Browse Source

ws-client

一般的电脑1 5 years ago
parent
commit
069dc563f4

+ 8 - 2
pom.xml

@@ -22,7 +22,7 @@
         <!-- mysql 数据库-->
         <mysql.version>5.1.38</mysql.version>
         <!--<mysql.version>8.0.11</mysql.version>-->
-        <druid.version>1.1.10</druid.version>
+        <druid.version>1.1.16</druid.version>
         <springboot.mybatis.version>1.3.0</springboot.mybatis.version>
         <mybatis.generator.version>1.3.7</mybatis.generator.version>
 
@@ -76,7 +76,8 @@
         <dependency>
             <groupId>mysql</groupId>
             <artifactId>mysql-connector-java</artifactId>
-            <version>${mysql.version}</version>
+            <version>8.0.15</version>
+<!--            <version>${mysql.version}</version>-->
         </dependency>
 
         <!-- alibaba的druid数据库连接池 -->
@@ -208,6 +209,11 @@
             <version>3.2.4</version>
         </dependency>
 
+        <dependency>
+            <groupId>dom4j</groupId>
+            <artifactId>dom4j</artifactId>
+            <version>1.6.1</version>
+        </dependency>
     </dependencies>
 
     <build>

+ 69 - 0
src/main/java/com/miyzh/config/DruidConfig.java

@@ -0,0 +1,69 @@
+package com.miyzh.config;
+
+import com.alibaba.druid.filter.Filter;
+import com.alibaba.druid.filter.stat.StatFilter;
+import com.alibaba.druid.pool.DruidDataSource;
+import com.alibaba.druid.support.http.StatViewServlet;
+import com.alibaba.druid.support.http.WebStatFilter;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.boot.web.servlet.FilterRegistrationBean;
+import org.springframework.boot.web.servlet.ServletRegistrationBean;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+import javax.sql.DataSource;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * description: DruidConfig
+ * date: 2020/6/19 10:29
+ * author: SZQ
+ */
+@Configuration
+public class DruidConfig {
+    @ConfigurationProperties(prefix = "spring.datasource")
+    //加载时读取指定的配置信息,前缀为spring.datasource.druid
+    @Bean
+    public DataSource druid(){
+        return new DruidDataSource();
+    }
+    //配置Druid的监控
+    //1. 配置一个管理后台的servlet
+    @Bean
+    public ServletRegistrationBean statViewServlet() {
+        //创建servlet注册实体
+        ServletRegistrationBean servletRegistrationBean = new ServletRegistrationBean(new StatViewServlet(), "/druid/*");
+        //设置ip白名单
+        servletRegistrationBean.addInitParameter("allow", "192.168.0.1");
+        //设置ip黑名单,如果allow与deny共同存在时,deny优先于allow
+        //servletRegistrationBean.addInitParameter("deny","192.168.0.1");
+        //设置控制台管理用户
+        servletRegistrationBean.addInitParameter("loginUsername", "admin");
+        servletRegistrationBean.addInitParameter("loginPassword", "123456");
+        //是否可以重置数据
+        servletRegistrationBean.addInitParameter("resetEnable", "false");
+        return servletRegistrationBean;
+    }
+    // 2. 配置一个监控的filter
+    @Bean
+    public FilterRegistrationBean webStatFilter(){
+        FilterRegistrationBean bean = new FilterRegistrationBean();
+        bean.setFilter(new WebStatFilter());
+        Map<String,String> initParams = new HashMap<>();
+        initParams.put("exclusions","*.js,*.css,/druid/*");
+        bean.setInitParameters(initParams);
+        bean.setUrlPatterns(Arrays.asList("/*"));
+        return bean;
+    }
+    // 3. 配置druid连接池以及慢日志配置
+    @Bean
+    public Filter statFilter() {
+        StatFilter filter = new StatFilter();
+        filter.setSlowSqlMillis(5000);
+        filter.setLogSlowSql(true);
+        filter.setMergeSql(true);
+        return filter;
+    }
+}

+ 28 - 0
src/main/java/com/miyzh/config/SheduledConfig.java

@@ -0,0 +1,28 @@
+package com.miyzh.config;
+
+import com.miyzh.service.UploadService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.scheduling.annotation.EnableScheduling;
+import org.springframework.scheduling.annotation.Scheduled;
+
+import java.time.LocalDateTime;
+
+/**
+ * description: SheduledConfig
+ * date: 2020/6/18 17:18
+ * author: SZQ
+ */
+
+@Configuration
+@EnableScheduling
+public class SheduledConfig {
+
+    @Autowired
+    private UploadService uploadService;
+
+    @Scheduled(fixedRate = 3 * 60 * 1000)
+    private void rertyUpload() {
+        uploadService.retryUpload();
+    }
+}

+ 174 - 169
src/main/java/com/miyzh/controller/WsController.java

@@ -1,14 +1,14 @@
 package com.miyzh.controller;
 
+import com.miyzh.entity.UploadExceptionLog;
+import com.miyzh.mapper.UploadExcepctionLogMapper;
+import com.miyzh.service.UploadService;
 import com.miyzh.service.WsClientService;
-import org.apache.cxf.jaxws.endpoint.dynamic.JaxWsDynamicClientFactory;
-import org.bouncycastle.jcajce.provider.asymmetric.ec.KeyFactorySpi;
+import com.miyzh.utils.DesUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
-import javax.xml.namespace.QName;
-
 /**
  * description: WsCtroller
  * date: 2020/6/16 9:38
@@ -20,164 +20,165 @@ import javax.xml.namespace.QName;
 public class WsController {
 
     @Autowired
-    WsClientService wsClientService;
+    private WsClientService wsClientService;
+
+    @Autowired
+    private UploadExcepctionLogMapper uploadExpectionLogMapper;
+
+    @Autowired
+    private UploadService uploadService;
+
 
     @RequestMapping("uploadPatBillInfo")
-    public String uploadPatBillInfo() {
-        try{
-            System.out.println("GetIn");
-            String webUrl = "http://15.72.29.170:86/qdmmib/webservice/runservice?wsdl";
-            String methodName = "runservice";
-            String param = "<Request>" +
-            "<TradeCode>uploadPatBillInfo</TradeCode>" +
-            "<Version></Version>" +
-            "<YLJGDM></YLJGDM>" +
-            "<YLJGXZQH></YLJGXZQH>" +
-            "<AgentIP></AgentIP>" +
-            "<AgentMAC></AgentMAC>" +
-            "<JYSJ></JYSJ>" +
-            "<SERIAL_NUMBER></SERIAL_NUMBER>" +
-            "<HS_NUMBER></HS_NUMBER>" +
-            "<Patient_IDStr></Patient_IDStr>" +
-            "<HS_PATIENT_NAME>123</HS_PATIENT_NAME>" +
-            "<CBRXZQH></CBRXZQH>" +
-            "<BENEFIT_TYPE_CODE>12</BENEFIT_TYPE_CODE>" +
-            "<BENEFIT_TYPE>职工</BENEFIT_TYPE>" +
-            "<BMI_CONVERED_AMOUNT></BMI_CONVERED_AMOUNT>" +
-            "<CKC892></CKC892>" +
-            "<PatientBenefitGroupCode>1</PatientBenefitGroupCode>" +
-            "<BENEFIT_GROUP_ID></BENEFIT_GROUP_ID>" +
-            "<MpName></MpName>" +
-            "<GENDER>1</GENDER>" +
-            "<PATIENT_BIRTH></PATIENT_BIRTH>" +
-            "<MCardNo></MCardNo>" +
-            "<CardType></CardType>" +
-            "<CardNo></CardNo>" +
-            "<PayUnit></PayUnit>" +
-            "<HS_STATUS></HS_STATUS>" +
-            "<Contact></Contact>" +
-            "<DOC_NUMBER></DOC_NUMBER>" +
-            "<BNo></BNo>" +
-            "<MEDICAL_TYPE></MEDICAL_TYPE>" +
-            "<JZWYBH></JZWYBH>" +
-            "<BDate>2012-03-11 16:15:00</BDate>" +
-            "<HOSPITAL_ID>123</HOSPITAL_ID>" +
-            "<HospitalType>123</HospitalType>" +
-            "<HOSPITAL_LEVEL>1</HOSPITAL_LEVEL>" +
-            "<DeptCode></DeptCode>" +
-            "<AKF005></AKF005>" +
-            "<HS_DIAGNOSIS_IN_NAME></HS_DIAGNOSIS_IN_NAME>" +
-            "<HS_DIAGNOSIS_OUT_NAME></HS_DIAGNOSIS_OUT_NAME>" +
-            "<DIAGNOSIS_IN>012</DIAGNOSIS_IN>" +
-            "<DIAGNOSIS_OUT>12</DIAGNOSIS_OUT>" +
-            "<ICD1></ICD1>" +
-            "<ICD2></ICD2>" +
-            "<ICD3></ICD3>" +
-            "<ICD4></ICD4>" +
-            "<ICD5></ICD5>" +
-            "<ICD6></ICD6>" +
-            "<ICD7></ICD7>" +
-            "<ICD8></ICD8>" +
-            "<ICD9></ICD9>" +
-            "<ICD10></ICD10>" +
-            "<ICD11></ICD11>" +
-            "<ICD12></ICD12>" +
-            "<ICD13></ICD13>" +
-            "<ICD14></ICD14>" +
-            "<ICD15></ICD15>" +
-            "<ICD16></ICD16>" +
-            "<IN_DATE>2012-02-02</IN_DATE>" +
-            "<OUT_DATE>2012-02-12</OUT_DATE>" +
-            "<SETTLE_DATE>2012-02-12</SETTLE_DATE>" +
-            "<CDate>2012-02-02</CDate>" +
-            "<TOTAL_COST>12000</TOTAL_COST>" +
-            "<MtCode>1</MtCode>" +
-            "<Refund>0</Refund>" +
-            "<RefundBNo>45544965</RefundBNo>" +
-            "<HName></HName>" +
-            "<FHID></FHID>" +
-            "<FHName></FHName>" +
-            "<THName></THName>" +
-            "<DPVisit></DPVisit>" +
-            "<OHReasonCode></OHReasonCode>" +
-            "<CDBNo></CDBNo>" +
-            "<CDICD></CDICD>" +
-            "<IsPregnant></IsPregnant>" +
-            "<IsLactation></IsLactation>" +
-            "<Height></Height>" +
-            "<Weight></Weight>" +
-            "<TInHosp></TInHosp>" +
-            "<ChargeBNo></ChargeBNo>" +
-            "<DPMpName></DPMpName>" +
-            "<DPDist></DPDist>" +
-            "<Bed></Bed>" +
-            "<BillDetailList>" +
-            "<BillDetail>" +
-            "<BDetailNo>44545</BDetailNo>" +
-            "<BNo></BNo >" +
-            "<DOC_NUMBER></DOC_NUMBER>" +
-            "<ITEM_DATE>2012-02-02</ITEM_DATE>" +
-            "<ITEM_ID>1</ITEM_ID>" +
-            "<ITEM_NAME></ITEM_NAME>" +
-            "<ITEM_TYPE></ITEM_TYPE>" +
-            "<USAGE_UNIT></USAGE_UNIT>" +
-            "<Specification></Specification>" +
-            "<Z_PhysicianAP></Z_PhysicianAP>" +
-            "<DocLevel></DocLevel>" +
-            "<PRICE>120</PRICE>" +
-            "<NUMBERS></NUMBERS>" +
-            "<COSTS></COSTS>" +
-            "<DeptCode></DeptCode>" +
-            "<DEPTNAME></DEPTNAME>" +
-            "<AKF005></AKF005>" +
-            "<DocName></DocName>" +
-            "<USAGE></USAGE>" +
-            "<DOUSAGE></DOUSAGE>" +
-            "<FREQUENCY_INTERVAL></FREQUENCY_INTERVAL>" +
-            "<USAGE_DAYS></USAGE_DAYS>" +
-            "<ELIGIBLE_AMOUNT></ELIGIBLE_AMOUNT>" +
-            "<DocLevel></DocLevel>" +
-                    "</BillDetail>" +
-            "<BillDetail>" +
-            "<BDetailNo>44546</BDetailNo>" +
-            "<BNo></BNo >" +
-            "<DOC_NUMBER></DOC_NUMBER>" +
-            "<ITEM_DATE>2012-02-02</ITEM_DATE>" +
-            "<ITEM_ID>1</ITEM_ID>" +
-            "<ITEM_NAME></ITEM_NAME>" +
-            "<ITEM_TYPE></ITEM_TYPE>" +
-            "<USAGE_UNIT></USAGE_UNIT>" +
-            "<Specification></Specification>" +
-            "<Z_PhysicianAP></Z_PhysicianAP>" +
-            "<DocLevel></DocLevel>" +
-            "<PRICE>120</PRICE>" +
-            "<NUMBERS></NUMBERS>" +
-            "<COSTS></COSTS>" +
-            "<DeptCode></DeptCode>" +
-            "<DEPTNAME></DEPTNAME>" +
-            "<AKF005></AKF005>" +
-            "<DocName></DocName>" +
-            "<USAGE></USAGE>" +
-            "<DOUSAGE></DOUSAGE>" +
-            "<FREQUENCY_INTERVAL></FREQUENCY_INTERVAL>" +
-            "<USAGE_DAYS></USAGE_DAYS>" +
-            "<ELIGIBLE_AMOUNT></ELIGIBLE_AMOUNT>" +
-            "<DocLevel></DocLevel>" +
-            "</BillDetail>" +
-            "</BillDetailList>" +
-            "</Request>";
-            return wsClientService.callWebSV(webUrl, methodName, param);
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-        return null;
+    public String uploadPatBillInfo() throws Exception {
+        UploadExceptionLog uploadExceptionLog = new UploadExceptionLog();
+        String param = "<Request>" +
+                "<TradeCode>uploadPatBillInfo</TradeCode>" +
+                "<Version></Version>" +
+                "<YLJGDM></YLJGDM>" +
+                "<YLJGXZQH></YLJGXZQH>" +
+                "<AgentIP></AgentIP>" +
+                "<AgentMAC></AgentMAC>" +
+                "<JYSJ></JYSJ>" +
+                "<SERIAL_NUMBER>1111</SERIAL_NUMBER>" +
+                "<HS_NUMBER></HS_NUMBER>" +
+                "<Patient_IDStr></Patient_IDStr>" +
+                "<HS_PATIENT_NAME>123</HS_PATIENT_NAME>" +
+                "<CBRXZQH></CBRXZQH>" +
+                "<BENEFIT_TYPE_CODE>12</BENEFIT_TYPE_CODE>" +
+                "<BENEFIT_TYPE>职工</BENEFIT_TYPE>" +
+                "<BMI_CONVERED_AMOUNT></BMI_CONVERED_AMOUNT>" +
+                "<CKC892></CKC892>" +
+                "<PatientBenefitGroupCode>1</PatientBenefitGroupCode>" +
+                "<BENEFIT_GROUP_ID></BENEFIT_GROUP_ID>" +
+                "<MpName></MpName>" +
+                "<GENDER>1</GENDER>" +
+                "<PATIENT_BIRTH></PATIENT_BIRTH>" +
+                "<MCardNo></MCardNo>" +
+                "<CardType></CardType>" +
+                "<CardNo></CardNo>" +
+                "<PayUnit></PayUnit>" +
+                "<HS_STATUS></HS_STATUS>" +
+                "<Contact></Contact>" +
+                "<DOC_NUMBER></DOC_NUMBER>" +
+                "<BNo></BNo>" +
+                "<MEDICAL_TYPE></MEDICAL_TYPE>" +
+                "<JZWYBH></JZWYBH>" +
+                "<BDate>2012-03-11 16:15:00</BDate>" +
+                "<HOSPITAL_ID>123</HOSPITAL_ID>" +
+                "<HospitalType>123</HospitalType>" +
+                "<HOSPITAL_LEVEL>1</HOSPITAL_LEVEL>" +
+                "<DeptCode></DeptCode>" +
+                "<AKF005></AKF005>" +
+                "<HS_DIAGNOSIS_IN_NAME></HS_DIAGNOSIS_IN_NAME>" +
+                "<HS_DIAGNOSIS_OUT_NAME></HS_DIAGNOSIS_OUT_NAME>" +
+                "<DIAGNOSIS_IN>012</DIAGNOSIS_IN>" +
+                "<DIAGNOSIS_OUT>12</DIAGNOSIS_OUT>" +
+                "<ICD1></ICD1>" +
+                "<ICD2></ICD2>" +
+                "<ICD3></ICD3>" +
+                "<ICD4></ICD4>" +
+                "<ICD5></ICD5>" +
+                "<ICD6></ICD6>" +
+                "<ICD7></ICD7>" +
+                "<ICD8></ICD8>" +
+                "<ICD9></ICD9>" +
+                "<ICD10></ICD10>" +
+                "<ICD11></ICD11>" +
+                "<ICD12></ICD12>" +
+                "<ICD13></ICD13>" +
+                "<ICD14></ICD14>" +
+                "<ICD15></ICD15>" +
+                "<ICD16></ICD16>" +
+                "<IN_DATE>2012-02-02</IN_DATE>" +
+                "<OUT_DATE>2012-02-12</OUT_DATE>" +
+                "<SETTLE_DATE>2012-02-12</SETTLE_DATE>" +
+                "<CDate>2012-02-02</CDate>" +
+                "<TOTAL_COST>12000</TOTAL_COST>" +
+                "<MtCode>1</MtCode>" +
+                "<Refund>0</Refund>" +
+                "<RefundBNo>45544965</RefundBNo>" +
+                "<HName></HName>" +
+                "<FHID></FHID>" +
+                "<FHName></FHName>" +
+                "<THName></THName>" +
+                "<DPVisit></DPVisit>" +
+                "<OHReasonCode></OHReasonCode>" +
+                "<CDBNo></CDBNo>" +
+                "<CDICD></CDICD>" +
+                "<IsPregnant></IsPregnant>" +
+                "<IsLactation></IsLactation>" +
+                "<Height></Height>" +
+                "<Weight></Weight>" +
+                "<TInHosp></TInHosp>" +
+                "<ChargeBNo></ChargeBNo>" +
+                "<DPMpName></DPMpName>" +
+                "<DPDist></DPDist>" +
+                "<Bed></Bed>" +
+                "<BillDetailList>" +
+                "<BillDetail>" +
+                "<BDetailNo>44545</BDetailNo>" +
+                "<BNo></BNo >" +
+                "<DOC_NUMBER></DOC_NUMBER>" +
+                "<ITEM_DATE>2012-02-02</ITEM_DATE>" +
+                "<ITEM_ID>1</ITEM_ID>" +
+                "<ITEM_NAME></ITEM_NAME>" +
+                "<ITEM_TYPE></ITEM_TYPE>" +
+                "<USAGE_UNIT></USAGE_UNIT>" +
+                "<Specification></Specification>" +
+                "<Z_PhysicianAP></Z_PhysicianAP>" +
+                "<DocLevel></DocLevel>" +
+                "<PRICE>120</PRICE>" +
+                "<NUMBERS></NUMBERS>" +
+                "<COSTS></COSTS>" +
+                "<DeptCode></DeptCode>" +
+                "<DEPTNAME></DEPTNAME>" +
+                "<AKF005></AKF005>" +
+                "<DocName></DocName>" +
+                "<USAGE></USAGE>" +
+                "<DOUSAGE></DOUSAGE>" +
+                "<FREQUENCY_INTERVAL></FREQUENCY_INTERVAL>" +
+                "<USAGE_DAYS></USAGE_DAYS>" +
+                "<ELIGIBLE_AMOUNT></ELIGIBLE_AMOUNT>" +
+                "<DocLevel></DocLevel>" +
+                "</BillDetail>" +
+                "<BillDetail>" +
+                "<BDetailNo>44546</BDetailNo>" +
+                "<BNo></BNo >" +
+                "<DOC_NUMBER></DOC_NUMBER>" +
+                "<ITEM_DATE>2012-02-02</ITEM_DATE>" +
+                "<ITEM_ID>1</ITEM_ID>" +
+                "<ITEM_NAME></ITEM_NAME>" +
+                "<ITEM_TYPE></ITEM_TYPE>" +
+                "<USAGE_UNIT></USAGE_UNIT>" +
+                "<Specification></Specification>" +
+                "<Z_PhysicianAP></Z_PhysicianAP>" +
+                "<DocLevel></DocLevel>" +
+                "<PRICE>120</PRICE>" +
+                "<NUMBERS></NUMBERS>" +
+                "<COSTS></COSTS>" +
+                "<DeptCode></DeptCode>" +
+                "<DEPTNAME></DEPTNAME>" +
+                "<AKF005></AKF005>" +
+                "<DocName></DocName>" +
+                "<USAGE></USAGE>" +
+                "<DOUSAGE></DOUSAGE>" +
+                "<FREQUENCY_INTERVAL></FREQUENCY_INTERVAL>" +
+                "<USAGE_DAYS></USAGE_DAYS>" +
+                "<ELIGIBLE_AMOUNT></ELIGIBLE_AMOUNT>" +
+                "<DocLevel></DocLevel>" +
+                "</BillDetail>" +
+                "</BillDetailList>" +
+                "</Request>";
+//        uploadExceptionLog.setUploadInfo(DesUtil.decrypt(param));
+        uploadExceptionLog.setUploadInfo(param);
+        return uploadService.upload(uploadExceptionLog);
     }
 
     @RequestMapping("uploadDocStatus")
     public String uploadDocStatus() throws Exception {
         try{
-            String webUrl = "http://15.72.29.170:86/qdmmib/webservice/runservice?wsdl";
-            String methodName = "runservice";
+            UploadExceptionLog uploadExceptionLog = new UploadExceptionLog();
             String param =
             "<Request>" +
                 "<TradeCode>uploadDocStatus</TradeCode>" +
@@ -190,7 +191,9 @@ public class WsController {
                 "<SERIAL_NUMBER>202003141202022</SERIAL_NUMBER>" +
                 "<STATUS>0</STATUS>	" +
             "</Request>";
-            return wsClientService.callWebSV(webUrl, methodName, param);
+            uploadExceptionLog.setUploadInfo(DesUtil.decrypt(param));
+            return uploadService.upload(uploadExceptionLog);
+           
         } catch (Exception e) {
             e.printStackTrace();
         }
@@ -210,19 +213,21 @@ public class WsController {
         return null;
     }
 
-    public static void main(String[] args) {
-        WsClientService wsClientService = new WsClientService();
-        try{
-//            String webUrl = "http://zs2.sjtt.com.cn/webservice/WebService.asmx?wsdl";
-            String webUrl = "http://www.webxml.com.cn/WebServices/WeatherWebService.asmx?wsdl";
-            String methodName = "getWeatherbyCityName";
-            String param = "青岛";
-            String str = wsClientService.callWebSV(webUrl, methodName, param);
-            System.out.println(str);
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-    }
+
+//    public static void main(String[] args) {
+//        WsClientService wsClientService = new WsClientService();
+//        try{
+////            String webUrl = "http://zs2.sjtt.com.cn/webservice/WebService.asmx?wsdl";
+//            String webUrl = "http://www.webxml.com.cn/WebServices/WeatherWebService.asmx?wsdl";
+//            String methodName = "getWeatherbyCityName";
+//            String param = "青岛";
+//            String str = wsClientService.callWebSV(webUrl, methodName, param);
+//            System.out.println(str);
+//        } catch (Exception e) {
+//            e.printStackTrace();
+//        }
+//    }
+
 
 }
 

+ 38 - 0
src/main/java/com/miyzh/entity/UploadExceptionLog.java

@@ -0,0 +1,38 @@
+package com.miyzh.entity;
+
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * description: 日志记录
+ * date: 2020/6/18 11:32
+ * author: SZQ
+ */
+@Data
+public class UploadExceptionLog {
+
+    private Long id;
+
+    private String tradeCode; //交易码
+
+    private String uploadInfo; //报文信息
+
+    private String serialNumber; //业务流水号
+
+    private String errorMsg; //错误信息
+
+    private Integer retryCount; //重试次数
+
+    private Integer status; // 1:成功, 2:执行中, 3:失败
+
+    private Integer isDel; //标记删除 0:删除 1:正常
+
+    private Date createDate;
+
+    private Date modifyDate;
+    
+
+
+
+}

+ 22 - 0
src/main/java/com/miyzh/mapper/UploadExcepctionLogMapper.java

@@ -0,0 +1,22 @@
+package com.miyzh.mapper;
+
+import com.miyzh.entity.UploadExceptionLog;
+import io.lettuce.core.dynamic.annotation.Param;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.List;
+
+/**
+ * description: UploadExpectionLogDao
+ * date: 2020/6/18 12:07
+ * author: SZQ
+ */
+@Mapper
+public interface UploadExcepctionLogMapper {
+
+    List<UploadExceptionLog> selectListLimit(@Param("limit") int limit);
+
+    Integer insert(UploadExceptionLog uploadExceptionLog);
+
+    Integer update(UploadExceptionLog uploadExceptionLog);
+}

+ 32 - 5
src/main/java/com/miyzh/rabbitMQ/MsgReceiver.java

@@ -1,12 +1,15 @@
 package com.miyzh.rabbitMQ;
 
 import com.miyzh.config.RabbitConfig;
+import com.miyzh.entity.UploadExceptionLog;
+import com.miyzh.service.UploadService;
 import com.rabbitmq.client.Channel;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.amqp.core.Message;
 import org.springframework.amqp.rabbit.annotation.RabbitHandler;
 import org.springframework.amqp.rabbit.annotation.RabbitListener;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
 import java.io.IOException;
@@ -17,19 +20,43 @@ import java.io.IOException;
  * @Date: 2019/6/21 11:37
  */
 @Component
-@RabbitListener(queues = RabbitConfig.QUEUE_A)
 public class MsgReceiver {
 
+    @Autowired
+    private UploadService uploadService;
+
     private final Logger logger = LoggerFactory.getLogger(this.getClass());
 
-    @RabbitHandler
-    public void process(String content, Message message, Channel channel) throws IOException {
-        logger.info("接收处理队列A当中的消息: " + content);
-//        System.out.println("接收处理队列A当中的消息: " + content);
+    @RabbitListener(queues = "preSettle")
+    public void preSettle(String content, Message message, Channel channel) throws IOException {
         try {
 //            int a = 1 / 0;
             System.out.println("消费消息:" + content);
             channel.basicAck(message.getMessageProperties().getDeliveryTag(), true);
+            UploadExceptionLog uploadExceptionLog = new UploadExceptionLog();
+            uploadExceptionLog.setUploadInfo(content);
+            uploadService.upload(uploadExceptionLog);
+            System.out.println("消费消息确认" + message.getMessageProperties().getConsumerQueue() + ",接收到了回调方法");
+        } catch (Exception e) {
+            //重新回到队列
+            channel.basicNack(message.getMessageProperties().getDeliveryTag(), false, true);
+            System.out.println("尝试重发:" + message.getMessageProperties().getConsumerQueue());
+            //requeue =true 重回队列,false 丢弃
+//            channel.basicReject(message.getMessageProperties().getDeliveryTag(), false);
+            // TODO 该消息已经导致异常,重发无意义,自己实现补偿机制
+
+
+        }
+    }
+
+    @RabbitListener(queues = "confirmSettle")
+    public void confirmSettle(String content, Message message, Channel channel) throws IOException {
+        try {
+            System.out.println("消费消息:" + content);
+            channel.basicAck(message.getMessageProperties().getDeliveryTag(), true);
+            UploadExceptionLog uploadExceptionLog = new UploadExceptionLog();
+            uploadExceptionLog.setUploadInfo(content);
+            uploadService.upload(uploadExceptionLog);
             System.out.println("消费消息确认" + message.getMessageProperties().getConsumerQueue() + ",接收到了回调方法");
         } catch (Exception e) {
             //重新回到队列

+ 32 - 0
src/main/java/com/miyzh/service/UploadExceptionLogService.java

@@ -0,0 +1,32 @@
+package com.miyzh.service;
+
+import com.miyzh.entity.UploadExceptionLog;
+import com.miyzh.mapper.UploadExcepctionLogMapper;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * description: UploadExceptionLogService
+ * date: 2020/6/18 15:36
+ * author: SZQ
+ */
+@Service
+public class UploadExceptionLogService {
+
+    @Autowired
+    private UploadExcepctionLogMapper uploadExcepctionLogMapper;
+
+    public List<UploadExceptionLog> listUploadExceptionLogLimit(int count) {
+        return uploadExcepctionLogMapper.selectListLimit(count);
+    }
+
+    public Integer update(UploadExceptionLog uploadExceptionLog) {
+        return uploadExcepctionLogMapper.update(uploadExceptionLog);
+    }
+
+    public Integer inster(UploadExceptionLog uploadExceptionLog) {
+        return uploadExcepctionLogMapper.insert(uploadExceptionLog);
+    }
+}

+ 120 - 0
src/main/java/com/miyzh/service/UploadService.java

@@ -0,0 +1,120 @@
+package com.miyzh.service;
+
+import com.alibaba.fastjson.JSONObject;
+import com.miyzh.entity.UploadExceptionLog;
+import com.miyzh.utils.DesUtil;
+import org.apache.commons.lang3.StringUtils;
+import org.dom4j.Document;
+import org.dom4j.DocumentHelper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * description: UploadService
+ * date: 2020/6/18 15:48
+ * author: SZQ
+ */
+@Service
+public class UploadService {
+
+    @Autowired
+    private WsClientService wsClientService;
+    @Autowired
+    private UploadExceptionLogService uploadExceptionLogService;
+    @Value("${scheduling.limit}")
+    private int limit;
+    @Value("${ws.webUrl}")
+    private String webUrl;
+
+    private final Logger logger = LoggerFactory.getLogger(this.getClass());
+
+
+    public String upload(UploadExceptionLog uploadExceptionLog) {
+        try {
+            Document doc = DocumentHelper.parseText(DesUtil.encrypt(uploadExceptionLog.getUploadInfo()));
+//            Document doc = DocumentHelper.parseText(uploadExceptionLog.getUploadInfo());
+            if (StringUtils.isBlank(uploadExceptionLog.getTradeCode())) {
+                if (StringUtils.isBlank(doc.getRootElement().element("TradeCode").getTextTrim())) {
+                    logger.error("交易码不能为空");
+                    return "交易码不能为空";
+                }
+                uploadExceptionLog.setTradeCode(doc.getRootElement().element("TradeCode").getTextTrim());
+            }
+            if (StringUtils.isBlank(uploadExceptionLog.getSerialNumber())) {
+                if (StringUtils.isBlank(doc.getRootElement().element("SERIAL_NUMBER").getTextTrim())) {
+                    return "业务流水号不能为空";
+                }
+                uploadExceptionLog.setSerialNumber(doc.getRootElement().element("SERIAL_NUMBER").getTextTrim());
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+            return "系统异常";
+        }
+        return runservice(uploadExceptionLog);
+    };
+
+    // 两种情况 1:第一次调用 2:第二次调用,第二次调用成功标记删除
+    public String runservice(UploadExceptionLog uploadExceptionLog) {
+        try{
+            System.out.println("GetIn");
+            String methodName = "runservice";
+            String param = uploadExceptionLog.getUploadInfo();
+            String resultCode = JSONObject.parseObject(wsClientService.callWebSV(webUrl, methodName, param)).get("resultCode").toString();
+            // 第二次请求
+            if (null != uploadExceptionLog.getId() && uploadExceptionLog.getId() > 0) {
+                // 如果有返回证明请求正常,标记删除该记录并记录状态,如果再次失败证明请求参数异常,更新异常信息
+                if (StringUtils.isNotBlank(resultCode)) {
+                    uploadExceptionLog.setIsDel(0);
+                    // 成功
+                    if ("0".equals(resultCode)) {
+                        uploadExceptionLog.setStatus(1);
+                    } else {
+                        uploadExceptionLog.setStatus(3);
+                        uploadExceptionLog.setErrorMsg(JSONObject.parseObject(wsClientService.callWebSV(webUrl, methodName, param))
+                                .get("resultContent").toString());
+                    }
+                    uploadExceptionLogService.update(uploadExceptionLog);
+                }
+            } else {
+                if (StringUtils.isNotBlank(resultCode) && "1".equals(resultCode)) {
+                    uploadExceptionLog.setIsDel(0);
+                    uploadExceptionLog.setStatus(3);
+                    uploadExceptionLog.setErrorMsg(JSONObject.parseObject(wsClientService.callWebSV(webUrl, methodName, param))
+                            .get("resultContent").toString());
+                    uploadExceptionLogService.inster(uploadExceptionLog);
+                }
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+            uploadExceptionLog.setErrorMsg(e.getCause().getMessage());
+            uploadExceptionLog.setIsDel(1);
+            uploadExceptionLog.setStatus(0);
+            if (null != uploadExceptionLog.getId() && uploadExceptionLog.getId() > 0) {
+                // 修改
+                uploadExceptionLogService.update(uploadExceptionLog);
+            } else {
+                // 新增异常记录
+                uploadExceptionLogService.inster(uploadExceptionLog);
+            }
+        }
+        return null;
+    }
+
+    public void retryUpload() {
+        List<UploadExceptionLog> list = uploadExceptionLogService.listUploadExceptionLogLimit(limit);
+        System.out.println("开始重传异常记录");
+        if (null != list && list.size() > 0) {
+            list.stream().forEach(item -> {
+                upload(item);
+            });
+        }
+    }
+
+    public static void main(String[] args) {
+    }
+}

+ 24 - 0
src/main/java/com/miyzh/service/WsClientService.java

@@ -1,13 +1,21 @@
 package com.miyzh.service;
 
+import com.alibaba.fastjson.JSONObject;
 import com.miyzh.utils.JaxWsDynamicClientFactory;
 import org.apache.cxf.endpoint.Client;
 import org.apache.cxf.endpoint.Endpoint;
+import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
 import org.apache.cxf.service.model.BindingInfo;
 import org.apache.cxf.service.model.BindingOperationInfo;
+import org.apache.cxf.transport.http.HTTPConduit;
+import org.apache.cxf.transports.http.configuration.HTTPClientPolicy;
+import org.dom4j.Document;
+import org.dom4j.DocumentHelper;
 import org.springframework.stereotype.Service;
 
 import javax.xml.namespace.QName;
+import java.util.HashMap;
+import java.util.Map;
 
 /**
  * description: WsService
@@ -20,6 +28,13 @@ public class WsClientService {
     public static String callWebSV(String wsdUrl, String operationName, String... params) throws Exception {
         JaxWsDynamicClientFactory dcf = JaxWsDynamicClientFactory.newInstance();
         Client client = dcf.createClient(wsdUrl);
+        // 设置超时单位为毫秒
+        HTTPConduit conduit = (HTTPConduit)client.getConduit();
+        HTTPClientPolicy policy = new HTTPClientPolicy();
+        policy.setConnectionTimeout(10 * 1000);
+        policy.setAllowChunking(false);
+        policy.setReceiveTimeout(10 * 1000);
+        conduit.setClient(policy);
         //处理 WebService接口和实现类namespace不同的情况
         // CXF动态客户端在处理此问题时,会报No operation was found with the name的异常
         Endpoint endpoint = client.getEndpoint();
@@ -37,7 +52,16 @@ public class WsClientService {
         Object[] objects;
         // invoke("方法名",参数1,参数2,参数3....);
         objects = client.invoke(opName, params);
+        System.out.println(objects[0].toString());
+        if (objects[0].toString().contains("<response>")) {
+            Document doc = DocumentHelper.parseText(objects[0].toString());
+            Map<String,Object> map = new HashMap<>();
+            map.put("resultCode", doc.getRootElement().element("resultCode").getTextTrim());
+            map.put("resultContent", doc.getRootElement().element("resultContent").getTextTrim());
+            return new JSONObject(map).toJSONString();
+        }
         return objects[0].toString();
     }
 
+
 }

+ 115 - 0
src/main/java/com/miyzh/utils/DesUtil.java

@@ -0,0 +1,115 @@
+package com.miyzh.utils;
+
+import javax.crypto.Cipher;
+import javax.crypto.SecretKey;
+import javax.crypto.SecretKeyFactory;
+import javax.crypto.spec.DESKeySpec;
+import java.security.SecureRandom;
+
+/**
+ * Created by Administrator on 2016/8/31.
+ */
+public class DesUtil {
+    /** 加密、解密key. */
+    private static final String PASSWORD_CRYPT_KEY = "kEHrDooxWHCWtfeSxvDvgqZq";
+    /** 加密算法,可用 DES,DESede,Blowfish. */
+    private final static String ALGORITHM = "DES";
+    public static void main(String[] args) throws Exception {
+        String md5Password = "/ysbj/31.htm";
+        String str = DesUtil.encrypt(md5Password);
+        System.out.println("str: " + str);
+        str = DesUtil.decrypt(str);
+        System.out.println("str: " + str);
+    }
+    /**
+     * 对数据进行DES加密.
+     * @param data 待进行DES加密的数据
+     * @return 返回经过DES加密后的数据
+     * @throws Exception
+     * @author zhursh
+     */
+    public final static String decrypt(String data) throws Exception {
+        return new String(decrypt(hex2byte(data.getBytes()), PASSWORD_CRYPT_KEY.getBytes()));
+    }
+    /**
+     * 对用DES加密过的数据进行解密.
+     * @param data DES加密数据
+     * @return 返回解密后的数据
+     * @throws Exception
+     * @author zhursh
+     */
+    public final static String encrypt(String data) throws Exception {
+        return byte2hex(encrypt(data.getBytes(), PASSWORD_CRYPT_KEY.getBytes()));
+    }
+    /**
+     * 用指定的key对数据进行DES加密.
+     * @param data 待加密的数据
+     * @param key DES加密的key
+     * @return 返回DES加密后的数据
+     * @throws Exception
+     * @author zhursh
+     */
+    private static byte[] encrypt(byte[] data, byte[] key) throws Exception {
+        // DES算法要求有一个可信任的随机数源
+        SecureRandom sr = new SecureRandom();
+        // 从原始密匙数据创建DESKeySpec对象
+        DESKeySpec dks = new DESKeySpec(key);
+        // 创建一个密匙工厂,然后用它把DESKeySpec转换成
+        // 一个SecretKey对象
+        SecretKeyFactory keyFactory = SecretKeyFactory.getInstance(ALGORITHM);
+        SecretKey securekey = keyFactory.generateSecret(dks);
+        // Cipher对象实际完成加密操作
+        Cipher cipher = Cipher.getInstance(ALGORITHM);
+        // 用密匙初始化Cipher对象
+        cipher.init(Cipher.ENCRYPT_MODE, securekey, sr);
+        // 现在,获取数据并加密
+        // 正式执行加密操作
+        return cipher.doFinal(data);
+    }
+    /**
+     * 用指定的key对数据进行DES解密.
+     * @param data 待解密的数据
+     * @param key DES解密的key
+     * @return 返回DES解密后的数据
+     * @throws Exception
+     * @author zhursh
+     */
+    private static byte[] decrypt(byte[] data, byte[] key) throws Exception {
+        // DES算法要求有一个可信任的随机数源
+        SecureRandom sr = new SecureRandom();
+        // 从原始密匙数据创建一个DESKeySpec对象
+        DESKeySpec dks = new DESKeySpec(key);
+        // 创建一个密匙工厂,然后用它把DESKeySpec对象转换成
+        // 一个SecretKey对象
+        SecretKeyFactory keyFactory = SecretKeyFactory.getInstance(ALGORITHM);
+        SecretKey securekey = keyFactory.generateSecret(dks);
+        // Cipher对象实际完成解密操作
+        Cipher cipher = Cipher.getInstance(ALGORITHM);
+        // 用密匙初始化Cipher对象
+        cipher.init(Cipher.DECRYPT_MODE, securekey, sr);
+        // 现在,获取数据并解密
+        // 正式执行解密操作
+        return cipher.doFinal(data);
+    }
+    public static byte[] hex2byte(byte[] b) {
+        if ((b.length % 2) != 0) throw new IllegalArgumentException("长度不是偶数");
+        byte[] b2 = new byte[b.length / 2];
+        for (int n = 0; n < b.length; n += 2) {
+            String item = new String(b, n, 2);
+            b2[n / 2] = (byte) Integer.parseInt(item, 16);
+        }
+        return b2;
+    }
+    public static String byte2hex(byte[] b) {
+        String hs = "";
+        String stmp = "";
+        for (int n = 0; n < b.length; n++) {
+            stmp = (Integer.toHexString(b[n] & 0XFF));
+            if (stmp.length() == 1)
+                hs = hs + "0" + stmp;
+            else
+                hs = hs + stmp;
+        }
+        return hs.toUpperCase();
+    }
+}

+ 9 - 0
src/main/java/com/miyzh/utils/ExceptionMsgUtil.java

@@ -0,0 +1,9 @@
+package com.miyzh.utils;
+
+/**
+ * description: ExceptionMsgUtil
+ * date: 2020/6/23 9:18
+ * author: SZQ
+ */
+public class ExceptionMsgUtil {
+}

+ 19 - 13
src/main/resources/application-szq.yml

@@ -3,27 +3,29 @@ spring:
     name: yideb-proxy-srv
 #druid数据源相关配置配置
   datasource:
-    url: jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&rewriteBatchedStatements
-    username: szq
-    password: 102030
+    url: jdbc:mysql://localhost:3306/proxy_srv?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&rewriteBatchedStatements=true&serverTimezone=Asia/Shanghai
+    username: root
+    password: root
     driver-class-name: com.mysql.jdbc.Driver
     type: com.alibaba.druid.pool.DruidDataSource
 
     #连接池的配置信息
-    initialSize: 5
-    minIdle: 5
-    maxActive: 20
-    maxWait: 60000
-    timeBetweenEvictionRunsMillis: 60000
+    initialSize: 5 #连接池初始化大小
+    minIdle: 5 #最小空闲连接数
+    maxActive: 20 #最大连接数
+    maxWait: 60000 #获取连接等待超时时间
+    timeBetweenEvictionRunsMillis: 60000 #间隔多久进行一次检测,检测需要关闭的空闲连接
     minEvictableIdleTimeMillis: 300000
     validationQuery: SELECT 1 FROM DUAL
     testWhileIdle: true
     testOnBorrow: false
     testOnReturn: false
     poolPreparedStatements: true
+    #   配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
+    filters: stat,wall
     maxPoolPreparedStatementPerConnectionSize: 20
-    filters: stat,wall,log4j
-    connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
+    useGlobalDataSourceStat: true
+    connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=500
 
 
   #redis配置数据
@@ -66,12 +68,16 @@ spring:
     publisher-returns: true
 #mybatis 配置信息
 mybatis:
-  type-aliases-package: com.miyzh.domain
-  mapperLocations: classpath:/mappers/**/*.xml
+  mapperLocations: classpath:/mapping/*.xml
   configLocation: classpath:mybatis/mybatis-config.xml
 
 server:
-  port: 8090
+  port: 18080
+
+scheduling:
+  limit: 100
+ws:
+  webUrl: http://15.72.29.170:86/qdmmib/webservice/runservice?wsdl
 
 
 

+ 37 - 31
src/main/resources/application.yml

@@ -1,49 +1,51 @@
 spring:
   application:
     name: yideb-proxy-srv
-#druid数据源相关配置配置
+  #druid数据源相关配置配置
   datasource:
-    url: jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&rewriteBatchedStatements
-    username: root
-    password: root
+    url: jdbc:mysql://www.yidab.com:61002/yideb2-pre?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&rewriteBatchedStatements=true&serverTimezone=Asia/Shanghai
+    username: yideb2pre
+    password: yideb2pre1234YDB
     driver-class-name: com.mysql.jdbc.Driver
     type: com.alibaba.druid.pool.DruidDataSource
 
     #连接池的配置信息
-    initialSize: 5
-    minIdle: 5
-    maxActive: 20
-    maxWait: 60000
-    timeBetweenEvictionRunsMillis: 60000
+    initialSize: 5 #连接池初始化大小
+    minIdle: 5 #最小空闲连接数
+    maxActive: 20 #最大连接数
+    maxWait: 60000 #获取连接等待超时时间
+    timeBetweenEvictionRunsMillis: 60000 #间隔多久进行一次检测,检测需要关闭的空闲连接
     minEvictableIdleTimeMillis: 300000
     validationQuery: SELECT 1 FROM DUAL
     testWhileIdle: true
     testOnBorrow: false
     testOnReturn: false
     poolPreparedStatements: true
+    #   配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
+    filters: stat,wall
     maxPoolPreparedStatementPerConnectionSize: 20
-    filters: stat,wall,log4j
-    connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
+    useGlobalDataSourceStat: true
+    connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=500
 
 
-  #redis配置数据
-#  redis:
-#    hostName: 192.168.140.131
-#    hostName: 47.104.236.202
-#    port: 6379
-#    password: 123456
+    #redis配置数据
+    #  redis:
+    #    hostName: 192.168.140.131
+    #    hostName: 47.104.236.202
+    #    port: 6379
+    #    password: 123456
     #  连接超时时间
-#    timeout: 5000
-#    jedis:
-#      pool:
-#    最大连接数(使用负值表示没有限制)
-#        max-active: 10
-#    连接池最大阻塞等待时间(使用负值表示没有限制)
-#        max-wait: -1
-#      连接池中最大空闲连接(使用负值表示没有限制)
-#        max-idle: 2
-#      连接池中最小空闲连接
-#        min-idle: 0
+    #    timeout: 5000
+    #    jedis:
+    #      pool:
+    #    最大连接数(使用负值表示没有限制)
+    #        max-active: 10
+    #    连接池最大阻塞等待时间(使用负值表示没有限制)
+    #        max-wait: -1
+    #      连接池中最大空闲连接(使用负值表示没有限制)
+    #        max-idle: 2
+    #      连接池中最小空闲连接
+    #        min-idle: 0
     # 下面为连接池的补充设置,应用到上面所有数据源中
     # 初始化大小,最小,最大
 
@@ -62,16 +64,20 @@ spring:
         prefetch: 5
         #必须配置这个才会确认回调
     publisher-confirm-type: correlated
-#    publisher-confirms: true
+    #    publisher-confirms: true
     publisher-returns: true
 #mybatis 配置信息
 mybatis:
-  type-aliases-package: com.miyzh.domain
-  mapperLocations: classpath:/mappers/**/*.xml
+  mapperLocations: classpath:/mapping/*.xml
   configLocation: classpath:mybatis/mybatis-config.xml
 
 server:
   port: 18080
 
+scheduling:
+  limit: 100
+ws:
+  webUrl: http://15.72.29.170:86/qdmmib/webservice/runservice?wsdl
+
 
 

+ 56 - 0
src/main/resources/mapping/UploadExpectionLogMapping.xml

@@ -0,0 +1,56 @@
+<?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.miyzh.mapper.UploadExcepctionLogMapper">
+
+    <resultMap id="BaseResultMap" type="com.miyzh.entity.UploadExceptionLog">
+        <result column="id" jdbcType="BIGINT" property="id" />
+        <result column="trade_code" jdbcType="VARCHAR" property="tradeCode" />
+        <result column="serial_number" jdbcType="VARCHAR" property="serialNumber" />
+        <result column="upload_info" jdbcType="LONGVARCHAR" property="uploadInfo" />
+        <result column="error_msg" jdbcType="VARCHAR" property="errorMsg" />
+        <result column="retry_count" jdbcType="INTEGER" property="retryCount" />
+        <result column="status" jdbcType="INTEGER" property="status" />
+        <result column="is_del" jdbcType="INTEGER" property="isDel" />
+        <result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
+        <result column="modify_date" jdbcType="TIMESTAMP" property="modifyDate" />
+    </resultMap>
+
+    <select id="selectListLimit" resultMap="BaseResultMap">
+        select
+            id, trade_code, serial_number, upload_info, error_msg, retry_count, status, is_del, create_date, modify_date
+        from
+            upload_exception_log
+        where
+            is_del = 1
+            and status = 0
+            order by modify_date asc
+            limit 0, #{limit}
+    </select>
+
+    <insert id="insert" parameterType="com.miyzh.entity.UploadExceptionLog">
+        insert into upload_exception_log
+        (trade_code, serial_number, upload_info, error_msg, retry_count, status, is_del,modify_date,create_date)
+        values
+        (#{tradeCode},#{serialNumber}, #{uploadInfo}, #{errorMsg}, 1, #{status}, #{isDel}, now(), now())
+    </insert>
+    <update id="update" parameterType="com.miyzh.entity.UploadExceptionLog">
+        update upload_exception_log
+        set
+        <if test="serialNumber">
+            serial_number = #{serialNumber},
+        </if>
+        <if test="errorMsg">
+            error_msg = #{errorMsg},
+        </if>
+        <if test="status">
+            status = #{status},
+        </if>
+        <if test="isDel">
+            is_del = #{isDel},
+        </if>
+        modify_date = now(),
+        retry_count = retry_count+1
+        where id=#{id}
+    </update>
+
+</mapper>