commit
This commit is contained in:
+36
-6
@@ -19,6 +19,8 @@ import com.budwk.app.flow.service.FlowCommonService;
|
||||
import com.budwk.app.sys.models.Sys_user;
|
||||
import com.budwk.app.web.commons.auth.utils.AuthUtil;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.web.commons.base.Globals;
|
||||
import com.budwk.app.zhgh.staffbenefit.medicalMutualAid.aidFund.model.AidFundMemberPay;
|
||||
import com.budwk.app.zhgh.staffbenefit.medicalMutualAid.medical.model.MedicalApply;
|
||||
import com.budwk.app.zhgh.staffbenefit.medicalMutualAid.medical.model.MedicalApplyCost;
|
||||
import com.budwk.app.zhgh.staffbenefit.medicalMutualAid.medical.model.MedicalDiseaseType;
|
||||
@@ -40,7 +42,9 @@ import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
@@ -126,13 +130,20 @@ public class MedicalApplyController {
|
||||
cnd.and("pay.`year`", "=", applyYear);
|
||||
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name())) {
|
||||
SqlExpressionGroup group1 = new SqlExpressionGroup();
|
||||
if (AuthUtil.hasRoleOr(RoleConstant.BRANCH_UNION_CHAIRMAN.name())) {
|
||||
group1.and("us.unionId", "=", SecurityUtil.getUnionId());
|
||||
if (AuthUtil.hasRole(RoleConstant.RETIREMENT_WORKPLACE.name())) {
|
||||
group1.or("us.aidFundMemberUserType", "=", "离退休人员");
|
||||
}
|
||||
if (AuthUtil.hasRoleOr(RoleConstant.RETIREMENT_WORKPLACE.name())) {
|
||||
group1.and("us.aidFundMemberUserType", "=", "离退休人员");
|
||||
if (AuthUtil.hasRole(RoleConstant.BRANCH_UNION_CHAIRMAN.name())) {
|
||||
SqlExpressionGroup group2 = new SqlExpressionGroup();
|
||||
group2.and("us.unionid", "=", SecurityUtil.getUnionId());
|
||||
group2.and("us.aidFundMemberUserType", "!=", "离退休人员");
|
||||
group1.or(group2);
|
||||
} else {
|
||||
cnd.and("us.id", "=", SecurityUtil.getUserId());
|
||||
}
|
||||
if (!group1.isEmpty()){
|
||||
cnd.and(group1);
|
||||
}
|
||||
cnd.and(group1);
|
||||
}
|
||||
sql.setCondition(cnd);
|
||||
|
||||
@@ -242,10 +253,29 @@ public class MedicalApplyController {
|
||||
@ApiOperation("查询是否有进行中的申请")
|
||||
@SaCheckPermission("medicalMutualAid.medical.apply")
|
||||
public Result getIsAfootMedicalApply(String userId, String id) {
|
||||
Sys_user user = medicalApplyService.dao().fetch(Sys_user.class, userId);
|
||||
if (StrUtil.isBlank(id)){
|
||||
String medicalApplyEndTime = Globals.MyConfig.getString("MedicalApplyEndTime");
|
||||
if (StrUtil.isBlank(medicalApplyEndTime)) {
|
||||
return Result.error("请先配置医疗补助系统申报截止时间!");
|
||||
}
|
||||
|
||||
Date deadlineEnd = DateUtil.endOfDay(DateUtil.parse(medicalApplyEndTime, "yyyy-M-d"));
|
||||
if (System.currentTimeMillis() > deadlineEnd.getTime()) {
|
||||
return Result.error("医疗补助系统申报已截止!");
|
||||
}
|
||||
}
|
||||
|
||||
int count = medicalApplyService.dao().count(AidFundMemberPay.class, Cnd.where(AidFundMemberPay::getUserId, "=", userId)
|
||||
.and(AidFundMemberPay::getIsPayed, "=", 1)
|
||||
.and(AidFundMemberPay::getYear, "=", DateUtil.thisYear()));
|
||||
if (count == 0) {
|
||||
return Result.error("【%s】当前年度暂未缴费,无法申请!".formatted(user.getUsername()));
|
||||
}
|
||||
|
||||
Boolean isAfootMedicalApply = medicalApplyService.getIsAfootMedicalApply(userId, id);
|
||||
if (isAfootMedicalApply) {
|
||||
Sys_user user = medicalApplyService.dao().fetch(Sys_user.class, userId);
|
||||
|
||||
return Result.error("【%s】有一条进行中的申请,请到“我的补助”菜单中查看。".formatted(user.getUsername()));
|
||||
}
|
||||
return Result.success();
|
||||
|
||||
+190
@@ -0,0 +1,190 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.medicalMutualAid.medical.controller;
|
||||
|
||||
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
||||
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.utils.CommonDownloadUtil;
|
||||
import com.budwk.app.zhgh.staffbenefit.medicalMutualAid.medical.model.MedicalApply;
|
||||
import com.budwk.app.zhgh.staffbenefit.medicalMutualAid.medical.model.MedicalMoneyDetail;
|
||||
import com.budwk.app.zhgh.staffbenefit.medicalMutualAid.medical.service.MedicalCalculateMoneyService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Chain;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.aop.Aop;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.json.Json;
|
||||
import org.nutz.lang.Lang;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
import javax.servlet.ServletOutputStream;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2026/1/24 11:10
|
||||
* @description 计算补助
|
||||
*/
|
||||
@IocBean
|
||||
@At("/platform/medicalMutualAid/medical/calculateMoney")
|
||||
@Api("医疗互助补助测算")
|
||||
@Ok("json:full")
|
||||
@Slf4j
|
||||
public class MedicalCalculateMoneyController {
|
||||
|
||||
@Inject
|
||||
private MedicalCalculateMoneyService medicalCalculateMoneyService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/staffbenefit/medicalMutualAid/medical/calculateMoney/index.html")
|
||||
@SaCheckPermission("medicalMutualAid.medical.calculateMoney")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("查询第一步输入金额")
|
||||
@SaCheckPermission("medicalMutualAid.medical.calculateMoney")
|
||||
public Result getData() {
|
||||
NutMap data = medicalCalculateMoneyService.getData();
|
||||
return Result.success(data);
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("查询所有的申请数据")
|
||||
@SaCheckPermission("medicalMutualAid.medical.calculateMoney")
|
||||
public Result getApplyData(double ratio) {
|
||||
List<NutMap> applyData = medicalCalculateMoneyService.getApplyData(ratio);
|
||||
return Result.success(applyData);
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ApiOperation("按比例修改补助金额")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SLog(tag = "医疗补助系统-医疗补助预测", msg = "按比例修改补助金额")
|
||||
@SaCheckPermission("medicalMutualAid.medical.calculateMoney")
|
||||
public Result doHandle(String data, float ratio, double aidFund, double inComeSum, long loveSubsidyMoney){
|
||||
//获取申请最新年份
|
||||
Sql yearSql = Sqls.create("SELECT MAX(YEAR(applyTime)) AS currentYear FROM medical_apply");
|
||||
yearSql.setCallback(Sqls.callback.longs());
|
||||
medicalCalculateMoneyService.execute(yearSql);
|
||||
Integer year = yearSql.getInt();
|
||||
|
||||
List<MedicalApply> list = Json.fromJsonAsList(MedicalApply.class, data);
|
||||
list.forEach(v -> {
|
||||
v.setSubsidyMoney(v.getForecastSubsidyMoney());
|
||||
});
|
||||
medicalCalculateMoneyService.updateIgnoreNull(list);
|
||||
//补助总额
|
||||
BigDecimal subsidyMoney = list.stream()
|
||||
.map(MedicalApply::getForecastSubsidyMoney)
|
||||
.filter(Objects::nonNull) // 防御性:避免 null
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
BigDecimal incomeRounded = BigDecimal.valueOf(Math.round(inComeSum));
|
||||
BigDecimal thisYearBalance = incomeRounded
|
||||
.subtract(subsidyMoney)
|
||||
.subtract(BigDecimal.valueOf(loveSubsidyMoney));
|
||||
|
||||
|
||||
MedicalMoneyDetail moneyDetail = medicalCalculateMoneyService.dao().fetch(MedicalMoneyDetail.class, Cnd.where("year", "=", year));
|
||||
if (Lang.isEmpty(moneyDetail)) {
|
||||
moneyDetail = new MedicalMoneyDetail();
|
||||
moneyDetail.setYear(year);
|
||||
moneyDetail.setAidFund(new BigDecimal(aidFund));
|
||||
moneyDetail.setRatio(ratio);
|
||||
moneyDetail.setLastYearBalance(thisYearBalance);
|
||||
medicalCalculateMoneyService.insert(moneyDetail);
|
||||
} else {
|
||||
moneyDetail.setAidFund(new BigDecimal(aidFund));
|
||||
moneyDetail.setRatio(ratio);
|
||||
moneyDetail.setLastYearBalance(thisYearBalance);
|
||||
medicalCalculateMoneyService.updateIgnoreNull(moneyDetail);
|
||||
}
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@Ok("void")
|
||||
@SaCheckPermission("medicalMutualAid.medical.calculateMoney")
|
||||
public void doExport(double ratio, HttpServletResponse response){
|
||||
List<NutMap> list = medicalCalculateMoneyService.getApplyData(ratio);
|
||||
|
||||
list.forEach(l -> {
|
||||
l.put("majorDisease", l.getBoolean("isMajorDisease") ? "是" : "否");
|
||||
});
|
||||
List<ExcelExportEntity> exportEntities = new ArrayList<>();
|
||||
exportEntities.add(new ExcelExportEntity("姓名", "username", 20));
|
||||
exportEntities.add(new ExcelExportEntity("工号", "loginname", 20));
|
||||
exportEntities.add(new ExcelExportEntity("所属单位", "unitName", 20));
|
||||
exportEntities.add(new ExcelExportEntity("所属分工会", "unionName", 20));
|
||||
exportEntities.add(new ExcelExportEntity("疾病种类", "diseaseName", 20));
|
||||
exportEntities.add(new ExcelExportEntity("重大疾病", "majorDisease", 20));
|
||||
exportEntities.add(new ExcelExportEntity("申请时间", "applyTime", 20));
|
||||
exportEntities.add(new ExcelExportEntity("申请次数", "applyNum", 20));
|
||||
|
||||
exportEntities.add(new ExcelExportEntity("起扣时间", "aidFundDeductTime", 20));
|
||||
exportEntities.add(new ExcelExportEntity("缴费年数", "yearsSinceDeduct", 20));
|
||||
ExcelExportEntity hospitalSumMoneyExcelExportEntity = new ExcelExportEntity("住院医疗总额(不含门诊)", "hospitalSumMoney$", 20);
|
||||
hospitalSumMoneyExcelExportEntity.setType(10);
|
||||
exportEntities.add(hospitalSumMoneyExcelExportEntity);
|
||||
ExcelExportEntity reimbursementMoneyExcelExportEntity = new ExcelExportEntity("实际报销总额", "reimbursementMoney$", 20);
|
||||
reimbursementMoneyExcelExportEntity.setType(10);
|
||||
exportEntities.add(reimbursementMoneyExcelExportEntity);
|
||||
ExcelExportEntity singleBearMoneyExcelExportEntity = new ExcelExportEntity("(住院医疗)允许报销范围内个人承担部分总额", "singleBearMoney$", 20);
|
||||
singleBearMoneyExcelExportEntity.setType(10);
|
||||
exportEntities.add(singleBearMoneyExcelExportEntity);
|
||||
ExcelExportEntity personExpenseMoneyExcelExportEntity = new ExcelExportEntity("(住院医疗)自费部分总额", "personExpenseMoney$", 20);
|
||||
personExpenseMoneyExcelExportEntity.setType(10);
|
||||
exportEntities.add(personExpenseMoneyExcelExportEntity);
|
||||
ExcelExportEntity outpatientServiceMoneyExcelExportEntity = new ExcelExportEntity("重病门诊自费金额", "outpatientServiceMoney$", 20);
|
||||
outpatientServiceMoneyExcelExportEntity.setType(10);
|
||||
exportEntities.add(outpatientServiceMoneyExcelExportEntity);
|
||||
ExcelExportEntity bxyMoneyExcelExportEntity = new ExcelExportEntity("非住院肾衰竭治疗、靶向药", "bxyMoney$", 20);
|
||||
bxyMoneyExcelExportEntity.setType(10);
|
||||
exportEntities.add(bxyMoneyExcelExportEntity);
|
||||
ExcelExportEntity totalMoneyExcelExportEntity = new ExcelExportEntity("合计金额", "totalMoney", 20);
|
||||
totalMoneyExcelExportEntity.setType(10);
|
||||
exportEntities.add(totalMoneyExcelExportEntity);
|
||||
ExcelExportEntity loveSubsidyMoneyExcelExportEntity = new ExcelExportEntity("爱心补助", "loveSubsidyMoney", 20);
|
||||
loveSubsidyMoneyExcelExportEntity.setType(10);
|
||||
exportEntities.add(loveSubsidyMoneyExcelExportEntity);
|
||||
ExcelExportEntity subsidyMoneyExcelExportEntity = new ExcelExportEntity("当前补助金额", "subsidyMoney", 20);
|
||||
subsidyMoneyExcelExportEntity.setType(10);
|
||||
exportEntities.add(subsidyMoneyExcelExportEntity);
|
||||
ExcelExportEntity ExcelExportEntityForecastSubsidyMoney = new ExcelExportEntity("按" + ratio + "%补助金额", "forecastSubsidyMoney", 20);
|
||||
ExcelExportEntityForecastSubsidyMoney.setType(10);
|
||||
exportEntities.add(ExcelExportEntityForecastSubsidyMoney);
|
||||
ExcelExportEntity medicalSubsidyMoneyExcelExportEntity = new ExcelExportEntity("以往累计补助金额", "medicalSubsidyMoney", 20);
|
||||
medicalSubsidyMoneyExcelExportEntity.setType(10);
|
||||
exportEntities.add(medicalSubsidyMoneyExcelExportEntity);
|
||||
try {
|
||||
ExportParams exportParams = new ExportParams();
|
||||
exportParams.setType(ExcelType.XSSF);
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, exportEntities, list);
|
||||
CommonDownloadUtil.download("测算补助金额汇总表.xlsx", workbook, response);
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+73
-64
@@ -1,11 +1,17 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.medicalMutualAid.medical.controller;
|
||||
|
||||
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
||||
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.lang.Dict;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.utils.CommonDownloadUtil;
|
||||
import com.budwk.app.base.utils.PageUtil;
|
||||
import com.budwk.app.flow.enums.ProcessTaskStateEnum;
|
||||
import com.budwk.app.flow.service.FlowCommonService;
|
||||
@@ -13,9 +19,11 @@ import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.staffbenefit.medicalMutualAid.medical.model.MedicalApplyCost;
|
||||
import com.budwk.app.zhgh.staffbenefit.medicalMutualAid.medical.param.MedicalPageForm;
|
||||
import com.budwk.app.zhgh.staffbenefit.medicalMutualAid.medical.service.MedicalApplyService;
|
||||
import com.budwk.app.zhgh.staffbenefit.medicalMutualAid.medical.service.MedicalAuditService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Chain;
|
||||
import org.nutz.dao.Cnd;
|
||||
@@ -31,6 +39,8 @@ import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -40,13 +50,15 @@ import java.util.List;
|
||||
*/
|
||||
@IocBean
|
||||
@At("/platform/medicalMutualAid/medical/foundationAudit")
|
||||
@Api("医疗互助校互管会审核")
|
||||
@Api("医疗互助互管会审核")
|
||||
@Ok("json:full")
|
||||
@Slf4j
|
||||
public class MedicalFoundationAuditController {
|
||||
|
||||
@Inject
|
||||
private MedicalApplyService medicalApplyService;
|
||||
@Inject
|
||||
private MedicalAuditService medicalAuditService;
|
||||
|
||||
@Inject
|
||||
private FlowCommonService flowCommonService;
|
||||
@@ -61,70 +73,9 @@ public class MedicalFoundationAuditController {
|
||||
@ApiOperation("分页查询")
|
||||
@SaCheckPermission("medicalMutualAid.medical.foundationAudit")
|
||||
public Result pageData(MedicalPageForm pageForm) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
type.diseaseName,
|
||||
type.isMajorDiseases,
|
||||
us.username,
|
||||
us.loginname,
|
||||
us.unitName,
|
||||
us.unionName,
|
||||
ins.id AS instanceId,
|
||||
ins.businessNo,
|
||||
ins.state instanceState,
|
||||
ins.variable instanceVariable,
|
||||
ins.processDefineId instanceProcessDefineId,
|
||||
t.id taskId,
|
||||
t.taskName AS taskKey,
|
||||
t.displayName taskName,
|
||||
t.taskType,
|
||||
t.performType taskPerformType,
|
||||
t.taskState,
|
||||
t.finishTime,
|
||||
t.taskParentId,
|
||||
t.variable taskVariable,
|
||||
IFNULL(GROUP_CONCAT(DISTINCT nt.displayName),'结束') curTaskName,
|
||||
IF(rt.id IS NOT NULL, 1, 0) AS canRevoke
|
||||
FROM
|
||||
wf_process_task t
|
||||
LEFT JOIN wf_process_instance ins ON ins.id = t.processInstanceId
|
||||
LEFT JOIN medical_apply info ON info.id = ins.businessNo
|
||||
LEFT JOIN medical_disease_type type ON info.diseaseId = type.id
|
||||
LEFT JOIN vw_user us ON us.id = info.userId
|
||||
LEFT JOIN wf_process_task_actor ta ON ta.processTaskId = t.id
|
||||
LEFT JOIN wf_process_task nt ON nt.processInstanceId = ins.id AND nt.taskState = 10
|
||||
LEFT JOIN wf_process_task rt ON rt.processInstanceId = ins.id AND rt.taskParentId = t.id AND rt.taskState = 10
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
seg.orLike("us.loginname", pageForm.getSearchKeyword());
|
||||
seg.orLike("us.username", pageForm.getSearchKeyword());
|
||||
cnd.and(seg);
|
||||
}
|
||||
cnd.andEX("year(info.applyTime)", "=", pageForm.getYear());
|
||||
cnd.andEX("info.diseaseId", "=", pageForm.getDiseaseId());
|
||||
cnd.andEX("us.unionid", "=", pageForm.getUnionId());
|
||||
cnd.andEX("us.unitid", "=", pageForm.getUnitId());
|
||||
|
||||
cnd.and("t.taskName", "=", "cd560356-cc70-48b5-8d99-ff9bd3505869");
|
||||
cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId()));
|
||||
|
||||
if (pageForm.getApproval()) {
|
||||
cnd.and("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode()));
|
||||
} else {
|
||||
cnd.and("t.taskState", "=", ProcessTaskStateEnum.DOING.getCode());
|
||||
}
|
||||
|
||||
if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
|
||||
cnd.desc("info.applyTime");
|
||||
} else {
|
||||
cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
|
||||
}
|
||||
cnd.groupBy("t.id");
|
||||
sql.setCondition(cnd);
|
||||
Sql sql = medicalAuditService.getAuditSql(pageForm, cnd);
|
||||
Pagination<NutMap> pageVO = medicalApplyService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
List<NutMap> costList = medicalApplyService.getCostList(pageVO.getList());
|
||||
pageVO.setList(costList);
|
||||
@@ -166,9 +117,67 @@ public class MedicalFoundationAuditController {
|
||||
@ApiOperation("预测补助金额")
|
||||
@SaCheckPermission("medicalMutualAid.medical.foundationAudit")
|
||||
public Result calcMedicalMoney(String id, String diseaseId) {
|
||||
NutMap nutMap = medicalApplyService.calcMedicalMoney(id, diseaseId);
|
||||
NutMap nutMap = medicalApplyService.calcMedicalMoney(id, diseaseId, 0);
|
||||
return Result.success(nutMap);
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@Ok("void")
|
||||
@SaCheckPermission("medicalMutualAid.medical.calculateMoney")
|
||||
public void doExport(MedicalPageForm pageForm, HttpServletResponse response){
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("t.taskName", "=", "cd560356-cc70-48b5-8d99-ff9bd3505869");
|
||||
Sql sql = medicalAuditService.getAuditSql(pageForm, cnd);
|
||||
List<NutMap> list = medicalApplyService.listMap(sql);
|
||||
List<NutMap> costList = medicalApplyService.getCostList(list);
|
||||
|
||||
costList.forEach(l -> {
|
||||
l.put("majorDisease", l.getBoolean("isMajorDisease") ? "是" : "否");
|
||||
});
|
||||
List<ExcelExportEntity> exportEntities = new ArrayList<>();
|
||||
exportEntities.add(new ExcelExportEntity("姓名", "username", 20));
|
||||
exportEntities.add(new ExcelExportEntity("工号", "loginname", 20));
|
||||
exportEntities.add(new ExcelExportEntity("所属单位", "unitName", 20));
|
||||
exportEntities.add(new ExcelExportEntity("所属分工会", "unionName", 20));
|
||||
exportEntities.add(new ExcelExportEntity("疾病种类", "diseaseName", 20));
|
||||
exportEntities.add(new ExcelExportEntity("重大疾病", "majorDisease", 20));
|
||||
exportEntities.add(new ExcelExportEntity("申请时间", "applyTime", 20));
|
||||
exportEntities.add(new ExcelExportEntity("申请次数", "applyNum", 20));
|
||||
|
||||
ExcelExportEntity hospitalSumMoneyExcelExportEntity = new ExcelExportEntity("住院医疗总额(不含门诊)", "hospitalSumMoney$", 20);
|
||||
hospitalSumMoneyExcelExportEntity.setType(10);
|
||||
exportEntities.add(hospitalSumMoneyExcelExportEntity);
|
||||
ExcelExportEntity reimbursementMoneyExcelExportEntity = new ExcelExportEntity("实际报销总额", "reimbursementMoney$", 20);
|
||||
reimbursementMoneyExcelExportEntity.setType(10);
|
||||
exportEntities.add(reimbursementMoneyExcelExportEntity);
|
||||
ExcelExportEntity singleBearMoneyExcelExportEntity = new ExcelExportEntity("(住院医疗)允许报销范围内个人承担部分总额", "singleBearMoney$", 20);
|
||||
singleBearMoneyExcelExportEntity.setType(10);
|
||||
exportEntities.add(singleBearMoneyExcelExportEntity);
|
||||
ExcelExportEntity personExpenseMoneyExcelExportEntity = new ExcelExportEntity("(住院医疗)自费部分总额", "personExpenseMoney$", 20);
|
||||
personExpenseMoneyExcelExportEntity.setType(10);
|
||||
exportEntities.add(personExpenseMoneyExcelExportEntity);
|
||||
ExcelExportEntity outpatientServiceMoneyExcelExportEntity = new ExcelExportEntity("重病门诊自费金额", "outpatientServiceMoney$", 20);
|
||||
outpatientServiceMoneyExcelExportEntity.setType(10);
|
||||
exportEntities.add(outpatientServiceMoneyExcelExportEntity);
|
||||
ExcelExportEntity bxyMoneyExcelExportEntity = new ExcelExportEntity("非住院肾衰竭治疗、靶向药", "bxyMoney$", 20);
|
||||
bxyMoneyExcelExportEntity.setType(10);
|
||||
exportEntities.add(bxyMoneyExcelExportEntity);
|
||||
ExcelExportEntity totalMoneyExcelExportEntity = new ExcelExportEntity("合计金额", "totalMoney", 20);
|
||||
totalMoneyExcelExportEntity.setType(10);
|
||||
exportEntities.add(totalMoneyExcelExportEntity);
|
||||
exportEntities.add(new ExcelExportEntity("当前节点", "curTaskName", 20));
|
||||
try {
|
||||
ExportParams exportParams = new ExportParams();
|
||||
exportParams.setType(ExcelType.XSSF);
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, exportEntities, costList);
|
||||
CommonDownloadUtil.download("测算补助金额汇总表.xlsx", workbook, response);
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
+21
-2
@@ -6,11 +6,13 @@ import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
import com.budwk.app.base.constant.RoleConstant;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.utils.PageUtil;
|
||||
import com.budwk.app.flow.engine.FlowEngine;
|
||||
import com.budwk.app.sys.views.View_user;
|
||||
import com.budwk.app.web.commons.auth.utils.AuthUtil;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.staffbenefit.medicalMutualAid.medical.model.MedicalApply;
|
||||
import com.budwk.app.zhgh.staffbenefit.medicalMutualAid.medical.model.MedicalApplyCost;
|
||||
@@ -110,7 +112,24 @@ public class MedicalMineController {
|
||||
}
|
||||
cnd.andEX("year(info.applyTime)", "=", pageForm.getYear());
|
||||
cnd.andEX("info.diseaseId", "=", pageForm.getDiseaseId());
|
||||
cnd.and("info.userId", "=", SecurityUtil.getUserId());
|
||||
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name())) {
|
||||
SqlExpressionGroup group = new SqlExpressionGroup();
|
||||
if (AuthUtil.hasRole(RoleConstant.RETIREMENT_WORKPLACE.name())) {
|
||||
group.or("us.aidFundMemberUserType", "=", "离退休人员");
|
||||
}
|
||||
if (AuthUtil.hasRole(RoleConstant.BRANCH_UNION_CHAIRMAN.name())) {
|
||||
SqlExpressionGroup group1 = new SqlExpressionGroup();
|
||||
group1.and("us.unionid", "=", SecurityUtil.getUnionId());
|
||||
group1.and("us.aidFundMemberUserType", "!=", "离退休人员");
|
||||
group.or(group1);
|
||||
} else {
|
||||
cnd.and("info.userId", "=", SecurityUtil.getUserId());
|
||||
}
|
||||
if (!group.isEmpty()){
|
||||
cnd.and(group);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (StrUtil.isNotBlank(pageForm.getPageOrderName()) && StrUtil.isNotBlank(pageForm.getPageOrderBy())) {
|
||||
cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
|
||||
@@ -143,7 +162,7 @@ public class MedicalMineController {
|
||||
public Result info(String id) {
|
||||
MedicalApply medicalApply = medicalApplyService.fetch(id);
|
||||
MedicalDiseaseType diseaseType = medicalApplyService.dao().fetch(MedicalDiseaseType.class, medicalApply.getDiseaseId());
|
||||
MedicalApply fetchLinks = medicalApplyService.fetchLinks(medicalApply, "costList",Cnd.NEW().asc("visitStartTime"));
|
||||
MedicalApply fetchLinks = medicalApplyService.fetchLinks(medicalApply, "costList", Cnd.NEW().asc("visitStartTime"));
|
||||
View_user user = medicalApplyService.dao().fetch(View_user.class, Cnd.where(View_user::getId, "=", medicalApply.getUserId()));
|
||||
NutMap nutMap = Lang.obj2nutmap(fetchLinks);
|
||||
nutMap.put("sex", user.getSex());
|
||||
|
||||
+59
@@ -0,0 +1,59 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.medicalMutualAid.medical.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.zhgh.staffbenefit.medicalMutualAid.medical.param.MedicalPageForm;
|
||||
import com.budwk.app.zhgh.staffbenefit.medicalMutualAid.medical.service.MedicalApplyService;
|
||||
import com.budwk.app.zhgh.staffbenefit.medicalMutualAid.medical.service.MedicalAuditService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2026/1/24 17:09
|
||||
* @description 离退休审核
|
||||
*/
|
||||
@IocBean
|
||||
@At("/platform/medicalMutualAid/medical/retirementAudit")
|
||||
@Api("医疗互助离退休审核")
|
||||
@Ok("json:full")
|
||||
@Slf4j
|
||||
public class MedicalRetirementAuditController {
|
||||
|
||||
@Inject
|
||||
private MedicalApplyService medicalApplyService;
|
||||
|
||||
@Inject
|
||||
private MedicalAuditService medicalAuditService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/staffbenefit/medicalMutualAid/medical/retirementAudit/index.html")
|
||||
@SaCheckPermission("medicalMutualAid.medical.retirementAudit")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("分页查询")
|
||||
@SaCheckPermission("medicalMutualAid.medical.retirementAudit")
|
||||
public Result pageData(MedicalPageForm pageForm) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("t.taskName", "=", "eedd925d-0ef5-417e-9c52-6133a785646f");
|
||||
Sql sql = medicalAuditService.getAuditSql(pageForm, cnd);
|
||||
sql.setCondition(cnd);
|
||||
Pagination<NutMap> pageVO = medicalApplyService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
List<NutMap> costList = medicalApplyService.getCostList(pageVO.getList());
|
||||
pageVO.setList(costList);
|
||||
return Result.success(pageVO);
|
||||
}
|
||||
}
|
||||
+6
-62
@@ -12,6 +12,7 @@ import com.budwk.app.flow.service.FlowCommonService;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.staffbenefit.medicalMutualAid.medical.param.MedicalPageForm;
|
||||
import com.budwk.app.zhgh.staffbenefit.medicalMutualAid.medical.service.MedicalApplyService;
|
||||
import com.budwk.app.zhgh.staffbenefit.medicalMutualAid.medical.service.MedicalAuditService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -48,6 +49,9 @@ public class MedicalSchoolHospitalAuditController {
|
||||
@Inject
|
||||
private MedicalApplyService medicalApplyService;
|
||||
|
||||
@Inject
|
||||
private MedicalAuditService medicalAuditService;
|
||||
|
||||
@Inject
|
||||
private FlowCommonService flowCommonService;
|
||||
|
||||
@@ -61,70 +65,10 @@ public class MedicalSchoolHospitalAuditController {
|
||||
@ApiOperation("分页查询")
|
||||
@SaCheckPermission("medicalMutualAid.medical.schoolHospitalAudit")
|
||||
public Result pageData(MedicalPageForm pageForm) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
type.diseaseName,
|
||||
type.isMajorDiseases,
|
||||
us.username,
|
||||
us.loginname,
|
||||
us.unitName,
|
||||
us.unionName,
|
||||
ins.id AS instanceId,
|
||||
ins.businessNo,
|
||||
ins.state instanceState,
|
||||
ins.variable instanceVariable,
|
||||
ins.processDefineId instanceProcessDefineId,
|
||||
t.id taskId,
|
||||
t.taskName AS taskKey,
|
||||
t.displayName taskName,
|
||||
t.taskType,
|
||||
t.performType taskPerformType,
|
||||
t.taskState,
|
||||
t.finishTime,
|
||||
t.taskParentId,
|
||||
t.variable taskVariable,
|
||||
IFNULL(GROUP_CONCAT(DISTINCT nt.displayName),'结束') curTaskName,
|
||||
IF(rt.id IS NOT NULL, 1, 0) AS canRevoke
|
||||
FROM
|
||||
wf_process_task t
|
||||
LEFT JOIN wf_process_instance ins ON ins.id = t.processInstanceId
|
||||
LEFT JOIN medical_apply info ON info.id = ins.businessNo
|
||||
LEFT JOIN medical_disease_type type ON info.diseaseId = type.id
|
||||
LEFT JOIN vw_user us ON us.id = info.userId
|
||||
LEFT JOIN wf_process_task_actor ta ON ta.processTaskId = t.id
|
||||
LEFT JOIN wf_process_task nt ON nt.processInstanceId = ins.id AND nt.taskState = 10
|
||||
LEFT JOIN wf_process_task rt ON rt.processInstanceId = ins.id AND rt.taskParentId = t.id AND rt.taskState = 10
|
||||
$condition
|
||||
""");
|
||||
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
seg.orLike("us.loginname", pageForm.getSearchKeyword());
|
||||
seg.orLike("us.username", pageForm.getSearchKeyword());
|
||||
cnd.and(seg);
|
||||
}
|
||||
cnd.andEX("year(info.applyTime)", "=", pageForm.getYear());
|
||||
cnd.andEX("info.diseaseId", "=", pageForm.getDiseaseId());
|
||||
cnd.andEX("us.unionid", "=", pageForm.getUnionId());
|
||||
cnd.andEX("us.unitid", "=", pageForm.getUnitId());
|
||||
|
||||
cnd.and("t.taskName", "=", "39916c1e-857d-407d-86c1-678ccf3011bc");
|
||||
cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId()));
|
||||
|
||||
if (pageForm.getApproval()) {
|
||||
cnd.and("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode()));
|
||||
} else {
|
||||
cnd.and("t.taskState", "=", ProcessTaskStateEnum.DOING.getCode());
|
||||
}
|
||||
|
||||
if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
|
||||
cnd.desc("info.applyTime");
|
||||
} else {
|
||||
cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
|
||||
}
|
||||
cnd.groupBy("t.id");
|
||||
sql.setCondition(cnd);
|
||||
Sql sql = medicalAuditService.getAuditSql(pageForm, cnd);
|
||||
Pagination<NutMap> pageVO = medicalApplyService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
List<NutMap> costList = medicalApplyService.getCostList(pageVO.getList());
|
||||
pageVO.setList(costList);
|
||||
|
||||
+5
-59
@@ -9,6 +9,7 @@ import com.budwk.app.flow.enums.ProcessTaskStateEnum;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.staffbenefit.medicalMutualAid.medical.param.MedicalPageForm;
|
||||
import com.budwk.app.zhgh.staffbenefit.medicalMutualAid.medical.service.MedicalApplyService;
|
||||
import com.budwk.app.zhgh.staffbenefit.medicalMutualAid.medical.service.MedicalAuditService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -40,6 +41,9 @@ public class MedicalUnionAuditController {
|
||||
@Inject
|
||||
private MedicalApplyService medicalApplyService;
|
||||
|
||||
@Inject
|
||||
private MedicalAuditService medicalAuditService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/staffbenefit/medicalMutualAid/medical/unionAudit/index.html")
|
||||
@SaCheckPermission("medicalMutualAid.medical.unionAudit")
|
||||
@@ -50,67 +54,9 @@ public class MedicalUnionAuditController {
|
||||
@ApiOperation("分页查询")
|
||||
@SaCheckPermission("medicalMutualAid.medical.unionAudit")
|
||||
public Result pageData(MedicalPageForm pageForm) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
type.diseaseName,
|
||||
type.isMajorDiseases,
|
||||
us.username,
|
||||
us.loginname,
|
||||
us.unitName,
|
||||
us.unionName,
|
||||
ins.id AS instanceId,
|
||||
ins.businessNo,
|
||||
ins.state instanceState,
|
||||
ins.variable instanceVariable,
|
||||
ins.processDefineId instanceProcessDefineId,
|
||||
t.id taskId,
|
||||
t.taskName AS taskKey,
|
||||
t.displayName taskName,
|
||||
t.taskType,
|
||||
t.performType taskPerformType,
|
||||
t.taskState,
|
||||
t.finishTime,
|
||||
t.taskParentId,
|
||||
t.variable taskVariable,
|
||||
IFNULL(GROUP_CONCAT(DISTINCT nt.displayName),'结束') curTaskName,
|
||||
IF(rt.id IS NOT NULL, 1, 0) AS canRevoke
|
||||
FROM
|
||||
wf_process_task t
|
||||
LEFT JOIN wf_process_instance ins ON ins.id = t.processInstanceId
|
||||
LEFT JOIN medical_apply info ON info.id = ins.businessNo
|
||||
LEFT JOIN medical_disease_type type ON info.diseaseId = type.id
|
||||
LEFT JOIN vw_user us ON us.id = info.userId
|
||||
LEFT JOIN wf_process_task_actor ta ON ta.processTaskId = t.id
|
||||
LEFT JOIN wf_process_task nt ON nt.processInstanceId = ins.id AND nt.taskState = 10
|
||||
LEFT JOIN wf_process_task rt ON rt.processInstanceId = ins.id AND rt.taskParentId = t.id AND rt.taskState = 10
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
seg.orLike("us.loginname", pageForm.getSearchKeyword());
|
||||
seg.orLike("us.username", pageForm.getSearchKeyword());
|
||||
cnd.and(seg);
|
||||
}
|
||||
cnd.andEX("year(info.applyTime)", "=", pageForm.getYear());
|
||||
cnd.andEX("info.diseaseId", "=", pageForm.getDiseaseId());
|
||||
|
||||
cnd.and("t.taskName", "=", "a9bbf69c-5edf-4161-a364-47996d212472");
|
||||
cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId()));
|
||||
|
||||
if (pageForm.getApproval()) {
|
||||
cnd.and("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode()));
|
||||
} else {
|
||||
cnd.and("t.taskState", "=", ProcessTaskStateEnum.DOING.getCode());
|
||||
}
|
||||
|
||||
if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
|
||||
cnd.desc("info.applyTime");
|
||||
} else {
|
||||
cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
|
||||
}
|
||||
cnd.groupBy("t.id");
|
||||
Sql sql = medicalAuditService.getAuditSql(pageForm, cnd);
|
||||
sql.setCondition(cnd);
|
||||
Pagination<NutMap> pageVO = medicalApplyService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
List<NutMap> costList = medicalApplyService.getCostList(pageVO.getList());
|
||||
|
||||
+65
@@ -0,0 +1,65 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.medicalMutualAid.medical.model;
|
||||
|
||||
import com.budwk.app.base.model.BaseModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
import org.nutz.dao.interceptor.annotation.PrevInsert;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Table("medical_money_detail")
|
||||
@Data
|
||||
@Comment("医疗互助补助金额明细")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class MedicalMoneyDetail extends BaseModel {
|
||||
|
||||
@Name
|
||||
@PrevInsert(uu32 = true)
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String id;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.INT)
|
||||
@Comment("年度")
|
||||
private Integer year;
|
||||
|
||||
@Column
|
||||
@ColDefine(customType = "decimal", width = 10)
|
||||
@Comment("会员上缴费用")
|
||||
private BigDecimal aidFund;
|
||||
|
||||
@Column
|
||||
@ColDefine(customType = "decimal", width = 10)
|
||||
@Comment("学校拨款")
|
||||
private BigDecimal schoolGrants;
|
||||
|
||||
@Column
|
||||
@ColDefine(customType = "decimal", width = 10)
|
||||
@Comment("上年结余")
|
||||
private BigDecimal lastYearBalance;
|
||||
|
||||
@Column
|
||||
@ColDefine(customType = "decimal", width = 10)
|
||||
@Comment("工会转入")
|
||||
private BigDecimal unionInto;
|
||||
|
||||
@Column
|
||||
@ColDefine(customType = "decimal", width = 10)
|
||||
@Comment("总收入")
|
||||
private BigDecimal grossIncome;
|
||||
|
||||
@Column
|
||||
@ColDefine(customType = "decimal", width = 10)
|
||||
@Comment("最终占比")
|
||||
private Float ratio;
|
||||
|
||||
@Column
|
||||
@ColDefine(customType = "decimal", width = 10)
|
||||
@Comment("最终分配金额")
|
||||
private Float finalSubsidy;
|
||||
|
||||
|
||||
}
|
||||
+1
@@ -22,5 +22,6 @@ public class MedicalPageForm extends PageForm {
|
||||
private Boolean approval;
|
||||
private String unionId;
|
||||
private String unitId;
|
||||
private Boolean isMajorDiseases;
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -44,5 +44,5 @@ public interface MedicalApplyService extends BaseService<MedicalApply> {
|
||||
* @param diseaseId
|
||||
* @return
|
||||
*/
|
||||
NutMap calcMedicalMoney(String applyId, String diseaseId);
|
||||
NutMap calcMedicalMoney(String applyId, String diseaseId,double ratio);
|
||||
}
|
||||
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.medicalMutualAid.medical.service;
|
||||
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.zhgh.staffbenefit.medicalMutualAid.medical.model.MedicalApply;
|
||||
import com.budwk.app.zhgh.staffbenefit.medicalMutualAid.medical.param.MedicalPageForm;
|
||||
import org.checkerframework.checker.units.qual.C;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
|
||||
public interface MedicalAuditService extends BaseService<MedicalApply> {
|
||||
|
||||
|
||||
Sql getAuditSql(MedicalPageForm pageForm, Cnd cnd);
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.medicalMutualAid.medical.service;
|
||||
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface MedicalCalculateMoneyService extends BaseService {
|
||||
|
||||
/**
|
||||
* 查询第一步输入金额
|
||||
* @return
|
||||
*/
|
||||
NutMap getData();
|
||||
|
||||
List<NutMap> getApplyData(double ratio);
|
||||
}
|
||||
+24
-12
@@ -53,7 +53,9 @@ public class MedicalApplyServiceImpl extends BaseServiceImpl<MedicalApply> imple
|
||||
|
||||
@Override
|
||||
public Integer getMedicalApplyNum(String userId) {
|
||||
return 0 + 1;
|
||||
List<NutMap> applyRecord = this.getApplyRecord(List.of(userId));
|
||||
|
||||
return applyRecord.size() + 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -122,7 +124,10 @@ public class MedicalApplyServiceImpl extends BaseServiceImpl<MedicalApply> imple
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
SqlExpressionGroup group = new SqlExpressionGroup();
|
||||
group.or("t.taskName", "is", null);
|
||||
SqlExpressionGroup group1 = new SqlExpressionGroup();
|
||||
group1.and("t.taskName", "is", null);
|
||||
group1.and("ins.state", "not in", List.of(ProcessInstanceStateEnum.FINISHED.getCode(), ProcessInstanceStateEnum.REJECT.getCode()));
|
||||
group.or(group1);
|
||||
group.or("ins.state", "=", ProcessInstanceStateEnum.DOING.getCode());
|
||||
cnd.and(group);
|
||||
cnd.and("info.userId", "=", userId);
|
||||
@@ -134,9 +139,15 @@ public class MedicalApplyServiceImpl extends BaseServiceImpl<MedicalApply> imple
|
||||
}
|
||||
|
||||
@Override
|
||||
public NutMap calcMedicalMoney(String applyId, String diseaseId) {
|
||||
public NutMap calcMedicalMoney(String applyId, String diseaseId, double ratio) {
|
||||
MedicalSetting medicalSetting = dao().fetch(MedicalSetting.class);
|
||||
|
||||
if (ratio == 0) {
|
||||
//补助比例
|
||||
ratio = medicalSetting.getSubsidyRatio();
|
||||
}
|
||||
|
||||
|
||||
//获取申请信息
|
||||
NutMap applyInfo = this.getApplyInfo(applyId);
|
||||
//获取申请疾病类型
|
||||
@@ -204,8 +215,15 @@ public class MedicalApplyServiceImpl extends BaseServiceImpl<MedicalApply> imple
|
||||
|
||||
//历年来所获全部补助
|
||||
BigDecimal allMoney = applyRecords.stream()
|
||||
.map(a -> a.getString("loveSubsidyMoney") + a.getString("subsidyMoney"))
|
||||
.map(BigDecimal::new)
|
||||
.map(a -> {
|
||||
String loveStr = a.getString("loveSubsidyMoney");
|
||||
String subsidStr = a.getString("subsidyMoney");
|
||||
|
||||
// 处理 null 或空字符串
|
||||
BigDecimal love = StrUtil.isBlank(loveStr) ? BigDecimal.ZERO : new BigDecimal(loveStr);
|
||||
BigDecimal subsid = StrUtil.isBlank(subsidStr) ? BigDecimal.ZERO : new BigDecimal(subsidStr);
|
||||
return love.add(subsid);
|
||||
})
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
|
||||
//是否超过历年所获补助限额
|
||||
@@ -217,9 +235,6 @@ public class MedicalApplyServiceImpl extends BaseServiceImpl<MedicalApply> imple
|
||||
boolean fullTenYears = DateUtil.thisYear() - Integer.parseInt(user.getAidFundDeductTime()) >= 10;
|
||||
boolean fullFifYears = DateUtil.thisYear() - Integer.parseInt(user.getAidFundDeductTime()) >= 15;
|
||||
|
||||
//补助比例
|
||||
double ratio = medicalSetting.getSubsidyRatio();
|
||||
|
||||
|
||||
// 连续缴满15年 或者是 连续缴满10年
|
||||
if (fullFifYears) {
|
||||
@@ -313,10 +328,7 @@ public class MedicalApplyServiceImpl extends BaseServiceImpl<MedicalApply> imple
|
||||
}
|
||||
|
||||
// 规则1:首次申请的重大疾病患者,若个人自付不足5000元,不给予常规补助(由爱心基金覆盖)
|
||||
if (applyInfo.getInt("applyNum") == 1
|
||||
&& applyDiseaseType.getIsMajorDiseases()
|
||||
&& singleBearMoney != null
|
||||
&& singleBearMoney.compareTo(new BigDecimal("5000")) < 0) {
|
||||
if (applyInfo.getInt("applyNum") == 1 && applyDiseaseType.getIsMajorDiseases() && singleBearMoney.compareTo(new BigDecimal("5000")) < 0) {
|
||||
allMedicalMoney = BigDecimal.ZERO;
|
||||
}
|
||||
|
||||
|
||||
+96
@@ -0,0 +1,96 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.medicalMutualAid.medical.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.service.impl.BaseServiceImpl;
|
||||
import com.budwk.app.base.utils.PageUtil;
|
||||
import com.budwk.app.flow.enums.ProcessTaskStateEnum;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.staffbenefit.medicalMutualAid.medical.model.MedicalApply;
|
||||
import com.budwk.app.zhgh.staffbenefit.medicalMutualAid.medical.param.MedicalPageForm;
|
||||
import com.budwk.app.zhgh.staffbenefit.medicalMutualAid.medical.service.MedicalAuditService;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.dao.util.cri.SqlExpressionGroup;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2026/1/24 16:36
|
||||
* @description
|
||||
*/
|
||||
@IocBean(args = {"refer:dao"})
|
||||
public class MedicalAuditServiceImpl extends BaseServiceImpl<MedicalApply> implements MedicalAuditService {
|
||||
public MedicalAuditServiceImpl(Dao dao) {
|
||||
super(dao);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Sql getAuditSql(MedicalPageForm pageForm, Cnd cnd) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
type.diseaseName,
|
||||
type.isMajorDiseases,
|
||||
us.username,
|
||||
us.loginname,
|
||||
us.unitName,
|
||||
us.unionName,
|
||||
ins.id AS instanceId,
|
||||
ins.businessNo,
|
||||
ins.state instanceState,
|
||||
ins.variable instanceVariable,
|
||||
ins.processDefineId instanceProcessDefineId,
|
||||
t.id taskId,
|
||||
t.taskName AS taskKey,
|
||||
t.displayName taskName,
|
||||
t.taskType,
|
||||
t.performType taskPerformType,
|
||||
t.taskState,
|
||||
t.finishTime,
|
||||
t.taskParentId,
|
||||
t.variable taskVariable,
|
||||
IFNULL(GROUP_CONCAT(DISTINCT nt.displayName),'结束') curTaskName,
|
||||
IF(rt.id IS NOT NULL, 1, 0) AS canRevoke
|
||||
FROM
|
||||
wf_process_task t
|
||||
LEFT JOIN wf_process_instance ins ON ins.id = t.processInstanceId
|
||||
LEFT JOIN medical_apply info ON info.id = ins.businessNo
|
||||
LEFT JOIN medical_disease_type type ON info.diseaseId = type.id
|
||||
LEFT JOIN vw_user us ON us.id = info.userId
|
||||
LEFT JOIN wf_process_task_actor ta ON ta.processTaskId = t.id
|
||||
LEFT JOIN wf_process_task nt ON nt.processInstanceId = ins.id AND nt.taskState = 10
|
||||
LEFT JOIN wf_process_task rt ON rt.processInstanceId = ins.id AND rt.taskParentId = t.id AND rt.taskState = 10
|
||||
$condition
|
||||
""");
|
||||
if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
seg.orLike("us.loginname", pageForm.getSearchKeyword());
|
||||
seg.orLike("us.username", pageForm.getSearchKeyword());
|
||||
cnd.and(seg);
|
||||
}
|
||||
cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId()));
|
||||
cnd.andEX("year(info.applyTime)", "=", pageForm.getYear());
|
||||
cnd.andEX("info.diseaseId", "=", pageForm.getDiseaseId());
|
||||
cnd.andEX("us.unionid", "=", pageForm.getUnionId());
|
||||
cnd.andEX("us.unitid", "=", pageForm.getUnitId());
|
||||
cnd.andEX("type.isMajorDiseases", "=", pageForm.getIsMajorDiseases());
|
||||
if (pageForm.getApproval()) {
|
||||
cnd.and("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode()));
|
||||
} else {
|
||||
cnd.and("t.taskState", "=", ProcessTaskStateEnum.DOING.getCode());
|
||||
}
|
||||
|
||||
if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
|
||||
cnd.desc("info.applyTime");
|
||||
} else {
|
||||
cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
|
||||
}
|
||||
cnd.groupBy("t.id");
|
||||
sql.setCondition(cnd);
|
||||
return sql;
|
||||
}
|
||||
}
|
||||
+165
@@ -0,0 +1,165 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.medicalMutualAid.medical.service.impl;
|
||||
|
||||
import com.budwk.app.base.service.impl.BaseServiceImpl;
|
||||
import com.budwk.app.flow.enums.ProcessInstanceStateEnum;
|
||||
import com.budwk.app.zhgh.staffbenefit.medicalMutualAid.aidFund.model.AidFundMemberPay;
|
||||
import com.budwk.app.zhgh.staffbenefit.medicalMutualAid.medical.model.MedicalApply;
|
||||
import com.budwk.app.zhgh.staffbenefit.medicalMutualAid.medical.model.MedicalMoneyDetail;
|
||||
import com.budwk.app.zhgh.staffbenefit.medicalMutualAid.medical.service.MedicalApplyService;
|
||||
import com.budwk.app.zhgh.staffbenefit.medicalMutualAid.medical.service.MedicalCalculateMoneyService;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.Lang;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2026/1/24 14:34
|
||||
* @description
|
||||
*/
|
||||
@IocBean(args = {"refer:dao"})
|
||||
public class MedicalCalculateMoneyServiceImpl extends BaseServiceImpl implements MedicalCalculateMoneyService {
|
||||
public MedicalCalculateMoneyServiceImpl(Dao dao) {
|
||||
super(dao);
|
||||
}
|
||||
|
||||
@Inject
|
||||
private MedicalApplyService medicalApplyService;
|
||||
|
||||
@Override
|
||||
public NutMap getData() {
|
||||
NutMap nutMap = new NutMap();
|
||||
|
||||
//获取申请最新年份
|
||||
Sql yearSql = Sqls.create("SELECT MAX(YEAR(applyTime)) AS currentYear FROM medical_apply");
|
||||
yearSql.setCallback(Sqls.callback.longs());
|
||||
dao().execute(yearSql);
|
||||
Integer year = yearSql.getInt();
|
||||
|
||||
//基金会员会费
|
||||
List<AidFundMemberPay> payList = dao().query(AidFundMemberPay.class, Cnd.where(AidFundMemberPay::getYear, "=", year).and(AidFundMemberPay::getIsPayed, "=", 1));
|
||||
double aidFundMoney = payList.stream().mapToDouble(AidFundMemberPay::getMoney).sum();
|
||||
nutMap.setv("aidFundMoney", aidFundMoney);
|
||||
|
||||
//工会往年结余金额
|
||||
List<MedicalMoneyDetail> detailList = dao().query(MedicalMoneyDetail.class, Cnd.where(MedicalMoneyDetail::getYear, "<", year));
|
||||
BigDecimal balanceMoney = detailList.stream()
|
||||
.map(MedicalMoneyDetail::getLastYearBalance)
|
||||
.filter(Objects::nonNull) // 防御性:排除 null 值
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
nutMap.setv("balanceMoney", balanceMoney);
|
||||
|
||||
MedicalMoneyDetail moneyDetail = dao().fetch(MedicalMoneyDetail.class, Cnd.where("year", "=", year));
|
||||
nutMap.setv("schoolGrants", Lang.isEmpty(moneyDetail) ? 0 : moneyDetail.getSchoolGrants());
|
||||
nutMap.setv("unionInto", Lang.isEmpty(moneyDetail) ? 0 : moneyDetail.getUnionInto());
|
||||
nutMap.setv("ratio", Lang.isEmpty(moneyDetail) ? null : moneyDetail.getRatio());
|
||||
|
||||
|
||||
//查询申请成功的补助金额
|
||||
List<NutMap> applyList = this.getApplyList(year);
|
||||
double subsidyMoney = applyList.stream().mapToDouble(apply -> apply.getDouble("subsidyMoney")).sum();
|
||||
nutMap.setv("subsidyMoney", subsidyMoney);
|
||||
|
||||
//获取申请成功的爱心补助金额
|
||||
//找到有多少数据
|
||||
int firstApplyCount = applyList.stream().filter(apply -> apply.getInt("applyNum") == 1).toList().size();
|
||||
nutMap.setv("loveSubsidyMoney", firstApplyCount * 5000);
|
||||
|
||||
//查询申请成功后的住院缴费金额
|
||||
List<String> applyIds = applyList.stream().map(v -> v.getString("id")).toList();
|
||||
double applyCostMoneySum = this.getApplyCostMoneySum(applyIds);
|
||||
BigDecimal applyCostMoneySumBig = BigDecimal.valueOf(applyCostMoneySum)
|
||||
.setScale(2, RoundingMode.HALF_UP);
|
||||
nutMap.setv("applySum", applyCostMoneySumBig);
|
||||
|
||||
return nutMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<NutMap> getApplyData(double ratio) {
|
||||
//获取申请最新年份
|
||||
Sql yearSql = Sqls.create("SELECT MAX(YEAR(applyTime)) AS currentYear FROM medical_apply");
|
||||
yearSql.setCallback(Sqls.callback.longs());
|
||||
dao().execute(yearSql);
|
||||
Integer year = yearSql.getInt();
|
||||
|
||||
List<NutMap> applyList = this.getApplyList(year);
|
||||
applyList = medicalApplyService.getCostList(applyList);
|
||||
|
||||
applyList.forEach(apply -> {
|
||||
apply.putAll(medicalApplyService.calcMedicalMoney(apply.getString("id"),null, ratio));
|
||||
});
|
||||
|
||||
|
||||
return applyList;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据申请id查询出住院缴费金额
|
||||
*
|
||||
* @param applyIds
|
||||
* @return
|
||||
*/
|
||||
public double getApplyCostMoneySum(List<String> applyIds) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
( sum( personExpenseMoney ) + sum( outpatientServiceMoney ) ) AS applySum
|
||||
FROM
|
||||
medical_apply_cost
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("applyId", "in", applyIds);
|
||||
sql.setCondition(cnd);
|
||||
sql.setCallback(Sqls.callback.doubleValue());
|
||||
dao().execute(sql);
|
||||
double applySum = sql.getDouble();
|
||||
return applySum;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询申请成功的记录
|
||||
*
|
||||
* @param year
|
||||
* @return
|
||||
*/
|
||||
public List<NutMap> getApplyList(Integer year) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
type.diseaseName,
|
||||
type.isMajorDiseases,
|
||||
us.username,
|
||||
us.loginname,
|
||||
us.unitName,
|
||||
us.unionName,
|
||||
us.aidFundDeductTime,
|
||||
YEAR(CURDATE()) - us.aidFundDeductTime AS yearsSinceDeduct
|
||||
FROM
|
||||
medical_apply info
|
||||
LEFT JOIN medical_disease_type type ON info.diseaseId = type.id
|
||||
LEFT JOIN vw_user us ON us.id = info.userId
|
||||
LEFT JOIN `wf_process_instance` ins ON ins.businessNo = info.id
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("YEAR(info.applyTime)", "=", year);
|
||||
cnd.and("ins.state", "=", ProcessInstanceStateEnum.FINISHED.getCode());
|
||||
sql.setCondition(cnd);
|
||||
List<NutMap> listMap = listMap(sql);
|
||||
return listMap;
|
||||
}
|
||||
}
|
||||
+10
-7
@@ -405,7 +405,7 @@ layout("/layouts/platform.html"){
|
||||
this.$message.error("请添加住院记录!")
|
||||
return
|
||||
}
|
||||
if (!this.validateIsMajorDiseases()){
|
||||
if (!this.validateIsMajorDiseases()) {
|
||||
this.$alert('您的个人承担部分金额达不到补助标准,无法申请!', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
callback: action => {
|
||||
@@ -431,8 +431,6 @@ layout("/layouts/platform.html"){
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
@@ -443,7 +441,7 @@ layout("/layouts/platform.html"){
|
||||
this.$message.error("请添加住院记录!")
|
||||
return
|
||||
}
|
||||
if (!this.validateIsMajorDiseases()){
|
||||
if (!this.validateIsMajorDiseases()) {
|
||||
this.$alert('您的个人承担部分金额达不到补助标准,无法申请!', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
callback: action => {
|
||||
@@ -500,9 +498,13 @@ layout("/layouts/platform.html"){
|
||||
|
||||
},
|
||||
async createRemoteMethod(keyword) {
|
||||
const resp = await this.$axios.post(loc() + "/getSubsidyUser", {keyword})
|
||||
if (resp.code === 0) {
|
||||
this.userOptions = resp.data;
|
||||
try {
|
||||
const resp = await this.$axios.post(loc() + "/getSubsidyUser", {keyword})
|
||||
if (resp.code === 0) {
|
||||
this.userOptions = resp.data;
|
||||
}
|
||||
} catch (e) {
|
||||
this.$message.error(e.msg)
|
||||
}
|
||||
},
|
||||
getDiseaseList() {
|
||||
@@ -557,6 +559,7 @@ layout("/layouts/platform.html"){
|
||||
|
||||
}
|
||||
}).catch(e => {
|
||||
this.formData = {}
|
||||
this.$alert(e.msg, '温馨提示', {
|
||||
confirmButtonText: '确定',
|
||||
callback: action => {
|
||||
|
||||
+341
@@ -0,0 +1,341 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<style>
|
||||
#calcSubsidyTable .el-button--text i {
|
||||
font-size: 20px !important;
|
||||
}
|
||||
|
||||
#calcSubsidyTable .el-col .symbol {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
font-size: 30px;
|
||||
}
|
||||
</style>
|
||||
<div id="app">
|
||||
<custom-card>
|
||||
<div id="calcSubsidyTable" v-loading="formLoading">
|
||||
<div class="process-title">1.输入金额(元)</div>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6">
|
||||
<el-input placeholder="本年度收入累计总额" readonly v-model="inComeSum" style="width: 100%">
|
||||
<template slot="prepend">本年度收入累计总额</template>
|
||||
</el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">
|
||||
<span class="symbol">=</span>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-input readonly v-model.number="calcData.aidFundMoney">
|
||||
<template slot="prepend">年度缴费总额</template>
|
||||
</el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">
|
||||
<span class="symbol">+</span>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-input @blur="(e)=>{grantOrIntoChange('grants',e.target.value)}"
|
||||
oninput="value=value.replace(/[^\d]/g,'')"
|
||||
v-model.number="calcData.schoolGrants">
|
||||
<template slot="prepend">学校拨款金额</template>
|
||||
</el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">
|
||||
<span class="symbol">+</span>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-input @blur="(e)=>{grantOrIntoChange('into',e.target.value)}"
|
||||
oninput="value=value.replace(/[^\d]/g,'')"
|
||||
v-model.number="calcData.unionInto">
|
||||
<template slot="prepend">工会转入</template>
|
||||
</el-input>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20" class="mt20">
|
||||
<el-col :span="6">
|
||||
<el-input readonly v-model="applyLoveSum">
|
||||
<template slot="prepend">本年度申请费用总额</template>
|
||||
</el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">
|
||||
<span class="symbol">=</span>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-input readonly v-model="calcData.applySum">
|
||||
<template slot="prepend">申请金额合计</template>
|
||||
</el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">
|
||||
<span class="symbol">+</span>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-input readonly v-model="calcData.loveSubsidyMoney">
|
||||
<template slot="prepend">爱心补助合计</template>
|
||||
</el-input>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-divider></el-divider>
|
||||
<div class="process-title">2.预测收支占比</div>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-progress :percentage="payThanInCome" type="circle"
|
||||
style="display: flex;justify-content: center;"></el-progress>
|
||||
<div style="text-align: center;font-size: 17px;">
|
||||
预测总额(ps:预测补助金额+爱心补助金额)/本年度收入累计总额
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<div style="text-align: center;font-size: 17px;">
|
||||
<div>
|
||||
<span>本年度实际补助总金额:</span>
|
||||
<span>{{parseFloat(tableSummaries[tableSummaries.length-1]) + calcData.loveSubsidyMoney}}元
|
||||
</span>
|
||||
</div>
|
||||
<div>
|
||||
<span>医疗补助合计:</span>
|
||||
<span>{{tableSummaries[tableSummaries.length-1]}}元
|
||||
</span>
|
||||
</div>
|
||||
<div>
|
||||
<span>爱心补助合计:</span>
|
||||
<span>{{calcData.loveSubsidyMoney}}元
|
||||
</span>
|
||||
</div>
|
||||
<div>
|
||||
<span>本年度结余:</span>
|
||||
<span>{{inComeSum - (parseFloat(tableSummaries[tableSummaries.length-1]) +
|
||||
calcData.loveSubsidyMoney)}}元
|
||||
</span>
|
||||
</div>
|
||||
<div>
|
||||
<span>累计结余:</span>
|
||||
<span>{{inComeSum + calcData.balanceMoney -
|
||||
(parseFloat(tableSummaries[tableSummaries.length-2]) + calcData.loveSubsidyMoney)}}元
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
|
||||
<el-divider></el-divider>
|
||||
<div class="process-title">3.测算补助金额</div>
|
||||
<el-row :gutter="20">
|
||||
<el-col>
|
||||
<el-slider @change="getApplyData" show-input v-model="ratio"></el-slider>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-table :data="applyListData" ref="table" row-key="id" style="width: 100%"
|
||||
:summary-method="getSummaries" show-summary>
|
||||
<el-table-column type="index" width="50px" label="序号"
|
||||
fixed="left"></el-table-column>
|
||||
<el-table-column
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:key="column.prop"
|
||||
:width="column.width"
|
||||
:fixed="column.fixed"
|
||||
:sortable="column.sortable"
|
||||
show-overflow-tooltip
|
||||
sortable
|
||||
v-for="column in tableColumns"
|
||||
>
|
||||
<template v-if="column.prop==='isMajorDiseases'" v-slot="{row}">
|
||||
<span :class="[row.isMajorDiseases?'text-danger':'text-info']">
|
||||
<i class="fa fa-circle ml5"></i>
|
||||
{{row.isMajorDiseases?'是':'否'}}({{row.applyNum}})
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="'按'+ratio+'%补助金额'" fixed="right" min-width="150px"
|
||||
prop="forecastSubsidyMoney"
|
||||
show-overflow-tooltip sortable>
|
||||
<template slot-scope="{row}">
|
||||
<el-input oninput="value=value.replace(/[^\d]/g,'')"
|
||||
v-model="row.forecastSubsidyMoney"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="以往累计补助金额" prop="medicalSubsidyMoney" fixed="right" show-overflow-tooltip
|
||||
sortable
|
||||
width="110px">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
</div>
|
||||
<template slot="footer">
|
||||
<el-button type="primary" @click="doExport" :loading="formLoading">导出测算补助金额</el-button>
|
||||
<el-button type="primary" @click="doHandle" :loading="formLoading">按{{ratio+'%'}}比例分配</el-button>
|
||||
</template>
|
||||
</custom-card>
|
||||
</div>
|
||||
|
||||
<script nonce="${cspNonce!}">
|
||||
|
||||
new Vue({
|
||||
el: "#app",
|
||||
store,
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
calcData: {
|
||||
aidFundMoney: 0,
|
||||
schoolGrants: 0,
|
||||
balanceMoney: 0,
|
||||
unionInto: 0,
|
||||
applySum: 0,
|
||||
ratio: 0
|
||||
},
|
||||
ratio: 60,
|
||||
medicalSetting: {},
|
||||
applyListData: [],
|
||||
tableSummaries: [],
|
||||
tableColumns: [
|
||||
{prop: 'loginname', label: '工号', fixed: "left"},
|
||||
{prop: 'username', label: '姓名', fixed: "left"},
|
||||
{prop: 'unionName', label: '所属工会', width: "180"},
|
||||
{prop: 'unitName', label: '所属单位', width: "180"},
|
||||
{prop: 'diseaseName', label: '疾病种类', width: "180"},
|
||||
{prop: 'isMajorDiseases', label: '重大疾病(次数)', width: "100"},
|
||||
{prop: 'applyNum', label: '申请总次数'},
|
||||
{prop: 'applyTime', label: '申请时间', width: "180"},
|
||||
{prop: 'aidFundDeductTime', label: '起扣时间', width: "100"},
|
||||
{prop: 'yearsSinceDeduct', label: '缴费年数', width: "100"},
|
||||
{prop: 'hospitalSumMoney$', label: '住院医疗总额(不含门诊)', width: "120"},
|
||||
{prop: 'reimbursementMoney$', label: '实际报销总额', width: "120"},
|
||||
{prop: 'singleBearMoney$', label: '(住院医疗)允许报销范围内个人承担部分总额', width: "120"},
|
||||
{prop: 'personExpenseMoney$', label: '(住院医疗)自费部分总额', width: "120"},
|
||||
{prop: 'outpatientServiceMoney$', label: '重病门诊自费金额', width: "120"},
|
||||
{prop: 'bxyMoney$', label: '非住院肾衰竭治疗、靶向药金额', width: "120"},
|
||||
{prop: 'totalMoney', label: '合计金额', width: "120"},
|
||||
{prop: 'loveSubsidyMoney', label: '爱心补助', width: "120"},
|
||||
{prop: 'forecastSubsidyMoney', label: '当前补助金额', width: "120"},
|
||||
],
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
//申请费用总额
|
||||
applyLoveSum() {
|
||||
const {applySum, loveSubsidyMoney} = this.calcData
|
||||
const applyLoveSum = applySum + loveSubsidyMoney
|
||||
return isNaN(applyLoveSum) ? 0 : applyLoveSum.toFixed(2)
|
||||
},
|
||||
inComeSum() {
|
||||
const {aidFundMoney, schoolGrants, balanceMoney, unionInto} = this.calcData
|
||||
return aidFundMoney + schoolGrants + unionInto
|
||||
},
|
||||
//预测支出/总收入
|
||||
payThanInCome() {
|
||||
const loveMoney = parseFloat(this.tableSummaries.slice(15, 16)[0])
|
||||
const bzMoney = parseFloat(this.tableSummaries.slice(-1)[0])
|
||||
|
||||
const num = parseFloat(bzMoney) + parseFloat(loveMoney);
|
||||
|
||||
const total = parseFloat(this.inComeSum);
|
||||
if (isNaN(num) || isNaN(total)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
const progress = total <= 0 ? 0 : (Math.round(num / total * 10000) / 100.00)
|
||||
|
||||
return progress > 100 ? 100 : progress
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
getSummaries(param) {
|
||||
const {columns, data} = param
|
||||
const sums = []
|
||||
columns.forEach((column, index) => {
|
||||
const sumColumn = ['hospitalSumMoney$', 'reimbursementMoney$', 'singleBearMoney$', 'personExpenseMoney$'
|
||||
, 'subsidyMoney', 'loveSubsidyMoney', 'outpatientServiceMoney$'
|
||||
, 'totalMoney', 'loveSubsidyMoney', 'forecastSubsidyMoney']
|
||||
if (sumColumn.includes(column.property)) {
|
||||
const values = data.map(i => Number(i[column.property]))
|
||||
if (values && values.length > 0) {
|
||||
const everyColumnSum = values.reduce((a, b) => a + b)
|
||||
sums[index] = isNaN(everyColumnSum) ? 0 : everyColumnSum.toFixed(2)
|
||||
}
|
||||
}
|
||||
})
|
||||
sums[0] = '合计'
|
||||
this.tableSummaries = sums
|
||||
return sums
|
||||
},
|
||||
doExport() {
|
||||
this.$downLoad("/platform/medicalMutualAid/medical/calculateMoney/doExport", {
|
||||
ratio: this.ratio})
|
||||
},
|
||||
doHandle() {
|
||||
this.$confirm('确定要按此比例来补助吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$axios.post("/platform/medicalMutualAid/medical/calculateMoney/doHandle", {
|
||||
data: JSON.stringify(this.applyListData),
|
||||
ratio: this.ratio,
|
||||
aidFund: this.calcData.aidFundMoney,
|
||||
inComeSum: this.inComeSum,
|
||||
loveSubsidyMoney: this.calcData.loveSubsidyMoney
|
||||
}).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success("操作成功")
|
||||
this.getData()
|
||||
this.getApplyData()
|
||||
}
|
||||
})
|
||||
|
||||
})
|
||||
},
|
||||
async getMedicalSetting() {
|
||||
try {
|
||||
const res = await this.$axios.post("/platform/medicalMutualAid/medical/basicSetting/getSetting")
|
||||
if (res.code === 0) {
|
||||
this.medicalSetting = res.data
|
||||
}
|
||||
} catch (e) {
|
||||
this.$message.error(e.message)
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
getData() {
|
||||
this.formLoading = true
|
||||
this.$axios.post("/platform/medicalMutualAid/medical/calculateMoney/getData").then(res => {
|
||||
if (res.code === 0) {
|
||||
if (res.data.ratio) {
|
||||
this.ratio = res.data.ratio
|
||||
} else {
|
||||
this.ratio = this.medicalSetting.subsidyRatio
|
||||
}
|
||||
this.calcData = res.data
|
||||
this.getApplyData()
|
||||
}
|
||||
}).finally(()=>{
|
||||
this.formLoading=false
|
||||
})
|
||||
},
|
||||
getApplyData() {
|
||||
this.$axios.post("/platform/medicalMutualAid/medical/calculateMoney/getApplyData", {ratio: this.ratio}).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.applyListData = res.data
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
await this.getMedicalSetting()
|
||||
this.getData()
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
+10
@@ -51,6 +51,12 @@ layout("/layouts/platform.html"){
|
||||
|
||||
<el-card shadow="never">
|
||||
<table-tool label="申请列表">
|
||||
<el-button type="primary" @click="doExport" size="small">导出</el-button>
|
||||
<el-radio-group v-model="pageForm.isMajorDiseases" size="small" @change="doSearch">
|
||||
<el-radio-button :label="null">全部</el-radio-button>
|
||||
<el-radio-button :label="true">重疾</el-radio-button>
|
||||
<el-radio-button :label="false">普通</el-radio-button>
|
||||
</el-radio-group>
|
||||
<el-radio-group v-model="pageForm.approval" size="small" @change="doSearch">
|
||||
<el-radio-button :label="true">已审核</el-radio-button>
|
||||
<el-radio-button :label="false">未审核</el-radio-button>
|
||||
@@ -213,6 +219,7 @@ layout("/layouts/platform.html"){
|
||||
showApprovalForm: false,
|
||||
pageForm: {
|
||||
approval: false,
|
||||
isMajorDiseases: null,
|
||||
year: new Date().getFullYear() + "",
|
||||
},
|
||||
medicalSetting: {}
|
||||
@@ -223,6 +230,9 @@ layout("/layouts/platform.html"){
|
||||
"medical-info": MEDICAL_INFO
|
||||
},
|
||||
methods: {
|
||||
doExport() {
|
||||
this.$downLoad("/platform/medicalMutualAid/medical/foundationAudit/doExport", this.pageForm)
|
||||
},
|
||||
// 修改表格里面的金额并修改数据库里的数据
|
||||
tableChangeMoney() {
|
||||
this.costList.forEach(cost => {
|
||||
|
||||
+182
@@ -0,0 +1,182 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<div id="app">
|
||||
<guava ref="guava">
|
||||
<el-card shadow="never">
|
||||
<search @search="doSearch">
|
||||
<search-item label="年度">
|
||||
<el-date-picker
|
||||
v-model="pageForm.year"
|
||||
type="year"
|
||||
value-format="yyyy"
|
||||
placeholder="请选择年度"
|
||||
style="width: 100%"
|
||||
@change="doSearch"
|
||||
></el-date-picker>
|
||||
</search-item>
|
||||
<search-item label="姓名/工号">
|
||||
<el-input placeholder="请输入姓名或工号" clearable v-model="pageForm.searchKeyword"
|
||||
@keyup.enter.native="doSearch">
|
||||
</el-input>
|
||||
</search-item>
|
||||
<search-item label="疾病种类">
|
||||
<el-select clearable placeholder="请选择疾病种类"
|
||||
v-model="pageForm.diseaseId" filterable>
|
||||
<el-option
|
||||
:key="i.id"
|
||||
:label="i.diseaseName"
|
||||
:value="i.id"
|
||||
v-for="i in diseaseList">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
|
||||
</search>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never">
|
||||
<table-tool label="申请列表">
|
||||
<el-radio-group v-model="pageForm.approval" size="small" @change="doSearch">
|
||||
<el-radio-button :label="true">已审核</el-radio-button>
|
||||
<el-radio-button :label="false">未审核</el-radio-button>
|
||||
</el-radio-group>
|
||||
</table-tool>
|
||||
<medical-table ref="table" :local-table-data="tableData" v-loading="tableLoading"
|
||||
:local-page-form="pageForm" @ready="doSearch">
|
||||
<template slot="operation">
|
||||
<el-table-column label="操作" fixed="right" width="200">
|
||||
<template slot-scope="{row}">
|
||||
<el-button @click="onView(row)" size="mini" type="primary">查看</el-button>
|
||||
<el-button v-if="row.taskState === 10" @click="onAudit(row)" size="mini" type="primary">
|
||||
审核
|
||||
</el-button>
|
||||
<el-button v-if="row.canRevoke" @click="onRevoke(row)" size="mini" type="danger">撤回
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</template>
|
||||
</medical-table>
|
||||
|
||||
</el-card>
|
||||
|
||||
|
||||
<template #edit>
|
||||
<medical-info ref="medicalInfoRef">
|
||||
<div v-if="showApprovalForm">
|
||||
<div class="process-title">
|
||||
{{formData.taskName}}
|
||||
</div>
|
||||
<el-form :model="formData" ref="formRef" :rules="formRules" label-width="0" label-suffix=":"
|
||||
class="flow-task-form">
|
||||
<el-form-item label="审批意见" prop="tf_opinion"
|
||||
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
|
||||
<user-opinion-textarea v-model="formData.tf_opinion"></user-opinion-textarea>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row type="flex" justify="end">
|
||||
<el-button @click="$refs.guava.index()" size="small">取消</el-button>
|
||||
<el-button @click="handleTaskAction(6)" size="small" type="info">退回到发起人</el-button>
|
||||
<el-button @click="handleTaskAction(2)" size="small" type="danger">拒绝申请</el-button>
|
||||
<el-button @click="handleTaskAction(1)" size="small" type="primary">同意申请</el-button>
|
||||
</el-row>
|
||||
</div>
|
||||
</medical-info>
|
||||
</template>
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
<script nonce="${cspNonce!}">
|
||||
<!--#include('../common/medicalTable.js'){}#-->
|
||||
<!--#include('../common/medicalInfo.js'){}#-->
|
||||
new Vue({
|
||||
el: "#app",
|
||||
store,
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
diseaseList: [],
|
||||
showApprovalForm: false,
|
||||
pageForm: {
|
||||
approval: false,
|
||||
year: new Date().getFullYear() + "",
|
||||
},
|
||||
}
|
||||
},
|
||||
components: {
|
||||
"medical-table": MEDICAL_TABLE,
|
||||
"medical-info": MEDICAL_INFO
|
||||
},
|
||||
methods: {
|
||||
onView(row) {
|
||||
this.$refs.guava.edit(() => {
|
||||
this.showApprovalForm = false
|
||||
this.$refs.medicalInfoRef.onOpen(row)
|
||||
})
|
||||
},
|
||||
onAudit(row) {
|
||||
this.$refs.guava.edit(() => {
|
||||
this.showApprovalForm = true
|
||||
this.formData = {
|
||||
processTaskId: row.taskId,
|
||||
taskName: row.curTaskName
|
||||
}
|
||||
this.$refs.medicalInfoRef.onOpen(row)
|
||||
})
|
||||
},
|
||||
handleTaskAction(val) {
|
||||
this.$refs.formRef.validate((valid) => {
|
||||
if (valid) {
|
||||
this.$confirm("您确定要提交吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
this.$axios.post("/flow/common/executeTask", {
|
||||
data: JSON.stringify({
|
||||
...this.formData,
|
||||
submitType: val
|
||||
})
|
||||
}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$refs.guava.index()
|
||||
this.$message.success(res.msg)
|
||||
this.doSearch()
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
onRevoke(row) {
|
||||
this.$confirm("您确定要撤回吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "info"
|
||||
}).then(() => {
|
||||
this.$axios.post("/flow/common/revokeTask", {taskId: row.taskId}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success(res.msg)
|
||||
this.doSearch()
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
getDiseaseList() {
|
||||
this.$axios.post("/platform/medicalMutualAid/medical/apply/getDiseaseList").then(res => {
|
||||
if (res.code === 0) {
|
||||
this.diseaseList = res.data;
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.getDiseaseList()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
Reference in New Issue
Block a user