| @@ -24,10 +24,10 @@ public class WxCouponSendConfigController extends BaseController { | |||||
| private WxCouponSendConfigService wxCouponSendConfigService; | private WxCouponSendConfigService wxCouponSendConfigService; | ||||
| @ApiOperation("获取开关") | @ApiOperation("获取开关") | ||||
| @GetMapping("getCouponSendConfig") | |||||
| public ResultData getCouponSendConfig(@RequestAttribute WxCouponSendConfig wxCouponSendConfig) { | |||||
| @GetMapping("get") | |||||
| public ResultData getCouponSendConfig(@ModelAttribute WxCouponSendConfig wxCouponSendConfig) { | |||||
| logger.debug("[" + getIpAddr() + "] WxMallConfigController::getCouponSendConfig"); | logger.debug("[" + getIpAddr() + "] WxMallConfigController::getCouponSendConfig"); | ||||
| if (wxCouponSendConfig == null || wxCouponSendConfig.getSendType() != null) | |||||
| if (wxCouponSendConfig == null || wxCouponSendConfig.getSendType() == null) | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR); | return new ResultData(ErrorCode.SYS_PARAMETER_ERROR); | ||||
| wxCouponSendConfig.setTenantId(getTenantId()); | wxCouponSendConfig.setTenantId(getTenantId()); | ||||
| @@ -39,12 +39,14 @@ public class WxCouponSendConfigController extends BaseController { | |||||
| } | } | ||||
| @PostMapping("updateCouponSendConfig") | |||||
| @PostMapping("update") | |||||
| @ApiOperation("修改开关") | @ApiOperation("修改开关") | ||||
| public ResultData updateCouponSendConfig(@RequestBody WxCouponSendConfig wxCouponSendConfig) { | public ResultData updateCouponSendConfig(@RequestBody WxCouponSendConfig wxCouponSendConfig) { | ||||
| logger.debug("[" + getIpAddr() + "] WxMallConfigController::updateStopCarConpon"); | logger.debug("[" + getIpAddr() + "] WxMallConfigController::updateStopCarConpon"); | ||||
| if (wxCouponSendConfig == null) | if (wxCouponSendConfig == null) | ||||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR); | return new ResultData(ErrorCode.SYS_PARAMETER_ERROR); | ||||
| if (wxCouponSendConfig.getId() == null) | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR); | |||||
| if (wxCouponSendConfig.getSendType() == null) | if (wxCouponSendConfig.getSendType() == null) | ||||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR); | return new ResultData(ErrorCode.SYS_PARAMETER_ERROR); | ||||
| if (wxCouponSendConfig.getValue() == null) | if (wxCouponSendConfig.getValue() == null) | ||||
| @@ -7,7 +7,7 @@ import java.util.List; | |||||
| import javax.persistence.Id; | import javax.persistence.Id; | ||||
| import java.io.Serializable; | import java.io.Serializable; | ||||
| @Table(name = "wx_mall_config") | |||||
| @Table(name = "wx_coupon_send_config") | |||||
| public class WxCouponSendConfig implements Serializable { | public class WxCouponSendConfig implements Serializable { | ||||
| private static final long serialVersionUID = 1L; | private static final long serialVersionUID = 1L; | ||||
| @@ -6,7 +6,7 @@ import com.iformall.domain.po.WxCouponSendConfig; | |||||
| public interface WxCouponSendConfigMapper extends CommonMapper<WxCouponSendConfig, Long> { | public interface WxCouponSendConfigMapper extends CommonMapper<WxCouponSendConfig, Long> { | ||||
| List<WxCouponSendConfig> findList(WxCouponSendConfig wxMallConfig); | |||||
| List<WxCouponSendConfig> findList(WxCouponSendConfig wxCouponSendConfig); | |||||
| @@ -9,25 +9,25 @@ import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.stereotype.Service; | import org.springframework.stereotype.Service; | ||||
| import com.iformall.common.IdWorker; | |||||
| @Service | @Service | ||||
| public class WxCouponSendConfigServiceImpl implements WxCouponSendConfigService { | public class WxCouponSendConfigServiceImpl implements WxCouponSendConfigService { | ||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | private final Logger logger = LoggerFactory.getLogger(this.getClass()); | ||||
| @Autowired | @Autowired | ||||
| WxCouponSendConfigMapper wxMallConfigMapper; | |||||
| WxCouponSendConfigMapper wxCouponSendConfigMapper; | |||||
| @Override | @Override | ||||
| public PageInfo<WxCouponSendConfig> listAsPage(WxCouponSendConfig record, Integer pageIndex, Integer pageSize) { | public PageInfo<WxCouponSendConfig> listAsPage(WxCouponSendConfig record, Integer pageIndex, Integer pageSize) { | ||||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxMallConfigMapper.findList(record)); | |||||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCouponSendConfigMapper.findList(record)); | |||||
| } | } | ||||
| @Override | @Override | ||||
| public void update(WxCouponSendConfig record) { | public void update(WxCouponSendConfig record) { | ||||
| wxMallConfigMapper.updateByPrimaryKeySelective(record); | |||||
| wxCouponSendConfigMapper.updateByPrimaryKeySelective(record); | |||||
| } | } | ||||
| @@ -28,7 +28,7 @@ | |||||
| </if> | </if> | ||||
| <if test=" null != key "> | |||||
| <if test=" null != sendType "> | |||||
| and `send_type` = #{sendType} | and `send_type` = #{sendType} | ||||
| </if> | </if> | ||||
| @@ -65,10 +65,6 @@ | |||||
| select <include refid="allColumns" /> from wx_coupon_send_config | select <include refid="allColumns" /> from wx_coupon_send_config | ||||
| <include refid="dynamicWhereConditions" /> | <include refid="dynamicWhereConditions" /> | ||||
| </select> | </select> | ||||
| </mapper> | </mapper> | ||||