Commit 4d298b15 authored by shiyu's avatar shiyu

查询图录加上title

parent e8e0e590
...@@ -3,7 +3,9 @@ package com.wwdz.ch.admin.controller; ...@@ -3,7 +3,9 @@ package com.wwdz.ch.admin.controller;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.wwdz.ch.admin.service.SysIdentifyOrderService; import com.wwdz.ch.admin.service.SysIdentifyOrderService;
import com.wwdz.ch.core.type.Result; import com.wwdz.ch.core.type.Result;
import com.wwdz.ch.db.dto.request.ConsignSaleRequestDto; import com.wwdz.ch.db.dto.request.distribution.IdentifyOrderRequestDto;
import com.xxdxxs.service.FormHandler;
import com.xxdxxs.validation.Validator;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
...@@ -22,10 +24,83 @@ public class IdentifyOrderController { ...@@ -22,10 +24,83 @@ public class IdentifyOrderController {
@Autowired @Autowired
SysIdentifyOrderService sysIdentifyOrderService; SysIdentifyOrderService sysIdentifyOrderService;
@ApiOperation(value = "查询寄售单")
@ApiOperation(value = "查询鉴定单")
@PostMapping("/findList") @PostMapping("/findList")
public Result findList(@RequestBody ConsignSaleRequestDto dto) { public Result findList(@RequestBody IdentifyOrderRequestDto dto) {
return null; logger.info("审核鉴定单,请求参数:{}", JSON.toJSONString(dto));
Validator validator = new Validator(FormHandler.ofEntity(dto));
validator.set("distributionOrderId", "分销订单号").must().string()
.set("identifyOrderId", "鉴定单号").must().string()
.set("approved", "审核结果").must().number()
.end();
if (!validator.isValid()) {
return Result.failed(validator.getErrorInfo());
}
return sysIdentifyOrderService.identify(dto);
}
@ApiOperation(value = "审核鉴定单")
@PostMapping("/identify")
public Result identify(@RequestBody IdentifyOrderRequestDto dto) {
logger.info("审核鉴定单,请求参数:{}", JSON.toJSONString(dto));
Validator validator = new Validator(FormHandler.ofEntity(dto));
validator.set("distributionOrderId", "分销订单号").must().string()
.set("identifyOrderId", "鉴定单号").must().string()
.set("approved", "审核结果").must().number()
.end();
if (!validator.isValid()) {
return Result.failed(validator.getErrorInfo());
}
return sysIdentifyOrderService.identify(dto);
}
@ApiOperation(value = "鉴定单审核后发出")
@PostMapping("/delivery")
public Result delivery(@RequestBody IdentifyOrderRequestDto dto) {
logger.info("鉴定单审核后发出,请求参数:{}", JSON.toJSONString(dto));
Validator validator = new Validator(FormHandler.ofEntity(dto));
validator.set("distributionOrderId", "分销订单号").must().string()
.set("identifyOrderId", "鉴定单号").must().string()
.set("outLogisticsCode", "物流公司编码").must().string()
.set("outWaybill", "物流单号").must().string()
.end();
if (!validator.isValid()) {
return Result.failed(validator.getErrorInfo());
}
return sysIdentifyOrderService.delivery(dto);
} }
@ApiOperation(value = "鉴定单审核不通过后退回寄出")
@PostMapping("/sendBack")
public Result sendBack(@RequestBody IdentifyOrderRequestDto dto) {
logger.info("鉴定单审核不通过后退回寄出,请求参数:{}", JSON.toJSONString(dto));
Validator validator = new Validator(FormHandler.ofEntity(dto));
validator.set("distributionOrderId", "分销订单号").must().string()
.set("identifyOrderId", "鉴定单号").must().string()
.set("outLogisticsCode", "物流公司编码").must().string()
.set("outWaybill", "物流单号").must().string()
.end();
if (!validator.isValid()) {
return Result.failed(validator.getErrorInfo());
}
return sysIdentifyOrderService.sendBack(dto);
}
@ApiOperation(value = "平台确认收货")
@PostMapping("signed")
public Result signed(@RequestBody IdentifyOrderRequestDto dto) {
logger.info("平台确认收货,请求参数:{}", JSON.toJSONString(dto));
Validator validator = new Validator(FormHandler.ofEntity(dto));
validator.set("identifyOrderId", "鉴定单号").must().string()
.end();
if (!validator.isValid()) {
return Result.failed(validator.getErrorInfo());
}
return sysIdentifyOrderService.signed(dto);
}
} }
...@@ -4,6 +4,7 @@ import com.github.pagehelper.PageInfo; ...@@ -4,6 +4,7 @@ import com.github.pagehelper.PageInfo;
import com.wwdz.ch.admin.service.ImageCatelogDetailService; import com.wwdz.ch.admin.service.ImageCatelogDetailService;
import com.wwdz.ch.core.type.PageSearchResult; import com.wwdz.ch.core.type.PageSearchResult;
import com.wwdz.ch.core.type.Result; import com.wwdz.ch.core.type.Result;
import com.wwdz.ch.db.dao.distribution.ImageCatelogDao;
import com.wwdz.ch.db.dao.distribution.ImageCatelogDetailDao; import com.wwdz.ch.db.dao.distribution.ImageCatelogDetailDao;
import com.wwdz.ch.db.domain.distribution.ImageCatelog; import com.wwdz.ch.db.domain.distribution.ImageCatelog;
import com.wwdz.ch.db.domain.distribution.ImageCatelogDetail; import com.wwdz.ch.db.domain.distribution.ImageCatelogDetail;
...@@ -13,7 +14,9 @@ import org.slf4j.LoggerFactory; ...@@ -13,7 +14,9 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
@Service @Service
public class ImageCatelogDetailServiceImpl implements ImageCatelogDetailService { public class ImageCatelogDetailServiceImpl implements ImageCatelogDetailService {
...@@ -23,12 +26,20 @@ public class ImageCatelogDetailServiceImpl implements ImageCatelogDetailService ...@@ -23,12 +26,20 @@ public class ImageCatelogDetailServiceImpl implements ImageCatelogDetailService
@Autowired @Autowired
ImageCatelogDetailDao imageCatelogDetailDao; ImageCatelogDetailDao imageCatelogDetailDao;
@Autowired
ImageCatelogDao imageCatelogDao;
@Override @Override
public Result findDetailList(ImageCatelogRequestDto dto) { public Result findDetailList(ImageCatelogRequestDto dto) {
try { try {
dto.setOrder(" asc"); dto.setOrder(" asc");
List<ImageCatelogDetail> list = imageCatelogDetailDao.findList(dto); List<ImageCatelogDetail> list = imageCatelogDetailDao.findList(dto);
return Result.success(list); ImageCatelog imageCatelog = imageCatelogDao.findById(dto.getId());
Map<String, Object> map = new HashMap<>();
map.put("title", imageCatelog.getTitle());
map.put("name", imageCatelog.getName());
map.put("data", list);
return Result.success(map);
} catch (Exception e) { } catch (Exception e) {
logger.error("查询图录内容 error:{}", e); logger.error("查询图录内容 error:{}", e);
} }
......
package com.wwdz.ch.admin.impl; package com.wwdz.ch.admin.impl;
import com.wechat.pay.java.service.refund.model.Refund;
import com.wechat.pay.java.service.refund.model.Status;
import com.wwdz.ch.admin.service.SysIdentifyOrderService; import com.wwdz.ch.admin.service.SysIdentifyOrderService;
import com.wwdz.ch.core.api.wxpay.WxPayServiceApi;
import com.wwdz.ch.core.consts.CommConsts;
import com.wwdz.ch.core.consts.DistributionEnum; import com.wwdz.ch.core.consts.DistributionEnum;
import com.wwdz.ch.core.consts.RefundOrderEnum;
import com.wwdz.ch.core.entity.DeliveryNoticeMsg; import com.wwdz.ch.core.entity.DeliveryNoticeMsg;
import com.wwdz.ch.core.entity.wxPay.DistributionOrderRefundRequestDto;
import com.wwdz.ch.core.service.SendMsgService; import com.wwdz.ch.core.service.SendMsgService;
import com.wwdz.ch.core.type.Result; import com.wwdz.ch.core.type.Result;
import com.wwdz.ch.db.dao.distribution.DistributionOrderDao; import com.wwdz.ch.core.util.IdUtils;
import com.wwdz.ch.db.dao.distribution.DistributorProfitDao; import com.wwdz.ch.core.util.RedisUtils;
import com.wwdz.ch.db.dao.distribution.IdentifyOrderDao; import com.wwdz.ch.db.dao.distribution.*;
import com.wwdz.ch.db.dao.distribution.SupplierItemDao;
import com.wwdz.ch.db.domain.distribution.DistributionOrder; import com.wwdz.ch.db.domain.distribution.DistributionOrder;
import com.wwdz.ch.db.domain.distribution.IdentifyOrder; import com.wwdz.ch.db.domain.distribution.IdentifyOrder;
import com.wwdz.ch.db.domain.distribution.RefundOrder;
import com.wwdz.ch.db.domain.distribution.SupplierItem; import com.wwdz.ch.db.domain.distribution.SupplierItem;
import com.wwdz.ch.db.dto.request.distribution.DistributionOrderRequestDto;
import com.wwdz.ch.db.dto.request.distribution.IdentifyOrderRequestDto; import com.wwdz.ch.db.dto.request.distribution.IdentifyOrderRequestDto;
import com.wwdz.ch.wx.service.distribution.DistributionOrderService;
import org.redisson.api.RLock;
import org.redisson.api.RedissonClient;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -21,6 +31,7 @@ import org.springframework.transaction.annotation.Transactional; ...@@ -21,6 +31,7 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport; import org.springframework.transaction.interceptor.TransactionAspectSupport;
import java.util.Date; import java.util.Date;
import java.util.concurrent.TimeUnit;
@Service @Service
public class SysIdentifyOrderServiceImpl implements SysIdentifyOrderService { public class SysIdentifyOrderServiceImpl implements SysIdentifyOrderService {
...@@ -42,6 +53,15 @@ public class SysIdentifyOrderServiceImpl implements SysIdentifyOrderService { ...@@ -42,6 +53,15 @@ public class SysIdentifyOrderServiceImpl implements SysIdentifyOrderService {
@Autowired @Autowired
SendMsgService sendMsgService; SendMsgService sendMsgService;
@Autowired
WxPayServiceApi wxPayServiceApi;
@Autowired
RefundOrderDao refundOrderDao;
@Autowired
RedissonClient redissonClient;
@Override @Override
@Transactional @Transactional
public Result identify(IdentifyOrderRequestDto dto) { public Result identify(IdentifyOrderRequestDto dto) {
...@@ -56,9 +76,13 @@ public class SysIdentifyOrderServiceImpl implements SysIdentifyOrderService { ...@@ -56,9 +76,13 @@ public class SysIdentifyOrderServiceImpl implements SysIdentifyOrderService {
identifyOrder.setState(DistributionEnum.IdentifyOrderStateEnum.CHANNEL_WAIT_RETURN.getCode()); identifyOrder.setState(DistributionEnum.IdentifyOrderStateEnum.CHANNEL_WAIT_RETURN.getCode());
identifyOrder.setRemark(dto.getRemark()); identifyOrder.setRemark(dto.getRemark());
//藏馆订单状态修改为已取消 //藏馆订单取消并退款
DistributionOrderRequestDto distributionOrderRequestDto = new DistributionOrderRequestDto();
distributionOrderRequestDto.setDistributionOrderId(dto.getDistributionOrderId());
refund(distributionOrderRequestDto);
/*
distributionOrderDao.updateState(dto.getDistributionOrderId(), DistributionEnum.DistributionOrderStateEnum.CANCEL.getCode()); distributionOrderDao.updateState(dto.getDistributionOrderId(), DistributionEnum.DistributionOrderStateEnum.CANCEL.getCode());
distributorProfitDao.updateValidState(dto.getDistributionOrderId(), false); distributorProfitDao.updateValidState(dto.getDistributionOrderId(), false);*/
} }
identifyOrder.setUpdateTime(new Date()); identifyOrder.setUpdateTime(new Date());
identifyOrderDao.update(identifyOrder); identifyOrderDao.update(identifyOrder);
...@@ -86,6 +110,13 @@ public class SysIdentifyOrderServiceImpl implements SysIdentifyOrderService { ...@@ -86,6 +110,13 @@ public class SysIdentifyOrderServiceImpl implements SysIdentifyOrderService {
orderUpdateDto.setDeliveryTime(now); orderUpdateDto.setDeliveryTime(now);
orderUpdateDto.setState(DistributionEnum.DistributionOrderStateEnum.PRE_SIGNED.getCode()); orderUpdateDto.setState(DistributionEnum.DistributionOrderStateEnum.PRE_SIGNED.getCode());
distributionOrderDao.update(orderUpdateDto); distributionOrderDao.update(orderUpdateDto);
//修改鉴定单状态
IdentifyOrder identifyOrder = new IdentifyOrder();
identifyOrder.setIdentifyOrderId(dto.getIdentifyOrderId());
identifyOrder.setState(DistributionEnum.IdentifyOrderStateEnum.CHANNEL_SENDED.getCode());
identifyOrder.setOutLogisticsCode(dto.getOutLogisticsCode());
identifyOrder.setOutWaybill(dto.getOutWaybill());
identifyOrderDao.update(identifyOrder);
//发货成功,发送模板信息通知买家 //发货成功,发送模板信息通知买家
try { try {
DeliveryNoticeMsg deliveryNoticeMsg = new DeliveryNoticeMsg(); DeliveryNoticeMsg deliveryNoticeMsg = new DeliveryNoticeMsg();
...@@ -115,7 +146,95 @@ public class SysIdentifyOrderServiceImpl implements SysIdentifyOrderService { ...@@ -115,7 +146,95 @@ public class SysIdentifyOrderServiceImpl implements SysIdentifyOrderService {
} }
@Override @Override
@Transactional
public Result sendBack(IdentifyOrderRequestDto dto) { public Result sendBack(IdentifyOrderRequestDto dto) {
return null; try {
//修改鉴定单状态
IdentifyOrder identifyOrder = new IdentifyOrder();
identifyOrder.setIdentifyOrderId(dto.getIdentifyOrderId());
identifyOrder.setState(DistributionEnum.IdentifyOrderStateEnum.CHANNEL_SENDED.getCode());
identifyOrder.setOutLogisticsCode(dto.getOutLogisticsCode());
identifyOrder.setOutWaybill(dto.getOutWaybill());
identifyOrderDao.update(identifyOrder);
return Result.success();
} catch (Exception e) {
logger.info("审核不通过退回商品失败 error: {}", e);
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
}
return Result.failed();
}
@Override
public Result signed(IdentifyOrderRequestDto dto) {
try {
//修改鉴定单状态
identifyOrderDao.updateState(dto.getIdentifyOrderId(), DistributionEnum.IdentifyOrderStateEnum.CHANNEL_IDENTIFYING.getCode());
return Result.success();
} catch (Exception e) {
logger.info("平台确认收货失败 error: {}", e);
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
}
return Result.failed();
}
@Override
public Result refund(DistributionOrderRequestDto dto) throws InterruptedException {
RLock lock = null;
try {
String refundId = IdUtils.getOrderNumber(CommConsts.REFUND_ORDER_PREFIX);
//判断订单状态
String distributionOrderId = dto.getDistributionOrderId();
DistributionOrder distributionOrder = distributionOrderDao.findById(distributionOrderId);
DistributionOrderRefundRequestDto refundRequestDto = new DistributionOrderRefundRequestDto();
refundRequestDto.setDistributionOrderId(distributionOrderId);
refundRequestDto.setRefundPrice(distributionOrder.getAmount());
refundRequestDto.setAmount(distributionOrder.getAmount());
refundRequestDto.setRefundId(refundId);
Result result = wxPayServiceApi.orderRefund(refundRequestDto);
if (!result.getSuccess()) {
throw new InterruptedException("调用微信支付退款接口错误");
}
Refund refundResponse = (Refund) result.getData();
if (refundResponse.getStatus().equals(Status.SUCCESS) || refundResponse.getStatus().equals(Status.PROCESSING)) {
Date now = new Date();
//创建退款单
RefundOrder refundOrder = new RefundOrder();
refundOrder.setRefundId(refundId);
refundOrder.setRefundAmount(distributionOrder.getAmount());
refundOrder.setAmount(distributionOrder.getAmount());
refundOrder.setDistributionOrderId(distributionOrderId);
refundOrder.setDistributorId(distributionOrder.getSellerId());
refundOrder.setCreateTime(now);
refundOrder.setUpdateTime(now);
refundOrder.setState(RefundOrderEnum.StateEnum.PROCESSING.getCode());
refundOrderDao.insert(refundOrder);
//退款受理成功,订单的状态改为退款受理中
distributionOrderDao.updateState(distributionOrderId, DistributionEnum.DistributionOrderStateEnum.REFUNDING.getCode());
//恢复商品库存
long itemId = distributionOrder.getItemId();
String itemIdKey = String.valueOf(itemId);
lock = redissonClient.getLock(itemIdKey);
if (lock.tryLock(5, 5, TimeUnit.SECONDS)) {
SupplierItem supplierItem = supplierItemDao.findById(itemId);
int updateStock = supplierItem.getStock().intValue() + distributionOrder.getItemNum().intValue();
supplierItemDao.updateStock(itemId, updateStock);
} else {
logger.error(">>>>>>>>> 未能获取到锁,退款后恢复库存失败 <<<<<<<<<<");
return Result.failed("退款后恢复库存失败");
}
logger.info(">>>>>>>> 藏馆单号:{}, 退款单号:{}, 退款申请成功,创建退款单 <<<<<<<<<", distributionOrderId, refundId);
return Result.success(refundId);
}
} catch (Exception e) {
logger.error("退款申请失败 error : {}", e);
throw e;
} finally {
if (lock != null && lock.isHeldByCurrentThread()) {
lock.unlock();
}
}
return Result.failed();
} }
} }
package com.wwdz.ch.admin.service; package com.wwdz.ch.admin.service;
import com.wwdz.ch.core.type.Result; import com.wwdz.ch.core.type.Result;
import com.wwdz.ch.db.dto.request.distribution.DistributionOrderRequestDto;
import com.wwdz.ch.db.dto.request.distribution.IdentifyOrderRequestDto; import com.wwdz.ch.db.dto.request.distribution.IdentifyOrderRequestDto;
public interface SysIdentifyOrderService { public interface SysIdentifyOrderService {
...@@ -26,4 +27,18 @@ public interface SysIdentifyOrderService { ...@@ -26,4 +27,18 @@ public interface SysIdentifyOrderService {
* @return * @return
*/ */
Result sendBack(IdentifyOrderRequestDto dto); Result sendBack(IdentifyOrderRequestDto dto);
/**
* 平台确认收货
* @param dto
* @return
*/
Result signed(IdentifyOrderRequestDto dto);
/**
* 订单取消并退款
* @param dto
* @return
*/
Result refund(DistributionOrderRequestDto dto) throws InterruptedException;
} }
...@@ -56,5 +56,5 @@ public interface CommConsts { ...@@ -56,5 +56,5 @@ public interface CommConsts {
public static final String DEFAULT_BACKGROUND_URL = "https://cdn.wanwudezhi.com/static/web-static/image/1c679aa4e27789e491c070d52577efb1_1125x480.png"; public static final String DEFAULT_BACKGROUND_URL = "https://cdn.wanwudezhi.com/static/web-static/image/1c679aa4e27789e491c070d52577efb1_1125x480.png";
public final static String REFUND_ORDER_PREFIX = "RF";
} }
...@@ -271,12 +271,13 @@ public class DistributionEnum { ...@@ -271,12 +271,13 @@ public class DistributionEnum {
* 鉴定单状态 * 鉴定单状态
*/ */
public enum IdentifyOrderStateEnum { public enum IdentifyOrderStateEnum {
CHANNEL_WAIT_RECEIVE(12, "平台待收货"), CHANNEL_WAIT_RECEIVE(12, "待平台收货"),
CHANNEL_IDENTIFYING(13, "平台鉴定中"), CHANNEL_IDENTIFYING(13, "平台鉴定中"),
CHANNEL_WAIT_SEND(14, "平台待发货"), CHANNEL_WAIT_SEND(14, "待平台发货"),
CHANNEL_WAIT_RETURN(15, "平台待退回"), CHANNEL_WAIT_RETURN(15, "待平台退回"),
CHANNEL_SENDED(16, "平台已发货"), CHANNEL_SENDED(16, "平台已发货"),
CHANNEL_RETURNED(17, "平台已退回"), CHANNEL_RETURNED(17, "退回待收货"),
RETURN_SIGNED(18, "退回已收货"),
; ;
private int code; private int code;
......
package com.wwdz.ch.db.domain.distribution; package com.wwdz.ch.db.domain.distribution;
import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Date; import java.util.Date;
import com.xxdxxs.entity.Entity; import com.xxdxxs.entity.Entity;
import lombok.Data; import lombok.Data;
/** /**
* @author shiyu * @author shiyu
* @date 2024/05/08 * @date 2024/05/09
*/ */
@Data @Data
public class IdentifyOrder implements Entity { public class IdentifyOrder implements Entity {
private Integer id; private Integer id;
/** /**
...@@ -25,11 +26,21 @@ public class IdentifyOrder implements Entity { ...@@ -25,11 +26,21 @@ public class IdentifyOrder implements Entity {
*/ */
private String identifyOrderId; private String identifyOrderId;
/**
* 卖方id
*/
private Long sellerId;
/** /**
* 商品id * 商品id
*/ */
private Long itemId; private Long itemId;
/**
* 商品数量
*/
private Integer itemNum;
/** /**
* 寄来的快递公司编码 * 寄来的快递公司编码
*/ */
...@@ -47,8 +58,6 @@ public class IdentifyOrder implements Entity { ...@@ -47,8 +58,6 @@ public class IdentifyOrder implements Entity {
/** /**
* 审核结果 * 审核结果
* 0不通过
* 1通过
*/ */
private Integer approved; private Integer approved;
...@@ -103,7 +112,9 @@ public class IdentifyOrder implements Entity { ...@@ -103,7 +112,9 @@ public class IdentifyOrder implements Entity {
sb.append(", id=").append(id); sb.append(", id=").append(id);
sb.append(", distributionOrderId=").append(distributionOrderId); sb.append(", distributionOrderId=").append(distributionOrderId);
sb.append(", identifyOrderId=").append(identifyOrderId); sb.append(", identifyOrderId=").append(identifyOrderId);
sb.append(", sellerId=").append(sellerId);
sb.append(", itemId=").append(itemId); sb.append(", itemId=").append(itemId);
sb.append(", itemNum=").append(itemNum);
sb.append(", fromLogisticsCode=").append(fromLogisticsCode); sb.append(", fromLogisticsCode=").append(fromLogisticsCode);
sb.append(", fromWaybill=").append(fromWaybill); sb.append(", fromWaybill=").append(fromWaybill);
sb.append(", state=").append(state); sb.append(", state=").append(state);
...@@ -136,7 +147,9 @@ public class IdentifyOrder implements Entity { ...@@ -136,7 +147,9 @@ public class IdentifyOrder implements Entity {
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getDistributionOrderId() == null ? other.getDistributionOrderId() == null : this.getDistributionOrderId().equals(other.getDistributionOrderId())) && (this.getDistributionOrderId() == null ? other.getDistributionOrderId() == null : this.getDistributionOrderId().equals(other.getDistributionOrderId()))
&& (this.getIdentifyOrderId() == null ? other.getIdentifyOrderId() == null : this.getIdentifyOrderId().equals(other.getIdentifyOrderId())) && (this.getIdentifyOrderId() == null ? other.getIdentifyOrderId() == null : this.getIdentifyOrderId().equals(other.getIdentifyOrderId()))
&& (this.getSellerId() == null ? other.getSellerId() == null : this.getSellerId().equals(other.getSellerId()))
&& (this.getItemId() == null ? other.getItemId() == null : this.getItemId().equals(other.getItemId())) && (this.getItemId() == null ? other.getItemId() == null : this.getItemId().equals(other.getItemId()))
&& (this.getItemNum() == null ? other.getItemNum() == null : this.getItemNum().equals(other.getItemNum()))
&& (this.getFromLogisticsCode() == null ? other.getFromLogisticsCode() == null : this.getFromLogisticsCode().equals(other.getFromLogisticsCode())) && (this.getFromLogisticsCode() == null ? other.getFromLogisticsCode() == null : this.getFromLogisticsCode().equals(other.getFromLogisticsCode()))
&& (this.getFromWaybill() == null ? other.getFromWaybill() == null : this.getFromWaybill().equals(other.getFromWaybill())) && (this.getFromWaybill() == null ? other.getFromWaybill() == null : this.getFromWaybill().equals(other.getFromWaybill()))
&& (this.getState() == null ? other.getState() == null : this.getState().equals(other.getState())) && (this.getState() == null ? other.getState() == null : this.getState().equals(other.getState()))
...@@ -158,7 +171,9 @@ public class IdentifyOrder implements Entity { ...@@ -158,7 +171,9 @@ public class IdentifyOrder implements Entity {
result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getDistributionOrderId() == null) ? 0 : getDistributionOrderId().hashCode()); result = prime * result + ((getDistributionOrderId() == null) ? 0 : getDistributionOrderId().hashCode());
result = prime * result + ((getIdentifyOrderId() == null) ? 0 : getIdentifyOrderId().hashCode()); result = prime * result + ((getIdentifyOrderId() == null) ? 0 : getIdentifyOrderId().hashCode());
result = prime * result + ((getSellerId() == null) ? 0 : getSellerId().hashCode());
result = prime * result + ((getItemId() == null) ? 0 : getItemId().hashCode()); result = prime * result + ((getItemId() == null) ? 0 : getItemId().hashCode());
result = prime * result + ((getItemNum() == null) ? 0 : getItemNum().hashCode());
result = prime * result + ((getFromLogisticsCode() == null) ? 0 : getFromLogisticsCode().hashCode()); result = prime * result + ((getFromLogisticsCode() == null) ? 0 : getFromLogisticsCode().hashCode());
result = prime * result + ((getFromWaybill() == null) ? 0 : getFromWaybill().hashCode()); result = prime * result + ((getFromWaybill() == null) ? 0 : getFromWaybill().hashCode());
result = prime * result + ((getState() == null) ? 0 : getState().hashCode()); result = prime * result + ((getState() == null) ? 0 : getState().hashCode());
...@@ -185,7 +200,9 @@ public class IdentifyOrder implements Entity { ...@@ -185,7 +200,9 @@ public class IdentifyOrder implements Entity {
id("id", "id", "INTEGER", false), id("id", "id", "INTEGER", false),
distributionOrderId("distribution_order_id", "distributionOrderId", "VARCHAR", false), distributionOrderId("distribution_order_id", "distributionOrderId", "VARCHAR", false),
identifyOrderId("identify_order_id", "identifyOrderId", "VARCHAR", false), identifyOrderId("identify_order_id", "identifyOrderId", "VARCHAR", false),
sellerId("seller_id", "sellerId", "BIGINT", false),
itemId("item_id", "itemId", "BIGINT", false), itemId("item_id", "itemId", "BIGINT", false),
itemNum("item_num", "itemNum", "INTEGER", false),
fromLogisticsCode("from_logistics_code", "fromLogisticsCode", "VARCHAR", false), fromLogisticsCode("from_logistics_code", "fromLogisticsCode", "VARCHAR", false),
fromWaybill("from_waybill", "fromWaybill", "VARCHAR", false), fromWaybill("from_waybill", "fromWaybill", "VARCHAR", false),
state("state", "state", "INTEGER", true), state("state", "state", "INTEGER", true),
......
...@@ -564,6 +564,138 @@ public class IdentifyOrderExample { ...@@ -564,6 +564,138 @@ public class IdentifyOrderExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andSellerIdIsNull() {
addCriterion("seller_id is null");
return (Criteria) this;
}
public Criteria andSellerIdIsNotNull() {
addCriterion("seller_id is not null");
return (Criteria) this;
}
public Criteria andSellerIdEqualTo(Long value) {
addCriterion("seller_id =", value, "sellerId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table identify_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andSellerIdEqualToColumn(IdentifyOrder.Column column) {
addCriterion(new StringBuilder("seller_id = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andSellerIdNotEqualTo(Long value) {
addCriterion("seller_id <>", value, "sellerId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table identify_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andSellerIdNotEqualToColumn(IdentifyOrder.Column column) {
addCriterion(new StringBuilder("seller_id <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andSellerIdGreaterThan(Long value) {
addCriterion("seller_id >", value, "sellerId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table identify_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andSellerIdGreaterThanColumn(IdentifyOrder.Column column) {
addCriterion(new StringBuilder("seller_id > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andSellerIdGreaterThanOrEqualTo(Long value) {
addCriterion("seller_id >=", value, "sellerId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table identify_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andSellerIdGreaterThanOrEqualToColumn(IdentifyOrder.Column column) {
addCriterion(new StringBuilder("seller_id >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andSellerIdLessThan(Long value) {
addCriterion("seller_id <", value, "sellerId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table identify_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andSellerIdLessThanColumn(IdentifyOrder.Column column) {
addCriterion(new StringBuilder("seller_id < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andSellerIdLessThanOrEqualTo(Long value) {
addCriterion("seller_id <=", value, "sellerId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table identify_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andSellerIdLessThanOrEqualToColumn(IdentifyOrder.Column column) {
addCriterion(new StringBuilder("seller_id <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andSellerIdIn(List<Long> values) {
addCriterion("seller_id in", values, "sellerId");
return (Criteria) this;
}
public Criteria andSellerIdNotIn(List<Long> values) {
addCriterion("seller_id not in", values, "sellerId");
return (Criteria) this;
}
public Criteria andSellerIdBetween(Long value1, Long value2) {
addCriterion("seller_id between", value1, value2, "sellerId");
return (Criteria) this;
}
public Criteria andSellerIdNotBetween(Long value1, Long value2) {
addCriterion("seller_id not between", value1, value2, "sellerId");
return (Criteria) this;
}
public Criteria andItemIdIsNull() { public Criteria andItemIdIsNull() {
addCriterion("item_id is null"); addCriterion("item_id is null");
return (Criteria) this; return (Criteria) this;
...@@ -696,6 +828,138 @@ public class IdentifyOrderExample { ...@@ -696,6 +828,138 @@ public class IdentifyOrderExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andItemNumIsNull() {
addCriterion("item_num is null");
return (Criteria) this;
}
public Criteria andItemNumIsNotNull() {
addCriterion("item_num is not null");
return (Criteria) this;
}
public Criteria andItemNumEqualTo(Integer value) {
addCriterion("item_num =", value, "itemNum");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table identify_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andItemNumEqualToColumn(IdentifyOrder.Column column) {
addCriterion(new StringBuilder("item_num = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andItemNumNotEqualTo(Integer value) {
addCriterion("item_num <>", value, "itemNum");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table identify_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andItemNumNotEqualToColumn(IdentifyOrder.Column column) {
addCriterion(new StringBuilder("item_num <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andItemNumGreaterThan(Integer value) {
addCriterion("item_num >", value, "itemNum");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table identify_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andItemNumGreaterThanColumn(IdentifyOrder.Column column) {
addCriterion(new StringBuilder("item_num > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andItemNumGreaterThanOrEqualTo(Integer value) {
addCriterion("item_num >=", value, "itemNum");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table identify_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andItemNumGreaterThanOrEqualToColumn(IdentifyOrder.Column column) {
addCriterion(new StringBuilder("item_num >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andItemNumLessThan(Integer value) {
addCriterion("item_num <", value, "itemNum");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table identify_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andItemNumLessThanColumn(IdentifyOrder.Column column) {
addCriterion(new StringBuilder("item_num < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andItemNumLessThanOrEqualTo(Integer value) {
addCriterion("item_num <=", value, "itemNum");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table identify_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andItemNumLessThanOrEqualToColumn(IdentifyOrder.Column column) {
addCriterion(new StringBuilder("item_num <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andItemNumIn(List<Integer> values) {
addCriterion("item_num in", values, "itemNum");
return (Criteria) this;
}
public Criteria andItemNumNotIn(List<Integer> values) {
addCriterion("item_num not in", values, "itemNum");
return (Criteria) this;
}
public Criteria andItemNumBetween(Integer value1, Integer value2) {
addCriterion("item_num between", value1, value2, "itemNum");
return (Criteria) this;
}
public Criteria andItemNumNotBetween(Integer value1, Integer value2) {
addCriterion("item_num not between", value1, value2, "itemNum");
return (Criteria) this;
}
public Criteria andFromLogisticsCodeIsNull() { public Criteria andFromLogisticsCodeIsNull() {
addCriterion("from_logistics_code is null"); addCriterion("from_logistics_code is null");
return (Criteria) this; return (Criteria) this;
......
...@@ -21,11 +21,21 @@ public class IdentifyOrderRequestDto extends BaseRequestDto implements Entity { ...@@ -21,11 +21,21 @@ public class IdentifyOrderRequestDto extends BaseRequestDto implements Entity {
*/ */
private String identifyOrderId; private String identifyOrderId;
/**
* 卖方id
*/
private Long sellerId;
/** /**
* 商品id * 商品id
*/ */
private Long itemId; private Long itemId;
/**
* 商品数量
*/
private Integer itemNum;
/** /**
* 寄来的快递公司编码 * 寄来的快递公司编码
*/ */
......
...@@ -5,7 +5,9 @@ ...@@ -5,7 +5,9 @@
<id column="id" jdbcType="INTEGER" property="id" /> <id column="id" jdbcType="INTEGER" property="id" />
<result column="distribution_order_id" jdbcType="VARCHAR" property="distributionOrderId" /> <result column="distribution_order_id" jdbcType="VARCHAR" property="distributionOrderId" />
<result column="identify_order_id" jdbcType="VARCHAR" property="identifyOrderId" /> <result column="identify_order_id" jdbcType="VARCHAR" property="identifyOrderId" />
<result column="seller_id" jdbcType="BIGINT" property="sellerId" />
<result column="item_id" jdbcType="BIGINT" property="itemId" /> <result column="item_id" jdbcType="BIGINT" property="itemId" />
<result column="item_num" jdbcType="INTEGER" property="itemNum" />
<result column="from_logistics_code" jdbcType="VARCHAR" property="fromLogisticsCode" /> <result column="from_logistics_code" jdbcType="VARCHAR" property="fromLogisticsCode" />
<result column="from_waybill" jdbcType="VARCHAR" property="fromWaybill" /> <result column="from_waybill" jdbcType="VARCHAR" property="fromWaybill" />
<result column="state" jdbcType="INTEGER" property="state" /> <result column="state" jdbcType="INTEGER" property="state" />
...@@ -78,9 +80,9 @@ ...@@ -78,9 +80,9 @@
</where> </where>
</sql> </sql>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, distribution_order_id, identify_order_id, item_id, from_logistics_code, from_waybill, id, distribution_order_id, identify_order_id, seller_id, item_id, item_num, from_logistics_code,
`state`, approved, remark, out_logistics_code, out_waybill, return_name, return_phone, from_waybill, `state`, approved, remark, out_logistics_code, out_waybill, return_name,
return_address, create_time, update_time return_phone, return_address, create_time, update_time
</sql> </sql>
<select id="selectByExample" parameterType="com.wwdz.ch.db.domain.distribution.IdentifyOrderExample" resultMap="BaseResultMap"> <select id="selectByExample" parameterType="com.wwdz.ch.db.domain.distribution.IdentifyOrderExample" resultMap="BaseResultMap">
select select
...@@ -115,9 +117,9 @@ ...@@ -115,9 +117,9 @@
</foreach> </foreach>
</when> </when>
<otherwise> <otherwise>
id, distribution_order_id, identify_order_id, item_id, from_logistics_code, from_waybill, id, distribution_order_id, identify_order_id, seller_id, item_id, item_num, from_logistics_code,
`state`, approved, remark, out_logistics_code, out_waybill, return_name, return_phone, from_waybill, `state`, approved, remark, out_logistics_code, out_waybill, return_name,
return_address, create_time, update_time return_phone, return_address, create_time, update_time
</otherwise> </otherwise>
</choose> </choose>
from identify_order from identify_order
...@@ -148,9 +150,9 @@ ...@@ -148,9 +150,9 @@
</foreach> </foreach>
</when> </when>
<otherwise> <otherwise>
id, distribution_order_id, identify_order_id, item_id, from_logistics_code, from_waybill, id, distribution_order_id, identify_order_id, seller_id, item_id, item_num, from_logistics_code,
`state`, approved, remark, out_logistics_code, out_waybill, return_name, return_phone, from_waybill, `state`, approved, remark, out_logistics_code, out_waybill, return_name,
return_address, create_time, update_time return_phone, return_address, create_time, update_time
</otherwise> </otherwise>
</choose> </choose>
from identify_order from identify_order
...@@ -171,17 +173,19 @@ ...@@ -171,17 +173,19 @@
SELECT LAST_INSERT_ID() SELECT LAST_INSERT_ID()
</selectKey> </selectKey>
insert into identify_order (distribution_order_id, identify_order_id, insert into identify_order (distribution_order_id, identify_order_id,
item_id, from_logistics_code, from_waybill, seller_id, item_id, item_num,
`state`, approved, remark, from_logistics_code, from_waybill, `state`,
out_logistics_code, out_waybill, return_name, approved, remark, out_logistics_code,
return_phone, return_address, create_time, out_waybill, return_name, return_phone,
update_time) return_address, create_time, update_time
)
values (#{distributionOrderId,jdbcType=VARCHAR}, #{identifyOrderId,jdbcType=VARCHAR}, values (#{distributionOrderId,jdbcType=VARCHAR}, #{identifyOrderId,jdbcType=VARCHAR},
#{itemId,jdbcType=BIGINT}, #{fromLogisticsCode,jdbcType=VARCHAR}, #{fromWaybill,jdbcType=VARCHAR}, #{sellerId,jdbcType=BIGINT}, #{itemId,jdbcType=BIGINT}, #{itemNum,jdbcType=INTEGER},
#{state,jdbcType=INTEGER}, #{approved,jdbcType=INTEGER}, #{remark,jdbcType=VARCHAR}, #{fromLogisticsCode,jdbcType=VARCHAR}, #{fromWaybill,jdbcType=VARCHAR}, #{state,jdbcType=INTEGER},
#{outLogisticsCode,jdbcType=VARCHAR}, #{outWaybill,jdbcType=VARCHAR}, #{returnName,jdbcType=VARCHAR}, #{approved,jdbcType=INTEGER}, #{remark,jdbcType=VARCHAR}, #{outLogisticsCode,jdbcType=VARCHAR},
#{returnPhone,jdbcType=VARCHAR}, #{returnAddress,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{outWaybill,jdbcType=VARCHAR}, #{returnName,jdbcType=VARCHAR}, #{returnPhone,jdbcType=VARCHAR},
#{updateTime,jdbcType=TIMESTAMP}) #{returnAddress,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
)
</insert> </insert>
<insert id="insertSelective" parameterType="com.wwdz.ch.db.domain.distribution.IdentifyOrder"> <insert id="insertSelective" parameterType="com.wwdz.ch.db.domain.distribution.IdentifyOrder">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer"> <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
...@@ -195,9 +199,15 @@ ...@@ -195,9 +199,15 @@
<if test="identifyOrderId != null"> <if test="identifyOrderId != null">
identify_order_id, identify_order_id,
</if> </if>
<if test="sellerId != null">
seller_id,
</if>
<if test="itemId != null"> <if test="itemId != null">
item_id, item_id,
</if> </if>
<if test="itemNum != null">
item_num,
</if>
<if test="fromLogisticsCode != null"> <if test="fromLogisticsCode != null">
from_logistics_code, from_logistics_code,
</if> </if>
...@@ -242,9 +252,15 @@ ...@@ -242,9 +252,15 @@
<if test="identifyOrderId != null"> <if test="identifyOrderId != null">
#{identifyOrderId,jdbcType=VARCHAR}, #{identifyOrderId,jdbcType=VARCHAR},
</if> </if>
<if test="sellerId != null">
#{sellerId,jdbcType=BIGINT},
</if>
<if test="itemId != null"> <if test="itemId != null">
#{itemId,jdbcType=BIGINT}, #{itemId,jdbcType=BIGINT},
</if> </if>
<if test="itemNum != null">
#{itemNum,jdbcType=INTEGER},
</if>
<if test="fromLogisticsCode != null"> <if test="fromLogisticsCode != null">
#{fromLogisticsCode,jdbcType=VARCHAR}, #{fromLogisticsCode,jdbcType=VARCHAR},
</if> </if>
...@@ -301,9 +317,15 @@ ...@@ -301,9 +317,15 @@
<if test="record.identifyOrderId != null"> <if test="record.identifyOrderId != null">
identify_order_id = #{record.identifyOrderId,jdbcType=VARCHAR}, identify_order_id = #{record.identifyOrderId,jdbcType=VARCHAR},
</if> </if>
<if test="record.sellerId != null">
seller_id = #{record.sellerId,jdbcType=BIGINT},
</if>
<if test="record.itemId != null"> <if test="record.itemId != null">
item_id = #{record.itemId,jdbcType=BIGINT}, item_id = #{record.itemId,jdbcType=BIGINT},
</if> </if>
<if test="record.itemNum != null">
item_num = #{record.itemNum,jdbcType=INTEGER},
</if>
<if test="record.fromLogisticsCode != null"> <if test="record.fromLogisticsCode != null">
from_logistics_code = #{record.fromLogisticsCode,jdbcType=VARCHAR}, from_logistics_code = #{record.fromLogisticsCode,jdbcType=VARCHAR},
</if> </if>
...@@ -350,7 +372,9 @@ ...@@ -350,7 +372,9 @@
set id = #{record.id,jdbcType=INTEGER}, set id = #{record.id,jdbcType=INTEGER},
distribution_order_id = #{record.distributionOrderId,jdbcType=VARCHAR}, distribution_order_id = #{record.distributionOrderId,jdbcType=VARCHAR},
identify_order_id = #{record.identifyOrderId,jdbcType=VARCHAR}, identify_order_id = #{record.identifyOrderId,jdbcType=VARCHAR},
seller_id = #{record.sellerId,jdbcType=BIGINT},
item_id = #{record.itemId,jdbcType=BIGINT}, item_id = #{record.itemId,jdbcType=BIGINT},
item_num = #{record.itemNum,jdbcType=INTEGER},
from_logistics_code = #{record.fromLogisticsCode,jdbcType=VARCHAR}, from_logistics_code = #{record.fromLogisticsCode,jdbcType=VARCHAR},
from_waybill = #{record.fromWaybill,jdbcType=VARCHAR}, from_waybill = #{record.fromWaybill,jdbcType=VARCHAR},
`state` = #{record.state,jdbcType=INTEGER}, `state` = #{record.state,jdbcType=INTEGER},
...@@ -376,9 +400,15 @@ ...@@ -376,9 +400,15 @@
<if test="identifyOrderId != null"> <if test="identifyOrderId != null">
identify_order_id = #{identifyOrderId,jdbcType=VARCHAR}, identify_order_id = #{identifyOrderId,jdbcType=VARCHAR},
</if> </if>
<if test="sellerId != null">
seller_id = #{sellerId,jdbcType=BIGINT},
</if>
<if test="itemId != null"> <if test="itemId != null">
item_id = #{itemId,jdbcType=BIGINT}, item_id = #{itemId,jdbcType=BIGINT},
</if> </if>
<if test="itemNum != null">
item_num = #{itemNum,jdbcType=INTEGER},
</if>
<if test="fromLogisticsCode != null"> <if test="fromLogisticsCode != null">
from_logistics_code = #{fromLogisticsCode,jdbcType=VARCHAR}, from_logistics_code = #{fromLogisticsCode,jdbcType=VARCHAR},
</if> </if>
...@@ -422,7 +452,9 @@ ...@@ -422,7 +452,9 @@
update identify_order update identify_order
set distribution_order_id = #{distributionOrderId,jdbcType=VARCHAR}, set distribution_order_id = #{distributionOrderId,jdbcType=VARCHAR},
identify_order_id = #{identifyOrderId,jdbcType=VARCHAR}, identify_order_id = #{identifyOrderId,jdbcType=VARCHAR},
seller_id = #{sellerId,jdbcType=BIGINT},
item_id = #{itemId,jdbcType=BIGINT}, item_id = #{itemId,jdbcType=BIGINT},
item_num = #{itemNum,jdbcType=INTEGER},
from_logistics_code = #{fromLogisticsCode,jdbcType=VARCHAR}, from_logistics_code = #{fromLogisticsCode,jdbcType=VARCHAR},
from_waybill = #{fromWaybill,jdbcType=VARCHAR}, from_waybill = #{fromWaybill,jdbcType=VARCHAR},
`state` = #{state,jdbcType=INTEGER}, `state` = #{state,jdbcType=INTEGER},
...@@ -470,9 +502,9 @@ ...@@ -470,9 +502,9 @@
</foreach> </foreach>
</when> </when>
<otherwise> <otherwise>
id, distribution_order_id, identify_order_id, item_id, from_logistics_code, from_waybill, id, distribution_order_id, identify_order_id, seller_id, item_id, item_num, from_logistics_code,
`state`, approved, remark, out_logistics_code, out_waybill, return_name, return_phone, from_waybill, `state`, approved, remark, out_logistics_code, out_waybill, return_name,
return_address, create_time, update_time return_phone, return_address, create_time, update_time
</otherwise> </otherwise>
</choose> </choose>
from identify_order from identify_order
......
...@@ -9,6 +9,7 @@ import com.wwdz.ch.core.api.OfficialAccountApi; ...@@ -9,6 +9,7 @@ import com.wwdz.ch.core.api.OfficialAccountApi;
import com.wwdz.ch.core.api.WxAppletApi; import com.wwdz.ch.core.api.WxAppletApi;
import com.wwdz.ch.core.api.wxpay.WxPayServiceApi; import com.wwdz.ch.core.api.wxpay.WxPayServiceApi;
import com.wwdz.ch.core.consts.DistributionEnum; import com.wwdz.ch.core.consts.DistributionEnum;
import com.wwdz.ch.core.consts.RefundOrderEnum;
import com.wwdz.ch.core.notify.AliSmsSender; import com.wwdz.ch.core.notify.AliSmsSender;
import com.wwdz.ch.core.type.Result; import com.wwdz.ch.core.type.Result;
import com.wwdz.ch.core.util.PriceUtil; import com.wwdz.ch.core.util.PriceUtil;
...@@ -453,7 +454,7 @@ public class WxPayCallbackController { ...@@ -453,7 +454,7 @@ public class WxPayCallbackController {
refundOrder.setUpdateTime(new Date()); refundOrder.setUpdateTime(new Date());
refundOrder.setSuccessTime(TimeUtil.wxTimeConvertToDate(successTime)); refundOrder.setSuccessTime(TimeUtil.wxTimeConvertToDate(successTime));
refundOrder.setUserReceivedAccount(refundNotification.getUserReceivedAccount()); refundOrder.setUserReceivedAccount(refundNotification.getUserReceivedAccount());
refundOrder.setState(DistributionEnum.RefundOrderStateEnum.SUCCESS.getCode()); refundOrder.setState(RefundOrderEnum.StateEnum.SUCCESS.getCode());
refundOrderDao.update(refundOrder); refundOrderDao.update(refundOrder);
//分销商利润记录改为无效 //分销商利润记录改为无效
distributorProfitDao.updateValidState(distributionOrderId, false); distributorProfitDao.updateValidState(distributionOrderId, false);
...@@ -467,7 +468,7 @@ public class WxPayCallbackController { ...@@ -467,7 +468,7 @@ public class WxPayCallbackController {
RefundOrder refundOrder = new RefundOrder(); RefundOrder refundOrder = new RefundOrder();
refundOrder.setRefundId(refundId); refundOrder.setRefundId(refundId);
refundOrder.setUpdateTime(new Date()); refundOrder.setUpdateTime(new Date());
refundOrder.setState(DistributionEnum.RefundOrderStateEnum.FAILED.getCode()); refundOrder.setState(RefundOrderEnum.StateEnum.FAILED.getCode());
refundOrderDao.update(refundOrder); refundOrderDao.update(refundOrder);
} }
} catch (Exception e) { } catch (Exception e) {
......
...@@ -54,8 +54,6 @@ public class DistributionOrderServiceImpl implements DistributionOrderService { ...@@ -54,8 +54,6 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
private final static String DISTRIBUTION_ORDER_PREFIX = "DA"; private final static String DISTRIBUTION_ORDER_PREFIX = "DA";
private final static String REFUND_ORDER_PREFIX = "RF";
private final static String SECRET = "117eb48AX0864490fbe4d1ef081B9cc25"; private final static String SECRET = "117eb48AX0864490fbe4d1ef081B9cc25";
private static final String CREATE_ORDER_KEY_PRE = "AUCTION:CREATE:"; private static final String CREATE_ORDER_KEY_PRE = "AUCTION:CREATE:";
...@@ -1120,7 +1118,7 @@ public class DistributionOrderServiceImpl implements DistributionOrderService { ...@@ -1120,7 +1118,7 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
public Result refund(DistributionOrderRequestDto dto) { public Result refund(DistributionOrderRequestDto dto) {
RLock lock = null; RLock lock = null;
try { try {
String refundId = IdUtils.getOrderNumber(REFUND_ORDER_PREFIX); String refundId = IdUtils.getOrderNumber(CommConsts.REFUND_ORDER_PREFIX);
//判断订单状态 //判断订单状态
String distributionOrderId = dto.getDistributionOrderId(); String distributionOrderId = dto.getDistributionOrderId();
DistributionOrder distributionOrder = distributionOrderDao.findById(distributionOrderId); DistributionOrder distributionOrder = distributionOrderDao.findById(distributionOrderId);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment