Forráskód Böngészése

Merge remote-tracking branch 'origin/master'

fangpy 1 éve
szülő
commit
604fd7e419

+ 8 - 0
cx-aps/cx-aps-common/src/main/java/com/rongwei/bscommon/sys/service/impl/ApsReportOutputServiceImpl.java

@@ -87,6 +87,7 @@ public class ApsReportOutputServiceImpl extends ServiceImpl<ApsReportOutputDao,
                         apsReportOutputDo.setLength(apsProcessOperationOutMaterDo.getProlength());
                         apsReportOutputDo.setWeight(apsProcessOperationOutMaterDo.getSinglerollweight());
                         apsReportOutputDo.setInsepctionlevel(B);
+                        apsReportOutputDo.setQualified("是");;
                         resList.add(apsReportOutputDo);
                     }
                 }
@@ -115,6 +116,7 @@ public class ApsReportOutputServiceImpl extends ServiceImpl<ApsReportOutputDao,
                         apsReportOutputDo.setLength(apsProcessOperationOutMaterDo.getProlength());
                         apsReportOutputDo.setWeight(apsProcessOperationOutMaterDo.getSinglerollweight());
                         apsReportOutputDo.setInsepctionlevel(B);
+                        apsReportOutputDo.setQualified("是");
                         resList.add(apsReportOutputDo);
                     }
                 }
@@ -136,6 +138,7 @@ public class ApsReportOutputServiceImpl extends ServiceImpl<ApsReportOutputDao,
                 apsReportOutputDo.setLength(list.get(0).getProlength());
                 apsReportOutputDo.setWeight(list.get(0).getSinglerollweight());
                 apsReportOutputDo.setInsepctionlevel(B);
+                apsReportOutputDo.setQualified("是");
                 JSONObject json = new JSONObject();
                 json.put("batchNumber", req.getInputBatchNumber());
                 //生成二维码
@@ -183,6 +186,7 @@ public class ApsReportOutputServiceImpl extends ServiceImpl<ApsReportOutputDao,
                         apsReportOutputDo.setLength(apsProcessOperationOutMaterDo.getProlength());
                         apsReportOutputDo.setWeight(apsProcessOperationOutMaterDo.getSinglerollweight());
                         apsReportOutputDo.setInsepctionlevel(B);
+                        apsReportOutputDo.setQualified("是");
                         resList.add(apsReportOutputDo);
                     }
                 }
@@ -235,6 +239,7 @@ public class ApsReportOutputServiceImpl extends ServiceImpl<ApsReportOutputDao,
                         apsReportOutputDo.setLength(apsProcessOperationOutMaterDo.getProlength());
                         apsReportOutputDo.setWeight(apsProcessOperationOutMaterDo.getSinglerollweight());
                         apsReportOutputDo.setInsepctionlevel(B);
+                        apsReportOutputDo.setQualified("是");
                         resList.add(apsReportOutputDo);
                     }
                 }
@@ -255,6 +260,7 @@ public class ApsReportOutputServiceImpl extends ServiceImpl<ApsReportOutputDao,
                         apsReportOutputDo.setLength(apsProcessOperationOutMaterDo.getProlength());
                         apsReportOutputDo.setWeight(apsProcessOperationOutMaterDo.getSinglerollweight());
                         apsReportOutputDo.setInsepctionlevel(B);
+                        apsReportOutputDo.setQualified("是");
                         resList.add(apsReportOutputDo);
                     }
                 }
@@ -275,6 +281,7 @@ public class ApsReportOutputServiceImpl extends ServiceImpl<ApsReportOutputDao,
                 apsReportOutputDo.setLength(list.get(0).getProlength());
                 apsReportOutputDo.setWeight(list.get(0).getSinglerollweight());
                 apsReportOutputDo.setInsepctionlevel(B);
+                apsReportOutputDo.setQualified("是");
                 resList.add(apsReportOutputDo);
             } else {//输出物料数量>1,或者单卷输出数量>1
                 for (ApsProcessOperationOutMaterDo apsProcessOperationOutMaterDo : list) {
@@ -293,6 +300,7 @@ public class ApsReportOutputServiceImpl extends ServiceImpl<ApsReportOutputDao,
                         apsReportOutputDo.setLength(apsProcessOperationOutMaterDo.getProlength());
                         apsReportOutputDo.setWeight(apsProcessOperationOutMaterDo.getSinglerollweight());
                         apsReportOutputDo.setInsepctionlevel(B);
+                        apsReportOutputDo.setQualified("是");
                         resList.add(apsReportOutputDo);
                     }
                 }

+ 3 - 2
cx-aps/cx-aps-common/src/main/java/com/rongwei/bscommon/sys/service/impl/ApsReportRecordsServiceImpl.java

@@ -199,8 +199,9 @@ public class ApsReportRecordsServiceImpl extends ServiceImpl<ApsReportRecordsDao
         //查询此工序对应工艺步骤中,对应设备的设备参数
         String equparames = "";
         //查询工序步骤
-        String processcode = apsProcessOperationDo.getProcesscode();
-        ApsCraftStepDo craftStepDo = apsCraftStepService.getOne(new QueryWrapper<ApsCraftStepDo>().lambda().eq(ApsCraftStepDo::getProcesscode, processcode));
+        String process = apsProcessOperationDo.getProcess();
+        String processname = apsProcessOperationDo.getProcessname();
+        ApsCraftStepDo craftStepDo = apsCraftStepService.getOne(new QueryWrapper<ApsCraftStepDo>().lambda().eq(ApsCraftStepDo::getProcess, process).eq(ApsCraftStepDo::getProcessname, processname));
         if (ObjectUtil.isNotEmpty(craftStepDo)) {
             //查询设备参数子表
             ApsCraftEquDo apsCraftEquDo = apsCraftEquService.getOne(new QueryWrapper<ApsCraftEquDo>().lambda().eq(ApsCraftEquDo::getMainid, craftStepDo.getId()).eq(ApsCraftEquDo::getResourceid, apsProcessOperationProcessEquDo.getProcessdeviceid()));

+ 8 - 3
cx-aps/cx-aps-common/src/main/java/com/rongwei/bscommon/sys/service/impl/ReportCheckServiceImpl.java

@@ -225,9 +225,9 @@ public class ReportCheckServiceImpl implements ReportCheckService {
             apsWorkInProgressInventoryService.removeByIds(deletedIdList);
         }
         /********************************更新当前报工记录的待检验批次号*************************************/
-        apsReportRecordsService.update(new LambdaUpdateWrapper<ApsReportRecordsDo>().eq(ApsReportRecordsDo::getId, id)
-                .set(ApsReportRecordsDo::getCheckstatus, VERIFIED)
-                .set(ApsReportRecordsDo::getNeedcheckbatchnumber, ""));
+//        apsReportRecordsService.update(new LambdaUpdateWrapper<ApsReportRecordsDo>().eq(ApsReportRecordsDo::getId, id)
+//                .set(ApsReportRecordsDo::getCheckstatus, VERIFIED)
+//                .set(ApsReportRecordsDo::getNeedcheckbatchnumber, ""));
         /******************************如果本次检验中存在不合格的批次 则更新后续所有工序作业的状态***************************/
         if (unqualifiedQuantity != 0 && (nextProcessIds!= null && !nextProcessIds.isEmpty())) {
             ApsProcessOperationDo apsProcessOperationDo = apsProcessOperationService.getById(currentProcessOperationMainDo.getId());
@@ -256,6 +256,11 @@ public class ReportCheckServiceImpl implements ReportCheckService {
                 .in(ApsReportOutputDo::getId,reportOutputDos.stream().map(ApsReportOutputDo::getId).collect(Collectors.toList()))
                 .set(ApsReportOutputDo::getCheckstatus,VERIFIED));
         reportRecordsDo.setCheckstatus(VERIFIED);
+
+        apsReportRecordsService.update(new LambdaUpdateWrapper<ApsReportRecordsDo>()
+                .set(ApsReportRecordsDo::getCheckstatus,VERIFIED)
+                .set(ApsReportRecordsDo::getNeedcheckbatchnumber,null)
+                .eq(ApsReportRecordsDo::getId,id));
         return R.ok();
     }
 

+ 1 - 2
cx-aps/cx-aps-server/src/main/java/com/rongwei/bsserver/controller/ReportCheckController.java

@@ -32,7 +32,6 @@ public class ReportCheckController {
      */
     @PostMapping("/save/postposition")
     public R updateRelevantInformation(@RequestParam(name = "reportCheckId", required = true) String reportCheckId) {
-        reportCheckService.updateRelevantInformation(reportCheckId);
-        return R.ok();
+        return reportCheckService.updateRelevantInformation(reportCheckId);
     }
 }

+ 35 - 35
cx-safe-check/cx-save-check-common/src/main/java/com/rongwei/sfcommon/sys/dao/AccidentDao.java

@@ -63,41 +63,41 @@ public interface AccidentDao extends BaseDao<AccidentDo> {
     @Select("SELECT * FROM sys_organization where DELETED = 0 AND PID = '-1'")
     List<Map<String, String>> selectFactory();
 
-    @Select({"<script>" +
-            "SELECT\n" +
-            "\tso.ID AS 'departid',\n" +
-            "\tso.FULLNAME AS 'departname',\n" +
-            "\tsum(IFNULL( suo.totalPeople, 0 )) AS 'departpeople',\n" +
-            "\tsum(IFNULL( b.count, 0 )) AS 'count',\n" +
-            "\tIFNULL(round( sum( IFNULL( b.count, 0 ))/ sum( IFNULL( suo.totalPeople, 0 ))* 100, 2 ),0.00) AS 'value'\n" +
-            "FROM\n" +
-            "\tsys_organization so\n" +
-            "\tLEFT JOIN sys_organization so2 ON ( ( so2.FULLPID LIKE CONCAT( '%', so.ID, '%' )) OR so2.ID = so.ID ) \n" +
-            "\tAND so2.DELETED = 0\n" +
-            "\tLEFT JOIN (\n" +
-            "\tSELECT\n" +
-            "\t\taa.ACCIDENTDEPT,\n" +
-            "\t\taa.ACCIDENTDEPTNAME,\n" +
-            "\t\tcount( 1 ) AS 'count' \n" +
-            "\tFROM\n" +
-            "\t\tasp_accident aa \n" +
-            "\tWHERE\n" +
-            "\t\taa.DELETED = 0 \n" +
-            "\t\tAND aa.DECLAREJOBINJURED = '1' \n" +
-            "\t\t<if test = 'month != -1'>AND MONTH ( aa.HAPPENDATE ) = #{month}</if> \n" +
-            "\t\tAND YEAR ( aa.HAPPENDATE ) = #{year} \n" +
-            "\t\t<if test = 'tenantId != null and tenantId != \"\"'>AND aa.TENANTID = #{tenantId}</if>\n" +
-            "\tGROUP BY\n" +
-            "\t\taa.ACCIDENTDEPT \n" +
-            "\t) b ON b.ACCIDENTDEPT = so2.ID \n" +
-            "\tAND so.DELETED = 0\n" +
-            "\tLEFT JOIN ( SELECT ORGID, count( 1 ) AS totalPeople FROM sys_user_org WHERE DELETED = 0 GROUP BY ORGID ) suo ON so2.ID = suo.ORGID \n" +
-            "WHERE\n" +
-            "\tso.ORGTYPE = 'chejian' \n" +
-            "\t<if test = 'tenantId != null and tenantId != \"\"'>AND so.FULLPID like CONCAT('%',#{tenantId},'%')</if>\n" +
-            "GROUP BY\n" +
-            "\tso.ID"+
-            "</script>"})
+//    @Select({"<script>" +
+//            "SELECT\n" +
+//            "\tso.ID AS 'departid',\n" +
+//            "\tso.FULLNAME AS 'departname',\n" +
+//            "\tsum(IFNULL( suo.totalPeople, 0 )) AS 'departpeople',\n" +
+//            "\tsum(IFNULL( b.count, 0 )) AS 'count',\n" +
+//            "\tIFNULL(round( sum( IFNULL( b.count, 0 ))/ sum( IFNULL( suo.totalPeople, 0 ))* 100, 2 ),0.00) AS 'value'\n" +
+//            "FROM\n" +
+//            "\tsys_organization so\n" +
+//            "\tLEFT JOIN sys_organization so2 ON ( ( so2.FULLPID LIKE CONCAT( '%', so.ID, '%' )) OR so2.ID = so.ID ) \n" +
+//            "\tAND so2.DELETED = 0\n" +
+//            "\tLEFT JOIN (\n" +
+//            "\tSELECT\n" +
+//            "\t\taa.ACCIDENTDEPT,\n" +
+//            "\t\taa.ACCIDENTDEPTNAME,\n" +
+//            "\t\tcount( 1 ) AS 'count' \n" +
+//            "\tFROM\n" +
+//            "\t\tasp_accident aa \n" +
+//            "\tWHERE\n" +
+//            "\t\taa.DELETED = 0 \n" +
+//            "\t\tAND aa.DECLAREJOBINJURED = '1' \n" +
+//            "\t\t<if test = 'month != -1'>AND MONTH ( aa.HAPPENDATE ) = #{month}</if> \n" +
+//            "\t\tAND YEAR ( aa.HAPPENDATE ) = #{year} \n" +
+//            "\t\t<if test = 'tenantId != null and tenantId != \"\"'>AND aa.TENANTID = #{tenantId}</if>\n" +
+//            "\tGROUP BY\n" +
+//            "\t\taa.ACCIDENTDEPT \n" +
+//            "\t) b ON b.ACCIDENTDEPT = so2.ID \n" +
+//            "\tAND so.DELETED = 0\n" +
+//            "\tLEFT JOIN ( SELECT ORGID, count( 1 ) AS totalPeople FROM sys_user_org WHERE DELETED = 0 GROUP BY ORGID ) suo ON so2.ID = suo.ORGID \n" +
+//            "WHERE\n" +
+//            "\tso.ORGTYPE = 'chejian' \n" +
+//            "\t<if test = 'tenantId != null and tenantId != \"\"'>AND so.FULLPID like CONCAT('%',#{tenantId},'%')</if>\n" +
+//            "GROUP BY\n" +
+//            "\tso.ID"+
+//            "</script>"})
     List<AspAccidentReport> selectReport(int year, int month, String tenantId);
 
     @Select({"<script>" +

+ 54 - 0
cx-safe-check/cx-save-check-common/src/main/resources/mybatis/AccidentDao.xml

@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.rongwei.sfcommon.sys.dao.AccidentDao">
+    <select id="selectReport" resultType="com.rongwe.scentity.domian.AspAccidentReport">
+        WITH ORG_USER_COUNT AS (
+        SELECT
+        c.ID,
+        max( c.FULLNAME ) AS FULLNAME,
+        max( c.TENANTID ) AS TENANTID,
+        max( c.orgids ) AS orgids,
+        COUNT( suo.USERID ) AS ORG_TOTAL
+        FROM
+        (
+        SELECT
+        a.ID,
+        a.FULLNAME,
+        SUBSTRING_INDEX( SUBSTRING_INDEX( a.FULLPID, ',', 2 ), ',', - 1 ) AS TENANTID,
+        IFNULL( CONCAT( GROUP_CONCAT( DISTINCT b.ID ), ',', a.ID ), a.ID ) AS orgids
+        FROM
+        sys_organization a
+        LEFT JOIN sys_organization b ON FIND_IN_SET( a.ID, b.FULLPID )
+        AND b.DELETED = '0'
+        WHERE
+        a.DELETED = '0'
+        AND a.ORGTYPE = 'chejian'
+        <if test="tenantId != null">AND FIND_IN_SET(#{tenantId}, a.FULLPID ) </if>
+        GROUP BY
+        a.ID,
+        a.TENANTID
+        ) c
+        LEFT JOIN sys_user_org suo ON FIND_IN_SET( suo.ORGID, c.orgids )
+        AND suo.DELETED = '0'
+        GROUP BY
+        C.ID
+        ) SELECT
+        ouc.ID as departid,
+        max( ouc.FULLNAME ) AS departname,
+        max( ouc.TENANTID ) AS TENANTID,
+        max( ouc.orgids ) AS orgids,
+        max( ouc.ORG_TOTAL ) AS departpeople,
+        COUNT( aa.ID ) AS count,
+        IFNULL(round( COUNT( aa.ID )/ max( ouc.ORG_TOTAL )* 100, 2 ),0.00) AS value
+        FROM
+        ORG_USER_COUNT ouc
+        LEFT JOIN asp_accident aa ON FIND_IN_SET( aa.ACCIDENTDEPT, ouc.orgids )
+        AND aa.DECLAREJOBINJURED = '1'
+        and aa.DELETED = 0
+        <if test="year != null">AND YEAR(aa.HAPPENDATE) = #{year}</if>
+        <if test="month != null">AND MONTH(aa.HAPPENDATE) = #{month}</if>
+        <if test="tenantId != null">AND aa.TENANTID= #{tenantId}</if>
+        GROUP BY
+        ouc.ID
+    </select>
+</mapper>

+ 4 - 1
cx-safe-check/cx-save-check-entity/src/main/java/com/rongwe/scentity/domian/AspAccidentReport.java

@@ -2,6 +2,8 @@ package com.rongwe.scentity.domian;
 
 import java.io.Serializable;
 import java.util.Date;
+
+import com.baomidou.mybatisplus.annotation.TableName;
 import lombok.Data;
 
 /**
@@ -9,6 +11,7 @@ import lombok.Data;
  * @author 
  */
 @Data
+@TableName("asp_accident_report")
 public class AspAccidentReport implements Serializable {
     /**
      * 主键ID
@@ -106,4 +109,4 @@ public class AspAccidentReport implements Serializable {
     private Integer count = 0;
 
     private static final long serialVersionUID = 1L;
-}
+}