Browse Source

修改火运质检

zx 2 years ago
parent
commit
98e8d246b1

+ 1 - 1
pom.xml

@@ -194,7 +194,7 @@
                     <!--包名-->
                     <targetPackage>com.steerinfo.dil</targetPackage>
                     <tables>
-                        <table>RMS_MATERIAL</table>
+                        <table>TMSTRAIN_QUALITY_RESULT</table>
                     </tables>
                 </configuration>
                 <executions>

+ 53 - 0
src/main/java/com/steerinfo/dil/controller/TmstrainQualityResultController.java

@@ -0,0 +1,53 @@
+package com.steerinfo.dil.controller;
+
+import com.steerinfo.framework.controller.BaseRESTfulController;
+import com.steerinfo.framework.controller.RESTfulResult;
+import com.steerinfo.framework.service.pagehelper.PageList;
+import com.steerinfo.framework.utils.collection.ListUtils;
+import com.steerinfo.dil.model.TmstrainQualityResult;
+import com.steerinfo.dil.service.ITmstrainQualityResultService;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.dom4j.DocumentException;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.transaction.Transactional;
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.ArrayList;
+import java.math.BigDecimal;
+
+/**
+ * TmstrainQualityResult RESTful接口:
+ * @author generator
+ * @version 1.0-SNAPSHORT 2022-07-11 05:00
+ * 类描述
+ * 修订历史:
+ * 日期:2022-07-11
+ * 作者:generator
+ * 参考:
+ * 描述:TmstrainQualityResult RESTful接口
+ * @see null
+ * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
+ */
+@RestController
+@RequestMapping("/${api.version}/tmstrainqualityresults")
+public class TmstrainQualityResultController extends BaseRESTfulController {
+
+    @Autowired
+    ITmstrainQualityResultService tmstrainQualityResultService;
+
+
+//    @GetMapping("/insert")
+//    @Transactional
+//    public RESTfulResult addQualityResult() throws IOException, DocumentException {
+//        return success(tmstrainQualityResultService.insertTmstrainQualityResult());
+//    }
+
+}

+ 20 - 0
src/main/java/com/steerinfo/dil/mapper/TmstrainQualityResultMapper.java

@@ -0,0 +1,20 @@
+package com.steerinfo.dil.mapper;
+
+import com.steerinfo.dil.model.TmstrainQualityResult;
+import com.steerinfo.framework.mapper.IBaseMapper;
+import java.math.*;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Select;
+
+@Mapper
+public interface TmstrainQualityResultMapper extends IBaseMapper<TmstrainQualityResult, Short> {
+   //查看未质检的火车实绩
+    List<Map<String, Object>> selectWzInputId();
+
+   // 获取主键id
+    @Select("select seq_TMSTRAIN_QUALITY_RESULT.nextval from dual")
+    BigDecimal selectMaxId();
+}

+ 2 - 0
src/main/java/com/steerinfo/dil/mapper/TmstruckWeightResultMapper.java

@@ -71,4 +71,6 @@ public interface TmstruckWeightResultMapper extends IBaseMapper<TmstruckWeightRe
 
     //修改采购内转的运输订单需求中关联的采购订单Id
     int updatePurchaseInwordAPOId(Map<String, Object> mesMap);
+
+    List<Map<String, Object>> getShipQualityResult(Map<String,Object> map);
 }

+ 394 - 0
src/main/java/com/steerinfo/dil/model/TmstrainQualityResult.java

@@ -0,0 +1,394 @@
+package com.steerinfo.dil.model;
+
+import com.steerinfo.framework.model.IBasePO;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+@ApiModel(value="火运质检")
+public class TmstrainQualityResult implements IBasePO<BigDecimal> {
+    /**
+     * 主键id(RESULT_ID,DECIMAL,0)
+     */
+    @ApiModelProperty(value="主键id",required=true)
+    private BigDecimal resultId;
+
+    /**
+     * 总实绩id(RESULT_TOTAL_ID,DECIMAL,0)
+     */
+    @ApiModelProperty(value="总实绩id",required=false)
+    private BigDecimal resultTotalId;
+
+    /**
+     * 进厂流水号(WZ_INPUT_ID,VARCHAR,255)
+     */
+    @ApiModelProperty(value="进厂流水号",required=false)
+    private String wzInputId;
+
+    /**
+     * 物资编号(WZ_ID,VARCHAR,255)
+     */
+    @ApiModelProperty(value="物资编号",required=false)
+    private String wzId;
+
+    /**
+     * 矿点编号(MINE_ID ,VARCHAR,255)
+     */
+    @ApiModelProperty(value="矿点编号",required=false)
+    private String mineId;
+
+    /**
+     * 合同号(CONTRANCT_NO,VARCHAR,200)
+     */
+    @ApiModelProperty(value="合同号",required=false)
+    private String contranctNo;
+
+    /**
+     * 供应商编号(SUPLIER_ID,VARCHAR,200)
+     */
+    @ApiModelProperty(value="供应商编号",required=false)
+    private String suplierId;
+
+    /**
+     * 矿点(MINE_NAME,VARCHAR,255)
+     */
+    @ApiModelProperty(value="矿点",required=false)
+    private String mineName;
+
+    /**
+     *  1、进口矿  2、国内矿(IS_IMPORT,VARCHAR,20)
+     */
+    @ApiModelProperty(value=" 1、进口矿  2、国内矿",required=false)
+    private String isImport;
+
+    /**
+     * 磅单号(POUND_NO,VARCHAR,50)
+     */
+    @ApiModelProperty(value="磅单号",required=false)
+    private String poundNo;
+
+    /**
+     * 车号(CARGO_NO,VARCHAR,50)
+     */
+    @ApiModelProperty(value="车号",required=false)
+    private String cargoNo;
+
+    /**
+     * 发站(SATION_NAME,VARCHAR,50)
+     */
+    @ApiModelProperty(value="发站",required=false)
+    private String sationName;
+
+    /**
+     * 采购单位名称(PURCHASE_UNIT_NAME,VARCHAR,50)
+     */
+    @ApiModelProperty(value="采购单位名称",required=false)
+    private String purchaseUnitName;
+
+    /**
+     * 船号(SHIP_NAME,VARCHAR,255)
+     */
+    @ApiModelProperty(value="船号",required=false)
+    private String shipName;
+
+    /**
+     * 抽样日期(SAMPLE_DATE,TIMESTAMP,7)
+     */
+    @ApiModelProperty(value="抽样日期",required=false)
+    private Date sampleDate;
+
+    /**
+     * 抽样地点(SAMPLE_PLACE_NAME,VARCHAR,255)
+     */
+    @ApiModelProperty(value="抽样地点",required=false)
+    private String samplePlaceName;
+
+    /**
+     * 新增日期(INSERT_TIME,TIMESTAMP,7)
+     */
+    @ApiModelProperty(value="新增日期",required=true)
+    private Date insertTime;
+
+    /**
+     * 备注(INSERT_REMARK,VARCHAR,255)
+     */
+    @ApiModelProperty(value="备注",required=false)
+    private String insertRemark;
+
+    /**
+     * 进厂时间(INPUT_DATE,VARCHAR,30)
+     */
+    @ApiModelProperty(value="进厂时间",required=false)
+    private String inputDate;
+
+    /**
+     * 净重(NET_WEIGHT,VARCHAR,20)
+     */
+    @ApiModelProperty(value="净重",required=false)
+    private String netWeight;
+
+    /**
+     * 是否已抽检(ISQUALITY,VARCHAR,20)
+     */
+    @ApiModelProperty(value="是否已抽检",required=false)
+    private String isquality;
+
+    /**
+     * 卸货点id(UNLOAD_ID,DECIMAL,0)
+     */
+    @ApiModelProperty(value="卸货点id",required=false)
+    private BigDecimal unloadId;
+
+    /**
+     * 扣水扣杂量(DEDUCT_NUMBER,DECIMAL,0)
+     */
+    @ApiModelProperty(value="扣水扣杂量",required=false)
+    private BigDecimal deductNumber;
+
+    /**
+     * 检验结果(ELEMENT_VALUE,VARCHAR,30)
+     */
+    @ApiModelProperty(value="检验结果",required=false)
+    private String elementValue;
+
+    private static final long serialVersionUID = 1L;
+
+    @Override
+    public BigDecimal getId() {
+        return this.resultId;
+    }
+
+    @Override
+    public void setId(BigDecimal resultId) {
+        this.resultId = resultId;
+    }
+
+    public BigDecimal getResultId() {
+        return resultId;
+    }
+
+    public void setResultId(BigDecimal resultId) {
+        this.resultId = resultId;
+    }
+
+    public BigDecimal getResultTotalId() {
+        return resultTotalId;
+    }
+
+    public void setResultTotalId(BigDecimal resultTotalId) {
+        this.resultTotalId = resultTotalId;
+    }
+
+    public String getWzInputId() {
+        return wzInputId;
+    }
+
+    public void setWzInputId(String wzInputId) {
+        this.wzInputId = wzInputId == null ? null : wzInputId.trim();
+    }
+
+    public String getWzId() {
+        return wzId;
+    }
+
+    public void setWzId(String wzId) {
+        this.wzId = wzId == null ? null : wzId.trim();
+    }
+
+    public String getMineId() {
+        return mineId;
+    }
+
+    public void setMineId(String mineId) {
+        this.mineId = mineId == null ? null : mineId.trim();
+    }
+
+    public String getContranctNo() {
+        return contranctNo;
+    }
+
+    public void setContranctNo(String contranctNo) {
+        this.contranctNo = contranctNo == null ? null : contranctNo.trim();
+    }
+
+    public String getSuplierId() {
+        return suplierId;
+    }
+
+    public void setSuplierId(String suplierId) {
+        this.suplierId = suplierId == null ? null : suplierId.trim();
+    }
+
+    public String getMineName() {
+        return mineName;
+    }
+
+    public void setMineName(String mineName) {
+        this.mineName = mineName == null ? null : mineName.trim();
+    }
+
+    public String getIsImport() {
+        return isImport;
+    }
+
+    public void setIsImport(String isImport) {
+        this.isImport = isImport == null ? null : isImport.trim();
+    }
+
+    public String getPoundNo() {
+        return poundNo;
+    }
+
+    public void setPoundNo(String poundNo) {
+        this.poundNo = poundNo == null ? null : poundNo.trim();
+    }
+
+    public String getCargoNo() {
+        return cargoNo;
+    }
+
+    public void setCargoNo(String cargoNo) {
+        this.cargoNo = cargoNo == null ? null : cargoNo.trim();
+    }
+
+    public String getSationName() {
+        return sationName;
+    }
+
+    public void setSationName(String sationName) {
+        this.sationName = sationName == null ? null : sationName.trim();
+    }
+
+    public String getPurchaseUnitName() {
+        return purchaseUnitName;
+    }
+
+    public void setPurchaseUnitName(String purchaseUnitName) {
+        this.purchaseUnitName = purchaseUnitName == null ? null : purchaseUnitName.trim();
+    }
+
+    public String getShipName() {
+        return shipName;
+    }
+
+    public void setShipName(String shipName) {
+        this.shipName = shipName == null ? null : shipName.trim();
+    }
+
+    public Date getSampleDate() {
+        return sampleDate;
+    }
+
+    public void setSampleDate(Date sampleDate) {
+        this.sampleDate = sampleDate;
+    }
+
+    public String getSamplePlaceName() {
+        return samplePlaceName;
+    }
+
+    public void setSamplePlaceName(String samplePlaceName) {
+        this.samplePlaceName = samplePlaceName == null ? null : samplePlaceName.trim();
+    }
+
+    public Date getInsertTime() {
+        return insertTime;
+    }
+
+    public void setInsertTime(Date insertTime) {
+        this.insertTime = insertTime;
+    }
+
+    public String getInsertRemark() {
+        return insertRemark;
+    }
+
+    public void setInsertRemark(String insertRemark) {
+        this.insertRemark = insertRemark == null ? null : insertRemark.trim();
+    }
+
+    public String getInputDate() {
+        return inputDate;
+    }
+
+    public void setInputDate(String inputDate) {
+        this.inputDate = inputDate == null ? null : inputDate.trim();
+    }
+
+    public String getNetWeight() {
+        return netWeight;
+    }
+
+    public void setNetWeight(String netWeight) {
+        this.netWeight = netWeight == null ? null : netWeight.trim();
+    }
+
+    public String getIsquality() {
+        return isquality;
+    }
+
+    public void setIsquality(String isquality) {
+        this.isquality = isquality == null ? null : isquality.trim();
+    }
+
+    public BigDecimal getUnloadId() {
+        return unloadId;
+    }
+
+    public void setUnloadId(BigDecimal unloadId) {
+        this.unloadId = unloadId;
+    }
+
+    public BigDecimal getDeductNumber() {
+        return deductNumber;
+    }
+
+    public void setDeductNumber(BigDecimal deductNumber) {
+        this.deductNumber = deductNumber;
+    }
+
+    public String getElementValue() {
+        return elementValue;
+    }
+
+    public void setElementValue(String elementValue) {
+        this.elementValue = elementValue == null ? null : elementValue.trim();
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(getClass().getSimpleName());
+        sb.append(" [");
+        sb.append("Hash = ").append(hashCode());
+        sb.append(", resultId=").append(resultId);
+        sb.append(", resultTotalId=").append(resultTotalId);
+        sb.append(", wzInputId=").append(wzInputId);
+        sb.append(", wzId=").append(wzId);
+        sb.append(", mineId=").append(mineId);
+        sb.append(", contranctNo=").append(contranctNo);
+        sb.append(", suplierId=").append(suplierId);
+        sb.append(", mineName=").append(mineName);
+        sb.append(", isImport=").append(isImport);
+        sb.append(", poundNo=").append(poundNo);
+        sb.append(", cargoNo=").append(cargoNo);
+        sb.append(", sationName=").append(sationName);
+        sb.append(", purchaseUnitName=").append(purchaseUnitName);
+        sb.append(", shipName=").append(shipName);
+        sb.append(", sampleDate=").append(sampleDate);
+        sb.append(", samplePlaceName=").append(samplePlaceName);
+        sb.append(", insertTime=").append(insertTime);
+        sb.append(", insertRemark=").append(insertRemark);
+        sb.append(", inputDate=").append(inputDate);
+        sb.append(", netWeight=").append(netWeight);
+        sb.append(", isquality=").append(isquality);
+        sb.append(", unloadId=").append(unloadId);
+        sb.append(", deductNumber=").append(deductNumber);
+        sb.append(", elementValue=").append(elementValue);
+        sb.append(", serialVersionUID=").append(serialVersionUID);
+        sb.append("]");
+        return sb.toString();
+    }
+}

+ 22 - 0
src/main/java/com/steerinfo/dil/service/ITmstrainQualityResultService.java

@@ -0,0 +1,22 @@
+package com.steerinfo.dil.service;
+
+import org.dom4j.DocumentException;
+
+import java.io.IOException;
+
+/**
+ * TmstrainQualityResult服务接口:
+ * @author generator
+ * @version 1.0-SNAPSHORT 2022-07-11 04:12
+ * 类描述
+ * 修订历史:
+ * 日期:2022-07-11
+ * 作者:generator
+ * 参考:
+ * 描述:TmstrainQualityResult服务接口
+ * @see null
+ * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
+ */
+public interface ITmstrainQualityResultService{
+    int insertTmstrainQualityResult() throws IOException, DocumentException;
+}

+ 1 - 0
src/main/java/com/steerinfo/dil/service/impl/TmsTruckQualityService.java

@@ -126,4 +126,5 @@ public class TmsTruckQualityService implements ITmsTruckQualityResultService {
         }
         return 1;
     }
+
 }

+ 177 - 0
src/main/java/com/steerinfo/dil/service/impl/TmstrainQualityResultServiceImpl.java

@@ -0,0 +1,177 @@
+package com.steerinfo.dil.service.impl;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.steerinfo.dil.mapper.TmstrainQualityResultMapper;
+import com.steerinfo.dil.mapper.TmstruckQualityResultMapper;
+import com.steerinfo.dil.model.TmstrainQualityResult;
+import com.steerinfo.dil.model.TmstruckQualityResult;
+import com.steerinfo.dil.service.ITmstrainQualityResultService;
+import com.steerinfo.dil.util.DataChange;
+import com.steerinfo.dil.util.XmlToJsonUtil;
+import com.steerinfo.framework.mapper.IBaseMapper;
+import com.steerinfo.framework.service.impl.BaseServiceImpl;
+import org.apache.http.HttpEntity;
+import org.apache.http.HttpResponse;
+import org.apache.http.HttpStatus;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClientBuilder;
+import org.apache.http.util.EntityUtils;
+import org.dom4j.DocumentException;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Service;
+
+import java.io.IOException;
+import java.util.Date;
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * TmstrainQualityResult服务实现:
+ * @author generator
+ * @version 1.0-SNAPSHORT 2022-07-11 04:12
+ * 类描述
+ * 修订历史:
+ * 日期:2022-07-11
+ * 作者:generator
+ * 参考:
+ * 描述:TmstrainQualityResult服务实现
+ * @see null
+ * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
+ */
+@Service(value = "tmstrainQualityResultService")
+public class TmstrainQualityResultServiceImpl implements ITmstrainQualityResultService {
+
+    @Autowired
+    TmstrainQualityResultMapper tmstrainQualityResultMapper;
+    @Autowired
+    TmstruckQualityResultMapper tmstruckQualityResultMapper;
+
+
+    //定时访问质检系统,获取质检实绩
+    @Scheduled(cron = "30 9 10 * * ?")
+//    @Override
+    public int insertTmstrainQualityResult() throws IOException, DocumentException {
+        //先查出所有需要质检的但是没有质检的磅单号
+        List<Map<String,Object>> mapList=tmstrainQualityResultMapper.selectWzInputId();
+        System.out.println(mapList);
+        if (mapList.size() != 0){
+            for (Map<String,Object> map:mapList
+            ) {
+                BigDecimal  resultTotalId= (BigDecimal) map.get("resultTotalId");
+                String capacityNumber = (String) map.get("cargonNo");
+                String grossWeightTime = (String) map.get("grossWeightTime");
+                String WzInputId = grossWeightTime + capacityNumber;
+                //		1. 创建 HttpClient 的实例
+                CloseableHttpClient httpClient = HttpClientBuilder.create().build();
+                //		2. 创建某种连接方法的实例
+                HttpGet httpGet = new HttpGet("http://172.16.33.106:40003/DG_Interface.asmx/Get_Quality_Info?WzInputId="+WzInputId);
+                //		3. 调用第一步中创建好的实例的execute方法来执行第二步中创建好的链接类实例
+                HttpResponse httpResponse = httpClient.execute(httpGet);
+                //		4. 读response获取HttpEntity
+                if (httpResponse.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
+                    HttpEntity entity = httpResponse.getEntity();
+                    System.out.println(entity);
+                    //		5. 对得到后的内容进行处理
+                    String result = EntityUtils.toString(entity, "utf-8");
+                    System.out.println(result);
+                    try {
+                        JSONObject object = XmlToJsonUtil.xmlToJson(result);
+                        System.out.println("-----object------");
+                        System.out.println(object);
+                        Map<String, Object>map1 = (Map<String, Object>) object.get("JsonResult");
+                        System.out.println(map1);
+                        List mapList2= JSON.parseArray((String) map1.get("jsonResult"));
+                        if(mapList2.size() == 0){
+                            continue;
+                        }
+                        List<Map<String,Object>>mapList9=mapList2;
+                        for (Map<String,Object> map3:mapList9
+                        ) {
+                            //判断是否生成报告单,如果生成则生成质检实绩,否则退出
+                            Object value =  map3.get("REPORT_ID");
+                            if("".equals(value)){
+                                continue;
+                            }
+                            //质检说明
+                            String DeductionDescription=(String)map3.get("DEDUCT_SEASON");
+                            //获取卸货点
+                            String samplePlaceName=(String) map3.get("SAMPLE_PLACE_NAME");
+                            //查询卸货点ID
+                            BigDecimal SamplePlaceId=tmstruckQualityResultMapper.selectSamplePlaceId(samplePlaceName);
+                            //扣水扣杂量
+                            BigDecimal Deduction= DataChange.dataToBigDecimal(map3.get("DEDUCT_NUMBER"));
+                            //抽样时间
+                            Date sampleDate= new Date((String)(map3.get("SAMPLE_DATE")));
+                            //设置车皮号
+                            String cargo =(String) map3.get("CARGO");
+                            //设置物资编号
+                            String wz_id =(String) map3.get("WZ_ID");
+                            //设置矿点编号
+                            String mine_id =(String) map3.get("MINE_ID");
+                            //设置合同号
+                            String contract_no =(String) map3.get("CONTRACT_NO");
+                            //设置供应商编号
+                            String supplier_id =(String) map3.get("SUPPLIER_ID");
+                            //设置矿种
+                            String mine_name =(String) map3.get("MINE_NAME");
+                            //设置是否为进口矿国产矿
+                            String is_import =(String) map3.get("IS_IMPORT");
+                            //获取进厂时间
+                            String input_date =(String) map3.get("INPUT_DATE");
+                            //获取检验结果
+                            String element_value =(String) map3.get("ELEMENT_VALUE");
+
+                            //获取发站
+                            //根据磅单号新增相应的质检实绩
+                            TmstrainQualityResult tmstrainQualityResult = new TmstrainQualityResult();
+                            //设置实绩id
+                            tmstrainQualityResult.setResultId(tmstrainQualityResultMapper.selectMaxId());
+                            //设置扣水扣杂
+                            tmstrainQualityResult.setDeductNumber(Deduction);
+                            //设置总实绩id
+                            tmstrainQualityResult.setResultTotalId(resultTotalId);
+                            //设置进厂流水号
+                            tmstrainQualityResult.setWzInputId(WzInputId);
+                            //设置卸货点
+                            tmstrainQualityResult.setUnloadId(SamplePlaceId);
+                            //设置抽样时间
+                            tmstrainQualityResult.setSampleDate(sampleDate);
+                            //设置质检说明
+                            tmstrainQualityResult.setInsertRemark(DeductionDescription);
+                            //设置车皮号
+                            tmstrainQualityResult.setCargoNo(cargo);
+                            //设置检验结果
+                            tmstrainQualityResult.setElementValue(element_value);
+                            //设置物资编号
+                            tmstrainQualityResult.setWzId(wz_id);
+                            tmstrainQualityResult.setMineId(mine_id);
+                            tmstrainQualityResult.setContranctNo(contract_no);
+                            tmstrainQualityResult.setSuplierId(supplier_id);
+                            tmstrainQualityResult.setMineName(mine_name);
+                            tmstrainQualityResult.setSamplePlaceName(samplePlaceName);
+                            tmstrainQualityResult.setIsImport(is_import);
+                            tmstrainQualityResult.setInputDate(input_date);
+                            tmstrainQualityResult.setInsertTime(new Date());
+                            //设置是否抽检状态
+                            tmstrainQualityResult.setIsquality("已抽检");
+                            tmstrainQualityResultMapper.insertSelective(tmstrainQualityResult);
+                        }
+                    } catch (DocumentException e) {
+                        e.printStackTrace();
+                    }
+                    EntityUtils.consume(entity);
+                } else {
+                    System.err.println(httpResponse.getStatusLine());
+                }
+//		6. 释放连接。无论执行方法是否成功,都必须释放连接
+                httpClient.close();
+            }
+        }
+        return 1;
+    }
+
+}

+ 3 - 3
src/main/resources/bootstrap.yml

@@ -17,11 +17,11 @@ eureka:
   client:
     service-url:
       defaultZone: http://root:root@${EUREKA_HOST:172.16.33.161}:${EUREKA_PORT:8081}/eureka/
-    register-with-eureka: true #表示向EurekaServer注册自己 默认为true
-    fetch-registry: true #是否从EurekaServer抓取已有的注册信息,默认为true,单节点无所谓,集群必须设置为true才能配合ribbon使用负载均衡
+    register-with-eureka: false #表示向EurekaServer注册自己 默认为true
+    fetch-registry: false #是否从EurekaServer抓取已有的注册信息,默认为true,单节点无所谓,集群必须设置为true才能配合ribbon使用负载均衡
 
   instance:
-    prefer-ip-address: true
+    prefer-ip-address: false
     status-page-url: http://${spring.cloud.client.ip-address}:${server.port}/swagger-ui.html#/
     instance-id: ${spring.cloud.client.ip-address}:${server.port}
 

+ 714 - 0
src/main/resources/com/steerinfo/dil/mapper/TmstrainQualityResultMapper.xml

@@ -0,0 +1,714 @@
+<?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.steerinfo.dil.mapper.TmstrainQualityResultMapper">
+  <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.TmstrainQualityResult">
+    <id column="RESULT_ID" jdbcType="DECIMAL" property="resultId" />
+    <result column="RESULT_TOTAL_ID" jdbcType="DECIMAL" property="resultTotalId" />
+    <result column="WZ_INPUT_ID" jdbcType="VARCHAR" property="wzInputId" />
+    <result column="WZ_ID" jdbcType="VARCHAR" property="wzId" />
+    <result column="MINE_ID " jdbcType="VARCHAR" property="mineId" />
+    <result column="CONTRANCT_NO" jdbcType="VARCHAR" property="contranctNo" />
+    <result column="SUPLIER_ID" jdbcType="VARCHAR" property="suplierId" />
+    <result column="MINE_NAME" jdbcType="VARCHAR" property="mineName" />
+    <result column="IS_IMPORT" jdbcType="VARCHAR" property="isImport" />
+    <result column="POUND_NO" jdbcType="VARCHAR" property="poundNo" />
+    <result column="CARGO_NO" jdbcType="VARCHAR" property="cargoNo" />
+    <result column="SATION_NAME" jdbcType="VARCHAR" property="sationName" />
+    <result column="PURCHASE_UNIT_NAME" jdbcType="VARCHAR" property="purchaseUnitName" />
+    <result column="SHIP_NAME" jdbcType="VARCHAR" property="shipName" />
+    <result column="SAMPLE_DATE" jdbcType="TIMESTAMP" property="sampleDate" />
+    <result column="SAMPLE_PLACE_NAME" jdbcType="VARCHAR" property="samplePlaceName" />
+    <result column="INSERT_TIME" jdbcType="TIMESTAMP" property="insertTime" />
+    <result column="INSERT_REMARK" jdbcType="VARCHAR" property="insertRemark" />
+    <result column="INPUT_DATE" jdbcType="VARCHAR" property="inputDate" />
+    <result column="NET_WEIGHT" jdbcType="VARCHAR" property="netWeight" />
+    <result column="ISQUALITY" jdbcType="VARCHAR" property="isquality" />
+    <result column="UNLOAD_ID" jdbcType="DECIMAL" property="unloadId" />
+    <result column="DEDUCT_NUMBER" jdbcType="DECIMAL" property="deductNumber" />
+    <result column="ELEMENT_VALUE" jdbcType="VARCHAR" property="elementValue" />
+  </resultMap>
+  <sql id="columns">
+    RESULT_ID, RESULT_TOTAL_ID, WZ_INPUT_ID, WZ_ID, "MINE_ID ", CONTRANCT_NO, SUPLIER_ID,
+    MINE_NAME, IS_IMPORT, POUND_NO, CARGO_NO, SATION_NAME, PURCHASE_UNIT_NAME, SHIP_NAME,
+    SAMPLE_DATE, SAMPLE_PLACE_NAME, INSERT_TIME, INSERT_REMARK, INPUT_DATE, NET_WEIGHT,
+    ISQUALITY, UNLOAD_ID, DEDUCT_NUMBER, ELEMENT_VALUE
+  </sql>
+  <sql id="columns_alias">
+    t.RESULT_ID, t.RESULT_TOTAL_ID, t.WZ_INPUT_ID, t.WZ_ID, t."MINE_ID ", t.CONTRANCT_NO,
+    t.SUPLIER_ID, t.MINE_NAME, t.IS_IMPORT, t.POUND_NO, t.CARGO_NO, t.SATION_NAME, t.PURCHASE_UNIT_NAME,
+    t.SHIP_NAME, t.SAMPLE_DATE, t.SAMPLE_PLACE_NAME, t.INSERT_TIME, t.INSERT_REMARK,
+    t.INPUT_DATE, t.NET_WEIGHT, t.ISQUALITY, t.UNLOAD_ID, t.DEDUCT_NUMBER, t.ELEMENT_VALUE
+  </sql>
+  <sql id="select">
+    SELECT <include refid="columns" /> FROM TMSTRAIN_QUALITY_RESULT
+  </sql>
+  <sql id="select_alias">
+    SELECT <include refid="columns_alias" /> FROM TMSTRAIN_QUALITY_RESULT t
+  </sql>
+  <sql id="where">
+    <where>
+      <if test="resultId != null">
+        and RESULT_ID = #{resultId}
+      </if>
+      <if test="resultTotalId != null">
+        and RESULT_TOTAL_ID = #{resultTotalId}
+      </if>
+      <if test="wzInputId != null and wzInputId != ''">
+        and WZ_INPUT_ID = #{wzInputId}
+      </if>
+      <if test="wzId != null and wzId != ''">
+        and WZ_ID = #{wzId}
+      </if>
+      <if test="mineId != null and mineId != ''">
+        and MINE_ID  = #{mineId}
+      </if>
+      <if test="contranctNo != null and contranctNo != ''">
+        and CONTRANCT_NO = #{contranctNo}
+      </if>
+      <if test="suplierId != null and suplierId != ''">
+        and SUPLIER_ID = #{suplierId}
+      </if>
+      <if test="mineName != null and mineName != ''">
+        and MINE_NAME = #{mineName}
+      </if>
+      <if test="isImport != null and isImport != ''">
+        and IS_IMPORT = #{isImport}
+      </if>
+      <if test="poundNo != null and poundNo != ''">
+        and POUND_NO = #{poundNo}
+      </if>
+      <if test="cargoNo != null and cargoNo != ''">
+        and CARGO_NO = #{cargoNo}
+      </if>
+      <if test="sationName != null and sationName != ''">
+        and SATION_NAME = #{sationName}
+      </if>
+      <if test="purchaseUnitName != null and purchaseUnitName != ''">
+        and PURCHASE_UNIT_NAME = #{purchaseUnitName}
+      </if>
+      <if test="shipName != null and shipName != ''">
+        and SHIP_NAME = #{shipName}
+      </if>
+      <if test="sampleDate != null">
+        and TO_CHAR(SAMPLE_DATE,'yyyy-MM-dd') = #{sampleDate}
+      </if>
+      <if test="samplePlaceName != null and samplePlaceName != ''">
+        and SAMPLE_PLACE_NAME = #{samplePlaceName}
+      </if>
+      <if test="insertTime != null">
+        and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
+      </if>
+      <if test="insertRemark != null and insertRemark != ''">
+        and INSERT_REMARK = #{insertRemark}
+      </if>
+      <if test="inputDate != null and inputDate != ''">
+        and INPUT_DATE = #{inputDate}
+      </if>
+      <if test="netWeight != null and netWeight != ''">
+        and NET_WEIGHT = #{netWeight}
+      </if>
+      <if test="isquality != null and isquality != ''">
+        and ISQUALITY = #{isquality}
+      </if>
+      <if test="unloadId != null">
+        and UNLOAD_ID = #{unloadId}
+      </if>
+      <if test="deductNumber != null">
+        and DEDUCT_NUMBER = #{deductNumber}
+      </if>
+      <if test="elementValue != null and elementValue != ''">
+        and ELEMENT_VALUE = #{elementValue}
+      </if>
+    </where>
+  </sql>
+  <sql id="whereLike">
+    <where>
+      <if test="resultId != null">
+        and RESULT_ID = #{resultId}
+      </if>
+      <if test="resultTotalId != null">
+        and RESULT_TOTAL_ID = #{resultTotalId}
+      </if>
+      <if test="wzInputId != null and wzInputId != ''">
+        and WZ_INPUT_ID LIKE '%${wzInputId}%'
+      </if>
+      <if test="wzId != null and wzId != ''">
+        and WZ_ID LIKE '%${wzId}%'
+      </if>
+      <if test="mineId != null and mineId != ''">
+        and MINE_ID  LIKE '%${mineId}%'
+      </if>
+      <if test="contranctNo != null and contranctNo != ''">
+        and CONTRANCT_NO LIKE '%${contranctNo}%'
+      </if>
+      <if test="suplierId != null and suplierId != ''">
+        and SUPLIER_ID LIKE '%${suplierId}%'
+      </if>
+      <if test="mineName != null and mineName != ''">
+        and MINE_NAME LIKE '%${mineName}%'
+      </if>
+      <if test="isImport != null and isImport != ''">
+        and IS_IMPORT LIKE '%${isImport}%'
+      </if>
+      <if test="poundNo != null and poundNo != ''">
+        and POUND_NO LIKE '%${poundNo}%'
+      </if>
+      <if test="cargoNo != null and cargoNo != ''">
+        and CARGO_NO LIKE '%${cargoNo}%'
+      </if>
+      <if test="sationName != null and sationName != ''">
+        and SATION_NAME LIKE '%${sationName}%'
+      </if>
+      <if test="purchaseUnitName != null and purchaseUnitName != ''">
+        and PURCHASE_UNIT_NAME LIKE '%${purchaseUnitName}%'
+      </if>
+      <if test="shipName != null and shipName != ''">
+        and SHIP_NAME LIKE '%${shipName}%'
+      </if>
+      <if test="sampleDate != null">
+        and TO_CHAR(SAMPLE_DATE,'yyyy-MM-dd') = #{sampleDate}
+      </if>
+      <if test="samplePlaceName != null and samplePlaceName != ''">
+        and SAMPLE_PLACE_NAME LIKE '%${samplePlaceName}%'
+      </if>
+      <if test="insertTime != null">
+        and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
+      </if>
+      <if test="insertRemark != null and insertRemark != ''">
+        and INSERT_REMARK LIKE '%${insertRemark}%'
+      </if>
+      <if test="inputDate != null and inputDate != ''">
+        and INPUT_DATE LIKE '%${inputDate}%'
+      </if>
+      <if test="netWeight != null and netWeight != ''">
+        and NET_WEIGHT LIKE '%${netWeight}%'
+      </if>
+      <if test="isquality != null and isquality != ''">
+        and ISQUALITY LIKE '%${isquality}%'
+      </if>
+      <if test="unloadId != null">
+        and UNLOAD_ID = #{unloadId}
+      </if>
+      <if test="deductNumber != null">
+        and DEDUCT_NUMBER = #{deductNumber}
+      </if>
+      <if test="elementValue != null and elementValue != ''">
+        and ELEMENT_VALUE LIKE '%${elementValue}%'
+      </if>
+    </where>
+  </sql>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Short">
+    delete from TMSTRAIN_QUALITY_RESULT
+    where RESULT_ID = #{resultId,jdbcType=DECIMAL}
+  </delete>
+  <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
+    delete from TMSTRAIN_QUALITY_RESULT
+    where 1!=1
+    <if test="resultTotalId != null">
+      or RESULT_TOTAL_ID = #{resultTotalId}
+    </if>
+    <if test="wzInputId != null and wzInputId != ''">
+      or WZ_INPUT_ID = #{wzInputId}
+    </if>
+    <if test="wzId != null and wzId != ''">
+      or WZ_ID = #{wzId}
+    </if>
+    <if test="mineId != null and mineId != ''">
+      or MINE_ID  = #{mineId}
+    </if>
+    <if test="contranctNo != null and contranctNo != ''">
+      or CONTRANCT_NO = #{contranctNo}
+    </if>
+    <if test="suplierId != null and suplierId != ''">
+      or SUPLIER_ID = #{suplierId}
+    </if>
+    <if test="mineName != null and mineName != ''">
+      or MINE_NAME = #{mineName}
+    </if>
+    <if test="isImport != null and isImport != ''">
+      or IS_IMPORT = #{isImport}
+    </if>
+    <if test="poundNo != null and poundNo != ''">
+      or POUND_NO = #{poundNo}
+    </if>
+    <if test="cargoNo != null and cargoNo != ''">
+      or CARGO_NO = #{cargoNo}
+    </if>
+    <if test="sationName != null and sationName != ''">
+      or SATION_NAME = #{sationName}
+    </if>
+    <if test="purchaseUnitName != null and purchaseUnitName != ''">
+      or PURCHASE_UNIT_NAME = #{purchaseUnitName}
+    </if>
+    <if test="shipName != null and shipName != ''">
+      or SHIP_NAME = #{shipName}
+    </if>
+    <if test="sampleDate != null">
+      or TO_CHAR(SAMPLE_DATE,'yyyy-MM-dd') = '#{sampleDate}'
+    </if>
+    <if test="samplePlaceName != null and samplePlaceName != ''">
+      or SAMPLE_PLACE_NAME = #{samplePlaceName}
+    </if>
+    <if test="insertTime != null">
+      or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
+    </if>
+    <if test="insertRemark != null and insertRemark != ''">
+      or INSERT_REMARK = #{insertRemark}
+    </if>
+    <if test="inputDate != null and inputDate != ''">
+      or INPUT_DATE = #{inputDate}
+    </if>
+    <if test="netWeight != null and netWeight != ''">
+      or NET_WEIGHT = #{netWeight}
+    </if>
+    <if test="isquality != null and isquality != ''">
+      or ISQUALITY = #{isquality}
+    </if>
+    <if test="unloadId != null">
+      or UNLOAD_ID = #{unloadId}
+    </if>
+    <if test="deductNumber != null">
+      or DEDUCT_NUMBER = #{deductNumber}
+    </if>
+    <if test="elementValue != null and elementValue != ''">
+      or ELEMENT_VALUE = #{elementValue}
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.steerinfo.dil.model.TmstrainQualityResult">
+    insert into TMSTRAIN_QUALITY_RESULT (RESULT_ID, RESULT_TOTAL_ID, WZ_INPUT_ID,
+                                         WZ_ID, "MINE_ID ", CONTRANCT_NO,
+                                         SUPLIER_ID, MINE_NAME, IS_IMPORT,
+                                         POUND_NO, CARGO_NO, SATION_NAME,
+                                         PURCHASE_UNIT_NAME, SHIP_NAME, SAMPLE_DATE,
+                                         SAMPLE_PLACE_NAME, INSERT_TIME, INSERT_REMARK,
+                                         INPUT_DATE, NET_WEIGHT, ISQUALITY,
+                                         UNLOAD_ID, DEDUCT_NUMBER, ELEMENT_VALUE
+    )
+    values (#{resultId,jdbcType=DECIMAL}, #{resultTotalId,jdbcType=DECIMAL}, #{wzInputId,jdbcType=VARCHAR},
+            #{wzId,jdbcType=VARCHAR}, #{mineId,jdbcType=VARCHAR}, #{contranctNo,jdbcType=VARCHAR},
+            #{suplierId,jdbcType=VARCHAR}, #{mineName,jdbcType=VARCHAR}, #{isImport,jdbcType=VARCHAR},
+            #{poundNo,jdbcType=VARCHAR}, #{cargoNo,jdbcType=VARCHAR}, #{sationName,jdbcType=VARCHAR},
+            #{purchaseUnitName,jdbcType=VARCHAR}, #{shipName,jdbcType=VARCHAR}, #{sampleDate,jdbcType=TIMESTAMP},
+            #{samplePlaceName,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP}, #{insertRemark,jdbcType=VARCHAR},
+            #{inputDate,jdbcType=VARCHAR}, #{netWeight,jdbcType=VARCHAR}, #{isquality,jdbcType=VARCHAR},
+            #{unloadId,jdbcType=DECIMAL}, #{deductNumber,jdbcType=DECIMAL}, #{elementValue,jdbcType=VARCHAR}
+           )
+  </insert>
+  <insert id="insertSelective" parameterType="com.steerinfo.dil.model.TmstrainQualityResult">
+    insert into TMSTRAIN_QUALITY_RESULT
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="resultId != null">
+        RESULT_ID,
+      </if>
+      <if test="resultTotalId != null">
+        RESULT_TOTAL_ID,
+      </if>
+      <if test="wzInputId != null">
+        WZ_INPUT_ID,
+      </if>
+      <if test="wzId != null">
+        WZ_ID,
+      </if>
+      <if test="mineId != null">
+        "MINE_ID ",
+      </if>
+      <if test="contranctNo != null">
+        CONTRANCT_NO,
+      </if>
+      <if test="suplierId != null">
+        SUPLIER_ID,
+      </if>
+      <if test="mineName != null">
+        MINE_NAME,
+      </if>
+      <if test="isImport != null">
+        IS_IMPORT,
+      </if>
+      <if test="poundNo != null">
+        POUND_NO,
+      </if>
+      <if test="cargoNo != null">
+        CARGO_NO,
+      </if>
+      <if test="sationName != null">
+        SATION_NAME,
+      </if>
+      <if test="purchaseUnitName != null">
+        PURCHASE_UNIT_NAME,
+      </if>
+      <if test="shipName != null">
+        SHIP_NAME,
+      </if>
+      <if test="sampleDate != null">
+        SAMPLE_DATE,
+      </if>
+      <if test="samplePlaceName != null">
+        SAMPLE_PLACE_NAME,
+      </if>
+      <if test="insertTime != null">
+        INSERT_TIME,
+      </if>
+      <if test="insertRemark != null">
+        INSERT_REMARK,
+      </if>
+      <if test="inputDate != null">
+        INPUT_DATE,
+      </if>
+      <if test="netWeight != null">
+        NET_WEIGHT,
+      </if>
+      <if test="isquality != null">
+        ISQUALITY,
+      </if>
+      <if test="unloadId != null">
+        UNLOAD_ID,
+      </if>
+      <if test="deductNumber != null">
+        DEDUCT_NUMBER,
+      </if>
+      <if test="elementValue != null">
+        ELEMENT_VALUE,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="resultId != null">
+        #{resultId,jdbcType=DECIMAL},
+      </if>
+      <if test="resultTotalId != null">
+        #{resultTotalId,jdbcType=DECIMAL},
+      </if>
+      <if test="wzInputId != null">
+        #{wzInputId,jdbcType=VARCHAR},
+      </if>
+      <if test="wzId != null">
+        #{wzId,jdbcType=VARCHAR},
+      </if>
+      <if test="mineId != null">
+        #{mineId,jdbcType=VARCHAR},
+      </if>
+      <if test="contranctNo != null">
+        #{contranctNo,jdbcType=VARCHAR},
+      </if>
+      <if test="suplierId != null">
+        #{suplierId,jdbcType=VARCHAR},
+      </if>
+      <if test="mineName != null">
+        #{mineName,jdbcType=VARCHAR},
+      </if>
+      <if test="isImport != null">
+        #{isImport,jdbcType=VARCHAR},
+      </if>
+      <if test="poundNo != null">
+        #{poundNo,jdbcType=VARCHAR},
+      </if>
+      <if test="cargoNo != null">
+        #{cargoNo,jdbcType=VARCHAR},
+      </if>
+      <if test="sationName != null">
+        #{sationName,jdbcType=VARCHAR},
+      </if>
+      <if test="purchaseUnitName != null">
+        #{purchaseUnitName,jdbcType=VARCHAR},
+      </if>
+      <if test="shipName != null">
+        #{shipName,jdbcType=VARCHAR},
+      </if>
+      <if test="sampleDate != null">
+        #{sampleDate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="samplePlaceName != null">
+        #{samplePlaceName,jdbcType=VARCHAR},
+      </if>
+      <if test="insertTime != null">
+        #{insertTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="insertRemark != null">
+        #{insertRemark,jdbcType=VARCHAR},
+      </if>
+      <if test="inputDate != null">
+        #{inputDate,jdbcType=VARCHAR},
+      </if>
+      <if test="netWeight != null">
+        #{netWeight,jdbcType=VARCHAR},
+      </if>
+      <if test="isquality != null">
+        #{isquality,jdbcType=VARCHAR},
+      </if>
+      <if test="unloadId != null">
+        #{unloadId,jdbcType=DECIMAL},
+      </if>
+      <if test="deductNumber != null">
+        #{deductNumber,jdbcType=DECIMAL},
+      </if>
+      <if test="elementValue != null">
+        #{elementValue,jdbcType=VARCHAR},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.TmstrainQualityResult">
+    update TMSTRAIN_QUALITY_RESULT
+    set RESULT_TOTAL_ID = #{resultTotalId,jdbcType=DECIMAL},
+        WZ_INPUT_ID = #{wzInputId,jdbcType=VARCHAR},
+        WZ_ID = #{wzId,jdbcType=VARCHAR},
+        "MINE_ID " = #{mineId,jdbcType=VARCHAR},
+        CONTRANCT_NO = #{contranctNo,jdbcType=VARCHAR},
+        SUPLIER_ID = #{suplierId,jdbcType=VARCHAR},
+        MINE_NAME = #{mineName,jdbcType=VARCHAR},
+        IS_IMPORT = #{isImport,jdbcType=VARCHAR},
+        POUND_NO = #{poundNo,jdbcType=VARCHAR},
+        CARGO_NO = #{cargoNo,jdbcType=VARCHAR},
+        SATION_NAME = #{sationName,jdbcType=VARCHAR},
+        PURCHASE_UNIT_NAME = #{purchaseUnitName,jdbcType=VARCHAR},
+        SHIP_NAME = #{shipName,jdbcType=VARCHAR},
+        SAMPLE_DATE = #{sampleDate,jdbcType=TIMESTAMP},
+        SAMPLE_PLACE_NAME = #{samplePlaceName,jdbcType=VARCHAR},
+        INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
+        INSERT_REMARK = #{insertRemark,jdbcType=VARCHAR},
+        INPUT_DATE = #{inputDate,jdbcType=VARCHAR},
+        NET_WEIGHT = #{netWeight,jdbcType=VARCHAR},
+        ISQUALITY = #{isquality,jdbcType=VARCHAR},
+        UNLOAD_ID = #{unloadId,jdbcType=DECIMAL},
+        DEDUCT_NUMBER = #{deductNumber,jdbcType=DECIMAL},
+        ELEMENT_VALUE = #{elementValue,jdbcType=VARCHAR}
+    where RESULT_ID = #{resultId,jdbcType=DECIMAL}
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.TmstrainQualityResult">
+    update TMSTRAIN_QUALITY_RESULT
+    <set>
+      <if test="resultTotalId != null">
+        RESULT_TOTAL_ID = #{resultTotalId,jdbcType=DECIMAL},
+      </if>
+      <if test="wzInputId != null">
+        WZ_INPUT_ID = #{wzInputId,jdbcType=VARCHAR},
+      </if>
+      <if test="wzId != null">
+        WZ_ID = #{wzId,jdbcType=VARCHAR},
+      </if>
+      <if test="mineId != null">
+        "MINE_ID " = #{mineId,jdbcType=VARCHAR},
+      </if>
+      <if test="contranctNo != null">
+        CONTRANCT_NO = #{contranctNo,jdbcType=VARCHAR},
+      </if>
+      <if test="suplierId != null">
+        SUPLIER_ID = #{suplierId,jdbcType=VARCHAR},
+      </if>
+      <if test="mineName != null">
+        MINE_NAME = #{mineName,jdbcType=VARCHAR},
+      </if>
+      <if test="isImport != null">
+        IS_IMPORT = #{isImport,jdbcType=VARCHAR},
+      </if>
+      <if test="poundNo != null">
+        POUND_NO = #{poundNo,jdbcType=VARCHAR},
+      </if>
+      <if test="cargoNo != null">
+        CARGO_NO = #{cargoNo,jdbcType=VARCHAR},
+      </if>
+      <if test="sationName != null">
+        SATION_NAME = #{sationName,jdbcType=VARCHAR},
+      </if>
+      <if test="purchaseUnitName != null">
+        PURCHASE_UNIT_NAME = #{purchaseUnitName,jdbcType=VARCHAR},
+      </if>
+      <if test="shipName != null">
+        SHIP_NAME = #{shipName,jdbcType=VARCHAR},
+      </if>
+      <if test="sampleDate != null">
+        SAMPLE_DATE = #{sampleDate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="samplePlaceName != null">
+        SAMPLE_PLACE_NAME = #{samplePlaceName,jdbcType=VARCHAR},
+      </if>
+      <if test="insertTime != null">
+        INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="insertRemark != null">
+        INSERT_REMARK = #{insertRemark,jdbcType=VARCHAR},
+      </if>
+      <if test="inputDate != null">
+        INPUT_DATE = #{inputDate,jdbcType=VARCHAR},
+      </if>
+      <if test="netWeight != null">
+        NET_WEIGHT = #{netWeight,jdbcType=VARCHAR},
+      </if>
+      <if test="isquality != null">
+        ISQUALITY = #{isquality,jdbcType=VARCHAR},
+      </if>
+      <if test="unloadId != null">
+        UNLOAD_ID = #{unloadId,jdbcType=DECIMAL},
+      </if>
+      <if test="deductNumber != null">
+        DEDUCT_NUMBER = #{deductNumber,jdbcType=DECIMAL},
+      </if>
+      <if test="elementValue != null">
+        ELEMENT_VALUE = #{elementValue,jdbcType=VARCHAR},
+      </if>
+    </set>
+    where RESULT_ID = #{resultId,jdbcType=DECIMAL}
+  </update>
+  <select id="selectByPrimaryKey" parameterType="java.lang.Short" resultMap="BaseResultMap">
+    <include refid="select" />
+    where RESULT_ID = #{resultId,jdbcType=DECIMAL}
+  </select>
+  <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
+    <include refid="select" />
+    <include refid="where" />
+  </select>
+  <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
+    <include refid="select" />
+    <include refid="whereLike" />
+  </select>
+  <insert id="batchInsert" parameterType="java.util.List">
+    insert into TMSTRAIN_QUALITY_RESULT
+    (RESULT_ID,
+    RESULT_TOTAL_ID, WZ_INPUT_ID, WZ_ID,
+    "MINE_ID ", CONTRANCT_NO, SUPLIER_ID,
+    MINE_NAME, IS_IMPORT, POUND_NO,
+    CARGO_NO, SATION_NAME, PURCHASE_UNIT_NAME,
+    SHIP_NAME, SAMPLE_DATE, SAMPLE_PLACE_NAME,
+    INSERT_TIME, INSERT_REMARK, INPUT_DATE,
+    NET_WEIGHT, ISQUALITY, UNLOAD_ID,
+    DEDUCT_NUMBER, ELEMENT_VALUE)
+    ( <foreach collection="list" item="item" separator="union all">
+    select
+    #{item.resultId,jdbcType=DECIMAL},
+    #{item.resultTotalId,jdbcType=DECIMAL}, #{item.wzInputId,jdbcType=VARCHAR}, #{item.wzId,jdbcType=VARCHAR},
+    #{item.mineId,jdbcType=VARCHAR}, #{item.contranctNo,jdbcType=VARCHAR}, #{item.suplierId,jdbcType=VARCHAR},
+    #{item.mineName,jdbcType=VARCHAR}, #{item.isImport,jdbcType=VARCHAR}, #{item.poundNo,jdbcType=VARCHAR},
+    #{item.cargoNo,jdbcType=VARCHAR}, #{item.sationName,jdbcType=VARCHAR}, #{item.purchaseUnitName,jdbcType=VARCHAR},
+    #{item.shipName,jdbcType=VARCHAR}, #{item.sampleDate,jdbcType=TIMESTAMP}, #{item.samplePlaceName,jdbcType=VARCHAR},
+    #{item.insertTime,jdbcType=TIMESTAMP}, #{item.insertRemark,jdbcType=VARCHAR}, #{item.inputDate,jdbcType=VARCHAR},
+    #{item.netWeight,jdbcType=VARCHAR}, #{item.isquality,jdbcType=VARCHAR}, #{item.unloadId,jdbcType=DECIMAL},
+    #{item.deductNumber,jdbcType=DECIMAL}, #{item.elementValue,jdbcType=VARCHAR} from dual
+  </foreach> )
+  </insert>
+  <update id="batchUpdate" parameterType="java.util.List">
+    update TMSTRAIN_QUALITY_RESULT
+    set
+    RESULT_ID=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.resultId,jdbcType=DECIMAL}
+    </foreach>
+    ,RESULT_TOTAL_ID=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.resultTotalId,jdbcType=DECIMAL}
+    </foreach>
+    ,WZ_INPUT_ID=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.wzInputId,jdbcType=VARCHAR}
+    </foreach>
+    ,WZ_ID=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.wzId,jdbcType=VARCHAR}
+    </foreach>
+    ,"MINE_ID "=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.mineId,jdbcType=VARCHAR}
+    </foreach>
+    ,CONTRANCT_NO=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.contranctNo,jdbcType=VARCHAR}
+    </foreach>
+    ,SUPLIER_ID=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.suplierId,jdbcType=VARCHAR}
+    </foreach>
+    ,MINE_NAME=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.mineName,jdbcType=VARCHAR}
+    </foreach>
+    ,IS_IMPORT=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.isImport,jdbcType=VARCHAR}
+    </foreach>
+    ,POUND_NO=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.poundNo,jdbcType=VARCHAR}
+    </foreach>
+    ,CARGO_NO=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.cargoNo,jdbcType=VARCHAR}
+    </foreach>
+    ,SATION_NAME=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.sationName,jdbcType=VARCHAR}
+    </foreach>
+    ,PURCHASE_UNIT_NAME=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.purchaseUnitName,jdbcType=VARCHAR}
+    </foreach>
+    ,SHIP_NAME=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.shipName,jdbcType=VARCHAR}
+    </foreach>
+    ,SAMPLE_DATE=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.sampleDate,jdbcType=TIMESTAMP}
+    </foreach>
+    ,SAMPLE_PLACE_NAME=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.samplePlaceName,jdbcType=VARCHAR}
+    </foreach>
+    ,INSERT_TIME=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
+    </foreach>
+    ,INSERT_REMARK=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.insertRemark,jdbcType=VARCHAR}
+    </foreach>
+    ,INPUT_DATE=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.inputDate,jdbcType=VARCHAR}
+    </foreach>
+    ,NET_WEIGHT=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.netWeight,jdbcType=VARCHAR}
+    </foreach>
+    ,ISQUALITY=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.isquality,jdbcType=VARCHAR}
+    </foreach>
+    ,UNLOAD_ID=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.unloadId,jdbcType=DECIMAL}
+    </foreach>
+    ,DEDUCT_NUMBER=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.deductNumber,jdbcType=DECIMAL}
+    </foreach>
+    ,ELEMENT_VALUE=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.elementValue,jdbcType=VARCHAR}
+    </foreach>
+    where RESULT_ID in
+    <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
+      #{item.resultId,jdbcType=DECIMAL}
+    </foreach>
+  </update>
+  <delete id="batchDelete" parameterType="java.util.List">
+    delete from TMSTRAIN_QUALITY_RESULT
+    where RESULT_ID in
+    <foreach close=")" collection="list" item="id" open="(" separator=",">
+      #{id}
+    </foreach>
+  </delete>
+  <!-- 友情提示!!!-->
+  <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
+<!--查询计量过后未质检的数据-->
+  <select id="selectWzInputId" resultType="java.util.Map">
+    select  TTR.TOTAL_RESULT_ID "resultTotalId",
+            TLR.RESULT_WAGON_NO "cargonNo",
+            to_char(TWR.RESULT_GROSS_WEIGHT_TIME,'YYYYMMDDHH24MISS')  "grossWeightTime"
+    from TMSTRAIN_LOADING_RESULT TLR
+           LEFT JOIN TMSTRAIN_TOTAL_RESULT TTR
+                     ON TTR.LOADING_ID = TLR.RESULT_ID
+           left join TMSTRAIN_WEIGHT_RESULT TWR
+                     ON TWR.RESULT_TOTAL_ID  = TTR.TOTAL_RESULT_ID
+           left join TMSTRAIN_QUALITY_RESULT TQR
+                     ON TQR.RESULT_TOTAL_ID = TTR.TOTAL_RESULT_ID
+    WHERE  TQR.ISQUALITY IS  NULL AND TWR.RESULT_GROSS_WEIGHT_TIME IS NOT  NULL
+  </select>
+
+</mapper>

+ 2 - 0
src/main/resources/com/steerinfo/dil/mapper/TmstruckWeightResultMapper.xml

@@ -903,6 +903,8 @@
         where APO.PURCHASE_ORDER_NO = #{arrivalBillNo}
     </select>
 
+
+
     <update id="updateOmsTruckPlanId" parameterType="map">
         update OMSTRUCK_ORDER
         set ORDER_PLAN_ID = #{purchaseOrderId}