作者 张天舒

报文原始版本 First

正在显示 52 个修改的文件 包含 4620 行增加6 行删除

要显示太多修改。

为保证性能只显示 52 of 52+ 个文件。

... ... @@ -57,6 +57,7 @@
</properties>
<dependencies>
<!-- springframe start -->
<dependency>
<groupId>org.springframework</groupId>
... ... @@ -185,7 +186,13 @@
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<!-- xstream -->
<dependency>
<groupId>com.thoughtworks.xstream</groupId>
<artifactId>xstream</artifactId>
<version>1.4.9</version>
</dependency>
<!--mybatis-->
<dependency>
<groupId>org.mybatis</groupId>
... ...
package com.tianbo.controller.lost;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.tianbo.model.ManifestLoad;
import com.tianbo.model.Sendlog;
import com.tianbo.service.LostService;
import com.tianbo.service.SendLogService;
import com.tianbo.util.DateUtils;
import com.tianbo.util.json.AjaxJson;
import com.tianbo.util.json.JsonConversion;
import com.tianbo.util.xml.XmlGen;
import com.tianbo.xml.lost.AdditionalInformation;
import com.tianbo.xml.lost.AssociatedTransportDocument;
import com.tianbo.xml.lost.BorderTransportMeans;
import com.tianbo.xml.lost.Consignment;
import com.tianbo.xml.lost.DeclarationXmlEntity;
import com.tianbo.xml.lost.HeadXmlEntity;
import com.tianbo.xml.lost.ManifestXmlEntity;
import com.tianbo.xml.lost.TransportContractDocument;
@Controller
@RequestMapping("/lost")
public class LostApplyController {
@Autowired
private LostService lostService;
@Autowired
private SendLogService sendLogService;
@RequestMapping(value = {"index", ""})
public String toFlight(ModelMap model,HttpServletRequest request) {
return "lost/list";
}
@RequestMapping(value ="edit")
public String edit(ModelMap model,HttpServletRequest request) {
model.put("ftId", request.getParameter("id"));
return "lost/edit";
}
@ResponseBody
@RequestMapping(value = "getList")
public String getList(HttpServletRequest request,int page,int limit){
int start = (page-1)*limit+1;
int end = page*limit;
List<ManifestLoad> lost = lostService.getList(start,end);
ManifestLoad ft = new ManifestLoad();
int count = lostService.getCount(ft);
Map<String,Object> map = new HashMap<>();
if(!lost.isEmpty()){
map.put("code", 0);
map.put("count", count);
map.put("msg", "success");
map.put("data", lost);
}else {
map.put("code", -1);
map.put("msg", "请检查网络连接或重试");
map.put("data", "");
}
return JsonConversion.writeMapJSON(map);
}
@ResponseBody
@RequestMapping(value = "selectByParam")
public String selectByParam(HttpServletRequest request,int page,int limit,String flightno,String flightdate,String waybillnomaster,String waybillnosecondary){
int start = (page-1)*limit+1;
int end = page*limit;
List<ManifestLoad> lost = lostService.selectByParam(start,end,flightno,flightdate,waybillnomaster,waybillnosecondary);
ManifestLoad fs = new ManifestLoad();
fs.setFlightno(flightno);
int count = lostService.getCount(fs);
Map<String,Object> map = new HashMap<>();
if(!lost.isEmpty()){
map.put("code", 0);
map.put("count", count);
map.put("msg", "success");
map.put("data", lost);
}else {
map.put("code", -1);
map.put("msg", "无此条件信息");
map.put("data", "");
}
return JsonConversion.writeMapJSON(map);
}
/**
* 编辑或新增
* @param lost
* @param redirectAttributes
* @return
*/
@ResponseBody
@RequestMapping(value = "editForm")
public AjaxJson editForm(ModelMap model,HttpServletRequest request) {
String id = request.getParameter("id");
String flightno = request.getParameter("flightno");
String flightdate = request.getParameter("flightdate");
String waybillnomaster = request.getParameter("waybillnomaster");
String waybillnosecondary = request.getParameter("waybillnosecondary");
String message = null;
AjaxJson j = new AjaxJson();
try {
if( id != null && id != ""){
ManifestLoad manifest = lostService.findById(id);
manifest.setFlightno(flightno);
manifest.setFlightdate(DateUtils.stringToDate(flightdate+" 00:00:00", "yyyy-MM-dd HH:mm:ss"));
manifest.setWaybillnomaster(waybillnomaster);
manifest.setWaybillnosecondary(waybillnosecondary);
lostService.saveorupdate(manifest);
}else{
ManifestLoad ml = new ManifestLoad();
ml.setId(id);
ml.setFlightno(flightno);
ml.setFlightdate(DateUtils.stringToDate(flightdate+" 00:00:00", "yyyy-MM-dd HH:mm:ss"));
ml.setWaybillnomaster(waybillnomaster);
ml.setWaybillnosecondary(waybillnosecondary);
lostService.saveorupdate(ml);
}
j.setSuccess(true);
message = "修改成功";
} catch (Exception e) {
j.setSuccess(false);
message = "修改失败";
e.printStackTrace();
}
j.setMsg(message);
return j;
}
/**
* 删除
* @param lost
* @param redirectAttributes
* @return
*/
@ResponseBody
@RequestMapping(value = "del")
public AjaxJson delete(ModelMap model,HttpServletRequest request) {
String id = request.getParameter("id");
String message = null;
AjaxJson j = new AjaxJson();
try {
lostService.del(id);
j.setSuccess(true);
message = "删除成功";
} catch (Exception e) {
j.setSuccess(false);
message = "删除失败";
e.printStackTrace();
}
j.setMsg(message);
return j;
}
/**
* 删除
* @param lost
* @param redirectAttributes
* @return
*/
@ResponseBody
@RequestMapping(value = "updateStatues")
public AjaxJson updateStatues(ModelMap model,HttpServletRequest request) {
String id = request.getParameter("id");
String message = null;
AjaxJson j = new AjaxJson();
try {
ManifestLoad manifestLoad = lostService.findById(id);
manifestLoad.setStatus("");
lostService.saveorupdate(manifestLoad);
j.setSuccess(true);
message = "修改状态成功";
} catch (Exception e) {
j.setSuccess(false);
message = "修改状态失败";
e.printStackTrace();
}
j.setMsg(message);
return j;
}
/**
* 申报
* @param lost
* @param redirectAttributes
* @return
*/
@ResponseBody
@RequestMapping(value = "send")
public AjaxJson send(ModelMap model,HttpServletRequest request) {
String id = request.getParameter("id");
String flightno = request.getParameter("flightno");
String flightdate = request.getParameter("flightdate");
String waybillnomaster = request.getParameter("waybillnomaster");
String waybillnosecondary = request.getParameter("waybillnosecondary");
String remark = request.getParameter("remark");
String message = null;
AjaxJson j = new AjaxJson();
try {
//保存至sendLog表
Sendlog sendlog = new Sendlog();
sendlog.setAutoid(id);
sendlog.setCreatedate(new Date());
sendlog.setMessagetype("MT8202");
sendlog.setReceiption("发送分拨申请");
sendLogService.save(sendlog);
//生成报文并发送至文件夹
ManifestXmlEntity manifestXml = new ManifestXmlEntity();
setParam(flightno, flightdate, waybillnomaster, waybillnosecondary, remark, manifestXml);
XmlGen.genLostXmlAndSend(manifestXml);
j.setSuccess(true);
message = "已发送申报报文";
ManifestLoad lost = lostService.findById(id);
lost.setStatus("01");//已发送
lostService.saveorupdate(lost);
} catch (Exception e) {
j.setSuccess(false);
message = "申报报文发送失败";
e.printStackTrace();
}
j.setMsg(message);
return j;
}
/**
* @param flightno
* @param flightdate
* @param waybillnomaster
* @param waybillnosecondary
* @param remark
* @param manifestXml
*/
public void setParam(String flightno, String flightdate, String waybillnomaster, String waybillnosecondary,
String remark, ManifestXmlEntity manifestXml) {
HeadXmlEntity headXml = new HeadXmlEntity();
DeclarationXmlEntity declarationXml = new DeclarationXmlEntity();
BorderTransportMeans transportMeans = new BorderTransportMeans();
transportMeans.setJourneyID(flightno+"/"+flightdate.substring(0,10).replace("-", ""));//航次航班
AdditionalInformation information = new AdditionalInformation();
information.setContent(remark);
Consignment consignment = new Consignment();
TransportContractDocument transportContractDocument = new TransportContractDocument();
transportContractDocument.setId(waybillnomaster.replace("-", ""));//主单号
AssociatedTransportDocument associatedTransportDocument = new AssociatedTransportDocument();
if(waybillnosecondary==""||waybillnosecondary==null){
associatedTransportDocument.setId("");//分单号
}else{
associatedTransportDocument.setId(waybillnomaster.replace("-", "")+"_"+waybillnosecondary);//分单号
}
consignment.setAssociatedTransportDocument(associatedTransportDocument );
consignment.setTransportContractDocument(transportContractDocument );
declarationXml.setAdditionalInformation(information);
declarationXml.setBorderTransportMeans(transportMeans);
declarationXml.setConsignment(consignment);
manifestXml.setHeadXml(headXml);
manifestXml.setDeclarationXml(declarationXml);
}
}
... ...
package com.tianbo.controller.lost;
import java.lang.reflect.InvocationTargetException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.beanutils.ConvertUtils;
import org.apache.commons.beanutils.Converter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import com.tianbo.model.ManifestItem;
import com.tianbo.model.ManifestLostChange;
import com.tianbo.model.Sendlog;
import com.tianbo.service.ItemService;
import com.tianbo.service.LostChangeService;
import com.tianbo.service.SendLogService;
import com.tianbo.util.json.AjaxJson;
import com.tianbo.util.json.JsonConversion;
import com.tianbo.util.xml.XmlGen;
import com.tianbo.xml.lost.AdditionalInformation;
import com.tianbo.xml.lost.AssociatedTransportDocument;
import com.tianbo.xml.lost.BorderTransportMeans;
import com.tianbo.xml.lost.Consignment;
import com.tianbo.xml.lost.DeclarationXmlEntity;
import com.tianbo.xml.lost.HeadXmlEntity;
import com.tianbo.xml.lost.ManifestXmlEntity;
import com.tianbo.xml.lost.TransportContractDocument;
@Controller
@RequestMapping("/lost/change")
public class LostChangeController {
@Autowired
private LostChangeService lostChangeService;
@Autowired
private ItemService itemService;
@Autowired
private SendLogService sendLogService;
@RequestMapping(value = {"index", ""})
public String toFlight(ModelMap model,HttpServletRequest request) {
return "lost/change/list";
}
@RequestMapping(value ="editItem")
public String editItem(ModelMap model,HttpServletRequest request) {
String id = request.getParameter("id");
if(id!=null||id!=""){
model.put("ftId", id);
}
String waybillnomaster = request.getParameter("waybillnomaster");
if(waybillnomaster!=null||waybillnomaster!=""){
model.put("waybillnomaster", waybillnomaster);
}
// ManifestItem item = itemService.selectByPrimaryKey(id);
// model.put("item", item);
return "lost/change/item";
}
@RequestMapping(value ="edit")
public String edit(ModelMap model,HttpServletRequest request) {
model.put("waybillnomaster", request.getParameter("waybillnomaster"));
model.put("ftId", request.getParameter("id"));
return "lost/change/edit";
}
@ResponseBody
@RequestMapping(value = "getList")
public String getList(HttpServletRequest request,int page,int limit){
int start = (page-1)*limit+1;
int end = page*limit;
List<ManifestLostChange> lost = lostChangeService.getList(start,end);
ManifestLostChange ft = new ManifestLostChange();
int count = lostChangeService.getCount(ft);
Map<String,Object> map = new HashMap<>();
if(!lost.isEmpty()){
map.put("code", 0);
map.put("count", count);
map.put("msg", "success");
map.put("data", lost);
}else {
map.put("code", -1);
map.put("msg", "请检查网络连接或重试");
map.put("data", "");
}
return JsonConversion.writeMapJSON(map);
}
@ResponseBody
@RequestMapping(value = "getIteamList")
public String getIteamList(HttpServletRequest request,String waybillnomaster){
Map<String,Object> map = new HashMap<>();
try {
if(waybillnomaster!=null && waybillnomaster!=""){
List<ManifestItem> ltem = itemService.getIteamList(waybillnomaster);
if(!ltem.isEmpty()){
map.put("code", 0);
map.put("msg", "success");
map.put("data", ltem);
}else {
map.put("code", 0);
map.put("msg", "");
map.put("data", "");
}
}
} catch (Exception e) {
map.put("code", -1);
map.put("msg", "请检查网络连接或重试");
map.put("data", "");
e.printStackTrace();
}
return JsonConversion.writeMapJSON(map);
}
@ResponseBody
@RequestMapping(value = "selectByParam")
public String selectByParam(HttpServletRequest request,int page,int limit,String flightno,String flightdate,String waybillnomaster,String waybillnosecondary){
int start = (page-1)*limit+1;
int end = page*limit;
List<ManifestLostChange> lost = lostChangeService.selectByParam(start,end,flightno,flightdate,waybillnomaster,waybillnosecondary);
ManifestLostChange fs = new ManifestLostChange();
fs.setFlightno(flightno);
int count = lostChangeService.getCount(fs);
Map<String,Object> map = new HashMap<>();
if(!lost.isEmpty()){
map.put("code", 0);
map.put("count", count);
map.put("msg", "success");
map.put("data", lost);
}else {
map.put("code", -1);
map.put("msg", "无此条件信息");
map.put("data", "");
}
return JsonConversion.writeMapJSON(map);
}
/**
* 编辑或新增
* @param lost
* @param redirectAttributes
* @return
* @throws InvocationTargetException
* @throws IllegalAccessException
*/
@ResponseBody
@RequestMapping(value = "editForm")
public AjaxJson editForm(ModelMap model,@RequestParam Map<String, Object> params) throws IllegalAccessException, InvocationTargetException {
ManifestLostChange lostChange = new ManifestLostChange();
DateConvert();//日期转化
BeanUtils.populate(lostChange, params);
String message = null;
AjaxJson j = new AjaxJson();
if(lostChange.getId()!=null&&lostChange.getId()!=""){ //存在ID 执行更新
try {
lostChangeService.saveorupdate(lostChange);
j.setSuccess(true);
message = "修改成功";
} catch (Exception e) {
j.setSuccess(false);
message = "修改失败";
e.printStackTrace();
}
} else {
try {
lostChangeService.saveorupdate(lostChange);
j.setSuccess(true);
message = "保存成功";
} catch (Exception e) {
j.setSuccess(false);
message = "保存失败";
e.printStackTrace();
}
}
j.setMsg(message);
return j;
}
/**
* 日期转化
*/
public void DateConvert() {
ConvertUtils.register(new Converter() {
@SuppressWarnings("rawtypes")
public Object convert(Class type, Object value) {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
try {
return simpleDateFormat.parse(value.toString());
} catch (ParseException e) {
e.printStackTrace();
}
return null;
}
}, Date.class);
}
/**
* 编辑或新增
* @param lost
* @param redirectAttributes
* @return
* @throws InvocationTargetException
* @throws IllegalAccessException
*/
@ResponseBody
@RequestMapping(value = "editItemData")
public AjaxJson editIteamData(ModelMap model,@RequestParam Map<String, Object> params) throws IllegalAccessException, InvocationTargetException {
ManifestItem ml = new ManifestItem();
BeanUtils.populate(ml, params);
String message = null;
AjaxJson j = new AjaxJson();
try {
itemService.saveorupdate(ml);
j.setSuccess(true);
message = "保存成功";
} catch (Exception e) {
j.setSuccess(false);
message = "保存失败";
e.printStackTrace();
}
j.setMsg(message);
return j;
}
/**
* 删除
* @param lost
* @param redirectAttributes
* @return
*/
@ResponseBody
@RequestMapping(value = "delItem")
public AjaxJson delItem(ModelMap model,HttpServletRequest request) {
String id = request.getParameter("id");
String message = null;
AjaxJson j = new AjaxJson();
try {
itemService.deleteByPrimaryKey(id);
j.setSuccess(true);
message = "删除成功";
} catch (Exception e) {
j.setSuccess(false);
message = "删除失败";
e.printStackTrace();
}
j.setMsg(message);
return j;
}
/**
* 删除
* @param lost
* @param redirectAttributes
* @return
*/
@ResponseBody
@RequestMapping(value = "del")
public AjaxJson delete(ModelMap model,HttpServletRequest request) {
String id = request.getParameter("id");
String message = null;
AjaxJson j = new AjaxJson();
try {
lostChangeService.deleteByPrimaryKey(id);
j.setSuccess(true);
message = "删除成功";
} catch (Exception e) {
j.setSuccess(false);
message = "删除失败";
e.printStackTrace();
}
j.setMsg(message);
return j;
}
/**
* 删除
* @param lost
* @param redirectAttributes
* @return
*/
@ResponseBody
@RequestMapping(value = "updateStatues")
public AjaxJson updateStatues(ModelMap model,HttpServletRequest request) {
String id = request.getParameter("id");
String message = null;
AjaxJson j = new AjaxJson();
try {
ManifestLostChange manifestLoad = lostChangeService.selectByPrimaryKey(id);
manifestLoad.setStatus("");
lostChangeService.updateByPrimaryKeySelective(manifestLoad);
j.setSuccess(true);
message = "修改状态成功";
} catch (Exception e) {
j.setSuccess(false);
message = "修改状态失败";
e.printStackTrace();
}
j.setMsg(message);
return j;
}
/**
* 申报
* @param lost
* @param redirectAttributes
* @return
*/
@ResponseBody
@RequestMapping(value = "send")
public AjaxJson send(ModelMap model,HttpServletRequest request) {
String id = request.getParameter("id");
String flightno = request.getParameter("flightno");
String flightdate = request.getParameter("flightdate");
String waybillnomaster = request.getParameter("waybillnomaster");
String waybillnosecondary = request.getParameter("waybillnosecondary");
String remark = request.getParameter("remark");
String message = null;
AjaxJson j = new AjaxJson();
try {
//保存至sendLog表
Sendlog sendlog = new Sendlog();
sendlog.setAutoid(id);
sendlog.setCreatedate(new Date());
sendlog.setMessagetype("MT8203");
sendlog.setReceiption("发送落装改配申请");
sendLogService.save(sendlog);
//生成报文并发送至文件夹
ManifestXmlEntity manifestXml = new ManifestXmlEntity();
setParam(flightno, flightdate, waybillnomaster, waybillnosecondary, remark, manifestXml);
XmlGen.genLostXmlAndSend(manifestXml);
j.setSuccess(true);
message = "已发送申报报文";
ManifestLostChange lost = lostChangeService.selectByPrimaryKey(id);
lost.setStatus("01");//已发送
lostChangeService.saveorupdate(lost);
} catch (Exception e) {
j.setSuccess(false);
message = "申报报文发送失败";
e.printStackTrace();
}
j.setMsg(message);
return j;
}
/**
* @param flightno
* @param flightdate
* @param waybillnomaster
* @param waybillnosecondary
* @param remark
* @param manifestXml
*/
public void setParam(String flightno, String flightdate, String waybillnomaster, String waybillnosecondary,
String remark, ManifestXmlEntity manifestXml) {
HeadXmlEntity headXml = new HeadXmlEntity();
DeclarationXmlEntity declarationXml = new DeclarationXmlEntity();
BorderTransportMeans transportMeans = new BorderTransportMeans();
transportMeans.setJourneyID(flightno+"/"+flightdate.substring(0,10).replace("-", ""));//航次航班
AdditionalInformation information = new AdditionalInformation();
information.setContent(remark);
Consignment consignment = new Consignment();
TransportContractDocument transportContractDocument = new TransportContractDocument();
transportContractDocument.setId(waybillnomaster);//主单号
AssociatedTransportDocument associatedTransportDocument = new AssociatedTransportDocument();
associatedTransportDocument.setId(waybillnomaster+"_"+waybillnosecondary);//分单号
consignment.setAssociatedTransportDocument(associatedTransportDocument );
consignment.setTransportContractDocument(transportContractDocument );
declarationXml.setAdditionalInformation(information);
declarationXml.setBorderTransportMeans(transportMeans);
declarationXml.setConsignment(consignment);
manifestXml.setHeadXml(headXml);
manifestXml.setDeclarationXml(declarationXml);
}
}
... ...
package com.tianbo.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.tianbo.model.ManifestLoad;
public interface LostMapper {
List<ManifestLoad> getList(@Param("start")int start, @Param("end")int end);
int getCount(ManifestLoad fs);
void del(@Param("id")String id);
void insert(ManifestLoad ft);
void update(ManifestLoad ft);
List<ManifestLoad> selectByFlightno(@Param("start")int start, @Param("end")int end, @Param("flightno")String flightno);
ManifestLoad get(String id);
List<ManifestLoad> selectByParam(@Param("start")int start, @Param("end")int end, @Param("flightno")String flightno,@Param("flightdate")String flightdate,@Param("waybillnomaster")String waybillnomaster,@Param("waybillnosecondary")String waybillnosecondary);
}
\ No newline at end of file
... ...
package com.tianbo.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.tianbo.model.ManifestItem;
public interface ManifestItemMapper {
int deleteByPrimaryKey(String id);
int insert(ManifestItem record);
int insertSelective(ManifestItem record);
ManifestItem selectByPrimaryKey(String id);
int updateByPrimaryKeySelective(ManifestItem record);
int updateByPrimaryKey(ManifestItem record);
List<ManifestItem> getIteamList(@Param("waybillnomaster")String waybillnomaster);
}
\ No newline at end of file
... ...
package com.tianbo.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.tianbo.model.ManifestLostChange;
public interface ManifestLostChangeMapper {
int deleteByPrimaryKey(String id);
int insert(ManifestLostChange record);
int insertSelective(ManifestLostChange record);
ManifestLostChange selectByPrimaryKey(String id);
int updateByPrimaryKeySelective(ManifestLostChange record);
int updateByPrimaryKey(ManifestLostChange record);
List<ManifestLostChange> getList(@Param("start")int start, @Param("end")int end);
int getCount(ManifestLostChange lostChange);
List<ManifestLostChange> selectByParam(@Param("start")int start, @Param("end")int end, @Param("flightno")String flightno,@Param("flightdate")String flightdate,@Param("waybillnomaster")String waybillnomaster,@Param("waybillnosecondary")String waybillnosecondary);
}
\ No newline at end of file
... ...
... ... @@ -12,7 +12,7 @@ public interface SendlogMapper {
int deleteByExample(SendlogExample example);
int insert(Sendlog record);
int insert(Sendlog sendlog);
int insertSelective(Sendlog record);
... ... @@ -28,4 +28,5 @@ public interface SendlogMapper {
List<Sendlog> getSendLogSecond(String billNoSecond);
List<Sendlog> getSendLogSecondByMain(String billNo);
}
\ No newline at end of file
... ...
... ... @@ -95,7 +95,7 @@ public class FlightSetting {
public void setWeek(String week) {
this.week = week;
}
public String getId() {
return id;
}
... ...
package com.tianbo.model;
public class ManifestItem {
private String id;
private String waybillnomaster;
private String piece;
private String packageCode;
private String shippingMarks;
private String dangerousCode;
private String containerNumber;
private String customProcedureCode;
private String customTariffCode;
private String consignCode;
private String originalCode;
private String description;
private String remark;
private String weight;
private String orderNumber;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id == null ? null : id.trim();
}
public String getWaybillnomaster() {
return waybillnomaster;
}
public void setWaybillnomaster(String waybillnomaster) {
this.waybillnomaster = waybillnomaster == null ? null : waybillnomaster.trim();
}
public String getPiece() {
return piece;
}
public void setPiece(String piece) {
this.piece = piece == null ? null : piece.trim();
}
public String getPackageCode() {
return packageCode;
}
public void setPackageCode(String packageCode) {
this.packageCode = packageCode == null ? null : packageCode.trim();
}
public String getShippingMarks() {
return shippingMarks;
}
public void setShippingMarks(String shippingMarks) {
this.shippingMarks = shippingMarks == null ? null : shippingMarks.trim();
}
public String getDangerousCode() {
return dangerousCode;
}
public void setDangerousCode(String dangerousCode) {
this.dangerousCode = dangerousCode == null ? null : dangerousCode.trim();
}
public String getContainerNumber() {
return containerNumber;
}
public void setContainerNumber(String containerNumber) {
this.containerNumber = containerNumber == null ? null : containerNumber.trim();
}
public String getCustomProcedureCode() {
return customProcedureCode;
}
public void setCustomProcedureCode(String customProcedureCode) {
this.customProcedureCode = customProcedureCode == null ? null : customProcedureCode.trim();
}
public String getCustomTariffCode() {
return customTariffCode;
}
public void setCustomTariffCode(String customTariffCode) {
this.customTariffCode = customTariffCode == null ? null : customTariffCode.trim();
}
public String getConsignCode() {
return consignCode;
}
public void setConsignCode(String consignCode) {
this.consignCode = consignCode == null ? null : consignCode.trim();
}
public String getOriginalCode() {
return originalCode;
}
public void setOriginalCode(String originalCode) {
this.originalCode = originalCode == null ? null : originalCode.trim();
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description == null ? null : description.trim();
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark == null ? null : remark.trim();
}
public String getWeight() {
return weight;
}
public void setWeight(String weight) {
this.weight = weight == null ? null : weight.trim();
}
public String getOrderNumber() {
return orderNumber;
}
public void setOrderNumber(String orderNumber) {
this.orderNumber = orderNumber == null ? null : orderNumber.trim();
}
}
\ No newline at end of file
... ...
package com.tianbo.model;
import java.util.Date;
public class ManifestLoad {
private String id;
private String flightno;
private Date flightdate;
private String waybillnomaster;
private String waybillnosecondary;
private String remark;
private String status;
private String receiption;
private Date createdate;
public Date getCreatedate() {
return createdate;
}
public void setCreatedate(Date createdate) {
this.createdate = createdate;
}
public String getFlightno() {
return flightno;
}
public void setFlightno(String flightno) {
this.flightno = flightno;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public String getReceiption() {
return receiption;
}
public void setReceiption(String receiption) {
this.receiption = receiption;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public Date getFlightdate() {
return flightdate;
}
public void setFlightdate(Date flightdate) {
this.flightdate = flightdate;
}
public String getWaybillnomaster() {
return waybillnomaster;
}
public void setWaybillnomaster(String waybillnomaster) {
this.waybillnomaster = waybillnomaster;
}
public String getWaybillnosecondary() {
return waybillnosecondary;
}
public void setWaybillnosecondary(String waybillnosecondary) {
this.waybillnosecondary = waybillnosecondary;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
}
... ...
package com.tianbo.model;
import java.util.Date;
public class ManifestLostChange {
private String id;
private String flightno;
private Date flightdate;
private String waybillnomaster;
private String waybillnosecondary;
private String cwaybillnomaster;
private String cwaybillnosecondary;
private Date createdate;
private String status;
private String receiption;
private String cflightno;
private Date cflightdate;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id == null ? null : id.trim();
}
public String getFlightno() {
return flightno;
}
public void setFlightno(String flightno) {
this.flightno = flightno == null ? null : flightno.trim();
}
public Date getFlightdate() {
return flightdate;
}
public void setFlightdate(Date flightdate) {
this.flightdate = flightdate;
}
public String getWaybillnomaster() {
return waybillnomaster;
}
public void setWaybillnomaster(String waybillnomaster) {
this.waybillnomaster = waybillnomaster == null ? null : waybillnomaster.trim();
}
public String getWaybillnosecondary() {
return waybillnosecondary;
}
public void setWaybillnosecondary(String waybillnosecondary) {
this.waybillnosecondary = waybillnosecondary == null ? null : waybillnosecondary.trim();
}
public String getCwaybillnomaster() {
return cwaybillnomaster;
}
public void setCwaybillnomaster(String cwaybillnomaster) {
this.cwaybillnomaster = cwaybillnomaster == null ? null : cwaybillnomaster.trim();
}
public String getCwaybillnosecondary() {
return cwaybillnosecondary;
}
public void setCwaybillnosecondary(String cwaybillnosecondary) {
this.cwaybillnosecondary = cwaybillnosecondary == null ? null : cwaybillnosecondary.trim();
}
public Date getCreatedate() {
return createdate;
}
public void setCreatedate(Date createdate) {
this.createdate = createdate;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status == null ? null : status.trim();
}
public String getReceiption() {
return receiption;
}
public void setReceiption(String receiption) {
this.receiption = receiption == null ? null : receiption.trim();
}
public String getCflightno() {
return cflightno;
}
public void setCflightno(String cflightno) {
this.cflightno = cflightno == null ? null : cflightno.trim();
}
public Date getCflightdate() {
return cflightdate;
}
public void setCflightdate(Date cflightdate) {
this.cflightdate = cflightdate;
}
}
\ No newline at end of file
... ...
package com.tianbo.service;
import java.util.List;
import com.tianbo.model.ManifestItem;
public interface ItemService {
ManifestItem selectByPrimaryKey(String id);
void saveorupdate(ManifestItem manifest);
void deleteByPrimaryKey(String id);
void insertSelective(ManifestItem manifest);
void updateByPrimaryKeySelective(ManifestItem manifest);
List<ManifestItem> getIteamList(String flightno);
}
... ...
package com.tianbo.service;
import java.util.List;
import com.tianbo.model.ManifestLostChange;
public interface LostChangeService {
List<ManifestLostChange> getList(int start, int end);
int getCount(ManifestLostChange ft);
List<ManifestLostChange> selectByParam(int start, int end, String flightno, String flightdate,
String waybillnomaster, String waybillnosecondary);
ManifestLostChange selectByPrimaryKey(String id);
void saveorupdate(ManifestLostChange manifest);
void deleteByPrimaryKey(String id);
void insertSelective(ManifestLostChange manifestLoad);
void updateByPrimaryKeySelective(ManifestLostChange manifestLoad);
}
... ...
package com.tianbo.service;
import java.util.List;
import com.tianbo.model.ManifestLoad;
public interface LostService {
List<ManifestLoad> getList(int start, int end);
int getCount(ManifestLoad mf);
void del(String id);
void saveorupdate(ManifestLoad mf);
List<ManifestLoad> selectByFlightno(int start, int end, String flightno);
public ManifestLoad findById(String id);
List<ManifestLoad> selectByParam(int start, int end, String flightno, String flightdate, String waybillnomaster,String waybillnosecondary);
}
... ...
... ... @@ -13,4 +13,5 @@ public interface SendLogService {
public List<Sendlog> getSendLogSecondByMain(String billNo);
public void save(Sendlog sendlog);
}
... ...
package com.tianbo.service.imp;
import java.util.List;
import java.util.UUID;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.tianbo.mapper.ManifestItemMapper;
import com.tianbo.model.ManifestItem;
import com.tianbo.service.ItemService;
@Service
@Transactional
public class ItemServiceImp implements ItemService{
@Autowired
private ManifestItemMapper ItemDao;
@Override
public ManifestItem selectByPrimaryKey(String id) {
// TODO Auto-generated method stub
return ItemDao.selectByPrimaryKey(id);
}
@Override
public void saveorupdate(ManifestItem manifest) {
if (manifest.getId()==null||manifest.getId()==""){
manifest.setId(UUID.randomUUID().toString());
ItemDao.insert(manifest);
}else{
// 更新用户数据
ItemDao.updateByPrimaryKeySelective(manifest);
}
}
@Override
public void deleteByPrimaryKey(String id) {
// TODO Auto-generated method stub
ItemDao.deleteByPrimaryKey(id);
}
@Override
public void insertSelective(ManifestItem manifest) {
// TODO Auto-generated method stub
ItemDao.insertSelective(manifest);
}
@Override
public void updateByPrimaryKeySelective(ManifestItem manifest) {
// TODO Auto-generated method stub
ItemDao.updateByPrimaryKeySelective(manifest);
}
@Override
public List<ManifestItem> getIteamList(String waybillnomaster) {
// TODO Auto-generated method stub
return ItemDao.getIteamList(waybillnomaster);
}
}
... ...
package com.tianbo.service.imp;
import java.util.Date;
import java.util.List;
import java.util.UUID;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.tianbo.mapper.ManifestLostChangeMapper;
import com.tianbo.model.ManifestLostChange;
import com.tianbo.service.LostChangeService;
@Service
@Transactional
public class LostChangeServiceImp implements LostChangeService{
@Autowired
private ManifestLostChangeMapper lostChangeDao;
@Override
public List<ManifestLostChange> getList(int start, int end) {
// TODO Auto-generated method stub
return lostChangeDao.getList(start,end);
}
@Override
public int getCount(ManifestLostChange lostChange) {
return lostChangeDao.getCount(lostChange);
}
@Override
public List<ManifestLostChange> selectByParam(int start, int end, String flightno, String flightdate,
String waybillnomaster, String waybillnosecondary) {
// TODO Auto-generated method stub
return lostChangeDao.selectByParam(start,end,flightno,flightdate,waybillnomaster,waybillnosecondary);
}
@Override
public ManifestLostChange selectByPrimaryKey(String id) {
// TODO Auto-generated method stub
return lostChangeDao.selectByPrimaryKey(id);
}
@Override
public void saveorupdate(ManifestLostChange manifest) {
if (manifest.getId()==null||manifest.getId()==""){
manifest.setId(UUID.randomUUID().toString());
manifest.setCreatedate(new Date());
lostChangeDao.insert(manifest);
}else{
// 更新用户数据
manifest.setCreatedate(new Date());
lostChangeDao.updateByPrimaryKeySelective(manifest);
}
}
@Override
public void deleteByPrimaryKey(String id) {
lostChangeDao.deleteByPrimaryKey(id);
}
@Override
public void insertSelective(ManifestLostChange manifestLoad) {
// TODO Auto-generated method stub
lostChangeDao.insertSelective(manifestLoad);
}
@Override
public void updateByPrimaryKeySelective(ManifestLostChange manifestLoad) {
// TODO Auto-generated method stub
lostChangeDao.updateByPrimaryKeySelective(manifestLoad);
}
}
... ...
package com.tianbo.service.imp;
import java.util.Date;
import java.util.List;
import java.util.UUID;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.tianbo.mapper.LostMapper;
import com.tianbo.model.ManifestLoad;
import com.tianbo.service.LostService;
@Service
@Transactional
public class LostServiceImp implements LostService{
@Autowired
private LostMapper lostDao;
@Override
public List<ManifestLoad> getList(int start, int end) {
return lostDao.getList(start,end);
}
@Override
public int getCount(ManifestLoad fs) {
return lostDao.getCount(fs);
}
@Override
public void del(String id) {
lostDao.del(id);
}
@Override
public void saveorupdate(ManifestLoad ft) {
if (ft.getId()==null||ft.getId()==""){
ft.setId(UUID.randomUUID().toString());
ft.setCreatedate(new Date());
lostDao.insert(ft);
}else{
// 更新用户数据
ft.setCreatedate(new Date());
lostDao.update(ft);
}
}
@Override
public List<ManifestLoad> selectByFlightno(int start, int end, String flightno) {
return lostDao.selectByFlightno(start,end,flightno);
}
@Override
public ManifestLoad findById(String id) {
// TODO Auto-generated method stub
return lostDao.get(id);
}
@Override
public List<ManifestLoad> selectByParam(int start, int end, String flightno, String flightdate,
String waybillnomaster, String waybillnosecondary) {
// TODO Auto-generated method stub
return lostDao.selectByParam(start,end,flightno,flightdate,waybillnomaster,waybillnosecondary);
}
}
... ...
... ... @@ -31,5 +31,11 @@ public class SendLogServiceImpl implements SendLogService {
// TODO Auto-generated method stub
return sendlogDao.getSendLogSecondByMain(billNo);
}
@Override
public void save(Sendlog sendlog) {
sendlogDao.insert(sendlog);
}
}
... ...
package com.tianbo.util;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.math.BigDecimal;
import java.sql.Timestamp;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.converters.Converter;
import com.thoughtworks.xstream.converters.MarshallingContext;
import com.thoughtworks.xstream.converters.UnmarshallingContext;
import com.thoughtworks.xstream.io.HierarchicalStreamReader;
import com.thoughtworks.xstream.io.HierarchicalStreamWriter;
public class NullConverter implements Converter {
private Map<Class<?>, List<String>> attributes = null;
public void regAttribute(Class<?> type, String attribute)
{
if (null == attributes)
{
attributes = new HashMap<Class<?>, List<String>>();
}
List value = attributes.get(type);
if (null == value)
{
value = new ArrayList<String>();
attributes.put(type, value);
}
value.add(attribute);
}
/**
* 是否是属性(是属性的不用以单独标签实现)
* @param type
* @param attribute
* @return
*/
public boolean isClassAttribute(Class<?> type,String attribute) {
List<String> value = getAttributes(type);
if (type.equals(Integer.class) || type.equals(Double.class)
|| type.equals(Long.class) || type.equals(Short.class)
|| type.equals(Float.class) || type.equals(BigDecimal.class)
|| type.equals(int.class) || type.equals(float.class)
|| type.equals(long.class) || type.equals(double.class)
|| type.equals(short.class)) {
return true;
}
return false;
}
/**
* 获取注册的属性
* @param type
* @return
*/
public List<String> getAttributes(Class<?> type) {
if (null != attributes){
return attributes.get(type);
}
return null;
}
/**
* 输出对象的属性标签
* @param source
* @param writer
*/
public void writerAttribute (Object source, HierarchicalStreamWriter writer) {
Class cType = source.getClass();
List<String> value = getAttributes(cType);
if ((null != value) && (value.size() > 0)){
Method[] methods = cType.getMethods();
for (Method method : methods){
String methodName = method.getName();
if (methodName.indexOf("get") != -1 && methodName != "getClass") {
String name = methodName.substring(3);
name = name.toLowerCase();
if (value.contains(name)){
Object o = null;
try {
o = method.invoke(source, null);
} catch (Exception e) {
e.printStackTrace();
}
writer.addAttribute(name, o==null?"":o.toString());
}
}
}
}
}
@SuppressWarnings("unchecked")
public void marshal(Object source, HierarchicalStreamWriter writer,
MarshallingContext context) {
if (null == source)
return;
Class cType = source.getClass();
Field[] fields = cType.getDeclaredFields();
if (source instanceof List) {
List list = (List) source;
for (Object obj : list) {
XStreamAlias alias = obj.getClass().getAnnotation(XStreamAlias.class);
if (alias != null) {
writer.startNode(alias.value());
marshal(obj, writer, context);
writer.endNode();
}else {
marshal(obj, writer, context);
}
}
} else {
for (Field field : fields) {
//获得get方法
String temp1 = "get"
+ field.getName().substring(0, 1).toUpperCase()
+ field.getName().substring(1);
Method m = null;
try {
m = cType.getMethod(temp1, null);
} catch (SecurityException e1) {
e1.printStackTrace();
} catch (NoSuchMethodException e1) {
e1.printStackTrace();
}
String methodName = m.getName();
if (methodName.indexOf("get") != -1 && methodName != "getClass") {
boolean isBaseType = isBaseType(m.getReturnType());
String name = methodName.substring(3);
Object o = null;
try {
o = m.invoke(source, null);
} catch (Exception e) {
e.printStackTrace();
}
//递归打出基础类型值
if (isBaseType) {
if(getAliasByNameAndType(name, cType)!=null){
writer.startNode(getAliasByNameAndType(name, cType).value());
writeData(o, m.getReturnType(), writer);
writer.endNode();
}
} else {
XStreamAlias alias = getAliasByNameAndType(name, cType);
if (alias == null) {
marshal(o, writer, context);
} else {
writer.startNode(alias.value());
marshal(o, writer, context);
writer.endNode();
}
}
}
}
}
}
/**
* 根据Name和类获得Xstream注解
* @param name
* Name
* @param cType
* 类
* @return
* XStreamAlias
*/
private XStreamAlias getAliasByNameAndType(String name,Class<?> cType){
String temp = name.substring(0, 1).toLowerCase()
+ name.substring(1);
Field f = null;
try {
f = cType.getDeclaredField(temp);
} catch (SecurityException e) {
e.printStackTrace();
} catch (NoSuchFieldException e) {
e.printStackTrace();
}
XStreamAlias alias = f.getAnnotation(XStreamAlias.class);
return alias;
}
/**
* 改写输出XML
* @param o
* @param ReturnType
* @param writer
*/
private void writeData(Object o,Class<?> ReturnType,HierarchicalStreamWriter writer) {
//如果是数字类型的话就要预设为0而不能为空
if (isNumValueType(ReturnType)) {
if (o == null) {
writer.setValue("0");
}else if (ReturnType.equals(Double.class)||ReturnType.equals(double.class)||ReturnType.equals(BigDecimal.class)) {
DecimalFormat df = new DecimalFormat("#.##");
writer.setValue(df.format(o));
}else {
writer.setValue(o.toString());
}
} else {
writer.setValue(o == null ? "" : o.toString());
}
}
public Object unmarshal(HierarchicalStreamReader reader,
UnmarshallingContext context) {
return null;
}
public boolean canConvert(Class type) {
return true;
}
/**
* 判断是否为基本类型
* @param type
* @return
* boolean
*/
private boolean isBaseType(Class<?> type) {
if (type.equals(Integer.class) || type.equals(Double.class)
|| type.equals(String.class) || type.equals(Boolean.class)
|| type.equals(Long.class) || type.equals(Short.class)
|| type.equals(Byte.class) || type.equals(Float.class)
|| type.equals(BigDecimal.class) || type.equals(int.class)
|| type.equals(float.class) || type.equals(long.class)
|| type.equals(double.class) || type.equals(short.class)
|| type.equals(boolean.class) || type.equals(byte.class)
|| type.equals(Timestamp.class)) {
return true;
}
return false;
}
/**
* 判断是否为数字类型
* @param type
* @return
* boolean
*/
public boolean isNumValueType(Class<?> type) {
if (type.equals(Integer.class) || type.equals(Double.class)
|| type.equals(Long.class) || type.equals(Short.class)
|| type.equals(Float.class) || type.equals(BigDecimal.class)
|| type.equals(int.class) || type.equals(float.class)
|| type.equals(long.class) || type.equals(double.class)
|| type.equals(short.class)) {
return true;
}
return false;
}
}
\ No newline at end of file
... ...
package com.tianbo.util.xml;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.math.BigDecimal;
import java.sql.Timestamp;
import java.text.DecimalFormat;
import java.util.List;
import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.converters.Converter;
import com.thoughtworks.xstream.converters.MarshallingContext;
import com.thoughtworks.xstream.converters.UnmarshallingContext;
import com.thoughtworks.xstream.io.HierarchicalStreamReader;
import com.thoughtworks.xstream.io.HierarchicalStreamWriter;
public class NullConverter implements Converter {
@SuppressWarnings("unchecked")
public void marshal(Object source, HierarchicalStreamWriter writer,
MarshallingContext context) {
if (null == source)
return;
Class cType = source.getClass();
Field[] fields = cType.getDeclaredFields();
if (source instanceof List) {
List list = (List) source;
for (Object obj : list) {
XStreamAlias alias = obj.getClass().getAnnotation(XStreamAlias.class);
if (alias != null) {
writer.startNode(alias.value());
marshal(obj, writer, context);
writer.endNode();
}else {
marshal(obj, writer, context);
}
}
} else {
for (Field field : fields) {
//获得get方法
String temp1 = "get"
+ field.getName().substring(0, 1).toUpperCase()
+ field.getName().substring(1);
Method m = null;
try {
m = cType.getMethod(temp1, null);
} catch (SecurityException e1) {
e1.printStackTrace();
} catch (NoSuchMethodException e1) {
e1.printStackTrace();
}
String methodName = m.getName();
if (methodName.indexOf("get") != -1 && methodName != "getClass") {
boolean isBaseType = isBaseType(m.getReturnType());
String name = methodName.substring(3);
Object o = null;
try {
o = m.invoke(source, null);
} catch (Exception e) {
e.printStackTrace();
}
//递归打出基础类型值
if (isBaseType) {
if(getAliasByNameAndType(name, cType)!=null){
writer.startNode(getAliasByNameAndType(name, cType).value());
writeData(o, m.getReturnType(), writer);
writer.endNode();
}
} else {
XStreamAlias alias = getAliasByNameAndType(name, cType);
if (alias == null) {
marshal(o, writer, context);
} else {
writer.startNode(alias.value());
marshal(o, writer, context);
writer.endNode();
}
}
}
}
}
}
/**
* 根据Name和类获得Xstream注解
* @param name
* Name
* @param cType
* 类
* @return
* XStreamAlias
*/
private XStreamAlias getAliasByNameAndType(String name,Class<?> cType){
String temp = name.substring(0, 1).toLowerCase()
+ name.substring(1);
Field f = null;
try {
f = cType.getDeclaredField(temp);
} catch (SecurityException e) {
e.printStackTrace();
} catch (NoSuchFieldException e) {
e.printStackTrace();
}
XStreamAlias alias = f.getAnnotation(XStreamAlias.class);
return alias;
}
/**
* 改写输出XML
* @param o
* @param ReturnType
* @param writer
*/
private void writeData(Object o,Class<?> ReturnType,HierarchicalStreamWriter writer) {
//如果是数字类型的话就要预设为0而不能为空
if (isNumValueType(ReturnType)) {
if (o == null) {
writer.setValue("0");
}else if (ReturnType.equals(Double.class)||ReturnType.equals(double.class)||ReturnType.equals(BigDecimal.class)) {
DecimalFormat df = new DecimalFormat("#.##");
writer.setValue(df.format(o));
}else {
writer.setValue(o.toString());
}
} else {
writer.setValue(o == null ? "" : o.toString());
}
}
public Object unmarshal(HierarchicalStreamReader reader,
UnmarshallingContext context) {
return null;
}
public boolean canConvert(Class type) {
return true;
}
/**
* 判断是否为基本类型
* @param type
* @return
* boolean
*/
private boolean isBaseType(Class<?> type) {
if (type.equals(Integer.class) || type.equals(Double.class)
|| type.equals(String.class) || type.equals(Boolean.class)
|| type.equals(Long.class) || type.equals(Short.class)
|| type.equals(Byte.class) || type.equals(Float.class)
|| type.equals(BigDecimal.class) || type.equals(int.class)
|| type.equals(float.class) || type.equals(long.class)
|| type.equals(double.class) || type.equals(short.class)
|| type.equals(boolean.class) || type.equals(byte.class)
|| type.equals(Timestamp.class)) {
return true;
}
return false;
}
/**
* 判断是否为数字类型
* @param type
* @return
* boolean
*/
public boolean isNumValueType(Class<?> type) {
if (type.equals(Integer.class) || type.equals(Double.class)
|| type.equals(Long.class) || type.equals(Short.class)
|| type.equals(Float.class) || type.equals(BigDecimal.class)
|| type.equals(int.class) || type.equals(float.class)
|| type.equals(long.class) || type.equals(double.class)
|| type.equals(short.class)) {
return true;
}
return false;
}
}
\ No newline at end of file
... ...
package com.tianbo.util.xml;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.nio.charset.Charset;
import org.springframework.stereotype.Component;
import com.thoughtworks.xstream.XStream;
import com.tianbo.util.DateUtils;
import com.tianbo.util.NullConverter;
import com.tianbo.util.PropertiesUtils;
import com.tianbo.xml.lost.ManifestXmlEntity;
@Component
public class XmlGen {
/**
* 生成落装申请报文
* @param entity
*/
public static String genLostXmlAndSend(ManifestXmlEntity xmlVO){
String xmlFileName = "CN_MT8202_1P0_460470678920X_" + DateUtils.currentFormatDate("yyyyMMddHHmmssSSS") + ".xml";
XStream xstream = new XStream();
xstream.autodetectAnnotations(true);
xstream.registerConverter(new NullConverter());
String xml = xstream.toXML(xmlVO);
xml="<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"+xml;
xml=xml.replace("__", "_");
String xmlPath =PropertiesUtils.readProperty("MT8202Path")+xmlFileName;
xml2File(xmlVO, xmlFileName, xstream,xmlPath);
return xml;
}
/**
* 生成落装改配申请报文
* @param entity
*/
public static String genLostChangeXmlAndSend(ManifestXmlEntity xmlVO){
String xmlFileName = "CN_MT8202_1P0_460470678920X_" + DateUtils.currentFormatDate("yyyyMMddHHmmssSSS") + ".xml";
XStream xstream = new XStream();
xstream.autodetectAnnotations(true);
xstream.registerConverter(new NullConverter());
String xml = xstream.toXML(xmlVO);
xml="<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"+xml;
xml=xml.replace("__", "_");
String xmlPath =PropertiesUtils.readProperty("MT8202Path")+xmlFileName;
xml2File(xmlVO, xmlFileName, xstream,xmlPath);
return xml;
}
/**
* @param xmlVO
* @param xmlFileName
* @param xstream
*/
public static void xml2File(ManifestXmlEntity xmlVO, String xmlFileName, XStream xstream,String xmlPath) {
File file = new File(xmlPath);
if (!file.exists()) {
try {
file.createNewFile();
System.out.println("文件创建成功!");
} catch (IOException e) {
System.out.println("文件创建失败!");
e.printStackTrace();
}
}
OutputStream out;
try {
out = new FileOutputStream(file);
OutputStreamWriter writer = new OutputStreamWriter(out,Charset.forName("UTF-8"));
writer.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
xstream.toXML(xmlVO, writer);
out.close();
writer.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
}catch (IOException e) {
e.printStackTrace();
}
}
}
\ No newline at end of file
... ...
package com.tianbo.util.xml;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.nio.charset.Charset;
import org.junit.Test;
import com.thoughtworks.xstream.XStream;
import com.thoughtworks.xstream.io.xml.DomDriver;
public class xmlUtils {
private Object obj;
@Test // 将对象信息写入xml文件
public void writeXML() {
XStream xstream = new XStream(new DomDriver("utf-8"));
String xmlFileName = "student.xml";
File file = new File("C:\\Users\\admin\\Desktop\\" + xmlFileName);
if (!file.exists()) {
try {
file.createNewFile();
System.out.println("文件创建成功!");
} catch (IOException e) {
System.out.println("文件创建失败!");
e.printStackTrace();
}
}
// String xml = xstream.toXML(student);//不会直接生成xml文件,返回的仅仅只是xml文本字符串
// System.out.println(xml);
OutputStream out;
try {
out = new FileOutputStream(file);
OutputStreamWriter writer = new OutputStreamWriter(out, Charset.forName("GBK"));
writer.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
xstream.toXML(obj, writer);
out.close();
writer.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
}
... ...
package com.tianbo.xml.lost;
import com.thoughtworks.xstream.annotations.XStreamAlias;
public class AdditionalInformation {
@XStreamAlias("Content")
private String content;
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
}
... ...
package com.tianbo.xml.lost;
import com.thoughtworks.xstream.annotations.XStreamAlias;
public class AssociatedTransportDocument {
@XStreamAlias("ID")
private String id;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
}
... ...
package com.tianbo.xml.lost;
import com.thoughtworks.xstream.annotations.XStreamAlias;
public class BorderTransportMeans {
@XStreamAlias("JourneyID")
private String journeyID;
public String getJourneyID() {
return journeyID;
}
public void setJourneyID(String journeyID) {
this.journeyID = journeyID;
}
}
... ...
package com.tianbo.xml.lost;
import com.thoughtworks.xstream.annotations.XStreamAlias;
public class Consignment {
@XStreamAlias("TransportContractDocument")
private TransportContractDocument transportContractDocument;
@XStreamAlias("AssociatedTransportDocument")
private AssociatedTransportDocument associatedTransportDocument;
public TransportContractDocument getTransportContractDocument() {
return transportContractDocument;
}
public void setTransportContractDocument(TransportContractDocument transportContractDocument) {
this.transportContractDocument = transportContractDocument;
}
public AssociatedTransportDocument getAssociatedTransportDocument() {
return associatedTransportDocument;
}
public void setAssociatedTransportDocument(AssociatedTransportDocument associatedTransportDocument) {
this.associatedTransportDocument = associatedTransportDocument;
}
}
... ...
package com.tianbo.xml.lost;
import com.thoughtworks.xstream.annotations.XStreamAlias;
public class DeclarationXmlEntity {
@XStreamAlias("BorderTransportMeans")
private BorderTransportMeans borderTransportMeans;
@XStreamAlias("Consignment")
private Consignment consignment;
@XStreamAlias("AdditionalInformation")
private AdditionalInformation additionalInformation;
public BorderTransportMeans getBorderTransportMeans() {
return borderTransportMeans;
}
public void setBorderTransportMeans(BorderTransportMeans borderTransportMeans) {
this.borderTransportMeans = borderTransportMeans;
}
public Consignment getConsignment() {
return consignment;
}
public void setConsignment(Consignment consignment) {
this.consignment = consignment;
}
public AdditionalInformation getAdditionalInformation() {
return additionalInformation;
}
public void setAdditionalInformation(AdditionalInformation additionalInformation) {
this.additionalInformation = additionalInformation;
}
}
... ...
package com.tianbo.xml.lost;
import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.tianbo.util.DateUtils;
public class HeadXmlEntity {
@XStreamAlias("MessageID")
private String messageId="CN_MT8202_1P0_460470678920X_" + DateUtils.currentFormatDate("yyyyMMddHHmmssSSS");
@XStreamAlias("FunctionCode")
private String functionCode="2";
@XStreamAlias("MessageType")
private String messageType="MT8202";
@XStreamAlias("SenderID")
private String senderId="460470678920X_DXPENT0000460002";
@XStreamAlias("ReceiverID")
private String receiverId="4604";
@XStreamAlias("SendTime")
private String sendTime=DateUtils.currentFormatDate("yyyyMMddHHmmssSSS");
@XStreamAlias("Version")
private String version="1.0";
public String getMessageType() {
return messageType;
}
public void setMessageType(String messageType) {
this.messageType = messageType;
}
public String getMessageId() {
return messageId;
}
public void setMessageId(String messageId) {
this.messageId = messageId;
}
public String getSenderId() {
return senderId;
}
public void setSenderId(String senderId) {
this.senderId = senderId;
}
public String getReceiverId() {
return receiverId;
}
public void setReceiverId(String receiverId) {
this.receiverId = receiverId;
}
public String getFunctionCode() {
return functionCode;
}
public void setFunctionCode(String functionCode) {
this.functionCode = functionCode;
}
public String getVersion() {
return version;
}
public void setVersion(String version) {
this.version = version;
}
public String getSendTime() {
return sendTime;
}
public void setSendTime(String sendTime) {
this.sendTime = sendTime;
}
public static void main(String[] args) {
HeadXmlEntity hd = new HeadXmlEntity();
System.out.println(hd);
}
}
... ...
package com.tianbo.xml.lost;
import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.tianbo.util.xml.XmlGen;
@XStreamAlias("Manifest")
public class ManifestXmlEntity {
@XStreamAlias("Head")
private HeadXmlEntity headXml;
@XStreamAlias("Declaration")
private DeclarationXmlEntity declarationXml;
public HeadXmlEntity getHeadXml() {
return headXml;
}
public void setHeadXml(HeadXmlEntity headXml) {
this.headXml = headXml;
}
public DeclarationXmlEntity getDeclarationXml() {
return declarationXml;
}
public void setDeclarationXml(DeclarationXmlEntity declarationXml) {
this.declarationXml = declarationXml;
}
public static void main(String[] args) {
ManifestXmlEntity ms = getXmlEntity();
String xml = XmlGen.genLostXmlAndSend(ms);
System.err.println(xml);
}
/**
* @return
*/
public static ManifestXmlEntity getXmlEntity() {
ManifestXmlEntity ms = new ManifestXmlEntity();
HeadXmlEntity headXml = new HeadXmlEntity();
DeclarationXmlEntity declarationXml = new DeclarationXmlEntity();
AdditionalInformation information = new AdditionalInformation();
BorderTransportMeans transportMeans = new BorderTransportMeans();
Consignment consignment = new Consignment();
AssociatedTransportDocument associatedTransportDocument = new AssociatedTransportDocument();
consignment.setAssociatedTransportDocument(associatedTransportDocument );
TransportContractDocument transportContractDocument = new TransportContractDocument();
consignment.setTransportContractDocument(transportContractDocument );
declarationXml.setAdditionalInformation(information);
declarationXml.setBorderTransportMeans(transportMeans);
declarationXml.setConsignment(consignment);
ms.setHeadXml(headXml);
ms.setDeclarationXml(declarationXml);
return ms;
}
}
... ...
package com.tianbo.xml.lost;
import com.thoughtworks.xstream.annotations.XStreamAlias;
public class TransportContractDocument {
@XStreamAlias("ID")
private String id;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
}
... ...
package com.tianbo.xml.lostChange;
import com.thoughtworks.xstream.annotations.XStreamAlias;
public class AdditionalInformation {
@XStreamAlias("Content")
private String content;
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
}
... ...
package com.tianbo.xml.lostChange;
import com.thoughtworks.xstream.annotations.XStreamAlias;
/**
* 运输合同附加信息
* @author Promise
*
*/
public class AssociatedTransportDocument {
@XStreamAlias("ID")
private String id;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
}
... ...
package com.tianbo.xml.lostChange;
import com.thoughtworks.xstream.annotations.XStreamAlias;
public class BorderTransportMeans {
@XStreamAlias("JourneyID")
private String journeyID;
public String getJourneyID() {
return journeyID;
}
public void setJourneyID(String journeyID) {
this.journeyID = journeyID;
}
}
... ...
package com.tianbo.xml.lostChange;
import com.thoughtworks.xstream.annotations.XStreamAlias;
public class ChangeBorderTransportMeans {
@XStreamAlias("JourneyID")
private String journeyID;
public String getJourneyID() {
return journeyID;
}
public void setJourneyID(String journeyID) {
this.journeyID = journeyID;
}
}
... ...
package com.tianbo.xml.lostChange;
import com.thoughtworks.xstream.annotations.XStreamAlias;
/**
* 变更后提(运)单信息
* @author Promise
*
*/
public class ChangeConsignment {
@XStreamAlias("TransportContractDocument")
private TransportContractDocument transportContractDocument;
@XStreamAlias("TransportContractDocument")
private AssociatedTransportDocument associatedTransportDocument;
@XStreamAlias("TransportEquipment")
private TransportEquipment transportEquipment;
public TransportContractDocument getTransportContractDocument() {
return transportContractDocument;
}
public void setTransportContractDocument(TransportContractDocument transportContractDocument) {
this.transportContractDocument = transportContractDocument;
}
public AssociatedTransportDocument getAssociatedTransportDocument() {
return associatedTransportDocument;
}
public void setAssociatedTransportDocument(AssociatedTransportDocument associatedTransportDocument) {
this.associatedTransportDocument = associatedTransportDocument;
}
public TransportEquipment getTransportEquipment() {
return transportEquipment;
}
public void setTransportEquipment(TransportEquipment transportEquipment) {
this.transportEquipment = transportEquipment;
}
}
... ...
package com.tianbo.xml.lostChange;
import com.thoughtworks.xstream.annotations.XStreamAlias;
public class Consignment {
@XStreamAlias("TransportContractDocument")
private TransportContractDocument transportContractDocument;
@XStreamAlias("AssociatedTransportDocument")
private AssociatedTransportDocument associatedTransportDocument;
@XStreamAlias("ChangeConsignment")
private ChangeConsignment changeConsignment;
public TransportContractDocument getTransportContractDocument() {
return transportContractDocument;
}
public void setTransportContractDocument(TransportContractDocument transportContractDocument) {
this.transportContractDocument = transportContractDocument;
}
public AssociatedTransportDocument getAssociatedTransportDocument() {
return associatedTransportDocument;
}
public void setAssociatedTransportDocument(AssociatedTransportDocument associatedTransportDocument) {
this.associatedTransportDocument = associatedTransportDocument;
}
public ChangeConsignment getChangeConsignment() {
return changeConsignment;
}
public void setChangeConsignment(ChangeConsignment changeConsignment) {
this.changeConsignment = changeConsignment;
}
}
... ...
package com.tianbo.xml.lostChange;
import java.util.List;
import com.thoughtworks.xstream.annotations.XStreamAlias;
public class DeclarationXmlEntity {
@XStreamAlias("BorderTransportMeans")
private BorderTransportMeans borderTransportMeans;
@XStreamAlias("ChangeBorderTransportMeans")
private ChangeBorderTransportMeans changeBorderTransportMeans;
@XStreamAlias("Consignment")
private List<Consignment> consignment;
@XStreamAlias("AdditionalInformation")
private AdditionalInformation additionalInformation;
public BorderTransportMeans getBorderTransportMeans() {
return borderTransportMeans;
}
public void setBorderTransportMeans(BorderTransportMeans borderTransportMeans) {
this.borderTransportMeans = borderTransportMeans;
}
public AdditionalInformation getAdditionalInformation() {
return additionalInformation;
}
public void setAdditionalInformation(AdditionalInformation additionalInformation) {
this.additionalInformation = additionalInformation;
}
public List<Consignment> getConsignment() {
return consignment;
}
public void setConsignment(List<Consignment> consignment) {
this.consignment = consignment;
}
}
... ...
package com.tianbo.xml.lostChange;
import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.tianbo.util.DateUtils;
public class HeadXmlEntity {
@XStreamAlias("MessageID")
private String messageId="CN_MT8203_1P0_460470678920X_" + DateUtils.currentFormatDate("yyyyMMddHHmmssSSS");
@XStreamAlias("FunctionCode")
private String functionCode="2";
@XStreamAlias("MessageType")
private String messageType="MT8203";
@XStreamAlias("SenderID")
private String senderId="460470678920X_DXPENT0000460002";
@XStreamAlias("ReceiverID")
private String receiverId="4604";
@XStreamAlias("SendTime")
private String sendTime=DateUtils.currentFormatDate("yyyyMMddHHmmssSSS");
@XStreamAlias("Version")
private String version="1.0";
public String getMessageType() {
return messageType;
}
public void setMessageType(String messageType) {
this.messageType = messageType;
}
public String getMessageId() {
return messageId;
}
public void setMessageId(String messageId) {
this.messageId = messageId;
}
public String getSenderId() {
return senderId;
}
public void setSenderId(String senderId) {
this.senderId = senderId;
}
public String getReceiverId() {
return receiverId;
}
public void setReceiverId(String receiverId) {
this.receiverId = receiverId;
}
public String getFunctionCode() {
return functionCode;
}
public void setFunctionCode(String functionCode) {
this.functionCode = functionCode;
}
public String getVersion() {
return version;
}
public void setVersion(String version) {
this.version = version;
}
public String getSendTime() {
return sendTime;
}
public void setSendTime(String sendTime) {
this.sendTime = sendTime;
}
public static void main(String[] args) {
HeadXmlEntity hd = new HeadXmlEntity();
System.out.println(hd);
}
}
... ...
package com.tianbo.xml.lostChange;
import com.thoughtworks.xstream.annotations.XStreamAlias;
/**
* 运输合同信息
* @author Promise
*
*/
public class TransportContractDocument {
@XStreamAlias("ID")
private String id;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
}
... ...
package com.tianbo.xml.lostChange;
import com.thoughtworks.xstream.annotations.XStreamAlias;
/**
* 集装箱(器)信息
* @author Promise
*
*/
public class TransportEquipment {
@XStreamAlias("EquipmentIdentification") //集装箱(器)编号信息
private String equipmentIdentification;
@XStreamAlias("CharacteristicCode")
private String characteristicCode; //集装箱(器)尺寸和类型
@XStreamAlias("SupplierPartyTypeCode")
private String supplierPartyTypeCode; //集装箱(器)尺寸和类型
public String getEquipmentIdentification() {
return equipmentIdentification;
}
public void setEquipmentIdentification(String equipmentIdentification) {
this.equipmentIdentification = equipmentIdentification;
}
public String getCharacteristicCode() {
return characteristicCode;
}
public void setCharacteristicCode(String characteristicCode) {
this.characteristicCode = characteristicCode;
}
}
... ...
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.tianbo.mapper.LostMapper">
<sql id="lostColumns">
a.id AS "id",
a.createdate AS "createdate",
a.flightno AS "flightno",
a.flightdate AS "flightdate",
a.waybillnomaster AS "waybillnomaster",
a.waybillnosecondary AS "waybillnosecondary",
a.remark AS "remark",
a.status AS "status",
a.receiption AS "receiption",
a.createdate AS "createdate"
</sql>
<sql id="lostJoins">
</sql>
<select id="get" resultType="com.tianbo.model.ManifestLoad">
SELECT
<include refid="lostColumns"/>
FROM MANIFESTLOAD a
<include refid="lostJoins"/>
WHERE a.id = #{id}
</select>
<select id="getCount" parameterType="com.tianbo.model.ManifestLoad" resultType="java.lang.Integer" >
select count(*) from MANIFESTLOAD
WHERE 1=1
<if test="flightno != null and flightno != ''">
AND flightno like CONCAT(CONCAT('%',#{flightno}),'%')
</if>
</select>
<select id="getList" resultType="com.tianbo.model.ManifestLoad">
SELECT
T2.*
FROM
( SELECT ROWNUM RN, T.* FROM ( SELECT * FROM ( SELECT * FROM MANIFESTLOAD ) ORDER BY createdate DESC ) T ) T2
WHERE
RN BETWEEN #{start} AND #{end}
</select>
<select id="selectByFlightno" resultType="com.tianbo.model.ManifestLoad">
SELECT
T2.*
FROM
( SELECT ROWNUM RN, T.* FROM (
SELECT * FROM (
SELECT * FROM MANIFESTLOAD
<if test="flightno != null and flightno != ''">
WHERE flightno like CONCAT(CONCAT('%',#{flightno}),'%')
</if>
) ORDER BY createdate DESC ) T ) T2
WHERE
RN BETWEEN #{start} AND #{end}
</select>
<select id="selectByParam" resultType="com.tianbo.model.ManifestLoad">
SELECT
T2.*
FROM
( SELECT ROWNUM RN, T.* FROM (
SELECT * FROM (
SELECT * FROM MANIFESTLOAD
WHERE 1=1
<if test="flightno != null and flightno != ''">
AND flightno like CONCAT(CONCAT('%',#{flightno}),'%')
</if>
<if test="flightdate != null and flightdate != ''">
AND flightdate = "TO_DATE" ( #{flightdate}, 'yyyy-mm-dd' )
</if>
<if test="waybillnomaster != null and waybillnomaster != ''">
AND waybillnomaster like CONCAT(CONCAT('%',#{waybillnomaster}),'%')
</if>
<if test="waybillnosecondary != null and waybillnosecondary != ''">
AND waybillnosecondary like CONCAT(CONCAT('%',#{waybillnosecondary}),'%')
</if>
) ORDER BY createdate DESC ) T ) T2
WHERE
RN BETWEEN #{start} AND #{end}
</select>
<insert id="insert" parameterType="com.tianbo.model.ManifestLoad">
INSERT INTO MANIFESTLOAD(
id,
createdate,
flightno,
flightdate,
waybillnomaster,
waybillnosecondary,
remark,
status,
receiption
) VALUES (
#{id,jdbcType=VARCHAR},
#{createdate,jdbcType=DATE},
#{flightno,jdbcType=VARCHAR},
#{flightdate,jdbcType=DATE},
#{waybillnomaster,jdbcType=VARCHAR},
#{waybillnosecondary,jdbcType=VARCHAR},
#{remark,jdbcType=VARCHAR},
#{status,jdbcType=VARCHAR},
#{receiption,jdbcType=VARCHAR}
)
</insert>
<update id="update" parameterType="com.tianbo.model.ManifestLoad">
UPDATE MANIFESTLOAD
SET
flightno=#{flightno,jdbcType=VARCHAR},
flightdate=#{flightdate,jdbcType=DATE},
waybillnomaster=#{waybillnomaster,jdbcType=VARCHAR},
waybillnosecondary=#{waybillnosecondary,jdbcType=VARCHAR},
status=#{status,jdbcType=VARCHAR},
remark=#{remark,jdbcType=VARCHAR},
receiption=#{receiption,jdbcType=VARCHAR},
createdate=#{createdate,jdbcType=DATE}
WHERE id = #{id}
</update>
<update id="del">
DELETE FROM MANIFESTLOAD
WHERE id = #{id}
</update>
</mapper>
\ No newline at end of file
... ...
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.tianbo.mapper.ManifestItemMapper" >
<resultMap id="BaseResultMap" type="com.tianbo.model.ManifestItem" >
<id column="ID" property="id" jdbcType="VARCHAR" />
<result column="WAYBILLNOMASTER" property="waybillnomaster" jdbcType="VARCHAR" />
<result column="PIECE" property="piece" jdbcType="VARCHAR" />
<result column="PACKAGE_CODE" property="packageCode" jdbcType="VARCHAR" />
<result column="SHIPPING_MARKS" property="shippingMarks" jdbcType="VARCHAR" />
<result column="DANGEROUS_CODE" property="dangerousCode" jdbcType="VARCHAR" />
<result column="CONTAINER_NUMBER" property="containerNumber" jdbcType="VARCHAR" />
<result column="CUSTOM_PROCEDURE_CODE" property="customProcedureCode" jdbcType="VARCHAR" />
<result column="CUSTOM_TARIFF_CODE " property="customTariffCode" jdbcType="VARCHAR" />
<result column="CONSIGN_CODE" property="consignCode" jdbcType="VARCHAR" />
<result column="ORIGINAL_CODE" property="originalCode" jdbcType="VARCHAR" />
<result column="DESCRIPTION" property="description" jdbcType="VARCHAR" />
<result column="REMARK" property="remark" jdbcType="VARCHAR" />
<result column="WEIGHT" property="weight" jdbcType="VARCHAR" />
<result column="ORDER_NUMBER" property="orderNumber" jdbcType="VARCHAR" />
</resultMap>
<sql id="Base_Column_List" >
ID, WAYBILLNOMASTER, PIECE, PACKAGE_CODE, SHIPPING_MARKS, DANGEROUS_CODE, CONTAINER_NUMBER,
CUSTOM_PROCEDURE_CODE, "CUSTOM_TARIFF_CODE ", CONSIGN_CODE, ORIGINAL_CODE, DESCRIPTION,
REMARK, WEIGHT, ORDER_NUMBER
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
<include refid="Base_Column_List" />
from MANIFESTITEM
where ID = #{id,jdbcType=VARCHAR}
</select>
<select id="getIteamList" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
*
from MANIFESTITEM
where WAYBILLNOMASTER = #{waybillnomaster,jdbcType=VARCHAR} ORDER BY ABS(ORDER_NUMBER)
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
delete from MANIFESTITEM
where ID = #{id,jdbcType=VARCHAR}
</delete>
<insert id="insert" parameterType="com.tianbo.model.ManifestItem" >
insert into MANIFESTITEM (ID, WAYBILLNOMASTER, PIECE,
PACKAGE_CODE, SHIPPING_MARKS, DANGEROUS_CODE,
CONTAINER_NUMBER, CUSTOM_PROCEDURE_CODE, "CUSTOM_TARIFF_CODE ",
CONSIGN_CODE, ORIGINAL_CODE, DESCRIPTION,
REMARK, WEIGHT, ORDER_NUMBER
)
values (#{id,jdbcType=VARCHAR}, #{waybillnomaster,jdbcType=VARCHAR}, #{piece,jdbcType=VARCHAR},
#{packageCode,jdbcType=VARCHAR}, #{shippingMarks,jdbcType=VARCHAR}, #{dangerousCode,jdbcType=VARCHAR},
#{containerNumber,jdbcType=VARCHAR}, #{customProcedureCode,jdbcType=VARCHAR}, #{customTariffCode,jdbcType=VARCHAR},
#{consignCode,jdbcType=VARCHAR}, #{originalCode,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR},
#{remark,jdbcType=VARCHAR}, #{weight,jdbcType=VARCHAR}, #{orderNumber,jdbcType=VARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="com.tianbo.model.ManifestItem" >
insert into MANIFESTITEM
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="id != null" >
ID,
</if>
<if test="waybillnomaster != null" >
WAYBILLNOMASTER,
</if>
<if test="piece != null" >
PIECE,
</if>
<if test="packageCode != null" >
PACKAGE_CODE,
</if>
<if test="shippingMarks != null" >
SHIPPING_MARKS,
</if>
<if test="dangerousCode != null" >
DANGEROUS_CODE,
</if>
<if test="containerNumber != null" >
CONTAINER_NUMBER,
</if>
<if test="customProcedureCode != null" >
CUSTOM_PROCEDURE_CODE,
</if>
<if test="customTariffCode != null" >
"CUSTOM_TARIFF_CODE ",
</if>
<if test="consignCode != null" >
CONSIGN_CODE,
</if>
<if test="originalCode != null" >
ORIGINAL_CODE,
</if>
<if test="description != null" >
DESCRIPTION,
</if>
<if test="remark != null" >
REMARK,
</if>
<if test="weight != null" >
WEIGHT,
</if>
<if test="orderNumber != null" >
ORDER_NUMBER,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="id != null" >
#{id,jdbcType=VARCHAR},
</if>
<if test="waybillnomaster != null" >
#{waybillnomaster,jdbcType=VARCHAR},
</if>
<if test="piece != null" >
#{piece,jdbcType=VARCHAR},
</if>
<if test="packageCode != null" >
#{packageCode,jdbcType=VARCHAR},
</if>
<if test="shippingMarks != null" >
#{shippingMarks,jdbcType=VARCHAR},
</if>
<if test="dangerousCode != null" >
#{dangerousCode,jdbcType=VARCHAR},
</if>
<if test="containerNumber != null" >
#{containerNumber,jdbcType=VARCHAR},
</if>
<if test="customProcedureCode != null" >
#{customProcedureCode,jdbcType=VARCHAR},
</if>
<if test="customTariffCode != null" >
#{customTariffCode,jdbcType=VARCHAR},
</if>
<if test="consignCode != null" >
#{consignCode,jdbcType=VARCHAR},
</if>
<if test="originalCode != null" >
#{originalCode,jdbcType=VARCHAR},
</if>
<if test="description != null" >
#{description,jdbcType=VARCHAR},
</if>
<if test="remark != null" >
#{remark,jdbcType=VARCHAR},
</if>
<if test="weight != null" >
#{weight,jdbcType=VARCHAR},
</if>
<if test="orderNumber != null" >
#{orderNumber,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.tianbo.model.ManifestItem" >
update MANIFESTITEM
<set >
<if test="waybillnomaster != null" >
WAYBILLNOMASTER = #{waybillnomaster,jdbcType=VARCHAR},
</if>
<if test="piece != null" >
PIECE = #{piece,jdbcType=VARCHAR},
</if>
<if test="packageCode != null" >
PACKAGE_CODE = #{packageCode,jdbcType=VARCHAR},
</if>
<if test="shippingMarks != null" >
SHIPPING_MARKS = #{shippingMarks,jdbcType=VARCHAR},
</if>
<if test="dangerousCode != null" >
DANGEROUS_CODE = #{dangerousCode,jdbcType=VARCHAR},
</if>
<if test="containerNumber != null" >
CONTAINER_NUMBER = #{containerNumber,jdbcType=VARCHAR},
</if>
<if test="customProcedureCode != null" >
CUSTOM_PROCEDURE_CODE = #{customProcedureCode,jdbcType=VARCHAR},
</if>
<if test="customTariffCode != null" >
"CUSTOM_TARIFF_CODE " = #{customTariffCode,jdbcType=VARCHAR},
</if>
<if test="consignCode != null" >
CONSIGN_CODE = #{consignCode,jdbcType=VARCHAR},
</if>
<if test="originalCode != null" >
ORIGINAL_CODE = #{originalCode,jdbcType=VARCHAR},
</if>
<if test="description != null" >
DESCRIPTION = #{description,jdbcType=VARCHAR},
</if>
<if test="remark != null" >
REMARK = #{remark,jdbcType=VARCHAR},
</if>
<if test="weight != null" >
WEIGHT = #{weight,jdbcType=VARCHAR},
</if>
<if test="orderNumber != null" >
ORDER_NUMBER = #{orderNumber,jdbcType=VARCHAR},
</if>
</set>
where ID = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.tianbo.model.ManifestItem" >
update MANIFESTITEM
set WAYBILLNOMASTER = #{waybillnomaster,jdbcType=VARCHAR},
PIECE = #{piece,jdbcType=VARCHAR},
PACKAGE_CODE = #{packageCode,jdbcType=VARCHAR},
SHIPPING_MARKS = #{shippingMarks,jdbcType=VARCHAR},
DANGEROUS_CODE = #{dangerousCode,jdbcType=VARCHAR},
CONTAINER_NUMBER = #{containerNumber,jdbcType=VARCHAR},
CUSTOM_PROCEDURE_CODE = #{customProcedureCode,jdbcType=VARCHAR},
"CUSTOM_TARIFF_CODE " = #{customTariffCode,jdbcType=VARCHAR},
CONSIGN_CODE = #{consignCode,jdbcType=VARCHAR},
ORIGINAL_CODE = #{originalCode,jdbcType=VARCHAR},
DESCRIPTION = #{description,jdbcType=VARCHAR},
REMARK = #{remark,jdbcType=VARCHAR},
WEIGHT = #{weight,jdbcType=VARCHAR},
ORDER_NUMBER = #{orderNumber,jdbcType=VARCHAR}
where ID = #{id,jdbcType=VARCHAR}
</update>
</mapper>
\ No newline at end of file
... ...
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.tianbo.mapper.ManifestLostChangeMapper" >
<resultMap id="BaseResultMap" type="com.tianbo.model.ManifestLostChange" >
<id column="ID" property="id" jdbcType="VARCHAR" />
<result column="FLIGHTNO" property="flightno" jdbcType="VARCHAR" />
<result column="FLIGHTDATE" property="flightdate" jdbcType="DATE" />
<result column="WAYBILLNOMASTER" property="waybillnomaster" jdbcType="VARCHAR" />
<result column="WAYBILLNOSECONDARY" property="waybillnosecondary" jdbcType="VARCHAR" />
<result column="CWAYBILLNOMASTER" property="cwaybillnomaster" jdbcType="VARCHAR" />
<result column="CWAYBILLNOSECONDARY" property="cwaybillnosecondary" jdbcType="VARCHAR" />
<result column="CREATEDATE" property="createdate" jdbcType="DATE" />
<result column="STATUS" property="status" jdbcType="VARCHAR" />
<result column="RECEIPTION" property="receiption" jdbcType="VARCHAR" />
<result column="CFLIGHTNO" property="cflightno" jdbcType="VARCHAR" />
<result column="CFLIGHTDATE" property="cflightdate" jdbcType="DATE" />
</resultMap>
<sql id="Base_Column_List" >
ID, FLIGHTNO, FLIGHTDATE, WAYBILLNOMASTER, WAYBILLNOSECONDARY, CWAYBILLNOMASTER,
CWAYBILLNOSECONDARY, CREATEDATE, STATUS, RECEIPTION, CFLIGHTNO, CFLIGHTDATE
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
<include refid="Base_Column_List" />
from MANIFESTLOSTCHANGE
where ID = #{id,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
delete from MANIFESTLOSTCHANGE
where ID = #{id,jdbcType=VARCHAR}
</delete>
<insert id="insert" parameterType="com.tianbo.model.ManifestLostChange" >
insert into MANIFESTLOSTCHANGE (ID, FLIGHTNO, FLIGHTDATE,
WAYBILLNOMASTER, WAYBILLNOSECONDARY, CWAYBILLNOMASTER,
CWAYBILLNOSECONDARY, CREATEDATE, STATUS,
RECEIPTION, CFLIGHTNO, CFLIGHTDATE
)
values (#{id,jdbcType=VARCHAR}, #{flightno,jdbcType=VARCHAR}, #{flightdate,jdbcType=DATE},
#{waybillnomaster,jdbcType=VARCHAR}, #{waybillnosecondary,jdbcType=VARCHAR}, #{cwaybillnomaster,jdbcType=VARCHAR},
#{cwaybillnosecondary,jdbcType=VARCHAR}, #{createdate,jdbcType=DATE}, #{status,jdbcType=VARCHAR},
#{receiption,jdbcType=VARCHAR}, #{cflightno,jdbcType=VARCHAR}, #{cflightdate,jdbcType=DATE}
)
</insert>
<insert id="insertSelective" parameterType="com.tianbo.model.ManifestLostChange" >
insert into MANIFESTLOSTCHANGE
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="id != null" >
ID,
</if>
<if test="flightno != null" >
FLIGHTNO,
</if>
<if test="flightdate != null" >
FLIGHTDATE,
</if>
<if test="waybillnomaster != null" >
WAYBILLNOMASTER,
</if>
<if test="waybillnosecondary != null" >
WAYBILLNOSECONDARY,
</if>
<if test="cwaybillnomaster != null" >
CWAYBILLNOMASTER,
</if>
<if test="cwaybillnosecondary != null" >
CWAYBILLNOSECONDARY,
</if>
<if test="createdate != null" >
CREATEDATE,
</if>
<if test="status != null" >
STATUS,
</if>
<if test="receiption != null" >
RECEIPTION,
</if>
<if test="cflightno != null" >
CFLIGHTNO,
</if>
<if test="cflightdate != null" >
CFLIGHTDATE,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="id != null" >
#{id,jdbcType=VARCHAR},
</if>
<if test="flightno != null" >
#{flightno,jdbcType=VARCHAR},
</if>
<if test="flightdate != null" >
#{flightdate,jdbcType=DATE},
</if>
<if test="waybillnomaster != null" >
#{waybillnomaster,jdbcType=VARCHAR},
</if>
<if test="waybillnosecondary != null" >
#{waybillnosecondary,jdbcType=VARCHAR},
</if>
<if test="cwaybillnomaster != null" >
#{cwaybillnomaster,jdbcType=VARCHAR},
</if>
<if test="cwaybillnosecondary != null" >
#{cwaybillnosecondary,jdbcType=VARCHAR},
</if>
<if test="createdate != null" >
#{createdate,jdbcType=DATE},
</if>
<if test="status != null" >
#{status,jdbcType=VARCHAR},
</if>
<if test="receiption != null" >
#{receiption,jdbcType=VARCHAR},
</if>
<if test="cflightno != null" >
#{cflightno,jdbcType=VARCHAR},
</if>
<if test="cflightdate != null" >
#{cflightdate,jdbcType=DATE},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.tianbo.model.ManifestLostChange" >
update MANIFESTLOSTCHANGE
<set >
<if test="flightno != null" >
FLIGHTNO = #{flightno,jdbcType=VARCHAR},
</if>
<if test="flightdate != null" >
FLIGHTDATE = #{flightdate,jdbcType=DATE},
</if>
<if test="waybillnomaster != null" >
WAYBILLNOMASTER = #{waybillnomaster,jdbcType=VARCHAR},
</if>
<if test="waybillnosecondary != null" >
WAYBILLNOSECONDARY = #{waybillnosecondary,jdbcType=VARCHAR},
</if>
<if test="cwaybillnomaster != null" >
CWAYBILLNOMASTER = #{cwaybillnomaster,jdbcType=VARCHAR},
</if>
<if test="cwaybillnosecondary != null" >
CWAYBILLNOSECONDARY = #{cwaybillnosecondary,jdbcType=VARCHAR},
</if>
<if test="createdate != null" >
CREATEDATE = #{createdate,jdbcType=DATE},
</if>
<if test="status != null" >
STATUS = #{status,jdbcType=VARCHAR},
</if>
<if test="receiption != null" >
RECEIPTION = #{receiption,jdbcType=VARCHAR},
</if>
<if test="cflightno != null" >
CFLIGHTNO = #{cflightno,jdbcType=VARCHAR},
</if>
<if test="cflightdate != null" >
CFLIGHTDATE = #{cflightdate,jdbcType=DATE},
</if>
</set>
where ID = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.tianbo.model.ManifestLostChange" >
update MANIFESTLOSTCHANGE
set FLIGHTNO = #{flightno,jdbcType=VARCHAR},
FLIGHTDATE = #{flightdate,jdbcType=DATE},
WAYBILLNOMASTER = #{waybillnomaster,jdbcType=VARCHAR},
WAYBILLNOSECONDARY = #{waybillnosecondary,jdbcType=VARCHAR},
CWAYBILLNOMASTER = #{cwaybillnomaster,jdbcType=VARCHAR},
CWAYBILLNOSECONDARY = #{cwaybillnosecondary,jdbcType=VARCHAR},
CREATEDATE = #{createdate,jdbcType=DATE},
STATUS = #{status,jdbcType=VARCHAR},
RECEIPTION = #{receiption,jdbcType=VARCHAR},
CFLIGHTNO = #{cflightno,jdbcType=VARCHAR},
CFLIGHTDATE = #{cflightdate,jdbcType=DATE}
where ID = #{id,jdbcType=VARCHAR}
</update>
<select id="getList" resultType="com.tianbo.model.ManifestLostChange">
SELECT
T2.*
FROM
( SELECT ROWNUM RN, T.* FROM ( SELECT * FROM ( SELECT * FROM MANIFESTLOSTCHANGE ) ORDER BY createdate DESC ) T ) T2
WHERE
RN BETWEEN #{start} AND #{end}
</select>
<select id="getCount" parameterType="com.tianbo.model.ManifestLostChange" resultType="java.lang.Integer" >
select count(*) from MANIFESTLOSTCHANGE
WHERE 1=1
<if test="flightno != null and flightno != ''">
AND flightno like CONCAT(CONCAT('%',#{flightno}),'%')
</if>
</select>
<select id="selectByParam" resultType="com.tianbo.model.ManifestLostChange">
SELECT
T2.*
FROM
( SELECT ROWNUM RN, T.* FROM (
SELECT * FROM (
SELECT * FROM MANIFESTLOSTCHANGE
WHERE 1=1
<if test="flightno != null and flightno != ''">
AND flightno like CONCAT(CONCAT('%',#{flightno}),'%')
</if>
<if test="flightdate != null and flightdate != ''">
AND flightdate = "TO_DATE" ( #{flightdate}, 'yyyy-mm-dd' )
</if>
<if test="waybillnomaster != null and waybillnomaster != ''">
AND waybillnomaster like CONCAT(CONCAT('%',#{waybillnomaster}),'%')
</if>
<if test="waybillnosecondary != null and waybillnosecondary != ''">
AND waybillnosecondary like CONCAT(CONCAT('%',#{waybillnosecondary}),'%')
</if>
) ORDER BY createdate DESC ) T ) T2
WHERE
RN BETWEEN #{start} AND #{end}
</select>
</mapper>
\ No newline at end of file
... ...
... ... @@ -8,6 +8,8 @@
#########################MYSQL################################################
jdbc.driver = oracle.jdbc.driver.OracleDriver
#jdbc.url = jdbc:oracle:thin:@192.168.0.253:1522:CGODW
jdbc.url = jdbc:oracle:thin:@10.50.3.69:1521:CGODB
#jdbc.url = jdbc:oracle:thin:@10.50.3.69:1521:CGODB
jdbc.url = jdbc:oracle:thin:@218.28.199.134:8004:CGODB
#jdbc.url = jdbc:oracle:thin:@10.50.3.70:1521:CGODB
jdbc.username = CGONMS
jdbc.password = 1q2w3e4r
\ No newline at end of file
... ...
... ... @@ -11,6 +11,9 @@
<!--自动扫描控制器-->
<context:component-scan base-package="com.tianbo.controller" />
<mvc:annotation-driven enable-matrix-variables="true"></mvc:annotation-driven>
<mvc:default-servlet-handler/>
<!--视图渲染-->
<bean id="internalResourceViewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/WEB-INF/views/"/>
... ...
path1=D:/1test
targetPath=E:/2test/
targetPath=
#path1=//10.50.3.61/nms_customs_xml1
#path2=//10.50.3.61/nms_customs_xml_SDM
#path3=//10.50.3.61/nms_customs_xml3
#path=D:/1test
#targetPath=//10.50.3.61/nms_customs_xml/
\ No newline at end of file
#targetPath=//10.50.3.61/nms_customs_xml/
MT8202Path=E:/2test/
\ No newline at end of file
... ...
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ page isELIgnored="false"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!doctype html>
<html lang="zh">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>落装改配修改</title>
<%-- <link href="<%=basePath %>static/css/login.css" rel="stylesheet"> --%>
<link href="<%=basePath %>static/layui2.4.5/css/layui.css" rel="stylesheet">
<style type="text/css">
.layui-input-b1ock {
margin-left: 25px;
min-height: 36px;
}
</style>
<script src="<%=basePath %>static/easyui/jquery.min.js"></script>
<script src="<%=basePath %>static/layui2.4.5/layui.js"></script>
<script type="text/javascript" src="<%=basePath %>static/layer-v3.0.3/layer/layer.js"></script>
<script>
function child(d) {
$("#id").val(d.id)
$("#flightno").val(d.flightno);
$("#cflightno").val(d.cflightno);
$("#flightdate").val(d.flightdate.substring(0,10));
$("#cflightdate").val(d.cflightdate.substring(0,10));
$("#waybillnomaster").val(d.waybillnomaster);
$("#cwaybillnomaster").val(d.cwaybillnomaster);
$("#waybillnosecondary").val(d.waybillnosecondary);
$("#cwaybillnosecondary").val(d.cwaybillnosecondary);
}
</script>
<script>
layui.use(['form','laydate'], function(){
var form = layui.form
,laydate = layui.laydate;
//监听提交
form.on('submit(demo1)', function(data){
if(check()){
editForm(data.field);
}
return false;
});
});
function editForm(data){
var billNo = $("#waybillnomaster").val();
data.waybillnomaster=billNo;
$.ajax({
type : "post",
url : "<%=basePath %>/lost/change/editForm",
data : data,
success: function(data){
if(data.success){
layer.alert( data.msg, function () {
window.parent.location.reload(); //刷新父页面
parent.layer.close(index); //关闭当前弹窗
});
}else{
layer.alert( data.msg, function () {
window.parent.location.reload(); //刷新父页面
parent.layer.close(index); //关闭当前弹窗
});
}
},
error: function() {
layer.alert("保存失败,请重试");
}
});
}
</script>
</head >
<body align="center">
<blockquote class="layui-elem-quote">原始信息</blockquote>
<hr>
<form class="layui-form" action="" lay-filter="example">
<input type="hidden" id="id" name="id" autocomplete="off" class="layui-input" >
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">航班号</label>
<div class="layui-input-inline">
<input type="text" id="flightno" placeholder="此项为必填项" style="text-transform:uppercase;" name="flightno" autocomplete="off" class="layui-input" onkeyup="if (this.value != this.value.toUpperCase()) this.value=this.value.toUpperCase();">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">航班日期</label>
<div class="layui-input-inline">
<input type="text" id="flightdate" placeholder="此项为必填项" name="flightdate" autocomplete="off" class="layui-input">
</div>
</div>
</div>
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">主单号</label>
<div class="layui-input-inline">
<input type="text" id="waybillnomaster" placeholder="此项为必填项" name="waybillnomaster" value="${waybillnomaster}" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">分单号</label>
<div class="layui-input-inline">
<input type="text" id="waybillnosecondary" style="text-transform:uppercase;" name="waybillnosecondary" autocomplete="off" class="layui-input" onkeyup="if (this.value != this.value.toUpperCase()) this.value=this.value.toUpperCase();">
</div>
</div>
</div>
<blockquote class="layui-elem-quote">改配后信息</blockquote>
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">航班号</label>
<div class="layui-input-inline">
<input type="text" id="cflightno" style="text-transform:uppercase;" placeholder="此项为必填项" name="cflightno" autocomplete="off" class="layui-input" onkeyup="if (this.value != this.value.toUpperCase()) this.value=this.value.toUpperCase();">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">航班日期</label>
<div class="layui-input-inline">
<input type="text" id="cflightdate" placeholder="此项为必填项" name="cflightdate" autocomplete="off" class="layui-input">
</div>
</div>
</div>
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">主单号</label>
<div class="layui-input-inline">
<input type="text" id="cwaybillnomaster" name="cwaybillnomaster" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">分单号</label>
<div class="layui-input-inline">
<input type="text" id="cwaybillnosecondary" style="text-transform:uppercase;" name="cwaybillnosecondary" autocomplete="off" class="layui-input" onkeyup="if (this.value != this.value.toUpperCase()) this.value=this.value.toUpperCase();">
</div>
</div>
</div>
<blockquote class="layui-elem-quote">商品项信息 <a style="margin-left:450px" class="layui-btn layui-btn-xs" onclick="add()">新增</a></blockquote>
<div class="layui-inline" >
<table class="layui-hide" id="flightItem" lay-filter="flightItem" style="width:99%; text-align="center"></table>
</div>
<hr>
<div class="layui-form-item" >
<div class="layui-input-b1ock">
<button class="layui-btn" lay-submit="" lay-filter="demo1">
<c:if test="${empty ftId }">保存</c:if>
<c:if test="${not empty ftId}">修改</c:if>
</button>
</div>
</div>
</form>
<script type="text/javascript">
layui.use(['form', 'laydate'], function(){
var form = layui.form
,laydate = layui.laydate
//日期
laydate.render({
elem: '#flightdate'
});
laydate.render({
elem: '#cflightdate'
});
});
function add(){
var waybillnomaster =$("#waybillnomaster").val();
parent.layer.open({
type: 2,
title: "商品信息新增",
shade: 0.8,
id: (new Date()).valueOf(), //设定一个id,防止重复弹出 时间戳1280977330748
moveType: 1, //拖拽模式,0或者1
type: 2,
skin: 'layui-layer-rim', //加上边框
/* area: [window.screen.width / 2 + 'px', window.screen.height / 2 + 'px'], //宽高 */
area: ['700px', '386px'],
maxmin: true, //开启最大化最小化按钮
content: "<%=basePath %>/lost/change/editItem?waybillnomaster="+waybillnomaster,
zIndex: parent.layer.zIndex,
success: function (layero, index) {
// 获取子页面的iframe
var frameId = $(layero).find("iframe").attr('id');//父页面获取子页面的iframe
var iframe = parent.window['layui-layer-iframe' + index];
var iframeWin = parent.window[layero.find('iframe')[0]['name']];
parent.layer.setTop(layero);
// 向子页面的全局函数child传参
//iframe.child(data);
}
,end : function(){
layui.table.reload('flightItem')
}
})
}
function check(){
var billNo = $("#waybillnomaster").val();
var cbillNo = $("#cwaybillnomaster").val();
var flightno = $("#flightno").val();
var cflightno = $("#cflightno").val();
var flightdate = $("#flightdate").val();
var cflightdate = $("#cflightdate").val();
var regs = /[a-z]/i;
if(flightno==''){
$("#flightno").focus();
layer.tips('请输入航班号', '#flightno', {
tips: [1, '#0FA6D8'] //还可配置颜色
});
return false;
}else if(flightdate==''){
$("#flightdate").focus();
layer.tips('请输入航班日期', '#flightdate', {
tips: [1, '#0FA6D8'] //还可配置颜色
});
return false;
}else if(billNo==''){
$("#waybillnomaster").focus();
layer.tips('请输入主单号', '#waybillnomaster', {
tips: [1, '#0FA6D8'] //还可配置颜色
});
return false;
}else if(billNo.indexOf("-") != -1){
billNo=billNo;
if(billNo.length!=12){
$("#waybillnomaster").focus();
layer.tips('主单号必须为11位', '#waybillnomaster', {
tips: [1, '#0FA6D8'] //还可配置颜色
});
return false;
}
}else if(regs.test(billNo)){
$("#waybillnomaster").focus();
layer.tips('主单号必须为数字', '#waybillnomaster', {
tips: [1, '#0FA6D8'] //还可配置颜色
});
return false;
}else if(billNo.length!=11){
$("#waybillnomaster").focus();
layer.tips('主单号必须为11位', '#waybillnomaster', {
tips: [1, '#0FA6D8'] //还可配置颜色
});
return false;
}else if(cflightno==''){
$("#cflightno").focus();
layer.tips('请输入改配后航班号', '#cflightno', {
tips: [1, '#0FA6D8'] //还可配置颜色
});
return false;
}else if(cflightdate==''){
$("#cflightdate").focus();
layer.tips('请输入改配后航班日期', '#cflightdate', {
tips: [1, '#0FA6D8'] //还可配置颜色
});
return false;
}else if(regs.test(cbillNo)){
$("#cwaybillnomaster").focus();
layer.tips('主单号必须为数字', 'c#waybillnomaster', {
tips: [1, '#0FA6D8'] //还可配置颜色
});
return false;
}else if(cbillNo==''){
return true;
}else if(cbillNo.indexOf("-") != -1){
cbillNo=cbillNo;
if(cbillNo.length!=12){
$("#cwaybillnomaster").focus();
layer.tips('主单号必须为11位', '#cwaybillnomaster', {
tips: [1, '#0FA6D8'] //还可配置颜色
});
return false;
}
}else if(cbillNo.length!=11){
$("#cwaybillnomaster").focus();
layer.tips('主单号必须为11位', '#cwaybillnomaster', {
tips: [1, '#0FA6D8'] //还可配置颜色
});
return false;
}else {
return true;
}
}
layui.use('table', function(){
var table = layui.table;
var waybillnomaster = $("#waybillnomaster").val();
table.render({
elem: '#flightItem'
,url:'<%=basePath %>/lost/change/getIteamList?waybillnomaster='+waybillnomaster
/* ,toolbar: '#toolbar' */
,page: false //开启分页
,cols: [[
{field:'orderNumber', align:'center',title:'序号', width:130, sort: true}
,{field:'description', align:'center',title:'简要描述', width:150}
,{field:'piece', title:'件数',align:'center', width:130,}
,{field:'weight', title:'重量',align:'center', width:100,}
,{fixed: 'right', title:'操作',align:'center', toolbar: '#barDemo', width:135}
]]
})
table.on('tool(flightItem)', function(obj){
var data = obj.data;
console.log(obj)
if(obj.event === 'edit'){
var data = obj.data;
var id = data.id;
parent.layer.open({
type: 2,
title: "商品信息编辑",
shade: 0.8,
id: (new Date()).valueOf(), //设定一个id,防止重复弹出 时间戳1280977330748
moveType: 1, //拖拽模式,0或者1
type: 2,
skin: 'layui-layer-rim', //加上边框
/* area: [window.screen.width / 2 + 'px', window.screen.height / 2 + 'px'], //宽高 */
area: ['700px', '386px'],
maxmin: true, //开启最大化最小化按钮
content: "<%=basePath %>/lost/change/editItem?id="+id,
zIndex: parent.layer.zIndex,
success: function (layero, index) {
debugger;
var layer = layui.layer;
// 获取子页面的iframe
var iframe = parent.window['layui-layer-iframe' + index];
parent.layer.setTop(layero);
// 向子页面的全局函数child传参
iframe.child(data);
}
,end : function(){
layui.table.reload('flightItem')
}
})
}else if(obj.event === 'del'){
var data = obj.data;
var id = data.id;
layer.confirm('您确定要删除吗', function(index){
$.ajax({
type : "post",
url : "<%=basePath %>/lost/change/delItem?id="+id,
data : data,
success: function(data){
if(data.success){
layer.alert( data.msg, function (index) {
layer.close(index); //关闭当前弹窗
layui.table.reload('flightItem')
});
}
},
error: function() {
layer.alert("删除失败,请重试");
}
});
});
}
})
})
</script>
<script type="text/html" id="barDemo">
<a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
<a class="layui-btn layui-btn-xs" lay-event="del">删除</a>
</script>
</body >
</html >
\ No newline at end of file
... ...
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ page isELIgnored="false"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!doctype html>
<html lang="zh">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>商品项信息</title>
<%-- <link href="<%=basePath %>static/css/login.css" rel="stylesheet"> --%>
<link href="<%=basePath %>static/layui2.4.5/css/layui.css" rel="stylesheet">
<style type="text/css">
.layui-input-block {
width:100px;
}
.layui-elip, .layui-form-checkbox span, .layui-form-pane .layui-form-label{
text-overflow:inherit;!important
}
.layui-disabled{
background-color:rgb(235, 235, 228);
}
.layui-input1{
width:545px;
height: 38px;
line-height: 38px;
border: 1px solid #e6e6e6;
background-color: #fff;
border-radius: 2px;
box-sizing: border-box!important;
}
.left{
padding: 10px
}
</style>
<script src="<%=basePath %>static/easyui/jquery.min.js"></script>
<script src="<%=basePath %>static/layui2.4.5/layui.js"></script>
<script type="text/javascript" src="<%=basePath %>static/layer-v3.0.3/layer/layer.js"></script>
<script>
function child(d) {
$("#orderNumber").val(d.orderNumber)
$("#piece").val(d.piece);
$("#packageCode").val(d.packageCode);
$("#shippingMarks").val(d.shippingMarks);
$("#containerNumber").val(d.containerNumber);
$("#customProcedureCode").val(d.customProcedureCode);
$("#customTariffCode").val(d.customTariffCode);
$("#consignCode").val(d.consignCode);
$("#originalCode").val(d.originalCode);
$("#description").val(d.description);
$("#remark").val(d.remark);
$("#weight").val(d.weight);
$("#id").val(d.id);
$("#waybillnomaster").val(d.waybillnomaster);
}
</script>
</head >
<body style="text-align: center">
<hr>
<form class="layui-form layui-form-pane" action="">
<input type="hidden" name="id" id = "id" />
<input type="hidden" name="waybillnomaster" id = "waybillnomaster" value="${waybillnomaster}" />
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">序号</label>
<div class="layui-input-block">
<input type="text" name="orderNumber" id="orderNumber" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">托运货物件数</label>
<div class="layui-input-block">
<input type="text" name="piece" id="piece" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">包装种类代码</label>
<div class="layui-input-block">
<input type="text" name="packageCode" id="packageCode" autocomplete="off" class="layui-input">
</div>
</div>
</div>
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">唛头</label>
<div class="layui-input-block">
<input type="text" name="shippingMarks" id="shippingMarks" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">危险品编号</label>
<div class="layui-input-block">
<input type="text" name="dangerousCode" id="dangerousCode" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">货物毛重KG</label>
<div class="layui-input-block">
<input type="text" name="weight" id="weight"autocomplete="off" class="layui-input">
</div>
</div>
</div>
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">集装箱编号</label>
<div class="layui-input-block">
<input type="text" name="containerNumber" id="containerNumber" autocomplete="off" class="layui-input layui-disabled" disabled>
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">海关手续代码</label>
<div class="layui-input-block">
<input type="text" name="customProcedureCode" id="customProcedureCode" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">海关税则编号</label>
<div class="layui-input-block">
<input type="text" name="customTariffCode" id="customTariffCode" autocomplete="off" class="layui-input">
</div>
</div>
</div>
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">唯一托运编号</label>
<div class="layui-input-block">
<input type="text" name="consignCode" id="consignCode" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">原产地代码</label>
<div class="layui-input-block">
<input type="text" name="originalCode" id="originalCode" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">货物简要描述</label>
<div class="layui-input-block">
<input type="text" name="description" id="description" autocomplete="off" class="layui-input">
</div>
</div>
<div class="left" align="left">
<label class="layui-form-label">备注</label>
<div class="layui-input-inline">
<input type="text" name="remark" id="remark" autocomplete="off" class="layui-input1">
</div>
</div>
</div>
<div class="layui-form-item">
<button type="button" class="layui-btn" lay-submit="" lay-filter="demo1" >
<c:if test="${empty ftId}">保存</c:if>
<c:if test="${not empty ftId}">修改</c:if>
</button>
</div>
</form>
<script>
layui.use(['layer', 'form','laydate'], function(){
var layer = layui.layer
,laydate=layui.laydate
,form = layui.form;
//监听提交
form.on('submit(demo1)', function(data){
editForm(data.field);
return false;
});
});
function editForm(data){
$.ajax({
type : "post",
url : "<%=basePath %>/lost/change/editItemData",
data : data,
success: function(data){
if(data.success){
layer.alert( data.msg, function (index, layero) {
var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
parent.layer.close(index); //关闭当前弹窗
/* var layer = layui.layer;
var table = layui.table;
parent.layui.table.reload('flight',{page:{curr:1}})
layui.table.reload('flightItem',{page:{curr:1}}) */
});
}else{
layer.alert(data.msg, function () {
window.parent.location.reload(); //刷新父页面
layer.close(index); //关闭当前弹窗
});
}
}
});
}
</script>
</body >
</html >
\ No newline at end of file
... ...
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ page isELIgnored="false"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!doctype html>
<html lang="zh">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>商品项信息</title>
<%-- <link href="<%=basePath %>static/css/login.css" rel="stylesheet"> --%>
<link href="<%=basePath %>static/layui2.4.5/css/layui.css" rel="stylesheet">
<style type="text/css">
.layui-input-block {
width:100px;
}
.layui-elip, .layui-form-checkbox span, .layui-form-pane .layui-form-label{
text-overflow:inherit;!important
}
.layui-disabled{
background-color:rgb(235, 235, 228);
}
.layui-input1{
width:545px;
height: 38px;
line-height: 38px;
border: 1px solid #e6e6e6;
background-color: #fff;
border-radius: 2px;
box-sizing: border-box!important;
}
.left{
padding: 10px
}
</style>
<script src="<%=basePath %>static/easyui/jquery.min.js"></script>
<script src="<%=basePath %>static/layui2.4.5/layui.js"></script>
<script type="text/javascript" src="<%=basePath %>static/layer-v3.0.3/layer/layer.js"></script>
<script>
function child(d) {
debugger;
$("#orderNumber").val(d.orderNumber)
$("#piece").val(d.piece);
$("#packageCode").val(d.packageCode);
$("#shippingMarks").val(d.shippingMarks);
$("#containerNumber").val(d.containerNumber);
$("#customProcedureCode").val(d.customProcedureCode);
$("#customTariffCode").val(d.customTariffCode);
$("#consignCode").val(d.consignCode);
$("#originalCode").val(d.originalCode);
$("#description").val(d.description);
$("#remark").val(d.remark);
$("#weight").val(d.weight);
}
</script>
</head >
<body style="text-align: center">
<hr>
<form class="layui-form layui-form-pane" action="">
<input type="hidden" name="id" id = "id" value="${item.id}"/>
<input type="hidden" name="waybillnomaster" id = "waybillnomaster" value="${waybillnomaster}"/>
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">序号</label>
<div class="layui-input-block">
<input type="text" name="orderNumber" id="orderNumber" value="${item.orderNumber}"autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">托运货物件数</label>
<div class="layui-input-block">
<input type="text" name="piece" id="piece" value="${item.piece}" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">包装种类代码</label>
<div class="layui-input-block">
<input type="text" name="packageCode" id="packageCode" value="${item.packageCode}" autocomplete="off" class="layui-input">
</div>
</div>
</div>
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">唛头</label>
<div class="layui-input-block">
<input type="text" name="shippingMarks" id="shippingMarks" value="${item.shippingMarks}" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">危险品编号</label>
<div class="layui-input-block">
<input type="text" name="dangerousCode" id="dangerousCode" value="${item.dangerousCode}" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">货物毛重KG</label>
<div class="layui-input-block">
<input type="text" name="weight" id="weight" value="${item.weight}" autocomplete="off" class="layui-input">
</div>
</div>
</div>
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">集装箱编号</label>
<div class="layui-input-block">
<input type="text" name="containerNumber" id="containerNumber" value="${item.containerNumber}" autocomplete="off" class="layui-input layui-disabled" disabled>
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">海关手续代码</label>
<div class="layui-input-block">
<input type="text" name="customProcedureCode" id="customProcedureCode" value="${item.customProcedureCode}" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">海关税则编号</label>
<div class="layui-input-block">
<input type="text" name="customTariffCode" id="customTariffCode" value="${item.customTariffCode}" autocomplete="off" class="layui-input">
</div>
</div>
</div>
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">唯一托运编号</label>
<div class="layui-input-block">
<input type="text" name="consignCode" id="consignCode" value="${item.consignCode}" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">原产地代码</label>
<div class="layui-input-block">
<input type="text" name="originalCode" id="originalCode" value="${item.originalCode}" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">货物简要描述</label>
<div class="layui-input-block">
<input type="text" name="description" id="description" value="${item.description}" autocomplete="off" class="layui-input">
</div>
</div>
<div class="left" align="left">
<label class="layui-form-label">备注</label>
<div class="layui-input-inline">
<input type="text" name="remark" id="remark" value="${item.remark}" autocomplete="off" class="layui-input1">
</div>
</div>
</div>
<div class="layui-form-item">
<button class="layui-btn" lay-submit="" lay-filter="demo1" return false;>
<c:if test="${empty ftId }">保存</c:if>
<c:if test="${not empty ftId}">修改</c:if>
</button>
</div>
</form>
<script>
layui.use(['layer', 'form','laydate'], function(){
var layer = layui.layer
,laydate=layui.laydate
,form = layui.form;
//监听提交
form.on('submit(demo1)', function(data){
editForm(data.field);
});
});
function editForm(data){
$.ajax({
type : "post",
url : "<%=basePath %>/lost/change/editItemData",
data : data,
success: function(data){
if(data.success){
parent.layer.alert(data.msg, function () {
var index = parent.layer.getFrameIndex(window.name)
window.parent.location.reload(); //刷新父页面
parent.layer.close(index); //关闭当前弹窗
});
}else{
layer.alert(data.msg, function () {
window.parent.location.reload(); //刷新父页面
layer.close(index); //关闭当前弹窗
});
}
}
});
}
</script>
</body >
</html >
\ No newline at end of file
... ...
<%@ 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="zh">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>落装改配申请列表</title>
<%-- <link href="<%=basePath %>static/css/login.css" rel="stylesheet"> --%>
<%-- <link rel="stylesheet" href="<%=basePath %>/static/css/main.css" /> --%>
<script src="<%=basePath %>static/easyui/jquery.min.js"></script>
<link href="<%=basePath %>static/layui2.4.5/css/layui.css" rel="stylesheet">
<script src="<%=basePath %>static/layui2.4.5/layui.js"></script>
<script type="text/javascript" src="<%=basePath %>static/layer-v3.0.3/layer/layer.js"></script>
<style>
body{
.layui-input{color:#FF7F24;font-size: 16px}
/* margin: 10px; */
/* text-align: center; */
}
</style>
</head>
<body>
<blockquote class="layui-elem-quote" align="left">落装改配申请列表</blockquote>
<div>
<div class="layui-inline">
<label class="layui-form-label" style="font-size: 15px; font-weight: bold; width: 70px;">航班号:</label>
<div class="layui-input-inline">
<input type="text" name="flightno" id="flightno" autocomplete="off" class="layui-input" style="text-transform:uppercase;" onkeyup="this.value=this.value.toUpperCase()"/>
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label"
style="font-weight: bold; font-size: 15px; width: 80px;">航班日期:</label>
<div class="layui-input-inline">
<input type="text" autocomplete="off" class="layui-input" id="flightdate" name="flightdate"/>
</div>
</div>
<div class="layui-inline">
<div class="layui-inline">
<label class="layui-form-label"
style="font-weight: bold; font-size: 15px; width: 70px;">主单号:</label>
<div class="layui-input-inline">
<input type="text" name="waybillnomaster" autocomplete="off" class="layui-input" id="waybillnomaster" />
</div>
</div>
</div>
<div class="layui-inline">
<div class="layui-inline">
<label class="layui-form-label"
style="font-weight: bold; font-size: 15px; width: 70px;">分单号:</label>
<div class="layui-input-inline">
<input type="text" name="waybillnosecondary" autocomplete="off" class="layui-input" id="waybillnosecondary" style="text-transform:uppercase;" onkeyup="this.value=this.value.toUpperCase()"/>
</div>
</div>
</div>
<div class="layui-inline">
<button class="layui-btn" lay-submit="" id="searchBtn" data-type="getInfo">查询</button>
<button class="layui-btn" data-type="reload" id="add">新增</button>
</div>
</div>
<!-- <button class="layui-btn" lay-submit="" id="searchBtn" data-type="getInfo">查询</button> -->
</div>
<hr>
<blockquote class="layui-elem-quote" align="left">落装改配申请明细</blockquote>
<div class="layui-inline" >
<table class="layui-hide" id="flight" lay-filter="flight" style="width:99%; text-align="center"></table>
</div>
<%--
<script type="text/html" id="toolbar">
<div class="layui-btn-container">
<button class="layui-btn layui-btn-sm" >新增</button>
<input id="searchInput" type="text" placeholder="请输入关键字">
<button class="layui-btn layui-btn-sm" >查询</button>
</div>
</script> --%>
<script type="text/html" id="barDemo">
<a class="layui-btn layui-btn-xs" lay-event="shoufa">收发明细</a>
<a class="layui-btn layui-btn-xs" lay-event="edit">编辑运单</a>
{{#console.log(d)}}
{{# if(d.status =="01"){ }}
<a class="layui-btn layui-btn-xs layui-btn-disabled">申报</a>
{{# } else { }}
<a class="layui-btn layui-btn-xs" lay-event="send" id="sb">申报</a>
{{# } }}
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">修改状态</a>
</script>
<script>
layui.use('table', function(){
var table = layui.table;
table.render({
elem: '#flight'
,url:'<%=basePath %>/lost/change/getList'
/* ,toolbar: '#toolbar' */
,title: '落装改配申请'
,height: 'full-200'
,page: true //开启分页
,cols: [[
{field:'waybillnomaster', align:'center',title:'主单号', width:130, sort: true}
,{field:'waybillnosecondary', align:'center',title:'分单号', width:150}
,{field:'cwaybillnomaster', title:'改配后主单号',align:'center', width:130,}
,{field:'cwaybillnosecondary',align:'center', title:'改配后分单号', width:150 ,templet: function(d){
return d.waybillnosecondary.substring(0,10)
}
}
,{field:'flightno', title:'航班号',align:'center', width:100,}
,{field:'cflightno',align:'center', title:'改配后航班号', width:115 ,templet: function(d){
return d.flightno.substring(0,10)
}
}
,{field:'status', align:'center',title:'状态', width:90,templet: function(d){
var text = d.status;
if(text=="01"){
return '已发送'
}else if(text=="02"){
return '申报成功'
}else{
return ''
}
}
}
,{field:'receiption', align:'center',title:'回执信息', width:336}
,{fixed: 'right', title:'操作',align:'center', toolbar: '#barDemo', width:300}
]]
});
$('#searchBtn').on('click',function(){
var type = $(this).data('type');
active[type] ? active[type].call(this) : '';
});
// 点击获取数据
var active = {
getInfo: function () {
if(check()){
var flightno=$('#flightno').val();
var flightdate=$('#flightdate').val();
var waybillnomaster=$('#waybillnomaster').val();
var waybillnosecondary=$('#waybillnosecondary').val();
/* if (flightno) { */
var index = layer.msg('查询中,请稍候...',{icon: 16,time:false,shade:0});
setTimeout(function(){
table.reload('flight', { //表格的id
url:'<%=basePath %>/lost/change/selectByParam',
page:{
curr:1 //从第一页开始
},
where: {
'flightno':$.trim(flightno),
'flightdate':$.trim(flightdate),
'waybillnomaster':$.trim(waybillnomaster),
'waybillnosecondary':$.trim(waybillnosecondary)
}
});
layer.close(index);
},800);
/* } else {
layer.msg("请输入航班号");
} */
}
},
};
$("#flightno").bind("keyup", function (e) {
if (e.keyCode == 13) {
var type = "getInfo";
active[type] ? active[type].call(this) : '';
}
});
//监听行工具事件
table.on('tool(flight)', function(obj){
var data = obj.data;
console.log(obj)
if(obj.event === 'del'){
layer.confirm('您确定要修改状态吗', function(index){
$.ajax({
type : "post",
url : "<%=basePath %>/lost/change/updateStatues",
data : data,
success: function(data){
if(data.success){
layer.alert( data.msg, function () {
window.parent.location.reload(); //刷新父页面
parent.layer.close(index); //关闭当前弹窗
});
}
},
error: function() {
layer.alert("删除失败,请重试");
}
});
});
}else if(obj.event === 'send'){
layer.confirm('您确定要申报吗', function(index){
if (data) {
var id = data.id;
$.ajax({
type : "post",
url : "<%=basePath %>/lost/change/send",
data : data,
success: function(data){
if(data.success){
debugger;
layer.alert(data.msg, function () {
window.parent.location.reload(); //刷新父页面
parent.layer.close(index); //关闭当前弹窗
});
}else{
layer.alert(data.msg, function () {
window.parent.location.reload(); //刷新父页面
parent.layer.close(index); //关闭当前弹窗
});
}
},
error: function() {
layer.alert("申报失败", function () {
window.parent.location.reload(); //刷新父页面
parent.layer.close(index); //关闭当前弹窗
});
}
});
} else {
alert("请选择需要申报的运单")
}
});
} else if(obj.event === 'edit'){
if (data) {
var waybillnomaster = data.waybillnomaster;
var id = data.id;
layer.open({
type: 2,
title: "落装改配申请",
shade: 0.8,
id: (new Date()).valueOf(), //设定一个id,防止重复弹出 时间戳1280977330748
moveType: 1, //拖拽模式,0或者1
type: 2,
skin: 'layui-layer-rim', //加上边框
/* area: [window.screen.width / 2 + 'px', window.screen.height / 2 + 'px'], //宽高 */
area: ['692px', '372px'],
maxmin: true, //开启最大化最小化按钮
zIndex: layer.zIndex, //重点1
content: "<%=basePath %>/lost/change/edit?id="+id+"&waybillnomaster="+waybillnomaster,
success: function (layero, index) {
debugger;
var layer = layui.layer;
// 获取子页面的iframe
var iframe = window['layui-layer-iframe' + index];
// 向子页面的全局函数child传参
iframe.child(data);
layer.setTop(layero); //重点2
}
})
} else {
alert("请选择运单")
}
}else if(obj.event === 'shoufa'){
if (data) {
var id = data.id;
layer.open({
type: 2,
title: "收发明细",
shade: 0.8,
id: (new Date()).valueOf(), //设定一个id,防止重复弹出 时间戳1280977330748
moveType: 1, //拖拽模式,0或者1
type: 2,
skin: 'layui-layer-rim', //加上边框
/* area: [window.screen.width / 2 + 'px', window.screen.height / 2 + 'px'], //宽高 */
area: ['692px', '372px'],
maxmin: true, //开启最大化最小化按钮
content: "<%=basePath %>/lost/change/edit?id="+id,
success: function (layero, index) {
// 获取子页面的iframe
var iframe = window['layui-layer-iframe' + index];
// 向子页面的全局函数child传参
iframe.child(data);
}
})
} else {
alert("请选择需要申报的运单")
}
}
});
});
$("#add").click(function(){
layer.open({
type: 2,
title: "落装改配申请", //不显示标题栏
//closeBtn: 2,
shade: 0.8,
id: (new Date()).valueOf(), //设定一个id,防止重复弹出 时间戳1280977330748
moveType: 1, //拖拽模式,0或者1
type: 2,
skin: 'layui-layer-rim', //加上边框
/* area: [window.screen.width / 2 + 'px', window.screen.height / 2 + 'px'], //宽高 */
area: ['692px', '372px'],
maxmin: true, //开启最大化最小化按钮
content: "<%=basePath %>/lost/change/edit",
zIndex: layer.zIndex,
success: function (layero, index) {
// 获取子页面的iframe
var iframe = window['layui-layer-iframe' + index];
// 向子页面的全局函数child传参
iframe.child(data);
layer.setTop(layero);
}
})
})
</script>
<script type="text/javascript">
layui.use(['form', 'laydate'], function(){
var form = layui.form
,laydate = layui.laydate;
//日期
laydate.render({
elem: '#flightdate'
});
});
function check(){
var billNo = $("#waybillnomaster").val();
var regs = /[a-z]/i;
if(billNo==''){
return true;
}else if(regs.test(billNo)){
$("#waybillnomaster").focus();
layer.tips('主单号必须为数字', '#waybillnomaster', {
tips: [1, '#0FA6D8'] //还可配置颜色
});
return false;
}
else{
if(billNo.indexOf("-") != -1){
billNo=billNo;
if(billNo.length!=12){
$("#waybillnomaster").focus();
layer.tips('主单号必须为11位', '#waybillnomaster', {
tips: [1, '#0FA6D8'] //还可配置颜色
});
return false;
}
}else{
// billNo = billNo.substring(0,3)+'-'+billNo.substring(3)
if(billNo.length!=11){
$("#waybillnomaster").focus();
layer.tips('主单号必须为11位', '#waybillnomaster', {
tips: [1, '#0FA6D8'] //还可配置颜色
});
return false;
}
}
$("#waybillnomaster").val(billNo);
return true;
}
}
</script>
</body>
</html>
\ No newline at end of file
... ...
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ page isELIgnored="false"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!doctype html>
<html lang="zh">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>落装申请修改</title>
<%-- <link href="<%=basePath %>static/css/login.css" rel="stylesheet"> --%>
<link href="<%=basePath %>static/layui2.4.5/css/layui.css" rel="stylesheet">
<style type="text/css">
.layui-input-b1ock {
margin-left: 510px;
min-height: 36px;
}
</style>
<script src="<%=basePath %>static/easyui/jquery.min.js"></script>
<script src="<%=basePath %>static/layui2.4.5/layui.js"></script>
<script type="text/javascript" src="<%=basePath %>static/layer-v3.0.3/layer/layer.js"></script>
<script>
function child(d) {
$("#id").val(d.id)
$("#flightno").val(d.flightno);
$("#flightdate").val(d.flightdate.substring(0,10));
$("#waybillnomaster").val(d.waybillnomaster);
$("#waybillnosecondary").val(d.waybillnosecondary);
}
</script>
<script>
layui.use(['layer', 'form','laydate'], function(){
var layer = layui.layer
,laydate=layui.laydate
,form = layui.form;
//监听提交
form.on('submit(demo1)', function(data){
if(check()){
editForm(data.field);
}
return false;
});
});
function editForm(data){
var billNo = $("#waybillnomaster").val();
data.waybillnomaster=billNo;
$.ajax({
type : "post",
url : "<%=basePath %>/lost/editForm",
data : data,
success: function(data){
if(data.success){
layer.alert( data.msg, function () {
window.parent.location.reload(); //刷新父页面
parent.layer.close(index); //关闭当前弹窗
});
}else{
layer.alert( data.msg, function () {
window.parent.location.reload(); //刷新父页面
parent.layer.close(index); //关闭当前弹窗
});
}
},
error: function() {
layer.alert("保存失败,请重试");
}
});
}
</script>
</head >
<body style="margin: auto">
<blockquote class="layui-elem-quote">运单信息编辑</blockquote>
<hr>
<form class="layui-form" action="" lay-filter="example">
<input type="hidden" id="id" name="id" autocomplete="off" class="layui-input" >
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">航班号</label>
<div class="layui-input-inline">
<input type="text" id="flightno" style="text-transform:uppercase;" name="flightno" autocomplete="off" class="layui-input" onkeyup="if (this.value != this.value.toUpperCase()) this.value=this.value.toUpperCase();">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">航班日期</label>
<div class="layui-input-inline">
<input type="text" id="flightdate" name="flightdate" autocomplete="off" class="layui-input">
</div>
</div>
</div>
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">主单号</label>
<div class="layui-input-inline">
<input type="text" id="waybillnomaster" name="waybillnomaster" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">分单号</label>
<div class="layui-input-inline">
<input type="text" id="waybillnosecondary" style="text-transform:uppercase;" name="waybillnosecondary" autocomplete="off" class="layui-input" onkeyup="if (this.value != this.value.toUpperCase()) this.value=this.value.toUpperCase();">
</div>
</div>
</div>
<div class="layui-form-item" >
<div class="layui-input-b1ock">
<button class="layui-btn" lay-submit="" lay-filter="demo1">
<c:if test="${empty ftId }">保存</c:if>
<c:if test="${not empty ftId}">修改</c:if>
</button>
</div>
</div>
</form>
<script type="text/javascript">
layui.use(['form', 'laydate'], function(){
var form = layui.form
,laydate = layui.laydate;
//日期
laydate.render({
elem: '#flightdate'
});
});
function check(){
var billNo = $("#waybillnomaster").val();
var flightno = $("#flightno").val();
var flightdate = $("#flightdate").val();
var regs = /[a-z]/i;
if(flightno==''){
$("#flightno").focus();
layer.tips('请输入航班号', '#flightno', {
tips: [1, '#0FA6D8'] //还可配置颜色
});
return false;
}else if(flightdate==''){
$("#flightdate").focus();
layer.tips('请输入航班日期', '#flightdate', {
tips: [1, '#0FA6D8'] //还可配置颜色
});
return false;
}else
if(billNo==''){
$("#waybillnomaster").focus();
layer.tips('请输入主单号', '#waybillnomaster', {
tips: [1, '#0FA6D8'] //还可配置颜色
});
return false;
}else if(regs.test(billNo)){
$("#waybillnomaster").focus();
layer.tips('主单号必须为数字', '#waybillnomaster', {
tips: [1, '#0FA6D8'] //还可配置颜色
});
return false;
}
else{
if(billNo.indexOf("-") != -1){
billNo=billNo;
if(billNo.length!=12){
$("#waybillnomaster").focus();
layer.tips('主单号必须为11位', '#waybillnomaster', {
tips: [1, '#0FA6D8'] //还可配置颜色
});
return false;
}
}else{
billNo = billNo.substring(0,3)+'-'+billNo.substring(3)
if(billNo.length!=12){
$("#waybillnomaster").focus();
layer.tips('主单号必须为11位', '#waybillnomaster', {
tips: [1, '#0FA6D8'] //还可配置颜色
});
return false;
}
}
$("#waybillnomaster").val(billNo);
return true;
}
}
</script>
</body >
</html >
\ No newline at end of file
... ...