Commit 72c9b39796783b46f5fca20649409c03b41f4ac8

Authored by yeqianyong
1 parent afe1a933

楚江ERP-客户开发取消接口开发

... ... @@ -136,6 +136,18 @@ public class CustomerDevelopPlanController extends DefaultBaseController {
136 136 return InvokeResultBuilder.success();
137 137 }
138 138
  139 + /**
  140 + * 取消
  141 + *
  142 + */
  143 + @ApiOperation("取消")
  144 + @HasPermission({"customer:develop:cancel"})
  145 + @GetMapping("/cancel")
  146 + public InvokeResult<Void> cancel(@NotBlank(message = "id不能为空!") String id) {
  147 + customerDevelopPlanService.cancel(id);
  148 + return InvokeResultBuilder.success();
  149 + }
  150 +
139 151
140 152 /**
141 153 * 封装客户开发数据
... ...
... ... @@ -17,6 +17,7 @@ import com.lframework.starter.web.core.utils.PageHelperUtil;
17 17 import com.lframework.starter.common.utils.Assert;
18 18 import com.lframework.starter.web.inner.components.oplog.OtherOpLogType;
19 19 import com.lframework.xingyun.sc.enums.CustomerDevelopStatus;
  20 +import org.apache.commons.lang3.StringUtils;
20 21 import org.springframework.transaction.annotation.Transactional;
21 22 import com.lframework.xingyun.sc.mappers.CustomerDevelopPlanMapper;
22 23 import com.lframework.xingyun.sc.service.customer.CustomerDevelopPlanService;
... ... @@ -195,4 +196,17 @@ public class CustomerDevelopPlanServiceImpl extends BaseMpServiceImpl<CustomerDe
195 196 public void deleteById(String id) {
196 197 getBaseMapper().deleteById(id);
197 198 }
  199 +
  200 + @OpLog(type = OtherOpLogType.class, name = "取消客户开发计划,ID:{}", params = {"#id"})
  201 + @Transactional(rollbackFor = Exception.class)
  202 + @Override
  203 + public void cancel(String id) {
  204 + if (StringUtils.isBlank(id)) {
  205 + return;
  206 + }
  207 + LambdaUpdateWrapper<CustomerDevelopPlan> updateWrapper = Wrappers.lambdaUpdate(CustomerDevelopPlan.class)
  208 + .set(CustomerDevelopPlan::getStatus, CustomerDevelopStatus.CANCEL)
  209 + .eq(CustomerDevelopPlan::getId, id);
  210 + getBaseMapper().update(updateWrapper);
  211 + }
198 212 }
... ...
... ... @@ -60,4 +60,11 @@ public interface CustomerDevelopPlanService extends BaseMpService<CustomerDevelo
60 60 * @param id 主键ID
61 61 */
62 62 void deleteById(String id);
  63 +
  64 + /**
  65 + * 取消
  66 + *
  67 + * @param id 主键ID
  68 + */
  69 + void cancel(String id);
63 70 }
... ...