|
@ -57,6 +57,8 @@ public class SynergyManageService extends BaseJpaService {
|
|
|
private ManageSynergyWorkorderReminderDao manageSynergyWorkorderReminderDao;
|
|
|
@Autowired
|
|
|
private ManageSynergyWorkorderServicerLogDao manageSynergyWorkorderServicerLogDao;
|
|
|
@Autowired
|
|
|
private TownDao townDao;
|
|
|
|
|
|
/**
|
|
|
* 根据服务编码获取工单
|
|
@ -106,18 +108,18 @@ public class SynergyManageService extends BaseJpaService {
|
|
|
}else if(userType==2){//客服
|
|
|
if(isAcceptTask==1){//我接收
|
|
|
whereSql +=" and w.create_user_type=1 ";//创建人为医生
|
|
|
whereSql += " and e.executor_code ="+code+" ";
|
|
|
whereSql += " and e.executor_code ='"+code+"' ";
|
|
|
}else if(isAcceptTask==2){//我派发
|
|
|
whereSql +=" and w.create_user_type=2 ";//创建人为客服
|
|
|
whereSql += " and e.create_user ="+code+" ";
|
|
|
whereSql += " and e.create_user ='"+code+"' ";
|
|
|
}
|
|
|
}else if(userType==3){//医生
|
|
|
if(isAcceptTask==1){//我接收
|
|
|
whereSql +=" and w.create_user_type=2 ";//创建人为客服
|
|
|
whereSql += " and e.executor_code ="+code+" ";
|
|
|
whereSql += " and e.executor_code ='"+code+"' ";
|
|
|
}else if(isAcceptTask==2){//我派发
|
|
|
whereSql +=" and w.create_user_type=2 ";//创建人为医生
|
|
|
whereSql += " and e.create_user ="+code+" ";
|
|
|
whereSql += " and e.create_user ='"+code+"' ";
|
|
|
}
|
|
|
}
|
|
|
|
|
@ -134,7 +136,7 @@ public class SynergyManageService extends BaseJpaService {
|
|
|
}
|
|
|
//是否是我负责的
|
|
|
if(isMyTask!=null){
|
|
|
whereSql += " and e.executor_code ="+code+" and e.executor_type=1 ";
|
|
|
whereSql += " and e.executor_code ='"+code+"' and e.executor_type=1 ";
|
|
|
}
|
|
|
//工单状态
|
|
|
if(status!=null){
|
|
@ -641,7 +643,7 @@ public class SynergyManageService extends BaseJpaService {
|
|
|
Integer myFinishedCount = workorderServicerDao.countByWorkorderCodeAndExecutorCodeAndStatus(workorderCode,userCode,3);
|
|
|
resultMap.put("myFinishedCount",myFinishedCount);
|
|
|
//待跟进
|
|
|
Integer followCount = manageSynergyWorkorderServicerLogDao.findByWorkorderCode(workorderCode);
|
|
|
Integer followCount = manageSynergyWorkorderServicerLogDao.findByWorkorderCodeAndFollowUp(workorderCode);
|
|
|
resultMap.put("followCount",followCount);
|
|
|
return resultMap;
|
|
|
}
|
|
@ -777,4 +779,199 @@ public class SynergyManageService extends BaseJpaService {
|
|
|
}
|
|
|
return list;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 创建工单
|
|
|
*
|
|
|
* @param manageSynergyWorkorderDO
|
|
|
* @param manageSynergyWorkorderServicerDOS
|
|
|
*/
|
|
|
public void createWorkorder(ManageSynergyWorkorderDO manageSynergyWorkorderDO,List<ManageSynergyWorkorderServicerDO> manageSynergyWorkorderServicerDOS){
|
|
|
manageSynergyWorkorderDO.setCode(getWorkorderNo());
|
|
|
ManageSynergyWorkorderDO manageSynergyWorkorderDO1 = workOrderDao.save(manageSynergyWorkorderDO);
|
|
|
for (ManageSynergyWorkorderServicerDO servicerDO:manageSynergyWorkorderServicerDOS){
|
|
|
servicerDO.setWorkorderType(manageSynergyWorkorderDO1.getType());
|
|
|
servicerDO.setWorkorderCode(manageSynergyWorkorderDO1.getCode());
|
|
|
servicerDO.setRelationCode(manageSynergyWorkorderDO1.getRelationCode());
|
|
|
servicerDO.setCreateTime(new Date());
|
|
|
servicerDO.setRelationCodeName(manageSynergyWorkorderDO1.getRelationCodeName());
|
|
|
workorderServicerDao.save(servicerDO);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 添加随访计划
|
|
|
*
|
|
|
* @param doctor
|
|
|
* @param patient
|
|
|
* @param date
|
|
|
* @param followupType
|
|
|
* @param followupClass
|
|
|
* @param followupManagerStatus
|
|
|
* @param plandate
|
|
|
* @param prescriptioncode
|
|
|
*/
|
|
|
public String addFollowup(String doctor,String patient, String date, String followupType,String followupClass,String followupManagerStatus,String plandate,String prescriptioncode){
|
|
|
String response = null;
|
|
|
String url = wlyyUrl + "followup/addFollowup";
|
|
|
Map<String, Object> params = new HashMap<>();
|
|
|
params.put("doctor",doctor);
|
|
|
params.put("patient",patient);
|
|
|
params.put("date",date);
|
|
|
params.put("followupType",followupType);
|
|
|
params.put("followupClass",followupClass);
|
|
|
params.put("followupManagerStatus",followupManagerStatus);
|
|
|
params.put("plandate",plandate);
|
|
|
params.put("prescriptioncode",prescriptioncode);
|
|
|
try {
|
|
|
response = httpClientUtil.post(url, params);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
return response;
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 保存随访数据
|
|
|
*
|
|
|
* @param followup
|
|
|
* @return
|
|
|
*/
|
|
|
public String saveFollowupProjectData(String followup){
|
|
|
String response = null;
|
|
|
String url = wlyyUrl + "followup/saveFollowupProjectData";
|
|
|
Map<String, Object> params = new HashMap<>();
|
|
|
params.put("followup",followup);
|
|
|
try {
|
|
|
response = httpClientUtil.post(url, params);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
return response;
|
|
|
}
|
|
|
|
|
|
|
|
|
@Transactional
|
|
|
public void taskSubmit(String workorderCode,String dealResultRemark,String dealResultAccessory) throws Exception{
|
|
|
|
|
|
ManageSynergyWorkorderDO manageSynergyWorkorderDO = workOrderDao.findByCode(workorderCode);
|
|
|
manageSynergyWorkorderDO.setDealResultRemark(dealResultRemark);
|
|
|
manageSynergyWorkorderDO.setDealResultAccessory(dealResultAccessory);
|
|
|
manageSynergyWorkorderDO.setStatus(3);
|
|
|
workOrderDao.save(manageSynergyWorkorderDO);
|
|
|
}
|
|
|
|
|
|
public JSONObject getLabels(String labelType) {
|
|
|
String url = wlyyUrl + "/wlyygc/doctor/label/labels?labelType=" + labelType;
|
|
|
String response = httpClientUtil.get(url, "UTF-8");
|
|
|
JSONObject jsonObject = new JSONObject(response);
|
|
|
return jsonObject;
|
|
|
}
|
|
|
|
|
|
public JSONObject getUnitLabels(String currentRoleCode) {
|
|
|
String url = wlyyUrl + "/wlyygc/doctor/label/unitLabels?currentRoleCode=" + currentRoleCode + "¤tRoleLevel=3";
|
|
|
String response = httpClientUtil.get(url, "UTF-8");
|
|
|
JSONObject jsonObject = new JSONObject(response);
|
|
|
return jsonObject;
|
|
|
}
|
|
|
|
|
|
public List<Town> getTowns() {
|
|
|
return (List<Town>) townDao.findAll();
|
|
|
}
|
|
|
|
|
|
public void exportWorkorder(String code,String keywords,Integer workorderType,
|
|
|
Integer isMyTask,Integer status,Integer priority,Integer timeout,String workorderCode,
|
|
|
String principal,String serviceStartTime,String serviceEndTime,
|
|
|
String patientName,String ssc,String idcard,Integer userType,Integer isAcceptTask){
|
|
|
String servicerTable = " left join wlyy.manage_synergy_workorder_executor e on e.workorder_code=w.code AND e.del = 1 " ;
|
|
|
String whereSql = "";
|
|
|
if(userType==3){//客服管理员
|
|
|
whereSql +=" and w.create_user_type=1 ";//创建人为医生
|
|
|
if(isAcceptTask==3){//待接收
|
|
|
whereSql +=" and w.status =1 ";
|
|
|
servicerTable ="";
|
|
|
}else if(isAcceptTask==4){//已接收
|
|
|
whereSql +=" and w.status in (2,3) ";
|
|
|
}
|
|
|
}else if(userType==2){//客服
|
|
|
if(isAcceptTask==1){//我接收
|
|
|
whereSql +=" and w.create_user_type=1 ";//创建人为医生
|
|
|
whereSql += " and e.executor_code ='"+code+"' ";
|
|
|
}else if(isAcceptTask==2){//我派发
|
|
|
whereSql +=" and w.create_user_type=2 ";//创建人为客服
|
|
|
whereSql += " and e.create_user ='"+code+"' ";
|
|
|
}
|
|
|
}else if(userType==3){//医生
|
|
|
if(isAcceptTask==1){//我接收
|
|
|
whereSql +=" and w.create_user_type=2 ";//创建人为客服
|
|
|
whereSql += " and e.executor_code ='"+code+"' ";
|
|
|
}else if(isAcceptTask==2){//我派发
|
|
|
whereSql +=" and w.create_user_type=2 ";//创建人为医生
|
|
|
whereSql += " and e.create_user ='"+code+"' ";
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//关键字查询
|
|
|
if(StringUtils.isNotEmpty(keywords)){
|
|
|
servicerTable +=" left join wlyy.manage_synergy_workorder_servicer s on s.workorder_code=w.code ";
|
|
|
whereSql += " and w.servicer_count<=10 ";
|
|
|
whereSql += " and (w.create_user_name like '%"+keywords+"%' or s.service_patient_name like '%"+keywords+"%' " +
|
|
|
" or s.ssc like '%"+keywords+"%' or s.idcard like '%"+keywords+"%' ) ";
|
|
|
}
|
|
|
//服务类型
|
|
|
if(workorderType!=null){
|
|
|
whereSql += " and w.type ="+workorderType+" ";
|
|
|
}
|
|
|
//是否是我负责的
|
|
|
if(isMyTask!=null){
|
|
|
whereSql += " and e.executor_code ='"+code+"' and e.executor_type=1 ";
|
|
|
}
|
|
|
//工单状态
|
|
|
if(status!=null){
|
|
|
whereSql +=" and w.status ="+status+" ";
|
|
|
}
|
|
|
//优先级
|
|
|
if(priority!=null){
|
|
|
whereSql+= " and w.priority="+priority+" ";
|
|
|
}
|
|
|
//是否超时
|
|
|
if(timeout!=null){
|
|
|
whereSql +=" and w.service_time >'"+DateUtil.dateToStrLong(new Date())+"' ";
|
|
|
}
|
|
|
//服务编码
|
|
|
if(StringUtils.isNotEmpty(workorderCode)){
|
|
|
whereSql+=" and w.code like '%"+workorderCode+"%' ";
|
|
|
}
|
|
|
//负责人
|
|
|
if(StringUtils.isNotEmpty(principal)){
|
|
|
whereSql+=" and e.code like '%"+principal+"%' and e.executor_type=1 ";
|
|
|
}
|
|
|
//服务时间
|
|
|
if(StringUtils.isNotEmpty(serviceStartTime)){
|
|
|
whereSql+=" and w.service_time>='"+serviceStartTime+"' ";
|
|
|
}
|
|
|
if(StringUtils.isNotEmpty(serviceEndTime)){
|
|
|
whereSql+=" and w.service_time<='"+serviceEndTime+"' ";
|
|
|
}
|
|
|
//服务对象
|
|
|
if(StringUtils.isNotEmpty(patientName)){
|
|
|
whereSql+=" s.service_patient_name like '%"+keywords+"%' ";
|
|
|
}
|
|
|
//社保卡号
|
|
|
if(StringUtils.isNotEmpty(ssc)){
|
|
|
whereSql+=" s.ssc like '%"+keywords+"%' ";
|
|
|
}
|
|
|
//身份证号
|
|
|
if(StringUtils.isNotEmpty(idcard)){
|
|
|
whereSql+=" s.idcard like '%"+keywords+"%' ";
|
|
|
}
|
|
|
String sql =" select DISTINCT w.* from wlyy.manage_synergy_workorder w " +servicerTable+
|
|
|
|
|
|
" where w.del=1 " +
|
|
|
" and 1=1 "+whereSql+ " order by w.priority desc,w.service_time desc";
|
|
|
List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
|
|
|
|
|
|
}
|
|
|
}
|