package cn.com.taiji.core.manager.tools; | |||||
public class SystemFinals { | |||||
public final static String appId = "52030131";// 系统APPID | |||||
public final static String commonServiceHallId = "5201010600400000000";// 普通用户的专属网点编号 | |||||
public final static String commonStaffId = "003d875dabaa4390b22739f6897cf570";// 普通用户的专属业务人员编号 | |||||
public final static String appBaseRoleId = "d1eb3eebfac846d39aea7d39aea7s365";// APP专用的RoleId | |||||
public final static String miniProgramBaseRoleId = "d1eb3eebfac846d39aea7d39aea7s124";// 微信小程序专用的RoleId | |||||
public final static String zfbMiniProgramBaseRoleId = "7acb029592c84738a8f509af6e179ffc";// 支付宝小程序专用的RoleId | |||||
} |
package cn.com.taiji.userw.api; | package cn.com.taiji.userw.api; | ||||
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.basic.QtkAgencyMap; | import cn.com.taiji.core.entity.basic.QtkAgencyMap; | ||||
private CenterAgencyManager manager; | private CenterAgencyManager manager; | ||||
@ApiOperation(value = "获取中心渠道编号信息") | @ApiOperation(value = "获取中心渠道编号信息") | ||||
@GetMapping(value = "/getCenterAgencyId") | |||||
@PostMapping(value = "/getCenterAgencyId") | |||||
public ApiResponse<List<QtkAgencyMap>> getCenterAgencyId() { | public ApiResponse<List<QtkAgencyMap>> getCenterAgencyId() { | ||||
List<QtkAgencyMap> res = manager.getCenterAgencyId(); | List<QtkAgencyMap> res = manager.getCenterAgencyId(); | ||||
return ApiResponse.of(res); | return ApiResponse.of(res); | ||||
} | } | ||||
@ApiOperation(value = "新增修改") | @ApiOperation(value = "新增修改") | ||||
@GetMapping(value = "/addOrUpDate") | |||||
public ApiResponse<?> getCenterServiceHall(@Validated @RequestBody CenterAgencyAddOrUpdateReqDTO reqDto) { | |||||
@PostMapping(value = "/addOrUpDate") | |||||
public ApiResponse<?> getCenterServiceHall(@Validated @RequestBody CenterAgencyAddOrUpdateReqDTO reqDto) throws ManagerException { | |||||
manager.addOrUpdate(reqDto); | manager.addOrUpdate(reqDto); | ||||
return ApiResponse.success().setMessage("成功"); | return ApiResponse.success().setMessage("成功"); | ||||
} | } | ||||
@ApiOperation(value = "删除") | @ApiOperation(value = "删除") | ||||
@GetMapping(value = "/delete") | |||||
@PostMapping(value = "/delete") | |||||
public ApiResponse<?> getCenterServiceHall(@Validated @RequestBody CenterHallOrAgencyDeleteRequestDTO reqDto) { | public ApiResponse<?> getCenterServiceHall(@Validated @RequestBody CenterHallOrAgencyDeleteRequestDTO reqDto) { | ||||
manager.delete(reqDto); | manager.delete(reqDto); | ||||
return ApiResponse.success().setMessage("删除成功"); | return ApiResponse.success().setMessage("删除成功"); | ||||
} | } | ||||
@ApiOperation(value = "分页查询") | @ApiOperation(value = "分页查询") | ||||
@GetMapping(value = "/page") | |||||
@PostMapping(value = "/page") | |||||
public ApiResponse<Pagination> getCenterServiceHall(@Validated @RequestBody CenterHallOrAgencyPageRequestDTO reqDto) { | public ApiResponse<Pagination> getCenterServiceHall(@Validated @RequestBody CenterHallOrAgencyPageRequestDTO reqDto) { | ||||
Pagination page = manager.page(reqDto); | Pagination page = manager.page(reqDto); | ||||
return ApiResponse.of(page); | return ApiResponse.of(page); |
package cn.com.taiji.userw.api; | package cn.com.taiji.userw.api; | ||||
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.basic.QtkServicehallMap; | import cn.com.taiji.core.entity.basic.QtkServicehallMap; | ||||
@Autowired | @Autowired | ||||
private CenterServiceHallManager manager; | private CenterServiceHallManager manager; | ||||
@ApiOperation(value = "获取中心网点编号信息") | @ApiOperation(value = "获取中心网点编号信息") | ||||
@GetMapping(value = "/getCenterServiceHall") | |||||
@PostMapping(value = "/getCenterServiceHall") | |||||
public ApiResponse<List<QtkServicehallMap>> getCenterServiceHall() { | public ApiResponse<List<QtkServicehallMap>> getCenterServiceHall() { | ||||
return ApiResponse.of(manager.getCenterServiceHall()); | return ApiResponse.of(manager.getCenterServiceHall()); | ||||
} | } | ||||
@ApiOperation(value = "新增修改") | @ApiOperation(value = "新增修改") | ||||
@GetMapping(value = "/addOrUpDate") | |||||
public ApiResponse<?> getCenterServiceHall(@Validated @RequestBody CenterHallAddOrUpdateReqDTO reqDto) { | |||||
@PostMapping(value = "/addOrUpDate") | |||||
public ApiResponse<?> getCenterServiceHall(@Validated @RequestBody CenterHallAddOrUpdateReqDTO reqDto) throws ManagerException { | |||||
manager.addOrUpdate(reqDto); | manager.addOrUpdate(reqDto); | ||||
return ApiResponse.success().setMessage("成功"); | return ApiResponse.success().setMessage("成功"); | ||||
} | } | ||||
@ApiOperation(value = "删除") | @ApiOperation(value = "删除") | ||||
@GetMapping(value = "/delete") | |||||
@PostMapping(value = "/delete") | |||||
public ApiResponse<?> getCenterServiceHall(@Validated @RequestBody CenterHallOrAgencyDeleteRequestDTO reqDto) { | public ApiResponse<?> getCenterServiceHall(@Validated @RequestBody CenterHallOrAgencyDeleteRequestDTO reqDto) { | ||||
manager.delete(reqDto); | manager.delete(reqDto); | ||||
return ApiResponse.success().setMessage("删除成功"); | return ApiResponse.success().setMessage("删除成功"); | ||||
} | } | ||||
@ApiOperation(value = "分页查询") | @ApiOperation(value = "分页查询") | ||||
@GetMapping(value = "/page") | |||||
@PostMapping(value = "/page") | |||||
public ApiResponse<Pagination> getCenterServiceHall(@Validated @RequestBody CenterHallOrAgencyPageRequestDTO reqDto) { | public ApiResponse<Pagination> getCenterServiceHall(@Validated @RequestBody CenterHallOrAgencyPageRequestDTO reqDto) { | ||||
Pagination page = manager.page(reqDto); | Pagination page = manager.page(reqDto); | ||||
return ApiResponse.of(page); | return ApiResponse.of(page); |
import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
import org.springframework.validation.annotation.Validated; | import org.springframework.validation.annotation.Validated; | ||||
import org.springframework.web.bind.annotation.GetMapping; | |||||
import org.springframework.web.bind.annotation.RequestBody; | |||||
import org.springframework.web.bind.annotation.RequestMapping; | |||||
import org.springframework.web.bind.annotation.RestController; | |||||
import org.springframework.web.bind.annotation.*; | |||||
/** | /** | ||||
* @Author:ChenChao | * @Author:ChenChao | ||||
@Autowired | @Autowired | ||||
private WxPayConfigManager manager; | private WxPayConfigManager manager; | ||||
@ApiOperation(value = "分页查询") | @ApiOperation(value = "分页查询") | ||||
@GetMapping(value = "/page") | |||||
@PostMapping(value = "/page") | |||||
public ApiResponse<Pagination> page(@Validated @RequestBody WxPayPageRequestDTO reqDto) { | public ApiResponse<Pagination> page(@Validated @RequestBody WxPayPageRequestDTO reqDto) { | ||||
Pagination page = manager.page(reqDto); | Pagination page = manager.page(reqDto); | ||||
return ApiResponse.of(page); | return ApiResponse.of(page); | ||||
} | } | ||||
@ApiOperation(value = "新增") | @ApiOperation(value = "新增") | ||||
@GetMapping(value = "/add") | |||||
@PostMapping(value = "/add") | |||||
public ApiResponse<?> add(@Validated @RequestBody WxPayAddReqDTO reqDto) throws ManagerException { | public ApiResponse<?> add(@Validated @RequestBody WxPayAddReqDTO reqDto) throws ManagerException { | ||||
manager.add(reqDto); | manager.add(reqDto); | ||||
return ApiResponse.success().setMessage("新增成功"); | return ApiResponse.success().setMessage("新增成功"); | ||||
} | } | ||||
@ApiOperation(value = "修改") | @ApiOperation(value = "修改") | ||||
@GetMapping(value = "/update") | |||||
@PostMapping(value = "/update") | |||||
public ApiResponse<?> update(@Validated @RequestBody WxPayUpdateReqDTO reqDto) throws ManagerException { | public ApiResponse<?> update(@Validated @RequestBody WxPayUpdateReqDTO reqDto) throws ManagerException { | ||||
manager.update(reqDto); | manager.update(reqDto); | ||||
return ApiResponse.success().setMessage("修改成功"); | return ApiResponse.success().setMessage("修改成功"); |
import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
import org.springframework.validation.annotation.Validated; | import org.springframework.validation.annotation.Validated; | ||||
import org.springframework.web.bind.annotation.GetMapping; | |||||
import org.springframework.web.bind.annotation.RequestBody; | |||||
import org.springframework.web.bind.annotation.RequestMapping; | |||||
import org.springframework.web.bind.annotation.RestController; | |||||
import org.springframework.web.bind.annotation.*; | |||||
/** | /** | ||||
* @Author:ChenChao | * @Author:ChenChao | ||||
@Autowired | @Autowired | ||||
private WxSignChannelConfigManager manager; | private WxSignChannelConfigManager manager; | ||||
@ApiOperation(value = "分页查询") | @ApiOperation(value = "分页查询") | ||||
@GetMapping(value = "/page") | |||||
@PostMapping(value = "/page") | |||||
public ApiResponse<Pagination> page(@Validated @RequestBody WxCarPageRequestDTO reqDto) { | public ApiResponse<Pagination> page(@Validated @RequestBody WxCarPageRequestDTO reqDto) { | ||||
Pagination page = manager.page(reqDto); | Pagination page = manager.page(reqDto); | ||||
return ApiResponse.of(page); | return ApiResponse.of(page); | ||||
} | } | ||||
@ApiOperation(value = "新增") | @ApiOperation(value = "新增") | ||||
@GetMapping(value = "/add") | |||||
@PostMapping(value = "/add") | |||||
public ApiResponse<?> add(@Validated @RequestBody WxCarAddReqDTO reqDto) throws ManagerException { | public ApiResponse<?> add(@Validated @RequestBody WxCarAddReqDTO reqDto) throws ManagerException { | ||||
manager.add(reqDto); | manager.add(reqDto); | ||||
return ApiResponse.success().setMessage("新增成功"); | return ApiResponse.success().setMessage("新增成功"); | ||||
} | } | ||||
@ApiOperation(value = "修改") | @ApiOperation(value = "修改") | ||||
@GetMapping(value = "/update") | |||||
@PostMapping(value = "/update") | |||||
public ApiResponse<?> update(@Validated @RequestBody WxCarUpdateReqDTO reqDto) throws ManagerException { | public ApiResponse<?> update(@Validated @RequestBody WxCarUpdateReqDTO reqDto) throws ManagerException { | ||||
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.common.valid.ViolationValidator; | |||||
import cn.com.taiji.core.dto.AbstractStaffBizRequestDTO; | import cn.com.taiji.core.dto.AbstractStaffBizRequestDTO; | ||||
import cn.com.taiji.core.model.comm.protocol.constraint.IntegerConstant; | |||||
import io.swagger.annotations.ApiModel; | import io.swagger.annotations.ApiModel; | ||||
import io.swagger.annotations.ApiModelProperty; | import io.swagger.annotations.ApiModelProperty; | ||||
import lombok.Data; | import lombok.Data; | ||||
import javax.validation.constraints.NotNull; | |||||
/** | /** | ||||
* @Author:ChenChao | * @Author:ChenChao | ||||
* @Date:2025/5/20 13:11 | * @Date:2025/5/20 13:11 | ||||
@ApiModelProperty(value = "中心渠道名称") | @ApiModelProperty(value = "中心渠道名称") | ||||
private String centerAgencyName; | private String centerAgencyName; | ||||
@ApiModelProperty(value = "ID") | |||||
private String id; | |||||
@ApiModelProperty(value = "操作类型 1新增 2修改") | |||||
@IntegerConstant(values = "1,2", message = "操作类型错误") | |||||
@NotNull | |||||
private Integer optType; | |||||
@Override | |||||
protected void validate(ViolationValidator validator) { | |||||
if (optType == 1){ | |||||
validator.validFieldNotBlank("centerAgencyName",centerAgencyName); | |||||
validator.validFieldNotBlank("centerAgencyId",centerAgencyId); | |||||
}else { | |||||
validator.validFieldNotBlank("id",id); | |||||
validator.validFieldNotBlank("centerAgencyName",centerAgencyName); | |||||
} | |||||
} | |||||
} | } |
package cn.com.taiji.userw.dto.centerHallAndAgency; | package cn.com.taiji.userw.dto.centerHallAndAgency; | ||||
import cn.com.taiji.common.valid.ViolationValidator; | |||||
import cn.com.taiji.core.dto.AbstractStaffBizRequestDTO; | import cn.com.taiji.core.dto.AbstractStaffBizRequestDTO; | ||||
import cn.com.taiji.core.model.comm.protocol.constraint.FixedLength; | import cn.com.taiji.core.model.comm.protocol.constraint.FixedLength; | ||||
import cn.com.taiji.core.model.comm.protocol.constraint.IntegerConstant; | |||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.Data; | import lombok.Data; | ||||
import javax.validation.constraints.NotBlank; | import javax.validation.constraints.NotBlank; | ||||
import javax.validation.constraints.NotNull; | |||||
/** | /** | ||||
* @Author:ChenChao | * @Author:ChenChao | ||||
*/ | */ | ||||
@Data | @Data | ||||
public class CenterHallAddOrUpdateReqDTO extends AbstractStaffBizRequestDTO { | public class CenterHallAddOrUpdateReqDTO extends AbstractStaffBizRequestDTO { | ||||
@NotBlank(message = "中心网点编号不能为空") | |||||
@FixedLength(length = 19, message = "中心网点编号必须是19位") | @FixedLength(length = 19, message = "中心网点编号必须是19位") | ||||
private String centerServiceHallId; | private String centerServiceHallId; | ||||
@NotBlank(message = "网点名称不能为空") | @NotBlank(message = "网点名称不能为空") | ||||
private String centerServicehallName; | private String centerServicehallName; | ||||
@ApiModelProperty(value = "ID") | |||||
private String id; | |||||
@ApiModelProperty(value = "操作类型 1新增 2修改") | |||||
@IntegerConstant(values = "1,2", message = "操作类型错误") | |||||
@NotNull | |||||
private Integer optType; | |||||
@Override | |||||
protected void validate(ViolationValidator validator) { | |||||
if (optType == 1){ | |||||
validator.validFieldNotBlank("centerServiceHallId",centerServiceHallId); | |||||
validator.validFieldNotBlank("centerServicehallName",centerServicehallName); | |||||
}else { | |||||
validator.validFieldNotBlank("id",id); | |||||
validator.validFieldNotBlank("centerServicehallName",centerServicehallName); | |||||
} | |||||
} | |||||
} | } |
package cn.com.taiji.userw.dto.centerHallAndAgency; | package cn.com.taiji.userw.dto.centerHallAndAgency; | ||||
import cn.com.taiji.core.dto.AbstractStaffBizRequestDTO; | |||||
import cn.com.taiji.core.dto.AbstractStaffBizPageRequestDTO; | |||||
import lombok.Data; | import lombok.Data; | ||||
/** | /** | ||||
* @description: 中心网点/渠道请求参数 | * @description: 中心网点/渠道请求参数 | ||||
*/ | */ | ||||
@Data | @Data | ||||
public class CenterHallOrAgencyPageRequestDTO extends AbstractStaffBizRequestDTO { | |||||
public class CenterHallOrAgencyPageRequestDTO extends AbstractStaffBizPageRequestDTO { | |||||
} | } |
package cn.com.taiji.userw.manager.centerHallAndAgency; | package cn.com.taiji.userw.manager.centerHallAndAgency; | ||||
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.basic.QtkAgencyMap; | import cn.com.taiji.core.entity.basic.QtkAgencyMap; | ||||
import cn.com.taiji.userw.dto.centerHallAndAgency.CenterAgencyAddOrUpdateReqDTO; | import cn.com.taiji.userw.dto.centerHallAndAgency.CenterAgencyAddOrUpdateReqDTO; | ||||
List<QtkAgencyMap> getCenterAgencyId(); | List<QtkAgencyMap> getCenterAgencyId(); | ||||
void addOrUpdate(CenterAgencyAddOrUpdateReqDTO reqDto); | |||||
void addOrUpdate(CenterAgencyAddOrUpdateReqDTO reqDto) throws ManagerException; | |||||
void delete(CenterHallOrAgencyDeleteRequestDTO reqDto); | void delete(CenterHallOrAgencyDeleteRequestDTO reqDto); | ||||
package cn.com.taiji.userw.manager.centerHallAndAgency; | package cn.com.taiji.userw.manager.centerHallAndAgency; | ||||
import cn.com.taiji.common.manager.AbstractManager; | import cn.com.taiji.common.manager.AbstractManager; | ||||
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.basic.QtkAgencyMap; | import cn.com.taiji.core.entity.basic.QtkAgencyMap; | ||||
import cn.com.taiji.core.repo.jpa.basic.QtkAgencyMapRepo; | import cn.com.taiji.core.repo.jpa.basic.QtkAgencyMapRepo; | ||||
} | } | ||||
@Override | @Override | ||||
public void addOrUpdate(CenterAgencyAddOrUpdateReqDTO reqDto) { | |||||
QtkAgencyMap agencyMap = qtkAgencyMapRepo.findByCenterAgencyId(reqDto.getCenterAgencyId()); | |||||
if (agencyMap != null) { | |||||
agencyMap.setCenterAgencyName(reqDto.getCenterAgencyName()); | |||||
qtkAgencyMapRepo.merge(agencyMap); | |||||
public void addOrUpdate(CenterAgencyAddOrUpdateReqDTO reqDto) throws ManagerException { | |||||
reqDto.validate(); | |||||
if (reqDto.getOptType() == 1){ | |||||
QtkAgencyMap agencyMap = qtkAgencyMapRepo.findByCenterAgencyId(reqDto.getCenterAgencyId()); | |||||
if (agencyMap != null) throw new ManagerException("此中心渠道编号也存在"); | |||||
agencyMap = copyProperties(reqDto, new QtkAgencyMap()); | |||||
qtkAgencyMapRepo.persist(agencyMap); | |||||
}else { | }else { | ||||
QtkAgencyMap qtkAgencyMap = copyProperties(reqDto, new QtkAgencyMap()); | |||||
qtkAgencyMapRepo.persist(qtkAgencyMap); | |||||
QtkAgencyMap qtkAgencyMap = qtkAgencyMapRepo.findById(reqDto.getId()).orElse(null); | |||||
if (qtkAgencyMap == null) throw new ManagerException("此中心渠道不存在"); | |||||
copyProperties(reqDto,qtkAgencyMap,"id","centerAgencyName"); | |||||
qtkAgencyMapRepo.merge(qtkAgencyMap); | |||||
} | } | ||||
} | } | ||||
package cn.com.taiji.userw.manager.centerHallAndAgency; | package cn.com.taiji.userw.manager.centerHallAndAgency; | ||||
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.basic.QtkServicehallMap; | import cn.com.taiji.core.entity.basic.QtkServicehallMap; | ||||
import cn.com.taiji.userw.dto.centerHallAndAgency.CenterHallOrAgencyDeleteRequestDTO; | import cn.com.taiji.userw.dto.centerHallAndAgency.CenterHallOrAgencyDeleteRequestDTO; | ||||
List<QtkServicehallMap> getCenterServiceHall(); | List<QtkServicehallMap> getCenterServiceHall(); | ||||
void addOrUpdate(CenterHallAddOrUpdateReqDTO reqDto); | |||||
void addOrUpdate(CenterHallAddOrUpdateReqDTO reqDto) throws ManagerException; | |||||
void delete(CenterHallOrAgencyDeleteRequestDTO reqDto); | void delete(CenterHallOrAgencyDeleteRequestDTO reqDto); | ||||
package cn.com.taiji.userw.manager.centerHallAndAgency; | package cn.com.taiji.userw.manager.centerHallAndAgency; | ||||
import cn.com.taiji.common.manager.AbstractManager; | import cn.com.taiji.common.manager.AbstractManager; | ||||
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.basic.QtkServicehallMap; | import cn.com.taiji.core.entity.basic.QtkServicehallMap; | ||||
import cn.com.taiji.core.repo.jpa.basic.QtkServicehallMapRepo; | import cn.com.taiji.core.repo.jpa.basic.QtkServicehallMapRepo; | ||||
} | } | ||||
@Override | @Override | ||||
public void addOrUpdate(CenterHallAddOrUpdateReqDTO reqDto){ | |||||
QtkServicehallMap serviceHallId = qtkServicehallMapRepo.findByCenterServiceHallId(reqDto.getCenterServiceHallId()); | |||||
if (serviceHallId != null) { | |||||
serviceHallId.setCenterServicehallName(reqDto.getCenterServicehallName()); | |||||
qtkServicehallMapRepo.merge(serviceHallId); | |||||
}else { | |||||
public void addOrUpdate(CenterHallAddOrUpdateReqDTO reqDto) throws ManagerException { | |||||
reqDto.validate(); | |||||
if (reqDto.getOptType() == 1){ | |||||
QtkServicehallMap serviceHallId = qtkServicehallMapRepo.findByCenterServiceHallId(reqDto.getCenterServiceHallId()); | |||||
if (serviceHallId != null) throw new ManagerException("此中心网点已存在"); | |||||
QtkServicehallMap servicehallMap = copyProperties(reqDto, new QtkServicehallMap()); | QtkServicehallMap servicehallMap = copyProperties(reqDto, new QtkServicehallMap()); | ||||
qtkServicehallMapRepo.persist(servicehallMap); | qtkServicehallMapRepo.persist(servicehallMap); | ||||
}else { | |||||
QtkServicehallMap servicehallMap = qtkServicehallMapRepo.findById(reqDto.getId()).orElse(null); | |||||
if (servicehallMap == null) throw new ManagerException("此中心网点不存在"); | |||||
copyProperties(reqDto, servicehallMap,"id","centerServiceHallId"); | |||||
qtkServicehallMapRepo.merge(servicehallMap); | |||||
} | } | ||||
} | } | ||||
import org.springframework.stereotype.Component; | import org.springframework.stereotype.Component; | ||||
@Data | @Data | ||||
@ConfigurationProperties("vfj") | |||||
@ConfigurationProperties(prefix = "vfj") | |||||
@Component | @Component | ||||
public class VfjConfigProperties { | public class VfjConfigProperties { | ||||
import cn.com.taiji.inss.manager.cache.RedisWrapManager; | import cn.com.taiji.inss.manager.cache.RedisWrapManager; | ||||
import cn.com.taiji.inss.manager.model.VfjCommonRequest; | import cn.com.taiji.inss.manager.model.VfjCommonRequest; | ||||
import cn.com.taiji.inss.manager.model.VfjCommonResponse; | import cn.com.taiji.inss.manager.model.VfjCommonResponse; | ||||
import cn.hutool.crypto.asymmetric.KeyType; | import cn.hutool.crypto.asymmetric.KeyType; | ||||
import cn.hutool.crypto.asymmetric.SM2; | import cn.hutool.crypto.asymmetric.SM2; | ||||
import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
sessionId = new String(sessionIdBytes); | sessionId = new String(sessionIdBytes); | ||||
redisWrapManager.set(VFJ_SESSION_ID_KEY, sessionId, 86400, TimeUnit.SECONDS); | redisWrapManager.set(VFJ_SESSION_ID_KEY, sessionId, 86400, TimeUnit.SECONDS); | ||||
} | } | ||||
logger.info("VFJ sessionId :{}", sessionId); | |||||
return sessionId; | return sessionId; | ||||
} | } | ||||
protected final String excute(InssServiceCmd cmd, BaseModel req) throws ServiceHandleException { | protected final String excute(InssServiceCmd cmd, BaseModel req) throws ServiceHandleException { | ||||
try { | try { | ||||
VfjCommonRequest vfjRequest = new VfjCommonRequest(vfjConfig, cmd, this.getSessionId(cmd), req.toJson(), this.getTermTrace()); | VfjCommonRequest vfjRequest = new VfjCommonRequest(vfjConfig, cmd, this.getSessionId(cmd), req.toJson(), this.getTermTrace()); | ||||
logger.info("vfj request:{}", vfjRequest.toJson()); | |||||
VfjCommonResponse vfjResponse = HttpClientHelper.jsonPost(VfjCommonResponse.class, vfjConfig.getUrl(), vfjRequest.toJson()); | VfjCommonResponse vfjResponse = HttpClientHelper.jsonPost(VfjCommonResponse.class, vfjConfig.getUrl(), vfjRequest.toJson()); | ||||
logger.info("vfj response:{}", vfjResponse.toJson()); | |||||
if (vfjResponse.getCode().equals("E9997")) { | if (vfjResponse.getCode().equals("E9997")) { | ||||
redisWrapManager.delete(VFJ_SESSION_ID_KEY); | |||||
return this.excute(cmd, req); | return this.excute(cmd, req); | ||||
} else if (vfjResponse.getCode().equals("0000")) { | } else if (vfjResponse.getCode().equals("0000")) { | ||||
if (!hasText(vfjResponse.getBuzzData())) | if (!hasText(vfjResponse.getBuzzData())) | ||||
private String getTermTrace() { | private String getTermTrace() { | ||||
long termTrace = redisWrapManager.increment(VFJ_TERM_TRACE, 1); | long termTrace = redisWrapManager.increment(VFJ_TERM_TRACE, 1); | ||||
if (termTrace > 99999999) redisWrapManager.set(VFJ_TERM_TRACE, "1", 1, TimeUnit.DAYS); | if (termTrace > 99999999) redisWrapManager.set(VFJ_TERM_TRACE, "1", 1, TimeUnit.DAYS); | ||||
return ("00000000" + termTrace).substring(0, 8); | |||||
String termTraceStr = "00000000" + termTrace; | |||||
return termTraceStr.substring(termTraceStr.length() - 8); | |||||
} | } | ||||
} | } |