Browse Source

[商户][修改][删除操作]

release_toaliyun_real
gongbiao 6 years ago
parent
commit
602851d3b1
2 changed files with 7 additions and 5 deletions
  1. +6
    -4
      mallinkService/src/main/java/com/iformall/service/impl/WxMerchantServiceImpl.java
  2. +1
    -1
      mallinkService/src/main/resources/mapper/WxMerchantMapper.xml

+ 6
- 4
mallinkService/src/main/java/com/iformall/service/impl/WxMerchantServiceImpl.java View File

@@ -415,10 +415,7 @@ public class WxMerchantServiceImpl implements WxMerchantService {
if (wxMerchant.getId() == null) { if (wxMerchant.getId() == null) {
return new ResultData(ErrorCode.MERCHANT_INFO_NOT_FOUND); return new ResultData(ErrorCode.MERCHANT_INFO_NOT_FOUND);
} }
//检查商户名称
if (hasMerchant(wxMerchant)) {
return new ResultData(ErrorCode.MERCHANT_NAME_IS_FOUND);
}

if(wxMerchant.getIsDel() != null && wxMerchant.getIsDel().equals(EnumDelStatus.DEL.getCode())) { if(wxMerchant.getIsDel() != null && wxMerchant.getIsDel().equals(EnumDelStatus.DEL.getCode())) {
// 停用商户 // 停用商户
WxMerchant oldMerchant = wxMerchantMapper.selectByPrimaryKey(wxMerchant.getId()); WxMerchant oldMerchant = wxMerchantMapper.selectByPrimaryKey(wxMerchant.getId());
@@ -427,6 +424,11 @@ public class WxMerchantServiceImpl implements WxMerchantService {
logger.error("停车商户不能被删除"); logger.error("停车商户不能被删除");
return new ResultData(ErrorCode.MERCHANT_CAR_NOT_DEL); return new ResultData(ErrorCode.MERCHANT_CAR_NOT_DEL);
} }
} else {
//检查商户名称
if (hasMerchant(wxMerchant)) {
return new ResultData(ErrorCode.MERCHANT_NAME_IS_FOUND);
}
} }
Date date = new Date(); Date date = new Date();
wxMerchant.setUpdateDate(date); wxMerchant.setUpdateDate(date);


+ 1
- 1
mallinkService/src/main/resources/mapper/WxMerchantMapper.xml View File

@@ -297,7 +297,7 @@
<include refid="allMerchantVoColumns"/> <include refid="allMerchantVoColumns"/>
FROM wx_merchant m FROM wx_merchant m
left join wx_business bu on bu.id = m.business_id left join wx_business bu on bu.id = m.business_id
where 1=1
where 1=1 and m.is_del=0
<if test=" null != merchantName and ''!=merchantName "> <if test=" null != merchantName and ''!=merchantName ">
and m.`name` like concat('%', #{merchantName},'%') and m.`name` like concat('%', #{merchantName},'%')
</if> </if>


Loading…
Cancel
Save