Selaa lähdekoodia

iaw 恢复签约、修改地址

master
chenchaod 1 kuukausi sitten
vanhempi
commit
e97cbee9dd

+ 46
- 0
zhywpt-app-iaw/src/main/java/cn/com/taiji/iaw/api/ass/ReSignController.java Näytä tiedosto

@@ -0,0 +1,46 @@
package cn.com.taiji.iaw.api.ass;

import cn.com.taiji.common.manager.ManagerException;
import cn.com.taiji.common.model.dao.Pagination;
import cn.com.taiji.common.web.ApiResponse;
import cn.com.taiji.iaw.api.MyValidController;
import cn.com.taiji.iaw.dto.ass.sign.RePageReqDto;
import cn.com.taiji.iaw.dto.ass.sign.ReSignRequestDTO;
import cn.com.taiji.iaw.dto.issue.order.SignQueryResponseDTO;
import cn.com.taiji.iaw.manager.ass.ResignManager;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
* @Author:ChenChao
* @Date:2025/7/19 15:44
* @Filename:ReSignController
* @description:
*/
@Api(tags = {"恢复签约"})
@RestController
@RequestMapping("/api/sign")
public class ReSignController extends MyValidController {

@Autowired
private ResignManager manager;

@ApiOperation("恢复签约-车辆信息分页查询")
@PostMapping("/rePage")
public ApiResponse<Pagination> page(@Valid @RequestBody RePageReqDto dto) throws ManagerException {
return ApiResponse.of(manager.rePage(dto));
}

@ApiOperation("恢复签约检测")
@PostMapping("/reSign")
public ApiResponse<SignQueryResponseDTO> reSign(@Valid @RequestBody ReSignRequestDTO dto) throws ManagerException {
return ApiResponse.of(manager.reSign(dto));
}
}

+ 7
- 0
zhywpt-app-iaw/src/main/java/cn/com/taiji/iaw/api/issue/OrderController.java Näytä tiedosto

@@ -155,4 +155,11 @@ public class OrderController extends MyValidController {
OrderDetailResDto resDto = issueOrderManage.orderDetailQuery(reqDto);
return ApiResponse.of(resDto);
}

@ApiOperation(value = "19.修改地址")
@PostMapping(value = "/updateAdress")
public ApiResponse<?> updateAdress(@Valid @RequestBody UpdateAdressReqDTO reqDto) throws ManagerException {
issueOrderManage.updateAdress(reqDto);
return ApiResponse.success().setMessage("修改成功");
}
}

+ 19
- 0
zhywpt-app-iaw/src/main/java/cn/com/taiji/iaw/dto/ass/sign/RePageReqDto.java Näytä tiedosto

@@ -0,0 +1,19 @@
package cn.com.taiji.iaw.dto.ass.sign;

import cn.com.taiji.common.valid.ViolationValidator;
import cn.com.taiji.core.dto.AbstractBizPageRequestDTO;
import lombok.Data;

/**
* @Author:ChenChao
* @Date:2025/7/19 15:52
* @Filename:RePageReqDto
* @description:
*/
@Data
public class RePageReqDto extends AbstractBizPageRequestDTO {
@Override
protected void validate(ViolationValidator validator) {
validator.validFieldNotBlank("customerId", getCustomerId());
}
}

+ 32
- 0
zhywpt-app-iaw/src/main/java/cn/com/taiji/iaw/dto/ass/sign/ReSignRequestDTO.java Näytä tiedosto

@@ -0,0 +1,32 @@
package cn.com.taiji.iaw.dto.ass.sign;

import cn.com.taiji.core.dto.AbstractBizRequestDTO;
import cn.com.taiji.core.model.comm.protocol.constraint.IntegerConstant;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
* @Author:ChenChao
* @Date:2025/7/19 15:55
* @Filename:ReSignRequestDTO
* @description:
*/
@ApiModel(description = "恢复签约请求参数")
@Data
public class ReSignRequestDTO extends AbstractBizRequestDTO {

@ApiModelProperty(value = "车辆Id")
private String vehicleId;

@NotNull
@IntegerConstant(values = "1,2")
@ApiModelProperty(value = "签约类型 1微信,2支付宝")
private Integer signChannelType=1;// 1:微信小程序 2:支付宝小程序
@NotBlank
@ApiModelProperty(value = "微信小程序或支付宝小程序的openId")
private String subOpenId;// signChannelType=1或2时必填,填黔通微信或支付宝小程序的openId,
}

+ 5
- 0
zhywpt-app-iaw/src/main/java/cn/com/taiji/iaw/dto/comm/VehicleInfoPageRequestDTO.java Näytä tiedosto

@@ -1,5 +1,6 @@
package cn.com.taiji.iaw.dto.comm;

import cn.com.taiji.common.valid.ViolationValidator;
import cn.com.taiji.core.dto.AbstractBizPageRequestDTO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@@ -25,4 +26,8 @@ public class VehicleInfoPageRequestDTO extends AbstractBizPageRequestDTO {
@ApiModelProperty(value = "车牌颜色")
private Integer vehiclePlateColor;

@Override
protected void validate(ViolationValidator validator) {
validator.validFieldNotBlank("customerId", getCustomerId());
}
}

+ 6
- 0
zhywpt-app-iaw/src/main/java/cn/com/taiji/iaw/dto/issue/order/SignQueryResponseDTO.java Näytä tiedosto

@@ -59,4 +59,10 @@ public class SignQueryResponseDTO {

@ApiModelProperty(value = "V3 签约参数 id")
private String preopenId;//V3黄牌 签约参数 +


@ApiModelProperty(value = "跳转渠道AppId")
private String channelSignAppId;
@ApiModelProperty(value = "渠道签约地址")
private String channelSignUrl;
}

+ 28
- 0
zhywpt-app-iaw/src/main/java/cn/com/taiji/iaw/dto/issue/order/UpdateAdressReqDTO.java Näytä tiedosto

@@ -0,0 +1,28 @@
package cn.com.taiji.iaw.dto.issue.order;

import cn.com.taiji.core.dto.AbstractBizRequestDTO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
* @Author:ChenChao
* @Date:2025/7/21 9:42
* @Filename:UpdateAdress
* @description:
*/
@ApiModel(description = "修改地址响应")
@Data
public class UpdateAdressReqDTO extends AbstractBizRequestDTO {

@ApiModelProperty(value = "订单编号",required = true)
private String orderNo;
@ApiModelProperty(value = "收货人",required = true)
private String consignee;// 换货——收货人
@ApiModelProperty(value = "收货人电话",required = true)
private String consigneeTel;// 换货——收货人电话
@ApiModelProperty(value = "收货所在地区(省、市、区、街道)",required = true)
private String region;// 换货——收货所在地区(省、市、区、街道)
@ApiModelProperty(value = "收货详细地址",required = true)
private String address;// 换货——收货详细地址
}

+ 83
- 0
zhywpt-app-iaw/src/main/java/cn/com/taiji/iaw/manager/ResignManagerImpl.java Näytä tiedosto

@@ -0,0 +1,83 @@
package cn.com.taiji.iaw.manager;

import cn.com.taiji.common.manager.ManagerException;
import cn.com.taiji.common.model.dao.Pagination;
import cn.com.taiji.core.entity.basic.QtkCardInfo;
import cn.com.taiji.core.entity.basic.QtkCustomerInfo;
import cn.com.taiji.core.entity.dict.basic.CardStatus;
import cn.com.taiji.core.entity.dict.basic.UserType;
import cn.com.taiji.core.entity.user.AccountInfo;
import cn.com.taiji.core.model.comm.protocol.ias.ass.ResignRequest;
import cn.com.taiji.core.model.comm.protocol.ias.order.SignQueryResponse;
import cn.com.taiji.core.repo.jpa.basic.QtkCardInfoRepo;
import cn.com.taiji.core.repo.jpa.basic.QtkCustomerInfoRepo;
import cn.com.taiji.core.repo.jpa.basic.QtkVehicleInfoRepo;
import cn.com.taiji.iaw.dto.ass.sign.RePageReqDto;
import cn.com.taiji.iaw.dto.ass.sign.ReSignRequestDTO;
import cn.com.taiji.iaw.dto.issue.order.SignQueryResponseDTO;
import cn.com.taiji.iaw.manager.ass.ResignManager;
import cn.com.taiji.iaw.repo.jpa.request.comm.VehicleSignPageRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @Author:ChenChao
* @Date:2025/7/19 15:49
* @Filename:ResignManagerImpl
* @description:
*/
@Service
public class ResignManagerImpl extends AbstractCommManager implements ResignManager {

@Autowired
private QtkVehicleInfoRepo vehicleInfoRepo;
@Autowired
private QtkCardInfoRepo cardInfoRepo;

@Autowired
private QtkCustomerInfoRepo customerInfoRepo;
@Override
public Pagination rePage(RePageReqDto dto) throws ManagerException {
dto.validate();
AccountInfo accountInfo = findAccountInfoByToken(dto.getAccessToken());
QtkCustomerInfo customerInfo = customerInfoRepo.findByCustomerId(dto.getCustomerId());
if (customerInfo == null) throw new ManagerException("ETC用户信息不存在");
if (UserType.PERSONAL_USER.equals(customerInfo.getUserType()) && !accountInfo.getIdNum().equals(customerInfo.getCustomerIdNum())) {
throw new ManagerException("账户信息与ETC账户信息不匹配");
}
if (UserType.UNIT_USER.equals(customerInfo.getUserType()) && !accountInfo.getIdNum().equals(customerInfo.getAgentIdNum())) {
throw new ManagerException("账户信息与ETC账户信息不匹配");
}
List<String> queryVehicleIds = null;
List<String> vehicleIds = vehicleInfoRepo.queryVehicleIds(dto.getCustomerId());
if (isEmpty(vehicleIds)) {
return new Pagination();
}else {
//过滤出有正常卡的
queryVehicleIds = cardInfoRepo.queryVehicleIds(vehicleIds, CardStatus.ZC);
if (isEmpty(queryVehicleIds)) {
return new Pagination();
}
}
VehicleSignPageRequest request = new VehicleSignPageRequest();
request.setVehicleIds(queryVehicleIds);
return vehicleInfoRepo.page(request);
}

@Override
public SignQueryResponseDTO reSign(ReSignRequestDTO dto) throws ManagerException {
QtkCardInfo cardInfo = cardInfoRepo.findByVehicleIdAndCardStatus(dto.getVehicleId(), CardStatus.ZC);
if (cardInfo == null) throw new ManagerException("未找到车辆卡信息");
AccountInfo accountInfo = findAccountInfoByToken(dto.getAccessToken());
ResignRequest request = new ResignRequest();
request.setWxOpenId(dto.getSubOpenId());
request.setAgencyId(cardInfo.getAgencyId());
request.setAgencyId(dto.getVehicleId());
request.setName(accountInfo.getUserName());
request.setIdNum(accountInfo.getIdNum());
SignQueryResponse response = jsonPostRepeat(request);
return copyProperties(response, new SignQueryResponseDTO());
}
}

+ 19
- 0
zhywpt-app-iaw/src/main/java/cn/com/taiji/iaw/manager/ass/ResignManager.java Näytä tiedosto

@@ -0,0 +1,19 @@
package cn.com.taiji.iaw.manager.ass;

import cn.com.taiji.common.manager.ManagerException;
import cn.com.taiji.common.model.dao.Pagination;
import cn.com.taiji.iaw.dto.ass.sign.RePageReqDto;
import cn.com.taiji.iaw.dto.ass.sign.ReSignRequestDTO;
import cn.com.taiji.iaw.dto.issue.order.SignQueryResponseDTO;

/**
* @Author:ChenChao
* @Date:2025/7/19 15:48
* @Filename:ResignManager
* @description:
*/
public interface ResignManager {
Pagination rePage(RePageReqDto dto) throws ManagerException;

SignQueryResponseDTO reSign(ReSignRequestDTO dto) throws ManagerException;
}

+ 22
- 6
zhywpt-app-iaw/src/main/java/cn/com/taiji/iaw/manager/comm/VehicleInfoManagerImpl.java Näytä tiedosto

@@ -1,14 +1,25 @@
package cn.com.taiji.iaw.manager.comm;

import cn.com.taiji.common.manager.ManagerException;
import cn.com.taiji.common.manager.net.http.ServiceHandleException;
import cn.com.taiji.common.model.dao.Pagination;
import cn.com.taiji.common.pub.StringTools;
import cn.com.taiji.common.pub.dao.HqlBuilder;
import cn.com.taiji.common.repo.request.jpa.JpaPageableDataRequest;
import cn.com.taiji.core.entity.basic.QtkCardInfo;
import cn.com.taiji.core.entity.basic.QtkCustomerInfo;
import cn.com.taiji.core.entity.basic.QtkVehicleInfo;
import cn.com.taiji.core.entity.dict.basic.CardStatus;
import cn.com.taiji.core.entity.dict.basic.UserType;
import cn.com.taiji.core.entity.user.AccountInfo;
import cn.com.taiji.core.repo.jpa.basic.QtkCardInfoRepo;
import cn.com.taiji.core.repo.jpa.basic.QtkCustomerInfoRepo;
import cn.com.taiji.core.repo.jpa.basic.QtkVehicleInfoRepo;
import cn.com.taiji.core.repo.jpa.user.AccountInfoRepo;
import cn.com.taiji.core.repo.request.basic.QtkVehicleInfoPageRequest;
import cn.com.taiji.iaw.dto.comm.*;
import cn.com.taiji.iaw.manager.AbstractCommManager;
import cn.com.taiji.iaw.repo.jpa.request.comm.VehicleSignPageRequest;
import cn.com.taiji.iaw.tools.WxLoginUserUtil;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@@ -16,6 +27,7 @@ import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

/**
* @Auther: humh
@@ -33,15 +45,19 @@ public class VehicleInfoManagerImpl extends AbstractCommManager implements Vehic
private WxLoginUserUtil wxLoginUserUtil;
@Autowired
private QtkCardInfoRepo cardInfoRepo;

@Autowired
private QtkCustomerInfoRepo customerInfoRepo;
@Override
public Pagination page(VehicleInfoPageRequestDTO dto) throws ManagerException {
dto.validate();
QtkVehicleInfoPageRequest pageRequest = copyProperties(dto, new QtkVehicleInfoPageRequest());
String customerId = wxLoginUserUtil.getCustomerIdFromOpenId(findOpenIdByToken(dto.getAccessToken()));
if (StringUtils.isEmpty(customerId)){
throw new ManagerException("未获取到用户信息!");
}
pageRequest.setCustomerId(customerId);
// String customerId = wxLoginUserUtil.getCustomerIdFromOpenId(findOpenIdByToken(dto.getAccessToken()));
// if (StringUtils.isEmpty(customerId)){
// throw new ManagerException("未获取到用户信息!");
// }
QtkCustomerInfo customerInfo = customerInfoRepo.findByCustomerId(dto.getCustomerId());
if (customerInfo == null) throw new ManagerException("未获取到用户信息!");
pageRequest.setCustomerId(dto.getCustomerId());
return repo.page(pageRequest);
}


+ 2
- 0
zhywpt-app-iaw/src/main/java/cn/com/taiji/iaw/manager/issue/IssueOrderManage.java Näytä tiedosto

@@ -54,4 +54,6 @@ public interface IssueOrderManage {
void orderReceiveGoods(OrderDetailReqDto reqDto) throws ManagerException;

void orderCancel(OrderCancelRequestDTO reqDto) throws ManagerException;

void updateAdress(UpdateAdressReqDTO reqDto) throws ManagerException;
}

+ 47
- 6
zhywpt-app-iaw/src/main/java/cn/com/taiji/iaw/manager/issue/IssueOrderManageImpl.java Näytä tiedosto

@@ -5,14 +5,13 @@ import cn.com.taiji.common.manager.ManagerException;
import cn.com.taiji.common.manager.net.http.ServiceHandleException;
import cn.com.taiji.common.model.dao.Pagination;
import cn.com.taiji.common.valid.ViolationValidator;
import cn.com.taiji.core.entity.ass.AssAgencyConfig;
import cn.com.taiji.core.entity.comm.CommonSatisfaction;
import cn.com.taiji.core.entity.dict.EnableStatus;
import cn.com.taiji.core.entity.dict.basic.IdType;
import cn.com.taiji.core.entity.dict.basic.SourceType;
import cn.com.taiji.core.entity.dict.basic.UserType;
import cn.com.taiji.core.entity.dict.issue.IssueOrderStep;
import cn.com.taiji.core.entity.dict.issue.OrderType;
import cn.com.taiji.core.entity.dict.issue.ShippingStatus;
import cn.com.taiji.core.entity.dict.issue.*;
import cn.com.taiji.core.entity.dict.log.OperateType;
import cn.com.taiji.core.entity.issue.*;
import cn.com.taiji.core.entity.user.Staff;
@@ -22,6 +21,7 @@ import cn.com.taiji.core.model.comm.protocol.inss.inst.InstApplyRequest;
import cn.com.taiji.core.model.comm.protocol.inss.inst.InstApplyResponse;
import cn.com.taiji.core.model.comm.protocol.inss.inst.InstCallBackRequest;
import cn.com.taiji.core.model.comm.protocol.inss.inst.InstCallBackResponse;
import cn.com.taiji.core.repo.jpa.ass.AssAgencyConfigRepo;
import cn.com.taiji.core.repo.jpa.comm.SatisfactionRepo;
import cn.com.taiji.core.repo.jpa.issue.*;
import cn.com.taiji.core.repo.jpa.user.StaffRepo;
@@ -33,6 +33,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.persistence.Column;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.List;
@@ -64,6 +65,12 @@ public class IssueOrderManageImpl extends AbstractIawManager implements IssueOrd
private MinioUtil minioUtil;
@Autowired
private SatisfactionRepo satisfactionRepo;
@Autowired
private AssAgencyConfigRepo assAgencyConfigRepo;
@Autowired
private IssueOrderRechangeRepo issueOrderRechangeRepo;
@Autowired
private IssueOrderinfoExtRepo issueOrderinfoExtRepo;

@Override
public Pagination mOrderPage(OrderMinPageReqDTO reqDto) throws ServiceHandleException {
@@ -241,9 +248,18 @@ public class IssueOrderManageImpl extends AbstractIawManager implements IssueOrd
}

@Override
public SignQueryResponseDTO signQuery(SignQueryRequest reqDto) throws ManagerException {
SignQueryResponse signQueryResponse = jsonPostRepeat(reqDto);
return copyProperties(signQueryResponse, new SignQueryResponseDTO());
public SignQueryResponseDTO signQuery(SignQueryRequest request) throws ManagerException {
IssueOrderinfo orderinfo = checkOrder(request.getOrderNo());
SignQueryResponseDTO resDTO = new SignQueryResponseDTO();
// AssAgencyConfig agencyConfig = assAgencyConfigRepo.findByAgencyId(orderinfo.getAgencyId());
// if (agencyConfig == null) throw new ManagerException("渠道参数未配置");
// if (!agencyConfig.getQtUserSign()){
// resDTO.setChannelSignAppId(agencyConfig.getChannelSignAppId());
// resDTO.setChannelSignUrl(agencyConfig.getChannelSignUrl());
// return resDTO;
// }
SignQueryResponse signQueryResponse = jsonPostRepeat(request);
return copyProperties(signQueryResponse, resDTO);
}

@Override
@@ -369,6 +385,31 @@ public class IssueOrderManageImpl extends AbstractIawManager implements IssueOrd
sysPersistOperateLog(OperateType.ORDER_CANCEL,order.getId(),reqDto.getOrderSource(), openId,"订单取消");
}

@Override
public void updateAdress(UpdateAdressReqDTO reqDto) throws ManagerException {
IssueOrderinfo orderinfo = checkOrder(reqDto.getOrderNo());
if (!IssueOrderStep.WAITING_SEND.equals(orderinfo.getOrderStep())) {
throw new ManagerException("当前订单阶段不可修改地址");
}
//存在换货记录,更改换货表,否则更改订单拓展表
IssueOrderRechange rechange = issueOrderRechangeRepo.findRCByOrderNoAndStatus(reqDto.getOrderNo(), RechangeType.EXCHANGE, RechangeStatus.NEW);
if (rechange == null){
IssueOrderinfoExt ext = issueOrderinfoExtRepo.findByOrderNo(reqDto.getOrderNo());
ext.setConsignee(reqDto.getConsignee());
ext.setConsigneeTel(reqDto.getConsigneeTel());
ext.setRegion(reqDto.getRegion());
ext.setAddress(reqDto.getAddress());
issueOrderinfoExtRepo.merge(ext);

}else {
rechange.setConsignee(reqDto.getConsignee());
rechange.setConsigneeTel(reqDto.getConsigneeTel());
rechange.setRegion(reqDto.getRegion());
rechange.setAddress(reqDto.getAddress());
issueOrderRechangeRepo.merge(rechange);
}
}

//校验发行订单是否存在
private IssueOrderinfo checkOrder(String orderNo) throws ManagerException {
IssueOrderinfo order = issueOrderinfoRepo.findByOrderNo(orderNo);

+ 31
- 0
zhywpt-app-iaw/src/main/java/cn/com/taiji/iaw/repo/jpa/request/comm/VehicleSignPageRequest.java Näytä tiedosto

@@ -0,0 +1,31 @@
package cn.com.taiji.iaw.repo.jpa.request.comm;

import cn.com.taiji.common.pub.dao.HqlBuilder;
import cn.com.taiji.common.repo.request.jpa.JpaDateTimePageableDataRequest;
import cn.com.taiji.core.entity.basic.QtkVehicleInfo;
import lombok.Getter;
import lombok.Setter;

import java.util.List;


@Getter
@Setter
public class VehicleSignPageRequest extends JpaDateTimePageableDataRequest<QtkVehicleInfo>{

public VehicleSignPageRequest() {
this.orderBy="updateTime";
this.desc=true;
}

// 车辆ID
private List<String> vehicleIds;

@Override
public HqlBuilder toSelectHql() {
HqlBuilder hql = new HqlBuilder("from " + QtkVehicleInfo.class.getName() + " where 1=1 ");
hql.append(" and vehicleId in:vehicleIds", vehicleIds);
return hql;
}

}

+ 1
- 1
zhywpt-app-iaw/src/main/java/cn/com/taiji/iaw/repo/jpa/request/issue/IssueOrdermPageRequest.java Näytä tiedosto

@@ -59,7 +59,7 @@ public class IssueOrdermPageRequest extends JpaPageableDataRequest<IssueOrderinf
if (!tabIndex.equals(0)) {
hql.append(" and orderStatus != 'CANCEL' ");
}
hql.append(" AND orderSource=:source", SourceType.WECHAT);
// hql.append(" AND orderSource=:source", SourceType.WECHAT);
return hql;
}
}

Loading…
Peruuta
Tallenna