From c267b1e645b04ee598d7cc68770aabab6ef2b931 Mon Sep 17 00:00:00 2001 From: wangziyangyang <707231019@qq.com> Date: Mon, 23 Mar 2020 12:51:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E7=89=A9=E6=96=99=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E4=BF=AE=E6=94=B9=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/SpMaterileController.java | 43 +++++++++++--- .../basedata/materile/addOrUpdate.ftl | 56 +++++++++++-------- .../templates/basedata/materile/list.ftl | 23 +++++++- 3 files changed, 89 insertions(+), 33 deletions(-) diff --git a/mes/src/main/java/com/wangziyang/mes/basedata/controller/SpMaterileController.java b/mes/src/main/java/com/wangziyang/mes/basedata/controller/SpMaterileController.java index 55b43f9..9468a0a 100644 --- a/mes/src/main/java/com/wangziyang/mes/basedata/controller/SpMaterileController.java +++ b/mes/src/main/java/com/wangziyang/mes/basedata/controller/SpMaterileController.java @@ -6,24 +6,20 @@ import com.wangziyang.mes.basedata.entity.SpMaterile; import com.wangziyang.mes.basedata.entity.SpTableManager; import com.wangziyang.mes.basedata.request.SpFlowReq; import com.wangziyang.mes.basedata.service.ISpMaterileService; +import com.wangziyang.mes.common.BaseController; import com.wangziyang.mes.common.Result; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; - import org.springframework.stereotype.Controller; -import com.wangziyang.mes.common.BaseController; -import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.*; /** *
- * 物料控制器 + * 物料控制器 *
* * @author WangZiYang @@ -38,6 +34,7 @@ public class SpMaterileController extends BaseController { */ @Autowired private ISpMaterileService iSpMaterileService; + /** * 物料管理界面 * @@ -84,4 +81,34 @@ public class SpMaterileController extends BaseController { IPage result = iSpMaterileService.page(req); return Result.success(result); } + + /** + * 物料管理修改、新增 + * + * @param record 物料实体类 + * @return 执行结果 + */ + @ApiOperation("物料管理修改、新增") + @PostMapping("/add-or-update") + @ResponseBody + public Result addOrUpdate( SpMaterile record) { + iSpMaterileService.saveOrUpdate(record); + return Result.success(); + } + + + /** + * 删除物料信息 + * + * @param req 请求参数 + * @return Result 执行结果 + */ + @ApiOperation("删除物料信息") + @ApiImplicitParams({@ApiImplicitParam(name = "req", value = "物料实体", defaultValue = "物料实体")}) + @PostMapping("/delete") + @ResponseBody + public Result deleteByTableNameId(SpMaterile req) throws Exception { + iSpMaterileService.removeById(req.getId()); + return Result.success(); + } } diff --git a/mes/src/main/resources/templates/basedata/materile/addOrUpdate.ftl b/mes/src/main/resources/templates/basedata/materile/addOrUpdate.ftl index 8689168..3d90bc1 100644 --- a/mes/src/main/resources/templates/basedata/materile/addOrUpdate.ftl +++ b/mes/src/main/resources/templates/basedata/materile/addOrUpdate.ftl @@ -73,15 +73,14 @@ class="layui-input" value="${result.size}"> -测试->dd->dd
+