Authored by caoyan

质检优化

... ... @@ -21,6 +21,8 @@ public class SignForPackage implements Serializable {
private Integer signTime;
private Integer isNormal;
public Integer getId() {
return id;
}
... ... @@ -61,6 +63,14 @@ public class SignForPackage implements Serializable {
this.signTime = signTime;
}
public Integer getIsNormal() {
return isNormal;
}
public void setIsNormal(Integer isNormal) {
this.isNormal = isNormal;
}
@Override
public String toString() {
return "SignForPackage{" +
... ... @@ -69,6 +79,7 @@ public class SignForPackage implements Serializable {
", sellerWaybillCode='" + sellerWaybillCode + '\'' +
", depotNo='" + depotNo + '\'' +
", signTime='" + signTime + '\'' +
", isNormal='" + isNormal + '\'' +
'}';
}
}
... ...
... ... @@ -7,15 +7,16 @@
<result column="seller_waybillCode" property="sellerWaybillCode" jdbcType="VARCHAR" />
<result column="depot_no" property="depotNo" jdbcType="INTEGER" />
<result column="sign_time" property="signTime" jdbcType="INTEGER" />
<result column="is_normal" property="isNormal" jdbcType="INTEGER" />
</resultMap>
<sql id="Base_Column_List">
id, date, seller_waybillCode, depot_no, sign_time
id, date, seller_waybillCode, depot_no, sign_time, is_normal
</sql>
<insert id="insert" parameterType="com.yoho.order.model.SignForPackage">
insert into sign_for_package (date, seller_waybillCode, depot_no, sign_time) values (#{date}, #{sellerWaybillCode}, #{depotNo},
#{signTime})
insert into sign_for_package (date, seller_waybillCode, depot_no, sign_time, is_normal) values (#{date}, #{sellerWaybillCode}, #{depotNo},
#{signTime}, #{isNormal})
</insert>
<select id="selectCountByDate" resultType="java.lang.Integer">
... ... @@ -37,6 +38,12 @@
<if test="buyerOrderReq.date != null">
and date=#{buyerOrderReq.date}
</if>
<if test="buyerOrderReq.status != null and buyerOrderReq.status == 0">
and is_normal=0
</if>
<if test="buyerOrderReq.status != null and buyerOrderReq.status == 1">
and is_normal=1
</if>
</sql>
<select id="selectTotalByCondition" resultType="java.lang.Integer" parameterType="com.yoho.order.model.BuyerOrderReq">
... ...
... ... @@ -500,7 +500,7 @@ public class BuyerOrderController {
if(StringUtils.isEmpty(req.getSellerWaybillCode()) || null == req.getDepotNo()) {
return new ApiResponse.ApiResponseBuilder().code(500).message("卖家运单号或收货地不能为空").build();
}
buyerOrderService.signForPackage(req.getSellerWaybillCode(), req.getDepotNo());
buyerOrderService.signForPackage(req.getSellerWaybillCode(), req.getDepotNo(), 0);
return new ApiResponse.ApiResponseBuilder().code(200).message("签收成功").build();
}
... ...
... ... @@ -106,7 +106,7 @@ public interface IBuyerOrderService {
JSONObject getExpressWaybillCode(BuyerOrderReq req);
@Database(ForceMaster = true)
void signForPackage(String sellerWaybillCode, Integer depotNo);
void signForPackage(String sellerWaybillCode, Integer depotNo, Integer isNormal);
int getPackageCount(Integer depotNo, Integer date);
... ...
... ... @@ -344,6 +344,10 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService, ApplicationCon
private static final Byte ABNORMAL_PACKAGE_STATUS_DEALED = 1;//异常包裹已处理
private static final Byte SIGN_FOR_PACKAGE_STATUS_NORMAL = 0;//正常包裹
private static final Byte SIGN_FOR_PACKAGE_STATUS_ABNORMAL = 1;//异常包裹
//已收货
private static final Byte QC_STATUS_RECEIVED = 0;
... ... @@ -1201,7 +1205,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService, ApplicationCon
}
//签收
signForPackage(sellerWaybillCode, getDepotNoByPhoneUid(req.getPhoneUid()));
signForPackage(sellerWaybillCode, getDepotNoByPhoneUid(req.getPhoneUid()), 0);
}
@Override
... ... @@ -2683,7 +2687,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService, ApplicationCon
@Override
@Database(ForceMaster = true)
public void signForPackage(String sellerWaybillCode, Integer depotNo) {
public void signForPackage(String sellerWaybillCode, Integer depotNo, Integer isNormal) {
BuyerOrderReq req = new BuyerOrderReq();
req.setSellerWaybillCode(sellerWaybillCode);
req.setDate(Integer.parseInt(DateUtil.getCurrentDateStr()));
... ... @@ -2697,6 +2701,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService, ApplicationCon
pkg.setSellerWaybillCode(sellerWaybillCode);
pkg.setDepotNo(depotNo);
pkg.setSignTime(DateUtil.getCurrentTimeSeconds());
pkg.setIsNormal(isNormal);
signForPackageMapper.insert(pkg);
}
... ... @@ -2729,18 +2734,13 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService, ApplicationCon
@Override
public PageResponseBO<SignForPackageRsp> queryPackageListByStatus(BuyerOrderReq req) {
PageResponseBO<SignForPackageRsp> result=new PageResponseBO<>();
if(req.getStatus().intValue() == 0) {//正常包裹
return queryNormalPackageList(req);
}else if(req.getStatus().intValue() == 1) {//异常包裹
buildQueryDate(req);
return queryAbnormalPackageList(req);
}
return result;
return querySignForPackageList(req);
}
private PageResponseBO<SignForPackageRsp> queryNormalPackageList(BuyerOrderReq req){
private PageResponseBO<SignForPackageRsp> querySignForPackageList(BuyerOrderReq req){
PageResponseBO<SignForPackageRsp> result=new PageResponseBO<>();
req.setDate(null == req.getDate() ? Integer.valueOf(DateUtil.getCurrentDateStr()) : req.getDate());
int total = signForPackageMapper.selectTotalByCondition(req);
if(total == 0) {
return null;
... ... @@ -2776,13 +2776,15 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService, ApplicationCon
req.setDepotNo(depotNo);
req.setSellerWaybillCode(sellerWaybillCode);
req.setDate(null == date ? Integer.valueOf(DateUtil.getCurrentDateStr()) : date);
req.setStatus(SIGN_FOR_PACKAGE_STATUS_NORMAL);
Map<String, Integer> result = Maps.newHashMap();
result.put("normalNum", signForPackageMapper.selectTotalByCondition(req));
//异常包裹
buildQueryDate(req);
result.put("abnormalNum", abnormalPackageMapper.selectCntByCondition(req));
// buildQueryDate(req);
req.setStatus(SIGN_FOR_PACKAGE_STATUS_ABNORMAL);
result.put("abnormalNum", signForPackageMapper.selectTotalByCondition(req));
return result;
}
... ... @@ -3417,7 +3419,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService, ApplicationCon
}
if(num > 0) {
//签收
signForPackage(sellerWaybillCode, depotNo);
signForPackage(sellerWaybillCode, depotNo, 1);//异常包裹
}
return num;
... ...