Browse Source

userw

master
chenchaod 4 weeks ago
parent
commit
27e7b0b24e

+ 3
- 1
gly-base-core/src/main/java/cn/com/taiji/core/repo/jpa/comm/CommonWxSignConfigRepo.java View File

import org.springframework.data.jpa.repository.Query; import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;


import java.util.List;

public interface CommonWxSignConfigRepo extends AbstractJpaRepo<CommonWxSignConfig, String>{ public interface CommonWxSignConfigRepo extends AbstractJpaRepo<CommonWxSignConfig, String>{


CommonWxSignConfig findByParentId(String parentId);
List<CommonWxSignConfig> findByParentId(String parentId);


CommonWxSignConfig findByParentIdAndVersion(String parentId, Integer version); CommonWxSignConfig findByParentIdAndVersion(String parentId, Integer version);



+ 9
- 3
zhywpt-app-userw/src/main/java/cn/com/taiji/userw/dto/wx/WxCarPageReqDTO.java View File

import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;


import javax.persistence.Column;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;

/** /**
* @Author:ChenChao * @Author:ChenChao
* @Date:2025/5/20 14:52 * @Date:2025/5/20 14:52
@Data @Data
public class WxCarPageReqDTO extends AbstractStaffBizPageRequestDTO { public class WxCarPageReqDTO extends AbstractStaffBizPageRequestDTO {


@ApiModelProperty(value = "渠道编号")
@FixedLength(length = 11)
private String agencyId;
// @ApiModelProperty(value = "渠道编号")
// @FixedLength(length = 11)
// private String agencyId;
@ApiModelProperty(value = "父表ID")
private String parentId;//父表ID


} }

+ 4
- 0
zhywpt-app-userw/src/main/java/cn/com/taiji/userw/dto/wx/WxPayAddReqDTO.java View File

import javax.persistence.Column; import javax.persistence.Column;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;


/** /**
* @Author:ChenChao * @Author:ChenChao
private Integer wxServiceType;//微信商户下单类型,1普通商户,2服务商 private Integer wxServiceType;//微信商户下单类型,1普通商户,2服务商
@ApiModelProperty(value = "微信商户号") @ApiModelProperty(value = "微信商户号")
private String wxSubMchId;//微信商户号 private String wxSubMchId;//微信商户号
@ApiModelProperty(value = "微信子appid")
private String wxSubAppId;//微信子appid
@ApiModelProperty(value = "微信商户公钥ID") @ApiModelProperty(value = "微信商户公钥ID")
private String wxPublicKeyId; private String wxPublicKeyId;
@ApiModelProperty(value = "微信商户公钥") @ApiModelProperty(value = "微信商户公钥")
} }
if (wxServiceType != null && wxServiceType==2){ if (wxServiceType != null && wxServiceType==2){
validator.validFieldNotBlank("wxSubMchId",wxSubMchId); validator.validFieldNotBlank("wxSubMchId",wxSubMchId);
validator.validFieldNotBlank("wxSubAppId",wxSubAppId);
} }
} }



+ 8
- 0
zhywpt-app-userw/src/main/java/cn/com/taiji/userw/manager/wx/ParentSignConfigManagerImpl.java View File

import cn.com.taiji.common.manager.ManagerException; import cn.com.taiji.common.manager.ManagerException;
import cn.com.taiji.common.model.dao.Pagination; import cn.com.taiji.common.model.dao.Pagination;
import cn.com.taiji.core.entity.comm.CommonPASignConfig; import cn.com.taiji.core.entity.comm.CommonPASignConfig;
import cn.com.taiji.core.entity.comm.CommonWxSignConfig;
import cn.com.taiji.core.repo.jpa.comm.CommonPASignConfigRepo; import cn.com.taiji.core.repo.jpa.comm.CommonPASignConfigRepo;
import cn.com.taiji.core.repo.jpa.comm.CommonWxSignConfigRepo; import cn.com.taiji.core.repo.jpa.comm.CommonWxSignConfigRepo;
import cn.com.taiji.userw.dto.wx.CarParentAddReqDTO; import cn.com.taiji.userw.dto.wx.CarParentAddReqDTO;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;


import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.List;


/** /**
* @Author:ChenChao * @Author:ChenChao
CommonPASignConfig paSignConfig = commonPASignConfigRepo.findById(reqDto.getId()).orElse(null); CommonPASignConfig paSignConfig = commonPASignConfigRepo.findById(reqDto.getId()).orElse(null);
if (paSignConfig == null) throw new ManagerException("该配置不存在"); if (paSignConfig == null) throw new ManagerException("该配置不存在");
paSignConfig.setInfo(reqDto.getInfo()); paSignConfig.setInfo(reqDto.getInfo());
if (!reqDto.getPayChannelType().equals(paSignConfig.getPayChannelType())){
List<CommonWxSignConfig> byParentId = commonWxSignConfigRepo.findByParentId(reqDto.getId());
if (!isEmpty(byParentId)){
throw new ManagerException("该配置已存在详情支付配置");
}
}
if (!paSignConfig.getMchId().equals(reqDto.getMchId())){ if (!paSignConfig.getMchId().equals(reqDto.getMchId())){
paSignConfig.setMchId(reqDto.getMchId()); paSignConfig.setMchId(reqDto.getMchId());
//更新子表商户号 //更新子表商户号

+ 6
- 2
zhywpt-app-userw/src/main/java/cn/com/taiji/userw/repo/jpa/request/CommonWxSignConfigPageRequest.java View File

import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;


import javax.persistence.Column;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;

@Getter @Getter
@Setter @Setter
public class CommonWxSignConfigPageRequest extends JpaDateTimePageableDataRequest<CommonWxSignConfig> { public class CommonWxSignConfigPageRequest extends JpaDateTimePageableDataRequest<CommonWxSignConfig> {




private String agencyId;//渠道编号
private String parentId;//父表ID




public CommonWxSignConfigPageRequest() { public CommonWxSignConfigPageRequest() {
@Override @Override
public HqlBuilder toSelectHql(){ public HqlBuilder toSelectHql(){
HqlBuilder hql = new HqlBuilder("from "+CommonWxSignConfig.class.getName()+" where 1=1 "); HqlBuilder hql = new HqlBuilder("from "+CommonWxSignConfig.class.getName()+" where 1=1 ");
hql.append(" and agencyId=:agencyId", agencyId);
hql.append(" and parentId=:parentId", parentId);
return hql; return hql;
} }



Loading…
Cancel
Save