修改代码;

This commit is contained in:
mengkuiliang 2023-10-11 16:08:54 +08:00
parent 31f7740e7c
commit c21c7373b5
5 changed files with 28 additions and 33 deletions

View File

@ -32,10 +32,10 @@ public class ResidentServiceApplyController extends BaseController {
@Resource @Resource
private IResidentServiceAppletService residentServiceAppletService; private IResidentServiceAppletService residentServiceAppletService;
@ApiOperation("提交服务申请(批量)") @ApiOperation("提交服务申请")
@PostMapping("/save") @PostMapping("/save")
public R<?> save(@RequestBody ResidentServiceApplyBody body) { public R<?> save(@RequestBody ResidentServiceApplyBody body) {
if (body == null || body.getFormList() == null || body.getFormList().size() == 0) { if (body == null || StringUtils.isBlank(body.getPackageNo()) || StringUtils.isBlank(body.getFormNo())) {
return R.fail("请求参数不能为空"); return R.fail("请求参数不能为空");
} }
residentServiceAppletService.insert(body); residentServiceAppletService.insert(body);

View File

@ -17,7 +17,7 @@ import java.util.List;
**/ **/
@Data @Data
@ApiModel("居民服务申请请求对象") @ApiModel("居民服务申请请求对象")
public class ResidentServiceApplyBody { public class ResidentServiceApplyBody extends ResidentServiceFormApplyDto{
/** /**
* 居民编号 * 居民编号
@ -94,6 +94,7 @@ public class ResidentServiceApplyBody {
/** /**
* 服务项集合 * 服务项集合
*/ */
@ApiModelProperty(value = "服务项集合", hidden = true)
List<ResidentServiceFormApplyDto> formList; List<ResidentServiceFormApplyDto> formList;
} }

View File

@ -77,31 +77,18 @@ public class ResidentServiceApplyServiceImpl implements IResidentServiceAppletSe
} }
} }
List<ResidentServiceApplyEntity> serviceApplyList = new ArrayList<>(); entity = new ResidentServiceApplyEntity();
for (ResidentServiceFormApplyDto form : body.getFormList()) { BeanUtils.copyProperties(body, entity);
if (!StringUtils.isBlank(form.getFormNo())) { if (patientInfo != null) {
entity = new ResidentServiceApplyEntity(); entity.setPatientId(patientInfo.getPatientCode());
BeanUtils.copyProperties(body, entity);
if (patientInfo != null) {
entity.setPatientId(patientInfo.getPatientCode());
}
entity.setApplyTime(new Date());
// 预约状态0已申请1已完成2已取消
entity.setBookingStatus("0");
// 审批状态0:待批准 1:已同意 2:已拒绝
entity.setApprovalStatus("0");
entity.setBookingNo(IdUtils.simpleUUID());
entity.setPackageNo(form.getPackageNo());
entity.setPackageName(form.getPackageName());
entity.setFormNo(form.getFormNo());
entity.setFormName(form.getFormName());
serviceApplyList.add(entity);
}
} }
if (serviceApplyList.size() == 0) { entity.setApplyTime(new Date());
throw new ServiceException("服务项目不能为空"); // 预约状态0已申请1已完成2已取消
} entity.setBookingStatus("0");
residentServiceApplyMapper.batchInsert(serviceApplyList); // 审批状态0:待批准 1:已同意 2:已拒绝
entity.setApprovalStatus("0");
entity.setBookingNo(IdUtils.simpleUUID());
residentServiceApplyMapper.insert(entity);
} }
/** /**
@ -274,7 +261,7 @@ public class ResidentServiceApplyServiceImpl implements IResidentServiceAppletSe
throw new ServiceException("未查询到签约信息!"); throw new ServiceException("未查询到签约信息!");
} }
// 获取家医个性服务包 // 获取家医个性服务包
result = (String) httpService.get(SpringUtils.getFdUrl(region) + "/package/getPackageOfGX/" + identity + (!StringUtils.isBlank(projectName)? ("?formName=" + projectName): "?formName=null"), null, String.class); result = (String) httpService.get(SpringUtils.getFdUrl(region) + "/package/getPackageOfGX/" + identity + (!StringUtils.isBlank(projectName) ? ("?formName=" + projectName) : "?formName=null"), null, String.class);
jsonObject = JSONObject.parseObject(result); jsonObject = JSONObject.parseObject(result);
if (!"1".equals(jsonObject.get("code"))) { if (!"1".equals(jsonObject.get("code"))) {
throw new ServiceException(jsonObject.get("msg").toString()); throw new ServiceException(jsonObject.get("msg").toString());
@ -311,15 +298,15 @@ public class ResidentServiceApplyServiceImpl implements IResidentServiceAppletSe
if (org != null && !StringUtils.isBlank(org.getPhOrgId())) { if (org != null && !StringUtils.isBlank(org.getPhOrgId())) {
// 根据机构编码获取筛查机构 // 根据机构编码获取筛查机构
HospitalInfo Hospital = hospitalInfoService.getHosptalByOrgCode(org.getPhOrgId()); HospitalInfo Hospital = hospitalInfoService.getHosptalByOrgCode(org.getPhOrgId());
if(Hospital != null) { if (Hospital != null) {
// 获取筛查项目 // 获取筛查项目
ScreeningProject query = new ScreeningProject(); ScreeningProject query = new ScreeningProject();
query.setHospitalId(Hospital.getId()); query.setHospitalId(Hospital.getId());
query.setProjectName(projectName); query.setProjectName(projectName);
List<ScreeningProject> screeningProjectList = screeningProjectService.findList(query); List<ScreeningProject> screeningProjectList = screeningProjectService.findList(query);
if(screeningProjectList != null && screeningProjectList.size() > 0) { if (screeningProjectList != null && screeningProjectList.size() > 0) {
ScreeningProjectVo sp; ScreeningProjectVo sp;
for(ScreeningProject project: screeningProjectList) { for (ScreeningProject project : screeningProjectList) {
sp = new ScreeningProjectVo(); sp = new ScreeningProjectVo();
sp.setSourceType("2"); sp.setSourceType("2");
sp.setHospitalId(String.valueOf(project.getHospitalId())); sp.setHospitalId(String.valueOf(project.getHospitalId()));

View File

@ -78,6 +78,9 @@ public class ResidentSignApplyServiceImpl implements IResidentSignAppletService
// 审批状态0:待批准 1:已同意 2:已拒绝 // 审批状态0:待批准 1:已同意 2:已拒绝
entity.setApprovalStatus("0"); entity.setApprovalStatus("0");
entity.setBookingNo(IdUtils.simpleUUID()); entity.setBookingNo(IdUtils.simpleUUID());
if(StringUtils.isBlank(entity.getNation())) {
entity.setNation("1");
}
residentSignApplyMapper.insert(entity); residentSignApplyMapper.insert(entity);
} }

View File

@ -127,8 +127,12 @@ public class ScreeningRecordServiceImpl implements IScreeningRecordService {
recordBody.setScreeningStatus("1"); recordBody.setScreeningStatus("1");
recordBody.setApplyCode(generateCode()); recordBody.setApplyCode(generateCode());
recordBody.setScreeningType("1"); recordBody.setScreeningType("1");
// 预约条码 try {
recordBody.setApplyBarcode(generateBarcode(xinELuConfig.getApplyBarcodePitureUrl(), recordBody.getScreeningId(), recordBody.getApplyCode())); // 预约条码
recordBody.setApplyBarcode(generateBarcode(xinELuConfig.getApplyBarcodePitureUrl(), recordBody.getScreeningId(), recordBody.getApplyCode()));
} catch (Exception e) {
}
int flag = screeningRecordMapper.insert(recordBody); int flag = screeningRecordMapper.insert(recordBody);
if(flag > 0) { if(flag > 0) {
// 推送消息 // 推送消息