From 7af2d33d8fda6af451b0873a8f642c3cf7686136 Mon Sep 17 00:00:00 2001
From: 邱宇豪 <qyh123230312>
Date: 星期三, 29 十一月 2023 16:21:49 +0800
Subject: [PATCH] 20231129_qiuyh_解决钢筋笼生产查询问题、新加钢筋笼材料标示牌、调整区域打卡

---
 hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/suSteelCageMaterialLabel/controller/SuSteelCageMaterialLabelController.java    |   42 +++++
 hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/suSteelCageMaterialLabel/mapper/SuSteelCageMaterialLabelMapper.java            |   25 +++
 hd/pipe/secure/src/main/resources/mapping/RegionInspectionRecordMapper.xml                                                                          |    6 
 hd/pipe/materialsManage/src/main/resources/mapping/SuSteelCageMaterialLabelMapper.xml                                                               |  238 +++++++++++++++++++++++++++++
 hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/suSteelCageMaterialLabel/entity/SuSteelCageMaterialLabelEntity.java            |   41 +++++
 hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/suSteelCageMaterialLabel/service/SuSteelCageMaterialLabelService.java          |   22 ++
 hd/pipe/materialsManage/src/main/resources/mapping/TSteelProduceMapper.xml                                                                          |    2 
 hd/pipe/secure/src/main/java/com/thhy/secure/modules/biz/regionInspection/entity/RegionInspectionHazardInformEntity.java                            |    3 
 hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/suSteelCageMaterialLabel/service/impl/SuSteelCageMaterialLabelServiceImpl.java |   68 ++++++++
 hd/pipe/secure/src/main/java/com/thhy/secure/modules/biz/regionInspection/service/impl/RegionInspectionRecordServiceImpl.java                       |   17 +
 hd/pipe/secure/src/main/java/com/thhy/secure/modules/biz/regionInspection/mapper/RegionInspectionRecordMapper.java                                  |    4 
 11 files changed, 462 insertions(+), 6 deletions(-)

diff --git a/hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/suSteelCageMaterialLabel/controller/SuSteelCageMaterialLabelController.java b/hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/suSteelCageMaterialLabel/controller/SuSteelCageMaterialLabelController.java
new file mode 100644
index 0000000..5f20734
--- /dev/null
+++ b/hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/suSteelCageMaterialLabel/controller/SuSteelCageMaterialLabelController.java
@@ -0,0 +1,42 @@
+package com.thhy.materials.modules.biz.suSteelCageMaterialLabel.controller;
+
+import com.thhy.general.common.BasicResult;
+import com.thhy.materials.modules.biz.suSteelCageMaterialLabel.entity.SuSteelCageMaterialLabelEntity;
+import com.thhy.materials.modules.biz.suSteelCageMaterialLabel.service.SuSteelCageMaterialLabelService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Map;
+
+/**
+ * @Author QiuYuHao
+ * @CreateDate 2023-11-29 13:17:17
+ * 钢筋笼标识牌控制层
+ */
+@RestController
+@RequestMapping("suSteelCageMaterialLabel")
+public class SuSteelCageMaterialLabelController {
+
+	@Autowired
+	private SuSteelCageMaterialLabelService service;
+
+	@PostMapping("insertAndUpdate")
+	public BasicResult insertAndUpdate(@RequestBody SuSteelCageMaterialLabelEntity suVo) {
+		return service.insertAndUpdate(suVo);
+	}
+
+	@GetMapping("delete")
+	public BasicResult delete(@RequestParam String id) {
+		return service.delete(id);
+	}
+
+	@PostMapping("selectPageList")
+	public BasicResult selectPageList(@RequestBody Map map) {
+		return service.selectPageList(map);
+	}
+
+	@GetMapping("selectInfo")
+	public BasicResult selectInfo(@RequestParam(required = false) String id,@RequestParam(required = false) String region) {
+		return service.selectInfo(id,region);
+	}
+}
diff --git a/hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/suSteelCageMaterialLabel/entity/SuSteelCageMaterialLabelEntity.java b/hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/suSteelCageMaterialLabel/entity/SuSteelCageMaterialLabelEntity.java
new file mode 100644
index 0000000..463dec5
--- /dev/null
+++ b/hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/suSteelCageMaterialLabel/entity/SuSteelCageMaterialLabelEntity.java
@@ -0,0 +1,41 @@
+package com.thhy.materials.modules.biz.suSteelCageMaterialLabel.entity;
+
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import org.checkerframework.checker.units.qual.A;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @Author QiuYuHao
+ * @CreateDate 2023-11-29 13:18:51
+ * 钢筋笼标识牌实体
+ */
+@Data
+@Builder
+@AllArgsConstructor
+@NoArgsConstructor
+public class SuSteelCageMaterialLabelEntity implements Serializable {
+
+	private String id;//
+	private String region;//	区域
+	private String materialName;//	材料名称
+	private String manufacturer;//	生产厂家
+	private String specifications;//	规格型号
+	private String heatNumber;//	炉(批)号
+	private String inNumber;//	进场数量
+	private String reportTime;//	报检日期
+	private String reportNum;//	报告编号
+	private Integer status;//	检验状态
+	private String companyId;//	varchar
+	private Integer isUse;
+	private Date createTime;
+	private String createUser;
+	private Date updateTime;
+	private String updateUser;
+	private Integer type;//	录入方式 0自动 1手动
+
+}
diff --git a/hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/suSteelCageMaterialLabel/mapper/SuSteelCageMaterialLabelMapper.java b/hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/suSteelCageMaterialLabel/mapper/SuSteelCageMaterialLabelMapper.java
new file mode 100644
index 0000000..61d3877
--- /dev/null
+++ b/hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/suSteelCageMaterialLabel/mapper/SuSteelCageMaterialLabelMapper.java
@@ -0,0 +1,25 @@
+package com.thhy.materials.modules.biz.suSteelCageMaterialLabel.mapper;
+
+import com.thhy.general.common.BasicResult;
+import com.thhy.materials.modules.biz.suSteelCageMaterialLabel.entity.SuSteelCageMaterialLabelEntity;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Author QiuYuHao
+ * @CreateDate 2023-11-29 13:23:53
+ */
+@Mapper
+public interface SuSteelCageMaterialLabelMapper {
+
+	void insertAndUpdate(SuSteelCageMaterialLabelEntity suSteelCageMaterialLabelEntity);
+
+	void delete(String id);
+
+	List<SuSteelCageMaterialLabelEntity> selectPageList(Map map);
+
+	SuSteelCageMaterialLabelEntity selectInfo(@Param("id") String id,@Param("region") String region);
+}
diff --git a/hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/suSteelCageMaterialLabel/service/SuSteelCageMaterialLabelService.java b/hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/suSteelCageMaterialLabel/service/SuSteelCageMaterialLabelService.java
new file mode 100644
index 0000000..9dbc345
--- /dev/null
+++ b/hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/suSteelCageMaterialLabel/service/SuSteelCageMaterialLabelService.java
@@ -0,0 +1,22 @@
+package com.thhy.materials.modules.biz.suSteelCageMaterialLabel.service;
+
+import com.thhy.general.common.BasicResult;
+import com.thhy.materials.modules.biz.suSteelCageMaterialLabel.entity.SuSteelCageMaterialLabelEntity;
+
+import java.util.Map;
+
+/**
+ * @Author QiuYuHao
+ * @CreateDate 2023-11-29 13:24:06
+ * 钢筋笼材料标识牌接口
+ */
+public interface SuSteelCageMaterialLabelService {
+
+	BasicResult insertAndUpdate(SuSteelCageMaterialLabelEntity suSteelCageMaterialLabelEntity);
+
+	BasicResult delete(String id);
+
+	BasicResult selectPageList(Map map);
+
+	BasicResult selectInfo(String id,String region);
+}
diff --git a/hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/suSteelCageMaterialLabel/service/impl/SuSteelCageMaterialLabelServiceImpl.java b/hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/suSteelCageMaterialLabel/service/impl/SuSteelCageMaterialLabelServiceImpl.java
new file mode 100644
index 0000000..e645c6d
--- /dev/null
+++ b/hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/suSteelCageMaterialLabel/service/impl/SuSteelCageMaterialLabelServiceImpl.java
@@ -0,0 +1,68 @@
+package com.thhy.materials.modules.biz.suSteelCageMaterialLabel.service.impl;
+
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import com.thhy.general.common.BasicResult;
+import com.thhy.general.config.SysUserInfo;
+import com.thhy.general.utils.UUIDUtils;
+import com.thhy.general.utils.UserInfoUtils;
+import com.thhy.materials.modules.biz.suSteelCageMaterialLabel.entity.SuSteelCageMaterialLabelEntity;
+import com.thhy.materials.modules.biz.suSteelCageMaterialLabel.mapper.SuSteelCageMaterialLabelMapper;
+import com.thhy.materials.modules.biz.suSteelCageMaterialLabel.service.SuSteelCageMaterialLabelService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.Date;
+import java.util.Map;
+
+/**
+ * @Author QiuYuHao
+ * @CreateDate 2023-11-29 13:26:31
+ * 钢筋笼材料标示牌实现
+ */
+@Service
+public class SuSteelCageMaterialLabelServiceImpl implements SuSteelCageMaterialLabelService {
+
+	@Autowired
+	private SuSteelCageMaterialLabelMapper suSteelCageMaterialLabelMapper;
+
+	@Override
+	public BasicResult insertAndUpdate(SuSteelCageMaterialLabelEntity suVo) {
+		SysUserInfo sysUserInfo = UserInfoUtils.getInstance().getUserInfo();
+		String userId = sysUserInfo.getUserId();
+		String companyId = sysUserInfo.getCompanyId();
+		if (suVo.getId() == null){
+			suVo.setId(UUIDUtils.create());
+			suVo.setCreateTime(new Date());
+			suVo.setCreateUser(userId);
+			suVo.setCompanyId(companyId);
+		}else {
+			suVo.setUpdateTime(new Date());
+			suVo.setUpdateUser(userId);
+		}
+		suSteelCageMaterialLabelMapper.insertAndUpdate(suVo);
+		return BasicResult.success();
+	}
+
+	@Override
+	public BasicResult delete(String id) {
+		suSteelCageMaterialLabelMapper.delete(id);
+		return BasicResult.success();
+	}
+
+	@Override
+	public BasicResult selectPageList(Map map) {
+		SysUserInfo sysUserInfo = UserInfoUtils.getInstance().getUserInfo();
+		String companyId = sysUserInfo.getCompanyId();
+		int pageNum = (int) map.get("pageNum");
+		int pageSize = (int) map.get("pageSize");
+		map.put("companyId",companyId);
+		PageHelper.startPage(pageNum,pageSize);
+		return BasicResult.success(new PageInfo<>(suSteelCageMaterialLabelMapper.selectPageList(map)));
+	}
+
+	@Override
+	public BasicResult selectInfo(String id, String region) {
+		return BasicResult.success(suSteelCageMaterialLabelMapper.selectInfo(id,region ));
+	}
+}
diff --git a/hd/pipe/materialsManage/src/main/resources/mapping/SuSteelCageMaterialLabelMapper.xml b/hd/pipe/materialsManage/src/main/resources/mapping/SuSteelCageMaterialLabelMapper.xml
new file mode 100644
index 0000000..61f22a1
--- /dev/null
+++ b/hd/pipe/materialsManage/src/main/resources/mapping/SuSteelCageMaterialLabelMapper.xml
@@ -0,0 +1,238 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.thhy.materials.modules.biz.suSteelCageMaterialLabel.mapper.SuSteelCageMaterialLabelMapper">
+
+
+  <insert id="insertAndUpdate">
+      insert into t_su_steel_cage_material_label
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+        <if test="id != null">
+            id,
+        </if>
+        <if test="region != null">
+            region,
+        </if>
+        <if test="materialName != null">
+            materialName,
+        </if>
+        <if test="manufacturer != null">
+            manufacturer,
+        </if>
+        <if test="specifications != null">
+            specifications,
+        </if>
+        <if test="heatNumber != null">
+            heatNumber,
+        </if>
+        <if test="inNumber != null">
+            inNumber,
+        </if>
+        <if test="reportTime != null">
+            reportTime,
+        </if>
+        <if test="reportNum != null">
+            reportNum,
+        </if>
+        <if test="status != null">
+            status,
+        </if>
+        <if test="companyId != null">
+            companyId,
+        </if>
+        <if test="isUse != null">
+            isUse,
+        </if>
+        <if test="createTime != null">
+            createTime,
+        </if>
+        <if test="createUser != null">
+            createUser,
+        </if>
+        <if test="updateTime != null">
+            updateTime,
+        </if>
+        <if test="updateUser != null">
+            updateUser,
+        </if>
+        <if test="type != null">
+            type,
+        </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+          <if test="id != null">
+              #{id,jdbcType=VARCHAR},
+          </if>
+          <if test="region != null">
+              #{region,jdbcType=VARCHAR},
+          </if>
+          <if test="materialName != null">
+              #{materialName,jdbcType=VARCHAR},
+          </if>
+          <if test="manufacturer != null">
+              #{manufacturer,jdbcType=VARCHAR},
+          </if>
+          <if test="specifications != null">
+              #{specifications,jdbcType=VARCHAR},
+          </if>
+          <if test="heatNumber != null">
+              #{heatNumber,jdbcType=VARCHAR},
+          </if>
+          <if test="inNumber != null">
+              #{inNumber,jdbcType=VARCHAR},
+          </if>
+          <if test="reportTime != null">
+              #{reportTime,jdbcType=VARCHAR},
+          </if>
+          <if test="reportNum != null">
+              #{reportNum,jdbcType=VARCHAR},
+          </if>
+          <if test="status != null">
+              #{status,jdbcType=INTEGER},
+          </if>
+          <if test="companyId != null">
+              #{companyId,jdbcType=VARCHAR},
+          </if>
+          <if test="isUse != null">
+              #{isUse,jdbcType=INTEGER},
+          </if>
+          <if test="createTime != null">
+              #{createTime,jdbcType=TIMESTAMP},
+          </if>
+          <if test="createUser != null">
+              #{createUser,jdbcType=VARCHAR},
+          </if>
+          <if test="updateTime != null">
+              #{updateTime,jdbcType=TIMESTAMP},
+          </if>
+          <if test="updateUser != null">
+              #{updateUser,jdbcType=VARCHAR},
+          </if>
+          <if test="type != null">
+              #{type,jdbcType=INTEGER},
+          </if>
+      </if>
+
+    </trim>
+    on duplicate key update
+    <trim suffixOverrides=",">
+        <if test="region != null">
+            region = #{region,jdbcType=VARCHAR},
+        </if>
+        <if test="materialName != null">
+            materialName = #{materialName,jdbcType=VARCHAR},
+        </if>
+        <if test="manufacturer != null">
+            manufacturer = #{manufacturer,jdbcType=VARCHAR},
+        </if>
+        <if test="specifications != null">
+            specifications = #{specifications,jdbcType=VARCHAR},
+        </if>
+        <if test="heatNumber != null">
+            heatNumber = #{heatNumber,jdbcType=VARCHAR},
+        </if>
+        <if test="inNumber != null">
+            inNumber = #{inNumber,jdbcType=VARCHAR},
+        </if>
+        <if test="reportTime != null">
+            reportTime = #{reportTime,jdbcType=VARCHAR},
+        </if>
+        <if test="reportNum != null">
+            reportNum = #{reportNum,jdbcType=VARCHAR},
+        </if>
+        <if test="status != null">
+            status = #{status,jdbcType=INTEGER},
+        </if>
+        <if test="companyId != null">
+            companyId = #{companyId,jdbcType=VARCHAR},
+        </if>
+        <if test="isUse != null">
+            isUse = #{isUse,jdbcType=INTEGER},
+        </if>
+        <if test="createTime != null">
+            createTime = #{createTime,jdbcType=TIMESTAMP},
+        </if>
+        <if test="createUser != null">
+            createUser = #{createUser,jdbcType=VARCHAR},
+        </if>
+        <if test="updateTime != null">
+            updateTime = #{updateTime,jdbcType=TIMESTAMP},
+        </if>
+        <if test="updateUser != null">
+            updateUser = #{updateUser,jdbcType=VARCHAR},
+        </if>
+        <if test="type != null">
+            type = #{type,jdbcType=INTEGER},
+        </if>
+    </trim>
+  </insert>
+
+  <delete id="delete">
+    update t_su_steel_cage_material_label set isUse = 0 where id = #{id,jdbcType=VARCHAR}
+  </delete>
+
+  <select id="selectPageList" resultType="com.thhy.materials.modules.biz.suSteelCageMaterialLabel.entity.SuSteelCageMaterialLabelEntity">
+    SELECT
+      t.id,
+      t.region,
+      t.materialName,
+      t.manufacturer,
+      t.specifications,
+      t.heatNumber,
+      t.inNumber,
+      t.reportTime,
+      t.reportNum,
+      t.status,
+      t.companyId,
+      t.isUse,
+      t.createTime,
+      t.createUser,
+      t.updateTime,
+      t.updateUser,
+      t.type
+      FROM `t_su_steel_cage_material_label` t
+    where t.isUse = 1 and t.companyId = #{companyId}
+      <if test="region != null and region !=''">
+          and t.region = #{region}
+      </if>
+      <if test="type != null and type != ''">
+          and t.type = #{type}
+      </if>
+      <if test="startTime != null and endTime != null">
+          and t.createTime between #{startTime} and  #{endTime}
+      </if>
+    order by t.createTime desc
+  </select>
+
+  <select id="selectInfo" resultType="com.thhy.materials.modules.biz.suSteelCageMaterialLabel.entity.SuSteelCageMaterialLabelEntity">
+      SELECT
+              t.id,
+              t.region,
+              t.materialName,
+              t.manufacturer,
+              t.specifications,
+              t.heatNumber,
+              t.inNumber,
+              t.reportTime,
+              t.reportNum,
+              t.status,
+              t.companyId,
+              t.isUse,
+              t.createTime,
+              t.createUser,
+              t.updateTime,
+              t.updateUser,
+              t.type
+      FROM `t_su_steel_cage_material_label` t
+      where t.isUse = 1
+      <if test="id != null and id !=''">
+          and t.id = #{id}
+      </if>
+      <if test="region != null and region !=''">
+          and t.region = #{region}
+      </if>
+      order by t.createTime desc
+
+  </select>
+
+</mapper>
\ No newline at end of file
diff --git a/hd/pipe/materialsManage/src/main/resources/mapping/TSteelProduceMapper.xml b/hd/pipe/materialsManage/src/main/resources/mapping/TSteelProduceMapper.xml
index 4957190..8ed1052 100644
--- a/hd/pipe/materialsManage/src/main/resources/mapping/TSteelProduceMapper.xml
+++ b/hd/pipe/materialsManage/src/main/resources/mapping/TSteelProduceMapper.xml
@@ -88,7 +88,7 @@
         <if test="isModel!=null and isModel!='' ">
             and tsp.is_model=#{isModel}
         </if>
-      <if test="isModel!=null and isModel!='' ">
+      <if test="sizeId!=null and sizeId!='' ">
           and tsp.size_id=#{sizeId}
       </if>
       <if test="platUserName!=null and platUserName!='' ">
diff --git a/hd/pipe/secure/src/main/java/com/thhy/secure/modules/biz/regionInspection/entity/RegionInspectionHazardInformEntity.java b/hd/pipe/secure/src/main/java/com/thhy/secure/modules/biz/regionInspection/entity/RegionInspectionHazardInformEntity.java
index 0d40b10..0d2545e 100644
--- a/hd/pipe/secure/src/main/java/com/thhy/secure/modules/biz/regionInspection/entity/RegionInspectionHazardInformEntity.java
+++ b/hd/pipe/secure/src/main/java/com/thhy/secure/modules/biz/regionInspection/entity/RegionInspectionHazardInformEntity.java
@@ -42,4 +42,7 @@
 	 * 一个区域对应一个结果记录
 	 */
 	RegionInspectionRecordEntity recordEntity;
+
+	private String result;//巡检结果
+	List<RegionInspectionRecordImgEntity> imgList;
 }
diff --git a/hd/pipe/secure/src/main/java/com/thhy/secure/modules/biz/regionInspection/mapper/RegionInspectionRecordMapper.java b/hd/pipe/secure/src/main/java/com/thhy/secure/modules/biz/regionInspection/mapper/RegionInspectionRecordMapper.java
index 8ee41b7..6a9766c 100644
--- a/hd/pipe/secure/src/main/java/com/thhy/secure/modules/biz/regionInspection/mapper/RegionInspectionRecordMapper.java
+++ b/hd/pipe/secure/src/main/java/com/thhy/secure/modules/biz/regionInspection/mapper/RegionInspectionRecordMapper.java
@@ -24,6 +24,7 @@
 	void delete(String id);
 	//根据任务id删除记录
 	void deleteByRegionInspectionId(String regionInspectionId);
+
 	//任务打卡web端查询列表 或者 判断主任务完成未完成的标准
 	List<RegionInspectionRecordEntity> selectPageList(Map map);
 	Integer selectCount(Map map);
@@ -41,6 +42,9 @@
 
 	void insertIMG(RegionInspectionRecordImgEntity regionInspectionRecordImgEntity);
 
+	List<RegionInspectionRecordImgEntity> selectImgByRecordId(String regionInspectionRecordId);
+
+
 	//小程序巡检打卡列表
 	List<Map> selectAppList(Map map);
 
diff --git a/hd/pipe/secure/src/main/java/com/thhy/secure/modules/biz/regionInspection/service/impl/RegionInspectionRecordServiceImpl.java b/hd/pipe/secure/src/main/java/com/thhy/secure/modules/biz/regionInspection/service/impl/RegionInspectionRecordServiceImpl.java
index d32f128..6d12941 100644
--- a/hd/pipe/secure/src/main/java/com/thhy/secure/modules/biz/regionInspection/service/impl/RegionInspectionRecordServiceImpl.java
+++ b/hd/pipe/secure/src/main/java/com/thhy/secure/modules/biz/regionInspection/service/impl/RegionInspectionRecordServiceImpl.java
@@ -160,23 +160,32 @@
 	public BasicResult selectAppInfo(String regionInspectionId, String userId) {
 		SysUserInfo sysUserInfo = UserInfoUtils.getInstance().getUserInfo();
 		userId = sysUserInfo.getUserId();
-		RegionInspectionEntity obj = regionInspectionRecordMapper.selectInfo(regionInspectionId, userId);
+		String platUserId = regionInspectionRecordMapper.selectPlatUserId(userId);
+		RegionInspectionEntity obj = regionInspectionRecordMapper.selectInfo(regionInspectionId, platUserId);
 		List<RegionInspectionHazardInformEntity> regionList = new ArrayList<>();
-		if (obj.getRegionIds()!=null){
+		if (obj!=null && obj.getRegionIds()!=null){
 			String[] regionIds = obj.getRegionIds().intern().split(",");
 			String[] regions = obj.getRegions().intern().split(",");
 			//区域对象数组
 			for (int i = 0; i < regionIds.length; i++) {
 				RegionInspectionRecordEntity recordEntity = regionInspectionRecordMapper.regionInfo(
 						regionInspectionId,
-						userId,
+						platUserId,
 						regionIds[i]);
+				List<RegionInspectionRecordImgEntity> imgEntityList=null;
+				if (recordEntity!=null){
+					imgEntityList = regionInspectionRecordMapper.selectImgByRecordId(recordEntity.getId());
+					recordEntity.setImgList(imgEntityList);
+				}
 				RegionInspectionHazardInformEntity regionEntity = RegionInspectionHazardInformEntity
 						.builder()
 						.regionInspectionId(obj.getId())
 						.regionHazardInformId(regionIds[i])
 						.region(regions[i])
-						.recordEntity(recordEntity).build();
+						.recordEntity(recordEntity)
+						.imgList(imgEntityList)
+						.result(recordEntity.getResult())
+						.build();
 				regionList.add(regionEntity);
 			}
 		}
diff --git a/hd/pipe/secure/src/main/resources/mapping/RegionInspectionRecordMapper.xml b/hd/pipe/secure/src/main/resources/mapping/RegionInspectionRecordMapper.xml
index a8df8b4..03275cb 100644
--- a/hd/pipe/secure/src/main/resources/mapping/RegionInspectionRecordMapper.xml
+++ b/hd/pipe/secure/src/main/resources/mapping/RegionInspectionRecordMapper.xml
@@ -3,7 +3,7 @@
 <mapper namespace="com.thhy.secure.modules.biz.regionInspection.mapper.RegionInspectionRecordMapper">
 
     <insert id="insertIMG">
-        insert into t_region_inspection_record
+        insert into t_region_inspection_record_img
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="id != null">
                 id,
@@ -158,6 +158,9 @@
         delete from t_region_inspection_record where  regionInspectionId=#{regionInspectionId,jdbcType=VARCHAR}
     </delete>
 
+    <select id="selectImgByRecordId" resultType="com.thhy.secure.modules.biz.regionInspection.entity.RegionInspectionRecordImgEntity">
+        select * from t_region_inspection_record_img where regionInspectionRecordId = #{regionInspectionRecordId}
+    </select>
     <select id="selectPageList" resultType="com.thhy.secure.modules.biz.regionInspection.entity.RegionInspectionRecordEntity">
         SELECT  a.userId,
                 a.regionInspectionId,
@@ -270,6 +273,7 @@
 
     <select id="regionInfo" resultType="com.thhy.secure.modules.biz.regionInspection.entity.RegionInspectionRecordEntity">
         SELECT
+                t.id,
                 t.userId,
                 t.regionInspectionId,
                 t.regionHazardInformId,

--
Gitblit v1.9.3