Commit b639ede0 by fudahua

Merge remote-tracking branch 'origin/developer' into developer

parents 4292a7fc 700f0c47
...@@ -170,16 +170,30 @@ public class AuditApiServiceImpl implements AuditApiService{ ...@@ -170,16 +170,30 @@ public class AuditApiServiceImpl implements AuditApiService{
logger.info("code已存在"); logger.info("code已存在");
tab.setAuditStatus(5); tab.setAuditStatus(5);
auditMapper.updateByPrimaryKeySelective(tab); auditMapper.updateByPrimaryKeySelective(tab);
if(org.apache.commons.lang.StringUtils.isNotBlank(batchId)){
insertBatchLog( batchId,AuditRsultType.fail.getCode(),tab);
}
return "0"; return "0";
}else{ }else{
staffClerkRelation = new StaffClerkRelationDTO(); ClerkDTO clerkDTO = clerkService.getClerkByClerkId(obj.getClerkId());
staffClerkRelation.setEnterpriseId(tab.getEnterpriseId()); if(clerkDTO == null){
staffClerkRelation.setClerkCode(obj.getClerkCode()); tab.setAuditStatus(5);
staffClerkRelation.setClerkId(obj.getClerkId()); tab.setAuditReason("gic已删除该导购");
staffClerkRelation.setStoreId(tab.getCommitStoreId()); auditMapper.updateByPrimaryKeySelective(tab);
staffClerkRelation.setWxEnterpriseId(tab.getWxEnterpriseId()); if(org.apache.commons.lang.StringUtils.isNotBlank(batchId)){
staffClerkRelation.setWxUserId(obj.getWxUserId()); insertBatchLog( batchId,AuditRsultType.fail.getCode(),tab);
staffClerkRelationApiService.insert(staffClerkRelation); }
return "0";
}else{
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());
staffClerkRelationApiService.insert(staffClerkRelation);
}
} }
if(org.apache.commons.lang.StringUtils.isNotBlank(batchId)){ if(org.apache.commons.lang.StringUtils.isNotBlank(batchId)){
insertBatchLog( batchId,AuditRsultType.success.getCode(), tab); insertBatchLog( batchId,AuditRsultType.success.getCode(), tab);
...@@ -190,21 +204,32 @@ public class AuditApiServiceImpl implements AuditApiService{ ...@@ -190,21 +204,32 @@ public class AuditApiServiceImpl implements AuditApiService{
//门店导购新增 //门店导购新增
String oldValue = tab.getOldValue(); String oldValue = tab.getOldValue();
AuditStaffDTO obj = JSONObject.parseObject(oldValue,AuditStaffDTO.class); AuditStaffDTO obj = JSONObject.parseObject(oldValue,AuditStaffDTO.class);
boolean flag = syncHaobanToGicServiceApi.syncClerkToGicClerkAdd(tab.getCommitStoreId(), obj.getClerkCode(), obj.getSex(), obj.getStaffName(), obj.getPhoneNumber(), obj.getNationCode(), null); ClerkDTO clerkDTO = clerkService.getClerkByClerkId(obj.getClerkId());
if(!flag){ if(clerkDTO == null){
//失败
tab.setAuditStatus(5); tab.setAuditStatus(5);
tab.setAuditReason("gic已删除该导购");
auditMapper.updateByPrimaryKeySelective(tab); auditMapper.updateByPrimaryKeySelective(tab);
if(org.apache.commons.lang.StringUtils.isNotBlank(batchId)){ if(org.apache.commons.lang.StringUtils.isNotBlank(batchId)){
insertBatchLog( batchId,AuditRsultType.fail.getCode(), tab); insertBatchLog( batchId,AuditRsultType.fail.getCode(),tab);
return "0"; }
} return "0";
}else{ }else{
//成功 boolean flag = syncHaobanToGicServiceApi.syncClerkToGicClerkAdd(tab.getCommitStoreId(), obj.getClerkCode(), obj.getSex(), obj.getStaffName(), obj.getPhoneNumber(), obj.getNationCode(), null);
if(org.apache.commons.lang.StringUtils.isNotBlank(batchId)){ if(!flag){
insertBatchLog( batchId,1, tab); //失败
tab.setAuditStatus(5);
auditMapper.updateByPrimaryKeySelective(tab);
if(org.apache.commons.lang.StringUtils.isNotBlank(batchId)){
insertBatchLog( batchId,AuditRsultType.fail.getCode(), tab);
return "0";
}
}else{
//成功
if(org.apache.commons.lang.StringUtils.isNotBlank(batchId)){
insertBatchLog( batchId,1, tab);
}
staffDepartmentRelatedApiService.sendClerkAdd(obj.getClerkId(), obj.getClerkCode(), 1, "");
} }
staffDepartmentRelatedApiService.sendClerkAdd(obj.getClerkId(), obj.getClerkCode(), 1, "");
} }
}else if(auditType == AuditType.CLERK_DEL.getCode()){ }else if(auditType == AuditType.CLERK_DEL.getCode()){
......
...@@ -14,6 +14,7 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -14,6 +14,7 @@ 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;
import com.gic.clerk.api.dto.ClerkDTO;
import com.gic.clerk.api.service.ClerkService; import com.gic.clerk.api.service.ClerkService;
import com.gic.commons.util.EntityUtil; import com.gic.commons.util.EntityUtil;
import com.gic.haoban.base.api.common.BasePageInfo; import com.gic.haoban.base.api.common.BasePageInfo;
...@@ -209,27 +210,39 @@ public class AuditController extends WebBaseController{ ...@@ -209,27 +210,39 @@ public class AuditController extends WebBaseController{
if(staffClerkRelation != null){ if(staffClerkRelation != null){
return resultResponse(HaoBanErrCode.ERR_111117); return resultResponse(HaoBanErrCode.ERR_111117);
}else{ }else{
staffClerkRelation = new StaffClerkRelationDTO(); ClerkDTO clerkDTO = clerkService.getClerkByClerkId(clerkId);
staffClerkRelation.setEnterpriseId(enterpriseId); if(clerkDTO == null){
staffClerkRelation.setClerkCode(clerkCode); audit.setAuditStatus(5);
staffClerkRelation.setClerkId(clerkId); audit.setAuditReason("gic已删除该导购");
staffClerkRelation.setStoreId(storeId); }else{
staffClerkRelation.setWxEnterpriseId(wxEnterpriseId); staffClerkRelation = new StaffClerkRelationDTO();
staffClerkRelation.setWxUserId(wxUserId); staffClerkRelation.setEnterpriseId(enterpriseId);
staffClerkRelationApiService.insert(staffClerkRelation); staffClerkRelation.setClerkCode(clerkCode);
audit.setAuditStatus(1); staffClerkRelation.setClerkId(clerkId);
staffClerkRelation.setStoreId(storeId);
staffClerkRelation.setWxEnterpriseId(wxEnterpriseId);
staffClerkRelation.setWxUserId(wxUserId);
staffClerkRelationApiService.insert(staffClerkRelation);
audit.setAuditStatus(1);
//发送消息
staffDepartmentRelatedApiService.sendClerkBind(clerkId, clerkCode, auditStatus, auditReason);
}
} }
//发送消息
staffDepartmentRelatedApiService.sendClerkBind(clerkId, clerkCode, auditStatus, auditReason);
} }
if(audit.getAuditType() == AuditType.CLERK_ADD.getCode()){ if(audit.getAuditType() == AuditType.CLERK_ADD.getCode()){
//导购新增 //导购新增
boolean flag = syncHaobanToGicServiceApi.syncClerkToGicClerkAdd(storeId, clerkCode, sex, staff.getStaffName(), phoneNumber, nationCode, null); ClerkDTO clerkDTO = clerkService.getClerkByClerkId(clerkId);
if(!flag){ if(clerkDTO == null){
return resultResponse(HaoBanErrCode.ERR_10010); audit.setAuditStatus(5);
audit.setAuditReason("gic已删除该导购");
}else{
boolean flag = syncHaobanToGicServiceApi.syncClerkToGicClerkAdd(storeId, clerkCode, sex, staff.getStaffName(), phoneNumber, nationCode, null);
if(!flag){
return resultResponse(HaoBanErrCode.ERR_10010);
}
audit.setAuditStatus(1);
staffDepartmentRelatedApiService.sendClerkAdd(clerkId, clerkCode, auditStatus, auditReason);
} }
audit.setAuditStatus(1);
staffDepartmentRelatedApiService.sendClerkAdd(clerkId, clerkCode, auditStatus, auditReason);
} }
if(audit.getAuditType() == AuditType.CLERK_DEL.getCode()){ if(audit.getAuditType() == AuditType.CLERK_DEL.getCode()){
//导购删除 //导购删除
......
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