瀏覽代碼

增加医技确费接口

hurugang 3 年之前
父節點
當前提交
5a55f5eb9d

+ 27 - 0
src/main/java/cn/hnthyy/thmz/controller/api/MedicalViewApiController.java

@@ -2514,4 +2514,31 @@ public class MedicalViewApiController {
     }
 
 
+
+    /**
+     * 医技申请确认费用
+     *
+     * @return
+     */
+    @RequestMapping(value = "/confirmYjReqFlag", method = {RequestMethod.GET})
+    public Map<String, Object> confirmYjReqFlag(@RequestParam("flag") String flag,@RequestParam("opId") String opId,@RequestParam("reqNo") Integer reqNo) {
+        Map<String, Object> resultMap = new HashMap<>();
+        try {
+            mzChargeDetailService.modifyReceiveFlagAndConfirmFlag(flag,opId,reqNo);
+            resultMap.put("code", 0);
+            resultMap.put("message", "医技申请确认费用成功");
+            return resultMap;
+        } catch (MzException me) {
+            resultMap.put("code", -1);
+            resultMap.put("message", me.getMessage());
+            return resultMap;
+        }catch (Exception e) {
+            log.error("信息查询失败,错误信息{}", e);
+            resultMap.put("code", -1);
+            resultMap.put("message", "信息查询失败");
+            return resultMap;
+        }
+    }
+
+
 }

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

@@ -1041,4 +1041,16 @@ public interface MzChargeDetailMapper {
      */
     @Update("update ${tableName} set group_id=0 where serial_no=#{serialNo} and group_no = '00' ")
     int updateYjGroupId(@Param("tableName") String tableName,@Param("serialNo") Integer serialNo);
+
+    /**
+     * 医技申请确认费用
+     * @param flag 1:医技已接收 =2:结果已返回
+     * @param opId 操作人ID
+     * @param confirmTime 确认时间
+     * @param reqNo 申请单号
+     * @return
+     */
+    @Update("update mz_charge_detail set receive_flag=#{flag},confirm_flag=#{flag},confirm_id=#{opId},confirm_time=#{confirmTime},exec_dept=isnull(exec_dept,'2010000')" +
+            "where  req_no = #{reqNo} ")
+    int updateReceiveFlagAndConfirmFlag(@Param("flag") String flag, @Param("opId") String opId, @Param("confirmTime") Date confirmTime,@Param("reqNo") Integer reqNo);
 }

+ 14 - 0
src/main/java/cn/hnthyy/thmz/mapper/his/mz/MzYjReqMapper.java

@@ -3,6 +3,7 @@ package cn.hnthyy.thmz.mapper.his.mz;
 import cn.hnthyy.thmz.entity.his.mz.MzYjReq;
 import org.apache.ibatis.annotations.*;
 
+import java.util.Date;
 import java.util.List;
 import java.util.Map;
 
@@ -283,4 +284,17 @@ public interface MzYjReqMapper {
             , "</script>"})
     List<MzYjReq> selectReqNameByPatientIdAndReqDateWithPage(MzYjReq mzYjReq);
 
+
+    /**
+     * 医技申请确认费用
+     * @param flag 1:医技已接收 =2:结果已返回
+     * @param opId 操作人ID
+     * @param confirmTime 确认时间
+     * @param reqNo 申请单号
+     * @return
+     */
+    @Update("update mz_yj_req set receive_flag=#{flag},confirm_flag=#{flag},confirm_id=#{opId},confirm_time=#{confirmTime},exec_dept=isnull(exec_dept,'2010000')" +
+            "where  req_no = #{reqNo}")
+    int updateReceiveFlagAndConfirmFlag(@Param("flag") String flag, @Param("opId") String opId, @Param("confirmTime") Date confirmTime,@Param("reqNo") Integer reqNo);
+
 }

+ 10 - 0
src/main/java/cn/hnthyy/thmz/service/his/mz/MzChargeDetailService.java

@@ -401,4 +401,14 @@ public interface MzChargeDetailService {
      * @throws MzException
      */
     void setFullMzPrescriptionVo(MzPrescriptionVo mzPrescriptionVo, boolean needPatient,Boolean needVerify) throws MzException;
+
+
+    /**
+     * 医技申请确认费用
+     * @param flag
+     * @param opId
+     * @param reqNo
+     * @return
+     */
+    int modifyReceiveFlagAndConfirmFlag(String flag, String opId,Integer reqNo) throws MzException;
 }

+ 26 - 8
src/main/java/cn/hnthyy/thmz/service/impl/his/mz/MzChargeDetailServiceImpl.java

@@ -270,7 +270,7 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
         returnMzChargeDetail.setAmount(BigDecimal.ZERO);
         returnMzChargeDetail.setNotDiscountAmount(BigDecimal.ZERO);
         for (MzChargeDetail md : mzChargeDetails) {
-            if(md==null){
+            if (md == null) {
                 continue;
             }
             if (StringUtils.isBlank(returnMzChargeDetail.getName())) {
@@ -512,7 +512,7 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
                     for (int i = 0; i < first.size(); i++) {
                         MzChargeDetail tempMzChargeDetail = first.get(i);
                         ZdChargeItem zdChargeItem = (ZdChargeItem) zdChargeItemMap.get(tempMzChargeDetail.getChargeItemCode());
-                        if(zdChargeItem==null || StringUtils.isBlank(zdChargeItem.getAuditCode())){
+                        if (zdChargeItem == null || StringUtils.isBlank(zdChargeItem.getAuditCode())) {
                             continue;
                         }
                         if (!Constants.AUDIT_ITEM_DR.equals(zdChargeItem.getAuditCode())) {
@@ -543,7 +543,7 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
                         for (int i = 0; i < secondTempMzChargeDetailList.size(); i++) {
                             MzChargeDetail tempMzChargeDetail = secondTempMzChargeDetailList.get(i);
                             ZdChargeItem zdChargeItem = (ZdChargeItem) zdChargeItemMap.get(tempMzChargeDetail.getChargeItemCode());
-                            if(zdChargeItem==null || StringUtils.isBlank(zdChargeItem.getAuditCode())){
+                            if (zdChargeItem == null || StringUtils.isBlank(zdChargeItem.getAuditCode())) {
                                 continue;
                             }
                             if (!Constants.AUDIT_ITEM_DR.equals(zdChargeItem.getAuditCode())) {
@@ -622,7 +622,7 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
             Set<String> hasHandle = new HashSet<>();
             MzChargeDetail mzChargeDetail = new MzChargeDetail();
             for (Map<String, Object> map : unPaidChargeDetails) {
-                if(map==null){
+                if (map == null) {
                     continue;
                 }
                 String key = map.get("patient_id") + "-" + map.get("times");
@@ -651,7 +651,7 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
 
     @Override
     @Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.DEFAULT, timeout = 36000, rollbackFor = Exception.class)
-    public int chargeFee(String opId, MzDepositFileVo mzDepositFileVo,String ipAddress) throws MzException {
+    public int chargeFee(String opId, MzDepositFileVo mzDepositFileVo, String ipAddress) throws MzException {
         Windows windows = windowsMapper.selectLastWindowsByIpAddress(ipAddress);
         if (windows == null) {
             throw new MzException("当前操作人未设置窗口号,请先设置!");
@@ -693,7 +693,7 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
                 if (Constants.YBJZ.equals(m.getChequeType())) {
                     PayInfo payInfo = tsmzService.calculateCost(opId, mzDepositFileVo.getPatientId(), mzDepositFileVo.getTimes(), receiptNo);
                     if (payInfo == null) {
-                        throw new MzException("特门费用结算失败,错误原因:获取特门费用失败" );
+                        throw new MzException("特门费用结算失败,错误原因:获取特门费用失败");
                     }
                     if (payInfo.getCode() == -1) {
                         throw new MzException("特门费用结算失败,错误原因:" + payInfo.getErrorMessage());
@@ -1988,7 +1988,7 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
             mzZyReq.setReqWard(mzZyReq.getReqDept());
             mzZyReq.setIcdCode(mzPrescriptionVo.getIcdCode());
             mzZyReq.setIcdText(mzPrescriptionVo.getIcdText());
-            if(StringUtils.isBlank(mzZyReq.getIcdText())){
+            if (StringUtils.isBlank(mzZyReq.getIcdText())) {
                 mzZyReq.setIcdText(mzPrescriptionVo.getMzBlRecord().getTentativeDiagnosis());
             }
             if (mzZyReq.getIcdCode() == null) {
@@ -2016,6 +2016,24 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
         }
     }
 
+    @Override
+    @Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.DEFAULT, timeout = 36000, rollbackFor = Exception.class)
+    public int modifyReceiveFlagAndConfirmFlag(String flag, String opId, Integer reqNo) throws MzException {
+        if(StringUtils.isBlank(flag)){
+            throw new MzException("确认标志不能为空");
+        }
+        if(StringUtils.isBlank(opId)){
+            throw new MzException("确认人ID不能为空");
+        }
+        if(reqNo==null){
+            throw new MzException("申请单号不能为空");
+        }
+        Date now = new Date();
+        mzYjReqMapper.updateReceiveFlagAndConfirmFlag(flag, opId, now, reqNo);
+        mzChargeDetailMapper.updateReceiveFlagAndConfirmFlag(flag, opId, now, reqNo);
+        return 0;
+    }
+
 
     @Override
     public Clinic nucleicAcidApplication(String patientId) throws MzException {
@@ -2733,7 +2751,7 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
 
     @Override
     @Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.DEFAULT, timeout = 36000, rollbackFor = Exception.class)
-    public int refundFee(String opId, MzDepositFileVo mzDepositFileVo,String ipAddress) throws MzException {
+    public int refundFee(String opId, MzDepositFileVo mzDepositFileVo, String ipAddress) throws MzException {
         Windows windows = windowsMapper.selectLastWindowsByIpAddress(ipAddress);
         if (windows == null) {
             throw new MzException("当前操作人未设置窗口号,请先设置!");