소스 검색

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

# Conflicts:
#	server/svr-configuration/src/main/resources/bootstrap.yml
wangzhinan 3 년 전
부모
커밋
8433beccd8
15개의 변경된 파일983개의 추가작업 그리고 64개의 파일을 삭제
  1. 120 1
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java
  2. 424 0
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/TasyNatService.java
  3. 4 0
      gateway/ag-basic/src/main/resources/application.yml
  4. 5 0
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/voluntary/VoluntaryRecruitmentCompanyDao.java
  5. 7 0
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/voluntary/VoluntaryRecruitmentPeopleDao.java
  6. 73 4
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/voluntary/VoluntaryRecruitmentCompanyEndpoint.java
  7. 65 3
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/voluntary/VoluntaryRecruitmentEndpoint.java
  8. 20 1
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/voluntary/VoluntaryRecruitmentPeopleEndpoint.java
  9. 78 11
      svr/svr-base/src/main/java/com/yihu/jw/base/service/voluntary/VoluntaryRecruitmentService.java
  10. 7 4
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/birthday/BirthdayWishesService.java
  11. 82 24
      svr/svr-cloud-device/src/main/java/com/yihu/jw/care/endpoint/DeviceController.java
  12. 24 9
      svr/svr-cloud-device/src/main/java/com/yihu/jw/care/service/DeviceService.java
  13. 59 0
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/patient/PatientNoLoginEndPoint.java
  14. 4 2
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/PrescriptionEndpoint.java
  15. 11 5
      svr/svr-internet-hospital/src/main/resources/application.yml

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

@ -322,6 +322,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    private BaseAdviceTreatmentDao baseAdviceTreatmentDao;
    @Autowired
    private EnterpriseService enterpriseService;
    @Autowired
    private TasyNatService tasyNatService;
    @Value("${demo.flag}")
    private boolean demoFlag;
@ -11382,7 +11384,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        return null;
    }
    public Map saveNatAppointment(String chargeAmount,String inspectionName,String mediaCard,String patientId,String name,String cardNo,String cardType,String mobile,
                                   String firstJobCode,String firstJobName,String secondJobCode,String secondJobName,String natTime,String address,String provinceName,String cityName,String townName,String streetName,String pm,String pushChannel,String pushFlag,String cardNoType,String consumer) throws Exception {
                                   String firstJobCode,String firstJobName,String secondJobCode,String secondJobName,String natTime,String address,String provinceName,String cityName,String townName,String streetName,String pm,String pushChannel,String pushFlag,String cardNoType,String consumer,String preNo) throws Exception {
        Map returnMap = new HashMap();
        List<WlyyHospitalSysDictDO> natConfigList = wlyyHospitalSysDictDao.findByDictName("natConfigList");
        String checkPart = "鼻/咽拭子";
@ -11687,6 +11689,113 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            returnMap.put("id",baseNatAppointmentDO.getId());
            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);
            net.sf.json.JSONObject jsondate = new JSONObject();
            jsondate.put("checkPart",checkPart);
            jsondate.put("cardNo",mediaCard);
            jsondate.put("chargeFlag",chargeFlag);
            jsondate.put("chargeCode",chargeCode);
            jsondate.put("icdCode",icdCode);
            jsondate.put("socialNo",cardNo);
            jsondate.put("tellPhone",mobile);
            jsondate.put("address1",provinceName);
            jsondate.put("address2",cityName);
            jsondate.put("address3",townName);
            jsondate.put("address4",streetName);
            jsondate.put("address5",address);
            jsondate.put("area",townName);
            jsondate.put("winNo",winNo);
            jsondate.put("targetChild",secondJobName);
            jsondate.put("target",firstJobName);
            jsondate.put("quantity",1);
            Map<String,Object> map = findRandomDoctor();
            if (map!=null){
                //先进行核算检测预约
                String realOrder="";
                String result = tasyNatService.initNatParams(preNo,name,cardNo);
                if (StringUtils.isNoneBlank(result)){
                    com.alibaba.fastjson.JSONObject object = com.alibaba.fastjson.JSONObject.parseObject(result);
                    logger.info("核酸检测预约结束"+result);
                    Boolean flag = false;
                    if (object!=null){
                        String returnCode = object.getString("returnCode");
                        if ("0".equalsIgnoreCase(returnCode)){
                            returnMap.put("msg",object.getString("returnMsg"));
                            returnMap.put("status","-1");
                            return  returnMap;
                        }else {
                            flag = true;
                            realOrder=object.getString("hisTradeNo");
                        }
                    }
                }
                if (flag){
                    BaseNatAppointmentDO baseNatAppointmentDO= new BaseNatAppointmentDO();
                    baseNatAppointmentDO.setChargeAmount(chargeAmount);
                    baseNatAppointmentDO.setMedicare(mediaCard);
                    baseNatAppointmentDO.setName(name);
                    baseNatAppointmentDO.setCardNo(cardNo);
                    baseNatAppointmentDO.setCardType(cardType);
                    baseNatAppointmentDO.setAddress(address);
                    baseNatAppointmentDO.setAppointmentTime(DateUtil.strToDateLong(natTime));
                    baseNatAppointmentDO.setCityName(cityName);
                    baseNatAppointmentDO.setFirstJobCode(firstJobCode);
                    baseNatAppointmentDO.setFirstJobName(firstJobName);
                    baseNatAppointmentDO.setSecondJobCode(secondJobCode);
                    baseNatAppointmentDO.setSecondJobName(secondJobName);
                    baseNatAppointmentDO.setProvinceName(provinceName);
                    baseNatAppointmentDO.setTownName(townName);
                    baseNatAppointmentDO.setStreetName(streetName);
                    baseNatAppointmentDO.setPatientId(patientId);
                    baseNatAppointmentDO.setIsSuccess("0");
                    baseNatAppointmentDO.setCardNoType(cardNoType);
                    baseNatAppointmentDO.setPayStatus("0");
                    baseNatAppointmentDO.setCreateTime(new Date());
                    baseNatAppointmentDO.setMobile(mobile);
                    baseNatAppointmentDO.setInspectionCode(chargeCode);
                    baseNatAppointmentDO.setInspectionName(inspectionName);
                    baseNatAppointmentDO.setIcdCode(icdCode);
                    baseNatAppointmentDO.setChargeCode(chargeCode);
                    baseNatAppointmentDO.setWinNo(String.valueOf(winNo));
                    baseNatAppointmentDO.setDept("3150000");
                    baseNatAppointmentDO.setDeptName("感染疾病科");
                    baseNatAppointmentDO.setRealOrder(realOrder);
                    baseNatAppointmentDO.setAmpm(pm);
                    baseNatAppointmentDO.setDoctorId(map.get("doctorMappingCode").toString());
                    baseNatAppointmentDO.setDoctorName(map.get("doctorName").toString());
                    baseNatAppointmentDO= baseNatAppointmentDao.save(baseNatAppointmentDO);
                    //添加订单
                    BusinessOrderDO businessDO = new BusinessOrderDO();
                    businessDO.setPatient(consumer);
                    businessDO.setPatientName(basePatientDO.getName());
                    businessDO.setOrderNo("HLWYY"+System.currentTimeMillis()+(int)(Math.random()*900)+100);
                    businessDO.setCreateTime(new Date());
                    businessDO.setStatus(0);
                    businessDO.setRelationCode(baseNatAppointmentDO.getId()+"");
                    businessDO.setRelationName("核酸检测订单");
                    businessDO.setOrderCategory("6");
                    businessDO.setOrderType(12);
                    businessDO.setPayPrice(natFee);
                    businessDO.setRematk("核酸检测订单");
                    businessDO.setDescription("核酸检测订单");
                    businessDO.setPayType(1);
                    businessDO.setUpdateTime(new Date());
                    businessOrderDao.save(businessDO);
                    logger.info("开单结束");
                    logger.info("saveNatAppointment params:"+jsondate.toString());
                    returnMap.put("msg","预约成功");
                    returnMap.put("status","200");
                    returnMap.put("id",baseNatAppointmentDO.getId());
                    returnMap.put("realOrder",baseNatAppointmentDO.getRealOrder());
                }
            }
            return returnMap;
        }
        return returnMap;
    }
@ -12074,6 +12183,16 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                            ykyyEntranceService.updateHisStatus(update01sq);
                        }
                    }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());
                        }
                    }

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

@ -0,0 +1,424 @@
package com.yihu.jw.hospital.prescription.service;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
import com.yihu.jw.hospital.prescription.service.entrance.XzzxEntranceService;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.util.http.HttpClientUtil;
import com.yihu.jw.utils.StringUtil;
import com.yihu.jw.utils.WebserviceUtil;
import net.sf.json.xml.XMLSerializer;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@Service
@Transactional
public class TasyNatService {
    private static Logger logger = LoggerFactory.getLogger(TasyNatService.class);
    private static String key="bvvsf3JA0mUXMU+mVnMaOQ==";
    @Autowired
    private BasePatientDao basePatientDao;
    @Autowired
    private WlyyHospitalSysDictDao wlyyHospitalSysDictDao;
    @Autowired
    private HttpClientUtil httpClientUtil;
    public String getOperateUrl(){
        List<WlyyHospitalSysDictDO> list =  wlyyHospitalSysDictDao.findByDictName("TasyWebOperateService");
        String url = list.get(0).getDictCode();
        return url;
    }
    public String getTaszWebServiceInfo(String api, Map<String,String> params, String url)throws Exception{
        logger.info("url"+url);
        List<WlyyHospitalSysDictDO> xzzxNamespaces =  wlyyHospitalSysDictDao.findByDictName("TasyNamespace");
        String xzzxNamespace = xzzxNamespaces.get(0).getDictCode();
        logger.info("TasyNamespace",xzzxNamespace);
        return WebserviceUtil.post(url,xzzxNamespace,api,params);
    }
    /**
     * 线上注册
     * @return
     */
    public String registerPatient(JSONObject jsonObject)throws Exception{
        String api = "SickNocardRegister";
        /*String msgHeader ="<?xml version=\"1.0\" encoding=\"utf-8\"?> " +
                "<root> " +
                "   <serverName>"+api+"</serverName>  " +
                "   <format>xml</format>" +
                "   <callOperator></callOperator> " +
                "   <certificate>"+key+"</certificate> " +
                "</root>";*/
        String condition ="";
        if (StringUtils.isNoneBlank(jsonObject.getString("IdType"))){
            condition += "<IdType>"+jsonObject.getString("IdType")+"</IdType>";
        }
        if (StringUtils.isNoneBlank(jsonObject.getString("IdNo"))){
            condition += "<IdNo>"+jsonObject.getString("IdNo")+"</IdNo>";
        }
        if (StringUtils.isNoneBlank(jsonObject.getString("UserName"))){
            condition += "<UserName>"+jsonObject.getString("UserName")+"</UserName>";
        }
        if (StringUtils.isNoneBlank(jsonObject.getString("UserSex"))){
            condition += "<UserSex>"+jsonObject.getString("UserSex")+"</UserSex>";
        }
        if (StringUtils.isNoneBlank(jsonObject.getString("MobilePhone"))){
            condition += "<MobilePhone>"+jsonObject.getString("MobilePhone")+"</MobilePhone>";
        }
        if (StringUtils.isNoneBlank(jsonObject.getString("Birthday"))){
            condition += "<Birthday>"+jsonObject.getString("Birthday")+"</Birthday>";
        }
        if (StringUtils.isNoneBlank(jsonObject.getString("Address "))){
            condition += "<Address >"+jsonObject.getString("Address ")+"</Address >";
        }
        if (StringUtils.isNoneBlank(jsonObject.getString("WorkUnit"))){
            condition += "<WorkUnit>"+jsonObject.getString("WorkUnit")+"</WorkUnit>";
        }
        if (StringUtils.isNoneBlank(jsonObject.getString("CardType"))){
            condition += "<CardType>"+jsonObject.getString("CardType")+"</CardType>";
        }
        if (StringUtils.isNoneBlank(jsonObject.getString("CardNo"))){
            condition += "<CardNo>"+jsonObject.getString("CardNo")+"</CardNo>";
        }
        if (StringUtils.isNoneBlank(jsonObject.getString("Citizen"))){
            condition += "<Citizen>"+jsonObject.getString("Citizen")+"</Citizen>";
        }
        if (StringUtils.isNoneBlank(jsonObject.getString("BirthPlace"))){
            condition += "<BirthPlace>"+jsonObject.getString("BirthPlace")+"</BirthPlace>";
        }
        if (StringUtils.isNoneBlank(jsonObject.getString("MaritalStatus"))){
            condition += "<MaritalStatus>"+jsonObject.getString("MaritalStatus")+"</MaritalStatus>";
        }
        if (StringUtils.isNoneBlank(jsonObject.getString("UnitPhone"))){
            condition += "<UnitPhone>"+jsonObject.getString("UnitPhone")+"</UnitPhone>";
        }
        if (StringUtils.isNoneBlank(jsonObject.getString("Email"))){
            condition += "<Email>"+jsonObject.getString("Email")+"</Email>";
        }
        if (StringUtils.isNoneBlank(jsonObject.getString("Community"))){
            condition += "<Community>"+jsonObject.getString("Community")+"</Community>";
        }
        if (StringUtils.isNoneBlank(jsonObject.getString("ContactName"))){
            condition += "<ContactName>"+jsonObject.getString("ContactName")+"</ContactName>";
        }
        if (StringUtils.isNoneBlank(jsonObject.getString("ContactRelation"))){
            condition += "<ContactRelation>"+jsonObject.getString("ContactRelation")+"</ContactRelation>";
        }
        if (StringUtils.isNoneBlank(jsonObject.getString("ContactPhone"))){
            condition += "<ContactPhone>"+jsonObject.getString("ContactPhone")+"</ContactPhone>";
        }
        if (StringUtils.isNoneBlank(jsonObject.getString("ContactAddress"))){
            condition += "<ContactAddress>"+jsonObject.getString("ContactAddress")+"</ContactAddress>";
        }
        if (StringUtils.isNoneBlank(jsonObject.getString("Id000"))){
            condition += "<Id000>"+jsonObject.getString("Id000")+"</Id000>";
        }
        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("registerPatient params:"+params.toString());
        String xml = getTaszWebServiceInfo("CallInterface",params,getOperateUrl());
        XMLSerializer xmlSerializer = new XMLSerializer();
        String json = xmlSerializer.read(xml).toString();
        logger.info("registerPatient json:"+json);
        return json;
    }
    /**
     * 挂号+项目开单
     * @return
     */
    public String insertNucleicBill(JSONObject jsonObject)throws Exception{
        String api = "insertNucleicBill";
        String msgHeader ="<?xml version=\"1.0\" encoding=\"utf-8\"?> " +
                "<root> " +
                "   <serverName>"+api+"</serverName>  " +
                "   <format>xml</format>" +
                "   <callOperator></callOperator> " +
                "   <certificate>"+key+"</certificate> " +
                "</root>";
        String condition ="";
        if (StringUtils.isNoneBlank(jsonObject.getString("deptCode"))){
            condition += "<deptCode>"+jsonObject.getString("deptCode")+"</deptCode>";
        }
        if (StringUtils.isNoneBlank(jsonObject.getString("staffNo"))){
            condition += "<staffNo>"+jsonObject.getString("staffNo")+"</staffNo>";
        }
        if (StringUtils.isNoneBlank(jsonObject.getString("preNo"))){
            condition += "<preNo>"+jsonObject.getString("preNo")+"</preNo>";
        }
        if (StringUtils.isNoneBlank(jsonObject.getString("icCardNo"))){
            condition += "<icCardNo>"+jsonObject.getString("icCardNo")+"</icCardNo>";
        }
        if (StringUtils.isNoneBlank(jsonObject.getString("patientName"))){
            condition += "<patientName>"+jsonObject.getString("patientName")+"</patientName>";
        }
        if (StringUtils.isNoneBlank(jsonObject.getString("registerFee"))){
            condition += "<registerFee>"+jsonObject.getString("registerFee")+"</registerFee>";
        }
        if (StringUtils.isNoneBlank(jsonObject.getString("clinicFee"))){
            condition += "<clinicFee>"+jsonObject.getString("clinicFee")+"</clinicFee>";
        }
        String itemCoditon="";
        if (StringUtils.isNoneBlank(jsonObject.getString("item"))){
            JSONObject itemObject=jsonObject.getJSONObject("item");
            if (StringUtils.isNoneBlank(itemObject.getString("itemCode"))){
                itemCoditon += "<itemCode>"+itemObject.getString("itemCode")+"</itemCode>";
            }
            if (StringUtils.isNoneBlank(itemObject.getString("itemName"))){
                itemCoditon += "<itemName>"+itemObject.getString("itemName")+"</itemName>";
            }
            if (StringUtils.isNoneBlank(itemObject.getString("itemPrice"))){
                itemCoditon += "<itemPrice>"+itemCoditon+"</itemPrice>";
            }
            condition += "<itemList><item>"+jsonObject.getString("clinicFee")+"</item></itemList>";
        }
        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("insertNucleicBill params:"+params.toString());
        String xml = getTaszWebServiceInfo("CallInterface",params,getOperateUrl());
        XMLSerializer xmlSerializer = new XMLSerializer();
        String json = xmlSerializer.read(xml).toString();
        logger.info("insertNucleicBill json:"+json);
        return json;
    }
    /**
     * 取消核酸预约
     * @return
     */
    public String cancelNucleicBill(JSONObject jsonObject)throws Exception{
        String api = "cancelNucleicBill";
        String msgHeader ="<?xml version=\"1.0\" encoding=\"utf-8\"?> " +
                "<root> " +
                "   <serverName>"+api+"</serverName>  " +
                "   <format>xml</format>" +
                "   <callOperator></callOperator> " +
                "   <certificate>"+key+"</certificate> " +
                "</root>";
        String condition ="";
        if (StringUtils.isNoneBlank(jsonObject.getString("hisTradeNo"))){
            condition += "<hisTradeNo>"+jsonObject.getString("hisTradeNo")+"</hisTradeNo>";
        }
        if (StringUtils.isNoneBlank(jsonObject.getString("icCardNo"))){
            condition += "<icCardNo>"+jsonObject.getString("icCardNo")+"</icCardNo>";
        }
        if (StringUtils.isNoneBlank(jsonObject.getString("patientName"))){
            condition += "<patientName>"+jsonObject.getString("patientName")+"</patientName>";
        }
        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("cancelNucleicBill params:"+params.toString());
        String xml = getTaszWebServiceInfo("CallInterface",params,getOperateUrl());
        XMLSerializer xmlSerializer = new XMLSerializer();
        String json = xmlSerializer.read(xml).toString();
        logger.info("cancelNucleicBill json:"+json);
        return json;
    }
    /**
     * 核酸检测项目扣费
     * @return
     */
    public String ChargenucleicBill(JSONObject jsonObject)throws Exception{
        String api = "ChargenucleicBill";
        String msgHeader ="<?xml version=\"1.0\" encoding=\"utf-8\"?> " +
                "<root> " +
                "   <serverName>"+api+"</serverName>  " +
                "   <format>xml</format>" +
                "   <callOperator></callOperator> " +
                "   <certificate>"+key+"</certificate> " +
                "</root>";
        String condition ="";
        if (StringUtils.isNoneBlank(jsonObject.getString("hisTradeNo"))){
            condition += "<hisTradeNo>"+jsonObject.getString("hisTradeNo")+"</hisTradeNo>";
        }
        if (StringUtils.isNoneBlank(jsonObject.getString("icCardNo"))){
            condition += "<icCardNo>"+jsonObject.getString("icCardNo")+"</icCardNo>";
        }
        if (StringUtils.isNoneBlank(jsonObject.getString("patientName"))){
            condition += "<patientName>"+jsonObject.getString("patientName")+"</patientName>";
        }
        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("cancelNucleicBill params:"+params.toString());
        String xml = getTaszWebServiceInfo("CallInterface",params,getOperateUrl());
        XMLSerializer xmlSerializer = new XMLSerializer();
        String json = xmlSerializer.read(xml).toString();
        logger.info("cancelNucleicBill json:"+json);
        return json;
    }
    //组装核算下单参数
    public String initNatParams(String preNo,String patientName,String icCardNo){
        List<WlyyHospitalSysDictDO> natConfigList = wlyyHospitalSysDictDao.findByDictName("natConfigList");
        String deptCode = "0001";
        String staffNo = "0001";
        String registerFee = "0.01";
        String clinicFee = "0.01";
        String itemCode = "xmCode";
        String itemName = "核酸检测";
        String itemPrice = "0.01";
        for (WlyyHospitalSysDictDO wlyyHospitalSysDictDO:natConfigList){
            if (StringUtils.isNoneBlank(wlyyHospitalSysDictDO.getDictValue())&&"deptCode".equalsIgnoreCase(wlyyHospitalSysDictDO.getDictCode())){
                deptCode = wlyyHospitalSysDictDO.getDictValue();
            }
            if (StringUtils.isNoneBlank(wlyyHospitalSysDictDO.getDictValue())&&"staffNo".equalsIgnoreCase(wlyyHospitalSysDictDO.getDictCode())){
                staffNo = wlyyHospitalSysDictDO.getDictValue();
            }
            if (StringUtils.isNoneBlank(wlyyHospitalSysDictDO.getDictValue())&&"registerFee".equalsIgnoreCase(wlyyHospitalSysDictDO.getDictCode())){
                registerFee = wlyyHospitalSysDictDO.getDictValue();
            }
            if (StringUtils.isNoneBlank(wlyyHospitalSysDictDO.getDictValue())&&"clinicFee".equalsIgnoreCase(wlyyHospitalSysDictDO.getDictCode())){
                clinicFee = wlyyHospitalSysDictDO.getDictValue();
            }
            if (StringUtils.isNoneBlank(wlyyHospitalSysDictDO.getDictValue())&&"itemCode".equalsIgnoreCase(wlyyHospitalSysDictDO.getDictCode())){
                itemCode = wlyyHospitalSysDictDO.getDictValue();
            }
            if (StringUtils.isNoneBlank(wlyyHospitalSysDictDO.getDictValue())&&"itemName".equalsIgnoreCase(wlyyHospitalSysDictDO.getDictCode())){
                itemName = wlyyHospitalSysDictDO.getDictValue();
            }
            if (StringUtils.isNoneBlank(wlyyHospitalSysDictDO.getDictValue())&&"itemPrice".equalsIgnoreCase(wlyyHospitalSysDictDO.getDictCode())){
                itemPrice = wlyyHospitalSysDictDO.getDictValue();
            }
        }
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("preNo",preNo);
        jsonObject.put("icCardNo",icCardNo);
        jsonObject.put("patientName",patientName);
        jsonObject.put("deptCode",deptCode);
        jsonObject.put("staffNo",staffNo);
        jsonObject.put("registerFee",registerFee);
        jsonObject.put("clinicFee",clinicFee);
        JSONObject item = new JSONObject();
        item.put("itemCode",itemCode);
        item.put("itemName",itemName);
        item.put("itemPrice",itemPrice);
        jsonObject.put("item",item);
        String res="";
        try {
            res = insertNucleicBill(jsonObject);
            if (StringUtils.isNoneBlank(res)){
                return res;
            }
        }catch (Exception e){
            e.printStackTrace();
        }
        return "";
    }
    //调用取消核酸接口
    public String cancelNat(String hisTraceNo,String idCardNo,String patientName){
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("hisTraceNo",hisTraceNo);
        jsonObject.put("idCardNo",idCardNo);
        jsonObject.put("patientName",patientName);
        String res="";
        try {
            res = cancelNucleicBill(jsonObject);
            if (StringUtils.isNoneBlank(res)){
                return res;
            }
        }catch (Exception e){
            e.printStackTrace();
        }
        return "";
    }
    //调用扣费接口
    public String chargeBill(String hisTraceNo,String idCardNo,String patientName){
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("hisTraceNo",hisTraceNo);
        jsonObject.put("idCardNo",idCardNo);
        jsonObject.put("patientName",patientName);
        String res="";
        try {
            res = ChargenucleicBill(jsonObject);
            if (StringUtils.isNoneBlank(res)){
                return res;
            }
        }catch (Exception e){
            e.printStackTrace();
        }
        return "";
    }
//Integer payType,String tradeNo,String openId,String idNo,String name ,String amountJSONObject jsonObject = new JSONObject();
//        jsonObject.put("payType",payType);
//        jsonObject.put("tradeNo",tradeNo);
//        jsonObject.put("openId",openId);
//        jsonObject.put("idNo",idNo);
//        jsonObject.put("name",name);
//        jsonObject.put("amount",amount);
    public String placeOrder(JSONObject jsonObject){
        String url = "";
        WlyyHospitalSysDictDO wlyyHospitalSysDictDO = wlyyHospitalSysDictDao.findById("placeOrderUrl");
        if (wlyyHospitalSysDictDO!=null){
            url=wlyyHospitalSysDictDO.getDictValue();
        }
        List<NameValuePair> params = new ArrayList<>();
        params.add(new BasicNameValuePair("placeOrder", jsonObject.toJSONString()));
        String response = httpClientUtil.post(url,params ,"UTF-8");
        return response;
    }
    public String orderStatus(JSONObject jsonObject){
        String url = "";
        WlyyHospitalSysDictDO wlyyHospitalSysDictDO = wlyyHospitalSysDictDao.findById("orderStatusUrl");
        if (wlyyHospitalSysDictDO!=null){
            url=wlyyHospitalSysDictDO.getDictValue();
        }
        List<NameValuePair> params = new ArrayList<>();
        params.add(new BasicNameValuePair("orderStatus", jsonObject.toJSONString()));
        String response = httpClientUtil.post(url,params ,"UTF-8");
        return response;
    }
    public String tmpPush(JSONObject jsonObject){
        String url = "";
        WlyyHospitalSysDictDO wlyyHospitalSysDictDO = wlyyHospitalSysDictDao.findById("tmpPushUrl");
        if (wlyyHospitalSysDictDO!=null){
            url=wlyyHospitalSysDictDO.getDictValue();
        }
        List<NameValuePair> params = new ArrayList<>();
        params.add(new BasicNameValuePair("orderStatus", jsonObject.toJSONString()));
        String response = httpClientUtil.post(url,params ,"UTF-8");
        return response;
    }
}

+ 4 - 0
gateway/ag-basic/src/main/resources/application.yml

@ -62,6 +62,10 @@ zuul:
    svr-base:
      path: /cityihealth/base/**
      serviceId: svr-base
#新冠患者招募
    svr-base-vol:
      path: /cityihealth/baseVol/**
      serviceId: svr-base-vol
    svr-authentication:
      path: /cityihealth/auth/**
      serviceId: svr-authentication

+ 5 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/dao/voluntary/VoluntaryRecruitmentCompanyDao.java

@ -4,6 +4,8 @@ import com.yihu.jw.entity.voluntary.VoluntaryRecruitmentCompanyDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
/**
 * @Author: yeshijie
 * @Date: 2021/8/1
@ -11,6 +13,9 @@ import org.springframework.data.repository.PagingAndSortingRepository;
 */
public interface VoluntaryRecruitmentCompanyDao extends PagingAndSortingRepository<VoluntaryRecruitmentCompanyDO, String>, JpaSpecificationExecutor<VoluntaryRecruitmentCompanyDO> {
    VoluntaryRecruitmentCompanyDO findByName(String name);
    boolean existsByName(String name);
    List<VoluntaryRecruitmentCompanyDO> findByContactsAndPhone(String contacts,String phone);
}

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

@ -2,8 +2,11 @@ package com.yihu.jw.base.dao.voluntary;
import com.yihu.jw.entity.voluntary.VoluntaryRecruitmentPeopleDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
/**
 * @Author: yeshijie
 * @Date: 2021/8/1
@ -11,6 +14,10 @@ import org.springframework.data.repository.PagingAndSortingRepository;
 */
public interface VoluntaryRecruitmentPeopleDao extends PagingAndSortingRepository<VoluntaryRecruitmentPeopleDO, String>, JpaSpecificationExecutor<VoluntaryRecruitmentPeopleDO> {
    boolean existsByPhone(String phone);
    List<VoluntaryRecruitmentPeopleDO> queryByIdIn(String[] id);
    @Query("select count(1) from VoluntaryRecruitmentPeopleDO where companyId = ?1 ")
    Integer findByCompanyId(String CompanyId);
}

+ 73 - 4
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/voluntary/VoluntaryRecruitmentCompanyEndpoint.java

@ -10,10 +10,21 @@ 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.http.client.utils.DateUtils;
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.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
 * Created with IntelliJ IDEA.
@ -42,7 +53,7 @@ public class VoluntaryRecruitmentCompanyEndpoint extends EnvelopRestEndpoint {
    @PostMapping(value = "update")
    @ApiOperation(value = "更新")
    public ObjEnvelop<VoluntaryRecruitmentCompanyDO> update (
    public ObjEnvelop<VoluntaryRecruitmentCompanyDO> update(
            @ApiParam(name = "jsonData", value = "Json数据", required = true)
            @RequestParam String jsonData) throws Exception {
        VoluntaryRecruitmentCompanyDO appVersion = toEntity(jsonData, VoluntaryRecruitmentCompanyDO.class);
@ -55,7 +66,7 @@ public class VoluntaryRecruitmentCompanyEndpoint extends EnvelopRestEndpoint {
    @GetMapping(value = "page")
    @ApiOperation(value = "获取分页")
    public PageEnvelop<VoluntaryRecruitmentCompanyDO> page (
    public PageEnvelop<VoluntaryRecruitmentCompanyDO> page(
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
@ -67,13 +78,13 @@ public class VoluntaryRecruitmentCompanyEndpoint extends EnvelopRestEndpoint {
            @ApiParam(name = "size", value = "页码", required = true, defaultValue = "15")
            @RequestParam(value = "size") int size) throws Exception {
        List<VoluntaryRecruitmentCompanyDO> appVersions = companyService.search(fields, filters, sorts, page, size);
        int count = (int)companyService.getCount(filters);
        int count = (int) companyService.getCount(filters);
        return success(appVersions, count, page, size, VoluntaryRecruitmentCompanyDO.class);
    }
    @GetMapping(value = "list")
    @ApiOperation(value = "获取列表")
    public ListEnvelop<VoluntaryRecruitmentCompanyDO> list (
    public ListEnvelop<VoluntaryRecruitmentCompanyDO> list(
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
@ -85,4 +96,62 @@ public class VoluntaryRecruitmentCompanyEndpoint extends EnvelopRestEndpoint {
    }
    @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<VoluntaryRecruitmentCompanyDO> appVersions = companyService.search(fields, filters, sorts);
            response.setContentType("octets/stream");
            response.setHeader("Content-Disposition", "attachment; filename=" + new String("volunteerInfo.xls"));
            OutputStream os = response.getOutputStream();
            this.write(os, appVersions);
        } catch (Exception ex) {
            Envelop.getError("导出失败");
        }
    }
    private void write(OutputStream os, List<VoluntaryRecruitmentCompanyDO> 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 (VoluntaryRecruitmentCompanyDO tmp : list) {
                addCell(sheet, j, 0, ii + "");
                addCell(sheet, j, 1, tmp.getName());
                addCell(sheet, j, 2, tmp.getContacts());
                addCell(sheet, j, 3, tmp.getPhone() + "");
                addCell(sheet, j, 4, tmp.getNum()+"");
                addCell(sheet, j, 5, tmp.getTimes() + "");
                addCell(sheet, j, 6, tmp.getServiceStation() + "");
                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);
    }
}

+ 65 - 3
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/voluntary/VoluntaryRecruitmentEndpoint.java

@ -1,11 +1,14 @@
package com.yihu.jw.base.endpoint.voluntary;
import com.yihu.jw.base.dao.voluntary.VoluntaryRecruitmentPeopleDao;
import com.yihu.jw.base.service.voluntary.VoluntaryRecruitmentCompanyService;
import com.yihu.jw.base.service.voluntary.VoluntaryRecruitmentService;
import com.yihu.jw.entity.voluntary.VoluntaryRecruitmentCompanyDO;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.PageEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.utils.StringUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
@ -25,11 +28,13 @@ import java.util.List;
@RequestMapping(value = "open/voluntary")
@Api(value = "新冠-志愿招募管理", description = "新冠-志愿招募管理", tags = {"新冠-志愿招募管理"})
public class VoluntaryRecruitmentEndpoint extends EnvelopRestEndpoint {
 
    @Autowired
    private VoluntaryRecruitmentService voluntaryRecruitmentService;
    @Autowired
    private VoluntaryRecruitmentCompanyService companyService;
    @Autowired
    private VoluntaryRecruitmentPeopleDao peopleDao;
    @PostMapping(value = "add")
    @ApiOperation(value = "企业报名")
@ -38,8 +43,11 @@ public class VoluntaryRecruitmentEndpoint extends EnvelopRestEndpoint {
         @RequestParam String jsonData){
        try {
            VoluntaryRecruitmentCompanyDO companyDO = toEntity(jsonData, VoluntaryRecruitmentCompanyDO.class);
            voluntaryRecruitmentService.add(companyDO);
            return success("报名成功");
            String result = voluntaryRecruitmentService.add(companyDO);
            if(StringUtil.isBlank(result)){
                return success("报名成功");
            }
           return Envelop.getError(result,-1);
        }catch (Exception e){
            e.printStackTrace();
            return failedException2(e);
@ -70,5 +78,59 @@ public class VoluntaryRecruitmentEndpoint extends EnvelopRestEndpoint {
    }
    @GetMapping(value = "existsByPhone")
    @ApiOperation(value = "人员是否已报名")
    public ObjEnvelop existsByPhone (
            @ApiParam(name = "phone", value = "联系人手机")
            @RequestParam(value = "phone", required = true) String phone){
        try {
            return ObjEnvelop.getSuccess("查找成功",peopleDao.existsByPhone(phone));
        }catch (Exception e){
            e.printStackTrace();
            return  ObjEnvelop.getError("查询失败");
        }
    }
    @GetMapping(value = "findByContactsAndPhone")
    @ApiOperation(value = "查找单个企业")
    public ObjEnvelop<VoluntaryRecruitmentCompanyDO> findByContactsAndPhone (
            @ApiParam(name = "contacts", value = "联系人姓名")
            @RequestParam(value = "contacts", required = true) String contacts,
            @ApiParam(name = "phone", value = "联系人手机")
            @RequestParam(value = "phone", required = true) String phone){
        try {
            VoluntaryRecruitmentCompanyDO companyDO = voluntaryRecruitmentService.findByContactsAndPhone(contacts,phone);
            if(companyDO==null){
               return ObjEnvelop.getError("未找到关联企业");
            }
            return ObjEnvelop.getSuccess("查找成功",companyDO);
        }catch (Exception e){
            e.printStackTrace();
            return  ObjEnvelop.getError("查询失败");
        }
    }
    @PostMapping(value = "arrange")
    @ApiOperation(value = "人员安排")
    public Envelop arrange (
            @ApiParam(name = "companyId", value = "联系人姓名")
            @RequestParam(value = "companyId", required = true) String companyId,
            @ApiParam(name = "day", value = "服务日期")
            @RequestParam(value = "day", required = true) String day,
            @ApiParam(name = "time", value = "服务时间段")
            @RequestParam(value = "time", required = true) String time,
            @ApiParam(name = "peoples", value = "服务人员 id+姓名逗号间隔。例:1:测试1,2:测试2")
            @RequestParam(value = "peoples", required = true) String peoples,
            @ApiParam(name = "station", value = "服务站")
            @RequestParam(value = "station", required = true) String station){
        try {
            voluntaryRecruitmentService.arrange(companyId, day, time, peoples, station);
            return success("报名成功");
        }catch (Exception e){
            e.printStackTrace();
            return failedException2(e);
        }
    }
}

+ 20 - 1
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/voluntary/VoluntaryRecruitmentPeopleEndpoint.java

@ -1,6 +1,8 @@
package com.yihu.jw.base.endpoint.voluntary;
import com.yihu.jw.base.dao.voluntary.VoluntaryRecruitmentCompanyDao;
import com.yihu.jw.base.service.voluntary.VoluntaryRecruitmentPeopleService;
import com.yihu.jw.entity.voluntary.VoluntaryRecruitmentCompanyDO;
import com.yihu.jw.entity.voluntary.VoluntaryRecruitmentPeopleDO;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ListEnvelop;
@ -29,14 +31,25 @@ public class VoluntaryRecruitmentPeopleEndpoint extends EnvelopRestEndpoint {
    @Autowired
    private VoluntaryRecruitmentPeopleService peopleService;
    @Autowired
    private VoluntaryRecruitmentCompanyDao companyDao;
    @PostMapping(value = "delete")
    @ApiOperation(value = "删除")
    public Envelop delete(
            @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("删除成功");
    }
@ -50,6 +63,12 @@ public class VoluntaryRecruitmentPeopleEndpoint extends EnvelopRestEndpoint {
            return failed("ID不能为空", ObjEnvelop.class);
        }
        appVersion = peopleService.save(appVersion);
        VoluntaryRecruitmentCompanyDO companyDO = companyDao.findOne(appVersion.getCompanyId());
        if (null !=companyDO ){
            Integer count = peopleService.getRepository().findByCompanyId(appVersion.getCompanyId());
            companyDO.setNum(count);
            companyDao.save(companyDO);
        }
        return success(appVersion, VoluntaryRecruitmentPeopleDO.class);
    }

+ 78 - 11
svr/svr-base/src/main/java/com/yihu/jw/base/service/voluntary/VoluntaryRecruitmentService.java

@ -3,11 +3,14 @@ package com.yihu.jw.base.service.voluntary;
import com.yihu.jw.base.dao.voluntary.VoluntaryRecruitmentArrangeDao;
import com.yihu.jw.base.dao.voluntary.VoluntaryRecruitmentCompanyDao;
import com.yihu.jw.base.dao.voluntary.VoluntaryRecruitmentPeopleDao;
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.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
/**
@ -27,25 +30,89 @@ public class VoluntaryRecruitmentService {
    @Autowired
    private VoluntaryRecruitmentPeopleDao peopleDao;
    /**
     * 人员安排
     */
    public void arrange(String companyId,String day,String time,String peoples,String station){
        List<VoluntaryRecruitmentArrangeDO> arrangeDOs = new ArrayList<>();
        String people[] = peoples.split(",");
        for (String peo:people){
            String p[] = peo.split(":");
            VoluntaryRecruitmentArrangeDO arrangeDO = new VoluntaryRecruitmentArrangeDO();
            arrangeDO.setCompanyId(companyId);
            arrangeDO.setDay(day);
            arrangeDO.setPeopleId(p[0]);
            arrangeDO.setPeopleName(p[1]);
            arrangeDO.setStation(station);
            arrangeDO.setTime(time);
            arrangeDOs.add(arrangeDO);
        }
        arrangeDao.save(arrangeDOs);
    }
    public VoluntaryRecruitmentCompanyDO findByContactsAndPhone(String contacts,String phone){
        List<VoluntaryRecruitmentCompanyDO> companyDOs = companyDao.findByContactsAndPhone(contacts,phone);
        if(companyDOs!=null&&companyDOs.size()>0){
            return companyDOs.get(0);
        }
        return null;
    }
    /**
     * 企业报名
     */
    public void add(VoluntaryRecruitmentCompanyDO companyDO){
    public String add(VoluntaryRecruitmentCompanyDO companyDO){
        List<VoluntaryRecruitmentPeopleDO> peopleDOs = new ArrayList<>();
        if(StringUtil.isBlank(companyDO.getId())){
            if(companyDao.existsByName(companyDO.getName())){
                return "该企业已报名,请勿重复报名";
            }
            List<VoluntaryRecruitmentCompanyDO> companyDOs = companyDao.findByContactsAndPhone(companyDO.getContacts(),companyDO.getPhone());
            if(companyDOs!=null&&companyDOs.size()>0){
                return "该联系人已被其他企业添加";
            }
            List<VoluntaryRecruitmentPeopleDO> peopleDOList = companyDO.getPeopleDOList();
            if(peopleDOList!=null){
                addPeople(peopleDOList,peopleDOs,companyDO);
                return null;
            }
            return null;
        }
        List<VoluntaryRecruitmentPeopleDO> peopleDOList = companyDO.getPeopleDOList();
        if(peopleDOList!=null){
            companyDO.setNum(peopleDOList.size());
            companyDao.save(companyDO);
        if(peopleDOList==null){
            return "请添加人员";
        }
        addPeople(peopleDOList,peopleDOs,companyDO);
        return null;
    }
    public void addPeople(List<VoluntaryRecruitmentPeopleDO> peopleDOList,List<VoluntaryRecruitmentPeopleDO> peopleDOs,VoluntaryRecruitmentCompanyDO companyDO){
            for (VoluntaryRecruitmentPeopleDO peopleDO:peopleDOList){
                peopleDO.setCompanyId(companyDO.getId());
                peopleDO.setCompanyName(companyDO.getName());
        if(!StringUtil.isBlank(companyDO.getId())){
            VoluntaryRecruitmentCompanyDO old = companyDao.findOne(companyDO.getId());
            companyDO = old;
        }else {
            companyDO.setNum(0);
            companyDao.save(companyDO);
        }
        for (VoluntaryRecruitmentPeopleDO peopleDO:peopleDOList){
            if(peopleDao.existsByPhone(peopleDO.getPhone())){
                continue;
            }
            peopleDao.save(peopleDOList);
            return;
            peopleDO.setCompanyId(companyDO.getId());
            peopleDO.setCompanyName(companyDO.getName());
            peopleDOs.add(peopleDO);
        }
        if(peopleDOs.size()>0){
            peopleDao.save(peopleDOs);
        }
        companyDO.setNum(0);
        companyDO.setNum(companyDO.getNum()+peopleDOs.size());
        companyDao.save(companyDO);
    }

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

@ -333,8 +333,12 @@ public class BirthdayWishesService {
                            map.put("birthday", esMap.get("birthday") + "");
                            map.put("doctorName", esMap.get("doctorName") + "");
                            map.put("content", esMap.get("content") + "");
                            map.put("createTime", (esMap.get("createTime") + "").replace("T", " ").replace("+0800", ""));
                            map.put("createTimeStr", (esMap.get("createTime") + "").replace("T", " ").replace("+0800", ""));
                            Date dateTmp = DateUtil.strToDate(esMap.get("createTime") + "");
                            map.put("createTime", (DateUtil.dateToChineseDate(dateTmp)));
                            map.put("status", "已发送");
                            BasePatientDO patientDO = patientDao.findById(map.get("patient") + "");
                            map.put("patientBirthday", IdCardUtil.getBirthdayForIdcardStr(patientDO.getIdcard()));
                            patientSet.add(patientCode);
                            resultList.add(map);
                        }
@ -349,11 +353,10 @@ public class BirthdayWishesService {
                        String birthday = map.get("birthday")+"日";
                        StringBuilder bir = new StringBuilder(birthday);
                        bir.insert(2, "月");
//                            int age = IdCardUtil.getAgeForIdcard(map.get("idcard") + "");
                        map.put("birthday", bir.toString());
//                        int age = IdCardUtil.getAgeForIdcard(map.get("idcard") + "");
//                        map.put("age", age);
                        map.put("status", "未发送");
                        BasePatientDO patientDO = patientDao.findById(map.get("patient") + "");
                        map.put("patientBirthday", IdCardUtil.getBirthdayForIdcardStr(patientDO.getIdcard()));
                        resultList.add(map);
                    }
                }

+ 82 - 24
svr/svr-cloud-device/src/main/java/com/yihu/jw/care/endpoint/DeviceController.java

@ -107,7 +107,7 @@ public class DeviceController {
    }
    //
    @ApiOperation("柏颐设备位置接收")
    @ApiOperation("爱牵挂位置接收")
    @RequestMapping(value = "byLocation", produces = "application/x-www-form-urlencoded;charset=UTF-8", method = {RequestMethod.POST,RequestMethod.GET})
    public String byLocation(
            @ApiParam(name="imei",required = false,value="15位设备唯一序号",defaultValue = "")
@ -131,7 +131,7 @@ public class DeviceController {
            HttpServletRequest request){
        try {
            String paraString = JSON.toJSONString(request.getParameterMap());
            logger.info("柏颐设备位置接收,请求参数:\n"+paraString);
            logger.info("爱牵挂位置接收,请求参数:\n"+paraString);
            deviceService.byLocation(imei,time_begin,is_reply,is_track,city,address,lon,lat,type);
            return success();
@ -142,7 +142,7 @@ public class DeviceController {
    }
    @ApiOperation("柏颐心率数据接收")
    @ApiOperation("爱牵挂心率数据接收")
    @RequestMapping(value = "byHeartRate", produces = "application/x-www-form-urlencoded;charset=UTF-8", method = {RequestMethod.POST,RequestMethod.GET})
    public String byHeartRate(
            @ApiParam(name = "imei", value = "15位设备唯一序号")
@ -158,7 +158,7 @@ public class DeviceController {
            HttpServletRequest request){
        try {
            String paraString = JSON.toJSONString(request.getParameterMap());
            logger.info("柏颐心率数据接收,请求参数: \n"+paraString);
            logger.info("爱牵挂心率数据接收,请求参数: \n"+paraString);
            deviceService.byHeartRate(imei,time_begin,heartrate,theshold_heartrate_h,theshold_heartrate_l);
            return success();
@ -168,7 +168,7 @@ public class DeviceController {
        }
    }
    @ApiOperation("柏颐血压数据接收")
    @ApiOperation("爱牵挂血压数据接收")
    @RequestMapping(value = "byBloodPressure", produces = "application/x-www-form-urlencoded;charset=UTF-8", method = {RequestMethod.POST,RequestMethod.GET})
    public String byBloodPressure(
            @ApiParam(name = "imei", value = "15位设备唯一序号", required = true)
@ -186,7 +186,7 @@ public class DeviceController {
            HttpServletRequest request){
        try {
            String paraString = JSON.toJSONString(request.getParameterMap());
            logger.info("柏颐血压数据,接收请求参数:\n"+paraString);
            logger.info("爱牵挂血压数据,接收请求参数:\n"+paraString);
            deviceService.byBloodPressure(imei,time_begin,dbp,dbp_l,sbp,sbp_h);
            return success();
@ -196,7 +196,7 @@ public class DeviceController {
        }
    }
    @ApiOperation("柏颐跌倒数据接收")
    @ApiOperation("爱牵挂跌倒数据接收")
    @RequestMapping(value = "byFall", produces = "application/x-www-form-urlencoded;charset=UTF-8", method = {RequestMethod.POST,RequestMethod.GET})
    public String byFall(
            @ApiParam(name = "imei", value = "15位设备唯一序号", required = true)
@ -216,7 +216,7 @@ public class DeviceController {
            HttpServletRequest request){
        try {
            String paraString = JSON.toJSONString(request.getParameterMap());
            logger.info("柏颐跌倒数据接收,请求参数: \n"+paraString);
            logger.info("爱牵挂跌倒数据接收,请求参数: \n"+paraString);
            deviceService.byFall(imei,time_begin,city,address,lon,lat,type);
            return success();
@ -238,7 +238,7 @@ public class DeviceController {
            HttpServletRequest request) {
        try {
            String paraString = JSON.toJSONString(request.getParameterMap());
            logger.info("柏颐设备步数接收,请求参数:\n"+paraString);
            logger.info("爱牵挂步数接收,请求参数:\n"+paraString);
            deviceService.bySteps(imei,time_begin,value);
            return success();
@ -248,29 +248,87 @@ public class DeviceController {
        }
    }
    @ApiOperation("柏颐设备睡眠接收")
    @ApiOperation("爱牵挂设备睡眠接收")
    @RequestMapping(value = "bySleep", produces = "application/x-www-form-urlencoded;charset=UTF-8", method = {RequestMethod.POST,RequestMethod.GET})
    public String bySleep(
            @ApiParam(name="imei",required = false,value="15位设备唯一序号",defaultValue = "")
            @RequestParam(value = "imei",required = true) String imei,
            @ApiParam(name="device",required = false,value="睡眠带MAC地址",defaultValue = "")
            @RequestParam(value = "device",required = true) String device,
            @ApiParam(name="time_begin",required = false,value="发生时间YYYY-MM-DD HH:mm:SS")
            @RequestParam(value = "time_begin",required = false) String time_begin,
            @ApiParam(name="time_end",required = false,value="结束时间YYYY-MM-DD HH:mm:SS")
            @RequestParam(value = "time_end",required = false) String time_end,
            @ApiParam(name="interval",required = false,value="固定30分钟")
            @RequestParam(value = "interval",required = false) int interval,
            @ApiParam(name="total",required = false,value="检测次数")
            @RequestParam(value = "total",required = false) int total,
            @ApiParam(name="data",required = false,value="样例截取 睡眠数据 (格式:state,turn_over|state,turn_over|...)")
            @RequestParam(value = "data",required = false)String data,
            @ApiParam(name="heartrate",required = false,value="心率数据(离床或翻身测量失败时为0)")
            @RequestParam(value = "heartrate",required = false) String heartrate,
            @ApiParam(name="breath",required = false,value="呼吸率(离床或翻身测量失败时为0)")
            @RequestParam(value = "breath",required = false) String breath,
            @ApiParam(name="bed_status",required = false,value="在离床状态(0 离床,1 在床) ")
            @RequestParam(value = "bed_status",required = false) String bed_status,
            @ApiParam(name="turn_over",required = false,value="翻身状态(0 没翻身,1 在翻身)")
            @RequestParam(value = "turn_over",required = false)String turn_over,
            @ApiParam(name="is_warn",required = false,value="是否为离床报警(0 否 默认,1 是)")
            @RequestParam(value = "is_warn",required = false)String is_warn,
            HttpServletRequest request) {
        try {
            //data 为字符串,格式为:  state,turn_over|state,turn_over|state, ... state和turn_over的
            // 含义见object.md 文档中sleepdatasleep
            String paraString = JSON.toJSONString(request.getParameterMap());
            logger.info("爱牵挂睡眠接收,请求参数:"+paraString);
            deviceService.bySleep(device,time_begin,heartrate,breath,turn_over,is_warn);
            return success();
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1,"Device data incoming failure");
        }
    }
    @ApiOperation("爱牵挂设备睡眠报告接收")
    @RequestMapping(value = "bySleepReport", produces = "application/x-www-form-urlencoded;charset=UTF-8", method = {RequestMethod.POST,RequestMethod.GET})
    public String bySleep(
            @ApiParam(name="device",required = false,value="睡眠带MAC地址",defaultValue = "")
            @RequestParam(value = "device",required = true) String device,
            @ApiParam(name="date",required = false,value="产生日期 YYYYMMDD")
            @RequestParam(value = "date",required = false) String date,
            @ApiParam(name="fallasleep",required = false,value="入睡时长 (分钟)")
            @RequestParam(value = "fallasleep",required = false) String fallasleep,
            @ApiParam(name="sleepTime",required = false,value="睡眠时长 (分钟)")
            @RequestParam(value = "sleepTime",required = false) String sleepTime,
            @ApiParam(name="restTime",required = false,value="休息时长 (分钟)")
            @RequestParam(value = "restTime",required = false) String restTime,
            @ApiParam(name="bed_status",required = false,value="在离床状态(0 离床,1 在床) ")
            @RequestParam(value = "bed_status",required = false) String bed_status,
            @ApiParam(name="awakeTime",required = false,value="清醒时长 (分钟)")
            @RequestParam(value = "awakeTime",required = false)String awakeTime,
            @ApiParam(name="lightTime",required = false,value="浅睡时长 (分钟)")
            @RequestParam(value = "lightTime",required = false)String lightTime,
            @ApiParam(name="remTime",required = false,value="rem时长  (分钟)")
            @RequestParam(value = "remTime",required = false)String remTime,
            @ApiParam(name="deepTime",required = false,value="深睡时长 (分钟) ")
            @RequestParam(value = "deepTime",required = false)String deepTime,
            @ApiParam(name="bucket",required = false,value="睡眠时段 ['18:00-18:21', '21:30-07:09'] ")
            @RequestParam(value = "bucket",required = false)String[] bucket,
            @ApiParam(name="avghr",required = false,value="平均心率 ")
            @RequestParam(value = "avghr",required = false)String avghr,
            @ApiParam(name="avgbr",required = false,value="平均呼吸率 ")
            @RequestParam(value = "avgbr",required = false)String avgbr,
            @ApiParam(name="awakePer",required = false,value="清醒百分比")
            @RequestParam(value = "awakePer",required = false)String awakePer,
            @ApiParam(name="remPer",required = false,value="rem百分比")
            @RequestParam(value = "remPer",required = false)String remPer,
            @ApiParam(name="lightPer",required = false,value="浅睡百分比")
            @RequestParam(value = "lightPer",required = false)String lightPer,
            @ApiParam(name="deepPer",required = false,value="深睡百分比")
            @RequestParam(value = "deepPer",required = false)String deepPer,
            @ApiParam(name="efficiency",required = false,value="睡眠效率")
            @RequestParam(value = "efficiency",required = false)String efficiency,
            @ApiParam(name="score",required = false,value="睡眠评分 <=0无睡眠数据,<60待改善,<70一般,<85良好 其他,非常好")
            @RequestParam(value = "score",required = false)String score,
            HttpServletRequest request) {
        try {
            String paraString = JSON.toJSONString(request.getParameterMap());
            logger.info("柏颐设备睡眠接收,请求参数:"+paraString);
            logger.info("爱牵挂睡眠接收,请求参数:"+paraString);
            deviceService.bySleep(imei,time_begin,time_end,interval,total,data);
            deviceService.bySleepReport(device,date,fallasleep,sleepTime,restTime,awakeTime,lightTime,remTime,deepTime,bucket,
                    avghr,avgbr,awakePer,remPer,lightPer,efficiency,score);
            return success();
        } catch (Exception e) {
            e.printStackTrace();

+ 24 - 9
svr/svr-cloud-device/src/main/java/com/yihu/jw/care/service/DeviceService.java

@ -537,18 +537,33 @@ public class DeviceService {
    }
    /**
     *柏颐睡眠数据接收
     * @param imei 15位设备唯一序号
     * @param time_begin 发生时间YYYY-MM-DD HH:mm:SS
     * @param time_end 结束时间YYYY-MM-DD HH:mm:SS
     * @param interval 固定30分钟
     * @param total 检测次数
     * @param data 样例截取   睡眠数据 (格式:state,turn_over|state,turn_over|...) 含义见object.md 文档中sleepdatasleep
     *
     * @param device
     * @param time_begin
     * @param heartrate
     * @param breath
     * @param turn_over
     * @param is_warn
     */
    @Async
    public void bySleep(String imei,String time_begin,String time_end,int interval,int total,String data) {
    public void bySleep(String device,String time_begin,String heartrate,String breath,String turn_over,String is_warn) {
        try {
            if(StringUtils.isNotBlank(imei)){
            if(StringUtils.isNotBlank(device)){
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    @Async
    public void bySleepReport(String device,String date,String fallasleep,String sleepTime,String restTime,String awakeTime,String lightTime,
                              String remTime,String deepTime,String[] bucket,String avghr,String avgbr,String awakePer,String remPer,String lightPer,
                              String efficiency,String score) {
        try {
            if(StringUtils.isNotBlank(device)){
            }

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

@ -221,6 +221,8 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
    private ConsultTeamDao consultTeamDao;
    @Autowired
    private BaseDoctorDao baseDoctorDao;
    @Autowired
    private TasyNatService tasyNatService;
    @GetMapping(value = BaseHospitalRequestMapping.PatientNoLogin.findDoctorByHospitalAndDiseaseAndDept)
    @ApiOperation(value = "根据疾病名称,热门部门查询医生", notes = "根据疾病名称,热门部门查询医生")
@ -2218,4 +2220,61 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
            return failedMixEnvelopException(e);
        }
    }
    @GetMapping("/testTasyInterface")
    @ApiOperation(value = "testTasyInterface")
    public Envelop testTasyInterface(
            @ApiParam(name = "api", value = "api", required = true)
            @RequestParam(value = "api", required = true) String api,
            @ApiParam(name = "json", value = "json", required = true)
            @RequestParam(value = "json", required = true) String json ) throws Exception {
        try {
            JSONObject jsonObject = JSON.parseObject(json);
            if ("SickNocardRegister".equalsIgnoreCase(api)){
                return success("操作成功",tasyNatService.registerPatient(jsonObject));
            }
            if ("insertNucleicBill".equalsIgnoreCase(api)){
                return success("操作成功",tasyNatService.insertNucleicBill(jsonObject));
            }
            if ("cancelNucleicBill".equalsIgnoreCase(api)){
                return success("操作成功",tasyNatService.cancelNucleicBill(jsonObject));
            }
            if ("ChargenucleicBill".equalsIgnoreCase(api)){
                return success("操作成功",tasyNatService.ChargenucleicBill(jsonObject));
            }
            return success("");
        } catch (Exception e){
            return  failedException(e);
        }
    }
    @GetMapping("/testTasyPay")
    @ApiOperation(value = "testTasyPay")
    public Envelop testTasyPay(
            @ApiParam(name = "api", value = "api", required = true)
            @RequestParam(value = "api", required = true) String api,
            @ApiParam(name = "json", value = "json", required = true)
            @RequestParam(value = "json", required = true) String json ) throws Exception {
        try {
            JSONObject jsonObject = JSON.parseObject(json);
            if ("placeOrder".equalsIgnoreCase(api)){
                return success("操作成功",tasyNatService.placeOrder(jsonObject));
            }
            if ("orderStatus".equalsIgnoreCase(api)){
                return success("操作成功",tasyNatService.orderStatus(jsonObject));
            }
            if ("tmpPush".equalsIgnoreCase(api)){
                return success("操作成功",tasyNatService.tmpPush(jsonObject));
            }
            return success("");
        } catch (Exception e){
            return  failedException(e);
        }
    }
}

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

@ -2957,9 +2957,11 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                      @ApiParam(name = "pushFlag", value = "pushFlag")
                                          @RequestParam(value = "pushFlag",required = false)String pushFlag,
                                      @ApiParam(name = "cardNoType", value = "cardNoType")
                                          @RequestParam(value = "cardNoType",required = false)String cardNoType){
                                          @RequestParam(value = "cardNoType",required = false)String cardNoType,
                                      @ApiParam(name = "preNo", value = "preNo")
                                          @RequestParam(value = "preNo",required = false)String preNo){
        try {
            return success(prescriptionService.saveNatAppointment(chargeAmount,inspectionName,mediaCard,patientId,name,cardNo,cardType,mobile,firstJobCode,firstJobName,secondJobCode,secondJobName,natTime,address,provinceName,cityName,townName,streetName,pm,pushChannel,pushFlag,cardNoType,getUID()));
            return success(prescriptionService.saveNatAppointment(chargeAmount,inspectionName,mediaCard,patientId,name,cardNo,cardType,mobile,firstJobCode,firstJobName,secondJobCode,secondJobName,natTime,address,provinceName,cityName,townName,streetName,pm,pushChannel,pushFlag,cardNoType,getUID(),preNo));
        } catch (Exception e) {
            return Envelop.getError(e.getMessage());
        }

+ 11 - 5
svr/svr-internet-hospital/src/main/resources/application.yml

@ -79,9 +79,9 @@ spring:
  profiles: jwdev
  datasource:
    driver-class-name: com.mysql.jdbc.Driver
    url: jdbc:mysql://172.26.0.114/base?useUnicode:true&characterEncoding=utf-8&autoReconnect=true&useSSL=false
    username: root
    password: jkzlehr
    url: jdbc:mysql://172.26.0.104/base?useUnicode:true&characterEncoding=utf-8&autoReconnect=true&useSSL=false
    username: ssgg
    password: ssgg@jkzl2019
#  elasticsearch:
#    cluster-name: jkzl #集群名 默认elasticsearch
#    cluster-nodes: 172.26.0.115:9300,172.26.0.115:9300 #配置es节点信息,逗号分隔,如果没有指定,则启动ClientNode
@ -132,8 +132,12 @@ hospital:
im:
  im_list_get: http://172.26.0.105:3000/
  data_base_name: im_internet_hospital
#文件服务器上传配置 0本地,1.I健康,2.内网调用
testPattern:
  sign: 0
  remote_inner_url: 172.16.100.240:10023/open/fileUpload/upload_stream
wlyy:
  url: http://ehr.yihu.com/wlyy/
es:
  pwflag: 1 # 1需要密码,2不需要密码
  index:
@ -144,6 +148,8 @@ es:
  tHost: 172.26.0.112:9300
  clusterName: jkzl
  securityUser: elastic:elastic
  user: lion
  password: jkzlehr
# 上传文件临时路径配置
FileTempPath: