作者 朱兆平

查询运单所有回执,目前只有出港

1 package com.tianbo.imfClient.controller; 1 package com.tianbo.imfClient.controller;
2 2
  3 +import com.tianbo.imfClient.dao.CUSTOMSMESSAGEMapper;
3 import com.tianbo.imfClient.dao.ORIGINMANIFESTMASTERMapper; 4 import com.tianbo.imfClient.dao.ORIGINMANIFESTMASTERMapper;
  5 +import com.tianbo.imfClient.model.CUSTOMSMESSAGE;
4 import com.tianbo.imfClient.model.ResultJson; 6 import com.tianbo.imfClient.model.ResultJson;
5 import org.springframework.beans.factory.annotation.Autowired; 7 import org.springframework.beans.factory.annotation.Autowired;
6 import org.springframework.web.bind.annotation.PostMapping; 8 import org.springframework.web.bind.annotation.PostMapping;
@@ -9,6 +11,7 @@ import org.springframework.web.bind.annotation.RequestParam; @@ -9,6 +11,7 @@ import org.springframework.web.bind.annotation.RequestParam;
9 import org.springframework.web.bind.annotation.RestController; 11 import org.springframework.web.bind.annotation.RestController;
10 12
11 import java.util.HashMap; 13 import java.util.HashMap;
  14 +import java.util.List;
12 15
13 @RestController 16 @RestController
14 @RequestMapping("/flight") 17 @RequestMapping("/flight")
@@ -17,6 +20,9 @@ public class FlightController { @@ -17,6 +20,9 @@ public class FlightController {
17 @Autowired 20 @Autowired
18 ORIGINMANIFESTMASTERMapper originmanifestmasterMapper; 21 ORIGINMANIFESTMASTERMapper originmanifestmasterMapper;
19 22
  23 + @Autowired
  24 + CUSTOMSMESSAGEMapper customsmessageMapper;
  25 +
20 /** 26 /**
21 * 修改航班日期 27 * 修改航班日期
22 * @param currDate 修改前日期 28 * @param currDate 修改前日期
@@ -40,4 +46,28 @@ public class FlightController { @@ -40,4 +46,28 @@ public class FlightController {
40 } 46 }
41 return new ResultJson("500","更新失败或航班信息不正确",i); 47 return new ResultJson("500","更新失败或航班信息不正确",i);
42 } 48 }
  49 +
  50 +
  51 + /**
  52 + * 查询运单的回执状态,目前能查到出港运单的所有回执状态,进港不行
  53 + * @param waybillno
  54 + * @return 返回 业务类型、主单号、分单号、回执内容
  55 + */
  56 + @PostMapping("/customres")
  57 + public ResultJson getCustomResponse(@RequestParam(value = "waybillno",required = true) String waybillno){
  58 + waybillno = waybillno.replace("-","");
  59 + List<CUSTOMSMESSAGE> customsmessageList = customsmessageMapper.selectCustomResponse(waybillno);
  60 + return new ResultJson(customsmessageList);
  61 + }
  62 +
  63 + /**
  64 + * 查询运单的回执状态,目前能查到出港运单 发送海关生成报文的messageId
  65 + * @param waybillno
  66 + * @return 返回 messageId,业务类型、主单号、分单号、回执内容
  67 + */
  68 + @PostMapping("/getmessageid")
  69 + public ResultJson getCustomMessageId(@RequestParam(value = "waybillno",required = true) String waybillno){
  70 + List<CUSTOMSMESSAGE> customsmessageList = customsmessageMapper.selectCustomId(waybillno);
  71 + return new ResultJson(customsmessageList);
  72 + }
43 } 73 }
@@ -11,4 +11,9 @@ public class IndexController { @@ -11,4 +11,9 @@ public class IndexController {
11 public String index(){ 11 public String index(){
12 return "index"; 12 return "index";
13 } 13 }
  14 +
  15 + @RequestMapping("/flight/reseption")
  16 + public String reception(){
  17 + return "flight/res";
  18 + }
14 } 19 }
  1 +package com.tianbo.imfClient.dao;
  2 +
  3 +import com.tianbo.imfClient.model.CUSTOMSMESSAGE;
  4 +import com.tianbo.imfClient.model.CUSTOMSMESSAGEWithBLOBs;
  5 +
  6 +import java.util.List;
  7 +
  8 +public interface CUSTOMSMESSAGEMapper {
  9 + int insert(CUSTOMSMESSAGEWithBLOBs record);
  10 +
  11 + int insertSelective(CUSTOMSMESSAGEWithBLOBs record);
  12 +
  13 + List<CUSTOMSMESSAGE> selectCustomResponse(String waybillMasterNo);
  14 +
  15 + List<CUSTOMSMESSAGE> selectCustomId(String waybillMasterNo);
  16 +}
  1 +package com.tianbo.imfClient.model;
  2 +
  3 +import java.math.BigDecimal;
  4 +import java.util.Date;
  5 +
  6 +public class CUSTOMSMESSAGE {
  7 + private String autoid;
  8 +
  9 + private String messageid;
  10 +
  11 + private String messagetype;
  12 +
  13 + private String messagestatus;
  14 +
  15 + private Date sendtime;
  16 +
  17 + private Date receivetime;
  18 +
  19 + private String objectid;
  20 +
  21 + private String flightno;
  22 +
  23 + private Date flightdate;
  24 +
  25 + private String masterautoid;
  26 +
  27 + private String waybillnomaster;
  28 +
  29 + private String secondaryautoid;
  30 +
  31 + private String waybillnosecondary;
  32 +
  33 + private BigDecimal pcs;
  34 +
  35 + private BigDecimal wt;
  36 +
  37 + private String responsecode;
  38 +
  39 + private String responsetext;
  40 +
  41 + private Date createtime;
  42 +
  43 + public String getAutoid() {
  44 + return autoid;
  45 + }
  46 +
  47 + public void setAutoid(String autoid) {
  48 + this.autoid = autoid == null ? null : autoid.trim();
  49 + }
  50 +
  51 + public String getMessageid() {
  52 + return messageid;
  53 + }
  54 +
  55 + public void setMessageid(String messageid) {
  56 + this.messageid = messageid == null ? null : messageid.trim();
  57 + }
  58 +
  59 + public String getMessagetype() {
  60 + return messagetype;
  61 + }
  62 +
  63 + public void setMessagetype(String messagetype) {
  64 + this.messagetype = messagetype == null ? null : messagetype.trim();
  65 + }
  66 +
  67 + public String getMessagestatus() {
  68 + return messagestatus;
  69 + }
  70 +
  71 + public void setMessagestatus(String messagestatus) {
  72 + this.messagestatus = messagestatus == null ? null : messagestatus.trim();
  73 + }
  74 +
  75 + public Date getSendtime() {
  76 + return sendtime;
  77 + }
  78 +
  79 + public void setSendtime(Date sendtime) {
  80 + this.sendtime = sendtime;
  81 + }
  82 +
  83 + public Date getReceivetime() {
  84 + return receivetime;
  85 + }
  86 +
  87 + public void setReceivetime(Date receivetime) {
  88 + this.receivetime = receivetime;
  89 + }
  90 +
  91 + public String getObjectid() {
  92 + return objectid;
  93 + }
  94 +
  95 + public void setObjectid(String objectid) {
  96 + this.objectid = objectid == null ? null : objectid.trim();
  97 + }
  98 +
  99 + public String getFlightno() {
  100 + return flightno;
  101 + }
  102 +
  103 + public void setFlightno(String flightno) {
  104 + this.flightno = flightno == null ? null : flightno.trim();
  105 + }
  106 +
  107 + public Date getFlightdate() {
  108 + return flightdate;
  109 + }
  110 +
  111 + public void setFlightdate(Date flightdate) {
  112 + this.flightdate = flightdate;
  113 + }
  114 +
  115 + public String getMasterautoid() {
  116 + return masterautoid;
  117 + }
  118 +
  119 + public void setMasterautoid(String masterautoid) {
  120 + this.masterautoid = masterautoid == null ? null : masterautoid.trim();
  121 + }
  122 +
  123 + public String getWaybillnomaster() {
  124 + return waybillnomaster;
  125 + }
  126 +
  127 + public void setWaybillnomaster(String waybillnomaster) {
  128 + this.waybillnomaster = waybillnomaster == null ? null : waybillnomaster.trim();
  129 + }
  130 +
  131 + public String getSecondaryautoid() {
  132 + return secondaryautoid;
  133 + }
  134 +
  135 + public void setSecondaryautoid(String secondaryautoid) {
  136 + this.secondaryautoid = secondaryautoid == null ? null : secondaryautoid.trim();
  137 + }
  138 +
  139 + public String getWaybillnosecondary() {
  140 + return waybillnosecondary;
  141 + }
  142 +
  143 + public void setWaybillnosecondary(String waybillnosecondary) {
  144 + this.waybillnosecondary = waybillnosecondary == null ? null : waybillnosecondary.trim();
  145 + }
  146 +
  147 + public BigDecimal getPcs() {
  148 + return pcs;
  149 + }
  150 +
  151 + public void setPcs(BigDecimal pcs) {
  152 + this.pcs = pcs;
  153 + }
  154 +
  155 + public BigDecimal getWt() {
  156 + return wt;
  157 + }
  158 +
  159 + public void setWt(BigDecimal wt) {
  160 + this.wt = wt;
  161 + }
  162 +
  163 + public String getResponsecode() {
  164 + return responsecode;
  165 + }
  166 +
  167 + public void setResponsecode(String responsecode) {
  168 + this.responsecode = responsecode == null ? null : responsecode.trim();
  169 + }
  170 +
  171 + public String getResponsetext() {
  172 + return responsetext;
  173 + }
  174 +
  175 + public void setResponsetext(String responsetext) {
  176 + this.responsetext = responsetext == null ? null : responsetext.trim();
  177 + }
  178 +
  179 + public Date getCreatetime() {
  180 + return createtime;
  181 + }
  182 +
  183 + public void setCreatetime(Date createtime) {
  184 + this.createtime = createtime;
  185 + }
  186 +}
  1 +package com.tianbo.imfClient.model;
  2 +
  3 +public class CUSTOMSMESSAGEWithBLOBs extends CUSTOMSMESSAGE {
  4 + private String messagecontent;
  5 +
  6 + private String receivecontent;
  7 +
  8 + public String getMessagecontent() {
  9 + return messagecontent;
  10 + }
  11 +
  12 + public void setMessagecontent(String messagecontent) {
  13 + this.messagecontent = messagecontent == null ? null : messagecontent.trim();
  14 + }
  15 +
  16 + public String getReceivecontent() {
  17 + return receivecontent;
  18 + }
  19 +
  20 + public void setReceivecontent(String receivecontent) {
  21 + this.receivecontent = receivecontent == null ? null : receivecontent.trim();
  22 + }
  23 +}
@@ -45,6 +45,6 @@ @@ -45,6 +45,6 @@
45 <property name="enableSubPackages" value="true"/> 45 <property name="enableSubPackages" value="true"/>
46 </javaClientGenerator> 46 </javaClientGenerator>
47 <!-- 要生成的表 tableName是数据库中的表名或视图名 domainObjectName是实体类名--> 47 <!-- 要生成的表 tableName是数据库中的表名或视图名 domainObjectName是实体类名-->
48 - <table tableName="ORIGINMANIFESTMASTER" domainObjectName="ORIGINMANIFESTMASTER" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table> 48 + <table tableName="CUSTOMSMESSAGE" domainObjectName="CUSTOMSMESSAGE" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>
49 </context> 49 </context>
50 </generatorConfiguration> 50 </generatorConfiguration>
  1 +<?xml version="1.0" encoding="UTF-8" ?>
  2 +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
  3 +<mapper namespace="com.tianbo.imfClient.dao.CUSTOMSMESSAGEMapper" >
  4 + <resultMap id="BaseResultMap" type="com.tianbo.imfClient.model.CUSTOMSMESSAGE" >
  5 + <result column="AUTOID" property="autoid" jdbcType="VARCHAR" />
  6 + <result column="MESSAGEID" property="messageid" jdbcType="VARCHAR" />
  7 + <result column="MESSAGETYPE" property="messagetype" jdbcType="VARCHAR" />
  8 + <result column="MESSAGESTATUS" property="messagestatus" jdbcType="VARCHAR" />
  9 + <result column="SENDTIME" property="sendtime" jdbcType="TIMESTAMP" />
  10 + <result column="RECEIVETIME" property="receivetime" jdbcType="TIMESTAMP" />
  11 + <result column="OBJECTID" property="objectid" jdbcType="VARCHAR" />
  12 + <result column="FLIGHTNO" property="flightno" jdbcType="VARCHAR" />
  13 + <result column="FLIGHTDATE" property="flightdate" jdbcType="TIMESTAMP" />
  14 + <result column="MASTERAUTOID" property="masterautoid" jdbcType="VARCHAR" />
  15 + <result column="WAYBILLNOMASTER" property="waybillnomaster" jdbcType="VARCHAR" />
  16 + <result column="SECONDARYAUTOID" property="secondaryautoid" jdbcType="VARCHAR" />
  17 + <result column="WAYBILLNOSECONDARY" property="waybillnosecondary" jdbcType="VARCHAR" />
  18 + <result column="PCS" property="pcs" jdbcType="DECIMAL" />
  19 + <result column="WT" property="wt" jdbcType="DECIMAL" />
  20 + <result column="RESPONSECODE" property="responsecode" jdbcType="VARCHAR" />
  21 + <result column="RESPONSETEXT" property="responsetext" jdbcType="VARCHAR" />
  22 + <result column="CREATETIME" property="createtime" jdbcType="TIMESTAMP" />
  23 + </resultMap>
  24 + <resultMap id="ResultMapWithBLOBs" type="com.tianbo.imfClient.model.CUSTOMSMESSAGEWithBLOBs" extends="BaseResultMap" >
  25 + <result column="MESSAGECONTENT" property="messagecontent" jdbcType="CLOB" />
  26 + <result column="RECEIVECONTENT" property="receivecontent" jdbcType="CLOB" />
  27 + </resultMap>
  28 + <sql id="Blob_Column_List" >
  29 + MESSAGECONTENT, RECEIVECONTENT
  30 + </sql>
  31 + <sql id="Response_Base">
  32 + MESSAGETYPE, WAYBILLNOMASTER, WAYBILLNOSECONDARY, RESPONSETEXT
  33 + </sql>
  34 + <select id="selectCustomResponse" parameterType="java.lang.String" resultType="com.tianbo.imfClient.model.CUSTOMSMESSAGE">
  35 + SELECT
  36 + <include refid="Response_Base" />
  37 + FROM
  38 + CUSTOMSMESSAGE
  39 + WHERE
  40 + WAYBILLNOMASTER = #{waybillnomaster,jdbcType=VARCHAR}
  41 + ORDER BY MESSAGETYPE
  42 + </select>
  43 + <select id="selectCustomId" parameterType="java.lang.String" resultType="com.tianbo.imfClient.model.CUSTOMSMESSAGE">
  44 + SELECT
  45 + MESSAGEID,
  46 + <include refid="Response_Base" />
  47 + FROM
  48 + CUSTOMSMESSAGE
  49 + WHERE
  50 + WAYBILLNOMASTER = #{waybillnomaster,jdbcType=VARCHAR}
  51 + ORDER BY MESSAGETYPE
  52 + </select>
  53 + <insert id="insert" parameterType="com.tianbo.imfClient.model.CUSTOMSMESSAGEWithBLOBs" >
  54 + insert into CUSTOMSMESSAGE (AUTOID, MESSAGEID, MESSAGETYPE,
  55 + MESSAGESTATUS, SENDTIME, RECEIVETIME,
  56 + OBJECTID, FLIGHTNO, FLIGHTDATE,
  57 + MASTERAUTOID, WAYBILLNOMASTER, SECONDARYAUTOID,
  58 + WAYBILLNOSECONDARY, PCS, WT,
  59 + RESPONSECODE, RESPONSETEXT, CREATETIME,
  60 + MESSAGECONTENT, RECEIVECONTENT)
  61 + values (#{autoid,jdbcType=VARCHAR}, #{messageid,jdbcType=VARCHAR}, #{messagetype,jdbcType=VARCHAR},
  62 + #{messagestatus,jdbcType=VARCHAR}, #{sendtime,jdbcType=TIMESTAMP}, #{receivetime,jdbcType=TIMESTAMP},
  63 + #{objectid,jdbcType=VARCHAR}, #{flightno,jdbcType=VARCHAR}, #{flightdate,jdbcType=TIMESTAMP},
  64 + #{masterautoid,jdbcType=VARCHAR}, #{waybillnomaster,jdbcType=VARCHAR}, #{secondaryautoid,jdbcType=VARCHAR},
  65 + #{waybillnosecondary,jdbcType=VARCHAR}, #{pcs,jdbcType=DECIMAL}, #{wt,jdbcType=DECIMAL},
  66 + #{responsecode,jdbcType=VARCHAR}, #{responsetext,jdbcType=VARCHAR}, #{createtime,jdbcType=TIMESTAMP},
  67 + #{messagecontent,jdbcType=CLOB}, #{receivecontent,jdbcType=CLOB})
  68 + </insert>
  69 + <insert id="insertSelective" parameterType="com.tianbo.imfClient.model.CUSTOMSMESSAGEWithBLOBs" >
  70 + insert into CUSTOMSMESSAGE
  71 + <trim prefix="(" suffix=")" suffixOverrides="," >
  72 + <if test="autoid != null" >
  73 + AUTOID,
  74 + </if>
  75 + <if test="messageid != null" >
  76 + MESSAGEID,
  77 + </if>
  78 + <if test="messagetype != null" >
  79 + MESSAGETYPE,
  80 + </if>
  81 + <if test="messagestatus != null" >
  82 + MESSAGESTATUS,
  83 + </if>
  84 + <if test="sendtime != null" >
  85 + SENDTIME,
  86 + </if>
  87 + <if test="receivetime != null" >
  88 + RECEIVETIME,
  89 + </if>
  90 + <if test="objectid != null" >
  91 + OBJECTID,
  92 + </if>
  93 + <if test="flightno != null" >
  94 + FLIGHTNO,
  95 + </if>
  96 + <if test="flightdate != null" >
  97 + FLIGHTDATE,
  98 + </if>
  99 + <if test="masterautoid != null" >
  100 + MASTERAUTOID,
  101 + </if>
  102 + <if test="waybillnomaster != null" >
  103 + WAYBILLNOMASTER,
  104 + </if>
  105 + <if test="secondaryautoid != null" >
  106 + SECONDARYAUTOID,
  107 + </if>
  108 + <if test="waybillnosecondary != null" >
  109 + WAYBILLNOSECONDARY,
  110 + </if>
  111 + <if test="pcs != null" >
  112 + PCS,
  113 + </if>
  114 + <if test="wt != null" >
  115 + WT,
  116 + </if>
  117 + <if test="responsecode != null" >
  118 + RESPONSECODE,
  119 + </if>
  120 + <if test="responsetext != null" >
  121 + RESPONSETEXT,
  122 + </if>
  123 + <if test="createtime != null" >
  124 + CREATETIME,
  125 + </if>
  126 + <if test="messagecontent != null" >
  127 + MESSAGECONTENT,
  128 + </if>
  129 + <if test="receivecontent != null" >
  130 + RECEIVECONTENT,
  131 + </if>
  132 + </trim>
  133 + <trim prefix="values (" suffix=")" suffixOverrides="," >
  134 + <if test="autoid != null" >
  135 + #{autoid,jdbcType=VARCHAR},
  136 + </if>
  137 + <if test="messageid != null" >
  138 + #{messageid,jdbcType=VARCHAR},
  139 + </if>
  140 + <if test="messagetype != null" >
  141 + #{messagetype,jdbcType=VARCHAR},
  142 + </if>
  143 + <if test="messagestatus != null" >
  144 + #{messagestatus,jdbcType=VARCHAR},
  145 + </if>
  146 + <if test="sendtime != null" >
  147 + #{sendtime,jdbcType=TIMESTAMP},
  148 + </if>
  149 + <if test="receivetime != null" >
  150 + #{receivetime,jdbcType=TIMESTAMP},
  151 + </if>
  152 + <if test="objectid != null" >
  153 + #{objectid,jdbcType=VARCHAR},
  154 + </if>
  155 + <if test="flightno != null" >
  156 + #{flightno,jdbcType=VARCHAR},
  157 + </if>
  158 + <if test="flightdate != null" >
  159 + #{flightdate,jdbcType=TIMESTAMP},
  160 + </if>
  161 + <if test="masterautoid != null" >
  162 + #{masterautoid,jdbcType=VARCHAR},
  163 + </if>
  164 + <if test="waybillnomaster != null" >
  165 + #{waybillnomaster,jdbcType=VARCHAR},
  166 + </if>
  167 + <if test="secondaryautoid != null" >
  168 + #{secondaryautoid,jdbcType=VARCHAR},
  169 + </if>
  170 + <if test="waybillnosecondary != null" >
  171 + #{waybillnosecondary,jdbcType=VARCHAR},
  172 + </if>
  173 + <if test="pcs != null" >
  174 + #{pcs,jdbcType=DECIMAL},
  175 + </if>
  176 + <if test="wt != null" >
  177 + #{wt,jdbcType=DECIMAL},
  178 + </if>
  179 + <if test="responsecode != null" >
  180 + #{responsecode,jdbcType=VARCHAR},
  181 + </if>
  182 + <if test="responsetext != null" >
  183 + #{responsetext,jdbcType=VARCHAR},
  184 + </if>
  185 + <if test="createtime != null" >
  186 + #{createtime,jdbcType=TIMESTAMP},
  187 + </if>
  188 + <if test="messagecontent != null" >
  189 + #{messagecontent,jdbcType=CLOB},
  190 + </if>
  191 + <if test="receivecontent != null" >
  192 + #{receivecontent,jdbcType=CLOB},
  193 + </if>
  194 + </trim>
  195 + </insert>
  196 +</mapper>
  1 +<!DOCTYPE html>
  2 +<html lang="en">
  3 +<head>
  4 + <meta charset="UTF-8">
  5 + <title>查询运单回执</title>
  6 + <!-- 引入样式 element-->
  7 + <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
  8 + <!-- 引入组件库 -->
  9 + <script src="https://unpkg.com/element-ui/lib/index.js"></script>
  10 +</head>
  11 +<body>
  12 +<el-form :inline="true" :model="formInline" class="demo-form-inline">
  13 + <el-form-item label="审批人">
  14 + <el-input v-model="formInline.user" placeholder="审批人"></el-input>
  15 + </el-form-item>
  16 + <el-form-item label="活动区域">
  17 + <el-select v-model="formInline.region" placeholder="活动区域">
  18 + <el-option label="区域一" value="shanghai"></el-option>
  19 + <el-option label="区域二" value="beijing"></el-option>
  20 + </el-select>
  21 + </el-form-item>
  22 + <el-form-item>
  23 + <el-button type="primary" @click="onSubmit">查询</el-button>
  24 + </el-form-item>
  25 +</el-form>
  26 +<script>
  27 + export default {
  28 + data() {
  29 + return {
  30 + formInline: {
  31 + user: '',
  32 + region: ''
  33 + }
  34 + }
  35 + },
  36 + methods: {
  37 + onSubmit() {
  38 + console.log('submit!');
  39 + }
  40 + }
  41 + }
  42 +</script>
  43 +</body>
  44 +</html>