소스 검색

上传日志,结算单优化

lihong 1 년 전
부모
커밋
352815335f

+ 5 - 3
src/main/java/thyyxxk/webserver/dao/his/medicalinsurance/AutoUploadBillDao.java

@@ -42,15 +42,16 @@ public interface AutoUploadBillDao extends BaseMapper<AutoUploadBill> {
             )
     Date getLastUpdateTime(@Param("patNo") String patNo, @Param("times")Integer times, @Param("ledgerSn")Integer ledgerSn);
     @Select("select top ${pageSize} *  from ("+
-            " select     row_number() over (order by t1.created_date) as rowNumber,  " +
-            "  t1.*," +
+            " select     row_number() over (order by t1.created_date desc) as rowNumber,  " +
+            "  t1.id, t1.pat_no, t1.times, t1.ledger_sn, t1.log_text, t1.created_date, t1.upload_date, t1.type_flag, t1.flag, t1.setl_time, t1.upload_code, t1.upload_name ,t4.insuplc_admdvs,t4.psn_name,t4.med_type,t4.clr_optins,clr_optins_name = (select name from t_region where code=t4.clr_optins), " +
             "    out_dept_name=(select rtrim(name) from zd_unit_code where code = isnull(t2.zk_ward, t2.small_dept))," +
             "                  rtrim(isnull(t2.zk_ward, t2.small_dept)) as out_dept " +
             " from t_auto_upload_bill t1" +
+            " join t_si_setlinfo t4 on t1.pat_no = t4.pat_no and t1.times = t4.times and t1.ledger_sn=t4.ledger_sn and t4.revoked =0 " +
             "   ${condition} "+
             "         left join zy_inactpatient t2 on t1.pat_no = t2.inpatient_no and t1.times = t2.admiss_times" +
             " where  ${ew.sqlSegment}"+
-            " )temp where rowNumber > ${pageSize} * (${currentPage} - 1)  order by created_date desc"
+            " )temp where rowNumber > ${pageSize} * (${currentPage} - 1)  order by created_date desc "
             )
    List<AutoUploadBill> listPage(@Param("ew")QueryWrapper<AutoUploadBill> query,
                                  @Param("currentPage") long currentPage,
@@ -59,6 +60,7 @@ public interface AutoUploadBillDao extends BaseMapper<AutoUploadBill> {
     );
 
     @Select("select count(1)  from t_auto_upload_bill t1  " +
+            " join t_si_setlinfo t4 on t1.pat_no = t4.pat_no and t1.times = t4.times and t1.ledger_sn=t4.ledger_sn and t4.revoked =0 " +
             " ${condition} "+
             "                 left join zy_inactpatient t2 on t1.pat_no = t2.inpatient_no and t1.times = t2.admiss_times " +
             "   where  ${ew.sqlSegment}")

+ 1 - 1
src/main/java/thyyxxk/webserver/dao/his/medicalinsurance/UpIdCollectionDao.java

@@ -355,7 +355,7 @@ public interface UpIdCollectionDao extends BaseMapper<SetlinfoUpld> {
 
     @Select("select top ${pageSize} * from (" +
             "select " +
-            "row_number() over (order by CURRENT_TIMESTAMP) as rowNumber," +
+            "row_number() over (order by setl_time) as rowNumber," +
             "rtrim(a.pat_no) pat_no,a.age,a.times,ledger_sn,psn_name,gend,brdy,insutype,psn_type,mdtrt_id,setl_id,setl_time, " +
             "       a.med_type,medfee_sumamt,fund_pay_sumamt, case when b.dis_date is null then a.endtime else b.dis_date end dis_date, a.hi_paymtd," +
             "       acct_pay,psn_cash_pay,clr_optins,clr_optins_name = (select name from t_region where code=clr_optins), " +

+ 18 - 0
src/main/java/thyyxxk/webserver/entity/querydata/AutoUploadBill.java

@@ -89,6 +89,24 @@ public class AutoUploadBill implements Serializable {
      */
     @TableField(exist = false)
     private long pageSize;
+    @TableField(exist = false)
+    private String insuplcAdmdvs;
+    /**参保地*/
+    @TableField(exist = false)
+    private String insuplcAdmdvsName;
+    /**姓名*/
+    @TableField(exist = false)
+    private String psnName;
+    /**医疗类别*/
+    @TableField(exist = false)
+    private String medType;
+    @TableField(exist = false)
+    private String medTypeName;
+    /**清算机构*/
+    @TableField(exist = false)
+    private String clrOptins;
+    @TableField(exist = false)
+    private String clrOptinsName;
 
 
     public enum TypeFlag {

+ 19 - 0
src/main/java/thyyxxk/webserver/service/medicalinsurance/AutoUploadBillService.java

@@ -7,11 +7,14 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.scheduling.annotation.Async;
 import org.springframework.stereotype.Service;
+import thyyxxk.webserver.constants.sidicts.MedType;
 import thyyxxk.webserver.dao.his.medicalinsurance.AutoUploadBillDao;
 import thyyxxk.webserver.entity.querydata.AutoUploadBill;
+import thyyxxk.webserver.service.redislike.RedisLikeService;
 import thyyxxk.webserver.utils.ListUtil;
 import thyyxxk.webserver.utils.StringUtil;
 
+import javax.annotation.Resource;
 import java.util.Date;
 import java.util.List;
 import java.util.stream.Collectors;
@@ -23,6 +26,8 @@ import java.util.stream.Collectors;
  */
 @Service
 public class AutoUploadBillService extends ServiceImpl<AutoUploadBillDao,AutoUploadBill> {
+    @Resource
+    private RedisLikeService redisLikeService;
     @Async
     public void asyncSaveData(List<AutoUploadBill> list){
         if(CollUtil.isNotEmpty(list)){
@@ -60,6 +65,20 @@ public class AutoUploadBillService extends ServiceImpl<AutoUploadBillDao,AutoUpl
             condition =" join  (select pat_no,times,ledger_sn ,max(created_date) created_date from t_auto_upload_bill group by pat_no,times,ledger_sn)t3 on t1.pat_no=t3.pat_no and t1.times=t3.times and t1.ledger_sn=t3.ledger_sn and t1.created_date=t3.created_date ";
         }
         List<AutoUploadBill> records = baseMapper.listPage(query, autoUploadBill.getCurrentPage(), autoUploadBill.getPageSize(),condition);
+        for(AutoUploadBill item : records){
+            item.setInsuplcAdmdvsName(redisLikeService.getRegionName(item.getInsuplcAdmdvs()));
+            if(item.getClrOptinsName() == null){
+                if("439900".equals(item.getClrOptins())){
+                    item.setClrOptinsName("省本级");
+                }else if("430199".equals(item.getClrOptins())){
+                    item.setClrOptinsName("市本级");
+                }
+            }
+            MedType medType = MedType.get(item.getMedType());
+            if (null != medType) {
+                item.setMedTypeName(medType.getName());
+            }
+        }
         page.setRecords(records);
         Integer total = baseMapper.pageTotal(query,condition);
         page.setTotal(total);