Bläddra i källkod

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

yeshijie 7 år sedan
förälder
incheckning
1da73c3652

+ 6 - 5
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/manager/healthbank/ActivityController.java

@ -5,7 +5,8 @@ import com.yihu.wlyy.controller.BaseController;
import com.yihu.wlyy.service.manager.healthbank.ActivityService;
import com.yihu.wlyy.util.fastdfs.FastDFSUtil;
import io.swagger.annotations.ApiParam;
import org.json.JSONObject;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -61,7 +62,6 @@ public class ActivityController extends BaseController {
            @RequestParam(value = "rows",required = false) Integer pageSize){
        try{
            return write(200,"操作成功","detailModelList",activityService.searchList(activity, page, pageSize).get("detailModelList"));
//            return write(200,"操作成功");
        }catch (Exception ex){
            error(ex);
            return error(-1,"操作失败!");
@ -133,10 +133,11 @@ public class ActivityController extends BaseController {
    @RequestMapping(value = "delete")
    @ResponseBody
    public String delete(String id) {
    public String delete(@RequestParam(value = "id") String id) {
        try {
            String jsonData = "{\"id\":\""+ id + "\"}";
            activityService.delete(jsonData);
            String[] ids = {id};
            String s = JSONArray.fromObject(ids).toString();
            activityService.delete(s);
            return write(200, "操作成功" );
        }catch (Exception ex){
            error(ex);

+ 15 - 0
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/manager/healthbank/TaskController.java

@ -2,6 +2,7 @@ package com.yihu.wlyy.controller.manager.healthbank;
import com.yihu.wlyy.controller.BaseController;
import com.yihu.wlyy.service.manager.healthbank.TaskService;
import net.sf.json.JSONArray;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@ -87,4 +88,18 @@ public class TaskController extends BaseController {
            return error(-1,"操作失败!");
        }
    }
    @RequestMapping(value = "delete")
    @ResponseBody
    public String delete(@RequestParam(value = "id") String id) {
        try {
            String[] ids = {id};
            String s = JSONArray.fromObject(ids).toString();
            taskService.delete(s);
            return write(200, "操作成功" );
        }catch (Exception ex){
            error(ex);
            return error(-1,"操作失败!");
        }
    }
}

+ 15 - 0
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/manager/healthbank/TaskRuleController.java

@ -2,6 +2,7 @@ package com.yihu.wlyy.controller.manager.healthbank;
import com.yihu.wlyy.controller.BaseController;
import com.yihu.wlyy.service.manager.healthbank.TaskRuleService;
import net.sf.json.JSONArray;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@ -87,4 +88,18 @@ public class TaskRuleController extends BaseController {
            return error(-1,"操作失败!");
        }
    }
    @RequestMapping(value = "delete")
    @ResponseBody
    public String delete(@RequestParam(value = "id") String id) {
        try {
            String[] ids = {id};
            String s = JSONArray.fromObject(ids).toString();
            taskRuleService.delete(s);
            return write(200, "操作成功" );
        }catch (Exception ex){
            error(ex);
            return error(-1,"操作失败!");
        }
    }
}

+ 2 - 2
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/manager/healthbank/ActivityService.java

@ -68,11 +68,11 @@ public class ActivityService {
        return JSONObject.parseObject(response);
    }
    public JSONObject delete(String jsonData) {
    public JSONObject delete(String ids) {
        String url = baseUrl + "batchActivity";
        String response = "";
        Map<String,String> params = new HashMap<>();
        params.put("ids",jsonData);
        params.put("ids",ids);
        try {
            response = httpClientUtil.httpPost(url,params);
        } catch (Exception e) {

+ 13 - 0
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/manager/healthbank/TaskRuleService.java

@ -67,4 +67,17 @@ public class TaskRuleService {
        }
        return JSONObject.parseObject(response);
    }
    public JSONObject delete(String ids) {
        String url = baseUrl + "batchTaskRule";
        String response = "";
        Map<String,String> params = new HashMap<>();
        params.put("ids",ids);
        try {
            response = httpClientUtil.httpPost(url,params);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return JSONObject.parseObject(response);
    }
}

+ 13 - 0
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/manager/healthbank/TaskService.java

@ -67,4 +67,17 @@ public class TaskService {
        }
        return JSONObject.parseObject(response);
    }
    public JSONObject delete(String ids) {
        String url = baseUrl + "batchTask";
        String response = "";
        Map<String,String> params = new HashMap<>();
        params.put("ids",ids);
        try {
            response = httpClientUtil.httpPost(url,params);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return JSONObject.parseObject(response);
    }
}

+ 9 - 3
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/wechat/WechatService.java

@ -10,6 +10,7 @@ import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
@ -31,7 +32,12 @@ public class WechatService extends BaseService {
	 * @return
	 */
	public List<WechatSignVO> geSignWechatDataList(String hospital,String attention) {
		
		Calendar a = Calendar.getInstance();
		int year = a.get(Calendar.YEAR)-1;
		int month = a.get(Calendar.MONTH)+1;
		if(month >= 7){
			year = a.get(Calendar.YEAR);
		}
		List<WechatSignVO> list = new ArrayList<>();
		String sql  = "";
		if("1".equals(attention)){
@ -50,7 +56,7 @@ public class WechatService extends BaseService {
					"t.street_name FROM (" +
					"SELECT b.patient,b.mobile,b.idcard,b.doctor_name,b.doctor_health_name,b.hospital_name FROM wlyy_sign_family b WHERE b.hospital='"+hospital+"' AND b.sign_year=2017 AND b.STATUS=1 AND b.expenses_status=1) a,wlyy_patient t WHERE t.CODE=a.patient) m," +
					"(SELECT t.openid,count(t.openid) tcount FROM wlyy_patient t WHERE t.`code` IN (" +
					"SELECT patient FROM wlyy_sign_family s WHERE s.hospital='"+hospital+"' AND s.sign_year=2017 AND s.expenses_status=1 AND s.STATUS=1) GROUP BY t.openid) n WHERE m.openid=n.openid";
					"SELECT patient FROM wlyy_sign_family s WHERE s.hospital='"+hospital+"' AND s.sign_year='"+year+"' AND s.expenses_status=1 AND s.STATUS=1) GROUP BY t.openid) n WHERE m.openid=n.openid";
		}else if("0".equals(attention)){
			sql = "SELECT m.*FROM (" +
					"SELECT a.mobile," +
@ -65,7 +71,7 @@ public class WechatService extends BaseService {
					"a.sick_village_name," +
					"a.street_name FROM (" +
					"SELECT t.CODE,t.NAME,t.address,t.sick_village_name,t.street_name,idcard,mobile,openid_time FROM wlyy_patient t WHERE t.`code` IN (" +
					"SELECT patient FROM wlyy_sign_family s WHERE s.hospital='"+hospital+"' AND s.sign_year=2017 AND s.expenses_status=1 AND s.STATUS=1 AND s.expenses_time IS NOT NULL) AND t.openid IS NULL) a,wlyy_sign_family b WHERE b.hospital='"+hospital+"' AND b.sign_year=2017 AND b.STATUS=1 AND b.expenses_status=1 AND a.CODE=b.patient AND b.expenses_time IS NOT NULL) m";
					"SELECT patient FROM wlyy_sign_family s WHERE s.hospital='"+hospital+"' AND s.sign_year='"+year+"' AND s.expenses_status=1 AND s.STATUS=1 AND s.expenses_time IS NOT NULL) AND t.openid IS NULL) a,wlyy_sign_family b WHERE b.hospital='"+hospital+"' AND b.sign_year=2017 AND b.STATUS=1 AND b.expenses_status=1 AND a.CODE=b.patient AND b.expenses_time IS NOT NULL) m";
		}
		

+ 4 - 1
patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/healthbank/activity_list.jsp

@ -18,7 +18,7 @@
    <div class="m-activity-area f-h50 f-dn f-pr m-form-inline" data-role-form style='display: block;'>
        <div class="m-form-group f-mt10">
            <div class="m-form-control f-ml15">
                <input type="text" id="inp_title" placeholder="请输入活动名称" class="f-ml10" data-attr-scan="title"/>
                <input type="text" id="inp_title" placeholder="请输入活动标题" class="f-ml10" data-attr-scan="title"/>
            </div>
            <div class="m-form-control f-ml15">
                <input type="text" id="inp_location" placeholder="请输入活动地点" class="f-ml10" data-attr-scan="location"/>
@ -26,6 +26,9 @@
            <div class="m-form-control f-ml15">
                <input type="text" id="inp_type" placeholder="请输入活动类型" class="f-ml10" data-attr-scan="type"/>
            </div>
            <div class="m-form-control f-ml15">
                <input type="text" id="inp_status" placeholder="请输入状态" class="f-ml10" data-attr-scan="status"/>
            </div>
            <div class="m-form-control f-ml15">
                <input type="text" id="inp_start_time" placeholder="请输入活动开始时间" class="f-ml10" data-attr-scan="startTime"/>
            </div>

+ 14 - 5
patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/healthbank/activity_list_js.jsp

@ -33,6 +33,7 @@
                $title: $("#inp_title"),//活动名称
                $type: $("#inp_type"),
                $location: $("#inp_location"),
                $status: $("#inp_status"),//状态
                $startTime: $("#inp_start_time"),
                $endTime: $("#inp_end_time"),
                init: function () {
@ -42,6 +43,14 @@
                    this.$title.ligerTextBox({width: 200});
                    this.$type.ligerTextBox({width: 200});
                    this.$location.ligerTextBox({width: 200});
                    this.statusBox = this.$status.ligerComboBox({
                        width: 200,
                        data: [
                            {text: '报名中', id: '1'},
                            {text: '进行时', id: '0'},
                            {text: '已结束', id: '-1'},
                        ]
                    });
                    this.$startTime.ligerDateEditor({
                        format: "yyyy-MM-dd",
                        showTime: false,
@ -93,13 +102,13 @@
                                display: '活动状态', name: 'status', width: '10%', align: "left",
                                render: function (row) {
                                    if (row.status == 1) {
                                        return "有效"
                                        return "报名中"
                                    }
                                    if (row.status == 0) {
                                        return "无效"
                                        return "进行时"
                                    }
                                    if (row.status == -1) {
                                        return "过期"
                                        return "已结束"
                                    }
                                }
                            },
@ -112,9 +121,9 @@
                                    <sec:authorize url="/admin/activity/update">
                                    html += '<a  style="margin-left:10px;"href="javascript:void(0)" onclick="javascript:' + Util.format("$.publish('{0}',['{1}'])", "activity:info:edit", row.id) + '">编辑</a>';
                                    </sec:authorize>
                                    <sec:authorize url="/admin/activity/delete">
                                    <%--<sec:authorize url="/admin/activity/delete">
                                    html += '<a  style="margin-left:10px;"href="javascript:void(0)" onclick="javascript:' + Util.format("$.publish('{0}',['{1}'])", "activity:info:del", row.id) + '">删除</a>';
                                    </sec:authorize>
                                    </sec:authorize>--%>
                                    return html;
                                }
                            }

+ 7 - 4
patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/healthbank/activity_modify_js.jsp

@ -47,9 +47,9 @@
                    $("#inp_status").ligerComboBox({
                        width: 240,
                        data: [
                            {text: '有效', id: '1'},
                            {text: '无效', id: '0'},
                            {text: '过期', id: '-1'},
                            {text: '报名中', id: '1'},
                            {text: '进行时', id: '0'},
                            {text: '已结束', id: '-1'},
                        ]
                    })//状态
                    $("#inp_isFlag").ligerComboBox({
@ -130,6 +130,7 @@
                                $("#inp_isFlag").ligerComboBox("selectValue",data.isFlag);
                                $("#inp_areaType").ligerComboBox("selectValue",data.areaType);
                                if(data.img != null) {
                                    _this.$imgUrl = data.img;
                                    var length = data.img.split(',').length;
                                    $('#img_upload').after('<li id="url">' + length + '张图片</li>');
                                }
@ -166,7 +167,9 @@
                    var self = this;
                    $("#btn_save").click(function () {
                        var values = self.$form.Fields.getValues();
                        values.img = self.$imgUrl;
                        if(values.img != '') {
                            values.img = self.$imgUrl;
                        }
                        values.status = $("#inp_status").ligerComboBox("getValue");
                        values.isFlag = $("#inp_isFlag").ligerComboBox("getValue");
                        values.areaType = $("#inp_areaType").ligerComboBox("getValue");