@@ -102,7 +102,7 @@ public class OrderController extends MyValidController { | |||
@ApiOperation(value = "小程序订单详情-支付后状态跳转") | |||
@PostMapping(value = "/payAfterOrder") | |||
public ApiResponse<PayAfterOrderResDTO> payAfterOrder(@Valid @RequestBody OrderDetailReqDto reqDto) throws ManagerException { | |||
public ApiResponse<PayAfterOrderResDTO> payAfterOrder(@Valid @RequestBody PayAfterOrderReqDTO reqDto) throws ManagerException { | |||
PayAfterOrderResDTO res = issueOrderManage.payAfterOrder(reqDto); | |||
return ApiResponse.of(res); | |||
} | |||
@@ -180,12 +180,18 @@ public class OrderController extends MyValidController { | |||
return ApiResponse.success().setMessage("修改成功"); | |||
} | |||
@ApiOperation(value = "订单查询-小程序") | |||
@ApiOperation(value = "订单查询是否有渠道订单-小程序") | |||
@PostMapping(value = "/orderQuery") | |||
public ApiResponse<OrderQueryResponseDTO> orderQuery(@RequestBody @Valid CommRequestDTO request) throws ManagerException { | |||
OrderQueryResponseDTO response = issueOrderManage.orderQuery(request); | |||
return ApiResponse.of(response); | |||
} | |||
@ApiOperation(value = "查询渠道订单-小程序") | |||
@PostMapping(value = "/qdOrderQuery") | |||
public ApiResponse<QdOrderResponseDTO> qdOrderQuery(@RequestBody @Valid QdOrderRequestDTO dto) { | |||
QdOrderResponseDTO response = issueOrderManage.qdOrderQuery(dto); | |||
return ApiResponse.of(response); | |||
} | |||
@ApiOperation(value = "领取-APP") | |||
@PostMapping(value = "/receive") |
@@ -1,6 +1,7 @@ | |||
package cn.com.taiji.iaw.dto.issue.order; | |||
import cn.com.taiji.core.dto.AbstractBizRequestDTO; | |||
import cn.com.taiji.core.entity.dict.basic.SourceType; | |||
import cn.com.taiji.core.model.comm.protocol.constraint.IntegerConstant; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
@@ -17,7 +18,7 @@ import javax.validation.constraints.NotNull; | |||
*/ | |||
@Data | |||
@ApiModel(description = "签署协议请求") | |||
public class AgreeProtocolReqDTO extends AbstractBizRequestDTO { | |||
public class AgreeProtocolReqDTO { | |||
@NotBlank | |||
@ApiModelProperty(value = "订单编号") | |||
@@ -27,5 +28,14 @@ public class AgreeProtocolReqDTO extends AbstractBizRequestDTO { | |||
@ApiModelProperty(value = "是否同一协议 1是,0否") | |||
private Integer protocol; | |||
private String accessToken; | |||
@NotBlank(message = "loginSource不能为空") | |||
private String loginSource; | |||
public SourceType getOrderSource() { | |||
return SourceType.findByCode(loginSource); | |||
} | |||
} |
@@ -13,7 +13,7 @@ import lombok.Data; | |||
*/ | |||
@Data | |||
@ApiModel(description = "签署协议检测请求") | |||
public class CheckProtocolReqDTO extends AbstractBizRequestDTO { | |||
public class CheckProtocolReqDTO { | |||
@ApiModelProperty(value = "订单编号") | |||
private String orderNo; |
@@ -0,0 +1,18 @@ | |||
package cn.com.taiji.iaw.dto.issue.order; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Data; | |||
/** | |||
* @Author:ChenChao | |||
* @Date:2025/8/18 20:24 | |||
* @Filename:PayAfterOrderReqDTO | |||
* @description: | |||
*/ | |||
@ApiModel(description = "支付后订单状态跳转查询") | |||
@Data | |||
public class PayAfterOrderReqDTO { | |||
@ApiModelProperty(value = "订单编号") | |||
private String orderNo; | |||
} |
@@ -1,5 +1,6 @@ | |||
package cn.com.taiji.iaw.dto.issue.order; | |||
import cn.com.taiji.common.valid.BaseValidDTO; | |||
import cn.com.taiji.common.valid.ViolationValidator; | |||
import cn.com.taiji.core.dto.AbstractBizRequestDTO; | |||
import cn.com.taiji.core.entity.dict.basic.SourceType; | |||
@@ -17,7 +18,7 @@ import javax.validation.constraints.NotBlank; | |||
*/ | |||
@ApiModel(description = "支付申请请求") | |||
@Data | |||
public class PayApplyReqDTO extends AbstractBizRequestDTO { | |||
public class PayApplyReqDTO extends BaseValidDTO { | |||
@ApiModelProperty(value = "员工编号") | |||
private String staffId; | |||
@@ -38,6 +39,14 @@ public class PayApplyReqDTO extends AbstractBizRequestDTO { | |||
@ApiModelProperty("h5页面类型") | |||
private String h5Type;// h5页面类型 | |||
private String accessToken; | |||
@NotBlank(message = "loginSource不能为空") | |||
private String loginSource; | |||
public SourceType getOrderSource() { | |||
return SourceType.findByCode(loginSource); | |||
} | |||
@Override | |||
protected void validate(ViolationValidator validator) { |
@@ -1,13 +1,15 @@ | |||
package cn.com.taiji.iaw.dto.issue.order; | |||
import cn.com.taiji.common.valid.BaseValidDTO; | |||
import cn.com.taiji.common.valid.ViolationValidator; | |||
import cn.com.taiji.core.dto.AbstractBizRequestDTO; | |||
import cn.com.taiji.core.entity.dict.basic.SourceType; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Getter; | |||
import lombok.Setter; | |||
import lombok.experimental.Accessors; | |||
import javax.validation.constraints.NotBlank; | |||
import javax.validation.constraints.NotNull; | |||
/** | |||
@@ -17,7 +19,7 @@ import javax.validation.constraints.NotNull; | |||
@Getter | |||
@Setter | |||
@Accessors(chain = true) | |||
public class PayQueryRequestDTO extends AbstractBizRequestDTO { | |||
public class PayQueryRequestDTO extends BaseValidDTO { | |||
@ApiModelProperty(value = "订单编号") | |||
@NotNull | |||
@@ -27,7 +29,13 @@ public class PayQueryRequestDTO extends AbstractBizRequestDTO { | |||
@ApiModelProperty(value = "微信用户标识") | |||
private String wxOpenId; | |||
@Override | |||
@NotBlank(message = "loginSource不能为空") | |||
private String loginSource; | |||
public SourceType getOrderSource() { | |||
return SourceType.findByCode(loginSource); | |||
} | |||
protected void validate(ViolationValidator validator) { | |||
if (SourceType.WECHAT.equals(getOrderSource())){ | |||
validator.validFieldNotBlank("wxOpenId", wxOpenId); |
@@ -0,0 +1,22 @@ | |||
package cn.com.taiji.iaw.dto.issue.order; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Data; | |||
import javax.validation.constraints.NotBlank; | |||
/** | |||
* @Author:ChenChao | |||
* @Date:2025/8/18 19:35 | |||
* @Filename:QdOrderRequestDTO | |||
* @description: | |||
*/ | |||
@Data | |||
@ApiModel(description = "查询渠道订单请求参数") | |||
public class QdOrderRequestDTO { | |||
@NotBlank | |||
@ApiModelProperty(value = "手机号") | |||
private String mobile; | |||
} |
@@ -0,0 +1,20 @@ | |||
package cn.com.taiji.iaw.dto.issue.order; | |||
import io.swagger.annotations.ApiModel; | |||
import lombok.Data; | |||
import java.util.List; | |||
/** | |||
* @Author:ChenChao | |||
* @Date:2025/8/18 19:41 | |||
* @Filename:QdOrderResponseDTO | |||
* @description: | |||
*/ | |||
@Data | |||
@ApiModel(description = "渠道订单查询响应参数") | |||
public class QdOrderResponseDTO { | |||
private List<OrderMinPageModel> orderList; | |||
} |
@@ -63,7 +63,7 @@ public interface IssueOrderManage { | |||
UpAdressQueryResDTO upAdressQuery(OrderDetailReqDto reqDto) throws ManagerException; | |||
PayAfterOrderResDTO payAfterOrder(OrderDetailReqDto reqDto) throws ManagerException; | |||
PayAfterOrderResDTO payAfterOrder(PayAfterOrderReqDTO reqDto) throws ManagerException; | |||
OrderQueryResponseDTO orderQuery(CommRequestDTO request) throws ServiceHandleException; | |||
@@ -72,4 +72,6 @@ public interface IssueOrderManage { | |||
void examine(OrderExamineReqDTO reqDto) throws ManagerException; | |||
ListQrCodeResDTO listQRcode(ListQrCodeReqDTO reqDto) throws ManagerException; | |||
QdOrderResponseDTO qdOrderQuery(QdOrderRequestDTO dto); | |||
} |
@@ -34,6 +34,7 @@ import cn.hutool.core.util.StrUtil; | |||
import cn.hutool.extra.qrcode.QrCodeUtil; | |||
import cn.hutool.extra.qrcode.QrConfig; | |||
import org.apache.commons.codec.binary.Base64; | |||
import org.apache.kafka.common.protocol.types.Field; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.stereotype.Service; | |||
import org.springframework.transaction.annotation.Transactional; | |||
@@ -251,8 +252,14 @@ public class IssueOrderManageImpl extends AbstractIawManager implements IssueOrd | |||
List<IssueAgreementAddress> agreementAddresses = issueAgreementAddressRepo.findByRefIdAndStatusList(ids, EnableStatus.ENABLE); | |||
List<String> agreementAddressesIds = agreementAddresses.stream().map(IssueAgreementAddress::getId).collect(Collectors.toList()); | |||
ext.setAgreements(String.join(StrUtil.COMMA, agreementAddressesIds)); | |||
ext.setAgreeTime(LocalDateTime.now()); | |||
issueOrderinfoExtRepo.merge(ext); | |||
sysPersistOperateLog(OperateType.ORDER_AGREEPROTOCOL, order.getId(), reqDto.getOrderSource(), findOpenIdByToken(reqDto.getAccessToken()), "同意协议"); | |||
String openId = "-1"; | |||
if (hasText(reqDto.getAccessToken())) { | |||
openId = findOpenIdByToken(reqDto.getAccessToken()); | |||
} | |||
sysPersistOperateLog(OperateType.ORDER_AGREEPROTOCOL, order.getId(), reqDto.getOrderSource(), openId, "同意协议"); | |||
} | |||
@Override | |||
@@ -269,8 +276,14 @@ public class IssueOrderManageImpl extends AbstractIawManager implements IssueOrd | |||
@Override | |||
public PayApplyResDTO payApply(PayApplyReqDTO reqDto) throws ManagerException { | |||
reqDto.validate(); | |||
IssueOrderinfo orderinfo = checkOrder(reqDto.getOrderNo()); | |||
OrderPayApplyRequest request = copyProperties(reqDto, new OrderPayApplyRequest()); | |||
OrderPayApplyResponse response = jsonPostRepeat(request); | |||
String openId = "-1"; | |||
if (hasText(reqDto.getAccessToken())){ | |||
openId = findOpenIdByToken(reqDto.getAccessToken()); | |||
} | |||
sysPersistOperateLog(OperateType.OPERATE_PAYAPPLY, orderinfo.getId(), reqDto.getOrderSource(), openId, "支付申请"); | |||
return copyProperties(response, new PayApplyResDTO()); | |||
} | |||
@@ -490,7 +503,7 @@ public class IssueOrderManageImpl extends AbstractIawManager implements IssueOrd | |||
* 签约如果有渠道地址就跳到渠道服务界面 | |||
*/ | |||
@Override | |||
public PayAfterOrderResDTO payAfterOrder(OrderDetailReqDto reqDto) throws ManagerException { | |||
public PayAfterOrderResDTO payAfterOrder(PayAfterOrderReqDTO reqDto) throws ManagerException { | |||
IssueOrderinfo order = checkOrder(reqDto.getOrderNo()); | |||
PayAfterOrderResDTO resDTO = new PayAfterOrderResDTO(); | |||
AssAgencyConfig agencyConfig = assAgencyConfigRepo.findByAgencyId(order.getAgencyId()); | |||
@@ -582,6 +595,17 @@ public class IssueOrderManageImpl extends AbstractIawManager implements IssueOrd | |||
return resDTO; | |||
} | |||
@Override | |||
public QdOrderResponseDTO qdOrderQuery(QdOrderRequestDTO dto) { | |||
QdOrderResponseDTO responseDTO = new QdOrderResponseDTO(); | |||
List<IssueOrderinfo> orderinfoList = issueOrderinfoRepo.findAppQueryByMobile(dto.getMobile()); | |||
if (!isEmpty(orderinfoList)) { | |||
List<OrderMinPageModel> collect = orderinfoList.stream().map(this::cover).collect(Collectors.toList()); | |||
responseDTO.setOrderList(collect); | |||
} | |||
return responseDTO; | |||
} | |||
//校验发行订单是否存在 | |||
private IssueOrderinfo checkOrder(String orderNo) throws ManagerException { | |||
IssueOrderinfo order = issueOrderinfoRepo.findByOrderNo(orderNo); |