|
@@ -0,0 +1,71 @@
|
|
|
|
|
+package com.jeesite.modules.mes.api;
|
|
|
|
|
+
|
|
|
|
|
+import com.jeesite.common.config.Global;
|
|
|
|
|
+import com.jeesite.modules.erp.entity.MesProductOrder;
|
|
|
|
|
+import com.jeesite.modules.mes.entity.MesInbound;
|
|
|
|
|
+import com.jeesite.modules.mes.resp.CommonResp;
|
|
|
|
|
+import com.jeesite.modules.mes.service.MesInboundService;
|
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
+import org.springframework.stereotype.Controller;
|
|
|
|
|
+import org.springframework.validation.annotation.Validated;
|
|
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
+import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
|
|
+
|
|
|
|
|
+import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
+import java.util.List;
|
|
|
|
|
+
|
|
|
|
|
+/**
|
|
|
|
|
+ * @Author: zh
|
|
|
|
|
+ * @Date: 2026/5/25 下午3:45
|
|
|
|
|
+ * @Description: com.jeesite.modules.mes.api
|
|
|
|
|
+ */
|
|
|
|
|
+@Controller
|
|
|
|
|
+@RequestMapping(value = "${adminPath}/mes/mesInboundControllerApi")
|
|
|
|
|
+public class MesInboundControllerApi {
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ MesInboundService mesInboundService;
|
|
|
|
|
+
|
|
|
|
|
+ //提交入库
|
|
|
|
|
+ @PostMapping(value = "inboundSave")
|
|
|
|
|
+ @ResponseBody
|
|
|
|
|
+ public CommonResp save(@Validated MesInbound mesInbound, HttpServletRequest request, HttpServletResponse response) {
|
|
|
|
|
+
|
|
|
|
|
+ CommonResp<List<MesProductOrder>> resp = new CommonResp<>();
|
|
|
|
|
+ //展示所有未结束的订单
|
|
|
|
|
+ String sn = request.getParameter("sn");//工件码
|
|
|
|
|
+ String productOrder = request.getParameter("productOrder");//生产订单编号
|
|
|
|
|
+ String storageLocation = request.getParameter("storageLocation");//库位
|
|
|
|
|
+ String linenSn = request.getParameter("linenSn");//产线编号
|
|
|
|
|
+ String remark = request.getParameter("remark");//备注
|
|
|
|
|
+
|
|
|
|
|
+ if (sn.isEmpty()||productOrder.isEmpty()||storageLocation.isEmpty()||linenSn.isEmpty()){
|
|
|
|
|
+ resp.setResult(Global.FALSE);
|
|
|
|
|
+ resp.setMessage("参数不能为空!");
|
|
|
|
|
+ return resp;
|
|
|
|
|
+ }
|
|
|
|
|
+ long count = mesInboundService.findCount(mesInbound);
|
|
|
|
|
+ if (count>0){
|
|
|
|
|
+ resp.setResult(Global.FALSE);
|
|
|
|
|
+ resp.setMessage("该工件已入库!");
|
|
|
|
|
+ return resp;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ mesInboundService.save(mesInbound);
|
|
|
|
|
+ resp.setResult(Global.TRUE);
|
|
|
|
|
+ resp.setMessage("操作成功!");
|
|
|
|
|
+ return resp;
|
|
|
|
|
+ }
|
|
|
|
|
+ //获取入库单列表
|
|
|
|
|
+ @PostMapping(value = "mesInboundList")
|
|
|
|
|
+ @ResponseBody
|
|
|
|
|
+ public CommonResp list(@Validated MesInbound mesInbound, HttpServletRequest request, HttpServletResponse response) {
|
|
|
|
|
+ CommonResp<List<MesInbound>> resp = new CommonResp<>();
|
|
|
|
|
+ List<MesInbound> list = mesInboundService.findList(mesInbound);
|
|
|
|
|
+ resp.setResult(Global.TRUE);
|
|
|
|
|
+ resp.setData(list);
|
|
|
|
|
+ resp.setMessage("操作成功!");
|
|
|
|
|
+ return resp;
|
|
|
|
|
+ }
|
|
|
|
|
+}
|