Commit f085a54a by QianQiXiang

测试

parent 3b39e91e
...@@ -40,4 +40,14 @@ public enum ChannelCodeEnum { ...@@ -40,4 +40,14 @@ public enum ChannelCodeEnum {
public void setName(String name) { public void setName(String name) {
this.name = name; this.name = name;
} }
public String getNameByCode(int code) {
ChannelCodeEnum[] values = ChannelCodeEnum.values();
for (ChannelCodeEnum channelCodeEnum : values) {
if (channelCodeEnum.getCode() == code) {
return channelCodeEnum.getName();
}
}
return null;
}
} }
package com.gic.haoban.manage.web.controller; package com.gic.haoban.manage.web.controller;
import java.util.ArrayList;
import java.util.List;
import com.gic.haoban.manage.api.enums.ChannelCodeEnum;
import com.gic.redis.data.util.RedisUtil;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.gic.api.base.commons.Page; import com.gic.api.base.commons.Page;
...@@ -26,10 +13,11 @@ import com.gic.haoban.common.utils.HaobanResponse; ...@@ -26,10 +13,11 @@ import com.gic.haoban.common.utils.HaobanResponse;
import com.gic.haoban.common.utils.PageUtil; import com.gic.haoban.common.utils.PageUtil;
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.AuditDTO;
import com.gic.haoban.manage.api.dto.StaffClerkBindLogDetailDTO;
import com.gic.haoban.manage.api.dto.StaffClerkRelationDTO; import com.gic.haoban.manage.api.dto.StaffClerkRelationDTO;
import com.gic.haoban.manage.api.dto.StaffDTO; import com.gic.haoban.manage.api.dto.StaffDTO;
import com.gic.haoban.manage.api.enums.AuditRsultType;
import com.gic.haoban.manage.api.enums.AuditType; import com.gic.haoban.manage.api.enums.AuditType;
import com.gic.haoban.manage.api.enums.ChannelCodeEnum;
import com.gic.haoban.manage.api.service.AuditApiService; import com.gic.haoban.manage.api.service.AuditApiService;
import com.gic.haoban.manage.api.service.StaffApiService; import com.gic.haoban.manage.api.service.StaffApiService;
import com.gic.haoban.manage.api.service.StaffClerkRelationApiService; import com.gic.haoban.manage.api.service.StaffClerkRelationApiService;
...@@ -37,258 +25,296 @@ import com.gic.haoban.manage.api.service.StaffDepartmentRelatedApiService; ...@@ -37,258 +25,296 @@ import com.gic.haoban.manage.api.service.StaffDepartmentRelatedApiService;
import com.gic.haoban.manage.web.anno.HttpLimit; import com.gic.haoban.manage.web.anno.HttpLimit;
import com.gic.haoban.manage.web.errCode.HaoBanErrCode; import com.gic.haoban.manage.web.errCode.HaoBanErrCode;
import com.gic.haoban.manage.web.vo.AuditVO; import com.gic.haoban.manage.web.vo.AuditVO;
import com.gic.haoban.manage.web.vo.StaffClerkBindLogDetailVO;
import com.gic.redis.data.util.RedisUtil;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.List;
@RestController @RestController
public class AuditController extends WebBaseController{ public class AuditController extends WebBaseController {
private static Logger logger= LoggerFactory.getLogger(AuditController.class); private static Logger logger = LoggerFactory.getLogger(AuditController.class);
@Autowired @Autowired
private AuditApiService auditApiService; private AuditApiService auditApiService;
@Autowired @Autowired
private StaffClerkRelationApiService staffClerkRelationApiService; private StaffClerkRelationApiService staffClerkRelationApiService;
@Autowired @Autowired
private StaffApiService staffApiService; private StaffApiService staffApiService;
@Autowired @Autowired
private SyncHaobanToGicServiceApi syncHaobanToGicServiceApi; private SyncHaobanToGicServiceApi syncHaobanToGicServiceApi;
@Autowired @Autowired
private StaffDepartmentRelatedApiService staffDepartmentRelatedApiService; private StaffDepartmentRelatedApiService staffDepartmentRelatedApiService;
@Autowired @Autowired
private ClerkService clerkService; private ClerkService clerkService;
@Autowired
private ChannelCodeEnum channelCodeEnum;
//关联记录列表
@RequestMapping("clerk-apply-list")
public HaobanResponse staffStoreList(String staffId,Integer auditType,Integer auditStatus,String wxEnterpriseId,BasePageInfo pageInfo){ //关联记录列表
if(StringUtils.isAnyBlank(staffId,wxEnterpriseId)){ @RequestMapping("clerk-apply-list")
return resultResponse(HaoBanErrCode.ERR_2); public HaobanResponse staffStoreList(String staffId, Integer auditType, Integer auditStatus, String wxEnterpriseId, BasePageInfo pageInfo) {
} if (StringUtils.isAnyBlank(staffId, wxEnterpriseId)) {
return resultResponse(HaoBanErrCode.ERR_2);
Page<AuditDTO> page = auditApiService.listByStaffId(staffId,auditType,auditStatus,pageInfo); }
List<AuditDTO> list = page.getResult();
List<AuditVO> voList = new ArrayList<AuditVO>(); Page<AuditDTO> page = auditApiService.listByStaffId(staffId, auditType, auditStatus, pageInfo);
for (AuditDTO auditDTO : list) { List<AuditDTO> list = page.getResult();
AuditVO vo = EntityUtil.changeEntityByJSON(AuditVO.class, auditDTO); List<AuditVO> voList = new ArrayList<AuditVO>();
String clerkCode = ""; for (AuditDTO auditDTO : list) {
String staffName = ""; AuditVO vo = EntityUtil.changeEntityByJSON(AuditVO.class, auditDTO);
String oldValue = auditDTO.getOldValue(); String clerkCode = "";
JSONObject json = JSON.parseObject(oldValue); String staffName = "";
clerkCode = json.getString("clerkCode"); String oldValue = auditDTO.getOldValue();
staffName = json.getString("staffName"); JSONObject json = JSON.parseObject(oldValue);
if(auditDTO.getAuditType() == 3){ clerkCode = json.getString("clerkCode");
vo.setCommitReason("添加导购账号:("+clerkCode+")"); staffName = json.getString("staffName");
}else if(auditDTO.getAuditType() == 4){ if (auditDTO.getAuditType() == 3) {
vo.setCommitReason("删除导购账号:("+clerkCode+")"); vo.setCommitReason("添加导购账号:(" + clerkCode + ")");
}else{ } else if (auditDTO.getAuditType() == 4) {
vo.setCommitReason("绑定申请{"+staffName+"}绑定登录导购code "+clerkCode); vo.setCommitReason("删除导购账号:(" + clerkCode + ")");
} } else {
voList.add(vo); vo.setCommitReason("绑定申请{" + staffName + "}绑定登录导购code " + clerkCode);
} }
Page<AuditVO> pageVO = new Page<>(); voList.add(vo);
pageVO.setCurrentPage(page.getCurrentPage()); }
pageVO.setPageSize(page.getPageSize()); Page<AuditVO> pageVO = new Page<>();
pageVO.setResult(voList); pageVO.setCurrentPage(page.getCurrentPage());
pageVO.setTotalCount(page.getTotalCount()); pageVO.setPageSize(page.getPageSize());
pageVO.setTotalPage(page.getTotalPage()); pageVO.setResult(voList);
PageResult2 pageResult2 = PageUtil.getPageInfo(pageVO); pageVO.setTotalCount(page.getTotalCount());
return resultResponse(HaoBanErrCode.ERR_1,pageResult2); pageVO.setTotalPage(page.getTotalPage());
PageResult2 pageResult2 = PageUtil.getPageInfo(pageVO);
} return resultResponse(HaoBanErrCode.ERR_1, pageResult2);
//门店记录列表
@RequestMapping("store-apply-list") }
public HaobanResponse storeApplyList(String storeId,String wxEnterpriseId,BasePageInfo pageInfo,Integer auditType,Integer auditStatus){
if(StringUtils.isAnyBlank(storeId,wxEnterpriseId)){
return resultResponse(HaoBanErrCode.ERR_2);
}
Page<AuditDTO> page = auditApiService.pageStoreListByParams(storeId,pageInfo,auditType,auditStatus);
List<AuditDTO> list = page.getResult();
List<AuditVO> voList = new ArrayList<AuditVO>();
for (AuditDTO auditDTO : list) {
AuditVO vo = EntityUtil.changeEntityByJSON(AuditVO.class, auditDTO);
String clerkCode = "";
String staffName = "";
String oldValue = auditDTO.getOldValue();
JSONObject json = JSON.parseObject(oldValue);
clerkCode = json.getString("clerkCode");
staffName = json.getString("staffName");
String headPic = json.get("headPic")== null ? "": json.get("headPic").toString();
if(auditDTO.getAuditType() == 3){ //解绑记录列表
vo.setCommitReason("添加导购账号:("+clerkCode+")"); @RequestMapping("clerk-unbind-list")
}else if(auditDTO.getAuditType() == 4){ public HaobanResponse staffUnbindList(String wxEnterpriseId, String search, String enterpriseId, @RequestParam(defaultValue = "1") Integer optType, BasePageInfo qo) {
vo.setCommitReason("删除导购账号:("+clerkCode+")"); Page<StaffClerkBindLogDetailDTO> page = staffClerkRelationApiService.pageStaffClerkBindLog(wxEnterpriseId, search, enterpriseId, optType, qo);
}else if(auditDTO.getAuditType() == 5){ List<StaffClerkBindLogDetailDTO> list = page.getResult();
vo.setCommitReason("解除绑定:("+clerkCode+")"); List<StaffClerkBindLogDetailVO> voList = new ArrayList<StaffClerkBindLogDetailVO>();
}else{ for (StaffClerkBindLogDetailDTO staffClerkBindLogDetailDTO : list) {
vo.setCommitReason("绑定申请{"+staffName+"}绑定登录导购code "+clerkCode); StaffClerkBindLogDetailVO vo = EntityUtil.changeEntityByJSON(StaffClerkBindLogDetailVO.class, staffClerkBindLogDetailDTO);
} vo.setUnbindReason(channelCodeEnum.getNameByCode(vo.getChannelCode()));
vo.setCommitName(auditDTO.getCommitStaffName()); voList.add(vo);
vo.setFailReason(auditDTO.getAuditReason()); }
vo.setStaffName(auditDTO.getCommitName()); Page<StaffClerkBindLogDetailVO> pageVO = new Page<>();
vo.setClerkName(auditDTO.getCommitName()); pageVO.setCurrentPage(page.getCurrentPage());
vo.setHeadPic(headPic); pageVO.setPageSize(page.getPageSize());
if(auditDTO.getAuditType() != 0){ pageVO.setResult(voList);
vo.setUpdateTime(auditDTO.getUpdateTime()); pageVO.setTotalCount(page.getTotalCount());
} pageVO.setTotalPage(page.getTotalPage());
voList.add(vo); PageResult2 pageResult2 = PageUtil.getPageInfo(pageVO);
} return resultResponse(HaoBanErrCode.ERR_1, pageResult2);
Page<AuditVO> pageVO = new Page<>(); }
pageVO.setCurrentPage(page.getCurrentPage());
pageVO.setPageSize(page.getPageSize());
pageVO.setResult(voList);
pageVO.setTotalCount(page.getTotalCount());
pageVO.setTotalPage(page.getTotalPage());
PageResult2 pageResult2 = PageUtil.getPageInfo(pageVO);
return resultResponse(HaoBanErrCode.ERR_1,pageResult2);
}
//查单个
@RequestMapping("get-store-record")
public HaobanResponse getStoreRecord(String auditId){
if(auditId == null){
return resultResponse(HaoBanErrCode.ERR_2);
}
AuditDTO auditDTO = auditApiService.findById(auditId);
AuditVO vo = EntityUtil.changeEntityByJSON(AuditVO.class, auditDTO);
String clerkCode = "";
String staffName = "";
String oldValue = auditDTO.getOldValue();
JSONObject json = JSON.parseObject(oldValue);
clerkCode = json.getString("clerkCode");
staffName = json.getString("staffName");
String headPic = json.get("headPic")== null ? "": json.get("headPic").toString();
if(auditDTO.getAuditType() == 3){
vo.setCommitReason("添加导购账号:("+clerkCode+")");
}else if(auditDTO.getAuditType() == 4){
vo.setCommitReason("删除导购账号:("+clerkCode+")");
}else if(auditDTO.getAuditType() == 5){
vo.setCommitReason("解除绑定:("+clerkCode+")");
}else{
vo.setCommitReason("绑定申请{"+staffName+"}绑定登录导购code "+clerkCode);
}
vo.setHeadPic(headPic);
vo.setCommitName(auditDTO.getCommitStaffName());
vo.setFailReason(auditDTO.getAuditReason());
vo.setStaffName(auditDTO.getCommitName());
vo.setClerkName(auditDTO.getCommitName());
if(auditDTO.getAuditType() != 0){
vo.setUpdateTime(auditDTO.getUpdateTime());
}
return resultResponse(HaoBanErrCode.ERR_1,vo);
}
//审核,1同意,2拒绝,3取消审核
@HttpLimit
@RequestMapping("clerk-audit")
public HaobanResponse clerkAudit(String auditId,String auditReason,Integer auditStatus,String wxEnterpriseId,String staffId){
if(StringUtils.isAnyBlank(auditId,wxEnterpriseId)){
return resultResponse(HaoBanErrCode.ERR_2);
}
if(auditStatus == null){
return resultResponse(HaoBanErrCode.ERR_2);
}
String key = "audit-" + auditId;
RedisUtil.lock(key, 10L);
AuditDTO audit = auditApiService.findById(auditId); //门店记录列表
if (audit == null || audit.getAuditStatus() != 0) { @RequestMapping("store-apply-list")
RedisUtil.unlock(key); public HaobanResponse storeApplyList(String storeId, String wxEnterpriseId, BasePageInfo pageInfo, Integer auditType, Integer auditStatus) {
return resultResponse(HaoBanErrCode.ERR_10017); if (StringUtils.isAnyBlank(storeId, wxEnterpriseId)) {
} return resultResponse(HaoBanErrCode.ERR_2);
StaffDTO staff = staffApiService.selectById(staffId); }
if(staff != null){
audit.setAuditName(staff.getStaffName());
}
String oldValue = audit.getOldValue();
JSONObject json = JSON.parseObject(oldValue);
String clerkCode = json.get("clerkCode")==null?"":json.get("clerkCode").toString();
String enterpriseId = audit.getEnterpriseId();
String clerkId = json.getString("clerkId")==null?"":json.get("clerkId").toString();
String clerkName = json.get("clerkName")==null?"":json.get("clerkName").toString();
String wxUserId = json.getString("wxUserId")==null?"":json.get("wxUserId").toString();
Integer sex = json.getInteger("sex")==null?0:json.getInteger("sex");
String phoneNumber = json.getString("phoneNumber")==null?"":json.get("phoneNumber").toString();
String nationCode = json.getString("nationCode")==null?"":json.get("nationCode").toString();
String auditStaffId = json.getString("staffId")==null?"":json.get("staffId").toString();
String storeId = audit.getCommitStoreId(); Page<AuditDTO> page = auditApiService.pageStoreListByParams(storeId, pageInfo, auditType, auditStatus);
if(auditStatus == 1){ List<AuditDTO> list = page.getResult();
//审核同意 List<AuditVO> voList = new ArrayList<AuditVO>();
if(audit.getAuditType() == AuditType.CLERK_BIND.getCode()){ for (AuditDTO auditDTO : list) {
//导购绑定 AuditVO vo = EntityUtil.changeEntityByJSON(AuditVO.class, auditDTO);
StaffClerkRelationDTO staffClerkRelation = staffClerkRelationApiService.getByCodeAndEnterpriseId(clerkCode,enterpriseId); String clerkCode = "";
StaffClerkRelationDTO have = staffClerkRelationApiService.getOneByStoreIdAndStaffId(storeId, auditStaffId); String staffName = "";
if(have !=null){ String oldValue = auditDTO.getOldValue();
audit.setAuditStatus(5); JSONObject json = JSON.parseObject(oldValue);
audit.setAuditReason("该成员在该门店下已经绑定过一个导购了"); clerkCode = json.getString("clerkCode");
}else{ staffName = json.getString("staffName");
ClerkDTO clerkDTO = clerkService.getClerkByClerkId(clerkId); String headPic = json.get("headPic") == null ? "" : json.get("headPic").toString();
if(clerkDTO == null){
audit.setAuditStatus(5); if (auditDTO.getAuditType() == 3) {
audit.setAuditReason("gic已删除该导购"); vo.setCommitReason("添加导购账号:(" + clerkCode + ")");
}else{ } else if (auditDTO.getAuditType() == 4) {
if(staffClerkRelation == null){ vo.setCommitReason("删除导购账号:(" + clerkCode + ")");
staffClerkRelation = new StaffClerkRelationDTO(); } else if (auditDTO.getAuditType() == 5) {
} vo.setCommitReason("解除绑定:(" + clerkCode + ")");
staffClerkRelation.setEnterpriseId(enterpriseId); } else {
staffClerkRelation.setClerkCode(clerkCode); vo.setCommitReason("绑定申请{" + staffName + "}绑定登录导购code " + clerkCode);
staffClerkRelation.setClerkId(clerkId); }
staffClerkRelation.setStoreId(storeId); vo.setCommitName(auditDTO.getCommitStaffName());
staffClerkRelation.setWxEnterpriseId(wxEnterpriseId); vo.setFailReason(auditDTO.getAuditReason());
staffClerkRelation.setWxUserId(wxUserId); vo.setStaffName(auditDTO.getCommitName());
staffClerkRelation.setStaffId(auditStaffId); vo.setClerkName(auditDTO.getCommitName());
staffClerkRelationApiService.delAndInsert(staffClerkRelation,staffId, ChannelCodeEnum.AUDIT_BIND.getCode()); vo.setHeadPic(headPic);
audit.setAuditStatus(1); if (auditDTO.getAuditType() != 0) {
//发送消息 vo.setUpdateTime(auditDTO.getUpdateTime());
staffDepartmentRelatedApiService.sendClerkBind(auditStaffId, clerkCode,storeId, auditStatus, auditReason); }
} voList.add(vo);
} }
} Page<AuditVO> pageVO = new Page<>();
if(audit.getAuditType() == AuditType.CLERK_ADD.getCode()){ pageVO.setCurrentPage(page.getCurrentPage());
//导购新增 pageVO.setPageSize(page.getPageSize());
boolean flag = syncHaobanToGicServiceApi.syncClerkToGicClerkAdd(storeId, clerkCode, sex, clerkName, phoneNumber, nationCode, null); pageVO.setResult(voList);
if(!flag){ pageVO.setTotalCount(page.getTotalCount());
return resultResponse(HaoBanErrCode.ERR_10010); pageVO.setTotalPage(page.getTotalPage());
} PageResult2 pageResult2 = PageUtil.getPageInfo(pageVO);
audit.setAuditStatus(1); return resultResponse(HaoBanErrCode.ERR_1, pageResult2);
}
//查单个
@RequestMapping("get-store-record")
public HaobanResponse getStoreRecord(String auditId) {
if (auditId == null) {
return resultResponse(HaoBanErrCode.ERR_2);
}
AuditDTO auditDTO = auditApiService.findById(auditId);
AuditVO vo = EntityUtil.changeEntityByJSON(AuditVO.class, auditDTO);
String clerkCode = "";
String staffName = "";
String oldValue = auditDTO.getOldValue();
JSONObject json = JSON.parseObject(oldValue);
clerkCode = json.getString("clerkCode");
staffName = json.getString("staffName");
String headPic = json.get("headPic") == null ? "" : json.get("headPic").toString();
if (auditDTO.getAuditType() == 3) {
vo.setCommitReason("添加导购账号:(" + clerkCode + ")");
} else if (auditDTO.getAuditType() == 4) {
vo.setCommitReason("删除导购账号:(" + clerkCode + ")");
} else if (auditDTO.getAuditType() == 5) {
vo.setCommitReason("解除绑定:(" + clerkCode + ")");
} else {
vo.setCommitReason("绑定申请{" + staffName + "}绑定登录导购code " + clerkCode);
}
vo.setHeadPic(headPic);
vo.setCommitName(auditDTO.getCommitStaffName());
vo.setFailReason(auditDTO.getAuditReason());
vo.setStaffName(auditDTO.getCommitName());
vo.setClerkName(auditDTO.getCommitName());
if (auditDTO.getAuditType() != 0) {
vo.setUpdateTime(auditDTO.getUpdateTime());
}
return resultResponse(HaoBanErrCode.ERR_1, vo);
}
//审核,1同意,2拒绝,3取消审核
@HttpLimit
@RequestMapping("clerk-audit")
public HaobanResponse clerkAudit(String auditId, String auditReason, Integer auditStatus, String wxEnterpriseId, String staffId) {
if (StringUtils.isAnyBlank(auditId, wxEnterpriseId)) {
return resultResponse(HaoBanErrCode.ERR_2);
}
if (auditStatus == null) {
return resultResponse(HaoBanErrCode.ERR_2);
}
String key = "audit-" + auditId;
RedisUtil.lock(key, 10L);
AuditDTO audit = auditApiService.findById(auditId);
if (audit == null || audit.getAuditStatus() != 0) {
RedisUtil.unlock(key);
return resultResponse(HaoBanErrCode.ERR_10017);
}
StaffDTO staff = staffApiService.selectById(staffId);
if (staff != null) {
audit.setAuditName(staff.getStaffName());
}
String oldValue = audit.getOldValue();
JSONObject json = JSON.parseObject(oldValue);
String clerkCode = json.get("clerkCode") == null ? "" : json.get("clerkCode").toString();
String enterpriseId = audit.getEnterpriseId();
String clerkId = json.getString("clerkId") == null ? "" : json.get("clerkId").toString();
String clerkName = json.get("clerkName") == null ? "" : json.get("clerkName").toString();
String wxUserId = json.getString("wxUserId") == null ? "" : json.get("wxUserId").toString();
Integer sex = json.getInteger("sex") == null ? 0 : json.getInteger("sex");
String phoneNumber = json.getString("phoneNumber") == null ? "" : json.get("phoneNumber").toString();
String nationCode = json.getString("nationCode") == null ? "" : json.get("nationCode").toString();
String auditStaffId = json.getString("staffId") == null ? "" : json.get("staffId").toString();
String storeId = audit.getCommitStoreId();
if (auditStatus == 1) {
//审核同意
if (audit.getAuditType() == AuditType.CLERK_BIND.getCode()) {
//导购绑定
StaffClerkRelationDTO staffClerkRelation = staffClerkRelationApiService.getByCodeAndEnterpriseId(clerkCode, enterpriseId);
StaffClerkRelationDTO have = staffClerkRelationApiService.getOneByStoreIdAndStaffId(storeId, auditStaffId);
if (have != null) {
audit.setAuditStatus(5);
audit.setAuditReason("该成员在该门店下已经绑定过一个导购了");
} else {
ClerkDTO clerkDTO = clerkService.getClerkByClerkId(clerkId);
if (clerkDTO == null) {
audit.setAuditStatus(5);
audit.setAuditReason("gic已删除该导购");
} else {
if (staffClerkRelation == null) {
staffClerkRelation = new StaffClerkRelationDTO();
}
staffClerkRelation.setEnterpriseId(enterpriseId);
staffClerkRelation.setClerkCode(clerkCode);
staffClerkRelation.setClerkId(clerkId);
staffClerkRelation.setStoreId(storeId);
staffClerkRelation.setWxEnterpriseId(wxEnterpriseId);
staffClerkRelation.setWxUserId(wxUserId);
staffClerkRelation.setStaffId(auditStaffId);
staffClerkRelationApiService.delAndInsert(staffClerkRelation, staffId, ChannelCodeEnum.AUDIT_BIND.getCode());
audit.setAuditStatus(1);
//发送消息
staffDepartmentRelatedApiService.sendClerkBind(auditStaffId, clerkCode, storeId, auditStatus, auditReason);
}
}
}
if (audit.getAuditType() == AuditType.CLERK_ADD.getCode()) {
//导购新增
boolean flag = syncHaobanToGicServiceApi.syncClerkToGicClerkAdd(storeId, clerkCode, sex, clerkName, phoneNumber, nationCode, null);
if (!flag) {
return resultResponse(HaoBanErrCode.ERR_10010);
}
audit.setAuditStatus(1);
// ClerkDTO clerkDTO = clerkService.getClerkByClerkCode(enterpriseId, clerkCode); // ClerkDTO clerkDTO = clerkService.getClerkByClerkCode(enterpriseId, clerkCode);
staffDepartmentRelatedApiService.sendClerkAdd(clerkName, clerkCode, storeId,auditStatus, auditReason); staffDepartmentRelatedApiService.sendClerkAdd(clerkName, clerkCode, storeId, auditStatus, auditReason);
} }
if(audit.getAuditType() == AuditType.CLERK_DEL.getCode()){ if (audit.getAuditType() == AuditType.CLERK_DEL.getCode()) {
//导购删除 //导购删除
syncHaobanToGicServiceApi.delGicClerk(clerkId); syncHaobanToGicServiceApi.delGicClerk(clerkId);
audit.setAuditStatus(1); audit.setAuditStatus(1);
staffDepartmentRelatedApiService.sendClerkDel(clerkName, clerkCode,storeId, auditStatus, auditReason); staffDepartmentRelatedApiService.sendClerkDel(clerkName, clerkCode, storeId, auditStatus, auditReason);
} }
}else if(auditStatus == 2){ } else if (auditStatus == 2) {
//审核拒绝 //审核拒绝
audit.setAuditReason(auditReason); audit.setAuditReason(auditReason);
audit.setAuditStatus(2); audit.setAuditStatus(2);
//发送消息 //发送消息
if(audit.getAuditType() == AuditType.CLERK_BIND.getCode()){ if (audit.getAuditType() == AuditType.CLERK_BIND.getCode()) {
staffDepartmentRelatedApiService.sendStaffBind(auditStaffId, clerkCode, storeId, auditStatus, auditReason); staffDepartmentRelatedApiService.sendStaffBind(auditStaffId, clerkCode, storeId, auditStatus, auditReason);
}else if (audit.getAuditType() == AuditType.CLERK_ADD.getCode()){ } else if (audit.getAuditType() == AuditType.CLERK_ADD.getCode()) {
staffDepartmentRelatedApiService.sendClerkAdd(clerkName, clerkCode, storeId,auditStatus, auditReason); staffDepartmentRelatedApiService.sendClerkAdd(clerkName, clerkCode, storeId, auditStatus, auditReason);
}else if (audit.getAuditType() == AuditType.CLERK_DEL.getCode()){ } else if (audit.getAuditType() == AuditType.CLERK_DEL.getCode()) {
staffDepartmentRelatedApiService.sendClerkDel(clerkName, clerkCode,storeId, auditStatus, auditReason); staffDepartmentRelatedApiService.sendClerkDel(clerkName, clerkCode, storeId, auditStatus, auditReason);
} }
}else if(auditStatus == 3){ } else if (auditStatus == 3) {
//取消审核 //取消审核
audit.setAuditStatus(3); audit.setAuditStatus(3);
} }
auditApiService.update(audit); auditApiService.update(audit);
RedisUtil.unlock(key); RedisUtil.unlock(key);
return resultResponse(HaoBanErrCode.ERR_1); return resultResponse(HaoBanErrCode.ERR_1);
} }
} }
package com.gic.haoban.manage.web.vo;
import java.io.Serializable;
import java.util.Date;
public class StaffClerkBindLogDetailVO implements Serializable{
private Integer logId;
private String staffId;
private String staffName;
private String optStaffId;
private String optStaffName;
private String clerkId;
private String clerkName;
private String clerkPhoneNumber;
private String wxEnterpriseId;
private Integer channelCode;
private String unbindReason;
private Date updateTime;
private Date createTime;
public Integer getLogId() { return logId; }
public void setLogId(Integer logId) { this.logId = logId; }
public String getStaffId() { return staffId; }
public void setStaffId(String staffId) { this.staffId = staffId; }
public String getStaffName() { return staffName; }
public void setStaffName(String staffName) { this.staffName = staffName; }
public String getOptStaffId() { return optStaffId; }
public void setOpStaffId(String opStaffId) { this.optStaffId = opStaffId; }
public String getOptStaffName() { return optStaffName; }
public void setOptStaffName(String opStaffName) { this.optStaffName = opStaffName; }
public void setOptStaffId(String optStaffId) { this.optStaffId = optStaffId; }
public String getClerkId() { return clerkId; }
public void setClerkId(String clerkId) { this.clerkId = clerkId; }
public String getClerkName() { return clerkName; }
public void setClerkName(String clerkName) { this.clerkName = clerkName; }
public String getClerkPhoneNumber() { return clerkPhoneNumber; }
public void setClerkPhoneNumber(String clerkPhoneNumber) { this.clerkPhoneNumber = clerkPhoneNumber; }
public String getWxEnterpriseId() { return wxEnterpriseId; }
public void setWxEnterpriseId(String wxEnterpriseId) { this.wxEnterpriseId = wxEnterpriseId; }
public Integer getChannelCode() { return channelCode; }
public void setChannelCode(Integer channelCode) { this.channelCode = channelCode; }
public String getUnbindReason() { return unbindReason; }
public void setUnbindReason(String unbindReason) { this.unbindReason = unbindReason; }
public Date getUpdateTime() { return updateTime; }
public void setUpdateTime(Date updateTime) { this.updateTime = updateTime; }
public Date getCreateTime() { return createTime; }
public void setCreateTime(Date createTime) { this.createTime = createTime; }
}
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