...
|
...
|
@@ -2,12 +2,14 @@ package com.sunyo.wlpt.message.builder.controller; |
|
|
|
|
|
import com.sunyo.wlpt.base.model.NMMS_CUSTOM_MT2201;
|
|
|
import com.sunyo.wlpt.message.builder.service.MT2201Service;
|
|
|
import com.sunyo.wlpt.message.builder.util.ReturnUtil;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import java.io.IOException;
|
|
|
import java.text.ParseException;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
...
|
...
|
@@ -48,7 +50,6 @@ public class MT2201Controller { |
|
|
@RequestParam("contactTel")String contactTel) {
|
|
|
|
|
|
try {
|
|
|
|
|
|
return mt2201Service.editMt2201(nmmsCustomMt2201List, reason, contactName, contactTel);
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
...
|
...
|
@@ -60,15 +61,21 @@ public class MT2201Controller { |
|
|
@PutMapping("/removeMt2201")
|
|
|
@ApiOperation(value = "删除报文")
|
|
|
@ResponseBody
|
|
|
public Map<String, Object> removeMt2201(@RequestBody Map<String, Object> map) {
|
|
|
public List<Map<String, Object>> removeMt2201(@RequestBody List<NMMS_CUSTOM_MT2201> nmmsCustomMt2201List,
|
|
|
@RequestParam("reason")String reason,
|
|
|
@RequestParam("contactName")String contactName,
|
|
|
@RequestParam("contactTel")String contactTel,
|
|
|
@RequestParam("content")String content) {
|
|
|
|
|
|
try {
|
|
|
return mt2201Service.removeMt2201(map);
|
|
|
Map<String, Object> map = removeLogic(nmmsCustomMt2201List, reason, contactName, contactTel, content);
|
|
|
Map<String, Object> mapNmms = mt2201Service.removeMt2201(map);
|
|
|
List<Map<String, Object>> mapList = new ArrayList<>();
|
|
|
mapList.add(mapNmms);
|
|
|
return mapList;
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
|
Map<String, Object> maps = new HashMap<>();
|
|
|
maps.put("status", "0");
|
|
|
return maps;
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
}
|
...
|
...
|
@@ -85,4 +92,36 @@ public class MT2201Controller { |
|
|
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 删除报文逻辑处理
|
|
|
*/
|
|
|
public Map<String, Object> removeLogic(List<NMMS_CUSTOM_MT2201> nmmsCustomMt2201List,
|
|
|
String reason,
|
|
|
String contactName,
|
|
|
String contactTel,
|
|
|
String content){
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
|
|
|
|
|
|
for (NMMS_CUSTOM_MT2201 nmmsCustomMt2201 : nmmsCustomMt2201List){
|
|
|
map.put("flightDates",sdf.format(nmmsCustomMt2201.getFlightdate()));
|
|
|
map.put("carrier", nmmsCustomMt2201.getCarrier());
|
|
|
map.put("flightNo", nmmsCustomMt2201.getFlightno());
|
|
|
map.put("customCode", nmmsCustomMt2201.getCustomcode());
|
|
|
map.put("awba", nmmsCustomMt2201.getAwba());
|
|
|
break;
|
|
|
}
|
|
|
for (NMMS_CUSTOM_MT2201 nmmsCustomMt2201 : nmmsCustomMt2201List){
|
|
|
// 处理主单号-
|
|
|
String awba = ReturnUtil.awbaReplace(nmmsCustomMt2201.getAwba());
|
|
|
nmmsCustomMt2201.setAwba(awba);
|
|
|
}
|
|
|
map.put("reason",reason);
|
|
|
map.put("contactName",contactName);
|
|
|
map.put("contactTel",contactTel);
|
|
|
map.put("content",content);
|
|
|
map.put("nmmsCustomMt2201List", nmmsCustomMt2201List);
|
|
|
return map;
|
|
|
}
|
|
|
|
|
|
} |
...
|
...
|
|