提交 48a581d6 作者: zhenjie

Merge branch 'develop'

...@@ -14,4 +14,4 @@ patches: ...@@ -14,4 +14,4 @@ patches:
images: images:
- name: REGISTRY/NAMESPACE/IMAGE:TAG - name: REGISTRY/NAMESPACE/IMAGE:TAG
newName: mmc-registry.cn-shenzhen.cr.aliyuncs.com/sharefly-dev/oms newName: mmc-registry.cn-shenzhen.cr.aliyuncs.com/sharefly-dev/oms
newTag: 62d5ba1ec80b8f48768cc6453fedc8e3fb12f95c newTag: b7b6292e8a4fd03a5ea0c9ad7cb8d3079ed995ad
...@@ -3,8 +3,10 @@ package com.mmc.oms; ...@@ -3,8 +3,10 @@ package com.mmc.oms;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.openfeign.EnableFeignClients; import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.scheduling.annotation.EnableScheduling;
@SpringBootApplication @SpringBootApplication
@EnableScheduling
@EnableFeignClients(basePackages = "com.mmc.oms.feign") @EnableFeignClients(basePackages = "com.mmc.oms.feign")
public class OmsApplication { public class OmsApplication {
......
package com.mmc.oms.common.util; package com.mmc.oms.common.util;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Random; import java.util.Random;
import java.util.concurrent.atomic.AtomicInteger;
/** /**
* @Author small * @Author small
...@@ -236,6 +239,14 @@ public class CodeUtil { ...@@ -236,6 +239,14 @@ public class CodeUtil {
return sb.toString(); return sb.toString();
} }
public static String multiUavOrderPayCode() {
StringBuffer sb = new StringBuffer();
sb.append("m");
sb.append(TDateUtil.getCurrentDateByType("yyyyMMddHHmmss"));
sb.append(CodeUtil.getRandomNum(4));
return sb.toString();
}
/** /**
* 活动编号 * 活动编号
*/ */
...@@ -243,4 +254,14 @@ public class CodeUtil { ...@@ -243,4 +254,14 @@ public class CodeUtil {
return "AC" + CodeUtil.getRandomNum(5); return "AC" + CodeUtil.getRandomNum(5);
} }
private static final SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
private static final AtomicInteger counter = new AtomicInteger(0);
public static String generateOrderId() {
Date now = new Date();
String dateString = sdf.format(now);
int count = counter.incrementAndGet();
return "ORD" + dateString + String.format("%04d", count);
}
} }
package com.mmc.oms.controller.data;
import com.mmc.oms.common.result.ResultBody;
import com.mmc.oms.model.dto.data.OrderReportDTO;
import com.mmc.oms.service.data.OrderReportService;
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.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @Author LW
* @date 2023/9/16 17:49
* 概要:
*/
@Api(tags = "云享飞加盟入驻及商品sku看板数据")
@RequestMapping("/product/report")
@RestController
public class OrderReportController {
@Autowired
private OrderReportService orderReportService;
@ApiOperation(value = "获取用户报表数据")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = OrderReportDTO.class)})
@GetMapping("/getOrderReportData")
public ResultBody<OrderReportDTO> getOrderReportData() {
return orderReportService.getOrderReportData();
}
}
package com.mmc.oms.controller.lease;
import com.mmc.oms.common.result.ResultBody;
import com.mmc.oms.controller.BaseController;
import com.mmc.oms.model.dto.lease.LeaseOrderDTO;
import com.mmc.oms.model.dto.transtatus.TranStatusDicDTO;
import com.mmc.oms.model.qo.uav.UavOrderQO;
import com.mmc.oms.model.vo.lease.AddLeaseOrderVO;
import com.mmc.oms.model.vo.lease.LeaseOrderRefundVO;
import com.mmc.oms.model.vo.uav.UavOrderExpressVO;
import com.mmc.oms.service.lease.LeaseOrderService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
/**
* @author: lw
* @Date: 2023/9/21 16:29
*/
@Api(tags = {"最新版--租赁订单接口"})
@RestController
@RequestMapping("/lease/order/")
public class LeaseOrderController extends BaseController {
@Resource
private LeaseOrderService leaseOrderService;
@ApiOperation(value = "提交订单")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = LeaseOrderDTO.class)})
@PostMapping("addLeaseOrder")
public ResultBody<LeaseOrderDTO> addLeaseOrder(@RequestBody AddLeaseOrderVO param, HttpServletRequest request) {
return leaseOrderService.addLeaseOrder(param, this.getCurrentAccount(request));
}
@ApiOperation(value = "订单详情")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = LeaseOrderDTO.class)})
@GetMapping("detail")
public ResultBody<LeaseOrderDTO> detail(@RequestParam Integer id, HttpServletRequest request) throws Exception {
return leaseOrderService.detail(id, this.getCurrentAccount(request));
}
@ApiOperation(value = "买家申请退款(取消订单)")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@PostMapping("close")
public ResultBody close(@RequestBody LeaseOrderRefundVO leaseOrderRefundVO, HttpServletRequest request) {
return leaseOrderService.close(leaseOrderRefundVO, this.getCurrentAccount(request).getToken());
}
@ApiOperation(value = "后台订单列表")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = LeaseOrderDTO.class)})
@PostMapping("list")
public ResultBody<LeaseOrderDTO> list(@RequestBody UavOrderQO uavOrderQO, HttpServletRequest request) {
return leaseOrderService.list(uavOrderQO, this.getCurrentAccount(request));
}
@ApiOperation(value = "个人订单列表")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = LeaseOrderDTO.class)})
@PostMapping("listByUid")
public ResultBody<LeaseOrderDTO> listByUid(@RequestBody UavOrderQO uavOrderQO, HttpServletRequest request) {
return leaseOrderService.listByUid(uavOrderQO, this.getCurrentAccount(request));
}
@ApiOperation(value = "支付", hidden = true)
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@GetMapping("pay")
public ResultBody pay(@RequestParam Integer id, HttpServletRequest request) {
return leaseOrderService.pay(id, this.getCurrentAccount(request), request);
}
@ApiOperation(value = "发货")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@PostMapping("send")
public ResultBody send(@RequestBody UavOrderExpressVO param) {
return leaseOrderService.send(param);
}
@ApiOperation(value = "用户收货")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@GetMapping("receive")
public ResultBody receive(@RequestParam Integer id, HttpServletRequest request) {
return leaseOrderService.receive(id, this.getCurrentAccount(request));
}
@ApiOperation(value = "归还商品")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@GetMapping("giveBack")
public ResultBody giveBack(@RequestBody LeaseOrderRefundVO leaseOrderRefundVO, HttpServletRequest request) {
return leaseOrderService.giveBack(leaseOrderRefundVO, this.getCurrentAccount(request));
}
@ApiOperation(value = "平台确认归还")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@PostMapping("pfConfirmOrderWare")
public ResultBody pfConfirmOrderWare(HttpServletRequest request, @RequestBody LeaseOrderRefundVO param) {
return leaseOrderService.pfConfirmOrderWare(this.getCurrentAccount(request), param);
}
@ApiOperation(value = "订单状态列表")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = TranStatusDicDTO.class)})
@GetMapping("statusList")
public ResultBody statusList() {
return leaseOrderService.statusList();
}
@ApiOperation(value = "用户删除订单")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@GetMapping("removeLeaseOrder")
public ResultBody removeLeaseOrder(@RequestParam Integer id) {
return leaseOrderService.removeLeaseOrder(id);
}
}
...@@ -2,6 +2,7 @@ package com.mmc.oms.controller.uav; ...@@ -2,6 +2,7 @@ package com.mmc.oms.controller.uav;
import com.mmc.oms.common.result.ResultBody; import com.mmc.oms.common.result.ResultBody;
import com.mmc.oms.controller.BaseController; import com.mmc.oms.controller.BaseController;
import com.mmc.oms.feign.UserAppApi;
import com.mmc.oms.model.dto.uav.UavCartCompanyDTO; import com.mmc.oms.model.dto.uav.UavCartCompanyDTO;
import com.mmc.oms.model.dto.uav.UavCartDTO; import com.mmc.oms.model.dto.uav.UavCartDTO;
import com.mmc.oms.model.dto.uav.UavOrderDTO; import com.mmc.oms.model.dto.uav.UavOrderDTO;
...@@ -13,6 +14,7 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -13,6 +14,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.util.Arrays;
import java.util.List; import java.util.List;
/** /**
......
...@@ -3,9 +3,7 @@ package com.mmc.oms.controller.uav; ...@@ -3,9 +3,7 @@ package com.mmc.oms.controller.uav;
import com.mmc.oms.common.result.ResultBody; import com.mmc.oms.common.result.ResultBody;
import com.mmc.oms.controller.BaseController; import com.mmc.oms.controller.BaseController;
import com.mmc.oms.model.dto.ContractInfoDTO; import com.mmc.oms.model.dto.ContractInfoDTO;
import com.mmc.oms.model.dto.uav.UavCartCompanyDTO; import com.mmc.oms.model.dto.uav.*;
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.qo.uav.UavOrderQO;
import com.mmc.oms.model.vo.uav.*; import com.mmc.oms.model.vo.uav.*;
import com.mmc.oms.service.uav.UavOrderService; import com.mmc.oms.service.uav.UavOrderService;
...@@ -38,10 +36,10 @@ public class UavOrderController extends BaseController { ...@@ -38,10 +36,10 @@ public class UavOrderController extends BaseController {
} }
@ApiOperation(value = "提交订单-购物车") @ApiOperation(value = "提交订单-购物车")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = UavOrderDTO.class)}) @ApiResponses({@ApiResponse(code = 200, message = "OK", response = MultiUavOrderDTO.class)})
@PostMapping("addOrderByCart") @PostMapping("addOrderByCart")
public ResultBody<UavOrderDTO> addOrderByCart(@RequestBody AddUavOrderByCartQO orderByCartQO, public ResultBody<MultiUavOrderDTO> addOrderByCart(@RequestBody AddUavOrderByCartQO orderByCartQO,
HttpServletRequest request) { HttpServletRequest request) {
return uavOrderService.addOrderByCart(orderByCartQO, this.getCurrentAccount(request)); return uavOrderService.addOrderByCart(orderByCartQO, this.getCurrentAccount(request));
} }
...@@ -143,6 +141,13 @@ public class UavOrderController extends BaseController { ...@@ -143,6 +141,13 @@ public class UavOrderController extends BaseController {
return uavOrderService.removeUavOrder(id); return uavOrderService.removeUavOrder(id);
} }
@ApiOperation(value = "商品评价")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = UavOrderRemarkDTO.class)})
@GetMapping("listGoodsRemark")
public List<UavOrderRemarkDTO> listGoodsRemark(@RequestParam Integer remarkType, @RequestParam Integer goodsId) {
return uavOrderService.listGoodsRemark(remarkType, goodsId);
}
// 设置订单抽成比例 // 设置订单抽成比例
// 微信完成回调-修改订单状态 // 微信完成回调-修改订单状态
......
package com.mmc.oms.dao; package com.mmc.oms.dao;
import com.mmc.oms.entity.mall.UserAddressDO; import com.mmc.oms.entity.mall.UserAddressDO;
import com.mmc.oms.entity.uav.UavOrderExpressDO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import java.util.List; import java.util.List;
......
package com.mmc.oms.dao.data;
import org.apache.ibatis.annotations.Mapper;
/**
* @Author LW
* @date 2023/9/19 10:06
* 概要:
*/
@Mapper
public interface OrderReportDao {
}
package com.mmc.oms.dao.lease;
import com.mmc.oms.entity.lease.LeaseOrderDO;
import com.mmc.oms.entity.lease.LeaseOrderExpressDO;
import com.mmc.oms.entity.lease.LeaseRefundOrderDO;
import com.mmc.oms.entity.transtatus.TranStatusDicDO;
import com.mmc.oms.entity.uav.UavOrderDO;
import com.mmc.oms.model.qo.uav.UavOrderQO;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* @Author LW
* @date 2023/9/21 16:48
* 概要:
*/
@Mapper
public interface LeaseOrderDao {
void addOrder(LeaseOrderDO leaseOrderDO);
void addAddress(LeaseOrderExpressDO leaseOrderExpressDO);
LeaseOrderDO detail(Integer id);
LeaseOrderExpressDO getLeaseOrderExpress(Integer id);
void updateUavOrderStatus(Integer id, Integer code);
void addLeaseRefundOrder(LeaseRefundOrderDO leaseRefundOrderDO);
int countList(UavOrderQO uavOrderQO);
List<LeaseOrderDO> list(UavOrderQO uavOrderQO);
List<LeaseRefundOrderDO> getLeaseRefundOrder(List<Integer> ids);
UavOrderDO detailByNo(String orderNo);
void updateLeaseOrderExpress(LeaseOrderExpressDO leaseOrderExpressDO);
List<TranStatusDicDO> statusList();
void closeShowLeaseOrder(Integer id);
List<LeaseOrderExpressDO> listLeaseOrderExpress(List<Integer> expressIds);
void updateLeaseOrderProportion(Integer id, int proportion);
}
...@@ -23,4 +23,6 @@ public interface UavCartDao { ...@@ -23,4 +23,6 @@ public interface UavCartDao {
List<Integer> countList(Integer userAccountId); List<Integer> countList(Integer userAccountId);
List<UavCartCompanyDO> list(Integer begin, Integer pageSize, Integer userAccountId); List<UavCartCompanyDO> list(Integer begin, Integer pageSize, Integer userAccountId);
UavCartDO countMallGoodsSku(UavCartDO uavCartDO);
} }
...@@ -4,6 +4,7 @@ import com.mmc.oms.entity.uav.*; ...@@ -4,6 +4,7 @@ import com.mmc.oms.entity.uav.*;
import com.mmc.oms.model.qo.uav.UavOrderQO; import com.mmc.oms.model.qo.uav.UavOrderQO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import java.math.BigDecimal;
import java.util.List; import java.util.List;
/** /**
...@@ -42,11 +43,21 @@ public interface UavOrderDao { ...@@ -42,11 +43,21 @@ public interface UavOrderDao {
void checkPay(UavOrderPayDO uavOrderPayDO); void checkPay(UavOrderPayDO uavOrderPayDO);
void addRemarkOrder(UavOrderRemarkDO uavOrderRemarkDO); void addRemarkOrder(List<UavOrderRemarkDO> uavOrderRemarkDOS);
UavOrderPayDO getUavOrderPayById(Integer id); UavOrderPayDO getUavOrderPayById(Integer id);
void updateUavOrderProportion(Integer id, Integer proportion); void updateUavOrderProportion(Integer id, Integer proportion);
void closeShowUavOrder(Integer id); void closeShowUavOrder(Integer id);
void batchAddOrder(List<UavOrderDO> orders);
int getOrderCount();
BigDecimal getSaleOrderGMV();
List<UavOrderRemarkDO> listGoodsRemark(Integer remarkType, Integer goodsId);
void updateUavOrderRemarkStatus(Integer id);
} }
...@@ -18,4 +18,6 @@ public interface UavOrderExpressDao { ...@@ -18,4 +18,6 @@ public interface UavOrderExpressDao {
int updateUavOrderExpressDO(UavOrderExpressDO uavOrderExpressDO); int updateUavOrderExpressDO(UavOrderExpressDO uavOrderExpressDO);
List<UavOrderExpressDO> listNoReceive(); List<UavOrderExpressDO> listNoReceive();
void batchAddOrderExpress(List<UavOrderExpressDO> expressDOS);
} }
package com.mmc.oms.dao.uav;
import com.mmc.oms.entity.uav.UavPayWxDO;
import com.mmc.oms.entity.uav.UavPayWxSubDO;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* @author: zj
* @Date: 2023/9/21 19:36
*/
@Mapper
public interface UavPayWxDao {
UavPayWxDO getUavPayWx(String payNo);
void addUavPayWx(UavPayWxDO uavPayWx);
void batchAddUavPayWxSub(List<UavPayWxSubDO> payWxSubDOS);
List<UavPayWxSubDO> listUavPayWxSub(Integer uavPayWxId);
void finishUavPayWx(String orderNo, String tradeState);
}
package com.mmc.oms.entity.lease;
import com.mmc.oms.model.dto.lease.LeaseOrderDTO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* (LeaseOrderDO)实体类
*
* @author makejava
* @since 2023-09-21 16:59:10
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class LeaseOrderDO implements Serializable {
private static final long serialVersionUID = -58305538180098964L;
private Integer id;
/**
* 订单编号
*/
private String orderNo;
/**
* 订单状态
*/
private Integer statusCode;
/**
* 下单用户id
*/
private Integer userAccountId;
/**
* 租赁商品id
*/
private Integer leaseGoodsId;
/**
* 商家企业名称
*/
private String companyName;
/**
* 商家id
*/
private Integer thirdBackUserAccountId;
/**
* 商品标题
*/
private String orderName;
/**
* sku图片/商品图片
*/
private String skuImg;
/**
* 订单总金额
*/
private BigDecimal orderTotalAmount;
/**
* 抵扣佣金金额
*/
private BigDecimal salaryAmount;
/**
* 抵扣云享金金额
*/
private BigDecimal shareAmount;
/**
* 其他渠道应支付金额
*/
private BigDecimal otherAmount;
/**
* 支付方式,wechatpay微信,alipay支付宝,offline线下
*/
private String payType;
/**
* 用户收货地址id
*/
private Integer userAddressId;
/**
* 买家备注信息
*/
private String userRemark;
/**
* 商家备注信息
*/
private String sellerRemark;
/**
* 支付时间
*/
private Date payTime;
/**
* 确认收货时间(成交时间)
*/
private Date confirmReceiptTime;
/**
* 修改版本
*/
private Integer version;
/**
* 评价状态
*/
private Integer remarkStatus;
/**
* 订单分成比例(平台收取)
*/
private Integer proportion;
/**
* 用户删除(0用户不可看,1用户可看)
* (假删除,后台还能看到)
*/
private Integer showUserPort;
/**
* 生成订单时间(下单时间)
*/
private Date createTime;
/**
* 最近修改时间
*/
private Date updateTime;
/**
* 单价 元/天
*/
private BigDecimal unitPrice;
/**
* 购买的商品数量
*/
private Integer wareNum;
/**
* 押金
*/
private BigDecimal deposit;
/**
* 租约开始日
*/
private Date startDate;
/**
* 租约结束日
*/
private Date endDate;
/**
* 关闭原因
*/
private String shutReason;
/**
* sku
*/
private String sku;
/**
* 发货时间
*/
private Date sendWareTime;
private String modeOfDeliveryInfo;
private BigDecimal shareCashPledge;
private BigDecimal salaryCashPledge;
public LeaseOrderDTO buildLeaseOrderDTO() {
return LeaseOrderDTO.builder().id(id).orderNo(orderNo).statusCode(statusCode).userAccountId(userAccountId)
.thirdBackUserAccountId(thirdBackUserAccountId).companyName(companyName).orderTotalAmount(orderTotalAmount)
.salaryAmount(salaryAmount).shareAmount(shareAmount).otherAmount(otherAmount).payType(payType).payTime(payTime)
.startDate(startDate).endDate(endDate).userRemark(userRemark).sellerRemark(sellerRemark).createTime(createTime)
.confirmReceiptTime(confirmReceiptTime).remarkStatus(remarkStatus).modeOfDeliveryInfo(modeOfDeliveryInfo).sku(sku).skuImg(skuImg).build();
}
}
package com.mmc.oms.entity.lease;
import com.mmc.oms.entity.mall.UserAddressDO;
import com.mmc.oms.model.dto.uav.UavOrderExpressDTO;
import com.mmc.oms.model.vo.lease.LeaseOrderRefundVO;
import com.mmc.oms.model.vo.uav.UavOrderExpressVO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.Date;
/**
* (LeaseOrderExpressDO)实体类
*
* @author makejava
* @since 2023-09-22 15:02:22
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class LeaseOrderExpressDO implements Serializable {
private static final long serialVersionUID = -24578000103219438L;
private Integer id;
private Integer leaseOrderId;
private String sendExpNo;
private String sendExpCode;
/**
* 收货人姓名
*/
private String takeName;
/**
* 收货人电话
*/
private String takePhone;
/**
* 收货地区
*/
private String takeRegion;
/**
* 收货详细地址
*/
private String takeAddress;
private String returnExpNo;
private String returnExpCode;
private Date returnTime;
/**
* 发货时间
*/
private Date sendTime;
/**
* 是否已签收
*/
private Integer receive;
/**
* 收货人签收时间
*/
private Date receiveTime;
private Date updateTime;
private Date createTime;
public LeaseOrderExpressDO(UserAddressDO userAddressDO) {
this.takeName = userAddressDO.getTakeName();
this.takePhone = userAddressDO.getTakePhone();
this.takeRegion = userAddressDO.getTakeRegion();
this.takeAddress = userAddressDO.getTakeAddress();
}
public LeaseOrderExpressDO(UavOrderExpressVO param) {
this.id = param.getId();
this.leaseOrderId = param.getUavOrderId();
this.sendExpNo = param.getSendExpNo();
this.sendExpCode = param.getSendExpCode();
this.takeName = param.getTakeName();
this.takePhone = param.getTakePhone();
this.takeRegion = param.getTakeRegion();
this.takeAddress = param.getTakeAddress();
this.sendTime = new Date();
}
public LeaseOrderExpressDO(LeaseOrderRefundVO leaseOrderRefundVO) {
this.id = leaseOrderRefundVO.getId();
this.leaseOrderId = leaseOrderRefundVO.getOrderId();
this.returnExpNo = leaseOrderRefundVO.getExpressNum();
this.returnExpCode = leaseOrderRefundVO.getExpressCode();
this.receiveTime = new Date();
}
public UavOrderExpressDTO buildUavOrderExpressDTO() {
return UavOrderExpressDTO.builder().id(this.id).uavOrderId(this.leaseOrderId).sendExpNo(this.sendExpNo).sendExpCode(this.sendExpCode).takeName(this.takeName)
.takePhone(this.takePhone).takeAddress(this.takeAddress).takeRegion(this.takeRegion).receive(this.receive).receiveTime(this.receiveTime)
.sendTime(this.sendTime).build();
}
}
package com.mmc.oms.entity.lease;
import com.mmc.oms.model.dto.lease.LeaseRefundOrderDTO;
import com.mmc.oms.model.vo.lease.LeaseOrderRefundVO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.Date;
/**
* (LeaseRefundOrderDO)实体类
*
* @author makejava
* @since 2023-09-23 15:49:05
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class LeaseRefundOrderDO implements Serializable {
private static final long serialVersionUID = -78279245843440398L;
private Integer id;
private Integer leaseOrderId;
/**
* 归还状态:0已归还 1无需归还
*/
private Integer status;
/**
* 物流单号
*/
private String expressNum;
/**
* 图片文件
*/
private String file;
/**
* 原因
*/
private String reason;
private Date createTime;
private Date updateTime;
private Integer leaseOrderExpressId;
private Integer type;
public LeaseRefundOrderDO(LeaseOrderRefundVO leaseOrderRefundVO) {
this.leaseOrderId = leaseOrderRefundVO.getOrderId();
this.status = leaseOrderRefundVO.getStatus();
this.file = leaseOrderRefundVO.getFile();
this.reason = leaseOrderRefundVO.getReason();
}
public LeaseRefundOrderDTO buildLeaseRefundOrderDTO() {
return LeaseRefundOrderDTO.builder().id(this.id).leaseOrderId(this.leaseOrderId)
.status(this.status).file(this.file).reason(this.reason)
.createTime(this.createTime).build();
}
}
package com.mmc.oms.entity.uav; package com.mmc.oms.entity.uav;
import com.mmc.oms.model.dto.uav.UavOrderRemarkDTO;
import com.mmc.oms.model.vo.uav.UavOrderRemarkVO; import com.mmc.oms.model.vo.uav.UavOrderRemarkVO;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
...@@ -8,6 +9,7 @@ import lombok.Data; ...@@ -8,6 +9,7 @@ import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date;
/** /**
* @author: zj * @author: zj
...@@ -21,6 +23,8 @@ public class UavOrderRemarkDO implements Serializable { ...@@ -21,6 +23,8 @@ public class UavOrderRemarkDO implements Serializable {
private static final long serialVersionUID = 3316555339556069007L; private static final long serialVersionUID = 3316555339556069007L;
@ApiModelProperty(value = "评价id") @ApiModelProperty(value = "评价id")
private Integer id; private Integer id;
@ApiModelProperty(value = "评价类型,0商城,1租赁")
private Integer remarkType;
@ApiModelProperty(value = "商品id") @ApiModelProperty(value = "商品id")
private Integer mallGoodsId; private Integer mallGoodsId;
@ApiModelProperty(value = "订单id") @ApiModelProperty(value = "订单id")
...@@ -31,6 +35,14 @@ public class UavOrderRemarkDO implements Serializable { ...@@ -31,6 +35,14 @@ public class UavOrderRemarkDO implements Serializable {
private String uavImages; private String uavImages;
@ApiModelProperty(value = "评论内容") @ApiModelProperty(value = "评论内容")
private String content; private String content;
@ApiModelProperty(value = "生成时间")
private Date createTime;
public UavOrderRemarkDTO buildUavOrderRemarkDTO() {
return UavOrderRemarkDTO.builder().id(this.id).remarkType(this.remarkType).mallGoodsId(this.mallGoodsId)
.uavOrderId(this.uavOrderId).remarkLevel(this.remarkLevel).content(this.content).uavImages(this.uavImages)
.createTime(this.createTime).build();
}
public UavOrderRemarkDO(UavOrderRemarkVO uavOrderRemarkVO){ public UavOrderRemarkDO(UavOrderRemarkVO uavOrderRemarkVO){
this.id = uavOrderRemarkVO.getId(); this.id = uavOrderRemarkVO.getId();
......
package com.mmc.oms.entity.uav;
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;
import java.util.List;
/**
* @author: zj
* @Date: 2023/9/21 16:59
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("多订单支付总记录")
public class UavPayWxDO implements Serializable {
private static final long serialVersionUID = 3003931182943391633L;
private Integer id;
private String payNo;
private BigDecimal amount;
private String tradeState;
private Date createTime;
private List<UavPayWxSubDO> payWxSubDOS;
}
package com.mmc.oms.entity.uav;
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/21 19:27
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("订单微信支付记录")
public class UavPayWxSubDO implements Serializable {
private static final long serialVersionUID = -1446318972494082705L;
private Integer id;
private Integer uavPayWxId;
private Integer uavOrderId;
private String orderNo;
private BigDecimal amount;
private Date createTime;
}
package com.mmc.oms.enums;
/**
* @author: zj
* @Date: 2023/9/4 14:36
*/
public enum LeaseOrderStatus {
PLACED_AN_ORDER(100, "已下单", "待付款"),
PAID(200, "已付款", "待发货"),
SHIPPED(300, "卖家已发货", "待买家收货"),
TO_BE_RETURNED(400, "待归还", "待归还"),
WAITING_MERCHANT_CONFIRM(500, "等待商家确认", "等待商家确认"),
REMAIN_TO_BE_EVALUATED(600, "待评价", "待评价"),
COMPLETE_TRANSACTION(700, "交易完成", "交易完成"),
APPLY_REFUND(800, "申请退款", "退款中"),
CLOSE(999, "订单关闭", "订单关闭");
public Integer getCode() {
return code;
}
public String getDoing() {
return doing;
}
public String getWaiting() {
return waiting;
}
LeaseOrderStatus(Integer code, String doing, String waiting) {
this.code = code;
this.doing = doing;
this.waiting = waiting;
}
private Integer code;
private String doing;
private String waiting;
}
package com.mmc.oms.enums;
/**
* @author: lw
* @Date: 2023/9/4 14:36
*/
public enum LeaseTermInfo {
THREE_DAY(1, 3, "三天"),
SEVEN_DAY(2, 7, "七天"),
THIRTY_DAY(3, 30, "三十天"),
NINETY_DAY(4, 90, "九十天"),
ONE_HUNDRED_AND_EIGHTY_DAY(5, 180, "一百八十天");
public Integer getId() {
return id;
}
public Integer getDays() {
return days;
}
public String getDescription() {
return description;
}
LeaseTermInfo(Integer id, Integer days, String description) {
this.id = id;
this.days = days;
this.description = description;
}
private Integer id;
private Integer days;
private String description;
}
package com.mmc.oms.enums;
/**
* @author 作者 lw
* @version 创建时间:2023年09月26日 下午10:57:12
* @explain 类说明
*/
public enum OrderType {
REC(1, "客户收货"), RETURN(2, "归还"), PFREC(3, "平台收货"), RETREAT(4, "申请退款");
OrderType(Integer code, String status) {
this.code = code;
this.status = status;
}
private Integer code;
private String status;
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
}
package com.mmc.oms.feign;
import com.mmc.oms.common.result.ResultBody;
import com.mmc.oms.feign.hystrix.ImsApiHystrix;
import com.mmc.oms.model.dto.data.ReleaseReportDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
/**
* @Author LW
* @date 2023/6/15 10:46 概要:
*/
@FeignClient(url = "${ims.url}", name = "ims", fallback = ImsApiHystrix.class)
public interface ImsAppApi {
@GetMapping("/report/getReleaseReportData")
ResultBody<ReleaseReportDTO> getUserReportData();
}
...@@ -4,8 +4,12 @@ import com.mmc.oms.common.result.ResultBody; ...@@ -4,8 +4,12 @@ import com.mmc.oms.common.result.ResultBody;
import com.mmc.oms.feign.hystrix.PmsAppApiHystrix; import com.mmc.oms.feign.hystrix.PmsAppApiHystrix;
import com.mmc.oms.model.dto.uav.UavCartDTO; import com.mmc.oms.model.dto.uav.UavCartDTO;
import com.mmc.oms.model.qo.uav.PriceStockQO; import com.mmc.oms.model.qo.uav.PriceStockQO;
import com.mmc.oms.model.vo.lease.LeaseGoodsVO;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List; import java.util.List;
...@@ -20,4 +24,7 @@ public interface PmsAppApi { ...@@ -20,4 +24,7 @@ public interface PmsAppApi {
@PostMapping("app/goods/listPriceStock") @PostMapping("app/goods/listPriceStock")
List<UavCartDTO> listPriceStock(@RequestBody List<PriceStockQO> priceStockQOS); List<UavCartDTO> listPriceStock(@RequestBody List<PriceStockQO> priceStockQOS);
@GetMapping("app/lease/leaseGoodsDetails")
ResultBody<LeaseGoodsVO> leaseGoodsDetails(@RequestParam Integer id);
} }
...@@ -38,6 +38,9 @@ public interface UserAppApi { ...@@ -38,6 +38,9 @@ public interface UserAppApi {
@GetMapping("company/getManagerIdByBackUserId") @GetMapping("company/getManagerIdByBackUserId")
public ResultBody getManagerIdByBackUserId(@RequestParam Integer backUserAccountId, @RequestHeader String token); public ResultBody getManagerIdByBackUserId(@RequestParam Integer backUserAccountId, @RequestHeader String token);
@PostMapping("user-account/feignListUserAccountByIds")
List<UserAccountSimpleDTO> feignListUserAccountByIds(@RequestBody List<Integer> ids, @RequestHeader("token") String token);
/** /**
* 获取小程序用户集合列表页面 * 获取小程序用户集合列表页面
* *
......
package com.mmc.oms.feign.config; package com.mmc.oms.feign.config;
import com.mmc.oms.feign.hystrix.ImsApiHystrix;
import com.mmc.oms.feign.hystrix.PmsAppApiHystrix; import com.mmc.oms.feign.hystrix.PmsAppApiHystrix;
import com.mmc.oms.feign.hystrix.UserAppApiHystrix; import com.mmc.oms.feign.hystrix.UserAppApiHystrix;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
...@@ -24,4 +25,8 @@ public class FeignConfiguration { ...@@ -24,4 +25,8 @@ public class FeignConfiguration {
return new UserAppApiHystrix(); return new UserAppApiHystrix();
} }
@Bean(name = "imsApiHystrix")
public ImsApiHystrix imsAppApi() {
return new ImsApiHystrix();
}
} }
package com.mmc.oms.feign.hystrix;
import com.mmc.oms.common.result.ResultBody;
import com.mmc.oms.feign.ImsAppApi;
import com.mmc.oms.model.dto.data.ReleaseReportDTO;
import lombok.extern.slf4j.Slf4j;
/**
* @Author LW
* @date 2023/6/15 10:47 概要:
*/
@Slf4j
public class ImsApiHystrix implements ImsAppApi {
@Override
public ResultBody<ReleaseReportDTO> getUserReportData() {
log.error("熔断:ImsApiHystrix.getUserReportData");
return null;
}
}
...@@ -5,8 +5,8 @@ import com.mmc.oms.common.result.ResultBody; ...@@ -5,8 +5,8 @@ import com.mmc.oms.common.result.ResultBody;
import com.mmc.oms.feign.PmsAppApi; import com.mmc.oms.feign.PmsAppApi;
import com.mmc.oms.model.dto.uav.UavCartDTO; import com.mmc.oms.model.dto.uav.UavCartDTO;
import com.mmc.oms.model.qo.uav.PriceStockQO; import com.mmc.oms.model.qo.uav.PriceStockQO;
import com.mmc.oms.model.vo.lease.LeaseGoodsVO;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.List; import java.util.List;
...@@ -18,7 +18,7 @@ import java.util.List; ...@@ -18,7 +18,7 @@ import java.util.List;
public class PmsAppApiHystrix implements PmsAppApi { public class PmsAppApiHystrix implements PmsAppApi {
@Override @Override
public ResultBody feignLeaseGoodsInfoByAddressId(Integer id) { public ResultBody feignLeaseGoodsInfoByAddressId(Integer id) {
log.info("熔断:PmsAppApiHystrix.feignLeaseGoodsInfoByAddressId==error==>param:{}",id); log.info("熔断:PmsAppApiHystrix.feignLeaseGoodsInfoByAddressId==error==>param:{}", id);
return null; return null;
} }
...@@ -27,4 +27,10 @@ public class PmsAppApiHystrix implements PmsAppApi { ...@@ -27,4 +27,10 @@ public class PmsAppApiHystrix implements PmsAppApi {
log.info("熔断:PmsAppApiHystrix.listPriceStock==error==>param:{}", JSONObject.toJSONString(priceStockQOS)); log.info("熔断:PmsAppApiHystrix.listPriceStock==error==>param:{}", JSONObject.toJSONString(priceStockQOS));
return null; return null;
} }
@Override
public ResultBody<LeaseGoodsVO> leaseGoodsDetails(Integer id) {
log.info("熔断:PmsAppApiHystrix.leaseGoodsDetails==error==>param:{}", id);
return null;
}
} }
...@@ -52,6 +52,12 @@ public class UserAppApiHystrix implements UserAppApi { ...@@ -52,6 +52,12 @@ public class UserAppApiHystrix implements UserAppApi {
} }
@Override @Override
public List<UserAccountSimpleDTO> feignListUserAccountByIds(List<Integer> ids, String token) {
log.error("熔断:UserAppApiHystrix.feignListUserAccountByIds:{}", ids);
return null;
}
@Override
public List<UserAccountSimpleDTO> feignListAppUserAccount(UserAccountQO userAccountQO, String token) { public List<UserAccountSimpleDTO> feignListAppUserAccount(UserAccountQO userAccountQO, String token) {
log.error("熔断:UserAppApiHystrix.feignListAppUserAccount:{}", userAccountQO); log.error("熔断:UserAppApiHystrix.feignListAppUserAccount:{}", userAccountQO);
return null; return null;
......
...@@ -39,7 +39,10 @@ public class AuthSignatureFilter implements AuthFilter { ...@@ -39,7 +39,10 @@ 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", "/oms/uav-order/finishSign", "/oms/uav-order/statusList"}; 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",
"/oms/uav-order/listGoodsRemark"
};
/*无需加密狗无需登录白名单*/ /*无需加密狗无需登录白名单*/
private static final String[] USE_KEY = {"/oms/account/loginByUsbKey"}; private static final String[] USE_KEY = {"/oms/account/loginByUsbKey"};
......
package com.mmc.oms.model.dto.data;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.math.BigDecimal;
/**
* @Author LW
* @date 2023/9/16 14:15
* 概要:
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class OrderReportDTO {
@ApiModelProperty(value = "商城售卖订单总数")
private Integer saleOrderCount;
@ApiModelProperty(value = "商品租赁订单总数")
private Integer leaseOrderCount;
@ApiModelProperty(value = "服务订单订单总数")
private Integer serviceOrderCount;
@ApiModelProperty(value = "商城售卖交易总额")
private BigDecimal saleGMV;
@ApiModelProperty(value = "商品租赁交易总额")
private BigDecimal leaseGMV;
@ApiModelProperty(value = "服务订单交易总额")
private BigDecimal serviceGMV;
@ApiModelProperty(value = "交易总额")
private BigDecimal totalGMV;
}
package com.mmc.oms.model.dto.data;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.math.BigDecimal;
/**
* @Author LW
* @date 2023/9/16 14:15
* 概要:
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class ReleaseReportDTO {
@ApiModelProperty(value = "信息发布总数")
private Integer releaseCount;
@ApiModelProperty(value = "订单发布数量")
private Integer orderReleaseCount;
@ApiModelProperty(value = "帖子发布数量")
private Integer postsReleaseCount;
@ApiModelProperty(value = "话题发布数量")
private Integer topicReleaseCount;
@ApiModelProperty(value = "订单金额")
private BigDecimal serviceOrderAmount;
}
package com.mmc.oms.model.dto.lease;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mmc.oms.model.dto.kdn.KdnExpDTO;
import com.mmc.oms.model.dto.uav.UavOrderExpressDTO;
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;
/**
* @author: lw
* @Date: 2023/9/4 14:50
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@ApiModel(description = "最新版-订单")
public class LeaseOrderDTO implements Serializable {
private static final long serialVersionUID = 7548192478556457453L;
@ApiModelProperty("id")
private Integer id;
@ApiModelProperty("订单编号")
private String orderNo;
@ApiModelProperty("订单状态")
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("卖家企业名称")
private String companyName;
@ApiModelProperty("订单实付总额")
private BigDecimal orderTotalAmount;
@ApiModelProperty("订单需付金额")
private BigDecimal needPayAmount;
@ApiModelProperty("抵扣佣金余额")
private BigDecimal salaryAmount;
@ApiModelProperty("抵扣云享金余额")
private BigDecimal shareAmount;
@ApiModelProperty("其他方式支付额度")
private BigDecimal otherAmount;
@ApiModelProperty("wechatpay微信,alipay支付宝,offline线下")
private String payType;
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@ApiModelProperty("租赁开始时间")
private Date startDate;
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@ApiModelProperty("租赁结束时间")
private Date endDate;
@ApiModelProperty("买家备注")
private String userRemark;
@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(value = "修改版本", hidden = true)
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;
@ApiModelProperty("快递信息")
private KdnExpDTO kdnExpDTO;
@ApiModelProperty("订单规格列表")
private String sku;
@ApiModelProperty("sku图片")
private String skuImg;
@ApiModelProperty("运费")
private String modeOfDeliveryInfo;
@ApiModelProperty("发货后申请退款")
private LeaseRefundOrderDTO leaseRefundOrder;
@ApiModelProperty("商户确认收货信息")
private LeaseRefundOrderDTO storeReceiveOrder;
}
package com.mmc.oms.model.dto.lease;
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;
/**
* @Author LW
* @date 2023/9/25 14:19
* 概要:
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class LeaseRefundOrderDTO implements Serializable {
@ApiModelProperty("id")
private Integer id;
@ApiModelProperty("订单id")
private Integer leaseOrderId;
@ApiModelProperty("归还状态:0已归还 1无需归还")
private Integer status;
@ApiModelProperty("快递单号")
private String expressNum;
@ApiModelProperty("物流编号")
private String expressCode;
@ApiModelProperty("图片文件")
private String file;
@ApiModelProperty("退款原因")
private String reason;
@ApiModelProperty("创建时间")
private Date createTime;
}
...@@ -17,12 +17,13 @@ import java.io.Serializable; ...@@ -17,12 +17,13 @@ import java.io.Serializable;
@Data @Data
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
//@ApiModel(value = "com.mmc.csf.model.dto.TranStatusDicDTO", description = "订单状态DTO")
public class TranStatusDicDTO implements Serializable { public class TranStatusDicDTO implements Serializable {
private static final long serialVersionUID = -5956006425413101797L; private static final long serialVersionUID = -5956006425413101797L;
@ApiModelProperty(value = "状态码") @ApiModelProperty(value = "状态码")
private String status; private String status;
@ApiModelProperty(value = "当前状态描述")
private String doing; private String doing;
@ApiModelProperty(value = "等待状态描述")
private String waiting; private String waiting;
private String leaseOrderStatus; private String leaseOrderStatus;
} }
package com.mmc.oms.model.dto.uav;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
/**
* @author: zj
* @Date: 2023/9/21 16:11
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
public class MultiUavOrderDTO implements Serializable {
private static final long serialVersionUID = -935420087357754202L;
private BigDecimal allOtherAmount;
private String payNo;
private List<UavOrderDTO> uavOrderDTOS;
}
...@@ -22,8 +22,16 @@ public class UavCartCompanyDTO implements Serializable { ...@@ -22,8 +22,16 @@ public class UavCartCompanyDTO implements Serializable {
private static final long serialVersionUID = -6785504068213761405L; private static final long serialVersionUID = -6785504068213761405L;
@ApiModelProperty(value = "商家id") @ApiModelProperty(value = "商家id")
private Integer thirdBackUserAccountId; private Integer thirdBackUserAccountId;
@ApiModelProperty(value = "商家名称") @ApiModelProperty(value = "商家名称")
private String companyName; private String companyName;
@ApiModelProperty("是否抵扣云享金,0否,1是")
private Integer deductShareAmount;
@ApiModelProperty("是否抵扣余额,0否,1是")
private Integer deductSalaryAmount;
@ApiModelProperty(value = "购物车对应规格") @ApiModelProperty(value = "购物车对应规格")
private List<UavCartDTO> uavCartDOS; private List<UavCartDTO> uavCartDOS;
} }
...@@ -24,9 +24,9 @@ public class UavCartDTO implements Serializable { ...@@ -24,9 +24,9 @@ public class UavCartDTO implements Serializable {
private Integer id; private Integer id;
@ApiModelProperty(value = "用户ID") @ApiModelProperty(value = "用户ID")
private Integer userAccountId; private Integer userAccountId;
@ApiModelProperty(value = "商家id") @ApiModelProperty(value = "商家id", hidden = true)
private Integer thirdBackUserAccountId; private Integer thirdBackUserAccountId;
@ApiModelProperty(value = "商家名称") @ApiModelProperty(value = "商家名称", hidden = true)
private String companyName; private String companyName;
@ApiModelProperty(value = "商品id") @ApiModelProperty(value = "商品id")
private Integer mallGoodsId; private Integer mallGoodsId;
...@@ -48,6 +48,8 @@ public class UavCartDTO implements Serializable { ...@@ -48,6 +48,8 @@ public class UavCartDTO implements Serializable {
private Date createTime; private Date createTime;
@ApiModelProperty(value = "是否展示价格,0 不显示 1显示") @ApiModelProperty(value = "是否展示价格,0 不显示 1显示")
private Integer priceShow; private Integer priceShow;
@ApiModelProperty(value = "是否删除")
private Integer deleted;
@ApiModelProperty(value = "是否上架状态:0: 下架 1:上架") @ApiModelProperty(value = "是否上架状态:0: 下架 1:上架")
private Integer shelfStatus; private Integer shelfStatus;
} }
package com.mmc.oms.model.dto.uav;
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;
/**
* @author: zj
* @Date: 2023/9/23 15:05
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class UavOrderRemarkDTO implements Serializable {
private static final long serialVersionUID = 2751635245494487278L;
@ApiModelProperty(value = "评价id")
private Integer id;
@ApiModelProperty(value = "评价类型,0商城,1租赁")
private Integer remarkType;
@ApiModelProperty(value = "订单id")
private Integer uavOrderId;
@ApiModelProperty(value = "商品id")
private Integer mallGoodsId;
@ApiModelProperty(value = "评分")
private Integer remarkLevel;
@ApiModelProperty(value = "图片地址,‘,’隔开")
private String uavImages;
@ApiModelProperty(value = "评论内容")
private String content;
@ApiModelProperty(value = "生成时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
private Date createTime;
}
...@@ -19,8 +19,6 @@ import java.io.Serializable; ...@@ -19,8 +19,6 @@ import java.io.Serializable;
@AllArgsConstructor @AllArgsConstructor
public class UavCartQO implements Serializable { public class UavCartQO implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "订单类型,0正常订单,1意向订单", required = true)
private Integer orderType;
@ApiModelProperty(value = "页码", required = true) @ApiModelProperty(value = "页码", required = true)
@NotNull(message = "页码不能为空", groups = Page.class) @NotNull(message = "页码不能为空", groups = Page.class)
......
package com.mmc.oms.model.vo.lease;
import com.fasterxml.jackson.annotation.JsonFormat;
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: lw
* @Date: 2023/9/21 16:01
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class AddLeaseOrderVO implements Serializable {
private static final long serialVersionUID = 2749055915508197141L;
@ApiModelProperty("商家id")
private Integer thirdBackUserAccountId;
@ApiModelProperty("卖家企业名称")
private String companyName;
@ApiModelProperty("租赁商品id")
private Integer leaseGoodsId;
@ApiModelProperty("收货地址id")
private Integer userAddressId;
@ApiModelProperty(value = "订单实付总额", hidden = true)
private BigDecimal orderTotalAmount;
@ApiModelProperty(value = "抵扣钱包余额", hidden = true)
private BigDecimal walletAmount;
@ApiModelProperty(value = "抵扣云享金余额", hidden = true)
private BigDecimal shareAmount;
@ApiModelProperty(value = "云享金抵扣押金金额", hidden = true)
private BigDecimal shareCashPledgeAmount;
@ApiModelProperty(value = "余额抵扣押金金额", hidden = true)
private BigDecimal salaryCashPledgeAmount;
@ApiModelProperty(value = "其他方式支付额度", hidden = true)
private BigDecimal otherAmount;
@ApiModelProperty(value = "租期", hidden = true)
private Integer leaseTerm;
@ApiModelProperty("用户备注")
private String userRemark;
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@ApiModelProperty("租赁开始时间")
private Date startDate;
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@ApiModelProperty("租赁结束时间")
private Date endDate;
@ApiModelProperty("购买数量")
private Integer wareNum;
@ApiModelProperty(value = "单价", hidden = true)
private BigDecimal unitPrice;
@ApiModelProperty(value = "押金", hidden = true)
private BigDecimal deposit;
@ApiModelProperty("sku")
private String sku;
@ApiModelProperty("是否抵扣云享金,0否,1是")
private Integer deductShareAmount;
@ApiModelProperty("是否抵扣余额,0否,1是")
private Integer deductSalaryAmount;
}
package com.mmc.oms.model.vo.lease;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mmc.oms.common.publicinterface.Create;
import com.mmc.oms.common.publicinterface.Update;
import com.mmc.oms.model.vo.uav.GoodsResourcesVO;
import com.mmc.oms.model.vo.uav.SpecAttrVO;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
* @Author LW
* @date 2023/7/24 17:44
* 概要:
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class LeaseGoodsVO implements Serializable {
private static final long serialVersionUID = -3147170430919703826L;
@ApiModelProperty(value = "id", example = "1")
@NotNull(message = "id不能为空", groups = {Update.class})
private Integer id;
@ApiModelProperty(value = "商品标题", example = "商品标题", required = true)
@NotEmpty(message = "商品标题不能为空", groups = {Update.class, Create.class})
private String tradeName;
@ApiModelProperty(value = "商品卖点", example = "商品卖点")
private String sellingPoint;
@ApiModelProperty(value = "商品成新", example = "1", required = true)
private Integer level;
@ApiModelProperty(value = "商品状态 :0下架 1上架", example = "1", required = true)
@NotNull(message = "商品状态不能为空", groups = {Update.class, Create.class})
private Integer shelfStatus;
@ApiModelProperty(value = "商品类型id", example = "1", required = true)
@NotNull(message = "商品类型id不能为空", groups = {Update.class, Create.class})
private Integer productTypeId;
@ApiModelProperty(value = "品牌id", example = "2", required = true)
@NotNull(message = "品牌id不能为空", groups = {Update.class, Create.class})
private Integer brandInfoId;
@ApiModelProperty(value = "型号id", example = "2", required = true)
@NotNull(message = "型号id不能为空", groups = {Update.class, Create.class})
private Integer deviceModeId;
@ApiModelProperty(value = "商品参数", example = "示例:[{\"起飞重量\":\"595g\"}]")
private String productParam;
@ApiModelProperty(value = "商品资源:图片or视频及其他")
@NotEmpty(message = "图片不能为空")
private List<GoodsResourcesVO> resourcesList;
@ApiModelProperty(value = "规格")
@NotEmpty(message = "规格不能为空", groups = {Update.class, Create.class})
private List<SpecAttrVO> specAttrList;
@ApiModelProperty(value = "价格库存排列组合表信息")
private List<LeasePriceStockVO> priceStock;
@ApiModelProperty(value = "商品详情 富文本")
private String productDetails;
@ApiModelProperty(value = "最短租期")
private Integer minLeaseTerm;
@ApiModelProperty(value = "最长租期")
private Integer maxLeaseTerm;
@ApiModelProperty(value = "发货地址")
private Integer shipAddress;
@ApiModelProperty(value = "归还地址")
private Integer returnAddress;
@ApiModelProperty(value = "寄出物流")
private String logisticsCompany;
@ApiModelProperty(value = "配送方式")
private Integer modeOfDelivery;
@ApiModelProperty(value = "展示最低价", example = "1")
private BigDecimal showPrice;
@ApiModelProperty(value = "创建时间 用作列表回显", hidden = true)
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date createTime;
@ApiModelProperty(value = "店铺id 小程序用", hidden = true)
private Integer userAccountId;
@ApiModelProperty(value = "押金范围", hidden = true)
private String cashPledgeRange;
@ApiModelProperty(value = "租金范围", hidden = true)
private String rentalRange;
@ApiModelProperty(value = "库存", hidden = true)
private Integer stock;
@ApiModelProperty(value = "市code编码")
private String districtCode;
@ApiModelProperty(value = "类型名称", hidden = true)
private String productTypeName;
@ApiModelProperty(value = "品牌名称", hidden = true)
private String brandName;
@ApiModelProperty(value = "型号名称", hidden = true)
private String deviceModeName;
@ApiModelProperty(value = "配送方式信息", hidden = true)
private String modeOfDeliveryInfo;
@ApiModelProperty(value = "企业名称", hidden = true)
private String companyName;
}
package com.mmc.oms.model.vo.lease;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @Author LW
* @date 2023/9/23 15:36
* 概要:
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class LeaseOrderRefundVO implements Serializable {
@ApiModelProperty("id")
private Integer id;
@ApiModelProperty("订单id")
private Integer orderId;
@ApiModelProperty("归还状态 0已归还 1无需归还(注:发货后申请退款需要传,归还商品的时候不需要)")
private Integer status;
@ApiModelProperty("商家确认商品是否破损 0:未破损 1:破损")
private Integer damage;
@ApiModelProperty("物流单号")
private String expressNum;
@ApiModelProperty(value = "物流编码")
private String expressCode;
@ApiModelProperty("图片文件")
private String file;
@ApiModelProperty("原因")
private String reason;
}
package com.mmc.oms.model.vo.lease;
import com.mmc.oms.common.publicinterface.Create;
import com.mmc.oms.common.publicinterface.Update;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.Max;
import javax.validation.constraints.NotEmpty;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* @Author LW
* @date 2023/8/8 10:48
* 概要:
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class LeasePriceStockVO implements Serializable {
private static final long serialVersionUID = 1011141620995647903L;
@ApiModelProperty(value = "id", example = "1")
private Integer id;
@ApiModelProperty(value = "商品规格", example = "示例:{\"颜色\":\"蓝色\",\"尺寸\":\"1寸\",\"大小\":\"小\"} 或 [\"颜色\":\"蓝色\",\"尺寸\":\"1寸\",\"大小\":\"小\"] 或 你怎么方便怎么来")
@NotEmpty(message = "商品规格不能为空", groups = {Update.class, Create.class})
private String productSpec;
@ApiModelProperty(value = "押金", example = "1")
private BigDecimal cashPledge;
@ApiModelProperty(value = "3天租金", example = "1")
private BigDecimal threeDaysRental;
@ApiModelProperty(value = "7天租金", example = "1")
private BigDecimal sevenDaysRental;
@ApiModelProperty(value = "30天租金", example = "1")
private BigDecimal thirtyDaysRental;
@ApiModelProperty(value = "90天租金", example = "1")
private BigDecimal ninetyDaysRental;
@ApiModelProperty(value = "180天租金", example = "1")
private BigDecimal maxDaysRental;
@ApiModelProperty(value = "sku图片", example = "https://pad-video-x.oss-cn-shenzhen.aliyuncs.com/file/35bbd044-7cd7-4c85-ba27-69776e03dbb2.jpg")
private String skuImage;
@ApiModelProperty(value = "库存", example = "10")
@Max(message = "最大不能超过9999", groups = {Update.class, Create.class}, value = 9999)
private Integer stock;
@ApiModelProperty(value = "是否缺货 0:否 1:是")
private Integer stockOut;
}
...@@ -27,12 +27,6 @@ public class AddUavOrderByCartQO implements Serializable { ...@@ -27,12 +27,6 @@ public class AddUavOrderByCartQO implements Serializable {
@ApiModelProperty("用户备注") @ApiModelProperty("用户备注")
private String userRemark; private String userRemark;
@ApiModelProperty("是否抵扣云享金,0否,1是")
private Integer deductShareAmount;
@ApiModelProperty("是否抵扣余额,0否,1是")
private Integer deductSalaryAmount;
@ApiModelProperty("每家商户对应的规格") @ApiModelProperty("每家商户对应的规格")
private List<UavCartCompanyDTO> cartCompanyDTOS; private List<UavCartCompanyDTO> cartCompanyDTOS;
} }
package com.mmc.oms.service.data;
import com.mmc.oms.common.result.ResultBody;
import com.mmc.oms.model.dto.data.OrderReportDTO;
/**
* @Author LW
* @date 2023/9/19 10:05
* 概要:
*/
public interface OrderReportService {
ResultBody<OrderReportDTO> getOrderReportData();
}
package com.mmc.oms.service.data.impl;
import com.mmc.oms.common.result.ResultBody;
import com.mmc.oms.dao.uav.UavOrderDao;
import com.mmc.oms.feign.ImsAppApi;
import com.mmc.oms.model.dto.data.OrderReportDTO;
import com.mmc.oms.model.dto.data.ReleaseReportDTO;
import com.mmc.oms.service.data.OrderReportService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.math.BigDecimal;
/**
* @Author LW
* @date 2023/9/19 10:05
* 概要:
*/
@Service
public class OrderReportServiceImpl implements OrderReportService {
@Resource
private UavOrderDao uavOrderDao;
@Resource
private ImsAppApi imsAppApi;
@Override
public ResultBody<OrderReportDTO> getOrderReportData() {
OrderReportDTO orderReportDTO = new OrderReportDTO();
// 获取商城订单数量
int saleOrderCount = uavOrderDao.getOrderCount();
orderReportDTO.setSaleOrderCount(saleOrderCount);
// 获取租赁订单数量// todo 暂时默认0
int leaseOrderCount = 0;
orderReportDTO.setLeaseOrderCount(leaseOrderCount);
// 获取服务订单总数
ResultBody<ReleaseReportDTO> userReportData = imsAppApi.getUserReportData();
int serviceOrderCount = userReportData.getResult().getOrderReleaseCount();
orderReportDTO.setServiceOrderCount(serviceOrderCount);
// 获取商城订单GMV
BigDecimal saleGMV = uavOrderDao.getSaleOrderGMV();
orderReportDTO.setSaleGMV(saleGMV);
// 获取租赁订单GMV // todo 暂时默认0
BigDecimal leaseGMV = BigDecimal.ZERO;
orderReportDTO.setLeaseGMV(leaseGMV);
BigDecimal serviceGMV = userReportData.getResult().getServiceOrderAmount();
orderReportDTO.setServiceGMV(serviceGMV);
// 获取总GMV
orderReportDTO.setTotalGMV(saleGMV.add(leaseGMV).add(serviceGMV));
return ResultBody.success(orderReportDTO);
}
}
...@@ -9,17 +9,18 @@ import com.mmc.oms.common.util.TDateUtil; ...@@ -9,17 +9,18 @@ import com.mmc.oms.common.util.TDateUtil;
import com.mmc.oms.controller.demand.util.EmojiUtils; import com.mmc.oms.controller.demand.util.EmojiUtils;
import com.mmc.oms.dao.demand.DemandReleaseOrderDao; import com.mmc.oms.dao.demand.DemandReleaseOrderDao;
import com.mmc.oms.dao.demand.PublishServiceOrderDao; import com.mmc.oms.dao.demand.PublishServiceOrderDao;
import com.mmc.oms.dao.lease.LeaseOrderDao;
import com.mmc.oms.dao.topup.TopUpOrderDao; import com.mmc.oms.dao.topup.TopUpOrderDao;
import com.mmc.oms.dao.uav.UavOrderDao; import com.mmc.oms.dao.uav.UavOrderDao;
import com.mmc.oms.dao.uav.UavPayWxDao;
import com.mmc.oms.entity.demand.DemandReleaseOrderDO; import com.mmc.oms.entity.demand.DemandReleaseOrderDO;
import com.mmc.oms.entity.demand.GetOrderNumberDO; import com.mmc.oms.entity.demand.GetOrderNumberDO;
import com.mmc.oms.entity.demand.GetOrderNumberDTO; import com.mmc.oms.entity.demand.GetOrderNumberDTO;
import com.mmc.oms.entity.demand.ServiceRequirementsDO; import com.mmc.oms.entity.demand.ServiceRequirementsDO;
import com.mmc.oms.entity.topup.TopUpOrderDO; import com.mmc.oms.entity.topup.TopUpOrderDO;
import com.mmc.oms.entity.uav.UavOrderDO; import com.mmc.oms.entity.uav.UavOrderDO;
import com.mmc.oms.enums.UavOrderStatus; import com.mmc.oms.entity.uav.UavPayWxDO;
import com.mmc.oms.feign.UserAppApi; import com.mmc.oms.feign.UserAppApi;
import com.mmc.oms.model.dto.uav.PayWalletDTO;
import com.mmc.oms.model.vo.demand.CommonPaymentVO; import com.mmc.oms.model.vo.demand.CommonPaymentVO;
import com.mmc.oms.model.vo.demand.DemandReleaseOrderVO; import com.mmc.oms.model.vo.demand.DemandReleaseOrderVO;
import com.mmc.oms.model.vo.demand.OrderRequestParamsVO; import com.mmc.oms.model.vo.demand.OrderRequestParamsVO;
...@@ -39,7 +40,6 @@ import org.springframework.web.client.RestTemplate; ...@@ -39,7 +40,6 @@ import org.springframework.web.client.RestTemplate;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
...@@ -81,8 +81,14 @@ public class DemandReleaseOrderServiceImpl implements DemandReleaseOrderService ...@@ -81,8 +81,14 @@ public class DemandReleaseOrderServiceImpl implements DemandReleaseOrderService
private TopUpOrderDao topUpOrderDao; private TopUpOrderDao topUpOrderDao;
@Autowired @Autowired
private UavPayWxDao uavPayWxDao;
@Autowired
private UserAppApi userAppApi; private UserAppApi userAppApi;
@Autowired
private LeaseOrderDao leaseOrderDao;
@Override @Override
public ResultBody publish(DemandReleaseOrderVO demandReleaseOrderVO, HttpServletRequest request) { public ResultBody publish(DemandReleaseOrderVO demandReleaseOrderVO, HttpServletRequest request) {
DemandReleaseOrderDO requirementsInfoDO = new DemandReleaseOrderDO(demandReleaseOrderVO); DemandReleaseOrderDO requirementsInfoDO = new DemandReleaseOrderDO(demandReleaseOrderVO);
...@@ -97,11 +103,13 @@ public class DemandReleaseOrderServiceImpl implements DemandReleaseOrderService ...@@ -97,11 +103,13 @@ public class DemandReleaseOrderServiceImpl implements DemandReleaseOrderService
switch (commonPaymentVO.getOrderPort().toString()) { switch (commonPaymentVO.getOrderPort().toString()) {
case "0": case "0":
return payUavOrder(commonPaymentVO, token); return payUavOrder(commonPaymentVO, token);
case "1":
return payLeaseOrder(commonPaymentVO, token);
case "3": case "3":
return orderPost(commonPaymentVO, token); return orderPost(commonPaymentVO, token);
case "4": case "4":
//发布服务需求支付 //发布服务需求支付
return publishServicePay(commonPaymentVO, token, userAccountId,request); return publishServicePay(commonPaymentVO, token, userAccountId, request);
case "5": case "5":
return topUpOrder(commonPaymentVO, token, userAccountId); return topUpOrder(commonPaymentVO, token, userAccountId);
default: default:
...@@ -109,17 +117,30 @@ public class DemandReleaseOrderServiceImpl implements DemandReleaseOrderService ...@@ -109,17 +117,30 @@ public class DemandReleaseOrderServiceImpl implements DemandReleaseOrderService
} }
} }
public ResultBody payUavOrder(CommonPaymentVO commonPaymentVO, String token) { private ResultBody payLeaseOrder(CommonPaymentVO commonPaymentVO, String token) {
UavOrderDO uavOrderDO = uavOrderDao.detailByNo(commonPaymentVO.getOrderNumber());
if (uavOrderDO.getOtherAmount().multiply(BigDecimal.valueOf(100)).compareTo(BigDecimal.valueOf(commonPaymentVO.getAmount())) !=0 ){
return ResultBody.error("发起支付金额不正确");
}
OrderRequestParamsVO orderRequestParamsVO = new OrderRequestParamsVO(); OrderRequestParamsVO orderRequestParamsVO = new OrderRequestParamsVO();
orderRequestParamsVO.setOrderNo(commonPaymentVO.getOrderNumber()); orderRequestParamsVO.setOrderNo(commonPaymentVO.getOrderNumber());
orderRequestParamsVO.setAmount(commonPaymentVO.getAmount()); orderRequestParamsVO.setAmount(commonPaymentVO.getAmount());
orderRequestParamsVO.setAttach("PAY_UAV_ORDER"); orderRequestParamsVO.setAttach("LEASE_ORDER");
orderRequestParamsVO.setDescription("商城订单" + uavOrderDO.getOrderNo());
orderRequestParamsVO.setOrderPort(commonPaymentVO.getOrderPort()); orderRequestParamsVO.setOrderPort(commonPaymentVO.getOrderPort());
UavOrderDO leaseOrder = leaseOrderDao.detailByNo(commonPaymentVO.getOrderNumber());
if (leaseOrder.getOtherAmount().multiply(BigDecimal.valueOf(100)).compareTo(BigDecimal.valueOf(commonPaymentVO.getAmount())) != 0) {
return ResultBody.error("支付金额不正确");
}
orderRequestParamsVO.setDescription("租赁订单" + leaseOrder.getOrderNo());
ResultBody resultBody = releaseOrder(orderRequestParamsVO, token);
if (!"200".equals(resultBody.getCode())) {
return ResultBody.error("调用微信支付方法失败");
}
return resultBody;
}
private ResultBody multiUavOrderPay(OrderRequestParamsVO orderRequestParamsVO, String token) {
UavPayWxDO uavPayWxDO = uavPayWxDao.getUavPayWx(orderRequestParamsVO.getOrderNo());
if (uavPayWxDO.getAmount().multiply(BigDecimal.valueOf(100)).compareTo(BigDecimal.valueOf(orderRequestParamsVO.getAmount())) != 0) {
return ResultBody.error("发起支付金额不正确");
}
orderRequestParamsVO.setDescription("商城多订单" + orderRequestParamsVO.getOrderNo());
ResultBody resultBody = releaseOrder(orderRequestParamsVO, token); ResultBody resultBody = releaseOrder(orderRequestParamsVO, token);
if (!"200".equals(resultBody.getCode())) { if (!"200".equals(resultBody.getCode())) {
throw new RuntimeException("调用微信支付方法失败!"); throw new RuntimeException("调用微信支付方法失败!");
...@@ -127,6 +148,33 @@ public class DemandReleaseOrderServiceImpl implements DemandReleaseOrderService ...@@ -127,6 +148,33 @@ public class DemandReleaseOrderServiceImpl implements DemandReleaseOrderService
return resultBody; return resultBody;
} }
private ResultBody singleUavOrderPay(OrderRequestParamsVO orderRequestParamsVO, String token) {
UavOrderDO uavOrderDO = uavOrderDao.detailByNo(orderRequestParamsVO.getOrderNo());
if (uavOrderDO.getOtherAmount().multiply(BigDecimal.valueOf(100)).compareTo(BigDecimal.valueOf(orderRequestParamsVO.getAmount())) != 0) {
return ResultBody.error("发起支付金额不正确");
}
orderRequestParamsVO.setDescription("商城订单" + uavOrderDO.getOrderNo());
ResultBody resultBody = releaseOrder(orderRequestParamsVO, token);
if (!"200".equals(resultBody.getCode())) {
throw new RuntimeException("调用微信支付方法失败!");
}
return resultBody;
}
public ResultBody payUavOrder(CommonPaymentVO commonPaymentVO, String token) {
OrderRequestParamsVO orderRequestParamsVO = new OrderRequestParamsVO();
orderRequestParamsVO.setOrderNo(commonPaymentVO.getOrderNumber());
orderRequestParamsVO.setAmount(commonPaymentVO.getAmount());
orderRequestParamsVO.setAttach("PAY_UAV_ORDER");
orderRequestParamsVO.setOrderPort(commonPaymentVO.getOrderPort());
// 购物车下单涉及多订单
if (commonPaymentVO.getOrderNumber().startsWith("m")) {
return multiUavOrderPay(orderRequestParamsVO, token);
} else {
return singleUavOrderPay(orderRequestParamsVO, token);
}
}
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public ResultBody topUpOrder(CommonPaymentVO commonPaymentVO, String token, Integer userAccountId) { public ResultBody topUpOrder(CommonPaymentVO commonPaymentVO, String token, Integer userAccountId) {
// 生成充值订单编号 规则T加时间戳加用户id加随机数4位 // 生成充值订单编号 规则T加时间戳加用户id加随机数4位
...@@ -163,9 +211,9 @@ public class DemandReleaseOrderServiceImpl implements DemandReleaseOrderService ...@@ -163,9 +211,9 @@ public class DemandReleaseOrderServiceImpl implements DemandReleaseOrderService
* @param userAccountId * @param userAccountId
* @return * @return
*/ */
private ResultBody publishServicePay(CommonPaymentVO commonPaymentVO, String token,Integer userAccountId, HttpServletRequest request) { private ResultBody publishServicePay(CommonPaymentVO commonPaymentVO, String token, Integer userAccountId, HttpServletRequest request) {
if ("4".equals(commonPaymentVO.getOrderPort().toString())){ if ("4".equals(commonPaymentVO.getOrderPort().toString())) {
try { try {
TimeUnit.SECONDS.sleep(1); TimeUnit.SECONDS.sleep(1);
} catch (InterruptedException e) { } catch (InterruptedException e) {
...@@ -175,14 +223,14 @@ public class DemandReleaseOrderServiceImpl implements DemandReleaseOrderService ...@@ -175,14 +223,14 @@ public class DemandReleaseOrderServiceImpl implements DemandReleaseOrderService
String json = stringRedisTemplate.opsForValue().get(orderNumber); String json = stringRedisTemplate.opsForValue().get(orderNumber);
GetOrderNumberDTO getOrderNumberDTO = JSONObject.parseObject(json, GetOrderNumberDTO.class); GetOrderNumberDTO getOrderNumberDTO = JSONObject.parseObject(json, GetOrderNumberDTO.class);
GetOrderNumberDO getOrderNumberDO = new GetOrderNumberDO(getOrderNumberDTO); GetOrderNumberDO getOrderNumberDO = new GetOrderNumberDO(getOrderNumberDTO);
if (getOrderNumberDTO.getRequirementsInfoId()!=null){ if (getOrderNumberDTO.getRequirementsInfoId() != null) {
int i = releaseOrderDao.selectOrderNumberDO(getOrderNumberDO.getRequirementsInfoId()); int i = releaseOrderDao.selectOrderNumberDO(getOrderNumberDO.getRequirementsInfoId());
if (i!=0){ if (i != 0) {
return ResultBody.error("当前需求已有人支付"); return ResultBody.error("当前需求已有人支付");
} }
ServiceRequirementsDO repertory = repertory(getOrderNumberDO.getRequirementsInfoId(), request); ServiceRequirementsDO repertory = repertory(getOrderNumberDO.getRequirementsInfoId(), request);
Integer repertory1 = repertory.getRepertory(); Integer repertory1 = repertory.getRepertory();
if (repertory1!=null && repertory1<=0 ){ if (repertory1 != null && repertory1 <= 0) {
return ResultBody.error("需求已被人抢走"); return ResultBody.error("需求已被人抢走");
} }
} }
...@@ -193,7 +241,7 @@ public class DemandReleaseOrderServiceImpl implements DemandReleaseOrderService ...@@ -193,7 +241,7 @@ public class DemandReleaseOrderServiceImpl implements DemandReleaseOrderService
OrderRequestParamsVO orderRequestParamsVO = getOrderNumberDO.orderRequestParamsVO(); OrderRequestParamsVO orderRequestParamsVO = getOrderNumberDO.orderRequestParamsVO();
orderRequestParamsVO.setAmount(i); orderRequestParamsVO.setAmount(i);
ResultBody resultBody = releaseOrder(orderRequestParamsVO, token); ResultBody resultBody = releaseOrder(orderRequestParamsVO, token);
stringRedisTemplate.opsForValue().set(getOrderNumberDO.getPaymentOrderNumber()+getOrderNumberDO.getUserAccountId(), JsonUtil.parseObjToJson(getOrderNumberDO)); stringRedisTemplate.opsForValue().set(getOrderNumberDO.getPaymentOrderNumber() + getOrderNumberDO.getUserAccountId(), JsonUtil.parseObjToJson(getOrderNumberDO));
return resultBody; return resultBody;
} }
return ResultBody.success(); return ResultBody.success();
......
package com.mmc.oms.service.lease;
import com.mmc.oms.common.result.ResultBody;
import com.mmc.oms.model.dto.lease.LeaseOrderDTO;
import com.mmc.oms.model.dto.user.BaseAccountDTO;
import com.mmc.oms.model.qo.uav.UavOrderQO;
import com.mmc.oms.model.vo.lease.AddLeaseOrderVO;
import com.mmc.oms.model.vo.lease.LeaseOrderRefundVO;
import com.mmc.oms.model.vo.uav.UavOrderExpressVO;
import javax.servlet.http.HttpServletRequest;
/**
* @Author LW
* @date 2023/9/21 16:38
* 概要:
*/
public interface LeaseOrderService {
ResultBody<LeaseOrderDTO> addLeaseOrder(AddLeaseOrderVO param, BaseAccountDTO currentAccount);
ResultBody detail(Integer id, BaseAccountDTO currentAccount) throws Exception;
ResultBody close(LeaseOrderRefundVO leaseOrderRefundVO, String token);
ResultBody<LeaseOrderDTO> list(UavOrderQO uavOrderQO, BaseAccountDTO currentAccount);
ResultBody<LeaseOrderDTO> listByUid(UavOrderQO uavOrderQO, BaseAccountDTO currentAccount);
ResultBody pay(Integer id, BaseAccountDTO currentAccount, HttpServletRequest request);
ResultBody send(UavOrderExpressVO param);
ResultBody receive(Integer id, BaseAccountDTO currentAccount);
ResultBody statusList();
ResultBody removeLeaseOrder(Integer id);
ResultBody giveBack(LeaseOrderRefundVO leaseOrderRefundVO, BaseAccountDTO currentAccount);
ResultBody pfConfirmOrderWare(BaseAccountDTO currentAccount, LeaseOrderRefundVO param);
}
...@@ -55,7 +55,8 @@ public class ServiceOrderTaskServiceImpl ...@@ -55,7 +55,8 @@ public class ServiceOrderTaskServiceImpl
@Autowired private PmsClient pmsClient; @Autowired private PmsClient pmsClient;
@Autowired private UserClient userClient; @Autowired
private UserAppApi userAppApi;
@Autowired private HttpUtil httpUtil; @Autowired private HttpUtil httpUtil;
...@@ -162,7 +163,7 @@ public class ServiceOrderTaskServiceImpl ...@@ -162,7 +163,7 @@ public class ServiceOrderTaskServiceImpl
} }
private Map<Integer, UserAccountSimpleDTO> getUserDTOMap(HttpServletRequest request, List<Integer> userIds) { private Map<Integer, UserAccountSimpleDTO> getUserDTOMap(HttpServletRequest request, List<Integer> userIds) {
List<UserAccountSimpleDTO> userList = userClient.feignListUserAccountByIds(userIds, request.getHeader(TokenConstant.TOKEN)); List<UserAccountSimpleDTO> userList = userAppApi.feignListUserAccountByIds(userIds, request.getHeader(TokenConstant.TOKEN));
Map<Integer, UserAccountSimpleDTO> userMap = new HashMap<>(); Map<Integer, UserAccountSimpleDTO> userMap = new HashMap<>();
if(CollectionUtils.isNotEmpty(userList)){ if(CollectionUtils.isNotEmpty(userList)){
userMap = userList.stream().collect(Collectors.toMap(UserAccountSimpleDTO::getId, d -> d, (k1, k2) -> k1)); userMap = userList.stream().collect(Collectors.toMap(UserAccountSimpleDTO::getId, d -> d, (k1, k2) -> k1));
......
...@@ -21,5 +21,5 @@ public interface UavCartService { ...@@ -21,5 +21,5 @@ public interface UavCartService {
ResultBody list(UavCartQO uavCartQO, BaseAccountDTO currentAccount); ResultBody list(UavCartQO uavCartQO, BaseAccountDTO currentAccount);
void buildUavCartCompany(Integer orderType, List<UavCartCompanyDTO> uavCartCompanyDTOS); void buildUavCartCompany(List<UavCartCompanyDTO> uavCartCompanyDTOS);
} }
package com.mmc.oms.service.uav; package com.mmc.oms.service.uav;
import com.mmc.oms.common.result.ResultBody; import com.mmc.oms.common.result.ResultBody;
import com.mmc.oms.model.dto.ContractInfoDTO; import com.mmc.oms.model.dto.uav.UavOrderRemarkDTO;
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.dto.user.BaseAccountDTO;
import com.mmc.oms.model.qo.uav.UavOrderQO; import com.mmc.oms.model.qo.uav.UavOrderQO;
import com.mmc.oms.model.vo.uav.*; import com.mmc.oms.model.vo.uav.*;
import com.mmc.oms.model.vo.wallet.TopUpOrderVO; import com.mmc.oms.model.vo.wallet.TopUpOrderVO;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal;
import java.util.List; import java.util.List;
/** /**
...@@ -54,4 +53,9 @@ public interface UavOrderService { ...@@ -54,4 +53,9 @@ public interface UavOrderService {
ResultBody removeUavOrder(Integer id); ResultBody removeUavOrder(Integer id);
ResultBody addOrderByCart(AddUavOrderByCartQO orderByCartQO, BaseAccountDTO currentAccount); ResultBody addOrderByCart(AddUavOrderByCartQO orderByCartQO, BaseAccountDTO currentAccount);
ResultBody deductWallet(BigDecimal allShareAmount, BigDecimal allSalaryAmount, BaseAccountDTO currentAccount);
List<UavOrderRemarkDTO> listGoodsRemark(Integer remarkType, Integer goodsId);
} }
package com.mmc.oms.service.uav.impl; package com.mmc.oms.service.uav.impl;
import com.alibaba.fastjson2.JSONObject;
import com.mmc.oms.common.ResultEnum; import com.mmc.oms.common.ResultEnum;
import com.mmc.oms.common.result.PageResult; import com.mmc.oms.common.result.PageResult;
import com.mmc.oms.common.result.ResultBody; import com.mmc.oms.common.result.ResultBody;
...@@ -15,6 +16,7 @@ import com.mmc.oms.model.qo.uav.PriceStockQO; ...@@ -15,6 +16,7 @@ import com.mmc.oms.model.qo.uav.PriceStockQO;
import com.mmc.oms.model.qo.uav.UavCartQO; import com.mmc.oms.model.qo.uav.UavCartQO;
import com.mmc.oms.model.vo.uav.UavCartVO; import com.mmc.oms.model.vo.uav.UavCartVO;
import com.mmc.oms.service.uav.UavCartService; import com.mmc.oms.service.uav.UavCartService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -28,6 +30,7 @@ import java.util.stream.Collectors; ...@@ -28,6 +30,7 @@ import java.util.stream.Collectors;
* @Date: 2023/9/16 14:40 * @Date: 2023/9/16 14:40
*/ */
@Service @Service
@Slf4j
public class UavCartServiceImpl implements UavCartService { public class UavCartServiceImpl implements UavCartService {
@Autowired @Autowired
private UavCartDao uavCartDao; private UavCartDao uavCartDao;
...@@ -38,6 +41,13 @@ public class UavCartServiceImpl implements UavCartService { ...@@ -38,6 +41,13 @@ public class UavCartServiceImpl implements UavCartService {
@Override @Override
public ResultBody addCart(UavCartVO uavCartVO) { public ResultBody addCart(UavCartVO uavCartVO) {
UavCartDO uavCartDO = new UavCartDO(uavCartVO); UavCartDO uavCartDO = new UavCartDO(uavCartVO);
// 查询购物车中是否有一样的商品规格,有则数量+1,无则直接添加数据。
UavCartDO uavCartDO1 = uavCartDao.countMallGoodsSku(uavCartDO);
if (uavCartDO1 != null) {
uavCartDO1.setOrderNum(uavCartDO1.getOrderNum() + 1);
uavCartDao.updateUavCart(uavCartDO1);
return ResultBody.success();
}
uavCartDao.addCart(uavCartDO); uavCartDao.addCart(uavCartDO);
return ResultBody.success(); return ResultBody.success();
} }
...@@ -54,7 +64,7 @@ public class UavCartServiceImpl implements UavCartService { ...@@ -54,7 +64,7 @@ public class UavCartServiceImpl implements UavCartService {
if (uavCartDO == null) { if (uavCartDO == null) {
return ResultBody.error(ResultEnum.SHOP_CAR_ERROR); return ResultBody.error(ResultEnum.SHOP_CAR_ERROR);
} }
// changeNum,正加负减 // 正加负减
Integer targetNum = uavCartDO.getOrderNum() + changeNum; Integer targetNum = uavCartDO.getOrderNum() + changeNum;
if (targetNum.compareTo(0) <= 0) { if (targetNum.compareTo(0) <= 0) {
return ResultBody.error(ResultEnum.BUY_NUM_ERROR); return ResultBody.error(ResultEnum.BUY_NUM_ERROR);
...@@ -71,18 +81,18 @@ public class UavCartServiceImpl implements UavCartService { ...@@ -71,18 +81,18 @@ public class UavCartServiceImpl implements UavCartService {
if (list.size() == 0) { if (list.size() == 0) {
return ResultBody.success(PageResult.buildPage(uavCartQO.getPageNo(), uavCartQO.getPageSize(), list.size())); return ResultBody.success(PageResult.buildPage(uavCartQO.getPageNo(), uavCartQO.getPageSize(), list.size()));
} }
Integer pageNo = uavCartQO.getPageNo(); Integer pageNo = uavCartQO.getPageSize();
uavCartQO.buildCurrentPage(); uavCartQO.buildCurrentPage();
List<UavCartCompanyDO> uavCartCompanyDOS = uavCartDao.list(pageNo, uavCartQO.getPageSize(), currentAccount.getUserAccountId()); List<UavCartCompanyDO> uavCartCompanyDOS = uavCartDao.list(uavCartQO.getPageNo(), uavCartQO.getPageSize(), currentAccount.getUserAccountId());
List<UavCartCompanyDTO> uavCartCompanyDTOS = uavCartCompanyDOS.stream().map(UavCartCompanyDO::buildUavCartCompanyDTO).collect(Collectors.toList()); List<UavCartCompanyDTO> uavCartCompanyDTOS = uavCartCompanyDOS.stream().map(UavCartCompanyDO::buildUavCartCompanyDTO).collect(Collectors.toList());
// 同步商品信息,价格及是否展示 // 同步商品信息,价格及是否展示
// 根据规格查询商品信息 buildUavCartCompany(uavCartCompanyDTOS);
buildUavCartCompany(uavCartQO.getOrderType(), uavCartCompanyDTOS); uavCartCompanyDTOS.removeIf(i -> CollectionUtils.isEmpty(i.getUavCartDOS()));
return ResultBody.success(PageResult.buildPage(pageNo, uavCartQO.getPageSize(), list.size(), uavCartCompanyDTOS)); return ResultBody.success(PageResult.buildPage(pageNo, uavCartQO.getPageSize(), list.size(), uavCartCompanyDTOS));
} }
@Override @Override
public void buildUavCartCompany(Integer orderType, List<UavCartCompanyDTO> uavCartCompanyDTOS){ public void buildUavCartCompany(List<UavCartCompanyDTO> uavCartCompanyDTOS){
List<PriceStockQO> priceStockQOS = new ArrayList<>(); List<PriceStockQO> priceStockQOS = new ArrayList<>();
for (UavCartCompanyDTO uavCartCompanyDTO : uavCartCompanyDTOS) { for (UavCartCompanyDTO uavCartCompanyDTO : uavCartCompanyDTOS) {
for (UavCartDTO uavCartDO : uavCartCompanyDTO.getUavCartDOS()) { for (UavCartDTO uavCartDO : uavCartCompanyDTO.getUavCartDOS()) {
...@@ -92,35 +102,29 @@ public class UavCartServiceImpl implements UavCartService { ...@@ -92,35 +102,29 @@ public class UavCartServiceImpl implements UavCartService {
} }
// 最新规格信息 // 最新规格信息
List<UavCartDTO> uavCartDTOS = pmsAppApi.listPriceStock(priceStockQOS); List<UavCartDTO> uavCartDTOS = pmsAppApi.listPriceStock(priceStockQOS);
if (CollectionUtils.isEmpty(uavCartDTOS)) {
return;
}
// 更新最新的规格信息 // 更新最新的规格信息
for (UavCartCompanyDTO uavCartCompanyDTO : uavCartCompanyDTOS) { for (UavCartCompanyDTO uavCartCompanyDTO : uavCartCompanyDTOS) {
uavCartCompanyDTO.setCompanyName(uavCartCompanyDTO.getUavCartDOS().get(0).getCompanyName()); uavCartCompanyDTO.setCompanyName(uavCartCompanyDTO.getUavCartDOS().get(0).getCompanyName());
for (UavCartDTO uavCartDTO : uavCartCompanyDTO.getUavCartDOS()) { for (UavCartDTO uavCartDTO : uavCartCompanyDTO.getUavCartDOS()) {
// 从最新规格中逐个更新 // 标识是否找到
Boolean flag = false;
// 从最新规格中逐个更新,没有则置为失效
for (UavCartDTO newestUavCartDTO : uavCartDTOS) { for (UavCartDTO newestUavCartDTO : uavCartDTOS) {
if (uavCartDTO.getMallGoodsId().equals(newestUavCartDTO.getMallGoodsId()) if (uavCartDTO.getMallGoodsId().equals(newestUavCartDTO.getMallGoodsId())
&& uavCartDTO.getProductSpec().equals(newestUavCartDTO.getProductSpec())) { && uavCartDTO.getProductSpec().equals(newestUavCartDTO.getProductSpec())) {
// 不符合的移除 flag = true;
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.setPriceShow(newestUavCartDTO.getPriceShow());
uavCartDTO.setSalePrice(newestUavCartDTO.getSalePrice()); uavCartDTO.setSalePrice(newestUavCartDTO.getSalePrice());
uavCartDTO.setShelfStatus(newestUavCartDTO.getShelfStatus());
uavCartDTO.setDeleted(newestUavCartDTO.getDeleted());
break; break;
} }
} }
} // 找不到或被删除则置为失效
if (CollectionUtils.isEmpty(uavCartCompanyDTO.getUavCartDOS())) { if (!flag || uavCartDTO.getDeleted().equals(1)) {
uavCartCompanyDTOS.remove(uavCartCompanyDTO); uavCartDTO.setShelfStatus(0);
uavCartDTO.setDeleted(1);
}
} }
} }
} }
......
...@@ -70,5 +70,5 @@ pms: ...@@ -70,5 +70,5 @@ pms:
ims: ims:
url: https://test.iuav.shop/release/ url: https://test.iuav.shop/release/
scheduling:
enabled: true
<?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.data.OrderReportDao">
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.mmc.oms.dao.lease.LeaseOrderDao">
<insert id="addOrder" keyProperty="id" useGeneratedKeys="true"
parameterType="com.mmc.oms.entity.lease.LeaseOrderDO">
insert into lease_order (order_no,
status_code,
user_account_id,
lease_goods_id,
company_name,
third_back_user_account_id,
order_name,
sku_img,
order_total_amount,
salary_amount,
share_amount,
other_amount,
user_address_id,
pay_time,
user_remark,
unit_price,
ware_num,
deposit,
start_date,
share_cash_pledge,
salary_cash_pledge,
end_date,
sku)
values (#{orderNo}, #{statusCode}, #{userAccountId}, #{leaseGoodsId}, #{companyName}, #{thirdBackUserAccountId},
#{orderName}, #{skuImg}, #{orderTotalAmount}, #{salaryAmount}, #{shareAmount}, #{otherAmount},
#{userAddressId},
#{payTime}, #{userRemark}, #{unitPrice}, #{wareNum}, #{deposit}, #{startDate}, #{shareCashPledge},
#{salaryCashPledge}, #{endDate}, #{sku});
</insert>
<insert id="addAddress" keyProperty="id" useGeneratedKeys="true"
parameterType="com.mmc.oms.entity.lease.LeaseOrderExpressDO">
insert into lease_order_express(lease_order_id, send_exp_no, send_exp_code, take_name, take_phone, take_region,
take_address, create_time, return_exp_no, return_exp_code, return_time)
values (#{leaseOrderId}, #{sendExpNo}, #{sendExpCode}, #{takeName}, #{takePhone}, #{takeRegion}, #{takeAddress},
NOW(), #{returnExpNo}, #{returnExpCode}, #{returnTime})
</insert>
<insert id="addLeaseRefundOrder" parameterType="com.mmc.oms.entity.lease.LeaseRefundOrderDO" useGeneratedKeys="true"
keyProperty="id">
insert into lease_refund_order(lease_order_id, status, file, reason, type, lease_order_express_id)
values (#{leaseOrderId}, #{status}, #{file}, #{reason}, #{type}, #{leaseOrderExpressId})
</insert>
<update id="updateUavOrderStatus">
update lease_order
set status_code = #{code}
where id = #{id}
</update>
<update id="updateLeaseOrderExpress">
update lease_order_express
<set>
<if test="sendExpNo != null">
send_exp_no = #{sendExpNo},
</if>
<if test="sendExpCode != null">
send_exp_code = #{sendExpCode},
</if>
<if test="takeName != null">
take_name = #{takeName},
</if>
<if test="takePhone != null">
take_phone = #{takePhone},
</if>
<if test="takeRegion != null">
take_region = #{takeRegion},
</if>
<if test="takeAddress != null">
take_address = #{takeAddress},
</if>
<if test="sendTime != null">
send_time = #{sendTime},
</if>
<if test="takeAddress != null">
take_address = #{takeAddress},
</if>
<if test="receive != null">
is_receive = #{receive},
</if>
<if test="receiveTime != null">
receive_time = #{receiveTime},
</if>
<if test="takeAddress != null">
take_address = #{takeAddress},
</if>
<if test="returnExpNo != null">
return_exp_no = #{returnExpNo},
</if>
<if test="returnExpCode != null">
return_exp_code = #{returnExpCode},
</if>
<if test="returnTime != null">
return_time = #{returnTime},
</if>
</set>
where
id = #{id}
</update>
<update id="closeShowLeaseOrder">
update lease_order
set show_user_port = 0
where id = #{id}
</update>
<update id="updateLeaseOrderProportion">
update lease_order
set proportion = #{proportion}
where id = #{id}
</update>
<sql id="lease_order_column">
id
,order_no,status_code,user_account_id,lease_goods_id,company_name,third_back_user_account_id,
order_name,sku_img,sku,order_total_amount,salary_amount,share_amount,other_amount,pay_type,
user_address_id,user_remark,seller_remark,pay_time,confirm_receipt_time,version,remark_status,mode_of_delivery_Info,
proportion,show_user_port,create_time,update_time,unit_price,ware_num,deposit,start_date,end_date,shut_reason,send_ware_time
</sql>
<select id="detail" resultType="com.mmc.oms.entity.lease.LeaseOrderDO">
select
<include refid="lease_order_column"/>
from lease_order where id = #{id}
</select>
<sql id="lease_order_express_column">
id
,lease_order_id,send_exp_no,send_exp_code,take_name,take_phone,take_region,take_address,send_time,is_receive
,receive_time,return_exp_no,return_exp_code,return_time,update_time,create_time
</sql>
<select id="getLeaseOrderExpress" resultType="com.mmc.oms.entity.lease.LeaseOrderExpressDO">
select
<include refid="lease_order_express_column"/>
from lease_order_express
where lease_order_id = #{id}
</select>
<select id="countList" resultType="java.lang.Integer">
select count(*) from lease_order lo
where 1 = 1
<if test="keyword != null">
and order_no = #{keyword}
</if>
<if test="userAccountId != null">
and user_account_id = #{userAccountId}
</if>
<if test="statusCode != null">
and status_code = #{statusCode}
</if>
<if test="thirdBackUserAccountId != null">
and third_back_user_account_id = #{thirdBackUserAccountId}
</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" resultType="com.mmc.oms.entity.lease.LeaseOrderDO">
SELECT
<include refid="lease_order_column"/>
FROM
lease_order lo
WHERE
1 = 1
<if test="keyword != null">
and lo.order_no = #{keyword}
</if>
<if test="uid != null">
and lo.user_account_id = #{uid}
</if>
<if test="userAccountId != null">
and lo.user_account_id = #{userAccountId}
</if>
<if test="statusCode != null">
and lo.status_code = #{statusCode}
</if>
<if test="thirdBackUserAccountId != null">
and lo.third_back_user_account_id = #{thirdBackUserAccountId}
</if>
<if test="startTime != null">
and lo.create_time >= #{startTime}
</if>
<if test="endTime != null">
and #{endTime} >= lo.create_time
</if>
<if test="showUserPort != null">
and show_user_port = #{showUserPort}
</if>
order by lo.id desc
limit #{pageNo}, #{pageSize}
</select>
<sql id="lease_refund_order_column">
id
,lease_order_express_id,lease_order_id,status,type,file,reason,create_time
</sql>
<select id="getLeaseRefundOrder" resultType="com.mmc.oms.entity.lease.LeaseRefundOrderDO">
select
<include refid="lease_refund_order_column"/>
from lease_refund_order
<where>
<foreach collection="list" item="item" open="and lease_order_id in(" separator="," close=")">
lease_order_id = #{item}
</foreach>
</where>
</select>
<select id="detailByNo" resultType="com.mmc.oms.entity.uav.UavOrderDO">
select
<include refid="lease_order_column"/>
from lease_order
where order_no = #{orderNo}
</select>
<select id="statusList" resultType="com.mmc.oms.entity.transtatus.TranStatusDicDO">
select t.id, t.`status`, t.doing, t.waiting
from tran_status_dic t
order by t.sort asc
</select>
<select id="listLeaseOrderExpress" resultType="com.mmc.oms.entity.lease.LeaseOrderExpressDO">
select
<include refid="lease_order_express_column"/>
from lease_order_express
<where>
<foreach collection="list" item="item" open="and id in(" separator="," close=")">
id = #{item}
</foreach>
</where>
</select>
</mapper>
\ No newline at end of file
...@@ -79,4 +79,11 @@ ...@@ -79,4 +79,11 @@
group by third_back_user_account_id group by third_back_user_account_id
limit #{begin}, #{pageSize} limit #{begin}, #{pageSize}
</select> </select>
<select id="countMallGoodsSku" resultType="com.mmc.oms.entity.uav.UavCartDO" parameterType="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
and mall_goods_id = #{mallGoodsId} and product_spec = #{productSpec}
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -13,6 +13,14 @@ ...@@ -13,6 +13,14 @@
values (#{uavOrderId}, #{sendExpNo}, #{sendExpCode}, #{takeName}, #{takePhone}, #{takeRegion}, #{takeAddress}, NOW()) values (#{uavOrderId}, #{sendExpNo}, #{sendExpCode}, #{takeName}, #{takePhone}, #{takeRegion}, #{takeAddress}, NOW())
</insert> </insert>
<insert id="batchAddOrderExpress">
insert into uav_order_express(uav_order_id, send_exp_no, send_exp_code, take_name, take_phone, take_region, take_address, create_time)
values
<foreach item="item" collection="list" separator=",">
(#{item.uavOrderId}, #{item.sendExpNo}, #{item.sendExpCode}, #{item.takeName}, #{item.takePhone}, #{item.takeRegion}, #{item.takeAddress}, NOW())
</foreach>
</insert>
<update id="updateUavOrderExpressDO" parameterType="com.mmc.oms.entity.uav.UavOrderExpressDO"> <update id="updateUavOrderExpressDO" parameterType="com.mmc.oms.entity.uav.UavOrderExpressDO">
update uav_order_express update uav_order_express
<set> <set>
......
<?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.UavPayWxDao">
<sql id="UAV_PAY_WX_COLUMN">
id, pay_no, amount, trade_state, create_time
</sql>
<sql id="UAV_PAY_WX_SUB_COLUMN">
id, uav_pay_wx_id, uav_order_id, order_no, amount, create_time
</sql>
<insert id="addUavPayWx" parameterType="com.mmc.oms.entity.uav.UavPayWxDO" keyProperty="id" useGeneratedKeys="true">
insert into uav_pay_wx (pay_no, amount, trade_state, create_time)
values (#{payNo}, #{amount}, #{tradeState}, NOW())
</insert>
<insert id="batchAddUavPayWxSub" keyProperty="id" useGeneratedKeys="true">
insert into uav_pay_wx_sub( uav_pay_wx_id, uav_order_id, order_no, amount, create_time)
values
<foreach item="item" collection="list" separator=",">
(#{item.uavPayWxId}, #{item.uavOrderId}, #{item.orderNo}, #{item.amount}, NOW())
</foreach>
</insert>
<update id="finishUavPayWx">
update uav_pay_wx set trade_state = #{tradeState} where pay_no = #{payNo}
</update>
<select id="getUavPayWx" resultType="com.mmc.oms.entity.uav.UavPayWxDO">
select <include refid="UAV_PAY_WX_COLUMN"/>
from uav_pay_wx where pay_no = #{payNo}
</select>
<select id="listUavPayWxSub" resultType="com.mmc.oms.entity.uav.UavPayWxSubDO">
select <include refid="UAV_PAY_WX_SUB_COLUMN"/>
from uav_pay_wx_sub where uav_pay_wx_id = #{uavPayWxId}
</select>
</mapper>
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论