Explorar o código

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

trick9191 %!s(int64=7) %!d(string=hai) anos
pai
achega
d61a540022

+ 6 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/patient/scheme/PatientSchemeListDao.java

@ -6,6 +6,8 @@ import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
/**
 * 监测方案关联关系表
 * @author huangwenjie
@ -18,4 +20,8 @@ public interface PatientSchemeListDao extends
    @Modifying
    @Query("delete PatientSchemeList where patientcode=?1 and type=?2")
    void delByPatientCode(String patientcode, int i);
    List<PatientSchemeList> findByPatientcodeAndSchemecodeAndType(String patientcode,String schemecode,Integer type);
    List<PatientSchemeList> findBySchemecode(String schemecode);
}

+ 19 - 4
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/scheme/DoctorSchemeService.java

@ -588,13 +588,17 @@ public class DoctorSchemeService extends BaseService{
    public void delDoctorScheme(String doctorcode, String schemecode, String type) throws Exception{
        if("1".equals(type)){
            doctroSchemeBloodSuggerDao.updateDelStatus(1,doctorcode,schemecode);
        }
        if("2".equals(type)){
            doctoreSchemeBloodPressureDao.updateDelStatus(1,doctorcode,schemecode);
        }
        List<PatientSchemeList> list = patientSchemeListDao.findBySchemecode(schemecode);
        if(list!=null&&list.size()>0){
            patientSchemeListDao.delete(list);
        }
    }
    public Map<String,Object> getPatientHealthIndex(String patient,String startDate,String endDate,String type){
@ -1965,15 +1969,26 @@ public class DoctorSchemeService extends BaseService{
        return rs;
    }
    @Transactional
    public String setPatientDefaultScheme(String patient,String type){
        PatientSchemeList pl = new PatientSchemeList();
        pl.setPatientcode(patient);
        pl.setCode(getCode());
        if("0".equals(type)){
        if("1".equals(type)){
            List<PatientSchemeList> list = patientSchemeListDao.findByPatientcodeAndSchemecodeAndType(patient,"default",1);
            if(list!=null&&list.size()>0){
                return "-1";
            }
            pl.setType(1);
        }else{
            List<PatientSchemeList> list = patientSchemeListDao.findByPatientcodeAndSchemecodeAndType(patient,"default",2);
            if(list!=null&&list.size()>0){
                return "-1";
            }
            pl.setType(2);
        }
        pl.setPatientcode(patient);
        pl.setCode(getCode());
        pl.setSchemecode("default");
        pl.setCreateTime(new Date());
        patientSchemeListDao.save(pl);

+ 2 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/patient/SignPatientLabelInfoController.java

@ -189,7 +189,7 @@ public class SignPatientLabelInfoController extends BaseController {
                                        @RequestParam(required = false) boolean isFollowWeChat,
                                        @RequestParam(required = false) String trackFlag,
                                        @RequestParam(required = false) String startDate,
                                        @RequestParam(required = false) String enddate) {
                                        @RequestParam(required = false) String endDate) {
        try {
            if (StringUtils.isEmpty(labelCode)) {
                return error(-1, "标签cdoe不能为空");
@ -210,7 +210,7 @@ public class SignPatientLabelInfoController extends BaseController {
                return write(200, "查询成功", "data", jsonObject);
            }
            JSONArray result = labelInfoService.getPatientByLabel(getUID(), labelCode, labelType, teamCode, page, pagesize,isSlowDisease,diseaseCondition,isFollowWeChat,trackFlag,startDate,enddate);
            JSONArray result = labelInfoService.getPatientByLabel(getUID(), labelCode, labelType, teamCode, page, pagesize,isSlowDisease,diseaseCondition,isFollowWeChat,trackFlag,startDate,endDate);
//            JSONArray result = labelInfoService.getPatientByLabel("xy201703150222", labelCode, labelType, teamCode, page, pagesize,isSlowDisease,diseaseCondition,isFollowWeChat);
            return write(200, "查询成功", "data", result);

+ 5 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/scheme/PatientSchemeController.java

@ -121,7 +121,11 @@ public class PatientSchemeController extends BaseController {
    @ApiOperation("设置居民监测列表")
    public String setPatientDefaultScheme(@ApiParam(name="type", value="1.糖尿病,2.高血压") @RequestParam(value = "type",required = true)String type){
        try {
            return write(200, "设置成功", "data",doctorSchemeService.setPatientDefaultScheme(getUID(),type));
            String rs = doctorSchemeService.setPatientDefaultScheme(getUID(),type);
            if("-1".equals(rs)){
                return error(-1, "居民监测列表已经存在");
            }
            return write(200, "设置成功", "data",rs);
        }catch (Exception e){
            error(e);
            //返回接口异常信息处理结果

+ 13 - 3
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/wechat/process/WeiXinEventProcess.java

@ -1,5 +1,7 @@
package com.yihu.wlyy.wechat.process;
import com.yihu.wlyy.entity.dict.SystemDict;
import com.yihu.wlyy.repository.dict.SystemDictDao;
import com.yihu.wlyy.task.PushMsgTask;
import com.yihu.wlyy.util.SystemConf;
import com.yihu.wlyy.wechat.util.WeiXinMessageReplyUtils;
@ -37,6 +39,8 @@ public class WeiXinEventProcess {
    @Autowired
    private JdbcTemplate jdbcTemplate;
    @Autowired
    private SystemDictDao systemDictDao;
    /**
     * 微信推送事件处理
@ -408,12 +412,13 @@ public class WeiXinEventProcess {
                if(cout>0){
                    Map<String, String> articleConsult = new HashMap<>();
                    // 图文URL
                    String urlConsult = systemConf.getProperty("patient_wifi_url");
                    String urlConsult = getSystemWifiUrl();
                    logger.info("hslq_Wifi_total_URL:"+urlConsult);
                    // 图文消息图片URL
                    String picUrlConsult = systemConf.getProperty("patient_wifi_pic_url");
                    // URL设置服务器URL、AppId
                    urlConsult = urlConsult.replace("{server}", wechat_base_url)
                            .replace("{appId}", appId);
//                    urlConsult = urlConsult.replace("{server}", wechat_base_url)
//                            .replace("{appId}", appId);
                    //图片地址
                    picUrlConsult = picUrlConsult.replace("{server}", serverUrl);
@ -430,6 +435,11 @@ public class WeiXinEventProcess {
        }
    }
    public String getSystemWifiUrl(){
        List<SystemDict> systemDicts =  systemDictDao.findByDictName("HSLQ_WIFI");
        return systemDicts.get(0).getCode();
    }
    /**
     * 设置微信公共的图文消息
     *