Authored by caoyan

Merge branch 'test6.8.4' of http://git.yoho.cn/ufo/ufo-platform into test6.8.4

... ... @@ -12,4 +12,6 @@ import com.yoho.order.model.ExpressInfo;
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);
}
... ...
... ... @@ -33,4 +33,11 @@
</if>
</select>
<select id="selectExpressInfoListByWaybillCodeAndLogisticsType" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List" />
FROM express_info
where waybill_code = #{waybillCode} and logistics_type = #{logisticsType}
ORDER BY create_time
</select>
</mapper>
\ No newline at end of file
... ...
... ... @@ -10,6 +10,7 @@ import java.util.Set;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
import com.alibaba.fastjson.JSON;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.elasticsearch.common.collect.Lists;
... ... @@ -600,7 +601,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
public List<ExpressInfoResp> queryExpressList(String orderCode, String expressType) {
LOGGER.info("queryExpressList orderCode is {}, expressTypeStr is {}", orderCode, expressType);
List<ExpressInfo> list = expressInfoMapper.selectByOrderCodeAndType(orderCode, convertExpressType(expressType));
List<ExpressInfo> list = getExpressInfoListByStage(orderCode, expressType);
if(CollectionUtils.isEmpty(list)) {
return Lists.newArrayList();
}
... ... @@ -622,6 +623,40 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
return respList;
}
private List<ExpressInfo> getExpressInfoListByStage(String orderCode, String expressType){
LOGGER.info("getExpressInfoListByStage orderCode is {}, expressTypeStr is {}", orderCode, expressType);
List<String> orderCodeList = Lists.newArrayList();
orderCodeList.add(orderCode);
List<ExpressRecord> records = expressRecordMapper.selectByOrderCodeListAndType(orderCodeList,convertExpressType(expressType));
if(CollectionUtils.isEmpty(records)) {
LOGGER.info("getExpressInfoListByStage records is empty , orderCode is {}, expressTypeStr is {}", orderCode, expressType);
return Lists.newArrayList();
}
ExpressRecord record = records.get(0);
LOGGER.info("getExpressInfoListByStage begin , orderCode = {} ,expressType = {}, expressRecord = {} ",orderCode,expressType,record);
String waybillCode = record.getWaybillCode();
Integer logisticsType = record.getLogisticsType();
//原来的情况,根据订单号直接查询物流,如果存在物流信息,则直接返回,否则有可能是多单一号
List<ExpressInfo> list = expressInfoMapper.selectByOrderCodeAndType(orderCode, convertExpressType(expressType));
//有可能存在一个订单号,多个物流的情况,比如原来的物流填错了,修改了新的物流,只保留新的物流号的信息
if(CollectionUtils.isNotEmpty(list)){
list = list.stream().filter(info -> StringUtils.equals(waybillCode,info.getWaybillCode())).collect(Collectors.toList());
}
if(CollectionUtils.isNotEmpty(list)) {
LOGGER.info("getExpressInfoListByStage success have data in express info orderCode = {} ,expressType = {} ",orderCode,expressType);
return list;
}
LOGGER.info("getExpressInfoListByStage orderCode is {}, expressTypeStr is {},records size is {} ,records is {}", orderCode, expressType , records.size(),JSON.toJSONString(records));
List<ExpressInfo> expressInfoList = expressInfoMapper.selectExpressInfoListByWaybillCodeAndLogisticsType(waybillCode,logisticsType);
return expressInfoList;
}
public List<OrderOperateRecordResp> queryOperateRecordList(BuyerOrderReq req){
if(null == req.getOrderCode()) {
return Lists.newArrayList();
... ...
... ... @@ -83,7 +83,7 @@ public class NFCServiceImpl implements INFCService {
BuyerOrder buyerOrder = buyerOrderMapper.selectByOrderCode(orderCode);
if(buyerOrder == null){
logger.info("writeIdentify get order is null");
return;
throw new PlatformException("订单信息不存在!", 403);
}
logger.info("writeIdentify get order success , order is {}", buyerOrder);
try{
... ... @@ -97,7 +97,7 @@ public class NFCServiceImpl implements INFCService {
syncBlockChain(tagId, buyerOrder);
}catch (Exception e){
logger.warn("writeIdentify syncBlockChain error , e is {}", e);
throw new PlatformException("同步数据到区块链写代理失败", 403);
// throw new PlatformException("同步数据到区块链写代理失败", 403);
}
}
... ...
... ... @@ -707,6 +707,10 @@ function addRecordPage(skup, order_code, id) {
modal: true,
collapsible: true,
cache: false,
onClose : function() {
timedCount();
$(this).dialog('destroy');
},
buttons: [{
text: "开始录制",
id: "recordBtn",
... ... @@ -758,7 +762,8 @@ function addRecordPage(skup, order_code, id) {
text: "取消",
iconCls: "icon-cancel",
handler: function () {
$(div).dialog("close");
timedCount();
$(div).dialog("destroy");
}
}]
});
... ...
... ... @@ -5,8 +5,8 @@
<title>Insert title here</title>
</head>
<body>
<input style="display: none" id="startTime" type="text"/>
<input style="display: none" id="endTime" type="text"/>
<input id="startTime" type="hidden"/>
<input id="endTime" type="hidden"/>
<ul>
<li style="padding-bottom: 10px;">
... ... @@ -37,8 +37,8 @@
var totalVar;
function stopCount() {
var endTime = $('#endTime').val();
var startTime = $('#startTime').val();
var endTime = parseInt($('#endTime').val());
var startTime = parseInt($('#startTime').val());
var secondVar = parseInt((endTime - startTime) % 60);
if (endTime - startTime > 60) {
var minuteVar = parseInt((endTime - startTime) / 60);
... ...