Min há 1 ano atrás
pai
commit
3e51557634

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

@@ -1,6 +1,7 @@
 package com.management.platform.controller;
 
 
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.management.platform.entity.Product;
 import com.management.platform.mapper.UserMapper;
 import com.management.platform.service.PlanService;
@@ -15,6 +16,11 @@ import org.springframework.web.multipart.MultipartFile;
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 import javax.validation.Valid;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
 
 /**
  * <p>
@@ -109,5 +115,22 @@ public class ProductController {
         }
         return msg;
     }
+
+    @RequestMapping("/getProductProjectNames")
+    public HttpRespMsg getProductProjectNames(String value){
+        HttpRespMsg msg=new HttpRespMsg();
+        Integer companyId = userMapper.selectById(request.getHeader("token")).getCompanyId();
+        List<Product> list = productService.list(new LambdaQueryWrapper<Product>().like(Product::getProjectName, value).eq(Product::getCompanyId,companyId));
+        List<String> stringList = list.stream().map(Product::getProjectName).distinct().collect(Collectors.toList());
+        List<Map<String,Object>> mapList=new ArrayList<>();
+        for (int i = 0; i < stringList.size(); i++) {
+            Map<String,Object> map=new HashMap<>();
+            map.put("label",i);
+            map.put("value",stringList.get(i));
+            mapList.add(map);
+        }
+        msg.setData(mapList);
+        return msg;
+    }
 }
 

+ 2 - 2
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/impl/ReportServiceImpl.java

@@ -4333,7 +4333,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
         HttpRespMsg httpRespMsg=new HttpRespMsg();
         HashMap map=new HashMap();
         if(checkStatus!=null && detailStatus==null){
-            List<Map<String,Object>> mapList=reportMapper.getPersonWorkHoursWagesDetailForMob(date,user.getId(),user.getCompanyId(),startDate,endDate,checkStatus,detailStatus);
+            List<Map<String,Object>> mapList=reportMapper.getPersonWorkHoursWagesDetailForMob(date,userId,user.getCompanyId(),startDate,endDate,checkStatus,detailStatus);
             DateTimeFormatter dtf=DateTimeFormatter.ofPattern("yyyy-MM-dd");
             DateTimeFormatter dtf1=DateTimeFormatter.ofPattern("yyyyMMdd");
             List<LocalDate> allDateList = getDays(LocalDate.parse(startDate, dtf), LocalDate.parse(endDate, dtf));
@@ -4951,7 +4951,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
             }
             item.add(map.get("productOrderNum")==null?"":String.valueOf(map.get("productOrderNum")));
             item.add(String.valueOf(map.get("procedureName")));
-            item.add("");
+            item.add(map.get("steelNumArray")==null?"":String.valueOf(map.get("steelNumArray")));
             item.add("");
             item.add("");
 //            item.add(String.valueOf(map.get("progress"))+"%");

+ 2 - 2
fhKeeper/formulahousekeeper/management-workshop/src/main/resources/mapper/ReportMapper.xml

@@ -186,7 +186,7 @@
             </choose>
         </if>
         <if test="startDate!=null and endDate!=null">
-            and ppt2.distribute_date between #{startDate} and #{endDate}
+            and r.create_date between #{startDate} and #{endDate}
         </if>
     </select>
 
@@ -387,7 +387,7 @@
         b.foreman_name as userName,IFNULL(ROUND(SUM(a.total_working_hours),2),0) as planWorkTime,IFNULL(ROUND(SUM(a.total_wages),2),0)  as planCost,
         IFNULL(ROUND(SUM(a.`total_fill_time`),2),0) AS nowWorkTime,
         IFNULL(ROUND(SUM(a.`total_wages`*a.`total_progress`/100),2),0) AS nowCost,
-        b.product_name as productName,b.num as planNum,DATE_FORMAT(b.start_date,'%Y%m%d') as startDate,DATE_FORMAT(b.end_date,'%Y%m%d') as endDate,DATE_FORMAT(b.real_end_date,'%Y%m%d') as realEndDate,b.station_name as statinoName
+        b.product_name as productName,b.project_name as projectName,b.num as planNum,DATE_FORMAT(b.start_date,'%Y%m%d') as startDate,DATE_FORMAT(b.end_date,'%Y%m%d') as endDate,DATE_FORMAT(b.real_end_date,'%Y%m%d') as realEndDate,b.station_name as statinoName
         from plan b
         left join plan_procedure_total a on a.plan_id=b.id
         left join user u on u.id=b.station_id

+ 35 - 2
fhKeeper/formulahousekeeper/timesheet-workshop/src/views/plan/planComponent.vue

@@ -152,7 +152,11 @@
             <el-input v-model="todayPlanForm.productOrderNum" maxlength="50"></el-input>
           </el-form-item>
           <el-form-item label="项目名称" style="width: 100%" prop="projectName">
-            <el-input :disabled="todayPlanForm.id==null?false:true"  v-model="todayPlanForm.projectName" maxlength="50" @blur="filterProductList(todayPlanForm.projectName)"></el-input>
+            <!-- <el-input :disabled="todayPlanForm.id==null?false:true"  v-model="todayPlanForm.projectName" maxlength="50" @blur="filterProductList(todayPlanForm.projectName)"></el-input> -->
+            <el-select :disabled="todayPlanForm.id==null?false:true" filterable remote reserve-keyword :remote-method="getProjectNames" @change="filterProductList(todayPlanForm.projectName)" v-model="todayPlanForm.projectName" placeholder="请输入项目名称" class="w100">
+              <el-option v-for="item in projectNameList" :key="item.label" :label="item.value" :value="item.value">
+              </el-option>
+            </el-select> 
           </el-form-item>
           <el-form-item label="产品名称" style="width: 100%" prop="productId">
             <el-select :disabled="todayPlanForm.id==null?false:true" v-model="todayPlanForm.productId" placeholder="请选择" class="w100" @change="setProductCode" filterable>
@@ -440,6 +444,7 @@ export default {
       exportParam: { productId: null, rangeDatas: this.getCurrentRangeTime() },
       searchType:'1',
       searchValue:'',
+      projectNameList:[]
     };
   },
   computed: {},
@@ -531,7 +536,7 @@ export default {
       // this.todayPlanForm.projectName = arrList[0].projectName
       // this.todayPlanForm.productName = arrList[0].name
       this.$set(this.todayPlanForm, "projectCode", arrList[0].code)
-      this.$set(this.todayPlanForm, "projectName", arrList[0].projectName)
+      // this.$set(this.todayPlanForm, "projectName", arrList[0].projectName)
       this.$set(this.todayPlanForm, "productName", arrList[0].name)
     },
     today() {
@@ -735,6 +740,34 @@ export default {
       this.hasChooseDept = item.departmentId;
       this.getTableData(item.departmentId);
     },
+    getProjectNames(value){
+      if(value != '') {
+        this.http.post(
+          "/product/getProductProjectNames",
+          {
+            value:value,
+          },
+          (res) => {
+            if (res.code == "ok") {
+              this.projectNameList = res.data;
+            } else {
+              this.$message({
+                message: res.msg,
+                type: "error",
+              });
+            }
+          },
+          (error) => {
+            this.$message({
+              message: error,
+              type: "error",
+            });
+          }
+        );
+      } else {
+        this.projectNameList = []
+      }
+    },
     // 获取车间数据
     getTableData(departmentId) {
       console.log(this.planDate, departmentId);

+ 3 - 0
fhKeeper/formulahousekeeper/timesheet-workshop/src/views/statistic/index.vue

@@ -162,6 +162,9 @@
                 <el-table-column align="center" prop="productName" label="产品名称" min-width="150">
                   <template slot-scope="scope">{{scope.row.productName}}</template>
                 </el-table-column>
+                <el-table-column align="center" prop="projectName" label="项目名称" min-width="150">
+                  <template slot-scope="scope">{{scope.row.projectName}}</template>
+                </el-table-column>
                 <el-table-column align="center" prop="startDate" label="开始日期" width="150">
                   <template slot-scope="scope">{{scope.row.startDate}}</template>
                 </el-table-column>