ソースを参照

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

LAPTOP-KB9HII50\70708 1 年間 前
コミット
5e2e5ce2bd
42 ファイル変更1896 行追加246 行削除
  1. 4 0
      business/base-service/src/main/java/com/yihu/jw/application/dao/BaseApplicationMenuDao.java
  2. 3 0
      business/base-service/src/main/java/com/yihu/jw/application/dao/BaseApplicationRoleUserDao.java
  3. 34 4
      business/base-service/src/main/java/com/yihu/jw/application/service/BaseApplicationMenuService.java
  4. 148 7
      business/base-service/src/main/java/com/yihu/jw/application/service/BaseApplicationRoleDictService.java
  5. 11 0
      business/base-service/src/main/java/com/yihu/jw/dict/dao/BaseTableDictDao.java
  6. 150 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/servicePackage/ServiceItemConfig.java
  7. 33 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/servicePackage/ServicePackageItemDO.java
  8. 18 7
      common/common-entity/src/main/java/com/yihu/jw/entity/base/servicePackage/ServicePackageSubItemDO.java
  9. 76 0
      common/common-entity/src/main/java/com/yihu/jw/entity/dict/BaseTableDict.java
  10. 123 0
      common/common-entity/src/main/java/com/yihu/jw/entity/followup/FollowupTemplate.java
  11. 31 0
      common/common-entity/src/main/java/com/yihu/jw/entity/specialist/BaseDiseaseHospitalDO.java
  12. 8 2
      common/common-entity/src/main/java/com/yihu/jw/entity/specialist/rehabilitation/RehabilitationPlanTemplateDO.java
  13. 50 0
      common/common-entity/src/main/java/com/yihu/jw/entity/specialist/rehabilitation/RehabilitationTemplateDetailDO.java
  14. 2 0
      common/common-entity/src/main/java/com/yihu/jw/entity/specialist/rehabilitation/TemplateJson.java
  15. 10 0
      common/common-request-mapping/src/main/java/com/yihu/jw/rm/base/BaseRequestMapping.java
  16. 47 8
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/qvo/ParamQvo.java
  17. 23 17
      starter/swagger-starter/pom.xml
  18. 3 2
      starter/swagger-starter/src/main/java/com/yihu/jw/SwaggerConfig.java
  19. 48 34
      svr/svr-base/pom.xml
  20. 10 0
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/followup/FollowupTemplateDao.java
  21. 15 0
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/servicePackage/ServiceItemConfigDao.java
  22. 1 1
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/specialist/rehabilitation/RehabilitationPlanTemplateDao.java
  23. 5 3
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/application/BaseApplicationMenuEndpoint.java
  24. 30 4
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/application/BaseApplicationRoleDictEndpoint.java
  25. 56 0
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/dict/BaseTableDictEndpoint.java
  26. 94 0
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/followup/FollowupTemplatePoint.java
  27. 44 2
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/servicePackage/ServicePackageEndpoint.java
  28. 18 36
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/servicePackage/ServicePackageItemEndpoint.java
  29. 174 0
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/servicePackage/ServicePackageSubItemEndpoint.java
  30. 56 18
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/specialist/rehabilitation/RehabilitationPlanController.java
  31. 38 0
      svr/svr-base/src/main/java/com/yihu/jw/base/service/dict/BaseTableDictService.java
  32. 91 0
      svr/svr-base/src/main/java/com/yihu/jw/base/service/followup/FollowupTemplateService.java
  33. 66 0
      svr/svr-base/src/main/java/com/yihu/jw/base/service/servicePackage/ServiceItemConfigService.java
  34. 29 23
      svr/svr-base/src/main/java/com/yihu/jw/base/service/servicePackage/ServicePackageItemService.java
  35. 22 16
      svr/svr-base/src/main/java/com/yihu/jw/base/service/servicePackage/ServicePackageService.java
  36. 188 0
      svr/svr-base/src/main/java/com/yihu/jw/base/service/servicePackage/ServicePackageSubItemService.java
  37. 51 5
      svr/svr-base/src/main/java/com/yihu/jw/base/service/specialist/rehabilitation/RehabilitationPlanService.java
  38. 29 0
      svr/svr-base/src/main/java/com/yihu/jw/base/vo/excel/SubItemExcelVo.java
  39. 5 5
      svr/svr-base/src/main/resources/application.yml
  40. 1 1
      svr/svr-base/src/main/resources/bootstrap.yml
  41. 50 50
      svr/svr-internet-hospital/src/main/resources/application.yml
  42. 1 1
      svr/svr-internet-hospital/src/main/resources/bootstrap.yml

+ 4 - 0
business/base-service/src/main/java/com/yihu/jw/application/dao/BaseApplicationMenuDao.java

@ -2,6 +2,8 @@ package com.yihu.jw.application.dao;
import com.yihu.jw.entity.base.application.BaseApplicationMenuDO;
import com.yihu.jw.entity.base.area.BaseCityDO;
import com.yihu.jw.entity.base.dict.DictIcd10DO;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
@ -16,6 +18,8 @@ public interface BaseApplicationMenuDao extends JpaRepository<BaseApplicationMen
    @Query("select p from BaseApplicationMenuDO p where p.type = ?1 and p.status=1 order by p.menuSort desc")
    List<BaseApplicationMenuDO> getParentList(String type);
    @Query("from BaseApplicationMenuDO p where  p.name like %?2% and  p.type = ?1  and p.status=1 order by p.menuSort desc")
    List<BaseApplicationMenuDO> getTypeAndNameList(String type,String name);
    @Query("select p from BaseApplicationMenuDO p where p.type = ?1 and p.parentId=?2 and p.status=1 order by p.menuSort desc ")
    List<BaseApplicationMenuDO> getChildBuParent(String type,String parentId);

+ 3 - 0
business/base-service/src/main/java/com/yihu/jw/application/dao/BaseApplicationRoleUserDao.java

@ -21,4 +21,7 @@ public interface BaseApplicationRoleUserDao extends JpaRepository<BaseApplicatio
    @Query("select p from BaseApplicationRoleUserDO p where p.roleId=?1 ")
    List<BaseApplicationRoleUserDO> findByRoleId(String roleId);
    @Query("select p from BaseApplicationRoleUserDO p where p.roleId=?1 and p.userCode=?2 ")
    BaseApplicationRoleUserDO findByRolIdAnduserCode(String roleId,String userCode);
}

+ 34 - 4
business/base-service/src/main/java/com/yihu/jw/application/service/BaseApplicationMenuService.java

@ -6,15 +6,18 @@ import com.yihu.jw.application.dao.BaseApplicationMenuDao;
import com.yihu.jw.application.dao.BaseApplicationRoleMenuDao;
import com.yihu.jw.contant.CommonContant;
import com.yihu.jw.entity.base.application.BaseApplicationMenuDO;
import com.yihu.jw.entity.base.user.UserDO;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
import com.yihu.jw.mysql.query.BaseJpaService;
import com.yihu.jw.restmodel.base.role.MenuVO;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.user.UserDao;
import com.yihu.jw.utils.hibernate.HibenateUtils;
import org.apache.commons.lang3.StringUtils;
import org.jsoup.Connection;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -40,17 +43,30 @@ public class BaseApplicationMenuService extends BaseJpaService<BaseApplicationMe
    @Autowired
    private WlyyHospitalSysDictDao hospitalSysDictDao;
    @Autowired
    private UserDao userDao;
    @Value("${wechat.id}")
    private String wechatId;
    /**
     * 创建和修改应用菜单实体
     *
     * @param menuDO
     * @return
     */
    public BaseApplicationMenuDO insertAndUpdateMenu(BaseApplicationMenuDO menuDO){
    public BaseApplicationMenuDO insertAndUpdateMenu(BaseApplicationMenuDO menuDO,String uuid){
        UserDO userDO = userDao.findById(uuid).get();
        if (StringUtils.isNoneBlank(menuDO.getId())){
            menuDO.setUpdateTime(new Date());
            menuDO.setUpdateUser(uuid);
            menuDO.setUpdateUserName(userDO.getName());
        }else {
            menuDO.setCreateTime(new Date());
            menuDO.setCreateUser(uuid);
            menuDO.setCreateUserName(userDO.getName());
            menuDO.setUpdateUser(uuid);
            menuDO.setUpdateTime(new Date());
            menuDO.setUpdateUserName(userDO.getName());
        }
        return applicationMenuDao.save(menuDO);
    }
@ -82,8 +98,13 @@ public class BaseApplicationMenuService extends BaseJpaService<BaseApplicationMe
     * @param type
     * @return
     */
    public List<BaseApplicationMenuDO> getMenuTree(String type){
        List<BaseApplicationMenuDO> baseApplicationMenuDOS = applicationMenuDao.getParentList(type);
    public List<BaseApplicationMenuDO> getMenuTree(String type,String name){
        List<BaseApplicationMenuDO> baseApplicationMenuDOS = new ArrayList<>();
        if (StringUtils.isNoneBlank(name)){
            baseApplicationMenuDOS = applicationMenuDao.getTypeAndNameList(type,name);
        }else {
            baseApplicationMenuDOS = applicationMenuDao.getParentList(type);
        }
        Map<String,List<BaseApplicationMenuDO>> map = baseApplicationMenuDOS.stream().collect(Collectors.groupingBy(BaseApplicationMenuDO::getParentId));
        baseApplicationMenuDOS.forEach(menu->{
            List<BaseApplicationMenuDO> tmp = map.get(menu.getId());
@ -112,6 +133,12 @@ public class BaseApplicationMenuService extends BaseJpaService<BaseApplicationMe
     */
    public MixEnvelop selectByCondition(String type,String saasId, String orgCode, String name, Integer status, Integer page, Integer size){
        MixEnvelop mixEnvelop = new MixEnvelop();
        String conditionSql = "";
        if ("xm_ykyy_wx".equals(wechatId)) {
            conditionSql = "to_char(m.update_time,'YYYY-MM-DD hh24:mi:ss')  AS \"updateTime\",";
        } else {
            conditionSql = "date_format(m.update_time,'%Y-%m-%d %H:%i:%S' )  AS \"updateTime\",";
        }
        String sql = "SELECT\n" +
                "\tm.id,\n" +
                "\tm. CODE AS \"code\",\n" +
@ -119,6 +146,7 @@ public class BaseApplicationMenuService extends BaseJpaService<BaseApplicationMe
                "\tm.saas_id AS \"saasId\",\n" +
                "\ts. NAME AS \"saasName\",\n" +
                "\tm.org_code AS \"orgCode\",\n" +
                "\to.name AS \"orgName\",\n" +
                "\tm.identify AS \"identify\",\n" +
                "\tm.parent_id AS \"parentId\",\n" +
                "\tm.menu_sort AS \"menuSort\",\n" +
@ -128,7 +156,9 @@ public class BaseApplicationMenuService extends BaseJpaService<BaseApplicationMe
                "\tm.url AS \"url\",\n" +
                "\tm.url_param AS \"urlParam\",\n" +
                "\tm.description AS \"description\",\n" +
                "\tm.create_time AS \"createTime\"\n" +
                conditionSql +
                "\tm.update_user_name AS \"updateUserName\"\n" +
                "FROM\n" +
                "\tbase_application_menu m\n" +
                "LEFT JOIN base_saas s ON s.id = m.saas_id\n" +

+ 148 - 7
business/base-service/src/main/java/com/yihu/jw/application/service/BaseApplicationRoleDictService.java

@ -9,17 +9,21 @@ import com.yihu.jw.entity.base.application.BaseApplicationMenuDO;
import com.yihu.jw.entity.base.application.BaseApplicationRoleDictDO;
import com.yihu.jw.entity.base.application.BaseApplicationRoleMenuDO;
import com.yihu.jw.entity.base.application.BaseApplicationRoleUserDO;
import com.yihu.jw.entity.base.user.UserDO;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
import com.yihu.jw.mysql.query.BaseJpaService;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.user.UserDao;
import com.yihu.jw.utils.hibernate.HibenateUtils;
import jdk.nashorn.internal.ir.IfNode;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
@ -44,6 +48,10 @@ public class BaseApplicationRoleDictService extends BaseJpaService<BaseApplicati
    private BaseApplicationRoleUserDao applicationRoleUserDao;
    @Autowired
    private WlyyHospitalSysDictDao hospitalSysDictDao;
    @Autowired
    private UserDao userDao;
    @Value("${wechat.id}")
    private String wechatId;
    /**
     * 创建和修改应用角色
@ -51,10 +59,18 @@ public class BaseApplicationRoleDictService extends BaseJpaService<BaseApplicati
     * @param roleDictDO
     * @return
     */
    public BaseApplicationRoleDictDO insertAndUpdateRole(BaseApplicationRoleDictDO roleDictDO){
    public BaseApplicationRoleDictDO insertAndUpdateRole(BaseApplicationRoleDictDO roleDictDO,String uuid){
        UserDO userDO = userDao.findById(uuid).get();
        if (StringUtils.isNoneBlank(roleDictDO.getId())){
            roleDictDO.setUpdateUser(uuid);
            roleDictDO.setUpdateUserName(userDO.getName());
            roleDictDO.setUpdateTime(new Date());
        }else {
            roleDictDO.setUpdateTime(new Date());
            roleDictDO.setUpdateUser(uuid);
            roleDictDO.setUpdateUserName(userDO.getName());
            roleDictDO.setCreateUser(uuid);
            roleDictDO.setCreateUserName(userDO.getName());
            roleDictDO.setCreateTime(new Date());
        }
        return applicationRoleDictDao.save(roleDictDO);
@ -95,6 +111,12 @@ public class BaseApplicationRoleDictService extends BaseJpaService<BaseApplicati
     */
    public MixEnvelop selectByCondition(String type, String saasId, String orgCode, String name, Integer status, Integer page, Integer size){
        MixEnvelop mixEnvelop = new MixEnvelop();
        String conditionSql = "";
        if ("xm_ykyy_wx".equals(wechatId)) {
            conditionSql = "to_char(m.update_time,'YYYY-MM-DD hh24:mi:ss')  AS \"updateTime\",";
        } else {
            conditionSql = "date_format(m.update_time,'%Y-%m-%d %H:%i:%S' )  AS \"updateTime\",";
        }
        String sql = "SELECT\n" +
                "\tm.id,\n" +
                "\tm.saas_id AS \"saasId\",\n" +
@ -104,7 +126,8 @@ public class BaseApplicationRoleDictService extends BaseJpaService<BaseApplicati
                "\tm.type AS \"type\",\n" +
                "\tm.name AS \"name\",\n" +
                "\tm.STATUS AS \"status\",\n" +
                "\tm.create_time AS \"createTime\"\n" +
                conditionSql +
                "\tm.update_user_name AS \"updateUserName\"\n" +
                "FROM\n" +
                "\tbase_application_role_dict m\n" +
                "LEFT JOIN base_saas s ON s.id = m.saas_id\n" +
@ -167,12 +190,18 @@ public class BaseApplicationRoleDictService extends BaseJpaService<BaseApplicati
     * @return
     * @throws Exception
     */
    public List<BaseApplicationRoleUserDO> insertRoleUser(List<BaseApplicationRoleUserDO> roleUserDOS) throws Exception {
    public List<BaseApplicationRoleUserDO> insertRoleUser(List<BaseApplicationRoleUserDO> roleUserDOS,String uuid) throws Exception {
        if (roleUserDOS!=null&&roleUserDOS.size()!=0){
            String roleId = roleUserDOS.get(0).getRoleId();
            applicationRoleUserDao.deleteByRoleId(roleId);
            List<BaseApplicationRoleUserDO> roleUserDOList = new ArrayList<>();
            UserDO userDO = userDao.findById(uuid).get();
            for (BaseApplicationRoleUserDO roleUserDO:roleUserDOS){
                roleUserDO.setCreateTime(new Date());
                roleUserDO.setCreateUser(uuid);
                roleUserDO.setCreateUserName(userDO.getName());
                BaseApplicationRoleUserDO applicationRoleUserDO = applicationRoleUserDao.findByRolIdAnduserCode(roleUserDO.getRoleId(),roleUserDO.getUserCode());
                if (applicationRoleUserDO!=null){
                    applicationRoleUserDao.deleteById(applicationRoleUserDO.getId());
                }
            }
            return applicationRoleUserDao.saveAll(roleUserDOS);
        }else {
@ -180,13 +209,125 @@ public class BaseApplicationRoleDictService extends BaseJpaService<BaseApplicati
        }
    }
    public void removeRoleUser(String id){
        applicationRoleUserDao.deleteById(id);
    }
    /**
     * 根据角色id获取角色关联的成员
     * @param roleId
     * @return
     */
    public List<BaseApplicationRoleUserDO> selectUserByRoleId(String roleId){
        return applicationRoleUserDao.findByRoleId(roleId);
    public MixEnvelop selectUserByRoleId(String roleId,String userType,String userName,String userMobile,String userIdcard,String dept,
                                                              String jobTitleCode,Integer page,Integer size){
        MixEnvelop mixEnvelop = new MixEnvelop();
        String conditionSql = "";
        if ("xm_ykyy_wx".equals(wechatId)) {
            conditionSql = "to_char(ru.create_time,'YYYY-MM-DD hh24:mi:ss')  AS \"createTime\" ";
        } else {
            conditionSql = "date_format(ru.create_time,'%Y-%m-%d %H:%i:%S' )  AS \"createTime\" ";
        }
        String sql = "SELECT\n" +
                "\tru.id AS \"id\",\n" +
                "\tru.role_id AS \"roleId\",\n" +
                "\tru.user_type AS \"userType\",\n" +
                "\tru.user_code AS \"userCode\",\n" +
                "\n" +
                "IF (\n" +
                "\tp.`name` IS NULL,\n" +
                "\td. NAME,\n" +
                "\tp. NAME\n" +
                ") AS \"userName\",\n" +
                "IF (p.sex IS NULL, d.sex, p.sex) AS \"userSex\",\n" +
                "IF (\n" +
                "\tp.idcard IS NULL,\n" +
                "\td.idcard,\n" +
                "\tp.idcard\n" +
                ") AS \"userIdcard\",\n" +
                "\n" +
                "IF (\n" +
                "\tp.mobile IS NULL,\n" +
                "\td.mobile,\n" +
                "\tp.mobile\n" +
                ") AS \"userMobile\",\n" +
                "\trd.org_code as \"orgCode\",\n" +
                "\trd.saas_id as \"saasId\",\n" +
                "\to.`name` as \"orgName\",\n" +
                "\ts.`name` as \"saasName\",\n" +
                "\tdh.dept_name as \"deptName\",\n" +
                "\td.job_title_name as \"jobTitleName\",\n" +
                "\tru.create_user_name as \"createUserName\",\n" +
                conditionSql +
                "FROM\n" +
                "\tbase_application_role_user ru\n" +
                "LEFT JOIN base_application_role_dict rd ON ru.role_id = rd.id\n" +
                "LEFT JOIN base_saas s ON s.id =rd.saas_id \n" +
                "LEFT JOIN base_org o ON rd.org_code = o.code \n" +
                "LEFT JOIN base_patient p ON ru.user_code = p.id\n" +
                "LEFT JOIN base_doctor d ON ru.user_code = d.id\n" +
                "LEFT JOIN base_doctor_hospital dh ON d.id = dh.doctor_code ";
        String sqlTotal = " SELECT\n" +
                "\tCOUNT(1) as \"total\"\n" +
                "FROM\n" +
                "\tbase_application_role_user ru\n" +
                "LEFT JOIN base_application_role_dict rd ON ru.role_id = rd.id\n" +
                "LEFT JOIN base_saas s ON s.id =rd.saas_id \n" +
                "LEFT JOIN base_org o ON rd.org_code = o.code \n" +
                "LEFT JOIN base_patient p ON ru.user_code = p.id\n" +
                "LEFT JOIN base_doctor d ON ru.user_code = d.id\n" +
                "LEFT JOIN base_doctor_hospital dh ON d.id = dh.doctor_code\n ";
        String condition = " where 1=1 ";
        if (StringUtils.isNoneBlank(roleId)){
            condition +=" and ru.role_id ='"+roleId+"' ";
        }
        if (StringUtils.isNoneBlank(userType)){
            condition +=" and ru.user_type ='"+userType+"' ";
        }
        if (StringUtils.isNoneBlank(userName)){
            condition +=" and IF (\n" +
                    "\tp.`name` IS NULL,\n" +
                    "\td. NAME,\n" +
                    "\tp. NAME\n" +
                    ") LIKE '%"+userName+"%' ";
        }
        if (StringUtils.isNoneBlank(userMobile)){
            condition +=" and IF (\n" +
                    "\tp.mobile IS NULL,\n" +
                    "\td.mobile,\n" +
                    "\tp.mobile\n" +
                    ") like '%"+userMobile+"%' ";
        }
        if (StringUtils.isNoneBlank(userIdcard)){
            condition +=" and IF (\n" +
                    "\tp.idcard IS NULL,\n" +
                    "\td.idcard,\n" +
                    "\tp.idcard\n" +
                    ") like '%"+userIdcard+"%' ";
        }
        if (StringUtils.isNoneBlank(dept)){
            condition +=" and dh.dept_code = '"+dept+"' ";
        }
        if (StringUtils.isNoneBlank(jobTitleCode)){
            condition +=" and d.job_title_code = '"+jobTitleCode+"' ";
        }
        String orderCondition = " order by ru.create_time desc ";
        List<Map<String,Object>> list = hibenateUtils.createSQLQuery(sql+condition+orderCondition,page,size);
        Long count = 0L;
        List<Map<String,Object>> total = hibenateUtils.createSQLQuery(sqlTotal+condition);
        if(total!=null){
            //mysql 与 Oracle 聚合函数返回类型不一致,需要判断装换
            count = hibenateUtils.objTransformLong(total.get(0).get("total"));
        }
        mixEnvelop.setTotalCount(count.intValue());
        mixEnvelop.setDetailModelList(list);
        mixEnvelop.setPageSize(size);
        mixEnvelop.setCurrPage(page);
        return mixEnvelop;
    }

+ 11 - 0
business/base-service/src/main/java/com/yihu/jw/dict/dao/BaseTableDictDao.java

@ -0,0 +1,11 @@
package com.yihu.jw.dict.dao;
import com.yihu.jw.entity.dict.BaseTableDict;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
public interface BaseTableDictDao extends JpaRepository<BaseTableDict, Integer>, JpaSpecificationExecutor<BaseTableDict> {
}

+ 150 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/servicePackage/ServiceItemConfig.java

@ -0,0 +1,150 @@
package com.yihu.jw.entity.base.servicePackage;
import com.yihu.jw.entity.UuidIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
/**
 * @author suqinyi
 * @Date 2023/9/21
 */
@Entity
@Table(name = "base_service_item_config")
public class ServiceItemConfig extends UuidIdentityEntity implements java.io.Serializable {
    @Column(name = "package_id")
    private String packageId;//名称
    @Column(name = "server_item_id")
    private String serverItemId;//项目的id
    @Column(name = "assess_type")
    private String assessType;//说明
    @Column(name = "booking_type")
    private String bookingType;//状态
    @Column(name = "late_serve_type")
    private String lateServeType;//排序
    @Column(name = "plan_start_time_type")
    private String planStartTimeType;
    @Column(name = "server_time_type")
    private String serverTimeType;
    @Column(name = "serverCount")
    private String server_count;
    @Column(name = "template_type")
    private String templateType;
    @Column(name = "template_code")
    private String templateCode;
    @Column(name = "pricing_units_code")
    private String pricingUnitsCode;//计价单位
    @Column(name = "pricing_units_name")
    private String pricingUnitsName;//计价单位名称
    public String getPricingUnitsCode() {
        return pricingUnitsCode;
    }
    public void setPricingUnitsCode(String pricingUnitsCode) {
        this.pricingUnitsCode = pricingUnitsCode;
    }
    public String getPricingUnitsName() {
        return pricingUnitsName;
    }
    public void setPricingUnitsName(String pricingUnitsName) {
        this.pricingUnitsName = pricingUnitsName;
    }
    public String getPackageId() {
        return packageId;
    }
    public void setPackageId(String packageId) {
        this.packageId = packageId;
    }
    public String getServerItemId() {
        return serverItemId;
    }
    public void setServerItemId(String serverItemId) {
        this.serverItemId = serverItemId;
    }
    public String getAssessType() {
        return assessType;
    }
    public void setAssessType(String assessType) {
        this.assessType = assessType;
    }
    public String getBookingType() {
        return bookingType;
    }
    public void setBookingType(String bookingType) {
        this.bookingType = bookingType;
    }
    public String getLateServeType() {
        return lateServeType;
    }
    public void setLateServeType(String lateServeType) {
        this.lateServeType = lateServeType;
    }
    public String getPlanStartTimeType() {
        return planStartTimeType;
    }
    public void setPlanStartTimeType(String planStartTimeType) {
        this.planStartTimeType = planStartTimeType;
    }
    public String getServerTimeType() {
        return serverTimeType;
    }
    public void setServerTimeType(String serverTimeType) {
        this.serverTimeType = serverTimeType;
    }
    public String getServer_count() {
        return server_count;
    }
    public void setServer_count(String server_count) {
        this.server_count = server_count;
    }
    public String getTemplateType() {
        return templateType;
    }
    public void setTemplateType(String templateType) {
        this.templateType = templateType;
    }
    public String getTemplateCode() {
        return templateCode;
    }
    public void setTemplateCode(String templateCode) {
        this.templateCode = templateCode;
    }
}

+ 33 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/servicePackage/ServicePackageItemDO.java

@ -33,12 +33,43 @@ public class ServicePackageItemDO extends UuidIdentityEntity implements java.io.
    /**
     * 新增字段
     */
    private String servicePackageItemId;//服务项id
    private String leasedCode;//租户code
    private String leasedName;//租户name
    private String subItemType;//是否包含子项目
    private String templateCode;//模板的code
    private String templateType;//模板的类型
    private String subItemId;//数据库不存在的字段
    @Column(name = "service_package_item_id")
    public String getServicePackageItemId() {
        return servicePackageItemId;
    }
    public void setServicePackageItemId(String servicePackageItemId) {
        this.servicePackageItemId = servicePackageItemId;
    }
    @Column(name = "template_type")
    public String getTemplateType() {
        return templateType;
    }
    public void setTemplateType(String templateType) {
        this.templateType = templateType;
    }
    @Column(name = "template_code")
    public String getTemplateCode() {
        return templateCode;
    }
    public void setTemplateCode(String templateCode) {
        this.templateCode = templateCode;
    }
    @Transient
    public String getSubItemId() {
        return subItemId;
@ -65,6 +96,7 @@ public class ServicePackageItemDO extends UuidIdentityEntity implements java.io.
    public void setLeasedCode(String leasedCode) {
        this.leasedCode = leasedCode;
    }
    @Column(name = "leased_name")
    public String getLeasedName() {
        return leasedName;
@ -172,6 +204,7 @@ public class ServicePackageItemDO extends UuidIdentityEntity implements java.io.
    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }
    @Transient
    public String getDelName() {
        return delName;

+ 18 - 7
common/common-entity/src/main/java/com/yihu/jw/entity/base/servicePackage/ServicePackageSubItemDO.java

@ -1,5 +1,6 @@
package com.yihu.jw.entity.base.servicePackage;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.jw.entity.UuidIdentityEntity;
import javax.persistence.Column;
@ -17,29 +18,38 @@ public class ServicePackageSubItemDO extends UuidIdentityEntity implements java.
    @Column(name = "name")
    private String name;//名称
    @Column(name = "item_id")
    private String itemId;//项目的id
    @Column(name = "dict_item_id")
    private String dictItemId;//字典配置的服务项的id
    @Column(name = "introduce")
    private String introduce;//说明
    @Column(name = "status")
    private String status;//状态
    @Column(name = "sort")
    private String sort;//排序
    @Column(name = "leased_code")
    private String leasedCode;
    @Column(name = "leased_name")
    private String leasedName;
    @Column(name = "org_code")
    private String orgCode;
    @Column(name = "org_name")
    private String orgName;
    @Column(name = "photo")
    private String photo;
    @Column(name = "create_time")
    private Date createTime;
    public String getName() {
        return name;
    }
@ -48,12 +58,12 @@ public class ServicePackageSubItemDO extends UuidIdentityEntity implements java.
        this.name = name;
    }
    public String getItemId() {
        return itemId;
    public String getDictItemId() {
        return dictItemId;
    }
    public void setItemId(String itemId) {
        this.itemId = itemId;
    public void setDictItemId(String dictItemId) {
        this.dictItemId = dictItemId;
    }
    public String getIntroduce() {
@ -120,6 +130,7 @@ public class ServicePackageSubItemDO extends UuidIdentityEntity implements java.
        this.photo = photo;
    }
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    public Date getCreateTime() {
        return createTime;
    }

+ 76 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/dict/BaseTableDict.java

@ -0,0 +1,76 @@
package com.yihu.jw.entity.dict;
import com.yihu.jw.entity.iot.gateway.IdEntity;
import javax.persistence.Entity;
import javax.persistence.Table;
@Entity
@Table(name = "base_table_dict")
public class BaseTableDict extends IdEntity {
    private String dictName;   //所属字典
    private String code; //code
    private String visitCount;  //访视次序  1第一次 2第二次 3(第3,5,7次) 4(第4,6,8次)
    private String className;  //对应类(全类名)
    private String tableName;   //实体对应的表名
    private String value;   //字典值
    private String sort; //排序
    public String getSort() {
        return sort;
    }
    public void setSort(String sort) {
        this.sort = sort;
    }
    public String getDictName() {
        return dictName;
    }
    public void setDictName(String dictName) {
        this.dictName = dictName;
    }
    public String getCode() {
        return code;
    }
    public void setCode(String code) {
        this.code = code;
    }
    public String getVisitCount() {
        return visitCount;
    }
    public void setVisitCount(String visitCount) {
        this.visitCount = visitCount;
    }
    public String getClassName() {
        return className;
    }
    public void setClassName(String className) {
        this.className = className;
    }
    public String getTableName() {
        return tableName;
    }
    public void setTableName(String tableName) {
        this.tableName = tableName;
    }
    public String getValue() {
        return value;
    }
    public void setValue(String value) {
        this.value = value;
    }
}

+ 123 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/followup/FollowupTemplate.java

@ -0,0 +1,123 @@
package com.yihu.jw.entity.followup;
import com.yihu.jw.entity.UuidIdentityEntityWithOperator;
import javax.persistence.*;
/**
 * 随访模板表
 */
@Entity
@Table(name = "base_followup_template")
public class FollowupTemplate extends UuidIdentityEntityWithOperator {
	@Column(name = "template_name")
	private String templateName;
	@Column(name = "followup_statrt_time_type")
	private String followupStatrtTimeType;
	@Column(name = "followup_count")
	private String followupCount;
	@Column(name = "description")
	private String description;
	@Column(name = "template_detail_json")
	private String templateDetailJson;
	@Column(name = "status")
	private String status;
	@Column(name = "leased_code")
	private String leasedCode;
	@Column(name = "leased_name")
	private String leasedName;
	@Column(name = "org_code")
	private String orgCode;
	@Column(name = "org_name")
	private String orgName;
	public String getTemplateName() {
		return templateName;
	}
	public void setTemplateName(String templateName) {
		this.templateName = templateName;
	}
	public String getFollowupStatrtTimeType() {
		return followupStatrtTimeType;
	}
	public void setFollowupStatrtTimeType(String followupStatrtTimeType) {
		this.followupStatrtTimeType = followupStatrtTimeType;
	}
	public String getFollowupCount() {
		return followupCount;
	}
	public void setFollowupCount(String followupCount) {
		this.followupCount = followupCount;
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	public String getTemplateDetailJson() {
		return templateDetailJson;
	}
	public void setTemplateDetailJson(String templateDetailJson) {
		this.templateDetailJson = templateDetailJson;
	}
	public String getStatus() {
		return status;
	}
	public void setStatus(String status) {
		this.status = status;
	}
	public String getLeasedCode() {
		return leasedCode;
	}
	public void setLeasedCode(String leasedCode) {
		this.leasedCode = leasedCode;
	}
	public String getLeasedName() {
		return leasedName;
	}
	public void setLeasedName(String leasedName) {
		this.leasedName = leasedName;
	}
	public String getOrgCode() {
		return orgCode;
	}
	public void setOrgCode(String orgCode) {
		this.orgCode = orgCode;
	}
	public String getOrgName() {
		return orgName;
	}
	public void setOrgName(String orgName) {
		this.orgName = orgName;
	}
}

+ 31 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/specialist/BaseDiseaseHospitalDO.java

@ -40,6 +40,37 @@ public class BaseDiseaseHospitalDO extends UuidIdentityEntityWithOperator {
    private List<Map<String,Object>> articleRelationList;//文章关联列表
    /**
     * 新增字段
     */
    private String rehabilitationType;// '是否开通诊后康复 0否 1是'
    private String rehabilitationDownType;//康复下转 1自动 2手动
    private String rehabilitationTemplateId;//康复计划模板id
    public String getRehabilitationType() {
        return rehabilitationType;
    }
    public void setRehabilitationType(String rehabilitationType) {
        this.rehabilitationType = rehabilitationType;
    }
    public String getRehabilitationDownType() {
        return rehabilitationDownType;
    }
    public void setRehabilitationDownType(String rehabilitationDownType) {
        this.rehabilitationDownType = rehabilitationDownType;
    }
    public String getRehabilitationTemplateId() {
        return rehabilitationTemplateId;
    }
    public void setRehabilitationTemplateId(String rehabilitationTemplateId) {
        this.rehabilitationTemplateId = rehabilitationTemplateId;
    }
    @Transient
    public List<Map<String, Object>> getArticleRelationList() {
        return articleRelationList;

+ 8 - 2
common/common-entity/src/main/java/com/yihu/jw/entity/specialist/rehabilitation/RehabilitationPlanTemplateDO.java

@ -17,28 +17,34 @@ public class RehabilitationPlanTemplateDO extends UuidIdentityEntityWithOperator
    @Column(name = "saas_id")
    private String saasId;
    @Column(name = "title")
    private String title;//模板名称
    @Column(name = "hospital")
    private String hospital;//医院标识
    @Column(name = "hospital_name")
    private String hospitalName;//医院名称
    @Column(name = "admin_team_code")
    private Long adminTeamCode;//行政团队id
    @Column(name = "del")
    private Integer del;//是否删除(0是,1否)
    /**
     * 新增字段
     */
    @Column(name = "disease_id")
    private String diseaseId;//病种code
    @Column(name = "disease_name")
    private String diseaseName;
    @Column(name = "status")
    private String status;
    //---------------------------------
    public String getStatus() {
        return status;

+ 50 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/specialist/rehabilitation/RehabilitationTemplateDetailDO.java

@ -40,17 +40,67 @@ public class RehabilitationTemplateDetailDO extends UuidIdentityEntityWithOperat
     */
    @Column(name = "assess_type")
    private String assessType;//是否项目评价
    @Column(name = "booking_type")
    private String bookingType;//是否预约
    @Column(name = "late_serve_type")
    private String lateServeType;//是否运行逾期服务
    @Column(name = "plan_start_time_type")
    private String planStartTimeType;//计划开始时间类型【1默认系统生成康复计划的时间、2患者就诊时间、3患者出院时间】
    @Column(name = "server_time_type")
    private String serverTimeType;//服务方法 1饭前、2饭后、3睡前
    @Column(name = "server_count")
    private String serverCount;//服务次数
    @Column(name = "pricing_units_code")
    private String pricingUnitsCode;//计价单位
    @Column(name = "pricing_units_name")
    private String pricingUnitsName;//计价单位名称
    @Column(name = "template_type")
    private String templateType;
    @Column(name = "template_code")
    private String templateCode;
    public String getTemplateType() {
        return templateType;
    }
    public void setTemplateType(String templateType) {
        this.templateType = templateType;
    }
    public String getTemplateCode() {
        return templateCode;
    }
    public void setTemplateCode(String templateCode) {
        this.templateCode = templateCode;
    }
    //-----------------------------------------------------
    public String getPricingUnitsCode() {
        return pricingUnitsCode;
    }
    public void setPricingUnitsCode(String pricingUnitsCode) {
        this.pricingUnitsCode = pricingUnitsCode;
    }
    public String getPricingUnitsName() {
        return pricingUnitsName;
    }
    public void setPricingUnitsName(String pricingUnitsName) {
        this.pricingUnitsName = pricingUnitsName;
    }
    public String getAssessType() {
        return assessType;

+ 2 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/specialist/rehabilitation/TemplateJson.java

@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.jw.entity.UuidIdentityEntity;
import javax.persistence.Entity;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import java.util.Date;
@ -13,6 +14,7 @@ import java.util.Date;
 */
@Entity
@Table(name = "template_json")
@SequenceGenerator(name="id_generated", sequenceName="DICT_DOCTOR_DUTY_SEQ")
public class TemplateJson extends UuidIdentityEntity {
    private String templateId;

+ 10 - 0
common/common-request-mapping/src/main/java/com/yihu/jw/rm/base/BaseRequestMapping.java

@ -316,6 +316,14 @@ public class BaseRequestMapping {
        public static final String INIT_WITHOUT_CONDITION  = "/initWithoutCondition";
    }
    /**
     * 随访
     */
    public static class Follow extends Basic {
        public static final String PREFIX_TEMPLATE  = "/followupTemplate";
    }
    /**
     * 通知公告
     */
@ -986,6 +994,8 @@ public class BaseRequestMapping {
        public static final String selectUserByRoleId = "/selectUserByRoleId";
        public static final String selectByCondition = "/selectByCondition";
        public static final String insertRoleUser ="/insertRoleUser";
        public static final String removeRoleUser="/removeRoleUser";
        public static final String selectMenuByRoleId="/selectMenuByRoleId";
        public static final String insertRoleMenu = "/insertRoleMenu";
    }

+ 47 - 8
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/qvo/ParamQvo.java

@ -10,31 +10,70 @@ public class ParamQvo {
    private String leasedCode;//租户
    private String orgCode;//机构code
    private String searchKey;//机构code
    private String searchKey;//关键字
    private String status;//状态
    private String jsonStr;
    private String name;//名称
    private String itemName;//项目名称
    private String jsonContent;
    private String parentId;//父id
    private String dictItemId;//字典服务项id
    private String configureIf;//是否是配置
    private String pageIf;//是否分页
    private int page;//是否分页
    private int pageSize;//数量
    private int page = 1;//是否分页
    private int pageSize = 20;//数量
    public String getDictItemId() {
        return dictItemId;
    }
    public void setDictItemId(String dictItemId) {
        this.dictItemId = dictItemId;
    }
    public String getItemName() {
        return itemName;
    }
    public void setItemName(String itemName) {
        this.itemName = itemName;
    }
    public String getParentId() {
        return parentId;
    }
    public void setParentId(String parentId) {
        this.parentId = parentId;
    }
    public String getId() {
        return id;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public void setId(String id) {
        this.id = id;
    }
    public String getJsonStr() {
        return jsonStr;
    public String getJsonContent() {
        return jsonContent;
    }
    public void setJsonStr(String jsonStr) {
        this.jsonStr = jsonStr;
    public void setJsonContent(String jsonContent) {
        this.jsonContent = jsonContent;
    }
    public String getLeasedCode() {

+ 23 - 17
starter/swagger-starter/pom.xml

@ -14,24 +14,30 @@
    <dependencies>
        <dependency>
            <groupId>com.github.xiaoymin</groupId>
            <artifactId>swagger-bootstrap-ui</artifactId>
            <version>1.9.3</version>
        </dependency>
        <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-swagger2</artifactId>
            <version>${version.swagger}</version>
        </dependency>
        <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-swagger-ui</artifactId>
            <version>${version.swagger-ui}</version>
        </dependency>
        <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-staticdocs</artifactId>
            <version>${version.springfox-staticdocs}</version>
            <artifactId>knife4j-spring-boot-starter</artifactId>
            <version>2.0.2</version>
        </dependency>
<!--        <dependency>-->
<!--            <groupId>com.github.xiaoymin</groupId>-->
<!--            <artifactId>swagger-bootstrap-ui</artifactId>-->
<!--            <version>1.9.3</version>-->
<!--        </dependency>-->
<!--        <dependency>-->
<!--            <groupId>io.springfox</groupId>-->
<!--            <artifactId>springfox-swagger2</artifactId>-->
<!--            <version>${version.swagger}</version>-->
<!--        </dependency>-->
<!--        <dependency>-->
<!--            <groupId>io.springfox</groupId>-->
<!--            <artifactId>springfox-swagger-ui</artifactId>-->
<!--            <version>${version.swagger-ui}</version>-->
<!--        </dependency>-->
<!--        <dependency>-->
<!--            <groupId>io.springfox</groupId>-->
<!--            <artifactId>springfox-staticdocs</artifactId>-->
<!--            <version>${version.springfox-staticdocs}</version>-->
<!--        </dependency>-->
        <dependency>
            <groupId>io.github.swagger2markup</groupId>
            <artifactId>swagger2markup</artifactId>

+ 3 - 2
starter/swagger-starter/src/main/java/com/yihu/jw/SwaggerConfig.java

@ -1,6 +1,6 @@
package com.yihu.jw;
import com.github.xiaoymin.swaggerbootstrapui.annotations.EnableSwaggerBootstrapUI;
import com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
@ -21,9 +21,10 @@ import java.util.List;
import static com.google.common.base.Predicates.or;
import static springfox.documentation.builders.PathSelectors.regex;
@EnableKnife4j
@Configuration
@EnableSwagger2
@EnableSwaggerBootstrapUI
//@EnableSwaggerBootstrapUI
public class SwaggerConfig {
    public static final String API_VERSION = "v1.0";

+ 48 - 34
svr/svr-base/pom.xml

@ -16,6 +16,43 @@
    <version>${project.parent.version}</version>
    <dependencies>
        <!--这边用2.2.6适配这个系统原本的有的poi3.17版本-->
        <dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>easyexcel</artifactId>
            <version>2.2.6</version>
        </dependency>
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi-ooxml</artifactId>
        </dependency>
        <!-- xlsx  依赖这个包 -->
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi-ooxml-schemas</artifactId>
        </dependency>
        <!--   poi xml导入导出工具 start-->
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>com.yihu.ehr</groupId>
                    <artifactId>commons-util</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.apache.commons</groupId>
                    <artifactId>commons-collections4</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <!--   poi xml导入导出工具 end -->
        <!-- 支持Tomcat启动 -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
@ -49,10 +86,10 @@
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
        </dependency>
<!--        <dependency>-->
<!--            <groupId>org.springframework.cloud</groupId>-->
<!--            <artifactId>spring-cloud-starter-sleuth</artifactId>-->
<!--        </dependency>-->
        <!--        <dependency>-->
        <!--            <groupId>org.springframework.cloud</groupId>-->
        <!--            <artifactId>spring-cloud-starter-sleuth</artifactId>-->
        <!--        </dependency>-->
        <!--注释掉就不会读取git的配置,只会读取yml中的配置-->
        <dependency>
@ -67,11 +104,11 @@
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-activemq</artifactId>
        </dependency>
<!--        <dependency>-->
<!--            <groupId>com.yihu.jw</groupId>-->
<!--            <artifactId>minio-starter</artifactId>-->
<!--            <version>2.4.0</version>-->
<!--        </dependency>-->
        <!--        <dependency>-->
        <!--            <groupId>com.yihu.jw</groupId>-->
        <!--            <artifactId>minio-starter</artifactId>-->
        <!--            <version>2.4.0</version>-->
        <!--        </dependency>-->
        <dependency>
            <groupId>com.yihu.jw</groupId>
            <artifactId>im-service</artifactId>
@ -165,30 +202,7 @@
            <artifactId>spring-boot-starter-mail</artifactId>
        </dependency>
        <!--   poi xml导入导出工具 start-->
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>com.yihu.ehr</groupId>
                    <artifactId>commons-util</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.apache.commons</groupId>
                    <artifactId>commons-collections4</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi-ooxml</artifactId>
        </dependency>
        <!-- xlsx  依赖这个包 -->
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi-ooxml-schemas</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-core</artifactId>
@ -214,7 +228,7 @@
            <version>${version.wlyy-common}</version>
            <scope>compile</scope>
        </dependency>
        <!--   poi xml导入导出工具 end -->
        <!--oracle驱动-->
        <dependency>
            <groupId>com.oracle</groupId>

+ 10 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/dao/followup/FollowupTemplateDao.java

@ -0,0 +1,10 @@
package com.yihu.jw.base.dao.followup;
import com.yihu.jw.entity.followup.FollowupTemplate;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
public interface FollowupTemplateDao extends JpaRepository<FollowupTemplate, String>, JpaSpecificationExecutor<FollowupTemplate> {
}

+ 15 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/dao/servicePackage/ServiceItemConfigDao.java

@ -0,0 +1,15 @@
package com.yihu.jw.base.dao.servicePackage;
import com.yihu.jw.entity.base.servicePackage.ServiceItemConfig;
import com.yihu.jw.entity.base.servicePackage.ServicePackageDO;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
/**
 *
 * @author yeshijie on 2018/8/17.
 */
public interface ServiceItemConfigDao extends JpaRepository<ServiceItemConfig, String>, JpaSpecificationExecutor<ServiceItemConfig> {
}

+ 1 - 1
svr/svr-base/src/main/java/com/yihu/jw/base/dao/specialist/rehabilitation/RehabilitationPlanTemplateDao.java

@ -8,7 +8,7 @@ import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
public interface RehabilitationPlanTemplateDao extends PagingAndSortingRepository<RehabilitationPlanTemplateDO, Long>, JpaSpecificationExecutor<RehabilitationPlanTemplateDO> {
public interface RehabilitationPlanTemplateDao extends PagingAndSortingRepository<RehabilitationPlanTemplateDO, String>, JpaSpecificationExecutor<RehabilitationPlanTemplateDO> {
    @Query("select t from RehabilitationPlanTemplateDO t where (t.adminTeamCode = ?1 or t.adminTeamCode is null) and t.del = 1 ORDER BY t.adminTeamCode,t.createTime DESC ")
    List<RehabilitationPlanTemplateDO> findByAdminTeamCode(Long adminTeamCode);

+ 5 - 3
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/application/BaseApplicationMenuEndpoint.java

@ -37,7 +37,7 @@ private BaseApplicationMenuService applicationMenuService;
        @ApiParam(name = "jsonData", value = "Json数据", required = true)
        @RequestParam(value = "jsonData") String jsonData) throws Exception {
            BaseApplicationMenuDO menuDO = toEntity(jsonData, BaseApplicationMenuDO.class);
            menuDO = applicationMenuService.insertAndUpdateMenu(menuDO);
            menuDO = applicationMenuService.insertAndUpdateMenu(menuDO,getUID());
            return success(menuDO);
    }
@ -62,8 +62,10 @@ private BaseApplicationMenuService applicationMenuService;
    @ApiOperation(value = "获取资源菜单树型结构")
    public Envelop getMenuTree (
            @ApiParam(name = "type", value = "type", required = true)
            @RequestParam(value = "type") String type) throws Exception {
        return success(applicationMenuService.getMenuTree(type));
            @RequestParam(value = "type") String type,
            @ApiParam(name = "name", value = "name", required = false)
            @RequestParam(value = "name",required = false) String name) throws Exception {
        return success(applicationMenuService.getMenuTree(type,name));
    }
    @GetMapping(value = BaseRequestMapping.ApplicationMenu.selectByCondition)

+ 30 - 4
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/application/BaseApplicationRoleDictEndpoint.java

@ -41,7 +41,7 @@ private BaseApplicationRoleDictService applicationRoleDictService;
        @ApiParam(name = "jsonData", value = "Json数据", required = true)
        @RequestParam(value = "jsonData") String jsonData) throws Exception {
        BaseApplicationRoleDictDO roleDictDO = toEntity(jsonData, BaseApplicationRoleDictDO.class);
        roleDictDO = applicationRoleDictService.insertAndUpdateRole(roleDictDO);
        roleDictDO = applicationRoleDictService.insertAndUpdateRole(roleDictDO,getUID());
        return success(roleDictDO);
    }
@ -94,7 +94,17 @@ private BaseApplicationRoleDictService applicationRoleDictService;
            BaseApplicationRoleUserDO roleUserDO = toEntity(object.toJSONString(), BaseApplicationRoleUserDO.class);
            roleUserDOS.add(roleUserDO);
        }
        return success(applicationRoleDictService.insertRoleUser(roleUserDOS));
        String uuid = getUID();
        return success(applicationRoleDictService.insertRoleUser(roleUserDOS,uuid));
    }
    @PostMapping(value = BaseRequestMapping.ApplicationRoleDict.removeRoleUser)
    @ApiOperation(value = "角色成员移除")
    public Envelop removeRoleUser (
            @ApiParam(name = "id", value = "主键id", required = true)
            @RequestParam(value = "id") String id) throws Exception {
        applicationRoleDictService.removeRoleUser(id);
        return success("请求成功");
    }
@ -118,8 +128,24 @@ private BaseApplicationRoleDictService applicationRoleDictService;
    @ApiOperation(value = "根据角色id获取角色关联的成员")
    public Envelop selectUserByRoleId (
            @ApiParam(name = "roleId", value = "角色id", required = true)
            @RequestParam(value = "roleId") String roleId) throws Exception {
        return success(applicationRoleDictService.selectUserByRoleId(roleId));
            @RequestParam(value = "roleId") String roleId,
            @ApiParam(name = "userType", value = "用户type1患者2医生", required = false)
            @RequestParam(value = "userType",required = false) String userType,
            @ApiParam(name = "userName", value = "用户名称", required = false)
            @RequestParam(value = "userName",required = false) String userName,
            @ApiParam(name = "userMobile", value = "用户手机号", required = false)
            @RequestParam(value = "userMobile",required = false) String userMobile,
            @ApiParam(name = "userIdcard", value = "用户身份证", required = false)
            @RequestParam(value = "userIdcard",required = false) String userIdcard,
            @ApiParam(name = "dept", value = "科室代码", required = false)
            @RequestParam(value = "dept",required = false) String dept,
            @ApiParam(name = "jobTitleCode", value = "职称", required = false)
            @RequestParam(value = "jobTitleCode",required = false) String jobTitleCode,
            @ApiParam(name = "page", value = "页码", required = false)
            @RequestParam(value = "page",required = false) Integer page,
            @ApiParam(name = "size", value = "大小", required = false)
            @RequestParam(value = "size",required = false) Integer size) throws Exception {
        return success(applicationRoleDictService.selectUserByRoleId(roleId,userType,userName,userMobile,userIdcard,dept,jobTitleCode,page,size));
    }

+ 56 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/dict/BaseTableDictEndpoint.java

@ -0,0 +1,56 @@
package com.yihu.jw.base.endpoint.dict;
import com.yihu.jw.base.service.dict.BaseTableDictService;
import com.yihu.jw.entity.dict.BaseTableDict;
import com.yihu.jw.restmodel.qvo.ParamQvo;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
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.*;
import java.util.List;
import java.util.Map;
@RestController
@RequestMapping(value = "/tableDict")
@Api(value = "表单字典", description = "表单字典", tags = {"表单字典"})
public class BaseTableDictEndpoint extends EnvelopRestEndpoint {
    @Autowired
    private BaseTableDictService tableDictService;
    @PostMapping("/saveTableDict")
    @ApiOperation(value = "保存字典")
    public Envelop saveTableDict(
            @ApiParam(name = "jsonStr", value = "json")
            @RequestParam(name = "jsonStr", required = true) String jsonStr) throws Exception {
        try {
            BaseTableDict entity = objectMapper.readValue(jsonStr, BaseTableDict.class);
            tableDictService.saveTableDict(entity);
            return success("操作成功");
        } catch (Exception e) {
            return failedObjEnvelopException(e);
        }
    }
    @GetMapping("/findDictByName")
    @ApiOperation(value = "查找字典")
    public Envelop findDictByName(
            @ApiParam(name = "jsonStr", value = "json")
            @RequestParam(name = "jsonStr", required = false) String jsonStr) throws Exception {
        try {
            ParamQvo qvo = objectMapper.readValue(jsonStr, ParamQvo.class);
            List<Map<String, Object>> list = tableDictService.findDictByName(qvo);
            return success("查询成功", list);
        } catch (Exception e) {
            return failedObjEnvelopException(e);
        }
    }
}

+ 94 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/followup/FollowupTemplatePoint.java

@ -0,0 +1,94 @@
package com.yihu.jw.base.endpoint.followup;
import com.alibaba.fastjson.JSON;
import com.yihu.jw.base.service.followup.FollowupTemplateService;
import com.yihu.jw.entity.followup.FollowupTemplate;
import com.yihu.jw.restmodel.qvo.ParamQvo;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.PageEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.base.BaseRequestMapping;
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.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@RestController
@RequestMapping(value = BaseRequestMapping.Follow.PREFIX_TEMPLATE)
@Api(value = "随访模板", description = "随访模板", tags = {"随访模板"})
public class FollowupTemplatePoint extends EnvelopRestEndpoint {
    @Autowired
    private FollowupTemplateService followupTemplateService;
    @GetMapping(value = "findList")
    @ApiOperation(value = "获取模板列表")
    public PageEnvelop<Map<String, Object>> findList(
            @ApiParam(name = "jsonStr", value = "jsonStr") @RequestParam(value = "jsonStr", required = false) String jsonStr
    ) throws Exception {
        ParamQvo qvo = JSON.parseObject(jsonStr, ParamQvo.class);
        HashMap<String, Object> map = followupTemplateService.findList(qvo);
        List<Map<String, Object>> list = (List<Map<String, Object>>) map.get("list");
        Integer count = (Integer) map.get("count");
        return success(list, count, qvo.getPage(), qvo.getPageSize());
    }
    /**
     * 创建模板和更新模板
     */
    @PostMapping(value = "createTemplate")
    @ApiOperation(value = "创建模板")
    public ObjEnvelop createTemplate(
            @ApiParam(name = "jsonStr", value = "jsonStr") @RequestParam(value = "jsonStr", required = false) String jsonStr
    ) throws Exception {
        FollowupTemplate vo = JSON.parseObject(jsonStr, FollowupTemplate.class);
        FollowupTemplate entity = followupTemplateService.createTemplate(vo);
        return success("创建成功", entity);
    }
    /**
     * 改变模板状态
     */
    @PostMapping(value = "changeTemplateStatus")
    @ApiOperation(value = "改变模板状态")
    public ObjEnvelop changeTemplateStatus(
            @ApiParam(name = "jsonStr", value = "jsonStr") @RequestParam(value = "jsonStr", required = false) String jsonStr
    ) throws Exception {
        ParamQvo qvo = JSON.parseObject(jsonStr, ParamQvo.class);
        try {
            FollowupTemplate entity = followupTemplateService.changeTemplateStatus(qvo);
            return success("改变模板状态成功", entity);
        } catch (Exception e) {
            return failedObjEnvelopException(e);
        }
    }
    /**
     * 删除模板
     */
    @PostMapping(value = "deleteTemplate")
    @ApiOperation(value = "删除模板")
    public Envelop deleteTemplate(
            @ApiParam(name = "jsonStr", value = "jsonStr") @RequestParam(value = "jsonStr", required = false) String jsonStr
    ) throws Exception {
        ParamQvo qvo = JSON.parseObject(jsonStr, ParamQvo.class);
        try {
            followupTemplateService.deleteTemplate(qvo);
            return success("删除成功");
        } catch (Exception e) {
            return failedObjEnvelopException(e);
        }
    }
}

+ 44 - 2
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/servicePackage/ServicePackageEndpoint.java

@ -3,6 +3,7 @@ package com.yihu.jw.base.endpoint.servicePackage;
import com.alibaba.fastjson.JSON;
import com.yihu.jw.base.dao.servicePackage.ServicePackageDao;
import com.yihu.jw.base.dao.servicePackage.ServicePackageItemDao;
import com.yihu.jw.base.service.servicePackage.ServiceItemConfigService;
import com.yihu.jw.base.service.servicePackage.ServicePackageService;
import com.yihu.jw.entity.base.servicePackage.ServicePackageDO;
import com.yihu.jw.entity.base.servicePackage.ServicePackageItemDO;
@ -21,6 +22,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import java.net.URLDecoder;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -40,20 +42,25 @@ public class ServicePackageEndpoint extends EnvelopRestEndpoint {
    private ServicePackageDao servicePackageDao;
    @Autowired
    private ServicePackageItemDao servicePackageItemDao;
    @Autowired
    ServiceItemConfigService itemConfigService;
    /**
     * 查询服务包 /servicepackage/page
     */
    @GetMapping(value = BaseRequestMapping.ServicePackage.PAGE)
    @ApiOperation(value = "获取分页")
    public PageEnvelop<Map<String, Object>> page(
            @ApiParam(name = "id", value = "主键") @RequestParam(value = "id", required = false) String id,
            @ApiParam(name = "leasedCode", value = "租户code") @RequestParam(value = "leasedCode", required = false) String leasedCode,
            @ApiParam(name = "orgCode", value = "机构code") @RequestParam(value = "orgCode", required = false) String orgCode,
            @ApiParam(name = "pageName", value = "服务包名称") @RequestParam(value = "pageName", required = false) String pageName,
            @ApiParam(name = "status", value = "状态") @RequestParam(value = "status", required = false) String status,
            @ApiParam(name = "page", value = "分页大小", required = true, defaultValue = "1") @RequestParam(value = "page") int page,
            @ApiParam(name = "size", value = "页码", required = true, defaultValue = "15") @RequestParam(value = "size") int size
    ) throws Exception {
        HashMap<String, Object> resultMap = servicePackageService.findList(leasedCode, orgCode, pageName, status, page, size);
        HashMap<String, Object> resultMap = servicePackageService.findList(id, leasedCode, orgCode, pageName, status, page, size);
        Integer count = (Integer) resultMap.get("count");
        List<Map<String, Object>> list = (List<Map<String, Object>>) resultMap.get("list");
        return success(list, count, page, size);
@ -65,6 +72,7 @@ public class ServicePackageEndpoint extends EnvelopRestEndpoint {
    public Envelop create(
            @ApiParam(name = "jsonData", value = "Json数据", required = true)
            @RequestParam String jsonData) throws Exception {
        jsonData = URLDecoder.decode(jsonData, "UTF-8");
        ServicePackageDO servicePackageDO = toEntity(jsonData, ServicePackageDO.class);
        servicePackageService.create(servicePackageDO);
        return success("操作成功");
@ -76,6 +84,7 @@ public class ServicePackageEndpoint extends EnvelopRestEndpoint {
    public Envelop deleteById(
            @ApiParam(name = "jsonStr", value = "Json数据", required = false) @RequestParam String jsonStr
    ) throws Exception {
        jsonStr = URLDecoder.decode(jsonStr, "UTF-8");
        ParamQvo qvo = JSON.parseObject(jsonStr, ParamQvo.class);
        servicePackageService.deleteById(qvo);
        return success("删除成功");
@ -87,12 +96,45 @@ public class ServicePackageEndpoint extends EnvelopRestEndpoint {
    public Envelop changeState(
            @ApiParam(name = "jsonStr", value = "Json数据", required = false) @RequestParam String jsonStr
    ) throws Exception {
        jsonStr = URLDecoder.decode(jsonStr, "UTF-8");
        ParamQvo qvo = JSON.parseObject(jsonStr, ParamQvo.class);
        servicePackageService.changeState(qvo);
        return success("删除成功");
    }
    /**
     * 配置服务项计划
     */
    @PostMapping(value = "/changeItemConfig")
    @ApiOperation(value = "配置服务项计划成功")
    public Envelop changeItemConfig(
            @ApiParam(name = "jsonStr", value = "Json数据", required = false) @RequestParam String jsonStr
    ) throws Exception {
        jsonStr = URLDecoder.decode(jsonStr, "UTF-8");
        System.out.println("入参:" + JSON.toJSONString(jsonStr));
        ParamQvo qvo = JSON.parseObject(jsonStr, ParamQvo.class);
        itemConfigService.changeItemConfig(qvo);
        return success("配置服务项计划成功");
    }
    /**
     * 根据服务包查询所有服务项配置
     */
    @GetMapping(value = "/findItemConfig")
    @ApiOperation(value = "根据服务包查询所有服务项配置")
    public Envelop findItemConfig(
            @ApiParam(name = "jsonStr", value = "Json数据", required = false) @RequestParam String jsonStr
    ) throws Exception {
        jsonStr = URLDecoder.decode(jsonStr, "UTF-8");
        System.out.println("入参:" + JSON.toJSONString(jsonStr));
        ParamQvo qvo = JSON.parseObject(jsonStr, ParamQvo.class);
        List<Map<String, Object>> list = itemConfigService.findItemConfig(qvo);
        return success("配置服务项计划成功", list);
    }
    //--------------------------------------------------------------------------------------
    //
    //--------------------------------------------------------------------------------------

+ 18 - 36
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/servicePackage/ServicePackageItemEndpoint.java

@ -21,6 +21,7 @@ import org.springframework.http.MediaType;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;
import java.net.URLDecoder;
import java.util.List;
import java.util.Map;
@ -44,48 +45,45 @@ public class ServicePackageItemEndpoint extends EnvelopRestEndpoint {
    @GetMapping(value = "getItemList")
    @ApiOperation(value = "查询所有服务项")
    public PageEnvelop<Map<String, Object>> getItemList(
            @ApiParam(name = "leasedCode", value = "租户code") @RequestParam(value = "leasedCode", required = false) String leasedCode,
            @ApiParam(name = "orgCode", value = "机构code") @RequestParam(value = "orgCode", required = false) String orgCode,
            @ApiParam(name = "itemName", value = "服务项名称") @RequestParam(value = "itemName", required = false) String itemName,
            @ApiParam(name = "status", value = "状态") @RequestParam(value = "status", required = false) String status,
            @ApiParam(name = "configureIf", value = "是否配置项") @RequestParam(value = "configureIf", required = false) String configureIf,
            @ApiParam(name = "pageIf", value = "是否分页") @RequestParam(value = "pageIf", required = false) String pageIf,
            @ApiParam(name = "page", value = "页码") @RequestParam(value = "page", required = false) int page,
            @ApiParam(name = "pageSize", value = "数量") @RequestParam(value = "pageSize", required = false) int pageSize
            @ApiParam(name = "jsonStr", value = "Json数据", required = false) @RequestParam String jsonStr
    ) throws Exception {
        Map<String, Object> map = servicePackageItemService.getItemList(leasedCode, orgCode, itemName, status, configureIf,pageIf, page, pageSize);
        jsonStr = URLDecoder.decode(jsonStr, "UTF-8");
        System.out.println("入参:" + JSON.toJSONString(jsonStr));
        ParamQvo qvo = JSON.parseObject(jsonStr, ParamQvo.class);
        Map<String, Object> map = servicePackageItemService.getItemList(qvo);
        List<Map<String, Object>> list = (List<Map<String, Object>>) map.get("list");
        Integer count = (Integer) map.get("count");
        return success(list, count, page, pageSize);
        return success(list, count, qvo.getPage(), qvo.getPageSize());
    }
    @PostMapping(value = "update")
    @ApiOperation(value = "更新")
    public ObjEnvelop<ServicePackageItemDO> update(
    @PostMapping(value = "create")
    @ApiOperation(value = "创建")
    public Envelop create(
            @ApiParam(name = "jsonData", value = "Json数据", required = true)
            @RequestParam String jsonData) throws Exception {
        ServicePackageItemDO servicePackageItemDO = toEntity(jsonData, ServicePackageItemDO.class);
        if (null == servicePackageItemDO.getId()) {
            return failed("ID不能为空", ObjEnvelop.class);
        JSONObject result = servicePackageItemService.create(servicePackageItemDO);
        if (StringUtils.endsWithIgnoreCase(ConstantUtils.FAIL, result.getString("response"))) {
            return failed(result.getString("msg"));
        }
        servicePackageItemDO = servicePackageItemService.save(servicePackageItemDO);
        return success(servicePackageItemDO);
        return success(result.get("msg"));
    }
    /**
     * 失效 del改成0
     * lapse
     * 改变状态 del改成0
     */
    @PostMapping(value = "changeState")
    @ApiOperation(value = "失效")
    @ApiOperation(value = "改变状态")
    public ObjEnvelop changeState(
            @ApiParam(name = "jsonStr", value = "jsonStr", required = true) @RequestParam String jsonStr) throws Exception {
        jsonStr = URLDecoder.decode(jsonStr, "UTF-8");
        ParamQvo qvo = JSON.parseObject(jsonStr, ParamQvo.class);
        if (org.apache.commons.lang3.StringUtils.isBlank(qvo.getId())) {
            return failed("ID不能为空", ObjEnvelop.class);
        }
        System.out.println("参数:" + JSON.toJSONString(qvo));
        ServicePackageItemDO entity = servicePackageItemService.changeState(qvo);
        return success(entity);
    }
@ -100,19 +98,6 @@ public class ServicePackageItemEndpoint extends EnvelopRestEndpoint {
    }
    @PostMapping(value = "create")
    @ApiOperation(value = "创建")
    public Envelop create(
            @ApiParam(name = "jsonData", value = "Json数据", required = true)
            @RequestParam String jsonData) throws Exception {
        ServicePackageItemDO servicePackageItemDO = toEntity(jsonData, ServicePackageItemDO.class);
        JSONObject result = servicePackageItemService.create(servicePackageItemDO);
        if (StringUtils.endsWithIgnoreCase(ConstantUtils.FAIL, result.getString("response"))) {
            return failed(result.getString("msg"));
        }
        return success(result.get("msg"));
    }
    //----------------------------------------------------------------------------------------------
    //
@ -129,9 +114,6 @@ public class ServicePackageItemEndpoint extends EnvelopRestEndpoint {
    }
    @GetMapping(value = "page")
    @ApiOperation(value = "获取分页")
    public PageEnvelop<ServicePackageItemDO> page(

+ 174 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/servicePackage/ServicePackageSubItemEndpoint.java

@ -0,0 +1,174 @@
package com.yihu.jw.base.endpoint.servicePackage;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.support.ExcelTypeEnum;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.base.service.servicePackage.ServicePackageSubItemService;
import com.yihu.jw.base.util.ConstantUtils;
import com.yihu.jw.base.vo.excel.SubItemExcelVo;
import com.yihu.jw.entity.base.servicePackage.ServicePackageSubItemDO;
import com.yihu.jw.entity.base.user.UserDO;
import com.yihu.jw.restmodel.qvo.ParamQvo;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.PageEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
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.http.MediaType;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.URLDecoder;
import java.net.URLEncoder;
import java.util.List;
import java.util.Map;
@RestController
@RequestMapping(value = "servicePackageSubItem", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(value = "服务子项管理", description = "服务子项管理", tags = {"wlyy基础服务 - 服务项管理服务接口"})
public class ServicePackageSubItemEndpoint extends EnvelopRestEndpoint {
    @Autowired
    private ServicePackageSubItemService subItemService;
    /**
     * 查询所有服务子项
     */
    @GetMapping(value = "getItemList")
    @ApiOperation(value = "查询所有服务项")
    public PageEnvelop<Map<String, Object>> getSubItemList(
            @ApiParam(name = "jsonStr", value = "Json数据", required = true) @RequestParam String jsonStr
    ) throws Exception {
        jsonStr = URLDecoder.decode(jsonStr, "UTF-8");
        ParamQvo qvo = JSON.parseObject(jsonStr, ParamQvo.class);
        Map<String, Object> map = subItemService.getSubItemList(qvo);
        List<Map<String, Object>> list = (List<Map<String, Object>>) map.get("list");
        Integer count = (Integer) map.get("count");
        return success(list, count, qvo.getPage(), qvo.getPageSize());
    }
    @PostMapping(value = "createSubItem")
    @ApiOperation(value = "创建服务子项")
    public Envelop createSubItem(
            @ApiParam(name = "jsonStr", value = "Json数据", required = true) @RequestParam String jsonStr) throws Exception {
        jsonStr = URLDecoder.decode(jsonStr, "UTF-8");
        ServicePackageSubItemDO subItemDO = toEntity(jsonStr, ServicePackageSubItemDO.class);
        JSONObject result = subItemService.createSubItem(subItemDO);
        if (StringUtils.endsWithIgnoreCase(ConstantUtils.FAIL, result.getString("response"))) {
            return failed(result.getString("msg"));
        }
        return success(result.get("msg"));
    }
    /**
     * 改变状态
     */
    @PostMapping(value = "changeState")
    @ApiOperation(value = "改变状态")
    public ObjEnvelop changeState(
            @ApiParam(name = "jsonStr", value = "jsonStr", required = true) @RequestParam String jsonStr) throws Exception {
        try {
            jsonStr = URLDecoder.decode(jsonStr, "UTF-8");
            ParamQvo qvo = JSON.parseObject(jsonStr, ParamQvo.class);
            if (org.apache.commons.lang3.StringUtils.isBlank(qvo.getId())) {
                return failed("ID不能为空", ObjEnvelop.class);
            }
            System.out.println("参数:" + JSON.toJSONString(qvo));
            ServicePackageSubItemDO entity = subItemService.changeState(qvo);
            return success(entity);
        } catch (Exception e) {
            e.printStackTrace();
            return failedObjEnvelopException(e);
        }
    }
    @PostMapping(value = "deleteById")
    @ApiOperation(value = "删除")
    public Envelop delete(
            @ApiParam(name = "ids", value = "id串,中间用,分隔", required = true) @RequestParam(value = "ids") String ids) throws Exception {
        subItemService.deleteById(ids);
        return success("删除成功");
    }
    /**
     * 导入数据
     */
    @PostMapping(value = "/importSubItemExcel")
    public void importSubItemExcel(
            @ApiParam(value = "文件", required = true)
            @RequestParam(value = "file", required = true) MultipartFile file) {
        try {
            //获取文件的输入流
            InputStream inputStream = file.getInputStream();
            List<SubItemExcelVo> list = EasyExcel.read(inputStream)
                    .head(SubItemExcelVo.class)
                    .sheet(0)
                    .headRowNumber(1)
                    .doReadSync();
            subItemService.importSubItemExcel(list);
        } catch (Exception exception) {
            throw new RuntimeException(exception);
        }
    }
    /**
     * 导出数据
     */
    @GetMapping("/exportSubItemExcel")
    public void exportSubItemExcel(
            HttpServletResponse response,
            @ApiParam(name = "jsonStr", value = "jsonStr", required = false) @RequestParam(value = "jsonStr") String jsonStr
    ) throws Exception {
        OutputStream outputStream = response.getOutputStream();
        try {
            jsonStr = URLDecoder.decode(jsonStr, "UTF-8");
            System.out.println("入参:" + JSON.toJSONString(jsonStr));
            ParamQvo qvo = JSON.parseObject(jsonStr, ParamQvo.class);
            this.setExcelResponseProp(response, "服务子项");
            List<SubItemExcelVo> resultList = subItemService.getSubItemVoList(qvo);
            EasyExcel.write(outputStream, SubItemExcelVo.class)
                    .excelType(ExcelTypeEnum.XLSX)
                    .sheet("服务子项")
                    .doWrite(resultList);
        } catch (Exception e) {
            throw new RuntimeException(e);
        } finally {
            outputStream.flush();
            outputStream.close();
        }
    }
    /**
     * 设置响应结果
     */
    private void setExcelResponseProp(HttpServletResponse response, String rawFileName) throws Exception {
        //设置内容类型
        response.setContentType("application/vnd.vnd.ms-excel");
        //设置编码格式
        response.setCharacterEncoding("utf-8");
        //设置导出文件名称(避免乱码)
        String fileName = URLEncoder.encode(rawFileName.concat(".xlsx"), "UTF-8");
        // 设置响应头
        response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName);
    }
}

ファイルの差分が大きいため隠しています
+ 56 - 18
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/specialist/rehabilitation/RehabilitationPlanController.java


+ 38 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/service/dict/BaseTableDictService.java

@ -0,0 +1,38 @@
package com.yihu.jw.base.service.dict;
import com.yihu.jw.dict.dao.BaseDrugUseDictDao;
import com.yihu.jw.dict.dao.BaseTableDictDao;
import com.yihu.jw.entity.base.dict.BaseDrugUseDictDO;
import com.yihu.jw.entity.dict.BaseTableDict;
import com.yihu.jw.mysql.query.BaseJpaService;
import com.yihu.jw.restmodel.qvo.ParamQvo;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
@Service
public class BaseTableDictService extends BaseJpaService<BaseDrugUseDictDO, BaseDrugUseDictDao> {
    @Autowired
    private BaseTableDictDao tableDictDao;
    @Autowired
    JdbcTemplate jdbcTemplate;
    public void saveTableDict(BaseTableDict entity) {
        tableDictDao.save(entity);
    }
    public List<Map<String, Object>> findDictByName(ParamQvo qvo) {
        String sql = " select * from base_table_dict where 1=1 ";
        if (StringUtils.isNotBlank(qvo.getName())) {
            sql += " and  dict_name='" + qvo.getName() + "'";
        }
        List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);
        return list;
    }
}

+ 91 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/service/followup/FollowupTemplateService.java

@ -0,0 +1,91 @@
package com.yihu.jw.base.service.followup;
import com.yihu.jw.base.dao.followup.FollowupTemplateDao;
import com.yihu.jw.entity.followup.FollowupTemplate;
import com.yihu.jw.mysql.query.BaseJpaService;
import com.yihu.jw.restmodel.qvo.ParamQvo;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service
public class FollowupTemplateService extends BaseJpaService<FollowupTemplate, FollowupTemplateDao> {
    @Autowired
    private FollowupTemplateDao followupTemplateDao;
    @Autowired
    JdbcTemplate jdbcTemplate;
    public HashMap<String, Object> findList(ParamQvo qvo) {
        String detailSql = "SELECT * ";
        String countSql = "SELECT COUNT(1) ";
        String conditionSql = " FROM base_followup_template WHERE 1=1 ";
        String pageSql = "";
        if (StringUtils.isNotBlank(qvo.getId())) {
            conditionSql += " AND `id`='" + qvo.getId() + "'";
        }
        if (StringUtils.isNotBlank(qvo.getSearchKey())) {
            conditionSql += " AND `template_name`='" + qvo.getSearchKey() + "'";
        }
        if (StringUtils.isNotBlank(qvo.getStatus())) {
            conditionSql += " AND `status`='" + qvo.getStatus() + "'";
        }
        if (StringUtils.isNotBlank(qvo.getLeasedCode())) {
            conditionSql += " AND `leased_code`='" + qvo.getLeasedCode() + "'";
        }
        if (StringUtils.isNotBlank(qvo.getOrgCode())) {
            conditionSql += " AND `org_code`='" + qvo.getOrgCode() + "'";
        }
        if (StringUtils.isNotBlank(qvo.getPageIf())) {
            pageSql = "limit " + (qvo.getPage() - 1) * qvo.getPageSize() + "," + qvo.getPageSize();
        }
        //查询
        detailSql += conditionSql + pageSql;
        countSql += conditionSql;
        List<Map<String, Object>> list = jdbcTemplate.queryForList(detailSql);
        Integer count = jdbcTemplate.queryForObject(countSql, Integer.class);
        HashMap<String, Object> map = new HashMap<>();
        map.put("list", list);
        map.put("count", count);
        return map;
    }
    /**
     * 创建模板
     */
    public FollowupTemplate createTemplate(FollowupTemplate vo) {
        FollowupTemplate entity = followupTemplateDao.save(vo);
        return entity;
    }
    /**
     * 改变模板状态
     */
    public FollowupTemplate changeTemplateStatus(ParamQvo qvo) throws Exception {
        FollowupTemplate entity = followupTemplateDao.findById(qvo.getId()).orElse(null);
        if (entity != null) {
            entity.setStatus(qvo.getStatus());
            FollowupTemplate save = followupTemplateDao.save(entity);
            return save;
        } else {
            throw new Exception("没找到模板信息");
        }
    }
    /**
     * 删除模板
     */
    public void deleteTemplate(ParamQvo qvo) {
        String sql = "DELETE FROM base_followup_template WHERE 1=1 AND id='" + qvo.getId() + "'";
        jdbcTemplate.execute(sql);
    }
}

+ 66 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/service/servicePackage/ServiceItemConfigService.java

@ -0,0 +1,66 @@
package com.yihu.jw.base.service.servicePackage;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.jw.base.dao.servicePackage.ServiceItemConfigDao;
import com.yihu.jw.entity.base.servicePackage.ServiceItemConfig;
import com.yihu.jw.mysql.query.BaseJpaService;
import com.yihu.jw.restmodel.qvo.ParamQvo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
 * @author yeshijie on 2018/8/17.
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class ServiceItemConfigService extends BaseJpaService<ServiceItemConfig, ServiceItemConfigDao> {
    private Logger logger = LoggerFactory.getLogger(ServiceItemConfigService.class);
    @Autowired
    ServiceItemConfigDao itemConfigDao;
    @Autowired
    JdbcTemplate jdbcTemplate;
    /**
     * 保存服务项的配置
     */
    public void changeItemConfig(ParamQvo qvo) throws Exception {
        String jsonContent = qvo.getJsonContent();
        ObjectMapper objectMapper = new ObjectMapper();
        //转换成数组
        List<ServiceItemConfig> itemConfigList = objectMapper.readValue(jsonContent, new TypeReference<List<ServiceItemConfig>>() {
        });
        String collect = itemConfigList.stream().map(vo -> String.valueOf("'" + vo.getServerItemId() + "'"))
                .collect(Collectors.joining(",", "(", ") "));
        //删除服务项的配置
        String sql = " DELETE FROM base_service_item_config q WHERE q.package_id='" + qvo.getId() + "' AND q.server_item_id IN " + collect;
        jdbcTemplate.execute(sql);
        //保存
        itemConfigDao.saveAll(itemConfigList);
    }
    public List<Map<String, Object>> findItemConfig(ParamQvo qvo) {
        String sql = "SELECT\n" +
                "	b.name,a.* \n" +
                "FROM\n" +
                "	base_service_item_config a\n" +
                "	INNER JOIN base_service_package_item b ON a.package_id = b.service_package_id \n" +
                "	AND a.server_item_id = b.service_package_item_id\n" +
                "	WHERE 1=1 AND a.package_id='" + qvo.getId() + "'";
        List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);
        return list;
    }
}

+ 29 - 23
svr/svr-base/src/main/java/com/yihu/jw/base/service/servicePackage/ServicePackageItemService.java

@ -50,15 +50,9 @@ public class ServicePackageItemService extends BaseJpaService<ServicePackageItem
            }
        } else {
            //修改
            ServicePackageItemDO oldItemDO = servicePackageItemDao.findById(itemDO.getId()).orElse(null);
            oldItemDO.setName(itemDO.getName());
            oldItemDO.setDel(itemDO.getDel());
            oldItemDO.setCode(itemDO.getCode());
            oldItemDO.setFeeType(itemDO.getFeeType());
            oldItemDO.setIntroduce(itemDO.getIntroduce());
            servicePackageItemDao.save(oldItemDO);
            servicePackageItemDao.save(itemDO);
            //删除关联表重新添加
            String delSql = " DELETE FROM base_service_package_item_relational WHERE item_id='" + oldItemDO.getId() + "'";
            String delSql = " DELETE FROM base_service_package_item_relational WHERE item_id='" + itemDO.getId() + "'";
            jdbcTemplate.execute(delSql);
            //加入关联表
            String subItemIdList = itemDO.getSubItemId();
@ -75,30 +69,37 @@ public class ServicePackageItemService extends BaseJpaService<ServicePackageItem
        return result;
    }
    public HashMap<String, Object> getItemList(String leasedCode, String orgCode, String itemName, String status, String configureIf, String pageIf, int page, int pageSize) {
        String detailSql = "SELECT * ";
    public HashMap<String, Object> getItemList(ParamQvo qvo) {
        String detailSql = "SELECT a.*, " +
                " (SELECT GROUP_CONCAT(q.sub_item_id) FROM base_service_package_item_relational q WHERE q.item_id=a.id) 'subItemId' ";
        String countSql = "SELECT count(1) ";
        String pageSql = "";
        String sql = " FROM base_service_package_item WHERE 1=1 \n";
        if (StringUtils.isNotBlank(configureIf)) {
        String sql = " FROM base_service_package_item a WHERE 1=1 \n";
        if (StringUtils.isNotBlank(qvo.getConfigureIf())) {
            //添加的项
            sql += " AND service_package_id ='system'  ";
            sql += " AND a.service_package_id ='system'  ";
        }
        if (StringUtils.isNotBlank(qvo.getId())) {
            sql += " AND a.id ='" + qvo.getId() + "'";
        }
        if (StringUtils.isNotBlank(qvo.getParentId())) {
            sql += " AND a.service_package_id ='" + qvo.getParentId() + "'";
        }
        if (StringUtils.isNotBlank(leasedCode)) {
            sql += " AND leased_code ='" + leasedCode + "'";
        if (StringUtils.isNotBlank(qvo.getLeasedCode())) {
            sql += " AND a.leased_code ='" + qvo.getLeasedCode() + "'";
        }
        if (StringUtils.isNotBlank(orgCode)) {
            sql += " AND org_code ='" + orgCode + "'";
        if (StringUtils.isNotBlank(qvo.getOrgCode())) {
            sql += " AND a.org_code ='" + qvo.getOrgCode() + "'";
        }
        if (StringUtils.isNotBlank(status)) {
            sql += " AND del ='" + status + "'";
        if (StringUtils.isNotBlank(qvo.getStatus())) {
            sql += " AND a.del ='" + qvo.getStatus() + "'";
        }
        if (StringUtils.isNotBlank(itemName)) {
            sql += " AND `name` LIKE '%" + itemName + "%'";
        if (StringUtils.isNotBlank(qvo.getItemName())) {
            sql += " AND a.`name` LIKE '%" + qvo.getItemName() + "%'";
        }
        if (StringUtils.isNotBlank(pageIf)) {
        if (StringUtils.isNotBlank(qvo.getPageIf())) {
            //需要分页
            pageSql = " limit " + (page-1) * pageSize + "," + pageSize;
            pageSql = " limit " + (qvo.getPage() - 1) * qvo.getPageSize() + "," + qvo.getPageSize();
        }
        countSql += sql;
        detailSql += sql + pageSql;
@ -125,5 +126,10 @@ public class ServicePackageItemService extends BaseJpaService<ServicePackageItem
        String delSql = "DELETE FROM base_service_package_item WHERE id IN ";
        delSql += collect;
        jdbcTemplate.execute(delSql);
        //删除关联关系
        String delRelationalSql = "DELETE FROM base_service_package_item_relational WHERE item_id in " + collect;
        jdbcTemplate.execute(delRelationalSql);
    }
}

+ 22 - 16
svr/svr-base/src/main/java/com/yihu/jw/base/service/servicePackage/ServicePackageService.java

@ -54,24 +54,25 @@ public class ServicePackageService extends BaseJpaService<ServicePackageDO, Serv
            packageVo = servicePackageDao.save(packageVo);
        } else {
            //修改
            ServicePackageDO oldDO = servicePackageDao.findById(packageVo.getId()).orElse(null);
            oldDO.setName(packageVo.getName());
            oldDO.setDel(packageVo.getDel());
            oldDO.setType(packageVo.getType());
            oldDO.setIntroduce(packageVo.getIntroduce());
            oldDO.setOrgCode(packageVo.getOrgCode());
            oldDO.setOrgName(packageVo.getOrgName());
            oldDO.setLeasedCode(packageVo.getLeasedCode());
            oldDO.setLeasedName(packageVo.getLeasedName());
//            ServicePackageDO oldDO = servicePackageDao.findById(packageVo.getId()).orElse(null);
//            oldDO.setName(packageVo.getName());
//            oldDO.setDel(packageVo.getDel());
//            oldDO.setType(packageVo.getType());
//            oldDO.setIntroduce(packageVo.getIntroduce());
//            oldDO.setOrgCode(packageVo.getOrgCode());
//            oldDO.setOrgName(packageVo.getOrgName());
//            oldDO.setLeasedCode(packageVo.getLeasedCode());
//            oldDO.setLeasedName(packageVo.getLeasedName());
            //更新服务包
            packageVo = servicePackageDao.save(oldDO);
            packageVo = servicePackageDao.save(packageVo);
            //删除服务项-根据server_page_id
            servicePackageItemDao.deleteByServicePackageId(oldDO.getId());
            servicePackageItemDao.deleteByServicePackageId(packageVo.getId());
        }
        //保存服务项
        List<ServicePackageItemDO> saveItemList = new ArrayList<>();
        for (ServicePackageItemDO item : itemList) {
            item.setCreateTime(dateFormat.format(new Date()));
            item.setServicePackageId(packageVo.getId());
            saveItemList.add(item);
        }
        servicePackageItemDao.saveAll(saveItemList);
@ -81,13 +82,16 @@ public class ServicePackageService extends BaseJpaService<ServicePackageDO, Serv
    }
    public HashMap<String, Object> findList(String leasedCode, String orgCode, String pageName, String status, int page, int size) {
    public HashMap<String, Object> findList(String id, String leasedCode, String orgCode, String pageName, String status, int page, int size) {
        String detailSql = "SELECT\n" +
                "	(SELECT GROUP_CONCAT(b.`name`) FROM  base_service_package_item b WHERE b.service_package_id=a.id) 'pageItemName',\n" +
                "	a.* \n";
        String countSql = "SELECT count(1)  ";
        String sql = " FROM 	base_service_package a  WHERE 1 =1 ";
        if (StringUtils.isNotBlank(id)) {
            sql += " AND a.id='" + id + "'";
        }
        if (StringUtils.isNotBlank(status)) {
            sql += " AND a.del='" + status + "'";
        }
@ -119,17 +123,19 @@ public class ServicePackageService extends BaseJpaService<ServicePackageDO, Serv
        String collect = list.stream().map(map -> String.valueOf("'" + map.get("itemId") + "'")).collect(Collectors.joining(",", "(", ") "));
        //删除服务部
        String sql01 = " DELETE FROM base_service_package WHERE id='" + qvo.getId() + "'";
        //删除服务项
        //删除关联的服务项
        String sql02 = " DELETE FROM base_service_package_item WHERE service_package_id='" + qvo.getId() + "'";
        //删除关联关系
        String sql03 = " DELETE FROM base_service_package_item_relational WHERE item_id IN " + collect;
        jdbcTemplate.execute(sql03);
        if (!list.isEmpty()) {
            String sql03 = " DELETE FROM base_service_package_item_relational WHERE item_id IN " + collect;
            jdbcTemplate.execute(sql03);
        }
        jdbcTemplate.execute(sql02);
        jdbcTemplate.execute(sql01);
    }
    public void changeState(ParamQvo qvo) {
        String sql = " UPDATE  base_service_package SET del='" + qvo.getStatus() + "'' WHERE id='" + qvo.getId() + "'";
        String sql = " UPDATE  base_service_package SET del='" + qvo.getStatus() + "' WHERE id='" + qvo.getId() + "'";
        jdbcTemplate.execute(sql);
    }
}

+ 188 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/service/servicePackage/ServicePackageSubItemService.java

@ -0,0 +1,188 @@
package com.yihu.jw.base.service.servicePackage;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.base.dao.servicePackage.ServicePackageSubItemDao;
import com.yihu.jw.base.vo.excel.SubItemExcelVo;
import com.yihu.jw.entity.base.servicePackage.ServicePackageSubItemDO;
import com.yihu.jw.mysql.query.BaseJpaService;
import com.yihu.jw.restmodel.qvo.ParamQvo;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.stereotype.Service;
import java.util.*;
import java.util.stream.Collectors;
/**
 * Created by yeshijie on 2021/2/23.
 */
@Service
public class ServicePackageSubItemService extends BaseJpaService<ServicePackageSubItemDO, ServicePackageSubItemDao> {
    @Autowired
    private ServicePackageSubItemDao subItemDao;
    public Map<String, Object> getSubItemList(ParamQvo qvo) {
        String detailSql = "select * ";
        String countSql = " select count(1) ";
        String pageSql = "";
        String sql = " FROM base_service_package_sub_item a   ";
        if (StringUtils.isNotBlank(qvo.getParentId())) {
            sql += " INNER JOIN base_service_package_item_relational b ON a.id = b.sub_item_id  ";
        }
        sql += " WHERE 1=1 ";
        if (StringUtils.isNotBlank(qvo.getId())) {
            sql += "AND a.id = '" + qvo.getId() + "'";
        }
        if (StringUtils.isNotBlank(qvo.getLeasedCode())) {
            sql += "AND a.leased_code = '" + qvo.getLeasedCode() + "'";
        }
        if (StringUtils.isNotBlank(qvo.getOrgCode())) {
            sql += "AND a.org_code = '" + qvo.getOrgCode() + "'";
        }
        if (StringUtils.isNotBlank(qvo.getStatus())) {
            sql += "AND a.`status` = '" + qvo.getStatus() + "'";
        }
        if (StringUtils.isNotBlank(qvo.getName())) {
            sql += "AND a.`name` like '%" + qvo.getName() + "%'";
        }
        if (StringUtils.isNotBlank(qvo.getParentId())) {
            //创建的服务项的id
            sql += "AND b.`item_id` = '" + qvo.getParentId() + "'";
        }
        if (StringUtils.isNotBlank(qvo.getDictItemId())) {
            sql += " and  a.dict_item_id='" + qvo.getDictItemId() + "'";
        }
        //分页
        if (StringUtils.isNotBlank(qvo.getPageIf())) {
            pageSql += " limit " + (qvo.getPage() - 1) * qvo.getPageSize() + "," + qvo.getPageSize();
        }
        detailSql += sql + pageSql;
        countSql += sql;
        Integer count = jdbcTemplate.queryForObject(countSql, Integer.class);
        List<Map<String, Object>> list = jdbcTemplate.queryForList(detailSql);
        HashMap<String, Object> map = new HashMap<>();
        map.put("count", count);
        map.put("list", list);
        return map;
    }
    /**
     * 用实体返回
     */
    public List<SubItemExcelVo> getSubItemVoList(ParamQvo qvo) {
        String detailSql = "SELECT\n" +
                " c.`name`'itemName',a.`name` 'subItemName' ,a.*\n" +
                "FROM\n" +
                " base_service_package_sub_item a\n" +
                " INNER JOIN base_service_package_item_relational b ON a.id = b.sub_item_id \n" +
                " INNER JOIN base_service_package_item c ON b.item_id=c.id\n" +
                "WHERE\n" +
                " 1 = 1;";
        if (StringUtils.isNotBlank(qvo.getId())) {
            detailSql += "AND a.id = '" + qvo.getId() + "'";
        }
        if (StringUtils.isNotBlank(qvo.getLeasedCode())) {
            detailSql += "AND a.leased_code = '" + qvo.getLeasedCode() + "'";
        }
        if (StringUtils.isNotBlank(qvo.getOrgCode())) {
            detailSql += "AND a.org_code = '" + qvo.getOrgCode() + "'";
        }
        if (StringUtils.isNotBlank(qvo.getStatus())) {
            detailSql += "AND a.`status` = '" + qvo.getStatus() + "'";
        }
        if (StringUtils.isNotBlank(qvo.getName())) {
            detailSql += "AND a.`name` like '%" + qvo.getName() + "%'";
        }
        if (StringUtils.isNotBlank(qvo.getParentId())) {
            detailSql += "AND a.`item_id` = '" + qvo.getParentId() + "'";
        }
        List<SubItemExcelVo> list = jdbcTemplate.query(detailSql, new BeanPropertyRowMapper<>(SubItemExcelVo.class));
        return list;
    }
    public JSONObject createSubItem(ServicePackageSubItemDO subItemDO) {
        subItemDO.setCreateTime(new Date());
        ServicePackageSubItemDO entity = subItemDao.save(subItemDO);
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("data", entity);
        jsonObject.put("msg", "操作成功");
        return jsonObject;
    }
    public ServicePackageSubItemDO changeState(ParamQvo qvo) throws Exception {
        ServicePackageSubItemDO entity = subItemDao.findById(qvo.getId()).orElse(null);
        if (entity != null) {
            entity.setStatus(qvo.getStatus());
            ServicePackageSubItemDO save = subItemDao.save(entity);
            return save;
        } else {
            throw new Exception("没有找到数据");
        }
    }
    public void deleteById(String ids) {
        String collect = Arrays.stream(ids.split(",")).map(s -> "'" + s + "'").collect(Collectors.joining(",", "(", ")"));
        String delSql = "DELETE FROM base_service_package_sub_item WHERE id IN ";
        delSql += collect;
        jdbcTemplate.execute(delSql);
    }
    public void importSubItemExcel(List<SubItemExcelVo> list) {
        //查询出所有租户和机构
        String sql01 = " SELECT id,`name` FROM base_saas WHERE `status`='1' ";
        String sql02 = " SELECT id,`code`,`name` FROM\tbase_org WHERE del='1' ";
        String sql03 = " SELECT id,name FROM `base`.`wlyy_rehabilitation_service_item`  ";
        List<Map<String, Object>> leasedList = jdbcTemplate.queryForList(sql01);
        List<Map<String, Object>> orgList = jdbcTemplate.queryForList(sql02);
        List<Map<String, Object>> itemList = jdbcTemplate.queryForList(sql03);
        ArrayList<ServicePackageSubItemDO> resultList = new ArrayList<>();
        for (SubItemExcelVo vo : list) {
            ServicePackageSubItemDO entity = new ServicePackageSubItemDO();
            entity.setCreateTime(new Date());
            entity.setName(vo.getItemName());
            entity.setIntroduce(vo.getIntroduce());
            entity.setSort(vo.getSort());
            if (StringUtils.isNotBlank(vo.getStatus())) {
                if (vo.getStatus().equals("生效")) {
                    entity.setStatus("1");
                } else {
                    entity.setStatus("0");
                }
            }
            for (Map<String, Object> map : leasedList) {
                if (vo.getLeasedName().equals(map.get("name"))) {
                    entity.setLeasedCode(map.get("id").toString());
                    entity.setLeasedName(map.get("name").toString());
                    break;
                }
            }
            for (Map<String, Object> map : orgList) {
                if (vo.getOrgName().equals(map.get("name"))) {
                    entity.setOrgCode(map.get("id").toString());
                    entity.setOrgName(map.get("name").toString());
                    break;
                }
            }
            for (Map<String, Object> map : itemList) {
                if (vo.getItemName().equals(map.get("name"))) {
                    entity.setDictItemId(map.get("id").toString());
                    break;
                }
            }
            resultList.add(entity);
            System.out.println(JSON.toJSONString(entity));
        }
        subItemDao.saveAll(resultList);
    }
}

+ 51 - 5
svr/svr-base/src/main/java/com/yihu/jw/base/service/specialist/rehabilitation/RehabilitationPlanService.java

@ -7,12 +7,14 @@ import com.yihu.jw.base.dao.specialist.rehabilitation.*;
import com.yihu.jw.base.service.specialist.SpecialistHospitalServiceItemService;
import com.yihu.jw.base.service.specialist.SpecialistService;
import com.yihu.jw.base.vo.TemplateDetailVo;
import com.yihu.jw.entity.hospital.doctor.Frequency;
import com.yihu.jw.entity.rehabilitation.RehabilitationPlanningDO;
import com.yihu.jw.entity.specialist.HospitalServiceItemDO;
import com.yihu.jw.entity.specialist.RehabilitationServiceItemDO;
import com.yihu.jw.entity.specialist.rehabilitation.*;
import com.yihu.jw.entity.util.TransforSqlUtl;
import com.yihu.jw.mysql.query.BaseJpaService;
import com.yihu.jw.restmodel.qvo.ParamQvo;
import com.yihu.jw.restmodel.specialist.PatientSignInfoVO;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ListEnvelop;
@ -25,6 +27,7 @@ import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -54,6 +57,10 @@ public class RehabilitationPlanService extends BaseJpaService<RehabilitationPlan
    private RehabilitationTemplateDetailDao templateDetailDao;
    @Autowired
    private PatientRehabilitationPlanDao patientRehabilitationPlanDao;
    @Autowired
    RehabilitationPlanService planService;
    @Autowired
    private RehabilitationDetailDao rehabilitationDetailDao;
    @Autowired
@ -200,6 +207,9 @@ public class RehabilitationPlanService extends BaseJpaService<RehabilitationPlan
            for (RehabilitationServiceItemDO item : itemDOList) {
                if (code.equals(item.getCode())) {
                    detailVo.setName(item.getName());
                    for (RehabilitationTemplateDetailDO detailDO : detailVo.getList()) {
                        detailDO.setName(item.getName());
                    }
                    break;
                }
            }
@ -483,13 +493,14 @@ public class RehabilitationPlanService extends BaseJpaService<RehabilitationPlan
    }
    public HashMap<String, Object> findRehabilitationPlanTemplatenew(
            String templateId, String templateName, String status, String diseaseId, int page, int pageSize) {
            String templateId, String templateName, String status, String diseaseId, String type, String pageIf, int page, int pageSize) {
        String countSql = "select count(1) ";
        String detailSql = "SELECT \n" +
                "  (SELECT GROUP_CONCAT(b.`name`) FROM 	wlyy_rehabilitation_template_detail q \n" +
                "	 INNER JOIN wlyy_rehabilitation_service_item b ON q.hospital_service_item_id=b.`code` WHERE q.template_id=a.id) 'itemName',\n" +
                "	a.*\n";
        String sql = " FROM	wlyy_rehabilitation_plan_template a WHERE 1=1\n";
        String pageSql = "";
        if (StringUtils.isNotBlank(templateId)) {
            sql += " AND a.id = '" + templateName + "' ";
        }
@ -502,15 +513,19 @@ public class RehabilitationPlanService extends BaseJpaService<RehabilitationPlan
        if (StringUtils.isNotBlank(diseaseId)) {
            sql += "  AND a.disease_id='" + diseaseId + "' ";
        }
        if (StringUtils.isNotBlank(type)) {
            sql += "  AND a.type='" + type + "' ";
        }
        if (StringUtils.isNotBlank(pageIf)) {
            pageSql += " LIMIT " + (page - 1) * pageSize + "," + pageSize;
        }
        detailSql += sql + pageSql;
        countSql += sql;
        Integer count = jdbcTemplate.queryForObject(countSql, Integer.class);
        sql += " LIMIT " + (page - 1) * pageSize + "," + pageSize;
        detailSql += sql;
        List<Map<String, Object>> list = jdbcTemplate.queryForList(detailSql);
        Integer count = jdbcTemplate.queryForObject(countSql, Integer.class);
        HashMap<String, Object> map = new HashMap<>();
        map.put("count", count);
        map.put("list", list);
        return map;
    }
@ -546,4 +561,35 @@ public class RehabilitationPlanService extends BaseJpaService<RehabilitationPlan
        List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);
        return list;
    }
    /**
     * 新增整个模板
     *
     * @param templateDO
     * @param details
     * @return
     */
    public ObjEnvelop saveRehabilitationPlanTemplateData(RehabilitationPlanTemplateDO templateDO, List<RehabilitationTemplateDetailDO> details) {
        RehabilitationPlanTemplateDO planTemplateDO = this.createRehabilitationTemplateNew(templateDO);
        this.createRehabilitationTemplateDetail(details, planTemplateDO.getId());
        return ObjEnvelop.getSuccess(SpecialistMapping.api_success, true);
    }
    public RehabilitationPlanTemplateDO changeState(ParamQvo qvo) {
        RehabilitationPlanTemplateDO entity = templateDao.findById(qvo.getId()).orElse(null);
        if (entity != null) {
            entity.setStatus(qvo.getStatus());
            templateDao.save(entity);
            return entity;
        }
        return null;
    }
    public ListEnvelop findFrequencyList() {
        String sql = " SELECT * FROM `base`.`wlyy_frequency` WHERE del='1' ";
        List<Frequency> list = jdbcTemplate.query(sql, new BeanPropertyRowMapper(Frequency.class));
        return ListEnvelop.getSuccess(SpecialistMapping.api_success, list);
    }
}

+ 29 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/vo/excel/SubItemExcelVo.java

@ -0,0 +1,29 @@
package com.yihu.jw.base.vo.excel;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;
/**
 * @author suqinyi
 * @Date 2023/9/26
 */
@Data
public class SubItemExcelVo {
    @ExcelProperty("归属项目名称")
    private String itemName;
    @ExcelProperty("项目名称")
    private String subItemName;
    @ExcelProperty("租户")
    private String leasedName;
    @ExcelProperty("机构")
    private String orgName;
    @ExcelProperty("状态")
    private String status;
    @ExcelProperty("排序")
    private String sort;
    @ExcelProperty("说明")
    private String introduce;
}

+ 5 - 5
svr/svr-base/src/main/resources/application.yml

@ -1033,16 +1033,16 @@ spring:
    port: 6390
    password: Kb6wKDQP1W4 # Redis server port.
basedb: #base数据基础数据数据源,用于跨库查询
  name: base
base:
  url: http://172.17.110.212:10020/
#basedb: #base数据基础数据数据源,用于跨库查询
#  name: base
#base:
#  url: http://172.17.110.212:10020/
fastDFS:
  fastdfs_file_url: http://10.172.0.61:80/
demo:
  flag: true
basedb: #base数据基础数据数据源,用于跨库查询
basedb:
  name: base
base:
  url: http://172.17.110.212:10020/

+ 1 - 1
svr/svr-base/src/main/resources/bootstrap.yml

@ -1,6 +1,6 @@
spring:
  application:
    name: svr-base
    name: svr-base---
  cloud:
    config:
      failFast: true

+ 50 - 50
svr/svr-internet-hospital/src/main/resources/application.yml

@ -24,8 +24,8 @@ spring:
    time-between-eviction-runs-millis: 300000 #在空闲连接回收器线程运行期间休眠的时间值,以毫秒为单位,一般比minEvictableIdleTimeMillis小
  main:
    allow-bean-definition-overriding: true
#      location: D:/work/soft_dev/IdeaWorkSpace/wlyy2.0/svr/svr-patient/temp_file/
#      resolve-lazily: true
  #      location: D:/work/soft_dev/IdeaWorkSpace/wlyy2.0/svr/svr-patient/temp_file/
  #      resolve-lazily: true
  redis:
    database: 0 # Database index used by the connection factory.
@ -38,17 +38,17 @@ spring:
      min-idle: 5  # 连接池中的最小空闲连接
  mail:
    default-encoding: UTF-8
#端口
    #端口
    port: 25
#协议
    #协议
    protocol: smtp
    properties.mail.smtp.auth: true
    properties.mail.smtp.starttls.enable: true
    properties.mail.smtp.starttls.required: true
    host: smtp.163.com
#发送者的邮箱密码
    #发送者的邮箱密码
    password: xmijk181016jkzl
#发送者的邮箱账号
    #发送者的邮箱账号
    username: i_jiankang@163.com
es:
  index:
@ -86,14 +86,14 @@ spring:
    url: jdbc:mysql://172.26.0.104/base?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false
    username: ssgg
    password: ssgg@jkzl2019
#  elasticsearch:
#    cluster-name: jkzl #集群名 默认elasticsearch
#    cluster-nodes: 172.26.0.115:9300,172.26.0.115:9300 #配置es节点信息,逗号分隔,如果没有指定,则启动ClientNode
#    client-transport-sniff: false
#    jest:
#      uris: http://172.26.0.112:9200,http://172.26.0.112:9200
#      connection-timeout: 60000 # Connection timeout in milliseconds.
#      multi-threaded: true # Enable connection requests from multiple execution threads.
  #  elasticsearch:
  #    cluster-name: jkzl #集群名 默认elasticsearch
  #    cluster-nodes: 172.26.0.115:9300,172.26.0.115:9300 #配置es节点信息,逗号分隔,如果没有指定,则启动ClientNode
  #    client-transport-sniff: false
  #    jest:
  #      uris: http://172.26.0.112:9200,http://172.26.0.112:9200
  #      connection-timeout: 60000 # Connection timeout in milliseconds.
  #      multi-threaded: true # Enable connection requests from multiple execution threads.
  activemq:
    broker-url: tcp://172.26.0.116:61616
    user: admin
@ -178,14 +178,14 @@ spring:
    url: jdbc:mysql://172.26.0.104/base?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false
    username: ssgg
    password: ssgg@jkzl2019
#  elasticsearch:
#    cluster-name: jkzl #集群名 默认elasticsearch
#    cluster-nodes: 172.26.0.115:9300,172.26.0.115:9300 #配置es节点信息,逗号分隔,如果没有指定,则启动ClientNode
#    client-transport-sniff: false
#    jest:
#      uris: http://172.26.0.112:9200,http://172.26.0.112:9200
#      connection-timeout: 60000 # Connection timeout in milliseconds.
#      multi-threaded: true # Enable connection requests from multiple execution threads.
  #  elasticsearch:
  #    cluster-name: jkzl #集群名 默认elasticsearch
  #    cluster-nodes: 172.26.0.115:9300,172.26.0.115:9300 #配置es节点信息,逗号分隔,如果没有指定,则启动ClientNode
  #    client-transport-sniff: false
  #    jest:
  #      uris: http://172.26.0.112:9200,http://172.26.0.112:9200
  #      connection-timeout: 60000 # Connection timeout in milliseconds.
  #      multi-threaded: true # Enable connection requests from multiple execution threads.
  activemq:
    broker-url: tcp://172.26.0.116:61616
    user: admin
@ -350,17 +350,17 @@ spring:
        dialect: org.hibernate.dialect.Oracle10gDialect
        show_sql: true
    database: oracle
#    url: jdbc:mysql://172.19.103.77/base?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false
#    username: root
#    password: 123456
#  elasticsearch:
#    cluster-name: jkzl #集群名 默认elasticsearch
#    cluster-nodes: 172.26.0.115:9300,172.26.0.115:9300 #配置es节点信息,逗号分隔,如果没有指定,则启动ClientNode
#    client-transport-sniff: false
#    jest:
#      uris: http://172.26.0.112:9200,http://172.26.0.112:9200
#      connection-timeout: 60000 # Connection timeout in milliseconds.
#      multi-threaded: true # Enable connection requests from multiple execution threads.
  #    url: jdbc:mysql://172.19.103.77/base?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false
  #    username: root
  #    password: 123456
  #  elasticsearch:
  #    cluster-name: jkzl #集群名 默认elasticsearch
  #    cluster-nodes: 172.26.0.115:9300,172.26.0.115:9300 #配置es节点信息,逗号分隔,如果没有指定,则启动ClientNode
  #    client-transport-sniff: false
  #    jest:
  #      uris: http://172.26.0.112:9200,http://172.26.0.112:9200
  #      connection-timeout: 60000 # Connection timeout in milliseconds.
  #      multi-threaded: true # Enable connection requests from multiple execution threads.
  activemq:
    broker-url: tcp://172.26.0.116:61616
    user: admin
@ -445,14 +445,14 @@ spring:
        show_sql: true
    database: oracle
#  elasticsearch:
#    cluster-name: jkzl #集群名 默认elasticsearch
#    cluster-nodes: 172.26.0.115:9300,172.26.0.115:9300 #配置es节点信息,逗号分隔,如果没有指定,则启动ClientNode
#    client-transport-sniff: false
#    jest:
#      uris: http://172.26.0.112:9200,http://172.26.0.112:9200
#      connection-timeout: 60000 # Connection timeout in milliseconds.
#      multi-threaded: true # Enable connection requests from multiple execution threads.
  #  elasticsearch:
  #    cluster-name: jkzl #集群名 默认elasticsearch
  #    cluster-nodes: 172.26.0.115:9300,172.26.0.115:9300 #配置es节点信息,逗号分隔,如果没有指定,则启动ClientNode
  #    client-transport-sniff: false
  #    jest:
  #      uris: http://172.26.0.112:9200,http://172.26.0.112:9200
  #      connection-timeout: 60000 # Connection timeout in milliseconds.
  #      multi-threaded: true # Enable connection requests from multiple execution threads.
  activemq:
    broker-url: tcp://172.26.0.116:61616
    user: admin
@ -806,7 +806,7 @@ spring:
    user: admin
    password: admin
  redis:
#    host: 172.26.0.253 # Redis server host.
    #    host: 172.26.0.253 # Redis server host.
    host: 172.26.0.190 # Redis server host
    port: 6379 # Redis server port
fastDFS:
@ -883,14 +883,14 @@ spring:
    url: jdbc:mysql://10.9.1.247:3310/base?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false
    username: wlyy
    password: qY#j2n5O
#  elasticsearch:
#    cluster-name: jkzl #集群名 默认elasticsearch
#    cluster-nodes: 192.0.33.26:9200 #配置es节点信息,逗号分隔,如果没有指定,则启动ClientNode
#    client-transport-sniff: false
#    jest:
#      uris: http://192.0.33.26:9300
#      connection-timeout: 60000 # Connection timeout in milliseconds.
#      multi-threaded: true # Enable connection requests from multiple execution threads.
  #  elasticsearch:
  #    cluster-name: jkzl #集群名 默认elasticsearch
  #    cluster-nodes: 192.0.33.26:9200 #配置es节点信息,逗号分隔,如果没有指定,则启动ClientNode
  #    client-transport-sniff: false
  #    jest:
  #      uris: http://192.0.33.26:9300
  #      connection-timeout: 60000 # Connection timeout in milliseconds.
  #      multi-threaded: true # Enable connection requests from multiple execution threads.
  activemq:
    broker-url: tcp://59.61.92.90:9103
    user: jkzl

+ 1 - 1
svr/svr-internet-hospital/src/main/resources/bootstrap.yml

@ -1,6 +1,6 @@
spring:
  application:
    name:  svr-internet-hospital-wangzhinan
    name:  svr-internet-hospital---
  cloud:
    config:
      failFast: true