...
|
...
|
@@ -104,24 +104,24 @@ public class LandBusinesstypeListController extends BaseController { |
|
|
@ResponseBody
|
|
|
public Page<LandRoadVeRecord> list(String frameNo) throws Exception {
|
|
|
Page<LandRoadVeRecord> page = new Page<LandRoadVeRecord>();
|
|
|
//List<LandBusinesstypeList> list = landBusinesstypeListService.findByStatus(frameNo);
|
|
|
List<LandRoadVeRecord> list = roadVeService.selectByFrameNo(frameNo);
|
|
|
// if(list.size()>0 ) {
|
|
|
// for (int i = 0; i < list.size(); i++) {
|
|
|
// System.out.println(list.get(i));
|
|
|
// boolean flag = (list.get(i).getContrastflag()==null ||list.get(i).getContrastflag()=="" ||list.get(i).getContrastflag().length()<=0);
|
|
|
// if("进场站".equals(list.get(i).getTurnoverflag()) && flag) {
|
|
|
// page.setResultMsg("此车辆存在进场业务,请勿重新申报");
|
|
|
// }else if("已进站".equals(list.get(i).getContrastflag())) {
|
|
|
// page.setResultMsg("此车辆有出站业务未完成");
|
|
|
// }else if("出场站".equals(list.get(i).getTurnoverflag())&& flag ) {
|
|
|
// page.setResultMsg("此车辆存在出场业务,请勿重新申报");
|
|
|
// }
|
|
|
// }
|
|
|
// }else {
|
|
|
// page.setResultMsg("此车辆可以正常申报业务");
|
|
|
// }
|
|
|
page.setList(list);
|
|
|
List<LandBusinesstypeList> list = landBusinesstypeListService.findByStatus(frameNo);
|
|
|
List<LandRoadVeRecord> veList = roadVeService.selectByFrameNo(frameNo);
|
|
|
if(list.size()>0 ) {
|
|
|
for (int i = 0; i < list.size(); i++) {
|
|
|
boolean flag = (list.get(i).getContrastflag()==null || list.get(i).getContrastflag().length()<1);
|
|
|
if("I".equals(list.get(i).getTurnoverflag()) && flag) {
|
|
|
page.setResultMsg("此车辆已存在进出场业务,请勿重新申报");
|
|
|
}else if("E".equals(list.get(i).getTurnoverflag())&& flag ) {
|
|
|
page.setResultMsg("此车辆已存在进出场业务,请勿重新申报");
|
|
|
}else {
|
|
|
page.setResultMsg("此车辆可以正常申报业务");
|
|
|
}
|
|
|
break;
|
|
|
}
|
|
|
}else {
|
|
|
page.setResultMsg("此车辆可以正常申报业务");
|
|
|
}
|
|
|
page.setList(veList);
|
|
|
return page;
|
|
|
|
|
|
}
|
...
|
...
|
@@ -139,7 +139,6 @@ public class LandBusinesstypeListController extends BaseController { |
|
|
@RequiresPermissions("land:landBusinesstypeList:view")
|
|
|
@RequestMapping(value = "form")
|
|
|
public String form(LandBusinesstypeList landBusinesstypeList, Model model) {
|
|
|
System.out.println(landBusinesstypeList);
|
|
|
Yard yard = new Yard();
|
|
|
List<Yard> yardList = yardService.findList(yard);
|
|
|
LandRoadVeRecord ve = new LandRoadVeRecord();
|
...
|
...
|
@@ -154,9 +153,6 @@ public class LandBusinesstypeListController extends BaseController { |
|
|
List<Bayonet> bayonets = bayService.findByYardId(yard1.getStationid());
|
|
|
model.addAttribute("bayonets", bayonets);
|
|
|
}
|
|
|
// Bayonet bayonet = new Bayonet();
|
|
|
// List<Bayonet> bayonets = bayService.findList(bayonet);
|
|
|
// model.addAttribute("bayonets", bayonets);
|
|
|
model.addAttribute("veList",veList);
|
|
|
model.addAttribute("yardList", yardList);
|
|
|
model.addAttribute("landBusinesstypeList", landBusinesstypeList);
|
...
|
...
|
@@ -173,13 +169,24 @@ public class LandBusinesstypeListController extends BaseController { |
|
|
landBusinesstypeList.setIsvalid("0");
|
|
|
if(landBusinesstypeList.getId().length()>0) {
|
|
|
String masterList = landBusinesstypeList.getMasterList();
|
|
|
System.out.println(masterList);
|
|
|
insertVm(landBusinesstypeList.getMassageId(),landBusinesstypeList.getTrailerFrameNo(),masterList);
|
|
|
landBusinesstypeListService.save(landBusinesstypeList);
|
|
|
List<LandBusinesstypeList> list = landBusinesstypeListService.findByBarcode(landBusinesstypeList.getBarcode());
|
|
|
for (int i = 0; i < list.size(); i++) {
|
|
|
if(list.get(i).getMasterList().length()>0) {
|
|
|
list.get(i).setMasterList(masterList);
|
|
|
landBusinesstypeListService.save(list.get(i));
|
|
|
if(list.get(i).getBusinesstype().endsWith("流转")) {
|
|
|
if(list.get(i).getMasterList().length()>0) {
|
|
|
if(list.get(i).getContrastflag()==null) {
|
|
|
list.get(i).setMasterList(masterList);
|
|
|
// list.get(i).setBusinesstype(landBusinesstypeList.getBusinesstype());
|
|
|
landBusinesstypeListService.save(list.get(i));
|
|
|
}
|
|
|
}else {
|
|
|
if("I".equals(list.get(i).getTurnoverflag())) {
|
|
|
list.get(i).setMasterList(masterList);
|
|
|
// list.get(i).setBusinesstype(landBusinesstypeList.getBusinesstype());
|
|
|
landBusinesstypeListService.save(list.get(i));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}else{
|
...
|
...
|
@@ -229,13 +236,10 @@ public class LandBusinesstypeListController extends BaseController { |
|
|
String messageId = LandBusinesstypeListController.dateTimeFormat();
|
|
|
String mainfistList = landBusinesstypeList.getMasterList();
|
|
|
String startport = landBusinesstypeList.getStartport();
|
|
|
System.out.println("startport:"+startport);
|
|
|
String endport = landBusinesstypeList.getEndport();
|
|
|
System.out.println("endport:"+endport);
|
|
|
String startStation = landBusinesstypeList.getStartsatation();
|
|
|
System.out.println("startStation:"+startStation);
|
|
|
String endStation = landBusinesstypeList.getEndstation();
|
|
|
System.out.println("endStation:"+endStation);
|
|
|
String isfull = landBusinesstypeList.getIsfull();
|
|
|
landBusinesstypeList.setMassageId(messageId);
|
|
|
String barCode = buildBarCode.CreateBarCode(landBusinesstypeList.getTrailerFrameNo(),messageId);
|
|
|
landBusinesstypeList.setStartport("");
|
...
|
...
|
@@ -244,6 +248,7 @@ public class LandBusinesstypeListController extends BaseController { |
|
|
landBusinesstypeList.setEndstation(startStation);
|
|
|
landBusinesstypeList.setBarcode(barCode);
|
|
|
landBusinesstypeList.setMasterList("");
|
|
|
landBusinesstypeList.setProdectTime(new Date());
|
|
|
landBusinesstypeList.setAisle(bayService.findByYardAndName(startStation, "1号卡口-进").getChannel());
|
|
|
landBusinesstypeListService.save(landBusinesstypeList);
|
|
|
insertVm(landBusinesstypeList.getMassageId(),landBusinesstypeList.getTrailerFrameNo(),mainfistList);
|
...
|
...
|
@@ -255,6 +260,7 @@ public class LandBusinesstypeListController extends BaseController { |
|
|
list.setBarcode(barCode);
|
|
|
list.setIsDelete("0");
|
|
|
list.setIsvalid("0");
|
|
|
list.setIsfull(isfull);
|
|
|
list.setBusinesstype(landBusinesstypeList.getBusinesstype());
|
|
|
list.setCocode(landBusinesstypeList.getCocode());
|
|
|
list.setTrailerFrameNo(landBusinesstypeList.getTrailerFrameNo());
|
...
|
...
|
@@ -275,6 +281,7 @@ public class LandBusinesstypeListController extends BaseController { |
|
|
list1.setAgentno(landBusinesstypeList.getAgentno());
|
|
|
list1.setIsDelete("0");
|
|
|
list1.setIsvalid("0");
|
|
|
list1.setIsfull(isfull);
|
|
|
list1.setBarcode(barCode);
|
|
|
list1.setBusinesstype(landBusinesstypeList.getBusinesstype());
|
|
|
list1.setCocode(landBusinesstypeList.getCocode());
|
...
|
...
|
@@ -299,13 +306,14 @@ public class LandBusinesstypeListController extends BaseController { |
|
|
list2.setBarcode(barCode);
|
|
|
list2.setIsDelete("0");
|
|
|
list2.setIsvalid("0");
|
|
|
list2.setIsfull(isfull);
|
|
|
list2.setBusinesstype(landBusinesstypeList.getBusinesstype());
|
|
|
list2.setCocode(landBusinesstypeList.getCocode());
|
|
|
list2.setTrailerFrameNo(landBusinesstypeList.getTrailerFrameNo());
|
|
|
list2.setStartport("");
|
|
|
list2.setStartsatation("");
|
|
|
list1.setStartport(startport);
|
|
|
list1.setStartsatation(startStation);
|
|
|
list2.setStartport(startport);
|
|
|
list2.setStartsatation(startStation);
|
|
|
list2.setEndport(endport);
|
|
|
list2.setEndstation(endStation);
|
|
|
list2.setProdectTime(new Date());
|
...
|
...
|
@@ -323,7 +331,7 @@ public class LandBusinesstypeListController extends BaseController { |
|
|
//first entry
|
|
|
String messageId = dateTimeFormat();
|
|
|
String mainfistList = landBusinesstypeList.getMasterList();
|
|
|
System.out.println(mainfistList);
|
|
|
String isfull = landBusinesstypeList.getIsfull();
|
|
|
landBusinesstypeList.setMassageId(messageId);
|
|
|
String barCode = buildBarCode.CreateBarCode(landBusinesstypeList.getTrailerFrameNo(),messageId);
|
|
|
landBusinesstypeList.setBarcode(barCode);
|
...
|
...
|
@@ -337,6 +345,7 @@ public class LandBusinesstypeListController extends BaseController { |
|
|
list.setIsDelete("0");
|
|
|
list.setIsvalid("0");
|
|
|
list.setBarcode(barCode);
|
|
|
list.setIsfull(isfull);
|
|
|
list.setBusinesstype(landBusinesstypeList.getBusinesstype());
|
|
|
list.setCocode(landBusinesstypeList.getCocode());
|
|
|
list.setTrailerFrameNo(landBusinesstypeList.getTrailerFrameNo());
|
...
|
...
|
@@ -361,7 +370,8 @@ public class LandBusinesstypeListController extends BaseController { |
|
|
landBusinesstypeList.setMassageId(messageId);
|
|
|
String mainfistList = landBusinesstypeList.getMasterList();
|
|
|
String barCode = buildBarCode.CreateBarCode(landBusinesstypeList.getTrailerFrameNo(),messageId);
|
|
|
// String barCode = messageId;
|
|
|
//String barCode = messageId;
|
|
|
String isfull = landBusinesstypeList.getIsfull();
|
|
|
landBusinesstypeList.setBarcode(barCode);
|
|
|
landBusinesstypeListService.save(landBusinesstypeList);
|
|
|
insertVm(landBusinesstypeList.getMassageId(),landBusinesstypeList.getTrailerFrameNo(),mainfistList);
|
...
|
...
|
@@ -371,6 +381,7 @@ public class LandBusinesstypeListController extends BaseController { |
|
|
list.setAgentno(landBusinesstypeList.getAgentno());
|
|
|
list.setIsDelete("0");
|
|
|
list.setIsvalid("0");
|
|
|
list.setIsfull(isfull);
|
|
|
list.setBarcode(barCode);
|
|
|
list.setBusinesstype(landBusinesstypeList.getBusinesstype());
|
|
|
list.setCocode(landBusinesstypeList.getCocode());
|
...
|
...
|
@@ -396,15 +407,27 @@ public class LandBusinesstypeListController extends BaseController { |
|
|
}
|
|
|
|
|
|
public void insertVm(String id ,String frameNo,String mainfistList) {
|
|
|
veMainService.deleteById(id);
|
|
|
|
|
|
List<VehicleMainifist> vmList = veMainService.selectByBueId(id);
|
|
|
|
|
|
if(mainfistList.length()>0) {
|
|
|
String[] list = mainfistList.split(",");
|
|
|
for (int i = 0; i < list.length; i++) {
|
|
|
VehicleMainifist vehicleMainifist = new VehicleMainifist();
|
|
|
vehicleMainifist.setBusinessId(id);
|
|
|
vehicleMainifist.setBusinessNum(frameNo);
|
|
|
vehicleMainifist.setMainifist(list[i]);
|
|
|
veMainService.save(vehicleMainifist);
|
|
|
String[] list = mainfistList.replace(",", ",").split(",");
|
|
|
if(vmList.size()>list.length) {
|
|
|
for (int j = 0; j < vmList.size(); j++) {
|
|
|
for (int i = 0; i < list.length; i++) {
|
|
|
if(vmList.get(j).getMainifist() != list[i]) {
|
|
|
veMainService.deleteEntry(vmList.get(j));
|
|
|
}
|
|
|
VehicleMainifist vm = veMainService.selectByVm(id,list[i]);
|
|
|
if(vm==null) {
|
|
|
VehicleMainifist vehicleMainifist = new VehicleMainifist();
|
|
|
vehicleMainifist.setBusinessId(id);
|
|
|
vehicleMainifist.setBusinessNum(frameNo);
|
|
|
vehicleMainifist.setMainifist(list[i]);
|
|
|
veMainService.save(vehicleMainifist);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
...
|
...
|
|