Browse Source

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/file_upload/FileUploadService.java
#	common/common-entity/src/main/java/com/yihu/jw/entity/IntegerIdentityEntity.java
wangzhinan 3 years ago
parent
commit
f5d11984a7

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

@ -12219,22 +12219,34 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            Map<String,Object> map = findRandomDoctor();
            net.sf.json.JSONObject rs = new JSONObject();
            if (map!=null){
                //先进行核算检测预约
                String result = entranceService.BS10144("3150000","0001",natTime,mediaCard,name,cardNo,mobile,pm,demoFlag);
                com.alibaba.fastjson.JSONObject object = com.alibaba.fastjson.JSONObject.parseObject(result);
                logger.info("核酸检测预约结束"+result);
                WlyyHospitalSysDictDO hospitalSysDictDO = hospitalSysDictDao.findById("natTimeConfig");
                String isOpen = null;
                if (hospitalSysDictDO!=null){
                    String dictValue = hospitalSysDictDO.getDictValue();
                    com.alibaba.fastjson.JSONObject jsonObject = com.alibaba.fastjson.JSONObject.parseObject(dictValue);
                    isOpen = jsonObject.getString("isOpen");
                }
                Boolean flag = false;
                if (object!=null){
                    com.alibaba.fastjson.JSONObject jsonObject = object.getJSONObject("MsgInfo");
                    String Msg = jsonObject.getString("Msg");
                    if (Msg.contains("Error")){
                if (isOpen!=null&&isOpen.equalsIgnoreCase("0")){
                    //先进行核算检测预约
                    String result = entranceService.BS10144("3150000","0001",natTime,mediaCard,name,cardNo,mobile,pm,demoFlag);
                    com.alibaba.fastjson.JSONObject object = com.alibaba.fastjson.JSONObject.parseObject(result);
                    logger.info("核酸检测预约结束"+result);
                    if (object!=null){
                        com.alibaba.fastjson.JSONObject jsonObject = object.getJSONObject("MsgInfo");
                        String Msg = jsonObject.getString("Msg");
                        if (Msg.contains("Error")){
                            returnMap.put("msg",Msg);
                            returnMap.put("status","-1");
                            return  returnMap;
                    }else {
                        flag = true;
                        }else {
                            flag = true;
                        }
                    }
                }else {
                    flag = true;
                }
                if (flag){
                    BaseNatAppointmentDO baseNatAppointmentDO= new BaseNatAppointmentDO();
                    baseNatAppointmentDO.setChargeAmount(chargeAmount);
@ -12978,10 +12990,24 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                BaseNatAppointmentDO baseNatAppointmentDO = baseNatAppointmentDao.findOne(id);
                if (null!=baseNatAppointmentDO){
                    if ("xm_zsyy_wx".equalsIgnoreCase(wechatId)){
                        res = entranceService.BS10145("3150000","0001",DateUtil.dateToStrLong(baseNatAppointmentDO.getAppointmentTime()),baseNatAppointmentDO.getMedicare(),baseNatAppointmentDO.getName(),baseNatAppointmentDO.getCardNo(),baseNatAppointmentDO.getMobile(),baseNatAppointmentDO.getAmpm(),demoFlag);
                        logger.info("核酸检测预约取消"+res);
                        com.alibaba.fastjson.JSONObject jsonObject = com.alibaba.fastjson.JSONObject.parseObject(res);
                        WlyyHospitalSysDictDO hospitalSysDictDO = hospitalSysDictDao.findById("natTimeConfig");
                        String isOpen = null;
                        if (hospitalSysDictDO!=null){
                            String dictValue = hospitalSysDictDO.getDictValue();
                            com.alibaba.fastjson.JSONObject jsonObject = com.alibaba.fastjson.JSONObject.parseObject(dictValue);
                            isOpen = jsonObject.getString("isOpen");
                        }
                        Boolean flag = false;
                        com.alibaba.fastjson.JSONObject jsonObject = new com.alibaba.fastjson.JSONObject();
                        if (isOpen!=null&&isOpen.equalsIgnoreCase("0")){
                            res = entranceService.BS10145("3150000","0001",DateUtil.dateToStrLong(baseNatAppointmentDO.getAppointmentTime()),baseNatAppointmentDO.getMedicare(),baseNatAppointmentDO.getName(),baseNatAppointmentDO.getCardNo(),baseNatAppointmentDO.getMobile(),baseNatAppointmentDO.getAmpm(),demoFlag);
                            logger.info("核酸检测预约取消"+res);
                            jsonObject = com.alibaba.fastjson.JSONObject.parseObject(res);
                        }else {
                            com.alibaba.fastjson.JSONObject object = new com.alibaba.fastjson.JSONObject();
                            object.put("Msg","success");
                            jsonObject.put("MsgInfo",object);
                        }
                        if (jsonObject!=null){
                            com.alibaba.fastjson.JSONObject object = jsonObject.getJSONObject("MsgInfo");
                            String Msg = object.getString("Msg");
@ -14390,4 +14416,80 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            throw e;
        }
    }
    public ObjEnvelop selectNatTime()throws Exception{
        ObjEnvelop envelop = new ObjEnvelop();
        GregorianCalendar ca = new GregorianCalendar();
        //i结果为“0”是上午 结果为“1”是下午
        Integer  i = ca.get(GregorianCalendar.AM_PM);
        WlyyHospitalSysDictDO hospitalSysDictDO = hospitalSysDictDao.findById("natTimeConfig");
        String isOpen = null;
        String sql = "SELECT COUNT(1) as count FROM `base_nat_appointment` where is_success = 1 and pay_status=1 ";
        if (hospitalSysDictDO!=null){
            String dictValue = hospitalSysDictDO.getDictValue();
            com.alibaba.fastjson.JSONObject jsonObject = com.alibaba.fastjson.JSONObject.parseObject(dictValue);
            String startAm = jsonObject.getString("startAm");
            String endAm = jsonObject.getString("endAm");
            String startPm = jsonObject.getString("startPm");
            String endPm = jsonObject.getString("endPm");
            String message1 = jsonObject.getString("message1");
            String message2 = jsonObject.getString("message2");
            Integer amTotal = jsonObject.getInteger("amTotal");
            Integer pmTotal = jsonObject.getInteger("pmTotal");
            Date startAmDate = DateUtil.strToDateLong(DateUtil.getStringDateShort()+" "+startAm);
            Date endAmDate = DateUtil.strToDateLong(DateUtil.getStringDateShort()+" "+endAm);
            Date startPmDate = DateUtil.strToDateLong(DateUtil.getStringDateShort()+" "+startPm);
            Date endPmDate = DateUtil.strToDateLong(DateUtil.getStringDateShort()+" "+endPm);
            Date now = new Date();
            if (i==0){
                if (now.getTime()>=startAmDate.getTime()&&now.getTime()<=endAmDate.getTime()){
                    sql += " and create_time >= '"+DateUtil.dateToStrLong(startAmDate)+"' and create_time <='"+DateUtil.dateToStrLong(endAmDate)+"' ";
                }else {
                    envelop.setMessage(message1);
                    envelop.setStatus(500);
                    return envelop;
                }
            }else if (i==1){
                if (now.getTime()>=(startPmDate.getTime())&&now.getTime()<=(endPmDate.getTime())){
                    sql += " and create_time >= '"+DateUtil.dateToStrLong(startPmDate)+"' and create_time <='"+DateUtil.dateToStrLong(endPmDate)+"' ";
                }else {
                    envelop.setMessage(message1);
                    envelop.setStatus(500);
                    return envelop;
                }
            }
            Map<String,Object> map = jdbcTemplate.queryForMap(sql);
            logger.info("map"+sql);
            Integer count = 0;
            if (map!=null){
                count= Integer.parseInt(map.get("count").toString());
            }
            if (i==0){
                if (amTotal>count){
                    Integer remainTotal = amTotal-count;
                    jsonObject.put("remainTotal",remainTotal);
                }else {
                    envelop.setMessage(message2);
                    envelop.setStatus(500);
                    return envelop;
                }
            }else if (i==1){
                if (pmTotal>count){
                    Integer remainTotal = pmTotal-count;
                    jsonObject.put("remainTotal",remainTotal);
                }else {
                    envelop.setMessage(message2);
                    envelop.setStatus(500);
                    return envelop;
                }
            }
            envelop.setStatus(200);
            envelop.setMessage("获取号源成功");
            envelop.setObj(jsonObject);
            return envelop;
        }else {
            envelop.setStatus(500);
            envelop.setMessage("获取号源失败");
            return envelop;
        }
    }
}

+ 8 - 4
business/base-service/src/main/java/com/yihu/jw/internet/service/InternetCommonService.java

@ -31,6 +31,7 @@ import com.yihu.jw.utils.JSONUtils;
import com.yihu.jw.utils.encode.AESUtils;
import com.yihu.jw.utils.hibernate.HibenateUtils;
import com.yihu.mysql.query.BaseJpaService;
import com.ylzinfo.ehc.common.utils.DateUtils;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.LoggerFactory;
@ -460,7 +461,7 @@ public class InternetCommonService extends BaseJpaService<InternetUpErrorLogDO,
                "   p.register_date AS \"date\"," +
                  " p.mobile as \"mobile\""+
                "   FROM wlyy_outpatient p " +
                " WHERE 1=1" ;
                " WHERE 1=1 and p.register_no is not null " ;
        Map<String,Object> params = new HashedMap();
        if(StringUtils.isNotBlank(startDate)){
            sql =  sql + "  and p.create_time >=:startDate ";
@ -1531,6 +1532,7 @@ public class InternetCommonService extends BaseJpaService<InternetUpErrorLogDO,
        int error = 0;
        int dataError = 0;
        logger.info("1231321321321");
        //时间参数
        Map<String,Object> params = new HashedMap();
@ -1538,7 +1540,7 @@ public class InternetCommonService extends BaseJpaService<InternetUpErrorLogDO,
        String yyghSql = "SELECT " +
                "   count(1) AS \"yyghtotal\"" +
                " FROM wlyy_outpatient p " +
                " WHERE 1=1" ;
                " WHERE 1=1 and p.register_no is not null " ;
        if(StringUtils.isNotBlank(startDate)){
            yyghSql =  yyghSql + "  and p.create_time >=:startDate ";
            params.put("startDate",DateUtil.stringToDate(startDate+" 00:00:00","yyyy-MM-dd HH:mm:ss"));
@ -1696,7 +1698,7 @@ public class InternetCommonService extends BaseJpaService<InternetUpErrorLogDO,
            //mysql 与 Oracle 聚合函数返回类型不一致,需要判断装换
            gctptotal = hibenateUtils.objTransformLong(gctp.get(0).get("gctptotal"));
        }
        logger.info("1231321321321+++++");
        JSONObject jb = new JSONObject();
        Boolean errorFlag = false;
        try {
@ -1711,7 +1713,8 @@ public class InternetCommonService extends BaseJpaService<InternetUpErrorLogDO,
            jb.put("dzcf_upload_count", dzcftotal);
            jb.put("ypmx_upload_count", infototal);
            jb.put("gctp_upload_count", gctptotal);
            jb.put("ywsj", startDate);
            logger.info("ywsj"+DateUtil.dateToStrShort(DateUtil.strToDateShort(startDate)));
            jb.put("ywsj", DateUtil.dateToStrShort(DateUtil.strToDateShort(startDate)));
            jb.put("crt_time", DateUtil.dateToStr(new Date(),"yyyy-MM-dd HH:mm:ss"));
@ -1721,6 +1724,7 @@ public class InternetCommonService extends BaseJpaService<InternetUpErrorLogDO,
            dataError++;
            logger.error(e.toString());
        }
        logger.info("1231321321321====");
        logger.info(jb.toString());
        if(!errorFlag){
            JSONArray jsonArray = new JSONArray();

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

@ -3279,6 +3279,16 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
        }
    }
    @GetMapping("/selectNatTime")
    @ApiOperation(value = "核酸号源控制查询")
    public ObjEnvelop selectNatTime() throws Exception {
        try {
            return prescriptionService.selectNatTime();
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
        }
    }
    @GetMapping("/saveNatAppointment")
    @ApiOperation(value = "核酸检测预约接口")
    public Envelop saveNatAppointment(@ApiParam(name = "chargeAmount", value = "chargeAmount")