|
|
@@ -1,10 +1,17 @@
|
|
|
package cn.hnthyy.thmz.controller.api;
|
|
|
|
|
|
|
|
|
-import cn.hnthyy.thmz.Utils.*;
|
|
|
+import cn.hnthyy.thmz.Utils.AddressResolutionUtil;
|
|
|
+import cn.hnthyy.thmz.Utils.AssertUtil;
|
|
|
+import cn.hnthyy.thmz.Utils.CloneUtil;
|
|
|
+import cn.hnthyy.thmz.Utils.DateUtil;
|
|
|
+import cn.hnthyy.thmz.Utils.HttpUtil;
|
|
|
+import cn.hnthyy.thmz.Utils.JsonUtil;
|
|
|
+import cn.hnthyy.thmz.Utils.NumberToCN;
|
|
|
+import cn.hnthyy.thmz.Utils.R;
|
|
|
+import cn.hnthyy.thmz.Utils.TokenUtil;
|
|
|
import cn.hnthyy.thmz.common.Constants;
|
|
|
import cn.hnthyy.thmz.common.exception.BizException;
|
|
|
-import cn.hnthyy.thmz.common.validate.ValidatorUtils;
|
|
|
import cn.hnthyy.thmz.entity.MzException;
|
|
|
import cn.hnthyy.thmz.entity.haici.HaiciCharge;
|
|
|
import cn.hnthyy.thmz.entity.haici.Haicipat;
|
|
|
@@ -14,8 +21,18 @@ import cn.hnthyy.thmz.entity.his.zd.ZdMzClass;
|
|
|
import cn.hnthyy.thmz.entity.his.zd.ZdUnitCode;
|
|
|
import cn.hnthyy.thmz.entity.his.zy.ZyActpatient;
|
|
|
import cn.hnthyy.thmz.entity.his.zy.ZyDepositFile;
|
|
|
-import cn.hnthyy.thmz.entity.thmz.*;
|
|
|
-import cn.hnthyy.thmz.enums.*;
|
|
|
+import cn.hnthyy.thmz.entity.thmz.Clinic;
|
|
|
+import cn.hnthyy.thmz.entity.thmz.Config;
|
|
|
+import cn.hnthyy.thmz.entity.thmz.DiscountVo;
|
|
|
+import cn.hnthyy.thmz.entity.thmz.HybirdTest;
|
|
|
+import cn.hnthyy.thmz.entity.thmz.PayInfo;
|
|
|
+import cn.hnthyy.thmz.entity.thmz.TcRefundFeeVo;
|
|
|
+import cn.hnthyy.thmz.entity.thmz.User;
|
|
|
+import cn.hnthyy.thmz.entity.thmz.WhiteList;
|
|
|
+import cn.hnthyy.thmz.enums.ConfirmFlagEnum;
|
|
|
+import cn.hnthyy.thmz.enums.GenderEnum;
|
|
|
+import cn.hnthyy.thmz.enums.PayMarkEnum;
|
|
|
+import cn.hnthyy.thmz.enums.YesNoEnum;
|
|
|
import cn.hnthyy.thmz.pageDto.MzChargeDetailPageDto;
|
|
|
import cn.hnthyy.thmz.pageDto.MzyReqrecPageDto;
|
|
|
import cn.hnthyy.thmz.pageDto.ZdUnitCodePageDto;
|
|
|
@@ -28,8 +45,18 @@ import cn.hnthyy.thmz.service.his.zd.ZdUnitCodeService;
|
|
|
import cn.hnthyy.thmz.service.his.zy.APatientMiService;
|
|
|
import cn.hnthyy.thmz.service.his.zy.ZyActpatientService;
|
|
|
import cn.hnthyy.thmz.service.his.zy.ZyDepositFileService;
|
|
|
-import cn.hnthyy.thmz.service.thmz.*;
|
|
|
-import cn.hnthyy.thmz.vo.*;
|
|
|
+import cn.hnthyy.thmz.service.thmz.ClinicService;
|
|
|
+import cn.hnthyy.thmz.service.thmz.ConfigService;
|
|
|
+import cn.hnthyy.thmz.service.thmz.HybirdTestService;
|
|
|
+import cn.hnthyy.thmz.service.thmz.TsmzService;
|
|
|
+import cn.hnthyy.thmz.service.thmz.UserService;
|
|
|
+import cn.hnthyy.thmz.service.thmz.WhiteListService;
|
|
|
+import cn.hnthyy.thmz.vo.MzDepositFileVo;
|
|
|
+import cn.hnthyy.thmz.vo.MzPrescriptionVo;
|
|
|
+import cn.hnthyy.thmz.vo.MzReceiptSerialVo;
|
|
|
+import cn.hnthyy.thmz.vo.PageViewVo;
|
|
|
+import cn.hnthyy.thmz.vo.SfjkMzbrmxVo;
|
|
|
+import cn.hnthyy.thmz.vo.SfjkMzbrxxVo;
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
import cn.hutool.core.convert.Convert;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
@@ -37,13 +64,26 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.dao.DataIntegrityViolationException;
|
|
|
-import org.springframework.web.bind.annotation.*;
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestBody;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import java.math.BigDecimal;
|
|
|
-import java.text.SimpleDateFormat;
|
|
|
-import java.util.*;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.Arrays;
|
|
|
+import java.util.Calendar;
|
|
|
+import java.util.Date;
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.HashSet;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+import java.util.Set;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
@RestController
|
|
|
@@ -103,7 +143,7 @@ public class MedicalViewApiController {
|
|
|
@Autowired
|
|
|
private RegionService regionService;
|
|
|
@Resource
|
|
|
- private ShareholderCardService shareholderCardService;
|
|
|
+ private MzOrderDetailService mzOrderDetailService;
|
|
|
|
|
|
//海慈身份证类型
|
|
|
private static final String ID_CARD_TYPE = "11";
|
|
|
@@ -590,30 +630,31 @@ 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;
|
|
|
}
|
|
|
+ // 0 普通门诊统筹处方 1 自费处方 2 门特处方
|
|
|
+ Integer vipFlag = 1;
|
|
|
if(clinic == null){
|
|
|
- clinic = clinicService.queryByPatientIdAndTimesAndReceiptNo(mzChargeDetail.getPatientId(), mzChargeDetail.getTimes(), 0);
|
|
|
+ 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);
|
|
|
+ if(clinic != null){
|
|
|
+ vipFlag = Convert.toInt(clinic.getZgmztczf(),0) == 0 ? 1 : 0;
|
|
|
+ }
|
|
|
+ MzOrderDetail mzOrderDetail = mzOrderDetailService.queryByPatientIdAndTimes(mzChargeDetail.getPatientId(), mzChargeDetail.getTimes());
|
|
|
+ if(mzOrderDetail != null){
|
|
|
+ if(Convert.toInt(mzOrderDetail.getOrderType(),1) == 1){
|
|
|
+ vipFlag = 1;
|
|
|
+ }else if(Convert.toInt(mzOrderDetail.getOrderType(),1) == 2){
|
|
|
+ vipFlag = 0;
|
|
|
+ }else if(Convert.toInt(mzOrderDetail.getOrderType(),1) == 3){
|
|
|
+ vipFlag = 2;
|
|
|
}
|
|
|
- }else if(clinic != null && Convert.toInt(clinic.getZgmztczf(),0) == 0){
|
|
|
- map.put("vipFlag", 1);
|
|
|
- }else {
|
|
|
- map.put("vipFlag", 2);
|
|
|
}
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
+ map.put("vipFlag", vipFlag);
|
|
|
map.put("hisOrdNum", mzChargeDetail.getPatientId() + "_" + mzChargeDetail.getTimes() + "_" + mzChargeDetail.getReceiptNo());
|
|
|
map.put("patName", mzChargeDetail.getName());
|
|
|
map.put("payName", "");
|