Browse Source

Merge branch 'dev' of liuwenbin/wlyy2.0 into dev

liuwenbin 6 years ago
parent
commit
53f5a3223d

+ 6 - 4
business/base-service/src/main/java/com/yihu/jw/message/dao/MessageDao.java

@ -1,12 +1,11 @@
package com.yihu.jw.message.dao;
import com.yihu.jw.entity.base.message.BaseMessageDO;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.Date;
import java.util.List;
/**
@ -14,11 +13,14 @@ import java.util.List;
 */
public interface MessageDao extends PagingAndSortingRepository<BaseMessageDO, String>, JpaSpecificationExecutor<BaseMessageDO> {
    @Query("select m from BaseMessageDO m where m.platform=?1 and m.receiver=?2 and m.saasId=?3 and m.del=1 and m.msgTypeCode like ?4 order by m.readState desc")
    @Query("select m from BaseMessageDO m where m.platform=?1 and m.receiver=?2 and m.saasId=?3 and m.del=1 and m.msgTypeCode like ?4 and m.type=2 order by m.readState desc")
    List<BaseMessageDO> messageList(Integer platform, String code, String saasId,String msgTypeCode);
    @Query("select count(m.id) from BaseMessageDO m where m.platform=?1 and m.receiver=?2 and m.saasId=?3 and m.del=1 and m.msgTypeCode like ?4 and m.readState=1")
    @Query("select count(m.id) from BaseMessageDO m where m.platform=?1 and m.receiver=?2 and m.saasId=?3 and m.del=1 and m.msgTypeCode like ?4 and m.type=2 and m.readState=1")
    Integer countMessage(Integer platform, String code, String saasId,String msgTypeCode);
    BaseMessageDO findById(Integer id);
    @Query("select m from BaseMessageDO m where m.receiver=?1 and m.type=1 and m.failureTime>=?2 and m.msgTypeCode=?3")
    List<BaseMessageDO> applyMessageList(String patient,Date failureTime,String msgTypeCode);
}

+ 6 - 0
business/base-service/src/main/java/com/yihu/jw/message/service/MessageService.java

@ -9,6 +9,7 @@ import org.springframework.data.domain.Sort;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
@ -103,6 +104,11 @@ public class MessageService extends BaseJpaService<BaseMessageDO, MessageDao> {
    }
    public List<BaseMessageDO> applyMessageList(String patient, Date failureTime, String msgTypeCode){
        return messageDao.applyMessageList(patient,failureTime,msgTypeCode);
    }
    private List<Map<String, Object>> messageListSql(Integer platform,String code,String saasId,Integer readState,Integer page,Integer pageSize){

+ 2 - 0
business/base-service/src/main/java/com/yihu/jw/patient/dao/BasePatientDao.java

@ -17,6 +17,8 @@ public interface BasePatientDao extends PagingAndSortingRepository<BasePatientDO
    BasePatientDO findByIdAndDel(String id, String del);
    BasePatientDO findByMobileAndDel(String mobile, String del);
    @Query("select id as id,idcard as idcard,name as name,case sex when 1 then '男' when 2 then '女' else '未知' end as sex,phone as phone,committeeName as committeeName,concat(provinceName,cityName,townName,streetName) as address from BasePatientDO where idcard like ?1")
    List<Map<String,Object>> findByIdcard(String idcard, Pageable pageable);

+ 13 - 0
business/base-service/src/main/java/com/yihu/jw/patient/service/BasePatientService.java

@ -176,4 +176,17 @@ public class BasePatientService<T, R extends CrudRepository> extends BaseJpaServ
        return basePatientDO;
    }
    /**
     * 根据patient的id获取居民信息
     * @param mobile
     * @return
     */
    public BasePatientDO findByMobileAndDel(String mobile) throws Exception{
        BasePatientDO basePatientDO = basePatientDao.findByMobileAndDel(mobile,"1");
        if(basePatientDO==null){
            throw new Exception("not patient");
        }
        return basePatientDO;
    }
}

+ 28 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/message/BaseMessageDO.java

@ -117,6 +117,16 @@ public class BaseMessageDO extends IntegerIdentityEntity {
     */
    private String relationData;
    /**
     * 消息存续类型(1、时效性,2、非时效性)
     */
    private Integer type;
    /**
     * 消息失效时间
     */
    private Date failureTime;
    @Column(name = "saas_id")
    public String getSaasId() {
@ -297,4 +307,22 @@ public class BaseMessageDO extends IntegerIdentityEntity {
    public void setRelationData(String relationData) {
        this.relationData = relationData;
    }
    @Column(name = "type")
    public Integer getType() {
        return type;
    }
    public void setType(Integer type) {
        this.type = type;
    }
    @Column(name = "failure_time")
    public Date getFailureTime() {
        return failureTime;
    }
    public void setFailureTime(Date failureTime) {
        this.failureTime = failureTime;
    }
}

+ 1 - 1
common/common-entity/src/main/java/com/yihu/jw/entity/myFamily/PatientApplyLog.java

@ -19,7 +19,7 @@ public class PatientApplyLog extends IntegerIdentityEntity {
    private String familyMemberCode;//家庭成员code
    private String qrCode;//二维码地址
    private Date failureTime;//失效时间
    private Integer status;//1、添加家人(默认),2、邀请登录,3、通过,4、拒绝
    private Integer status;//1、添加家人(默认),2、邀请登录,3、通过,4、拒绝,5、申请人主动终止申请
    private Integer del;//删除标志(1正常,0删除)申请人主动终止申请
    private Date createTime;//创建时间
    private String createUser;//申请人

+ 6 - 0
common/common-request-mapping/src/main/java/com/yihu/jw/rm/patient/PatientRequestMapping.java

@ -49,6 +49,12 @@ public class PatientRequestMapping {
        public static final String PREFIX  = "/myFamily";
        public static final String getMyFamilyBindingRole  = "/getMyFamilyBindingRole";
        public static final String getBindingList  = "/getBindingList";
        public static final String bindingMyFamily  = "/bindingMyFamily";
        public static final String createFamilyQrCode  = "/createFamilyQrCode";
        public static final String remindMyFamily  = "/remindMyFamily";
        public static final String confirmApply  = "/confirmApply";
        public static final String applyMessageList  = "/applyMessageList";
        public static final String cancelApply  = "/cancelApply";
    }

+ 5 - 0
svr/svr-patient/src/main/java/com/yihu/jw/patient/dao/myFamily/PatientApplyLogDao.java

@ -1,5 +1,6 @@
package com.yihu.jw.patient.dao.myFamily;
import com.sun.tools.javac.util.List;
import com.yihu.jw.entity.myFamily.PatientApplyLog;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
@ -17,4 +18,8 @@ public interface PatientApplyLogDao extends PagingAndSortingRepository<PatientAp
    PatientApplyLog findById(Integer id);
    @Modifying
    @Query("update PatientApplyLog t set t.status = ?1 where t.id=?2 ")
    int updateStatusById(Integer status,Integer id);
}

+ 111 - 4
svr/svr-patient/src/main/java/com/yihu/jw/patient/endpoint/myFamily/MyFamilyEndpoint.java

@ -1,6 +1,9 @@
package com.yihu.jw.patient.endpoint.myFamily;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.myFamily.PatientApplyLog;
import com.yihu.jw.patient.service.myFamily.MyFamilyService;
import com.yihu.jw.patient.service.personal_Info.PatientService;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.patient.PatientRequestMapping;
@ -8,11 +11,9 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
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 javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;
@ -26,6 +27,8 @@ public class MyFamilyEndpoint extends EnvelopRestEndpoint {
    @Autowired
    private MyFamilyService myFamilyService;
    @Autowired
    private PatientService patientService;
    @GetMapping(value = PatientRequestMapping.MyFamily.getMyFamilyBindingRole)
    @ApiOperation(value = "获取我的家人")
@ -55,5 +58,109 @@ public class MyFamilyEndpoint extends EnvelopRestEndpoint {
        }
    }
    @PostMapping(value = PatientRequestMapping.MyFamily.bindingMyFamily)
    @ApiOperation(value = "一键绑定家人")
    public Envelop bindingMyFamily(
            @ApiParam(name = "patient", value = "居民code", required = false)
            @RequestParam(value = "patient",required = false) String patient,
            @ApiParam(name = "wechatId", value = "wechatId", required = true)
            @RequestParam(value = "wechatId",required = true) String wechatId,
            @ApiParam(name = "saasId", value = "saasId", required = true)
            @RequestParam(value = "saasId",required = true) String saasId,
            @ApiParam(name = "familyMobile", value = "家人的手机号码", required = true)
            @RequestParam(value = "familyMobile",required = true) String familyMobile,
            @ApiParam(name = "familyBindRole", value = "家庭关系关系 1配偶 2父亲 3母亲 4公公 5婆婆 6岳父 7岳母 8子女", required = true)
            @RequestParam(value = "familyBindRole",required = true) Integer familyBindRole,HttpServletRequest request) throws Exception {
        try{
            PatientApplyLog patientApplyLog = myFamilyService.bindingMyFamily(request,wechatId, saasId, getUID(patient), familyMobile, 1,familyBindRole);
            return success(patientApplyLog);
        }catch (Exception e){
            e.printStackTrace();
            return failed(e.getMessage());
        }
    }
    @PostMapping(value = PatientRequestMapping.MyFamily.createFamilyQrCode)
    @ApiOperation(value = "生成绑定家人的二维码")
    public Envelop createFamilyQrCode(
            @ApiParam(name = "patient", value = "居民code", required = false)
            @RequestParam(value = "patient",required = false) String patient,
            @ApiParam(name = "familyMobile", value = "家人的手机号码", required = true)
            @RequestParam(value = "familyMobile",required = true) String familyMobile,
            @ApiParam(name = "wechatId", value = "wechatId", required = true)
            @RequestParam(value = "wechatId",required = true) String wechatId,
            @ApiParam(name = "familyBindRole", value = "家庭关系关系 1配偶 2父亲 3母亲 4公公 5婆婆 6岳父 7岳母 8子女", required = true)
            @RequestParam(value = "familyBindRole",required = true) Integer familyBindRole,HttpServletRequest request) throws Exception {
        try{
            BasePatientDO familyPatient = patientService.findByMobileAndDel(familyMobile);
            PatientApplyLog patientApplyLog = myFamilyService.createFamilyQrCode(request,familyPatient,wechatId, getUID(patient),familyBindRole);
            return success(patientApplyLog.getQrCode());
        }catch (Exception e){
            e.printStackTrace();
            return failed(e.getMessage());
        }
    }
    @PostMapping(value = PatientRequestMapping.MyFamily.remindMyFamily)
    @ApiOperation(value = "绑定家人界面提醒家人通过")
    public Envelop remindMyFamily(
            @ApiParam(name = "patientApplyLogId", value = "patientApplyLogId", required = true)
            @RequestParam(value = "patientApplyLogId",required = true) Integer patientApplyLogId,
            @ApiParam(name = "remindType", value = "提醒方式(1、打电话,2、发短信,3、微信)", required = true)
            @RequestParam(value = "remindType",required = true) Integer remindType) throws Exception {
        try{
            myFamilyService.remindMyFamily(patientApplyLogId,remindType);
            return success();
        }catch (Exception e){
            e.printStackTrace();
            return failed(e.getMessage());
        }
    }
    @GetMapping(value = PatientRequestMapping.MyFamily.applyMessageList)
    @ApiOperation(value = "有效的申请绑定消息")
    public Envelop applyMessageList(
            @ApiParam(name = "patient", value = "居民code", required = false)
            @RequestParam(value = "patient",required = false) String patient) throws Exception {
        try{
            List<Map<String,Object>> messageList = myFamilyService.applyMessageList(getUID(patient));
            return success(messageList);
        }catch (Exception e){
            e.printStackTrace();
            return failed(e.getMessage());
        }
    }
    @PostMapping(value = PatientRequestMapping.MyFamily.confirmApply)
    @ApiOperation(value = "家人确认绑定")
    public Envelop confirmApply(
            @ApiParam(name = "patientApplyLogId", value = "patientApplyLogId", required = true)
            @RequestParam(value = "patientApplyLogId",required = true) Integer patientApplyLogId,
            @ApiParam(name = "status", value = "3、通过,4、拒绝", required = true)
            @RequestParam(value = "status",required = true) Integer status,
            @ApiParam(name = "isAuthorize", value = "0:未授权,1:已授权", required = true)
            @RequestParam(value = "isAuthorize",required = true) Integer isAuthorize) throws Exception {
        try{
            myFamilyService.confirmApply(patientApplyLogId,status,isAuthorize);
            return success();
        }catch (Exception e){
            e.printStackTrace();
            return failed(e.getMessage());
        }
    }
    @PostMapping(value = PatientRequestMapping.MyFamily.cancelApply)
    @ApiOperation(value = "取消申请绑定家人")
    public Envelop cancelApply(
            @ApiParam(name = "patientApplyLogId", value = "patientApplyLogId", required = true)
            @RequestParam(value = "patientApplyLogId",required = true) Integer patientApplyLogId) throws Exception {
        try{
            myFamilyService.cancelApply(patientApplyLogId);
            return success();
        }catch (Exception e){
            e.printStackTrace();
            return failed(e.getMessage());
        }
    }
}

+ 117 - 18
svr/svr-patient/src/main/java/com/yihu/jw/patient/service/myFamily/MyFamilyService.java

@ -1,6 +1,5 @@
package com.yihu.jw.patient.service.myFamily;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.entity.base.message.BaseMessageDO;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.base.patient.BasePatientFamilyMemberDO;
@ -41,14 +40,14 @@ public class MyFamilyService {
    private PatientApplyLogService patientApplyLogService;
    @Autowired
    private BasePatientMedicardCardService  patientMedicareCardService;
    LinkedList<String> role = new LinkedList<>(Arrays.asList("配偶","父亲","母亲","公公","婆婆","岳父","岳母","女婿","儿媳","子女"));
    public List<Map<String,Object>> getMyFamilyBindingRole(String patient) throws Exception{
        //获取用户的信息,根据完善信息获取男女
        BasePatientDO patientDO = patientService.findByIdAndDel(patient);
        Integer sex = patientDO.getSex();
        LinkedList<String> role = new LinkedList<>(Arrays.asList("配偶","父亲","母亲","公公","婆婆","岳父","岳母","女婿","儿媳","子女"));
        Map<String,Map<String,Object>> map = new LinkedMap();
        for(int i =0;i<role.size();i++){
            Map<String,Object> m = new LinkedMap();
@ -115,7 +114,8 @@ public class MyFamilyService {
        messageDO.setReceiver(familyPatient.getId());
        messageDO.setReceiverName(familyPatient.getName());
        messageDO.setSender(patient);
        messageDO.setType(1);
        messageDO.setFailureTime(patientApplyLog.getFailureTime());
        messageDO.setSenderName(patientDO.getName());
        messageDO.setSenderPhoto(patientDO.getPhoto());
        messageDO.setTitle("家人绑定");
@ -132,6 +132,36 @@ public class MyFamilyService {
        return patientApplyLog;
    }
    /**
     * 签约绑定家人
     * @param request
     * @param wechatId
     * @param saasId
     * @param patient
     * @param familyMobile
     * @param platform
     * @param familyBindRole 1"配偶",2"父亲",3"母亲",4"公公",5"婆婆",6"岳父",7"岳母",8"女婿",9"儿媳",10"子女"
     * @param isAdult 0未成年人 1成年人
     */
    public PatientApplyLog signBindFamily(HttpServletRequest request,String wechatId, String saasId, String patient, String familyMobile, Integer platform,Integer familyBindRole,Integer isAdult) throws Exception{
        if(isAdult==1){
            PatientApplyLog p = bindingMyFamily(request,wechatId, saasId,patient, familyMobile, platform,familyBindRole);
            return p;
        }else if(isAdult==0){
            //注册一个没有手机号码的用户信息
            BasePatientDO familyPatient = null;
            //生成绑定信息
            BasePatientFamilyMemberDO patientFamilyMember = new BasePatientFamilyMemberDO();
            patientFamilyMember.setPatient(patient);
            patientFamilyMember.setFamilyMember(familyPatient.getId());
            patientFamilyMember.setFamilyRelation(familyBindRole);
            patientFamilyMember.setIsAuthorize(1);//0:未授权,1:已授权
            patientFamilyMember.setDel(1);
            patientFamilyMemberService.save(patientFamilyMember);
        }
        return null;
    }
    /**
     * 生成绑定家人的二维码
     * @param request
@ -172,6 +202,7 @@ public class MyFamilyService {
     * @param remindType
     * @throws Exception
     */
    @Transactional(rollbackFor = Exception.class)
    public void remindMyFamily(Integer patientApplyLogId,Integer remindType) throws Exception{
        int i = patientApplyLogService.updateRemindTypeById(remindType,patientApplyLogId);
        if(i<0){
@ -181,25 +212,12 @@ public class MyFamilyService {
    /**
     * 家人确认绑定
     * @param messageId
     * @param patientApplyLogId
     * @param status 1、添加家人(默认),2、邀请登录,3、通过,4、拒绝
     */
    @Transactional(rollbackFor = Exception.class)
    public void confirmApply(Integer messageId,Integer patientApplyLogId,Integer status,Integer isAuthorize){
    public void confirmApply(Integer patientApplyLogId,Integer status,Integer isAuthorize){
        BaseMessageDO messageDO = null;
        if(messageId!=null){
            messageDO = messageService.findById(messageId);
        }
        if(messageDO!=null&&patientApplyLogId==null){
            String json = messageDO.getRelationData();
            JSONObject jsonObject = JSONObject.parseObject(json);
            patientApplyLogId = (Integer)jsonObject.get("patientApplyLogId");
            messageDO.setReadState(1);
            messageDO.setReadTime(new Date());
            messageService.save(messageDO);
        }
        PatientApplyLog patientApplyLog = patientApplyLogService.findById(patientApplyLogId);
        patientApplyLog.setStatus(status);
@ -272,6 +290,87 @@ public class MyFamilyService {
        return resultList;
    }
    public void myFamilyBindList(String patient) throws Exception{
        //已绑定的
        List<BasePatientFamilyMemberDO> bindList = patientFamilyMemberService.getByPatientAndFamilyMember(patient);
        BasePatientDO patientDO = patientService.findByIdAndDel(patient);//绑定人
        List<Map<String,Object>> resultList = new ArrayList<>();
        for(BasePatientFamilyMemberDO one:bindList){
            Map<String,Object> map = new HashedMap();
            if(patient.equals(one.getPatient())){
                BasePatientDO familyMember = patientService.findByIdAndDel(one.getFamilyMember());
                map.put("photo",familyMember.getPhoto());//头像
                map.put("name",familyMember.getName());//姓名
                map.put("roleName",role.get(one.getFamilyRelation()+1));//角色名称
                map.put("mobile",familyMember.getMobile());//手机号码
                map.put("isAuthorize",one.getIsAuthorize());//0:未授权,1:已授权
                map.put("familyMemberId",one.getId());
                map.put("patientId",familyMember.getId());
                map.put("type",1);
            }else{
                Integer familyRelation = familyRelationTrans(one.getFamilyRelation(),patientDO.getSex());
                BasePatientDO familyMember = patientService.findByIdAndDel(one.getPatient());
                map.put("photo",familyMember.getPhoto());//头像
                map.put("name",familyMember.getName());//姓名
                map.put("roleName",role.get(familyRelation+1));//角色名称
                map.put("mobile",familyMember.getMobile());//手机号码
                map.put("isAuthorize",one.getIsAuthorize());//0:未授权,1:已授权
                map.put("familyMemberId",one.getId());
                map.put("patientId",familyMember.getId());
                map.put("type",1);
            }
            resultList.add(map);
        }
        //已邀请的
//        patientApplyLogService.
        //已取消的
    }
    /**
     * 有效的申请绑定消息
     * @param patient
     */
    @Transactional(rollbackFor = Exception.class)
    public List<Map<String,Object>> applyMessageList(String patient) throws Exception{
        List<BaseMessageDO> msgList = messageService.applyMessageList(patient, new Date(), "010801");
        List<Map<String,Object>> result = new ArrayList<>();
        PatientApplyLog patientApplyLog = null;
        for(BaseMessageDO one:msgList){
            Map<String,Object> map = new HashedMap();
            String o = one.getRelationData();
            patientApplyLog = patientApplyLogService.findById(Integer.valueOf(o));
            Integer bindRole = patientApplyLog.getFamilyBindRole();
            String createUser = patientApplyLog.getCreateUser();//申请人code
            BasePatientDO patientDO = patientService.findByIdAndDel(patient);//被绑定人
            BasePatientDO createPatient = patientService.findByIdAndDel(createUser);//绑定人
            Integer converRole = familyRelationTrans(bindRole,createPatient.getSex());//转换后的角色
            map.put("patientApplyLogId",one.getId());
            map.put("patientPhoto",patientDO.getPhoto());
            map.put("applyPatientPhoto",createPatient.getPhoto());
            map.put("explain","您的"+role.get(converRole-1)+createPatient.getName()+"邀请您绑定家人账号");
            result.add(map);
            one.setReadonly(1);
            one.setReadTime(new Date());
            messageService.save(one);
        }
        return result;
    }
    /**
     * 取消申请绑定家人
     * @param patientApplyLogId
     * @throws Exception
     */
    @Transactional(rollbackFor = Exception.class)
    public void cancelApply(Integer patientApplyLogId) throws Exception{
        int i= patientApplyLogService.updateStatusById(5, patientApplyLogId);
        if(i<0){
            throw new Exception("update data failur !");
        }
    }
    /**
     * 家庭关系转换

+ 23 - 0
svr/svr-patient/src/main/java/com/yihu/jw/patient/service/myFamily/PatientApplyLogService.java

@ -2,10 +2,16 @@ package com.yihu.jw.patient.service.myFamily;
import com.yihu.jw.entity.myFamily.PatientApplyLog;
import com.yihu.jw.patient.dao.myFamily.PatientApplyLogDao;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.mysql.query.BaseJpaService;
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;
/**
 * @author liuwenbin on 2018/11/30.
 */
@ -14,6 +20,8 @@ public class PatientApplyLogService extends BaseJpaService<PatientApplyLog, Pati
    @Autowired
    private PatientApplyLogDao patientApplyLogDao;
    @Autowired
    private JdbcTemplate jdbcTemplate;
    /**
     * 更新提醒方式
@ -28,4 +36,19 @@ public class PatientApplyLogService extends BaseJpaService<PatientApplyLog, Pati
    public PatientApplyLog findById(Integer id){
        return  patientApplyLogDao.findById(id);
    }
    /**
     * 更新是否取消申请
     * @param patientApplyLogId
     * @return
     */
    public int updateStatusById(Integer status, Integer patientApplyLogId){
        return  patientApplyLogDao.updateStatusById(status,patientApplyLogId);
    }
    //invalid 无效 valid 有效
    public List<Map<String, Object>> findValidByPatient(String patient){
        String sql = "select l.* from patient_apply_for_log l where l.create_user='"+patient+"' and l.del=1 and l.status in (1,2) and l.failure_time>="+ DateUtil.dateToStr(new Date(),"yyyy-MM-dd HH:mm:ss");
        return jdbcTemplate.queryForList(sql);
    }
}