提交 4df40bbe 作者: zhenjie

商城订单修复

上级 6b99d632
...@@ -36,4 +36,6 @@ public interface UavPODao { ...@@ -36,4 +36,6 @@ public interface UavPODao {
UavPurchaseOrderDO getUavPOrderByUavOId(Integer uavOrderId); UavPurchaseOrderDO getUavPOrderByUavOId(Integer uavOrderId);
UavPurchaseOrderDO getUavPOrderByNo(String orderNo); UavPurchaseOrderDO getUavPOrderByNo(String orderNo);
UavPurchaseOrderPayDO getUavPOrderPayById(Integer id);
} }
...@@ -70,6 +70,8 @@ public class UavOrderDO implements Serializable { ...@@ -70,6 +70,8 @@ public class UavOrderDO implements Serializable {
private Date updateTime; private Date updateTime;
@ApiModelProperty("规格列表") @ApiModelProperty("规格列表")
private List<UavOrderSkuDO> skuDOS; private List<UavOrderSkuDO> skuDOS;
@ApiModelProperty("支付凭证列表")
private List<UavOrderPayDO> payDOList;
public UavOrderDTO buildUavOrderDTO(){ public UavOrderDTO buildUavOrderDTO(){
return UavOrderDTO.builder().id(this.id).version(this.version).orderNo(this.orderNo).statusCode(this.statusCode).userAccountId(this.userAccountId) 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 { ...@@ -78,6 +80,7 @@ public class UavOrderDO implements Serializable {
.userRemark(this.userRemark).sellerRemark(this.sellerRemark).createTime(this.createTime).payTime(this.payTime).confirmReceiptTime(this.confirmReceiptTime) .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 : .remarkStatus(this.remarkStatus).updateTime(this.updateTime).skuDTOList(CollectionUtils.isEmpty(skuDOS) ? null :
this.skuDOS.stream().map(UavOrderSkuDO::buildUavOrderSkuDTO).collect(Collectors.toList())) this.skuDOS.stream().map(UavOrderSkuDO::buildUavOrderSkuDTO).collect(Collectors.toList()))
.payDTOList(CollectionUtils.isEmpty(payDOList) ? null : this.payDOList.stream().map(UavOrderPayDO::buildUavOrderPayDTO).collect(Collectors.toList()))
.build(); .build();
} }
......
package com.mmc.oms.entity.uav; package com.mmc.oms.entity.uav;
import com.mmc.oms.model.dto.uav.UavOrderPayDTO;
import com.mmc.oms.model.dto.uav.UavPurchaseOrderDTO; import com.mmc.oms.model.dto.uav.UavPurchaseOrderDTO;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
...@@ -46,11 +47,15 @@ public class UavPurchaseOrderDO implements Serializable { ...@@ -46,11 +47,15 @@ public class UavPurchaseOrderDO implements Serializable {
private String sellerRemark; private String sellerRemark;
@ApiModelProperty("规格列表") @ApiModelProperty("规格列表")
private List<UavOrderSkuDO> skuDOS; private List<UavOrderSkuDO> skuDOS;
@ApiModelProperty("支付凭证列表")
private List<UavPurchaseOrderPayDO> payDOS;
public UavPurchaseOrderDTO buildUavPurchaseOrderDTO() { public UavPurchaseOrderDTO buildUavPurchaseOrderDTO() {
return UavPurchaseOrderDTO.builder().id(this.id).orderNo(this.orderNo).statusCode(this.statusCode).backUserAccountId(this.backUserAccountId) 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) .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) ? .createTime(this.createTime).userRemark(this.userRemark).sellerRemark(this.sellerRemark).skuDTOList(CollectionUtils.isEmpty(skuDOS) ? null :
this.skuDOS.stream().map(UavOrderSkuDO::buildUavOrderSkuDTO).collect(Collectors.toList()) : null).build(); 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; package com.mmc.oms.model.dto.uav;
import com.mmc.oms.entity.uav.UavPurchaseOrderPayDO;
import com.mmc.oms.model.dto.ContractInfoDTO; import com.mmc.oms.model.dto.ContractInfoDTO;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
...@@ -53,4 +54,7 @@ public class UavPurchaseOrderDTO implements Serializable { ...@@ -53,4 +54,7 @@ public class UavPurchaseOrderDTO implements Serializable {
private List<UavOrderPayDTO> uavOrderPayDTOS; private List<UavOrderPayDTO> uavOrderPayDTOS;
@ApiModelProperty("合同签署信息") @ApiModelProperty("合同签署信息")
private ContractInfoDTO contractInfoDTO; private ContractInfoDTO contractInfoDTO;
@ApiModelProperty("支付凭证列表")
private List<UavOrderPayDTO> payDTOS;
} }
...@@ -143,7 +143,8 @@ public class UavPOServiceImpl implements UavPOService { ...@@ -143,7 +143,8 @@ public class UavPOServiceImpl implements UavPOService {
@Transactional @Transactional
@Override @Override
public ResultBody checkPay(UavOrderPayVO uavOrderPayVO) { 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())) { if (!uavPOrder.getStatusCode().equals(UavOrderStatus.FINISH_PAYING.getCode())) {
return ResultBody.error("操作有误,请重试!"); return ResultBody.error("操作有误,请重试!");
} }
......
...@@ -30,6 +30,10 @@ ...@@ -30,6 +30,10 @@
select="listUavOrderSkuDO" select="listUavOrderSkuDO"
column="{uavOrderId=id}"> column="{uavOrderId=id}">
</collection> </collection>
<collection property="payDOList" ofType="com.mmc.oms.entity.uav.UavOrderPayDO"
select="listUavOrderPay"
column="{uavOrderId=id}">
</collection>
</resultMap> </resultMap>
<sql id="uav_order_column"> <sql id="uav_order_column">
......
...@@ -17,12 +17,20 @@ ...@@ -17,12 +17,20 @@
select="listUavOrderSkuDO" select="listUavOrderSkuDO"
column="{uavOrderId=uav_order_id}"> column="{uavOrderId=uav_order_id}">
</collection> </collection>
<collection property="payDOS" ofType="com.mmc.oms.entity.uav.UavPurchaseOrderPayDO"
select="listUavPOrderPay"
column="{uavPurchaseOrderId=id}">
</collection>
</resultMap> </resultMap>
<sql id="uav_purchase_order_column"> <sql id="uav_purchase_order_column">
id, order_no, back_user_account_id, third_user_account_id, uav_order_id, order_amount, status_code, id, order_no, back_user_account_id, third_user_account_id, uav_order_id, order_amount, status_code,
create_time, user_remark, seller_remark create_time, user_remark, seller_remark
</sql> </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" <insert id="addPurchaseOrder" parameterType="com.mmc.oms.entity.uav.UavPurchaseOrderDO" keyProperty="id"
useGeneratedKeys="true"> useGeneratedKeys="true">
...@@ -95,7 +103,7 @@ ...@@ -95,7 +103,7 @@
from uav_purchase_order where id = #{id} from uav_purchase_order where id = #{id}
</select> </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"/> select <include refid="uav_purchase_order_column"/>
from uav_purchase_order from uav_purchase_order
where 1 = 1 where 1 = 1
...@@ -140,14 +148,7 @@ ...@@ -140,14 +148,7 @@
</select> </select>
<select id="listUavPOrderPay" resultType="com.mmc.oms.entity.uav.UavPurchaseOrderPayDO"> <select id="listUavPOrderPay" resultType="com.mmc.oms.entity.uav.UavPurchaseOrderPayDO">
select id, select <include refid="uav_purchase_order_pay_column"/>
uav_purchase_order_id,
pay_img_list,
check_status,
pay_remark,
refuse_reason,
create_time,
check_time
from uav_purchase_order_pay from uav_purchase_order_pay
where uav_purchase_order_id = #{uavPurchaseOrderId} where uav_purchase_order_id = #{uavPurchaseOrderId}
</select> </select>
...@@ -161,4 +162,10 @@ ...@@ -161,4 +162,10 @@
select <include refid="uav_purchase_order_column"/> select <include refid="uav_purchase_order_column"/>
from uav_purchase_order where order_no = #{orderNo} from uav_purchase_order where order_no = #{orderNo}
</select> </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> </mapper>
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论