@ResponseBody
@PostMapping ( "/check" )
@RequiresPermissions ( "incident:menu" )
@OperationLogAnnotation ( "风险点批量审核" )
public Result check ( IncidentQuery query, HttpServletRequest request) {
FxIncident point = new FxIncident ( ) ;
Arrays. asList ( query. getFxIncidentIds ( ) ) . forEach ( id - > {
point. setFxIncidentId ( id) ;
point. setFxCheckStatus ( "1" ) ;
incidentService. updateRiskPoint ( point) ;
} ) ;
return Result. success ( ) ;
}
@Override
public void updateRiskPoint ( FxIncident point) {
Long id = point. getFxIncidentId ( ) ;
point. setDisposalUuid ( StringUtils. getUuid ( ) ) ;
point. setDisposalDate ( new Date ( ) ) ;
incidentMapper. updateByPrimaryKeySelective ( point) ;
new FirstThreadTest ( id) . start ( ) ;
}
public class FirstThreadTest extends Thread {
private Long id;
public FirstThreadTest ( Long id) {
this . id= id;
}
public long getId ( ) {
return this . id;
}
public void run ( )
{
FxIncident fxIncident = incidentMapper. getIncidentDetail ( this . id) ;
String url = "http://192.168.252.230:8081/uoimccp/http/syncEvent/" ;
Map< String, Object> result= new HashMap < > ( ) ;
result. put ( "mobile" , fxIncident. getMobilephone ( ) ) ;
result. put ( "upload_type" , "1" ) ;
result. put ( "event_add" , fxIncident. getFxIncidentAddress ( ) ) ;
result. put ( "event_coordinate" , fxIncident. getFxIncidentX ( ) + "," + fxIncident. getFxIncidentY ( ) ) ;
result. put ( "event_describe" , fxIncident. getFxIncidentContent ( ) ) ;
String format = new SimpleDateFormat ( "yyyy-MM-dd HH:mm:ss" ) . format ( new Date ( ) ) ;
String format11 = new SimpleDateFormat ( "yyyy-MM-dd HH:mm:ss" ) . format ( fxIncident. getFxIncidentReportDate ( ) ) ;
result. put ( "event_time" , format11) ;
result. put ( "chuzhi_time" , format) ;
result. put ( "event_type_one" , "ee396d5a003f4ebbb26e6b821b82e0f0" ) ;
result. put ( "id" , fxIncident. getIncidentUuid ( ) ) ;
if ( ! StringUtils. isEmpty ( fxIncident. getIncidentTypeDict ( ) ) ) {
if ( fxIncident. getIncidentTypeDict ( ) . equals ( "寒潮霜冻" ) ) {
result. put ( "event_type_two" , "b59c9d443a084440875bc76cd7b4bf44" ) ;
}
if ( fxIncident. getIncidentTypeDict ( ) . equals ( "公共设施缺损" ) ) {
result. put ( "event_type_two" , "dc60a7aac4344fe7b0c7e55d91066937" ) ;
}
if ( fxIncident. getIncidentTypeDict ( ) . equals ( "危棚简屋" ) ) {
result. put ( "event_type_two" , "c24dabf6087147538ff59fceca2f8601" ) ;
}
if ( fxIncident. getIncidentTypeDict ( ) . equals ( "高空坠物" ) ) {
result. put ( "event_type_two" , "5ec029af13e74128952827d4560c13f4" ) ;
}
if ( fxIncident. getIncidentTypeDict ( ) . equals ( "树木倒折" ) ) {
result. put ( "event_type_two" , "c57bce02b7cf46aba892810cf7c97a9c" ) ;
}
if ( fxIncident. getIncidentTypeDict ( ) . equals ( "路面积水" ) ) {
result. put ( "event_type_two" , "d1d5a30f610a4114bdfb08a63b9d2dbf" ) ;
}
if ( fxIncident. getIncidentTypeDict ( ) . equals ( "应急避难场所倒灌" ) ) {
result. put ( "event_type_two" , "18996a7208134a76a3337259ce74b798" ) ;
}
if ( fxIncident. getIncidentTypeDict ( ) . equals ( "其它" ) ) {
result. put ( "event_type_two" , "c258df1ea9a14113a5395791a06424d8" ) ;
}
}
List< Map< String, Object> > imgList = new ArrayList < > ( ) ;
if ( StringUtils. isNotEmpty ( fxIncident. getFxIncidentReportPic ( ) ) ) {
List< String> reportPicList = new ArrayList < > ( ) ;
fxUploadFileMapper. selectFilesForAsso ( fxIncident. getFxIncidentReportPic ( ) ) . forEach (
reportImg - > {
Map< String, Object> reportPic= new HashMap < > ( ) ;
reportPic. put ( "id" , StringUtils. getUuid ( ) ) ;
reportPic. put ( "event_id" , fxIncident. getIncidentUuid ( ) ) ;
reportPic. put ( "img_url" , "http://media.jqout.wiseljz.com:6003" + reportImg. getFxFileUri ( ) ) ;
imgList. add ( reportPic) ;
} ) ;
}
result. put ( "imgList" , imgList) ;
List< Map< String, Object> > disposalList = new ArrayList < > ( ) ;
Map< String, Object> disposal= new HashMap < > ( ) ;
Map< String, Object> disposal1= new HashMap < > ( ) ;
disposal. put ( "event_status" , "0" ) ;
disposal. put ( "chuzhi_time" , format) ;
disposal. put ( "handle_status" , "0" ) ;
disposal. put ( "event_id" , fxIncident. getIncidentUuid ( ) ) ;
disposal. put ( "id" , StringUtils. getUuid ( ) ) ;
disposalList. add ( disposal) ;
disposal1. put ( "event_status" , "2" ) ;
disposal1. put ( "chuzhi_time" , format) ;
disposal1. put ( "handle_status" , "1" ) ;
disposal1. put ( "event_id" , fxIncident. getIncidentUuid ( ) ) ;
disposal1. put ( "id" , StringUtils. getUuid ( ) ) ;
disposalList. add ( disposal1) ;
if ( fxIncident. getFxIncidentStatusDict ( ) . equals ( "1" ) ) {
result. put ( "event_status" , "2" ) ;
result. put ( "handle_status" , "1" ) ;
}
if ( fxIncident. getFxIncidentStatusDict ( ) . equals ( "2" ) ) {
result. put ( "event_status" , "2" ) ;
result. put ( "handle_status" , "4" ) ;
List< Map< String, Object> > disposalImgList = new ArrayList < > ( ) ;
if ( StringUtils. isNotEmpty ( fxIncident. getFxIncidentAccessPic ( ) ) ) {
fxUploadFileMapper. selectFilesForAsso ( fxIncident. getFxIncidentAccessPic ( ) ) . forEach (
reportImg - > {
Map< String, Object> reportPic= new HashMap < > ( ) ;
reportPic. put ( "disposal_id" , fxIncident. getDisposalUuid ( ) ) ;
reportPic. put ( "id" , StringUtils. getUuid ( ) ) ;
reportPic. put ( "event_id" , fxIncident. getIncidentUuid ( ) ) ;
reportPic. put ( "img_url" , "http://media.jqout.wiseljz.com:6003" + reportImg. getFxFileUri ( ) ) ;
disposalImgList. add ( reportPic) ;
} ) ;
}
result. put ( "disposalImgList" , disposalImgList) ;
Map< String, Object> disposal2= new HashMap < > ( ) ;
disposal2. put ( "event_status" , "2" ) ;
disposal2. put ( "chuzhi_time" , format) ;
disposal2. put ( "handle_status" , "3" ) ;
disposal2. put ( "event_id" , fxIncident. getIncidentUuid ( ) ) ;
disposal2. put ( "id" , StringUtils. getUuid ( ) ) ;
disposalList. add ( disposal2) ;
Map< String, Object> disposal3= new HashMap < > ( ) ;
disposal3. put ( "event_status" , "2" ) ;
disposal3. put ( "chuzhi_time" , format) ;
disposal3. put ( "handle_status" , "4" ) ;
disposal3. put ( "event_id" , fxIncident. getIncidentUuid ( ) ) ;
disposal3. put ( "id" , fxIncident. getDisposalUuid ( ) ) ;
disposalList. add ( disposal3) ;
}
result. put ( "disposalList" , disposalList) ;
String s = JSONObject. toJSONString ( result) ;
try {
commonHttpClient. sendHttpPost ( url, s) ;
} catch ( Exception e) {
e. printStackTrace ( ) ;
}
}
}