zx преди 1 година
родител
ревизия
a6d7d2db41

+ 11 - 5
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/controller/ProdMaterialController.java

@@ -15,6 +15,7 @@ import org.springframework.web.bind.annotation.RestController;
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 import java.io.IOException;
+import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.HashMap;
 import java.util.List;
@@ -41,14 +42,19 @@ public class ProdMaterialController {
     @RequestMapping("/getProdMaterialList")
     public HttpRespMsg getProdMaterialList (@RequestParam Integer productId){
         HttpRespMsg httpRespMsg=new HttpRespMsg();
+        HashMap<String,Object> map=new HashMap<>();
+
         List<String> versionList= (List<String>) prodMaterialService.getVersion(request,productId).getData();
-        HttpRespMsg info = prodMaterialService.getInfo(request, versionList.get(versionList.size() - 1), productId);
-        List<ProdMaterial> prodMaterialList= (List<ProdMaterial>) info.data;
+        List<ProdMaterial> prodMaterialList=new ArrayList<>();
+        if(versionList!=null&&versionList.size()>1){
+            HttpRespMsg info = prodMaterialService.getInfo(request, versionList.get(versionList.size() - 1), productId);
+            prodMaterialList= (List<ProdMaterial>) info.data;
+            map.put("version",versionList.get(versionList.size() - 1));
+        }else{
+            map.put("version","");
+        }
 
-        HashMap<String,Object> map=new HashMap<>();
-        map.put("version",versionList.get(versionList.size() - 1));
         map.put("prodMaterialList",prodMaterialList);
-        System.out.println(map);
 
         httpRespMsg.data=map;
         return httpRespMsg;

+ 12 - 5
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/controller/ProdProcedureController.java

@@ -12,6 +12,7 @@ import org.springframework.web.bind.annotation.*;
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 import java.io.IOException;
+import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.HashMap;
 import java.util.List;
@@ -38,14 +39,20 @@ public class ProdProcedureController {
     @RequestMapping("/getProdProcedureList")
     public HttpRespMsg getProdProcedureList (@RequestParam Integer productId){
         HttpRespMsg httpRespMsg=new HttpRespMsg();
+        HashMap<String,Object> map=new HashMap<>();
+
         List<String> versionList= (List<String>) prodProcedureService.getVersion(request,productId).getData();
-        HttpRespMsg info = prodProcedureService.getInfo(request, versionList.get(versionList.size() - 1), productId);
-        List<ProdProcedure> prodProcedureList= (List<ProdProcedure>) info.data;
+        List<ProdProcedure> prodProcedureList=new ArrayList<>();
+        if(versionList!=null&&versionList.size()>0){
+            HttpRespMsg info = prodProcedureService.getInfo(request, versionList.get(versionList.size() - 1), productId);
+            prodProcedureList= (List<ProdProcedure>) info.data;
+            map.put("version",versionList.get(versionList.size() - 1));
+        }else{
+            map.put("version","");
+        }
+
 
-        HashMap<String,Object> map=new HashMap<>();
-        map.put("version",versionList.get(versionList.size() - 1));
         map.put("prodProcedureList",prodProcedureList);
-        System.out.println(map);
 
         httpRespMsg.data=map;
         return httpRespMsg;

+ 11 - 0
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/controller/ProductController.java

@@ -12,6 +12,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
 
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.multipart.MultipartFile;
 
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
@@ -70,5 +71,15 @@ public class ProductController {
     public HttpRespMsg getInfo(Integer id){
         return productService.getProductInfo(request,id);
     }
+
+    /**
+     * todo
+     * @param file
+     * @return
+     */
+    @RequestMapping("/importData")
+    public HttpRespMsg importData(MultipartFile file){
+        return null;
+    }
 }
 

+ 0 - 11
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/entity/PlanMaterial.java

@@ -35,17 +35,6 @@ public class PlanMaterial extends Model<PlanMaterial> {
     @TableField("is_checked")
     private Boolean isChecked;
 
-    /**
-     * 数量(个/产品):产品数量*产品物料单中数量
-     */
-    @TableField("number_product")
-    private Integer numberProduct;
-
-    /**
-     * 数量(个/辆):产品数量*产品物料单中数量
-     */
-    @TableField("number_vehicle")
-    private Integer numberVehicle;
 
     /**
      * 缺少数量

+ 2 - 2
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/entity/ProdMaterial.java

@@ -46,13 +46,13 @@ public class ProdMaterial extends Model<ProdMaterial> {
      * 公司编码
      */
     @TableField("company_code")
-    private Integer companyCode;
+    private String companyCode;
 
     /**
      * 公司图号
      */
     @TableField("company_drawing_no")
-    private Integer companyDrawingNo;
+    private String companyDrawingNo;
 
     /**
      * 材质

+ 10 - 3
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/impl/ProdMaterialServiceImpl.java

@@ -2,11 +2,14 @@ package com.management.platform.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.management.platform.entity.PlanMaterial;
 import com.management.platform.entity.ProdMaterial;
 import com.management.platform.entity.ProdMaterial;
 import com.management.platform.entity.User;
+import com.management.platform.mapper.PlanMaterialMapper;
 import com.management.platform.mapper.ProdMaterialMapper;
 import com.management.platform.mapper.UserMapper;
+import com.management.platform.service.PlanMaterialService;
 import com.management.platform.service.ProdMaterialService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.management.platform.util.HttpRespMsg;
@@ -32,6 +35,11 @@ public class ProdMaterialServiceImpl extends ServiceImpl<ProdMaterialMapper, Pro
     private ProdMaterialMapper prodMaterialMapper;
     @Resource
     private UserMapper userMapper;
+    @Resource
+    private PlanMaterialMapper planMaterialMapper;
+    @Resource
+    private PlanMaterialService planMaterialService;
+
     @Override
     public HttpRespMsg getVersion(HttpServletRequest request, Integer productId) {
         HttpRespMsg httpRespMsg=new HttpRespMsg();
@@ -65,7 +73,6 @@ public class ProdMaterialServiceImpl extends ServiceImpl<ProdMaterialMapper, Pro
     @Override
     public HttpRespMsg isDelete(HttpServletRequest request, Integer id) {
         HttpRespMsg msg = new HttpRespMsg();
-        //TODO: 检查物料是否已经被使用,被使用的不能删除
         boolean flag=true;
         msg.setData(flag);
         return msg;
@@ -86,7 +93,7 @@ public class ProdMaterialServiceImpl extends ServiceImpl<ProdMaterialMapper, Pro
         });
 
 
-        //1.获取原有的工序id
+        //1.获取原有的物料id
         List<ProdMaterial> oldList = prodMaterialMapper.selectList(new LambdaQueryWrapper<ProdMaterial>()
                 .eq(user.getCompanyId() != null, ProdMaterial::getCompanyId, user.getCompanyId())
                 .eq(productId != null, ProdMaterial::getProductId, productId)
@@ -95,7 +102,7 @@ public class ProdMaterialServiceImpl extends ServiceImpl<ProdMaterialMapper, Pro
         );
 
         if(oldList!=null&&oldList.size()>0){
-            //2.要删除的id
+            //2.要删除物料的id
             List<ProdMaterial> deleteList = oldList.stream().filter(old -> {
                 for (ProdMaterial prodMaterial : prodMaterialList) {
                     if (prodMaterial.getId() == old.getId()) {

+ 1 - 1
fhKeeper/formulahousekeeper/timesheet-workshop/src/views/product/list.vue

@@ -386,7 +386,7 @@
         <el-dialog
             title="分类管理"
             :visible.sync="isganttshow"
-            width="40%"
+            width="50%"
             :before-close="handleClose">
             <div>
                 <el-table