Authored by qinchao

Merge branch 'dev_685_质检状态拆分' into test6.8.5

package com.yoho.order.dal;
import com.yoho.order.model.QualityCheck;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface QualityCheckMapper {
int deleteByPrimaryKey(Integer id);
int insert(QualityCheck record);
int insertSelective(QualityCheck record);
QualityCheck selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(QualityCheck record);
int updateByPrimaryKey(QualityCheck record);
QualityCheck selectByOrderCode(@Param("orderCode") Long orderCode);
List<QualityCheck> selectByOrderCodeList(@Param("orderCodeList") List<String> orderCodeList);
}
\ No newline at end of file
... ...
package com.yoho.order.model;
import lombok.Data;
import lombok.ToString;
@Data
@ToString
public class QualityCheck {
private Integer id;
private Long orderCode;
private String checkText;
// 1质检不通过 , 2瑕疵确认
private Byte type;
// 1等待确认 , 2瑕疵通过 ,8瑕疵不接受 ,9瑕疵不通过(超时)
private Byte status;
private String imageUrl;
}
\ No newline at end of file
... ...
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yoho.order.dal.QualityCheckMapper">
<resultMap id="BaseResultMap" type="com.yoho.order.model.QualityCheck">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="order_code" jdbcType="BIGINT" property="orderCode" />
<result column="check_text" jdbcType="VARCHAR" property="checkText" />
<result column="type" jdbcType="TINYINT" property="type" />
<result column="status" jdbcType="TINYINT" property="status" />
<result column="image_url" jdbcType="VARCHAR" property="imageUrl" />
</resultMap>
<sql id="Base_Column_List">
id, order_code, check_text, type, status, image_url
</sql>
<select id="selectByOrderCode" resultMap="BaseResultMap">
select <include refid="Base_Column_List" />
from quality_check where order_code = #{orderCode}
</select>
<select id="selectByOrderCodeList" resultMap="BaseResultMap">
select <include refid="Base_Column_List" />
from quality_check
where order_code in
<foreach collection="orderCodeList" item="orderCode" open="(" close=")" separator=",">
#{orderCode}
</foreach>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from quality_check
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from quality_check
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.yoho.order.model.QualityCheck">
insert into quality_check (id, order_code, check_text,
type, status, image_url
)
values (#{id,jdbcType=INTEGER}, #{orderCode,jdbcType=BIGINT}, #{checkText,jdbcType=VARCHAR},
#{type,jdbcType=TINYINT}, #{status,jdbcType=TINYINT}, #{imageUrl,jdbcType=VARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="com.yoho.order.model.QualityCheck">
insert into quality_check
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="orderCode != null">
order_code,
</if>
<if test="checkText != null">
check_text,
</if>
<if test="type != null">
type,
</if>
<if test="status != null">
status,
</if>
<if test="imageUrl != null">
image_url,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="orderCode != null">
#{orderCode,jdbcType=BIGINT},
</if>
<if test="checkText != null">
#{checkText,jdbcType=VARCHAR},
</if>
<if test="type != null">
#{type,jdbcType=TINYINT},
</if>
<if test="status != null">
#{status,jdbcType=TINYINT},
</if>
<if test="imageUrl != null">
#{imageUrl,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.yoho.order.model.QualityCheck">
update quality_check
<set>
<if test="orderCode != null">
order_code = #{orderCode,jdbcType=BIGINT},
</if>
<if test="checkText != null">
check_text = #{checkText,jdbcType=VARCHAR},
</if>
<if test="type != null">
type = #{type,jdbcType=TINYINT},
</if>
<if test="status != null">
status = #{status,jdbcType=TINYINT},
</if>
<if test="imageUrl != null">
image_url = #{imageUrl,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.yoho.order.model.QualityCheck">
update quality_check
set order_code = #{orderCode,jdbcType=BIGINT},
check_text = #{checkText,jdbcType=VARCHAR},
type = #{type,jdbcType=TINYINT},
status = #{status,jdbcType=TINYINT},
image_url = #{imageUrl,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>
\ No newline at end of file
... ...
... ... @@ -19,7 +19,7 @@ public enum Constant {
BUYER_ORDER_STATUS_JUDGING((byte)3,"平台鉴定中"),
//平台鉴定通过
BUYER_ORDER_STATUS_JUDGE_PASS((byte)32,"平台鉴定通过"),
//BUYER_ORDER_STATUS_JUDGE_PASS((byte)32,"平台鉴定通过"),
//待收货
BUYER_ORDER_STATUS_TO_BE_RECEIVED((byte)4,"平台已发货"),
... ...
... ... @@ -11,14 +11,17 @@ public enum OperateTypeEnum {
OPERATE_TYPE_UPDATE_RECEIVE_INFO(2,"修改收货人信息"),
OPERATE_TYPE_CONFIRM_RECEIVE(3,"确认收货"),
OPERATE_TYPE_JUDGE_BEGIN(4,"质检通过"),
OPERATE_TYPE_JUDGE_PASS(5,"鉴定通过(并且发货)"),
OPERATE_TYPE_JUDGE_REJECT(6,"鉴定不通过(并且发货)"),
OPERATE_TYPE_QUALITY_CHECK_PASS(4,"质检通过"),
OPERATE_TYPE_JUDGE_PASS(5,"鉴定通过(且发货)"),
OPERATE_TYPE_JUDGE_REJECT(6,"鉴定不通过(且发货)"),
OPERATE_TYPE_DELIVERY_GOODS(7,"发货给买家"),
//OPERATE_TYPE_DELIVERY_GOODS(7,"发货给买家"),
OPERATE_TYPE_RETURN_CAUSE_OF_JUDGE_FAILURE(8,"发货给卖家(鉴定不通过)"),
OPERATE_TYPE_RETURN_CAUSE_OF_BUYER_CANCEL_AFTER_SELLER_SELL_OUT(9,"发货给卖家(买家在卖家发货后取消)"),
CS_CANCEL_BEFORE_DEPOT_RECEIVE(10,"鉴定中心收货前客服取消"),
OPERATE_TYPE_QUALITY_NOT_PASS(11,"质检不通过"),
OPERATE_TYPE_QUALITY_MINI_FAULT(12,"质检瑕疵确认"),
;
private Integer code;
private String desc;
... ...
... ... @@ -80,7 +80,7 @@ public class BuyerOrderController {
@RequestMapping(value = "/qualityCheckNotPass")
public ApiResponse qualityCheckNotPass(BuyerOrderReq req) {
LOGGER.info("qualityCheckNotPass in. req is {}", req);
JSONObject result = buyerOrderService.qualityCheckNotPass();
JSONObject result = buyerOrderService.qualityCheckNotPass(req);
if(result.getIntValue("code") == 200) {
return new ApiResponse.ApiResponseBuilder().code(200).message("质检不通过成功").build();
}else {
... ... @@ -89,10 +89,10 @@ public class BuyerOrderController {
}
//瑕疵确认
@RequestMapping(value = "/minorFaultConfirm")
public ApiResponse minorFaultConfirm(BuyerOrderReq req) {
LOGGER.info("minorFaultConfirm in. req is {}", req);
JSONObject result = buyerOrderService.minorFaultConfirm();
@RequestMapping(value = "/miniFaultConfirm")
public ApiResponse miniFaultConfirm(BuyerOrderReq req) {
LOGGER.info("miniFaultConfirm in. req is {}", req);
JSONObject result = buyerOrderService.miniFaultConfirm(req);
if(result.getIntValue("code") == 200) {
return new ApiResponse.ApiResponseBuilder().code(200).message("瑕疵确认成功").build();
}else {
... ...
... ... @@ -32,8 +32,8 @@ public interface IBuyerOrderService {
JSONObject qualityCheckPass(BuyerOrderReq req);
JSONObject qualityCheckNotPass();
JSONObject minorFaultConfirm();
JSONObject qualityCheckNotPass(BuyerOrderReq req);
JSONObject miniFaultConfirm(BuyerOrderReq req);
JSONObject judgePass(BuyerOrderReq req);
... ...
... ... @@ -102,6 +102,9 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
@Autowired
private IdentifyRecordsMapper identifyRecordsMapper;
@Autowired
private QualityCheckMapper qualityCheckMapper;
@Autowired
private BuyerOrderFeedbackService buyerOrderFeedbackService;
... ... @@ -189,15 +192,21 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
return null;
}
//查询质检情况
//查询buyer_order_goods
List<String> buyerOrderCodeList = orderList.stream().map(BuyerOrder::getOrderCode).collect(Collectors.toList());
List<BuyerOrderGoods> buyerGoodsList = buyerOrderGoodsMapper.selectByOrderCode(buyerOrderCodeList);
if(CollectionUtils.isEmpty(buyerGoodsList)) {
return null;
}
//查询质检情况
List<QualityCheck> qualityCheckList = qualityCheckMapper.selectByOrderCodeList(buyerOrderCodeList);
Map<Long, QualityCheck> qualityCheckMap = null;
if(CollectionUtils.isNotEmpty(qualityCheckList)){
qualityCheckMap = qualityCheckList.stream().collect(Collectors.toMap(QualityCheck::getOrderCode, b->b));
}
Map<String, BuyerOrderGoods> buyerGoodsMap = buyerGoodsList.stream().collect(Collectors.toMap(BuyerOrderGoods::getOrderCode, b->b));
//查询seller_order_goods
... ... @@ -240,7 +249,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
List<ExpressCompany> companyList = expressCompanyMapper.selectByIdList(expressCompanyIdList);
companyMap = companyList.stream().collect(Collectors.toMap(ExpressCompany::getId, ExpressCompany::getCompanyName));
}
List<BuyerOrderResp> respList = convertToResp(orderList, buyerGoodsMap, sellerOrderMap, sellerGoodsMap,expressRecordMap, platformExpressRecordMap, companyMap,skupProductCodeMap);
List<BuyerOrderResp> respList = convertToResp(orderList, buyerGoodsMap, sellerOrderMap, sellerGoodsMap,expressRecordMap, platformExpressRecordMap, companyMap,skupProductCodeMap,qualityCheckMap);
completeMp4VedioUrl(respList); // 查询是否有视频连接
... ... @@ -384,43 +393,75 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
@Override
public JSONObject qualityCheckPass(BuyerOrderReq req){
BuyerOrder buyerOrder = checkParam(req);
String args = "ufo-gateway.qualityCheckPass";
JSONObject jsonObject = asyncCallConfirmReceive(args, buyerOrder.getOrderCode());
//记录操作日志
int operateType =OperateTypeEnum.OPERATE_TYPE_QUALITY_CHECK_PASS.getCode();
UserHelper userHelper = new UserHelper();
saveOrderOperateRecord(buyerOrder.getOrderCode(), userHelper, operateType, "");
LOGGER.info("qualityCheckPass saveOrderOperateRecord operateType={} ,order code ={} ,userHelper = {} ,result json {}",operateType,buyerOrder.getOrderCode() ,userHelper,jsonObject);
return jsonObject;
}
private BuyerOrder checkParam(BuyerOrderReq req){
if(null == req.getId()) {
return null;
throw new ServiceException(400,"错误:参数错误");
}
BuyerOrder buyerOrder = buyerOrderMapper.selectById(req.getId());
if(null == buyerOrder) {
return null;
throw new ServiceException(400,"错误:订单为空");
}
if( Constant.BUYER_ORDER_STATUS_PLATFORM_RECEIVE.getByteVal()!=buyerOrder.getStatus().byteValue()){
throw new ServiceException(400,"错误:订单状态变化,不允许开始鉴定,请重新刷新列表");
}
String args = "ufo-gateway.qualityCheckPass";
//检查是否存在质检记录,如果存在,则不允许再次执行
QualityCheck qualityCheck = qualityCheckMapper.selectByOrderCode(Long.valueOf(buyerOrder.getOrderCode()));
if(null != qualityCheck){
LOGGER.warn("checkParam exist quality check info ,buyerOrder = {} ,qualityCheck = {} ",buyerOrder ,qualityCheck);
throw new ServiceException(400,"错误:订单存在质检信息,请重新刷新列表");
}
return buyerOrder;
}
public JSONObject qualityCheckNotPass(BuyerOrderReq req){
BuyerOrder buyerOrder = checkParam(req);
//保存图片
//调用鉴定不通过接口
String args = "orderAppraise.appraiseFailWithoutExpress";
JSONObject jsonObject = asyncCallConfirmReceive(args, buyerOrder.getOrderCode());
//记录操作日志
int operateType =OperateTypeEnum.OPERATE_TYPE_JUDGE_BEGIN.getCode();
int operateType =OperateTypeEnum.OPERATE_TYPE_QUALITY_NOT_PASS.getCode();
UserHelper userHelper = new UserHelper();
saveOrderOperateRecord(buyerOrder.getOrderCode(), userHelper, operateType, "");
LOGGER.info("qualityCheckPass saveOrderOperateRecord operateType={} ,order code ={} ,userHelper = {} ,result json {}",operateType,buyerOrder.getOrderCode() ,userHelper,jsonObject);
LOGGER.info("qualityCheckNotPass saveOrderOperateRecord operateType={} ,order code ={} ,userHelper = {} ,result json {}",operateType,buyerOrder.getOrderCode() ,userHelper,jsonObject);
return jsonObject;
}
public JSONObject qualityCheckNotPass(){
//保存图片
public JSONObject miniFaultConfirm(BuyerOrderReq req){
BuyerOrder buyerOrder = checkParam(req);
//调用鉴定不通过接口
String args = "ufo-gateway.miniFaultConfirm";
JSONObject jsonObject = asyncCallConfirmReceive(args, buyerOrder.getOrderCode());
//记录操作日志
int operateType =OperateTypeEnum.OPERATE_TYPE_QUALITY_MINI_FAULT.getCode();
UserHelper userHelper = new UserHelper();
saveOrderOperateRecord(buyerOrder.getOrderCode(), userHelper, operateType, "");
LOGGER.info("miniFaultConfirm saveOrderOperateRecord operateType={} ,order code ={} ,userHelper = {} ,result json {}",operateType,buyerOrder.getOrderCode() ,userHelper,jsonObject);
return null;
}
public JSONObject minorFaultConfirm(){
return null;
return jsonObject;
}
//鉴定通过
... ... @@ -688,7 +729,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
LOGGER.info("call ufo-gateway enter orderCode is {}, interface is {},result is {}", orderCode, args);
OrderRequest request = new OrderRequest();
request.setOrderCode(Long.valueOf(orderCode));
JSONObject jsonObject = serviceCaller.asyncCall(args, request, JSONObject.class).get(5);
JSONObject jsonObject = serviceCaller.asyncCall(args, request, JSONObject.class).get(5, TimeUnit.SECONDS);
LOGGER.info("call ufo-gateway orderCode is {}, interface is {},result is {}", orderCode, args, jsonObject.toJSONString());
return jsonObject;
}
... ... @@ -1216,7 +1257,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
private List<BuyerOrderResp> convertToResp(List<BuyerOrder> orderList, Map<String, BuyerOrderGoods> buyerGoodsMap,
Map<Integer, SellerOrder> sellerOrderMap, Map<Integer, SellerOrderGoods> sellerGoodsMap, Map<String, ExpressRecord> expressInfoMap,
Map<String, ExpressRecord> platformExpressRecordMap, Map<Integer, String> companyMap,Map<Integer, String> skupProductCodeMap ){
Map<String, ExpressRecord> platformExpressRecordMap, Map<Integer, String> companyMap,Map<Integer, String> skupProductCodeMap,Map<Long, QualityCheck> qualityCheckMap ){
List<BuyerOrderResp> respList = Lists.newArrayList();
for(BuyerOrder item : orderList) {
if(null == buyerGoodsMap.get(item.getOrderCode())) {
... ... @@ -1250,6 +1291,12 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
String companyName = companyMap.get(logisticsType);
resp.setPlatformWaybillCode(platformWaybillCode + "(" + companyName + ")");
}
if(qualityCheckMap!=null&&qualityCheckMap.get(Long.valueOf(item.getOrderCode()))!=null){
QualityCheck qualityCheck = qualityCheckMap.get(Long.valueOf(item.getOrderCode()));
resp.setQualityCheckType(qualityCheck.getType()==null?0:qualityCheck.getType().intValue());
resp.setQualityCheckStatus(qualityCheck.getStatus()==null?0:qualityCheck.getStatus().intValue());
}
respList.add(resp);
}
... ... @@ -1314,8 +1361,6 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
);
case 8:
return Lists.newArrayList(Constant.BUYER_ORDER_STATUS_PLATFORM_RECEIVE.getByteVal());
case 9:
return Lists.newArrayList(Constant.BUYER_ORDER_STATUS_JUDGE_PASS.getByteVal());
default:
return Lists.newArrayList();
}
... ...
... ... @@ -31,6 +31,7 @@ datasources:
- com.yoho.order.dal.ExpressRecordMapper
- com.yoho.order.dal.AreaMapper
- com.yoho.order.dal.OrderOperateRecordMapper
- com.yoho.order.dal.QualityCheckMapper
- com.yoho.order.dal.TradeBillsMapper
- com.yoho.order.dal.StoredSellerMapper
- com.yoho.order.dal.SellerWalletDetailMapper
... ...
... ... @@ -31,6 +31,7 @@ datasources:
- com.yoho.order.dal.ExpressRecordMapper
- com.yoho.order.dal.AreaMapper
- com.yoho.order.dal.OrderOperateRecordMapper
- com.yoho.order.dal.QualityCheckMapper
- com.yoho.order.dal.TradeBillsMapper
- com.yoho.order.dal.StoredSellerMapper
- com.yoho.order.dal.SellerWalletDetailMapper
... ...
... ... @@ -471,10 +471,10 @@ function getToBeReceiveListOrJudgedList(platformWaybillShowFlag,paramStatusStr,p
});
//瑕疵确认
$(this).datagrid("getPanel").find("a[role='minorFaultConfirm']").linkbutton({
$(this).datagrid("getPanel").find("a[role='miniFaultConfirm']").linkbutton({
onClick: function () {
var id = $(this).attr("dataId");
minorFaultConfirm(id);
miniFaultConfirm(id);
}
});
... ... @@ -642,7 +642,7 @@ function getTableColumn(platformWaybillShowFlag) {
}else{
operateButton += "<a role='qualityCheckPass' dataId='"+ rowData.id +"' style='margin-left:10px;background-color: #5cb85c !important;'>质检通过</a>";
operateButton += "<a role='qualityCheckNotPass' dataId='"+ rowData.id + "'" + " skup='"+rowData.skup +"' style='margin-left:10px;background-color: #d9534f !important; color: #fff !important;'>质检不通过</a>";
operateButton += "<a role='minorFaultConfirm' dataId='"+ rowData.id +"' style='margin-left:10px;background-color: #5bc0de !important;'>瑕疵确认</a>";
operateButton += "<a role='miniFaultConfirm' dataId='"+ rowData.id +"' style='margin-left:10px;background-color: #5bc0de !important;'>瑕疵确认</a>";
}
return operateButton ;
}else if (rowData.status == 3) {
... ... @@ -747,7 +747,7 @@ function qualityCheckNotPass(id) {
}
//瑕疵确认
function minorFaultConfirm(id) {
function miniFaultConfirm(id) {
}
... ...
... ... @@ -26,8 +26,8 @@
<li><a href="javascript:switchOrderStatus(1);">待买家付款(<span id="num_1"></span>)</a></li>
<li><a href="javascript:switchOrderStatus(2);">待卖家发货(<span id="num_2"></span>)</a></li>
<li><a href="javascript:switchOrderStatus(3);">卖家已发货(<span id="num_3"></span>)</a></li>
<li><a href="javascript:switchOrderStatus(4);">平台鉴定中(<span id="num_4"></span>)</a></li>
<li><a href="javascript:switchOrderStatus(8);">平台质检中(<span id="num_8"></span>)</a></li>
<li><a href="javascript:switchOrderStatus(4);">平台鉴定中(<span id="num_4"></span>)</a></li>
<li><a href="javascript:switchOrderStatus(5);">平台已发货(<span id="num_5"></span>)</a></li>
<li><a href="javascript:switchOrderStatus(6);">订单完成(<span id="num_6"></span>)</a></li>
<li><a href="javascript:switchOrderStatus(7);">已取消(<span id="num_7">)</span>)</a></li>
... ...