作者 申海龙

。。。。。。。。。。。。。。。。。。。。。。。

... ... @@ -1012,6 +1012,7 @@ public class ManifestController extends BasicController {
manifest.setCarrier(carrier);
manifest.setFlightno(flightno);
manifest.setResponse_text("已暂存预配舱单");
// consigneeService.saveFromManifest(manifest, Tools.getUserId());
// consignorService.saveFromManifest(manifest, Tools.getUserId());
... ...
... ... @@ -15,6 +15,7 @@ import com.agent.vo.agent.SDVo;
import com.agent.vo.agent.SecurityDeclarationVo;
import com.agent.xml.XmlBuildTask;
import com.framework.core.Servlets;
import com.framework.mail.MailSenderService;
import com.framework.util.MessageKit;
import com.framework.util.MessageType;
import com.framework.util.StringUtils;
... ... @@ -29,6 +30,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import tools.Tools;
import javax.print.attribute.standard.ReferenceUriSchemesSupported;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
... ... @@ -37,6 +39,7 @@ import java.net.URL;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
... ... @@ -129,6 +132,14 @@ public class SecurityDeclarationController {
}
/**
* 跳转国际安检申报添加
*/
@RequestMapping(value = "/inlandSaveView")
public String inlandSaveView(){
return "declaration/inlandsave";
}
/**
* 保存并发送报文
* @param request
* @param waybill
... ... @@ -153,10 +164,15 @@ public class SecurityDeclarationController {
//货物品名
String cargoName = request.getParameter("sd_cargo_name");
//运输条件鉴定书
String transportCertificate = request.getParameter("sd_transport_certificate");
String transportCertificate = "";
if ( request.getParameter("sd_transport_certificate") != null){
transportCertificate = request.getParameter("sd_transport_certificate");
}
//航空公司同意运输证明
String transportationProve = request.getParameter("sd_transportation_prove");
String transportationProve = "";
if (request.getParameter("sd_transportation_prove") != null){
transportationProve = request.getParameter("sd_transportation_prove");
}
//货物性质是否多选
List<String> list = new ArrayList();
if (!StringUtils.isBlank(one)){
... ... @@ -250,6 +266,223 @@ public class SecurityDeclarationController {
/**
* 保存并发送报文
* @param request
* @return
*/
@RequestMapping(value = "/inlandsave")
@ResponseBody
public ResponseModel inlandsave(HttpServletRequest request) throws ParseException {
ResponseModel model = new ResponseModel();
/**
* 预配
*/
//订单号
String waybill = "";
String waybill1 = request.getParameter("waybill");
if (waybill1.contains("-")){
waybill = waybill1;
}else {
String substring = waybill1.substring(0, waybill1.length() - 8);
String substring1 = waybill1.substring(3);
waybill = substring+"-"+substring1;
}
//承运人公司
String carrier = request.getParameter("carrier");
//航班号
String flightno = request.getParameter("flightno");
//航班日期
String flightdates = request.getParameter("flightdate");
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
Date flightdate = simpleDateFormat.parse(flightdates);
//公斤
String totalweight = request.getParameter("totalweight");
//件数
String totalpiece = request.getParameter("totalpiece");
//目的地
String destinationstation = request.getParameter("destinationstation");
/**
* 安检申报
*/
//货物性质(类型)
String one = request.getParameter("one");
String two = request.getParameter("two");
String three = request.getParameter("three");
String four = request.getParameter("four");
//航空货物托运人名称
String cargoShipperName = request.getParameter("sd_cargo_shipper_name");
//航空货运销售代理人名称
String cargoAgentName = request.getParameter("sd_cargo_agent_name");
//航协编号
String iataNumber = request.getParameter("sd_iata_number");
//货物品名
String cargoName = request.getParameter("sd_cargo_name");
//运输条件鉴定书
String transportCertificate = "";
if ( request.getParameter("sd_transport_certificate") != null){
transportCertificate = request.getParameter("sd_transport_certificate");
}
//航空公司同意运输证明
String transportationProve = "";
if (request.getParameter("sd_transportation_prove") != null){
transportationProve = request.getParameter("sd_transportation_prove");
}
//货物性质是否多选
List<String> list = new ArrayList();
if (!StringUtils.isBlank(one)){
list.add(one);
}
if (!StringUtils.isBlank(two)){
list.add(two);
}
if (!StringUtils.isBlank(three)){
list.add(three);
}
if (!StringUtils.isBlank(four)){
list.add(four);
}
//查询是否存在
if (securityDeclarationService.findWaybill(waybill) == 0 && manifestService.findWbm(waybill) == null){
//货物性质(类型)添加
for (String type: list){
SDCargoTypeEntity sdCargoTypeEntity = new SDCargoTypeEntity();
sdCargoTypeEntity.setSd_waybill(waybill);
sdCargoTypeEntity.setSd_cargo_type(type);
sdCargoTypeService.save(sdCargoTypeEntity);
}
//货物品名
String cName = cargoName.replaceAll(",", ",");
String[] split = cName.split(",");
for (int i=0; i<split.length; i++){
if (!StringUtils.isBlank(split[i]) || !"".equals(split[i])){
SDCargoNameEntity sdCargoNameEntity = new SDCargoNameEntity();
sdCargoNameEntity.setSd_waybill(waybill);
sdCargoNameEntity.setSd_cargo_name(split[i]);
sdCargoNameService.save(sdCargoNameEntity);
}
}
UserEntity ue = (UserEntity)SecurityUtils.getSubject().getSession().getAttribute("user");
ManifestEntity manifestEntity = new ManifestEntity();
//添加安检申报
SecurityDeclarationEntity sd = new SecurityDeclarationEntity();
sd.setSd_waybill(waybill);
sd.setSd_cargo_agent_name(cargoAgentName);
sd.setSd_cargo_shipper_name(cargoShipperName);
sd.setSd_iata_number(iataNumber);
sd.setSd_transport_certificate(transportCertificate);
sd.setSd_transportation_prove(transportationProve);
sd.setSd_static("1");
if (ue != null){
if (ue.getId() != null ){
sd.setUSER_ID(ue.getId());
manifestEntity.setUSER_ID(ue.getId());
}
}
securityDeclarationService.save(sd);
// 生成报文并且发送
String ndlrPath = MessageKit.getMessagePath(MessageType.NDLR);
//存放数据Vo
SDVo sdVo = new SDVo();
sdVo.setSd_waybill(waybill);
sdVo.setSd_cargo_agent_name(cargoAgentName);
sdVo.setSd_cargo_shipper_name(cargoShipperName);
sdVo.setSd_iata_number(iataNumber);
sdVo.setSd_transport_certificate(transportCertificate);
sdVo.setSd_transportation_prove(transportationProve);
//品名
sdVo.setSd_cargo_name(cargoName);
//货物类型
String cargoType = "";
for (String s: list){
cargoType+=s+",";
}
sdVo.setSd_cargo_type(cargoType);
//添加预配信息
manifestEntity.setWaybillnomaster(waybill);
manifestEntity.setFlightdate(flightdate);
manifestEntity.setFlightno(flightno);
manifestEntity.setCarrier(carrier);
manifestEntity.setTotalpiece(totalpiece);
manifestEntity.setTotalweight(totalweight);
manifestEntity.setDestinationstation(destinationstation);
manifestService.save(manifestEntity);
//生成报文
sdVo.setFlightno(flightno);
sdVo.setFlightdate(flightdate);
sdVo.setCarrier(carrier);
sdVo.setTotalpiece(totalpiece);
sdVo.setTotalweight(totalweight);
sdVo.setDestinationstation(destinationstation);
new XmlBuildTask(securityDeclarationService.sendNDLRXml(sdVo), ndlrPath).perform();
model.setStatus(200);
}else {
model.setStatus(203);
}
return model;
}
/**
* 查看信息
*/
@RequestMapping(value = "/findone")
public String findOne(Model model, Long id){
String cargoName = "";
String cargoType = "";
SecurityDeclarationEntity sd = securityDeclarationService.findOne(id);
model.addAttribute("sd", sd);
//查询预配
ManifestEntity wbm = manifestService.findWbm(sd.getSd_waybill());
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
String format = simpleDateFormat.format(new Date());
model.addAttribute("date", format);
model.addAttribute("wbm", wbm);
List<SDCargoTypeEntity> sdCargoTypeEntities = sdCargoTypeService.waybillAll(sd.getSd_waybill());
for (SDCargoTypeEntity type: sdCargoTypeEntities){
cargoType+=type.getSd_cargo_type();
}
//货物性质(类型)
model.addAttribute("type", cargoType);
model.addAttribute("types", sdCargoTypeEntities);
List<SDCargoNameEntity> sdCargoNameEntities = sdCargoNameService.waybillAll(sd.getSd_waybill());
for (SDCargoNameEntity sdCargoNameEntity: sdCargoNameEntities){
cargoName+=sdCargoNameEntity.getSd_cargo_name()+",";
}
String name = cargoName.substring(0, cargoName.length() - 1);
model.addAttribute("name", name);
return "declaration/findOne";
}
/**
* 调转编辑页面
*/
@RequestMapping(value = "/edit")
... ... @@ -263,6 +496,12 @@ public class SecurityDeclarationController {
//查询预配
ManifestEntity wbm = manifestService.findWbm(sd.getSd_waybill());
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
String format = simpleDateFormat.format(wbm.getFlightdate());
model.addAttribute("date", format);
model.addAttribute("wbm", wbm);
List<SDCargoTypeEntity> sdCargoTypeEntities = sdCargoTypeService.waybillAll(sd.getSd_waybill());
... ... @@ -286,20 +525,75 @@ public class SecurityDeclarationController {
/**
* 安检申报修改
* @param sd
* @param request
* @param waybill
* @return
*/
@RequestMapping("/update")
@ResponseBody
public ResponseModel update(SecurityDeclarationEntity sd, HttpServletRequest request, String waybill){
public ResponseModel update(HttpServletRequest request) throws ParseException {
ResponseModel model = new ResponseModel();
/**
* 预配
*/
//订单号
String waybill = "";
String waybill1 = request.getParameter("waybill");
if (waybill1.contains("-")){
waybill = waybill1;
}else {
String substring = waybill1.substring(0, waybill1.length() - 8);
String substring1 = waybill1.substring(3);
waybill = substring+"-"+substring1;
}
String id = request.getParameter("id");
//承运人公司
String carrier = request.getParameter("carrier");
//航班号
String flightno = request.getParameter("flightno");
//航班日期
String flightdates = request.getParameter("flightdate");
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
Date flightdate = simpleDateFormat.parse(flightdates);
//公斤
String totalweight = request.getParameter("totalweight");
//件数
String totalpiece = request.getParameter("totalpiece");
//目的地
String destinationstation = request.getParameter("destinationstation");
/**
* 安检申报
*/
//货物性质(类型)
String one = request.getParameter("one");
String two = request.getParameter("two");
String three = request.getParameter("three");
String four = request.getParameter("four");
//航空货物托运人名称
String cargoShipperName = request.getParameter("sd_cargo_shipper_name");
//航空货运销售代理人名称
String cargoAgentName = request.getParameter("sd_cargo_agent_name");
//航协编号
String iataNumber = request.getParameter("sd_iata_number");
//货物品名
String cargoName = request.getParameter("sd_cargo_name");
//运输条件鉴定书
String transportCertificate = "";
if ( request.getParameter("sd_transport_certificate") != null){
transportCertificate = request.getParameter("sd_transport_certificate");
}
//航空公司同意运输证明
String transportationProve = "";
if (request.getParameter("sd_transportation_prove") != null){
transportationProve = request.getParameter("sd_transportation_prove");
}
List<String> list = new ArrayList();
if (!StringUtils.isBlank(one)){
... ... @@ -339,22 +633,40 @@ public class SecurityDeclarationController {
}
}
}
if (securityDeclarationService.update(sd, waybill)>0){
//修改安检申报
UserEntity ue = (UserEntity)SecurityUtils.getSubject().getSession().getAttribute("user");
SecurityDeclarationEntity sd = new SecurityDeclarationEntity();
sd.setId(Long.valueOf(id));
sd.setSd_waybill(waybill);
sd.setSd_cargo_agent_name(cargoAgentName);
sd.setSd_cargo_shipper_name(cargoShipperName);
sd.setSd_iata_number(iataNumber);
sd.setSd_transport_certificate(transportCertificate);
sd.setSd_transportation_prove(transportationProve);
sd.setSd_static("1");
sd.setUSER_ID(ue.getId());
if (securityDeclarationService.update(sd)>0){
model.setStatus(200);
}
// 生成报文并且发送
String ndlrPath = MessageKit.getMessagePath(MessageType.NDLR);
String dlcPath = MessageKit.getMessagePath(MessageType.DLCF);
String sliPath = MessageKit.getMessagePath(MessageType.SLI);
//存放数据Vo
SDVo sdVo = new SDVo();
sdVo.setSd_waybill(waybill);
sdVo.setSd_cargo_agent_name(sd.getSd_cargo_agent_name());
sdVo.setSd_cargo_shipper_name(sd.getSd_cargo_shipper_name());
sdVo.setSd_iata_number(sd.getSd_iata_number());
if (sd.getSd_transport_certificate() != null){
sdVo.setSd_transport_certificate(sd.getSd_transport_certificate());
}
if (sd.getSd_transportation_prove() != null){
sdVo.setSd_transportation_prove(sd.getSd_transportation_prove());
}
//品名
sdVo.setSd_cargo_name(request.getParameter("sd_cargo_name").replaceAll(",", ","));
//货物类型
... ... @@ -364,13 +676,30 @@ public class SecurityDeclarationController {
}
sdVo.setSd_cargo_type(cargoType);
// ManifestEntity wbm = manifestService.findWbm(waybill);
ManifestEntity manifestEntity = new ManifestEntity();
//修改预配信息
// manifestEntity.setId(wbm.getId());
manifestEntity.setWaybillnomaster(waybill);
manifestEntity.setFlightdate(flightdate);
manifestEntity.setFlightno(flightno);
manifestEntity.setCarrier(carrier);
manifestEntity.setTotalpiece(totalpiece);
manifestEntity.setTotalweight(totalweight);
manifestEntity.setDestinationstation(destinationstation);
// if (manifestService.deleteOne(waybill)>0){
// manifestService.save(manifestEntity);
// }
manifestService.update(manifestEntity);
//预配信息
ManifestEntity wbm = manifestService.findWbm(waybill);
sdVo.setFlightno(wbm.getFlightno());
sdVo.setFlightdate(wbm.getFlightdate());
sdVo.setCarrier(wbm.getCarrier());
sdVo.setTotalpiece(wbm.getTotalpiece());
sdVo.setTotalweight(wbm.getTotalweight());
sdVo.setFlightno(flightno);
sdVo.setFlightdate(flightdate);
sdVo.setCarrier(carrier);
sdVo.setTotalpiece(totalpiece);
sdVo.setTotalweight(totalweight);
sdVo.setTotalweight(totalweight);
sdVo.setDestinationstation(destinationstation);
new XmlBuildTask(securityDeclarationService.sendNDLRXml(sdVo), ndlrPath).perform();
... ... @@ -388,6 +717,12 @@ public class SecurityDeclarationController {
//安检申报数据
SecurityDeclarationEntity sd = securityDeclarationService.findOne(id);
if (sd.getSd_transport_certificate() == null){
sd.setSd_transport_certificate("无");
}
if(sd.getSd_transportation_prove() == null){
sd.setSd_transportation_prove("无");
}
model.addAttribute("sd", sd);
//航空公司运输证明
... ... @@ -403,13 +738,12 @@ public class SecurityDeclarationController {
//生成条形码
BarCodeUtil.generateFile(replace, s);
model.addAttribute("path", replace);
//查询预配
ManifestEntity wbm = manifestService.findWbm(sd.getSd_waybill());
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
String format = simpleDateFormat.format(wbm.getFlightdate());
String format = simpleDateFormat.format(new Date());
model.addAttribute("date", format);
//主单数据
model.addAttribute("wbm", wbm);
... ...
... ... @@ -80,9 +80,16 @@ public class HzInfoController {
hzvo.setForShort(hz.getFor_short());
hzvo.setFullName(hz.getFull_name());
hzvo.setContacts(hz.getContacts());
if ("1".equals(hz.getThe_shipper_type())){
// if ("1".equals(hz.getThe_shipper_type())){
// hzvo.setTheShipperType("发货人");
// }else if ("2".equals(hz.getThe_shipper_type())){
// hzvo.setTheShipperType("订舱代理");
// }else {
// hzvo.setTheShipperType("操作代理");
// }
if ("111" == hz.getThe_shipper_type()){
hzvo.setTheShipperType("发货人");
}else if ("2".equals(hz.getThe_shipper_type())){
}else if ("222" == hz.getThe_shipper_type()){
hzvo.setTheShipperType("订舱代理");
}else {
hzvo.setTheShipperType("操作代理");
... ... @@ -136,14 +143,14 @@ public class HzInfoController {
for (String type: list){
switch (type) {
case "1":
if (hzInfoService.forShortShipperType(forshort, "1") == 0) {
case "111":
if (hzInfoService.forShortShipperType(forshort, "111") == 0) {
HZSHIPPERINFORMATIONEntity hzshipperinformationEntity = new HZSHIPPERINFORMATIONEntity();
hzshipperinformationEntity.setFor_short(forshort);
hzshipperinformationEntity.setFull_name(fullname);
hzshipperinformationEntity.setThe_shipper_type("1");
hzshipperinformationEntity.setThe_shipper_type("111");
hzshipperinformationEntity.setContacts(contacts);
hzshipperinformationEntity.setPhone(phone);
hzshipperinformationEntity.setDelete_flag("1");
... ... @@ -154,12 +161,12 @@ public class HzInfoController {
model.setStatus(201);
break;
}
case "2":
if (hzInfoService.forShortShipperType(forshort, "2") == 0) {
case "222":
if (hzInfoService.forShortShipperType(forshort, "222") == 0) {
HZSHIPPERINFORMATIONEntity hzshipperinformationEntity = new HZSHIPPERINFORMATIONEntity();
hzshipperinformationEntity.setFor_short(forshort);
hzshipperinformationEntity.setFull_name(fullname);
hzshipperinformationEntity.setThe_shipper_type("2");
hzshipperinformationEntity.setThe_shipper_type("222");
hzshipperinformationEntity.setContacts(contacts);
hzshipperinformationEntity.setPhone(phone);
hzshipperinformationEntity.setDelete_flag("1");
... ... @@ -170,12 +177,12 @@ public class HzInfoController {
model.setStatus(201);
break;
}
case "3":
if (hzInfoService.forShortShipperType(forshort, "3") == 0) {
case "333":
if (hzInfoService.forShortShipperType(forshort, "333") == 0) {
HZSHIPPERINFORMATIONEntity hzshipperinformationEntity = new HZSHIPPERINFORMATIONEntity();
hzshipperinformationEntity.setFor_short(forshort);
hzshipperinformationEntity.setFull_name(fullname);
hzshipperinformationEntity.setThe_shipper_type("3");
hzshipperinformationEntity.setThe_shipper_type("333");
hzshipperinformationEntity.setContacts(contacts);
hzshipperinformationEntity.setPhone(phone);
hzshipperinformationEntity.setDelete_flag("1");
... ...
... ... @@ -2,8 +2,10 @@ package com.agent.repository.agent;
import com.agent.entity.agent.ManifestEntity;
import java.util.Date;
import java.util.List;
import org.omg.CORBA.PUBLIC_MEMBER;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
... ... @@ -27,24 +29,35 @@ public interface ManifestRepository extends PagingAndSortingRepository<ManifestE
@Transactional
@Modifying
@Query(value = "DELETE FROM MANIFEST WHERE WAYBILLNOMASTER = ?1", nativeQuery = true)
int deleteOne(String waybill);
@Transactional
@Modifying
@Query(value = "UPDATE MANIFEST SET USER_ID =?1 where ID = ?2", nativeQuery = true)
void userUpdate(Long userId, Long ids);
@Query(value = "SELECT * FROM MANIFEST ORDER BY ID DESC", nativeQuery = true)
public List<ManifestEntity> findAll();
List<ManifestEntity> findAll();
@Query(value = "SELECT * FROM MANIFEST WHERE WAYBILLNOMASTER = ?1 and USER_ID=?2 ORDER BY ID DESC", nativeQuery = true)
public List<ManifestEntity> findByMawbNo(String mawbNo, Long user_id);
List<ManifestEntity> findByMawbNo(String mawbNo, Long user_id);
@Query(value = "SELECT * FROM MANIFEST WHERE WAYBILLNOMASTER = ?1 ORDER BY ID DESC", nativeQuery = true)
public List<ManifestEntity> findByMawbNo(String mawbNo);
List<ManifestEntity> findByMawbNo(String mawbNo);
@Query(value = "SELECT * FROM MANIFEST", nativeQuery = true)
public List<ManifestEntity> queryAll();
List<ManifestEntity> queryAll();
@Query(value = "SELECT * FROM MANIFEST WHERE USER_ID=?1", nativeQuery = true)
public List<ManifestEntity> queryByUserId(Long user_id);
List<ManifestEntity> queryByUserId(Long user_id);
@Query(value = "SELECT * FROM MANIFEST WHERE WAYBILLNOMASTER=?1", nativeQuery = true)
public ManifestEntity findWbm(String wbm);
ManifestEntity findWbm(String wbm);
@Transactional
@Modifying
@Query(value = "UPDATE MANIFEST SET WAYBILLNOMASTER=?1, FLIGHTNO=?2, FLIGHTDATE=?3, CARRIER=?4, TOTALPIECE=?5, TOTALWEIGHT=?6, DESTINATIONSTATION=?7 WHERE WAYBILLNOMASTER=?1", nativeQuery = true)
int update(String waybill, String flightno, Date flightdate, String carrier,
String totalpiece, String totalweight, String destinationstation);
}
... ...
... ... @@ -33,13 +33,13 @@ public interface HzInfoRepository extends PagingAndSortingRepository<HZSHIPPERIN
@Query(value = "insert into HZ_SHIPPER_INFORMATION(FOR_SHORT, FULL_NAME, THE_SHIPPER_TYPE, CONTACTS, PHONE, DELETE_FLAG) values(?1, ?2, ?3, ?4, ?5, ?6)", nativeQuery = true)
int saves(String forShort, String fullName, String theShipperType, String contacts, String phone, String deleteFlag);
@Query(value = "select * from HZ_SHIPPER_INFORMATION where the_shipper_type=1 and delete_flag = 1", nativeQuery = true)
@Query(value = "select * from HZ_SHIPPER_INFORMATION where the_shipper_type=111 and delete_flag = 1", nativeQuery = true)
List<HZSHIPPERINFORMATIONEntity> findShipeer();
@Query(value = "select * from HZ_SHIPPER_INFORMATION where the_shipper_type=2 and delete_flag = 1", nativeQuery = true)
@Query(value = "select * from HZ_SHIPPER_INFORMATION where the_shipper_type=222 and delete_flag = 1", nativeQuery = true)
List<HZSHIPPERINFORMATIONEntity> findBooking();
@Query(value = "select * from HZ_SHIPPER_INFORMATION where the_shipper_type=3 and delete_flag = 1", nativeQuery = true)
@Query(value = "select * from HZ_SHIPPER_INFORMATION where the_shipper_type=333 and delete_flag = 1", nativeQuery = true)
List<HZSHIPPERINFORMATIONEntity> findOperaion();
@Query(value = "select * from HZ_SHIPPER_INFORMATION where id=?1 and delete_flag = 1", nativeQuery = true)
... ...
... ... @@ -16,12 +16,15 @@ public interface SecurityDeclarationRepository extends PagingAndSortingRepositor
@Transactional
@Modifying
@Query(value = "update SECURITY_DECLARATION set SD_WAYBILL=?2, SD_CARGO_SHIPPER_NAME=?4, SD_CARGO_AGENT_NAME=?3, SD_IATA_NUMBER=?5, SD_TRANSPORT_CERTIFICATE=?6, SD_TRANSPORTATION_PROVE=?7 where id=?1", nativeQuery = true)
@Query(value = "update SECURITY_DECLARATION set SD_WAYBILL=?2, SD_CARGO_SHIPPER_NAME=?4, SD_CARGO_AGENT_NAME=?3, SD_IATA_NUMBER=?5, SD_TRANSPORT_CERTIFICATE=?6, SD_TRANSPORTATION_PROVE=?7, USER_ID=?8 where id=?1", nativeQuery = true)
int update(Long id, String waybill,
String cargoAgent, String cargoShipper,
String iata, String tranposrt, String prove);
String iata, String tranposrt, String prove, Long userId);
@Query(value = "select count(*) from SECURITY_DECLARATION where SD_WAYBILL = ?1", nativeQuery = true)
int findWaybill(String waybill);
@Query(value = "select * from SECURITY_DECLARATION where SD_WAYBILL = ?1", nativeQuery = true)
SecurityDeclarationEntity waybill(String waybill);
}
... ...
... ... @@ -9,6 +9,7 @@ import javax.annotation.Resource;
import com.agent.entity.agent.*;
import com.agent.repository.system.HzWaybillRepository;
import com.agent.repository.system.SecurityDeclarationRepository;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.jpa.domain.Specification;
... ... @@ -124,6 +125,9 @@ public class ManifestService extends BasicService<ManifestEntity> {
@Resource
private HzWaybillRepository hzWaybillRepository;
@Resource
private SecurityDeclarationRepository securityDeclarationRepository;
/**
* 分页查询
*
... ... @@ -212,6 +216,11 @@ public class ManifestService extends BasicService<ManifestEntity> {
ManifestEntity manifestEntity = new ManifestEntity();
manifestEntity.setId(Long.valueOf(id));
manifestRepository.delete(manifestEntity);
//查看是否有安检申报 存在删除
SecurityDeclarationEntity waybill1 = securityDeclarationRepository.waybill(waybillnomaster);
if (waybill1 != null){
securityDeclarationRepository.delete(waybill1.getId());
}
}
}catch (Exception e){
e.printStackTrace();
... ... @@ -1066,4 +1075,18 @@ public class ManifestService extends BasicService<ManifestEntity> {
return manifestRepository.findWbm(wbm);
}
//修改预配
// @Transactional
public int update(ManifestEntity manifestEntity){
return manifestRepository.update(manifestEntity.getWaybillnomaster(),
manifestEntity.getFlightno(), manifestEntity.getFlightdate(), manifestEntity.getCarrier(),
manifestEntity.getTotalpiece(), manifestEntity.getTotalweight(), manifestEntity.getDestinationstation());
}
//删除预配
@Transactional
public int deleteOne(String waybill){
return manifestRepository.deleteOne(waybill);
}
}
... ...
... ... @@ -56,12 +56,12 @@ public class SecurityDeclarationService extends BasicService<SecurityDeclaration
return securityDeclarationRepository.findOne(id);
}
public int update(SecurityDeclarationEntity sd, String waybill){
public int update(SecurityDeclarationEntity sd){
return securityDeclarationRepository.update(sd.getId(), waybill,
return securityDeclarationRepository.update(sd.getId(), sd.getSd_waybill(),
sd.getSd_cargo_agent_name(), sd.getSd_cargo_shipper_name(),
sd.getSd_iata_number(), sd.getSd_transport_certificate(),
sd.getSd_transportation_prove());
sd.getSd_transportation_prove(), sd.getUSER_ID());
}
... ...
package com.agent.vo.agent;
import java.util.Date;
/**
* @Auther: shenhl
* @Date: 2019/7/5 15:05
*/
public class InlandVo {
private static final long serialVersionUID = 1L;
private Long id;
//承运人公司
private String carrier;
//航空货物性质 1普通货物 2特种货物 3危险品 4航空快件
private String inlandtype;
//航班日期
private Date flightdate;
//航空货物托运人名称
private String inlandname;
//航班号
private String flightno;
//航空货物销售代理人名称
private String agentname;
//航协资质编号
private String iatanumber;
//货物品名
private String cargoname;
//公斤
private String weight;
//件
private String piece;
//目的地
private String destination;
//运输条件鉴定书
private String transportcertificate;
//航空公司同意运输证明
private String transportationprove;
//用户id
private Long userid;
private String status;
private String waybill;
public String getWaybill() {
return waybill;
}
public void setWaybill(String waybill) {
this.waybill = waybill;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getCarrier() {
return carrier;
}
public void setCarrier(String carrier) {
this.carrier = carrier;
}
public String getInlandtype() {
return inlandtype;
}
public void setInlandtype(String inlandtype) {
this.inlandtype = inlandtype;
}
public Date getFlightdate() {
return flightdate;
}
public void setFlightdate(Date flightdate) {
this.flightdate = flightdate;
}
public String getInlandname() {
return inlandname;
}
public void setInlandname(String inlandname) {
this.inlandname = inlandname;
}
public String getFlightno() {
return flightno;
}
public void setFlightno(String flightno) {
this.flightno = flightno;
}
public String getAgentname() {
return agentname;
}
public void setAgentname(String agentname) {
this.agentname = agentname;
}
public String getIatanumber() {
return iatanumber;
}
public void setIatanumber(String iatanumber) {
this.iatanumber = iatanumber;
}
public String getCargoname() {
return cargoname;
}
public void setCargoname(String cargoname) {
this.cargoname = cargoname;
}
public String getWeight() {
return weight;
}
public void setWeight(String weight) {
this.weight = weight;
}
public String getPiece() {
return piece;
}
public void setPiece(String piece) {
this.piece = piece;
}
public String getDestination() {
return destination;
}
public void setDestination(String destination) {
this.destination = destination;
}
public String getTransportcertificate() {
return transportcertificate;
}
public void setTransportcertificate(String transportcertificate) {
this.transportcertificate = transportcertificate;
}
public String getTransportationprove() {
return transportationprove;
}
public void setTransportationprove(String transportationprove) {
this.transportationprove = transportationprove;
}
public Long getUserid() {
return userid;
}
public void setUserid(Long userid) {
this.userid = userid;
}
}
... ...
... ... @@ -69,9 +69,9 @@
<table class="search_form_table">
<select name="search_LIKE_tstype" id="tstype" style="width:166px;height:35px;line-height:35px;">
<option value="">请选择</option>
<option value="1">发货人</option>
<option value="2">订舱代理</option>
<option value="3">操作代理</option>
<option value="A">发货人</option>
<option value="B">订舱代理</option>
<option value="C">操作代理</option>
</select>
货主名称: <input class="easyui-textbox" type="text" name="search_LIKE_fullname" style="width:166px;height:35px;line-height:35px;">
... ... @@ -110,13 +110,13 @@
function tstype(value, row, index) {
console.log(row);
if ("1" == row.tstype){
if ("111" == row.tstype){
return "发货人"
}
if ("2" == row.tstype){
if ("222" == row.tstype){
return"订舱代理"
}
if("3"== row.tstype){
if("333"== row.tstype){
return "操作代理"
}
}
... ...
... ... @@ -52,7 +52,7 @@
<span class="required_span">*</span>
</td>
<td class="kv-content">
<input required id="waybill" minlength="12" name="waybill" value="${sd.sd_waybill}" disabled>
<input required id="waybill" minlength="12" name="waybill" value="${sd.sd_waybill}" >
</td>
<td class="kv-label">航空货物性质
... ... @@ -79,14 +79,14 @@
<span class="required_span">*</span>
</td>
<td class="kv-content">
<input disabled value="${wbm.carrier}" disabled>
<input required name="carrier" id="carrier" type="text" value="${wbm.carrier}" >
</td>
<td class="kv-label">航班号
<span class="required_span">*</span>
</td>
<td class="kv-content">
<input disabled value="${wbm.carrier}${wbm.flightno}" disabled>
<input required name="flightno" value="${wbm.flightno}">
</td>
</tr>
... ... @@ -95,7 +95,7 @@
<span class="required_span">*</span>
</td>
<td class="kv-content">
<input disabled value="${wbm.flightdate}" disabled>
<input required name="flightdate" id="flightdate" type="date" value="${date}">
</td>
<td class="kv-label">航空货物托运人名称
... ... @@ -133,7 +133,7 @@
<span class="required_span">*</span>
</td>
<td class="kv-content">
<input disabled type="text" value="${wbm.totalweight}">
<input required name="totalweight" id="totalweight" type="text" value="${wbm.totalweight}">
</td>
</tr>
... ... @@ -142,42 +142,31 @@
<span class="required_span">*</span>
</td>
<td class="kv-content">
<input disabled type="text" value="${wbm.totalpiece}">
<input required name="totalpiece" id="totalpiece" type="text" value="${wbm.totalpiece}">
</td>
<td class="kv-label">目的地
<span class="required_span">*</span>
</td>
<td class="kv-content">
<input disabled type="text" value="${wbm.destinationstation}">
<input required name="destinationstation" id="destinationstation" type="text" value="${wbm.destinationstation}">
</td>
</tr>
<tr>
<td class="kv-label">运输条件鉴定书
<span class="required_span">*</span>
</td>
<td class="kv-content">
<input required id="sd_transport_certificate" name="sd_transport_certificate" type="text" value="${sd.sd_transport_certificate}">
<input id="sd_transport_certificate" name="sd_transport_certificate" type="text" value="${sd.sd_transport_certificate}">
</td>
<td class="kv-label">航空公司同意运输证明
<span class="required_span">*</span>
</td>
<td class="kv-content">
<input required id="sd_transportation_prove" name="sd_transportation_prove" type="text" value="${sd.sd_transportation_prove}" placeholder="运输证明分别用逗号隔开">
<input id="sd_transportation_prove" name="sd_transportation_prove" type="text" value="${sd.sd_transportation_prove}" placeholder="运输证明分别用逗号隔开">
</td>
</tr>
<tr>
<%--<td colspan="2">--%>
<%--<div class="opt-buttons" style="padding-top: 20px;" id="divsubmit">--%>
<%--<button type="submit" class="easyui-linkbutton l-btn l-btn-small l-btn-selected "--%>
<%--data-options="selected:true">--%>
<%--<span class="l-btn-left"><span class="l-btn-text"><spring:message--%>
<%--code="opt.temsave" /></span></span>--%>
<%--</button>--%>
<%--</div>--%>
<%--</td>--%>
<td colspan="2" align="right">
<div class="opt-buttons" style="padding-top: 20px;text-align: right;" id="divsubmit">
<a onclick="savesend()" class="easyui-linkbutton l-btn l-btn-small l-btn-selected "
... ... @@ -185,10 +174,6 @@
<span class="l-btn-left"><span class="l-btn-text"><spring:message
code="opt.saveandsend" /></span></span>
</a>
<%-- <a onclick="sendDelivery()" class="easyui-linkbutton l-btn l-btn-small l-btn-selected " data-options="selected:true">
<span class="l-btn-left"><span class="l-btn-text"><spring:message code="manifest.delivery"/></span></span>
</a> --%>
<%--<a onclick="windowprint()" href="javascript:void(0)">打印</a>--%>
</div>
</td>
</tr>
... ... @@ -296,9 +281,13 @@
if (data.status == 200) {
$("#xmlContent").val(data.data);
$("#DialogShunt").window('open');
<%--var index = parent.layer.getFrameIndex(window.name); // 获取窗口索引--%>
<%--parent.layer.close(index);--%>
<%--window.location.href = "<%=basePath%>declaration/list";--%>
window.parent.location.reload();
var index = parent.layer.getFrameIndex(window.name); // 获取窗口索引
parent.layer.close(index);
window.location.href = "<%=basePath%>declaration/list";
} else {
layer.open({content:data.msg});
}
... ...
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="<%=basePath%>resource/css/base.css?version=${version}" rel="stylesheet">
<link href="<%=basePath%>resource/css/basic_info.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="<%=basePath%>resource/easyui/uimaker/icon.css?version=${version}">
<link rel="stylesheet" href="<%=basePath%>resource/easyui/uimaker/easyui.css?version=${version}">
<link rel="stylesheet" href="<%=basePath%>resource/css/form.css?version=${version}">
<script type="text/javascript" src="<%=basePath%>resource/easyui/jquery.min.js?version=${version}"></script>
<script type="text/javascript" src="<%=basePath%>resource/validate/jquery.validate.js?version=${version}"></script>
<script type="text/javascript" src="<%=basePath%>resource/validate/validate-extends.js?version=${version}"></script>
<link rel="stylesheet" href="<%=basePath%>resource/layui/css/layui.css?version=${version}" media="all">
<script type="text/javascript" src="<%=basePath%>resource/layer-v3.0.3/layer/layer.js?version=${version}"></script>
<script type="text/javascript" src="<%=basePath%>resource/layui/layui.js?version=${version}"></script>
<style type="text/css">
.required_span {
color: red;
margin-left: 10px;
font-size: 20px;
}
</style>
<!-- validate 验证中英文 -->
<script type="text/javascript"
src="<%=basePath %>resource/validate/jquery.validate-${pageContext.response.locale}.js"></script>
</head>
<body>
<div class="container">
<div class="content">
<form class="from-control" id="form">
<input type="hidden" id="id" name="id" value="${sd.id}">
<table class="kv-table" id="tableId">
<tbody>
<tr>
<td class="kv-label">主单号
<span class="required_span">*</span>
</td>
<td class="kv-content">
<input required id="waybill" minlength="12" name="waybill" value="${sd.sd_waybill}" >
</td>
<td class="kv-label">航空货物性质
<span class="required_span">*</span>
</td>
<td class="kv-content">
<label>
<input id="one" name="one" type="checkbox" ${fn:contains(type, 1)?"checked":""} value="1" >普通货物
</label>
<label>
<input id="two" name="two" type="checkbox" ${fn:contains(type, 2)?"checked":""} value="2">特种货物
</label>
<label>
<input id="three" name="three" type="checkbox" ${fn:contains(type, 3)?"checked":""} value="3">危险品
</label>
<label>
<input id="four" name="four" type="checkbox" ${fn:contains(type, 4)?"checked":""} value="4">航空快件
</label>
</td>
</tr>
<tr>
<td class="kv-label">承运航空公司
<span class="required_span">*</span>
</td>
<td class="kv-content">
<input required name="carrier" id="carrier" type="text" value="${wbm.carrier}" >
</td>
<td class="kv-label">航班号
<span class="required_span">*</span>
</td>
<td class="kv-content">
<input required name="flightno" value="${wbm.carrier}${wbm.flightno}">
</td>
</tr>
<tr>
<td class="kv-label">航班日期
<span class="required_span">*</span>
</td>
<td class="kv-content">
<input required name="flightdate" id="flightdate" value="${date}">
</td>
<td class="kv-label">航空货物托运人名称
<span class="required_span">*</span>
</td>
<td class="kv-content">
<input required id="sd_cargo_shipper_name" name="sd_cargo_shipper_name" type="text" value="${sd.sd_cargo_shipper_name}">
</td>
</tr>
<tr>
<td class="kv-label">航空货运销售代理人名称
<span class="required_span">*</span>
</td>
<td class="kv-content">
<input required id="sd_cargo_agent_name" name="sd_cargo_agent_name" type="text" value="${sd.sd_cargo_agent_name}">
</td>
<td class="kv-label">航协编号
<span class="required_span">*</span>
</td>
<td class="kv-content">
<input required id="sd_iata_number" name="sd_iata_number" type="text" value="${sd.sd_iata_number}">
</td>
</tr>
<tr>
<td class="kv-label">货物品名
<span class="required_span">*</span>
</td>
<td class="kv-content">
<input required id="sd_cargo_name" name="sd_cargo_name" type="text" value="${name}" placeholder="品名分别用逗号隔开">
</td>
<td class="kv-label">公斤
<span class="required_span">*</span>
</td>
<td class="kv-content">
<input required name="totalweight" id="totalweight" type="text" value="${wbm.totalweight}">
</td>
</tr>
<tr>
<td class="kv-label">件数
<span class="required_span">*</span>
</td>
<td class="kv-content">
<input required name="totalpiece" id="totalpiece" type="text" value="${wbm.totalpiece}">
</td>
<td class="kv-label">目的地
<span class="required_span">*</span>
</td>
<td class="kv-content">
<input required name="destinationstation" id="destinationstation" type="text" value="${wbm.destinationstation}">
</td>
</tr>
<tr>
<td class="kv-label">运输条件鉴定书
</td>
<td class="kv-content">
<input id="sd_transport_certificate" name="sd_transport_certificate" type="text" value="${sd.sd_transport_certificate}">
</td>
<td class="kv-label">航空公司同意运输证明
</td>
<td class="kv-content">
<input id="sd_transportation_prove" name="sd_transportation_prove" type="text" value="${sd.sd_transportation_prove}" placeholder="运输证明分别用逗号隔开">
</td>
</tr>
<%--<tr>--%>
<%--<td colspan="2" align="right">--%>
<%--<div class="opt-buttons" style="padding-top: 20px;text-align: right;" id="divsubmit">--%>
<%--<a onclick="savesend()" class="easyui-linkbutton l-btn l-btn-small l-btn-selected "--%>
<%--data-options="selected:true">--%>
<%--<span class="l-btn-left"><span class="l-btn-text"><spring:message--%>
<%--code="opt.saveandsend" /></span></span>--%>
<%--</a>--%>
<%--</div>--%>
<%--</td>--%>
<%--</tr>--%>
</tbody>
</table>
</form>
</div>
</div>
<div id="DialogShunt" class="easyui-dialog" title="报文" style="width: 800px; height: 800px;"
data-options="iconCls:'pag-list',modal:true,collapsible:false,minimizable:false,maximizable:false,resizable:false,closed:true">
<div style="margin-left: 5px; margin-right: 5px; margin-top: 5px;">
<div class="data-tips-info">
<div class="data-tips-tip icon-tip"></div>
</div>
<div class="modal-body" style="padding-top: 3px; padding-left: 20px; padding-right: 3px;">
<textarea id="xmlContent" style="width: 100%; height: 400px;"></textarea>
</div>
<div style="text-align: center; padding-top: 30px;"></div>
</div>
</div>
<!-- 外部js -->
<script type="text/javascript" src="<%=basePath%>resource/My97DatePicker/WdatePicker.js?version=${version}"></script>
<script src="<%=basePath%>resource/easyui/jquery.easyui.min.js?version=${version}"></script>
<script src="<%=basePath%>/resource/js/tools.js?version=${version}"></script>
<!--弹出层引入的JS-->
<script type="text/javascript">
var layerIndex;
var layer;
layui.use('layer', function(){
layer = layui.layer;
});
var selectFals = false;
function submit(){
layerIndex = parent.layer.load(1, {
shade: [0.6,'#000000'] //0.1透明度
});
var chboxValue=[];
var checkBox = $("input[name=one],input[name=two],input[name=three],input[name=four]");
for (var i=0; i<checkBox.length; i++){
if (checkBox[i].checked){
selectFals = true;
}
}
if (selectFals == true){
var data = $("#form").serialize();
$.post("<%=basePath%>declaration/save",data,function (data) {
parent.layer.close(layerIndex);
if (data.status == 200) {
var index = parent.layer.getFrameIndex(window.name); // 获取窗口索引
parent.layer.close(index);
window.location.href = "<%=basePath%>declaration/list";
} else {
layer.open({content:""+data.msg});
}
});
}else {
alert("货主类型至少选择一项");
return false;
}
}
function viewXml(){
if($("#ids").val()==''){
layer.open({content:"<spring:message code='manifest.send.message.failed'/>"});
}else{
$("#mask").show();
showMask();
$("#mask").append("<spring:message code='manifest.send'/>");
$.post("<%=basePath%>manifest/xml",{id:$("#ids").val()},function(data){
// layer.open({content:data.data});
layer.open({content:"<spring:message code='manifest.send.message.successfully'/>"});
hideMask();
})
}
}
//发送报文并且保存
function savesend(){
var isValid = $("#form").valid();
if(isValid){
layerIndex = parent.layer.load(1, {
shade: [0.6,'#000000'] //0.1透明度
});
var chboxValue=[];
var checkBox = $("input[name=one],input[name=two],input[name=three],input[name=four]");
for (var i=0; i<checkBox.length; i++){
if (checkBox[i].checked){
selectFals = true;
}
}
var waybill = $("#waybill").val();
if (selectFals == true){
var data = $("#form").serialize();
$.post("<%=basePath%>declaration/update?waybill="+waybill,data,function (data) {
parent.layer.close(layerIndex);
if (data.status == 200) {
$("#xmlContent").val(data.data);
$("#DialogShunt").window('open');
<%--var index = parent.layer.getFrameIndex(window.name); // 获取窗口索引--%>
<%--parent.layer.close(index);--%>
<%--window.location.href = "<%=basePath%>declaration/list";--%>
window.parent.location.reload();
var index = parent.layer.getFrameIndex(window.name); // 获取窗口索引
parent.layer.close(index);
} else {
layer.open({content:data.msg});
}
})
}else {
alert("货物性质至少选择一项");
return false;
}
}
}
//发送交运报文
function sendDelivery(){
var id3 = $("#waybillnomaster").val($("#waybill").val());
var data = $("#form").serialize();
$.post("<%=basePath%>manifest/sendDelivery",data,function (data) {
if (data.status == 200) {
// layer.confirm("<spring:message code="opt.savesuccess"/>", {btn: ['<spring:message code="opt.confirm"/>', '<spring:message code="opt.cancel"/>']}, function () {
<%-- window.location.href = "<%=basePath %>manifest/list" ; --%>
$("#xmlContent").val(data.data);
$("#DialogShunt").window('open');
window.location.href = "<%=basePath%>manifest/list";
// })
} else {
layer.open({content: data.msg});
}
})
}
// function windowprint() {
// var f = document.getElementById("tableId");
// f.style.display = "";
// window.print();
// f.style.display = "none";
// }
</script>
</body>
</html>
\ No newline at end of file
... ...
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="<%=basePath%>resource/css/base.css?version=${version}" rel="stylesheet">
<link href="<%=basePath%>resource/css/basic_info.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="<%=basePath%>resource/easyui/uimaker/icon.css?version=${version}">
<link rel="stylesheet" href="<%=basePath%>resource/easyui/uimaker/easyui.css?version=${version}">
<link rel="stylesheet" href="<%=basePath%>resource/css/form.css?version=${version}">
<script type="text/javascript" src="<%=basePath%>resource/easyui/jquery.min.js?version=${version}"></script>
<script type="text/javascript" src="<%=basePath%>resource/validate/jquery.validate.js?version=${version}"></script>
<script type="text/javascript" src="<%=basePath%>resource/validate/validate-extends.js?version=${version}"></script>
<link rel="stylesheet" href="<%=basePath%>resource/layui/css/layui.css?version=${version}" media="all">
<script type="text/javascript" src="<%=basePath%>resource/layer-v3.0.3/layer/layer.js?version=${version}"></script>
<script type="text/javascript" src="<%=basePath%>resource/layui/layui.js?version=${version}"></script>
<style type="text/css">
.required_span {
color: red;
margin-left: 10px;
font-size: 20px;
}
</style>
<!-- validate 验证中英文 -->
<script type="text/javascript"
src="<%=basePath %>resource/validate/jquery.validate-${pageContext.response.locale}.js"></script>
</head>
<body>
<div class="container">
<div class="content">
<form class="from-control" id="form">
<%--<input type="hidden" id="id" name="id" value="${sd.id}">--%>
<table class="kv-table" id="tableId">
<tbody>
<tr>
<td class="kv-label">主单号
<span class="required_span">*</span>
</td>
<td class="kv-content">
<input required id="waybill" minlength="12" name="waybill" type="text" onblur="input_change(this)">
</td>
<script>
function input_change(obj){
var val = $(obj).val();
if(val){
checkNo(val);
}
//用户输入订单号满足格式
}
</script>
<td class="kv-label">航空货物性质
<span class="required_span">*</span>
</td>
<td class="kv-content">
<label>
<input id="one" name="one" type="checkbox" value="1" >普通货物
</label>
<label>
<input id="two" name="two" type="checkbox" value="2">特种货物
</label>
<label>
<input id="three" name="three" type="checkbox" value="3">危险品
</label>
<label>
<input id="four" name="four" type="checkbox" value="4">航空快件
</label>
</td>
</tr>
<tr>
<td class="kv-label">承运航空公司
<span class="required_span">*</span>
</td>
<td class="kv-content">
<input required name="carrier" id="carrier" type="text" placeholder="如:CV">
</td>
<td class="kv-label">航班号
<span class="required_span">*</span>
</td>
<td class="kv-content">
<input required type="text" name="flightno" id="flightno" placeholder="如:0000">
</td>
</tr>
<tr>
<td class="kv-label">航班日期
<span class="required_span">*</span>
</td>
<td class="kv-content">
<input required name="flightdate" id="flightdate" type="date">
</td>
<td class="kv-label">航空货物托运人名称
<span class="required_span">*</span>
</td>
<td class="kv-content">
<input required id="sd_cargo_shipper_name" name="sd_cargo_shipper_name" type="text">
</td>
</tr>
<tr>
<td class="kv-label">航空货运销售代理人名称
<span class="required_span">*</span>
</td>
<td class="kv-content">
<input required id="sd_cargo_agent_name" name="sd_cargo_agent_name" type="text">
</td>
<td class="kv-label">航协编号
<span class="required_span">*</span>
</td>
<td class="kv-content">
<input required id="sd_iata_number" name="sd_iata_number" type="text">
</td>
</tr>
<tr>
<td class="kv-label">货物品名
<span class="required_span">*</span>
</td>
<td class="kv-content">
<input required id="sd_cargo_name" name="sd_cargo_name" type="text" placeholder="品名分别用逗号隔开">
</td>
<td class="kv-label">公斤
<span class="required_span">*</span>
</td>
<td class="kv-content">
<input required type="text" name="totalweight" id="totalweight">
</td>
</tr>
<tr>
<td class="kv-label">件数
<span class="required_span">*</span>
</td>
<td class="kv-content">
<input required type="text" name="totalpiece" id="totalpiece">
</td>
<td class="kv-label">目的地
<span class="required_span">*</span>
</td>
<td class="kv-content">
<input required type="text" name="destinationstation" id="destinationstation">
</td>
</tr>
<tr>
<td class="kv-label">运输条件鉴定书
</td>
<td class="kv-content">
<input id="sd_transport_certificate" name="sd_transport_certificate" type="text">
</td>
<td class="kv-label">航空公司同意运输证明
</td>
<td class="kv-content">
<input id="sd_transportation_prove" name="sd_transportation_prove" type="text" placeholder="运输证明分别用逗号隔开">
</td>
</tr>
<tr>
<td colspan="2" align="right">
<div class="opt-buttons" style="padding-top: 20px;text-align: right;" id="divsubmit">
<a onclick="savesend()" class="easyui-linkbutton l-btn l-btn-small l-btn-selected "
data-options="selected:true">
<span class="l-btn-left"><span class="l-btn-text"><spring:message
code="opt.saveandsend" /></span></span>
</a>
</div>
</td>
</tr>
</tbody>
</table>
</form>
</div>
</div>
<div id="DialogShunt" class="easyui-dialog" title="报文" style="width: 800px; height: 800px;"
data-options="iconCls:'pag-list',modal:true,collapsible:false,minimizable:false,maximizable:false,resizable:false,closed:true">
<div style="margin-left: 5px; margin-right: 5px; margin-top: 5px;">
<div class="data-tips-info">
<div class="data-tips-tip icon-tip"></div>
</div>
<div class="modal-body" style="padding-top: 3px; padding-left: 20px; padding-right: 3px;">
<textarea id="xmlContent" style="width: 100%; height: 400px;"></textarea>
</div>
<div style="text-align: center; padding-top: 30px;"></div>
</div>
</div>
<!-- 外部js -->
<script type="text/javascript" src="<%=basePath%>resource/My97DatePicker/WdatePicker.js?version=${version}"></script>
<script src="<%=basePath%>resource/easyui/jquery.easyui.min.js?version=${version}"></script>
<script src="<%=basePath%>/resource/js/tools.js?version=${version}"></script>
<!--弹出层引入的JS-->
<script type="text/javascript">
var layerIndex;
var layer;
layui.use('layer', function(){
layer = layui.layer;
});
var selectFals = false;
function submit(){
layerIndex = parent.layer.load(1, {
shade: [0.6,'#000000'] //0.1透明度
});
var chboxValue=[];
var checkBox = $("input[name=one],input[name=two],input[name=three],input[name=four]");
for (var i=0; i<checkBox.length; i++){
if (checkBox[i].checked){
selectFals = true;
}
}
if (selectFals == true){
var data = $("#form").serialize();
$.post("<%=basePath%>declaration/save",data,function (data) {
parent.layer.close(layerIndex);
if (data.status == 200) {
var index = parent.layer.getFrameIndex(window.name); // 获取窗口索引
parent.layer.close(index);
window.location.href = "<%=basePath%>declaration/list";
} else {
layer.open({content:""+data.msg});
}
});
}else {
alert("货主类型至少选择一项");
return false;
}
}
function viewXml(){
if($("#ids").val()==''){
layer.open({content:"<spring:message code='manifest.send.message.failed'/>"});
}else{
$("#mask").show();
showMask();
$("#mask").append("<spring:message code='manifest.send'/>");
$.post("<%=basePath%>manifest/xml",{id:$("#ids").val()},function(data){
// layer.open({content:data.data});
layer.open({content:"<spring:message code='manifest.send.message.successfully'/>"});
hideMask();
})
}
}
//发送报文并且保存
function savesend(){
var isValid = $("#form").valid();
if(isValid){
layerIndex = parent.layer.load(1, {
shade: [0.6,'#000000'] //0.1透明度
});
var chboxValue=[];
var checkBox = $("input[name=one],input[name=two],input[name=three],input[name=four]");
for (var i=0; i<checkBox.length; i++){
if (checkBox[i].checked){
selectFals = true;
}
}
var waybill = $("#waybill").val();
if (selectFals == true){
var data = $("#form").serialize();
$.post("<%=basePath%>declaration/inlandsave?waybill="+waybill,data,function (data) {
parent.layer.close(layerIndex);
if (data.status == 200) {
$("#xmlContent").val(data.data);
$("#DialogShunt").window('open');
window.parent.location.reload();
var index = parent.layer.getFrameIndex(window.name); // 获取窗口索引
parent.layer.close(index);
}
else if (data.status == 203){
alert("安检申报不可以重复添加");
} else {
layer.open({content:data.msg});
}
})
}else {
alert("货物性质至少选择一项");
return false;
}
}
}
//主单号校验
function checkNo(content){
if (content) {
var reg = /^(\d{3})(-)(\d{8})$/;
var flag = content.match(reg);
if(flag==null){
layui.use('layer', function(){
var layer = layui.layer;
parent.layer.alert('主单号格式错误,请检查运单号位数及格式,例如:172-30937185', {icon: 0});
$("#waybill").focus();
});
return;
}
content = content.replace(/ /g,'');
$("#waybill").val(content);
if(content.length>4){
var forth = content.substring(3,4);
if(forth!='-'){
var start = content.substring(0,3);
var end = content.substring(3,content.length);
content = start+"-"+end;
$("#waybill").val(content);
}
}
if(content.length>12){
content = content.substring(0,12);
$("#waybill").val(content);
}
if(content.length<12){
layui.use('layer', function(){
var layer = layui.layer;
parent.layer.alert('主单号不能少于12位~!', {icon: 0});
$("#waybill").focus();
});
return;
}
var array = content.split("-");
if(array!=null&&array.length==2){
var end = array[1];
if(end&&end.length==8){
var number = parseInt(end);
var start = number/10;
var remainder = parseInt(start)%7;
var last = number%10;
if(remainder!=last){
layui.use('layer', function(){
var layer = layui.layer;
parent.layer.alert('主单号不符合模七校验,请修改~!', {icon: 6});
$("#waybill").focus();
});
}else{
//模七校验通过,校验是否有重复
checkRepeatNo(content);
}
}
}
}
}
</script>
</body>
</html>
\ No newline at end of file
... ...
... ... @@ -42,8 +42,8 @@
<th field="sd_cargo_shipper_name">航空货运托运人名称</th>
<th field="sd_cargo_agent_name">航空货运销售代理人名称</th>
<th field="sd_iata_number">航协编号</th>
<th field="sd_transport_certificate">运输条件鉴定书</th>
<th field="sd_transportation_prove">航空公司同意运输证明</th>
<th field="sd_transport_certificate" formatter="certificate">运输条件鉴定书</th>
<th field="sd_transportation_prove" formatter="prove">航空公司同意运输证明</th>
<th field="sd_static"formatter="sdStatic" width="80">状态</th>
<th field=".." formatter="operatorFormat" width="60">操作</th>
</tr>
... ... @@ -54,6 +54,7 @@
<table class="search_form_table">
<spring:message code="manifest.bill.number"/>:<input id="manifnum" type="text" name="search_LIKE_sd_waybill" style="width:166px;height:35px;line-height:35px;">
<a href="javascript:doSearch()" class="easyui-linkbutton" iconCls="icon-search" data-options="selected:true"><spring:message code="opt.search" /></a>
<a href="javascript:doSaves()" class="easyui-linkbutton" style="background:#18A197;color:#FFF;border: 1px solid #18A197;" iconCls="icon-add">添加</a>
<%--<a href="javascript:printAll()" class="easyui-linkbutton" style="background:red;color:#FFF;border: 1px solid red">批量打印</a>--%>
</table>
</form>
... ... @@ -76,6 +77,25 @@
return html;
}
//判断是否为空
function certificate(val, row, index) {
if (row.sd_transport_certificate == null){
return "无";
}else {
return row.sd_transport_certificate;
}
}
function prove(val, row, index) {
if (row.sd_transportation_prove == null){
return "无";
}else {
return row.sd_transportation_prove;
}
}
function sdStatic(value, row, index) {
var res = '';
res = '<span style="color:red;">'+value+'</span>';
... ... @@ -83,7 +103,9 @@
}
function operatorFormat(val, row, index) {
var html = "<a href='javascript:void(0)' onclick='print("+row.id+")' style='text-decoration:none;color:blue;'>打印</a>";
var html = "<a href='javascript:void(0)' onclick='print("+row.id+")' style='text-decoration:none;color:blue;'>打印</a>" +
"&nbsp;&nbsp;&nbsp;&nbsp;<a href='javascript:void(0)' onclick='findOne("+row.id+")' style='text-decoration:none;color:blue;'>查看</a>";
return html;
}
... ... @@ -211,7 +233,27 @@
});
}
function findOne(id) {
layer.open({
type : 2,
title : '修改',
maxmin : true,
shadeClose : false, // 点击遮罩关闭层
area : [ '80%', '65%' ],
content : '<%=basePath %>declaration/findone?id='+id
});
}
function doSaves() {
layer.open({
type : 2,
title : '添加',
maxmin : true,
shadeClose : false, // 点击遮罩关闭层
area : [ '80%', '65%' ],
content : '<%=basePath %>declaration/inlandSaveView'
});
}
function doSearch(){
$('#dg').datagrid("options").queryParams=$("#searchForm").serializeJson();
$('#dg').datagrid("reload");
... ...
... ... @@ -111,17 +111,17 @@
<tr>
<td class="kv-label">运输条件鉴定书
<span class="required_span">*</span>
<%--<span class="required_span">*</span>--%>
</td>
<td class="kv-content">
<input required id="sd_transport_certificate" name="sd_transport_certificate" type="text">
<input id="sd_transport_certificate" name="sd_transport_certificate" type="text">
</td>
<td class="kv-label">航空公司同意运输证明
<span class="required_span">*</span>
<%--<span class="required_span">*</span>--%>
</td>
<td class="kv-content">
<input required id="sd_transportation_prove" name="sd_transportation_prove" type="text" placeholder="运输证明分别用逗号隔开">
<input id="sd_transportation_prove" name="sd_transportation_prove" type="text" placeholder="运输证明分别用逗号隔开">
</td>
</tr>
... ...
... ... @@ -99,7 +99,7 @@
</td>
<td class="kv-content">
<select required id="for_short_shipper" name="for_short_shipper">
<option value="" selected>-----请选择-----</option>
<option value="" selected></option>
<c:forEach items="${shipper}" var="shipper">
<option value="${shipper.id}" <c:forEach items="${hzId}" var = "hzId"> ${shipper.id eq hzId.hzinfor_id?"selected":""} </c:forEach>>${shipper.for_short}&nbsp;&nbsp;${shipper.full_name}</option>
</c:forEach>
... ... @@ -110,7 +110,7 @@
</td>
<td class="kv-content">
<select id="for_short_booking" name="for_short_booking">
<option value="" selected>-----请选择-----</option>
<option value="" selected></option>
<c:forEach items="${booking}" var="booking">
<option value="${booking.id}" <c:forEach items="${hzId}" var = "hzId"> ${booking.id eq hzId.hzinfor_id?"selected":""} </c:forEach>>${booking.for_short}&nbsp;&nbsp;${booking.full_name}</option>
</c:forEach>
... ... @@ -121,7 +121,7 @@
</td>
<td class="kv-content">
<select id="for_short_operation" name="for_short_operation">
<option value="" selected>-----请选择-----</option>
<option value="" selected></option>
<c:forEach items="${operation}" var="operation">
<option value="${operation.id}" <c:forEach items="${hzId}" var = "hzId"> ${operation.id eq hzId.hzinfor_id?"selected":""} </c:forEach> >${operation.for_short}&nbsp;&nbsp;${operation.full_name}</option>
</c:forEach>
... ...
... ... @@ -46,13 +46,13 @@
<td class="kv-content">
<div class="date">
<label>
<input id="one" name="one" type="checkbox" value="1" checked>发货人
<input id="one" name="one" type="checkbox" value="111" checked>发货人
</label>
<label>
<input id="two" name="two" type="checkbox" value="2">订舱代理
<input id="two" name="two" type="checkbox" value="222">订舱代理
</label>
<label>
<input id="three" name="three" type="checkbox" value="3">操作代理
<input id="three" name="three" type="checkbox" value="333">操作代理
</label>
</div>
</td>
... ...
... ... @@ -48,13 +48,13 @@
<td class="kv-content">
<div class="date">
<label>
<input id="one" name="the_shipper_type" type="checkbox" ${1 eq entity.the_shipper_type?"checked":""} value="1">发货人
<input id="one" name="the_shipper_type" type="checkbox" ${111 eq entity.the_shipper_type?"checked":""} value="111">发货人
</label>
<label>
<input id="two" name="the_shipper_type" type="checkbox" ${2 eq entity.the_shipper_type?"checked":""} value="2">订舱代理
<input id="two" name="the_shipper_type" type="checkbox" ${222 eq entity.the_shipper_type?"checked":""} value="222">订舱代理
</label>
<label>
<input id="three" name="the_shipper_type" type="checkbox" ${3 eq entity.the_shipper_type?"checked":""} value="3">操作代理
<input id="three" name="the_shipper_type" type="checkbox" ${333 eq entity.the_shipper_type?"checked":""} value="333">操作代理
</label>
</div>
</td>
... ...