作者 zhangFan

修改部分bug

... ... @@ -26,5 +26,11 @@ public interface LandBusinesstypeListDao extends CrudDao<LandBusinesstypeList> {
int deleteByBarcode(@Param("barcode")String barcode);
int updateByBarcode(LandBusinesstypeList landBusinesstypeList);
List<LandBusinesstypeList> findByMessageId(@Param("massageId")String messageId);
int updateEntry(LandBusinesstypeList landBusinesstypeList);
int deleteByMessageId(LandBusinesstypeList landBusinesstypeList);
}
\ No newline at end of file
... ...
... ... @@ -36,7 +36,7 @@ public class LandRoadVeRecord extends DataEntity<LandRoadVeRecord> {
private String brand; // 厂牌
private String model; // 车型
private String exhaustCapacity; // 排气量
private Date veFactoryDate; // 车辆出厂日期
private Date veFactoryDate; // 行驶证有效日期
private String veMotorNo; // 发动机号
private String veFrameNo; // 车架号(车辆识别代号)
private String veTon; // 核定载客/核定载质量:客车的核定载客单位仍为:人;货车的核定载客单位改为:千克。
... ... @@ -62,7 +62,7 @@ public class LandRoadVeRecord extends DataEntity<LandRoadVeRecord> {
private String proposer; // 申请人
private Date proposeTime; // 申请时间
private String veClassFlag; // 车辆分类
private String operationType; // 数据操作类型
private String operationType; // 删除标识
private String trailerLicenseNo; // 挂车牌号
private String trailerFrameNo; // 挂车车架号
private String approNoPic; // 批文扫描图
... ...
... ... @@ -68,4 +68,18 @@ public class LandBusinesstypeListService extends CrudService<LandBusinesstypeLis
return dao.updateByBarcode(landBusinesstypeList);
}
@Transactional(readOnly = false)
public List<LandBusinesstypeList> findByMessageId(String messageId) {
return dao.findByMessageId(messageId);
}
@Transactional(readOnly = false)
public int updateEntry(LandBusinesstypeList landBusinesstypeList) {
return dao.updateEntry(landBusinesstypeList);
}
@Transactional(readOnly = false)
public int deleteByMessageId(LandBusinesstypeList landBusinesstypeList) {
return dao.deleteByMessageId(landBusinesstypeList);
}
}
\ No newline at end of file
... ...
... ... @@ -6,6 +6,7 @@ package com.thinkgem.jeesite.modules.land.web;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.Random;
import javax.annotation.PostConstruct;
import javax.servlet.http.HttpServletRequest;
... ... @@ -43,6 +44,7 @@ import com.thinkgem.jeesite.modules.yard.service.YardService;
/**
* 货物流转类型Controller
*
* @author zhangfan
* @version 2018-10-08
*/
... ... @@ -52,53 +54,57 @@ public class LandBusinesstypeListController extends BaseController {
@Autowired
private LandBusinesstypeListService landBusinesstypeListService;
@Autowired
private YardService yardService;
@Autowired
private BayonetService bayService;
@Autowired
private VehicleMainifistService veMainService;
@Autowired
private LandRoadVeRecordService roadVeService;
@Autowired
private SystemService systemService;
private static final String TYPE1 = "进口流转";
private static final String TYPE1 = "调拨业务";
private static final String TYPE2 = "进口提货";
private static final String TYPE3 = "出口送货";
private static final String TYPE4 = "出口流转";
private static final String TYPE4 = "分拨业务";
@ModelAttribute
public LandBusinesstypeList get(@RequestParam(required=false) String id) {
public LandBusinesstypeList get(@RequestParam(required = false) String id) {
LandBusinesstypeList entity = null;
if (StringUtils.isNotBlank(id)){
if (StringUtils.isNotBlank(id)) {
entity = landBusinesstypeListService.get(id);
}
if (entity == null){
if (entity == null) {
entity = new LandBusinesstypeList();
}
return entity;
}
@RequiresPermissions("land:landBusinesstypeList:view")
@RequestMapping(value = {"list", ""})
public String list(LandBusinesstypeList landBusinesstypeList, HttpServletRequest request, HttpServletResponse response, Model model) {
@RequestMapping(value = { "list", "" })
public String list(LandBusinesstypeList landBusinesstypeList, HttpServletRequest request,
HttpServletResponse response, Model model) {
Principal principal = UserUtils.getPrincipal();
String loginName = principal.getLoginName();
User user = systemService.getUserByLoginName(loginName);
landBusinesstypeList.setCreateBy(user);
Page<LandBusinesstypeList> page = landBusinesstypeListService.findPage(new Page<LandBusinesstypeList>(request, response), landBusinesstypeList);
Yard yard = new Yard();
List<Yard> yardList = yardService.findList(yard);
Page<LandBusinesstypeList> page = landBusinesstypeListService
.findPage(new Page<LandBusinesstypeList>(request, response), landBusinesstypeList);
model.addAttribute("yardList", yardList);
model.addAttribute("page", page);
return "modules/land/landBusinesstypeListList";
}
@RequiresPermissions("land:landBusinesstypeList:view")
@RequestMapping(value = "check")
@ResponseBody
... ... @@ -106,30 +112,36 @@ public class LandBusinesstypeListController extends BaseController {
Page<LandRoadVeRecord> page = new Page<LandRoadVeRecord>();
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("此车辆可以正常申报业务");
if (veList.size() < 1) {
page.setResultMsg("此车辆未备案,请先备案");
} else {
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;
}
break;
} else {
page.setResultMsg("此车辆可以正常申报业务");
}
}else {
page.setResultMsg("此车辆可以正常申报业务");
}
page.setList(veList);
return page;
}
@RequiresPermissions("land:landBusinesstypeList:view")
@RequestMapping(value = "option")
@ResponseBody
public Page<Bayonet> option(String st_select,Model model) throws Exception {
Page<Bayonet>page = new Page<Bayonet>();
public Page<Bayonet> option(String st_select) throws Exception {
Page<Bayonet> page = new Page<Bayonet>();
Yard yard = yardService.findByStaionId(st_select);
List<Bayonet> bayonet = bayService.findByYardId(yard.getStationid());
page.setList(bayonet);
... ... @@ -140,21 +152,19 @@ public class LandBusinesstypeListController extends BaseController {
@RequestMapping(value = "form")
public String form(LandBusinesstypeList landBusinesstypeList, Model model) {
Yard yard = new Yard();
List<Yard> yardList = yardService.findList(yard);
LandRoadVeRecord ve = new LandRoadVeRecord();
Principal principal = UserUtils.getPrincipal();
String loginName = principal.getLoginName();
User user = systemService.getUserByLoginName(loginName);
ve.setCreateBy(user);
List<Yard> yardList = yardService.findList(yard);
LandRoadVeRecord ve = new LandRoadVeRecord();
User user = systemService.getUserByLoginName("admin");
ve.setCreateBy(user);
List<LandRoadVeRecord> veList = roadVeService.findList(ve);
if(landBusinesstypeList.getEndstation() !=null) {
Yard yard1 = yardService.findByStaionId(landBusinesstypeList.getEndstation());
List<LandRoadVeRecord> veList = roadVeService.findList(ve);
if (landBusinesstypeList.getEndstation() != null) {
Yard yard1 = yardService.findByStaionId(landBusinesstypeList.getEndstation());
List<Bayonet> bayonets = bayService.findByYardId(yard1.getStationid());
model.addAttribute("bayonets", bayonets);
}
model.addAttribute("veList",veList);
model.addAttribute("yardList", yardList);
}
model.addAttribute("veList", veList);
model.addAttribute("yardList", yardList);
model.addAttribute("landBusinesstypeList", landBusinesstypeList);
return "modules/land/landBusinesstypeListForm";
}
... ... @@ -162,264 +172,411 @@ public class LandBusinesstypeListController extends BaseController {
@RequiresPermissions("land:landBusinesstypeList:edit")
@RequestMapping(value = "save")
public String save(LandBusinesstypeList landBusinesstypeList, Model model, RedirectAttributes redirectAttributes) {
if (!beanValidator(model, landBusinesstypeList)){
if (!beanValidator(model, landBusinesstypeList)) {
return form(landBusinesstypeList, model);
}
landBusinesstypeList.setIsDelete("0");
landBusinesstypeList.setIsvalid("0");
if(landBusinesstypeList.getId().length()>0) {
boolean flag = false;
landBusinesstypeList.setIsDelete("0");
landBusinesstypeList.setIsvalid("0");
if (landBusinesstypeList.getId().length() > 0) {
String masterList = landBusinesstypeList.getMasterList();
insertVm(landBusinesstypeList.getMassageId(),landBusinesstypeList.getTrailerFrameNo(),masterList);
landBusinesstypeListService.save(landBusinesstypeList);
List<LandBusinesstypeList> list = landBusinesstypeListService.findByBarcode(landBusinesstypeList.getBarcode());
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).getBusinesstype().endsWith("流转")) {
if(list.get(i).getMasterList().length()>0) {
if(list.get(i).getContrastflag()==null) {
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())) {
} else {
if ("I".equals(list.get(i).getTurnoverflag()) && list.get(i).getContrastflag() == null) {
list.get(i).setMasterList(masterList);
// list.get(i).setBusinesstype(landBusinesstypeList.getBusinesstype());
landBusinesstypeListService.save(list.get(i));
}
}
}
}
}else{
if(TYPE1.equals(landBusinesstypeList.getBusinesstype())) {
insertType1(landBusinesstypeList);
flag=true;
} else {
if (TYPE1.equals(landBusinesstypeList.getBusinesstype())) {
flag = insertType1(landBusinesstypeList);
}
if(TYPE2.equals(landBusinesstypeList.getBusinesstype())) {
insertType2(landBusinesstypeList);
if (TYPE2.equals(landBusinesstypeList.getBusinesstype())) {
flag = insertType2(landBusinesstypeList);
}
if(TYPE3.equals(landBusinesstypeList.getBusinesstype())) {
insertType3(landBusinesstypeList);
if (TYPE3.equals(landBusinesstypeList.getBusinesstype())) {
flag = insertType3(landBusinesstypeList);
}
if(TYPE4.equals(landBusinesstypeList.getBusinesstype())) {
insertType1(landBusinesstypeList);
if (TYPE4.equals(landBusinesstypeList.getBusinesstype())) {
flag = insertType1(landBusinesstypeList);
}
}
addMessage(redirectAttributes, "保存申请单成功");
return "redirect:"+Global.getAdminPath()+"/land/landBusinesstypeList/?repage";
if(flag) {
addMessage(redirectAttributes, "保存申请单成功");
}else {
addMessage(redirectAttributes, "保存申请单失败,请重新录入");
}
return "redirect:" + Global.getAdminPath() + "/land/landBusinesstypeList/?repage";
}
@RequiresPermissions("land:landBusinesstypeList:edit")
@RequestMapping(value = "delete")
public String delete(LandBusinesstypeList landBusinesstypeList, RedirectAttributes redirectAttributes) {
public String delete(LandBusinesstypeList landBusinesstypeList, RedirectAttributes redirectAttributes)
throws Exception {
boolean flag = false;
List<LandBusinesstypeList> list = landBusinesstypeListService.findByBarcode(landBusinesstypeList.getBarcode());
for (int i = 0; i < list.size(); i++) {
String flag1 = list.get(i).getContrastflag();
if(flag1!=null) {
flag =true;
if (flag1 != null) {
flag = true;
break;
}
}
if(!flag) {
if (!flag) {
landBusinesstypeListService.deleteByBarcode(landBusinesstypeList.getBarcode());
veMainService.deleteById(landBusinesstypeList.getMassageId());
buildBarCode.cancleBarCode(landBusinesstypeList.getTrailerFrameNo());
addMessage(redirectAttributes, "删除申请单成功");
}else {
} else {
addMessage(redirectAttributes, "删除失败,已有业务已进出站");
}
return "redirect:"+Global.getAdminPath()+"/land/landBusinesstypeList/?repage";
return "redirect:" + Global.getAdminPath() + "/land/landBusinesstypeList/?repage";
}
public void insertType1(LandBusinesstypeList landBusinesstypeList) {
//first entry in
String messageId = LandBusinesstypeListController.dateTimeFormat();
String mainfistList = landBusinesstypeList.getMasterList();
String startport = landBusinesstypeList.getStartport();
String endport = landBusinesstypeList.getEndport();
String startStation = landBusinesstypeList.getStartsatation();
String endStation = landBusinesstypeList.getEndstation();
String isfull = landBusinesstypeList.getIsfull();
landBusinesstypeList.setMassageId(messageId);
String barCode = buildBarCode.CreateBarCode(landBusinesstypeList.getTrailerFrameNo(),messageId);
landBusinesstypeList.setStartport("");
landBusinesstypeList.setStartsatation("");
landBusinesstypeList.setEndport(startport);
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);
//second out
LandBusinesstypeList list = new LandBusinesstypeList();
list.setAgentname(landBusinesstypeList.getAgentname());
list.setAgentno(landBusinesstypeList.getAgentno());
list.setBarcode(barCode);
list.setIsDelete("0");
list.setIsvalid("0");
list.setIsfull(isfull);
list.setBusinesstype(landBusinesstypeList.getBusinesstype());
list.setCocode(landBusinesstypeList.getCocode());
list.setTrailerFrameNo(landBusinesstypeList.getTrailerFrameNo());
list.setEndport(startport);
list.setEndstation(startStation);
list.setProdectTime(new Date());
list.setMasterList(mainfistList);
list.setDriverid(landBusinesstypeList.getDriverid());
list.setDrivername(landBusinesstypeList.getDrivername());
list.setAisle(bayService.findByYardAndName(startStation, "1号卡口-出").getChannel());
list.setTurnoverflag("E");
list.setMassageId(messageId);
landBusinesstypeListService.save(list);
//third
LandBusinesstypeList list1 = new LandBusinesstypeList();
list1.setAgentname(landBusinesstypeList.getAgentname());
list1.setAgentno(landBusinesstypeList.getAgentno());
list1.setIsDelete("0");
list1.setIsvalid("0");
list1.setIsfull(isfull);
list1.setBarcode(barCode);
list1.setBusinesstype(landBusinesstypeList.getBusinesstype());
list1.setCocode(landBusinesstypeList.getCocode());
list1.setTrailerFrameNo(landBusinesstypeList.getTrailerFrameNo());
list1.setStartport(startport);
list1.setStartsatation(startStation);
list1.setEndport(endport);
list1.setEndstation(endStation);
list1.setProdectTime(new Date());
list1.setMasterList(mainfistList);
list1.setDriverid(landBusinesstypeList.getDriverid());
list1.setDrivername(landBusinesstypeList.getDrivername());
list1.setAisle(bayService.findByYardAndName(endStation, "1号卡口-进").getChannel());
list1.setTurnoverflag("I");
list1.setMassageId(messageId);
landBusinesstypeListService.save(list1);
//four
LandBusinesstypeList list2 = new LandBusinesstypeList();
list2.setAgentname(landBusinesstypeList.getAgentname());
list2.setAgentno(landBusinesstypeList.getAgentno());
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("");
list2.setStartport(startport);
list2.setStartsatation(startStation);
list2.setEndport(endport);
list2.setEndstation(endStation);
list2.setProdectTime(new Date());
list2.setMasterList("");
list2.setDriverid(landBusinesstypeList.getDriverid());
list2.setDrivername(landBusinesstypeList.getDrivername());
list2.setAisle(bayService.findByYardAndName(endStation, "1号卡口-出").getChannel());
list2.setTurnoverflag("E");
list2.setMassageId(messageId);
landBusinesstypeListService.save(list2);
public boolean insertType1(LandBusinesstypeList landBusinesstypeList) {
boolean flag = false;
try {
// first entry in
String messageId = LandBusinesstypeListController.dateTimeFormat();
String mainfistList = landBusinesstypeList.getMasterList();
String startport = landBusinesstypeList.getStartport();
String endport = landBusinesstypeList.getEndport();
String startStation = landBusinesstypeList.getStartsatation();
String endStation = landBusinesstypeList.getEndstation();
String isfull = landBusinesstypeList.getIsfull();
landBusinesstypeList.setMassageId(messageId);
landBusinesstypeList.setStartport("");
landBusinesstypeList.setStartsatation("");
landBusinesstypeList.setEndport(startport);
landBusinesstypeList.setEndstation(startStation);
landBusinesstypeList.setMasterList("");
landBusinesstypeList.setProdectTime(new Date());
landBusinesstypeList.setAisle(bayService.findByYardAndName(startStation, "1号卡口-进").getChannel());
landBusinesstypeListService.save(landBusinesstypeList);
insertVm(landBusinesstypeList.getMassageId(), landBusinesstypeList.getTrailerFrameNo(), mainfistList);
// second out
LandBusinesstypeList list = new LandBusinesstypeList();
list.setAgentname(landBusinesstypeList.getAgentname());
list.setAgentno(landBusinesstypeList.getAgentno());
list.setIsDelete("0");
list.setIsvalid("0");
list.setIsfull(isfull);
list.setBusinesstype(landBusinesstypeList.getBusinesstype());
list.setCocode(landBusinesstypeList.getCocode());
list.setTrailerFrameNo(landBusinesstypeList.getTrailerFrameNo());
list.setEndport(startport);
list.setEndstation(startStation);
list.setProdectTime(new Date());
list.setMasterList(mainfistList);
list.setDriverid(landBusinesstypeList.getDriverid());
list.setDrivername(landBusinesstypeList.getDrivername());
list.setAisle(bayService.findByYardAndName(startStation, "1号卡口-出").getChannel());
list.setTurnoverflag("E");
list.setMassageId(messageId);
landBusinesstypeListService.save(list);
// third
LandBusinesstypeList list1 = new LandBusinesstypeList();
list1.setAgentname(landBusinesstypeList.getAgentname());
list1.setAgentno(landBusinesstypeList.getAgentno());
list1.setIsDelete("0");
list1.setIsvalid("0");
list1.setIsfull(isfull);
list1.setBusinesstype(landBusinesstypeList.getBusinesstype());
list1.setCocode(landBusinesstypeList.getCocode());
list1.setTrailerFrameNo(landBusinesstypeList.getTrailerFrameNo());
list1.setStartport(startport);
list1.setStartsatation(startStation);
list1.setEndport(endport);
list1.setEndstation(endStation);
list1.setProdectTime(new Date());
list1.setMasterList(mainfistList);
list1.setDriverid(landBusinesstypeList.getDriverid());
list1.setDrivername(landBusinesstypeList.getDrivername());
list1.setAisle(bayService.findByYardAndName(endStation, "1号卡口-进").getChannel());
list1.setTurnoverflag("I");
list1.setMassageId(messageId);
landBusinesstypeListService.save(list1);
// four
LandBusinesstypeList list2 = new LandBusinesstypeList();
list2.setAgentname(landBusinesstypeList.getAgentname());
list2.setAgentno(landBusinesstypeList.getAgentno());
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("");
list2.setStartport(startport);
list2.setStartsatation(startStation);
list2.setEndport(endport);
list2.setEndstation(endStation);
list2.setProdectTime(new Date());
list2.setMasterList("");
list2.setDriverid(landBusinesstypeList.getDriverid());
list2.setDrivername(landBusinesstypeList.getDrivername());
list2.setAisle(bayService.findByYardAndName(endStation, "1号卡口-出").getChannel());
list2.setTurnoverflag("E");
list2.setMassageId(messageId);
landBusinesstypeListService.save(list2);
String barCode = buildBarCode.CreateBarCode(landBusinesstypeList.getTrailerFrameNo(), messageId);
List<LandBusinesstypeList> typeList = landBusinesstypeListService.findByMessageId(messageId);
for (int i = 0; i < typeList.size(); i++) {
typeList.get(i).setBarcode(barCode);
landBusinesstypeListService.updateEntry(typeList.get(i));
flag = true;
}
if (barCode==null) {
List<LandBusinesstypeList> typeList1 = landBusinesstypeListService.findByMessageId(messageId);
for (int i = 0; i < typeList1.size(); i++) {
landBusinesstypeListService.deleteByMessageId(typeList1.get(i));
flag =false;
}
}
} catch (Exception e) {
e.printStackTrace();
}
return flag;
}
public void insertType2(LandBusinesstypeList landBusinesstypeList) {
//first entry
String messageId = dateTimeFormat();
String mainfistList = landBusinesstypeList.getMasterList();
String isfull = landBusinesstypeList.getIsfull();
landBusinesstypeList.setMassageId(messageId);
String barCode = buildBarCode.CreateBarCode(landBusinesstypeList.getTrailerFrameNo(),messageId);
landBusinesstypeList.setBarcode(barCode);
landBusinesstypeList.setMasterList("");
landBusinesstypeListService.save(landBusinesstypeList);
insertVm(landBusinesstypeList.getMassageId(),landBusinesstypeList.getTrailerFrameNo(),mainfistList);
//second
LandBusinesstypeList list = new LandBusinesstypeList();
list.setAgentname(landBusinesstypeList.getAgentname());
list.setAgentno(landBusinesstypeList.getAgentno());
list.setIsDelete("0");
list.setIsvalid("0");
list.setBarcode(barCode);
list.setIsfull(isfull);
list.setBusinesstype(landBusinesstypeList.getBusinesstype());
list.setCocode(landBusinesstypeList.getCocode());
list.setTrailerFrameNo(landBusinesstypeList.getTrailerFrameNo());
list.setStartport(landBusinesstypeList.getStartport());
list.setStartsatation(landBusinesstypeList.getStartsatation());
list.setEndport(landBusinesstypeList.getEndport());
list.setEndstation(landBusinesstypeList.getEndstation());
list.setProdectTime(new Date());
list.setMasterList(mainfistList);
list.setDriverid(landBusinesstypeList.getDriverid());
list.setDrivername(landBusinesstypeList.getDrivername());
list.setAisle(bayService.findByYardAndName(landBusinesstypeList.getEndstation(), "1号卡口-出").getChannel());
list.setTurnoverflag("E");
list.setMassageId(messageId);
landBusinesstypeListService.save(list);
public boolean insertType2(LandBusinesstypeList landBusinesstypeList) {
boolean flag = false;
try {
// first entry
String messageId = dateTimeFormat();
String mainfistList = landBusinesstypeList.getMasterList();
String isfull = landBusinesstypeList.getIsfull();
landBusinesstypeList.setMassageId(messageId);
landBusinesstypeList.setMasterList("");
landBusinesstypeList.setProdectTime(new Date());
landBusinesstypeListService.save(landBusinesstypeList);
insertVm(landBusinesstypeList.getMassageId(), landBusinesstypeList.getTrailerFrameNo(), mainfistList);
// second
LandBusinesstypeList list = new LandBusinesstypeList();
list.setAgentname(landBusinesstypeList.getAgentname());
list.setAgentno(landBusinesstypeList.getAgentno());
list.setIsDelete("0");
list.setIsvalid("0");
list.setIsfull(isfull);
list.setBusinesstype(landBusinesstypeList.getBusinesstype());
list.setCocode(landBusinesstypeList.getCocode());
list.setTrailerFrameNo(landBusinesstypeList.getTrailerFrameNo());
list.setStartport(landBusinesstypeList.getStartport());
list.setStartsatation(landBusinesstypeList.getStartsatation());
list.setEndport(landBusinesstypeList.getEndport());
list.setEndstation(landBusinesstypeList.getEndstation());
list.setProdectTime(new Date());
list.setMasterList(mainfistList);
list.setDriverid(landBusinesstypeList.getDriverid());
list.setDrivername(landBusinesstypeList.getDrivername());
list.setAisle(bayService.findByYardAndName(landBusinesstypeList.getEndstation(), "1号卡口-出").getChannel());
list.setTurnoverflag("E");
list.setMassageId(messageId);
landBusinesstypeListService.save(list);
String barCode = buildBarCode.CreateBarCode(landBusinesstypeList.getTrailerFrameNo(), messageId);
List<LandBusinesstypeList> typeList = landBusinesstypeListService.findByMessageId(messageId);
for (int i = 0; i < typeList.size(); i++) {
typeList.get(i).setBarcode(barCode);
landBusinesstypeListService.updateEntry(typeList.get(i));
flag = true;
}
if (barCode==null) {
List<LandBusinesstypeList> typeList1 = landBusinesstypeListService.findByMessageId(messageId);
for (int i = 0; i < typeList1.size(); i++) {
landBusinesstypeListService.deleteByMessageId(typeList1.get(i));
flag=false;
}
}
} catch (Exception e) {
e.printStackTrace();
}
return flag;
}
public void insertType3(LandBusinesstypeList landBusinesstypeList) {
//first entry
public boolean insertType3(LandBusinesstypeList landBusinesstypeList) {
String messageId = dateTimeFormat();
landBusinesstypeList.setMassageId(messageId);
String mainfistList = landBusinesstypeList.getMasterList();
String barCode = buildBarCode.CreateBarCode(landBusinesstypeList.getTrailerFrameNo(),messageId);
//String barCode = messageId;
String isfull = landBusinesstypeList.getIsfull();
landBusinesstypeList.setBarcode(barCode);
landBusinesstypeListService.save(landBusinesstypeList);
insertVm(landBusinesstypeList.getMassageId(),landBusinesstypeList.getTrailerFrameNo(),mainfistList);
//second
LandBusinesstypeList list = new LandBusinesstypeList();
list.setAgentname(landBusinesstypeList.getAgentname());
list.setAgentno(landBusinesstypeList.getAgentno());
list.setIsDelete("0");
list.setIsvalid("0");
list.setIsfull(isfull);
list.setBarcode(barCode);
list.setBusinesstype(landBusinesstypeList.getBusinesstype());
list.setCocode(landBusinesstypeList.getCocode());
list.setTrailerFrameNo(landBusinesstypeList.getTrailerFrameNo());
list.setStartport(landBusinesstypeList.getStartport());
list.setStartsatation(landBusinesstypeList.getStartsatation());
list.setEndport(landBusinesstypeList.getEndport());
list.setEndstation(landBusinesstypeList.getEndstation());
list.setProdectTime(new Date());
list.setMasterList("");
list.setDriverid(landBusinesstypeList.getDriverid());
list.setDrivername(landBusinesstypeList.getDrivername());
list.setAisle(bayService.findByYardAndName(landBusinesstypeList.getEndstation(), "1号卡口-出").getChannel());
list.setTurnoverflag("E");
list.setMassageId(messageId);
landBusinesstypeListService.save(list);
boolean flag = false;
try {
// first entry
String messageId = dateTimeFormat();
landBusinesstypeList.setMassageId(messageId);
String mainfistList = landBusinesstypeList.getMasterList();
String isfull = landBusinesstypeList.getIsfull();
landBusinesstypeList.setProdectTime(new Date());
landBusinesstypeListService.save(landBusinesstypeList);
insertVm(landBusinesstypeList.getMassageId(), landBusinesstypeList.getTrailerFrameNo(), mainfistList);
// second
LandBusinesstypeList list = new LandBusinesstypeList();
list.setAgentname(landBusinesstypeList.getAgentname());
list.setAgentno(landBusinesstypeList.getAgentno());
list.setIsDelete("0");
list.setIsvalid("0");
list.setIsfull(isfull);
list.setBusinesstype(landBusinesstypeList.getBusinesstype());
list.setCocode(landBusinesstypeList.getCocode());
list.setTrailerFrameNo(landBusinesstypeList.getTrailerFrameNo());
list.setStartport(landBusinesstypeList.getStartport());
list.setStartsatation(landBusinesstypeList.getStartsatation());
list.setEndport(landBusinesstypeList.getEndport());
list.setEndstation(landBusinesstypeList.getEndstation());
list.setProdectTime(new Date());
list.setMasterList("");
list.setDriverid(landBusinesstypeList.getDriverid());
list.setDrivername(landBusinesstypeList.getDrivername());
list.setAisle(bayService.findByYardAndName(landBusinesstypeList.getEndstation(), "1号卡口-出").getChannel());
list.setTurnoverflag("E");
list.setMassageId(messageId);
landBusinesstypeListService.save(list);
String barCode = buildBarCode.CreateBarCode(landBusinesstypeList.getTrailerFrameNo(), messageId);
List<LandBusinesstypeList> typeList = landBusinesstypeListService.findByMessageId(messageId);
for (int i = 0; i < typeList.size(); i++) {
typeList.get(i).setBarcode(barCode);
landBusinesstypeListService.updateEntry(typeList.get(i));
flag = true;
}
if (barCode==null) {
List<LandBusinesstypeList> typeList1 = landBusinesstypeListService.findByMessageId(messageId);
for (int i = 0; i < typeList1.size(); i++) {
landBusinesstypeListService.deleteByMessageId(typeList1.get(i));
flag = false;
}
}
} catch (Exception e) {
e.printStackTrace();
}
return flag;
}
/*
* public void insertType1(LandBusinesstypeList landBusinesstypeList) { //first
* entry in String messageId = LandBusinesstypeListController.dateTimeFormat();
* String mainfistList = landBusinesstypeList.getMasterList(); String startport
* = landBusinesstypeList.getStartport(); String endport =
* landBusinesstypeList.getEndport(); String startStation =
* landBusinesstypeList.getStartsatation(); String endStation =
* landBusinesstypeList.getEndstation(); String isfull =
* landBusinesstypeList.getIsfull();
* landBusinesstypeList.setMassageId(messageId); String barCode =
* buildBarCode.CreateBarCode(landBusinesstypeList.getTrailerFrameNo(),messageId
* ); landBusinesstypeList.setStartport("");
* landBusinesstypeList.setStartsatation("");
* landBusinesstypeList.setEndport(startport);
* 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);
*
* //second out LandBusinesstypeList list = new LandBusinesstypeList();
* list.setAgentname(landBusinesstypeList.getAgentname());
* list.setAgentno(landBusinesstypeList.getAgentno()); list.setBarcode(barCode);
* list.setIsDelete("0"); list.setIsvalid("0"); list.setIsfull(isfull);
* list.setBusinesstype(landBusinesstypeList.getBusinesstype());
* list.setCocode(landBusinesstypeList.getCocode());
* list.setTrailerFrameNo(landBusinesstypeList.getTrailerFrameNo());
* list.setEndport(startport); list.setEndstation(startStation);
* list.setProdectTime(new Date()); list.setMasterList(mainfistList);
* list.setDriverid(landBusinesstypeList.getDriverid());
* list.setDrivername(landBusinesstypeList.getDrivername());
* list.setAisle(bayService.findByYardAndName(startStation,
* "1号卡口-出").getChannel()); list.setTurnoverflag("E");
* list.setMassageId(messageId); landBusinesstypeListService.save(list);
*
* //third LandBusinesstypeList list1 = new LandBusinesstypeList();
* list1.setAgentname(landBusinesstypeList.getAgentname());
* list1.setAgentno(landBusinesstypeList.getAgentno()); list1.setIsDelete("0");
* list1.setIsvalid("0"); list1.setIsfull(isfull); list1.setBarcode(barCode);
* list1.setBusinesstype(landBusinesstypeList.getBusinesstype());
* list1.setCocode(landBusinesstypeList.getCocode());
* list1.setTrailerFrameNo(landBusinesstypeList.getTrailerFrameNo());
* list1.setStartport(startport); list1.setStartsatation(startStation);
* list1.setEndport(endport); list1.setEndstation(endStation);
* list1.setProdectTime(new Date()); list1.setMasterList(mainfistList);
* list1.setDriverid(landBusinesstypeList.getDriverid());
* list1.setDrivername(landBusinesstypeList.getDrivername());
* list1.setAisle(bayService.findByYardAndName(endStation,
* "1号卡口-进").getChannel()); list1.setTurnoverflag("I");
* list1.setMassageId(messageId); landBusinesstypeListService.save(list1);
*
* //four LandBusinesstypeList list2 = new LandBusinesstypeList();
* list2.setAgentname(landBusinesstypeList.getAgentname());
* list2.setAgentno(landBusinesstypeList.getAgentno());
* 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("");
* list2.setStartport(startport); list2.setStartsatation(startStation);
* list2.setEndport(endport); list2.setEndstation(endStation);
* list2.setProdectTime(new Date()); list2.setMasterList("");
* list2.setDriverid(landBusinesstypeList.getDriverid());
* list2.setDrivername(landBusinesstypeList.getDrivername());
* list2.setAisle(bayService.findByYardAndName(endStation,
* "1号卡口-出").getChannel()); list2.setTurnoverflag("E");
* list2.setMassageId(messageId); landBusinesstypeListService.save(list2);
*
* }
*/
public static String dateTimeFormat() {
Date dateTime = new Date();
SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmss");
return format.format(dateTime);
String str = String.valueOf(new Random().nextInt(9999)+1);
if(str.length()==1) {
str = "000"+str;
}else if(str.length()==2) {
str = "00"+str;
}else if(str.length()==3) {
str = "0"+str;
}
str = format.format(dateTime)+str;
return str;
}
public void insertVm(String id ,String frameNo,String mainfistList) {
public void insertVm(String id, String frameNo, String mainfistList) {
List<VehicleMainifist> vmList = veMainService.selectByBueId(id);
if(mainfistList.length()>0) {
if (mainfistList.length() > 0) {
String[] list = mainfistList.replace(",", ",").split(",");
if(vmList.size()>list.length) {
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]) {
if (vmList.get(j).getMainifist() != list[i]) {
veMainService.deleteEntry(vmList.get(j));
}
VehicleMainifist vm = veMainService.selectByVm(id,list[i]);
if(vm==null) {
VehicleMainifist vm = veMainService.selectByVm(id, list[i]);
if (vm == null) {
VehicleMainifist vehicleMainifist = new VehicleMainifist();
vehicleMainifist.setBusinessId(id);
vehicleMainifist.setBusinessNum(frameNo);
... ... @@ -431,6 +588,5 @@ public class LandBusinesstypeListController extends BaseController {
}
}
}
}
\ No newline at end of file
... ...
... ... @@ -3,6 +3,9 @@
*/
package com.thinkgem.jeesite.modules.land.web;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
... ... @@ -13,6 +16,7 @@ import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import com.thinkgem.jeesite.common.barCode.buildBarCode;
... ... @@ -83,6 +87,7 @@ public class LandRoadVeRecordController extends BaseController {
String barcode = landRoadVeRecord.getBarcode();
if(barcode ==null) {
String barCode = buildBarCode.crateCar(landRoadVeRecord);
// String barCode = "111";
if("0".equals(barCode)) {
landRoadVeRecord.setReturnmessage("备案成功");
}else {
... ... @@ -90,6 +95,9 @@ public class LandRoadVeRecordController extends BaseController {
}
landRoadVeRecord.setBarcode(barCode);
}
if(landRoadVeRecord.getProposeTime()==null) {
landRoadVeRecord.setProposeTime(new Date());
}
landRoadVeRecordService.save(landRoadVeRecord);
addMessage(redirectAttributes, "保存备案成功");
return "redirect:"+Global.getAdminPath()+"/land/landRoadVeRecord/?repage";
... ... @@ -103,5 +111,22 @@ public class LandRoadVeRecordController extends BaseController {
addMessage(redirectAttributes, "删除备案成功");
return "redirect:"+Global.getAdminPath()+"/land/landRoadVeRecord/?repage";
}
@RequiresPermissions("land:landRoadVeRecord:edit")
@RequestMapping(value = "selectByVeName")
@ResponseBody
public Page<LandRoadVeRecord> selectByVeName(String veName){
Page<LandRoadVeRecord> page = new Page<LandRoadVeRecord>();
Principal principal = UserUtils.getPrincipal();
String loginName = principal.getLoginName();
User user = systemService.getUserByLoginName(loginName);
List<LandRoadVeRecord> veList = landRoadVeRecordService.selectByFrameNo(veName);
if(veList.size()>0) {
page.setCount(1L);
}
return page;
}
}
\ No newline at end of file
... ...
... ... @@ -10,17 +10,23 @@
#jdbc.password=123456
#mysql database setting
jdbc.type=mysql
jdbc.driver=com.mysql.cj.jdbc.Driver
jdbc.url=jdbc:mysql://10.50.7.70:3306/station?useUnicode=true&characterEncoding=utf8&autoReconnect=true&failOverReadOnly=false&allowMultiQueries=true&useSSL=true&serverTimezone=Asia/Shanghai
jdbc.username=station
jdbc.password=station@10.50.7.70
#jdbc.type=mysql
#jdbc.driver=com.mysql.cj.jdbc.Driver
#jdbc.url=jdbc:mysql://10.50.7.70:3306/station?useUnicode=true&characterEncoding=utf8&autoReconnect=true&failOverReadOnly=false&allowMultiQueries=true&useSSL=true&serverTimezone=Asia/Shanghai
#jdbc.username=station
#jdbc.password=station@10.50.7.70
#jdbc.type=mysql
#jdbc.driver=com.mysql.cj.jdbc.Driver
#jdbc.url=jdbc:mysql://localhost:3306/station?characterEncoding=utf8&useSSL=false&serverTimezone=UTC&rewriteBatchedStatements=true
#jdbc.username=root
#jdbc.password=root
#jdbc.url=jdbc:mysql://10.50.7.10:3306/station?useUnicode=true&characterEncoding=utf8&autoReconnect=true&failOverReadOnly=false&allowMultiQueries=true&useSSL=true&serverTimezone=Asia/Shanghai
#jdbc.username=kako
#jdbc.password=mysql10.50.7.10
jdbc.type=mysql
jdbc.driver=com.mysql.cj.jdbc.Driver
jdbc.url=jdbc:mysql://localhost:3306/station?characterEncoding=utf8&useSSL=false&serverTimezone=UTC&rewriteBatchedStatements=true
jdbc.username=root
jdbc.password=root
#mssql database settings
#jdbc.type=mssql
... ... @@ -47,7 +53,7 @@ redis.port=6379
#============================#
#\u4ea7\u54c1\u4fe1\u606f\u8bbe\u7f6e
productName=\u6D77\u5173\u8F85\u52A9\u7BA1\u7406\u7CFB\u7EDF
productName=\u673A\u573A\u53E3\u5CB8\u901A\u5173\u7269\u6D41\u8F85\u52A9\u7BA1\u7406\u7CFB\u7EDF
copyrightYear=2018
#version=V1.2.7
... ...
... ... @@ -56,8 +56,12 @@
<if test="trailerFrameNo !=null and trailerFrameNo !=''">
and trailer_frame_no = #{trailerFrameNo}
</if>
<!-- <if test='createBy.id !="1" and createBy.id !=null and createBy.id !=""'>
and create_by = #{createBy.id}
</if> -->
order by a.create_date DESC
</select>
<select id="findByBarcode" resultType="LandBusinesstypeList">
SELECT
<include refid="landBusinesstypeListColumns"/>
... ... @@ -69,7 +73,17 @@
</if>
order by a.create_date DESC
</select>
<select id="findByMessageId" resultType="LandBusinesstypeList">
SELECT
<include refid="landBusinesstypeListColumns"/>
FROM land_businesstype_list a
<include refid="landBusinesstypeListJoins"/>
where a.is_delete = "0"
<if test="massageId !=null and massageId !=''">
and massage_id = #{massageId}
</if>
order by a.create_date DESC
</select>
<select id="findList" resultType="LandBusinesstypeList">
SELECT
<include refid="landBusinesstypeListColumns"/>
... ... @@ -77,6 +91,24 @@
<include refid="landBusinesstypeListJoins"/>
<where>
a.is_delete = "0"
<if test='trailerFrameNo !="1" and trailerFrameNo !=null and trailerFrameNo !=""'>
and trailer_frame_no = #{trailerFrameNo}
</if>
<if test='(createBy.id !="1" and createBy.id !=null and createBy.id !="")'>
and create_by = #{createBy.id}
</if>
<if test="endstation !=null and endstation !=''">
and endstation = #{endstation}
</if>
<if test="contrastflag !=null and contrastflag !=''">
and contrastflag = #{contrastflag}
</if>
<if test="aisle !=null and aisle !=''">
and aisle = #{aisle}
</if>
<if test="agentname !=null and agentname !=''">
and agentname like "%"#{agentname}"%"
</if>
</where>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
... ... @@ -110,6 +142,11 @@
UPDATE land_businesstype_list set is_delete = "1",isvalid = "1"
WHERE barcode = #{barcode}
</update>
<update id="deleteByMessageId" parameterType="java.lang.String">
DELETE FROM land_businesstype_list
WHERE massage_id = #{massageId}
</update>
<insert id="insert">
INSERT INTO land_businesstype_list(
... ... @@ -211,6 +248,38 @@
remark2 = #{remark2}
WHERE id = #{id}
</update>
<update id="updateEntry">
UPDATE land_businesstype_list SET
massage_id = #{massageId},
trailer_frame_no = #{trailerFrameNo},
trailer_license_no = #{trailerLicenseNo},
master_list = #{masterList},
prodect_time = #{prodectTime},
is_delete = #{isDelete},
agentno = #{agentno},
agentname = #{agentname},
cocode = #{cocode},
drivername = #{drivername},
driverid = #{driverid},
startport = #{startport},
endport = #{endport},
startsatation = #{startsatation},
endstation = #{endstation},
aisle = #{aisle},
businesstype = #{businesstype},
turnoverflag = #{turnoverflag},
barcode = #{barcode},
contrastflag = #{contrastflag},
update_by = #{updateBy.id},
update_date = #{updateDate},
isvalid = #{isvalid},
aislewt = #{aislewt},
isfull = #{isfull},
remark = #{remark},
remark1 = #{remark1},
remark2 = #{remark2}
WHERE id = #{id}
</update>
<update id="delete">
DELETE FROM land_businesstype_list
... ...
... ... @@ -81,14 +81,14 @@
<include refid="landRoadVeRecordColumns"/>
FROM land_road_ve_record a
<include refid="landRoadVeRecordJoins"/>
<where>
<trim prefix="WHERE" prefixOverrides="and">
<if test='domesticLisenceNo !="1" and domesticLisenceNo !=null and domesticLisenceNo !=""'>
domestic_lisence_no = #{domesticLisenceNo}
and domestic_lisence_no = #{domesticLisenceNo}
</if>
<if test='createBy.id !="1" and createBy.id !=null and createBy.id !=""'>
create_by = #{createBy.id}
and create_by = #{createBy.id}
</if>
</where>
</trim>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
... ...
... ... @@ -104,10 +104,10 @@ th, td {
<div class="span6">
<label class="control-label">车牌号:</label>
<div class="controls">
<form:select path="trailerFrameNo" htmlEscape="false" maxlength="64" class="input-xlarge required" id="frameNo" >
<form:option value="" label="--请选择--" />
<form:input path="trailerFrameNo" htmlEscape="false" maxlength="64" class="input-xlarge required" id="frameNo" />
<%-- <form:option value="" label="--请选择--" />
<form:options items="${veList}" itemLabel="domesticLisenceNo" itemValue="domesticLisenceNo" htmlEscape="false" />
</form:select>
</form:select> --%>
<span class="help-inline"><font color="red">*</font></span>
<span class="help-inline" id="message" style="color: red"></span>
</div>
... ... @@ -119,16 +119,16 @@ th, td {
<form:option value="" label="--请选择--" />
<form:option value="进口提货" label="进口提货" />
<form:option value="出口送货" label="出口送货" />
<form:option value="进口流转" label="进口流转" />
<form:option value="出口流转" label="出口流转" />
<form:option value="分拨业务" label="分拨业务" />
<form:option value="调拨业务" label="调拨业务" />
</form:select>
<span class="help-inline"><font color="red">*</font></span>
</div>
</div>
</div>
</div>
</div>
<div class="control-group">
<%-- <div class="control-group">
<div class="row-fluid">
<div class="span12">
<div class="span6">
... ... @@ -141,28 +141,28 @@ th, td {
</div>
</div>
<div class="span6">
<%-- <label class="control-label">所在企业代码:</label>
<label class="control-label">所在企业代码:</label>
<div class="controls">
<form:input path="cocode" htmlEscape="false" maxlength="32"
class="input-xlarge " id="cocode" />
<span class="help-inline"><font color="red">*</font></span>
</div> --%>
</div>
</div>
</div>
</div>
</div>
</div> --%>
<div class="control-group">
<div class="row-fluid">
<div class="span12">
<div class="span6">
<label class="control-label">货代代码</label>
<label class="control-label">运输公司</label>
<div class="controls">
<form:input path="agentno" htmlEscape="false" maxlength="32"
class="input-xlarge" id="agentno" style="disabled:true"/>
</div>
</div>
<div class="span6">
<label class="control-label">货代名称</label>
<label class="control-label">挂靠单位</label>
<div class="controls">
<form:input path="agentname" htmlEscape="false" maxlength="255"
class="input-xlarge" id="agentName" />
... ... @@ -171,7 +171,7 @@ th, td {
</div>
</div>
</div>
<div class="control-group">
<div class="control-group" style="display:none">
<div class="row-fluid">
<div class="span12">
<div class="span6">
... ... @@ -200,21 +200,21 @@ th, td {
<form:select path="startport" class="input-xlarge ">
<form:option value="" label="--请选择--" />
<form:option value="4604" label="4604" />
<form:option value="4613" label="4613" />
<form:option value="4620" label="4620" />
</form:select>
<span class="help-inline"><font color="red">流转业务填写,其他业务可不填写</font></span>
<span class="help-inline"><font color="red">分拨、调拨业务填写</font></span>
</div>
</div>
<div class="span6">
<label class="control-label">目的关区代码</label>
<label class="control-label">起始场站</label>
<div class="controls">
<form:select path="endport" class="input-xlarge ">
<form:select path="startsatation" class="input-xlarge"
id="st_select">
<form:option value="" label="--请选择--" />
<form:option value="4604" label="4604" />
<form:option value="4613" label="4613" />
<form:option value="4620" label="4620" />
<form:options items="${yardList}" itemLabel="name"
itemValue="stationid" htmlEscape="false" />
</form:select>
<span class="help-inline"><font color="red">分拨、调拨业务填写</font></span>
</div>
</div>
</div>
... ... @@ -225,25 +225,25 @@ th, td {
<div class="row-fluid">
<div class="span12">
<div class="span6">
<label class="control-label">起始场站</label>
<label class="control-label">目的关区代码</label>
<div class="controls">
<form:select path="startsatation" class="input-xlarge"
id="st_select">
<form:select path="endport" class="input-xlarge ">
<form:option value="" label="--请选择--" />
<form:options items="${yardList}" itemLabel="name"
itemValue="stationid" htmlEscape="false" />
<form:option value="4604" label="4604" selected = "selected"/>
<form:option value="4620" label="4620" />
</form:select>
<span class="help-inline"><font color="red">流转业务填写,其他业务可不填写</font></span>
</div>
</div>
<div class="span6">
</label> <label class="control-label">目的场站:</label>
<div class="controls">
<form:select path="endstation" class="input-xlarge" id="en_select">
<form:select path="endstation" class="input-xlarge required" id="en_select">
<form:option value="" label="--请选择--" />
<form:options items="${yardList}" itemLabel="name"
itemValue="stationid" htmlEscape="false" />
</form:select>
<span class="help-inline"><font color="red">*</font></span>
</div>
</div>
</div>
... ... @@ -255,11 +255,12 @@ th, td {
<div class="span6">
<label class="control-label">目的场站通道/卡口:</label>
<div class="controls">
<form:select path="aisle" class="input-xlarge" id="aisle">
<form:select path="aisle" class="input-xlarge required" id="aisle">
<form:option value="" label="--请选择--" />
<form:options items="${bayonets}" itemLabel="name"
itemValue="channel" htmlEscape="false" />
</form:select>
<span class="help-inline"><font color="red">*</font></span>
</div>
</div>
<div class="span6">
... ... @@ -289,19 +290,18 @@ th, td {
<div class="control-group">
<label class="control-label">主单列表:</label>
<div class="controls">
<form:textarea path="masterList" rows="5" maxlength="1000"
<form:textarea path="masterList" rows="5" maxlength="1000" id="masterList"
placeholder="请输入主单号,例如172-12341234,多个单号以“,”(英文)分割"
class="input-xxlarge textarea" />
</div>
</div>
<div class="form-actions">
<div class="form-actions" id="btnAll">
<shiro:hasPermission name="land:landBusinesstypeList:edit">
<input id="btnSubmit" class="btn btn-primary" type="submit"
value="保 存" />&nbsp;
<input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存" />&nbsp;
</shiro:hasPermission>
<input id="btnCancel" class="btn" type="button" value="返 回"
onclick="history.go(-1)" />
<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)" />
</div>
</form:form>
<style>
</style>
... ... @@ -316,7 +316,13 @@ th, td {
}
});
})
$("#frameNo").change(function(){
$("#masterList").blur(function(){
var masterList = $("#masterList").val();
if(masterList.indexOf(",")!=-1){
$("#masterList").val(masterList.replace(/,/g,","));
}
})
$("#frameNo").blur(function(){
var frameNo = $("#frameNo").val();
if(frameNo !=null && frameNo !="" ){
$.ajax({
... ... @@ -328,17 +334,27 @@ th, td {
var index = data.html.lastIndexOf(">");
var str = data.html.substring(index + 1, data.html.length);
if(data.list !=undefined){
$("#agentName").val(data.list[0].proposer)
$("#agentno").val(data.list[0].coCode)
$("#agentName").val(data.list[0].proposer)
$("#agentno").val(data.list[0].coCode)
$("#driverid").val(data.list[0].veOwnerNo)
$("#drivername").val(data.list[0].veOwnerName)
if(str.indexOf("已存在进出场")!=-1){
$("#btnAll").css("display","none");
}
}
if(data.list ==undefined){
$("#agentName").val("");
$("#agentno").val("");
$("#agentName").val("");
$("#agentno").val("");
$("#driverid").val("");
$("#drivername").val("");
}
if(str.indexOf("车辆未备案")!=-1){
$("#btnAll").css("display","none");
}
if(str.indexOf("正常")!=-1){
$("#btnAll").css("display","block");
}
$("#message").html(str);
},
error:function(data){
... ... @@ -375,7 +391,7 @@ th, td {
</script>
<script type="text/javascript">
$("#putMaster").blur(function(){
/* $("#putMaster").blur(function(){
var master = $("#putMaster").val();
var str = parseInt(master.substring(4,11));
var endStr = parseInt(master.substring(11));
... ... @@ -384,14 +400,30 @@ th, td {
$("#error_p").html("输入主单号不符合模七校验");
//$("#putMaster").val(" ");
}
})
}) */
$("#select").click(function(){
var masterNum = $("#putMaster").val();
var ieType=$("#ieType").val();
if(masterNum.length<1 || ieType.length<1){
return false;
}
if(masterNum.indexOf("-")==-1){
masterNum = masterNum.substr(0,3)+"-"+masterNum.substr(3);
}
var str = parseInt(masterNum.substring(4,11));
var endStr = parseInt(masterNum.substring(11));
if(str%7 != endStr){
$(".error_div").css("display","block");
$("#error_p").html("输入主单号不符合模七校验");
//$("#putMaster").val(" ");
return false;
}
if(ieType=="进口提货" | ieType=="进口流转" ){
if(ieType=="进口提货" | ieType=="分拨业务" ){
ieType="I";
}else if(ieType=="出口送货" | ieType=="出口流转"){
}else if(ieType=="出口送货" | ieType=="调拨业务"){
ieType="E";
}
var url = "http://tjfx.15miaoo.com:8003/tj/orig/orig";
... ... @@ -406,27 +438,38 @@ th, td {
var flightNo = "";
var flightDate = "";
var data = JSON.parse(xhr.responseText);
if(ieType=="I"){
flightNo = data[0].flightno;
flightDate = timeFormat(data[0].flightDate).substring(0,10);
}else{
flightNo = data[0].carrier+data[0].flightno
flightDate = timeFormat(data[0].flightdate).substring(0,10)
for(var i = 0;i<data.length;i++ ){
console.log(data[i])
console.log()
if(data[i].receiptinformation!=undefined){
if(data[i].receiptinformation.indexOf("41301")!=-1 || data[i].receiptinformation.indexOf("41106")!=-1 ||
data[i].receiptinformation.indexOf("31301")!=-1 || data[i].receiptinformation.indexOf("31106")!=-1 ||
data[i].receiptinformation.indexOf("提运单放行")!=-1 ){
if(ieType=="I"){
flightNo = data[i].flightno;
flightDate = timeFormat(data[i].flightDate).substring(0,10);
}else{
flightNo = data[i].carrier+data[i].flightno
flightDate = timeFormat(data[i].flightdate).substring(0,10)
}
$("#tableInfo").children("tr").remove();
var str = '<tr>'+
'<td><button class="btn btn-primary" onclick="addData(this);">添加</button></td>'+
'<td>'+flightNo+'</td>'+
'<td>'+flightDate+'</td>'+
'<td>'+data[i].originatingstation+"-"+data[0].destinationstation+'</td>'+
'<td>'+data[i].waybillnomaster+'</td>'+
'<td>'+data[i].totalpiece +'</td>'+
'<td>'+data[i].totalweight +'</td>'+
'<td>'+data[i].customscode+'</td>'+
'<td>'+timeFormat(data[i].createdate) +'</td>'+
'<td>'+data[i].receiptinformation +'</td>'+
'</tr>';
$("#tableInfo").append(str);
}
}
}
$("#tableInfo").children("tr").remove();
var str = '<tr>'+
'<td><button class="btn btn-primary" onclick="addData(this);">添加</button></td>'+
'<td>'+flightNo+'</td>'+
'<td>'+flightDate+'</td>'+
'<td>'+data[0].originatingstation+"-"+data[0].destinationstation+'</td>'+
'<td>'+data[0].waybillnomaster+'</td>'+
'<td>'+data[0].totalpiece +'</td>'+
'<td>'+data[0].totalweight +'</td>'+
'<td>'+data[0].customscode+'</td>'+
'<td>'+timeFormat(data[0].createdate) +'</td>'+
'<td>'+data[0].receiptinformation +'</td>'+
'</tr>';
$("#tableInfo").append(str);
}
}
}
... ...
... ... @@ -14,6 +14,29 @@
$("#searchForm").submit();
return false;
}
function change(){
var st_select = $("#station").val();
$.ajax({
type:"post",
url:"${ctx}/land/landBusinesstypeList/option",
data:{st_select,st_select},
dataType:"json",
success:function(data){
$("#aisle").val("");
$("#aisle").empty();
for(var i=0;i<data.list.length;i++){
var option = document.createElement("option");
$(option).val(data.list[i].channel);
$(option).text(data.list[i].name);
$("#aisle").append(option);
}
},
error:function(data){
$(".error_div").css("display","block");
$("#error_p").html(data);
}
})
}
</script>
</head>
<body>
... ... @@ -28,7 +51,29 @@
<ul class="ul-form">
<li>
<label>车牌号:</label>
<form:input path="trailerFrameNo" htmlEscape="false" maxlength="32" class="input-medium"/>
<form:input path="trailerFrameNo" htmlEscape="false" maxlength="10" class="input-small"/>
<label>挂靠名称:</label>
<form:input path="agentname" htmlEscape="false" maxlength="32" class="input-small"/>
<label>目的场站:</label>
<form:select path="endstation" class="input" id="station" onchange="change()">
<form:option value="" label="--请选择--" />
<form:options items="${yardList}" itemLabel="name" itemValue="stationid" htmlEscape="false" />
</form:select>
<label>卡口:</label>
<form:select path="aisle" class="input" id="aisle">
<form:option value="" label="--请选择--" />
</form:select>
<label>是否出站</label>
<form:select path="contrastflag" class="input">
<form:option value="" label="--请选择--" />
<form:option value="已进站" label="已进站" />
<form:option value="已出站" label="已出站" />
</form:select>
</li>
<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/></li>
<li class="clearfix"></li>
... ... @@ -38,14 +83,18 @@
<table id="contentTable" class="table table-striped table-bordered table-condensed">
<thead>
<tr>
<shiro:hasRole name="dept">
<th>操作</th>
</shiro:hasRole>
<th>车牌号</th>
<th>货代名称</th>
<th>起始海关代码</th>
<th>起始关区</th>
<th>挂靠单位</th>
<th>目的海关代码</th>
<th>目的关区</th>
<th>卡口</th>
<th>地磅称重</th>
<th>总货重</th>
<th>业务类型</th>
<th>二维码编号</th>
<th>进出场站</th>
<th>已进已出</th>
<th>更新时间</th>
... ... @@ -55,36 +104,33 @@
<tbody>
<c:forEach items="${page.list}" var="landBusinesstypeList">
<tr>
<shiro:hasRole name="dept">
<td>
<a href="${ctx}/land/landBusinesstypeList/form?id=${landBusinesstypeList.id}">
${landBusinesstypeList.trailerFrameNo}
</a>
</td>
<td>${landBusinesstypeList.agentname}</td>
<td>${landBusinesstypeList.startport}</td>
<td>
<c:if test='${landBusinesstypeList.startsatation =="4604000000"}'>西货站</c:if>
<c:if test='${landBusinesstypeList.startsatation =="4604499001"}'>军投货站</c:if>
<c:if test='${landBusinesstypeList.startsatation =="4604511001"}'>快邮站</c:if>
<a href="${ctx}/land/landBusinesstypeList/form?id=${landBusinesstypeList.id}">查看</a>
</td>
</shiro:hasRole>
<td>${landBusinesstypeList.trailerFrameNo}</td>
<td>${landBusinesstypeList.agentname}</td>
<td>${landBusinesstypeList.endport}</td>
<td>
<c:if test='${landBusinesstypeList.endstation =="4604000000"}'>西货站</c:if>
<c:if test='${landBusinesstypeList.endstation =="4604499001"}'>军投货站</c:if>
<c:if test='${landBusinesstypeList.endstation =="4604511001"}'>快邮站</c:if>
<c:if test='${landBusinesstypeList.endstation =="4604499001"}'>三号货站</c:if>
<c:if test='${landBusinesstypeList.endstation =="4604511001"}'>快邮货站</c:if>
</td>
<td>
<c:if test="${landBusinesstypeList.aisle =='4604333311'}">1号卡口-进</c:if>
<c:if test="${landBusinesstypeList.aisle =='4604111111'}">1号卡口-进</c:if>
<c:if test="${landBusinesstypeList.aisle =='4604444411'}">1号卡口-进</c:if>
<c:if test="${landBusinesstypeList.aisle =='4604333321'}">2号卡口-进</c:if>
<c:if test="${landBusinesstypeList.aisle =='4604333312'}">1号卡口-出</c:if>
<c:if test="${landBusinesstypeList.aisle =='4604444412'}">1号卡口-出</c:if>
<c:if test="${landBusinesstypeList.aisle =='4604110112'}">1号卡口-出</c:if>
<c:if test="${landBusinesstypeList.aisle =='4604333322'}">2号卡口-出</c:if>
<c:if test="${landBusinesstypeList.aisle =='4604333321'}">暂不启用</c:if>
<c:if test="${landBusinesstypeList.aisle =='4604333322'}">暂不启用</c:if>
</td>
<td>${landBusinesstypeList.aislewt}</td>
<td>${landBusinesstypeList.remark}</td>
<td>${landBusinesstypeList.businesstype}</td>
<td>${landBusinesstypeList.barcode}</td>
<td>
<c:if test="${landBusinesstypeList.turnoverflag =='E'}">出场站</c:if>
<c:if test="${landBusinesstypeList.turnoverflag =='I'}">进场站</c:if>
... ...
... ... @@ -84,7 +84,15 @@ input {
class="input-large" id="mainPort" value="4604"/>
<span class="help-inline"><font color="red">*</font></span>
</div>
<label class="row-lable">海关货代备案代码:</label>
</div>
<div class="control-group">
<label class="row-lable">挂靠单位:</label>
<span class="row-controls">
<form:input path="proposer" htmlEscape="false" maxlength="32"
class="input-large required" />
<span class="help-inline"><font color="red">*</font></span>
</span>
<label class="row-lable">运输公司名称:</label>
<div class="row-controls">
<form:input path="coCode" htmlEscape="false" maxlength="20"
class="input-large required" />
... ... @@ -95,8 +103,8 @@ input {
<label class="row-lable">国内车牌:</label>
<span class="row-controls">
<form:input path="domesticLisenceNo" htmlEscape="false"
maxlength="32" class="input-large required" /> <span
class="help-inline"><font color="red">*</font></span>
maxlength="32" class="input-large required" id ="vename"/> <span
class="help-inline"><font color="red">*<span id="returnMsg"></span></font></span>
</span>
<label class="row-lable">车主姓名:</label>
<span class="row-controls">
... ... @@ -106,16 +114,24 @@ input {
</span>
</div>
<div class="control-group">
<label class="row-lable">车主证件号码:</label> <span
<%-- <label class="row-lable">车主证件号码:</label> <span
class="row-controls"> <form:input path="veOwnerNo"
htmlEscape="false" maxlength="32" class="input-large required" />
<span class="help-inline"><font color="red">*</font></span>
<span class="help-inline"><font color="red">*</font></span> --%>
</span> <label class="row-lable">车主联系电话:</label> <span
class="row-controls"> <form:input path="ownerInsideTel"
htmlEscape="false" maxlength="32"
class="input-large required" /> <span class="help-inline"><font
color="red">*</font></span>
</span>
<label class="row-lable">行驶证有效期:</label>
<span class="row-controls">
<input name="VE_FACTORY_DATE" type="text" readonly="readonly"
maxlength="20" class="input-medium Wdate required"
value="<fmt:formatDate value="${landRoadVeRecord.proposeTime}" pattern="yyyy-MM-dd HH:mm:ss"/>"
onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});" />
<span class="help-inline"><font color="red">*</font></span>
</span>
</div>
<div class="control-group">
<label class="row-lable">自重(空车重量):</label>
... ... @@ -130,22 +146,22 @@ input {
class="input-large numberCheck" placeholder="货车核载单位为:kg" />
</span>
</div>
<div class="control-group">
<label class="row-lable">货代名称:</label>
<%-- <div class="control-group">
<%-- <label class="row-lable">货代名称:</label>
<span class="row-controls">
<form:input path="proposer" htmlEscape="false" maxlength="32"
class="input-large required" />
<span class="help-inline"><font color="red">*</font></span>
</span>
<label class="row-lable">申请时间:</label>
<label class="row-lable">申请时间:</label>
<span class="row-controls">
<input name="proposeTime" type="text" readonly="readonly"
<input name="VE_FACTORY_DATE" type="text" readonly="readonly"
maxlength="20" class="input-medium Wdate required"
value="<fmt:formatDate value="${landRoadVeRecord.proposeTime}" pattern="yyyy-MM-dd HH:mm:ss"/>"
onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});" />
<span class="help-inline"><font color="red">*</font></span>
</span>
</div>
</div> --%>
<div class="control-group">
<label class="row-lable">挂车牌号:</label>
<span class="row-controls">
... ... @@ -165,12 +181,38 @@ input {
maxlength="512" class="input-xxlarge" />
</span>
</div>
<div class="form-actions">
<div class="form-actions" id="btnAll">
<shiro:hasPermission name="land:landRoadVeRecord:edit">
<input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存" />&nbsp;
</shiro:hasPermission>
<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)" />
</div>
</form:form>
<script type="text/javascript">
$("#vename").on("blur",function(){
var veName = $("#vename").val();
if(veName.length>0){
$.ajax({
type:"post",
url:"${ctx}/land/landRoadVeRecord/selectByVeName",
data:{veName:veName},
dataType:"json",
success:function(data){
if(data.count===1){
$("#returnMsg").html("车辆已备案");
$("#btnAll").css("display","none");
}else{
$("#returnMsg").html("");
}
},
error:function(data){
console.log(data)
}
})
}
})
</script>
</body>
</html>
\ No newline at end of file
... ...
... ... @@ -37,15 +37,15 @@
<table id="contentTable" class="table table-striped table-bordered table-condensed">
<thead>
<tr>
<th>企业代码</th>
<th>运输公司名称</th>
<th>挂靠单位</th>
<th>国内车牌</th>
<th>车主姓名</th>
<th>车主证件号</th>
<th>批准车辆进出口岸</th>
<th>车辆类型</th>
<th>车主联系方式</th>
<th>本地关代码</th>
<th>自重</th>
<th>最大牵引重量</th>
<th>车辆分类</th>
<th>载重</th>
<th>备案结果</th>
<th>更新时间</th>
<shiro:hasPermission name="land:landRoadVeRecord:edit"><th>操作</th></shiro:hasPermission>
</tr>
... ... @@ -54,21 +54,22 @@
<c:forEach items="${page.list}" var="landRoadVeRecord">
<tr>
<td>${landRoadVeRecord.coCode }</td>
<td>${landRoadVeRecord.proposer }</td>
<td>${landRoadVeRecord.domesticLisenceNo }</td>
<td>${landRoadVeRecord.veOwnerName }</td>
<td>${landRoadVeRecord.veOwnerNo }</td>
<td>${landRoadVeRecord.allowVeIePort }</td>
<td>${landRoadVeRecord.veType }</td>
<td>${landRoadVeRecord.ownerInsideTel }</td>
<td>${landRoadVeRecord.mainPort }</td>
<td>${landRoadVeRecord.selfWt }</td>
<td>${landRoadVeRecord.allowTowTotalWt }</td>
<td>${landRoadVeRecord.veClassFlag }</td>
<td>${landRoadVeRecord.veTon }</td>
<td>${landRoadVeRecord.returnmessage }</td>
<td><a href="${ctx}/land/landRoadVeRecord/form?id=${landRoadVeRecord.id}">
<fmt:formatDate value="${landRoadVeRecord.updateDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
</a></td>
<shiro:hasPermission name="land:landRoadVeRecord:edit"><td>
<a href="${ctx}/land/landRoadVeRecord/form?id=${landRoadVeRecord.id}">修改</a>
<a href="${ctx}/land/landRoadVeRecord/delete?id=${landRoadVeRecord.id}" onclick="return confirmx('确认要删除该备案吗?', this.href)">删除</a>
<shiro:hasRole name="dept">
<a href="${ctx}/land/landRoadVeRecord/delete?id=${landRoadVeRecord.id}" onclick="return confirmx('确认要删除该备案吗?', this.href)">删除</a>
</shiro:hasRole>
</td></shiro:hasPermission>
</tr>
</c:forEach>
... ...