فهرست منبع

填写日报增加钢印号

seyason 1 سال پیش
والد
کامیت
0ab68d5acd

+ 8 - 1
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/entity/ProdProcedureTeam.java

@@ -20,7 +20,7 @@ import org.springframework.format.annotation.DateTimeFormat;
  * </p>
  *
  * @author Seyason
- * @since 2023-08-30
+ * @since 2023-08-31
  */
 @Data
 @EqualsAndHashCode(callSuper = false)
@@ -96,6 +96,13 @@ public class ProdProcedureTeam extends Model<ProdProcedureTeam> {
     private Integer isChange;
 
 
+    /**
+     * 选中的钢印号
+     */
+    @TableField("steel_num_array")
+    private String steelNumArray;
+
+
     @Override
     protected Serializable pkVal() {
         return this.id;

+ 9 - 1
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/entity/Report.java

@@ -21,7 +21,7 @@ import org.springframework.format.annotation.DateTimeFormat;
  * </p>
  *
  * @author Seyason
- * @since 2023-07-29
+ * @since 2023-08-31
  */
 @Data
 @EqualsAndHashCode(callSuper = false)
@@ -127,6 +127,14 @@ public class Report extends Model<Report> {
 
     @TableField(exist = false)
     private Boolean isTerminated;
+
+    /**
+     * 钢印号数组
+     */
+    @TableField("steel_num_array")
+    private String steelNumArray;
+
+
     @Override
     protected Serializable pkVal() {
         return this.id;

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

@@ -1,5 +1,6 @@
 package com.management.platform.service.impl;
 
+import com.alibaba.fastjson.JSONArray;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -76,6 +77,8 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
     @Resource
     SysFunctionService sysFunctionService;
     @Resource
+    ReportSteelNumMapper reportSteelNumMapper;
+    @Resource
     private InformationServiceImpl informationService;
 
     @Resource
@@ -184,6 +187,8 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
         }
         prodProcedureTeam.setUpdateTime(LocalDateTime.now());
         prodProcedureTeam.setProgress(report.getProgress());
+        //更新填写的钢印号
+        prodProcedureTeam.setSteelNumArray(report.getSteelNumArray());
         if (report.getProgress() == 100) {
             //完工了
             prodProcedureTeam.setStatus(2);//顺利完工
@@ -193,9 +198,31 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
 
         if (todayReport == null) {
             reportMapper.insert(report);
+            //处理钢印号
+            if (!StringUtils.isEmpty(report.getSteelNumArray())) {
+                JSONArray array = JSONArray.parseArray(report.getSteelNumArray());
+                array.forEach(s->{
+                    ReportSteelNum reportSteelNum = new ReportSteelNum();
+                    reportSteelNum.setReportId(report.getId());
+                    reportSteelNum.setSteelNum((String) s);
+                    reportSteelNumMapper.insert(reportSteelNum);
+                });
+            }
         } else {
             report.setId(todayReport.getId());
             reportMapper.updateById(report);
+            //删除之前的钢印号
+            reportSteelNumMapper.delete(new QueryWrapper<ReportSteelNum>().eq("report_id", todayReport.getId()));
+            //处理钢印号
+            if (!StringUtils.isEmpty(report.getSteelNumArray())) {
+                JSONArray array = JSONArray.parseArray(report.getSteelNumArray());
+                array.forEach(s->{
+                    ReportSteelNum reportSteelNum = new ReportSteelNum();
+                    reportSteelNum.setReportId(report.getId());
+                    reportSteelNum.setSteelNum((String) s);
+                    reportSteelNumMapper.insert(reportSteelNum);
+                });
+            }
         }
         //更新自己执行的工序上的进度
         prodProcedureTeamMapper.updateById(prodProcedureTeam);

+ 7 - 6
fhKeeper/formulahousekeeper/management-workshop/src/main/resources/mapper/ProdProcedureTeamMapper.xml

@@ -16,21 +16,22 @@
         <result column="plan_procedure_id" property="planProcedureId" />
         <result column="status" property="status" />
         <result column="is_change" property="isChange" />
+        <result column="steel_num_array" property="steelNumArray" />
     </resultMap>
 
     <!-- 通用查询结果列 -->
     <sql id="Base_Column_List">
-        id, company_id, user_id, work_time, job_of_money, progress, checker_id, checker_name, update_time, plan_procedure_id, status, is_change
+        id, company_id, user_id, work_time, job_of_money, progress, checker_id, checker_name, update_time, plan_procedure_id, status, is_change, steel_num_array
     </sql>
 
     <select id="getReportForWorkList" resultType="java.util.HashMap" >
         SELECT a.*, plan_procedure_total.plan_id, plan_procedure_total.prod_procedure_id, date_format(plan.`start_date`,'%Y-%m-%d') as start_date, date_format(plan.`end_date`,'%Y-%m-%d') as end_date, plan.`plan_type`, plan.`product_scheduling_num`,plan.task_type_name,plan.task_name,plan.task_change_notice_num,
-               product.`name` AS product_name,prod_procedure.name AS procedure_name, prod_procedure.check_type, plan.check_type as plan_check_type
+        product.`name` AS product_name,prod_procedure.name AS procedure_name, prod_procedure.check_type, plan.check_type as plan_check_type
         FROM prod_procedure_team a
-                 left join plan_procedure_total on plan_procedure_total.id = a.plan_procedure_id
-                 LEFT JOIN plan ON plan.id = plan_procedure_total.plan_id
-                 LEFT JOIN product ON product.id = plan.`product_id`
-                 LEFT JOIN prod_procedure ON prod_procedure.id = plan_procedure_total.prod_procedure_id
+        left join plan_procedure_total on plan_procedure_total.id = a.plan_procedure_id
+        LEFT JOIN plan ON plan.id = plan_procedure_total.plan_id
+        LEFT JOIN product ON product.id = plan.`product_id`
+        LEFT JOIN prod_procedure ON prod_procedure.id = plan_procedure_total.prod_procedure_id
         where 1 = 1 and a.status = 1 and a.user_id=#{userId}
         <if test="chicleNum!=null and chicleNum!=''">
             and  (#{chicleNum} &gt;= plan.chicle_num_start and #{chicleNum} &lt;= plan.chicle_num_end)

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

@@ -19,6 +19,7 @@
         <result column="check_type" property="checkType" />
         <result column="checker_id" property="checkerId" />
         <result column="user_procedure_team_id" property="userProcedureTeamId" />
+        <result column="steel_num_array" property="steelNumArray" />
     </resultMap>
     <resultMap id="FullMap" type="com.management.platform.entity.vo.ReportVO" extends="BaseResultMap">
         <result column="creatorName" property="creatorName" />
@@ -28,7 +29,7 @@
     </resultMap>
     <!-- 通用查询结果列 -->
     <sql id="Base_Column_List">
-        id, creator_id, create_date, working_time, create_time, cost, dept_id, company_id, plan_id, progress, product_id, prod_procedure_id, check_type, checker_id, user_procedure_team_id
+        id, creator_id, create_date, working_time, create_time, cost, dept_id, company_id, plan_id, progress, product_id, prod_procedure_id, check_type, checker_id, user_procedure_team_id, steel_num_array
     </sql>
     <select id="getReportFillStatus" resultType="java.util.Map">
         SELECT DATE_FORMAT(create_date,'%Y-%m-%d') as createDate FROM report

+ 16 - 2
fhKeeper/formulahousekeeper/timesheet-workshop-h5/src/views/workView/fillReport.vue

@@ -9,9 +9,17 @@
 
     <van-form @submit="onSubmit">
       <van-cell-group inset>
-
         <van-cell v-if="reportForm.plan_type==0" title="工序" :value="reportForm.procedure_name" />
         <van-cell v-else title="任务变更通知号" :value="reportForm.task_change_notice_num" />
+        <van-cell title="钢印号" >
+          <template>
+            <div style="float:right;">
+              <van-checkbox-group v-model="reportForm.checkedSteelNum" direction="horizontal">
+                <van-checkbox style="padding:5px;" :name="item" @click="onCheckChange" v-for="(item, index) in reportForm.planSteelStampNumberList" :key="item">{{item}}</van-checkbox>
+              </van-checkbox-group>
+            </div>
+          </template>
+        </van-cell>
         <van-cell title="进度(%)"   >
           <template>
             <van-stepper v-model="reportForm.progress" step="10" :min="0" :max="100"/>
@@ -110,7 +118,8 @@ export default {
           progress: this.reportForm.progress,
           planId: this.reportForm.plan_id,
           checkType: this.reportForm.check_type,
-          isTerminated: this.reportForm.isTerminated
+          isTerminated: this.reportForm.isTerminated,
+          steelNumArray: JSON.stringify(this.reportForm.checkedSteelNum)
         };
         if (this.reportForm.progress == 100) {
           if (this.reportForm.check_type != 0) {
@@ -133,11 +142,16 @@ export default {
             }
         }).catch(err=> {this.$toast.clear();});
     },
+    onCheckChange(names) {
+      this.$forceUpdate();
+      console.log(this.reportForm.checkedSteelNum);
+    },
     getMyPlanProcedureList() {
         this.$axios.post("/plan-procedure-total/getFillProcedureDetail", {id: this.$route.query.id})
         .then(res => {
             if(res.code == "ok") {
                 this.reportForm = res.data;
+                this.reportForm.checkedSteelNum = JSON.parse(this.reportForm.steel_num_array);
                 if (this.reportForm.check_type == 0) {
                   //自检
                   this.reportForm.checker_name = this.user.name;