فهرست منبع

企业自主管理-企业经营情况相关接口开发

jichaobo 2 سال پیش
والد
کامیت
86ed60955a

+ 16 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/controller/web/BscEnterpriseAutonomyController.java

@@ -9,6 +9,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
+import java.util.List;
+import java.util.Map;
+
 /**
  * <p>
  * 企业自主管理大屏统计(全部) 前端控制器
@@ -48,5 +51,18 @@ public class BscEnterpriseAutonomyController {
         bscEnterpriseAutonomyService.enterpriseAutonomyTask();
         return ApiResult.success();
     }
+
+
+    /**
+     * 企业自主管理-企业经营情况-数据查询
+     *
+     * @param companyId 单位ID
+     * @return
+     */
+    @GetMapping("erpData")
+    public ApiResult<List<Map<String, Object>>> erpData(@RequestParam(value = "companyId", defaultValue = "2DB679350A0F4023B74C4261539AA031") String companyId) {
+        return ApiResult.success(bscEnterpriseAutonomyService.erpData(companyId));
+    }
+
 }
 

+ 45 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/domain/BaseCompanyAttach1.java

@@ -202,5 +202,50 @@ public class BaseCompanyAttach1 implements Serializable {
      */
     private LocalDateTime updateTime;
 
+    /**
+     * 注册资金
+     */
+    private String registeredCapital;
+
+    /**
+     * 经营状态
+     */
+    private String businessStatus;
+
+    /**
+     * 实缴资本
+     */
+    private String paidCapital;
+
+    /**
+     * 登记机关
+     */
+    private String registrar;
+
+    /**
+     * 竣工年份
+     */
+    private String completedTime;
+
+    /**
+     * 耐火等级
+     */
+    private String fireRating;
+
+    /**
+     * 建筑高度
+     */
+    private String buildingHeight;
+
+    /**
+     * 建筑结构
+     */
+    private String buildingStructure;
+
+    /**
+     * 建筑情况
+     */
+    private String construction;
+
 
 }

+ 9 - 1
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/BscEnterpriseAutonomyService.java

@@ -30,12 +30,20 @@ public interface BscEnterpriseAutonomyService extends CrudService<BscEnterpriseA
      */
     void enterpriseAutonomyTask();
 
+    /**
+     * 企业自主管理-企业经营情况-数据查询
+     *
+     * @param companyId 单位ID
+     * @return
+     */
+    List<Map<String, Object>> erpData(String companyId);
+
     /**
      * 企业自主管理大屏统计(全部)-企业自主情况模块查询(定时)
      *
      * @return
      */
-    Map<String, Object>  enterpriseAutonomyData();
+    Map<String, Object> enterpriseAutonomyData();
 
     /**
      * 最后6条数据查询

+ 71 - 13
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/BscEnterpriseAutonomyServiceImpl.java

@@ -133,7 +133,8 @@ public class BscEnterpriseAutonomyServiceImpl extends AbstractCrudService<BscEnt
     }
 
 
-    public void erpData(String companyId) {
+    @Override
+    public List<Map<String, Object>> erpData(String companyId) {
         LambdaQueryWrapper<BaseCompany> queryWrapper1 = Wrappers.lambdaQuery();
         queryWrapper1.select(BaseCompany::getId, BaseCompany::getCompanyId, BaseCompany::getCompanyName, BaseCompany::getFoundTime,
                 BaseCompany::getCompanyType, BaseCompany::getLinkPhone, BaseCompany::getAddress, BaseCompany::getOrganization,
@@ -142,19 +143,76 @@ public class BscEnterpriseAutonomyServiceImpl extends AbstractCrudService<BscEnt
                 .eq(BaseCompany::getCompanyId, companyId)
                 .orderByDesc(BaseCompany::getId);
         List<BaseCompany> list1 = baseCompanyService.list(queryWrapper1);
+        List<Map<String, Object>> list = new ArrayList<>();
+        if (CollectionUtils.isNotEmpty(list1)) {
+            LambdaQueryWrapper<BaseCompanyPerson> queryWrapper2 = Wrappers.lambdaQuery();
+            queryWrapper2.select(BaseCompanyPerson::getCompanyId, BaseCompanyPerson::getDelegateName, BaseCompanyPerson::getFireManageName,
+                    BaseCompanyPerson::getFireDutyName)
+                    .eq(BaseCompanyPerson::getCompanyId, companyId);
+            List<BaseCompanyPerson> list2 = baseCompanyPersonService.list(queryWrapper2);
+
+            LambdaQueryWrapper<BaseCompanyAttach1> queryWrapper3 = Wrappers.lambdaQuery();
+            queryWrapper3.select(BaseCompanyAttach1::getCompanyId, BaseCompanyAttach1::getBuildArea, BaseCompanyAttach1::getEmployeeNum,
+                    BaseCompanyAttach1::getRegisteredCapital, BaseCompanyAttach1::getBusinessStatus, BaseCompanyAttach1::getPaidCapital,
+                    BaseCompanyAttach1::getRegistrar, BaseCompanyAttach1::getCompletedTime, BaseCompanyAttach1::getFireRating,
+                    BaseCompanyAttach1::getBuildingHeight, BaseCompanyAttach1::getBuildingStructure,BaseCompanyAttach1::getConstruction)
+                    .eq(BaseCompanyAttach1::getCompanyId, companyId);
+            List<BaseCompanyAttach1> list3 = baseCompanyAttach1Service.list(queryWrapper3);
+            for (int i = 0; i < list1.size(); i++) {
+                Map<String, Object> map = new HashMap<>();
+                map.put("id", list1.get(i).getId());
+                map.put("companyId", list1.get(i).getCompanyId());
+                map.put("companyName", list1.get(i).getCompanyName());
+                map.put("foundTime", list1.get(i).getFoundTime());
+                map.put("companyType", list1.get(i).getCompanyType());
+                map.put("linkPhone", list1.get(i).getLinkPhone());
+                map.put("address", list1.get(i).getAddress());
+                map.put("organization", list1.get(i).getOrganization());
+                map.put("companyNature", list1.get(i).getCompanyNature());
+
+                map.put("delegateName", null);
+                map.put("fireManageName", null);
+                map.put("fireDutyName", null);
+
+                map.put("buildArea", null);
+                map.put("employeeNum", null);
+                map.put("registeredCapital", null);
+                map.put("businessStatus", null);
+                map.put("paidCapital", null);
+                map.put("registrar", null);
+                map.put("completedTime", null);
+                map.put("fireRating", null);
+                map.put("buildingHeight", null);
+                map.put("buildingStructure", null);
+                map.put("construction", null);
+
+                for (int j = 0; j < list2.size(); j++) {
+                    if (list1.get(i).getCompanyId().equals(list2.get(j).getCompanyId())) {
+                        map.put("delegateName", list2.get(j).getDelegateName());
+                        map.put("fireManageName", list2.get(j).getFireManageName());
+                        map.put("fireDutyName", list2.get(j).getFireDutyName());
+                    }
+                }
 
-        LambdaQueryWrapper<BaseCompanyPerson> queryWrapper2 = Wrappers.lambdaQuery();
-        queryWrapper2.select(BaseCompanyPerson::getCompanyId, BaseCompanyPerson::getDelegateName, BaseCompanyPerson::getFireManageName,
-                BaseCompanyPerson::getFireDutyName)
-                .eq(BaseCompanyPerson::getCompanyId, companyId);
-        List<BaseCompanyPerson> list2 = baseCompanyPersonService.list(queryWrapper2);
-
-        LambdaQueryWrapper<BaseCompanyAttach1> queryWrapper3 = Wrappers.lambdaQuery();
-        queryWrapper3.select(BaseCompanyAttach1::getCompanyId, BaseCompanyAttach1::getBuildArea, BaseCompanyAttach1::getEmployeeNum)
-                .eq(BaseCompanyAttach1::getCompanyId, companyId);
-        List<BaseCompanyAttach1> list3 = baseCompanyAttach1Service.list(queryWrapper3);
-
-
+                for (int j = 0; j < list3.size(); j++) {
+                    if (list1.get(i).getCompanyId().equals(list3.get(j).getCompanyId())) {
+                        map.put("buildArea", list3.get(j).getBuildArea());
+                        map.put("employeeNum", list3.get(j).getEmployeeNum());
+                        map.put("registeredCapital", list3.get(j).getRegisteredCapital());
+                        map.put("businessStatus", list3.get(j).getBusinessStatus());
+                        map.put("paidCapital", list3.get(j).getPaidCapital());
+                        map.put("registrar", list3.get(j).getRegistrar());
+                        map.put("completedTime", list3.get(j).getCompletedTime());
+                        map.put("fireRating", list3.get(j).getFireRating());
+                        map.put("buildingHeight", list3.get(j).getBuildingHeight());
+                        map.put("buildingStructure", list3.get(j).getBuildingStructure());
+                        map.put("construction", list3.get(j).getConstruction());
+                    }
+                }
+                list.add(map);
+            }
+        }
+        return list;
     }
 
 

+ 9 - 0
service-fire/service-fire-biz/src/main/resources/mapper/fire/BaseCompanyAttach1Mapper.xml

@@ -40,6 +40,15 @@
         <result column="create_time" property="createTime" />
         <result column="update_person" property="updatePerson" />
         <result column="update_time" property="updateTime" />
+        <result column="registered_capital" property="registeredCapital" />
+        <result column="business_status" property="businessStatus" />
+        <result column="paid_capital" property="paidCapital" />
+        <result column="registrar" property="registrar" />
+        <result column="completed_time" property="completedTime" />
+        <result column="fire_rating" property="fireRating" />
+        <result column="building_height" property="buildingHeight" />
+        <result column="building_structure" property="buildingStructure" />
+        <result column="construction" property="construction" />
     </resultMap>
 
 </mapper>