Преглед изворни кода

Merge branch 'dev' of http://192.168.1.220:10080/Amoy2/wlyy2.0 into dev

wangzhinan пре 2 година
родитељ
комит
7e505f18b6
15 измењених фајлова са 308 додато и 64 уклоњено
  1. 17 9
      business/base-service/src/main/java/com/yihu/jw/dailyReport/service/DailyReportUploadService.java
  2. 0 26
      business/base-service/src/main/java/com/yihu/jw/dailyReport/service/Main.java
  3. 8 3
      common/common-entity/sql记录
  4. 2 2
      common/common-entity/src/main/java/com/yihu/jw/entity/dailyReport/BaseDailyReportDetailDO.java
  5. 21 9
      common/common-util/src/main/java/com/yihu/jw/util/date/DateUtil.java
  6. 1 1
      business/base-service/src/main/java/com/yihu/jw/dailyReport/service/Holiday.java
  7. 4 2
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/customerService/CustomerServiceController.java
  8. 2 2
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/opinionFeedback/OpinionFeedbackController.java
  9. 4 1
      svr/svr-base/src/main/java/com/yihu/jw/base/service/customerService/CustomerService.java
  10. 6 4
      svr/svr-base/src/main/java/com/yihu/jw/base/service/opinionFeedback/OpinionFeedbackService.java
  11. 1 1
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/dao/role/DoctorRoleDao.java
  12. 78 0
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/cutomerService/CustomerServiceController.java
  13. 148 0
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/customerService/CustomerService.java
  14. 12 0
      svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/service/channel/DailyReportService.java
  15. 4 4
      svr/svr-internet-hospital-job/src/main/resources/system.properties

+ 17 - 9
business/base-service/src/main/java/com/yihu/jw/dailyReport/service/DailyReportUploadService.java

@ -342,7 +342,7 @@ public class DailyReportUploadService {
        if (StringUtil.isBlank(report_date)){
            report_date = DateUtil.getStringDateShort();
            week_name = DateUtil.getWeek(report_date);
            week_name = DateUtil.getWeekStr(report_date);
        }
        BaseDailyReportUploadDO dailyReportUploadDO = dailyReportUploadDao.findByDoctorIdAndReportDate(doctorId,report_date);
        if (null==dailyReportUploadDO){
@ -364,10 +364,14 @@ public class DailyReportUploadService {
        }else {
            throw new Exception("您不是部门人员,无法上传日报信息");
        }
        String sql = " select dict_code from wlyy_hospital_sys_dict where dict_name='daily_report_create_item' ";
        List<String> createItemUser = jdbcTemplate.queryForList(sql,String.class);
        for (BaseDailyReportDetailDO tmp :detailDOList){
            tmp.setReportId(dailyReportUploadDO.getId());
            if (tmp.isReportItemFlag()==true){//新则自建关联项目
                if (!createItemUser.contains(doctorId)){
                    throw new Exception("您无权创建自定义项目,请联系管理员");
                }
                String title = tmp.getReportItemTitle();
                BaseDailyReportItemDO reportItemDO = reportItemDao.findByTitleAndDeptAndProjectCode(title,doctorHospitalDOS.get(0).getDeptCode(),tmp.getProjectCode());
                if (null!=reportItemDO){
@ -436,7 +440,7 @@ public class DailyReportUploadService {
        }
        String senderID="";//日报发送对象
        String sql = " select dict_value from wlyy_hospital_sys_dict where dict_name='BOOS_ADMIN_SENDER'  ";
        sql = " select dict_value from wlyy_hospital_sys_dict where dict_name='BOOS_ADMIN_SENDER'  ";
        List<String> boosSenderIds = jdbcTemplate.queryForList(sql,String.class);
        String boosID = "";
        if (boosSenderIds.size()>0){
@ -3482,16 +3486,20 @@ public class DailyReportUploadService {
            workDays = DateUtil.getWorkDays(startDate, endDate);
        }
        String shangchuanSql = " select count(distinct up.id) from base_doctor_daily_report_upload up " +
        String shangchuanSql = " select distinct up.report_date from base_doctor_daily_report_upload up " +
                " INNER JOIN base_doctor doc on up.doctor_id = doc.id and doc.del=1 " +
                "Inner JOIN base_doctor_hospital dh on doc.id = dh.doctor_code and dh.del=1 " +
                "LEFT JOIN base_daily_report_detail rd on up.id = rd.report_id " +
                "LEFT join base_daily_report_item i on i.id = rd.report_item_id and i.del=1 where 1=1 " +
                "and DATE_FORMAT(up.report_date,'%w') BETWEEN 1 and 5  "+sqlWhere;
        //只计算出周一到周五上传的数量去求未上传
        Long shangchuanTotal = jdbcTemplate.queryForObject(shangchuanSql,Long.class);
                " "+sqlWhere;
        //只计算出工作日上传的数量去求未上传
        List<String> upLoadTimes = jdbcTemplate.queryForList(shangchuanSql,String.class);
        Long shangchuanTotal = 0l;
        for (String tmp:upLoadTimes){
            if (!DateUtil.isHoliday(DateUtil.strToDate(tmp))){
                shangchuanTotal++;
            }
        }
        Double acWorkHours = 0d;
        Long needWorkHours = workDays*members*8;

+ 0 - 26
business/base-service/src/main/java/com/yihu/jw/dailyReport/service/Main.java

@ -1,26 +0,0 @@
package com.yihu.jw.dailyReport.service;
import com.yihu.jw.util.date.DateUtil;
import java.text.SimpleDateFormat;
import java.util.Date;
/**
 * 测试类
 *
 * @author holate
 * @date 2020/10/26
 */
public class Main {
    public static void main(String[] args) {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss SSSS");
   /*     System.out.println("Holiday.calculateNormalDay(new Date(), 1) = " +
            sdf.format(Holiday.calculateNormalDay(new Date(), 7)));
        System.out.println("Holiday.calculateWorkDay(new Date(), 1) = " +
            sdf.format(Holiday.calculateWorkDay(new Date(), 7)));
        System.out.println("Holiday.calculateNextHoliday(new Date(),1) = " +
            sdf.format(Holiday.calculateNextHoliday(new Date(), 1)));*/
        System.out.println("Holiday.isHoliday(new Date()) = " + Holiday.isHoliday(DateUtil.strToDate("2022-09-10")));
    }
}

+ 8 - 3
common/common-entity/sql记录

@ -2189,9 +2189,9 @@ CREATE TABLE `base_opinion_feedback` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `suggest_user_id` varchar(50) DEFAULT NULL COMMENT '反馈用户',
  `suggest_user_name` varchar(50) DEFAULT NULL COMMENT '反馈用户名字',
  `user_type` int(2) DEFAULT NULL COMMENT '反馈用户类型 0家属 1社工 2助老员',
  `user_type` int(2) DEFAULT NULL COMMENT '反馈用户类型 0家属 1医生 2社工 3教师  4助老员\r\n',
  `feedback_type` int(2) DEFAULT NULL COMMENT '反馈工单类型',
  `suggest_describe` varchar(50) DEFAULT NULL COMMENT '反馈内容',
  `suggest_describe` varchar(500) DEFAULT NULL COMMENT '反馈内容',
  `suggest_user_phone` varchar(20) DEFAULT NULL COMMENT '反馈人手机号',
  `suggest_status` int(2) DEFAULT NULL COMMENT '反馈状态 0处理中 1已回复',
  `create_time` timestamp NULL DEFAULT NULL COMMENT '反馈时间',
@ -2199,7 +2199,7 @@ CREATE TABLE `base_opinion_feedback` (
  `reply_time` timestamp NULL DEFAULT NULL COMMENT '回复时间',
  `suggest_img_url` varchar(2500) DEFAULT NULL COMMENT '图片地址“,”分割',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=48 DEFAULT CHARSET=utf8mb4 COMMENT='医养意见反馈表';
) ENGINE=InnoDB AUTO_INCREMENT=67 DEFAULT CHARSET=utf8mb4 COMMENT='医养意见反馈表';
ALTER table wlyy_user_role add COLUMN `del` int(1) DEFAULT NULL COMMENT '是否生效';
@ -2209,3 +2209,8 @@ INSERT INTO `base`.`wlyy_hospital_sys_dict`(`id`, `saas_id`, `dict_name`, `dict_
INSERT INTO `base`.`wlyy_hospital_sys_dict`(`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('opinionFeedback3', NULL, 'opinionFeedbackType', '3', '功能建议', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `base`.`wlyy_hospital_sys_dict`(`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('opinionFeedback4', NULL, 'opinionFeedbackType', '4', '其他', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `base`.`wlyy_hospital_sys_dict`(`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('opinionFeedbackUser0', NULL, 'opinionFeedbackUser', '0', '家属', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `base`.`wlyy_hospital_sys_dict`(`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('opinionFeedbackUser1', NULL, 'opinionFeedbackUser', '1', '社区医生', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `base`.`wlyy_hospital_sys_dict`(`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('opinionFeedbackUser2', NULL, 'opinionFeedbackUser', '2', '社工', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `base`.`wlyy_hospital_sys_dict`(`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('opinionFeedbackUser3', NULL, 'opinionFeedbackUser', '3', '教师', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `base`.`wlyy_hospital_sys_dict`(`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('opinionFeedbackUser4', NULL, 'opinionFeedbackUser', '4', '助老员', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);

+ 2 - 2
common/common-entity/src/main/java/com/yihu/jw/entity/dailyReport/BaseDailyReportDetailDO.java

@ -43,8 +43,8 @@ public class BaseDailyReportDetailDO extends UuidIdentityEntityWithOperator {
    /**
     * 非数据库字段
     */
    private boolean reportItemFlag;
    private String reportItemTitle;
    private boolean reportItemFlag;//新增项目标识
    private String reportItemTitle;//新增项目title
    public String getReportId() {
        return reportId;

+ 21 - 9
common/common-util/src/main/java/com/yihu/jw/util/date/DateUtil.java

@ -800,19 +800,19 @@ public class DateUtil {
    public static String getWeekStr(String sdate) {
        String str = "";
        str = DateUtil.getWeek(sdate);
        if ("1".equals(str)||"Monday".equals(str)) {
        if ("1".equals(str)||"Sunday".equals(str)) {
            str = "星期日";
        } else if ("2".equals(str)||"Tuesday".equals(str)) {
        } else if ("2".equals(str)||"Monday".equals(str)) {
            str = "星期一";
        } else if ("3".equals(str)||"Wednesday".equals(str)) {
        } else if ("3".equals(str)||"Tuesday".equals(str)) {
            str = "星期二";
        } else if ("4".equals(str)||"Thursday".equals(str)) {
        } else if ("4".equals(str)||"Wednesday".equals(str)) {
            str = "星期三";
        } else if ("5".equals(str)||"Friday".equals(str)) {
        } else if ("5".equals(str)||"Thursday".equals(str)) {
            str = "星期四";
        } else if ("6".equals(str)||"Saturday".equals(str)) {
        } else if ("6".equals(str)||"Friday".equals(str)) {
            str = "星期五";
        } else if ("7".equals(str)||"Sunday".equals(str)) {
        } else if ("7".equals(str)||"Saturday".equals(str)) {
            str = "星期六";
        }
        return str;
@ -1108,8 +1108,8 @@ public class DateUtil {
        }
        while (startCal.compareTo(endCal) <= 0) {
            //如果不是周六或者周日则工作日+1
            if (startCal.get(Calendar.DAY_OF_WEEK) != 7 && startCal.get(Calendar.DAY_OF_WEEK) != 1) {
            //工作日+1
            if (!Holiday.isHoliday((startCal.getTime()))){
                day++;
            }
            startCal.add(Calendar.DAY_OF_MONTH, 1);
@ -1118,6 +1118,17 @@ public class DateUtil {
    }
    /**
     * 判断一天是不是工作日
     *
     * @param date 日期
     * @return true:休息日,false:工作日
     * @date 2020/10/26
     */
    public static boolean isHoliday(Date date) {
        return Holiday.isHoliday(date);
    }
    /**
     * 获取当月第一天
     * @return
@ -1682,4 +1693,5 @@ public class DateUtil {
        String[] weekDays = { "周日", "周一", "周二", "周三", "周四", "周五", "周六" };
        return weekDays[getWeekByString(date)];
    }
}

+ 1 - 1
business/base-service/src/main/java/com/yihu/jw/dailyReport/service/Holiday.java

@ -1,4 +1,4 @@
package com.yihu.jw.dailyReport.service;
package com.yihu.jw.util.date;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;

+ 4 - 2
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/customerService/CustomerServiceController.java

@ -48,7 +48,7 @@ public class CustomerServiceController extends EnvelopRestEndpoint {
            if (byUserPhone != null) {
                return ObjEnvelop.getSuccess("查找成功", byUserPhone, 200);
            } else {
                return ObjEnvelop.getError("查找失败", 400);
                return ObjEnvelop.getError("账号不存在", 400);
            }
        } catch (Exception e) {
            e.printStackTrace();
@ -66,7 +66,9 @@ public class CustomerServiceController extends EnvelopRestEndpoint {
                return Envelop.getError("添加失败!当前已存在一个生效客服!",500);
            }else if (result == -1){
                return Envelop.getError("添加失败!当前客服已存在未生效状态!",500);
            }else {
            }else if (result == -2){
               return Envelop.getError("添加失败!添加用户非管理员!",500);
           }else {
               return success("添加成功");
           }

+ 2 - 2
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/opinionFeedback/OpinionFeedbackController.java

@ -28,14 +28,14 @@ public class OpinionFeedbackController extends EnvelopRestEndpoint {
    @GetMapping("findOpinionFeedbackList")
    @ApiOperation("查找列表")
    public ObjEnvelop findOpinionFeedbackList(@RequestParam(value = "suggestUserName", required = false) String suggestUserName,
                                              @RequestParam(value = "feedbcakType", required = false) Integer feedbcakType,
                                              @RequestParam(value = "feedbackType", required = false) Integer feedbackType,
                                              @RequestParam(value = "userType", required = false) Integer userType,
                                              @RequestParam(value = "suggestStatus", required = false) Integer suggestStatus,
                                              @RequestParam(value = "page", required = false) Integer page,
                                              @RequestParam(value = "pageSize", required = false) Integer pageSize,
                                              @RequestParam(value = "id", required = false) String id) {
        try {
            JSONObject opinionFeedbackList = opinionFeedbackService.findOpinionFeedbackList(suggestUserName, feedbcakType, userType, suggestStatus, page, pageSize, id);
            JSONObject opinionFeedbackList = opinionFeedbackService.findOpinionFeedbackList(suggestUserName, feedbackType, userType, suggestStatus, page, pageSize, id);
            return success(opinionFeedbackList);
        } catch (Exception e) {
            e.printStackTrace();

+ 4 - 1
svr/svr-base/src/main/java/com/yihu/jw/base/service/customerService/CustomerService.java

@ -59,10 +59,13 @@ public class CustomerService {
    public Integer addCustomerServiceUser(String id) {
        String sql = "select count(id) from wlyy_user_role where del = 1";
        String sqldel = "select count(id) from wlyy_user_role where user ='" + id + "' and del = 0";
        String sqladmin = "select count(id) from wlyy_user_role where user ='" + id + "' and role = '330100'";
        Integer total = jdbcTemplate.queryForObject(sql, Integer.class);
        Integer delTotal = jdbcTemplate.queryForObject(sqldel, Integer.class);
        Integer adminTital = jdbcTemplate.queryForObject(sqladmin, Integer.class);
        if (total > 0) return 0;
        if (delTotal > 0) return -1;
        if (!(adminTital > 0)) return -2;
        String instSql = "INSERT INTO `base`.`wlyy_user_role`(`user`, `role`, `czy`, `czrq`,`del`) VALUES ('" + id + "', 'chjd_kf', NULL, NULL,1);";
        jdbcTemplate.update(instSql);
        return 1;
@ -73,7 +76,7 @@ public class CustomerService {
        if (1 == status) {
            String sqlTotal = "select count(id) from wlyy_user_role where 1=1 and role = 'chjd_kf' and del=1";
            Integer total = jdbcTemplate.queryForObject(sqlTotal, Integer.class);
            if (total > 1) return -1;
            if (total >= 1) return -1;
        }
        String sql = "update wlyy_user_role set del = '" + status + "' where user = '" + id + "' and role ='chjd_kf' ";

+ 6 - 4
svr/svr-base/src/main/java/com/yihu/jw/base/service/opinionFeedback/OpinionFeedbackService.java

@ -23,7 +23,7 @@ public class OpinionFeedbackService {
    @Autowired
    private JdbcTemplate jdbcTemplate;
    public JSONObject findOpinionFeedbackList(String suggestUserName, Integer feedbcakType, Integer userType, Integer suggestStatus, Integer page, Integer pageSize,String id) {
    public JSONObject findOpinionFeedbackList(String suggestUserName, Integer feedbackType, Integer userType, Integer suggestStatus, Integer page, Integer pageSize,String id) {
        JSONObject jsonObject = new JSONObject();
@ -39,9 +39,9 @@ public class OpinionFeedbackService {
            sql += " and suggest_user_name like '%" + suggestUserName + "%'";
            sqlTotal += " and suggest_user_name like '%" + suggestUserName + "%'";
        }
        if (null != feedbcakType) {
            sql +=" and feedback_type = "+feedbcakType+"";
            sqlTotal +=" and feedback_type = "+feedbcakType+"";
        if (null != feedbackType) {
            sql +=" and feedback_type = "+feedbackType+"";
            sqlTotal +=" and feedback_type = "+feedbackType+"";
        }
        if (null != userType) {
            sql +=" and  user_type = "+userType+"";
@ -63,6 +63,8 @@ public class OpinionFeedbackService {
        if (StringUtils.isBlank(id)) {
            if (page == null) {
                page = 0;
            }else {
                page = (page - 1) * pageSize;
            }
            if (pageSize == null) {
                pageSize = 10;

+ 1 - 1
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/dao/role/DoctorRoleDao.java

@ -14,6 +14,6 @@ import java.util.List;
public interface DoctorRoleDao extends JpaRepository<DoctorRole, Long> {
    @Query(value = "select b.* from wlyy_user_role a,wlyy_role b where a.role = b.code and a.user = ?1",nativeQuery = true)
    @Query(value = "select b.* from wlyy_user_role a,wlyy_role b where a.role = b.code and a.user = ?1 and ((a.del = 1 OR a.del IS NULL) )  ",nativeQuery = true)
    List<DoctorRole> findUserRole(String user);
}

+ 78 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/cutomerService/CustomerServiceController.java

@ -0,0 +1,78 @@
package com.yihu.jw.care.endpoint.cutomerService;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.care.service.customerService.CustomerService;
import com.yihu.jw.restmodel.web.ListEnvelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
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 java.util.List;
import java.util.Map;
/**
 * Created by wsl on 2022/9/13
 */
@RestController
@RequestMapping(value = "/customerService/", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(description = "医养客服")
public class CustomerServiceController extends EnvelopRestEndpoint {
    @Autowired
    private CustomerService customerService;
    @ApiOperation("获取生效客服信息")
    @GetMapping(value= "findCustomerServiceInfo")
    public ListEnvelop customerServiceInfo(){
        try {
            List<Map<String, Object>> result = customerService.customerServiceInfo();
            return success(result);
        } catch (Exception e) {
            e.printStackTrace();
            return ListEnvelop.getError("服务端异常!");
        }
    }
    @ApiOperation("获取客服咨询信息")
    @GetMapping(value= "consultList")
    public ListEnvelop consultList(@RequestParam(value = "user_id", required = true) String user_id,
                                   @RequestParam(value = "business_type", required = true) String business_type,
                                   @RequestParam(value = "status", required = true) String status,
                                   @RequestParam(value = "name", required = false) String name,
                                   @RequestParam(value = "search_type", required = true) String search_type,
                                   @RequestParam(value = "page", required = true) Integer page,
                                   @RequestParam(value = "size", required = true) Integer size){
        try {
            JSONArray jsonArray = customerService.consultList(user_id, business_type, status, name, search_type, page, size);
            return success(jsonArray);
        } catch (Exception e) {
            e.printStackTrace();
            return ListEnvelop.getError("服务端异常!");
        }
    }
    @ApiOperation("获取客服咨询未回复数量")
    @GetMapping(value= "consultNoReply")
    public ObjEnvelop consultNoReply(@RequestParam(value = "doctor", required = true) String doctor){
        try {
            JSONObject jsonObject = customerService.consultNoReply(doctor);
            return success(jsonObject);
        } catch (Exception e) {
            e.printStackTrace();
            return ObjEnvelop.getError("服务端异常!");
        }
    }
}

+ 148 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/customerService/CustomerService.java

@ -0,0 +1,148 @@
package com.yihu.jw.care.service.customerService;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.care.util.HttpClientUtilCare;
import com.yihu.jw.im.service.ImService;
import com.yihu.jw.im.util.ImUtil;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
/**
 * Created by wsl on 2022/9/13
 */
@Service
public class CustomerService {
    @Value("${im.im_list_get}")
    private String im_host;
    //@Autowired
    //private HttpClientUtilCare httpClientUtilCare;
    @Autowired
    private JdbcTemplate jdbcTemplate;
    @Autowired
    RedisTemplate redisTemplate;
    @Autowired
    ImService imService;
    @Autowired
    private ImUtil imUtil;
    // user_id=13&business_type=2&status=0&name=&search_type=1&page=1&size=20
    //获取客服信息
    public List<Map<String, Object>> customerServiceInfo() {
        String sql = "SELECT d.id,d.`name`,d.photo,d.mobile FROM base_doctor d INNER JOIN wlyy_user_role r ON d.id = r.`user` WHERE r.del = 1 AND r.role = 'chjd_kf'  ";
        String listStr = imUtil.getOnlineListByType("helper");
        JSONObject onLineObj = JSONObject.parseObject(listStr);
        List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);
        if (200 == onLineObj.getInteger("status")) {
            JSONObject oneLineInfo = onLineObj.getJSONObject("helper");
            for (Map<String, Object> map : list) {
                String doctorCode = map.get("id").toString();
                if (oneLineInfo.containsKey(doctorCode)) {
                    if (oneLineInfo.getInteger(doctorCode) > 0) {
                        map.put("onLineFlag", 1);
                    } else {
                        map.put("onLineFlag", 0);
                    }
                } else {
                    map.put("onLineFlag", 0);
                }
            }
        }
        return list;
    }
    public JSONArray consultList(String user_id, String business_type, String status, String name, String search_type, Integer page, Integer size) {
        if (StringUtils.isBlank(name)) {
            name = "";
        }
        String imAddr = im_host + "api/v2/sessions?user_id=" + user_id + "&business_type=" + business_type + "&status=" + status + "&" +
                "name=" + name + "&search_type=" + search_type + "&page=" + page + "&size=" + size + "";
        HttpClientUtilCare httpClientUtilCare = new HttpClientUtilCare();
        String sing = httpClientUtilCare.get(imAddr, "utf-8");
        JSONArray jsonArray = JSONArray.parseArray(sing);
        JSONArray result = new JSONArray();
        System.out.println("-----imAddr:"+imAddr);
        String sql = "SELECT CASE WHEN archive_type = 1 THEN '老人' WHEN archive_type = 2 THEN '幼儿' WHEN archive_type = 3 THEN '家属' END AS type FROM base_patient  WHERE  id = '<id>' AND del = 1 " +
                "UNION  " +
                "SELECT CASE " +
                " WHEN doctor_level = 2 THEN " +
                " '社工' " +
                "WHEN doctor_level = 4 THEN " +
                "'助老员' " +
                "WHEN doctor_level = 3 THEN " +
                "'教师' " +
                "END AS type FROM base_doctor WHERE id = '<id>'  ";
       for (int i = 0; i < jsonArray.size(); i++) {
            JSONObject jsonObject = jsonArray.getJSONObject(i);
            System.out.println(jsonObject.get("sender_id") + ":" + jsonObject.get("sender_name"));
           /*  if (jsonObject.get("sender_id") != null && StringUtils.isNotBlank(jsonObject.get("sender_id").toString())&&!jsonObject.get("sender_id").toString().equals(user_id)) {
                String id = jsonObject.get("sender_id").toString();
                String labelSql = sql.replace("<id>",id);
                List<Map<String, Object>> list = jdbcTemplate.queryForList(labelSql);
                if (list.size() > 0) {
                    jsonObject.put("userType", list.get(0).get("type").toString());
                }else {
                    jsonObject.put("userType", "未知");
                }
               *//* for (Map<String, Object> map : list) {
                    switch (map.get("type").toString()){
                        case "老人":
                            String fpatientSql = "SELECT count(id) FROM base_patient_family_member  WHERE  family_member = '"+id+"'";
                            Integer total = jdbcTemplate.queryForObject(fpatientSql, Integer.class);
                            if (total>0){
                                jsonObject.put("userType","家属");
                            }
                            break;
                        default:
                            break;
                    }
                }*//*
            }else {*/
                JSONArray participantsArray = JSONArray.parseArray(jsonObject.get("participantsTimeArray").toString());
                for (Object participantObj : participantsArray) {
                    JSONObject participant = JSONObject.parseObject(participantObj.toString());
                    if (!user_id.equals(participant.getString("id"))) {
                        String id = participant.getString("id");
                        String labelSql = sql.replace("<id>",id);
                        List<Map<String, Object>> list = jdbcTemplate.queryForList(labelSql);
                        if (list.size() > 0) {
                            jsonObject.put("userType", list.get(0).get("type").toString());
                        }else {
                            jsonObject.put("userType", "未知");
                        }
                    }
                }
           /* }*/
            result.add(jsonObject);
       }
        return result;
    }
    public JSONObject consultNoReply(String doctor) {
        JSONObject result = new JSONObject();
        Integer integer = imService.SessionsUnreadMessageCount(doctor,"2");
        result.put("total", integer);
        return result;
    }
}

+ 12 - 0
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/service/channel/DailyReportService.java

@ -72,6 +72,10 @@ public class DailyReportService {
    private Logger logger= LoggerFactory.getLogger(DailyReportService.class);
    public void dailyReportRemind() throws Exception {
        Date date = new Date();
        if (DateUtil.isHoliday(date)){
            return;
        }
        List<BaseDoctorDO> doctorDOList = doctorDao.findByDel();
        String nowDate = DateUtil.getStringDateShort();
        for (BaseDoctorDO doctorDO:doctorDOList){
@ -98,6 +102,10 @@ public class DailyReportService {
     * @throws Exception
     */
    public void dailyReportWsbTotalRemind() throws Exception {
        Date date = new Date();
        if (DateUtil.isHoliday(date)){
            return;
        }
        String boosID = "0592008";//老板id
        String nowDate = DateUtil.getStringDateShort();
        List<BaseDoctorRoleDO> deptAdminRoleList = doctorRoleDao.findByRoleCode("deptAdmin");
@ -165,6 +173,10 @@ public class DailyReportService {
     * @throws Exception
     */
    public void dailyReportTotalRemind() throws Exception {
        Date date = new Date();
        if (DateUtil.isHoliday(date)){
            return;
        }
        String boosID = "0592008";//老板id
        String nowDate = DateUtil.getStringDateShort();
        List<BaseDoctorRoleDO> deptAdminRoleList = doctorRoleDao.findByRoleCode("deptAdmin");

+ 4 - 4
svr/svr-internet-hospital-job/src/main/resources/system.properties

@ -41,11 +41,11 @@ health_upload_weishangbao_remind_job=0 45 8 * * ? *
health_upload_total_remind_job=0 0 9 * * ? *
DailyReportRemindJob=0 50 17 ? * 2,3,4,5,6
DailyReportRemindJob=0 50 17 * * ? *
DailyReportRemindSecondJob=0 0 20 ? * 2,3,4,5,6
DailyReportRemindSecondJob=0 0 20 * * ? *
DailyReportTotalRemindJob=0 0 22 ? * 2,3,4,5,6
DailyReportTotalRemindJob=0 0 22 * * ? *
DailyReportWsbTotalRemindJob=0 0 21 ? * 2,3,4,5,6
DailyReportWsbTotalRemindJob=0 0 21 * * ? *