提交 425446e4 作者: zhenjie

Merge branch 'develop'

......@@ -14,4 +14,4 @@ patches:
images:
- name: REGISTRY/NAMESPACE/IMAGE:TAG
newName: mmc-registry.cn-shenzhen.cr.aliyuncs.com/sharefly-dev/oms
newTag: 8118519f46d175f9aa351561f564c6ffc5243432
newTag: 62d5ba1ec80b8f48768cc6453fedc8e3fb12f95c
......@@ -228,6 +228,14 @@ public class CodeUtil {
return sb.toString();
}
public static String uavPOrderCode() {
StringBuffer sb = new StringBuffer();
sb.append("UP");
sb.append(TDateUtil.getCurrentDateByType("yyyyMMddHHmmss"));
sb.append(CodeUtil.getRandomNum(4));
return sb.toString();
}
/**
* 活动编号
*/
......
package com.mmc.oms.controller.uav;
import com.mmc.oms.common.result.ResultBody;
import com.mmc.oms.controller.BaseController;
import com.mmc.oms.model.dto.uav.UavCartCompanyDTO;
import com.mmc.oms.model.dto.uav.UavCartDTO;
import com.mmc.oms.model.dto.uav.UavOrderDTO;
import com.mmc.oms.model.qo.uav.UavCartQO;
import com.mmc.oms.model.vo.uav.UavCartVO;
import com.mmc.oms.service.uav.UavCartService;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
/**
* @description: 商城购物车,正常订单可以多商家的商品一起下单;意向订单只能单个商家的商品一起下单。
* @author: zj
* @Date: 2023/9/16 14:37
*/
@Api(tags = { "最新版-购物车接口" })
@RestController
@RequestMapping("/uav-cart/")
public class UavCartController extends BaseController {
@Autowired
private UavCartService uavCartService;
@ApiOperation(value = "加入购物车")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@PostMapping("add")
public ResultBody addCart(@RequestBody UavCartVO uavCartVO) {
return uavCartService.addCart(uavCartVO);
}
@ApiOperation(value = "移除")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@PostMapping("batchRemove")
public ResultBody batchRemove(@RequestBody List<Integer> carIds) {
return uavCartService.batchRemove(carIds);
}
@ApiOperation(value = "修改数量")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@GetMapping("updateNum")
public ResultBody updateNum(@RequestParam(required = true) Integer id,
@ApiParam("改变的数量(正加负减)") @RequestParam(required = true) Integer changeNum, HttpServletRequest request) {
return uavCartService.updateNum(id, changeNum);
}
@ApiOperation(value = "购物车列表")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = UavCartCompanyDTO.class)})
@PostMapping("list")
public ResultBody list(@RequestBody UavCartQO uavCartQO,
HttpServletRequest request) {
return uavCartService.list(uavCartQO, this.getCurrentAccount(request));
}
}
......@@ -2,13 +2,12 @@ package com.mmc.oms.controller.uav;
import com.mmc.oms.common.result.ResultBody;
import com.mmc.oms.controller.BaseController;
import com.mmc.oms.model.dto.ContractInfoDTO;
import com.mmc.oms.model.dto.uav.UavCartCompanyDTO;
import com.mmc.oms.model.dto.uav.UavOrderDTO;
import com.mmc.oms.model.dto.uav.UavOrderStatusDTO;
import com.mmc.oms.model.qo.uav.UavOrderQO;
import com.mmc.oms.model.vo.uav.AddUavOrderVO;
import com.mmc.oms.model.vo.uav.UavOrderExpressVO;
import com.mmc.oms.model.vo.uav.UavOrderPayVO;
import com.mmc.oms.model.vo.uav.UavOrderRemarkVO;
import com.mmc.oms.model.vo.uav.*;
import com.mmc.oms.service.uav.UavOrderService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
......@@ -18,6 +17,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
/**
* @author: zj
......@@ -37,11 +37,19 @@ public class UavOrderController extends BaseController {
return uavOrderService.addOrder(param, this.getCurrentAccount(request));
}
@ApiOperation(value = "提交订单-购物车")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = UavOrderDTO.class)})
@PostMapping("addOrderByCart")
public ResultBody<UavOrderDTO> addOrderByCart(@RequestBody AddUavOrderByCartQO orderByCartQO,
HttpServletRequest request) {
return uavOrderService.addOrderByCart(orderByCartQO, this.getCurrentAccount(request));
}
@ApiOperation(value = "订单详情")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = UavOrderDTO.class)})
@GetMapping("detail")
public ResultBody<UavOrderDTO> detail(@RequestParam Integer id) throws Exception {
return uavOrderService.detail(id);
public ResultBody<UavOrderDTO> detail(@RequestParam Integer id, HttpServletRequest request) throws Exception {
return uavOrderService.detail(id, this.getCurrentAccount(request));
}
@ApiOperation(value = "关闭")
......@@ -100,7 +108,7 @@ public class UavOrderController extends BaseController {
return uavOrderService.receive(id, this.getCurrentAccount(request));
}
@ApiOperation(value = "评价订单", hidden = true)
@ApiOperation(value = "评价订单")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@PostMapping("remarkOrder")
public ResultBody remarkOrder(@RequestBody UavOrderRemarkVO uavOrderRemarkVO) {
......@@ -110,7 +118,7 @@ public class UavOrderController extends BaseController {
@ApiOperation(value = "卖家备注")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@GetMapping("sellerRemark")
public ResultBody sellerRemark(@RequestParam Integer id, @RequestParam String content) {
public ResultBody sellerRemark(@RequestParam Integer id, @RequestParam(required = false) String content) {
return uavOrderService.sellerRemark(id, content);
}
......@@ -121,7 +129,19 @@ public class UavOrderController extends BaseController {
return uavOrderService.statusList();
}
// 检测超时未收货的订单
@ApiOperation(value = "平台确认订单")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@PostMapping("confirmOrder")
public ResultBody confirmOrder(@RequestBody UavOrderVO uavOrderVO, HttpServletRequest request) {
return uavOrderService.confirmOrder(uavOrderVO, this.getCurrentAccount(request));
}
@ApiOperation(value = "用户删除订单")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@GetMapping("removeUavOrder")
public ResultBody removeUavOrder(@RequestParam Integer id) {
return uavOrderService.removeUavOrder(id);
}
// 设置订单抽成比例
......
package com.mmc.oms.controller.uav;
import com.mmc.oms.common.result.ResultBody;
import com.mmc.oms.controller.BaseController;
import com.mmc.oms.model.dto.uav.UavPurchaseOrderDTO;
import com.mmc.oms.model.qo.uav.UavPOrderQO;
import com.mmc.oms.model.vo.uav.UavOrderExpressVO;
import com.mmc.oms.model.vo.uav.UavOrderPayVO;
import com.mmc.oms.model.vo.uav.UavPOConfirmVO;
import com.mmc.oms.service.uav.UavPOService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
/**
* @author: zj
* @Date: 2023/9/9 10:01
*/
@Api(tags = { "最新版-采购订单接口" })
@RestController
@RequestMapping("/uav-po/")
public class UavPOController extends BaseController {
@Autowired
private UavPOService uavPOService;
@ApiOperation(value = "平台确认采购订单(包含签署)")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@PostMapping("confirmPOrder")
private ResultBody confirmPOrder(@RequestBody UavPOConfirmVO uavPOConfirmVO, HttpServletRequest request){
return uavPOService.confirmPOrder(uavPOConfirmVO, this.getCurrentAccount(request));
}
@ApiOperation(value = "平台采购订单列表")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = UavPurchaseOrderDTO.class)})
@PostMapping("listPurchaseOrder")
private ResultBody listPurchase(@RequestBody UavPOrderQO uavPOrderQO, HttpServletRequest request){
return uavPOService.listPurchase(uavPOrderQO, this.getCurrentAccount(request));
}
@ApiOperation(value = "订单详情")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = UavPurchaseOrderDTO.class)})
@GetMapping("getPurchaseOrder")
private ResultBody getPurchaseOrder(@RequestParam Integer id, HttpServletRequest request) throws Exception {
return uavPOService.getPurchaseOrder(id, this.getCurrentAccount(request));
}
@ApiOperation(value = "上传付款凭证")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@PostMapping("upLoadPay")
public ResultBody upLoadPay(@RequestBody UavOrderPayVO uavOrderPayVO) {
return uavPOService.upLoadPay(uavOrderPayVO);
}
@ApiOperation(value = "审核付款凭证")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@PostMapping("checkPay")
public ResultBody checkPay(@RequestBody UavOrderPayVO uavOrderPayVO) {
return uavPOService.checkPay(uavOrderPayVO);
}
@ApiOperation(value = "发货")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@PostMapping("send")
public ResultBody send(@RequestBody UavOrderExpressVO param) {
return uavPOService.send(param);
}
@ApiOperation(value = "平台备注")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@GetMapping("userRemark")
public ResultBody userRemark(@RequestParam Integer id, @RequestParam(required = false) String content) {
return uavPOService.userRemark(id, content);
}
@ApiOperation(value = "商家备注")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@GetMapping("sellerRemark")
public ResultBody sellerRemark(@RequestParam Integer id, @RequestParam(required = false) String content) {
return uavPOService.sellerRemark(id, content);
}
}
package com.mmc.oms.dao.uav;
import com.mmc.oms.entity.uav.UavCartCompanyDO;
import com.mmc.oms.entity.uav.UavCartDO;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* @author: zj
* @Date: 2023/9/16 14:38
*/
@Mapper
public interface UavCartDao {
void addCart(UavCartDO uavCartDO);
void batchRemove(List<Integer> carIds);
UavCartDO getUavCartDO(Integer id);
void updateUavCart(UavCartDO uavCartDO);
List<Integer> countList(Integer userAccountId);
List<UavCartCompanyDO> list(Integer begin, Integer pageSize, Integer userAccountId);
}
package com.mmc.oms.dao.uav;
import com.mmc.oms.entity.uav.UavOrderDO;
import com.mmc.oms.entity.uav.UavOrderPayDO;
import com.mmc.oms.entity.uav.UavOrderSkuDO;
import com.mmc.oms.entity.uav.UavOrderStatusDO;
import com.mmc.oms.entity.uav.*;
import com.mmc.oms.model.qo.uav.UavOrderQO;
import org.apache.ibatis.annotations.Mapper;
......@@ -40,4 +37,16 @@ public interface UavOrderDao {
void addOrderPay(UavOrderPayDO uavOrderPayDO);
void updateUavOrderPayInfo(UavOrderDO uavOrderDO);
void updateUavOrder(UavOrderDO uavOrderDO);
void checkPay(UavOrderPayDO uavOrderPayDO);
void addRemarkOrder(UavOrderRemarkDO uavOrderRemarkDO);
UavOrderPayDO getUavOrderPayById(Integer id);
void updateUavOrderProportion(Integer id, Integer proportion);
void closeShowUavOrder(Integer id);
}
......@@ -3,6 +3,8 @@ package com.mmc.oms.dao.uav;
import com.mmc.oms.entity.uav.UavOrderExpressDO;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* @author: zj
* @Date: 2023/9/5 16:19
......@@ -14,4 +16,6 @@ public interface UavOrderExpressDao {
UavOrderExpressDO getUavOrderExpressDO(Integer uavOrderId);
int updateUavOrderExpressDO(UavOrderExpressDO uavOrderExpressDO);
List<UavOrderExpressDO> listNoReceive();
}
package com.mmc.oms.dao.uav;
import com.mmc.oms.entity.uav.UavOrderPayDO;
import com.mmc.oms.entity.uav.UavPurchaseOrderDO;
import com.mmc.oms.entity.uav.UavPurchaseOrderPayDO;
import com.mmc.oms.model.qo.uav.UavPOrderQO;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* @author: zj
* @Date: 2023/9/9 10:05
*/
@Mapper
public interface UavPODao {
int addPurchaseOrder(UavPurchaseOrderDO uavPurchaseOrderDO);
UavPurchaseOrderDO getUavPOrder(Integer id);
int countListPurchaseOrder(UavPOrderQO uavPOrderQO);
List<UavPurchaseOrderDO> listPurchaseOrder(UavPOrderQO uavPOrderQO);
void updateUavPOrderStatus(Integer id, Integer statusCode);
List<UavPurchaseOrderPayDO> listUavPOrderPay(Integer uavPurchaseOrderId);
void updateUavPOrderDO(UavPurchaseOrderDO uavPOrder);
void addPurchaseOrderPay(UavPurchaseOrderPayDO uavOrderPayDO);
void updateUavPOrderPay(UavPurchaseOrderPayDO uavOrderPayDO);
UavPurchaseOrderDO getUavPOrderByUavOId(Integer uavOrderId);
UavPurchaseOrderDO getUavPOrderByNo(String orderNo);
UavPurchaseOrderPayDO getUavPOrderPayById(Integer id);
void userRemark(Integer id, String content);
void sellerRemark(Integer id, String content);
}
package com.mmc.oms.entity.uav;
import com.mmc.oms.model.dto.uav.UavCartCompanyDTO;
import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.collections4.CollectionUtils;
import java.io.Serializable;
import java.util.List;
import java.util.stream.Collectors;
/**
* @author: zj
* @Date: 2023/9/18 15:58
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("最新版-商城购物车-小程序")
public class UavCartCompanyDO implements Serializable {
private static final long serialVersionUID = 1170859050008253153L;
private Integer thirdBackUserAccountId;
private Integer userAccountId;
private String companyName;
private List<UavCartDO> uavCartDOS;
public UavCartCompanyDTO buildUavCartCompanyDTO(){
return UavCartCompanyDTO.builder().thirdBackUserAccountId(this.thirdBackUserAccountId).companyName(this.companyName)
.uavCartDOS(CollectionUtils.isNotEmpty(this.uavCartDOS) ?
this.uavCartDOS.stream().map(UavCartDO::buildUavCartDTO).collect(Collectors.toList()) : null).build();
}
}
package com.mmc.oms.entity.uav;
import com.mmc.oms.model.dto.uav.UavCartDTO;
import com.mmc.oms.model.vo.uav.UavCartVO;
import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* @author: zj
* @Date: 2023/9/16 14:03
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("最新版-商城购物车")
public class UavCartDO implements Serializable {
private static final long serialVersionUID = 3845763818022578395L;
private Integer id;
private Integer version;
private Integer userAccountId;
private Integer thirdBackUserAccountId;
private String companyName;
private Integer mallGoodsId;
private String tradeName;
private Integer priceStockId;
private String productSpec;
private Integer orderNum;
private BigDecimal salePrice;
private String skuImage;
private String skuNo;
private Date createTime;
public UavCartDTO buildUavCartDTO() {
return UavCartDTO.builder().id(this.id).userAccountId(this.userAccountId).thirdBackUserAccountId(thirdBackUserAccountId)
.mallGoodsId(this.mallGoodsId).tradeName(this.tradeName).priceStockId(this.priceStockId).productSpec(this.productSpec)
.orderNum(this.orderNum).salePrice(this.salePrice).skuImage(this.skuImage).skuNo(this.skuNo).createTime(createTime)
.companyName(this.companyName).build();
}
public UavCartDO(UavCartVO uavCartVO){
this.id = uavCartVO.getId();
this.userAccountId = uavCartVO.getUserAccountId();
this.thirdBackUserAccountId = uavCartVO.getThirdBackUserAccountId();
this.companyName = uavCartVO.getCompanyName();
this.mallGoodsId = uavCartVO.getMallGoodsId();
this.tradeName = uavCartVO.getTradeName();
this.priceStockId = uavCartVO.getPriceStockId();
this.productSpec = uavCartVO.getProductSpec();
this.orderNum = uavCartVO.getOrderNum();
this.salePrice = uavCartVO.getSalePrice();
this.skuImage = uavCartVO.getSkuImage();
this.skuNo = uavCartVO.getSkuNo();
}
}
......@@ -70,6 +70,8 @@ public class UavOrderDO implements Serializable {
private Date updateTime;
@ApiModelProperty("规格列表")
private List<UavOrderSkuDO> skuDOS;
@ApiModelProperty("支付凭证列表")
private List<UavOrderPayDO> payDOList;
public UavOrderDTO buildUavOrderDTO(){
return UavOrderDTO.builder().id(this.id).version(this.version).orderNo(this.orderNo).statusCode(this.statusCode).userAccountId(this.userAccountId)
......@@ -78,6 +80,7 @@ public class UavOrderDO implements Serializable {
.userRemark(this.userRemark).sellerRemark(this.sellerRemark).createTime(this.createTime).payTime(this.payTime).confirmReceiptTime(this.confirmReceiptTime)
.remarkStatus(this.remarkStatus).updateTime(this.updateTime).skuDTOList(CollectionUtils.isEmpty(skuDOS) ? null :
this.skuDOS.stream().map(UavOrderSkuDO::buildUavOrderSkuDTO).collect(Collectors.toList()))
.payDTOList(CollectionUtils.isEmpty(payDOList) ? null : this.payDOList.stream().map(UavOrderPayDO::buildUavOrderPayDTO).collect(Collectors.toList()))
.build();
}
......
......@@ -29,6 +29,7 @@ public class UavOrderExpressDO implements Serializable {
private String takePhone;
private String takeRegion;
private String takeAddress;
private Date sendTime;
private Date receiveTime;
private Integer receive;
private Date updateTime;
......@@ -50,11 +51,12 @@ public class UavOrderExpressDO implements Serializable {
this.takePhone = param.getTakePhone();
this.takeRegion = param.getTakeRegion();
this.takeAddress = param.getTakeAddress();
this.sendTime = new Date();
}
public UavOrderExpressDTO buildUavOrderExpressDTO(){
return UavOrderExpressDTO.builder().id(this.id).uavOrderId(this.uavOrderId).sendExpNo(this.sendExpNo).sendExpCode(this.sendExpCode).takeName(this.takeName)
.takePhone(this.takePhone).takeAddress(this.takeAddress).takeRegion(this.takeRegion).receive(this.receive).receiveTime(this.receiveTime)
.build();
.sendTime(this.sendTime).build();
}
}
package com.mmc.oms.entity.uav;
import com.mmc.oms.model.dto.uav.UavOrderPayDTO;
import com.mmc.oms.model.vo.uav.UavOrderPayVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
......@@ -23,6 +24,7 @@ public class UavOrderPayDO implements Serializable {
private static final long serialVersionUID = -7440333696084228732L;
private Integer id;
private Integer uavOrderId;
private String orderNo;
private String payImgList;
private Integer checkStatus;
private Integer payType;
......@@ -32,6 +34,14 @@ public class UavOrderPayDO implements Serializable {
private Date checkTime;
private BigDecimal payAmount;
public UavOrderPayDO(UavOrderPayVO uavOrderPayVO) {
this.id = uavOrderPayVO.getId();
this.payImgList = uavOrderPayVO.getPayImgList();
this.checkStatus = uavOrderPayVO.getCheckStatus();
this.payRemark = uavOrderPayVO.getPayRemark();
this.refuseReason = uavOrderPayVO.getRefuseReason();
}
public UavOrderPayDTO buildUavOrderPayDTO(){
return UavOrderPayDTO.builder().id(this.id).uavOrderId(this.uavOrderId).payImgList(this.payImgList).checkStatus(this.checkStatus)
.payRemark(this.payRemark).refuseReason(this.refuseReason).createTime(this.createTime).payType(this.payType)
......
package com.mmc.oms.entity.uav;
import com.mmc.oms.model.vo.uav.UavOrderRemarkVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @author: zj
* @Date: 2023/9/9 17:48
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("最新版-订单评价信息")
public class UavOrderRemarkDO implements Serializable {
private static final long serialVersionUID = 3316555339556069007L;
@ApiModelProperty(value = "评价id")
private Integer id;
@ApiModelProperty(value = "商品id")
private Integer mallGoodsId;
@ApiModelProperty(value = "订单id")
private Integer uavOrderId;
@ApiModelProperty(value = "评分")
private Integer remarkLevel;
@ApiModelProperty(value = "图片地址,‘,’隔开")
private String uavImages;
@ApiModelProperty(value = "评论内容")
private String content;
public UavOrderRemarkDO(UavOrderRemarkVO uavOrderRemarkVO){
this.id = uavOrderRemarkVO.getId();
this.mallGoodsId = uavOrderRemarkVO.getMallGoodsId();
this.uavOrderId = uavOrderRemarkVO.getUavOrderId();
this.remarkLevel = uavOrderRemarkVO.getRemarkLevel();
this.uavImages = uavOrderRemarkVO.getUavImages();
this.content = uavOrderRemarkVO.getContent();
}
}
package com.mmc.oms.entity.uav;
import com.mmc.oms.model.dto.uav.UavCartDTO;
import com.mmc.oms.model.dto.uav.UavOrderSkuDTO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
......@@ -25,6 +26,8 @@ public class UavOrderSkuDO implements Serializable {
private Integer id;
@ApiModelProperty("订单id")
private Integer uavOrderId;
@ApiModelProperty("采购订单id")
private Integer uavPurchaseOrderId;
@ApiModelProperty("商品id")
private Integer mallGoodsId;
@ApiModelProperty("商品名称")
......@@ -50,4 +53,15 @@ public class UavOrderSkuDO implements Serializable {
.skuNo(this.skuNo).createTime(this.createTime).build();
}
public UavOrderSkuDO(UavCartDTO uavCartDTO){
this.mallGoodsId = uavCartDTO.getMallGoodsId();
this.orderNum = uavCartDTO.getOrderNum();
this.unitPrice = uavCartDTO.getSalePrice();
this.productSpec = uavCartDTO.getProductSpec();
this.tradeName = uavCartDTO.getTradeName();
this.skuNo = uavCartDTO.getSkuNo();
this.skuImage = uavCartDTO.getSkuImage();
this.priceStockId = uavCartDTO.getPriceStockId();
}
}
package com.mmc.oms.entity.uav;
import com.mmc.oms.model.dto.uav.UavOrderPayDTO;
import com.mmc.oms.model.dto.uav.UavPurchaseOrderDTO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.collections4.CollectionUtils;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
/**
* @author: zj
* @Date: 2023/9/11 13:23
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("最新版-采购订单")
public class UavPurchaseOrderDO implements Serializable {
private static final long serialVersionUID = -2874411492914226394L;
@ApiModelProperty(value = "id")
private Integer id;
@ApiModelProperty(value = "订单编号")
private String orderNo;
@ApiModelProperty(value = "用户订单编号")
private String uavOrderNo;
@ApiModelProperty(value = "采购方id")
private Integer backUserAccountId;
@ApiModelProperty(value = "第三方商家用户id")
private Integer thirdUserAccountId;
@ApiModelProperty(value = "被关联订单id")
private Integer uavOrderId;
@ApiModelProperty(value = "订单金额")
private BigDecimal orderAmount;
@ApiModelProperty(value = "订单状态")
private Integer statusCode;
@ApiModelProperty(value = "生成时间")
private Date createTime;
@ApiModelProperty(value = "买家备注")
private String userRemark;
@ApiModelProperty(value = "卖家备注")
private String sellerRemark;
@ApiModelProperty("规格列表")
private List<UavOrderSkuDO> skuDOS;
@ApiModelProperty("支付凭证列表")
private List<UavPurchaseOrderPayDO> payDOS;
public UavPurchaseOrderDTO buildUavPurchaseOrderDTO() {
return UavPurchaseOrderDTO.builder().id(this.id).orderNo(this.orderNo).statusCode(this.statusCode).backUserAccountId(this.backUserAccountId)
.thirdUserAccountId(this.thirdUserAccountId).uavOrderId(this.uavOrderId).orderAmount(this.orderAmount).statusCode(this.statusCode)
.createTime(this.createTime).userRemark(this.userRemark).sellerRemark(this.sellerRemark).skuDTOList(CollectionUtils.isEmpty(skuDOS) ? null :
this.skuDOS.stream().map(UavOrderSkuDO::buildUavOrderSkuDTO).collect(Collectors.toList()))
.payDTOS(CollectionUtils.isEmpty(skuDOS) ? null : this.payDOS.stream().map(UavPurchaseOrderPayDO::buildUavOrderPayDTO).collect(Collectors.toList()))
.uavOrderNo(this.uavOrderNo).build();
}
}
package com.mmc.oms.entity.uav;
import com.mmc.oms.model.dto.uav.UavOrderPayDTO;
import com.mmc.oms.model.vo.uav.UavOrderPayVO;
import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* @author: zj
* @Date: 2023/9/11 16:00
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("最新版-采购订单凭证")
public class UavPurchaseOrderPayDO implements Serializable {
private static final long serialVersionUID = -287998124979696397L;
private Integer id;
private Integer uavPOrderId;
private String payImgList;
private Integer checkStatus;
private String payRemark;
private String refuseReason;
private Date createTime;
private Date checkTime;
public UavPurchaseOrderPayDO(UavOrderPayVO uavOrderPayVO) {
this.id = uavOrderPayVO.getId();
this.payImgList = uavOrderPayVO.getPayImgList();
this.checkStatus = uavOrderPayVO.getCheckStatus();
this.payRemark = uavOrderPayVO.getPayRemark();
this.refuseReason = uavOrderPayVO.getRefuseReason();
}
public UavOrderPayDTO buildUavOrderPayDTO(){
return UavOrderPayDTO.builder().id(this.id).uavOrderId(this.uavPOrderId).payImgList(this.payImgList).checkStatus(this.checkStatus)
.payRemark(this.payRemark).refuseReason(this.refuseReason).createTime(this.createTime).build();
}
}
......@@ -9,6 +9,7 @@ public enum UavOrderStatus {
CONFIRM(200, 300, "待确认订单"),
SIGN(300, 400, "待签署合同"),
PAYING(400, 500,"待付款"),
FINISH_PAYING(420, 500,"已上传付款凭证"),
WAITING_DELIVER_GOODS(500,600, "待发货"),
WAITING_RECEIVE_GOODS(600, 700, "待收货"),
WAITING_REMARK(700, 800, "待评价"),
......
package com.mmc.oms.enums;
/**
* @author: zj
* @Date: 2023/9/9 14:09
*/
public enum UavOrderType {
PAY(0, "正常订单"),SIGN(1, "意向订单")
;
UavOrderType(Integer code, String name) {
this.code = code;
this.name = name;
}
public Integer getCode() {
return code;
}
public String getName() {
return name;
}
private Integer code;
private String name;
}
......@@ -6,6 +6,7 @@ import com.mmc.oms.model.vo.ApplyRefundVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
/**
* @author: zj
......@@ -15,5 +16,5 @@ import org.springframework.web.bind.annotation.RequestBody;
public interface PaymentAppApi {
@PostMapping("wechat/applyRefund")
public ResultBody applyRefund(@RequestBody ApplyRefundVO applyRefundVO);
public ResultBody applyRefund(@RequestBody ApplyRefundVO applyRefundVO, @RequestHeader String token);
}
......@@ -2,9 +2,13 @@ package com.mmc.oms.feign;
import com.mmc.oms.common.result.ResultBody;
import com.mmc.oms.feign.hystrix.PmsAppApiHystrix;
import com.mmc.oms.model.dto.uav.UavCartDTO;
import com.mmc.oms.model.qo.uav.PriceStockQO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* @author: zj
* @Date: 2023/6/5 15:18
......@@ -13,4 +17,7 @@ import org.springframework.web.bind.annotation.*;
public interface PmsAppApi {
@GetMapping("lease/goods/feignLeaseGoodsInfoByAddressId")
public ResultBody feignLeaseGoodsInfoByAddressId(@RequestParam Integer id);
@PostMapping("app/goods/listPriceStock")
List<UavCartDTO> listPriceStock(@RequestBody List<PriceStockQO> priceStockQOS);
}
......@@ -2,12 +2,21 @@ package com.mmc.oms.feign;
import com.mmc.oms.common.result.ResultBody;
import com.mmc.oms.feign.hystrix.UserAppApiHystrix;
import com.mmc.oms.model.dto.ContractInfoDTO;
import com.mmc.oms.model.dto.uav.PayWalletDTO;
import com.mmc.oms.model.dto.user.UserAccountSimpleDTO;
import com.mmc.oms.model.qo.UserAccountQO;
import com.mmc.oms.model.qo.mall.BUserAccountQO;
import com.mmc.oms.model.vo.uav.PayUavWalletVO;
import com.mmc.oms.model.vo.wallet.TopUpOrderVO;
import io.swagger.annotations.ApiParam;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* @author: zj
* @Date: 2023/5/18 17:06
......@@ -20,10 +29,44 @@ public interface UserAppApi {
@GetMapping("pay/getCurrentUserPayWalletInfo")
public ResultBody<PayWalletDTO> getCurrentUserPayWalletInfo(@RequestHeader String token);
@GetMapping("pay/getPayWalletInfo")
public ResultBody<PayWalletDTO> getPayWalletInfo(@RequestParam Integer userAccountId, @RequestHeader String token);
@PostMapping("pay/feignPayUavWallet")
public ResultBody feignPayUavWallet(@RequestBody PayUavWalletVO payUavWalletVO, @RequestHeader String token);
@GetMapping("company/getManagerIdByBackUserId")
public ResultBody getManagerIdByBackUserId(@RequestParam Integer backUserAccountId, @RequestHeader String token);
/**
* 获取小程序用户集合列表页面
*
* @param userAccountQO
* @param token
* @return
*/
@PostMapping("user-account/feignListAppUserAccount")
List<UserAccountSimpleDTO> feignListAppUserAccount(@ApiParam(value = "账号查询QO", required = true) @RequestBody UserAccountQO userAccountQO, @RequestHeader("token") String token);
@PostMapping("/fdd/contract/listContractInfoByOrderNo")
List<ContractInfoDTO> listContractInfoByOrderNo(@RequestBody List<String> orderNos, @RequestHeader("token") String token);
/**
* 根据用户id获取基本信息
*
* @param userAccountId
* @return
*/
@RequestMapping(value = "/user-account/feignGetUserSimpleInfo", method = RequestMethod.GET)
public UserAccountSimpleDTO feignGetUserSimpleInfo(@RequestParam Integer userAccountId, @RequestHeader("token") String token);
/**
* 获取后台用户集合列表页面
*
* @param bUserAccountQO 问:b用户帐户
* @return {@link List}<{@link UserAccountSimpleDTO}>
*/
@PostMapping("/back-user/feignListBAccountPage")
List<UserAccountSimpleDTO> feignListBAccountPage(@ApiParam(value = "账号查询QO", required = true) @RequestBody BUserAccountQO bUserAccountQO, @RequestHeader("token") String token);
}
......@@ -13,7 +13,7 @@ import lombok.extern.slf4j.Slf4j;
@Slf4j
public class PaymentAppApiHystrix implements PaymentAppApi {
@Override
public ResultBody applyRefund(ApplyRefundVO applyRefundVO) {
public ResultBody applyRefund(ApplyRefundVO applyRefundVO, String token) {
log.error("PaymentAppApiHystrix applyRefund ---- param:{}", JSONObject.toJSONString(applyRefundVO));
return ResultBody.error("调用微信退款失败");
}
......
package com.mmc.oms.feign.hystrix;
import com.alibaba.fastjson2.JSONObject;
import com.mmc.oms.common.result.ResultBody;
import com.mmc.oms.feign.PmsAppApi;
import com.mmc.oms.model.dto.uav.UavCartDTO;
import com.mmc.oms.model.qo.uav.PriceStockQO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestBody;
......@@ -18,4 +21,10 @@ public class PmsAppApiHystrix implements PmsAppApi {
log.info("熔断:PmsAppApiHystrix.feignLeaseGoodsInfoByAddressId==error==>param:{}",id);
return null;
}
@Override
public List<UavCartDTO> listPriceStock(List<PriceStockQO> priceStockQOS) {
log.info("熔断:PmsAppApiHystrix.listPriceStock==error==>param:{}", JSONObject.toJSONString(priceStockQOS));
return null;
}
}
......@@ -3,11 +3,17 @@ package com.mmc.oms.feign.hystrix;
import com.alibaba.fastjson2.JSONObject;
import com.mmc.oms.common.result.ResultBody;
import com.mmc.oms.feign.UserAppApi;
import com.mmc.oms.model.dto.ContractInfoDTO;
import com.mmc.oms.model.dto.uav.PayWalletDTO;
import com.mmc.oms.model.dto.user.UserAccountSimpleDTO;
import com.mmc.oms.model.qo.UserAccountQO;
import com.mmc.oms.model.qo.mall.BUserAccountQO;
import com.mmc.oms.model.vo.uav.PayUavWalletVO;
import com.mmc.oms.model.vo.wallet.TopUpOrderVO;
import lombok.extern.slf4j.Slf4j;
import java.util.List;
/**
* @author: zj
* @Date: 2023/5/18 17:08
......@@ -28,6 +34,12 @@ public class UserAppApiHystrix implements UserAppApi {
}
@Override
public ResultBody<PayWalletDTO> getPayWalletInfo(Integer userAccountId, String token) {
log.error("熔断:UserAppApiHystrix.getPayWalletInfo==error");
return ResultBody.error("-1", "远程调用失败");
}
@Override
public ResultBody feignPayUavWallet(PayUavWalletVO payUavWalletVO, String token) {
log.error("熔断:UserAppApiHystrix.feignPayUavWallet==error==>param:{}", JSONObject.toJSONString(payUavWalletVO));
return ResultBody.error("-1", "远程调用失败");
......@@ -38,4 +50,28 @@ public class UserAppApiHystrix implements UserAppApi {
log.error("熔断:UserAppApiHystrix.getManagerIdByBackUserId==error==>param:{}", JSONObject.toJSONString(backUserAccountId));
return ResultBody.error("-1", "远程调用失败");
}
@Override
public List<UserAccountSimpleDTO> feignListAppUserAccount(UserAccountQO userAccountQO, String token) {
log.error("熔断:UserAppApiHystrix.feignListAppUserAccount:{}", userAccountQO);
return null;
}
@Override
public List<ContractInfoDTO> listContractInfoByOrderNo(List<String> orderNos, String token) {
log.error("熔断:UserAppApiHystrix.listContractInfoByOrderNo==error==>param:{}", JSONObject.toJSONString(orderNos));
return null;
}
@Override
public UserAccountSimpleDTO feignGetUserSimpleInfo(Integer userAccountId, String token) {
log.error("熔断:UserAppApiHystrix.feignGetUserSimpleInfo==error==>param:{}", JSONObject.toJSONString(userAccountId));
return null;
}
@Override
public List<UserAccountSimpleDTO> feignListBAccountPage(BUserAccountQO bUserAccountQO, String token) {
log.error("熔断:UserAppApiHystrix.feignListBAccountPage==error==>param:{}", JSONObject.toJSONString(bUserAccountQO));
return null;
}
}
......@@ -39,7 +39,7 @@ public class AuthSignatureFilter implements AuthFilter {
/**
* 无需登录白名单
*/
private static final String[] IGNORE_URLS = {"/oms/swagger-resources", "/oms/v2/api-docs", "/oms/doc.html", "/oms/mallorder/listStatus","/oms/actuator/health/readiness"};
private static final String[] IGNORE_URLS = {"/oms/swagger-resources", "/oms/v2/api-docs", "/oms/doc.html", "/oms/mallorder/listStatus","/oms/actuator/health/readiness", "/oms/uav-order/finishSign", "/oms/uav-order/statusList"};
/*无需加密狗无需登录白名单*/
private static final String[] USE_KEY = {"/oms/account/loginByUsbKey"};
......
package com.mmc.oms.model.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.Date;
/**
* (ContractInfoDO)实体类
*
* @author makejava
* @since 2023-09-07 10:14:08
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class ContractInfoDTO implements Serializable {
private static final long serialVersionUID = -42558889792167148L;
@ApiModelProperty(value = "id")
private Integer id;
@ApiModelProperty(value = "发起合同方用户唯一标识")
private String unionId;
@ApiModelProperty(value = "订单号")
private String orderNo;
@ApiModelProperty(value = "合同编号")
private String contractNo;
@ApiModelProperty(value = "合同标题")
private String contractTitle;
@ApiModelProperty(value = "状态: 0、等待平台签署1、平台签署失败 2、等待(买家/供应商)签署(平台签署成功) 3、(买家/供应商)签署失败 4、(买家/供应商)签署成功、5、归档")
private Integer signStatus;
@ApiModelProperty(value = "签署完成日期")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
private Date singerTime;
@ApiModelProperty(value = "平台签署失败备注信息")
private String aRemark;
@ApiModelProperty(value = "(买家/供应商)签署失败备注信息")
private String bRemark;
@ApiModelProperty(value = "平台签署交易号")
private String aTransactionId;
@ApiModelProperty(value = "(买家/供应商)签署交易号")
private String bTransactionId;
@ApiModelProperty(value = "创建时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
private Date createTime;
@ApiModelProperty(value = "更新时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
private Date updateTime;
@ApiModelProperty(value = "归档日期")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
private Date archiveDate;
}
package com.mmc.oms.model.dto.uav;
import com.mmc.oms.entity.uav.UavCartDO;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.List;
/**
* @author: zj
* @Date: 2023/9/18 16:12
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
public class UavCartCompanyDTO implements Serializable {
private static final long serialVersionUID = -6785504068213761405L;
@ApiModelProperty(value = "商家id")
private Integer thirdBackUserAccountId;
@ApiModelProperty(value = "商家名称")
private String companyName;
@ApiModelProperty(value = "购物车对应规格")
private List<UavCartDTO> uavCartDOS;
}
package com.mmc.oms.model.dto.uav;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* @author: zj
* @Date: 2023/9/16 14:08
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
public class UavCartDTO implements Serializable {
private static final long serialVersionUID = 4386011514861211847L;
@ApiModelProperty(value = "id")
private Integer id;
@ApiModelProperty(value = "用户ID")
private Integer userAccountId;
@ApiModelProperty(value = "商家id")
private Integer thirdBackUserAccountId;
@ApiModelProperty(value = "商家名称")
private String companyName;
@ApiModelProperty(value = "商品id")
private Integer mallGoodsId;
@ApiModelProperty(value = "商品名称")
private String tradeName;
@ApiModelProperty(value = "商品规格id")
private Integer priceStockId;
@ApiModelProperty(value = "商品规格名称")
private String productSpec;
@ApiModelProperty(value = "数量")
private Integer orderNum;
@ApiModelProperty(value = "售卖价")
private BigDecimal salePrice;
@ApiModelProperty(value = "主图或规格图")
private String skuImage;
@ApiModelProperty(value = "规格编号")
private String skuNo;
@ApiModelProperty(value = "生成时间")
private Date createTime;
@ApiModelProperty(value = "是否展示价格,0 不显示 1显示")
private Integer priceShow;
@ApiModelProperty(value = "是否上架状态:0: 下架 1:上架")
private Integer shelfStatus;
}
package com.mmc.oms.model.dto.uav;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mmc.oms.model.dto.ContractInfoDTO;
import com.mmc.oms.model.dto.kdn.KdnExpDTO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
......@@ -32,6 +34,12 @@ public class UavOrderDTO implements Serializable {
private Integer statusCode;
@ApiModelProperty("买家id")
private Integer userAccountId;
@ApiModelProperty("买家手机号")
private String phoneNum;
@ApiModelProperty("买家姓名")
private String userName;
@ApiModelProperty("买家昵称")
private String nickname;
@ApiModelProperty("卖家id")
private Integer thirdBackUserAccountId;
@ApiModelProperty("卖家企业名称")
......@@ -49,6 +57,7 @@ public class UavOrderDTO implements Serializable {
@ApiModelProperty("订单类型,0正常订单、1意向订单")
private Integer orderType;
@ApiModelProperty("订单交期")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
private Date deliveryTime;
@ApiModelProperty("收货地址id")
private Integer userAddressId;
......@@ -57,16 +66,20 @@ public class UavOrderDTO implements Serializable {
@ApiModelProperty("卖家备注")
private String sellerRemark;
@ApiModelProperty("下单时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
private Date createTime;
@ApiModelProperty("支付时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
private Date payTime;
@ApiModelProperty("确认收货时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
private Date confirmReceiptTime;
@ApiModelProperty("修改版本")
private Integer version;
@ApiModelProperty("评价状态")
private Integer remarkStatus;
@ApiModelProperty("最近修改时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
private Date updateTime;
@ApiModelProperty("用户收货地址信息")
private UavOrderExpressDTO uavOrderExpressDTO;
......@@ -76,5 +89,7 @@ public class UavOrderDTO implements Serializable {
private List<UavOrderPayDTO> payDTOList;
@ApiModelProperty("订单规格列表")
private List<UavOrderSkuDTO> skuDTOList;
@ApiModelProperty("合同签署信息")
private ContractInfoDTO contractInfoDTO;
}
package com.mmc.oms.model.dto.uav;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
......@@ -37,7 +38,11 @@ public class UavOrderExpressDTO implements Serializable {
private String takeRegion;
@ApiModelProperty(value = "发货-收货详细地址")
private String takeAddress;
@ApiModelProperty(value = "发货-平台操作发货时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
private Date sendTime;
@ApiModelProperty(value = "取件时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
private Date receiveTime;
@ApiModelProperty(value = "是否已取件,0未取,1已取")
private Integer receive;
......
package com.mmc.oms.model.dto.uav;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
......@@ -26,6 +27,8 @@ public class UavOrderPayDTO implements Serializable {
private Integer id;
@ApiModelProperty(value = "订单id")
private Integer uavOrderId;
@ApiModelProperty(value = "订单编号")
private String orderNo;
@ApiModelProperty(value = "支付凭证")
private String payImgList;
@ApiModelProperty(value = "审核状态,0待审批,1通过,2未通过")
......@@ -35,6 +38,7 @@ public class UavOrderPayDTO implements Serializable {
@ApiModelProperty(value = "未通过原因")
private String refuseReason;
@ApiModelProperty(value = "提交时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
private Date createTime;
@ApiModelProperty(value = "0微信支付,1支付宝,2线下支付凭证")
private Integer payType;
......
package com.mmc.oms.model.dto.uav;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
......@@ -26,6 +27,8 @@ public class UavOrderSkuDTO implements Serializable {
private Integer id;
@ApiModelProperty("订单id")
private Integer uavOrderId;
@ApiModelProperty("采购订单id")
private Integer uavPurchaseOrderId;
@ApiModelProperty("商品id")
private Integer mallGoodsId;
@ApiModelProperty("商品名称")
......@@ -43,5 +46,6 @@ public class UavOrderSkuDTO implements Serializable {
@ApiModelProperty("商品规格编号")
private String skuNo;
@ApiModelProperty("下单时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
private Date createTime;
}
package com.mmc.oms.model.dto.uav;
import com.mmc.oms.entity.uav.UavPurchaseOrderPayDO;
import com.mmc.oms.model.dto.ContractInfoDTO;
import com.mmc.oms.model.dto.kdn.KdnExpDTO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
* @author: zj
* @Date: 2023/9/11 13:30
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@ApiModel(description = "采购订单")
public class UavPurchaseOrderDTO implements Serializable {
private static final long serialVersionUID = -4512219777300057765L;
@ApiModelProperty(value = "id")
private Integer id;
@ApiModelProperty(value = "订单编号")
private String orderNo;
@ApiModelProperty(value = "用户订单编号")
private String uavOrderNo;
@ApiModelProperty(value = "采购方id")
private Integer backUserAccountId;
@ApiModelProperty(value = "采购方商家公司名称")
private String buyCompanyName;
@ApiModelProperty(value = "采购方商家公司电话")
private String phoneNum;
@ApiModelProperty(value = "第三方商家用户id")
private Integer thirdUserAccountId;
@ApiModelProperty(value = "第三方商家公司名称")
private String companyName;
@ApiModelProperty(value = "第三方商家公司电话")
private String thirdPhoneNum;
@ApiModelProperty(value = "被关联订单id")
private Integer uavOrderId;
@ApiModelProperty(value = "订单金额")
private BigDecimal orderAmount;
@ApiModelProperty(value = "订单状态")
private Integer statusCode;
@ApiModelProperty(value = "生成时间")
private Date createTime;
@ApiModelProperty(value = "买家备注")
private String userRemark;
@ApiModelProperty(value = "卖家备注")
private String sellerRemark;
@ApiModelProperty("订单规格列表")
private List<UavOrderSkuDTO> skuDTOList;
@ApiModelProperty("用户收货地址信息")
private UavOrderExpressDTO uavOrderExpressDTO;
@ApiModelProperty("付款凭证")
private List<UavOrderPayDTO> uavOrderPayDTOS;
@ApiModelProperty("合同签署信息")
private ContractInfoDTO contractInfoDTO;
@ApiModelProperty("支付凭证列表")
private List<UavOrderPayDTO> payDTOS;
@ApiModelProperty("支付凭证列表")
private KdnExpDTO kdnExpDTO;
}
package com.mmc.oms.model.qo.uav;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @author: zj
* @Date: 2023/9/19 15:08
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class PriceStockQO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "商品id")
private Integer mallGoodsId;
@ApiModelProperty(value = "商品规格名称")
private String productSpec;
}
package com.mmc.oms.model.qo.uav;
import com.mmc.oms.common.publicinterface.Page;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
* @author: zj
* @Date: 2023/9/19 16:20
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class UavCartQO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "订单类型,0正常订单,1意向订单", required = true)
private Integer orderType;
@ApiModelProperty(value = "页码", required = true)
@NotNull(message = "页码不能为空", groups = Page.class)
@Min(value = 1, groups = Page.class)
private Integer pageNo;
@ApiModelProperty(value = "每页显示数", required = true)
@NotNull(message = "每页显示数不能为空", groups = Page.class)
@Min(value = 1, groups = Page.class)
private Integer pageSize;
public void buildCurrentPage() {
this.pageNo = (pageNo - 1) * pageSize;
}
}
......@@ -35,6 +35,12 @@ public class UavOrderQO implements Serializable {
@ApiModelProperty(value = "商家id", hidden = true)
private Integer thirdBackUserAccountId;
@ApiModelProperty(value = "订单类型,0正常订单、1意向订单", hidden = true)
private Integer orderType;
@ApiModelProperty(value = "订单是否展示给用户", hidden = true)
private Integer showUserPort;
@ApiModelProperty(value = "开始时间")
private String startTime;
......
package com.mmc.oms.model.qo.uav;
import com.mmc.oms.common.publicinterface.Page;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
* @author: zj
* @Date: 2023/9/11 14:12
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class UavPOrderQO implements Serializable {
private static final long serialVersionUID = 12451212L;
@ApiModelProperty(value = "关键字-订单编号", required = false)
private String keyword;
@ApiModelProperty(value = "用户uid", required = false)
private String uid;
@ApiModelProperty(value = "订单状态码")
private Integer statusCode;
@ApiModelProperty(value = "用户id", hidden = true)
private Integer userAccountId;
@ApiModelProperty(value = "商家id")
private Integer thirdBackUserAccountId;
@ApiModelProperty(value = "开始时间")
private String startTime;
@ApiModelProperty(value = "结束时间")
private String endTime;
@ApiModelProperty(value = "页码", required = true)
@NotNull(message = "页码不能为空", groups = Page.class)
@Min(value = 1, groups = Page.class)
private Integer pageNo;
@ApiModelProperty(value = "每页显示数", required = true)
@NotNull(message = "每页显示数不能为空", groups = Page.class)
@Min(value = 1, groups = Page.class)
private Integer pageSize;
public void buildCurrentPage() {
this.pageNo = (pageNo - 1) * pageSize;
}
}
package com.mmc.oms.model.vo.uav;
import com.mmc.oms.model.dto.uav.UavCartCompanyDTO;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.List;
/**
* @author: zj
* @Date: 2023/9/20 9:46
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class AddUavOrderByCartQO implements Serializable {
private static final long serialVersionUID = 2749055915328197141L;
@ApiModelProperty("收货地址")
private Integer userAddressId;
@ApiModelProperty("订单类型,0正常直接支付订单,1意向沟通订单")
private Integer orderType;
@ApiModelProperty("用户备注")
private String userRemark;
@ApiModelProperty("是否抵扣云享金,0否,1是")
private Integer deductShareAmount;
@ApiModelProperty("是否抵扣余额,0否,1是")
private Integer deductSalaryAmount;
@ApiModelProperty("每家商户对应的规格")
private List<UavCartCompanyDTO> cartCompanyDTOS;
}
......@@ -59,6 +59,9 @@ public class MallGoodsVO implements Serializable {
@ApiModelProperty(value = "商品标签")
private String goodsLabel;
@ApiModelProperty(value = "价格是否显示 0不显示 1显示")
private Integer priceShow;
@ApiModelProperty(value = "标签是否显示 0否 1是")
private Integer labelShow;
......
......@@ -29,7 +29,7 @@ public class PayUavWalletVO implements Serializable {
@ApiModelProperty(value = "佣金")
private BigDecimal salaryAmount;
@ApiModelProperty(value = "订单状态 100:订单支付 1400:商城订单退款")
@ApiModelProperty(value = "订单状态 100:订单支付 1400:商城订单退款 1500:订单提成 999:确认收货", required = true)
private Integer orderStatus;
@ApiModelProperty(value = "订单备注")
......
package com.mmc.oms.model.vo.uav;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* @author: zj
* @Date: 2023/9/16 14:49
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class UavCartVO implements Serializable {
private static final long serialVersionUID = 3679112602652045328L;
@ApiModelProperty(value = "id")
private Integer id;
@ApiModelProperty(value = "用户ID")
@NotNull(message = "用户ID不能为空")
private Integer userAccountId;
@ApiModelProperty(value = "商家id")
@NotNull(message = "商家id不能为空")
private Integer thirdBackUserAccountId;
@ApiModelProperty(value = "商家名称")
@NotNull(message = "商家名称不能为空")
private String companyName;
@ApiModelProperty(value = "商品id")
@NotNull(message = "商品id不能为空")
private Integer mallGoodsId;
@ApiModelProperty(value = "商品名称")
private String tradeName;
@ApiModelProperty(value = "商品规格id")
private Integer priceStockId;
@ApiModelProperty(value = "商品规格名称")
@NotNull(message = "商品规格名称不能为空")
private String productSpec;
@ApiModelProperty(value = "数量")
@NotNull(message = "数量不能为空")
private Integer orderNum;
@ApiModelProperty(value = "售卖价")
private BigDecimal salePrice;
@ApiModelProperty(value = "主图或规格图")
@NotNull(message = "主图或规格图不能为空")
private String skuImage;
@ApiModelProperty(value = "规格编号")
private String skuNo;
}
......@@ -18,10 +18,14 @@ import java.io.Serializable;
@Builder
public class UavOrderRemarkVO implements Serializable {
private static final long serialVersionUID = -5505722703435250409L;
@ApiModelProperty(value = "评价id")
private Integer id;
@ApiModelProperty(value = "订单id")
private Integer uavOrderId;
@ApiModelProperty(value = "商品id")
private Integer mallGoodsId;
@ApiModelProperty(value = "评分")
private Integer level;
private Integer remarkLevel;
@ApiModelProperty(value = "图片地址,‘,’隔开")
private String uavImages;
@ApiModelProperty(value = "评论内容")
......
package com.mmc.oms.model.vo.uav;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* @author: zj
* @Date: 2023/9/9 13:47
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class UavOrderVO implements Serializable {
private static final long serialVersionUID = 2835559199139136798L;
@ApiModelProperty("订单id")
private Integer id;
@ApiModelProperty("订单实付总额")
private BigDecimal orderTotalAmount;
@ApiModelProperty("订单交期")
private Date deliveryTime;
@ApiModelProperty("卖家备注")
private String sellerRemark;
}
package com.mmc.oms.model.vo.uav;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* @author: zj
* @Date: 2023/9/11 13:40
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class UavPOConfirmVO implements Serializable {
private static final long serialVersionUID = 2835559199139139868L;
@ApiModelProperty("采购订单id")
private Integer id;
@ApiModelProperty("订单金额")
private BigDecimal orderAmount;
@ApiModelProperty("平台备注")
private String userRemark;
}
......@@ -10,4 +10,6 @@ public class RabbitmqConstant {
public final static String PAY_UAV_ORDER_SUCCESS_QUEUE = "PAY_UAV_ORDER_SUCCESS_QUEUE";
public final static String ORDER_SIGN_FINISH_QUEUE = "ORDER_SIGN_FINISH_QUEUE";
}
package com.mmc.oms.mq.listener;
import com.alibaba.fastjson.JSONObject;
import com.mmc.oms.common.ResultEnum;
import com.mmc.oms.common.result.ResultBody;
import com.mmc.oms.dao.topup.TopUpOrderDao;
import com.mmc.oms.entity.topup.TopUpOrderDO;
import com.mmc.oms.model.dto.ContractInfoDTO;
import com.mmc.oms.model.vo.wallet.TopUpOrderVO;
import com.mmc.oms.mq.constant.RabbitmqConstant;
import com.mmc.oms.service.uav.UavOrderService;
import com.mmc.oms.service.uav.UavPOService;
import com.rabbitmq.client.Channel;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message;
......@@ -28,6 +32,9 @@ public class MqConsumer {
@Resource
private UavOrderService uavOrderService;
@Resource
private UavPOService uavPOService;
@RabbitListener(queues = RabbitmqConstant.USER_TOP_UP_DIRECT_QUEUE)
public void subscribeDirectQueue(@Payload String topUpOrder, Channel channel, Message message) {
TopUpOrderVO topUpOrderVO = JSONObject.parseObject(topUpOrder, TopUpOrderVO.class);
......@@ -44,9 +51,23 @@ public class MqConsumer {
@RabbitListener(queues = RabbitmqConstant.PAY_UAV_ORDER_SUCCESS_QUEUE)
public void subscribePayUavOrderDirectQueue(@Payload String topUpOrder, Channel channel, Message message) {
TopUpOrderVO topUpOrderVO = JSONObject.parseObject(topUpOrder, TopUpOrderVO.class);
log.info("<==========商城支付消费开始:信息是---->{}==========>", topUpOrderVO);
log.info("<==========商城支付消息消费开始:信息是---->{}==========>", topUpOrderVO);
// 根据支付消息修改订单状态
uavOrderService.payUavOrder(topUpOrderVO);
log.info("<==========用户充值订单消费结束==========>");
log.info("<==========商城支付消息消费结束==========>");
}
@RabbitListener(queues = RabbitmqConstant.ORDER_SIGN_FINISH_QUEUE)
public void finishOrderSign(@Payload String contractInfoDTO, Channel channel, Message message) {
ContractInfoDTO contract = JSONObject.parseObject(contractInfoDTO, ContractInfoDTO.class);
log.info("<==========合同签署完成:信息是---->{}==========>", contract);
// 根据支付消息修改订单状态
String orderNo = contract.getOrderNo();
if (orderNo.startsWith("UD")) {
uavOrderService.uavOrderFinishSign(orderNo);
} else if (orderNo.startsWith("UP")) {
uavPOService.uavPOFinishSign(orderNo);
}
log.info("<==========合同签署完成,消息消费结束==========>");
}
}
package com.mmc.oms.schedule;
import com.mmc.oms.service.uav.UavOrderService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
/**
* @author: zj
* @Date: 2023/9/9 17:34
*/
@Slf4j
@Component
public class ScheduleController {
@Autowired
private UavOrderService uavOrderService;
@Scheduled(fixedDelay = 5 * 60 * 1000)
public void checkNoReceiveUavOrder() {
log.info("checkNoReceiveUavOrder");
uavOrderService.checkNoReceive();
}
}
......@@ -25,6 +25,7 @@ import com.mmc.oms.model.vo.demand.DemandReleaseOrderVO;
import com.mmc.oms.model.vo.demand.OrderRequestParamsVO;
import com.mmc.oms.model.vo.demand.UserPayInfoVO;
import com.mmc.oms.service.demand.DemandReleaseOrderService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.StringRedisTemplate;
......@@ -49,6 +50,7 @@ import java.util.concurrent.TimeUnit;
* @Date 2023/7/25 15:49
* @Version 1.0
*/
@Slf4j
@Service
public class DemandReleaseOrderServiceImpl implements DemandReleaseOrderService {
......@@ -109,14 +111,14 @@ public class DemandReleaseOrderServiceImpl implements DemandReleaseOrderService
public ResultBody payUavOrder(CommonPaymentVO commonPaymentVO, String token) {
UavOrderDO uavOrderDO = uavOrderDao.detailByNo(commonPaymentVO.getOrderNumber());
if (!uavOrderDO.getOtherAmount().multiply(BigDecimal.valueOf(100)).equals(commonPaymentVO.getAmount())){
if (uavOrderDO.getOtherAmount().multiply(BigDecimal.valueOf(100)).compareTo(BigDecimal.valueOf(commonPaymentVO.getAmount())) !=0 ){
return ResultBody.error("发起支付金额不正确");
}
OrderRequestParamsVO orderRequestParamsVO = new OrderRequestParamsVO();
orderRequestParamsVO.setOrderNo(commonPaymentVO.getOrderNumber());
orderRequestParamsVO.setAmount(commonPaymentVO.getAmount());
orderRequestParamsVO.setAttach("PAY_UAV_ORDER");
orderRequestParamsVO.setDescription(commonPaymentVO.getDescription());
orderRequestParamsVO.setDescription("商城订单" + uavOrderDO.getOrderNo());
orderRequestParamsVO.setOrderPort(commonPaymentVO.getOrderPort());
ResultBody resultBody = releaseOrder(orderRequestParamsVO, token);
if (!"200".equals(resultBody.getCode())) {
......
package com.mmc.oms.service.uav;
import com.mmc.oms.common.result.ResultBody;
import com.mmc.oms.model.dto.uav.UavCartCompanyDTO;
import com.mmc.oms.model.dto.user.BaseAccountDTO;
import com.mmc.oms.model.qo.uav.UavCartQO;
import com.mmc.oms.model.vo.uav.UavCartVO;
import java.util.List;
/**
* @author: zj
* @Date: 2023/9/16 14:40
*/
public interface UavCartService {
ResultBody addCart(UavCartVO uavCartVO);
ResultBody batchRemove(List<Integer> carIds);
ResultBody updateNum(Integer id, Integer changeNum);
ResultBody list(UavCartQO uavCartQO, BaseAccountDTO currentAccount);
void buildUavCartCompany(Integer orderType, List<UavCartCompanyDTO> uavCartCompanyDTOS);
}
package com.mmc.oms.service.uav;
import com.mmc.oms.common.result.ResultBody;
import com.mmc.oms.model.dto.ContractInfoDTO;
import com.mmc.oms.model.dto.uav.UavCartCompanyDTO;
import com.mmc.oms.model.dto.uav.UavOrderDTO;
import com.mmc.oms.model.dto.user.BaseAccountDTO;
import com.mmc.oms.model.qo.uav.UavOrderQO;
import com.mmc.oms.model.vo.uav.AddUavOrderVO;
import com.mmc.oms.model.vo.uav.UavOrderExpressVO;
import com.mmc.oms.model.vo.uav.UavOrderPayVO;
import com.mmc.oms.model.vo.uav.UavOrderRemarkVO;
import com.mmc.oms.model.vo.uav.*;
import com.mmc.oms.model.vo.wallet.TopUpOrderVO;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
/**
* @author: zj
......@@ -18,7 +19,7 @@ import javax.servlet.http.HttpServletRequest;
public interface UavOrderService {
ResultBody addOrder(AddUavOrderVO param, BaseAccountDTO currentAccount);
ResultBody detail(Integer id) throws Exception;
ResultBody detail(Integer id, BaseAccountDTO baseAccountDTO) throws Exception;
ResultBody close(Integer id, String token);
......@@ -43,4 +44,14 @@ public interface UavOrderService {
ResultBody checkPay(UavOrderPayVO uavOrderPayVO);
void payUavOrder(TopUpOrderVO topUpOrderVO);
ResultBody confirmOrder(UavOrderVO uavOrderVO, BaseAccountDTO currentAccount);
ResultBody checkNoReceive();
ResultBody uavOrderFinishSign(String orderNo);
ResultBody removeUavOrder(Integer id);
ResultBody addOrderByCart(AddUavOrderByCartQO orderByCartQO, BaseAccountDTO currentAccount);
}
package com.mmc.oms.service.uav;
import com.mmc.oms.common.result.ResultBody;
import com.mmc.oms.model.dto.user.BaseAccountDTO;
import com.mmc.oms.model.qo.uav.UavPOrderQO;
import com.mmc.oms.model.vo.uav.UavOrderExpressVO;
import com.mmc.oms.model.vo.uav.UavOrderPayVO;
import com.mmc.oms.model.vo.uav.UavPOConfirmVO;
/**
* @author: zj
* @Date: 2023/9/9 10:03
*/
public interface UavPOService {
ResultBody confirmPOrder(UavPOConfirmVO uavPOConfirmVO, BaseAccountDTO currentAccount);
ResultBody listPurchase(UavPOrderQO uavPOrderQO, BaseAccountDTO currentAccount);
ResultBody getPurchaseOrder(Integer id, BaseAccountDTO currentAccount) throws Exception;
ResultBody upLoadPay(UavOrderPayVO uavOrderPayVO);
ResultBody checkPay(UavOrderPayVO uavOrderPayVO);
ResultBody send(UavOrderExpressVO param);
ResultBody uavPOFinishSign(String orderNo);
ResultBody receive(Integer id);
ResultBody userRemark(Integer id, String content);
ResultBody sellerRemark(Integer id, String content);
}
package com.mmc.oms.service.uav.impl;
import com.mmc.oms.common.ResultEnum;
import com.mmc.oms.common.result.PageResult;
import com.mmc.oms.common.result.ResultBody;
import com.mmc.oms.dao.uav.UavCartDao;
import com.mmc.oms.entity.uav.UavCartCompanyDO;
import com.mmc.oms.entity.uav.UavCartDO;
import com.mmc.oms.enums.UavOrderType;
import com.mmc.oms.feign.PmsAppApi;
import com.mmc.oms.model.dto.uav.UavCartCompanyDTO;
import com.mmc.oms.model.dto.uav.UavCartDTO;
import com.mmc.oms.model.dto.user.BaseAccountDTO;
import com.mmc.oms.model.qo.uav.PriceStockQO;
import com.mmc.oms.model.qo.uav.UavCartQO;
import com.mmc.oms.model.vo.uav.UavCartVO;
import com.mmc.oms.service.uav.UavCartService;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
/**
* @author: zj
* @Date: 2023/9/16 14:40
*/
@Service
public class UavCartServiceImpl implements UavCartService {
@Autowired
private UavCartDao uavCartDao;
@Autowired
private PmsAppApi pmsAppApi;
@Override
public ResultBody addCart(UavCartVO uavCartVO) {
UavCartDO uavCartDO = new UavCartDO(uavCartVO);
uavCartDao.addCart(uavCartDO);
return ResultBody.success();
}
@Override
public ResultBody batchRemove(List<Integer> carIds) {
uavCartDao.batchRemove(carIds);
return ResultBody.success();
}
@Override
public ResultBody updateNum(Integer id, Integer changeNum) {
UavCartDO uavCartDO = uavCartDao.getUavCartDO(id);
if (uavCartDO == null) {
return ResultBody.error(ResultEnum.SHOP_CAR_ERROR);
}
// changeNum,正加负减
Integer targetNum = uavCartDO.getOrderNum() + changeNum;
if (targetNum.compareTo(0) <= 0) {
return ResultBody.error(ResultEnum.BUY_NUM_ERROR);
}
uavCartDO.setOrderNum(targetNum);
uavCartDao.updateUavCart(uavCartDO);
return ResultBody.success();
}
@Override
public ResultBody list(UavCartQO uavCartQO, BaseAccountDTO currentAccount) {
// 按照第三方企业名称分组查询商品
List<Integer> list = uavCartDao.countList(currentAccount.getUserAccountId());
if (list.size() == 0) {
return ResultBody.success(PageResult.buildPage(uavCartQO.getPageNo(), uavCartQO.getPageSize(), list.size()));
}
Integer pageNo = uavCartQO.getPageNo();
uavCartQO.buildCurrentPage();
List<UavCartCompanyDO> uavCartCompanyDOS = uavCartDao.list(pageNo, uavCartQO.getPageSize(), currentAccount.getUserAccountId());
List<UavCartCompanyDTO> uavCartCompanyDTOS = uavCartCompanyDOS.stream().map(UavCartCompanyDO::buildUavCartCompanyDTO).collect(Collectors.toList());
// 同步商品信息,价格及是否展示
// 根据规格查询商品信息
buildUavCartCompany(uavCartQO.getOrderType(), uavCartCompanyDTOS);
return ResultBody.success(PageResult.buildPage(pageNo, uavCartQO.getPageSize(), list.size(), uavCartCompanyDTOS));
}
@Override
public void buildUavCartCompany(Integer orderType, List<UavCartCompanyDTO> uavCartCompanyDTOS){
List<PriceStockQO> priceStockQOS = new ArrayList<>();
for (UavCartCompanyDTO uavCartCompanyDTO : uavCartCompanyDTOS) {
for (UavCartDTO uavCartDO : uavCartCompanyDTO.getUavCartDOS()) {
PriceStockQO priceStockQO = new PriceStockQO(uavCartDO.getMallGoodsId(), uavCartDO.getProductSpec());
priceStockQOS.add(priceStockQO);
}
}
// 最新规格信息
List<UavCartDTO> uavCartDTOS = pmsAppApi.listPriceStock(priceStockQOS);
if (CollectionUtils.isEmpty(uavCartDTOS)) {
return;
}
// 更新最新的规格信息
for (UavCartCompanyDTO uavCartCompanyDTO : uavCartCompanyDTOS) {
uavCartCompanyDTO.setCompanyName(uavCartCompanyDTO.getUavCartDOS().get(0).getCompanyName());
for (UavCartDTO uavCartDTO : uavCartCompanyDTO.getUavCartDOS()) {
// 从最新规格中逐个更新
for (UavCartDTO newestUavCartDTO : uavCartDTOS) {
if (uavCartDTO.getMallGoodsId().equals(newestUavCartDTO.getMallGoodsId())
&& uavCartDTO.getProductSpec().equals(newestUavCartDTO.getProductSpec())) {
// 不符合的移除
if (UavOrderType.PAY.getCode().equals(orderType)) {
if (newestUavCartDTO.getPriceShow().equals(0)) {
uavCartCompanyDTO.getUavCartDOS().remove(uavCartDTO);
}
}else {
if (newestUavCartDTO.getPriceShow().equals(1)) {
uavCartCompanyDTO.getUavCartDOS().remove(uavCartDTO);
}
}
uavCartDTO.setPriceShow(newestUavCartDTO.getPriceShow());
uavCartDTO.setSalePrice(newestUavCartDTO.getSalePrice());
break;
}
}
}
if (CollectionUtils.isEmpty(uavCartCompanyDTO.getUavCartDOS())) {
uavCartCompanyDTOS.remove(uavCartCompanyDTO);
}
}
}
}
<?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.mmc.oms.dao.uav.UavCartDao">
<resultMap id="uavCartCompanyRes" type="com.mmc.oms.entity.uav.UavCartCompanyDO">
<id property="thirdBackUserAccountId" column="third_back_user_account_id"/>
<result property="companyName" column="companyName"/>
<result property="userAccountId" column="userAccountId"/>
<collection property="uavCartDOS" ofType="com.mmc.oms.entity.uav.UavCartDO"
select="listUavCart"
column="{thirdBackUserAccountId = third_back_user_account_id, userAccountId = userAccountId}">
</collection>
</resultMap>
<insert id="addCart" parameterType="com.mmc.oms.entity.uav.UavCartDO" useGeneratedKeys="true" keyProperty="id">
insert into uav_cart(user_account_id, third_back_user_account_id, company_name, mall_goods_id, trade_name,
price_stock_id, product_spec, order_num, sale_price, sku_image, sku_no, create_time)
values (#{userAccountId}, #{thirdBackUserAccountId}, #{companyName}, #{mallGoodsId}, #{tradeName},
#{priceStockId}, #{productSpec}, #{orderNum}, #{salePrice}, #{skuImage}, #{skuNo}, NOW());
</insert>
<sql id="cart_column">
id, version, user_account_id, third_back_user_account_id, company_name, mall_goods_id, trade_name, price_stock_id,
product_spec, order_num, sale_price, sku_image, sku_no, create_time
</sql>
<update id="batchRemove">
update uav_cart set is_deleted = 1
<where>
<foreach collection="carIds" item="id" index="index"
open="id in (" close=")" separator=",">
#{id}
</foreach>
</where>
</update>
<update id="updateUavCart" parameterType="com.mmc.oms.entity.uav.UavCartDO">
update uav_cart
<set>
<if test="orderNum != null">
order_num = #{orderNum},
</if>
<if test="version != null">
version = #{version} + 1,
</if>
</set>
where id = #{id} and version = #{version}
</update>
<select id="getUavCartDO" resultType="com.mmc.oms.entity.uav.UavCartDO">
select <include refid="cart_column"/>
from uav_cart
where id = #{id}
</select>
<select id="listUavCart" resultType="com.mmc.oms.entity.uav.UavCartDO">
select <include refid="cart_column"/>
from uav_cart
where third_back_user_account_id = #{thirdBackUserAccountId} and user_account_id = #{userAccountId} and is_deleted = 0 order by id desc
</select>
<select id="countList" resultType="java.lang.Integer">
SELECT
DISTINCT third_back_user_account_id
FROM
uav_cart
WHERE
user_account_id = #{userAccountId} and is_deleted = 0
</select>
<select id="list" resultMap="uavCartCompanyRes">
SELECT
third_back_user_account_id, #{userAccountId} AS userAccountId
FROM
( SELECT third_back_user_account_id, #{userAccountId} AS userAccountId
FROM uav_cart
where user_account_id = #{userAccountId} and is_deleted = 0
ORDER BY id DESC limit 1000000000) a
group by third_back_user_account_id
limit #{begin}, #{pageSize}
</select>
</mapper>
\ No newline at end of file
......@@ -30,6 +30,10 @@
select="listUavOrderSkuDO"
column="{uavOrderId=id}">
</collection>
<collection property="payDOList" ofType="com.mmc.oms.entity.uav.UavOrderPayDO"
select="listUavOrderPay"
column="{uavOrderId=id}">
</collection>
</resultMap>
<sql id="uav_order_column">
......@@ -38,6 +42,10 @@
pay_time, confirm_receipt_time, version, remark_status, update_time
</sql>
<sql id="uav_order_pay_column">
id, uav_order_id, pay_type, pay_img_list, check_status, pay_remark, refuse_reason, create_time, check_time
</sql>
<insert id="addOrder" parameterType="com.mmc.oms.entity.uav.UavOrderDO" useGeneratedKeys="true" keyProperty="id">
insert into uav_order(order_no, status_code, user_account_id, third_back_user_account_id, company_name, order_total_amount,
salary_amount, share_amount, other_amount, pay_type, order_type, user_address_id, user_remark, seller_remark, create_time
......@@ -73,6 +81,11 @@
values(#{uavOrderId}, #{orderNo}, #{payType}, #{payAmount}, #{payImgList}, #{checkStatus}, #{payRemark}, #{refuseReason}, NOW(), #{checkTime})
</insert>
<insert id="addRemarkOrder" parameterType="com.mmc.oms.entity.uav.UavOrderRemarkDO">
insert into uav_order_remark (mall_goods_id, uav_order_id, remark_level, uav_images, content, create_time)
values (#{mallGoodsId}, #{uavOrderId}, #{remarkLevel}, #{uavImages}, #{content}, NOW())
</insert>
<update id="sellerRemark">
update uav_order set seller_remark = #{content} where id = #{id}
</update>
......@@ -84,6 +97,58 @@
<update id="updateUavOrderPayInfo" parameterType="com.mmc.oms.entity.uav.UavOrderDO">
update uav_order set pay_time = #{payTime}, pay_type = #{payType} where id = #{id}
</update>
<update id="updateUavOrder" parameterType="com.mmc.oms.entity.uav.UavOrderDO">
update uav_order
<set>
<if test="orderTotalAmount != null">
order_total_amount = #{orderTotalAmount},
</if>
<if test="shareAmount != null">
share_amount = #{shareAmount},
</if>
<if test="otherAmount != null">
other_amount = #{otherAmount},
</if>
<if test="statusCode != null">
status_code = #{statusCode},
</if>
<if test="deliveryTime != null">
delivery_time = #{deliveryTime},
</if>
<if test="sellerRemark != null">
seller_remark = #{sellerRemark}
</if>
</set>
where id = #{id} and version = #{version}
</update>
<update id="checkPay" parameterType="com.mmc.oms.entity.uav.UavOrderPayDO">
update uav_order_pay
<set>
<if test="payImgList != null">
pay_img_list = #{payImgList},
</if>
<if test="checkStatus != null">
check_status = #{checkStatus},
</if>
<if test="payRemark != null">
pay_remark = #{payRemark},
</if>
<if test="refuseReason != null">
refuse_reason = #{refuseReason}
</if>
</set>
where id = #{id}
</update>
<update id="updateUavOrderProportion">
update uav_order set proportion = #{proportion} where id = #{id}
</update>
<update id="closeShowUavOrder">
update uav_order set show_user_port = 0 where id = #{id}
</update>
<select id="detail" resultType="com.mmc.oms.entity.uav.UavOrderDO">
select <include refid="uav_order_column" /> from uav_order where id = #{id}
......@@ -91,17 +156,9 @@
<select id="listUavOrderPay" resultType="com.mmc.oms.entity.uav.UavOrderPayDO">
select
id,
uav_order_id,
pay_type,
pay_img_list,
check_status,
pay_remark,
refuse_reason,
create_time,
check_time
<include refid="uav_order_pay_column"/>
from uav_order_pay
where uav_order_id = #{uavOrderId}
where uav_order_id = #{uavOrderId} and pay_type = 2
</select>
<select id="listUavOrderSkuDO" resultType="com.mmc.oms.entity.uav.UavOrderSkuDO">
......@@ -131,10 +188,10 @@
</select>
<select id="countList" resultType="java.lang.Integer" parameterType="com.mmc.oms.model.qo.uav.UavOrderQO">
select count(*) from uav_order
select count(*) from uav_order uo
where 1 = 1
<if test="keyword != null">
and order_no = #{orderNo}
and order_no = #{keyword}
</if>
<if test="uid != null">
and user_account_id = #{uid}
......@@ -148,12 +205,18 @@
<if test="thirdBackUserAccountId != null">
and third_back_user_account_id = #{thirdBackUserAccountId}
</if>
<if test="orderType != null">
and uo.order_type = #{orderType}
</if>
<if test="startTime != null">
and create_time >= #{startTime}
</if>
<if test="endTime != null">
and #{endTime} >= create_time
</if>
<if test="showUserPort != null">
and show_user_port = #{showUserPort}
</if>
</select>
<select id="list" resultMap="uavOrderResultMap" parameterType="com.mmc.oms.model.qo.uav.UavOrderQO">
......@@ -162,7 +225,7 @@
uav_order uo
where 1 = 1
<if test="keyword != null">
and uo.order_no = #{orderNo}
and uo.order_no = #{keyword}
</if>
<if test="uid != null">
and uo.user_account_id = #{uid}
......@@ -176,12 +239,18 @@
<if test="thirdBackUserAccountId != null">
and uo.third_back_user_account_id = #{thirdBackUserAccountId}
</if>
<if test="orderType != null">
and uo.order_type = #{orderType}
</if>
<if test="startTime != null">
and uo.create_time >= #{startTime}
</if>
<if test="endTime != null">
and #{endTime} >= uo.create_time
</if>
<if test="showUserPort != null">
and show_user_port = #{showUserPort}
</if>
order by uo.id desc
limit #{pageNo}, #{pageSize}
</select>
......@@ -190,4 +259,10 @@
select <include refid="uav_order_column" /> from uav_order where order_no = #{orderNo}
</select>
<select id="getUavOrderPayById" resultType="com.mmc.oms.entity.uav.UavOrderPayDO">
select <include refid="uav_order_pay_column"/>
from uav_order_pay
where id = #{id} and pay_type = 2
</select>
</mapper>
<?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.mmc.oms.dao.uav.UavOrderExpressDao">
<sql id="uav_order_express_column">
id, uav_order_id, send_exp_no, send_exp_code, take_name, take_phone, take_region, take_address, send_time,
is_receive as receive, receive_time, update_time, create_time
</sql>
<insert id="addAddress" keyProperty="id" useGeneratedKeys="true"
parameterType="com.mmc.oms.entity.uav.UavOrderExpressDO">
insert into uav_order_express(uav_order_id, send_exp_no, send_exp_code, take_name, take_phone, take_region, take_address, create_time)
......@@ -50,22 +56,16 @@
<select id="getUavOrderExpressDO" resultType="com.mmc.oms.entity.uav.UavOrderExpressDO">
select
id,
uav_order_id,
send_exp_no,
send_exp_code,
take_name,
take_phone,
take_region,
take_address,
send_time,
is_receive,
receive_time,
update_time,
create_time
<include refid="uav_order_express_column" />
from uav_order_express
where uav_order_id = #{uavOrderId}
</select>
<select id="listNoReceive" resultType="com.mmc.oms.entity.uav.UavOrderExpressDO">
select
<include refid="uav_order_express_column" />
from uav_order_express where is_receive = 0 and timestampdiff(day, send_time, NOW()) >= 14
</select>
</mapper>
<?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.mmc.oms.dao.uav.UavPODao">
<resultMap type="com.mmc.oms.entity.uav.UavPurchaseOrderDO"
id="uavPOResultMap">
<id property="id" column="id" />
<result property="orderNo" column="order_no" />
<result property="uavOrderNo" column="uavOrderNo" />
<result property="backUserAccountId" column="back_user_account_id" />
<result property="thirdUserAccountId" column="third_user_account_id" />
<result property="uavOrderId" column="uav_order_id" />
<result property="orderAmount" column="order_amount" />
<result property="statusCode" column="status_code" />
<result property="createTime" column="create_time" />
<result property="userRemark" column="user_remark" />
<result property="sellerRemark" column="seller_remark" />
<collection property="skuDOS" ofType="com.mmc.oms.entity.uav.UavOrderSkuDO"
select="listUavOrderSkuDO"
column="{uavOrderId=uav_order_id}">
</collection>
<collection property="payDOS" ofType="com.mmc.oms.entity.uav.UavPurchaseOrderPayDO"
select="listUavPOrderPay"
column="{uavPurchaseOrderId=id}">
</collection>
</resultMap>
<sql id="uav_purchase_order_column">
upo.id, upo.order_no, upo.back_user_account_id, upo.third_user_account_id, upo.uav_order_id, upo.order_amount, upo.status_code,
upo.create_time, upo.user_remark, upo.seller_remark
</sql>
<sql id="uav_purchase_order_pay_column">
id, uav_purchase_order_id as uavPOrderId, pay_img_list, check_status, pay_remark, refuse_reason, create_time, check_time
</sql>
<insert id="addPurchaseOrder" parameterType="com.mmc.oms.entity.uav.UavPurchaseOrderDO" keyProperty="id"
useGeneratedKeys="true">
insert into uav_purchase_order(order_no, back_user_account_id, third_user_account_id, uav_order_id, order_amount, status_code,
create_time, user_remark, seller_remark)
values(#{orderNo}, #{backUserAccountId}, #{thirdUserAccountId}, #{uavOrderId}, #{orderAmount}, #{statusCode}, NOW(), #{userRemark}, #{sellerRemark});
</insert>
<insert id="addPurchaseOrderPay" parameterType="com.mmc.oms.entity.uav.UavPurchaseOrderPayDO" useGeneratedKeys="true" keyProperty="id">
insert into uav_purchase_order_pay(
uav_purchase_order_id, pay_img_list, check_status, pay_remark, refuse_reason, create_time, check_time )
values(#{uavPOrderId}, #{payImgList}, #{checkStatus}, #{payRemark}, #{refuseReason}, NOW(), #{checkTime})
</insert>
<update id="updateUavPOrderStatus">
update uav_purchase_order set status_code = #{statusCode} where id = #{id}
</update>
<update id="updateUavPOrderDO" parameterType="com.mmc.oms.entity.uav.UavPurchaseOrderDO">
update uav_purchase_order
<set>
<if test="orderAmount != null">
order_amount = #{orderAmount},
</if>
<if test="sellerRemark != null">
seller_remark = #{sellerRemark},
</if>
<if test="userRemark != null">
user_remark = #{userRemark}
</if>
</set>
where id = #{id}
</update>
<update id="updateUavPOrderPay" parameterType="com.mmc.oms.entity.uav.UavPurchaseOrderPayDO">
update uav_purchase_order_pay
<set>
<if test="payImgList != null">
pay_img_list = #{payImgList},
</if>
<if test="checkStatus != null">
check_status = #{checkStatus},
</if>
<if test="payRemark != null">
pay_remark = #{payRemark},
</if>
<if test="refuseReason != null">
refuse_reason = #{refuseReason}
</if>
</set>
where id = #{id}
</update>
<update id="userRemark">
update uav_purchase_order set user_remark = #{content} where id = #{id}
</update>
<update id="sellerRemark">
update uav_purchase_order set seller_remark = #{content} where id = #{id}
</update>
<select id="listUavOrderSkuDO" resultType="com.mmc.oms.entity.uav.UavOrderSkuDO">
select
id,
uav_order_id,
mall_goods_id,
trade_name,
price_stock_id,
product_spec,
order_num,
unit_price,
sku_image,
sku_no,
create_time
from uav_order_sku
where uav_order_id = #{uavOrderId}
</select>
<select id="getUavPOrder" resultMap="uavPOResultMap">
select <include refid="uav_purchase_order_column"/>, uo.order_no as uavOrderNo
from uav_purchase_order upo inner join uav_order uo on upo.uav_order_id = uo.id
where upo.id = #{id}
</select>
<select id="listPurchaseOrder" resultMap="uavPOResultMap" parameterType="com.mmc.oms.model.qo.uav.UavPOrderQO">
select <include refid="uav_purchase_order_column"/>, uo.order_no as uavOrderNo
from uav_purchase_order upo inner join uav_order uo on upo.uav_order_id = uo.id
where 1 = 1
<if test="keyword != null">
and uo.order_no = #{keyword}
</if>
<if test="thirdBackUserAccountId != null">
and upo.third_user_account_id = #{thirdBackUserAccountId}
</if>
<if test="statusCode != null">
and upo.status_code = #{statusCode}
</if>
<if test="startTime != null">
and upo.create_time >= #{startTime}
</if>
<if test="endTime != null">
and #{endTime} >= upo.create_time
</if>
order by upo.id desc
limit #{pageNo}, #{pageSize}
</select>
<select id="countListPurchaseOrder" resultType="java.lang.Integer" parameterType="com.mmc.oms.model.qo.uav.UavPOrderQO">
select count(*)
from uav_purchase_order upo inner join uav_order uo on upo.uav_order_id = uo.id
where 1 = 1
<if test="keyword != null">
and uo.order_no = #{keyword}
</if>
<if test="thirdBackUserAccountId != null">
and upo.third_user_account_id = #{thirdBackUserAccountId}
</if>
<if test="statusCode != null">
and upo.status_code = #{statusCode}
</if>
<if test="startTime != null">
and upo.create_time >= #{startTime}
</if>
<if test="endTime != null">
and #{endTime} >= upo.create_time
</if>
</select>
<select id="listUavPOrderPay" resultType="com.mmc.oms.entity.uav.UavPurchaseOrderPayDO">
select <include refid="uav_purchase_order_pay_column"/>
from uav_purchase_order_pay
where uav_purchase_order_id = #{uavPurchaseOrderId}
</select>
<select id="getUavPOrderByUavOId" resultType="com.mmc.oms.entity.uav.UavPurchaseOrderDO">
select <include refid="uav_purchase_order_column"/>, uo.order_no as uavOrderNo
from uav_purchase_order upo inner join uav_order uo on upo.uav_order_id = uo.id
where upo.uav_order_id = #{uavOrderId}
</select>
<select id="getUavPOrderByNo" resultType="com.mmc.oms.entity.uav.UavPurchaseOrderDO">
select <include refid="uav_purchase_order_column"/>, uo.order_no as uavOrderNo
from uav_purchase_order upo inner join uav_order uo on upo.uav_order_id = uo.id
where upo.order_no = #{orderNo}
</select>
<select id="getUavPOrderPayById" resultType="com.mmc.oms.entity.uav.UavPurchaseOrderPayDO">
select <include refid="uav_purchase_order_pay_column"/>
from uav_purchase_order_pay
where id = #{id}
</select>
</mapper>
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论