排查提交修改

master
Zangzhipeng 1 year ago
parent b1fc846f82
commit d28b028b46
  1. 2
      hiatmp-base/src/main/resources/sql-mapper/HighDangerMapper.xml
  2. 18
      hiatmp-hidden-danger-server/src/main/java/com/hisense/hiatmp/server_api/controller/HighDangerController.java
  3. 7
      hiatmp-hidden-danger-server/src/main/java/com/hisense/hiatmp/server_api/mapper/HighDangerMapper.java
  4. 1
      hiatmp-hidden-danger-server/src/main/java/com/hisense/hiatmp/server_api/service/impl/HighDangerBaseServiceImpl.java
  5. 22
      hiatmp-hidden-danger-server/src/main/resources/sql-mapper/HighDangerMapper.xml
  6. 2
      hiatmp-model/src/main/java/com/hisense/hiatmp/model/common/ManualInvestigation.java
  7. 36
      hiatmp-model/src/main/java/com/hisense/hiatmp/model/common/ServerResponse.java
  8. 27
      hiatmp-model/src/main/java/com/hisense/hiatmp/model/common/ThtHiddenDangerExtra.java
  9. BIN
      hiatmp-model/target/classes/com/hisense/hiatmp/model/common/ServerResponse.class

@ -304,7 +304,7 @@
</update> </update>
<insert id="saveHiddenDataCollectConfig"> <insert id="saveHiddenDataCollectConfig">
INSERT INTO tht_hidden_data_collect_config_copy2 (nid, itemid, order, type, name, standar, unit, pic1_address, INSERT INTO tht_hidden_data_collect_config_extra (nid, itemid, order, type, name, standar, unit, pic1_address,
pic2_address) pic2_address)
VALUES (nextval('test_id_seq2'), , #{itemid}, #{order}, #{type}, #{name}, #{standar}, #{unit}, #{pic1Address}, VALUES (nextval('test_id_seq2'), , #{itemid}, #{order}, #{type}, #{name}, #{standar}, #{unit}, #{pic1Address},
#{pic2Address}) #{pic2Address})

@ -341,6 +341,10 @@ public class HighDangerController {
highDangerMapper.insertSectionTraffic(manualInvestigation); highDangerMapper.insertSectionTraffic(manualInvestigation);
} }
Set<String> keys = Collections.emptySet(); Set<String> keys = Collections.emptySet();
// 先删除二级页面数据
highDangerMapper.deleteHiddenDataCollectConfigByBusinessId(manualInvestigation.getBusinessId());
// 保存隐患排查二级页面数据 // 保存隐患排查二级页面数据
for (Map<String,List<ThtHiddenDataCollectConfig>> map: manualInvestigation.getKeyInvestigation()){ for (Map<String,List<ThtHiddenDataCollectConfig>> map: manualInvestigation.getKeyInvestigation()){
keys = map.keySet(); keys = map.keySet();
@ -382,16 +386,24 @@ public class HighDangerController {
// } // }
manualInvestigation.setKeySet(keys.toString()); manualInvestigation.setKeySet(keys.toString());
// 隐患排查表--如果存在该记录则更新
if(highDangerMapper.isExtraExistence(manualInvestigation.getBusinessId()) != null){
highDangerMapper.updateDangerExtra(manualInvestigation);
}else{
// 保存重点排查数据 // 保存重点排查数据
highDangerMapper.saveDangerExtra(manualInvestigation); highDangerMapper.saveDangerExtra(manualInvestigation);
}
// 暂存数据 // 暂存数据
if(manualInvestigation.getTemporary() == Boolean.FALSE){ if(manualInvestigation.getTemporary() == Boolean.FALSE){
highDangerMapper.updateTemporary(manualInvestigation.getBusinessId()); highDangerMapper.updateTemporary(manualInvestigation.getBusinessId(), "99");
return ServerResponse.ok("数据已暂存"); return ServerResponse.ok("数据已暂存",manualInvestigation);
}else{
highDangerMapper.updateTemporary(manualInvestigation.getBusinessId(), "30");
return ServerResponse.ok("数据已保存",manualInvestigation);
} }
return ServerResponse.ok(manualInvestigation); // return ServerResponse.ok(manualInvestigation);
} }
// 图片上传接口 // 图片上传接口

@ -52,12 +52,17 @@ public interface HighDangerMapper extends BaseMapper<HighDangerBase>{
List<ThtDangerItems> getDangerItems(); List<ThtDangerItems> getDangerItems();
void updateTemporary(String temporary); void updateTemporary(String businessId, String temporary);
void saveHiddenDataCollectConfig(ThtHiddenDataCollectConfig config); void saveHiddenDataCollectConfig(ThtHiddenDataCollectConfig config);
void saveDangerExtra(ManualInvestigation manualInvestigation); void saveDangerExtra(ManualInvestigation manualInvestigation);
ThtHiddenDangerExtra isExtraExistence(String bussinessId);
void updateDangerExtra(ManualInvestigation manualInvestigation);
void deleteHiddenDataCollectConfigByBusinessId(String businessId);
} }

@ -190,4 +190,5 @@ public class HighDangerBaseServiceImpl implements HighDangerService {
// return null; // return null;
// } // }
} }
} }

@ -3,6 +3,9 @@
<mapper namespace="com.hisense.hiatmp.server_api.mapper.HighDangerMapper"> <mapper namespace="com.hisense.hiatmp.server_api.mapper.HighDangerMapper">
<delete id="deleteHiddenDataCollectConfigByBusinessId">
delete from tht_hidden_data_collect_config_extra where business_id = #{businessId}
</delete>
<select id="getStatusCounts" resultType="com.hisense.hiatmp.model.common.HighDangerBaseNum"> <select id="getStatusCounts" resultType="com.hisense.hiatmp.model.common.HighDangerBaseNum">
SELECT 'Unconfirmed' AS status, SUM(CASE WHEN hdb.status = '0' THEN 1 ELSE 0 END) AS count SELECT 'Unconfirmed' AS status, SUM(CASE WHEN hdb.status = '0' THEN 1 ELSE 0 END) AS count
@ -239,6 +242,10 @@
FROM tht_danger_items FROM tht_danger_items
</select> </select>
<select id="isExtraExistence" resultType="com.hisense.hiatmp.model.common.ThtHiddenDangerExtra">
SELECT * FROM tht_hidden_danger_extra where business_id = #{businessId}
</select>
<insert id="insertSectionInfo"> <insert id="insertSectionInfo">
insert into tht_section_info insert into tht_section_info
values (nextval('test_id_seq'), values (nextval('test_id_seq'),
@ -299,12 +306,12 @@
<update id="updateTemporary"> <update id="updateTemporary">
update tht_hidden_danger_base update tht_hidden_danger_base
set status = '99' set status = #{temporary}
where business_id = #{businessId} where business_id = #{businessId}
</update> </update>
<insert id="saveHiddenDataCollectConfig"> <insert id="saveHiddenDataCollectConfig">
INSERT INTO tht_hidden_data_collect_config_copy2 (nid, itemid, "order", type, name, standar, unit, business_id) INSERT INTO tht_hidden_data_collect_config_extra (nid, itemid, "order", type, name, standar, unit, business_id)
VALUES (nextval('test_id_seq2'), #{itemid}, #{order}, #{type}, #{name}, #{standar}, #{unit},#{businessId}) VALUES (nextval('test_id_seq2'), #{itemid}, #{order}, #{type}, #{name}, #{standar}, #{unit},#{businessId})
</insert> </insert>
@ -315,4 +322,15 @@
#{information}, #{businessId}) #{information}, #{businessId})
</insert> </insert>
<update id="updateDangerExtra">
update tht_hidden_danger_extra
set
key_investigation = #{keySet},
danger_item = #{dangerItem},
danger_desc = #{dangerDesc},
image_list = #{imageList},
information = #{information}
where business_id = #{businessId}
</update>
</mapper> </mapper>

@ -43,7 +43,7 @@ public class ManualInvestigation implements Serializable {
String keySet; String keySet;
String dangerItem; String dangerItem;
String dangerDesc; String dangerDesc;
List<MultipartFile> imageList; String imageList;
String information; String information;
// 暂存标识 0暂存 1提交 // 暂存标识 0暂存 1提交

@ -34,9 +34,9 @@ public class ServerResponse<T> implements Serializable {
this.code(code).message(message).result(result); this.code(code).message(message).result(result);
} }
ServerResponse(int code, String message, T result,int total) { // ServerResponse(int code, String message, T result) {
this.code(code).message(message).result(result).total(total); // this.code(code).message(message).result(result);
} // }
private ServerResponse<T> code(int code) { private ServerResponse<T> code(int code) {
this.setCode(code); this.setCode(code);
return this; return this;
@ -46,18 +46,18 @@ public class ServerResponse<T> implements Serializable {
this.setMessage(message); this.setMessage(message);
return this; return this;
} }
private ServerResponse<T> total(int total) { // private ServerResponse<T> total(int total) {
this.setTotal(total); // this.setTotal(total);
return this; // return this;
} // }
public ServerResponse<T> result(T result) { public ServerResponse<T> result(T result) {
this.setResult(result); this.setResult(result);
return this; return this;
} }
public static <T> ServerResponse<T> response(int code, String message, T result,int total) { // public static <T> ServerResponse<T> response(int code, String message, T result,int total) {
return new ServerResponse(code, message, result,total); // return new ServerResponse(code, message, result,total);
} // }
public static <T> ServerResponse<T> response(int code, String message, T result) { public static <T> ServerResponse<T> response(int code, String message, T result) {
return new ServerResponse(code, message, result); return new ServerResponse(code, message, result);
@ -99,6 +99,10 @@ public class ServerResponse<T> implements Serializable {
return new ServerResponse(200, I18nUtils.getMessage("common.message.success"), result); return new ServerResponse(200, I18nUtils.getMessage("common.message.success"), result);
} }
public static <T> ServerResponse<T> ok(String massage,T result) {
return new ServerResponse(200, massage, result);
}
public int getCode() { public int getCode() {
return this.code; return this.code;
} }
@ -123,13 +127,13 @@ public class ServerResponse<T> implements Serializable {
this.result = result; this.result = result;
} }
public int getTotal() { // public int getTotal() {
return total; // return total;
} // }
public void setTotal(int total) { // public void setTotal(int total) {
this.total = total; // this.total = total;
} // }
public boolean equals(final Object o) { public boolean equals(final Object o) {
if (o == this) { if (o == this) {

@ -0,0 +1,27 @@
package com.hisense.hiatmp.model.common;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* 排查保存 & 暂存数据
*/
@Data
public class ThtHiddenDangerExtra implements Serializable {
private static final long serialVersionUID = 1L;
String nid;
String keyInvestigation;
String dangerItem;
String dangerDesc;
String imageList;
String information;
String businessId;
}
Loading…
Cancel
Save