Browse Source

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

humingfen 4 years ago
parent
commit
a9ff999996

+ 2 - 0
business/base-service/src/main/java/com/yihu/jw/org/dao/BaseOrgDao.java

@ -43,6 +43,8 @@ public interface BaseOrgDao extends PagingAndSortingRepository<BaseOrgDO, String
    @Query("select code as code,name as name from BaseOrgDO where del = 1")
    List<Map<String,Object>> findOrgListBySaasId();
    @Query("select a from BaseOrgDO a where a.del = '1'")
    List<BaseOrgDO> findByAll();
    List<BaseOrgDO> findByCityCode(String cityCode);

+ 8 - 0
svr/svr-door-serivce/sql/初始sql.sql

@ -614,6 +614,14 @@ INSERT INTO `base`.`base_system_dict_entry` (`id`, `saas_id`, `dict_code`, `code
INSERT INTO `base`.`base_system_dict_entry` (`id`, `saas_id`, `dict_code`, `code`, `py_code`, `value`, `sort`, `remark`) VALUES ('8', NULL, 'PROFESSIONAL_STATE', '7', '1', '不便分类的其他从业人员', '8', NULL);
INSERT INTO `base`.`base_system_dict_entry` (`id`, `saas_id`, `dict_code`, `code`, `py_code`, `value`, `sort`, `remark`) VALUES ('9', NULL, 'PROFESSIONAL_STATE', '8', '1', '无职业', '9', NULL);
INSERT INTO `base`.`base_system_dict_entry` (`id`, `saas_id`, `dict_code`, `code`, `py_code`, `value`, `sort`, `remark`) VALUES ('10', NULL, 'door_service_subject_class_dict', '4', '4', '检验费', '1', '上门服务项类型');
INSERT INTO `base`.`base_system_dict_entry` (`id`, `saas_id`, `dict_code`, `code`, `py_code`, `value`, `sort`, `remark`) VALUES ('11', NULL, 'door_service_subject_class_dict', '28', '28', '检查费', '2', NULL);
INSERT INTO `base`.`base_system_dict_entry` (`id`, `saas_id`, `dict_code`, `code`, `py_code`, `value`, `sort`, `remark`) VALUES ('12', NULL, 'door_service_subject_class_dict', '89', '89', '护理费', '3', NULL);
INSERT INTO `base`.`base_system_dict_entry` (`id`, `saas_id`, `dict_code`, `code`, `py_code`, `value`, `sort`, `remark`) VALUES ('13', NULL, 'door_service_subject_class_dict', '148', '148', '推拿', '4', NULL);
INSERT INTO `base`.`base_system_dict_entry` (`id`, `saas_id`, `dict_code`, `code`, `py_code`, `value`, `sort`, `remark`) VALUES ('14', NULL, 'door_service_subject_class_dict', '149', '149', '针灸', '5', NULL);
CREATE TABLE `wlyy_doctor_quick_reply` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `doctor` varchar(50) NOT NULL COMMENT '医生',

+ 13 - 0
svr/svr-door-serivce/src/main/java/com/yihu/jw/door/controller/doctor/DoctorController.java

@ -115,6 +115,19 @@ public class DoctorController extends BaseController {
        }
    }
    @GetMapping(value = "getHospitals")
    @ApiOperation("获取医院")
    public String getHospitals() {
        try {
            List<BaseOrgDO> orgDOs = orgDao.findByAll();
            return write(200, "查询成功", "data", orgDOs);
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败");
        }
    }
    /**
     * 医生基本信息查询接口
     *

+ 65 - 11
svr/svr-door-serivce/src/main/java/com/yihu/jw/door/controller/doctor/DoorOrderController.java

@ -11,6 +11,7 @@ import com.yihu.jw.door.service.WlyyDoorServiceOrderService;
import com.yihu.jw.door.service.common.HospitalService;
import com.yihu.jw.door.service.common.ServerPackageService;
import com.yihu.jw.door.service.prescription.JwDoorPrescriptionService;
import com.yihu.jw.door.util.StreamUtil;
import com.yihu.jw.entity.door.WlyyDoorConclusionDO;
import com.yihu.jw.entity.door.WlyyDoorServiceOrderDO;
import com.yihu.jw.restmodel.ResponseContant;
@ -28,10 +29,7 @@ import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.IOException;
import java.io.OutputStream;
import java.io.*;
import java.net.URLEncoder;
import java.util.*;
@ -429,7 +427,7 @@ public class DoorOrderController extends BaseController {
    }
    @ApiOperation("导出工单到excel")
    @GetMapping(value = "/doorOrderOutExcel")
    @GetMapping(value = "excelControl/doorOrderOutExcel")
    public void doorOrderOutExcel(
            @ApiParam(value = "工单id", name = "orderId",required = false)
            @RequestParam(value = "orderId", required = false) String orderId,
@ -440,7 +438,7 @@ public class DoorOrderController extends BaseController {
            @ApiParam(value = "服务机构", name = "hospitalCode",required = false)
            @RequestParam(value = "hospitalCode", required = false) String hospitalCode,
            @ApiParam(value = "工单状态", name = "status",required = false)
            @RequestParam(value = "status", required = false) Integer status,
            @RequestParam(value = "status", required = false) Integer[] status,
            @ApiParam(value = "创建时间开始,格式(yyyy-MM-dd mm:dd:ss)", name = "createTimeStart",required = false)
            @RequestParam(value = "createTimeStart", required = false) String createTimeStart,
            @ApiParam(value = "创建时间结束,格式(yyyy-MM-dd mm:dd:ss)", name = "createTimeEnd",required = false)
@ -1230,7 +1228,7 @@ public class DoorOrderController extends BaseController {
    }
    @ApiOperation("导出服务小结到word")
    @RequestMapping(value = "exportConclusion", method = RequestMethod.GET)
    @RequestMapping(value = "excelControl/exportConclusion", method = RequestMethod.GET)
    public void writeWordFile(@ApiParam(name = "urlString", value = "链接地址") @RequestParam(required = false) String urlString,
                              @ApiParam(name = "orderId", value = "订单id", required = true) @RequestParam String orderId,
                              HttpServletResponse response) {
@ -1245,10 +1243,25 @@ public class DoorOrderController extends BaseController {
            response.setHeader("Content-Disposition", "attachment; filename=" + fileName);
            OutputStream os = response.getOutputStream();
            //获取相对路径
            String pathName = DoorOrderController.class.getResource("/").getPath().replaceFirst("/", "");
            pathName = pathName.replace("target/classes/", "src/main/resources/conclusion.mht");
            Document doc = Jsoup.parse(new File(pathName), "UTF-8");
            String html = doorOrderService.handleData(doc,orderId);
//            String pathName = DoorOrderController.class.getResource("/").getPath().replaceFirst("/", "");
//            pathName = pathName.replace("target/classes/", "src/main/resources/conclusion.mht");
//            Document doc = Jsoup.parse(new File(pathName), "UTF-8");
//            String txt =     StreamUtil.readResources();
//            ByteArrayInputStream ins = new ByteArrayInputStream(txt.getBytes());
//            File file = new File("conclusion.mht");
//            OutputStream os1 = new FileOutputStream(file);
//            int bytesRead = 0;
//            byte[] buffer1 = new byte[8192];
//            while ((bytesRead = ins.read(buffer1, 0, 8192)) != -1) {
//                os1.write(buffer1, 0, bytesRead);
//            }
//            os1.close();
//            ins.close();
//            Document aa = Jsoup.parse(file,"UTF-8");
            Document aa = Jsoup.parse(StreamUtil.readResources());
            String html = doorOrderService.handleData(aa,orderId);
            byte b[] = html.getBytes();
            ByteArrayInputStream bais = new ByteArrayInputStream(b);
            POIFSFileSystem poifs = new POIFSFileSystem();
@ -1263,6 +1276,47 @@ public class DoorOrderController extends BaseController {
        }
    }
    @ApiOperation("批量导出服务小结到word-----pathName  本地测试和线上不一样")
    @RequestMapping(value = "excelControl/exportConclusionList", method = RequestMethod.GET)
    public void writeWordFileList(
            @ApiParam(value = "医生的code", name = "doctorCode",required = false) @RequestParam(value = "doctorCode", required = false) String doctorCode,
            @ApiParam(value = "状态 ;  5-需要,待补录   6-已完成", name = "status",required = false) @RequestParam(value = "status", required = false) Integer status,
            HttpServletResponse response) throws Exception {
        try {
            List<Map<String,Object>> list = doorOrderService.getOrderIdList(status,doctorCode);
            if (list.size()<0){
                response.setStatus(500);
            }else {
                List<String> list1 = new ArrayList<>();
                for (int i=0;i<list.size();i++){
                    list1.add(list.get(i).get("orderId").toString());
                }
                File file = doorOrderService.writeWordFile(list1,response);
                if (file != null) {
                    response.setCharacterEncoding("utf-8");
                    response.setContentType("multipart/form-data");
                    response.setHeader("Content-Disposition", "attachment;fileName=service_summary.zip");
                    InputStream inputStream = new FileInputStream(file);
                    OutputStream outputStream = response.getOutputStream();
                    byte[] b = new byte[2048];
                    int length = 0;
                    while ((length = inputStream.read(b)) > 0) {
                        outputStream.write(b, 0, length);
                    }
                    outputStream.flush();
                    outputStream.close();
                    inputStream.close();
                } else {
                    response.setStatus(500);
                }
            }
        } catch (Exception e) {
            response.setStatus(500);
        }
    }
    @ApiOperation("推送知情同意書")
    @RequestMapping(value = "/sendInformedConsent" , method = RequestMethod.GET)
    public String sendInformedConsent(   @ApiParam(value = "医生code", name = "doctor")

+ 19 - 62
svr/svr-door-serivce/src/main/java/com/yihu/jw/door/service/DoorOrderService.java

@ -6,6 +6,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
import com.yihu.jw.door.dao.*;
import com.yihu.jw.door.util.MessageUtil;
import com.yihu.jw.door.util.StreamUtil;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.im.ConsultDo;
import com.yihu.jw.entity.base.im.ConsultTeamDo;
@ -23,7 +24,6 @@ import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.util.http.HttpClientUtil;
import jxl.Workbook;
import jxl.write.*;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.poi.poifs.filesystem.POIFSFileSystem;
import org.jsoup.Jsoup;
@ -770,15 +770,14 @@ public class DoorOrderService {
    }
    public void doorOrderOutExcel(String orderId,String patientName,String patientPhone,String hospitalCode,
                                  Integer status,String createTimeStart,String createTimeEnd,String serverDoctorName,String doctorCode,Integer examPaperStatus, HttpServletResponse response)throws Exception{
                                  Integer[] status,String createTimeStart,String createTimeEnd,String serverDoctorName,String doctorCode,Integer examPaperStatus, HttpServletResponse response)throws Exception{
        WritableWorkbook book = null;
        OutputStream os = null;
        try {
            String sql = "select DISTINCT o.id as orderId,o.number,o.status,f.hospital,f.hospital_name as hospitalName1,o.is_trans_other_org," +
                    " o.transed_org_code,h.name as hospitalName2,o.patient_name,f.idcard,o.doctor_sign_time,o.total_fee," +
            String sql = "select DISTINCT o.id as orderId,o.number,o.status,o.is_trans_other_org," +
                    " o.transed_org_code,o.patient_name,p.idcard,o.doctor_sign_time,o.total_fee," +
                    " o.patient_phone,o.remark,o.create_time,o.patient as patientCode from wlyy_door_service_order o " +
                    " LEFT JOIN wlyy_sign_family f ON f.patient = o.patient AND f. STATUS = 1 AND f.expenses_status = 1 " +
                    " LEFT JOIN base_org h on h.code=o.transed_org_code and h.del=1 " ;
                    " LEFT JOIN base_patient p on p.id=o.patient " ;
            if(!StringUtils.isEmpty(serverDoctorName)){
                sql+=" RIGHT JOIN wlyy_door_doctor d on d.order_id = o.id";
            }
@ -793,13 +792,15 @@ public class DoorOrderService {
            if (!StringUtils.isEmpty(patientPhone)) {
                sql += " and o.patient_phone ='" + patientPhone + "'";
            }
            if (StringUtils.isNotBlank(hospitalCode) && !hospitalCode.contains("%")) {
                sql += " and (f.hospital = '" + hospitalCode + "' or o.transed_org_code='" + hospitalCode + "') ";
/*            if (StringUtils.isNotBlank(hospitalCode) && !hospitalCode.contains("%")) {
//                sql += " and (h.code = '" + hospitalCode + "' or o.transed_org_code='" + hospitalCode + "') ";
                sql += " and ( o.transed_org_code='" + hospitalCode + "') ";
            }else if(StringUtils.isNotBlank(hospitalCode) && hospitalCode.contains("%")){
                sql += " and (f.hospital like '" + hospitalCode + "' or o.transed_org_code like '" + hospitalCode + "') ";
            }
//                sql += " and (h.code like '" + hospitalCode + "' or o.transed_org_code like '" + hospitalCode + "') ";
                sql += " and ( o.transed_org_code like '" + hospitalCode + "') ";
            }*/
            if (status != null) {
                sql += " and o.status ='" + status + "'";
                sql += " and o.status in ("+StringUtils.strip(Arrays.toString(status),"[]")+") ";
            }
            if (!StringUtils.isEmpty(createTimeStart)) {
                sql += " and o.create_time >='" + createTimeStart + "'";
@ -889,14 +890,7 @@ public class DoorOrderService {
                sheet.addCell(new Label(1, b + 1, statusName,cellFormat));//工单状态
                //工单是否转给其他机构,0-不转,1-已转
                String transOtherOrg = list.get(i).get("is_trans_other_org") + "";
                String hospitalName = null;
                if ("0".equals(transOtherOrg)) {
                    hospitalName = list.get(i).get("hospitalName1") + "";//签约表中的机构
                } else if ("1".equals(transOtherOrg)) {
                    hospitalName = list.get(i).get("hospitalName2") + "";//转机构中的机构
                }else if("null".equals(transOtherOrg)){
                    hospitalName = list.get(i).get("hospitalName1") + "";//签约表中的机构
                }
                String hospitalName = "泰安市中医医院";
                sheet.addCell(new Label(2, b + 1, hospitalName,cellFormat));//服务机构
                Date createTime = (Date) list.get(i).get("create_time");
@ -1046,8 +1040,7 @@ public class DoorOrderService {
        // 更新记录
        this.setUpdateColumnInfo(one);
        doorServiceOrderDao.save(one);
        // 更新居民签约服务包服务项次数
        this.reduceServiceItemTimes(serverPackagePriceByOrderId(orderId), one.getPatient());
        // 发送微信消息通知--用户评价//·
        BasePatientDO patient = patientInfoService.findById(one.getPatient());
        // 获取微信模板  fwyspf-服务医生评分
@ -1292,42 +1285,6 @@ public class DoorOrderService {
        return map;
    }
    /**
     * 更新居民签约服务包服务项次数
     * @param itemInfo 格式[{"itemCode":"","fee":"","number":""}]
     * @param patient 居民code
     */
    public void reduceServiceItemTimes(String itemInfo, String patient){
        Map<String, Object> map = new HashMap<>();
        //获取居民签约服务项及次数
//        SignFamily signFamily = signFamilyDao.findByPatient(patient);
        String sql = "SELECT ip.`code`,ip.service_item_code as itemCode, ip.service_times as times  FROM wlyy_server_package_patient pp , wlyy_server_package_item_patient ip " +
//                "where pp.`code` = ip.server_package_patient_code and  pp.patient = '" + patient + "' and pp.hospital = '" + signFamily.getHospital() + "' and pp.`status` = 1 " +
                "where pp.`code` = ip.server_package_patient_code and  pp.patient = '" + patient + "' and pp.hospital = '" + "" + "' and pp.`status` = 1 " +
                "order BY pp.end_time ";
        List<Map<String, Object>> list =jdbcTemplate.query(sql, new BeanPropertyRowMapper(String.class));
        JSONArray jsonArray = JSONArray.parseArray(itemInfo);
        for(Object o : jsonArray) {
            JSONObject jsonObject = (JSONObject) o;
            String itemCode = jsonObject.getString("itemCode");
            Integer number = jsonObject.getInteger("number");
            //遍历是否是居民签约的服务项,如果是,看服务项次数够不够减,不够减的继续遍历其他服务项,够减则跳出循环更新次数
            for (Map<String, Object> m : list) {
                if ((m.get(itemCode) + "").equals(itemCode)) {
                    String itemPatientCode = map.get("code") + "";
                    Integer times = (Integer) map.get("times");
                    if (number <= times) {
//                        serverPackageItemPatientDao.updateTimesByCode(itemPatientCode, times - number);
                        break;
                    } else {
//                        serverPackageItemPatientDao.updateTimesByCode(itemPatientCode, 0);
                        number -= times;
                    }
                }
            }
        }
    }
    /**
     * 获取订单下服务包数量、单价
@ -1657,9 +1614,10 @@ public class DoorOrderService {
            fileName = java.net.URLEncoder.encode(fileName,"UTF-8");
            fileName = java.net.URLDecoder.decode(fileName,"UTF-8");
            response.setHeader("Content-Disposition", "attachment; filename=" + fileName);
            String pathName = this.getClass().getResource("/").getPath() + "conclusion.mht";
            System.out.println("路径pathName:" + pathName);
            Document doc = Jsoup.parse(new File(pathName), "UTF-8");
//            String pathName = this.getClass().getResource("/").getPath() + "conclusion.mht";
//            System.out.println("路径pathName:" + pathName);
//            Document doc = Jsoup.parse(new File(pathName), "UTF-8");
            Document doc = Jsoup.parse(StreamUtil.readResources());
            String html = this.handleData(doc, orderId.get(i));//16
            BufferedWriter bw = new BufferedWriter(new FileWriter(path+"/"+fileName));//创建的文件
            bw.write(html);
@ -1773,12 +1731,11 @@ public class DoorOrderService {
   public List<Map<String,Object>> getOrderIdList(Integer status,String doctorCode){
       String sqlList = "select DISTINCT o.id as orderId";
       String sql = " from wlyy_door_service_order o " +
               " LEFT JOIN wlyy_sign_family f ON f.patient = o.patient AND f. STATUS = 1 AND f.expenses_status = 1 " +
               " LEFT JOIN base_org h on h.code=o.hospital and h.del=1 "
               +" LEFT JOIN wlyy_door_doctor d on d.order_id = o.id ";
       sql+= " where 1=1 ";
       if(status == 6){//已完成状态
           sql+=" and o.status ='"+status+"'";
           sql+=" and o.status in (5,6) ";
       }else {//5是待补录状态
           sql+=" and o.conclusion_status =1 ";
       }

+ 3 - 3
svr/svr-door-serivce/src/main/java/com/yihu/jw/door/service/WlyyDoorServiceOrderService.java

@ -939,7 +939,7 @@ public class WlyyDoorServiceOrderService extends BaseJpaService<WlyyDoorServiceO
        orderBriefInfo.put("prescriptionTime", DateUtil.dateToStr(orderDO.getPrescriptionTime(), "MM-dd HH:mm"));
        orderBriefInfo.put("cancelTime", DateUtil.dateToStr(orderDO.getCancelTime(), "MM-dd HH:mm"));
        // 计算服务包支付多少钱
       /*  // 计算服务包支付多少钱
        List<Map<String, Object>> feeDetailDOS = doorOrderService.getDoorFeeDetailGroupByStatus(id);
        String jsonData = null;
        try {
@ -948,9 +948,9 @@ public class WlyyDoorServiceOrderService extends BaseJpaService<WlyyDoorServiceO
            e.printStackTrace();
        }
        if (!CollectionUtils.isEmpty(feeDetailDOS)) {
            Map<String, Object> map = doorOrderService.countServerPackagePrice(jsonData, orderDO.getPatient());
           Map<String, Object> map = doorOrderService.countServerPackagePrice(jsonData, orderDO.getPatient());
            orderBriefInfo.put("packageFee", map.get("serverPackagePrice"));
        }
        }*/
        orderJson.put("order", orderBriefInfo);
        //关联服务项

+ 51 - 32
svr/svr-door-serivce/src/main/java/com/yihu/jw/door/service/common/ServerPackageService.java

@ -6,6 +6,7 @@ import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -25,7 +26,8 @@ public class ServerPackageService  {
    @Autowired
    private JdbcTemplate jdbcTemplate;
    @Value("${wechat.id}")
    private String wxId;
    /**
@ -85,30 +87,45 @@ public class ServerPackageService  {
//            HospitalMapping hospitalMapping = hospitalMappingDao.findByCode(hospital);
//            buffer.append(" and ziocad.org_code = '"+hospitalMapping.getMappingCode()+"'");
        }
        String sql ="SELECT " +
                "ziocad.org_code AS hospital," +
                "zicd.clinic_code AS diagnosis_code," +
                "zicd.clinic_code AS code," +
                "zicd.clinic_name AS title," +
                "zicd.clinic_spec AS spec," +
                "zicd.clinic_unit AS unit," +
                "ziccad.allot_quantity AS quantity," +
                "zicd.subject_class AS subjectClass," +
                "ziccad.item_code AS itemCode," +
                " SUBSTR(zicd.subject_class, 1, 4) AS subjectCatagory," +
                " (CASE WHEN ISNULL(ziocd.price) THEN 0 ELSE ziocd.price END) as expense " +
                " FROM zy_iv_org_clinic_allot_dict ziocad " +
                " LEFT JOIN zy_iv_clinic_charge_allot_dict ziccad ON ziccad.clinic_code = ziocad.clinic_code AND ziccad.org_code = ziocad.org_code" +
                " LEFT JOIN zy_iv_clinic_dict zicd ON zicd.clinic_code = ziocad.clinic_code" +
                " LEFT JOIN zy_iv_org_charge_allot_dict ziocd ON ziocd.charge_code = ziccad.item_code and ziocd.org_code = ziccad.org_code  " ;
        if("used".equals(type)){
            sql += " LEFT JOIN wlyy_door_order_item i on i.code = zicd.clinic_code and (i.patient = '"+patient+"' or i.doctor='"+doctor+"') ";
            sql += " WHERE SUBSTR(zicd.subject_class, 1, 4) = '"+type+"' ";
        }else{
            sql += " WHERE SUBSTR(zicd.subject_class, 1, 4) = '"+type+"' ";
        String sql = "";
        if("sd_tnzyy_wx".equals(wxId)){
            sql = "SELECT a.FYXH code,a.FYMC title,a.FYDW unit,a.FYDJ expense from gy_ylsf a ";
            if("used".equals(type)){
                sql += " JOIN wlyy_door_order_item i on i.code = a.FYXH and (i.patient = '"+patient+"' or i.doctor='"+doctor+"') ";
            }else if("other".equals(type)){
                sql = " where a.FYGB not in (SELECT code from base_system_dict_entry WHERE dict_code = 'door_service_subject_class_dict')";
            }else{
                sql += " WHERE a.FYGB ="+type;
            }
        }else {
            sql ="SELECT " +
                    "ziocad.org_code AS hospital," +
                    "zicd.clinic_code AS diagnosis_code," +
                    "zicd.clinic_code AS code," +
                    "zicd.clinic_name AS title," +
                    "zicd.clinic_spec AS spec," +
                    "zicd.clinic_unit AS unit," +
                    "ziccad.allot_quantity AS quantity," +
                    "zicd.subject_class AS subjectClass," +
                    "ziccad.item_code AS itemCode," +
                    " SUBSTR(zicd.subject_class, 1, 4) AS subjectCatagory," +
                    " (CASE WHEN ISNULL(ziocd.price) THEN 0 ELSE ziocd.price END) as expense " +
                    " FROM zy_iv_org_clinic_allot_dict ziocad " +
                    " LEFT JOIN zy_iv_clinic_charge_allot_dict ziccad ON ziccad.clinic_code = ziocad.clinic_code AND ziccad.org_code = ziocad.org_code" +
                    " LEFT JOIN zy_iv_clinic_dict zicd ON zicd.clinic_code = ziocad.clinic_code" +
                    " LEFT JOIN zy_iv_org_charge_allot_dict ziocd ON ziocd.charge_code = ziccad.item_code and ziocd.org_code = ziccad.org_code  " ;
            if("used".equals(type)){
                sql += " LEFT JOIN wlyy_door_order_item i on i.code = zicd.clinic_code and (i.patient = '"+patient+"' or i.doctor='"+doctor+"') ";
                sql += " WHERE SUBSTR(zicd.subject_class, 1, 4) = '"+type+"' ";
            }else{
                sql += " WHERE SUBSTR(zicd.subject_class, 1, 4) = '"+type+"' ";
            }
            sql += buffer;
        }
        sql += buffer;
        List<Map<String,Object>> mapList = jdbcTemplate.queryForList(sql);
        return mapList;
@ -116,14 +133,16 @@ public class ServerPackageService  {
    public List<Map<String,Object>> selectTypes(){
        String sql1 = "SELECT zisc.class_code AS code, zisc.class_name AS type FROM zy_iv_subject_class_dict zisc " +
                "WHERE zisc.class_code IN ( SELECT DISTINCT SUBSTR(zicd.subject_class, 1, 4) AS subjectCatagory " +
                "FROM zy_iv_clinic_dict zicd WHERE LENGTH(zicd.subject_class) > 4 )";
        List<Map<String,Object>> mapList1 = jdbcTemplate.queryForList(sql1);
        Map<String,Object> map = new HashedMap();
        map.put("code","used");
        map.put("type","常用");
        mapList1.add(map);
        String sql = "SELECT code,value type from base_system_dict_entry WHERE dict_code = 'door_service_subject_class_dict' ORDER BY sort";
        List<Map<String,Object>> mapList1 = jdbcTemplate.queryForList(sql);
        Map<String,Object> map1 = new HashedMap();
        map1.put("code","used");
        map1.put("type","常用");
        mapList1.add(map1);
        Map<String,Object> map2 = new HashedMap();
        map2.put("code","other");
        map2.put("type","其他");
        mapList1.add(map2);
        return mapList1;
    }

+ 1 - 1
svr/svr-door-serivce/src/main/java/com/yihu/jw/door/service/common/WlyyMessageService.java

@ -57,7 +57,7 @@ public class WlyyMessageService {
            object.put("del",one.get("del"));
            object.put("title",one.get("title"));
            object.put("type",one.get("type"));
            object.put("content",one.get("content"));
            object.put("content",one.get("data"));
            object.put("sender",one.get("sender"));
            object.put("id",one.get("id"));
            object.put("relation_code",one.get("relation_code"));

+ 42 - 0
svr/svr-door-serivce/src/main/java/com/yihu/jw/door/util/StreamUtil.java

@ -0,0 +1,42 @@
package com.yihu.jw.door.util;
import org.springframework.core.io.Resource;
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
import org.springframework.core.io.support.ResourcePatternResolver;
import java.io.IOException;
import java.io.InputStream;
/***
 * @ClassName: StreamUtil
 * @Description:
 * @Auther: shi kejing
 * @Date: 2021/1/5 19:40
 */
public class StreamUtil {
    /**
     *   jar包,读取resources配置
     *   /conclusion.mht    :resources下文件路径以及文件名
     * @return
     * @throws IOException
     */
    public static String readResources() throws IOException {
        ResourcePatternResolver resolver = new PathMatchingResourcePatternResolver();
        Resource[] resources = resolver.getResources("/conclusion.mht");
        Resource resource = resources[0];
//获得文件流,因为在jar文件中,不能直接通过文件资源路径拿到文件,但是可以在jar包中拿到文件流
        InputStream stream = resource.getInputStream();
        StringBuilder buffer = new StringBuilder();
        byte[] bytes = new byte[1024];
        try {
            for (int n; (n = stream.read(bytes)) != -1; ) {
                buffer.append(new String(bytes, 0, n));
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
        return buffer.toString();
    }
}

+ 4 - 4
svr/svr-door-serivce/src/main/resources/application.yml

@ -101,7 +101,7 @@ wechat:
  wechat_token: 27eb3bb24f149a7760cf1bb154b08040
  wechat_base_url: http%3a%2f%2fweixin.xmtyw.cn%2fwlyy-dev
  accId: gh_ffd64560fb21
  id: xm_ykyy_wx  # base库中,wx_wechat 的id字段
  id: sd_tnzyy_wx  # base库中,wx_wechat 的id字段
  flag: false #演示环境  true走Mysql数据库  false走Oracle
im:
@ -181,7 +181,7 @@ wechat:
  wechat_token: 27eb3bb24f149a7760cf1bb154b08040
  wechat_base_url: http%3a%2f%2fehr.yihu.com%2fwlyy
  accId: gh_ffd64560fb21
  id: xm_ykyy_wx  # base库中,wx_wechat 的id字段
  id: sd_tnzyy_wx  # base库中,wx_wechat 的id字段
  flag: false #演示环境  true走Mysql数据库  false走Oracle
im:
@ -260,8 +260,8 @@ wechat:
  wechat_token: 27eb3bb24f149a7760cf1bb154b08040
  wechat_base_url: http%3a%2f%2fwww.xmtyw.cn%2fwlyy
  accId: gh_ffd64560fb21
  id: xm_ykyy_wx  # base库中,wx_wechat 的id字段
  flag: false #演示环境  true走Mysql数据库  false走Oracle
  id: sd_tnzyy_wx  # base库中,wx_wechat 的id字段
  flag: true #演示环境  true走Mysql数据库  false走Oracle
im:
  im_list_get: http://27.155.101.77:3000/

File diff suppressed because it is too large
+ 1 - 0
svr/svr-door-serivce/src/main/resources/conclusion.mht