liubing 4 years ago
parent
commit
660e9282db

+ 64 - 4
svr/svr-door-serivce/src/main/java/com/yihu/jw/door/controller/doctor/DoctorController.java

@ -1,21 +1,27 @@
package com.yihu.jw.door.controller.doctor;
import com.alibaba.fastjson.JSON;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
import com.yihu.jw.doctor.dao.BaseDoctorHospitalDao;
import com.yihu.jw.door.controller.BaseController;
import com.yihu.jw.door.service.common.WlyyMessageService;
import com.yihu.jw.door.service.common.PatientService;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.org.BaseOrgDO;
import com.yihu.jw.entity.hospital.message.SystemMessageDO;
import com.yihu.jw.org.dao.BaseOrgDao;
import com.yihu.jw.patient.dao.BasePatientDao;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.List;
/**
 * Created by yeshijie on 2020/12/30.
@ -33,6 +39,48 @@ public class DoctorController extends BaseController {
    private BasePatientDao patientDao;
    @Autowired
    private PatientService patientService;
    @Autowired
    private BaseOrgDao orgDao;
    @Autowired
    private WlyyMessageService messageService;
    @RequestMapping(value = "message/getWaitingMessages",method = RequestMethod.GET)
    @ApiOperation("获取服务工单待接单列表")
    public String getWaitingMessages(
            @ApiParam(name = "message",value = "消息对象")
            @RequestParam(value = "message")String message,
            @ApiParam(name="types",value="消息类型")
            @RequestParam(value="types",required = true) String types,
            @ApiParam(name="page",value="第几页",defaultValue = "1")
            @RequestParam(value="page",required = true) String page,
            @ApiParam(name="pageSize",value="",defaultValue = "10")
            @RequestParam(value="pageSize",required = true) String pageSize){
        if (StringUtils.isBlank(pageSize)) {
            pageSize = "10";
        }
        if (page.equals("0")) {
            page = "1";
        }
        String[] split = StringUtils.split(types, ",");
        List<Integer> typeList = new ArrayList<>();
        for (String s : split) {
            typeList.add(Integer.valueOf(s));
        }
        SystemMessageDO message1 = new SystemMessageDO();
        com.alibaba.fastjson.JSONObject object = JSON.parseObject(message);
        message1.setOver(object.getString("over"));
        message1.setIsRead(object.get("read")+"");
        message1.setReceiver(getUID());
        try {
            JSONObject waitingMessages = messageService.getWaitingMessages(message1, types, Integer.valueOf(page), Integer.valueOf(pageSize));
            return write(200, "查询成功","data",waitingMessages);
        }catch (Exception e){
            error(e);
            return error( -1, "查询失败!");
        }
    }
    /**
     * 查询居民信息
@ -55,6 +103,18 @@ public class DoctorController extends BaseController {
        }
    }
    @GetMapping(value = "getHospitalInfoByCode")
    @ApiOperation("根据机构code获取机构信息")
    public String getHospitalInfoByCode(String code) {
        try {
            BaseOrgDO baseOrgDO = orgDao.findByCode(code);
            return write(200, "查询成功", "data", baseOrgDO);
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败");
        }
    }
    /**
     * 医生基本信息查询接口
     *

+ 14 - 1
svr/svr-door-serivce/src/main/java/com/yihu/jw/door/controller/doctor/DoorOrderController.java

@ -243,7 +243,7 @@ public class DoorOrderController extends BaseController {
            @ApiParam(value = "二维码内容", name = "twoDimensionalCode")
            @RequestParam(value = "twoDimensionalCode", required = false) String twoDimensionalCode) {
        try {
            WlyyDoorServiceOrderDO wlyyDoorServiceOrderDO = doorOrderService.signIn(orderId, signTime, signWay, signLocation, signImg,twoDimensionalCode);
            WlyyDoorServiceOrderDO wlyyDoorServiceOrderDO = doorOrderService.signIn(orderId, signTime, signWay, signLocation, signImg,twoDimensionalCode,getUID());
            if (wlyyDoorServiceOrderDO != null){
                return write(200, "操作成功", "data", wlyyDoorServiceOrderDO);
            }else {
@ -935,6 +935,19 @@ public class DoorOrderController extends BaseController {
        }
    }
    @PostMapping(value = "savePrescription")
    @ApiOperation("上门服务前手工开方接口")
    public String savePrescription(@ApiParam(name = "orderId", value = "工单id", required = true) @RequestParam String orderId,
                                     @ApiParam(name = "prescriptionCode", value = "处方单号,多个用逗号隔开", required = true) @RequestParam String prescriptionCode) {
        try {
            wlyyDoorServiceOrderService.savePrescription(orderId, prescriptionCode);
            return write(200, "操作成功");
        } catch (Exception e) {
            error(e);
            return error(-1, "操作失败");
        }
    }
    @PostMapping(value = "createPrescription")
    @ResponseBody
    @ApiOperation("上门服务前手工开方接口")

+ 41 - 4
svr/svr-door-serivce/src/main/java/com/yihu/jw/door/service/DoorOrderService.java

@ -20,6 +20,7 @@ import com.yihu.jw.message.dao.MessageDao;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.util.common.IdCardUtil;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.util.http.HttpClientUtil;
import jxl.Workbook;
import jxl.write.*;
import org.apache.commons.collections.CollectionUtils;
@ -115,6 +116,11 @@ public class DoorOrderService {
    private WlyyDoorServiceOrderDao wlyyDoorServiceOrderDao;
    @Autowired
    private WlyyDoorFeeDetailDao wlyyDoorFeeDetailDao;
    @Value("${base.hospitalUrl}")
    private String hospitalUrl;
    @Autowired
    private HttpClientUtil httpClientUtil;
    @Value("${wechat.id}")
    private String wxId;
    @Autowired
@ -164,9 +170,15 @@ public class DoorOrderService {
        if (!map.containsKey("completed")) {
            map.put("completed", "0");
        }
        if(!map.containsKey("exampaperstatus")){
        //待补录
        String sqlCount = "SELECT COUNT(DISTINCT o.id) FROM wlyy_door_service_order o LEFT JOIN wlyy_door_doctor d ON d.order_id = o.id " +
                "WHERE o.conclusion_status = 1 and (d.doctor='"+doctor+"' or o.doctor='"+doctor+"')";
        Integer count = jdbcTemplate.queryForObject(sqlCount,Integer.class);
        map.put("exampaperstatus", String.valueOf(count));
/*        if(!map.containsKey("exampaperstatus")){
            map.put("exampaperstatus", "0");
        }
        }*/
        return map;
    }
@ -368,14 +380,15 @@ public class DoorOrderService {
     * @param signImg
     * @return
     */
    public WlyyDoorServiceOrderDO signIn(String orderId, String signTime, Integer signWay, String signLocation, String signImg, String twoDimensionalCode) throws Exception {
    public WlyyDoorServiceOrderDO signIn(String orderId, String signTime, Integer signWay, String signLocation,
                                         String signImg, String twoDimensionalCode,String doctorId) throws Exception {
        WlyyDoorServiceOrderDO doorServiceOrder = this.doorServiceOrderDao.findOne(orderId);
        doorServiceOrder.setDoctorSignTime(DateUtil.strToDate(signTime));
        doorServiceOrder.setDoctorSignWay(signWay);
        // 签到方式-2扫码时,需要去解析地址
        doorServiceOrder.setDoctorSignLocation(signLocation);
        doorServiceOrder.setDoctorSignImg(StringUtils.isEmpty(signImg) ? null : signImg);
        doorServiceOrder.setStatus(4);
        if(signWay == 4 ){//扫码签到
            if (twoDimensionalCode.equals(doorServiceOrder.getNumber())){
@ -383,6 +396,7 @@ public class DoorOrderService {
                doorServiceOrder = doorServiceOrderDao.save(doorServiceOrder);
                // 修改医生上门服务工单状态 4服务中
                this.updateDispatchStatusBySystem(doorServiceOrder.getDoctor(), 4);
                appointmentRevisitOnDoor(doorServiceOrder,doctorId);
                return doorServiceOrder;
            }else {
                logger.info("扫码签到失败");
@ -393,10 +407,33 @@ public class DoorOrderService {
            doorServiceOrder = doorServiceOrderDao.save(doorServiceOrder);
            // 修改医生上门服务工单状态 4服务中
            this.updateDispatchStatusBySystem(doorServiceOrder.getDoctor(), 4);
            appointmentRevisitOnDoor(doorServiceOrder,doctorId);
            return doorServiceOrder;
        }
    }
    /**
     * 挂号
     * @param orderDO
     * @param doctorId
     */
    public void appointmentRevisitOnDoor(WlyyDoorServiceOrderDO orderDO,String doctorId){
        BaseDoctorDO doctorDO = doctorDao.findById(doctorId);
        JSONObject outpatientJson = new JSONObject();
        outpatientJson.put("hospital",orderDO.getHospital());
        outpatientJson.put("patient",orderDO.getPatient());
        outpatientJson.put("patientName",orderDO.getPatientName());
        outpatientJson.put("mobile",orderDO.getPatientPhone());
        outpatientJson.put("doctor",doctorId);
        outpatientJson.put("doctorName",doctorDO.getName());
        String url = hospitalUrl + "/open/noLogin/appointmentRevisitOnDoor";
        JSONObject json = new JSONObject();
        json.put("outpatientJson", outpatientJson);
        String res = httpClientUtil.postBody(url,json);
        System.out.println("appointmentRevisitOnDoor res:"+res);
    }
    /**
     * 编辑保存服务工单小结
     * @param model

+ 61 - 43
svr/svr-door-serivce/src/main/java/com/yihu/jw/door/service/WlyyDoorServiceOrderService.java

@ -55,7 +55,6 @@ import java.io.IOException;
import java.io.InputStream;
import java.math.BigDecimal;
import java.nio.charset.Charset;
import java.text.SimpleDateFormat;
import java.util.*;
/**
@ -1404,6 +1403,20 @@ public class WlyyDoorServiceOrderService extends BaseJpaService<WlyyDoorServiceO
                );
            }
        }
//        else if(type == WlyyDoorServiceOrderDO.CancelType.patient.getType()){                   //居民取消,消息列表也应该不显示
//
//            List<Message> messages = messageDao.queryByRelationCodeAndTypeIn(orderId,new Integer[]{402,403});
//            if(CollectionUtils.isEmpty(messages)){
//                logger.error("当前工单没有系统消息!!orderId:" + orderId);
//            } else {
//                messages.forEach(
//                        message -> {
//                            message.setOver("0");
//                            messageDao.save(message);
//                        }
//                );
//            }
//        }
        //如果是调度员取消,推送IM取消工单json消息,
/*        if(type == WlyyDoorServiceOrderDO.CancelType.dispatcher.getType()){
            JSONObject content = this.queryOrderCardInfo(orderDO);
@ -1825,6 +1838,24 @@ public class WlyyDoorServiceOrderService extends BaseJpaService<WlyyDoorServiceO
        }else if (StringUtils.isNoneBlank(phone)){
            buffer.append(" AND o.`proxy_patient_phone` like '%"+phone+"%'");
        }
        String applicationSql = "";
        String patientTypeTemp = "";
        if("1".equals(isApplication)){
            applicationSql +=                 " JOIN ( " +
                    "         select a.patient, group_concat(v.type) as type " +
                    "         from wlyy_door_service_voucher v " +
                    "                  JOIN (select t.id, t.patient, max(t.create_time) " +
                    "                        from wlyy_door_service_application t " +
                    "                        where t.status in (2, 3) " +
                    "                        group by t.patient) as a " +
                    "                       on a.id = v.service_id " +
                    "         where v.status = 1 " +
                    "         group by a.patient " +
                    "        ) as t1 on o.patient = t1.patient" ;
            patientTypeTemp = " ,t1.`type` as patientType ";
        }
        String sql = "SELECT " +
                "  p.name AS patientName, " +
                "  p.photo AS photo, " +
@ -1844,23 +1875,12 @@ public class WlyyDoorServiceOrderService extends BaseJpaService<WlyyDoorServiceO
                "  o.serve_lat as lat, " +
                "  o.`status` as status, " +
                "  o.`dispatcher_name` as dispatcherName, " +
                "  concat( o.patient,'_' ,c.id, '_',o.`number`,'_11' ) as sessionId, " +
                "   t1.`type` as patientType " +
                "  concat( o.patient,'_' ,c.id, '_',o.`number`,'_11' ) as sessionId " +
                patientTypeTemp +
                " FROM " +
                " ( wlyy_door_service_order o " +
                " LEFT JOIN base_patient p ON o.patient = p.id ) LEFT JOIN wlyy_consult c on o.id = c.relation_code" +
                " JOIN ( " +
                "         select a.patient, group_concat(v.type) as type " +
                "         from wlyy_door_service_voucher v " +
                "                  JOIN (select t.id, t.patient, max(t.create_time) " +
                "                        from wlyy_door_service_application t " +
                "                        where t.status in (2, 3) " +
                "                        group by t.patient) as a " +
                "                       on a.id = v.service_id " +
                "         where v.status = 1 " +
                "         group by a.patient " +
                "        ) as t1 on o.patient = t1.patient" +
                " WHERE " +
                " LEFT JOIN base_patient p ON o.patient = p.id ) LEFT JOIN wlyy_consult c on o.id = c.relation_code"+
                applicationSql+" WHERE " +
                "  o.hospital = '{hospital}' and o.type != 3 " +buffer+
                " AND ( o.`status` = {status} OR -100 = {status} ) " +
                " ORDER BY o.create_time desc " +
@ -1877,17 +1897,7 @@ public class WlyyDoorServiceOrderService extends BaseJpaService<WlyyDoorServiceO
                " FROM  " +
                "   wlyy_door_service_order o  " +
                " LEFT JOIN base_patient p ON o.patient = p.id " +
                " JOIN  ( " +
                "         select a.patient, group_concat(v.type) as type " +
                "         from wlyy_door_service_voucher v " +
                "                  JOIN (select t.id, t.patient, max(t.create_time) " +
                "                        from wlyy_door_service_application t " +
                "                        where t.status in (2, 3) " +
                "                        group by t.patient) as a " +
                "                       on a.id = v.service_id " +
                "         where v.status = 1 " +
                "         group by a.patient " +
                "        ) as t1 on o.patient = t1.patient" +
                applicationSql +
                " WHERE  " +
                "  o.hospital = '{hospital}' " +buffer+
                " AND (o.`status` = {status} or -100 = {status})";
@ -1932,7 +1942,7 @@ public class WlyyDoorServiceOrderService extends BaseJpaService<WlyyDoorServiceO
                    JSONArray parArray = imUtill.getParticipants(sessionId);
                    parArray.forEach(
                            oneParObj -> {
                                org.json.JSONObject oneParJson = (org.json.JSONObject)oneParObj;
                                JSONObject oneParJson = (com.alibaba.fastjson.JSONObject)oneParObj;
                                if(StringUtils.equalsIgnoreCase(oneParJson.getString("id"),dispatcher)){
                                    oneMap.put("isInSession",true);
                                }
@ -2126,7 +2136,7 @@ public class WlyyDoorServiceOrderService extends BaseJpaService<WlyyDoorServiceO
        int start = 0 == page ? page++ : (page - 1) * size;
        int end = 0 == size ? 15 : page * size;
        String sql = "select ds.doctor,d.name, d.job_name as jobName, 1 as sortFlag " +
        String sql = "select ds.doctor,d.name, d.job_title_name as jobName, 1 as sortFlag " +
                " from wlyy_door_doctor_status ds " +
                "        JOIN (select b.* from base_doctor b,base_doctor_hospital dh where b.id=dh.doctor_code and dh.del = 1 and dh.org_code='" + hospital + "')  d on ds.doctor = d.id " +
                " where ds.status in (1,2,3,4)" +
@ -2134,7 +2144,7 @@ public class WlyyDoorServiceOrderService extends BaseJpaService<WlyyDoorServiceO
        String countSql = "select count(ds.id) " +
                "from wlyy_door_doctor_status ds " +
                "         JOIN (select b.* from base_doctor b,base_doctor_hospital dh where b.id=dh.doctor_code and dh.del = 1 and dh.org_code= '" + hospital + "') d on ds.doctor = d.code " +
                "         JOIN (select b.* from base_doctor b,base_doctor_hospital dh where b.id=dh.doctor_code and dh.del = 1 and dh.org_code= '" + hospital + "') d on ds.doctor = d.id " +
                "where ds.status in (1,2,3,4)";
        List<Map<String,Object>> doctorList = new ArrayList<>();
        try {
@ -2479,8 +2489,8 @@ public class WlyyDoorServiceOrderService extends BaseJpaService<WlyyDoorServiceO
        messageDO.setReceiverName(ReceiverName);
        net.sf.json.JSONObject data = new net.sf.json.JSONObject();
        data.put("name", ReceiverName);
        data.put("age", IdCardUtil.getAgeForIdcard(idCard));
        try {
            data.put("age", IdCardUtil.getAgeForIdcard(idCard));
            data.put("gender", IdCardUtil.getSexForIdcard(idCard));
        } catch (Exception e) {
            e.printStackTrace();
@ -2630,6 +2640,26 @@ public class WlyyDoorServiceOrderService extends BaseJpaService<WlyyDoorServiceO
        return res;
    }
    /**
     * 互联网医院开方后 关联上门工单
     * @param orderId
     * @param prescriptionCode
     */
    public void savePrescription(String orderId,String prescriptionCode){
        WlyyDoorServiceOrderDO orderDO = wlyyDoorServiceOrderDao.findOne(orderId);
        orderDO.setPrescriptionCode(prescriptionCode);
        orderDO.setPrescriptionTime(new Date());
        orderDO.setPrescriptionStatus(1);
        wlyyDoorServiceOrderDao.save(orderDO);
        //非代预约才发送im消息
        if(orderDO.getType() != null && orderDO.getType() != 3) {
            //发送 预约卡片信息(2101类型)
            JSONObject orderInfoContent = this.queryOrderCardInfo(orderDO);
            orderInfoContent.put("re_msg_type", 2);//开方完成消息
            this.qucikSendIM(orderDO.getId(), orderDO.getDispatcher(), "智能助手", "2101", orderInfoContent.toJSONString());
        }
    }
    /**
     *  更新医生地理位置状态
@ -2754,15 +2784,6 @@ public class WlyyDoorServiceOrderService extends BaseJpaService<WlyyDoorServiceO
        }
        //判断工单是否已存在,新建或者编辑
        if(StringUtils.isBlank(orderDO.getId())) {
/*            SignFamily signFamily = signFamilyDao.findSignFamilyByPatient(orderDO.getPatient());
            if (signFamily == null) {
                result.put(ResponseContant.resultFlag, ResponseContant.fail);
                String failMsg = "当前服务对象未完成家庭医生签约,请完成签约后再预约上门服务!";
                result.put(ResponseContant.resultMsg, failMsg);
                logger.error(failMsg);
                return result;
            }*/
            //已取消的订单也可以申请
            boolean bool = wlyyDoorServiceOrderDao.existsByPatientAndStatusIn(orderDO.getPatient(),
                    new Integer[]{WlyyDoorServiceOrderDO.Status.waitForAccept.getType(),
@ -2818,9 +2839,6 @@ public class WlyyDoorServiceOrderService extends BaseJpaService<WlyyDoorServiceO
                sql += " and d.id = '"+orderDO.getDoctor()+"'";
                List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
/*                BaseDoctorDO doctor = doctorDao.findById(orderDO.getDoctor());
                Hospital hospital = hospitalDao.findByCode(doctor.getHospital());
                doorOrderService.acceptOrder1(orderDO.getId(), doctor.getJob(), doctor.getJobName(), hospital.getLevel());*/
                doorOrderService.acceptOrder1(orderDO.getId(), list.get(0).get("job_title_code").toString(),
                        list.get(0).get("job_title_name").toString(), Integer.valueOf(list.get(0).get("org_level").toString()));
            }catch (Exception e){

+ 10 - 2
svr/svr-door-serivce/src/main/java/com/yihu/jw/door/service/common/PatientService.java

@ -2,8 +2,10 @@ package com.yihu.jw.door.service.common;
import com.yihu.jw.door.dao.common.SignFamilyDao;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.base.patient.PatientMedicareCardDO;
import com.yihu.jw.entity.door.SignFamily;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.patient.dao.BasePatientMedicareCardDao;
import com.yihu.jw.util.common.IdCardUtil;
import com.yihu.jw.util.date.DateUtil;
import org.apache.commons.lang3.StringUtils;
@ -22,6 +24,8 @@ public class PatientService {
    private BasePatientDao patientDao;
    @Autowired
    private SignFamilyDao signFamilyDao;
    @Autowired
    private BasePatientMedicareCardDao patientMedicareCardDao;
    /**
     * 查询单个居民信息
@ -34,10 +38,12 @@ public class PatientService {
        JSONObject json = new JSONObject();
        BasePatientDO p = patientDao.findById(patient);
        PatientMedicareCardDO medicareCardDO = patientMedicareCardDao.findByTypeAndPatientCodeAndDel("A_01",patient,"1");
        if (p == null) {
            throw new Exception("patient info can not find");
        }
        // 设置患者标识
        json.put("code", p.getId());
        // 设置患者姓名
@ -66,8 +72,10 @@ public class PatientService {
        json.put("streetName", p.getStreetName());
        // 设置患者地址
        json.put("address", p.getAddress());
        // 社保号
//        json.put("ssc", p.getSsc());
        // 社保号/医保卡
        if(medicareCardDO!=null){
            json.put("ssc", medicareCardDO.getCode());
        }
        //病情类型:0健康,1高血压,2糖尿病,(1,2)高血压+糖尿病
/*        json.put("disease",p.getDisease());

+ 80 - 0
svr/svr-door-serivce/src/main/java/com/yihu/jw/door/service/common/WlyyMessageService.java

@ -0,0 +1,80 @@
package com.yihu.jw.door.service.common;
import com.alibaba.fastjson.JSONArray;
import com.yihu.jw.entity.hospital.message.SystemMessageDO;
import com.yihu.jw.util.date.DateUtil;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
 * Created by yeshijie on 2021/1/4.
 */
@Service
public class WlyyMessageService {
    @Autowired
    private JdbcTemplate jdbcTemplate;
    /**
     * 获取待接单的接口
     *
     * @param message {"read":1,"over":0}
     * @param page 页码
     * @param size 分页大小
     * @return
     * @throws Exception
     */
    public JSONObject getWaitingMessages(SystemMessageDO message, String types, Integer page, Integer size) throws Exception{
        String sqlList = " SELECT a.*, b.`status` AS appliStatus ";
        String sqlCount = " select count(*) as total ";
        String sql =  " FROM base_system_message a " +
                " LEFT JOIN wlyy_door_service_application b ON a.relation_code = b.id ";
//        sql+= " where 1=1 AND a.state = 1 AND a.over = 1 ";
        sql+= " where a.del='1' AND a.over = 1  ";
        if(!StringUtils.isEmpty(message.getReceiver())){
            sql+=" AND a.receiver = '"+message.getReceiver()+"'";
        }
        if(!StringUtils.isEmpty(types)){
            sql+=" AND a.type IN ("+types+")";
        }
        List<Map<String,Object>> rstotal = jdbcTemplate.queryForList(sqlCount+sql);
        sql+=" ORDER BY a.create_time DESC LIMIT "+(page-1)*size+","+size;
        List<Map<String,Object>> mapList = jdbcTemplate.queryForList(sqlList+sql);
        Long count = 0L;
        if(rstotal!=null&&rstotal.size()>0){
            count = (Long) rstotal.get(0).get("total");
        }
        JSONArray jsonArray = new JSONArray();
        for(Map<String,Object> one:mapList){
            JSONObject object = new JSONObject();
            object.put("over",one.get("over"));
            object.put("receiver",one.get("receiver"));
            object.put("del",one.get("del"));
            object.put("title",one.get("title"));
            object.put("type",one.get("type"));
            object.put("content",one.get("content"));
            object.put("sender",one.get("sender"));
            object.put("id",one.get("id"));
            object.put("relation_code",one.get("relation_code"));
            object.put("has_read",one.get("is_read"));
            object.put("appliStatus",one.get("appliStatus"));
            Date date = (Date)one.get("create_time");
            object.put("create_time", DateUtil.dateToStr(date,"yyyy-MM-dd HH:mm:ss"));
            Date date1 = (Date)one.get("czrq");
            object.put("czrq", DateUtil.dateToStr(date1,"yyyy-MM-dd HH:mm:ss"));
            jsonArray.add(object);
        }
        JSONObject object = new JSONObject();
        object.put("total",count);
        object.put("waitingMessages",jsonArray);
        object.put("currPage",page);
        object.put("pageSize",size);
        return object;
    }
}