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.common.web.ApiResponse; | import cn.com.taiji.common.web.ApiResponse; | ||||
import cn.com.taiji.core.entity.comm.CommonPayConfig; | |||||
import cn.com.taiji.userw.dto.wx.*; | import cn.com.taiji.userw.dto.wx.*; | ||||
import cn.com.taiji.userw.manager.wx.WxPayConfigManager; | import cn.com.taiji.userw.manager.wx.WxPayConfigManager; | ||||
import io.swagger.annotations.Api; | import io.swagger.annotations.Api; | ||||
import org.springframework.validation.annotation.Validated; | import org.springframework.validation.annotation.Validated; | ||||
import org.springframework.web.bind.annotation.*; | import org.springframework.web.bind.annotation.*; | ||||
import java.util.List; | |||||
/** | /** | ||||
* @Author:ChenChao | * @Author:ChenChao | ||||
* @Date:2025/5/20 17:00 | * @Date:2025/5/20 17:00 | ||||
manager.update(reqDto); | manager.update(reqDto); | ||||
return ApiResponse.success().setMessage("修改成功"); | return ApiResponse.success().setMessage("修改成功"); | ||||
} | } | ||||
} | } |
package cn.com.taiji.userw.dto.centerHallAndAgency; | package cn.com.taiji.userw.dto.centerHallAndAgency; | ||||
import cn.com.taiji.core.dto.AbstractStaffBizPageRequestDTO; | import cn.com.taiji.core.dto.AbstractStaffBizPageRequestDTO; | ||||
import io.swagger.annotations.ApiModel; | |||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.Data; | import lombok.Data; | ||||
/** | /** | ||||
* @Filename:CenterHallRequestDTO | * @Filename:CenterHallRequestDTO | ||||
* @description: 中心网点/渠道请求参数 | * @description: 中心网点/渠道请求参数 | ||||
*/ | */ | ||||
@ApiModel(value = "中心网点/渠道请求参数") | |||||
@Data | @Data | ||||
public class CenterHallOrAgencyPageRequestDTO extends AbstractStaffBizPageRequestDTO { | public class CenterHallOrAgencyPageRequestDTO extends AbstractStaffBizPageRequestDTO { | ||||
@ApiModelProperty(name = "中心网点/渠道ID") | |||||
private String id; | |||||
@ApiModelProperty(name = "中心网点/渠道名称") | |||||
private String name; | |||||
} | } |
if (reqDto.getOptType() == 1){ | if (reqDto.getOptType() == 1){ | ||||
QtkAgencyMap agencyMap = qtkAgencyMapRepo.findByCenterAgencyId(reqDto.getCenterAgencyId()); | QtkAgencyMap agencyMap = qtkAgencyMapRepo.findByCenterAgencyId(reqDto.getCenterAgencyId()); | ||||
if (agencyMap != null) throw new ManagerException("此中心渠道编号也存在"); | if (agencyMap != null) throw new ManagerException("此中心渠道编号也存在"); | ||||
agencyMap = copyProperties(reqDto, new QtkAgencyMap()); | |||||
agencyMap = copyProperties(reqDto, new QtkAgencyMap(),"id"); | |||||
qtkAgencyMapRepo.persist(agencyMap); | qtkAgencyMapRepo.persist(agencyMap); | ||||
}else { | }else { | ||||
QtkAgencyMap qtkAgencyMap = qtkAgencyMapRepo.findById(reqDto.getId()).orElse(null); | QtkAgencyMap qtkAgencyMap = qtkAgencyMapRepo.findById(reqDto.getId()).orElse(null); | ||||
if (qtkAgencyMap == null) throw new ManagerException("此中心渠道不存在"); | if (qtkAgencyMap == null) throw new ManagerException("此中心渠道不存在"); | ||||
copyProperties(reqDto,qtkAgencyMap,"id","centerAgencyName"); | |||||
copyProperties(reqDto,qtkAgencyMap,"id","centerAgencyId"); | |||||
qtkAgencyMapRepo.merge(qtkAgencyMap); | qtkAgencyMapRepo.merge(qtkAgencyMap); | ||||
} | } | ||||
} | } | ||||
@Override | @Override | ||||
public Pagination page(CenterHallOrAgencyPageRequestDTO reqDto) { | public Pagination page(CenterHallOrAgencyPageRequestDTO reqDto) { | ||||
CenterAgencyPageRequest request = copyProperties(reqDto, new CenterAgencyPageRequest()); | |||||
CenterAgencyPageRequest request = new CenterAgencyPageRequest(); | |||||
request.setCenterAgencyId(reqDto.getId()); | |||||
request.setCenterAgencyName(reqDto.getName()); | |||||
return qtkAgencyMapRepo.page(request); | return qtkAgencyMapRepo.page(request); | ||||
} | } | ||||
} | } |
if (reqDto.getOptType() == 1){ | if (reqDto.getOptType() == 1){ | ||||
QtkServicehallMap serviceHallId = qtkServicehallMapRepo.findByCenterServiceHallId(reqDto.getCenterServiceHallId()); | QtkServicehallMap serviceHallId = qtkServicehallMapRepo.findByCenterServiceHallId(reqDto.getCenterServiceHallId()); | ||||
if (serviceHallId != null) throw new ManagerException("此中心网点已存在"); | if (serviceHallId != null) throw new ManagerException("此中心网点已存在"); | ||||
QtkServicehallMap servicehallMap = copyProperties(reqDto, new QtkServicehallMap()); | |||||
QtkServicehallMap servicehallMap = copyProperties(reqDto, new QtkServicehallMap(),"id"); | |||||
qtkServicehallMapRepo.persist(servicehallMap); | qtkServicehallMapRepo.persist(servicehallMap); | ||||
}else { | }else { | ||||
QtkServicehallMap servicehallMap = qtkServicehallMapRepo.findById(reqDto.getId()).orElse(null); | QtkServicehallMap servicehallMap = qtkServicehallMapRepo.findById(reqDto.getId()).orElse(null); | ||||
@Override | @Override | ||||
public Pagination page(CenterHallOrAgencyPageRequestDTO reqDto) { | public Pagination page(CenterHallOrAgencyPageRequestDTO reqDto) { | ||||
CenterServiceHallPageRequest request = copyProperties(reqDto, new CenterServiceHallPageRequest()); | |||||
CenterServiceHallPageRequest request = new CenterServiceHallPageRequest(); | |||||
request.setCenterServiceHallId(reqDto.getId()); | |||||
request.setCenterServicehallName(reqDto.getName()); | |||||
return qtkServicehallMapRepo.page(request); | return qtkServicehallMapRepo.page(request); | ||||
} | } | ||||
} | } |
//递归 | //递归 | ||||
public List<ServiceHallSonQueryModel> querySon(List<QtkServiceHall> serviceHalls,Map<String, List<QtkServiceHall>> collect) { | public List<ServiceHallSonQueryModel> querySon(List<QtkServiceHall> serviceHalls,Map<String, List<QtkServiceHall>> collect) { | ||||
ArrayList<ServiceHallSonQueryModel> returnModes = new ArrayList<>(); | ArrayList<ServiceHallSonQueryModel> returnModes = new ArrayList<>(); | ||||
for (QtkServiceHall serviceHall : serviceHalls) { | |||||
ServiceHallSonQueryModel model = new ServiceHallSonQueryModel(); | |||||
String serviceHallId = serviceHall.getServiceHallId(); | |||||
model.setServicehallId(serviceHallId); | |||||
model.setServicehallName(serviceHall.getName()); | |||||
List<QtkServiceHall> serviceHalls1 = collect.get(serviceHallId); | |||||
if (serviceHalls1 != null){ | |||||
model.setChildrens(querySon(serviceHalls1, collect)); | |||||
if (CollectionUtil.isNotEmpty(serviceHalls)) { | |||||
for (QtkServiceHall serviceHall : serviceHalls) { | |||||
ServiceHallSonQueryModel model = new ServiceHallSonQueryModel(); | |||||
String serviceHallId = serviceHall.getServiceHallId(); | |||||
model.setServicehallId(serviceHallId); | |||||
model.setServicehallName(serviceHall.getName()); | |||||
List<QtkServiceHall> serviceHalls1 = collect.get(serviceHallId); | |||||
if (serviceHalls1 != null) { | |||||
model.setChildrens(querySon(serviceHalls1, collect)); | |||||
} | |||||
returnModes.add(model); | |||||
} | } | ||||
returnModes.add(model); | |||||
} | } | ||||
return returnModes; | return returnModes; | ||||
} | } |
import cn.com.taiji.userw.dto.wx.WxPayPageRequestDTO; | import cn.com.taiji.userw.dto.wx.WxPayPageRequestDTO; | ||||
import cn.com.taiji.userw.dto.wx.WxPayUpdateReqDTO; | import cn.com.taiji.userw.dto.wx.WxPayUpdateReqDTO; | ||||
import java.util.List; | |||||
/** | /** | ||||
* @Author:ChenChao | * @Author:ChenChao | ||||
* @Date:2025/5/20 17:03 | * @Date:2025/5/20 17:03 | ||||
void add(WxPayAddReqDTO reqDto); | void add(WxPayAddReqDTO reqDto); | ||||
void update(WxPayUpdateReqDTO reqDto) throws ManagerException; | void update(WxPayUpdateReqDTO reqDto) throws ManagerException; | ||||
} | } |
import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
import org.springframework.stereotype.Service; | import org.springframework.stereotype.Service; | ||||
import java.util.List; | |||||
/** | /** | ||||
* @Author:ChenChao | * @Author:ChenChao | ||||
* @Date:2025/5/20 17:03 | * @Date:2025/5/20 17:03 | ||||
commonPayConfigRepo.merge(commonPayConfig); | commonPayConfigRepo.merge(commonPayConfig); | ||||
} | } | ||||
} | } |
import cn.com.taiji.core.entity.basic.QtkServicehallMap; | import cn.com.taiji.core.entity.basic.QtkServicehallMap; | ||||
import lombok.Data; | import lombok.Data; | ||||
import javax.persistence.Column; | |||||
import javax.validation.constraints.Size; | |||||
@Data | @Data | ||||
public class CenterAgencyPageRequest extends JpaPageableDataRequest<QtkAgencyMap> { | public class CenterAgencyPageRequest extends JpaPageableDataRequest<QtkAgencyMap> { | ||||
private String centerAgencyId; | |||||
private String centerAgencyName; | |||||
public CenterAgencyPageRequest() { | |||||
this.orderBy="insertTime"; | |||||
this.desc=true; | |||||
} | |||||
@Override | @Override | ||||
public HqlBuilder toSelectHql() { | public HqlBuilder toSelectHql() { | ||||
HqlBuilder hql = new HqlBuilder("from QtkAgencyMap where 1=1 "); | HqlBuilder hql = new HqlBuilder("from QtkAgencyMap where 1=1 "); | ||||
hql.append("and centerAgencyId like :centerAgencyId ", like(centerAgencyId)); | |||||
hql.append("and centerAgencyName like :centerAgencyName ", like(centerAgencyName)); | |||||
return hql; | return hql; | ||||
} | } | ||||
} | } |
import cn.com.taiji.core.entity.basic.QtkServicehallMap; | import cn.com.taiji.core.entity.basic.QtkServicehallMap; | ||||
import lombok.Data; | import lombok.Data; | ||||
import javax.persistence.Column; | |||||
import javax.validation.constraints.Size; | |||||
@Data | @Data | ||||
public class CenterServiceHallPageRequest extends JpaPageableDataRequest<QtkServicehallMap> { | public class CenterServiceHallPageRequest extends JpaPageableDataRequest<QtkServicehallMap> { | ||||
private String centerServiceHallId; | |||||
private String centerServicehallName; | |||||
public CenterServiceHallPageRequest() { | |||||
this.orderBy="insertTime"; | |||||
this.desc=true; | |||||
} | |||||
@Override | @Override | ||||
public HqlBuilder toSelectHql() { | public HqlBuilder toSelectHql() { | ||||
HqlBuilder hql = new HqlBuilder("from QtkServicehallMap where 1=1 "); | HqlBuilder hql = new HqlBuilder("from QtkServicehallMap where 1=1 "); | ||||
hql.append("and centerServiceHallId like :centerServiceHallId ", like(centerServiceHallId)); | |||||
hql.append("and centerServicehallName like :centerServicehallName ", like(centerServicehallName)); | |||||
return hql; | return hql; | ||||
} | } | ||||
} | } |
private String agencyId;//渠道编号 | private String agencyId;//渠道编号 | ||||
public CommonPayConfigPageRequest() { | public CommonPayConfigPageRequest() { | ||||
this.orderBy="agencyId"; | |||||
this.orderBy="insertTime"; | |||||
this.desc=true; | this.desc=true; | ||||
} | } | ||||