|
@ -1,20 +1,12 @@
|
|
package com.yihu.wlyy.service.synergy;
|
|
package com.yihu.wlyy.service.synergy;
|
|
|
|
|
|
import com.yihu.wlyy.entity.Patient;
|
|
|
|
import com.yihu.wlyy.entity.SignFamily;
|
|
|
|
import com.yihu.wlyy.entity.SignPatientLabelInfo;
|
|
|
|
import com.yihu.wlyy.entity.User;
|
|
|
|
|
|
import com.yihu.wlyy.entity.*;
|
|
|
|
import com.yihu.wlyy.entity.synergy.ManageSynergyWorkordeReminderDO;
|
|
import com.yihu.wlyy.entity.synergy.ManageSynergyWorkorderDO;
|
|
import com.yihu.wlyy.entity.synergy.ManageSynergyWorkorderDO;
|
|
import com.yihu.wlyy.entity.synergy.ManageSynergyWorkorderExecutorDO;
|
|
import com.yihu.wlyy.entity.synergy.ManageSynergyWorkorderExecutorDO;
|
|
import com.yihu.wlyy.entity.synergy.ManageSynergyWorkorderServicerDO;
|
|
import com.yihu.wlyy.entity.synergy.ManageSynergyWorkorderServicerDO;
|
|
import com.yihu.wlyy.repository.PatientDao;
|
|
|
|
import com.yihu.wlyy.repository.SignFamilyDao;
|
|
|
|
import com.yihu.wlyy.repository.SignPatientLabelInfoDao;
|
|
|
|
import com.yihu.wlyy.repository.UserDao;
|
|
|
|
import com.yihu.wlyy.repository.synergy.ManageSynergyWorkOrderDao;
|
|
|
|
import com.yihu.wlyy.repository.synergy.ManageSynergyWorkorderCustomerLogDao;
|
|
|
|
import com.yihu.wlyy.repository.synergy.ManageSynergyWorkorderExecutorDao;
|
|
|
|
import com.yihu.wlyy.repository.synergy.ManageSynergyWorkorderServicerDao;
|
|
|
|
|
|
import com.yihu.wlyy.repository.*;
|
|
|
|
import com.yihu.wlyy.repository.synergy.*;
|
|
import com.yihu.wlyy.util.DateUtil;
|
|
import com.yihu.wlyy.util.DateUtil;
|
|
import com.yihu.wlyy.util.HttpClientUtil;
|
|
import com.yihu.wlyy.util.HttpClientUtil;
|
|
import com.yihu.wlyy.util.IdCardUtil;
|
|
import com.yihu.wlyy.util.IdCardUtil;
|
|
@ -52,6 +44,8 @@ public class SynergyManageService extends BaseJpaService {
|
|
@Autowired
|
|
@Autowired
|
|
private UserDao userDao;
|
|
private UserDao userDao;
|
|
@Autowired
|
|
@Autowired
|
|
|
|
private ManageSynergyWorkorderCustomerLogDao manageSynergyWorkorderCustomerLogDao;
|
|
|
|
@Autowired
|
|
private PatientDao patientDao;
|
|
private PatientDao patientDao;
|
|
@Autowired
|
|
@Autowired
|
|
private SignFamilyDao signFamilyDao;
|
|
private SignFamilyDao signFamilyDao;
|
|
@ -59,6 +53,10 @@ public class SynergyManageService extends BaseJpaService {
|
|
private SignPatientLabelInfoDao signPatientLabelInfoDao;
|
|
private SignPatientLabelInfoDao signPatientLabelInfoDao;
|
|
@Autowired
|
|
@Autowired
|
|
private ManageSynergyWorkorderCustomerLogDao customerLogDao;
|
|
private ManageSynergyWorkorderCustomerLogDao customerLogDao;
|
|
|
|
@Autowired
|
|
|
|
private DoctorDao doctorDao;
|
|
|
|
@Autowired
|
|
|
|
private ManageSynergyWorkorderReminderDao manageSynergyWorkorderReminderDao;
|
|
|
|
|
|
/**
|
|
/**
|
|
* 根据服务编码获取工单
|
|
* 根据服务编码获取工单
|
|
@ -593,4 +591,75 @@ public class SynergyManageService extends BaseJpaService {
|
|
resultMap.put("serveType", StringUtils.isNotEmpty(serveType)?serveType.substring(1) : "");//服务类型
|
|
resultMap.put("serveType", StringUtils.isNotEmpty(serveType)?serveType.substring(1) : "");//服务类型
|
|
return resultMap;
|
|
return resultMap;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 任务进度
|
|
|
|
* @param workorderCode
|
|
|
|
* @param userCode
|
|
|
|
*/
|
|
|
|
public void workorderRate(String workorderCode,String userCode){
|
|
|
|
Map<String,Object> resultMap = new HashMap<>();
|
|
|
|
//完成情况
|
|
|
|
//1、有效
|
|
|
|
Integer validCount = workorderServicerDao.findByWorkorderCodeCount(workorderCode,3);
|
|
|
|
resultMap.put("validCount",validCount);
|
|
|
|
//2、无效
|
|
|
|
resultMap.put("invalidCount","");
|
|
|
|
//3、总数
|
|
|
|
ManageSynergyWorkorderDO manageSynergyWorkorder = workOrderDao.findByCode(workorderCode);
|
|
|
|
resultMap.put("allCount",manageSynergyWorkorder.getServicerCount());
|
|
|
|
//我已完成
|
|
|
|
Integer myFinishedCount = workorderServicerDao.countByWorkorderCodeAndExecutorCodeAndStatus(workorderCode,userCode,3);
|
|
|
|
resultMap.put("myFinishedCount",myFinishedCount);
|
|
|
|
//待跟进
|
|
|
|
resultMap.put("followCount","");
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 催单
|
|
|
|
* @param workorderServicerCode
|
|
|
|
* @param userCode
|
|
|
|
* @param userType
|
|
|
|
* @throws Exception
|
|
|
|
*/
|
|
|
|
@Transactional
|
|
|
|
public void reminder(String workorderServicerCode,String userCode,Integer userType) throws Exception{
|
|
|
|
|
|
|
|
ManageSynergyWorkorderServicerDO manageSynergyWorkorderServicerDO = workorderServicerDao.findByCode(workorderServicerCode);
|
|
|
|
if(manageSynergyWorkorderServicerDO==null){
|
|
|
|
throw new Exception();
|
|
|
|
}
|
|
|
|
ManageSynergyWorkordeReminderDO workordeReminderDO = new ManageSynergyWorkordeReminderDO();
|
|
|
|
workordeReminderDO.setCode(getCode());
|
|
|
|
workordeReminderDO.setWorkorderCode(manageSynergyWorkorderServicerDO.getWorkorderCode());
|
|
|
|
workordeReminderDO.setServicePatientCode(workorderServicerCode);
|
|
|
|
workordeReminderDO.setCreateUser(userCode);
|
|
|
|
//创建人类型(1、医生,2、客服,3、客服负责人)
|
|
|
|
if(userType==1){
|
|
|
|
Doctor doctor = doctorDao.findByCode(userCode);
|
|
|
|
workordeReminderDO.setCreateUserName(doctor.getName());
|
|
|
|
}else if(userType==2||userType==3){
|
|
|
|
User user = userDao.findByCode(userCode);
|
|
|
|
workordeReminderDO.setCreateUserName(user.getName());
|
|
|
|
}
|
|
|
|
workordeReminderDO.setCreateUserType(userType);
|
|
|
|
workordeReminderDO.setHospital(manageSynergyWorkorderServicerDO.getHospital());
|
|
|
|
workordeReminderDO.setHospitalName(manageSynergyWorkorderServicerDO.getHospitalName());
|
|
|
|
workordeReminderDO.setCreateTime(new Date());
|
|
|
|
List<ManageSynergyWorkorderExecutorDO> list = workorderExecutorDao.findByWorkorderCode(manageSynergyWorkorderServicerDO.getWorkorderCode(),1);
|
|
|
|
if(list!=null&&list.size()>0){
|
|
|
|
workordeReminderDO.setPrincipalCode(list.get(0).getExecutorCode());
|
|
|
|
workordeReminderDO.setPrincipalName(list.get(0).getExecutorName());
|
|
|
|
}
|
|
|
|
workordeReminderDO.setWorkorderType(manageSynergyWorkorderServicerDO.getWorkorderType());
|
|
|
|
workordeReminderDO.setRelationCode(manageSynergyWorkorderServicerDO.getRelationCode());
|
|
|
|
workordeReminderDO.setRelationCodeName(manageSynergyWorkorderServicerDO.getRelationCodeName());
|
|
|
|
ManageSynergyWorkorderDO manageSynergyWorkorderDO = workOrderDao.findByCode(manageSynergyWorkorderServicerDO.getWorkorderCode());
|
|
|
|
|
|
|
|
workordeReminderDO.setServiceTime(manageSynergyWorkorderDO!=null?manageSynergyWorkorderDO.getServiceTime():null);
|
|
|
|
workordeReminderDO.setServicerKey(manageSynergyWorkorderDO!=null?manageSynergyWorkorderDO.getServicerKey():null);
|
|
|
|
workordeReminderDO.setWorkorderRemark(manageSynergyWorkorderDO!=null?manageSynergyWorkorderDO.getRemark():null);
|
|
|
|
workordeReminderDO.setDealWith(0);
|
|
|
|
manageSynergyWorkorderReminderDao.save(workordeReminderDO);
|
|
|
|
}
|
|
}
|
|
}
|