|
@ -12,6 +12,7 @@ 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;
|
|
|
|
import com.yihu.wlyy.util.fastdfs.FastDFSUtil;
|
|
import com.yihu.wlyy.util.query.BaseJpaService;
|
|
import com.yihu.wlyy.util.query.BaseJpaService;
|
|
import jxl.Workbook;
|
|
import jxl.Workbook;
|
|
import jxl.write.*;
|
|
import jxl.write.*;
|
|
@ -67,6 +68,8 @@ public class SynergyManageService extends BaseJpaService {
|
|
private ManageSynergyWorkorderServicerLogDao manageSynergyWorkorderServicerLogDao;
|
|
private ManageSynergyWorkorderServicerLogDao manageSynergyWorkorderServicerLogDao;
|
|
@Autowired
|
|
@Autowired
|
|
private TownDao townDao;
|
|
private TownDao townDao;
|
|
|
|
@Autowired
|
|
|
|
private FastDFSUtil fastDFSUtil;
|
|
|
|
|
|
/**
|
|
/**
|
|
* 根据服务编码获取工单
|
|
* 根据服务编码获取工单
|
|
@ -121,13 +124,14 @@ public class SynergyManageService extends BaseJpaService {
|
|
whereSql +=" and w.create_user_type=2 ";//创建人为客服
|
|
whereSql +=" and w.create_user_type=2 ";//创建人为客服
|
|
whereSql += " and w.create_user ='"+code+"' ";
|
|
whereSql += " and w.create_user ='"+code+"' ";
|
|
}
|
|
}
|
|
}else if(userType==3){//医生
|
|
|
|
|
|
}else if(userType==1){//医生
|
|
if(isAcceptTask==1){//我接收
|
|
if(isAcceptTask==1){//我接收
|
|
whereSql +=" and w.create_user_type=2 ";//创建人为客服
|
|
whereSql +=" and w.create_user_type=2 ";//创建人为客服
|
|
|
|
|
|
whereSql += " and e.executor_code ='"+code+"' ";
|
|
whereSql += " and e.executor_code ='"+code+"' ";
|
|
}else if(isAcceptTask==2){//我派发
|
|
}else if(isAcceptTask==2){//我派发
|
|
whereSql +=" and w.create_user_type=2 ";//创建人为医生
|
|
|
|
whereSql += " and e.create_user ='"+code+"' ";
|
|
|
|
|
|
whereSql +=" and w.create_user_type=1 ";//创建人为医生
|
|
|
|
whereSql += " and w.create_user ='"+code+"' ";
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@ -208,6 +212,9 @@ public class SynergyManageService extends BaseJpaService {
|
|
String finalSql = sql+" LIMIT "+(page-1)*pageSize+","+pageSize;
|
|
String finalSql = sql+" LIMIT "+(page-1)*pageSize+","+pageSize;
|
|
List<Map<String,Object>> resultWorkorderList = jdbcTemplate.queryForList(finalSql);
|
|
List<Map<String,Object>> resultWorkorderList = jdbcTemplate.queryForList(finalSql);
|
|
List<Map<String,Object>> resultList = new ArrayList<>();
|
|
List<Map<String,Object>> resultList = new ArrayList<>();
|
|
|
|
ManageSynergyWorkorderServicerDO servicerDO = null;
|
|
|
|
Patient patient =null;
|
|
|
|
List<ManageSynergyWorkorderServicerDO> servicerList = null;
|
|
for(Map<String,Object> one : resultWorkorderList){
|
|
for(Map<String,Object> one : resultWorkorderList){
|
|
Map<String,Object> map = new HashMap<>();
|
|
Map<String,Object> map = new HashMap<>();
|
|
map.put("workorderCode",one.get("code"));//服务编码
|
|
map.put("workorderCode",one.get("code"));//服务编码
|
|
@ -249,6 +256,19 @@ public class SynergyManageService extends BaseJpaService {
|
|
map.put("finishedServicerCount",finishedServicerCount);//服务完成人数
|
|
map.put("finishedServicerCount",finishedServicerCount);//服务完成人数
|
|
map.put("userName",one.get("create_user_name"));
|
|
map.put("userName",one.get("create_user_name"));
|
|
map.put("hospitalName",one.get("hospital_name"));
|
|
map.put("hospitalName",one.get("hospital_name"));
|
|
|
|
map.put("servicerKey",one.get("servicer_key"));
|
|
|
|
map.put("remark",one.get("remark"));
|
|
|
|
if(workorderTypeR==0||workorderTypeR==2||workorderTypeR==3){
|
|
|
|
servicerList = workorderServicerDao.findByWorkorderCode(one.get("code")+"");
|
|
|
|
if(servicerList.size()>0){
|
|
|
|
servicerDO = servicerList.get(0);
|
|
|
|
patient = patientDao.findByCode(servicerDO.getServicePatientCode());
|
|
|
|
}
|
|
|
|
Integer age = IdCardUtil.getAgeForIdcard(patient.getIdcard());
|
|
|
|
String sex = IdCardUtil.getSexForIdcard_new(patient.getIdcard());
|
|
|
|
map.put("age",age);
|
|
|
|
map.put("sex","1".equals(sex)?"男":("2".equals(sex)?"女":"未知"));
|
|
|
|
}
|
|
resultList.add(map);
|
|
resultList.add(map);
|
|
}
|
|
}
|
|
Map<String,Object> resultMap = new HashMap<>();
|
|
Map<String,Object> resultMap = new HashMap<>();
|
|
@ -462,14 +482,17 @@ public class SynergyManageService extends BaseJpaService {
|
|
resultMap.put("townName",workorderMap.get("town_name"));//所属区县
|
|
resultMap.put("townName",workorderMap.get("town_name"));//所属区县
|
|
resultMap.put("hospitalName",workorderMap.get("hospital_name"));//所属社区
|
|
resultMap.put("hospitalName",workorderMap.get("hospital_name"));//所属社区
|
|
SignFamily signFamily = signFamilyDao.findSignByPatient(workorderMap.get("service_patient_code")+"");
|
|
SignFamily signFamily = signFamilyDao.findSignByPatient(workorderMap.get("service_patient_code")+"");
|
|
resultMap.put("signDoctor",signFamily.getDoctor());//签约医生(即:工单创建医生)
|
|
|
|
|
|
resultMap.put("signDoctor",signFamily.getDoctorName());//签约医生(即:工单创建医生)
|
|
resultMap.put("healthDoctor",signFamily.getDoctorHealthName());//健管师
|
|
resultMap.put("healthDoctor",signFamily.getDoctorHealthName());//健管师
|
|
List<SignPatientLabelInfo> labelDiseaseType = signPatientLabelInfoDao.findByPatientAndLabelTypeAndStatus(workorderMap.get("service_patient_code")+"", "3", 1);
|
|
List<SignPatientLabelInfo> labelDiseaseType = signPatientLabelInfoDao.findByPatientAndLabelTypeAndStatus(workorderMap.get("service_patient_code")+"", "3", 1);
|
|
String diseaseType="";
|
|
String diseaseType="";
|
|
|
|
List<String> diseaseTypeList= new ArrayList<>();
|
|
for(SignPatientLabelInfo one:labelDiseaseType){
|
|
for(SignPatientLabelInfo one:labelDiseaseType){
|
|
diseaseType+=","+one.getLabelName();
|
|
diseaseType+=","+one.getLabelName();
|
|
|
|
diseaseTypeList.add(one.getLabel());
|
|
}
|
|
}
|
|
resultMap.put("diseaseType",StringUtils.isNotEmpty(diseaseType)?diseaseType.substring(1):"");//疾病类型
|
|
resultMap.put("diseaseType",StringUtils.isNotEmpty(diseaseType)?diseaseType.substring(1):"");//疾病类型
|
|
|
|
resultMap.put("diseaseTypeCode",diseaseTypeList);//疾病类型code
|
|
List<SignPatientLabelInfo> labelHealthType = signPatientLabelInfoDao.findByPatientAndLabelTypeAndStatus(workorderMap.get("service_patient_code")+"", "2", 1);
|
|
List<SignPatientLabelInfo> labelHealthType = signPatientLabelInfoDao.findByPatientAndLabelTypeAndStatus(workorderMap.get("service_patient_code")+"", "2", 1);
|
|
String healthType="";
|
|
String healthType="";
|
|
for(SignPatientLabelInfo one:labelHealthType){
|
|
for(SignPatientLabelInfo one:labelHealthType){
|
|
@ -482,20 +505,22 @@ public class SynergyManageService extends BaseJpaService {
|
|
serveType+=","+one.getLabelName();
|
|
serveType+=","+one.getLabelName();
|
|
}
|
|
}
|
|
resultMap.put("serveType",StringUtils.isNotEmpty(serveType)?serveType.substring(1):"");//服务类型
|
|
resultMap.put("serveType",StringUtils.isNotEmpty(serveType)?serveType.substring(1):"");//服务类型
|
|
|
|
|
|
|
|
resultMap.put("workorder",workorderMap.get("code"));//工单编号
|
|
|
|
resultMap.put("patientCode",workorderMap.get("service_patient_code"));//居民code
|
|
|
|
resultMap.put("doctorCode",workorderMap.get("create_user"));//创建人(医生)code
|
|
//获取提交记录
|
|
//获取提交记录
|
|
String servicerCode = workorderMap.get("servicerCode")+"";
|
|
String servicerCode = workorderMap.get("servicerCode")+"";
|
|
List<ManageSynergyWorkorderServicerLogDO> list = manageSynergyWorkorderServicerLogDao.findByWorkorderServiceCode(servicerCode);
|
|
List<ManageSynergyWorkorderServicerLogDO> list = manageSynergyWorkorderServicerLogDao.findByWorkorderServiceCode(servicerCode);
|
|
if(list.size()>0){
|
|
if(list.size()>0){
|
|
ManageSynergyWorkorderServicerLogDO log = list.get(0);
|
|
ManageSynergyWorkorderServicerLogDO log = list.get(0);
|
|
Map<String,Object> m = new HashMap<>();
|
|
Map<String,Object> m = new HashMap<>();
|
|
m.put("personal",log.getPersonal());
|
|
|
|
m.put("callCode",log.getCallCode());
|
|
|
|
m.put("callStatus",log.getCallStatus());
|
|
|
|
m.put("emphasis",log.getEmphasis());
|
|
|
|
m.put("followUp",log.getFollowUp());
|
|
|
|
m.put("remark",log.getRemark());
|
|
|
|
m.put("returnVisit",log.getReturnVisit());
|
|
|
|
|
|
m.put("personal",log.getPersonal());//是否为本人
|
|
|
|
m.put("callCode",log.getCallCode());//通话记录code
|
|
|
|
m.put("callStatus",log.getCallStatus());//通话状态(1、正常通话,2、无人接听,3、拒接,4、占线,5、关机,6、停机,7、无法接通,8、空号错号)
|
|
|
|
m.put("emphasis",log.getEmphasis());//是否重点患者(1、重点患者,2、非重点患者)
|
|
|
|
m.put("followUp",log.getFollowUp());//是否跟进(1、无需跟进,2、待跟进)
|
|
|
|
m.put("remark",log.getRemark());//备注
|
|
|
|
m.put("returnVisit",log.getReturnVisit());//回访(1、有效回访,2、无效回访)
|
|
resultMap.put("servicerLog",m);
|
|
resultMap.put("servicerLog",m);
|
|
}
|
|
}
|
|
return resultMap;
|
|
return resultMap;
|
|
@ -1129,11 +1154,11 @@ public class SynergyManageService extends BaseJpaService {
|
|
i++;
|
|
i++;
|
|
}
|
|
}
|
|
wwb.write();
|
|
wwb.write();
|
|
wwb.close();
|
|
|
|
}catch (Exception e) {
|
|
}catch (Exception e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
if (wwb != null) wwb.close();
|
|
|
|
throw e;
|
|
throw e;
|
|
|
|
}finally {
|
|
|
|
if (wwb != null) wwb.close();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@ -1242,15 +1267,39 @@ public class SynergyManageService extends BaseJpaService {
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
*
|
|
|
|
|
|
* 添加客户操作记录
|
|
* @param workorderCode
|
|
* @param workorderCode
|
|
* @param workorderServiceCode
|
|
* @param workorderServiceCode
|
|
* @param userCode
|
|
* @param userCode
|
|
* @param userName
|
|
|
|
* @param callCode
|
|
* @param callCode
|
|
* @param status
|
|
* @param status
|
|
*/
|
|
*/
|
|
public void addWorkorderCustomerLog(String workorderCode,String workorderServiceCode,String userCode,String userName,String callCode,String status){
|
|
|
|
|
|
@Transactional
|
|
|
|
public void addWorkorderCustomerLog(String workorderCode,String workorderServiceCode,String userCode,String callCode,Integer status) throws Exception{
|
|
|
|
|
|
|
|
ManageSynergyWorkorderCustomerLogDO workorderCustomerLogDO = new ManageSynergyWorkorderCustomerLogDO();
|
|
|
|
workorderCustomerLogDO.setCode(getCode());
|
|
|
|
workorderCustomerLogDO.setCallCode(callCode);
|
|
|
|
workorderCustomerLogDO.setCreateTime(new Date());
|
|
|
|
workorderCustomerLogDO.setCreateUserCode(userCode);
|
|
|
|
User user = userDao.findByCode(userCode);
|
|
|
|
workorderCustomerLogDO.setCreateUserName(user.getName());
|
|
|
|
workorderCustomerLogDO.setStatus(status);
|
|
|
|
workorderCustomerLogDO.setWorkorderCode(workorderCode);
|
|
|
|
workorderCustomerLogDO.setWorkorderServiceCode(workorderServiceCode);
|
|
|
|
customerLogDao.save(workorderCustomerLogDO);
|
|
|
|
}
|
|
|
|
|
|
|
|
// public static void main(String[] args) {
|
|
|
|
// String a ="group1/M00/0E/FB/rBFuWlubh7SACz32AAAde0sVAJk899.png";
|
|
|
|
// int aa = a.lastIndexOf("/");
|
|
|
|
// System.out.println(aa);
|
|
|
|
// System.out.println(a.substring(0,aa));
|
|
|
|
// }
|
|
|
|
public void wordToPDF(String path) throws Exception{
|
|
|
|
String groupName = path.substring(0,path.lastIndexOf("/"));
|
|
|
|
String remoteFileName =path.substring(path.lastIndexOf("/"),path.length()-1);
|
|
|
|
byte[] bb =FastDFSUtil.download(groupName,remoteFileName);
|
|
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|