Parcourir la source

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

yeshijie il y a 7 ans
Parent
commit
15c5284e1c

+ 2 - 2
patient-co-service/wlyy_sign/src/main/java/com/yihu/wlyy/sign/common/thread/UploadChargeThread.java

@ -29,7 +29,7 @@ public class UploadChargeThread implements Runnable{
                {
                {
                    Boolean running = systemDictService.getUploadChargeRunning();
                    Boolean running = systemDictService.getUploadChargeRunning();
                    if(running) {
                    if(running) {
                        System.out.print(DateUtil.dateToStrLong(now) + " 上传缴费...\r\n");
//                        System.out.print(DateUtil.dateToStrLong(now) + " 上传缴费...\r\n");
                        try {
                        try {
                            service.uploadCharge();
                            service.uploadCharge();
                        }
                        }
@ -38,7 +38,7 @@ public class UploadChargeThread implements Runnable{
                            e.printStackTrace();
                            e.printStackTrace();
                        }
                        }
                        System.out.print(DateUtil.dateToStrLong(new Date()) + " 上传缴费记录结束。\r\n");
//                        System.out.print(DateUtil.dateToStrLong(new Date()) + " 上传缴费记录结束。\r\n");
                    }
                    }
                    Thread.sleep(sleepTime);
                    Thread.sleep(sleepTime);

+ 5 - 5
patient-co-service/wlyy_sign/src/main/java/com/yihu/wlyy/sign/common/thread/UploadThread.java

@ -30,8 +30,8 @@ public class UploadThread implements Runnable {
                Date now = new Date();
                Date now = new Date();
                //判断非空闲时候
                //判断非空闲时候
                if(now.getHours()>=morningHours &&  now.getHours() < nightHours)
                {
//                if(now.getHours()>=morningHours &&  now.getHours() < nightHours)---2017.11.15修改为不判断空闲非空闲
//                {
                    //签约上传
                    //签约上传
                    SignZYService signZYService = (SignZYService) SpringContextHolder.getSpringBean("SignZYService");
                    SignZYService signZYService = (SignZYService) SpringContextHolder.getSpringBean("SignZYService");
                    SystemDictService systemDictService = (SystemDictService) SpringContextHolder.getSpringBean("SystemDictService");
                    SystemDictService systemDictService = (SystemDictService) SpringContextHolder.getSpringBean("SystemDictService");
@ -56,9 +56,9 @@ public class UploadThread implements Runnable {
                        Thread.sleep(retryTime);
                        Thread.sleep(retryTime);
                        continue;
                        continue;
                    }
                    }
                }
                Thread.sleep(1000*sleepTime);
//                }
//
//                Thread.sleep(1000*sleepTime);
            }
            }
            catch (Exception ex)
            catch (Exception ex)
            {
            {

+ 2 - 0
patient-co-service/wlyy_sign/src/main/java/com/yihu/wlyy/sign/dao/SignFamilyRenewLogDao.java

@ -23,6 +23,8 @@ public interface SignFamilyRenewLogDao extends PagingAndSortingRepository<SignFa
    SignFamilyRenewLog findByProId(String proId);
    SignFamilyRenewLog findByProId(String proId);
    SignFamilyRenewLog findByRenewProId(String renewProId);
    SignFamilyRenewLog findByRenewProId(String renewProId);
    
    SignFamilyRenewLog findBySignCode(String signCode);
    SignFamilyRenewLog findByRenewSignCode(String renewSignCode);
    SignFamilyRenewLog findByRenewSignCode(String renewSignCode);

+ 50 - 1
patient-co-service/wlyy_sign/src/main/java/com/yihu/wlyy/sign/service/ChargeZYService.java

@ -6,11 +6,13 @@ import com.yihu.wlyy.sign.common.util.DateUtil;
import com.yihu.wlyy.sign.common.util.StringUtil;
import com.yihu.wlyy.sign.common.util.StringUtil;
import com.yihu.wlyy.sign.dao.*;
import com.yihu.wlyy.sign.dao.*;
import com.yihu.wlyy.sign.entity.*;
import com.yihu.wlyy.sign.entity.*;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.stereotype.Service;
import java.io.PrintWriter;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.io.StringWriter;
import java.util.Date;
import java.util.HashMap;
import java.util.HashMap;
import java.util.List;
import java.util.List;
import java.util.Map;
import java.util.Map;
@ -121,16 +123,62 @@ public class ChargeZYService {
                params.put("IDENTITY_CARD_NO", idcard);  //身份证
                params.put("IDENTITY_CARD_NO", idcard);  //身份证
                params.put("SIGN_MANAGE_YEAR", year);  //签约年度
                params.put("SIGN_MANAGE_YEAR", year);  //签约年度
                params.put("SICK_NAME", patient.getName());  //姓名
                params.put("SICK_NAME", patient.getName());  //姓名
                params.put("CHARGE_TIME", DateUtil.dateToStrLong(sign.getExpensesTime()));  //缴费时间
                
                if(sign.getExpensesTime() == null){
                    //如果签约表的支付时间为空,则从支付表获取支付时间
                    Date newdate = DateUtil.formatCharDateYMD(charge.getChargeTime(),"yyyyMMddHHmmss");
                    params.put("CHARGE_TIME", DateUtil.dateToStrLong(newdate));  //缴费时间
                    sign.setExpensesTime(newdate);
                    sign.setExpensesStatus("1");//已支付
                }else{
                    params.put("CHARGE_TIME", DateUtil.dateToStrLong(sign.getExpensesTime()));  //缴费时间
                }
                
               
                params.put("INSUR_PRO_ID", charge.getMiRegisterNo());  //医保签约号
                params.put("INSUR_PRO_ID", charge.getMiRegisterNo());  //医保签约号
                if("1".equals(sign.getRenewFlag())||"2".equals(sign.getRenewFlag())){
                if("1".equals(sign.getRenewFlag())||"2".equals(sign.getRenewFlag())){
                    proId = signFamilyRenewLogDao.getProId(signCode);
                    proId = signFamilyRenewLogDao.getProId(signCode);
                    if(StringUtils.isBlank(proId) || "0".equals(proId)){
                        
                        if("1".equals(sign.getSignSource())){
                            //如果是在基卫签约则需要更新同步
                            SignFamilyMapping signFamilyMapping = signFamilyMappingDao.findByCode(signCode);
                            signFamilyMapping.setNeedUpdate("1");
                            signFamilyMappingDao.save(signFamilyMapping);
                        }else{
                            //如果是网络签约则需要上传同步
                            SignFamilyRenewLog signFamilyRenewLog = signFamilyRenewLogDao.findBySignCode(signCode);
                            signFamilyRenewLog.setNeedUpload("1");
                            signFamilyRenewLogDao.save(signFamilyRenewLog);
                        }
    
                        //暂停30秒
                        Thread.sleep(30000);
                        return true;
                    }
                }else {
                }else {
                    proId = signFamilyMappingDao.getProId(signCode);
                    proId = signFamilyMappingDao.getProId(signCode);
                    if(StringUtils.isBlank(proId) || "0".equals(proId)){
    
                        SignFamilyMapping signFamilyMapping = signFamilyMappingDao.findByCode(signCode);
                        if("1".equals(sign.getSignSource())){
                            //如果是在基卫签约则需要更新同步
                            signFamilyMapping.setNeedUpdate("1");
                        }else{
                            //如果是网络签约则需要上传同步
                            signFamilyMapping.setNeedUpload("1");
                        }
                        signFamilyMappingDao.save(signFamilyMapping);
    
                        //暂停30秒
                        Thread.sleep(30000);
                        return true;
                    }
                }
                }
                params.put("PRO_ID", proId);  //标志(智业签约主键)
                params.put("PRO_ID", proId);  //标志(智业签约主键)
                operator = doctorMappingDao.findByDocotrCodeAndJwDoctorHospital(operator,hm[0]);  //【医生映射】
                operator = doctorMappingDao.findByDocotrCodeAndJwDoctorHospital(operator,hm[0]);  //【医生映射】
@ -160,6 +208,7 @@ public class ChargeZYService {
                if(isSuccess)
                if(isSuccess)
                {
                {
                    charge.setNeedUpload("0");
                    charge.setNeedUpload("0");
                    signFamilyDao.save(sign);
                }else {
                }else {
                    charge.setNeedUpload("2");
                    charge.setNeedUpload("2");
                    content = objectMapper.writeValueAsString(charge);
                    content = objectMapper.writeValueAsString(charge);

+ 56 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/followup/FollowUpService.java

@ -1047,7 +1047,23 @@ public class FollowUpService extends BaseService {
            followupContentESDOList = result.getSourceAsObjectList(FollowupContentESDO.class);
            followupContentESDOList = result.getSourceAsObjectList(FollowupContentESDO.class);
            if (!followupContentESDOList.isEmpty()) {
            if (!followupContentESDOList.isEmpty()) {
                for (FollowupContentESDO followupContentESDO : followupContentESDOList) {
                for (FollowupContentESDO followupContentESDO : followupContentESDOList) {
                    resultList.add(followupContentESDO.getFollowup_project());
                   
                    if("2".equals(followupContentESDO.getFollowup_project())){
                        //判断血压必填
                        if(StringUtils.isNotBlank(followupContentESDO.getBP_D()) && StringUtils.isNotBlank(followupContentESDO.getBP_U())){
                            resultList.add(followupContentESDO.getFollowup_project());
                        }
                    }else if("3".equals(followupContentESDO.getFollowup_project())){
                        //判断血糖必填
                        if(StringUtils.isNotBlank(followupContentESDO.getBS_FPG()) ||
                                StringUtils.isNotBlank(followupContentESDO.getNO_BS_FPG())||
                                    StringUtils.isNotBlank(followupContentESDO.getRANDOM_BLOOD_SUGAR())){
                            resultList.add(followupContentESDO.getFollowup_project());
                        }
                    }else{
                        resultList.add(followupContentESDO.getFollowup_project());
                    }
                    
                }
                }
            }
            }
@ -1146,4 +1162,43 @@ public class FollowUpService extends BaseService {
        return count;
        return count;
    }
    }
    
    /**
     * 检查随访记录是否可完成
     * @param followupid
     * @return
     */
    public boolean checkfollowupcompleted(String followupid)  throws Exception {
        boolean result = true;
    
        List<FollowupContentESDO> eslist = this.esfindFollowUpContestsByFollowupId(followupid);
    
        if (!eslist.isEmpty()) {
            for (FollowupContentESDO followupContentESDO : eslist) {
            
                if("2".equals(followupContentESDO.getFollowup_project())){
                    //判断血压必填
                    if(StringUtils.isBlank(followupContentESDO.getBP_D()) || StringUtils.isBlank(followupContentESDO.getBP_U())){
                        return false;
                    }
                }else if("3".equals(followupContentESDO.getFollowup_project())){
                    //判断血糖必填
                    if(StringUtils.isBlank(followupContentESDO.getBS_FPG()) &&
                            StringUtils.isBlank(followupContentESDO.getNO_BS_FPG()) &&
                            StringUtils.isBlank(followupContentESDO.getRANDOM_BLOOD_SUGAR())){
                        return false;
                    }
                }else if("5".equals(followupContentESDO.getFollowup_project())){
                    //判断评价
                    if(StringUtils.isBlank(followupContentESDO.getDIA_FOLLOWUP_TYPE_CODE()) &&
                            StringUtils.isBlank(followupContentESDO.getHYP_FOLLOWUP_TYPE_CODE())){
                        return false;
                    }
                }else{}
            
            }
        }
        
        return result;
    }
}
}

+ 8 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/reply/DoctorQuickReplyService.java

@ -164,16 +164,22 @@ public class DoctorQuickReplyService extends BaseService {
     * 排序回复
     * 排序回复
     *
     *
     * @param id
     * @param id
     * @param type
     * @return
     * @return
     */
     */
    public int sortReplyList(String id) {
    public int sortReplyList(String id,String type) {
        String[] ids = id.split(",");
        String[] ids = id.split(",");
        for (int i = 0; i < ids.length; i++) {
        for (int i = 0; i < ids.length; i++) {
            DoctorQuickReply reply = quickReplyDao.findOne(Long.valueOf(ids[i]));
            DoctorQuickReply reply = quickReplyDao.findOne(Long.valueOf(ids[i]));
            if (reply == null) {
            if (reply == null) {
                return -1;
                return -1;
            }
            }
            reply.setSort(ids.length - i);
            if("1".equals(type)){
                reply.setSort(i+1);
            }else{
                reply.setSort(ids.length - i);
            }
            
        }
        }
        return 1;
        return 1;
    }
    }

+ 16 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/followup/DoctorFollowUpController.java

@ -419,5 +419,21 @@ public class DoctorFollowUpController extends BaseController {
            return error(-1, "操作失败!");
            return error(-1, "操作失败!");
        }
        }
    }
    }
    
    @RequestMapping(value = "/checkfollowupcompleted", method = RequestMethod.GET)
    @ApiOperation("检查续方关联的随访记录是否对应的详情记录")
    public String checkfollowupcompleted(
            @ApiParam(name = "followupid", value = "随访ID", defaultValue = "")
            @RequestParam(value = "followupid", required = true) String followupid){
        try {
            boolean completed = followUpService.checkfollowupcompleted(followupid);
            return write(200, "操作成功!","data",completed);
        }catch (Exception e){
            //日志文件中记录异常信息
            error(e);
            //返回接口异常信息处理结果
            return error(-1, "操作失败!");
        }
    }
}
}

+ 4 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/reply/DoctorQuickReplyController.java

@ -131,13 +131,15 @@ public class DoctorQuickReplyController extends BaseController {
    @RequestMapping(value = "/sortList", method = RequestMethod.POST)
    @RequestMapping(value = "/sortList", method = RequestMethod.POST)
    @ApiOperation(value = "快捷回复排序")
    @ApiOperation(value = "快捷回复排序")
    public String sortReplyList(@RequestParam @ApiParam(value = "快捷回复ID")String id) {
    public String sortReplyList(@RequestParam @ApiParam(value = "快捷回复ID")String id,
                                @ApiParam(name = "type", value = "快捷回复类型(1为续方咨询)", defaultValue = "0")
                                @RequestParam(value = "type", required = false, defaultValue = "0") String type) {
        try {
        try {
            if (StringUtils.isEmpty(id)) {
            if (StringUtils.isEmpty(id)) {
                return error(-1, "请输入排序后的回复ID");
                return error(-1, "请输入排序后的回复ID");
            }
            }
            int result = quickReplyService.sortReplyList(id);
            int result = quickReplyService.sortReplyList(id,type);
            if (result == 1) {
            if (result == 1) {
                return write(200, "排序成功");
                return write(200, "排序成功");