|
|
|
|
@ -8,10 +8,15 @@ import com.hisense.hiatmp.server_api.mapper.OperatorMapper; |
|
|
|
|
import com.hisense.hiatmp.model.common.DangerProblem; |
|
|
|
|
import com.hisense.hiatmp.server_api.service.HighDangerService; |
|
|
|
|
import com.hisense.hiatmp.model.dmr.Point; |
|
|
|
|
import com.hisense.hiatmp.server_api.service.ThtApproveService; |
|
|
|
|
import com.hisense.hiatmp.server_api.service.ThtAttachsService; |
|
|
|
|
import com.hisense.hiatmp.server_api.utils.CoordinateConverter; |
|
|
|
|
import com.hisense.hiatmp.server_api.utils.CoordinateUtils; |
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
import org.apache.commons.collections4.CollectionUtils; |
|
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
|
import org.springframework.beans.factory.annotation.Value; |
|
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
import org.springframework.web.multipart.MultipartFile; |
|
|
|
|
@ -34,7 +39,25 @@ public class HighDangerController { |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
HighDangerService highDangerService; |
|
|
|
|
@Autowired |
|
|
|
|
ThtAttachsService thtAttachsService; |
|
|
|
|
@Autowired |
|
|
|
|
ThtApproveService thtApproveService; |
|
|
|
|
|
|
|
|
|
@Value("${spring.ftp.username}") //用户名
|
|
|
|
|
private String userName; |
|
|
|
|
|
|
|
|
|
@Value("${spring.ftp.password}") //密码
|
|
|
|
|
private String passWord; |
|
|
|
|
|
|
|
|
|
@Value("${spring.ftp.host}") //ip地址
|
|
|
|
|
private String ip; |
|
|
|
|
|
|
|
|
|
@Value("${spring.ftp.port}") //端口号
|
|
|
|
|
private int port; |
|
|
|
|
|
|
|
|
|
@Value("${spring.ftp.currentdir}") |
|
|
|
|
private String CURRENT_DIR; // 文件存放的目录
|
|
|
|
|
/* |
|
|
|
|
查询各个状态的数据情况 |
|
|
|
|
*/ |
|
|
|
|
@ -705,7 +728,7 @@ public class HighDangerController { |
|
|
|
|
@Transactional |
|
|
|
|
@PostMapping("/saveManualInvestigation") |
|
|
|
|
public ServerResponse<?> saveManualInvestigation(@RequestBody ManualInvestigation manualInvestigation, HttpServletRequest request) { |
|
|
|
|
|
|
|
|
|
String ftpUrl = "ftp://"+userName+":"+passWord+"@"+ip+":"+port+CURRENT_DIR; |
|
|
|
|
log.info("/saveManualInvestigation(保存 & 暂存人工排查)接口被调用,调用ip: {}, 入参:{}", request.getRemoteAddr(), manualInvestigation); |
|
|
|
|
Date lastModDate = new Date(); |
|
|
|
|
manualInvestigation.setLastModeDate(lastModDate); |
|
|
|
|
@ -742,7 +765,7 @@ public class HighDangerController { |
|
|
|
|
extra.setBusinessId(manualInvestigation.getBusinessId()); |
|
|
|
|
highDangerMapper.saveThtHiddenDataCollectConfigExtra(extra); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Date date = new Date(); |
|
|
|
|
// 隐患排查表--如果存在该记录则更新
|
|
|
|
|
highDangerMapper.deleteRoadInfo(manualInvestigation.getBusinessId()); |
|
|
|
|
for (HiddenDangerDTO details : manualInvestigation.getDescribe()) { |
|
|
|
|
@ -753,6 +776,28 @@ public class HighDangerController { |
|
|
|
|
details.setBusinessId(manualInvestigation.getBusinessId()); |
|
|
|
|
// 保存重点排查数据
|
|
|
|
|
highDangerMapper.saveDangerExtra(details); |
|
|
|
|
|
|
|
|
|
//提交的时候保存附件
|
|
|
|
|
if (manualInvestigation.getTemporary() == Boolean.TRUE |
|
|
|
|
&& StringUtils.isNotEmpty(details.getHdPic())) { |
|
|
|
|
String hdPicArr[] = details.getHdPic().split(","); |
|
|
|
|
for (String s : hdPicArr) { |
|
|
|
|
uuid = UUID.randomUUID(); |
|
|
|
|
uuidString = uuid.toString().replace("-", ""); |
|
|
|
|
ThtAttachs thtAttachs = new ThtAttachs(); |
|
|
|
|
String accachName = s.substring(s.lastIndexOf("/") + 1); |
|
|
|
|
thtAttachs.setId(uuidString); |
|
|
|
|
thtAttachs.setAttachUrl(ftpUrl + accachName); |
|
|
|
|
thtAttachs.setAttachType("3"); |
|
|
|
|
thtAttachs.setUploadTime(date); |
|
|
|
|
thtAttachs.setInfoId(details.getNid()); |
|
|
|
|
thtAttachs.setAttachName(accachName); |
|
|
|
|
thtAttachs.setBusinessId(manualInvestigation.getBusinessId()); |
|
|
|
|
thtAttachs.setPcCount(pcCount); |
|
|
|
|
thtAttachs.setLastModDate(date); |
|
|
|
|
thtAttachsService.saveAttachs(thtAttachs); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
/*if(!highDangerMapper.isExtraExistence(manualInvestigation.getBusinessId()).isEmpty()){ |
|
|
|
|
}else{ |
|
|
|
|
@ -808,6 +853,23 @@ public class HighDangerController { |
|
|
|
|
} else { |
|
|
|
|
log.info("/saveManualInvestigation(保存 & 暂存人工排查)接口返回, 客户端ip: {}, 返回数据:{},{}", request.getRemoteAddr(), "数据已保存", manualInvestigation); |
|
|
|
|
highDangerMapper.updateTemporary(manualInvestigation.getBusinessId(), "20"); |
|
|
|
|
//隐患项不为空时,修改tht_hidden_danger_road
|
|
|
|
|
String hdFlag = "0"; |
|
|
|
|
if (CollectionUtils.isNotEmpty(manualInvestigation.getDescribe())) { |
|
|
|
|
hdFlag = "1"; |
|
|
|
|
} |
|
|
|
|
highDangerMapper.updateDangerRoad(hdFlag,manualInvestigation.getBusinessId(),pcCount); |
|
|
|
|
ThtApprove thtAApprove = new ThtApprove(); |
|
|
|
|
UUID uuid = UUID.randomUUID(); |
|
|
|
|
String uuidString = uuid.toString().replace("-", ""); |
|
|
|
|
thtAApprove.setNid(uuidString); |
|
|
|
|
thtAApprove.setBusinessId(manualInvestigation.getBusinessId()); |
|
|
|
|
thtAApprove.setOperator(manualInvestigation.getLastModeUser()); |
|
|
|
|
thtAApprove.setStatus("10"); |
|
|
|
|
thtAApprove.setOperateTime(date); |
|
|
|
|
thtAApprove.setOperateContent("0"); |
|
|
|
|
thtAApprove.setLastModDate(date); |
|
|
|
|
thtApproveService.save(thtAApprove); |
|
|
|
|
return ServerResponse.ok("数据已保存", manualInvestigation); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|