Ver código fonte

Merge branch 'dev' of http://192.168.1.220:10080/Amoy/patient-co-management into dev

trick9191 7 anos atrás
pai
commit
69bccefdc2
64 arquivos alterados com 3068 adições e 709 exclusões
  1. 1 1
      common/common-entity/src/main/java/com/yihu/wlyy/entity/message/Message.java
  2. 1 1
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/common/account/BookingController.java
  3. 4 4
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/manager/specialist/HopsitalServiceItemController.java
  4. 8 8
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/manager/specialist/ServiceItemController.java
  5. 27 0
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/entity/specialist/HospitalServiceItemDO.java
  6. 12 12
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/entity/specialist/SpecialistServiceItemDO.java
  7. 9 8
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/manager/specialist/ServiceItemService.java
  8. 13 12
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/manager/specialist/SpecialistHospitalItemService.java
  9. 1 1
      patient-co-manage/wlyy-manage/src/main/resources/application.yml
  10. 160 62
      patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/desizenMan/new-institutional-projects.jsp
  11. 670 81
      patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/desizenMan/service_project_management.jsp
  12. 10 10
      patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/healthbank/activity_list.jsp
  13. 1 1
      patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/healthbank/activity_list_js.jsp
  14. 1 1
      patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/healthbank/activity_modify.jsp
  15. 1 1
      patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/healthbank/activity_modify_js.jsp
  16. 624 170
      patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/specialty/index.jsp
  17. 278 0
      patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/specialty/upload.jsp
  18. BIN
      patient-co-manage/wlyy-manage/src/main/webapp/static/desizenMan/Sheet1.xls
  19. 3 3
      patient-co-manage/wlyy-manage/src/main/webapp/static/desizenMan/js/bootstrap-treeview.js
  20. BIN
      patient-co-manage/wlyy-manage/src/main/webapp/static/specialty/Sheet1.xls
  21. 77 7
      patient-co-manage/wlyy-manage/src/main/webapp/static/specialty/css/index.css
  22. 1 1
      patient-co-service/wlyy_device/src/main/java/com/yihu/hos/device/common/dao/MessageDao.java
  23. 3 1
      patient-co-service/wlyy_device/src/main/java/com/yihu/hos/device/service/AsyncService.java
  24. 3 2
      patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/etl/convert/wlyy/DeviceTypeConvert.java
  25. 5 1
      patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/job/business/MysqlToEsQuotaJob.java
  26. 15 0
      patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/util/DateUtil.java
  27. 4 2
      patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/job/specialist/EightSpecialistJob.java
  28. 2 1
      patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/job/specialist/SixteenSpecialistJob.java
  29. 65 0
      patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/service/specialist/SpecialistService.java
  30. 50 0
      patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/web/SpecialistController.java
  31. 2 1
      patient-co/patient-co-wlyy-job/src/main/resources/application-test.yml
  32. 2 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/config/SwaggerConfig.java
  33. 29 9
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/message/MessageDao.java
  34. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/patient/PatientAimSportsDao.java
  35. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/disease/PatientDiseaseService.java
  36. 10 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/label/SignPatientLabelInfoService.java
  37. 124 11
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/message/MessageService.java
  38. 5 4
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/statisticsES/StatisticsESService.java
  39. 92 8
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/specialist/SpecialistEvaluateSevice.java
  40. 5 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/specialist/SpecialistHospitalItemService.java
  41. 22 5
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/specialist/SpecialistService.java
  42. 225 48
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/specialist/rehabilitation/RehabilitationManageService.java
  43. 21 12
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/specialist/rehabilitation/RehabilitationPlanService.java
  44. 3 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/template/DoctorGuidanceTempLableService.java
  45. 6 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/task/PushMsgTask.java
  46. 0 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/util/CommonUtil.java
  47. 16 12
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/util/SystemDataRedis.java
  48. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/account/LoginController.java
  49. 22 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/job/SpecialistRehabilitationJob.java
  50. 1 9
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/messages/ImMessageController.java
  51. 77 4
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/data/DataHandingService.java
  52. 13 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/data/DataHandlingController.java
  53. 7 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/jimeiJkEduPC/DoctorJMJkEduArticlePCController.java
  54. 116 4
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/message/DoctorMessageController.java
  55. 14 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/specialist/SpecialistController.java
  56. 42 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/specialist/SpecialistEvaluate1Controller.java
  57. 37 9
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/specialist/rehabilitation/DoctorRehabilitationManageController.java
  58. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/family/FamilyMemberController.java
  59. 1 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/specialist/SpecialistEvaluateController.java
  60. 24 12
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/specialist/rehabilitation/PatientRehabilitationManageController.java
  61. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/zysoft/BookingController.java
  62. 3 3
      patient-co/patient-co-wlyy/src/main/resources/application-devtest.yml
  63. 44 74
      patient-co/patient-co-wlyy/src/main/resources/wechat/weixin_menu.txt
  64. 51 78
      patient-co/patient-co-wlyy/src/main/resources/wechat/weixin_menu_jimei.txt

+ 1 - 1
common/common-entity/src/main/java/com/yihu/wlyy/entity/message/Message.java

@ -58,7 +58,7 @@ public class Message extends IdEntity {
	private String tzType;//体征类别
	private String tzCode;//体征code
	private Integer sex;//患者性别
	private String relationCode;//业务关联code,type=6时为咨询code,type=7、8、9时为续方code type = 10\11时为申诉和反馈ID 12.协同服务code,14和15是文章审核功能是(0未认证1已认证2未通过)16.专科医生申请签约消息
	private String relationCode;//业务关联code,type=6时为咨询code,type=7、8、9时为续方code type = 10\11时为申诉和反馈ID 12.协同服务code,14和15是文章审核功能是(0未认证1已认证2未通过)16.专科医生申请签约消息 301.为患者code 21.wlyy_specialist里的wlyy_rehabilitation_plan_detail的id
	private String prescriptionStatus;//type=6续方审核状态 0待审核,1审核通过,2审核失败,3居民取消|type=7续方状态 0待取药,1已取药
	public String getCode() {

+ 1 - 1
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/common/account/BookingController.java

@ -361,7 +361,7 @@ public class BookingController extends WeixinBaseController {
                        json.put("date", obj.getStartTime());
                        json.put("orgName", obj.getOrgName());
                        json.put("orgCode", obj.getOrgCode());
                        json.put("doctorName", obj.getDeptName());
                        json.put("doctorName", obj.getDoctorName());
                        json.put("deptName", obj.getDeptName());
                        json.put("remark", patientName + ",您好!\n" + msg);

+ 4 - 4
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/manager/specialist/HopsitalServiceItemController.java

@ -12,8 +12,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.io.InputStream;
@ -135,15 +135,15 @@ public class HopsitalServiceItemController extends BaseController {
    /**
     * 机构服务项目导数据
     * @param request
     * @param file
     * @return
     */
    @RequestMapping(value = "importData", produces = "application/json;charset=UTF-8")
    @ResponseBody
    public String importData(HttpServletRequest request) {
    public String importData(@RequestParam(name = "file") MultipartFile file) {
        try {
            request.setCharacterEncoding("UTF-8");
            InputStream inputStream = request.getInputStream();
            InputStream inputStream = file.getInputStream();
            Workbook workbook = Workbook.getWorkbook(inputStream);
            specialistHospitalItemService.importData(workbook);

+ 8 - 8
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/manager/specialist/ServiceItemController.java

@ -14,8 +14,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.io.InputStream;
import java.util.List;
@ -78,19 +78,19 @@ public class ServiceItemController  extends BaseController {
     *
     * @param serviceItem
     * @param page
     * @param pageSize
     * @param pagesize
     * @return
     */
    @RequestMapping(value = "selectServiceItem", method = RequestMethod.GET)
    @ResponseBody
    public String selectServiceItem(@RequestParam(name = "serviceItem") String serviceItem,
                                    @RequestParam(name = "page",defaultValue = "1")Integer page,
                                    @RequestParam(name = "pageSize",defaultValue = "10")Integer pageSize){
                                    @RequestParam(name = "pagesize",defaultValue = "10")Integer pagesize){
        try {
            JSONObject jsonObject = serviceItemService.selectServiceItem(serviceItem,page,pageSize);
            JSONObject jsonObject = serviceItemService.selectServiceItem(serviceItem,page,pagesize);
            String totalCount = String.valueOf(jsonObject.get("totalCount"));
            Long total = Long.parseLong(totalCount);
            return write(200, "操作成功", page,pageSize,total,(List< SpecialistServiceItemDO>)jsonObject.get("detailModelList"));
            return write(200, "操作成功", page,pagesize,total,(List< SpecialistServiceItemDO>)jsonObject.get("detailModelList"));
        } catch (Exception ex) {
            error(ex);
            return error(-1, "操作失败");
@ -142,15 +142,15 @@ public class ServiceItemController  extends BaseController {
    /**
     * 服务项目导数据
     *
     * @param request
     * @param file
     * @return
     */
    @RequestMapping(value = "importData", produces = "application/json;charset=UTF-8")
    @ResponseBody
    public String importData(HttpServletRequest request) {
    public String importData(@RequestParam(name = "file") MultipartFile file) {
        try {
            request.setCharacterEncoding("UTF-8");
            InputStream inputStream = request.getInputStream();
            InputStream inputStream = file.getInputStream();
            Workbook workbook = Workbook.getWorkbook(inputStream);
            serviceItemService.importData(workbook);

+ 27 - 0
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/entity/specialist/HospitalServiceItemDO.java

@ -41,6 +41,12 @@ public class HospitalServiceItemDO extends IdEntityWithOperation implements Seri
    @Column(name = "expense")
    private Integer expense;//价格
    @Transient
    private String title;//标题
    @Transient
    private String content;//内容
    @Transient
    private Integer flag;//标识(1:社区,2、医院,3、社区、医院)
@ -50,6 +56,9 @@ public class HospitalServiceItemDO extends IdEntityWithOperation implements Seri
    @Transient
    private SpecialistServiceItemDO specialistServiceItemDO;
    public HospitalServiceItemDO() {
    }
    @Column(name = "saas_id")
    public String getSaasId() {
        return saasId;
@ -139,4 +148,22 @@ public class HospitalServiceItemDO extends IdEntityWithOperation implements Seri
    public void setImediate(Integer imediate) {
        this.imediate = imediate;
    }
    @Transient
    public String getTitle() {
        return title;
    }
    public void setTitle(String title) {
        this.title = title;
    }
    @Transient
    public String getContent() {
        return content;
    }
    public void setContent(String content) {
        this.content = content;
    }
}

+ 12 - 12
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/entity/specialist/SpecialistServiceItemDO.java

@ -53,16 +53,16 @@ public class SpecialistServiceItemDO extends IdEntityWithOperation implements Se
    private Integer hospitalGrade; //医院等级
    @Column(name = "three_hospitals")
    private Integer threeHospitals; //三级医院收费标准
    private Double threeHospitals; //三级医院收费标准
    @Column(name = "two_hospitals")
    private Integer twoHospitals; //二级医院收费标准
    private Double twoHospitals; //二级医院收费标准
    @Column(name = "one_hospitals")
    private Integer oneHospitals;//一级医院以及一级以下的社区医院
    private Double oneHospitals;//一级医院以及一级以下的社区医院
    @Column(name = "unit")
    private Integer unit; //计价单位
    private String unit; //计价单位
    @Column(name = "add_item")
    private String addItem;//加收项目
@ -177,38 +177,38 @@ public class SpecialistServiceItemDO extends IdEntityWithOperation implements Se
    }
    @Column(name = "three_hospitals")
    public Integer getThreeHospitals() {
    public Double getThreeHospitals() {
        return threeHospitals;
    }
    public void setThreeHospitals(Integer threeHospitals) {
    public void setThreeHospitals(Double threeHospitals) {
        this.threeHospitals = threeHospitals;
    }
    @Column(name = "two_hospitals")
    public Integer getTwoHospitals() {
    public Double getTwoHospitals() {
        return twoHospitals;
    }
    public void setTwoHospitals(Integer twoHospitals) {
    public void setTwoHospitals(Double twoHospitals) {
        this.twoHospitals = twoHospitals;
    }
    @Column(name = "one_hospitals")
    public Integer getOneHospitals() {
    public Double getOneHospitals() {
        return oneHospitals;
    }
    public void setOneHospitals(Integer oneHospitals) {
    public void setOneHospitals(Double oneHospitals) {
        this.oneHospitals = oneHospitals;
    }
    @Column(name = "unit")
    public Integer getUnit() {
    public String getUnit() {
        return unit;
    }
    public void setUnit(Integer unit) {
    public void setUnit(String unit) {
        this.unit = unit;
    }

+ 9 - 8
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/manager/specialist/ServiceItemService.java

@ -189,14 +189,13 @@ public class ServiceItemService extends BaseService {
            Map<Integer, ExcelData> mapping = mapping(itemDO);
            int finalRow = row;
            mapping.forEach((index, excelData) -> {
                String value = sheet.getCell(index, finalRow).getContents().trim();
                String value = sheet.getCell(index-1, finalRow).getContents().trim();
                excelData.transform(value);
            });
            JSONObject object = JSONObject.parseObject(itemDO.toString());
            array.add(object);
            array.add(itemDO);
        }
        String response = null;
        String url =getBaseUrl() + "importData1";
        String url =/*"http://localhost:10051/svr-specialist/"*/getBaseUrl() + "importData1";
        Map<String,String> params = new HashMap<>();
        params.put("serviceItems",array.toJSONString());
        try {
@ -244,6 +243,8 @@ public class ServiceItemService extends BaseService {
                Map<String, String> centerSite = new HashMap<>();
                centerSite.put("康复服务", "1");
                centerSite.put("健康服务", "2");
                System.out.print(data);
                String data1 = data;
                specialistServiceItemDO.setItemType(Integer.parseInt(centerSite.get(data)));
            }
        });
@ -263,14 +264,14 @@ public class ServiceItemService extends BaseService {
        dataMap.put(6, new ExcelData() {
            @Override
            public void transform(String data) {
                specialistServiceItemDO.setThreeHospitals(Integer.parseInt(data));
                specialistServiceItemDO.setThreeHospitals(Double.parseDouble(data));
            }
        });
        //二级医院收费
        dataMap.put(7, new ExcelData() {
            @Override
            public void transform(String data) {
                specialistServiceItemDO.setTwoHospitals(Integer.parseInt(data));
                specialistServiceItemDO.setTwoHospitals(Double.parseDouble(data));
            }
        });
@ -278,14 +279,14 @@ public class ServiceItemService extends BaseService {
        dataMap.put(8, new ExcelData() {
            @Override
            public void transform(String data) {
                specialistServiceItemDO.setOneHospitals(Integer.parseInt(data));
                specialistServiceItemDO.setOneHospitals(Double.parseDouble(data));
            }
        });
        //计价单位
        dataMap.put(9, new ExcelData() {
            @Override
            public void transform(String data) {
                specialistServiceItemDO.setUnit(Integer.parseInt(data));
                specialistServiceItemDO.setUnit((data));
            }
        });
        //加收项目

+ 13 - 12
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/manager/specialist/SpecialistHospitalItemService.java

@ -190,14 +190,15 @@ public class SpecialistHospitalItemService extends BaseService {
        JSONArray array = new  JSONArray();
        for (int row = 1; row < rows; row++) {  //索引从0开始,第一行为标题
            HospitalServiceItemDO hospitalServiceItemDO = new HospitalServiceItemDO();
            Map<Integer, ExcelData> mapping = mapping(hospitalServiceItemDO);
            Map<Integer, ExcelData> mapping = mapping1(hospitalServiceItemDO);
            int finalRow = row;
            mapping.forEach((index, excelData) -> {
                String value = sheet.getCell(index, finalRow).getContents().trim();
                String value = sheet.getCell(index-1, finalRow).getContents().trim();
                excelData.transform(value);
            });
            JSONObject object = JSONObject.parseObject(hospitalServiceItemDO.toString());
            array.add(object);
            Hospital hospital = hospitalDao.findByName(hospitalServiceItemDO.getHospitalName());
            hospitalServiceItemDO.setHospital(hospital.getCode());
            array.add(hospitalServiceItemDO);
        }
        String response = null;
        String url =getBaseUrl() + "importData2";
@ -219,33 +220,33 @@ public class SpecialistHospitalItemService extends BaseService {
     * @param hospitalServiceItemDO
     * @return
     */
    private Map<Integer, ExcelData> mapping(HospitalServiceItemDO hospitalServiceItemDO) {
    private Map<Integer, ExcelData> mapping1(HospitalServiceItemDO hospitalServiceItemDO) {
        Map<Integer, ExcelData> dataMap = new HashMap<>();
        //医院名称
        dataMap.put(1, new ExcelData() {
            @Override
            public void transform(String data) {
                hospitalServiceItemDO.setHospital(hospitalServiceItemDO.getHospital());
                hospitalServiceItemDO.setHospitalName(data);
            }
        });
        //医院名称
        //服务项目标题
        dataMap.put(2, new ExcelData() {
            @Override
            public void transform(String data) {
                hospitalServiceItemDO.setHospitalName(hospitalServiceItemDO.getHospitalName());
                hospitalServiceItemDO.setTitle(data);
            }
        });
        //服务项目id
        //服务项目内容
        dataMap.put(3, new ExcelData() {
            @Override
            public void transform(String data) {
                hospitalServiceItemDO.setServiceItemId(hospitalServiceItemDO.getServiceItemId());
                hospitalServiceItemDO.setContent(data);
            }
        });
        //服务项目名称
        dataMap.put(4, new ExcelData() {
            @Override
            public void transform(String data) {
                hospitalServiceItemDO.setServiceItemName(hospitalServiceItemDO.getServiceItemName());
                hospitalServiceItemDO.setExpense(Integer.parseInt(data));
            }
        });
        hospitalServiceItemDO.setSaasId("dev");

+ 1 - 1
patient-co-manage/wlyy-manage/src/main/resources/application.yml

@ -318,7 +318,7 @@ reservation:
  zyurl: http://59.61.92.90:8072/wlyy_service
#健康活动url
healthbank:
  url: http://192.168.120.167:8661/svr-wlyy-health-bank/svr-health-bank/
  url: http://www.xmtyw.cn/svr-wlyy-health-bank/svr-health-bank/
wechat:
  appId: wxad04e9c4c5255acf
  appSecret: ae77c48ccf1af5d07069f5153d1ac8d3

+ 160 - 62
patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/desizenMan/new-institutional-projects.jsp

@ -82,51 +82,36 @@
	<body>
		<div class="page-title">
			新增机构项目
			<img id="closePage" src="${ctx}/static/desizenMan/images/close.png" />
			<img id="closePage" class="closePage" src="${ctx}/static/desizenMan/images/close.png" />
		</div>
		<div class="page-content plr20">
			<div class="flex-box ptb10 filter-box">
				<div class="btn-group w160 mr20">
				  <button type="button" class="btn btn-default btn-group-title">请选择项目类别</button>
				  <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
				    <span class="caret"></span>
				    <span class="sr-only">Toggle Dropdown</span>
				  </button>
				  <ul class="dropdown-menu">
				    <li><a href="#">Action</a></li>
				    <li><a href="#">Another action</a></li>
				    <li><a href="#">Something else here</a></li>
				    <li role="separator" class="divider"></li>
				    <li><a href="#">Separated link</a></li>
				  </ul>
				</div>
			<div class="flex-box ptb10 filter-box" style="justify-content: space-between">
				<div class="btn-group w160 mr20">
				  <button type="button" class="btn btn-default btn-group-title">请选择医院等级</button>
				  <button type="button" class="btn btn-default btn-group-title btn-grade">请选择医院等级</button>
				  <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"></button>
				  <ul class="dropdown-menu">
				    <li><a href="#">Action</a></li>
				    <li><a href="#">Another action</a></li>
				    <li><a href="#">Something else here</a></li>
				    <li role="separator" class="divider"></li>
				    <li><a href="#">Separated link</a></li>
					  <li>
						  <a href="#">所有</a>
					  </li>
					  <li>
						  <a href="#">三级医院</a>
					  </li>
					  <li>
						  <a href="#">二级医院</a>
					  </li>
					  <li>
						  <a href="#">一级及以下</a>
					  </li>
				  </ul>
				</div>
				<div class="btn-group w160 mr20">
				  <button type="button" class="btn btn-default btn-group-title">请选择病案项目</button>
				  <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"></button>
				  <ul class="dropdown-menu">
				    <li><a href="#">Action</a></li>
				    <li><a href="#">Another action</a></li>
				    <li><a href="#">Something else here</a></li>
				    <li role="separator" class="divider"></li>
				    <li><a href="#">Separated link</a></li>
				  </ul>
				<div class="flex-box">
					<div class="input-group w320 mr20">
						<input type="text" class="form-control hostpital-name" placeholder="请输入医院名称">
						<div class="input-group-addon"></div>
					</div>
					<button class="btn btn-primary w100" id="btn-search">查询</button>
				</div>
				<div class="input-group w320 mr20">
			      <input type="text" class="form-control" placeholder="请输入计算机编码、项目编码、服务名称">
			      <div class="input-group-addon"></div>
			    </div>
				<button class="btn btn-primary w100">查询</button>
			</div>
			<div class="flex-box fuwu-box">
				<div class="flex-box-item">
@ -168,8 +153,8 @@
			<div class="row text-center">
				<p class="ptb20 mb0"><span class="checkbox-box"><input type="checkbox" class="immediately" /><i></i>立即生效</span></p>
				<button class="btn btn-primary mr20 w100">确认</button>
				<button class="btn btn-default w100">取消</button>
				<button class="btn btn-primary mr20 w100 add">确认</button>
				<button class="btn btn-default w100 closePage">取消</button>
			</div>
		</div>
@ -181,23 +166,30 @@
		<script type="text/javascript">
			var $fuwuTable=$(".fuwu-table");
			var hospitalData = [];
            $.ajax({
                url: ctx + "/admin/specialist/hospitalServiceItem/selectByHospitals",
                method: "POST",
                dataType: "json",
                async: true,
                success:function (res) {
                    console.log('请求成功');
                    var html = ''
                    res.data.forEach(function (item) {
						html += '<li><span class="yiyuan-code" data-grade='+item.grade+' data-code='+item.code+'>'+item.name+'</span></li>'
                    })
					$('.yiyuan').html(html);
                },
                error:function (err) {
                    console.log(err)
                }
            })
//			获取机构
			function selectHospital(name,grade) {
                (name)?name:name="";
                (grade)?grade:grade="";
                $.ajax({
                    url: ctx + "/admin/specialist/hospitalServiceItem/selectHospital",
                    method: "POST",
                    dataType: "json",
                    async: true,
                    data:{hospitalName:name,grade:grade},
                    success:function (res) {
                        console.log('请求成功');
                        var html = ''
                        res.data.forEach(function (item) {
                            html += '<li><span class="yiyuan-code" data-grade='+item.grade+' data-code='+item.code+'>'+item.name+'</span></li>'
                        })
                        $('.yiyuan').html(html);
                    },
                    error:function (err) {
                        console.log(err)
                    }
                })
            }
            selectHospital();
			//获取项目
			function selectByHospital(code) {
				(code)?code:code="";
@ -207,7 +199,7 @@
                    method: "POST",
                    dataType: "json",
                    async: true,
					data:{hospital:""},
					data:{hospital:code},
                    success:function (res) {
                        console.log('请求成功');
                        console.log(res)
@ -226,7 +218,8 @@
			$("body").on('click','.yiyuan li',function(){
				var lastItem=$fuwuTable.find('.flex-box:last-child');
				lastItem.find(".hosp").html($(this).html());
				console.log(2222)
				var code = $(this).children('span')[0].dataset.code;
                selectByHospital(code)
			})
			$("body").on('click','.xiangmu li',function(){
				var lastItem=$fuwuTable.find('.flex-box:last-child');
@ -248,13 +241,13 @@
				var l = $('.fuwu-table>div').length-1;
				var t = {};
                t.code = $($('.fuwu-table>div')[l]).find('.yiyuan-code').attr('data-code');
                t.grade = $($('.fuwu-table>div')[l]).find('.yiyuan-code').attr('data-grade');
                t.id = $(this).find('span').attr('data-id');
                console.log('当前最后一个');
                console.log(t);
                hospitalData.forEach(function (item) {
                    console.log(item)
					if (item.id == t.id && item.code == t.code){
					    console.log(2222)
                        layer.msg('已选择此项目',{icon:5});
						h = false;
					}
@ -262,6 +255,16 @@
				if (h == false){
                    return false;
				}
				//输入默认价格
				var price = '';
				if(t.grade == 1){
					price = $(this).children('span')[0].dataset.one
				}else if(t.grade == 2){
                    price = $(this).children('span')[0].dataset.two;
				}else if(t.grade == 3){
                    price = $(this).children('span')[0].dataset.three;
                }
                lastItem.find("input").val(price)
				lastItem.find(".proj").html($(this).html());
				$fuwuTable.append('<div class="flex-box">\
					<div class="w300 hosp"></div>\
@ -286,11 +289,106 @@
			})
            //        点击选择下拉框内容
            $('.btn-group').on('click','.dropdown-menu a',function (e){
                console.log($(this))
                // console.log($(this))
                $(this).parents('.btn-group').find('.btn-group-title').text($(this).text())
                console.log(ctx)
                // console.log(ctx)
            });
            $('.dropdown-toggle').dropdown()
            $('.dropdown-toggle').dropdown();
            
//            点击确认新增
			$('.add').on('click',function () {
			    console.log($('.fuwu-table>.flex-box'));
				var length = $('.fuwu-table>.flex-box').length-1;
				var data = [];
				var imediate = $('.immediately').prop('checked');
				(imediate)?imediate = 1 :imediate = 0;
				var h = true;
				for (var i = 0; i<=length;i++){
				    var item = {};
				    item.hospital=$($('.fuwu-table>.flex-box')[i]).find('.yiyuan-code').attr('data-code');
				    item.hospitalName = $($('.fuwu-table>.flex-box')[i]).find('.yiyuan-code').text();
				    item.serviceItemId = $($('.fuwu-table>.flex-box')[i]).find('.xiangmu-id').attr('data-id');
                    item.serviceItemName = $($('.fuwu-table>.flex-box')[i]).find('.xiangmu-id').text();
				    item.expense = $($('.fuwu-table>.flex-box')[i]).find('.cost').val();
				    item.status = 1;
                    item.imediate = imediate;
                    if (item.hospital && item.serviceItemName == ""){
                        layer.msg('请选择项目',{icon:5});
                        h = false;
                        break;
                    }
				    if (item.hospital && item.expense == ""){
                        layer.msg('请填上金额',{icon:5});
                        h = false;
                        break;
                    }
					if (item.expense != "" && (item.hospitalName == '' || item.serviceItemName == "")){
                        layer.msg('请填上医院和项目',{icon:5});
                        h = false;
                        break;
					}
                    if(item.hospitalName == '' && item.expense == "" && item.serviceItemName == ""){
                        break;
                    }
				    data.push(item)
				};
				if (data.length < 1){
                    layer.msg('请填上需要添加的信息',{icon:5});
				    return;
				}
				//如果不满足条件,不进行ajax
				if (h == false){
				    return;
				}
                data = JSON.stringify(data);
                parms = {
                    hospitalServiceItem:data
                }
                $.ajax({
                    url: ctx + "/admin/specialist/hospitalServiceItem/createHospitalServiceItem",
                    method: "POST",
                    dataType: "json",
                    async: true,
                    data:parms,
                    success:function (res) {
                        console.log(res);
                        if (res.data.status == 200){
                            layer.msg('操作成功',{icon:1});
                            setTimeout(function () {
                                var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                                parent.layer.close(index); //再执行关闭
                            },3000)
						}
                    },
                    error:function (err) {
                        console.log(err)
                    }
                })
            });
			
//			点击查询医院
			$('#btn-search').on('click',function () {
				debugger
				var name = $('.hostpital-name').val();
				var grade = $('.btn-grade').text();
				if (grade == '三级医院'){
				    grade = 3;
				}else if(grade == '二级医院'){
				    grade = 2
				}else if(grade == '一级及以下'){
				    grade = 1
				}else{
				    grade = '';
				}
				if(grade || name){
                    selectHospital(name,grade)
                }
            })
//			关闭弹窗
			$('.closePage').on('click',function () {
                var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                parent.layer.close(index); //再执行关闭
            })
		</script>
	</body>
</html>

+ 670 - 81
patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/desizenMan/service_project_management.jsp

@ -6,6 +6,31 @@
		<link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
		<link href="${ctx}/static/desizenMan/css/bootstrap-treeview.min.css" rel="stylesheet" />
		<style type="text/css">
			.flex{
				display:-webkit-box;
				display:-webkit-flex;
				display:flex;
			}
			.flex-sp-b{
				justify-content: space-between;
				-webkit-justify-content: space-between;
			}
			.flex-sp-a{
				justify-content: space-around;
				-webkit-justify-content: space-around;
			}
			.flex-sp-c{
				justify-content: center;
				-webkit-justify-content: center;
			}
			.flex-sp-end{
				justify-content: flex-end;
				-webkit-justify-content: flex-end;
			}
			.flex-cz-c{
				-webkit-align-items:center;
				align-items:center;
			}
			.icon{width: 20px;height: 20px;vertical-align: sub;background-size: 100% 100%;background-repeat: no-repeat;display: inline-block;}
			.icon15{width: 15px;height: 15px;}
			.icon30{width: 30px;height: 30px;}
@ -13,7 +38,7 @@
			.icon-delete{background-image: url(${ctx}/static/desizenMan/images/delete.png);}
			.operation-box{font-size: 0;padding: 20px;}
			.operation-box .form-control{border-right-width: 0;font-size: 12px;height: auto;border-radius: 0;width: 290px!important;line-height: 16px;}
			.operation-box .form-control{font-size: 12px;height: auto;border-radius: 0;width: 290px!important;line-height: 16px;}
			.operation-box .input-group-addon{padding: 0;border: none;background-color: none;}
			.operation-box .form-inline .btn{float: none;}
			.operation-box .btn{margin-left: 20px;float: left;width: 90px;font-size: 12px;line-height: 16px;padding: 6px;text-align: center;}
@ -40,10 +65,18 @@
			.item-name{position: relative;color: #999;padding-right: 10px;width: 80px;text-align: justify;text-align-last: justify;display: inline-block;}
			.item-name:after{content: ':';position: absolute;right: 5px;}
			/*立即生效*/
			.checkbox-box{position: relative;}
			.immediately{opacity: 0;position: absolute;width: 100%;height: 100%;top: 0;cursor: pointer;}
			.checkbox-box{position: relative;z-index: 20}
			.immediately{opacity: 0;position: absolute;width: 100%;height: 100%;top: 0;cursor: pointer;z-index: 2;}
			.immediately + i{display: inline-block;width: 15px;height: 15px;vertical-align: middle;margin-right: 10px;background: url(${ctx}/static/desizenMan/images/weigouxuan_icon.png) center center / cover no-repeat;}
			.immediately:checked + i{background-image: url(${ctx}/static/desizenMan/images/yigouxuan_icon.png);}
            .immediatelyClick{
				position: absolute;
				width: 80px;
				height: 20px;
				top: 11px;
				left: 470px;
				z-index: 20;
			}
			.layui-layer-blue .layui-layer-title{background-color: #2d9bd2;color: #fff;}
			.layui-layer-blue .layui-layer-close1{background-color: #fff;border-radius: 100%;background-image: none;position: relative;width: 20px;height: 20px;margin-top: -4px;}
@ -55,17 +88,113 @@
			.node-institutional_project{
				border:none!important;
			}
			.display-none{
				opacity: 0;
			}
			.webuploader-pick{
				display: initial;background-color: transparent;
			}
            .lay-box-3 .lay{
            width: 420px!important;
            height: 260px;
        }
        .lay-box-3 .lay .title{
            width: 100%;
        }
        .lay-box-3 .lay .file{
            width: 370px;height: 30px;margin: 20px auto;position: relative;
        }
        .lay-box-3 .lay .file span{
            font-size: 12px;color: #333;
        }
        .lay-box-3 .lay .file input:nth-of-type(1){
            width: 200px;height: 30px;border: solid 1px #d0d0d0;background-color: #fff!important;
        }
        .lay-box-3 .lay .file input:nth-of-type(2){
            width: 90px;
            height: 30px;
            background-color: #2d9bd2;
            border-radius: 2px;
            font-size: 12px;
            color: #fff;
            opacity: 0;
            z-index: 99;
        }
        .lay-box-3 .lay .file button{
            width: 90px;
            height: 30px;
            background-color: #2d9bd2;
            border: none;
            border-radius: 2px;
            font-size: 12px;
            color: #fff;
            position: absolute;
            right: 0;
            z-index: 1;
        }
        .lay-box-3 .lay a{
            display: block;
            margin-left: 87px;
            font-size: 12px;color: #2d9bd2;
        }
        .lay-box-3 .lay p {
            font-size: 12px;color: #eb4b3c;text-align: center;
        }
        .lay-box-3 .lay .lay-button{
            text-align: center;margin-top: 40px;
        }
        .lay-box-3 .lay .lay-button button{
            width: 99px;
            height: 35px;
            background-color: #2d9bd2;
            border-radius: 2px;
            border: none;
            color:#fff;
            font-size: 14px;
        }
        .lay-box-3 .lay .lay-button button:nth-of-type(2){
            background-color: #b9c8d2;
        }
		.lay .title{
			 width: 680px;height: 40px;line-height: 40px;background-color: #fff;background-color: #2d9bd2;
			 font-size: 14px;color: #fff;padding-left: 20px;padding-right: 10px;
		 }
		</style>
	</head>
	<body>
        <div class="lay-box-3-1" style="display:none">
            <div class="lay-box-3">
                <div class="lay">
                    <div class="title flex flex-sp-b flex-cz-c">
                        <span>批量导入</span>
                        <img class="closePage" src="${ctx}/static/specialty/images/Close_btn.png" alt="">
                    </div>
                    <div class="file flex flex-sp-b flex-cz-c">
                        <span>导入文件:</span>
                        <input type="text" class="fileName" disabled>
                        <input class="uploadfile" type="file" value="选择" onchange="auploadFile(event)">
                        <button>选择</button>
                    </div>
                    <a href="${ctx}/static/desizenMan/Sheet1.xls" target="_blank">模板下载</a>
                    <p>请核对导入数据,若导入项目信息已存在,将会更新项目表中的数据。</p>
                    <div class="lay-button">
                        <button onclick="submitFile(this)">确认</button>
                        <button class="closePage">取消</button>
                    </div>
                </div>
            </div>
        </div>
		<div class="operation-box clearfix">
			<div class="pull-left">
				<div class="form-inline">
					<div class="input-group">
						<input type="text" class="form-control" id="input-select-node" placeholder="请输入计算机编码、项目编码、项目名称" />
						<span class="input-group-addon">
							<i class="icon icon30 icon-search"></i>
						</span>
						<div class="input-group">
							<input id="input-select-node" type="text" class="form-control" aria-label="..." style="width:270px;height:34px;" placeholder="输入医院名">
						</div>
						<%--<input type="text" class="form-control" id="input-select-node" placeholder="请输入计算机编码、项目编码、项目名称" />--%>
						<%--<span class="input-group-addon">--%>
							<%--<i class="icon icon30 icon-search"></i>--%>
						<%--</span>--%>
					</div>
					<button class="btn btn-primary search-btn">查询</button>
				</div>
@ -73,7 +202,9 @@
			<div class="pull-right text-right">
				<div class="operation-group clearfix" role="group" aria-label="...">
				  <button type="button" class="btn btn-danger delete"><i class="icon icon15 icon-delete"></i>&emsp;删除</button>
				  <button type="button" class="btn btn-warning">批量导入</button>
				  <sec:authorize url="/admin/specialist/hospitalServiceItem/importData">
				  	<button id="btn_import" type="button" class="btn btn-warning"><div id="div_file_picker">批量导入</div></button>
				  </sec:authorize>
				  <button type="button" class="btn btn-primary add">新增机构项目</button>
				</div>
			</div>
@ -102,66 +233,70 @@
							<div class="row">
								<div class="col-xs-6">
									<span class="item-name">名称</span>
									<span>院前急救箱</span>
									<span class="item-title"></span>
								</div>
								<div class="col-xs-6">
									<span class="item-name">类型</span>
									<span>康复服务</span>
									<span class="item-type"></span>
								</div>
							</div>
							<div class="row">
								<div class="col-xs-12">
									<span class="item-name">内容</span>
									<span>院前急救箱院前急救箱院前急救箱院前急救箱院前急救箱</span>
									<span class="item-content"></span>
								</div>
							</div>
							<div class="row">
								<div class="col-xs-12">
									<span class="item-name">除外内容</span>
									<span>院前急救箱院前急救箱院前急救箱院前急救箱院前急救箱</span>
									<span class="item-chuwai"></span>
								</div>
							</div>
							<div class="row">
								<div class="col-xs-12">
									<span class="item-name">说明</span>
									<span>院前急救箱院前急救箱院前急救箱院前急救箱院前急救箱</span>
									<span class="item-shuoming"></span>
								</div>
							</div>
							<div class="row">
								<div class="col-xs-6">
									<span class="item-name">病案项目</span>
									<span>急救箱</span>
									<span class="item-xiangmu"></span>
								</div>
								<div class="col-xs-6">
									<span class="item-name">医院等级</span>
									<span>三级</span>
									<span class="item-grade"></span>
								</div>
							</div>
							<div class="row">
								<div class="col-xs-6">
									<p><span class="item-name c-323232">病案项目</span><span>元</span></p>
									<p><span class="item-name">三级医院</span><span>126</span></p>
									<p><span class="item-name c-323232">收费标准</span><span class="item-biaozhun">元</span></p>
									<p><span class="item-name item-dengji">三级医院</span><span class="item-jiage"></span></p>
								</div>
								<div class="col-xs-6">
									<br />
									<p><span class="item-name mt-30">实际收费</span><span>126</span></p>
									<p><span class="item-name mt-30">实际收费</span><span class="item-shiji"></span></p>
								</div>
							</div>
							<div class="row">
								<div class="col-xs-12">
									<span class="item-name">计价单位</span>
									<span>次</span>
									<span class="item-danwei"></span>
								</div>
							</div>
							<div class="row">
								<div class="col-xs-12">
									<span class="item-name">收费项目</span>
									<span>其他检查检验器械费用</span>
									<span class="item-name">加收项目</span>
									<span class="item-jiashou"></span>
								</div>
							</div>
							<div class="row text-center">
								<p class="ptb-30 mb-0"><span class="checkbox-box"><input type="checkbox" class="immediately" /><i></i>立即生效</span></p>
								<button class="btn btn-danger mb-30">删除服务</button>
								<p class="ptb-30 mb-0">
                                    <div class="checkbox-box">
                                        <input type="checkbox" class="immediately"/><i></i>立即生效
                                        <div class="immediatelyClick"></div>
                                    </div>
                                </p>
							</div>
						</td>
					</tr>
@ -208,8 +343,13 @@
                    ]
                }
            ];
            var xiangmuContent = [];
            var $selectableTree=null;
            var $institutionalProject = null;
            var initSelectableTree = function() {
				/*之前人写的方法,删除模式不一样,改了会出错,就设置成空了*/
//                var deleteStr='<span class="delete-node" data-type="1">删除</span>';
                var deleteStr='';
                return $('#medical_institution').treeview({
                    data: defaultData,
                    selectedColor:"#2d9bd2",//选择时的颜色
@ -219,62 +359,80 @@
                    showBorder: false,//是否显示边框
                    backColor:"#FFFFFF",
                    onNodeSelected: function(event, node) {
//                        nodeParent=$("#medical_institution").find('.node-selected');
//                        console.log(nodeParent);
                        var nodeParent=$("#medical_institution").find('.node-selected');
                        var unNodeId=null;
                        console.log('nodeParent')
                        console.log(nodeParent);
						if(nodeParent.length){
                            $.each(nodeParent,function(index,item){
                                var _nodeid=$(item).data('nodeid')
                                if(_nodeid!=node.nodeId){
                                    unNodeId=_nodeid;
                                }
                            })
						}
                      	unNodeId && ( $("#medical_institution").treeview("unselectNode", [unNodeId, { silent: true } ]));
                        (deleteMode && $("#medical_institution").treeview("editNode", [node.nodeId, { text: node.text.indexOf(deleteStr)===-1?node.text+=deleteStr:node.text}])) || $("#medical_institution").treeview("editNode", [node.nodeId, { text: node.text.replace(deleteStr,'')}]);
						if($("#medical_institution").find('.node-selected')[0]){
                            var code = $("#medical_institution").find('.node-selected')[0].dataset.code
                            selectByCondition(code);
						}
                    },
                    onNodeUnselected: function (event, node) {
                        $("#medical_institution").treeview("selectNode", [node.nodeId, { silent: true } ]);
                        console.log('节点未选中')
                    }
                });
            };
            $.ajax({
                url: ctx + "/admin/specialist/hospitalServiceItem/selectByHospitals",
                method: "POST",
                dataType: "json",
                async: true,
                success:function (res) {
                    console.log(res);
                    res.data.forEach(function (item) {
                        var t = {}
                        t.text = item.name;
                        if (item.townName == '思明区'){
                            defaultData[0].nodes[0].nodes.push(t)
                        }
                        if (item.townName == '海沧区'){
                            defaultData[0].nodes[1].nodes.push(t)
                        }
                        if (item.townName == '湖里区'){
                            defaultData[0].nodes[2].nodes.push(t)
                        }
                        if (item.townName == '集美区'){
                            defaultData[0].nodes[3].nodes.push(t)
                        }
                        if (item.townName == '翔安区'){
                            defaultData[0].nodes[4].nodes.push(t)
                        }
                    })
                    $selectableTree = initSelectableTree();
                    bindEvent();
                },
                error:function (err) {
                    console.log(err)
                }
            })
//            获取医疗机构
            function selectHospital() {
                $.ajax({
                    url: ctx + "/admin/specialist/hospitalServiceItem/selectHospital",
                    method: "POST",
                    dataType: "json",
                    async: true,
                    data:{hospitalName:'',grade:''},
                    success:function (res) {
                        console.log(res);
                        res.data.forEach(function (item) {
                            var t = {}
                            t.text = item.name;
                            t.code = item.code;
                            if (item.townName == '思明区'){
                                defaultData[0].nodes[0].nodes.push(t)
                            }
                            if (item.townName == '海沧区'){
                                defaultData[0].nodes[1].nodes.push(t)
                            }
                            if (item.townName == '湖里区'){
                                defaultData[0].nodes[2].nodes.push(t)
                            }
                            if (item.townName == '集美区'){
                                defaultData[0].nodes[3].nodes.push(t)
                            }
                            if (item.townName == '翔安区'){
                                defaultData[0].nodes[4].nodes.push(t)
                            }
                        })
                        $selectableTree = initSelectableTree();
                    },
                    error:function (err) {
                        console.log(err)
                    }
                })
            }
            selectHospital();
	        var serverData=[{
	            text: '检查费',
	            tags: ['4'],
	            tags: [0],
	            color: '#323232',
	            nodes: [
	              {
	                text: '浅表器官彩色多普勒超声波检查',
	              },
	              {
	                text: '彩色多普勒超声波检查',
	              }
	            ]
	        }]
	            nodes: []
	        }];
	        var deleteStr='<span class="delete-node">删除</span>';
	        var deleteMode=false;
	        $('.delete').on('click',function(){
@ -293,12 +451,14 @@
	        };
	        $('.search-btn').on('click', function (e) {
	          findSelectableNodes();//医疗机构搜索
	          findSelectableNodes1();//机构项目搜索
//	          findSelectableNodes1();//机构项目搜索
	        });
//	        	机构项目
	         var institutionalProject = function() {
	          var deleteStr='<span class="delete-node">删除</span>';
	             /*之前人写的方法,删除模式不一样,改了会出错,就设置成空了*/
//	          var deleteStr='<span class="delete-node" data-type="2">删除</span>';
 			  var deleteStr = '';
	          return $('#institutional_project').treeview({
	            data: serverData,
	            selectedColor:"#2d9bd2",//选择时的颜色
@ -308,26 +468,196 @@
          		showBorder: false,//是否显示边框
  				backColor:"#FFFFFF",
	            onNodeSelected: function(event, node) {
					(deleteMode && $("#institutional_project").treeview("editNode", [node.nodeId, { text: node.text.indexOf(deleteStr)===-1?node.text+=deleteStr:node.text}])) || $("#institutional_project").treeview("editNode", [node.nodeId, { text: node.text.replace(deleteStr,'')}]);
                    var nodeParent=$("#institutional_project").find('.node-selected');
                    var unNodeId=null;
//                    console.log('nodeParent')
//                    console.log(nodeParent);
                    if(nodeParent.length){
                        $.each(nodeParent,function(index,item){
                            var _nodeid=$(item).data('nodeid')
                            if(_nodeid!=node.nodeId){
                                unNodeId=_nodeid;
                            }
                        })
                    }
                    node.text = node.text.toString()
                    unNodeId && ( $("#institutional_project").treeview("unselectNode", [unNodeId, { silent: true } ]));
                    (deleteMode && $("#institutional_project").treeview("editNode", [node.nodeId, { text: node.text.indexOf(deleteStr)===-1?node.text+=deleteStr:node.text}])) || $("#institutional_project").treeview("editNode", [node.nodeId, { text: node.text.replace(deleteStr,'')}]);
					var id = $("#institutional_project").find('.node-selected')[0].dataset.code
					console.log(id);
					if (!id){
					    return
					}
                    console.log(xiangmuContent);
                    var t = null;
					xiangmuContent.forEach(function (item) {
						if (id == item.hospitalServiceItem.id){
                            t = item
						}
                    });
					console.log(t);
                    var grade = '',price = '',itemType='',hospitalGrade='';
					$('.item-title').text(t.hospitalServiceItem.serviceItemName);
                    t.hospitalServiceItem.specialistServiceItemDO.itemType == 0 ? itemType = '康健服务':itemType = '健康管理';
					$('.item-type').text(itemType);
					$('.item-content').text(t.hospitalServiceItem.specialistServiceItemDO.content);
					$('.item-chuwai').text(t.hospitalServiceItem.specialistServiceItemDO.excludeContent);
					$('.item-shuoming').text(t.hospitalServiceItem.specialistServiceItemDO.description);
					$('.item-xiangmu').text(t.hospitalServiceItem.specialistServiceItemDO.diseaseItem);
					if(t.hospitalServiceItem.specialistServiceItemDO.hospitalGrade == 1){
                        hospitalGrade = '一级';
                        grade = '一级医院';
                        price = t.hospitalServiceItem.specialistServiceItemDO.oneHospitals;
					}else if(t.hospitalServiceItem.specialistServiceItemDO.hospitalGrade == 2){
                        hospitalGrade = '二级';
                        grade = '二级医院';
                        price = t.hospitalServiceItem.specialistServiceItemDO.twoHospitals;
					}else if(t.hospitalServiceItem.specialistServiceItemDO.hospitalGrade == 3){
                        hospitalGrade = '三级';
                        grade = '三级医院';
                        price = t.hospitalServiceItem.specialistServiceItemDO.threeHospitals;
                    }
                    console.log('医院等级'+grade,'价格'+price);
					$('.item-grade').text(hospitalGrade);
					$('.item-dengji').text(grade);
					$('.item-jiage').text(price);
					$('.item-shiji').text(t.hospitalServiceItem.expense);
					$('.item-danwei').text(t.hospitalServiceItem.specialistServiceItemDO.unit);
					$('.item-jiashou').text(t.hospitalServiceItem.specialistServiceItemDO.addItem);
					console.log(t.hospitalServiceItem.imediate)
					if(t.hospitalServiceItem.imediate == 1){
                        console.log($('.immediately')[0])
						$($('.immediately')[0]).prop('checked','checked');
					}else{
                        $($('.immediately')[0]).prop('checked',false);
					}
	            },
	            onNodeUnselected: function (event, node) {
                    $("#institutional_project").treeview("selectNode", [node.nodeId, { silent: true } ]);
	            	console.log('节点未选中')
	            }
	          });
	        };
	        var $institutionalProject = institutionalProject();
            $institutionalProject = institutionalProject();
	        function selectNode1(e) {
	          	var selectedNodes1=$selectableTree.treeview('getSelected');
                var selectedNodes1=$selectableTree.treeview('getSelected');
                var selectedNodes2=$institutionalProject.treeview('getSelected');
                var node=selectedNodes1[0];
                var node1=selectedNodes2[0];
                console.log(node);
                console.log(node1);
                if(!node && !node1){
                    return false
				}
                if (node.code || (node1 && node1.code)) {
                    layer.confirm('您确定要删除此机构服务项目?', {
                        title: '删除提示',
                        skin: 'layui-layer-blue', //样式类名
                        anim:4,
                        btn: ['确定','取消'] //按钮
                    }, function(index){
                        var data = {};
                        var type = '';
//                        删除项目
                        if(node1 && node1.code){
                            data.id = node1.code;;
                            data.hospital = '';
                            data.serviceItem = '';
                            type = 1;
                        }else{
//                            删除机构关联下的项目
                            data.hospital = node.code;
                            type = 2;
						}
                        $.ajax({
                            url: ctx + "/admin/specialist/hospitalServiceItem/deleteHospitalItem",
                            method: "POST",
                            dataType: "json",
                            async: true,
                            data:data,
                            success:function (res) {
                                console.log(res)
                                if (res.status == 200){
                                    if (type == 1){
                                        $institutionalProject.treeview("deleteNode", [node1.nodeId, { silent: true } ])
									}else{
                                        defaultData = [
                                            {
                                                text: '厦门市',
                                                href: '#parent1',
                                                nodes: [
                                                    {
                                                        text: '思明区',
                                                        nodes: [
                                                        ]
                                                    },
                                                    {
                                                        text: '海沧区',
                                                        href: '#child2',
                                                        nodes: [
                                                        ]
                                                    }, {
                                                        text: '湖里区',
                                                        nodes: [
                                                        ]
                                                    },
                                                    {
                                                        text: '集美区',
                                                        nodes: [
                                                        ]
                                                    },
                                                    {
                                                        text: '翔安区',
                                                        nodes: [
                                                        ]
                                                    },
                                                ]
                                            }
                                        ];
                                        serverData=[{
                                            text: '检查费',
                                            tags: [0],
                                            color: '#323232',
                                            nodes: []
                                        }];
                                        $institutionalProject = null;
                                        $institutionalProject = institutionalProject();
                                        selectHospital();
									}
                                    layer.closeAll();
                                    $('.item-title').text('');
                                    $('.item-type').text('');
                                    $('.item-content').text('');
                                    $('.item-chuwai').text('');
                                    $('.item-shuoming').text('');
                                    $('.item-xiangmu').text('');
                                    $('.item-grade').text('');
//                                    $('.item-dengji').text('');
                                    $('.item-biaozhun').text('');
                                    $('.item-jiage').text('');
                                    $('.item-danwei').text('');
                                    $('.item-jiashou').text('');
                                }
                            }
                        })
					})
                }
	          	/*var selectedNodes1=$selectableTree.treeview('getSelected');
	          	console.log(selectedNodes1)
	          	var node=selectedNodes1[0];
                var deleteStr='<span class="delete-node" data-type="1">删除</span>';
				node && ((deleteMode && $selectableTree.treeview("editNode", [node.nodeId, { text: node.text.indexOf(deleteStr)===-1?node.text+=deleteStr:node.text}])) || $selectableTree.treeview("editNode", [node.nodeId, { text: node.text.replace(deleteStr,'')}]));
	        	var selectedNodes2=$institutionalProject.treeview('getSelected');
	          	var node1=selectedNodes2[0];
	          	node1 && ((deleteMode && $institutionalProject.treeview("editNode", [node1.nodeId, { text: node1.text.indexOf(deleteStr)===-1?node1.text+=deleteStr:node1.text}])) || $institutionalProject.treeview("editNode", [node1.nodeId, { text: node1.text.replace(deleteStr,'')}]));
                deleteStr='<span class="delete-node" data-type="2">删除</span>';
	          	node1 && ((deleteMode && $institutionalProject.treeview("editNode", [node1.nodeId, { text: node1.text.indexOf(deleteStr)===-1?node1.text+=deleteStr:node1.text}])) || $institutionalProject.treeview("editNode", [node1.nodeId, { text: node1.text.replace(deleteStr,'')}]));*/
	        };
	        function bindEvent(){
                $('.treeview').on('click','.delete-node',function(event){
                    console.log('err')
                    event.stopPropagation();
                    event.stopImmediatePropagation();
                    var that=this;
@ -337,7 +667,86 @@
                        anim:4,
                        btn: ['确定','取消'] //按钮
                    }, function(index){
                        layer.close(index);
                        console.log();
                        var type = $(that)[0].dataset.type
                        var code = $(that).parent()[0].dataset.code;
                        var data = {};
                        if (type == 1){
                            data.hospital = code;
						}else if(type == 2 ){
                            data.id = code;
                            data.hospital = '';
                            data.serviceItem = ''
						}
                        $.ajax({
                            url: ctx + "/admin/specialist/hospitalServiceItem/deleteHospitalItem",
                            method: "POST",
                            dataType: "json",
                            async: true,
                            data:data,
                            success:function (res) {
                                console.log(res)
								if (res.status == 200){
                                    defaultData = [
                                        {
                                            text: '厦门市',
                                            href: '#parent1',
                                            nodes: [
                                                {
                                                    text: '思明区',
                                                    nodes: [
                                                    ]
                                                },
                                                {
                                                    text: '海沧区',
                                                    href: '#child2',
                                                    nodes: [
                                                    ]
                                                }, {
                                                    text: '湖里区',
                                                    nodes: [
                                                    ]
                                                },
                                                {
                                                    text: '集美区',
                                                    nodes: [
                                                    ]
                                                },
                                                {
                                                    text: '翔安区',
                                                    nodes: [
                                                    ]
                                                },
                                            ]
                                        }
                                    ];
                                    serverData=[{
                                        text: '检查费',
                                        tags: [0],
                                        color: '#323232',
                                        nodes: []
                                    }];
                                    $institutionalProject = null;
                                    $institutionalProject = institutionalProject();
                                    selectHospital();
                                    layer.closeAll();
                                    $('.item-title').text('');
                                    $('.item-type').text('');
                                    $('.item-content').text('');
                                    $('.item-chuwai').text('');
                                    $('.item-shuoming').text('');
                                    $('.item-xiangmu').text('');
                                    $('.item-grade').text('');
//                                    $('.item-dengji').text('');
                                    $('.item-biaozhun').text('');
                                    $('.item-jiage').text('');
                                    $('.item-danwei').text('');
                                    $('.item-jiashou').text('');
								}
                            }
                        })
                        /*layer.close(index);
                        var nodeId=$($(that).parent()).data('nodeid');
                        console.log($(that).parents('.treeview'));
                        var pid=$(that).parents('.treeview')[0].id;
@ -345,24 +754,204 @@
                            $institutionalProject.treeview("deleteNode", [nodeId, { silent: true } ])
                        }else{
                            $selectableTree.treeview("deleteNode", [nodeId, { silent: true } ])
                        }
                        }*/
                    }, function(){
                    });
                })
			}
            // 点击立即生效
            $('.checkbox-box').on('click',function(event){
                event.stopPropagation(); 
                if(!($("#institutional_project").find('.node-selected')[0])){
                    return
                }
                var id = $("#institutional_project").find('.node-selected')[0].dataset.code
				if (!id){
				    return
				}
                var t = null;
				xiangmuContent.forEach(function (item) {
					if (id == item.hospitalServiceItem.id){
                        t = item
					}
                });
                layer.confirm('是否更改"立即生效"状态', {
                    title: '提示',
                    skin: 'layui-layer-blue', //样式类名
                    anim:4,
                    btn: ['是','否'] //按钮
                },function () {
                    var index = layer.load(2);
                    var _imediate = '';
                    debugger
                    if(t.hospitalServiceItem.imediate == 1){
                        t.hospitalServiceItem.imediate = 0;
                        _imediate = 0
                    }else{
                        t.hospitalServiceItem.imediate = 1;
                        _imediate = 1
                    }
                    var item = {},data=[];
                    item.hospital = t.hospitalServiceItem.hospital;
                    item.hospitalName = t.hospitalServiceItem.hospitalName;
                    item.serviceItemId = t.hospitalServiceItem.serviceItemId;
                    item.serviceItemName = t.hospitalServiceItem.serviceItemName;
                    item.expense = t.hospitalServiceItem.expense;
                    item.status = t.hospitalServiceItem.status;
                    item.imediate = t.hospitalServiceItem.imediate;
                    item.id = t.hospitalServiceItem.id;
                    data.push(item)
                    data = JSON.stringify(data);
                    parms = {
                        hospitalServiceItem:data
                    }
                    $.ajax({
                        url: ctx + "/admin/specialist/hospitalServiceItem/createHospitalServiceItem",
                        method: "POST",
                        dataType: "json",
                        async: true,
                        data:parms,
                        success:function (res) {
                            console.log(res);
                            if (res.status == 200){
                                layer.close(index);
                                if(_imediate == 0){
                                    $($('.immediately')[0]).prop('checked',false);
                                }else{
                                    $($('.immediately')[0]).prop('checked','checked');
                                }
                                layer.msg('操作成功',{icon:1});
                                setTimeout(function(){
                                    layer.closeAll()
                                },1500)
                            }
                        },
                        error:function (err) {
                            console.log(err)
                        }
                    })
                });
            })
//			点击新增机构项目
			$('.add').on('click',function(){
			    layer.open({
                    offset: '40px',
                    type: 2,
                    title: 'layer mobile页',
                    title: false,
                    closeBtn:0,
                    shadeClose: true,
                    shade: 0.8,
                    area: ['1020px', '90%'],
                    content: '/admin/specialist/hospitalServiceItem/initial1' //iframe的url
                    area: ['1020px', '700px'],
                    content: ctx + '/admin/specialist/hospitalServiceItem/initial1' //iframe的url
				})
			})
//			获取检查费(项目机构)
			function selectByCondition(code) {
	            if(code) {
                    $.ajax({
                        url: ctx + "/admin/specialist/hospitalServiceItem/selectByCondition",
                        method: "POST",
                        dataType: "json",
                        async: true,
                        data: {hospital: code},
                        success: function (res) {
                            $institutionalProject = null;
                            serverData[0].nodes = [];
                            xiangmuContent = res.data.detailModelList[0];
                            res.data.detailModelList[0].forEach(function (item) {
                                var t = {};
                                t.text = item.hospitalServiceItem.specialistServiceItemDO.diseaseItem;
                                t.code = item.hospitalServiceItem.id
                                serverData[0].nodes.push(t)
                            });
                            $institutionalProject = institutionalProject();
                        }
                    })
                }
            }
            // 选择上传文件
            function auploadFile(e){
                console.log(e);
                var file = ''
                var arr =e.target && e.target.files;
                file= arr[0].name
                console.log(file)
                $('.fileName').val(file)
            }
            // 上传文件
            function submitFile(_this){
                var file = $(_this).parents('.lay').find('.uploadfile')[0].files[0];
                var _formData = new FormData()
                _formData.append('file', file)
                var index = layer.load(2);
                console.log(_formData)
                $.ajax({
                    url: ctx + "/admin/specialist/hospitalServiceItem/importData",
                    method: "POST",
                    dataType: "json",
                    async: true,
                    contentType: false,
                    cache: false,
                    processData: false,
                    data: _formData,
                    success:function (res) {
                        console.log(res)
                        layer.close(index);
                        if (res.status == 200){
                            layer.confirm('上传成功!', {
                                title: '提示',
                                skin: 'layui-layer-blue', //样式类名
                                anim:4,
                                btn: ['确定'] //按钮
                            },function () {
                                layer.closeAll();
                                init();
                            });
//                        layer.alert('操作成功!', {
//                            icon: 1,
//                        },function () {
//                            layer.closeAll();
//                            init();
//                        })
                        }
                    },
                    error:function (res) {
                        layer.close(index);
                        layer.confirm('上传失败!', {
                            title: '提示',
                            skin: 'layui-layer-blue', //样式类名
                            anim:4,
                            btn: ['确定'] //按钮
                        },function () {
                            layer.closeAll();
                            init();
                        });
//                    layer.alert('上传失败!', {
//                        icon: 1,
//                    },function () {
//                        layer.closeAll();
//                        init();
//                    })
                    }
                })
            }
            $('#btn_import').on('click',function(){
                layer.open({
                    offset: '240px',
                    type:1,
                    title:'',
                    closeBtn:false,
                    content: $('.lay-box-3-1').html(),
                    area: ['420px', '260px']
                })
            })
            //        关闭弹窗
            $(document).on('click','.closePage',function () {
                layer.closeAll()
            })
		</script>
	</body>
</html>

+ 10 - 10
patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/healthbank/activity_list.jsp

@ -15,33 +15,33 @@
<body>
<div id="div_wrapper">
    <!-- 检索条件 -->
    <div class="m-activity-area f-h50 f-dn f-pr m-form-inline" data-role-form style='display: block;'>
        <div class="m-form-group f-mt10">
            <div class="m-form-control f-ml15">
    <div class="m-activity-area f-dn f-pr m-form-inline" data-role-form style='display: block;'>
        <div class="m-form-group">
            <div class="m-form-control f-ml15 f-mt10">
                <input type="text" id="inp_title" placeholder="请输入活动标题" class="f-ml10" data-attr-scan="title"/>
            </div>
            <div class="m-form-control f-ml15">
            <div class="m-form-control f-ml15 f-mt10">
                <input type="text" id="inp_location" placeholder="请输入活动地点" class="f-ml10" data-attr-scan="location"/>
            </div>
            <div class="m-form-control f-ml15">
            <div class="m-form-control f-ml15 f-mt10">
                <input type="text" id="inp_type" placeholder="请输入活动类型" class="f-ml10" data-attr-scan="type"/>
            </div>
            <div class="m-form-control f-ml15">
            <div class="m-form-control f-ml15 f-mt10">
                <input type="text" id="inp_status" placeholder="请输入状态" class="f-ml10" data-attr-scan="status"/>
            </div>
            <div class="m-form-control f-ml15">
            <div class="m-form-control f-ml15 f-mt10">
                <input type="text" id="inp_start_time" placeholder="请输入活动开始时间" class="f-ml10" data-attr-scan="startTime"/>
            </div>
            <div class="m-form-control f-ml15">
            <div class="m-form-control f-ml15 f-mt10">
                <input type="text" id="inp_end_time" placeholder="请输入活动结束时间" class="f-ml10" data-attr-scan="endTime"/>
            </div>
            <sec:authorize url="/admin/activity/list">
                <div id="btn_search" class="l-button u-btn u-btn-primary u-btn-small f-ib f-vam  f-ml10" >
                <div id="btn_search" class="m-form-control l-button u-btn u-btn-primary u-btn-small f-ib f-vam  f-ml10 f-mt10" >
                    <span>查询</span>
                </div>
            </sec:authorize>
            <sec:authorize url="/admin/activity/create">
                <div id="btn_add" class="l-button u-btn u-btn-primary u-btn-small f-ib f-vam  f-ml10" >
                <div id="btn_add" class="m-form-control l-button u-btn u-btn-primary u-btn-small f-ib f-vam  f-ml10 f-mt10" >
                    <span>新增</span>
                </div>
            </sec:authorize>

+ 1 - 1
patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/healthbank/activity_list_js.jsp

@ -173,7 +173,7 @@
                    $.subscribe('activity:info:edit', function (event, id) {
                        var title = '编辑信息';
                        self.activityInfoDialog = $.ligerDialog.open({
                            height: 700,
                            height: 900,
                            width: 560,
                            urlParms: {"id": id, "type": "edit"},
                            title: title,

+ 1 - 1
patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/healthbank/activity_modify.jsp

@ -33,7 +33,7 @@
    <div class="m-form-group">
        <label class="label_title" style="width:120px">活动说明</label>
        <div class="l-text-wrapper m-form-control essential">
            <input type="text"  id="inp_description" class="required useTitle ajax f-w240 validate-special-char"  required-title="活动说明不能为空"  data-attr-scan="description"/>
            <textarea type="text"  id="inp_description" class="required useTitle ajax f-w240 validate-special-char"  required-title="活动说明不能为空"  data-attr-scan="description"></textarea>
        </div>
    </div>
    <div class="m-form-group">

+ 1 - 1
patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/healthbank/activity_modify_js.jsp

@ -27,7 +27,7 @@
                    $("#inp_organizer").ligerTextBox({width: 240}) //主办方&发布机构
                    $("#inp_title").ligerTextBox({width: 240})//活动标题
                    $("#inp_description").ligerTextBox({width: 240})//活动说明
                    $("#inp_description").ligerTextBox({width: 260, height: 240})//活动说明
                    $("#inp_location").ligerTextBox({width: 240})//活动地点
                    $("#inp_type").ligerTextBox({width: 240})//活动类型
                    $("#inp_startTime").ligerDateEditor({

+ 624 - 170
patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/specialty/index.jsp

@ -8,15 +8,83 @@
    <link href="${ctx}/static/specialty/css/bootstrap-treeview.min.css" rel="stylesheet" />
    <link rel="stylesheet" href="${ctx}/static/specialty/layui/css/layui.css">
    <link rel="stylesheet" href="${ctx}/static/specialty/css/index.css">
    <style>
        .layui-layer-blue .layui-layer-title{background-color: #2d9bd2;color: #fff;}
        .layui-layer-blue .layui-layer-close1{background-color: #fff;border-radius: 100%;background-image: none;position: relative;width: 20px;height: 20px;margin-top: -4px;}
        .layui-layer-blue .layui-layer-close1:after{content: '×';position: absolute;font-size: 20px;top: 0;color: #2d9bd2;width: 20px;left: 4px;}
        .layui-layer-blue .layui-layer-content{padding: 30px 50px 50px!important;}
        .lay-box-3 .lay{
            width: 420px!important;
            height: 260px;
        }
        .lay-box-3 .lay .title{
            width: 100%;
        }
        .lay-box-3 .lay .file{
            width: 370px;height: 30px;margin: 20px auto;position: relative;
        }
        .lay-box-3 .lay .file span{
            font-size: 12px;color: #333;
        }
        .lay-box-3 .lay .file input:nth-of-type(1){
            width: 200px;height: 30px;border: solid 1px #d0d0d0;background-color: #fff!important;
        }
        .lay-box-3 .lay .file input:nth-of-type(2){
            width: 90px;
            height: 30px;
            background-color: #2d9bd2;
            border-radius: 2px;
            font-size: 12px;
            color: #fff;
            opacity: 0;
            z-index: 99;
        }
        .lay-box-3 .lay .file button{
            width: 90px;
            height: 30px;
            background-color: #2d9bd2;
            border: none;
            border-radius: 2px;
            font-size: 12px;
            color: #fff;
            position: absolute;
            right: 0;
            z-index: 1;
        }
        .lay-box-3 .lay a{
            display: block;
            margin-left: 87px;
            font-size: 12px;color: #2d9bd2;
        }
        .lay-box-3 .lay p {
            font-size: 12px;color: #eb4b3c;text-align: center;
        }
        .lay-box-3 .lay .lay-button{
            text-align: center;margin-top: 40px;
        }
        .lay-box-3 .lay .lay-button button{
            width: 99px;
            height: 35px;
            background-color: #2d9bd2;
            border-radius: 2px;
            border: none;
            color:#fff;
            font-size: 14px;
        }
        .lay-box-3 .lay .lay-button button:nth-of-type(2){
            background-color: #b9c8d2;
        }
    </style>
    <script src="${ctx}/static/specialty/layui/layui.js"></script>
</head>
<body>
    <div class="lay-box" style="display:none">
        <div class="lay">
            <div class="title flex flex-sp-b flex-cz-c">
                <span>新增项目</span>
                <img src="images/Close_btn.png" alt="">
                <img class="closePage" src="${ctx}/static/specialty/images/Close_btn.png" alt="">
            </div>
            <form action="">
                <div class="info">
@ -24,11 +92,11 @@
                    <p class="info-title">项目信息</p>
                    <div class="info-left">
                        <div class="input">
                            <label for="">项目名称:</label>
                            <label class="required" for="">项目名称:</label>
                            <input class="title_" type="text">
                        </div>
                        <div class="input flex flex-sp-end">
                            <label for="">项目内涵:</label>
                            <label for="" class="required">项目内涵:</label>
                            <textarea class="content" style="margin-left: 4px" name="" id="" cols="30" rows="10"></textarea>
                        </div>
                        <div class="input flex flex-sp-end">
@ -39,35 +107,39 @@
                            <label for="">说明:</label>
                            <textarea class="description" style="margin-left: 4px" name="" id="" cols="30" rows="10"></textarea>
                        </div>
                        <div class="input">
                            <label for="">病案项目:</label>
                            <input class="disease_item" type="text">
                        <div class="input layui-form flex flex-cz-c" style="padding-left: 30px;">
                            <label class="required" for="" style="margin-right: 10px;right: -6px;">病案项目:</label>
                            <%--<input class="hospital_grade" type="text">--%>
                            <select name="disease_item" lay-verify="">
                            </select>
                        </div>
                        <div class="radio layui-form">
                            <div class="layui-form-item">
                                <label class="layui-form-label">需要预约:</label>
                                <label class="layui-form-label required-1">需要预约:</label>
                                <div class="layui-input-block">
                                    <input type="radio" name="reserve" value="0" title="是">
                                    <input type="radio" name="reserve" value="1" title="否">
                                    <input type="radio" name="reserve" value="0" title="否">
                                    <input type="radio" name="reserve" value="1" title="是">
                                </div>
                            </div>
                        </div>
                        <div class="radio layui-form">
                            <div class="layui-form-item">
                                <label class="layui-form-label">完成方式:</label>
                            <div class="layui-form-item" style="position: relative;width: max-content;">
                                <label class="layui-form-label required-1">完成方式:</label>
                                <div class="layui-input-block flex">
                                    <input type="radio" name="type" value="0" title="扫码">
                                    <input type="radio" name="type" value="1" title="按钮">
                                    <input type="radio" name="type" value="2" title="关联记录">
                                    <input type="radio" name="type" value="0" title="记录服务">
                                    <input type="radio" name="type" value="1" title="扫码">
                                    <input type="radio" name="type" value="2" title="健康教育">
                                    <input type="radio" name="type" value="3" title="健康指导">
                                    <input type="radio" name="type" value="4" title="随访">
                                </div>
                            </div>
                        </div>
                        <div class="radio layui-form">
                            <div class="layui-form-item">
                                <label class="layui-form-label">项目评价:</label>
                                <label class="layui-form-label required-1">项目评价:</label>
                                <div class="layui-input-block">
                                    <input type="radio" name="evaluation" value="0" title="是">
                                    <input type="radio" name="evaluation" value="1" title="否">
                                    <input type="radio" name="evaluation" value="0" title="否">
                                    <input type="radio" name="evaluation" value="1" title="是">
                                </div>
                            </div>
                        </div>
@ -75,45 +147,51 @@
                    <div class="info-right">
                        <div class="layui-form">
                            <div class="layui-form-item">
                                <div class="layui-input-block ml40">
                                    <input type="radio" name="item_type" value="0" title="康复服务">
                                    <input type="radio" name="item_type" value="1" title="健康管理">
                                <div class="layui-input-block ml40 required-2">
                                    <input type="radio" name="item_type" value="0" title="诊疗服务">
                                    <input type="radio" name="item_type" value="1" title="健康服务">
                                </div>
                            </div>
                        </div>
                        <div class="input">
                            <label for="">医院等级:</label>
                            <input class="hospital_grade" type="text">
                        <div class="input layui-form flex flex-cz-c" style="padding-left: 30px;">
                            <label class="required" for="" style="margin-right: 12px">医院等级:</label>
                            <%--<input class="hospital_grade" type="text">--%>
                            <select name="hospital_grade" lay-verify="">
                                <option value="0">所有</option>
                                <option value="3">三级医院</option>
                                <option value="2">二级医院</option>
                                <option value="1">一级及以下</option>
                            </select>
                        </div>
                        <div class="info-right-title flex flex-cz-c flex-sp-b">
                            <span>收费标准</span>
                            <span>元</span>
                        </div>
                        <div class="input">
                            <label for="">三级医院:</label>
                            <input class="three_hospitals" type="text">
                            <label class="required" for="">三级医院:</label>
                            <input class="three_hospitals" type="text" value="0.00">
                        </div>
                        <div class="input">
                            <label for="">二级医院:</label>
                            <input class="two_hospitals" type="text">
                            <label class="required" for="">二级医院:</label>
                            <input class="two_hospitals" type="text" value="0.00">
                        </div>
                        <div class="input flex flex-sp-end flex-cz-c">
                            <label for="">一级及一级以下<br>医疗机构:</label>
                            <input class="one_hospitals" style="margin-left: 4px;" type="text">
                            <label class="required" for="">一级及以下:</label>
                            <input class="one_hospitals" style="margin-left: 4px;" type="text" value="0.00">
                        </div>
                        <div class="input">
                            <label for="">计价单位:</label>
                            <label class="required" for="">计价单位:</label>
                            <input class="unit" type="text">
                        </div>
                        <div class="input flex flex-sp-end">
                            <label for="">加收项目:</label>
                            <label for="" style="margin-right: 4px">加收项目:</label>
                            <textarea class="add_item" name="" id="" cols="30" rows="10"></textarea>
                        </div>
                    </div>
                    <div class="info-bottom layui-form">
                        <input type="checkbox" name="imediate" title="立即生效" lay-skin="primary">
                        <input type="checkbox" name="imediate" checked title="立即生效" lay-skin="primary">
                        <div style="margin-top: 20px;">
                            <button style="background-color: #2d9bd2;" class="layui-btn layui-btn-primary addSubmit" onclick="addSubmit(event,this)">确认</button>
                            <input type="submit" style="background-color: #2d9bd2;" class="layui-btn layui-btn-primary addSubmit" onclick="addSubmit(event,this)" value="确认">
                            <button style="background-color: #d9c8b2;" class="layui-btn layui-btn-primary" onclick="cancel(event)">取消</button>
                        </div>
                    </div>
@ -122,32 +200,79 @@
            
        </div>
    </div>
    <div class="lay-box-2" style="display: none;">
        <div class="lay">
            <div class="title flex flex-sp-b flex-cz-c">
                <span>修改、失效历史</span>
                <img class="closePage" src="${ctx}/static/specialty/images/Close_btn.png" alt="">
            </div>
            <div class="content-box">
                <div class="content-text">
                    <div class="flex flex-sp-b">
                        <span class="number"></span>
                        <span class="time"></span>
                    </div>
                    <ul>
                        <li></li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
    <div class="lay-box-3-1" style="display:none">
        <div class="lay-box-3">
            <div class="lay">
                <div class="title flex flex-sp-b flex-cz-c">
                    <span>批量导入</span>
                    <img class="closePage" src="${ctx}/static/specialty/images/Close_btn.png" alt="">
                </div>
                <div class="file flex flex-sp-b flex-cz-c">
                    <span>导入文件:</span>
                    <input type="text" class="fileName" disabled>
                    <input class="uploadfile" type="file" value="选择" onchange="auploadFile(event)">
                    <button>选择</button>
                </div>
                <a href="${ctx}/static/specialty/Sheet1.xls" target="_blank">模板下载</a>
                <p>请核对导入数据,若导入项目信息已存在,将会更新项目表中的数据。</p>
                <div class="lay-button">
                    <button onclick="submitFile(this)">确认</button>
                    <button class="closePage">取消</button>
                </div>
            </div>
        </div>
    </div>
    
    <div class="content">
        <!-- 请选择项目类型 -->
        <div class="btn-group">
            <button type="button" class="btn btn-default btn-hover-none btn-radius-none w130 h30 text-align-left">请选择项目类型</button>
            <button type="button" class="btn btn-default btn-hover-none btn-radius-none w130 h30 text-align-left xiangmu">请选择项目类型</button>
            <button type="button" class="btn dropdown-toggle btn-radius-none  w30 h30" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                <span class="caret"></span>
                <span class="sr-only">Toggle Dropdown</span>
            </button>
            <ul class="dropdown-menu">
                <li>
                    <a href="#">康健服务</a>
                    <a href="#">所有</a>
                </li>
                <li>
                    <a href="#">诊疗服务</a>
                </li>
                <li>
                    <a href="#">健康管理</a>
                    <a href="#">健康服务</a>
                </li>
            </ul>
        </div>
        <!-- 请选择医院等级 -->
        <div class="btn-group">
            <button type="button" class="btn btn-default btn-hover-none btn-radius-none w130 h30 text-align-left">请选择医院等级</button>
            <button type="button" class="btn btn-default btn-hover-none btn-radius-none w130 h30 text-align-left yiyuan">请选择医院等级</button>
            <button type="button" class="btn dropdown-toggle btn-radius-none  w30 h30" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                <span class="caret"></span>
                <span class="sr-only">Toggle Dropdown</span>
            </button>
            <ul class="dropdown-menu">
                <li>
                    <a href="#">所有</a>
                </li>
                <li>
                    <a href="#">三级医院</a>
                </li>
@ -161,49 +286,33 @@
        </div>
        <!-- 请选择病案项目 -->
        <div class="btn-group">
            <button type="button" class="btn btn-default btn-hover-none btn-radius-none w130 h30 text-align-left">请选择病案项目</button>
            <button type="button" class="btn btn-default btn-hover-none btn-radius-none w130 h30 text-align-left bingan-xiangmu">请选择病案项目</button>
            <button type="button" class="btn dropdown-toggle btn-radius-none  w30 h30" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                <span class="caret"></span>
                <span class="sr-only">Toggle Dropdown</span>
            </button>
            <ul class="dropdown-menu">
                <li>
                    <a href="#">Action</a>
                </li>
                <li>
                    <a href="#">Another action</a>
                </li>
                <li>
                    <a href="#">Something else here</a>
                </li>
            <ul class="dropdown-menu bingan">
            </ul>
        </div>
        <!-- 搜索 -->
        <div class="search form-inline">
            <div class="input-group h30 font-12" style="width: 379px;">
            <div class="input-group h30 font-12" style="width: 270px;">
                <div class="input-group">
                    <div class="input-group-btn">
                        <button type="button" style="height: 34px;width: 90px" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">计算机编码 <span class="caret"></span></button>
                        <ul class="dropdown-menu">
                            <li><a href="#">计算机编码</a></li>
                            <li><a href="#">项目编码</a></li>
                            <li><a href="#">项目名称</a></li>
                        </ul>
                    </div><!-- /btn-group -->
                    <input type="text" class="form-control" aria-label="..." style="width:270px;border-radius: 0;" placeholder="输入计算机编码、项目编码、项目名称">
                    <input type="text" class="form-control xiangmu-name" aria-label="..." style="width:270px;border-radius: 0;" placeholder="输入项目名称">
                </div>
                <%--搜索图标--%>
                <%--<span class="input-group-addon">--%>
                    <%--<i class="icon icon30 icon-search"></i>--%>
                <%--</span>--%>
            </div>
            <button class="btn btn-primary h30 font-12">查询</button>
            <button class="btn btn-primary h30 font-12 search-btn">查询</button>
        </div>
        <div class="pull-right text-right">
            <div class="operation-group clearfix" role="group" aria-label="...">
                <button id="delete" type="button" class="btn btn-danger delete">
                    <i class="icon icon15 icon-delete"></i>&emsp;删除</button>
                <button type="button" class="btn btn-warning">批量导入</button>
                <button type="button" class="btn btn-warning" id="daoru">批量导入</button>
                <button id="add" type="button" class="btn btn-primary">新增项目</button>
            </div>
        </div>
@ -214,6 +323,16 @@
    <%--<%@ include  file="./js/ligerui.all_js.jsp"%>--%>
    <script type="text/javascript">
        var form,grid;
        var diseaseItem = ['不统计','治疗费','检查费','其它费用','床位费','护理费','婴儿费','输氧费','放射费','化验费','手术费','麻醉费','接生费','非手术治疗项目费','治疗费','康复费'];
        var diseaseItemHtml = '';
        var binganHtml = '';
        var modityRow = null;
        diseaseItem.forEach(function (item) {
            diseaseItemHtml += '<option value='+item+'>'+item+'</option>';
            binganHtml += '<li><a href="#">'+item+'</a></li>'
        })
        $('select[name="disease_item"]').html(diseaseItemHtml);
        $('.bingan').html(binganHtml)
        layui.use(['layer','laydate','form'],function(){
            var layer = layui.layer;  //layer初始化
            form = layui.form;
@ -238,7 +357,6 @@
                    async: true,
                    data: {serviceItem: data},
                    success:function (res) {
                        console.log(res)
                        if (res.status == 200){
                            layer.alert('操作成功!', {
                                icon: 1,
@ -279,10 +397,13 @@
//        修改行
        function modify(rowindex) {
            var row = grid.getRow(rowindex);
            modityRow = row;
            console.log(row)
            layer.open({
                offset: '20px',
                type:1,
                title:'',
                closeBtn:false,
                content: $('.lay-box').html(),
                area: ['680px', '750px']
            });
@ -292,13 +413,24 @@
            $('.lay .content').val(row.content);
            $('.lay .exclude_content').val(row.excludeContent);
            $('.lay .description').val(row.description);
            $('.lay .disease_item').val(row.diseaseItem);
            $($('.lay input[name="reserve')[row.reserve+2]).prop("checked",true);
            $($('.lay input[name="type')[row.type+3]).prop("checked",true);
            console.log($('.lay select[name="disease_item"]'));
            $('.lay select[name="disease_item"]').val(row.diseaseItem);
            $($('.lay input[name="reserve"]')[row.reserve+2]).prop("checked",true);
            $($('.lay input[name="type"]')[row.type+5]).prop("checked",true);
            $($('.lay input[name="evaluation')[row.evaluation+2]).prop("checked",true);
            row.itemType == '康健服务' ? row.itemType = 0: row.itemType = 1;
            row.itemType == '诊疗服务' ? row.itemType = 0: row.itemType = 1;
            $($('.lay input[name="item_type')[row.itemType+2]).prop("checked",true);
            $('.lay .hospital_grade').val(row.hospitalGrade);
            if (row.hospitalGrade == '三级医院'){
                row.hospitalGrade = 3
            }else if(row.hospitalGrade == '二级医院'){
                row.hospitalGrade = 2
            }else if(row.hospitalGrade == '一级及一级以下医疗机构'){
                row.hospitalGrade = 1
            }
            else if(row.hospitalGrade == '所有'){
                row.hospitalGrade = 0
            }
            $('select[name="hospital_grade"]').find('option[value='+row.hospitalGrade+']').attr('selected','selected')
            $('.lay .three_hospitals').val(row.threeHospitals);
            $('.lay .two_hospitals').val(row.twoHospitals);
            $('.lay .one_hospitals').val(row.oneHospitals);
@ -308,17 +440,171 @@
            $($('.lay input[name="imediate')[1]).prop("checked",row.imediate);
            form.render();
        }
//      历史
        function history(rowindex) {
            var row = grid.getRow(rowindex);
            console.log(row.id);
            var data = {
                serviceItemId:row.id,
            }
            data = JSON.stringify(data);
            $.ajax({
                url: ctx + "/admin/specialist/serviceItem/selectOperate",
                method: "POST",
                dataType: "json",
                async: true,
                data: {serviceItem: data,page:1,size:1000},
                success:function (res) {
                    var Arr = res.data.detailModelList;
                    var html = '';
                    if (Arr.length < 1){
                        layer.msg('该条记录没有历史',{icon:5})
                        return false
                    }
                    Arr.forEach(function (item,index,arr) {
                        var operateLog = [
                            {
                                name:'项目名称',
                                key:'title旧',
                                text:''
                            },{
                                name:'项目内涵',
                                key:'content旧',
                                text:''
                            },{
                                name:'除外内容',
                                key:'excludeContent旧',
                                text:''
                            },{
                                name:'说明',
                                key:'description旧',
                                text:''
                            },{
                                name:'病案项目',
                                key:'diseaseItem旧',
                                text:''
                            },{
                                name:'是否预约',
                                key:'reserve旧',
                                text:''
                            },{
                                name:'完成方式',
                                key:'type旧',
                                text:''
                            },{
                                name:'项目评价',
                                key:'evaluation旧',
                                text:''
                            },{
                                name:'项目类型',
                                key:'itemType旧',
                                text:''
                            },{
                                name:'医院等级',
                                key:'hospitalGrade旧',
                                text:''
                            },{
                                name:'三级医院收费标准',
                                key:'threeHospitals旧',
                                text:''
                            },{
                                name:'二级医院收费标准',
                                key:'twoHospitals旧',
                                text:''
                            },{
                                name:'一级以及以下',
                                key:'oneHospitals旧',
                                text:''
                            },{
                                name:'计价单位',
                                key:'unit旧',
                                text:''
                            },{
                                name:'加收项目',
                                key:'addItem旧',
                                text:''
                            },{
                                name:'立即生效',
                                key:'imediate旧',
                                text:''
                            }
                        ]
                        var title = '第'+(arr.length-index)+'次';
                        var time = new Date(item.createTime).Format('yyyy/MM/dd');
                        var log = JSON.parse(item.operateLog);
/*                        console.log(arr.length,index,title);
                        console.log(time);
                        console.log(log)*/
                        var ul = '';
                        log.forEach(function (t,k) {
                            if(t['itemType旧']){
                                t['itemType旧'] == '0'? t['itemType旧'] = "诊疗服务":t['itemType旧'] = "健康服务";
                            }
                            if(t['type旧']){
                                if (t['type旧'] == 1){
                                    t['type旧'] = '扫码'
                                }else if (t['type旧'] == 0){
                                    t['type旧'] = '记录服务'
                                }else if (t['type旧'] == 2){
                                    t['type旧'] = '健康教育'
                                }else if (t['type旧'] == 3){
                                    t['type旧'] = '健康指导'
                                }else if (t['type旧'] == 4){
                                    t['type旧'] = '随访'
                                }
                            }
                            if (t['hospitalGrade旧']){
                                if (t['hospitalGrade旧'] == 3){
                                    t['hospitalGrade旧'] = '三级医院'
                                }else if(t['hospitalGrade旧']==2){
                                    t['hospitalGrade旧'] = '二级医院'
                                }else if(t['hospitalGrade旧'] == 1){
                                    t['hospitalGrade旧'] = '一级及一级以下医疗机构'
                                }
                            }
                            if (t['imediate旧']){
                                t['imediate旧'] == '0'? t['imediate旧'] = "否":t['imediate旧'] = "是";
                            }
                            for(var key in t){
                                operateLog.forEach(function (w,i) {
                                    if(key==w.key){
                                        var li = '<li>'+w.name + ':' + t[key] + '</li>'
                                        ul += li
                                    }
                                })
                            }
                        })
                        html += '<div class="content-text">\
                            <div class="flex flex-sp-b">\
                            <span class="number">'+title+'</span>\
                            <span class="time">'+time+'</span>\
                            </div>\
                            <ul>'+ul+'</ul>\
                        </div>'
//                        console.log(html);
                    })
                    $('.content-box').html(html)
                    layer.open({
                        type:1,
                        title:'',
                        closeBtn:false,
                        content: $('.lay-box-2').html(),
                        area: ['680px', '750px']
                    });
                }
            })
        }
        $('#add').on('click',function(){
            layer.open({
                offset: '20px',
                type:1,
                title:'',
                closeBtn:false,
                content: $('.lay-box').html(),
                area: ['680px', '750px']
            })
            $('.lay .title span').text('新增项目');
            form.render();
        });
        $('#delete').on('click',function(){
            var rows = grid.getSelectedRows();
@ -375,12 +661,12 @@
            data.content = $.trim($(_this).parents('.lay').find('.content').val());
            data.excludeContent = $.trim($(_this).parents('.lay').find('.exclude_content').val());
            data.description = $.trim($(_this).parents('.lay').find('.description').val());
            data.diseaseItem = $.trim($(_this).parents('.lay').find('.disease_item').val());
            data.diseaseItem = $.trim($(_this).parents('.lay').find('select[name="disease_item"]').val());
            data.reserve = $.trim($(_this).parents('.lay').find('input[name="reserve"]:checked').val());
            data.type = $.trim($(_this).parents('.lay').find('input[name="type"]:checked').val());
            data.evaluation = $.trim($(_this).parents('.lay').find('input[name="evaluation"]:checked').val());
            data.itemType = $.trim($(_this).parents('.lay').find('input[name="item_type"]:checked').val());
            data.hospitalGrade = $.trim($(_this).parents('.lay').find('.hospital_grade').val());
            data.hospitalGrade = $.trim($(_this).parents('.lay').find('select[name="hospital_grade"]').val());
            data.threeHospitals = $.trim($(_this).parents('.lay').find('.three_hospitals').val());
            data.twoHospitals = $.trim($(_this).parents('.lay').find('.two_hospitals').val());
            data.oneHospitals = $.trim($(_this).parents('.lay').find('.one_hospitals').val());
@ -388,13 +674,16 @@
            data.addItem = $.trim($(_this).parents('.lay').find('.add_item').val());
            data.imediate = $.trim($(_this).parents('.lay').find('input[name="imediate"]').prop("checked"));
            data.imediate == "true" ?data.imediate = 1:data.imediate = 0;
            if(!(data.title && data.content && data.diseaseItem && data.reserve && data.type && data.evaluation && data.itemType && data.hospitalGrade && data.threeHospitals && data.twoHospitals && data.oneHospitals && data.unit)){
                layer.msg('请将信息补充完整',{icon:5});
                return falses
            }
            if ($(_this).parents('.lay').find('.title span').text() == "新增项目"){
                data = JSON.stringify(data);
                console.log(data);
                $.ajax({
                    url: ctx + "/admin/specialist/serviceItem/createServiceItem",
                    method: "get",
                    method: "POST",
                    dataType: "json",
                    async: true,
                    data: {serviceItem: data},
@ -411,15 +700,21 @@
                    }
                })
            }else{
                data.id = $.trim($(_this).parents('.lay').find('.id').val());
                data = JSON.stringify(data);
                console.log(data);
                var r = {};
                for (var key in data){
                    if (data[key] != modityRow[key]){
                        r[key] = data[key]
                    }
                }
                console.log(r)
                r.id = $.trim($(_this).parents('.lay').find('.id').val());
                r = JSON.stringify(r);
                $.ajax({
                    url: ctx + "/admin/specialist/serviceItem/updateServiceItem",
                    method: "post",
                    dataType: "json",
                    async: true,
                    data: {serviceItem: data},
                    data: {serviceItem: r},
                    success:function (res) {
                        console.log(res)
                        if (res.status == 200){
@ -435,112 +730,271 @@
            }
        }
        function init() {
            $.ajax({
            grid = $("#maingrid").ligerGrid({
                url: ctx + "/admin/specialist/serviceItem/selectServiceItem",
                method: "POST",
                dataType: "json",
                async: true,
                data: {serviceItem: '{"status":1}',page:'1',pageSize:'10'},
                success:function (res) {
                    console.log(res)
                    griddata = res.data.detailModelList;
                    griddata.forEach(function (item,index) {
                        item.imediate == '0'? item.imediate = "否":item.imediate = "是";
                        item.itemType == '0'? item.itemType = "康健服务":item.itemType = "健康管理";
                        return item;
                    })
                    grid = $("#maingrid").ligerGrid({
                        columns: [
                            {
                                name: 'title',
                                display: '项目名称',
                                width: 80
                            },
                            {
                                name:"diseaseItem",
                                display:"病案项目",
                                width:80
                            },
                            {
                                name:'itemType',
                                display:"项目类型",
                                width:80
                            },
                            {
                                name:'hospitalGrade',
                                display:"医院等级",
                                width:80
                            },
                            {
                                name:"content",
                                display:"项目内涵",
                                width:290
                            },
                            {
                                name:"excludeContent",
                                display:"除外内容",
                                width:200
                            },
                            {
                                name:'unit',
                                display:"计价单位",
                                width:80
                            },
                            {
                                name:'biaozhun',
                                display:'费用标准',
                                columns:[
                                    {
                                        name:'threeHospitals',
                                        display:'三级医院',
                                        width:75
                                    },
                                    {
                                        name:'twoHospitals',
                                        display:"二级医院",
                                        width:75
                                    },
                                    {
                                        name:'oneHospitals',
                                        display:"一级及一级以</br>下医疗机构",
                                        width:75
                                    }
                                ],
                            },
                            {
                                name:'addItem',
                                display:'加收项目',
                                width:130
                            },
                parms: {serviceItem: '{"status":1}'},
                method: 'get',
                record:'totalCount',
                root:'detailModelList',
                columns: [
                    {
                        name: 'title',
                        display: '项目名称',
                        width: 162
                    },
                    {
                        name:"diseaseItem",
                        display:"病案项目",
                        width:81
                    },
                    {
                        name:'itemType',
                        display:"项目类型",
                        width:81,
                        render:function (row) {
                            row.itemType == '0'? row.itemType = "诊疗服务":row.itemType = "健康服务";
                            return row.itemType;
                        }
                    },
                    {
                        name:'hospitalGrade',
                        display:"医院等级",
                        width:81,
                        render:function (row) {
                            if (row.hospitalGrade == '3'){
                                row.hospitalGrade = '三级医院'
                            }else if(row.hospitalGrade== '2'){
                                row.hospitalGrade = '二级医院'
                            }else if(row.hospitalGrade == '1'){
                                row.hospitalGrade = '一级及一级以下医疗机构'
                            }else if(row.hospitalGrade == '0'){
                                row.hospitalGrade = '所有'
                            }
                            return row.hospitalGrade;
                        }
                    },
                    {
                        name:"content",
                        display:"项目内涵",
                        width:243
                    },
                    {
                        name:"excludeContent",
                        display:"除外内容",
                        width:162
                    },
                    {
                        name:'unit',
                        display:"计价单位",
                        width:81
                    },
                    {
                        name:'biaozhun',
                        display:'费用标准',
                        columns:[
                            {
                                name:'description',
                                display:"说明",
                                width:100
                                name:'threeHospitals',
                                display:'三级医院',
                                width:81
                            },
                            {
                                name:"imediate",
                                display:"是否生效",
                                width:60
                                name:'twoHospitals',
                                display:"二级医院",
                                width:81
                            },
                            {
                                name:"caozuo",
                                display:"操作",
                                width:160,
                                render: function (record, rowindex, value, column) {
                                    return '<input type="button" onclick="invalid('+rowindex+')" value="失效"/><input type="button" onclick="modify('+rowindex+')" value="修改"/><input type="button" class="delete" onclick="deleteRow('+rowindex+')" value="删除"/><input type="button" value="查看历史"/>';
                                }
                                name:'oneHospitals',
                                display:"一级及一级以</br>下医疗机构",
                                width:81
                            }
                        ],
                        data: {
                            Rows: griddata
                        },
                        checkbox:"true",
                        alternatingRow:false
                    },
                    {
                        name:'addItem',
                        display:'加收项目',
                        width:121.5
                    },
                    {
                        name:'description',
                        display:"说明",
                        width:121.5
                    },
                    {
                        name:"imediate",
                        display:"是否生效",
                        width:81,
                        render:function (row) {
                            row.imediate == '0'? row.imediate = "否":row.imediate = "是";
                            return row.imediate;
                        }
                    },
                    {
                        name:"caozuo",
                        display:"操作",
                        width:162,
                        render: function (record, rowindex, value, column) {
                            return '<input type="button" onclick="invalid('+rowindex+')" value="失效"/><input type="button" onclick="modify('+rowindex+')" value="修改"/><input type="button" class="delete" onclick="deleteRow('+rowindex+')" value="删除"/><input type="button" onclick="history('+rowindex+')" value="查看历史"/>';
                        }
                    }
                ],
                checkbox:"true",
                alternatingRow:false,
                onAfterShowData:function () {
                    var table = $('.l-grid-body-table')[0];
                    var table2 = $('.l-grid-body-table')[1];
                    var arr =  $(table).find('tr');
                    var arr2 =  $(table2).find('tr');
                    arr2.each(function(index,item){
                        $(arr[index]).height($(this).height())
                        $(arr[index]).width(40)
                        console.log($(arr[index]).width())
                    })
                }
            });
        }
        init();
//        更新ligerui
        function reloadGrid(url, params, curPage){
            if(curPage)
                this.options.newPage = curPage;
            if(url && url!='')
                this.setOptions({parms: params, url: url});
            else{
                this.setOptions({parms: params});
                this.loadData(true);
            }
        }
//        查询动作
        $('.search-btn').on('click',function (e) {
            e.stopPropagation()
            var data = {};
            if ($('.xiangmu').text() == '诊疗服务'){
                data.itemType = 0
            }else if($('.xiangmu').text() == '健康服务'){
                data.itemType = 1
            }else if($('.xiangmu').text() == '所有'){
                data.itemType = ''
            }
            if ($('.yiyuan').text()=='三级医院'){
                data.hospitalGrade = 3
            }else if($('.yiyuan').text()=='二级医院'){
                data.hospitalGrade = 2
            }else if($('.yiyuan').text()=='一级及以下'){
                data.hospitalGrade = 1
            }else if($('.yiyuan').text()=='所有'){
                data.hospitalGrade = ''
            }
            if($('.bingan-xiangmu').text() != '请选择病案项目'){
                data.diseaseItem = $('.bingan-xiangmu').text();
            }
            data.title = $('.xiangmu-name').val();
            data.status = 1;
            console.log(data);
            data = JSON.stringify(data);
            parms = {
                serviceItem:data
            }
            reloadGrid.call(grid,ctx + "/admin/specialist/serviceItem/selectServiceItem", parms);
        })
//        关闭弹窗
        $(document).on('click','.closePage',function () {
            layer.closeAll()
        })
        Date.prototype.Format = function (fmt) { //author: meizz
            var o = {
                "M+": this.getMonth() + 1, //月份
                "d+": this.getDate(), //日
                "h+": this.getHours(), //小时
                "m+": this.getMinutes(), //分
                "s+": this.getSeconds(), //秒
                "q+": Math.floor((this.getMonth() + 3) / 3), //季度
                "S": this.getMilliseconds() //毫秒
            };
            if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
            for (var k in o)
                if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) :
                    (("00" + o[k]).substr(("" + o[k]).length)));
            return fmt;
        }
        // 选择上传文件
        function auploadFile(e){
            console.log(e);
            var file = ''
            var arr =e.target && e.target.files;
            file= arr[0].name
            console.log(file)
            $('.fileName').val(file)
        }
        // 上传文件
        function submitFile(_this){
            var file = $(_this).parents('.lay').find('.uploadfile')[0].files[0];
            var _formData = new FormData()
			_formData.append('file', file)
            console.log(_formData.get('file'));
            var index = layer.load(2);
            $.ajax({
                url: ctx + "/admin/specialist/serviceItem/importData",
                method: "POST",
                dataType: "json",
                async: true,
                contentType: false,
                cache: false,
                processData: false,
                data: _formData,
                success:function (res) {
                    console.log(res)
                    layer.close(index);
                    if (res.status == 200){
                        layer.confirm('上传成功!', {
                            title: '提示',
                            skin: 'layui-layer-blue', //样式类名
                            anim:4,
                            btn: ['确定'] //按钮
                        },function () {
                            layer.closeAll();
                            init();
                        });
//                        layer.alert('操作成功!', {
//                            icon: 1,
//                        },function () {
//                            layer.closeAll();
//                            init();
//                        })
                    }
                },
                error:function (res) {
                    layer.close(index);
                    layer.confirm('上传失败!', {
                        title: '提示',
                        skin: 'layui-layer-blue', //样式类名
                        anim:4,
                        btn: ['确定'] //按钮
                    },function () {
                        layer.closeAll();
                        init();
                    });
//                    layer.alert('上传失败!', {
//                        icon: 1,
//                    },function () {
//                        layer.closeAll();
//                        init();
//                    })
                }
            })
        }
        init();
        // 导入按钮
        $('#daoru').on('click',function(){
            layer.open({
                offset: '240px',
                type:1,
                title:'',
                closeBtn:false,
                content: $('.lay-box-3-1').html(),
                area: ['420px', '260px']
            })
        })
    </script>
</body>

+ 278 - 0
patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/specialty/upload.jsp

@ -0,0 +1,278 @@
<%--
  Created by IntelliJ IDEA.
  User: 72482
  Date: 2018/9/10
  Time: 10:17
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <style>
        #app{
            width: 100%;
        }
        .m-form-group label.w-50 {
            width: 50px;
        }
        .m-form-group label.w-80 {
            width: 80px;
        }
        hr {
            height: 1px;
            border: none;
            border-top: 1px solid #898989;
            margin-top: 15px;
        }
        .m-form-group label {
            font-size: 14px;
            color: #666666;
            padding-left: 0px;
            text-align: left;
            width: auto;
        }
        .l-text-wrapper {
            margin-left: 10px;
        }
        .c-30a9de {
            color: #30a9de;
        }
        .ml130 {
            margin-left: 130px;
        }
        .ml320{
            margin-left: 320px;
        }
        .mt26 {
            margin-top: 26px;
        }
        .ml160 {
            margin-left: 80px;
        }
        .ml60 {
            margin-left: 60px;
        }
        .mr70 {
            margin-right: 70px;
        }
        .tac {
            text-align: center;
        }
        .div-upload-title {
            display: inline-block;
            width: 100px;
            text-align: right;
            margin-right: 30px;
            margin-top: 10px;
        }
        .div-title {
            display: inline-block;
            width: 138px;
            text-align: right;
        }
        /* #btnNew {
            float: right;
        } */
        #dataUpload,#dataUpload1 {
            margin-left: 580px;
        }
        #btnreceivesSave {
            margin-left: 380px;
        }
        #dataSel,.fc1eaaff {
            color: #1eaaff;
            cursor: pointer;
            font-size: 14px;
        }
        .leftBtn {
            width: 200px;
            margin: 30px auto;
        }
        .div-dialog-content {
            height: 90%;
            height: -moz-calc(100% - 100px);
            /*Firefox*/
            height: -webkit-calc(100% - 100px);
            /*chrome safari*/
            height: calc(100% - 100px);
            /*Standard */
            overflow: auto;
        }
        .edit-input {
            padding: 8px;
            border: 1px solid #ccc;
            margin-right: 20px;
            width: 151px;
        }
        .edit-tip{
            display: inline-table;
        }
        #div_upload_detail_grid,
        #div_upload_detail_edit_grid,
        #div_receive_detail_grid,
        #div_receive_detail_edit_grid {
            width: 600px;
            margin: 20px 20px 50px 225px;
        }
        .yj-nav {
            width: 350px;
            text-align: center;
            margin: 10px auto 30px;
        }
        .yj-nav div {
            width: 110px;
            height: 40px;
            line-height: 40px;
            font-size: 14px;
            color: #333;
            border: solid 1px #1eaaff;
            float: left;
            display: inline-block;
            cursor: pointer;
        }
        .yj-nav div.active,
        .yj-nav div:hover {
            color: #fff;
            background-color: #1eaaff;
        }
        .yj-nav-l {
            border-top-left-radius: 20px;
            border-bottom-left-radius: 20px;
            border-right: none !important;
        }
        .yj-nav-r {
            border-top-right-radius: 20px;
            border-bottom-right-radius: 20px;
            border-left: none !important;
        }
        .see-detail-btn,
        .edit-detail-btn {
            color: #1eaaff;
            padding: 0px 10px;
        }
        .del-detail-btn {
            color: darkred;
            padding: 0px 10px;
        }
        .del-detail-btn:hover {
            color: red;
            padding: 0px 10px;
        }
        #div_databse_grid,
        #div_databse_tosel_grid {
            width: 400px;
            height: 378px;
        }
        #div_databse_tosel_grid tbody{
            display:block;
            height:338px;
            overflow-y:scroll;
        }
        #div_databse_tosel_grid thead, #div_databse_tosel_grid tbody tr, .detail_grid thead, .detail_grid tbody tr{
            display:table;
            width:100%;
            table-layout:fixed;
            border-bottom: 1px solid #e7e7e7;
        }
        .div_databse_tosel_grid table{
            border: 1px solid #e7e7e7;
        }
        #div_databse_tosel_grid th,#div_databse_tosel_grid td,.detail_grid  th,.detail_grid td{
            text-align: center;
            height: 40px;
            line-height: 40px;
            white-space: nowrap;text-overflow: ellipsis;overflow: hidden;
        }
        #div_databse_tosel_grid th,.detail_grid th{
            font-weight: bold;
        }
        #div_databse_tosel_grid table thead {
            width: calc( 100% - 1em )
        }
        #touploadfile {
            margin-left: -20px;
            width: 50px;
            border-radius: 0;
            height: 31.5px;
        }
        .upload-p{
            color:red;
            width:280px;
            margin: 30px auto;
        }
        .has-error input,.has-error .l-text-combobox{
            border-color:#a94442;
        }
        .has-success input,.has-success .l-text-combobox{
            border-color:#3c763d;
        }
        label.help-block{
            display: none!important;
        }
        input.help-block{
            display: inline-block!important;
        }
        #receive_edit_medicalOrg,#resource_edit_medicalOrg,#upload_edit_medicalOrg{
            display: none;
        }
        .fileBox{
            width: 100px;
            height: 30px;
            display: inline-block;
            border: 1px solid #ccc;
            white-space: nowrap;
            text-overflow: ellipsis;
            -o-text-overflow: ellipsis;
            overflow: hidden;
        }
    </style>
</head>
<body style="overflow: hidden;">
</body>
</html>

BIN
patient-co-manage/wlyy-manage/src/main/webapp/static/desizenMan/Sheet1.xls


+ 3 - 3
patient-co-manage/wlyy-manage/src/main/webapp/static/desizenMan/js/bootstrap-treeview.js

@ -514,14 +514,14 @@
		var _this = this;
		$.each(nodes, function addNodes(id, node) {
			var treeItem = $(_this.template.item)
				.addClass('node-' + _this.elementId)
				.addClass(node.state.checked ? 'node-checked' : '')
				.addClass(node.state.disabled ? 'node-disabled': '')
				.addClass(node.state.selected ? 'node-selected' : '')
				.addClass(node.searchResult ? 'search-result' : '') 
				.attr('data-nodeid', node.nodeId)
				.addClass(node.searchResult ? 'search-result' : '')
                .attr('data-nodeid', node.nodeId)
                .attr('data-code', node.code)
				.attr('style', _this.buildStyleOverride(node));
			// Add indent/spacer to mimic tree structure

BIN
patient-co-manage/wlyy-manage/src/main/webapp/static/specialty/Sheet1.xls


+ 77 - 7
patient-co-manage/wlyy-manage/src/main/webapp/static/specialty/css/index.css

@ -193,16 +193,16 @@
    font-size: 12px;color: #323232;
}
.lay .info .info-left .input input{
    width: 267px;height: 30px;
    width: 267px;height: 30px;border: solid 1px #d0d0d0;
}
.lay .info .info-right .input input{
    width: 180px;height: 30px;
    width: 180px;height: 30px;border: solid 1px #d0d0d0;
}
.lay .info .info-left .input textarea{
    width: 267px;height: 100px;resize:none
    width: 267px;height: 100px;resize:none;border: solid 1px #d0d0d0;
}
.lay .info .info-right .input textarea{
    width: 180px;height: 116px;resize:none
    width: 180px;height: 116px;resize:none;border: solid 1px #d0d0d0;
}
.layui-form-label{
    font-size: 12px!important;color: #323232!important;font-weight: bold!important;
@ -212,7 +212,7 @@
    margin-left: 95px;
}
.lay .info .info-right .info-right-title{
    font-size: 12px;color: #323232;font-weight: bold;padding-left: 40px;margin-bottom: 10px;
    font-size: 12px;color: #323232;font-weight: bold;padding-left: 32px;margin-bottom: 10px;
}
.lay .info .info-bottom{
    text-align: center;
@ -226,6 +226,76 @@
.l-grid-header-table{
    height: 100%;
}
.lay .content{
    padding: 0!important;
.lay input{
    text-indent: 1em;
}
.lay textarea{
    padding: 10px;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}
.pl-30{
    padding-left: 30px;
}
.l-grid-row-cell-inner{
    height: auto!important;
}
.required{
    position: relative;
}
.required::after{
    content:'*';
    position:absolute;
    left:-10px;
    top:1px;
    color:red;
    font-size:20px;
}
.required-1::after{
    content:'*';
    position:absolute;
    left:10px;
    top:4px;
    color:red;
    font-size:20px;
}
.required-2::after{
    content:'*';
    position:absolute;
    left:-10px;
    top:12px;
    color:red;
    font-size:22px;
}
.lay .layui-input, .layui-textarea{
    padding-left:0;
}
.lay .content-text{
    padding:20px 10px 20px 20px;
    border-bottom: 1px dashed #999;
}
.lay .content-text .number{
    font-size: 14px;
    color: #333;
    margin-bottom:20px;
    font-weight: bold;
}
.lay .content-text .time{
    color: #999;
    font-size:10px;
}
.lay .content-text ul{
    list-style: none;
    padding: 0;
    margin: 0;
}
.lay .content-text ul li{
    font-size:12px;
    color: #333;
    line-height: 20px;
    word-wrap: break-word;
}
.addSubmit{
    text-indent: 0!important;
}

+ 1 - 1
patient-co-service/wlyy_device/src/main/java/com/yihu/hos/device/common/dao/MessageDao.java

@ -46,6 +46,6 @@ public interface MessageDao extends PagingAndSortingRepository<Message, Long>, J
    int findMessageNum(String doctor, Integer type);
    //查询医生下的签约居民未读体征异常消息
    @Query("SELECT a FROM Message a WHERE a.sender=?1 AND a.receiver = ?2 AND a.type = 2 and a.del = '1' and a.read=1 ORDER BY czrq DESC")
    @Query("SELECT a FROM Message a WHERE a.sender=?1 AND a.receiver = ?2 AND a.type = 2 and  (a.del = '1' OR a.del IS NULL) and a.read=1 ORDER BY czrq DESC")
    List<Message> findUnreadHealthIndex(String sender, String receiver);
}

+ 3 - 1
patient-co-service/wlyy_device/src/main/java/com/yihu/hos/device/service/AsyncService.java

@ -334,10 +334,12 @@ public class AsyncService extends BaseService{
                continue;
            }
            if(messageService.getMessageNoticeSettingByMessageType(receiver,"1", MessageNoticeSetting.MessageTypeEnum.healthSignSwitch.getValue())){
                //            新增发送医生助手模板消息 v1.4.0 by wujunjie
               logger.info("医生有开启消息接收");
                //新增发送医生助手模板消息 v1.4.0 by wujunjie
                Doctor doctor = doctorDao.findByCode(receiver);
                if (doctor!=null && StringUtils.isNotEmpty(doctor.getOpenid())) {
                    List<Message> messagesList = messageDao.findUnreadHealthIndex(patientCode, receiver);
                    logger.info("未读消息数量----"+messagesList.size());
                    if (messagesList != null && messagesList.size()>0){
                        logger.info("发送医生助手------start");
                        String url = doctorAssistant + "/wlyy/feldsher/sendDoctorTemplates";

+ 3 - 2
patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/etl/convert/wlyy/DeviceTypeConvert.java

@ -43,14 +43,15 @@ public class DeviceTypeConvert implements Convert {
        if("1".equals(dataModel.getServerType())){
             for (Map<String,Object> one : dict){
                String result = one.get("name")+"";
                if(result.equals("血糖")){
                //if(result.equals("血糖")){
                 if (result.equals("1")){
                    return one.get("code")+"";
                }
            }
        }else if("2".equals(dataModel.getServerType())){
            for (Map<String,Object> one : dict){
                String result = one.get("name")+"";
                if(result.equals("血压")){
                if(result.equals("2")){
                    return one.get("code")+"";
                }
            }

+ 5 - 1
patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/job/business/MysqlToEsQuotaJob.java

@ -116,6 +116,11 @@ public class MysqlToEsQuotaJob implements Job {
        } else {
            endTime = endTime + " 17:00:00";
        }
        if("2".equals(incrementInterval)){
            endTime =  DateUtil.getSundayOfThisDate(DateUtil.strToDateLong(endTime));
        }else if("3".equals(incrementInterval)){
            endTime=  DateUtil.getLastDayOfMonth((DateUtil.strToDateLong(endTime)));
        }
        //初始化统计年份
        this.year = getNowYearByDate(endTime);
        //初始化开始时间
@ -132,7 +137,6 @@ public class MysqlToEsQuotaJob implements Job {
            }
        }
        this.quotaDate = DateUtil.strToDate(endTime, "yyyy-MM-dd");
        this.wlyyJobCongId = map.getString("jobConfig");
        this.quartzJobConfig = quartzJobConfigDao.findById(wlyyJobCongId);

+ 15 - 0
patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/util/DateUtil.java

@ -753,6 +753,21 @@ public class DateUtil {
        c.add(Calendar.DATE, -day_of_week + 7);
        return df2.format(c.getTime());
    }
	/**
	 * 得到本周周日
	 *
	 * @return yyyy-MM-dd
	 */
	public static Date getSundayOfThisDateToDate(Date date) {
		SimpleDateFormat df2 = new SimpleDateFormat("yyyy-MM-dd");
		Calendar c = Calendar.getInstance();
		c.setTime(date);
		int day_of_week = c.get(Calendar.DAY_OF_WEEK) - 1;
		if (day_of_week == 0)
			day_of_week = 7;
		c.add(Calendar.DATE, -day_of_week + 7);
		return c.getTime();
	}
	/**
	 * 获取当月第一天
	 * @return

+ 4 - 2
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/job/specialist/EightSpecialistJob.java

@ -11,6 +11,7 @@ import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
@ -27,13 +28,14 @@ import java.util.Map;
public class EightSpecialistJob implements Job {
    public static String jobKey = "Specialist_Rehabilitation_8_JOB";
    public static String jobCron = "0 0 8 * * ?"; //每天8点
    @Autowired
    @Value("${server.server_url}")
    private String serverUrl;
    @Autowired
    private QuartzJobLogDao dbStorage;
    @Autowired
    private HttpClientUtil httpClientUtil;
    private String dailyJobSendMessage = "/specialist/job/dailyJobSendMessage";//康复管理-每天推送项目进展
    private String dailyJobReserve = "/specialist/job/dailyJobReserve";//康复管理-10天、7天、5天、当天康复服务预约复诊通知
    @Transactional
@ -52,7 +54,7 @@ public class EightSpecialistJob implements Job {
            param.put("endTime", endTime);
            param.put("type", 23);
            HttpResponse response = HttpUtils.doPost(serverUrl + dailyJobSendMessage, param);
            HttpUtils.doPost(serverUrl + dailyJobReserve,  new HashedMap());
        }catch (Exception e){
            //保存日志
            quartzJobLog.setJobEndTime(new Date());

+ 2 - 1
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/job/specialist/SixteenSpecialistJob.java

@ -13,6 +13,7 @@ import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
@ -31,7 +32,7 @@ import java.util.Map;
public class SixteenSpecialistJob implements Job {
    public static String jobKey = "Specialist_Rehabilitation_16_JOB";
    public static String jobCron = "0 0 16 * * ?"; //每天8点,14点,20 点执行一次
    @Autowired
    @Value("${server.server_url}")
    private String serverUrl;
    @Autowired
    private QuartzJobLogDao dbStorage;

+ 65 - 0
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/service/specialist/SpecialistService.java

@ -0,0 +1,65 @@
package com.yihu.wlyy.service.specialist;
import com.yihu.wlyy.event.ApplicationEvent;
import com.yihu.wlyy.job.QuartzHelper;
import com.yihu.wlyy.job.specialist.EightSpecialistJob;
import com.yihu.wlyy.job.specialist.SixteenSpecialistJob;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.HashMap;
/**
 * Created by 刘文彬 on 2018/9/13.
 */
@Service
public class SpecialistService {
    private Logger logger = LoggerFactory.getLogger(SpecialistService.class);
    @Autowired
    QuartzHelper quartzHelper;
    public void starJob(Integer type) throws Exception{
        if(type==1){
            //康复计划每天8点发送服务执行进展
            if (!quartzHelper.isExistJob(EightSpecialistJob.jobKey)) {
                quartzHelper.addJob(EightSpecialistJob.class, EightSpecialistJob.jobCron, EightSpecialistJob.jobKey, new HashMap<String, Object>());
                logger.info("NoticeJob  job success");
            } else {
                logger.info("NoticeJob  job exist");
            }
        }else if(type==2){
            //康复计划每天16点发送服务执行进展
            if (!quartzHelper.isExistJob(SixteenSpecialistJob.jobKey)) {
                quartzHelper.addJob(SixteenSpecialistJob.class, SixteenSpecialistJob.jobCron, SixteenSpecialistJob.jobKey, new HashMap<String, Object>());
                logger.info("NoticeJob  job success");
            } else {
                logger.info("NoticeJob  job exist");
            }
        }
    }
    /**
     *
     * @param type 1、8点推送,2、16点推送
     * @throws Exception
     */
    public void stopJob(Integer type) throws Exception{
        switch (type){
            case 1:{
                if(quartzHelper.isExistJob(EightSpecialistJob.jobKey)){
                    quartzHelper.removeJob(EightSpecialistJob.jobKey);
                }break;}
            case 2:{
                if(quartzHelper.isExistJob(SixteenSpecialistJob.jobKey)){
                    quartzHelper.removeJob(EightSpecialistJob.jobKey);
                }
                break;}
        }
    }
}

+ 50 - 0
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/web/SpecialistController.java

@ -0,0 +1,50 @@
package com.yihu.wlyy.web;
import com.yihu.wlyy.service.specialist.SpecialistService;
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.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
 * Created by 刘文彬 on 2018/9/13.
 */
@RestController
@RequestMapping(value = "/job/specialist", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(description = "后台-任务控制每天8点、16点推送康复计划进展")
public class SpecialistController extends BaseController{
    @Autowired
    private SpecialistService specialistService;
    @RequestMapping(value = "starJob", method = RequestMethod.GET)
    @ApiOperation(value = "启动每天8点、16点推送康复计划进展")
    public String starJob(@ApiParam(name = "type", value = "(1、8点推送,2、16点推送)",required = true)
                          @RequestParam(value = "type", required = true)Integer type){
        try{
            specialistService.starJob(type);
            return success("启动成功!");
        }catch (Exception e){
            error(e);
            return invalidUserException(e, -1, "启动失败:" + e.getMessage());
        }
    }
    @RequestMapping(value = "stopJob", method = RequestMethod.GET)
    @ApiOperation(value = "关闭每天8点、16点推送康复计划进展")
    public String stopJob(@ApiParam(name = "type", value = "(1、8点推送,2、16点推送)",required = true)
                          @RequestParam(value = "type", required = true)Integer type){
        try{
            specialistService.stopJob(type);
            return success("关闭成功!");
        }catch (Exception e){
            error(e);
            return invalidUserException(e, -1, "关闭失败:" + e.getMessage());
        }
    }
}

+ 2 - 1
patient-co/patient-co-wlyy-job/src/main/resources/application-test.yml

@ -87,9 +87,10 @@ images:
  sign_path: /usr/local/apache-tomcat-8.0.36/webapps/wlyy/images/familycontract.png
sign:
  check_upload: http://172.19.103.88:8011/wlyy_service
  zysoft: http://59.61.92.90:8072/wlyy_sign
quartz:
  name: schedulerFactoryBean_test

+ 2 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/config/SwaggerConfig.java

@ -194,7 +194,8 @@ public class SwaggerConfig {
                        regex("/esstatistics/.*"),
                        regex("/old/statistics/.*"),
                        regex("/questionnaire/.*"),
                        regex("/rehabilitation/.*")
                        regex("/rehabilitation/.*"),
                        regex("/specialist/.*")
                ))
                .build()
                .apiInfo(otherApiInfo());

+ 29 - 9
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/message/MessageDao.java

@ -60,13 +60,13 @@ public interface MessageDao extends PagingAndSortingRepository<Message, Long>, J
    @Query("update Message a set a.read = 0 where a.receiver = ?1 and a.sender=?2 and a.tzType=?3")
    int updateHealthIndexMessageByPatient(String doctor, String patient, String type);
    @Query("select a from Message a where a.read= 1 and a.receiver = ?1 and a.type not in (1,2,6,7,12,101,14,15,16,17,18,19,20,21,22) order by a.czrq desc")
    @Query("select a from Message a where a.read= 1 and a.receiver = ?1 and a.type not in (1,2,6,7,12,101,14,15,16,17,18,19,20,21,22,23) order by a.czrq desc")
    List<Message> getSystemMessageUnread(String doctor);
    @Query("select a from Message a where a.receiver = ?1 and a.prescriptionStatus=?2 and a.type in (6,7) order by a.createTime desc")
    List<Message> getSysTemMessageByPrescription(String doctor, String prescriptionStatus);
    @Query("select a from Message a where a.receiver = ?1 and a.type not in (1,2,6,7,12,101,14,15,301,16,17,18) and (a.del = '1' or a.del is null) ")
    @Query("select a from Message a where a.receiver = ?1 and a.type not in (1,2,6,7,12,101,14,15,301,16,17,18,19,20,21,22,23) and (a.del = '1' or a.del is null) ")
    List<Message> getSystemMessage(String doctor, Pageable pageRequest);
    @Query("select a from Message a where a.receiver = ?1 and a.type=?2 and a.prescriptionStatus='0' ")
@ -87,7 +87,9 @@ public interface MessageDao extends PagingAndSortingRepository<Message, Long>, J
    @Modifying
    int setMessageReaded(String doctor, Integer type);
    @Query("update Message a set a.read = 0,a.over = '0' where a.receiver = ?1 and a.id = ?2")
    @Modifying
    int setMessageReadedById(String doctor, Long id);
    @Query("update Message a set a.read = 0,a.over = '0' where a.receiver = ?1 and a.type not in (1,2,6,7)")
    @Modifying
@ -126,8 +128,8 @@ public interface MessageDao extends PagingAndSortingRepository<Message, Long>, J
    @Query(" select a from Message a where a.type=?2 and a.del='1' and a.read=1 and a.receiver=?1 and a.over='1' order by a.createTime desc ")
    List<Message> findUnReadByReceiverAndType(String receiver,Integer type);
    @Query("select a from Message a where a.read= ?2 and a.receiver = ?1 and a.state = 1 and a.over = ?3 and a.type = 16 order by a.czrq desc")
    List<Message> getSpecialistApply(String receiver,Integer read,String over);
    @Query("select a from Message a where a.read = 1 and a.receiver = ?1 and a.state = 1 and a.over = ?2 and a.type in (16,20,22,23) order by a.czrq desc")
    List<Message> getSpecialistApply(String receiver,String over);
    @Query("select a from Message a where a.receiver = ?1 and a.state = 1 and a.type = 17 order by a.czrq desc")
    List<Message> getFamilyTransfer(String receiver);
@ -135,18 +137,36 @@ public interface MessageDao extends PagingAndSortingRepository<Message, Long>, J
    @Query("select a from Message a where a.read = 1 and a.receiver = ?1 and a.state = 1 and a.type = 18 order by a.czrq desc")
    List<Message> getFamilySign(String receiver);
    @Query("select a from Message a where a.receiver = ?1 and a.state = 1 and a.type in(18,19,20,21,22)")
    @Query("select a from Message a where a.receiver = ?1 and a.state = 1 and a.type in(18,19,20,21,22,23)")
    List<Message> selectFamilySign(String receiver,Pageable pageableRequest);
    @Query("select a from Message a where a.read= ?2 and a.receiver = ?1 and a.state = 1 and a.over = ?3 and a.type = 17 order by a.czrq desc")
    List<Message> getFamilyTransferReadAndOver(String receiver,Integer read,String over);
    @Query("select a from Message a where a.read= ?2 and a.receiver = ?1 and a.state = 1 and a.over = ?3 and a.type in (16,19,20,21,22) order by a.czrq desc")
    List<Message> getSpecialistUntreated(String receiver,Integer read,String over,Pageable pageable);
    @Query("select a from Message a where a.receiver = ?1 and a.state = 1 and a.over = ?2 and a.type in (16,20,22,23) order by a.czrq desc")
    List<Message> getSpecialistUntreated(String receiver,String over,Pageable pageable);
    @Query("select a from Message a where  a.receiver = ?1 and a.state = 1 and a.over = ?2 and a.type in (19,21) order by a.czrq desc")
    List<Message> getSpecialistMessages(String receiver,String over,Pageable pageable);
    @Query("select a from Message a where a.read= ?2 and a.receiver = ?1 and a.state = 1 and a.over = ?3 and a.type in (17) order by a.czrq desc")
    List<Message> getTransferMessage(String receiver,Integer read,String over,Pageable pageable);
    @Query("select a from Message a where a.code = ?1")
    Message findByCode(String code);
    @Query("select a from Message a where a.read = 1 and a.receiver = ?1 and a.state = 1 and a.type in (19,20,21,22) order by a.czrq desc")
    @Query("select a from Message a where a.read = 1 and a.receiver = ?1 and a.state = 1 and a.type in (19,21) order by a.czrq desc")
    List<Message> getSpecialistUnRead(String receiver);
    @Query("select a from Message a where a.read = 1 and a.receiver = ?1 and a.state = 1 and a.type in (19,20,21,22,23) order by a.czrq desc")
    List<Message> getSpecialistUnRead2(String receiver);
    @Query("update Message a set a.read=0,a.over = '0' where a.id = ?1")
    @Modifying
    int setSpecialistById(Long id);
    @Query("update Message a set a.read = 0 where a.id = ?1")
    @Modifying
    int setSpecialistReadById(Long id);
}

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/patient/PatientAimSportsDao.java

@ -17,7 +17,7 @@ public interface PatientAimSportsDao extends
    @Query("from PatientAimSports p where p.code=?1")
    PatientAimSports findByCode(String code);
    @Query("from PatientAimSports p where p.patientcode =?1")
    @Query("from PatientAimSports p where p.patientcode =?1 and p.bmiMax is not null and p.bmiMin is not null")
    PatientAimSports getPatientAimSportsByPatientCode(String patientCode);
}

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/disease/PatientDiseaseService.java

@ -510,7 +510,7 @@ public class PatientDiseaseService extends BaseService {
                "b.disease_name AS labelName," +
                "b.disease AS label " +
                "FROM wlyy_specialist.wlyy_specialist_patient_relation a " +
                "JOIN wlyy.wlyy_patient_disease_server b ON a.patient=b.patient and b.del=1 " +
                "JOIN wlyy.wlyy_patient_disease_server b ON a.id=b.specialist_relation_code and b.del=1 " +
                "WHERE a.sign_status> 0 AND a.`status`>=0 AND b.del =1 " +
                "AND a.doctor='"+doctor+"' " +
                "GROUP BY b.disease";

+ 10 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/label/SignPatientLabelInfoService.java

@ -21,6 +21,7 @@ import com.yihu.wlyy.service.app.account.PatientInfoService;
import com.yihu.wlyy.service.app.health.PatientHealthIndexService;
import com.yihu.wlyy.service.app.team.AdminTeamService;
import com.yihu.wlyy.service.specialist.SpecialistService;
import com.yihu.wlyy.service.specialist.rehabilitation.RehabilitationManageService;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.util.IdCardUtil;
import org.apache.commons.collections.map.HashedMap;
@ -84,6 +85,8 @@ public class SignPatientLabelInfoService extends BaseService {
    PatientHealthIndexService patientHealthIndexService;
    @Autowired
    SpecialistService specialistService;
    @Autowired
    RehabilitationManageService rehabilitationManageService;
    private final Logger logger = LoggerFactory.getLogger(this.getClass());
@ -273,7 +276,13 @@ public class SignPatientLabelInfoService extends BaseService {
        }else{
            json.put("isSpecialist",0);
        }
        //1.5.0 是否有康复计划
        JSONArray planList = rehabilitationManageService.planListByPatient(patient);
        if(planList!=null&&planList.length()>0){
            json.put("havePlan",1);
        }else{
            json.put("havePlan",0);
        }
        return json;
    }

+ 124 - 11
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/message/MessageService.java

@ -18,6 +18,7 @@ import com.yihu.wlyy.util.HttpClientUtil;
import com.yihu.wlyy.util.IdCardUtil;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONObject;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.Page;
@ -46,6 +47,8 @@ import java.util.*;
@Transactional(rollbackOn = Exception.class)
public class MessageService extends BaseService {
    private static org.slf4j.Logger logger = LoggerFactory.getLogger(MessageService.class);
    @Autowired
    private ConsultTeamDao consultTeamDao;
    @Autowired
@ -67,6 +70,11 @@ public class MessageService extends BaseService {
    @Value("${im.im_list_get}")
    private String im_list_get;
    @Value("${specialist.url}")
    private String specialistUrl;
    @Autowired
    private HttpClientUtil httpClientUtil;
    /**
     * IM消息数量
     */
@ -103,7 +111,7 @@ public class MessageService extends BaseService {
    /**
     * 查询医生未读消息和最后消息
     */
    public JSONObject findDoctorAllMessage(String doctor,Integer type) throws Exception {
    public JSONObject findDoctorAllMessage(String doctor,Integer type,Integer flag) throws Exception {
        // 签约未读消息总数
        int sign = messageDao.amountUnreadByReceiver(doctor);
        JSONObject signJson = new JSONObject();
@ -202,7 +210,8 @@ public class MessageService extends BaseService {
            JSONObject articleJson = new JSONObject();
            articleJson.put("title", "文章审核消息");
            articleJson.put("type", articleMes.get(0).getType());
            articleJson.put("msg", "你有"+articleMes.size()+"个文章审核消息");
//            articleJson.put("msg", "你有"+articleMes.size()+"个文章审核消息");
            articleJson.put("msg", "你有"+articleMes.size()+"个新消息");
            articleJson.put("msgTime", DateUtil.dateToStrLong(articleMes.get(0).getCreateTime()));
            articleMesJson.put("lastMessage", articleJson);
        }else{
@ -243,8 +252,17 @@ public class MessageService extends BaseService {
            familyMesJson.put("amount", 0);
        }
        //专科1、全科2
        //专科消息
        List<Message> specialistList = messageDao.getSpecialistUnRead(doctor);
        List<Message> specialistList = new ArrayList<>();
        if (flag!=null){
            if (flag == 1){
                specialistList = messageDao.getSpecialistUnRead(doctor);
            }else if (flag == 2){
                specialistList = messageDao.getSpecialistUnRead2(doctor);
            }
        }
        JSONObject specialistMesJson = new JSONObject();
        JSONArray jsonArray = new JSONArray();
        if (specialistList != null && specialistList.size() > 0) {
@ -601,13 +619,18 @@ public class MessageService extends BaseService {
        }
    }
    public void setMessageReadedById(String doctor, Long id) {
        messageDao.setMessageReadedById(doctor, id);
    }
    /**
     * 家医设置专科消息一键已读
     *
     * @param doctor
     */
    public String setMessageReaded(String doctor,List<Integer> types) {
    public String setMessageReaded(String doctor,List<Integer> types,Integer flag) {
        StringBuffer buffer = new StringBuffer();
        buffer.append("type in (");
        for (int i = 0;i<types.size();i++){
@ -615,8 +638,21 @@ public class MessageService extends BaseService {
        }
        buffer.deleteCharAt(buffer.length()-1);
        buffer.append(")");
        String sql = " update wlyy_message a set a.has_read = 0,a.over = '0' where a.receiver = '"+doctor+"' and "+buffer;
        int i = jdbcTemplate.update(sql);
        int i = 0;
        if (flag == 1){
            String sql = " update wlyy_message a set a.has_read = 0,a.over = '0' where a.receiver = '"+doctor+"' and "+buffer;
            i = jdbcTemplate.update(sql);
        }else if (flag == 2){
            if (types.contains(19)&&types.contains(21)){
                String sql = " update wlyy_message a set a.has_read = 0,a.over = '0' where a.receiver = '"+doctor+"' and "+buffer;
                i = jdbcTemplate.update(sql);
            }else {
                String sql1 = " update wlyy_message a set a.has_read = 0,a.over = '0' where a.receiver = '"+doctor+"' and type = 20";
                i=jdbcTemplate.update(sql1);
                String sql2 = "update wlyy_message a set a.has_read = 0 where a.receiver = '"+doctor+"' and type IN (22,23)";
                i=jdbcTemplate.update(sql2);
            }
        }
        return Integer.toString(i);
    }
@ -859,14 +895,14 @@ public class MessageService extends BaseService {
    public JSONObject selectUntreated(String doctor){
        //专科医生签约平台
        List<Message> specialist = messageDao.getSpecialistApply(doctor,1,"1");
        List<Message> specialist = messageDao.getSpecialistApply(doctor,"1");
        JSONObject specialistJson = new JSONObject();
        if (specialist != null && specialist.size() != 0){
            specialistJson.put("amount", specialist.size());
            JSONObject specialistObject = new JSONObject();
            specialistObject.put("title", specialist.get(0).getTitle());
            specialistObject.put("type", specialist.get(0).getType());
            specialistObject.put("msg", "您有"+specialist.size()+"个居民申请共管服务");
            specialistObject.put("msg", "您有"+specialist.size()+"个消息待处理,请查收");
            specialistObject.put("msgTime", DateUtil.dateToStrLong(specialist.get(0).getCreateTime()));
            specialistObject.put("relationCode",specialist.get(0).getRelationCode());
            specialistJson.put("specialist",specialistObject);
@ -913,7 +949,7 @@ public class MessageService extends BaseService {
    public List<Message> getFamilySign(String receiver,Integer page, Integer size) throws Exception{
        // 排序
        Sort sort = new Sort(Sort.Direction.DESC, "read","over","createTime");
        Sort sort = new Sort(Direction.DESC, "createTime");
        // 分页信息
        Pageable pageRequest = new PageRequest(page - 1, size, sort);
        return messageDao.selectFamilySign(receiver,pageRequest);
@ -932,14 +968,91 @@ public class MessageService extends BaseService {
    public List<Message> getSpecialistUnTreated(Message message, Integer page, Integer size) throws Exception{
        // 排序
        Sort sort = new Sort(Sort.Direction.DESC, "read","over","createTime");
        Sort sort = new Sort(Sort.Direction.DESC, "createTime");
        // 分页信息
        Pageable pageRequest = new PageRequest(page - 1, size, sort);
        return messageDao.getSpecialistUntreated(message.getReceiver(),message.getOver(),pageRequest);
    }
    /**
     * 获取待处理的接口
     *
     * @param message {}
     * @param page 页码
     * @param size 分页大小
     * @return
     * @throws Exception
     */
    public List<Message> getSpecialistMessages(Message message, Integer page, Integer size) throws Exception{
        // 排序
        Sort sort = new Sort(Sort.Direction.DESC,"over","createTime");
        // 分页信息
        Pageable pageRequest = new PageRequest(page - 1, size, sort);
        return messageDao.getSpecialistUntreated(message.getReceiver(),message.getRead(),message.getOver(),pageRequest);
        return messageDao.getSpecialistMessages(message.getReceiver(),message.getOver(),pageRequest);
    }
    /**
     * 获取转诊通知
     *
     * @param message
     * @param page
     * @param size
     * @return
     * @throws Exception
     */
    public List<Message> getTransferMessage(Message message, Integer page, Integer size) throws Exception{
        // 排序
        Sort sort = new Sort(Sort.Direction.DESC, "read","over","createTime");
        // 分页信息
        Pageable pageRequest = new PageRequest(page - 1, size, sort);
        return messageDao.getTransferMessage(message.getReceiver(),message.getRead(),message.getOver(),pageRequest);
    }
    /**
     * 设置待办消息已处理
     *
     * @param id
     * @param type
     */
    public int setSpecialistOver(Long id,Integer type){
        if (type == 22 || type==23){
            int result = 0;
            Message message = messageDao.findOne(id);
            String response = null;
            String url =specialistUrl + "svr-specialist/selectByIds";
            Map<String,String> params = new HashMap<>();
            params.put("ids",message.getRelationCode());
            try {
                response = httpClientUtil.httpPost(url,params);
               com.alibaba.fastjson.JSONObject object = com.alibaba.fastjson.JSONObject.parseObject(response);
               if (object.getInteger("status") == 200){
                   JSONArray array = object.getJSONArray("obj");
                   Integer count = 0;
                   for (int i =0;i<array.size();i++){
                       if (array.getJSONObject(i).getInteger("status") == 1){
                           count = count+1;
                       }
                   }
                   if (count == array.size()){
                       result = messageDao.setSpecialistById(id);
                   }else {
                       result = messageDao.setSpecialistReadById(id);
                   }
               }
            }catch (Exception e){
                e.printStackTrace();
                logger.error(e.getMessage());
            }
            return result;
        }else {
           return messageDao.setSpecialistById(id);
        }
    }
}

+ 5 - 4
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/statisticsES/StatisticsESService.java

@ -5768,11 +5768,12 @@ public class StatisticsESService {
    //按绑定的医生列表展示绑定的设备列表
    public Map<String, Object> deviceRateList(Map<String, Object> reMap,Hospital hos){
//        String sql = " select count(1) as amount from wlyy.wlyy_patient_device p JOIN wlyy.wlyy_doctor r on p.doctor is not null and  p.doctor =r.code  LEFT JOIN device.wlyy_devices d on p.device_sn=d.device_code where  p.doctor is not null and d.grant_org_code ='" + hos.getCode() + "' and p.doctor='"+reMap.get("code")+"'";
        String temp = "other".equals(reMap.get("code"))? " and p.doctor is null ":" and p.doctor='"+reMap.get("code")+"' ";
        String sql = " select count(1) as amount " +
        String temp = "other".equals(reMap.get("code"))? " and wd.grant_org_code ='"+hos.getCode()+"' and (wd.grant_doctor is null or wd.grant_doctor='')":" and wd.grant_doctor='"+String.valueOf(reMap.get("code"))+"' ";
       /* String sql = " select count(1) as amount " +
                " from (select  DISTINCT p.doctor,r.name,p.device_sn FROM wlyy.wlyy_patient_device p left join device.wlyy_devices d on p.device_sn=d.device_code left JOIN wlyy.wlyy_doctor r ON  p.doctor = r. CODE " +
                " where d.is_binding in (1,2) and p.category_code in('1','2') and d.grant_org_code ='" + hos.getCode() + "' "+temp+") a " +
                " GROUP BY a.doctor,a.name";
                " GROUP BY a.doctor,a.name";*/
       String sql ="SELECT count(1) as amount from device.wlyy_devices wd LEFT JOIN dm_device dd ON wd.device_model=dd.model where 1=1 "+temp+" AND dd.category_code IN('1','2') and wd.is_grant=1";
//        Map<String, Object> map = jdbcTemplate.queryForMap(sql);
        List<Map<String,Object>> result = jdbcTemplate.queryForList(sql);
        Map<String,Object> map = result.get(0);
@ -5821,7 +5822,7 @@ public class StatisticsESService {
            creditsSaveModel = elasticsearchUtil.findOneDateQuotaLevel1(timeKey, area, level, index_93, SaveModel.timeLevel_DDL,slaveKey1);//活动获取积分人次总量
            resultMap = applyList(index_1,index_89,area,level, sort,lowLevel,slaveKey1,resultMap);//列表
        }else{
            activitySaveModel = elasticsearchUtil.findOneDateQuotaLevel0(timeKey, area, level, index_89, SaveModel.timeLevel_DDL);//活动报名人次总量
            activitySaveModel = elasticsearchUtil.findOneDateQuotaLevel0(timeKey, area, level, index_91, SaveModel.timeLevel_DDL);//活动报名人次总量
            participantSaveModel = elasticsearchUtil.findOneDateQuotaLevel0(timeKey, area, level, index_92, SaveModel.timeLevel_DDL);//活动参与人次总量
            creditsSaveModel = elasticsearchUtil.findOneDateQuotaLevel0(timeKey, area, level, index_93, SaveModel.timeLevel_DDL);//活动获取积分人次总量
            resultMap = applyList(index_1,index_91,area,level, sort,lowLevel,slaveKey1,resultMap);//列表

+ 92 - 8
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/specialist/SpecialistEvaluateSevice.java

@ -2,6 +2,7 @@ package com.yihu.wlyy.service.specialist;/**
 * Created by nature of king on 2018/8/28.
 */
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.entity.message.Message;
@ -13,6 +14,7 @@ import com.yihu.wlyy.repository.organization.HospitalDao;
import com.yihu.wlyy.repository.patient.PatientDao;
import com.yihu.wlyy.service.BaseService;
import com.yihu.wlyy.util.HttpClientUtil;
import com.yihu.wlyy.util.IdCardUtil;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -111,8 +113,79 @@ public class SpecialistEvaluateSevice extends BaseService {
    /**
     * 发送消息 type:19 受理提醒,20 待办工作提醒 21 服务进展提醒-已完成 22 服务进展提醒-未完成
     * 医生获取评分
     *
     * @param doctor
     * @return
     */
    public JSONObject selectByDoctor(String doctor){
        String response = null;
        String url =/*"http://localhost:10051/"*/specialistUrl + "svr-specialist/selectByDoctor";
        Map<String,String> params = new HashMap<>();
        params.put("doctor",doctor);
        try {
            response = httpClientUtil.httpPost(url,params);
            JSONObject object = JSONObject.parseObject(response);
            if (object.getInteger("status")==200){
                JSONObject jsonObject4 = object.getJSONObject("obj");
                JSONObject jsonObject = jsonObject4.getJSONObject("4");
                JSONObject jsonObject1 = jsonObject4.getJSONObject("5");
                JSONObject jsonObject2 = jsonObject4.getJSONObject("6");
                JSONObject jsonObject3 = jsonObject4.getJSONObject("7");
                JSONArray array = jsonObject.getJSONArray("evaluate");
                JSONArray array1 = jsonObject1.getJSONArray("evaluate");
                JSONArray array2 = jsonObject2.getJSONArray("evaluate");
                JSONArray array3 = jsonObject3.getJSONArray("evaluate");
                //全部
                for (int i=0;i<array.size();i++){
                    JSONObject object1 = array.getJSONObject(i);
                    String patient = object1.getJSONArray("patient").getString(0);
                    Patient patient1 = patientDao.findByCode(patient);
                    Integer age = IdCardUtil.getAgeForIdcard(patient1.getIdcard());
                    object1.put("patient1",patient1);
                    object1.put("age",age);
                }
                //好评
                for (int i=0;i<array1.size();i++){
                    JSONObject object1 = array1.getJSONObject(i);
                    String patient = object1.getJSONArray("patient").getString(0);
                    Patient patient1 = patientDao.findByCode(patient);
                    Integer age = IdCardUtil.getAgeForIdcard(patient1.getIdcard());
                    object1.put("patient1",patient1);
                    object1.put("age",age);
                }
                //中评
                for (int i=0;i<array2.size();i++){
                    JSONObject object1 = array2.getJSONObject(i);
                    String patient = object1.getJSONArray("patient").getString(0);
                    Patient patient1 = patientDao.findByCode(patient);
                    Integer age = IdCardUtil.getAgeForIdcard(patient1.getIdcard());
                    object1.put("patient1",patient1);
                    object1.put("age",age);
                }
                //差评
                for (int i=0;i<array3.size();i++){
                    JSONObject object1 = array3.getJSONObject(i);
                    String patient = object1.getJSONArray("patient").getString(0);
                    Patient patient1 = patientDao.findByCode(patient);
                    Integer age = IdCardUtil.getAgeForIdcard(patient1.getIdcard());
                    object1.put("patient1",patient1);
                    object1.put("age",age);
                }
            }
            return object;
        }catch (Exception e){
            e.printStackTrace();
            logger.error(e.getMessage());
            return null;
        }
    }
    /**
     * 发送消息 type:19 受理提醒,20 待办工作提醒 21 服务进展提醒-已完成 22 服务进展提醒-未完成 23 服务进展提醒-待完成
     */
    public JSONObject sendMessage(Message message,String hospitalCode,String patientCode,Integer num){
        JSONObject object = new JSONObject();
        try {
@ -121,40 +194,51 @@ public class SpecialistEvaluateSevice extends BaseService {
                hospital = hospitalDao.findByCode(hospitalCode);
            }
            Patient patient = patientDao.findByCode(patientCode);
            Doctor sendDoctor = doctorDao.findByCode(message.getSender());
//            Doctor sendDoctor = doctorDao.findByCode(message.getSender());
            Doctor receiverDoctor = doctorDao.findByCode(message.getReceiver());
            if (message.getType() == 19 ){
                message.setOver("0");//未处理
                message.setType(19);
                message.setTitle("康复计划-受理提醒");
                message.setContent("您的"+patient.getName()+"签约居民,刚刚出院,"+(hospital!=null?hospital.getName():"")+"已完成康复计划的制定,请查看");
            }else if (message.getType() == 20){
                message.setOver("1");//未处理
                message.setType(20);
                message.setTitle("康复计划-待办工作提醒");
                message.setContent("您的"+patient.getName()+"签约居民"+num+"天后计划到"+(hospital!=null?hospital.getName():"")+"复诊,请查看");
                if(num==0){
                    message.setContent("您的"+patient.getName()+"签约居民今天计划到"+(hospital!=null?hospital.getName():"")+"复诊,请查看");
                }else{
                    message.setContent("您的"+patient.getName()+"签约居民"+num+"天后计划到"+(hospital!=null?hospital.getName():"")+"复诊,请查看");
                }
            }else if (message.getType() == 21){
                message.setOver("0");//未处理
                message.setType(21);
                message.setTitle("康复计划-服务进展提醒");
                message.setContent("您的"+patient.getName()+"签约居民已完成康复计划今日项目,请查看");
            }else if (message.getType() == 22){
                message.setOver("1");//未处理
                message.setType(22);
                message.setTitle("康复计划-服务进展提醒");
                message.setContent("您的"+patient.getName()+"签约居民未完成康复计划今天项目,请尽快处理");
            }else if (message.getType() == 23){
                message.setOver("1");//未处理
                message.setType(23);
                message.setTitle("康复计划-服务进展提醒");
                message.setContent("您的"+patient.getName()+"签约居民今日有"+num+"个康复计划项目待完成,请尽快处理");
            }
            message.setSenderName(sendDoctor.getName());
            message.setCode(getCode());
            message.setSenderPhoto(sendDoctor.getPhoto());
//            message.setSenderName(sendDoctor.getName());
//            message.setSenderPhoto(sendDoctor.getPhoto());
//            message.setSex(sendDoctor.getSex());
            message.setReadonly(1);//是否只读消息
            message.setSex(sendDoctor.getSex());
            message.setOver("1");//未处理
            message.setDel("1");
            message.setState(1);
            message.setRead(1);
            message.setCzrq(new Date());
            message.setReceiverName(receiverDoctor.getName());
            message.setReason(patientCode);
            message.setData(patientCode);
            message.setCreateTime(new Date());
            messageDao.save(message);
        }catch (Exception e){
            e.printStackTrace();

+ 5 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/specialist/SpecialistHospitalItemService.java

@ -117,7 +117,11 @@ public class SpecialistHospitalItemService extends BaseService {
        params.put("docHospital",d.getHospital());
        if(StringUtils.isNotBlank(patient)) {
            signFamily = familyService.findByPatient(patient);
            params.put("hospital", signFamily.getHospital());
            if (signFamily != null) {
                params.put("hospital", signFamily.getHospital());
            }else {
                throw new Exception("该居民不是有效签约!");
            }
        }
        if(StringUtils.isNotBlank(serviceItemName)) {
            params.put("serviceItemName", serviceItemName);

+ 22 - 5
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/specialist/SpecialistService.java

@ -41,10 +41,7 @@ import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
 * Created by Trick on 2018/5/31.
@ -800,9 +797,10 @@ public class SpecialistService extends BaseService {
        return false;
    }
    
    public JSONArray findDoctorAndDoctorHealthBySpecialDoctor(String doctor) throws Exception{
    public JSONArray findDoctorAndDoctorHealthBySpecialDoctor(String doctor, String name) throws Exception{
        Map<String, Object> param = new HashedMap();
        param.put("doctor", doctor);
        param.put("name", name);
        HttpResponse response = HttpUtils.doGet(specialistUrl + "svr-specialist/findDoctorAndDoctorHealthBySpecialDoctor", param);
        if(StringUtils.isNotBlank(response.getContent())) {
            JSONObject rs = new JSONObject(response.getContent());
@ -862,5 +860,24 @@ public class SpecialistService extends BaseService {
        }
        throw new Exception("请求获取居民信息失败!");
    }
    public List<Map<String,Object>> findPatientSignFamily(String patient) throws Exception {
        SignFamily signFamily = signFamilyDao.findSignFamilyByPatient(patient);
        List<Map<String,Object>> resultList = new ArrayList<>();
        if(signFamily!=null){
            Map<String,Object> map = new HashMap<>();
            map.put("doctorName",signFamily.getDoctorHealthName());
            map.put("doctorCode",signFamily.getDoctorHealth());
            map.put("doctorType","健管师");
            resultList.add(map);
            map = new HashMap<>();
            map.put("doctorName",signFamily.getDoctorName());
            map.put("doctorCode",signFamily.getDoctor());
            map.put("doctorType","全科医生");
            resultList.add(map);
        }
        return resultList;
    }
}

+ 225 - 48
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/specialist/rehabilitation/RehabilitationManageService.java

@ -1,5 +1,6 @@
package com.yihu.wlyy.service.specialist.rehabilitation;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.entity.message.Message;
import com.yihu.wlyy.entity.patient.Patient;
@ -12,7 +13,10 @@ import com.yihu.wlyy.repository.wechat.WechatTemplateConfigDao;
import com.yihu.wlyy.service.BaseService;
import com.yihu.wlyy.service.specialist.SpecialistEvaluateSevice;
import com.yihu.wlyy.task.PushMsgTask;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.util.IdCardUtil;
import com.yihu.wlyy.util.QrcodeUtil;
import com.yihu.wlyy.util.fastdfs.FastDFSUtil;
import com.yihu.wlyy.util.http.HttpResponse;
import com.yihu.wlyy.util.http.HttpUtils;
import com.yihu.wlyy.wechat.util.WeiXinAccessTokenUtils;
@ -27,7 +31,10 @@ import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletRequest;
import java.io.InputStream;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
@ -40,6 +47,14 @@ import java.util.Map;
public class RehabilitationManageService extends BaseService {
    @Value("${specialist.url}")
    private String specialistUrl;
    @Value("${wechat.wechat_base_url}")
    private String wechat_base_url;
    @Value("${wechat.appId}")
    private String appId;
    @Value("${neiwang.enable}")
    private Boolean isneiwang;  //如果不是内网项目要转到到内网wlyy在上传
    @Value("${fastDFS.fastdfs_file_url}")
    private String fastdfs_file_url;
    @Autowired
    private JdbcTemplate jdbcTemplate;
    @Autowired
@ -58,6 +73,10 @@ public class RehabilitationManageService extends BaseService {
    private WeiXinOpenIdUtils weiXinOpenIdUtils;
    @Autowired
    private WeiXinAccessTokenUtils accessTokenUtils;
    @Autowired
    protected HttpServletRequest request;
    @Autowired
    private com.yihu.wlyy.util.CommonUtil CommonUtil;
    /************************************************************* start ************************************************************************/
    private String findRehabilitationPlanList = "/svr-specialist/findRehabilitationPlanList";//康复管理-康复计划列表
@ -75,10 +94,13 @@ public class RehabilitationManageService extends BaseService {
    private String serviceDoctorList = "/svr-specialist/serviceDoctorList";//康复管理-医生端居民详情服务医生列表
    private String appCalendarPlanDetailList = "/svr-specialist/appCalendarPlanDetailList";//康复管理-app端、微信端计划的服务项目列表
    private String dailyJob = "/svr-specialist/dailyJob";//每日康复服务通知
    private String dailyJobReserve = "/svr-specialist/dailyJobReserve";//10天、7天、5天、当天康复服务预约复诊通知
    private String saveRehabilitationOperateRecord ="/svr-specialist/saveRehabilitationOperateRecord";//新增operateRecodr
    private String updateNoteAndImageRehabilitationOperate ="/svr-specialist/updateNoteAndImageRehabilitationOperate";//康复计划完成时更新服务完成笔记和图片接口;
    private String updatePlanDetailStatusById = "/svr-specialist/updatePlanDetailStatusById";//康复管理-更新康复计划服务项目状态
    private String planSchedule = "/svr-specialist/planSchedule";//康复管理-计划总进度
    private String planListByPatient = "/svr-specialist/planListByPatient";//康复管理-根据居民获取康复计划
    private String patientCount = "/svr-specialist/patientCount";//康复管理-医生已计划数,已完成计划数(居民数)
    /************************************************************* end ************************************************************************/
    /**
@ -139,17 +161,19 @@ public class RehabilitationManageService extends BaseService {
     * @return
     * @throws Exception
     */
    public JSONObject findRehabilitationPlanDetailList(String doctorCode,String patientCode) throws Exception{
    public JSONArray findRehabilitationPlanDetailList(String doctorCode,String patientCode) throws Exception{
        Map<String, Object> param = new HashedMap();
        param.put("doctorCode", doctorCode);
        param.put("patientCode", patientCode);
        HttpResponse response = HttpUtils.doGet(specialistUrl + findRehabilitationPlanDetailList, param);
        JSONObject result = new JSONObject(response.getContent());
        if(result.getInt("status")==200){
            JSONObject jsonObject = result.getJSONObject("obj");
            Patient p = patientDao.findByCode(patientCode);
            jsonObject.put("patientPhoto",p.getPhoto());
            return jsonObject;
            JSONArray jsonArray = result.getJSONArray("obj");
            for(int i=0;i<jsonArray.length();i++){
                Patient p = patientDao.findByCode(patientCode);
                jsonArray.getJSONObject(i).put("patientPhoto",p.getPhoto());
            }
            return jsonArray;
        }
        throw new Exception("请求微服务失败!");
    }
@ -214,9 +238,10 @@ public class RehabilitationManageService extends BaseService {
     * @return
     * @throws Exception
     */
    public JSONArray serviceItemList(String planDetailIds) throws Exception{
    public JSONArray serviceItemList(String planDetailIds,String doctorCode) throws Exception{
        Map<String, Object> param = new HashedMap();
        param.put("planDetailIds", planDetailIds);
        param.put("doctorCode", doctorCode);
        HttpResponse response = HttpUtils.doGet(specialistUrl + serviceItemList, param);
        JSONObject result = new JSONObject(response.getContent());
        JSONArray jsonArray = null;
@ -244,9 +269,10 @@ public class RehabilitationManageService extends BaseService {
     * @return
     * @throws Exception
     */
    public JSONObject serviceItem(String planDetailId) throws Exception{
    public JSONObject serviceItem(String planDetailId,String doctorCode) throws Exception{
        Map<String, Object> param = new HashedMap();
        param.put("planDetailId", planDetailId);
        param.put("doctorCode", doctorCode);
        HttpResponse response = HttpUtils.doGet(specialistUrl + serviceItem, param);
        JSONObject result = new JSONObject(response.getContent());
        if(result.getInt("status")==200){
@ -315,7 +341,7 @@ public class RehabilitationManageService extends BaseService {
     * @throws Exception
     */
    public JSONObject patientRehabilitationDetail(String patientCode) throws Exception{
        Map<String, Object> param = new HashedMap();
        List<SignFamily> list = signFamilyDao.findByPatientAndExpensesStatusAndStatus(patientCode,"1",1);
        String healthDoctor = null;
        String healthDoctorName =null;
@ -325,6 +351,8 @@ public class RehabilitationManageService extends BaseService {
        Integer age = null;
        String sex = null;
        String signHospitalName = null;
        JSONObject json = null;
        Patient patient = patientDao.findByCode(patientCode);
        if(list.size()>0){
            SignFamily signFamily = list.get(0);
            healthDoctor = signFamily.getDoctorHealth();
@ -332,37 +360,56 @@ public class RehabilitationManageService extends BaseService {
            generalDoctor = signFamily.getDoctor();
            generalDoctorName = signFamily.getDoctorName();
            patientName = signFamily.getName();
            age = IdCardUtil.getAgeForIdcard(signFamily.getIdcard());
            sex = IdCardUtil.getSexForIdcard_new(signFamily.getIdcard());
            signHospitalName = signFamily.getHospitalName();
        }
        param.put("patientCode", patientCode);
        param.put("healthDoctor", healthDoctor);
        param.put("healthDoctorName", healthDoctorName);
        param.put("generalDoctor", generalDoctor);
        param.put("generalDoctorName", generalDoctorName);
        HttpResponse response = HttpUtils.doGet(specialistUrl + patientRehabilitationDetail, param);
        JSONObject result = new JSONObject(response.getContent());
        if(result.getInt("status")==200){
            JSONObject json = result.getJSONObject("obj").getJSONObject("patientInfo");
            json.put("patientName",patientName);
            json.put("age",age);
            json.put("sex",sex);
            json.put("healthyCondition","康复期");
            json.put("signHospitalName",signHospitalName);
            json.put("photo",patientDao.findByCode(patientCode).getPhoto());
            JSONArray jsonArray = result.getJSONObject("obj").getJSONArray("serviceDoctorList");
            String doctorCode ="";
            Doctor doctor = null;
            for(int i=0;i<jsonArray.length();i++){
                doctorCode = jsonArray.getJSONObject(i).get("doctorCode")+"";
                doctor = doctorDao.findByCode(doctorCode);
                jsonArray.getJSONObject(i).put("doctorPhoto",doctor!=null?doctor.getPhoto():"");
            Map<String, Object> param = new HashedMap();
            param.put("patientCode", patientCode);
            param.put("healthDoctor", healthDoctor);
            param.put("healthDoctorName", healthDoctorName);
            param.put("generalDoctor", generalDoctor);
            param.put("generalDoctorName", generalDoctorName);
            HttpResponse response = HttpUtils.doGet(specialistUrl + patientRehabilitationDetail, param);
            JSONObject result = new JSONObject(response.getContent());
            if(result.getInt("status")==200){
                json = result.getJSONObject("obj").getJSONObject("patientInfo");
                json.put("patientName",patientName);
                String healthyConditionSql =" select  label_name,label from wlyy_sign_patient_label_info where status=1 and patient='"+patientCode+"' and label_type=8";
                List<Map<String,Object>> healthyConditionList = jdbcTemplate.queryForList(healthyConditionSql);
                String healthyCondition = healthyConditionList.size()>0?healthyConditionList.get(0).get("label_name")+"":"";
                String healthyConditionType = healthyConditionList.size()>0?healthyConditionList.get(0).get("label")+"":"";
                json.put("healthyCondition",healthyCondition);
                json.put("healthyConditionType",healthyConditionType);
                json.put("signHospitalName",signHospitalName);
                age = IdCardUtil.getAgeForIdcard(patient.getIdcard());
                sex = IdCardUtil.getSexForIdcard_new(patient.getIdcard());
                json.put("patientCode", patientCode);
                json.put("patientName", patient.getName());
                json.put("age",age);
                json.put("sex",sex);
                json.put("photo",patient.getPhoto());
                json.put("mobile",patient.getMobile());
                JSONArray jsonArray = result.getJSONObject("obj").getJSONArray("serviceDoctorList");
                String doctorCode ="";
                Doctor doctor = null;
                for(int i=0;i<jsonArray.length();i++){
                    doctorCode = jsonArray.getJSONObject(i).get("doctorCode")+"";
                    doctor = doctorDao.findByCode(doctorCode);
                    jsonArray.getJSONObject(i).put("doctorPhoto",doctor!=null?doctor.getPhoto():"");
                }
                return result.getJSONObject("obj").put("patientInfo",json);
            }
            return result.getJSONObject("obj").put("patientInfo",json);
            throw new Exception("请求微服务失败!");
        }else{
            json = new JSONObject();
        }
        throw new Exception("请求微服务失败!");
        age = IdCardUtil.getAgeForIdcard(patient.getIdcard());
        sex = IdCardUtil.getSexForIdcard_new(patient.getIdcard());
        json.put("patientCode", patientCode);
        json.put("patientName", patient.getName());
        json.put("age",age);
        json.put("sex",sex);
        json.put("photo",patient.getPhoto());
        json.put("mobile",patient.getMobile());
        return new JSONObject().put("patientInfo",json) ;
    }
    /**
@ -390,8 +437,47 @@ public class RehabilitationManageService extends BaseService {
    public String createServiceQrCode(String planDetailId,String doctorCode) throws Exception{
        Map<String, Object> param = new HashedMap();
        String fileUrl = "";
        String sql ="SELECT service_qr_code FROM wlyy_specialist.wlyy_rehabilitation_plan_detail where id='"+planDetailId+"'";
        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
        if(list!=null && list.size()>0){
            fileUrl = String.valueOf(list.get(0).get("service_qr_code"));
        }
        if (StringUtils.isEmpty(fileUrl) || "null".equals(fileUrl)){
            //生成二维码图片
            String contentJsonStr="https://open.weixin.qq.com/connect/oauth2/authorize?appid="+appId+"&redirect_uri="+wechat_base_url+"/wx/html/kfgl/html/confirm-service.html"+"?paramStr="+planDetailId+","+doctorCode+"&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect";
            InputStream ipt = QrcodeUtil.createQrcode(contentJsonStr, 300, "png");
            if (isneiwang) {
                // 圖片列表
                List<String> tempPaths = new ArrayList<String>();
                try {
                    ObjectNode imgNode = FastDFSUtil.upload(ipt, "png", "plan_service_qrcode" + System.currentTimeMillis());
                    com.alibaba.fastjson.JSONObject json = com.alibaba.fastjson.JSONObject.parseObject(imgNode.toString());
                    tempPaths.add(json.getString("fid"));
                    String urls = "";
                    for (String image : tempPaths) {
                        if (urls.length() == 0) {
                            urls = image;
                        } else {
                            urls += "," + image;
                        }
                    }
                    fileUrl = fastdfs_file_url + urls;
                } catch (Exception e) {
                    e.printStackTrace();
                }
            } else {
                try {
                    fileUrl = fastdfs_file_url + CommonUtil.PrescriptionQRCodetoNeiWang(ipt);
                }catch (Exception e){
                    e.printStackTrace();
                }
            }
        }
        System.out.println("服务码-----------1"+fileUrl);
        param.put("planDetailId", planDetailId);
        param.put("doctorCode", doctorCode);
        param.put("imageUrl",fileUrl);
        //specialistUrl= "http://localhost:10051";
        HttpResponse response = HttpUtils.doPost(specialistUrl + createServiceQrCode, param);
        JSONObject result = new JSONObject(response.getContent());
@ -440,7 +526,15 @@ public class RehabilitationManageService extends BaseService {
        HttpResponse response = HttpUtils.doGet(specialistUrl + serviceDoctorList, param);
        JSONObject result = new JSONObject(response.getContent());
        if(result.getInt("status")==200){
            return result.getJSONArray("obj");
            JSONArray jsonArray = result.getJSONArray("obj");
            String doctorCode ="";
            Doctor doctor = null;
            for(int i=0;i<jsonArray.length();i++){
                doctorCode = jsonArray.getJSONObject(i).get("doctorCode")+"";
                doctor = doctorDao.findByCode(doctorCode);
                jsonArray.getJSONObject(i).put("doctorPhoto",doctor!=null?doctor.getPhoto():"");
            }
            return jsonArray;
        }
        throw new Exception("请求微服务失败!");
    }
@ -482,6 +576,18 @@ public class RehabilitationManageService extends BaseService {
        throw new Exception("请求微服务失败!");
    }
    public JSONArray dailyJobReserve(String startTime, String endTime) throws Exception{
        Map<String, Object> param = new HashedMap();
        param.put("startTime", startTime);
        param.put("endTime", endTime);
        HttpResponse response = HttpUtils.doGet(specialistUrl + dailyJobReserve, param);
        JSONObject result = new JSONObject(response.getContent());
        if(result.getInt("status")==200){
            return result.getJSONArray("obj");
        }
        throw new Exception("请求微服务失败!");
    }
    public JSONObject saveRehabilitationOperateRecord(String dataJson) throws Exception{
        Map<String, Object> param = new HashedMap();
@ -509,32 +615,44 @@ public class RehabilitationManageService extends BaseService {
        param.put("image", image);
        //specialistUrl= "http://localhost:10051";
        HttpResponse response = HttpUtils.doPost(specialistUrl + updateNoteAndImageRehabilitationOperate, param);
        System.out.println("返回数据=======1===="+response);
        JSONObject result = new JSONObject(response.getContent());
        if(result.getString("status").equals("200")){
            JSONArray array = result.getJSONArray("detailModelList");
            JSONObject object = array.getJSONObject(0);
        System.out.println("返回数据=======2===="+result);
        if(result.getInt("status") == 200){
            JSONObject object = result.getJSONObject("obj");
            //保存wlyy_message
            String hospotal = object.getString("hospital");
            String patient = object.getString("patient_code");
            String doctor = object.getString("doctor_code");
            Message message = new Message();
            message.setType(21);
            message.setSender(patient);
            message.setReceiver(doctor);
            message.setRelationCode(planDetailId);
            specialistEvaluateSevice.sendMessage(message,hospotal,patient,null);
            //发送微信模板消息
            int evaluation = object.getInt("evaluation");
            if (evaluation == 1){
                String serviceItemId = object.getString("serviceItemId");
                String doctor = object.getString("doctorCode");
                String patient = object.getString("patientCode");
                String serviceItemId = object.getString("service_item_id");
                String title = object.getString("title");
                Patient p = patientDao.findByCode(patient);
                Doctor doctor1 = doctorDao.findByCode(doctor);
                String patientName = p.getName();
                String openId = p.getOpenid();
                WechatTemplateConfig templateConfig = templateConfigDao.findByScene("template_doctor_survey","fwxmpj");
                WechatTemplateConfig templateConfig = templateConfigDao.findByScene("template_doctor_service","fwxmpj");
                String first = templateConfig.getFirst();
                first = first.replace("key1",(patientName==null?"":patientName));
                String keyword1 = templateConfig.getKeyword1();
                JSONObject json = new JSONObject();
                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
                json.put("keyword1", keyword1);
                json.put("keyword2", sdf.format(new Date()));
                json.put("keyword1", title);
                json.put("keyword2",doctor1.getName());
                json.put("keyword3", sdf.format(new Date()));
                json.put("toUser", p.getCode());
                json.put("represented",p.getCode());//被代理人
                json.put("remark", "");
                json.put("doctor",doctor);
                json.put("serviceItemId", serviceItemId);
                json.put("planIds", planDetailId);
                first = first.replace("key2",title);
                json.put("first", first);
                if(StringUtils.isNotBlank(p.getOpenid())){
@ -573,15 +691,18 @@ public class RehabilitationManageService extends BaseService {
        String doctor = "";
        String patient ="";
        Integer num = null;
        String planDetailIds = null;
        for(int i=0;i<jsonArray.length();i++){
            jsonObject = jsonArray.getJSONObject(i);
            doctor = jsonObject.get("doctor")+"";//执行的医生(接收的医生)
            patient = jsonObject.get("patient")+"";//执行的居民
            num = (Integer)jsonObject.get("num");//需要今日需要执行的项目数
            planDetailIds = jsonObject.get("planDetailIds")+"";
            Message message1 = new Message();
            message1.setSender(null);
//            message1.setSender(patient);
            message1.setType(type);
            message1.setReceiver(doctor);
            message1.setRelationCode(planDetailIds);
            specialistEvaluateSevice.sendMessage(message1,null,patient,num);
        }
    }
@ -624,8 +745,64 @@ public class RehabilitationManageService extends BaseService {
            json.put("patientPhoto",p.getPhoto());
            json.put("patientName",p.getName());
            json.put("patientCode",p.getCode());
            String healthyConditionSql =" select  label_name,label from wlyy_sign_patient_label_info where status=1 and patient='"+p.getCode()+"' and label_type=8";
            List<Map<String,Object>> healthyConditionList = jdbcTemplate.queryForList(healthyConditionSql);
            String healthyCondition = healthyConditionList.size()>0?healthyConditionList.get(0).get("label_name")+"":"";
            String healthyConditionType = healthyConditionList.size()>0?healthyConditionList.get(0).get("label")+"":"";
            json.put("healthyCondition",healthyCondition);
            json.put("healthyConditionType",healthyConditionType);
            return json;
        }
        throw new Exception("请求微服务失败!");
    }
    public JSONArray planListByPatient(String patient) throws Exception {
        Map<String, Object> param = new HashedMap();
        param.put("patientCode", patient);
        HttpResponse response = HttpUtils.doGet(specialistUrl + planListByPatient, param);
        if(StringUtils.isNotBlank(response.getContent())) {
            JSONObject result = new JSONObject(response.getContent());
            if(result.getInt("status")==200){
                return result.getJSONArray("obj");
            }
        }
        throw new Exception("请求微服务失败!");
    }
    public JSONObject patientCount(String doctorCode) throws Exception{
        Map<String, Object> param = new HashedMap();
        param.put("doctorCode", doctorCode);
        HttpResponse response = HttpUtils.doGet(specialistUrl + patientCount, param);
        JSONObject result = new JSONObject(response.getContent());
        if(result.getInt("status")==200){
            return result.getJSONObject("obj");
        }
        throw new Exception("请求微服务失败!");
    }
    public void dailyJobReserve(Integer num,Integer type) throws Exception{
        Long time = num*24*60*60*1000L;
        String startTime = DateUtil.dateToStrShort(new Date(new Date().getTime()+time))+" "+"00:00:00";
        String endTime = DateUtil.dateToStrShort(new Date(new Date().getTime()+time))+" "+"23:59:59";
        JSONArray jsonArray
                = dailyJobReserve(startTime,endTime);
        JSONObject jsonObject = null;
        String doctor = "";
        String patient ="";
        String hospital ="";
        String planDetailIds = null;
        for(int i=0;i<jsonArray.length();i++){
            jsonObject = jsonArray.getJSONObject(i);
            doctor = jsonObject.get("doctor")+"";//执行的医生(接收的医生)
            patient = jsonObject.get("patient")+"";//执行的居民
            hospital = jsonObject.get("hospital")+"";//医院
            planDetailIds = jsonObject.get("planDetailIds")+"";
            Message message1 = new Message();
//            message1.setSender(patient);
            message1.setType(type);
            message1.setReceiver(doctor);
            message1.setRelationCode(planDetailIds);
            specialistEvaluateSevice.sendMessage(message1,hospital,patient,num);
        }
    }
}

+ 21 - 12
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/specialist/rehabilitation/RehabilitationPlanService.java

@ -17,6 +17,7 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.HashSet;
import java.util.Map;
/**
@ -134,7 +135,7 @@ public class RehabilitationPlanService extends BaseService {
        return rs.getString("message");
    }
    public String createRehabilitationPlan(String json, Doctor doctor) {
    public String createRehabilitationPlan(String json, Doctor doctor) throws Exception {
        JSONObject object = new JSONObject(json);
        String patient = object.getString("patient");
        object.put("createUser", doctor.getCode());
@ -148,18 +149,26 @@ public class RehabilitationPlanService extends BaseService {
            e.printStackTrace();
        }
        JSONObject rs = new JSONObject(response.getContent());
        JSONArray detailModelList = (JSONArray) rs.get("detailModelList");
        //康复计划创建完给执行者发送消息
        for (Object obj : detailModelList){
            JSONObject detail = (JSONObject) obj;
            Message message = new Message();
            message.setSender(doctor.getCode());
            message.setType(19);
            message.setRelationCode(detail.getString("planId"));
            message.setReceiver(detail.getString("doctor"));
            specialistEvaluateSevice.sendMessage(message, detail.getString("hospital"), patient,null);
        if(rs.getInt("status") == 200) {
            HashSet set = new HashSet();
            JSONArray detailModelList = (JSONArray) rs.get("detailModelList");
            //康复计划创建完给执行者发送消息
            for (Object obj : detailModelList) {
                JSONObject detail = (JSONObject) obj;
                if (!set.contains(detail.getString("doctor"))) {
                    set.add(detail.getString("doctor"));
                    Message message = new Message();
                    message.setSender(doctor.getCode());
                    message.setType(19);
                    message.setRelationCode(detail.getString("planId"));
                    message.setReceiver(detail.getString("doctor"));
                    specialistEvaluateSevice.sendMessage(message, detail.getString("hospital"), patient, null);
                }
            }
            return rs.getString("message");
        }else {
            throw new Exception("请求微服务失败!");
        }
        return rs.getString("message");
    }
    public String deleteTemplate(String templateId) {

+ 3 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/template/DoctorGuidanceTempLableService.java

@ -47,7 +47,9 @@ public class DoctorGuidanceTempLableService extends BaseService {
        PageRequest pageRequest = new PageRequest(pageNo, pageSize,sort);
        Page<DoctorGuidanceTempLabel> page =  doctorGuidanceTempLableDao.findByTeamId(teamId,pageRequest);
        List<DoctorGuidanceTempLabel> newList = new ArrayList<>();
        newList.add(0,new DoctorGuidanceTempLabel("","未分组"));
        if(pageNo==0){
            newList.add(0,new DoctorGuidanceTempLabel("","未分组"));
        }
        newList.addAll(page.getContent());
        return newList;
    }

+ 6 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/task/PushMsgTask.java

@ -851,8 +851,8 @@ public class PushMsgTask {
                keyword2.setValue(json.getString("keyword2"));
                m.put("keyword2", keyword2);
            }else if (type==25){
                temp.setUrl(url + "yszx/html/manyidu.html?openid=" + openid + "&serviceItemId=" + json.getString("serviceItemId") + "&toUser=" + json.getString("toUser") + "&toName=" + name + "&represented=" + json.getString("represented")+"&doctor="+json.getString("doctor"));
                temp.setTemplate_id(template_doctor_survey);
                temp.setUrl(url + "kfgl/html/plan-item-detail.html?openid=" + openid + "&planIds=" + json.getString("planIds") + "&toUser=" + json.getString("toUser") + "&toName=" + name + "&represented=" + json.getString("represented")+"&doctor="+json.getString("doctor"));
                temp.setTemplate_id(template_doctor_service);
                WechatTemplateData keyword1 = new WechatTemplateData();
                keyword1.setColor("#000000");
                keyword1.setValue(json.getString("keyword1"));
@ -861,6 +861,10 @@ public class PushMsgTask {
                keyword2.setColor("#000000");
                keyword2.setValue(json.getString("keyword2"));
                m.put("keyword2", keyword2);
                WechatTemplateData keyword3 = new WechatTemplateData();
                keyword3.setColor("#000000");
                keyword3.setValue(json.getString("keyword3"));
                m.put("keyword3", keyword3);
            }
            temp.setData(m);

+ 0 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/util/CommonUtil.java

@ -5,7 +5,6 @@ import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.yihu.wlyy.util.fastdfs.FastDFSUtil;
import it.sauronsoftware.jave.*;
import net.sf.json.JSONObject;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;

+ 16 - 12
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/util/SystemDataRedis.java

@ -1,7 +1,7 @@
package com.yihu.wlyy.util;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.wlyy.entity.security.Token;
import net.sf.json.JSONObject;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -9,6 +9,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Component;
import java.text.SimpleDateFormat;
import java.util.Set;
/**
@ -22,6 +23,8 @@ public class SystemDataRedis {
    @Autowired
    private StringRedisTemplate redisTemplate;
    @Autowired
    private ObjectMapper objectMapper;
    /**
     * tokenTypeName
@ -37,7 +40,7 @@ public class SystemDataRedis {
     * 设置医生缓存
     * @param token
     */
    public String setDoctorToken(Token token){
    public String setDoctorToken(Token token) throws Exception{
        return setToken(doctorTokens,token);
    }
@ -45,7 +48,7 @@ public class SystemDataRedis {
     * 设置pc端缓存
     * @param token
     */
    public String setDoctorPCToken(Token token){
    public String setDoctorPCToken(Token token) throws Exception{
       return setToken(doctorPCTokens,token);
    }
@ -53,7 +56,7 @@ public class SystemDataRedis {
     * 设置居民缓存
     * @param token
     */
    public String setPatientToken(Token token){
    public String setPatientToken(Token token) throws Exception{
        return setToken(patientTokens,token);
    }
@ -61,7 +64,7 @@ public class SystemDataRedis {
     *  设置医生微信缓存
     * @param token
     */
    public String setDoctorWXToken(Token token){
    public String setDoctorWXToken(Token token) throws Exception{
        return setToken(doctorWXTokens,token);
    }
//====设置token==end===
@ -88,12 +91,12 @@ public class SystemDataRedis {
     * @param tokenTypeName
     * @param token
     */
    public String setToken(String tokenTypeName,Token token){
    public String setToken(String tokenTypeName,Token token) throws Exception{
        JSONObject json = JSONObject.fromObject(token);
        String tokenStr = objectMapper.writeValueAsString(token);
        String key = "token:"+tokenTypeName+":"+token.getUser();
        redisTemplate.opsForValue().set(key,json.toString());
        return json.toString();
        redisTemplate.opsForValue().set(key,tokenStr);
        return tokenStr;
    }
    /**
@ -105,9 +108,10 @@ public class SystemDataRedis {
    public Token getToken(String tokenTypeName,String uid) {
        try{
            //获取token
            String tokenJosn = redisTemplate.opsForValue().get("token:" + tokenTypeName + ":" + uid);
            if(StringUtils.isNotBlank(tokenJosn)){
                Token token = (Token)JSONObject.toBean(JSONObject.fromObject(tokenJosn),Token.class);
            String tokenJson = redisTemplate.opsForValue().get("token:" + tokenTypeName + ":" + uid);
            if(StringUtils.isNotBlank(tokenJson)){
                objectMapper.setDateFormat(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"));
                Token token = objectMapper.readValue(tokenJson, Token.class);
                return token;
            }
            return null;

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/account/LoginController.java

@ -565,7 +565,7 @@ public class LoginController extends BaseController {
    @RequestMapping(value = "setTokenTest", method = RequestMethod.POST)
    @ResponseBody
    public String setToken(String uid){
    public String setToken(String uid) throws Exception{
        Token token = new Token();
        token.setToken("123456");
        token.setDel("1");

+ 22 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/job/SpecialistRehabilitationJob.java

@ -43,4 +43,26 @@ public class SpecialistRehabilitationJob extends BaseController {
            return error(-1, "发送失败");
        }
    }
    @RequestMapping(value = "/dailyJobReserve", method = RequestMethod.POST)
    @ApiOperation("康复管理-10天、7天、5天、当天(0)康复服务预约复诊通知")
    @ObserverRequired
    public String dailyJobReserve(@ApiParam(name = "num", value = "10天、7天、5天、当天康复服务预约复诊通知", required = false)
                      @RequestParam(value = "num", required = false)Integer num){
        try {
            if(num!=null){
                rehabilitationManageService.dailyJobReserve(num,20);
            }else{
                Integer[] days = {10,7,5,0};
                for(Integer one : days){
                    rehabilitationManageService.dailyJobReserve(one,20);
                }
            }
            return write(200, "发送成功");
        } catch (Exception e) {
            error(e);
            return error(-1, "发送失败");
        }
    }
}

+ 1 - 9
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/messages/ImMessageController.java

@ -1,17 +1,12 @@
package com.yihu.wlyy.web.common.messages;
import com.yihu.wlyy.entity.consult.ConsultTeam;
import com.yihu.wlyy.entity.message.Message;
import com.yihu.wlyy.service.app.message.MessageService;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.json.JSONArray;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@ -19,9 +14,6 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.List;
import java.util.Map;
@Controller
@RequestMapping(value = "/im/common/message", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(description = "医生端-消息")
@ -36,7 +28,7 @@ public class ImMessageController extends BaseController {
    public String messages(@ApiParam(name = "type", value = "文章审核的时候必传,消息类型,14:提交文章审核,15:审核结果")
                               @RequestParam(value = "type", required = false,defaultValue = "15") Integer type) {
        try {
            JSONObject json = messageService.findDoctorAllMessage(getUID(),type);
            JSONObject json = messageService.findDoctorAllMessage(getUID(),type,1);
            return write(200, "获取消息总数成功!", "data", json);
        } catch (Exception e) {
            error(e);

+ 77 - 4
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/data/DataHandingService.java

@ -676,6 +676,7 @@ public class DataHandingService {
    @Transactional(rollbackFor = Exception.class)
    public void updateDeviceGrantDoctor()throws Exception{
        //取出所有符合逻辑的已发放的设备
        String sql ="SELECT" +
                " wd.device_code,s.* FROM device.wlyy_devices wd" +
                " LEFT JOIN (" +
@ -683,15 +684,61 @@ public class DataHandingService {
                " LEFT JOIN wlyy.wlyy_doctor d ON wat.leader_code = d.`code`" +
                " WHERE available = 1" +
                ") s ON wd.grant_admin_team = s.id" +
                " WHERE  wd.is_grant = 1 AND wd.grant_admin_team IN(SELECT id from wlyy.wlyy_admin_team where available=1)";
                " WHERE  wd.is_grant = 1 AND (wd.grant_doctor IS NULL OR wd.grant_doctor ='') AND wd.grant_admin_team IN(SELECT id from wlyy.wlyy_admin_team where available=1)";
        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
        //wlyy_patient_device取出对应的device_sn和doctor
        String patientDeviceSql ="SELECT device_sn,doctor,doctor_name FROM `wlyy_patient_device`  WHERE doctor IS NOT NULL and  doctor <> '' and category_code IN('1','2') GROUP BY device_sn";
        List<Map<String,Object>> patientDeviceList = jdbcTemplate.queryForList(patientDeviceSql);
        String patientDeviceLogSql ="SELECT s.* FROM" +
                "(SELECT device_sn, operator doctor, operator_name doctor_name FROM" +
                " wlyy_patient_device_log WHERE device_sn NOT IN (SELECT device_sn FROM wlyy_patient_device WHERE" +
                " category_code IN ('1', '2') AND doctor IS NOT NULL and doctor <> '' GROUP BY device_sn )" +
                " AND category_code IN ('1', '2')" +
                " AND operate_code = 1" +
                " AND is_del = 1" +
                " AND role = 1" +
                " ORDER BY" +
                " create_time" +
                " ) s" +
                " GROUP BY" +
                " s.device_sn";
        //List<Map<String,Object>> patientDeviceLogList = jdbcTemplate.queryForList(patientDeviceLogSql);
        patientDeviceList.addAll(jdbcTemplate.queryForList(patientDeviceLogSql));
        List<String> sqlList = new ArrayList<>();
        //设备列表和绑定关系列表比对,存入绑定医生的doctor,没有的存团队长
        for (Map<String,Object> map : list){
            String updateSql ="update device.wlyy_devices set grant_doctor='"+String.valueOf(map.get("code"))+"'," +
                    " grant_doctor_name='"+String.valueOf(map.get("name"))+"'"+
                    " where device_code='"+String.valueOf(map.get("device_code"))+"'";
            int count =0;
            String doctor = "";
            String doctorName="";
            String deviceCode = String.valueOf(map.get("device_code"));
            for (Map<String,Object> patientDeviceMap : patientDeviceList){
                if (deviceCode.equals(String.valueOf(patientDeviceMap.get("device_sn")))){
                    count++;
                    doctor=String.valueOf(patientDeviceMap.get("doctor"));
                    doctorName=String.valueOf(patientDeviceMap.get("doctor_name"));
                }
            }
            if (count==0){
                doctor = String.valueOf(map.get("code"));
                doctorName=String.valueOf(map.get("name"));
            }
            if (StringUtils.isEmpty(doctorName) || "null".equals(doctorName)){
                Doctor doctorDo = doctorDao.findByCode(doctor);
                if (doctorDo!=null){
                    doctorName = doctorDo.getName();
                }
            }
            String updateSql ="update device.wlyy_devices set grant_doctor='"+doctor+"'," +
                    " grant_doctor_name='"+doctorName+"'"+
                    " where device_code='"+deviceCode+"'";
            sqlList.add(updateSql);
        }
        String[] sqlStr = new String[sqlList.size()];
        sqlStr = sqlList.toArray(sqlStr);
        jdbcTemplate.batchUpdate(sqlStr);
@ -750,4 +797,30 @@ public class DataHandingService {
        }
        return result;
    }
    @Transactional(rollbackFor = Exception.class)
    public void addPatientDeviceDoctor()throws Exception{
        String patientDeviceSql="SELECT * FROM wlyy_patient_device WHERE doctor IS NULL OR doctor = ''";
        List<PatientDevice> patientDeviceList = jdbcTemplate.query(patientDeviceSql,new BeanPropertyRowMapper<>(PatientDevice.class));
        List<String> sqlList = new ArrayList<>();
        for (PatientDevice patientDevice : patientDeviceList){
            SignFamily signFamily = signFamilyDao.findByPatient(patientDevice.getUser());
            if (signFamily==null && signFamilyDao.findLastJySignByPatient(patientDevice.getUser(),2)!=null && signFamilyDao.findLastJySignByPatient(patientDevice.getUser(),2).size()>0){
                signFamily = signFamilyDao.findLastJySignByPatient(patientDevice.getUser(),2).get(0);
            }
            if (signFamily!=null){
                String doctorSql ="SELECT d.`code`,d.`name` FROM wlyy_admin_team wat LEFT JOIN wlyy_doctor d ON wat.leader_code = d.`code` WHERE wat.id='"+signFamily.getAdminTeamId()+"'";
                List<Map<String,Object>> doctorList = jdbcTemplate.queryForList(doctorSql);
                if (doctorList!=null && doctorList.size()>0){
                    String updateSql ="update wlyy_patient_device set doctor='"+String.valueOf(doctorList.get(0).get("code"))
                            +"',doctor_name='"+String.valueOf(doctorList.get(0).get("name"))+"' where id="+patientDevice.getId();
                    sqlList.add(updateSql);
                }
            }
        }
        String[] sqlStr = new String[sqlList.size()];
        sqlStr = sqlList.toArray(sqlStr);
        jdbcTemplate.batchUpdate(sqlStr);
    }
}

+ 13 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/data/DataHandlingController.java

@ -390,4 +390,17 @@ public class DataHandlingController extends BaseController {
        }
    }
    @RequestMapping(value = "/addPatientDeviceDoctor",method = RequestMethod.GET)
    @ResponseBody
    @ApiOperation("更新居民设备关系表中绑定医生字段")
    public String addPatientDeviceDoctor(){
        try{
            dataHandingService.addPatientDeviceDoctor();
            return write(200,"清洗数据成功");
        }catch (Exception e){
            System.out.println(e.getMessage());
            e.printStackTrace();
            return write(-1,"清洗数据失败!");
        }
    }
}

+ 7 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/jimeiJkEduPC/DoctorJMJkEduArticlePCController.java

@ -153,7 +153,13 @@ public class DoctorJMJkEduArticlePCController extends BaseController {
            //判断文章列表是否有推送过该居民
            if(StringUtils.isNotBlank(patient)){
                com.alibaba.fastjson.JSONArray pushresponse = jmJkEduArticleService.pushArticleLogs(0,0,patient,"");
                com.alibaba.fastjson.JSONArray pushresponse = null;
                try{
                    pushresponse = jmJkEduArticleService.pushArticleLogs(0,0,patient,"");
                }catch (Exception e){
                    pushresponse = new JSONArray();
                }
                Set<String> articleids = new HashSet<>();
                if(pushresponse.size() > 0)
                {

+ 116 - 4
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/message/DoctorMessageController.java

@ -52,9 +52,11 @@ public class DoctorMessageController extends BaseController {
    @ResponseBody
    @ApiOperation("查询医生未读消息和最后消息")
    public String messages(@ApiParam(name = "type", value = "文章审核的时候必传,消息类型,14:提交文章审核,15:审核结果")
                               @RequestParam(value = "type", required = false) Integer type) {
                               @RequestParam(value = "type", required = false) Integer type,
    @ApiParam(name = "flag", value = "标识家医/专科")
    @RequestParam(value = "flag", required = false) Integer flag) {
        try {
            JSONObject json = messageService.findDoctorAllMessage(getUID(),type);
            JSONObject json = messageService.findDoctorAllMessage(getUID(),type,flag);
            return write(200, "获取消息总数成功!", "data", json);
        } catch (Exception e) {
            error(e);
@ -421,6 +423,28 @@ public class DoctorMessageController extends BaseController {
        }
    }
    /**
     * 设置某条消息已读
     * @param id
     * @return
     */
    @RequestMapping(value = "setMessageReadedById")
    @ResponseBody
    @ApiOperation("设置某条消息已读")
    @ObserverRequired
    public String setMessageReadedById(@RequestParam @ApiParam(value = "消息id") Long id) {
        try {
            messageService.setMessageReadedById(getUID(), id);
            return write(200, "设置成功");
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1, "设置失败");
        }
    }
    @RequestMapping(value = "getMessageNoticeSetting",method = RequestMethod.GET)
    @ResponseBody
    @ApiOperation("获取消息设置")
@ -589,6 +613,66 @@ public class DoctorMessageController extends BaseController {
    }
    @RequestMapping(value = "getSpecialistMessages",method = RequestMethod.GET)
    @ApiOperation("专科医生待处理列表")
    @ResponseBody
    public String getSpecialistMessage(@ApiParam(name = "message",value = "消息对象")@RequestParam(value = "message")String message,
                                @ApiParam(name="page",value="第几页",defaultValue = "1") @RequestParam(value="page",required = true) String page,
                                @ApiParam(name="pageSize",value="",defaultValue = "10") @RequestParam(value="pageSize",required = true) String pageSize){
        if (StringUtils.isBlank(pageSize)) {
            pageSize = "10";
        }
        if (page.equals("0")) {
            page = "1";
        }
        Message message1 = new Message();
        com.alibaba.fastjson.JSONObject object = JSON.parseObject(message);
        message1.setOver(object.getString("over"));
        message1.setRead(object.getInteger("read"));
        message1.setReceiver(getUID());
        try {
            return write(200,"查询成功!","data",messageService.getSpecialistMessages(message1,Integer.valueOf(page),Integer.valueOf(pageSize)));
        }catch (Exception e){
            error(e);
            return error( -1, "查询失败!");
        }
    }
    /**
     * 转诊消息
     *
     * @param message
     * @param page
     * @param pageSize
     * @return
     */
    @RequestMapping(value = "getTransferMessage",method = RequestMethod.GET)
    @ApiOperation("转诊消息")
    @ResponseBody
    public String getTransferMessage(@ApiParam(name = "message",value = "消息对象")@RequestParam(value = "message")String message,
                                @ApiParam(name="page",value="第几页",defaultValue = "1") @RequestParam(value="page",required = true) String page,
                                @ApiParam(name="pageSize",value="",defaultValue = "10") @RequestParam(value="pageSize",required = true) String pageSize){
        if (StringUtils.isBlank(pageSize)) {
            pageSize = "10";
        }
        if (page.equals("0")) {
            page = "1";
        }
        Message message1 = new Message();
        com.alibaba.fastjson.JSONObject object = JSON.parseObject(message);
        message1.setOver(object.getString("over"));
        message1.setRead(object.getInteger("read"));
        message1.setReceiver(getUID());
        try {
            return write(200,"查询成功!","data",messageService.getTransferMessage(message1,Integer.valueOf(page),Integer.valueOf(pageSize)));
        }catch (Exception e){
            error(e);
            return error( -1, "查询失败!");
        }
    }
    /**
     * 发送消息 type:19 受理提醒,20 待办工作提醒 21 服务进展提醒-已完成 22 服务进展提醒-未完成
     *  message{sender:"",receiver:"",relationCode:""}
@ -634,18 +718,46 @@ public class DoctorMessageController extends BaseController {
    @ResponseBody
    @ApiOperation("一键已读" )
    public String setMessageRead(@ApiParam(name = "types",value = "消息集合")
                                     @RequestParam(value = "types")String types) {
                                     @RequestParam(value = "types")String types,
                                 @ApiParam(name = "flag",value = "标识家医/专科")
                                 @RequestParam(value = "flag")Integer flag) {
        try {
            com.alibaba.fastjson.JSONArray array = com.alibaba.fastjson.JSONArray.parseArray(types);
            List<Integer> typeList = new ArrayList<>();
            for (int i=0;i<array.size();i++){
                typeList.add(array.getInteger(i));
            }
            return write(200, "获取消息总数成功!", "data", messageService.setMessageReaded(getUID(),typeList));
            return write(200, "获取消息总数成功!", "data", messageService.setMessageReaded(getUID(),typeList,flag));
        } catch (Exception e) {
            error(e);
            return error(-1, e.getMessage());
        }
    }
    /**
     * 设置待办消息已处理
     *
     * @param id
     * @param type
     * @return
     */
    @RequestMapping(value = "setSpecialistOver",method = RequestMethod.POST)
    @ResponseBody
    @ApiOperation("设置待办消息已处理" )
    public String setSpecialistOver(@ApiParam(name = "id",value = "消息id")
                                 @RequestParam(value = "id")Long id,
                                    @ApiParam(name = "type",value = "消息类型")
                                    @RequestParam(value = "type")Integer type) {
        try {
            return write(200, "获取消息总数成功!", "data", messageService.setSpecialistOver(id,type));
        } catch (Exception e) {
            error(e);
            return error(-1, e.getMessage());
        }
    }
}

+ 14 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/specialist/SpecialistController.java

@ -333,9 +333,10 @@ public class SpecialistController extends WeixinBaseController {
    @RequestMapping(value = "/findDoctorAndDoctorHealthBySpecialDoctor", method = RequestMethod.GET)
    @ApiOperation(value = "获取当前专科医生有关联的家庭医生和健管师列表")
    public String findDoctorAndDoctorHealthBySpecialDoctor(
            @ApiParam(name = "doctor", value = "专科医生code") @RequestParam(required = true)String doctor){
            @ApiParam(name = "doctor", value = "专科医生code") @RequestParam(required = true)String doctor,
            @ApiParam(name = "name", value = "家庭医生姓名") @RequestParam(required = false)String name){
        try {
            return write(200, "获取成功", "data", specialistService.findDoctorAndDoctorHealthBySpecialDoctor(doctor));
            return write(200, "获取成功", "data", specialistService.findDoctorAndDoctorHealthBySpecialDoctor(doctor,name));
        } catch (Exception e) {
            error(e);
            return error(-1, "请求失败");
@ -392,4 +393,15 @@ public class SpecialistController extends WeixinBaseController {
        }
    }
    @RequestMapping(value = "/findPatientSignFamily", method = RequestMethod.GET)
    @ApiOperation(value = "获取居民所有专科医生签约信息")
    public String findPatientSignFamily(@ApiParam(name = "patient", value = "居民code") @RequestParam(required = true)String patient) throws Exception {
        try {
            return write(200, "获取成功", "data", specialistService.findPatientSignFamily(patient));
        } catch (Exception e) {
            error(e);
            return error(-1, "请求失败");
        }
    }
}

+ 42 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/specialist/SpecialistEvaluate1Controller.java

@ -0,0 +1,42 @@
package com.yihu.wlyy.web.doctor.specialist;/**
 * Created by nature of king on 2018/9/14.
 */
import com.yihu.wlyy.service.specialist.SpecialistEvaluateSevice;
import com.yihu.wlyy.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
/**
 * @author wangzhinan
 * @create 2018-09-14 0:09
 * @desc 医生评价
 **/
@RestController
@RequestMapping(value = "/doctor/specialist/evaluate", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(description = "专科医生-医生评价")
public class SpecialistEvaluate1Controller extends BaseController {
    @Autowired
    private SpecialistEvaluateSevice specialistEvaluateSevice;
    /**
     * 医生获取评分
     * @return
     */
    @RequestMapping(value = "/selectByDoctor",method = RequestMethod.POST)
    @ApiOperation("医生获取评分")
    public String selectByDoctor(){
        try {
            return write(200,"获取成功","data",specialistEvaluateSevice.selectByDoctor(getUID()));
        }catch (Exception e){
            error(e);
            return error(-1,e.getMessage());
        }
    }
}

+ 37 - 9
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/specialist/rehabilitation/DoctorRehabilitationManageController.java

@ -76,7 +76,7 @@ public class DoctorRehabilitationManageController extends BaseController {
            if(!StringUtils.isNotEmpty(doctorCode)){
                doctorCode = getRepUID();
            }
            JSONObject result = rehabilitationManageService.findRehabilitationPlanDetailList(doctorCode,patientCode);
            JSONArray result = rehabilitationManageService.findRehabilitationPlanDetailList(doctorCode,patientCode);
            return write(200, "获取成功", "data", result);
        } catch (Exception e) {
            error(e);
@ -93,7 +93,7 @@ public class DoctorRehabilitationManageController extends BaseController {
                                     @RequestParam(value = "executeEndTime", required = true)String executeEndTime,
                                     @ApiParam(name = "planId", value = "计划id", required = true)
                                     @RequestParam(value = "planId", required = true)String planId,
                                     @ApiParam(name = "searchTask", value = "快速查找任务:(1、我的任务,2、随访,3、复诊,4、健康教育)", required = false)
                                     @ApiParam(name = "searchTask", value = "快速查找任务:(1、我的任务,2、健康教育,3、健康指导,4、随访,5、复诊)", required = false)
                                     @RequestParam(value = "searchTask", required = false)Integer searchTask,
                                     @ApiParam(name = "doctorCode", value = "医生code(专科医生、家庭医生)", required = false)
                                     @RequestParam(value = "doctorCode", required = false)String doctorCode,
@ -120,7 +120,7 @@ public class DoctorRehabilitationManageController extends BaseController {
                                     @RequestParam(value = "executeEndTime", required = true)String executeEndTime,
                                     @ApiParam(name = "planId", value = "计划id", required = true)
                                     @RequestParam(value = "planId", required = true)String planId,
                                     @ApiParam(name = "searchTask", value = "快速查找任务:(1、我的任务,2、随访,3、复诊,4、健康教育)", required = false)
                                     @ApiParam(name = "searchTask", value = "快速查找任务:(1、我的任务,2、健康教育,3、健康指导,4、随访,5、复诊)", required = false)
                                     @RequestParam(value = "searchTask", required = false)Integer searchTask,
                                     @ApiParam(name = "doctorCode", value = "医生code(专科医生、家庭医生)", required = false)
                                     @RequestParam(value = "doctorCode", required = false)String doctorCode,
@ -142,10 +142,15 @@ public class DoctorRehabilitationManageController extends BaseController {
    @ApiOperation("康复管理-多个康复计划服务项目内容列表")
    @ObserverRequired
    public String serviceItemList(@ApiParam(name = "planDetailIds", value = "康复计划多个服务项目id(多个‘,’分隔)", required = true)
                                                   @RequestParam(value = "planDetailIds", required = true)String planDetailIds){
                                                   @RequestParam(value = "planDetailIds", required = true)String planDetailIds,
                                  @ApiParam(name = "doctorCode", value = "医生code", required = false)
                                  @RequestParam(value = "doctorCode", required = false)String doctorCode){
        try {
            JSONArray result = rehabilitationManageService.serviceItemList(planDetailIds);
            if(!StringUtils.isNotEmpty(doctorCode)){
                doctorCode = getRepUID();
            }
            JSONArray result = rehabilitationManageService.serviceItemList(planDetailIds,doctorCode);
            return write(200, "获取成功", "data", result);
        } catch (Exception e) {
            error(e);
@ -157,10 +162,15 @@ public class DoctorRehabilitationManageController extends BaseController {
    @ApiOperation("康复管理-康复计划服务项目确认详情页")
    @ObserverRequired
    public String serviceItem(@ApiParam(name = "planDetailId", value = "康复计划服务项目id", required = true)
                                  @RequestParam(value = "planDetailId", required = true)String planDetailId){
                              @RequestParam(value = "planDetailId", required = true)String planDetailId,
                              @ApiParam(name = "doctorCode", value = "医生code", required = false)
                              @RequestParam(value = "doctorCode", required = false)String doctorCode){
        try {
            JSONObject result = rehabilitationManageService.serviceItem(planDetailId);
            if(!StringUtils.isNotEmpty(doctorCode)){
                doctorCode = getRepUID();
            }
            JSONObject result = rehabilitationManageService.serviceItem(planDetailId,doctorCode);
            return write(200, "获取成功", "data", result);
        } catch (Exception e) {
            error(e);
@ -340,8 +350,8 @@ public class DoctorRehabilitationManageController extends BaseController {
    @ApiOperation("康复管理-康复计划完成时更新服务完成笔记和图片接口并且确认完成")
    @ObserverRequired
    public String updateNoteAndImageRehabilitationOperate(@ApiParam(name = "planDetailId", value = "康复计划项目明细ID")@RequestParam(value = "planDetailId", required = true)String planDetailId,
                                                          @ApiParam(name = "node", value = "服务完成笔记", required = false)@RequestParam(value = "node", required = true)String node,
                                                          @ApiParam(name = "image", value = "相关记录图片,json格式", required = false)@RequestParam(value = "image", required = true)String image){
                                                          @ApiParam(name = "node", value = "服务完成笔记", required = false)@RequestParam(value = "node", required = false)String node,
                                                          @ApiParam(name = "image", value = "相关记录图片,json格式", required = false)@RequestParam(value = "image", required = false)String image){
        try {
            JSONObject result = rehabilitationManageService.updateNodeAndRelationRecordImg(planDetailId, node, image);
@ -406,4 +416,22 @@ public class DoctorRehabilitationManageController extends BaseController {
            return error(-1, "请求失败");
        }
    }
    @RequestMapping(value = "patientCount", method = RequestMethod.GET)
    @ApiOperation("医生已计划数,已完成计划数(居民数)")
    @ObserverRequired
    public String patientCount(@ApiParam(name = "doctorCode", value = "医生code", required = false)
                                                   @RequestParam(value = "doctorCode", required = false)String doctorCode){
        try {
            if(!StringUtils.isNotEmpty(doctorCode)){
                doctorCode = getRepUID();
            }
            JSONObject result = rehabilitationManageService.patientCount(doctorCode);
            return write(200, "获取成功", "data", result);
        } catch (Exception e) {
            error(e);
            return error(-1, "请求失败");
        }
    }
}

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/family/FamilyMemberController.java

@ -235,7 +235,7 @@ public class FamilyMemberController extends WeixinBaseController {
    @ApiOperation(value = "家庭成员(有授权)查询")
    public String getAuthorizeFamilyMembers(){
        try {
            JSONArray result = familyMemberService.getAuthorizeMembers(getLastUid());
            JSONArray result = familyMemberService.getAuthorizeMembers(getUID());
            return write(200, "查询成功", "data", result);
        } catch (Exception e) {

+ 1 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/specialist/SpecialistEvaluateController.java

@ -85,4 +85,5 @@ public class SpecialistEvaluateController extends WeixinBaseController {
            return error(-1,e.getMessage());
        }
    }
}

+ 24 - 12
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/specialist/rehabilitation/PatientRehabilitationManageController.java

@ -51,14 +51,13 @@ public class PatientRehabilitationManageController extends BaseController {
    @RequestMapping(value = "calendarPlanDetail", method = RequestMethod.GET)
    @ApiOperation("康复管理-康复计划按日历展示")
    @ObserverRequired
    public String calendarPlanDetail(@ApiParam(name = "executeStartTime", value = "日历开始时间(格式:yyyy-MM-dd HH:mm:ss)", required = true)
                                     @RequestParam(value = "executeStartTime", required = true)String executeStartTime,
                                     @ApiParam(name = "executeEndTime", value = "日历结束时间(格式:yyyy-MM-dd HH:mm:ss)", required = true)
                                     @RequestParam(value = "executeEndTime", required = true)String executeEndTime,
                                     @ApiParam(name = "planId", value = "计划id", required = true)
                                     @RequestParam(value = "planId", required = true)String planId,
                                     @ApiParam(name = "searchTask", value = "快速查找任务:(1、我的任务,2、随访,3、复诊,4、健康教育)", required = false)
                                     @ApiParam(name = "searchTask", value = "快速查找任务:(1、我的任务,2、健康教育,3、复诊,4、随访)", required = false)
                                     @RequestParam(value = "searchTask", required = false)Integer searchTask,
                                     @ApiParam(name = "status", value = "任务状态(0未完成,1已完成,2已预约)", required = false)
                                     @RequestParam(value = "status", required = false)Integer status){
@ -86,14 +85,13 @@ public class PatientRehabilitationManageController extends BaseController {
    @RequestMapping(value = "calendarPlanDetailList", method = RequestMethod.GET)
    @ApiOperation("康复管理-康复计划按列表展示")
    @ObserverRequired
    public String calendarPlanDetailList(@ApiParam(name = "executeStartTime", value = "日历开始时间(格式:yyyy-MM-dd HH:mm:ss)", required = true)
                                         @RequestParam(value = "executeStartTime", required = true)String executeStartTime,
                                         @ApiParam(name = "executeEndTime", value = "日历结束时间(格式:yyyy-MM-dd HH:mm:ss)", required = true)
                                         @RequestParam(value = "executeEndTime", required = true)String executeEndTime,
                                         @ApiParam(name = "planId", value = "计划id", required = true)
                                         @RequestParam(value = "planId", required = true)String planId,
                                         @ApiParam(name = "searchTask", value = "快速查找任务:(1、我的任务,2、随访,3、复诊,4、健康教育)", required = false)
                                         @ApiParam(name = "searchTask", value = "快速查找任务:(1、我的任务,2、健康教育,3、复诊,4、随访)", required = false)
                                         @RequestParam(value = "searchTask", required = false)Integer searchTask,
                                         @ApiParam(name = "status", value = "任务状态(0未完成,1已完成,2已预约)", required = false)
                                         @RequestParam(value = "status", required = false)Integer status){
@ -108,7 +106,6 @@ public class PatientRehabilitationManageController extends BaseController {
    @RequestMapping(value = "sendMessageIm", method = RequestMethod.POST)
    @ApiOperation("康复管理-扫描二维码发送消息")
    @ObserverRequired
    public String sendMessageIm(@ApiParam(name = "sendId", value = "发送者id")@RequestParam(value = "sendId", required = true)String sendId,
                                @ApiParam(name = "receiverId", value = "接受者id", required = true)@RequestParam(value = "receiverId", required = true)String receiverId,
                                @ApiParam(name = "content", value = "内容", required = true)@RequestParam(value = "content", required = true)String content){
@ -124,7 +121,6 @@ public class PatientRehabilitationManageController extends BaseController {
    @RequestMapping(value = "checkAfterQrCode", method = RequestMethod.POST)
    @ApiOperation("康复管理-居民扫码后验证是否是关联的居民扫码")
    @ObserverRequired
    public String checkAfterQrCode(@ApiParam(name = "planDetailId", value = "康复计划项目明细ID")@RequestParam(value = "planDetailId", required = true)String planDetailId,
                                   @ApiParam(name = "patientCode", value = "居民端登录的居民code")@RequestParam(value = "patientCode", required = true)String patientCode){
@ -139,7 +135,6 @@ public class PatientRehabilitationManageController extends BaseController {
    @RequestMapping(value = "saveRehabilitationOperateRecord", method = RequestMethod.POST)
    @ApiOperation("康复管理-新增operateRecord")
    @ObserverRequired
    public String saveRehabilitationOperateRecord(@ApiParam(name = "dataJson", value = "实体json",defaultValue = "{\"rehabilitationDetailId\":\"402803f6657f195301657f4fbd3c0001\",\"patientCode\":\"00\",\"patientName\":\"11\",\"doctorCode\":\"22\",\"doctorName\":\"33\",\"node\":\"jjjjjj\",\"relationRecordType\":\"4\",\"relation_record_code\":\"55\",\"relationRecordImg\":\"666666\",\"status\":\"0\"}")@RequestParam(value = "dataJson", required = true)String dataJson){
        try {
@ -157,7 +152,6 @@ public class PatientRehabilitationManageController extends BaseController {
    @RequestMapping(value = "recentPlanDetailRecord", method = RequestMethod.GET)
    @ApiOperation("康复管理-近期康复相关记录")
    @ObserverRequired
    public String recentPlanDetailRecord(@ApiParam(name = "patientCode", value = "居民code", required = false)
                                         @RequestParam(value = "patientCode", required = false)String patientCode,
                                         @ApiParam(name = "startTime", value = "开始时间(格式:yyyy-MM-dd HH:mm:ss)", required = false)
@ -183,12 +177,11 @@ public class PatientRehabilitationManageController extends BaseController {
    @RequestMapping(value = "serviceItemList", method = RequestMethod.GET)
    @ApiOperation("康复管理-多个康复计划服务项目内容列表")
    @ObserverRequired
    public String serviceItemList(@ApiParam(name = "planDetailIds", value = "康复计划多个服务项目id(多个‘,’分隔)", required = true)
                                  @RequestParam(value = "planDetailIds", required = true)String planDetailIds){
        try {
            JSONArray result = rehabilitationManageService.serviceItemList(planDetailIds);
            JSONArray result = rehabilitationManageService.serviceItemList(planDetailIds,null);
            return write(200, "获取成功", "data", result);
        } catch (Exception e) {
            error(e);
@ -198,16 +191,35 @@ public class PatientRehabilitationManageController extends BaseController {
    @RequestMapping(value = "serviceItem", method = RequestMethod.GET)
    @ApiOperation("康复管理-康复计划服务项目确认详情页")
    @ObserverRequired
    public String serviceItem(@ApiParam(name = "planDetailId", value = "康复计划服务项目id", required = true)
                              @RequestParam(value = "planDetailId", required = true)String planDetailId){
        try {
            JSONObject result = rehabilitationManageService.serviceItem(planDetailId);
            JSONObject result = rehabilitationManageService.serviceItem(planDetailId,null);
            return write(200, "获取成功", "data", result);
        } catch (Exception e) {
            error(e);
            return error(-1, "请求失败");
        }
    }
    @RequestMapping(value = "planSchedule", method = RequestMethod.GET)
    @ApiOperation("康复管理-计划总进度")
    @ObserverRequired
    public String planSchedule(@ApiParam(name = "planId", value = "计划id", required = true)
                               @RequestParam(value = "planId", required = true)String planId,
                               @ApiParam(name = "patientCode", value = "居民code", required = false)
                               @RequestParam(value = "patientCode", required = false)String patientCode){
        try {
            if(!StringUtils.isNotEmpty(patientCode)){
                patientCode = getRepUID();
            }
            JSONObject result = rehabilitationManageService.planSchedule(planId,patientCode);
            return write(200, "获取成功!", "data", result);
        } catch (Exception e) {
            error(e);
            return error(-1, "请求失败");
        }
    }
}

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/zysoft/BookingController.java

@ -678,7 +678,7 @@ public class BookingController extends WeixinBaseController {
                        json.put("date", DateUtil.dateToStrLong(obj.getStartTime()));
                        json.put("orgName", obj.getOrgName());
                        json.put("orgCode", obj.getOrgCode());
                        json.put("doctorName", obj.getDeptName());
                        json.put("doctorName", obj.getDoctorName());
                        json.put("deptName", obj.getDeptName());
//                        json.put("remark", patientName + ",您好!\n" + msg);
                        json.put("remark", remark);

+ 3 - 3
patient-co/patient-co-wlyy/src/main/resources/application-devtest.yml

@ -189,8 +189,8 @@ es:
jkEdu:
  web:
#    articleBaseUrl: http://yihu.com:9088/
    articleBaseUrl: http://172.19.103.78:9092/
#    articleBaseUrl: http://172.19.103.87:9088/
#    articleBaseUrl: http://172.19.103.78:9092/
    articleBaseUrl: http://172.19.103.87:9088/
#消息队列
activemq:
@ -205,7 +205,7 @@ activemq:
##如果是外网项目就是flase 内网是true
neiwang:
  enable: true
  wlyy: http://localhost:8081
  wlyy: http://172.19.103.54:22122/
#系统中使用的双层对称加密使用到的KEY
Riva:

+ 44 - 74
patient-co/patient-co-wlyy/src/main/resources/wechat/weixin_menu.txt

@ -2,93 +2,63 @@
"button":[
   {
	  "name":"家庭医生",
	  "sub_button":[
	      {
            "type":"view",
           	"name":"健康评估",
           	"url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appId&redirect_uri=server_url%2fwx%2fhtml%2fjkpg%2fhtml%2fjkpg.html&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
          },
		  {
			"type":"view",
			"name":"签约管理",
			"url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appId&redirect_uri=server_url%2fwx%2fhtml%2fqygl%2fhtml%2fsigning_management.html&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
		  },
		  {
			"type":"view",
			"name":"医生咨询",
			"url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appId&redirect_uri=server_url%2fwx%2fhtml%2fyszx%2fhtml%2fdoctor-consultation.html&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
		  },
		  {
			"type":"view",
			"name":"医生指导",
			"url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appId&redirect_uri=server_url%2fwx%2fhtml%2fyszd%2fhtml%2fdoctor-guidance.html&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
		  },
		  {
            "type":"view",
            "name":"健教文库",
            "url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appId&redirect_uri=server_url%2fwx%2fhtml%2fjkjy%2fhtml%2farticle_list.html&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
          }
	  ]
	  "type":"view",
      "url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appId&redirect_uri=server_url%2fwx%2fhtml%2fhome%2fhtml%2findex.html&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
   },
   {
	  "name":"健康管理",
	  "name":"快捷服务",
	  "sub_button":[
		 {
			  "type":"view",
			  "name":"预约挂号",
			  "url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appId&redirect_uri=server_url%2fwx%2fhtml%2fwdyy%2fhtml%2fappointment-register.html&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
		 },
         		"type":"view",
         		"name":"预约挂号",
         		"url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appId&redirect_uri=server_url%2fwx%2fhtml%2fwdyy%2fhtml%2fappointment-register.html&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
         },
		 {
               "type":"view",
               "name":"健康记录",
               "url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appId&redirect_uri=server_url%2fwx%2fhtml%2fjkjl%2fhtml%2fhealth-record.html&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
            	"type":"view",
         	    "name":"医生咨询",
         		"url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appId&redirect_uri=server_url%2fwx%2fhtml%2fyszx%2fhtml%2fdoctor-consultation.html&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
         },
		 {
                "type":"view",
               	"name":"健康评估",
               	"url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appId&redirect_uri=server_url%2fwx%2fhtml%2fjkpg%2fhtml%2fjkpg.html&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
         },
         {
                "type":"view",
                "name":"康复管理",
                "url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appId&redirect_uri=server_url%2fwx%2fhtml%2fkfgl%2fhtml%2frecover_manage.html&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
         },
		{
			"type":"click",
			"name":"健康档案",
			"key":"jiankangdangan"
		},
         {
            "type":"view",
            "name":"慢病管理",
            "url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appId&redirect_uri=server_url%2fwx%2fhtml%2fjbsq%2fhtml%2fslow-disease-manage.html&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
                  },
        {
            "type":"click",
            "name":"妇幼保健",
            "key":"fuyoubaojian"
        }
                "type":"view",
                "name":"慢病管理",
                "url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appId&redirect_uri=server_url%2fwx%2fhtml%2fjbsq%2fhtml%2fslow-disease-manage.html&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
         }
	  ]
   },
   {
	  "name":"我的",
	  "sub_button":[
		{
           "type":"view",
           "name":"电子健康卡",
           "url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appId&redirect_uri=server_url%2fwx%2fhtml%2fgrzx%2fhtml%2fmy-health-card.html&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
        },
		{
		   "type":"view",
		   "name":"我的资料",
		   "url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appId&redirect_uri=server_url%2fwx%2fhtml%2fgrzx%2fhtml%2fmy-detail.html&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
		},
        {
           "type":"view",
           "name":"我的家庭",
           "url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appId&redirect_uri=server_url%2fwx%2fhtml%2fjtgx%2fhtml%2ffamily.html&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
        },
		{
		   "type":"view",
		   "name":"我的设备",
		   "url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appId&redirect_uri=server_url%2fwx%2fhtml%2fwdsb%2fhtml%2fmy-equipments.html&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
		},
		{
		   "type":"view",
		   "name":"健康银行",
		   "url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appId&redirect_uri=server_url%2fwx%2fhtml%2fjkjf%2fhtml%2funopened.html&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
		}
		 {
                "type":"view",
                "name":"电子健康卡",
                "url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appId&redirect_uri=server_url%2fwx%2fhtml%2fgrzx%2fhtml%2fmy-health-card.html&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
         },
         {
        		"type":"view",
        		"name":"我的资料",
        		"url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appId&redirect_uri=server_url%2fwx%2fhtml%2fgrzx%2fhtml%2fmy-detail.html&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
         },
		 {
        	    "type":"view",
        	    "name":"健康银行",
        	    "url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appId&redirect_uri=server_url%2fwx%2fhtml%2fjkjf%2fhtml%2funopened.html&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
         },
         {
                "type":"click",
                "name":"用户指南",
                "key":"caozuoshuoming"
         }
	 ]
  }
]

+ 51 - 78
patient-co/patient-co-wlyy/src/main/resources/wechat/weixin_menu_jimei.txt

@ -2,96 +2,69 @@
"button":[
   {
	  "name":"家庭医生",
	  "sub_button":[
	      {
            "type":"view",
            "name":"健康评估",
            "url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appId&redirect_uri=server_url%2fwx%2fhtml%2fjkpg%2fhtml%2fjkpg.html&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
          },
		  {
			"type":"view",
			"name":"签约管理",
			"url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appId&redirect_uri=server_url%2fwx%2fhtml%2fqygl%2fhtml%2fsigning_management.html&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
		  },
		  {
			"type":"view",
			"name":"医生咨询",
			"url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appId&redirect_uri=server_url%2fwx%2fhtml%2fyszx%2fhtml%2fdoctor-consultation.html&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
		  },
		  {
			"type":"view",
			"name":"医生指导",
			"url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appId&redirect_uri=server_url%2fwx%2fhtml%2fyszd%2fhtml%2fdoctor-guidance.html&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
		  },
		  {
            "type":"view",
            "name":"健康文章",
            "url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appId&redirect_uri=server_url%2fwx%2fhtml%2fjkjy%2fhtml%2farticle_list.html&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
          }
	  ]
	  "type":"view",
      "url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appId&redirect_uri=server_url%2fwx%2fhtml%2fhome%2fhtml%2findex.html&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
   },
   {
	  "name":"健康管理",
	  "name":"快捷服务",
	  "sub_button":[
		 {
			  "type":"view",
			  "name":"预约挂号",
			  "url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appId&redirect_uri=server_url%2fwx%2fhtml%2fwdyy%2fhtml%2fappointment-register.html&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
		 },
         		"type":"view",
         		"name":"预约挂号",
         		"url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appId&redirect_uri=server_url%2fwx%2fhtml%2fwdyy%2fhtml%2fappointment-register.html&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
         },
		 {
            	"type":"view",
         	    "name":"医生咨询",
         		"url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appId&redirect_uri=server_url%2fwx%2fhtml%2fyszx%2fhtml%2fdoctor-consultation.html&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
         },
		 {
               "type":"view",
               "name":"健康记录",
               "url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appId&redirect_uri=server_url%2fwx%2fhtml%2fjkjl%2fhtml%2fhealth-record.html&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
                "type":"view",
               	"name":"健康评估",
               	"url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appId&redirect_uri=server_url%2fwx%2fhtml%2fjkpg%2fhtml%2fjkpg.html&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
         },
         {
                "type":"view",
                "name":"康复管理",
                "url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appId&redirect_uri=server_url%2fwx%2fhtml%2fkfgl%2fhtml%2frecover_manage.html&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
         },
		{
			"type":"click",
			"name":"健康档案",
			"key":"jiankangdangan"
		},
         {
            "type":"view",
            "name":"疾病社区",
            "url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appId&redirect_uri=server_url%2fwx%2fhtml%2fjbsq%2fhtml%2fdisease-community.html&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
        },
        {
                    "type":"click",
                    "name":"妇幼保健",
                    "key":"fuyoubaojian"
        }
                "type":"view",
                "name":"慢病管理",
                "url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appId&redirect_uri=server_url%2fwx%2fhtml%2fjbsq%2fhtml%2fslow-disease-manage.html&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
         }
	  ]
   },
   {
	  "name":"我的",
	  "sub_button":[
		{
		   "type":"view",
		   "name":"集美家签特色",
		   "url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appId&redirect_uri=server_url%2fwx%2fhtml%2fdist%2fhtml%2fexclusive-service.html&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
		},
		{
           "type":"view",
           "name":"电子健康卡",
           "url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appId&redirect_uri=server_url%2fwx%2fhtml%2fgrzx%2fhtml%2fmy-health-card.html&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
        },
		{
		   "type":"view",
		   "name":"我的资料",
		   "url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appId&redirect_uri=server_url%2fwx%2fhtml%2fgrzx%2fhtml%2fmy-detail.html&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
		},
        {
           "type":"view",
           "name":"我的家庭",
           "url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appId&redirect_uri=server_url%2fwx%2fhtml%2fjtgx%2fhtml%2ffamily.html&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
        },
		{
		   "type":"view",
		   "name":"我的设备",
		   "url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appId&redirect_uri=server_url%2fwx%2fhtml%2fwdsb%2fhtml%2fmy-equipments.html&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
		}
	     {
         		"type":"view",
         		"name":"集美家签特色",
         		"url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appId&redirect_uri=server_url%2fwx%2fhtml%2fdist%2fhtml%2fexclusive-service.html&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
         },
		 {
                "type":"view",
                "name":"电子健康卡",
                "url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appId&redirect_uri=server_url%2fwx%2fhtml%2fgrzx%2fhtml%2fmy-health-card.html&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
         },
         {
        		"type":"view",
        		"name":"我的资料",
        		"url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appId&redirect_uri=server_url%2fwx%2fhtml%2fgrzx%2fhtml%2fmy-detail.html&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
         },
		 {
        	    "type":"view",
        	    "name":"健康银行",
        	    "url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appId&redirect_uri=server_url%2fwx%2fhtml%2fjkjf%2fhtml%2funopened.html&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
         },
         {
                "type":"click",
                "name":"用户指南",
                "key":"caozuoshuoming"
         }
	 ]
  }],
    "matchrule":{
      "tag_id":"103"
      }
  }
]
}