|
@@ -13,6 +13,7 @@ import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import com.ym.mec.biz.dal.entity.Goods;
|
|
|
+import com.ym.mec.biz.dal.enums.YesOrNoEnum;
|
|
|
import com.ym.mec.biz.dal.page.GoodsQueryInfo;
|
|
|
import com.ym.mec.biz.service.GoodsService;
|
|
|
import com.ym.mec.common.controller.BaseController;
|
|
@@ -36,7 +37,13 @@ public class GoodsController extends BaseController {
|
|
|
@PostMapping("/del/{id}")
|
|
|
@PreAuthorize("@pcs.hasPermissions('goods/del')")
|
|
|
public Object del(@ApiParam(value = "商品(教材、辅件)编号", required = true) @PathVariable("id") Integer id){
|
|
|
- goodsService.delete(id);
|
|
|
+ Goods goods = goodsService.get(id);
|
|
|
+ if(goods == null){
|
|
|
+ return failed("参数错误");
|
|
|
+ }
|
|
|
+ goods.setStatus(YesOrNoEnum.NO);
|
|
|
+ goods.setUpdateTime(new Date());
|
|
|
+ goodsService.update(goods);
|
|
|
return succeed();
|
|
|
}
|
|
|
|