Kaynağa Gözat

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

Lijy 1 yıl önce
ebeveyn
işleme
5d29e5b2be

+ 1 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/ReportController.java

@@ -1210,7 +1210,7 @@ public class ReportController {
                                 hasReport = new BigDecimal(groupSum).add(new BigDecimal(nowReport));
                                 TaskGroup tgp = taskGroupService.getById(targetGpId);
                                 //设置的数值大于0时检查是否超额
-                                if (tgp.getManDay() != null && tgp.getManDay() > 0) {
+                                if (tgp != null && tgp.getManDay() != null && tgp.getManDay() > 0) {
                                     multiply = new BigDecimal(tgp.getManDay()).multiply(new BigDecimal(comTimeType.getAllday()));
                                     System.out.println("hasReport:"+hasReport+" multiply:"+multiply);
                                     if (hasReport.doubleValue() > multiply.doubleValue()) {

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

@@ -166,7 +166,7 @@ public class PlanProcedureTotalServiceImpl extends ServiceImpl<PlanProcedureTota
             Stream<String> sorted = list.stream().distinct().sorted();
             List<String> collect = sorted.collect(Collectors.toList());
             //如果钢印号有其他人已经填过了,就不显示
-            List<Report> reportList = reportMapper.selectList(new QueryWrapper<Report>().select("id", "steel_num_array").eq("plan_id", planId));
+            List<Report> reportList = reportMapper.selectList(new QueryWrapper<Report>().select("id", "steel_num_array","create_date", "creator_id").eq("plan_id", planId));
             List<String> filledSteelNumList=new ArrayList<>();
 
             for (Report report : reportList) {
@@ -179,8 +179,17 @@ public class PlanProcedureTotalServiceImpl extends ServiceImpl<PlanProcedureTota
                     filledSteelNumList.addAll(Arrays.asList(split));
                 }
             }
-            List<String> collect1 = collect.stream().filter(item -> !filledSteelNumList.contains(item)).collect(Collectors.toList());
-            prodProcedureTeam.put("planSteelStampNumberList",collect1);
+//            List<String> collect1 = collect.stream().filter(item -> !filledSteelNumList.contains(item)).collect(Collectors.toList());
+            List<HashMap> steelMapList = new ArrayList<>();
+            for (String s : collect) {
+                HashMap map = new HashMap();
+                map.put("number", s);
+                if (filledSteelNumList.contains(s)) {
+                    map.put("disabled", true);
+                }
+                steelMapList.add(map);
+            }
+            prodProcedureTeam.put("planSteelStampNumberList",steelMapList);
             msg.setData(prodProcedureTeam);
         }
         return msg;

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

@@ -311,6 +311,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                         for (ReportVO m : list) {
                             double t = m.getWorkingTime();
                             reportTime += t;
+                            System.out.println("t:"+t);
                             total = total.add(m.getCost());
                         }
 
@@ -320,7 +321,6 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                         map.put("state", state);
                     }
                 }
-
                 List<Integer> allVisibleDeptIdList = getAllVisibleDeptIdList(user, null);
                 //需要看可见部门(部门主要负责人和其他负责人以及查看本部门工时权限)所有人员的日报
                 if (allVisibleDeptIdList.size() > 0) {
@@ -348,15 +348,17 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                             //再根据人分别获取当天的报告
                             List<ReportVO> rList = new ArrayList<ReportVO>();
                             BigDecimal total = new BigDecimal(0);
+                            double reportTime = 0;
                             for (ReportVO report : reportList) {
                                 if (report.getCreatorId().equals((String)memb.get("id"))) {
                                     rList.add(report);
+                                    reportTime += report.getWorkingTime();
                                     total = total.add(report.getCost());
                                 }
                             }
                             memb.put("data", rList);
                             memb.put("cost", total);
-                            double reportTime = 0;
+
                             if (rList.size() > 0) {
                                 int state = 1;
                                 memb.put("state", state);
@@ -399,15 +401,12 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                     for (Map<String, Object> map : nameList) {
                         //再根据人分别获取当天的报告
                         List<ReportVO> list = new ArrayList<ReportVO>();
-//                        BigDecimal total = new BigDecimal(0);
                         for (ReportVO report : reportList) {
                             if (report.getCreatorId().equals((String)map.get("id"))) {
                                 list.add(report);
-//                                total = total.add(report.getCost());
                             }
                         }
                         map.put("data", list);
-//                        map.put("cost", total);
                         double reportTime = reportList.stream().filter(r->r.getCreatorId().equals((String)map.get("id"))).mapToDouble(ReportVO::getWorkingTime).sum();
                         if (list.size() > 0) {
                             int state = 1;
@@ -418,8 +417,6 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                     }
                 }
             }
-
-
             httpRespMsg.data = nameList;
         } catch (NullPointerException e) {
             e.printStackTrace();

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

@@ -42,7 +42,7 @@
 
     <select id="getFillProcedureDetail" 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,
+               plan.`product_scheduling_num`,plan.task_type_name,plan.task_name,plan.task_change_notice_num,plan.num,
                product.`name` AS product_name,prod_procedure.name AS procedure_name, if(plan.plan_type=0,prod_procedure.check_type, plan.check_type) as check_type, plan.station_id
         FROM prod_procedure_team a
                  left join plan_procedure_total on plan_procedure_total.id = a.plan_procedure_id

+ 15 - 4
fhKeeper/formulahousekeeper/timesheet-workshop-h5/src/views/workView/fillReport.vue

@@ -2,7 +2,7 @@
   <div class="distribution">
     <van-nav-bar title="报工" left-text="返回" @click-left="back" fixed left-arrow />
     <div class="distribution_header">
-      <div>{{ reportForm.product_name }}</div>
+      <div>{{ reportForm.product_name }}<span style="float:right;color:#20a0ff;">{{reportDate  }}</span> </div>
       <div>{{ reportForm.plan_type == 0 ? reportForm.product_scheduling_num : reportForm.task_change_notice_num }}</div>
       <div>{{ reportForm.start_date }}至{{ reportForm.end_date }}</div>
     </div>
@@ -16,8 +16,8 @@
             <template>
               <div style="float:right;" v-if="reportForm.planSteelStampNumberList&&reportForm.planSteelStampNumberList.length>0">
                 <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="index">{{ item }}</van-checkbox>
+                  <van-checkbox style="padding:5px;" :name="item.number" @click="onCheckChange" :disabled="item.disabled" 
+                    v-for="(item, index) in reportForm.planSteelStampNumberList" :key="index">{{ item.number }}</van-checkbox>
                 </van-checkbox-group>
               </div>
               <div v-else>无</div>
@@ -25,7 +25,7 @@
           </van-cell>
           <van-cell title="当日完成件数">
             <template>
-              <van-stepper v-model="reportForm.finishNum" step="0.1" :min="0" :max="1000" />
+              <van-stepper v-model="reportForm.finishNum" step="0.1" :min="0" :max="reportForm.num" @change="onFinishNumChange"/>
             </template>
           </van-cell>
           <van-cell title="完成全部工作" >
@@ -77,6 +77,7 @@ export default {
   },
   data() {
     return {
+      reportDate: null,
       checkerOptionList: [],
       checkerShow: false,
       user: JSON.parse(localStorage.userInfo),
@@ -93,9 +94,16 @@ export default {
   watch: {},
   created() { },
   mounted() {
+    this.reportDate = this.$route.query.date;
     this.getMyPlanProcedureList();
   },
   methods: {
+    onFinishNumChange() {
+      //件数发生改变时,检测如果和计划总件数一样,则算完成
+      if (this.reportForm.finishNum == this.reportForm.num) {
+          this.$set(this.reportForm, 'isFinish',true);
+      } 
+    },
     back() {
       this.$router.go(-1);
     },
@@ -171,6 +179,9 @@ export default {
       if(reportBoolean == 'true') {
         params.createDate = date
       }
+      if (this.reportDate) {
+        params.createDate = this.reportDate;
+      }
       this.$axios.post("/plan-procedure-total/getFillProcedureDetail", params)
         .then(res => {
           if (res.code == "ok") {