...
|
...
|
@@ -5,10 +5,16 @@ import com.tianbo.analysis.model.Originmanifestsecondary; |
|
|
import com.tianbo.analysis.model.ResultJson;
|
|
|
import com.tianbo.analysis.service.NmmsImportService;
|
|
|
import com.tianbo.analysis.service.OriginService;
|
|
|
import com.tianbo.util.Date.DateUtil;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import org.thymeleaf.util.DateUtils;
|
|
|
|
|
|
import java.text.ParseException;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -28,42 +34,46 @@ public class NmmsImportController { |
|
|
NmmsImportService nmmsImportService;
|
|
|
|
|
|
/**
|
|
|
* awbhIds[] 分单id
|
|
|
* 批量删除
|
|
|
* @param originmanifestsecondary
|
|
|
* @param awbhIds
|
|
|
* @return
|
|
|
*/
|
|
|
@ApiOperation(value = "批量删除")
|
|
|
@PostMapping(value = "/imp_removes")
|
|
|
@ResponseBody
|
|
|
public ResultJson antivirus_log_remove(@RequestBody Originmanifestsecondary originmanifestsecondary){
|
|
|
public ResultJson antivirus_log_remove(@RequestParam(value ="awbhIds", required= true) String awbhIds){
|
|
|
int r = 0;
|
|
|
if(originmanifestsecondary != null){
|
|
|
if (originmanifestsecondary.getAwbhIds().contains(",")){
|
|
|
String[] split = originmanifestsecondary.getAwbhIds().split(",");
|
|
|
for (int i=0; i< split.length; i++){
|
|
|
r += originService.deleteAwbh(split[i]);
|
|
|
}
|
|
|
if (awbhIds.contains(",")){
|
|
|
String[] split = awbhIds.split(",");
|
|
|
for (int i=0; i< split.length; i++){
|
|
|
r += originService.deleteAwbh(split[i]);
|
|
|
}
|
|
|
}else {
|
|
|
r += originService.deleteAwbh(awbhIds);
|
|
|
}
|
|
|
|
|
|
|
|
|
return r > 0 ? new ResultJson("200", "批量删除成功")
|
|
|
: new ResultJson("201", "批量删除失败");
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* awbhIds[] 分单id
|
|
|
* flightDate 航班日期
|
|
|
* flightno 航班号
|
|
|
* @param originmanifestmaster
|
|
|
* 分单挂载主单
|
|
|
* @param awbhIds
|
|
|
* @param flightNo
|
|
|
* @param flightDate
|
|
|
* @return
|
|
|
*/
|
|
|
@ApiOperation(value = "分单批量挂载")
|
|
|
@PostMapping(value = "/mountAwbh")
|
|
|
@ResponseBody
|
|
|
public ResultJson antivirus_log_remove(@RequestBody ORIGINMANIFESTMASTER originmanifestmaster){
|
|
|
|
|
|
public ResultJson antivirus_log_remove(@RequestParam(value ="awbhIds", required= true) String awbhIds,
|
|
|
@RequestParam(value ="flightNo", required= true) String flightNo,
|
|
|
@RequestParam(value ="flightDate", required= true) String flightDate) throws ParseException {
|
|
|
ORIGINMANIFESTMASTER originmanifestmaster = new ORIGINMANIFESTMASTER();
|
|
|
originmanifestmaster.setAwbhIds(awbhIds);
|
|
|
originmanifestmaster.setFlightno(flightNo);
|
|
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
Date parse = simpleDateFormat.parse(flightDate);
|
|
|
originmanifestmaster.setFlightDate(parse);
|
|
|
return nmmsImportService.mountAwbh(originmanifestmaster) > 0 ? new ResultJson("200", "分单挂载成功")
|
|
|
: new ResultJson("201", "分单挂载失败");
|
|
|
}
|
...
|
...
|
|