排查状态保存(人工&智能)

master
Zangzhipeng 2 years ago
parent 75143fe591
commit 0f3602737b
  1. 7
      hiatmp-hidden-danger-server/src/main/java/com/hisense/hiatmp/server_api/controller/AuthController.java
  2. 50
      hiatmp-hidden-danger-server/src/main/java/com/hisense/hiatmp/server_api/controller/HighDangerController.java
  3. 2
      hiatmp-hidden-danger-server/src/main/java/com/hisense/hiatmp/server_api/mapper/HighDangerMapper.java
  4. 24
      hiatmp-hidden-danger-server/src/main/resources/sql-mapper/HighDangerMapper.xml
  5. 4
      hiatmp-model/src/main/java/com/hisense/hiatmp/model/common/HighDangerBase.java
  6. 1
      hiatmp-model/src/main/java/com/hisense/hiatmp/model/common/ImportDangerDTO.java
  7. 4
      hiatmp-model/src/main/java/com/hisense/hiatmp/model/common/ThtDangerItems.java
  8. 6
      hiatmp-model/src/main/java/com/hisense/hiatmp/model/common/ThtHiddenDataCollectConfigExtra.java

@ -39,11 +39,10 @@ public class AuthController {
// 密码加密 // 密码加密
String encrypt = authService.encrypt(operator.getCuserpwd()+ operator.getNuserid()); String encrypt = authService.encrypt(operator.getCuserpwd()+ operator.getNuserid());
if (operatorById.getNuserid().equals(operator.getNuserid()) && operatorById.getCuserpwd().equals(encrypt)) { if (operatorById.getNuserid().equals(operator.getNuserid()) && operatorById.getCuserpwd().equals(encrypt)) {
authMap.put("nuserid", operator.getNuserid()); // authMap.put("nuserid", operator.getNuserid());
authMap.put("department", operatorById.getCdepartmentid()); // authMap.put("department", operatorById.getCdepartmentid());
// String token = JwtUtil.createToken(operatorById); // String token = JwtUtil.createToken(operatorById);
return ServerResponse.ok("登录成功",authMap); return ServerResponse.ok("登录成功",operator.getNuserid());
} }
}else{ }else{
return ServerResponse.error("用户不存在"); return ServerResponse.error("用户不存在");

@ -299,6 +299,7 @@ public class HighDangerController {
pointMapSection.put("distance", (int) Math.ceil(minDistance)); pointMapSection.put("distance", (int) Math.ceil(minDistance));
pointMapSection.put("name", dto.getSectionName()); pointMapSection.put("name", dto.getSectionName());
pointMapSection.put("position", pointList); pointMapSection.put("position", pointList);
pointMapSection.put("sectionCode",dto.getSectionCode());
pointMapSection.put("type", "1"); pointMapSection.put("type", "1");
combinedMap.add(pointMapSection); combinedMap.add(pointMapSection);
@ -339,6 +340,7 @@ public class HighDangerController {
pointList.add(pointMap); pointList.add(pointMap);
pointMapCrossing.put("distance", (int) Math.ceil(pointDistance)); pointMapCrossing.put("distance", (int) Math.ceil(pointDistance));
pointMapCrossing.put("position", pointList); pointMapCrossing.put("position", pointList);
pointMapCrossing.put("sectionCode",cross.getCrossingCode());
pointMapCrossing.put("type", "2"); pointMapCrossing.put("type", "2");
// map.put(pointDistance, cross.getLongitude() + "," + cross.getLatitude()); // map.put(pointDistance, cross.getLongitude() + "," + cross.getLatitude());
pointMapCrossing.put("name", cross.getCrossingName()); pointMapCrossing.put("name", cross.getCrossingName());
@ -462,7 +464,8 @@ public class HighDangerController {
log.info("/saveSectionOrCrossing(新增路段 & 路口)接口被调用,调用ip: {}, 入参:{}", request.getRemoteAddr(), sectionOrCrossAdd); log.info("/saveSectionOrCrossing(新增路段 & 路口)接口被调用,调用ip: {}, 入参:{}", request.getRemoteAddr(), sectionOrCrossAdd);
if(highDangerMapper.isRoadExist(sectionOrCrossAdd.getBusinessId()) == 0){ HighDangerRoad roadInfo = highDangerMapper.getRoadInfo(sectionOrCrossAdd.getBusinessId());
if (roadInfo != null) {
UUID uuid = UUID.randomUUID(); UUID uuid = UUID.randomUUID();
String uuidString = uuid.toString().replace("-", ""); String uuidString = uuid.toString().replace("-", "");
highDangerMapper.insertRoad(uuidString, sectionOrCrossAdd.getBusinessId()); highDangerMapper.insertRoad(uuidString, sectionOrCrossAdd.getBusinessId());
@ -479,15 +482,16 @@ public class HighDangerController {
// 插入路段表 // 插入路段表
int i = highDangerMapper.saveSection(sectionOrCrossAdd); int i = highDangerMapper.saveSection(sectionOrCrossAdd);
if (i > 0) { if (i > 0) {
return ServerResponse.ok("道路新增成功"); assert roadInfo != null;
return ServerResponse.ok("道路新增成功","2079028191469929");
} else { } else {
return ServerResponse.error("道路新增失败"); return ServerResponse.error("道路新增失败");
} }
} } else if ("2".equals(sectionOrCrossAdd.getAddType())) {
else if("2".equals(sectionOrCrossAdd.getAddType())){
int i = highDangerMapper.saveCrossing(sectionOrCrossAdd); int i = highDangerMapper.saveCrossing(sectionOrCrossAdd);
if (i > 0) { if (i > 0) {
return ServerResponse.ok("道路新增成功"); assert roadInfo != null;
return ServerResponse.ok("道路新增成功","2079028191469929");
} else { } else {
return ServerResponse.error("道路新增失败"); return ServerResponse.error("道路新增失败");
} }
@ -606,7 +610,26 @@ public class HighDangerController {
@GetMapping("/getImportDangerDisplay") @GetMapping("/getImportDangerDisplay")
public ServerResponse<?> getImportDangerDisplay(@RequestParam String businessId, HttpServletRequest request) { public ServerResponse<?> getImportDangerDisplay(@RequestParam String businessId, HttpServletRequest request) {
log.info("/getImportDangerDisplay(排查第三页--重点排查项标签)接口被调用,调用ip: {}, 入参:{}", request.getRemoteAddr(), businessId); log.info("/getImportDangerDisplay(排查第三页--重点排查项标签)接口被调用,调用ip: {}, 入参:{}", request.getRemoteAddr(), businessId);
LinkedList<String> checkedList = new LinkedList<>();
List<ImportDangerDTO> item = highDangerMapper.getImportDangerDisplayItem(businessId); List<ImportDangerDTO> item = highDangerMapper.getImportDangerDisplayItem(businessId);
List<ThtHiddenDataCollectConfigExtra> importDangerList = highDangerMapper.getImportDangerDisplay(businessId, null);
for (ThtHiddenDataCollectConfigExtra importDanger : importDangerList) {
checkedList.add(importDanger.getDangerId());
}
for (ImportDangerDTO importDangerDTO : item) {
List<ThtDangerItems> importDangerItemsValue = new LinkedList<>();
List<ThtDangerItems> importDangerItems = highDangerMapper.getImportDangerItems(importDangerDTO.getNid());
for (ThtDangerItems items : importDangerItems) {
if (checkedList.contains(items.getId())) {
items.setChecked("1");
}
// assert importDangerItemsValue != null;
importDangerItemsValue.add(items);
}
importDangerDTO.setDangerItems(importDangerItemsValue);
}
log.info("/getImportDangerDisplay(排查第三页--重点排查项标签)接口返回, 客户端ip: {}, 返回数据:{}", request.getRemoteAddr(), item); log.info("/getImportDangerDisplay(排查第三页--重点排查项标签)接口返回, 客户端ip: {}, 返回数据:{}", request.getRemoteAddr(), item);
if (item != null) { if (item != null) {
@ -639,7 +662,7 @@ public class HighDangerController {
@GetMapping("/getUserHiddenDangerList") @GetMapping("/getUserHiddenDangerList")
public ServerResponse<?> getUserHiddenDangerList(@RequestParam String businessId, public ServerResponse<?> getUserHiddenDangerList(@RequestParam String businessId,
@RequestParam String pcType, @RequestParam String pcType,
@RequestParam String hdTerm, @RequestParam(defaultValue = "") String hdTerm,
HttpServletRequest request HttpServletRequest request
) { ) {
@ -774,6 +797,21 @@ public class HighDangerController {
// return ServerResponse.ok(manualInvestigation); // return ServerResponse.ok(manualInvestigation);
} }
// 智能排查 & 人工排查保存状态
@GetMapping("/HighDangerSaveStatus")
public ServerResponse<?> HighDangerSaveStatus(
@RequestParam String businessId,
@RequestParam String pcType,
HttpServletRequest request
) {
log.info("/HighDangerSaveStatus(智能排查 & 人工排查状态)接口被调用, 调用ip: {}, 入参: businessId={}, pcType={}", request.getRemoteAddr(), businessId, pcType);
// 保存排查类型
highDangerMapper.HighDangerSaveStatus(businessId, pcType);
log.info("/HighDangerSaveStatus(智能排查 & 人工排查状态)接口返回, 客户端ip: {}, 返回数据:{},{}", request.getRemoteAddr(), "数据已保存");
return ServerResponse.ok("状态修改成功,状态为:" + pcType, pcType);
}
// 图片上传接口 // 图片上传接口
/*@PostMapping("/uploadImage") /*@PostMapping("/uploadImage")
public ServerResponse<?> uploadImage(@RequestBody MultipartFile multipartFile) throws IOException { public ServerResponse<?> uploadImage(@RequestBody MultipartFile multipartFile) throws IOException {

@ -87,5 +87,7 @@ public interface HighDangerMapper extends BaseMapper<HighDangerBase>{
String getDangerProblem(String id); String getDangerProblem(String id);
void HighDangerSaveStatus(@Param("businessId") String businessId,@Param("pcType") String pcType);
} }

@ -114,7 +114,7 @@
</select> </select>
<select id="getHigDangerDealt" resultType="com.hisense.hiatmp.model.common.HighDangerBase"> <select id="getHigDangerDealt" resultType="com.hisense.hiatmp.model.common.HighDangerBase">
SELECT * SELECT hdb.*,hdr.pc_type
FROM tht_hidden_danger_base hdb FROM tht_hidden_danger_base hdb
LEFT JOIN tht_hidden_danger_road hdr ON hdb.business_id = hdr.business_id LEFT JOIN tht_hidden_danger_road hdr ON hdb.business_id = hdr.business_id
AND hdb.pc_count = hdr.pc_count AND hdb.pc_count = hdr.pc_count
@ -224,7 +224,7 @@
</select> </select>
<select id="isRoadExist" resultType="int"> <select id="isRoadExist" resultType="int">
SELECT count(1) SELECT DISTINCT *
from tht_hidden_danger_road from tht_hidden_danger_road
where business_id = #{businessId} where business_id = #{businessId}
</select> </select>
@ -234,7 +234,7 @@
</insert> </insert>
<select id="getImportDanger" resultType="com.hisense.hiatmp.model.common.ImportDangerDTO"> <select id="getImportDanger" resultType="com.hisense.hiatmp.model.common.ImportDangerDTO">
SELECT * SELECT DISTINCT *
from tht_hidden_scenes; from tht_hidden_scenes;
</select> </select>
@ -296,7 +296,7 @@
</select> </select>
<select id="getDangerItems" resultType="com.hisense.hiatmp.model.common.ThtDangerItems"> <select id="getDangerItems" resultType="com.hisense.hiatmp.model.common.ThtDangerItems">
SELECT * SELECT DISTINCT *
FROM tht_danger_items FROM tht_danger_items
</select> </select>
@ -402,7 +402,11 @@
</insert> </insert>
<select id="getImportDangerDisplay" resultType="com.hisense.hiatmp.model.common.ThtHiddenDataCollectConfigExtra"> <select id="getImportDangerDisplay" resultType="com.hisense.hiatmp.model.common.ThtHiddenDataCollectConfigExtra">
select * from tht_hidden_data_collect_config_extra where business_id = #{businessId} and danger_id = #{dangerId} select * from tht_hidden_data_collect_config_extra where business_id = #{businessId}
<if test="dangerId != null">
and danger_id = #{dangerId}
</if>
</select> </select>
<select id="getImportDangerDisplayItem" resultType="com.hisense.hiatmp.model.common.ImportDangerDTO"> <select id="getImportDangerDisplayItem" resultType="com.hisense.hiatmp.model.common.ImportDangerDTO">
@ -428,14 +432,14 @@
business_id = #{businessId} business_id = #{businessId}
and and
pc_type = #{pcType} pc_type = #{pcType}
<if test="hdTerm != null"> <if test="hdTerm != null and hdTerm != ''">
AND hd_term = #{hdTerm} AND hd_term = #{hdTerm}
</if> </if>
</select> </select>
<select id="getDangerProblem" resultType="String"> <select id="getDangerProblem" resultType="String">
SELECT SELECT DISTINCT
itemname itemname
FROM FROM
tht_danger_items tht_danger_items
@ -443,5 +447,11 @@
id = #{id} id = #{id}
</select> </select>
<update id="HighDangerSaveStatus">
update tht_hidden_danger_road
set pc_type = #{pcType}
where business_id = #{businessId}
</update>
</mapper> </mapper>

@ -65,6 +65,8 @@ public class HighDangerBase implements Serializable {
*/ */
private String operator; private String operator;
private String deptId;
/** /**
* insert_time * insert_time
*/ */
@ -131,6 +133,8 @@ public class HighDangerBase implements Serializable {
*/ */
private String pcCount; private String pcCount;
private String pcType;
/** /**
* split_id * split_id
*/ */

@ -15,6 +15,7 @@ public class ImportDangerDTO implements Serializable {
private String name; private String name;
private String measure; private String measure;
private String description; private String description;
// private List<String> checked;
List<ThtDangerItems> dangerItems; List<ThtDangerItems> dangerItems;

@ -22,8 +22,10 @@ public class ThtDangerItems implements Serializable {
private String nlevel; private String nlevel;
private String checked;
@TableField(exist = false) @TableField(exist = false)
@JsonIgnore // @JsonIgnore
private List<ThtDangerItems> children; private List<ThtDangerItems> children;

@ -44,5 +44,11 @@ public class ThtHiddenDataCollectConfigExtra implements Serializable {
private String dangerId; private String dangerId;
// // 重点排查-存在隐患
// private String hdTerm;
// private String hdDesc;
// private String hdPic;
// private String hdInfo;
public ThtHiddenDataCollectConfigExtra() {} public ThtHiddenDataCollectConfigExtra() {}
} }
Loading…
Cancel
Save