Parcourir la source

Merge branch 'master' of http://47.100.37.243:10191/wutt/manHourHousekeeper

Min il y a 1 an
Parent
commit
44f5710653

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

+ 13 - 1
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/entity/PlanMaterial.java

@@ -14,7 +14,7 @@ import lombok.experimental.Accessors;
  * </p>
  *
  * @author Seyason
- * @since 2023-07-26
+ * @since 2023-07-25
  */
 @Data
 @EqualsAndHashCode(callSuper = false)
@@ -35,6 +35,18 @@ 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()) {

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

@@ -224,7 +224,9 @@
 
                     <el-form-item label="描述" prop="description">
                         <!-- <el-input v-model="addForm.projectDesc" :disabled="!permissions.projectManagement && addForm.creatorId != user.id" placeholder="请输入项目描述" clearable maxlength="4000"></el-input> -->
-                        <el-input v-model="addForm.description" :placeholder="$t('peaseenterthe')" clearable maxlength="200"  show-word-limit></el-input>
+                        <!-- <el-input v-model="addForm.description" :placeholder="$t('peaseenterthe')" clearable maxlength="200"  show-word-limit></el-input> -->
+                        <el-input v-model="addForm.description" placeholder="产品特征" clearable maxlength="200"  show-word-limit></el-input>
+                        
                     </el-form-item>
                 </el-form>  
                 </div>
@@ -348,7 +350,7 @@
             <div slot="footer" class="dialog-footer;">
                 
                 <el-button @click.native="deletePro(1, addForm)" v-if="addForm.id" style="float:left">{{ $t('btn.delete') }}</el-button>
-                <el-button @click.native="prodEditActive = 0;addFormVisible = false ">{{ $t('btn.cancel') }}</el-button>
+                <el-button @click.native="addFormVisible = false ">{{ $t('btn.cancel') }}</el-button>
                 <el-button v-if="prodEditActive == 0" type="primary" @click="submitInsert(0)" :loading="addLoading">保存</el-button>
                 <el-button v-if="prodEditActive == 0" type="primary" @click="submitInsert(1)" :loading="addLoading">保存并编辑工序</el-button>
                 <el-button v-if="prodEditActive == 1" type="primary" @click="submitSequence(0)" :loading="addLoading">保存工序</el-button>
@@ -386,7 +388,7 @@
         <el-dialog
             title="分类管理"
             :visible.sync="isganttshow"
-            width="40%"
+            width="50%"
             :before-close="handleClose">
             <div>
                 <el-table
@@ -2899,6 +2901,7 @@ a {
             },
             //显示新增界面
             handleAdd(i, item) {
+                this.prodEditActive = 0;  //初始化弹框
                 this.canOnlyModParticipator = false;
                 this.projectManagerEdit = false
                 this.contractAmountReasonShow = false