省级互助保障修改
This commit is contained in:
+17
-27
@@ -20,7 +20,9 @@ import com.budwk.app.flow.service.FlowCommonService;
|
||||
import com.budwk.app.web.commons.auth.utils.AuthUtil;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.staffbenefit.maternityLeave.models.MaternityLeave;
|
||||
import com.budwk.app.zhgh.staffbenefit.mutualInsurance.model.MutualInsuranceProject;
|
||||
import com.budwk.app.zhgh.staffbenefit.mutualInsurance.model.MutualInsuranceUserInfo;
|
||||
import com.budwk.app.zhgh.staffbenefit.mutualInsurance.service.MutualInsuranceProjectService;
|
||||
import com.budwk.app.zhgh.staffbenefit.mutualInsurance.service.MutualInsuranceUserService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@@ -67,6 +69,8 @@ public class MutualInsuranceApplyController {
|
||||
@Inject
|
||||
private FlowCommonService flowCommonService;
|
||||
@Inject
|
||||
private MutualInsuranceProjectService mutualInsuranceProjectService;
|
||||
@Inject
|
||||
private MutualInsuranceUserService mutualInsuranceUserService;
|
||||
|
||||
@At("/index")
|
||||
@@ -86,6 +90,7 @@ public class MutualInsuranceApplyController {
|
||||
@SLog(tag = "生育休假-休假申请", msg = "保存休假申请")
|
||||
public Result save(@Param("data") MutualInsuranceUserInfo mutualInsuranceUserInfo) {
|
||||
if (StrUtil.isBlank(mutualInsuranceUserInfo.getId())) mutualInsuranceUserInfo.setApplyTime(new Date());
|
||||
mutualInsuranceUserInfo.setIsSubmit("未提交");
|
||||
dao.insertOrUpdate(mutualInsuranceUserInfo);
|
||||
return Result.success();
|
||||
}
|
||||
@@ -95,37 +100,11 @@ public class MutualInsuranceApplyController {
|
||||
@SaCheckPermission(value = {"mutualInsurance.apply", "h5.mutualInsurance.apply"}, mode = SaMode.OR)
|
||||
public Result submit(@Param("data") MutualInsuranceUserInfo mutualInsuranceUserInfo) {
|
||||
if (StrUtil.isBlank(mutualInsuranceUserInfo.getId())) mutualInsuranceUserInfo.setApplyTime(new Date());
|
||||
|
||||
mutualInsuranceUserInfo.setIsSubmit("已提交");
|
||||
dao.insertOrUpdate(mutualInsuranceUserInfo);
|
||||
// 开启流程实例
|
||||
Dict args = Dict.create();
|
||||
args.set(FlowConst.SUBMIT_TYPE, ProcessSubmitTypeEnum.APPLY.getCode());
|
||||
args.set(FlowConst.FORM_DATA, mutualInsuranceUserInfo);
|
||||
ProcessInstance instance = flowEngine.startProcessInstanceByKey("SJHZBZ", mutualInsuranceUserInfo.getId(), SecurityUtil.getUserId(), args);
|
||||
|
||||
// 自动完成第一个申请任务
|
||||
List<ProcessTask> doingTaskList = flowEngine.processTaskService().getDoingTaskList(instance.getId(), null);
|
||||
for (ProcessTask task : doingTaskList) {
|
||||
flowEngine.executeProcessTask(task.getId(), SecurityUtil.getUserId(), args);
|
||||
}
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("重新提交申请")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission(value = {"mutualInsurance.apply", "h5.mutualInsurance.apply"}, mode = SaMode.OR)
|
||||
public Result submitAgain(@Param("data") MutualInsuranceUserInfo mutualInsuranceUserInfo, @Param("taskId") Long taskId) {
|
||||
if (StrUtil.isBlank(mutualInsuranceUserInfo.getId())) mutualInsuranceUserInfo.setApplyTime(new Date());
|
||||
|
||||
dao.insertOrUpdate(mutualInsuranceUserInfo);
|
||||
|
||||
Dict dict = Dict.create();
|
||||
dict.set(FlowConst.PROCESS_TASK_ID_KEY, taskId);
|
||||
dict.set(FlowConst.SUBMIT_TYPE, ProcessSubmitTypeEnum.RE_APPLY.getCode());
|
||||
flowCommonService.executeTask(dict);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckLogin
|
||||
@@ -133,6 +112,17 @@ public class MutualInsuranceApplyController {
|
||||
return Result.success(baseService.dao().fetch(MutualInsuranceUserInfo.class, id));
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("查询事项列表")
|
||||
@SaCheckPermission(value = {"mutualInsurance.apply", "h5.mutualInsurance.apply"}, mode = SaMode.OR)
|
||||
public Result listProject(Integer year){
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.andEX("`year`", "=", year == null ? DateUtil.thisYear() : year);
|
||||
cnd.and("isOpen", "=", true);
|
||||
List<MutualInsuranceProject> query = mutualInsuranceProjectService.query(cnd);
|
||||
return Result.success(query);
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("获取受助人")
|
||||
@SaCheckPermission("mutualInsurance.apply")
|
||||
|
||||
+1
-1
@@ -119,7 +119,7 @@ public class MutualInsuranceCollectController {
|
||||
}
|
||||
|
||||
// 只查询流程实例状态为20的数据(已完成状态)
|
||||
cnd.and("ins.state", "=", 20);
|
||||
// cnd.and("ins.state", "=", 20);
|
||||
|
||||
cnd.desc("info.applyTime");
|
||||
sql.setCondition(cnd);
|
||||
|
||||
+59
-1
@@ -2,18 +2,35 @@ package com.budwk.app.zhgh.staffbenefit.mutualInsurance.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.dev33.satoken.annotation.SaMode;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.convert.NumberChineseFormatter;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.lang.Dict;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
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.SysOfficeTemplateUtil;
|
||||
import com.budwk.app.flow.engine.FlowEngine;
|
||||
import com.budwk.app.flow.entity.ProcessTask;
|
||||
import com.budwk.app.flow.vo.ProcessTaskVO;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.web.commons.base.Globals;
|
||||
import com.budwk.app.zhgh.activity.declarereimbursement.vo.ActivityBudgetVO;
|
||||
import com.budwk.app.zhgh.staffbenefit.mutualInsurance.model.MutualInsuranceUserInfo;
|
||||
import com.budwk.app.zhgh.staffbenefit.mutualInsurance.service.MutualInsuranceUserService;
|
||||
import com.deepoove.poi.XWPFTemplate;
|
||||
import com.deepoove.poi.config.Configure;
|
||||
import com.deepoove.poi.plugin.table.LoopRowTableRenderPolicy;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
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.aop.Aop;
|
||||
@@ -24,6 +41,14 @@ import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @version 1.0
|
||||
* @Author zzr
|
||||
@@ -39,9 +64,13 @@ import org.nutz.mvc.annotation.Param;
|
||||
@Slf4j
|
||||
public class MutualInsuranceMineController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private FlowEngine flowEngine;
|
||||
@Inject
|
||||
private SysOfficeTemplateUtil sysOfficeTemplateUtil;
|
||||
@Inject
|
||||
private MutualInsuranceUserService mutualInsuranceUserService;
|
||||
|
||||
@At("/index")
|
||||
@@ -49,6 +78,7 @@ public class MutualInsuranceMineController {
|
||||
@SaCheckPermission("mutualInsurance.mine")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At("/h5")
|
||||
@Ok("beetl:/platform/zhghh5/staffbenefit/mutualInsurance/mine/index.html")
|
||||
@SaCheckPermission("h5.mutualInsurance.mine")
|
||||
@@ -100,10 +130,38 @@ public class MutualInsuranceMineController {
|
||||
@ApiOperation("删除")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission(value = {"mutualInsurance.mine", "h5.mutualInsurance.mine"}, mode = SaMode.OR)
|
||||
@SLog( tag = "删除工会报销", msg = "删除工会报销")
|
||||
@SLog(tag = "删除工会报销", msg = "删除工会报销")
|
||||
public Result delete(@Param("id") String id) {
|
||||
mutualInsuranceUserService.delete(id);
|
||||
flowEngine.processInstanceService().deleteProcessInstanceByBusinessKey(id);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("void")
|
||||
@SaCheckPermission("mutualInsurance.mine")
|
||||
@SLog(tag = "省级互助保障", msg = "导出给付申请书")
|
||||
public void doExportApply(@Valid String id, HttpServletResponse response) {
|
||||
MutualInsuranceUserInfo info = dao.fetch(MutualInsuranceUserInfo.class, id);
|
||||
Map<String, Object> docData = BeanUtil.beanToMap(info);
|
||||
|
||||
String dangerEvent = sysOfficeTemplateUtil.convertRichTextToDocText(info.getDangerEvent());
|
||||
dangerEvent = dangerEvent.trim().replaceAll("^<p>", "").replaceAll("</p>$", "");
|
||||
docData.put("dangerEvent", dangerEvent);
|
||||
docData.put("isRenewal", info.getIsRenewal() ? " √" : "×");
|
||||
docData.put("guaranteedStartTime", DateUtil.format(info.getGuaranteedStartTime(), "yyyy-MM-dd"));
|
||||
docData.put("guaranteedEndTime", DateUtil.format(info.getGuaranteedEndTime(), "yyyy-MM-dd"));
|
||||
docData.put("dangerTime", DateUtil.format(info.getDangerTime(), "yyyy-MM-dd HH:mm:ss"));
|
||||
docData.put("applyTime", DateUtil.format(info.getApplyTime(), "yyyy年MM月dd日"));
|
||||
|
||||
|
||||
String fileName = Globals.AppName + "【" + info.getProjectName() + "】给付申请书.docx";
|
||||
|
||||
try (ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream()) {
|
||||
XWPFTemplate.compile(sysOfficeTemplateUtil.getTemplate("mutual_insurance_user_info")).render(docData).writeAndClose(byteArrayOutputStream);
|
||||
CommonDownloadUtil.download(fileName, byteArrayOutputStream.toByteArray(), response);
|
||||
} catch (IOException e) {
|
||||
log.error("给付申请书表导出失败,id:{},错误信息:{}", id, e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
-13
@@ -105,19 +105,6 @@ public class MutualInsuranceProjectController {
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ApiOperation("查询事项列表")
|
||||
@SaCheckPermission(value = {"mutualInsurance.project", "h5.mutualInsurance.project"}, mode = SaMode.OR)
|
||||
public Result listProject(Integer year){
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.andEX("`year`", "=", year == null ? DateUtil.thisYear() : year);
|
||||
cnd.and("isOpen", "=", true);
|
||||
List<MutualInsuranceProject> query = mutualInsuranceProjectService.query(cnd);
|
||||
return Result.success(query);
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@SaCheckPermission(value = {"mutualInsurance.project", "h5.mutualInsurance.project"}, mode = SaMode.OR)
|
||||
public Result findOne(String id){
|
||||
|
||||
+81
-25
@@ -4,6 +4,7 @@ import com.budwk.app.base.model.BaseModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
import org.nutz.dao.interceptor.annotation.PrevInsert;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
@@ -20,11 +21,10 @@ import java.util.Date;
|
||||
@Comment("个人信息")
|
||||
public class MutualInsuranceUserInfo extends BaseModel implements Serializable {
|
||||
|
||||
@Column
|
||||
@Name
|
||||
@Comment("id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@Prev(els = {@EL("uuid()")})
|
||||
@PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
@Column
|
||||
@@ -68,25 +68,10 @@ public class MutualInsuranceUserInfo extends BaseModel implements Serializable {
|
||||
private String loginName;
|
||||
|
||||
@Column
|
||||
@Comment("姓名")
|
||||
@Comment("申请人")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String userName;
|
||||
|
||||
@Column
|
||||
@Comment("性别")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 4)
|
||||
private String sex;
|
||||
|
||||
@Column
|
||||
@Comment("手机号")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String mobile;
|
||||
|
||||
@Column
|
||||
@Comment("身份证件号")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 20)
|
||||
private String idCard;
|
||||
|
||||
@Column
|
||||
@Comment("所属单位Id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@@ -108,19 +93,90 @@ public class MutualInsuranceUserInfo extends BaseModel implements Serializable {
|
||||
private String unionName;
|
||||
|
||||
@Column
|
||||
@Comment("在职状态(年度在岗,不在岗,有个时间范围,在某个时间之后退休的不能参加)")
|
||||
@Comment("年龄")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String insuranceUserState;
|
||||
private String age;
|
||||
|
||||
@Column
|
||||
@Comment("不在岗时间")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private Date noDutyTime;
|
||||
@Comment("性别")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 4)
|
||||
private String sex;
|
||||
|
||||
@Column
|
||||
@Comment("医保状态")
|
||||
@Comment("手机号")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String medicalInsuranceState;
|
||||
private String mobile;
|
||||
|
||||
@Column
|
||||
@Comment("身份证件号")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 20)
|
||||
private String idCard;
|
||||
|
||||
@Column
|
||||
@Comment("住址")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 200)
|
||||
private String address;
|
||||
|
||||
@Column
|
||||
@Comment("计划书号码")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 200)
|
||||
private String planNumber;
|
||||
|
||||
@Column
|
||||
@Comment("是否续保")
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
@Default("0")
|
||||
private Boolean isRenewal;
|
||||
|
||||
@Column
|
||||
@Comment("保障开始时间")
|
||||
@ColDefine(type = ColType.DATE)
|
||||
private Date guaranteedStartTime;
|
||||
|
||||
@Column
|
||||
@Comment("保障结束时间")
|
||||
@ColDefine(type = ColType.DATE)
|
||||
private Date guaranteedEndTime;
|
||||
|
||||
@Column
|
||||
@Comment("出险时间")
|
||||
@ColDefine(type = ColType.DATE)
|
||||
private Date dangerTime;
|
||||
|
||||
@Column
|
||||
@Comment("出险地点")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 200)
|
||||
private String dangerAddress;
|
||||
|
||||
@Column
|
||||
@Comment("出险原因、经过、结果")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 200)
|
||||
private String dangerEvent;
|
||||
|
||||
@Column
|
||||
@Comment("开户名")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 200)
|
||||
private String bankUserName;
|
||||
|
||||
@Column
|
||||
@Comment("开户支行")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 200)
|
||||
private String bankOfDeposit;
|
||||
|
||||
@Column
|
||||
@Comment("银行卡账号")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 200)
|
||||
private String bankCardNumber;
|
||||
|
||||
@Column
|
||||
@Comment("赔付金额")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 200)
|
||||
private String amount;
|
||||
|
||||
@Column
|
||||
@Comment("是否提交")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 200)
|
||||
private String isSubmit;
|
||||
|
||||
@Column
|
||||
@Comment("签字")
|
||||
|
||||
Reference in New Issue
Block a user