Authored by yangchangjiang

Merge remote-tracking branch 'origin/test6.9.16' into test6.9.16

... ... @@ -49,4 +49,5 @@ public interface AppraiseOrderMapper {
*/
List<AppraiseOrder> selectListByCondition(@Param("appraiseServiceReq") AppraiseServiceReq req);
AppraiseOrder selectParentBySubOrderCode(@Param("orderCode") String orderCode);
}
... ...
... ... @@ -14,4 +14,6 @@ public interface ExpressInfoMapper {
List<ExpressInfo> selectByOrderCodeAndType(@Param("orderCode") String orderCode, @Param("expressTypeList") List<Integer> expressTypeList);
List<ExpressInfo> selectExpressInfoListByWaybillCodeAndLogisticsType(@Param("waybillCode") String waybillCode, @Param("logisticsType") Integer logisticsType);
List<ExpressInfo> selectExpressInfoListByWaybillCode(@Param("waybillCode") String waybillCode);
}
... ...
... ... @@ -68,4 +68,7 @@ public interface StorageDepositMapper {
List<StorageDeposit> selectDepositList(StorageDepositReq req);
StorageDeposit selectByOrderCodeIgnoreDelStatus(@Param("orderCode") String orderCode);
List<StorageDeposit> selectDepositedByOrderCode(@Param("orderCodes") List<Long> orderCodes);
}
\ No newline at end of file
... ...
... ... @@ -185,6 +185,11 @@
where <include refid="list_condition"/> order by create_time desc limit #{start}, #{size}
</select>
<select id="selectParentBySubOrderCode" resultMap="BaseResultMap">
select * from appraise_order
where order_code = (select parent_order_code from appraise_order where attributes = 7 and order_code = #{orderCode} limit 1)
</select>
<sql id="list_condition" >
parent_order_code is null and attributes = 7
<if test="statusList != null and statusList.size()>0">
... ...
... ... @@ -40,5 +40,12 @@
where waybill_code = #{waybillCode} and logistics_type = #{logisticsType}
ORDER BY create_time
</select>
<select id="selectExpressInfoListByWaybillCode" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List" />
FROM express_info
where waybill_code = #{waybillCode}
ORDER BY create_time
</select>
</mapper>
\ No newline at end of file
... ...
... ... @@ -253,4 +253,14 @@
from storage_deposit
where order_code=#{orderCode} AND deposit_type = 0 limit 1
</select>
<select id="selectDepositedByOrderCode" resultMap="BaseResultMap">
select order_code, deposit_code
from storage_deposit
where order_code in
<foreach collection="orderCodes" item="orderCode" open="(" close=")" separator=",">
#{orderCode}
</foreach>
and status &gt; 0
</select>
</mapper>
\ No newline at end of file
... ...
... ... @@ -8,6 +8,7 @@ import com.yoho.ufo.exception.PlatformException;
import com.yoho.ufo.order.service.IAppraiseOrderService;
import com.yoho.ufo.service.model.ApiResponse;
import com.yoho.ufo.service.model.PageResponseBO;
import com.yohobuy.ufo.model.order.req.AppraiseOrderWaybillUpdateReq;
import com.yohobuy.ufo.model.order.req.AppraiseServiceReq;
import com.yohobuy.ufo.model.order.resp.AppraiseServiceRsp;
import com.yohobuy.ufo.model.order.resp.BuyerOrderResp;
... ... @@ -113,4 +114,17 @@ public class AppraiseOrderController {
return new ApiResponse.ApiResponseBuilder().code(result == null ? 500 : 200).data(result).message("查询完成").build();
}
@RequestMapping(value = "/updateSellerWaybillCode")
public ApiResponse updateSellerWaybillCode(AppraiseOrderWaybillUpdateReq req) {
LOGGER.info("updateSellerWaybillCode in. req is {}", req);
JSONObject result = null;
try {
result = appraiseOrderService.updateSellerWaybillCode(req);
return new ApiResponse.ApiResponseBuilder().code(result.getInteger("code")).data(result).message(result.getString("message")).build();
} catch (Exception e) {
LOGGER.error("updateSellerWaybillCode error ", e);
return new ApiResponse.ApiResponseBuilder().code(500).data(result).message(e.getMessage()).build();
}
}
}
... ...
... ... @@ -5,6 +5,7 @@ import com.yoho.order.model.AppraiseOrderReq;
import com.yoho.order.model.AppraiseOrderResp;
import com.yoho.ufo.exception.PlatformException;
import com.yoho.ufo.service.model.PageResponseBO;
import com.yohobuy.ufo.model.order.req.AppraiseOrderWaybillUpdateReq;
import com.yohobuy.ufo.model.order.req.AppraiseServiceReq;
import com.yohobuy.ufo.model.order.resp.AppraiseServiceRsp;
... ... @@ -35,4 +36,6 @@ public interface IAppraiseOrderService {
JSONObject sendBackGoodsToSeller(AppraiseOrderReq req);
JSONObject getBackAddressInfo(AppraiseOrderReq req);
JSONObject updateSellerWaybillCode(AppraiseOrderWaybillUpdateReq req);
}
... ...
... ... @@ -3,19 +3,17 @@ package com.yoho.ufo.order.service.impl;
import java.math.BigDecimal;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.*;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import java.util.function.Function;
import java.util.stream.Collectors;
import com.yoho.order.dal.*;
import com.yoho.order.model.*;
import com.yoho.ufo.util.CollectionUtil;
import com.yohobuy.ufo.model.order.req.AppraiseOrderWaybillUpdateReq;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.elasticsearch.common.collect.Lists;
... ... @@ -31,29 +29,6 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.yoho.core.rest.client.ServiceCaller;
import com.yoho.error.exception.ServiceException;
import com.yoho.order.dal.AbnormalOrderMapper;
import com.yoho.order.dal.AppraiseOrderGoodsMapper;
import com.yoho.order.dal.AppraiseOrderMapper;
import com.yoho.order.dal.AppraiseOrderMetaMapper;
import com.yoho.order.dal.AppraiseOrderStorageMapper;
import com.yoho.order.dal.ExpressRecordMapper;
import com.yoho.order.dal.OrderOperateRecordMapper;
import com.yoho.order.dal.OrdersPayRefundMapper;
import com.yoho.order.dal.StorageDepositMapper;
import com.yoho.order.dal.StoredSellerMapper;
import com.yoho.order.model.AbnormalOrder;
import com.yoho.order.model.AppraiseOrder;
import com.yoho.order.model.AppraiseOrderGoods;
import com.yoho.order.model.AppraiseOrderMeta;
import com.yoho.order.model.AppraiseOrderReq;
import com.yoho.order.model.AppraiseOrderResp;
import com.yoho.order.model.AppraiseOrderStorage;
import com.yoho.order.model.ExpressCompany;
import com.yoho.order.model.ExpressRecord;
import com.yoho.order.model.OrderOperateRecord;
import com.yoho.order.model.OrdersPayRefund;
import com.yoho.order.model.StorageDeposit;
import com.yoho.order.model.StoredSeller;
import com.yoho.service.model.order.request.OrderRequest;
import com.yoho.ufo.exception.PlatformException;
import com.yoho.ufo.order.constant.Constant;
... ... @@ -123,7 +98,10 @@ public class AppraiseOrderServiceImpl implements IAppraiseOrderService {
@Autowired
private AbnormalOrderMapper abnormalOrderMapper;
@Autowired
private ExpressInfoMapper expressInfoMapper;
@Autowired
private UserProxyService userProxyService;
... ... @@ -253,10 +231,26 @@ public class AppraiseOrderServiceImpl implements IAppraiseOrderService {
req.setStatusList(checkStatusList);
req.setBuyStartTime(parseTime(req.getBuyStartTimeStr()));
req.setBuyEndTime(parseTime(req.getBuyEndTimeStr()));
PageResponseBO<AppraiseOrderResp> resp = new PageResponseBO<>();
if(StringUtils.isNotBlank(req.getWaybillCode())) {
List<ExpressInfo> expressInfo = expressInfoMapper.selectExpressInfoListByWaybillCode(req.getWaybillCode());
if(expressInfo.isEmpty()) {
resp.setList(Lists.newArrayList());
return resp;
}
req.setOrderCode(expressInfo.get(0).getOrderCode().toString());
}
int count = appraiseOrderMapper.selectParentListCount(req);
AppraiseOrder bySub = null;
if (count == 0 && StringUtils.isNotBlank(req.getOrderCode())) {
bySub = appraiseOrderMapper.selectParentBySubOrderCode(req.getOrderCode());
if (bySub != null) {
count = 1;
}
}
PageResponseBO<AppraiseOrderResp> resp = new PageResponseBO<>();
resp.setTotal(count);
if (count == 0) {
resp.setList(Lists.newArrayList());
... ... @@ -264,7 +258,7 @@ public class AppraiseOrderServiceImpl implements IAppraiseOrderService {
}
req.setStart((req.getPage() - 1) * req.getSize());
List<AppraiseOrder> orderList = appraiseOrderMapper.selectParentList(req);
List<AppraiseOrder> orderList = (bySub == null) ? appraiseOrderMapper.selectParentList(req) : Arrays.asList(bySub);
List<AppraiseOrderResp> respList = exchangeBo(orderList);
resp.setPage(req.getPage());
... ... @@ -368,6 +362,14 @@ public class AppraiseOrderServiceImpl implements IAppraiseOrderService {
Map<Long, AppraiseOrderMeta> feeMap = feeList.stream().collect(Collectors.toMap(AppraiseOrderMeta::getOrderCode, Function.identity()));
Map<String, OrdersPayRefund> refundMap = refundList.stream().collect(Collectors.toMap(OrdersPayRefund::getRefundCode, Function.identity()));
List<AppraiseOrderResp> result = Lists.newArrayList();
List<Long> orderCodeList = orderList.stream().filter(order -> order.getStatus() == AppraiseOrderStatus.JUDGE_PASS_WAIT_WAREHOUSE.getCode()).map(order -> new Long(order.getOrderCode())).collect(Collectors.toList());
Map<String, String> orderCodeMap = new HashMap<>();
if(!orderCodeList.isEmpty()) {
List<StorageDeposit> deposited = storageDepositMapper.selectDepositedByOrderCode(orderCodeList);
if(!deposited.isEmpty()) {
orderCodeMap = CollectionUtil.extractMap(deposited, o -> o.getOrderCode().toString(), StorageDeposit::getDepositCode);
}
}
for(AppraiseOrder order : orderList) {
AppraiseOrderResp r = new AppraiseOrderResp();
BeanUtils.copyProperties(order, r);
... ... @@ -398,7 +400,12 @@ public class AppraiseOrderServiceImpl implements IAppraiseOrderService {
r.setUsedAmount(order.getAmount().toString());
}
r.setCreateTimeStr(formatTime(order.getCreateTime()));
r.setStatusStr(getStatusStr(order.getStatus()));
String depositCode = orderCodeMap.get(order.getOrderCode());
if (depositCode != null) {
r.setStatusStr("平台鉴定通过(已寄存)<br/>[ " + depositCode+" ]");
} else {
r.setStatusStr(getStatusStr(order.getStatus()));
}
result.add(r);
}
return result;
... ... @@ -907,8 +914,14 @@ public class AppraiseOrderServiceImpl implements IAppraiseOrderService {
LOGGER.info("sendBackGoodsToSeller saveOrderOperateRecord operateType={} ,order code ={} ,userHelper = {} ,result json {}",operateType,appraiseOrder.getOrderCode() ,userHelper,jsonObject);
return jsonObject;
}
private JSONObject asyncCallAppraise(String args, String orderCode, AppraiseOrderReq req) {
@Override
public JSONObject updateSellerWaybillCode(AppraiseOrderWaybillUpdateReq req) {
String args = "ufo-gateway.updateWaybillCode";
return serviceCaller.call(args, req, JSONObject.class);
}
private JSONObject asyncCallAppraise(String args, String orderCode, AppraiseOrderReq req) {
AppraiseExpressInfoBo bo = new AppraiseExpressInfoBo();
bo.setOrderCode(Long.valueOf(orderCode));
bo.setExpressCompanyId(req.getExpressCompanyId());
... ...
... ... @@ -9,7 +9,10 @@
<td>姓名:<span id="showUserName"></span></td>
<td>UID:<span id="showUid"></span></td>
<td>绑定手机号:<span id="showMobile"></span></td>
<td>发货单号:<span id="showExpressNumber"></span></td>
<!--<td>发货单号:<span id="showExpressNumber"></span></td>-->
<td>发货单号:<input id="showExpressNumber" type="text"/>
<a id="editExpressNumberBtn" class="easyui-linkbutton btn-info" data-options="iconCls:'icon-edit'">修改</a>
</td>
<td>发货时间:<span id="showDeliverTimeStr"></span></td>
</tr>
... ... @@ -56,10 +59,26 @@
</div>
</div>
</div>
<div id="viewFaultDiv" class="easyui-dialog" style="width:1150px;height:500px;padding:10px 20px" closed="true" resizable="true" modal="true" data-options="iconCls: 'icon-view',buttons: '#dlg-buttons'">
<div>
<table>
<tr>
<td width="100px">图片</td>
<td><span id="faultImage" /></td>
</tr>
<tr>
<td height="40px">描述</td>
<td><span id="faultTxt" /></td>
</tr>
</table>
</div>
</div>
<script>
$(function () {
$("#showExpressNumber").textbox({});
$('#tt').tabs({
border: false,
onSelect: function (title, index) {
... ... @@ -72,6 +91,28 @@
}
});
$("#editExpressNumberBtn").linkbutton({
onClick: function () {
$.messager.confirm('修改卖家发货物流单号','确认修改卖家发货物流单号?',function(r){
if (r){
$.post(contextPath + "/appraiseOrder/updateSellerWaybillCode", {
orderCode : orderCode,
sellerWaybillCode : $('#showExpressNumber').textbox('getValue')
}, function(data) {
if (data.code == 200) {
window.self.$.messager.show({
title : "提示",
msg : "操作成功!"
});
}else {
window.self.$.messager.alert("失败", data.message, "error");
}
});
}
});
}
});
// 隐藏域赋值
$.post(contextPath + "/appraiseOrder/detailInfo", {
orderCode: orderCode,
... ... @@ -80,7 +121,7 @@
if (result.code == 200) {
var data = result.data;
$("#showDeliverTimeStr").text(data.deliverTimeStr);
$("#showExpressNumber").text(data.expressNumber);
$("#showExpressNumber").textbox('setValue', data.expressNumber);
$("#showUserName").text(data.userName);
$("#showUid").text(data.uid);
$("#showMobile").text(data.mobile);
... ... @@ -188,6 +229,9 @@
if(rowData.status == "2") {
str = "<br/><a role='cancel' dataId='" + rowData.orderCode + "' style='margin-left:10px;background-color: #5bc0de'>取消订单</a>";
}
if(rowData.status == "20") {
str = "<br/><a role='appraiseDetail' dataId='" + rowData.orderCode + "' style='margin-left:10px;background-color: #5bc0de'>鉴定详情</a>";
}
return str;
}
}]],
... ... @@ -238,6 +282,29 @@
});
}
});
$(this).myDatagrid("getPanel").find("a[role='appraiseDetail']").linkbutton({
iconCls: "icon-edit",
onClick: function () {
orderCode = $(this).attr("dataId");
$.post(contextPath + "/buyerOrder/queryQualityCheck", {
orderCode : orderCode
}, function(data) {
if (data.code == 200) {
$("#faultTxt").text(data.data.checkText);
var images = "";
for (var i = 0; i < data.data.imageUrlList.length; i++) {
images += "<image height='300px' width='300px' src='"+data.data.imageUrlList[i]+"' />";
}
document.getElementById("faultImage").innerHTML = images;
//$("#faultImage").text(data.imageUrlList);
$("#viewFaultDiv").dialog('open').dialog('setTitle', '查看瑕疵');
}else {
window.self.$.messager.alert("失败", data.message, "error");
}
});
}
});
}
});
function getOperateRecord(orderCode){
... ...
... ... @@ -31,6 +31,7 @@
</select>
下单时间:<input id="buyStartTime" type="text">
<input id="buyEndTime" type="text"/>
<input id="waybillCode" type="text"/>
</div>
<div style="margin: 10px 0 0 30px;" class="div_search">
<a id="searchLinkButton" class="easyui-linkbutton btn-info" data-options="iconCls:'icon-search'">筛选</a>
... ... @@ -52,7 +53,10 @@
}
$(function () {
$("#orderCode").textbox({
prompt: "父订单编号"
prompt: "订单编号"
});
$("#waybillCode").textbox({
prompt: "物流单号"
});
$("#uid").textbox({
prompt: "UID"
... ... @@ -200,7 +204,7 @@
var div = $("<div>").appendTo($(document.body));
var title = "寄存详情";
$(div).myDialog({
width: "1150px",
width: "1200px",
height: "750px",
title: title,
left: 10,
... ... @@ -228,6 +232,7 @@
param.status = $('#status').combobox('getValue');
param.buyStartTimeStr = $('#buyStartTime').datetimebox('getValue');
param.buyEndTimeStr = $('#buyEndTime').datetimebox('getValue');
param.waybillCode = $('#waybillCode').textbox('getValue');
$("#orderTable").myDatagrid("load", param);
}
});
... ...