Преглед изворни кода

Merge branch 'dev' of liuwenbin/patient-co-management into dev

liuwenbin пре 7 година
родитељ
комит
31699b65a2

+ 4 - 4
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/repository/synergy/ManageSynergyWorkorderExecutorDao.java

@ -4,11 +4,11 @@ import com.yihu.wlyy.entity.synergy.ManageSynergyWorkorderExecutorDO;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
public interface ManageSynergyWorkorderExecutorDao extends PagingAndSortingRepository<ManageSynergyWorkorderExecutorDO, Long> {
    @Query("select e.executorName from ManageSynergyWorkorderExecutorDO e where e.workorderCode = ?1 and e.executorType = 1")
    String findManagerByWorkorderCode(String workorderCode);
    @Query("select e from ManageSynergyWorkorderExecutorDO e where e.workorderCode = ?1 and e.executorType = ?2 and e.del=1")
    List<ManageSynergyWorkorderExecutorDO> findByWorkorderExecutorCode(String workorderCode, Integer executorType);
    @Query("select e.executorName from ManageSynergyWorkorderExecutorDO e where e.workorderCode = ?1 and e.executorType = 2")
    String findCollaboratorByWorkorderCode(String workorderCode);
}

+ 42 - 11
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/synergy/SynergyManageService.java

@ -1,5 +1,6 @@
package com.yihu.wlyy.service.synergy;
import com.yihu.wlyy.entity.synergy.ManageSynergyWorkorderExecutorDO;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.entity.synergy.ManageSynergyWorkorderDO;
import org.apache.commons.lang3.StringUtils;
@ -33,7 +34,6 @@ public class SynergyManageService {
    @Autowired
    JdbcTemplate jdbcTemplate;
    @Autowired
    private ManageSynergyWorkOrderDao workOrderDao;
    @Autowired
@ -41,6 +41,11 @@ public class SynergyManageService {
    @Autowired
    private ManageSynergyWorkorderExecutorDao workorderExecutorDao;
    /**
     * 根据服务编码获取工单
     * @param workorderCode
     * @return
     */
    public ManageSynergyWorkorderDO findWorkOrderByCode(String workorderCode) {
        return workOrderDao.findByCode(workorderCode);
    }
@ -153,13 +158,17 @@ public class SynergyManageService {
                case 4:statusName="退回";break;
            }
            map.put("statusName",statusName);
            map.put("principalMan",one.get(""));//负责人
            List<ManageSynergyWorkorderExecutorDO> managerList = workorderExecutorDao.findByWorkorderExecutorCode(one.get("code")+"",1);
            String managerName = managerList.size()>0?managerList.get(0).getExecutorName():"";
            map.put("managerName",managerName);//负责人的名称
        }
    }
    //获取服务编码
    public synchronized  String getWorkorderNo(){
    /**
     * 获取服务编码
     * @return
     */
    public synchronized String getWorkorderNo(){
        String orderNo = "" ;
        String trandNo = String.valueOf((Math.random() * 9 + 1) * 1000000);
        String sdf = new SimpleDateFormat("yyyyMMddHHMMSS").format(new Date());
@ -167,6 +176,23 @@ public class SynergyManageService {
        orderNo = sdf + orderNo ;
        return orderNo ;
    }
    /**
     * 获取超时级别
     * @param serviceTime
     * @return
     */
    public Integer isServiceOverTime(Date serviceTime){
        //当前时间 > 服务时间+4小时(已超时)3
        //服务时间+4小时 > 当前时间 > 服务时间(红色超时)2
        //服务时间 HH:mm:59()> 当前时间 > 服务时间 HH:mm:00(黄色超时)1
        //服务时间 HH:mm:00 > 当前时间 (正常)0
        Long serviceTimeAfter4Long = serviceTime.getTime()+4*60*60*1000;
        Long serviceTimeLong = serviceTime.getTime();
        Long currentTime = new Date().getTime();
        return 0;
    }
    //获取系统服务详情
    public Map<String, Object> getWorkOrderInfo(String workorderCode, Integer role) {
        Map<String, Object> map = new HashMap<>();
@ -200,16 +226,21 @@ public class SynergyManageService {
        //获取负责人信息
        if(role == 3){
            String manager = workorderExecutorDao.findManagerByWorkorderCode(workorderCode);
            String collaborator = workorderExecutorDao.findCollaboratorByWorkorderCode(workorderCode);
            map.put("负责人", manager);
            map.put("参与人", collaborator);
            List<ManageSynergyWorkorderExecutorDO> managerList = workorderExecutorDao.findByWorkorderExecutorCode(workorderCode,1);
            List<ManageSynergyWorkorderExecutorDO> collaboratorList = workorderExecutorDao.findByWorkorderExecutorCode(workorderCode,2);
            String manager = managerList.size()>0?managerList.get(0).getExecutorName():"";
            String collaborator ="";
            for(ManageSynergyWorkorderExecutorDO one:collaboratorList){
                collaborator+="、"+one.getExecutorName();
            }
            map.put("manager", manager);//负责人
            map.put("collaboratorList", StringUtils.isNotEmpty(collaborator)?collaborator.substring(1):"");//参与人可能有多个
        }
        //获取处理结果
        if(workorderDO.getStatus() == 3){
            map.put("说明", workorderDO.getDealResultRemark());
            map.put("附件",workorderDO.getDealResultAccessory());
            map.put("remark", workorderDO.getDealResultRemark());
            map.put("accessory",workorderDO.getDealResultAccessory());
        }
        return map;
    }