Authored by caoyan

Merge branch 'dev_鉴定优化_20190611' into test6.9.6

# Conflicts:
#	dal/src/main/resources/META-INF/mybatis/BuyerOrderMapper.xml
@@ -130,4 +130,6 @@ public class BuyerOrderReq extends PageRequestBO{ @@ -130,4 +130,6 @@ public class BuyerOrderReq extends PageRequestBO{
130 private Integer maxCurrentSecondMinusHours; 130 private Integer maxCurrentSecondMinusHours;
131 131
132 private String phoneUid; 132 private String phoneUid;
  133 +
  134 + private String sortRule;
133 } 135 }
@@ -246,7 +246,12 @@ @@ -246,7 +246,12 @@
246 </if> 246 </if>
247 where 1=1 247 where 1=1
248 <include refid="Query_Order_Sql" /> 248 <include refid="Query_Order_Sql" />
249 - order by a.create_time desc 249 + <if test="buyerOrderReq.sortRule!=null and buyerOrderReq.sortRule!=''">
  250 + order by a.create_time #{buyerOrderReq.sortRule}
  251 + </if>
  252 + <if test="buyerOrderReq.sortRule==null or buyerOrderReq.sortRule=''">
  253 + order by a.create_time desc
  254 + </if>
250 <if test="buyerOrderReq.start!=null and buyerOrderReq.size != null"> 255 <if test="buyerOrderReq.start!=null and buyerOrderReq.size != null">
251 limit #{buyerOrderReq.start},#{buyerOrderReq.size} 256 limit #{buyerOrderReq.start},#{buyerOrderReq.size}
252 </if> 257 </if>
@@ -22,6 +22,7 @@ @@ -22,6 +22,7 @@
22 <select id="selectByWaybillCode" resultMap = "BaseResultMap"> 22 <select id="selectByWaybillCode" resultMap = "BaseResultMap">
23 select <include refid="Base_Column_List"></include> 23 select <include refid="Base_Column_List"></include>
24 from express_screenshots where waybill_code= #{waybillCode} 24 from express_screenshots where waybill_code= #{waybillCode}
  25 + order by create_time asc
25 </select> 26 </select>
26 27
27 </mapper> 28 </mapper>
  1 +package com.yoho.ufo.order.response;
  2 +
  3 +public class ExpressScreenshotsPicRsp {
  4 + private String url;
  5 +
  6 + private String createTimeStr;
  7 +
  8 + private String createUserName;
  9 +
  10 + public String getUrl() {
  11 + return url;
  12 + }
  13 +
  14 + public void setUrl(String url) {
  15 + this.url = url;
  16 + }
  17 +
  18 + public String getCreateTimeStr() {
  19 + return createTimeStr;
  20 + }
  21 +
  22 + public void setCreateTimeStr(String createTimeStr) {
  23 + this.createTimeStr = createTimeStr;
  24 + }
  25 +
  26 + public String getCreateUserName() {
  27 + return createUserName;
  28 + }
  29 +
  30 + public void setCreateUserName(String createUserName) {
  31 + this.createUserName = createUserName;
  32 + }
  33 +
  34 +}
1 package com.yoho.ufo.order.response; 1 package com.yoho.ufo.order.response;
2 2
  3 +import java.util.List;
  4 +
3 public class ExpressScreenshotsRsp { 5 public class ExpressScreenshotsRsp {
4 private String waybillCode; 6 private String waybillCode;
5 7
6 - private String url;  
7 -  
8 - private String createTimeStr; 8 + private List<ExpressScreenshotsPicRsp> picList;
9 9
10 - private String createUserName; 10 + public List<ExpressScreenshotsPicRsp> getPicList() {
  11 + return picList;
  12 + }
  13 +
  14 + public void setPicList(List<ExpressScreenshotsPicRsp> picList) {
  15 + this.picList = picList;
  16 + }
11 17
12 public String getWaybillCode() { 18 public String getWaybillCode() {
13 return waybillCode; 19 return waybillCode;
@@ -17,28 +23,4 @@ public class ExpressScreenshotsRsp { @@ -17,28 +23,4 @@ public class ExpressScreenshotsRsp {
17 this.waybillCode = waybillCode; 23 this.waybillCode = waybillCode;
18 } 24 }
19 25
20 - public String getUrl() {  
21 - return url;  
22 - }  
23 -  
24 - public void setUrl(String url) {  
25 - this.url = url;  
26 - }  
27 -  
28 - public String getCreateTimeStr() {  
29 - return createTimeStr;  
30 - }  
31 -  
32 - public void setCreateTimeStr(String createTimeStr) {  
33 - this.createTimeStr = createTimeStr;  
34 - }  
35 -  
36 - public String getCreateUserName() {  
37 - return createUserName;  
38 - }  
39 -  
40 - public void setCreateUserName(String createUserName) {  
41 - this.createUserName = createUserName;  
42 - }  
43 -  
44 } 26 }
@@ -2,7 +2,6 @@ package com.yoho.ufo.order.service; @@ -2,7 +2,6 @@ package com.yoho.ufo.order.service;
2 2
3 import java.util.List; 3 import java.util.List;
4 4
5 -import com.yoho.order.model.ExpressScreenshots;  
6 import com.yoho.ufo.order.response.ExpressScreenshotsRsp; 5 import com.yoho.ufo.order.response.ExpressScreenshotsRsp;
7 6
8 public interface IExpressScreenshotsService { 7 public interface IExpressScreenshotsService {
@@ -688,7 +688,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { @@ -688,7 +688,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
688 } 688 }
689 689
690 if(StringUtils.isNotEmpty(req.getQueryStr())) { 690 if(StringUtils.isNotEmpty(req.getQueryStr())) {
691 - return queryOrderListByStatusAndQueryStr(req.getQueryStr(), req.getDepotNo(), checkStatusList, platformExpressInfoFlag); 691 + return queryOrderListByStatusAndQueryStr(req.getQueryStr(), req.getDepotNo(), checkStatusList, platformExpressInfoFlag, req.getSortRule());
692 } 692 }
693 693
694 req.setStatus(null); 694 req.setStatus(null);
@@ -720,7 +720,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { @@ -720,7 +720,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
720 } 720 }
721 721
722 private PageResponseBO<BuyerOrderResp> queryOrderListByStatusAndQueryStr(String queryStr, Integer depotNo, 722 private PageResponseBO<BuyerOrderResp> queryOrderListByStatusAndQueryStr(String queryStr, Integer depotNo,
723 - List<Byte> checkStatusList, String platformExpressInfoFlag){ 723 + List<Byte> checkStatusList, String platformExpressInfoFlag, String sortRule){
724 //先按订单号来查 724 //先按订单号来查
725 BuyerOrderReq req = new BuyerOrderReq(); 725 BuyerOrderReq req = new BuyerOrderReq();
726 req.setOrderCode(queryStr); 726 req.setOrderCode(queryStr);
@@ -728,6 +728,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { @@ -728,6 +728,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
728 req.setStatusList(checkStatusList); 728 req.setStatusList(checkStatusList);
729 req.setPlatformExpressInfoFlag(platformExpressInfoFlag); 729 req.setPlatformExpressInfoFlag(platformExpressInfoFlag);
730 req.setSize(100); 730 req.setSize(100);
  731 + req.setSortRule(sortRule);
731 List<BuyerOrder> orderList = buyerOrderMapper.selectByCondition(req); 732 List<BuyerOrder> orderList = buyerOrderMapper.selectByCondition(req);
732 if(CollectionUtils.isEmpty(orderList)){//再按卖家运单号来查 733 if(CollectionUtils.isEmpty(orderList)){//再按卖家运单号来查
733 orderList = Lists.newArrayList(); 734 orderList = Lists.newArrayList();
@@ -737,6 +738,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { @@ -737,6 +738,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
737 req.setStatusList(checkStatusList); 738 req.setStatusList(checkStatusList);
738 req.setPlatformExpressInfoFlag(platformExpressInfoFlag); 739 req.setPlatformExpressInfoFlag(platformExpressInfoFlag);
739 req.setSize(100); 740 req.setSize(100);
  741 + req.setSortRule(sortRule);
740 List<BuyerOrder> list = buyerOrderMapper.selectByCondition(req); 742 List<BuyerOrder> list = buyerOrderMapper.selectByCondition(req);
741 if(CollectionUtils.isNotEmpty(list)){ 743 if(CollectionUtils.isNotEmpty(list)){
742 orderList.addAll(list); 744 orderList.addAll(list);
@@ -2,6 +2,7 @@ package com.yoho.ufo.order.service.impl; @@ -2,6 +2,7 @@ package com.yoho.ufo.order.service.impl;
2 2
3 import java.util.List; 3 import java.util.List;
4 4
  5 +import org.apache.commons.collections.CollectionUtils;
5 import org.elasticsearch.common.collect.Lists; 6 import org.elasticsearch.common.collect.Lists;
6 import org.slf4j.Logger; 7 import org.slf4j.Logger;
7 import org.slf4j.LoggerFactory; 8 import org.slf4j.LoggerFactory;
@@ -11,9 +12,9 @@ import org.springframework.stereotype.Service; @@ -11,9 +12,9 @@ import org.springframework.stereotype.Service;
11 import com.yoho.core.common.utils.DateUtil; 12 import com.yoho.core.common.utils.DateUtil;
12 import com.yoho.order.dal.ExpressScreenshotsMapper; 13 import com.yoho.order.dal.ExpressScreenshotsMapper;
13 import com.yoho.order.model.ExpressScreenshots; 14 import com.yoho.order.model.ExpressScreenshots;
  15 +import com.yoho.ufo.order.response.ExpressScreenshotsPicRsp;
14 import com.yoho.ufo.order.response.ExpressScreenshotsRsp; 16 import com.yoho.ufo.order.response.ExpressScreenshotsRsp;
15 import com.yoho.ufo.order.service.IExpressScreenshotsService; 17 import com.yoho.ufo.order.service.IExpressScreenshotsService;
16 -import com.yoho.ufo.service.impl.UserHelper;  
17 18
18 /** 19 /**
19 * @author craig.qin 20 * @author craig.qin
@@ -44,17 +45,24 @@ public class ExpressScreenshotsServiceImpl implements IExpressScreenshotsService @@ -44,17 +45,24 @@ public class ExpressScreenshotsServiceImpl implements IExpressScreenshotsService
44 @Override 45 @Override
45 public List<ExpressScreenshotsRsp> queryListByWaybillCode(String waybillCode) { 46 public List<ExpressScreenshotsRsp> queryListByWaybillCode(String waybillCode) {
46 List<ExpressScreenshots> list = expressScreenshotsMapper.selectByWaybillCode(waybillCode); 47 List<ExpressScreenshots> list = expressScreenshotsMapper.selectByWaybillCode(waybillCode);
47 - List<ExpressScreenshotsRsp> rspList = Lists.newArrayList(); 48 + List<ExpressScreenshotsRsp> result = Lists.newArrayList();
  49 + if(CollectionUtils.isEmpty(list)) {
  50 + return null;
  51 + }
  52 + List<ExpressScreenshotsPicRsp> picList = Lists.newArrayList();
48 for(ExpressScreenshots item : list) { 53 for(ExpressScreenshots item : list) {
49 - ExpressScreenshotsRsp rsp = new ExpressScreenshotsRsp();  
50 - rsp.setWaybillCode(item.getWaybillCode());  
51 - rsp.setUrl(item.getUrl());  
52 - rsp.setCreateTimeStr(DateUtil.getDateStrBySecond(item.getCreateTime(), "yyyy-MM-dd HH:mm:ss"));  
53 - rsp.setCreateUserName(item.getCreateUserName());  
54 - rspList.add(rsp); 54 + ExpressScreenshotsPicRsp picRsp = new ExpressScreenshotsPicRsp();
  55 + picRsp.setUrl(item.getUrl());
  56 + picRsp.setCreateTimeStr(DateUtil.getDateStrBySecond(item.getCreateTime(), "yyyy-MM-dd HH:mm:ss"));
  57 + picRsp.setCreateUserName(item.getCreateUserName());
  58 + picList.add(picRsp);
55 } 59 }
56 60
57 - return rspList; 61 + ExpressScreenshotsRsp rsp = new ExpressScreenshotsRsp();
  62 + rsp.setWaybillCode(waybillCode);
  63 + rsp.setPicList(picList);
  64 +
  65 + return Lists.newArrayList(rsp);
58 } 66 }
59 67
60 68
  1 +<!DOCTYPE html>
  2 +<html>
  3 +<head>
  4 + <meta charset="UTF-8"/>
  5 + <title>Yoho!Buy运营平台</title>
  6 + <script src="/ufoPlatform/js/include.js?version=6.9.3"></script>
  7 +</head>
  8 +<body class="easyui-layout" fit="true">
  9 +<div region="north" style="height:230px;">
  10 + <script>
  11 + document.write(addHead('订单管理', '扫描快递单截屏'));
  12 + </script>
  13 + <div style="margin-left: 10px;margin-top: 30px">
  14 + <div style="border:1px solid #ddd;border-radius:5px 5px 5px 5px;">
  15 + <div style="margin-left: 10px;margin-top: 20px;margin-bottom: 20px">
  16 + <input id="waybillCode" name="waybillCode" />
  17 + <a id="searchBtn" class="btn-info">筛选</a>
  18 + <a id="clearBtn" class="btn-success">清除筛选</a>
  19 + </div>
  20 + </div>
  21 + </div>
  22 +</div>
  23 +
  24 +<div id="screenshotsDiv" region="center">
  25 + <table id="screenshotsTable">
  26 + </table>
  27 +</div>
  28 +<div style="display: none">
  29 + <div id="dlg" class="datagrid-toolbar" style="padding:5px;">
  30 + <img id="simg" src="" alt="" width="800">
  31 + </div>
  32 +</div>
  33 +<script>
  34 +$(function() {
  35 + $("#waybillCode").textbox({
  36 + prompt: "卖家物流单号"
  37 + });
  38 +
  39 + $("#searchBtn").linkbutton({
  40 + iconCls : "icon-search",
  41 + onClick: function () {
  42 + var param = {};
  43 + param.waybillCode = $('#waybillCode').val();
  44 + $("#screenshotsTable").myDatagrid("load", param);
  45 + }
  46 + });
  47 +
  48 + // 清除筛选
  49 + $("#clearBtn").linkbutton({
  50 + iconCls : "icon-search",
  51 + onClick: function () {
  52 + $('#waybillCode').textbox('setValue', '');
  53 + }
  54 + });
  55 +
  56 + loadMainList();
  57 +
  58 + //放大图片预览
  59 + $(".pimg").click(function(){
  60 + alert("****");
  61 + var _this = $(this);//将当前的pimg元素作为_this传入函数
  62 + var src = _this.attr("src");
  63 + alert(src);
  64 + //var index = src.indexOf("?");
  65 + //src = src.substring(0, index);
  66 + //window.open(src);
  67 + download(src);
  68 + });
  69 +
  70 +});
  71 +
  72 +function download(url) {
  73 + $('#dlg').dialog({
  74 + title: '预览',
  75 + width: 800,
  76 + height: 600,
  77 + resizable: false,
  78 + closed: false,
  79 + cache: false,
  80 + modal: true
  81 + });
  82 + $("#simg").attr("src", url);
  83 +}
  84 +
  85 +function loadMainList(){
  86 + $("#screenshotsTable").myDatagrid({
  87 + fit: true,
  88 + fitColumns: true,
  89 + striped: true,
  90 + url: contextPath + "/expressScreenshots/queryByWaybillCode",
  91 + method: 'POST',
  92 + loadFilter: function (data) {
  93 + var temp = defaultLoadFilter(data);
  94 + temp=null==temp?[]:temp;
  95 + temp.rows = temp.list;
  96 + return temp;
  97 + },
  98 + columns: [[{
  99 + title: "卖家物流单号",
  100 + field: "waybillCode",
  101 + width: 20,
  102 + align: "center"
  103 + }, {
  104 + title: "截屏",
  105 + field: "picList",
  106 + width: 80,
  107 + align: "center",
  108 + formatter: function (value, rowData, rowIndex) {
  109 + var imageStr = "<table><tbody><tr>";
  110 + if(value != null){
  111 + for (var i = 0 ;i < value.length; i++){
  112 + imageStr += "<td><img height='200px;' width='150px;' class='pimg' src='"+value[i].url+"'/>";
  113 + //imageStr += "<br>创建时间:"+value[i].createTimeStr+"<br>操作人:"+value[i].createUserName;
  114 + imageStr += "</td>";
  115 + if((i+1) % 5 == 0 && 0 != i && i != (value.length - 1)) {
  116 + imageStr += "</tr><tr>";
  117 + }
  118 + }
  119 + }
  120 +
  121 + imageStr = imageStr + "</tr></tbody></table>";
  122 +
  123 + return imageStr;
  124 + }
  125 + }]],
  126 + cache: false,
  127 + pagination: true,
  128 + pageSize: 10,
  129 + idField: "id",
  130 + singleSelect: true,
  131 + onLoadSuccess: function (data) {
  132 + if (data.total == 0) { 
  133 + $(this).datagrid('appendRow', { waybillCode: '<div style="text-align:center;color:red">无数据!</div>' }).datagrid('mergeCells', { index: 0, field: 'waybillCode', colspan: 2 })         
  134 +  }
  135 + }
  136 + });
  137 +}
  138 +
  139 +</script>
  140 +</body>
  141 +</html>