Parcourir la source

药柜1.4.5需求

bing il y a 2 ans
Parent
commit
a8bb0cfd0c

+ 5 - 0
common/common-entity/sql记录

@ -1671,3 +1671,8 @@ ALTER table base_ylz_medical_recharge add column`amount` varchar(50) DEFAULT NUL
 --2022-07-20
alter table t_mediicine_order add column reviewer_state tinyint(2) default null comment '审方状态-1不通过0未审1审核通过';
 alter table t_mediicine_order add column reviewer_content varchar(255) default null comment '审方描述内容';
 alter table t_mediicine_order add column reviewer_doctor varchar(255) default null comment '审方医生';
alter table t_mediicine_order add column reviewer_doctor_name varchar(255) default null comment '审方医生';
 alter table t_mediicine_order add column reviewer_time varchar(255) default null comment '审方时间';

+ 33 - 1
common/common-entity/src/main/java/com/yihu/jw/entity/a1entity/Mediicineorder.java

@ -250,7 +250,15 @@ public class Mediicineorder extends UuidIdentityEntityWithOperator implements Se
     * 审方描述内容
     */
    private String reviewerContent;
    /**
     * 审方医生
     */
    private String reviewerDoctor;
    private String reviewerDoctorName;
    /**
     *审方时间
     */
    private String reviewerTime;
    /**
     * 订单详情
@ -661,4 +669,28 @@ public class Mediicineorder extends UuidIdentityEntityWithOperator implements Se
    public void setShipmentLogs(List<MedicineShipmentLog> shipmentLogs) {
        this.shipmentLogs = shipmentLogs;
    }
    public String getReviewerDoctor() {
        return reviewerDoctor;
    }
    public void setReviewerDoctor(String reviewerDoctor) {
        this.reviewerDoctor = reviewerDoctor;
    }
    public String getReviewerDoctorName() {
        return reviewerDoctorName;
    }
    public void setReviewerDoctorName(String reviewerDoctorName) {
        this.reviewerDoctorName = reviewerDoctorName;
    }
    public String getReviewerTime() {
        return reviewerTime;
    }
    public void setReviewerTime(String reviewerTime) {
        this.reviewerTime = reviewerTime;
    }
}

+ 11 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/a4endpoint/MedicineDeviceEndpoint.java

@ -821,6 +821,17 @@ public class MedicineDeviceEndpoint extends EnvelopRestEndpoint {
        return success(deviceService.getPrescriptionStatics(level,area, day));
    }
    @GetMapping(value = "getPrescriptionStaticsRank")
    @ApiOperation(value = "总览-处方订单情况统计", notes = "总览-处方订单情况统计")
    public Envelop getPrescriptionStaticsRank(
            @ApiParam(name = "area", value = "对应级别code", required = true)
            @RequestParam(value = "area", required = true) String area,
            @ApiParam(name = "day", value = "天数", required = false)
            @RequestParam(value = "day", required = false) Integer day,
            @ApiParam(name = "level", value = "1、市级、2、区级、3、社区", required = true)
            @RequestParam(value = "level", required = true) Integer level) throws Exception {
        return success(deviceService.getPrescriptionStaticsRank(level,area, day));
    }
    @PostMapping(value = BaseRequestMapping.BaseDevice.setWarrayRule)
    @ApiOperation(value = "设置设备药品库存报警规则")

+ 5 - 3
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/a4endpoint/MedicineOrderDrugsEndpoint.java

@ -84,7 +84,7 @@ public class MedicineOrderDrugsEndpoint extends EnvelopRestEndpoint {
    public Envelop getSettlementInfoFirst(
            @ApiParam(name = "recipe_no", value = "recipe_no")
            @RequestParam(value = "recipe_no", required = true) String recipe_no,
            @ApiParam(name = "mdtrt_cert_type", value = "凭证类型01扫医保凭证02身份证03医保卡 如果是扫凭证 该参数传02外加身份证字段 且无需再重复读卡 ")
            @ApiParam(name = "mdtrt_cert_type", value = "凭证类型01扫医保凭证02身份证03医保卡 如果是扫凭证 该参数传01外加身份证字段 且无需再重复读卡 ")
            @RequestParam(value = "mdtrt_cert_type", defaultValue = "03",required = false) String mdtrt_cert_type,
            @ApiParam(name = "card_sn", value = "卡识别码")
            @RequestParam(value = "card_sn", required = false) String card_sn,
@ -107,9 +107,11 @@ public class MedicineOrderDrugsEndpoint extends EnvelopRestEndpoint {
            @ApiParam(name = "readcardResult", value = "readcardResult")
            @RequestParam(value = "readcardResult", required = true) String readcardResult,
            @ApiParam(name = "registerResult", value = "registerResult")
            @RequestParam(value = "registerResult", required = false) String registerResult){
            @RequestParam(value = "registerResult", required = false) String registerResult,
            @ApiParam(name = "mdtrt_cert_type", value = "凭证类型01扫医保凭证02身份证03医保卡 如果是扫凭证 该参数传01外加身份证字段")
            @RequestParam(value = "mdtrt_cert_type",required = false) String mdtrt_cert_type){
        try {
            return success("操作成功", medOrderService.getSettlementInfoSecond(recipe_no,readcardResult,registerResult));
            return success("操作成功", medOrderService.getSettlementInfoSecond(recipe_no,mdtrt_cert_type,readcardResult,registerResult));
        } catch (Exception e) {
            e.printStackTrace();
            return Envelop.getError(e.getMessage());

+ 4 - 2
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/a4endpoint/MedicineOrderEndpoint.java

@ -126,9 +126,11 @@ public class MedicineOrderEndpoint extends EnvelopRestEndpoint {
                                 @ApiParam(name = "reviewerState",value = "审方状态-2取消审方,-1不通过,1审核通过",required = true)
                                 @RequestParam(value = "reviewerState",required = true)Integer reviewerState,
                                 @ApiParam(name = "reviewerContent",value = "审核描述内容",required = false)
                                 @RequestParam(value = "reviewerContent",required = false)String reviewerContent){
                                 @RequestParam(value = "reviewerContent",required = false)String reviewerContent,
                                 @ApiParam(name = "doctor",value = "审方医生",required = true)
                                 @RequestParam(value = "doctor",required = true)String doctor){
        try {
            JSONObject result = orderservice.reviewerOrder(orderId,reviewerState,reviewerContent);
            JSONObject result = orderservice.reviewerOrder(orderId,doctor,reviewerState,reviewerContent);
            if (result.getInteger(ResponseContant.resultFlag)==ResponseContant.fail){
                return failed(result.getString(ResponseContant.resultMsg));
            }else {

+ 18 - 12
svr/svr-base/src/main/java/com/yihu/jw/base/service/a3service/MedOrderService.java

@ -183,13 +183,13 @@ public class MedOrderService {
        JSONObject strinObj = JSONObject.parseObject(deviceParam.get("yb_strin").toString());
        JSONObject netData = new JSONObject();
        netData.put("opter","010XXX");
        netData.put("opter",orgCode);
        netData.put("msgid",strinObj.getString("outBizNo")+ DateUtil.getYyyymmddhhmmss(new Date()));
        netData.put("opmsgidter","123123");
        netData.put("fixmedins_code",strinObj.getString("outBizNo"));
        netData.put("opter_name","XX");
        netData.put("opter_name","自助机");
        netData.put("infver","V1.0");
        netData.put("opter_type","1");
        netData.put("opter_type","2");
        netData.put("mdtrtarea_admvs","350200");
        netData.put("fixmedins_name","XX");
        netData.put("signtype","SM2");
@ -336,13 +336,13 @@ public class MedOrderService {
         **/
        JSONObject strinObj = JSONObject.parseObject(deviceParam.get("yb_strin").toString());
        JSONObject netData = new JSONObject();
        netData.put("opter","010XXX");
        netData.put("opter",orgCode);
        netData.put("msgid",strinObj.getString("outBizNo")+ DateUtil.getYyyymmddhhmmss(new Date()));
        netData.put("opmsgidter","123123");
        netData.put("fixmedins_code",strinObj.getString("outBizNo"));
        netData.put("opter_name","XX");
        netData.put("opter_name","自助机");
        netData.put("infver","V1.0");
        netData.put("opter_type","1");
        netData.put("opter_type","2");
        netData.put("mdtrtarea_admvs","350200");
        netData.put("fixmedins_name","XX");
        netData.put("signtype","SM2");
@ -462,7 +462,7 @@ public class MedOrderService {
     * @throws Exception
     */
    @Transactional(rollbackFor = Exception.class)
    public com.alibaba.fastjson.JSONArray getSettlementInfoSecond(String recipe_no,String readcardResult,String registerResult) throws Exception {
    public com.alibaba.fastjson.JSONArray getSettlementInfoSecond(String recipe_no,String mdtrt_cert_type,String readcardResult,String registerResult) throws Exception {
        YlzMedicalRelationDO ylzMedicalRelationDO = ylzMedicailRelationDao.findByLog_no(recipe_no);
        JSONArray result = new JSONArray();
        JSONObject resultTmp = new JSONObject();
@ -573,13 +573,13 @@ public class MedOrderService {
                List<YlzMedicalMxDO> ylzMedicalMxDOSTmp = chrgBchnoKey.get(key);
                JSONObject strinObj = JSONObject.parseObject(deviceParam.get("yb_strin").toString());
                JSONObject netData = new JSONObject();
                netData.put("opter","010XXX");
                netData.put("opter",ylzMedicalRelationDO.getOrgCode());
                netData.put("msgid",ylzMedicalMxDOSTmp.get(0).getSetlMsgid());//发送方结算报文id
                netData.put("opmsgidter","123123");
                netData.put("fixmedins_code",strinObj.getString("outBizNo"));
                netData.put("opter_name","XX");
                netData.put("opter_name","自助机");
                netData.put("infver","V1.0");
                netData.put("opter_type","1");
                netData.put("opter_type","2");
                netData.put("mdtrtarea_admvs","350200");
                netData.put("fixmedins_name","XX");
                netData.put("signtype","SM2");
@ -590,8 +590,14 @@ public class MedOrderService {
                JSONObject dataInfo = new JSONObject();//结算基本信息
                dataInfo.put("psn_no",ylzMedicalRelationDO.getPsnNo());  //人员编号
                dataInfo.put("mdtrt_cert_type","03"); //就诊凭证类型
                dataInfo.put("mdtrt_cert_no",ylzMedicalRelationDO.getCardNo());   //就诊凭证编号
                if (StringUtils.isNotBlank(mdtrt_cert_type)){
                    if ("01".equals(mdtrt_cert_type)){
                        dataInfo.put("mdtrt_cert_type",mdtrt_cert_type); //就诊凭证类型
                    }
                }else {
                    dataInfo.put("mdtrt_cert_type","03"); //就诊凭证类型
                    dataInfo.put("mdtrt_cert_no",ylzMedicalRelationDO.getCardNo());   //就诊凭证编号
                }
                dataInfo.put("med_type",ylzMedicalRelationDO.getMedType());    //医疗类别
                Double medfee_sumamt = ylzMedicalMxDOSTmp.stream().mapToDouble(e-> Double.valueOf(e.getTotalMoney())).sum();

+ 14 - 1
svr/svr-base/src/main/java/com/yihu/jw/base/service/a3service/MedicineOrderService.java

@ -28,6 +28,7 @@ import com.yihu.jw.restmodel.ResponseContant;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.restmodel.web.PageEnvelop;
import com.yihu.jw.rm.base.BaseRequestMapping;
import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.util.http.HttpClientUtil;
@ -2861,8 +2862,16 @@ public class MedicineOrderService extends BaseJpaService<Mediicineorder, Mediici
    }
    @Transactional(rollbackFor = Exception.class)
    public JSONObject reviewerOrder(String orderId,Integer reviewerState,String reviewerContent) {
    public JSONObject reviewerOrder(String orderId,String doctor,Integer reviewerState,String reviewerContent) {
        JSONObject result = new JSONObject();
        UserDO userDO = userDao.findOne(doctor);
        if (null==userDO){
            result.put(ResponseContant.resultFlag, ResponseContant.fail);
            result.put(ResponseContant.resultMsg, "无权限操作");
            return result;
        }
        Mediicineorder mediicineorder = orderDao.findOne(orderId);
        if (null == mediicineorder) {
            result.put(ResponseContant.resultFlag, ResponseContant.fail);
@ -2875,6 +2884,10 @@ public class MedicineOrderService extends BaseJpaService<Mediicineorder, Mediici
            return result;
        }
        mediicineorder.setReviewerState(reviewerState);
        mediicineorder.setReviewerDoctor(doctor);
        mediicineorder.setReviewerDoctorName(userDO.getName());
        mediicineorder.setReviewerTime(DateUtil.getStringDate());
        mediicineorder.setReviewerState(reviewerState);
        if (org.apache.commons.lang3.StringUtils.isNotBlank(reviewerContent)) {
            mediicineorder.setReviewerContent(reviewerContent);
        }

+ 39 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/service/a3service/MedicinedeviceService.java

@ -5696,7 +5696,15 @@ public class MedicinedeviceService  extends BaseJpaService<Mediicinedevice, Medi
            }
        }
        sql = "SELECT count(1) as 'count' FROM t_mediicine_order o WHERE 1=1 and order_source='厦门i健康' "+condition+ timeCondition;
        Integer onlineTotal = jdbcTemplate.queryForObject(sql,Integer.class);
        sql = "SELECT count(1) as 'count' FROM t_mediicine_order o WHERE 1=1 and order_source='智业系统' "+condition+ timeCondition;
        Integer offlineTotal = jdbcTemplate.queryForObject(sql,Integer.class);
        object.put("total",total);
        object.put("onlineTotal",onlineTotal);
        object.put("offlineTotal",offlineTotal);
        String drugSql = "select sum(od.quantity) as quantity from t_mediicine_order_detail od where od.id_order IN (SELECT o.id as id  FROM t_mediicine_order o WHERE 1=1 "+condition+ timeCondition+")";
        Map<String,Object> drugTotalMap = jdbcTemplate.queryForMap(drugSql);
        Double quantity =0.0;
@ -5709,6 +5717,37 @@ public class MedicinedeviceService  extends BaseJpaService<Mediicinedevice, Medi
        return object;
    }
    /**
     * 订单排行统计
     * @param level
     * @param area
     * @param day
     * @return
     */
    public List<Map<String,Object>> getPrescriptionStaticsRank(int level,String area,int day){
        String condition = "";
        if (level==1){
            condition = "";
        }else if (level==2){
            condition = " o.belong_community IN (select h.code from dm_hospital h where h.town = '"+area+"') ";
        }else if (level==3){
            condition = " o.belong_community = '"+area+"' ";
        }
        Date startDate = null;
        if (day==1){
            startDate = DateUtil.strToDateLong(DateUtil.getStringDateShort()+" 00:00:00");
        }else {
            startDate = DateUtil.getPreDays(new Date(),-day);
        }
        String endTime = DateUtil.getStringDate();
        String timeCondition = " and o.create_time >='"+DateUtil.dateToStrLong(startDate)+"' and o.create_time <= '"+endTime+"'  ";
        String sql = "SELECT o.belong_community,o.community,count(o.id) 'orderTotal',count(IF(o.sell_state=1,1,null)) 'sellTotal'" +
                " FROM t_mediicine_order o WHERE 1=1 "+condition+ timeCondition;
        sql += " group by o.belong_community order by orderTotal desc";
        return jdbcTemplate.queryForList(sql);
    }
    /**
     * 更新出货单图片-出货图片