dev
This commit is contained in:
parent
9858ed6ca3
commit
2e467405a2
|
|
@ -78,8 +78,7 @@ public class ChargeController extends BaseController {
|
|||
@RequestMapping("/getOrderByDiagnosisCode")
|
||||
public Result<ChargeOrder> getOrderByDiagnosisCode() {
|
||||
String diagnosisCode = parmsUtil.getString("diagnosisCode","诊断code不能为空");
|
||||
Integer status = parmsUtil.getInteger("status","诊断状态不能为空");
|
||||
ChargeOrder chargeOrder = chargeService.getOrderByDiagnosisCode(diagnosisCode,status);
|
||||
ChargeOrder chargeOrder = chargeService.getOrderByDiagnosisCode(diagnosisCode);
|
||||
|
||||
return success(chargeOrder);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,14 +15,20 @@ public class ReconciliationItemVo {
|
|||
// 经办机构
|
||||
private String handlingInstitution;
|
||||
// 医疗费用总额
|
||||
private BigDecimal totalMedicalCost = BigDecimal.ZERO;
|
||||
private BigDecimal totalMedicalCost ;
|
||||
// 基金支付总额
|
||||
private BigDecimal totalFundPayment = BigDecimal.ZERO;
|
||||
private BigDecimal totalFundPayment ;
|
||||
// 个账支付总额
|
||||
private BigDecimal totalPersonalAccountPayment = BigDecimal.ZERO;
|
||||
private BigDecimal totalPersonalAccountPayment ;
|
||||
// 结算笔数
|
||||
private Integer settlementCount;
|
||||
// 对账结果
|
||||
private String reconciliationResult;
|
||||
|
||||
public ReconciliationItemVo() {
|
||||
this.settlementCount = 0;
|
||||
this.totalMedicalCost = BigDecimal.ZERO;
|
||||
this.totalFundPayment = BigDecimal.ZERO;
|
||||
this.totalPersonalAccountPayment = BigDecimal.ZERO;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -412,6 +412,8 @@ public class ChargeService extends BaseService {
|
|||
this.recordChargeLog(order, ChargeSourceEnum.CHARGE, ChargeTypeEnum.CHARGE);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void uploadCostDetails(String changeOrderCode) {
|
||||
|
|
@ -995,13 +997,11 @@ public class ChargeService extends BaseService {
|
|||
/**
|
||||
* 根据诊断id和状态查询订单
|
||||
* @param diagnosisCode
|
||||
* @param status
|
||||
* @return
|
||||
*/
|
||||
public ChargeOrder getOrderByDiagnosisCode(String diagnosisCode, Integer status) {
|
||||
public ChargeOrder getOrderByDiagnosisCode(String diagnosisCode) {
|
||||
QueryWrapper<ChargeOrder> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("diagnosis_code",diagnosisCode);
|
||||
queryWrapper.eq("status",status);
|
||||
queryWrapper.last("limit 1");
|
||||
return chargeOrderMapper.selectOne(queryWrapper);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,10 +36,7 @@ import java.io.FileWriter;
|
|||
import java.io.IOException;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
|
|
@ -59,14 +56,18 @@ public class SocialReconciliationService extends BaseService {
|
|||
@Autowired
|
||||
private HttpUtil httpUtil;
|
||||
|
||||
|
||||
public List<ReconciliationItemVo> getList(LocalDateTime beginTime, LocalDateTime endTime) {
|
||||
|
||||
|
||||
|
||||
QueryWrapper<ChargeSocialPayLog> clrQuery = new QueryWrapper<>();
|
||||
clrQuery.select("clr_type,insutype,clr_optins,count(0) as count");
|
||||
clrQuery.groupBy("clr_type", "insutype", "clr_optins");
|
||||
clrQuery.ge("setl_time", beginTime);
|
||||
clrQuery.le("setl_time", endTime);
|
||||
List<Map<String, Object>> mapList = chargeSocialPayLogMapper.selectMaps(clrQuery);
|
||||
List<ReconciliationItemVo> voList = new ArrayList<>();
|
||||
List<ReconciliationItemVo> voList = initReconciliationList();
|
||||
for (Map<String, Object> item : mapList) {
|
||||
if (item.get("clr_type") == null || item.get("insutype") == null) {
|
||||
continue;
|
||||
|
|
@ -91,11 +92,36 @@ public class SocialReconciliationService extends BaseService {
|
|||
vo.setTotalFundPayment(log.getFundPaySumamt().add(vo.getTotalFundPayment()));
|
||||
vo.setTotalPersonalAccountPayment(log.getAcctPay().add(vo.getTotalPersonalAccountPayment()));
|
||||
}
|
||||
voList.add(vo);
|
||||
reconciliationListAdd(voList,vo);
|
||||
}
|
||||
return voList;
|
||||
}
|
||||
|
||||
private List<ReconciliationItemVo> initReconciliationList (){
|
||||
List<String> initReconciliation = Arrays.asList("99959", "99952");
|
||||
List<String> iniInsurance = Arrays.asList("310", "390");
|
||||
|
||||
List<ReconciliationItemVo> voList = new ArrayList<>();
|
||||
for (String reconcil : initReconciliation){
|
||||
for (String insurance : iniInsurance){
|
||||
ReconciliationItemVo vo = new ReconciliationItemVo();
|
||||
vo.setReconciliationType(reconcil);
|
||||
vo.setInsuranceType(insurance);
|
||||
vo.setHandlingInstitution(config.get("social","mdtrtareaAdmvs"));
|
||||
voList.add(vo);
|
||||
}
|
||||
}
|
||||
return voList;
|
||||
|
||||
}
|
||||
private void reconciliationListAdd(List<ReconciliationItemVo> voList,ReconciliationItemVo vo){
|
||||
voList.removeIf(item -> item.getInsuranceType().equals(vo.getInsuranceType())
|
||||
&& item.getReconciliationType().equals(vo.getReconciliationType())
|
||||
&& item.getHandlingInstitution().equals(vo.getHandlingInstitution()));
|
||||
voList.add(vo);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 对总账
|
||||
*
|
||||
|
|
|
|||
Loading…
Reference in New Issue