Explorar o código

医保移动支付

lihong hai 1 ano
pai
achega
87dfcc413e
Modificáronse 27 ficheiros con 797 adicións e 432 borrados
  1. 20 0
      src/main/java/cn/hnthyy/thmz/Utils/Tools.java
  2. 8 1
      src/main/java/cn/hnthyy/thmz/common/Constants.java
  3. 36 0
      src/main/java/cn/hnthyy/thmz/controller/CommonController.java
  4. 22 2
      src/main/java/cn/hnthyy/thmz/controller/api/MedicalViewApiController.java
  5. 39 12
      src/main/java/cn/hnthyy/thmz/controller/mz/MzChargeDetailController.java
  6. 1 0
      src/main/java/cn/hnthyy/thmz/controller/mz/MzZdYpYshController.java
  7. 6 0
      src/main/java/cn/hnthyy/thmz/entity/his/mz/MzChargeDetail.java
  8. 23 0
      src/main/java/cn/hnthyy/thmz/entity/his/mz/MzOrderLock.java
  9. 1 1
      src/main/java/cn/hnthyy/thmz/entity/his/zd/ZdUnitCode.java
  10. 10 10
      src/main/java/cn/hnthyy/thmz/mapper/his/mz/MzChargeDetailMapper.java
  11. 12 0
      src/main/java/cn/hnthyy/thmz/mapper/his/mz/MzOrderLockMapper.java
  12. 5 2
      src/main/java/cn/hnthyy/thmz/mapper/his/mz/MzPatientMiMapper.java
  13. 11 9
      src/main/java/cn/hnthyy/thmz/mapper/his/zd/MzZdYpYshMapper.java
  14. 6 3
      src/main/java/cn/hnthyy/thmz/mapper/his/zd/ZdUnitCodeMapper.java
  15. 66 43
      src/main/java/cn/hnthyy/thmz/service/impl/his/mz/MzChargeDetailServiceImpl.java
  16. 3 0
      src/main/java/cn/hnthyy/thmz/service/impl/his/mz/MzOrderDetailServiceImpl.java
  17. 175 175
      src/main/java/cn/hnthyy/thmz/service/impl/thmz/HaiCiAdapterServiceImpl.java
  18. 92 3
      src/main/java/cn/hnthyy/thmz/service/impl/thmz/HaiCiAdapterServiceTaiheImpl.java
  19. 1 1
      src/main/java/cn/hnthyy/thmz/service/impl/thmz/OrderStatusChangeServiceImpl.java
  20. 1 1
      src/main/java/cn/hnthyy/thmz/service/impl/thmz/TsmzServiceImpl.java
  21. 30 0
      src/main/java/cn/hnthyy/thmz/service/thmz/HaiCiAdapterService.java
  22. 4 0
      src/main/java/cn/hnthyy/thmz/vo/MzDepositFileVo.java
  23. 74 82
      src/main/resources/static/js/mz/clinic.js
  24. 94 71
      src/main/resources/static/js/mz/toll_administration.js
  25. 7 0
      src/main/resources/static/js/mz/unit_code.js
  26. 42 16
      src/main/resources/templates/mz/clinic.html
  27. 8 0
      src/main/resources/templates/mz/unit_code.html

+ 20 - 0
src/main/java/cn/hnthyy/thmz/Utils/Tools.java

@@ -713,6 +713,16 @@ public class Tools {
         return result;
     }
 
+    public static String getHisOrdNum(String patientId,Integer times,Integer receiptNo){
+        return patientId + "_" + times + "_" + receiptNo;
+    }
+
+
+    public static String getEcToken(String readCard) {
+        Map<String, Object> res = (Map) JsonUtil.jsontoObject(readCard, Map.class);
+        return (String) res.get("ecToken");
+    }
+
     public static String beforeAddZeroStr(String str){
         if(StrUtil.isNotBlank(str) && str.length() == 1){
             return "0" + str;
@@ -725,6 +735,16 @@ public class Tools {
     }
 
     public static void main(String[] args) {
+        String num1 = "1";
+        Integer num2 = 0;
+        if(num1 == null){
+            System.out.println(0);
+        }else if(num2 == 0){
+            System.out.println(1);
+        }else {
+            System.out.println(2);
+        }
+
     }
 
 }

+ 8 - 1
src/main/java/cn/hnthyy/thmz/common/Constants.java

@@ -553,5 +553,12 @@ public class Constants {
      */
     public static final String JZ_CODE = "03";
 
-
+    //退款处理中
+    public static final String REFUND_PROCEEDING = "REFUND_PROCEEDING";
+    //退款成功
+    public static final String REFUND_SUCCEED = "REFUND_SUCCEED";
+    //退款失败
+    public static final String REFUND_FAILED = "REFUND_FAILED";
+    //退款异常
+    public static final String REFUND_ABNORMAL = "REFUND_ABNORMAL";
 }

+ 36 - 0
src/main/java/cn/hnthyy/thmz/controller/CommonController.java

@@ -6,12 +6,14 @@ import cn.hnthyy.thmz.Utils.Tools;
 import cn.hnthyy.thmz.comment.UserLoginToken;
 import cn.hnthyy.thmz.entity.his.mz.CodeNameEntity;
 import cn.hnthyy.thmz.entity.his.mz.MzOrderFrequency;
+import cn.hnthyy.thmz.entity.his.mz.MzOrderLock;
 import cn.hnthyy.thmz.enums.CertificateTypeEnum;
 import cn.hnthyy.thmz.enums.ClassCodeEnum;
 import cn.hnthyy.thmz.enums.NumberEnum;
 import cn.hnthyy.thmz.enums.OrderFrequencyEnum;
 import cn.hnthyy.thmz.enums.TemplateKindTypeEnum;
 import cn.hnthyy.thmz.enums.TemplateTypeEnum;
+import cn.hnthyy.thmz.mapper.his.mz.MzOrderLockMapper;
 import cn.hnthyy.thmz.service.his.RegionService;
 import cn.hnthyy.thmz.service.his.mz.MzBillItemService;
 import cn.hnthyy.thmz.service.his.mz.MzOrderFrequencyService;
@@ -29,6 +31,7 @@ import cn.hnthyy.thmz.service.his.zd.ZdIcdCodeService;
 import cn.hnthyy.thmz.service.his.zd.ZdMaritalStatusService;
 import cn.hnthyy.thmz.service.his.zd.ZdMzClassService;
 import cn.hnthyy.thmz.service.thmz.UserService;
+import cn.hnthyy.thmz.vo.MzDepositFileVo;
 import cn.hutool.core.convert.Convert;
 import cn.hutool.core.util.StrUtil;
 import cn.hutool.http.HttpRequest;
@@ -87,6 +90,8 @@ public class CommonController {
     private ZdChargeBaClassService zdChargeBaClassService;
     @Autowired
     private MzOrderFrequencyService mzOrderFrequencyService;
+    @Resource
+    private MzOrderLockMapper mzOrderLockMapper;
     //websocket 地址前半部分
     @Value("${webSocketHost}")
     private String webSocketHost;
@@ -1175,6 +1180,37 @@ public class CommonController {
         }
     }
 
+    /**
+     * @description: 解锁处方
+     * @author: lihong
+     * @date: 2024/10/29 10:07
+     * @return: cn.hnthyy.thmz.Utils.R
+     **/
+    @PostMapping("/deleteOrderLock")
+    public R deleteOrderLock(@RequestBody MzDepositFileVo mzDepositFileVo){
+        MzOrderLock mzOrderLock = new MzOrderLock();
+        mzOrderLock.setHisOrderNum(Tools.getHisOrdNum(mzDepositFileVo.getPatientId(),mzDepositFileVo.getTimes(),Convert.toInt(mzDepositFileVo.getReceiptNo(),1)));
+        mzOrderLock.setLockFlag(0);
+        mzOrderLockMapper.updateById(mzOrderLock);
+        return R.ok();
+    }
+
+    /**
+     * @description: 处方加锁
+     * @author: lihong
+     * @date: 2024/10/29 10:15
+     * @param: mzDepositFileVo
+     * @return: cn.hnthyy.thmz.Utils.R
+     **/
+    @PostMapping("/addOrderLock")
+    public R addOrderLock(@RequestBody MzDepositFileVo mzDepositFileVo){
+        MzOrderLock mzOrderLock = new MzOrderLock();
+        mzOrderLock.setHisOrderNum(Tools.getHisOrdNum(mzDepositFileVo.getPatientId(),mzDepositFileVo.getTimes(),Convert.toInt(mzDepositFileVo.getReceiptNo(),1)));
+        mzOrderLock.setLockFlag(1);
+        mzOrderLockMapper.updateById(mzOrderLock);
+        return R.ok();
+    }
+
 
     @GetMapping("/queryProvinceCodes")
     public R queryProvinceCodes(){

+ 22 - 2
src/main/java/cn/hnthyy/thmz/controller/api/MedicalViewApiController.java

@@ -39,6 +39,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.dao.DataIntegrityViolationException;
 import org.springframework.web.bind.annotation.*;
 
+import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 import java.math.BigDecimal;
 import java.text.SimpleDateFormat;
@@ -101,8 +102,9 @@ public class MedicalViewApiController {
     private ConfigService configService;
     @Autowired
     private RegionService regionService;
-    @Autowired
-    private DiscountService discountService;
+    @Resource
+    private ShareholderCardService shareholderCardService;
+
     //海慈身份证类型
     private static final String ID_CARD_TYPE = "11";
     //诊疗卡类型
@@ -588,12 +590,30 @@ public class MedicalViewApiController {
             }
             mzChargeDetailService.formatMzChargeDetail(mzChargeDetailList);
             List<Map<String, Object>> returnList = new ArrayList<>();
+            Integer discountFlag = shareholderCardService.checkCurDiscount(mzPatientMi.getPatientId());
             for (MzChargeDetail mzChargeDetail : mzChargeDetailList) {
                 Clinic clinic = clinicService.queryByPatientIdAndTimesAndReceiptNo(mzChargeDetail.getPatientId(), mzChargeDetail.getTimes(), mzChargeDetail.getReceiptNo());
                 if (clinic != null && StringUtils.isNotBlank(clinic.getOpId()) && Constants.HLWYY_CODE.equals(clinic.getOpId()) && !whiteList.getOpId().equals(clinic.getOpId())) {
                     continue;
                 }
+                if(clinic == null){
+                    clinic = clinicService.queryByPatientIdAndTimesAndReceiptNo(mzChargeDetail.getPatientId(), mzChargeDetail.getTimes(), 0);
+                }
                 Map<String, Object> map = new HashMap<>();
+
+                if(discountFlag == null){
+                    if((clinic != null && Convert.toInt(clinic.getZgmztczf(),0) == 0) || Convert.toBigDecimal(mzChargeDetail.getDiscountAmount(),BigDecimal.ZERO).compareTo(new BigDecimal("0.1")) > 0){
+                        //vipFlag  0 普通病人  1 股东卡已打折,不进医保 2 股东卡不打折,需要进医保
+                        map.put("vipFlag", 1);
+                    }
+                    else {
+                        map.put("vipFlag", 0);
+                    }
+                }else if(clinic != null && Convert.toInt(clinic.getZgmztczf(),0) == 0){
+                    map.put("vipFlag", 1);
+                }else {
+                    map.put("vipFlag", 2);
+                }
                 map.put("hisOrdNum", mzChargeDetail.getPatientId() + "_" + mzChargeDetail.getTimes() + "_" + mzChargeDetail.getReceiptNo());
                 map.put("patName", mzChargeDetail.getName());
                 map.put("payName", "");

+ 39 - 12
src/main/java/cn/hnthyy/thmz/controller/mz/MzChargeDetailController.java

@@ -29,6 +29,7 @@ import cn.hnthyy.thmz.enums.GenderEnum;
 import cn.hnthyy.thmz.enums.MzfzStatusEnum;
 import cn.hnthyy.thmz.enums.PayMarkEnum;
 import cn.hnthyy.thmz.enums.YesNoEnum;
+import cn.hnthyy.thmz.mapper.his.mz.MzOrderLockMapper;
 import cn.hnthyy.thmz.pageDto.MzChargeDetailPageDto;
 import cn.hnthyy.thmz.service.his.ResponceTypeService;
 import cn.hnthyy.thmz.service.his.mz.*;
@@ -133,6 +134,9 @@ public class MzChargeDetailController {
     private TransactionService transactionService;
     @Autowired
     private ZdChequeTypeService zdChequeTypeService;
+    @Resource
+    private MzOrderLockMapper mzOrderLockMapper;
+
     @Value("${healthEducationUrl}")
     private String healthEducationUrl;
     @Value("${wxPayQrUrl}")
@@ -651,6 +655,15 @@ public class MzChargeDetailController {
             User tokenUser = (User) JsonUtil.jsontoObject(decodedJWT.getSubject(), User.class);
             List<MzChargeDetail> mzChargeDetails = mzChargeDetailService.getNewListForRefundFee(tokenUser.getUserIdCode(), mzDepositFileVo, YesNoEnum.NO);
             PageViewVo pageViewVo = new PageViewVo();
+            Boolean mipOrderFlag = haiCiAdapterService.isMipOrder(Tools.getHisOrdNum(mzDepositFileVo.getPatientId(), mzDepositFileVo.getTimes(), mzDepositFileVo.getReceiptNo()));
+            if(mzChargeDetails != null && mzChargeDetails.size() > 0 ){
+                if(mipOrderFlag){
+                    throw new MzException("医保移动支付退款,只能全部退款,不能部分退费");
+                }
+                if(Convert.toBigDecimal(oriMzChargeDetail.getNotDiscountAmount(),BigDecimal.ZERO).subtract(Convert.toBigDecimal(oriMzChargeDetail.getAmount(),BigDecimal.ZERO)).compareTo(new BigDecimal("0.01")) > 0){
+                    throw new MzException("优惠打折项目,只能全部退款,不能部分退费");
+                }
+            }
             if (mzChargeDetails == null || mzChargeDetails.size() == 0) {
                 MzChargeDetail returnMzChargeDetail = new MzChargeDetail();
                 returnMzChargeDetail.setPatientId(mzDepositFileVo.getPatientId());
@@ -664,6 +677,7 @@ public class MzChargeDetailController {
                     BigDecimal acctPay = ybAmountMap.get("acct_pay");
                     refundFee = (refundFee == null ? BigDecimal.ZERO : refundFee).subtract(fundPaySumamt == null ? BigDecimal.ZERO : fundPaySumamt).subtract(acctPay == null ? BigDecimal.ZERO : acctPay);
                 }
+                returnMzChargeDetail.setMipOrderFlag(mipOrderFlag ? 1 : 0);
                 returnMzChargeDetail.setRefundFee(refundFee);
                 pageViewVo.setTotal(0);
                 pageViewVo.setData(Arrays.asList(returnMzChargeDetail));
@@ -681,7 +695,10 @@ public class MzChargeDetailController {
             mzChargeDetailService.formatMzChargeDetail(realMzChargeDetails);
             int ybCount = mzPatientMiService.queryCountYbZf(mzDepositFileVo.getPatientId(), mzDepositFileVo.getTimes());
             if(CollUtil.isNotEmpty(realMzChargeDetails)){
-                realMzChargeDetails.forEach(item->item.setYbZfFlag(ybCount > 0 ? "1" : "0"));
+                realMzChargeDetails.forEach(item->{
+                    item.setMipOrderFlag(mipOrderFlag ? 1 : 0);
+                    item.setYbZfFlag(ybCount > 0 ? "1" : "0");
+                });
             }
             pageViewVo.setData(realMzChargeDetails);
             resultMap.put("code", 0);
@@ -860,8 +877,21 @@ public class MzChargeDetailController {
                 return resultMap;
             }
             Map<String, Object> map ;
-
-            if(StrUtil.isBlank(mzDepositFileVo.getReadCardResult())){
+            Boolean mipOrder = haiCiAdapterService.isMipOrder(Tools.getHisOrdNum(mzDepositFileVo.getPatientId(), mzDepositFileVo.getTimes(), mzDepositFileVo.getReceiptNo()));
+            if(mipOrder){
+                if(!"01".equals(mzDepositFileVo.getReadCardType())){
+                    throw new MzException("该订单是移动医保支付,请读取电子凭证!");
+                }
+                if(StrUtil.isBlank(mzDepositFileVo.getReadCardResult())){
+                    throw new MzException("该订单是移动医保支付,读取电子凭证内容不能为空!");
+                }
+                mzDepositFileVo.setRefundType(1);
+                mzDepositFileVo.setEcToken(Tools.getEcToken(mzDepositFileVo.getReadCardResult()));
+                log.info("ecToken={}",mzDepositFileVo.getEcToken());
+                mzDepositFileVo.setMipOrdeFlag(YesNoEnum.YES.code);
+                map = mzChargeDetailService.refundFee(tokenUser.getUserIdCode(), mzDepositFileVo, ipAddress);
+            }
+            else if(StrUtil.isBlank(mzDepositFileVo.getReadCardResult())){
                 map = mzChargeDetailService.refundFee(tokenUser.getUserIdCode(), mzDepositFileVo, ipAddress);
             }
             else {
@@ -906,10 +936,10 @@ public class MzChargeDetailController {
                     }
                 }
             }
+            resultMap.put("mipOrdeFlag", mzDepositFileVo.getMipOrdeFlag());
             resultMap.put("refundMzDepositFiles", refundMzDepositFiles);
             resultMap.put("patientId", mzDepositFileVo.getPatientId());
             resultMap.put("message", "退费操作成功");
-
             List<MzDepositFile> needRefundList = (List<MzDepositFile>) map.get("needRefundList");
             if (YesNoEnum.YES.code.equals(mzDepositFileVo.getRefundType()) && needRefundList != null && needRefundList.size() > 0 && StringUtils.isNotBlank(windowsDb.getMisPosRouterCode())) {
                 for (MzDepositFile mzDepositFile : needRefundList) {
@@ -2967,11 +2997,9 @@ public class MzChargeDetailController {
     public R queryPrescriptionModifyPermission(@RequestBody Map<String,Object> query){
         String patientId = Convert.toStr(query.get("patientId"));
         Integer times = Convert.toInt(query.get("times"));
-        //修改处方时撤销医保费用
-        tsmzService.retractFees(TokenUtil.getUser().getUserCode(),patientId, times , 1);
-        boolean flag =tsmzService.queryModifyPermission(patientId,times,TokenUtil.getUser().getUserCode());
-        if(!flag){
-            return R.error("不可以修改处方");
+        MzOrderLock mzOrderLock = mzOrderLockMapper.selectById(Tools.getHisOrdNum(patientId,times,1));
+        if(mzOrderLock != null && Convert.toInt(mzOrderLock.getLockFlag(),0) == 1){
+            return R.error("处方在缴费中,不能修改处方");
         }
         return R.ok();
     }
@@ -2999,12 +3027,11 @@ public class MzChargeDetailController {
         String patientId = Convert.toStr(query.get("patientId"));
         Integer times = Convert.toInt(query.get("times"));
         String admdvs = Convert.toStr(query.get("admdvs"));
-        String socialNo = Convert.toStr(query.get("socialNo"));
         AssertUtil.isNotBlank(patientId,"门诊号不能为空");
         AssertUtil.isNotBlank(times,"就诊次数不能为空");
         AssertUtil.isNotBlank(admdvs,"参保地不能为空");
-        AssertUtil.isNotBlank(socialNo,"身份证号码不能为空");
-       Map<String,Object> res = tsmzService.queryNewInsuinfo(TokenUtil.getUser().getUserIdCode(), patientId, times,admdvs,socialNo);
+        MzPatientMi mzPatientMi = mzPatientMiService.queryByPatientId(patientId);
+        Map<String,Object> res = tsmzService.queryNewInsuinfo(TokenUtil.getUser().getUserIdCode(), patientId, times,admdvs,mzPatientMi.getSocialNo());
         return res;
     }
 

+ 1 - 0
src/main/java/cn/hnthyy/thmz/controller/mz/MzZdYpYshController.java

@@ -58,6 +58,7 @@ public class MzZdYpYshController {
     public Map<String, Object> getYpListByCommonParams(@RequestParam("commonParams") String commonParams, @RequestParam("groupNo") String groupNo) {
         Map<String, Object> resultMap = new HashMap<>();
         try {
+
             if (StringUtils.isBlank(groupNo)) {
                 resultMap.put("code", -1);
                 resultMap.put("message", "药房编码不能为空");

+ 6 - 0
src/main/java/cn/hnthyy/thmz/entity/his/mz/MzChargeDetail.java

@@ -233,6 +233,10 @@ public class MzChargeDetail implements Serializable,Comparable<MzChargeDetail> {
     private Integer isHide;
     //患者的处方是否有医保报销支付(门诊统筹) >0 有医保报销
     private Integer countYbZf;
+    //处方锁定标识 1 锁定 0未锁
+    private Integer orderLockFlag;
+    //医保移动支付标识 0 不是 1是
+    private Integer mipOrderFlag;
     //患者的处方是否可以进行医保补录 1 可以 非数据库字段
     private Integer mztcbl;
     //药房发药药品批次
@@ -243,6 +247,8 @@ public class MzChargeDetail implements Serializable,Comparable<MzChargeDetail> {
     private String visitTypeName;
     //处方类型
     private String orderTypeName;
+    //0-报销,2-自费
+    private String hospApprFlag;
     public MzChargeDetail(String patientId, Integer times) {
         this.patientId = patientId;
         this.times = times;

+ 23 - 0
src/main/java/cn/hnthyy/thmz/entity/his/mz/MzOrderLock.java

@@ -0,0 +1,23 @@
+package cn.hnthyy.thmz.entity.his.mz;
+
+import com.baomidou.mybatisplus.annotation.TableId;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @Description: 门诊处方锁表
+ * @Author:lihong
+ * @Date: 2024/10/24
+ */
+@Data
+public class MzOrderLock implements Serializable {
+    private static final long serialVersionUID = 1L;
+    /** 处方订单号  patientId_times_receiptNo 拼接而成 */
+    @TableId
+    private String hisOrderNum;
+    /** 0 未锁定 1锁定不能修改处方 */
+    private Integer lockFlag;
+    private Date updateTime;
+}

+ 1 - 1
src/main/java/cn/hnthyy/thmz/entity/his/zd/ZdUnitCode.java

@@ -76,7 +76,7 @@ public class ZdUnitCode {
     //科室描述
     private String deptDescribe;
     //夜诊地点
-    private String OfficePos1;
+    private String officePos1;
     public ZdUnitCode(String code, String name) {
         this.code = code;
         this.name = name;

+ 10 - 10
src/main/java/cn/hnthyy/thmz/mapper/his/mz/MzChargeDetailMapper.java

@@ -111,7 +111,7 @@ public interface MzChargeDetailMapper {
             "instruction_text,order_days,rtrim(pay_self) pay_self,rtrim(try_flag) try_flag,rtrim(req_yj) req_yj,req_no,rtrim(group_type) group_type,order_bill,charge_bill_code,",
             "rtrim(self_flag) self_flag,rtrim(responce_type) responce_type,dec_amount,back_serial,input_time,cy_mtjs,cy_jsl,cy_zql,cy_fj,cy_ffcs,cy_fysm,supply_amount,rtrim(cy_jssm) cy_jssm,",
             "dept_no,gl_percent_ft,rtrim(yb_zf_flag) yb_zf_flag,orig_price,rtrim(try_result) try_result,rtrim(supply_exec) supply_exec,rtrim(cy_dj) cy_dj,rtrim(receive_flag) receive_flag,",
-            "rtrim(chequ_type) chequ_type,rtrim(print_flag_yj) print_flag_yj,rtrim(confirm_flag_qx) confirm_flag_qx,group_id ",
+            "rtrim(chequ_type) chequ_type,rtrim(print_flag_yj) print_flag_yj,rtrim(confirm_flag_qx) confirm_flag_qx,group_id,hosp_appr_flag ",
             "from dbo.mz_charge_detail WITH(NOLOCK) where pay_mark=#{payMark,jdbcType=CHAR} and patient_id =#{patientId,jdbcType=CHAR}  and times = #{times,jdbcType=INTEGER} and receipt_no=#{receiptNo,jdbcType=INTEGER}",
             "<choose>",
             "<when test='billItemCode==3'>",
@@ -253,7 +253,7 @@ public interface MzChargeDetailMapper {
             "instruction_text,order_days,rtrim(pay_self) pay_self,rtrim(try_flag) try_flag,rtrim(req_yj) req_yj,req_no,rtrim(group_type) group_type,order_bill,charge_bill_code,",
             "rtrim(self_flag) self_flag,rtrim(responce_type) responce_type,dec_amount,back_serial,input_time,cy_mtjs,cy_jsl,cy_zql,cy_fj,cy_ffcs,cy_fysm,supply_amount,rtrim(cy_jssm) cy_jssm,",
             "dept_no,gl_percent_ft,rtrim(yb_zf_flag) yb_zf_flag,orig_price,rtrim(try_result) try_result,rtrim(supply_exec) supply_exec,rtrim(cy_dj) cy_dj,rtrim(receive_flag) receive_flag,",
-            "rtrim(chequ_type) chequ_type,rtrim(print_flag_yj) print_flag_yj,rtrim(confirm_flag_qx) confirm_flag_qx,group_id ",
+            "rtrim(chequ_type) chequ_type,rtrim(print_flag_yj) print_flag_yj,rtrim(confirm_flag_qx) confirm_flag_qx,group_id,hosp_appr_flag ",
             "from dbo.mz_charge_detail WITH(NOLOCK) where  patient_id =#{patientId,jdbcType=CHAR} and times =#{times} and pay_mark = 5 ",
             "</script>"})
     List<MzChargeDetail> selectNotPayMzChargeDetailByPatientId(@Param("patientId") String patientId, @Param("times") Integer times);
@@ -332,7 +332,7 @@ public interface MzChargeDetailMapper {
             "instruction_text,order_days,rtrim(pay_self) pay_self,rtrim(try_flag) try_flag,rtrim(req_yj) req_yj,req_no,rtrim(group_type) group_type,order_bill,charge_bill_code,",
             "rtrim(self_flag) self_flag,rtrim(responce_type) responce_type,dec_amount,back_serial,input_time,cy_mtjs,cy_jsl,cy_zql,cy_fj,cy_ffcs,cy_fysm,supply_amount,rtrim(cy_jssm) cy_jssm,",
             "dept_no,gl_percent_ft,rtrim(yb_zf_flag) yb_zf_flag,orig_price,rtrim(try_result) try_result,rtrim(supply_exec) supply_exec,rtrim(cy_dj) cy_dj,rtrim(receive_flag) receive_flag,",
-            "rtrim(chequ_type) chequ_type,rtrim(print_flag_yj) print_flag_yj,rtrim(confirm_flag_qx) confirm_flag_qx,group_id ",
+            "rtrim(chequ_type) chequ_type,rtrim(print_flag_yj) print_flag_yj,rtrim(confirm_flag_qx) confirm_flag_qx,group_id,hosp_appr_flag ",
             "from dbo.${tableName} WITH(NOLOCK) where  patient_id =#{patientId,jdbcType=CHAR} and times =#{times,jdbcType=INTEGER}" +
                     "<choose>" +
                     "<when test='payMark!=null and payMark ==0 '>",
@@ -371,7 +371,7 @@ public interface MzChargeDetailMapper {
             "audit_code,gongnks_flag,print_flag,confirm_flag,warn_dept,jz_flag,group_order,cash_id,doctor_code,supply_code,frequency,drug_quan,drug_unit,doctor_flag,inject_res,inject_times," +
             "confirm_zs,real_no,windows_no_yf,ybbx_flag,tc_no,tc_name,detail_flag,gl_percent,order_type,supply_no,instruction_code,instruction_text,order_days,pay_self,try_flag,req_yj," +
             "req_no,group_type,order_bill,charge_bill_code,self_flag,responce_type,dec_amount,back_serial,input_time,cy_mtjs,cy_jsl,cy_zql,cy_fj,cy_ffcs,cy_fysm,supply_amount,cy_jssm," +
-            "dept_no,gl_percent_ft,yb_zf_flag,orig_price,try_result,supply_exec,cy_dj,receive_flag,chequ_type,print_flag_yj,confirm_flag_qx,group_id) " +
+            "dept_no,gl_percent_ft,yb_zf_flag,orig_price,try_result,supply_exec,cy_dj,receive_flag,chequ_type,print_flag_yj,confirm_flag_qx,group_id,hosp_appr_flag) " +
             " VALUES (#{patientId,jdbcType=CHAR},#{times,jdbcType=INTEGER},#{receiptNo,jdbcType=SMALLINT},#{orderNo,jdbcType=TINYINT},#{itemNo,jdbcType=TINYINT}," +
             "#{chargeItemCode,jdbcType=CHAR},#{billItemCode,jdbcType=CHAR},#{quantity,jdbcType=DOUBLE},#{unitPriceStr,jdbcType=DECIMAL},#{payMark,jdbcType=CHAR}," +
             "#{serial,jdbcType=CHAR},#{chargeItemType,jdbcType=CHAR},#{countryFlag,jdbcType=CHAR},#{drugFlag,jdbcType=CHAR},#{serialNo,jdbcType=INTEGER},#{name,jdbcType=CHAR}," +
@@ -386,7 +386,7 @@ public interface MzChargeDetailMapper {
             "#{chargeBillCode,jdbcType=VARCHAR},#{selfFlag,jdbcType=CHAR},#{responceType,jdbcType=CHAR},#{decAmount,jdbcType=DECIMAL},#{backSerial,jdbcType=INTEGER},#{inputTime,jdbcType=TIMESTAMP}," +
             "#{cyMtjs,jdbcType=SMALLINT},#{cyJsl,jdbcType=SMALLINT},#{cyZql,jdbcType=SMALLINT},#{cyFj,jdbcType=SMALLINT},#{cyFfcs,jdbcType=SMALLINT},#{cyFysm,jdbcType=SMALLINT}," +
             "#{supplyAmount,jdbcType=SMALLINT},#{cyJssm,jdbcType=CHAR},#{deptNo,jdbcType=VARCHAR},#{glPercentFt,jdbcType=DECIMAL},#{ybZfFlag,jdbcType=CHAR},#{origPriceStr,jdbcType=DECIMAL}," +
-            "#{tryResult,jdbcType=CHAR},#{supplyExec,jdbcType=CHAR},#{cyDj,jdbcType=CHAR},#{receiveFlag,jdbcType=CHAR},#{chequType,jdbcType=CHAR},#{printFlagYj,jdbcType=CHAR},#{confirmFlagQx,jdbcType=CHAR},#{groupId,jdbcType=CHAR}) ")
+            "#{tryResult,jdbcType=CHAR},#{supplyExec,jdbcType=CHAR},#{cyDj,jdbcType=CHAR},#{receiveFlag,jdbcType=CHAR},#{chequType,jdbcType=CHAR},#{printFlagYj,jdbcType=CHAR},#{confirmFlagQx,jdbcType=CHAR},#{groupId,jdbcType=CHAR},#{hospApprFlag,jdbcType=VARCHAR}) ")
     int insertMzChargeDetail(MzChargeDetail mzChargeDetail);
 
 
@@ -403,7 +403,7 @@ public interface MzChargeDetailMapper {
             "audit_code,gongnks_flag,print_flag,confirm_flag,warn_dept,jz_flag,group_order,cash_id,doctor_code,supply_code,frequency,drug_quan,drug_unit,doctor_flag,inject_res,inject_times,",
             "confirm_zs,real_no,windows_no_yf,ybbx_flag,tc_no,tc_name,detail_flag,gl_percent,order_type,supply_no,instruction_code,instruction_text,order_days,pay_self,try_flag,req_yj,",
             "req_no,group_type,order_bill,charge_bill_code,self_flag,responce_type,dec_amount,back_serial,input_time,cy_mtjs,cy_jsl,cy_zql,cy_fj,cy_ffcs,cy_fysm,supply_amount,cy_jssm,",
-            "dept_no,gl_percent_ft,yb_zf_flag,orig_price,try_result,supply_exec,cy_dj,receive_flag,chequ_type,print_flag_yj,confirm_flag_qx,group_id) VALUES ",
+            "dept_no,gl_percent_ft,yb_zf_flag,orig_price,try_result,supply_exec,cy_dj,receive_flag,chequ_type,print_flag_yj,confirm_flag_qx,group_id,hosp_appr_flag) VALUES ",
             "<foreach collection='mzChargeDetails' item='item' index='index' separator=','>",
             " (#{item.patientId,jdbcType=CHAR},#{item.times,jdbcType=INTEGER},#{item.receiptNo,jdbcType=SMALLINT},#{item.orderNo,jdbcType=TINYINT},#{item.itemNo,jdbcType=TINYINT},",
             "#{item.chargeItemCode,jdbcType=CHAR},#{item.billItemCode,jdbcType=CHAR},#{item.quantity,jdbcType=DOUBLE},#{item.unitPriceStr,jdbcType=DECIMAL},#{item.payMark,jdbcType=CHAR},",
@@ -419,7 +419,7 @@ public interface MzChargeDetailMapper {
             "#{item.chargeBillCode,jdbcType=VARCHAR},#{item.selfFlag,jdbcType=CHAR},#{item.responceType,jdbcType=CHAR},#{item.decAmount,jdbcType=DECIMAL},#{item.backSerial,jdbcType=INTEGER},#{item.inputTime,jdbcType=TIMESTAMP},",
             "#{item.cyMtjs,jdbcType=SMALLINT},#{item.cyJsl,jdbcType=SMALLINT},#{item.cyZql,jdbcType=SMALLINT},#{item.cyFj,jdbcType=SMALLINT},#{item.cyFfcs,jdbcType=SMALLINT},#{item.cyFysm,jdbcType=SMALLINT},",
             "#{item.supplyAmount,jdbcType=SMALLINT},#{item.cyJssm,jdbcType=CHAR},#{item.deptNo,jdbcType=VARCHAR},#{item.glPercentFt,jdbcType=DECIMAL},#{item.ybZfFlag,jdbcType=CHAR},#{item.origPriceStr,jdbcType=DECIMAL},",
-            "#{item.tryResult,jdbcType=CHAR},#{item.supplyExec,jdbcType=CHAR},#{item.cyDj,jdbcType=CHAR},#{item.receiveFlag,jdbcType=CHAR},#{item.chequType,jdbcType=CHAR},#{item.printFlagYj,jdbcType=CHAR},#{item.confirmFlagQx,jdbcType=CHAR},#{item.groupId,jdbcType=CHAR}) ",
+            "#{item.tryResult,jdbcType=CHAR},#{item.supplyExec,jdbcType=CHAR},#{item.cyDj,jdbcType=CHAR},#{item.receiveFlag,jdbcType=CHAR},#{item.chequType,jdbcType=CHAR},#{item.printFlagYj,jdbcType=CHAR},#{item.confirmFlagQx,jdbcType=CHAR},#{item.groupId,jdbcType=CHAR},#{item.hospApprFlag,jdbcType=VARCHAR}) ",
             "</foreach>",
             "</script>"
     })
@@ -568,7 +568,7 @@ public interface MzChargeDetailMapper {
             "instruction_text,order_days,rtrim(pay_self) pay_self,rtrim(try_flag) try_flag,rtrim(req_yj) req_yj,req_no,rtrim(group_type) group_type,order_bill,charge_bill_code,",
             "rtrim(self_flag) self_flag,rtrim(responce_type) responce_type,dec_amount,back_serial,input_time,cy_mtjs,cy_jsl,cy_zql,cy_fj,cy_ffcs,cy_fysm,supply_amount,rtrim(cy_jssm) cy_jssm,",
             "dept_no,gl_percent_ft,rtrim(yb_zf_flag) yb_zf_flag,orig_price,rtrim(try_result) try_result,rtrim(supply_exec) supply_exec,rtrim(cy_dj) cy_dj,rtrim(receive_flag) receive_flag,",
-            "rtrim(chequ_type) chequ_type,rtrim(print_flag_yj) print_flag_yj,rtrim(confirm_flag_qx) confirm_flag_qx,group_id ",
+            "rtrim(chequ_type) chequ_type,rtrim(print_flag_yj) print_flag_yj,rtrim(confirm_flag_qx) confirm_flag_qx,group_id,hosp_appr_flag ",
             "from dbo.mz_charge_detail WITH(NOLOCK) where patient_id =#{patientId,jdbcType=CHAR} and pay_mark=0  and times =#{times} and  receipt_no =#{receiptNo} ",
             "</script>"})
     List<MzChargeDetail> selectJiZhangDetails(@Param(value = "patientId") String patientId, @Param("times") Integer times, @Param("receiptNo") Integer receiptNo);
@@ -840,7 +840,7 @@ public interface MzChargeDetailMapper {
             "instruction_text,order_days,rtrim(pay_self) pay_self,rtrim(try_flag) try_flag,rtrim(req_yj) req_yj,req_no,rtrim(group_type) group_type,order_bill,charge_bill_code,",
             "rtrim(self_flag) self_flag,rtrim(responce_type) responce_type,dec_amount,back_serial,input_time,cy_mtjs,cy_jsl,cy_zql,cy_fj,cy_ffcs,cy_fysm,supply_amount,rtrim(cy_jssm) cy_jssm,",
             "dept_no,gl_percent_ft,rtrim(yb_zf_flag) yb_zf_flag,orig_price,rtrim(try_result) try_result,rtrim(supply_exec) supply_exec,rtrim(cy_dj) cy_dj,rtrim(receive_flag) receive_flag,",
-            "rtrim(chequ_type) chequ_type,rtrim(print_flag_yj) print_flag_yj,rtrim(confirm_flag_qx) confirm_flag_qx,group_id ",
+            "rtrim(chequ_type) chequ_type,rtrim(print_flag_yj) print_flag_yj,rtrim(confirm_flag_qx) confirm_flag_qx,group_id,hosp_appr_flag ",
             "from dbo.mz_charge_detail WITH(NOLOCK)  where  patient_id =#{patientId,jdbcType=CHAR} and times =#{times} and receipt_no =#{receiptNo} ",
             "</script>"})
     List<MzChargeDetail> selectByPatientIdAndTimesAndReceiptNo(@Param("patientId") String patientId, @Param("times") Integer times, @Param("receiptNo") Integer receiptNo);
@@ -1160,7 +1160,7 @@ public interface MzChargeDetailMapper {
             "instruction_text,order_days,rtrim(pay_self) pay_self,rtrim(try_flag) try_flag,rtrim(req_yj) req_yj,req_no,rtrim(group_type) group_type,order_bill,charge_bill_code,"+
             "rtrim(self_flag) self_flag,rtrim(responce_type) responce_type,dec_amount,back_serial,input_time,cy_mtjs,cy_jsl,cy_zql,cy_fj,cy_ffcs,cy_fysm,supply_amount,rtrim(cy_jssm) cy_jssm,"+
             "dept_no,gl_percent_ft,rtrim(yb_zf_flag) yb_zf_flag,orig_price,rtrim(try_result) try_result,rtrim(supply_exec) supply_exec,rtrim(cy_dj) cy_dj,rtrim(receive_flag) receive_flag,"+
-            "rtrim(chequ_type) chequ_type,rtrim(print_flag_yj) print_flag_yj,rtrim(confirm_flag_qx) confirm_flag_qx,group_id "+
+            "rtrim(chequ_type) chequ_type,rtrim(print_flag_yj) print_flag_yj,rtrim(confirm_flag_qx) confirm_flag_qx,group_id,hosp_appr_flag "+
             " from  mz_charge_detail where patient_id=#{patientId} and pay_mark = 0 and confirm_flag<>4 and DateDiff(dd,charge_date,getDate()) =0 and group_no in('71','81','82') ")
     List<MzChargeDetail> selectCurrentYpList(@Param("patientId") String patientId);
 

+ 12 - 0
src/main/java/cn/hnthyy/thmz/mapper/his/mz/MzOrderLockMapper.java

@@ -0,0 +1,12 @@
+package cn.hnthyy.thmz.mapper.his.mz;
+
+import cn.hnthyy.thmz.entity.his.mz.MzOrderLock;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * @Description:
+ * @Author:lihong
+ * @Date: 2024/10/24
+ */
+public interface MzOrderLockMapper extends BaseMapper<MzOrderLock> {
+}

+ 5 - 2
src/main/java/cn/hnthyy/thmz/mapper/his/mz/MzPatientMiMapper.java

@@ -243,7 +243,9 @@ public interface MzPatientMiMapper {
      * @param times
      * @return  fund_pay_sumamt 基金支付总额  acct_pay 个人账户支出
      */
-    @Select("select fund_pay_sumamt,acct_pay from t_si_setlinfo where pat_no=#{patientId} and times=#{times} and revoked=0")
+    @Select("select fund_pay_sumamt,acct_pay from t_si_setlinfo where pat_no=#{patientId} and times=#{times} and revoked=0" +
+            " union " +
+            "  select fund_pay,psn_acct_pay from powersi_mip_setlinfo where med_org_ord ='${patientId}_${times}_1' and ord_state ='SETTLED' ")
     Map<String,BigDecimal>  selectYbAmount(@Param("patientId") String patientId,@Param("times") Integer times);
 
 
@@ -254,7 +256,8 @@ public interface MzPatientMiMapper {
      * @return
      */
     @Select("select ((select count(1) from t_si_setlinfo where pat_no=#{patientId} and times=#{times} and revoked=0) + " +
-            "(select count(1) from t_si_presetlinfo where pat_no=#{patientId} and times=#{times}) )")
+            "(select count(1) from t_si_presetlinfo where pat_no=#{patientId} and times=#{times}) +" +
+            " (select count(1) from powersi_mip_setlinfo where med_org_ord ='${patientId}_${times}_1') )")
     int countYbZf(@Param(value = "patientId") String patientId, @Param("times") Integer times);
     /**
      * @description:分页查询病人信息

+ 11 - 9
src/main/java/cn/hnthyy/thmz/mapper/his/zd/MzZdYpYshMapper.java

@@ -48,7 +48,7 @@ public interface MzZdYpYshMapper {
             " top ${pageSize} ",
             "</when>",
             " code=rtrim(a.charge_code),serial=rtrim(a.serial),name=rtrim(b.name),specification=b.specification,charge_amount=a.pack_retprice,manufactory=c.name,mini_unit=b.mini_unit,group_no=a.group_no,stock_amount_virtual=a.stock_amount_virtual,drug_win=1,national_code=b.national_code,yp_type=91  ",
-            "    FROM yp_base_yf a WITH(NOLOCK)  LEFT JOIN yp_zd_dict b WITH(NOLOCK)  on a.charge_code = b.code and a.serial = b.serial  LEFT JOIN yp_zd_manufactory c on a.charge_code = c.code ",
+            "    FROM yp_base_yf a WITH(NOLOCK)  LEFT JOIN yp_zd_dict b WITH(NOLOCK)  on a.charge_code = b.code and a.serial = b.serial  LEFT JOIN yp_zd_manufactory c on b.manu_code = c.code ",
             "where a.visible_flag_mz=0 and a.stock_amount_virtual <![CDATA[>]]> 0 and a.group_no ='91' ",
             "<when test='commonParams!=null'>",
             " and (b.py_code like #{commonParams} collate Chinese_PRC_CI_AS or b.d_code  like #{commonParams} collate Chinese_PRC_CI_AS or b.code like #{commonParams} collate Chinese_PRC_CI_AS or b.name like #{commonParams} collate Chinese_PRC_CI_AS or b.class_code like #{commonParams} collate Chinese_PRC_CI_AS ) ",
@@ -70,11 +70,12 @@ public interface MzZdYpYshMapper {
             "<when test='pageSize!=null'>",
             " top ${pageSize} ",
             "</when>",
-            "  code=rtrim(code),serial,name,specification,charge_amount,manufactory=yb_comment,mini_unit,group_no,stock_amount_virtual,drug_win,national_code,yp_type=111  ",
-            "    FROM view_mz_zd_yp_dm WITH(NOLOCK)  ",
-            "where stock_amount_virtual <![CDATA[>]]> 0 and group_no='71' ",
+            "  code=rtrim(a.code),a.serial,a.name,a.specification,a.charge_amount,manufactory=c.name,a.mini_unit,a.group_no,a.stock_amount_virtual,a.drug_win,a.national_code,yp_type=111  ",
+            "    FROM view_mz_zd_yp_dm a WITH(NOLOCK) left join yp_zd_dict  b WITH(NOLOCK) on a.code = b.code and a.serial =b.serial " +
+                    "           left join yp_zd_manufactory  c WITH(NOLOCK) on b.manu_code = c.code  ",
+            "where a.stock_amount_virtual <![CDATA[>]]> 0 and a.group_no='71' ",
             "<when test='commonParams!=null'>",
-            " and (py_code like #{commonParams} collate Chinese_PRC_CI_AS or d_code  like #{commonParams} collate Chinese_PRC_CI_AS or code like #{commonParams} collate Chinese_PRC_CI_AS or name like #{commonParams} collate Chinese_PRC_CI_AS or class_code like #{commonParams} collate Chinese_PRC_CI_AS ) ",
+            " and (a.py_code like #{commonParams} collate Chinese_PRC_CI_AS or a.d_code  like #{commonParams} collate Chinese_PRC_CI_AS or a.code like #{commonParams} collate Chinese_PRC_CI_AS or a.name like #{commonParams} collate Chinese_PRC_CI_AS or a.class_code like #{commonParams} collate Chinese_PRC_CI_AS ) ",
             "</when>",
             " order by stock_amount_virtual desc",
             "</script>"})
@@ -94,11 +95,12 @@ public interface MzZdYpYshMapper {
             "<when test='pageSize!=null'>",
             " top ${pageSize} ",
             "</when>",
-            "  code=rtrim(code),serial,name,specification,charge_amount,manufactory=yb_comment,mini_unit,group_no,stock_amount_virtual,drug_win,national_code,yp_type=131   ",
-            "    FROM view_mz_zd_yp_dm_j2 WITH(NOLOCK)   ",
-            "where  stock_amount_virtual <![CDATA[>]]> 0 and group_no='71' ",
+            "  code=rtrim(a.code),a.serial,a.name,a.specification,a.charge_amount,manufactory=c.name,a.mini_unit,a.group_no,a.stock_amount_virtual,a.drug_win,a.national_code,yp_type=131   ",
+            "    FROM view_mz_zd_yp_dm_j2  a WITH(NOLOCK) left join yp_zd_dict  b WITH(NOLOCK) on a.code = b.code and a.serial =b.serial " +
+                    "          left  join yp_zd_manufactory  c WITH(NOLOCK) on b.manu_code = c.code    ",
+            "where  a.stock_amount_virtual <![CDATA[>]]> 0 and a.group_no='71' ",
             "<when test='commonParams!=null'>",
-            " and (py_code like #{commonParams} collate Chinese_PRC_CI_AS or d_code  like #{commonParams} collate Chinese_PRC_CI_AS or code like #{commonParams} collate Chinese_PRC_CI_AS or name like #{commonParams} collate Chinese_PRC_CI_AS or class_code like #{commonParams} collate Chinese_PRC_CI_AS) ",
+            " and (a.py_code like #{commonParams} collate Chinese_PRC_CI_AS or a.d_code  like #{commonParams} collate Chinese_PRC_CI_AS or a.code like #{commonParams} collate Chinese_PRC_CI_AS or a.name like #{commonParams} collate Chinese_PRC_CI_AS or a.class_code like #{commonParams} collate Chinese_PRC_CI_AS) ",
             "</when>",
             " order by stock_amount_virtual desc",
             "</script>"})

+ 6 - 3
src/main/java/cn/hnthyy/thmz/mapper/his/zd/ZdUnitCodeMapper.java

@@ -18,7 +18,7 @@ public interface ZdUnitCodeMapper {
      * @return
      */
     @Select({"<script>",
-            "SELECT top ${pageSize} code,name,class_code,py_code,d_code wbCode,mz_flag,del_flag,n_code ynCode,yj_flag,mzrc_flag,parent_code,gh_charge_flag,office_pos,",
+            "SELECT top ${pageSize} code,name,class_code,py_code,d_code wbCode,mz_flag,del_flag,n_code ynCode,yj_flag,mzrc_flag,parent_code,gh_charge_flag,office_pos,office_pos1,",
             "supply_flag,xnh_dept_code,xnh_dept_name,ghjz_flag,mz_class,sort_code,op_id,op_date,inpatient_flag,unit_num,ks_zkl,dept_describe FROM (SELECT ROW_NUMBER() OVER (ORDER BY zd_unit_code_page.${orderByCase} asc) ",
             "AS RowNumber,* from dbo.zd_unit_code zd_unit_code_page WITH(NOLOCK)   where 1=1 ",
             "<when test='zdUnitCode.delFlag!=null'>",
@@ -150,10 +150,10 @@ public interface ZdUnitCodeMapper {
      * @return
      */
     @Insert("INSERT INTO dbo.zd_unit_code(code,name,class_code,py_code,d_code,mz_flag,del_flag,n_code,yj_flag,mzrc_flag,parent_code," +
-            "gh_charge_flag,office_pos,supply_flag,xnh_dept_code,xnh_dept_name,ghjz_flag,mz_class,sort_code,op_id,op_date,inpatient_flag,unit_num,ks_zkl,dept_describe )VALUES(#{code,jdbcType=VARCHAR},#{name,jdbcType=VARCHAR}" +
+            "gh_charge_flag,office_pos,supply_flag,xnh_dept_code,xnh_dept_name,ghjz_flag,mz_class,sort_code,op_id,op_date,inpatient_flag,unit_num,ks_zkl,dept_describe,office_pos1 )VALUES(#{code,jdbcType=VARCHAR},#{name,jdbcType=VARCHAR}" +
             ",#{classCode,jdbcType=VARCHAR},#{pyCode,jdbcType=VARCHAR},#{wbCode,jdbcType=VARCHAR},#{mzFlag,jdbcType=CHAR},#{delFlag,jdbcType=CHAR},#{ynCode,jdbcType=VARCHAR},#{yjFlag,jdbcType=CHAR}" +
             ",#{mzrcFlag,jdbcType=CHAR},#{parentCode,jdbcType=CHAR},#{ghChargeFlag,jdbcType=CHAR},#{officePos,jdbcType=VARCHAR},#{supplyFlag,jdbcType=CHAR},#{xnhDeptCode,jdbcType=VARCHAR}" +
-            ",#{xnhDeptName,jdbcType=VARCHAR},#{ghjzFlag,jdbcType=CHAR},#{mzClass,jdbcType=VARCHAR},#{sortCode,jdbcType=VARCHAR},#{opId,jdbcType=VARCHAR},#{opDate,jdbcType=TIMESTAMP},#{inpatientFlag},#{unitNum},#{ksZkl},#{deptDescribe}) ")
+            ",#{xnhDeptName,jdbcType=VARCHAR},#{ghjzFlag,jdbcType=CHAR},#{mzClass,jdbcType=VARCHAR},#{sortCode,jdbcType=VARCHAR},#{opId,jdbcType=VARCHAR},#{opDate,jdbcType=TIMESTAMP},#{inpatientFlag},#{unitNum},#{ksZkl},#{deptDescribe},#{officePos1}) ")
     int insertZdUnitCode(ZdUnitCode zdUnitCode);
 
     /**
@@ -204,6 +204,9 @@ public interface ZdUnitCodeMapper {
             "<when test='officePos!=null'>",
             ",office_pos =#{officePos,jdbcType=VARCHAR}",
             "</when>",
+            "<when test='officePos1!=null'>",
+            ",office_pos1 =#{officePos1,jdbcType=VARCHAR}",
+            "</when>",
             "<when test='supplyFlag!=null'>",
             ",supply_flag =#{supplyFlag,jdbcType=CHAR}",
             "</when>",

+ 66 - 43
src/main/java/cn/hnthyy/thmz/service/impl/his/mz/MzChargeDetailServiceImpl.java

@@ -6,6 +6,7 @@ import cn.hnthyy.thmz.Utils.DateUtil;
 import cn.hnthyy.thmz.Utils.HttpUtil;
 import cn.hnthyy.thmz.Utils.JsonUtil;
 import cn.hnthyy.thmz.Utils.MapUtil;
+import cn.hnthyy.thmz.Utils.R;
 import cn.hnthyy.thmz.Utils.TokenUtil;
 import cn.hnthyy.thmz.Utils.Tools;
 import cn.hnthyy.thmz.common.Constants;
@@ -48,6 +49,7 @@ import cn.hnthyy.thmz.vo.ThmzmxsrParamsVo;
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.convert.Convert;
+import cn.hutool.core.thread.ThreadUtil;
 import cn.hutool.core.util.NumberUtil;
 import cn.hutool.core.util.StrUtil;
 import lombok.extern.slf4j.Slf4j;
@@ -216,6 +218,9 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
     private MzOrderDetailService mzOrderDetailService;
     @Resource
     private JcZdClassMapper jcZdClassMapper;
+    @Resource
+    private MzOrderLockMapper mzOrderLockMapper;
+
     //是否加收开关
     @Value("${setUnitPrice}")
     private boolean setUnitPrice;
@@ -419,12 +424,8 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
         returnMzChargeDetail.setDiscountAmount(returnMzChargeDetail.getNotDiscountAmount().subtract(returnMzChargeDetail.getAmount()).setScale(1, BigDecimal.ROUND_HALF_UP));
         Clinic clinic = clinicMapper.selectByPatientIdAndTimesAndReceiptNo(mzChargeDetail.getPatientId(), mzChargeDetail.getTimes(), 0);
         returnMzChargeDetail.setCountYbZf((clinic == null || clinic.getZgmztczf() == null) ? 0 : clinic.getZgmztczf());
-//        Map<String, Object> insuinfoMap = tsmzService.queryInsuinfo(Constants.BRZZJF_CODE, mzChargeDetail.getPatientId());
-//        if (insuinfoMap != null && insuinfoMap.size() > 0) {
-//            if (Integer.valueOf(0).equals(insuinfoMap.get("code"))) {
-//                returnMzChargeDetail.setCountYbZf(1);
-//            }
-//        }
+        MzOrderLock mzOrderLock = mzOrderLockMapper.selectById(Tools.getHisOrdNum(mzChargeDetail.getPatientId(),mzChargeDetail.getTimes(),1));
+        returnMzChargeDetail.setOrderLockFlag(mzOrderLock != null && Convert.toInt(mzOrderLock.getLockFlag(),0) == 1 ? 1 : 0);
         return returnMzChargeDetail;
     }
 
@@ -1267,6 +1268,10 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
         Integer JzFlag = getJzFlag(mzPrescriptionVo, mzPatientMi);
         setPrescriptionDetail(mzPrescriptionVo, YesNoEnum.YES, mzPatientMi.getBirthDay());
         if (dbClinic != null && dbClinic.getId() != null && StringUtils.isNotBlank(dbClinic.getPatientId()) && dbClinic.getTimes() != null && ClinicStatusEnum.HAD_CLINIC.code.equals(dbClinic.getClinicStatus())) {
+            MzOrderLock mzOrderLock = mzOrderLockMapper.selectById(Tools.getHisOrdNum(dbClinic.getPatientId(),dbClinic.getTimes(),1));
+            if(Convert.toInt(mzOrderLock.getLockFlag(),0) == 1){
+                throw new MzException("当前病人正在缴费中,不能修改处方!");
+            }
             List<MzChargeDetail> dbMzChargeDetailList = mzChargeDetailMapper.selectNotPayMzChargeDetailByPatientId(mzPrescriptionVo.getPatientId(), dbClinic.getTimes());
             if (dbMzChargeDetailList != null && dbMzChargeDetailList.size() > 0) {
                 for (MzChargeDetail mzChargeDetail : dbMzChargeDetailList) {
@@ -1296,7 +1301,7 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
                     opRecordMapper.deleteOpRecordByOpCordId(opRecord.getRecordId());
                 }
             }
-            tsmzService.retractFees(mzPrescriptionVo.getDoctorCode(), dbClinic.getPatientId(), dbClinic.getTimes(), dbClinic.getReceiptNo());
+            //tsmzService.retractFees(mzPrescriptionVo.getDoctorCode(), dbClinic.getPatientId(), dbClinic.getTimes(), dbClinic.getReceiptNo());
         }
         int times = 0;
         MzVisitTable lastMzVisitTable = mzVisitTableService.queryLastMzVisitTableByPatientId(mzPrescriptionVo.getPatientId());
@@ -1427,6 +1432,12 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
                 .reqType(Tools.beforeAddZeroStr(mzPrescriptionVo.getReqType()))
                 .build();
         mzOrderDetailService.save(mzOrderDetail);
+        //保存处方锁信息
+        MzOrderLock mzOrderLock = new MzOrderLock();
+        mzOrderLock.setHisOrderNum(mzPatientMi.getPatientId()+"_"+times+"_1");
+        mzOrderLock.setLockFlag(0);
+        mzOrderLock.setUpdateTime(new Date());
+        mzOrderLockMapper.insert(mzOrderLock);
         clinic.setOpId(opId);
         clinic.setOpDay(new Date());
         clinic.setIcdCode(realIcdText != null ? mzPrescriptionVo.getIcdCode() : null);
@@ -1441,15 +1452,15 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
             haiCiAdapterService.closeUnpaidWxOrder(mzPatientMi.getPatientId()+"_"+dbClinic.getTimes()+"_1");
         }
         haiCiAdapterService.closeUnpaidWxOrder(mzPatientMi.getPatientId()+"_"+times+"_1");
-        if (mzPrescriptionVo.getZgmztczf() != null && YesNoEnum.YES.code.equals(mzPrescriptionVo.getZgmztczf())) {
-            String medType = "11";
-            if(mzPrescriptionVo.getOrderType() != null && mzPrescriptionVo.getOrderType() == 3){
-                medType = "14";
-            }
-            if(StrUtil.isNotBlank(mzPrescriptionVo.getReadCardResult())){
-                tsmzService.directRegistrationAsync(opId, mzPatientMi.getPatientId(), times, mzPrescriptionVo.getReadCardResult(), mzPrescriptionVo.getGrzhzf(), mzPrescriptionVo.getReadCardType(), mzPrescriptionVo.getExpContent(),medType,mzPrescriptionVo.getOpspDisecode(),mzPrescriptionVo.getOpspDiseName());
-            }
-        }
+        //if (mzPrescriptionVo.getZgmztczf() != null && YesNoEnum.YES.code.equals(mzPrescriptionVo.getZgmztczf())) {
+        //    String medType = "11";
+        //    if(mzPrescriptionVo.getOrderType() != null && mzPrescriptionVo.getOrderType() == 3){
+        //        medType = "14";
+        //    }
+        //    if(StrUtil.isNotBlank(mzPrescriptionVo.getReadCardResult())){
+        //        tsmzService.directRegistrationAsync(opId, mzPatientMi.getPatientId(), times, mzPrescriptionVo.getReadCardResult(), mzPrescriptionVo.getGrzhzf(), mzPrescriptionVo.getReadCardType(), mzPrescriptionVo.getExpContent(),medType,mzPrescriptionVo.getOpspDisecode(),mzPrescriptionVo.getOpspDiseName());
+        //    }
+        //}
         //发送处方待缴费MQ
         if(preChargeNotice){
             orderStatusChangeService.orderStatusChange(mzPatientMi.getPatientId() + "_" + times + "_" + newMzVisitTable.getReceiptNo() + "," + OrderStatusEnum.PRESCRIPTION_TO_BE_PAID.code);
@@ -1474,19 +1485,9 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
         if (!clinic.getOpId().equals(tokenUser.getUserIdCode())) {
             throw new MzException("删除处方失败,禁止删除非本人开立处方!");
         }
-        try {
-           tsmzService.queryModifyPermission(clinic.getPatientId(), clinic.getTimes(), clinic.getOpId());
-        }catch (Exception e){
-            log.error(StrUtil.format("删除处方权限,门诊号={},就诊次数={}",clinic.getPatientId(),clinic.getTimes()),e);
-            throw new MzException("没有删除该处方权限,不可以删除处方!");
-        }
-        //撤销医保结算
-        PayInfo retractInfo = tsmzService.retractFees(clinic.getOpId(), clinic.getPatientId(), clinic.getTimes(), 1);
-        if (retractInfo == null) {
-            log.info("删除处方失败,医保撤销失败门诊号:{}就诊次数:{}", clinic.getPatientId(), clinic.getTimes());
-        }
-        if (retractInfo != null && retractInfo.getCode() != 0) {
-            log.info("删除处方失败,医保撤销失败门诊号:{}就诊次数:{}[错误信息:{}]", clinic.getPatientId(), clinic.getTimes(), retractInfo.getErrorMessage());
+        MzOrderLock mzOrderLock = mzOrderLockMapper.selectById(Tools.getHisOrdNum(clinic.getPatientId(), clinic.getTimes(), 1));
+        if(mzOrderLock != null && Convert.toInt(mzOrderLock.getLockFlag(),0) == 1){
+            throw new MzException("处方在缴费中,不能删除处方");
         }
         int num = clinicMapper.deleteById(clnicId);
         mzVisitTableMapper.deleteByPatientIdAndTimes(clinic.getPatientId(), clinic.getTimes());
@@ -2551,6 +2552,7 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
                 mzChargeDetail.setConfirmFlag(0);
                 mzChargeDetail.setItemNo(itemNo);
                 mzChargeDetail.setPayMark(PayMarkEnum.NO_CHARGE.code);
+                mzChargeDetail.setHospApprFlag(Convert.toStr(mzChargeDetail.getHospApprFlag(),"0"));
                 if (Arrays.asList(OrderFrequencyEnum.ALWAYS.code, OrderFrequencyEnum.IRREG.code, OrderFrequencyEnum.ONCE.code).contains(mzChargeDetail.getFrequency())) {
                     mzChargeDetail.setSupplyAmount(1);
                 } else {
@@ -4194,6 +4196,10 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
         List<MzChargeDetail> mzChargeDetails = getNewListForRefundFee(opId, mzDepositFileVo, YesNoEnum.YES);
         //是否全退
         boolean allRefund = mzChargeDetails == null || mzChargeDetails.size() == 0;
+        Integer mipOrdeFlag = mzDepositFileVo.getMipOrdeFlag();
+        if(YesNoEnum.YES.code.equals(mipOrdeFlag) && !allRefund){
+            throw new MzException("此费用为医保移动支付,必须全退!");
+        }
         MzBlRecord mzBlRecord = null;
         MzOrderDetail mzOrderDetail = null;
         if (!allRefund) {
@@ -4261,13 +4267,31 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
                 mzDepositFileMapper.batchInsertMzDepositFile(fullNewMzDepositFiles);
             }
             times = 0;
-            if (ybFlag) {
-                PayInfo result = tsmzService.retractFees(opId, mzDepositFileVo.getPatientId(), mzDepositFileVo.getTimes(), mzDepositFileVo.getReceiptNo());
-                if (result == null) {
-                    throw new MzException("退费失败,特门退费失败!");
+            if(YesNoEnum.YES.code.equals(mipOrdeFlag)){
+                haiCiAdapterService.revokeMipSettle(opId, Tools.getHisOrdNum(mzDepositFileVo.getPatientId(), mzDepositFileVo.getTimes(), mzDepositFileVo.getReceiptNo()), mzDepositFileVo.getEcToken(), "客户退款");
+                for (int i = 1; i <= 5; i++) {
+                    String refundState = haiCiAdapterService.queryRefundState(Tools.getHisOrdNum(mzDepositFileVo.getPatientId(), mzDepositFileVo.getTimes(), mzDepositFileVo.getReceiptNo()));
+                    if(Constants.REFUND_SUCCEED.equals(refundState)){
+                        break;
+                    }
+                    if(i != 5){
+                        ThreadUtil.sleep(1000*(i+1));
+                    }
+                    else {
+                        if(!Constants.REFUND_SUCCEED.equals(refundState)){
+                            throw new MzException("退费失败,医保移动支付退费失败!");
+                        }
+                    }
                 }
-                if (result.getCode() != 0) {
-                    throw new MzException(result.getErrorMessage());
+            }else {
+                if (ybFlag) {
+                    PayInfo result = tsmzService.retractFees(opId, mzDepositFileVo.getPatientId(), mzDepositFileVo.getTimes(), mzDepositFileVo.getReceiptNo());
+                    if (result == null) {
+                        throw new MzException("退费失败,特门退费失败!");
+                    }
+                    if (result.getCode() != 0) {
+                        throw new MzException(result.getErrorMessage());
+                    }
                 }
             }
             mzYpFydlMapper.deleteMzYpFydl(mzDepositFileVo.getPatientId(), mzDepositFileVo.getTimes(), mzDepositFileVo.getReceiptNo());
@@ -4597,12 +4621,6 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
 //            }
             temp.setDcountNo(YesNoEnum.NO.code);
             temp.setDcountDate(null);
-            temp.setPsordnum(null);
-            temp.setAgtordnum(null);
-            //不是套餐退费
-            if(!(Constants.ZZWX.equals(temp.getChequeType()) && StrUtil.isNotBlank(temp.getHisrefundnum()))){
-                temp.setHisrefundnum(null);
-            }
             temp.setParChannel(null);
             temp.setTransDate(null);
             //  fullNewMzDepositFiles.add(temp);
@@ -4673,8 +4691,13 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
         //如果有非本院记账的退款金额,非本院记账记录保持入库
         if (notByjzAmount.compareTo(BigDecimal.ZERO) == 1) {
             //套餐退费保持原退费方式 不是就改为现金
-            if(!(Constants.ZZWX.equals(temp.getChequeType()) && StrUtil.isNotBlank(temp.getHisrefundnum()))){
+            if(Constants.ZZWX.equals(temp.getChequeType()) && (StrUtil.isNotBlank(temp.getHisrefundnum()) || StrUtil.startWith(temp.getAgtordnum(),"MPCORD"))){
+                temp.setChequeType(Constants.ZZWX);
+            }else {
                 temp.setChequeType(Constants.CASH);
+                temp.setPsordnum(null);
+                temp.setAgtordnum(null);
+                temp.setHisrefundnum(null);
             }
             temp.setAmount(BigDecimal.ZERO.subtract(notByjzAmount));
             fullNewMzDepositFiles.add(temp);
@@ -7093,7 +7116,7 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
             log.info("退费失败,门诊统筹重新结算门诊号:{}就诊次数:{}", mzDepositFile.getPatientId(),mzDepositFile.getTimes());
             throw new BizException("退费失败,门诊统筹费用重新结算失败,错误原因:可能是医保网络问题;因本次需要退费的已经结算已经撤销成功,请找医保科重新手动结算,稍后再试!");
         }
-        if (payInfo.getCode() == -1) {
+        if (payInfo.getCode() != 0) {
             log.info("退费失败,门诊统筹重新结算门诊号:{}就诊次数:{}[错误信息:{}]", mzDepositFile.getPatientId(),mzDepositFile.getTimes(),payInfo.getErrorMessage());
             throw new BizException("特门费用重新结算失败,错误原因:" + payInfo.getErrorMessage()+";因本次需要退费的已经结算已经撤销成功,请找医保科重新手动结算,稍后再试!");
         }

+ 3 - 0
src/main/java/cn/hnthyy/thmz/service/impl/his/mz/MzOrderDetailServiceImpl.java

@@ -26,6 +26,9 @@ public class MzOrderDetailServiceImpl implements MzOrderDetailService {
     @Override
     @Transactional(rollbackFor = Exception.class)
     public int save(MzOrderDetail mzOrderDetail) {
+        if(mzOrderDetail.getOrderType() == null){
+            mzOrderDetail.setOrderType(1);
+        }
         List<MzOrderDetail> mzOrderDetails = queryByEntity(MzOrderDetail.builder()
                 .patientId(mzOrderDetail.getPatientId())
                 .times(mzOrderDetail.getTimes())

+ 175 - 175
src/main/java/cn/hnthyy/thmz/service/impl/thmz/HaiCiAdapterServiceImpl.java

@@ -1,175 +1,175 @@
-package cn.hnthyy.thmz.service.impl.thmz;
-
-import cn.hnthyy.thmz.Utils.DateUtil;
-import cn.hnthyy.thmz.Utils.HttpUtil;
-import cn.hnthyy.thmz.Utils.SignUtil;
-import cn.hnthyy.thmz.service.thmz.HaiCiAdapterService;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Value;
-
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Map;
-
-@Slf4j
-//@Service
-public class HaiCiAdapterServiceImpl implements HaiCiAdapterService {
-    private static final String th_pwd = "hnthyy2213";
-
-    @Value("${haiciServiceUrl}")
-    private String haiciServiceUrl;
-    //卡号变更通知开关
-    @Value("${sendNoticeToHaiCi}")
-    private boolean sendNoticeToHaiCi;
-
-    /**
-     * 更新病人卡号 消息通知
-     *
-     * @param oldCardNo 老卡号
-     * @param cardNo    新卡号
-     * @param timeStamp 变更时间
-     */
-    @Override
-    public void cardChangeNotice(String oldCardNo, String cardNo, Date timeStamp) {
-        if (!sendNoticeToHaiCi) {
-            return;
-        }
-        try {
-            String timeStampStr = DateUtil.fomart(timeStamp, "yyyy-MM-dd HH:mm:ss");
-            Map<String, String> map = getMap(oldCardNo, cardNo, timeStampStr);
-            HttpUtil.httpPost(haiciServiceUrl, getXMLString(oldCardNo, cardNo, timeStampStr), "application/xml",3000);
-            log.info(map.toString());
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-    }
-
-    @Override
-    public void commonMessageNotice(String cardNo, String message, Date timeStamp) {
-        try {
-            String timeStampStr = DateUtil.fomart(timeStamp, "yyyy-MM-dd HH:mm:ss");
-            Map<String, String> map = getCommonMessageMap(cardNo, message, timeStampStr);
-            HttpUtil.httpPost(haiciServiceUrl, getCommonMessageXMLString(cardNo, message, timeStampStr), "application/xml",3000);
-            log.info(map.toString());
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-    }
-
-    @Override
-    public void rejectCallbackScheduleOfMedical(String reqNo) {
-
-    }
-
-    @Override
-    public void refreshMzClasses() {
-
-    }
-
-    @Override
-    public void notify(String serialNo, Integer action) {
-
-    }
-
-    @Override
-    public String genMzPayQrcode(Integer totalAmt, String patientId, String hisOrdNum) {
-        return null;
-    }
-
-    @Override
-    public void closeUnpaidWxOrder(String hisOrdNum) {
-
-    }
-
-    @Override
-    public void timeLimitChanged() {
-
-    }
-
-    @Override
-    public void preAllocationBed(String patientId, String visitDate) {
-
-    }
-
-    /**
-     * 生成map以进行Sign加密  变更卡号参数
-     */
-    private Map<String, String> getMap(String oldCardNo, String cardNo, String timeStamp) {
-        Map<String, String> map = new HashMap<>();
-        map.put("serviceCode", "CardChangeNotice");
-        map.put("partnerId", "hnthyy");
-        map.put("timeStamp", timeStamp);
-        map.put("actionType", "1");
-        map.put("cardType", "1");
-        map.put("oldCardNo", oldCardNo);
-        map.put("cardNo", cardNo);
-        return map;
-    }
-
-    /**
-     * 生成向海鹚发送请求的参数 变更卡号参数
-     */
-    private String getXMLString(String oldCardNo, String cardNo, String timeStamp) throws Exception {
-        Map<String, String> map = getMap(oldCardNo, cardNo, timeStamp);
-        return "<?xml version='1.0' encoding='UTF-8'?>\n"
-                + "<Request>\n"
-                + "<serviceCode>CardChangeNotice</serviceCode>\n"
-                + "<partnerId>hnthyy</partnerId>\n"
-                + "<timeStamp>" + timeStamp + "</timeStamp>\n"
-                + "<password>" + SignUtil.getSignValue(map, th_pwd) + "</password>\n"
-                + "<actionType>1</actionType>\n"
-                + "<cardType>1</cardType>\n"
-                + "<cardNo>" + cardNo + "</cardNo>\n"
-                + "<oldCardNo>" + oldCardNo + "</oldCardNo>\n"
-                + "</Request>";
-    }
-
-
-    /**
-     * 生成map以进行Sign加密  发送通用消息参数
-     */
-    private Map<String, String> getCommonMessageMap(String cardNo, String message, String timeStamp) {
-        Map<String, String> map = new HashMap<>();
-        map.put("serviceCode", "SendMessageNotice");
-        map.put("partnerId", "hnthyy");
-        map.put("timeStamp", timeStamp);
-        map.put("cardNo", cardNo);
-        map.put("admissionNum", "");
-        map.put("inNo", "");
-        map.put("msgType", "0");
-        map.put("msgContext", message);
-        map.put("channel", "WX");
-        return map;
-    }
-
-    /**
-     * 生成向海鹚发送请求的参数 发送通用消息参数
-     */
-    private String getCommonMessageXMLString(String cardNo, String message, String timeStamp) throws Exception {
-        Map<String, String> map = getCommonMessageMap(cardNo, message, timeStamp);
-        return "<?xml version='1.0' encoding='UTF-8'?>\n"
-                + "<Request>\n"
-                + "<serviceCode>SendMessageNotice</serviceCode>\n"
-                + "<partnerId>hnthyy</partnerId>\n"
-                + "<timeStamp>" + timeStamp + "</timeStamp>\n"
-                + "<password>" + SignUtil.getSignValue(map, th_pwd) + "</password>\n"
-                + "<cardNo>" + cardNo + "</cardNo>\n"
-                + "<admissionNum></admissionNum>\n"
-                + "<inNo></inNo>\n"
-                + "<msgType>0</msgType>\n"
-                + "<msgContext>" + message + "</msgContext>\n"
-                + "<channel>WX</channel>\n"
-                + "</Request>";
-    }
-
-    /**
-     * @description: 处理危机消息回执
-     * @author: lihong
-     * @date: 2024/4/11 9:30
-     * @param: param
-     */
-    @Override
-    public void criticalMessageReceipt(Map<String, Object> param) {
-
-    }
-}
+//package cn.hnthyy.thmz.service.impl.thmz;
+//
+//import cn.hnthyy.thmz.Utils.DateUtil;
+//import cn.hnthyy.thmz.Utils.HttpUtil;
+//import cn.hnthyy.thmz.Utils.SignUtil;
+//import cn.hnthyy.thmz.service.thmz.HaiCiAdapterService;
+//import lombok.extern.slf4j.Slf4j;
+//import org.springframework.beans.factory.annotation.Value;
+//
+//import java.util.Date;
+//import java.util.HashMap;
+//import java.util.Map;
+//
+//@Slf4j
+////@Service
+//public class HaiCiAdapterServiceImpl implements HaiCiAdapterService {
+//    private static final String th_pwd = "hnthyy2213";
+//
+//    @Value("${haiciServiceUrl}")
+//    private String haiciServiceUrl;
+//    //卡号变更通知开关
+//    @Value("${sendNoticeToHaiCi}")
+//    private boolean sendNoticeToHaiCi;
+//
+//    /**
+//     * 更新病人卡号 消息通知
+//     *
+//     * @param oldCardNo 老卡号
+//     * @param cardNo    新卡号
+//     * @param timeStamp 变更时间
+//     */
+//    @Override
+//    public void cardChangeNotice(String oldCardNo, String cardNo, Date timeStamp) {
+//        if (!sendNoticeToHaiCi) {
+//            return;
+//        }
+//        try {
+//            String timeStampStr = DateUtil.fomart(timeStamp, "yyyy-MM-dd HH:mm:ss");
+//            Map<String, String> map = getMap(oldCardNo, cardNo, timeStampStr);
+//            HttpUtil.httpPost(haiciServiceUrl, getXMLString(oldCardNo, cardNo, timeStampStr), "application/xml",3000);
+//            log.info(map.toString());
+//        } catch (Exception e) {
+//            e.printStackTrace();
+//        }
+//    }
+//
+//    @Override
+//    public void commonMessageNotice(String cardNo, String message, Date timeStamp) {
+//        try {
+//            String timeStampStr = DateUtil.fomart(timeStamp, "yyyy-MM-dd HH:mm:ss");
+//            Map<String, String> map = getCommonMessageMap(cardNo, message, timeStampStr);
+//            HttpUtil.httpPost(haiciServiceUrl, getCommonMessageXMLString(cardNo, message, timeStampStr), "application/xml",3000);
+//            log.info(map.toString());
+//        } catch (Exception e) {
+//            e.printStackTrace();
+//        }
+//    }
+//
+//    @Override
+//    public void rejectCallbackScheduleOfMedical(String reqNo) {
+//
+//    }
+//
+//    @Override
+//    public void refreshMzClasses() {
+//
+//    }
+//
+//    @Override
+//    public void notify(String serialNo, Integer action) {
+//
+//    }
+//
+//    @Override
+//    public String genMzPayQrcode(Integer totalAmt, String patientId, String hisOrdNum) {
+//        return null;
+//    }
+//
+//    @Override
+//    public void closeUnpaidWxOrder(String hisOrdNum) {
+//
+//    }
+//
+//    @Override
+//    public void timeLimitChanged() {
+//
+//    }
+//
+//    @Override
+//    public void preAllocationBed(String patientId, String visitDate) {
+//
+//    }
+//
+//    /**
+//     * 生成map以进行Sign加密  变更卡号参数
+//     */
+//    private Map<String, String> getMap(String oldCardNo, String cardNo, String timeStamp) {
+//        Map<String, String> map = new HashMap<>();
+//        map.put("serviceCode", "CardChangeNotice");
+//        map.put("partnerId", "hnthyy");
+//        map.put("timeStamp", timeStamp);
+//        map.put("actionType", "1");
+//        map.put("cardType", "1");
+//        map.put("oldCardNo", oldCardNo);
+//        map.put("cardNo", cardNo);
+//        return map;
+//    }
+//
+//    /**
+//     * 生成向海鹚发送请求的参数 变更卡号参数
+//     */
+//    private String getXMLString(String oldCardNo, String cardNo, String timeStamp) throws Exception {
+//        Map<String, String> map = getMap(oldCardNo, cardNo, timeStamp);
+//        return "<?xml version='1.0' encoding='UTF-8'?>\n"
+//                + "<Request>\n"
+//                + "<serviceCode>CardChangeNotice</serviceCode>\n"
+//                + "<partnerId>hnthyy</partnerId>\n"
+//                + "<timeStamp>" + timeStamp + "</timeStamp>\n"
+//                + "<password>" + SignUtil.getSignValue(map, th_pwd) + "</password>\n"
+//                + "<actionType>1</actionType>\n"
+//                + "<cardType>1</cardType>\n"
+//                + "<cardNo>" + cardNo + "</cardNo>\n"
+//                + "<oldCardNo>" + oldCardNo + "</oldCardNo>\n"
+//                + "</Request>";
+//    }
+//
+//
+//    /**
+//     * 生成map以进行Sign加密  发送通用消息参数
+//     */
+//    private Map<String, String> getCommonMessageMap(String cardNo, String message, String timeStamp) {
+//        Map<String, String> map = new HashMap<>();
+//        map.put("serviceCode", "SendMessageNotice");
+//        map.put("partnerId", "hnthyy");
+//        map.put("timeStamp", timeStamp);
+//        map.put("cardNo", cardNo);
+//        map.put("admissionNum", "");
+//        map.put("inNo", "");
+//        map.put("msgType", "0");
+//        map.put("msgContext", message);
+//        map.put("channel", "WX");
+//        return map;
+//    }
+//
+//    /**
+//     * 生成向海鹚发送请求的参数 发送通用消息参数
+//     */
+//    private String getCommonMessageXMLString(String cardNo, String message, String timeStamp) throws Exception {
+//        Map<String, String> map = getCommonMessageMap(cardNo, message, timeStamp);
+//        return "<?xml version='1.0' encoding='UTF-8'?>\n"
+//                + "<Request>\n"
+//                + "<serviceCode>SendMessageNotice</serviceCode>\n"
+//                + "<partnerId>hnthyy</partnerId>\n"
+//                + "<timeStamp>" + timeStamp + "</timeStamp>\n"
+//                + "<password>" + SignUtil.getSignValue(map, th_pwd) + "</password>\n"
+//                + "<cardNo>" + cardNo + "</cardNo>\n"
+//                + "<admissionNum></admissionNum>\n"
+//                + "<inNo></inNo>\n"
+//                + "<msgType>0</msgType>\n"
+//                + "<msgContext>" + message + "</msgContext>\n"
+//                + "<channel>WX</channel>\n"
+//                + "</Request>";
+//    }
+//
+//    /**
+//     * @description: 处理危机消息回执
+//     * @author: lihong
+//     * @date: 2024/4/11 9:30
+//     * @param: param
+//     */
+//    @Override
+//    public void criticalMessageReceipt(Map<String, Object> param) {
+//
+//    }
+//}

+ 92 - 3
src/main/java/cn/hnthyy/thmz/service/impl/thmz/HaiCiAdapterServiceTaiheImpl.java

@@ -2,8 +2,13 @@ package cn.hnthyy.thmz.service.impl.thmz;
 
 import cn.hnthyy.thmz.Utils.HttpUtil;
 import cn.hnthyy.thmz.Utils.JsonUtil;
+import cn.hnthyy.thmz.Utils.R;
+import cn.hnthyy.thmz.common.Constants;
+import cn.hnthyy.thmz.entity.jy.ResultVo;
 import cn.hnthyy.thmz.service.his.zd.DictDataService;
 import cn.hnthyy.thmz.service.thmz.HaiCiAdapterService;
+import cn.hutool.core.convert.Convert;
+import cn.hutool.http.HttpRequest;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.scheduling.annotation.Async;
@@ -12,6 +17,7 @@ import org.springframework.stereotype.Service;
 import javax.annotation.Resource;
 import java.io.IOException;
 import java.util.Date;
+import java.util.HashMap;
 import java.util.Map;
 
 @Slf4j
@@ -32,8 +38,6 @@ public class HaiCiAdapterServiceTaiheImpl implements HaiCiAdapterService {
     @Resource
     private DictDataService dictDataService;
 
-    //private ExecutorService executor = Executors.newFixedThreadPool(5);
-
     /**
      * 更新病人卡号 消息通知
      *
@@ -169,7 +173,6 @@ public class HaiCiAdapterServiceTaiheImpl implements HaiCiAdapterService {
     }
 
     /**
-     * @param hisOrdNum
      * @description: 关闭微信支付订单
      * @author: lihong
      * @date: 2024/3/19 16:58
@@ -234,4 +237,90 @@ public class HaiCiAdapterServiceTaiheImpl implements HaiCiAdapterService {
             log.error("[criticalMessageReceipt]报错信息:", e);
         }
     }
+
+    /**
+     * @description: 查询处方是否医保移动支付
+     * @author: lihong
+     * @date: 2024/10/24 16:47
+     * @param: hisOrdNum HIS单号
+     * @return: java.lang.Boolean
+     */
+    @Override
+    public Boolean isMipOrder(String hisOrdNum) {
+        try {
+            String res = HttpRequest.get(haiciServiceUrl + "/api/mobilePayPlugin/isMipOrder?hisOrdNum=" + hisOrdNum)
+                    .timeout(8000)
+                    .execute()
+                    .body();
+            ResultVo response = (ResultVo)JsonUtil.jsontoObject(res, ResultVo.class);
+            log.info("[isMipOrder]返回结果:{}",res);
+            if(response.getCode() == 200){
+                return true;
+            }
+        }catch (Exception e){
+            log.error("[isMipOrder]报错,参数hisOrdNum="+hisOrdNum,e);
+        }
+        return false;
+    }
+
+    /**
+     * @description: 医保移动支付退款
+     * @author: lihong
+     * @date: 2024/10/24 16:51
+     * @param: staffId 操作人编号
+     * @param: hisOrdNum HIS单号
+     * @param: ecToken 电子凭证授权码
+     * @param: refundReason 退款原因
+     * @return: java.lang.Integer 返回  0 成功  -1失败
+     */
+    @Override
+    public Integer revokeMipSettle(String staffId, String hisOrdNum, String ecToken, String refundReason) {
+        Map<String, Object> paraMap = new HashMap<>();
+        paraMap.put("staffId", staffId);
+        paraMap.put("hisOrdNum", hisOrdNum);
+        paraMap.put("ecToken", ecToken);
+        paraMap.put("refundReason", refundReason);
+        try {
+            log.info("[revokeMipSettle]入参:{}",paraMap);
+            String res = HttpRequest.post(haiciServiceUrl + "/api/mobilePayPlugin/revokeMipSettle")
+                    .body(JsonUtil.object2Json(paraMap))
+                    .execute()
+                    .body();
+            log.info("[revokeMipSettle]返回结果:{}",res);
+            ResultVo response = (ResultVo)JsonUtil.jsontoObject(res, ResultVo.class);
+            return response.getCode()==200 ? R.SUCCESS_CODE : R.ERR_CODE;
+        }catch (Exception e){
+            log.error("[revokeMipSettle]报错:", e);
+        }
+        return R.ERR_CODE;
+    }
+
+    /**
+     * @description: 查询医保移动支付退款状态
+     * @author: lihong
+     * @date: 2024/10/24 16:54
+     * @param: hisOrdNum
+     * @return: java.lang.String  返回 REFUND_PROCEEDING:退款处理中
+     * REFUND_SUCCEED:退款成功
+     * REFUND_FAILED:退款失败
+     * REFUND_ABNORMAL:退款异常
+     */
+    @Override
+    public String queryRefundState(String hisOrdNum) {
+        try {
+            log.info("[queryRefundState]入参:{}",hisOrdNum);
+            String res = HttpRequest.get(haiciServiceUrl + "/api/mobilePayPlugin/queryRefundState?hisOrdNum="+hisOrdNum)
+                    .timeout(8000)
+                    .execute()
+                    .body();
+            log.info("[queryRefundState]返回结果:{}",JsonUtil.object2Json(res));
+            ResultVo response = (ResultVo)JsonUtil.jsontoObject(res, ResultVo.class);
+            if(response.getCode() == 200){
+                return Convert.toStr(response.getData());
+            }
+        }catch (Exception e){
+            log.error("[queryRefundState]报错:",e);
+        }
+        return Constants.REFUND_ABNORMAL;
+    }
 }

+ 1 - 1
src/main/java/cn/hnthyy/thmz/service/impl/thmz/OrderStatusChangeServiceImpl.java

@@ -138,7 +138,7 @@ public class OrderStatusChangeServiceImpl implements OrderStatusChangeService {
             }
 
             if (OrderStatusEnum.PRESCRIPTION_TO_BE_PAID.code.equals(status)) {
-                String url="https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxbde6b16acad84204&redirect_uri=https://staticweb.hnthyy.cn/wxserver/redirect/page2?to=unPaidList_"+patientInfo[0]+"&response_type=code&scope=snsapi_base&state=1#wechat_redirect";
+                String url="https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxbde6b16acad84204&redirect_uri=https://staticweb.hnthyy.cn/wxserver/redirect/page2?to=mzFeeList_"+patientInfo[0]+"&response_type=code&scope=snsapi_base&state=1#wechat_redirect";
                 haiCiAdapterService.commonMessageNotice(mzPatientMi.getIcCardNo(), "{\"data\":{\"first\":{\"color\":\"#FF0000\",\"value\":\"您好,您有一笔门诊费用待缴。\"},\"keyword1\":{\"color\":\"#173177\",\"value\":\"长沙泰和医院\"},\"keyword2\":{\"color\":\"#173177\",\"value\":\"" + mzPatientMi.getName() + "\"},\"remark\":{\"color\":\"#FF0000\",\"value\":\" 您的处方已生成,可以点击查看详情并缴费!\"}},\"miniprogram\":{\"appid\":\"\",\"pagepath\":\"\"},\"template_id\":\"utgzvafhKaWx3F6-6G26tb72zZ0eT_kJ6DzQeTwmwi4\",\"touser\":\"\",\"url\":\""+url+"\"}", new Date());
                 return;
             }

+ 1 - 1
src/main/java/cn/hnthyy/thmz/service/impl/thmz/TsmzServiceImpl.java

@@ -404,7 +404,7 @@ public class TsmzServiceImpl implements TsmzService {
         //Map 转成  JSONObject 字符串
         JSONObject jsonObj = new JSONObject(map);
         try {
-            String result = HttpUtil.sendHttpPost(realUrl, jsonObj.toString(), 20000);
+            String result = HttpUtil.sendHttpPost(realUrl, jsonObj.toString(), 40000);
             if (StringUtils.isBlank(result)) {
                 return null;
             }

+ 30 - 0
src/main/java/cn/hnthyy/thmz/service/thmz/HaiCiAdapterService.java

@@ -73,4 +73,34 @@ public interface HaiCiAdapterService {
      * @param: param
      **/
     void criticalMessageReceipt(Map<String, Object> param);
+    /**
+     * @description: 查询处方是否医保移动支付
+     * @author: lihong
+     * @date: 2024/10/24 16:47
+     * @param: hisOrdNum HIS单号
+     * @return: java.lang.Boolean
+     **/
+    Boolean isMipOrder(String hisOrdNum);
+    /**
+     * @description: 医保移动支付退款
+     * @author: lihong
+     * @date: 2024/10/24 16:51
+     * @param: staffId 操作人编号
+     * @param: hisOrdNum HIS单号
+     * @param: ecToken 电子凭证授权码
+     * @param: refundReason 退款原因
+     * @return: java.lang.Integer 返回  0 成功 -1其他失败
+     **/
+   Integer revokeMipSettle(String staffId, String hisOrdNum, String ecToken, String refundReason);
+    /**
+     * @description: 查询医保移动支付退款状态
+     * @author: lihong
+     * @date: 2024/10/24 16:54
+     * @param: hisOrdNum
+     * @return: java.lang.String  返回 REFUND_PROCEEDING:退款处理中
+     * REFUND_SUCCEED:退款成功
+     * REFUND_FAILED:退款失败
+     * REFUND_ABNORMAL:退款异常
+     **/
+    String queryRefundState(String hisOrdNum);
 }

+ 4 - 0
src/main/java/cn/hnthyy/thmz/vo/MzDepositFileVo.java

@@ -34,5 +34,9 @@ public class MzDepositFileVo {
     //	03 社保卡
     //    01 电子凭证
     private String readCardType;
+    //1 移动医保支付  0 不是
+    private Integer mipOrdeFlag;
+    //电子凭证授权码
+    private String ecToken;
 
 }

+ 74 - 82
src/main/resources/static/js/mz/clinic.js

@@ -851,16 +851,16 @@ $(function () {
     /**
      * 门诊统筹支付医保电子凭证读卡
      */
-    $("#mztczfSiReadCard").on("click", function (t) {
-        mztczfSiReadCard(true, "qrcode_01101");
-    });
+    // $("#mztczfSiReadCard").on("click", function (t) {
+    //     mztczfSiReadCard(true, "qrcode_01101");
+    // });
 
     /**
      * 门诊统筹支付医保刷脸
      */
-    $("#mztczfSiReadCardFace").on("click", function (t) {
-        mztczfSiReadCard(true, "face_01101");
-    });
+    // $("#mztczfSiReadCardFace").on("click", function (t) {
+    //     mztczfSiReadCard(true, "face_01101");
+    // });
 
     /**
      * 快速接诊页面 -未挂号患者信息查询处编辑患者信息
@@ -2359,57 +2359,38 @@ function realClinicalReception(patientId, serialNo, reqType) {
  * @param patientId
  */
 function queryInsuinfo(patientId) {
-    $.ajax({
-        type: "GET",
-        url: '/thmz/queryInsuinfo?patientId=' + patientId,
-        contentType: "application/json;charset=UTF-8",
-        dataType: "json",
-        headers: {
-            'Accept': 'application/json',
-            'Authorization': 'Bearer ' + localStorage.getItem("token")
-        },
-        success: function (res) {
-            if (res == '401' || res == 401) {
-                window.location.href = '/thmz/login/view'
-                return;
-            }
-            if (res.code == 0) {
-                $("#zgmztczfDiv").removeClass("hide").addClass("in");
-                $("#mztczfSiReadCard").removeClass("hide").addClass("in");
-                $("#mztczfSiReadCardFace").removeClass("hide").addClass("in");
-                $("#grzhzfDiv").removeClass("hide").addClass("in");
-                var ybCode = localStorage.getItem("ybCode");
-                if (ybCode != null && ybCode != "" && ybCode.length > 0) {
-                    $("#zgmztczf").selectpicker('val', 1);
-                    $("#zgmztczf").selectpicker('refresh');
-                    if($("#mzOrderTypeSelect").val() !='4'){
-                        $("#mzOrderTypeSelect").selectpicker('val', '2');
-                        $("#mzOrderTypeSelect").selectpicker('refresh');
-                    }else {
-                        $("#zgmztczf").selectpicker('val', 0);
-                        $("#zgmztczf").selectpicker('refresh');
-                    }
-                    postAjaxJsonHttpRequst("/thmz/queryVisitTypeName",{patientId:patientId},true,function (res) {
-                        if(res.code ==0){
-                            if(!stringIsBlank(res.data)){
-                                warningMesageSimaple("该患者为股东卡用户,选择医保门诊统筹将不能享受股东卡优惠,请告知患者,请悉知!")
-                            }
-                        }
-                    })
+    getAjaxRequst("/thmz/queryInsuinfo",{patientId: patientId},true,function (insurRes) {
+        if(insurRes.code == 0){
+            var ybCode = localStorage.getItem("ybCode");
+            if(ybCode !=null && ybCode !="" && ybCode.length > 0){
+                $("#zgmztczf").selectpicker('val',1);
+                $("#zgmztczf").selectpicker('refresh');
+                if($("#mzOrderTypeSelect").val() !='4'){
+                    $("#mzOrderTypeSelect").selectpicker('val','2');
+                    $("#mzOrderTypeSelect").selectpicker('refresh');
                 }else {
-                    $("#zgmztczf").selectpicker('val', 0);
+                    $("#zgmztczf").selectpicker('val',0);
                     $("#zgmztczf").selectpicker('refresh');
                 }
-                if (res.expContentRequired != null && res.expContentRequired == 1) {
-                    $("#expContentRequired").removeClass("hide").addClass("in");
-                }
-            } else if (res.code == -1) {
-                errorMesageSimaple(res.message);
-            } else if (res.code == -2) {
-                warningMesageSimaple(res.message);
+                postAjaxJsonHttpRequst("/thmz/queryVisitTypeName",{patientId:patientId},true,function (res) {
+                    if(res.code ==0){
+                        if(!stringIsBlank(res.data)){
+                            warningMesageSimaple("该患者为股东卡用户,选择医保门诊统筹将不能享受股东卡优惠,请告知患者,请悉知!")
+                        }
+                    }
+                })
+            }else {
+                $("#zgmztczf").selectpicker('val',0);
+                $("#zgmztczf").selectpicker('refresh');
             }
+        }else if(insurRes.code == -1){
+            errorMesageSimaple(insurRes.message);
+        }else if(insurRes.code == -2){
+            warningMesageSimaple(insurRes.message);
         }
-    });
+    })
+
+
 }
 
 
@@ -3113,6 +3094,10 @@ function callBackZlDetail(code, mzChargeDetail) {
                 $("#zlRemark").val(mzChargeDetail.instructionText);
                 $("#dayZlNum").selectpicker('val', mzChargeDetail.orderDays);
                 $('#dayZlNum').selectpicker('refresh');
+                if(!stringIsBlank(mzChargeDetail.hospApprFlag)){
+                    $("#zlHospApprFlag").selectpicker('val', mzChargeDetail.hospApprFlag);
+                    $('#zlHospApprFlag').selectpicker('refresh');
+                }
                 $("#orderFrequencyZl").selectpicker('val', mzChargeDetail.frequency);
                 $('#orderFrequencyZl').selectpicker('refresh');
                 if (mzChargeDetail.execDept != null && mzChargeDetail.execDept != "") {
@@ -3482,6 +3467,10 @@ function editPrescription(jsonData, type) {
                 $("#totalRetprice").val(Multiply(mzChargeDetail.quantity, $("#packRetprice").val()));
                 $("#medicalAdvice").selectpicker('val', mzChargeDetail.instructionCode);
                 $('#medicalAdvice').selectpicker('refresh');
+                if(!stringIsBlank(mzChargeDetail.hospApprFlag)){
+                    $("#xyHospApprFlag").selectpicker('val', mzChargeDetail.hospApprFlag);
+                    $('#xyHospApprFlag').selectpicker('refresh');
+                }
                 saveWesternMedicineWithCheck(false, orderNo);
                 $("#western_medicine_button").click();
                 $("#xyTab").find("li:eq(0) a").off("click").click();
@@ -3497,6 +3486,10 @@ function editPrescription(jsonData, type) {
                 $("#zy_drugWin").val(mzChargeDetail.quantity);
                 $("#zyInstruction").selectpicker('val', mzChargeDetail.instructionCode);
                 $('#zyInstruction').selectpicker('refresh');
+                if(!stringIsBlank(mzChargeDetail.hospApprFlag)){
+                    $("#zyHospApprFlag").selectpicker('val', mzChargeDetail.hospApprFlag);
+                    $('#zyHospApprFlag').selectpicker('refresh');
+                }
                 saveChineseMedicine(false);
                 if (!hadSetZyFullParams) {
                     hadSetZyFullParams = true;
@@ -4663,6 +4656,8 @@ function saveWesternMedicine(calculateTotalAmountFlag) {
     var tryResult = $("#tryResult").val();
     //药品大类标志
     var categoriesFlag = $("#categoriesFlag").val();
+    //报销自费标识
+    var xyHospApprFlag = $("#xyHospApprFlag").val();
     if (currentCode == null || currentCode == '') {
         if (calculateTotalAmountFlag) {
             errorMesageSimaple("未选择任何药品!");
@@ -4740,6 +4735,7 @@ function saveWesternMedicine(calculateTotalAmountFlag) {
     html += '<input type="hidden" class="temporary_items_tryResult" value="' + tryResult + '"/>';
     html += '<input type="hidden" class="temporary_items_currentGroupNo" value="' + currentGroupNo + '"/>';
     html += '<input type="hidden" class="temporary_items_categoriesFlag" value="' + categoriesFlag + '"/>';
+    html += '<input type="hidden" class="temporary_items_xyHospApprFlag" value="' + xyHospApprFlag + '"/>';
     html += '</div>';
 
     var tableId = $("#xyTab li.active").find("a").attr("href");
@@ -4901,6 +4897,8 @@ function editWesternMedicine(obj) {
     $("#supplyType").val($(parentObject).find("input.temporary_items_supplyType").val());
     $('#supplyType').selectpicker('refresh');
 
+    $("#xyHospApprFlag").val($(parentObject).find("input.temporary_items_xyHospApprFlag").val());
+    $('#xyHospApprFlag').selectpicker('refresh');
     //药品默认单次使用剂量
     $("#drugWinDb").val($(parentObject).find("input.temporary_items_drugWinDb").val());
     //处方实际单次使用剂量
@@ -5024,6 +5022,8 @@ function editChineseMedicine(obj) {
     //医嘱码
     $("#zyInstruction").val($(parentObject).find("input.temporary_items_zyInstruction").val());
     $('#zyInstruction').selectpicker('refresh');
+    $("#zyHospApprFlag").val($(parentObject).find("input.temporary_items_zyHospApprFlag").val());
+    $('#zyHospApprFlag').selectpicker('refresh');
 
 }
 
@@ -5098,6 +5098,9 @@ function editZlItem(obj) {
     //执行科室
     var execUnit = $(parentObject).find("input.temporary_items_execUnit").val();
 
+    $("#zlHospApprFlag").val($(parentObject).find("input.temporary_items_zlHospApprFlag").val());
+    $('#zlHospApprFlag').selectpicker('refresh');
+
     var descriptions = $(parentObject).find("input.temporary_items_code").val();
     if (descriptions != null && descriptions != "" && descriptions != 'null') {
         $("#descriptions").val(descriptions);
@@ -5404,6 +5407,8 @@ function saveZlItemReal(calculateTotalAmountFlag) {
     var chargeUnitCode = chargeUnit;
     //备注
     var remark = $("#zlRemark").val();
+    //报销自费标识
+    var zlHospApprFlag = $("#zlHospApprFlag").val();
     if (calculateTotalAmountFlag == true) {
         if (currentCode == null || currentCode == '') {
             errorMesageSimaple("未选择任何项目!");
@@ -5496,6 +5501,7 @@ function saveZlItemReal(calculateTotalAmountFlag) {
     html += '<input type="hidden" class="temporary_items_descriptions" value="' + descriptions + '"/>';
     html += '<input type="hidden" class="temporary_items_dayZlNum" value="' + dayZlNum + '"/>';
     html += '<input type="hidden" class="temporary_items_orderFrequencyZl" value="' + orderFrequencyZl + '"/>';
+    html += '<input type="hidden" class="temporary_items_zlHospApprFlag" value="' + zlHospApprFlag + '"/>';
     html += '<input type="hidden" class="temporary_items_totalNumZl" value="' + totalNumZl + '"/>';
     html += '</div>';
     //当没有下一个兄弟节点或者当前编辑的药品是最后一个时,直接添加
@@ -5934,6 +5940,8 @@ function clearWesternMedicine(flag) {
     //医嘱
     $("#medicalAdvice").selectpicker('val', null);
     $('#medicalAdvice').selectpicker('refresh');
+    $("#xyHospApprFlag").selectpicker('val', '0');
+    $('#xyHospApprFlag').selectpicker('refresh');
     $("#tryResult").parent().parent().parent().removeClass("in").addClass("hide");
     //皮试结果
     $("#tryResult").selectpicker('val', null);
@@ -5968,6 +5976,8 @@ function saveChineseMedicine(calculateTotalAmountFlag) {
     var totalRetprice = Multiply(drugWin, zyPackRetprice);
     //中药类型
     var zyClassType = $("#zyClassType").val();
+    //
+    var zyHospApprFlag = $("#zyHospApprFlag").val();
     //已经选中的药品类型, 中药不允许一个处方里有普通中药和颗粒剂
     var currentYyClassType = $("#current_zyClassType").val();
     if (currentYyClassType == null || currentYyClassType == "") {
@@ -6008,6 +6018,7 @@ function saveChineseMedicine(calculateTotalAmountFlag) {
     html += '<input type="hidden" class="temporary_items_drugUnit" value="' + $("#zyUnit").text() + '"/>';
     html += '<input type="hidden" class="temporary_items_zyInstruction" value="' + zyInstruction + '"/>';
     html += '<input type="hidden" class="temporary_items_zyInstructionText" value="' + zyInstructionText + '"/>';
+    html += '<input type="hidden" class="temporary_items_zyHospApprFlag" value="' + zyHospApprFlag + '"/>';
     html += '</div>';
 
     var tableId = $("#zyTab li.active").find("a").attr("href");
@@ -6077,6 +6088,8 @@ function clearChineseMedicine() {
     //医嘱
     $("#zyInstruction").selectpicker('val', null);
     $('#zyInstruction').selectpicker('refresh');
+    $("#zyHospApprFlag").selectpicker('val', '0');
+    $('#zyHospApprFlag').selectpicker('refresh');
     //剂量
     $("#zy_drugWin").val(null);
     //单价
@@ -6155,6 +6168,8 @@ function clearZlItem() {
     $("#descriptions").val(null);
     $("#dayZlNum").selectpicker('val', 1);
     $('#dayZlNum').selectpicker('refresh');
+    $("#zlHospApprFlag").selectpicker('val', '0');
+    $('#zlHospApprFlag').selectpicker('refresh');
     $("#orderFrequencyZl").selectpicker('val', 'ONCE');
     $('#orderFrequencyZl').selectpicker('refresh');
     $("#totalNumZl").val(null);
@@ -9459,6 +9474,7 @@ function getParamsForpPrescription(type) {
                     tempJson.instructionCode = $(formGroups[j]).find("input.temporary_items_medicalAdvice").val();
                     tempJson.instructionText = $(formGroups[j]).find("input.temporary_items_medicalAdviceText").val();
                     tempJson.supplyCode = $(formGroups[j]).find("input.temporary_items_supplyType").val();
+                    tempJson.hospApprFlag = $(formGroups[j]).find("input.temporary_items_xyHospApprFlag").val();
                     orderNo = i + 1;
                     tempJson.orderNo = orderNo;
                     tempJson.groupOrder = $(formGroups[j]).find("input.temporary_items_groupId").val();
@@ -9505,6 +9521,7 @@ function getParamsForpPrescription(type) {
             //tempJson.frequency = $("#zy_orderFrequency_1").val();
             tempJson.instructionCode = $(zyTabContents[i]).find("input.temporary_items_zyInstruction").val();
             tempJson.instructionText = $(zyTabContents[i]).find("input.temporary_items_zyInstructionText").val();
+            tempJson.hospApprFlag = $(zyTabContents[i]).find("input.temporary_items_zyHospApprFlag").val();
             tempJson.cyFysm = $("#useType_1").val();
             tempJson.cyJssm = $("#cyJssm").val();
             tempJson.cyJsl = $("#cyJsl").val();
@@ -9569,6 +9586,7 @@ function getParamsForpPrescription(type) {
             //因为收费表里的单位长度限制,无法存入库
             //tempJson.drugUnit = $(zlTabContents[i]).find("input.temporary_items_desc_value").val();
             tempJson.frequency = $(zlTabContents[i]).find("input.temporary_items_orderFrequencyZl").val();
+            tempJson.hospApprFlag = $(zlTabContents[i]).find("input.temporary_items_zlHospApprFlag").val();
             tempJson.orderDays = $(zlTabContents[i]).find("input.temporary_items_dayZlNum").val();
             tempJson.orderNo = orderNo;
             tempJson.execDept = execUnit;
@@ -9763,27 +9781,7 @@ function savePrescriptionForReadCard() {
     $("#chinese_medicine_name").webuiPopover('hide');
     $("#jcJyItem").webuiPopover('hide');
     $("#zlItem").webuiPopover('hide');
-    var zgmztczf = $("#zgmztczf").val();
-    var readCardResult = $("#readCardResult").val();
-    if ((zgmztczf == 1 || zgmztczf == "1") && (readCardResult == null || readCardResult == "")) {
-        $("#messageModalYb").modal();
-        $("#messageContent").html("门诊统筹处方必须读卡,是否立即读卡?");
-        $("#ybdzpz").off("click").bind("click", function (t) {
-            mztczfSiReadCard(true, "qrcode_01101");
-            realSavePrescription();
-        });
-        $("#ybsl").off("click").bind("click", function (t) {
-            mztczfSiReadCard(true, "face_01101");
-            realSavePrescription();
-        });
-        $("#cancelButtonYb").off("click").bind("click", function (t) {
-            t.stopPropagation();
-            t.preventDefault();
-            realSavePrescription();
-        });
-    } else {
-        realSavePrescription();
-    }
+    realSavePrescription();
 }
 
 
@@ -9795,10 +9793,6 @@ function realSavePrescription() {
     $("#messageModal").modal();
     $("#messageContent").html("确认保存处方吗?");
     $("#messageButton").off("click").bind("click", function (t) {
-        if (mztczfSiReadCardStatus) {
-            $("#messageContent").html("门诊统筹正在读卡中,次操作需与医保中心交互,耗时较长,请耐心等待...");
-            return;
-        }
         $("#messageButton").attr("disabled", true);
         var jsonData = getParamsForpPrescription(1);
         $.ajax({
@@ -9971,6 +9965,9 @@ function clearApidAcceptsModal() {
  * @param clnicId 就诊记录id
  */
 function getMzPrescriptionVoUnPaid(patientId, times, clnicId) {
+    if (!confirm("请确认要修改处方吗?如只修改病历,请取消,点击【详情】再【修改病历】")) {
+        return;
+    }
     var currentPatientId = $("#patientId").text();
     //当前接诊的用户和操作接诊的是同一个人,不做任何操作
     if (currentPatientId == patientId) {
@@ -13223,11 +13220,6 @@ function clearExpContentRequired() {
  * 清空门诊统筹支付参数区域
  */
 function clearZgtczfInput() {
-    $("#zgmztczfDiv").removeClass("in").addClass("hide");
-    $("#mztczfSiReadCard").removeClass("in").addClass("hide");
-    $("#mztczfSiReadCardFace").removeClass("in").addClass("hide");
-    $("#expContentRequired").removeClass("in").addClass("hide");
-    $("#grzhzfDiv").removeClass("in").addClass("hide");
     $("#zgmztczf").selectpicker('val', null);
     $("#zgmztczf").selectpicker('refresh');
     $("#grzhzf").selectpicker('val', null);

+ 94 - 71
src/main/resources/static/js/mz/toll_administration.js

@@ -482,16 +482,20 @@ function initFeeTable() {
                     str += '<button type="button" class="registration-no-color-foot-button" title="诊断查询" onclick="diagnoseQuery(\'' + row.patientId + '\',' + row.times + ')"><i class="fa fa-search-minus"></i></button>';
                     var payMarkGroup = getIndex("pay_mark_group");
                     if (payMarkGroup == 0) {
-                        if (row.countYbZf != null && row.countYbZf > 0) {
-                                str += '<button type="button" class="registration-no-color-foot-button"title="医保读卡" onclick="mztczfSiReadCardTypeModel(\'' + row.patientId + '\',' + row.times + ')"><i class="fa fa-newspaper-o"></i></button>';
-                                str += '<button type="button" class="registration-no-color-foot-button"title="医保结算" onclick="directRegistration(\'' + row.patientId + '\',' + row.times + ')"><i class="fa fa-credit-card"></i></button>';
-                        }
+                                if(row.countYbZf !=null && row.countYbZf > 0 ){
+                                    str += '<button type="button" class="registration-no-color-foot-button"title="医保读卡" onclick="mztczfSiReadCardTypeModel(\'' + row.patientId + '\',' + row.times + ')"><i class="fa fa-newspaper-o"></i></button>';
+                                    str += '<button type="button" class="registration-no-color-foot-button"title="医保结算" onclick="directRegistration(\'' + row.patientId + '\',' + row.times + ')"><i class="fa fa-credit-card"></i></button>';
+                                }
                         str += '<button type="button" class="registration-no-color-foot-button"title="确认收费" onclick="tipHaveTally(' + row.amount + ',\'' + row.patientId + '\',' + row.times + ',\'' + row.name + '\',' + row.receiptNo + ')"><i class="fa fa-rmb"></i></button>';
                         if (buttonCodes != null) {
                             if (isInArrayStr("init_clinic_for_exception", buttonCodes)) {
                                 str += '<button type="button" class="registration-no-color-foot-button" title="就诊记录修复" onclick="initClinicForException(\'' + row.patientId + '\',' + row.times + ',\'5\',' + row.receiptNo + ');"><i class="fa fa-wrench"></i></button>';
                             }
                         }
+
+                        if(row.orderLockFlag != null && row.orderLockFlag == 1){
+                            str += '<button type="button" class="registration-no-color-foot-button" title="解锁处方" onclick="deleteOrderLock(\'' + row.patientId + '\',' + row.times + ',' + row.receiptNo + ')"><i class="fa fa-remove"></i></button>';
+                        }
                         return str;
                     }
                     if (payMarkGroup == 1) {
@@ -800,6 +804,7 @@ function reSiReadCard(asyncFlag,tfReadType) {
                 return;
             }
             if (res.code == 200) {
+                successMesageSimaple('读卡成功')
                 if(tfReadType == '01'){
                     var data = JSON.parse(res.data);
                     $("#cdReadCardResult").val(JSON.stringify(data.data));
@@ -1407,6 +1412,7 @@ function initClinicForException(patientId, times, payMark, receiptNo) {
  * 提示有记账记录
  */
 function tipHaveTally(data, patientId, times, name, receiptNo) {
+    addOrderLock(patientId,times,null)
     closeConfirmFeeModal();
     if (patientId == null || patientId == "") {
         return;
@@ -2579,6 +2585,9 @@ function initRefundChargeDetailTable(chargeItemCodes) {
                     }else {
                         str += '<button type="button" class="registration-no-color-foot-button" title="撤销医保重新登记医保" onclick="reqYb()"><i  class="fa fa-server"></i></button>';
                     }
+                    if(row.mipOrderFlag == 1){
+                        str += `<button type="button" class="registration-no-color-foot-button"title="读取电子凭证" onclick="reSiReadCard(true,'01')"><i class="fa fa-newspaper-o"></i></button>`;
+                    }
                     str += '<button type="button" class="registration-no-color-foot-button"title="普通退费" onclick="saveRefundFee(0)"><i class="fa fa-check"></i></button>';
                     str += '<button type="button" class="registration-no-color-foot-button"title="原路退费" onclick="saveRefundFee(1)"><i class="fa fa-exchange"></i></button>';
                     return str;
@@ -2604,7 +2613,7 @@ function initRefundChargeDetailTable(chargeItemCodes) {
                     "rows": {}   //数据
                 };
             }
-            if(ress.pageViewVo.data[0].ybZfFlag =='1' && (ress.pageViewVo.data[0].amount !=null && ress.pageViewVo.data[0].amount != undefined && ress.pageViewVo.data[0].amount != 0)){
+            if((ress.pageViewVo.data[0].ybZfFlag =='1' ) && (ress.pageViewVo.data[0].amount !=null && ress.pageViewVo.data[0].amount != undefined && ress.pageViewVo.data[0].amount != 0)){
                 $("#tfGrzhzfDiv").removeClass("hide").addClass("in");
             }else {
                 $("#tfGrzhzfDiv").removeClass("in").addClass("hide");
@@ -2681,7 +2690,10 @@ function saveRefundFee(refundType) {
                         html += '</div>';
                         html += '<label style="text-align: left;" class="control-label col-md-1 col-sm-1 col-xs-1">元</label>';
                         html += '<label style="text-align: left;color: red" class="control-label col-md-3 col-sm-3 col-xs-3">';
-                        if ((refundType == 1 && (mzDepositFile.chequeType == "银联卡" || mzDepositFile.chequeType == "聚合支付")) || mzDepositFile.chequeType == "医保记账" || mzDepositFile.chequeType == "省医保个账" || mzDepositFile.chequeType == "市医保个账") {
+                        if(res.mipOrdeFlag !=null && res.mipOrdeFlag == 1){
+                            html += "原路退回";
+                        }
+                       else if ((refundType == 1 && (mzDepositFile.chequeType == "银联卡" || mzDepositFile.chequeType == "聚合支付")) || mzDepositFile.chequeType == "医保记账" || mzDepositFile.chequeType == "省医保个账" || mzDepositFile.chequeType == "市医保个账") {
                             html += "原路退回";
                         }
                         html += '</label>';
@@ -3046,80 +3058,70 @@ function mztczfSiReadCardTypeChange() {
         return;
     }
     let admdvs =  $('#mztczfAdvmCity').val()
-    if(mztczfSiReadCardType == "02" && !stringNotBlank(admdvs)){
+    if(!stringNotBlank(admdvs)){
         errorMesageSimaple("请选择参保地!")
         $('#mztczfSiReadCardType').selectpicker('val', null);
         $('#mztczfSiReadCardType').selectpicker('refresh');
         return;
     }
 
-    var url = "http://localhost:8321/readcard/entry?param=";
-    if (mztczfSiReadCardType == "03") {
-        url += 'sicard_01101';
-    } else if (mztczfSiReadCardType == "01") {
-        url += 'qrcode_01101';
-    } else if (mztczfSiReadCardType == "02") {
-        url += 'idcard_01101';
-    }else if (mztczfSiReadCardType == "04") {
-        url += 'face_01101';
-    }
-    $.ajax({
-        type: "GET",
-        url: url,
-        contentType: "application/json;charset=UTF-8",
-        dataType: "json",
-        headers: {
-            'Accept': 'application/json',
-            'Authorization': 'Bearer ' + localStorage.getItem("token")
-        },
-        success: function (res) {
-            if (res == '401' || res == 401) {
-                window.location.href = '/thmz/login/view'
-                return;
-            }
-            //console.log(res);
-            if (res.code == 200) {
-                if (mztczfSiReadCardType == "01") {
-                    var data = JSON.parse(res.data);
-                    $("#readCardResult").val(JSON.stringify(data.data));
-                } else {
-                    $("#readCardResult").val(res.data);
-                }
-                if(mztczfSiReadCardType == "02"){
-                    let str =  res.data.split("^");
-                    let str1=  str.filter(item=>item !='');
-                    let IDNumber = str1[0];
-                    postAjaxJsonHttpRequst("/thmz/queryNewInsuinfo",{
-                        patientId :readPatientId,
-                        times :readTimes,
-                        admdvs:admdvs,
-                        socialNo:IDNumber
-                    },true,function (sfzRes) {
-                        if (sfzRes == '401' || sfzRes == 401) {
-                            window.location.href = '/thmz/login/view'
-                            return;
-                        }
-                        if(sfzRes.code == 0){
-                            successMesageSimaple("读卡成功,可以进行医保结算操作。");
-                            $("#mztczfSiReadCardModal").modal("hide");
-                        }else {
-                            errorMesage(res)
+    postAjaxJsonHttpRequst("/thmz/queryNewInsuinfo",{
+        patientId :readPatientId,
+        times :readTimes,
+        admdvs:admdvs
+    },true,function (sfzRes) {
+        if (sfzRes == '401' || sfzRes == 401) {
+            window.location.href = '/thmz/login/view'
+            return;
+        }
+        if(sfzRes.code == 0){
+            var url = "http://localhost:8321/readcard/entry?param=";
+            if (mztczfSiReadCardType == "03") {
+                url += 'sicard_01101';
+            } else if (mztczfSiReadCardType == "01") {
+                url += 'qrcode_01101';
+            } else if (mztczfSiReadCardType == "02") {
+                url += 'idcard_01101';
+            }else if (mztczfSiReadCardType == "04") {
+                url += 'face_01101';
+            }
+            $.ajax({
+                type: "GET",
+                url: url,
+                contentType: "application/json;charset=UTF-8",
+                dataType: "json",
+                headers: {
+                    'Accept': 'application/json',
+                    'Authorization': 'Bearer ' + localStorage.getItem("token")
+                },
+                success: function (res) {
+                    if (res == '401' || res == 401) {
+                        window.location.href = '/thmz/login/view'
+                        return;
+                    }
+                    if (res.code == 200) {
+                        if (mztczfSiReadCardType == "01") {
+                            var data = JSON.parse(res.data);
+                            $("#readCardResult").val(JSON.stringify(data.data));
+                        } else {
+                            $("#readCardResult").val(res.data);
                         }
-                    })
-                }else {
-                    successMesageSimaple("读卡成功,可以进行医保结算操作。");
-                    $("#mztczfSiReadCardModal").modal("hide");
+                        successMesageSimaple("读卡成功,可以进行医保结算操作。");
+                        $("#mztczfSiReadCardModal").modal("hide");
+                    } else {
+                        warningMesageSimaple("读卡失败,可以稍后重试或者自费结算(不享受门诊统筹)!")
+                        console.log(res);
+                    }
+                },
+                error: function (XMLHttpRequest, textStatus, errorThrown) {
+                    warningMesageSimaple("读卡异常,可以稍后重试或者自费结算(不享受门诊统筹)!")
                 }
-            } else {
-                warningMesageSimaple("读卡失败,可以稍后重试或者自费结算(不享受门诊统筹)!")
-                console.log(res);
-                //errorMesage(res);
-            }
-        },
-        error: function (XMLHttpRequest, textStatus, errorThrown) {
-            warningMesageSimaple("读卡异常,可以稍后重试或者自费结算(不享受门诊统筹)!")
+            });
+
+        }else {
+            errorMesage(sfzRes)
         }
-    });
+    })
 }
 
 
@@ -3129,6 +3131,7 @@ function mztczfSiReadCardTypeChange() {
  * 打开读卡类型弹窗
  */
 function mztczfSiReadCardTypeModel(patientId,times) {
+    addOrderLock(patientId,times,null)
     $("#readCardResult").val(null);
     readPatientId = patientId
     readTimes = times
@@ -3139,6 +3142,26 @@ function mztczfSiReadCardTypeModel(patientId,times) {
     $("#mztczfSiReadCardModal").modal();
 }
 
+/**
+ * 处方加锁
+ */
+function addOrderLock(patientId,times,receiptNo) {
+   postAjaxJsonHttpRequst("/thmz/addOrderLock",{patientId:patientId,times:times,receiptNo:receiptNo},true,function (res) {
+   })
+}
+
+/**
+ * 处方解锁
+ */
+function deleteOrderLock(patientId,times,receiptNo) {
+    postAjaxJsonHttpRequst("/thmz/deleteOrderLock",{patientId:patientId,times:times,receiptNo:receiptNo},true,function (res) {
+        if(res.code == 0){
+            successMesageSimaple('处方解锁成功')
+        }
+    })
+}
+
+
 /**
  * 医保结算
  * @param patientId

+ 7 - 0
src/main/resources/static/js/mz/unit_code.js

@@ -200,6 +200,11 @@ var TableInit = function () {
                     title: '就诊地点',
                     align: "center",
                     valign: 'middle',
+                }, {
+                    field: 'officePos1',
+                    title: '夜间门诊地点',
+                    align: "center",
+                    valign: 'middle',
                 }, {
                     field: 'ksZkl',
                     title: '科室折扣率',
@@ -544,6 +549,7 @@ function fillModel(code) {
                 // $("#xnhDeptNamePlus").val(res.data.xnhDeptName);
                 $("#unitNumPlus").val(res.data.unitNum);
                 $("#officePosPlus").val(res.data.officePos);
+                $("#officePosPlus1").val(res.data.officePos1);
                 $("#sortCodePlus").val(res.data.sortCode);
                 $("#ksZklPlus").val(res.data.ksZkl);
                 $("#deptDescribePlus").val(res.data.deptDescribe);
@@ -620,6 +626,7 @@ $(function () {
             // "xnhDeptCode": $("#xnhDeptCodePlus").val(),
             // "xnhDeptName": $("#xnhDeptNamePlus").val(),
             "officePos": $("#officePosPlus").val(),
+            "officePos1": $("#officePosPlus1").val(),
             "sortCode": $("#sortCodePlus").val(),
             "classCode": $("#classTypePlus").val(),
             "mzClass": $("#mzClassPlus").val(),

+ 42 - 16
src/main/resources/templates/mz/clinic.html

@@ -730,14 +730,25 @@
                                     </div>
                                 </div>
                                 <div class="item form-group">
-                                    <div style="width: 100%">
+                                    <div style="width: 256px;float: left;">
                                         <label class="my_label_2">医嘱:</label>
-                                        <div style="width: 340px;float: left;">
+                                        <div style="width: 200px; float: left">
                                             <select class="form-control selectpicker show-tick" data-live-search="true"
                                                     id="medicalAdvice" title="请选择">
                                             </select>
                                         </div>
                                     </div>
+                                    <div style="width: 130px;float: left;">
+                                        <label class="my_label_2">报销:</label>
+                                        <div style="width: 85px;float: left;">
+                                            <select class="form-control selectpicker show-tick"
+                                                    title="请选择"
+                                                    id="xyHospApprFlag">
+                                                <option value="0" selected>报销</option>
+                                                <option value="2">自费</option>
+                                            </select>
+                                        </div>
+                                    </div>
                                 </div>
                                 <div style="width: 100%;height: 22px;line-height: 22px;">
                                     <div style="float: left;display: inline-block;"><a
@@ -825,14 +836,25 @@
                                     </div>
                                 </div>
                                 <div class="item form-group">
-                                    <div style="width: 100%">
+                                    <div style="width: 256px;float: left">
                                         <label class="my_label_2">医嘱:</label>
-                                        <div style="width: 340px;float: left;">
+                                        <div style="width: 200px;float: left;">
                                             <select class="form-control selectpicker show-tick" data-live-search="true"
                                                     id="zyInstruction" title="请选择">
                                             </select>
                                         </div>
                                     </div>
+                                    <div style="width: 130px;float: left;">
+                                        <label class="my_label_2">报销:</label>
+                                        <div style="width: 85px;float: left;">
+                                            <select class="form-control selectpicker show-tick"
+                                                    title="请选择"
+                                                    id="zyHospApprFlag">
+                                                <option value="0" selected>报销</option>
+                                                <option value="2">自费</option>
+                                            </select>
+                                        </div>
+                                    </div>
                                 </div>
                                 <div style="width: 100%;height: 22px;line-height: 22px;">
                                     <div style="float: left;display: inline-block;"><a id="clearRegistration8"
@@ -1093,6 +1115,19 @@
                                                style="padding-left: 10px;width: 340px;" placeholder="请输入">
                                     </div>
                                 </div>
+                                <div class="item form-group">
+                                    <div style="width: 130px;float: left;">
+                                        <label class="my_label_2">报销:</label>
+                                        <div style="width: 85px;float: left;">
+                                            <select class="form-control selectpicker show-tick"
+                                                    title="请选择"
+                                                    id="zlHospApprFlag">
+                                                <option value="0" selected>报销</option>
+                                                <option value="2">自费</option>
+                                            </select>
+                                        </div>
+                                    </div>
+                                </div>
                                 <div style="width: 100%;height: 22px;line-height: 22px;">
                                     <div style="float: left;display: inline-block;"><a onclick="clearZlItem()"
                                                                                        style="cursor: pointer;font-size: 14px;color: #2e69eb!important;"><i
@@ -1383,7 +1418,7 @@
 
                 <!-- 读卡返回-->
                 <input type="hidden" id="readCardResult"/>
-                <div style="width: 130px;float: left;margin-right: 10px;height: 60px;" class="hide" id="zgmztczfDiv">
+                <div style="width: 130px;float: left;margin-right: 10px;height: 60px;"  id="zgmztczfDiv">
                     <label style="float: left;font-weight: 400;margin-bottom: -5px;">门诊统筹:</label>
                     <div style="width: 65px;float: left;">
                         <select class="form-control selectpicker show-tick"
@@ -1392,7 +1427,7 @@
                         </select>
                     </div>
                 </div>
-                <div style="width: 130px;float: left;margin-right: 10px;height: 60px;" class="hide" id="grzhzfDiv">
+                <div style="width: 130px;float: left;margin-right: 10px;height: 60px;" id="grzhzfDiv">
                     <label style="float: left;font-weight: 400;margin-bottom: -5px;">个账支付:</label>
                     <div style="width: 65px;float: left;">
                         <select class="form-control selectpicker show-tick"
@@ -1401,15 +1436,6 @@
                         </select>
                     </div>
                 </div>
-                <a id="mztczfSiReadCard" class="hide"
-                   style="cursor: pointer;color: #2e69eb !important;font-size: 14px;margin-right: 20px;"><i
-                        class="fa fa-barcode">&nbsp;医保电子凭证</i></a>
-                <a id="mztczfSiReadCardFace" class="hide"
-                   style="cursor: pointer;color: #2e69eb !important;font-size: 14px;margin-right: 20px;"><i
-                        class="fa fa-github-alt">&nbsp;医保刷脸</i></a>
-                <a id="expContentRequired" class="hide"
-                   style="cursor: pointer;color: #2e69eb !important;font-size: 14px;margin-right: 20px;"><i
-                        class="fa fa-paperclip">&nbsp;额外内容</i></a>
                 <button type="button" class="btn btn-primary"
                         style="height: 30px;line-height: 15px;" onclick="savePrescription()"><i
                         class="fa fa-save">&nbsp;&nbsp;</i>保存处方
@@ -2050,7 +2076,7 @@
                 <button type="button" class="btn btn-primary hide" id="printJyReq">打印检验申请单</button>
                 <button type="button" class="btn btn-primary hide" id="printPrescription">打印处方、门诊指引单</button>
                 <button type="button" class="btn btn-primary hide" id="callPrescription">调用</button>
-                <button type="button" class="btn btn-primary hide" id="showMzBlRecordModal">病历编辑</button>
+                <button type="button" class="btn btn-primary hide" id="showMzBlRecordModal">修改病历</button>
                 <button type="button" class="btn btn-primary hide" id="previewYjReq">检查检验报告</button>
                 <button type="button" class="btn btn-primary hide" id="previewYjReqAll">检查检验报告(含往期)</button>
                 <button type="button" class="btn btn-primary" id="previewBlbg">病理报告</button>

+ 8 - 0
src/main/resources/templates/mz/unit_code.html

@@ -141,6 +141,14 @@
                                            class="form-control col-md-7 col-xs-12">
                                 </div>
                             </div>
+                            <div class="item form-group">
+                                <label class="control-label col-md-3 col-sm-3 col-xs-12" for="officePosPlus1">夜间门诊地点
+                                </label>
+                                <div class="col-md-6 col-sm-6 col-xs-12">
+                                    <input type="text" id="officePosPlus1"
+                                           class="form-control col-md-7 col-xs-12">
+                                </div>
+                            </div>
                             <div class="item form-group">
                                 <label class="control-label col-md-3 col-sm-3 col-xs-12" for="sortCodePlus">排序码
                                 </label>