|
@@ -1,12 +1,18 @@
|
|
|
package com.ruoyi.care.service.impl;
|
|
|
|
|
|
import java.util.List;
|
|
|
+
|
|
|
+import com.ruoyi.care.domain.CareAssignments;
|
|
|
+import com.ruoyi.care.mapper.CareAssignmentsMapper;
|
|
|
+import com.ruoyi.common.enums.CareApplyStatus;
|
|
|
import com.ruoyi.common.utils.DateUtils;
|
|
|
+import com.ruoyi.common.utils.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import com.ruoyi.care.mapper.CareApplicationsMapper;
|
|
|
import com.ruoyi.care.domain.CareApplications;
|
|
|
import com.ruoyi.care.service.ICareApplicationsService;
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
/**
|
|
|
* 护理申请Service业务层处理
|
|
@@ -20,6 +26,8 @@ public class CareApplicationsServiceImpl implements ICareApplicationsService
|
|
|
@Autowired
|
|
|
private CareApplicationsMapper careApplicationsMapper;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private CareAssignmentsMapper careAssignmentsMapper;
|
|
|
/**
|
|
|
* 查询护理申请
|
|
|
*
|
|
@@ -93,4 +101,33 @@ public class CareApplicationsServiceImpl implements ICareApplicationsService
|
|
|
{
|
|
|
return careApplicationsMapper.deleteCareApplicationsByApplyId(applyId);
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ @Transactional
|
|
|
+ public int assign(CareApplications careApplications) {
|
|
|
+ int result=0;
|
|
|
+ CareAssignments careAssignments=new CareAssignments();
|
|
|
+ careApplications.setStatus(CareApplyStatus.ASSIGNED.getCode());
|
|
|
+ careApplicationsMapper.updateCareApplications(careApplications);
|
|
|
+
|
|
|
+ if(careApplications.getAssignId()==null){
|
|
|
+ careAssignments.setApplyId(careApplications.getApplyId());
|
|
|
+ careAssignments.setCompanyId(careApplications.getCompanyId());
|
|
|
+ careAssignments.setNurseId(careApplications.getNurseId());
|
|
|
+ careAssignments.setRemark(careApplications.getAssignRemark());
|
|
|
+ careAssignments.setCreateTime(DateUtils.getNowDate());
|
|
|
+
|
|
|
+ result=careAssignmentsMapper.insertCareAssignments(careAssignments);
|
|
|
+ }else{
|
|
|
+ careAssignments=careAssignmentsMapper.selectCareAssignmentsByAssignId(careApplications.getAssignId());
|
|
|
+ careAssignments.setCompanyId(careApplications.getCompanyId());
|
|
|
+ careAssignments.setNurseId(careApplications.getNurseId());
|
|
|
+ careAssignments.setRemark(careApplications.getAssignRemark());
|
|
|
+ careAssignments.setUpdateTime(DateUtils.getNowDate());
|
|
|
+
|
|
|
+ result=careAssignmentsMapper.updateCareAssignments(careAssignments);
|
|
|
+ }
|
|
|
+
|
|
|
+ return result;
|
|
|
+ }
|
|
|
}
|