Просмотр исходного кода

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/entrance/XzzxEntranceService.java
wangzhinan 5 лет назад
Родитель
Сommit
7f554fa429

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

@ -94,8 +94,6 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
    private static final Logger logger = LoggerFactory.getLogger(YkyyPrescriptionService.class);
    @Autowired
    private JdbcTemplate jdbcTemplate;
    @Autowired
    private BaseDoctorDao baseDoctorDao;
    @Autowired
@ -371,6 +369,7 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
            JSONObject object = new JSONObject();
            object.put("supply_code",map.get("pydm"));
            object.put("supply_name",map.get("xmmc"));
            object.put("ypyf",map.get("ypyf"));
            array.add(object);
        }
        return array;
@ -455,4 +454,40 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
        return array;
    }
    /**
     * 获取卡记录
     *  "PAT_NO": "P5616242-0  ",
     "CARD_NO": "D40136791",
     "CARD_STAT": "旧卡停用",
     "OP_DATE": "2011-09-27 15:35:57",
     "CARD_TYPE": "2",
     "CARD_TYPE_NAME": "社保卡",
     "social_no": "350211198411053024"
     * @param patient
     * @return
     * @throws Exception
     */
    public JSONArray findPatientCard(String patient)throws Exception{
        BasePatientDO patientDO = basePatientDao.findById(patient);
        if (patientDO!=null){
            JSONArray res = ykyyEntranceService.findHisCard(patientDO.getIdcard());
            JSONArray rs = new JSONArray();
            if(res !=null){
                for (int i =0;i<res.size();i++){
                    JSONObject jsonObject = new JSONObject();
                    jsonObject.put("PAT_NO",jsonObject.get("pat_no"));
                    jsonObject.put("CARD_NO",jsonObject.get("card_no"));
                    jsonObject.put("OP_DATE",jsonObject.get("op_date"));
                    jsonObject.put("CARD_STAT",jsonObject.get("card_stat"));
                    jsonObject.put("CARD_TYPE",jsonObject.get("card_type"));
                    jsonObject.put("CARD_TYPE_NAME",jsonObject.get("card_type_name"));
                }
            }
            return rs;
        }
        return null;
    }
}

+ 105 - 4
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/YkyyEntranceService.java

@ -763,6 +763,71 @@ public class YkyyEntranceService {
    }
    /**
     * 获取his病人信息
     * @param idcard
     * @return
     * @throws Exception
     */
    public JSONArray findHisPatient(String idcard) throws Exception {
        String sql = "SELECT\n" +
                "\tx.brid AS \"brid\",\n" +
                "\tx.mzhm AS \"mzhm\",\n" +
                "\tx.brxm AS \"brxm\",\n" +
                "\tx.sfzh AS \"sfzh\",\n" +
                "\tx.brxz AS \"brxz\",\n" +
                "\tx.brxb AS \"brxb\",\n" +
                "\tx.csny as \"csny\",\n" +
                "\tx.jzkh AS \"jzkh\",\n" +
                "\tx.jdsj AS \"jdsj\",\n" +
                "\tx.sjhm AS \"sjhm\",\n" +
                "\tx.fzxmc AS \"fzxmc\",\n" +
                "\tx.gzztmc AS \"gzztmc\",\n" +
                "\tx.lxdz AS \"lxdz\"\n" +
                "FROM\n" +
                "\tV_ZKSG_BRCX x\n" +
                "WHERE\n" +
                "\tsfzh.sfzh = '"+idcard+"' ";
        JSONArray array = new JSONArray();
        Map<String,Object> params = new HashedMap();
        params.put("sql",sql);
        logger.info("idcard:"+sql);
        HttpResponse response = HttpUtils.doGet(url,params);
        String content = response.getContent();
        logger.info("response:"+content);
        JSONObject rs = JSON.parseObject(content);
        Integer status = rs.getInteger("status");
        if (status==200){
            array = rs.getJSONArray("detailModelList");
        }
        return array;
    }
    /**
     * 获取his就诊卡号
     * @param idcard
     * @return
     * @throws Exception
     */
    public JSONArray findHisCard(String idcard) throws Exception {
        String sql = "select o.pat_no as \"pat_no\",o.card_no as \"card_no\",o.card_stat as \"card_stat\",o.op_date as \"op_date\",o.card_type as \"card_type\",o.card_type_name as \"card_type_name\" from v_zksg_brcx x,V_HLW_CARDINFO o where  o.pat_no = x.mzhm and x.sfzh = '"+idcard+"'";
        JSONArray array = new JSONArray();
        Map<String,Object> params = new HashedMap();
        params.put("sql",sql);
        logger.info("idcard:"+sql);
        HttpResponse response = HttpUtils.doGet(url,params);
        String content = response.getContent();
        logger.info("response:"+content);
        JSONObject rs = JSON.parseObject(content);
        Integer status = rs.getInteger("status");
        if (status==200){
            array = rs.getJSONArray("detailModelList");
        }
        return array;
    }
@ -781,14 +846,14 @@ public class YkyyEntranceService {
                wlyyPrescriptionInfoVOS.add(prescriptionInfoVO);
            }
            prescriptionVO.setInfoVOs(wlyyPrescriptionInfoVOS);
            synPrecriptionHis(prescriptionVO);
            synPrecriptionHis(prescriptionVO,code);
        }
        return wlyyPrescriptionDOs.toString();
    }
    public WlyyPrescriptionVO synPrecriptionHis(WlyyPrescriptionVO wlyyPrescriptionVO) throws Exception {
    public WlyyPrescriptionVO synPrecriptionHis(WlyyPrescriptionVO wlyyPrescriptionVO,String code) throws Exception {
        HlwCf01DO hlwCf01DO = new HlwCf01DO();
        if (wlyyPrescriptionVO!=null){
            hlwCf01DO.setSPZT(0);
@ -796,13 +861,24 @@ public class YkyyEntranceService {
            hlwCf01DO.setYFSB(3);
            hlwCf01DO.setCFLX(wlyyPrescriptionVO.getType());
            hlwCf01DO.setKFRQ(DateUtil.strToDate(DateUtil.dateToStr(wlyyPrescriptionVO.getCreateTime(),"yyyy-MM-dd HH:mm:ss")));
            hlwCf01DO.setZFPB(1);
            hlwCf01DO.setZFPB(0);
            hlwCf01DO.setFYBZ(0);
            hlwCf01DO.setPYBZ(0);
            hlwCf01DO.setDJYBZ(0);
            hlwCf01DO.setCFTS(1);
            hlwCf01DO.setCFSB(Integer.parseInt(wlyyPrescriptionVO.getRealOrder()));
            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.setLSCFBZ(0);
            hlwCf01DO.setZJFLAG(0);
            hlwCf01DO.setLSCFBZ(0);
            hlwCf01DO.setZJFLAG(0);
            hlwCf01DO.setFKZT(1);
            hlwCf01DO.setSCDDH(wlyyPrescriptionVO.getOrderNo());
            String patient = wlyyPrescriptionVO.getPatientCode();
            PatientMappingDO patientMappingDO = patientMappingDao.findByPatient(patient);
@ -814,6 +890,8 @@ public class YkyyEntranceService {
            hlwCf01DO.setYSDM(doctorMappingDO.getMappingCode());
            hlwCf01DO.setJZKH(wlyyPrescriptionVO.getSsc());
            hlwCf01DO.setGUID(getCode());
            hlwCf01DO.setSJLY(1);
            hlwCf01DO.setJZXH(Integer.parseInt(wlyyPrescriptionVO.getAdmNo()));
           /* hibenateUtils.save(hlwCf01DO);*/
            String jsonString = JSONObject.toJSONString(hlwCf01DO);
@ -823,7 +901,21 @@ public class YkyyEntranceService {
            logger.info("HLW_CF01:"+jsonString);
            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){
                    String cfsb = object.getString("cfsb");
                    List<WlyyPrescriptionDO> wlyyPrescriptionDOS = prescriptionDao.findById(code);
                    if (wlyyPrescriptionDOS!=null&&wlyyPrescriptionDOS.size()!=0){
                        WlyyPrescriptionDO wlyyPrescriptionDO = wlyyPrescriptionDOS.get(0);
                        wlyyPrescriptionDO.setRealOrder(cfsb);
                        prescriptionDao.save(wlyyPrescriptionDO);
                    }
                }
                logger.info("表HLW_CF01同步成功!");
            }else {
                logger.info("表HLW_CF01同步失败!"+response.getErrorMsg());
            }
@ -850,6 +942,9 @@ public class YkyyEntranceService {
                hlwCf02DO.setMRCS(Integer.parseInt(wlyyPrescriptionInfoVO.getDosage()));//每日次数
                hlwCf02DO.setYFBZ(wlyyPrescriptionInfoVO.getPackQuantity());
                hlwCf02DO.setYPYF(wlyyPrescriptionInfoVO.getUsageCode());
                hlwCf02DO.setGYTJ(wlyyPrescriptionInfoVO.getYpyf());
                hlwCf02DO.setPSPB(0);
                hlwCf02DO.setYYTS(1);
                /*hlwCf02DO.setYPZH(Integer.parseInt(wlyyPrescriptionInfoVO.getFrequency()));*/
                hlwCf02DO.setYFGG(wlyyPrescriptionInfoVO.getSpecification());
              /*  hibenateUtils.save(hlwCf02DO);*/
@ -877,4 +972,10 @@ public class YkyyEntranceService {
    public String getCode() {
        return UUID.randomUUID().toString().replaceAll("-", "");
    }
}

+ 10 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/HlwCf01DO.java

@ -63,6 +63,7 @@ public class HlwCf01DO {
    private Integer fKZT;//	NUMBER(1)	Y	0		0 未付款  1付款
    private String sPGH;//	VARCHAR2(10)	Y			审批工号
    private String gUID;//
    private Integer sJLY;//1互联网
    @Basic
    @Id
@ -558,4 +559,13 @@ public class HlwCf01DO {
    public void setGUID(String gUID) {
        this.gUID = gUID;
    }
    @Column(name = "SJLY")
    public Integer getSJLY() {
        return sJLY;
    }
    public void setSJLY(Integer sJLY) {
        this.sJLY = sJLY;
    }
}

+ 14 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/WlyyPrescriptionInfoDO.java

@ -147,6 +147,11 @@ public class WlyyPrescriptionInfoDO extends UuidIdentityEntity {
     */
    private Integer packQuantity;
    /**
     * 用法id
     */
    private Integer ypyf;
    @Column(name = "prescription_id")
    public String getPrescriptionId() {
@ -370,4 +375,13 @@ public class WlyyPrescriptionInfoDO extends UuidIdentityEntity {
    public void setPackQuantity(Integer packQuantity) {
        this.packQuantity = packQuantity;
    }
    @Column(name = "ypyf")
    public Integer getYpyf() {
        return ypyf;
    }
    public void setYpyf(Integer ypyf) {
        this.ypyf = ypyf;
    }
}

+ 11 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/hospital/prescription/WlyyPrescriptionInfoVO.java

@ -149,6 +149,9 @@ public class WlyyPrescriptionInfoVO extends UuidIdentityVOWithOperator {
    @ApiModelProperty(value = "药房包装", example = "药房包装")
    private Integer packQuantity;
    @ApiModelProperty(value = "给药途径", example = "给药途径")
    private Integer ypyf;
    private String comm;
@ -349,4 +352,12 @@ public class WlyyPrescriptionInfoVO extends UuidIdentityVOWithOperator {
    public void setPackQuantity(Integer packQuantity) {
        this.packQuantity = packQuantity;
    }
    public Integer getYpyf() {
        return ypyf;
    }
    public void setYpyf(Integer ypyf) {
        this.ypyf = ypyf;
    }
}

+ 27 - 4
svr/svr-internet-hospital-entrance/src/main/java/com/yihu/jw/entrance/controller/YkyyController.java

@ -11,8 +11,10 @@ import com.yihu.jw.hospital.prescription.service.entrance.YkyyEntranceService;
import com.yihu.jw.im.service.ImService;
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.util.date.DateUtil;
import com.yihu.jw.utils.hibernate.HibenateUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
@ -47,6 +49,8 @@ public class YkyyController extends EnvelopRestEndpoint {
    
    @Autowired
    private BaseDoctorDao baseDoctorDao;
    @Autowired
    private HibenateUtils hibenateUtils;
    @GetMapping(value = "/createSQLQuery")
    @ApiOperation(value = "视图统一查询")
@ -63,16 +67,35 @@ public class YkyyController extends EnvelopRestEndpoint {
    @GetMapping(value = "/save")
    @ApiOperation(value = "视图统一查询")
    public Envelop save(@ApiParam(name = "json", value = "json", required = true)
    @ApiOperation(value = "保存01和02表")
    public ObjEnvelop save(@ApiParam(name = "json", value = "json", required = true)
                                      @RequestParam(value = "json",required = true)String json,
                        @ApiParam(name = "table", value = "table", required = true)
                           @ApiParam(name = "table", value = "table", required = true)
                        @RequestParam(value = "table",required = true)String table) throws IOException {
        Envelop envelop = new Envelop();
        ObjEnvelop envelop = new ObjEnvelop();
        JSONObject object = JSONObject.parseObject(json);
        if (table.equalsIgnoreCase("HLW_CF01")){
            HlwCf01DO hlwCf01VO =  JSONObject.toJavaObject(object,HlwCf01DO.class);
            String cfsbSql =" select dqz + 1 as total  from portal_his.gy_identity_ms@xec_link where bmc = 'MS_CF01'";
            String cfhmSql="select dqz + 1 as total  from portal_his.gy_identity_ms@xec_link 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());
            }
            if (cfhmList!=null&&cfhmList.size()!=0){
                cfhm = Long.parseLong(cfhmList.get(0).get("total").toString());
            }
            hlwCf01VO.setCFSB(cfsb.intValue());
            hlwCf01VO.setCFHM(cfhm+"");
            JSONObject object1 = new JSONObject();
            object1.put("cfsb",cfsb);
            object1.put("cfhm",cfhm);
            ykyyEntranceService.save(hlwCf01VO);
            envelop.setObj(object1);
        }else if (table.equalsIgnoreCase("HLW_CF02")){
            HlwCf02DO hlwCf01VO =  JSONObject.toJavaObject(object,HlwCf02DO.class);
            ykyyEntranceService.save(hlwCf01VO);

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

@ -146,4 +146,11 @@ public class YkyyPrescriptionEndpoint extends EnvelopRestEndpoint {
                                               @RequestParam(value = "codes", required = false)String codes)throws Exception{
        return success(prescriptionService.getInspectionDictionary(pyKey,codes,winNo));
    }
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findPatientCard)
    @ApiOperation(value = "查询患者就诊卡", notes = "查询患者就诊卡")
    public ListEnvelop findPatientCard(@ApiParam(name = "patient", value = "居民Code")
                                       @RequestParam(value = "patient", required = true)String patient)throws Exception {
        return success(prescriptionService.findPatientCard(patient));
    }
}