|
|
|
@ -314,7 +314,7 @@ public class BuyerServiceImpl implements BuyerService { |
|
|
|
|
buyerEntity1.setBuyerCode(buyerCode); |
|
|
|
|
List<BuyerEntity> entities = buyerMapper.selectBuyerByBuyerEntity(buyerEntity1, shList1); |
|
|
|
|
if(entities != null && entities.size() > 0){ |
|
|
|
|
return buyerEntities.get(0); |
|
|
|
|
return entities.get(0); |
|
|
|
|
} |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
@ -413,6 +413,11 @@ public class BuyerServiceImpl implements BuyerService { |
|
|
|
|
/** |
|
|
|
|
* 根据入参进行判断是新增还是修改 |
|
|
|
|
*/ |
|
|
|
|
buyerEntity.setAddress(""); |
|
|
|
|
buyerEntity.setPhone(""); |
|
|
|
|
buyerEntity.setBankNumber(""); |
|
|
|
|
buyerEntity.setBankOfDeposit(""); |
|
|
|
|
|
|
|
|
|
Boolean isAdd = false; |
|
|
|
|
if(StringUtils.isBlank(buyerEntity.getId())){ |
|
|
|
|
isAdd = true; |
|
|
|
@ -433,7 +438,9 @@ public class BuyerServiceImpl implements BuyerService { |
|
|
|
|
} |
|
|
|
|
// 处理MDM默认银行账户等信息
|
|
|
|
|
//判断是否存在默认银行信息
|
|
|
|
|
Boolean isDefaultMark = true; |
|
|
|
|
if(isAdd && existBuyer != null){ |
|
|
|
|
return r.put("message", "客户编码已存在").put(OrderManagementConstant.CODE, ConfigureConstant.STRING_9999); |
|
|
|
|
} |
|
|
|
|
String buyerId = baseService.getGenerateShotKey(); |
|
|
|
|
if (CollectionUtil.isNotEmpty(buyerEntity.getBuyerEntityDetail())) { |
|
|
|
|
for (BuyerEntityDetail t : buyerEntity.getBuyerEntityDetail()) { |
|
|
|
@ -451,27 +458,19 @@ public class BuyerServiceImpl implements BuyerService { |
|
|
|
|
buyerEntity.setPhone(t.getPhone()); |
|
|
|
|
buyerEntity.setBankNumber(t.getBankAccount()); |
|
|
|
|
buyerEntity.setBankOfDeposit(t.getBankName()); |
|
|
|
|
isDefaultMark = false; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
buyerMapper.deleteBuyerDetail(buyerEntity.getId()); |
|
|
|
|
if(buyerEntity.getBuyerEntityDetail() != null && buyerEntity.getBuyerEntityDetail().size()>0){ |
|
|
|
|
buyerMapper.batchInsertBuyerDetail(buyerEntity.getBuyerEntityDetail()); |
|
|
|
|
} |
|
|
|
|
if(isAdd && existBuyer != null){ |
|
|
|
|
return r.put("message", "客户编码已存在").put(OrderManagementConstant.CODE, ConfigureConstant.STRING_9999); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (existBuyer != null) {//StringUtils.isNotBlank(buyerEntity.getId())
|
|
|
|
|
if (existBuyer != null) {//StringUtils.isNotBlank(buyerEntity.getId())修改客户信息
|
|
|
|
|
|
|
|
|
|
buyerEntity.setModifyTime(new Date()); |
|
|
|
|
if(isDefaultMark){ |
|
|
|
|
buyerEntity.setAddress(""); |
|
|
|
|
buyerEntity.setPhone(""); |
|
|
|
|
buyerEntity.setBankNumber(""); |
|
|
|
|
buyerEntity.setBankOfDeposit(""); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//更新明细表,最好的办法是先删除后新增
|
|
|
|
|
int i = buyerMapper.updateBuyer(buyerEntity, shList); |
|
|
|
|
|
|
|
|
@ -479,8 +478,7 @@ public class BuyerServiceImpl implements BuyerService { |
|
|
|
|
r.put("message", "修改失败").put(OrderManagementConstant.CODE, ConfigureConstant.STRING_9999); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
//新增购方信息
|
|
|
|
|
} else { //新增购方信息
|
|
|
|
|
if (StringUtils.isBlank(buyerEntity.getBuyerCode())) { |
|
|
|
|
buyerEntity.setBuyerCode(baseService.getGenerateShotKey()); |
|
|
|
|
} |
|
|
|
@ -621,6 +619,7 @@ public class BuyerServiceImpl implements BuyerService { |
|
|
|
|
queryBuyerEntity.setTaxpayerCode(buyerEntity.getTaxpayerCode()); |
|
|
|
|
queryBuyerEntity.setPurchaseName(buyerEntity.getPurchaseName()); |
|
|
|
|
} |
|
|
|
|
queryBuyerEntity.setEntId(buyerEntity.getDeptId()); |
|
|
|
|
|
|
|
|
|
List<String> shList = new ArrayList<>(); |
|
|
|
|
shList.add(buyerEntity.getXhfNsrsbh()); |
|
|
|
|