Browse Source

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

trick9191 8 years ago
parent
commit
1392a796d2

+ 1 - 1
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/sign/FamilyContractService.java

@ -3041,7 +3041,7 @@ public class FamilyContractService extends BaseService {
            JSONObject jsonObject = doctorWorkTimeService.isDoctorWorking(doctor);
            if (jsonObject.getString("status").equals("1")) {
                //如果在工作时间内就推送
                PushMsgTask.getInstance().put(doctor, MessageType.MESSAGE_TYPE_DOCTOR_NEW_SIGN_WEB.D_SW_01.name(), MessageType.MESSAGE_TYPE_DOCTOR_NEW_SIGN_WEB.家庭签约.name(), "您有一条新的家庭签约申请!", patient);
                PushMsgTask.getInstance().put(doctor, MessageType.MESSAGE_TYPE_DOCTOR_NEW_SIGN_WEB.D_SW_01.name(), MessageType.MESSAGE_TYPE_DOCTOR_NEW_SIGN_WEB.家庭签约.name(), p.getName()+"申请与您续签家庭医生", patient);
            }
        }

+ 2 - 2
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/sign/SignWebService.java

@ -910,7 +910,7 @@ public class SignWebService extends BaseService {
                        renew.setStatus(1);
                    }
                }
                renew.setStatus(1);
                renew.setApplyDate(new Date());
                signFamilyRenewDao.save(renew);
                //发送微信模板消息
@ -984,7 +984,7 @@ public class SignWebService extends BaseService {
    public JSONObject getOverDuePatients(String year,Long teamCode,Integer page,Integer pageSize){
        StringBuffer sql = new StringBuffer("SELECT IFNULL(year( from_days( datediff( now(), p.birthday))),'未知') age," +
                "t.patient code,t.idcard,t.name,t.mobile,t.openid," +
                "t.ssc,t.sign_type signType,p.sex " +
                "t.ssc,t.sign_type signType,p.sex ,t.expenses_status expensesStatus " +
                " FROM wlyy_sign_family t " +
                " LEFT JOIN wlyy_patient p ON t.patient = p.code " +
                " WHERE t.admin_team_code ="+teamCode+" AND t.sign_year ='"+year+"' AND t.status =-4 LIMIT "+page*pageSize+","+pageSize);

+ 3 - 2
patient-co-wlyy/src/main/java/com/yihu/wlyy/task/PushMsgTask.java

@ -529,9 +529,10 @@ public class PushMsgTask {
                WechatTemplateData  keyword1= new WechatTemplateData();
                keyword1.setColor("#000000");
                keyword1.setValue(json.getString("keyword1"));
                m.put("keyword1", keyword1);
                WechatTemplateData  keyword2= new WechatTemplateData();
                keyword1.setColor("#000000");
                keyword1.setValue(json.getString("keyword2"));
                keyword2.setColor("#000000");
                keyword2.setValue(json.getString("keyword2"));
                m.put("keyword2", keyword2);
            }

+ 33 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/util/ValueComparator.java

@ -0,0 +1,33 @@
package com.yihu.wlyy.util;
import org.json.JSONObject;
import java.util.Comparator;
import java.util.Map;
import java.util.jar.JarEntry;
/**
 * Created by Trick on 2017/5/24.
 */
public class ValueComparator implements Comparator<String> {
    Map<String, JSONObject> base;
    //这里需要将要比较的map集合传进来
    public ValueComparator(Map<String, JSONObject> base) {
        this.base = base;
    }
    // Note: this comparator imposes orderings that are inconsistent with equals.
    //比较的时候,传入的两个参数应该是map的两个key,根据上面传入的要比较的集合base,可以获取到key对应的value,然后按照value进行比较
    public int compare(String a, String b) {
        JSONObject j1 =  base.get(a);
        JSONObject j2 =  base.get(b);
        j1.get("amount");
        j2.get("amount");
        if((Long)j1.get("amount")>=(Long)j2.get("amount")){
            return -1;
        }
        return 1;
    }
}

+ 6 - 5
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/sign/DoctorSignController.java

@ -424,8 +424,8 @@ public class DoctorSignController extends WeixinBaseController {
    @ApiOperation(value = "提醒用户签约")
    public String sendRenewToPatients(){
        try{
            int rs = signWebService.sendRenewToPatients(getAccessToken(),getUID());
            //int rs = signWebService.sendRenewToPatients(getAccessToken(),"64de930c-5b15-11e6-8344-fa163e8aee56");
            //int rs = signWebService.sendRenewToPatients(getAccessToken(),getUID());
            int rs = signWebService.sendRenewToPatients(getAccessToken(),"64de930c-5b15-11e6-8344-fa163e8aee56");
            if(rs == 0){
                return error(-1, "微信和短信,提醒失败");
            }else{
@ -447,8 +447,8 @@ public class DoctorSignController extends WeixinBaseController {
    public String agreeRenew(@RequestParam(required = true)String state,
                             @RequestParam(required = true)String patient){
        try{
            //int rs =signWebService.agreeRenew(getAccessToken(),getUID(),patient,state);
            int rs =signWebService.agreeRenew(getAccessToken(),"test00000000005",patient,state);
            int rs =signWebService.agreeRenew(getAccessToken(),getUID(),patient,state);
//            int rs =signWebService.agreeRenew(getAccessToken(),"test00000000005",patient,state);
            if(rs == 0){
                return error(-1, "操作失败");
            }else{
@ -522,7 +522,8 @@ public class DoctorSignController extends WeixinBaseController {
    @ApiOperation(value = "提醒居民续签")
    public String remindPatientRenew(@RequestParam(required = true)String patient){
        try{
            int rs =signWebService.remainPatientRenew(getAccessToken(),patient,getUID());
            //int rs =signWebService.remainPatientRenew(getAccessToken(),patient,getUID());
            int rs =signWebService.remainPatientRenew(getAccessToken(),patient,"test00000000006");
            if(rs==-1){
                return error(-1, "提醒失败");
            }else if(rs ==1){

+ 8 - 3
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/statistic/StatisticsController.java

@ -3,6 +3,7 @@ package com.yihu.wlyy.web.statistic;
import com.yihu.wlyy.entity.statistics.PopulationBase;
import com.yihu.wlyy.service.app.statistics.StatisticsAllService;
import com.yihu.wlyy.service.app.statistics.StatisticsService;
import com.yihu.wlyy.util.ValueComparator;
import com.yihu.wlyy.web.BaseController;
import io.swagger.annotations.Api;
import org.apache.commons.lang3.StringUtils;
@ -258,12 +259,15 @@ public class StatisticsController extends BaseController {
                }
            } else {
                //如果是2个指标的时候,分别放入map中,以减少查询次数
                Map<String,JSONObject> index1=new HashMap<>();
                Map<String,JSONObject> index2=new HashMap<>();
                Map<String,JSONObject> in =new TreeMap<>();
                ValueComparator vc = new ValueComparator(in);
                Map<String,JSONObject> index2=new TreeMap<>();
                for (int i = 0; i < jsonArrays.get(0).length(); i++) {
                    JSONObject map1 = jsonArrays.get(0).getJSONObject(i);
                    index1.put(map1.get("code").toString(),map1);
                    in.put(map1.get("code").toString(),map1);
                }
                Map<String,JSONObject> index1 =new TreeMap<>(vc);
                index1.putAll(in);
                for (int i = 0; i < jsonArrays.get(1).length(); i++) {
                    JSONObject map1 = jsonArrays.get(1).getJSONObject(i);
@ -701,4 +705,5 @@ public class StatisticsController extends BaseController {
        }
    }
}

+ 33 - 33
patient-co-wlyy/src/main/resources/application.properties

@ -52,23 +52,23 @@
#redis.testOnBorrow=true
##------------------------------------�����������ݿ�����------------------------------------#
#### mysql database setting
#jdbc.driver=com.mysql.jdbc.Driver
#jdbc.url=jdbc:mysql://172.19.103.77/wlyy?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
#jdbc.username=root
#jdbc.password=123456
#
##### health index
#health.jdbc.driver=com.mysql.jdbc.Driver
#health.jdbc.url=jdbc:mysql://172.19.103.77/device?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
#health.jdbc.username=root
#health.jdbc.password=123456
#
##### suifang
#fv.jdbc.driver=com.mysql.jdbc.Driver
#fv.jdbc.url=jdbc:mysql://172.19.103.77/fv?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
#fv.jdbc.username=root
#fv.jdbc.password=123456
### mysql database setting
jdbc.driver=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://172.19.103.77/wlyy?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
jdbc.username=root
jdbc.password=123456
#### health index
health.jdbc.driver=com.mysql.jdbc.Driver
health.jdbc.url=jdbc:mysql://172.19.103.77/device?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
health.jdbc.username=root
health.jdbc.password=123456
#### suifang
fv.jdbc.driver=com.mysql.jdbc.Driver
fv.jdbc.url=jdbc:mysql://172.19.103.77/fv?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
fv.jdbc.username=root
fv.jdbc.password=123456
#### redis
redis.host=172.19.103.47
@ -76,23 +76,23 @@ redis.port=6379
redis.password=
#---------------------------------���Ի������ݿ�����---------------------------------------#
##### mysql database setting
jdbc.driver=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://172.19.103.85/wlyy?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
jdbc.username=linzhou
jdbc.password=linzhou
##### health index
health.jdbc.driver=com.mysql.jdbc.Driver
health.jdbc.url=jdbc:mysql://172.19.103.85/device?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
health.jdbc.username=linzhou
health.jdbc.password=linzhou
##### suifang
fv.jdbc.driver=com.mysql.jdbc.Driver
fv.jdbc.url=jdbc:mysql://172.19.103.85/fv?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
fv.jdbc.username=linzhou
fv.jdbc.password=linzhou
#jdbc.driver=com.mysql.jdbc.Driver
#jdbc.url=jdbc:mysql://172.19.103.85/wlyy?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
#jdbc.username=linzhou
#jdbc.password=linzhou
#
###### health index
#health.jdbc.driver=com.mysql.jdbc.Driver
#health.jdbc.url=jdbc:mysql://172.19.103.85/device?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
#health.jdbc.username=linzhou
#health.jdbc.password=linzhou
#
###### suifang
#fv.jdbc.driver=com.mysql.jdbc.Driver
#fv.jdbc.url=jdbc:mysql://172.19.103.85/fv?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
#fv.jdbc.username=linzhou
#fv.jdbc.password=linzhou
##
###### redis
#redis.host=172.19.103.88
#redis.port=6379

+ 4 - 4
patient-co-wlyy/src/main/webapp/WEB-INF/spring-mvc.xml

@ -77,14 +77,14 @@
	</bean>
	
	<mvc:interceptors>
		<mvc:interceptor>
<!--		<mvc:interceptor>
	        <mvc:mapping path="/patient/**"/>
	        <bean class="com.yihu.wlyy.interceptors.PatientInterceptor"/>
	    </mvc:interceptor>
	    <mvc:interceptor>
	    </mvc:interceptor>-->
	    <!--<mvc:interceptor>
	        <mvc:mapping path="/doctor/**"/>
	        <bean class="com.yihu.wlyy.interceptors.DoctorInterceptor"/>
	    </mvc:interceptor>
	    </mvc:interceptor>-->
	    <mvc:interceptor>
	        <mvc:mapping path="/user/**"/>
	        <bean class="com.yihu.wlyy.interceptors.UserInterceptor"/>