大病互助
This commit is contained in:
@@ -211,7 +211,7 @@ public class SickHelpImportController {
|
|||||||
sickHelp.setSchoolSecondSubsidyMoney(v.getEcbx());
|
sickHelp.setSchoolSecondSubsidyMoney(v.getEcbx());
|
||||||
sickHelp.setSelfPayMoney(v.getCalc());
|
sickHelp.setSelfPayMoney(v.getCalc());
|
||||||
return sickHelp;
|
return sickHelp;
|
||||||
}).filter(v -> v.getSelfPayMoney().compareTo(BigDecimal.valueOf(10000)) >= 0).collect(Collectors.toList());
|
}).filter(v -> v.getSelfPayMoney() != null && v.getSelfPayMoney().compareTo(BigDecimal.valueOf(10000)) >= 0).collect(Collectors.toList());
|
||||||
|
|
||||||
List<SickHelp> sickHelps = sickHelpImportService.checkData(collect);
|
List<SickHelp> sickHelps = sickHelpImportService.checkData(collect);
|
||||||
return Result.success(sickHelps);
|
return Result.success(sickHelps);
|
||||||
|
|||||||
@@ -78,8 +78,8 @@ public class SickHelpListController {
|
|||||||
@Ok("json:full")
|
@Ok("json:full")
|
||||||
@ViReturn
|
@ViReturn
|
||||||
@RequiresPermissions("sickHelp.list")
|
@RequiresPermissions("sickHelp.list")
|
||||||
public Object pageData(PageForm pageForm, Integer year, String subsidyUser, String unionId, String unitId, Integer isMember) {
|
public Object pageData(PageForm pageForm, Integer year, String subsidyUser, String unionId, String unitId, Integer isMember, Integer isMeetRequirements, Integer isAccept) {
|
||||||
return sickHelpListService.pageData(pageForm, year, subsidyUser, unionId, unitId,isMember);
|
return sickHelpListService.pageData(pageForm, year, subsidyUser, unionId, unitId, isMember, isMeetRequirements, isAccept);
|
||||||
}
|
}
|
||||||
|
|
||||||
@At
|
@At
|
||||||
@@ -251,6 +251,18 @@ public class SickHelpListController {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新是否接受补助
|
||||||
|
*/
|
||||||
|
@At
|
||||||
|
@Ok("json:full")
|
||||||
|
@ViReturn
|
||||||
|
public Object updateIsAccept(SickHelp sickHelp) {
|
||||||
|
dao.updateIgnoreNull(sickHelp);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 一键设置满足申请要求
|
* 一键设置满足申请要求
|
||||||
*
|
*
|
||||||
@@ -268,4 +280,21 @@ public class SickHelpListController {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 一键设置接受补助
|
||||||
|
*
|
||||||
|
* @param year 年度
|
||||||
|
* @return {@link Object}
|
||||||
|
*/
|
||||||
|
@At
|
||||||
|
@Ok("json:full")
|
||||||
|
@ViReturn
|
||||||
|
@RequiresAuthentication
|
||||||
|
public Object oneKeyUpdateIsAccept(Integer year) {
|
||||||
|
dao.update(SickHelp.class, Chain.make("isAccept", 1),
|
||||||
|
Cnd.where("year", "=", year).and("isMeetRequirements", "=", 1));
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ public interface SickHelpListService extends ViService<SickHelp> {
|
|||||||
* @param isMember 是成员
|
* @param isMember 是成员
|
||||||
* @return {@link Pagination}
|
* @return {@link Pagination}
|
||||||
*/
|
*/
|
||||||
Pagination pageData(PageForm pageForm, Integer year, String subsidyUser, String unionId, String unitId,Integer isMember);
|
Pagination pageData(PageForm pageForm, Integer year, String subsidyUser, String unionId, String unitId, Integer isMember, Integer isMeetRequirements, Integer isAccept);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -62,15 +62,15 @@ public class SickHelpImportServiceImpl extends ViServiceImpl<SickHelp> implement
|
|||||||
sick.setValidMsg(sick.getValidMsg());
|
sick.setValidMsg(sick.getValidMsg());
|
||||||
}
|
}
|
||||||
if(Lang.isEmpty(sick.getMedicalFourTotalMoney())){
|
if(Lang.isEmpty(sick.getMedicalFourTotalMoney())){
|
||||||
sick.getValidMsg().add("医保四项之和金额为空");
|
sick.getValidMsg().add("医保系统中个人自付、个人自理总金额为空");
|
||||||
sick.setValidMsg(sick.getValidMsg());
|
sick.setValidMsg(sick.getValidMsg());
|
||||||
}
|
}
|
||||||
if(Lang.isEmpty(sick.getSelfPayTotalMoney())){
|
if(Lang.isEmpty(sick.getSelfPayTotalMoney())){
|
||||||
sick.getValidMsg().add("两项自付之和金额为空");
|
sick.getValidMsg().add("医保系统中个人自付金额为空");
|
||||||
sick.setValidMsg(sick.getValidMsg());
|
sick.setValidMsg(sick.getValidMsg());
|
||||||
}
|
}
|
||||||
if(Lang.isEmpty(sick.getSchoolSecondSubsidyMoney())){
|
if(Lang.isEmpty(sick.getSchoolSecondSubsidyMoney())){
|
||||||
sick.getValidMsg().add("学校二次报销金额为空");
|
sick.getValidMsg().add("学校补充医疗保险报销金额为空");
|
||||||
sick.setValidMsg(sick.getValidMsg());
|
sick.setValidMsg(sick.getValidMsg());
|
||||||
}
|
}
|
||||||
if (Lang.isEmpty(sick.getSelfPayMoney())) {
|
if (Lang.isEmpty(sick.getSelfPayMoney())) {
|
||||||
@@ -127,7 +127,7 @@ public class SickHelpImportServiceImpl extends ViServiceImpl<SickHelp> implement
|
|||||||
|
|
||||||
//河海不一样
|
//河海不一样
|
||||||
if (StrUtil.isNotBlank(schoolCode) && "HHU".equals(schoolCode)) {
|
if (StrUtil.isNotBlank(schoolCode) && "HHU".equals(schoolCode)) {
|
||||||
sqlYear.setVar("Cnd", "AND isAccept = 1 AND stateCode = %d".formatted(SickHelpStateEnum.XGHTG.getStateCode()));
|
sqlYear.setVar("Cnd", "AND isMeetRequirements = 1 AND isAccept = 1");
|
||||||
}
|
}
|
||||||
|
|
||||||
Integer maxYear = (Integer) Daos.query(dao(), sqlYear.toString(), Sqls.callback.integer());
|
Integer maxYear = (Integer) Daos.query(dao(), sqlYear.toString(), Sqls.callback.integer());
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ public class SickHelpListServiceImpl extends ViServiceImpl<SickHelp> implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Pagination pageData(PageForm pageForm, Integer year, String subsidyUser, String unionId, String unitId, Integer isMember) {
|
public Pagination pageData(PageForm pageForm, Integer year, String subsidyUser, String unionId, String unitId, Integer isMember, Integer isMeetRequirements, Integer isAccept) {
|
||||||
Sql sql = Sqls.create("""
|
Sql sql = Sqls.create("""
|
||||||
SELECT
|
SELECT
|
||||||
sick.*,
|
sick.*,
|
||||||
@@ -65,6 +65,12 @@ public class SickHelpListServiceImpl extends ViServiceImpl<SickHelp> implements
|
|||||||
|
|
||||||
cnd.andEX("sfm.isMember", "=", isMember);
|
cnd.andEX("sfm.isMember", "=", isMember);
|
||||||
|
|
||||||
|
cnd.andEX("sick.isMeetRequirements", "=", isMeetRequirements);
|
||||||
|
|
||||||
|
if (isMeetRequirements != null && isMeetRequirements != 0) {
|
||||||
|
cnd.andEX("isAccept", "=", isAccept);
|
||||||
|
}
|
||||||
|
|
||||||
if (StrUtil.isNotBlank(subsidyUser)) {
|
if (StrUtil.isNotBlank(subsidyUser)) {
|
||||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||||
seg.orLike("sick.userName", subsidyUser);
|
seg.orLike("sick.userName", subsidyUser);
|
||||||
|
|||||||
@@ -87,6 +87,30 @@ layout("/layouts/platform.html"){
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="search-item">
|
||||||
|
<div class="search-item-label">是否符合:</div>
|
||||||
|
<div class="search-item-option">
|
||||||
|
<el-select clearable filterable style="width: 100%"
|
||||||
|
v-model="pageForm.isMeetRequirements">
|
||||||
|
<el-option label="全部" :value="null"></el-option>
|
||||||
|
<el-option label="是" :value="1"></el-option>
|
||||||
|
<el-option label="否" :value="0"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="search-item" v-if="pageForm.isMeetRequirements!==0">
|
||||||
|
<div class="search-item-label">是否接受:</div>
|
||||||
|
<div class="search-item-option">
|
||||||
|
<el-select clearable filterable style="width: 100%"
|
||||||
|
v-model="pageForm.isAccept">
|
||||||
|
<el-option label="全部" :value="null"></el-option>
|
||||||
|
<el-option label="是" :value="1"></el-option>
|
||||||
|
<el-option label="否" :value="0"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="search-query">
|
<div class="search-query">
|
||||||
<el-button @click="doSearch" icon="el-icon-search" type="primary">搜索</el-button>
|
<el-button @click="doSearch" icon="el-icon-search" type="primary">搜索</el-button>
|
||||||
</div>
|
</div>
|
||||||
@@ -99,6 +123,8 @@ layout("/layouts/platform.html"){
|
|||||||
<template #func>
|
<template #func>
|
||||||
<el-button @click="oneKeyUpdateIsMeetRequirements" size="small" type="primary">一键设为符合申请
|
<el-button @click="oneKeyUpdateIsMeetRequirements" size="small" type="primary">一键设为符合申请
|
||||||
</el-button>
|
</el-button>
|
||||||
|
<el-button @click="oneKeyUpdateIsAccept" size="small" type="primary">一键设为接受补助
|
||||||
|
</el-button>
|
||||||
|
|
||||||
<el-button @click="importHistoryData" size="small" type="primary">导入历史数据</el-button>
|
<el-button @click="importHistoryData" size="small" type="primary">导入历史数据</el-button>
|
||||||
|
|
||||||
@@ -140,6 +166,15 @@ layout("/layouts/platform.html"){
|
|||||||
v-model="row.isMeetRequirements">
|
v-model="row.isMeetRequirements">
|
||||||
</el-switch>
|
</el-switch>
|
||||||
</template>
|
</template>
|
||||||
|
<template scope="{row}" v-else-if="column.prop=='isAccept' ">
|
||||||
|
<el-switch
|
||||||
|
v-if="row.isMeetRequirements"
|
||||||
|
@change="(val)=>{isAcceptChange(row.id,val)}"
|
||||||
|
active-color="#13ce66"
|
||||||
|
inactive-color="#ff4949"
|
||||||
|
v-model="row.isAccept">
|
||||||
|
</el-switch>
|
||||||
|
</template>
|
||||||
<template scope="{row}" v-else-if="column.prop=='isMember'">
|
<template scope="{row}" v-else-if="column.prop=='isMember'">
|
||||||
<span v-if="row.isMember==true" class="text-success">是</span>
|
<span v-if="row.isMember==true" class="text-success">是</span>
|
||||||
<span v-if="row.isMember==false" class="text-danger">否</span>
|
<span v-if="row.isMember==false" class="text-danger">否</span>
|
||||||
@@ -237,9 +272,19 @@ layout("/layouts/platform.html"){
|
|||||||
{prop: 'unionName', label: '分工会', sortable: true, width: 150},
|
{prop: 'unionName', label: '分工会', sortable: true, width: 150},
|
||||||
{prop: 'unitName', label: '单位', sortable: true, width: 150},
|
{prop: 'unitName', label: '单位', sortable: true, width: 150},
|
||||||
|
|
||||||
{prop: 'medicalFourTotalMoney', label: '医保四项之和金额(元)', sortable: true, width: 200},
|
{
|
||||||
{prop: 'selfPayTotalMoney', label: '两项自付之和金额(元)', sortable: true, width: 200},
|
prop: 'medicalFourTotalMoney',
|
||||||
{prop: 'schoolSecondSubsidyMoney', label: '学校二次报销金额(元)', sortable: true, width: 200},
|
label: '医保系统中个人自付、个人自理总金额(元)',
|
||||||
|
sortable: true,
|
||||||
|
width: 200
|
||||||
|
},
|
||||||
|
{prop: 'selfPayTotalMoney', label: '医保系统中个人自付金额(元)', sortable: true, width: 200},
|
||||||
|
{
|
||||||
|
prop: 'schoolSecondSubsidyMoney',
|
||||||
|
label: '学校补充医疗保险报销金额(元)',
|
||||||
|
sortable: true,
|
||||||
|
width: 200
|
||||||
|
},
|
||||||
{prop: 'selfPayMoney', label: '个人支付金额(元)', sortable: true, width: 170},
|
{prop: 'selfPayMoney', label: '个人支付金额(元)', sortable: true, width: 170},
|
||||||
{prop: 'noLimitSubsidyMoney', label: '计算金额(元)', sortable: true, width: 150},
|
{prop: 'noLimitSubsidyMoney', label: '计算金额(元)', sortable: true, width: 150},
|
||||||
{prop: 'subsidyMoney', label: '补助金额(元)', sortable: true, width: 150},
|
{prop: 'subsidyMoney', label: '补助金额(元)', sortable: true, width: 150},
|
||||||
@@ -252,11 +297,14 @@ layout("/layouts/platform.html"){
|
|||||||
{prop: 'lastTimeSubsidyYear', label: '最近年度', sortable: true, width: 155},
|
{prop: 'lastTimeSubsidyYear', label: '最近年度', sortable: true, width: 155},
|
||||||
// {prop: 'subsidyDesc', label: '入会年限∕是否享受过补助', width: 220},
|
// {prop: 'subsidyDesc', label: '入会年限∕是否享受过补助', width: 220},
|
||||||
{prop: 'isMeetRequirements', label: '是否符合申请要求', width: 220},
|
{prop: 'isMeetRequirements', label: '是否符合申请要求', width: 220},
|
||||||
|
{prop: 'isAccept', label: '是否接受补助申请', width: 220}
|
||||||
],
|
],
|
||||||
pageForm: {
|
pageForm: {
|
||||||
year: (new Date().getFullYear() - 1).toString(),
|
year: (new Date().getFullYear() - 1).toString(),
|
||||||
isMember: null,
|
isMember: null,
|
||||||
unitName:''
|
unitName: '',
|
||||||
|
isMeetRequirements: null,
|
||||||
|
isAccept: null
|
||||||
},
|
},
|
||||||
unions: [],
|
unions: [],
|
||||||
units: [],
|
units: [],
|
||||||
@@ -341,8 +389,8 @@ layout("/layouts/platform.html"){
|
|||||||
sublime.jumpPagePjax('/platform/sickHelp/importByForm?id=' + row.id)
|
sublime.jumpPagePjax('/platform/sickHelp/importByForm?id=' + row.id)
|
||||||
},
|
},
|
||||||
exportData() {
|
exportData() {
|
||||||
const {year, unitName} = this.pageForm
|
const {year, unitName, isMeetRequirements, isAccept} = this.pageForm
|
||||||
window.open(loc() + '/exportData?year=' + year + '&unitName=' + unitName)
|
window.open(loc() + '/exportData?year=' + year + '&unitName=' + unitName + "&isMeetRequirements=" + isMeetRequirements + "&isAccept=" + isAccept)
|
||||||
},
|
},
|
||||||
async isMeetRequirementsChange(id, isMeetRequirements) {
|
async isMeetRequirementsChange(id, isMeetRequirements) {
|
||||||
const resp = await $.post(loc() + '/updateIsMeetRequirements', {id, isMeetRequirements})
|
const resp = await $.post(loc() + '/updateIsMeetRequirements', {id, isMeetRequirements})
|
||||||
@@ -352,7 +400,15 @@ layout("/layouts/platform.html"){
|
|||||||
} else {
|
} else {
|
||||||
this.notifyWarning(resp.msg)
|
this.notifyWarning(resp.msg)
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
async isAcceptChange(id, isAccept) {
|
||||||
|
const resp = await $.post(loc() + '/updateIsAccept', {id, isAccept})
|
||||||
|
if (resp.code === 0) {
|
||||||
|
this.pageData()
|
||||||
|
this.notifySuccess(resp.msg)
|
||||||
|
} else {
|
||||||
|
this.notifyWarning(resp.msg)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
async oneKeyUpdateIsMeetRequirements() {
|
async oneKeyUpdateIsMeetRequirements() {
|
||||||
const {year} = this.pageForm
|
const {year} = this.pageForm
|
||||||
@@ -374,7 +430,27 @@ layout("/layouts/platform.html"){
|
|||||||
} else {
|
} else {
|
||||||
this.notifyWarning(resp.msg)
|
this.notifyWarning(resp.msg)
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
async oneKeyUpdateIsAccept() {
|
||||||
|
const {year} = this.pageForm
|
||||||
|
if (!year) {
|
||||||
|
this.notifyWarning('请先选择年度')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const confirm = await this.$confirm('确认要将' + year + '的申请记录全部设为接受补助申请吗?', '提示', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
})
|
||||||
|
if ('confirm' !== confirm) return
|
||||||
|
|
||||||
|
const resp = await $.post(loc() + '/oneKeyUpdateIsAccept', {year})
|
||||||
|
if (resp.code === 0) {
|
||||||
|
this.pageData()
|
||||||
|
this.notifySuccess(resp.msg)
|
||||||
|
} else {
|
||||||
|
this.notifyWarning(resp.msg)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
async flushUnits() {
|
async flushUnits() {
|
||||||
this.$set(this.pageForm, "unitId", "")
|
this.$set(this.pageForm, "unitId", "")
|
||||||
|
|||||||
@@ -0,0 +1,75 @@
|
|||||||
|
package io.v.nutz;
|
||||||
|
|
||||||
|
import cn.afterturn.easypoi.excel.ExcelImportUtil;
|
||||||
|
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||||
|
import cn.afterturn.easypoi.excel.entity.ImportParams;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collector;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
public class SickHelpTest {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void importExcel(){
|
||||||
|
List<Yibao> records = ExcelImportUtil.importExcel(new File("D:\\公司资料\\河海大学\\大病互助数据\\医保数据.xlsx"), Yibao.class, new ImportParams());
|
||||||
|
|
||||||
|
// 按身份证分组并聚合数据
|
||||||
|
List<Yibao> aggregatedData = records.stream()
|
||||||
|
.collect(Collectors.groupingBy(Yibao::getIdCard))
|
||||||
|
.entrySet().stream()
|
||||||
|
.map(entry -> {
|
||||||
|
List<Yibao> group = entry.getValue();
|
||||||
|
Yibao aggregated = new Yibao();
|
||||||
|
aggregated.setUserName(entry.getKey()); // 注意: 这里可能有逻辑问题,原代码用k(身份证)作为用户名
|
||||||
|
aggregated.setIdCard(entry.getKey());
|
||||||
|
|
||||||
|
aggregated.setZhzl(group.stream().mapToDouble(Yibao::getZhzl).sum());
|
||||||
|
aggregated.setZhzf(group.stream().mapToDouble(Yibao::getZhzf).sum());
|
||||||
|
aggregated.setXjzl(group.stream().mapToDouble(Yibao::getXjzl).sum());
|
||||||
|
aggregated.setXjzf(group.stream().mapToDouble(Yibao::getXjzf).sum());
|
||||||
|
aggregated.setSelfPayTotalMoney(aggregated.getZhzl()+aggregated.getXjzf());
|
||||||
|
|
||||||
|
return aggregated;
|
||||||
|
})
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
System.out.println(aggregatedData.size());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public static class Yibao{
|
||||||
|
|
||||||
|
@Excel(name = "人员姓名")
|
||||||
|
private String userName;
|
||||||
|
|
||||||
|
@Excel(name = "身份证号")
|
||||||
|
private String idCard;
|
||||||
|
|
||||||
|
@Excel(name = "账户自理")
|
||||||
|
private double zhzl;
|
||||||
|
|
||||||
|
@Excel(name = "账户自付")
|
||||||
|
private double zhzf;
|
||||||
|
|
||||||
|
@Excel(name = "现金自理")
|
||||||
|
private double xjzl;
|
||||||
|
|
||||||
|
@Excel(name = "现金自付")
|
||||||
|
private double xjzf;
|
||||||
|
|
||||||
|
@Excel(name = "两项自付之和金额")
|
||||||
|
private double selfPayTotalMoney;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user