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{
private Integer maxCurrentSecondMinusHours;
private String phoneUid;
private String sortRule;
}
... ...
... ... @@ -246,7 +246,12 @@
</if>
where 1=1
<include refid="Query_Order_Sql" />
order by a.create_time desc
<if test="buyerOrderReq.sortRule!=null and buyerOrderReq.sortRule!=''">
order by a.create_time #{buyerOrderReq.sortRule}
</if>
<if test="buyerOrderReq.sortRule==null or buyerOrderReq.sortRule=''">
order by a.create_time desc
</if>
<if test="buyerOrderReq.start!=null and buyerOrderReq.size != null">
limit #{buyerOrderReq.start},#{buyerOrderReq.size}
</if>
... ...
... ... @@ -22,6 +22,7 @@
<select id="selectByWaybillCode" resultMap = "BaseResultMap">
select <include refid="Base_Column_List"></include>
from express_screenshots where waybill_code= #{waybillCode}
order by create_time asc
</select>
</mapper>
\ No newline at end of file
... ...
package com.yoho.ufo.order.response;
public class ExpressScreenshotsPicRsp {
private String url;
private String createTimeStr;
private String createUserName;
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getCreateTimeStr() {
return createTimeStr;
}
public void setCreateTimeStr(String createTimeStr) {
this.createTimeStr = createTimeStr;
}
public String getCreateUserName() {
return createUserName;
}
public void setCreateUserName(String createUserName) {
this.createUserName = createUserName;
}
}
... ...
package com.yoho.ufo.order.response;
import java.util.List;
public class ExpressScreenshotsRsp {
private String waybillCode;
private String url;
private String createTimeStr;
private List<ExpressScreenshotsPicRsp> picList;
private String createUserName;
public List<ExpressScreenshotsPicRsp> getPicList() {
return picList;
}
public void setPicList(List<ExpressScreenshotsPicRsp> picList) {
this.picList = picList;
}
public String getWaybillCode() {
return waybillCode;
... ... @@ -17,28 +23,4 @@ public class ExpressScreenshotsRsp {
this.waybillCode = waybillCode;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getCreateTimeStr() {
return createTimeStr;
}
public void setCreateTimeStr(String createTimeStr) {
this.createTimeStr = createTimeStr;
}
public String getCreateUserName() {
return createUserName;
}
public void setCreateUserName(String createUserName) {
this.createUserName = createUserName;
}
}
... ...
... ... @@ -2,7 +2,6 @@ package com.yoho.ufo.order.service;
import java.util.List;
import com.yoho.order.model.ExpressScreenshots;
import com.yoho.ufo.order.response.ExpressScreenshotsRsp;
public interface IExpressScreenshotsService {
... ...
... ... @@ -688,7 +688,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
}
if(StringUtils.isNotEmpty(req.getQueryStr())) {
return queryOrderListByStatusAndQueryStr(req.getQueryStr(), req.getDepotNo(), checkStatusList, platformExpressInfoFlag);
return queryOrderListByStatusAndQueryStr(req.getQueryStr(), req.getDepotNo(), checkStatusList, platformExpressInfoFlag, req.getSortRule());
}
req.setStatus(null);
... ... @@ -720,7 +720,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
}
private PageResponseBO<BuyerOrderResp> queryOrderListByStatusAndQueryStr(String queryStr, Integer depotNo,
List<Byte> checkStatusList, String platformExpressInfoFlag){
List<Byte> checkStatusList, String platformExpressInfoFlag, String sortRule){
//先按订单号来查
BuyerOrderReq req = new BuyerOrderReq();
req.setOrderCode(queryStr);
... ... @@ -728,6 +728,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
req.setStatusList(checkStatusList);
req.setPlatformExpressInfoFlag(platformExpressInfoFlag);
req.setSize(100);
req.setSortRule(sortRule);
List<BuyerOrder> orderList = buyerOrderMapper.selectByCondition(req);
if(CollectionUtils.isEmpty(orderList)){//再按卖家运单号来查
orderList = Lists.newArrayList();
... ... @@ -737,6 +738,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
req.setStatusList(checkStatusList);
req.setPlatformExpressInfoFlag(platformExpressInfoFlag);
req.setSize(100);
req.setSortRule(sortRule);
List<BuyerOrder> list = buyerOrderMapper.selectByCondition(req);
if(CollectionUtils.isNotEmpty(list)){
orderList.addAll(list);
... ...
... ... @@ -2,6 +2,7 @@ package com.yoho.ufo.order.service.impl;
import java.util.List;
import org.apache.commons.collections.CollectionUtils;
import org.elasticsearch.common.collect.Lists;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
... ... @@ -11,9 +12,9 @@ import org.springframework.stereotype.Service;
import com.yoho.core.common.utils.DateUtil;
import com.yoho.order.dal.ExpressScreenshotsMapper;
import com.yoho.order.model.ExpressScreenshots;
import com.yoho.ufo.order.response.ExpressScreenshotsPicRsp;
import com.yoho.ufo.order.response.ExpressScreenshotsRsp;
import com.yoho.ufo.order.service.IExpressScreenshotsService;
import com.yoho.ufo.service.impl.UserHelper;
/**
* @author craig.qin
... ... @@ -44,17 +45,24 @@ public class ExpressScreenshotsServiceImpl implements IExpressScreenshotsService
@Override
public List<ExpressScreenshotsRsp> queryListByWaybillCode(String waybillCode) {
List<ExpressScreenshots> list = expressScreenshotsMapper.selectByWaybillCode(waybillCode);
List<ExpressScreenshotsRsp> rspList = Lists.newArrayList();
List<ExpressScreenshotsRsp> result = Lists.newArrayList();
if(CollectionUtils.isEmpty(list)) {
return null;
}
List<ExpressScreenshotsPicRsp> picList = Lists.newArrayList();
for(ExpressScreenshots item : list) {
ExpressScreenshotsRsp rsp = new ExpressScreenshotsRsp();
rsp.setWaybillCode(item.getWaybillCode());
rsp.setUrl(item.getUrl());
rsp.setCreateTimeStr(DateUtil.getDateStrBySecond(item.getCreateTime(), "yyyy-MM-dd HH:mm:ss"));
rsp.setCreateUserName(item.getCreateUserName());
rspList.add(rsp);
ExpressScreenshotsPicRsp picRsp = new ExpressScreenshotsPicRsp();
picRsp.setUrl(item.getUrl());
picRsp.setCreateTimeStr(DateUtil.getDateStrBySecond(item.getCreateTime(), "yyyy-MM-dd HH:mm:ss"));
picRsp.setCreateUserName(item.getCreateUserName());
picList.add(picRsp);
}
return rspList;
ExpressScreenshotsRsp rsp = new ExpressScreenshotsRsp();
rsp.setWaybillCode(waybillCode);
rsp.setPicList(picList);
return Lists.newArrayList(rsp);
}
... ...
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8"/>
<title>Yoho!Buy运营平台</title>
<script src="/ufoPlatform/js/include.js?version=6.9.3"></script>
</head>
<body class="easyui-layout" fit="true">
<div region="north" style="height:230px;">
<script>
document.write(addHead('订单管理', '扫描快递单截屏'));
</script>
<div style="margin-left: 10px;margin-top: 30px">
<div style="border:1px solid #ddd;border-radius:5px 5px 5px 5px;">
<div style="margin-left: 10px;margin-top: 20px;margin-bottom: 20px">
<input id="waybillCode" name="waybillCode" />
<a id="searchBtn" class="btn-info">筛选</a>
<a id="clearBtn" class="btn-success">清除筛选</a>
</div>
</div>
</div>
</div>
<div id="screenshotsDiv" region="center">
<table id="screenshotsTable">
</table>
</div>
<div style="display: none">
<div id="dlg" class="datagrid-toolbar" style="padding:5px;">
<img id="simg" src="" alt="" width="800">
</div>
</div>
<script>
$(function() {
$("#waybillCode").textbox({
prompt: "卖家物流单号"
});
$("#searchBtn").linkbutton({
iconCls : "icon-search",
onClick: function () {
var param = {};
param.waybillCode = $('#waybillCode').val();
$("#screenshotsTable").myDatagrid("load", param);
}
});
// 清除筛选
$("#clearBtn").linkbutton({
iconCls : "icon-search",
onClick: function () {
$('#waybillCode').textbox('setValue', '');
}
});
loadMainList();
//放大图片预览
$(".pimg").click(function(){
alert("****");
var _this = $(this);//将当前的pimg元素作为_this传入函数
var src = _this.attr("src");
alert(src);
//var index = src.indexOf("?");
//src = src.substring(0, index);
//window.open(src);
download(src);
});
});
function download(url) {
$('#dlg').dialog({
title: '预览',
width: 800,
height: 600,
resizable: false,
closed: false,
cache: false,
modal: true
});
$("#simg").attr("src", url);
}
function loadMainList(){
$("#screenshotsTable").myDatagrid({
fit: true,
fitColumns: true,
striped: true,
url: contextPath + "/expressScreenshots/queryByWaybillCode",
method: 'POST',
loadFilter: function (data) {
var temp = defaultLoadFilter(data);
temp=null==temp?[]:temp;
temp.rows = temp.list;
return temp;
},
columns: [[{
title: "卖家物流单号",
field: "waybillCode",
width: 20,
align: "center"
}, {
title: "截屏",
field: "picList",
width: 80,
align: "center",
formatter: function (value, rowData, rowIndex) {
var imageStr = "<table><tbody><tr>";
if(value != null){
for (var i = 0 ;i < value.length; i++){
imageStr += "<td><img height='200px;' width='150px;' class='pimg' src='"+value[i].url+"'/>";
//imageStr += "<br>创建时间:"+value[i].createTimeStr+"<br>操作人:"+value[i].createUserName;
imageStr += "</td>";
if((i+1) % 5 == 0 && 0 != i && i != (value.length - 1)) {
imageStr += "</tr><tr>";
}
}
}
imageStr = imageStr + "</tr></tbody></table>";
return imageStr;
}
}]],
cache: false,
pagination: true,
pageSize: 10,
idField: "id",
singleSelect: true,
onLoadSuccess: function (data) {
if (data.total == 0) { 
$(this).datagrid('appendRow', { waybillCode: '<div style="text-align:center;color:red">无数据!</div>' }).datagrid('mergeCells', { index: 0, field: 'waybillCode', colspan: 2 })         
 }
}
});
}
</script>
</body>
</html>
\ No newline at end of file
... ...