hanfucheng 8 miesięcy temu
rodzic
commit
2b6953be72

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

@@ -232,4 +232,15 @@ public class CenterdataTHousingconstructionViewController extends BaseController
         return AjaxResult.success(housingconstructionViewService.getNewUserSumByEnterpriseId(steelcylinder));
     }
 
+    /*
+    * 查询企业生产报告
+    *
+    * @author 韩福成
+    * @date 2024/10/29 下午3:16
+    */
+    @GetMapping("/getProductionReport")
+    public AjaxResult getProductionReport(CenterdataTHousingconstructionSteelcylinder steelcylinder){
+        return AjaxResult.success(housingconstructionViewService.getProductionReport(steelcylinder));
+    }
+
 }

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

@@ -51,4 +51,6 @@ public interface CenterdataTHousingconstructionViewMapper {
     public List<Map<String,Object>> getItems(CenterdataTHousingconstructionSafetyinspectionrecordsdetail safetyinspectionrecordsdetail);
 
     List<Map<String, Object>> getNewUserSumByEnterpriseId(CenterdataTHousingconstructionSteelcylinder steelcylinder);
+
+    List<Map<String, Object>> getProductionReport(CenterdataTHousingconstructionSteelcylinder steelcylinder);
 }

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

@@ -51,4 +51,6 @@ public interface ICenterdataTHousingconstructionViewService {
     public List<Map<String,Object>> getItems(CenterdataTHousingconstructionSafetyinspectionrecordsdetail safetyinspectionrecordsdetail);
 
     List<Map<String, Object>> getNewUserSumByEnterpriseId(CenterdataTHousingconstructionSteelcylinder steelcylinder);
+
+    List<Map<String, Object>> getProductionReport(CenterdataTHousingconstructionSteelcylinder steelcylinder);
 }

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

@@ -376,5 +376,23 @@ public class CenterdataTHousingconstructionViewServiceImpl extends BaseServiceIm
         });
         return resultData;
     }
+    @DataScopeMutiDept(deptAlias = "d")
+    @Override
+    public List<Map<String,Object>> getProductionReport(CenterdataTHousingconstructionSteelcylinder steelcylinder) {
+        setSookaDataBase(steelcylinder);
+        List<Map<String, Object>> list = centerdataTHousingconstructionViewMapper.getProductionReport(steelcylinder);
+        String fileUrl = SpringUtils.getBean(RemoteConfigService.class).remotegetConfigKey("fileUrl").getData();
+        for (Map<String,Object> map : list) {
+            if (map.get("attachPath") != null) {
+                String[] paths = map.get("attachPath").toString().split(",");
+                List<String> pathList = new ArrayList<>();
+                for (String part : paths) {
+                    pathList.add(fileUrl + part);
+                }
+                map.put("attachPath", pathList);
+            }
+        }
+        return list;
+    }
 
 }

+ 16 - 0
src/main/resources/mapper/housingconstruction/CenterdataTHousingconstructionViewMapper.xml

@@ -534,4 +534,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </where>
         GROUP BY e.enterprise_name, DATE_FORMAT(r.account_open_time, '%Y-%m');
     </select>
+
+    <select id="getProductionReport" parameterType="CenterdataTHousingconstructionSteelcylinder" resultType="map">
+        SELECT
+            a.enterprise_name enterpriseName,
+            a.report_type reportType,
+            b.dict_label reportTypeLabel,
+            a.create_time createTime,
+            c.file_name fileName,
+            c.attach_path attachPath
+        FROM
+            centerdata_t_housingconstruction_enterpriseproductionreport a
+                left join onest_system.sys_dict_data b on a.report_type = b.dict_value
+                left join centerdata_t_housingconstruction_attach c on a.id = c.bus_id
+        WHERE a.enterprise_id = #{enterpriseId}
+          and b.dict_type = 'enterprise_qualification_file'
+    </select>
 </mapper>