Browse Source

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

wangzhinan 3 years ago
parent
commit
8852bb1482
14 changed files with 947 additions and 69 deletions
  1. 67 20
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java
  2. 284 31
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/TasyNatService.java
  3. 9 0
      common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/BaseNatAppointmentDO.java
  4. 4 4
      common/common-entity/src/main/java/com/yihu/jw/entity/order/BusinessOrderDO.java
  5. 58 0
      common/common-entity/src/main/java/com/yihu/jw/entity/voluntary/VoluntaryRecruitmentArrangeDO.java
  6. 1 0
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/voluntary/VoluntaryRecruitmentPeopleDao.java
  7. 160 0
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/voluntary/VoluntaryRecruitmentArrangeEndpoint.java
  8. 94 4
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/voluntary/VoluntaryRecruitmentEndpoint.java
  9. 35 0
      svr/svr-base/src/main/java/com/yihu/jw/base/service/voluntary/VoluntaryRecruitmentService.java
  10. 40 0
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/patient/PatientBirthdayWishesEndpoint.java
  11. 13 3
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/birthday/BirthdayWishesService.java
  12. 1 2
      svr/svr-cloud-device/src/main/java/com/yihu/jw/care/service/YsDeviceService.java
  13. 109 2
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/patient/PatientNoLoginEndPoint.java
  14. 72 3
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/PrescriptionEndpoint.java

+ 67 - 20
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java

@ -11348,11 +11348,11 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
       return doorServiceCount;
    }
    public MixEnvelop findJobCategory(){
        String sqlPid = "select id as \"id\",name as \"name\",pid as \"pid\" from base_job_category  where pid = 0 and del = 1";
        String sqlPid = "select id as \"id\",name as \"name\",code as \"code\",pid as \"pid\" from base_job_category  where pid = 0 and del = 1";
        List<Map<String,Object>> list = hibenateUtils.createSQLQuery(sqlPid);
        if (list.size()>0){
            for (Map<String,Object> map:list){
                String child = "select id as \"id\",name as \"name\",pid as \"pid\" from base_job_category  where del = 1";
                String child = "select id as \"id\",name as \"name\",code as \"code\",pid as \"pid\" from base_job_category  where del = 1";
                String pid = map.get("id").toString();
                child+=" and pid = "+pid;
                List<Map<String,Object>> childList = hibenateUtils.createSQLQuery(child);
@ -11690,14 +11690,14 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            returnMap.put("realOrder",baseNatAppointmentDO.getRealOrder());
            return returnMap;
        }else if (wechatId.equalsIgnoreCase("xm_tasy_wx")){
            Double natFee = 8000.0;
            if(StringUtils.isNoneBlank(chargeAmount)){
                natFee= Double.parseDouble(chargeAmount)*100;
            }
            BasePatientDO  basePatientDO = basePatientDao.findById(patientId);
            List<WlyyHospitalSysDictDO> tasyList = wlyyHospitalSysDictDao.findByDictName("natConfigList");
            String deptCode = "0001";
            String staffNo = "0001";
            String staffName = "0001";
            String regDept="";
            String deptName="";
            String itemPrice="";
            for (WlyyHospitalSysDictDO wlyyHospitalSysDictDO:tasyList){
                if (StringUtils.isNoneBlank(wlyyHospitalSysDictDO.getDictValue())&&"deptCode".equalsIgnoreCase(wlyyHospitalSysDictDO.getDictCode())){
                    deptCode = wlyyHospitalSysDictDO.getDictValue();
@ -11705,11 +11705,47 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                if (StringUtils.isNoneBlank(wlyyHospitalSysDictDO.getDictValue())&&"staffNo".equalsIgnoreCase(wlyyHospitalSysDictDO.getDictCode())){
                    staffNo = wlyyHospitalSysDictDO.getDictValue();
                }
                if (StringUtils.isNoneBlank(wlyyHospitalSysDictDO.getDictValue())&&"regDept".equalsIgnoreCase(wlyyHospitalSysDictDO.getDictCode())){
                    regDept = wlyyHospitalSysDictDO.getDictValue();
                }
                if (StringUtils.isNoneBlank(wlyyHospitalSysDictDO.getDictValue())&&"deptName".equalsIgnoreCase(wlyyHospitalSysDictDO.getDictCode())){
                    deptName = wlyyHospitalSysDictDO.getDictValue();
                }
                if (StringUtils.isNoneBlank(wlyyHospitalSysDictDO.getDictValue())&&"staffName".equalsIgnoreCase(wlyyHospitalSysDictDO.getDictCode())){
                    staffName = wlyyHospitalSysDictDO.getDictValue();
                }
                if (StringUtils.isNoneBlank(wlyyHospitalSysDictDO.getDictValue())&&"itemPrice".equalsIgnoreCase(wlyyHospitalSysDictDO.getDictCode())){
                    itemPrice = wlyyHospitalSysDictDO.getDictValue();
                }
            }
            Double natFee = 8000.0;
            if(StringUtils.isNoneBlank(itemPrice)){
                natFee= Double.parseDouble(itemPrice)*100;
            }
            //先预约号源
            Date format2 = null;
            format2 = new SimpleDateFormat("yyyy-MM-dd").parse(natTime);
            String shortDate = new SimpleDateFormat("yyyyMMdd").format(format2);
            System.out.println("yyyy-MM-dd转yyyyMMdd:"+shortDate);
            String regRes=tasyNatService.saveRegOrder(regDept,shortDate,pm,preNo,cardNo,mobile,name,"3");
            com.alibaba.fastjson.JSONObject regObj = com.alibaba.fastjson.JSONObject.parseObject(regRes);
            String HisSeqNo="";
            String orderNum="";
            if (regObj!=null){
                if ("true".equalsIgnoreCase(regObj.getString("success"))){
                    com.alibaba.fastjson.JSONObject dataObj = com.alibaba.fastjson.JSONObject.parseObject(regObj.getString("data"));
                    HisSeqNo=dataObj.getString("HisSeqNo").trim();
                    orderNum=dataObj.getString("OrderNumber").trim();
                }else {
                    returnMap.put("msg",regObj.getString("data"));
                    returnMap.put("status","-1");
                    return  returnMap;
                }
            }
            //先进行核算检测预约
            String realOrder="";
            String addressNow=provinceName+cityName+townName+streetName+address;
            String result = tasyNatService.initNatParams(preNo,name,mediaCard,addressNow,firstJobCode,secondJobCode);
            String result = tasyNatService.initNatParams(HisSeqNo,name,mediaCard,addressNow,firstJobCode,secondJobCode);
            Boolean flag = false;
            if (StringUtils.isNoneBlank(result)){
                com.alibaba.fastjson.JSONObject object = com.alibaba.fastjson.JSONObject.parseObject(result);
@ -11718,7 +11754,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    String returnCode = object.getString("ReturnCode");
                    System.out.println("returnCode"+returnCode);
                    if ("0".equalsIgnoreCase(returnCode)){
                        returnMap.put("msg",object.getString("returnMsg"));
                        returnMap.put("msg",object.getString("data"));
                        returnMap.put("status","-1");
                        return  returnMap;
                    }else {
@ -11733,13 +11769,15 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            if (flag){
                logger.info("BaseNatAppointmentDO保存开始");
                BaseNatAppointmentDO baseNatAppointmentDO= new BaseNatAppointmentDO();
                baseNatAppointmentDO.setChargeAmount(chargeAmount);
                baseNatAppointmentDO.setChargeAmount(itemPrice);
                baseNatAppointmentDO.setMedicare(mediaCard);
                baseNatAppointmentDO.setRegisterNo(HisSeqNo);
                baseNatAppointmentDO.setName(name);
                baseNatAppointmentDO.setCardNo(cardNo);
                baseNatAppointmentDO.setCardType(cardType);
                baseNatAppointmentDO.setAddress(address);
                baseNatAppointmentDO.setAppointmentTime(DateUtil.strToDateLong(natTime));
                baseNatAppointmentDO.setOderNum(orderNum);
                baseNatAppointmentDO.setCityName(cityName);
                baseNatAppointmentDO.setFirstJobCode(firstJobCode);
                baseNatAppointmentDO.setFirstJobName(firstJobName);
@ -11760,12 +11798,12 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                baseNatAppointmentDO.setChargeCode(chargeCode);
                baseNatAppointmentDO.setWinNo(String.valueOf(winNo));
                baseNatAppointmentDO.setDept(deptCode);
                baseNatAppointmentDO.setDeptName("感染疾病科");
                baseNatAppointmentDO.setDeptName(deptName);
                baseNatAppointmentDO.setRealOrder(realOrder);
                baseNatAppointmentDO.setAmpm(pm);
                baseNatAppointmentDO.setDoctorId(staffNo);
                baseNatAppointmentDO.setConsumer(consumer);
                //baseNatAppointmentDO.setDoctorName(map.get("doctorName").toString());
                baseNatAppointmentDO.setDoctorName(staffName);
                baseNatAppointmentDO= baseNatAppointmentDao.save(baseNatAppointmentDO);
                logger.info("BaseNatAppointmentDO保存结束"+baseNatAppointmentDO.getId());
                //添加订单
@ -11790,14 +11828,17 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                if (basePatientWechatDo!=null&&basePatientWechatDo.size()>0){
                    openId=basePatientWechatDo.get(0).getOpenid();
                }
               /* //亿同支付创建订单
                //亿同支付创建订单
                com.alibaba.fastjson.JSONObject orderObj= new com.alibaba.fastjson.JSONObject();
                orderObj.put("payType",1);
                orderObj.put("tradeNo",businessDO.getOrderNo());
                orderObj.put("openId",openId);
                orderObj.put("name",name);
                orderObj.put("idNo",cardNo);
                orderObj.put("amount",chargeAmount);
                BigDecimal b = new BigDecimal(itemPrice);
                b=b.setScale(2, BigDecimal.ROUND_DOWN);
                System.out.println("amount"+b);
                orderObj.put("amount",b);
                String orderRes=tasyNatService.placeOrder(orderObj);
                if (StringUtils.isNoneBlank(orderRes)){
                    com.alibaba.fastjson.JSONObject jsonObject= JSON.parseObject(orderRes);
@ -11805,16 +11846,20 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                        if("0".equalsIgnoreCase(jsonObject.getString("code"))){
                            com.alibaba.fastjson.JSONObject dataObj= com.alibaba.fastjson.JSONObject.parseObject(jsonObject.getString("data"));
                            businessDO.setTraceNo(dataObj.getString("orderNo"));
                            businessDO.setRematk(dataObj.toJSONString());
                            businessDO=businessOrderDao.save(businessDO);
                        }
                    }
                }
                tasyNatService.sendWxtemplateMessaeg(baseNatAppointmentDO.getConsumer(),"hszftx",baseNatAppointmentDO.getName(),baseNatAppointmentDO.getId().toString());*/
                tasyNatService.sendWxtemplateMessaeg(baseNatAppointmentDO.getConsumer(),baseNatAppointmentDO.getName(),"hszftx",baseNatAppointmentDO.getId().toString());
                tasyNatService.sendWxtemplateMessaeg(baseNatAppointmentDO.getConsumer(),baseNatAppointmentDO.getName(),"hsyycg",baseNatAppointmentDO.getId().toString());
                logger.info("开单结束");
                returnMap.put("msg","预约成功");
                returnMap.put("status","200");
                returnMap.put("id",baseNatAppointmentDO.getId());
                returnMap.put("realOrder",baseNatAppointmentDO.getRealOrder());
                baseNatAppointmentDO.setIsSuccess("1");
                baseNatAppointmentDO= baseNatAppointmentDao.save(baseNatAppointmentDO);
            }else {
                returnMap.put("msg","核酸开方失败");
                returnMap.put("status","-1");
@ -12211,14 +12256,16 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                        }
                    }else if("xm_tasy_wx".equalsIgnoreCase(wechatId)){
                        baseNatAppointmentDO.setIsSuccess("-1");
                        baseNatAppointmentDO.setCancelReson("患者本人取消");
                        baseNatAppointmentDO.setCancelTime(new Date());
                        baseNatAppointmentDO.setCancelBy(patientId);
                        baseNatAppointmentDao.save(baseNatAppointmentDO);
                        if (StringUtils.isNoneBlank(baseNatAppointmentDO.getRealOrder())){
                            logger.info("同步his订单状态"+baseNatAppointmentDO.getRealOrder());
                            tasyNatService.cancelNat(baseNatAppointmentDO.getRealOrder(),baseNatAppointmentDO.getCardNo(),baseNatAppointmentDO.getName());
                            //取消号源
                            tasyNatService.cancleOrder(baseNatAppointmentDO.getCardNo(),baseNatAppointmentDO.getRegisterNo(),baseNatAppointmentDO.getOderNum());
                            tasyNatService.cancelNat(baseNatAppointmentDO.getRealOrder(),baseNatAppointmentDO.getMedicare(),baseNatAppointmentDO.getName());
                            baseNatAppointmentDO.setIsSuccess("-1");
                            baseNatAppointmentDO.setCancelReson("患者本人取消");
                            baseNatAppointmentDO.setCancelTime(new Date());
                            baseNatAppointmentDO.setCancelBy(patientId);
                            baseNatAppointmentDao.save(baseNatAppointmentDO);
                        }
                    }

+ 284 - 31
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/TasyNatService.java

@ -5,13 +5,18 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.sun.org.apache.regexp.internal.RE;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.base.wx.BasePatientWechatDo;
import com.yihu.jw.entity.base.wx.WxTemplateConfigDO;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.entity.hospital.httplog.WlyyHttpLogDO;
import com.yihu.jw.entity.hospital.prescription.BaseNatAppointmentDO;
import com.yihu.jw.entity.order.BusinessOrderDO;
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
import com.yihu.jw.hospital.httplog.dao.WlyyHttpLogDao;
import com.yihu.jw.hospital.prescription.dao.BaseNatAppointmentDao;
import com.yihu.jw.hospital.prescription.service.entrance.XzzxEntranceService;
import com.yihu.jw.order.dao.BusinessOrderDao;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.restmodel.hospital.doctor.PersonInfoVO;
import com.yihu.jw.util.http.HttpClientUtil;
@ -26,6 +31,7 @@ import nu.xom.Element;
import nu.xom.Elements;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.math.NumberUtils;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import org.checkerframework.checker.units.qual.A;
@ -36,10 +42,8 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.io.StringReader;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.net.URLEncoder;
import java.util.*;
@Service
@Transactional
@ -59,6 +63,10 @@ public class TasyNatService {
    private BasePatientWechatDao basePatientWechatDao;
    @Autowired
    private WxTemplateConfigDao wxTemplateConfigDao;
    @Autowired
    private BaseNatAppointmentDao baseNatAppointmentDao;
    @Autowired
    private BusinessOrderDao businessOrderDao;
    public String getOperateUrl(){
@ -452,17 +460,17 @@ public class TasyNatService {
            url=wlyyHospitalSysDictDO.getDictValue();
        }
        System.out.println(url);
        List<NameValuePair> params = new ArrayList<>();
        /*List<NameValuePair> params = new ArrayList<>();
        params.add(new BasicNameValuePair("payType", jsonObject.getString("payType")));
        params.add(new BasicNameValuePair("tradeNo", jsonObject.getString("tradeNo")));
        params.add(new BasicNameValuePair("openId", jsonObject.getString("openId")));
        params.add(new BasicNameValuePair("name", jsonObject.getString("name")));
        params.add(new BasicNameValuePair("idNo", jsonObject.getString("idNo")));
        params.add(new BasicNameValuePair("amount", jsonObject.getString("amount")));
        System.out.println(params.toString());
        String response = httpClientUtil.post(url,params ,"UTF-8");
        params.add(new BasicNameValuePair("amount", jsonObject.getString("amount")));*/
        System.out.println(jsonObject.toString());
        String response = httpClientUtil.postBody(url,jsonObject);
        System.out.println("res"+response);
        saveHttpLog("placeOrder",params.toString(),response,url);
        saveHttpLog("placeOrder",jsonObject.toString(),response,url);
        return response;
    }
@ -473,12 +481,9 @@ public class TasyNatService {
            url=wlyyHospitalSysDictDO.getDictValue();
        }
        System.out.println(url);
        List<NameValuePair> params = new ArrayList<>();
        params.add(new BasicNameValuePair("orderNo", jsonObject.getString("orderNo")));
        System.out.println(params.toString());
        String response = httpClientUtil.post(url,params ,"UTF-8");
        String response = httpClientUtil.postBody(url,jsonObject);
        System.out.println("res"+response);
        saveHttpLog("orderStatus",params.toString(),response,url);
        saveHttpLog("orderStatus",jsonObject.toString(),response,url);
        return response;
    }
@ -489,22 +494,16 @@ public class TasyNatService {
            url=wlyyHospitalSysDictDO.getDictValue();
        }
        System.out.println(url);
        List<NameValuePair> params = new ArrayList<>();
        params.add(new BasicNameValuePair("tempateId", jsonObject.getString("tempateId")));
        params.add(new BasicNameValuePair("url", jsonObject.getString("url")));
        params.add(new BasicNameValuePair("openId", jsonObject.getString("openId")));
        params.add(new BasicNameValuePair("data", jsonObject.getJSONObject("data").toString()));
        System.out.println(params.toString());
        String response = httpClientUtil.post(url,params ,"UTF-8");
        String response = httpClientUtil.postBody(url,jsonObject);
        System.out.println("res"+response);
        saveHttpLog("tmpPush",params.toString(),response,url);
        saveHttpLog("tmpPush",jsonObject.toString(),response,url);
        return response;
    }
    public void  saveHttpLog(String name,String req,String res,String code){
        WlyyHttpLogDO wlyyHttpLogDO = new WlyyHttpLogDO();
        wlyyHttpLogDO.setRequest(req);
        wlyyHttpLogDO.setName(name);
        wlyyHttpLogDO.setCode(code);
        //wlyyHttpLogDO.setCode(code);
        wlyyHttpLogDO.setCreateTime(new Date());
        wlyyHttpLogDO.setResponse(res);
        wlyyHttpLogDao.save(wlyyHttpLogDO);
@ -514,13 +513,19 @@ public class TasyNatService {
        String url="";
        String openId="";
        JSONObject key=new JSONObject();
        JSONObject first=new JSONObject();
        JSONObject key1=new JSONObject();
        JSONObject key2=new JSONObject();
        JSONObject key3=new JSONObject();
        JSONObject key4=new JSONObject();
        JSONObject key5=new JSONObject();
        JSONObject remark=new JSONObject();
        BaseNatAppointmentDO baseNatAppointmentD0 = baseNatAppointmentDao.findOne(Integer.valueOf(relationCode));
        List<BasePatientWechatDo> basePatientWechatDo = basePatientWechatDao.findByWechatIdAndPatientId("xm_tasy_wx",patient);
        if (basePatientWechatDo!=null&&basePatientWechatDo.size()>0){
            openId=basePatientWechatDo.get(0).getOpenid();
        }
        if ("hszfcg".equalsIgnoreCase(scene)){
        if ("hszfcgtx".equalsIgnoreCase(scene)){
            //开始发送模板消息
            logger.info("开始发送模板消息");
            List<WxTemplateConfigDO> wxTemplateConfigDO = wxTemplateConfigDao.findByWechatIdAndScene("xm_tasy_wx",scene);
@ -529,12 +534,27 @@ public class TasyNatService {
                wxTemplateConfigDO1 = wxTemplateConfigDO.get(0);
            }
            url=wxTemplateConfigDO1.getUrl()+relationCode;
            key1.put("value",wxTemplateConfigDO1.getKeyword1().replace("key1",name));
            first.put("value",wxTemplateConfigDO1.getFirst());
            first.put("color",wxTemplateConfigDO1.getKeyword6());
            key1.put("value",baseNatAppointmentD0.getDoctorName());
            key1.put("color",wxTemplateConfigDO1.getKeyword6());
            key2.put("value",wxTemplateConfigDO1.getKeyword1().replace("key1",name));
            key2.put("value",baseNatAppointmentD0.getChargeAmount());
            key2.put("color",wxTemplateConfigDO1.getKeyword6());
            key3.put("value",wxTemplateConfigDO1.getKeyword3());
            key3.put("color",wxTemplateConfigDO1.getKeyword6());
            key4.put("value",baseNatAppointmentD0.getDoctorName());
            key4.put("color",wxTemplateConfigDO1.getKeyword6());
            key5.put("value",baseNatAppointmentD0.getVoucherNo());
            key5.put("color",wxTemplateConfigDO1.getKeyword6());
            remark.put("value",wxTemplateConfigDO1.getRemark());
            remark.put("color",wxTemplateConfigDO1.getKeyword6());
            key.put("first",first);
            key.put("keyword1",key1);
            key.put("keyword2",key2);
            key.put("key3",key3);
            key.put("key4",key4);
            key.put("key5",key5);
            key.put("remark",remark);
            JSONObject jsonObject = new JSONObject();
            jsonObject.put("tempateId",wxTemplateConfigDO1.getTemplateId());//
            jsonObject.put("data",key);
@ -552,12 +572,27 @@ public class TasyNatService {
                wxTemplateConfigDO1 = wxTemplateConfigDO.get(0);
            }
            url=wxTemplateConfigDO1.getUrl()+relationCode;
            key1.put("value",wxTemplateConfigDO1.getKeyword1().replace("key1",name));
            first.put("value",wxTemplateConfigDO1.getFirst());
            first.put("color",wxTemplateConfigDO1.getKeyword6());
            key1.put("value",name);
            key1.put("color",wxTemplateConfigDO1.getKeyword6());
            key2.put("value",wxTemplateConfigDO1.getKeyword1().replace("key1",name));
            key2.put("value",baseNatAppointmentD0.getDeptName());
            key2.put("color",wxTemplateConfigDO1.getKeyword6());
            key3.put("value",wxTemplateConfigDO1.getKeyword3());
            key3.put("color",wxTemplateConfigDO1.getKeyword6());
            key4.put("value",baseNatAppointmentD0.getDoctorName());
            key4.put("color",wxTemplateConfigDO1.getKeyword6());
            key5.put("value",baseNatAppointmentD0.getCreateTime());
            key5.put("color",wxTemplateConfigDO1.getKeyword6());
            remark.put("value",wxTemplateConfigDO1.getRemark());
            remark.put("color",wxTemplateConfigDO1.getKeyword6());
            key.put("first",first);
            key.put("keyword1",key1);
            key.put("keyword2",key2);
            key.put("key3",key3);
            key.put("key4",key4);
            key.put("key5",key5);
            key.put("remark",remark);
            JSONObject jsonObject = new JSONObject();
            jsonObject.put("tempateId",wxTemplateConfigDO1.getTemplateId());//
            jsonObject.put("data",key);
@ -566,15 +601,233 @@ public class TasyNatService {
            logger.info("核酸检测支付提醒模板消息推送param"+jsonObject.toString());
            String tmResilt= tmpPush(jsonObject);
            return tmResilt;
        } else if ("hsyycg".equalsIgnoreCase(scene)) {
            //开始发送模板消息
            logger.info("开始发送模板消息");
            List<WxTemplateConfigDO> wxTemplateConfigDO = wxTemplateConfigDao.findByWechatIdAndScene("xm_tasy_wx",scene);
            WxTemplateConfigDO wxTemplateConfigDO1 = new WxTemplateConfigDO();
            if (wxTemplateConfigDO!=null&&wxTemplateConfigDO.size()>0){
                wxTemplateConfigDO1 = wxTemplateConfigDO.get(0);
            }
            url=wxTemplateConfigDO1.getUrl()+relationCode;
            first.put("value",wxTemplateConfigDO1.getFirst().replace("key1",name));
            first.put("color",wxTemplateConfigDO1.getKeyword6());
            key1.put("value",name);
            key1.put("color",wxTemplateConfigDO1.getKeyword6());
            key2.put("value",baseNatAppointmentD0.getInspectionName());
            key2.put("color",wxTemplateConfigDO1.getKeyword6());
            key3.put("value",baseNatAppointmentD0.getAppointmentTime());
            key3.put("color",wxTemplateConfigDO1.getKeyword6());
            key4.put("value",wxTemplateConfigDO1.getKeyword4());
            key4.put("color",wxTemplateConfigDO1.getKeyword6());
            remark.put("value",wxTemplateConfigDO1.getRemark());
            remark.put("color",wxTemplateConfigDO1.getKeyword6());
            key.put("first",first);
            key.put("keyword1",key1);
            key.put("keyword2",key2);
            key.put("key3",key3);
            key.put("key4",key4);
            key.put("remark",remark);
            JSONObject jsonObject = new JSONObject();
            jsonObject.put("tempateId",wxTemplateConfigDO1.getTemplateId());//
            jsonObject.put("data",key);
            jsonObject.put("openId",openId);
            jsonObject.put("url",url);
            logger.info("核酸检测预约成功模板消息推送param"+jsonObject.toString());
            String tmResilt= tmpPush(jsonObject);
            return tmResilt;
        }
        return "";
    }
    //查询排班部门
    public String departMent(String ApplyType){
        String url = "";
        WlyyHospitalSysDictDO wlyyHospitalSysDictDO = wlyyHospitalSysDictDao.findById("DepartMentUrl");
        if (wlyyHospitalSysDictDO!=null){
            url=wlyyHospitalSysDictDO.getDictValue();
        }
        url+="?ApplyType="+ApplyType;
        System.out.println(url);
        String response = httpClientUtil.get(url,"UTF-8");
        System.out.println("res"+response);
        saveHttpLog("departMent",ApplyType,response,url);
        return response;
    }
    //保存预约
    public String saveRegOrder(String DepartId,String OrderDate,String OrderTime,String OrderID,String HisID,String Tel,
                               String HisName,String ApplyType){
        String url = "";
        WlyyHospitalSysDictDO wlyyHospitalSysDictDO = wlyyHospitalSysDictDao.findById("saveNatOrderUrl");
        if (wlyyHospitalSysDictDO!=null){
            url=wlyyHospitalSysDictDO.getDictValue();
        }
        url+="?DepartId="+DepartId+"&OrderDate="+OrderDate+"&OrderTime="+OrderTime+"&OrderID="+OrderID
                +"&HisID="+HisID+"&Tel="+Tel+"&HisName="+HisName+"&ApplyType="+ApplyType;
        System.out.println(url);
        String response = httpClientUtil.get(url,"UTF-8");
        System.out.println("res"+response);
        saveHttpLog("saveRegOrder",url,response,url);
        return response;
    }
    //取消预约
    public String cancleOrder(String HisID,String HisSeqNo,String OrderNumber) throws Exception{
        String url = "";
        WlyyHospitalSysDictDO wlyyHospitalSysDictDO = wlyyHospitalSysDictDao.findById("CancleOrderUrl");
        if (wlyyHospitalSysDictDO!=null){
            url=wlyyHospitalSysDictDO.getDictValue();
        }
        url+="?HisID="+HisID+"&HisSeqNo="+HisSeqNo+"&OrderNumber="+OrderNumber;
        System.out.println(url);
        String response = httpClientUtil.get(url,"UTF-8");
        System.out.println("res"+response);
        saveHttpLog("cancleOrder",url,response,url);
        return response;
    }
    //查询排班医生
    public String GetDoctorWorkDate(String ApplyType,String DepartId){
        String url = "";
        WlyyHospitalSysDictDO wlyyHospitalSysDictDO = wlyyHospitalSysDictDao.findById("GetDoctorWorkDateUrl");
        if (wlyyHospitalSysDictDO!=null){
            url=wlyyHospitalSysDictDO.getDictValue();
        }
        url+="?ApplyType="+ApplyType+"&DepartId="+DepartId;
        System.out.println(url);
        String response = httpClientUtil.get(url,"UTF-8");
        System.out.println("res"+response);
        saveHttpLog("departMent",url,response,url);
        return response;
    }
    //预约查询
    public String GetOrderInfo(String HisID,String ApplyType){
        String url = "";
        WlyyHospitalSysDictDO wlyyHospitalSysDictDO = wlyyHospitalSysDictDao.findById("GetOrderInfoUrl");
        if (wlyyHospitalSysDictDO!=null){
            url=wlyyHospitalSysDictDO.getDictValue();
        }
        url+="?ApplyType="+ApplyType+"&HisID="+HisID;
        System.out.println(url);
        String response = httpClientUtil.get(url,"UTF-8");
        System.out.println("res"+response);
        saveHttpLog("departMent",url,response,url);
        return response;
    }
    //获取号源
    public String GetOrderSource(String DepartId,String DoctorId,String QueryDate,String ApplyType,String IsAll,String QueryTime){
        String url = "";
        WlyyHospitalSysDictDO wlyyHospitalSysDictDO = wlyyHospitalSysDictDao.findById("GetOrderSourceUrl");
        if (wlyyHospitalSysDictDO!=null){
            url=wlyyHospitalSysDictDO.getDictValue();
        }
        url+="?DepartId="+DepartId+"&DoctorId="+DoctorId+"&QueryDate="+QueryDate+"&ApplyType="+ApplyType+"&IsAll="+IsAll+"&QueryTime="+QueryTime;
        System.out.println(url);
        String response = httpClientUtil.get(url,"UTF-8");
        System.out.println("res"+response);
        saveHttpLog("GetOrderInfo",url,response,url);
        return response;
    }
    //查询患者就诊卡
    public String findHisPatientCard(String idcard) throws Exception{
        String api = "QuerySickInfo";
        String msgHeader ="<?xml version=\"1.0\" encoding=\"utf-8\"?> " +
                "<root> " +
                "   <serverName>"+api+"</serverName>  " +
                "   <format>xml</format>" +
                "   <callOperator>"+operator+"</callOperator> " +
                "   <certificate>"+key+"</certificate> " +
                "</root>";
        String condition ="";
        if (StringUtils.isNoneBlank(idcard)){
            condition += "<IdNo>"+idcard+"</IdNo>";
            condition += "<IdType>100</IdType>";
        }
    public static void main(String[] args) throws Exception{
        String xml="<StringResponse><StringValue><![CDATA[<?xml version=\"1.0\" encoding=\"utf-8\"?><root><ReturnCode>1</ReturnCode><hisTradeNo>599907010</hisTradeNo><ReturnMsg></ReturnMsg></root>]]></StringValue></StringResponse>";
        String msgBody ="<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
                "<root>"+condition+"</root>";
        Map<String,String> params = new HashedMap();
        params.put("msgHeader",msgHeader);
        params.put("msgBody",msgBody);
        logger.info("QuerySickInfo params:"+params.toString());
        String xml = getTaszWebServiceInfo("CallInterface",params,getOperateUrl());
        xml=xml.substring(xml.indexOf("<root>"),xml.lastIndexOf("]]"));
        System.out.println(xml);
        XMLSerializer xmlSerializer = new XMLSerializer();
        String json = xmlSerializer.read(xml).toString();
        logger.info("QuerySickInfo json:"+json);
        return json;
    }
    public JSONArray findPatientCard(String patient) throws Exception{
        BasePatientDO basePatientDO = basePatientDao.findById(patient);
        String idcard="";
        if (basePatientDO!=null){
            idcard=basePatientDO.getIdcard();
        }
        String res = findHisPatientCard(idcard);
        JSONArray jsonArray = new JSONArray();
        if (StringUtils.isNoneBlank(res)){
            JSONObject jsonObject = JSON.parseObject(res);
            jsonArray.add(jsonObject);
            return jsonArray;
        }
        return null;
    }
    //病人单据状态查询
    public String QueryApplyInfo(String nullahNumber) throws Exception{
        String api = "QueryApplyInfo";
        String msgHeader ="<?xml version=\"1.0\" encoding=\"utf-8\"?> " +
                "<root> " +
                "   <serverName>"+api+"</serverName>  " +
                "   <format>xml</format>" +
                "   <callOperator>"+operator+"</callOperator> " +
                "   <certificate>"+key+"</certificate> " +
                "</root>";
        String condition ="";
        if (StringUtils.isNoneBlank(nullahNumber)){
            condition += "<NullahNumber>"+nullahNumber+"</NullahNumber>";
        }
        String msgBody ="<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
                "<root>"+condition+"</root>";
        Map<String,String> params = new HashedMap();
        params.put("msgHeader",msgHeader);
        params.put("msgBody",msgBody);
        logger.info("QueryApplyInfo params:"+params.toString());
        String xml = getTaszWebServiceInfo("CallInterface",params,getOperateUrl());
        xml=xml.substring(xml.indexOf("<root>"),xml.lastIndexOf("]]"));
        XMLSerializer xmlSerializer = new XMLSerializer();
        String json = xmlSerializer.read(xml).toString();
        logger.info("QueryApplyInfo json:"+json);
        return json;
    }
    public void savePayStatusByHis(String patientId) throws Exception {
        List<BaseNatAppointmentDO> baseNatAppointmentDOList = baseNatAppointmentDao.findPayStatusByPatientId(patientId);
        for (BaseNatAppointmentDO baseNatAppointmentDO:baseNatAppointmentDOList){
                String res = QueryApplyInfo(baseNatAppointmentDO.getRealOrder());
                JSONObject jsonObject = JSON.parseObject(res);
                if (jsonObject!=null){
                    if (jsonObject.getString("ReturnCode").equalsIgnoreCase("1")){
                        String voucherNo = jsonObject.getString("ApplyNo");
                        baseNatAppointmentDO.setVoucherNo(voucherNo);
                        if ("已扣费".equalsIgnoreCase(jsonObject.getString("Status"))){
                            baseNatAppointmentDO.setPayStatus("1");
                        }
                        baseNatAppointmentDao.save(baseNatAppointmentDO);
                    }
                }
            }
    }
    public String selectByRelationCode(String relationCode) throws  Exception{
        BusinessOrderDO businessOrderDO = businessOrderDao.selectByRelationCode(relationCode);
        if (NumberUtils.isDigits(relationCode) ){
            BaseNatAppointmentDO baseNatAppointmentDO = baseNatAppointmentDao.findOne(Integer.valueOf(relationCode));
            if (baseNatAppointmentDO!=null&&"-1".equalsIgnoreCase(baseNatAppointmentDO.getIsSuccess())){
                throw new Exception("订单已取消");
            }
            if (businessOrderDO!=null&&businessOrderDO.getStatus()==1){
                throw new Exception("订单已支付");
            }
        }
        return businessOrderDO.getRematk();
    }
}

+ 9 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/BaseNatAppointmentDO.java

@ -59,6 +59,15 @@ public class BaseNatAppointmentDO extends IntegerIdentityEntity {
    private String hospitalFlag;
    private String consumer;
    private String consumerName;
    private String oderNum;
    public String getOderNum() {
        return oderNum;
    }
    public void setOderNum(String oderNum) {
        this.oderNum = oderNum;
    }
    public String getConsumer() {
        return consumer;

+ 4 - 4
common/common-entity/src/main/java/com/yihu/jw/entity/order/BusinessOrderDO.java

@ -34,7 +34,7 @@ public class BusinessOrderDO extends IntegerIdentityEntity {
    private String relationCode;//业务关联code
    private String relationName;//业务关联名称
    private String description;//支付备注
    private String rematk;//病人描述
    private String remark;//病人描述
    private Integer payType;//支付类型1微信2支付宝3易联众支付
    private Double payPrice;//支付金额
    private Date payTime;//支付时间
@ -261,11 +261,11 @@ public class BusinessOrderDO extends IntegerIdentityEntity {
    @Column(name = "remark")
    public String getRematk() {
        return rematk;
        return remark;
    }
    public void setRematk(String rematk) {
        this.rematk = rematk;
    public void setRematk(String remark) {
        this.remark = remark;
    }
    @Column(name = "yk_order_no")

+ 58 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/voluntary/VoluntaryRecruitmentArrangeDO.java

@ -1,10 +1,12 @@
package com.yihu.jw.entity.voluntary;
import com.yihu.jw.entity.UuidIdentityEntityWithCreateTime;
import org.springframework.transaction.annotation.Transactional;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
/**
 * Created with IntelliJ IDEA.
@ -42,6 +44,17 @@ public class VoluntaryRecruitmentArrangeDO extends UuidIdentityEntityWithCreateT
     */
    private String station;
    /**
     *非数据库字段
     */
    private String companyName;//企业名称
    private String phone;//服务人员手机
    private String idcard;//服务人员身份证
    private String vaccination;//是否接种疫苗 0未接种 1接种1针 2已接种
    private String experience;//是否有核酸设备运维经验
    @Column(name = "company_id")
    public String getCompanyId() {
        return companyId;
@ -95,4 +108,49 @@ public class VoluntaryRecruitmentArrangeDO extends UuidIdentityEntityWithCreateT
    public void setStation(String station) {
        this.station = station;
    }
    @Transient
    public String getCompanyName() {
        return companyName;
    }
    public void setCompanyName(String companyName) {
        this.companyName = companyName;
    }
    @Transient
    public String getPhone() {
        return phone;
    }
    public void setPhone(String phone) {
        this.phone = phone;
    }
    @Transient
    public String getIdcard() {
        return idcard;
    }
    public void setIdcard(String idcard) {
        this.idcard = idcard;
    }
    @Transient
    public String getVaccination() {
        return vaccination;
    }
    public void setVaccination(String vaccination) {
        this.vaccination = vaccination;
    }
    @Transient
    public String getExperience() {
        return experience;
    }
    public void setExperience(String experience) {
        this.experience = experience;
    }
}

+ 1 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/dao/voluntary/VoluntaryRecruitmentPeopleDao.java

@ -20,4 +20,5 @@ public interface VoluntaryRecruitmentPeopleDao extends PagingAndSortingRepositor
    @Query("select count(1) from VoluntaryRecruitmentPeopleDO where companyId = ?1 ")
    Integer findByCompanyId(String CompanyId);
}

+ 160 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/voluntary/VoluntaryRecruitmentArrangeEndpoint.java

@ -0,0 +1,160 @@
package com.yihu.jw.base.endpoint.voluntary;
import com.yihu.jw.base.dao.voluntary.VoluntaryRecruitmentPeopleDao;
import com.yihu.jw.base.service.voluntary.VoluntaryRecruitmentArrangeService;
import com.yihu.jw.entity.voluntary.VoluntaryRecruitmentArrangeDO;
import com.yihu.jw.entity.voluntary.VoluntaryRecruitmentPeopleDO;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ListEnvelop;
import com.yihu.jw.restmodel.web.PageEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import jxl.Workbook;
import jxl.write.Label;
import jxl.write.WritableSheet;
import jxl.write.WritableWorkbook;
import jxl.write.WriteException;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.io.OutputStream;
import java.util.List;
/**
 * Created by Bing on 2021/8/4.
 */
@RestController
@RequestMapping(value = "voluntaryRecruitmentArrange")
@Api(value = "新冠-志愿招募安排管理", description = "新冠-志愿招募安排管理", tags = {"新冠-志愿招募安排管理"})
public class VoluntaryRecruitmentArrangeEndpoint extends EnvelopRestEndpoint {
    @Autowired
    private VoluntaryRecruitmentArrangeService arrangeService;
    @Autowired
    private VoluntaryRecruitmentPeopleDao peopleDao;
    @GetMapping(value = "page")
    @ApiOperation(value = "获取分页")
    public PageEnvelop<VoluntaryRecruitmentArrangeDO> page(
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
            @RequestParam(value = "sorts", required = false) String sorts,
            @ApiParam(name = "page", value = "分页大小", required = true, defaultValue = "1")
            @RequestParam(value = "page") int page,
            @ApiParam(name = "size", value = "页码", required = true, defaultValue = "15")
            @RequestParam(value = "size") int size) throws Exception {
        List<VoluntaryRecruitmentArrangeDO> appVersions = arrangeService.search(fields, filters, sorts, page, size);
        int count = (int) arrangeService.getCount(filters);
        return success(appVersions, count, page, size, VoluntaryRecruitmentArrangeDO.class);
    }
    @GetMapping(value = "list")
    @ApiOperation(value = "获取列表")
    public ListEnvelop<VoluntaryRecruitmentArrangeDO> list(
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
            @RequestParam(value = "sorts", required = false) String sorts) throws Exception {
        List<VoluntaryRecruitmentArrangeDO> appVersions = arrangeService.search(fields, filters, sorts);
        return success(appVersions, VoluntaryRecruitmentArrangeDO.class);
    }
    @GetMapping(value = "/excelControl/exportExcel")
    @ApiOperation("导出列表")
    @ResponseBody
    public void searchList(
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
            @RequestParam(value = "sorts", required = false) String sorts,
            HttpServletResponse response) {
        try {
            List<VoluntaryRecruitmentArrangeDO> appVersions = arrangeService.search(fields, filters, sorts);
            response.setContentType("octets/stream");
            response.setHeader("Content-Disposition", "attachment; filename=" + new String("volunteerArrange.xls"));
            OutputStream os = response.getOutputStream();
            this.write(os, appVersions);
        } catch (Exception ex) {
            Envelop.getError("导出失败");
        }
    }
    private void write(OutputStream os, List<VoluntaryRecruitmentArrangeDO> list) throws Exception {
        WritableWorkbook wwb = Workbook.createWorkbook(os);
        try {
            WritableSheet sheet = wwb.createSheet("sheet", 1);
            String header[] = {"序号", "日期","服务时间","所在单位", " 姓名", "手机号", "身份证号", "是否有核酸检测信息采集设备运维经验","是否接种疫苗"};
            int i = 0;
            for (String h : header) {
                addCell(sheet, 0, i, h);
                i++;
            }
            int j = 1;
            int ii=1;
            for (VoluntaryRecruitmentArrangeDO tmp : list) {
                VoluntaryRecruitmentPeopleDO peopleDO= peopleDao.findOne(tmp.getPeopleId());
                if (null == peopleDO){
                    continue;
                }
                String vaccinationName = "未接种";
                String experienceName = "否";
                if (StringUtils.isNotBlank(peopleDO.getVaccination())){
                    String  vaccination = peopleDO.getVaccination();
                    switch (vaccination){
                        case "1":
                            vaccinationName = "已接种一针";
                            break;
                        case "2":
                            vaccinationName = "已接种";
                            break;
                    }
                }
                if (StringUtils.isNotBlank(peopleDO.getExperience())){
                    String  experience = peopleDO.getExperience();
                    switch (experience){
                        case "0":
                            experienceName = "否";
                            break;
                        case "1 ":
                            experienceName = "是";
                            break;
                    }
                }
                addCell(sheet, j, 0, ii + "");
                addCell(sheet, j, 1, tmp.getDay());
                addCell(sheet, j, 2, tmp.getTime());
                addCell(sheet, j, 3, peopleDO.getCompanyName());
                addCell(sheet, j, 4, tmp.getPeopleName() + "");
                addCell(sheet, j, 5, peopleDO.getPhone()+"");
                addCell(sheet, j, 6, peopleDO.getIdcard() + "");
                addCell(sheet, j, 7, experienceName);
                addCell(sheet, j, 8, vaccinationName);
                j++;
                ii++;
            }
            wwb.write();
            wwb.close();
        } catch (Exception e) {
            e.printStackTrace();
            if (wwb != null) wwb.close();
        }
    }
    private void addCell(WritableSheet ws, int row, int column, String data) throws WriteException {
        Label label = new Label(column, row, data);
        ws.addCell(label);
    }
}

+ 94 - 4
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/voluntary/VoluntaryRecruitmentEndpoint.java

@ -1,14 +1,15 @@
package com.yihu.jw.base.endpoint.voluntary;
import com.yihu.jw.base.dao.voluntary.VoluntaryRecruitmentCompanyDao;
import com.yihu.jw.base.dao.voluntary.VoluntaryRecruitmentPeopleDao;
import com.yihu.jw.base.service.voluntary.VoluntaryRecruitmentArrangeService;
import com.yihu.jw.base.service.voluntary.VoluntaryRecruitmentCompanyService;
import com.yihu.jw.base.service.voluntary.VoluntaryRecruitmentPeopleService;
import com.yihu.jw.base.service.voluntary.VoluntaryRecruitmentService;
import com.yihu.jw.entity.voluntary.VoluntaryRecruitmentCompanyDO;
import com.yihu.jw.entity.voluntary.VoluntaryRecruitmentPeopleDO;
import com.yihu.jw.hospital.dict.service.WlyyHospitalSysDictService;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.PageEnvelop;
import com.yihu.jw.restmodel.web.*;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.utils.StringUtil;
import io.swagger.annotations.Api;
@ -39,6 +40,12 @@ public class VoluntaryRecruitmentEndpoint extends EnvelopRestEndpoint {
    private VoluntaryRecruitmentPeopleDao peopleDao;
    @Autowired
    private WlyyHospitalSysDictService wlyyHospitalSysDictService;
    @Autowired
    private VoluntaryRecruitmentArrangeService arrangeService;
    @Autowired
    private VoluntaryRecruitmentPeopleService peopleService;
    @Autowired
    private VoluntaryRecruitmentCompanyDao companyDao;
    @PostMapping(value = "add")
    @ApiOperation(value = "企业报名")
@ -135,6 +142,89 @@ public class VoluntaryRecruitmentEndpoint extends EnvelopRestEndpoint {
        }
    }
    @GetMapping(value = "arrangeInfoList")
    @ApiOperation(value = "获取企业人员安排数量列表")
    public ListEnvelop arrangeInfoList (
            @ApiParam(name = "companyId", value = "企业id")
            @RequestParam(value = "companyId", required = true) String companyId){
        try {
            return ListEnvelop.getSuccess("安排成功",voluntaryRecruitmentService.arrangeInfoList(companyId));
        }catch (Exception e){
            return failedListEnvelopException2(e);
        }
    }
    @GetMapping(value = "arrangeInfoDetail")
    @ApiOperation(value = "获取企业安排信息详情详情")
    public ListEnvelop arrangeInfoDetail (
            @ApiParam(name = "companyId", value = "企业id")
            @RequestParam(value = "companyId", required = true) String companyId,
            @ApiParam(name = "day", value = "日期 yyyy-MM-dd格式")
            @RequestParam(value = "day", required = false) String day){
        try {
            return ListEnvelop.getSuccess("安排成功",voluntaryRecruitmentService.arrangeInfoDetail(companyId,day));
        }catch (Exception e){
            return failedListEnvelopException2(e);
        }
    }
    @GetMapping(value = "companyPeopleUnArrange")
    @ApiOperation(value = "获取企业志愿者列表(未被安排)")
    public ListEnvelop companyPeopleUnArrange (
            @ApiParam(name = "companyId", value = "企业id")
            @RequestParam(value = "companyId", required = true) String companyId,
            @ApiParam(name = "day", value = "日期 yyyy-MM-dd格式")
            @RequestParam(value = "day", required = true) String day,
            @ApiParam(name = "time", value = "时间")
            @RequestParam(value = "time", required = true) String time){
        try {
            return ListEnvelop.getSuccess("安排成功",voluntaryRecruitmentService.companyPeopleUnArrange(companyId,day,time));
        }catch (Exception e){
            return failedListEnvelopException2(e);
        }
    }
    @PostMapping(value = "arrangeDelete")
    @ApiOperation(value = "企业志愿者安排删除")
    public Envelop arrangeDelete(
            @ApiParam(name = "ids", value = "id串,中间用,分隔", required = true)
            @RequestParam(value = "ids") String ids) {
        arrangeService.delete(ids.split(","));
        return success("删除成功");
    }
    @GetMapping(value = "companyPeopleList")
    @ApiOperation(value = "企业志愿者名单列表")
    public ListEnvelop<VoluntaryRecruitmentPeopleDO> companyPeopleList (
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
            @RequestParam(value = "sorts", required = false) String sorts) throws Exception {
        List<VoluntaryRecruitmentPeopleDO> appVersions = peopleService.search(fields, filters, sorts);
        return success(appVersions, VoluntaryRecruitmentPeopleDO.class);
    }
    @PostMapping(value = "companyPeopleDelete")
    @ApiOperation(value = "企业志愿者名单删除")
    public Envelop companyPeopleDelete(
            @ApiParam(name = "ids", value = "id串,中间用,分隔", required = true)
            @RequestParam(value = "ids") String ids) {
        String[] idsTmp = ids.split(",");
        List<VoluntaryRecruitmentPeopleDO> List = peopleService.getRepository().queryByIdIn(idsTmp);
        peopleService.delete(ids.split(","));
        for (VoluntaryRecruitmentPeopleDO tmp:List){
            VoluntaryRecruitmentCompanyDO companyDO = companyDao.findOne(tmp.getCompanyId());
            if (null !=companyDO ){
                Integer count = peopleService.getRepository().findByCompanyId(tmp.getCompanyId());
                companyDO.setNum(count);
                companyDao.save(companyDO);
            }
        }
        return success("删除成功");
    }
    @ApiOperation("查询字典")
    @GetMapping(value= "findDict")
    public MixEnvelop findDict(@ApiParam(name = "name", value = "name", required = false)

+ 35 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/service/voluntary/VoluntaryRecruitmentService.java

@ -7,11 +7,15 @@ import com.yihu.jw.entity.voluntary.VoluntaryRecruitmentArrangeDO;
import com.yihu.jw.entity.voluntary.VoluntaryRecruitmentCompanyDO;
import com.yihu.jw.entity.voluntary.VoluntaryRecruitmentPeopleDO;
import com.yihu.jw.utils.StringUtil;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
 * Created with IntelliJ IDEA.
@ -29,6 +33,8 @@ public class VoluntaryRecruitmentService {
    private VoluntaryRecruitmentArrangeDao arrangeDao;
    @Autowired
    private VoluntaryRecruitmentPeopleDao peopleDao;
    @Autowired
    private JdbcTemplate jdbcTemplate;
    /**
     * 人员安排
@ -50,6 +56,35 @@ public class VoluntaryRecruitmentService {
        arrangeDao.save(arrangeDOs);
    }
    /**
     * 企业人员安排信息
     */
    public List<Map<String,Object>> arrangeInfoList(String companyId){
        String sql = " select day,time,count(people_id) from voluntary_recruitment_arrange where company_id = '"+companyId+"' " +
                " group by day,time order by day,time asc ";
        List<Map<String,Object>> result = jdbcTemplate.queryForList(sql);
        return result;
    }
    public List<VoluntaryRecruitmentArrangeDO> arrangeInfoDetail(String companyId,String day){
        String sql = "select ar.*,po.company_name,po.phone,po.idcard,po.vaccination,po.experience from " +
                " voluntary_recruitment_arrange ar  INNER JOIN voluntary_recruitment_people po on ar.people_id = po.id " +
                " where ar.company_id = '"+companyId+"' " ;
        if (StringUtils.isNoneBlank(day)){
            sql += " and ar.day = '"+day+"' ";
        }
        sql += " order by ar.day,ar.time asc ";
        List<VoluntaryRecruitmentArrangeDO> result = jdbcTemplate.query(sql,new BeanPropertyRowMapper<>(VoluntaryRecruitmentArrangeDO.class));
        return result;
    }
    public List<VoluntaryRecruitmentPeopleDO> companyPeopleUnArrange(String companyId,String day,String time){
        String sql =" select po.* from voluntary_recruitment_people po  LEFT JOIN voluntary_recruitment_arrange ar " +
                " on ar.people_id = po.id where ar.company_id = '"+companyId+"'  and ar.`day`='"+day+"' " +
                "  and ar.time<> '"+time+"' group by ar.day,ar.time order by ar.day,ar.time asc ";
        List<VoluntaryRecruitmentPeopleDO> result = jdbcTemplate.query(sql,new BeanPropertyRowMapper<>(VoluntaryRecruitmentPeopleDO.class));
      return result;
    }
    public VoluntaryRecruitmentCompanyDO findByContactsAndPhone(String contacts,String phone){
        List<VoluntaryRecruitmentCompanyDO> companyDOs = companyDao.findByContactsAndPhone(contacts,phone);

+ 40 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/patient/PatientBirthdayWishesEndpoint.java

@ -0,0 +1,40 @@
package com.yihu.jw.care.endpoint.patient;
import com.yihu.jw.care.endpoint.BaseController;
import com.yihu.jw.care.service.birthday.BirthdayWishesService;
import com.yihu.jw.entity.care.birthday.BirthDayWishesToPatient;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
 * Created by Bing on 2021/8/4.
 */
@RestController
@RequestMapping(value = "patient/birthday")
@Api(tags = "居民生日祝福", description = "居民生日祝福")
public class PatientBirthdayWishesEndpoint extends BaseController {
    @Autowired
    private BirthdayWishesService birthdayWishesService;
    @RequestMapping(value = "/getWishesById", method = RequestMethod.GET)
    @ApiOperation(value = "根据模板id获取祝福信息")
    public String getWishesById(@ApiParam(name = "id", value = "发送记录id")
                                  @RequestParam(required = true) Long id) {
        try {
            BirthDayWishesToPatient result = birthdayWishesService.getWishesById(id);
            if (null == result){
                return write(-1, "无对应祝福信息");
            }
            return write(200,"获取成功","data",result);
        } catch (Exception e) {
            return errorResult(e);
        }
    }
}

+ 13 - 3
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/birthday/BirthdayWishesService.java

@ -185,13 +185,18 @@ public class BirthdayWishesService {
                "AND CASE LENGTH(p.idcard) WHEN  18 then SUBSTR(p.idcard,11,4) when 15 then SUBSTR(p.idcard, 9,4) END =  '" + dateString + "' " ;
        List<Map<String, Object>> patientInfos =  jdbcTemplate.queryForList(sql);
        //整理未发送居民信息
        for(Map<String, Object> map : patientInfos){
            if (sendPatients == null || !sendPatients.contains(map.get("patient"))) {
        Iterator<Map<String, Object>> iterator = patientInfos.iterator();
        while (iterator.hasNext()){
            Map<String, Object> map = iterator.next();
            if (sendPatients == null || !sendPatients.contains(map.get("patient").toString())) {
                int age = IdCardUtil.getAgeForIdcard(map.get("idcard") + "");
                Date birthday = IdCardUtil.getBirthdayForIdcard(map.get("idcard") + "");
                map.put("age", age);
                map.put("birthday", DateUtil.dateToStr(birthday, "yyyy-MM-dd"));
            }
            else {
                iterator.remove();
            }
        }
        return patientInfos;
    }
@ -481,7 +486,7 @@ public class BirthdayWishesService {
//            System.out.println("ES保存成功!");
            //将发送生日祝福的居民code存起来
            Calendar today = Calendar.getInstance();
            today.set(Calendar.HOUR, 23);
            today.set(Calendar.HOUR_OF_DAY, 23);
            today.set(Calendar.MINUTE, 59);
            today.set(Calendar.SECOND, 59);
            today.set(Calendar.MILLISECOND, 999);
@ -507,4 +512,9 @@ public class BirthdayWishesService {
        List<BirthDayWishesToPatient> patientList = jdbcTemplate.query(sql.toString(),new BeanPropertyRowMapper<>(BirthDayWishesToPatient.class));
        return patientList;
    }
    public BirthDayWishesToPatient getWishesById(Long id){
        BirthDayWishesToPatient tmp = bwToPatientDao.findOne(id);
        return tmp;
    }
}

+ 1 - 2
svr/svr-cloud-device/src/main/java/com/yihu/jw/care/service/YsDeviceService.java

@ -97,7 +97,7 @@ public class YsDeviceService {
                message = message.substring(0,message.length()-1);
            }
        }
        System.out.println("推送消息:\n"+message+"\n");
        JSONObject result = new JSONObject();
        try {
            String decodeStr = messageDecrypt(message,YsConfig.msgDataKey);
@ -202,7 +202,6 @@ public class YsDeviceService {
        }catch (Exception e){
            e.printStackTrace();
        }
        logger.info("萤石摄像机消息推送:"+result.toString());
        return result;
        //https://www.yuque.com/u1400669/kb/mlqrm2
        //https://www.yuque.com/u1400669/kb/div5py

+ 109 - 2
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/patient/PatientNoLoginEndPoint.java

@ -81,8 +81,10 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import net.sf.json.JSONArray;
import net.sf.json.xml.XMLSerializer;
import org.apache.axis.utils.StringUtils;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang.time.DateUtils;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import org.apache.jasper.tagplugins.jstl.core.Url;
@ -97,8 +99,10 @@ import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.math.BigDecimal;
import java.net.URLEncoder;
import java.nio.charset.Charset;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.TimeUnit;
@ -1493,6 +1497,9 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
            @ApiParam(name = "appletCode", value = "appletCode", required = false)
            @RequestParam(value = "appletCode",required = false)String appletCode) throws Exception {
        try {
            if ("xm_tasy_wx".equalsIgnoreCase(wxId)){
               return ObjEnvelop.getSuccess("操作成功",tasyNatService.selectByRelationCode(relationCode));
            }
            return ObjEnvelop.getSuccess("ok",businessOrderService.selectOrderByRelationCode(relationCode,tradeType,wxId,payFlag,appletCode));
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
@ -1834,6 +1841,8 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
        try {
            if (wxId.equalsIgnoreCase("xm_zsyy_wx")){
                prescriptionService.savePayStatusByHis(patientId);
            }else if (wxId.equalsIgnoreCase("xm_tasy_wx")){
                tasyNatService.savePayStatusByHis(patientId);
            }
            logger.info("同步数据成功");
            return  prescriptionService.getNatRecords(patientId,id,payStatus,appointmentTime,isSuccess,page,pageSize);
@ -2276,6 +2285,12 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
            if ("tmpPush".equalsIgnoreCase(api)){
                return success("操作成功",tasyNatService.tmpPush(jsonObject));
            }
            if ("CancleOrder".equalsIgnoreCase(api)){
                return success("操作成功",tasyNatService.cancleOrder(jsonObject.getString("HisID"),jsonObject.getString("no"),jsonObject.getString("OrderNumber")));
            }
            if ("GetOrderInfo".equalsIgnoreCase(api)){
                return success("操作成功",tasyNatService.GetOrderInfo(jsonObject.getString("HisID"),jsonObject.getString("ApplyType")));
            }
            return success("");
        } catch (Exception e){
            return  failedException(e);
@ -2319,10 +2334,17 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
                                chargeObj.put("icCardNo",baseNatAppointmentDO.getMedicare());
                                chargeObj.put("patientName",baseNatAppointmentDO.getName());
                                //调用扣费接口
                                tasyNatService.ChargenucleicBill(chargeObj);
                                tasyNatService.sendWxtemplateMessaeg(baseNatAppointmentDO.getConsumer(),"hszfcg",baseNatAppointmentDO.getName(),baseNatAppointmentDO.getId().toString());
                                String feeRes=tasyNatService.ChargenucleicBill(chargeObj);
                                JSONObject feeObj = JSONObject.parseObject(feeRes);
                                if (feeObj!=null){
                                    if ("1".equalsIgnoreCase(feeObj.getString("ReturnCode"))){
                                        String voucherNo = feeObj.getString("ApplyNo");
                                        baseNatAppointmentDO.setVoucherNo(voucherNo);
                                    }
                                }
                                baseNatAppointmentDO.setPayStatus("1");
                                baseNatAppointmentDao.save(baseNatAppointmentDO);
                                tasyNatService.sendWxtemplateMessaeg(baseNatAppointmentDO.getConsumer(),"hszfcgtx",baseNatAppointmentDO.getName(),baseNatAppointmentDO.getId().toString());
                            }
                            return "SUCCESS";
                    }
@ -2333,6 +2355,7 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
        }
        return  "failed";
    }
    @GetMapping("/saveNatAppointment")
    @ApiOperation(value = "核酸检测预约接口")
    public Envelop saveNatAppointment(@ApiParam(name = "chargeAmount", value = "chargeAmount")
@ -2401,4 +2424,88 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
            return Envelop.getError(e.getMessage());
        }
    }
    @GetMapping("/BS10142")
    public ListEnvelop BS10142(
            @ApiParam(name = "deptCode", value = "deptCode")
            @RequestParam(value = "deptCode",required = false)String deptCode,
            @ApiParam(name = "docCode", value = "docCode")
            @RequestParam(value = "docCode",required = false)String docCode,
            @ApiParam(name = "chargeType", value = "chargeType")
            @RequestParam(value = "chargeType",required = false)String chargeType) throws Exception {
        if("xm_zsyy_wx".equalsIgnoreCase(wxId)){
            return success(entranceService.BS10142(deptCode,docCode,chargeType,false));
        }else if ("xm_tasy_wx".equalsIgnoreCase(wxId)){
            String res=tasyNatService.departMent(deptCode);
            String dept="";
            JSONObject deptres = JSON.parseObject(res);
            if (deptres!=null){
                if (deptres.getString("success").equalsIgnoreCase("true")){
                    JSONObject data = JSON.parseObject(deptres.getString("data"));
                    dept=data.getString("Dept");
                    com.alibaba.fastjson.JSONArray jsonArray1 = JSON.parseArray(dept);
                    if (jsonArray1!=null&&jsonArray1.size()>0){
                        JSONObject jsonObject = jsonArray1.getJSONObject(0);
                        dept=jsonObject.getString("Id");
                        System.out.println(dept);
                    }
                    String json=tasyNatService.GetDoctorWorkDate("3",dept);
                    JSONObject jsonObject = JSON.parseObject(json);
                    jsonObject.put("dept",dept);
                    com.alibaba.fastjson.JSONArray jsonArray = new com.alibaba.fastjson.JSONArray();
                    jsonArray.add(jsonObject);
                    return success(jsonArray);
                }else {
                    return ListEnvelop.getError("获取部门编码失败");
                }
            }else {
                return ListEnvelop.getError("无效部门");
            }
        }else {
            return ListEnvelop.getError("未开放");
        }
    }
    @GetMapping("/BS10143")
    public ListEnvelop BS10143(@ApiParam(name = "day", value = "day")
                               @RequestParam(value = "day",required = false)String day,
                               @ApiParam(name = "dept", value = "dept")
                               @RequestParam(value = "dept",required = false)String dept,
                               @ApiParam(name = "doctor", value = "doctor")
                               @RequestParam(value = "doctor",required = false)String doctor,
                               @ApiParam(name = "IsAll", value = "IsAll")
                               @RequestParam(value = "IsAll",required = false)String IsAll,
                               @ApiParam(name = "pm", value = "pm")
                               @RequestParam(value = "pm",required = false)String pm) throws Exception {
        if("xm_zsyy_wx".equalsIgnoreCase(wxId)){
            return success(entranceService.BS10143(day,pm,false));
        }else if ("xm_tasy_wx".equalsIgnoreCase(wxId)){
            String res=tasyNatService.GetOrderSource(dept,doctor,day,"3",IsAll,pm);
            String xml="";
            if (!StringUtils.isEmpty(res)){
                JSONObject jsonObject = JSON.parseObject(res);
                System.out.println("====="+jsonObject.getString("success"));
                if (jsonObject!=null&&jsonObject.getString("success").equalsIgnoreCase("true")){
                    xml=jsonObject.getString("data");
                    XMLSerializer xmlSerializer = new XMLSerializer();
                    String json = xmlSerializer.read(xml).toString();
                    JSONObject jsonObjectRes = JSON.parseObject(json);
                    com.alibaba.fastjson.JSONArray jsonArray = new com.alibaba.fastjson.JSONArray();
                    jsonArray.add(jsonObjectRes);
                    return success(jsonArray);
                }
            }
            return ListEnvelop.getError("查询失败");
        }else {
            return ListEnvelop.getError("未开放");
        }
    }
    @GetMapping("/DepartMent")
    public Envelop DepartMent(
            @ApiParam(name = "DepartMent", value = "DepartMent")
            @RequestParam(value = "DepartMent",required = false)String DepartMent) throws Exception {
        return success("查询成功",tasyNatService.departMent(DepartMent));
    }
}

+ 72 - 3
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/PrescriptionEndpoint.java

@ -1,5 +1,6 @@
package com.yihu.jw.hospital.endpoint.prescription;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.area.service.BaseCityService;
@ -49,6 +50,7 @@ import com.yihu.jw.wlyy.service.WlyyBusinessService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import net.sf.json.xml.XMLSerializer;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -132,6 +134,8 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
    private EntranceService entranceService;
    @Autowired
    private BaseOperateLogService baseOperateLogService;
    @Autowired
    private TasyNatService tasyNatService;
    @Value("${qywx.id}")
    private String qywxId;
@ -362,7 +366,13 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                       @RequestParam(value = "patient", required = true)String patient)throws Exception {
        try {
            return success(prescriptionService.findPatientCard(patient));
            if ("xm_zsyy_wx".equalsIgnoreCase(wxId)){
                return success(prescriptionService.findPatientCard(patient));
            }else if ("xm_tasy_wx".equalsIgnoreCase(wxId)){
                return success(tasyNatService.findPatientCard(patient));
            }else {
                return ListEnvelop.getError("暂未开放");
            }
        }catch (Exception e) {
            return failedListEnvelopException(e);
        }
@ -2873,14 +2883,73 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
            @RequestParam(value = "docCode",required = false)String docCode,
            @ApiParam(name = "chargeType", value = "chargeType")
            @RequestParam(value = "chargeType",required = false)String chargeType) throws Exception {
        return success(entranceService.BS10142(deptCode,docCode,chargeType,demoFlag));
        if("xm_zsyy_wx".equalsIgnoreCase(wxId)){
            return success(entranceService.BS10142(deptCode,docCode,chargeType,demoFlag));
        }else if ("xm_tasy_wx".equalsIgnoreCase(wxId)){
            String res=tasyNatService.departMent(deptCode);
            String dept="";
            JSONObject deptres = JSON.parseObject(res);
            if (deptres!=null){
                if (deptres.getString("success").equalsIgnoreCase("true")){
                    JSONObject data = JSON.parseObject(deptres.getString("data"));
                    dept=data.getString("Dept");
                    JSONArray jsonArray1 = JSON.parseArray(dept);
                    if (jsonArray1!=null&&jsonArray1.size()>0){
                        JSONObject jsonObject = jsonArray1.getJSONObject(0);
                        dept=jsonObject.getString("Id");
                        System.out.println(dept);
                    }
                    String json=tasyNatService.GetDoctorWorkDate("3",dept);
                    JSONObject jsonObject = JSON.parseObject(json);
                    jsonObject.put("dept",dept);
                    com.alibaba.fastjson.JSONArray jsonArray = new com.alibaba.fastjson.JSONArray();
                    jsonArray.add(jsonObject);
                    return success(jsonArray);
                }else {
                    return ListEnvelop.getError("获取部门编码失败");
                }
            }else {
                return ListEnvelop.getError("无效部门");
            }
        }else {
            return ListEnvelop.getError("未开放");
        }
    }
    @GetMapping("/BS10143")
    public ListEnvelop BS10143(@ApiParam(name = "day", value = "day")
                               @RequestParam(value = "day",required = false)String day,
                               @ApiParam(name = "dept", value = "dept")
                               @RequestParam(value = "dept",required = false)String dept,
                               @ApiParam(name = "doctor", value = "doctor")
                                   @RequestParam(value = "doctor",required = false)String doctor,
                               @ApiParam(name = "IsAll", value = "IsAll")
                                   @RequestParam(value = "IsAll",required = false)String IsAll,
                               @ApiParam(name = "pm", value = "pm")
                               @RequestParam(value = "pm",required = false)String pm) throws Exception {
        return success(entranceService.BS10143(day,pm,demoFlag));
        if("xm_zsyy_wx".equalsIgnoreCase(wxId)){
            return success(entranceService.BS10143(day,pm,false));
        }else if ("xm_tasy_wx".equalsIgnoreCase(wxId)){
            String res=tasyNatService.GetOrderSource(dept,doctor,day,"3",IsAll,pm);
            String xml="";
            if (!org.apache.axis.utils.StringUtils.isEmpty(res)){
                JSONObject jsonObject = JSON.parseObject(res);
                System.out.println("====="+jsonObject.getString("success"));
                if (jsonObject!=null&&jsonObject.getString("success").equalsIgnoreCase("true")){
                    xml=jsonObject.getString("data");
                    XMLSerializer xmlSerializer = new XMLSerializer();
                    String json = xmlSerializer.read(xml).toString();
                    JSONObject jsonObjectRes = JSON.parseObject(json);
                    com.alibaba.fastjson.JSONArray jsonArray = new com.alibaba.fastjson.JSONArray();
                    jsonArray.add(jsonObjectRes);
                    return success(jsonArray);
                }
            }
            return ListEnvelop.getError("查询失败");
        }else {
            return ListEnvelop.getError("未开放");
        }
    }
    @GetMapping("/BS10144")
    public Envelop BS10144(@ApiParam(name = "deptCode", value = "deptCode")