| @@ -7,6 +7,7 @@ import com.iformall.common.ResultData; | |||||
| import com.iformall.controller.base.BaseController; | import com.iformall.controller.base.BaseController; | ||||
| import com.iformall.domain.po.WxBrand; | import com.iformall.domain.po.WxBrand; | ||||
| import com.iformall.domain.po.WxMerchant; | import com.iformall.domain.po.WxMerchant; | ||||
| import com.iformall.enums.EnumDelFlag; | |||||
| import com.iformall.service.WxBrandService; | import com.iformall.service.WxBrandService; | ||||
| import com.iformall.service.WxMerchantService; | import com.iformall.service.WxMerchantService; | ||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| @@ -66,7 +67,7 @@ public class WxBrandController extends BaseController { | |||||
| logger.debug("[" + getIpAddr() + "] WxBrandController::update"); | logger.debug("[" + getIpAddr() + "] WxBrandController::update"); | ||||
| wxBrand.setTenantId(getTenantId()); | wxBrand.setTenantId(getTenantId()); | ||||
| if(wxBrand.getIsDel().equals(1)){ | |||||
| if(EnumDelFlag.YES.getCode().equals(wxBrand.getIsDel())){ | |||||
| //判断是否解绑商户 | //判断是否解绑商户 | ||||
| WxMerchant wxMerchant = new WxMerchant(); | WxMerchant wxMerchant = new WxMerchant(); | ||||
| wxMerchant.setTenantId(wxBrand.getTenantId()); | wxMerchant.setTenantId(wxBrand.getTenantId()); | ||||
| @@ -12,6 +12,7 @@ import com.iformall.domain.vo.WxCouponStatisVo; | |||||
| import com.iformall.enums.EnumCouponChannelStatus; | import com.iformall.enums.EnumCouponChannelStatus; | ||||
| import com.iformall.enums.EnumCouponType; | import com.iformall.enums.EnumCouponType; | ||||
| import com.iformall.enums.EnumCouponValidType; | import com.iformall.enums.EnumCouponValidType; | ||||
| import com.iformall.enums.EnumDelFlag; | |||||
| import com.iformall.mapper.WxCouponChannelMapper; | import com.iformall.mapper.WxCouponChannelMapper; | ||||
| import com.iformall.service.WxCouponService; | import com.iformall.service.WxCouponService; | ||||
| import com.iformall.utils.DateUtils; | import com.iformall.utils.DateUtils; | ||||
| @@ -67,7 +68,7 @@ public class WxCouponController extends BaseController { | |||||
| if (wxCoupon.getId() == null) { | if (wxCoupon.getId() == null) { | ||||
| return new ResultData(ResultData.ERROR, "缺少id"); | return new ResultData(ResultData.ERROR, "缺少id"); | ||||
| } | } | ||||
| if(wxCoupon.getIsDel().equals(1)){ | |||||
| if(EnumDelFlag.YES.getCode().equals(wxCoupon.getIsDel())){ | |||||
| WxCouponChannel query = new WxCouponChannel(); | WxCouponChannel query = new WxCouponChannel(); | ||||
| query.setTenantId(wxCoupon.getTenantId()); | query.setTenantId(wxCoupon.getTenantId()); | ||||
| query.setCouponId(wxCoupon.getId()); | query.setCouponId(wxCoupon.getId()); | ||||
| @@ -1,6 +1,5 @@ | |||||
| package com.iformall.domain.po; | package com.iformall.domain.po; | ||||
| import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | |||||
| import lombok.Data; | import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | import lombok.EqualsAndHashCode; | ||||
| import lombok.ToString; | import lombok.ToString; | ||||
| @@ -0,0 +1,36 @@ | |||||
| package com.iformall.enums; | |||||
| /** | |||||
| * Created by luozukai | |||||
| */ | |||||
| public enum EnumDelFlag { | |||||
| YES(1, "是"), | |||||
| NO(0, "否"), | |||||
| ; | |||||
| public static EnumDelFlag getEnum(Integer code) { | |||||
| for (EnumDelFlag value : values()) { | |||||
| if (value.getCode().equals(code)) { | |||||
| return value; | |||||
| } | |||||
| } | |||||
| return null; | |||||
| } | |||||
| private Integer code; | |||||
| private String message; | |||||
| EnumDelFlag(Integer code, String message) { | |||||
| this.code = code; | |||||
| this.message = message; | |||||
| } | |||||
| public Integer getCode() { | |||||
| return code; | |||||
| } | |||||
| public String getMessage() { | |||||
| return message; | |||||
| } | |||||
| } | |||||
| @@ -8,6 +8,7 @@ import com.iformall.common.Result; | |||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.domain.po.WxBrand; | import com.iformall.domain.po.WxBrand; | ||||
| import com.iformall.domain.po.WxShop; | import com.iformall.domain.po.WxShop; | ||||
| import com.iformall.enums.EnumDelFlag; | |||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| import com.iformall.mapper.WxBrandMapper; | import com.iformall.mapper.WxBrandMapper; | ||||
| import com.iformall.service.WxBrandService; | import com.iformall.service.WxBrandService; | ||||
| @@ -69,7 +70,7 @@ public class WxBrandServiceImpl implements WxBrandService { | |||||
| @Override | @Override | ||||
| public ResultData update(WxBrand wxBrand) { | public ResultData update(WxBrand wxBrand) { | ||||
| if(wxBrand.getIsDel().equals(1)){ | |||||
| if(EnumDelFlag.YES.getCode().equals(wxBrand.getIsDel())){ | |||||
| wxBrand.setUpdatetime(new Date()); | wxBrand.setUpdatetime(new Date()); | ||||
| wxBrandMapper.updateByPrimaryKeySelective(wxBrand); | wxBrandMapper.updateByPrimaryKeySelective(wxBrand); | ||||
| return new ResultData(Result.SUCCESS, "操作成功"); | return new ResultData(Result.SUCCESS, "操作成功"); | ||||