feature:客户信息新增列表地址电话置空调整

release
gaorl 2 years ago
parent a72bf3cede
commit 2cdb25106d
  1. 27
      order-management-base-service/src/main/java/com/dxhy/order/baseservice/module/buyer/service/impl/BuyerServiceImpl.java
  2. 59
      order-management-base-service/src/main/resources/mybatis/mapper/BuyerMapper.xml

@ -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());

@ -906,33 +906,45 @@
<select id="selectBuyer" parameterType="String" resultMap="BaseResultMap">
<bind name="dataType" value="${dataType}"/>
SELECT
id,
taxpayer_code,
purchase_name,
address,
phone,
bank_of_deposit,
bank_number,
email,
sjh,
remarks,
create_user_id,
bmi.id,
bmi.taxpayer_code,
bmi.purchase_name,
bmi.address,
bmi.phone,
bmi.bank_of_deposit,
bmi.bank_number,
bmi.email,
bmi.sjh,
bmi.remarks,
bmi.create_user_id,
<if test="dataType == 0">
DATE_FORMAT(create_time,'%Y-%m-%d') as createTime,
DATE_FORMAT(modify_time,'%Y-%m-%d') as modifyTime,
DATE_FORMAT(bmi.create_time,'%Y-%m-%d') as createTime,
DATE_FORMAT(bmi.modify_time,'%Y-%m-%d') as modifyTime,
</if>
<if test="dataType == 1">
to_char(create_time,'yyyy-MM-dd') as createTime,
to_char(modify_time,'yyyy-MM-dd') as modifyTime,
to_char(bmi.create_time,'yyyy-MM-dd') as createTime,
to_char(bmi.modify_time,'yyyy-MM-dd') as modifyTime,
</if>
modify_user_id,
ghf_qylx,
buyer_code,
status,
sync_order,
ent_id
bmi.modify_user_id,
bmi.ghf_qylx,
bmi.xhf_nsrsbh,
bmi.xhf_mc,
bmi.buyer_code,
bmi.create_time,
bmi.status,
bmi.sync_order,
bmi.ent_id,
bmid.consumer_id,
bmid.buyer_manage_id,
bmid.bank_name,
bmid.bank_account,
bmid.address as bmid_address,
bmid.phone as bmid_phone,
bmid.default_mark,
bmid.create_user,
bmid.update_user
FROM
buyer_manage_info
buyer_manage_info bmi left join buyer_manage_info_detail bmid on bmi.id = bmid.buyer_manage_id
<where>
<if test="shList != null and shList.size() == 0">
and xhf_nsrsbh = ''
@ -1100,6 +1112,9 @@
<if test="buyer.purchaseName != null and buyer.purchaseName != ''">
and purchase_name = #{buyer.purchaseName,jdbcType=VARCHAR}
</if>
<if test="buyer.entId != null and buyer.entId != ''">
and ent_id = #{buyer.entId,jdbcType=VARCHAR}
</if>
<if test="buyer.buyerCode != null and buyer.buyerCode != ''">
and buyer_code = #{buyer.buyerCode,jdbcType=VARCHAR}
</if>

Loading…
Cancel
Save