Selaa lähdekoodia

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

# Conflicts:
#	business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java
wangzhinan 4 vuotta sitten
vanhempi
commit
d0342c1198

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

@ -2,7 +2,6 @@ package com.yihu.jw.hospital.prescription.service;
import com.alibaba.fastjson.JSON;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.jw.dict.dao.BaseDictJobTitleDao;
import com.yihu.jw.dict.dao.BaseJobCategoryDao;
import com.yihu.jw.dict.dao.DictDeptDescDao;
import com.yihu.jw.dict.dao.DictHospitalDeptDao;
@ -18,7 +17,6 @@ import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO;
import com.yihu.jw.entity.base.im.ConsultTeamDo;
import com.yihu.jw.entity.base.org.BaseDoctorPatientFollowDO;
import com.yihu.jw.entity.base.org.BaseOrgDO;
import com.yihu.jw.entity.base.patient.BasePatientBusinessDO;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.base.patient.PatientMedicareCardDO;
import com.yihu.jw.entity.base.wx.*;
@ -55,6 +53,7 @@ import com.yihu.jw.hospital.message.dao.BaseBannerDoctorDao;
import com.yihu.jw.hospital.message.service.SystemMessageService;
import com.yihu.jw.hospital.prescription.dao.*;
import com.yihu.jw.hospital.prescription.service.entrance.EntranceService;
import com.yihu.jw.hospital.prescription.service.entrance.TnyyEntranceService;
import com.yihu.jw.hospital.prescription.service.entrance.XzzxEntranceService;
import com.yihu.jw.hospital.prescription.service.entrance.YkyyEntranceService;
import com.yihu.jw.hospital.prescription.service.useragent.BaseUserAgent;
@ -94,7 +93,6 @@ import com.yihu.jw.wechat.service.BaseSensitiveFilterWordsService;
import com.yihu.jw.wechat.service.WxAccessTokenService;
import com.yihu.jw.yx.dao.YxTokenMappingDao;
import com.yihu.mysql.query.BaseJpaService;
import com.yihu.utils.pinyin.PinyinUtil;
import com.yihu.utils.security.MD5;
import com.ylzinfo.ehc.EhcHandler;
import com.ylzinfo.ehc.common.utils.DateUtils;
@ -130,8 +128,6 @@ import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import static javafx.scene.input.KeyCode.L;
/**
 * Created by Trick on 2019/5/17.
 */
@ -281,6 +277,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    private PayInfoNoticeService payInfoNoticeService;
    @Autowired
    private BaseJobCategoryDao jobCategoryDao;
    @Autowired
    private TnyyEntranceService tnyyEntranceService;
@ -2591,7 +2589,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            //保存挂号费用
            prescription.setRegFee(getChargeFee(outpatientDO.getDoctor()));
            prescription.setRegFee(outpatientDO.getFee());
            prescription.setPrescribeTime(new Date());
            //保存费用
            prescriptionDao.save(prescription);
@ -2618,6 +2616,27 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                }
                result.put("code", 1);
                result.put("mes", "诊断完成");
                result.put("prescriptionId",prescription.getId());
                return result;
            }else if (wechatId.equalsIgnoreCase("sd_tnzyy_wx")) {
                outpatientDO.setStatus("2");
                outpatientDao.save(outpatientDO);
                //先下单
                businessOrderService.savePrescriptionOrder(prescription.getId());
                if(!demoFlag){
                    //同步his
                    tnyyEntranceService.findByRealOrder(prescription.getId(),demoFlag);
                    List<WlyyPrescriptionDO> prescriptionDOList = prescriptionDao.findById(prescription.getId());
                    if (prescriptionDOList != null && prescriptionDOList.size() != 0) {
                        WlyyPrescriptionDO wlyyPrescriptionDO = prescriptionDOList.get(0);
                        BusinessOrderDO businessOrderDO = businessOrderDao.selectByRelationCode(outpatientDO.getId());
                        logger.info("cfsb", wlyyPrescriptionDO.getRealOrder());
                    }
                }
                result.put("code", 1);
                result.put("mes", "诊断完成");
                result.put("prescriptionId",prescription.getId());

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

@ -539,7 +539,8 @@ public class TnPrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pr
/*            object.put("ybfl",map.get("ybfl"));//医保分类*/
            object.put("retprice",map.get("retprice"));//零售价格
            object.put("stock_amount",map.get("stock_amount"));//库存
            object.put("ypcd",map.get("manu_name"));//产地
            object.put("ypcd",map.get("manu_code"));//产地
            object.put("manu_name",map.get("manu_code"));
           /* object.put("zfpb",map.get("ZFPB"));//作废判别*/
            object.put("jbywbz",map.get("jbyw"));//基本药物标志
            object.put("pack_retprice",map.get("pack_retprice"));

+ 282 - 1
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/TnyyEntranceService.java

@ -14,13 +14,17 @@ import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorRoleDO;
import com.yihu.jw.entity.hospital.mapping.DoctorMappingDO;
import com.yihu.jw.entity.hospital.mapping.PatientMappingDO;
import com.yihu.jw.entity.hospital.prescription.*;
import com.yihu.jw.hospital.dict.YkDictIcd10Dao;
import com.yihu.jw.hospital.mapping.dao.DoctorMappingDao;
import com.yihu.jw.hospital.mapping.dao.PatientMappingDao;
import com.yihu.jw.hospital.prescription.dao.PrescriptionDao;
import com.yihu.jw.hospital.prescription.dao.PrescriptionInfoDao;
import com.yihu.jw.restmodel.hospital.prescription.*;
import com.yihu.jw.util.common.IdCardUtil;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.utils.StringUtil;
import com.yihu.jw.utils.hibernate.HibenateUtils;
import com.yihu.utils.network.HttpResponse;
import com.yihu.utils.network.HttpUtils;
import com.yihu.utils.security.MD5;
@ -48,7 +52,12 @@ import static com.yihu.jw.util.common.PwdUtil.randomString;
public class TnyyEntranceService {
    private static Logger logger = LoggerFactory.getLogger(TnyyEntranceService.class);
    private final static String url="http://10.9.1.247:10023/ykyy/createSQLQuery";
    private final static String url="http://10.9.1.247:10023//tnyy/queryBySql";
    private final static String saveUrl="http://10.9.1.247:10023//tnyy/save";
    private final static String updateUrl="http://10.9.1.247:10023//tnyy/updateBySql";
    private final static String updateEntityUrl="http://10.9.1.247:10023/tnyy/update";
    @Autowired
    private PrescriptionInfoDao prescriptionInfoDao;
    @Autowired
    private JdbcTemplate jdbcTemplate;
@ -67,6 +76,10 @@ public class TnyyEntranceService {
    private final static String orgCode ="350211A1002";
    @Autowired
    private PatientMappingDao patientMappingDao;
    @Autowired
    private HibenateUtils hibenateUtils;
    @Autowired
    private PrescriptionDao prescriptionDao;
@ -897,4 +910,272 @@ public class TnyyEntranceService {
    }
    public void save(Object object){
        hibenateUtils.save(object);
    }
    public void updateBySql(String sql){
        hibenateUtils.updateBySql(sql);
    }
    public void update(Object object){
        hibenateUtils.update(object);
    }
    public String findByRealOrder(String code,boolean demoFlag) throws Exception {
        List<WlyyPrescriptionDO>  wlyyPrescriptionDOs = prescriptionDao.findById(code);
        if (wlyyPrescriptionDOs!=null&&wlyyPrescriptionDOs.size()!=0){
            WlyyPrescriptionDO wlyyPrescriptionDO = wlyyPrescriptionDOs.get(0);
            JSONObject objectString = (JSONObject) JSONObject.toJSON(wlyyPrescriptionDO);
            WlyyPrescriptionVO prescriptionVO =  JSONObject.toJavaObject(objectString,WlyyPrescriptionVO.class);
            List<WlyyPrescriptionInfoDO> wlyyPrescriptionInfoDOS = prescriptionInfoDao.findByPrescriptionId(wlyyPrescriptionDO.getId(),1);
            List<WlyyPrescriptionInfoVO> wlyyPrescriptionInfoVOS = new ArrayList<>();
            for (WlyyPrescriptionInfoDO wlyyPrescriptionInfoDO:wlyyPrescriptionInfoDOS){
                JSONObject object = (JSONObject) JSONObject.toJSON(wlyyPrescriptionInfoDO);
                logger.info("11111参数入参"+object.toJSONString());
                WlyyPrescriptionInfoVO prescriptionInfoVO = JSONObject.toJavaObject(object,WlyyPrescriptionInfoVO.class);
                wlyyPrescriptionInfoVOS.add(prescriptionInfoVO);
            }
          /*  //诊断
            synPrescriptionDiagnosis(prescriptionVO,code,demoFlag);*/
            prescriptionVO.setInfoVOs(wlyyPrescriptionInfoVOS);
         /*   List<WlyyInspectionDO> inspectionDOS = wlyyInspectionDao.findByPrescriptionId(code,1);*/
            synPrecriptionTnHis(prescriptionVO,code);
            /*//同步检查检验
            if(null!=inspectionDOS&&inspectionDOS.size()>0){
                synInspect(inspectionDOS);
            }*/
        }
        return wlyyPrescriptionDOs.toString();
    }
    public WlyyPrescriptionVO synPrecriptionTnHis(WlyyPrescriptionVO wlyyPrescriptionVO,String code) throws Exception {
        HlwTnCf01DO hlwCf01DO = new HlwTnCf01DO();
        logger.info("开始===================");
        if (wlyyPrescriptionVO!=null){
            try {
                hlwCf01DO.setYFSB(3);
                hlwCf01DO.setCFLX(wlyyPrescriptionVO.getType());
                hlwCf01DO.setKFRQ(DateUtil.strToDate(DateUtil.dateToStr(wlyyPrescriptionVO.getCreateTime(),"yyyy-MM-dd HH:mm:ss")));
                hlwCf01DO.setZFPB(0);
                hlwCf01DO.setFYBZ(0);
                hlwCf01DO.setPYBZ(0);
                hlwCf01DO.setCFTS(1);
                hlwCf01DO.setYXPB(1);
                hlwCf01DO.setDYBZ(0);
                hlwCf01DO.setTSCF(0);
                hlwCf01DO.setTYBZ(0);
                hlwCf01DO.setTSLX(6);
                hlwCf01DO.setCFBZ(0);
                hlwCf01DO.setJZXH(0);
                hlwCf01DO.setYXPB(0);
                hlwCf01DO.setPjbz(0);
                hlwCf01DO.setFypj(0);
                String patient = wlyyPrescriptionVO.getPatientCode();
                PatientMappingDO patientMappingDO = patientMappingDao.findByPatient(patient);
                hlwCf01DO.setBRID(Integer.parseInt(patientMappingDO.getMappingCode()));
                hlwCf01DO.setBRXM(wlyyPrescriptionVO.getPatientName());
                hlwCf01DO.setKSDM(Integer.parseInt(wlyyPrescriptionVO.getDept()));
                String doctor = wlyyPrescriptionVO.getDoctor();
                DoctorMappingDO doctorMappingDO = doctorMappingDao.findByDoctor(doctor);
                hlwCf01DO.setYSDM(doctorMappingDO.getMappingCode());
                hlwCf01DO.setJZKH(wlyyPrescriptionVO.getSsc());
                if (StringUtils.isNoneBlank(wlyyPrescriptionVO.getAdmNo())){
                    hlwCf01DO.setJZXH(Integer.parseInt(wlyyPrescriptionVO.getAdmNo()));
                }
               /* hibenateUtils.save(hlwCf01DO);*/
                if (StringUtils.isNoneBlank(wlyyPrescriptionVO.getRealOrder())){
                    hlwCf01DO.setCFSB(Integer.parseInt(wlyyPrescriptionVO.getRealOrder()));
                }
                if (StringUtils.isNoneBlank(wlyyPrescriptionVO.getOriginRealOrder())){
                    hlwCf01DO.setCFHM(wlyyPrescriptionVO.getOriginRealOrder());
                }
                String jsonString = JSONObject.toJSONString(hlwCf01DO);
                Map<String,Object> params = new HashedMap();
                params.put("json",jsonString);
                params.put("table","HLW_CF01");
                logger.info("HLW_CF01:"+jsonString);
                /**
                 {"message":null,"status":200,"obj":{"cfhm":1898356,"cfsb":5390518}}
                 */
                String cfsb = null;
                String cfhm = null;
                if (!StringUtils.isNoneBlank(wlyyPrescriptionVO.getRealOrder())){
                    HttpResponse response = HttpUtils.doGet(saveUrl,params);
                    if (response.getStatus()==200){
                        logger.info("content"+response.getContent());
                        String content = response.getContent();
                        JSONObject jsonObject = JSONObject.parseObject(content);
                        JSONObject object = jsonObject.getJSONObject("obj");
                        if (object!=null){
                            cfsb = object.getString("cfsb");
                            cfhm = object.getString("cfhm");
                            logger.info("kaishi=========="+cfsb);
                            List<WlyyPrescriptionDO> wlyyPrescriptionDOS = prescriptionDao.findById(code);
                            if (wlyyPrescriptionDOS!=null&&wlyyPrescriptionDOS.size()!=0){
                                WlyyPrescriptionDO wlyyPrescriptionDO = wlyyPrescriptionDOS.get(0);
                                wlyyPrescriptionDO.setRealOrder(cfsb);
                                wlyyPrescriptionDO.setOriginRealOrder(cfhm);
                                prescriptionDao.save(wlyyPrescriptionDO);
                            }
                        }
                        logger.info("表HLW_CF01同步成功!");
                    }else {
                        logger.info("表HLW_CF01同步失败!"+response.getErrorMsg());
                    }
                }else {
                    cfsb = wlyyPrescriptionVO.getRealOrder();
                    String sql = "update v_ms_dd01 t set t.ZFPB=1,t.ZFSJ=to_date('"+DateUtil.getStringDate()+"','yyyy-mm-dd hh24:mi:ss')  where  t.CFSB ='"+cfsb+"' ";
                    Map<String,Object> params1 = new HashedMap();
                    params1.put("sql",sql);
                    HttpResponse response = HttpUtils.doGet(updateUrl,params1);
                    if (response.getStatus()==200){
                        logger.info("表v_ms_dd01作废成功!");
                        HttpResponse response1 = HttpUtils.doGet(saveUrl,params);
                        if (response1.getStatus()==200){
                            logger.info("content"+response1.getContent());
                            String content = response1.getContent();
                            JSONObject jsonObject = JSONObject.parseObject(content);
                            JSONObject object = jsonObject.getJSONObject("obj");
                            if (object!=null){
                                cfsb = object.getString("cfsb");
                                cfhm = object.getString("cfhm");
                                logger.info("kaishi=========="+cfsb);
                                List<WlyyPrescriptionDO> wlyyPrescriptionDOS = prescriptionDao.findById(code);
                                if (wlyyPrescriptionDOS!=null&&wlyyPrescriptionDOS.size()!=0){
                                    WlyyPrescriptionDO wlyyPrescriptionDO = wlyyPrescriptionDOS.get(0);
                                    wlyyPrescriptionDO.setRealOrder(cfsb);
                                    wlyyPrescriptionDO.setOriginRealOrder(cfhm);
                                    prescriptionDao.save(wlyyPrescriptionDO);
                                }
                            }
                            logger.info("表HLW_CF01同步成功!");
                        }else {
                            logger.info("表HLW_CF01同步失败!"+response.getErrorMsg());
                        }
                    }
                   /* hlwCf01DO.setZFPB(1);
                    hlwCf01DO.setZFSJ(new Date());
                    HttpResponse response = HttpUtils.doGet(updateEntityUrl,params);
                    if (response.getStatus()==200){
                        logger.info("content"+response.getContent());
                        logger.info("表HLW_CF01更新成功!");
                    }else {
                        logger.info("表HLW_CF01更新失败!"+response.getErrorMsg());
                    }*/
                }
                logger.info("处方:"+cfsb);
                if (StringUtils.isEmpty(cfsb)){
                    throw new Exception("添加失败");
                }
               /* if (StringUtils.isNoneBlank(wlyyPrescriptionVO.getRealOrder())){
                    String deleteSql = "delete from v_ms_dd02 where cfsb = '"+wlyyPrescriptionVO.getRealOrder()+"'";
                    Map<String,Object> params1 = new HashedMap();
                    params1.put("sql",deleteSql);
                    HttpResponse response = HttpUtils.doGet(updateUrl,params1);
                    if (response.getStatus()==200){
                        logger.info("表v_ms_dd02删除成功!");
                    }
                }*/
                List<WlyyPrescriptionInfoVO> wlyyPrescriptionInfoVOS =wlyyPrescriptionVO.getInfoVOs();
                for (WlyyPrescriptionInfoVO wlyyPrescriptionInfoVO:wlyyPrescriptionInfoVOS){
                    try {
                        logger.info("chufang1============");
                        HlwTnCf02DO hlwCf02DO = new HlwTnCf02DO();
                        hlwCf02DO.setCFSB(Integer.parseInt(cfsb));
                        hlwCf02DO.setYPXH(Integer.parseInt(wlyyPrescriptionInfoVO.getDrugNo()));
                        logger.info("drugNo"+hlwCf02DO.getYPXH());
                        if (wlyyPrescriptionInfoVO.getDrugPlace()!=null){
                            hlwCf02DO.setYPCD(Integer.parseInt(wlyyPrescriptionInfoVO.getDrugPlace()));
                        }
                        hlwCf02DO.setXMLX(1);
                        hlwCf02DO.setCFTS(1);
                        hlwCf02DO.setYPSL(Double.parseDouble(wlyyPrescriptionInfoVO.getQuantity()));
                        hlwCf02DO.setYPDJ(wlyyPrescriptionInfoVO.getPackRetprice());
                        hlwCf02DO.setHJJE(Integer.parseInt(wlyyPrescriptionInfoVO.getQuantity())*wlyyPrescriptionInfoVO.getPackRetprice());//划价价额
                        hlwCf02DO.setYPZS(1);//药品组数  待确定
                        hlwCf02DO.setYCSL("0");
                        hlwCf02DO.setFYGB(1);//费用归并
                        hlwCf02DO.setZFBL(1.0);//自负比例
                        hlwCf02DO.setYFDW(wlyyPrescriptionInfoVO.getPackUnitName());
                        hlwCf02DO.setMRCS(StringUtils.isNoneBlank(wlyyPrescriptionInfoVO.getGroupNo())?Integer.parseInt(wlyyPrescriptionInfoVO.getGroupNo()):0);//每日次数
                        hlwCf02DO.setYFBZ(3);
                        hlwCf02DO.setYPYF(wlyyPrescriptionInfoVO.getUsageCode());
                        hlwCf02DO.setGYTJ(wlyyPrescriptionInfoVO.getYpyf());
                        hlwCf02DO.setSL(Integer.parseInt(wlyyPrescriptionInfoVO.getQuantity()));
                        hlwCf02DO.setPSPB(0);
                        hlwCf02DO.setYYTS(1);
                        hlwCf02DO.setJhjg(0);
                        hlwCf02DO.setJhje(0);
                        hlwCf02DO.setJhjg1(0);
                        hlwCf02DO.setDzdr(0);
                        hlwCf02DO.setYCJL(wlyyPrescriptionInfoVO.getDosage()!=null?Double.parseDouble(wlyyPrescriptionInfoVO.getDosage()):0);
                        if (wlyyPrescriptionInfoVO.getHisCode()!=null){
                            hlwCf02DO.setSBXH(wlyyPrescriptionInfoVO.getHisCode());
                        }
                    /*hlwCf02DO.setYPZH(Integer.parseInt(wlyyPrescriptionInfoVO.getFrequency()));*/
                        hlwCf02DO.setYFGG(wlyyPrescriptionInfoVO.getSpecification());
                  /*  hibenateUtils.save(hlwCf02DO);*/
                        String jsonString1 = JSONObject.toJSONString(hlwCf02DO);
                        logger.info("chufang2============");
                        Map<String,Object> params1 = new HashedMap();
                        params1.put("json",jsonString1);
                        params1.put("table","HLW_CF02");
                        logger.info("HLW_CF02:"+jsonString1);
                        if (wlyyPrescriptionInfoVO.getHisCode()==null){
                            HttpResponse response1 = HttpUtils.doGet(saveUrl,params1);
                            Integer sbxh = null;
                            if (response1.getStatus()==200){
                                logger.info("content"+response1.getContent());
                                String content = response1.getContent();
                                JSONObject jsonObject = JSONObject.parseObject(content);
                                JSONObject object = jsonObject.getJSONObject("obj");
                                if (object!=null){
                                    sbxh = object.getInteger("sbxh");
                                    logger.info("kaishi=========="+cfsb);
                                    WlyyPrescriptionInfoDO wlyyPrescriptionInfoDO = prescriptionInfoDao.findOne(wlyyPrescriptionInfoVO.getId());
                                    if (wlyyPrescriptionInfoDO!=null){
                                        wlyyPrescriptionInfoDO.setHisCode(sbxh);
                                        prescriptionInfoDao.save(wlyyPrescriptionInfoDO);
                                    }
                                }
                                logger.info("表HLW_CF02同步成功!");
                            }else {
                                logger.info("表HLW_CF02同步失败!"+response1.getErrorMsg());
                            }
                        }else {
                            HttpResponse response1 = HttpUtils.doGet(updateEntityUrl,params1);
                            if (response1.getStatus()==200){
                                logger.info("content"+response1.getContent());
                                logger.info("表HLW_CF02更新成功!");
                            }else {
                                logger.info("表HLW_CF02更新失败!"+response1.getErrorMsg());
                            }
                        }
                    }catch (Exception e){
                        e.printStackTrace();
                        e.getMessage();
                    }
                }
            }catch (Exception e){
                e.printStackTrace();
            }
        }
        return null;
    }
}

+ 44 - 42
business/base-service/src/main/java/com/yihu/jw/order/BusinessOrderService.java

@ -181,53 +181,55 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
                wlyyPrescriptionDO = prescriptionDao.save(wlyyPrescriptionDO);
                JSONArray array = new JSONArray();
                List<WlyyPrescriptionInfoDO> wlyyPrescriptionInfoDOS = prescriptionInfoDao.findByPrescriptionId(code, 1);
                WlyyHospitalSysDictDO hospitalSysDictDO = hospitalSysDictDao.findById("YKTCONTROL");
                for (WlyyPrescriptionInfoDO prescriptionInfoDO : wlyyPrescriptionInfoDOS) {
                    JSONObject object = new JSONObject();
                    //{"commodityName":"","commodityPrice":"","DrugUnit":"","MedicineDoctor":""}
                    object.put("commodityName", prescriptionInfoDO.getDrugName());
                    object.put("commodityPrice", prescriptionInfoDO.getPackRetprice());
                    object.put("DrugUnit", prescriptionInfoDO.getPackUnitName());
                    DoctorMappingDO doctorMappingDO = doctorMappingDao.findByDoctor(businessOrderDO.getDoctor());
                    String yktDoctor = "";
                    if (doctorMappingDO != null && StringUtils.isNoneBlank(doctorMappingDO.getMappingCode())) {
                        System.out.println("----------------"+hospitalSysDictDO.getDictValue());
                        if (null != hospitalSysDictDO && "0".equalsIgnoreCase(hospitalSysDictDO.getDictValue())) {
                        } else {
                            String doctorResponse = ykyyService.getYktDoctor(doctorMappingDO.getMappingCode());
                            JSONObject jsonObject = JSONObject.parseObject(doctorResponse);
                            if (jsonObject.getInteger("code") == 200) {
                                JSONArray array1 = jsonObject.getJSONArray("data");
                                if (array1 != null && array1.size() != 0) {
                                    yktDoctor = array1.getJSONObject(0).getString("DOCTORUSERID");
                if (wechatId.equalsIgnoreCase("xm_ykyy_wx")){
                    WlyyHospitalSysDictDO hospitalSysDictDO = hospitalSysDictDao.findById("YKTCONTROL");
                    for (WlyyPrescriptionInfoDO prescriptionInfoDO : wlyyPrescriptionInfoDOS) {
                        JSONObject object = new JSONObject();
                        //{"commodityName":"","commodityPrice":"","DrugUnit":"","MedicineDoctor":""}
                        object.put("commodityName", prescriptionInfoDO.getDrugName());
                        object.put("commodityPrice", prescriptionInfoDO.getPackRetprice());
                        object.put("DrugUnit", prescriptionInfoDO.getPackUnitName());
                        DoctorMappingDO doctorMappingDO = doctorMappingDao.findByDoctor(businessOrderDO.getDoctor());
                        String yktDoctor = "";
                        if (doctorMappingDO != null && StringUtils.isNoneBlank(doctorMappingDO.getMappingCode())) {
                            System.out.println("----------------"+hospitalSysDictDO.getDictValue());
                            if (null != hospitalSysDictDO && "0".equalsIgnoreCase(hospitalSysDictDO.getDictValue())) {
                            } else {
                                String doctorResponse = ykyyService.getYktDoctor(doctorMappingDO.getMappingCode());
                                JSONObject jsonObject = JSONObject.parseObject(doctorResponse);
                                if (jsonObject.getInteger("code") == 200) {
                                    JSONArray array1 = jsonObject.getJSONArray("data");
                                    if (array1 != null && array1.size() != 0) {
                                        yktDoctor = array1.getJSONObject(0).getString("DOCTORUSERID");
                                    }
                                }
                            }
                        } else {
                            throw new Exception("医生映射表不存在!");
                        }
                    } else {
                        throw new Exception("医生映射表不存在!");
                        object.put("MedicineDoctor", yktDoctor);
                        array.add(object);
                    }
                    object.put("MedicineDoctor", yktDoctor);
                    array.add(object);
                }
                BasePatientDO patientDO = patientDao.findById(businessOrderDO.getPatient());
                String userId = null;
                if (patientDO != null) {
                    userId = patientDO.getUserId();
                }
                if (null != hospitalSysDictDO && "0".equalsIgnoreCase(hospitalSysDictDO.getDictValue())) {
                    BasePatientDO patientDO = patientDao.findById(businessOrderDO.getPatient());
                    String userId = null;
                    if (patientDO != null) {
                        userId = patientDO.getUserId();
                    }
                    if (null != hospitalSysDictDO && "0".equalsIgnoreCase(hospitalSysDictDO.getDictValue())) {
                } else {
                    String response = ykyyService.addOrder4Jkzl("1", wlyyPrescriptionDO.getOrderId(), businessOrderDO.getOrderNo(), userId, array);
                    if (StringUtils.isNoneBlank(response)) {
                        JSONObject jsonObject = JSONObject.parseObject(response);
                        if (jsonObject.getString("code").equalsIgnoreCase("10000")) {
                            String orderId = jsonObject.getString("orderId");
                            String orderNo = jsonObject.getString("orderNo");
                            businessOrderDO.setYkOrderId(orderId);
                            businessOrderDO.setYkOrderNo(orderNo);
                            businessOrderDO.setUploadStatus(1);
                            businessOrderDao.save(businessOrderDO);
                    } else {
                        String response = ykyyService.addOrder4Jkzl("1", wlyyPrescriptionDO.getOrderId(), businessOrderDO.getOrderNo(), userId, array);
                        if (StringUtils.isNoneBlank(response)) {
                            JSONObject jsonObject = JSONObject.parseObject(response);
                            if (jsonObject.getString("code").equalsIgnoreCase("10000")) {
                                String orderId = jsonObject.getString("orderId");
                                String orderNo = jsonObject.getString("orderNo");
                                businessOrderDO.setYkOrderId(orderId);
                                businessOrderDO.setYkOrderNo(orderNo);
                                businessOrderDO.setUploadStatus(1);
                                businessOrderDao.save(businessOrderDO);
                            }
                        }
                    }
                }

+ 538 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/HlwTnCf01DO.java

@ -0,0 +1,538 @@
package com.yihu.jw.entity.hospital.prescription;
import com.fasterxml.jackson.annotation.JsonFormat;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;
/**
 * 眼科处方表1数据
 *
 * */
//@ApiModel(value = "HlwTnCf01DO", description = "眼科处方表1数据")
@Entity
@Table(name = "MS_CF01")
public class HlwTnCf01DO {
    private Integer cFSB;//	NUMBER(18)	N			处方识别 每次写一次就变化一次不能重复
    private String cFHM;//	VARCHAR2(10)	Y			处方号码
    private String fPHM;//	VARCHAR2(12)	Y			发票号码
    private Integer mZXH;//	NUMBER(18)	Y			门诊序号
    private Integer cFLX;//	NUMBER(1)	N			处方类型
    private Integer bRID;//	NUMBER(18)	Y			病人ID号
    private String bRXM;//	VARCHAR2(40)	Y			病人姓名
    private Date kFRQ;//	DATE	        N			开方日期
    private Integer cFTS;//	NUMBER(2)	N			处方贴数
    private Integer kSDM;//	NUMBER(4)	Y			科室代码
    private String ySDM;//	VARCHAR2(10)	Y			医生代码
    private Date fYRQ;//	DATE	        Y			发药日期
    private Integer fYCK;//	NUMBER(2)	Y			发药窗口
    private String hJGH;//	VARCHAR2(10)	Y			划价工号
    private String pYGH;//	VARCHAR2(10)	Y			配药工号
    private String fYGH;//	VARCHAR2(10)	Y			发药工号
    private Integer pYBZ;//	NUMBER(1)	N			配药标志
    private Integer fYBZ;//	NUMBER(1)	N			发药标志
    private Integer cFGL;//	NUMBER(18)	Y			处方关联
    private Integer zFPB;//	NUMBER(1)	N			作废判别
    private Integer dYBZ;//	NUMBER(1)	Y			打印标志
    private Integer yFSB;//	NUMBER(3)	N			药房识别
    private Integer tSCF;//	NUMBER(2)	Y			特殊处方
    private Integer tSLX;//	INTEGER	Y			特殊类型
    private Integer tYBZ;//	NUMBER(1)	Y			退药标志
    private Integer cFBZ;//	NUMBER(1)	Y			处方标志(CFBZ = 2 处方锁定)
    private Integer jZXH;//	NUMBER(18)	Y			门诊就诊
    private Integer yXPB;//	NUMBER(1)	N			优先处方
    private String jZKH;//	VARCHAR2(20)	Y			就诊卡号
    private Integer dMSB;//numeric(5, 0)
    private String sqr;//sqr varchar(8)
    private Integer zyzd;//numeric(18, 0)
    private Integer tmhd;//numeric(1, 0)
    private String voice;//	varchar(1)
    private String sereen;//	varchar(1)
    private Date voiceDate;//	datetime
    private Integer sJTS;//	numeric(4, 0)
    private Integer mRJJ;//	numeric(2, 0)
    private Integer pjbz;//	numeric(1, 0)
    private Integer fypj;//	numeric(1, 0)
    private Integer cFSCBZ;//	int
    private Integer sbjbh;//	int
    private String sbjbh1;//	varchar(20)
    private String grbh;//	varchar(50)
    private String dbjbbm;//	varchar(50)
    private String mzlsh;//	varchar(50)
    private Integer dJBZ;//	numeric(2, 0)
    private Integer djbzGx;//	int
    @Id
    @Column(name = "CFSB")
    public Integer getCFSB() {
        return cFSB;
    }
    public void setCFSB(Integer cFSB) {
        this.cFSB = cFSB;
    }
    @Column(name = "CFHM")
    public String getCFHM() {
        return cFHM;
    }
    public void setCFHM(String cFHM) {
        this.cFHM = cFHM;
    }
    @Column(name = "FPHM")
    public String getFPHM() {
        return fPHM;
    }
    public void setFPHM(String fPHM) {
        this.fPHM = fPHM;
    }
    @Column(name = "MZXH")
    public Integer getMZXH() {
        return mZXH;
    }
    public void setMZXH(Integer mZXH) {
        this.mZXH = mZXH;
    }
    @Column(name = "CFLX")
    public Integer getCFLX() {
        return cFLX;
    }
    public void setCFLX(Integer cFLX) {
        this.cFLX = cFLX;
    }
    @Column(name = "BRID")
    public Integer getBRID() {
        return bRID;
    }
    public void setBRID(Integer bRID) {
        this.bRID = bRID;
    }
    @Column(name = "BRXM")
    public String getBRXM() {
        return bRXM;
    }
    public void setBRXM(String bRXM) {
        this.bRXM = bRXM;
    }
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    @Column(name = "KFRQ")
    public Date getKFRQ() {
        return kFRQ;
    }
    public void setKFRQ(Date kFRQ) {
        this.kFRQ = kFRQ;
    }
    @Column(name = "CFTS")
    public Integer getCFTS() {
        return cFTS;
    }
    public void setCFTS(Integer cFTS) {
        this.cFTS = cFTS;
    }
    @Column(name = "KSDM")
    public Integer getKSDM() {
        return kSDM;
    }
    public void setKSDM(Integer kSDM) {
        this.kSDM = kSDM;
    }
    @Column(name = "YSDM")
    public String getYSDM() {
        return ySDM;
    }
    public void setYSDM(String ySDM) {
        this.ySDM = ySDM;
    }
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    @Column(name = "FYRQ")
    public Date getFYRQ() {
        return fYRQ;
    }
    public void setFYRQ(Date fYRQ) {
        this.fYRQ = fYRQ;
    }
    @Column(name = "FYCK")
    public Integer getFYCK() {
        return fYCK;
    }
    public void setFYCK(Integer fYCK) {
        this.fYCK = fYCK;
    }
    @Column(name = "HJGH")
    public String getHJGH() {
        return hJGH;
    }
    public void setHJGH(String hJGH) {
        this.hJGH = hJGH;
    }
    @Column(name = "PYGH")
    public String getPYGH() {
        return pYGH;
    }
    public void setPYGH(String pYGH) {
        this.pYGH = pYGH;
    }
    @Column(name = "FYGH")
    public String getFYGH() {
        return fYGH;
    }
    public void setFYGH(String fYGH) {
        this.fYGH = fYGH;
    }
    @Column(name = "PYBZ")
    public Integer getPYBZ() {
        return pYBZ;
    }
    public void setPYBZ(Integer pYBZ) {
        this.pYBZ = pYBZ;
    }
    @Column(name = "FYBZ")
    public Integer getFYBZ() {
        return fYBZ;
    }
    public void setFYBZ(Integer fYBZ) {
        this.fYBZ = fYBZ;
    }
    @Column(name = "CFGL")
    public Integer getCFGL() {
        return cFGL;
    }
    public void setCFGL(Integer cFGL) {
        this.cFGL = cFGL;
    }
    @Column(name = "ZFPB")
    public Integer getZFPB() {
        return zFPB;
    }
    public void setZFPB(Integer zFPB) {
        this.zFPB = zFPB;
    }
    @Column(name = "DYBZ")
    public Integer getDYBZ() {
        return dYBZ;
    }
    public void setDYBZ(Integer dYBZ) {
        this.dYBZ = dYBZ;
    }
    @Column(name = "YFSB")
    public Integer getYFSB() {
        return yFSB;
    }
    public void setYFSB(Integer yFSB) {
        this.yFSB = yFSB;
    }
    @Column(name = "TSCF")
    public Integer getTSCF() {
        return tSCF;
    }
    public void setTSCF(Integer tSCF) {
        this.tSCF = tSCF;
    }
    @Column(name = "TSLX")
    public Integer getTSLX() {
        return tSLX;
    }
    public void setTSLX(Integer tSLX) {
        this.tSLX = tSLX;
    }
    @Column(name = "TYBZ")
    public Integer getTYBZ() {
        return tYBZ;
    }
    public void setTYBZ(Integer tYBZ) {
        this.tYBZ = tYBZ;
    }
    @Column(name = "CFBZ")
    public Integer getCFBZ() {
        return cFBZ;
    }
    public void setCFBZ(Integer cFBZ) {
        this.cFBZ = cFBZ;
    }
    @Column(name = "JZXH")
    public Integer getJZXH() {
        return jZXH;
    }
    public void setJZXH(Integer jZXH) {
        this.jZXH = jZXH;
    }
    @Column(name = "YXPB")
    public Integer getYXPB() {
        return yXPB;
    }
    public void setYXPB(Integer yXPB) {
        this.yXPB = yXPB;
    }
    @Column(name = "JZKH")
    public String getJZKH() {
        return jZKH;
    }
    public void setJZKH(String jZKH) {
        this.jZKH = jZKH;
    }
    @Column(name = "DMSB")
    public Integer getdMSB() {
        return dMSB;
    }
    public void setdMSB(Integer dMSB) {
        this.dMSB = dMSB;
    }
    @Column(name = "sqr")
    public String getSqr() {
        return sqr;
    }
    public void setSqr(String sqr) {
        this.sqr = sqr;
    }
    @Column(name = "zyzd")
    public Integer getZyzd() {
        return zyzd;
    }
    public void setZyzd(Integer zyzd) {
        this.zyzd = zyzd;
    }
    @Column(name = "tmhd")
    public Integer getTmhd() {
        return tmhd;
    }
    public void setTmhd(Integer tmhd) {
        this.tmhd = tmhd;
    }
    @Column(name = "voice")
    public String getVoice() {
        return voice;
    }
    public void setVoice(String voice) {
        this.voice = voice;
    }
    @Column(name = "sereen")
    public String getSereen() {
        return sereen;
    }
    public void setSereen(String sereen) {
        this.sereen = sereen;
    }
    @Column(name = "voice_date")
    public Date getVoiceDate() {
        return voiceDate;
    }
    public void setVoiceDate(Date voiceDate) {
        this.voiceDate = voiceDate;
    }
    @Column(name = "SJTS")
    public Integer getSJTS() {
        return sJTS;
    }
    public void setSJTS(Integer sJTS) {
        this.sJTS = sJTS;
    }
    @Column(name = "MRJJ")
    public Integer getMRJJ() {
        return mRJJ;
    }
    public void setMRJJ(Integer mRJJ) {
        this.mRJJ = mRJJ;
    }
    @Column(name = "pjbz")
    public Integer getPjbz() {
        return pjbz;
    }
    public void setPjbz(Integer pjbz) {
        this.pjbz = pjbz;
    }
    @Column(name = "fypj")
    public Integer getFypj() {
        return fypj;
    }
    public void setFypj(Integer fypj) {
        this.fypj = fypj;
    }
    @Column(name = "CFSCBZ")
    public Integer getCFSCBZ() {
        return cFSCBZ;
    }
    public void setCFSCBZ(Integer cFSCBZ) {
        this.cFSCBZ = cFSCBZ;
    }
    @Column(name = "sbjbh")
    public Integer getSbjbh() {
        return sbjbh;
    }
    public void setSbjbh(Integer sbjbh) {
        this.sbjbh = sbjbh;
    }
    @Column(name = "sbjbh1")
    public String getSbjbh1() {
        return sbjbh1;
    }
    public void setSbjbh1(String sbjbh1) {
        this.sbjbh1 = sbjbh1;
    }
    @Column(name = "grbh")
    public String getGrbh() {
        return grbh;
    }
    public void setGrbh(String grbh) {
        this.grbh = grbh;
    }
    @Column(name = "dbjbbm")
    public String getDbjbbm() {
        return dbjbbm;
    }
    public void setDbjbbm(String dbjbbm) {
        this.dbjbbm = dbjbbm;
    }
    @Column(name = "mzlsh")
    public String getMzlsh() {
        return mzlsh;
    }
    public void setMzlsh(String mzlsh) {
        this.mzlsh = mzlsh;
    }
    @Column(name = "DJBZ")
    public Integer getDJBZ() {
        return dJBZ;
    }
    public void setDJBZ(Integer dJBZ) {
        this.dJBZ = dJBZ;
    }
    @Column(name = "djbz_gx")
    public Integer getDjbzGx() {
        return djbzGx;
    }
    public void setDjbzGx(Integer djbzGx) {
        this.djbzGx = djbzGx;
    }
}

+ 439 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/HlwTnCf02DO.java

@ -0,0 +1,439 @@
package com.yihu.jw.entity.hospital.prescription;
import javax.persistence.*;
/**
 * 眼科处方表1数据
 *
 * */
@Entity
@Table(name = "MS_CF02")
public class HlwTnCf02DO {
    private Integer sBXH;//NUMBER(18)   N注释
    private Integer cFSB;//NUMBER(18)   N识别序号
    private Integer yPXH;//NUMBER(6)    N处方识别
    private Integer yPCD;//NUMBER(6)    N药品序号
    private Integer xMLX;//NUMBER(2)    N药品产地
    private Integer cFTS;//NUMBER(2)    N项目类型
    private Double yPSL;//NUMBER(10,2) N处方贴数
    private Double yPDJ;//NUMBER(12,4) N药品数量
    private Double hJJE;//NUMBER(12,2) N药品单价
    private Integer yPZS;//INTEGER      N划价金额
    private String yCSL;//VARCHAR2(20)  N药品组数
    private Integer fYGB;//NUMBER(4)    N一次数量
    private Double zFBL;//NUMBER(5,3)  N费用归并
    private Integer gYTJ;//NUMBER(4)    Y自负比例
    private String yPYF;//VARCHAR2(20)  Y给药途径
    private Integer yPZH;//NUMBER(18)   Y药品用法
    private String yFGG;//VARCHAR2(20)  Y药品组号
    private String yFDW;//VARCHAR2(4)   Y药房规格
    private Integer yFBZ;//NUMBER(4)    N药房单位
    private String sJYL;//VARCHAR2(20)  Y药房包装
    private Integer pSPB;//NUMBER(1)    Y实际用量
    private Integer yYTS;//INTEGER      Y皮试判别
    private Double yCSL2;//NUMBER(10,4)Y用药天数
    private Double xSSL;//NUMBER(10,4) Y一次用量
    private Integer mRCS;//NUMBER(2)    N显示数量
    private String cFBZ;//VARCHAR2(40)  Y每日次数
    private Double yCJL;//NUMBER(10,2) Y处方标志
    private Integer pSJG;//NUMBER(1)    Y一次剂量
    private Integer pLXH;//NUMBER(4)    Y皮试结果
    private Integer sL;//numeric(18, 0)总数量
    private Integer yPSL1;//	numeric(10, 2)	Checked
    private Integer tgbz;//	int	Checked
    private Integer brjsh;//	numeric(18, 0)	Checked
    private Integer cSBZ;//	numeric(1, 0)	Checked
    private Integer jhjg;//	numeric(12, 4)	Unchecked
    private Integer jhje;//	numeric(12, 4)	Unchecked
    private String brjsh1;//	varchar(40)	Checked
    private String posLsh;//	varchar(6)	Checked
    private String jyje	;//varchar(12)	Checked
    private Integer jhjg1;//	numeric(12, 4)	Unchecked
    private Integer dzdr;//	numeric(1, 0)	Unchecked
    private Integer ypid;//	numeric(18, 0)	Checked
    @Id
    @Column(name = "SBXH")
    public Integer getSBXH() {
        return sBXH;
    }
    public void setSBXH(Integer sBXH) {
        this.sBXH = sBXH;
    }
    @Column(name = "CFSB")
    public Integer getCFSB() {
        return cFSB;
    }
    public void setCFSB(Integer cFSB) {
        this.cFSB = cFSB;
    }
    @Column(name = "YPXH")
    public Integer getYPXH() {
        return yPXH;
    }
    public void setYPXH(Integer yPXH) {
        this.yPXH = yPXH;
    }
    @Column(name = "YPCD")
    public Integer getYPCD() {
        return yPCD;
    }
    public void setYPCD(Integer yPCD) {
        this.yPCD = yPCD;
    }
    @Column(name = "XMLX")
    public Integer getXMLX() {
        return xMLX;
    }
    public void setXMLX(Integer xMLX) {
        this.xMLX = xMLX;
    }
    @Basic
    @Column(name = "CFTS")
    public Integer getCFTS() {
        return cFTS;
    }
    public void setCFTS(Integer cFTS) {
        this.cFTS = cFTS;
    }
    @Column(name = "YPSL")
    public Double getYPSL() {
        return yPSL;
    }
    public void setYPSL(Double yPSL) {
        this.yPSL = yPSL;
    }
    @Column(name = "YPDJ")
    public Double getYPDJ() {
        return yPDJ;
    }
    public void setYPDJ(Double yPDJ) {
        this.yPDJ = yPDJ;
    }
    @Column(name = "HJJE")
    public Double getHJJE() {
        return hJJE;
    }
    public void setHJJE(Double hJJE) {
        this.hJJE = hJJE;
    }
    @Column(name = "YPZS")
    public Integer getYPZS() {
        return yPZS;
    }
    public void setYPZS(Integer yPZS) {
        this.yPZS = yPZS;
    }
    @Column(name = "YCSL")
    public String getYCSL() {
        return yCSL;
    }
    public void setYCSL(String yCSL) {
        this.yCSL = yCSL;
    }
    @Column(name = "FYGB")
    public Integer getFYGB() {
        return fYGB;
    }
    public void setFYGB(Integer fYGB) {
        this.fYGB = fYGB;
    }
    @Column(name = "ZFBL")
    public Double getZFBL() {
        return zFBL;
    }
    public void setZFBL(Double zFBL) {
        this.zFBL = zFBL;
    }
    @Column(name = "GYTJ")
    public Integer getGYTJ() {
        return gYTJ;
    }
    public void setGYTJ(Integer gYTJ) {
        this.gYTJ = gYTJ;
    }
    @Column(name = "YPYF")
    public String getYPYF() {
        return yPYF;
    }
    public void setYPYF(String yPYF) {
        this.yPYF = yPYF;
    }
    @Column(name = "YPZH")
    public Integer getYPZH() {
        return yPZH;
    }
    public void setYPZH(Integer yPZH) {
        this.yPZH = yPZH;
    }
    @Column(name = "YFGG")
    public String getYFGG() {
        return yFGG;
    }
    public void setYFGG(String yFGG) {
        this.yFGG = yFGG;
    }
    @Column(name = "YFDW")
    public String getYFDW() {
        return yFDW;
    }
    public void setYFDW(String yFDW) {
        this.yFDW = yFDW;
    }
    @Column(name = "YFBZ")
    public Integer getYFBZ() {
        return yFBZ;
    }
    public void setYFBZ(Integer yFBZ) {
        this.yFBZ = yFBZ;
    }
    @Column(name = "SJYL")
    public String getSJYL() {
        return sJYL;
    }
    public void setSJYL(String sJYL) {
        this.sJYL = sJYL;
    }
    @Column(name = "PSPB")
    public Integer getPSPB() {
        return pSPB;
    }
    public void setPSPB(Integer pSPB) {
        this.pSPB = pSPB;
    }
    @Column(name = "YYTS")
    public Integer getYYTS() {
        return yYTS;
    }
    public void setYYTS(Integer yYTS) {
        this.yYTS = yYTS;
    }
    @Column(name = "YCSL2")
    public Double getYCSL2() {
        return yCSL2;
    }
    public void setYCSL2(Double yCSL2) {
        this.yCSL2 = yCSL2;
    }
    @Column(name = "XSSL")
    public Double getXSSL() {
        return xSSL;
    }
    public void setXSSL(Double xSSL) {
        this.xSSL = xSSL;
    }
    @Column(name = "MRCS")
    public Integer getMRCS() {
        return mRCS;
    }
    public void setMRCS(Integer mRCS) {
        this.mRCS = mRCS;
    }
    @Column(name = "CFBZ")
    public String getCFBZ() {
        return cFBZ;
    }
    public void setCFBZ(String cFBZ) {
        this.cFBZ = cFBZ;
    }
    @Column(name = "YCJL")
    public Double getYCJL() {
        return yCJL;
    }
    public void setYCJL(Double yCJL) {
        this.yCJL = yCJL;
    }
    @Column(name = "PSJG")
    public Integer getPSJG() {
        return pSJG;
    }
    public void setPSJG(Integer pSJG) {
        this.pSJG = pSJG;
    }
    @Column(name = "PLXH")
    public Integer getPLXH() {
        return pLXH;
    }
    public void setPLXH(Integer pLXH) {
        this.pLXH = pLXH;
    }
    @Column(name = "SL")
    public Integer getSL() {
        return sL;
    }
    public void setSL(Integer sL) {
        this.sL = sL;
    }
    @Column(name = "YPSL1")
    public Integer getYPSL1() {
        return yPSL1;
    }
    public void setYPSL1(Integer yPSL1) {
        this.yPSL1 = yPSL1;
    }
    @Column(name = "tgbz")
    public Integer getTgbz() {
        return tgbz;
    }
    public void setTgbz(Integer tgbz) {
        this.tgbz = tgbz;
    }
    @Column(name = "brjsh")
    public Integer getBrjsh() {
        return brjsh;
    }
    public void setBrjsh(Integer brjsh) {
        this.brjsh = brjsh;
    }
    @Column(name = "CSBZ")
    public Integer getCSBZ() {
        return cSBZ;
    }
    public void setCSBZ(Integer cSBZ) {
        this.cSBZ = cSBZ;
    }
    @Column(name = "jhjg")
    public Integer getJhjg() {
        return jhjg;
    }
    public void setJhjg(Integer jhjg) {
        this.jhjg = jhjg;
    }
    @Column(name = "jhje")
    public Integer getJhje() {
        return jhje;
    }
    public void setJhje(Integer jhje) {
        this.jhje = jhje;
    }
    @Column(name = "brjsh1")
    public String getBrjsh1() {
        return brjsh1;
    }
    public void setBrjsh1(String brjsh1) {
        this.brjsh1 = brjsh1;
    }
    @Column(name = "pos_lsh")
    public String getPosLsh() {
        return posLsh;
    }
    public void setPosLsh(String posLsh) {
        this.posLsh = posLsh;
    }
    @Column(name = "jyje")
    public String getJyje() {
        return jyje;
    }
    public void setJyje(String jyje) {
        this.jyje = jyje;
    }
    @Column(name = "jhjg1")
    public Integer getJhjg1() {
        return jhjg1;
    }
    public void setJhjg1(Integer jhjg1) {
        this.jhjg1 = jhjg1;
    }
    @Column(name = "dzdr")
    public Integer getDzdr() {
        return dzdr;
    }
    public void setDzdr(Integer dzdr) {
        this.dzdr = dzdr;
    }
    @Column(name = "ypid")
    public Integer getYpid() {
        return ypid;
    }
    public void setYpid(Integer ypid) {
        this.ypid = ypid;
    }
}

+ 96 - 0
svr/svr-internet-hospital-entrance/src/main/java/com/yihu/jw/entrance/controller/TnyyController.java

@ -1,9 +1,14 @@
package com.yihu.jw.entrance.controller;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.entity.hospital.prescription.*;
import com.yihu.jw.hospital.prescription.service.entrance.TnyyEntranceService;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ListEnvelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.utils.hibernate.HibenateUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
@ -13,6 +18,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Map;
/**
 * Created by Trick on 2020/1/19.
 */
@ -23,6 +31,8 @@ public class TnyyController extends EnvelopRestEndpoint {
    @Autowired
    private TnyyEntranceService tnyyEntranceService;
    @Autowired
    private HibenateUtils hibenateUtils;
    @GetMapping(value = "/queryBySql")
    @ApiOperation(value = "视图统一查询")
@ -31,6 +41,92 @@ public class TnyyController extends EnvelopRestEndpoint {
        return success(tnyyEntranceService.queryBySql(sql));
    }
    @GetMapping(value = "/update")
    @ApiOperation(value = "更新实体类")
    public ObjEnvelop udapte(@ApiParam(name = "json", value = "json", required = true)
                             @RequestParam(value = "json",required = true)String json,
                             @ApiParam(name = "table", value = "table", required = true)
                             @RequestParam(value = "table",required = true)String table){
        ObjEnvelop envelop = new ObjEnvelop();
        JSONObject object = JSONObject.parseObject(json);
        if (table.equalsIgnoreCase("HLW_CF01")){
            HlwTnCf01DO hlwCf01VO =  JSONObject.toJavaObject(object,HlwTnCf01DO.class);
            tnyyEntranceService.update(hlwCf01VO);
            envelop.setObj(hlwCf01VO);
        } else if (table.equalsIgnoreCase("HLW_CF02")) {
            HlwTnCf02DO hlwCf02VO =  JSONObject.toJavaObject(object,HlwTnCf02DO.class);
            tnyyEntranceService.update(hlwCf02VO);
            envelop.setObj(hlwCf02VO);
        }
        return success(envelop);
    }
    @GetMapping(value = "/updateBySql")
    @ApiOperation(value = "更新支付")
    public ObjEnvelop updateBySql(@ApiParam(name = "sql", value = "sql语句", required = true)
                                  @RequestParam(value = "sql",required = true)String sql){
        ObjEnvelop envelop = new ObjEnvelop();
        tnyyEntranceService.updateBySql(sql);
        return success(envelop);
    }
    @GetMapping(value = "/save")
    @ApiOperation(value = "保存01表")
    public Envelop save(@ApiParam(name = "json", value = "json", required = true)
                                 @RequestParam(value = "json",required = true)String json,
                             @ApiParam(name = "table", value = "table", required = true)
                                 @RequestParam(value = "table",required = true)String table){
        ObjEnvelop envelop = new ObjEnvelop();
        JSONObject object = JSONObject.parseObject(json);
        if (table.equalsIgnoreCase("HLW_CF01")){
            HlwTnCf01DO hlwTnCf01DO =  JSONObject.toJavaObject(object,HlwTnCf01DO.class);
            String cfsbSql =" select DQZ + 1 as \"total\"  from GY_IDENTITY_MS where BMC = 'MS_CF01'";
            String cfhmSql="select DQZ + 1 as \"total\"  from GY_IDENTITY_MS where BMC = 'MS_CF01_CFHM'";
            List<Map<String,Object>> cfsbList = hibenateUtils.createSQLQuery(cfsbSql);
            List<Map<String,Object>> cfhmList = hibenateUtils.createSQLQuery(cfhmSql);
            Long cfsb = 0L;
            Long cfhm = 0L;
            if (cfsbList!=null&&cfsbList.size()!=0){
                cfsb = Long.parseLong(cfsbList.get(0).get("total").toString());
                System.out.println("cfsb:"+cfsb);
                String updateCfsb = "update GY_IDENTITY_MS set DQZ=DQZ+1 where BMC = 'MS_CF01'";
                hibenateUtils.updateBySql(updateCfsb);
            }
            if (cfhmList!=null&&cfhmList.size()!=0){
                cfhm = Long.parseLong(cfhmList.get(0).get("total").toString());
                System.out.println("cfhm:"+cfhm);
                String updateCfhm = "update GY_IDENTITY_MS set DQZ=DQZ+1 where BMC = 'MS_CF01_CFHM'";
                hibenateUtils.updateBySql(updateCfhm);
            }
            hlwTnCf01DO.setCFSB(cfsb.intValue());
            hlwTnCf01DO.setCFHM(cfhm+"");
            JSONObject object1 = new JSONObject();
            object1.put("cfsb",cfsb);
            object1.put("cfhm",cfhm);
            tnyyEntranceService.save(hlwTnCf01DO);
            envelop.setObj(object1);
        }else if (table.equalsIgnoreCase("HLW_CF02")){
            HlwTnCf02DO hlwCf02DO =  JSONObject.toJavaObject(object,HlwTnCf02DO.class);
            String sbxhSql =" select DQZ + 1 as \"total\"  from GY_IDENTITY_MS where BMC = 'MS_CF02'";
            List<Map<String,Object>> sbxhList = hibenateUtils.createSQLQuery(sbxhSql);
            Long sbxh = 0L;
            if (sbxhList!=null&&sbxhList.size()!=0){
                sbxh = Long.parseLong(sbxhList.get(0).get("total").toString());
                String updateSbxh = "update GY_IDENTITY_MS set DQZ=DQZ+1 where BMC = 'MS_CF02'";
                hibenateUtils.updateBySql(updateSbxh);
            }
            JSONObject object1 = new JSONObject();
            object1.put("sbxh",sbxh);
            envelop.setObj(object1);
            hlwCf02DO.setSBXH(sbxh.intValue());
            tnyyEntranceService.save(hlwCf02DO);
        }
        return envelop;
    }
    
}

+ 1 - 1
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/DoctorConsultEndpoint.java

@ -232,7 +232,7 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
		
			JSONObject result = new JSONObject();
			synchronized (outpatientCode.intern()){
				if(!"xm_ykyy_wx".equals(wxId)){//中山医院-心脏中心需要挂号
				if(!"xm_ykyy_wx".equals(wxId)&&!"sd_tnzyy_wx".equals(wxId)){//中山医院-心脏中心需要挂号
					//1.调用挂号接口
					logger.info("调用挂号接口====START");
					String rsCode = "";

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

@ -2635,4 +2635,17 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
    }
    @GetMapping("/syncPrescription")
    @ApiOperation(value = "同步泰安处方")
    public Envelop syncPrescription( @ApiParam(name = "code", value = "code")
                                @RequestParam(value = "code",required = false)String code) throws Exception {
        try {
            return success(tnyyEntranceService.findByRealOrder(code,demoFlag));
        } catch (Exception e) {
            return Envelop.getError(e.getMessage());
        }
    }
}