修改代码;
This commit is contained in:
parent
31f7740e7c
commit
c21c7373b5
@ -32,10 +32,10 @@ public class ResidentServiceApplyController extends BaseController {
|
||||
@Resource
|
||||
private IResidentServiceAppletService residentServiceAppletService;
|
||||
|
||||
@ApiOperation("提交服务申请(批量)")
|
||||
@ApiOperation("提交服务申请")
|
||||
@PostMapping("/save")
|
||||
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("请求参数不能为空");
|
||||
}
|
||||
residentServiceAppletService.insert(body);
|
||||
|
||||
@ -17,7 +17,7 @@ import java.util.List;
|
||||
**/
|
||||
@Data
|
||||
@ApiModel("居民服务申请请求对象")
|
||||
public class ResidentServiceApplyBody {
|
||||
public class ResidentServiceApplyBody extends ResidentServiceFormApplyDto{
|
||||
|
||||
/**
|
||||
* 居民编号
|
||||
@ -94,6 +94,7 @@ public class ResidentServiceApplyBody {
|
||||
/**
|
||||
* 服务项集合
|
||||
*/
|
||||
@ApiModelProperty(value = "服务项集合", hidden = true)
|
||||
List<ResidentServiceFormApplyDto> formList;
|
||||
|
||||
}
|
||||
|
||||
@ -77,31 +77,18 @@ public class ResidentServiceApplyServiceImpl implements IResidentServiceAppletSe
|
||||
}
|
||||
}
|
||||
|
||||
List<ResidentServiceApplyEntity> serviceApplyList = new ArrayList<>();
|
||||
for (ResidentServiceFormApplyDto form : body.getFormList()) {
|
||||
if (!StringUtils.isBlank(form.getFormNo())) {
|
||||
entity = new ResidentServiceApplyEntity();
|
||||
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);
|
||||
}
|
||||
entity = new ResidentServiceApplyEntity();
|
||||
BeanUtils.copyProperties(body, entity);
|
||||
if (patientInfo != null) {
|
||||
entity.setPatientId(patientInfo.getPatientCode());
|
||||
}
|
||||
if (serviceApplyList.size() == 0) {
|
||||
throw new ServiceException("服务项目不能为空");
|
||||
}
|
||||
residentServiceApplyMapper.batchInsert(serviceApplyList);
|
||||
entity.setApplyTime(new Date());
|
||||
// 预约状态0:已申请1:已完成2:已取消
|
||||
entity.setBookingStatus("0");
|
||||
// 审批状态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("未查询到签约信息!");
|
||||
}
|
||||
// 获取家医个性服务包
|
||||
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);
|
||||
if (!"1".equals(jsonObject.get("code"))) {
|
||||
throw new ServiceException(jsonObject.get("msg").toString());
|
||||
@ -311,15 +298,15 @@ public class ResidentServiceApplyServiceImpl implements IResidentServiceAppletSe
|
||||
if (org != null && !StringUtils.isBlank(org.getPhOrgId())) {
|
||||
// 根据机构编码获取筛查机构
|
||||
HospitalInfo Hospital = hospitalInfoService.getHosptalByOrgCode(org.getPhOrgId());
|
||||
if(Hospital != null) {
|
||||
if (Hospital != null) {
|
||||
// 获取筛查项目
|
||||
ScreeningProject query = new ScreeningProject();
|
||||
query.setHospitalId(Hospital.getId());
|
||||
query.setProjectName(projectName);
|
||||
List<ScreeningProject> screeningProjectList = screeningProjectService.findList(query);
|
||||
if(screeningProjectList != null && screeningProjectList.size() > 0) {
|
||||
if (screeningProjectList != null && screeningProjectList.size() > 0) {
|
||||
ScreeningProjectVo sp;
|
||||
for(ScreeningProject project: screeningProjectList) {
|
||||
for (ScreeningProject project : screeningProjectList) {
|
||||
sp = new ScreeningProjectVo();
|
||||
sp.setSourceType("2");
|
||||
sp.setHospitalId(String.valueOf(project.getHospitalId()));
|
||||
|
||||
@ -78,6 +78,9 @@ public class ResidentSignApplyServiceImpl implements IResidentSignAppletService
|
||||
// 审批状态0:待批准 1:已同意 2:已拒绝
|
||||
entity.setApprovalStatus("0");
|
||||
entity.setBookingNo(IdUtils.simpleUUID());
|
||||
if(StringUtils.isBlank(entity.getNation())) {
|
||||
entity.setNation("1");
|
||||
}
|
||||
residentSignApplyMapper.insert(entity);
|
||||
}
|
||||
|
||||
|
||||
@ -127,8 +127,12 @@ public class ScreeningRecordServiceImpl implements IScreeningRecordService {
|
||||
recordBody.setScreeningStatus("1");
|
||||
recordBody.setApplyCode(generateCode());
|
||||
recordBody.setScreeningType("1");
|
||||
// 预约条码
|
||||
recordBody.setApplyBarcode(generateBarcode(xinELuConfig.getApplyBarcodePitureUrl(), recordBody.getScreeningId(), recordBody.getApplyCode()));
|
||||
try {
|
||||
// 预约条码
|
||||
recordBody.setApplyBarcode(generateBarcode(xinELuConfig.getApplyBarcodePitureUrl(), recordBody.getScreeningId(), recordBody.getApplyCode()));
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
int flag = screeningRecordMapper.insert(recordBody);
|
||||
if(flag > 0) {
|
||||
// 推送消息
|
||||
|
||||
Loading…
Reference in New Issue
Block a user