Commit 207cf344 by 墨竹

fix:去除无效好办2.0引用

parent ac556257
package com.gic.haoban.manage.api.enums;
/**
* Created by hua on 2018/7/18.
*/
public enum StatusEnum {
ALL(-1),
DEL(0),
NORMAL(1),
Preview(2);
private int value;
StatusEnum(int value) {
this.value = value;
}
public int getValue() {
return value;
}
public void setValue(int value) {
this.value = value;
}
}
...@@ -115,11 +115,7 @@ ...@@ -115,11 +115,7 @@
<artifactId>haoban-contacts-manage-api</artifactId> <artifactId>haoban-contacts-manage-api</artifactId>
<version>${haoban-contacts-manage-api}</version> <version>${haoban-contacts-manage-api}</version>
</dependency> </dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>haoban-auth-api</artifactId>
<version>${haoban-auth-api}</version>
</dependency>
<dependency> <dependency>
<groupId>com.gic</groupId> <groupId>com.gic</groupId>
<artifactId>haoban-operation-api</artifactId> <artifactId>haoban-operation-api</artifactId>
...@@ -141,41 +137,19 @@ ...@@ -141,41 +137,19 @@
<artifactId>gic-thirdparty-api</artifactId> <artifactId>gic-thirdparty-api</artifactId>
<version>${gic-thirdparty-api}</version> <version>${gic-thirdparty-api}</version>
</dependency> </dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>haoban-message-api</artifactId>
<version>${haoban-message-api}</version>
</dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>haoban-app-announcement-api</artifactId>
<version>${haoban-app-announcement-api}</version>
</dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>haoban-communicate-api</artifactId>
<version>${haoban-communicate-api}</version>
</dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>haoban-mobile-app-api</artifactId>
<version>${haoban-mobile-app-api}</version>
</dependency>
<dependency> <dependency>
<groupId>com.gic</groupId> <groupId>com.gic</groupId>
<artifactId>gic-thirdparty-sdk</artifactId> <artifactId>gic-thirdparty-sdk</artifactId>
<version>${gic-thirdparty-sdk}</version> <version>${gic-thirdparty-sdk}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.gic.operation</groupId> <groupId>com.gic.operation</groupId>
<artifactId>gic-operation-api</artifactId> <artifactId>gic-operation-api</artifactId>
<version>${gic-operation-api}</version> <version>${gic-operation-api}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.gic</groupId> <groupId>com.gic</groupId>
<artifactId>gic-enterprise-api</artifactId> <artifactId>gic-enterprise-api</artifactId>
...@@ -204,6 +178,7 @@ ...@@ -204,6 +178,7 @@
<artifactId>sharing-core-api</artifactId> <artifactId>sharing-core-api</artifactId>
<version>${sharing-core-api}</version> <version>${sharing-core-api}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.gic</groupId> <groupId>com.gic</groupId>
<artifactId>haoban-app-customer-api</artifactId> <artifactId>haoban-app-customer-api</artifactId>
......
package com.gic.haoban.manage.web.controller; package com.gic.haoban.manage.web.controller;
import com.gic.haoban.auth.api.dto.DisplayRelationShortInfoDTO;
import com.gic.haoban.auth.api.dto.UserRightDetailDTO;
import com.gic.haoban.common.utils.AuthRequestUtil;
import com.gic.haoban.common.utils.HaobanResponse; import com.gic.haoban.common.utils.HaobanResponse;
import com.gic.haoban.manage.web.errCode.HaoBanErrCode; import com.gic.haoban.manage.web.errCode.HaoBanErrCode;
import org.apache.commons.collections.CollectionUtils;
import java.util.ArrayList;
import java.util.List;
/** /**
* Created 2018/7/18. * Created 2018/7/18.
...@@ -41,38 +34,5 @@ public class WebBaseController { ...@@ -41,38 +34,5 @@ public class WebBaseController {
response.setErrorCode(errCode.getCode()); response.setErrorCode(errCode.getCode());
return response; return response;
} }
/**
* 获取登陆信息
*
* @return
*/
protected UserRightDetailDTO getLoginUser() {
return (UserRightDetailDTO) AuthRequestUtil.getSessionUser();
}
public boolean haveRight(List<DisplayRelationShortInfoDTO> list){
List<String> groupList = new ArrayList<String>();
List<String> storeList = new ArrayList<String>();
List<String> clerkList = new ArrayList<String>();
if(list==null){
return false;
}
for(DisplayRelationShortInfoDTO showDto :list){
if(showDto.getGroupId()!=null){
groupList.add(showDto.getGroupId());
}
if(showDto.getStoreId()!=null){
storeList.add(showDto.getStoreId());
}
if(showDto.getClerkId()!=null){
clerkList.add(showDto.getClerkId());
}
}
if(CollectionUtils.isEmpty(groupList) && CollectionUtils.isEmpty(storeList) && CollectionUtils.isEmpty(clerkList)){
return false;
}
return true;
}
} }
package com.gic.haoban.manage.web.response;
import com.gic.haoban.auth.api.dto.MenuRightDTO;
import java.io.Serializable;
import java.util.List;
/**
* Created 2018/12/27.
*
* @author hua
*/
public class MenuDetailResponse implements Serializable {
private MenuRightDTO top;
private List<MenuRightDTO> leftMenu;
private MenuRightDTO current;
public MenuRightDTO getTop() {
return top;
}
public void setTop(MenuRightDTO top) {
this.top = top;
}
public List<MenuRightDTO> getLeftMenu() {
return leftMenu;
}
public void setLeftMenu(List<MenuRightDTO> leftMenu) {
this.leftMenu = leftMenu;
}
public MenuRightDTO getCurrent() {
return current;
}
public void setCurrent(MenuRightDTO current) {
this.current = current;
}
}
package com.gic.haoban.manage.web.response;
import com.gic.haoban.auth.api.dto.MenuRightInfoDTO;
import com.gic.haoban.auth.api.dto.RoleDTO;
import java.io.Serializable;
import java.util.List;
/**
* Created 2018/12/17.
*
* @author hua
*/
public class RoleDetailResponse implements Serializable {
public RoleDTO role;
public List<MenuRightInfoDTO> menuRightList;
public RoleDTO getRole() {
return role;
}
public void setRole(RoleDTO role) {
this.role = role;
}
public List<MenuRightInfoDTO> getMenuRightList() {
return menuRightList;
}
public void setMenuRightList(List<MenuRightInfoDTO> menuRightList) {
this.menuRightList = menuRightList;
}
}
\ No newline at end of file
...@@ -46,12 +46,12 @@ ...@@ -46,12 +46,12 @@
<groupId>com.gic</groupId> <groupId>com.gic</groupId>
<artifactId>haoban-common</artifactId> <artifactId>haoban-common</artifactId>
<version>${haoban-common}</version> <version>${haoban-common}</version>
<exclusions> <exclusions>
<exclusion> <exclusion>
<artifactId>log4j</artifactId> <artifactId>log4j</artifactId>
<groupId>log4j</groupId> <groupId>log4j</groupId>
</exclusion> </exclusion>
</exclusions> </exclusions>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.gic</groupId> <groupId>com.gic</groupId>
...@@ -78,22 +78,7 @@ ...@@ -78,22 +78,7 @@
<artifactId>haoban-task-api</artifactId> <artifactId>haoban-task-api</artifactId>
<version>${haoban-task-api}</version> <version>${haoban-task-api}</version>
</dependency> </dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>haoban-contacts-api</artifactId>
<version>${haoban-contacts-api}</version>
</dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>haoban-contacts-manage-api</artifactId>
<version>${haoban-contacts-manage-api}</version>
</dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>haoban-auth-api</artifactId>
<version>${haoban-auth-api}</version>
</dependency>
<dependency> <dependency>
<groupId>com.gic</groupId> <groupId>com.gic</groupId>
<artifactId>gic-enterprise-api</artifactId> <artifactId>gic-enterprise-api</artifactId>
...@@ -106,34 +91,28 @@ ...@@ -106,34 +91,28 @@
</exclusions> </exclusions>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.gic</groupId> <groupId>com.gic</groupId>
<artifactId>haoban-communicate-api</artifactId> <artifactId>haoban-communicate-api</artifactId>
<version>${haoban-communicate-api}</version> <version>${haoban-communicate-api}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.gic</groupId> <groupId>com.gic</groupId>
<artifactId>haoban-message-api</artifactId> <artifactId>gic-wechat-api</artifactId>
<version>${haoban-message-api}</version> <version>${gic-wechat-api}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.gic</groupId>
<artifactId>gic-wechat-api</artifactId>
<version>${gic-wechat-api}</version>
</dependency>
<dependency>
<groupId>com.gic</groupId> <groupId>com.gic</groupId>
<artifactId>gic-clerk-api</artifactId> <artifactId>gic-clerk-api</artifactId>
<version>${gic-clerk-api}</version> <version>${gic-clerk-api}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.gic</groupId> <groupId>com.gic</groupId>
<artifactId>gic-search-engine-api</artifactId> <artifactId>gic-search-engine-api</artifactId>
<version>${gic-search-engine-api}</version> <version>${gic-search-engine-api}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.gic</groupId> <groupId>com.gic</groupId>
<artifactId>gic-member-api</artifactId> <artifactId>gic-member-api</artifactId>
...@@ -147,7 +126,7 @@ ...@@ -147,7 +126,7 @@
<version>${gic-thirdparty-api}</version> <version>${gic-thirdparty-api}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.gic</groupId> <groupId>com.gic</groupId>
<artifactId>haoban-app-customer-api</artifactId> <artifactId>haoban-app-customer-api</artifactId>
<version>${haoban-app-customer-api}</version> <version>${haoban-app-customer-api}</version>
...@@ -169,9 +148,9 @@ ...@@ -169,9 +148,9 @@
<version>5.5.1</version> <version>5.5.1</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.gic</groupId> <groupId>com.gic</groupId>
<artifactId>sql-check-sdk</artifactId> <artifactId>sql-check-sdk</artifactId>
<version>${sql-check-sdk}</version> <version>${sql-check-sdk}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.gic</groupId> <groupId>com.gic</groupId>
...@@ -180,7 +159,7 @@ ...@@ -180,7 +159,7 @@
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
</dependencies> </dependencies>
<build> <build>
<finalName>haoban-manage3-service</finalName> <finalName>haoban-manage3-service</finalName>
<plugins> <plugins>
...@@ -233,6 +212,6 @@ ...@@ -233,6 +212,6 @@
</executions> </executions>
</plugin> </plugin>
</plugins> </plugins>
</build> </build>
</project> </project>
package com.gic.haoban.manage.service.service.out.impl; package com.gic.haoban.manage.service.service.out.impl;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
import com.gic.haoban.manage.api.enums.*;
import com.gic.haoban.manage.api.util.notify.NoticeMessageUtil;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.gic.api.base.commons.Page; import com.gic.api.base.commons.Page;
import com.gic.clerk.api.dto.ClerkDTO; import com.gic.clerk.api.dto.ClerkDTO;
...@@ -30,208 +16,201 @@ import com.gic.haoban.base.api.common.BasePageInfo; ...@@ -30,208 +16,201 @@ import com.gic.haoban.base.api.common.BasePageInfo;
import com.gic.haoban.common.utils.PageUtil; import com.gic.haoban.common.utils.PageUtil;
import com.gic.haoban.common.utils.UuidUtil; import com.gic.haoban.common.utils.UuidUtil;
import com.gic.haoban.communicate.api.service.SyncHaobanToGicServiceApi; import com.gic.haoban.communicate.api.service.SyncHaobanToGicServiceApi;
import com.gic.haoban.manage.api.dto.AuditDTO; import com.gic.haoban.manage.api.dto.*;
import com.gic.haoban.manage.api.dto.AuditStaffDTO; import com.gic.haoban.manage.api.enums.*;
import com.gic.haoban.manage.api.dto.BatchAuditLogDTO;
import com.gic.haoban.manage.api.dto.EnterpriseDetailDTO;
import com.gic.haoban.manage.api.dto.StaffClerkRelationDTO;
import com.gic.haoban.manage.api.dto.StaffDepartmentRelatedDTO;
import com.gic.haoban.manage.api.dto.StoreAddressDTO;
import com.gic.haoban.manage.api.service.AuditApiService; import com.gic.haoban.manage.api.service.AuditApiService;
import com.gic.haoban.manage.api.service.StaffClerkRelationApiService; import com.gic.haoban.manage.api.service.StaffClerkRelationApiService;
import com.gic.haoban.manage.api.service.StaffDepartmentRelatedApiService; import com.gic.haoban.manage.api.service.StaffDepartmentRelatedApiService;
import com.gic.haoban.manage.api.service.WxEnterpriseRelatedApiService; import com.gic.haoban.manage.api.service.WxEnterpriseRelatedApiService;
import com.gic.haoban.manage.service.config.Config; import com.gic.haoban.manage.api.util.notify.NoticeMessageUtil;
import com.gic.haoban.manage.service.dao.mapper.DepartmentMapper;
import com.gic.haoban.manage.service.dao.mapper.StaffMapper; import com.gic.haoban.manage.service.dao.mapper.StaffMapper;
import com.gic.haoban.manage.service.dao.mapper.TabHaobanAuditMapper; import com.gic.haoban.manage.service.dao.mapper.TabHaobanAuditMapper;
import com.gic.haoban.manage.service.dao.mapper.TabHaobanBatchAuditLogMapper; import com.gic.haoban.manage.service.dao.mapper.TabHaobanBatchAuditLogMapper;
import com.gic.haoban.manage.service.dao.mapper.WxEnterpriseMapper;
import com.gic.haoban.manage.service.entity.TabHaobanAudit; import com.gic.haoban.manage.service.entity.TabHaobanAudit;
import com.gic.haoban.manage.service.entity.TabHaobanBatchAuditLog; import com.gic.haoban.manage.service.entity.TabHaobanBatchAuditLog;
import com.gic.haoban.manage.service.entity.TabHaobanDepartment;
import com.gic.haoban.manage.service.entity.TabHaobanStaff; import com.gic.haoban.manage.service.entity.TabHaobanStaff;
import com.gic.haoban.manage.service.entity.TabHaobanWxEnterprise;
import com.gic.wechat.api.dto.qywx.ItemDTO;
import com.gic.wechat.api.dto.qywx.QywxXcxSendMessageDTO;
import com.gic.wechat.api.service.qywx.QywxSuiteApiService;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
/** /**
* Created by tgs on 2020/2/9. * Created by tgs on 2020/2/9.
*/ */
@Service @Service
public class AuditApiServiceImpl implements AuditApiService{ public class AuditApiServiceImpl implements AuditApiService {
private static final Logger logger = LoggerFactory.getLogger(AuditApiServiceImpl.class); private static final Logger logger = LoggerFactory.getLogger(AuditApiServiceImpl.class);
@Autowired @Autowired
private TabHaobanAuditMapper auditMapper; private TabHaobanAuditMapper auditMapper;
@Autowired @Autowired
private DepartmentMapper departmentMapper; private StaffMapper staffMapper;
@Autowired @Autowired
private StaffMapper staffMapper; private StoreService storeService;
@Autowired @Autowired
private StoreService storeService; private TabHaobanBatchAuditLogMapper tabHaobanBatchAuditLogMapper;
@Autowired @Autowired
private QywxSuiteApiService qywxSuiteApiService; private StaffDepartmentRelatedApiService staffDepartmentRelatedApiService;
@Autowired @Autowired
private Config config; private EnterpriseService enterpriseService;
@Autowired @Autowired
private WxEnterpriseMapper wxEnterpriseMapper; private SyncHaobanToGicServiceApi syncHaobanToGicServiceApi;
@Autowired @Autowired
private TabHaobanBatchAuditLogMapper tabHaobanBatchAuditLogMapper; private StaffClerkRelationApiService staffClerkRelationApiService;
@Autowired @Autowired
private StaffDepartmentRelatedApiService staffDepartmentRelatedApiService; private ClerkService clerkService;
@Autowired @Autowired
private EnterpriseService enterpriseService; private WxEnterpriseRelatedApiService wxEnterpriseRelatedApiService;
@Autowired
private SyncHaobanToGicServiceApi syncHaobanToGicServiceApi;
@Autowired @Override
private StaffClerkRelationApiService staffClerkRelationApiService; public Page<AuditDTO> page(Integer auditType, String search, String wxEnterpriseId,
@Autowired String enterpriseId, Integer auditStatus, Integer auditFlag, BasePageInfo pageInfo) {
private ClerkService clerkService; //部门关联表修改,服务层调整
@Autowired List<String> departmentIds = new ArrayList<>();
private WxEnterpriseRelatedApiService wxEnterpriseRelatedApiService; List<String> staffIds = new ArrayList<>();
@Override List<String> storeIds = new ArrayList<>();
public Page<AuditDTO> page(Integer auditType, String search,String wxEnterpriseId, if (StringUtils.isNotEmpty(search)) {
String enterpriseId,Integer auditStatus,Integer auditFlag, BasePageInfo pageInfo) { //获取企业列表
//部门关联表修改,服务层调整 List<String> enterpriseIds = new ArrayList<>();
List<String> departmentIds = new ArrayList<>(); if (StringUtils.isEmpty(enterpriseId)) {
List<String> staffIds = new ArrayList<>(); List<EnterpriseDetailDTO> enterprises = wxEnterpriseRelatedApiService.listEnterpriseByWxEnterpriseId(wxEnterpriseId);
List<String> storeIds = new ArrayList<>(); if (CollectionUtil.isNotEmpty(enterprises)) {
if(StringUtils.isNotEmpty(search)){ List<String> searchEnterpriseIds = enterprises.stream().map(s -> s.getEnterpriseId()).collect(Collectors.toList());
//获取企业列表 enterpriseIds.addAll(searchEnterpriseIds);
List<String> enterpriseIds = new ArrayList<>(); }
if(StringUtils.isEmpty(enterpriseId)){ } else {
List<EnterpriseDetailDTO> enterprises = wxEnterpriseRelatedApiService.listEnterpriseByWxEnterpriseId(wxEnterpriseId); enterpriseIds.add(enterpriseId);
if(CollectionUtil.isNotEmpty(enterprises)){ }
List<String> searchEnterpriseIds = enterprises.stream().map(s->s.getEnterpriseId()).collect(Collectors.toList()); //调gic接口查storeIds
enterpriseIds.addAll(searchEnterpriseIds); String[] strArray = new String[enterpriseIds.size()];
} enterpriseIds.toArray(strArray);
}else{
enterpriseIds.add(enterpriseId); List<StoreVo> list = storeService.queryStoreByName(strArray, search);
} if (CollectionUtil.isNotEmpty(list)) {
//调gic接口查storeIds List<String> storeIds1 = list.stream().map(s -> s.getStoreId()).collect(Collectors.toList());
String[] strArray = new String[enterpriseIds.size()]; storeIds.addAll(storeIds1);
enterpriseIds.toArray(strArray); }
//模糊查staffName
List<StoreVo> list = storeService.queryStoreByName(strArray,search); List<TabHaobanStaff> staffList = staffMapper.listLikeName(search);
if(CollectionUtil.isNotEmpty(list)){ if (CollectionUtil.isNotEmpty(staffList)) {
List<String> storeIds1 = list.stream().map(s->s.getStoreId()).collect(Collectors.toList()); List<String> staffIds2 = staffList.stream().map(s -> s.getStaffId()).collect(Collectors.toList());
storeIds.addAll(storeIds1); staffIds.addAll(staffIds2);
} }
//模糊查staffName if (CollectionUtil.isEmpty(staffIds)) {
List<TabHaobanStaff> staffList = staffMapper.listLikeName(search); staffIds.add("-999");
if(CollectionUtil.isNotEmpty(staffList)){ }
List<String> staffIds2 = staffList.stream().map(s->s.getStaffId()).collect(Collectors.toList()); if (CollectionUtil.isEmpty(storeIds)) {
staffIds.addAll(staffIds2); storeIds.add("-999");
} }
if(CollectionUtil.isEmpty(staffIds)){ }
staffIds.add("-999"); PageHelper.startPage(pageInfo.getPageNum(), pageInfo.getPageSize());
} com.github.pagehelper.Page<TabHaobanAudit> page = new com.github.pagehelper.Page<TabHaobanAudit>();
if(CollectionUtil.isEmpty(storeIds)){ if (CollectionUtil.isNotEmpty(storeIds) && CollectionUtil.isNotEmpty(staffIds)) {
storeIds.add("-999"); page = auditMapper.pageForStoreIdsAndstaffIds(auditType, storeIds, staffIds, wxEnterpriseId, enterpriseId, auditStatus, auditFlag);
} } else {
} page = auditMapper.page(auditType, storeIds, staffIds, wxEnterpriseId, enterpriseId, auditStatus, auditFlag);
PageHelper.startPage(pageInfo.getPageNum(), pageInfo.getPageSize()); }
com.github.pagehelper.Page<TabHaobanAudit> page = new com.github.pagehelper.Page<TabHaobanAudit>(); if (CollectionUtil.isNotEmpty(page.getResult())) {
if(CollectionUtil.isNotEmpty(storeIds)&&CollectionUtil.isNotEmpty(staffIds)){ List<String> commitStaffIds = page.getResult().stream().map(s -> s.getCommitStaffId()).collect(Collectors.toList());
page = auditMapper.pageForStoreIdsAndstaffIds(auditType, storeIds, staffIds, wxEnterpriseId,enterpriseId,auditStatus,auditFlag); List<TabHaobanStaff> staffList = staffMapper.listByIds(commitStaffIds);
}else{ Map<String, TabHaobanStaff> map = com.gic.commons.util.CollectionUtil.toMap(staffList, "staffId");
page = auditMapper.page(auditType, storeIds, staffIds, wxEnterpriseId,enterpriseId,auditStatus,auditFlag); for (TabHaobanAudit tab : page.getResult()) {
} String commitStaffId = tab.getCommitStaffId();
if(CollectionUtil.isNotEmpty( page.getResult())){ tab.setCommitStaffName(map.get(commitStaffId) == null ? "" : map.get(commitStaffId).getStaffName());
List<String> commitStaffIds = page.getResult().stream().map(s->s.getCommitStaffId()).collect(Collectors.toList()); tab.setCommitStaffImg(map.get(commitStaffId) == null ? "" : map.get(commitStaffId).getHeadImg());
List<TabHaobanStaff> staffList = staffMapper.listByIds(commitStaffIds); }
Map<String,TabHaobanStaff> map = com.gic.commons.util.CollectionUtil.toMap(staffList, "staffId"); }
for(TabHaobanAudit tab: page.getResult()){ return PageUtil.changePageHelperToCurrentPage(page, AuditDTO.class);
String commitStaffId = tab.getCommitStaffId(); }
tab.setCommitStaffName(map.get(commitStaffId)==null?"":map.get(commitStaffId).getStaffName());
tab.setCommitStaffImg(map.get(commitStaffId)==null?"":map.get(commitStaffId).getHeadImg()); @Transactional
} @Override
} public String audit(String batchId, String auditId, String auditName, String optStaffId) {
return PageUtil.changePageHelperToCurrentPage( page,AuditDTO.class); TabHaobanAudit tab = auditMapper.selectByPrimaryKey(auditId);
} if (tab == null) {
@Transactional return "审核项目不存在";
@Override }
public String audit(String batchId,String auditId,String auditName,String optStaffId) { int auditType = tab.getAuditType();
TabHaobanAudit tab = auditMapper.selectByPrimaryKey(auditId); tab.setAuditId(auditId);
if(tab==null){ tab.setUpdateTime(new Date());
return "审核项目不存在"; tab.setAuditName(auditName);
} tab.setAuditStaffId(optStaffId);
int auditType = tab.getAuditType(); if (auditType == AuditType.STORE_CHANGE.getCode()) {
tab.setAuditId(auditId); //门店信息变更
tab.setUpdateTime(new Date()); String storeId = tab.getCommitStoreId();
tab.setAuditName(auditName); String oldValue = tab.getOldValue();
tab.setAuditStaffId(optStaffId); String newValue = tab.getNewValue();
if(auditType == AuditType.STORE_CHANGE.getCode()){ String changeField = tab.getChangeField();
//门店信息变更
String storeId = tab.getCommitStoreId();
String oldValue = tab.getOldValue();
String newValue = tab.getNewValue();
String changeField = tab.getChangeField();
StoreDTO store = storeService.getStore(storeId); StoreDTO store = storeService.getStore(storeId);
if (store == null) { if (store == null) {
return "门店不存在"; return "门店不存在";
} }
this.editStoreInfo(storeId, changeField, oldValue, newValue); this.editStoreInfo(storeId, changeField, oldValue, newValue);
//发送消息 //发送消息
String title = "门店信息修改通知"; String title = "门店信息修改通知";
String content = StoreFieldEnum.getValueName(changeField); String content = StoreFieldEnum.getValueName(changeField);
content = "["+content+"]"+"修改审核通过"; content = "[" + content + "]" + "修改审核通过";
TabHaobanAudit tab2 = auditMapper.selectByPrimaryKey(auditId); TabHaobanAudit tab2 = auditMapper.selectByPrimaryKey(auditId);
String staffId = tab2.getCommitStaffId(); String staffId = tab2.getCommitStaffId();
// this.sendMessageByStaffId(staffId, storeId, title, content); // this.sendMessageByStaffId(staffId, storeId, title, content);
//插入log //插入log
if(org.apache.commons.lang.StringUtils.isNotBlank(batchId)){ if (org.apache.commons.lang.StringUtils.isNotBlank(batchId)) {
insertBatchLog( batchId,AuditRsultType.success.getCode(), tab); insertBatchLog(batchId, AuditRsultType.success.getCode(), tab);
} }
this.sendMessageByStaffId(staffId, storeId, false, content, ""); this.sendMessageByStaffId(staffId, storeId, false, content, "");
} else if (auditType == AuditType.CLERK_BIND.getCode()) { } else if (auditType == AuditType.CLERK_BIND.getCode()) {
//门店导购绑定 //门店导购绑定
String oldValue = tab.getOldValue(); String oldValue = tab.getOldValue();
AuditStaffDTO obj = JSONObject.parseObject(oldValue,AuditStaffDTO.class); AuditStaffDTO obj = JSONObject.parseObject(oldValue, AuditStaffDTO.class);
StaffClerkRelationDTO staffClerkRelation = staffClerkRelationApiService.getByCodeAndEnterpriseId(obj.getClerkCode(),tab.getEnterpriseId()); StaffClerkRelationDTO staffClerkRelation = staffClerkRelationApiService.getByCodeAndEnterpriseId(obj.getClerkCode(), tab.getEnterpriseId());
String staffId = obj.getStaffId(); String staffId = obj.getStaffId();
String storeId = tab.getCommitStoreId(); String storeId = tab.getCommitStoreId();
StaffClerkRelationDTO have = staffClerkRelationApiService.getOneByStoreIdAndStaffId(storeId, staffId); StaffClerkRelationDTO have = staffClerkRelationApiService.getOneByStoreIdAndStaffId(storeId, staffId);
if(have !=null){ if (have != null) {
tab.setAuditStatus(5); tab.setAuditStatus(5);
tab.setAuditReason("该成员在该门店下已经绑定过一个导购了"); tab.setAuditReason("该成员在该门店下已经绑定过一个导购了");
auditMapper.updateByPrimaryKeySelective(tab); auditMapper.updateByPrimaryKeySelective(tab);
if(org.apache.commons.lang.StringUtils.isNotBlank(batchId)){ if (org.apache.commons.lang.StringUtils.isNotBlank(batchId)) {
insertBatchLog( batchId,AuditRsultType.fail.getCode(),tab); insertBatchLog(batchId, AuditRsultType.fail.getCode(), tab);
} }
staffDepartmentRelatedApiService.sendBindAuditMessage(auditId, obj.getStaffId(), obj.getClerkId(), tab.getAuditReason(), true); staffDepartmentRelatedApiService.sendBindAuditMessage(auditId, obj.getStaffId(), obj.getClerkId(), tab.getAuditReason(), true);
return "该成员在该门店下已经绑定过一个导购了"; return "该成员在该门店下已经绑定过一个导购了";
} }
ClerkDTO clerkDTO = clerkService.getClerkByClerkId(obj.getClerkId()); ClerkDTO clerkDTO = clerkService.getClerkByClerkId(obj.getClerkId());
if(clerkDTO == null){ if (clerkDTO == null) {
tab.setAuditStatus(5); tab.setAuditStatus(5);
tab.setAuditReason("gic已删除该导购"); tab.setAuditReason("gic已删除该导购");
auditMapper.updateByPrimaryKeySelective(tab); auditMapper.updateByPrimaryKeySelective(tab);
if(org.apache.commons.lang.StringUtils.isNotBlank(batchId)){ if (org.apache.commons.lang.StringUtils.isNotBlank(batchId)) {
insertBatchLog( batchId,AuditRsultType.fail.getCode(),tab); insertBatchLog(batchId, AuditRsultType.fail.getCode(), tab);
} }
staffDepartmentRelatedApiService.sendBindAuditMessage(auditId, obj.getStaffId(), obj.getClerkId(), tab.getAuditReason(), true); staffDepartmentRelatedApiService.sendBindAuditMessage(auditId, obj.getStaffId(), obj.getClerkId(), tab.getAuditReason(), true);
return "gic已删除该导购"; return "gic已删除该导购";
}else{ } else {
if(staffClerkRelation == null){ if (staffClerkRelation == null) {
staffClerkRelation = new StaffClerkRelationDTO(); staffClerkRelation = new StaffClerkRelationDTO();
} }
staffClerkRelation.setEnterpriseId(tab.getEnterpriseId()); staffClerkRelation.setEnterpriseId(tab.getEnterpriseId());
staffClerkRelation.setClerkCode(obj.getClerkCode()); staffClerkRelation.setClerkCode(obj.getClerkCode());
staffClerkRelation.setClerkId(obj.getClerkId()); staffClerkRelation.setClerkId(obj.getClerkId());
staffClerkRelation.setStoreId(tab.getCommitStoreId()); staffClerkRelation.setStoreId(tab.getCommitStoreId());
staffClerkRelation.setWxEnterpriseId(tab.getWxEnterpriseId()); staffClerkRelation.setWxEnterpriseId(tab.getWxEnterpriseId());
staffClerkRelation.setWxUserId(obj.getWxUserId()); staffClerkRelation.setWxUserId(obj.getWxUserId());
staffClerkRelation.setStaffId(obj.getStaffId()); staffClerkRelation.setStaffId(obj.getStaffId());
staffClerkRelationApiService.delAndInsert(staffClerkRelation,optStaffId, ChannelCodeEnum.AUDIT_BIND.getCode()); staffClerkRelationApiService.delAndInsert(staffClerkRelation, optStaffId, ChannelCodeEnum.AUDIT_BIND.getCode());
} }
if(org.apache.commons.lang.StringUtils.isNotBlank(batchId)){ if (org.apache.commons.lang.StringUtils.isNotBlank(batchId)) {
insertBatchLog( batchId,AuditRsultType.success.getCode(), tab); insertBatchLog(batchId, AuditRsultType.success.getCode(), tab);
} }
//同意绑定 //同意绑定
staffDepartmentRelatedApiService.sendBindAuditMessage(auditId, obj.getStaffId(), obj.getClerkId(), "", false); staffDepartmentRelatedApiService.sendBindAuditMessage(auditId, obj.getStaffId(), obj.getClerkId(), "", false);
...@@ -239,65 +218,66 @@ public class AuditApiServiceImpl implements AuditApiService{ ...@@ -239,65 +218,66 @@ public class AuditApiServiceImpl implements AuditApiService{
} else if (auditType == AuditType.CLERK_ADD.getCode()) { } else if (auditType == AuditType.CLERK_ADD.getCode()) {
//门店导购新增 //门店导购新增
String oldValue = tab.getOldValue(); String oldValue = tab.getOldValue();
AuditStaffDTO obj = JSONObject.parseObject(oldValue,AuditStaffDTO.class); AuditStaffDTO obj = JSONObject.parseObject(oldValue, AuditStaffDTO.class);
String flag = syncHaobanToGicServiceApi.syncClerkToGicClerkAddNew(tab.getCommitStoreId(), obj.getClerkCode(), obj.getSex(), obj.getClerkName(), obj.getPhoneNumber(), obj.getNationCode(), null); String flag = syncHaobanToGicServiceApi.syncClerkToGicClerkAddNew(tab.getCommitStoreId(), obj.getClerkCode(), obj.getSex(), obj.getClerkName(), obj.getPhoneNumber(), obj.getNationCode(), null);
if(!"1".equals(flag)){ if (!"1".equals(flag)) {
//失败 //失败
tab.setAuditStatus(5); tab.setAuditStatus(5);
tab.setAuditReason(flag); tab.setAuditReason(flag);
auditMapper.updateByPrimaryKeySelective(tab); auditMapper.updateByPrimaryKeySelective(tab);
if(org.apache.commons.lang.StringUtils.isNotBlank(batchId)){ if (org.apache.commons.lang.StringUtils.isNotBlank(batchId)) {
insertBatchLog( batchId,AuditRsultType.fail.getCode(), tab); insertBatchLog(batchId, AuditRsultType.fail.getCode(), tab);
} }
return flag; return flag;
}else{ } else {
//成功 //成功
if(org.apache.commons.lang.StringUtils.isNotBlank(batchId)){ if (org.apache.commons.lang.StringUtils.isNotBlank(batchId)) {
insertBatchLog( batchId,1, tab); insertBatchLog(batchId, 1, tab);
} }
staffDepartmentRelatedApiService.sendClerkAdd(obj.getClerkName(), obj.getClerkCode(),tab.getCommitStoreId(), 1, ""); staffDepartmentRelatedApiService.sendClerkAdd(obj.getClerkName(), obj.getClerkCode(), tab.getCommitStoreId(), 1, "");
} }
}else if(auditType == AuditType.CLERK_DEL.getCode()){ } else if (auditType == AuditType.CLERK_DEL.getCode()) {
//门店导购删除 //门店导购删除
String oldValue = tab.getOldValue(); String oldValue = tab.getOldValue();
AuditStaffDTO obj = JSONObject.parseObject(oldValue,AuditStaffDTO.class); AuditStaffDTO obj = JSONObject.parseObject(oldValue, AuditStaffDTO.class);
syncHaobanToGicServiceApi.delGicClerk(obj.getClerkId()); syncHaobanToGicServiceApi.delGicClerk(obj.getClerkId());
if(org.apache.commons.lang.StringUtils.isNotBlank(batchId)){ if (org.apache.commons.lang.StringUtils.isNotBlank(batchId)) {
insertBatchLog( batchId,AuditRsultType.success.getCode(),tab); insertBatchLog(batchId, AuditRsultType.success.getCode(), tab);
} }
//解绑日志 //解绑日志
StaffClerkRelationDTO relationDTO = staffClerkRelationApiService.getByClerkId(obj.getClerkId()); StaffClerkRelationDTO relationDTO = staffClerkRelationApiService.getByClerkId(obj.getClerkId());
if (null != relationDTO) { if (null != relationDTO) {
staffClerkRelationApiService.pushToBindLog(relationDTO.getStaffId(),optStaffId,BindTypeEnum.UNBIND.getVal(),ChannelCodeEnum.SELF_UNBIND.getCode(),relationDTO.getStaffClerkRelationId()); staffClerkRelationApiService.pushToBindLog(relationDTO.getStaffId(), optStaffId, BindTypeEnum.UNBIND.getVal(), ChannelCodeEnum.SELF_UNBIND.getCode(), relationDTO.getStaffClerkRelationId());
} }
staffClerkRelationApiService.delByClerkId(obj.getClerkId()); staffClerkRelationApiService.delByClerkId(obj.getClerkId());
staffDepartmentRelatedApiService.sendClerkDel(obj.getClerkName(), obj.getClerkCode(),tab.getCommitStoreId(), 1, ""); staffDepartmentRelatedApiService.sendClerkDel(obj.getClerkName(), obj.getClerkCode(), tab.getCommitStoreId(), 1, "");
}else if(auditType == AuditType.CLERK_UNBIND.getCode()){ } else if (auditType == AuditType.CLERK_UNBIND.getCode()) {
//解绑申请,无需审核,直接通过 //解绑申请,无需审核,直接通过
} }
tab.setAuditStatus(1); tab.setAuditStatus(1);
auditMapper.updateByPrimaryKeySelective(tab); auditMapper.updateByPrimaryKeySelective(tab);
return ""; return "";
} }
@Override
public void refuse(String auditId, String auditReason,String auditStaffId,String auditName) { @Override
TabHaobanAudit tab = new TabHaobanAudit(); public void refuse(String auditId, String auditReason, String auditStaffId, String auditName) {
tab.setAuditId(auditId); TabHaobanAudit tab = new TabHaobanAudit();
tab.setAuditStatus(2); tab.setAuditId(auditId);
tab.setUpdateTime(new Date()); tab.setAuditStatus(2);
tab.setAuditReason(auditReason); tab.setUpdateTime(new Date());
tab.setAuditName(auditName); tab.setAuditReason(auditReason);
tab.setAuditStaffId(auditStaffId); tab.setAuditName(auditName);
auditMapper.updateByPrimaryKeySelective(tab); tab.setAuditStaffId(auditStaffId);
TabHaobanAudit tab2 = auditMapper.selectByPrimaryKey(auditId); auditMapper.updateByPrimaryKeySelective(tab);
int auditType = tab2.getAuditType(); TabHaobanAudit tab2 = auditMapper.selectByPrimaryKey(auditId);
String oldValue = tab2.getOldValue(); int auditType = tab2.getAuditType();
String enterpriseId = tab2.getEnterpriseId(); String oldValue = tab2.getOldValue();
//发送消息 String enterpriseId = tab2.getEnterpriseId();
if(auditType == AuditType.STORE_CHANGE.getCode()){ //发送消息
String changeField = tab2.getChangeField(); if (auditType == AuditType.STORE_CHANGE.getCode()) {
String changeField = tab2.getChangeField();
// String title = "门店信息修改通知"; // String title = "门店信息修改通知";
String content = StoreFieldEnum.getValueName(changeField); String content = StoreFieldEnum.getValueName(changeField);
// content = "["+content+"]"+"被拒绝。拒绝理由:"+auditReason; // content = "["+content+"]"+"被拒绝。拒绝理由:"+auditReason;
...@@ -306,126 +286,128 @@ public class AuditApiServiceImpl implements AuditApiService{ ...@@ -306,126 +286,128 @@ public class AuditApiServiceImpl implements AuditApiService{
this.sendMessageByStaffId(staffId, storeId, true, content, auditReason); this.sendMessageByStaffId(staffId, storeId, true, content, auditReason);
}else if(auditType == AuditType.CLERK_BIND.getCode()){ } else if (auditType == AuditType.CLERK_BIND.getCode()) {
AuditStaffDTO obj = JSONObject.parseObject(oldValue,AuditStaffDTO.class); AuditStaffDTO obj = JSONObject.parseObject(oldValue, AuditStaffDTO.class);
String staffId = tab2.getCommitStaffId(); String staffId = tab2.getCommitStaffId();
staffDepartmentRelatedApiService.sendBindAuditMessage(auditId, staffId, obj.getClerkId(), auditReason, true); staffDepartmentRelatedApiService.sendBindAuditMessage(auditId, staffId, obj.getClerkId(), auditReason, true);
// staffDepartmentRelatedApiService.sendStaffBind(obj.getStaffId(), obj.getClerkCode(), tab2.getCommitStoreId(), 2, auditReason); // staffDepartmentRelatedApiService.sendStaffBind(obj.getStaffId(), obj.getClerkCode(), tab2.getCommitStoreId(), 2, auditReason);
} else if (auditType == AuditType.CLERK_ADD.getCode()) { } else if (auditType == AuditType.CLERK_ADD.getCode()) {
AuditStaffDTO obj = JSONObject.parseObject(oldValue,AuditStaffDTO.class); AuditStaffDTO obj = JSONObject.parseObject(oldValue, AuditStaffDTO.class);
staffDepartmentRelatedApiService.sendClerkAdd(obj.getClerkName(), obj.getClerkCode(),tab2.getCommitStoreId(), 2, auditReason); staffDepartmentRelatedApiService.sendClerkAdd(obj.getClerkName(), obj.getClerkCode(), tab2.getCommitStoreId(), 2, auditReason);
}else if(auditType == AuditType.CLERK_DEL.getCode()) { } else if (auditType == AuditType.CLERK_DEL.getCode()) {
AuditStaffDTO obj = JSONObject.parseObject(oldValue,AuditStaffDTO.class); AuditStaffDTO obj = JSONObject.parseObject(oldValue, AuditStaffDTO.class);
staffDepartmentRelatedApiService.sendClerkDel(obj.getClerkName(), obj.getClerkCode(),tab2.getCommitStoreId(), 2, auditReason); staffDepartmentRelatedApiService.sendClerkDel(obj.getClerkName(), obj.getClerkCode(), tab2.getCommitStoreId(), 2, auditReason);
} }
} }
@Override
public int save(Integer auditType,String wxEnterpriseId, String enterpriseId, @Override
String commitStaffId, String commitStoreId, String changeField, public int save(Integer auditType, String wxEnterpriseId, String enterpriseId,
String oldValue, String newValue) { String commitStaffId, String commitStoreId, String changeField,
TabHaobanStaff staff = staffMapper.selectByPrimaryKey(commitStaffId); String oldValue, String newValue) {
if(staff == null){ TabHaobanStaff staff = staffMapper.selectByPrimaryKey(commitStaffId);
return 0; if (staff == null) {
} return 0;
TabHaobanAudit tab = new TabHaobanAudit(); }
tab.setAuditId(UuidUtil.randomUUID()); TabHaobanAudit tab = new TabHaobanAudit();
tab.setAuditStatus(0); tab.setAuditId(UuidUtil.randomUUID());
tab.setAuditType(auditType); tab.setAuditStatus(0);
tab.setChangeField(changeField); tab.setAuditType(auditType);
tab.setCommitName(null); tab.setChangeField(changeField);
tab.setCommitStaffId(commitStaffId); tab.setCommitName(null);
tab.setCommitStaffImg(staff.getHeadImg()); tab.setCommitStaffId(commitStaffId);
tab.setCommitStaffName(staff.getStaffName()); tab.setCommitStaffImg(staff.getHeadImg());
tab.setCommitStoreId(commitStoreId); tab.setCommitStaffName(staff.getStaffName());
tab.setCommitTime(new Date()); tab.setCommitStoreId(commitStoreId);
tab.setCreateTime(new Date()); tab.setCommitTime(new Date());
tab.setWxEnterpriseId(wxEnterpriseId); tab.setCreateTime(new Date());
tab.setEnterpriseId(enterpriseId); tab.setWxEnterpriseId(wxEnterpriseId);
tab.setNewValue(newValue); tab.setEnterpriseId(enterpriseId);
tab.setOldValue(oldValue); tab.setNewValue(newValue);
tab.setStatusFlag(1); tab.setOldValue(oldValue);
tab.setUpdateTime(new Date()); tab.setStatusFlag(1);
return auditMapper.insertSelective(tab); tab.setUpdateTime(new Date());
} return auditMapper.insertSelective(tab);
@Override }
public void editStoreInfo(String storeId, String changeField,
String oldValue, String newValue) { @Override
logger.info("===================进11"); public void editStoreInfo(String storeId, String changeField,
StoreDTO store = storeService.getStore(storeId); String oldValue, String newValue) {
if(!StoreFieldEnum.STORE_IMAG.getValue().equals(changeField)){ logger.info("===================进11");
//非门店图片修改 StoreDTO store = storeService.getStore(storeId);
logger.info("===================进222"); if (!StoreFieldEnum.STORE_IMAG.getValue().equals(changeField)) {
StoreDetailDTO detailDTO = new StoreDetailDTO(); //非门店图片修改
detailDTO = EntityUtil.changeEntityByJSON(StoreDetailDTO.class, store); logger.info("===================进222");
detailDTO.setStoreId(storeId); StoreDetailDTO detailDTO = new StoreDetailDTO();
detailDTO.setEnterpriseId(store.getEnterpriseId()); detailDTO = EntityUtil.changeEntityByJSON(StoreDetailDTO.class, store);
detailDTO.setStatus(2); detailDTO.setStoreId(storeId);
detailDTO.setOpenTime(null); detailDTO.setEnterpriseId(store.getEnterpriseId());
detailDTO.setCloseTime(null); detailDTO.setStatus(2);
getStoreDTO( detailDTO, changeField, oldValue, newValue); detailDTO.setOpenTime(null);
detailDTO.setCloseTime(null);
logger.info("detailDTO====================>为{}",JSONObject.toJSONString(detailDTO)); getStoreDTO(detailDTO, changeField, oldValue, newValue);
storeService.saveStore(detailDTO);
logger.info("detailDTO====================>为{}", JSONObject.toJSONString(detailDTO));
storeService.saveStore(detailDTO);
// storeService.saveOrUpdateStore(store); // storeService.saveOrUpdateStore(store);
}else{ } else {
//门店图片修改 //门店图片修改
logger.info("===================进333"); logger.info("===================进333");
storeService.updateStorePhotos(storeId, newValue); storeService.updateStorePhotos(storeId, newValue);
} }
} }
void getStoreDTO(StoreDetailDTO store,String changeField,String oldValue,String newValue){
logger.info("==========================>changeField={}",changeField); void getStoreDTO(StoreDetailDTO store, String changeField, String oldValue, String newValue) {
if(StoreFieldEnum.BUSINESS_TIME_STRING.getValue().equals(changeField)){ logger.info("==========================>changeField={}", changeField);
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm"); if (StoreFieldEnum.BUSINESS_TIME_STRING.getValue().equals(changeField)) {
//营业时间 SimpleDateFormat sdf = new SimpleDateFormat("HH:mm");
String [] newValues = newValue.split("-"); //营业时间
String openTime = newValues[0]; String[] newValues = newValue.split("-");
String closeTime = newValues[1]; String openTime = newValues[0];
store.setOpenTime(openTime); String closeTime = newValues[1];
store.setCloseTime(closeTime); store.setOpenTime(openTime);
}else if(StoreFieldEnum.CONACTS_PHONE.getValue().equals(changeField)){ store.setCloseTime(closeTime);
//联系电话 } else if (StoreFieldEnum.CONACTS_PHONE.getValue().equals(changeField)) {
store.setConactsPhone(newValue); //联系电话
}else if(StoreFieldEnum.STORE_ADDRESS.getValue().equals(changeField)){ store.setConactsPhone(newValue);
logger.info("==========================>进来333"); } else if (StoreFieldEnum.STORE_ADDRESS.getValue().equals(changeField)) {
//门店地址 logger.info("==========================>进来333");
StoreAddressDTO obj = JSONObject.parseObject(newValue,StoreAddressDTO.class); //门店地址
String areaId = obj.getAreaId(); StoreAddressDTO obj = JSONObject.parseObject(newValue, StoreAddressDTO.class);
String storeAddress = obj.getStoreAddress(); String areaId = obj.getAreaId();
logger.info("==========================>areaId={},storeAddress={},newValue={}",areaId,storeAddress,newValue); String storeAddress = obj.getStoreAddress();
String[] arr = storeAddress.split(" "); logger.info("==========================>areaId={},storeAddress={},newValue={}", areaId, storeAddress, newValue);
store.setAreaId(areaId); String[] arr = storeAddress.split(" ");
store.setFullArea(arr[0]); store.setAreaId(areaId);
//避免多个空格造成数据混乱 store.setFullArea(arr[0]);
store.setStoreAddress(storeAddress.substring(storeAddress.indexOf(arr[0])+arr[0].length()+1)); //避免多个空格造成数据混乱
}else if(StoreFieldEnum.STORE_AREA.getValue().equals(changeField)){ store.setStoreAddress(storeAddress.substring(storeAddress.indexOf(arr[0]) + arr[0].length() + 1));
//门店面积 } else if (StoreFieldEnum.STORE_AREA.getValue().equals(changeField)) {
store.setStoreArea(Double.parseDouble(newValue)); //门店面积
}else if(StoreFieldEnum.STORE_NAME.getValue().equals(changeField)){ store.setStoreArea(Double.parseDouble(newValue));
//门店名字 } else if (StoreFieldEnum.STORE_NAME.getValue().equals(changeField)) {
store.setStoreName(newValue); //门店名字
// TabHaobanDepartment tab = departmentMapper.getByRelatedId(store.getStoreId()); store.setStoreName(newValue);
// tab.setDepartmentName(newValue); } else if (StoreFieldEnum.STORE_IMAG.getValue().equals(changeField)) {
// departmentMapper.updateByPrimaryKey(tab); //门店图片
}else if(StoreFieldEnum.STORE_IMAG.getValue().equals(changeField)){ }
//门店图片 }
}
} @Override
@Override public List<AuditDTO> listByStoreId(String storeId) {
public List<AuditDTO> listByStoreId(String storeId) { List<TabHaobanAudit> list = auditMapper.listByStoreId(storeId);
List<TabHaobanAudit> list = auditMapper.listByStoreId(storeId); List<AuditDTO> resultList = EntityUtil.changeEntityListByJSON(AuditDTO.class, list);
List<AuditDTO> resultList = EntityUtil.changeEntityListByJSON(AuditDTO.class, list); return resultList;
return resultList; }
}
@Override @Override
public AuditDTO findByStoreIdAndChangeField(String storeId, public AuditDTO findByStoreIdAndChangeField(String storeId,
String changeField) { String changeField) {
TabHaobanAudit tab = auditMapper.findByStoreIdAndChangeField(storeId,changeField); TabHaobanAudit tab = auditMapper.findByStoreIdAndChangeField(storeId, changeField);
if(tab == null){ if (tab == null) {
return null; return null;
} }
return EntityUtil.changeEntityByJSON(AuditDTO.class, tab); return EntityUtil.changeEntityByJSON(AuditDTO.class, tab);
} }
private void sendMessageByStaffId(String staffId, String storeId, boolean isRefuse, String content, String reason) { private void sendMessageByStaffId(String staffId, String storeId, boolean isRefuse, String content, String reason) {
...@@ -475,14 +457,14 @@ public class AuditApiServiceImpl implements AuditApiService{ ...@@ -475,14 +457,14 @@ public class AuditApiServiceImpl implements AuditApiService{
if (staffClerkRelationDTO == null) { if (staffClerkRelationDTO == null) {
logger.info("staff不存在"); logger.info("staff不存在");
return; return;
} }
Map<String, String> params = new HashMap<String, String>(); Map<String, String> params = new HashMap<String, String>();
params.put("field", content); params.put("field", content);
params.put("reason", reason); params.put("reason", reason);
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
jsonObject.put("storeId", storeId); jsonObject.put("storeId", storeId);
if (isRefuse) { if (isRefuse) {
NoticeMessageUtil.sendNoticeMessage(staffClerkRelationDTO.getEnterpriseId(), staffClerkRelationDTO.getClerkId() NoticeMessageUtil.sendNoticeMessage(staffClerkRelationDTO.getEnterpriseId(), staffClerkRelationDTO.getClerkId()
...@@ -495,66 +477,72 @@ public class AuditApiServiceImpl implements AuditApiService{ ...@@ -495,66 +477,72 @@ public class AuditApiServiceImpl implements AuditApiService{
} }
@Override @Override
public void insert(AuditDTO audit) { public void insert(AuditDTO audit) {
audit.setAuditId(com.gic.haoban.common.utils.StringUtil.randomUUID()); audit.setAuditId(com.gic.haoban.common.utils.StringUtil.randomUUID());
audit.setCreateTime(new Date()); audit.setCreateTime(new Date());
audit.setUpdateTime(new Date()); audit.setUpdateTime(new Date());
auditMapper.insertSelective(EntityUtil.changeEntityByJSON(TabHaobanAudit.class, audit)); auditMapper.insertSelective(EntityUtil.changeEntityByJSON(TabHaobanAudit.class, audit));
} }
@Override
public Page<AuditDTO> listByStaffId(String staffId, Integer auditType,Integer auditStatus,BasePageInfo pageInfo) { @Override
PageHelper.startPage(pageInfo.getPageNum(), pageInfo.getPageSize()); public Page<AuditDTO> listByStaffId(String staffId, Integer auditType, Integer auditStatus, BasePageInfo pageInfo) {
return PageUtil.changePageHelperToCurrentPage(auditMapper.listByStaffId(staffId,auditType,auditStatus),AuditDTO.class); PageHelper.startPage(pageInfo.getPageNum(), pageInfo.getPageSize());
} return PageUtil.changePageHelperToCurrentPage(auditMapper.listByStaffId(staffId, auditType, auditStatus), AuditDTO.class);
@Override }
public Page<AuditDTO> pageStoreListByParams(String storeId, BasePageInfo pageInfo, Integer auditType,
Integer auditStatus) { @Override
PageHelper.startPage(pageInfo.getPageNum(), pageInfo.getPageSize()); public Page<AuditDTO> pageStoreListByParams(String storeId, BasePageInfo pageInfo, Integer auditType,
return PageUtil.changePageHelperToCurrentPage(auditMapper.pageStoreListByParams(storeId,auditType,auditStatus),AuditDTO.class); Integer auditStatus) {
} PageHelper.startPage(pageInfo.getPageNum(), pageInfo.getPageSize());
return PageUtil.changePageHelperToCurrentPage(auditMapper.pageStoreListByParams(storeId, auditType, auditStatus), AuditDTO.class);
public void insertBatchLog(String batchId,int auditResult,TabHaobanAudit tab){ }
EnterpriseDTO enterprise = enterpriseService.getEnterpriseById(tab.getEnterpriseId());
TabHaobanBatchAuditLog batTab = new TabHaobanBatchAuditLog(); public void insertBatchLog(String batchId, int auditResult, TabHaobanAudit tab) {
batTab.setAuditId(tab.getAuditId()); EnterpriseDTO enterprise = enterpriseService.getEnterpriseById(tab.getEnterpriseId());
batTab.setBatchAuditLogId(UuidUtil.randomUUID()); TabHaobanBatchAuditLog batTab = new TabHaobanBatchAuditLog();
batTab.setAuditType(tab.getAuditType()); batTab.setAuditId(tab.getAuditId());
batTab.setAuditResult(auditResult); batTab.setBatchAuditLogId(UuidUtil.randomUUID());
batTab.setBatchId(batchId); batTab.setAuditType(tab.getAuditType());
batTab.setCommitName(tab.getCommitStaffName()); batTab.setAuditResult(auditResult);
batTab.setCommitTime(tab.getCommitTime()); batTab.setBatchId(batchId);
batTab.setCreateTime(new Date()); batTab.setCommitName(tab.getCommitStaffName());
batTab.setEnterpriseName(enterprise == null ?"":enterprise.getEnterpriseName()); batTab.setCommitTime(tab.getCommitTime());
batTab.setStatus(1); batTab.setCreateTime(new Date());
batTab.setUpdateTime(new Date()); batTab.setEnterpriseName(enterprise == null ? "" : enterprise.getEnterpriseName());
tabHaobanBatchAuditLogMapper.insert(batTab); batTab.setStatus(1);
} batTab.setUpdateTime(new Date());
tabHaobanBatchAuditLogMapper.insert(batTab);
@Override }
public AuditDTO findById(String auditId) {
return EntityUtil.changeEntityByJSON(AuditDTO.class, auditMapper.selectByPrimaryKey(auditId)); @Override
} public AuditDTO findById(String auditId) {
@Override return EntityUtil.changeEntityByJSON(AuditDTO.class, auditMapper.selectByPrimaryKey(auditId));
public void update(AuditDTO audit) { }
audit.setUpdateTime(new Date());
auditMapper.updateByPrimaryKeySelective(EntityUtil.changeEntityByJSON(TabHaobanAudit.class, audit)); @Override
} public void update(AuditDTO audit) {
@Override audit.setUpdateTime(new Date());
public List<BatchAuditLogDTO> listBatchLog(String batchId) { auditMapper.updateByPrimaryKeySelective(EntityUtil.changeEntityByJSON(TabHaobanAudit.class, audit));
List<TabHaobanBatchAuditLog > list = tabHaobanBatchAuditLogMapper.listByBatchId(batchId); }
return EntityUtil.changeEntityListByJSON(BatchAuditLogDTO.class, list);
} @Override
@Override public List<BatchAuditLogDTO> listBatchLog(String batchId) {
public AuditDTO findByBindRelatedIdAndAuditType(String relatedId, List<TabHaobanBatchAuditLog> list = tabHaobanBatchAuditLogMapper.listByBatchId(batchId);
int auditType) { return EntityUtil.changeEntityListByJSON(BatchAuditLogDTO.class, list);
TabHaobanAudit tab = auditMapper.findByBindRelatedIdAndAuditType(relatedId, auditType); }
return EntityUtil.changeEntityByJSON(AuditDTO.class, tab);
} @Override
@Override public AuditDTO findByBindRelatedIdAndAuditType(String relatedId,
public boolean judgeHavePhoneNumberOrCode(String enterpriseId, int auditType) {
String clerkCode, String phoneNumber) { TabHaobanAudit tab = auditMapper.findByBindRelatedIdAndAuditType(relatedId, auditType);
List<TabHaobanAudit> list = auditMapper.judgeHavePhoneNumberOrCode(enterpriseId,clerkCode,phoneNumber); return EntityUtil.changeEntityByJSON(AuditDTO.class, tab);
return !CollectionUtil.isEmpty(list); }
}
@Override
public boolean judgeHavePhoneNumberOrCode(String enterpriseId,
String clerkCode, String phoneNumber) {
List<TabHaobanAudit> list = auditMapper.judgeHavePhoneNumberOrCode(enterpriseId, clerkCode, phoneNumber);
return !CollectionUtil.isEmpty(list);
}
} }
package com.gic.haoban.manage.service.service.out.impl; package com.gic.haoban.manage.service.service.out.impl;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import com.gic.haoban.base.api.common.Constant;
import com.gic.haoban.base.api.common.ServiceResponse;
import com.gic.haoban.manage.api.dto.*;
import com.gic.haoban.manage.api.enums.SecretTypeEnum;
import com.gic.haoban.manage.api.service.StaffApiService;
import com.gic.haoban.manage.api.service.StaffDepartmentRelatedApiService;
import com.gic.haoban.manage.service.service.*;
import com.gic.redis.data.anno.RedisCache;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.gic.api.base.commons.JSONResponse; import com.gic.api.base.commons.JSONResponse;
import com.gic.api.base.commons.Page; import com.gic.api.base.commons.Page;
import com.gic.commons.util.EntityUtil; import com.gic.commons.util.EntityUtil;
...@@ -39,19 +13,34 @@ import com.gic.enterprise.api.dto.StoreGroupDTO; ...@@ -39,19 +13,34 @@ import com.gic.enterprise.api.dto.StoreGroupDTO;
import com.gic.enterprise.api.service.StoreGroupService; import com.gic.enterprise.api.service.StoreGroupService;
import com.gic.enterprise.api.service.StoreService; import com.gic.enterprise.api.service.StoreService;
import com.gic.haoban.base.api.common.BasePageInfo; import com.gic.haoban.base.api.common.BasePageInfo;
import com.gic.haoban.base.api.common.Constant;
import com.gic.haoban.base.api.common.ServiceResponse;
import com.gic.haoban.common.utils.PageUtil; import com.gic.haoban.common.utils.PageUtil;
import com.gic.haoban.common.utils.StringUtil; import com.gic.haoban.common.utils.StringUtil;
import com.gic.haoban.contacts.manage.api.dto.SyncJsonColumnDTO; import com.gic.haoban.manage.api.dto.*;
import com.gic.haoban.manage.api.enums.SecretTypeEnum;
import com.gic.haoban.manage.api.service.DepartmentApiService; import com.gic.haoban.manage.api.service.DepartmentApiService;
import com.gic.haoban.manage.api.service.StaffApiService;
import com.gic.haoban.manage.api.service.StaffDepartmentRelatedApiService;
import com.gic.haoban.manage.service.dao.mapper.DepartmentMapper; import com.gic.haoban.manage.service.dao.mapper.DepartmentMapper;
import com.gic.haoban.manage.service.entity.TabHaobanDepartment; import com.gic.haoban.manage.service.entity.TabHaobanDepartment;
import com.gic.haoban.manage.service.entity.TabHaobanStaffDepartmentRelated; import com.gic.haoban.manage.service.entity.TabHaobanStaffDepartmentRelated;
import com.gic.haoban.manage.service.entity.TabHaobanSyncErrorLog; import com.gic.haoban.manage.service.entity.TabHaobanSyncErrorLog;
import com.gic.haoban.manage.service.entity.TabHaobanWxEnterpriseRelated; import com.gic.haoban.manage.service.service.*;
import com.gic.haoban.manage.service.task.RouterConstant; import com.gic.haoban.manage.service.task.RouterConstant;
import com.gic.redis.data.util.RedisUtil; import com.gic.redis.data.util.RedisUtil;
import com.gic.wechat.api.service.qywx.QywxDepartmentApiService; import com.gic.wechat.api.service.qywx.QywxDepartmentApiService;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
@Service @Service
public class DepartmentApiServiceImpl implements DepartmentApiService { public class DepartmentApiServiceImpl implements DepartmentApiService {
......
...@@ -10,26 +10,19 @@ import com.gic.commons.util.EntityUtil; ...@@ -10,26 +10,19 @@ import com.gic.commons.util.EntityUtil;
import com.gic.commons.util.GICMQClientUtil; import com.gic.commons.util.GICMQClientUtil;
import com.gic.dubbo.entity.ProviderLocalTag; import com.gic.dubbo.entity.ProviderLocalTag;
import com.gic.haoban.base.api.common.ServiceResponse; import com.gic.haoban.base.api.common.ServiceResponse;
import com.gic.haoban.contacts.manage.api.enums.StatusEnum;
import com.gic.haoban.manage.api.dto.FlushStoreMqDTO; import com.gic.haoban.manage.api.dto.FlushStoreMqDTO;
import com.gic.haoban.manage.api.dto.StaffClerkBindLogInfoDTO;
import com.gic.haoban.manage.api.dto.StaffClerkRelationDTO; import com.gic.haoban.manage.api.dto.StaffClerkRelationDTO;
import com.gic.haoban.manage.api.enums.ChannelCodeEnum; import com.gic.haoban.manage.api.enums.ChannelCodeEnum;
import com.gic.haoban.manage.api.enums.StatusEnum;
import com.gic.haoban.manage.api.service.StaffClerkRelationApiService; import com.gic.haoban.manage.api.service.StaffClerkRelationApiService;
import com.gic.haoban.manage.api.service.WxEnterpriseRelatedApiService; import com.gic.haoban.manage.api.service.WxEnterpriseRelatedApiService;
import com.gic.haoban.manage.service.pojo.BinlogBasePojo; import com.gic.haoban.manage.service.pojo.BinlogBasePojo;
import com.gic.haoban.manage.service.pojo.ClerkSyncPojo; import com.gic.haoban.manage.service.pojo.ClerkSyncPojo;
import com.gic.haoban.manage.service.pojo.GroupSyncPojo; import com.gic.haoban.manage.service.pojo.GroupSyncPojo;
import com.gic.haoban.manage.service.pojo.StoreSyncPojo; import com.gic.haoban.manage.service.pojo.StoreSyncPojo;
import com.gic.haoban.manage.service.service.StaffClerkBindLogService;
import com.gic.haoban.manage.service.service.StaffClerkRelationService; import com.gic.haoban.manage.service.service.StaffClerkRelationService;
import com.gic.haoban.manage.service.service.StoreRangeService; import com.gic.haoban.manage.service.service.StoreRangeService;
import com.gic.haoban.task.api.dto.MqMessageQo; import com.gic.haoban.task.api.dto.MqMessageQo;
import com.gic.mq.sdk.exception.RouterException;
import com.gic.qcloud.cmq.CMQClientException;
import com.gic.qcloud.cmq.CMQServerException;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.time.DateUtils; import org.apache.commons.lang3.time.DateUtils;
import org.apache.kafka.clients.consumer.ConsumerRecord; import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.slf4j.Logger; import org.slf4j.Logger;
...@@ -58,9 +51,6 @@ public class KafkaMessageServiceImpl implements MessageListener<String, GicRecor ...@@ -58,9 +51,6 @@ public class KafkaMessageServiceImpl implements MessageListener<String, GicRecor
private StaffClerkRelationService staffClerkRelationService; private StaffClerkRelationService staffClerkRelationService;
@Autowired @Autowired
private StaffClerkBindLogService staffClerkBindLogService;
@Autowired
private StaffClerkRelationApiService staffClerkRelationApiService; private StaffClerkRelationApiService staffClerkRelationApiService;
@Autowired @Autowired
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent> <parent>
<groupId>com.gic</groupId> <groupId>com.gic</groupId>
<artifactId>gic-pom-base</artifactId> <artifactId>gic-pom-base</artifactId>
<version>3.0-SNAPSHOT</version> <version>3.0-SNAPSHOT</version>
<relativePath/> <relativePath/>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>haoban-manage3-web</artifactId> <artifactId>haoban-manage3-web</artifactId>
<version>${libraryVersion}</version> <version>${libraryVersion}</version>
<packaging>war</packaging> <packaging>war</packaging>
<name>haoban-manage3-web Maven Webapp</name> <name>haoban-manage3-web Maven Webapp</name>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<commonVersion>3.0-SNAPSHOT</commonVersion> <commonVersion>3.0-SNAPSHOT</commonVersion>
<libraryVersion>3.0-SNAPSHOT</libraryVersion> <libraryVersion>3.0-SNAPSHOT</libraryVersion>
</properties> </properties>
<dependencyManagement> <dependencyManagement>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.springframework</groupId> <groupId>org.springframework</groupId>
<artifactId>spring-framework-bom</artifactId> <artifactId>spring-framework-bom</artifactId>
<version>4.2.4.RELEASE</version> <version>4.2.4.RELEASE</version>
<type>pom</type> <type>pom</type>
<scope>import</scope> <scope>import</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.alibaba</groupId> <groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId> <artifactId>fastjson</artifactId>
<version>1.2.47</version> <version>1.2.47</version>
</dependency> </dependency>
</dependencies> </dependencies>
</dependencyManagement> </dependencyManagement>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>com.gic</groupId> <groupId>com.gic</groupId>
<artifactId>haoban-common</artifactId> <artifactId>haoban-common</artifactId>
<version>${haoban-common}</version> <version>${haoban-common}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.gic</groupId> <groupId>com.gic</groupId>
<artifactId>gic-base-api</artifactId> <artifactId>gic-base-api</artifactId>
<version>${gic-base-api}</version> <version>${gic-base-api}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
<artifactId>junit</artifactId> <artifactId>junit</artifactId>
<version>4.11</version> <version>4.11</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.session</groupId> <groupId>org.springframework.session</groupId>
<artifactId>spring-session-data-redis</artifactId> <artifactId>spring-session-data-redis</artifactId>
<version>1.2.1.RELEASE</version> <version>1.2.1.RELEASE</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>redis.clients</groupId> <groupId>redis.clients</groupId>
<artifactId>jedis</artifactId> <artifactId>jedis</artifactId>
<version>2.8.1</version> <version>2.8.1</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.gic</groupId> <groupId>com.gic</groupId>
<artifactId>gic-dict-api</artifactId> <artifactId>gic-dict-api</artifactId>
<version>${gic-dict-api}</version> <version>${gic-dict-api}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.gic</groupId> <groupId>com.gic</groupId>
<artifactId>gic-redis-data</artifactId> <artifactId>gic-redis-data</artifactId>
<version>${gic-redis-data}</version> <version>${gic-redis-data}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.gic</groupId> <groupId>com.gic</groupId>
<artifactId>gic-wechat-api</artifactId> <artifactId>gic-wechat-api</artifactId>
<version>${gic-wechat-api}</version> <version>${gic-wechat-api}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.gic</groupId> <groupId>com.gic</groupId>
<artifactId>gic-wechat-token-api</artifactId> <artifactId>gic-wechat-token-api</artifactId>
<version>${gic-wechat-token-api}</version> <version>${gic-wechat-token-api}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.gic</groupId> <groupId>com.gic</groupId>
<artifactId>gic-platform-config</artifactId> <artifactId>gic-platform-config</artifactId>
<version>${gic-platform-config}</version> <version>${gic-platform-config}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>net.sourceforge.jexcelapi</groupId> <groupId>net.sourceforge.jexcelapi</groupId>
<artifactId>jxl</artifactId> <artifactId>jxl</artifactId>
<version>2.6.12</version> <version>2.6.12</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.poi</groupId> <groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId> <artifactId>poi</artifactId>
<version>3.9</version> <version>3.9</version>
<exclusions> <exclusions>
<exclusion> <exclusion>
<groupId>commons-codec</groupId> <groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId> <artifactId>commons-codec</artifactId>
</exclusion> </exclusion>
</exclusions> </exclusions>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.poi</groupId> <groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId> <artifactId>poi-ooxml</artifactId>
<version>3.9</version> <version>3.9</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.poi</groupId> <groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml-schemas</artifactId> <artifactId>poi-ooxml-schemas</artifactId>
<version>3.9</version> <version>3.9</version>
</dependency> </dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>haoban-contacts-api</artifactId>
<version>${haoban-contacts-api}</version>
</dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>haoban-manage3-api</artifactId>
<version>${haoban-manage3-api}</version>
</dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>haoban-manage-api</artifactId>
<version>${haoban-manage-api}</version>
</dependency>
<dependency> <dependency>
<groupId>com.gic</groupId> <groupId>com.gic</groupId>
<artifactId>haoban-contacts-manage-api</artifactId> <artifactId>haoban-manage3-api</artifactId>
<version>${haoban-contacts-manage-api}</version> <version>${haoban-manage3-api}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.gic</groupId> <groupId>com.gic</groupId>
<artifactId>haoban-auth-api</artifactId> <artifactId>haoban-manage-api</artifactId>
<version>${haoban-auth-api}</version> <version>${haoban-manage-api}</version>
</dependency> </dependency>
<dependency>
<groupId>com.gic</groupId> <dependency>
<artifactId>haoban-operation-api</artifactId> <groupId>com.gic</groupId>
<version>${haoban-operation-api}</version> <artifactId>haoban-operation-api</artifactId>
</dependency> <version>${haoban-operation-api}</version>
<dependency> </dependency>
<groupId>com.gic</groupId> <dependency>
<artifactId>haoban-config</artifactId> <groupId>com.gic</groupId>
<version>${haoban-config}</version> <artifactId>haoban-config</artifactId>
</dependency> <version>${haoban-config}</version>
<dependency> </dependency>
<groupId>javax.servlet</groupId> <dependency>
<artifactId>javax.servlet-api</artifactId> <groupId>javax.servlet</groupId>
<version>3.1.0</version> <artifactId>javax.servlet-api</artifactId>
<scope>provided</scope> <version>3.1.0</version>
</dependency> <scope>provided</scope>
<dependency> </dependency>
<groupId>com.gic</groupId> <dependency>
<artifactId>gic-thirdparty-api</artifactId> <groupId>com.gic</groupId>
<version>${gic-thirdparty-api}</version> <artifactId>gic-thirdparty-api</artifactId>
</dependency> <version>${gic-thirdparty-api}</version>
<dependency> </dependency>
<groupId>com.gic</groupId>
<artifactId>haoban-message-api</artifactId>
<version>${haoban-message-api}</version>
</dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>haoban-app-announcement-api</artifactId>
<version>${haoban-app-announcement-api}</version>
</dependency>
<dependency> <dependency>
<groupId>com.gic</groupId> <groupId>com.gic</groupId>
<artifactId>haoban-communicate-api</artifactId> <artifactId>gic-thirdparty-sdk</artifactId>
<version>${haoban-communicate-api}</version> <version>${gic-thirdparty-sdk}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.gic</groupId> <groupId>com.gic</groupId>
<artifactId>haoban-mobile-app-api</artifactId> <artifactId>haoban-communicate-api</artifactId>
<version>${haoban-mobile-app-api}</version> <version>${haoban-communicate-api}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.gic</groupId> <groupId>com.gic.operation</groupId>
<artifactId>gic-thirdparty-sdk</artifactId> <artifactId>gic-operation-api</artifactId>
<version>${gic-thirdparty-sdk}</version> <version>${gic-operation-api}</version>
</dependency> </dependency>
<dependency>
<dependency>
<groupId>com.gic.operation</groupId>
<artifactId>gic-operation-api</artifactId>
<version>${gic-operation-api}</version>
</dependency>
<dependency>
<groupId>com.gic</groupId> <groupId>com.gic</groupId>
<artifactId>gic-enterprise-api</artifactId> <artifactId>gic-enterprise-api</artifactId>
<version>${gic-enterprise-api}</version> <version>${gic-enterprise-api}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.gic</groupId> <groupId>com.gic</groupId>
<artifactId>gic-clerk-api</artifactId> <artifactId>gic-clerk-api</artifactId>
<version>${gic-clerk-api}</version> <version>${gic-clerk-api}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.gic</groupId> <groupId>com.gic</groupId>
<artifactId>gic-quartz-api</artifactId> <artifactId>gic-quartz-api</artifactId>
<version>${gic-quartz-api}</version> <version>${gic-quartz-api}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.gic</groupId> <groupId>com.gic</groupId>
<artifactId>gic-cloud-data-api</artifactId> <artifactId>gic-cloud-data-api</artifactId>
<version>${gic-cloud-data-api}</version> <version>${gic-cloud-data-api}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.gic</groupId> <groupId>com.gic</groupId>
<artifactId>gic-cloud-web-service-api</artifactId> <artifactId>gic-cloud-web-service-api</artifactId>
<version>${gic-cloud-web-service-api}</version> <version>${gic-cloud-web-service-api}</version>
</dependency> </dependency>
</dependencies> </dependencies>
<build> <build>
<finalName>haoban-manage3-web</finalName> <finalName>haoban-manage3-web</finalName>
<plugins> <plugins>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<configuration> <configuration>
<encoding>UTF-8</encoding> <encoding>UTF-8</encoding>
<source>1.8</source> <source>1.8</source>
<target>1.8</target> <target>1.8</target>
</configuration> </configuration>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId> <artifactId>maven-dependency-plugin</artifactId>
<executions> <executions>
<execution> <execution>
<id>copy-dependencies</id> <id>copy-dependencies</id>
<phase>package</phase> <phase>package</phase>
<goals> <goals>
<goal>copy-dependencies</goal> <goal>copy-dependencies</goal>
</goals> </goals>
<configuration> <configuration>
<type>jar</type> <type>jar</type>
<includeTypes>jar</includeTypes> <includeTypes>jar</includeTypes>
<outputDirectory> <outputDirectory>
${project.build.directory}/lib ${project.build.directory}/lib
</outputDirectory> </outputDirectory>
</configuration> </configuration>
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.apache.tomcat.maven</groupId> <groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId> <artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version> <version>2.2</version>
<configuration> <configuration>
<path>/haoban-manage3-web</path> <path>/haoban-manage3-web</path>
<port>9907</port> <port>9907</port>
<uriEncoding>UTF-8</uriEncoding> <uriEncoding>UTF-8</uriEncoding>
</configuration> </configuration>
</plugin> </plugin>
</plugins> </plugins>
</build> </build>
</project> </project>
package com.gic.haoban.manage.web.controller; package com.gic.haoban.manage.web.controller;
import com.gic.haoban.auth.api.dto.DisplayRelationShortInfoDTO;
import com.gic.haoban.common.utils.AuthWebRequestUtil; import com.gic.haoban.common.utils.AuthWebRequestUtil;
import com.gic.haoban.common.utils.EntityUtil; import com.gic.haoban.common.utils.EntityUtil;
import com.gic.haoban.common.utils.HaobanResponse; import com.gic.haoban.common.utils.HaobanResponse;
import com.gic.haoban.manage.api.dto.LoginDTO; import com.gic.haoban.manage.api.dto.LoginDTO;
import com.gic.haoban.manage.web.errCode.HaoBanErrCode; import com.gic.haoban.manage.web.errCode.HaoBanErrCode;
import org.apache.commons.collections.CollectionUtils;
import java.util.ArrayList;
import java.util.List;
/** /**
* Created 2018/7/18. * Created 2018/7/18.
...@@ -54,24 +49,4 @@ public class WebBaseController { ...@@ -54,24 +49,4 @@ public class WebBaseController {
return EntityUtil.changeEntityByJSON(LoginDTO.class, AuthWebRequestUtil.getLoginUser()); return EntityUtil.changeEntityByJSON(LoginDTO.class, AuthWebRequestUtil.getLoginUser());
} }
public boolean haveRight(List<DisplayRelationShortInfoDTO> list) {
List<String> groupList = new ArrayList<String>();
List<String> storeList = new ArrayList<String>();
List<String> clerkList = new ArrayList<String>();
if (list == null) {
return false;
}
for (DisplayRelationShortInfoDTO showDto : list) {
if (showDto.getGroupId() != null) {
groupList.add(showDto.getGroupId());
}
if (showDto.getStoreId() != null) {
storeList.add(showDto.getStoreId());
}
if (showDto.getClerkId() != null) {
clerkList.add(showDto.getClerkId());
}
}
return !CollectionUtils.isEmpty(groupList) || !CollectionUtils.isEmpty(storeList) || !CollectionUtils.isEmpty(clerkList);
}
} }
package com.gic.haoban.manage.web.response;
import com.gic.haoban.auth.api.dto.MenuRightDTO;
import java.io.Serializable;
import java.util.List;
/**
* Created 2018/12/27.
*
* @author hua
*/
public class MenuDetailResponse implements Serializable {
private MenuRightDTO top;
private List<MenuRightDTO> leftMenu;
private MenuRightDTO current;
public MenuRightDTO getTop() {
return top;
}
public void setTop(MenuRightDTO top) {
this.top = top;
}
public List<MenuRightDTO> getLeftMenu() {
return leftMenu;
}
public void setLeftMenu(List<MenuRightDTO> leftMenu) {
this.leftMenu = leftMenu;
}
public MenuRightDTO getCurrent() {
return current;
}
public void setCurrent(MenuRightDTO current) {
this.current = current;
}
}
package com.gic.haoban.manage.web.response;
import com.gic.haoban.auth.api.dto.MenuRightInfoDTO;
import com.gic.haoban.auth.api.dto.RoleDTO;
import java.io.Serializable;
import java.util.List;
/**
* Created 2018/12/17.
*
* @author hua
*/
public class RoleDetailResponse implements Serializable {
public RoleDTO role;
public List<MenuRightInfoDTO> menuRightList;
public RoleDTO getRole() {
return role;
}
public void setRole(RoleDTO role) {
this.role = role;
}
public List<MenuRightInfoDTO> getMenuRightList() {
return menuRightList;
}
public void setMenuRightList(List<MenuRightInfoDTO> menuRightList) {
this.menuRightList = menuRightList;
}
}
\ No newline at end of file
package com.gic.haoban.manage.web.response;
import com.gic.haoban.manage.api.dto.EnterpriseDTO;
import java.io.Serializable;
import java.util.List;
/**
* Created 2018/12/28.
*
* @author hua
*/
public class WebLoginResponse implements Serializable {
private String userId;
private List<EnterpriseDTO> enterpriseList;
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public List<EnterpriseDTO> getEnterpriseList() {
return enterpriseList;
}
public void setEnterpriseList(List<EnterpriseDTO> enterpriseList) {
this.enterpriseList = enterpriseList;
}
}
...@@ -96,6 +96,4 @@ ...@@ -96,6 +96,4 @@
retries="0" check="false"/> retries="0" check="false"/>
</beans> </beans>
...@@ -14,10 +14,6 @@ ...@@ -14,10 +14,6 @@
<version>${libraryVersion}</version> <version>${libraryVersion}</version>
<packaging>war</packaging> <packaging>war</packaging>
<name>haoban-manage3-wx Maven Webapp</name>
<!-- FIXME change it to the project's website -->
<url>http://www.example.com</url>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<commonVersion>3.0-SNAPSHOT</commonVersion> <commonVersion>3.0-SNAPSHOT</commonVersion>
...@@ -103,24 +99,10 @@ ...@@ -103,24 +99,10 @@
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.gic</groupId> <groupId>com.gic</groupId>
<artifactId>haoban-contacts-api</artifactId>
<version>${haoban-contacts-api}</version>
</dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>haoban-manage3-api</artifactId> <artifactId>haoban-manage3-api</artifactId>
<version>${haoban-manage3-api}</version> <version>${haoban-manage3-api}</version>
</dependency> </dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>haoban-contacts-manage-api</artifactId>
<version>${haoban-contacts-manage-api}</version>
</dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>haoban-auth-api</artifactId>
<version>${haoban-auth-api}</version>
</dependency>
<dependency> <dependency>
<groupId>com.gic</groupId> <groupId>com.gic</groupId>
<artifactId>haoban-operation-api</artifactId> <artifactId>haoban-operation-api</artifactId>
...@@ -149,34 +131,15 @@ ...@@ -149,34 +131,15 @@
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.gic</groupId> <groupId>com.gic</groupId>
<artifactId>haoban-message-api</artifactId>
<version>${haoban-message-api}</version>
</dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>haoban-app-announcement-api</artifactId>
<version>${haoban-app-announcement-api}</version>
</dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>haoban-communicate-api</artifactId> <artifactId>haoban-communicate-api</artifactId>
<version>${haoban-communicate-api}</version> <version>${haoban-communicate-api}</version>
</dependency> </dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>haoban-mobile-app-api</artifactId>
<version>${haoban-mobile-app-api}</version>
</dependency>
<dependency> <dependency>
<groupId>com.gic</groupId> <groupId>com.gic</groupId>
<artifactId>gic-thirdparty-sdk</artifactId> <artifactId>gic-thirdparty-sdk</artifactId>
<version>${gic-thirdparty-sdk}</version> <version>${gic-thirdparty-sdk}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.gic.operation</groupId> <groupId>com.gic.operation</groupId>
<artifactId>gic-operation-api</artifactId> <artifactId>gic-operation-api</artifactId>
......
package com.gic.haoban.manage.web.controller; package com.gic.haoban.manage.web.controller;
import com.gic.haoban.auth.api.dto.DisplayRelationShortInfoDTO;
import com.gic.haoban.base.api.common.pojo.dto.WellDoneLoginDTO; import com.gic.haoban.base.api.common.pojo.dto.WellDoneLoginDTO;
import com.gic.haoban.common.utils.AuthRequestWellDoneUtil; import com.gic.haoban.common.utils.AuthRequestWellDoneUtil;
import com.gic.haoban.common.utils.HaobanResponse; import com.gic.haoban.common.utils.HaobanResponse;
import com.gic.haoban.manage.web.errCode.HaoBanErrCode; import com.gic.haoban.manage.web.errCode.HaoBanErrCode;
import org.apache.commons.collections.CollectionUtils;
import java.util.ArrayList;
import java.util.List;
/** /**
* Created 2018/7/18. * Created 2018/7/18.
...@@ -54,24 +48,4 @@ public class WebBaseController { ...@@ -54,24 +48,4 @@ public class WebBaseController {
return AuthRequestWellDoneUtil.getLoginUser(); return AuthRequestWellDoneUtil.getLoginUser();
} }
public boolean haveRight(List<DisplayRelationShortInfoDTO> list){
List<String> groupList = new ArrayList<String>();
List<String> storeList = new ArrayList<String>();
List<String> clerkList = new ArrayList<String>();
if(list==null){
return false;
}
for(DisplayRelationShortInfoDTO showDto :list){
if(showDto.getGroupId()!=null){
groupList.add(showDto.getGroupId());
}
if(showDto.getStoreId()!=null){
storeList.add(showDto.getStoreId());
}
if(showDto.getClerkId()!=null){
clerkList.add(showDto.getClerkId());
}
}
return !CollectionUtils.isEmpty(groupList) || !CollectionUtils.isEmpty(storeList) || !CollectionUtils.isEmpty(clerkList);
}
} }
package com.gic.haoban.manage.web.response;
import com.gic.haoban.auth.api.dto.MenuRightDTO;
import java.io.Serializable;
import java.util.List;
/**
* Created 2018/12/27.
*
* @author hua
*/
public class MenuDetailResponse implements Serializable {
private MenuRightDTO top;
private List<MenuRightDTO> leftMenu;
private MenuRightDTO current;
public MenuRightDTO getTop() {
return top;
}
public void setTop(MenuRightDTO top) {
this.top = top;
}
public List<MenuRightDTO> getLeftMenu() {
return leftMenu;
}
public void setLeftMenu(List<MenuRightDTO> leftMenu) {
this.leftMenu = leftMenu;
}
public MenuRightDTO getCurrent() {
return current;
}
public void setCurrent(MenuRightDTO current) {
this.current = current;
}
}
package com.gic.haoban.manage.web.response;
import com.gic.haoban.auth.api.dto.MenuRightInfoDTO;
import com.gic.haoban.auth.api.dto.RoleDTO;
import java.io.Serializable;
import java.util.List;
/**
* Created 2018/12/17.
*
* @author hua
*/
public class RoleDetailResponse implements Serializable {
public RoleDTO role;
public List<MenuRightInfoDTO> menuRightList;
public RoleDTO getRole() {
return role;
}
public void setRole(RoleDTO role) {
this.role = role;
}
public List<MenuRightInfoDTO> getMenuRightList() {
return menuRightList;
}
public void setMenuRightList(List<MenuRightInfoDTO> menuRightList) {
this.menuRightList = menuRightList;
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment