Authored by caoyan

Merge branch 'dev_确认收货优化' into test6.9.7

# Conflicts:
#	order/src/main/java/com/yoho/ufo/order/service/IBuyerOrderService.java
#	order/src/main/java/com/yoho/ufo/order/service/impl/BuyerOrderServiceImpl.java
@@ -16,9 +16,9 @@ public interface AbnormalPackageMapper { @@ -16,9 +16,9 @@ public interface AbnormalPackageMapper {
16 16
17 int insert(AbnormalPackage abnormalPackage); 17 int insert(AbnormalPackage abnormalPackage);
18 18
19 - int update(@Param("operateUid") Integer operateUid, @Param("updateTime") Integer updateTime, @Param("sellerWaybillCode") String sellerWaybillCode); 19 + int update(@Param("operateUid") Integer operateUid, @Param("updateTime") Integer updateTime, @Param("sellerWaybillCode") String sellerWaybillCode, @Param("depotNo")Integer depotNo);
20 20
21 - int selectValidCnt(@Param("sellerWaybillCode") String sellerWaybillCode); 21 + int selectValidCnt(@Param("sellerWaybillCode") String sellerWaybillCode, @Param("depotNo") Integer depotNo);
22 22
23 List<String> selectValidSellerWaybillCodeList(@Param("buyerOrderReq") BuyerOrderReq buyerOrderReq); 23 List<String> selectValidSellerWaybillCodeList(@Param("buyerOrderReq") BuyerOrderReq buyerOrderReq);
24 } 24 }
@@ -23,6 +23,8 @@ public class AbnormalPackage implements Serializable { @@ -23,6 +23,8 @@ public class AbnormalPackage implements Serializable {
23 23
24 private Integer updateTime; 24 private Integer updateTime;
25 25
  26 + private Integer depotNo;
  27 +
26 public Integer getId() { 28 public Integer getId() {
27 return id; 29 return id;
28 } 30 }
@@ -71,6 +73,14 @@ public class AbnormalPackage implements Serializable { @@ -71,6 +73,14 @@ public class AbnormalPackage implements Serializable {
71 this.updateTime = updateTime; 73 this.updateTime = updateTime;
72 } 74 }
73 75
  76 + public Integer getDepotNo() {
  77 + return depotNo;
  78 + }
  79 +
  80 + public void setDepotNo(Integer depotNo) {
  81 + this.depotNo = depotNo;
  82 + }
  83 +
74 @Override 84 @Override
75 public String toString() { 85 public String toString() {
76 return "AbnormalExpress{" + 86 return "AbnormalExpress{" +
@@ -8,14 +8,18 @@ @@ -8,14 +8,18 @@
8 <result column="create_time" property="createTime" jdbcType="INTEGER" /> 8 <result column="create_time" property="createTime" jdbcType="INTEGER" />
9 <result column="operate_uid" property="operateUid" jdbcType="INTEGER" /> 9 <result column="operate_uid" property="operateUid" jdbcType="INTEGER" />
10 <result column="update_time" property="updateTime" jdbcType="INTEGER" /> 10 <result column="update_time" property="updateTime" jdbcType="INTEGER" />
  11 + <result column="depot_no" property="depotNo" jdbcType="INTEGER" />
11 </resultMap> 12 </resultMap>
12 13
13 <sql id="Base_Column_List"> 14 <sql id="Base_Column_List">
14 - id, seller_waybillCode, is_del, create_time, operate_uid, update_time 15 + id, seller_waybillCode, is_del, create_time, operate_uid, update_time, depot_no
15 </sql> 16 </sql>
16 17
17 - <select id="selectValidCnt" resultType="java.lang.Integer"> 18 + <select id="selectValidCnt" resultType="java.lang.Integer" parameterType="com.yoho.order.model.BuyerOrderReq">
18 select count(1) from abnormal_package where is_del = 0 19 select count(1) from abnormal_package where is_del = 0
  20 + <if test="depotNo !=null ">
  21 + and depot_no = #{depotNo}
  22 + </if>
19 <if test="sellerWaybillCode!=null and sellerWaybillCode != ''"> 23 <if test="sellerWaybillCode!=null and sellerWaybillCode != ''">
20 and seller_waybillCode = #{sellerWaybillCode} 24 and seller_waybillCode = #{sellerWaybillCode}
21 </if> 25 </if>
@@ -23,6 +27,9 @@ @@ -23,6 +27,9 @@
23 27
24 <select id="selectValidSellerWaybillCodeList" resultType="java.lang.String" parameterType="com.yoho.order.model.BuyerOrderReq"> 28 <select id="selectValidSellerWaybillCodeList" resultType="java.lang.String" parameterType="com.yoho.order.model.BuyerOrderReq">
25 select seller_waybillCode from abnormal_package where is_del=0 29 select seller_waybillCode from abnormal_package where is_del=0
  30 + <if test="buyerOrderReq.depotNo !=null ">
  31 + and depot_no = #{buyerOrderReq.depotNo}
  32 + </if>
26 <if test="buyerOrderReq.sellerWaybillCode!=null and buyerOrderReq.sellerWaybillCode != ''"> 33 <if test="buyerOrderReq.sellerWaybillCode!=null and buyerOrderReq.sellerWaybillCode != ''">
27 and seller_waybillCode = #{buyerOrderReq.sellerWaybillCode} 34 and seller_waybillCode = #{buyerOrderReq.sellerWaybillCode}
28 </if> 35 </if>
@@ -37,12 +44,12 @@ @@ -37,12 +44,12 @@
37 </select> 44 </select>
38 45
39 <insert id="insert" parameterType="com.yoho.order.model.AbnormalPackage"> 46 <insert id="insert" parameterType="com.yoho.order.model.AbnormalPackage">
40 - insert into abnormal_package(id, seller_waybillCode, is_del, create_time, operate_uid, update_time)  
41 - values (#{id}, #{sellerWaybillCode}, #{isDel}, #{createTime}, #{operateUid}, #{updateTime}) 47 + insert into abnormal_package(id, seller_waybillCode, is_del, create_time, operate_uid, update_time, depot_no)
  48 + values (#{id}, #{sellerWaybillCode}, #{isDel}, #{createTime}, #{operateUid}, #{updateTime}, #{depotNo})
42 </insert> 49 </insert>
43 50
44 <update id="update"> 51 <update id="update">
45 - update abnormal_package set operate_uid=#{operateUid}, update_time=#{updateTime}, is_del=0 52 + update abnormal_package set operate_uid=#{operateUid}, update_time=#{updateTime}, depot_no=#{depotNo}, is_del=0
46 where seller_waybillCode = #{sellerWaybillCode} 53 where seller_waybillCode = #{sellerWaybillCode}
47 </update> 54 </update>
48 </mapper> 55 </mapper>
@@ -115,7 +115,8 @@ public interface IBuyerOrderService { @@ -115,7 +115,8 @@ public interface IBuyerOrderService {
115 // 查询鉴定室列表 115 // 查询鉴定室列表
116 List<IdentifyCenterResp> queryIdentifyCenter(); 116 List<IdentifyCenterResp> queryIdentifyCenter();
117 117
118 - int addAbnormalPackage(String sellerWaybillCode); 118 +
  119 + int addAbnormalPackage(String sellerWaybillCode, String phoneUid);
119 120
120 PageResponseBO<String> queryAbnormalPackage(BuyerOrderReq req); 121 PageResponseBO<String> queryAbnormalPackage(BuyerOrderReq req);
121 122
@@ -262,18 +262,14 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { @@ -262,18 +262,14 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
262 @Autowired 262 @Autowired
263 private AbnormalPackageMapper abnormalPackageMapper; 263 private AbnormalPackageMapper abnormalPackageMapper;
264 264
265 - //南京月结账号  
266 -// private static final String NANJING_CUSTID = "0255045253";  
267 -// private static final String NANJING_CUSTID = "9999999999";  
268 -  
269 - //北京月结账号  
270 -// private static final String BEIJING_CUSTID = "0100026158";  
271 -// private static final String BEIJING_CUSTID = "9999999999";  
272 -  
273 private static final Integer PAY_METHOD_MONTHLY = 1;//寄付月结 265 private static final Integer PAY_METHOD_MONTHLY = 1;//寄付月结
274 266
275 private static final Integer PAY_METHOD_FREIGHT_COLLECT = 2;//到付 267 private static final Integer PAY_METHOD_FREIGHT_COLLECT = 2;//到付
276 268
  269 + private static final Integer DEPOT_NO_BEIJING= 0;//北京
  270 +
  271 + private static final Integer DEPOT_NO_NANJING=1;//南京
  272 +
277 //已收货 273 //已收货
278 private static final Byte QC_STATUS_RECEIVED = 0; 274 private static final Byte QC_STATUS_RECEIVED = 0;
279 275
@@ -366,11 +362,22 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { @@ -366,11 +362,22 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
366 return resultMap; 362 return resultMap;
367 } 363 }
368 364
369 - public Map<String, Integer> getCountForQc(BuyerOrderReq req){  
370 - if(null == req.getDepotNo()) {  
371 - req.setDepotNo(1);//默认南京 365 + private Integer getDepotNoByPhoneUid(String phoneUid) {
  366 + if(StringUtils.isEmpty(phoneUid)) {
  367 + return DEPOT_NO_NANJING;
  368 + }
  369 + PhoneUidDepot record = phoneUidDepotMapper.selectByphoneUid(phoneUid);
  370 + if(null != record) {
  371 + return record.getDepotNo();
  372 + }else {
  373 + return DEPOT_NO_NANJING;
372 } 374 }
373 375
  376 + }
  377 +
  378 + public Map<String, Integer> getCountForQc(BuyerOrderReq req){
  379 + req.setDepotNo(getDepotNoByPhoneUid(req.getPhoneUid()));
  380 +
374 //根据查询条件(订单号或卖家运单号) 381 //根据查询条件(订单号或卖家运单号)
375 if(StringUtils.isNotEmpty(req.getQueryStr())) { 382 if(StringUtils.isNotEmpty(req.getQueryStr())) {
376 return queryOrderNumByStatus(req.getQueryStr(), req.getDepotNo()); 383 return queryOrderNumByStatus(req.getQueryStr(), req.getDepotNo());
@@ -388,7 +395,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { @@ -388,7 +395,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
388 resultMap.put("problemNum", problemNum); 395 resultMap.put("problemNum", problemNum);
389 396
390 //查询异常包裹 397 //查询异常包裹
391 - resultMap.put("exceptionNum", abnormalPackageMapper.selectValidCnt(null)); 398 + resultMap.put("exceptionNum", abnormalPackageMapper.selectValidCnt(null, req.getDepotNo()));
392 399
393 return resultMap; 400 return resultMap;
394 } 401 }
@@ -425,7 +432,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { @@ -425,7 +432,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
425 resultMap.put("alreadyDeliverNum", alreadyDeliverNum); 432 resultMap.put("alreadyDeliverNum", alreadyDeliverNum);
426 resultMap.put("problemNum", problemNum); 433 resultMap.put("problemNum", problemNum);
427 //查询异常包裹 434 //查询异常包裹
428 - resultMap.put("exceptionNum", abnormalPackageMapper.selectValidCnt(queryStr)); 435 + resultMap.put("exceptionNum", abnormalPackageMapper.selectValidCnt(queryStr, depotNo));
429 436
430 return resultMap; 437 return resultMap;
431 } 438 }
@@ -750,6 +757,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { @@ -750,6 +757,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
750 757
751 @Override 758 @Override
752 public PageResponseBO<BuyerOrderResp> queryOrderListByStatusForQc(BuyerOrderReq req) { 759 public PageResponseBO<BuyerOrderResp> queryOrderListByStatusForQc(BuyerOrderReq req) {
  760 + req.setDepotNo(getDepotNoByPhoneUid(req.getPhoneUid()));
753 Byte status = req.getStatus(); 761 Byte status = req.getStatus();
754 List<Byte> checkStatusList = Lists.newArrayList(); 762 List<Byte> checkStatusList = Lists.newArrayList();
755 String platformExpressInfoFlag = ""; 763 String platformExpressInfoFlag = "";
@@ -2532,11 +2540,12 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { @@ -2532,11 +2540,12 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
2532 } 2540 }
2533 2541
2534 @Override 2542 @Override
2535 - public int addAbnormalPackage(String sellerWaybillCode) { 2543 + public int addAbnormalPackage(String sellerWaybillCode, String phoneUid) {
  2544 + Integer depotNo = getDepotNoByPhoneUid(phoneUid);
2536 //数据库已存在 2545 //数据库已存在
2537 AbnormalPackage pkg = abnormalPackageMapper.selectBySellerWaybillCode(sellerWaybillCode); 2546 AbnormalPackage pkg = abnormalPackageMapper.selectBySellerWaybillCode(sellerWaybillCode);
2538 if(null != pkg) { 2547 if(null != pkg) {
2539 - return abnormalPackageMapper.update(new UserHelper().getUserId(), DateUtil.getCurrentTimeSeconds(), sellerWaybillCode); 2548 + return abnormalPackageMapper.update(new UserHelper().getUserId(), DateUtil.getCurrentTimeSeconds(), sellerWaybillCode, depotNo);
2540 } 2549 }
2541 2550
2542 pkg = new AbnormalPackage(); 2551 pkg = new AbnormalPackage();
@@ -2544,15 +2553,19 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { @@ -2544,15 +2553,19 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
2544 pkg.setIsDel(0); 2553 pkg.setIsDel(0);
2545 pkg.setCreateTime(DateUtil.getCurrentTimeSeconds()); 2554 pkg.setCreateTime(DateUtil.getCurrentTimeSeconds());
2546 pkg.setOperateUid(new UserHelper().getUserId()); 2555 pkg.setOperateUid(new UserHelper().getUserId());
  2556 + pkg.setDepotNo(depotNo);
2547 return abnormalPackageMapper.insert(pkg); 2557 return abnormalPackageMapper.insert(pkg);
2548 } 2558 }
2549 2559
2550 @Override 2560 @Override
2551 public PageResponseBO<String> queryAbnormalPackage(BuyerOrderReq req){ 2561 public PageResponseBO<String> queryAbnormalPackage(BuyerOrderReq req){
2552 - int total = abnormalPackageMapper.selectValidCnt(req.getSellerWaybillCode()); 2562 + Integer depotNo = getDepotNoByPhoneUid(req.getPhoneUid());
  2563 + int total = abnormalPackageMapper.selectValidCnt(req.getSellerWaybillCode(), depotNo);
2553 if(total == 0){ 2564 if(total == 0){
2554 return null; 2565 return null;
2555 } 2566 }
  2567 +
  2568 + req.setDepotNo(depotNo);
2556 List<String> list = abnormalPackageMapper.selectValidSellerWaybillCodeList(req); 2569 List<String> list = abnormalPackageMapper.selectValidSellerWaybillCodeList(req);
2557 PageResponseBO<String> result=new PageResponseBO<>(); 2570 PageResponseBO<String> result=new PageResponseBO<>();
2558 result.setPage(req.getPage()); 2571 result.setPage(req.getPage());