hanfucheng 8 місяців тому
батько
коміт
69b9a6b9a4

+ 70 - 40
src/main/java/com/sooka/sponest/data/housingconstruction/controller/CenterdataTHousingconstructionSteelcylinderLogController.java

@@ -134,64 +134,94 @@ public class CenterdataTHousingconstructionSteelcylinderLogController extends Ba
                 }
             }
             if (StringUtils.isNotEmpty(steelcylinderLog.getWorkCard())) {
-                Map<String,Object> photo = new HashMap<>();
-                photo.put("key","workCard");
-                photo.put("value", steelcylinderLog.getWorkCard());
-                list.add(photo);
+                String[] paths = steelcylinderLog.getWorkCard().split(",");
+                for (String part : paths) {
+                    Map<String,Object> photo = new HashMap<>();
+                    photo.put("key","workCard");
+                    photo.put("value", part);
+                    list.add(photo);
+                }
             }
             if (StringUtils.isNotEmpty(steelcylinderLog.getPitfall())) {
-                Map<String,Object> photo = new HashMap<>();
-                photo.put("key","pitfall");
-                photo.put("value", steelcylinderLog.getPitfall());
-                list.add(photo);
+                String[] paths = steelcylinderLog.getPitfall().split(",");
+                for (String part : paths) {
+                    Map<String,Object> photo = new HashMap<>();
+                    photo.put("key","pitfall");
+                    photo.put("value", part);
+                    list.add(photo);
+                }
             }
             if (StringUtils.isNotEmpty(steelcylinderLog.getPitfallDetails())) {
-                Map<String,Object> photo = new HashMap<>();
-                photo.put("key","pitfallDetails");
-                photo.put("value", steelcylinderLog.getPitfallDetails());
-                list.add(photo);
+                String[] paths = steelcylinderLog.getPitfallDetails().split(",");
+                for (String part : paths) {
+                    Map<String,Object> photo = new HashMap<>();
+                    photo.put("key","pitfallDetails");
+                    photo.put("value", part);
+                    list.add(photo);
+                }
             }
             if (StringUtils.isNotEmpty(steelcylinderLog.getInformation())) {
-                Map<String,Object> photo = new HashMap<>();
-                photo.put("key","information");
-                photo.put("value", steelcylinderLog.getInformation());
-                list.add(photo);
+                String[] paths = steelcylinderLog.getInformation().split(",");
+                for (String part : paths) {
+                    Map<String,Object> photo = new HashMap<>();
+                    photo.put("key","information");
+                    photo.put("value", part);
+                    list.add(photo);
+                }
             }
             if (StringUtils.isNotEmpty(steelcylinderLog.getSteelCylinder())) {
-                Map<String,Object> photo = new HashMap<>();
-                photo.put("key","steelCylinder");
-                photo.put("value", steelcylinderLog.getSteelCylinder());
-                list.add(photo);
+                String[] paths = steelcylinderLog.getSteelCylinder().split(",");
+                for (String part : paths) {
+                    Map<String,Object> photo = new HashMap<>();
+                    photo.put("key","steelCylinder");
+                    photo.put("value", part);
+                    list.add(photo);
+                }
             }
             if (StringUtils.isNotEmpty(steelcylinderLog.getTailpiece())) {
-                Map<String,Object> photo = new HashMap<>();
-                photo.put("key","tailpiece");
-                photo.put("value", steelcylinderLog.getTailpiece());
-                list.add(photo);
+                String[] paths = steelcylinderLog.getTailpiece().split(",");
+                for (String part : paths) {
+                    Map<String,Object> photo = new HashMap<>();
+                    photo.put("key","tailpiece");
+                    photo.put("value", part);
+                    list.add(photo);
+                }
             }
             if (StringUtils.isNotEmpty(steelcylinderLog.getInstrument())) {
-                Map<String,Object> photo = new HashMap<>();
-                photo.put("key","instrument");
-                photo.put("value", steelcylinderLog.getInstrument());
-                list.add(photo);
+                String[] paths = steelcylinderLog.getInstrument().split(",");
+                for (String part : paths) {
+                    Map<String,Object> photo = new HashMap<>();
+                    photo.put("key","instrument");
+                    photo.put("value", part);
+                    list.add(photo);
+                }
             }
             if (StringUtils.isNotEmpty(steelcylinderLog.getValve())) {
-                Map<String,Object> photo = new HashMap<>();
-                photo.put("key","valve");
-                photo.put("value", steelcylinderLog.getValve());
-                list.add(photo);
+                String[] paths = steelcylinderLog.getValve().split(",");
+                for (String part : paths) {
+                    Map<String,Object> photo = new HashMap<>();
+                    photo.put("key","valve");
+                    photo.put("value", part);
+                    list.add(photo);
+                }
             }
             if (StringUtils.isNotEmpty(steelcylinderLog.getWarningDevice())) {
-                Map<String,Object> photo = new HashMap<>();
-                photo.put("key","warningDevice");
-                photo.put("value", steelcylinderLog.getWarningDevice());
-                list.add(photo);
+                String[] paths = steelcylinderLog.getWarningDevice().split(",");
+                for (String part : paths) {
+                    Map<String,Object> photo = new HashMap<>();
+                    photo.put("key","warningDevice");
+                    photo.put("value", part);
+                    list.add(photo);
+                }
             }
             if (StringUtils.isNotEmpty(steelcylinderLog.getEnvironment())) {
-                Map<String,Object> photo = new HashMap<>();
-                photo.put("key","environment");
-                photo.put("value", steelcylinderLog.getEnvironment());
-                list.add(photo);
+                String[] paths = steelcylinderLog.getEnvironment().split(",");
+                for (String part : paths) {
+                    Map<String,Object> photo = new HashMap<>();
+                    photo.put("key","environment");
+                    photo.put("value", part);
+                    list.add(photo);
+                }
             }
             if (StringUtils.isNotEmpty(list)) {
                 attachService.addAttach(list, log.getId());

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

@@ -5,6 +5,7 @@ import com.ruoyi.common.core.web.controller.BaseController;
 import com.ruoyi.common.core.web.domain.AjaxResult;
 import com.ruoyi.common.core.web.page.TableDataInfo;
 import com.sooka.sponest.data.housingconstruction.domain.*;
+import com.sooka.sponest.data.housingconstruction.service.ICenterdataTHousingconstructionSteelcylinderLogService;
 import com.sooka.sponest.data.housingconstruction.service.ICenterdataTHousingconstructionViewService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -26,7 +27,8 @@ public class CenterdataTHousingconstructionViewController extends BaseController
 
     @Autowired
     private ICenterdataTHousingconstructionViewService housingconstructionViewService;
-
+    @Autowired
+    private ICenterdataTHousingconstructionSteelcylinderLogService steelcylinderLogService;
     /*
     * 液化气罐总数
     *
@@ -243,4 +245,26 @@ public class CenterdataTHousingconstructionViewController extends BaseController
         return AjaxResult.success(housingconstructionViewService.getProductionReport(steelcylinder));
     }
 
+    /*
+    * 钢瓶流转信息
+    *
+    * @author 韩福成
+    * @date 2024/11/5 下午4:12
+    */
+    @GetMapping("/getCirculation")
+    public AjaxResult getCirculation(CenterdataTHousingconstructionSteelcylinderLog log){
+        return AjaxResult.success(housingconstructionViewService.getCirculation(log));
+    }
+
+    /*
+    * 查看附件
+    *
+    * @author 韩福成
+    * @date 2024/11/5 下午4:34
+    */
+    @GetMapping("/getAttach")
+    public AjaxResult getAttach(CenterdataTHousingconstructionAttach attach){
+        return AjaxResult.success(housingconstructionViewService.getAttach(attach));
+    }
+
 }

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

@@ -1,8 +1,10 @@
 package com.sooka.sponest.data.housingconstruction.mapper;
 
 import com.sooka.sponest.data.housingconstruction.domain.CenterdataTHousingconstructionAttach;
+import com.sooka.sponest.data.housingconstruction.domain.CenterdataTHousingconstructionSteelcylinderLog;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * 住建-附件Mapper接口
@@ -64,4 +66,6 @@ public interface CenterdataTHousingconstructionAttachMapper {
     int delAttachByBusId(String busId);
 
     List<CenterdataTHousingconstructionAttach> getAttachListByBusId(String busId);
+
+    List<Map<String,Object>> getCirculation(CenterdataTHousingconstructionSteelcylinderLog log);
 }

+ 8 - 1
src/main/java/com/sooka/sponest/data/housingconstruction/mapper/CenterdataTHousingconstructionRealnameuserMapper.java

@@ -66,6 +66,13 @@ public interface CenterdataTHousingconstructionRealnameuserMapper {
     * @author 韩福成
     * @date 2024/8/5 上午10:53
     */
-
     List<Map<String,Object>> getRealnameuserList(CenterdataTHousingconstructionRealnameuser realnameuser);
+
+    /*
+    * 查询入户状态钢瓶
+    *
+    * @author 韩福成
+    * @date 2024/11/5 下午3:25
+    */
+    List<Map<String,Object>> getSteelcylinderName(CenterdataTHousingconstructionRealnameuser realnameuser);
 }

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

@@ -53,4 +53,8 @@ public interface ICenterdataTHousingconstructionViewService {
     List<Map<String, Object>> getNewUserSumByEnterpriseId(CenterdataTHousingconstructionSteelcylinder steelcylinder);
 
     List<Map<String, Object>> getProductionReport(CenterdataTHousingconstructionSteelcylinder steelcylinder);
+
+    List<Map<String, Object>> getCirculation(CenterdataTHousingconstructionSteelcylinderLog log);
+
+    List<CenterdataTHousingconstructionAttach> getAttach(CenterdataTHousingconstructionAttach attach);
 }

+ 34 - 5
src/main/java/com/sooka/sponest/data/housingconstruction/service/impl/CenterdataTHousingconstructionViewServiceImpl.java

@@ -5,10 +5,7 @@ import com.ruoyi.common.datascope.annotation.DataScopeMutiDept;
 import com.ruoyi.system.api.RemoteConfigService;
 import com.sooka.sponest.data.base.service.impl.BaseServiceImpl;
 import com.sooka.sponest.data.housingconstruction.domain.*;
-import com.sooka.sponest.data.housingconstruction.mapper.CenterdataTHousingconstructionCarMapper;
-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.mapper.*;
 import com.sooka.sponest.data.housingconstruction.service.ICenterdataTHousingconstructionViewService;
 import org.apache.commons.collections4.MapUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -41,6 +38,9 @@ public class CenterdataTHousingconstructionViewServiceImpl extends BaseServiceIm
     @Autowired
     private CenterdataTHousingconstructionCarMapper centerdataTHousingconstructionCarMapper;
 
+    @Autowired
+    private CenterdataTHousingconstructionAttachMapper centerdataTHousingconstructionAttachMapper;
+
     /*
     * 液化气罐总数
     *
@@ -255,7 +255,18 @@ public class CenterdataTHousingconstructionViewServiceImpl extends BaseServiceIm
                 realnameuser.setLongitude(storagetank.getLongitude());
                 realnameuser.setLatitude(storagetank.getLatitude());
                 realnameuser.setRadius(storagetank.getRadius());
-                mapList = centerdataTHousingconstructionRealnameuserMapper.getRealnameuserList(realnameuser);
+                List<Map<String, Object>> realnameuserList = centerdataTHousingconstructionRealnameuserMapper.getRealnameuserList(realnameuser);
+                List<Map<String, Object>> steelcylinderList = centerdataTHousingconstructionRealnameuserMapper.getSteelcylinderName(realnameuser);
+                for (Map<String, Object> realnameuserMap : realnameuserList) {
+                    List<String> strings = new ArrayList<>();
+                    for (Map<String, Object> steelcylinderMap : steelcylinderList) {
+                        if (steelcylinderMap.get("joinHouseId").toString().equals(realnameuserMap.get("id").toString())) {
+                            strings.add(steelcylinderMap.get("steelcylinderName").toString());
+                        }
+                    }
+                    realnameuserMap.put("steelcylinderName", strings);
+                }
+                mapList = realnameuserList;
                 break;
             case "3":
                 //车辆
@@ -376,6 +387,7 @@ public class CenterdataTHousingconstructionViewServiceImpl extends BaseServiceIm
         });
         return resultData;
     }
+
     @DataScopeMutiDept(deptAlias = "d")
     @Override
     public List<Map<String,Object>> getProductionReport(CenterdataTHousingconstructionSteelcylinder steelcylinder) {
@@ -395,4 +407,21 @@ public class CenterdataTHousingconstructionViewServiceImpl extends BaseServiceIm
         return list;
     }
 
+    @Override
+    public List<Map<String,Object>> getCirculation(CenterdataTHousingconstructionSteelcylinderLog log) {
+        return centerdataTHousingconstructionAttachMapper.getCirculation(log);
+    }
+
+    @Override
+    public List<CenterdataTHousingconstructionAttach> getAttach(CenterdataTHousingconstructionAttach attach) {
+        List<CenterdataTHousingconstructionAttach> attachList = centerdataTHousingconstructionAttachMapper.selectCenterdataTHousingconstructionAttachList(attach);
+        String fileUrl = SpringUtils.getBean(RemoteConfigService.class).remotegetConfigKey("fileUrl").getData();
+        for (CenterdataTHousingconstructionAttach attach1 : attachList) {
+            if (attach1.getAttachPath() != null) {
+                attach1.setAttachPath(fileUrl + attach1.getAttachPath());
+            }
+        }
+        return attachList;
+    }
+
 }

+ 29 - 6
src/main/resources/mapper/housingconstruction/CenterdataTHousingconstructionAttachMapper.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.CenterdataTHousingconstructionAttachMapper">
-    
+
     <resultMap type="CenterdataTHousingconstructionAttach" id="CenterdataTHousingconstructionAttachResult">
         <result property="id"    column="id"    />
         <result property="busId"    column="bus_id"    />
@@ -28,7 +28,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="selectCenterdataTHousingconstructionAttachList" parameterType="CenterdataTHousingconstructionAttach" resultMap="CenterdataTHousingconstructionAttachResult">
         <include refid="selectCenterdataTHousingconstructionAttachVo"/>
-        <where>  
+        <where>
             <if test="busId != null  and busId != ''"> and bus_id = #{busId}</if>
             <if test="dictType != null  and dictType != ''"> and dict_type = #{dictType}</if>
             <if test="dictValue != null  and dictValue != ''"> and dict_value = #{dictValue}</if>
@@ -37,12 +37,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="attachSorts != null "> and attach_sorts = #{attachSorts}</if>
         </where>
     </select>
-    
+
     <select id="selectCenterdataTHousingconstructionAttachById" parameterType="Long" resultMap="CenterdataTHousingconstructionAttachResult">
         <include refid="selectCenterdataTHousingconstructionAttachVo"/>
         where id = #{id}
     </select>
-        
+
     <insert id="insertCenterdataTHousingconstructionAttach" parameterType="CenterdataTHousingconstructionAttach">
         insert into centerdata_t_housingconstruction_attach
         <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -86,7 +86,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </delete>
 
     <delete id="deleteCenterdataTHousingconstructionAttachByIds" parameterType="String">
-        delete from centerdata_t_housingconstruction_attach where id in 
+        delete from centerdata_t_housingconstruction_attach where id in
         <foreach item="id" collection="array" open="(" separator="," close=")">
             #{id}
         </foreach>
@@ -114,4 +114,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <select id="getAttachListByBusId" parameterType="string" resultMap="CenterdataTHousingconstructionAttachResult">
         select * from centerdata_t_housingconstruction_attach where bus_id = #{busId}
     </select>
-</mapper>
+
+    <select id="getCirculation" parameterType="CenterdataTHousingconstructionSteelcylinderLog" resultType="map">
+        SELECT
+            a.id,
+            a.inspector_name inspectorName,
+            a.inspector_time inspectorTime,
+            a.filling_time fillingTime,
+            a.operator_name operatorName,
+            a.filling_medium fillingMedium,
+            a.delivery_time deliveryTime,
+            a.delivery_name deliveryName,
+            a.car_number carNumber,
+            a.sign_time signTime,
+            a.join_house_name joinHouseName,
+            a.recycling_name recyclingName,
+            a.recycling_time recyclingTime,
+            b.gas_address gasAddress
+        FROM
+            centerdata_t_housingconstruction_steelcylinder_log a
+                left join centerdata_t_housingconstruction_realnameuser b on a.join_house_id = b.id
+        where a.steelcylinder_id = #{steelcylinderId}
+        order by a.update_time desc
+    </select>
+</mapper>

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

@@ -154,6 +154,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         LEFT JOIN ${database_system}.sys_dept d ON a.dept_id = d.dept_id
         <where>
             b.dict_type = 'enterprise_user_type'
+            and a.longitude is not null
             <if test="enterpriseId != null  and enterpriseId != ''"> and enterprise_id = #{enterpriseId}</if>
             <if test="userName != null  and userName != ''"> and a.user_name like concat('%', #{userName}, '%')</if>
             ${params.dataScope}
@@ -161,4 +162,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <if test="radius != null">having distance &lt; #{radius}</if>
     </select>
 
+    <select id="getSteelcylinderName" parameterType="CenterdataTHousingconstructionRealnameuser" resultType="map">
+        select
+            join_house_id joinHouseId,
+            SUBSTRING_INDEX( GROUP_CONCAT( steelcylinder_name ORDER BY sign_time DESC ), ',', 1 ) steelcylinderName
+        from centerdata_t_housingconstruction_steelcylinder_log a
+            left join centerdata_t_housingconstruction_steelcylinder b on a.steelcylinder_id = b.id
+        <where>
+            b.state = 'state_4'
+            <if test="enterpriseId != null  and enterpriseId != ''"> and enterprise_id = #{enterpriseId}</if>
+        </where>
+        group by steelcylinder_id
+    </select>
+
 </mapper>

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

@@ -475,6 +475,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             u.gas_address gasAddress,
             d.address,
             a.dept_name deptName,
+            a.id steelcylinderId,
         round( st_distance_sphere ( point ( #{longitude}, #{latitude}), point ( longitude, latitude ) ), 2 ) AS distance
         FROM centerdata_t_housingconstruction_steelcylinder_log l
         left join centerdata_t_housingconstruction_steelcylinder a on a.id = l.steelcylinder_id