liubing 4 年 前
コミット
6089590916

+ 1 - 1
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/lifeCare/DoctorLifeCareEndpoint.java

@ -91,7 +91,7 @@ public class DoctorLifeCareEndpoint extends EnvelopRestEndpoint {
            @ApiParam(value = "完成服务记录", name = "completeRemark")
            @RequestParam(value = "completeRemark", required = true) String completeRemark) {
        try {
           lifeCareOrderService.completeOrder(orderId, completeImgs, completeRemark);
           lifeCareOrderService.completeOrder(orderId, completeImgs, completeRemark,getUID());
            return Envelop.getSuccess("记录成功");
        } catch (Exception e) {
            e.printStackTrace();

+ 1 - 1
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/lifeCare/PatientLifeCareEndpoint.java

@ -33,7 +33,7 @@ public class PatientLifeCareEndpoint  extends EnvelopRestEndpoint {
    public Envelop create(@ApiParam(name = "jsonData", value = "Json数据", required = true) @RequestParam String jsonData) {
        JSONObject result = new JSONObject();
        try{
            result = lifeCareOrderService.create(jsonData);
            result = lifeCareOrderService.create(jsonData,getUID());
        }catch (Exception e){
            e.printStackTrace();
            return Envelop.getError("操作失败",-1);

+ 34 - 7
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/lifeCare/LifeCareOrderService.java

@ -6,13 +6,17 @@ import com.yihu.jw.care.dao.lifeCare.LifeCareFeeDetailDao;
import com.yihu.jw.care.dao.lifeCare.LifeCareItemDictDao;
import com.yihu.jw.care.dao.lifeCare.LifeCareOrderDao;
import com.yihu.jw.care.util.MessageUtil;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
import com.yihu.jw.doctor.dao.BaseDoctorHospitalDao;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO;
import com.yihu.jw.entity.base.org.BaseOrgDO;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.care.lifeCare.LifeCareCancelLogDO;
import com.yihu.jw.entity.care.lifeCare.LifeCareFeeDetailDO;
import com.yihu.jw.entity.care.lifeCare.LifeCareItemDictDO;
import com.yihu.jw.entity.care.lifeCare.LifeCareOrderDO;
import com.yihu.jw.org.dao.BaseOrgDao;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.restmodel.ResponseContant;
import com.yihu.jw.util.common.IdCardUtil;
@ -61,6 +65,10 @@ public class LifeCareOrderService extends BaseJpaService<LifeCareOrderDO, LifeCa
    private String wxId;
    @Autowired
    private BaseDoctorHospitalDao doctorHospitalDao;
    @Autowired
    private BaseOrgDao baseOrgDao;
    @Autowired
    private BaseDoctorDao doctorDao;
    /**
     * 记录完成情况
@ -68,7 +76,7 @@ public class LifeCareOrderService extends BaseJpaService<LifeCareOrderDO, LifeCa
     * @param complereImgs
     * @param completeRemark
     */
    public void completeOrder(String orderId,String complereImgs,String completeRemark){
    public void completeOrder(String orderId,String complereImgs,String completeRemark,String doctorId){
        LifeCareOrderDO lifeCareOrderDO = lifeCareOrderDao.findOne(orderId);
        if(lifeCareOrderDO.getStatus().equals(LifeCareOrderDO.Status.waitForAccept.getType())){
            lifeCareOrderDO.setStatus(2);
@ -217,7 +225,7 @@ public class LifeCareOrderService extends BaseJpaService<LifeCareOrderDO, LifeCa
            }
        } catch (Exception e) {
            result.put(ResponseContant.resultFlag, ResponseContant.fail);
            result.put(ResponseContant.resultMsg, "从数据库查询【调度员】生活照料工单列表信息失败:" + e.getMessage());
            result.put(ResponseContant.resultMsg, "从数据库查询生活照料工单列表信息失败");
            return result;
        }
@ -226,7 +234,7 @@ public class LifeCareOrderService extends BaseJpaService<LifeCareOrderDO, LifeCa
            count = jdbcTemplate.queryForObject(finqlCountSql, Long.class);
        } catch (Exception e) {
            result.put(ResponseContant.resultFlag, ResponseContant.fail);
            result.put(ResponseContant.resultMsg, "从数据库统计【调度员】生活照料工单数量失败:" + e.getMessage());
            result.put(ResponseContant.resultMsg, "从数据库统计生活照料工单数量失败" );
            return result;
        }
        
@ -339,14 +347,14 @@ public class LifeCareOrderService extends BaseJpaService<LifeCareOrderDO, LifeCa
        LifeCareOrderDO orderDO = lifeCareOrderDao.findOne(orderId);
        if(null == orderDO){
            result.put(ResponseContant.resultFlag, ResponseContant.fail);
            String failMsg = "【取消工单】该工单不存在:," + orderId;
            String failMsg = "【取消工单】该工单不存在";
            result.put(ResponseContant.resultMsg, failMsg);
            logger.error(failMsg);
            return result;
        }
        if(orderDO.getStatus().equals(LifeCareOrderDO.Status.waitForAccept.getType())){
        if(orderDO.getStatus().equals(LifeCareOrderDO.Status.complete.getType())){
            result.put(ResponseContant.resultFlag, ResponseContant.fail);
            String failMsg = "只有医生服务前的工单才可取消:," + orderId;
            String failMsg = "只有医生服务前的工单才可取消";
            result.put(ResponseContant.resultMsg, failMsg);
            logger.error(failMsg);
            return result;
@ -395,13 +403,27 @@ public class LifeCareOrderService extends BaseJpaService<LifeCareOrderDO, LifeCa
     * @return
     */
    @Transactional(rollbackFor = Exception.class)
    public JSONObject create(String jsonData) {
    public JSONObject create(String jsonData,String proxyPatient) {
        logger.info("申请生活照料jsonData参数:" + jsonData);
        JSONObject result = new JSONObject();
        JSONObject jsonObjectParam;
        try {
            jsonObjectParam = JSONObject.parseObject(jsonData);
            if (jsonObjectParam.getInteger("type")==1||jsonObjectParam.getInteger("type")==2){
                //本人或家人代发起
                BasePatientDO patientDO = patientDao.findById(proxyPatient);
                jsonObjectParam.put("proxyPatient",proxyPatient);
                jsonObjectParam.put("proxyPatientName",patientDO.getName());
                jsonObjectParam.put("proxyPatientPhone",patientDO.getMobile());
            }
            if (jsonObjectParam.getInteger("type")==3) {//医生代发起
                BaseDoctorDO doctorDO = doctorDao.findById(proxyPatient);
                jsonObjectParam.put("proxyPatient",proxyPatient);
                jsonObjectParam.put("proxyPatientName",doctorDO.getName());
                jsonObjectParam.put("proxyPatientPhone",doctorDO.getMobile());
            }
        } catch (Exception e) {
            result.put(ResponseContant.resultFlag, ResponseContant.fail);
            String failMsg = "参数转换成JSON对象异常:" + e.getMessage();
@ -439,6 +461,11 @@ public class LifeCareOrderService extends BaseJpaService<LifeCareOrderDO, LifeCa
            return result;
        }
        if (StringUtils.isNotBlank(orderDO.getHospital())){
            BaseOrgDO orgDO = baseOrgDao.findByCode(orderDO.getHospital());
            orderDO.setHospitalName(orgDO.getName());
        }
        orderDO.setCreateTime(new Date());
        //判断创建生活照料类型,发起类型(1本人发起 2家人待预约 3医生代预约)
        if(orderDO.getProxyPatient().equals(orderDO.getPatient())){

+ 1 - 1
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/message/DoctorMessageService.java

@ -85,7 +85,7 @@ public class DoctorMessageService {
            sql+= "and  EXISTS ( SELECT 1 from base_service_package_sign_record sr,base_service_package_record r, base_service_package_item i ," +
                    "base_team_member m " +
                    "where ord.patient = CONVERT(sr.patient USING utf8) and  sr.id = r.sign_id and sr.status=1 and " +
                    " r.service_package_id = i.service_package_id and  m.team_code = i.team_code  and i.del = 1 and sr.`status`=1  and i.code='8' and m.doctor_code = '"+doctor+"' and m.del = '1') ";
                    " r.service_package_id = i.service_package_id and  m.team_code = i.team_code  and i.del = 1 and sr.`status`=1  and i.code='preventLost' and m.doctor_code = '"+doctor+"' and m.del = '1') ";
            sql+=" order by create_time asc ";
            Map<String,Object> sqlResult  = jdbcTemplate.queryForMap(sql);
            if (sqlResult.containsKey("count")){

+ 9 - 9
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/security/SecurityMonitoringOrderService.java

@ -123,7 +123,7 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit
        //签约防走失服务包
        String sql ="SELECT i.code from base_service_package_sign_record sr,base_service_package_record r, base_service_package_item i  \n" +
                "where  sr.id = r.sign_id and sr.status=1 and r.service_package_id = i.service_package_id   and i.del = 1 and sr.`status`=1 \n" +
                "and  sr.patient  = '"+orderDO.getPatient()+"' and i.code=8 ";
                "and  sr.patient  = '"+orderDO.getPatient()+"' and i.code='preventLost' ";
       List<String> items = jdbcTemplate.queryForList(sql,String.class);
        if (items.size()==0) {
            result.put("resultFlag", 0);
@ -220,7 +220,7 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit
            sql+=" and  EXISTS ( SELECT 1 from base_service_package_sign_record sr,base_service_package_record r, base_service_package_item i ," +
                    "base_team_member m " +
                    "where ord.patient = CONVERT(sr.patient USING utf8) and  sr.id = r.sign_id and sr.status=1 and " +
                    " r.service_package_id = i.service_package_id and  m.team_code = i.team_code  and i.del = 1 and sr.`status`=1  and i.code='8' and m.doctor_code = '"+doctor+"' and m.del = '1') ";
                    " r.service_package_id = i.service_package_id and  m.team_code = i.team_code  and i.del = 1 and sr.`status`=1  and i.code='preventLost' and m.doctor_code = '"+doctor+"' and m.del = '1') ";
        }
        if (StringUtils.isNotBlank(serverDoctor)){
            sql +=" and ord.doctor = '"+serverDoctor+"' ";
@ -297,7 +297,7 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit
        sql+= "and  EXISTS ( SELECT 1 from base_service_package_sign_record sr,base_service_package_record r, base_service_package_item i ," +
                "base_team_member m " +
                "where ord.patient = CONVERT(sr.patient USING utf8) and  sr.id = r.sign_id and sr.status=1 and " +
                " r.service_package_id = i.service_package_id and  m.team_code = i.team_code  and i.del = 1 and sr.`status`=1  and i.code='8' and m.doctor_code = '"+doctor+"' and m.del = '1') ";
                " r.service_package_id = i.service_package_id and  m.team_code = i.team_code  and i.del = 1 and sr.`status`=1  and i.code='preventLost' and m.doctor_code = '"+doctor+"' and m.del = '1') ";
        sql +=" order by ord.create_time asc ";
        result= jdbcTemplate.queryForList(sql);
        for (Map<String,Object> map:result){
@ -509,7 +509,7 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit
        JSONObject result = new JSONObject();
        SecurityMonitoringOrderDO orderDO = securityMonitoringOrderDao.findOne(orderId);
        if(null == orderDO){
            String failMsg = "【取消工单】该工单不存在:," + orderId;
            String failMsg = "【取消工单】该工单不存在" ;
            result.put("resultFlag", 0);
            result.put("resultMsg", failMsg);
            logger.error(failMsg);
@ -518,14 +518,14 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit
        //接单前可取消工单
        BaseDoctorDO doctorDO = baseDoctorDao.findById(doctor);
        if (doctorDO==null){
            String failMsg = "【取消工单】操作医生不存在," + orderId;
            String failMsg = "【取消工单】操作医生不存在";
            result.put("resultFlag", 0);
            result.put("resultMsg", failMsg);
            logger.error(failMsg);
            return result;
        }
        if(orderDO.getStatus() > SecurityMonitoringOrderDO.Status.waitForSend.getType()){
            String failMsg = "只有医生接单前的工单才可取消:," + orderId;
            String failMsg = "只有医生接单前的工单才可取消";
            result.put("resultFlag", 0);
            result.put("resultMsg", failMsg);
            logger.error(failMsg);
@ -596,7 +596,7 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit
            try {
                confirmLogDO = EntityUtils.jsonToEntity(confirmInfo.toString(), SecurityMonitoringOrderPatientConfirmLog.class);
            } catch (Exception e) {
                String failMsg = "工单关联【居民确认操作日志记录】时," + e.getMessage();
                String failMsg = "工单关联【居民确认操作日志记录】时出错";
                result.put("resultFlag", 0);
                result.put("resultMsg", failMsg);
                logger.error(failMsg);
@ -607,7 +607,7 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit
            try {
                securityMonitoringOrderPatientConfirmLogDao.save(confirmLogDO);
            } catch (Exception e) {
                String failMsg = "保存工单关联的【居民确认操作日志记录】时:," + e.getMessage();
                String failMsg = "保存工单关联的【居民确认操作日志记录】时出错";
                result.put("resultFlag", 0);
                result.put("resultMsg", failMsg);
                logger.error(failMsg);
@ -878,7 +878,7 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit
        //获取患者签约防走失服务的团队
        String sql="SELECT DISTINCT i.team_code from base_service_package_sign_record sr,base_service_package_record r, base_service_package_item i  \n" +
                "where  sr.id = r.sign_id and sr.status=1 and r.service_package_id = i.service_package_id   and i.del = 1 and sr.`status`=1 \n" +
                "and  sr.patient  = '"+patient+"' and i.code=8";
                "and  sr.patient  = '"+patient+"' and i.code=preventLost";
        List<String> teams = jdbcTemplate.queryForList(sql,String.class);
        List<Map<String,Object>> result = new ArrayList<>();
        if (teams.size()==0){

+ 4 - 2
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/sign/ArchiveService.java

@ -138,9 +138,11 @@ public class ArchiveService extends BaseJpaService<ArchiveDO, ArchiveDao> {
        patientDO.setUpdateTime(new Date());
        patientDO.setPatientStatus("1");
        if(!patientDao.existsByIdcardAndDel(idcard,"1")){
            patientDao.save(patientDO);
            patientDO = patientDao.save(patientDO);
        }
        else{
            patientDO = patientDao.findByIdcardAndDel(idcard,"1");
        }
        BaseDoctorDO doctorDO = doctorDao.findById(doctorId);
        ArchiveDO archiveDO = new ArchiveDO();
        archiveDO.setArchiveOperatorName(doctorDO.getName());