Explorar el Código

半成品、成品入库

zhanghe hace 5 meses
padre
commit
ff19baddd6

+ 71 - 0
src/main/java/com/jeesite/modules/mes/api/MesInboundControllerApi.java

@@ -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;
+    }
+}

+ 44 - 0
src/main/java/com/jeesite/modules/mes/api/MesProductOrderControllerApi.java

@@ -0,0 +1,44 @@
+package com.jeesite.modules.mes.api;
+
+import com.jeesite.common.config.Global;
+import com.jeesite.modules.erp.entity.MesProductOrder;
+import com.jeesite.modules.erp.service.MesProductOrderService;
+import com.jeesite.modules.mes.resp.CommonResp;
+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:26
+ * @Description: com.jeesite.modules.mes.api
+ */
+@Controller
+@RequestMapping(value = "${adminPath}/mes/mesProductOrderApi")
+public class MesProductOrderControllerApi {
+    @Autowired
+    private MesProductOrderService mesProductOrderService;
+
+    //获取生产订单单号列表
+    @PostMapping(value = "mesProductOrderCodeList")
+    @ResponseBody
+    public CommonResp save(@Validated MesProductOrder mesProductOrder, HttpServletRequest request, HttpServletResponse response) {
+        CommonResp<List<MesProductOrder> > resp = new CommonResp<>();
+        String lineSn = request.getParameter("lineSn");
+        //展示所有未结束的订单
+        mesProductOrder.setState("0");//0,表示未结束,1,表示结束,2,表示作废
+        mesProductOrder.setLineSn(lineSn);
+        List<MesProductOrder> list = mesProductOrderService.findList(mesProductOrder);
+        resp.setData(list);
+        resp.setResult(Global.TRUE);
+        resp.setMessage("操作成功!");
+        return resp;
+    }
+}

+ 41 - 0
src/main/java/com/jeesite/modules/mes/api/WmsHouseControllerApi.java

@@ -0,0 +1,41 @@
+package com.jeesite.modules.mes.api;
+
+import com.jeesite.common.config.Global;
+import com.jeesite.modules.mes.resp.CommonResp;
+import com.jeesite.modules.wms.entity.WmsHouseLocation;
+import com.jeesite.modules.wms.service.WmsHouseLocationService;
+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 下午4:06
+ * @Description: com.jeesite.modules.mes.api
+ */
+@Controller
+@RequestMapping(value = "${adminPath}/mes/wmsHouseControllerApi")
+public class WmsHouseControllerApi {
+    @Autowired
+    private WmsHouseLocationService wmsHouseLocationService;
+    //获取仓位列表
+    @PostMapping(value = "wmsHouseList")
+    @ResponseBody
+    public CommonResp findList(@Validated WmsHouseLocation wmsHouseLocation, HttpServletRequest request) {
+        CommonResp<List<WmsHouseLocation>> resp = new CommonResp<>();
+        String lineSn = request.getParameter("lineSn");
+        //展示所有未结束的订单
+        wmsHouseLocation.setStatus("0");//状态(0正常 1删除 2停用)
+        List<WmsHouseLocation> list = wmsHouseLocationService.findList(wmsHouseLocation);
+        resp.setData(list);
+        resp.setResult(Global.TRUE);
+        resp.setMessage("操作成功!");
+        return resp;
+    }
+}