소스 검색

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

yeshijie 6 년 전
부모
커밋
78b5394e7c
15개의 변경된 파일480개의 추가작업 그리고 197개의 파일을 삭제
  1. 56 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/saas/SaasBusinessCardDO.java
  2. 0 101
      common/common-entity/src/main/java/com/yihu/jw/entity/base/team/BaseTeamDO.java
  3. 10 0
      common/common-entity/src/main/java/com/yihu/jw/entity/specialist/rehabilitation/GuidanceMessageLogDO.java
  4. 8 0
      common/common-request-mapping/src/main/java/com/yihu/jw/rm/base/BaseRequestMapping.java
  5. 1 0
      common/common-request-mapping/src/main/java/com/yihu/jw/rm/specialist/SpecialistMapping.java
  6. 50 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/saas/SaasBusinessCardVO.java
  7. 39 11
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/web/endpoint/EnvelopRestEndpoint.java
  8. 13 0
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/saas/SaasBusinessCardDao.java
  9. 111 0
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/saas/SaasBusinessCardEndpoint.java
  10. 41 0
      svr/svr-base/src/main/java/com/yihu/jw/base/service/saas/SaasBusinessCardService.java
  11. 40 22
      svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/controller/rehabilitation/RehabilitationManageController.java
  12. 1 1
      svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/dao/SpecialistPatientRelationDao.java
  13. 1 1
      svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/dao/rehabilitation/RehabilitationDetailDao.java
  14. 1 1
      svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/service/SpecialistHospitalServiceItemService.java
  15. 108 60
      svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/service/rehabilitation/RehabilitationManageService.java

+ 56 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/saas/SaasBusinessCardDO.java

@ -0,0 +1,56 @@
package com.yihu.jw.entity.base.saas;
import com.yihu.jw.entity.IntegerIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
 * Entity - SAAS名片
 * Created by progr1mmer on 2018/9/7.
 */
@Entity
@Table(name = "base_saas_business_card")
public class SaasBusinessCardDO extends IntegerIdentityEntity {
    public enum Type {
        doctor,
        patient
    }
    //SAAS ID
    private String saasId;
    //字段
    private String field;
    //类型
    private Type type;
    @Column(name = "saas_id", nullable = false)
    public String getSaasId() {
        return saasId;
    }
    public void setSaasId(String saasId) {
        this.saasId = saasId;
    }
    @Column(name = "field", nullable = false)
    public String getField() {
        return field;
    }
    public void setField(String field) {
        this.field = field;
    }
    @Column(name = "type", nullable = false)
    public Type getType() {
        return type;
    }
    public void setType(Type type) {
        this.type = type;
    }
}

+ 0 - 101
common/common-entity/src/main/java/com/yihu/jw/entity/base/team/BaseTeamDO.java

@ -1,101 +0,0 @@
package com.yihu.jw.entity.base.team;
import com.yihu.jw.entity.UuidIdentityEntityWithOperator;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
/**
* 团队信息实体
*
* @author litaohong on  2018年08月31日
*
*/
@Entity
@Table(name = "base_team")
public class BaseTeamDO extends UuidIdentityEntityWithOperator {
    /**
	* 机构id
	*/
    private String orgId;
    /**
	* 团队名称
	*/
    private String name;
    /**
	* 领导医生标识
	*/
    private String leaderId;
    /**
	* 团队人数
	*/
    private String teamNum;
    /**
	* 团队二维码
	*/
    private String qrcode;
    /**
	* 作废标识,1正常,0作废
	*/
    private String del;
	@Column(name = "org_id")
    public String getOrgId() {
        return orgId;
    }
    public void setOrgId(String orgId) {
        this.orgId = orgId;
    }
	@Column(name = "name")
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
	@Column(name = "leader_id")
    public String getLeaderId() {
        return leaderId;
    }
    public void setLeaderId(String leaderId) {
        this.leaderId = leaderId;
    }
	@Column(name = "team_num")
    public String getTeamNum() {
        return teamNum;
    }
    public void setTeamNum(String teamNum) {
        this.teamNum = teamNum;
    }
	@Column(name = "qrcode")
    public String getQrcode() {
        return qrcode;
    }
    public void setQrcode(String qrcode) {
        this.qrcode = qrcode;
    }
	@Column(name = "del")
    public String getDel() {
        return del;
    }
    public void setDel(String del) {
        this.del = del;
    }
}

+ 10 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/specialist/rehabilitation/GuidanceMessageLogDO.java

@ -23,6 +23,7 @@ public class GuidanceMessageLogDO extends UuidIdentityEntityWithOperator impleme
    private Integer doctorType;
    private Integer adminTeamCode;
    private String adminTeamName;
    private Integer contentType;
    @Column(name = "doctor")
    public String getDoctor() {
@ -104,4 +105,13 @@ public class GuidanceMessageLogDO extends UuidIdentityEntityWithOperator impleme
    public void setMessageId(String messageId) {
        this.messageId = messageId;
    }
    @Column(name = "content_type")
    public Integer getContentType() {
        return contentType;
    }
    public void setContentType(Integer contentType) {
        this.contentType = contentType;
    }
}

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

@ -35,6 +35,14 @@ public class BaseRequestMapping {
        public static final String PREFIX  = "/saas_default_module_function";
    }
    /**
     * SAAS名片
     */
    public static class SaasBusinessCard extends Basic {
        public static final String PREFIX  = "/saas_business_card";
        public static final String GENERATE = "/generate";
    }
    /**
     * 模块
     */

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

@ -82,6 +82,7 @@ public class SpecialistMapping {
        public static final String appCalendarPlanDetailList = "/appCalendarPlanDetailList";
        public static final String updatePlanDetailStatusById = "/updatePlanDetailStatusById";
        public static final String updatePlanStatusById = "/updatePlanStatusById";
        public static final String planSchedule = "/planSchedule";
    }
    public static class serviceItem{

+ 50 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/saas/SaasBusinessCardVO.java

@ -0,0 +1,50 @@
package com.yihu.jw.restmodel.base.saas;
import com.yihu.jw.entity.base.saas.SaasDO;
import com.yihu.jw.restmodel.IntegerIdentityVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
 * VO - SAAS名片
 * Created by progr1mmer on 2018/9/7.
 */
@ApiModel(value = "SaasBusinessCardVO", description = "SAAS名片")
public class SaasBusinessCardVO extends IntegerIdentityVO {
    //SAAS ID
    @ApiModelProperty(value = "Saas ID", example = "402303ee65634dfs0234sf9ad2wa00d2")
    private String saasId;
    //字段
    @ApiModelProperty(value = "实体字段", example = "name")
    private String field;
    //类型
    @ApiModelProperty(value = "名片类型", example = "doctor")
    private SaasDO.Type type;
    public String getSaasId() {
        return saasId;
    }
    public void setSaasId(String saasId) {
        this.saasId = saasId;
    }
    public String getField() {
        return field;
    }
    public void setField(String field) {
        this.field = field;
    }
    public SaasDO.Type getType() {
        return type;
    }
    public void setType(SaasDO.Type type) {
        this.type = type;
    }
}

+ 39 - 11
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/web/endpoint/EnvelopRestEndpoint.java

@ -29,6 +29,10 @@ public abstract class EnvelopRestEndpoint {
    @Autowired
    protected ObjectMapper objectMapper;
    protected Envelop success() {
        return success("success");
    }
    protected Envelop success(String message) {
        return success(message, 200);
    }
@ -45,8 +49,8 @@ public abstract class EnvelopRestEndpoint {
    }
    protected <J, _J> ObjEnvelop<_J> success(J obj, Class<_J> target){
        _J _target = convertToModel(obj, target);
        return success(_target);
        _J _obj = convertToModel(obj, target);
        return success("success", _obj);
    }
    protected <J> ObjEnvelop<J> success(String message, J obj){
@ -54,8 +58,8 @@ public abstract class EnvelopRestEndpoint {
    }
    protected <J, _J> ObjEnvelop<_J> success(String message, J obj, Class<_J> target){
        _J _target = convertToModel(obj, target);
        return success(message, _target);
        _J _obj = convertToModel(obj, target);
        return success(message, 200, _obj);
    }
    protected <J> ObjEnvelop<J> success(String message, int status, J obj){
@ -67,8 +71,8 @@ public abstract class EnvelopRestEndpoint {
    }
    protected <J, _J> ObjEnvelop<_J> success(String message, int status, J obj, Class<_J> target){
        _J _target = convertToModel(obj, target);
        return success(message, status, _target);
        _J _obj = convertToModel(obj, target);
        return success(message, status, _obj);
    }
    protected <T> ListEnvelop<T> success(List<T> contents){
@ -77,7 +81,7 @@ public abstract class EnvelopRestEndpoint {
    protected <T, _T> ListEnvelop<_T> success(List<T> contents, Class<_T> target){
        List<_T> _contents = convertToModels(contents, new ArrayList<>(contents.size()), target);
        return success(_contents);
        return success("success", _contents);
    }
    protected <T> ListEnvelop<T> success(String message, List<T> contents){
@ -86,7 +90,7 @@ public abstract class EnvelopRestEndpoint {
    protected <T, _T> ListEnvelop<_T> success(String message, List<T> contents, Class<_T> target){
        List<_T> _contents = convertToModels(contents, new ArrayList<>(contents.size()), target);
        return success(message, _contents);
        return success(message, 200, _contents);
    }
    protected <T> ListEnvelop<T> success(String message, int status, List<T> contents){
@ -108,7 +112,7 @@ public abstract class EnvelopRestEndpoint {
    protected <T, _T> PageEnvelop<_T> success(List<T> contents, int totalCount, int currPage, int pageSize, Class<_T> target){
        List<_T> _contents = convertToModels(contents, new ArrayList<>(contents.size()), target);
        return success(_contents, totalCount, currPage, pageSize);
        return success("success", _contents, totalCount, currPage, pageSize);
    }
    protected <T> PageEnvelop<T> success(String message, List<T> contents, int totalCount, int currPage, int pageSize) {
@ -117,7 +121,7 @@ public abstract class EnvelopRestEndpoint {
    protected <T, _T> PageEnvelop<_T> success(String message, List<T> contents, int totalCount, int currPage, int pageSize, Class<_T> target){
        List<_T> _contents = convertToModels(contents, new ArrayList<>(contents.size()), target);
        return success(message, _contents, totalCount, currPage, pageSize);
        return success(message, 200, _contents, totalCount, currPage, pageSize);
    }
    protected <T> PageEnvelop<T> success(String message, int status,  List<T> contents, int totalCount, int currPage, int pageSize) {
@ -140,16 +144,34 @@ public abstract class EnvelopRestEndpoint {
        return success("success", contents, obj);
    }
    protected <T, J, _T, _J> MixEnvelop<_T, _J> success(List<T> contents, J obj, Class<_T> targetContents, Class<_J> targetObj) {
        List<_T> _contents = convertToModels(contents, new ArrayList<>(contents.size()), targetContents);
        _J _obj = convertToModel(obj, targetObj);
        return success("success", _contents, _obj);
    }
    protected <T, J> MixEnvelop<T, J> success(String message, List<T> contents, J obj) {
        return success(message, 200, contents, obj);
    }
    protected <T, J, _T, _J> MixEnvelop<_T, _J>  success(String message, List<T> contents, J obj, Class<_T> targetContents, Class<_J> targetObj) {
        List<_T> _contents = convertToModels(contents, new ArrayList<>(contents.size()), targetContents);
        _J _obj = convertToModel(obj, targetObj);
        return success(message, 200, _contents, _obj);
    }
    protected <T, J> MixEnvelop<T, J> success(String message, int status, List<T> contents, J obj) {
        return success(message, status, contents, obj, contents.size(), 1, contents.size());
    }
    protected <T, J, _T, _J> MixEnvelop<_T, _J> success(String message, int status, List<T> contents, J obj, Class<_T> targetContents, Class<_J> targetObj) {
        List<_T> _contents = convertToModels(contents, new ArrayList<>(contents.size()), targetContents);
        _J _obj = convertToModel(obj, targetObj);
        return success(message, status, _contents, _obj, _contents.size(), 1, _contents.size());
    }
    protected <T, J> MixEnvelop<T, J> success(String message, int status, List<T> contents, J obj, int totalCount, int currPage, int pageSize) {
        MixEnvelop<T, J> mixEnvelop = new MixEnvelop();
        MixEnvelop<T, J> mixEnvelop = new MixEnvelop<>();
        mixEnvelop.setMessage(message);
        mixEnvelop.setStatus(status);
        mixEnvelop.setCurrPage(currPage);
@ -160,6 +182,12 @@ public abstract class EnvelopRestEndpoint {
        return mixEnvelop;
    }
    protected <T, J, _T, _J> MixEnvelop<_T, _J> success(String message, int status, List<T> contents, J obj, int totalCount, int currPage, int pageSize, Class<_T> targetContents, Class<_J> targetObj) {
        List<_T> _contents = convertToModels(contents, new ArrayList<>(contents.size()), targetContents);
        _J _obj = convertToModel(obj, targetObj);
        return success(message, status, _contents, _obj, totalCount, currPage, pageSize);
    }
    protected Envelop failed (String message) {
        return failed(message, -10000);
    }

+ 13 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/dao/saas/SaasBusinessCardDao.java

@ -0,0 +1,13 @@
package com.yihu.jw.base.dao.saas;
import com.yihu.jw.entity.base.saas.SaasBusinessCardDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * Dao - SAAS名片
 * Created by progr1mmer on 2018/9/7.
 */
public interface SaasBusinessCardDao extends PagingAndSortingRepository<SaasBusinessCardDO, Integer>, JpaSpecificationExecutor<SaasBusinessCardDO> {
}

+ 111 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/saas/SaasBusinessCardEndpoint.java

@ -0,0 +1,111 @@
package com.yihu.jw.base.endpoint.saas;
import com.yihu.jw.base.service.saas.SaasBusinessCardService;
import com.yihu.jw.entity.base.saas.SaasBusinessCardDO;
import com.yihu.jw.restmodel.base.saas.SaasBusinessCardVO;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ListEnvelop;
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.http.MediaType;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
/**
 * Endpoint - SAAS名片
 * Created by progr1mmer on 2018/8/14.
 * @author progr1mmer
 */
@RestController
@RequestMapping(value = BaseRequestMapping.SaasBusinessCard.PREFIX)
@Api(value = "SAAS名片管理", description = "SAAS名片管理服务接口", tags = {"wlyy基础服务 - SAAS名片管理服务接口"})
public class SaasBusinessCardEndpoint extends EnvelopRestEndpoint {
    @Autowired
    private SaasBusinessCardService saasBusinessCardService;
    @PostMapping(value = BaseRequestMapping.SaasBusinessCard.CREATE, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "创建")
    public ObjEnvelop<SaasBusinessCardVO> create (
            @ApiParam(name = "json", value = "Json数据", required = true)
            @RequestBody String jsonData) throws Exception {
        SaasBusinessCardDO saasBusinessCardDO = toEntity(jsonData, SaasBusinessCardDO.class);
        saasBusinessCardDO = saasBusinessCardService.save(saasBusinessCardDO);
        return success(saasBusinessCardDO, SaasBusinessCardVO.class);
    }
    @PostMapping(value = BaseRequestMapping.SaasBusinessCard.DELETE)
    @ApiOperation(value = "删除")
    public Envelop delete(
            @ApiParam(name = "ids", value = "id串,中间用,分隔", required = true)
            @RequestParam(value = "ids") String ids) {
        saasBusinessCardService.delete(ids.split(","));
        return success("删除成功");
    }
    @PostMapping(value = BaseRequestMapping.SaasBusinessCard.UPDATE, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "更新")
    public Envelop update (
            @ApiParam(name = "json", value = "Json数据", required = true)
            @RequestBody String jsonData) throws Exception {
        SaasBusinessCardDO saasBusinessCardDO = toEntity(jsonData, SaasBusinessCardDO.class);
        if (null == saasBusinessCardDO.getId()) {
            return failed("ID不能为空", Envelop.class);
        }
        saasBusinessCardDO = saasBusinessCardService.save(saasBusinessCardDO);
        return success(saasBusinessCardDO);
    }
    @GetMapping(value = BaseRequestMapping.SaasBusinessCard.PAGE)
    @ApiOperation(value = "获取分页")
    public PageEnvelop<SaasBusinessCardVO> 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<SaasBusinessCardDO> saasBusinessCardDOS = saasBusinessCardService.search(fields, filters, sorts, page, size);
        int count = (int)saasBusinessCardService.getCount(filters);
        return success(saasBusinessCardDOS, count, page, size, SaasBusinessCardVO.class);
    }
    @GetMapping(value = BaseRequestMapping.SaasBusinessCard.LIST)
    @ApiOperation(value = "获取列表")
    public ListEnvelop<SaasBusinessCardVO> 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<SaasBusinessCardDO> saasBusinessCardDOS = saasBusinessCardService.search(fields, filters, sorts);
        return success(saasBusinessCardDOS, SaasBusinessCardVO.class);
    }
    @GetMapping(value = BaseRequestMapping.SaasBusinessCard.GENERATE)
    @ApiOperation(value = "生成名片")
    public ObjEnvelop<Map> generate (
            @ApiParam(name = "type", value = "名片类型", required = true)
            @RequestParam(value = "type") SaasBusinessCardDO.Type type,
            @ApiParam(name = "saasId", value = "SAAS ID", required = true)
            @RequestParam(value = "saasId") String saasId,
            @ApiParam(name = "sourceId", value = "实体对象ID,如医生、居民", required = true)
            @RequestParam(value = "sourceId") String sourceId) throws Exception {
        Map<String, Object> card = saasBusinessCardService.generateBusinessCard(type, saasId, sourceId);
        return success(card);
    }
}

+ 41 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/service/saas/SaasBusinessCardService.java

@ -0,0 +1,41 @@
package com.yihu.jw.base.service.saas;
import com.yihu.jw.base.dao.saas.SaasBusinessCardDao;
import com.yihu.jw.base.service.doctor.BaseDoctorService;
import com.yihu.jw.entity.base.saas.SaasBusinessCardDO;
import com.yihu.mysql.query.BaseJpaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * Service - SAAS名片
 * Created by progr1mmer on 2018/9/7.
 */
@Service
public class SaasBusinessCardService extends BaseJpaService<SaasBusinessCardDO, SaasBusinessCardDao> {
    @Autowired
    private BaseDoctorService doctorService;
    public Map<String, Object> generateBusinessCard(SaasBusinessCardDO.Type type, String saasId, String id) throws Exception {
        List<SaasBusinessCardDO> saasBusinessCardDO = search("type=" + type  + ";saasId=" + saasId);
        Map<String, Object> card = new HashMap<>();
        if (type == SaasBusinessCardDO.Type.doctor) {
            //模拟加载医生数据
            Map<String, Object> source = new HashMap<>();
            saasBusinessCardDO.forEach(item -> card.put(item.getField(), source.get(item.getField())));
            return card;
        } else if (type == SaasBusinessCardDO.Type.patient) {
            //模拟加载居民数据
            Map<String, Object> source = new HashMap<>();
            saasBusinessCardDO.forEach(item -> card.put(item.getField(), source.get(item.getField())));
            return card;
        }
        return card;
    }
}

+ 40 - 22
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/controller/rehabilitation/RehabilitationManageController.java

@ -13,6 +13,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.sleuth.Tracer;
import org.springframework.web.bind.annotation.*;
import java.util.Map;
/**
 * Created by 刘文彬 on 2018/8/16.
 */
@ -155,9 +157,11 @@ public class RehabilitationManageController {
                                       @ApiParam(name = "content", value = "聊天内容", required = true)
                                       @RequestParam(value = "content", required = true)String content,
                                       @ApiParam(name = "planDetailId", value = "服务项目id", required = true)
                                       @RequestParam(value = "planDetailId", required = true)String planDetailId){
                                       @RequestParam(value = "planDetailId", required = true)String planDetailId,
                                       @ApiParam(name = "contentType", value = "内容类型(1,6,8 - 文本, 2,9- 图片, 3 - 语音, 4-文章, 5,7系统消息。12-语音 18-居民名片, 19-聊天记录)", required = true)
                                       @RequestParam(value = "contentType", required = true)Integer contentType){
        try {
            return rehabilitationManageService.saveGuidanceMessage(messageId,doctorCode,doctorType,content,planDetailId);
            return rehabilitationManageService.saveGuidanceMessage(messageId,doctorCode,doctorType,content,planDetailId,contentType);
        }catch (Exception e){
            e.printStackTrace();
            tracer.getCurrentSpan().logEvent(e.getMessage());
@ -184,14 +188,14 @@ public class RehabilitationManageController {
    @ApiOperation(value = "康复管理-居民详情页")
    public Envelop patientRehabilitationDetail(@ApiParam(name = "patientCode", value = "居民code", required = true)
                                       @RequestParam(value = "patientCode", required = true)String patientCode,
                                       @ApiParam(name = "healthDoctor", value = "健管师医生code", required = true)
                                       @RequestParam(value = "healthDoctor", required = true)String healthDoctor,
                                       @ApiParam(name = "healthDoctorName", value = "健管师医生名称", required = true)
                                       @RequestParam(value = "healthDoctorName", required = true)String healthDoctorName,
                                       @ApiParam(name = "generalDoctor", value = "全科医生code", required = true)
                                       @RequestParam(value = "generalDoctor", required = true)String generalDoctor,
                                       @ApiParam(name = "generalDoctorName", value = "全科医生名称", required = true)
                                       @RequestParam(value = "generalDoctorName", required = true)String generalDoctorName){
                                       @ApiParam(name = "healthDoctor", value = "健管师医生code", required = false)
                                       @RequestParam(value = "healthDoctor", required = false)String healthDoctor,
                                       @ApiParam(name = "healthDoctorName", value = "健管师医生名称", required = false)
                                       @RequestParam(value = "healthDoctorName", required = false)String healthDoctorName,
                                       @ApiParam(name = "generalDoctor", value = "全科医生code", required = false)
                                       @RequestParam(value = "generalDoctor", required = false)String generalDoctor,
                                       @ApiParam(name = "generalDoctorName", value = "全科医生名称", required = false)
                                       @RequestParam(value = "generalDoctorName", required = false)String generalDoctorName){
        try {
            return rehabilitationManageService.patientRehabilitationDetail(patientCode,healthDoctor, healthDoctorName,generalDoctor,generalDoctorName);
        }catch (Exception e){
@ -227,14 +231,14 @@ public class RehabilitationManageController {
    @ApiOperation(value = "康复管理-医生端居民详情服务医生列表")
    public Envelop serviceDoctorList(@ApiParam(name = "patientCode", value = "居民code", required = true)
                                               @RequestParam(value = "patientCode", required = true)String patientCode,
                                               @ApiParam(name = "healthDoctor", value = "健管师医生code", required = true)
                                               @RequestParam(value = "healthDoctor", required = true)String healthDoctor,
                                               @ApiParam(name = "healthDoctorName", value = "健管师医生名称", required = true)
                                               @RequestParam(value = "healthDoctorName", required = true)String healthDoctorName,
                                               @ApiParam(name = "generalDoctor", value = "全科医生code", required = true)
                                               @RequestParam(value = "generalDoctor", required = true)String generalDoctor,
                                               @ApiParam(name = "generalDoctorName", value = "全科医生名称", required = true)
                                               @RequestParam(value = "generalDoctorName", required = true)String generalDoctorName){
                                               @ApiParam(name = "healthDoctor", value = "健管师医生code", required = false)
                                               @RequestParam(value = "healthDoctor", required = false)String healthDoctor,
                                               @ApiParam(name = "healthDoctorName", value = "健管师医生名称", required = false)
                                               @RequestParam(value = "healthDoctorName", required = false)String healthDoctorName,
                                               @ApiParam(name = "generalDoctor", value = "全科医生code", required = false)
                                               @RequestParam(value = "generalDoctor", required = false)String generalDoctor,
                                               @ApiParam(name = "generalDoctorName", value = "全科医生名称", required = false)
                                               @RequestParam(value = "generalDoctorName", required = false)String generalDoctorName){
        try {
            return rehabilitationManageService.serviceDoctorList(patientCode,healthDoctor, healthDoctorName,generalDoctor,generalDoctorName);
        }catch (Exception e){
@ -282,14 +286,15 @@ public class RehabilitationManageController {
    @PostMapping(value = SpecialistMapping.rehabilitation.updateNoteAndImageRehabilitationOperate)
    @ApiOperation(value = "康复计划完成时更新服务完成笔记和图片接口并且确认完成")
    public Envelop updateNoteAndImageRehabilitationOperate(@ApiParam(name = "planDetailId", value = "服务项目id", required = true)@RequestParam(value = "planDetailId", required = true)String planDetailId,
    public ObjEnvelop updateNoteAndImageRehabilitationOperate(@ApiParam(name = "planDetailId", value = "服务项目id", required = true)@RequestParam(value = "planDetailId", required = true)String planDetailId,
                                                           @ApiParam(name = "node", value = "服务完成笔记", required = true)@RequestParam(value = "node", required = false)String node,
                                                           @ApiParam(name = "image", value = "相关记录图片,json格式", required = true)@RequestParam(value = "image", required = false)String image){
        try {
            if(rehabilitationManageService.updateNodeAndRelationRecordImg(node,image,planDetailId)>1){
                return Envelop.getSuccess(SpecialistMapping.api_success);
            Map<String,Object> map = rehabilitationManageService.updateNodeAndRelationRecordImg(node,image,planDetailId);
            if(Integer.parseInt(String.valueOf(map.get("count")))>1){
                return ObjEnvelop.getSuccess(SpecialistMapping.api_success,map);
            }
            return Envelop.getError("update error!");
            return ObjEnvelop.getError("update error!");
        }catch (Exception e){
            e.printStackTrace();
            tracer.getCurrentSpan().logEvent(e.getMessage());
@ -311,4 +316,17 @@ public class RehabilitationManageController {
            return Envelop.getError(e.getMessage());
        }
    }
    @GetMapping(value = SpecialistMapping.rehabilitation.planSchedule)
    @ApiOperation(value = "康复管理-计划总进度")
    public ObjEnvelop planSchedule(@ApiParam(name = "planId", value = "计划id", required = true)
                                                       @RequestParam(value = "planId", required = true)String planId){
        try {
            return rehabilitationManageService.planSchedule(planId);
        }catch (Exception e){
            e.printStackTrace();
            tracer.getCurrentSpan().logEvent(e.getMessage());
            return ObjEnvelop.getError(e.getMessage());
        }
    }
}

+ 1 - 1
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/dao/SpecialistPatientRelationDao.java

@ -17,6 +17,6 @@ public interface SpecialistPatientRelationDao extends PagingAndSortingRepository
    @Query("select p from SpecialistPatientRelationDO p where p.doctor=?1 and p.patient =?2 and p.status>=0")
    public SpecialistPatientRelationDO findByDoctorAndPatient(String doctor,String patient);
    @Query("select p from SpecialistPatientRelationDO p where p.doctor=?1 and p.patient=?2 and p.signStatus='1' and p.status=1 ")
    @Query("select p from SpecialistPatientRelationDO p where p.doctor=?1 and p.patient=?2 and p.signStatus='1' and p.status>=0 ")
    SpecialistPatientRelationDO findByPatientAndDoctor(String doctor,String patient);
}

+ 1 - 1
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/dao/rehabilitation/RehabilitationDetailDao.java

@ -64,5 +64,5 @@ public interface RehabilitationDetailDao extends PagingAndSortingRepository<Reha
    int updateStatusById(Integer status,String id);
    @Query(value ="select p.patient from wlyy_rehabilitation_plan_detail d left join wlyy_patient_rehabilitation_plan p on d.plan_id=p.id where d.id=?1",nativeQuery = true)
    List<Map<String,Object>> findPatientById(String planDetailId);
    List<String> findPatientById(String planDetailId);
}

+ 1 - 1
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/service/SpecialistHospitalServiceItemService.java

@ -279,7 +279,7 @@ public class SpecialistHospitalServiceItemService extends EnvelopRestEndpoint {
            buffer.deleteCharAt(buffer.length()-1);
            buffer.append(")");
        }
        String sql = "select * from wlyy_hospital_service_item where 1=1 AND status=1"+buffer;
        String sql = "select * from wlyy_hospital_service_item where 1=1 AND status = 1"+buffer;
        List<HospitalServiceItemDO> hospitalServiceItemDOS = jdbcTemplate.query(sql,new BeanPropertyRowMapper(HospitalServiceItemDO.class));
        for (HospitalServiceItemDO hospitalServiceItemDO:hospitalServiceItemDOS){
            SpecialistServiceItemDO specialistServiceItemDO = specialistServiceItemDao.findOne(hospitalServiceItemDO.getServiceItemId());

+ 108 - 60
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/service/rehabilitation/RehabilitationManageService.java

@ -17,6 +17,7 @@ import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.rm.specialist.SpecialistMapping;
import com.yihu.jw.util.common.IdCardUtil;
import com.yihu.jw.util.date.DateUtil;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONArray;
import org.json.JSONObject;
@ -98,7 +99,7 @@ public class RehabilitationManageService {
            condition += " and execute_time>='"+todayStart+"' and execute_time<='"+todayEnd+"'";
        }
        finalSql =" select DISTINCT b.* from (select DISTINCT plan_id from wlyy_specialist.wlyy_rehabilitation_plan_detail where  1=1 "+condition+") a " +
                " LEFT JOIN ("+sql+") b on a.plan_id=b.id ";
                " right JOIN ("+sql+") b on a.plan_id=b.id ";
//        if(todaybacklog!=null&&todaybacklog==1){
//            finalSql = " select DISTINCT b.* from (select DISTINCT plan_id from wlyy_specialist.wlyy_rehabilitation_plan_detail where execute_time>='"+todayStart+"' and execute_time<='"+todayEnd+"') a "+
//                    "LEFT JOIN ("+sql+") b on a.plan_id=b.id";
@ -117,11 +118,11 @@ public class RehabilitationManageService {
            for(Map<String,Object> one:patientRehabilitationPlanDOList){
                Map<String,Object> resultMap = new HashMap<>();
                Integer age = IdCardUtil.getAgeForIdcard(one.get("idcard")+"");
                String sex = IdCardUtil.getSexForIdcard_new(one.get("idcard")+"");
                resultMap.put("age",age);
//                Integer age = IdCardUtil.getAgeForIdcard(one.get("idcard")+"");
//                String sex = IdCardUtil.getSexForIdcard_new(one.get("idcard")+"");
//                resultMap.put("age",age);
                resultMap.put("hospitalName",one.get("hospital_name"));
                resultMap.put("sex","1".equals(sex)?"男":("2".equals(sex)?"女":"未知"));
//                resultMap.put("sex","1".equals(sex)?"男":("2".equals(sex)?"女":"未知"));
                resultMap.put("patientName",one.get("name"));
                resultMap.put("patientCode",one.get("patient"));
                resultMap.put("id",one.get("id"));
@ -285,9 +286,9 @@ public class RehabilitationManageService {
        Map<String,Object> signFamilyMap = signFamilyList.get(0);
        resultMap.put("signFamilyAdminTeamName",signFamilyMap.get("teamName"));
        resultMap.put("familyHospitalName",signFamilyMap.get("hospital_name"));//家庭医生所在医院
        Integer familyUnfinishCount = rehabilitationDetailDao.unfinishItemByDoctor(signFamilyMap.get("doctor").toString(),signFamilyMap.get("doctor_health").toString(),patientCode,1);
        Integer familyFinishCount = rehabilitationDetailDao.findItemByDoctor(signFamilyMap.get("doctor").toString(),signFamilyMap.get("doctor_health").toString(),patientCode);
        Integer familyServiceCount = rehabilitationDetailDao.completeServiceByDoctor(signFamilyMap.get("doctor").toString(),signFamilyMap.get("doctor_health").toString(),patientCode,1);
        Integer familyUnfinishCount = rehabilitationDetailDao.unfinishItemByDoctor(signFamilyMap.get("doctor")+"",signFamilyMap.get("doctor_health")+"",patientCode,1);
        Integer familyFinishCount = rehabilitationDetailDao.findItemByDoctor(signFamilyMap.get("doctor")+"",signFamilyMap.get("doctor_health")+"",patientCode);
        Integer familyServiceCount = rehabilitationDetailDao.completeServiceByDoctor(signFamilyMap.get("doctor")+"",signFamilyMap.get("doctor_health")+"",patientCode,1);
        resultMap.put("signFamilyFinishItemCount",familyFinishCount-familyUnfinishCount);//完成项目
        resultMap.put("signFamilyServiceRecordCount",familyServiceCount);//服务次数
@ -481,7 +482,7 @@ public class RehabilitationManageService {
        String sql = " select d.*,DATE_FORMAT(d.execute_time,'%Y/%m/%d %H:%i') as executeTime ,i.content,i.title from wlyy_specialist.wlyy_rehabilitation_plan_detail d " +
                " LEFT JOIN wlyy_specialist.wlyy_hospital_service_item h on d.hospital_service_item_id = h.id "+
                " LEFT JOIN wlyy_service_item i on i.id = h.service_item_id " +
                " where d.execute_time>='"+executeStartTime+"' and d.execute_time<='"+executeEndTime+"' and d.plan_id='"+planId+"' " ;
                " where d.execute_time>='"+executeStartTime+"' and d.execute_time<='"+executeEndTime+"' and d.plan_id='"+planId+"' order by d.execute_time desc" ;
        if(searchTask!=null){
            if(searchTask==1){
                sql+="and d.doctor='"+doctorCode+"' ";
@ -554,6 +555,7 @@ public class RehabilitationManageService {
                map.put("doctorName",one2.getDoctorName());
                map.put("adminTeamName",one2.getAdminTeamName());
                map.put("content",one2.getContent());
                map.put("contentType",one2.getContentType());
                map.put("createTime",DateUtil.dateToStr(one2.getCreateTime(),"MM-dd HH:mm"));
                messageMapList.add(map);
            }
@ -626,6 +628,7 @@ public class RehabilitationManageService {
            map.put("doctorName",one2.getDoctorName());
            map.put("adminTeamName",one2.getAdminTeamName());
            map.put("content",one2.getContent());
            map.put("contentType",one2.getContentType());
            map.put("createTime",DateUtil.dateToStr(one2.getCreateTime(),"MM-dd HH:mm"));
            messageMapList.add(map);
        }
@ -684,27 +687,32 @@ public class RehabilitationManageService {
        //服务医生
        //完成项目=全部的服务项目-未完成的服务项目
        List<Map<String,Object>> serviceDoctorList = new ArrayList<>();
        Map<String,Object> generalDoctorMap =  new HashMap<>();
        generalDoctorMap.put("type","全科医生");
        generalDoctorMap.put("doctorName",generalDoctorName);
        generalDoctorMap.put("doctorCode",generalDoctor);
        Integer generalUnfinishCount = rehabilitationDetailDao.unfinishItemByDoctor(generalDoctor,patientCode,1);
        Integer generalFinishCount = rehabilitationDetailDao.findItemByDoctor(generalDoctor,patientCode);
        Integer generalServiceCount = rehabilitationDetailDao.completeServiceByDoctor(generalDoctor,patientCode,1);
        generalDoctorMap.put("finishedItem",generalFinishCount-generalUnfinishCount);
        generalDoctorMap.put("serviceCount",generalServiceCount);
        serviceDoctorList.add(generalDoctorMap);
        if(StringUtils.isNotEmpty(generalDoctor)){
        Map<String,Object> healthDoctorMap =  new HashMap<>();
        healthDoctorMap.put("type","健管师");
        healthDoctorMap.put("doctorName",healthDoctorName);
        healthDoctorMap.put("doctorCode",healthDoctor);
        Integer healthUnfinishCount = rehabilitationDetailDao.unfinishItemByDoctor(healthDoctor,patientCode,1);
        Integer healthFinishCount = rehabilitationDetailDao.findItemByDoctor(healthDoctor,patientCode);
        Integer healthServiceCount = rehabilitationDetailDao.completeServiceByDoctor(healthDoctor,patientCode,1);
        healthDoctorMap.put("finishedItem",healthFinishCount-healthUnfinishCount);
        healthDoctorMap.put("serviceCount",healthServiceCount);
        serviceDoctorList.add(healthDoctorMap);
            Map<String,Object> generalDoctorMap =  new HashMap<>();
            generalDoctorMap.put("type","全科医生");
            generalDoctorMap.put("doctorName",generalDoctorName);
            generalDoctorMap.put("doctorCode",generalDoctor);
            Integer generalUnfinishCount = rehabilitationDetailDao.unfinishItemByDoctor(generalDoctor,patientCode,1);
            Integer generalFinishCount = rehabilitationDetailDao.findItemByDoctor(generalDoctor,patientCode);
            Integer generalServiceCount = rehabilitationDetailDao.completeServiceByDoctor(generalDoctor,patientCode,1);
            generalDoctorMap.put("finishedItem",generalFinishCount-generalUnfinishCount);
            generalDoctorMap.put("serviceCount",generalServiceCount);
            serviceDoctorList.add(generalDoctorMap);
        }
        if(StringUtils.isNotEmpty(healthDoctor)){
            Map<String,Object> healthDoctorMap =  new HashMap<>();
            healthDoctorMap.put("type","健管师");
            healthDoctorMap.put("doctorName",healthDoctorName);
            healthDoctorMap.put("doctorCode",healthDoctor);
            Integer healthUnfinishCount = rehabilitationDetailDao.unfinishItemByDoctor(healthDoctor,patientCode,1);
            Integer healthFinishCount = rehabilitationDetailDao.findItemByDoctor(healthDoctor,patientCode);
            Integer healthServiceCount = rehabilitationDetailDao.completeServiceByDoctor(healthDoctor,patientCode,1);
            healthDoctorMap.put("finishedItem",healthFinishCount-healthUnfinishCount);
            healthDoctorMap.put("serviceCount",healthServiceCount);
            serviceDoctorList.add(healthDoctorMap);
        }
        String specialistRelationSql = "select * from wlyy_specialist.wlyy_specialist_patient_relation where patient='"+patientCode+"' and sign_status='1' and status='1'";
        List<Map<String,Object>> specialistRelationList = jdbcTemplate.queryForList(specialistRelationSql);
@ -905,16 +913,16 @@ public class RehabilitationManageService {
     * @param doctorType 1、专科医生,2、家庭医生
     */
    @Transactional
    public Envelop saveGuidanceMessage(String messageId,String doctor,Integer doctorType,String content,String planDetailId) throws Exception{
    public Envelop saveGuidanceMessage(String messageId,String doctor,Integer doctorType,String content,String planDetailId,Integer contentType) throws Exception{
        List<Map<String,Object>> patientList = rehabilitationDetailDao.findPatientById(planDetailId);
        String patient = patientList.size()>0?patientList.get(0).get("patient")+"":"";
        List<String> patientList = rehabilitationDetailDao.findPatientById(planDetailId);
        String patient = patientList.size()>0?patientList.get(0):"";
        GuidanceMessageLogDO guidanceMessageLogDO = new GuidanceMessageLogDO();
        guidanceMessageLogDO.setMessageId(messageId);
        guidanceMessageLogDO.setPlanDetailId(planDetailId);
        guidanceMessageLogDO.setContent(content);
        guidanceMessageLogDO.setDoctor(doctor);
        guidanceMessageLogDO.setContentType(contentType);
        guidanceMessageLogDO.setDoctorType(doctorType);
        Integer adminTeamCode = null;
        String doctorName = null;
@ -968,27 +976,33 @@ public class RehabilitationManageService {
        //服务医生
        //完成项目=全部的服务项目-未完成的服务项目
        List<Map<String,Object>> serviceDoctorList = new ArrayList<>();
        Map<String,Object> generalDoctorMap =  new HashMap<>();
        generalDoctorMap.put("type","全科医生");
        generalDoctorMap.put("doctorName",generalDoctorName);
        generalDoctorMap.put("doctorCode",generalDoctor);
        Integer generalUnfinishCount = rehabilitationDetailDao.unfinishItemByDoctor(generalDoctor,patientCode,1);
        Integer generalFinishCount = rehabilitationDetailDao.findItemByDoctor(generalDoctor,patientCode);
        Integer generalServiceCount = rehabilitationDetailDao.completeServiceByDoctor(generalDoctor,patientCode,1);
        generalDoctorMap.put("finishedItem",generalFinishCount-generalUnfinishCount);
        generalDoctorMap.put("serviceCount",generalServiceCount);
        serviceDoctorList.add(generalDoctorMap);
        if(StringUtils.isNotEmpty(generalDoctor)){
        Map<String,Object> healthDoctorMap =  new HashMap<>();
        healthDoctorMap.put("type","健管师");
        healthDoctorMap.put("doctorName",healthDoctorName);
        healthDoctorMap.put("doctorCode",healthDoctor);
        Integer healthUnfinishCount = rehabilitationDetailDao.unfinishItemByDoctor(healthDoctor,patientCode,1);
        Integer healthFinishCount = rehabilitationDetailDao.findItemByDoctor(healthDoctor,patientCode);
        Integer healthServiceCount = rehabilitationDetailDao.completeServiceByDoctor(healthDoctor,patientCode,1);
        healthDoctorMap.put("finishedItem",healthFinishCount-healthUnfinishCount);
        healthDoctorMap.put("serviceCount",healthServiceCount);
        serviceDoctorList.add(healthDoctorMap);
            Map<String,Object> generalDoctorMap =  new HashMap<>();
            generalDoctorMap.put("type","全科医生");
            generalDoctorMap.put("doctorName",generalDoctorName);
            generalDoctorMap.put("doctorCode",generalDoctor);
            Integer generalUnfinishCount = rehabilitationDetailDao.unfinishItemByDoctor(generalDoctor,patientCode,1);
            Integer generalFinishCount = rehabilitationDetailDao.findItemByDoctor(generalDoctor,patientCode);
            Integer generalServiceCount = rehabilitationDetailDao.completeServiceByDoctor(generalDoctor,patientCode,1);
            generalDoctorMap.put("finishedItem",generalFinishCount-generalUnfinishCount);
            generalDoctorMap.put("serviceCount",generalServiceCount);
            serviceDoctorList.add(generalDoctorMap);
        }
        if(StringUtils.isNotEmpty(healthDoctor)){
            Map<String,Object> healthDoctorMap =  new HashMap<>();
            healthDoctorMap.put("type","健管师");
            healthDoctorMap.put("doctorName",healthDoctorName);
            healthDoctorMap.put("doctorCode",healthDoctor);
            Integer healthUnfinishCount = rehabilitationDetailDao.unfinishItemByDoctor(healthDoctor,patientCode,1);
            Integer healthFinishCount = rehabilitationDetailDao.findItemByDoctor(healthDoctor,patientCode);
            Integer healthServiceCount = rehabilitationDetailDao.completeServiceByDoctor(healthDoctor,patientCode,1);
            healthDoctorMap.put("finishedItem",healthFinishCount-healthUnfinishCount);
            healthDoctorMap.put("serviceCount",healthServiceCount);
            serviceDoctorList.add(healthDoctorMap);
        }
        String specialistRelationSql = "select * from wlyy_specialist.wlyy_specialist_patient_relation where patient='"+patientCode+"' and sign_status='1' and status='1'";
        List<Map<String,Object>> specialistRelationList = jdbcTemplate.queryForList(specialistRelationSql);
@ -1049,13 +1063,32 @@ public class RehabilitationManageService {
     * @param planDeatilId
     * @return
     */
    public int updateNodeAndRelationRecordImg(String node,String image,String planDeatilId){
        int i = 0;
        i = rehabilitationDetailDao.updateStatusById(1,planDeatilId);
        int j = 0;
        j = rehabilitationOperateRecordsDao.updateNodeAndRelationRecordImg(node,image,planDeatilId);
        int result = i+j;
        return  result;
    public Map<String,Object> updateNodeAndRelationRecordImg(String node,String image,String planDeatilId)throws Exception{
        Map<String,Object> resultMap = new HashedMap();
        int i = rehabilitationDetailDao.updateStatusById(1,planDeatilId);
        int j = rehabilitationOperateRecordsDao.updateNodeAndRelationRecordImg(node,image,planDeatilId);
        String sql ="SELECT" +
                " i.service_item_id," +
                " r.doctor_code," +
                " r.patient_code" +
                " FROM" +
                " wlyy_rehabilitation_plan_detail pd" +
                " LEFT JOIN wlyy_hospital_service_item i ON pd.hospital_service_item_id = i.id" +
                " LEFT JOIN wlyy_rehabilitation_operate_records r ON pd.id = r.rehabilitation_detail_id" +
                " WHERE" +
                " pd.id = '"+planDeatilId+"'";
        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
        if (list!=null && list.size()>0){
            resultMap = list.get(0);
        }
        String itemSql ="SELECT evaluation,title FROM `wlyy_service_item` WHERE id='"+String.valueOf(resultMap.get("service_item_id"))+"'";
        List<Map<String,Object>> itemList = jdbcTemplate.queryForList(itemSql);
        if (itemList!=null && itemList.size()>0){
            resultMap.put("evaluation",itemList.get(0).get("evaluation"));
            resultMap.put("title",itemList.get(0).get("title"));
        }
        resultMap.put("count",i+j);
        return resultMap;
    }
    /**
@ -1071,4 +1104,19 @@ public class RehabilitationManageService {
        }
        return Envelop.getError("更新失败!");
    }
    /**
     * 计划总进度
     * @param planId
     * @return
     */
    public ObjEnvelop planSchedule(String planId){
        Map<String,Object> resultMap = new HashMap<>();
        Integer allCount = rehabilitationDetailDao.findAllByPlanId(planId);//计划总服务项目数
        Integer finishedCount = rehabilitationDetailDao.findByStatusAndPlanId(1,planId);
        resultMap.put("allCount",allCount);
        resultMap.put("finishedCount",finishedCount);
        resultMap.put("healthyCondition","康复期");
        return ObjEnvelop.getSuccess(SpecialistMapping.api_success,resultMap);
    }
}