Commit c94623fc by 徐高华

批量修改活码

parent a3757dda
...@@ -162,6 +162,8 @@ public class HmClerkRelationServiceImpl implements HmClerkRelationService { ...@@ -162,6 +162,8 @@ public class HmClerkRelationServiceImpl implements HmClerkRelationService {
List<TabHaobanHmClerkRelation> staffRelationList = map.get(hmId) ; List<TabHaobanHmClerkRelation> staffRelationList = map.get(hmId) ;
if (CollectionUtils.isEmpty(staffRelationList)) { if (CollectionUtils.isEmpty(staffRelationList)) {
log.info("活码无关联导购={}",hmId); log.info("活码无关联导购={}",hmId);
HmBatchModifyResultDTO err = new HmBatchModifyResultDTO(hmId,3,"无关联导购") ;
errList.add(err) ;
continue; continue;
} }
Set<String> staffIdSet = staffRelationList.stream().map(o->o.getStaffId()).collect(Collectors.toSet()) ; Set<String> staffIdSet = staffRelationList.stream().map(o->o.getStaffId()).collect(Collectors.toSet()) ;
...@@ -223,6 +225,30 @@ public class HmClerkRelationServiceImpl implements HmClerkRelationService { ...@@ -223,6 +225,30 @@ public class HmClerkRelationServiceImpl implements HmClerkRelationService {
if (StringUtils.isBlank(taskId)) { if (StringUtils.isBlank(taskId)) {
return ServiceResponse.failure("9999", "创建任务失败") ; return ServiceResponse.failure("9999", "创建任务失败") ;
} }
if(CollectionUtils.isNotEmpty(errList)) {
List<TabHaobanPreDealLog> dealLogList = new ArrayList<>() ;
for(HmBatchModifyResultDTO err : errList) {
if(err.getErrcode()==1 || err.getErrcode()==3) {
Long hmid = err.getHmid() ;
TabHaobanPreDealLog dealLog = new TabHaobanPreDealLog();
dealLog.setEnterpriseId(enterpriseId);
dealLog.setWxEnterpriseId(wxEnterpriseId);
dealLog.setTaskId(taskId);
dealLog.setDataId(hmid+"") ;
dealLog.setpDataId(hmid+"");
dealLog.setDataContent(JSON.toJSONString(modifyMap.get(hmid)));
dealLog.setDataType(PreDealTypeEnum.modify_hm.getVal());
dealLog.setStatusFlag(3);
dealLog.setReason(err.getMessage());
dealLogList.add(dealLog) ;
}
}
if(CollectionUtils.isNotEmpty(dealLogList)) {
this.preDealService.insert(dealLogList);
}
}
log.info("总任务数={},taskid={}",modifyMap.size(),taskId); log.info("总任务数={},taskid={}",modifyMap.size(),taskId);
List<TabHaobanPreDealLog> dealLogList = modifyMap.keySet().stream().map(hmid -> { List<TabHaobanPreDealLog> dealLogList = modifyMap.keySet().stream().map(hmid -> {
TabHaobanPreDealLog dealLog = new TabHaobanPreDealLog(); TabHaobanPreDealLog dealLog = new TabHaobanPreDealLog();
......
...@@ -280,6 +280,9 @@ public class HmQrcodeController { ...@@ -280,6 +280,9 @@ public class HmQrcodeController {
qdto.setEnterpriseId(loginUser.getEnterpriseId()); qdto.setEnterpriseId(loginUser.getEnterpriseId());
ServiceResponse<List<HmBatchModifyResultDTO>> resp = this.hmQrcodeApiService.batchModify(qdto) ; ServiceResponse<List<HmBatchModifyResultDTO>> resp = this.hmQrcodeApiService.batchModify(qdto) ;
if(resp.isSuccess()) { if(resp.isSuccess()) {
if(null == resp.getResult()) {
return RestResponse.successResult(resp.getMessage()) ;
}
return RestResponse.successResult(resp.getResult()) ; return RestResponse.successResult(resp.getResult()) ;
} }
return RestResponse.failure("9999", resp.getMessage()) ; return RestResponse.failure("9999", resp.getMessage()) ;
......
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