hanfucheng 10 月之前
父节点
当前提交
18eaed1318

+ 5 - 2
data-ui/src/views/data/housingconstruction/inspect/index.vue

@@ -119,8 +119,8 @@
     />
 
     <!-- 添加或修改钢瓶年检对话框 -->
-    <el-dialog :title="title" :visible.sync="open" width="600px" class="form-style">
-      <el-form ref="form" :model="form" :rules="rules" label-width="100px">
+    <el-dialog :title="title" :visible.sync="open" width="800px" class="form-style">
+      <el-form ref="form" :model="form" :rules="rules" label-width="150px">
         <el-form-item label="钢瓶" prop="steelcylinderId">
           <el-select v-model="form.steelcylinderId" filterable placeholder="请选择钢瓶">
             <el-option
@@ -238,6 +238,9 @@ export default {
         state: [
           {required: true, message: "年检状态不能为空", trigger: "change"},
         ],
+        nextInspectTime: [
+          {required: true, message: "下次年检时间不能为空", trigger: "blur"},
+        ],
       }
     };
   },

+ 33 - 0
src/main/java/com/sooka/sponest/data/housingconstruction/controller/CenterdataTHousingconstructionViewController.java

@@ -188,4 +188,37 @@ public class CenterdataTHousingconstructionViewController extends BaseController
         return R.ok(housingconstructionViewService.getResourcePoint(storagetank));
     }
 
+    /*
+    * 企业生产报告
+    *
+    * @author 韩福成
+    * @date 2024/9/27 下午3:08
+    */
+    @GetMapping("/getReport")
+    public R getReport(CenterdataTHousingconstructionEnterpriseproductionreport enterpriseproductionreport) {
+        return R.ok(housingconstructionViewService.getReport(enterpriseproductionreport));
+    }
+
+    /*
+    * 安全检查记录列表
+    *
+    * @author 韩福成
+    * @date 2024/9/27 下午3:37
+    */
+    @GetMapping("/getInspectionRecords")
+    public R getInspectionRecords(CenterdataTHousingconstructionSafetyinspectionrecords enterpriseproductionreport) {
+        return R.ok(housingconstructionViewService.getInspectionRecords(enterpriseproductionreport));
+    }
+
+    /*
+    * 安全检查项
+    *
+    * @author 韩福成
+    * @date 2024/9/27 下午4:27
+    */
+    @GetMapping("/getItems")
+    public R getItems(CenterdataTHousingconstructionSafetyinspectionrecordsdetail safetyinspectionrecordsdetail) {
+        return R.ok(housingconstructionViewService.getItems(safetyinspectionrecordsdetail));
+    }
+
 }

+ 6 - 0
src/main/java/com/sooka/sponest/data/housingconstruction/mapper/CenterdataTHousingconstructionViewMapper.java

@@ -44,4 +44,10 @@ public interface CenterdataTHousingconstructionViewMapper {
 
     public List<Map<String,Object>> getSteelcylinderPointList(CenterdataTHousingconstructionSteelcylinder steelcylinder);
 
+    public List<Map<String,Object>> getReport(CenterdataTHousingconstructionEnterpriseproductionreport enterpriseproductionreport);
+
+    public List<Map<String,Object>> getInspectionRecords(CenterdataTHousingconstructionSafetyinspectionrecords enterpriseproductionreport);
+
+    public List<Map<String,Object>> getItems(CenterdataTHousingconstructionSafetyinspectionrecordsdetail safetyinspectionrecordsdetail);
+
 }

+ 6 - 0
src/main/java/com/sooka/sponest/data/housingconstruction/service/ICenterdataTHousingconstructionViewService.java

@@ -44,4 +44,10 @@ public interface ICenterdataTHousingconstructionViewService {
 
     public List<Map<String,Object>> getResourcePoint(CenterdataTHousingconstructionStoragetank storagetank);
 
+    public List<Map<String,Object>> getReport(CenterdataTHousingconstructionEnterpriseproductionreport enterpriseproductionreport);
+
+    public List<Map<String,Object>> getInspectionRecords(CenterdataTHousingconstructionSafetyinspectionrecords enterpriseproductionreport);
+
+    public List<Map<String,Object>> getItems(CenterdataTHousingconstructionSafetyinspectionrecordsdetail safetyinspectionrecordsdetail);
+
 }

+ 63 - 0
src/main/java/com/sooka/sponest/data/housingconstruction/service/impl/CenterdataTHousingconstructionViewServiceImpl.java

@@ -277,4 +277,67 @@ public class CenterdataTHousingconstructionViewServiceImpl extends BaseServiceIm
         }
         return mapList;
     }
+
+    /*
+    * 企业生产报告
+    *
+    * @author 韩福成
+    * @date 2024/9/27 下午3:10
+    */
+    @DataScopeMutiDept(deptAlias = "d")
+    @Override
+    public List<Map<String,Object>> getReport(CenterdataTHousingconstructionEnterpriseproductionreport enterpriseproductionreport) {
+        setSookaDataBase(enterpriseproductionreport);
+        List<Map<String,Object>> list = centerdataTHousingconstructionViewMapper.getReport(enterpriseproductionreport);
+        String fileUrl = SpringUtils.getBean(RemoteConfigService.class).remotegetConfigKey("fileUrl").getData();
+        for (Map<String,Object> map : list) {
+            if (map.get("attachPaths") != null) {
+                String[] paths = map.get("attachPaths").toString().split(",");
+                List<String> pathList = new ArrayList<>();
+                for (String part : paths) {
+                    pathList.add(fileUrl + part);
+                }
+                map.put("attachPaths", pathList);
+            }
+        }
+        return list;
+    }
+
+    /*
+    * 安全检查记录列表
+    *
+    * @author 韩福成
+    * @date 2024/9/27 下午3:57
+    */
+    @DataScopeMutiDept(deptAlias = "d")
+    @Override
+    public List<Map<String,Object>> getInspectionRecords(CenterdataTHousingconstructionSafetyinspectionrecords enterpriseproductionreport) {
+        setSookaDataBase(enterpriseproductionreport);
+        return centerdataTHousingconstructionViewMapper.getInspectionRecords(enterpriseproductionreport);
+    }
+
+    /*
+    * 安全检查项
+    *
+    * @author 韩福成
+    * @date 2024/9/27 下午4:30
+    */
+    @DataScopeMutiDept(deptAlias = "d")
+    @Override
+    public List<Map<String,Object>> getItems(CenterdataTHousingconstructionSafetyinspectionrecordsdetail safetyinspectionrecordsdetail) {
+        setSookaDataBase(safetyinspectionrecordsdetail);
+        List<Map<String,Object>> list = centerdataTHousingconstructionViewMapper.getItems(safetyinspectionrecordsdetail);
+        String fileUrl = SpringUtils.getBean(RemoteConfigService.class).remotegetConfigKey("fileUrl").getData();
+        for (Map<String,Object> map : list) {
+            if (map.get("attachPaths") != null) {
+                String[] paths = map.get("attachPaths").toString().split(",");
+                List<String> pathList = new ArrayList<>();
+                for (String part : paths) {
+                    pathList.add(fileUrl + part);
+                }
+                map.put("attachPaths", pathList);
+            }
+        }
+        return list;
+    }
 }

+ 1 - 0
src/main/resources/mapper/housingconstruction/CenterdataTHousingconstructionRealnameuserMapper.xml

@@ -127,6 +127,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="getRealnameuserList" parameterType="CenterdataTHousingconstructionRealnameuser" resultType="map">
         SELECT
+        a.id,
         a.enterprise_id enterpriseId,
         enterprise_user_type enterpriseUserType,
         b.dict_label enterpriseUserTypeLabel,

+ 62 - 2
src/main/resources/mapper/housingconstruction/CenterdataTHousingconstructionViewMapper.xml

@@ -289,7 +289,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         WHERE DATE( delivery_time ) = DATE( NOW( ) )
         <if test="enterpriseId != null  and enterpriseId != ''"> and a.enterprise_id = #{enterpriseId}</if>
                 ${params.dataScope}
-        UNION ALL
+       <!-- UNION ALL
         SELECT
             '空罐回收' type,
             count( b.id ) num
@@ -299,7 +299,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                 left join ${database_system}.sys_dept d on a.dept_id = d.dept_id
         WHERE DATE( recycling_time ) = DATE( NOW( ) )
         <if test="enterpriseId != null  and enterpriseId != ''"> and a.enterprise_id = #{enterpriseId}</if>
-                ${params.dataScope}
+                ${params.dataScope}-->
+        union all
+        SELECT
+            '钢瓶待检' type,
+            count( a.id ) num
+        FROM
+            centerdata_t_housingconstruction_inspect a
+            JOIN ( SELECT steelcylinder_id, MAX( create_time ) max_time
+                   FROM centerdata_t_housingconstruction_inspect GROUP BY steelcylinder_id ) b
+            ON a.steelcylinder_id = b.steelcylinder_id AND a.create_time = b.max_time
+        WHERE
+            a.next_inspect_time &lt; DATE( NOW( ) )
+        <if test="enterpriseId != null  and enterpriseId != ''"> and a.dept_id = #{enterpriseId}</if>
     </select>
 
     <select id="getJoinHouseUserList" parameterType="CenterdataTHousingconstructionSteelcylinder" resultType="map">
@@ -371,4 +383,52 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             ${params.dataScope}
         GROUP BY a.id
     </select>
+
+    <select id="getReport" parameterType="CenterdataTHousingconstructionEnterpriseproductionreport" resultType="map">
+        SELECT
+            a.enterprise_name enterpriseName,
+            a.report_type reportType,
+            c.dict_label reportTypeLabel,
+            GROUP_CONCAT(b.attach_path) attachPaths
+        FROM
+            centerdata_t_housingconstruction_enterpriseproductionreport a
+                LEFT JOIN centerdata_t_housingconstruction_attach b ON a.id = b.bus_id
+                left join ${database_system}.sys_dict_data c on a.report_type = c.dict_value
+        where a.report_type LIKE concat( 'enterprise_production_report', '%' )
+        <if test="enterpriseId != null  and enterpriseId != ''"> and a.enterprise_id = #{enterpriseId}</if>
+        GROUP BY a.id
+    </select>
+
+    <select id="getInspectionRecords" parameterType="CenterdataTHousingconstructionSafetyinspectionrecords" resultType="map">
+        SELECT
+            a.id,
+            a.censor_name censorName,
+            a.client_name clientName,
+            b.dict_label typeLabel,
+            a.steelcylinder_name steelcylinderName
+        FROM
+            centerdata_t_housingconstruction_safetyinspectionrecords a
+                left join ${database_system}.sys_dict_data b on a.enterprise_inspection_type = b.dict_value
+        WHERE
+            b.dict_type = 'enterprise_inspection_type'
+        <if test="clientId != null  and clientId != ''"> and a.client_id = #{clientId}</if>
+    </select>
+
+    <select id="getItems" parameterType="CenterdataTHousingconstructionSafetyinspectionrecordsdetail" resultType="map">
+        SELECT
+            if(a.standard_status='0','不合格','合格') `status`,
+            a.remark,
+            b.inspection_name inspectionName,
+            b.inspection_sort inspectionSort,
+            if(b.update_time is null,b.create_time,b.update_time) time,
+	        GROUP_CONCAT(c.attach_path) attachPaths
+        FROM
+            centerdata_t_housingconstruction_safetyinspectionrecordsdetail a
+            LEFT JOIN centerdata_t_housingconstruction_safetyinspectionitem b ON a.item_id = b.id
+            left join centerdata_t_housingconstruction_attach c on a.id = c.bus_id
+        WHERE
+            a.record_id = #{recordId}
+        GROUP BY a.id
+        ORDER BY b.inspection_sort
+    </select>
 </mapper>