@@ -5,7 +5,6 @@ import java.io.IOException; | |||
import java.io.StringWriter; | |||
import java.util.Locale; | |||
import java.util.Map; | |||
import freemarker.template.Configuration; | |||
import freemarker.template.ObjectWrapper; | |||
import freemarker.template.Template; |
@@ -26,7 +26,7 @@ public class QtkAgency extends StringUUIDEntity { | |||
@NotBlank | |||
@Size(max = 6) | |||
@Column(name = "ISSUER_ID") | |||
private String issuerId;//发行方编号 | |||
private String issuerId = "520101";//发行方编号 | |||
@NotBlank | |||
@Size(max = 11) | |||
@Column(name = "AGENCY_ID") | |||
@@ -57,9 +57,6 @@ public class QtkAgency extends StringUUIDEntity { | |||
@Size(max = 255) | |||
@Column(name = "INFO") | |||
private String info;//备注 | |||
@NotNull | |||
@Column(name = "CREATE_TIME") | |||
private LocalDateTime createTime;//录入时间 | |||
/* @Column(name = "START_TIME") | |||
private LocalDateTime startTime;//注册时间 | |||
@Column(name = "END_TIME") | |||
@@ -85,9 +82,11 @@ public class QtkAgency extends StringUUIDEntity { | |||
@Size(max = 50) | |||
@Column(name = "FILE_DIR") | |||
private String fileDir;//流水文件目录名 | |||
*/ | |||
@Size(max = 50) | |||
@Column(name = "ACCOUNT_ID") | |||
private String accountId;//记账渠道号(映射网点) | |||
/* | |||
@Size(max = 50) | |||
@Column(name = "AGENCY_TRANS_SEND_TYPE") | |||
private String agencyTransSendType;//渠道流水推送类型(AgencyTransSendType) | |||
@@ -111,7 +110,7 @@ public class QtkAgency extends StringUUIDEntity { | |||
private String merchantId;//商户号*/ | |||
@NotNull | |||
@Column(name = "STATUS") | |||
private Integer status;//状态,1-启用 0-停用 | |||
private Integer status = 1;//状态,1-启用 0-停用 | |||
/* @Size(max = 64) | |||
@Column(name = "AGREEMENT_NAME") | |||
private String agreementName;//协议名称 | |||
@@ -155,5 +154,11 @@ public class QtkAgency extends StringUUIDEntity { | |||
/*@Size(max = 255) | |||
@Column(name = "CAPITAL_ACCOUNTS") | |||
private String capitalAccounts;//渠道对应的资金账户(对公账户)*/ | |||
@NotNull | |||
@Column(name = "INSERT_TIME") | |||
private LocalDateTime insertTime = LocalDateTime.now();//录入时间 | |||
@NotNull | |||
@Column(name = "UPDATE_TIME") | |||
private LocalDateTime updateTime = LocalDateTime.now();//更改时间 | |||
} |
@@ -0,0 +1,32 @@ | |||
package cn.com.taiji.core.entity.basic; | |||
import javax.persistence.*; | |||
import javax.validation.constraints.Size; | |||
import cn.com.taiji.common.entity.StringPropertyUUIDEntity; | |||
import lombok.Getter; | |||
import lombok.Setter; | |||
/** | |||
* 渠道映射表,如6个渠道可能映射成一个了,因为老系统没产品,一个产品多个渠道。 | |||
* | |||
*/ | |||
@Getter | |||
@Setter | |||
@Entity | |||
@Table(name = "QTK_AGENCY_MAP") | |||
public class QtkAgencyMap extends StringPropertyUUIDEntity { | |||
@Size(max = 64) | |||
@Column(name = "CENTER_AGENCY_ID") | |||
private String centerAgencyId; | |||
@Size(max = 64) | |||
@Column(name = "CENTER_AGENCY_NAME") | |||
private String centerAgencyName; | |||
} |
@@ -27,7 +27,7 @@ public class QtkAgencyModel extends StringPropertyUUIDEntity { | |||
@NotNull | |||
@Column(name = "INSERT_TIME") | |||
private LocalDateTime insertTime;//入库时间 | |||
private LocalDateTime insertTime = LocalDateTime.now();//入库时间 | |||
@NotBlank | |||
@Size(max = 50) | |||
@Column(name = "AGREEMENT_NAME") |
@@ -0,0 +1,9 @@ | |||
package cn.com.taiji.core.repo.jpa.basic; | |||
import cn.com.taiji.common.repo.jpa.AbstractJpaRepo; | |||
import cn.com.taiji.core.entity.basic.QtkAgencyMap; | |||
public interface QtkAgencyMapRepo extends AbstractJpaRepo<QtkAgencyMap, String>{ | |||
QtkAgencyMap findByCenterAgencyId(String centerAgencyId); | |||
} |
@@ -2,7 +2,19 @@ package cn.com.taiji.core.repo.jpa.basic; | |||
import cn.com.taiji.common.repo.jpa.AbstractJpaRepo; | |||
import cn.com.taiji.core.entity.basic.QtkAgencyModel; | |||
import org.springframework.data.jpa.repository.Modifying; | |||
import org.springframework.data.jpa.repository.Query; | |||
import org.springframework.transaction.annotation.Transactional; | |||
public interface QtkAgencyModelRepo extends AbstractJpaRepo<QtkAgencyModel, String>{ | |||
public QtkAgencyModel findByAgencyId(String agencyId); | |||
/** | |||
* 根据渠道编号 | |||
*/ | |||
@Transactional | |||
@Modifying | |||
@Query("delete from QtkAgencyModel where agencyId=?1") | |||
public int deleteByAgencyId(String agencyId); | |||
} |
@@ -3,8 +3,11 @@ package cn.com.taiji.core.repo.jpa.basic; | |||
import cn.com.taiji.common.repo.jpa.AbstractJpaRepo; | |||
import cn.com.taiji.core.entity.basic.QtkAgency; | |||
import cn.com.taiji.core.entity.basic.QtkServiceHall; | |||
import org.springframework.data.jpa.repository.Modifying; | |||
import org.springframework.data.jpa.repository.Query; | |||
import org.springframework.transaction.annotation.Transactional; | |||
import java.time.LocalDateTime; | |||
import java.util.List; | |||
public interface QtkAgencyRepo extends AbstractJpaRepo<QtkAgency, String>{ | |||
@@ -14,4 +17,18 @@ public interface QtkAgencyRepo extends AbstractJpaRepo<QtkAgency, String>{ | |||
QtkAgency findByAgencyId(String agencyId); | |||
QtkAgency findByName(String name); | |||
@Query(nativeQuery = true, value = "SELECT AGENCY_ID FROM QTK_AGENCY ") | |||
List<String> findAllAgencyId(); | |||
//更改状态 | |||
@Modifying | |||
@Transactional | |||
@Query("update QtkAgency set status =?1 ,updateTime = ?2 where agencyId = ?3") | |||
int updateState(Integer state, LocalDateTime updateTime, String agencyId); | |||
@Query("from QtkAgency where name like ?1 ") | |||
public List<QtkAgency> listByNameLike(String likeName); | |||
} |
@@ -0,0 +1,32 @@ | |||
package cn.com.taiji.core.repo.request.issue; | |||
import cn.com.taiji.common.pub.dao.HqlBuilder; | |||
import cn.com.taiji.common.repo.request.jpa.JpaDateTimePageableDataRequest; | |||
import cn.com.taiji.core.entity.basic.QtkAgencyMap; | |||
import lombok.Getter; | |||
import lombok.Setter; | |||
@Getter | |||
@Setter | |||
public class QtkAgencyMapPageRequest extends JpaDateTimePageableDataRequest<QtkAgencyMap>{ | |||
public QtkAgencyMapPageRequest() { | |||
this.orderBy="id"; | |||
this.desc=true; | |||
} | |||
@Override | |||
public HqlBuilder toSelectHql(){ | |||
HqlBuilder hql = new HqlBuilder("from QtkAgencyMap where 1=1 "); | |||
return hql; | |||
} | |||
} |
@@ -0,0 +1,105 @@ | |||
package cn.com.taiji.userw.api; | |||
import cn.com.taiji.common.manager.ManagerException; | |||
import cn.com.taiji.common.model.StringKeyValue; | |||
import cn.com.taiji.common.model.dao.Pagination; | |||
import cn.com.taiji.common.web.ApiResponse; | |||
import cn.com.taiji.userw.dto.agency.*; | |||
import cn.com.taiji.userw.manager.agency.AgencyManager; | |||
import cn.com.taiji.userw.model.FormatException; | |||
import cn.hutool.core.util.ObjectUtil; | |||
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; | |||
import java.util.List; | |||
/** | |||
* @Author ChenChao | |||
* @Date 2024/9/29 16:10 | |||
* @Description | |||
*/ | |||
@Api(tags = {"渠道管理"}) | |||
@RestController | |||
@RequestMapping("/agency") | |||
public class AgencyController extends MyValidController { | |||
@Autowired | |||
private AgencyManager agencyManager; | |||
@ApiOperation(value = "渠道信息查询") | |||
@PostMapping(value = "/agencyquery") | |||
public ApiResponse<Pagination> agencyquery(@RequestBody @Valid AgencyPageRequestDTO reqDto) | |||
throws FormatException, ManagerException { | |||
Pagination page = agencyManager.page(reqDto); | |||
return ApiResponse.of(page); | |||
} | |||
// @ApiOperation(value = "渠道信息查询list") | |||
// @PostMapping(value = "/agencyqueryList") | |||
// public ApiResponse<List<AgencyQueryModel> > agencyqueryList() | |||
// throws FormatException, ManagerException { | |||
// logger.info("------- 渠道list查询 START -------"); | |||
// List<AgencyQueryModel> response = agencyManager.list(); | |||
// logger.info("------- 渠道list查询 END -------"); | |||
// return ApiResponse.of(response); | |||
// } | |||
@ApiOperation(value = "获取渠道编号") | |||
@PostMapping(value = "/getAgencyId") | |||
public ApiResponse<String> getAgencyId(@RequestBody @Valid GetAgencyIdRequestDTO req) { | |||
return ApiResponse.of(agencyManager.getAgencyId(req)); | |||
} | |||
@ApiOperation(value = "渠道信息添加") | |||
@PostMapping(value = "/agencyinsert") | |||
public ApiResponse<?> agencyinsert(@RequestBody @Valid AgencyInsertRequestDTO req) throws ManagerException { | |||
agencyManager.insert(req); | |||
return ApiResponse.success().setMessage("添加成功"); | |||
} | |||
@ApiOperation(value = "渠道信息修改") | |||
@PostMapping(value = "/agencyupdate") | |||
public ApiResponse<?> agencyupdate(@RequestBody @Valid AgencyUpdateRequestDTO reqDTO) throws ManagerException { | |||
agencyManager.update(reqDTO); | |||
return ApiResponse.success().setMessage("修改成功"); | |||
} | |||
// @ApiOperation(value = "渠道信息查询所有") | |||
// @PostMapping(value = "/agencyqueryall") | |||
// public ApiResponse<AgencyQueryAllResponse> agencyqueryall(@RequestBody @Valid AgencyQueryAllRequest req) | |||
// throws FormatException, ManagerException { | |||
// AgencyQueryAllResponse response = agencyManager.queryAll(req); | |||
// return ApiResponse.of(response); | |||
// } | |||
@ApiOperation(value = "渠道启用停用") | |||
@PostMapping(value = "/agencyenable") | |||
public ApiResponse<?> agencyenable(@RequestBody @Valid AgencyEnableRequestDTO req) { | |||
agencyManager.enable(req); | |||
return ApiResponse.success().setMessage("状态变更成功"); | |||
} | |||
// @ApiOperation(value = "渠道信息查询列表") | |||
// @PostMapping(value = "/agencyselect") | |||
// public ApiResponse<AgencySelectAllResponse> agencyselect(@RequestBody @Valid AgencySelectAllRequest req) | |||
// throws FormatException, ManagerException { | |||
// AgencySelectAllResponse response = agencyManager.selectAll(); | |||
// return ApiResponse.of(response); | |||
// } | |||
@ApiOperation(value = "按名称模糊查询") | |||
@PostMapping(value = "/listByNameLike") | |||
public ApiResponse<List<StringKeyValue>> listByNameLike( | |||
@RequestBody @Valid AgencyLikeNameReqDTO req) throws ManagerException { | |||
return ApiResponse.of(agencyManager.listByNameLike(req)); | |||
} | |||
} |
@@ -0,0 +1,61 @@ | |||
package cn.com.taiji.userw.api; | |||
import cn.com.taiji.common.model.dao.Pagination; | |||
import cn.com.taiji.common.web.ApiResponse; | |||
import cn.com.taiji.core.entity.basic.QtkAgencyMap; | |||
import cn.com.taiji.userw.dto.centerHallAndAgency.CenterAgencyAddOrUpdateReqDTO; | |||
import cn.com.taiji.userw.dto.centerHallAndAgency.CenterHallOrAgencyDeleteRequestDTO; | |||
import cn.com.taiji.userw.dto.centerHallAndAgency.CenterHallOrAgencyPageRequestDTO; | |||
import cn.com.taiji.userw.manager.centerHallAndAgency.CenterAgencyManager; | |||
import io.swagger.annotations.Api; | |||
import io.swagger.annotations.ApiOperation; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.validation.annotation.Validated; | |||
import org.springframework.web.bind.annotation.*; | |||
import java.util.List; | |||
/** | |||
* @Author:ChenChao | |||
* @Date:2025/5/19 15:20 | |||
* @Filename:CenterServiceHallController | |||
* @description: 中心渠道管理 | |||
*/ | |||
@Api(tags = {"中心渠道管理"}) | |||
@RestController | |||
@RequestMapping("/centerServiceHall") | |||
public class CenterAgencyController extends MyValidController{ | |||
@Autowired | |||
private CenterAgencyManager manager; | |||
@ApiOperation(value = "获取中心渠道编号信息") | |||
@GetMapping(value = "/getCenterAgencyId") | |||
public ApiResponse<List<QtkAgencyMap>> getCenterAgencyId() { | |||
List<QtkAgencyMap> res = manager.getCenterAgencyId(); | |||
return ApiResponse.of(res); | |||
} | |||
@ApiOperation(value = "新增修改") | |||
@GetMapping(value = "/addOrUpDate") | |||
public ApiResponse<?> getCenterServiceHall(@Validated @RequestBody CenterAgencyAddOrUpdateReqDTO reqDto) { | |||
manager.addOrUpdate(reqDto); | |||
return ApiResponse.success().setMessage("新增成功"); | |||
} | |||
@ApiOperation(value = "删除") | |||
@GetMapping(value = "/delete") | |||
public ApiResponse<?> getCenterServiceHall(@Validated @RequestBody CenterHallOrAgencyDeleteRequestDTO reqDto) { | |||
manager.delete(reqDto); | |||
return ApiResponse.success().setMessage("删除成功"); | |||
} | |||
@ApiOperation(value = "分页查询") | |||
@GetMapping(value = "/page") | |||
public ApiResponse<Pagination> getCenterServiceHall(@Validated @RequestBody CenterHallOrAgencyPageRequestDTO reqDto) { | |||
Pagination page = manager.page(reqDto); | |||
return ApiResponse.of(page); | |||
} | |||
} |
@@ -3,10 +3,10 @@ package cn.com.taiji.userw.api; | |||
import cn.com.taiji.common.model.dao.Pagination; | |||
import cn.com.taiji.common.web.ApiResponse; | |||
import cn.com.taiji.core.entity.basic.QtkServicehallMap; | |||
import cn.com.taiji.userw.dto.centerServiceHall.CenterHallDeleteRequestDTO; | |||
import cn.com.taiji.userw.dto.centerServiceHall.CenterHallAddOrUpdateReqDTO; | |||
import cn.com.taiji.userw.dto.centerServiceHall.CenterHallPageRequestDTO; | |||
import cn.com.taiji.userw.manager.serviceHall.CenterServiceHallManager; | |||
import cn.com.taiji.userw.dto.centerHallAndAgency.CenterHallOrAgencyDeleteRequestDTO; | |||
import cn.com.taiji.userw.dto.centerHallAndAgency.CenterHallAddOrUpdateReqDTO; | |||
import cn.com.taiji.userw.dto.centerHallAndAgency.CenterHallOrAgencyPageRequestDTO; | |||
import cn.com.taiji.userw.manager.centerHallAndAgency.CenterServiceHallManager; | |||
import io.swagger.annotations.Api; | |||
import io.swagger.annotations.ApiOperation; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
@@ -24,7 +24,7 @@ import java.util.List; | |||
@Api(tags = {"中心网点管理"}) | |||
@RestController | |||
@RequestMapping("/centerServiceHall") | |||
public class CenterServiceHallController { | |||
public class CenterServiceHallController extends MyValidController{ | |||
@Autowired | |||
private CenterServiceHallManager manager; | |||
@@ -43,14 +43,14 @@ public class CenterServiceHallController { | |||
@ApiOperation(value = "删除") | |||
@GetMapping(value = "/delete") | |||
public ApiResponse<?> getCenterServiceHall(@Validated @RequestBody CenterHallDeleteRequestDTO reqDto) { | |||
public ApiResponse<?> getCenterServiceHall(@Validated @RequestBody CenterHallOrAgencyDeleteRequestDTO reqDto) { | |||
manager.delete(reqDto); | |||
return ApiResponse.success().setMessage("删除成功"); | |||
} | |||
@ApiOperation(value = "分页查询") | |||
@GetMapping(value = "/page") | |||
public ApiResponse<Pagination> getCenterServiceHall(@Validated @RequestBody CenterHallPageRequestDTO reqDto) { | |||
public ApiResponse<Pagination> getCenterServiceHall(@Validated @RequestBody CenterHallOrAgencyPageRequestDTO reqDto) { | |||
Pagination page = manager.page(reqDto); | |||
return ApiResponse.of(page); | |||
} |
@@ -30,7 +30,7 @@ import java.util.List; | |||
@Api(tags = {"网点管理"}) | |||
@RestController | |||
@RequestMapping("/serviceHall") | |||
public class ServiceHallController extends ApiValidController{ | |||
public class ServiceHallController extends MyValidController{ | |||
@Autowired | |||
private ServiceHallManager manager; | |||
@@ -71,11 +71,11 @@ public class ServiceHallController extends ApiValidController{ | |||
return ApiResponse.success().setMessage("修改网点成功"); | |||
} | |||
@ApiOperation(value = "删除网点") | |||
@ApiOperation(value = "更新网点状态") | |||
@PostMapping(value = "/serviceHallDelete") | |||
public ApiResponse serviceHallInsertDelete(@Valid @RequestBody ServiceHallDeleteRequestDTO reqDto) throws ManagerException { | |||
manager.delete(reqDto); | |||
return ApiResponse.success().setMessage("删除网点成功"); | |||
manager.updateState(reqDto); | |||
return ApiResponse.success().setMessage("状态更新成功"); | |||
} | |||
@ApiOperation(value = "查询网点位置列表") |
@@ -43,15 +43,9 @@ public abstract class AbstractBizRequestDTO extends BaseValidDTO { | |||
@Override | |||
protected void validate(ViolationValidator validator) { | |||
// if (getOrderSource() == SourceType.SERVICE_HALL) { | |||
// validator.validFieldNotBlank("staffId", staffId); | |||
// } | |||
} | |||
// @JsonIgnore | |||
// public List<String> getPermittedAgencyIdList() { | |||
// AgencyVerifyManager manager = SpringContextHolder.getBean(AgencyVerifyManager.class); | |||
// return manager.getPermittedAgencyIdListWithCache(openId, getOrderSource().getLoginSourceEnum()); | |||
// } | |||
} |
@@ -0,0 +1,22 @@ | |||
package cn.com.taiji.userw.dto.agency; | |||
import cn.com.taiji.core.model.comm.protocol.constraint.IntegerConstant; | |||
import cn.com.taiji.userw.dto.AbstractBizRequestDTO; | |||
import io.swagger.annotations.ApiModel; | |||
import lombok.Getter; | |||
import lombok.Setter; | |||
import javax.validation.constraints.NotBlank; | |||
import javax.validation.constraints.NotNull; | |||
@ApiModel(description = "渠道启用停用请求参数") | |||
@Getter | |||
@Setter | |||
public class AgencyEnableRequestDTO extends AbstractBizRequestDTO { | |||
@NotBlank(message = "渠道编号不能为空") | |||
private String agencyId; | |||
@NotNull(message = "状态不能为空 1启用,0停用") | |||
@IntegerConstant(values = "0,1", message = "状态错误") | |||
private Integer status; | |||
} |
@@ -0,0 +1,65 @@ | |||
package cn.com.taiji.userw.dto.agency; | |||
import cn.com.taiji.common.valid.ViolationValidator; | |||
import cn.com.taiji.core.model.comm.protocol.constraint.FixedLength; | |||
import cn.com.taiji.userw.dto.AbstractBizRequestDTO; | |||
import cn.com.taiji.userw.model.agency.QtkAgencyBkModel; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Data; | |||
import javax.validation.constraints.NotBlank; | |||
@ApiModel(description = "渠道信息添加请求参数") | |||
@Data | |||
public class AgencyInsertRequestDTO extends AbstractBizRequestDTO { | |||
@ApiModelProperty(value = "发行方编号") | |||
private String issuerId; | |||
@NotBlank | |||
@FixedLength( length = 11) | |||
@ApiModelProperty(value = "机构编号") | |||
private String agencyId; | |||
@NotBlank | |||
@FixedLength( length = 11) | |||
@ApiModelProperty(value = "中心渠道编号") | |||
private String centerAgencyId;//--- | |||
@NotBlank | |||
@ApiModelProperty(value = "合作机构类别") | |||
private String type; | |||
@NotBlank | |||
@ApiModelProperty(value = "机构名称") | |||
private String name; | |||
@ApiModelProperty(value = "联系人姓名") | |||
private String contact; | |||
@ApiModelProperty(value = "联系电话") | |||
private String tel; | |||
@ApiModelProperty(value = "纳税人识别号") | |||
private String taxPayerCode; | |||
@ApiModelProperty(value = "统一社会信用代码/组织机构代码证号") | |||
private String creditCode; | |||
@ApiModelProperty(value = "地址") | |||
private String address; | |||
@ApiModelProperty(value = "备注") | |||
private String info; | |||
@ApiModelProperty(value = "记账渠道号") | |||
private String accountId; | |||
@ApiModelProperty(value = "协议") | |||
private QtkAgencyBkModel[] agencyModels; | |||
@ApiModelProperty(value = "邮箱") | |||
private String email; | |||
@ApiModelProperty(value = "发行组负责人") | |||
private String distributionTeamLeader; | |||
@ApiModelProperty(value = "客服组负责人") | |||
private String customerTeamLeader; | |||
@ApiModelProperty(value = "技术组负责人") | |||
private String technicalTeamLeader; | |||
@ApiModelProperty(value = "结算组负责人") | |||
private String settlementTeamLeader; | |||
@Override | |||
protected void validate(ViolationValidator validator) { | |||
validator.validField("agencyId",!agencyId.matches("\\d+")||!agencyId.substring(0,6).equals("520101"), | |||
"编号需要是520101开头的11位数字"); | |||
} | |||
} |
@@ -0,0 +1,22 @@ | |||
package cn.com.taiji.userw.dto.agency; | |||
import cn.com.taiji.userw.dto.AbstractBizRequestDTO; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Getter; | |||
import lombok.Setter; | |||
/** | |||
* @Author:ChenChao | |||
* @Date:2025/5/20 11:50 | |||
* @Filename:AgencyLikeNameReqDTO | |||
* @description: | |||
*/ | |||
@ApiModel(description = "按名称模糊查询请求参数") | |||
@Getter | |||
@Setter | |||
public class AgencyLikeNameReqDTO extends AbstractBizRequestDTO { | |||
@ApiModelProperty(value = "渠道名称") | |||
private String name; | |||
} |
@@ -0,0 +1,24 @@ | |||
package cn.com.taiji.userw.dto.agency; | |||
import cn.com.taiji.common.model.finals.SysFinals; | |||
import cn.com.taiji.core.model.comm.protocol.constraint.IntegerConstant; | |||
import cn.com.taiji.userw.dto.AbstractBizRequestDTO; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Data; | |||
@Data | |||
@ApiModel(description = "机构分页查询请求参数") | |||
public class AgencyPageRequestDTO extends AbstractBizRequestDTO { | |||
@ApiModelProperty(value = "渠道编号") | |||
private String agencyId; | |||
@ApiModelProperty(value = "渠道名") | |||
private String name; | |||
@ApiModelProperty(value = "状态,1-启用 0-停用") | |||
@IntegerConstant(values = "0,1", message = "状态错误") | |||
private Integer status; | |||
private Integer pageNo = SysFinals.DEFAULT_PAGE_NUM; | |||
private Integer pageSize = SysFinals.DEFAULT_PAGE_SIZE; | |||
} |
@@ -0,0 +1,69 @@ | |||
package cn.com.taiji.userw.dto.agency; | |||
import cn.com.taiji.common.valid.ViolationValidator; | |||
import cn.com.taiji.core.model.comm.protocol.constraint.FixedLength; | |||
import cn.com.taiji.userw.dto.AbstractBizRequestDTO; | |||
import cn.com.taiji.userw.model.agency.QtkAgencyBkModel; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Data; | |||
import javax.validation.constraints.NotBlank; | |||
@ApiModel(description = "渠道信息添加请求参数") | |||
@Data | |||
public class AgencyUpdateRequestDTO extends AbstractBizRequestDTO { | |||
@NotBlank | |||
@ApiModelProperty(value = "渠道表唯一id") | |||
private String id; | |||
// @ApiModelProperty(value = "发行方编号") | |||
// private String issuerId; | |||
// @NotBlank | |||
// @FixedLength( length = 11) | |||
// @ApiModelProperty(value = "机构编号") | |||
// private String agencyId; | |||
@NotBlank | |||
@FixedLength( length = 11) | |||
@ApiModelProperty(value = "中心渠道编号") | |||
private String centerAgencyId;//--- | |||
@NotBlank | |||
@ApiModelProperty(value = "合作机构类别") | |||
private String type; | |||
@NotBlank | |||
@ApiModelProperty(value = "机构名称") | |||
private String name; | |||
@ApiModelProperty(value = "联系人姓名") | |||
private String contact; | |||
@ApiModelProperty(value = "联系电话") | |||
private String tel; | |||
@ApiModelProperty(value = "纳税人识别号") | |||
private String taxPayerCode; | |||
@ApiModelProperty(value = "统一社会信用代码/组织机构代码证号") | |||
private String creditCode; | |||
@ApiModelProperty(value = "地址") | |||
private String address; | |||
@ApiModelProperty(value = "备注") | |||
private String info; | |||
@ApiModelProperty(value = "记账渠道号") | |||
private String accountId; | |||
@ApiModelProperty(value = "协议") | |||
private QtkAgencyBkModel[] agencyModels; | |||
@ApiModelProperty(value = "邮箱") | |||
private String email; | |||
@ApiModelProperty(value = "发行组负责人") | |||
private String distributionTeamLeader; | |||
@ApiModelProperty(value = "客服组负责人") | |||
private String customerTeamLeader; | |||
@ApiModelProperty(value = "技术组负责人") | |||
private String technicalTeamLeader; | |||
@ApiModelProperty(value = "结算组负责人") | |||
private String settlementTeamLeader; | |||
@Override | |||
protected void validate(ViolationValidator validator) { | |||
// validator.validField("agencyId",!agencyId.matches("\\d+")||!agencyId.substring(0,6).equals("520101"), | |||
// "编号需要是520101开头的11位数字"); | |||
} | |||
} |
@@ -0,0 +1,12 @@ | |||
package cn.com.taiji.userw.dto.agency; | |||
import cn.com.taiji.userw.dto.AbstractBizRequestDTO; | |||
/** | |||
* @Author ChenChao | |||
* @Date 2024/11/7 15:21 | |||
* @Description | |||
*/ | |||
public class GetAgencyIdRequestDTO extends AbstractBizRequestDTO { | |||
} |
@@ -0,0 +1,23 @@ | |||
package cn.com.taiji.userw.dto.centerHallAndAgency; | |||
import cn.com.taiji.userw.dto.AbstractBizRequestDTO; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Data; | |||
/** | |||
* @Author:ChenChao | |||
* @Date:2025/5/20 13:11 | |||
* @Filename:CenterAgencyAddOrUpdateReqDTO | |||
* @description: | |||
*/ | |||
@Data | |||
@ApiModel(description = "中心渠道新增修改") | |||
public class CenterAgencyAddOrUpdateReqDTO extends AbstractBizRequestDTO { | |||
@ApiModelProperty(value = "中心渠道编号") | |||
private String centerAgencyId; | |||
@ApiModelProperty(value = "中心渠道名称") | |||
private String centerAgencyName; | |||
} |
@@ -1,4 +1,4 @@ | |||
package cn.com.taiji.userw.dto.centerServiceHall; | |||
package cn.com.taiji.userw.dto.centerHallAndAgency; | |||
import cn.com.taiji.core.model.comm.protocol.constraint.FixedLength; | |||
import cn.com.taiji.userw.dto.AbstractBizRequestDTO; |
@@ -1,4 +1,4 @@ | |||
package cn.com.taiji.userw.dto.centerServiceHall; | |||
package cn.com.taiji.userw.dto.centerHallAndAgency; | |||
import cn.com.taiji.userw.dto.AbstractBizRequestDTO; | |||
import io.swagger.annotations.ApiModel; | |||
@@ -14,12 +14,12 @@ import javax.validation.constraints.NotBlank; | |||
* @Filename:CenterHallDeleteRequestDTO | |||
* @description: | |||
*/ | |||
@ApiModel(description = "删除中心网点信息") | |||
@ApiModel(description = "删除中心网点/渠道信息") | |||
@Getter | |||
@Setter | |||
public class CenterHallDeleteRequestDTO extends AbstractBizRequestDTO { | |||
public class CenterHallOrAgencyDeleteRequestDTO extends AbstractBizRequestDTO { | |||
@ApiModelProperty(value = "中心网点id") | |||
@ApiModelProperty(value = "中心网点id/中心渠道id") | |||
@NotBlank | |||
private String id; | |||
} |
@@ -0,0 +1,19 @@ | |||
package cn.com.taiji.userw.dto.centerHallAndAgency; | |||
import cn.com.taiji.common.model.finals.SysFinals; | |||
import cn.com.taiji.userw.dto.AbstractBizRequestDTO; | |||
import lombok.Data; | |||
/** | |||
* @Author:ChenChao | |||
* @Date:2025/5/19 20:23 | |||
* @Filename:CenterHallRequestDTO | |||
* @description: 中心网点/渠道请求参数 | |||
*/ | |||
@Data | |||
public class CenterHallOrAgencyPageRequestDTO extends AbstractBizRequestDTO { | |||
private Integer pageNo = SysFinals.DEFAULT_PAGE_NUM; | |||
private Integer pageSize = SysFinals.DEFAULT_PAGE_SIZE; | |||
} |
@@ -1,22 +0,0 @@ | |||
package cn.com.taiji.userw.dto.centerServiceHall; | |||
import cn.com.taiji.core.model.comm.protocol.constraint.FixedLength; | |||
import cn.com.taiji.userw.dto.AbstractBizRequestDTO; | |||
import lombok.Data; | |||
import javax.validation.constraints.NotBlank; | |||
import javax.validation.constraints.NotNull; | |||
/** | |||
* @Author:ChenChao | |||
* @Date:2025/5/19 20:23 | |||
* @Filename:CenterHallRequestDTO | |||
* @description: 中心网点新增请求参数 | |||
*/ | |||
@Data | |||
public class CenterHallPageRequestDTO extends AbstractBizRequestDTO { | |||
@NotNull | |||
private Integer pageNo; | |||
@NotNull | |||
private Integer pageSize; | |||
} |
@@ -1,7 +1,7 @@ | |||
package cn.com.taiji.userw.dto.serviceHall; | |||
import cn.com.taiji.common.model.BaseModel; | |||
import cn.com.taiji.userw.dto.AbstractBizRequestDTO; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Data; | |||
import javax.validation.constraints.NotBlank; | |||
@@ -10,7 +10,8 @@ import javax.validation.constraints.NotBlank; | |||
public class ServiceHallDeleteRequestDTO extends AbstractBizRequestDTO { | |||
@NotBlank(message = "网点编号不能为空") | |||
private String serviceHallId;//网点名称 | |||
@ApiModelProperty(value = "网点编号") | |||
private String serviceHallId; | |||
@@ -1,6 +1,7 @@ | |||
package cn.com.taiji.userw.dto.serviceHall; | |||
import cn.com.taiji.common.model.finals.SysFinals; | |||
import cn.com.taiji.userw.dto.AbstractBizRequestDTO; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
@@ -21,9 +22,8 @@ public class ServiceHallPageRequestDTO extends AbstractBizRequestDTO { | |||
@ApiModelProperty(value = "机构") | |||
private String agencyName;//渠道名称 | |||
private String superServiceHallName;//上级网点名称 | |||
@NotNull | |||
private Integer pageNo; | |||
@NotNull | |||
private Integer pageSize; | |||
private Integer pageNo = SysFinals.DEFAULT_PAGE_NUM; | |||
private Integer pageSize = SysFinals.DEFAULT_PAGE_SIZE; | |||
} |
@@ -0,0 +1,28 @@ | |||
package cn.com.taiji.userw.manager.agency; | |||
import cn.com.taiji.common.manager.ManagerException; | |||
import cn.com.taiji.common.model.StringKeyValue; | |||
import cn.com.taiji.common.model.dao.Pagination; | |||
import cn.com.taiji.userw.dto.agency.*; | |||
import java.util.List; | |||
/** | |||
* @Author:ChenChao | |||
* @Date:2025/5/19 21:55 | |||
* @Filename:AgencyManager | |||
* @description:渠道管理 | |||
*/ | |||
public interface AgencyManager { | |||
Pagination page(AgencyPageRequestDTO reqDto); | |||
void enable(AgencyEnableRequestDTO req); | |||
String getAgencyId(GetAgencyIdRequestDTO req); | |||
void insert(AgencyInsertRequestDTO req) throws ManagerException; | |||
void update(AgencyUpdateRequestDTO reqDTO) throws ManagerException; | |||
List<StringKeyValue> listByNameLike(AgencyLikeNameReqDTO req); | |||
} |
@@ -0,0 +1,147 @@ | |||
package cn.com.taiji.userw.manager.agency; | |||
import cn.com.taiji.common.manager.AbstractManager; | |||
import cn.com.taiji.common.manager.ManagerException; | |||
import cn.com.taiji.common.model.StringKeyValue; | |||
import cn.com.taiji.common.model.dao.Pagination; | |||
import cn.com.taiji.core.entity.basic.QtkAgency; | |||
import cn.com.taiji.core.entity.basic.QtkAgencyMap; | |||
import cn.com.taiji.core.entity.basic.QtkAgencyModel; | |||
import cn.com.taiji.core.repo.jpa.basic.QtkAgencyMapRepo; | |||
import cn.com.taiji.core.repo.jpa.basic.QtkAgencyModelRepo; | |||
import cn.com.taiji.core.repo.jpa.basic.QtkAgencyRepo; | |||
import cn.com.taiji.userw.dto.agency.*; | |||
import cn.com.taiji.userw.model.agency.QtkAgencyBkModel; | |||
import cn.com.taiji.userw.repo.jpa.request.AgencyPageRequest; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.stereotype.Service; | |||
import java.time.LocalDateTime; | |||
import java.util.ArrayList; | |||
import java.util.Comparator; | |||
import java.util.List; | |||
import java.util.stream.Collectors; | |||
/** | |||
* @Author:ChenChao | |||
* @Date:2025/5/19 21:55 | |||
* @Filename:AgencyManagerImpl | |||
* @description: | |||
*/ | |||
@Service | |||
public class AgencyManagerImpl extends AbstractManager implements AgencyManager { | |||
@Autowired | |||
private QtkAgencyRepo qtkAgencyRepo; | |||
@Autowired | |||
private QtkAgencyModelRepo qtkAgencyModelRepo; | |||
@Autowired | |||
private QtkAgencyMapRepo qtkAgencyMapRepo; | |||
@Override | |||
public Pagination page(AgencyPageRequestDTO reqDto) { | |||
AgencyPageRequest request = copyProperties(reqDto, new AgencyPageRequest()); | |||
return qtkAgencyRepo.page(request); | |||
} | |||
@Override | |||
public void enable(AgencyEnableRequestDTO req) { | |||
qtkAgencyRepo.updateState(req.getStatus(), LocalDateTime.now(), req.getAgencyId()); | |||
} | |||
@Override | |||
public String getAgencyId(GetAgencyIdRequestDTO req) { | |||
List<String> allAgencyId = qtkAgencyRepo.findAllAgencyId(); | |||
String agencyId = "52010100001"; | |||
Long num = Long.parseLong(agencyId); | |||
for (int i = 1; i <= 50000; i++) { | |||
Long sum = num + i; | |||
agencyId = sum.toString(); | |||
boolean contains = allAgencyId.contains(agencyId); | |||
if (!contains) break; | |||
} | |||
return agencyId; | |||
} | |||
@Override | |||
public void insert(AgencyInsertRequestDTO req) throws ManagerException { | |||
req.validate(); | |||
QtkAgency byAgencyId = qtkAgencyRepo.findByAgencyId(req.getAgencyId()); | |||
if (byAgencyId != null) throw new ManagerException("该机构编号已存在"); | |||
QtkAgency byName = qtkAgencyRepo.findByName(req.getName()); | |||
if (byName != null) throw new ManagerException("该机构名称已存在"); | |||
QtkAgencyMap byCenterAgencyId = qtkAgencyMapRepo.findByCenterAgencyId(req.getCenterAgencyId()); | |||
if (byCenterAgencyId == null) throw new ManagerException("该中心渠道编号不存在"); | |||
QtkAgency qtkAgency = copyProperties(req, new QtkAgency()); | |||
qtkAgency.setMapAgencyId(req.getCenterAgencyId()); | |||
qtkAgencyRepo.persist(qtkAgency); | |||
QtkAgencyBkModel[] agencyModels = req.getAgencyModels(); | |||
ArrayList<QtkAgencyModel> qtkAgencyModels = new ArrayList<>(); | |||
if (agencyModels != null && agencyModels.length > 0) { | |||
for (QtkAgencyBkModel agencyModel : agencyModels) { | |||
QtkAgencyModel model = copyProperties(agencyModel, new QtkAgencyModel()); | |||
model.setAgencyId(req.getAgencyId()); | |||
qtkAgencyModels.add(model); | |||
} | |||
qtkAgencyModelRepo.persistAll(qtkAgencyModels); | |||
} | |||
} | |||
@Override | |||
public void update(AgencyUpdateRequestDTO reqDTO) throws ManagerException { | |||
reqDTO.validate(); | |||
QtkAgency byAgencyId = qtkAgencyRepo.findById(reqDTO.getId()).orElse(null); | |||
if (byAgencyId == null) throw new ManagerException("渠道不存在"); | |||
if (!byAgencyId.getName().equals(reqDTO.getName())) { | |||
//渠道名称被修改,要验证数据库是否已存在此名称 | |||
QtkAgency byName = qtkAgencyRepo.findByName(reqDTO.getName()); | |||
if (byName != null) throw new ManagerException("该机构名称已存在"); | |||
} | |||
if (!byAgencyId.getMapAgencyId().equals(reqDTO.getCenterAgencyId())) { | |||
QtkAgencyMap byCenterAgencyId = qtkAgencyMapRepo.findByCenterAgencyId(reqDTO.getCenterAgencyId()); | |||
if (byCenterAgencyId == null) throw new ManagerException("该中心渠道编号不存在"); | |||
} | |||
byAgencyId.setMapAgencyId(reqDTO.getCenterAgencyId()); | |||
byAgencyId.setType(reqDTO.getType()); | |||
byAgencyId.setName(reqDTO.getName()); | |||
byAgencyId.setContact(reqDTO.getContact()); | |||
byAgencyId.setTel(reqDTO.getTel()); | |||
byAgencyId.setTaxPayercode(reqDTO.getTaxPayerCode()); | |||
byAgencyId.setCreditCode(reqDTO.getCreditCode()); | |||
byAgencyId.setAddress(reqDTO.getAddress()); | |||
byAgencyId.setInfo(reqDTO.getInfo()); | |||
byAgencyId.setAccountId(reqDTO.getAccountId()); | |||
byAgencyId.setEmail(reqDTO.getEmail()); | |||
byAgencyId.setDistributionTeamLeader(reqDTO.getDistributionTeamLeader()); | |||
byAgencyId.setCustomerTeamLeader(reqDTO.getCustomerTeamLeader()); | |||
byAgencyId.setTechnicalTeamLeader(reqDTO.getTechnicalTeamLeader()); | |||
byAgencyId.setSettlementTeamLeader(reqDTO.getSettlementTeamLeader()); | |||
byAgencyId.setUpdateTime(LocalDateTime.now()); | |||
qtkAgencyRepo.merge(byAgencyId); | |||
QtkAgencyBkModel[] agencyModels = reqDTO.getAgencyModels(); | |||
ArrayList<QtkAgencyModel> qtkAgencyModels = new ArrayList<>(); | |||
if (agencyModels != null && agencyModels.length > 0) { | |||
qtkAgencyModelRepo.deleteByAgencyId(byAgencyId.getAgencyId()); | |||
for (QtkAgencyBkModel agencyModel : agencyModels) { | |||
QtkAgencyModel model = copyProperties(agencyModel, new QtkAgencyModel()); | |||
model.setAgencyId(byAgencyId.getAgencyId()); | |||
qtkAgencyModels.add(model); | |||
} | |||
qtkAgencyModelRepo.persistAll(qtkAgencyModels); | |||
} | |||
} | |||
@Override | |||
public List<StringKeyValue> listByNameLike(AgencyLikeNameReqDTO req) { | |||
if (!hasText(req.getName())) { | |||
return sortAndFilter(qtkAgencyRepo.findAll()); | |||
} | |||
return sortAndFilter(qtkAgencyRepo.listByNameLike("%" + req.getName().trim() + "%")); | |||
} | |||
private List<StringKeyValue> sortAndFilter(List<QtkAgency> dbList) { | |||
return dbList.stream().filter(a -> a.getStatus() == 1) | |||
.sorted(Comparator.comparing(QtkAgency::getName).thenComparing(QtkAgency::getAgencyId)).map(a->new StringKeyValue(a.getAgencyId(),a.getName())).collect(Collectors.toList()); | |||
} | |||
} |
@@ -0,0 +1,26 @@ | |||
package cn.com.taiji.userw.manager.centerHallAndAgency; | |||
import cn.com.taiji.common.model.dao.Pagination; | |||
import cn.com.taiji.core.entity.basic.QtkAgencyMap; | |||
import cn.com.taiji.userw.dto.centerHallAndAgency.CenterAgencyAddOrUpdateReqDTO; | |||
import cn.com.taiji.userw.dto.centerHallAndAgency.CenterHallOrAgencyDeleteRequestDTO; | |||
import cn.com.taiji.userw.dto.centerHallAndAgency.CenterHallOrAgencyPageRequestDTO; | |||
import java.util.List; | |||
/** | |||
* @Author:ChenChao | |||
* @Date:2025/5/20 11:58 | |||
* @Filename:CenterAgencyManager | |||
* @description: | |||
*/ | |||
public interface CenterAgencyManager { | |||
List<QtkAgencyMap> getCenterAgencyId(); | |||
void addOrUpdate(CenterAgencyAddOrUpdateReqDTO reqDto); | |||
void delete(CenterHallOrAgencyDeleteRequestDTO reqDto); | |||
Pagination page(CenterHallOrAgencyPageRequestDTO reqDto); | |||
} |
@@ -0,0 +1,53 @@ | |||
package cn.com.taiji.userw.manager.centerHallAndAgency; | |||
import cn.com.taiji.common.manager.AbstractManager; | |||
import cn.com.taiji.common.model.dao.Pagination; | |||
import cn.com.taiji.core.entity.basic.QtkAgencyMap; | |||
import cn.com.taiji.core.repo.jpa.basic.QtkAgencyMapRepo; | |||
import cn.com.taiji.userw.dto.centerHallAndAgency.CenterAgencyAddOrUpdateReqDTO; | |||
import cn.com.taiji.userw.dto.centerHallAndAgency.CenterHallOrAgencyDeleteRequestDTO; | |||
import cn.com.taiji.userw.dto.centerHallAndAgency.CenterHallOrAgencyPageRequestDTO; | |||
import cn.com.taiji.userw.repo.jpa.request.CenterAgencyPageRequest; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.stereotype.Service; | |||
import java.util.List; | |||
/** | |||
* @Author:ChenChao | |||
* @Date:2025/5/20 11:58 | |||
* @Filename:CenterAgencyManagerImpl | |||
* @description: | |||
*/ | |||
@Service | |||
public class CenterAgencyManagerImpl extends AbstractManager implements CenterAgencyManager{ | |||
@Autowired | |||
private QtkAgencyMapRepo qtkAgencyMapRepo; | |||
@Override | |||
public List<QtkAgencyMap> getCenterAgencyId() { | |||
return qtkAgencyMapRepo.findAll(); | |||
} | |||
@Override | |||
public void addOrUpdate(CenterAgencyAddOrUpdateReqDTO reqDto) { | |||
QtkAgencyMap agencyMap = qtkAgencyMapRepo.findByCenterAgencyId(reqDto.getCenterAgencyId()); | |||
if (agencyMap != null) { | |||
agencyMap.setCenterAgencyName(reqDto.getCenterAgencyName()); | |||
qtkAgencyMapRepo.merge(agencyMap); | |||
}else { | |||
QtkAgencyMap qtkAgencyMap = copyProperties(reqDto, new QtkAgencyMap()); | |||
qtkAgencyMapRepo.persist(qtkAgencyMap); | |||
} | |||
} | |||
@Override | |||
public void delete(CenterHallOrAgencyDeleteRequestDTO reqDto) { | |||
qtkAgencyMapRepo.deleteById(reqDto.getId()); | |||
} | |||
@Override | |||
public Pagination page(CenterHallOrAgencyPageRequestDTO reqDto) { | |||
CenterAgencyPageRequest request = copyProperties(reqDto, new CenterAgencyPageRequest()); | |||
return qtkAgencyMapRepo.page(request); | |||
} | |||
} |
@@ -0,0 +1,26 @@ | |||
package cn.com.taiji.userw.manager.centerHallAndAgency; | |||
import cn.com.taiji.common.model.dao.Pagination; | |||
import cn.com.taiji.core.entity.basic.QtkServicehallMap; | |||
import cn.com.taiji.userw.dto.centerHallAndAgency.CenterHallOrAgencyDeleteRequestDTO; | |||
import cn.com.taiji.userw.dto.centerHallAndAgency.CenterHallAddOrUpdateReqDTO; | |||
import cn.com.taiji.userw.dto.centerHallAndAgency.CenterHallOrAgencyPageRequestDTO; | |||
import java.util.List; | |||
/** | |||
* @Author:ChenChao | |||
* @Date:2025/5/19 15:23 | |||
* @Filename:CenterServiceHallManager | |||
* @description: | |||
*/ | |||
public interface CenterServiceHallManager { | |||
List<QtkServicehallMap> getCenterServiceHall(); | |||
void addOrUpdate(CenterHallAddOrUpdateReqDTO reqDto); | |||
void delete(CenterHallOrAgencyDeleteRequestDTO reqDto); | |||
Pagination page(CenterHallOrAgencyPageRequestDTO reqDto); | |||
} |
@@ -1,12 +1,12 @@ | |||
package cn.com.taiji.userw.manager.serviceHall; | |||
package cn.com.taiji.userw.manager.centerHallAndAgency; | |||
import cn.com.taiji.common.manager.AbstractManager; | |||
import cn.com.taiji.common.model.dao.Pagination; | |||
import cn.com.taiji.core.entity.basic.QtkServicehallMap; | |||
import cn.com.taiji.core.repo.jpa.basic.QtkServicehallMapRepo; | |||
import cn.com.taiji.userw.dto.centerServiceHall.CenterHallDeleteRequestDTO; | |||
import cn.com.taiji.userw.dto.centerServiceHall.CenterHallAddOrUpdateReqDTO; | |||
import cn.com.taiji.userw.dto.centerServiceHall.CenterHallPageRequestDTO; | |||
import cn.com.taiji.userw.dto.centerHallAndAgency.CenterHallOrAgencyDeleteRequestDTO; | |||
import cn.com.taiji.userw.dto.centerHallAndAgency.CenterHallAddOrUpdateReqDTO; | |||
import cn.com.taiji.userw.dto.centerHallAndAgency.CenterHallOrAgencyPageRequestDTO; | |||
import cn.com.taiji.userw.repo.jpa.request.CenterServiceHallPageRequest; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.stereotype.Service; | |||
@@ -44,12 +44,12 @@ public class CenterServiceHallManagerImpl extends AbstractManager implements Cen | |||
} | |||
@Override | |||
public void delete(CenterHallDeleteRequestDTO reqDto) { | |||
public void delete(CenterHallOrAgencyDeleteRequestDTO reqDto) { | |||
qtkServicehallMapRepo.deleteById(reqDto.getId()); | |||
} | |||
@Override | |||
public Pagination page(CenterHallPageRequestDTO reqDto) { | |||
public Pagination page(CenterHallOrAgencyPageRequestDTO reqDto) { | |||
CenterServiceHallPageRequest request = copyProperties(reqDto, new CenterServiceHallPageRequest()); | |||
return qtkServicehallMapRepo.page(request); | |||
} |
@@ -1,26 +0,0 @@ | |||
package cn.com.taiji.userw.manager.serviceHall; | |||
import cn.com.taiji.common.model.dao.Pagination; | |||
import cn.com.taiji.core.entity.basic.QtkServicehallMap; | |||
import cn.com.taiji.userw.dto.centerServiceHall.CenterHallDeleteRequestDTO; | |||
import cn.com.taiji.userw.dto.centerServiceHall.CenterHallAddOrUpdateReqDTO; | |||
import cn.com.taiji.userw.dto.centerServiceHall.CenterHallPageRequestDTO; | |||
import java.util.List; | |||
/** | |||
* @Author:ChenChao | |||
* @Date:2025/5/19 15:23 | |||
* @Filename:CenterServiceHallManager | |||
* @description: | |||
*/ | |||
public interface CenterServiceHallManager { | |||
List<QtkServicehallMap> getCenterServiceHall(); | |||
void addOrUpdate(CenterHallAddOrUpdateReqDTO reqDto); | |||
void delete(CenterHallDeleteRequestDTO reqDto); | |||
Pagination page(CenterHallPageRequestDTO reqDto); | |||
} |
@@ -25,7 +25,7 @@ public interface ServiceHallManager { | |||
void update(ServiceHallUpdateRequestDTO reqDto) throws ManagerException; | |||
void delete(ServiceHallDeleteRequestDTO reqDto) throws ManagerException; | |||
void updateState(ServiceHallDeleteRequestDTO reqDto) throws ManagerException; | |||
List<QtkServicehallLocation> queryLocations(ServiceHallDeleteRequestDTO reqDto); | |||
@@ -215,12 +215,9 @@ public class ServiceHallManagerImpl extends AbstractManager implements ServiceHa | |||
} | |||
@Override | |||
public void delete(ServiceHallDeleteRequestDTO reqDto) throws ManagerException { | |||
public void updateState(ServiceHallDeleteRequestDTO reqDto) throws ManagerException { | |||
Staff staff = staffRepo.findByStaffId(reqDto.getStaffId()); | |||
if (staff == null) throw new ManagerException("员工不存在"); | |||
//判断是否有下级网点 | |||
List<QtkServiceHall> serviceHalls = serviceHallRepo.findBySuperServiceHallId(reqDto.getServiceHallId()); | |||
if (CollectionUtil.isEmpty(serviceHalls)) throw new ManagerException("该网点存在下级网点,不允许删除"); | |||
serviceHallRepo.updateState(0, LocalDateTime.now(), reqDto.getServiceHallId()); | |||
} | |||
@@ -0,0 +1,30 @@ | |||
package cn.com.taiji.userw.model.agency; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Getter; | |||
import lombok.Setter; | |||
import java.time.LocalDate; | |||
import java.time.LocalDateTime; | |||
@Getter | |||
@Setter | |||
@ApiModel(description = "渠道协议") | |||
public class QtkAgencyBkModel { | |||
@ApiModelProperty(value = "协议名称") | |||
private String agreementName; | |||
@ApiModelProperty(value = "协议编号") | |||
private String agreementId; | |||
@ApiModelProperty(value = "对公账户") | |||
private String corporateAccount; | |||
@ApiModelProperty(value = "商户号") | |||
private String merchantId; | |||
@ApiModelProperty(value = "开户行") | |||
private String openingBank; | |||
@ApiModelProperty(value = "有效期") | |||
private LocalDate termOfValidity; | |||
@ApiModelProperty(value = "协议附件") | |||
private String agreementAnnex; | |||
} |
@@ -0,0 +1,29 @@ | |||
package cn.com.taiji.userw.repo.jpa.request; | |||
import cn.com.taiji.common.pub.dao.HqlBuilder; | |||
import cn.com.taiji.common.repo.request.jpa.JpaPageableDataRequest; | |||
import cn.com.taiji.core.entity.basic.QtkAgency; | |||
import lombok.Getter; | |||
import lombok.Setter; | |||
@Getter | |||
@Setter | |||
public class AgencyPageRequest extends JpaPageableDataRequest<QtkAgency> { | |||
private String agencyId; | |||
private String name; | |||
private Integer status; | |||
/** | |||
* 动态sql | |||
*/ | |||
@Override | |||
public HqlBuilder toSelectHql() { | |||
HqlBuilder hql = new HqlBuilder(" from " + QtkAgency.class.getName() + " where 1=1"); | |||
hql.append(" and agencyId =:agencyId", agencyId); | |||
hql.append(" and name like:name", like(name)); | |||
hql.append(" and status =:status",status); | |||
return hql; | |||
} | |||
} |
@@ -0,0 +1,17 @@ | |||
package cn.com.taiji.userw.repo.jpa.request; | |||
import cn.com.taiji.common.pub.dao.HqlBuilder; | |||
import cn.com.taiji.common.repo.request.jpa.JpaPageableDataRequest; | |||
import cn.com.taiji.core.entity.basic.QtkAgencyMap; | |||
import cn.com.taiji.core.entity.basic.QtkServicehallMap; | |||
import lombok.Data; | |||
@Data | |||
public class CenterAgencyPageRequest extends JpaPageableDataRequest<QtkAgencyMap> { | |||
@Override | |||
public HqlBuilder toSelectHql() { | |||
HqlBuilder hql = new HqlBuilder("from QtkAgencyMap where 1=1 "); | |||
return hql; | |||
} | |||
} |