bug整改

This commit is contained in:
Paidax
2025-02-10 08:58:39 +08:00
parent 8fd04f131d
commit 567da06823
163 changed files with 12110 additions and 11667 deletions
@@ -1,6 +1,6 @@
package io.v.nutz.sys.controllers.platform.sys; package io.v.nutz.sys.controllers.platform.sys;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.wizzer.framework.base.Result; import cn.wizzer.framework.base.Result;
import io.v.nutz.base.enums.Env; import io.v.nutz.base.enums.Env;
@@ -15,7 +15,6 @@ import io.v.nutz.zhgh.activity.models.ActivityUserScope;
import org.apache.shiro.authz.annotation.RequiresAuthentication; import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.jsoup.Jsoup; import org.jsoup.Jsoup;
import org.jsoup.nodes.Document; import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements; import org.jsoup.select.Elements;
import org.nutz.dao.Cnd; import org.nutz.dao.Cnd;
import org.nutz.dao.Dao; import org.nutz.dao.Dao;
@@ -38,6 +37,7 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession; import javax.servlet.http.HttpSession;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@@ -210,12 +210,19 @@ public class SysHomeController {
@RequiresAuthentication @RequiresAuthentication
public Result listHomeActivity() { public Result listHomeActivity() {
FieldFilter fieldFilter = FieldFilter.locked(Sys_home_activity.class, "classPath"); FieldFilter fieldFilter = FieldFilter.locked(Sys_home_activity.class, "classPath");
List<Sys_home_activity> list = Daos.ext(dao, fieldFilter).query(Sys_home_activity.class, Cnd.where("enable", "=", 1).desc("top")); List<Sys_home_activity> list = Daos.ext(dao,fieldFilter) .query(Sys_home_activity.class, Cnd.where("enable", "=", 1).desc("top"));
String userId = ShiroUtil.getUserId(); String userId = ShiroUtil.getUserId();
List<Sys_home_activity> allowActivityList = new ArrayList<>(); List<Sys_home_activity> allowActivityList = new ArrayList<>();
// 今天的时间
Date today = DateUtil.date();
for (Sys_home_activity activity : list) { for (Sys_home_activity activity : list) {
// 该活动的时间范围
Date startDate = activity.getStartDate();
Date endDate = activity.getEndDate();
// 判断当前时间是否在活动范围内,不在就过滤掉
if (!DateUtil.isIn(today, startDate, endDate)) {
continue;
}
Integer allowUserGroupId = activity.getAllowUserGroupId(); Integer allowUserGroupId = activity.getAllowUserGroupId();
String allowUserSql = activity.getAllowUserSql(); String allowUserSql = activity.getAllowUserSql();
activity.setAllowUserSql(null); activity.setAllowUserSql(null);
@@ -232,10 +239,10 @@ public class SysHomeController {
} }
} }
if (StrUtil.isNotBlank(allowUserSql)) { if (StrUtil.isNotBlank(allowUserSql)){
Sql sql = Sqls.create(allowUserSql).setParam("userId", userId); Sql sql = Sqls.create(allowUserSql).setParam("userId", userId);
NutMap nutMap = (NutMap) Daos.query(dao, sql.toString(), Sqls.callback.map()); NutMap nutMap = (NutMap) Daos.query(dao, sql.toString(), Sqls.callback.map());
if (Lang.isNotEmpty(nutMap)) { if (Lang.isNotEmpty(nutMap) && StrUtil.isNotBlank(nutMap.getString("userId"))) {
allowActivityList.add(activity); allowActivityList.add(activity);
} }
} }
@@ -7,10 +7,10 @@ import cn.hutool.core.util.StrUtil;
import cn.wizzer.framework.base.Result; import cn.wizzer.framework.base.Result;
import io.v.nutz.base.annontation.ViReturn; import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.page.Pagination; import io.v.nutz.base.page.Pagination;
import io.v.nutz.base.utils.PageUtil;
import io.v.nutz.base.utils.Roles;
import io.v.nutz.base.query.PageForm; import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.service.ViService; import io.v.nutz.base.service.ViService;
import io.v.nutz.base.utils.PageUtil;
import io.v.nutz.base.utils.Roles;
import io.v.nutz.sys.models.*; import io.v.nutz.sys.models.*;
import io.v.nutz.sys.services.*; import io.v.nutz.sys.services.*;
import io.v.nutz.web.commons.controller.ViCommonCon; import io.v.nutz.web.commons.controller.ViCommonCon;
@@ -102,7 +102,10 @@ public class SysUnionMangeCon {
} }
sysUserRoleService.insert(role); sysUserRoleService.insert(role);
} else if (type == 2) { } else if (type == 2) {
Cnd cnd = Cnd.where("roleId", "=", roleId).and("userId", "=", userId); Cnd cnd = Cnd.where("roleId", "=", roleId);
if (Strings.isNotBlank(userId)) {
cnd.and("userId", "=", userId);
}
// if (Strings.isNotBlank(unionid)) { // if (Strings.isNotBlank(unionid)) {
// cnd.and("unionid", "=", unionid); // cnd.and("unionid", "=", unionid);
// } // }
@@ -9,6 +9,7 @@ import io.v.nutz.base.service.BaseService;
import io.v.nutz.base.service.SimpleService; import io.v.nutz.base.service.SimpleService;
import io.v.nutz.base.utils.Vi; import io.v.nutz.base.utils.Vi;
import io.v.nutz.web.commons.utils.ShiroUtil; import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.activity.models.ActivityTissue;
import io.v.nutz.zhgh.activity.models.ActivityTissuePerson; import io.v.nutz.zhgh.activity.models.ActivityTissuePerson;
import org.apache.shiro.authz.annotation.Logical; import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
@@ -94,7 +95,7 @@ public class ActivityUnionApplyUserController {
cnd.andEx("tissue.type", "=", type); cnd.andEx("tissue.type", "=", type);
cnd.andEx("tissue.state", "=", 3); cnd.andEx("tissue.state", "=", 3);
cnd.andEx("tissue.projectTypeCode", "!=", 50004); cnd.andEx("tissue.projectTypeCode", "!=", 50004);
cnd.andEx("tissue.signUpMethod", "in", List.of(1, 2)); cnd.andEx("tissue.signUpMethod", "in", List.of(1, 2, 3));
if (Strings.isNotBlank(name)) { if (Strings.isNotBlank(name)) {
cnd.where().andLike("tissue.name", name); cnd.where().andLike("tissue.name", name);
@@ -172,18 +173,20 @@ public class ActivityUnionApplyUserController {
@ViReturn @ViReturn
@RequiresPermissions(value = {"activity.club.applyUser", "activity.union.applyUser", "activity.school.applyUser"}, logical = Logical.OR) @RequiresPermissions(value = {"activity.club.applyUser", "activity.union.applyUser", "activity.school.applyUser"}, logical = Logical.OR)
public Object getReportedUser(String tissueId) { public Object getReportedUser(String tissueId) {
ActivityTissue tissue = baseService.dao().fetch(ActivityTissue.class, Cnd.where("id", "=", tissueId));
Sql sql = Sqls.create(""" Sql sql = Sqls.create("""
SELECT SELECT
atp.userId atp.userId
FROM FROM
activity_tissue_person atp activity_tissue_person atp
LEFT JOIN `user` u ON atp.userId = u.id LEFT JOIN `user` u ON atp.userId = u.id
WHERE $condition
atp.tissueId = @tissueId
AND u.unionid = @unionId
"""); """);
sql.setParam("tissueId", tissueId); Cnd cnd = Cnd.NEW();
sql.setParam("unionId", Vi.getUnionId()); cnd.and("atp.tissueId", "=", tissueId);
if (tissue.getSignUpMethod() != 3 && tissue.getType() != 40003) {
cnd.and("u.unionid", "=", Vi.getUnionId());
}
List<NutMap> list = baseService.listMap(sql); List<NutMap> list = baseService.listMap(sql);
List<String> userIds = list.stream().map(v -> v.getString("userId")).collect(Collectors.toList()); List<String> userIds = list.stream().map(v -> v.getString("userId")).collect(Collectors.toList());
return userIds; return userIds;
@@ -3,6 +3,7 @@ package io.v.nutz.zhgh.activity.controller.union;
import cn.afterturn.easypoi.excel.ExcelExportUtil; import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.entity.ExportParams; import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity; import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import cn.hutool.core.util.StrUtil;
import com.deepoove.poi.XWPFTemplate; import com.deepoove.poi.XWPFTemplate;
import com.deepoove.poi.config.Configure; import com.deepoove.poi.config.Configure;
import com.deepoove.poi.policy.HackLoopTableRenderPolicy; import com.deepoove.poi.policy.HackLoopTableRenderPolicy;
@@ -125,7 +126,7 @@ public class ActivityUnionManageController {
"""); """);
if (!ShiroUtil.hasRole("sysadmin")) { if (!ShiroUtil.hasRole("sysadmin")) {
if (activity_type == 40002) { if (activity_type == 40002) {
cnd.and("unionId", "=", vi.getUnionId()); cnd.and("unionId", "=", Vi.getUnionId());
} else if (activity_type == 40003) { } else if (activity_type == 40003) {
cnd.and("id", "in", " SELECT userid FROM sys_club_user WHERE clubid = '%s' ".formatted(vi.getClubId())); cnd.and("id", "in", " SELECT userid FROM sys_club_user WHERE clubid = '%s' ".formatted(vi.getClubId()));
} }
@@ -153,7 +154,9 @@ public class ActivityUnionManageController {
@Aop(TransAop.READ_COMMITTED) @Aop(TransAop.READ_COMMITTED)
@RequiresPermissions(value = {"activity.union.info", "activity.club.info", "activity.school.info2"}, logical = Logical.OR) @RequiresPermissions(value = {"activity.union.info", "activity.club.info", "activity.school.info2"}, logical = Logical.OR)
public Object doAdd(@Param(value = "tissue") ActivityTissue tissue) { public Object doAdd(@Param(value = "tissue") ActivityTissue tissue) {
tissue.setUserId(ShiroUtil.getUserId()); if (StrUtil.isBlank(tissue.getUserId())) {
tissue.setUserId(ShiroUtil.getUserId());
}
tissue.setApplyTime(DateUtil.getDate()); tissue.setApplyTime(DateUtil.getDate());
if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) { if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) {
tissue.setState(1); tissue.setState(1);
@@ -166,8 +169,6 @@ public class ActivityUnionManageController {
tissue.setClubId(vi.getClubId()); tissue.setClubId(vi.getClubId());
} }
tissue.getGoods().forEach(v -> { tissue.getGoods().forEach(v -> {
v.setActivityCode(tissue.getActivityCode()); v.setActivityCode(tissue.getActivityCode());
v.setReid(tissue.getId()); v.setReid(tissue.getId());
@@ -1,22 +0,0 @@
package io.v.nutz.zhgh.difficulty.controller;
import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.zhgh.difficulty.model.DifficultyApply;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
@IocBean
@At("/platform/difficulty/apply")
@Ok("json:full")
public class DifficultyApplyController {
@At
@ViReturn
public Object doApply(DifficultyApply difficultyApply){
return null;
}
}
@@ -1,67 +0,0 @@
package io.v.nutz.zhgh.difficulty.model;
import io.v.nutz.sys.models.Sys_file;
import lombok.Data;
import org.nutz.dao.entity.annotation.*;
import org.nutz.dao.interceptor.annotation.PrevInsert;
import java.util.List;
/**
* 困难补助
*/
@Table("difficulty_apply")
@Data
public class DifficultyApply {
private static final long serialVersionUID = 1L;
@Column
@Name
@ColDefine(type = ColType.VARCHAR, width = 32)
@PrevInsert(uu32 = true)
private String id;
@Column
@ColDefine(type = ColType.VARCHAR, width = 32)
@Comment("申请人")
private String applyUser;
@Column
@ColDefine(type = ColType.INT)
@Comment("申请模式")
private String applyMode;
@Column
@ColDefine(type = ColType.VARCHAR, width = 32)
@Comment("受补助人")
private String difficultyUser;
@Column
@ColDefine(type = ColType.VARCHAR, width = 100)
@Comment("申请事由")
private String remark;
@Column
@ColDefine(type = ColType.MYSQL_JSON)
@Comment("附件")
private List<Sys_file> files;
@Column
@Comment("状态id")
@ColDefine(type = ColType.INT, width = 8)
private Integer stateId;
@Column
@Comment("院级工会主席审核记录")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String unionAuditId;
@Column
@Comment("校工会审核记录")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String schoolAuditId;
}
@@ -106,7 +106,7 @@ public class FundsApplyController {
@At @At
@ViReturn @ViReturn
@RequiresPermissions(value = {"sys.jf.Funds.apply","sys.jf.Funds.apply2","sys.jf.reimbursement.apply"},logical = Logical.OR) @RequiresPermissions(value = {"sys.jf.Funds.apply","sys.jf.Funds.apply2","sys.jf.reimbursement.apply"},logical = Logical.OR)
public Object getCardNumberByPayeeId(String payeeId){ public Object getCardNumberByPayeeId(String username){
Sql sql = Sqls.create(""" Sql sql = Sqls.create("""
SELECT SELECT
JT.bankName, JT.bankName,
@@ -116,15 +116,15 @@ public class FundsApplyController {
JSON_TABLE( JSON_TABLE(
budgets, budgets,
'$[*]' COLUMNS( '$[*]' COLUMNS(
payeeId VARCHAR(255) PATH '$.payeeId', username VARCHAR(255) PATH '$.username',
bankName VARCHAR(255) PATH '$.bankName', bankName VARCHAR(255) PATH '$.bankName',
bankCardNum VARCHAR(255) PATH '$.bankCardNum' bankCardNum VARCHAR(255) PATH '$.bankCardNum'
) )
) AS JT ) AS JT
WHERE WHERE
JT.payeeId = @payeeId JT.username = @username
ORDER BY bx.apply_time DESC LIMIT 1 ORDER BY bx.apply_time DESC LIMIT 1
""").setParam("payeeId", payeeId); """).setParam("username", username);
sql.setCallback(Sqls.callback.map()); sql.setCallback(Sqls.callback.map());
dao.execute(sql); dao.execute(sql);
return sql.getResult(); return sql.getResult();
@@ -8,6 +8,7 @@ import cn.wizzer.framework.base.service.BaseService;
import com.deepoove.poi.XWPFTemplate; import com.deepoove.poi.XWPFTemplate;
import com.deepoove.poi.config.Configure; import com.deepoove.poi.config.Configure;
import com.deepoove.poi.data.PictureRenderData; import com.deepoove.poi.data.PictureRenderData;
import com.deepoove.poi.data.PictureType;
import com.deepoove.poi.policy.HackLoopTableRenderPolicy; import com.deepoove.poi.policy.HackLoopTableRenderPolicy;
import io.v.nutz.base.annontation.ViReturn; import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.model.Goods; import io.v.nutz.base.model.Goods;
@@ -24,6 +25,7 @@ import io.v.nutz.zhgh.jf.service.ActivityBxService;
import io.v.nutz.zhgh.jf.service.ActivityFileService; import io.v.nutz.zhgh.jf.service.ActivityFileService;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.aop.interceptor.ioc.TransAop; import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.boot.starter.ftp.FtpService;
import org.nutz.dao.Cnd; import org.nutz.dao.Cnd;
import org.nutz.dao.Sqls; import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql; import org.nutz.dao.sql.Sql;
@@ -38,6 +40,7 @@ import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param; import org.nutz.mvc.annotation.Param;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayOutputStream;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.math.BigDecimal; import java.math.BigDecimal;
@@ -69,6 +72,9 @@ public class ReimbursementCon {
@Inject @Inject
private BaseService baseService; private BaseService baseService;
@Inject
private FtpService ftpService;
@At("") @At("")
@Ok("beetl:/platform/jf/activitybx/reimbursement.html") @Ok("beetl:/platform/jf/activitybx/reimbursement.html")
@@ -315,9 +321,16 @@ public class ReimbursementCon {
} }
private PictureRenderData getImage(String base64) throws IOException { private PictureRenderData getImage(String base64) throws IOException {
String s = base64.split(",")[1]; if (base64.startsWith("data")) {
byte[] bytes = Base64.getDecoder().decode(s); String s = base64.split(",")[1];
return new PictureRenderData(70, 30, ".png", bytes); byte[] bytes = Base64.getDecoder().decode(s);
return new PictureRenderData(70, 30, ".png", bytes);
} else {
ByteArrayOutputStream os = new ByteArrayOutputStream();
ftpService.download(base64, os);
os.close();
return new PictureRenderData(70, 30, PictureType.PNG, os.toByteArray());
}
} }
@@ -5,6 +5,7 @@ import cn.hutool.json.JSONUtil;
import com.deepoove.poi.XWPFTemplate; import com.deepoove.poi.XWPFTemplate;
import com.deepoove.poi.config.Configure; import com.deepoove.poi.config.Configure;
import com.deepoove.poi.data.PictureRenderData; import com.deepoove.poi.data.PictureRenderData;
import com.deepoove.poi.data.PictureType;
import com.deepoove.poi.policy.HackLoopTableRenderPolicy; import com.deepoove.poi.policy.HackLoopTableRenderPolicy;
import io.v.nutz.base.annontation.ViReturn; import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.utils.Html2Text; import io.v.nutz.base.utils.Html2Text;
@@ -15,6 +16,7 @@ import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.jf.model.ActivityBx; import io.v.nutz.zhgh.jf.model.ActivityBx;
import io.v.nutz.zhgh.jf.service.ActivityBxService; import io.v.nutz.zhgh.jf.service.ActivityBxService;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.boot.starter.ftp.FtpService;
import org.nutz.dao.Cnd; import org.nutz.dao.Cnd;
import org.nutz.dao.Sqls; import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql; import org.nutz.dao.sql.Sql;
@@ -28,6 +30,7 @@ import org.nutz.mvc.annotation.Param;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.BufferedOutputStream; import java.io.BufferedOutputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.net.URLEncoder; import java.net.URLEncoder;
@@ -50,9 +53,10 @@ public class ReimbursementViewCon {
@Inject @Inject
private Vi vi; private Vi vi;
@Inject @Inject
private ActivityBxService activityBxService; private ActivityBxService activityBxService;
@Inject
private FtpService ftpService;
private SysUnionService sysUnionService; private SysUnionService sysUnionService;
@@ -127,9 +131,16 @@ public class ReimbursementViewCon {
} }
private PictureRenderData getImage(String base64) throws IOException { private PictureRenderData getImage(String base64) throws IOException {
String s = base64.split(",")[1]; if (base64.startsWith("data:")) {
byte[] bytes = Base64.getDecoder().decode(s); String s = base64.split(",")[1];
return new PictureRenderData(100, 30, ".png", bytes); byte[] bytes = Base64.getDecoder().decode(s);
return new PictureRenderData(70, 30, ".png", bytes);
} else {
ByteArrayOutputStream os = new ByteArrayOutputStream();
ftpService.download(base64, os);
os.close();
return new PictureRenderData(70, 30, PictureType.PNG, os.toByteArray());
}
} }
@At @At
@@ -83,7 +83,9 @@ public class ActivityReimbursementApplyController {
List<ActivityBx.Budget> budgets = activityBx.getBudgets(); List<ActivityBx.Budget> budgets = activityBx.getBudgets();
double sum = budgets.stream().mapToDouble(ActivityBx.Budget::getActualPrice).sum(); double sum = budgets.stream().mapToDouble(ActivityBx.Budget::getActualPrice).sum();
activityBx.setActivity_money(sum); activityBx.setActivity_money(sum);
activityBx.setReimbursement_apply_time(DateUtil.today()); if (activityBx.getReimbursement_apply_time() == null){
activityBx.setReimbursement_apply_time(DateUtil.today());
}
if (StrUtil.isNotBlank(activityBx.getId()) && count > 0) { if (StrUtil.isNotBlank(activityBx.getId()) && count > 0) {
activityBx.setFiles(null); activityBx.setFiles(null);
@@ -1,12 +1,12 @@
package io.v.nutz.zhgh.member; package io.v.nutz.zhgh.member;
import io.v.nutz.base.utils.Roles; import io.v.nutz.base.utils.Roles;
import io.v.nutz.zhgh.member.constant.MemberOrigin; import io.v.nutz.base.utils.ViResource;
import io.v.nutz.zhgh.member.constant.MemberStatus;
import io.v.nutz.sys.models.Sys_user; import io.v.nutz.sys.models.Sys_user;
import io.v.nutz.sys.models.Sys_user_role; import io.v.nutz.sys.models.Sys_user_role;
import io.v.nutz.sys.services.SysUserService; import io.v.nutz.sys.services.SysUserService;
import io.v.nutz.base.utils.ViResource; import io.v.nutz.zhgh.member.constant.MemberOrigin;
import io.v.nutz.zhgh.member.constant.MemberStatus;
import org.apache.shiro.crypto.hash.Sha256Hash; import org.apache.shiro.crypto.hash.Sha256Hash;
import org.apache.shiro.util.ByteSource; import org.apache.shiro.util.ByteSource;
import org.nutz.dao.Chain; import org.nutz.dao.Chain;
@@ -2,13 +2,13 @@ package io.v.nutz.zhgh.member.controller;
import io.v.nutz.base.annontation.ViReturn; import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.utils.Vi; import io.v.nutz.base.utils.Vi;
import io.v.nutz.sys.models.Sys_menu;
import io.v.nutz.sys.models.Sys_user;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.member.constant.MemberApplyState; import io.v.nutz.zhgh.member.constant.MemberApplyState;
import io.v.nutz.zhgh.member.constant.MemberChangeApplyState; import io.v.nutz.zhgh.member.constant.MemberChangeApplyState;
import io.v.nutz.zhgh.member.constant.MemberChangeRecordMode; import io.v.nutz.zhgh.member.constant.MemberChangeRecordMode;
import io.v.nutz.zhgh.member.service.MemberService; import io.v.nutz.zhgh.member.service.MemberService;
import io.v.nutz.sys.models.Sys_menu;
import io.v.nutz.sys.models.Sys_user;
import io.v.nutz.web.commons.utils.ShiroUtil;
import org.apache.shiro.authz.annotation.RequiresAuthentication; import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.nutz.dao.Cnd; import org.nutz.dao.Cnd;
import org.nutz.dao.Sqls; import org.nutz.dao.Sqls;
@@ -3,17 +3,16 @@ package io.v.nutz.zhgh.member.controller;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.wizzer.framework.base.Result; import cn.wizzer.framework.base.Result;
import io.v.nutz.base.annontation.ViReturn; import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.service.ViService;
import io.v.nutz.sys.models.Sys_unit; import io.v.nutz.sys.models.Sys_unit;
import io.v.nutz.zhgh.data.constant.UserChangeType; import io.v.nutz.sys.models.Sys_user;
import io.v.nutz.sys.services.SysUserService;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.data.model.UserHistory; import io.v.nutz.zhgh.data.model.UserHistory;
import io.v.nutz.zhgh.member.UserMode; import io.v.nutz.zhgh.member.UserMode;
import io.v.nutz.zhgh.member.model.MemberApplyRecord; import io.v.nutz.zhgh.member.model.MemberApplyRecord;
import io.v.nutz.zhgh.member.model.MemberChangeRecord; import io.v.nutz.zhgh.member.model.MemberChangeRecord;
import io.v.nutz.zhgh.member.service.MemberService; import io.v.nutz.zhgh.member.service.MemberService;
import io.v.nutz.base.service.ViService;
import io.v.nutz.sys.models.Sys_user;
import io.v.nutz.sys.services.SysUserService;
import io.v.nutz.web.commons.utils.ShiroUtil;
import org.apache.shiro.authz.annotation.RequiresAuthentication; import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.nutz.dao.Cnd; import org.nutz.dao.Cnd;
import org.nutz.dao.Dao; import org.nutz.dao.Dao;
@@ -205,7 +204,7 @@ public class MemberCommonController {
UserHistory userHistory = dao.fetch(UserHistory.class, hisId); UserHistory userHistory = dao.fetch(UserHistory.class, hisId);
Map<String, String> unitMap = dao.query(Sys_unit.class, null).stream().collect(Collectors.toMap(v -> v.getId(), v -> v.getName())); Map<String, String> unitMap = dao.query(Sys_unit.class, null).stream().collect(Collectors.toMap(v -> v.getId(), v -> v.getName()));
NutMap sysUserMap = (NutMap) Daos.query(dao, Sqls.create("select * from sys_user where loginname=@loginname").setParam("loginname", userHistory.getLoginname()).toString(), Sqls.callback.map()); NutMap sysUserMap = (NutMap) Daos.query(dao, Sqls.create("select * from sys_user where loginname=@loginname").setParam("loginname", userHistory.getLoginname()).toString(), Sqls.callback.map());
NutMap userHisMap = org.nutz.lang.Lang.obj2nutmap(userHistory); NutMap userHisMap = Lang.obj2nutmap(userHistory);
if (StrUtil.isNotBlank(userHistory.getMemberChangeRecordId())) { if (StrUtil.isNotBlank(userHistory.getMemberChangeRecordId())) {
//从变更来的 特殊 需要审核 //从变更来的 特殊 需要审核
@@ -221,8 +220,8 @@ public class MemberCommonController {
); );
} }
String userState = StrUtil.blankToDefault(changeRecord.getUserState(), ""); String userState = StrUtil.blankToDefault(changeRecord.getChangeUserState(), "");
if (!userState.equals(sysUserMap.getString("userState", ""))) { if (StrUtil.isNotBlank(userState) && !userState.equals(sysUserMap.getString("userState", ""))) {
compareData.add(NutMap.NEW() compareData.add(NutMap.NEW()
.addv("columnName", "在职状态") .addv("columnName", "在职状态")
.addv("newValue", userState) .addv("newValue", userState)
@@ -230,6 +229,15 @@ public class MemberCommonController {
); );
} }
String personType = StrUtil.blankToDefault(changeRecord.getChangePersonType(), "");
if (StrUtil.isNotBlank(personType) && !personType.equals(sysUserMap.getString("personType", ""))) {
compareData.add(NutMap.NEW()
.addv("columnName", "人员类型")
.addv("newValue", personType)
.addv("oldValue", sysUserMap.getString("personType"))
);
}
//在职,退休,离职可能会发生会员和福利会员的变化 //在职,退休,离职可能会发生会员和福利会员的变化
if(changeRecord.getUpdateMember()!=null && changeRecord.getUpdateMember()){ if(changeRecord.getUpdateMember()!=null && changeRecord.getUpdateMember()){
//说明要改变会员状态 //说明要改变会员状态
@@ -240,7 +248,7 @@ public class MemberCommonController {
); );
} }
if(changeRecord.getUpdateWelfare()!=null && changeRecord.getUpdateWelfare()){ if(changeRecord.getUpdateWelfareMember()!=null && changeRecord.getUpdateWelfareMember()){
//说明要改变福利会员状态 //说明要改变福利会员状态
compareData.add(NutMap.NEW() compareData.add(NutMap.NEW()
.addv("columnName", "福利会员资格") .addv("columnName", "福利会员资格")
@@ -267,7 +275,7 @@ public class MemberCommonController {
COLUMN_COMMENT COLUMN_COMMENT
FROM INFORMATION_SCHEMA.COLUMNS FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = 'sys_user' WHERE TABLE_NAME = 'sys_user'
AND TABLE_SCHEMA = 'union_cpu' AND TABLE_SCHEMA = 'zhgh_hrbnu'
"""); """);
List<NutMap> userTableColumnInfos = sysUserService.listMap(userColumnSql); List<NutMap> userTableColumnInfos = sysUserService.listMap(userColumnSql);
@@ -3,10 +3,10 @@ package io.v.nutz.zhgh.member.controller;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import io.v.nutz.base.annontation.ViReturn; import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.service.BaseService; import io.v.nutz.base.service.BaseService;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.member.constant.MemberChangeRecordMode; import io.v.nutz.zhgh.member.constant.MemberChangeRecordMode;
import io.v.nutz.zhgh.member.model.MemberCheckSelfTask; import io.v.nutz.zhgh.member.model.MemberCheckSelfTask;
import io.v.nutz.zhgh.member.model.MemberCheckTask; import io.v.nutz.zhgh.member.model.MemberCheckTask;
import io.v.nutz.web.commons.utils.ShiroUtil;
import org.apache.shiro.authz.annotation.RequiresAuthentication; import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.nutz.dao.Cnd; import org.nutz.dao.Cnd;
import org.nutz.ioc.loader.annotation.Inject; import org.nutz.ioc.loader.annotation.Inject;
@@ -1,16 +1,16 @@
package io.v.nutz.zhgh.member.controller.apply; package io.v.nutz.zhgh.member.controller.apply;
import io.v.nutz.base.annontation.ViReturn; import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.lang.Enum;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.base.dao.CndPlus; import io.v.nutz.base.dao.CndPlus;
import io.v.nutz.zhgh.member.constant.MemberApplyState; import io.v.nutz.base.lang.Enum;
import io.v.nutz.zhgh.member.handle.MemberApplyAuditHandle;
import io.v.nutz.zhgh.member.model.MemberApplyRecord;
import io.v.nutz.base.model.Audit; import io.v.nutz.base.model.Audit;
import io.v.nutz.base.query.PageForm; import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.service.ViService; import io.v.nutz.base.service.ViService;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.web.commons.utils.ShiroUtil; import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.member.constant.MemberApplyState;
import io.v.nutz.zhgh.member.handle.MemberApplyAuditHandle;
import io.v.nutz.zhgh.member.model.MemberApplyRecord;
import org.apache.shiro.authz.annotation.Logical; import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.dao.Sqls; import org.nutz.dao.Sqls;
@@ -5,21 +5,21 @@ import cn.hutool.core.util.StrUtil;
import com.deepoove.poi.XWPFTemplate; import com.deepoove.poi.XWPFTemplate;
import com.deepoove.poi.config.Configure; import com.deepoove.poi.config.Configure;
import io.v.nutz.base.annontation.ViReturn; import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.service.ViService;
import io.v.nutz.base.utils.OfficeTemplateUtil; import io.v.nutz.base.utils.OfficeTemplateUtil;
import io.v.nutz.base.utils.Roles; import io.v.nutz.base.utils.Roles;
import io.v.nutz.base.utils.Vi; import io.v.nutz.base.utils.Vi;
import io.v.nutz.base.utils.ViTool; import io.v.nutz.base.utils.ViTool;
import io.v.nutz.sys.models.Sys_signature; import io.v.nutz.sys.models.Sys_signature;
import io.v.nutz.sys.models.Sys_user;
import io.v.nutz.sys.services.SysSignatureService; import io.v.nutz.sys.services.SysSignatureService;
import io.v.nutz.sys.services.SysUserService;
import io.v.nutz.web.commons.base.Globals; import io.v.nutz.web.commons.base.Globals;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.member.constant.MemberApplyState; import io.v.nutz.zhgh.member.constant.MemberApplyState;
import io.v.nutz.zhgh.member.handle.MemberApplyAuditHandle; import io.v.nutz.zhgh.member.handle.MemberApplyAuditHandle;
import io.v.nutz.zhgh.member.model.MemberApplyRecord; import io.v.nutz.zhgh.member.model.MemberApplyRecord;
import io.v.nutz.zhgh.member.model.MemberCheckSelfTask; import io.v.nutz.zhgh.member.model.MemberCheckSelfTask;
import io.v.nutz.base.service.ViService;
import io.v.nutz.sys.models.Sys_user;
import io.v.nutz.sys.services.SysUserService;
import io.v.nutz.web.commons.utils.ShiroUtil;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.ddr.poi.html.HtmlRenderPolicy; import org.ddr.poi.html.HtmlRenderPolicy;
import org.nutz.dao.Chain; import org.nutz.dao.Chain;
@@ -1,18 +1,18 @@
package io.v.nutz.zhgh.member.controller.change; package io.v.nutz.zhgh.member.controller.change;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import io.v.nutz.base.lang.Enum;
import io.v.nutz.base.annontation.ViReturn; import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.base.dao.CndPlus; import io.v.nutz.base.dao.CndPlus;
import io.v.nutz.base.lang.Enum;
import io.v.nutz.base.model.Audit;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.service.ViService;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.member.constant.MemberChangeApplyState; import io.v.nutz.zhgh.member.constant.MemberChangeApplyState;
import io.v.nutz.zhgh.member.constant.MemberChangeRecordMode; import io.v.nutz.zhgh.member.constant.MemberChangeRecordMode;
import io.v.nutz.zhgh.member.handle.MemberChangeAuditHandle; import io.v.nutz.zhgh.member.handle.MemberChangeAuditHandle;
import io.v.nutz.zhgh.member.model.MemberChangeRecord; import io.v.nutz.zhgh.member.model.MemberChangeRecord;
import io.v.nutz.base.model.Audit;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.service.ViService;
import io.v.nutz.web.commons.utils.ShiroUtil;
import org.apache.shiro.authz.annotation.Logical; import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.dao.Sqls; import org.nutz.dao.Sqls;
@@ -1,16 +1,16 @@
package io.v.nutz.zhgh.member.controller.change; package io.v.nutz.zhgh.member.controller.change;
import io.v.nutz.base.annontation.ViReturn; import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.service.ViService;
import io.v.nutz.base.utils.Roles; import io.v.nutz.base.utils.Roles;
import io.v.nutz.base.utils.Vi; import io.v.nutz.base.utils.Vi;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.member.constant.MemberChangeApplyState; import io.v.nutz.zhgh.member.constant.MemberChangeApplyState;
import io.v.nutz.zhgh.member.constant.MemberChangeOrigin; import io.v.nutz.zhgh.member.constant.MemberChangeOrigin;
import io.v.nutz.zhgh.member.constant.MemberChangeRecordMode; import io.v.nutz.zhgh.member.constant.MemberChangeRecordMode;
import io.v.nutz.zhgh.member.handle.MemberChangeAuditHandle; import io.v.nutz.zhgh.member.handle.MemberChangeAuditHandle;
import io.v.nutz.zhgh.member.model.MemberChangeRecord; import io.v.nutz.zhgh.member.model.MemberChangeRecord;
import io.v.nutz.zhgh.member.service.MemberService; import io.v.nutz.zhgh.member.service.MemberService;
import io.v.nutz.base.service.ViService;
import io.v.nutz.web.commons.utils.ShiroUtil;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.dao.Sqls; import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql; import org.nutz.dao.sql.Sql;
@@ -10,13 +10,20 @@ import cn.hutool.core.util.StrUtil;
import cn.wizzer.framework.base.Result; import cn.wizzer.framework.base.Result;
import com.google.common.base.Joiner; import com.google.common.base.Joiner;
import io.v.nutz.base.annontation.ViReturn; import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.dao.CndPlus;
import io.v.nutz.base.model.Audit;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.service.AuditService;
import io.v.nutz.base.service.ViService;
import io.v.nutz.base.utils.PageUtil; import io.v.nutz.base.utils.PageUtil;
import io.v.nutz.base.utils.Roles; import io.v.nutz.base.utils.Roles;
import io.v.nutz.base.utils.Vi; import io.v.nutz.base.utils.Vi;
import io.v.nutz.base.dao.CndPlus;
import io.v.nutz.base.utils.ViTool; import io.v.nutz.base.utils.ViTool;
import io.v.nutz.sys.models.*; import io.v.nutz.sys.models.*;
import io.v.nutz.sys.services.SysUnitService;
import io.v.nutz.sys.services.SysUserService;
import io.v.nutz.web.commons.slog.annotation.SLog; import io.v.nutz.web.commons.slog.annotation.SLog;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.data.constant.UserChangeType; import io.v.nutz.zhgh.data.constant.UserChangeType;
import io.v.nutz.zhgh.member.MemberMode; import io.v.nutz.zhgh.member.MemberMode;
import io.v.nutz.zhgh.member.UserMode; import io.v.nutz.zhgh.member.UserMode;
@@ -27,13 +34,6 @@ import io.v.nutz.zhgh.member.model.MemberChangeRecord;
import io.v.nutz.zhgh.member.service.MemberService; import io.v.nutz.zhgh.member.service.MemberService;
import io.v.nutz.zhgh.member.template.MemberTemp; import io.v.nutz.zhgh.member.template.MemberTemp;
import io.v.nutz.zhgh.member.utils.MemberUtils; import io.v.nutz.zhgh.member.utils.MemberUtils;
import io.v.nutz.base.model.Audit;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.service.AuditService;
import io.v.nutz.base.service.ViService;
import io.v.nutz.sys.services.SysUnitService;
import io.v.nutz.sys.services.SysUserService;
import io.v.nutz.web.commons.utils.ShiroUtil;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.Workbook;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
@@ -109,10 +109,12 @@ public class MemberChangeManageController {
@Param(value = "sex", required = false) String sex, @Param(value = "sex", required = false) String sex,
@Param(value = "personType", required = false) String personType, @Param(value = "personType", required = false) String personType,
@Param(value = "userState", required = false) String userState, @Param(value = "userState", required = false) String userState,
@Param(value = "preparedBy", required = false) String preparedBy,
@Param(value = "changeDate", required = false) String changeDate, @Param(value = "changeDate", required = false) String changeDate,
@Param(value = "changeType", required = false) String changeType, @Param(value = "changeType", required = false) String changeType,
@Param(value = "changeTypes", required = false) Integer[] changeTypes, @Param(value = "changeTypes", required = false) Integer[] changeTypes,
@Param(value = "changed", required = false) Integer changed, @Param(value = "changed", required = false) Integer changed,
@Param(value = "myUnionGroupUser", required = false) Integer myUnionGroupUser,
@Param(value = "isMember", required = false) Integer isMember) { @Param(value = "isMember", required = false) Integer isMember) {
Sql sql = Sqls.create(""" Sql sql = Sqls.create("""
SELECT SELECT
@@ -154,9 +156,16 @@ public class MemberChangeManageController {
cnd.and("u.unionId", "=", Vi.getUnionId()); cnd.and("u.unionId", "=", Vi.getUnionId());
} else if (ShiroUtil.hasRole("ghxzzz")) { } else if (ShiroUtil.hasRole("ghxzzz")) {
SqlExpressionGroup seg = new SqlExpressionGroup(); SqlExpressionGroup seg = new SqlExpressionGroup();
seg.or("u.unionGroupId", "in", io.v.nutz.web.commons.utils.ShiroUtil.getUnionGroupIds()); if (myUnionGroupUser == null) {
seg.or("u.unionGroupId", "is", null); seg.or("u.unionGroupId", "in", ShiroUtil.getUnionGroupIds());
cnd.and(seg); seg.or("u.unionGroupId", "is", null);
cnd.and(seg);
} else if (myUnionGroupUser == 1) {
cnd.and("u.unionGroupId", "in", ShiroUtil.getUnionGroupIds());
} else {
seg.or("u.unionGroupId", "is", null);
cnd.and(seg);
}
cnd.and("u.unionid", "=", Vi.getUnionId()); cnd.and("u.unionid", "=", Vi.getUnionId());
} }
@@ -169,6 +178,7 @@ public class MemberChangeManageController {
cnd.andEX("u.sex", "=", sex); cnd.andEX("u.sex", "=", sex);
cnd.andEX("u.personType", "=", personType); cnd.andEX("u.personType", "=", personType);
cnd.andEX("u.userState", "=", userState); cnd.andEX("u.userState", "=", userState);
cnd.andEX("u.preparedBy", "=", preparedBy);
if (StrUtil.isNotBlank(changeDateBefore) && StrUtil.isNotBlank(changeDateEnd)) { if (StrUtil.isNotBlank(changeDateBefore) && StrUtil.isNotBlank(changeDateEnd)) {
cnd.and(new Static(String.format("Date(his.changeTime) >= '%s' and Date(his.changeTime) <= '%s'", changeDateBefore, changeDateEnd))); cnd.and(new Static(String.format("Date(his.changeTime) >= '%s' and Date(his.changeTime) <= '%s'", changeDateBefore, changeDateEnd)));
@@ -176,9 +186,10 @@ public class MemberChangeManageController {
if (Strings.isNotBlank(pageForm.getPageOrderName()) && Strings.isNotBlank(pageForm.getPageOrderBy())) { if (Strings.isNotBlank(pageForm.getPageOrderName()) && Strings.isNotBlank(pageForm.getPageOrderBy())) {
cnd.orderBy((List.of("changeTime", "changeType", "changeTypes").contains(pageForm.getPageOrderName()) ? "his." : "u.") + pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy())); cnd.orderBy((List.of("changeTime", "changeType", "changeTypes").contains(pageForm.getPageOrderName()) ? "his." : "u.") + pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
} else {
cnd.desc("his.changeTime");
} }
if (Lang.isNotEmpty(changeTypes)) { if (Lang.isNotEmpty(changeTypes)) {
SqlExpressionGroup seg = new SqlExpressionGroup(); SqlExpressionGroup seg = new SqlExpressionGroup();
for (Integer type : changeTypes) { for (Integer type : changeTypes) {
@@ -249,7 +260,7 @@ public class MemberChangeManageController {
} else if (ShiroUtil.hasRole("ghxzzz")) { } else if (ShiroUtil.hasRole("ghxzzz")) {
cnd.and("u.unionId", "=", Vi.getUnionId()); cnd.and("u.unionId", "=", Vi.getUnionId());
SqlExpressionGroup seg = new SqlExpressionGroup(); SqlExpressionGroup seg = new SqlExpressionGroup();
seg.or("u.unionGroupId", "in", io.v.nutz.web.commons.utils.ShiroUtil.getUnionGroupIds()); seg.or("u.unionGroupId", "in", ShiroUtil.getUnionGroupIds());
seg.or("u.unionGroupId", "is", null); seg.or("u.unionGroupId", "is", null);
cnd.and(seg); cnd.and(seg);
} }
@@ -301,7 +312,11 @@ public class MemberChangeManageController {
memberChangeRecord = MemberChangeAuditHandle.CREATE.next(memberChangeRecord, null); memberChangeRecord = MemberChangeAuditHandle.CREATE.next(memberChangeRecord, null);
MemberChangeAuditHandle.SCHOOL.next(memberChangeRecord, audit); MemberChangeAuditHandle.SCHOOL.next(memberChangeRecord, audit);
} else { } else {
memberChangeRecord.setApplyOrigin(MemberChangeOrigin.UNION.getCode()); if (ShiroUtil.hasAnyRoles("gh01, H04")) {
memberChangeRecord.setApplyOrigin(MemberChangeOrigin.UNION.getCode());
} else if (ShiroUtil.hasRole("ghxzzz")){
memberChangeRecord.setApplyOrigin(MemberChangeOrigin.UNION_GROUP.getCode());
}
memberChangeRecord = MemberChangeAuditHandle.CREATE.next(memberChangeRecord, null); memberChangeRecord = MemberChangeAuditHandle.CREATE.next(memberChangeRecord, null);
MemberChangeAuditHandle.UNION.next(memberChangeRecord, audit); MemberChangeAuditHandle.UNION.next(memberChangeRecord, audit);
} }
@@ -363,7 +378,7 @@ public class MemberChangeManageController {
@Param(value = "memberSearchKeyWord", required = false) String memberSearchKeyWord, @Param(value = "memberSearchKeyWord", required = false) String memberSearchKeyWord,
@Param(value = "isAppendWelfareMember", required = false) Boolean isAppendWelfareMember) { @Param(value = "isAppendWelfareMember", required = false) Boolean isAppendWelfareMember) {
int yyyy = Calendar.getInstance().get(Calendar.YEAR); int yyyy = Calendar.getInstance().get(Calendar.YEAR);
Cnd cnd = MemberUtils.getCnd(pageForm, startDate, endDate, unionId, unitId, personTypes, userStates, memberTypes, sexTypes, age, null, roleIds, null, null, memberStatus, threeUnitId, unionGroupId, reverseSelection, null, null, campus); Cnd cnd = MemberUtils.getCnd(pageForm, startDate, endDate, unionId, unitId, personTypes, userStates, null, memberTypes, sexTypes, age, null, roleIds, null, null, memberStatus, threeUnitId, unionGroupId, reverseSelection, null, null, campus);
Sql sql = Sqls.create(""" Sql sql = Sqls.create("""
SELECT u.* from $table SELECT u.* from $table
LEFT JOIN sys_user_role sur ON sur.userid = u.id LEFT JOIN sys_user_role sur ON sur.userid = u.id
@@ -510,7 +525,7 @@ public class MemberChangeManageController {
User user = memberService.dao().fetch(User.class, Cnd.where("id", "=", userId)); User user = memberService.dao().fetch(User.class, Cnd.where("id", "=", userId));
MemberChangeRecord changeRecord = new MemberChangeRecord(); MemberChangeRecord changeRecord = new MemberChangeRecord();
changeRecord.setType(UserChangeType.NEW.getCode()); changeRecord.setType(UserChangeType.NEW.getCode());
changeRecord.setApplyOrigin(io.v.nutz.web.commons.utils.ShiroUtil.hasRole("H04") ? MemberChangeOrigin.UNION.getCode() : MemberChangeOrigin.UNION_GROUP.getCode()); changeRecord.setApplyOrigin(ShiroUtil.hasRole("H04") ? MemberChangeOrigin.UNION.getCode() : MemberChangeOrigin.UNION_GROUP.getCode());
changeRecord.setStateId(MemberChangeApplyState.SCHOOL_UNION); changeRecord.setStateId(MemberChangeApplyState.SCHOOL_UNION);
changeRecord.setUpdateWelfareMember(true); changeRecord.setUpdateWelfareMember(true);
changeRecord.setUserId(userId); changeRecord.setUserId(userId);
@@ -536,6 +551,9 @@ public class MemberChangeManageController {
public Object units() { public Object units() {
Cnd cnd = Cnd.NEW(); Cnd cnd = Cnd.NEW();
cnd.and("unitlevel", "=", 2); cnd.and("unitlevel", "=", 2);
if (!ShiroUtil.hasAnyRoles("sysadmin,SchoolUnionAdmin")) {
cnd.and("id", "!=", "DZJF000");
}
return sysUnitService.dao().query("unit_union", cnd); return sysUnitService.dao().query("unit_union", cnd);
} }
@@ -635,7 +653,7 @@ public class MemberChangeManageController {
//判断是否在系统中 //判断是否在系统中
Sys_user user = userMap.get(v.getLoginname()); Sys_user user = userMap.get(v.getLoginname());
Sys_user_role userRole = new Sys_user_role(); Sys_user_role userRole = new Sys_user_role();
if (org.nutz.lang.Lang.isNotEmpty(user)) { if (Lang.isNotEmpty(user)) {
user.setUnitid(unitId); user.setUnitid(unitId);
user.setSex(v.getSex()); user.setSex(v.getSex());
user.setMobile(v.getMobile()); user.setMobile(v.getMobile());
@@ -683,7 +701,7 @@ public class MemberChangeManageController {
sysUnitService.dao().updateIgnoreNull(needUpdateUser); sysUnitService.dao().updateIgnoreNull(needUpdateUser);
//如果有错误数据就返回给前端 //如果有错误数据就返回给前端
if (org.nutz.lang.Lang.isNotEmpty(errorInfos)) { if (Lang.isNotEmpty(errorInfos)) {
NutMap nutMap = NutMap.NEW(); NutMap nutMap = NutMap.NEW();
nutMap.setv("totalCount", memberImportList.size()); nutMap.setv("totalCount", memberImportList.size());
nutMap.setv("successCount", doCleanRoleUsers.size()); nutMap.setv("successCount", doCleanRoleUsers.size());
@@ -2,14 +2,14 @@ package io.v.nutz.zhgh.member.controller.change;
import cn.wizzer.framework.page.Pagination; import cn.wizzer.framework.page.Pagination;
import io.v.nutz.base.annontation.ViReturn; import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.base.dao.CndPlus; import io.v.nutz.base.dao.CndPlus;
import io.v.nutz.zhgh.member.model.MemberChangeRecord;
import io.v.nutz.zhgh.member.service.MemberService;
import io.v.nutz.base.model.Audit; import io.v.nutz.base.model.Audit;
import io.v.nutz.base.query.PageForm; import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.service.ViService; import io.v.nutz.base.service.ViService;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.web.commons.utils.ShiroUtil; import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.member.model.MemberChangeRecord;
import io.v.nutz.zhgh.member.service.MemberService;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.dao.Cnd; import org.nutz.dao.Cnd;
import org.nutz.dao.util.cri.SqlExpressionGroup; import org.nutz.dao.util.cri.SqlExpressionGroup;
@@ -80,7 +80,7 @@ public class MemberChangeRecordsController {
} else if (ShiroUtil.hasRole("ghxzzz")) { } else if (ShiroUtil.hasRole("ghxzzz")) {
cnd.and("u.unionId", "=", Vi.getUnionId()); cnd.and("u.unionId", "=", Vi.getUnionId());
SqlExpressionGroup seg = new SqlExpressionGroup(); SqlExpressionGroup seg = new SqlExpressionGroup();
seg.or("u.unionGroupId", "in", io.v.nutz.web.commons.utils.ShiroUtil.getUnionGroupIds()); seg.or("u.unionGroupId", "in", ShiroUtil.getUnionGroupIds());
seg.or("u.unionGroupId", "is", null); seg.or("u.unionGroupId", "is", null);
cnd.and(seg); cnd.and(seg);
} }
@@ -4,11 +4,11 @@ import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.entity.ExportParams; import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity; import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import io.v.nutz.base.annontation.ViReturn; import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.zhgh.member.service.MemberCheckPersonalService;
import io.v.nutz.base.query.PageForm; import io.v.nutz.base.query.PageForm;
import io.v.nutz.web.commons.utils.ShiroUtil; import io.v.nutz.base.utils.Vi;
import io.v.nutz.base.utils.ViTool; import io.v.nutz.base.utils.ViTool;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.member.service.MemberCheckPersonalService;
import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.Workbook;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.dao.Cnd; import org.nutz.dao.Cnd;
@@ -1,13 +1,12 @@
package io.v.nutz.zhgh.member.controller.check; package io.v.nutz.zhgh.member.controller.check;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
import io.v.nutz.base.annontation.ViReturn; import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.service.SimpleService; import io.v.nutz.base.service.SimpleService;
import io.v.nutz.base.utils.Roles; import io.v.nutz.base.utils.Roles;
import io.v.nutz.zhgh.member.constant.MemberChangeApplyState; import io.v.nutz.zhgh.member.constant.MemberChangeApplyState;
import io.v.nutz.zhgh.member.model.MemberChangeRecord; import io.v.nutz.zhgh.member.model.MemberChangeRecord;
import io.v.nutz.base.query.PageForm;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.dao.Cnd; import org.nutz.dao.Cnd;
import org.nutz.dao.Dao; import org.nutz.dao.Dao;
@@ -15,7 +14,6 @@ import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql; import org.nutz.dao.sql.Sql;
import org.nutz.ioc.loader.annotation.Inject; import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean; import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.json.Json;
import org.nutz.lang.util.NutMap; import org.nutz.lang.util.NutMap;
import org.nutz.mvc.annotation.At; import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok; import org.nutz.mvc.annotation.Ok;
@@ -2,16 +2,15 @@ package io.v.nutz.zhgh.member.controller.check;
import cn.hutool.core.lang.Assert; import cn.hutool.core.lang.Assert;
import io.v.nutz.base.annontation.ViReturn; import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.service.SimpleService; import io.v.nutz.base.service.SimpleService;
import io.v.nutz.sys.models.Sys_union; import io.v.nutz.sys.models.Sys_union;
import io.v.nutz.sys.models.Sys_user;
import io.v.nutz.zhgh.member.constant.MemberChangeRecordMode; import io.v.nutz.zhgh.member.constant.MemberChangeRecordMode;
import io.v.nutz.zhgh.member.model.MemberChangeRecord; import io.v.nutz.zhgh.member.model.MemberChangeRecord;
import io.v.nutz.zhgh.member.model.MemberCheckSelfTask; import io.v.nutz.zhgh.member.model.MemberCheckSelfTask;
import io.v.nutz.zhgh.member.model.MemberCheckTask; import io.v.nutz.zhgh.member.model.MemberCheckTask;
import io.v.nutz.zhgh.member.model.MemberCheckUnionTask; import io.v.nutz.zhgh.member.model.MemberCheckUnionTask;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.sys.models.SysUnionGroup;
import io.v.nutz.sys.models.Sys_user;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.dao.Cnd; import org.nutz.dao.Cnd;
import org.nutz.dao.Dao; import org.nutz.dao.Dao;
@@ -4,9 +4,12 @@ import cn.hutool.core.util.StrUtil;
import cn.wizzer.framework.base.Result; import cn.wizzer.framework.base.Result;
import com.google.common.base.Joiner; import com.google.common.base.Joiner;
import io.v.nutz.base.annontation.ViReturn; import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.model.Audit;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.service.SimpleService; import io.v.nutz.base.service.SimpleService;
import io.v.nutz.base.utils.Vi; import io.v.nutz.base.utils.Vi;
import io.v.nutz.sys.models.Sys_config; import io.v.nutz.sys.models.Sys_config;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.data.constant.UserChangeType; import io.v.nutz.zhgh.data.constant.UserChangeType;
import io.v.nutz.zhgh.member.constant.MemberChangeApplyState; import io.v.nutz.zhgh.member.constant.MemberChangeApplyState;
import io.v.nutz.zhgh.member.constant.MemberChangeOrigin; import io.v.nutz.zhgh.member.constant.MemberChangeOrigin;
@@ -14,9 +17,6 @@ import io.v.nutz.zhgh.member.constant.MemberChangeRecordMode;
import io.v.nutz.zhgh.member.handle.MemberChangeAuditHandle; import io.v.nutz.zhgh.member.handle.MemberChangeAuditHandle;
import io.v.nutz.zhgh.member.model.MemberChangeRecord; import io.v.nutz.zhgh.member.model.MemberChangeRecord;
import io.v.nutz.zhgh.member.model.MemberCheckUnionTask; import io.v.nutz.zhgh.member.model.MemberCheckUnionTask;
import io.v.nutz.base.model.Audit;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.web.commons.utils.ShiroUtil;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.dao.Chain; import org.nutz.dao.Chain;
import org.nutz.dao.Cnd; import org.nutz.dao.Cnd;
@@ -67,11 +67,11 @@ public class MemberCheckUnionController {
@Param(value = "taskId", required = false) String taskId, @Param(value = "taskId", required = false) String taskId,
@Param(value = "unionId", required = false) String unionId, @Param(value = "unionId", required = false) String unionId,
@Param(value = "unitId", required = false) String unitId, @Param(value = "unitId", required = false) String unitId,
@Param(value = "sex", required = false) String sex,
@Param(value = "changed", required = false) Integer changed, @Param(value = "changed", required = false) Integer changed,
@Param(value = "isMember", required = false) Integer isMember, @Param(value = "isMember", required = false) Integer isMember,
@Param(value = "unionGroupId", required = false) String unionGroupId, @Param(value = "unionGroupId", required = false) String unionGroupId,
@Param(value = "threeUnitId", required = false) String threeUnitId, @Param(value = "threeUnitId", required = false) String threeUnitId,
@Param(value = "preparedBy", required = false) String preparedBy,
@Param(value = "userStates", required = false) String[] userStates, @Param(value = "userStates", required = false) String[] userStates,
@Param(value = "personTypes", required = false) String[] personTypes, @Param(value = "personTypes", required = false) String[] personTypes,
@Param(value = "changeTypes", required = false) Integer[] changeTypes, @Param(value = "changeTypes", required = false) Integer[] changeTypes,
@@ -86,6 +86,7 @@ public class MemberCheckUnionController {
u.birthday, u.birthday,
u.personType, u.personType,
u.userState, u.userState,
u.preparedBy,
u.unionname, u.unionname,
u.unitname, u.unitname,
u.threeUnitName, u.threeUnitName,
@@ -114,18 +115,18 @@ public class MemberCheckUnionController {
cnd.and("u.unionId", "=", Vi.getUnionId()); cnd.and("u.unionId", "=", Vi.getUnionId());
} else if (ShiroUtil.hasRole("ghxzzz")) { } else if (ShiroUtil.hasRole("ghxzzz")) {
SqlExpressionGroup seg = new SqlExpressionGroup(); SqlExpressionGroup seg = new SqlExpressionGroup();
seg.or("u.unionGroupId", "in", io.v.nutz.web.commons.utils.ShiroUtil.getUnionGroupIds()); seg.or("u.unionGroupId", "in", ShiroUtil.getUnionGroupIds());
seg.or("u.unionGroupId", "is", null); seg.or("u.unionGroupId", "is", null);
cnd.and(seg); cnd.and(seg);
cnd.and("u.unionid", "=", Vi.getUnionId()); cnd.and("u.unionid", "=", Vi.getUnionId());
} }
} }
cnd.andEX("u.sex", "=", sex);
cnd.andEX("u.unionid", "=", unionId); cnd.andEX("u.unionid", "=", unionId);
cnd.andEX("u.unitid", "=", unitId); cnd.andEX("u.unitid", "=", unitId);
cnd.andEX("u.unionGroupId", "=", unionGroupId); cnd.andEX("u.unionGroupId", "=", unionGroupId);
cnd.andEX("u.threeUnitId", "=", threeUnitId); cnd.andEX("u.threeUnitId", "=", threeUnitId);
cnd.andEX("u.preparedBy", "=", preparedBy);
cnd.and(Cnd.likeEX("u." + pageForm.getSearchName(), pageForm.getSearchKeyword())); cnd.and(Cnd.likeEX("u." + pageForm.getSearchName(), pageForm.getSearchKeyword()));
cnd.andEX("u.member", "=", isMember); cnd.andEX("u.member", "=", isMember);
@@ -143,7 +144,7 @@ public class MemberCheckUnionController {
cnd.desc("changeTime"); cnd.desc("changeTime");
} }
if (org.nutz.lang.Lang.isNotEmpty(changeTypes)) { if (Lang.isNotEmpty(changeTypes)) {
SqlExpressionGroup seg = new SqlExpressionGroup(); SqlExpressionGroup seg = new SqlExpressionGroup();
for (Integer type : changeTypes) { for (Integer type : changeTypes) {
seg.or(new Static("JSON_CONTAINS(his.changeTypes, CAST(%d AS JSON), '$')".formatted(type))); seg.or(new Static("JSON_CONTAINS(his.changeTypes, CAST(%d AS JSON), '$')".formatted(type)));
@@ -151,7 +152,7 @@ public class MemberCheckUnionController {
cnd.and(seg); cnd.and(seg);
} }
if (org.nutz.lang.Lang.isNotEmpty(userStates)) { if (Lang.isNotEmpty(userStates)) {
SqlExpressionGroup seg = new SqlExpressionGroup(); SqlExpressionGroup seg = new SqlExpressionGroup();
for (String state : userStates) { for (String state : userStates) {
seg.orEquals("u.userState", state); seg.orEquals("u.userState", state);
@@ -159,7 +160,7 @@ public class MemberCheckUnionController {
cnd.and(seg); cnd.and(seg);
} }
if (org.nutz.lang.Lang.isNotEmpty(personTypes)) { if (Lang.isNotEmpty(personTypes)) {
SqlExpressionGroup seg = new SqlExpressionGroup(); SqlExpressionGroup seg = new SqlExpressionGroup();
for (String personType : personTypes) { for (String personType : personTypes) {
seg.orEquals("u.personType", personType); seg.orEquals("u.personType", personType);
@@ -167,7 +168,7 @@ public class MemberCheckUnionController {
cnd.and(seg); cnd.and(seg);
} }
if (org.nutz.lang.Lang.isNotEmpty(changeOrigins)) { if (Lang.isNotEmpty(changeOrigins)) {
SqlExpressionGroup seg = new SqlExpressionGroup(); SqlExpressionGroup seg = new SqlExpressionGroup();
for (Integer c : changeOrigins) { for (Integer c : changeOrigins) {
seg.orEquals("u.changeOrigin", c); seg.orEquals("u.changeOrigin", c);
@@ -218,7 +219,7 @@ public class MemberCheckUnionController {
} else if (ShiroUtil.hasRole("ghxzzz")) { } else if (ShiroUtil.hasRole("ghxzzz")) {
cnd.and("u.unionId", "=", Vi.getUnionId()); cnd.and("u.unionId", "=", Vi.getUnionId());
SqlExpressionGroup seg = new SqlExpressionGroup(); SqlExpressionGroup seg = new SqlExpressionGroup();
seg.or("u.unionGroupId", "in", io.v.nutz.web.commons.utils.ShiroUtil.getUnionGroupIds()); seg.or("u.unionGroupId", "in", ShiroUtil.getUnionGroupIds());
seg.or("u.unionGroupId", "is", null); seg.or("u.unionGroupId", "is", null);
cnd.and(seg); cnd.and(seg);
} }
@@ -230,7 +231,7 @@ public class MemberCheckUnionController {
cnd.andEX("u.unitid", "=", unitId); cnd.andEX("u.unitid", "=", unitId);
cnd.andEX("u.member", "=", isMember); cnd.andEX("u.member", "=", isMember);
if (org.nutz.lang.Lang.isNotEmpty(changeTypes)) { if (Lang.isNotEmpty(changeTypes)) {
SqlExpressionGroup seg = new SqlExpressionGroup(); SqlExpressionGroup seg = new SqlExpressionGroup();
for (Integer type : changeTypes) { for (Integer type : changeTypes) {
seg.or(new Static("JSON_CONTAINS(his.changeTypes, CAST(%d AS JSON), '$')".formatted(type))); seg.or(new Static("JSON_CONTAINS(his.changeTypes, CAST(%d AS JSON), '$')".formatted(type)));
@@ -238,7 +239,7 @@ public class MemberCheckUnionController {
cnd.and(seg); cnd.and(seg);
} }
if (org.nutz.lang.Lang.isNotEmpty(userStates)) { if (Lang.isNotEmpty(userStates)) {
SqlExpressionGroup seg = new SqlExpressionGroup(); SqlExpressionGroup seg = new SqlExpressionGroup();
for (String state : userStates) { for (String state : userStates) {
seg.orEquals("u.userState", state); seg.orEquals("u.userState", state);
@@ -246,7 +247,7 @@ public class MemberCheckUnionController {
cnd.and(seg); cnd.and(seg);
} }
if (org.nutz.lang.Lang.isNotEmpty(personTypes)) { if (Lang.isNotEmpty(personTypes)) {
SqlExpressionGroup seg = new SqlExpressionGroup(); SqlExpressionGroup seg = new SqlExpressionGroup();
for (String personType : personTypes) { for (String personType : personTypes) {
seg.orEquals("u.personType", personType); seg.orEquals("u.personType", personType);
@@ -254,7 +255,7 @@ public class MemberCheckUnionController {
cnd.and(seg); cnd.and(seg);
} }
if (org.nutz.lang.Lang.isNotEmpty(changeOrigins)) { if (Lang.isNotEmpty(changeOrigins)) {
SqlExpressionGroup seg = new SqlExpressionGroup(); SqlExpressionGroup seg = new SqlExpressionGroup();
for (Integer c : changeOrigins) { for (Integer c : changeOrigins) {
seg.orEquals("u.changeOrigin", c); seg.orEquals("u.changeOrigin", c);
@@ -309,11 +310,11 @@ public class MemberCheckUnionController {
dao.execute(userSql); dao.execute(userSql);
String userState = StrUtil.blankToDefault(userSql.getString(), ""); String userState = StrUtil.blankToDefault(userSql.getString(), "");
if (memberChangeRecord.getType() == UserChangeType.ON_DUTY.getCode()) { // if (memberChangeRecord.getType() == UserChangeType.ON_DUTY.getCode()) {
if (userState.equals(UserChangeType.ON_DUTY.getDescription())) { // if (userState.equals(UserChangeType.ON_DUTY.getDescription())) {
return Result.error("该用户当前的状态已经是" + UserChangeType.ON_DUTY.getDescription() + ",您无需变更!"); // return Result.error("该用户当前的状态已经是" + UserChangeType.ON_DUTY.getDescription() + ",您无需变更!");
} // }
} // }
if (memberChangeRecord.getType() == UserChangeType.RESIGN.getCode()) { if (memberChangeRecord.getType() == UserChangeType.RESIGN.getCode()) {
if (userState.equals(UserChangeType.RESIGN.getDescription())) { if (userState.equals(UserChangeType.RESIGN.getDescription())) {
return Result.error("该用户当前的状态已经是" + UserChangeType.RESIGN.getDescription() + ",您无需变更!"); return Result.error("该用户当前的状态已经是" + UserChangeType.RESIGN.getDescription() + ",您无需变更!");
@@ -4,8 +4,15 @@ import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.entity.ExportParams; import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity; import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import io.v.nutz.base.annontation.ViReturn; import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.base.dao.CndPlus; import io.v.nutz.base.dao.CndPlus;
import io.v.nutz.base.model.Audit;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.service.AsyncService;
import io.v.nutz.base.service.AuditService;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.base.utils.ViTool;
import io.v.nutz.sys.services.SysUserService;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.data.constant.UserChangeType; import io.v.nutz.zhgh.data.constant.UserChangeType;
import io.v.nutz.zhgh.member.MemberMode; import io.v.nutz.zhgh.member.MemberMode;
import io.v.nutz.zhgh.member.UserMode; import io.v.nutz.zhgh.member.UserMode;
@@ -15,13 +22,6 @@ import io.v.nutz.zhgh.member.constant.MemberChangeRecordMode;
import io.v.nutz.zhgh.member.constant.MemberOrigin; import io.v.nutz.zhgh.member.constant.MemberOrigin;
import io.v.nutz.zhgh.member.model.MemberChangeRecord; import io.v.nutz.zhgh.member.model.MemberChangeRecord;
import io.v.nutz.zhgh.member.service.MemberService; import io.v.nutz.zhgh.member.service.MemberService;
import io.v.nutz.base.model.Audit;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.service.AuditService;
import io.v.nutz.base.service.AsyncService;
import io.v.nutz.sys.services.SysUserService;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.base.utils.ViTool;
import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.Workbook;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.dao.Cnd; import org.nutz.dao.Cnd;
@@ -123,7 +123,7 @@ public class MemberBatchMakeController {
} else if (ShiroUtil.hasRole("ghxzzz")) { } else if (ShiroUtil.hasRole("ghxzzz")) {
cnd.and("unionId", "=", Vi.getUnionId()); cnd.and("unionId", "=", Vi.getUnionId());
SqlExpressionGroup seg = new SqlExpressionGroup(); SqlExpressionGroup seg = new SqlExpressionGroup();
seg.or("unionGroupId", "in", io.v.nutz.web.commons.utils.ShiroUtil.getUnionGroupIds()); seg.or("unionGroupId", "in", ShiroUtil.getUnionGroupIds());
seg.or("unionGroupId", "is", null); seg.or("unionGroupId", "is", null);
cnd.and(seg); cnd.and(seg);
} }
@@ -217,7 +217,7 @@ public class MemberBatchMakeController {
} else if (ShiroUtil.hasRole("ghxzzz")) { } else if (ShiroUtil.hasRole("ghxzzz")) {
cnd.and("unionId", "=", Vi.getUnionId()); cnd.and("unionId", "=", Vi.getUnionId());
SqlExpressionGroup seg = new SqlExpressionGroup(); SqlExpressionGroup seg = new SqlExpressionGroup();
seg.or("unionGroupId", "in", io.v.nutz.web.commons.utils.ShiroUtil.getUnionGroupIds()); seg.or("unionGroupId", "in", ShiroUtil.getUnionGroupIds());
seg.or("unionGroupId", "is", null); seg.or("unionGroupId", "is", null);
cnd.and(seg); cnd.and(seg);
} }
@@ -2,8 +2,12 @@ package io.v.nutz.zhgh.member.controller.info;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import io.v.nutz.base.annontation.ViReturn; import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.model.Audit;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.utils.PageUtil; import io.v.nutz.base.utils.PageUtil;
import io.v.nutz.base.utils.Vi; import io.v.nutz.base.utils.Vi;
import io.v.nutz.sys.models.Sys_user;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.data.constant.UserChangeType; import io.v.nutz.zhgh.data.constant.UserChangeType;
import io.v.nutz.zhgh.member.MemberMode; import io.v.nutz.zhgh.member.MemberMode;
import io.v.nutz.zhgh.member.UserMode; import io.v.nutz.zhgh.member.UserMode;
@@ -14,10 +18,6 @@ import io.v.nutz.zhgh.member.constant.MemberChangeRecordMode;
import io.v.nutz.zhgh.member.constant.MemberOrigin; import io.v.nutz.zhgh.member.constant.MemberOrigin;
import io.v.nutz.zhgh.member.model.MemberChangeRecord; import io.v.nutz.zhgh.member.model.MemberChangeRecord;
import io.v.nutz.zhgh.member.service.MemberService; import io.v.nutz.zhgh.member.service.MemberService;
import io.v.nutz.base.model.Audit;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.sys.models.Sys_user;
import io.v.nutz.web.commons.utils.ShiroUtil;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.aop.interceptor.ioc.TransAop; import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.dao.Chain; import org.nutz.dao.Chain;
@@ -71,7 +71,8 @@ public class MemberDataManageController {
@Param(value = "startLoginNames", required = false) String startLoginNames, @Param(value = "startLoginNames", required = false) String startLoginNames,
@Param(value = "endLoginNames", required = false) String endLoginNames, @Param(value = "endLoginNames", required = false) String endLoginNames,
@Param(value = "personTypes", required = false) String[] personTypes, @Param(value = "personTypes", required = false) String[] personTypes,
@Param(value = "userStates", required = false) String[] userStates @Param(value = "userStates", required = false) String[] userStates,
@Param(value = "preparedBys", required = false) String[] preparedBys
) { ) {
Sql sql = Sqls.create(""" Sql sql = Sqls.create("""
SELECT SELECT
@@ -83,6 +84,7 @@ public class MemberDataManageController {
welfareMember, welfareMember,
personType, personType,
userState, userState,
preparedBy,
unioncode, unioncode,
unionname, unionname,
unionid, unionid,
@@ -123,6 +125,7 @@ public class MemberDataManageController {
cnd.andEX("campusName", "=", campus); cnd.andEX("campusName", "=", campus);
cnd.andEX("personType", "in", personTypes); cnd.andEX("personType", "in", personTypes);
cnd.andEX("userState", "in", userStates); cnd.andEX("userState", "in", userStates);
cnd.andEX("preparedBy", "in", preparedBys);
if (StrUtil.isNotBlank(startLoginNames)) { if (StrUtil.isNotBlank(startLoginNames)) {
String[] loginNames = startLoginNames.split(","); String[] loginNames = startLoginNames.split(",");
@@ -146,7 +149,7 @@ public class MemberDataManageController {
if (ShiroUtil.hasRole("H04")) { if (ShiroUtil.hasRole("H04")) {
cnd.and("unionid", "=", Vi.getUnionId()); cnd.and("unionid", "=", Vi.getUnionId());
} else { } else {
cnd.and("unionGroupId", "in", io.v.nutz.web.commons.utils.ShiroUtil.getUnionGroupIds()); cnd.and("unionGroupId", "in", ShiroUtil.getUnionGroupIds());
} }
} }
@@ -249,7 +252,7 @@ public class MemberDataManageController {
if (ShiroUtil.hasRole("H04")) { if (ShiroUtil.hasRole("H04")) {
cnd.and("unionid", "=", Vi.getUnionId()); cnd.and("unionid", "=", Vi.getUnionId());
} else { } else {
cnd.and("unionGroupId", "in", io.v.nutz.web.commons.utils.ShiroUtil.getUnionGroupIds()); cnd.and("unionGroupId", "in", ShiroUtil.getUnionGroupIds());
} }
} }
@@ -315,6 +318,7 @@ public class MemberDataManageController {
@Param(value = "endLoginNames", required = false) String endLoginNames, @Param(value = "endLoginNames", required = false) String endLoginNames,
@Param(value = "confirm", required = false) Boolean confirm, @Param(value = "confirm", required = false) Boolean confirm,
@Param(value = "personTypes", required = false) String[] personTypes, @Param(value = "personTypes", required = false) String[] personTypes,
@Param(value = "preparedBys", required = false) String[] preparedBys,
@Param(value = "userStates", required = false) String[] userStates) { @Param(value = "userStates", required = false) String[] userStates) {
@@ -343,6 +347,7 @@ public class MemberDataManageController {
cnd.andEX("campusName", "=", campus); cnd.andEX("campusName", "=", campus);
cnd.andEX("personType", "in", personTypes); cnd.andEX("personType", "in", personTypes);
cnd.andEX("userState", "in", userStates); cnd.andEX("userState", "in", userStates);
cnd.andEX("preparedBy", "in", preparedBys);
if (StrUtil.isNotBlank(startLoginNames)) { if (StrUtil.isNotBlank(startLoginNames)) {
String[] loginNames = startLoginNames.split(","); String[] loginNames = startLoginNames.split(",");
@@ -366,7 +371,7 @@ public class MemberDataManageController {
if (ShiroUtil.hasRole("H04")) { if (ShiroUtil.hasRole("H04")) {
cnd.and("unionid", "=", Vi.getUnionId()); cnd.and("unionid", "=", Vi.getUnionId());
} else { } else {
cnd.and("unionGroupId", "in", io.v.nutz.web.commons.utils.ShiroUtil.getUnionGroupIds()); cnd.and("unionGroupId", "in", ShiroUtil.getUnionGroupIds());
} }
} }
@@ -5,20 +5,20 @@ import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity; import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import io.v.nutz.base.annontation.ViReturn; import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.dao.CndPlus;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.result.Result; import io.v.nutz.base.result.Result;
import io.v.nutz.base.service.AsyncService; import io.v.nutz.base.service.AsyncService;
import io.v.nutz.base.utils.Vi; import io.v.nutz.base.utils.Vi;
import io.v.nutz.base.dao.CndPlus; import io.v.nutz.base.utils.ViTool;
import io.v.nutz.sys.services.SysRoleService;
import io.v.nutz.sys.services.SysUserService;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.member.MemberMode; import io.v.nutz.zhgh.member.MemberMode;
import io.v.nutz.zhgh.member.UserMode; import io.v.nutz.zhgh.member.UserMode;
import io.v.nutz.zhgh.member.model.MemberHistory; import io.v.nutz.zhgh.member.model.MemberHistory;
import io.v.nutz.zhgh.member.service.MemberHistoryService; import io.v.nutz.zhgh.member.service.MemberHistoryService;
import io.v.nutz.zhgh.member.service.MemberService; import io.v.nutz.zhgh.member.service.MemberService;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.sys.services.SysRoleService;
import io.v.nutz.sys.services.SysUserService;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.base.utils.ViTool;
import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.Workbook;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.dao.Cnd; import org.nutz.dao.Cnd;
@@ -159,7 +159,7 @@ public class MemberGroupInfoController {
} else if (ShiroUtil.hasRole("ghxzzz")) { } else if (ShiroUtil.hasRole("ghxzzz")) {
cnd.and("unionId", "=", Vi.getUnionId()); cnd.and("unionId", "=", Vi.getUnionId());
SqlExpressionGroup seg = new SqlExpressionGroup(); SqlExpressionGroup seg = new SqlExpressionGroup();
seg.or("unionGroupId", "in", io.v.nutz.web.commons.utils.ShiroUtil.getUnionGroupIds()); seg.or("unionGroupId", "in", ShiroUtil.getUnionGroupIds());
seg.or("unionGroupId", "is", null); seg.or("unionGroupId", "is", null);
cnd.and(seg); cnd.and(seg);
} }
@@ -1,8 +1,12 @@
package io.v.nutz.zhgh.member.controller.info; package io.v.nutz.zhgh.member.controller.info;
import io.v.nutz.base.annontation.ViReturn; import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.base.dao.CndPlus; import io.v.nutz.base.dao.CndPlus;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.sys.models.Sys_user;
import io.v.nutz.sys.services.SysUserService;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.data.constant.UserChangeType; import io.v.nutz.zhgh.data.constant.UserChangeType;
import io.v.nutz.zhgh.data.model.UserHistory; import io.v.nutz.zhgh.data.model.UserHistory;
import io.v.nutz.zhgh.data.service.HistoryUserService; import io.v.nutz.zhgh.data.service.HistoryUserService;
@@ -10,10 +14,6 @@ import io.v.nutz.zhgh.member.UserMode;
import io.v.nutz.zhgh.member.constant.*; import io.v.nutz.zhgh.member.constant.*;
import io.v.nutz.zhgh.member.model.MemberChangeRecord; import io.v.nutz.zhgh.member.model.MemberChangeRecord;
import io.v.nutz.zhgh.member.service.MemberService; import io.v.nutz.zhgh.member.service.MemberService;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.sys.models.Sys_user;
import io.v.nutz.sys.services.SysUserService;
import io.v.nutz.web.commons.utils.ShiroUtil;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.dao.Chain; import org.nutz.dao.Chain;
import org.nutz.dao.Cnd; import org.nutz.dao.Cnd;
@@ -132,7 +132,7 @@ public class MemberMakeController {
if (ShiroUtil.hasRole("H04")) { if (ShiroUtil.hasRole("H04")) {
cnd.and("unionid", "=", Vi.getUnionId()); cnd.and("unionid", "=", Vi.getUnionId());
} else { } else {
cnd.and("unionGroupId", "in", io.v.nutz.web.commons.utils.ShiroUtil.getUnionGroupIds()); cnd.and("unionGroupId", "in", ShiroUtil.getUnionGroupIds());
} }
} }
@@ -6,8 +6,8 @@ import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import io.v.nutz.base.annontation.ViReturn; import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.utils.Vi; import io.v.nutz.base.utils.Vi;
import io.v.nutz.base.utils.ViTool; import io.v.nutz.base.utils.ViTool;
import io.v.nutz.zhgh.member.service.MemberService;
import io.v.nutz.web.commons.utils.ShiroUtil; import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.member.service.MemberService;
import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.Workbook;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.dao.Cnd; import org.nutz.dao.Cnd;
@@ -2,12 +2,12 @@ package io.v.nutz.zhgh.member.controller.inquire;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import io.v.nutz.base.annontation.ViReturn; import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.base.dao.CndPlus; import io.v.nutz.base.dao.CndPlus;
import io.v.nutz.zhgh.data.model.UserHistory;
import io.v.nutz.base.query.PageForm; import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.service.ViService; import io.v.nutz.base.service.ViService;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.web.commons.utils.ShiroUtil; import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.data.model.UserHistory;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.dao.Sqls; import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql; import org.nutz.dao.sql.Sql;
@@ -69,7 +69,7 @@ public class MemberHistoyController {
} else if (ShiroUtil.hasRole("ghxzzz")) { } else if (ShiroUtil.hasRole("ghxzzz")) {
cnd.and("u.unionId", "=", Vi.getUnionId()); cnd.and("u.unionId", "=", Vi.getUnionId());
SqlExpressionGroup seg = new SqlExpressionGroup(); SqlExpressionGroup seg = new SqlExpressionGroup();
seg.or("u.unionGroupId", "in", io.v.nutz.web.commons.utils.ShiroUtil.getUnionGroupIds()); seg.or("u.unionGroupId", "in", ShiroUtil.getUnionGroupIds());
seg.or("u.unionGroupId", "is", null); seg.or("u.unionGroupId", "is", null);
cnd.and(seg); cnd.and(seg);
} }
@@ -6,16 +6,16 @@ import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity; import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import io.v.nutz.base.annontation.ViReturn; import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.base.dao.CndPlus; import io.v.nutz.base.dao.CndPlus;
import io.v.nutz.zhgh.member.constant.MemberStatus;
import io.v.nutz.zhgh.member.service.MemberService;
import io.v.nutz.zhgh.member.utils.MemberUtils;
import io.v.nutz.base.query.PageForm; import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.service.ViService; import io.v.nutz.base.service.ViService;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.sys.models.Sys_user; import io.v.nutz.sys.models.Sys_user;
import io.v.nutz.sys.services.SysUserService; import io.v.nutz.sys.services.SysUserService;
import io.v.nutz.web.commons.utils.ShiroUtil; import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.member.constant.MemberStatus;
import io.v.nutz.zhgh.member.service.MemberService;
import io.v.nutz.zhgh.member.utils.MemberUtils;
import lombok.Data; import lombok.Data;
import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.Workbook;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
@@ -80,6 +80,7 @@ public class MemberInquireIntegrateController {
@Param(value = "unionGroupId", required = false) String[] unionGroupId, @Param(value = "unionGroupId", required = false) String[] unionGroupId,
@Param(value = "personTypes", required = false) String[] personTypes, @Param(value = "personTypes", required = false) String[] personTypes,
@Param(value = "userStates", required = false) String[] userStates, @Param(value = "userStates", required = false) String[] userStates,
@Param(value = "preparedBys", required = false) String[] preparedBys,
@Param(value = "memberStatus", required = false) String[] memberStatus, @Param(value = "memberStatus", required = false) String[] memberStatus,
@Param(value = "campus", required = false) String campus, @Param(value = "campus", required = false) String campus,
@Param(value = "memberType", required = false) String memberType, @Param(value = "memberType", required = false) String memberType,
@@ -92,7 +93,7 @@ public class MemberInquireIntegrateController {
@Param(value = "memberSearchKeyWord", required = false) String memberSearchKeyWord) { @Param(value = "memberSearchKeyWord", required = false) String memberSearchKeyWord) {
int yyyy = Calendar.getInstance().get(Calendar.YEAR); int yyyy = Calendar.getInstance().get(Calendar.YEAR);
Cnd cnd = MemberUtils.getCnd(pageForm, startDate, endDate, unionId, unitId, personTypes, userStates, memberTypes, sexTypes, age, null, roleIds, null, null, memberStatus, threeUnitId, unionGroupId, reverseSelection, null, null, campus); Cnd cnd = MemberUtils.getCnd(pageForm, startDate, endDate, unionId, unitId, personTypes, userStates, preparedBys, memberTypes, sexTypes, age, null, roleIds, null, null, memberStatus, threeUnitId, unionGroupId, reverseSelection, null, null, campus);
Sql sql = Sqls.create(""" Sql sql = Sqls.create("""
SELECT u.* from $table SELECT u.* from $table
@@ -143,7 +144,12 @@ public class MemberInquireIntegrateController {
} }
if (!ShiroUtil.hasAnyRoles("sysadmin,A06,H03")) { if (!ShiroUtil.hasAnyRoles("sysadmin,A06,H03")) {
cnd.and("unionid", "=", Vi.getUnionId()); if (ShiroUtil.hasAnyRoles("H04,gh01")) {
cnd.and("u.unionId", "=", Vi.getUnionId());
} else if (ShiroUtil.hasRole("ghxzzz")) {
cnd.and("u.unionGroupId", "in", ShiroUtil.getUnionGroupIds());
// cnd.and("u.unionid", "=", Vi.getUnionId());
}
} }
if (StrUtil.isBlank(pageForm.getPageOrderName()) && StrUtil.isBlank(pageForm.getPageOrderBy())) { if (StrUtil.isBlank(pageForm.getPageOrderName()) && StrUtil.isBlank(pageForm.getPageOrderBy())) {
@@ -241,7 +247,7 @@ public class MemberInquireIntegrateController {
private String endDate; private String endDate;
@Excel(name = "参加工作日期", width = 20d) @Excel(name = "参加工作日期", width = 20d)
private String schoolTime; private String workDate;
@Excel(name = "录用职位", width = 20d) @Excel(name = "录用职位", width = 20d)
private String position; private String position;
@@ -443,6 +449,7 @@ public class MemberInquireIntegrateController {
@Param(value = "unionGroupId", required = false) String[] unionGroupId, @Param(value = "unionGroupId", required = false) String[] unionGroupId,
@Param(value = "personTypes", required = false) String[] personTypes, @Param(value = "personTypes", required = false) String[] personTypes,
@Param(value = "userStates", required = false) String[] userStates, @Param(value = "userStates", required = false) String[] userStates,
@Param(value = "preparedBys", required = false) String[] preparedBys,
@Param(value = "memberStatus", required = false) String[] memberStatus, @Param(value = "memberStatus", required = false) String[] memberStatus,
@Param(value = "campus", required = false) String campus, @Param(value = "campus", required = false) String campus,
@Param(value = "memberType", required = false) String memberType, @Param(value = "memberType", required = false) String memberType,
@@ -455,62 +462,9 @@ public class MemberInquireIntegrateController {
@Param(value = "memberSearchKeyWord", required = false) String memberSearchKeyWord, @Param(value = "memberSearchKeyWord", required = false) String memberSearchKeyWord,
String props) { String props) {
try { try {
// int yyyy = Calendar.getInstance().get(Calendar.YEAR);
// CndPlus cnd = CndPlus.create();
// Sql sql = Sqls.create("""
// SELECT
// *,
// unitname,
// unionname,
// unitcode,
// unioncode
// FROM
// $table
// $condition
// """);
//
// if (year == yyyy) {
// sql.setVar("table", "user");
// } else {
// sql.setVar("table", "member_his");
// cnd.andEX("year", "=", year);
// }
//
// cnd.and("member", "=", 1);
// if (ShiroUtil.hasAnyRoles("sysadmin,A06,H03")) {
// cnd.andEX("unionid", "=", unionId);
// } else {
// cnd.andEX("unionid", "=", Vi.getUnionId());
// }
// cnd.andEX("unitid", "=", unitId);
// if (memberStatus != null) {
// if (Json.fromJsonAsArray(Integer.class, memberStatus).length > 0) {
// cnd.andEX("memberStatus", "in", Json.fromJsonAsArray(Integer.class, memberStatus));
// } else {
// List<Integer> status = new ArrayList<>();
// status.add(MemberStatus.NORMAL.getCode());
// status.add(MemberStatus.TURN_IN.getCode());
// status.add(MemberStatus.RESTORE.getCode());
// SqlExpressionGroup group = new SqlExpressionGroup();
// group.and("memberStatus", "in", status);
// group.or("memberStatus", "IS", null);
// cnd.and(group);
// }
// }
//
// if (personTypes != null && Json.fromJsonAsArray(String.class, personTypes).length > 0) {
// cnd.andEX("personType", "in", Json.fromJsonAsArray(String.class, personTypes));
// }
// if (userStates != null && Json.fromJsonAsArray(String.class, userStates).length > 0) {
// cnd.andEX("userState", "in", Json.fromJsonAsArray(String.class, userStates));
// }
// cnd.asc("unitcode");
// cnd.asc("unioncode");
// cnd.asc("memberJoinTime");
// sql.setCondition(cnd);
int yyyy = Calendar.getInstance().get(Calendar.YEAR); int yyyy = Calendar.getInstance().get(Calendar.YEAR);
Cnd cnd = MemberUtils.getCnd(null, startDate, endDate, unionId, unitId, personTypes, userStates, memberTypes, sexTypes, age, null, roleIds, null, null, memberStatus, threeUnitId, unionGroupId, reverseSelection, null, null, campus); Cnd cnd = MemberUtils.getCnd(null, startDate, endDate, unionId, unitId, personTypes, userStates, preparedBys, memberTypes, sexTypes, age, null, roleIds, null, null, memberStatus, threeUnitId, unionGroupId, reverseSelection, null, null, campus);
Sql sql = Sqls.create(""" Sql sql = Sqls.create("""
SELECT u.* from $table SELECT u.* from $table
@@ -4,8 +4,8 @@ import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.entity.ExportParams; import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity; import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.base.dao.CndPlus; import io.v.nutz.base.dao.CndPlus;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.sys.services.SysUserService; import io.v.nutz.sys.services.SysUserService;
import io.v.nutz.web.commons.utils.ShiroUtil; import io.v.nutz.web.commons.utils.ShiroUtil;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
@@ -5,10 +5,10 @@ import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity; import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import io.v.nutz.base.annontation.ViReturn; import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.utils.Vi; import io.v.nutz.base.utils.Vi;
import io.v.nutz.zhgh.member.service.MemberService;
import io.v.nutz.sys.models.Sys_dict; import io.v.nutz.sys.models.Sys_dict;
import io.v.nutz.sys.services.SysDictService; import io.v.nutz.sys.services.SysDictService;
import io.v.nutz.web.commons.utils.ShiroUtil; import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.member.service.MemberService;
import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.Workbook;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.dao.Sqls; import org.nutz.dao.Sqls;
@@ -1,9 +1,16 @@
package io.v.nutz.zhgh.member.handle; package io.v.nutz.zhgh.member.handle;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import io.v.nutz.base.model.Audit;
import io.v.nutz.base.service.AuditService;
import io.v.nutz.base.service.ViService;
import io.v.nutz.base.service.impl.ViServiceImpl;
import io.v.nutz.base.utils.MsgApi; import io.v.nutz.base.utils.MsgApi;
import io.v.nutz.base.utils.Roles; import io.v.nutz.base.utils.Roles;
import io.v.nutz.base.utils.Vi; import io.v.nutz.base.utils.Vi;
import io.v.nutz.base.utils.ViResource;
import io.v.nutz.sys.models.Sys_user;
import io.v.nutz.sys.services.SysUserService;
import io.v.nutz.web.commons.utils.ShiroUtil; import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.data.constant.UserChangeType; import io.v.nutz.zhgh.data.constant.UserChangeType;
import io.v.nutz.zhgh.data.model.UserHistory; import io.v.nutz.zhgh.data.model.UserHistory;
@@ -12,13 +19,6 @@ import io.v.nutz.zhgh.member.constant.MemberApplyState;
import io.v.nutz.zhgh.member.constant.MemberChangeOrigin; import io.v.nutz.zhgh.member.constant.MemberChangeOrigin;
import io.v.nutz.zhgh.member.constant.MemberOrigin; import io.v.nutz.zhgh.member.constant.MemberOrigin;
import io.v.nutz.zhgh.member.model.MemberApplyRecord; import io.v.nutz.zhgh.member.model.MemberApplyRecord;
import io.v.nutz.base.model.Audit;
import io.v.nutz.base.service.AuditService;
import io.v.nutz.base.service.ViService;
import io.v.nutz.base.service.impl.ViServiceImpl;
import io.v.nutz.sys.models.Sys_user;
import io.v.nutz.sys.services.SysUserService;
import io.v.nutz.base.utils.ViResource;
import lombok.Getter; import lombok.Getter;
import org.nutz.aop.interceptor.ioc.TransAop; import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.dao.Chain; import org.nutz.dao.Chain;
@@ -106,29 +106,29 @@ public enum MemberApplyAuditHandle {
MemberApplyToDoHandler.COMPLETE_UNION_TASK.exec(record,NutMap.NEW().addv("nodeName",audit.getAuditPass() ? "基层工会通过" : "基层工会拒绝")); MemberApplyToDoHandler.COMPLETE_UNION_TASK.exec(record,NutMap.NEW().addv("nodeName",audit.getAuditPass() ? "基层工会通过" : "基层工会拒绝"));
if (audit.getAuditPass()) { // if (audit.getAuditPass()) {
//
Sql sql = Sqls.create(""" // Sql sql = Sqls.create("""
SELECT // SELECT
su.loginname // su.loginname
FROM // FROM
sys_user_role sur // sys_user_role sur
LEFT JOIN sys_user su ON su.id = sur.userId // LEFT JOIN sys_user su ON su.id = sur.userId
WHERE // WHERE
sur.roleId = @roleId // sur.roleId = @roleId
""").setParam("roleId", Roles.H03); // """).setParam("roleId", Roles.H03);
//
List<NutMap> mapList = sysUserService.listMap(sql); // List<NutMap> mapList = sysUserService.listMap(sql);
//
MemberApplyToDoHandler.CREATE_SCHOOL_TASK.exec(record,NutMap.NEW().addv("schoolLeader",mapList)); // MemberApplyToDoHandler.CREATE_SCHOOL_TASK.exec(record,NutMap.NEW().addv("schoolLeader",mapList));
//
/* mapList.forEach(v -> { ///* mapList.forEach(v -> {
// sendMsg.pushWeChatMsg("会员系统", user.getUsername() + "提交了会员申请待您审核,请前往智慧工会进行审核!", v.getString("loginname")); //// sendMsg.pushWeChatMsg("会员系统", user.getUsername() + "提交了会员申请待您审核,请前往智慧工会进行审核!", v.getString("loginname"));
});*/ // });*/
} else { // } else {
// sendMsg.pushWeChatMsg("会员系统", "院级工会拒绝了您的会员申请", user.getLoginname()); //// sendMsg.pushWeChatMsg("会员系统", "院级工会拒绝了您的会员申请", user.getLoginname());
MemberApplyToDoHandler.REFUSE_UNION_TASK.exec(record,NutMap.NEW().addv("nodeName","基层工会拒绝")); // MemberApplyToDoHandler.REFUSE_UNION_TASK.exec(record,NutMap.NEW().addv("nodeName","基层工会拒绝"));
} // }
return record; return record;
@@ -1,23 +1,18 @@
package io.v.nutz.zhgh.member.handle; package io.v.nutz.zhgh.member.handle;
import io.v.nutz.base.utils.Roles;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.base.utils.ViResource; import io.v.nutz.base.utils.ViResource;
import io.v.nutz.sys.models.User; import io.v.nutz.sys.models.User;
import io.v.nutz.sys.services.SysLocalProcessService; import io.v.nutz.sys.services.SysLocalProcessService;
import io.v.nutz.sys.services.impl.SysLocalProcessServiceImpl; import io.v.nutz.sys.services.impl.SysLocalProcessServiceImpl;
import io.v.nutz.web.commons.utils.ShiroUtil; import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.member.model.MemberApplyRecord; import io.v.nutz.zhgh.member.model.MemberApplyRecord;
import io.v.nutz.zhgh.member.model.MemberChangeRecord;
import io.v.nutz.zhgh.member.service.MemberService; import io.v.nutz.zhgh.member.service.MemberService;
import io.v.nutz.zhgh.member.service.impl.MemberServiceImpl; import io.v.nutz.zhgh.member.service.impl.MemberServiceImpl;
import io.v.nutz.zhgh.zgfw.model.difficult.Zgfw_knbf;
import lombok.Getter; import lombok.Getter;
import org.nutz.dao.Cnd; import org.nutz.dao.Cnd;
import org.nutz.dao.Dao; import org.nutz.dao.Dao;
import org.nutz.dao.Sqls; import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql; import org.nutz.dao.sql.Sql;
import org.nutz.dao.util.Daos;
import org.nutz.lang.util.NutMap; import org.nutz.lang.util.NutMap;
import java.util.List; import java.util.List;
@@ -1,21 +1,21 @@
package io.v.nutz.zhgh.member.handle; package io.v.nutz.zhgh.member.handle;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import io.v.nutz.base.lang.Enum;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import io.v.nutz.base.lang.Enum;
import io.v.nutz.base.model.Audit;
import io.v.nutz.base.service.AuditService;
import io.v.nutz.base.service.ViService;
import io.v.nutz.base.service.impl.ViServiceImpl;
import io.v.nutz.base.utils.Vi; import io.v.nutz.base.utils.Vi;
import io.v.nutz.base.utils.ViResource;
import io.v.nutz.sys.models.Sys_user;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.data.constant.UserChangeType; import io.v.nutz.zhgh.data.constant.UserChangeType;
import io.v.nutz.zhgh.data.model.UserHistory; import io.v.nutz.zhgh.data.model.UserHistory;
import io.v.nutz.zhgh.member.constant.MemberChangeApplyState; import io.v.nutz.zhgh.member.constant.MemberChangeApplyState;
import io.v.nutz.zhgh.member.constant.MemberChangeOrigin; import io.v.nutz.zhgh.member.constant.MemberChangeOrigin;
import io.v.nutz.zhgh.member.model.MemberChangeRecord; import io.v.nutz.zhgh.member.model.MemberChangeRecord;
import io.v.nutz.base.model.Audit;
import io.v.nutz.base.service.AuditService;
import io.v.nutz.base.service.ViService;
import io.v.nutz.base.service.impl.ViServiceImpl;
import io.v.nutz.sys.models.Sys_user;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.base.utils.ViResource;
import lombok.Getter; import lombok.Getter;
import org.nutz.dao.Cnd; import org.nutz.dao.Cnd;
import org.nutz.lang.util.NutMap; import org.nutz.lang.util.NutMap;
@@ -118,7 +118,8 @@ public enum MemberChangeAuditHandle {
if (record.getStateId() == MemberChangeApplyState.SUCCESS) { if (record.getStateId() == MemberChangeApplyState.SUCCESS) {
if (auditService.dao().count(UserHistory.class, Cnd.where("memberChangeRecordId", "=", record.getId())) == 0) { int count = auditService.dao().count(UserHistory.class, Cnd.where("memberChangeRecordId", "=", record.getId()));
if (count == 0) {
UserHistory history = new UserHistory(); UserHistory history = new UserHistory();
Sys_user user = recordViService.dao().fetch(Sys_user.class, record.getUserId()); Sys_user user = recordViService.dao().fetch(Sys_user.class, record.getUserId());
BeanUtils.copyProperties(user, history); BeanUtils.copyProperties(user, history);
@@ -1,25 +1,26 @@
package io.v.nutz.zhgh.member.handle; package io.v.nutz.zhgh.member.handle;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import io.v.nutz.base.service.ViService;
import io.v.nutz.base.service.impl.ViServiceImpl;
import io.v.nutz.base.utils.ViResource;
import io.v.nutz.sys.models.Sys_user;
import io.v.nutz.sys.services.SysRoleService;
import io.v.nutz.sys.services.SysUserService;
import io.v.nutz.zhgh.data.constant.UserChangeType; import io.v.nutz.zhgh.data.constant.UserChangeType;
import io.v.nutz.zhgh.data.model.UserHistory; import io.v.nutz.zhgh.data.model.UserHistory;
import io.v.nutz.zhgh.member.MemberMode;
import io.v.nutz.zhgh.member.UserMode; import io.v.nutz.zhgh.member.UserMode;
import io.v.nutz.zhgh.member.WelfareMemberMode; import io.v.nutz.zhgh.member.WelfareMemberMode;
import io.v.nutz.zhgh.member.constant.MemberStatus; import io.v.nutz.zhgh.member.constant.MemberStatus;
import io.v.nutz.zhgh.member.model.MemberChangeRecord; import io.v.nutz.zhgh.member.model.MemberChangeRecord;
import io.v.nutz.base.service.ViService;
import io.v.nutz.base.service.impl.ViServiceImpl;
import io.v.nutz.sys.models.Sys_user;
import io.v.nutz.sys.services.SysRoleService;
import io.v.nutz.sys.services.SysUserService;
import io.v.nutz.base.utils.ViResource;
import lombok.Getter; import lombok.Getter;
import org.nutz.dao.Chain; import org.nutz.dao.Chain;
import org.nutz.dao.Cnd; import org.nutz.dao.Cnd;
import org.nutz.lang.Strings; import org.nutz.lang.Strings;
import org.springframework.beans.BeanUtils;
import java.util.Date; import java.util.List;
/** /**
* 会员变更Handle * 会员变更Handle
@@ -37,7 +38,7 @@ public enum MemberChangeHandle {
UNIT_CHANGE(UserChangeType.UNIT_CHANGE.getCode()) { UNIT_CHANGE(UserChangeType.UNIT_CHANGE.getCode()) {
@Override @Override
public void change(MemberChangeRecord record) { public void change(MemberChangeRecord record) {
archive(record.getUserId(), UserChangeType.UNIT_CHANGE); archive(record, UserChangeType.UNIT_CHANGE);
sysUserService.update(Chain.make("unitid", record.getCurrentUnitId()) sysUserService.update(Chain.make("unitid", record.getCurrentUnitId())
.add("unionid", record.getCurrentUnionId()) .add("unionid", record.getCurrentUnionId())
.add("threeUnitId", record.getCurrentThreeUnitId()), Cnd.where("id", "=", record.getUserId())); .add("threeUnitId", record.getCurrentThreeUnitId()), Cnd.where("id", "=", record.getUserId()));
@@ -48,14 +49,11 @@ public enum MemberChangeHandle {
NEW(UserChangeType.NEW.getCode()) { NEW(UserChangeType.NEW.getCode()) {
@Override @Override
public void change(MemberChangeRecord record) { public void change(MemberChangeRecord record) {
archive(record.getUserId(), UserChangeType.NEW); archive(record, UserChangeType.NEW);
if (null != record.getInsertMember() && record.getInsertMember()){ if (null != record.getUpdateMember() && record.getUpdateMember()){
UserMode.addMemberRole(record.getUserId());
sysUserService.update(Chain.make("schoolTime", DateUtil.today()),Cnd.where("id","=",record.getUserId())); sysUserService.update(Chain.make("schoolTime", DateUtil.today()),Cnd.where("id","=",record.getUserId()));
} }
if (null != record.getUpdateWelfareMember() && record.getUpdateWelfareMember()) { updateMemberAndWelfareMember(record);
sysUserService.update(Chain.make("welfareMember", WelfareMemberMode.NORMAL.getCode()).add("schoolTime", DateUtil.today()), Cnd.where("id", "=", record.getUserId()));
}
sysUserService.clearCache(); sysUserService.clearCache();
sysRoleService.clearCache(); sysRoleService.clearCache();
} }
@@ -63,105 +61,102 @@ public enum MemberChangeHandle {
RESIGN(UserChangeType.RESIGN.getCode()) { RESIGN(UserChangeType.RESIGN.getCode()) {
@Override @Override
public void change(MemberChangeRecord record) { public void change(MemberChangeRecord record) {
archive(record.getUserId(), UserChangeType.RESIGN); archive(record, UserChangeType.RESIGN);
UserMode.removeMemberRole(record.getUserId()); UserMode.removeMemberRole(record.getUserId());
updateWelfareMember(record); updateMemberAndWelfareMember(record);
updateMemberStatus(MemberStatus.TURN_OUT, record.getUserId()); // updateMemberStatus(MemberStatus.TURN_OUT, record.getUserId());
updateUserStateAndPersonType(record); updateUserStateAndPersonType(record);
} }
}, },
DIE(UserChangeType.DIE.getCode()) { DIE(UserChangeType.DIE.getCode()) {
@Override @Override
public void change(MemberChangeRecord record) { public void change(MemberChangeRecord record) {
archive(record.getUserId(), UserChangeType.DIE); archive(record, UserChangeType.DIE);
UserMode.removeMemberRole(record.getUserId()); UserMode.removeMemberRole(record.getUserId());
updateWelfareMember(record); updateMemberAndWelfareMember(record);
updateMemberStatus(MemberStatus.WITHDRAWAL, record.getUserId());
updateUserStateAndPersonType(record); updateUserStateAndPersonType(record);
} }
}, },
RETIREMENT(UserChangeType.RETIREMENT.getCode()) { RETIREMENT(UserChangeType.RETIREMENT.getCode()) {
@Override @Override
public void change(MemberChangeRecord record) { public void change(MemberChangeRecord record) {
archive(record.getUserId(), UserChangeType.RETIREMENT); archive(record, UserChangeType.RETIREMENT);
UserMode.removeMemberRole(record.getUserId()); UserMode.removeMemberRole(record.getUserId());
updateWelfareMember(record); updateMemberAndWelfareMember(record);
updateMemberStatus(MemberStatus.KEEP, record.getUserId());
updateUserStateAndPersonType(record); updateUserStateAndPersonType(record);
} }
}, },
// EXPELLED(UserChangeType.EXPELLED.getCode()) { /*EXPELLED(UserChangeType.EXPELLED.getCode()) {
// @Override @Override
// public void change(MemberChangeRecord record) { public void change(MemberChangeRecord record) {
// archive(record.getUserId(), UserChangeType.EXPELLED); archive(record, UserChangeType.EXPELLED);
// UserMode.removeMemberRole(record.getUserId()); UserMode.removeMemberRole(record.getUserId());
// updateWelfareMember(record); updateWelfareMember(record);
// updateMemberStatus(MemberStatus.EXPELLED, record.getUserId()); updateUserStateAndPersonType(record);
// updateUserStateAndPersonType(record); }
// } },*/
// },
RESTORE(UserChangeType.RESTORE.getCode()) { RESTORE(UserChangeType.RESTORE.getCode()) {
@Override @Override
public void change(MemberChangeRecord record) { public void change(MemberChangeRecord record) {
archive(record.getUserId(), UserChangeType.RESTORE); archive(record, UserChangeType.RESTORE);
UserMode.addMemberRole(record.getUserId()); UserMode.addMemberRole(record.getUserId());
updateMemberStatus(MemberStatus.RESTORE, record.getUserId()); updateMemberAndWelfareMember(record);
if (record.getUpdateWelfareMember()) {
sysUserService.update(Chain.make("welfareMember", WelfareMemberMode.NORMAL.getCode()), Cnd.where("id", "=", record.getUserId()));
}
} }
}, },
WITHDRAWAL(UserChangeType.WITHDRAWAL.getCode()) { WITHDRAWAL(UserChangeType.WITHDRAWAL.getCode()) {
@Override @Override
public void change(MemberChangeRecord record) { public void change(MemberChangeRecord record) {
archive(record.getUserId(), UserChangeType.WITHDRAWAL); archive(record, UserChangeType.WITHDRAWAL);
UserMode.removeMemberRole(record.getUserId()); UserMode.removeMemberRole(record.getUserId());
updateWelfareMember(record); updateMemberAndWelfareMember(record);
updateMemberStatus(MemberStatus.WITHDRAWAL, record.getUserId());
updateUserStateAndPersonType(record); updateUserStateAndPersonType(record);
} }
}, },
CARD_CHANGE(UserChangeType.CARD_CHANGE.getCode()){ CARD_CHANGE(UserChangeType.CARD_CHANGE.getCode()){
@Override @Override
public void change(MemberChangeRecord record) { public void change(MemberChangeRecord record) {
archive(record.getUserId(), UserChangeType.CARD_CHANGE); archive(record, UserChangeType.CARD_CHANGE);
if (Strings.isNotBlank(record.getIdCard())) { if (Strings.isNotBlank(record.getChangeIdCard())) {
sysUserService.update(Chain.make("idcard", record.getIdCard()), Cnd.where("id", "=", record.getUserId())); sysUserService.update(Chain.make("idcard", record.getChangeIdCard()), Cnd.where("id", "=", record.getUserId()));
} }
} }
}, },
MOBILE_CHANGE(UserChangeType.MOBILE_CHANGE.getCode()){ MOBILE_CHANGE(UserChangeType.MOBILE_CHANGE.getCode()){
@Override @Override
public void change(MemberChangeRecord record) { public void change(MemberChangeRecord record) {
archive(record.getUserId(), UserChangeType.MOBILE_CHANGE); archive(record, UserChangeType.MOBILE_CHANGE);
if (Strings.isNotBlank(record.getMobile())) { if (Strings.isNotBlank(record.getChangeMobile())) {
sysUserService.update(Chain.make("mobile", record.getMobile()), Cnd.where("id", "=", record.getUserId())); sysUserService.update(Chain.make("mobile", record.getChangeMobile()), Cnd.where("id", "=", record.getUserId()));
} }
} }
}, };
EDUCATION_CHANGE(UserChangeType.EDUCATION_CHANGE.getCode()){ /*EDUCATION_CHANGE(UserChangeType.EDUCATION_CHANGE.getCode()){
@Override @Override
public void change(MemberChangeRecord record) { public void change(MemberChangeRecord record) {
archive(record.getUserId(), UserChangeType.EDUCATION_CHANGE); archive(record, UserChangeType.EDUCATION_CHANGE);
if (Strings.isNotBlank(record.getEducation())) { if (Strings.isNotBlank(record.getEducation())) {
sysUserService.update(Chain.make("education", record.getEducation()), Cnd.where("id", "=", record.getUserId())); sysUserService.update(Chain.make("education", record.getEducation()), Cnd.where("id", "=", record.getUserId()));
} }
} }
}; };*/
/** /**
* 存档 * 存档
* *
* @param userId * @param record
* @param changeType * @param changeType
*/ */
private static void archive(String userId, UserChangeType changeType) { private static void archive(MemberChangeRecord record, UserChangeType changeType) {
// Sys_user user = sysUserService.fetch(userId); int count = sysUserService.dao().count(UserHistory.class, Cnd.where("memberChangeRecordId", "=", record.getId()));
// UserHistory history = new UserHistory(); if (count == 0) {
// BeanUtils.copyProperties(user,history); Sys_user user = sysUserService.fetch(record.getUserId());
// history.setChangeTime(new Date()); UserHistory history = new UserHistory();
// history.setChangeType(changeType.getCode()); BeanUtil.copyProperties(user, history);
// sysUserService.insert(history); history.setChangeTime(DateUtil.date());
history.setChangeType(changeType.getCode());
history.setChangeTypes(List.of(changeType.getCode()));
sysUserService.insert(history);
}
} }
@@ -170,14 +165,17 @@ public enum MemberChangeHandle {
* *
* @param record 变更记录 * @param record 变更记录
*/ */
public static void updateWelfareMember(MemberChangeRecord record) { public static void updateMemberAndWelfareMember(MemberChangeRecord record) {
//record.getUpdateWelfareMember() (true:增加福利会员 false:取消福利会员);针对入会(恢复) if (null != record.getUpdateWelfareMember()) {
if (null != record.getUpdateWelfareMember() && record.getUpdateWelfareMember()) { sysUserService.update(Chain.make("welfareMember", record.getUpdateWelfareMember() ? WelfareMemberMode.NORMAL.getCode() : WelfareMemberMode.NONE.getCode()), Cnd.where("id", "=", record.getUserId()));
sysUserService.update(Chain.make("welfareMember", WelfareMemberMode.NORMAL.getCode()), Cnd.where("id", "=", record.getUserId()));
} }
//record.getUpdateWelfare() (true:取消 false:不取消);针对(退休、离职、退会、去世) if (null != record.getUpdateMember()){
if (null != record.getUpdateWelfare() && record.getUpdateWelfare()){ sysUserService.update(Chain.make("member", record.getUpdateMember() ? MemberMode.NORMAL.getCode() : MemberMode.NONE.getCode()), Cnd.where("id", "=", record.getUserId()));
sysUserService.update(Chain.make("welfareMember", WelfareMemberMode.NONE.getCode()), Cnd.where("id", "=", record.getUserId())); }
if (null != record.getUpdateMember() && record.getUpdateMember()) {
UserMode.addMemberRole(record.getUserId());
} else {
UserMode.removeMemberRole(record.getUserId());
} }
} }
@@ -198,13 +196,12 @@ public enum MemberChangeHandle {
* @param record 变更记录 * @param record 变更记录
*/ */
public static void updateUserStateAndPersonType(MemberChangeRecord record){ public static void updateUserStateAndPersonType(MemberChangeRecord record){
Chain chain = null; Chain chain = Chain.make("eCard",null);
if (Strings.isNotBlank(record.getUserState()) && Strings.isNotBlank(record.getPersonType())){ if (Strings.isNotBlank(record.getChangeUserState())) {
chain = Chain.make("userState",record.getUserState()).add("personType",record.getPersonType()); chain.add("userState", record.getChangeUserState());
} else if (Strings.isNotBlank(record.getUserState()) && Strings.isBlank(record.getPersonType())){ }
chain = Chain.make("userState",record.getUserState()); if (Strings.isNotBlank(record.getChangePersonType())) {
} else if (Strings.isBlank(record.getUserState()) && Strings.isNotBlank(record.getPersonType())){ chain.add("personType", record.getChangePersonType());
chain = Chain.make("personType",record.getPersonType());
} }
sysUserService.update(chain,Cnd.where("id","=",record.getUserId())); sysUserService.update(chain,Cnd.where("id","=",record.getUserId()));
} }
@@ -7,7 +7,6 @@ import io.v.nutz.sys.models.User;
import io.v.nutz.sys.services.SysLocalProcessService; import io.v.nutz.sys.services.SysLocalProcessService;
import io.v.nutz.sys.services.impl.SysLocalProcessServiceImpl; import io.v.nutz.sys.services.impl.SysLocalProcessServiceImpl;
import io.v.nutz.web.commons.utils.ShiroUtil; import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.member.model.MemberApplyRecord;
import io.v.nutz.zhgh.member.model.MemberChangeRecord; import io.v.nutz.zhgh.member.model.MemberChangeRecord;
import io.v.nutz.zhgh.member.service.MemberService; import io.v.nutz.zhgh.member.service.MemberService;
import io.v.nutz.zhgh.member.service.impl.MemberServiceImpl; import io.v.nutz.zhgh.member.service.impl.MemberServiceImpl;
@@ -107,19 +106,19 @@ public enum MemberChangeToDoHandler {
CREATE_UNION_TASK() { CREATE_UNION_TASK() {
@Override @Override
public void exec(MemberChangeRecord record, NutMap extra) { public void exec(MemberChangeRecord record, NutMap extra) {
List<String> unionLeader = Vi.getUnionLeader(record.getUserId()); // List<String> unionLeader = Vi.getUnionLeader(record.getUserId());
localProcessService.createTask( // localProcessService.createTask(
"member_change_record@" + record.getId(), // "member_change_record@" + record.getId(),
"member_change_record_union_audit", // "member_change_record_union_audit",
"基层工会审核", // "基层工会审核",
ShiroUtil.getUserId(), // ShiroUtil.getUserId(),
unionLeader, // unionLeader,
"/platform/member/change/audit/union", // "/platform/member/change/audit/union",
"/platform/member/change/audit/union", // "/platform/member/change/audit/union",
"/platform/member/change/audit/union", // "/platform/member/change/audit/union",
"/platform/member/change/audit/union" // "/platform/member/change/audit/union"
); // );
localProcessService.updateProcessNodeName("member_change_record@" + record.getId(), "基层工会审核"); localProcessService.updateProcessNodeName("member_change_record@" + record.getId(), "基层工会审核");
@@ -150,32 +149,32 @@ public enum MemberChangeToDoHandler {
CREATE_SCHOOL_TASK() { CREATE_SCHOOL_TASK() {
@Override @Override
public void exec(MemberChangeRecord record, NutMap extra) { public void exec(MemberChangeRecord record, NutMap extra) {
Sql sql = Sqls.create(""" // Sql sql = Sqls.create("""
SELECT // SELECT
u.loginname // u.loginname
FROM // FROM
sys_user_role sur // sys_user_role sur
LEFT JOIN sys_user u ON u.id = sur.userid // LEFT JOIN sys_user u ON u.id = sur.userid
WHERE // WHERE
sur.roleId = @roleId // sur.roleId = @roleId
GROUP BY // GROUP BY
sur.userId // sur.userId
""").setParam("roleId", Roles.H03); // """).setParam("roleId", Roles.H03);
List<NutMap> list = (List<NutMap>) Daos.query(dao, sql.toString(), Sqls.callback.maps()); // List<NutMap> list = (List<NutMap>) Daos.query(dao, sql.toString(), Sqls.callback.maps());
List<String> schoolLeader = list.stream().map(v -> v.getString("loginname")).collect(Collectors.toList()); // List<String> schoolLeader = list.stream().map(v -> v.getString("loginname")).collect(Collectors.toList());
localProcessService.createTask( // localProcessService.createTask(
"member_change_record@" + record.getId(), // "member_change_record@" + record.getId(),
"member_change_record_school_audit", // "member_change_record_school_audit",
"校工会审核", // "校工会审核",
ShiroUtil.getUserId(), // ShiroUtil.getUserId(),
schoolLeader, // schoolLeader,
"/platform/member/change/audit/school", // "/platform/member/change/audit/school",
"/platform/member/change/audit/school", // "/platform/member/change/audit/school",
"/platform/member/change/audit/school", // "/platform/member/change/audit/school",
"/platform/member/change/audit/school" // "/platform/member/change/audit/school"
); // );
//
localProcessService.updateProcessNodeName("member_change_record@" + record.getId(), "校工会审核"); // localProcessService.updateProcessNodeName("member_change_record@" + record.getId(), "校工会审核");
} }
}, },
@@ -64,11 +64,6 @@ public class MemberApplyRecord {
@ColDefine(type = ColType.VARCHAR, width = 32) @ColDefine(type = ColType.VARCHAR, width = 32)
public String schoolAuditId; public String schoolAuditId;
@Column
@Comment("个人签字Id")
@ColDefine(type = ColType.VARCHAR, width = 32)
public String signId;
@One(field = "unionAuditId") @One(field = "unionAuditId")
public Audit unionAudit; public Audit unionAudit;
@@ -1,11 +1,11 @@
package io.v.nutz.zhgh.member.model; package io.v.nutz.zhgh.member.model;
import io.v.nutz.zhgh.member.constant.MemberChangeOrigin;
import io.v.nutz.zhgh.member.constant.MemberChangeRecordMode;
import io.v.nutz.base.model.Audit; import io.v.nutz.base.model.Audit;
import io.v.nutz.base.model.AuditState; import io.v.nutz.base.model.AuditState;
import io.v.nutz.sys.models.Sys_union; import io.v.nutz.sys.models.Sys_union;
import io.v.nutz.sys.models.Sys_unit; import io.v.nutz.sys.models.Sys_unit;
import io.v.nutz.zhgh.member.constant.MemberChangeOrigin;
import io.v.nutz.zhgh.member.constant.MemberChangeRecordMode;
import lombok.Data; import lombok.Data;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import org.nutz.dao.entity.annotation.*; import org.nutz.dao.entity.annotation.*;
@@ -124,40 +124,30 @@ public class MemberChangeRecord {
@ColDefine(type = ColType.BOOLEAN) @ColDefine(type = ColType.BOOLEAN)
private Boolean updateMember; private Boolean updateMember;
@Column
@Comment("福利会员身份(true:取消 false:不取消);针对(退休、离职、退会、去世)")
@ColDefine(type = ColType.BOOLEAN)
private Boolean updateWelfare;
@Column
@Comment("是否增加会员身份(true:增加 false:不增加)")
@ColDefine(type = ColType.BOOLEAN)
private Boolean insertMember;
@Column @Column
@Comment("身份证号异动") @Comment("身份证号异动")
@ColDefine(type = ColType.VARCHAR, width = 30) @ColDefine(type = ColType.VARCHAR, width = 30)
private String idCard; private String changeIdCard;
@Column @Column
@Comment("手机号异动") @Comment("手机号异动")
@ColDefine(type = ColType.VARCHAR, width = 30) @ColDefine(type = ColType.VARCHAR, width = 30)
private String mobile; private String changeMobile;
@Column @Column
@Comment("学历异动") @Comment("学历异动")
@ColDefine(type = ColType.VARCHAR, width = 30) @ColDefine(type = ColType.VARCHAR, width = 30)
private String education; private String changeEducation;
@Column @Column
@Comment("在职状态") @Comment("在职状态")
@ColDefine(type = ColType.VARCHAR, width = 10) @ColDefine(type = ColType.VARCHAR, width = 10)
private String userState; private String changeUserState;
@Column @Column
@Comment("人员类别") @Comment("人员类别")
@ColDefine(type = ColType.VARCHAR, width = 10) @ColDefine(type = ColType.VARCHAR, width = 10)
private String personType; private String changePersonType;
@Column @Column
@Comment("任务id") @Comment("任务id")
@@ -67,4 +67,9 @@ public class MemberCheckTask extends BaseModel {
@Comment("创建模式1.小组核对2.个人核对") @Comment("创建模式1.小组核对2.个人核对")
@ColDefine(type = ColType.INT) @ColDefine(type = ColType.INT)
private Integer createTaskMode; private Integer createTaskMode;
@Column
@Comment("核对模式(字典)")
@ColDefine(type = ColType.INT)
private Integer welfareCheckFilterMode;
} }
@@ -1,7 +1,7 @@
package io.v.nutz.zhgh.member.service; package io.v.nutz.zhgh.member.service;
import io.v.nutz.zhgh.member.model.MemberHistory;
import io.v.nutz.base.service.ViService; import io.v.nutz.base.service.ViService;
import io.v.nutz.zhgh.member.model.MemberHistory;
/** /**
* Todo * Todo
@@ -1,7 +1,7 @@
package io.v.nutz.zhgh.member.service.impl; package io.v.nutz.zhgh.member.service.impl;
import io.v.nutz.zhgh.member.service.MemberCheckPersonalService;
import io.v.nutz.base.service.impl.ViServiceImpl; import io.v.nutz.base.service.impl.ViServiceImpl;
import io.v.nutz.zhgh.member.service.MemberCheckPersonalService;
import org.nutz.dao.Dao; import org.nutz.dao.Dao;
import org.nutz.ioc.loader.annotation.IocBean; import org.nutz.ioc.loader.annotation.IocBean;
@@ -1,11 +1,11 @@
package io.v.nutz.zhgh.member.service.impl; package io.v.nutz.zhgh.member.service.impl;
import io.v.nutz.base.service.AsyncService; import io.v.nutz.base.service.AsyncService;
import io.v.nutz.zhgh.member.model.MemberHistory;
import io.v.nutz.zhgh.member.service.MemberHistoryService;
import io.v.nutz.base.service.impl.ViServiceImpl; import io.v.nutz.base.service.impl.ViServiceImpl;
import io.v.nutz.sys.services.SysRoleService; import io.v.nutz.sys.services.SysRoleService;
import io.v.nutz.sys.services.SysUserService; import io.v.nutz.sys.services.SysUserService;
import io.v.nutz.zhgh.member.model.MemberHistory;
import io.v.nutz.zhgh.member.service.MemberHistoryService;
import org.nutz.aop.interceptor.ioc.TransAop; import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.dao.Dao; import org.nutz.dao.Dao;
import org.nutz.dao.Sqls; import org.nutz.dao.Sqls;
@@ -3,9 +3,9 @@ package io.v.nutz.zhgh.member.service.impl;
import cn.wizzer.framework.page.Pagination; import cn.wizzer.framework.page.Pagination;
import io.v.nutz.base.dao.CndPlus; import io.v.nutz.base.dao.CndPlus;
import io.v.nutz.base.query.PageForm; import io.v.nutz.base.query.PageForm;
import io.v.nutz.zhgh.member.service.MemberService;
import io.v.nutz.base.service.impl.ViServiceImpl; import io.v.nutz.base.service.impl.ViServiceImpl;
import io.v.nutz.sys.models.Sys_user; import io.v.nutz.sys.models.Sys_user;
import io.v.nutz.zhgh.member.service.MemberService;
import org.nutz.dao.Cnd; import org.nutz.dao.Cnd;
import org.nutz.dao.Dao; import org.nutz.dao.Dao;
import org.nutz.dao.Sqls; import org.nutz.dao.Sqls;
@@ -1,12 +1,12 @@
package io.v.nutz.zhgh.member.utils; package io.v.nutz.zhgh.member.utils;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.sys.models.Sys_user;
import io.v.nutz.zhgh.activity.models.ActivityUserCnd; import io.v.nutz.zhgh.activity.models.ActivityUserCnd;
import io.v.nutz.zhgh.data.constant.UserChangeType; import io.v.nutz.zhgh.data.constant.UserChangeType;
import io.v.nutz.zhgh.member.MemberMode; import io.v.nutz.zhgh.member.MemberMode;
import io.v.nutz.zhgh.member.constant.MemberStatus; import io.v.nutz.zhgh.member.constant.MemberStatus;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.sys.models.Sys_user;
import org.apache.commons.lang.ArrayUtils; import org.apache.commons.lang.ArrayUtils;
import org.nutz.dao.Cnd; import org.nutz.dao.Cnd;
import org.nutz.dao.Sqls; import org.nutz.dao.Sqls;
@@ -39,10 +39,6 @@ public class MemberUtils {
member = MemberMode.NONE.getCode(); member = MemberMode.NONE.getCode();
memberStatus = MemberStatus.TURN_OUT.getCode(); memberStatus = MemberStatus.TURN_OUT.getCode();
} }
if (type == UserChangeType.DIE.getCode()) {
member = MemberMode.NONE.getCode();
memberStatus = MemberStatus.WITHDRAWAL.getCode();
}
if (type == UserChangeType.RETIREMENT.getCode()) { if (type == UserChangeType.RETIREMENT.getCode()) {
member = MemberMode.NONE.getCode(); member = MemberMode.NONE.getCode();
memberStatus = MemberStatus.KEEP.getCode(); memberStatus = MemberStatus.KEEP.getCode();
@@ -71,6 +67,7 @@ public class MemberUtils {
String[] unitId, String[] unitId,
String[] personTypes, String[] personTypes,
String[] userStates, String[] userStates,
String[] preparedBys,
String[] memberTypes, String[] memberTypes,
String[] sexTypes, String[] sexTypes,
String[] age, String[] age,
@@ -168,6 +165,7 @@ public class MemberUtils {
cnd.andEX("u.campus", EQ_OR_NEQ_OP, campus); cnd.andEX("u.campus", EQ_OR_NEQ_OP, campus);
cnd.andEX("u.personType", IN_OR_NIN_OP, personTypes); cnd.andEX("u.personType", IN_OR_NIN_OP, personTypes);
cnd.andEX("u.userState", IN_OR_NIN_OP, userStates); cnd.andEX("u.userState", IN_OR_NIN_OP, userStates);
cnd.andEX("u.preparedBy", IN_OR_NIN_OP, preparedBys);
cnd.andEX("u.sex", IN_OR_NIN_OP, sexTypes); cnd.andEX("u.sex", IN_OR_NIN_OP, sexTypes);
cnd.andEX("sur.jdhid", EQ_OR_NEQ_OP, teacherMeetingId); cnd.andEX("sur.jdhid", EQ_OR_NEQ_OP, teacherMeetingId);
cnd.andEX("sur.roleid", IN_OR_NIN_OP, roleIds); cnd.andEX("sur.roleid", IN_OR_NIN_OP, roleIds);
@@ -20,6 +20,7 @@ import org.nutz.dao.FieldFilter;
import org.nutz.dao.Sqls; import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql; import org.nutz.dao.sql.Sql;
import org.nutz.dao.util.Daos; import org.nutz.dao.util.Daos;
import org.nutz.dao.util.cri.SqlExpressionGroup;
import org.nutz.dao.util.cri.Static; import org.nutz.dao.util.cri.Static;
import org.nutz.ioc.loader.annotation.Inject; import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean; import org.nutz.ioc.loader.annotation.IocBean;
@@ -300,8 +301,6 @@ public class UnionActivityRegisterController {
@ViReturn @ViReturn
@RequiresAuthentication @RequiresAuthentication
public Object searchNoRegisterUser(String searchKey, String activityId) { public Object searchNoRegisterUser(String searchKey, String activityId) {
ActivityTissue tissue = simpleService.dao().fetch(ActivityTissue.class, Cnd.where("id", "=", activityId)); ActivityTissue tissue = simpleService.dao().fetch(ActivityTissue.class, Cnd.where("id", "=", activityId));
Sql sql = Sqls.create(""" Sql sql = Sqls.create("""
@@ -317,10 +316,16 @@ public class UnionActivityRegisterController {
"""); """);
String unionId = Vi.getUnionId(); String unionId = Vi.getUnionId();
Cnd cnd = Cnd.NEW(); Cnd cnd = Cnd.NEW();
if (tissue.getSignUpMethod() != 3) { if (tissue.getSignUpMethod() != 3 && tissue.getType() != 40003) {
cnd.andEX("unionId", "=", unionId); cnd.andEX("unionId", "=", unionId);
} }
cnd.and(Cnd.exps(Cnd.likeEX("username", searchKey.trim())).or(Cnd.likeEX("loginname", searchKey.trim()))); if (StrUtil.isNotBlank(searchKey)){
SqlExpressionGroup seg = new SqlExpressionGroup();
seg.or("username", "LIKE", "%" + searchKey + "%");
seg.or("loginname", "LIKE", "%" + searchKey + "%");
cnd.and(seg);
}
// cnd.and(Cnd.exps(Cnd.likeEX("username", searchKey.trim())).or(Cnd.likeEX("loginname", searchKey.trim())));
if (tissue.getGroupId() != null) { if (tissue.getGroupId() != null) {
cnd.and(new Static(""" cnd.and(new Static("""
id IN ( SELECT userid FROM activity_user_scope WHERE groupId IN ( SELECT groupId FROM activity_tissue WHERE id = '%s' AND groupId IS NOT NULL ) ) id IN ( SELECT userid FROM activity_user_scope WHERE groupId IN ( SELECT groupId FROM activity_tissue WHERE id = '%s' AND groupId IS NOT NULL ) )
@@ -53,7 +53,7 @@ public class CondolenceAgentController {
List<NutMap> result = new ArrayList<>(); List<NutMap> result = new ArrayList<>();
result.add(new NutMap().setv("title", title).setv("url", UCR).setv("iconClass", vi.getIconByPath(UCR)).setv("label", "待分工会审核").setv("number", getUcrCount())); result.add(new NutMap().setv("title", title).setv("url", UCR).setv("iconClass", vi.getIconByPath(UCR)).setv("label", "待院级工会审核").setv("number", getUcrCount()));
result.add(new NutMap().setv("title", title).setv("url", FR).setv("iconClass", vi.getIconByPath(FR)).setv("label", "待二级党组织审核").setv("number", getFrCount())); result.add(new NutMap().setv("title", title).setv("url", FR).setv("iconClass", vi.getIconByPath(FR)).setv("label", "待二级党组织审核").setv("number", getFrCount()));
result.add(new NutMap().setv("title", title).setv("url", VCR).setv("iconClass", vi.getIconByPath(VCR)).setv("label", "待校工会审核").setv("number", getVcrCount())); result.add(new NutMap().setv("title", title).setv("url", VCR).setv("iconClass", vi.getIconByPath(VCR)).setv("label", "待校工会审核").setv("number", getVcrCount()));
result.add(new NutMap().setv("title", title).setv("url", ECR).setv("iconClass", vi.getIconByPath(ECR)).setv("label", "待工会常务副主席审核").setv("number", getEcrCount())); result.add(new NutMap().setv("title", title).setv("url", ECR).setv("iconClass", vi.getIconByPath(ECR)).setv("label", "待工会常务副主席审核").setv("number", getEcrCount()));
@@ -75,7 +75,7 @@ public class CondolenceAgentController {
"""); """);
cnd.and("con.state_id", "=", 2000); cnd.and("con.state_id", "=", 2000);
if (!ShiroUtil.hasAnyRoles("sysadmin")) { if (!ShiroUtil.hasAnyRoles("sysadmin")) {
cnd.and("us.unionid", "=", vi.getUnionId()); cnd.and("us.unionid", "=", Vi.getUnionId());
} }
sql.setCondition(cnd); sql.setCondition(cnd);
return condolenceService.count(sql); return condolenceService.count(sql);
@@ -29,6 +29,7 @@ import org.nutz.mvc.annotation.Param;
* @DateTime: 2020/11/20 11:49 * @DateTime: 2020/11/20 11:49
* @Description: 会计审核 * @Description: 会计审核
*/ */
// 江南大学,校工会审核
@At("/platform/fw/condolence/fr") @At("/platform/fw/condolence/fr")
@IocBean @IocBean
@RequiresAuthentication @RequiresAuthentication
@@ -44,6 +45,11 @@ public class CondolenceFrCon {
public void index() { public void index() {
} }
@At("/h5")
@Ok("beetl:/mobile/condolence/schoolunionaudit/index.html")
@RequiresPermissions("fw.condolence.fr")
public void h5() {
}
@At @At
@ViReturn @ViReturn
@@ -66,6 +72,7 @@ public class CondolenceFrCon {
be.username be_username, be.username be_username,
be.loginname be_loginname, be.loginname be_loginname,
sqr.username sqr_username, sqr.username sqr_username,
sqr.loginname sqr_loginname,
be.unitname be_unitname, be.unitname be_unitname,
be.unionname be_unionname, be.unionname be_unionname,
state.state_name, state.state_name,
@@ -16,8 +16,8 @@ import io.v.nutz.base.utils.ViTool;
import io.v.nutz.sys.models.Sys_signature; import io.v.nutz.sys.models.Sys_signature;
import io.v.nutz.web.commons.base.Globals; import io.v.nutz.web.commons.base.Globals;
import io.v.nutz.web.commons.utils.ShiroUtil; import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.zgfw.model.condolence.CondolenceType;
import io.v.nutz.zhgh.zgfw.model.condolence.Condolence; import io.v.nutz.zhgh.zgfw.model.condolence.Condolence;
import io.v.nutz.zhgh.zgfw.model.condolence.CondolenceType;
import io.v.nutz.zhgh.zgfw.service.CondolenceService; import io.v.nutz.zhgh.zgfw.service.CondolenceService;
import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.Workbook;
import org.apache.shiro.authz.annotation.RequiresAuthentication; import org.apache.shiro.authz.annotation.RequiresAuthentication;
@@ -111,7 +111,7 @@ public class CondolenceReadCon {
if (!ShiroUtil.hasAnyRoles("sysadmin,A06,wyh02")) { if (!ShiroUtil.hasAnyRoles("sysadmin,A06,wyh02")) {
SqlExpressionGroup group2 = new SqlExpressionGroup(); SqlExpressionGroup group2 = new SqlExpressionGroup();
if (ShiroUtil.hasAnyRoles("gh01,H04")) { if (ShiroUtil.hasAnyRoles("gh01,H04")) {
group2.or("be.unionid", "=", vi.getUnionId()); group2.or("be.unionid", "=", Vi.getUnionId());
/*group2.or("con.state_id", ">=", 2000);*/ /*group2.or("con.state_id", ">=", 2000);*/
} }
/* if (ShiroUtil.hasAnyRoles("SchoolUnionAccountant")) { /* if (ShiroUtil.hasAnyRoles("SchoolUnionAccountant")) {
@@ -53,6 +53,12 @@ public class CondolenceUcrCon {
public void index() { public void index() {
} }
@At("/h5")
@Ok("beetl:/mobile/condolence/branchunionaudit/index.html")
@RequiresPermissions("fw.condolence.ucr")
public void h5() {
}
@At @At
@ViReturn @ViReturn
@RequiresPermissions("fw.condolence.ucr") @RequiresPermissions("fw.condolence.ucr")
@@ -74,6 +80,7 @@ public class CondolenceUcrCon {
be.username be_username, be.username be_username,
be.loginname be_loginname, be.loginname be_loginname,
sqr.username sqr_username, sqr.username sqr_username,
sqr.loginname sqr_loginname,
be.unitname be_unitname, be.unitname be_unitname,
be.unionname be_unionname, be.unionname be_unionname,
state.state_name, state.state_name,
@@ -5,9 +5,12 @@ import io.v.nutz.base.model.Review;
import io.v.nutz.base.service.ReviewService; import io.v.nutz.base.service.ReviewService;
import io.v.nutz.base.utils.DateUtil; import io.v.nutz.base.utils.DateUtil;
import io.v.nutz.base.utils.Vi; import io.v.nutz.base.utils.Vi;
import io.v.nutz.sys.models.Sys_user;
import io.v.nutz.sys.services.SysMsgService;
import io.v.nutz.web.commons.utils.ShiroUtil; import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.zgfw.handler.condolence.CondolenceToDoHandler; import io.v.nutz.zhgh.zgfw.handler.condolence.CondolenceToDoHandler;
import io.v.nutz.zhgh.zgfw.model.condolence.Condolence; import io.v.nutz.zhgh.zgfw.model.condolence.Condolence;
import io.v.nutz.zhgh.zgfw.model.condolence.CondolenceType;
import io.v.nutz.zhgh.zgfw.service.CondolenceService; import io.v.nutz.zhgh.zgfw.service.CondolenceService;
import org.apache.shiro.authz.annotation.RequiresAuthentication; import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
@@ -22,12 +25,15 @@ import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok; import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param; import org.nutz.mvc.annotation.Param;
import java.util.List;
/** /**
* @Author: 1V * @Author: 1V
* @DateTime: 2020/11/20 11:49 * @DateTime: 2020/11/20 11:49
* @Description: 校工会审核 * @Description: 校工会审核
*/ */
@At({"/platform/fw/condolence/vcr","/platform/fw/condolence/vcr/school"}) // 江南大学,校工会主席审核
@At({"/platform/fw/condolence/vcr", "/platform/fw/condolence/vcr/school"})
@IocBean @IocBean
@RequiresAuthentication @RequiresAuthentication
@Ok("json") @Ok("json")
@@ -36,27 +42,36 @@ public class CondolenceVcrCon {
@Inject @Inject
private Vi vi; private Vi vi;
@Inject
private SysMsgService sysMsgService;
@At("") @At("")
@Ok("beetl:/platform/zgfw/condolence/vcr.html") @Ok("beetl:/platform/zgfw/condolence/vcr.html")
@RequiresPermissions("fw.condolence.vcr") @RequiresPermissions("fw.condolence.vcr")
public void index() { public void index() {
} }
@At("/h5")
@Ok("beetl:/mobile/condolence/schoolchairmanaudit/index.html")
@RequiresPermissions("fw.condolence.vcr")
public void h5() {
}
@At @At
@ViReturn @ViReturn
@RequiresPermissions("fw.condolence.vcr") @RequiresPermissions("fw.condolence.vcr")
public Object pageData(@Param(value = "year",required = false) String year, public Object pageData(@Param(value = "year", required = false) String year,
@Param(value = "unitId",required = false) String unitId, @Param(value = "unitId", required = false) String unitId,
@Param(value = "unionId",required = false) String unionId, @Param(value = "unionId", required = false) String unionId,
@Param(value = "isAudit",required = false) Boolean isAudit, @Param(value = "isAudit", required = false) Boolean isAudit,
@Param(value = "type",required = false) String type, @Param(value = "type", required = false) String type,
@Param(value = "way",required = false) String way, @Param(value = "way", required = false) String way,
@Param(value = "searchName",required = false) String searchName, @Param(value = "searchName", required = false) String searchName,
@Param(value = "searchKeyword",required = false) String searchKeyword, @Param(value = "searchKeyword", required = false) String searchKeyword,
@Param("pageNumber") int pageNumber,@Param("pageSize") int pageSize, @Param("pageNumber") int pageNumber, @Param("pageSize") int pageSize,
@Param(value = "pageOrderName",required = false) String pageOrderName, @Param(value = "pageOrderName", required = false) String pageOrderName,
@Param(value = "pageOrderBy",required = false) String pageOrderBy) { @Param(value = "pageOrderBy", required = false) String pageOrderBy) {
Sql sql = Sqls.create(""" Sql sql = Sqls.create("""
SELECT SELECT
con.*, con.*,
@@ -64,6 +79,7 @@ public class CondolenceVcrCon {
be.username be_username, be.username be_username,
be.loginname be_loginname, be.loginname be_loginname,
sqr.username sqr_username, sqr.username sqr_username,
sqr.loginname sqr_loginname,
be.unitname be_unitname, be.unitname be_unitname,
be.unionname be_unionname, be.unionname be_unionname,
state.state_name, state.state_name,
@@ -130,12 +146,26 @@ public class CondolenceVcrCon {
} }
condolenceService.updateIgnoreNull(condolence); condolenceService.updateIgnoreNull(condolence);
CondolenceToDoHandler.COMPLETE_SCHOOL_TASK.exec(condolence, review.getOpinion()); CondolenceToDoHandler.COMPLETE_SCHOOL_TASK.exec(condolence, review.getOpinion());
if (pass == 1){ if (pass == 1) {
CondolenceToDoHandler.COMPLETE_PROCESS.exec(condolence, review.getOpinion()); CondolenceToDoHandler.COMPLETE_PROCESS.exec(condolence, review.getOpinion());
} else if (pass == 2){ } else if (pass == 2) {
CondolenceToDoHandler.CREATE_BACK_SCHOOL_TASK.exec(condolence, review.getOpinion()); CondolenceToDoHandler.CREATE_BACK_SCHOOL_TASK.exec(condolence, review.getOpinion());
} }
CondolenceToDoHandler.COMPLETE_PROCESS.exec(condolence,null); CondolenceToDoHandler.COMPLETE_PROCESS.exec(condolence, null);
if (condolence.getState_id().equals("2040") || condolence.getState_id().equals("2050")) {
List<String> unionLeaders = condolenceService.getUnionLeader(condolence.getManager());
Sys_user beUser = condolenceService.dao().fetch(Sys_user.class, condolence.getBe_user());
CondolenceType condolenceType = condolenceService.dao().fetch(CondolenceType.class, condolence.getType());
String note = """
<p style="text-indent: 2em;">您的申报已审批通过,请参照以下提示跟进:</p><p style="text-indent: 2em;">1.慰问事项为生病住院、去世、直系亲属去世,慰问金线上申报审批完成后,不需要再提交纸质材料。</p><p style="text-indent: 2em;">2.慰问事项为结婚和生育的,审核通过后请将报销材料尽快提交至校工会(行政楼A426办公室)周学军老师处。注意:报销发票上须有分工会主席和经办人的签字;购买慰问品须有公务卡支付记录,如未使用公务卡,请提交支付记录和公务卡结算审批表(所在单位审核签字)。 </p><p style="text-indent: 2em;">3.各类慰问金每月结算一次。当月审核通过且报销材料提交齐全的,校工会将于次月第一周统一办理慰问金(慰问品报销)上卡,材料不齐全的推迟上卡。</p>
""";
for (String unionLeader : unionLeaders) {
sysMsgService.sendMsg(unionLeader,"【职工慰问】-" + beUser.getUsername(),note,ShiroUtil.getUserId());
}
}
return null; return null;
} }
@@ -1,126 +0,0 @@
package io.v.nutz.zhgh.zgfw.controller.difficult;
import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.zgfw.service.ZgfwKnbfService;
import org.nutz.dao.Cnd;
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.util.NutMap;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import java.util.ArrayList;
import java.util.List;
/**
* @author zhf
* @date 2021/3/22 9:41
* @description 困难帮扶代办事项
*/
@IocBean
@Ok("json:full")
@At("/platform/difficult/agent")
public class DifficultAgentController {
@Inject
private Vi vi;
@Inject
private ZgfwKnbfService zgfwKnbfService;
private static final String UNIONCHAIRMAN = "/platform/fw/difficulty/unionchairman";
private static final String SCHOOLMANAGER = "/platform/fw/difficulty/schoolmanager";
private static final String SCHOOLVICECHAIRMAN = "/platform/fw/difficulty/schoolvicechairman";
private static final String SCHOOLSTANDING = "/platform/fw/difficulty/schoolstanding";
@At
@ViReturn
public Object getAgenda() {
final String title = "【困难帮扶】";
List<NutMap> result = new ArrayList<>();
if (ShiroUtil.hasAnyRoles("sysadmin")) {
result.add(new NutMap().setv("title", title).setv("url", UNIONCHAIRMAN).setv("iconClass", vi.getIconByPath(UNIONCHAIRMAN)).setv("label", "待分工会审核").setv("number", getUnionChairmanCount()));
result.add(new NutMap().setv("title", title).setv("url", SCHOOLMANAGER).setv("iconClass", vi.getIconByPath(SCHOOLMANAGER)).setv("label", "待校工会审核").setv("number", getSchoolManagerCount()));
//暂时没用到
result.add(new NutMap().setv("title", title).setv("url", SCHOOLVICECHAIRMAN).setv("iconClass", vi.getIconByPath(SCHOOLVICECHAIRMAN)).setv("label", "待校工会副主席审核").setv("number", getSchoolviceChairmanCount()));
//暂时没用到
result.add(new NutMap().setv("title", title).setv("url", SCHOOLSTANDING).setv("iconClass", vi.getIconByPath(SCHOOLSTANDING)).setv("label", "待校工会常务副主席审核").setv("number", getSchoolStandingCount()));
} else {
if (ShiroUtil.hasAnyRoles("H04,gh01")) {
result.add(new NutMap().setv("title", title).setv("url", UNIONCHAIRMAN).setv("iconClass", vi.getIconByPath(UNIONCHAIRMAN)).setv("label", "待分工会审核").setv("number", getUnionChairmanCount()));
}
if (ShiroUtil.hasAnyRoles("A06,wyh02")) {
result.add(new NutMap().setv("title", title).setv("url", SCHOOLMANAGER).setv("iconClass", vi.getIconByPath(SCHOOLMANAGER)).setv("label", "待校工会审核").setv("number", getSchoolManagerCount()));
}//暂时没用到
if (ShiroUtil.hasRole("wyh01")) {
result.add(new NutMap().setv("title", title).setv("url", SCHOOLVICECHAIRMAN).setv("iconClass", vi.getIconByPath(SCHOOLVICECHAIRMAN)).setv("label", "待校工会副主席审核").setv("number", getSchoolviceChairmanCount()));
}//暂时没用到
if (ShiroUtil.hasRole("wyh02")) {
result.add(new NutMap().setv("title", title).setv("url", SCHOOLSTANDING).setv("iconClass", vi.getIconByPath(SCHOOLSTANDING)).setv("label", "待校工会常务副主席审核").setv("number", getSchoolStandingCount()));
}
}
return result;
}
/**
* 待工会主席审核
*
* @return
*/
private Integer getUnionChairmanCount() {
Cnd cnd = Cnd.NEW();
Sql sql = Sqls.create("""
SELECT COUNT(1) FROM zgfw_knbf bf LEFT JOIN `user` us ON bf.sqr=us.id $condition
""");
cnd.and("bf.zt", "=", 100);
if (!ShiroUtil.hasAnyRoles("sysadmin")) {
cnd.and("us.unionid", "=", vi.getUnionId());
}
sql.setCondition(cnd);
return zgfwKnbfService.count(sql);
}
/**
* 待校工会审核
*
* @return
*/
private Integer getSchoolManagerCount() {
return zgfwKnbfService.count(Cnd.where("zt", "=", 200));
}
/**
* 待校工会副主席审核
*
* @return
*/
private Integer getSchoolviceChairmanCount() {
return zgfwKnbfService.count(Cnd.where("zt", "=", 300));
}
/**
* 待校工会常务副主席审核
*
* @return
*/
private Integer getSchoolStandingCount() {
return zgfwKnbfService.count(Cnd.where("zt", "=", 400));
}
}
@@ -0,0 +1,153 @@
package io.v.nutz.zhgh.zgfw.controller.difficult;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import cn.wizzer.framework.base.Result;
import cn.wizzer.framework.page.Pagination;
import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.model.Audit;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.service.AuditService;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.sys.services.SysLocalProcessService;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.zgfw.handler.difficult.DifficultToDoHandler;
import io.v.nutz.zhgh.zgfw.model.difficult.Zgfw_knbf;
import io.v.nutz.zhgh.zgfw.service.ZgfwKnbfService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.dao.Chain;
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.aop.Aop;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
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.Map;
@At("/platform/difficulty/branchUnionAudit")
@Ok("json:full")
@IocBean
public class DifficultBranchUnionAuditController {
@Inject
private ZgfwKnbfService zgfwKnbfService;
@Inject
private AuditService auditService;
@Inject
private Vi vi;
@Inject
private Dao dao;
@Inject
private SysLocalProcessService sysLocalProcessService;
@At("")
@Ok("beetl:/platform/zgfw/difficulty/branchUnionAudit.html")
@RequiresPermissions("difficulty.branchUnionAudit")
public void index() {
}
@At("/h5")
@Ok("beetl:/mobile/difficulty/branchunionaudit/index.html")
@RequiresPermissions("difficulty.branchUnionAudit")
public void h5() {
}
@At
@ViReturn
@RequiresPermissions("difficulty.branchUnionAudit")
public Object pageData(@Param(value = "isAudit", required = false) Boolean isAudit,
@Param(value = "year", required = false) Integer year,
@Param(value = "unitId", required = false) String unitId,
@Param(value = "unionId", required = false) String unionId, PageForm page) {
Cnd cnd = Cnd.NEW();
Sql sql = Sqls.create("""
SELECT
info.*,
s.state_name
FROM
`zgfw_knbf` info
LEFT JOIN state s ON s.state_id = info.stateId
$condition
""");
cnd.and("info.stateId", isAudit ? ">" : "=", 3000);
if (!ShiroUtil.hasAnyRoles("sysadmin")) {
cnd.and("info.unionId", "=", Vi.getUnionId());
}
cnd.andEX("YEAR(info.applyTime)", "=", year);
cnd.andEX("info.unitId", "=", unitId);
cnd.andEX("info.unionId", "=", unionId);
if (StrUtil.isNotBlank(page.getSearchKeyword())) {
SqlExpressionGroup seg = new SqlExpressionGroup();
seg.orLike("info.userName", page.getSearchKeyword());
seg.orLike("info.loginName", page.getSearchKeyword());
cnd.and(seg);
}
sql.setCondition(cnd);
Pagination pagination = zgfwKnbfService.listPageMap(page.getPageNumber(), page.getPageSize(), sql);
return Result.success(pagination);
}
@At
@ViReturn
@RequiresPermissions("difficulty.branchUnionAudit")
@Aop(TransAop.READ_COMMITTED)
public Result doEdit(String id) {
dao.update(Zgfw_knbf.class, Chain.make("stateId", 3000)
.add("branchUnionAuditId", null),
Cnd.where("id", "=", id));
//待办撤回
sysLocalProcessService.revokeTask("zgfw_knbf@" + id, "分工会审核");
return Result.success();
}
@At
@ViReturn
@RequiresPermissions("difficulty.branchUnionAudit")
@Aop(TransAop.READ_COMMITTED)
public Object doReview(String id, Integer pass, double money, Audit audit) {
audit.setAuditor(ShiroUtil.getPrincipalProperty("id").toString());
audit.setLoginname(ShiroUtil.getPrincipalProperty("loginname").toString());
audit.setUsername(ShiroUtil.getPrincipalProperty("username").toString());
audit.setAuditTime(new Date());
audit.setExt(JSONUtil.parseObj(Map.of("money", money)));
audit = dao.insert(audit);
Zgfw_knbf zgfw_knbf = zgfwKnbfService.fetch(id);
if (pass == 1) {
//不通过
zgfw_knbf.setStateId(3010);
} else if (pass == 2) {
//退回
zgfw_knbf.setStateId(3020);
} else {
//通过
zgfw_knbf.setStateId(3030);
}
zgfw_knbf.setBranchUnionAuditId(audit.getId());
zgfwKnbfService.updateIgnoreNull(zgfw_knbf);
if (pass == 2) {
DifficultToDoHandler.CREATE_APPLY_RE_MODIFY_TASK.exec(zgfw_knbf);
} else if (pass == 3) {
DifficultToDoHandler.CREATE_FINANCE_TASK.exec(zgfw_knbf);
}
DifficultToDoHandler.COMPLETE_UNION_TASK.exec(zgfw_knbf);
return null;
}
}
@@ -0,0 +1,33 @@
package io.v.nutz.zhgh.zgfw.controller.difficult;
import cn.wizzer.framework.base.Result;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.zgfw.model.difficult.Zgfw_knbf;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.dao.Dao;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
@IocBean
@At("/platform/difficulty/common")
@Ok("json:full")
public class DifficultCommonController {
@Inject
private Dao dao;
@At
@RequiresPermissions("difficulty")
public Result findOne(String id) {
Zgfw_knbf knbf = dao.fetch(Zgfw_knbf.class, id);
dao.fetchLinks(knbf, null);
if(!ShiroUtil.hasRole("sysadmin")){
boolean isSelf = knbf.getUserId().equals(ShiroUtil.getUserId());
knbf.setSelf(isSelf);
}
return Result.success(knbf);
}
}
@@ -0,0 +1,474 @@
package io.v.nutz.zhgh.zgfw.controller.difficult;
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.hutool.core.bean.BeanUtil;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.wizzer.framework.base.Result;
import cn.wizzer.framework.page.Pagination;
import com.deepoove.poi.XWPFTemplate;
import com.deepoove.poi.config.Configure;
import com.deepoove.poi.data.PictureRenderData;
import com.deepoove.poi.data.PictureType;
import com.deepoove.poi.policy.HackLoopTableRenderPolicy;
import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.model.Audit;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.service.BaseService;
import io.v.nutz.base.utils.OfficeTemplateUtil;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.base.utils.ViTool;
import io.v.nutz.sys.models.Sys_signature;
import io.v.nutz.sys.services.SysUnionService;
import io.v.nutz.sys.services.SysUserService;
import io.v.nutz.web.commons.base.Globals;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.zgfw.model.difficult.Zgfw_knbf;
import io.v.nutz.zhgh.zgfw.service.ZgfwKnbfJtcyService;
import io.v.nutz.zhgh.zgfw.service.ZgfwKnbfService;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.boot.starter.ftp.FtpService;
import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
import org.nutz.dao.Sqls;
import org.nutz.dao.entity.Record;
import org.nutz.dao.sql.Sql;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.Strings;
import org.nutz.lang.util.NutMap;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.*;
@IocBean
@Ok("json")
@At("/platform/difficulty/reading")
public class DifficultReadingController {
@Inject
private Dao dao;
@Inject
private ZgfwKnbfService zgfwKnbfService;
@Inject
private FtpService ftpService;
@Inject
private SysUserService sysUserService;
@Inject
private SysUnionService sysUnionService;
@Inject
private BaseService baseService;
@Inject
private Vi vi;
@Inject
private OfficeTemplateUtil officeTemplateUtil;
@At("")
@Ok("beetl:/platform/zgfw/difficulty/reading.html")
@RequiresPermissions("difficulty.reading")
public void index() {
}
@At()
@ViReturn
@RequiresPermissions("difficulty.reading")
public Object pageData(@Param(value = "dateRange", required = false) String[] dateRange,
@Param(value = "year", required = false) Integer year,
@Param(value = "unitId", required = false) String unitId,
@Param(value = "unionId", required = false) String unionId,
PageForm page) {
Cnd cnd = Cnd.NEW();
Sql sql = Sqls.create("""
SELECT
info.*,
s.state_name
FROM
`zgfw_knbf` info
LEFT JOIN state s ON s.state_id = info.stateId
$condition
""");
if (!ShiroUtil.hasAnyRoles("sysadmin")) {
cnd.and("info.unionId", "=", Vi.getUnionId());
}
// cnd.andEX("YEAR(info.applyTime)", "=", year);
cnd.andEX("info.unitId", "=", unitId);
cnd.andEX("info.unionId", "=", unionId);
if (StrUtil.isAllNotBlank(page.getSearchName(), page.getSearchKeyword())) {
cnd.and(Cnd.likeEX(page.getSearchName(), page.getSearchKeyword()));
}
if (dateRange != null && dateRange.length == 2) {
cnd.and("info.applyTime", ">=", dateRange[0]);
cnd.and("info.applyTime", "<=", dateRange[1]);
}
sql.setCondition(cnd);
Pagination pagination = zgfwKnbfService.listPageMap(page.getPageNumber(), page.getPageSize(), sql);
return Result.success(pagination);
}
@At
@ViReturn
@RequiresPermissions("difficulty.reading")
public Object findOne(String id) {
return zgfwKnbfService.findOne(id);
}
/**
* 导出报销表
*
* @param id
* @param response
* @throws Exception
*/
@At
@Ok("void")
@ViReturn
@RequiresPermissions("difficulty.reading")
public void doExport(@Param("id") String id, HttpServletResponse response) throws Exception {
Zgfw_knbf knbf = dao.fetch(Zgfw_knbf.class, id);
dao.fetchLinks(knbf, null);
Map<String, Object> renderData = BeanUtil.beanToMap(knbf);
renderData.put("knbf", "☑");
renderData.put("applyDateTime", DateUtil.format(knbf.getApplyTime(), "yyyy年MM月dd日"));
if (ObjectUtil.isNotNull(knbf.getSignature())) {
String sign = knbf.getSignature();
ByteArrayOutputStream os = new ByteArrayOutputStream();
ftpService.download(sign, os);
os.close();
renderData.put("applySign", new PictureRenderData(70, 30, PictureType.PNG, os.toByteArray()));
}
if (ObjectUtil.isNotNull(knbf.getBranchUnionAudit())) {
String sign = knbf.getBranchUnionAudit().getAuditSign();
ByteArrayOutputStream os = new ByteArrayOutputStream();
ftpService.download(sign, os);
os.close();
renderData.put("branchUnionAuditSign", new PictureRenderData(70, 30, PictureType.PNG, os.toByteArray()));
}
if (ObjectUtil.isNotNull(knbf.getSchoolUnionInitialAudit())) {
String sign = knbf.getSchoolUnionInitialAudit().getAuditSign();
ByteArrayOutputStream os = new ByteArrayOutputStream();
ftpService.download(sign, os);
os.close();
renderData.put("schoolUnionInitialAuditSign", new PictureRenderData(70, 30, PictureType.PNG, os.toByteArray()));
}
if (ObjectUtil.isNotNull(knbf.getSchoolUnionFinalAudit())) {
String sign = knbf.getSchoolUnionFinalAudit().getAuditSign();
ByteArrayOutputStream os = new ByteArrayOutputStream();
ftpService.download(sign, os);
os.close();
renderData.put("schoolUnionFinalAuditSign", new PictureRenderData(70, 30, PictureType.PNG, os.toByteArray()));
}
renderData.put("subsidy_amount_big", Convert.digitToChinese(knbf.getSchoolUnionFinalAudit().getExt().getDouble("money")));
renderData.put("money", knbf.getSchoolUnionFinalAudit().getExt().getDouble("money"));
Configure config = Configure.newBuilder().build();
String suffix = "领取通知单";
response.addHeader("Content-Type", "application/octet-stream");
response.addHeader("Content-Disposition", "attachment; filename=\"" + new String(suffix.getBytes("UTF-8"), "ISO-8859-1") + "\".docx");
XWPFTemplate.compile(officeTemplateUtil.getPath("knbf_pay"), config).render(renderData).writeAndClose(response.getOutputStream());
}
/**
* 导出备案表
*
* @param id
* @param response
* @throws Exception
*/
@At
@Ok("void")
@RequiresPermissions("difficulty.reading")
public void export(@Param("id") String id, HttpServletResponse response) throws Exception {
String suffix = "江南大学工会会员困难补助申请表";
response.addHeader("Content-Type", "application/octet-stream");
response.addHeader("Content-Disposition", "attachment; filename=\"" + new String(suffix.getBytes("UTF-8"), "ISO-8859-1") + "\".docx");
ServletOutputStream outputStream = response.getOutputStream();
Zgfw_knbf knbf = dao.fetch(Zgfw_knbf.class, id);
dao.fetchLinks(knbf, null);
Map<String, Object> renderData = BeanUtil.beanToMap(knbf);
renderData.put("birthday", DateUtil.format(knbf.getBirthday(), "yyyy-MM-dd"));
renderData.put("applyDateTime", DateUtil.format(knbf.getApplyTime(), "yyyy年MM月dd日"));
if (ObjectUtil.isNotNull(knbf.getBranchUnionAudit())) {
String sign = knbf.getBranchUnionAudit().getAuditSign();
ByteArrayOutputStream os = new ByteArrayOutputStream();
ftpService.download(sign, os);
os.close();
renderData.put("branchUnionAuditSign", new PictureRenderData(70, 30, PictureType.PNG, os.toByteArray()));
}
if (ObjectUtil.isNotNull(knbf.getSchoolUnionInitialAudit())) {
String sign = knbf.getSchoolUnionInitialAudit().getAuditSign();
ByteArrayOutputStream os = new ByteArrayOutputStream();
ftpService.download(sign, os);
os.close();
renderData.put("schoolUnionInitialAuditSign", new PictureRenderData(70, 30, PictureType.PNG, os.toByteArray()));
}
if (ObjectUtil.isNotNull(knbf.getSchoolUnionFinalAudit())) {
String sign = knbf.getSchoolUnionFinalAudit().getAuditSign();
ByteArrayOutputStream os = new ByteArrayOutputStream();
ftpService.download(sign, os);
os.close();
renderData.put("schoolUnionFinalAuditSign", new PictureRenderData(70, 30, PictureType.PNG, os.toByteArray()));
}
HackLoopTableRenderPolicy policy = new HackLoopTableRenderPolicy();
Configure config = Configure.builder().bind("familyList", policy).build();
String officeTemplateUtilPath = officeTemplateUtil.getPath("knbf_apply");
XWPFTemplate.compile(officeTemplateUtilPath, config).render(renderData, outputStream);
outputStream.close();
}
@Inject
private ZgfwKnbfJtcyService zgfwKnbfJtcyService;
private void Export(String id, OutputStream outputStream) throws Exception {
Record record = zgfwKnbfService.findOne(id);
List<Record> recordList = zgfwKnbfJtcyService.list(Sqls.create("select * from zgfw_knbf_jtcy where sqid = @id").setParam("id", id));
HackLoopTableRenderPolicy policy = new HackLoopTableRenderPolicy();
Configure config = Configure.newBuilder().bind("familyList", policy).build();
if (!recordList.isEmpty()) {
record.set("familyList", recordList);
}
/* if (record.getInt("sq_bzlx") == 1) {
record.set("bzlx_name", "日常补助慰问");
} else if (record.getInt("sq_bzlx") == 2) {
record.set("bzlx_name", "“元旦、春节”困难补助慰问");
}*/
//分工会
Object app = record.get("app");
if (app != null) {
Sys_signature signature = (Sys_signature) app;
if (Strings.isNotBlank(signature.getData())) {
record.set("appimg", ((Sys_signature) app).getData() != null ? getImg(((Sys_signature) app).getData()) : null);
}
}
//分工会
Object upa = record.get("upa");
if (upa != null) {
Audit audit = (Audit) upa;
record.set("upaimg", audit.getAuditSign() != null ? getImg(audit.getAuditSign()) : null);
record.set("upaTime", audit.getAuditTime() != null ? DateUtil.formatDate(audit.getAuditTime()) : null);
record.set("upaOpinion", audit.getAuditOpinion());
}
//二级党委组织
Object tda = record.get("tda");
if (tda != null) {
Audit audit = (Audit) tda;
record.set("tdaimg", audit.getAuditSign() != null ? getImg(audit.getAuditSign()) : null);
record.set("tdaTime", audit.getAuditTime() != null ? DateUtil.formatDate(audit.getAuditTime()) : null);
record.set("tdaOpinion", audit.getAuditOpinion());
}
//校工会主席
Object sma = record.get("sma");
if (sma != null) {
Audit audit = (Audit) sma;
record.set("smaimg", audit.getAuditSign() != null ? getImg(audit.getAuditSign()) : null);
record.set("smaTime", audit.getAuditTime() != null ? DateUtil.formatDate(audit.getAuditTime()) : null);
record.set("smaOpinion", audit.getAuditOpinion());
}
if (Strings.isNotBlank(record.getString("xghbzje"))) {
record.set("subsidy_amount_big", Convert.digitToChinese(record.getDouble("xghbzje")));
}
record.set("schoolName", Globals.schoolName);
InputStream inputStream;
String officeTemplateUtilPath = officeTemplateUtil.getPath("knbf_apply");
/* if (record.getString("sq_knlx").equals("1")) {
officeTemplateUtilPath = officeTemplateUtil.getPath("knbf_sick");
} else if (record.getString("sq_knlx").equals("3")) {
officeTemplateUtilPath = officeTemplateUtil.getPath("knbf_die");
} else {
officeTemplateUtilPath = officeTemplateUtil.getPath("knbf_summary");
}*/
assert officeTemplateUtilPath != null;
XWPFTemplate.compile(officeTemplateUtilPath, config).render(record, outputStream);
}
/**
* 下载备案表和附件
*
* @param id
* @param response
* @throws Exception
*/
@At
@ViReturn
@RequiresPermissions("difficulty.reading")
public void downloadAnnex(@Param("id") String id, HttpServletResponse response) throws Exception {
// response.reset();
// response.setContentType("application/x-msdownload;charset=utf-8");
//
// String fileName = "";
//
// Zgfw_knbf zgfwKnbf = zgfwKnbfService.fetch(id);
// Sys_user user = sysUserService.fetchLinks(sysUserService.fetch(zgfwKnbf.getBbzrusername()), "unit");
// if (user.getUnit() != null && Strings.isNotBlank(user.getUnit().getUnionid())) {
// Sys_union union = sysUnionService.fetch(user.getUnit().getUnionid());
// fileName += union.getUnionname() + "-";
// }
// fileName += user.getUsername();
//
// List<Sys_file> files = zgfwKnbf.getFiles();
//
// /**
// * 创建临时文件夹
// */
// String tmpPath = "tmp/" + R.UU32();
// File tmpDir = new File(tmpPath + "/" + fileName);
// tmpDir.mkdirs();
//
// if (files != null) {
// for (Sys_file file : files) {
// FileOutputStream outputStream = new FileOutputStream(tmpDir.getPath() + "/" + file.getFilename());
// ftpService.download(file.getFilepath(), outputStream);
// outputStream.close();
// }
// }
//
// FileOutputStream outputStream = new FileOutputStream(tmpDir.getPath() + "/" + "职工慰问报销审批单.docx");
// Export(id, outputStream);
// outputStream.close();
//
// String aimsDir = "zipTmp/" + R.UU32();
// String aimsName = fileName + ".zip";
// String aimsPath = aimsDir + "/" + aimsName;
// FileUtil.compressToZip(tmpDir.getPath(), aimsDir, aimsName);
//
// response.setHeader("content-disposition", "attachment;filename="
// + URLEncoder.encode(aimsName, "UTF-8"));
//
// File aimsFile = new File(aimsPath);
// FileInputStream inputStream = new FileInputStream(aimsFile);
// IOUtils.copy(inputStream, response.getOutputStream());
// inputStream.close();
// aimsFile.delete();
//
// FileUtil.deleteDir(new File(tmpPath));
// FileUtil.deleteDir(new File(aimsDir));
}
@At
@Ok("void")
@RequiresPermissions("difficulty.reading")
public void doExcel(@Param(value = "year", required = false) Integer year,
@Param(value = "dateRange", required = false) String[] dateRange,
@Param(value = "unionId", required = false) String unionId,
@Param(value = "unitId", required = false) String unitId, HttpServletResponse response) throws IOException {
Sql sql = Sqls.create("""
SELECT
info.userName,
info.loginName,
info.unitName,
info.unionName,
info.applyTime,
info.mobile,
info.subsidyStandards,
s.state_name,
branchUnionAudit.auditOpinion AS branchUnionAuditOpinion,
schoolUnionInitialAudit.auditOpinion AS schoolUnionInitialAuditOpinion,
schoolUnionFinalAudit.auditOpinion AS schoolUnionFinalAuditOpinion,
JSON_EXTRACT( branchUnionAudit.ext, '$.money' ) AS branchUnionAuditMoney,
JSON_EXTRACT( schoolUnionInitialAudit.ext, '$.money' ) AS schoolUnionInitialAuditMoney,
JSON_EXTRACT( schoolUnionFinalAudit.ext, '$.money' ) AS schoolUnionFinalAuditMoney
FROM
zgfw_knbf info
LEFT JOIN state s ON s.state_id = info.stateId
LEFT JOIN audit branchUnionAudit ON branchUnionAudit.id = info.branchUnionAuditId
LEFT JOIN audit schoolUnionInitialAudit ON schoolUnionInitialAudit.id = info.schoolUnionInitialAuditId
LEFT JOIN audit schoolUnionFinalAudit ON schoolUnionFinalAudit.id = info.schoolUnionFinalAuditId
$condition
""");
Map<String, Object> map = new HashMap<>();
Cnd cnd = Cnd.where("info.stateId", "=", 3090);
if (dateRange != null && dateRange.length == 2) {
cnd.and("info.applyTime", ">=", dateRange[0]);
cnd.and("info.applyTime", "<=", dateRange[1]);
}
cnd.andEX("info.unionId", "=", unionId);
cnd.andEX("info.unitId", "=", unitId);
cnd.asc("info.applyTime");
sql.setCondition(cnd);
List<NutMap> list = sysUserService.listMap(sql);
ViTool.excelResponse(response, "困难补助汇总表.xlsx");
List<ExcelExportEntity> entities = new ArrayList<>();
entities.add(new ExcelExportEntity("工号", "loginName", 20));
entities.add(new ExcelExportEntity("姓名", "userName", 20));
entities.add(new ExcelExportEntity("单位", "unitName", 20));
entities.add(new ExcelExportEntity("部门", "unionName", 20));
entities.add(new ExcelExportEntity("申请时间", "applyTime", 20));
entities.add(new ExcelExportEntity("联系电话", "mobile", 20));
entities.add(new ExcelExportEntity("类别", "subsidyStandards", 20));
entities.add(new ExcelExportEntity("分工会审核意见", "branchUnionAuditOpinion", 20));
entities.add(new ExcelExportEntity("分工会审核金额", "branchUnionAuditMoney", 20));
entities.add(new ExcelExportEntity("校工会初审意见", "schoolUnionInitialAuditOpinion", 20));
entities.add(new ExcelExportEntity("校工会初审金额", "schoolUnionInitialAuditMoney", 20));
entities.add(new ExcelExportEntity("工会常委会审核意见", "schoolUnionFinalAuditOpinion", 20));
entities.add(new ExcelExportEntity("工会常委会审核金额", "schoolUnionFinalAuditMoney", 20));
ExportParams exportParams = new ExportParams();
exportParams.setType(ExcelType.XSSF);
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, entities, list);
workbook.write(response.getOutputStream());
response.getOutputStream().close();
workbook.close();
}
private PictureRenderData getImg(String base64) throws IOException {
String s = base64.split(",")[1];
byte[] bytes = Base64.getDecoder().decode(s);
return new PictureRenderData(70, 30, ".png", bytes);
}
}
@@ -0,0 +1,151 @@
package io.v.nutz.zhgh.zgfw.controller.difficult;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import cn.wizzer.framework.base.Result;
import cn.wizzer.framework.page.Pagination;
import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.model.Audit;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.service.AuditService;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.sys.services.SysLocalProcessService;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.zgfw.handler.difficult.DifficultToDoHandler;
import io.v.nutz.zhgh.zgfw.model.difficult.Zgfw_knbf;
import io.v.nutz.zhgh.zgfw.service.ZgfwKnbfService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.dao.Chain;
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.aop.Aop;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
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.Map;
@At("/platform/difficulty/schoolUnionFinalAudit")
@Ok("json:full")
@IocBean
public class DifficultSchoolUnionFinalAuditController {
@Inject
private ZgfwKnbfService zgfwKnbfService;
@Inject
private AuditService auditService;
@Inject
private Dao dao;
@Inject
private SysLocalProcessService sysLocalProcessService;
@At("")
@Ok("beetl:/platform/zgfw/difficulty/schoolUnionFinalAudit.html")
@RequiresPermissions("difficulty.schoolUnionFinalAudit")
public void index() {
}
@At("/h5")
@Ok("beetl:/mobile/difficulty/schoolunionfinalaudit/index.html")
@RequiresPermissions("difficulty.schoolUnionFinalAudit")
public void h5() {
}
@At
@ViReturn
@RequiresPermissions("difficulty.schoolUnionFinalAudit")
public Object pageData(@Param(value = "isAudit", required = false) Boolean isAudit,
@Param(value = "year", required = false) Integer year,
@Param(value = "unitId", required = false) String unitId,
@Param(value = "unionId", required = false) String unionId, PageForm page) {
Cnd cnd = Cnd.NEW();
Sql sql = Sqls.create("""
SELECT
info.*,
s.state_name
FROM
`zgfw_knbf` info
LEFT JOIN state s ON s.state_id = info.stateId
$condition
""");
cnd.and("info.stateId", isAudit ? ">" : "=", 3060);
if (!ShiroUtil.hasAnyRoles("sysadmin")) {
cnd.and("info.unionId", "=", Vi.getUnionId());
}
cnd.andEX("YEAR(info.applyTime)", "=", year);
cnd.andEX("info.unitId", "=", unitId);
cnd.andEX("info.unionId", "=", unionId);
if (StrUtil.isNotBlank(page.getSearchKeyword())) {
SqlExpressionGroup seg = new SqlExpressionGroup();
seg.orLike("info.userName", page.getSearchKeyword());
seg.orLike("info.loginName", page.getSearchKeyword());
cnd.and(seg);
}
sql.setCondition(cnd);
Pagination pagination = zgfwKnbfService.listPageMap(page.getPageNumber(), page.getPageSize(), sql);
return Result.success(pagination);
}
@At
@ViReturn
@RequiresPermissions("difficulty.schoolUnionFinalAudit")
@Aop(TransAop.READ_COMMITTED)
public Object doReview(String id, Integer pass, Audit audit, double money) {
audit.setAuditor(ShiroUtil.getPrincipalProperty("id").toString());
audit.setLoginname(ShiroUtil.getPrincipalProperty("loginname").toString());
audit.setUsername(ShiroUtil.getPrincipalProperty("username").toString());
audit.setAuditTime(new Date());
audit.setExt(JSONUtil.parseObj(Map.of("money", money)));
audit = dao.insert(audit);
Zgfw_knbf zgfw_knbf = zgfwKnbfService.fetch(id);
if (pass == 1) {
//不通过
zgfw_knbf.setStateId(3070);
} else if (pass == 2) {
//退回
zgfw_knbf.setStateId(3080);
} else {
//通过
zgfw_knbf.setStateId(3090);
}
zgfw_knbf.setSchoolUnionFinalAuditId(audit.getId());
zgfwKnbfService.updateIgnoreNull(zgfw_knbf);
if (pass == 1){
DifficultToDoHandler.CREATE_APPLY_RE_MODIFY_TASK.exec(zgfw_knbf);
} else if (pass == 2){
DifficultToDoHandler.COMPLETE_PROCESS.exec(zgfw_knbf);
}
DifficultToDoHandler.COMPLETE_SCHOOL_TASK.exec(zgfw_knbf);
return null;
}
@At
@ViReturn
@RequiresPermissions("difficulty.schoolUnionFinalAudit")
@Aop(TransAop.READ_COMMITTED)
public Result doEdit(String id) {
dao.update(Zgfw_knbf.class, Chain.make("stateId", 3060)
.add("schoolUnionFinalAuditId", null)
, Cnd.where("id", "=", id));
//待办撤回
sysLocalProcessService.revokeTask("zgfw_knbf@" + id,"工会常委会审核");
return Result.success();
}
}
@@ -0,0 +1,224 @@
package io.v.nutz.zhgh.zgfw.controller.difficult;
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.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import cn.wizzer.framework.base.Result;
import cn.wizzer.framework.page.Pagination;
import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.model.Audit;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.service.AuditService;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.base.utils.ViTool;
import io.v.nutz.sys.services.SysLocalProcessService;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.zgfw.handler.difficult.DifficultToDoHandler;
import io.v.nutz.zhgh.zgfw.model.difficult.Zgfw_knbf;
import io.v.nutz.zhgh.zgfw.service.ZgfwKnbfService;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.dao.Chain;
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.aop.Aop;
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 org.nutz.mvc.annotation.Param;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.*;
@At("/platform/difficulty/schoolUnionInitialAudit")
@Ok("json:full")
@IocBean
public class DifficultSchoolUnionInitialAuditController {
@Inject
private ZgfwKnbfService zgfwKnbfService;
@Inject
private AuditService auditService;
@Inject
private Vi vi;
@Inject
private Dao dao;
@Inject
private SysLocalProcessService sysLocalProcessService;
@At("")
@Ok("beetl:/platform/zgfw/difficulty/schoolUnionInitialAudit.html")
@RequiresPermissions("difficulty.schoolUnionInitialAudit")
public void index() {
}
@At("/h5")
@Ok("beetl:/mobile/difficulty/schoolunioninitialaudit/index.html")
@RequiresPermissions("difficulty.schoolUnionInitialAudit")
public void h5() {
}
@At
@ViReturn
@RequiresPermissions("difficulty.schoolUnionInitialAudit")
public Object pageData(@Param(value = "isAudit", required = false) Boolean isAudit,
@Param(value = "year", required = false) Integer year,
@Param(value = "unitId", required = false) String unitId,
@Param(value = "unionId", required = false) String unionId, PageForm page) {
Cnd cnd = Cnd.NEW();
Sql sql = Sqls.create("""
SELECT
info.*,
s.state_name
FROM
`zgfw_knbf` info
LEFT JOIN state s ON s.state_id = info.stateId
$condition
""");
cnd.and("info.stateId", isAudit ? ">" : "=", 3030);
if (!ShiroUtil.hasAnyRoles("sysadmin")) {
cnd.and("info.unionId", "=", Vi.getUnionId());
}
cnd.andEX("YEAR(info.applyTime)", "=", year);
cnd.andEX("info.unitId", "=", unitId);
cnd.andEX("info.unionId", "=", unionId);
if (StrUtil.isNotBlank(page.getSearchKeyword())) {
SqlExpressionGroup seg = new SqlExpressionGroup();
seg.orLike("info.userName", page.getSearchKeyword());
seg.orLike("info.loginName", page.getSearchKeyword());
cnd.and(seg);
}
sql.setCondition(cnd);
Pagination pagination = zgfwKnbfService.listPageMap(page.getPageNumber(), page.getPageSize(), sql);
return Result.success(pagination);
}
@At
@ViReturn
@RequiresPermissions("difficulty.schoolUnionInitialAudit")
@Aop(TransAop.READ_COMMITTED)
public Object doReview(String id, Integer pass, Audit audit, double money) {
audit.setAuditor(ShiroUtil.getPrincipalProperty("id").toString());
audit.setLoginname(ShiroUtil.getPrincipalProperty("loginname").toString());
audit.setUsername(ShiroUtil.getPrincipalProperty("username").toString());
audit.setAuditTime(new Date());
audit.setExt(JSONUtil.parseObj(Map.of("money", money)));
audit = dao.insert(audit);
Zgfw_knbf zgfw_knbf = zgfwKnbfService.fetch(id);
if (pass == 1) {
//不通过
zgfw_knbf.setStateId(3040);
} else if (pass == 2) {
//退回
zgfw_knbf.setStateId(3050);
} else {
//通过
zgfw_knbf.setStateId(3060);
}
zgfw_knbf.setSchoolUnionInitialAuditId(audit.getId());
zgfwKnbfService.updateIgnoreNull(zgfw_knbf);
if (pass == 2) {
DifficultToDoHandler.CREATE_APPLY_RE_MODIFY_TASK.exec(zgfw_knbf);
} else if (pass == 3) {
DifficultToDoHandler.CREATE_SCHOOL_TASK.exec(zgfw_knbf);
}
DifficultToDoHandler.COMPLETE_FINANCE_TASK.exec(zgfw_knbf);
return null;
}
@At
@ViReturn
@RequiresPermissions("difficulty.schoolUnionInitialAudit")
@Aop(TransAop.READ_COMMITTED)
public Result doEdit(String id) {
dao.update(Zgfw_knbf.class, Chain.make("stateId", 3030)
.add("schoolUnionInitialAuditId", null)
, Cnd.where("id", "=", id));
//待办撤回
sysLocalProcessService.revokeTask("zgfw_knbf@" + id, "校工会初审");
return Result.success();
}
@At
@Ok("void")
@RequiresPermissions("difficulty.schoolUnionInitialAudit")
public void exportExcel(@Param(value = "year", required = false) Integer year,
@Param(value = "unionId", required = false) String unionId,
@Param(value = "unitId", required = false) String unitId,
HttpServletResponse response) throws IOException {
Sql sql = Sqls.create("""
SELECT
info.userName,
info.loginName,
info.unitName,
info.unionName,
info.applyTime,
info.mobile,
info.subsidyStandards,
s.state_name,
branchUnionAudit.auditOpinion AS branchUnionAuditOpinion,
schoolUnionInitialAudit.auditOpinion AS schoolUnionInitialAuditOpinion,
schoolUnionFinalAudit.auditOpinion AS schoolUnionFinalAuditOpinion,
JSON_EXTRACT( branchUnionAudit.ext, '$.money' ) AS branchUnionAuditMoney,
JSON_EXTRACT( schoolUnionInitialAudit.ext, '$.money' ) AS schoolUnionInitialAuditMoney
FROM
zgfw_knbf info
LEFT JOIN state s ON s.state_id = info.stateId
LEFT JOIN audit branchUnionAudit ON branchUnionAudit.id = info.branchUnionAuditId
LEFT JOIN audit schoolUnionInitialAudit ON schoolUnionInitialAudit.id = info.schoolUnionInitialAuditId
LEFT JOIN audit schoolUnionFinalAudit ON schoolUnionFinalAudit.id = info.schoolUnionFinalAuditId
$condition
""");
Map<String, Object> map = new HashMap<>();
Cnd cnd = Cnd.where("info.stateId", ">=", 3060);
cnd.andEX("YEAR(info.applyTime)","=",year);
cnd.andEX("info.unionId", "=", unionId);
cnd.andEX("info.unitId", "=", unitId);
cnd.asc("info.applyTime");
sql.setCondition(cnd);
List<NutMap> list = auditService.listMap(sql);
ViTool.excelResponse(response, "困难补助审定汇总表.xlsx");
List<ExcelExportEntity> entities = new ArrayList<>();
entities.add(new ExcelExportEntity("工号", "loginName", 20));
entities.add(new ExcelExportEntity("姓名", "userName", 20));
entities.add(new ExcelExportEntity("单位", "unitName", 20));
entities.add(new ExcelExportEntity("部门", "unionName", 20));
entities.add(new ExcelExportEntity("申请时间", "applyTime", 20));
entities.add(new ExcelExportEntity("联系电话", "mobile", 20));
entities.add(new ExcelExportEntity("类别", "subsidyStandards", 20));
entities.add(new ExcelExportEntity("分工会审核意见", "branchUnionAuditOpinion", 20));
entities.add(new ExcelExportEntity("分工会审核金额", "branchUnionAuditMoney", 20));
entities.add(new ExcelExportEntity("校工会初审意见", "schoolUnionInitialAuditOpinion", 20));
entities.add(new ExcelExportEntity("校工会初审金额", "schoolUnionInitialAuditMoney", 20));
ExportParams exportParams = new ExportParams();
exportParams.setType(ExcelType.XSSF);
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, entities, list);
workbook.write(response.getOutputStream());
response.getOutputStream().close();
workbook.close();
}
}
@@ -3,9 +3,7 @@ package io.v.nutz.zhgh.zgfw.controller.difficult;
import cn.wizzer.framework.base.Result; import cn.wizzer.framework.base.Result;
import io.v.nutz.base.annontation.ViReturn; import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.service.AuditService; import io.v.nutz.base.service.AuditService;
import io.v.nutz.base.utils.DateUtil;
import io.v.nutz.base.utils.Vi; import io.v.nutz.base.utils.Vi;
import io.v.nutz.sys.models.Sys_signature;
import io.v.nutz.sys.services.SysSignatureService; import io.v.nutz.sys.services.SysSignatureService;
import io.v.nutz.sys.services.SysUserService; import io.v.nutz.sys.services.SysUserService;
import io.v.nutz.web.commons.utils.ShiroUtil; import io.v.nutz.web.commons.utils.ShiroUtil;
@@ -16,6 +14,7 @@ import io.v.nutz.zhgh.zgfw.service.ZgfwKnbfService;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.aop.interceptor.ioc.TransAop; import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.dao.Cnd; import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
import org.nutz.dao.Sqls; import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql; import org.nutz.dao.sql.Sql;
import org.nutz.dao.util.cri.SqlExpressionGroup; import org.nutz.dao.util.cri.SqlExpressionGroup;
@@ -25,7 +24,9 @@ import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.Strings; import org.nutz.lang.Strings;
import org.nutz.mvc.annotation.At; import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok; import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
import java.util.Date;
import java.util.List; import java.util.List;
/** /**
@@ -35,34 +36,72 @@ import java.util.List;
*/ */
@IocBean @IocBean
@Ok("json") @Ok("json")
@At("/platform/fw/difficulty/apply") @At("/platform/difficulty/apply")
public class DifficultyApply { public class DifficultyApplyController {
@Inject
private Dao dao;
@Inject @Inject
private SysUserService sysUserService; private SysUserService sysUserService;
@Inject @Inject
private ZgfwKnbfService zgfwKnbfService; private ZgfwKnbfService zgfwKnbfService;
@Inject @Inject
private ZgfwKnbfJtcyService zgfwKnbfJtcyService; private ZgfwKnbfJtcyService zgfwKnbfJtcyService;
@Inject @Inject
private AuditService auditService; private AuditService auditService;
@Inject @Inject
private SysSignatureService sysSignatureService; private SysSignatureService sysSignatureService;
@Inject @Inject
private Vi vi; private Vi vi;
@At("") @At("")
@Ok("beetl:/platform/zgfw/difficulty/apply.html") @Ok("beetl:/platform/zgfw/difficulty/apply.html")
@RequiresPermissions("difficulty.apply") @RequiresPermissions("difficulty.apply")
public void index() { public void index() {
} }
@At("/h5")
@Ok("beetl:/mobile/difficulty/apply/index.html")
@RequiresPermissions("difficulty.apply")
public void h5() {
}
@At
@ViReturn
@RequiresPermissions("difficulty.apply")
@Aop(TransAop.READ_COMMITTED)
public Object doAdd(@Param("data") Zgfw_knbf knbf) {
knbf.setApplyTime(new Date());
knbf.setStateId(3000);
dao.insert(knbf);
DifficultToDoHandler.START_PROCESS.exec(knbf);
DifficultToDoHandler.CREATE_UNION_TASK.exec(knbf);
return Result.success();
}
@At
@ViReturn
@RequiresPermissions("difficulty.apply")
@Aop(TransAop.READ_COMMITTED)
public Object doEdit(@Param("data") Zgfw_knbf knbf) {
knbf.setStateId(3000);
zgfwKnbfService.updateIgnoreNull(knbf);
DifficultToDoHandler.START_PROCESS.exec(knbf);
DifficultToDoHandler.CREATE_UNION_TASK.exec(knbf);
if (List.of(3020, 3050, 3080).contains(knbf.getStateId())) {
DifficultToDoHandler.COMPLETE_APPLY_RE_MODIFY_TASK.exec(knbf);
}
return Result.success();
}
@At
@RequiresPermissions("difficulty.apply")
public Result findOne(String id) {
Zgfw_knbf knbf = dao.fetch(Zgfw_knbf.class, id);
return Result.success(knbf);
}
@At @At
@ViReturn @ViReturn
@@ -71,106 +110,34 @@ public class DifficultyApply {
Cnd cnd = Cnd.NEW(); Cnd cnd = Cnd.NEW();
Sql sql = Sqls.create(""" Sql sql = Sqls.create("""
SELECT SELECT
su.id, id,
su.username,su.birthday, username,
su.loginname,su.mobile,su.sex, birthday,
un.`name` unit_name, loginname,
uni.unionname mobile,
sex,
unitname,
unionname,
unionid,
unitid
FROM FROM
sys_user su `user` $condition
LEFT JOIN sys_unit un ON un.id = su.unitid
LEFT JOIN sys_union uni ON uni.id = un.unionid $condition
"""); """);
cnd.and("uni.id", "=", vi.getUnionId()); if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) {
cnd.and("unionid", "=", Vi.getUnionId());
if (!ShiroUtil.hasAnyRoles("gh01")){
cnd.and("id", "=", ShiroUtil.getUserId());
}
}
if (Strings.isNotBlank(key)) { if (Strings.isNotBlank(key)) {
SqlExpressionGroup group = new SqlExpressionGroup(); SqlExpressionGroup group = new SqlExpressionGroup();
group.orLike("su.username", key); group.orLike("username", key);
group.orLike("su.loginname", key); group.orLike("loginname", key);
cnd.and(group); cnd.and(group);
} }
sql.setCondition(cnd); sql.setCondition(cnd);
return sysUserService.listPage(1, 10, sql).getList(); return sysUserService.listPage(1, 10, sql).getList();
} }
@At
@ViReturn
@RequiresPermissions("difficulty.apply")
@Aop(TransAop.READ_COMMITTED)
public Object doAdd(Zgfw_knbf knbf, Boolean flag) {
if (Strings.isNotBlank(knbf.getApplicantsign())) {
knbf.setApplicantsign(sysSignatureService.insert(new Sys_signature(knbf.getApplicantsign())).getId());
}
if (knbf.getApply_mode().equals("1")) {
knbf.setBbzrusername(ShiroUtil.getPrincipalProperty("id").toString());
}
knbf.setZt(flag ? 100 : 98);
knbf.setSqr(ShiroUtil.getPrincipalProperty("id").toString());
knbf.setSqsj(DateUtil.getDate());
// zgfwKnbfService.insert(knbf);
zgfwKnbfService.insertWith(knbf, "jtcys");
DifficultToDoHandler.START_PROCESS.exec(knbf);
DifficultToDoHandler.CREATE_UNION_TASK.exec(knbf);
return Result.success();
}
@At
@ViReturn
@RequiresPermissions("difficulty.apply")
@Aop(TransAop.READ_COMMITTED)
public Object doEdit(Zgfw_knbf knbf, Boolean flag) {
if (Strings.isNotBlank(knbf.getApplicantsign())) {
knbf.setApplicantsign(sysSignatureService.insert(new Sys_signature(knbf.getApplicantsign())).getId());
}
if (knbf.getApply_mode().equals("1")) {
knbf.setBbzrusername(ShiroUtil.getPrincipalProperty("id").toString());
}
knbf.setZt(flag ? 100 : 98);
zgfwKnbfService.updateIgnoreNull(knbf);
zgfwKnbfJtcyService.clear(Cnd.where("sqid", "=", knbf.getId()));
zgfwKnbfService.insertLinks(knbf, "jtcys");
DifficultToDoHandler.START_PROCESS.exec(knbf);
DifficultToDoHandler.CREATE_UNION_TASK.exec(knbf);
if (List.of(150,156,250,350,450).contains(knbf.getZt())){
DifficultToDoHandler.COMPLETE_APPLY_RE_MODIFY_TASK.exec(knbf);
}
// zgfwKnbfService.updateWith(knbf, "jtcys");
return Result.success();
}
/**
* 获取部分信息
*
* @return
*/
@At
@ViReturn
@RequiresPermissions("difficulty.apply")
public Object getUserData() {
Sql sql = Sqls.create("""
SELECT
u.id,
u.loginname,
u.username,
u.idcard,
u.nation,
u.political,
u.birthday,
u.sex,
u.jobTitle,
u.position,
u.bank_number AS yhkh,
un.`name` unitname
FROM
sys_user u
LEFT JOIN sys_unit un ON u.unitid = un.id
WHERE u.id = @id
""").setParam("id", ShiroUtil.getPrincipalProperty("id").toString());
return Result.success().addData(sysUserService.list(sql).get(0));
}
} }
@@ -1,93 +0,0 @@
package io.v.nutz.zhgh.zgfw.controller.difficult;
import cn.wizzer.framework.base.Result;
import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.dao.CndPlus;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.service.AuditService;
import io.v.nutz.sys.services.SysUnionService;
import io.v.nutz.sys.services.SysUserService;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.zgfw.service.ZgfwKnbfJtcyService;
import io.v.nutz.zhgh.zgfw.service.ZgfwKnbfService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.boot.starter.ftp.FtpService;
import org.nutz.dao.Cnd;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
/**
* @author zhf
* @date 2021/1/28 9:26
* @description 困难帮扶申请列表
*/
@IocBean
@Ok("json")
@At("/platform/fw/difficulty/applylist")
public class DifficultyApplyList {
@Inject
private FtpService ftpService;
@Inject
private ZgfwKnbfService zgfwKnbfService;
@Inject
private ZgfwKnbfJtcyService zgfwKnbfJtcyService;
@Inject
private AuditService auditService;
@Inject
private SysUserService sysUserService;
@Inject
private SysUnionService sysUnionService;
@At("")
@Ok("beetl:/platform/zgfw/difficulty/applylist.html")
@RequiresPermissions("difficulty.applylist")
public void index() {
}
@At()
@ViReturn
@RequiresPermissions("difficulty.applylist")
public Object pageData(@Param(value = "year",required = false) Integer year,
@Param(value = "unitId",required = false) String unitId,
@Param(value = "unionId",required = false) String unionId, PageForm page) {
CndPlus cnd = CndPlus.create();
if (!ShiroUtil.hasAnyRoles("sysadmin")) {
cnd.and(Cnd.exps("sq.sqr", "=", ShiroUtil.getPlatformUid()).or("sq.bbzrusername", "=", ShiroUtil.getPlatformUid()));
}
return zgfwKnbfService.pageData(cnd, page, year, unitId,unionId);
}
@At
@ViReturn
@RequiresPermissions("difficulty.applylist")
public Object findOne(String id) {
return zgfwKnbfService.findOne(id);
}
@At
@ViReturn
@RequiresPermissions("difficulty.applylist")
public Object doDelete(String id) {
zgfwKnbfJtcyService.clear(Cnd.where("sqid", "=", id));
zgfwKnbfService.delete(id);
return Result.success();
}
}
@@ -0,0 +1,112 @@
package io.v.nutz.zhgh.zgfw.controller.difficult;
import cn.hutool.core.util.StrUtil;
import cn.wizzer.framework.base.Result;
import cn.wizzer.framework.page.Pagination;
import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.service.AuditService;
import io.v.nutz.sys.services.SysLocalProcessService;
import io.v.nutz.sys.services.SysUnionService;
import io.v.nutz.sys.services.SysUserService;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.zgfw.service.ZgfwKnbfJtcyService;
import io.v.nutz.zhgh.zgfw.service.ZgfwKnbfService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.boot.starter.ftp.FtpService;
import org.nutz.dao.Cnd;
import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql;
import org.nutz.dao.util.cri.SqlExpressionGroup;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
@IocBean
@Ok("json")
@At("/platform/difficulty/applylist")
public class DifficultyApplyListController {
@Inject
private FtpService ftpService;
@Inject
private ZgfwKnbfService zgfwKnbfService;
@Inject
private ZgfwKnbfJtcyService zgfwKnbfJtcyService;
@Inject
private AuditService auditService;
@Inject
private SysUserService sysUserService;
@Inject
private SysUnionService sysUnionService;
@Inject
private SysLocalProcessService localProcessService;
@At("")
@Ok("beetl:/platform/zgfw/difficulty/applylist.html")
@RequiresPermissions("difficulty.applylist")
public void index() {
}
@At("/h5")
@Ok("beetl:/mobile/difficulty/mine/index.html")
@RequiresPermissions("difficulty.applylist")
public void h5() {
}
@At
@RequiresPermissions("difficulty.applylist")
public Result pageData(@Param(value = "year", required = false) Integer year,
@Param(value = "unitId", required = false) String unitId,
@Param(value = "unionId", required = false) String unionId, PageForm page) {
Cnd cnd = Cnd.NEW();
Sql sql = Sqls.create("""
SELECT
info.*,
s.state_name
FROM
`zgfw_knbf` info
LEFT JOIN state s ON s.state_id = info.stateId
$condition
""");
if (!ShiroUtil.hasAnyRoles("sysadmin")) {
cnd.and("info.proxyUserId", "=", ShiroUtil.getUserId());
}
cnd.andEX("YEAR(info.applyTime)", "=", year);
cnd.andEX("info.unitId", "=", unitId);
cnd.andEX("info.unionId", "=", unionId);
if (StrUtil.isNotBlank(page.getSearchKeyword())) {
SqlExpressionGroup seg = new SqlExpressionGroup();
seg.orLike("info.userName", page.getSearchKeyword());
seg.orLike("info.loginName", page.getSearchKeyword());
cnd.and(seg);
}
sql.setCondition(cnd);
Pagination pagination = zgfwKnbfService.listPageMap(page.getPageNumber(), page.getPageSize(), sql);
return Result.success(pagination);
}
@At
@ViReturn
@RequiresPermissions("difficulty.applylist")
public Object findOne(String id) {
return zgfwKnbfService.findOne(id);
}
@At
@ViReturn
@RequiresPermissions("difficulty.applylist")
public Object doDelete(String id) {
zgfwKnbfJtcyService.clear(Cnd.where("sqid", "=", id));
zgfwKnbfService.delete(id);
localProcessService.deleteProcessInstance("zgfw_knbf@" + id);
return Result.success();
}
}
@@ -1,442 +0,0 @@
package io.v.nutz.zhgh.zgfw.controller.difficult;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.date.DateUtil;
import com.deepoove.poi.XWPFTemplate;
import com.deepoove.poi.config.Configure;
import com.deepoove.poi.data.PictureRenderData;
import com.deepoove.poi.policy.HackLoopTableRenderPolicy;
import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.dao.CndPlus;
import io.v.nutz.base.model.Audit;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.service.BaseService;
import io.v.nutz.base.utils.OfficeTemplateUtil;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.sys.models.Sys_file;
import io.v.nutz.sys.models.Sys_signature;
import io.v.nutz.sys.models.Sys_union;
import io.v.nutz.sys.models.Sys_user;
import io.v.nutz.sys.services.SysUnionService;
import io.v.nutz.sys.services.SysUserService;
import io.v.nutz.web.commons.base.Globals;
import io.v.nutz.web.commons.utils.FileUtil;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.zgfw.model.difficult.Zgfw_knbf;
import io.v.nutz.zhgh.zgfw.service.ZgfwKnbfJtcyService;
import io.v.nutz.zhgh.zgfw.service.ZgfwKnbfService;
import org.apache.commons.io.IOUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.boot.starter.ftp.FtpService;
import org.nutz.dao.Cnd;
import org.nutz.dao.Sqls;
import org.nutz.dao.entity.Record;
import org.nutz.dao.sql.Sql;
import org.nutz.dao.util.cri.SqlExpressionGroup;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.Strings;
import org.nutz.lang.random.R;
import org.nutz.lang.util.NutMap;
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.io.*;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.Base64;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;
/**
* @author zhf
* @date 2021/2/2 13:45
* @description 困难帮扶阅览
*/
@IocBean
@Ok("json")
@At("/platform/fw/difficulty/reading")
public class ReadingController {
@Inject
private ZgfwKnbfService zgfwKnbfService;
@Inject
private FtpService ftpService;
@Inject
private SysUserService sysUserService;
@Inject
private SysUnionService sysUnionService;
@Inject
private BaseService baseService;
@Inject
private Vi vi;
@Inject
private OfficeTemplateUtil officeTemplateUtil;
@At("")
@Ok("beetl:/platform/zgfw/difficulty/reading.html")
@RequiresPermissions("difficulty.reading")
public void index() {
}
@At()
@ViReturn
@RequiresPermissions("difficulty.reading")
public Object pageData(@Param(value = "dateRange", required = false) String[] dateRange,
@Param(value = "year", required = false) Integer year,
@Param(value = "unitId", required = false) String unitId,
@Param(value = "unionId", required = false) String unionId, PageForm page) {
CndPlus cnd = CndPlus.create();
if (!ShiroUtil.hasAnyRoles("sysadmin,A06,wyh03,wyh02")) {
SqlExpressionGroup group2 = new SqlExpressionGroup();
if (ShiroUtil.hasAnyRoles("gh01,H04")) {
group2.or("sqr.unionid", "=", vi.getUnionId());
}
if (ShiroUtil.hasRole("H01")) {
group2.or("sq.sqr", "=", ShiroUtil.getPrincipalProperty("id").toString());
group2.or("sq.bbzrusername", "=", ShiroUtil.getPrincipalProperty("id").toString());
}
cnd.and(group2);
}
if (dateRange != null && dateRange.length == 2) {
cnd.and("sq.sqsj", ">=", dateRange[0]);
cnd.and("sq.sqsj", "<=", dateRange[1]);
}
return zgfwKnbfService.pageData(cnd, page, year, unitId, unionId);
}
@At
@ViReturn
@RequiresPermissions("difficulty.reading")
public Object findOne(String id) {
return zgfwKnbfService.findOne(id);
}
/**
* 导出报销表
*
* @param id
* @param response
* @throws Exception
*/
@At
@Ok("void")
@ViReturn
@RequiresPermissions("difficulty.reading")
public void doExport(@Param("id") String id, HttpServletResponse response) throws Exception {
Record record = zgfwKnbfService.findOne(id);
record.put("knbf", "☑");
Object app = record.get("app");
if (app != null) {
Sys_signature signature = (Sys_signature) app;
if (Strings.isNotBlank(signature.getData())) {
record.set("appimg", ((Sys_signature) app).getData() != null ? getImg(((Sys_signature) app).getData()) : null);
}
}
Object upa = record.get("upa");
if (upa != null) {
Audit audit = (Audit) upa;
record.set("upaimg", audit.getAuditSign() != null ? getImg(audit.getAuditSign()) : null);
}
Object sua = record.get("sua");
if (sua != null) {
Audit audit = (Audit) sua;
record.set("suaimg", audit.getAuditSign() != null ? getImg(audit.getAuditSign()) : null);
}
record.set("subsidy_amount_big", Convert.digitToChinese(record.getDouble("xghbzje")));
/*int price = record.getInt("xghbzje");
int money_int = price;
int money_decimal = money_int - price;
record.set("one", money_int >= 1000000 ? (money_int / 1000000) % 10 : null);
record.set("two", money_int >= 100000 ? (money_int / 100000) % 10 : null);
record.set("three", money_int >= 10000 ? (money_int / 10000) % 10 : null);
record.set("four", money_int >= 1000 ? (money_int / 1000) % 10 : null);
record.set("five", money_int >= 100 ? (money_int / 100) % 10 : null);
record.set("six", money_int >= 10 ? (money_int / 10) % 10 : null);
record.set("seven", money_int >= 10 ? money_int % 10 : null);
record.set("eight", (int) (money_decimal * 10));
record.set("nine", (int) (money_decimal % 0.1 * 100));*/
/* if (record.getInt("sq_bzlx") == 1) {
record.set("bzlx_name", "日常补助慰问");
} else if (record.getInt("sq_bzlx") == 2) {
record.set("bzlx_name", "“元旦、春节”困难补助慰问");
}*/
Configure config = Configure.newBuilder().build();
String suffix = "领取通知单";
//InputStream inputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("docTemplate/difficulty/knbf_reimbursement.docx");
response.addHeader("Content-Type", "application/octet-stream");
response.addHeader("Content-Disposition", "attachment; filename=\"" + new String(suffix.getBytes("UTF-8"), "ISO-8859-1") + "\".docx");
XWPFTemplate.compile(officeTemplateUtil.getPath("knbf_pay"), config).render(record).writeAndClose(response.getOutputStream());
}
/**
* 导出备案表
*
* @param id
* @param response
* @throws Exception
*/
@At
@RequiresPermissions("difficulty.reading")
public void export(@Param("id") String id, HttpServletResponse response) throws Exception {
// Record record = zgfwKnbfService.findOne(id);
String suffix = "江南大学工会会员困难补助申请表";
/* if (record.getString("sq_knlx").equals("1")) {
suffix = Globals.schoolName + "工会审批表";
} else if (record.getString("sq_knlx").equals("3")) {
suffix = Globals.schoolName + "工会审批表";
} else {
suffix = Globals.schoolName + "工会审批表";
}*/
response.addHeader("Content-Type", "application/octet-stream");
response.addHeader("Content-Disposition", "attachment; filename=\"" + new String(suffix.getBytes("UTF-8"), "ISO-8859-1") + "\".docx");
Export(id, response.getOutputStream());
}
@Inject
private ZgfwKnbfJtcyService zgfwKnbfJtcyService;
private void Export(String id, OutputStream outputStream) throws Exception {
Record record = zgfwKnbfService.findOne(id);
List<Record> recordList = zgfwKnbfJtcyService.list(Sqls.create("select * from zgfw_knbf_jtcy where sqid = @id").setParam("id", id));
HackLoopTableRenderPolicy policy = new HackLoopTableRenderPolicy();
Configure config = Configure.newBuilder().bind("familyList", policy).build();
if (!recordList.isEmpty()) {
record.set("familyList", recordList);
}
/* if (record.getInt("sq_bzlx") == 1) {
record.set("bzlx_name", "日常补助慰问");
} else if (record.getInt("sq_bzlx") == 2) {
record.set("bzlx_name", "“元旦、春节”困难补助慰问");
}*/
//分工会
Object app = record.get("app");
if (app != null) {
Sys_signature signature = (Sys_signature) app;
if (Strings.isNotBlank(signature.getData())) {
record.set("appimg", ((Sys_signature) app).getData() != null ? getImg(((Sys_signature) app).getData()) : null);
}
}
//分工会
Object upa = record.get("upa");
if (upa != null) {
Audit audit = (Audit) upa;
record.set("upaimg", audit.getAuditSign() != null ? getImg(audit.getAuditSign()) : null);
record.set("upaTime", audit.getAuditTime() != null ? DateUtil.formatDate(audit.getAuditTime()) : null);
record.set("upaOpinion", audit.getAuditOpinion());
}
//二级党委组织
Object tda = record.get("tda");
if (tda != null) {
Audit audit = (Audit) tda;
record.set("tdaimg", audit.getAuditSign() != null ? getImg(audit.getAuditSign()) : null);
record.set("tdaTime", audit.getAuditTime() != null ? DateUtil.formatDate(audit.getAuditTime()) : null);
record.set("tdaOpinion", audit.getAuditOpinion());
}
//校工会主席
Object sma = record.get("sma");
if (sma != null) {
Audit audit = (Audit) sma;
record.set("smaimg", audit.getAuditSign() != null ? getImg(audit.getAuditSign()) : null);
record.set("smaTime", audit.getAuditTime() != null ? DateUtil.formatDate(audit.getAuditTime()) : null);
record.set("smaOpinion", audit.getAuditOpinion());
}
if (Strings.isNotBlank(record.getString("xghbzje"))) {
record.set("subsidy_amount_big", Convert.digitToChinese(record.getDouble("xghbzje")));
}
record.set("schoolName", Globals.schoolName);
InputStream inputStream;
String officeTemplateUtilPath = officeTemplateUtil.getPath("knbf_apply");
/* if (record.getString("sq_knlx").equals("1")) {
officeTemplateUtilPath = officeTemplateUtil.getPath("knbf_sick");
} else if (record.getString("sq_knlx").equals("3")) {
officeTemplateUtilPath = officeTemplateUtil.getPath("knbf_die");
} else {
officeTemplateUtilPath = officeTemplateUtil.getPath("knbf_summary");
}*/
assert officeTemplateUtilPath != null;
XWPFTemplate.compile(officeTemplateUtilPath, config).render(record, outputStream);
}
/**
* 下载备案表和附件
*
* @param id
* @param response
* @throws Exception
*/
@At
@ViReturn
@RequiresPermissions("difficulty.reading")
public void downloadAnnex(@Param("id") String id, HttpServletResponse response) throws Exception {
response.reset();
response.setContentType("application/x-msdownload;charset=utf-8");
String fileName = "";
Zgfw_knbf zgfwKnbf = zgfwKnbfService.fetch(id);
Sys_user user = sysUserService.fetchLinks(sysUserService.fetch(zgfwKnbf.getBbzrusername()), "unit");
if (user.getUnit() != null && Strings.isNotBlank(user.getUnit().getUnionid())) {
Sys_union union = sysUnionService.fetch(user.getUnit().getUnionid());
fileName += union.getUnionname() + "-";
}
fileName += user.getUsername();
List<Sys_file> files = zgfwKnbf.getFiles();
/**
* 创建临时文件夹
*/
String tmpPath = "tmp/" + R.UU32();
File tmpDir = new File(tmpPath + "/" + fileName);
tmpDir.mkdirs();
if (files != null) {
for (Sys_file file : files) {
FileOutputStream outputStream = new FileOutputStream(tmpDir.getPath() + "/" + file.getFilename());
ftpService.download(file.getFilepath(), outputStream);
outputStream.close();
}
}
FileOutputStream outputStream = new FileOutputStream(tmpDir.getPath() + "/" + "职工慰问报销审批单.docx");
Export(id, outputStream);
outputStream.close();
String aimsDir = "zipTmp/" + R.UU32();
String aimsName = fileName + ".zip";
String aimsPath = aimsDir + "/" + aimsName;
FileUtil.compressToZip(tmpDir.getPath(), aimsDir, aimsName);
response.setHeader("content-disposition", "attachment;filename="
+ URLEncoder.encode(aimsName, "UTF-8"));
File aimsFile = new File(aimsPath);
FileInputStream inputStream = new FileInputStream(aimsFile);
IOUtils.copy(inputStream, response.getOutputStream());
inputStream.close();
aimsFile.delete();
FileUtil.deleteDir(new File(tmpPath));
FileUtil.deleteDir(new File(aimsDir));
}
@At
@ViReturn
@Ok("void")
@RequiresPermissions("difficulty.reading")
public void doExcel(@Param(value = "year", required = false) Integer year,
@Param(value = "dateRange", required = false) String[] dateRange,
@Param(value = "unionId", required = false) String unionId,
@Param(value = "unitId", required = false) String unitId, HttpServletResponse response) throws IOException {
Sql sql = Sqls.create("""
SELECT
su.username,
su.loginname,
su.unitname,
su.unionname,
su.sex,
su.jobTitle,
bf.zc,
bf.zw,
bf.zyzkyybz,
bf.xghbzje,
bf.yhkh,
bf.lxfs,
bf.apply_reason
FROM
zgfw_knbf bf
LEFT JOIN `user` su ON su.id = bf.bbzrusername $condition
""");
Map<String, Object> map = new HashMap<>();
Cnd cnd = Cnd.where("bf.zt", "=", 500);
if (dateRange != null && dateRange.length == 2) {
cnd.and("bf.sqsj", ">=", dateRange[0]);
cnd.and("bf.sqsj", "<=", dateRange[1]);
}
if (!ShiroUtil.hasAnyRoles("sysadmin,A06,wyh03,wyh02")) {
if (ShiroUtil.hasAnyRoles("gh01,H04")) {
cnd.andEX("su.unionid", "=", vi.getUnionId());
map.put("union", "院级工会主席");
}
map.put("union", "校工会");
}
cnd.andEX("su.unionid", "=", unionId);
cnd.andEX("su.unitid", "=", unitId);
cnd.asc("su.unionname");
cnd.asc("su.unitname");
cnd.asc("bf.sqsj");
sql.setCondition(cnd);
List<NutMap> nutMap = sysUserService.listMap(sql);
AtomicInteger listIndex = new AtomicInteger(1);
nutMap.forEach(v -> {
v.put("index", listIndex.get());
listIndex.getAndIncrement();
});
map.put("exportDate", io.v.nutz.base.utils.DateUtil.getDate());
map.put("knbf", nutMap);
HackLoopTableRenderPolicy policy = new HackLoopTableRenderPolicy();
Configure config = Configure.newBuilder().bind("knbf", policy).build();
response.addHeader("Content-Type", "application/octet-stream");
response.addHeader("Content-Disposition", "attachment; filename=\"" + new String(("院级工会教职工困难补助申报汇总表").getBytes(StandardCharsets.UTF_8), StandardCharsets.ISO_8859_1) + "\".docx");
XWPFTemplate.compile(officeTemplateUtil.getPath("knbf_summary"), config).render(map).writeAndClose(response.getOutputStream());
}
private PictureRenderData getImg(String base64) throws IOException {
String s = base64.split(",")[1];
byte[] bytes = Base64.getDecoder().decode(s);
return new PictureRenderData(70, 30, ".png", bytes);
}
}
@@ -1,95 +0,0 @@
package io.v.nutz.zhgh.zgfw.controller.difficult;
import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.dao.CndPlus;
import io.v.nutz.base.model.Audit;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.service.AuditService;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.zgfw.handler.difficult.DifficultToDoHandler;
import io.v.nutz.zhgh.zgfw.model.difficult.Zgfw_knbf;
import io.v.nutz.zhgh.zgfw.service.ZgfwKnbfService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.ioc.aop.Aop;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
import java.util.Date;
/**
* @author zhf
* @date 2021/1/30 8:42
* @description 校工会主席
*/
@At("/platform/fw/difficulty/schoolmanager")
@Ok("json:full")
@IocBean
public class SchoolManagerController {
@Inject
private ZgfwKnbfService zgfwKnbfService;
@Inject
private AuditService auditService;
@At("")
@Ok("beetl:/platform/zgfw/difficulty/schoolmanager.html")
@RequiresPermissions("fw.difficulty.schoolmanager")
public void index() {
}
@At
@ViReturn
@RequiresPermissions("fw.difficulty.schoolmanager")
public Object pageData(@Param(value = "isAudit", required = false) Boolean isAudit,
@Param(value = "year", required = false) Integer year,
@Param(value = "unitId", required = false) String unitId,
@Param(value = "unionId", required = false) String unionId, PageForm page) {
CndPlus cnd = CndPlus.create();
cnd.and("sq.zt", isAudit ? ">" : "=", 200);
return zgfwKnbfService.pageData(cnd, page, year, unitId, unionId);
}
@At
@ViReturn
@RequiresPermissions("fw.difficulty.schoolmanager")
@Aop(TransAop.READ_COMMITTED)
public Object doReview(String id, Integer pass, Audit audit, @Param(value = "xghbzje", required = false) String xghbzje) {
audit.setAuditor(ShiroUtil.getPrincipalProperty("id").toString());
audit.setLoginname(ShiroUtil.getPrincipalProperty("loginname").toString());
audit.setUsername(ShiroUtil.getPrincipalProperty("username").toString());
audit.setAuditTime(new Date());
audit = auditService.insert(audit);
Zgfw_knbf zgfw_knbf = zgfwKnbfService.fetch(id);
zgfw_knbf.setSchool_manager_audit(audit.getId());
// zgfw_knbf.setXghbzje(xghbzje);
if (pass == 1) {
//不通过
zgfw_knbf.setZt(250);
}
if (pass == 2) {
//通过
zgfw_knbf.setZt(500);
}
if (pass == 3) {
zgfw_knbf.setZt(252);
}
zgfwKnbfService.updateIgnoreNull(zgfw_knbf);
if (pass == 1){
DifficultToDoHandler.CREATE_APPLY_RE_MODIFY_TASK.exec(zgfw_knbf);
} else if (pass == 2){
DifficultToDoHandler.COMPLETE_PROCESS.exec(zgfw_knbf);
}
DifficultToDoHandler.COMPLETE_SCHOOL_TASK.exec(zgfw_knbf);
return null;
}
}
@@ -1,78 +0,0 @@
package io.v.nutz.zhgh.zgfw.controller.difficult;
import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.dao.CndPlus;
import io.v.nutz.base.model.Audit;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.service.AuditService;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.zgfw.model.difficult.Zgfw_knbf;
import io.v.nutz.zhgh.zgfw.service.ZgfwKnbfService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
import java.util.Date;
/**
* @author zhf
* @date 2021/1/30 8:49
* @description 校工会常务副主席审核
*/
@At("/platform/fw/difficulty/schoolstanding")
@Ok("json:full")
@IocBean
public class SchoolStandingController {
@Inject
private ZgfwKnbfService zgfwKnbfService;
@Inject
private AuditService auditService;
@At("")
@Ok("beetl:/platform/fw/difficulty/schoolstanding.html")
@RequiresPermissions("fw.difficulty.schoolstanding")
public void index() {
}
@At()
@ViReturn
@RequiresPermissions("fw.difficulty.schoolstanding")
public Object pageData(@Param(value = "isAudit",required = false) Boolean isAudit,
@Param(value = "year",required = false) Integer year,
@Param(value = "unitId",required = false) String unitId,
@Param(value = "unionId",required = false) String unionId, PageForm page) {
CndPlus cnd = CndPlus.create();
cnd.and("sq.zt", isAudit ? ">" : "=", 400);
return zgfwKnbfService.pageData(cnd, page, year, unitId,unionId);
}
@At
@ViReturn
@RequiresPermissions("fw.difficulty.schoolstanding")
public Object doReview(String id, boolean pass, Audit audit, String jb, String xghbzje) {
audit.setAuditor(ShiroUtil.getPrincipalProperty("id").toString());
audit.setLoginname(ShiroUtil.getPrincipalProperty("loginname").toString());
audit.setUsername(ShiroUtil.getPrincipalProperty("username").toString());
audit.setAuditTime(new Date());
audit = auditService.insert(audit);
Zgfw_knbf zgfw_knbf = zgfwKnbfService.fetch(id);
zgfw_knbf.setSchool_standing_audit(audit.getId());
zgfw_knbf.setJb(jb);
zgfw_knbf.setXghbzje(xghbzje);
zgfw_knbf.setZt(pass ? 500 : 450);
zgfwKnbfService.updateIgnoreNull(zgfw_knbf);
return null;
}
}
@@ -1,77 +0,0 @@
package io.v.nutz.zhgh.zgfw.controller.difficult;
import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.dao.CndPlus;
import io.v.nutz.base.model.Audit;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.service.AuditService;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.zgfw.model.difficult.Zgfw_knbf;
import io.v.nutz.zhgh.zgfw.service.ZgfwKnbfService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
import java.util.Date;
/**
* @author zhf
* @date 2021/1/30 8:47
* @description 校工会财务审核
*/
@At("/platform/fw/difficulty/schoolvicechairman")
@Ok("json:full")
@IocBean
public class SchoolViceChairmanCon {
@Inject
private ZgfwKnbfService zgfwKnbfService;
@Inject
private AuditService auditService;
@At("")
@Ok("beetl:/platform/fw/difficulty/schoolvicechairman.html")
@RequiresPermissions("fw.difficulty.schoolvicechairman")
public void index() {
}
@At()
@ViReturn
@RequiresPermissions("fw.difficulty.schoolvicechairman")
public Object pageData(@Param(value = "isAudit",required = false) Boolean isAudit,
@Param(value = "year",required = false) Integer year,
@Param(value = "unitId",required = false) String unitId,
@Param(value = "unionId",required = false) String unionId, PageForm page) {
CndPlus cnd = CndPlus.create();
cnd.and("sq.zt", isAudit ? ">" : "=", 300);
return zgfwKnbfService.pageData(cnd, page, year, unitId,unionId);
}
@At
@ViReturn
@RequiresPermissions("fw.difficulty.schoolvicechairman")
public Object doReview(String id, boolean pass, Audit audit) {
audit.setAuditor(ShiroUtil.getPrincipalProperty("id").toString());
audit.setLoginname(ShiroUtil.getPrincipalProperty("loginname").toString());
audit.setUsername(ShiroUtil.getPrincipalProperty("username").toString());
audit.setAuditTime(new Date());
audit = auditService.insert(audit);
Zgfw_knbf zgfw_knbf = zgfwKnbfService.fetch(id);
zgfw_knbf.setSchool_vice_chairman_audit(audit.getId());
zgfw_knbf.setZt(pass ? 500 : 350);
zgfwKnbfService.updateIgnoreNull(zgfw_knbf);
return null;
}
}
@@ -1,95 +0,0 @@
package io.v.nutz.zhgh.zgfw.controller.difficult;
import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.dao.CndPlus;
import io.v.nutz.base.model.Audit;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.service.AuditService;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.zgfw.handler.difficult.DifficultToDoHandler;
import io.v.nutz.zhgh.zgfw.model.difficult.Zgfw_knbf;
import io.v.nutz.zhgh.zgfw.service.ZgfwKnbfService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.ioc.aop.Aop;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
import java.util.Date;
/**
* 二级党组织审核
*/
@At("/platform/fw/difficulty/twoOrganization")
@Ok("json:full")
@IocBean
public class TwoOrganizationController {
@Inject
private ZgfwKnbfService zgfwKnbfService;
@Inject
private AuditService auditService;
@Inject
private Vi vi;
@At("")
@Ok("beetl:/platform/zgfw/difficulty/twoOrganization.html")
@RequiresPermissions("fw.difficulty.twoOrganization")
public void index() {
}
@At()
@ViReturn
@RequiresPermissions("fw.difficulty.twoOrganization")
public Object pageData(@Param(value = "isAudit", required = false) Boolean isAudit,
@Param(value = "year", required = false) Integer year,
@Param(value = "unitId", required = false) String unitId,
@Param(value = "unionId", required = false) String unionId, PageForm page) {
CndPlus cnd = CndPlus.create();
cnd.and("sq.zt", isAudit ? ">" : "=", 155);
return zgfwKnbfService.pageData(cnd, page, year, unitId, unionId);
}
@At
@ViReturn
@RequiresPermissions("fw.difficulty.twoOrganization")
@Aop(TransAop.READ_COMMITTED)
public Object doReview(String id, Integer pass, Audit audit, @Param(value = "xghbzje", required = false) String xghbzje) {
audit.setAuditor(ShiroUtil.getPrincipalProperty("id").toString());
audit.setLoginname(ShiroUtil.getPrincipalProperty("loginname").toString());
audit.setUsername(ShiroUtil.getPrincipalProperty("username").toString());
audit.setAuditTime(new Date());
audit = auditService.insert(audit);
Zgfw_knbf zgfw_knbf = zgfwKnbfService.fetch(id);
if (pass == 1) {
//不通过
zgfw_knbf.setZt(156);
} else if (pass == 2) {
//通过
zgfw_knbf.setZt(200);
} else {
zgfw_knbf.setZt(157);
}
zgfw_knbf.setXghbzje(xghbzje);
zgfw_knbf.setTwo_dzz_audit(audit.getId());
zgfwKnbfService.updateIgnoreNull(zgfw_knbf);
if (pass == 1){
DifficultToDoHandler.CREATE_APPLY_RE_MODIFY_TASK.exec(zgfw_knbf);
}else if (pass == 2){
DifficultToDoHandler.CREATE_SCHOOL_TASK.exec(zgfw_knbf);
}
DifficultToDoHandler.COMPLETE_FINANCE_TASK.exec(zgfw_knbf);
return null;
}
}
@@ -1,120 +0,0 @@
package io.v.nutz.zhgh.zgfw.controller.difficult;
import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.dao.CndPlus;
import io.v.nutz.base.model.Audit;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.service.AuditService;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.zgfw.handler.difficult.DifficultToDoHandler;
import io.v.nutz.zhgh.zgfw.model.difficult.Zgfw_knbf;
import io.v.nutz.zhgh.zgfw.service.ZgfwKnbfService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.dao.Chain;
import org.nutz.dao.Cnd;
import org.nutz.ioc.aop.Aop;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
import java.util.Date;
/**
* @author zhf
* @date 2021/1/30 8:34
* @description 工会主席审核
*/
@At("/platform/fw/difficulty/unionchairman")
@Ok("json:full")
@IocBean
public class UnionChairmanController {
@Inject
private ZgfwKnbfService zgfwKnbfService;
@Inject
private AuditService auditService;
@Inject
private Vi vi;
@At("")
@Ok("beetl:/platform/zgfw/difficulty/unionchairman.html")
@RequiresPermissions("fw.difficulty.unionchairman")
public void index() {
}
@At()
@ViReturn
@RequiresPermissions("fw.difficulty.unionchairman")
public Object pageData(@Param(value = "isAudit",required = false) Boolean isAudit,
@Param(value = "year",required = false) Integer year,
@Param(value = "unitId",required = false) String unitId,
@Param(value = "unionId",required = false) String unionId, PageForm page) {
CndPlus cnd = CndPlus.create();
if (!ShiroUtil.hasAnyRoles("sysadmin")){
cnd.and("un.id", "=", vi.getUnionId());
}
cnd.and("sq.zt", isAudit ? ">" : "=", 100);
return zgfwKnbfService.pageData(cnd, page, year, unitId,unionId);
}
@At
@ViReturn
@RequiresPermissions("fw.difficulty.unionchairman")
public Object doEdit(String id) {
Zgfw_knbf knbf = zgfwKnbfService.fetch(id);
int zt = 0;
//审核通过,撤回为待校工会审核
if(knbf.getZt().equals(500)){
zt=200;
} else if (knbf.getZt().equals(200)){//待校工会审核,撤回为待二级党组织审核
zt=155;
}else if (knbf.getZt().equals(155)){//待二级党组织审核,撤回为待分工会审核
zt=100;
}
zgfwKnbfService.update(Chain.make("zt", zt), Cnd.where("id", "=", id));
return null;
}
@At
@ViReturn
@RequiresPermissions("fw.difficulty.unionchairman")
@Aop(TransAop.READ_COMMITTED)
public Object doReview(String id, Integer pass, Audit audit) {
audit.setAuditor(ShiroUtil.getPrincipalProperty("id").toString());
audit.setLoginname(ShiroUtil.getPrincipalProperty("loginname").toString());
audit.setUsername(ShiroUtil.getPrincipalProperty("username").toString());
audit.setAuditTime(new Date());
audit = auditService.insert(audit);
Zgfw_knbf zgfw_knbf = zgfwKnbfService.fetch(id);
if (pass == 1) {
//不通过
zgfw_knbf.setZt(150);
} else if (pass == 2) {
zgfw_knbf.setZt(152);
} else {
//通过
zgfw_knbf.setZt(155);
}
zgfw_knbf.setUnion_president_audit(audit.getId());
zgfwKnbfService.updateIgnoreNull(zgfw_knbf);
if (pass == 1){
DifficultToDoHandler.CREATE_APPLY_RE_MODIFY_TASK.exec(zgfw_knbf);
}else if (pass == 3){
DifficultToDoHandler.CREATE_FINANCE_TASK.exec(zgfw_knbf);
}
DifficultToDoHandler.COMPLETE_UNION_TASK.exec(zgfw_knbf);
return null;
}
}
@@ -1,407 +0,0 @@
package io.v.nutz.zhgh.zgfw.controller.difficult;
import cn.wizzer.framework.base.Result;
import io.v.nutz.base.utils.DateUtil;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.zgfw.model.difficult.Zgfw_knbf;
import io.v.nutz.zhgh.zgfw.service.ZgfwKnbfJtcyService;
import io.v.nutz.zhgh.zgfw.service.ZgfwKnbfService;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.CellType;
import org.apache.poi.xssf.usermodel.XSSFCell;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.dao.Cnd;
import org.nutz.dao.Sqls;
import org.nutz.dao.entity.Record;
import org.nutz.dao.sql.Sql;
import org.nutz.dao.util.cri.SqlExpressionGroup;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.Strings;
import org.nutz.lang.util.NutMap;
import org.nutz.mvc.annotation.AdaptBy;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
import org.nutz.mvc.upload.TempFile;
import org.nutz.mvc.upload.UploadAdaptor;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.List;
/**
* @Author: V
* @Date: 2020/5/26 9:59
* @Description: 数据导入
*/
@IocBean
@Ok("json")
@At("/platform/knbf/sjdr")
public class ZgfwKnbfSjdrCon extends ZgfwUtil {
@Inject
private ZgfwKnbfService zgfwKnbfService;
@Inject
private ZgfwKnbfJtcyService zgfwKnbfJtcyService;
@At("")
@Ok("re")
@RequiresPermissions("zgfw.knbf.sjdr")
public String index() {
return "beetl:/platform/fw/difficulty/sjdr.html";
}
@At
@RequiresPermissions("zgfw.knbf.sjdr")
public Object queryUser(String query) {
try {
Sql sql = Sqls.create("SELECT u.*,un.`name` unitname from sys_user u left join sys_unit un on u.unitid = un.id $condition");
Cnd cnd = Cnd.NEW();
if (!ShiroUtil.hasAnyRoles("sysadmin", "A06")) {
SqlExpressionGroup group = new SqlExpressionGroup();
if (ShiroUtil.hasRole("H04")) {
//院级工会
group.or("unit.unionid", "in", getFghIdStr());
}
cnd.and(group);
}
SqlExpressionGroup g2 = new SqlExpressionGroup();
g2.orLike("username", query);
g2.orLike("loginname", query);
cnd.and(g2);
cnd.asc("u.unitid");
sql.setCondition(cnd);
return Result.success().addData(sysUserService.listPage(1, 50, sql));
} catch (Exception e) {
return Result.error();
}
}
@At
@RequiresPermissions("zgfw.knbf.sjdr")
public Object doAdd(Zgfw_knbf zgfw_knbf) {
try {
zgfw_knbf.setZyzkyy("[]");
zgfw_knbf.setJtfc("[]");
zgfw_knbf.setJtcc("[]");
zgfw_knbf.setZt(600);
zgfwKnbfService.insert(zgfw_knbf);
return Result.success();
} catch (Exception e) {
return Result.error();
}
}
/**
* 下载摸板
*
* @param response
* @throws IOException
*/
@At
@RequiresPermissions("zgfw.knbf.sjdr")
public void downLoadTemp(HttpServletResponse response) throws IOException {
File file = null;
InputStream fin = null;
ServletOutputStream out = null;
try {
file = new File("src/main/resources/templates/knbfls.xlsx");
fin = new FileInputStream(file);
// 设置浏览器以下载的方式处理该文件名
String fileName = "困难帮扶历史数据" + ".xlsx";
response.setHeader("Content-Disposition", "attachment;filename="
.concat(String.valueOf(URLEncoder.encode(fileName, "UTF-8"))));
out = response.getOutputStream();
byte[] buffer = new byte[512]; // 缓冲区
int bytesToRead = -1;
// 通过循环将读入的Word文件的内容输出到浏览器中
while ((bytesToRead = fin.read(buffer)) != -1) {
out.write(buffer, 0, bytesToRead);
}
out.flush();
} finally {
if (fin != null) fin.close();
if (out != null) out.close();
}
}
@At
@Ok("json")
@AdaptBy(type = UploadAdaptor.class, args = {"ioc:fileUpload"})
@RequiresPermissions("zgfw.knbf.sjdr")
public Object getRow(@Param("file") TempFile tempFile,@Param(value = "year",required = false) String year) {
try {
if (tempFile == null) {
return Result.error("文件为空!");
}
List<NutMap> result = new ArrayList<>();
InputStream fileInputStream = tempFile.getInputStream();
String suffixName = tempFile.getSubmittedFileName().substring(tempFile.getSubmittedFileName().lastIndexOf(".")).toLowerCase();
if (suffixName.equals(".xls")) {
HSSFWorkbook hssfWorkbook = new HSSFWorkbook(fileInputStream);
//2.获取要解析的表格(第一个表格)
HSSFSheet sheet = hssfWorkbook.getSheetAt(0);
//获得最后一行的行号
int lastRowNum = sheet.getLastRowNum();
for (int i = 1; i <= lastRowNum; i++) {//遍历每一行
//3.获得要解析的行
HSSFRow row = sheet.getRow(i);
String unitname = null;
String loginname = null;
String username = null;
String sex = null;
String jtzz = null;
String lxfs = null;
String zyzkyybz = null;
Integer jtrs = null;
Integer brnzsr = null;
Integer jtnzsr = null;
String jb = null;
//4.获得每个单元格中的内容(String)
HSSFCell cell1 = row.getCell(1);
HSSFCell cell2 = row.getCell(2);
HSSFCell cell3 = row.getCell(3);
HSSFCell cell4 = row.getCell(4);
HSSFCell cell5 = row.getCell(5);
HSSFCell cell6 = row.getCell(6);
HSSFCell cell7 = row.getCell(7);
HSSFCell cell8 = row.getCell(8);
HSSFCell cell9 = row.getCell(9);
HSSFCell cell10 = row.getCell(10);
HSSFCell cell11 = row.getCell(11);
if (cell1 != null) {
cell1.setCellType(CellType.STRING);
unitname = cell1.getStringCellValue();
}
if (cell2 != null) {
cell2.setCellType(CellType.STRING);
loginname = cell2.getStringCellValue();
}
if (cell3 != null) {
cell3.setCellType(CellType.STRING);
username = cell3.getStringCellValue();
}
if (cell4 != null) {
cell4.setCellType(CellType.STRING);
sex = cell4.getStringCellValue();
}
if (cell5 != null) {
cell5.setCellType(CellType.STRING);
jtzz = cell5.getStringCellValue();
}
if (cell6 != null) {
cell6.setCellType(CellType.STRING);
lxfs = cell6.getStringCellValue();
}
if (cell7 != null) {
cell7.setCellType(CellType.STRING);
zyzkyybz = cell7.getStringCellValue();
}
if (cell8 != null) {
cell8.setCellType(CellType.STRING);
jtrs = Strings.isBlank(cell8.getStringCellValue()) ? null : Integer.parseInt(cell8.getStringCellValue());
}
if (cell9 != null) {
cell9.setCellType(CellType.STRING);
brnzsr = Strings.isBlank(cell9.getStringCellValue()) ? null : Integer.parseInt(cell9.getStringCellValue());
}
if (cell10 != null) {
cell10.setCellType(CellType.STRING);
jtnzsr = Strings.isBlank(cell10.getStringCellValue()) ? null : Integer.parseInt(cell10.getStringCellValue());
}
if (cell11 != null) {
cell11.setCellType(CellType.STRING);
jb = cell11.getStringCellValue();
}
Sql sql = Sqls.create("SELECT u.*,un.`name` unitname from sys_user u left join sys_unit un on u.unitid = un.id WHERE u.loginname = @loginname LIMIT 1").setParam("loginname", loginname);
List<Record> list = sysUserService.list(sql);
if (list.size() > 0) {
Record record = list.get(0);
NutMap map = new NutMap();
map.setv("sqr", record == null ? "" : record.getString("id"));
map.setv("unitname", record == null ? "" : record.getString("unitname"));
map.setv("loginname", loginname == null ? "" : loginname);
map.setv("username", record == null ? "" : record.getString("username"));
map.setv("sex", sex == null ? "" : sex);
map.setv("jtzz", jtzz == null ? "" : jtzz);
map.setv("lxfs", lxfs == null ? "" : lxfs);
map.setv("zyzkyybz", zyzkyybz == null ? "" : zyzkyybz);
map.setv("jtrs", jtrs);
map.setv("brnzsr", brnzsr);
map.setv("jtnzsr", jtnzsr);
map.setv("jb", jb == null ? "" : jb);
result.add(map);
}
}
} else if (suffixName.equals(".xlsx")) {
XSSFWorkbook xssfWorkbook = new XSSFWorkbook(fileInputStream);
//2.获取要解析的表格(第一个表格)
XSSFSheet sheet = xssfWorkbook.getSheetAt(0);
//获得最后一行的行号
int lastRowNum = sheet.getLastRowNum();
for (int i = 1; i <= lastRowNum; i++) {//遍历每一行
//3.获得要解析的行
XSSFRow row = sheet.getRow(i);
String unitname = null;
String loginname = null;
String username = null;
String sex = null;
String jtzz = null;
String lxfs = null;
String zyzkyybz = null;
Integer jtrs = null;
Integer brnzsr = null;
Integer jtnzsr = null;
String jb = null;
//4.获得每个单元格中的内容(String)
XSSFCell cell1 = row.getCell(1);
XSSFCell cell2 = row.getCell(2);
XSSFCell cell3 = row.getCell(3);
XSSFCell cell4 = row.getCell(4);
XSSFCell cell5 = row.getCell(5);
XSSFCell cell6 = row.getCell(6);
XSSFCell cell7 = row.getCell(7);
XSSFCell cell8 = row.getCell(8);
XSSFCell cell9 = row.getCell(9);
XSSFCell cell10 = row.getCell(10);
XSSFCell cell11 = row.getCell(11);
if (cell1 != null) {
cell1.setCellType(CellType.STRING);
unitname = cell1.getStringCellValue();
}
if (cell2 != null) {
cell2.setCellType(CellType.STRING);
loginname = cell2.getStringCellValue();
}
if (cell3 != null) {
cell3.setCellType(CellType.STRING);
username = cell3.getStringCellValue();
}
if (cell4 != null) {
cell4.setCellType(CellType.STRING);
sex = cell4.getStringCellValue();
}
if (cell5 != null) {
cell5.setCellType(CellType.STRING);
jtzz = cell5.getStringCellValue();
}
if (cell6 != null) {
cell6.setCellType(CellType.STRING);
lxfs = cell6.getStringCellValue();
}
if (cell7 != null) {
cell7.setCellType(CellType.STRING);
zyzkyybz = cell7.getStringCellValue();
}
if (cell8 != null) {
cell8.setCellType(CellType.STRING);
jtrs = Strings.isBlank(cell8.getStringCellValue()) ? null : Integer.parseInt(cell8.getStringCellValue());
}
if (cell9 != null) {
cell9.setCellType(CellType.STRING);
brnzsr = Strings.isBlank(cell9.getStringCellValue()) ? null : Integer.parseInt(cell9.getStringCellValue());
}
if (cell10 != null) {
cell10.setCellType(CellType.STRING);
jtnzsr = Strings.isBlank(cell10.getStringCellValue()) ? null : Integer.parseInt(cell10.getStringCellValue());
}
if (cell11 != null) {
cell11.setCellType(CellType.STRING);
jb = cell11.getStringCellValue();
}
Sql sql = Sqls.create("SELECT u.*,un.`name` unitname from sys_user u left join sys_unit un on u.unitid = un.id WHERE u.loginname = @loginname LIMIT 1").setParam("loginname", loginname);
List<Record> list = sysUserService.list(sql);
if (list.size() > 0) {
Record record = list.get(0);
NutMap map = new NutMap();
map.setv("sqr", record == null ? "" : record.getString("id"));
map.setv("unitname", record == null ? "" : record.getString("unitname"));
map.setv("loginname", loginname == null ? "" : loginname);
map.setv("username", record == null ? "" : record.getString("username"));
map.setv("sex", sex == null ? "" : sex);
map.setv("jtzz", jtzz == null ? "" : jtzz);
map.setv("lxfs", lxfs == null ? "" : lxfs);
map.setv("zyzkyybz", zyzkyybz == null ? "" : zyzkyybz);
map.setv("jtrs", jtrs);
map.setv("brnzsr", brnzsr);
map.setv("jtnzsr", jtnzsr);
map.setv("jb", jb == null ? "" : jb);
result.add(map);
}
}
} else {
return Result.error("文件类型不对!必须为excel表格!");
}
return Result.success().addData(result);
} catch (Exception e) {
e.printStackTrace();
return Result.error();
}
}
@At
@Ok("json")
@RequiresPermissions("zgfw.knbf.sjdr")
public Object write(Zgfw_knbf[] zgfw_knbfs, String sqsj) {
try {
if (Strings.isBlank(sqsj)) {
throw new RuntimeException();
}
for (Zgfw_knbf zgfw_knbf : zgfw_knbfs) {
zgfw_knbf.setZyzkyy("[]");
zgfw_knbf.setJtfc("[]");
zgfw_knbf.setJtcc("[]");
zgfw_knbf.setZt(600);
zgfw_knbf.setSqsj(DateUtil.getDate());
zgfwKnbfService.insert(zgfw_knbf);
}
return Result.success();
} catch (Exception e) {
return Result.error();
}
}
}
@@ -1,6 +1,5 @@
package io.v.nutz.zhgh.zgfw.handler.difficult; package io.v.nutz.zhgh.zgfw.handler.difficult;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.base.utils.ViResource; import io.v.nutz.base.utils.ViResource;
import io.v.nutz.sys.services.SysLocalProcessService; import io.v.nutz.sys.services.SysLocalProcessService;
import io.v.nutz.sys.services.impl.SysLocalProcessServiceImpl; import io.v.nutz.sys.services.impl.SysLocalProcessServiceImpl;
@@ -24,7 +23,7 @@ public enum DifficultToDoHandler {
START_PROCESS(){ START_PROCESS(){
@Override @Override
public void exec(Zgfw_knbf knbf) { public void exec(Zgfw_knbf knbf) {
Sql sql = Sqls.fetchString(Sqls.create("select username from sys_user where id = @id").setParam("id", knbf.getSqr()).toString()); Sql sql = Sqls.fetchString(Sqls.create("select username from sys_user where id = @id").setParam("id", knbf.getUserId()).toString());
dao.execute(sql); dao.execute(sql);
String username = sql.getString(); String username = sql.getString();
@@ -32,9 +31,9 @@ public enum DifficultToDoHandler {
"【困难帮扶】" + username, "【困难帮扶】" + username,
"zgfw_knbf@" + knbf.getId(), "zgfw_knbf@" + knbf.getId(),
"", "",
knbf.getSqr(), knbf.getUserId(),
"/platform/fw/difficulty/applylist", "/platform/difficulty/applylist",
"/platform/fw/difficulty/applylist" "/platform/difficulty/applylist"
); );
} }
}, },
@@ -45,7 +44,7 @@ public enum DifficultToDoHandler {
CREATE_APPLY_RE_MODIFY_TASK(){ CREATE_APPLY_RE_MODIFY_TASK(){
@Override @Override
public void exec(Zgfw_knbf knbf) { public void exec(Zgfw_knbf knbf) {
Sql sql = Sqls.fetchString(Sqls.create("select loginname from sys_user where id = @id").setParam("id", knbf.getSqr()).toString()); Sql sql = Sqls.fetchString(Sqls.create("select loginname from sys_user where id = @id").setParam("id", knbf.getUserId()).toString());
dao.execute(sql); dao.execute(sql);
String loginname = sql.getString(); String loginname = sql.getString();
@@ -55,10 +54,10 @@ public enum DifficultToDoHandler {
"退回重新修改", "退回重新修改",
ShiroUtil.getUserId(), ShiroUtil.getUserId(),
List.of(loginname), List.of(loginname),
"/platform/fw/difficulty/applylist", "/platform/difficulty/applylist",
"/platform/fw/difficulty/applylist", "/platform/difficulty/applylist",
"/platform/fw/difficulty/applylist", "/platform/difficulty/applylist",
"/platform/fw/difficulty/applylist" "/platform/difficulty/applylist"
); );
} }
}, },
@@ -85,17 +84,17 @@ public enum DifficultToDoHandler {
CREATE_UNION_TASK(){ CREATE_UNION_TASK(){
@Override @Override
public void exec(Zgfw_knbf knbf) { public void exec(Zgfw_knbf knbf) {
List<String> unionLeader = zgfwKnbfService.getUnionLeader(knbf.getSqr()); List<String> unionLeader = zgfwKnbfService.getUnionLeader(knbf.getUserId());
localProcessService.createTask( localProcessService.createTask(
"zgfw_knbf@" + knbf.getId(), "zgfw_knbf@" + knbf.getId(),
"union_president_audit", "branchUnionAudit",
"分工会审核", "分工会审核",
ShiroUtil.getUserId(), ShiroUtil.getUserId(),
unionLeader, unionLeader,
"/platform/fw/difficulty/unionchairman", "/platform/difficulty/branchUnionAudit",
"/platform/fw/difficulty/unionchairman", "/platform/difficulty/branchUnionAudit",
"/platform/fw/difficulty/unionchairman", "/platform/difficulty/branchUnionAudit",
"/platform/fw/difficulty/unionchairman" "/platform/difficulty/branchUnionAudit"
); );
localProcessService.updateProcessNodeName("zgfw_knbf@" + knbf.getId(), "分工会审核"); localProcessService.updateProcessNodeName("zgfw_knbf@" + knbf.getId(), "分工会审核");
} }
@@ -108,7 +107,7 @@ public enum DifficultToDoHandler {
@Override @Override
public void exec(Zgfw_knbf knbf) { public void exec(Zgfw_knbf knbf) {
localProcessService.completeTask( localProcessService.completeTask(
"union_president_audit", "branchUnionAudit",
"zgfw_knbf@" + knbf.getId(), "zgfw_knbf@" + knbf.getId(),
ShiroUtil.getUserId(), ShiroUtil.getUserId(),
"" ""
@@ -117,36 +116,36 @@ public enum DifficultToDoHandler {
}, },
/** /**
* 创建财务任务 * 创建校工会初审任务
*/ */
CREATE_FINANCE_TASK(){ CREATE_FINANCE_TASK(){
@Override @Override
public void exec(Zgfw_knbf knbf) { public void exec(Zgfw_knbf knbf) {
List<String> schoolUnionAccountant = Vi.getSchoolUnionAccountant(); List<String> list = zgfwKnbfService.getSchoolUnionDifficultyAdmin();
localProcessService.createTask( localProcessService.createTask(
"zgfw_knbf@" + knbf.getId(), "zgfw_knbf@" + knbf.getId(),
"two_dzz_audit", "schoolUnionInitialAudit",
"财务审核", "校工会初审",
ShiroUtil.getUserId(), ShiroUtil.getUserId(),
schoolUnionAccountant, list,
"/platform/fw/difficulty/twoOrganization", "/platform/difficulty/schoolUnionInitialAudit",
"/platform/fw/difficulty/twoOrganization", "/platform/difficulty/schoolUnionInitialAudit",
"/platform/fw/difficulty/twoOrganization", "/platform/difficulty/schoolUnionInitialAudit",
"/platform/fw/difficulty/twoOrganization" "/platform/difficulty/schoolUnionInitialAudit"
); );
localProcessService.updateProcessNodeName("zgfw_knbf@" + knbf.getId(), "财务审核"); localProcessService.updateProcessNodeName("zgfw_knbf@" + knbf.getId(), "校工会初审");
} }
}, },
/** /**
* 财务完成 * 校工会初审任务完成
*/ */
COMPLETE_FINANCE_TASK(){ COMPLETE_FINANCE_TASK(){
@Override @Override
public void exec(Zgfw_knbf knbf) { public void exec(Zgfw_knbf knbf) {
localProcessService.completeTask( localProcessService.completeTask(
"two_dzz_audit", "schoolUnionInitialAudit",
"zgfw_knbf@" + knbf.getId(), "zgfw_knbf@" + knbf.getId(),
ShiroUtil.getUserId(), ShiroUtil.getUserId(),
"" ""
@@ -163,14 +162,14 @@ public enum DifficultToDoHandler {
List<String> list = zgfwKnbfService.getSchoolUnionDifficultyAdmin(); List<String> list = zgfwKnbfService.getSchoolUnionDifficultyAdmin();
localProcessService.createTask( localProcessService.createTask(
"zgfw_knbf@" + knbf.getId(), "zgfw_knbf@" + knbf.getId(),
"school_standing_audit", "schoolUnionFinalAudit",
"校工会审核", "工会常委会审核",
ShiroUtil.getUserId(), ShiroUtil.getUserId(),
list, list,
"/platform/fw/difficulty/schoolmanager", "/platform/difficulty/schoolUnionFinalAudit",
"/platform/fw/difficulty/schoolmanager", "/platform/difficulty/schoolUnionFinalAudit",
"/platform/fw/difficulty/schoolmanager", "/platform/difficulty/schoolUnionFinalAudit",
"/platform/fw/difficulty/schoolmanager" "/platform/difficulty/schoolUnionFinalAudit"
); );
localProcessService.updateProcessNodeName("zgfw_knbf@" + knbf.getId(), "校工会审核"); localProcessService.updateProcessNodeName("zgfw_knbf@" + knbf.getId(), "校工会审核");
@@ -184,7 +183,7 @@ public enum DifficultToDoHandler {
@Override @Override
public void exec(Zgfw_knbf knbf) { public void exec(Zgfw_knbf knbf) {
localProcessService.completeTask( localProcessService.completeTask(
"school_standing_audit", "schoolUnionFinalAudit",
"zgfw_knbf@" + knbf.getId(), "zgfw_knbf@" + knbf.getId(),
ShiroUtil.getUserId(), ShiroUtil.getUserId(),
"" ""
@@ -200,10 +199,15 @@ public enum DifficultToDoHandler {
public void exec(Zgfw_knbf knbf) { public void exec(Zgfw_knbf knbf) {
localProcessService.completeProcess("zgfw_knbf@" + knbf.getId()); localProcessService.completeProcess("zgfw_knbf@" + knbf.getId());
} }
},
DELETE_PROCESS(){
@Override
public void exec(Zgfw_knbf knbf) {
localProcessService.deleteProcessInstance("zgfw_knbf@" + knbf.getId());
}
}; };
public abstract void exec(Zgfw_knbf knbf); public abstract void exec(Zgfw_knbf knbf);
public Dao dao = ViResource.dao; public Dao dao = ViResource.dao;
public ZgfwKnbfService zgfwKnbfService = ViResource.ioc.get(ZgfwKnbfServiceImpl.class); public ZgfwKnbfService zgfwKnbfService = ViResource.ioc.get(ZgfwKnbfServiceImpl.class);
@@ -1,6 +1,8 @@
package io.v.nutz.zhgh.zgfw.model.difficult; package io.v.nutz.zhgh.zgfw.model.difficult;
import cn.hutool.json.JSONObject;
import io.v.nutz.base.model.Audit;
import io.v.nutz.sys.models.Sys_file; import io.v.nutz.sys.models.Sys_file;
import lombok.Data; import lombok.Data;
import org.nutz.dao.DB; import org.nutz.dao.DB;
@@ -8,6 +10,7 @@ import org.nutz.dao.entity.annotation.*;
import org.nutz.integration.json4excel.annotation.J4EIgnore; import org.nutz.integration.json4excel.annotation.J4EIgnore;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date;
import java.util.List; import java.util.List;
/** /**
@@ -30,43 +33,43 @@ public class Zgfw_knbf implements Serializable {
@Column @Column
@Comment("申请时间") @Comment("申请时间")
@ColDefine(type = ColType.VARCHAR, width = 20) @ColDefine(type = ColType.DATETIME)
private String sqsj; private Date applyTime;
@Column @Column
@Comment("申请模式") @Comment("申请模式")
@ColDefine(type = ColType.VARCHAR, width = 20) @ColDefine(type = ColType.VARCHAR, width = 20)
private String apply_mode; private String mode;
@Column
@Comment("填写人id")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String proxyUserId;
@Column
@Comment("填写人姓名")
@ColDefine(type = ColType.VARCHAR, width = 100)
private String proxyUserName;
@Column
@Comment("填写人工号")
@ColDefine(type = ColType.VARCHAR, width = 100)
private String proxyLoginName;
@Column @Column
@Comment("申请人id") @Comment("申请人id")
@ColDefine(type = ColType.VARCHAR, width = 32) @ColDefine(type = ColType.VARCHAR, width = 32)
private String sqr; private String userId;
@Column @Column
@Comment("受补助人id") @Comment("申请人姓名")
@ColDefine(type = ColType.VARCHAR, width = 32) @ColDefine(type = ColType.VARCHAR, width = 100)
private String bbzrusername; private String userName;
@Column @Column
@Comment("身份证") @Comment("申请人工号")
@ColDefine(type = ColType.VARCHAR, width = 20) @ColDefine(type = ColType.VARCHAR, width = 100)
private String idcard; private String loginName;
@Column
@Comment("民族")
@ColDefine(type = ColType.VARCHAR, width = 10)
private String mz;
@Column
@Comment("政治面貌")
@ColDefine(type = ColType.VARCHAR, width = 10)
private String zzmm;
@Column
@Comment("生日")
@ColDefine(type = ColType.VARCHAR, width = 20)
private String birthday;
@Column @Column
@Comment("性别") @Comment("性别")
@@ -74,196 +77,94 @@ public class Zgfw_knbf implements Serializable {
private String sex; private String sex;
@Column @Column
@Comment("职称") @Comment("单位")
@ColDefine(type = ColType.VARCHAR, width = 50) @ColDefine(type = ColType.VARCHAR, width = 32)
private String zc; private String unitId;
@Column @Column
@Comment("职务") @Comment("单位名称")
@ColDefine(type = ColType.VARCHAR, width = 50) @ColDefine(type = ColType.VARCHAR, width = 500)
private String zw; private String unitName;
@Column @Column
@Comment("人事编制") @Comment("分工会id")
@ColDefine(type = ColType.VARCHAR, width = 50) @ColDefine(type = ColType.VARCHAR, width = 32)
private String rsbz; private String unionId;
@Column @Column
@Comment("参加工作时间") @Comment("工会名称")
@ColDefine(type = ColType.VARCHAR, width = 50) @ColDefine(type = ColType.VARCHAR, width = 500)
private String cjgzsj; private String unionName;
@Column @Column
@Comment("医保状况") @Comment("月收入")
@ColDefine(type = ColType.VARCHAR, width = 50) @ColDefine(type = ColType.VARCHAR, width = 10)
private String ybzk; private String monthlyIncome;
@Column @Column
@Comment("联系方式") @Comment("出生日期")
@ColDefine(type = ColType.VARCHAR, width = 100) @ColDefine(type = ColType.DATE)
private String lxfs; private Date birthday;
@Column @Column
@Comment("本人年总收入") @Comment("联系电话")
@ColDefine(type = ColType.INT) @ColDefine(type = ColType.VARCHAR, width = 20)
private Integer brnzsr; private String mobile;
@Column
@Comment("家庭年总收入")
@ColDefine(type = ColType.INT)
private Integer jtnzsr;
@Column
@Comment("家庭人数")
@ColDefine(type = ColType.INT)
private Integer jtrs;
@Column
@Comment("现住房类型")
@ColDefine(type = ColType.VARCHAR, width = 50)
private String xzflx;
@Column
@Comment("建筑面积 m*m")
@ColDefine(type = ColType.INT)
private Integer jzmj;
@Column
@Comment("家庭房产 (json)")
@ColDefine(type = ColType.TEXT)
private String jtfc;
@Column @Column
@Comment("家庭住址") @Comment("家庭住址")
@ColDefine(type = ColType.VARCHAR, width = 200) @ColDefine(type = ColType.VARCHAR, width = 200)
private String jtzz; private String homeAddress;
@Column @Column
@Comment("婚姻状态") @Comment("补助标准")
@ColDefine(type = ColType.VARCHAR, width = 20)
private String hyzt;
@Column
@Comment("家庭车产 (json)")
@ColDefine(type = ColType.TEXT)
private String jtcc;
@Column
@Comment("所在医院")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String hospital;
@Column
@Comment("住院时间")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String hospitalized_time;
@Column
@Comment("银行名称")
@ColDefine(type = ColType.VARCHAR, width = 100)
private String yhmc;
@Column
@Comment("银行卡号")
@ColDefine(type = ColType.VARCHAR, width = 30)
private String yhkh;
@Column
@Comment("科室班组")
@ColDefine(type = ColType.VARCHAR, width = 30)
private String sq_ksbz;
@Column
@Comment("主要致困原因(json 多选)")
@ColDefine(type = ColType.VARCHAR, width = 100)
private String zyzkyy;
@Column
@Comment("主要致困原因备注")
@ColDefine(type = ColType.VARCHAR, width = 500) @ColDefine(type = ColType.VARCHAR, width = 500)
private String zyzkyybz; private String subsidyStandards;
@Column
@Comment("家庭成员")
@ColDefine(type = ColType.MYSQL_JSON)
private List<JSONObject> familyList;
@Column @Column
@Comment("申请理由") @Comment("申请理由")
@ColDefine(type = ColType.VARCHAR, width = 500) @ColDefine(type = ColType.VARCHAR, width = 500)
private String apply_reason; private String reason;
@Column @Column
@Comment("补助类型") @Comment("备注")
@ColDefine(type = ColType.VARCHAR, width = 4) @ColDefine(type = ColType.VARCHAR, width = 500)
private String sq_bzlx; private String remarks;
@Column
@Comment("困难类型")
@ColDefine(type = ColType.VARCHAR, width = 4)
private String sq_knlx;
@Column @Column
@Comment("附件") @Comment("附件")
@ColDefine(type = ColType.VARCHAR, width = 500) @ColDefine(type = ColType.MYSQL_JSON)
private List<Sys_file> files; private List<Sys_file> files;
@Many(field = "sqid") @Column
private List<Zgfw_knbf_jtcy> jtcys; @Comment("申请人签字")
@ColDefine(type = ColType.VARCHAR, width = 500)
private String signature;
@Column @Column
@Comment("申请人签字 对应id") @Comment("分工会审核记录id")
@ColDefine(type = ColType.VARCHAR, width = 32) @ColDefine(type = ColType.VARCHAR, width = 32)
private String applicantsign; private String branchUnionAuditId;
@Column @Column
@Comment("工会主席审核记录 id") @Comment("校工会初审审核记录id")
@ColDefine(type = ColType.VARCHAR, width = 32) @ColDefine(type = ColType.VARCHAR, width = 32)
private String union_president_audit; private String schoolUnionInitialAuditId;
@Column @Column
@Comment("校工会经办人审核记录 id") @Comment("工会常委会审核记录id")
@ColDefine(type = ColType.VARCHAR, width = 32) @ColDefine(type = ColType.VARCHAR, width = 32)
private String school_manager_audit; private String schoolUnionFinalAuditId;
@Column @Column
@Comment("校工会副主席审核记录 id") @Comment("状态")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String school_vice_chairman_audit;
@Column
@Comment("校工会审核记录id")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String school_union_audit;
@Column
@Comment("二级党组织审核记录id")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String two_dzz_audit;
@Column
@Comment("校工会常务副主席审核记录id")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String school_standing_audit;
@Column
@Comment("级别")
@ColDefine(type = ColType.VARCHAR, width = 10)
private String jb;
@Column
@Comment("补助金额")
@ColDefine(type = ColType.VARCHAR, width = 10)
private String xghbzje;
@Column
@Comment("上级工会补助金额")
@ColDefine(type = ColType.VARCHAR, width = 20)
private String sjghbzje;
@Column
@Comment("状态(100 待工会主席审核 150 工会主席不通过 200 校工会经办人审核 250 校工会经办人不通过 300 待校工会副主席审核 350 校工会副主席不通过 400 校工会常务副主席审核 450 校工会常务副主席不通过 500待校工会审核 550校工会主席不通过 600 通过)")
@ColDefine(type = ColType.INT, width = 4) @ColDefine(type = ColType.INT, width = 4)
private Integer zt; private Integer stateId;
@Column @Column
@Comment("单据号") @Comment("单据号")
@@ -272,4 +173,15 @@ public class Zgfw_knbf implements Serializable {
}) })
private Integer document_no; private Integer document_no;
@One(field = "branchUnionAuditId")
private Audit branchUnionAudit;
@One(field = "schoolUnionInitialAuditId")
private Audit schoolUnionInitialAudit;
@One(field = "schoolUnionFinalAuditId")
private Audit schoolUnionFinalAudit;
private boolean isSelf;
} }
@@ -1,192 +1,191 @@
<template> <template>
<div style="padding-bottom: 20px;"> <div style="padding-bottom: 20px">
<van-form readonly input-align="right">
<div class="van-cell-group__title">
<div class="van-sidebar-item van-sidebar-item--select">申请信息</div>
</div>
<van-cell-group>
<van-field readonly :value="viewData.manager_name" label="申请人"></van-field>
<!-- <van-field readonly :value="viewData.apply_time" label="申请时间"></van-field>-->
<van-field readonly :value="viewData.be_username" label="慰问对象"></van-field>
<van-field readonly :value="viewData.typename" name="type" label="慰问类型"></van-field>
<van-field readonly :value="viewData.money" type="number" label="慰问金额"></van-field>
<van-field readonly :value="viewData.way" name="way" label="慰问方式"></van-field>
<van-field readonly :value="viewData.occur_time" name="occur_time" label="慰问时间"></van-field>
<van-field
readonly
:value="viewData.birth_child_num"
name="birth_child_num"
v-if="viewData.type === '2'"
label="生育孩次"
></van-field>
<template v-if="viewData.type === '3' || viewData.type === '4'">
<van-field readonly :value="viewData.the_hospital" name="the_hospital" label="治疗医院"></van-field>
<van-field readonly :value="viewData.the_hospital_house_num" name="the_hospital_house_num" label="病房号"></van-field>
<van-field readonly :value="viewData.the_hospital_house_bed_num" name="the_hospital_house_bed_num" label="床号"></van-field>
<van-field readonly :value="viewData.hospital_by" name="hospital_by" v-if="viewData.type === '4'" label="患病病种"></van-field>
</template>
<van-field
readonly
:value="viewData.deadImmediateFamily"
name="deadImmediateFamily"
v-if="viewData.type === '6'"
label="直系亲属"
></van-field>
<van-field
readonly
:value="viewData.remark"
label="申请事由"
input-align="left"
style="flex-flow: column"
rows="2"
maxlength="200"
type="textarea"
show-word-limit
autosize
></van-field>
<van-field label="附件" style="flex-flow: column" input-align="left">
<template #label>
<div class="mb10">附&emsp;&emsp;件</div>
</template>
<template #input>
<vant-file-upload
:files.sync="viewData.files"
view
:del="false"
v-if="viewData.files && viewData.files.length"
></vant-file-upload>
<span v-else>暂无</span>
</template>
</van-field>
<van-form readonly input-align="right"> <van-field name="sign" label="签字">
<div class="van-cell-group__title"> <template #input>
<div class="van-sidebar-item van-sidebar-item--select"> <van-image width="200" height="100" :src="viewData.manager_sign_data" v-if="viewData.manager_sign_data" />
申请信息 <span v-else>暂无</span>
</div> </template>
</div> </van-field>
<van-cell-group> </van-cell-group>
<van-field readonly :value="viewData.manager_name" label="申请人"></van-field> </van-form>
<van-field readonly :value="viewData.apply_time" label="申请时间"></van-field>
<van-field readonly :value="viewData.be_username" label="慰问对象"></van-field> <template v-if="viewData.ucr">
<van-field readonly :value="viewData.typename" name="type" label="慰问类型"></van-field> <div class="van-cell-group__title mt20">
<van-field readonly :value="viewData.money" type="number" label="慰问金额"></van-field> <div class="van-sidebar-item van-sidebar-item--select">分工会审核信息</div>
<van-field readonly :value="viewData.way" name="way" label="慰问方式"></van-field> </div>
<van-field readonly :value="viewData.occur_time" name="occur_time" label="慰问时间"></van-field> <van-cell-group>
<van-field readonly :value="viewData.birth_child_num" name="birth_child_num" v-if="viewData.type === '2'" label="生育孩次"></van-field> <div style="padding-left: 16px">
<template v-if="viewData.type === '3' || viewData.type === '4'"> <van-field label="审&ensp;核&ensp;人" :value="viewData.ucr.username" left-icon="contact" readonly></van-field>
<van-field readonly :value="viewData.the_hospital" name="the_hospital" label="治疗医院"></van-field> <van-field label="审核时间" :value="viewData.ucr.time" left-icon="clock-o" readonly></van-field>
<van-field readonly :value="viewData.the_hospital_house_num" name="the_hospital_house_num" label="病房号"></van-field> <van-field label="审核意见" left-icon="chat-o" :value="viewData.ucr.opinion ? viewData.ucr.opinion : '暂无'" readonly></van-field>
<van-field readonly :value="viewData.the_hospital_house_bed_num" name="the_hospital_house_bed_num" label="床号"></van-field> <van-field name="sign" label="签字">
<van-field readonly :value="viewData.hospital_by" name="hospital_by" v-if="viewData.type === '4'" label="患病病种"></van-field> <template #input>
<van-image width="200" height="100" :src="viewData.ucr.sign" v-if="viewData.ucr.sign" />
<span v-else>暂无</span>
</template>
</van-field>
</div>
</van-cell-group>
</template> </template>
<van-field readonly :value="viewData.deadImmediateFamily" name="deadImmediateFamily" v-if="viewData.type === '6'" label="直系亲属"></van-field>
<van-field readonly :value="viewData.remark" label="申请事由"
input-align="left"
style="flex-flow: column"
rows="2" maxlength="200" type="textarea" show-word-limit autosize></van-field>
<van-field label="附件" style="flex-flow: column" input-align="left">
<template #label>
<div class="mb10">附&emsp;&emsp;件</div>
</template>
<template #input>
<vant-file-upload :files.sync="viewData.files" view :del="false"
v-if="viewData.files&&viewData.files.length"></vant-file-upload>
<span v-else>暂无</span>
</template>
</van-field>
<van-field name="sign" label="签字"> <template v-if="viewData.fr">
<template #input> <div class="van-cell-group__title mt20">
<van-image width="200" height="100" :src="viewData.manager_sign_data" <div class="van-sidebar-item van-sidebar-item--select">校工会审核信息</div>
v-if="viewData.manager_sign_data"/> </div>
<span v-else>暂无</span> <van-cell-group>
</template> <div style="padding-left: 16px">
</van-field> <van-field label="审&ensp;核&ensp;人" :value="viewData.fr.username" left-icon="contact" readonly></van-field>
</van-cell-group> <van-field label="审核时间" :value="viewData.fr.time" left-icon="clock-o" readonly></van-field>
</van-form> <van-field label="审核意见" left-icon="chat-o" :value="viewData.fr.opinion ? viewData.fr.opinion : '暂无'" readonly></van-field>
<van-field name="sign" label="签字">
<template #input>
<van-image width="200" height="100" :src="viewData.fr.sign" v-if="viewData.fr.sign" />
<span v-else>暂无</span>
</template>
</van-field>
</div>
</van-cell-group>
</template>
<template v-if="viewData.ucr"> <template v-if="viewData.vcr">
<div class="van-cell-group__title mt20"> <div class="van-cell-group__title mt20">
<div class="van-sidebar-item van-sidebar-item--select"> <div class="van-sidebar-item van-sidebar-item--select">校工会主席审核信息</div>
分工会审核信息 </div>
</div> <van-cell-group>
</div> <div style="padding-left: 16px">
<van-cell-group> <van-field label="审&ensp;核&ensp;人" :value="viewData.vcr.username" left-icon="contact" readonly></van-field>
<div style="padding-left: 16px"> <van-field label="审核时间" :value="viewData.vcr.time" left-icon="clock-o" readonly></van-field>
<van-field label="审&ensp;核&ensp;人" :value="viewData.ucr.username" left-icon="contact" <van-field label="审核意见" left-icon="chat-o" :value="viewData.vcr.opinion ? viewData.vcr.opinion : '暂无'" readonly></van-field>
readonly></van-field> <van-field name="sign" label="签字">
<van-field label="审核时间" :value="viewData.ucr.time" left-icon="clock-o" <template #input>
readonly></van-field> <van-image width="200" height="100" :src="viewData.vcr.sign" v-if="viewData.vcr.sign" />
<van-field label="审核意见" left-icon="chat-o" <span v-else>暂无</span>
:value="viewData.ucr.opinion ? viewData.ucr.opinion : '暂无'" </template>
readonly></van-field> </van-field>
<van-field name="sign" label="签字"> </div>
<template #input> </van-cell-group>
<van-image width="200" height="100" :src="viewData.ucr.sign" </template>
v-if="viewData.ucr.sign"/>
<span v-else>暂无</span>
</template>
</van-field>
</div>
</van-cell-group>
</template>
<template v-if="viewData.fr"> <template v-if="handle">
<div class="van-cell-group__title mt20"> <slot name="handle"></slot>
<div class="van-sidebar-item van-sidebar-item--select"> </template>
校工会审核信息 </div>
</div>
</div>
<van-cell-group>
<div style="padding-left: 16px">
<van-field label="审&ensp;核&ensp;人" :value="viewData.fr.username" left-icon="contact"
readonly></van-field>
<van-field label="审核时间" :value="viewData.fr.time" left-icon="clock-o"
readonly></van-field>
<van-field label="审核意见" left-icon="chat-o"
:value="viewData.fr.opinion ? viewData.fr.opinion : '暂无'"
readonly></van-field>
<van-field name="sign" label="签字">
<template #input>
<van-image width="200" height="100" :src="viewData.fr.sign"
v-if="viewData.fr.sign"/>
<span v-else>暂无</span>
</template>
</van-field>
</div>
</van-cell-group>
</template>
<template v-if="viewData.vcr">
<div class="van-cell-group__title mt20">
<div class="van-sidebar-item van-sidebar-item--select">
校工会主席审核信息
</div>
</div>
<van-cell-group>
<div style="padding-left: 16px">
<van-field label="审&ensp;核&ensp;人" :value="viewData.vcr.username" left-icon="contact"
readonly></van-field>
<van-field label="审核时间" :value="viewData.vcr.time" left-icon="clock-o"
readonly></van-field>
<van-field label="审核意见" left-icon="chat-o"
:value="viewData.vcr.opinion ? viewData.vcr.opinion : '暂无'"
readonly></van-field>
<van-field name="sign" label="签字">
<template #input>
<van-image width="200" height="100" :src="viewData.vcr.sign"
v-if="viewData.vcr.sign"/>
<span v-else>暂无</span>
</template>
</van-field>
</div>
</van-cell-group>
</template>
<template v-if="handle">
<slot name="handle"></slot>
</template>
</div>
</template> </template>
<script> <script>
module.exports = { module.exports = {
props: { props: {
handle: { handle: {
type: Boolean, type: Boolean,
default: false, default: false
},
title: {
type: String,
default: "审核"
},
id: {
type: String,
default: ""
}
}, },
title: { data() {
type: String, return {
default: '审核' viewData: {}
}
}, },
id: { components: {
type: String, "vant-file-upload": httpVueLoader("/components/plugins/VantFileUpload.vue")
default: ''
}, },
}, methods: {
data() { async getInfo(id) {
return { const { data, code, msg } = await $.get("/platform/fw/condolence/findOne", { id })
viewData: {}, if (data) {
condolence.toFormData(data)
this.viewData = data
this.viewData.hospital_stay = data.starting_time + "-" + data.end_time
} else {
this.viewData = {}
this.$toast.fail("获取信息失败")
}
}
},
async created() {
if (this.id) {
await this.getInfo(this.id)
}
} }
},
components: {
'vant-file-upload': httpVueLoader('/components/plugins/VantFileUpload.vue')
},
methods: {
async getInfo(id) {
const {data, code, msg} = await $.get("/platform/fw/condolence/findOne", {id})
if (data) {
condolence.toFormData(data)
this.viewData = data
this.viewData.hospital_stay = data.starting_time + "-" + data.end_time
} else {
this.viewData = {}
this.$toast.fail('获取信息失败');
}
},
},
async created() {
await this.getInfo(this.id)
}
} }
</script> </script>
<style> <style>
.van-cell-group__title { .van-cell-group__title {
padding-left: 0 !important; padding-left: 0 !important;
} }
.van-sidebar-item { .van-sidebar-item {
font-size: 16px !important; font-size: 16px !important;
text-indent: 4px !important; text-indent: 4px !important;
} }
.van-sidebar-item--select::before { .van-sidebar-item--select::before {
left: 5px !important; left: 5px !important;
} }
</style> </style>
@@ -1,369 +1,411 @@
<template> <template>
<div style="display: flex;align-items: center;justify-content: center"> <div style="display: flex;align-items: center;justify-content: center">
<el-form :model="formData" ref="form" :rules="formRules" v-loading="loading" label-width="170px" <el-form :model="formData" ref="form" :rules="formRules" v-loading="loading" label-width="170px"
style="width: 1000px"> style="width: 1000px">
<vi-title title="申请变更"></vi-title> <vi-title title="申请变更"></vi-title>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
<el-form-item label="工&emsp;&emsp;号"> <el-form-item label="工&emsp;&emsp;号">
<el-input :value="formData.loginname" disabled></el-input> <el-input :value="formData.loginname" disabled></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="姓&emsp;&emsp;名"> <el-form-item label="姓&emsp;&emsp;名">
<el-input :value="formData.username" disabled></el-input> <el-input :value="formData.username" disabled></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
<el-form-item label="所在单位"> <el-form-item label="所在单位">
<el-input :value="formData.unitname" disabled></el-input> <el-input :value="formData.unitname" disabled></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="所在工会"> <el-form-item label="所在工会">
<el-input :value="formData.unionname" <el-input :value="formData.unionname"
disabled></el-input> disabled></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-form-item label="变更时间"> <el-form-item label="变更时间">
<el-input :value="formData.auditTime" disabled></el-input> <el-input :value="formData.auditTime" disabled></el-input>
</el-form-item>
<el-form-item prop="type" label="变更类型">
<!-- <dict-select v-model="formData.type" style="width: 100%" clearable placeholder="变更类型"-->
<!-- code="MemberChangeType" @change="typeChange"></dict-select>-->
<el-select v-model="formData.type" style="width: 100%" clearable placeholder="变更类型" @change="typeChange">
<el-option v-for="item in userChangeTypeList" :label="item.name" :value="item.code" :key="item.id"></el-option>
</el-select>
</el-form-item>
<!--异动-->
<div v-if="formData.type==='1'">
<el-form-item prop="type" label="新&ensp;单&ensp;位">
<el-select v-model="formData.currentUnitId" style="width: 100%" filterable clearable
@change="unitChange"
placeholder="请选择单位">
<el-option
v-for="item in unitOptions"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item prop="type" label="新&ensp;工&ensp;会">
<el-input :value="formData.currentUnionName" disabled placeholder=""></el-input>
</el-form-item>
<el-row :gutter="20" v-if="isThreeUnit">
<el-col :span="12">
<el-form-item label="新科室" prop="currentThreeUnitId">
<el-select v-model="formData.currentThreeUnitId" clearable filterable
placeholder="请选择新科室"
@change="threeUnitChange"
style="width: 100%">
<el-option
v-for="item in threeUnits"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item> </el-form-item>
</el-col>
<el-col :span="12"> <el-form-item prop="type" label="变更类型">
<el-form-item label="工会小组"> <!-- <dict-select v-model="formData.type" style="width: 100%" clearable placeholder="变更类型"-->
<el-input :value="formData.currentUnionGroupName" disabled></el-input> <!-- code="MemberChangeType" @change="typeChange"></dict-select>-->
<el-select v-model="formData.type" style="width: 100%" clearable placeholder="变更类型"
@change="typeChange">
<el-option v-for="item in userChangeTypeList" :label="item.name" :value="item.code"
:key="item.id"></el-option>
</el-select>
</el-form-item> </el-form-item>
</el-col>
</el-row>
</div>
<div v-else-if="welfare_member&&['2'].includes(formData.type)"> <!--异动-->
<el-form-item prop="updateWelfareMember" label="福利会员"> <div v-if="formData.type==='1'">
<el-radio-group v-model="formData.updateWelfareMember" size="small"> <el-row :gutter="20">
<el-radio :label="true" border>享受福利</el-radio> <el-col :span="12">
<el-radio :label="false" border>不享受福利</el-radio> <el-form-item prop="type" label="新单位">
</el-radio-group> <el-select v-model="formData.currentUnitId" style="width: 100%" filterable clearable
</el-form-item> @change="unitChange"
<el-form-item prop="insertMember" label="工会会员"> placeholder="请选择单位">
<el-radio-group v-model="formData.insertMember" size="small"> <el-option
<el-radio :label="true" border>成为会员</el-radio> v-for="item in unitOptions"
<el-radio :label="false" border>不成为会员</el-radio> :label="item.name"
</el-radio-group> :value="item.id">
</el-form-item> </el-option>
</div> </el-select>
</el-form-item>
</el-col>
<div v-else-if="welfare_member&&['7'].includes(formData.type)"> <el-col :span="12">
<el-form-item prop="updateWelfareMember" label="福利会员"> <el-form-item prop="type" label="新工会">
<el-radio-group v-model="formData.updateWelfareMember" size="small"> <el-input :value="formData.currentUnionName" readonly placeholder="选择单位后自动填充"></el-input>
<el-radio :label="true" border>享受福利</el-radio> </el-form-item>
<el-radio :label="false" border>不享受福利</el-radio> </el-col>
</el-radio-group> </el-row>
</el-form-item>
</div>
<div v-else-if="welfare_member&&['3','4','5','6','8'].includes(formData.type)"> <el-row :gutter="20" v-if="isThreeUnit">
<el-form-item prop="updateWelfare" label="福利会员"> <el-col :span="12">
<el-radio-group v-model="formData.updateWelfare" size="small"> <el-form-item label="新科室" prop="currentThreeUnitId">
<el-radio :label="true" border>取消享受福利</el-radio> <el-select v-model="formData.currentThreeUnitId" clearable filterable
<el-radio :label="false" border>保留享受福利</el-radio> placeholder="请选择新科室"
</el-radio-group> @change="threeUnitChange"
<!-- <span style="color: red">&emsp;&emsp;&emsp;温馨提醒:此操作将取消该教工正式会员资格</span>--> style="width: 100%">
</el-form-item> <el-option
v-for="item in threeUnits"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="工会小组">
<el-input :value="formData.currentUnionGroupName" readonly placeholder="选择科室后自动填充"></el-input>
</el-form-item>
</el-col>
</el-row>
</div>
<el-form-item prop="updateMember" label="工会会员"> <div v-else-if="welfare_member&&['2'].includes(formData.type)">
<el-radio-group v-model="formData.updateMember" size="small"> <el-row :gutter="20">
<el-radio :label="true" border>取消会员资格</el-radio> <el-col :span="12">
<el-radio :label="false" border>保留会员资格</el-radio> <el-form-item prop="updateWelfareMember" label="福利会员">
</el-radio-group> <el-radio-group v-model="formData.updateWelfareMember" size="small">
</el-form-item> <el-radio :label="true" border>享受福利</el-radio>
<el-radio :label="false" border>不享受福利</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="updateMember" label="工会会员">
<el-radio-group v-model="formData.updateMember" size="small">
<el-radio :label="true" border>成为会员</el-radio>
<el-radio :label="false" border>不成为会员</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
</div>
<el-form-item prop="updateUserState" label="是否改变在职状态" style="width: 100%" <div v-else-if="welfare_member&&['7'].includes(formData.type)">
v-if="welfare_member&&['3','4','5','6','8'].includes(formData.type)"> <el-form-item prop="updateWelfareMember" label="福利会员">
<dict-select v-model="formData.userState" style="width: 100%" clearable placeholder="变更类型" <el-radio-group v-model="formData.updateWelfareMember" size="small">
code="userState"></dict-select> <el-radio :label="true" border>享受福利</el-radio>
</el-form-item> <el-radio :label="false" border>不享受福利</el-radio>
</el-radio-group>
</el-form-item>
</div>
<el-form-item prop="updateUserState" label="是否改变人员类型" style="width: 100%" <div v-else-if="welfare_member&&['3','4','5','6','8'].includes(formData.type)">
v-if="welfare_member&&['3','4','5','6','8'].includes(formData.type)"> <el-row :gutter="20">
<dict-select v-model="formData.personType" style="width: 100%" clearable <el-col :span="12">
placeholder="人员类型" <el-form-item prop="updateWelfareMember" label="福利会员">
code="UserType"></dict-select> <el-radio-group v-model="formData.updateWelfareMember" size="small">
</el-form-item> <el-radio :label="true" border>保留享受福利</el-radio>
</div> <el-radio :label="false" border>取消享受福利</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="updateMember" label="工会会员">
<el-radio-group v-model="formData.updateMember" size="small">
<el-radio :label="true" border>保留会员资格</el-radio>
<el-radio :label="false" border>取消会员资格</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item prop="userState" label="原在职状态">
<el-input v-model="formData.userState" readonly placeholder="原在职状态"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="updateUserState" label="是否改变在职状态" style="width: 100%">
<dict-select v-model="formData.changeUserState" style="width: 100%" clearable
placeholder="是否改变在职状态"
code="userState"></dict-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item prop="personType" label="原人员类型">
<el-input v-model="formData.personType" readonly placeholder="原人员类型"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="updateUserState" label="是否改变人员类型" style="width: 100%">
<dict-select v-model="formData.changePersonType" style="width: 100%" clearable
placeholder="是否改变人员类型"
code="UserType"></dict-select>
</el-form-item>
</el-col>
</el-row>
</div>
<div v-else-if="formData.type==='10'"> <div v-else-if="formData.type==='10'">
<el-form-item prop="oldIdCard" label="原身份证号" style="width: 100%"> <el-form-item prop="oldIdCard" label="原身份证号" style="width: 100%">
<el-input v-model="formData.oldIdCard" readonly type="text"></el-input> <el-input v-model="formData.oldIdCard" readonly type="text"></el-input>
</el-form-item> </el-form-item>
<el-form-item prop="idCard" label="新的身份证号" style="width: 100%"> <el-form-item prop="idCard" label="新的身份证号" style="width: 100%">
<el-input v-model="formData.idCard" placeholder="请输入新的身份证号" type="text"></el-input> <el-input v-model="formData.changeIdCard" placeholder="请输入新的身份证号" type="text"></el-input>
</el-form-item> </el-form-item>
</div> </div>
<div v-else-if="formData.type==='11'"> <div v-else-if="formData.type==='11'">
<el-form-item prop="oldMobile" label="原手机号码" style="width: 100%"> <el-form-item prop="oldMobile" label="原手机号码" style="width: 100%">
<el-input v-model="formData.oldMobile" readonly type="text"></el-input> <el-input v-model="formData.oldMobile" readonly type="text"></el-input>
</el-form-item> </el-form-item>
<el-form-item prop="mobile" label="新的手机号码" style="width: 100%"> <el-form-item prop="mobile" label="新的手机号码" style="width: 100%">
<el-input v-model="formData.mobile" placeholder="请输入新的手机号码" type="text"></el-input> <el-input v-model="formData.changeMobile" placeholder="请输入新的手机号码" type="text"></el-input>
</el-form-item> </el-form-item>
</div> </div>
<div v-else-if="formData.type==='12'"> <div v-else-if="formData.type==='12'">
<el-form-item prop="oldEducation" label="原学历" style="width: 100%"> <el-form-item prop="oldEducation" label="原学历" style="width: 100%">
<el-input v-model="formData.oldEducation" readonly type="text"></el-input> <el-input v-model="formData.oldEducation" readonly type="text"></el-input>
</el-form-item> </el-form-item>
<el-form-item prop="education" label="新的学历" style="width: 100%"> <el-form-item prop="education" label="新的学历" style="width: 100%">
<dict-select v-model="formData.education" style="width: 100%" clearable placeholder="请选择新的学历" <dict-select v-model="formData.changeEducation" style="width: 100%" clearable
code="Education"></dict-select> placeholder="请选择新的学历"
</el-form-item> code="Education"></dict-select>
</div> </el-form-item>
</div>
<!-- <div v-else-if="welfare_member&&['2','7'].includes(formData.type)"> <!-- <div v-else-if="welfare_member&&['2','7'].includes(formData.type)">
<el-form-item prop="updateWelfareMember" label="是否享受福利"> <el-form-item prop="updateWelfareMember" label="是否享受福利">
<el-switch <el-switch
v-model="formData.updateWelfareMember" v-model="formData.updateWelfareMember"
active-color="#13ce66" active-color="#13ce66"
inactive-color="#ff4949"> inactive-color="#ff4949">
</el-switch> </el-switch>
<span style="color: red">&emsp;&emsp;&emsp;温馨提醒:此操作将该教工设为正式会员</span> <span style="color: red">&emsp;&emsp;&emsp;温馨提醒:此操作将该教工设为正式会员</span>
</el-form-item> </el-form-item>
</div>--> </div>-->
<el-form-item prop="remark" label="变化原因"> <el-form-item prop="remark" label="变化原因">
<el-input v-model="formData.remark" placeholder="变化原因" type="textarea" :rows="4"></el-input> <el-input v-model="formData.remark" placeholder="变化原因" type="textarea" :rows="4"></el-input>
</el-form-item> </el-form-item>
<el-row style="display: flex;justify-content:flex-end;"> <el-row style="display: flex;justify-content:flex-end;">
<el-button @click="doSubmit" :loading="submitLoading" :disabled="disabled" type="primary"> <el-button @click="doSubmit" :loading="submitLoading" :disabled="disabled" type="primary">
提交 提交
</el-button> </el-button>
</el-row> </el-row>
</el-form> </el-form>
</div> </div>
</template> </template>
<script> <script>
module.exports = { module.exports = {
components: { components: {
'dict-select': httpVueLoader('/components/plugins/DictSelect.vue?v=1.0.0'), 'dict-select': httpVueLoader('/components/plugins/DictSelect.vue?v=1.0.0'),
},
props: {
userid: {type: String},
welfare_member: {type: Boolean, default: true},
},
data() {
return {
loading: true,
disabled: false,
submitLoading: false,
formData: {},
formRules: {
type: [{required: true, message: '必选', trigger: ['blur', 'change']}],
updateWelfareMember: [{required: true, message: '必选', trigger: ['blur', 'change']}],
updateMember: [{required: true, message: '必选', trigger: ['blur', 'change']}],
updateWelfare: [{required: true, message: '必选', trigger: ['blur', 'change']}],
currentUnitId: [{required: true, message: '必选', trigger: ['blur', 'change']}],
currentThreeUnitId: [{required: true, message: '请选择新三级单位', trigger: 'change'}],
idCard: [{required: true, message: '必填', trigger: ['blur', 'change']}],
mobile: [{required: true, message: '必填', trigger: ['blur', 'change']}],
education: [{required: true, message: '必填', trigger: ['blur', 'change']}],
insertMember: [{required: true, message: '必填', trigger: ['blur', 'change']}],
},
unitOptions: [],
threeUnits: [],
isThreeUnit: false,
userChangeTypeList:[],
}
},
watch: {
userid(val) {
this.flush()
}
},
methods: {
typeChange() {
this.$set(this.formData, "updateWelfareMember", ['2','7'].includes(this.formData.type))
this.$set(this.formData, "updateWelfare", ['2', '3', '4', '5', '6', '8'].includes(this.formData.type))
this.$set(this.formData, "updateMember", ['2', '3', '4', '5', '6', '8'].includes(this.formData.type))
this.$set(this.formData, "insertMember", ['2'].includes(this.formData.type))
}, },
async doSubmit() { props: {
this.$refs["form"].validate((valid) => { userid: {type: String},
if (valid) { welfare_member: {type: Boolean, default: true},
this.submitLoading = true },
this.$emit("submit", this.formData) data() {
return {
loading: true,
disabled: false,
submitLoading: false,
formData: {},
formRules: {
type: [{required: true, message: '必选', trigger: ['blur', 'change']}],
updateWelfareMember: [{required: true, message: '必选', trigger: ['blur', 'change']}],
updateMember: [{required: true, message: '必选', trigger: ['blur', 'change']}],
updateWelfare: [{required: true, message: '必选', trigger: ['blur', 'change']}],
currentUnitId: [{required: true, message: '必选', trigger: ['blur', 'change']}],
currentThreeUnitId: [{required: true, message: '请选择新三级单位', trigger: 'change'}],
idCard: [{required: true, message: '必填', trigger: ['blur', 'change']}],
mobile: [{required: true, message: '必填', trigger: ['blur', 'change']}],
education: [{required: true, message: '必填', trigger: ['blur', 'change']}],
insertMember: [{required: true, message: '必填', trigger: ['blur', 'change']}],
},
unitOptions: [],
threeUnits: [],
isThreeUnit: false,
userChangeTypeList: [],
} }
})
}, },
closeLoading() { watch: {
this.submitLoading = false userid(val) {
}, this.flush()
unitChange(v) {
// const unit = this.unitOptions.find(x => x.id === v)
// if (unit) {
// this.formData.currentUnionId = unit.unionid
// this.formData.currentUnionName = unit.unionname
// } else {
// this.formData.currentUnionId = ''
// this.formData.currentUnionName = ''
// }
this.$set(this.formData, 'currentThreeUnitId', null)
this.$set(this.formData, 'currentUnionGroupName', null)
this.threeUnits = []
if (v) {
this.getThreeUnits(v)
}
const unit = this.unitOptions.find(x => x.id === v)
if (unit) {
this.$set(this.formData, 'currentUnionId', unit.unionid)
this.$set(this.formData, 'currentUnionName', unit.unionname)
} else {
this.$set(this.formData, 'currentUnionId', null)
this.$set(this.formData, 'currentUnionName', null)
}
},
async getThreeUnits(val) {
this.threeUnits = await threeUnitsByUnionGroupOrUnitId(val, null)
},
async threeUnitChange(val) {
if (val) {
const threeUnit = this.threeUnits.find(v => v.id === val)
const groupName = threeUnit.groupname
this.$set(this.formData, 'currentUnionGroupName', groupName)
} else {
this.$set(this.formData, 'currentUnionGroupName', null)
}
},
async flush() {
this.loading = true
this.disabled = false
if (!this.userid) {
this.formData = {}
this.loading = false
this.disabled = true
return
}
const resp = await $.get("/platform/member/common/userInfo", {userId: this.userid})
if (resp.code === 0) {
if (this.$refs["form"])
this.$refs["form"].resetFields();
this.formData = {
userId: resp.data.id,
loginname: resp.data.loginname,
username: resp.data.username,
unitname: resp.data.unitname,
unionname: resp.data.unionname,
originUnitId: resp.data.unitid,
originThreeUnitId: resp.data.threeUnitId,
originUnionId: resp.data.unionid,
userState: resp.data.userState,
personType: resp.data.personType,
auditTime: moment().format('YYYY-MM-DD'),
notes: null,
oldIdCard:resp.data.idcard,
oldMobile:resp.data.mobile,
oldEducation:resp.data.education
} }
this.disabled = false
} else {
this.disabled = true
this.$notify.error({
title: '错误',
message: '获取用户信息失败'
});
}
this.loading = false
}, },
async getUnits() { methods: {
const resp = await $.post('/platform/member/change/mange/units') typeChange(val) {
if (resp.code === 0) { if (val == '1') {
this.unitOptions = resp.data this.formData.updateWelfareMember = null
} this.formData.updateMember = null
} else {
this.$set(this.formData, "updateWelfareMember", ['2', '7'].includes(this.formData.type))
this.$set(this.formData, "updateWelfareMember", !['3', '4', '5', '6', '8'].includes(this.formData.type))
this.$set(this.formData, "updateMember", ['2'].includes(this.formData.type))
this.$set(this.formData, "updateMember", !['3', '4', '5', '6', '8'].includes(this.formData.type))
}
},
async doSubmit() {
this.$refs["form"].validate((valid) => {
if (valid) {
this.submitLoading = true
this.$emit("submit", this.formData)
}
})
},
closeLoading() {
this.submitLoading = false
},
unitChange(v) {
// const unit = this.unitOptions.find(x => x.id === v)
// if (unit) {
// this.formData.currentUnionId = unit.unionid
// this.formData.currentUnionName = unit.unionname
// } else {
// this.formData.currentUnionId = ''
// this.formData.currentUnionName = ''
// }
this.$set(this.formData, 'currentThreeUnitId', null)
this.$set(this.formData, 'currentUnionGroupName', null)
this.threeUnits = []
if (v) {
this.getThreeUnits(v)
}
const unit = this.unitOptions.find(x => x.id === v)
this.isThreeUnit = unit.unionname.includes("机关");
if (unit) {
this.$set(this.formData, 'currentUnionId', unit.unionid)
this.$set(this.formData, 'currentUnionName', unit.unionname)
} else {
this.$set(this.formData, 'currentUnionId', null)
this.$set(this.formData, 'currentUnionName', null)
}
},
async getThreeUnits(val) {
this.threeUnits = await threeUnitsByUnionGroupOrUnitId(val, null)
},
async threeUnitChange(val) {
if (val) {
const threeUnit = this.threeUnits.find(v => v.id === val)
const groupName = threeUnit.groupname
this.$set(this.formData, 'currentUnionGroupName', groupName)
} else {
this.$set(this.formData, 'currentUnionGroupName', null)
}
},
async flush() {
this.loading = true
this.disabled = false
if (!this.userid) {
this.formData = {}
this.loading = false
this.disabled = true
return
}
const resp = await $.get("/platform/member/common/userInfo", {userId: this.userid})
if (resp.code === 0) {
if (this.$refs["form"])
this.$refs["form"].resetFields();
this.formData = {
userId: resp.data.id,
loginname: resp.data.loginname,
username: resp.data.username,
unitname: resp.data.unitname,
unionname: resp.data.unionname,
originUnitId: resp.data.unitid,
originThreeUnitId: resp.data.threeUnitId,
originUnionId: resp.data.unionid,
userState: resp.data.userState,
personType: resp.data.personType,
auditTime: moment().format('YYYY-MM-DD'),
notes: null,
oldIdCard: resp.data.idcard,
oldMobile: resp.data.mobile,
oldEducation: resp.data.education
}
this.disabled = false
} else {
this.disabled = true
this.$notify.error({
title: '错误',
message: '获取用户信息失败'
});
}
this.loading = false
},
async getUnits() {
const resp = await $.post('/platform/member/change/mange/units')
if (resp.code === 0) {
this.unitOptions = resp.data
}
},
async getUserChangeType() {
const resp = await $.get('/platform/member/common/getUserChangType')
if (resp.code === 0) {
this.userChangeTypeList = resp.data
}
},
}, },
async getUserChangeType(){ async created() {
const resp = await $.get('/platform/member/common/getUserChangType') // this.isThreeUnit = await getConfigKey('isThreeUnit') === 'true'
if (resp.code === 0){ // this.isThreeUnit = await getConfigKey('isThreeUnit') === 'true'
this.userChangeTypeList = resp.data await this.getUnits()
} await this.flush()
}, await this.getUserChangeType()
}, // getUnits(null).then(res => this.unitOptions = res)
async created() { }
this.isThreeUnit = await getConfigKey('isThreeUnit') === 'true'
await this.getUnits()
await this.flush()
await this.getUserChangeType()
// getUnits(null).then(res => this.unitOptions = res)
}
} }
</script> </script>
<style> <style>
.is-flex { .is-flex {
display: flex; display: flex;
} }
.is-flex .el-form-item { .is-flex .el-form-item {
width: 50%; width: 50%;
} }
</style> </style>
@@ -1,151 +1,151 @@
<template> <template>
<div> <div>
<el-table :data="memberHistoryRecords" border> <el-table :data="memberHistoryRecords" border>
<el-table-column type="index" label="序号" width="80px"></el-table-column> <el-table-column type="index" label="序号" width="80px"></el-table-column>
<el-table-column label="工号" prop="loginname"></el-table-column> <el-table-column label="工号" prop="loginname"></el-table-column>
<el-table-column label="姓名" prop="username"></el-table-column> <el-table-column label="姓名" prop="username"></el-table-column>
<el-table-column label="变更来源" prop="changeOrigin"> <el-table-column label="变更来源" prop="changeOrigin">
<template scope="{row}"> <template scope="{row}">
{{ memberChangeOriginOptions.find(v => v.code == row.changeOrigin)?.description }} {{ memberChangeOriginOptions.find((v) => v.code == row.changeOrigin)?.description }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="变更时间" prop="changeTime"></el-table-column> <el-table-column label="变更时间" prop="changeTime"></el-table-column>
<el-table-column label="异动类型" prop="changeTypes"> <el-table-column label="异动类型" prop="changeTypes">
<template scope="{row}"> <template scope="{row}">
<span style="color: #0e78c5;cursor: pointer" @click="openUserChangeInfo(row)"> <span style="color: #0e78c5; cursor: pointer" @click="openUserChangeInfo(row)">
{{ {{
userChangeTypeOptions.filter(v => row.changeTypes.includes(v.code)).map(v => v.description).join() userChangeTypeOptions
}} .filter((v) => row.changeTypes.includes(v.code))
</span> .map((v) => v.description)
</template> .join()
</el-table-column> }}
<el-table-column label="状态" prop="stateId"> </span>
<template scope="{row}"> </template>
<vi-table-state v-if="row.stateId" :state="row"></vi-table-state> </el-table-column>
</template> <el-table-column label="状态" prop="stateId">
</el-table-column> <template scope="{row}">
</el-table> <vi-table-state v-if="row.stateId" :state="row"></vi-table-state>
</template>
</el-table-column>
</el-table>
<user-change-history ref="userChangeHistory"></user-change-history> <user-change-history ref="userChangeHistory"></user-change-history>
</div> </div>
</template> </template>
<script> <script>
module.exports = { module.exports = {
components: { components: {
'user-change-history': httpVueLoader('/components/userChangeHistory/UserChangeHistory.vue?v=' + new Date().getTime()), "user-change-history": httpVueLoader("/components/userChangeHistory/userChangeHistory.vue?v=" + new Date().getTime())
}, },
props: { props: {
records: {type: Array, default: []}, records: { type: Array, default: [] },
userid: {type: String}, userid: { type: String },
audit_info_union: {type: Boolean, default: true}, audit_info_union: { type: Boolean, default: true },
audit_info_school: {type: Boolean, default: true} audit_info_school: { type: Boolean, default: true }
}, },
model: { model: {
prop: 'records', prop: "records",
event: 'change' event: "change"
}, },
data() { data() {
return { return {
isThreeUnit: false, isThreeUnit: false,
loading: true, loading: true,
changeType: {}, changeType: {},
changeOrigin: {}, changeOrigin: {},
memberHistoryRecords: [], memberHistoryRecords: [],
memberChangeOriginOptions: [], memberChangeOriginOptions: [],
userChangeTypeOptions: [] userChangeTypeOptions: []
} }
}, },
watch: { watch: {
userid(val) { userid(val) {
this.getMemberChangeRecords() this.getMemberChangeRecords()
this.getMemberHistoryRecords() this.getMemberHistoryRecords()
} }
}, },
methods: { methods: {
async getMemberHistoryRecords() { async getMemberHistoryRecords() {
const {code, msg, data} = await $.get("/platform/member/common/memberHistoryRecords", {userId: this.userid}) const { code, msg, data } = await $.get("/platform/member/common/memberHistoryRecords", { userId: this.userid })
if (code === 0) { if (code === 0) {
data.forEach(v => { data.forEach((v) => {
if (v.changeTypes) { if (v.changeTypes) {
v.changeTypes = JSON.parse(v.changeTypes) v.changeTypes = JSON.parse(v.changeTypes)
} }
})
this.memberHistoryRecords = data
}
},
openUserChangeInfo({ id }) {
this.$refs.userChangeHistory.openUserChangeInfo(id)
},
async onExpand(row, expandedRows) {
if (!expandedRows.includes(row)) {
return
}
this.$set(row, "loading", true)
const resp = await $.get("/platform/member/common/findChangeApplyInfo", { id: row.id })
this.$set(row, "loading", false)
if (resp.code === 0) {
this.$set(row, "info", resp.data)
} else {
this.$set(row, "info", {})
}
},
async getMemberChangeRecords() {
this.loading = true
if (!this.userid && this.records.length) {
this.loading = false
return
} else if (!this.userid) {
this.records = []
this.loading = false
return
}
const resp = await $.get("/platform/member/common/memberChangeRecords", { userId: this.userid })
this.loading = false
if (resp.code === 0) {
this.records = resp.data
} else {
this.$notify.error({
title: "错误",
message: "获取变更记录失败"
})
}
}
},
async created() {
this.isThreeUnit = (await getConfigKey("isThreeUnit")) === "true"
this.getMemberChangeRecords()
this.changeType = await member.getChangeType()
this.changeOrigin = await member.getChangeOrigin()
getEnumOptions("MemberChangeOrigin").then((res) => {
this.memberChangeOriginOptions = res
}) })
this.memberHistoryRecords = data getEnumOptions("UserChangeType").then((res) => {
} this.userChangeTypeOptions = res
})
}, }
openUserChangeInfo({id}) {
this.$refs.userChangeHistory.openUserChangeInfo(id)
},
async onExpand(row, expandedRows) {
if (!expandedRows.includes(row)) {
return
}
this.$set(row, "loading", true)
const resp = await $.get("/platform/member/common/findChangeApplyInfo", {id: row.id})
this.$set(row, "loading", false)
if (resp.code === 0) {
this.$set(row, "info", resp.data)
} else {
this.$set(row, "info", {})
}
},
async getMemberChangeRecords() {
this.loading = true
if (!this.userid && this.records.length) {
this.loading = false
return
} else if (!this.userid) {
this.records = []
this.loading = false
return
}
const resp = await $.get("/platform/member/common/memberChangeRecords", {userId: this.userid})
this.loading = false
if (resp.code === 0) {
this.records = resp.data
} else {
this.$notify.error({
title: '错误',
message: '获取变更记录失败'
});
}
},
},
async created() {
this.isThreeUnit = await getConfigKey('isThreeUnit') === 'true'
this.getMemberChangeRecords()
this.changeType = await member.getChangeType()
this.changeOrigin = await member.getChangeOrigin()
getEnumOptions('MemberChangeOrigin').then(res => {
this.memberChangeOriginOptions = res
})
getEnumOptions('UserChangeType').then(res => {
this.userChangeTypeOptions = res
})
}
} }
</script> </script>
<style> <style>
.is-flex { .is-flex {
display: flex; display: flex;
} }
.is-flex .el-form-item { .is-flex .el-form-item {
width: 50%; width: 50%;
} }
</style> </style>
@@ -1,58 +1,51 @@
/** /** *Desc: *Create by: jug *Create time:2023/6/8/10:29 */
*Desc:
*Create by: jug
*Create time:2023/6/8/10:29
*/
<template> <template>
<div> <div>
<el-input v-model="cnd.memberSearchKeyWord" placeholder="请输入值" style="width: 100%"> <el-input v-model="cnd.memberSearchKeyWord" placeholder="请输入值" style="width: 100%">
<el-select v-model="cnd.memberSearchName" slot="prepend" placeholder="请选择字段" style="width: 120px"> <el-select v-model="cnd.memberSearchName" slot="prepend" placeholder="请选择字段" style="width: 120px">
<el-option <el-option
v-for="column in columnInfos" v-for="column in columnInfos"
:key="column.COLUMN_NAME" :key="column.COLUMN_NAME"
:label="column.COLUMN_COMMENT" :label="column.COLUMN_COMMENT"
:value="column.COLUMN_NAME"> :value="column.COLUMN_NAME"
</el-option> ></el-option>
</el-select> </el-select>
</el-input> </el-input>
</div>
</div>
</template> </template>
<script> <script>
module.exports = { module.exports = {
name: "MemberCnd", name: "MemberCnd",
props: {}, props: {},
data() { data() {
return { return {
columnInfos: [], columnInfos: [],
cnd: {} cnd: {}
}
},
watch: {
cnd: {
handler(val) {
this.$emit("cnd", val)
},
deep: true
}
},
methods: {
async getColumnInfo() {
const { data, msg, code } = await $.post("/platform/activity/basic/scope/getUserTableColumnInfo")
if (code !== 0) {
this.$notify.warning(msg)
return
}
this.columnInfos = data
}
},
created() {
this.getColumnInfo()
} }
},
watch: {
cnd: {
handler(val) {
this.$emit('cnd', val)
},
deep: true
}
},
methods: {
async getColumnInfo() {
const {data, msg, code} = await $.post('/platform/activity/basic/scope/getUserTableColumnInfo')
if (code !== 0) {
this.$notify.warning(msg)
return
}
this.columnInfos = data
}
},
created() {
this.getColumnInfo()
}
} }
</script> </script>
<style scoped> <style scoped></style>
</style>
@@ -204,12 +204,12 @@
placeholder="更新时间" placeholder="更新时间"
></el-date-picker> ></el-date-picker>
</el-form-item> </el-form-item>
<el-form-item prop="schoolTime" label="参加工作日期"> <el-form-item prop="workDate" label="参加工作日期">
<el-date-picker <el-date-picker
style="width: 100%" style="width: 100%"
format="yyyy-MM-dd" format="yyyy-MM-dd"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
v-model="formData.schoolTime" v-model="formData.workDate"
type="date" type="date"
placeholder="选择参加工作日期" placeholder="选择参加工作日期"
></el-date-picker> ></el-date-picker>
@@ -326,7 +326,7 @@
<div v-else> <div v-else>
<h3 style="text-align: center; letter-spacing: 6px">工会会员登记表</h3> <h3 style="text-align: center; letter-spacing: 6px">工会会员登记表</h3>
<!-- <div style="text-align: right; letter-spacing: 2px">填表日期:{{ moment(formData.applyTime).format("YYYY年MM月DD日") }}</div>--> <!-- <div style="text-align: right; letter-spacing: 2px">填表日期:{{ moment(formData.applyTime).format("YYYY年MM月DD日") }}</div>-->
<el-descriptions :column="3" border class="descriptions-form"> <el-descriptions :column="3" border class="descriptions-form">
<el-descriptions-item label="姓名">{{ formData.username }}</el-descriptions-item> <el-descriptions-item label="姓名">{{ formData.username }}</el-descriptions-item>
@@ -1,189 +1,185 @@
<template> <template>
<div style="padding-bottom: 20px;"> <div style="padding-bottom: 20px">
<van-form readonly input-align="right">
<van-form readonly input-align="right"> <div class="van-cell-group__title">
<div class="van-cell-group__title"> <div class="van-sidebar-item van-sidebar-item--select">基础信息</div>
<div class="van-sidebar-item van-sidebar-item--select">
基础信息
</div>
</div>
<van-cell-group>
<van-field readonly :value="viewData.username" label="姓名"></van-field>
<van-field readonly :value="viewData.loginname" label="工资号"></van-field>
<van-field readonly :value="viewData.unitname" label="单位"></van-field>
<van-field readonly :value="viewData.unionname" label="工会"></van-field>
</van-cell-group>
<div class="van-cell-group__title">
<div class="van-sidebar-item van-sidebar-item--select">
作品信息
</div>
</div>
<van-cell-group>
<van-field readonly name="type" :value="viewData.zpzt" label="作品主题"></van-field>
<van-field readonly name="type" :value="viewData.lname" label="活动类别"></van-field>
<van-field readonly name="type" :value="viewData.zname" label="作品类别"></van-field>
<van-field readonly :value="viewData.zpms" label="简介"
input-align="left"
style="flex-flow: column"
rows="2" maxlength="200" type="textarea" show-word-limit autosize></van-field>
<van-field label="照片" style="flex-flow: column" input-align="left">
<template #label>
<div class="mb10">照&emsp;&emsp;片</div>
</template>
<template #input>
<vant-file-upload :files.sync="img2List" view :del="false"
v-if="img2List&&img2List.length>0"></vant-file-upload>
<span v-else>暂无</span>
</template>
</van-field>
<van-field label="视频" style="flex-flow: column" input-align="left">
<template #label>
<div class="mb10">视&emsp;&emsp;频</div>
</template>
<template #input>
<template v-for="item in videoList" v-if="videoList.length>0">
<video id="myVideo" class="video-js vjs-default-skin vjs-big-play-centered" controls preload="auto"
width="640" height="264"
data-setup="{}" webkit-playsinline='true' playsinline='true' x-webkit-airplay='true'
x5-video-player-type='h5' x5-video-player-fullscreen='true' x5-video-ignore-metadata='true'>
<source :src="FILE_DOMAIN+item.filepath" type="video/mp4">
</video>
</template>
<div v-else style="text-align: center;color: #c2bbbb;font-size: 10px;">
没有音频。
</div> </div>
<van-cell-group>
</template> <van-field readonly :value="viewData.username" label="姓名"></van-field>
</van-field> <van-field readonly :value="viewData.loginname" label="工资号"></van-field>
<van-field readonly :value="viewData.unitname" label="单位"></van-field>
<van-field label="音频" style="flex-flow: column" input-align="left"> <van-field readonly :value="viewData.unionname" label="工会"></van-field>
<template #label> </van-cell-group>
<div class="mb10">音&emsp;&emsp;频</div> <div class="van-cell-group__title">
</template> <div class="van-sidebar-item van-sidebar-item--select">作品信息</div>
<template #input>
<template v-for="item in videoList" v-if="audioList.length>0">
<audio id="amusic" preload="auto" controls style="width: 100%;outline: none;">
<source :src="FILE_DOMAIN+item.filepath"/>
</audio>
</template>
<div v-else style="text-align: center;color: #c2bbbb;font-size: 10px;">
没有音频。
</div> </div>
<van-cell-group>
<van-field readonly name="type" :value="viewData.zpzt" label="作品主题"></van-field>
<van-field readonly name="type" :value="viewData.lname" label="活动类别"></van-field>
<van-field readonly name="type" :value="viewData.zname" label="作品类别"></van-field>
<van-field
readonly
:value="viewData.zpms"
label="简介"
input-align="left"
style="flex-flow: column"
rows="2"
maxlength="200"
type="textarea"
show-word-limit
autosize
></van-field>
</template> <van-field label="照片" style="flex-flow: column" input-align="left">
</van-field> <template #label>
<div class="mb10">照&emsp;&emsp;片</div>
</template>
<template #input>
<vant-file-upload :files.sync="img2List" view :del="false" v-if="img2List && img2List.length > 0"></vant-file-upload>
<span v-else>暂无</span>
</template>
</van-field>
<van-field label="文档" style="flex-flow: column" input-align="left"> <van-field label="视频" style="flex-flow: column" input-align="left">
<template #label> <template #label>
<div class="mb10">文&emsp;&emsp;档</div> <div class="mb10">视&emsp;&emsp;频</div>
</template> </template>
<template #input> <template #input>
<template v-for="(item,index) in docList" v-if="docList.length>0"> <template v-for="item in videoList" v-if="videoList.length > 0">
<div class="text-nowrap color-puple" <video
@click="previewFile(item.filepath,item.filename,docList,index,item.id)"> id="myVideo"
{{ item.filename }} class="video-js vjs-default-skin vjs-big-play-centered"
</div> controls
</template> preload="auto"
<div v-else style="text-align: center;color: #c2bbbb;font-size: 10px;"> width="640"
没有文档。 height="264"
</div> data-setup="{}"
webkit-playsinline="true"
playsinline="true"
x-webkit-airplay="true"
x5-video-player-type="h5"
x5-video-player-fullscreen="true"
x5-video-ignore-metadata="true"
>
<source :src="FILE_DOMAIN + item.filepath" type="video/mp4" />
</video>
</template>
<div v-else style="text-align: center; color: #c2bbbb; font-size: 10px">没有音频。</div>
</template>
</van-field>
</template> <van-field label="音频" style="flex-flow: column" input-align="left">
</van-field> <template #label>
<div class="mb10">音&emsp;&emsp;频</div>
</template>
<template #input>
<template v-for="item in videoList" v-if="audioList.length > 0">
<audio id="amusic" preload="auto" controls style="width: 100%; outline: none">
<source :src="FILE_DOMAIN + item.filepath" />
</audio>
</template>
<div v-else style="text-align: center; color: #c2bbbb; font-size: 10px">没有音频。</div>
</template>
</van-field>
<van-field label="文档" style="flex-flow: column" input-align="left">
<template #label>
<div class="mb10">文&emsp;&emsp;档</div>
</template>
<template #input>
<template v-for="(item, index) in docList" v-if="docList.length > 0">
<div class="text-nowrap color-puple" @click="previewFile(item.filepath, item.filename, docList, index, item.id)">
{{ item.filename }}
</div>
</template>
<div v-else style="text-align: center; color: #c2bbbb; font-size: 10px">没有文档。</div>
</template>
</van-field>
</van-cell-group>
</van-form>
</van-cell-group> <template v-if="handle">
</van-form> <slot name="handle"></slot>
</template>
</div>
<template v-if="handle">
<slot name="handle"></slot>
</template>
</div>
</template> </template>
<script> <script>
module.exports = { module.exports = {
props: { props: {
handle: { handle: {
type: Boolean, type: Boolean,
default: false, default: false
},
title: {
type: String,
default: "审核"
},
id: {
type: String,
default: ""
}
}, },
title: { data() {
type: String, return {
default: '审核' viewData: {},
videoList: [],
prevImgList: [],
img2List: [],
audioList: [],
docList: [],
imgtype: ["gif", "jpg", "png", "jpeg"],
videotype: ["flv", "swf", "mkv", "avi", "rm", "rmvb", "wmv", "mp4", "mov", "mpg", "mpeg"],
doctype: ["doc", "docx"],
audiotype: ["mp3", "wma", "flac", "wav", "m4a", "amr", "au"]
}
}, },
id: { components: {
type: String, "vant-file-upload": httpVueLoader("/components/plugins/VantFileUpload.vue")
default: ''
}, },
}, methods: {
data() { async getInfo(id) {
return { const { data, code, msg } = await $.get("/platform/hd/wmhd/findOneById", { id })
viewData: {}, const refs = await $.get("/mobile/cahd/list/findOne", { id })
videoList: [],
prevImgList: [],
img2List: [],
audioList: [],
docList: [],
imgtype: ['gif', 'jpg', 'png', 'jpeg'],
videotype: ['flv', 'swf', 'mkv', 'avi', 'rm', 'rmvb', 'wmv', 'mp4', 'mov', 'mpg', 'mpeg'],
doctype: ['doc', 'docx'],
audiotype: ['mp3', 'wma', 'flac', 'wav', 'm4a', 'amr', 'au'],
}
},
components: {
'vant-file-upload': httpVueLoader('/components/plugins/VantFileUpload.vue')
},
methods: {
async getInfo(id) {
const {data, code, msg} = await $.get("/platform/hd/wmhd/findOneById", {id})
const refs = await $.get("/mobile/cahd/list/findOne", {id})
if (refs) { if (refs) {
this.viewData = refs[0] this.viewData = refs[0]
data.forEach(val => { data.forEach((val) => {
val.fjname = val.filename val.fjname = val.filename
val.fjurl = val.filepath val.fjurl = val.filepath
val.url = FILE_DOMAIN + val.filepath val.url = FILE_DOMAIN + val.filepath
let filetype = val.fjname.substring(val.fjname.lastIndexOf('.') + 1, val.fjname.length).toLowerCase(); let filetype = val.fjname.substring(val.fjname.lastIndexOf(".") + 1, val.fjname.length).toLowerCase()
if (this.videotype.indexOf(filetype) > -1) { if (this.videotype.indexOf(filetype) > -1) {
this.videoList.push(val); this.videoList.push(val)
} else if (this.imgtype.indexOf(filetype) > -1) { } else if (this.imgtype.indexOf(filetype) > -1) {
this.prevImgList.push(FILE_DOMAIN + val.filepath) this.prevImgList.push(FILE_DOMAIN + val.filepath)
this.img2List.push(val); this.img2List.push(val)
} else if (this.doctype.indexOf(filetype) > -1) { } else if (this.doctype.indexOf(filetype) > -1) {
this.docList.push(val); this.docList.push(val)
} else if (this.audiotype.indexOf(filetype) > -1) { } else if (this.audiotype.indexOf(filetype) > -1) {
this.audioList.push(val); this.audioList.push(val)
} }
}) })
} else { } else {
this.viewData = {} this.viewData = {}
this.$toast.fail('获取信息失败'); this.$toast.fail("获取信息失败")
} }
}
}, },
}, async created() {}
async created() {
}
} }
</script> </script>
<style> <style>
.van-cell-group__title { .van-cell-group__title {
padding-left: 0 !important; padding-left: 0 !important;
} }
.van-sidebar-item { .van-sidebar-item {
font-size: 16px !important; font-size: 16px !important;
text-indent: 4px !important; text-indent: 4px !important;
} }
.van-sidebar-item--select::before { .van-sidebar-item--select::before {
left: 5px !important; left: 5px !important;
} }
</style>
</style>
@@ -31,7 +31,7 @@
<!-- <template v-if="viewData.upa"> <!-- <template v-if="viewData.upa">
<div class="van-cell-group__title"> <div class="van-cell-group__title">
<div class="van-sidebar-item van-sidebar-item&#45;&#45;select"> <div class="van-sidebar-item van-sidebar-item&#45;&#45;select">
分工会审核信息 院级工会审核信息
</div> </div>
</div> </div>
<van-cell-group class="mt10"> <van-cell-group class="mt10">
@@ -20,6 +20,8 @@
:readonly="['SELECT'].includes(column.columnFormType)" :readonly="['SELECT'].includes(column.columnFormType)"
:rules="[{ required: column.isRequired, message: (['SELECT'].includes(column.columnFormType) ? '请选择' : '请填写') + column.columnName }]" :rules="[{ required: column.isRequired, message: (['SELECT'].includes(column.columnFormType) ? '请选择' : '请填写') + column.columnName }]"
:required="column.isRequired" :required="column.isRequired"
:clearable="true"
clear-trigger="always"
@click="selectFieldClick(column)" @click="selectFieldClick(column)"
></van-field> ></van-field>
@@ -47,7 +47,7 @@
<template v-if="viewData.upa"> <template v-if="viewData.upa">
<div class="van-cell-group__title"> <div class="van-cell-group__title">
<div class="van-sidebar-item van-sidebar-item--select"> <div class="van-sidebar-item van-sidebar-item--select">
分工会审核信息 院级工会审核信息
</div> </div>
</div> </div>
<van-cell-group class="mt10"> <van-cell-group class="mt10">
@@ -1,189 +0,0 @@
<template>
<div style="padding-bottom: 20px;">
<van-form readonly input-align="right">
<div class="van-cell-group__title">
<div class="van-sidebar-item van-sidebar-item--select">
基础信息
</div>
</div>
<van-cell-group>
<van-field readonly :value="viewData.username" label="姓名"></van-field>
<van-field readonly :value="viewData.loginname" label="工资号"></van-field>
<van-field readonly :value="viewData.unitname" label="单位"></van-field>
<van-field readonly :value="viewData.unionname" label="工会"></van-field>
</van-cell-group>
<div class="van-cell-group__title">
<div class="van-sidebar-item van-sidebar-item--select">
作品信息
</div>
</div>
<van-cell-group>
<van-field readonly name="type" :value="viewData.zpzt" label="作品主题"></van-field>
<van-field readonly name="type" :value="viewData.lname" label="活动类别"></van-field>
<van-field readonly name="type" :value="viewData.zname" label="作品类别"></van-field>
<van-field readonly :value="viewData.zpms" label="简介"
input-align="left"
style="flex-flow: column"
rows="2" maxlength="200" type="textarea" show-word-limit autosize></van-field>
<van-field label="照片" style="flex-flow: column" input-align="left">
<template #label>
<div class="mb10">照&emsp;&emsp;片</div>
</template>
<template #input>
<vant-file-upload :files.sync="img2List" view :del="false"
v-if="img2List&&img2List.length>0"></vant-file-upload>
<span v-else>暂无</span>
</template>
</van-field>
<van-field label="视频" style="flex-flow: column" input-align="left">
<template #label>
<div class="mb10">视&emsp;&emsp;频</div>
</template>
<template #input>
<template v-for="item in videoList" v-if="videoList.length>0">
<video id="myVideo" class="video-js vjs-default-skin vjs-big-play-centered" controls preload="auto"
width="640" height="264"
data-setup="{}" webkit-playsinline='true' playsinline='true' x-webkit-airplay='true'
x5-video-player-type='h5' x5-video-player-fullscreen='true' x5-video-ignore-metadata='true'>
<source :src="FILE_DOMAIN+item.filepath" type="video/mp4">
</video>
</template>
<div v-else style="text-align: center;color: #c2bbbb;font-size: 10px;">
没有音频。
</div>
</template>
</van-field>
<van-field label="音频" style="flex-flow: column" input-align="left">
<template #label>
<div class="mb10">音&emsp;&emsp;频</div>
</template>
<template #input>
<template v-for="item in videoList" v-if="audioList.length>0">
<audio id="amusic" preload="auto" controls style="width: 100%;outline: none;">
<source :src="FILE_DOMAIN+item.filepath"/>
</audio>
</template>
<div v-else style="text-align: center;color: #c2bbbb;font-size: 10px;">
没有音频。
</div>
</template>
</van-field>
<van-field label="文档" style="flex-flow: column" input-align="left">
<template #label>
<div class="mb10">文&emsp;&emsp;档</div>
</template>
<template #input>
<template v-for="(item,index) in docList" v-if="docList.length>0">
<div class="text-nowrap color-puple"
@click="previewFile(item.filepath,item.filename,docList,index,item.id)">
{{ item.filename }}
</div>
</template>
<div v-else style="text-align: center;color: #c2bbbb;font-size: 10px;">
没有文档。
</div>
</template>
</van-field>
</van-cell-group>
</van-form>
<template v-if="handle">
<slot name="handle"></slot>
</template>
</div>
</template>
<script>
module.exports = {
props: {
handle: {
type: Boolean,
default: false,
},
title: {
type: String,
default: '审核'
},
id: {
type: String,
default: ''
},
},
data() {
return {
viewData: {},
videoList: [],
prevImgList: [],
img2List: [],
audioList: [],
docList: [],
imgtype: ['gif', 'jpg', 'png', 'jpeg'],
videotype: ['flv', 'swf', 'mkv', 'avi', 'rm', 'rmvb', 'wmv', 'mp4', 'mov', 'mpg', 'mpeg'],
doctype: ['doc', 'docx'],
audiotype: ['mp3', 'wma', 'flac', 'wav', 'm4a', 'amr', 'au'],
}
},
components: {
'vant-file-upload': httpVueLoader('/components/plugins/VantFileUpload.vue')
},
methods: {
async getInfo(id) {
const {data, code, msg} = await $.get("/platform/hd/wmhd/findOneById", {id})
const refs = await $.get("/mobile/cahd/list/findOne", {id})
if (refs) {
this.viewData = refs[0]
data.forEach(val => {
val.fjname = val.filename
val.fjurl = val.filepath
val.url = FILE_DOMAIN + val.filepath
let filetype = val.fjname.substring(val.fjname.lastIndexOf('.') + 1, val.fjname.length).toLowerCase();
if (this.videotype.indexOf(filetype) > -1) {
this.videoList.push(val);
} else if (this.imgtype.indexOf(filetype) > -1) {
this.prevImgList.push(FILE_DOMAIN + val.filepath)
this.img2List.push(val);
} else if (this.doctype.indexOf(filetype) > -1) {
this.docList.push(val);
} else if (this.audiotype.indexOf(filetype) > -1) {
this.audioList.push(val);
}
})
} else {
this.viewData = {}
this.$toast.fail('获取信息失败');
}
},
},
async created() {
}
}
</script>
<style>
.van-cell-group__title {
padding-left: 0 !important;
}
.van-sidebar-item {
font-size: 16px !important;
text-indent: 4px !important;
}
.van-sidebar-item--select::before {
left: 5px !important;
}
</style>
@@ -1,50 +0,0 @@
<template>
<div class="card">
<div class="card-header" v-if="$slots.header">
<slot name="header"></slot>
</div>
<div class="card-body">
<slot></slot>
</div>
<div class="card-footer" v-if="$slots.footer">
<slot name="footer"></slot>
</div>
</div>
</template>
<script>
module.exports = {
name: "MCard"
}
</script>
<style scoped>
.card {
border: none;
border-radius: .5rem;
}
.card-header {
border-bottom:1px dashed rgba(0,0,0,.125);
font-size: 1.15rem;
}
.card-header:first-child {
border-radius: calc(.5rem - 1px) calc(.5rem - 1px) 0 0
}
.card-body>.van-cell{
padding: 5px 0;
}
.card-body{
padding-top: 0;
}
.card-header, .card-footer {
background-color: #FFFFFF;
}
</style>
@@ -1,89 +0,0 @@
<template>
<div class="loader"></div>
</template>
<script>
module.exports = {
name: "MLoading"
}
</script>
<style scoped>
.loader {
z-index: 10000;
position: relative;
width: 2.5em;
height: 2.5em;
transform: rotate(165deg);
}
.loader:before, .loader:after {
content: "";
position: absolute;
top: 50%;
left: 50%;
display: block;
width: 0.5em;
height: 0.5em;
border-radius: 0.25em;
transform: translate(-50%, -50%);
}
.loader:before {
animation: before 2s infinite;
}
.loader:after {
animation: after 2s infinite;
}
@keyframes before {
0% {
width: 0.5em;
box-shadow: 1em -0.5em rgba(225, 20, 98, 0.75), -1em 0.5em rgba(111, 202, 220, 0.75);
}
35% {
width: 2.5em;
box-shadow: 0 -0.5em rgba(225, 20, 98, 0.75), 0 0.5em rgba(111, 202, 220, 0.75);
}
70% {
width: 0.5em;
box-shadow: -1em -0.5em rgba(225, 20, 98, 0.75), 1em 0.5em rgba(111, 202, 220, 0.75);
}
100% {
box-shadow: 1em -0.5em rgba(225, 20, 98, 0.75), -1em 0.5em rgba(111, 202, 220, 0.75);
}
}
@keyframes after {
0% {
height: 0.5em;
box-shadow: 0.5em 1em rgba(61, 184, 143, 0.75), -0.5em -1em rgba(233, 169, 32, 0.75);
}
35% {
height: 2.5em;
box-shadow: 0.5em 0 rgba(61, 184, 143, 0.75), -0.5em 0 rgba(233, 169, 32, 0.75);
}
70% {
height: 0.5em;
box-shadow: 0.5em -1em rgba(61, 184, 143, 0.75), -0.5em 1em rgba(233, 169, 32, 0.75);
}
100% {
box-shadow: 0.5em 1em rgba(61, 184, 143, 0.75), -0.5em -1em rgba(233, 169, 32, 0.75);
}
}
/**
* Attempt to center the whole thing!
*/
html,
body {
height: 100%;
}
.loader {
position: absolute;
top: calc(50% - 1.25em);
left: calc(50% - 1.25em);
}
</style>
@@ -1,140 +0,0 @@
<template>
<figure>
<div class="dot white"></div>
<div class="dot"></div>
<div class="dot"></div>
<div class="dot"></div>
<div class="dot"></div>
</figure>
</template>
<script>
module.exports = {
name: "MTableLoading"
}
</script>
<style scoped>
body {
background: #222;
}
figure {
position: absolute;
margin: auto;
top: 0;
bottom: 0;
left: 0;
right: 0;
width: 6.250em;
height: 6.250em;
animation: rotate 2.4s linear infinite;
}
.white {
top: 0;
bottom: 0;
left: 0;
right: 0;
background: white;
animation: flash 2.4s linear infinite;
opacity: 0;
}
.dot {
position: absolute;
margin: auto;
width: 2.4em;
height: 2.4em;
border-radius: 100%;
transition: all 1s ease;
}
.dot:nth-child(2) {
top: 0;
bottom: 0;
left: 0;
background: #FF4444;
animation: dotsY 2.4s linear infinite;
}
.dot:nth-child(3) {
left: 0;
right: 0;
top: 0;
background: #FFBB33;
animation: dotsX 2.4s linear infinite;
}
.dot:nth-child(4) {
top: 0;
bottom: 0;
right: 0;
background: #99CC00;
animation: dotsY 2.4s linear infinite;
}
.dot:nth-child(5) {
left: 0;
right: 0;
bottom: 0;
background: #33B5E5;
animation: dotsX 2.4s linear infinite;
}
@keyframes rotate {
0% {
transform: rotate(0);
}
10% {
width: 6.250em;
height: 6.250em;
}
66% {
width: 2.4em;
height: 2.4em;
}
100% {
transform: rotate(360deg);
width: 6.250em;
height: 6.250em;
}
}
@keyframes dotsY {
66% {
opacity: .1;
width: 2.4em;
}
77% {
opacity: 1;
width: 0;
}
}
@keyframes dotsX {
66% {
opacity: .1;
height: 2.4em;
}
77% {
opacity: 1;
height: 0;
}
}
@keyframes flash {
33% {
opacity: 0;
border-radius: 0%;
}
55% {
opacity: .6;
border-radius: 100%;
}
66% {
opacity: 0;
}
}
</style>
@@ -1,186 +0,0 @@
<style>
.field .van-field__error-message {
display: none;
}
</style>
<template>
<div>
<van-form @submit="onSubmit" ref="form">
<template v-for="column in dynamicData">
<!-- 文本、数值、时间 -->
<template v-if="['VARCHAR','TEXT','INT','DATE','DATETIME'].includes(column.columnType)">
<van-field
class="field"
v-model="column.columnValue"
:clickable="['SELECT'].includes(column.columnFormType)"
:label="column.columnName"
:name="column.columnCode"
:type="['INT'].includes(column.columnType) ? 'digit' : ''"
:placeholder="(['SELECT'].includes(column.columnFormType) ? '请选择' : '请填写') + column.columnName"
:readonly="['SELECT'].includes(column.columnFormType)"
:rules="[{ required: column.isRequired, message: (['SELECT'].includes(column.columnFormType) ? '请选择' : '请填写') + column.columnName }]"
:required="column.isRequired"
:clearable="true"
clear-trigger="always"
@click="selectFieldClick(column)"
></van-field>
<van-popup v-if="['SELECT'].includes(column.columnFormType)"
v-model="pickerStates[column.columnCode + 'Picker']"
position="bottom">
<template v-if="['DATETIME','DATE'].includes(column.columnType)">
<van-datetime-picker
:title="column.columnName"
:type="column.columnType.toLocaleLowerCase()"
show-toolbar
@cancel="pickerStates[column.columnCode + 'Picker'] = false; column.columnValue = ''"
@confirm="(time)=>{dateTimePickerConfirm(time,column)}"
/>
</template>
<template v-else>
<van-picker
:columns="column.selectValues"
:title="column.columnName"
show-toolbar
@cancel="pickerStates[column.columnCode + 'Picker'] = false; column.columnValue = ''"
@confirm="(value)=>{ordinaryPickerConfirm(value,column)}"
/>
</template>
</van-popup>
</template>
<!-- 单选框 -->
<template v-else-if="['BOOLEAN'].includes(column.columnType)">
</template>
<!-- 文件 -->
<template v-else-if="['JSON'].includes(column.columnType)">
<van-field :required="column.isRequired" :label="column.columnName"
:rules="[{ required: column.isRequired, message: '请上传' + column.columnName }]">
<template #input>
<!-- <van-uploader v-model="fileList" :after-read="(file)=>{fileAfterRead(file,column)}"
:max-count="column.fileNumber"/>-->
<vant_file_upload :files.sync="column.columnValue" :max="column.fileNumber"
:type="column.fileType"></vant_file_upload>
</template>
</van-field>
</template>
</template>
</van-form>
</div>
</template>
<!-- 请在van-form中引用 -->
<script>
module.exports = {
name: "TrainDynamicForm",
components: {
'vant_file_upload': httpVueLoader('/components/plugins/VantFileUpload.vue')
},
props: {
dynamicData: []
},
model: {
prop: 'dynamicData',
event: 'updateDynamicData'
},
watch: {
dynamicData: {
handler: function (newValue, oldValue) {
this.$emit('updateDynamicData', newValue)
},
deep: true
}
},
data() {
return {
//所有的picker状态
pickerStates: {},
fileList: []
}
},
methods: {
validForm() {
try {
this.$refs.form.validate().then(() => {
return true
}).catch(() => {
return false
})
} catch (e) {
return false
}
/*return new Promise(resolve => {
this.$refs.form.validate().then(() => {
resolve(true)
}).catch(() => {
resolve(false)
})
})*/
},
onSubmit() {
},
selectFieldClick(column) {
console.log(column)
this.$set(this.pickerStates, column.columnCode + 'Picker', true)
if (!['DATE', 'DATETIME'].includes(column.columnType)) {
//说明是普通的下拉框
// column.selectValues = ['1', '2', '3']
}
},
/**
* 时间picker确认
* @param time
* @param column
*/
dateTimePickerConfirm(time, column) {
if (column.columnType === 'DATE') {
column.columnValue = moment(time).format('YYYY-MM-DD')
} else if (column.columnType === 'DATETIME') {
column.columnValue = moment(time).format('YYYY-MM-DD HH:mm:ss')
} else {
//预留别的类型
column.columnValue = moment(time).format('YYYY-MM-DD HH:mm:ss')
}
this.pickerStates[column.columnCode + 'Picker'] = false
},
/**
* 普通picker确认
* @param value
* @param column
*/
ordinaryPickerConfirm(value, column) {
column.columnValue = value
this.pickerStates[column.columnCode + 'Picker'] = false
},
/**
* 文件读取
*/
fileAfterRead(file, column) {
console.log(file)
console.log(column)
}
},
created() {
// console.log(this.dynamicData)
// this.dynamicData.forEach(v => {
// if (v.columnFormType === 'SELECT') {
// v.columnPickerName = v.columnCode+'Picker'
// }
// })
// console.log(this.dynamicData)
}
}
</script>
<style scoped>
</style>
@@ -1,158 +0,0 @@
<template>
<div style="padding-bottom: 20px;">
<van-form readonly input-align="right">
<div class="van-cell-group__title">
<div class="van-sidebar-item van-sidebar-item--select">
申请信息
</div>
</div>
<van-cell-group>
<van-field readonly :value="viewData.sqrname" label="申请人"></van-field>
<van-field readonly :value="viewData.sqsj" label="申请时间"></van-field>
<van-field readonly :value="viewData.bbname" label="受补助人"></van-field>
<van-field readonly :value="viewData.idcard" label="身份证号"></van-field>
<van-field readonly name="type" :value="viewData.bbsex" label="性别"></van-field>
<van-field readonly name="type" :value="viewData.zc" label="职称"></van-field>
<van-field readonly name="type" :value="viewData.zw" label="职务"></van-field>
<van-field readonly :value="viewData.bbunit" label="所在单位"></van-field>
<van-field readonly name="way" :value="viewData.bbbirthday" label="出生日期"></van-field>
<van-field readonly :value="viewData.lxfs" label="手机号码"></van-field>
<van-field readonly :value="difficulty.subsidy[viewData.sq_bzlx]" label="补助类型"></van-field>
<van-field readonly :value=" difficulty.sq_knlx[viewData.sq_knlx] " label="困难类型"></van-field>
<van-field readonly :value="viewData.apply_reason" label="申请理由"
input-align="left"
style="flex-flow: column"
rows="2" maxlength="200" type="textarea" show-word-limit autosize></van-field>
<van-field label="附件" style="flex-flow: column" input-align="left">
<template #label>
<div class="mb10">附&emsp;&emsp;件</div>
</template>
<template #input>
<vant-file-upload :files.sync="viewData.files" view :del="false"
v-if="viewData.files&&viewData.files.length"></vant-file-upload>
<span v-else>暂无</span>
</template>
</van-field>
<van-field name="sign" label="申请人签字">
<template #input>
<van-image width="200" height="100" :src="viewData.sqsign" v-if="viewData.sqsign!=null"></van-image>
<span v-else>暂无</span>
</template>
</van-field>
</van-cell-group>
</van-form>
<template v-if="viewData.upa">
<div class="van-cell-group__title">
<div class="van-sidebar-item van-sidebar-item--select">
分工会审核信息
</div>
</div>
<van-cell-group class="mt10">
<div style="padding-left: 16px">
<van-field label="审核人员" :value="viewData.upa.username" left-icon="contact" readonly></van-field>
<van-field label="审核时间" :value="viewData.upa.auditTime" left-icon="clock-o"
readonly></van-field>
<van-field label="审核意见" left-icon="chat-o"
:value="viewData.upa.auditOpinion ? viewData.upa.auditOpinion : '暂无'"
readonly></van-field>
<van-field name="sign" label="签字">
<template #input>
<van-image width="200" height="100" :src="viewData.upa.auditSign"
v-if="viewData.upa.auditSign"></van-image>
<span v-else>暂无</span>
</template>
</van-field>
</div>
</van-cell-group>
</template>
<template v-if="viewData.sma">
<div class="van-cell-group__title">
<div class="van-sidebar-item van-sidebar-item--select">
校工会审核信息
</div>
</div>
<van-cell-group class="mt10">
<div style="padding-left: 16px">
<van-field label="审核人员" :value="viewData.sma.username" left-icon="contact" readonly></van-field>
<van-field label="审核时间" :value="viewData.sma.auditTime" left-icon="clock-o"
readonly></van-field>
<van-field label="审核意见" left-icon="chat-o"
:value="viewData.sma.auditOpinion ? viewData.sma.auditOpinion : '暂无'"
readonly></van-field>
<van-field name="sign" label="签字">
<template #input>
<van-image width="200" height="100" :src="viewData.sma.auditSign"
v-if="viewData.sma.auditSign"></van-image>
<span v-else>暂无</span>
</template>
</van-field>
</div>
</van-cell-group>
</template>
<template v-if="handle">
<slot name="handle"></slot>
</template>
</div>
</template>
<script>
module.exports = {
props: {
handle: {
type: Boolean,
default: false,
},
title: {
type: String,
default: '审核'
},
id: {
type: String,
default: ''
},
},
data() {
return {
viewData: {},
}
},
components: {
'vant-file-upload': httpVueLoader('/components/plugins/VantFileUpload.vue')
},
methods: {
async getInfo(id) {
const {data, code, msg} = await $.get("/platform/fw/difficulty/applylist/findOne", {id})
if (data) {
condolence.toFormData(data)
this.viewData = data
} else {
this.viewData = {}
this.$toast.fail('获取信息失败');
}
},
},
async created() {
await this.getInfo(this.id)
}
}
</script>
<style>
.van-cell-group__title {
padding-left: 0 !important;
}
.van-sidebar-item {
font-size: 16px !important;
text-indent: 4px !important;
}
.van-sidebar-item--select::before {
left: 5px !important;
}
</style>
@@ -1,214 +0,0 @@
<template>
<div style="padding-bottom: 20px;">
<van-form readonly input-align="right">
<div class="van-cell-group__title">
<div class="van-sidebar-item van-sidebar-item--select">
申请信息
</div>
</div>
<van-cell-group>
<van-field :value="viewData.loginname" label="工号" left-icon="contact"></van-field>
<van-field label="姓名" :value="viewData.username" left-icon="contact"></van-field>
<van-field label="性别" :value="viewData.sex" left-icon="ellipsis"></van-field>
<van-field label="民族" left-icon="bar-chart-o" :value="viewData.nation"></van-field>
<van-field label="学历" left-icon="coupon-o" :value="viewData.education"></van-field>
<van-field label="学位" left-icon="comment-o" :value="viewData.academicDegree"></van-field>
<van-field label="政治面貌" left-icon="label-o" :value="viewData.political"></van-field>
<van-field :value="viewData.personType" label="人员类型" left-icon="label-o"></van-field>
<van-field label="身份证" left-icon="idcard" :value="viewData.idcard"></van-field>
<van-field label="联系电话" left-icon="phone-o" :value="viewData.mobile"></van-field>
<van-field label="户口所在地" left-icon="wap-home-o"
:value="viewData.registeredResidence"></van-field>
<van-field label="现居住地" left-icon="home-o" :value="viewData.homeAddress"></van-field>
<van-field label="工作单位" left-icon="cluster-o" :value="viewData.unitname"></van-field>
<van-field label="职务" left-icon="debit-pay" :value="viewData.position"></van-field>
</van-cell-group>
</van-form>
<van-cell-group class="mt10 up_down">
<div class="van-cell" style="flex-flow: column">
<div style="display: flex">
<div class="van-field__left-icon">
<i class="van-icon van-icon-notes-o"></i>
</div>
<div class="van-cell__title van-field__label">
<span>个人工作简历</span>
</div>
</div>
<van-divider></van-divider>
<van-field readonly>
<template #input>
<div v-html="viewData.position"></div>
</template>
</van-field>
</div>
</van-cell-group>
<van-cell-group class="mt10 up_down">
<div class="van-cell" style="flex-flow: column">
<div style="display: flex">
<div class="van-field__left-icon">
<i class="van-icon van-icon-award-o"></i>
</div>
<div class="van-cell__title van-field__label">
<span>特长</span>
</div>
</div>
<van-divider></van-divider>
<van-field readonly>
<template #input>
<div v-html="viewData.specialSkill"></div>
</template>
</van-field>
</div>
</van-cell-group>
<van-cell-group class="mt10 up_down">
<div class="van-cell" style="flex-flow: column">
<div class="van-cell__title van-field__label"
style="display: flex;justify-content: space-between">
<div style="display: flex;">
<div class="van-field__left-icon">
<i class="van-icon van-icon-friends-o"></i>
</div>
<div class="van-cell__title van-field__label" style="width: auto">
<span>家庭主要成员及联系方式</span>
</div>
</div>
</div>
<van-divider></van-divider>
<div v-if="family && family.length>0">
<div v-for="(o,i) in family" class="mt5">
<div style="font-weight: 700;display: flex;justify-content: space-between">
<span>成员{{ toChinesNum(i + 1) }}</span>
</div>
<van-form readonly input-align="right">
<van-field label="关系" :value="o.relation" left-icon="exchange"></van-field>
<van-field label="姓名" :value="o.name" left-icon="user-o"></van-field>
<van-field label="联系方式" :value="o.mobile" left-icon="phone-o"></van-field>
</van-form>
</div>
</div>
<div v-else style="height: 100px">
</div>
</div>
</van-cell-group>
<template v-if="unionAudit">
<div class="van-cell-group__title mt20">
<div class="van-sidebar-item van-sidebar-item--select">
分工会审核信息
</div>
</div>
<van-cell-group>
<van-field label="审&ensp;核&ensp;人" :value="unionAudit.username" left-icon="contact"
readonly></van-field>
<van-field label="审核时间" :value="moment(unionAudit.auditTime).format('YYYY-MM-DD')"
left-icon="clock-o"
readonly></van-field>
<van-field label="审核意见" left-icon="chat-o" :value="unionAudit.auditOpinion"
readonly></van-field>
</van-cell-group>
</template>
<template v-if="schoolAudit">
<div class="van-cell-group__title mt20">
<div class="van-sidebar-item van-sidebar-item--select">
校工会审核信息
</div>
</div>
<van-cell-group>
<van-field label="审&ensp;核&ensp;人" :value="schoolAudit.username" left-icon="contact"
readonly></van-field>
<van-field label="审核时间" :value="moment(schoolAudit.auditTime).format('YYYY-MM-DD')"
left-icon="clock-o"
readonly></van-field>
<van-field label="审核意见" left-icon="chat-o" :value="schoolAudit.auditOpinion"
readonly></van-field>
</van-cell-group>
</template>
<template v-if="handle">
<slot name="handle"></slot>
</template>
</div>
</template>
<script>
module.exports = {
data() {
return {
info: {},
viewData: {},
unionAudit: {},
schoolAudit: {},
family: []
}
},
props: {
handle: {
type: Boolean,
default: false,
},
title: {
type: String,
default: '审核'
},
user_id: String,
record_id: String
},
methods: {
async getAuditInfo(id) {
const {data} = await $.get('/platform/member/common/findChangeApplyInfo', {id: id})
if (data !== null) {
const {unionAudit, schoolAudit} = data
this.info = data
this.unionAudit = unionAudit
this.schoolAudit = schoolAudit
} else {
this.unionAudit = null
this.schoolAudit = null
}
},
async getUserInfo(id) {
const {data} = await $.get('/platform/member/common/userInfo', {userId: id})
this.viewData = data
this.family = JSON.parse(data.family)
}
}
}
</script>
<style>
.card_title {
margin: 5px 0 5px 16px;
}
.van-cell-group__title {
padding-left: 0 !important;
}
.van-sidebar-item {
font-size: 16px !important;
text-indent: 4px !important;
}
.van-sidebar-item--select::before {
left: 5px !important;
}
</style>
@@ -1,208 +0,0 @@
<template>
<div style="padding-bottom: 20px;">
<van-form readonly input-align="right">
<div class="van-cell-group__title">
<div class="van-sidebar-item van-sidebar-item--select">
申请信息
</div>
</div>
<van-cell-group>
<van-field :value="viewData.loginname" label="工号" left-icon="contact"></van-field>
<van-field label="姓名" :value="viewData.username" left-icon="contact"></van-field>
<van-field label="性别" :value="viewData.sex" left-icon="ellipsis"></van-field>
<van-field label="民族" left-icon="bar-chart-o" :value="viewData.nation"></van-field>
<van-field label="学历" left-icon="coupon-o" :value="viewData.education"></van-field>
<van-field label="学位" left-icon="comment-o" :value="viewData.academicDegree"></van-field>
<van-field label="政治面貌" left-icon="label-o" :value="viewData.political"></van-field>
<van-field :value="viewData.personType" label="人员类型" left-icon="label-o"></van-field>
<van-field label="身份证" left-icon="idcard" :value="viewData.idcard"></van-field>
<van-field label="联系电话" left-icon="phone-o" :value="viewData.mobile"></van-field>
<van-field label="户口所在地" left-icon="wap-home-o" :value="viewData.registeredResidence"></van-field>
<van-field label="现居住地" left-icon="home-o" :value="viewData.homeAddress"></van-field>
<van-field label="工作单位" left-icon="cluster-o" :value="viewData.unitname"></van-field>
<van-field label="职务" left-icon="debit-pay" :value="viewData.position"></van-field>
</van-cell-group>
</van-form>
<van-cell-group class="mt10 up_down">
<div class="van-cell" style="flex-flow: column">
<div style="display: flex">
<div class="van-field__left-icon">
<i class="van-icon van-icon-notes-o"></i>
</div>
<div class="van-cell__title van-field__label">
<span>个人工作简历</span>
</div>
</div>
<van-divider></van-divider>
<van-field readonly>
<template #input>
<div v-html="viewData.position"></div>
</template>
</van-field>
</div>
</van-cell-group>
<van-cell-group class="mt10 up_down">
<div class="van-cell" style="flex-flow: column">
<div style="display: flex">
<div class="van-field__left-icon">
<i class="van-icon van-icon-award-o"></i>
</div>
<div class="van-cell__title van-field__label">
<span>特长</span>
</div>
</div>
<van-divider></van-divider>
<van-field readonly>
<template #input>
<div v-html="viewData.specialSkill"></div>
</template>
</van-field>
</div>
</van-cell-group>
<van-cell-group class="mt10 up_down">
<div class="van-cell" style="flex-flow: column">
<div class="van-cell__title van-field__label" style="display: flex;justify-content: space-between">
<div style="display: flex;">
<div class="van-field__left-icon">
<i class="van-icon van-icon-friends-o"></i>
</div>
<div class="van-cell__title van-field__label" style="width: auto">
<span>家庭主要成员及联系方式</span>
</div>
</div>
</div>
<van-divider></van-divider>
<div v-if="family && family.length>0">
<div v-for="(o,i) in family" class="mt5">
<div style="font-weight: 700;display: flex;justify-content: space-between">
<span>成员{{ toChinesNum(i + 1) }}</span>
</div>
<van-form readonly input-align="right">
<van-field label="关系" :value="o.relation" left-icon="exchange"></van-field>
<van-field label="姓名" :value="o.name" left-icon="user-o"></van-field>
<van-field label="联系方式" :value="o.mobile" left-icon="phone-o"></van-field>
</van-form>
</div>
</div>
<div v-else style="height: 100px">
</div>
</div>
</van-cell-group>
<template v-if="unionAudit!=null">
<div class="van-cell-group__title mt20">
<div class="van-sidebar-item van-sidebar-item--select">
分工会审核信息
</div>
</div>
<van-cell-group>
<van-field label="审&ensp;核&ensp;人" :value="unionAudit.username" left-icon="contact" readonly></van-field>
<van-field label="审核时间" :value="moment(unionAudit.auditTime).format('YYYY-MM-DD')" left-icon="clock-o"
readonly></van-field>
<van-field label="审核意见" left-icon="chat-o" :value="unionAudit.auditOpinion" readonly></van-field>
</van-cell-group>
</template>
<template v-if="schoolAudit!=null">
<div class="van-cell-group__title mt20">
<div class="van-sidebar-item van-sidebar-item--select">
校工会审核信息
</div>
</div>
<van-cell-group>
<van-field label="审&ensp;核&ensp;人" :value="schoolAudit.username" left-icon="contact" readonly></van-field>
<van-field label="审核时间" :value="moment(schoolAudit.auditTime).format('YYYY-MM-DD')" left-icon="clock-o"
readonly></van-field>
<van-field label="审核意见" left-icon="chat-o" :value="schoolAudit.auditOpinion" readonly></van-field>
</van-cell-group>
</template>
<template v-if="handle">
<slot name="handle"></slot>
</template>
</div>
</template>
<script>
module.exports = {
data() {
return {
viewData: {},
unionAudit: {},
schoolAudit: {},
family: []
}
},
props: {
handle: {
type: Boolean,
default: false,
},
title: {
type: String,
default: '审核'
},
user_id: String,
record_id: String
},
methods: {
// getDetailInfo(user_id, record_id) {
// this.getUserInfo(user_id)
// this.getAuditInfo(record_id)
// },
async getAuditInfo(id) {
const {data} = await $.get('/platform/member/common/findApplyInfo', {id: id})
if (data !== null) {
const {unionAudit, schoolAudit} = data
this.unionAudit = unionAudit
this.schoolAudit = schoolAudit
} else {
this.unionAudit = null
this.schoolAudit = null
}
},
async getUserInfo(id) {
const {data} = await $.get('/platform/member/common/userInfo', {userId: id})
this.viewData = data
this.family = JSON.parse(data.family)
}
}
}
</script>
<style>
.card_title {
margin: 5px 0 5px 16px;
}
.van-cell-group__title {
padding-left: 0 !important;
}
.van-sidebar-item {
font-size: 16px !important;
text-indent: 4px !important;
}
.van-sidebar-item--select::before {
left: 5px !important;
}
</style>
@@ -1,247 +0,0 @@
<template>
<div style="padding-bottom: 20px;">
<van-form readonly input-align="right">
<div class="van-cell-group__title">
<div class="van-sidebar-item van-sidebar-item--select">
基础信息
</div>
</div>
<van-cell-group>
<van-field readonly :value="viewData.username" label="姓名"></van-field>
<van-field readonly :value="viewData.loginname" label="工资号"></van-field>
<van-field readonly :value="viewData.dwname" label="单位"></van-field>
<van-field readonly :value="viewData.ghname" label="工会"></van-field>
</van-cell-group>
<div class="van-cell-group__title">
<div class="van-sidebar-item van-sidebar-item--select">
作品信息
</div>
</div>
<van-cell-group>
<van-field readonly name="type" :value="viewData.hdname" label="作品主题"></van-field>
<van-field readonly name="type" :value="viewData.hdlbname" label="活动类别"></van-field>
<van-field readonly name="type" :value="viewData.step_count" label="健步走步数"
v-if="viewData.step_count"></van-field>
<van-field readonly name="type" :value="viewData.zname" label="作品类别" v-if="viewData.zname"></van-field>
<van-field readonly :value="viewData.hdsbzpms" label="简介"
input-align="left"
style="flex-flow: column"
rows="2" maxlength="200" type="textarea" show-word-limit autosize></van-field>
<van-field label="照片" style="flex-flow: column" input-align="left">
<template #label>
<div class="mb10">照&emsp;&emsp;片</div>
</template>
<template #input>
<vant-file-upload :files.sync="img2List" view :del="false"
v-if="img2List&&img2List.length>0"></vant-file-upload>
<div v-if="img2List.length===0" style="text-align: center;color: #c2bbbb;font-size: 10px;">
没有照片。
</div>
</template>
</van-field>
<van-field label="视频" style="flex-flow: column" input-align="left">
<template #label>
<div class="mb10">视&emsp;&emsp;频</div>
</template>
<template #input>
<div v-if="videoList.length>0">
<div v-for="item in videoList" class="mt10">
<video id="myVideo" class="video-js vjs-default-skin vjs-big-play-centered" controls preload="auto"
width="640" height="264"
data-setup="{}" webkit-playsinline='true' playsinline='true' x-webkit-airplay='true'
x5-video-player-type='h5' x5-video-player-fullscreen='true' x5-video-ignore-metadata='true'>
<source :src="item.url" type="video/mp4">
</video>
</div>
</div>
<div v-if="videoList.length===0" style="text-align: center;color: #c2bbbb;font-size: 10px;">
没有视频。
</div>
</template>
</van-field>
<van-field label="音频" style="flex-flow: column" input-align="left">
<template #label>
<div class="mb10">音&emsp;&emsp;频</div>
</template>
<template #input>
<div v-if="audioList&&audioList.length>0">
<div v-for="audio in audioList" class="mt10">
<audio id="amusic" preload="auto" controls>
<source :src="FILE_DOMAIN+audio.url"/>
</audio>
</div>
</div>
<div style="text-align: center;color: #c2bbbb;font-size: 10px;" v-if="audioList.length===0">
没有音频。
</div>
</template>
</van-field>
<van-field label="文档" style="flex-flow: column" input-align="left">
<template #label>
<div class="mb10">文&emsp;&emsp;档</div>
</template>
<template #input>
<div v-for="(item,index) in docList" v-if="docList&&docList.length>0">
<div class="text-nowrap color-puple"
@click="previewFile(item.filepath,item.filename,docList,index,item.id)">
{{ item.filename }}
</div>
</div>
<div v-if="docList.length===0" style="text-align: center;color: #c2bbbb;font-size: 10px;">
没有文档。
</div>
</template>
</van-field>
</van-cell-group>
<template v-if="viewData.union">
<div class="van-cell-group__title">
<div class="van-sidebar-item van-sidebar-item--select">
分工会审核信息
</div>
</div>
<van-cell-group>
<van-field readonly name="type" :value="viewData.union.username" label="审核人"></van-field>
<van-field label="审核时间" :value="viewData.union.auditTime" left-icon="clock-o"
readonly></van-field>
<van-field label="审核意见" left-icon="chat-o"
:value="viewData.union.auditOpinion ? viewData.union.auditOpinion : '暂无'"
readonly></van-field>
<van-field name="sign" label="签字">
<template #input>
<van-image width="200" height="100" :src="viewData.union.auditSign"
v-if="viewData.union.auditSign"></van-image>
<span v-else>暂无</span>
</template>
</van-field>
</van-cell-group>
</template>
<template v-if="viewData.school">
<div class="van-cell-group__title">
<div class="van-sidebar-item van-sidebar-item--select">
校工会审核信息
</div>
</div>
<van-cell-group>
<van-field readonly name="type" :value="viewData.school.username" label="审核人"></van-field>
<van-field label="审核时间" :value="viewData.school.auditTime" left-icon="clock-o"
readonly></van-field>
<van-field label="审核意见" left-icon="chat-o"
:value="viewData.school.auditOpinion ? viewData.school.auditOpinion : '暂无'"
readonly></van-field>
<van-field name="sign" label="签字">
<template #input>
<van-image width="200" height="100" :src="viewData.school.auditSign"
v-if="viewData.school.auditSign"></van-image>
<span v-else>暂无</span>
</template>
</van-field>
</van-cell-group>
</template>
</van-form>
<template v-if="handle">
<slot name="handle"></slot>
</template>
</div>
</template>
<script>
module.exports = {
props: {
handle: {
type: Boolean,
default: false,
},
title: {
type: String,
default: '审核'
},
id: {
type: String,
default: ''
},
},
data() {
return {
viewData: {},
videoList: [],
prevImgList: [],
img2List: [],
audioList: [],
docList: [],
imgtype: ['gif', 'jpg', 'png', 'jpeg'],
videotype: ['flv', 'swf', 'mkv', 'avi', 'rm', 'rmvb', 'wmv', 'mp4', 'mov', 'mpg', 'mpeg'],
doctype: ['doc', 'docx'],
audiotype: ['mp3', 'wma', 'flac', 'wav', 'm4a', 'amr', 'au'],
}
},
components: {
'vant-file-upload': httpVueLoader('/components/plugins/VantFileUpload.vue')
},
methods: {
async getInfo(id) {
const {data, code, msg} = await $.get("/platform/hd/wmhd/findOneById", {id})
const refs = await $.get("/platform/hd/wmhd/findxxById", {id})
if (refs) {
this.viewData = refs.data
console.log(refs)
data.forEach(val => {
val.fjname = val.filename
val.fjurl = val.filepath
val.id = val.filepath
val.url = FILE_DOMAIN + '/fileStreamPreview?id=' + val.filepath
let filetype = val.fjname.substring(val.fjname.lastIndexOf('.') + 1, val.fjname.length).toLowerCase();
if (this.videotype.indexOf(filetype) > -1) {
this.videoList.push(val);
} else if (this.imgtype.indexOf(filetype) > -1) {
this.prevImgList.push(val.url)
this.img2List.push(val);
} else if (this.doctype.indexOf(filetype) > -1) {
this.docList.push(val);
} else if (this.audiotype.indexOf(filetype) > -1) {
this.audioList.push(val);
}
})
} else {
this.viewData = {}
this.$toast.fail('获取信息失败');
}
},
},
async created() {
}
}
</script>
<style>
.van-cell-group__title {
padding-left: 0 !important;
}
.van-sidebar-item {
font-size: 16px !important;
text-indent: 4px !important;
}
.van-sidebar-item--select::before {
left: 5px !important;
}
</style>
@@ -1,311 +1,322 @@
<template> <template>
<div>
<el-card shadow="never">
<div class="search">
<div class="search-item">
<div class="search-item-label">活动分组:</div>
<div class="search-item-option">
<el-select
placeholder="活动分组"
v-model="pageForm.groupId"
style="width: 100%"
@change="
doSearch()
viewGroupName()
"
filterable
>
<el-option v-for="item in activityGroupList" :label="item.groupName" :value="item.groupId"></el-option>
</el-select>
</div>
</div>
<div> <div class="search-item">
<el-card shadow="never"> <div class="search-item-label">姓名工号:</div>
<div class="search"> <div class="search-item-option">
<div class="search-item"> <el-input
<div class="search-item-label">活动分组:</div> placeholder="请输入内容"
<div class="search-item-option"> clearable
<el-select placeholder="活动分组" v-model="pageForm.groupId" v-model="pageForm.searchKeyword"
style="width: 100%;" style="width: 100%"
@change="doSearch();viewGroupName()" @keyup.enter.native="doSearch"
filterable> >
<el-option v-for="item in activityGroupList" :label="item.groupName" <el-select v-model="pageForm.searchName" slot="prepend" placeholder="查询类型" style="width: 80px">
:value="item.groupId"></el-option> <el-option label="姓名" value="username"></el-option>
</el-select> <el-option label="工号" value="loginname"></el-option>
</div> </el-select>
</div> </el-input>
</div>
</div>
<div class="search-item"> <div class="search-item" v-if="is_sysadmin || is_A06 || is_H03">
<div class="search-item-label">姓名工号:</div> <div class="search-item-label">所属工会:</div>
<div class="search-item-option"> <div class="search-item-option">
<el-input placeholder="请输入内容" clearable v-model="pageForm.searchKeyword" <el-select
style="width: 100%" placeholder="所属工会"
@keyup.enter.native="doSearch"> v-model="pageForm.unionId"
<el-select v-model="pageForm.searchName" slot="prepend" style="width: 100%"
placeholder="查询类型" clearable="true"
style="width: 80px;"> @change="flushUnits"
<el-option label="姓名" value="username"></el-option> @clear="flushUnits"
<el-option label="工号" value="loginname"></el-option> filterable="true"
</el-select> >
</el-input> <el-option v-for="item in unions" :label="item.unionname" :value="item.id"></el-option>
</div> </el-select>
</div> </div>
</div>
<div class="search-item" <div class="search-item">
v-if="is_sysadmin||is_A06||is_H03"> <div class="search-item-label">所属单位:</div>
<div class="search-item-label">所属工会:</div> <div class="search-item-option">
<div class="search-item-option"> <el-select
<el-select placeholder="所属工会" v-model="pageForm.unionId" placeholder="所属单位"
style="width: 100%;" v-model="pageForm.unitId"
clearable="true" style="width: 100%"
@change="flushUnits" @clear="flushUnits" clearable="true"
filterable="true"> @change="doSearch"
<el-option v-for="item in unions" :label="item.unionname" filterable="true"
:value="item.id"></el-option> >
</el-select> <el-option v-for="item in units" :label="item.name" :value="item.id"></el-option>
</div> </el-select>
</div> </div>
</div>
<div class="search-item"> <!--<div class="search-item"
<div class="search-item-label">所属单位:</div> v-if="${@shiro.hasRole('sysadmin')}">
<div class="search-item-option"> <div class="search-item-label">活动工会:</div>
<el-select placeholder="所属单位" v-model="pageForm.unitId" style="width: 100%;" <div class="search-item-option">
clearable="true" <el-select placeholder="所属工会" v-model="pageForm.activityUnionId"
@change="doSearch" style="width: 100%;"
filterable="true"> clearable="true"
<el-option v-for="item in units" :label="item.name" @change="flushUnits" @clear="flushUnits"
:value="item.id"></el-option> filterable="true">
</el-select> <el-option v-for="item in ActivityUnions" :label="item.unionname"
</div> :value="item.id"></el-option>
</div> </el-select>
</div>
</div>
<!--<div class="search-item" <div class="search-item" v-if="${@shiro.hasRole('sysadmin')}">
v-if="${@shiro.hasRole('sysadmin')}"> <div class="search-item-label">活动单位:</div>
<div class="search-item-label">活动工会:</div> <div class="search-item-option">
<div class="search-item-option"> <el-select placeholder="所属单位" v-model="pageForm.activityUnitId"
<el-select placeholder="所属工会" v-model="pageForm.activityUnionId" style="width: 100%;"
style="width: 100%;" clearable="true"
clearable="true" @change="doSearch"
@change="flushUnits" @clear="flushUnits" filterable="true">
filterable="true"> <el-option v-for="item in ActivityUnits" :label="item.name"
<el-option v-for="item in ActivityUnions" :label="item.unionname" :value="item.id"></el-option>
:value="item.id"></el-option> </el-select>
</el-select> </div>
</div>-->
<div class="search-item">
<div class="search-item-label">人员类型:</div>
<div class="search-item-option">
<dict-select
v-model="pageForm.personType"
style="width: 100%"
clearable
placeholder="人员类型"
@change="doSearch"
code="UserType"
></dict-select>
</div>
</div>
<div class="search-item">
<div class="search-item-label">在职状态:</div>
<div class="search-item-option">
<dict-select
v-model="pageForm.userState"
style="width: 100%"
clearable
placeholder="在职状态"
@change="doSearch"
code="UserState"
></dict-select>
</div>
</div>
<div class="search-query">
<el-button type="primary" icon="el-icon-search" @click="doSearch">搜索</el-button>
</div>
</div> </div>
</div> </el-card>
<div class="search-item" v-if="${@shiro.hasRole('sysadmin')}">
<div class="search-item-label">活动单位:</div>
<div class="search-item-option">
<el-select placeholder="所属单位" v-model="pageForm.activityUnitId"
style="width: 100%;"
clearable="true"
@change="doSearch"
filterable="true">
<el-option v-for="item in ActivityUnits" :label="item.name"
:value="item.id"></el-option>
</el-select>
</div>
</div>-->
<div class="search-item">
<div class="search-item-label">人员类型:</div>
<div class="search-item-option">
<dict-select v-model="pageForm.personType" style="width: 100%" clearable
placeholder="人员类型"
@change="doSearch"
code="UserType"></dict-select>
</div>
</div>
<div class="search-item">
<div class="search-item-label">在职状态:</div>
<div class="search-item-option">
<dict-select v-model="pageForm.userState" style="width: 100%" clearable
placeholder="在职状态"
@change="doSearch"
code="UserState"></dict-select>
</div>
</div>
<div class="search-query">
<el-button type="primary" icon="el-icon-search" @click="doSearch">搜索</el-button>
</div>
</div>
</el-card>
<el-card shadow="never" class="mt10">
<table-tool :label="currentGroupName" :app="this">
<template #label_end>
<!-- <span class="text-danger pl5">提醒:删除活动分组操作,请先选择某个活动分组后,再点击右边的删除按钮。</span>-->
</template>
<template #func>
<el-button @click="doExportUser" icon="el-icon-printer"
size="medium" type="primary" :disabled="!pageForm.groupId">
导出活动分组人员xlsx
</el-button>
<el-button @click="doDelete(null,pageForm.groupId)"
type="danger"
size="medium" :disabled="tableData.length===0">
删除{{ currentGroupName }}
</el-button>
</template>
</table-tool>
<el-table ref="userTable" :data="tableData" stripe border :size="tableSize">
<el-table-column type="index" label="序号" width="80px"></el-table-column>
<el-table-column
align="center"
header-align="center"
v-for="column in tableColumns"
show-overflow-tooltip
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
></el-table-column>
<el-table-column align="center" header-align="center" label="操作" width="100">
<template scope="{row}">
<el-button size="mini" type="danger" @click="doDelete(row.id,null)">删除
</el-button>
</template>
</el-table-column>
</el-table>
<el-row class="el-pagination-container" style="margin-bottom: 0px">
<el-pagination
@size-change="pageSizeChange"
@current-change="pageNumberChange"
:current-page="pageForm.pageNumber"
:page-sizes="[5,10, 20, 30, 50]"
:page-size="pageForm.pageSize"
layout="total, sizes, prev, pager, next"
:total="pageForm.totalCount">
</el-pagination>
</el-row>
</el-card>
</div>
<el-card shadow="never" class="mt10">
<table-tool :label="currentGroupName" :app="this">
<template #label_end>
<!-- <span class="text-danger pl5">提醒:删除活动分组操作,请先选择某个活动分组后,再点击右边的删除按钮。</span>-->
</template>
<template #func>
<el-button @click="doExportUser" icon="el-icon-printer" size="medium" type="primary" :disabled="!pageForm.groupId">
导出活动分组人员xlsx
</el-button>
<el-button @click="doDelete(null, pageForm.groupId)" type="danger" size="medium" :disabled="tableData.length === 0">
删除{{ currentGroupName }}
</el-button>
</template>
</table-tool>
<el-table ref="userTable" :data="tableData" stripe border :size="tableSize">
<el-table-column type="index" label="序号" width="80px"></el-table-column>
<el-table-column
align="center"
header-align="center"
v-for="column in tableColumns"
show-overflow-tooltip
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
></el-table-column>
<el-table-column align="center" header-align="center" label="操作" width="100">
<template scope="{row}">
<el-button size="mini" type="danger" @click="doDelete(row.id, null)">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-row class="el-pagination-container" style="margin-bottom: 0px">
<el-pagination
@size-change="pageSizeChange"
@current-change="pageNumberChange"
:current-page="pageForm.pageNumber"
:page-sizes="[5, 10, 20, 30, 50]"
:page-size="pageForm.pageSize"
layout="total, sizes, prev, pager, next"
:total="pageForm.totalCount"
></el-pagination>
</el-row>
</el-card>
</div>
</template> </template>
<script> <script>
module.exports = { module.exports = {
props: { props: {
group_id: { group_id: {
type: String, default: '' type: String,
} default: ""
},
computed: {
is_H10() {
return this.roleData.is_H10
},
is_A06() {
return this.roleData.is_A06
},
is_H04() {
return this.roleData.is_H04
},
is_H02() {
return this.roleData.is_H02
},
is_H03() {
return this.roleData.is_H03
},
is_sysadmin() {
return this.roleData.is_sysadmin
},
unionid() {
return this.roleData.unionid
},
},
data() {
return {
activityGroupList: [],
ActivityUnions: [],
ActivityUnits: [],
unions: [],
units: [],
pageForm: {
unionId: "",
unitId: "",
searchName: "username",
personTypes: [],
userStates: [],
memberStatus: [],
year: moment().format('YYYY')
},
tableColumns: [
{prop: 'loginName', label: '工号'},
{prop: 'userName', label: '姓名'},
{prop: 'sex', label: '性别'},
{prop: 'birthday', label: '出生年月'},
{prop: 'mobile', label: '联系电话'},
{prop: 'personType', label: '人员类型', sortable: true},
{prop: 'userState', label: '在职状态', sortable: true},
{prop: 'unitName', label: '所属单位', sortable: true},
{prop: 'unionName', label: '所属工会', sortable: true},
{prop: 'activityUnionName', label: '活动工会', sortable: true},
{prop: 'groupName', label: '所属分组', sortable: true},
],
roleData: {},
currentGroupName: null,
}
},
mixins: [initTableMixins],
components: {
'dict-select': httpVueLoader('/components/plugins/DictSelect.vue?v=1.0.0')
},
methods: {
viewGroupName() {
if (this.pageForm.groupId) {
const group = this.activityGroupList.find(v => v.groupId === this.pageForm.groupId)
this.currentGroupName = group.groupName + '人员'
return
}
this.currentGroupName = '全部人员'
},
doExportUser() {
window.open("/platform/activity/basic/user/doExportUser?groupId=" + this.pageForm.groupId)
},
doSearch2() {
this.getActivityGroup()
this.doSearch()
},
async doDelete(id, groupId) {
const confirm = await this.$confirm('您确定要删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
if (confirm === 'confirm') {
const resp = await $.post('/platform/activity/basic/user/doDelete', {id, groupId})
if (resp.code === 0) {
this.$message.success(resp.msg)
this.$set(this.pageForm, "groupId", null)
this.doSearch()
await this.getActivityGroup()
this.$emit('group_change')
} }
}
}, },
async flushUnits() { computed: {
this.$set(this.pageForm, "unitId", "") is_H10() {
this.units = await getUnits(this.pageForm.unionId) return this.roleData.is_H10
/* if (this.is_A06 || this.is_sysadmin || this.is_H03) { },
this.units = await getUnits(this.pageForm.unionId) is_A06() {
this.ActivityUnits = await getActivityUnits(this.pageForm.activityUnionId) return this.roleData.is_A06
} else { },
this.units = await getUnits(this.unionid) is_H04() {
}*/ return this.roleData.is_H04
},
is_H02() {
return this.roleData.is_H02
},
is_H03() {
return this.roleData.is_H03
},
is_sysadmin() {
return this.roleData.is_sysadmin
},
unionid() {
return this.roleData.unionid
}
}, },
async getActivityGroup() { data() {
this.pageForm.groupId = '' return {
const resp = await $.get('/platform/activity/basic/scope/getActivityUserScopeGroup') activityGroupList: [],
this.activityGroupList = resp.data ActivityUnions: [],
if (resp.data && resp.data.length > 0) { ActivityUnits: [],
this.$set(this.pageForm, "groupId", resp.data[0].groupId) unions: [],
} units: [],
await this.pageData() pageForm: {
unionId: "",
unitId: "",
searchName: "username",
personTypes: [],
userStates: [],
memberStatus: [],
year: moment().format("YYYY")
},
tableColumns: [
{ prop: "loginName", label: "工号" },
{ prop: "userName", label: "姓名" },
{ prop: "sex", label: "性别" },
{ prop: "birthday", label: "出生年月" },
{ prop: "mobile", label: "联系电话" },
{ prop: "personType", label: "人员类型", sortable: true },
{ prop: "userState", label: "在职状态", sortable: true },
{ prop: "unitName", label: "所属单位", sortable: true },
{ prop: "unionName", label: "所属工会", sortable: true },
{ prop: "activityUnionName", label: "活动工会", sortable: true },
{ prop: "groupName", label: "所属分组", sortable: true }
],
roleData: {},
currentGroupName: null
}
}, },
async pageData() { mixins: [initTableMixins],
sublime.showLoadingbar() components: {
const resp = await $.post('/platform/activity/basic/user/pageData', this.pageForm) "dict-select": httpVueLoader("/components/plugins/DictSelect.vue?v=1.0.0")
if (resp.code === 0) {
this.tableData = resp.data.list
this.pageForm.totalCount = resp.data.totalCount
}
sublime.closeLoadingbar()
}, },
methods: {
}, viewGroupName() {
async created() { if (this.pageForm.groupId) {
this.unions = await getUnions(null) const group = this.activityGroupList.find((v) => v.groupId === this.pageForm.groupId)
// this.ActivityUnions = await getActivityUnions() this.currentGroupName = group.groupName + "人员"
await this.flushUnits() return
await this.getActivityGroup() }
this.viewGroupName() this.currentGroupName = "全部人员"
},
} doExportUser() {
window.open("/platform/activity/basic/user/doExportUser?groupId=" + this.pageForm.groupId)
},
doSearch2() {
this.getActivityGroup()
this.doSearch()
},
async doDelete(id, groupId) {
const confirm = await this.$confirm("您确定要删除吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
if (confirm === "confirm") {
const resp = await $.post("/platform/activity/basic/user/doDelete", { id, groupId })
if (resp.code === 0) {
this.$message.success(resp.msg)
await this.pageData()
if (groupId) {
await this.getActivityGroup()
}
this.$emit("group_change")
}
}
},
async flushUnits() {
this.$set(this.pageForm, "unitId", "")
this.units = await getUnits(this.pageForm.unionId)
/* if (this.is_A06 || this.is_sysadmin || this.is_H03) {
this.units = await getUnits(this.pageForm.unionId)
this.ActivityUnits = await getActivityUnits(this.pageForm.activityUnionId)
} else {
this.units = await getUnits(this.unionid)
}*/
},
async getActivityGroup() {
this.$set(this.pageForm, "groupId", null)
const resp = await $.get("/platform/activity/basic/scope/getActivityUserScopeGroup")
this.activityGroupList = resp.data
if (resp.data && resp.data.length > 0) {
this.$set(this.pageForm, "groupId", resp.data[0].groupId)
}
await this.pageData()
},
async pageData() {
sublime.showLoadingbar()
const resp = await $.post("/platform/activity/basic/user/pageData", this.pageForm)
if (resp.code === 0) {
this.tableData = resp.data.list
this.pageForm.totalCount = resp.data.totalCount
}
sublime.closeLoadingbar()
}
},
async created() {
this.unions = await getUnions(null)
// this.ActivityUnions = await getActivityUnions()
await this.flushUnits()
await this.getActivityGroup()
this.viewGroupName()
}
} }
</script> </script>
@@ -4,11 +4,14 @@
<div style="text-align: right"> <div style="text-align: right">
<van-button plain type="danger" hairline size="small" @click="openSignDrawingBoard" native-type="button">打开签字版</van-button> <van-button plain type="danger" hairline size="small" @click="openSignDrawingBoard" native-type="button">打开签字版</van-button>
</div> </div>
<van-popup v-model="signDrawingBoardShow" position="bottom" :style="{ height: '60vh' }"> <van-popup v-model="signDrawingBoardShow" position="bottom" :style="{ height: '60vh' }" get-container="body">
<div id="canvas" style="position: relative; width: 100%"></div> <div id="canvas" style="position: relative; width: 100%; height: calc(100% - 50px)"></div>
<div class="button-extra"> <div
<van-button plain type="danger" hairline size="small" @click="reset" native-type="button">清空重签</van-button> class="button-extra"
<van-button plain type="primary" hairline size="small" @click="confirm" native-type="button">确定</van-button> style="height: 50px; display: flex; justify-content: space-between; align-items: center; padding: 0 20px; column-gap: 20px"
>
<van-button plain type="danger" block hairline @click="reset" native-type="button">清空重签</van-button>
<van-button plain type="primary" block hairline @click="confirm" native-type="button">确定</van-button>
</div> </div>
</van-popup> </van-popup>
</div> </div>
@@ -54,6 +57,8 @@ module.exports = {
openSignDrawingBoard() { openSignDrawingBoard() {
this.signDrawingBoardShow = true this.signDrawingBoardShow = true
this.$nextTick(() => { this.$nextTick(() => {
// 删除之前的canvas
$("#canvas").empty()
$("#canvas").jSignature({ $("#canvas").jSignature({
width: "100%", width: "100%",
height: "100%", height: "100%",
@@ -99,8 +104,15 @@ module.exports = {
if (this.is_value_base64) { if (this.is_value_base64) {
this.imageUrl = value this.imageUrl = value
} else { } else {
this.imageUrl = "/signature/getSignData?path=" + value const prefix = "data:image/png;base64,"
if (!value.startsWith(prefix)) {
this.imageUrl = "/signature/getSignData?path=" + value
} else {
this.imageUrl = null
value = null
}
} }
this.$emit("input", value)
}, },
checkNull() { checkNull() {
return $("#canvas").jSignature("getData", "native").length === 0 return $("#canvas").jSignature("getData", "native").length === 0
@@ -85,7 +85,7 @@ module.exports = {
const ts = new Date().getTime() + (Math.floor(Math.random() * (1000 - 1 + 1)) + 1).toString() const ts = new Date().getTime() + (Math.floor(Math.random() * (1000 - 1 + 1)) + 1).toString()
console.log(ts) console.log(ts)
// this.postAddress = location.protocol + '//' + location.host + '/signature?prefix=' + this.prefix + '&id=' + ts + "&is_value_base64=" + this.is_value_base64 // this.postAddress = location.protocol + '//' + location.host + '/signature?prefix=' + this.prefix + '&id=' + ts + "&is_value_base64=" + this.is_value_base64
this.postAddress = "http://10.10.10.15/signature?prefix=" + this.prefix + "&id=" + ts + "&is_value_base64=" + this.is_value_base64 this.postAddress = "http://localhost/signature?prefix=" + this.prefix + "&id=" + ts + "&is_value_base64=" + this.is_value_base64
this.showQrCode = true this.showQrCode = true
@@ -161,7 +161,14 @@ layout("/mobile/platform.html"){
<van-button @click.stop="openView(o)" type="primary" size="small" color="#1867b0" style="margin-right: 8px; width: auto"> <van-button @click.stop="openView(o)" type="primary" size="small" color="#1867b0" style="margin-right: 8px; width: auto">
查看 查看
</van-button> </van-button>
<van-button @click.stop="openAudit(o)" type="primary" size="small" color="#1867b0" style="margin-right: 8px; width: auto"> <van-button
@click.stop="openAudit(o)"
v-if="o.status == 1"
type="primary"
size="small"
color="#1867b0"
style="margin-right: 8px; width: auto"
>
审核 审核
</van-button> </van-button>
</div> </div>
@@ -505,10 +505,21 @@ layout("/mobile/platform.html"){
} }
str += "请确认是否申请加入【" + row.name + "】?" str += "请确认是否申请加入【" + row.name + "】?"
vant.Dialog.confirm({ title: "提示", message: str }) vant.Dialog.confirm({ title: "提示", message: str })
.then(() => { .then(async () => {
this.formData.clubid = row.id this.formData.clubid = row.id
this.formData.photo = this.formData.photo[0].filepath if (this.formData.photo && this.formData.photo.length > 0) {
$.post( this.formData.photo = this.formData.photo[0].filepath
}
// this.formData.photo = this.formData.photo[0].filepath
const resp = await $.post("/platform/sys/club/sq/submit", this.formData)
if (resp.code === 0) {
vant.Toast(resp.msg)
this.doSearch()
this.infoShow = false
} else {
vant.Toast(resp.msg)
}
/*$.post(
"/platform/sys/club/sq/submit", "/platform/sys/club/sq/submit",
this.formData, this.formData,
(data) => { (data) => {
@@ -521,7 +532,7 @@ layout("/mobile/platform.html"){
} }
}, },
"json" "json"
) )*/
}) })
.catch(() => {}) .catch(() => {})
}, },
@@ -3,208 +3,149 @@ layout("/mobile/platform.html"){
#--> #-->
<div id="app" v-cloak> <div id="app" v-cloak>
<van-nav-bar title="填写慰问申请" left-arrow placeholder fixed @click-left="pjaxReplace('/mobile/index')"></van-nav-bar> <van-nav-bar title="填写慰问申请" left-arrow placeholder fixed
@click-left="history.back()"></van-nav-bar>
<van-form ref="addForm" :show-error-message="false" input-align="right" style="margin-bottom: 60px"> <van-form ref="addForm" :show-error-message="false" input-align="right" style="margin-bottom: 60px">
<van-cell-group inset class="mt10"> <van-cell-group inset class="mt10">
<van-field readonly value="${@shiro.getPrincipalProperty('username')}" name="manager_name" label="经办人姓名"></van-field> <van-field readonly value="${@shiro.getPrincipalProperty('username')}" name="manager_name"
<van-field readonly value="${@shiro.getPrincipalProperty('loginname')}" name="manager_name" label="经办人工号"></van-field> label="经办人姓名"></van-field>
<van-field <van-field readonly value="${@shiro.getPrincipalProperty('loginname')}" name="manager_name"
@input="userRemoteMethod" label="经办人工号"></van-field>
name="be_user_name" <van-field @input="userRemoteMethod" name="be_user_name"
required required
v-model="formData.be_user_name" v-model="formData.be_user_name" label="慰问对象" placeholder="请输入慰问对象"
label="慰问对象" :rules="[{ required: true, message: '请填写慰问对象' }]"></van-field>
placeholder="请输入慰问对象" <van-action-sheet v-model="sheetShow"
:rules="[{ required: true, message: '请填写慰问对象' }]" :actions="userList"
></van-field> cancel-text="重新输入姓名或工号查询"
<van-action-sheet @cancel="userList = []; formData.be_user_name = ''"
v-model="sheetShow" :close-on-click-overlay="false"
:actions="userList" @select="onUserSelect">
cancel-text="重新输入姓名或工号查询" </van-action-sheet>
@cancel="userList = []; formData.be_user_name = ''"
:close-on-click-overlay="false"
@select="onUserSelect"
></van-action-sheet>
<van-field readonly :value="formData.apply_time" name="apply_time" label="申请时间"></van-field> <van-field readonly :value="formData.apply_time" name="apply_time"
label="申请时间"
<van-field
@input="payeeUserRemoteMethod"
name="payee_name"
required
:rules="[{ required: true, message: '请选择收款人' }]"
v-model="formData.payee_name"
label="收款人"
placeholder="请输入收款人"
></van-field> ></van-field>
<van-action-sheet
v-model="payeeSheetShow"
:actions="payeeUserList" <van-field @input="payeeUserRemoteMethod" name="payee_name"
cancel-text="重新输入姓名或工号查询" required :rules="[{ required: true, message: '请选择收款人' }]"
@cancel="payeeUserList = []; formData.payee_name = ''" v-model="formData.payee_name" label="收款人" placeholder="请输入收款人"></van-field>
:close-on-click-overlay="false" <van-action-sheet v-model="payeeSheetShow"
@select="payeeOnUserSelect" :actions="payeeUserList"
></van-action-sheet> cancel-text="重新输入姓名或工号查询"
@cancel="payeeUserList = []; formData.payee_name = ''"
:close-on-click-overlay="false"
@select="payeeOnUserSelect">
</van-action-sheet>
<!--<van-field v-model="formData.payee_bank_number" name="payee_bank_number" type="number" <!--<van-field v-model="formData.payee_bank_number" name="payee_bank_number" type="number"
label="收款人银行卡" placeholder="请输入收款人银行卡"></van-field> label="收款人银行卡" placeholder="请输入收款人银行卡"></van-field>
<van-field v-model="formData.payee_bank_name" name="payee_bank_name" <van-field v-model="formData.payee_bank_name" name="payee_bank_name"
label="收款人开户行" placeholder="请输入收款人开户行"></van-field>--> label="收款人开户行" placeholder="请输入收款人开户行"></van-field>-->
<van-field
readonly <van-field readonly clickable name="type" :value="formData.typeName"
clickable required
name="type" label="慰问类型"
:value="formData.typeName" @click="showTypePicker = true" placeholder="点击选择慰问类型"
required :rules="[{ required:true, message: '请选择慰问类型'}]"></van-field>
label="慰问类型"
@click="showTypePicker = true"
placeholder="点击选择慰问类型"
:rules="[{ required:true, message: '请选择慰问类型'}]"
></van-field>
<van-popup v-model:show="showTypePicker" position="bottom" round> <van-popup v-model:show="showTypePicker" position="bottom" round>
<van-picker show-toolbar :columns="typeColumns" @confirm="onTypeConfirm" @cancel="showTypePicker = false"></van-picker> <van-picker show-toolbar :columns="typeColumns" @confirm="onTypeConfirm"
@cancel="showTypePicker = false">
</van-picker>
</van-popup> </van-popup>
<van-field <van-field readonly clickable name="way" :value="formData.wayName"
readonly label="慰问方式"
clickable required
name="way" placeholder="点击选择慰问方式"
:value="formData.wayName" :rules="[{ required:true, message: '请选择慰问方式'}]"></van-field>
label="慰问方式"
required
placeholder="点击选择慰问方式"
:rules="[{ required:true, message: '请选择慰问方式'}]"
></van-field>
<van-popup v-model:show="showWayPicker" position="bottom" round> <van-popup v-model:show="showWayPicker" position="bottom" round>
<van-picker show-toolbar :columns="wayColumns" @confirm="onWayConfirm" @cancel="showWayPicker = false"></van-picker> <van-picker show-toolbar :columns="wayColumns" @confirm="onWayConfirm"
@cancel="showWayPicker = false">
</van-picker>
</van-popup> </van-popup>
<van-field <van-field v-model="formData.money" name="money" type="number" label="慰问金额"
v-model="formData.money" placeholder="请填写慰问金额"
name="money" :rules="[{ required:true, message: '请填写慰问金额' }]"></van-field>
type="number"
label="慰问金额"
placeholder="请填写慰问金额"
:rules="[{ required:true, message: '请填写慰问金额' }]"
></van-field>
<!-- 孩次 --> <!-- 孩次 -->
<van-field <van-field readonly clickable name="type" v-model="formData.birth_child_num"
readonly required v-if="formData.type==='2'"
clickable label="孩次"
name="type" @click="showChildPicker = true" placeholder="点击选择孩次"
v-model="formData.birth_child_num" :rules="[{ required:true, message: '请选择孩次'}]"></van-field>
required
v-if="formData.type==='2'"
label="孩次"
@click="showChildPicker = true"
placeholder="点击选择孩次"
:rules="[{ required:true, message: '请选择孩次'}]"
></van-field>
<van-popup v-model:show="showChildPicker" position="bottom" round> <van-popup v-model:show="showChildPicker" position="bottom" round>
<van-picker show-toolbar :columns="childColumns" @confirm="onChildConfirm" @cancel="showChildPicker = false"></van-picker> <van-picker show-toolbar :columns="childColumns" @confirm="onChildConfirm"
@cancel="showChildPicker = false">
</van-picker>
</van-popup> </van-popup>
<van-field <van-field
required required
:rules="[{ required:true, message: '请填写慰问时间' }]" :rules="[{ required:true, message: '请填写慰问时间' }]"
readonly readonly
clickable clickable
name="occur_time" name="occur_time"
:value="formData.occur_time" :value="formData.occur_time"
label="慰问时间" label="慰问时间"
placeholder="点击选择慰问时间" placeholder="点击选择慰问时间"
@click="showOccurTime = true" @click="showOccurTime = true"
></van-field> ></van-field>
<van-calendar <van-calendar v-model="showOccurTime"
v-model="showOccurTime" @confirm="onOccurTimeConfirm"
@confirm="onOccurTimeConfirm" :min-date="minDate"
:min-date="minDate" :max-date="maxDate"
:max-date="maxDate" :color="themeColor"></van-calendar>
:color="themeColor"
></van-calendar>
<template v-if="['3','4'].includes(formData.type)"> <template v-if="['3','4'].includes(formData.type)">
<van-field <van-field v-model="formData.the_hospital" name="the_hospital" label="治疗医院"
v-model="formData.the_hospital" placeholder="请填写治疗医院" required
name="the_hospital" :rules="[{ required:true, message: '请填写治疗医院' }]"></van-field>
label="治疗医院" <van-field v-model="formData.the_hospital_house_num" name="the_hospital_house_num" label="病房号"
placeholder="请填写治疗医院" placeholder="请填写病房号" required
required :rules="[{ required:true, message: '请填写病房号' }]"></van-field>
:rules="[{ required:true, message: '请填写治疗医院' }]" <van-field v-model="formData.the_hospital_house_bed_num" name="the_hospital_house_bed_num" label="床号"
></van-field> placeholder="请填写床号" required
<van-field :rules="[{ required:true, message: '请填写床号' }]"></van-field>
v-model="formData.the_hospital_house_num"
name="the_hospital_house_num"
label="病房号"
placeholder="请填写病房号"
required
:rules="[{ required:true, message: '请填写病房号' }]"
></van-field>
<van-field
v-model="formData.the_hospital_house_bed_num"
name="the_hospital_house_bed_num"
label="床号"
placeholder="请填写床号"
required
:rules="[{ required:true, message: '请填写床号' }]"
></van-field>
</template> </template>
<template v-if="['4'].includes(formData.type)"> <template v-if="['4'].includes(formData.type)">
<van-field <van-field v-model="formData.hospital_by" name="hospital_by" label="患病病种"
v-model="formData.hospital_by" placeholder="请填写患病病种" required
name="hospital_by" :rules="[{ required:true, message: '请填写患病病种' }]"></van-field>
label="患病病种"
placeholder="请填写患病病种"
required
:rules="[{ required:true, message: '请填写患病病种' }]"
></van-field>
</template> </template>
<template v-if="['6'].includes(formData.type)"> <template v-if="['6'].includes(formData.type)">
<van-field <van-field v-model="formData.deadImmediateFamily" name="deadImmediateFamily" label="直系亲属"
v-model="formData.deadImmediateFamily" placeholder="配偶、父亲、母亲、子女" required
name="deadImmediateFamily" :rules="[{ required:true, message: '必填' }]"></van-field>
label="直系亲属"
placeholder="配偶、父亲、母亲、子女"
required
:rules="[{ required:true, message: '必填' }]"
></van-field>
</template> </template>
<!-- <template--> <!-- <template-->
<!-- v-if="['c7175af55693441e8233be4552cef9d5','0872ea0b95aa463fb8d98c46bdf72537'].includes(formData.type)">--> <!-- v-if="['c7175af55693441e8233be4552cef9d5','0872ea0b95aa463fb8d98c46bdf72537'].includes(formData.type)">-->
<!-- <van-field :value="formData.hospital_stay"--> <!-- <van-field :value="formData.hospital_stay"-->
<!-- readonly clickable required--> <!-- readonly clickable required-->
<!-- @click="hospital_stay = true"--> <!-- @click="hospital_stay = true"-->
<!-- name="hospital_stay" label="住院时间"--> <!-- name="hospital_stay" label="住院时间"-->
<!-- placeholder="请选择住院时间"--> <!-- placeholder="请选择住院时间"-->
<!-- :rules="[{ required:true, message: '请选择住院时间' }]"></van-field>--> <!-- :rules="[{ required:true, message: '请选择住院时间' }]"></van-field>-->
<!-- <van-calendar v-model="hospital_stay" type="range" @confirm="onConfirm"--> <!-- <van-calendar v-model="hospital_stay" type="range" @confirm="onConfirm"-->
<!-- :min-date="new Date('1999-01-01')"--> <!-- :min-date="new Date('1999-01-01')"-->
<!-- :color="themeColor"></van-calendar>--> <!-- :color="themeColor"></van-calendar>-->
<!-- <van-field v-model="formData.the_hospital" name="the_hospital" name="type" label="所在医院"--> <!-- <van-field v-model="formData.the_hospital" name="the_hospital" name="type" label="所在医院"-->
<!-- placeholder="请填写所在医院" required--> <!-- placeholder="请填写所在医院" required-->
<!-- :rules="[{ required:true, message: '请填写所在医院' }]"></van-field>--> <!-- :rules="[{ required:true, message: '请填写所在医院' }]"></van-field>-->
<!-- </template>--> <!-- </template>-->
<van-field <van-field v-model="formData.remark" name="remark" label="申请事由" style="flex-flow: column"
v-model="formData.remark" required
name="remark" :rules="[{ required:true, message: '请填写申请事由' }]"
label="申请事由" placeholder="请填写申请事由"
style="flex-flow: column" input-align="left"
required rows="3" maxlength="200" type="textarea" show-word-limit autosize>
:rules="[{ required:true, message: '请填写申请事由' }]"
placeholder="请填写申请事由"
input-align="left"
rows="3"
maxlength="200"
type="textarea"
show-word-limit
autosize
>
<template #label> <template #label>
<div class="mb10">申请事由</div> <div class="mb10">申请事由</div>
</template> </template>
@@ -212,7 +153,8 @@ layout("/mobile/platform.html"){
</van-cell-group> </van-cell-group>
<van-cell-group inset class="mt10" v-if="isUploadFile === true"> <van-cell-group inset class="mt10" v-if="isUploadFile === true">
<van-field name="files" label="附&emsp;&emsp;件" required style="flex-flow: column" input-align="left"> <van-field name="files" label="附&emsp;&emsp;件" required
style="flex-flow: column" input-align="left">
<template #label> <template #label>
<div class="mb10">附&emsp;&emsp;件</div> <div class="mb10">附&emsp;&emsp;件</div>
</template> </template>
@@ -220,8 +162,8 @@ layout("/mobile/platform.html"){
<vant-file-upload :files.sync="formData.files"></vant-file-upload> <vant-file-upload :files.sync="formData.files"></vant-file-upload>
</template> </template>
</van-field> </van-field>
<div style="margin: 0 0 7px 15px" v-if="isUploadFile && uploadFileDesc"> <div style="margin: 0 0 7px 15px;" v-if="isUploadFile && uploadFileDesc">
<span style="color: red">上传附件说明:{{ uploadFileDesc }}</span> <span style="color:red;">上传附件说明:{{ uploadFileDesc }}</span>
</div> </div>
</van-cell-group> </van-cell-group>
@@ -237,21 +179,26 @@ layout("/mobile/platform.html"){
</van-cell-group> </van-cell-group>
<div style="margin: 20px 20px 10px 20px"> <div style="margin: 20px 20px 10px 20px">
<van-button @click="onSubmit()" style="border-radius: 10px" block type="info" :color="themeColor">提 交</van-button> <van-button @click="onSubmit()" style="border-radius: 10px" block type="info" :color="themeColor">
提 交
</van-button>
</div> </div>
</van-form> </van-form>
<div> <div>
<van-tabbar v-model="tarBarActive" style="z-index: 99"> <van-tabbar v-model="tarBarActive" style="z-index: 99">
<van-tabbar-item icon="home-o" replace url="/mobile/condolence/apply/for">慰问申请</van-tabbar-item> <van-tabbar-item icon="home-o" replace url="/mobile/condolence/apply/for">慰问申请
<van-tabbar-item icon="manager-o" replace url="/mobile/condolence/apply">慰问记录</van-tabbar-item> </van-tabbar-item>
<van-tabbar-item icon="manager-o" replace url="/mobile/condolence/apply">慰问记录
</van-tabbar-item>
</van-tabbar> </van-tabbar>
</div> </div>
</div> </div>
<script> <script>
const vue = new Vue({ const vue = new Vue({
el: "#app", el: '#app',
mixins: [mobileMixins], mixins: [mobileMixins],
data() { data() {
return { return {
@@ -275,38 +222,34 @@ layout("/mobile/platform.html"){
money: 0, money: 0,
isUploadFile: true, isUploadFile: true,
uploadFileDesc: null, uploadFileDesc: null,
showChildPicker: false, showChildPicker:false,
childColumns: [ childColumns:[{value:'一孩',text:'一孩'},{value:'二孩',text:'二孩'},{value:'三孩',text:'三孩'}],
{ value: "一孩", text: "一孩" },
{ value: "二孩", text: "二孩" },
{ value: "三孩", text: "三孩" }
]
} }
}, },
watch: { watch: {
"formData.money"(val) { "formData.money"(val) {
if (val > this.money) { if (val > this.money) {
this.$notify({ this.$notify({
title: "警告", title: '警告',
message: "金额超过规定金额" + this.money + "(元)", message: '金额超过规定金额' + this.money + "(元)",
type: "warning" type: 'warning'
}) });
this.$set(this.formData, "money", this.money) this.$set(this.formData, "money", this.money)
} }
} }
}, },
components: { components: {
"mobile-sign": httpVueLoader("/components/sign/mobileSign.vue?v=" + new Date().getTime()) 'mobile-sign': httpVueLoader('/components/sign/mobileSign.vue?v='+new Date().getTime()),
}, },
methods: { methods: {
onChildConfirm(data) { onChildConfirm(data){
console.log(data) console.log(data)
this.formData.birth_child_num = data.value this.formData.birth_child_num = data.value
this.showChildPicker = false this.showChildPicker = false
}, },
priceInput() { priceInput() {
let num = 0 let num = 0
this.goods.forEach((v) => { this.goods.forEach(v => {
num += parseFloat(v.price) num += parseFloat(v.price)
}) })
this.$set(this.formData, "money", num) this.$set(this.formData, "money", num)
@@ -316,19 +259,18 @@ layout("/mobile/platform.html"){
this.showOccurTime = false this.showOccurTime = false
}, },
onConfirm(date) { onConfirm(date) {
const [start, end] = date const [start, end] = date;
this.hospital_stay = false this.hospital_stay = false;
this.formData.hospital_stay = moment(start).format("YYYY-MM-DD") + "-" + moment(end).format("YYYY-MM-DD") this.formData.hospital_stay = moment(start).format('YYYY-MM-DD') + "-" + moment(end).format('YYYY-MM-DD');
this.$set(this.formData, "hospital_stay_1", moment(start).format("YYYY-MM-DD")) this.$set(this.formData, "hospital_stay_1", moment(start).format('YYYY-MM-DD'))
this.$set(this.formData, "hospital_stay_2", moment(end).format("YYYY-MM-DD")) this.$set(this.formData, "hospital_stay_2", moment(end).format('YYYY-MM-DD'))
}, },
async userRemoteMethod(event) { async userRemoteMethod(event) {
if (event) { if (event) {
const arr = await this.queryUser(event) const arr = await this.queryUser(event)
this.userList = arr.map((v) => { this.userList = arr.map(v => {
return { return {
name: v.username + "(" + v.loginname + ")", name: v.username + "(" + v.loginname + ")", id: v.id
id: v.id
} }
}) })
this.sheetShow = true this.sheetShow = true
@@ -337,33 +279,32 @@ layout("/mobile/platform.html"){
async payeeUserRemoteMethod(event) { async payeeUserRemoteMethod(event) {
if (event) { if (event) {
const arr = await this.queryUser(event) const arr = await this.queryUser(event)
this.payeeUserList = arr.map((v) => { this.payeeUserList = arr.map(v => {
return { return {
name: v.username + "(" + v.loginname + ")", name: v.username + "(" + v.loginname + ")", id: v.id
id: v.id
} }
}) })
this.payeeSheetShow = true this.payeeSheetShow = true
} }
}, },
async queryUser(query) { async queryUser(query) {
const { data } = await $.get("/platform/fw/condolence/apply/queryUser", { query }) const {data} = await $.get("/platform/fw/condolence/apply/queryUser", {query})
return data return data
}, },
onUserSelect(u) { onUserSelect(u) {
this.$set(this.formData, "be_user", u.id) this.$set(this.formData, 'be_user', u.id)
this.$set(this.formData, "be_user_name", u.name) this.$set(this.formData, 'be_user_name', u.name)
this.sheetShow = false this.sheetShow = false
}, },
payeeOnUserSelect(u) { payeeOnUserSelect(u) {
this.$set(this.formData, "payee", u.id) this.$set(this.formData, 'payee', u.id)
this.$set(this.formData, "payee_name", u.name) this.$set(this.formData, 'payee_name', u.name)
this.payeeSheetShow = false this.payeeSheetShow = false
}, },
async onTypeConfirm(val) { async onTypeConfirm(val) {
this.$set(this.formData, "typeName", val.text) this.$set(this.formData, "typeName", val.text)
this.$set(this.formData, "type", val.value) this.$set(this.formData, "type", val.value)
const { data, code, msg } = await $.get("/platform/condolence/type/findOne", { id: val.value }) const {data, code, msg} = await $.get("/platform/condolence/type/findOne", {id: val.value})
console.log(data) console.log(data)
this.isUploadFile = data.isUploadFile this.isUploadFile = data.isUploadFile
@@ -371,15 +312,15 @@ layout("/mobile/platform.html"){
this.$set(this, "money", data.money) this.$set(this, "money", data.money)
await this.moneyChange(val.value) await this.moneyChange(val.value)
this.showTypePicker = false this.showTypePicker = false;
}, },
onWayConfirm(val) { onWayConfirm(val) {
this.$set(this.formData, "wayName", val.text) this.$set(this.formData, "wayName", val.text)
this.$set(this.formData, "way", val.value) this.$set(this.formData, "way", val.value)
this.showWayPicker = false this.showWayPicker = false;
}, },
async moneyChange(id) { async moneyChange(id) {
const { data, code, msg } = await $.get("/platform/condolence/type/findOne", { id }) const {data, code, msg} = await $.get("/platform/condolence/type/findOne", {id})
if (data) { if (data) {
this.$set(this.formData, "money", data.money) this.$set(this.formData, "money", data.money)
this.$set(this.formData, "wayName", data.way) this.$set(this.formData, "wayName", data.way)
@@ -388,34 +329,34 @@ layout("/mobile/platform.html"){
}, },
async onSubmit() { async onSubmit() {
if (!this.formData.files) { if (!this.formData.files) {
vant.Toast("请上传附件材料!") vant.Toast('请上传附件材料!')
return return
} }
this.$refs.signature.submitSign() this.$refs.signature.submitSign()
if (this.$refs.signature.checkNull()) { if (this.$refs.signature.checkNull()) {
this.$toast("请签名!") this.$toast('请签名!')
return return
} }
await this.$refs.signature.updateSign() await this.$refs.signature.updateSign()
const formData = clone(this.formData) const formData = clone(this.formData)
formData.mobile = "${@shiro.getPrincipalProperty('mobile')}" formData.mobile = "${@shiro.getPrincipalProperty('mobile')}"
formData.files = JSON.stringify(formData.files) formData.files = JSON.stringify(formData.files)
this.$refs["addForm"].validate().then(async () => { this.$refs['addForm'].validate().then(async () => {
this.$toast.loading("提交中...") this.$toast.loading('提交中...')
const res = await $.post("/platform/fw/condolence/apply/doAdd", { const res = await $.post('/platform/fw/condolence/apply/doAdd', {
data: JSON.stringify(formData), data: JSON.stringify(formData),
sign: formData.sign sign: formData.sign
}) })
if (res.code === 0) { if (res.code === 0) {
this.$toast.success("申请成功") this.$toast.success('申请成功');
setTimeout(() => { setTimeout(() => {
location.replace("/mobile/condolence/apply") location.replace('/mobile/condolence/apply')
}, 1000) }, 1000)
} else { } else {
this.$toast.fail("申请失败") this.$toast.fail('申请失败');
} }
}) })
} },
}, },
mounted() { mounted() {
this.$nextTick(() => { this.$nextTick(() => {
@@ -425,20 +366,21 @@ layout("/mobile/platform.html"){
}) })
}, },
async created() { async created() {
this.formData.apply_time = moment().format("YYYY-MM-DD") this.formData.apply_time = moment().format('YYYY-MM-DD')
this.formData.be_user = "${@shiro.getPrincipalProperty('id')}" this.formData.be_user = "${@shiro.getPrincipalProperty('id')}"
//this.formData.be_user_name = "${@shiro.getPrincipalProperty('username')}" + "(" + "${@shiro.getPrincipalProperty('loginname')}" + ")" //this.formData.be_user_name = "${@shiro.getPrincipalProperty('username')}" + "(" + "${@shiro.getPrincipalProperty('loginname')}" + ")"
const { code, data } = await $.get("/platform/condolence/type/getAll") const {code, data} = await $.get("/platform/condolence/type/getAll")
data.forEach((v) => { data.forEach(v => {
this.typeColumns.push({ value: v.id, text: v.name + "(" + v.code + ")" }) this.typeColumns.push({value: v.id, text: v.name + "(" + v.code + ")"})
}) })
for (let i in condolence.way) { for (let i in condolence.way) {
this.wayColumns.push({ value: condolence.way[i], text: condolence.way[i] }) this.wayColumns.push({value: condolence.way[i], text: condolence.way[i]})
} }
} }
}) })
</script> </script>
<style> <style>
.up_down > .van-cell { .up_down > .van-cell {
flex-flow: column; flex-flow: column;
} }
@@ -447,15 +389,14 @@ layout("/mobile/platform.html"){
width: 100%; width: 100%;
} }
.van-cell, .van-cell, .van-picker button, .submit .van-button--normal {
.van-picker button,
.submit .van-button--normal {
font-size: 16px; font-size: 16px;
} }
.van-divider { .van-divider {
margin: 10px 0; margin: 10px 0;
} }
</style> </style>
<!--# <!--#
} }
@@ -1,16 +1,19 @@
<!--# <!--#
layout("/mobile/platform.html"){ layout("/mobile/platform.html"){
#--> #-->
<style></style> <style>
</style>
<div id="app" v-cloak> <div id="app" v-cloak>
<van-nav-bar title="慰问申请信息" left-arrow placeholder fixed @click-left="pjaxReplace('/mobile/index')"></van-nav-bar> <van-nav-bar title="慰问申请信息" left-arrow placeholder fixed
@click-left="history.back()"></van-nav-bar>
<div> <div>
<condolence-info :id.sync="id"></condolence-info> <condolence-info :id.sync="id"></condolence-info>
<div style="margin: 20px 20px 10px 20px"> <div style="margin: 20px 20px 10px 20px">
<van-button :color="themeColor" block @click="doEdit" class="ml10 mr10" v-if="state_id==2010||state_id==2020"> <van-button :color="themeColor" block @click="doEdit" class="ml10 mr10"
撤&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;回 v-if="state_id==2010||state_id==2020">撤&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;回
</van-button> </van-button>
</div> </div>
</div> </div>
@@ -18,7 +21,7 @@ layout("/mobile/platform.html"){
<script> <script>
const vue = new Vue({ const vue = new Vue({
el: "#app", el: '#app',
mixins: [mobileMixins], mixins: [mobileMixins],
data() { data() {
return { return {
@@ -27,29 +30,30 @@ layout("/mobile/platform.html"){
} }
}, },
components: { components: {
"condolence-info": httpVueLoader("/components/condolence/mobile/common.vue?v=" + new Date().getTime()) 'condolence-info': httpVueLoader('/components/condolence/mobile/common.vue?v=' + new Date().getTime()),
}, },
methods: { methods: {
doEdit() { doEdit() {
vant.Dialog.confirm({ vant.Dialog.confirm({
title: "标题", title: '标题',
message: "确认要撤回吗?" message: '确认要撤回吗?',
}) })
.then(async () => { .then(async () => {
const resp = await $.post("/platform/fw/condolence/ucr/doEdit", { id: this.id }) const resp = await $.post("/platform/fw/condolence/ucr/doEdit", {id: this.id});
this.$toast.success("撤回成功") this.$toast.success('撤回成功');
setTimeout(() => { setTimeout(() => {
history.back() history.back()
}, 1000) }, 1000)
}) })
.catch(() => { .catch(() => {
// on cancel // on cancel
}) });
} }
}, },
async created() { async created() {
this.id = GetQueryString("id") this.id = GetQueryString('id')
this.state_id = GetQueryString("state_id") this.state_id = GetQueryString('state_id')
} }
}) })
</script> </script>
@@ -3,10 +3,8 @@ layout("/mobile/platform.html"){
#--> #-->
<style> <style>
.apply_btn { .apply_btn {
animation: come 0.5s; animation: come .5s;
position: fixed; position: fixed;top: 20%;right: 0
top: 20%;
right: 0;
} }
@keyframes come { @keyframes come {
@@ -17,11 +15,12 @@ layout("/mobile/platform.html"){
right: 0px; right: 0px;
} }
} }
</style> </style>
<div id="app" v-cloak> <div id="app" v-cloak>
<m-page-loading v-if="mLoading"></m-page-loading> <m-page-loading v-if="mLoading"></m-page-loading>
<van-nav-bar title="慰问申请列表" left-arrow placeholder fixed @click-left="pjaxReplace('/mobile/index')"></van-nav-bar> <van-nav-bar title="慰问申请列表" left-arrow placeholder fixed @click-left="history.back()"></van-nav-bar>
<div class="search-fixed"> <div class="search-fixed">
<van-dropdown-menu active-color="#1989fa"> <van-dropdown-menu active-color="#1989fa">
@@ -30,11 +29,14 @@ layout("/mobile/platform.html"){
</van-dropdown-menu> </van-dropdown-menu>
</div> </div>
<div style="margin: 60px auto 0 auto"> <div style="margin: 60px auto 0 auto">
<van-list v-model="loading" :finished="finished" :finished-text="tableData.length>0?'没有更多了':''" @load="pageData"> <van-list v-model="loading" :finished="finished" :finished-text="tableData.length>0?'没有更多了':''"
@load="pageData">
<div v-for="o in tableData" class="list-card" @click="openInfo(o.id)"> <div v-for="o in tableData" class="list-card" @click="openInfo(o.id)">
<van-cell-group inset> <van-cell-group inset>
<van-cell :border="false" title="被慰问人"> <van-cell :border="false" title="被慰问人">
<span class="van-ellipsis" style="font-size: 16px" :style="{color:themeColor}">{{o.be_username}}</span> <span class="van-ellipsis" style="font-size: 16px;" :style="{color:themeColor}">
{{o.be_username}}
</span>
</van-cell> </van-cell>
<van-cell :border="false" title="申请时间">{{o.apply_time}}</van-cell> <van-cell :border="false" title="申请时间">{{o.apply_time}}</van-cell>
<van-cell :border="false" title="慰问类型">{{o.type_name}}</van-cell> <van-cell :border="false" title="慰问类型">{{o.type_name}}</van-cell>
@@ -47,61 +49,69 @@ layout("/mobile/platform.html"){
</div> </div>
</van-list> </van-list>
<!-- <van-button v-show="visible" class="apply_btn" @click.stop="openApply" plain hairline>-->
<!-- <template #icon>--> <!-- <van-button v-show="visible" class="apply_btn" @click.stop="openApply" plain hairline>-->
<!-- <svg t="1634200664904" class="icon" viewBox="0 0 1024 1024" version="1.1"--> <!-- <template #icon>-->
<!-- xmlns="http://www.w3.org/2000/svg" p-id="3163" width="32" height="32">--> <!-- <svg t="1634200664904" class="icon" viewBox="0 0 1024 1024" version="1.1"-->
<!-- <path d="M837.632 160.768c64 0 117.248 53.248 117.248 117.248v470.528c0 64-53.248 117.248-117.248 117.248H187.904c-64 2.048-117.248-50.688-117.248-114.688V278.016c0-64 53.248-117.248 117.248-117.248h649.728z m66.048 590.848V274.944c0-32.768-28.16-60.416-60.416-60.416H184.832c-32.768 0-60.416 28.16-60.416 60.416v479.232c0 32.768 28.16 60.416 60.416 60.416h657.92c32.768-2.56 60.928-28.16 60.928-62.976zM387.072 317.44"--> <!-- xmlns="http://www.w3.org/2000/svg" p-id="3163" width="32" height="32">-->
<!-- fill="#2E77ED" p-id="3164"></path>--> <!-- <path d="M837.632 160.768c64 0 117.248 53.248 117.248 117.248v470.528c0 64-53.248 117.248-117.248 117.248H187.904c-64 2.048-117.248-50.688-117.248-114.688V278.016c0-64 53.248-117.248 117.248-117.248h649.728z m66.048 590.848V274.944c0-32.768-28.16-60.416-60.416-60.416H184.832c-32.768 0-60.416 28.16-60.416 60.416v479.232c0 32.768 28.16 60.416 60.416 60.416h657.92c32.768-2.56 60.928-28.16 60.928-62.976zM387.072 317.44"-->
<!-- <path d="M326.144 709.632c-14.848 0-26.624-12.288-26.624-27.136V455.68c0-14.848 12.288-27.136 27.136-27.136S353.28 440.832 353.28 455.68v226.816c-0.512 15.36-12.288 27.136-27.136 27.136z"--> <!-- fill="#2E77ED" p-id="3164"></path>-->
<!-- fill="#FFBB12" p-id="3165"></path>--> <!-- <path d="M326.144 709.632c-14.848 0-26.624-12.288-26.624-27.136V455.68c0-14.848 12.288-27.136 27.136-27.136S353.28 440.832 353.28 455.68v226.816c-0.512 15.36-12.288 27.136-27.136 27.136z"-->
<!-- <path d="M569.856 442.368c0-14.848 12.288-26.624 27.136-26.624H757.76c14.848 0 27.136 12.288 27.136 27.136s-12.288 26.624-27.136 26.624h-160.768c-15.36 0-27.136-12.288-27.136-27.136zM569.856 682.496c0-14.848 12.288-26.624 27.136-26.624H757.76c14.848 0 27.136 12.288 27.136 27.136s-12.288 26.624-27.136 26.624h-160.768c-15.36 0-27.136-12.288-27.136-27.136zM569.856 553.472c0-14.848 12.288-26.624 27.136-26.624H757.76c14.848 0 27.136 12.288 27.136 27.136s-12.288 26.624-27.136 26.624h-160.768c-15.36 0-27.136-12.288-27.136-27.136z"--> <!-- fill="#FFBB12" p-id="3165"></path>-->
<!-- fill="#2E77ED" p-id="3166"></path>--> <!-- <path d="M569.856 442.368c0-14.848 12.288-26.624 27.136-26.624H757.76c14.848 0 27.136 12.288 27.136 27.136s-12.288 26.624-27.136 26.624h-160.768c-15.36 0-27.136-12.288-27.136-27.136zM569.856 682.496c0-14.848 12.288-26.624 27.136-26.624H757.76c14.848 0 27.136 12.288 27.136 27.136s-12.288 26.624-27.136 26.624h-160.768c-15.36 0-27.136-12.288-27.136-27.136zM569.856 553.472c0-14.848 12.288-26.624 27.136-26.624H757.76c14.848 0 27.136 12.288 27.136 27.136s-12.288 26.624-27.136 26.624h-160.768c-15.36 0-27.136-12.288-27.136-27.136z"-->
<!-- <path d="M228.352 509.44c-10.24-10.752-10.24-27.648 0-37.888l78.336-78.336c10.752-10.752 27.648-10.752 37.888 0s10.24 27.648 0 37.888L266.24 509.44c-10.24 10.752-27.136 10.752-37.888 0z"--> <!-- fill="#2E77ED" p-id="3166"></path>-->
<!-- fill="#FFBB12" p-id="3167"></path>--> <!-- <path d="M228.352 509.44c-10.24-10.752-10.24-27.648 0-37.888l78.336-78.336c10.752-10.752 27.648-10.752 37.888 0s10.24 27.648 0 37.888L266.24 509.44c-10.24 10.752-27.136 10.752-37.888 0z"-->
<!-- <path d="M306.688 393.216c10.752-10.24 27.648-10.24 37.888 0l78.336 78.336c10.752 10.752 10.752 27.648 0 37.888s-27.648 10.24-37.888 0L306.688 431.104c-10.24-10.752-10.24-27.648 0-37.888z"--> <!-- fill="#FFBB12" p-id="3167"></path>-->
<!-- fill="#FFBB12" p-id="3168"></path>--> <!-- <path d="M306.688 393.216c10.752-10.24 27.648-10.24 37.888 0l78.336 78.336c10.752 10.752 10.752 27.648 0 37.888s-27.648 10.24-37.888 0L306.688 431.104c-10.24-10.752-10.24-27.648 0-37.888z"-->
<!-- </svg>--> <!-- fill="#FFBB12" p-id="3168"></path>-->
<!-- </template>--> <!-- </svg>-->
<!-- 申请--> <!-- </template>-->
<!-- </van-button>--> <!-- 申请-->
<!-- </van-button>-->
</div> </div>
<van-empty v-if="mLoading==false&&tableData.length==0" class="custom-image" image="/none.svg" description="暂无数据"></van-empty> <van-empty v-if="mLoading==false&&tableData.length==0" class="custom-image"
image="/none.svg"
description="暂无数据">
</van-empty>
<div> <div>
<van-tabbar v-model="tarBarActive"> <van-tabbar v-model="tarBarActive">
<van-tabbar-item icon="home-o" replace url="/mobile/condolence/apply/for">慰问申请</van-tabbar-item> <van-tabbar-item icon="home-o" replace url="/mobile/condolence/apply/for">慰问申请
<van-tabbar-item icon="manager-o" replace url="/mobile/condolence/apply">慰问记录</van-tabbar-item> </van-tabbar-item>
<van-tabbar-item icon="manager-o" replace url="/mobile/condolence/apply">慰问记录
</van-tabbar-item>
</van-tabbar> </van-tabbar>
</div> </div>
</div> </div>
<script> <script>
const vue = new Vue({ const vue = new Vue({
el: "#app", el: '#app',
mixins: [mobileMixins], mixins: [mobileMixins],
data() { data() {
return { return {
tarBarActive: 1, tarBarActive: 1,
visible: true, visible: true,
typeOption: [{ value: null, text: "全部" }], typeOption: [
{value: null, text: '全部'}
],
yearOption: [], yearOption: [],
pageForm: { pageForm: {
year: "", year: '',
type: "" type: ''
} }
} }
}, },
components: { components: {
"mobile-sign": httpVueLoader("/components/sign/mobileSign.vue") 'mobile-sign': httpVueLoader('/components/sign/mobileSign.vue'),
}, },
methods: { methods: {
openApply() { openApply() {
window.location.href = "/mobile/condolence/apply/for" window.location.href = '/mobile/condolence/apply/for'
}, },
openInfo(id) { openInfo(id) {
window.location.href = "/mobile/condolence/apply/info?id=" + id window.location.href = '/mobile/condolence/apply/info?id=' + id
}, },
yearChange(val) { yearChange(val) {
this.pageForm.year = val this.pageForm.year = val
@@ -114,12 +124,13 @@ layout("/mobile/platform.html"){
listenTouch() { listenTouch() {
this.$nextTick(() => { this.$nextTick(() => {
const app = document.querySelector("#app") const app = document.querySelector("#app")
app.addEventListener("touchstart", () => { app.addEventListener('touchstart', () => {
this.visible = false this.visible = false
}) })
app.addEventListener("touchend", () => { app.addEventListener('touchend', () => {
this.visible = true this.visible = true
}) })
}) })
} }
}, },
@@ -129,11 +140,11 @@ layout("/mobile/platform.html"){
async created() { async created() {
this.mLoading = true this.mLoading = true
for (let i = new Date().getFullYear() - 10; i <= new Date().getFullYear(); i++) { for (let i = new Date().getFullYear() - 10; i <= new Date().getFullYear(); i++) {
this.yearOption.unshift({ value: i, text: i + "年" }) this.yearOption.unshift({value: i, text: i + '年'},)
} }
const { code, data } = await $.get("/platform/condolence/type/getAll") const {code, data} = await $.get("/platform/condolence/type/getAll")
data.forEach((v) => { data.forEach(v => {
this.typeOption.push({ value: v.id, text: v.name + v.code }) this.typeOption.push({value: v.id, text: v.name + v.code})
}) })
this.$set(this.pageForm, "year", this.yearOption[0].value) this.$set(this.pageForm, "year", this.yearOption[0].value)
this.$set(this.pageForm, "type", this.typeOption[0].value) this.$set(this.pageForm, "type", this.typeOption[0].value)
@@ -3,25 +3,38 @@ layout("/mobile/platform.html"){
#--> #-->
<div id="app" v-cloak> <div id="app" v-cloak>
<m-page-loading v-if="mLoading"></m-page-loading> <m-page-loading v-if="mLoading"></m-page-loading>
<van-nav-bar title="慰问审核" left-arrow placeholder fixed @click-left="pjaxReplace('/mobile/index')"></van-nav-bar> <van-nav-bar title="慰问审核" left-arrow placeholder fixed
@click-left="history.go(-1)"></van-nav-bar>
<div class="search-fixed"> <div class="search-fixed">
<van-dropdown-menu :active-color="themeColor"> <van-dropdown-menu :active-color="themeColor">
<van-dropdown-item v-model="pageForm.year" @change="yearChange" :options="yearList"></van-dropdown-item> <van-dropdown-item v-model="pageForm.year" @change="yearChange"
<van-dropdown-item v-model="pageForm.isAudit" @change="yearChange" :options="auditList"></van-dropdown-item> :options="yearList"></van-dropdown-item>
<van-dropdown-item v-model="pageForm.type" @change="yearChange" :options="mCondolence.typeList"></van-dropdown-item> <van-dropdown-item v-model="pageForm.isAudit" @change="yearChange"
<van-dropdown-item v-model="pageForm.unionId" @change="yearChange" :options="mCommon.unionList"></van-dropdown-item> :options="auditList"></van-dropdown-item>
<van-dropdown-item v-model="pageForm.unitId" @change="yearChange" :options="mCommon.unitList"></van-dropdown-item> <van-dropdown-item v-model="pageForm.type" @change="yearChange"
:options="mCondolence.typeList"></van-dropdown-item>
<van-dropdown-item v-model="pageForm.unionId" @change="yearChange"
:options="mCommon.unionList"></van-dropdown-item>
<van-dropdown-item v-model="pageForm.unitId" @change="yearChange"
:options="mCommon.unitList"></van-dropdown-item>
</van-dropdown-menu> </van-dropdown-menu>
</div> </div>
<div style="margin: 70px auto 0"> <div style="margin: 70px auto 0">
<van-list v-model="mLoading" :finished="finished" :finished-text="tableData.length>0?'没有更多了':''" @load="pageData"> <van-list v-model="mLoading" :finished="finished"
:finished-text="tableData.length>0?'没有更多了':''"
@load="pageData">
<div v-for="o in tableData" class="list-card" @click="openView(o)"> <div v-for="o in tableData" class="list-card" @click="openView(o)">
<van-cell-group inset> <van-cell-group inset>
<van-cell :border="false" title="被慰问人"> <van-cell :border="false" title="被慰问人">
<span class="van-ellipsis" style="font-size: 16px" :style="{color:themeColor}">{{o.be_username}}</span> <span class="van-ellipsis" style="font-size: 16px;"
:style="{color:themeColor}">
{{o.be_username}}
</span>
</van-cell> </van-cell>
<van-cell :border="false" title="申&ensp;请&ensp;人">{{o.sqr_username}}</van-cell> <van-cell :border="false" title="申&ensp;请&ensp;人">{{o.sqr_username}}</van-cell>
<van-cell :border="false" title="所在单位">{{o.be_unitname}}</van-cell> <van-cell :border="false" title="所在单位">{{o.be_unitname}}</van-cell>
@@ -36,13 +49,18 @@ layout("/mobile/platform.html"){
</div> </div>
</van-list> </van-list>
<van-empty v-if="mLoading==false&&tableData.length==0" class="custom-image" image="/none.svg" description="暂无数据"></van-empty> <van-empty v-if="mLoading==false&&tableData.length==0" class="custom-image"
image="/none.svg"
description="暂无数据">
</van-empty>
</div> </div>
</div> </div>
<script> <script>
const vue = new Vue({ const vue = new Vue({
el: "#app", el: '#app',
mixins: [mobileMixins], mixins: [mobileMixins],
data() { data() {
return { return {
@@ -50,30 +68,30 @@ layout("/mobile/platform.html"){
unionList: [], unionList: [],
yearList: [], yearList: [],
auditList: [ auditList: [
{ text: "未审核", value: false }, {text: '未审核', value: false},
{ text: "已审核", value: true } {text: '已审核', value: true},
], ],
handle: true, handle: true,
pageForm: { pageForm: {
year: new Date().getFullYear(), year: new Date().getFullYear(),
isAudit: false isAudit: false,
} },
} }
}, },
methods: { methods: {
openView(o) { openView(o) {
window.location.href = "/mobile/condolence/audit/auditHtml?state_id=" + o.state_id + "&id=" + o.id window.location.href = '/mobile/condolence/audit/auditHtml?state_id=' + o.state_id + '&id=' + o.id
}, },
yearChange() { yearChange() {
this.tableData = [] this.tableData = []
this.refreshing = true this.refreshing = true;
this.finished = false this.finished = false;
this.pageForm.pageNumber = 0 this.pageForm.pageNumber = 0
this.flushUnits() this.flushUnits()
}, },
pageData() { pageData() {
this.mLoading = true this.mLoading = true
$.get(loc() + "/pageData", this.pageForm, (res) => { $.get(loc() + '/pageData', this.pageForm, (res) => {
if (res.code === 0) { if (res.code === 0) {
this.tableData = this.tableData.concat(res.data.list) this.tableData = this.tableData.concat(res.data.list)
if (this.tableData.length === res.data.totalCount) { if (this.tableData.length === res.data.totalCount) {
@@ -84,10 +102,11 @@ layout("/mobile/platform.html"){
} }
}) })
this.mLoading = false this.mLoading = false
}, },
async flushUnits() { async flushUnits() {
//this.$set(this.pageForm, "unitId", "") //this.$set(this.pageForm, "unitId", "")
if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('SchoolUnionMemberAdmin')}" === "true") { if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('SchoolUnionMemberAdmin')}" === 'true') {
await mCommon.getUnitList(this.pageForm.unionId) await mCommon.getUnitList(this.pageForm.unionId)
} else { } else {
await mCommon.getUnitList("${@shiro.getPrincipalProperty('unit').getUnionid()}") await mCommon.getUnitList("${@shiro.getPrincipalProperty('unit').getUnionid()}")
@@ -96,7 +115,7 @@ layout("/mobile/platform.html"){
async init() { async init() {
let nowYear = new Date().getFullYear() let nowYear = new Date().getFullYear()
for (let i = nowYear; i >= nowYear - 9; i--) { for (let i = nowYear; i >= nowYear - 9; i--) {
this.yearList.push({ text: i, value: i }) this.yearList.push({text: i, value: i})
} }
await mCondolence.getType() await mCondolence.getType()
await mCommon.getUnionList() await mCommon.getUnionList()
@@ -114,12 +133,12 @@ layout("/mobile/platform.html"){
async created() { async created() {
this.init() this.init()
this.flushUnits() this.flushUnits()
if (GetQueryString("audit") === "1") { if (GetQueryString("audit") === '1') {
this.pageForm.isAudit = true this.pageForm.isAudit = true
} }
} }
}) })
window.addEventListener("pageshow", (e) => { window.addEventListener('pageshow', e => {
if (e.persisted || (window.performance && window.performance.navigation.type === 2)) { if (e.persisted || (window.performance && window.performance.navigation.type === 2)) {
vue.init() vue.init()
vue.yearChange() vue.yearChange()
@@ -127,6 +146,7 @@ layout("/mobile/platform.html"){
}) })
</script> </script>
<!--# <!--#
} }
#--> #-->
@@ -0,0 +1,369 @@
<!--#
layout("/mobile/platform.html"){
#-->
<style>
.title_color {
color: #000000;
}
.content_color {
color: grey;
}
.van-doc-card {
margin: 8px;
padding: 12px 12px 12px 12px;
background-color: #fff;
border-radius: 10px;
box-shadow: 0 8px 12px #ebedf0;
line-height: 20px;
font-size: 15px;
position: relative;
}
.van-divider {
margin: 6px 0 6px 0;
}
.van-button--small {
border-radius: 8px;
height: 26px;
font-size: 16px;
}
.van-col {
line-height: 35px;
}
.title_span {
font-size: 19px;
font-weight: bold;
position: absolute;
left: -1px;
top: 11px;
color: #1867b0;
}
.title {
font-size: 18px;
font-weight: bold;
flex: 1;
overflow: hidden;
white-space: nowrap;
color: #1867b0;
}
.cus_overflow {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.van-dropdown-menu__item {
flex: auto;
}
p {
margin: 0 !important;
}
.van-cell__title {
width: 30%;
}
.van-cell__right-icon {
margin-left: 0;
}
.van-sidebar-item {
padding: 8px 12px;
}
.footer {
background-color: white;
width: 100%;
height: 60px;
display: flex;
justify-content: space-evenly;
align-items: center;
left: 0;
}
.footer .van-button {
height: 34px;
border-radius: 6px;
width: 90% !important;
}
.join {
background-color: #0e78c5;
color: white;
}
.info_tab .van-doc-card > div:first-child {
border: 2px #0e78c5 solid;
width: 26px;
border-radius: 6px;
position: absolute;
top: 0;
left: 20px;
}
.process-title {
font-size: 15px;
color: #1867b0;
font-weight: 600;
margin: 10px 0 10px 0!important;
padding:10px;
position: relative;
line-height: 1.1;
font-family: inherit;
}
</style>
<div id="app" v-cloak>
<van-sticky>
<van-nav-bar title="日常慰问分工会审核" left-arrow placeholder fixed
@click-left="pjaxReplace('/mobile/index')"></van-nav-bar>
<van-dropdown-menu :close-on-click-outside="false" :close-on-click-overlay="false">
<van-dropdown-item :options="yearList" @change="doSearch" v-model="pageForm.year"></van-dropdown-item>
<van-dropdown-item :options="unitList" @change="doSearch" v-model="pageForm.unitId"></van-dropdown-item>
<van-dropdown-item :options="auditList" @change="doSearch" v-model="pageForm.isAudit"></van-dropdown-item>
</van-dropdown-menu>
</van-sticky>
<div>
<van-list v-if="tableData.length>0" v-model="tableLoading" :finished="tableFinished" finished-text="没有更多了" @load="pageData">
<div v-for="item in tableData" :key="item.id" class="van-doc-card">
<div>
<div style="display: flex; justify-content: space-between">
<div style="width: 74%">
<div class="van-ellipsis title">
<span class="title_span">|</span>
<span>{{item.sqr_username + '(' + item.sqr_loginname + ')'}}</span>
</div>
</div>
</div>
<div style="margin-top: 4px">
<van-row>
<van-col span="24">
<span class="title_color">慰问对象:</span>
<span class="content_color">{{item.be_username}}</span>
</van-col>
<van-col span="24"><span class="title_color">对象工号:</span>
<span class="content_color">
{{item.be_loginname}}
</span>
</van-col>
</van-row>
<van-row>
<van-col span="24"><span class="title_color">所属工会:</span>
<span class="content_color">
{{item.be_unionname}}
</span>
</van-col>
<van-col span="24"><span class="title_color">工作单位:</span>
<span class="content_color">{{item.be_unitname}}</span>
</van-col>
</van-row>
<van-row>
<van-col span="24"><span class="title_color">慰问类型:</span>
<span class="content_color">{{item.type_name}}</span>
</van-col>
</van-row>
</div>
<van-divider></van-divider>
<div style="display: flex; justify-content: space-between; align-items: center">
<div>
<span class="title_color">当前状态:</span>
<span class="content_color">{{item.state_name}}</span>
</div>
<div>
<van-button size="small" @click="openView(item)"
type="info" style="margin-right: 4px">查看
</van-button>
<van-button size="small" type="primary"
v-if="item.state_id === 2000"
@click="openApproval(item)"
style="margin-right: 4px">审核
</van-button>
<!--<van-button size="small" type="danger"
v-if="[2014,2015,2020].includes(item.state_id)"
@click="openRevoke(item.id)"
style="margin-right: 4px">撤回
</van-button>-->
</div>
</div>
</div>
</div>
</van-list>
<van-empty v-else class="custom-image" image="/none.svg" description="暂无数据"></van-empty>
</div>
<van-popup v-model="infoShow" position="right" :style="{ height: '100%', width: '100%' }" safe-area-inset-bottom>
<van-sticky>
<van-nav-bar @click-left="infoShow=false" left-arrow
title="分工会审核"></van-nav-bar>
</van-sticky>
<div style="height: calc(100% - 44px);overflow-y: auto">
<condolence-info ref="info"></condolence-info>
<div v-if="showApprovalForm">
<div class="process-title">{{ '分工会审核' }}</div>
<van-form>
<van-field label="审核人员" readonly name="username" v-model="formData.username" required></van-field>
<van-field label="审核时间" readonly name="time" v-model="formData.time" required></van-field>
<van-field label="审核意见" name="opinion" v-model="formData.opinion" placeholder="请输入审核意见" required></van-field>
<van-field label="审核签字" name="sign" required style="flex-flow: column">
<template #label>
<div class="mb10">审核签字</div>
</template>
<template #input>
<mobile-sign ref="signature" v-model="formData.sign"></mobile-sign>
</template>
</van-field>
</van-form>
<div style="display: flex; justify-content: space-between; column-gap: 10px; padding: 10px">
<van-button type="danger" block @click.submit="doApproval(1)">拒绝</van-button>
<van-button type="danger" block @click.submit="doApproval(2)">退回</van-button>
<van-button type="primary" block @click.submit="doApproval(3)">通过</van-button>
</div>
</div>
</div>
</van-popup>
</div>
<script>
const vue = new Vue({
el: '#app',
mixins: [mobileMixins],
data() {
return {
unitList: [],
yearList: [],
auditList: [
{text: '未审核', value: false},
{text: '已审核', value: true},
],
handle: true,
pageForm: {
year: new Date().getFullYear(),
isAudit: false
},
tableLoading: false,
tableFinished: false,
infoShow: false,
showApprovalForm: false,
}
},
components: {
'condolence-info': httpVueLoader('/components/condolence/mobile/common.vue?v=' + new Date().getTime()),
},
methods: {
openView(item) {
this.infoShow = true
this.showApprovalForm = false
this.$nextTick(() => {
this.$refs.info.getInfo(item.id)
})
},
openApproval(item) {
this.formData.id = item.id
this.formData.username = "${@shiro.getPrincipalProperty('username')}"
this.formData.time = moment().format('YYYY-MM-DD')
this.infoShow = true
this.showApprovalForm = true
this.$nextTick(() => {
this.$refs.info.getInfo(item.id)
})
},
openRevoke(id) {
this.$dialog.confirm({
title: '温馨提示',
message: '确定要撤回该申请吗?'
}).then(() => {
$.post('/platform/fw/condolence/ucr/doEdit', { id }).then(resp => {
if (resp.code === 0) {
this.$toast.success(resp.msg)
this.doSearch()
} else {
this.$toast.fail(resp.msg)
}
})
})
},
async doApproval(flag) {
if (!this.formData.opinion) {
this.$toast.fail('请填写审核意见')
return
}
this.$refs.signature.submitSign()
if (this.formData.sign === undefined || this.$refs.signature.checkNull()) {
this.$toast.fail('请签名')
return
}
await this.$refs.signature.updateSign()
this.formData.pass = flag
const resp = await $.post('/platform/fw/condolence/ucr/doReview', this.formData)
if (resp.code === 0) {
this.$toast.success(resp.msg)
this.infoShow = false
this.doSearch()
} else {
this.$toast.fail(resp.msg)
}
},
doSearch() {
this.pageForm.pageNumber = 1
this.tableData = []
this.finished = false
this.pageData()
},
pageData() {
this.tableLoading = true
$.post('/platform/fw/condolence/ucr/pageData', this.pageForm)
.then(res => {
if (res.code === 0) {
this.tableData = this.tableData.concat(res.data.list)
this.pageForm.totalCount = res.data.totalCount
if (this.tableData.length >= this.pageForm.totalCount) {
this.tableFinished = true
} else {
this.pageForm.pageNumber++
}
this.tableLoading = false
} else {
this.$toast(res.msg)
}
})
},
async flushUnits(unionId) {
this.unitList = await getUnits(unionId)
this.unitList.forEach(v => {
v.text = v.name
v.value = v.id
})
if (this.unitList && this.unitList.length > 0) {
this.unitList.unshift({ text: "全部单位", value: null })
this.$set(this.pageForm, "unitId", this.unitList[0].value)
}
},
async initData() {
if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')}" === 'true') {
await this.flushUnits()
} else {
await this.flushUnits("${@shiro.getPrincipalProperty('unit').getUnionid()}")
}
this.$set(this.pageForm, "year", this.yearList[0].value)
this.doSearch()
},
},
created() {
this.initData()
},
})
</script>
<!--#
}
#-->
@@ -3,34 +3,37 @@ layout("/mobile/platform.html"){
#--> #-->
<div id="app" v-cloak> <div id="app" v-cloak>
<van-nav-bar title="慰问审核" left-arrow placeholder fixed @click-left="pjaxReplace('/mobile/index')"></van-nav-bar> <van-nav-bar title="慰问审核" left-arrow placeholder fixed
@click-left="history.back()"></van-nav-bar>
<condolence-info ref="info" :id.sync="id" title="校工会审核" :handle="handle"> <condolence-info ref="info" :id.sync="id" title="校工会审核" :handle="handle">
<template #handle> <template #handle>
<div class="van-cell-group__title mt20"> <div class="van-cell-group__title mt20">
<div class="van-sidebar-item van-sidebar-item--select">校工会审核</div> <div class="van-sidebar-item van-sidebar-item--select">
校工会审核
</div>
</div> </div>
<van-form> <van-form>
<van-field
readonly <van-field readonly left-icon="contact"
left-icon="contact" value="${@shiro.getPrincipalProperty('username')}"
value="${@shiro.getPrincipalProperty('username')}" name="username"
name="username" label="审核人员"
label="审核人员"
></van-field> ></van-field>
<van-field v-model="formData.time" label="审核时间" left-icon="clock-o" readonly></van-field> <van-field v-model="formData.time" label="审核时间" left-icon="clock-o"
readonly></van-field>
<van-field <van-field v-model="formData.opinion"
v-model="formData.opinion" left-icon="chat-o"
left-icon="chat-o" rows="1"
rows="1" required
required :rules="[{ required:true, message: '请输入审核意见' }]"
:rules="[{ required:true, message: '请输入审核意见' }]" autosize
autosize label="审核意见"
label="审核意见" type="textarea"
type="textarea" placeholder="请输入审核意见"
placeholder="请输入审核意见"
></van-field> ></van-field>
<van-field label="签字" required style="flex-flow: column"> <van-field label="签字" required style="flex-flow: column">
@@ -42,76 +45,88 @@ layout("/mobile/platform.html"){
</template> </template>
</van-field> </van-field>
<van-row gutter="20" style="margin-top: 30px; padding: 0 25px">
<van-row gutter="20" style="margin-top: 30px;padding: 0 25px">
<van-col span="8"> <van-col span="8">
<van-button :color="themeColor" plain block @click="doAudit(1)">拒 绝</van-button> <van-button :color="themeColor" plain block @click="doAudit(1)">拒 绝
</van-button>
</van-col> </van-col>
<van-col span="8"> <van-col span="8">
<van-button :color="themeColor" block @click="doAudit(2)">返回修改</van-button> <van-button :color="themeColor" block @click="doAudit(2)">返回修改
</van-button>
</van-col> </van-col>
<van-col span="8"> <van-col span="8">
<van-button :color="themeColor" block @click="doAudit(3)">通 过</van-button> <van-button :color="themeColor" block @click="doAudit(3)">通 过
</van-button>
</van-col> </van-col>
</van-row> </van-row>
</van-form> </van-form>
</template> </template>
</condolence-info> </condolence-info>
</div> </div>
<script> <script>
const vue = new Vue({ const vue = new Vue({
el: "#app", el: '#app',
mixins: [mobileMixins], mixins: [mobileMixins],
data() { data() {
return { return {
handle: true, handle: true,
id: "", id: "",
formData: {} formData: {},
} }
}, },
components: { components: {
"mobile-sign": httpVueLoader("/components/sign/mobileSign.vue"), 'mobile-sign': httpVueLoader('/components/sign/mobileSign.vue'),
"condolence-info": httpVueLoader("/components/condolence/mobile/common.vue?v=" + new Date().getTime()) 'condolence-info': httpVueLoader('/components/condolence/mobile/common.vue?v=' + new Date().getTime()),
}, },
methods: { methods: {
async doAudit(pass) { async doAudit(pass) {
if (!this.formData.opinion) { if (!this.formData.opinion) {
this.$toast.fail("请填写审核意见") this.$toast.fail('请填写审核意见');
return return
} }
this.$refs.signature.submitSign() this.$refs.signature.submitSign()
if (this.$refs.signature.checkNull()) { if (this.$refs.signature.checkNull()) {
vant.Toast("请签名!") vant.Toast('请签名!')
return return
} }
await this.$refs.signature.updateSign() await this.$refs.signature.updateSign()
this.formData.pass = pass this.formData.pass = pass
const resp = await $.post("/platform/fw/condolence/fr/doReview", this.formData) const resp = await $.post("/platform/fw/condolence/fr/doReview", this.formData)
if (resp.code === 0) { if (resp.code === 0) {
this.$toast.success("审核成功") this.$toast.success('审核成功')
setTimeout(() => { setTimeout(() => {
window.history.back() window.history.back()
}, 1000) }, 1000)
} else { } else {
this.$toast.fail("审核失败") this.$toast.fail('审核失败');
} }
} },
}, },
async created() { async created() {
this.id = GetQueryString("id") this.id = GetQueryString("id")
const { data } = await $.get("/platform/fw/condolence/findOne", { id: this.id }) const {data} = await $.get("/platform/fw/condolence/findOne", {id: this.id})
this.formData = { this.formData = {
id: this.id, id: this.id,
username: "${@shiro.getPrincipalProperty('username')}", username: "${@shiro.getPrincipalProperty('username')}",
time: moment().format("YYYY-MM-DD"), time: moment().format('YYYY-MM-DD'),
opinion: null, opinion: null,
sign: "" sign: "",
} }
} }
}) })
</script> </script>
<!--# <!--#
} }
#--> #-->

Some files were not shown because too many files have changed in this diff Show More