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 @@
<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>
<groupId>com.gic</groupId>
<artifactId>haoban-operation-api</artifactId>
......@@ -141,41 +137,19 @@
<artifactId>gic-thirdparty-api</artifactId>
<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>
<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>
<groupId>com.gic</groupId>
<artifactId>gic-thirdparty-sdk</artifactId>
<version>${gic-thirdparty-sdk}</version>
</dependency>
<dependency>
<groupId>com.gic.operation</groupId>
<artifactId>gic-operation-api</artifactId>
<version>${gic-operation-api}</version>
</dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>gic-enterprise-api</artifactId>
......@@ -204,6 +178,7 @@
<artifactId>sharing-core-api</artifactId>
<version>${sharing-core-api}</version>
</dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>haoban-app-customer-api</artifactId>
......
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.manage.web.errCode.HaoBanErrCode;
import org.apache.commons.collections.CollectionUtils;
import java.util.ArrayList;
import java.util.List;
/**
* Created 2018/7/18.
......@@ -41,38 +34,5 @@ public class WebBaseController {
response.setErrorCode(errCode.getCode());
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 @@
<groupId>com.gic</groupId>
<artifactId>haoban-common</artifactId>
<version>${haoban-common}</version>
<exclusions>
<exclusion>
<artifactId>log4j</artifactId>
<groupId>log4j</groupId>
</exclusion>
</exclusions>
<exclusions>
<exclusion>
<artifactId>log4j</artifactId>
<groupId>log4j</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.gic</groupId>
......@@ -78,22 +78,7 @@
<artifactId>haoban-task-api</artifactId>
<version>${haoban-task-api}</version>
</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>
<groupId>com.gic</groupId>
<artifactId>gic-enterprise-api</artifactId>
......@@ -106,34 +91,28 @@
</exclusions>
</dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>haoban-communicate-api</artifactId>
<version>${haoban-communicate-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>gic-wechat-api</artifactId>
<version>${gic-wechat-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>gic-wechat-api</artifactId>
<version>${gic-wechat-api}</version>
</dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>gic-clerk-api</artifactId>
<version>${gic-clerk-api}</version>
</dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>gic-search-engine-api</artifactId>
<version>${gic-search-engine-api}</version>
</dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>gic-member-api</artifactId>
......@@ -147,7 +126,7 @@
<version>${gic-thirdparty-api}</version>
</dependency>
<dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>haoban-app-customer-api</artifactId>
<version>${haoban-app-customer-api}</version>
......@@ -169,9 +148,9 @@
<version>5.5.1</version>
</dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>sql-check-sdk</artifactId>
<version>${sql-check-sdk}</version>
<groupId>com.gic</groupId>
<artifactId>sql-check-sdk</artifactId>
<version>${sql-check-sdk}</version>
</dependency>
<dependency>
<groupId>com.gic</groupId>
......@@ -180,7 +159,7 @@
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<finalName>haoban-manage3-service</finalName>
<plugins>
......@@ -233,6 +212,6 @@
</executions>
</plugin>
</plugins>
</build>
</project>
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 com.alibaba.fastjson.JSONObject;
import com.gic.api.base.commons.Page;
import com.gic.clerk.api.dto.ClerkDTO;
......@@ -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.UuidUtil;
import com.gic.haoban.communicate.api.service.SyncHaobanToGicServiceApi;
import com.gic.haoban.manage.api.dto.AuditDTO;
import com.gic.haoban.manage.api.dto.AuditStaffDTO;
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.dto.*;
import com.gic.haoban.manage.api.enums.*;
import com.gic.haoban.manage.api.service.AuditApiService;
import com.gic.haoban.manage.api.service.StaffClerkRelationApiService;
import com.gic.haoban.manage.api.service.StaffDepartmentRelatedApiService;
import com.gic.haoban.manage.api.service.WxEnterpriseRelatedApiService;
import com.gic.haoban.manage.service.config.Config;
import com.gic.haoban.manage.service.dao.mapper.DepartmentMapper;
import com.gic.haoban.manage.api.util.notify.NoticeMessageUtil;
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.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.TabHaobanBatchAuditLog;
import com.gic.haoban.manage.service.entity.TabHaobanDepartment;
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 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.
*/
@Service
public class AuditApiServiceImpl implements AuditApiService{
private static final Logger logger = LoggerFactory.getLogger(AuditApiServiceImpl.class);
@Autowired
private TabHaobanAuditMapper auditMapper;
@Autowired
private DepartmentMapper departmentMapper;
@Autowired
private StaffMapper staffMapper;
@Autowired
private StoreService storeService;
@Autowired
private QywxSuiteApiService qywxSuiteApiService;
@Autowired
private Config config;
@Autowired
private WxEnterpriseMapper wxEnterpriseMapper;
@Autowired
private TabHaobanBatchAuditLogMapper tabHaobanBatchAuditLogMapper;
@Autowired
private StaffDepartmentRelatedApiService staffDepartmentRelatedApiService;
@Autowired
private EnterpriseService enterpriseService;
@Autowired
private SyncHaobanToGicServiceApi syncHaobanToGicServiceApi;
@Autowired
private StaffClerkRelationApiService staffClerkRelationApiService;
@Autowired
private ClerkService clerkService;
@Autowired
private WxEnterpriseRelatedApiService wxEnterpriseRelatedApiService;
@Override
public Page<AuditDTO> page(Integer auditType, String search,String wxEnterpriseId,
String enterpriseId,Integer auditStatus,Integer auditFlag, BasePageInfo pageInfo) {
//部门关联表修改,服务层调整
List<String> departmentIds = new ArrayList<>();
List<String> staffIds = new ArrayList<>();
List<String> storeIds = new ArrayList<>();
if(StringUtils.isNotEmpty(search)){
//获取企业列表
List<String> enterpriseIds = new ArrayList<>();
if(StringUtils.isEmpty(enterpriseId)){
List<EnterpriseDetailDTO> enterprises = wxEnterpriseRelatedApiService.listEnterpriseByWxEnterpriseId(wxEnterpriseId);
if(CollectionUtil.isNotEmpty(enterprises)){
List<String> searchEnterpriseIds = enterprises.stream().map(s->s.getEnterpriseId()).collect(Collectors.toList());
enterpriseIds.addAll(searchEnterpriseIds);
}
}else{
enterpriseIds.add(enterpriseId);
}
//调gic接口查storeIds
String[] strArray = new String[enterpriseIds.size()];
enterpriseIds.toArray(strArray);
List<StoreVo> list = storeService.queryStoreByName(strArray,search);
if(CollectionUtil.isNotEmpty(list)){
List<String> storeIds1 = list.stream().map(s->s.getStoreId()).collect(Collectors.toList());
storeIds.addAll(storeIds1);
}
//模糊查staffName
List<TabHaobanStaff> staffList = staffMapper.listLikeName(search);
if(CollectionUtil.isNotEmpty(staffList)){
List<String> staffIds2 = staffList.stream().map(s->s.getStaffId()).collect(Collectors.toList());
staffIds.addAll(staffIds2);
}
if(CollectionUtil.isEmpty(staffIds)){
staffIds.add("-999");
}
if(CollectionUtil.isEmpty(storeIds)){
storeIds.add("-999");
}
}
PageHelper.startPage(pageInfo.getPageNum(), pageInfo.getPageSize());
com.github.pagehelper.Page<TabHaobanAudit> page = new com.github.pagehelper.Page<TabHaobanAudit>();
if(CollectionUtil.isNotEmpty(storeIds)&&CollectionUtil.isNotEmpty(staffIds)){
page = auditMapper.pageForStoreIdsAndstaffIds(auditType, storeIds, staffIds, wxEnterpriseId,enterpriseId,auditStatus,auditFlag);
}else{
page = auditMapper.page(auditType, storeIds, staffIds, wxEnterpriseId,enterpriseId,auditStatus,auditFlag);
}
if(CollectionUtil.isNotEmpty( page.getResult())){
List<String> commitStaffIds = page.getResult().stream().map(s->s.getCommitStaffId()).collect(Collectors.toList());
List<TabHaobanStaff> staffList = staffMapper.listByIds(commitStaffIds);
Map<String,TabHaobanStaff> map = com.gic.commons.util.CollectionUtil.toMap(staffList, "staffId");
for(TabHaobanAudit tab: page.getResult()){
String commitStaffId = tab.getCommitStaffId();
tab.setCommitStaffName(map.get(commitStaffId)==null?"":map.get(commitStaffId).getStaffName());
tab.setCommitStaffImg(map.get(commitStaffId)==null?"":map.get(commitStaffId).getHeadImg());
}
}
return PageUtil.changePageHelperToCurrentPage( page,AuditDTO.class);
}
@Transactional
@Override
public String audit(String batchId,String auditId,String auditName,String optStaffId) {
TabHaobanAudit tab = auditMapper.selectByPrimaryKey(auditId);
if(tab==null){
return "审核项目不存在";
}
int auditType = tab.getAuditType();
tab.setAuditId(auditId);
tab.setUpdateTime(new Date());
tab.setAuditName(auditName);
tab.setAuditStaffId(optStaffId);
if(auditType == AuditType.STORE_CHANGE.getCode()){
//门店信息变更
String storeId = tab.getCommitStoreId();
String oldValue = tab.getOldValue();
String newValue = tab.getNewValue();
String changeField = tab.getChangeField();
public class AuditApiServiceImpl implements AuditApiService {
private static final Logger logger = LoggerFactory.getLogger(AuditApiServiceImpl.class);
@Autowired
private TabHaobanAuditMapper auditMapper;
@Autowired
private StaffMapper staffMapper;
@Autowired
private StoreService storeService;
@Autowired
private TabHaobanBatchAuditLogMapper tabHaobanBatchAuditLogMapper;
@Autowired
private StaffDepartmentRelatedApiService staffDepartmentRelatedApiService;
@Autowired
private EnterpriseService enterpriseService;
@Autowired
private SyncHaobanToGicServiceApi syncHaobanToGicServiceApi;
@Autowired
private StaffClerkRelationApiService staffClerkRelationApiService;
@Autowired
private ClerkService clerkService;
@Autowired
private WxEnterpriseRelatedApiService wxEnterpriseRelatedApiService;
@Override
public Page<AuditDTO> page(Integer auditType, String search, String wxEnterpriseId,
String enterpriseId, Integer auditStatus, Integer auditFlag, BasePageInfo pageInfo) {
//部门关联表修改,服务层调整
List<String> departmentIds = new ArrayList<>();
List<String> staffIds = new ArrayList<>();
List<String> storeIds = new ArrayList<>();
if (StringUtils.isNotEmpty(search)) {
//获取企业列表
List<String> enterpriseIds = new ArrayList<>();
if (StringUtils.isEmpty(enterpriseId)) {
List<EnterpriseDetailDTO> enterprises = wxEnterpriseRelatedApiService.listEnterpriseByWxEnterpriseId(wxEnterpriseId);
if (CollectionUtil.isNotEmpty(enterprises)) {
List<String> searchEnterpriseIds = enterprises.stream().map(s -> s.getEnterpriseId()).collect(Collectors.toList());
enterpriseIds.addAll(searchEnterpriseIds);
}
} else {
enterpriseIds.add(enterpriseId);
}
//调gic接口查storeIds
String[] strArray = new String[enterpriseIds.size()];
enterpriseIds.toArray(strArray);
List<StoreVo> list = storeService.queryStoreByName(strArray, search);
if (CollectionUtil.isNotEmpty(list)) {
List<String> storeIds1 = list.stream().map(s -> s.getStoreId()).collect(Collectors.toList());
storeIds.addAll(storeIds1);
}
//模糊查staffName
List<TabHaobanStaff> staffList = staffMapper.listLikeName(search);
if (CollectionUtil.isNotEmpty(staffList)) {
List<String> staffIds2 = staffList.stream().map(s -> s.getStaffId()).collect(Collectors.toList());
staffIds.addAll(staffIds2);
}
if (CollectionUtil.isEmpty(staffIds)) {
staffIds.add("-999");
}
if (CollectionUtil.isEmpty(storeIds)) {
storeIds.add("-999");
}
}
PageHelper.startPage(pageInfo.getPageNum(), pageInfo.getPageSize());
com.github.pagehelper.Page<TabHaobanAudit> page = new com.github.pagehelper.Page<TabHaobanAudit>();
if (CollectionUtil.isNotEmpty(storeIds) && CollectionUtil.isNotEmpty(staffIds)) {
page = auditMapper.pageForStoreIdsAndstaffIds(auditType, storeIds, staffIds, wxEnterpriseId, enterpriseId, auditStatus, auditFlag);
} else {
page = auditMapper.page(auditType, storeIds, staffIds, wxEnterpriseId, enterpriseId, auditStatus, auditFlag);
}
if (CollectionUtil.isNotEmpty(page.getResult())) {
List<String> commitStaffIds = page.getResult().stream().map(s -> s.getCommitStaffId()).collect(Collectors.toList());
List<TabHaobanStaff> staffList = staffMapper.listByIds(commitStaffIds);
Map<String, TabHaobanStaff> map = com.gic.commons.util.CollectionUtil.toMap(staffList, "staffId");
for (TabHaobanAudit tab : page.getResult()) {
String commitStaffId = tab.getCommitStaffId();
tab.setCommitStaffName(map.get(commitStaffId) == null ? "" : map.get(commitStaffId).getStaffName());
tab.setCommitStaffImg(map.get(commitStaffId) == null ? "" : map.get(commitStaffId).getHeadImg());
}
}
return PageUtil.changePageHelperToCurrentPage(page, AuditDTO.class);
}
@Transactional
@Override
public String audit(String batchId, String auditId, String auditName, String optStaffId) {
TabHaobanAudit tab = auditMapper.selectByPrimaryKey(auditId);
if (tab == null) {
return "审核项目不存在";
}
int auditType = tab.getAuditType();
tab.setAuditId(auditId);
tab.setUpdateTime(new Date());
tab.setAuditName(auditName);
tab.setAuditStaffId(optStaffId);
if (auditType == AuditType.STORE_CHANGE.getCode()) {
//门店信息变更
String storeId = tab.getCommitStoreId();
String oldValue = tab.getOldValue();
String newValue = tab.getNewValue();
String changeField = tab.getChangeField();
StoreDTO store = storeService.getStore(storeId);
if (store == null) {
return "门店不存在";
}
this.editStoreInfo(storeId, changeField, oldValue, newValue);
//发送消息
String title = "门店信息修改通知";
String content = StoreFieldEnum.getValueName(changeField);
content = "["+content+"]"+"修改审核通过";
TabHaobanAudit tab2 = auditMapper.selectByPrimaryKey(auditId);
String staffId = tab2.getCommitStaffId();
//发送消息
String title = "门店信息修改通知";
String content = StoreFieldEnum.getValueName(changeField);
content = "[" + content + "]" + "修改审核通过";
TabHaobanAudit tab2 = auditMapper.selectByPrimaryKey(auditId);
String staffId = tab2.getCommitStaffId();
// this.sendMessageByStaffId(staffId, storeId, title, content);
//插入log
if(org.apache.commons.lang.StringUtils.isNotBlank(batchId)){
insertBatchLog( batchId,AuditRsultType.success.getCode(), tab);
}
if (org.apache.commons.lang.StringUtils.isNotBlank(batchId)) {
insertBatchLog(batchId, AuditRsultType.success.getCode(), tab);
}
this.sendMessageByStaffId(staffId, storeId, false, content, "");
} else if (auditType == AuditType.CLERK_BIND.getCode()) {
//门店导购绑定
String oldValue = tab.getOldValue();
AuditStaffDTO obj = JSONObject.parseObject(oldValue,AuditStaffDTO.class);
StaffClerkRelationDTO staffClerkRelation = staffClerkRelationApiService.getByCodeAndEnterpriseId(obj.getClerkCode(),tab.getEnterpriseId());
String staffId = obj.getStaffId();
String storeId = tab.getCommitStoreId();
StaffClerkRelationDTO have = staffClerkRelationApiService.getOneByStoreIdAndStaffId(storeId, staffId);
if(have !=null){
tab.setAuditStatus(5);
tab.setAuditReason("该成员在该门店下已经绑定过一个导购了");
auditMapper.updateByPrimaryKeySelective(tab);
if(org.apache.commons.lang.StringUtils.isNotBlank(batchId)){
insertBatchLog( batchId,AuditRsultType.fail.getCode(),tab);
}
String oldValue = tab.getOldValue();
AuditStaffDTO obj = JSONObject.parseObject(oldValue, AuditStaffDTO.class);
StaffClerkRelationDTO staffClerkRelation = staffClerkRelationApiService.getByCodeAndEnterpriseId(obj.getClerkCode(), tab.getEnterpriseId());
String staffId = obj.getStaffId();
String storeId = tab.getCommitStoreId();
StaffClerkRelationDTO have = staffClerkRelationApiService.getOneByStoreIdAndStaffId(storeId, staffId);
if (have != null) {
tab.setAuditStatus(5);
tab.setAuditReason("该成员在该门店下已经绑定过一个导购了");
auditMapper.updateByPrimaryKeySelective(tab);
if (org.apache.commons.lang.StringUtils.isNotBlank(batchId)) {
insertBatchLog(batchId, AuditRsultType.fail.getCode(), tab);
}
staffDepartmentRelatedApiService.sendBindAuditMessage(auditId, obj.getStaffId(), obj.getClerkId(), tab.getAuditReason(), true);
return "该成员在该门店下已经绑定过一个导购了";
}
ClerkDTO clerkDTO = clerkService.getClerkByClerkId(obj.getClerkId());
if(clerkDTO == null){
tab.setAuditStatus(5);
tab.setAuditReason("gic已删除该导购");
auditMapper.updateByPrimaryKeySelective(tab);
if(org.apache.commons.lang.StringUtils.isNotBlank(batchId)){
insertBatchLog( batchId,AuditRsultType.fail.getCode(),tab);
}
ClerkDTO clerkDTO = clerkService.getClerkByClerkId(obj.getClerkId());
if (clerkDTO == null) {
tab.setAuditStatus(5);
tab.setAuditReason("gic已删除该导购");
auditMapper.updateByPrimaryKeySelective(tab);
if (org.apache.commons.lang.StringUtils.isNotBlank(batchId)) {
insertBatchLog(batchId, AuditRsultType.fail.getCode(), tab);
}
staffDepartmentRelatedApiService.sendBindAuditMessage(auditId, obj.getStaffId(), obj.getClerkId(), tab.getAuditReason(), true);
return "gic已删除该导购";
}else{
if(staffClerkRelation == null){
staffClerkRelation = new StaffClerkRelationDTO();
}
staffClerkRelation.setEnterpriseId(tab.getEnterpriseId());
staffClerkRelation.setClerkCode(obj.getClerkCode());
staffClerkRelation.setClerkId(obj.getClerkId());
staffClerkRelation.setStoreId(tab.getCommitStoreId());
staffClerkRelation.setWxEnterpriseId(tab.getWxEnterpriseId());
staffClerkRelation.setWxUserId(obj.getWxUserId());
staffClerkRelation.setStaffId(obj.getStaffId());
staffClerkRelationApiService.delAndInsert(staffClerkRelation,optStaffId, ChannelCodeEnum.AUDIT_BIND.getCode());
}
if(org.apache.commons.lang.StringUtils.isNotBlank(batchId)){
insertBatchLog( batchId,AuditRsultType.success.getCode(), tab);
}
} else {
if (staffClerkRelation == null) {
staffClerkRelation = new StaffClerkRelationDTO();
}
staffClerkRelation.setEnterpriseId(tab.getEnterpriseId());
staffClerkRelation.setClerkCode(obj.getClerkCode());
staffClerkRelation.setClerkId(obj.getClerkId());
staffClerkRelation.setStoreId(tab.getCommitStoreId());
staffClerkRelation.setWxEnterpriseId(tab.getWxEnterpriseId());
staffClerkRelation.setWxUserId(obj.getWxUserId());
staffClerkRelation.setStaffId(obj.getStaffId());
staffClerkRelationApiService.delAndInsert(staffClerkRelation, optStaffId, ChannelCodeEnum.AUDIT_BIND.getCode());
}
if (org.apache.commons.lang.StringUtils.isNotBlank(batchId)) {
insertBatchLog(batchId, AuditRsultType.success.getCode(), tab);
}
//同意绑定
staffDepartmentRelatedApiService.sendBindAuditMessage(auditId, obj.getStaffId(), obj.getClerkId(), "", false);
......@@ -239,65 +218,66 @@ public class AuditApiServiceImpl implements AuditApiService{
} else if (auditType == AuditType.CLERK_ADD.getCode()) {
//门店导购新增
String oldValue = tab.getOldValue();
AuditStaffDTO obj = JSONObject.parseObject(oldValue,AuditStaffDTO.class);
String flag = syncHaobanToGicServiceApi.syncClerkToGicClerkAddNew(tab.getCommitStoreId(), obj.getClerkCode(), obj.getSex(), obj.getClerkName(), obj.getPhoneNumber(), obj.getNationCode(), null);
if(!"1".equals(flag)){
//失败
tab.setAuditStatus(5);
tab.setAuditReason(flag);
auditMapper.updateByPrimaryKeySelective(tab);
if(org.apache.commons.lang.StringUtils.isNotBlank(batchId)){
insertBatchLog( batchId,AuditRsultType.fail.getCode(), tab);
}
return flag;
}else{
//成功
if(org.apache.commons.lang.StringUtils.isNotBlank(batchId)){
insertBatchLog( batchId,1, tab);
}
staffDepartmentRelatedApiService.sendClerkAdd(obj.getClerkName(), obj.getClerkCode(),tab.getCommitStoreId(), 1, "");
}
}else if(auditType == AuditType.CLERK_DEL.getCode()){
//门店导购删除
String oldValue = tab.getOldValue();
AuditStaffDTO obj = JSONObject.parseObject(oldValue,AuditStaffDTO.class);
syncHaobanToGicServiceApi.delGicClerk(obj.getClerkId());
if(org.apache.commons.lang.StringUtils.isNotBlank(batchId)){
insertBatchLog( batchId,AuditRsultType.success.getCode(),tab);
}
//解绑日志
StaffClerkRelationDTO relationDTO = staffClerkRelationApiService.getByClerkId(obj.getClerkId());
if (null != relationDTO) {
staffClerkRelationApiService.pushToBindLog(relationDTO.getStaffId(),optStaffId,BindTypeEnum.UNBIND.getVal(),ChannelCodeEnum.SELF_UNBIND.getCode(),relationDTO.getStaffClerkRelationId());
}
staffClerkRelationApiService.delByClerkId(obj.getClerkId());
staffDepartmentRelatedApiService.sendClerkDel(obj.getClerkName(), obj.getClerkCode(),tab.getCommitStoreId(), 1, "");
}else if(auditType == AuditType.CLERK_UNBIND.getCode()){
//解绑申请,无需审核,直接通过
}
tab.setAuditStatus(1);
auditMapper.updateByPrimaryKeySelective(tab);
return "";
}
@Override
public void refuse(String auditId, String auditReason,String auditStaffId,String auditName) {
TabHaobanAudit tab = new TabHaobanAudit();
tab.setAuditId(auditId);
tab.setAuditStatus(2);
tab.setUpdateTime(new Date());
tab.setAuditReason(auditReason);
tab.setAuditName(auditName);
tab.setAuditStaffId(auditStaffId);
auditMapper.updateByPrimaryKeySelective(tab);
TabHaobanAudit tab2 = auditMapper.selectByPrimaryKey(auditId);
int auditType = tab2.getAuditType();
String oldValue = tab2.getOldValue();
String enterpriseId = tab2.getEnterpriseId();
//发送消息
if(auditType == AuditType.STORE_CHANGE.getCode()){
String changeField = tab2.getChangeField();
String oldValue = tab.getOldValue();
AuditStaffDTO obj = JSONObject.parseObject(oldValue, AuditStaffDTO.class);
String flag = syncHaobanToGicServiceApi.syncClerkToGicClerkAddNew(tab.getCommitStoreId(), obj.getClerkCode(), obj.getSex(), obj.getClerkName(), obj.getPhoneNumber(), obj.getNationCode(), null);
if (!"1".equals(flag)) {
//失败
tab.setAuditStatus(5);
tab.setAuditReason(flag);
auditMapper.updateByPrimaryKeySelective(tab);
if (org.apache.commons.lang.StringUtils.isNotBlank(batchId)) {
insertBatchLog(batchId, AuditRsultType.fail.getCode(), tab);
}
return flag;
} else {
//成功
if (org.apache.commons.lang.StringUtils.isNotBlank(batchId)) {
insertBatchLog(batchId, 1, tab);
}
staffDepartmentRelatedApiService.sendClerkAdd(obj.getClerkName(), obj.getClerkCode(), tab.getCommitStoreId(), 1, "");
}
} else if (auditType == AuditType.CLERK_DEL.getCode()) {
//门店导购删除
String oldValue = tab.getOldValue();
AuditStaffDTO obj = JSONObject.parseObject(oldValue, AuditStaffDTO.class);
syncHaobanToGicServiceApi.delGicClerk(obj.getClerkId());
if (org.apache.commons.lang.StringUtils.isNotBlank(batchId)) {
insertBatchLog(batchId, AuditRsultType.success.getCode(), tab);
}
//解绑日志
StaffClerkRelationDTO relationDTO = staffClerkRelationApiService.getByClerkId(obj.getClerkId());
if (null != relationDTO) {
staffClerkRelationApiService.pushToBindLog(relationDTO.getStaffId(), optStaffId, BindTypeEnum.UNBIND.getVal(), ChannelCodeEnum.SELF_UNBIND.getCode(), relationDTO.getStaffClerkRelationId());
}
staffClerkRelationApiService.delByClerkId(obj.getClerkId());
staffDepartmentRelatedApiService.sendClerkDel(obj.getClerkName(), obj.getClerkCode(), tab.getCommitStoreId(), 1, "");
} else if (auditType == AuditType.CLERK_UNBIND.getCode()) {
//解绑申请,无需审核,直接通过
}
tab.setAuditStatus(1);
auditMapper.updateByPrimaryKeySelective(tab);
return "";
}
@Override
public void refuse(String auditId, String auditReason, String auditStaffId, String auditName) {
TabHaobanAudit tab = new TabHaobanAudit();
tab.setAuditId(auditId);
tab.setAuditStatus(2);
tab.setUpdateTime(new Date());
tab.setAuditReason(auditReason);
tab.setAuditName(auditName);
tab.setAuditStaffId(auditStaffId);
auditMapper.updateByPrimaryKeySelective(tab);
TabHaobanAudit tab2 = auditMapper.selectByPrimaryKey(auditId);
int auditType = tab2.getAuditType();
String oldValue = tab2.getOldValue();
String enterpriseId = tab2.getEnterpriseId();
//发送消息
if (auditType == AuditType.STORE_CHANGE.getCode()) {
String changeField = tab2.getChangeField();
// String title = "门店信息修改通知";
String content = StoreFieldEnum.getValueName(changeField);
// content = "["+content+"]"+"被拒绝。拒绝理由:"+auditReason;
......@@ -306,126 +286,128 @@ public class AuditApiServiceImpl implements AuditApiService{
this.sendMessageByStaffId(staffId, storeId, true, content, auditReason);
}else if(auditType == AuditType.CLERK_BIND.getCode()){
AuditStaffDTO obj = JSONObject.parseObject(oldValue,AuditStaffDTO.class);
String staffId = tab2.getCommitStaffId();
staffDepartmentRelatedApiService.sendBindAuditMessage(auditId, staffId, obj.getClerkId(), auditReason, true);
} else if (auditType == AuditType.CLERK_BIND.getCode()) {
AuditStaffDTO obj = JSONObject.parseObject(oldValue, AuditStaffDTO.class);
String staffId = tab2.getCommitStaffId();
staffDepartmentRelatedApiService.sendBindAuditMessage(auditId, staffId, obj.getClerkId(), auditReason, true);
// staffDepartmentRelatedApiService.sendStaffBind(obj.getStaffId(), obj.getClerkCode(), tab2.getCommitStoreId(), 2, auditReason);
} else if (auditType == AuditType.CLERK_ADD.getCode()) {
AuditStaffDTO obj = JSONObject.parseObject(oldValue,AuditStaffDTO.class);
staffDepartmentRelatedApiService.sendClerkAdd(obj.getClerkName(), obj.getClerkCode(),tab2.getCommitStoreId(), 2, auditReason);
}else if(auditType == AuditType.CLERK_DEL.getCode()) {
AuditStaffDTO obj = JSONObject.parseObject(oldValue,AuditStaffDTO.class);
staffDepartmentRelatedApiService.sendClerkDel(obj.getClerkName(), obj.getClerkCode(),tab2.getCommitStoreId(), 2, auditReason);
}
}
@Override
public int save(Integer auditType,String wxEnterpriseId, String enterpriseId,
String commitStaffId, String commitStoreId, String changeField,
String oldValue, String newValue) {
TabHaobanStaff staff = staffMapper.selectByPrimaryKey(commitStaffId);
if(staff == null){
return 0;
}
TabHaobanAudit tab = new TabHaobanAudit();
tab.setAuditId(UuidUtil.randomUUID());
tab.setAuditStatus(0);
tab.setAuditType(auditType);
tab.setChangeField(changeField);
tab.setCommitName(null);
tab.setCommitStaffId(commitStaffId);
tab.setCommitStaffImg(staff.getHeadImg());
tab.setCommitStaffName(staff.getStaffName());
tab.setCommitStoreId(commitStoreId);
tab.setCommitTime(new Date());
tab.setCreateTime(new Date());
tab.setWxEnterpriseId(wxEnterpriseId);
tab.setEnterpriseId(enterpriseId);
tab.setNewValue(newValue);
tab.setOldValue(oldValue);
tab.setStatusFlag(1);
tab.setUpdateTime(new Date());
return auditMapper.insertSelective(tab);
}
@Override
public void editStoreInfo(String storeId, String changeField,
String oldValue, String newValue) {
logger.info("===================进11");
StoreDTO store = storeService.getStore(storeId);
if(!StoreFieldEnum.STORE_IMAG.getValue().equals(changeField)){
//非门店图片修改
logger.info("===================进222");
StoreDetailDTO detailDTO = new StoreDetailDTO();
detailDTO = EntityUtil.changeEntityByJSON(StoreDetailDTO.class, store);
detailDTO.setStoreId(storeId);
detailDTO.setEnterpriseId(store.getEnterpriseId());
detailDTO.setStatus(2);
detailDTO.setOpenTime(null);
detailDTO.setCloseTime(null);
getStoreDTO( detailDTO, changeField, oldValue, newValue);
logger.info("detailDTO====================>为{}",JSONObject.toJSONString(detailDTO));
storeService.saveStore(detailDTO);
AuditStaffDTO obj = JSONObject.parseObject(oldValue, AuditStaffDTO.class);
staffDepartmentRelatedApiService.sendClerkAdd(obj.getClerkName(), obj.getClerkCode(), tab2.getCommitStoreId(), 2, auditReason);
} else if (auditType == AuditType.CLERK_DEL.getCode()) {
AuditStaffDTO obj = JSONObject.parseObject(oldValue, AuditStaffDTO.class);
staffDepartmentRelatedApiService.sendClerkDel(obj.getClerkName(), obj.getClerkCode(), tab2.getCommitStoreId(), 2, auditReason);
}
}
@Override
public int save(Integer auditType, String wxEnterpriseId, String enterpriseId,
String commitStaffId, String commitStoreId, String changeField,
String oldValue, String newValue) {
TabHaobanStaff staff = staffMapper.selectByPrimaryKey(commitStaffId);
if (staff == null) {
return 0;
}
TabHaobanAudit tab = new TabHaobanAudit();
tab.setAuditId(UuidUtil.randomUUID());
tab.setAuditStatus(0);
tab.setAuditType(auditType);
tab.setChangeField(changeField);
tab.setCommitName(null);
tab.setCommitStaffId(commitStaffId);
tab.setCommitStaffImg(staff.getHeadImg());
tab.setCommitStaffName(staff.getStaffName());
tab.setCommitStoreId(commitStoreId);
tab.setCommitTime(new Date());
tab.setCreateTime(new Date());
tab.setWxEnterpriseId(wxEnterpriseId);
tab.setEnterpriseId(enterpriseId);
tab.setNewValue(newValue);
tab.setOldValue(oldValue);
tab.setStatusFlag(1);
tab.setUpdateTime(new Date());
return auditMapper.insertSelective(tab);
}
@Override
public void editStoreInfo(String storeId, String changeField,
String oldValue, String newValue) {
logger.info("===================进11");
StoreDTO store = storeService.getStore(storeId);
if (!StoreFieldEnum.STORE_IMAG.getValue().equals(changeField)) {
//非门店图片修改
logger.info("===================进222");
StoreDetailDTO detailDTO = new StoreDetailDTO();
detailDTO = EntityUtil.changeEntityByJSON(StoreDetailDTO.class, store);
detailDTO.setStoreId(storeId);
detailDTO.setEnterpriseId(store.getEnterpriseId());
detailDTO.setStatus(2);
detailDTO.setOpenTime(null);
detailDTO.setCloseTime(null);
getStoreDTO(detailDTO, changeField, oldValue, newValue);
logger.info("detailDTO====================>为{}", JSONObject.toJSONString(detailDTO));
storeService.saveStore(detailDTO);
// storeService.saveOrUpdateStore(store);
}else{
//门店图片修改
logger.info("===================进333");
storeService.updateStorePhotos(storeId, newValue);
}
}
void getStoreDTO(StoreDetailDTO store,String changeField,String oldValue,String newValue){
logger.info("==========================>changeField={}",changeField);
if(StoreFieldEnum.BUSINESS_TIME_STRING.getValue().equals(changeField)){
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm");
//营业时间
String [] newValues = newValue.split("-");
String openTime = newValues[0];
String closeTime = newValues[1];
store.setOpenTime(openTime);
store.setCloseTime(closeTime);
}else if(StoreFieldEnum.CONACTS_PHONE.getValue().equals(changeField)){
//联系电话
store.setConactsPhone(newValue);
}else if(StoreFieldEnum.STORE_ADDRESS.getValue().equals(changeField)){
logger.info("==========================>进来333");
//门店地址
StoreAddressDTO obj = JSONObject.parseObject(newValue,StoreAddressDTO.class);
String areaId = obj.getAreaId();
String storeAddress = obj.getStoreAddress();
logger.info("==========================>areaId={},storeAddress={},newValue={}",areaId,storeAddress,newValue);
String[] arr = storeAddress.split(" ");
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.setStoreArea(Double.parseDouble(newValue));
}else if(StoreFieldEnum.STORE_NAME.getValue().equals(changeField)){
//门店名字
store.setStoreName(newValue);
// TabHaobanDepartment tab = departmentMapper.getByRelatedId(store.getStoreId());
// tab.setDepartmentName(newValue);
// departmentMapper.updateByPrimaryKey(tab);
}else if(StoreFieldEnum.STORE_IMAG.getValue().equals(changeField)){
//门店图片
}
}
@Override
public List<AuditDTO> listByStoreId(String storeId) {
List<TabHaobanAudit> list = auditMapper.listByStoreId(storeId);
List<AuditDTO> resultList = EntityUtil.changeEntityListByJSON(AuditDTO.class, list);
return resultList;
}
@Override
public AuditDTO findByStoreIdAndChangeField(String storeId,
String changeField) {
TabHaobanAudit tab = auditMapper.findByStoreIdAndChangeField(storeId,changeField);
if(tab == null){
return null;
}
return EntityUtil.changeEntityByJSON(AuditDTO.class, tab);
}
} else {
//门店图片修改
logger.info("===================进333");
storeService.updateStorePhotos(storeId, newValue);
}
}
void getStoreDTO(StoreDetailDTO store, String changeField, String oldValue, String newValue) {
logger.info("==========================>changeField={}", changeField);
if (StoreFieldEnum.BUSINESS_TIME_STRING.getValue().equals(changeField)) {
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm");
//营业时间
String[] newValues = newValue.split("-");
String openTime = newValues[0];
String closeTime = newValues[1];
store.setOpenTime(openTime);
store.setCloseTime(closeTime);
} else if (StoreFieldEnum.CONACTS_PHONE.getValue().equals(changeField)) {
//联系电话
store.setConactsPhone(newValue);
} else if (StoreFieldEnum.STORE_ADDRESS.getValue().equals(changeField)) {
logger.info("==========================>进来333");
//门店地址
StoreAddressDTO obj = JSONObject.parseObject(newValue, StoreAddressDTO.class);
String areaId = obj.getAreaId();
String storeAddress = obj.getStoreAddress();
logger.info("==========================>areaId={},storeAddress={},newValue={}", areaId, storeAddress, newValue);
String[] arr = storeAddress.split(" ");
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.setStoreArea(Double.parseDouble(newValue));
} else if (StoreFieldEnum.STORE_NAME.getValue().equals(changeField)) {
//门店名字
store.setStoreName(newValue);
} else if (StoreFieldEnum.STORE_IMAG.getValue().equals(changeField)) {
//门店图片
}
}
@Override
public List<AuditDTO> listByStoreId(String storeId) {
List<TabHaobanAudit> list = auditMapper.listByStoreId(storeId);
List<AuditDTO> resultList = EntityUtil.changeEntityListByJSON(AuditDTO.class, list);
return resultList;
}
@Override
public AuditDTO findByStoreIdAndChangeField(String storeId,
String changeField) {
TabHaobanAudit tab = auditMapper.findByStoreIdAndChangeField(storeId, changeField);
if (tab == null) {
return null;
}
return EntityUtil.changeEntityByJSON(AuditDTO.class, tab);
}
private void sendMessageByStaffId(String staffId, String storeId, boolean isRefuse, String content, String reason) {
......@@ -475,14 +457,14 @@ public class AuditApiServiceImpl implements AuditApiService{
if (staffClerkRelationDTO == null) {
logger.info("staff不存在");
return;
}
}
Map<String, String> params = new HashMap<String, String>();
params.put("field", content);
params.put("reason", reason);
JSONObject jsonObject = new JSONObject();
jsonObject.put("storeId", storeId);
JSONObject jsonObject = new JSONObject();
jsonObject.put("storeId", storeId);
if (isRefuse) {
NoticeMessageUtil.sendNoticeMessage(staffClerkRelationDTO.getEnterpriseId(), staffClerkRelationDTO.getClerkId()
......@@ -495,66 +477,72 @@ public class AuditApiServiceImpl implements AuditApiService{
}
@Override
public void insert(AuditDTO audit) {
audit.setAuditId(com.gic.haoban.common.utils.StringUtil.randomUUID());
audit.setCreateTime(new Date());
audit.setUpdateTime(new Date());
auditMapper.insertSelective(EntityUtil.changeEntityByJSON(TabHaobanAudit.class, audit));
}
@Override
public Page<AuditDTO> listByStaffId(String staffId, Integer auditType,Integer auditStatus,BasePageInfo pageInfo) {
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) {
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();
batTab.setAuditId(tab.getAuditId());
batTab.setBatchAuditLogId(UuidUtil.randomUUID());
batTab.setAuditType(tab.getAuditType());
batTab.setAuditResult(auditResult);
batTab.setBatchId(batchId);
batTab.setCommitName(tab.getCommitStaffName());
batTab.setCommitTime(tab.getCommitTime());
batTab.setCreateTime(new Date());
batTab.setEnterpriseName(enterprise == null ?"":enterprise.getEnterpriseName());
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 void update(AuditDTO audit) {
audit.setUpdateTime(new Date());
auditMapper.updateByPrimaryKeySelective(EntityUtil.changeEntityByJSON(TabHaobanAudit.class, audit));
}
@Override
public List<BatchAuditLogDTO> listBatchLog(String batchId) {
List<TabHaobanBatchAuditLog > list = tabHaobanBatchAuditLogMapper.listByBatchId(batchId);
return EntityUtil.changeEntityListByJSON(BatchAuditLogDTO.class, list);
}
@Override
public AuditDTO findByBindRelatedIdAndAuditType(String relatedId,
int auditType) {
TabHaobanAudit tab = auditMapper.findByBindRelatedIdAndAuditType(relatedId, auditType);
return EntityUtil.changeEntityByJSON(AuditDTO.class, tab);
}
@Override
public boolean judgeHavePhoneNumberOrCode(String enterpriseId,
String clerkCode, String phoneNumber) {
List<TabHaobanAudit> list = auditMapper.judgeHavePhoneNumberOrCode(enterpriseId,clerkCode,phoneNumber);
return !CollectionUtil.isEmpty(list);
}
public void insert(AuditDTO audit) {
audit.setAuditId(com.gic.haoban.common.utils.StringUtil.randomUUID());
audit.setCreateTime(new Date());
audit.setUpdateTime(new Date());
auditMapper.insertSelective(EntityUtil.changeEntityByJSON(TabHaobanAudit.class, audit));
}
@Override
public Page<AuditDTO> listByStaffId(String staffId, Integer auditType, Integer auditStatus, BasePageInfo pageInfo) {
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) {
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();
batTab.setAuditId(tab.getAuditId());
batTab.setBatchAuditLogId(UuidUtil.randomUUID());
batTab.setAuditType(tab.getAuditType());
batTab.setAuditResult(auditResult);
batTab.setBatchId(batchId);
batTab.setCommitName(tab.getCommitStaffName());
batTab.setCommitTime(tab.getCommitTime());
batTab.setCreateTime(new Date());
batTab.setEnterpriseName(enterprise == null ? "" : enterprise.getEnterpriseName());
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 void update(AuditDTO audit) {
audit.setUpdateTime(new Date());
auditMapper.updateByPrimaryKeySelective(EntityUtil.changeEntityByJSON(TabHaobanAudit.class, audit));
}
@Override
public List<BatchAuditLogDTO> listBatchLog(String batchId) {
List<TabHaobanBatchAuditLog> list = tabHaobanBatchAuditLogMapper.listByBatchId(batchId);
return EntityUtil.changeEntityListByJSON(BatchAuditLogDTO.class, list);
}
@Override
public AuditDTO findByBindRelatedIdAndAuditType(String relatedId,
int auditType) {
TabHaobanAudit tab = auditMapper.findByBindRelatedIdAndAuditType(relatedId, auditType);
return EntityUtil.changeEntityByJSON(AuditDTO.class, tab);
}
@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;
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 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.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.gic.api.base.commons.JSONResponse;
import com.gic.api.base.commons.Page;
import com.gic.commons.util.EntityUtil;
......@@ -39,19 +13,34 @@ import com.gic.enterprise.api.dto.StoreGroupDTO;
import com.gic.enterprise.api.service.StoreGroupService;
import com.gic.enterprise.api.service.StoreService;
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.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.StaffApiService;
import com.gic.haoban.manage.api.service.StaffDepartmentRelatedApiService;
import com.gic.haoban.manage.service.dao.mapper.DepartmentMapper;
import com.gic.haoban.manage.service.entity.TabHaobanDepartment;
import com.gic.haoban.manage.service.entity.TabHaobanStaffDepartmentRelated;
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.redis.data.util.RedisUtil;
import com.gic.wechat.api.service.qywx.QywxDepartmentApiService;
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
public class DepartmentApiServiceImpl implements DepartmentApiService {
......
......@@ -10,26 +10,19 @@ import com.gic.commons.util.EntityUtil;
import com.gic.commons.util.GICMQClientUtil;
import com.gic.dubbo.entity.ProviderLocalTag;
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.StaffClerkBindLogInfoDTO;
import com.gic.haoban.manage.api.dto.StaffClerkRelationDTO;
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.WxEnterpriseRelatedApiService;
import com.gic.haoban.manage.service.pojo.BinlogBasePojo;
import com.gic.haoban.manage.service.pojo.ClerkSyncPojo;
import com.gic.haoban.manage.service.pojo.GroupSyncPojo;
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.StoreRangeService;
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.kafka.clients.consumer.ConsumerRecord;
import org.slf4j.Logger;
......@@ -58,9 +51,6 @@ public class KafkaMessageServiceImpl implements MessageListener<String, GicRecor
private StaffClerkRelationService staffClerkRelationService;
@Autowired
private StaffClerkBindLogService staffClerkBindLogService;
@Autowired
private StaffClerkRelationApiService staffClerkRelationApiService;
@Autowired
......
<?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"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>com.gic</groupId>
<artifactId>gic-pom-base</artifactId>
<version>3.0-SNAPSHOT</version>
<relativePath/>
</parent>
<modelVersion>4.0.0</modelVersion>
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>com.gic</groupId>
<artifactId>gic-pom-base</artifactId>
<version>3.0-SNAPSHOT</version>
<relativePath/>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>haoban-manage3-web</artifactId>
<version>${libraryVersion}</version>
<packaging>war</packaging>
<name>haoban-manage3-web Maven Webapp</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<commonVersion>3.0-SNAPSHOT</commonVersion>
<libraryVersion>3.0-SNAPSHOT</libraryVersion>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-framework-bom</artifactId>
<version>4.2.4.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.47</version>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>com.gic</groupId>
<artifactId>haoban-common</artifactId>
<version>${haoban-common}</version>
</dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>gic-base-api</artifactId>
<version>${gic-base-api}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.session</groupId>
<artifactId>spring-session-data-redis</artifactId>
<version>1.2.1.RELEASE</version>
</dependency>
<dependency>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
<version>2.8.1</version>
</dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>gic-dict-api</artifactId>
<version>${gic-dict-api}</version>
</dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>gic-redis-data</artifactId>
<version>${gic-redis-data}</version>
</dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>gic-wechat-api</artifactId>
<version>${gic-wechat-api}</version>
</dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>gic-wechat-token-api</artifactId>
<version>${gic-wechat-token-api}</version>
</dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>gic-platform-config</artifactId>
<version>${gic-platform-config}</version>
</dependency>
<dependency>
<groupId>net.sourceforge.jexcelapi</groupId>
<artifactId>jxl</artifactId>
<version>2.6.12</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.9</version>
<exclusions>
<exclusion>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.9</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml-schemas</artifactId>
<version>3.9</version>
</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>
<artifactId>haoban-manage3-web</artifactId>
<version>${libraryVersion}</version>
<packaging>war</packaging>
<name>haoban-manage3-web Maven Webapp</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<commonVersion>3.0-SNAPSHOT</commonVersion>
<libraryVersion>3.0-SNAPSHOT</libraryVersion>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-framework-bom</artifactId>
<version>4.2.4.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.47</version>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>com.gic</groupId>
<artifactId>haoban-common</artifactId>
<version>${haoban-common}</version>
</dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>gic-base-api</artifactId>
<version>${gic-base-api}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.session</groupId>
<artifactId>spring-session-data-redis</artifactId>
<version>1.2.1.RELEASE</version>
</dependency>
<dependency>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
<version>2.8.1</version>
</dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>gic-dict-api</artifactId>
<version>${gic-dict-api}</version>
</dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>gic-redis-data</artifactId>
<version>${gic-redis-data}</version>
</dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>gic-wechat-api</artifactId>
<version>${gic-wechat-api}</version>
</dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>gic-wechat-token-api</artifactId>
<version>${gic-wechat-token-api}</version>
</dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>gic-platform-config</artifactId>
<version>${gic-platform-config}</version>
</dependency>
<dependency>
<groupId>net.sourceforge.jexcelapi</groupId>
<artifactId>jxl</artifactId>
<version>2.6.12</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.9</version>
<exclusions>
<exclusion>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.9</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml-schemas</artifactId>
<version>3.9</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>
<groupId>com.gic</groupId>
<artifactId>haoban-operation-api</artifactId>
<version>${haoban-operation-api}</version>
</dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>haoban-config</artifactId>
<version>${haoban-config}</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>gic-thirdparty-api</artifactId>
<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>
<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>
<groupId>com.gic</groupId>
<artifactId>haoban-operation-api</artifactId>
<version>${haoban-operation-api}</version>
</dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>haoban-config</artifactId>
<version>${haoban-config}</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>gic-thirdparty-api</artifactId>
<version>${gic-thirdparty-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>gic-thirdparty-sdk</artifactId>
<version>${gic-thirdparty-sdk}</version>
</dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>haoban-mobile-app-api</artifactId>
<version>${haoban-mobile-app-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>gic-thirdparty-sdk</artifactId>
<version>${gic-thirdparty-sdk}</version>
</dependency>
<dependency>
<groupId>com.gic.operation</groupId>
<artifactId>gic-operation-api</artifactId>
<version>${gic-operation-api}</version>
</dependency>
<dependency>
<dependency>
<groupId>com.gic.operation</groupId>
<artifactId>gic-operation-api</artifactId>
<version>${gic-operation-api}</version>
</dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>gic-enterprise-api</artifactId>
<version>${gic-enterprise-api}</version>
</dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>gic-clerk-api</artifactId>
<version>${gic-clerk-api}</version>
</dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>gic-quartz-api</artifactId>
<version>${gic-quartz-api}</version>
</dependency>
<groupId>com.gic</groupId>
<artifactId>gic-quartz-api</artifactId>
<version>${gic-quartz-api}</version>
</dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>gic-cloud-data-api</artifactId>
<groupId>com.gic</groupId>
<artifactId>gic-cloud-data-api</artifactId>
<version>${gic-cloud-data-api}</version>
</dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>gic-cloud-web-service-api</artifactId>
<version>${gic-cloud-web-service-api}</version>
</dependency>
</dependencies>
</dependencies>
<build>
<finalName>haoban-manage3-web</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<encoding>UTF-8</encoding>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<type>jar</type>
<includeTypes>jar</includeTypes>
<outputDirectory>
${project.build.directory}/lib
</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<build>
<finalName>haoban-manage3-web</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<encoding>UTF-8</encoding>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<type>jar</type>
<includeTypes>jar</includeTypes>
<outputDirectory>
${project.build.directory}/lib
</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<path>/haoban-manage3-web</path>
<port>9907</port>
<uriEncoding>UTF-8</uriEncoding>
</configuration>
</plugin>
</plugins>
</build>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<path>/haoban-manage3-web</path>
<port>9907</port>
<uriEncoding>UTF-8</uriEncoding>
</configuration>
</plugin>
</plugins>
</build>
</project>
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.EntityUtil;
import com.gic.haoban.common.utils.HaobanResponse;
import com.gic.haoban.manage.api.dto.LoginDTO;
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.
......@@ -54,24 +49,4 @@ public class WebBaseController {
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;
}
}
......@@ -14,10 +14,6 @@
<version>${libraryVersion}</version>
<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>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<commonVersion>3.0-SNAPSHOT</commonVersion>
......@@ -103,24 +99,10 @@
</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-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>
<groupId>com.gic</groupId>
<artifactId>haoban-operation-api</artifactId>
......@@ -149,34 +131,15 @@
</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>
<groupId>com.gic</groupId>
<artifactId>gic-thirdparty-sdk</artifactId>
<version>${gic-thirdparty-sdk}</version>
</dependency>
<dependency>
<groupId>com.gic.operation</groupId>
<artifactId>gic-operation-api</artifactId>
......
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.common.utils.AuthRequestWellDoneUtil;
import com.gic.haoban.common.utils.HaobanResponse;
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.
......@@ -54,24 +48,4 @@ public class WebBaseController {
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