Browse Source

[fix]

售后管理 客诉通知
修改客诉通知service新增和编辑接口,处理sn号字符串得到数组,数组长度赋值给数量合计字段;
dev
王晓迪 3 months ago
parent
commit
389937749d
  1. 17
      ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AftersalesComplaintNoticeDetailServiceImpl.java

17
ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AftersalesComplaintNoticeDetailServiceImpl.java

@ -140,6 +140,7 @@ public class AftersalesComplaintNoticeDetailServiceImpl implements IAftersalesCo
complaintNoticeDetail.setCreateBy(loginName);
complaintNoticeDetail.setCreateTime(DateUtils.getNowDate());
String makeNo = complaintNoticeDetail.getMakeNo();
int enterpriseSum = 0;
//保存信息到AftersalesComplaintNotice数据表中
complaintNotice.setComplaintNoticeCode(newCode);
complaintNotice.setCreateBy(loginName);
@ -171,9 +172,12 @@ public class AftersalesComplaintNoticeDetailServiceImpl implements IAftersalesCo
complaintNoticeDetail.setAdverseReportUrl(aftersalesMaterialVO.getAdverseReportUrl());
// int totalQuantity = warehouseOutOrderMapper.sumOutOrderQuantityByMakeNo(makeNo);
complaintNoticeDetail.setShippedGoodsSum(aftersalesMaterialVO.getShippedGoodsSum());
complaintNotice.setEnterpriseSum(aftersalesMaterialVO.getShippedGoodsSum());
String snCodes = aftersalesMaterialVO.getSnCode();
String[] snCodeArray = snCodes.split(",");
enterpriseSum += snCodeArray.length;
aftersalesComplaintNoticeDetailMapper.insertAftersalesComplaintNoticeDetail(complaintNoticeDetail);
}
complaintNotice.setEnterpriseSum(enterpriseSum);
}
complaintNoticeMapper.insertAftersalesComplaintNotice(complaintNotice);
return 1;
@ -191,6 +195,7 @@ public class AftersalesComplaintNoticeDetailServiceImpl implements IAftersalesCo
{
AftersalesComplaintNotice aftersalesComplaintNotice = new AftersalesComplaintNotice();
String loginName = ShiroUtils.getLoginName();
int enterpriseSum = 0;
//更新主表内容
aftersalesComplaintNotice.setComplaintNoticeCode(aftersalesComplaintNoticeDetail.getComplaintNoticeCode());
aftersalesComplaintNotice.setUpdateBy(loginName);
@ -201,15 +206,13 @@ public class AftersalesComplaintNoticeDetailServiceImpl implements IAftersalesCo
aftersalesComplaintNotice.setCustomerName(aftersalesComplaintNoticeDetail.getCustomerName());
aftersalesComplaintNotice.setCustomerId(aftersalesComplaintNoticeDetail.getCustomerId());
aftersalesComplaintNotice.setClosingProcedures(aftersalesComplaintNoticeDetail.getClosingProcedures());
complaintNoticeMapper.updateAftersalesComplaintNotice(aftersalesComplaintNotice);
String complaintNoticeCode = aftersalesComplaintNoticeDetail.getComplaintNoticeCode();
List<AftersalesMaterialVO> aftersalesMaterialVOs = aftersalesComplaintNoticeDetail.getAftersalesMaterialVOs();
//如果前面相关物料信息为空
if (StringUtils.isEmpty(aftersalesMaterialVOs)){
//删除子表中的数据
int result = aftersalesComplaintNoticeDetailMapper.deleteAftersalesComplaintNoticeDetailByCode(complaintNoticeCode);
return result;
}
}else{
//如果有物料信息
int result = aftersalesComplaintNoticeDetailMapper.deleteAftersalesComplaintNoticeDetailByCode(complaintNoticeCode);
for (AftersalesMaterialVO aftersalesMaterialVO : aftersalesMaterialVOs) {
@ -237,8 +240,14 @@ public class AftersalesComplaintNoticeDetailServiceImpl implements IAftersalesCo
complaintNoticeDetail.setAdverseReportUrl(aftersalesMaterialVO.getAdverseReportUrl());
complaintNoticeDetail.setShippedGoodsSum(aftersalesMaterialVO.getShippedGoodsSum());
complaintNoticeDetail.setClosingProcedures("1");
String snCodes = aftersalesMaterialVO.getSnCode();
String[] snCodeArray = snCodes.split(",");
enterpriseSum += snCodeArray.length;
aftersalesComplaintNoticeDetailMapper.insertAftersalesComplaintNoticeDetail(complaintNoticeDetail);
}
}
aftersalesComplaintNotice.setEnterpriseSum(enterpriseSum);
complaintNoticeMapper.updateAftersalesComplaintNotice(aftersalesComplaintNotice);
return 1;
}

Loading…
Cancel
Save