浏览代码

门特结算和取消结算加强操作员验证。

lighter 4 年之前
父节点
当前提交
8c6ca8e419

+ 3 - 3
src/main/java/thyyxxk/webserver/dao/his/markmtfees/MarkMtFeesDao.java

@@ -101,9 +101,9 @@ public interface MarkMtFeesDao {
     MzVisit selectMzVisit(@Param("patientId") String patientId,
                           @Param("times") Integer times);
 
-    @Select("select top 1 responce_type from mt_part_info where patient_id=#{patientId} and times=#{times}")
-    String selectResponceType(@Param("patientId") String patientId,
-                              @Param("times") Integer times);
+    @Select("select top 1 * from mt_part_info where patient_id=#{patientId} and times=#{times}")
+    MtPartInfo selectMtPartInfo(@Param("patientId") String patientId,
+                                @Param("times") Integer times);
 
     @Select("select rtrim(name) from a_employee_mi where code=#{code}")
     String selectDoctorName(@Param("code") String code);

+ 1 - 0
src/main/java/thyyxxk/webserver/entity/markmtfees/MtPartInfo.java

@@ -20,4 +20,5 @@ public class MtPartInfo {
 	private String thirdIcdCode;
 	private String mzSerialNo;
 	private String certificateNo;
+	private String staffId;
 }

+ 21 - 9
src/main/java/thyyxxk/webserver/service/markmtfees/MarkMtFeesService.java

@@ -316,15 +316,20 @@ public class MarkMtFeesService {
     public Map<String, Object> uploadMtFees(UploadMtFeeParam param) {
         log.info("上传门特费用:{}", param);
         Map<String, Object> resultMap = new HashMap<>(Capacity.TWO);
-        String responceType = dao.selectResponceType(param.getPatientId(), param.getTimes());
-        if (null == responceType) {
+        MtPartInfo mtPartInfo = dao.selectMtPartInfo(param.getPatientId(), param.getTimes());
+        if (null == mtPartInfo) {
             resultMap.put("code", -1);
             resultMap.put("msg", "未查询到此人的门特身份记录。");
             return resultMap;
         }
+        if (StringUtil.notBlank(mtPartInfo.getStaffId()) && StringUtil.notBlank(mtPartInfo.getCertificateNo())) {
+            resultMap.put("code", -1);
+            resultMap.put("msg", "此患者已存在有效的结算信息,请勿重复收费。");
+            return resultMap;
+        }
         String urlHead = YbLinksUtil.normalLinks.get("mtBase");
         String urlEnd;
-        if (responceType.equals(ResponceType.HUNAN_PROVINCIAL_MEDICAL_INSURANCE)) {
+        if (mtPartInfo.getResponceType().equals(ResponceType.HUNAN_PROVINCIAL_MEDICAL_INSURANCE)) {
             urlEnd = ":2000/shengyb/mt/uploadFees";
         } else {
             urlEnd = ":1000/mzsyb/mzCalculate";
@@ -339,15 +344,22 @@ public class MarkMtFeesService {
     public Map<String, Object> retractMtFees(UploadMtFeeParam param) {
         log.info("撤销门特费用:{}", param);
         Map<String, Object> resultMap = new HashMap<>(Capacity.TWO);
-        String responceType = dao.selectResponceType(param.getPatientId(), param.getTimes());
-        if (null == responceType) {
+        MtPartInfo mtPartInfo = dao.selectMtPartInfo(param.getPatientId(), param.getTimes());
+        if (null == mtPartInfo) {
             resultMap.put("code", -1);
             resultMap.put("msg", "未查询到此人的门特身份记录。");
             return resultMap;
         }
+        if (StringUtil.notBlank(mtPartInfo.getStaffId())) {
+            if (!mtPartInfo.getStaffId().trim().equals(param.getStaffId().trim())) {
+                resultMap.put("code", -1);
+                resultMap.put("msg", "您无法撤销其他操作员上传的费用。");
+                return resultMap;
+            }
+        }
         String urlHead = YbLinksUtil.normalLinks.get("mtBase");
         String urlEnd;
-        if (responceType.equals(ResponceType.HUNAN_PROVINCIAL_MEDICAL_INSURANCE)) {
+        if (mtPartInfo.getResponceType().equals(ResponceType.HUNAN_PROVINCIAL_MEDICAL_INSURANCE)) {
             urlEnd = ":2000/shengyb/mt/retractFees";
         } else {
             urlEnd = ":1000/mzsyb/mzCancelCalculate";
@@ -361,15 +373,15 @@ public class MarkMtFeesService {
     public Map<String, Object> calculateMtFees(UploadMtFeeParam param) {
         log.info("结算门特费用:{}", param);
         Map<String, Object> resultMap = new HashMap<>(Capacity.TWO);
-        String responceType = dao.selectResponceType(param.getPatientId(), param.getTimes());
-        if (null == responceType) {
+        MtPartInfo mtPartInfo = dao.selectMtPartInfo(param.getPatientId(), param.getTimes());
+        if (null == mtPartInfo) {
             resultMap.put("code", -1);
             resultMap.put("msg", "未查询到此人的门特身份记录。");
             return resultMap;
         }
         String urlHead = YbLinksUtil.normalLinks.get("mtBase");
         String urlEnd;
-        if (responceType.equals(ResponceType.HUNAN_PROVINCIAL_MEDICAL_INSURANCE)) {
+        if (mtPartInfo.getResponceType().equals(ResponceType.HUNAN_PROVINCIAL_MEDICAL_INSURANCE)) {
             urlEnd = ":2000/shengyb/mt/calculateCost";
         } else {
             urlEnd = ":1000/mzsyb/mzCalculate";