报名增加修改报名机构接口

This commit is contained in:
ly19960718 2021-05-15 21:16:01 +08:00
parent acc8efd2ec
commit fd7405fbc2
4 changed files with 57 additions and 3 deletions

View File

@ -40,6 +40,21 @@ public class ApplyController extends DefaultBaseController {
private IApplyService applyService;
@ApiOperation(value = "报名信息报道", notes = "报名信息报道接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "applyId", value = "报名信息ID", paramType = "path"),
})
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@PutMapping("updateInstitutionId/{targetId}")
@CheckRequestBodyAnnotation
public SuccessResult updateInstitutionId(@PathVariable("targetId") String targetId) {
Map<String, Object> params = requestParams();
String sourceIds = params.get("sourceIds").toString();
applyService.updateInstitutionId(targetId,Arrays.asList(sourceIds.split(",")));
return new SuccessResult();
}
@ApiOperation(value = "自定义新增报名信息", notes = "自定义新增报名信息")
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})

View File

@ -22,6 +22,13 @@ import java.util.Map;
**/
public interface IApplyService {
/**
* 修改报名机构
* @param targetId 目标id
* @param sourceIds 源id
*/
void updateInstitutionId(String targetId,List<String> sourceIds);
/**
* 自定义新增报名信息
* @param applyVO

View File

@ -86,12 +86,41 @@ public class ApplyServiceImpl extends DefaultBaseService implements IApplyServic
@Autowired
private ServerProperties serverProperties;
/**
* 修改报名机构
* @param targetId 目标id
* @param sourceIds 源id
*/
public void updateInstitutionId(String targetId,List<String> sourceIds){
InstitutionDTO institutionDTO = iInstitutionService.get(targetId);
if(institutionDTO != null){
throw new SearchException("未查询到目标机构信息");
}
Map<String,Object> params = new HashMap<>();
for (String sourceId : sourceIds) {
params.put("applyInstitutionId",sourceId);
List<ApplyDTO> applyDTOList = this.list(params);//查询源报名的人
for (ApplyDTO applyDTO : applyDTOList) {
Map<String,Object> updateParams = new HashMap<>();
updateParams.put("applyId",applyDTO.getApplyId());
updateParams.put("applyInstitutionId",applyDTO.getApplyInstitutionId());
applyDao.update(params);
//增加操作日志
ApplyAuditLogVO auditLogVO = new ApplyAuditLogVO();
auditLogVO.setApplyId(applyDTO.getApplyId());
auditLogVO.setApplyAuditState(0);
InstitutionDTO sourceInstitutionDTO = iInstitutionService.get(applyDTO.getApplyInstitutionId());
if(sourceInstitutionDTO != null){
throw new SearchException("未查询到源机构信息");
}
auditLogVO.setApplyAuditExplain("【因报名人数不足】 报名培训机构 由原【"+sourceInstitutionDTO.getInstitutionName()+"】培训机构 调整到【"+institutionDTO.getInstitutionName()+"】培训机构");
applyAuditLogService.save(null,auditLogVO);
}
}
}
private ISystemConfigManager systemConfigManager;
public String saveRelationReturnId(ApplyVO applyVO){
String applyId = UUIDUtil.getUUID();

View File

@ -686,4 +686,7 @@
</select>
</mapper>