提交 4df40bbe 作者: zhenjie

商城订单修复

上级 6b99d632
......@@ -36,4 +36,6 @@ public interface UavPODao {
UavPurchaseOrderDO getUavPOrderByUavOId(Integer uavOrderId);
UavPurchaseOrderDO getUavPOrderByNo(String orderNo);
UavPurchaseOrderPayDO getUavPOrderPayById(Integer id);
}
......@@ -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();
}
......
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;
......@@ -46,11 +47,15 @@ public class UavPurchaseOrderDO implements Serializable {
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.isNotEmpty(skuDOS) ?
this.skuDOS.stream().map(UavOrderSkuDO::buildUavOrderSkuDTO).collect(Collectors.toList()) : null).build();
.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()))
.build();
}
}
package com.mmc.oms.model.dto.uav;
import com.mmc.oms.entity.uav.UavPurchaseOrderPayDO;
import com.mmc.oms.model.dto.ContractInfoDTO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
......@@ -53,4 +54,7 @@ public class UavPurchaseOrderDTO implements Serializable {
private List<UavOrderPayDTO> uavOrderPayDTOS;
@ApiModelProperty("合同签署信息")
private ContractInfoDTO contractInfoDTO;
@ApiModelProperty("支付凭证列表")
private List<UavOrderPayDTO> payDTOS;
}
......@@ -143,7 +143,8 @@ public class UavPOServiceImpl implements UavPOService {
@Transactional
@Override
public ResultBody checkPay(UavOrderPayVO uavOrderPayVO) {
UavPurchaseOrderDO uavPOrder = uavPODao.getUavPOrder(uavOrderPayVO.getUavOrderId());
UavPurchaseOrderPayDO uavPurchaseOrderPayDO = uavPODao.getUavPOrderPayById(uavOrderPayVO.getId());
UavPurchaseOrderDO uavPOrder = uavPODao.getUavPOrder(uavPurchaseOrderPayDO.getUavPOrderId());
if (!uavPOrder.getStatusCode().equals(UavOrderStatus.FINISH_PAYING.getCode())) {
return ResultBody.error("操作有误,请重试!");
}
......
......@@ -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">
......
......@@ -17,6 +17,10 @@
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">
......@@ -24,6 +28,10 @@
create_time, user_remark, seller_remark
</sql>
<sql id="uav_purchase_order_pay_column">
id, uav_purchase_order_id, 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,
......@@ -95,7 +103,7 @@
from uav_purchase_order where id = #{id}
</select>
<select id="listPurchaseOrder" resultType="com.mmc.oms.entity.uav.UavPurchaseOrderDO" parameterType="com.mmc.oms.model.qo.uav.UavPOrderQO">
<select id="listPurchaseOrder" resultMap="uavPOResultMap" parameterType="com.mmc.oms.model.qo.uav.UavPOrderQO">
select <include refid="uav_purchase_order_column"/>
from uav_purchase_order
where 1 = 1
......@@ -140,14 +148,7 @@
</select>
<select id="listUavPOrderPay" resultType="com.mmc.oms.entity.uav.UavPurchaseOrderPayDO">
select id,
uav_purchase_order_id,
pay_img_list,
check_status,
pay_remark,
refuse_reason,
create_time,
check_time
select <include refid="uav_purchase_order_pay_column"/>
from uav_purchase_order_pay
where uav_purchase_order_id = #{uavPurchaseOrderId}
</select>
......@@ -161,4 +162,10 @@
select <include refid="uav_purchase_order_column"/>
from uav_purchase_order where 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 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论