Browse Source

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

wangzhinan 1 year ago
parent
commit
bda3238a0c
21 changed files with 638 additions and 178 deletions
  1. 59 1
      common/common-entity/src/main/java/com/yihu/jw/entity/base/servicePackage/ServicePackageDO.java
  2. 46 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/servicePackage/ServicePackageItemDO.java
  3. 38 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/servicePackage/ServicePackageItemRelationalDO.java
  4. 130 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/servicePackage/ServicePackageSubItemDO.java
  5. 6 2
      common/common-entity/src/main/java/com/yihu/jw/entity/specialist/rehabilitation/TemplateJson.java
  6. 1 0
      common/common-request-mapping/src/main/java/com/yihu/jw/rm/specialist/SpecialistMapping.java
  7. 2 2
      common/commons-util/src/main/java/com/yihu/jw/ehr/util/compress/Zipper.java
  8. 3 3
      common/commons-util/src/main/java/com/yihu/jw/ehr/util/encrypt/RSA.java
  9. 9 9
      common/commons-util/src/main/java/com/yihu/jw/ehr/util/http/HttpUtils.java
  10. 17 0
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/servicePackage/ServicePackageItemRelationalDao.java
  11. 20 0
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/servicePackage/ServicePackageSubItemDao.java
  12. 1 1
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/specialist/rehabilitation/TemplateJsonDao.java
  13. 7 0
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/lifeCare/LifeCareEndpoint.java
  14. 30 51
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/servicePackage/ServicePackageEndpoint.java
  15. 82 36
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/servicePackage/ServicePackageItemEndpoint.java
  16. 19 2
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/specialist/rehabilitation/RehabilitationPlanController.java
  17. 22 0
      svr/svr-base/src/main/java/com/yihu/jw/base/service/servicePackage/ServicePackageItemRelationalService.java
  18. 81 49
      svr/svr-base/src/main/java/com/yihu/jw/base/service/servicePackage/ServicePackageItemService.java
  19. 49 21
      svr/svr-base/src/main/java/com/yihu/jw/base/service/servicePackage/ServicePackageService.java
  20. 10 1
      svr/svr-base/src/main/java/com/yihu/jw/base/service/specialist/rehabilitation/RehabilitationPlanService.java
  21. 6 0
      svr/svr-base/src/main/resources/application.yml

+ 59 - 1
common/common-entity/src/main/java/com/yihu/jw/entity/base/servicePackage/ServicePackageDO.java

@ -1,6 +1,8 @@
package com.yihu.jw.entity.base.servicePackage;
import com.yihu.jw.entity.UuidIdentityEntity;
import com.yihu.jw.entity.UuidIdentityEntityWithCreateTime;
import com.yihu.jw.entity.UuidIdentityEntityWithOperator;
import com.yihu.jw.entity.base.org.BaseOrgDO;
import com.yihu.jw.entity.base.team.BaseTeamDO;
@ -18,7 +20,7 @@ import java.util.List;
 */
@Entity
@Table(name = "base_service_package")
public class ServicePackageDO extends UuidIdentityEntityWithCreateTime implements Serializable {
public class ServicePackageDO extends UuidIdentityEntityWithOperator implements Serializable {
    private String name;//'服务包名称'
    private String type;//服务类型(1养老服务、2医疗服务、3安防监护、4慢病管理)
@ -37,6 +39,62 @@ public class ServicePackageDO extends UuidIdentityEntityWithCreateTime implement
    private String orgCode;
    private String orgName;
    /**
     * 新增字段
     */
    private String  leasedCode;//租户code
    private String  leasedName;//租户name
    private String  serverTimeType;//服务时间类型
    private String  serverTime;//服务期限
    private String  serverTimeDescription;//服务时间说明
    private String createUserCode;//创建人
    @Column(name = "leased_code")
    public String getLeasedCode() {
        return leasedCode;
    }
    public void setLeasedCode(String leasedCode) {
        this.leasedCode = leasedCode;
    }
    @Column(name = "leased_name")
    public String getLeasedName() {
        return leasedName;
    }
    public void setLeasedName(String leasedName) {
        this.leasedName = leasedName;
    }
    @Column(name = "server_time_type")
    public String getServerTimeType() {
        return serverTimeType;
    }
    public void setServerTimeType(String serverTimeType) {
        this.serverTimeType = serverTimeType;
    }
    @Column(name = "server_time")
    public String getServerTime() {
        return serverTime;
    }
    public void setServerTime(String serverTime) {
        this.serverTime = serverTime;
    }
    @Column(name = "server_time_description")
    public String getServerTimeDescription() {
        return serverTimeDescription;
    }
    public void setServerTimeDescription(String serverTimeDescription) {
        this.serverTimeDescription = serverTimeDescription;
    }
    @Transient
    public String getTypeName() {
        return typeName;

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

@ -28,6 +28,52 @@ public class ServicePackageItemDO extends UuidIdentityEntity implements java.io.
    private String createTime;//
    private String dictId;//
    private String topicItem;//所属专题 security 安防专题
    /**
     * 新增字段
     */
    private String leasedCode;//租户code
    private String leasedName;//租户name
    private String subItemType;//是否包含子项目
    @Transient
    private String subItemId;//数据库不存在的字段
    public String getSubItemId() {
        return subItemId;
    }
    public void setSubItemId(String subItemId) {
        this.subItemId = subItemId;
    }
    @Column(name = "sub_item_type")
    public String getSubItemType() {
        return subItemType;
    }
    public void setSubItemType(String subItemType) {
        this.subItemType = subItemType;
    }
    @Column(name = "leased_code")
    public String getLeasedCode() {
        return leasedCode;
    }
    public void setLeasedCode(String leasedCode) {
        this.leasedCode = leasedCode;
    }
    @Column(name = "leased_name")
    public String getLeasedName() {
        return leasedName;
    }
    public void setLeasedName(String leasedName) {
        this.leasedName = leasedName;
    }
    @Column(name = "dict_id")
    public String getDictId() {
        return dictId;

+ 38 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/servicePackage/ServicePackageItemRelationalDO.java

@ -0,0 +1,38 @@
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;
/**
 * 关联表
 * base_service_package_item
 * base_service_package_sub_item
 */
@Entity
@Table(name = "base_service_package_item_relational")
public class ServicePackageItemRelationalDO extends UuidIdentityEntity implements java.io.Serializable {
    @Column(name = "item_id")
    private String itemId;
    @Column(name = "sub_item_id")
    private String subItemId;
    public String getItemId() {
        return itemId;
    }
    public void setItemId(String itemId) {
        this.itemId = itemId;
    }
    public String getSubItemId() {
        return subItemId;
    }
    public void setSubItemId(String subItemId) {
        this.subItemId = subItemId;
    }
}

+ 130 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/servicePackage/ServicePackageSubItemDO.java

@ -0,0 +1,130 @@
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_package_sub_item")
public class ServicePackageSubItemDO extends UuidIdentityEntity implements java.io.Serializable {
    @Column(name = "name")
    private String name;//名称
    @Column(name = "item_id")
    private String itemId;//项目的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;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getItemId() {
        return itemId;
    }
    public void setItemId(String itemId) {
        this.itemId = itemId;
    }
    public String getIntroduce() {
        return introduce;
    }
    public void setIntroduce(String introduce) {
        this.introduce = introduce;
    }
    public String getStatus() {
        return status;
    }
    public void setStatus(String status) {
        this.status = status;
    }
    public String getSort() {
        return sort;
    }
    public void setSort(String sort) {
        this.sort = sort;
    }
    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;
    }
    public String getPhoto() {
        return photo;
    }
    public void setPhoto(String photo) {
        this.photo = photo;
    }
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
}

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

@ -1,6 +1,7 @@
package com.yihu.jw.entity.specialist.rehabilitation;
import com.yihu.jw.entity.IdEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.jw.entity.UuidIdentityEntity;
import javax.persistence.Entity;
import javax.persistence.Table;
@ -12,7 +13,8 @@ import java.util.Date;
 */
@Entity
@Table(name = "template_json")
public class TemplateJson extends IdEntity {
public class TemplateJson extends UuidIdentityEntity {
    private String templateId;
    private String templateName;
    private String templateJson;
@ -43,6 +45,7 @@ public class TemplateJson extends IdEntity {
        this.templateJson = templateJson;
    }
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    public Date getCreateTime() {
        return createTime;
    }
@ -58,4 +61,5 @@ public class TemplateJson extends IdEntity {
    public void setCreateUser(String createUser) {
        this.createUser = createUser;
    }
}

+ 1 - 0
common/common-request-mapping/src/main/java/com/yihu/jw/rm/specialist/SpecialistMapping.java

@ -64,6 +64,7 @@ public class SpecialistMapping {
        public static final String saveRehabilitationPlanTemplate = "/saveRehabilitationPlanTemplate";
        public static final String saveTemplate = "/saveTemplate";
        public static final String findDiseaseList = "/findDiseaseList";
        public static final String findSaveTemplate = "/findSaveTemplate";
        public static final String findRehabilitationPlan = "/findRehabilitationPlan";
        public static final String createRehabilitationPlanTemplate = "/createRehabilitationPlanTemplate";

+ 2 - 2
common/commons-util/src/main/java/com/yihu/jw/ehr/util/compress/Zipper.java

@ -1,6 +1,6 @@
package com.yihu.jw.ehr.util.compress;
import com.yihu.jw.ehr.util.log.LogService;
//import com.yihu.jw.ehr.util.log.LogService;
import net.lingala.zip4j.core.ZipFile;
import net.lingala.zip4j.exception.ZipException;
import net.lingala.zip4j.model.FileHeader;
@ -127,7 +127,7 @@ public class Zipper {
            return new File(zipFileName);
        } catch (ZipException ex) {
            LogService.getLogger(Zipper.class).error(ex.getMessage());
//            LogService.getLogger(Zipper.class).error(ex.getMessage());
        }
        return null;

+ 3 - 3
common/commons-util/src/main/java/com/yihu/jw/ehr/util/encrypt/RSA.java

@ -1,6 +1,6 @@
package com.yihu.jw.ehr.util.encrypt;
import com.yihu.jw.ehr.util.log.LogService;
//import com.yihu.jw.ehr.util.log.LogService;
import java.util.Base64;
import javax.crypto.Cipher;
@ -53,7 +53,7 @@ public class RSA {
            return keyFactory.generatePrivate(pkcs8KeySpec);
        } catch (NoSuchAlgorithmException | InvalidKeySpecException ex) {
            LogService.getLogger(RSA.class).error(ex.getMessage());
//            LogService.getLogger(RSA.class).error(ex.getMessage());
        }
        return null;
@ -67,7 +67,7 @@ public class RSA {
            return keyFactory.generatePublic(x509KeySpec);
        } catch (NoSuchAlgorithmException | InvalidKeySpecException ex) {
            LogService.getLogger(RSA.class).error(ex.getMessage());
//            LogService.getLogger(RSA.class).error(ex.getMessage());
        }
        return null;

+ 9 - 9
common/commons-util/src/main/java/com/yihu/jw/ehr/util/http/HttpUtils.java

@ -1,6 +1,6 @@
package com.yihu.jw.ehr.util.http;
import com.yihu.jw.ehr.util.log.LogService;
//import com.yihu.jw.ehr.util.log.LogService;
import org.apache.http.HttpEntity;
import org.apache.http.HttpStatus;
import org.apache.http.NameValuePair;
@ -71,7 +71,7 @@ public class HttpUtils {
            HttpEntity resEntity = closeableHttpResponse.getEntity();
            int status = closeableHttpResponse.getStatusLine().getStatusCode();
            if (status != HttpStatus.SC_OK) {
                LogService.getLogger().error(" GET: " + url + " " + status);
//                //LogService.getLogger().error(" GET: " + url + " " + status);
            }
            return getResp(status, resEntity);
        } finally {
@ -128,7 +128,7 @@ public class HttpUtils {
            HttpEntity resEntity = closeableHttpResponse.getEntity();
            int status = closeableHttpResponse.getStatusLine().getStatusCode();
            if (status != HttpStatus.SC_OK) {
                LogService.getLogger().error(" POST: " + url + " " + status);
                //LogService.getLogger().error(" POST: " + url + " " + status);
            }
            return getResp(status, resEntity);
        } finally {
@ -169,7 +169,7 @@ public class HttpUtils {
            HttpEntity resEntity = closeableHttpResponse.getEntity();
            int status = closeableHttpResponse.getStatusLine().getStatusCode();
            if (status != HttpStatus.SC_OK) {
                LogService.getLogger().error(" POST: " + url + " " + status);
                //LogService.getLogger().error(" POST: " + url + " " + status);
            }
            return getResp(status, resEntity);
        } finally {
@ -226,7 +226,7 @@ public class HttpUtils {
            HttpEntity resEntity = closeableHttpResponse.getEntity();
            int status = closeableHttpResponse.getStatusLine().getStatusCode();
            if (status != HttpStatus.SC_OK) {
                LogService.getLogger().error(" PUT: " + url + " " + status);
                //LogService.getLogger().error(" PUT: " + url + " " + status);
            }
            return getResp(status, resEntity);
        } finally {
@ -267,7 +267,7 @@ public class HttpUtils {
            HttpEntity resEntity = closeableHttpResponse.getEntity();
            int status = closeableHttpResponse.getStatusLine().getStatusCode();
            if (status != HttpStatus.SC_OK) {
                LogService.getLogger().error(" PUT: " + url + " " + status);
                //LogService.getLogger().error(" PUT: " + url + " " + status);
            }
            return getResp(status, resEntity);
        } finally {
@ -324,7 +324,7 @@ public class HttpUtils {
            HttpEntity resEntity = closeableHttpResponse.getEntity();
            int status = closeableHttpResponse.getStatusLine().getStatusCode();
            if (status != HttpStatus.SC_OK) {
                LogService.getLogger().error(" DELETE: " + url + " " + status);
                //LogService.getLogger().error(" DELETE: " + url + " " + status);
            }
            return getResp(status, resEntity);
        } finally {
@ -388,7 +388,7 @@ public class HttpUtils {
            HttpEntity resEntity = closeableHttpResponse.getEntity();
            int status = closeableHttpResponse.getStatusLine().getStatusCode();
            if (status != HttpStatus.SC_OK) {
                LogService.getLogger().error(" POST UPLOAD: " + url + " " + status);
                //LogService.getLogger().error(" POST UPLOAD: " + url + " " + status);
            }
            return getResp(status, resEntity);
        } finally {
@ -441,7 +441,7 @@ public class HttpUtils {
            HttpEntity resEntity = closeableHttpResponse.getEntity();
            int status = closeableHttpResponse.getStatusLine().getStatusCode();
            if (status != HttpStatus.SC_OK) {
                LogService.getLogger().error(" DOWNLOAD: " + url + " " + status);
                //LogService.getLogger().error(" DOWNLOAD: " + url + " " + status);
            }
            return getRespFile(filePath, resEntity);
        } finally {

+ 17 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/dao/servicePackage/ServicePackageItemRelationalDao.java

@ -0,0 +1,17 @@
package com.yihu.jw.base.dao.servicePackage;
import com.yihu.jw.entity.base.servicePackage.ServicePackageItemRelationalDO;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
/**
 * Created by yeshijie on 2021/2/23.
 */
public interface ServicePackageItemRelationalDao
        extends JpaRepository<ServicePackageItemRelationalDO, String>,
        JpaSpecificationExecutor<ServicePackageItemRelationalDO> {
}

+ 20 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/dao/servicePackage/ServicePackageSubItemDao.java

@ -0,0 +1,20 @@
package com.yihu.jw.base.dao.servicePackage;
import com.yihu.jw.entity.base.servicePackage.ServicePackageItemDO;
import com.yihu.jw.entity.base.servicePackage.ServicePackageSubItemDO;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import java.util.List;
/**
 * Created by yeshijie on 2021/2/23.
 */
public interface ServicePackageSubItemDao
        extends JpaRepository<ServicePackageSubItemDO, String>,
        JpaSpecificationExecutor<ServicePackageSubItemDO> {
}

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

@ -5,7 +5,7 @@ import com.yihu.jw.entity.specialist.rehabilitation.TemplateJson;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
public interface TemplateJsonDao extends PagingAndSortingRepository<TemplateJson, Long>,
public interface TemplateJsonDao extends PagingAndSortingRepository<TemplateJson, String>,
        JpaSpecificationExecutor<TemplateJson> {

+ 7 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/lifeCare/LifeCareEndpoint.java

@ -28,6 +28,13 @@ public class LifeCareEndpoint extends EnvelopRestEndpoint {
    private LifeCareService lifeCareService;
    //----------------------------------------------------------------------------
    @ApiOperation("获取生活照料服务项目列表")
    @RequestMapping(value = "/getServeDictList",method = RequestMethod.GET)
    public PageEnvelop<List<Map<String,Object>>> getServeDictList(@ApiParam(name = "orgName",value = "机构名称",required = false)

+ 30 - 51
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/servicePackage/ServicePackageEndpoint.java

@ -5,7 +5,6 @@ import com.yihu.jw.base.dao.servicePackage.ServicePackageItemDao;
import com.yihu.jw.base.service.servicePackage.ServicePackageService;
import com.yihu.jw.entity.base.servicePackage.ServicePackageDO;
import com.yihu.jw.entity.base.servicePackage.ServicePackageItemDO;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ListEnvelop;
@ -21,7 +20,9 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
@ -38,12 +39,29 @@ public class ServicePackageEndpoint extends EnvelopRestEndpoint {
    private ServicePackageDao servicePackageDao;
    @Autowired
    private ServicePackageItemDao servicePackageItemDao;
    @Autowired
    private WlyyHospitalSysDictDao wlyyHospitalSysDictDao;
    @GetMapping(value = BaseRequestMapping.ServicePackage.PAGE)
    @ApiOperation(value = "获取分页")
    public PageEnvelop<Map<String, Object>> page(
            @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);
        Integer count = (Integer) resultMap.get("count");
        List<Map<String, Object>> list = (List<Map<String, Object>>) resultMap.get("list");
        return success(list, count, page, size);
    }
    @PostMapping(value = BaseRequestMapping.ServicePackage.CREATE)
    @ApiOperation(value = "创建")
    public Envelop create (
    public Envelop create(
            @ApiParam(name = "jsonData", value = "Json数据", required = true)
            @RequestParam String jsonData) throws Exception {
        ServicePackageDO servicePackageDO = toEntity(jsonData, ServicePackageDO.class);
@ -51,69 +69,30 @@ public class ServicePackageEndpoint extends EnvelopRestEndpoint {
        return success("操作成功");
    }
    //--------------------------------------------------------------------------------------
    //
    //--------------------------------------------------------------------------------------
    @PostMapping(value = BaseRequestMapping.ServicePackage.DELETE)
    @ApiOperation(value = "删除")
    public Envelop delete(
            @ApiParam(name = "ids", value = "id串,中间用,分隔", required = true)
            @RequestParam(value = "ids") String ids) throws Exception{
            @RequestParam(value = "ids") String ids) throws Exception {
        servicePackageService.delete(ids.split(","));
        return success("删除成功");
    }
    @GetMapping(value = BaseRequestMapping.ServicePackage.PAGE)
    @ApiOperation(value = "获取分页")
    public PageEnvelop<ServicePackageDO> page (
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
            @RequestParam(value = "sorts", required = false) String sorts,
            @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 {
        List<ServicePackageDO> servicePackageDOS = servicePackageService.search(fields, filters, sorts, page, size);
        List<WlyyHospitalSysDictDO> wlyyHospitalSysDictDOS = wlyyHospitalSysDictDao.findByDictName("serviceType");
        List<WlyyHospitalSysDictDO> wlyyHospitalSysDictDOS1 = wlyyHospitalSysDictDao.findByDictName("isEffect");
        for (ServicePackageDO servicePackageDO:servicePackageDOS){
            List<ServicePackageItemDO> itemDOList = servicePackageItemDao.findByServicePackageId(servicePackageDO.getId());
            List<String> orgNames = itemDOList.stream().map(p -> p.getOrgName()).collect(Collectors.toList()).stream().distinct().collect(Collectors.toList());
//            List<String> teamNames = itemDOList.stream().map(p -> p.getTeamName()).collect(Collectors.toList()).stream().distinct().collect(Collectors.toList());
            List<String> orgCodes = itemDOList.stream().map(p -> p.getOrgCode()).collect(Collectors.toList()).stream().distinct().collect(Collectors.toList());
 //           List<String> teamCodes = itemDOList.stream().map(p -> p.getTeamCode()).collect(Collectors.toList()).stream().distinct().collect(Collectors.toList());
            servicePackageDO.setOrgNames(StringUtils.join(orgNames,","));
//            servicePackageDO.setTeamNames(StringUtils.join(teamNames,","));
            servicePackageDO.setOrgCodes(StringUtils.join(orgCodes,","));
            for (WlyyHospitalSysDictDO wlyyHospitalSysDictDO:wlyyHospitalSysDictDOS){
                if (servicePackageDO.getType().equalsIgnoreCase(wlyyHospitalSysDictDO.getDictCode())){
                    servicePackageDO.setTypeName(wlyyHospitalSysDictDO.getDictValue());
                }
            }
            for (WlyyHospitalSysDictDO wlyyHospitalSysDictDO:wlyyHospitalSysDictDOS1){
                if (servicePackageDO.getDel().equalsIgnoreCase(wlyyHospitalSysDictDO.getDictCode())){
                    servicePackageDO.setDelName(wlyyHospitalSysDictDO.getDictValue());
                }
            }
        }
        int count = (int)servicePackageService.getCount(filters);
        return success(servicePackageDOS, count, page, size);
    }
    @GetMapping(value = "findById")
    @ApiOperation(value = "按id查找")
    public ObjEnvelop<ServicePackageDO> findById (
    public ObjEnvelop<ServicePackageDO> findById(
            @ApiParam(name = "id", value = "id")
            @RequestParam(value = "id", required = true) String id) throws Exception {
        ServicePackageDO servicePackageDO = servicePackageDao.findById(id).orElse(null);
        List<ServicePackageItemDO> itemDOList = servicePackageItemDao.findByServicePackageId(servicePackageDO.getId());
        List<String> orgNames = itemDOList.stream().map(p -> p.getOrgName()).collect(Collectors.toList()).stream().distinct().collect(Collectors.toList());
//        List<String> teamNames = itemDOList.stream().map(p -> p.getTeamName()).collect(Collectors.toList()).stream().distinct().collect(Collectors.toList());
        servicePackageDO.setOrgNames(StringUtils.join(orgNames,","));
        servicePackageDO.setOrgNames(StringUtils.join(orgNames, ","));
//        servicePackageDO.setTeamNames(StringUtils.join(teamNames,","));
        servicePackageDO.setPackageItemDOList(itemDOList);
        return success(servicePackageDO);
@ -121,7 +100,7 @@ public class ServicePackageEndpoint extends EnvelopRestEndpoint {
    @GetMapping(value = BaseRequestMapping.ServicePackage.LIST)
    @ApiOperation(value = "获取列表")
    public ListEnvelop<ServicePackageDO> list (
    public ListEnvelop<ServicePackageDO> list(
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")

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

@ -19,9 +19,8 @@ import org.springframework.http.MediaType;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.List;
import java.util.Map;
/**
 * @author yeshijie on 2021/2/23.
@ -36,44 +35,102 @@ public class ServicePackageItemEndpoint extends EnvelopRestEndpoint {
    @Autowired
    private WlyyHospitalSysDictDao wlyyHospitalSysDictDao;
    @PostMapping(value = "create")
    @ApiOperation(value = "创建")
    public Envelop create (
    /**
     * 查询所有服务项
     */
    @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 = "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
    ) throws Exception {
        Map<String, Object> map = servicePackageItemService.getItemList(leasedCode, orgCode, itemName, status, pageIf, page, pageSize);
        List<Map<String, Object>> list = (List<Map<String, Object>>) map.get("list");
        Integer count = (Integer) map.get("count");
        return success(list, count, page, pageSize);
    }
    @PostMapping(value = "update")
    @ApiOperation(value = "更新")
    public ObjEnvelop<ServicePackageItemDO> update(
            @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"));
        if (null == servicePackageItemDO.getId()) {
            return failed("ID不能为空", ObjEnvelop.class);
        }
        return success(result.get("msg"));
        servicePackageItemDO = servicePackageItemService.save(servicePackageItemDO);
        return success(servicePackageItemDO);
    }
    /**
     * 失效 del改成0
     * lapse
     */
    @PostMapping(value = "lapseItem")
    @ApiOperation(value = "失效")
    public ObjEnvelop lapseItem(
            @ApiParam(name = "itemId", value = "itemId", required = true) @RequestParam String itemId) throws Exception {
        if (org.apache.commons.lang3.StringUtils.isBlank(itemId)) {
            return failed("ID不能为空", ObjEnvelop.class);
        }
        ServicePackageItemDO entity = servicePackageItemService.lapseItem(itemId);
        return success(entity);
    }
    @PostMapping(value = "delete")
    @ApiOperation(value = "删除")
    public Envelop delete(
            @ApiParam(name = "ids", value = "id串,中间用,分隔", required = true)
            @RequestParam(value = "ids") String ids) throws Exception{
        servicePackageItemService.delete(ids.split(","));
            @ApiParam(name = "ids", value = "id串,中间用,分隔", required = true) @RequestParam(value = "ids") String ids) throws Exception {
        servicePackageItemService.deleteById(ids);
        return success("删除成功");
    }
    @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"));
    }
    //----------------------------------------------------------------------------------------------
    //
    //----------------------------------------------------------------------------------------------
    @GetMapping(value = "list")
    @ApiOperation(value = "获取列表")
    public ListEnvelop<ServicePackageItemDO> list(
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段") @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件") @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档") @RequestParam(value = "sorts", required = false) String sorts) throws Exception {
        List<ServicePackageItemDO> servicePackageItemDOS = servicePackageItemService.search(fields, filters, sorts);
        return success(servicePackageItemDOS);
    }
    @GetMapping(value = "page")
    @ApiOperation(value = "获取分页")
    public PageEnvelop<ServicePackageItemDO> page (
    public PageEnvelop<ServicePackageItemDO> page(
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
@ -85,28 +142,17 @@ public class ServicePackageItemEndpoint extends EnvelopRestEndpoint {
            @ApiParam(name = "size", value = "页码", required = true, defaultValue = "15")
            @RequestParam(value = "size") int size) throws Exception {
        List<ServicePackageItemDO> servicePackageItemDOS = servicePackageItemService.search(fields, filters, sorts, page, size);
        for (ServicePackageItemDO servicePackageItemDO:servicePackageItemDOS){
        for (ServicePackageItemDO servicePackageItemDO : servicePackageItemDOS) {
            List<WlyyHospitalSysDictDO> wlyyHospitalSysDictDO = wlyyHospitalSysDictDao.findByDictName("isEffect");
            for (WlyyHospitalSysDictDO wlyyHospitalSysDictDO1:wlyyHospitalSysDictDO){
                if (servicePackageItemDO.getDel().equalsIgnoreCase(wlyyHospitalSysDictDO1.getDictCode())){
            for (WlyyHospitalSysDictDO wlyyHospitalSysDictDO1 : wlyyHospitalSysDictDO) {
                if (servicePackageItemDO.getDel().equalsIgnoreCase(wlyyHospitalSysDictDO1.getDictCode())) {
                    servicePackageItemDO.setDelName(wlyyHospitalSysDictDO1.getDictValue());
                }
            }
        }
        int count = (int)servicePackageItemService.getCount(filters);
        int count = (int) servicePackageItemService.getCount(filters);
        return success(servicePackageItemDOS, count, page, size);
    }
    @GetMapping(value = "list")
    @ApiOperation(value = "获取列表")
    public ListEnvelop<ServicePackageItemDO> list (
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
            @RequestParam(value = "sorts", required = false) String sorts) throws Exception {
        List<ServicePackageItemDO> servicePackageItemDOS = servicePackageItemService.search(fields, filters, sorts);
        return success(servicePackageItemDOS);
    }
}

+ 19 - 2
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/specialist/rehabilitation/RehabilitationPlanController.java

@ -168,11 +168,10 @@ public class RehabilitationPlanController extends EnvelopRestEndpoint {
     * 存成json串
     */
    @GetMapping(value = SpecialistMapping.rehabilitation.saveTemplate)
    @ApiOperation(value = "查询服务项目")
    @ApiOperation(value = "另存为模板")
    public MixEnvelop saveTemplate(
            @ApiParam(name = "templateName", value = "templateName") @RequestParam(value = "templateName", required = false) String templateName,
            @ApiParam(name = "templateJson", value = "templateJson") @RequestParam(value = "templateJson", required = false) String templateJson
    ) {
        try {
            TemplateJson entity = rehabilitationPlanService.saveTemplate(templateName,templateJson);
@ -184,6 +183,24 @@ public class RehabilitationPlanController extends EnvelopRestEndpoint {
    }
    /**
     * 查询另存为的模板
     */
    @GetMapping(value = SpecialistMapping.rehabilitation.findSaveTemplate)
    @ApiOperation(value = "另存为模板")
    public MixEnvelop saveTemplate(
            @ApiParam(name = "templateName", value = "templateName") @RequestParam(value = "templateName", required = false) String templateName
    ) {
        try {
            List<Map<String, Object>> list  = rehabilitationPlanService.findSaveTemplate(templateName);
            return MixEnvelop.getSuccess(SpecialistMapping.api_success, list);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
        }
    }
    //--------------------------------------------------------------------------------------
    //                    下面的没有用到
    //--------------------------------------------------------------------------------------

+ 22 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/service/servicePackage/ServicePackageItemRelationalService.java

@ -0,0 +1,22 @@
package com.yihu.jw.base.service.servicePackage;
import com.yihu.jw.base.dao.servicePackage.ServicePackageItemRelationalDao;
import com.yihu.jw.entity.base.servicePackage.ServicePackageItemRelationalDO;
import com.yihu.jw.mysql.query.BaseJpaService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
 * @author yeshijie on 2018/8/17.
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class ServicePackageItemRelationalService
        extends BaseJpaService<ServicePackageItemRelationalDO, ServicePackageItemRelationalDao> {
    private Logger logger = LoggerFactory.getLogger(ServicePackageItemRelationalService.class);
}

+ 81 - 49
svr/svr-base/src/main/java/com/yihu/jw/base/service/servicePackage/ServicePackageItemService.java

@ -2,21 +2,22 @@ package com.yihu.jw.base.service.servicePackage;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.base.dao.servicePackage.ServicePackageItemDao;
import com.yihu.jw.base.dao.system.SystemDictEntryDao;
import com.yihu.jw.base.dao.team.BaseTeamDao;
import com.yihu.jw.base.dao.servicePackage.ServicePackageItemRelationalDao;
import com.yihu.jw.base.util.ConstantUtils;
import com.yihu.jw.entity.base.org.BaseOrgDO;
import com.yihu.jw.entity.base.servicePackage.ServicePackageItemDO;
import com.yihu.jw.entity.base.system.SystemDictEntryDO;
import com.yihu.jw.org.dao.BaseOrgDao;
import com.yihu.jw.entity.base.servicePackage.ServicePackageItemRelationalDO;
import com.yihu.jw.mysql.query.BaseJpaService;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.utils.StringUtil;
import com.yihu.jw.mysql.query.BaseJpaService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
 * Created by yeshijie on 2021/2/23.
@ -27,54 +28,27 @@ public class ServicePackageItemService extends BaseJpaService<ServicePackageItem
    @Autowired
    private ServicePackageItemDao servicePackageItemDao;
    @Autowired
    private BaseOrgDao  baseOrgDao;
    @Autowired
    private BaseTeamDao baseTeamDao;
    @Autowired
    private SystemDictEntryDao systemDictEntryDao;
    ServicePackageItemRelationalDao relationalDao;
    public JSONObject create(ServicePackageItemDO itemDO){
    public JSONObject create(ServicePackageItemDO itemDO) {
        JSONObject result = new JSONObject();
//         if(StringUtils.isEmpty(itemDO.getTeamCode())){
//            result.put("msg","请选择服务团队");
//            result.put("response", ConstantUtils.FAIL);
//            return result;
//        }
        BaseOrgDO baseOrgDO = baseOrgDao.findByCode(itemDO.getOrgCode());
        if (baseOrgDO!=null){
            itemDO.setOrgName(baseOrgDO.getName());
        }
//        BaseTeamDO baseTeamDO  = baseTeamDao.getOne(itemDO.getTeamCode());
//        if (baseTeamDO!=null){
//            itemDO.setTeamName(baseTeamDO.getName());
//        }
        if(StringUtil.isEmpty(itemDO.getId())){
            SystemDictEntryDO systemDictEntryDO = systemDictEntryDao.findByDictCodeAndCode("service_item",itemDO.getCode());
            if (systemDictEntryDO!=null){
                if (StringUtils.isNotBlank(systemDictEntryDO.getRemark())){//服务项所属专题不为空
                    itemDO.setTopicItem(systemDictEntryDO.getRemark());
                }
            }
        if (StringUtil.isEmpty(itemDO.getId())) {
            //新增
//            List<ServicePackageItemDO> itemDOList = servicePackageItemDao.findByTeamCode(itemDO.getTeamCode(),itemDO.getCode());
//            if(itemDOList!=null&&itemDOList.size()>0){
//                result.put("msg","该服务团队已存在此服务项,请勿重复添加");
//                result.put("response", ConstantUtils.FAIL);
//                return result;
//            }
            itemDO.setPrice(new BigDecimal(0));
            itemDO.setServicePackageId("system");
            itemDO.setCreateTime(DateUtil.getStringDate());
            itemDO.setDel("1");
            servicePackageItemDao.save(itemDO);
        }else{
            //修改
            SystemDictEntryDO systemDictEntryDO = systemDictEntryDao.findByDictCodeAndCode("service_item",itemDO.getCode());
            if (systemDictEntryDO!=null){
                if (StringUtils.isNotBlank(systemDictEntryDO.getRemark())){//服务项所属专题不为空
                    itemDO.setTopicItem(systemDictEntryDO.getRemark());
                }
            //保存子项目
            String subItemIdList = itemDO.getSubItemId();
            for (String subItemId : subItemIdList.split(",")) {
                ServicePackageItemRelationalDO entity = new ServicePackageItemRelationalDO();
                entity.setItemId(itemDO.getId());
                entity.setSubItemId(subItemId);
                relationalDao.save(entity);
            }
        } else {
            //修改
            ServicePackageItemDO oldItemDO = servicePackageItemDao.findById(itemDO.getId()).orElse(null);
            oldItemDO.setName(itemDO.getName());
            oldItemDO.setDel(itemDO.getDel());
@ -82,11 +56,69 @@ public class ServicePackageItemService extends BaseJpaService<ServicePackageItem
            oldItemDO.setFeeType(itemDO.getFeeType());
            oldItemDO.setIntroduce(itemDO.getIntroduce());
            servicePackageItemDao.save(oldItemDO);
            //删除关联表重新添加
            String delSql = " DELETE FROM base_service_package_item_relational WHERE item_id='" + oldItemDO.getId() + "'";
            jdbcTemplate.execute(delSql);
            //加入关联表
            String subItemIdList = itemDO.getSubItemId();
            for (String subItemId : subItemIdList.split(",")) {
                ServicePackageItemRelationalDO entity = new ServicePackageItemRelationalDO();
                entity.setItemId(itemDO.getId());
                entity.setSubItemId(subItemId);
                relationalDao.save(entity);
            }
        }
        result.put("response",ConstantUtils.SUCCESS);
        result.put("msg","操作成功");
        result.put("response", ConstantUtils.SUCCESS);
        result.put("msg", "操作成功");
        return result;
    }
    public HashMap<String, Object> getItemList(String leasedCode, String orgCode, String itemName, String status, String pageIf, int page, int pageSize) {
        String detailSql = "SELECT * ";
        String countSql = "SELECT count(1) ";
        String pageSql = "";
        String sql = "FROM base_service_package_item WHERE 1=1 \n";
        if (StringUtils.isNotBlank(leasedCode)) {
            sql += "AND leased_code ='" + leasedCode + "'";
        }
        if (StringUtils.isNotBlank(orgCode)) {
            sql += "AND org_code ='" + orgCode + "'";
        }
        if (StringUtils.isNotBlank(status)) {
            sql += "AND del ='" + status + "'";
        }
        if (StringUtils.isNotBlank(itemName)) {
            sql += "AND `name` LIKE '%" + itemName + "%'";
        }
        if (StringUtils.isNotBlank(pageIf)) {
            //需要分页
            pageSql = " limit " + page * pageSize + "," + pageSize;
        }
        countSql += sql;
        detailSql += sql + pageSql;
        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 ServicePackageItemDO lapseItem(String itemId) {
        ServicePackageItemDO entity = servicePackageItemDao.findById(itemId).orElse(null);
        if (entity != null) {
            entity.setDel("0");
            ServicePackageItemDO newEntity = servicePackageItemDao.save(entity);
            return newEntity;
        }
        return null;
    }
    public void deleteById(String ids) {
        String collect = Arrays.stream(ids.split(",")).map(s -> "'" + s + "'").collect(Collectors.joining(",", "(", ")"));
        String delSql = "DELETE FROM base_service_package_item WHERE id IN ";
        delSql += collect;
        jdbcTemplate.execute(delSql);
    }
}

+ 49 - 21
svr/svr-base/src/main/java/com/yihu/jw/base/service/servicePackage/ServicePackageService.java

@ -11,10 +11,10 @@ import com.yihu.jw.entity.base.org.BaseOrgDO;
import com.yihu.jw.entity.base.servicePackage.ServicePackageDO;
import com.yihu.jw.entity.base.servicePackage.ServicePackageItemDO;
import com.yihu.jw.entity.base.system.SystemDictEntryDO;
import com.yihu.jw.mysql.query.BaseJpaService;
import com.yihu.jw.org.dao.BaseOrgDao;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.utils.StringUtil;
import com.yihu.jw.mysql.query.BaseJpaService;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -23,12 +23,9 @@ import org.springframework.beans.factory.annotation.Autowired;
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.*;
/**
 *
 * @author yeshijie on 2018/8/17.
 */
@Service
@ -52,49 +49,50 @@ public class ServicePackageService extends BaseJpaService<ServicePackageDO, Serv
    private ServicePackageSignRecordDao servicePackageSignRecordDao;
    @Transactional(rollbackFor = Exception.class)
    public JSONObject create(ServicePackageDO servicePackageDO){
    public JSONObject create(ServicePackageDO servicePackageDO) {
        JSONObject result = new JSONObject();
        List<ServicePackageItemDO> itemDOList = servicePackageDO.getPackageItemDOList();
        if(itemDOList==null){
        if (itemDOList == null) {
            servicePackageDO.setNum(0);
        }else {
        } else {
            servicePackageDO.setNum(itemDOList.size());
        }
        if(StringUtil.isEmpty(servicePackageDO.getId())){
        if (StringUtil.isEmpty(servicePackageDO.getId())) {
            //新增
            servicePackageDO.setCreateTime(new Date());
            servicePackageDO=servicePackageDao.save(servicePackageDO);
        }else{
            servicePackageDO = servicePackageDao.save(servicePackageDO);
        } else {
            //修改
            ServicePackageDO oldDO = servicePackageDao.findById(servicePackageDO.getId()).orElse(null);;
            ServicePackageDO oldDO = servicePackageDao.findById(servicePackageDO.getId()).orElse(null);
            oldDO.setName(servicePackageDO.getName());
            oldDO.setDel(servicePackageDO.getDel());
            oldDO.setType(servicePackageDO.getType());
            oldDO.setIntroduce(servicePackageDO.getIntroduce());
            oldDO.setOrgCode(servicePackageDO.getOrgCode());
            oldDO.setOrgName(servicePackageDO.getOrgName());
            servicePackageDO= servicePackageDao.save(oldDO);
            servicePackageDO = servicePackageDao.save(oldDO);
            servicePackageItemDao.deleteByServicePackageId(oldDO.getId());
        }
        List<ServicePackageItemDO> itemDOs = new ArrayList<>();
        for (ServicePackageItemDO itemDO:itemDOList){
        for (ServicePackageItemDO itemDO : itemDOList) {
            BaseOrgDO baseOrgDO = baseOrgDao.findByCode(itemDO.getOrgCode());
            if (baseOrgDO!=null){
            if (baseOrgDO != null) {
                itemDO.setOrgName(baseOrgDO.getName());
            }
            itemDO = servicePackageItemDao.findById(itemDO.getId()).orElse(null);;
            itemDO = servicePackageItemDao.findById(itemDO.getId()).orElse(null);
            ;
            ServicePackageItemDO itemDO1 = new ServicePackageItemDO();
            BeanUtils.copyProperties(itemDO,itemDO1);
            BeanUtils.copyProperties(itemDO, itemDO1);
            itemDO1.setId(null);
            itemDO1.setDictId(itemDO.getId());
            itemDO1.setServicePackageId(servicePackageDO.getId());
            itemDO1.setCreateTime(DateUtil.getStringDate());
            SystemDictEntryDO systemDictEntryDO = systemDictEntryDao.findByDictCodeAndCode("service_item",itemDO.getCode());
            if (systemDictEntryDO!=null){
                if (StringUtils.isNotBlank(systemDictEntryDO.getRemark())){//服务项所属专题不为空
            SystemDictEntryDO systemDictEntryDO = systemDictEntryDao.findByDictCodeAndCode("service_item", itemDO.getCode());
            if (systemDictEntryDO != null) {
                if (StringUtils.isNotBlank(systemDictEntryDO.getRemark())) {//服务项所属专题不为空
                    itemDO1.setTopicItem(systemDictEntryDO.getRemark());
                }
            }
@ -103,8 +101,38 @@ public class ServicePackageService extends BaseJpaService<ServicePackageDO, Serv
        servicePackageItemDao.saveAll(itemDOs);
        result.put("response", ConstantUtils.SUCCESS);
        result.put("msg","操作成功");
        result.put("msg", "操作成功");
        return result;
    }
    public HashMap<String, Object> findList(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(status)) {
            sql += " AND a.del='" + status + "'";
        }
        if (StringUtils.isNotBlank(pageName)) {
            sql += " AND a.`name` like'%" + pageName + "%'";
        }
        if (StringUtils.isNotBlank(leasedCode)) {
            sql += " AND a.`leased_code`='" + leasedCode + "'";
        }
        if (StringUtils.isNotBlank(orgCode)) {
            sql += " AND a.`org_code`='" + orgCode + "'";
        }
        sql += " ORDER BY a.create_time DESC ";
        String pageSql = " limit " + (page - 1) * size + "," + size;
        detailSql += sql + pageSql;
        countSql += sql;
        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;
    }
}

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

@ -526,8 +526,8 @@ public class RehabilitationPlanService extends BaseJpaService<RehabilitationPlan
    public TemplateJson saveTemplate(String templateName, String templateJson) {
        TemplateJson entity = new TemplateJson();
        entity.setCreateTime(new Date());
        entity.setTemplateName(templateName);
        entity.setTemplateJson(templateJson);
        entity.setTemplateName(templateJson);
        templateJsonDao.save(entity);
        return entity;
    }
@ -537,4 +537,13 @@ public class RehabilitationPlanService extends BaseJpaService<RehabilitationPlan
        List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);
        return list;
    }
    public List<Map<String, Object>> findSaveTemplate(String templateName) {
        String sql = "select * FROM template_json WHERE 1=1 ";
        if (StringUtils.isNotBlank(templateName)) {
            sql += " and template_name LIKE '%" + templateName + "%'  ";
        }
        List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);
        return list;
    }
}

+ 6 - 0
svr/svr-base/src/main/resources/application.yml

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