Browse Source

住建-可视化

hanfucheng 1 year ago
parent
commit
bc4369dd72

+ 3 - 0
data-ui/src/views/data/housingconstruction/steelcylinder/index.vue

@@ -518,6 +518,9 @@ export default {
         recyclingTime: [
           {required: true, message: "回收时间不能为空", trigger: "blur"},
         ],
+        steelcylinderNumber: [
+          {required: true, message: "钢瓶编号不能为空", trigger: "blur"},
+        ],
       },
     };
   },

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

@@ -172,20 +172,20 @@ public class CenterdataTHousingconstructionViewController extends BaseController
     * @author 韩福成
     * @date 2024/8/2 下午4:36
     */
-//    @GetMapping("/getJoinHouseUserList")
-//    public R getJoinHouseUserList(CenterdataTHousingconstructionSteelcylinder steelcylinder) {
-//        return R.ok(housingconstructionViewService.getJoinHouseUserList(steelcylinder));
-//    }
+    @GetMapping("/getGassourceList")
+    public R getGassourceList(CenterdataTHousingconstructionSteelcylinder steelcylinder) {
+        return R.ok(housingconstructionViewService.getGassourceList(steelcylinder));
+    }
 
     /*
-    * 今日派送订单
+    * 资源落点
     *
     * @author 韩福成
-    * @date 2024/8/2 下午4:48
+    * @date 2024/8/5 上午9:13
     */
-//    @GetMapping("/getJoinHouseUserList")
-//    public R getJoinHouseUserList(CenterdataTHousingconstructionSteelcylinder steelcylinder) {
-//        return R.ok(housingconstructionViewService.getJoinHouseUserList(steelcylinder));
-//    }
+    @GetMapping("/getResourcePoint")
+    public R getResourcePoint(CenterdataTHousingconstructionStoragetank storagetank) {
+        return R.ok(housingconstructionViewService.getResourcePoint(storagetank));
+    }
 
 }

+ 9 - 0
src/main/java/com/sooka/sponest/data/housingconstruction/mapper/CenterdataTHousingconstructionEnterpriseMapper.java

@@ -3,6 +3,7 @@ package com.sooka.sponest.data.housingconstruction.mapper;
 import com.sooka.sponest.data.housingconstruction.domain.CenterdataTHousingconstructionEnterprise;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * 住建-企业信息Mapper接口
@@ -58,4 +59,12 @@ public interface CenterdataTHousingconstructionEnterpriseMapper {
      * @return 结果
      */
     int deleteCenterdataTHousingconstructionEnterpriseByIds(String[] ids);
+
+    /*
+    * 企业列表
+    *
+    * @author 韩福成
+    * @date 2024/8/5 上午11:21
+    */
+    List<Map<String,Object>> getEnterpriseList(CenterdataTHousingconstructionEnterprise enterprise);
 }

+ 9 - 0
src/main/java/com/sooka/sponest/data/housingconstruction/mapper/CenterdataTHousingconstructionRealnameuserMapper.java

@@ -3,6 +3,7 @@ package com.sooka.sponest.data.housingconstruction.mapper;
 import com.sooka.sponest.data.housingconstruction.domain.CenterdataTHousingconstructionRealnameuser;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * 住建-实名用户Mapper接口
@@ -59,4 +60,12 @@ public interface CenterdataTHousingconstructionRealnameuserMapper {
      */
     int deleteCenterdataTHousingconstructionRealnameuserByIds(Long[] ids);
 
+    /*
+    * 实名用户列表
+    *
+    * @author 韩福成
+    * @date 2024/8/5 上午10:53
+    */
+
+    List<Map<String,Object>> getRealnameuserList(CenterdataTHousingconstructionRealnameuser realnameuser);
 }

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

@@ -40,4 +40,8 @@ public interface CenterdataTHousingconstructionViewMapper {
 
     public List<Map<String,Object>> getJoinHouseUserList(CenterdataTHousingconstructionSteelcylinder steelcylinder);
 
+    public List<Map<String,Object>> getGassourceList(CenterdataTHousingconstructionSteelcylinder steelcylinder);
+
+    public List<Map<String,Object>> getSteelcylinderPointList(CenterdataTHousingconstructionSteelcylinder steelcylinder);
+
 }

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

@@ -40,4 +40,8 @@ public interface ICenterdataTHousingconstructionViewService {
 
     public List<Map<String,Object>> getJoinHouseUserList(CenterdataTHousingconstructionSteelcylinder steelcylinder);
 
+    public List<Map<String,Object>> getGassourceList(CenterdataTHousingconstructionSteelcylinder steelcylinder);
+
+    public List<Map<String,Object>> getResourcePoint(CenterdataTHousingconstructionStoragetank storagetank);
+
 }

+ 65 - 2
src/main/java/com/sooka/sponest/data/housingconstruction/service/impl/CenterdataTHousingconstructionViewServiceImpl.java

@@ -3,13 +3,16 @@ package com.sooka.sponest.data.housingconstruction.service.impl;
 import com.ruoyi.common.datascope.annotation.DataScopeMutiDept;
 import com.sooka.sponest.data.base.service.impl.BaseServiceImpl;
 import com.sooka.sponest.data.housingconstruction.domain.*;
+import com.sooka.sponest.data.housingconstruction.mapper.CenterdataTHousingconstructionEnterpriseMapper;
+import com.sooka.sponest.data.housingconstruction.mapper.CenterdataTHousingconstructionRealnameuserMapper;
 import com.sooka.sponest.data.housingconstruction.mapper.CenterdataTHousingconstructionViewMapper;
 import com.sooka.sponest.data.housingconstruction.service.ICenterdataTHousingconstructionViewService;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
-import java.util.List;
-import java.util.Map;
+import java.util.*;
+import java.util.stream.Collectors;
 
 /**
  * 车辆数据Service业务层处理
@@ -22,6 +25,12 @@ public class CenterdataTHousingconstructionViewServiceImpl extends BaseServiceIm
     @Autowired
     private CenterdataTHousingconstructionViewMapper centerdataTHousingconstructionViewMapper;
 
+    @Autowired
+    private CenterdataTHousingconstructionRealnameuserMapper centerdataTHousingconstructionRealnameuserMapper;
+
+    @Autowired
+    private CenterdataTHousingconstructionEnterpriseMapper centerdataTHousingconstructionEnterpriseMapper;
+
     /*
     * 液化气罐总数
     *
@@ -190,4 +199,58 @@ public class CenterdataTHousingconstructionViewServiceImpl extends BaseServiceIm
         setSookaDataBase(steelcylinder);
         return centerdataTHousingconstructionViewMapper.getJoinHouseUserList(steelcylinder);
     }
+
+    /*
+    * 入库记录
+    *
+    * @author 韩福成
+    * @date 2024/8/5 上午8:58
+    */
+    @DataScopeMutiDept(deptAlias = "d")
+    @Override
+    public List<Map<String,Object>> getGassourceList(CenterdataTHousingconstructionSteelcylinder steelcylinder) {
+        setSookaDataBase(steelcylinder);
+        return centerdataTHousingconstructionViewMapper.getGassourceList(steelcylinder);
+    }
+
+    /*
+    * 资源落点
+    *
+    * @author 韩福成
+    * @date 2024/8/5 上午9:15
+    */
+    @DataScopeMutiDept(deptAlias = "d")
+    @Override
+    public List<Map<String,Object>> getResourcePoint(CenterdataTHousingconstructionStoragetank storagetank) {
+        setSookaDataBase(storagetank);
+        List<Map<String,Object>> mapList = new ArrayList<Map<String,Object>>();
+        switch (storagetank.getState()){
+            case "1":
+                //钢瓶
+                CenterdataTHousingconstructionSteelcylinder steelcylinder = new CenterdataTHousingconstructionSteelcylinder();
+                setSookaDataBase(steelcylinder);
+                steelcylinder.setEnterpriseId(storagetank.getEnterpriseId());
+                mapList = centerdataTHousingconstructionViewMapper.getSteelcylinderPointList(steelcylinder);
+                break;
+            case "2":
+                //用户
+                CenterdataTHousingconstructionRealnameuser realnameuser = new CenterdataTHousingconstructionRealnameuser();
+                setSookaDataBase(realnameuser);
+                realnameuser.setEnterpriseId(storagetank.getEnterpriseId());
+                mapList = centerdataTHousingconstructionRealnameuserMapper.getRealnameuserList(realnameuser);
+            case "3":
+                //车辆
+               // mapList = centerdataTHousingconstructionViewMapper.getResourcePoint(storagetank);
+            case "4":
+                //厂站
+                CenterdataTHousingconstructionEnterprise enterprise = new CenterdataTHousingconstructionEnterprise();
+                setSookaDataBase(enterprise);
+                enterprise.setId(storagetank.getEnterpriseId());
+                mapList = centerdataTHousingconstructionEnterpriseMapper.getEnterpriseList(enterprise);
+            case "5":
+                //配送员
+             //   mapList = centerdataTHousingconstructionViewMapper.getResourcePoint(storagetank);
+        }
+        return mapList;
+    }
 }

+ 29 - 6
src/main/resources/mapper/housingconstruction/CenterdataTHousingconstructionEnterpriseMapper.xml

@@ -3,7 +3,7 @@
 PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.sooka.sponest.data.housingconstruction.mapper.CenterdataTHousingconstructionEnterpriseMapper">
-    
+
     <resultMap type="CenterdataTHousingconstructionEnterprise" id="CenterdataTHousingconstructionEnterpriseResult">
         <result property="id"    column="id"    />
         <result property="enterpriseName"    column="enterprise_name"    />
@@ -35,7 +35,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <select id="selectCenterdataTHousingconstructionEnterpriseList" parameterType="CenterdataTHousingconstructionEnterprise" resultMap="CenterdataTHousingconstructionEnterpriseResult">
         <include refid="selectCenterdataTHousingconstructionEnterpriseVo"/>
         left join ${database_system}.sys_dept d on a.dept_id = d.dept_id
-        <where>  
+        <where>
             <if test="enterpriseName != null  and enterpriseName != ''"> and enterprise_name like concat('%', #{enterpriseName}, '%')</if>
             <if test="enterpriseAdministrativeArea != null  and enterpriseAdministrativeArea != ''"> and enterprise_administrative_area = #{enterpriseAdministrativeArea}</if>
             <if test="legalRepresentative != null  and legalRepresentative != ''"> and legal_representative = #{legalRepresentative}</if>
@@ -51,12 +51,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             ${params.dataScope}
         </where>
     </select>
-    
+
     <select id="selectCenterdataTHousingconstructionEnterpriseById" parameterType="String" resultMap="CenterdataTHousingconstructionEnterpriseResult">
         <include refid="selectCenterdataTHousingconstructionEnterpriseVo"/>
         where id = #{id}
     </select>
-        
+
     <insert id="insertCenterdataTHousingconstructionEnterprise" parameterType="CenterdataTHousingconstructionEnterprise">
         insert into centerdata_t_housingconstruction_enterprise
         <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -139,9 +139,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </delete>
 
     <delete id="deleteCenterdataTHousingconstructionEnterpriseByIds" parameterType="String">
-        delete from centerdata_t_housingconstruction_enterprise where id in 
+        delete from centerdata_t_housingconstruction_enterprise where id in
         <foreach item="id" collection="array" open="(" separator="," close=")">
             #{id}
         </foreach>
     </delete>
-</mapper>
+
+    <select id="getEnterpriseList" parameterType="CenterdataTHousingconstructionEnterprise" resultType="map">
+        SELECT
+            enterprise_name enterpriseName,
+            enterprise_administrative_area enterpriseAdministrativeArea,
+            legal_representative legalRepresentative,
+            registered_address registeredAddress,
+            business_category businessCategory,
+            operating_area operatingArea,
+            issuing_time issuingTime,
+            license_period_start licensePeriodStart,
+            license_period_end licensePeriodEnd,
+            issuing_authority issuingAuthority,
+            longitude,
+            latitude
+        FROM
+            centerdata_t_housingconstruction_enterprise a
+                LEFT JOIN onest_system.sys_dept d ON a.dept_id = d.dept_id
+     <where>
+         <if test="id != null  and id != ''"> and a.id = #{id}</if>
+         ${params.dataScope}
+     </where>
+    </select>
+</mapper>

+ 25 - 6
src/main/resources/mapper/housingconstruction/CenterdataTHousingconstructionRealnameuserMapper.xml

@@ -3,7 +3,7 @@
 PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.sooka.sponest.data.housingconstruction.mapper.CenterdataTHousingconstructionRealnameuserMapper">
-    
+
     <resultMap type="CenterdataTHousingconstructionRealnameuser" id="CenterdataTHousingconstructionRealnameuserResult">
         <result property="id"    column="id"    />
         <result property="enterpriseId"    column="enterprise_id"    />
@@ -32,17 +32,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="selectCenterdataTHousingconstructionRealnameuserList" parameterType="CenterdataTHousingconstructionRealnameuser" resultMap="CenterdataTHousingconstructionRealnameuserResult">
         <include refid="selectCenterdataTHousingconstructionRealnameuserVo"/>
-        <where>  
+        <where>
             <if test="enterpriseId != null  and enterpriseId != ''"> and enterprise_id = #{enterpriseId}</if>
             <if test="enterpriseUserType != null  and enterpriseUserType != ''"> and enterprise_user_type = #{enterpriseUserType}</if>
         </where>
     </select>
-    
+
     <select id="selectCenterdataTHousingconstructionRealnameuserById" parameterType="Long" resultMap="CenterdataTHousingconstructionRealnameuserResult">
         <include refid="selectCenterdataTHousingconstructionRealnameuserVo"/>
         where id = #{id}
     </select>
-        
+
     <insert id="insertCenterdataTHousingconstructionRealnameuser" parameterType="CenterdataTHousingconstructionRealnameuser" useGeneratedKeys="true" keyProperty="id">
         insert into centerdata_t_housingconstruction_realnameuser
         <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -117,10 +117,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </delete>
 
     <delete id="deleteCenterdataTHousingconstructionRealnameuserByIds" parameterType="String">
-        delete from centerdata_t_housingconstruction_realnameuser where id in 
+        delete from centerdata_t_housingconstruction_realnameuser where id in
         <foreach item="id" collection="array" open="(" separator="," close=")">
             #{id}
         </foreach>
     </delete>
 
-</mapper>
+    <select id="getRealnameuserList" parameterType="CenterdataTHousingconstructionRealnameuser" resultType="map">
+        SELECT
+            enterprise_user_type enterpriseUserType,
+            user_code userCode,
+            user_name userName,
+            gas_address gasAddress,
+            license_code licenseCode,
+            contact_number contactNumber,
+            account_open_time accountOpenTime,
+            longitude,
+            latitude
+        FROM
+            centerdata_t_housingconstruction_realnameuser a
+            LEFT JOIN onest_system.sys_dept d ON a.dept_id = d.dept_id
+        <where>
+            <if test="enterpriseId != null  and enterpriseId != ''"> and enterprise_id = #{enterpriseId}</if>
+        </where>
+    </select>
+
+</mapper>

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

@@ -46,7 +46,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             a.car_number carNumber,
             a.driver_name driverName,
             b.phone,
-            a.speed
+            a.speed,
+            if(a.speed is not null,'1','2') state
         FROM
             centerdata_t_housingconstruction_car a
             left join centerdata_t_housingconstruction_delivery_personnel b on a.driver_id = b.id
@@ -286,7 +287,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             a.`name`,
             b.join_house_id joinHouseId,
             b.join_house_name joinHouseName,
-            c.gas_address gasAddress
+            c.gas_address gasAddress,
+            b.delivery_time deliveryTime,
+            b.delivery_name deliveryName
         FROM
             centerdata_t_housingconstruction_steelcylinder a
             left join centerdata_t_housingconstruction_steelcylinder_log b on a.id = b.steelcylinder_id and recycling_time is null
@@ -297,4 +300,45 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <if test="enterpriseId != null  and enterpriseId != ''"> and a.enterprise_id = #{enterpriseId}</if>
             ${params.dataScope}
     </select>
+
+    <select id="getGassourceList" parameterType="CenterdataTHousingconstructionSteelcylinder" resultType="map">
+        SELECT
+            a.join_instation_time joinInstationTime,
+            a.address,
+            b.dict_label componentLabel,
+            a.weight
+        FROM
+            centerdata_t_housingconstruction_gassource a
+            left join ${database_system}.sys_dict_data b on a.component = b.dict_value
+            left join ${database_system}.sys_dept d on a.dept_id = d.dept_id
+        where b.dict_type = 'housingconstruction_component'
+        <if test="enterpriseId != null  and enterpriseId != ''"> and a.enterprise_id = #{enterpriseId}</if>
+        ${params.dataScope}
+    </select>
+
+    <select id="getSteelcylinderPointList" parameterType="CenterdataTHousingconstructionSteelcylinder" resultType="map">
+        SELECT
+            a.`name`,
+            a.steelcylinder_number steelcylinderNumber,
+            c.gas_address gasAddress,
+            c.longitude,
+            c.latitude,
+            d.address
+        FROM
+            centerdata_t_housingconstruction_steelcylinder a
+            LEFT JOIN centerdata_t_housingconstruction_steelcylinder_log b ON a.id = b.steelcylinder_id AND recycling_time IS NULL
+            LEFT JOIN centerdata_t_housingconstruction_realnameuser c ON b.join_house_id = c.id
+            left join (SELECT
+                        a.steelcylinder_id,
+                        GROUP_CONCAT(b.gas_address ORDER BY a.sign_time desc) address
+                        FROM
+                        centerdata_t_housingconstruction_steelcylinder_log a
+                        LEFT JOIN centerdata_t_housingconstruction_realnameuser b ON a.join_house_id = b.id
+                        GROUP BY a.steelcylinder_id) d on a.id = d.steelcylinder_id
+        WHERE
+            a.state = 'state_4'
+            <if test="enterpriseId != null  and enterpriseId != ''"> and a.enterprise_id = #{enterpriseId}</if>
+            ${params.dataScope}
+        GROUP BY a.id
+    </select>
 </mapper>