| | |
| | | this.vzanHttpUtil = vzanHttpUtil; |
| | | } |
| | | |
| | | /** 分页查询省代理。 */ |
| | | public PageResponse<ProvincialAgentListItemVO> page(int page, int pageSize, String regionCode, |
| | | String clinicName, String contactInfo, Integer status) { |
| | | LambdaQueryWrapper<ProvincialAgent> query = new LambdaQueryWrapper<ProvincialAgent>() |
| | |
| | | return PageResponse.of(new ArrayList<ProvincialAgentListItemVO>(), 0, page, pageSize); |
| | | } |
| | | |
| | | /** 查询省代理详情。 */ |
| | | public ProvincialAgentDetailVO detail(Long id) { |
| | | return toDetail(require(id)); |
| | | } |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | /** 创建省代理并同步区域及微赞代理信息。 */ |
| | | public ProvincialAgentDetailVO create(ProvincialAgentSaveRequest request) { |
| | | // STEP 1:保存本地代理与负责区域;STEP 2:同步第三方代理;失败时整体回滚。 |
| | | boolean firstAgent = agentMapper.selectCount(new LambdaQueryWrapper<ProvincialAgent>() |
| | | .eq(ProvincialAgent::getDeleted, 0)) == 0; |
| | | ProvincialAgent agent = new ProvincialAgent(); |
| | |
| | | } |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | /** 更新省代理及其负责区域。 */ |
| | | public ProvincialAgentDetailVO update(Long id, ProvincialAgentSaveRequest request) { |
| | | ProvincialAgent agent = require(id); |
| | | fill(agent, request); |
| | |
| | | } |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | /** 删除省代理。 */ |
| | | public void delete(Long id) { |
| | | require(id); |
| | | agentMapper.deleteById(id); |