Showing
3 changed files
with
33 additions
and
0 deletions
| ... | ... | @@ -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 | * 封装客户开发数据 | ... | ... |
xingyun-sc/src/main/java/com/lframework/xingyun/sc/impl/customer/CustomerDevelopPlanServiceImpl.java
| ... | ... | @@ -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 | } | ... | ... |