commit
This commit is contained in:
@@ -1,18 +1,18 @@
|
||||
package io.v.nutz.base.utils;
|
||||
|
||||
import com.deepoove.poi.data.PictureRenderData;
|
||||
import com.deepoove.poi.data.PictureType;
|
||||
import io.v.nutz.base.service.BaseService;
|
||||
import io.v.nutz.sys.models.*;
|
||||
import io.v.nutz.zhgh.jdh.model.cb.Jdh_jdhxx;
|
||||
import io.v.nutz.sys.services.SysMenuService;
|
||||
import io.v.nutz.sys.services.SysUserRoleService;
|
||||
import io.v.nutz.sys.services.SysUserService;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.zhgh.jdh.model.cb.Jdh_jdhxx;
|
||||
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.dao.util.Daos;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
@@ -24,6 +24,7 @@ import org.nutz.mvc.Mvcs;
|
||||
|
||||
import javax.servlet.http.Cookie;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -48,6 +49,9 @@ public class Vi {
|
||||
@Inject
|
||||
private SysUserRoleService sysUserRoleService;
|
||||
|
||||
@Inject
|
||||
private static FtpService ftpService;
|
||||
|
||||
/**
|
||||
* @return 当前登录用户的福利单位
|
||||
*/
|
||||
@@ -191,9 +195,16 @@ public class Vi {
|
||||
}
|
||||
|
||||
public static PictureRenderData getImg(String base64) throws IOException {
|
||||
String s = base64.split(",")[1];
|
||||
byte[] bytes = Base64.getDecoder().decode(s);
|
||||
return new PictureRenderData(70, 30, ".png", bytes);
|
||||
if (base64.startsWith(base64)) {
|
||||
String s = base64.split(",")[1];
|
||||
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());
|
||||
}
|
||||
}
|
||||
|
||||
public static String getCron(Date time) {
|
||||
@@ -250,8 +261,6 @@ public class Vi {
|
||||
});
|
||||
}
|
||||
|
||||
@Inject
|
||||
private FtpService ftpService;
|
||||
|
||||
public void deleteSysFiles(List<Sys_file> files) {
|
||||
try {
|
||||
|
||||
@@ -85,8 +85,9 @@ public class SysAppController {
|
||||
List<LoglevelProperty> list = (List) entry.getValue();
|
||||
for (LoglevelProperty property : list) {
|
||||
NutMap nutMap = NutMap.NEW().addv("hostName", property.getHostName()).addv("hostAddress", property.getHostAddress());
|
||||
if (!hostList.contains(nutMap))
|
||||
if (!hostList.contains(nutMap)) {
|
||||
hostList.add(nutMap);
|
||||
}
|
||||
if (Strings.isBlank(hostName) || (Strings.isNotBlank(hostName) && property.getHostName().equals(hostName))) {
|
||||
dataList.add(property);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,125 @@
|
||||
package io.v.nutz.sys.controllers.platform.sys;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.wizzer.framework.base.Result;
|
||||
import cn.wizzer.framework.page.Pagination;
|
||||
import io.v.nutz.sys.models.Sys_home_activity;
|
||||
import io.v.nutz.sys.param.SysHomeActivityPageForm;
|
||||
import io.v.nutz.sys.services.SysHomeActivityService;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.zhgh.activity.models.ActivityUserScope;
|
||||
import org.apache.shiro.authz.annotation.RequiresAuthentication;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.nutz.dao.*;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.dao.util.Daos;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.Lang;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@IocBean
|
||||
@At("/platform/sys/homeActivity")
|
||||
@Ok("json:full")
|
||||
public class SysHomeActivityController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private SysHomeActivityService sysHomeActivityService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/sys/homeActivity/index.html")
|
||||
@RequiresPermissions("sys.homeActivity")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@RequiresPermissions("sys.homeActivity")
|
||||
public Object pageData(SysHomeActivityPageForm pageForm) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and(Cnd.likeEX("`name`",pageForm.getName()));
|
||||
cnd.desc("sortNo");
|
||||
Pagination pagination = sysHomeActivityService.listPage(pageForm.getPageNumber(), pageForm.getPageSize(), cnd);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@RequiresPermissions("sys.homeActivity")
|
||||
public Object enable(@Valid String id) {
|
||||
sysHomeActivityService.update(Chain.make("enable", 1), Cnd.where("id", "=", id));
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@RequiresPermissions("sys.homeActivity")
|
||||
public Object disable(@Valid String id) {
|
||||
sysHomeActivityService.update(Chain.make("enable", 0), Cnd.where("id", "=", id));
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@RequiresPermissions("sys.homeActivity")
|
||||
public Object topUp(@Valid String id){
|
||||
Sys_home_activity sysHomeActivity = new Sys_home_activity();
|
||||
sysHomeActivity.setId(id);
|
||||
sysHomeActivity.setTop(true);
|
||||
sysHomeActivityService.updateIgnoreNull(sysHomeActivity);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@RequiresPermissions("sys.homeActivity")
|
||||
public Object cancelTopUp(@Valid String id){
|
||||
Sys_home_activity sysHomeActivity = new Sys_home_activity();
|
||||
sysHomeActivity.setId(id);
|
||||
sysHomeActivity.setTop(false);
|
||||
sysHomeActivityService.updateIgnoreNull(sysHomeActivity);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@RequiresAuthentication
|
||||
public Result listHomeActivity() {
|
||||
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"));
|
||||
String userId = ShiroUtil.getUserId();
|
||||
|
||||
List<Sys_home_activity> allowActivityList = new ArrayList<>();
|
||||
|
||||
for (Sys_home_activity activity : list) {
|
||||
Integer allowUserGroupId = activity.getAllowUserGroupId();
|
||||
String allowUserSql = activity.getAllowUserSql();
|
||||
activity.setAllowUserSql(null);
|
||||
if (allowUserGroupId == null && StrUtil.isBlank(allowUserSql)) {
|
||||
allowActivityList.add(activity);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (allowUserGroupId != null) {
|
||||
int count = dao.count(ActivityUserScope.class, Cnd.where("groupId", "=", allowUserGroupId).and("userId", "=", userId));
|
||||
if (count > 0) {
|
||||
allowActivityList.add(activity);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (StrUtil.isNotBlank(allowUserSql)){
|
||||
Sql sql = Sqls.create(allowUserSql).setParam("userId", userId);
|
||||
NutMap nutMap = (NutMap) Daos.query(dao, sql.toString(), Sqls.callback.map());
|
||||
if (Lang.isNotEmpty(nutMap) && StrUtil.isNotBlank(nutMap.getString("userId"))) {
|
||||
allowActivityList.add(activity);
|
||||
}
|
||||
}
|
||||
}
|
||||
return Result.success(allowActivityList);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -35,6 +35,10 @@ public class SysAppModule extends BaseModel {
|
||||
@Column
|
||||
private Boolean enable;
|
||||
|
||||
@ColDefine(type = ColType.VARCHAR, width = 500)
|
||||
@Comment("图标")
|
||||
@Column
|
||||
private String iconClass;
|
||||
/**
|
||||
* 子菜单
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
package io.v.nutz.sys.models;
|
||||
|
||||
import io.v.nutz.base.model.BaseModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@Table
|
||||
@Comment("首页活动")
|
||||
public class Sys_home_activity extends BaseModel {
|
||||
|
||||
@Name
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@Comment("主键ID,和业务ID保持一致")
|
||||
private String id;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
@Comment("活动名称")
|
||||
private String name;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 255)
|
||||
@Comment("活动封面")
|
||||
private String cover;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 1000)
|
||||
@Comment("活动链接")
|
||||
private String url;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 1000)
|
||||
@Comment("h5活动链接")
|
||||
private String h5Url;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.INT)
|
||||
@Comment("面向人员分组ID")
|
||||
private Integer allowUserGroupId;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 1000)
|
||||
@Comment("允许查看的人员sql")
|
||||
private String allowUserSql;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
@Comment("是否启用")
|
||||
@Default("0")
|
||||
private Boolean enable;
|
||||
|
||||
@Column
|
||||
@Comment("类路径")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 500)
|
||||
private String classPath;
|
||||
|
||||
@Column
|
||||
@Comment("是否置顶")
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
@Default("0")
|
||||
private Boolean top;
|
||||
|
||||
@Column
|
||||
@Comment("排序号")
|
||||
@Default("0")
|
||||
private Integer sortNo;
|
||||
|
||||
@Column
|
||||
@Comment("开始时间")
|
||||
@ColDefine(type = ColType.DATETIME)
|
||||
private Date startDate;
|
||||
|
||||
@Column
|
||||
@Comment("结束时间")
|
||||
@ColDefine(type = ColType.DATETIME)
|
||||
private Date endDate;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package io.v.nutz.sys.param;
|
||||
|
||||
import io.v.nutz.base.query.PageForm;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class SysHomeActivityPageForm extends PageForm {
|
||||
|
||||
private String name;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package io.v.nutz.sys.services;
|
||||
|
||||
|
||||
import cn.wizzer.framework.base.service.BaseService;
|
||||
import io.v.nutz.sys.models.Sys_home_activity;
|
||||
|
||||
public interface SysHomeActivityService extends BaseService<Sys_home_activity> {
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package io.v.nutz.sys.services;
|
||||
|
||||
|
||||
import io.v.nutz.sys.models.Sys_home_activity;
|
||||
|
||||
public interface SysHomeConvert {
|
||||
|
||||
Sys_home_activity covertToSysHomeActivity();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package io.v.nutz.sys.services.impl;
|
||||
|
||||
import cn.wizzer.framework.base.service.BaseServiceImpl;
|
||||
import io.v.nutz.sys.models.Sys_home_activity;
|
||||
import io.v.nutz.sys.services.SysHomeActivityService;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
|
||||
@IocBean(args = {"refer:dao"})
|
||||
public class SysHomeActivityServiceImpl extends BaseServiceImpl<Sys_home_activity> implements SysHomeActivityService {
|
||||
|
||||
public SysHomeActivityServiceImpl(Dao dao) {
|
||||
super(dao);
|
||||
}
|
||||
}
|
||||
@@ -6,15 +6,17 @@ import cn.wizzer.framework.base.Result;
|
||||
import com.artofsolving.jodconverter.openoffice.connection.OpenOfficeConnection;
|
||||
import com.artofsolving.jodconverter.openoffice.connection.SocketOpenOfficeConnection;
|
||||
import com.artofsolving.jodconverter.openoffice.converter.StreamOpenOfficeDocumentConverter;
|
||||
import com.aspose.words.*;
|
||||
import io.v.nutz.sys.models.Sys_file;
|
||||
import io.v.nutz.sys.models.Sys_log;
|
||||
import io.v.nutz.sys.models.Sys_user;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.web.commons.slog.SLogService;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.coobird.thumbnailator.Thumbnails;
|
||||
import org.apache.commons.io.FilenameUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresAuthentication;
|
||||
import org.jsoup.Jsoup;
|
||||
import org.nutz.boot.starter.ftp.FtpService;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
@@ -40,7 +42,10 @@ import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Base64;
|
||||
import java.util.List;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* @FileName io.v.nutz.web.commons.controller.FilePreviewController
|
||||
@@ -58,6 +63,8 @@ public class FileServerController {
|
||||
@Inject
|
||||
private PropertiesProxy conf;
|
||||
|
||||
private static final String IMG_BASE64_PATTERN = "<img\\s+[^>]*src\\s*=\\s*['\"](data:image/[^'\"]+;base64,[^'\"]+)['\"][^>]*>";
|
||||
|
||||
private static final List<String> IMGTYPES = new ArrayList<>() {{
|
||||
add("JPG");
|
||||
add("JPEG");
|
||||
@@ -377,4 +384,68 @@ public class FileServerController {
|
||||
}
|
||||
|
||||
|
||||
|
||||
@At
|
||||
@AdaptBy(type = UploadAdaptor.class, args = {"ioc:fileUpload"})
|
||||
@RequiresAuthentication
|
||||
@Ok("json")
|
||||
public Object convertHtml(TempFile file) {
|
||||
try {
|
||||
Document doc = new Document(file.getInputStream());
|
||||
for (Shape shape : (Iterable<Shape>) doc.getChildNodes(NodeType.SHAPE, true)) {
|
||||
if (shape.hasImage()) {
|
||||
ImageSize imageSize = shape.getImageData().getImageSize();
|
||||
shape.setWidth(imageSize.getWidthPoints());
|
||||
shape.setHeight(imageSize.getHeightPoints());
|
||||
}
|
||||
}
|
||||
HtmlSaveOptions saveOptions = new HtmlSaveOptions();
|
||||
saveOptions.setExportImagesAsBase64(true);
|
||||
ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
||||
doc.save(bos, saveOptions);
|
||||
String htmlContent = Jsoup.parse(bos.toString()).body().html();
|
||||
|
||||
Pattern pattern = Pattern.compile(IMG_BASE64_PATTERN, Pattern.CASE_INSENSITIVE);
|
||||
Matcher matcher = pattern.matcher(htmlContent);
|
||||
StringBuffer sb = new StringBuffer();
|
||||
while (matcher.find()) {
|
||||
String srcValue = matcher.group(1);
|
||||
String[] parts = srcValue.split(";base64,");
|
||||
String base64Content = parts[1];
|
||||
try{
|
||||
//转为在线地址 base64很喜欢被信息中心拦截
|
||||
byte[] imageBytes = Base64.getDecoder().decode(base64Content);
|
||||
// 获取当前上传时间
|
||||
LocalDateTime uploadTime = LocalDateTime.now();
|
||||
String folderPath = String.format("/%04d/%02d/%02d/", uploadTime.getYear(), uploadTime.getMonthValue(), uploadTime.getDayOfMonth());
|
||||
//文件id
|
||||
String fileId = R.UU64();
|
||||
String filePath = folderPath + fileId + ".png";
|
||||
boolean uploadRes = ftpService.upload(folderPath, fileId + ".png", new ByteArrayInputStream(imageBytes));
|
||||
|
||||
if (uploadRes) {
|
||||
//上传成功记录到文件表
|
||||
Sys_file sys_file = new Sys_file();
|
||||
sys_file.setFilename(fileId + ".png");
|
||||
sys_file.setFilepath(filePath);
|
||||
sys_file.setSource(null);
|
||||
dao.insert(sys_file);
|
||||
String imgUrl = "/file_server/fileStreamPreview?id=" + sys_file.getId();
|
||||
String replacement = "<img src=\"" + imgUrl + "\">";
|
||||
matcher.appendReplacement(sb, Matcher.quoteReplacement(replacement));
|
||||
} else {
|
||||
throw new RuntimeException("上传文件失败");
|
||||
}
|
||||
}catch (Exception e){
|
||||
matcher.appendReplacement(sb, Matcher.quoteReplacement("<img src=>"));
|
||||
}
|
||||
}
|
||||
matcher.appendTail(sb);
|
||||
return Result.success().addData(sb.toString());
|
||||
} catch (Exception e) {
|
||||
log.error("文件转换HTML异常", e);
|
||||
throw new RuntimeException("文件读取失败");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,11 +2,11 @@ package io.v.nutz.web.commons.controller;
|
||||
|
||||
import cn.hutool.core.codec.Base64;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.io.IoUtil;
|
||||
import cn.wizzer.framework.base.Result;
|
||||
import com.aliyun.core.utils.Base64Util;
|
||||
import io.v.nutz.sys.models.Sys_file;
|
||||
import org.apache.shiro.authz.annotation.RequiresAuthentication;
|
||||
import org.nutz.boot.starter.ftp.FtpService;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.integration.jedis.RedisService;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
@@ -28,6 +28,9 @@ import java.io.InputStream;
|
||||
@At("/signature")
|
||||
public class SignatureController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
|
||||
@Inject
|
||||
private RedisService redisService;
|
||||
|
||||
@@ -65,8 +68,18 @@ public class SignatureController {
|
||||
String replaceData = base64.replaceAll("data:image/png;base64,", "");
|
||||
|
||||
try (InputStream is = new ByteArrayInputStream(Base64.decode(replaceData))) {
|
||||
ftpService.upload(todayPath, fileName, is);
|
||||
redisService.setex(prefix + ":" + id, 60 * 10, fullPath);
|
||||
boolean uploadRes = ftpService.upload(todayPath, fileName, is);
|
||||
if (uploadRes) {
|
||||
//上传成功记录到文件表
|
||||
Sys_file sysFile = new Sys_file();
|
||||
sysFile.setFilename(fileName);
|
||||
sysFile.setFilepath(fullPath);
|
||||
sysFile.setSource(null);
|
||||
dao.insert(sysFile);
|
||||
redisService.setex(prefix + ":" + id, 60 * 10, fullPath);
|
||||
} else {
|
||||
throw new RuntimeException("上传文件失败");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
return Result.error("签字数据上传失败");
|
||||
}
|
||||
@@ -111,9 +124,18 @@ public class SignatureController {
|
||||
String replaceData = data.replaceAll("data:image/png;base64,", "");
|
||||
|
||||
try (InputStream is = new ByteArrayInputStream(Base64.decode(replaceData))) {
|
||||
ftpService.upload(todayPath, fileName, is);
|
||||
boolean uploadRes = ftpService.upload(todayPath, fileName, is);
|
||||
if (uploadRes) {
|
||||
//上传成功记录到文件表
|
||||
Sys_file sysFile = new Sys_file();
|
||||
sysFile.setFilename(fileName);
|
||||
sysFile.setFilepath(fullPath);
|
||||
sysFile.setSource(null);
|
||||
dao.insert(sysFile);
|
||||
} else {
|
||||
throw new RuntimeException("上传文件失败");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return Result.error("签字数据上传失败");
|
||||
}
|
||||
|
||||
|
||||
@@ -45,6 +45,8 @@ import org.springframework.util.StringUtils;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.*;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
import java.util.concurrent.locks.Lock;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
@@ -124,7 +126,7 @@ public class SourceUserServiceImpl extends ViServiceImpl<UserSource> implements
|
||||
//新增的用户
|
||||
List<Sys_user> needInitUserList = new CopyOnWriteArrayList<>();
|
||||
//添加角色的用户
|
||||
List<Sys_user_role> userRoles = new ArrayList<>();
|
||||
List<Sys_user_role> userRoles = new CopyOnWriteArrayList<>();
|
||||
|
||||
// 创建一个固定大小的线程池 可以根据服务器性能调整线程池大小
|
||||
int numberOfThreads = Runtime.getRuntime().availableProcessors() * 2;
|
||||
@@ -172,7 +174,7 @@ public class SourceUserServiceImpl extends ViServiceImpl<UserSource> implements
|
||||
}
|
||||
}
|
||||
|
||||
List<UserChangeType> changeTypes = getChangeTypes(source, user);
|
||||
List<UserChangeType> changeTypes = getChangeTypes(source, user, sourceType);
|
||||
if (changeTypes.contains(UserChangeType.NEW)) {
|
||||
user = UserMode.initUser(u);
|
||||
needInitUserList.add(user);
|
||||
@@ -233,35 +235,36 @@ public class SourceUserServiceImpl extends ViServiceImpl<UserSource> implements
|
||||
dao().clear(UserSource.class, Cnd.where("DATE(pullTime)", "<", formatAgoWeekDate));
|
||||
}
|
||||
|
||||
private List<UserChangeType> getChangeTypes(Sys_user source, Sys_user user) {
|
||||
private List<UserChangeType> getChangeTypes(Sys_user source, Sys_user user, String sourceType) {
|
||||
List<UserChangeType> userChangeTypes = new ArrayList<>();
|
||||
if (user == null) {
|
||||
userChangeTypes.add(UserChangeType.NEW);
|
||||
return userChangeTypes;
|
||||
}
|
||||
if (!StringUtils.isEmpty(source.getUnitid()) && !source.getUnitid().equals(user.getUnitid())) {
|
||||
userChangeTypes.add(UserChangeType.UNIT_CHANGE);
|
||||
}
|
||||
if (!StringUtils.isEmpty(user.getUserState()) && StrUtil.isNotEmpty(source.getUserState()) && !source.getUserState().equals(user.getUserState())) {
|
||||
for (UserChangeType value : UserChangeType.values()) {
|
||||
if (value.getDescription().equals(source.getUserState())) {
|
||||
userChangeTypes.add(value);
|
||||
} else {
|
||||
if ("add".equals(sourceType)) {
|
||||
return userChangeTypes;
|
||||
}
|
||||
if (!StringUtils.isEmpty(source.getUnitid()) && !source.getUnitid().equals(user.getUnitid())) {
|
||||
userChangeTypes.add(UserChangeType.UNIT_CHANGE);
|
||||
}
|
||||
if (StrUtil.isNotBlank(user.getUserState()) && StrUtil.isNotEmpty(source.getUserState()) && !source.getUserState().equals(user.getUserState())) {
|
||||
for (UserChangeType value : UserChangeType.values()) {
|
||||
if (value.getDescription().equals(source.getUserState())) {
|
||||
userChangeTypes.add(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
List<String> columns = List.of("nation", "birthday", "personType", "political", "schoolTime", "jobTitle", "education", "academicDegree", "position");
|
||||
for (String column : columns) {
|
||||
NutMap userSourceMap = Lang.obj2nutmap(source);
|
||||
NutMap userMap = Lang.obj2nutmap(user);
|
||||
String sourceValue = userSourceMap.getString(column, "");
|
||||
String value = userMap.getString(column, "");
|
||||
if (!sourceValue.equals(value) && StrUtil.isNotBlank(sourceValue)) {
|
||||
userChangeTypes.add(UserChangeType.BASIC_CHANGE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
List<String> columns = List.of("nation", "birthday", "personType", "political", "schoolTime", "jobTitle", "education", "academicDegree", "position", "leaveSchoolDate", "retireDate");
|
||||
for (String column : columns) {
|
||||
NutMap userSourceMap = Lang.obj2nutmap(source);
|
||||
NutMap userMap = Lang.obj2nutmap(user);
|
||||
String sourceValue = userSourceMap.getString(column, "");
|
||||
String value = userMap.getString(column, "");
|
||||
if (!sourceValue.equals(value) && StrUtil.isNotBlank(sourceValue)) {
|
||||
userChangeTypes.add(UserChangeType.BASIC_CHANGE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return userChangeTypes;
|
||||
}
|
||||
|
||||
@@ -300,53 +303,51 @@ public class SourceUserServiceImpl extends ViServiceImpl<UserSource> implements
|
||||
* @param filterColumnDao 部分更新传递(部分更新存在过滤字段)
|
||||
*/
|
||||
private void massUpdatesAsync(List<Sys_user> needDoUpdateList, Boolean isPart, AtomicReference<Dao> filterColumnDao) {
|
||||
// 根据服务器性能和任务特性动态确定线程池大小;通常,线程池大小为CPU核心数的2倍
|
||||
// 创建一个CPU核心数的2倍的线程池
|
||||
int numberOfThreads = Runtime.getRuntime().availableProcessors() * 2;
|
||||
ExecutorService executorService = Executors.newFixedThreadPool(numberOfThreads);
|
||||
ExecutorCompletionService<Void> ecs = new ExecutorCompletionService<>(executorService);
|
||||
|
||||
// 每批处理的数据量
|
||||
int batchSize = 100;
|
||||
|
||||
int batchSize = 200;
|
||||
// 共享锁
|
||||
Lock lock = new ReentrantLock();
|
||||
try {
|
||||
// 将sources分成若干批
|
||||
for (int i = 0; i < needDoUpdateList.size(); i += batchSize) {
|
||||
final int end = Math.min(i + batchSize, needDoUpdateList.size());
|
||||
List<Sys_user> batch = needDoUpdateList.subList(i, end);
|
||||
|
||||
// 提交任务给线程池执行
|
||||
ecs.submit(() -> {
|
||||
Dao daoToUse = isPart ? filterColumnDao.get() : dao();
|
||||
// 执行数据库更新操作
|
||||
synchronized (daoToUse) {
|
||||
lock.lock();
|
||||
try {
|
||||
daoToUse.updateIgnoreNull(batch);
|
||||
} finally {
|
||||
lock.unlock();
|
||||
}
|
||||
return null; // CompletionService需要一个返回值,这里返回null
|
||||
return null;
|
||||
});
|
||||
}
|
||||
|
||||
// 等待所有任务完成
|
||||
for (int i = 0; i < needDoUpdateList.size(); i += batchSize) {
|
||||
try {
|
||||
Future<Void> future = ecs.take();
|
||||
future.get(); // 等待任务完成
|
||||
future.get();
|
||||
} catch (InterruptedException | ExecutionException e) {
|
||||
Thread.currentThread().interrupt(); // 恢复中断状态
|
||||
throw new RuntimeException(e);
|
||||
Thread.currentThread().interrupt();
|
||||
throw new RuntimeException("Error during batch update", e);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error("Error in massUpdatesAsync", e);
|
||||
throw new RuntimeException("Error in massUpdatesAsync", e);
|
||||
} finally {
|
||||
// 关闭线程池
|
||||
executorService.shutdown();
|
||||
try {
|
||||
// 设置合理的超时时间,防止无限期阻塞
|
||||
if (!executorService.awaitTermination(10, TimeUnit.SECONDS)) {
|
||||
executorService.shutdownNow(); // 如果超时,强制关闭
|
||||
executorService.shutdownNow();
|
||||
}
|
||||
} catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt(); // 恢复中断状态
|
||||
Thread.currentThread().interrupt();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
package io.v.nutz.zhgh.jf.controller.Funds;
|
||||
|
||||
import io.v.nutz.zhgh.activity.models.ActivityTissue;
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.utils.Vi;
|
||||
import io.v.nutz.zhgh.jf.model.ActivityBx;
|
||||
import io.v.nutz.zhgh.jf.service.ActivityBxService;
|
||||
import io.v.nutz.base.service.ViService;
|
||||
import io.v.nutz.base.utils.Vi;
|
||||
import io.v.nutz.sys.models.Sys_club_user;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.zhgh.activity.models.ActivityTissue;
|
||||
import io.v.nutz.zhgh.jf.service.ActivityBxService;
|
||||
import org.apache.shiro.authz.annotation.Logical;
|
||||
import org.apache.shiro.authz.annotation.RequiresAuthentication;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
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.Static;
|
||||
@@ -23,8 +23,6 @@ import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
@@ -44,6 +42,8 @@ public class FundsApplyController {
|
||||
@Inject
|
||||
private Vi vi;
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private ActivityBxService activityBxService;
|
||||
@Inject("ActivityTissue")
|
||||
private ViService<ActivityTissue> tissueViService;
|
||||
@@ -85,6 +85,7 @@ public class FundsApplyController {
|
||||
*/
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions(value = {"sys.jf.Funds.apply","sys.jf.Funds.apply2"},logical = Logical.OR)
|
||||
public Object generateProjectCode(String activity_type) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
int year = Calendar.getInstance().get(Calendar.YEAR);
|
||||
@@ -104,13 +105,28 @@ public class FundsApplyController {
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions(value = {"sys.jf.Funds.apply","sys.jf.Funds.apply2"},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){
|
||||
List<ActivityBx> query = activityBxService.query(Cnd.where("payeeId", "=", payeeId).desc("apply_time"));
|
||||
return query.stream().map(v -> {
|
||||
NutMap map = new NutMap();
|
||||
return map.addv("activity_card_number", v.getActivity_card_number()).addv("activity_card_name", v.getActivity_card_name());
|
||||
}).collect(Collectors.toList());
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
JT.bankName,
|
||||
JT.bankCardNum
|
||||
FROM
|
||||
activity_bx AS bx,
|
||||
JSON_TABLE(
|
||||
budgets,
|
||||
'$[*]' COLUMNS(
|
||||
payeeId VARCHAR(255) PATH '$.payeeId',
|
||||
bankName VARCHAR(255) PATH '$.bankName',
|
||||
bankCardNum VARCHAR(255) PATH '$.bankCardNum'
|
||||
)
|
||||
) AS JT
|
||||
WHERE
|
||||
JT.payeeId = @payeeId
|
||||
ORDER BY bx.apply_time DESC LIMIT 1
|
||||
""").setParam("payeeId", payeeId);
|
||||
sql.setCallback(Sqls.callback.map());
|
||||
dao.execute(sql);
|
||||
return sql.getResult();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -149,13 +149,13 @@ public class AccountingCon {
|
||||
Sys_user_role sys_user_role = activityBxService.dao().fetch(Sys_user_role.class, Cnd.where("roleId", "=", Roles.GH_WYH_ZX));
|
||||
if (Lang.isNotEmpty(sys_user_role)) {
|
||||
Sys_user user = activityBxService.dao().fetch(Sys_user.class, sys_user_role.getUserId());
|
||||
////msgApi.sendWxMsg("活动申报", "", "text", aid.getUser_name() + "申报了一条活动【" + aid.getActivity_name() + "】,请前往智慧工会进行审核。", List.of(user.getLoginname()), null);
|
||||
msgApi.sendWxMsg("活动申报", "", "text", aid.getUser_name() + "申报了一条活动【" + aid.getActivity_name() + "】,请前往智慧工会进行审核。", List.of(user.getLoginname()), null);
|
||||
FundsToHandler.CREATE_SCHOOL_TASK.exec(aid.getId(), null, List.of(user.getLoginname()));
|
||||
}
|
||||
} else {
|
||||
nodeName = "校工会负责人拒绝";
|
||||
Sys_user user = activityBxService.dao().fetch(Sys_user.class, aid.getUser_id());
|
||||
////msgApi.sendWxMsg("活动申报", "", "text", "您申报的活动【" + aid.getActivity_name() + "】被校工会负责人拒绝,审核意见:" + aid.getAccounting_idea(), List.of(user.getLoginname()), null);
|
||||
msgApi.sendWxMsg("活动申报", "", "text", "您申报的活动【" + aid.getActivity_name() + "】被校工会负责人拒绝,审核意见:" + aid.getAccounting_idea(), List.of(user.getLoginname()), null);
|
||||
FundsToHandler.REFUSE_TASK.exec(aid.getId(), new NutMap().addv("option", nodeName), null);
|
||||
}
|
||||
FundsToHandler.COMPLETE_SCHOOL_FZR_TASK.exec(aid.getId(), new NutMap().addv("option", nodeName), null);
|
||||
|
||||
+1
-1
@@ -2,8 +2,8 @@ package io.v.nutz.zhgh.jf.controller.activitybx;
|
||||
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.utils.Vi;
|
||||
import io.v.nutz.zhgh.jf.service.ActivityBxService;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.zhgh.jf.service.ActivityBxService;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
|
||||
@@ -1,19 +1,22 @@
|
||||
package io.v.nutz.zhgh.jf.controller.activitybx;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.wizzer.framework.base.Result;
|
||||
import cn.wizzer.framework.base.service.BaseService;
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.utils.DateUtil;
|
||||
import io.v.nutz.base.utils.MsgApi;
|
||||
import io.v.nutz.base.utils.Roles;
|
||||
import io.v.nutz.base.utils.Vi;
|
||||
import io.v.nutz.zhgh.jf.handle.funds.FundsToHandler;
|
||||
import io.v.nutz.zhgh.jf.model.ActivityBx;
|
||||
import io.v.nutz.zhgh.jf.service.ActivityBxService;
|
||||
import io.v.nutz.sys.models.Sys_signature;
|
||||
import io.v.nutz.sys.models.Sys_user;
|
||||
import io.v.nutz.sys.models.Sys_user_role;
|
||||
import io.v.nutz.sys.services.SysSignatureService;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.zhgh.jf.handle.funds.FundsToHandler;
|
||||
import io.v.nutz.zhgh.jf.model.ActivityBx;
|
||||
import io.v.nutz.zhgh.jf.service.ActivityBxService;
|
||||
import org.apache.shiro.authz.annotation.Logical;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Cnd;
|
||||
@@ -73,13 +76,37 @@ public class ApplyController {
|
||||
@At
|
||||
@ViReturn
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@RequiresPermissions(value = {"sys.jf.Funds.apply","sys.jf.Funds.apply2","sys.jf.reimbursement.apply","sys.jf.activity_bx.apply"},logical = Logical.OR)
|
||||
public Object doSave(@Param("activityBx") ActivityBx activityBx, @Param("sign") String sign) {
|
||||
activityBx.setState_id("999");
|
||||
activityBx.setYear(activityBx.getYear() != null ? activityBx.getYear() : DateUtil.getYear());
|
||||
activityBx.setApply_time(StrUtil.isNotBlank(activityBx.getApply_time()) ? activityBx.getApply_time() : DateUtil.getDateTime());
|
||||
activityBx.setUser_id(StrUtil.isNotBlank(activityBx.getUser_id()) ? activityBx.getUser_id() : ShiroUtil.getUserId());
|
||||
if (Strings.isNotBlank(sign)) {
|
||||
activityBx.setUser_signature(sysSignatureService.insert(new Sys_signature(sign)).getId());
|
||||
}
|
||||
if (StrUtil.isNotBlank(activityBx.getId())) {
|
||||
activityBxService.update(activityBx);
|
||||
} else {
|
||||
activityBxService.doAdd(activityBx);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@RequiresPermissions(value = {"sys.jf.Funds.apply","sys.jf.Funds.apply2","sys.jf.reimbursement.apply","sys.jf.activity_bx.apply"},logical = Logical.OR)
|
||||
public Object doAdd(@Param("activityBx") ActivityBx activityBx, @Param("sign") String sign) {
|
||||
List<String> loginNames = new ArrayList<>();
|
||||
activityBx.setYear(Calendar.getInstance().get(Calendar.YEAR));
|
||||
activityBx.setYear(activityBx.getYear() != null ? activityBx.getYear() : DateUtil.getYear());
|
||||
if (activityBx.getActivity_type() == 40001) {
|
||||
// 校工会活动
|
||||
activityBx.setState_id("1020");
|
||||
loginNames.add("8333300107");
|
||||
loginNames.add("1019911404");
|
||||
} else if (activityBx.getActivity_type() == 40002) {
|
||||
// 分工会活动
|
||||
activityBx.setState_id("1010");
|
||||
Sys_user_role sys_user_role = activityBxService.dao().fetch(Sys_user_role.class, Cnd.where("roleId", "=", Roles.GH01).and("unionid", "=", Vi.getUnionId()));
|
||||
if (Lang.isNotEmpty(sys_user_role)) {
|
||||
@@ -87,6 +114,7 @@ public class ApplyController {
|
||||
loginNames.add(user.getLoginname());
|
||||
}
|
||||
} else if (activityBx.getActivity_type() == 40003) {
|
||||
// 协会活动
|
||||
Sys_user_role sys_user_role = activityBxService.dao().fetch(Sys_user_role.class, Cnd.where("roleId", "=", Roles.club01).and("stid", "=", activityBx.getClubId()));
|
||||
if (Lang.isNotEmpty(sys_user_role)) {
|
||||
Sys_user user = activityBxService.dao().fetch(Sys_user.class, sys_user_role.getUserId());
|
||||
@@ -96,8 +124,8 @@ public class ApplyController {
|
||||
} else {
|
||||
activityBx.setState_id("1010");
|
||||
}
|
||||
activityBx.setApply_time(DateUtil.getDateTime());
|
||||
activityBx.setUser_id(ShiroUtil.getPrincipalProperty("id").toString());
|
||||
activityBx.setApply_time(StrUtil.isNotBlank(activityBx.getApply_time()) ? activityBx.getApply_time() : DateUtil.getDateTime());
|
||||
activityBx.setUser_id(StrUtil.isNotBlank(activityBx.getUser_id()) ? activityBx.getUser_id() : ShiroUtil.getUserId());
|
||||
if (Strings.isNotBlank(sign)) {
|
||||
activityBx.setUser_signature(sysSignatureService.insert(new Sys_signature(sign)).getId());
|
||||
}
|
||||
@@ -125,14 +153,29 @@ public class ApplyController {
|
||||
@At
|
||||
@ViReturn
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@RequiresPermissions(value = {"sys.jf.Funds.apply","sys.jf.Funds.apply2","sys.jf.reimbursement.apply","sys.jf.activity_bx.apply"},logical = Logical.OR)
|
||||
public Object doEdit(@Param("activityBx") ActivityBx activityBx, @Param("sign") String sign) {
|
||||
List<String> loginNames = new ArrayList<>();
|
||||
ActivityBx oldActivity = activityBxService.dao().fetch(ActivityBx.class, activityBx.getId());
|
||||
activityBx.setYear(Calendar.getInstance().get(Calendar.YEAR));
|
||||
if (activityBx.getActivity_type() == 40001) {
|
||||
activityBx.setState_id("1020");
|
||||
loginNames.add("1019911404");
|
||||
} else if (activityBx.getActivity_type() == 40002) {
|
||||
activityBx.setState_id("1010");
|
||||
Sys_user_role sys_user_role = activityBxService.dao().fetch(Sys_user_role.class, Cnd.where("roleId", "=", Roles.GH01).and("unionid", "=", Vi.getUnionId()));
|
||||
if (Lang.isNotEmpty(sys_user_role)) {
|
||||
Sys_user user = activityBxService.dao().fetch(Sys_user.class, sys_user_role.getUserId());
|
||||
loginNames.add(user.getLoginname());
|
||||
}
|
||||
} else if (activityBx.getActivity_type() == 40003) {
|
||||
activityBx.setState_id("1000");
|
||||
// 协会活动
|
||||
Sys_user_role sys_user_role = activityBxService.dao().fetch(Sys_user_role.class, Cnd.where("roleId", "=", Roles.club01).and("stid", "=", activityBx.getClubId()));
|
||||
if (Lang.isNotEmpty(sys_user_role)) {
|
||||
Sys_user user = activityBxService.dao().fetch(Sys_user.class, sys_user_role.getUserId());
|
||||
loginNames.add(user.getLoginname());
|
||||
}
|
||||
} else {
|
||||
activityBx.setState_id("1010");
|
||||
}
|
||||
@@ -141,20 +184,50 @@ public class ApplyController {
|
||||
if (Strings.isNotBlank(sign)) {
|
||||
activityBx.setUser_signature(sysSignatureService.insert(new Sys_signature(sign)).getId());
|
||||
}
|
||||
|
||||
if ("1025".equals(oldActivity.getState_id()) || "1045".equals(oldActivity.getState_id()) ) {
|
||||
activityBx.setState_id("1025".equals(oldActivity.getState_id()) ? "1020" : "1040");
|
||||
}
|
||||
activityBxService.doEdit(activityBx);
|
||||
|
||||
NutMap map = new NutMap();
|
||||
map.setv("userId",activityBx.getUser_id());
|
||||
map.setv("activityName",activityBx.getActivity_name());
|
||||
FundsToHandler.START_PROCESS.exec(activityBx.getId(),map,loginNames);
|
||||
|
||||
// FundsToHandler.START_PROCESS.exec(activityBx.getId(),NutMap.NEW().addv("userId",ShiroUtil.getUserId()),null);
|
||||
//
|
||||
// if (activityBx.getActivity_type() == 40001) {
|
||||
//// FundsToHandler.CREATE_SCHOOL_FZR_TASK.exec(activityBx.getId(),NutMap.NEW().addv("userId",ShiroUtil.getUserId()),loginNames);
|
||||
// } else if (activityBx.getActivity_type() == 40002) {
|
||||
// FundsToHandler.CREATE_UNION_TASK.exec(activityBx.getId(),NutMap.NEW().addv("userId",ShiroUtil.getUserId()),List.of("1019971597"));
|
||||
// } else if (activityBx.getActivity_type() == 40003) {
|
||||
//// FundsToHandler.CREATE_CLUB_TASK.exec(activityBx.getId(),NutMap.NEW().addv("userId",ShiroUtil.getUserId()),loginNames);
|
||||
// }
|
||||
if ("999".equals(activityBx.getState_id())) {
|
||||
|
||||
if (activityBx.getActivity_type() == 40001) {
|
||||
FundsToHandler.CREATE_SCHOOL_FZR_TASK.exec(activityBx.getId(),NutMap.NEW().addv("userId",ShiroUtil.getUserId()),loginNames);
|
||||
} else if (activityBx.getActivity_type() == 40002) {
|
||||
FundsToHandler.CREATE_UNION_TASK.exec(activityBx.getId(),NutMap.NEW().addv("userId",ShiroUtil.getUserId()),List.of("1019971597"));
|
||||
} else if (activityBx.getActivity_type() == 40003) {
|
||||
FundsToHandler.CREATE_CLUB_TASK.exec(activityBx.getId(),NutMap.NEW().addv("userId",ShiroUtil.getUserId()),loginNames);
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@RequiresPermissions(value = {"sys.jf.Funds.apply","sys.jf.Funds.apply2","sys.jf.reimbursement.apply","sys.jf.activity_bx.apply"},logical = Logical.OR)
|
||||
public Object checkActivity(String activityName, String activityType) {
|
||||
List<String> list = new ArrayList<>();
|
||||
list.add("999");
|
||||
switch (activityType) {
|
||||
case "40001": list.add("1020");
|
||||
case "40002": list.add("1010");
|
||||
case "40003": list.add("1000");
|
||||
}
|
||||
|
||||
ActivityBx activityBx = baseService.dao().fetch(ActivityBx.class, Cnd.where("activity_name", "=", activityName)
|
||||
.and("user_id", "=", ShiroUtil.getUserId()).and("activity_type", "=", activityType)
|
||||
.and("state_id", "in", list).desc("apply_time"));
|
||||
if (Lang.isNotEmpty(activityBx)) {
|
||||
return Result.success().addData(activityBx);
|
||||
} else {
|
||||
return Result.error();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -131,12 +131,12 @@ public class AssociationCon {
|
||||
|
||||
String nodeName = "";
|
||||
if (flag) {
|
||||
////msgApi.sendWxMsg("活动申报", "", "text", aid.getUser_name() + "申报了一条活动【" + aid.getActivity_name() + "】,请前往智慧工会进行审核。", List.of("1019911404"), null);
|
||||
FundsToHandler.CREATE_SCHOOL_FZR_TASK.exec(id, new NutMap().addv("userId", aid.getUser_id()), List.of("8333300107"));
|
||||
msgApi.sendWxMsg("活动申报", "", "text", aid.getUser_name() + "申报了一条活动【" + aid.getActivity_name() + "】,请前往智慧工会进行审核。", List.of("1019911404"), null);
|
||||
FundsToHandler.CREATE_SCHOOL_FZR_TASK.exec(id, new NutMap().addv("userId", aid.getUser_id()), List.of("1019911404"));
|
||||
nodeName = "校工会负责人审核";
|
||||
} else {
|
||||
Sys_user user = activityBxService.dao().fetch(Sys_user.class, aid.getUser_id());
|
||||
////msgApi.sendWxMsg("活动申报", "", "text", "您申报的活动【" + aid.getActivity_name() + "】被协会拒绝,审核意见:" + aid.getAssociation_principal_idea(), List.of(user.getLoginname()), null);
|
||||
msgApi.sendWxMsg("活动申报", "", "text", "您申报的活动【" + aid.getActivity_name() + "】被协会拒绝,审核意见:" + aid.getAssociation_principal_idea(), List.of(user.getLoginname()), null);
|
||||
nodeName = "协会审核拒绝";
|
||||
FundsToHandler.REFUSE_TASK.exec(id, new NutMap().addv("option", nodeName), null);
|
||||
}
|
||||
|
||||
@@ -3,11 +3,11 @@ package io.v.nutz.zhgh.jf.controller.activitybx;
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.utils.DateUtil;
|
||||
import io.v.nutz.base.utils.Vi;
|
||||
import io.v.nutz.zhgh.jf.model.ActivityBx;
|
||||
import io.v.nutz.zhgh.jf.service.ActivityBxService;
|
||||
import io.v.nutz.sys.models.Sys_signature;
|
||||
import io.v.nutz.sys.services.SysSignatureService;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.zhgh.jf.model.ActivityBx;
|
||||
import io.v.nutz.zhgh.jf.service.ActivityBxService;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Sqls;
|
||||
|
||||
@@ -3,11 +3,11 @@ package io.v.nutz.zhgh.jf.controller.activitybx;
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.utils.DateUtil;
|
||||
import io.v.nutz.base.utils.Vi;
|
||||
import io.v.nutz.zhgh.jf.model.ActivityBx;
|
||||
import io.v.nutz.zhgh.jf.service.ActivityBxService;
|
||||
import io.v.nutz.sys.models.Sys_signature;
|
||||
import io.v.nutz.sys.services.SysSignatureService;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.zhgh.jf.model.ActivityBx;
|
||||
import io.v.nutz.zhgh.jf.service.ActivityBxService;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Sqls;
|
||||
|
||||
@@ -3,11 +3,9 @@ package io.v.nutz.zhgh.jf.controller.activitybx;
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.utils.DateUtil;
|
||||
import io.v.nutz.base.utils.MsgApi;
|
||||
import io.v.nutz.base.utils.Roles;
|
||||
import io.v.nutz.base.utils.Vi;
|
||||
import io.v.nutz.sys.models.Sys_signature;
|
||||
import io.v.nutz.sys.models.Sys_user;
|
||||
import io.v.nutz.sys.models.Sys_user_role;
|
||||
import io.v.nutz.sys.services.SysSignatureService;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.zhgh.jf.handle.funds.FundsToHandler;
|
||||
@@ -21,7 +19,6 @@ import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.aop.Aop;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.Lang;
|
||||
import org.nutz.lang.Strings;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
@@ -141,14 +138,14 @@ public class DivisionCon {
|
||||
// Sys_user_role sys_user_role = activityBxService.dao().fetch(Sys_user_role.class, Cnd.where("roleId", "=", Roles.GH_WYH_ZX));
|
||||
// if (Lang.isNotEmpty(sys_user_role)) {
|
||||
// Sys_user user = activityBxService.dao().fetch(Sys_user.class, sys_user_role.getUserId());
|
||||
Sys_user user = activityBxService.dao().fetch(Sys_user.class, Cnd.where("loginname","=","8333300107"));
|
||||
//msgApi.sendWxMsg("活动申报", "", "text", aid.getUser_name() + "申报了一条活动【" + aid.getActivity_name() + "】,请前往智慧工会进行审核。", List.of(user.getLoginname()), null);
|
||||
Sys_user user = activityBxService.dao().fetch(Sys_user.class, Cnd.where("loginname","=","1019911404"));
|
||||
msgApi.sendWxMsg("活动申报", "", "text", aid.getUser_name() + "申报了一条活动【" + aid.getActivity_name() + "】,请前往智慧工会进行审核。", List.of(user.getLoginname()), null);
|
||||
FundsToHandler.CREATE_SCHOOL_FZR_TASK.exec(id, null, List.of(user.getLoginname()));
|
||||
// }
|
||||
} else {
|
||||
nodeName = "基层工会主席拒绝";
|
||||
Sys_user user = activityBxService.dao().fetch(Sys_user.class, aid.getUser_id());
|
||||
//msgApi.sendWxMsg("活动申报", "", "text", "您申报的活动【" + aid.getActivity_name() + "】被基层工会主席拒绝,审核意见:" + aid.getDivision_chairman_idea(), List.of(user.getLoginname()), null);
|
||||
msgApi.sendWxMsg("活动申报", "", "text", "您申报的活动【" + aid.getActivity_name() + "】被基层工会主席拒绝,审核意见:" + aid.getDivision_chairman_idea(), List.of(user.getLoginname()), null);
|
||||
FundsToHandler.REFUSE_TASK.exec(id, new NutMap().addv("option", nodeName), null);
|
||||
}
|
||||
FundsToHandler.COMPLETE_UNION_TASK.exec(id, new NutMap().addv("option", nodeName), null);
|
||||
|
||||
@@ -3,15 +3,16 @@ package io.v.nutz.zhgh.jf.controller.activitybx;
|
||||
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import cn.wizzer.framework.base.service.BaseService;
|
||||
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.model.Goods;
|
||||
import io.v.nutz.base.utils.DateUtil;
|
||||
import io.v.nutz.base.utils.Html2Text;
|
||||
import io.v.nutz.base.utils.Roles;
|
||||
import io.v.nutz.base.utils.Vi;
|
||||
import io.v.nutz.sys.models.Sys_signature;
|
||||
import io.v.nutz.sys.services.SysSignatureService;
|
||||
@@ -35,7 +36,6 @@ 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 org.nutz.trans.Trans;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
@@ -44,6 +44,7 @@ import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.Base64;
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
@@ -142,20 +143,6 @@ public class ReimbursementCon {
|
||||
$condition
|
||||
""");
|
||||
|
||||
sql.setParam("role1", Roles.CLUB_FZR);
|
||||
sql.setParam("role2", Roles.UNION_MANGER);
|
||||
sql.setParam("role3", Roles.XGH_HD);
|
||||
sql.setParam("role4", Roles.GH_WYH_FZX);
|
||||
sql.setParam("role5", Roles.GH_WYH_CWFZX);
|
||||
sql.setParam("role6", Roles.XGHCN);
|
||||
sql.setParam("state1", 1000);
|
||||
sql.setParam("state2", 1010);
|
||||
sql.setParam("state3", 1020);
|
||||
sql.setParam("state4", 1030);
|
||||
sql.setParam("state5", 1040);
|
||||
sql.setParam("state6", 1050);
|
||||
|
||||
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin")) {
|
||||
cnd.and("bx.user_id", "=", ShiroUtil.getPrincipalProperty("id"));
|
||||
@@ -172,7 +159,6 @@ public class ReimbursementCon {
|
||||
}
|
||||
Vi.cndPlus(cnd, "bxr.unitid", "=", unitId);
|
||||
Vi.cndPlus(cnd, "bxr.unionid", "=", unionId);
|
||||
Vi.cndPlus(cnd, "bx.apply_type", "=", apply_type);
|
||||
sql.setCondition(cnd);
|
||||
return activityBxService.listPageMap(pageNumber, pageSize, sql);
|
||||
}
|
||||
@@ -237,6 +223,11 @@ public class ReimbursementCon {
|
||||
one.setv("money_big", Convert.digitToChinese(one.getDouble("activity_money")));
|
||||
one.setv("apply_time", one.getString("apply_time").substring(0, 10));
|
||||
|
||||
String budgets = one.getString("budgets");
|
||||
List<NutMap> goods = JSONUtil.parseArray(budgets).toList(NutMap.class);
|
||||
|
||||
one.put("goods",goods);
|
||||
|
||||
if (one.getString("activity_type").equals("40001")) {
|
||||
one.setv("jfName", "校工会");
|
||||
} else if (one.getString("activity_type").equals("40002")) {
|
||||
@@ -251,7 +242,6 @@ public class ReimbursementCon {
|
||||
BigDecimal priceBigDecimal = new BigDecimal(price);
|
||||
BigDecimal moneyDecimal = priceBigDecimal.subtract(new BigDecimal(money_int));
|
||||
|
||||
double money_decimal = money_int - price;
|
||||
one.setv("one", money_int >= 1000000 ? (money_int / 1000000) % 10 : null);
|
||||
one.setv("two", money_int >= 100000 ? (money_int / 100000) % 10 : null);
|
||||
one.setv("three", money_int >= 10000 ? (money_int / 10000) % 10 : null);
|
||||
@@ -260,10 +250,16 @@ public class ReimbursementCon {
|
||||
one.setv("six", money_int >= 10 ? (money_int / 10) % 10 : null);
|
||||
one.setv("seven", money_int >= 1 ? money_int % 10 : null);
|
||||
|
||||
BigDecimal decimalPart1 = moneyDecimal.divide(new BigDecimal("1"), 1, RoundingMode.HALF_UP);
|
||||
BigDecimal decimalPart2 = moneyDecimal.divide(new BigDecimal("0.1"), 1, RoundingMode.HALF_UP);
|
||||
one.setv("eight", decimalPart1.movePointRight(1).intValueExact());
|
||||
one.setv("nine", decimalPart2.movePointRight(1).intValueExact());
|
||||
// 提取小数部分的各个位上的数值
|
||||
BigDecimal tenthsPart = moneyDecimal.multiply(BigDecimal.TEN).setScale(0, RoundingMode.DOWN);
|
||||
int tenths = tenthsPart.intValue();
|
||||
BigDecimal hundredthsPart = moneyDecimal.multiply(BigDecimal.valueOf(100)).setScale(0, RoundingMode.DOWN);
|
||||
int hundredths = hundredthsPart.intValue();
|
||||
|
||||
// BigDecimal decimalPart1 = moneyDecimal.divide(new BigDecimal("1"), 1, RoundingMode.HALF_UP);
|
||||
// BigDecimal decimalPart2 = moneyDecimal.divide(new BigDecimal("0.1"), 1, RoundingMode.HALF_UP);
|
||||
one.setv("eight", (tenths % 10));
|
||||
one.setv("nine", (hundredths % 10) + 1);
|
||||
|
||||
|
||||
/*基层工会主席签字*/
|
||||
@@ -308,7 +304,9 @@ public class ReimbursementCon {
|
||||
|
||||
String fileName = Globals.schoolName + "【" + one.getString("activity_name") + "】报销凭证";
|
||||
|
||||
Configure config = Configure.newBuilder().build();
|
||||
HackLoopTableRenderPolicy policy = new HackLoopTableRenderPolicy();
|
||||
Configure config = Configure.newBuilder().bind("goods", policy).build();
|
||||
|
||||
InputStream inputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("docTemplate/funds3.docx");
|
||||
response.addHeader("Content-Type", "application/octet-stream");
|
||||
response.addHeader("Content-Disposition", "attachment; filename=\"" + new String(fileName.getBytes("UTF-8"), "ISO-8859-1") + "\".docx");
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package io.v.nutz.zhgh.jf.controller.activitybx;
|
||||
|
||||
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.deepoove.poi.XWPFTemplate;
|
||||
import com.deepoove.poi.config.Configure;
|
||||
import com.deepoove.poi.data.PictureRenderData;
|
||||
@@ -8,11 +9,11 @@ import com.deepoove.poi.policy.HackLoopTableRenderPolicy;
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.utils.Html2Text;
|
||||
import io.v.nutz.base.utils.Vi;
|
||||
import io.v.nutz.zhgh.jf.model.ActivityBx;
|
||||
import io.v.nutz.zhgh.jf.service.ActivityBxService;
|
||||
import io.v.nutz.sys.services.SysUnionService;
|
||||
import io.v.nutz.web.commons.base.Globals;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.zhgh.jf.model.ActivityBx;
|
||||
import io.v.nutz.zhgh.jf.service.ActivityBxService;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Sqls;
|
||||
@@ -137,7 +138,11 @@ public class ReimbursementViewCon {
|
||||
NutMap nutMap = activityBxService.queryOne(id);
|
||||
nutMap.setv("activity_content", Html2Text.toPlainText(nutMap.getString("activity_content")));
|
||||
nutMap.setv("apply_time", nutMap.getString("apply_time").substring(0, 10));
|
||||
List<NutMap> goods = nutMap.getAsList("Goods", NutMap.class);
|
||||
|
||||
String budgets = nutMap.getString("budgets");
|
||||
List<NutMap> goods = JSONUtil.parseArray(budgets).toList(NutMap.class);
|
||||
|
||||
// List<NutMap> goods = nutMap.getAsList("budgets", NutMap.class);
|
||||
|
||||
for (int i = 0; i < goods.size(); i++) {
|
||||
goods.get(i).put("ranking", i + 1);
|
||||
|
||||
@@ -151,7 +151,7 @@ public class UnionCon {
|
||||
String nodeName = "";
|
||||
if (nutMap.getBoolean("flag")) {
|
||||
User user = activityBxService.dao().fetch(User.class, Cnd.where("id", "=", aid.getUser_id()));
|
||||
//msgApi.sendWxMsg("活动申报", "", "text", "您申报的活动【" + aid.getActivity_name() + "】已审核通过,请前往智慧工会进行查看。", List.of(user.getLoginname()), null);
|
||||
msgApi.sendWxMsg("活动申报", "", "text", "您申报的活动【" + aid.getActivity_name() + "】已审核通过,请前往智慧工会进行查看。", List.of(user.getLoginname()), null);
|
||||
|
||||
|
||||
if (aid.getActivity_id() == null) {
|
||||
@@ -161,12 +161,11 @@ public class UnionCon {
|
||||
activityTissue.setType(aid.getActivity_type());
|
||||
activityTissue.setActivityCode(aid.getProjectCode());
|
||||
activityTissue.setName(aid.getActivity_name());
|
||||
activityTissue.setUserId(ShiroUtil.getUserId());
|
||||
activityTissue.setUserId(aid.getUser_id());
|
||||
activityTissue.setStartPlannedDate(aid.getStartPlannedDate());
|
||||
activityTissue.setEndPlannedDate(aid.getEndPlannedDate());
|
||||
activityTissue.setStartTime(aid.getStartTime());
|
||||
activityTissue.setEndTime(aid.getEndTime());
|
||||
activityTissue.setUserId(ShiroUtil.getUserId());
|
||||
activityTissue.setAddress(aid.getAddress());
|
||||
if (aid.getActivity_type() == 40002) {
|
||||
activityTissue.setUnionId(user.getUnionid());
|
||||
@@ -180,7 +179,7 @@ public class UnionCon {
|
||||
nodeName = "审核通过";
|
||||
} else {
|
||||
Sys_user user = activityBxService.dao().fetch(Sys_user.class, aid.getUser_id());
|
||||
//msgApi.sendWxMsg("活动申报", "", "text", "您申报的活动【" + aid.getActivity_name() + "】被校工会主席拒绝,审核意见:" + aid.getUnion_chairman_idea(), List.of(user.getLoginname()), null);
|
||||
msgApi.sendWxMsg("活动申报", "", "text", "您申报的活动【" + aid.getActivity_name() + "】被校工会主席拒绝,审核意见:" + aid.getUnion_chairman_idea(), List.of(user.getLoginname()), null);
|
||||
FundsToHandler.REFUSE_TASK.exec(aid.getId(), new NutMap().addv("option", nodeName), null);
|
||||
}
|
||||
activityBxService.update(aid);
|
||||
|
||||
@@ -3,10 +3,10 @@ package io.v.nutz.zhgh.jf.controller.club;
|
||||
import cn.afterturn.easypoi.excel.ExcelImportUtil;
|
||||
import cn.afterturn.easypoi.excel.entity.ImportParams;
|
||||
import cn.wizzer.framework.base.Result;
|
||||
import io.v.nutz.zhgh.jf.model.jf_club;
|
||||
import io.v.nutz.zhgh.jf.service.jfClubService;
|
||||
import io.v.nutz.sys.models.Sys_club;
|
||||
import io.v.nutz.sys.services.SysClubService;
|
||||
import io.v.nutz.zhgh.jf.model.jf_club;
|
||||
import io.v.nutz.zhgh.jf.service.jfClubService;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
|
||||
@@ -5,9 +5,9 @@ import cn.wizzer.framework.page.Pagination;
|
||||
import io.v.nutz.base.utils.ExcelUtil;
|
||||
import io.v.nutz.base.utils.PageUtil;
|
||||
import io.v.nutz.base.utils.Roles;
|
||||
import io.v.nutz.zhgh.jf.service.jfClubService;
|
||||
import io.v.nutz.sys.models.Sys_user_role;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.zhgh.jf.service.jfClubService;
|
||||
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
||||
import org.apache.shiro.authz.annotation.RequiresAuthentication;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
|
||||
@@ -2,15 +2,15 @@ package io.v.nutz.zhgh.jf.controller.costsSet;
|
||||
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.utils.DateUtil;
|
||||
import io.v.nutz.sys.models.Sys_club;
|
||||
import io.v.nutz.sys.models.Sys_union;
|
||||
import io.v.nutz.sys.services.SysClubService;
|
||||
import io.v.nutz.sys.services.SysUnionService;
|
||||
import io.v.nutz.zhgh.jf.model.CostsSet;
|
||||
import io.v.nutz.zhgh.jf.model.jf_club;
|
||||
import io.v.nutz.zhgh.jf.model.jf_school;
|
||||
import io.v.nutz.zhgh.jf.model.jf_yjgh;
|
||||
import io.v.nutz.zhgh.jf.service.CostsSetService;
|
||||
import io.v.nutz.sys.models.Sys_club;
|
||||
import io.v.nutz.sys.models.Sys_union;
|
||||
import io.v.nutz.sys.services.SysClubService;
|
||||
import io.v.nutz.sys.services.SysUnionService;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
|
||||
@@ -9,17 +9,16 @@ import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.result.Result;
|
||||
import io.v.nutz.base.service.BaseService;
|
||||
import io.v.nutz.base.utils.ViTool;
|
||||
import io.v.nutz.sys.models.Sys_club;
|
||||
import io.v.nutz.sys.models.Sys_union;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.zhgh.jf.mode.FinancialImportExcelMode;
|
||||
import io.v.nutz.zhgh.jf.model.jf_club;
|
||||
import io.v.nutz.zhgh.jf.model.jf_use;
|
||||
import io.v.nutz.zhgh.jf.model.jf_yjgh;
|
||||
import io.v.nutz.sys.models.Sys_club;
|
||||
import io.v.nutz.sys.models.Sys_union;
|
||||
import io.v.nutz.base.utils.ViTool;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.apache.shiro.authz.annotation.RequiresAuthentication;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Chain;
|
||||
|
||||
@@ -3,11 +3,11 @@ package io.v.nutz.zhgh.jf.controller.jfbx;
|
||||
import cn.wizzer.framework.base.Result;
|
||||
import cn.wizzer.framework.page.Pagination;
|
||||
import io.v.nutz.base.utils.DateUtil;
|
||||
import io.v.nutz.zhgh.jf.model.jf_bxyy;
|
||||
import io.v.nutz.zhgh.jf.service.jfBxYyFjService;
|
||||
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.jf.model.jf_bxyy;
|
||||
import io.v.nutz.zhgh.jf.service.jfBxYyFjService;
|
||||
import org.apache.shiro.authz.annotation.RequiresAuthentication;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.nutz.dao.Cnd;
|
||||
|
||||
@@ -4,12 +4,12 @@ import cn.wizzer.framework.base.Result;
|
||||
import cn.wizzer.framework.base.service.BaseService;
|
||||
import cn.wizzer.framework.page.Pagination;
|
||||
import io.v.nutz.base.utils.DateUtil;
|
||||
import io.v.nutz.zhgh.jf.model.jf_bxyy;
|
||||
import io.v.nutz.zhgh.jf.model.jf_bxyy_fj;
|
||||
import io.v.nutz.sys.models.Sys_file;
|
||||
import io.v.nutz.sys.models.Sys_user;
|
||||
import io.v.nutz.web.commons.utils.DocConverter;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.zhgh.jf.model.jf_bxyy;
|
||||
import io.v.nutz.zhgh.jf.model.jf_bxyy_fj;
|
||||
import org.apache.shiro.authz.annotation.RequiresAuthentication;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.nutz.boot.starter.ftp.FtpService;
|
||||
|
||||
@@ -5,12 +5,12 @@ import cn.wizzer.framework.page.Pagination;
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.utils.DateUtil;
|
||||
import io.v.nutz.base.utils.PageUtil;
|
||||
import io.v.nutz.sys.models.Sys_user;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.zhgh.jf.model.jf_club;
|
||||
import io.v.nutz.zhgh.jf.model.jf_use;
|
||||
import io.v.nutz.zhgh.jf.model.jf_yjgh;
|
||||
import io.v.nutz.zhgh.jf.service.ActivityBxService;
|
||||
import io.v.nutz.sys.models.Sys_user;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
|
||||
+54
-21
@@ -1,15 +1,17 @@
|
||||
package io.v.nutz.zhgh.jf.controller.reimbursement;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.zhgh.jf.handle.reimbursement.ReimbursementToHandler;
|
||||
import io.v.nutz.zhgh.jf.model.ActivityBx;
|
||||
import io.v.nutz.zhgh.jf.service.ActivityBxService;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Cnd;
|
||||
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;
|
||||
@@ -18,15 +20,17 @@ import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @version 1.0
|
||||
* @Author zzr
|
||||
* @name:ActivityReimbursementApplyController
|
||||
* @Date 2024/4/26 14:58
|
||||
* @注释 活动报销,报销申请
|
||||
* 校工会活动——>校工会负责人(姜学军)审核——>校工会主席审核——>流程结束
|
||||
* 基层工会活动——>基层工会主席审核——>校工会负责人(姜学军)审核——>校工会主席审核——>流程结束
|
||||
* 协会活动——>协会负责人审核——>校工会负责人(姜学军)审核——>校工会主席审核——>流程结束
|
||||
* 校工会活动——>校工会负责人(姜学军)审核——>校工会主席审核——>流程结束
|
||||
* 基层工会活动——>基层工会主席审核——>校工会负责人(姜学军)审核——>校工会主席审核——>流程结束
|
||||
* 协会活动——>协会负责人审核——>校工会负责人(姜学军)审核——>校工会主席审核——>流程结束
|
||||
*/
|
||||
@IocBean
|
||||
@Ok("json:full")
|
||||
@@ -39,63 +43,92 @@ public class ActivityReimbursementApplyController {
|
||||
@At("")
|
||||
@Ok("beetl:/platform/jf/reimbursement/apply.html")
|
||||
@RequiresPermissions("sys.jf.reimbursement.apply")
|
||||
public void index() {}
|
||||
public void index() {
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("sys.jf.reimbursement.apply")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public Object doEdit(@Param("activityBx") ActivityBx activityBx,@Param(value = "sign",required = false)String sign){
|
||||
public Object doSave(@Param("activityBx") ActivityBx activityBx) {
|
||||
List<ActivityBx.Budget> budgets = activityBx.getBudgets();
|
||||
if (ArrayUtil.isNotEmpty(budgets)) {
|
||||
double sum = budgets.stream().mapToDouble(ActivityBx.Budget::getActualPrice).sum();
|
||||
activityBx.setActivity_money(sum);
|
||||
activityBx.setReimbursement_apply_time(DateUtil.today());
|
||||
}
|
||||
|
||||
activityBx.setFiles(null);
|
||||
activityBx.setActivity_content(null);
|
||||
activityBx.setReimbursement_state_id(999);
|
||||
activityBxService.updateIgnoreNull(activityBx);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("sys.jf.reimbursement.apply")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public Object doEdit(@Param("activityBx") ActivityBx activityBx, @Param(value = "sign", required = false) String sign) {
|
||||
int count = activityBxService.count(Cnd.where("id", "=", activityBx.getId()));
|
||||
|
||||
switch (activityBx.getActivity_type()){
|
||||
switch (activityBx.getActivity_type()) {
|
||||
case 40001 -> activityBx.setReimbursement_state_id(1020);
|
||||
case 40002 -> activityBx.setReimbursement_state_id(1010);
|
||||
case 40003 -> activityBx.setReimbursement_state_id(1000);
|
||||
}
|
||||
|
||||
List<ActivityBx.Budget> budgets = activityBx.getBudgets();
|
||||
double sum = budgets.stream().mapToDouble(ActivityBx.Budget::getActualPrice).sum();
|
||||
activityBx.setActivity_money(sum);
|
||||
activityBx.setReimbursement_apply_time(DateUtil.today());
|
||||
|
||||
if (StrUtil.isNotBlank(activityBx.getId()) && count>0){
|
||||
if (StrUtil.isNotBlank(activityBx.getId()) && count > 0) {
|
||||
activityBx.setFiles(null);
|
||||
activityBx.setActivity_content(null);
|
||||
activityBxService.updateIgnoreNull(activityBx);
|
||||
} else {
|
||||
activityBxService.doAdd(activityBx);
|
||||
// activityBxService.doAdd(activityBx);
|
||||
}
|
||||
|
||||
NutMap map = new NutMap();
|
||||
map.put("userId",ShiroUtil.getUserId());
|
||||
map.put("userId", ShiroUtil.getUserId());
|
||||
//流程开始
|
||||
ReimbursementToHandler.START_PROCESS.exec(activityBx.getId(),map);
|
||||
ReimbursementToHandler.START_PROCESS.exec(activityBx.getId(), map);
|
||||
if (activityBx.getActivity_type() == 40001) {
|
||||
//校工会申请,校工会负责人审核
|
||||
ReimbursementToHandler.CREATE_SCHOOL_DIRECTOR_TASK.exec(activityBx.getId(), map);
|
||||
} else if (activityBx.getActivity_type() == 40002) {
|
||||
//分工会
|
||||
ReimbursementToHandler.CREATE_UNION_TASK.exec(activityBx.getId(),map);
|
||||
ReimbursementToHandler.CREATE_UNION_TASK.exec(activityBx.getId(), map);
|
||||
} else if (activityBx.getActivity_type() == 40003) {
|
||||
//协会
|
||||
ReimbursementToHandler.CREATE_CLUB_TASK.exec(activityBx.getId(),map);
|
||||
ReimbursementToHandler.CREATE_CLUB_TASK.exec(activityBx.getId(), map);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("sys.jf.reimbursement.apply")
|
||||
public Object getActivityReimbursementByUser(){
|
||||
public Object getActivityReimbursementByUser() {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("state_id", "=", 1060);
|
||||
cnd.andEX("`year`","=",DateUtil.thisYear());
|
||||
cnd.and(Cnd.exps("reimbursement_state_id","is",null).or("reimbursement_state_id","=",""));
|
||||
cnd.and(Cnd.exps("reimbursement_state_id","is",null).or("reimbursement_state_id","=",""));
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin")){
|
||||
cnd.and("user_id","=",ShiroUtil.getUserId());
|
||||
cnd.andEX("`year`", "=", DateUtil.thisYear());
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
seg.or("reimbursement_state_id", "in", List.of(1005, 1015, 1025, 1045));
|
||||
seg.or("reimbursement_union_audit_id", "is", null);
|
||||
cnd.and(seg);
|
||||
// cnd.and("reimbursement_unit_secretary_audit_id", "is", null);
|
||||
// cnd.and("reimbursement_finance_audit_id", "is", null);
|
||||
// cnd.and("reimbursement_school_director_id", "is", null);
|
||||
// cnd.and("reimbursement_school_chairman_id", "is", null);
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin")) {
|
||||
cnd.and("user_id", "=", ShiroUtil.getUserId());
|
||||
}
|
||||
return activityBxService.query(cnd);
|
||||
}
|
||||
@@ -104,7 +137,7 @@ public class ActivityReimbursementApplyController {
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("sys.jf.reimbursement.apply")
|
||||
public Object findOne(String id){
|
||||
public Object findOne(String id) {
|
||||
return activityBxService.queryOne(id);
|
||||
}
|
||||
}
|
||||
|
||||
+4
-4
@@ -2,9 +2,7 @@ package io.v.nutz.zhgh.jf.controller.reimbursement;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.wizzer.framework.base.Result;
|
||||
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.jf.service.ActivityBxService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
@@ -19,8 +17,10 @@ import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @version 1.0
|
||||
|
||||
+4
-5
@@ -3,18 +3,17 @@ package io.v.nutz.zhgh.jf.controller.reimbursement;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.utils.Vi;
|
||||
import io.v.nutz.zhgh.jf.handle.reimbursement.ReimbursementToHandler;
|
||||
import io.v.nutz.zhgh.jf.service.ActivityBxService;
|
||||
import io.v.nutz.base.model.Audit;
|
||||
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.web.commons.slog.annotation.SLog;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.zhgh.jf.handle.reimbursement.ReimbursementToHandler;
|
||||
import io.v.nutz.zhgh.jf.service.ActivityBxService;
|
||||
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.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.aop.Aop;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
|
||||
+14
-19
@@ -5,19 +5,17 @@ import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import io.v.nutz.zhgh.activity.models.ActivityTissuePerson;
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.query.PageForm;
|
||||
import io.v.nutz.base.utils.Vi;
|
||||
import io.v.nutz.base.utils.ViTool;
|
||||
import io.v.nutz.sys.models.Sys_file;
|
||||
import io.v.nutz.web.commons.utils.FileUtil;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.zhgh.activity.models.ActivityTissuePerson;
|
||||
import io.v.nutz.zhgh.jf.handle.reimbursement.ReimbursementToHandler;
|
||||
import io.v.nutz.zhgh.jf.model.ActivityBx;
|
||||
import io.v.nutz.zhgh.jf.service.ActivityBxService;
|
||||
import io.v.nutz.base.query.PageForm;
|
||||
import io.v.nutz.sys.models.Sys_file;
|
||||
import io.v.nutz.sys.models.Sys_union;
|
||||
import io.v.nutz.sys.models.Sys_user;
|
||||
import io.v.nutz.base.utils.ViTool;
|
||||
import io.v.nutz.web.commons.utils.FileUtil;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
@@ -25,7 +23,6 @@ import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.boot.starter.ftp.FtpService;
|
||||
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;
|
||||
@@ -33,7 +30,6 @@ import org.nutz.ioc.aop.Aop;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.Lang;
|
||||
import org.nutz.lang.Strings;
|
||||
import org.nutz.lang.random.R;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
@@ -44,7 +40,6 @@ import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -106,15 +101,15 @@ public class ActivityReimbursementMineController {
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin,wyh02,H10,xghng")) {
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) {
|
||||
SqlExpressionGroup group2 = new SqlExpressionGroup();
|
||||
// if (ShiroUtil.hasAnyRoles("gh01,H04")) {
|
||||
// group2.or("u.unionid", "=", vi.getUnionId());
|
||||
// } else if (ShiroUtil.hasRole("H02")) {
|
||||
// group2.or("scu.clubid", "=", vi.getClubId());
|
||||
// } else {
|
||||
// }
|
||||
group2.or("act.user_id", "=", ShiroUtil.getUserId());
|
||||
if (ShiroUtil.hasAnyRoles("gh01,H04")) {
|
||||
group2.or("u.unionid", "=", vi.getUnionId());
|
||||
} else if (ShiroUtil.hasRole("H02")) {
|
||||
group2.or("scu.clubid", "=", vi.getClubId());
|
||||
} else {
|
||||
group2.or("act.user_id", "=", ShiroUtil.getUserId());
|
||||
}
|
||||
cnd.and(group2);
|
||||
}
|
||||
|
||||
|
||||
+3
-5
@@ -2,17 +2,15 @@ package io.v.nutz.zhgh.jf.controller.reimbursement;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.utils.Vi;
|
||||
import io.v.nutz.zhgh.jf.handle.reimbursement.ReimbursementToHandler;
|
||||
import io.v.nutz.zhgh.jf.service.ActivityBxService;
|
||||
import io.v.nutz.base.model.Audit;
|
||||
import io.v.nutz.base.query.PageForm;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.web.commons.slog.annotation.SLog;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.zhgh.jf.handle.reimbursement.ReimbursementToHandler;
|
||||
import io.v.nutz.zhgh.jf.service.ActivityBxService;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.nutz.dao.Chain;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
|
||||
+3
-4
@@ -2,13 +2,12 @@ package io.v.nutz.zhgh.jf.controller.reimbursement;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.utils.Vi;
|
||||
import io.v.nutz.zhgh.jf.handle.reimbursement.ReimbursementToHandler;
|
||||
import io.v.nutz.zhgh.jf.service.ActivityBxService;
|
||||
import io.v.nutz.base.model.Audit;
|
||||
import io.v.nutz.base.query.PageForm;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.web.commons.slog.annotation.SLog;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.zhgh.jf.handle.reimbursement.ReimbursementToHandler;
|
||||
import io.v.nutz.zhgh.jf.service.ActivityBxService;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.nutz.dao.Chain;
|
||||
import org.nutz.dao.Cnd;
|
||||
|
||||
+1
-4
@@ -2,11 +2,9 @@ package io.v.nutz.zhgh.jf.controller.reimbursement;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.query.PageForm;
|
||||
import io.v.nutz.zhgh.jf.model.ActivityBx;
|
||||
import io.v.nutz.zhgh.jf.service.ActivityBxService;
|
||||
import io.v.nutz.base.model.Audit;
|
||||
import io.v.nutz.base.query.PageForm;
|
||||
import io.v.nutz.web.commons.slog.annotation.SLog;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
@@ -18,7 +16,6 @@ import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @version 1.0
|
||||
|
||||
+5
-6
@@ -2,17 +2,16 @@ package io.v.nutz.zhgh.jf.controller.reimbursement;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.utils.Vi;
|
||||
import io.v.nutz.zhgh.jf.handle.reimbursement.ReimbursementToHandler;
|
||||
import io.v.nutz.zhgh.jf.service.ActivityBxService;
|
||||
import io.v.nutz.base.model.Audit;
|
||||
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.web.commons.slog.annotation.SLog;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.zhgh.jf.handle.reimbursement.ReimbursementToHandler;
|
||||
import io.v.nutz.zhgh.jf.service.ActivityBxService;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.nutz.dao.Chain;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
@@ -65,7 +64,7 @@ public class ActivityReimbursementUnionChairmanController {
|
||||
//1已审核;2未审核;0全部
|
||||
cnd.and("act.reimbursement_state_id", "1".equals(isAudit) ? ">" : "2".equals(isAudit) ? "=" : ">=", 1010);
|
||||
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin,A06")){
|
||||
if (ShiroUtil.hasAnyRoles("sysadmin,A06")){
|
||||
cnd.andEX("u.unionid","=",unionId);
|
||||
} else {
|
||||
cnd.and("u.unionid","=", Vi.getUnionId());
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package io.v.nutz.zhgh.jf.controller.school;
|
||||
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.query.PageForm;
|
||||
import io.v.nutz.base.service.BaseService;
|
||||
import io.v.nutz.base.utils.DateUtil;
|
||||
import io.v.nutz.zhgh.jf.model.CostsSet;
|
||||
import io.v.nutz.zhgh.jf.model.jf_school;
|
||||
import io.v.nutz.base.query.PageForm;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.nutz.dao.Chain;
|
||||
import org.nutz.dao.Cnd;
|
||||
|
||||
@@ -3,9 +3,9 @@ package io.v.nutz.zhgh.jf.controller.yjgh;
|
||||
import cn.afterturn.easypoi.excel.ExcelImportUtil;
|
||||
import cn.afterturn.easypoi.excel.entity.ImportParams;
|
||||
import cn.wizzer.framework.base.Result;
|
||||
import io.v.nutz.zhgh.jf.model.jf_yjgh;
|
||||
import io.v.nutz.sys.models.Sys_union;
|
||||
import io.v.nutz.sys.services.SysUnionService;
|
||||
import io.v.nutz.zhgh.jf.model.jf_yjgh;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
|
||||
@@ -7,7 +7,6 @@ import io.v.nutz.base.utils.PageUtil;
|
||||
import io.v.nutz.base.utils.Roles;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
||||
import org.apache.shiro.authz.annotation.RequiresAuthentication;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.nutz.dao.Chain;
|
||||
import org.nutz.dao.Cnd;
|
||||
|
||||
@@ -3,14 +3,13 @@ package io.v.nutz.zhgh.jf.controller.yjgh;
|
||||
import cn.wizzer.framework.base.Result;
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.page.Pagination;
|
||||
import io.v.nutz.base.service.AsyncService;
|
||||
import io.v.nutz.base.service.BaseService;
|
||||
import io.v.nutz.base.utils.DateUtil;
|
||||
import io.v.nutz.zhgh.jf.model.CostsSet;
|
||||
import io.v.nutz.zhgh.jf.model.jf_yjgh;
|
||||
import io.v.nutz.zhgh.jf.service.CostsSetService;
|
||||
import io.v.nutz.zhgh.jf.service.jfYjghService;
|
||||
import io.v.nutz.base.service.AsyncService;
|
||||
import org.apache.shiro.authz.annotation.RequiresAuthentication;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Chain;
|
||||
|
||||
@@ -1,32 +1,20 @@
|
||||
package io.v.nutz.zhgh.jf.handle.reimbursement;
|
||||
|
||||
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.sys.models.Sys_user_role;
|
||||
import io.v.nutz.sys.models.User;
|
||||
import io.v.nutz.sys.services.SysLocalProcessService;
|
||||
import io.v.nutz.sys.services.impl.SysLocalProcessServiceImpl;
|
||||
import io.v.nutz.web.commons.base.Globals;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.zhgh.member.model.MemberChangeRecord;
|
||||
import io.v.nutz.zhgh.needhandlebycpu.model.vo.ParticipantVO;
|
||||
import io.v.nutz.zhgh.needhandlebycpu.model.vo.TaskVO;
|
||||
import io.v.nutz.zhgh.needhandlebycpu.service.HandleCpuCommonService;
|
||||
import io.v.nutz.zhgh.needhandlebycpu.service.impl.HandleCpuCommonServiceImpl;
|
||||
import io.v.nutz.zhgh.zgfw.model.condolence.Condolence;
|
||||
import io.v.nutz.zhgh.zgfw.model.difficult.Zgfw_knbf;
|
||||
import io.v.nutz.zhgh.zgfw.service.CondolenceService;
|
||||
import io.v.nutz.zhgh.zgfw.service.impl.CondolenceServiceImpl;
|
||||
import lombok.Getter;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -50,7 +38,7 @@ public enum ReimbursementToHandler {
|
||||
User user = dao.fetch(User.class, Cnd.where("id", "=", userId));
|
||||
|
||||
localProcessService.startProcess(
|
||||
user.getUnionname() + "(" + user.getUsername() + ")【活动报销】申请",
|
||||
"【活动报销】" + user.getUnionname() + "(" + user.getUsername() + ")",
|
||||
"activity_reimbursement@" + reimbursementId,
|
||||
"",
|
||||
userId,
|
||||
@@ -209,7 +197,7 @@ public enum ReimbursementToHandler {
|
||||
"activity_reimbursement_school_director_audit",
|
||||
"校工会负责人审核",
|
||||
ShiroUtil.getUserId(),
|
||||
List.of("8333300107"),
|
||||
List.of("1019911404"),
|
||||
"/platform/jf/reimbursement/schoolDirector",
|
||||
"/platform/jf/reimbursement/schoolDirector",
|
||||
"/platform/jf/reimbursement/schoolDirector",
|
||||
|
||||
@@ -405,6 +405,36 @@ public class ActivityBx {
|
||||
private List<Sys_file> newsFiles;
|
||||
|
||||
|
||||
@Column
|
||||
@Comment("活动经费预算")
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
private List<Budget> budgets;
|
||||
|
||||
/**
|
||||
* 活动费用预算
|
||||
*/
|
||||
@Data
|
||||
public static class Budget{
|
||||
// 名称
|
||||
private String name;
|
||||
// 预算费用
|
||||
private Double budgetPrice;
|
||||
// 实际费用
|
||||
private Double actualPrice;
|
||||
// 收款人id
|
||||
private String payeeId;
|
||||
// 收款人姓名
|
||||
private String username;
|
||||
// 收款人工号
|
||||
private String loginName;
|
||||
// 支行名称
|
||||
private String bankName;
|
||||
// 报销卡号
|
||||
private String bankCardNum;
|
||||
// 备注
|
||||
private String remark;
|
||||
}
|
||||
|
||||
@Column
|
||||
@Comment("单据号")
|
||||
@Prev({
|
||||
|
||||
@@ -3,7 +3,6 @@ package io.v.nutz.zhgh.jf.model;
|
||||
import lombok.Data;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
import org.nutz.dao.interceptor.annotation.PrevInsert;
|
||||
import org.nutz.integration.json4excel.annotation.J4EIgnore;
|
||||
|
||||
/**
|
||||
* TODO
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package io.v.nutz.zhgh.jf.service;
|
||||
|
||||
import io.v.nutz.zhgh.jf.model.ActivityBx;
|
||||
import io.v.nutz.base.service.ViService;
|
||||
import io.v.nutz.zhgh.jf.model.ActivityBx;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
|
||||
@@ -3,22 +3,18 @@ package io.v.nutz.zhgh.jf.service.impl;
|
||||
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
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.zhgh.activity.models.ActivityTissue;
|
||||
import io.v.nutz.base.utils.DateUtil;
|
||||
import io.v.nutz.base.model.Audit;
|
||||
import io.v.nutz.base.service.impl.ViServiceImpl;
|
||||
import io.v.nutz.base.utils.Html2Text;
|
||||
import io.v.nutz.base.utils.Vi;
|
||||
import io.v.nutz.base.model.Goods;
|
||||
import io.v.nutz.zhgh.jf.model.ActivityBx;
|
||||
import io.v.nutz.zhgh.jf.model.ActivityFile;
|
||||
import io.v.nutz.zhgh.jf.service.ActivityBxService;
|
||||
import io.v.nutz.base.model.Audit;
|
||||
import io.v.nutz.base.service.impl.ViServiceImpl;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.web.commons.base.Globals;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
@@ -30,9 +26,10 @@ import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.Strings;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.Base64;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
@@ -68,11 +65,12 @@ public class ActivityBxServiceImpl extends ViServiceImpl<ActivityBx> implements
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public void doEdit(ActivityBx activityBx) {
|
||||
|
||||
activityBx.getGoods().forEach(v -> {
|
||||
/*activityBx.getGoods().forEach(v -> {
|
||||
v.setReid(activityBx.getId());
|
||||
});
|
||||
dao().clear(Goods.class,Cnd.where("reid","=",activityBx.getId()));
|
||||
insert(activityBx.getGoods());
|
||||
insert(activityBx.getGoods());*/
|
||||
update(activityBx);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -130,7 +128,7 @@ public class ActivityBxServiceImpl extends ViServiceImpl<ActivityBx> implements
|
||||
sql.setCallback(Sqls.callback.map());
|
||||
dao().execute(sql);
|
||||
NutMap record = (NutMap) sql.getResult();
|
||||
record.setv("Goods", dao().query(Goods.class, Cnd.where("reid", "=", record.getString("id"))));
|
||||
// record.setv("Goods", dao().query("Goods", Cnd.where("reid", "=", record.getString("id"))));
|
||||
|
||||
if (record.size() == 0) {
|
||||
return null;
|
||||
@@ -172,7 +170,9 @@ public class ActivityBxServiceImpl extends ViServiceImpl<ActivityBx> implements
|
||||
NutMap nutMap = queryOne(id);
|
||||
nutMap.setv("activity_content", Html2Text.toPlainText(nutMap.getString("activity_content")));
|
||||
nutMap.setv("apply_time", nutMap.getString("apply_time").substring(0, 10));
|
||||
List<NutMap> goods = nutMap.getAsList("Goods", NutMap.class);
|
||||
|
||||
String budgets = nutMap.getString("budgets");
|
||||
List<NutMap> goods = JSONUtil.parseArray(budgets).toList(NutMap.class);
|
||||
|
||||
for (int i = 0; i < goods.size(); i++) {
|
||||
goods.get(i).put("ranking", i + 1);
|
||||
@@ -233,18 +233,26 @@ public class ActivityBxServiceImpl extends ViServiceImpl<ActivityBx> implements
|
||||
if (StrUtil.isNotBlank(one.getString("activity_content"))) {
|
||||
one.setv("activity_content", Html2Text.getContent(one.getString("activity_content")));
|
||||
}
|
||||
one.setv("money_big", Convert.digitToChinese(one.getDouble("funds_money")));
|
||||
one.setv("money_big", Convert.digitToChinese(one.getDouble("activity_money")));
|
||||
one.setv("apply_time", one.getString("apply_time").substring(0, 10));
|
||||
|
||||
String budgets = one.getString("budgets");
|
||||
List<NutMap> goods = JSONUtil.parseArray(budgets).toList(NutMap.class);
|
||||
|
||||
one.put("goods",goods);
|
||||
|
||||
switch (one.getString("activity_type")) {
|
||||
case "40001" -> one.setv("jfName", "校工会");
|
||||
case "40002" -> one.setv("jfName", "分工会");
|
||||
case "40003" -> one.setv("jfName", "协会");
|
||||
}
|
||||
|
||||
double price = one.getDouble("funds_money");
|
||||
double price = one.getDouble("activity_money");
|
||||
int money_int = (int) price;
|
||||
double money_decimal = money_int - price;
|
||||
|
||||
BigDecimal priceBigDecimal = new BigDecimal(price);
|
||||
BigDecimal moneyDecimal = priceBigDecimal.subtract(new BigDecimal(money_int));
|
||||
|
||||
one.setv("one", money_int >= 1000000 ? (money_int / 1000000) % 10 : null);
|
||||
one.setv("two", money_int >= 100000 ? (money_int / 100000) % 10 : null);
|
||||
one.setv("three", money_int >= 10000 ? (money_int / 10000) % 10 : null);
|
||||
@@ -252,8 +260,17 @@ public class ActivityBxServiceImpl extends ViServiceImpl<ActivityBx> implements
|
||||
one.setv("five", money_int >= 100 ? (money_int / 100) % 10 : null);
|
||||
one.setv("six", money_int >= 10 ? (money_int / 10) % 10 : null);
|
||||
one.setv("seven", money_int >= 1 ? money_int % 10 : null);
|
||||
one.setv("eight", (int) (money_decimal / 1) * 10);
|
||||
one.setv("nine", (int) (money_decimal / 0.1) * 100);
|
||||
|
||||
// 提取小数部分的各个位上的数值
|
||||
BigDecimal tenthsPart = moneyDecimal.multiply(BigDecimal.TEN).setScale(0, RoundingMode.DOWN);
|
||||
int tenths = tenthsPart.intValue();
|
||||
BigDecimal hundredthsPart = moneyDecimal.multiply(BigDecimal.valueOf(100)).setScale(0, RoundingMode.DOWN);
|
||||
int hundredths = hundredthsPart.intValue();
|
||||
|
||||
// BigDecimal decimalPart1 = moneyDecimal.divide(new BigDecimal("1"), 1, RoundingMode.HALF_UP);
|
||||
// BigDecimal decimalPart2 = moneyDecimal.divide(new BigDecimal("0.1"), 1, RoundingMode.HALF_UP);
|
||||
one.setv("eight", (tenths % 10));
|
||||
one.setv("nine", (hundredths % 10) + 1);
|
||||
|
||||
|
||||
/*基层工会主席签字*/
|
||||
@@ -277,7 +294,9 @@ public class ActivityBxServiceImpl extends ViServiceImpl<ActivityBx> implements
|
||||
}
|
||||
// String fileName = Globals.schoolName + "【" + one.getString("activity_name") + "】报销凭证";
|
||||
|
||||
Configure config = Configure.newBuilder().build();
|
||||
HackLoopTableRenderPolicy policy = new HackLoopTableRenderPolicy();
|
||||
Configure config = Configure.newBuilder().bind("goods", policy).build();
|
||||
|
||||
InputStream inputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("docTemplate/funds3.docx");
|
||||
// response.addHeader("Content-Type", "application/octet-stream");
|
||||
// response.addHeader("Content-Disposition", "attachment; filename=\"" + new String(fileName.getBytes("UTF-8"), "ISO-8859-1") + "\".docx");
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package io.v.nutz.zhgh.jf.service.impl;
|
||||
|
||||
import io.v.nutz.base.service.impl.ViServiceImpl;
|
||||
import io.v.nutz.zhgh.jf.model.jf_club;
|
||||
import io.v.nutz.zhgh.jf.service.jfClubService;
|
||||
import io.v.nutz.base.service.impl.ViServiceImpl;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package io.v.nutz.zhgh.jf.service.impl;
|
||||
|
||||
import io.v.nutz.base.service.impl.ViServiceImpl;
|
||||
import io.v.nutz.zhgh.jf.model.jf_yjgh;
|
||||
import io.v.nutz.zhgh.jf.service.jfYjghService;
|
||||
import io.v.nutz.base.service.impl.ViServiceImpl;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package io.v.nutz.zhgh.jf.service;
|
||||
|
||||
import io.v.nutz.zhgh.jf.model.jf_club;
|
||||
import io.v.nutz.base.service.ViService;
|
||||
import io.v.nutz.zhgh.jf.model.jf_club;
|
||||
|
||||
public interface jfClubService extends ViService<jf_club> {
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package io.v.nutz.zhgh.jf.service;
|
||||
|
||||
import io.v.nutz.zhgh.jf.model.jf_yjgh;
|
||||
import io.v.nutz.base.service.ViService;
|
||||
import io.v.nutz.zhgh.jf.model.jf_yjgh;
|
||||
|
||||
public interface jfYjghService extends ViService<jf_yjgh> {
|
||||
}
|
||||
|
||||
@@ -411,7 +411,7 @@ public class WelfareCommonController {
|
||||
@Excel(name = "身份证号", width = 20d)
|
||||
private String idcard;
|
||||
|
||||
/* @Excel(name = "人员类型", width = 20d)
|
||||
/* @Excel(name = "人员性质", width = 20d)
|
||||
private String personType;
|
||||
|
||||
@Excel(name = "在职状态", width = 20d)
|
||||
@@ -465,7 +465,7 @@ public class WelfareCommonController {
|
||||
|
||||
ExportParams exportParams = new ExportParams();
|
||||
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin,SchoolUnionAdmin,SchoolUnionMemberAdmin,SchoolUnionWelfareAdmin")) {
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) {
|
||||
cnd.and("vwl.unionid", "=", Vi.getUnionId());
|
||||
exportParams.setTitle(Vi.getUnion().getUnionname() + "名单");
|
||||
}
|
||||
@@ -541,7 +541,7 @@ public class WelfareCommonController {
|
||||
cnd.andEX("personType", "in", personTypes);
|
||||
cnd.andEX("userState", "in", userStates);
|
||||
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin,SchoolUnionAdmin,SchoolUnionMemberAdmin,SchoolUnionWelfareAdmin,H04,gh12") && Globals.MyConfig.getBoolean("isThreeUnit")) {
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin,A06,H04,gh12") && Globals.MyConfig.getBoolean("isThreeUnit")) {
|
||||
cnd.and("list.unionGroupId", "in", ShiroUtil.getUnionGroupIds());
|
||||
}
|
||||
cnd.asc("unionname");
|
||||
@@ -572,7 +572,7 @@ public class WelfareCommonController {
|
||||
entityList.add(new ExcelExportEntity("工号", "loginname", 20));
|
||||
entityList.add(new ExcelExportEntity("姓名", "username", 20));
|
||||
entityList.add(new ExcelExportEntity("在职状态", "userState", 20));
|
||||
entityList.add(new ExcelExportEntity("人员类型", "personType", 20));
|
||||
entityList.add(new ExcelExportEntity("人员性质", "personType", 20));
|
||||
entityList.add(new ExcelExportEntity("所属工会", "unionname", 50));
|
||||
entityList.add(new ExcelExportEntity("所属单位", "unitname", 50));
|
||||
|
||||
|
||||
@@ -4,11 +4,13 @@ import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||
import cn.afterturn.easypoi.excel.ExcelImportUtil;
|
||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.ImportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.TemplateExportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
||||
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
|
||||
import cn.afterturn.easypoi.excel.export.ExcelExportService;
|
||||
import cn.hutool.core.io.FileUtil;
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.wizzer.framework.base.Result;
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
@@ -34,6 +36,7 @@ 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.dao.util.cri.SqlExpressionGroup;
|
||||
import org.nutz.ioc.aop.Aop;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
@@ -91,8 +94,7 @@ public class WelfareListController {
|
||||
@Param(value = "projectId", required = false) String projectId,
|
||||
@Param(value = "optionId", required = false) String optionId,
|
||||
@Param(value = "month", required = false) String month,
|
||||
@Param(value = "courierNumber", required = false) String courierNumber
|
||||
) {
|
||||
@Param(value = "courierNumber", required = false) String courierNumber) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
CASE
|
||||
@@ -115,10 +117,10 @@ public class WelfareListController {
|
||||
GROUP_CONCAT( DISTINCT wuso.optionName, '(', wus.selectNum, '份)' ) AS gist_list
|
||||
FROM
|
||||
view_welfare_list wl
|
||||
LEFT JOIN welfare_project_user_selection wus ON wus.welfareId = wl.projectId
|
||||
LEFT JOIN welfare_project_user_selection wus ON wus.welfareId = wl.projectId
|
||||
AND wus.selectUserId = wl.id
|
||||
LEFT JOIN welfare_project_subject_option wuso ON wus.selectOptionId = wuso.id
|
||||
LEFT JOIN welfare_courier_number wcn on wcn.selectUserId = wl.id AND wcn.welfareId = wl.projectId
|
||||
LEFT JOIN welfare_courier_number wcn on wcn.selectUserId = wl.id
|
||||
LEFT JOIN welfare_project wp ON wp.id = wus.welfareId
|
||||
$condition
|
||||
""");
|
||||
@@ -143,11 +145,12 @@ public class WelfareListController {
|
||||
|
||||
cnd.andEX("wl.sex", "in", pageParam.getSex());
|
||||
|
||||
cnd.andEX("wcn.courierNumber","=",courierNumber);
|
||||
cnd.andEX("wcn.courierNumber", "=", courierNumber);
|
||||
|
||||
cnd.groupBy("wl.id");
|
||||
cnd.asc("wl.unitCode");
|
||||
cnd.asc("wl.loginname");
|
||||
cnd.asc("wl.unitid");
|
||||
cnd.asc("wl.userSortNum");
|
||||
cnd.desc("wl.id");
|
||||
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin")) {
|
||||
cnd.and("wl.unionid", "=", Vi.getUnionId());
|
||||
@@ -242,9 +245,17 @@ public class WelfareListController {
|
||||
NutMap editData = Json.fromJson(NutMap.class, editWelfareData);
|
||||
List<NutMap> optionList = Json.fromJsonAsList(NutMap.class, welfareOptions);
|
||||
Dao dao = welfareListService.dao();
|
||||
WelfareUserSelection oldSelection = dao.fetch(WelfareUserSelection.class, Cnd.where("welfareId", "=", editData.getString("projectId"))
|
||||
.and("selectUserId", "=", editData.getString("userId")));
|
||||
String sign = "";
|
||||
if (ObjectUtil.isNotEmpty(oldSelection)) {
|
||||
sign = oldSelection.getUserSign();
|
||||
}
|
||||
|
||||
dao.clear(WelfareUserSelection.class,
|
||||
Cnd.where("welfareId", "=", editData.getString("projectId"))
|
||||
.and("selectUserId", "=", editData.getString("userId")));
|
||||
String finalSign = sign;
|
||||
List<WelfareUserSelection> userSelections = optionList.stream().map(v -> {
|
||||
WelfareUserSelection selection = new WelfareUserSelection();
|
||||
selection.setSelectTime(new Date());
|
||||
@@ -254,6 +265,7 @@ public class WelfareListController {
|
||||
selection.setReceiveAddress(editData.getString("receiveAddress"));
|
||||
selection.setSubjectId(v.getString("subjectId"));
|
||||
selection.setSelectNum(v.getInt("selectNum"));
|
||||
selection.setUserSign(finalSign);
|
||||
return selection;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
@@ -318,7 +330,7 @@ public class WelfareListController {
|
||||
""");
|
||||
cnd.and("wpus.welfareId", "=", projectId);
|
||||
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin,SchoolUnionWelfareAdmin")) {
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) {
|
||||
cnd.and("u.unionId", "=", Vi.getUnionId());
|
||||
}
|
||||
|
||||
@@ -484,7 +496,7 @@ public class WelfareListController {
|
||||
it.`name` unitname,
|
||||
wpus.selectNum
|
||||
FROM
|
||||
welfare_project_user_selection_copy wpus
|
||||
welfare_project_user_selection wpus
|
||||
LEFT JOIN `welfare_list` wl ON wpus.selectUserId = wl.userId
|
||||
LEFT JOIN `sys_user` u ON u.id = wl.userId
|
||||
LEFT JOIN sys_union un ON un.id = wl.welfareUnitId
|
||||
@@ -492,7 +504,7 @@ public class WelfareListController {
|
||||
WHERE
|
||||
wpus.welfareId = @welfareId
|
||||
AND wpus.selectOptionId = @selectOptionId and wpus.selectNum!=0
|
||||
|
||||
|
||||
""").setParam("welfareId", projectId).setParam("selectOptionId", optionId);
|
||||
|
||||
// GROUP BY wpus.selectUserId,wpus.selectOptionId ORDER BY un.unioncode
|
||||
@@ -557,8 +569,77 @@ public class WelfareListController {
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@Ok("void")
|
||||
@RequiresPermissions("welfare.list.mange")
|
||||
public void doExportReimbursement(@Param(value = "projectId", required = false) String projectId,
|
||||
@Param(value = "optionId", required = false) String optionId,
|
||||
@Param(value = "personType", required = false) String personType,
|
||||
HttpServletResponse response) {
|
||||
WelfareProject project = welfareListService.dao().fetch(WelfareProject.class, projectId);
|
||||
WelfareProjectSubjectOption subjectOption = welfareListService.dao().fetch(WelfareProjectSubjectOption.class, optionId);
|
||||
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
u.id,
|
||||
u.loginname,
|
||||
u.username,
|
||||
wl.personType,
|
||||
un.unionname,
|
||||
it.`name` unitname,
|
||||
wpus.selectNum,
|
||||
GROUP_CONCAT(wcn.courierNumber) as courierNumber
|
||||
FROM
|
||||
welfare_project_user_selection wpus
|
||||
LEFT JOIN `welfare_list` wl ON wpus.selectUserId = wl.userId
|
||||
LEFT JOIN `sys_user` u ON u.id = wl.userId
|
||||
LEFT JOIN sys_union un ON un.id = wl.welfareUnitId
|
||||
LEFT JOIN sys_unit it ON it.id = wl.welfareSecondLevelUnitId
|
||||
LEFT JOIN welfare_courier_number wcn ON wcn.welfareId = wpus.welfareId\s
|
||||
AND wcn.selectUserId = wpus.selectUserId
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.groupBy("wpus.id");
|
||||
cnd.and("wpus.welfareId", "=", projectId);
|
||||
cnd.and("wpus.selectOptionId", "=", optionId);
|
||||
cnd.and("wpus.selectNum", "!=", 0);
|
||||
if (Objects.equals("在职教职工", personType)) {
|
||||
cnd.and("wl.personType", "is not", null);
|
||||
cnd.and("wl.personType", "!=", "");
|
||||
cnd.and("wl.personType", "!=", "劳务人才派遣");
|
||||
cnd.and("wl.personType", "!=", "其他类");
|
||||
} else if (Objects.equals("劳务派遣人员", personType)) {
|
||||
cnd.and("wl.personType", "in", List.of("劳务人才派遣", "其他类"));
|
||||
} else if (Objects.equals("空状态", personType)) {
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
seg.or("wl.personType", "=", "");
|
||||
seg.orIsNull("wl.personType");
|
||||
cnd.and(seg);
|
||||
}
|
||||
sql.setCondition(cnd);
|
||||
List<NutMap> mapList = welfareListService.listMap(sql);
|
||||
|
||||
HashMap<String, Object> data = new HashMap<>();
|
||||
data.put("data", mapList);
|
||||
data.put("projectName", project.getName());
|
||||
data.put("optionName", subjectOption.getOptionName());
|
||||
data.put("personType", personType);
|
||||
|
||||
try {
|
||||
ViTool.excelResponse(response, subjectOption.getOptionName() + "(" + personType + ")" + "发放名单.xlsx");
|
||||
TemplateExportParams templateExportParams = new TemplateExportParams();
|
||||
//开启横向遍历
|
||||
templateExportParams.setColForEach(true);
|
||||
templateExportParams.setTemplateUrl("C:\\Users\\jug\\Desktop\\福利发放名单.xlsx");
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(templateExportParams, data);
|
||||
workbook.write(response.getOutputStream());
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+8
-11
@@ -96,18 +96,13 @@ public class WelfareMemberAdjustmentController {
|
||||
mcr_state.stateColor mcrStateColor
|
||||
FROM
|
||||
`user` u
|
||||
|
||||
LEFT JOIN user_history_latest his ON his.loginname = u.loginname
|
||||
|
||||
LEFT JOIN welfare_member_apply_record_latest wmar ON wmar.userId = u.id
|
||||
|
||||
LEFT JOIN member_change_record_latest mcr on mcr.userId = u.id
|
||||
|
||||
LEFT JOIN audit_state state ON wmar.stateId = state.stateId
|
||||
|
||||
LEFT JOIN audit_state mcr_state ON mcr_state.stateId = mcr.stateId
|
||||
$condition
|
||||
""")
|
||||
""")
|
||||
.setParam("recordMode", MemberChangeRecordMode.WELFARE_MEMBER.getCode())
|
||||
.setParam("changeUnitAuditing", MemberChangeApplyState.SCHOOL_UNION)
|
||||
.setParam("changeUnitError", MemberChangeApplyState.SCHOOL_UNION_FAIL);
|
||||
@@ -120,7 +115,7 @@ public class WelfareMemberAdjustmentController {
|
||||
cnd.andEX("u.unionGroupId", "=", pageParam.getUnionGroupId());
|
||||
|
||||
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin,SchoolUnionAdmin,SchoolUnionMemberAdmin,SchoolUnionWelfareAdmin")) {
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) {
|
||||
if (ShiroUtil.hasAnyRoles("H04,gh12")) {
|
||||
cnd.and("u.unionId", "=", Vi.getUnionId());
|
||||
} else if (ShiroUtil.hasRole("ghxzzz")) {
|
||||
@@ -163,8 +158,10 @@ public class WelfareMemberAdjustmentController {
|
||||
WelfareFeature.Condition.judgmentAuthority(cnd, "u");
|
||||
|
||||
cnd.and(pageForm);
|
||||
cnd.desc("u.threeUnitId");
|
||||
cnd.asc("u.loginname");
|
||||
cnd.desc("his.changeTime");
|
||||
cnd.asc("u.unitid");
|
||||
cnd.asc("COALESCE(u.userSortNum, 999999)");
|
||||
cnd.desc("u.id");
|
||||
|
||||
pageParam.participate(cnd, "u");
|
||||
|
||||
@@ -221,7 +218,7 @@ public class WelfareMemberAdjustmentController {
|
||||
}
|
||||
}
|
||||
cnd.andEX("u.unionGroupId", "=", pageParam.getUnionGroupId());
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin,SchoolUnionAdmin,SchoolUnionMemberAdmin,SchoolUnionWelfareAdmin")) {
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) {
|
||||
if (ShiroUtil.hasAnyRoles("H04,gh12")) {
|
||||
cnd.and("u.unionId", "=", Vi.getUnionId());
|
||||
} else if (ShiroUtil.hasRole("ghxzzz")) {
|
||||
@@ -307,7 +304,7 @@ public class WelfareMemberAdjustmentController {
|
||||
@ViReturn
|
||||
@RequiresPermissions("welfare.member.adjustment")
|
||||
public Object joinWelfareMember(String[] userIds) {
|
||||
if (ShiroUtil.hasAnyRoles("sysadmin,SchoolUnionAdmin,SchoolUnionMemberAdmin,SchoolUnionWelfareAdmin")) {
|
||||
if (ShiroUtil.hasAnyRoles("sysadmin,A06")) {
|
||||
WelfareMemberMode.joinWelfareMember(Arrays.stream(userIds).collect(Collectors.toList()));
|
||||
return null;
|
||||
}
|
||||
|
||||
+1
-1
@@ -75,7 +75,7 @@ public class WelfareMemberChangeApplyAuditController {
|
||||
wun.welfareUnitId realWelfareUnitId,
|
||||
wun.welfareUnitCode realWelfareUnitCode,
|
||||
wun.welfareUnitName realWelfareUnitName,
|
||||
u.mobile,
|
||||
u.mobile AS MMobile,
|
||||
state.stateName,
|
||||
state.stateColor,
|
||||
originUnit.unitcode originUnitCode,
|
||||
|
||||
@@ -95,7 +95,9 @@ public class WelfareMemberMangeController {
|
||||
}
|
||||
pageParam.participate(cnd);
|
||||
cnd.and(pageForm);
|
||||
cnd.asc("loginname");
|
||||
cnd.asc("unitid");
|
||||
cnd.asc("COALESCE(userSortNum, 999999)");
|
||||
cnd.desc("id");
|
||||
sql.setCondition(cnd);
|
||||
return welfareMemberService.list(pageForm, sql);
|
||||
}
|
||||
@@ -178,7 +180,7 @@ public class WelfareMemberMangeController {
|
||||
if (member != null && member) {
|
||||
cnd.and("u.member", "=", MemberMode.NORMAL.getCode());
|
||||
}
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin,SchoolUnionAdmin,SchoolUnionMemberAdmin,SchoolUnionWelfareAdmin")) {
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) {
|
||||
cnd.and("u.unionid", "=", Vi.getUnionId());
|
||||
}
|
||||
|
||||
@@ -257,7 +259,7 @@ public class WelfareMemberMangeController {
|
||||
List<WelfareMemberTemp> memberImportList = ExcelImportUtil.importExcel(file.getFile(), WelfareMemberTemp.class, new ImportParams());
|
||||
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin,SchoolUnionAdmin,SchoolUnionMemberAdmin,SchoolUnionWelfareAdmin")) {
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) {
|
||||
cnd.and("unionid", "=", Vi.getUnionId());
|
||||
}
|
||||
cnd.andEX("unionid", "=", unionId);
|
||||
@@ -339,7 +341,7 @@ public class WelfareMemberMangeController {
|
||||
public void exportList(HttpServletResponse response) {
|
||||
Sql sql = Sqls.create("SELECT loginname,username,sex,personType,userState,unionname,unitname,CASE member WHEN 1 THEN '是' ELSE '否' END as member from welfare_member $condition");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin,SchoolUnionWelfareAdmin")) {
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) {
|
||||
cnd.andEX("unionid", "=", Vi.getUnionId());
|
||||
}
|
||||
sql.setCondition(cnd);
|
||||
@@ -349,7 +351,7 @@ public class WelfareMemberMangeController {
|
||||
exportEntities.add(new ExcelExportEntity("工号","loginname",20));
|
||||
exportEntities.add(new ExcelExportEntity("姓名","username",20));
|
||||
exportEntities.add(new ExcelExportEntity("性别","sex",20));
|
||||
exportEntities.add(new ExcelExportEntity("人员类型","personType",20));
|
||||
exportEntities.add(new ExcelExportEntity("人员性质","personType",20));
|
||||
exportEntities.add(new ExcelExportEntity("在职状态","userState",20));
|
||||
exportEntities.add(new ExcelExportEntity("分工会","unionname",20));
|
||||
exportEntities.add(new ExcelExportEntity("单位","unitname",50));
|
||||
|
||||
@@ -86,7 +86,8 @@ public class WelfareMineController {
|
||||
sql.setParam("selectUserId", ShiroUtil.getUserId());
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("wp.isDisabled", "=", 0);
|
||||
cnd.andEX("YEAR(wp.choiceTimeStart)", "=", year);
|
||||
// cnd.andEX("YEAR(wp.choiceTimeStart)", "=", year);
|
||||
cnd.and("wp.id","in",Sqls.create("(select projectId from view_welfare_list where id = @userId)").setParam("userId",ShiroUtil.getUserId()));
|
||||
cnd.groupBy("wp.id");
|
||||
cnd.desc("wp.choiceTimeStart");
|
||||
sql.setCondition(cnd);
|
||||
|
||||
@@ -6,6 +6,7 @@ import io.v.nutz.base.dao.CndPlus;
|
||||
import io.v.nutz.base.query.PageForm;
|
||||
import io.v.nutz.base.utils.MsgApi;
|
||||
import io.v.nutz.base.utils.Vi;
|
||||
import io.v.nutz.sys.models.Sys_home_activity;
|
||||
import io.v.nutz.sys.services.SysTaskService;
|
||||
import io.v.nutz.task.services.TaskPlatformService;
|
||||
import io.v.nutz.zhgh.data.model.MatchConditionStructure;
|
||||
@@ -37,7 +38,6 @@ import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
import org.nutz.trans.Trans;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@@ -235,9 +235,11 @@ public class WelfareProjectMangeController {
|
||||
dao.update(project);
|
||||
|
||||
}
|
||||
if (project.getIsPushHome() != 0) {
|
||||
mobileHomeService.handle(project, "welfare", "/mobile/welfare/list/receive?projectId=" + project.getId(), project.getIsPushHome());
|
||||
}
|
||||
// if (project.getIsPushHome() != 0) {
|
||||
// mobileHomeService.handle(project, "welfare", "/mobile/welfare/list/receive?projectId=" + project.getId(), project.getIsPushHome());
|
||||
// }
|
||||
Sys_home_activity sysHomeActivity = project.covertToSysHomeActivity();
|
||||
dao.insertOrUpdate(sysHomeActivity);
|
||||
});
|
||||
return null;
|
||||
}
|
||||
@@ -290,8 +292,7 @@ public class WelfareProjectMangeController {
|
||||
public Object sendMsgToNotWelfareUsers(String projectId, String sendMsgValue) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
u.loginname,
|
||||
u.username
|
||||
u.loginname as userId
|
||||
FROM
|
||||
welfare_list wl
|
||||
left join sys_user u on u.id = wl.userId
|
||||
@@ -308,13 +309,7 @@ public class WelfareProjectMangeController {
|
||||
""");
|
||||
sql.setParam("projectId", projectId);
|
||||
List<NutMap> userList = listService.listMap(sql);
|
||||
|
||||
// for (NutMap map : userList) {
|
||||
// msgApi.sendMsg(sendMsgValue, "", "", "", "4", new ArrayList<>() {{
|
||||
// add(NutMap.NEW().addv("userId", map.getString("loginname")));
|
||||
// }});
|
||||
// }
|
||||
|
||||
// msgApi.sendMsg(sendMsgValue, "福利选择链接", "", "https://zhgh.jiangnan.edu.cn/mobile/welfare/list/receive?projectId=4fa233704ddb41bc8e34e966efeda0a4", "4", userList);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -55,22 +55,21 @@ public class WelfareUserChooseController {
|
||||
@ViReturn
|
||||
@RequiresPermissions("welfare.user.choose")
|
||||
public Object pageData(PageForm pageForm, Integer year) {
|
||||
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
wp.*,
|
||||
CASE
|
||||
WHEN wus.selectUserId IS NOT NULL THEN 1
|
||||
ELSE 0
|
||||
END AS isChoose,
|
||||
wus.selectTime,
|
||||
GROUP_CONCAT(DISTINCT wuso.optionName ,'(',wus.selectNum,'份)') AS gist_list,
|
||||
wus.receiveAddress
|
||||
wp.*,
|
||||
CASE
|
||||
WHEN wus.selectUserId IS NOT NULL THEN 1
|
||||
ELSE 0
|
||||
END AS isChoose,
|
||||
wus.selectTime,
|
||||
GROUP_CONCAT(DISTINCT wuso.optionName ,'(',wus.selectNum,'份)') AS gist_list,
|
||||
wus.receiveAddress
|
||||
FROM
|
||||
welfare_project wp
|
||||
LEFT JOIN welfare_project_user_selection wus ON wp.id = wus.welfareId AND wus.selectUserId = @selectUserId
|
||||
LEFT JOIN welfare_list wl ON wp.id = wl.projectId AND wl.userId = @selectUserId
|
||||
LEFT JOIN welfare_project_subject_option wuso ON wus.selectOptionId = wuso.id
|
||||
welfare_project wp
|
||||
LEFT JOIN welfare_project_user_selection wus ON wp.id = wus.welfareId AND wus.selectUserId = @selectUserId
|
||||
INNER JOIN welfare_list wl ON wp.id = wl.projectId AND wl.userId = @selectUserId
|
||||
LEFT JOIN welfare_project_subject_option wuso ON wus.selectOptionId = wuso.id
|
||||
$condition
|
||||
""");
|
||||
sql.setParam("selectUserId", ShiroUtil.getUserId());
|
||||
|
||||
+1
-1
@@ -201,7 +201,7 @@ public class WelfareCheckPersonalController {
|
||||
exportEntities.add(new ExcelExportEntity("姓名", "username", 20));
|
||||
exportEntities.add(new ExcelExportEntity("性别", "sex", 20));
|
||||
exportEntities.add(new ExcelExportEntity("联系电话", "mobile", 20));
|
||||
exportEntities.add(new ExcelExportEntity("人员类型", "personType", 20));
|
||||
exportEntities.add(new ExcelExportEntity("人员性质", "personType", 20));
|
||||
exportEntities.add(new ExcelExportEntity("所属工会", "unionname", 20));
|
||||
exportEntities.add(new ExcelExportEntity("所在单位", "unitname", 20));
|
||||
exportEntities.add(new ExcelExportEntity("核对情况", "isfinish", 20));
|
||||
|
||||
+13
-14
@@ -131,7 +131,7 @@ public class WelfareMemberCheckUnionController {
|
||||
/* if (!ShiroUtil.hasAnyRoles("sysadmin,A06,flwyh01")) {
|
||||
cnd.and("u.unionGroupId", "in", io.v.nutz.web.commons.utils.ShiroUtil.getUnionGroupIds());
|
||||
}*/
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin,SchoolUnionAdmin,SchoolUnionMemberAdmin,SchoolUnionWelfareAdmin")) {
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) {
|
||||
if (ShiroUtil.hasAnyRoles("H04,gh12")) {
|
||||
cnd.and("u.unionId", "=", Vi.getUnionId());
|
||||
} else if (ShiroUtil.hasRole("ghxzzz")) {
|
||||
@@ -166,9 +166,9 @@ public class WelfareMemberCheckUnionController {
|
||||
|
||||
cnd.and(pageForm);
|
||||
cnd.desc("his.changeTime");
|
||||
cnd.asc("u.userState");
|
||||
cnd.asc("u.unitid");
|
||||
cnd.asc("u.loginname");
|
||||
cnd.asc("COALESCE(u.userSortNum, 999999)");
|
||||
cnd.desc("u.id");
|
||||
|
||||
if (Lang.isNotEmpty(changeTypes)) {
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
@@ -227,9 +227,9 @@ public class WelfareMemberCheckUnionController {
|
||||
@ViReturn
|
||||
@RequiresPermissions("welfare.member.check.union")
|
||||
public Object doSubmitChangeUser(MemberChangeRecord memberChangeRecord) {
|
||||
if (Objects.equals(memberChangeRecord.getType(), UserChangeType.NEW.getCode())) {
|
||||
/*if (Objects.equals(memberChangeRecord.getType(), UserChangeType.NEW.getCode())) {
|
||||
return Result.error("您已经入职,可以选择恢复功能入会!");
|
||||
}
|
||||
}*/
|
||||
if (Objects.equals(memberChangeRecord.getType(), UserChangeType.UNIT_CHANGE.getCode())) {
|
||||
boolean unionGroupEnable = Optional.ofNullable(dao.fetch(Sys_config.class, Cnd.where("configKey", "=", "isThreeUnit"))).map(v -> v.getConfigValue()).orElse("false").equals("true");
|
||||
|
||||
@@ -239,21 +239,21 @@ public class WelfareMemberCheckUnionController {
|
||||
return Result.error("请选择不同的单位!");
|
||||
}
|
||||
}
|
||||
if (!Objects.equals(memberChangeRecord.getType(), UserChangeType.UNIT_CHANGE.getCode())) {
|
||||
/*if (!Objects.equals(memberChangeRecord.getType(), UserChangeType.UNIT_CHANGE.getCode())) {
|
||||
memberChangeRecord.setCurrentUnitId(null);
|
||||
memberChangeRecord.setCurrentUnionId(null);
|
||||
}
|
||||
}*/
|
||||
|
||||
Sql userSql = Sqls.fetchString("select userState from sys_user where id = @userId");
|
||||
userSql.setParam("userId", memberChangeRecord.getUserId());
|
||||
dao.execute(userSql);
|
||||
String userState = StrUtil.blankToDefault(userSql.getString(), "");
|
||||
|
||||
if (memberChangeRecord.getType() == UserChangeType.ON_DUTY.getCode()) {
|
||||
if (userState.equals(UserChangeType.ON_DUTY.getDescription())) {
|
||||
return Result.error("该用户当前的状态已经是" + UserChangeType.ON_DUTY.getDescription() + ",您无需变更!");
|
||||
}
|
||||
}
|
||||
// if (memberChangeRecord.getType() == UserChangeType.WORK.getCode()) {
|
||||
// if (userState.equals(UserChangeType.WORK.getDescription())) {
|
||||
// return Result.error("该用户当前的状态已经是" + UserChangeType.WORK.getDescription() + ",您无需变更!");
|
||||
// }
|
||||
// }
|
||||
if (memberChangeRecord.getType() == UserChangeType.RESIGN.getCode()) {
|
||||
if (userState.equals(UserChangeType.RESIGN.getDescription())) {
|
||||
return Result.error("该用户当前的状态已经是" + UserChangeType.RESIGN.getDescription() + ",您无需变更!");
|
||||
@@ -265,7 +265,6 @@ public class WelfareMemberCheckUnionController {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
memberChangeRecord.setRecordMode(MemberChangeRecordMode.WELFARE_MEMBER.getCode());
|
||||
memberChangeRecord.setApplyOrigin(MemberChangeOrigin.UNION.getCode());
|
||||
memberChangeRecord = MemberChangeAuditHandle.CREATE.next(memberChangeRecord, null);
|
||||
@@ -310,7 +309,7 @@ public class WelfareMemberCheckUnionController {
|
||||
public Object doWelfareMember(String[] userIds, String taskId,
|
||||
@Param(value = "threeUnitId", required = false) String threeUnitId,
|
||||
@Param(value = "unitId", required = false) String unitId) {
|
||||
if (ShiroUtil.hasAnyRoles("sysadmin,SchoolUnionAdmin,SchoolUnionMemberAdmin,SchoolUnionWelfareAdmin")) {
|
||||
if (ShiroUtil.hasAnyRoles("sysadmin,A06")) {
|
||||
WelfareMemberMode.joinWelfareMember(Arrays.stream(userIds).collect(Collectors.toList()));
|
||||
return null;
|
||||
}
|
||||
|
||||
+143
-43
@@ -3,23 +3,22 @@ package io.v.nutz.zhgh.welfare.controller.statistics;
|
||||
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.TemplateExportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
||||
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
|
||||
import cn.afterturn.easypoi.excel.export.ExcelExportService;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.utils.MsgApi;
|
||||
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.SysUnionGroup;
|
||||
import io.v.nutz.sys.models.Sys_union;
|
||||
import io.v.nutz.sys.models.Sys_unit;
|
||||
import io.v.nutz.web.commons.base.Globals;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.zhgh.welfare.mode.WelfareUnitMode;
|
||||
import io.v.nutz.zhgh.welfare.model.WelfareList;
|
||||
import io.v.nutz.zhgh.welfare.model.WelfareProject;
|
||||
import io.v.nutz.zhgh.welfare.model.WelfareUserSelection;
|
||||
import io.v.nutz.zhgh.welfare.model.*;
|
||||
import io.v.nutz.zhgh.welfare.service.WelfareSingleService;
|
||||
import lombok.Data;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -32,11 +31,11 @@ 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.json.Json;
|
||||
import org.nutz.lang.Lang;
|
||||
import org.nutz.lang.Strings;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
@@ -48,10 +47,7 @@ import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.BufferedOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.zip.ZipEntry;
|
||||
import java.util.zip.ZipOutputStream;
|
||||
@@ -74,6 +70,8 @@ public class WelfareSingleController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private OfficeTemplateUtil officeTemplateUtil;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/welfare/statistics/single.html")
|
||||
@@ -94,8 +92,10 @@ public class WelfareSingleController {
|
||||
public Object pageData(@Param(value = "projectId", required = false) String projectId,
|
||||
@Param(value = "month", required = false) String month,
|
||||
@Param(value = "welfareUnitCode", required = false) String welfareUnitCode,
|
||||
@Param(value = "unionGroupId", required = false) String unionGroupId) {
|
||||
return welfareSingleService.pageData(projectId, month, welfareUnitCode, unionGroupId);
|
||||
@Param(value = "unionGroupId", required = false) String unionGroupId,
|
||||
@Param(value = "personType", required = false) String personType
|
||||
) {
|
||||
return welfareSingleService.pageData(projectId, month, welfareUnitCode, unionGroupId, personType);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -209,49 +209,149 @@ public class WelfareSingleController {
|
||||
@Param(value = "month", required = false) String month,
|
||||
@Param(value = "unionGroupId", required = false) String unionGroupId,
|
||||
@Param(value = "isThreeUnit", required = false) Boolean isThreeUnit,
|
||||
@Param(value = "personType", required = false) String personType,
|
||||
HttpServletResponse response) {
|
||||
String title = "统计名单";
|
||||
if (StrUtil.isNotBlank(welfareUnitCode)) {
|
||||
switch (WelfareUnitMode.getMode().name()) {
|
||||
case "UNION" -> {
|
||||
Sys_union sysUnion = dao.fetch(Sys_union.class, Cnd.where("unioncode", "=", welfareUnitCode));
|
||||
title = (Lang.isNotEmpty(sysUnion) ? sysUnion.getUnionname() : "") + "统计名单";
|
||||
}
|
||||
case "UNIT" -> {
|
||||
Sys_unit sysUnit = dao.fetch(Sys_unit.class, Cnd.where("unitcode", "=", welfareUnitCode));
|
||||
title = (Lang.isNotEmpty(sysUnit) ? sysUnit.getName() : "") + "统计名单";
|
||||
}
|
||||
}
|
||||
WelfareProject project = dao.fetch(WelfareProject.class, projectId);
|
||||
WelfareProjectSubject subject = dao.fetch(WelfareProjectSubject.class, Cnd.where("projectId", "=", projectId));
|
||||
List<WelfareProjectSubjectOption> subjectOptions = dao.query(WelfareProjectSubjectOption.class, Cnd.where("subjectId", "=", subject.getId()).asc("optionSort"));
|
||||
|
||||
List<WelfareList> welfareLists = dao.query(WelfareList.class, Cnd.where("projectId", "=", projectId));
|
||||
|
||||
HashMap<String, Object> data = new HashMap<>();
|
||||
data.put("projectName", project.getName());
|
||||
data.put("personType", personType);
|
||||
|
||||
List<NutMap> titles = subjectOptions.stream().map(o -> {
|
||||
NutMap nutMap = NutMap.NEW();
|
||||
nutMap.put("optionName", o.getOptionName());
|
||||
nutMap.put("val", "t." + o.getOptionName());
|
||||
return nutMap;
|
||||
}).collect(Collectors.toList());
|
||||
data.put("titles", titles);
|
||||
|
||||
List<HashMap<String, Object>> datas = new ArrayList<>();
|
||||
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
t1.selectOptionId,
|
||||
t1.selectNum,
|
||||
t2.welfareUnitId,
|
||||
t3.unionname,
|
||||
t2.personType
|
||||
FROM
|
||||
`welfare_project_user_selection` t1
|
||||
LEFT JOIN welfare_list t2 ON t2.userId = t1.selectUserId
|
||||
AND t2.projectId = t1.welfareId
|
||||
LEFT JOIN sys_union t3 ON t3.id = t2.welfareUnitId
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("t1.welfareId", "=", projectId);
|
||||
cnd.groupBy("t1.id");
|
||||
if (Objects.equals("在职教职工", personType)) {
|
||||
cnd.and("t2.personType", "is not", null);
|
||||
cnd.and("t2.personType", "!=", "");
|
||||
cnd.and("t2.personType", "!=", "劳务人才派遣");
|
||||
cnd.and("t2.personType", "!=", "其他类");
|
||||
} else if (Objects.equals("劳务派遣人员", personType)) {
|
||||
cnd.and("t2.personType", "in", List.of("劳务人才派遣", "其他类"));
|
||||
} else if (Objects.equals("空状态", personType)) {
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
seg.or("t2.personType", "=", "");
|
||||
seg.orIsNull("t2.personType");
|
||||
cnd.and(seg);
|
||||
}
|
||||
sql.setCondition(cnd);
|
||||
List<NutMap> list = welfareSingleService.listMap(sql);
|
||||
|
||||
NutMap dataMap = welfareSingleService.pageData(projectId, month, welfareUnitCode, unionGroupId);
|
||||
List<ExcelExportEntity> entityList = new ArrayList<>();
|
||||
List<NutMap> labelList = dataMap.getAsList("tableColumn", NutMap.class);
|
||||
List<NutMap> list = dataMap.getAsList("tableList", NutMap.class);
|
||||
Map<String, List<NutMap>> welfareUnitGroups = list.stream().collect(Collectors.groupingBy(v -> v.getString("unionname")));
|
||||
|
||||
NutMap map = NutMap.NEW().setv("welfareUnitName", "合计");
|
||||
labelList.forEach(o -> {
|
||||
List<Integer> numList = list.stream().map(v -> v.getInt(o.getString("prop"))).collect(Collectors.toList());
|
||||
int sum = numList.stream().mapToInt(Integer::intValue).sum();
|
||||
map.setv(o.getString("prop"), sum);
|
||||
});
|
||||
list.add(map);
|
||||
welfareUnitGroups.forEach((welfareUnitName, welfareUnitList) -> {
|
||||
NutMap welfareUnitMap = NutMap.NEW();
|
||||
welfareUnitMap.addv("name", welfareUnitName);
|
||||
for (int i = 0; i < subjectOptions.size(); i++) {
|
||||
int finalI = i;
|
||||
int sum = welfareUnitList.stream().filter(v -> v.getString("selectOptionId").equals(subjectOptions.get(finalI).getId())).mapToInt(x -> x.getInt("selectNum")).sum();
|
||||
welfareUnitMap.put(subjectOptions.get(finalI).getOptionName(), sum);
|
||||
}
|
||||
welfareUnitMap.addv("total", welfareUnitList.stream().mapToInt(x -> x.getInt("selectNum")).sum());
|
||||
|
||||
labelList.add(0, NutMap.NEW().addv("label", "福利单位").addv("prop", "welfareUnitName"));
|
||||
labelList.add(1, NutMap.NEW().addv("label", "福利单位编码").addv("prop", "welfareUnitCode"));
|
||||
labelList.forEach(v -> {
|
||||
entityList.add(new ExcelExportEntity(v.getString("label"), v.getString("prop"), 20));
|
||||
String welfareUnitId = welfareUnitList.stream().findFirst().map(v -> v.getString("welfareUnitId")).orElse(null);
|
||||
|
||||
long welfareMemberCount = 0;
|
||||
|
||||
if (Objects.equals("在职人员", personType)) {
|
||||
welfareMemberCount = welfareLists.stream().filter(v -> Objects.equals(v.getWelfareUnitId(), welfareUnitId)
|
||||
&& !Objects.equals(v.getPersonType(), "劳务人才派遣") && !Objects.equals(v.getPersonType(), "其他类")).count();
|
||||
} else if (Objects.equals("劳务派遣人员", personType)) {
|
||||
welfareMemberCount = welfareLists.stream().filter(v -> Objects.equals(v.getWelfareUnitId(), welfareUnitId)
|
||||
&& (Objects.equals(v.getPersonType(), "劳务人才派遣") || Objects.equals(v.getPersonType(), "其他类"))).count();
|
||||
} else if (Objects.equals("空状态", personType)) {
|
||||
welfareMemberCount = welfareLists.stream().filter(v -> Objects.equals(v.getWelfareUnitId(), welfareUnitId)
|
||||
&& StrUtil.isBlank(v.getPersonType())).count();
|
||||
}
|
||||
// long welfareMemberCount = welfareLists.stream().filter(v -> Objects.equals(v.getWelfareUnitId(), welfareUnitId)).count();
|
||||
welfareUnitMap.addv("welfareMemberCount", welfareMemberCount);
|
||||
datas.add(welfareUnitMap);
|
||||
});
|
||||
data.put("data", datas);
|
||||
|
||||
|
||||
try {
|
||||
ViTool.excelResponse(response, "汇总表.xls");
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(title, ""), entityList, list);
|
||||
ViTool.excelResponse(response, personType + "发放清单.xlsx");
|
||||
TemplateExportParams templateExportParams = new TemplateExportParams();
|
||||
//开启横向遍历
|
||||
templateExportParams.setColForEach(true);
|
||||
templateExportParams.setTemplateUrl("E:\\env\\福利导出模板.xlsx");
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(templateExportParams, data);
|
||||
workbook.write(response.getOutputStream());
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
// String title = "统计名单";
|
||||
// if (StrUtil.isNotBlank(welfareUnitCode)) {
|
||||
// switch (WelfareUnitMode.getMode().name()) {
|
||||
// case "UNION" -> {
|
||||
// Sys_union sysUnion = dao.fetch(Sys_union.class, Cnd.where("unioncode", "=", welfareUnitCode));
|
||||
// title = (Lang.isNotEmpty(sysUnion) ? sysUnion.getUnionname() : "") + "统计名单";
|
||||
// }
|
||||
// case "UNIT" -> {
|
||||
// Sys_unit sysUnit = dao.fetch(Sys_unit.class, Cnd.where("unitcode", "=", welfareUnitCode));
|
||||
// title = (Lang.isNotEmpty(sysUnit) ? sysUnit.getName() : "") + "统计名单";
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// }
|
||||
|
||||
// NutMap dataMap = welfareSingleService.pageData(projectId, month, welfareUnitCode, unionGroupId,personType);
|
||||
// List<ExcelExportEntity> entityList = new ArrayList<>();
|
||||
// List<NutMap> labelList = dataMap.getAsList("tableColumn", NutMap.class);
|
||||
// List<NutMap> list = dataMap.getAsList("tableList", NutMap.class);
|
||||
|
||||
// NutMap map = NutMap.NEW().setv("welfareUnitName", "合计");
|
||||
// labelList.forEach(o -> {
|
||||
// List<Integer> numList = list.stream().map(v -> v.getInt(o.getString("prop"))).collect(Collectors.toList());
|
||||
// int sum = numList.stream().mapToInt(Integer::intValue).sum();
|
||||
// map.setv(o.getString("prop"), sum);
|
||||
// });
|
||||
// list.add(map);
|
||||
//
|
||||
// labelList.add(0, NutMap.NEW().addv("label", "福利单位").addv("prop", "welfareUnitName"));
|
||||
// labelList.add(1, NutMap.NEW().addv("label", "福利单位编码").addv("prop", "welfareUnitCode"));
|
||||
// labelList.forEach(v -> {
|
||||
// entityList.add(new ExcelExportEntity(v.getString("label"), v.getString("prop"), 20));
|
||||
// });
|
||||
//
|
||||
//
|
||||
// try {
|
||||
// ViTool.excelResponse(response, "汇总表.xls");
|
||||
// Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(title, ""), entityList, list);
|
||||
// workbook.write(response.getOutputStream());
|
||||
// } catch (IOException e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
@@ -698,10 +798,10 @@ public class WelfareSingleController {
|
||||
wpus.selectNum,
|
||||
wpso.optionName
|
||||
FROM
|
||||
welfare_project_user_selection_copy wpus
|
||||
welfare_project_user_selection wpus
|
||||
left join sys_user u on u.id = wpus.selectUserId
|
||||
left join welfare_project_subject_option wpso on wpso.id = wpus.selectOptionId
|
||||
left join welfare_list wl on wl.userId = wpus.selectUserId
|
||||
left join welfare_list wl on wl.userId = wpus.selectUserId AND wpus.welfareId = wl.projectId
|
||||
left join sys_union gh on gh.id = wl.welfareUnitId
|
||||
left join sys_unit dw on dw.id = wl.welfareSecondLevelUnitId
|
||||
$condition
|
||||
@@ -724,7 +824,7 @@ public class WelfareSingleController {
|
||||
exportEntities.add(new ExcelExportEntity("姓名", "username", 20));
|
||||
exportEntities.add(new ExcelExportEntity("电话号码", "mobile", 20));
|
||||
exportEntities.add(new ExcelExportEntity("在职状态", "userState", 20));
|
||||
exportEntities.add(new ExcelExportEntity("人员类型", "personType", 20));
|
||||
exportEntities.add(new ExcelExportEntity("人员性质", "personType", 20));
|
||||
exportEntities.add(new ExcelExportEntity("所在分工会", "unionname", 30));
|
||||
exportEntities.add(new ExcelExportEntity("所在单位", "unitname", 50));
|
||||
exportEntities.add(new ExcelExportEntity("选择份数", "selectNum", 20));
|
||||
|
||||
@@ -29,7 +29,7 @@ public interface WelfareFeature {
|
||||
* @return
|
||||
*/
|
||||
static boolean judgmentAuthority() {
|
||||
return ShiroUtil.hasAnyRoles("sysadmin,SchoolUnionWelfareAdmin,SchoolUnionAdmin,SchoolUnionMemberAdmin");
|
||||
return ShiroUtil.hasAnyRoles("sysadmin,A06");
|
||||
}
|
||||
|
||||
interface Condition {
|
||||
|
||||
@@ -58,7 +58,7 @@ public class WelfareList {
|
||||
private Boolean isAutoSelect;
|
||||
|
||||
@Column
|
||||
@Comment("人员类型")
|
||||
@Comment("人员性质")
|
||||
@ColDefine(type = ColType.VARCHAR)
|
||||
private String personType;
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package io.v.nutz.zhgh.welfare.model;
|
||||
|
||||
import io.v.nutz.base.model.ViBaseModel;
|
||||
import io.v.nutz.sys.models.Sys_home_activity;
|
||||
import io.v.nutz.sys.services.SysHomeConvert;
|
||||
import io.v.nutz.zhgh.data.model.MatchConditionStructure;
|
||||
import io.v.nutz.zhgh.welfare.mode.WelfareNoticePushMode;
|
||||
import io.v.nutz.zhgh.welfare.mode.WelfareProvideMode;
|
||||
@@ -11,6 +13,7 @@ import lombok.experimental.Accessors;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
import org.nutz.dao.interceptor.annotation.PrevInsert;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@@ -26,7 +29,10 @@ import java.util.List;
|
||||
@Accessors(chain = true)
|
||||
@Table("welfare_project")
|
||||
@Comment("福利项目")
|
||||
public class WelfareProject extends ViBaseModel {
|
||||
public class WelfareProject extends ViBaseModel implements Serializable, SysHomeConvert {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Column
|
||||
@Name
|
||||
@Comment("ID")
|
||||
@@ -215,4 +221,20 @@ public class WelfareProject extends ViBaseModel {
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
private Boolean isDisabled;
|
||||
|
||||
|
||||
@Override
|
||||
public Sys_home_activity covertToSysHomeActivity() {
|
||||
Sys_home_activity sysHomeActivity = new Sys_home_activity();
|
||||
sysHomeActivity.setId(this.getId());
|
||||
sysHomeActivity.setName(this.getName());
|
||||
sysHomeActivity.setCover(this.getCover());
|
||||
sysHomeActivity.setUrl("/platform/welfare/userChoose");
|
||||
sysHomeActivity.setH5Url("/mobile/welfare/list/receive?projectId=" + this.getId());
|
||||
sysHomeActivity.setStartDate(this.getChoiceTimeStart());
|
||||
sysHomeActivity.setEndDate(this.getChoiceTimeEnd());
|
||||
sysHomeActivity.setAllowUserSql("select userId from welfare_list where projectId = '"+this.getId()+"' and userId = @userId");
|
||||
sysHomeActivity.setEnable(true);
|
||||
sysHomeActivity.setClassPath(this.getClass().getPackageName() + this.getClass().getName());
|
||||
return sysHomeActivity;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ public interface WelfareSingleService extends ViService<WelfareProject> {
|
||||
* @param projectId 福利id
|
||||
* @return
|
||||
*/
|
||||
NutMap pageData(String projectId, String month, String welfareUnitCode, String unionGroupId);
|
||||
NutMap pageData(String projectId, String month, String welfareUnitCode, String unionGroupId,String personType);
|
||||
|
||||
|
||||
NutMap exportByUnit(String projectId, String welfareUnitCode);
|
||||
|
||||
@@ -149,6 +149,8 @@ public class WelfareListServiceImpl extends ViServiceImpl<WelfareList> implement
|
||||
list.setUserId(user.getString("id"));
|
||||
list.setWelfareUnitId(user.getString(field));
|
||||
list.setWelfareSecondLevelUnitId(user.getString("unitid"));
|
||||
list.setUserState(user.getString("userState"));
|
||||
list.setPersonType(user.getString("personType"));
|
||||
lists.add(list);
|
||||
}
|
||||
dao().insert(lists);
|
||||
|
||||
@@ -119,7 +119,7 @@ public class WelfareSingleServiceImpl extends ViServiceImpl<WelfareProject> impl
|
||||
sys_union un
|
||||
$condition
|
||||
""");
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin,SchoolUnionAdmin,SchoolUnionMemberAdmin,SchoolUnionWelfareAdmin")) {
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) {
|
||||
if (ShiroUtil.hasAnyRoles("H04,gh12")) {
|
||||
cnd.and("un.id", "=", Vi.getUnionId());
|
||||
}
|
||||
@@ -184,10 +184,11 @@ public class WelfareSingleServiceImpl extends ViServiceImpl<WelfareProject> impl
|
||||
wpus.selectUserId,
|
||||
wl.welfareUnitId as unionId
|
||||
FROM
|
||||
`welfare_project_user_selection_copy` wpus
|
||||
LEFT JOIN welfare_list wl on wl.userId = wpus.selectUserId
|
||||
`welfare_project_user_selection` wpus
|
||||
LEFT JOIN welfare_list wl on wl.userId = wpus.selectUserId AND wpus.welfareId = wl.projectId
|
||||
$condition
|
||||
""");
|
||||
cnd.groupBy("wpus.id");
|
||||
sql.setCondition(cnd);
|
||||
return listMap(sql);
|
||||
}
|
||||
@@ -199,7 +200,7 @@ public class WelfareSingleServiceImpl extends ViServiceImpl<WelfareProject> impl
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public NutMap pageData(String projectId, String month, String welfareUnitCode, String unionGroupId) {
|
||||
public NutMap pageData(String projectId, String month, String welfareUnitCode, String unionGroupId, String personType) {
|
||||
boolean isThreeUnit = Globals.MyConfig.getBoolean("isThreeUnit");
|
||||
Sql welfareUnitSql = Sqls.create("""
|
||||
SELECT
|
||||
@@ -210,8 +211,8 @@ public class WelfareSingleServiceImpl extends ViServiceImpl<WelfareProject> impl
|
||||
""");
|
||||
CndPlus cnd = CndPlus.create();
|
||||
|
||||
if(!ShiroUtil.hasAnyRoles("sysadmin,SchoolUnionAdmin,SchoolUnionWelfareAdmin")){
|
||||
cnd.and("unit.welfareUnitId","=",Vi.getUnionId());
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin,A06,SchoolUnionWelfareAdmin")) {
|
||||
cnd.and("unit.welfareUnitId", "=", Vi.getUnionId());
|
||||
}
|
||||
|
||||
|
||||
@@ -476,7 +477,7 @@ public class WelfareSingleServiceImpl extends ViServiceImpl<WelfareProject> impl
|
||||
welfare_project_user_selection wpus
|
||||
LEFT JOIN `user` u ON u.id = wpus.selectUserId
|
||||
LEFT JOIN welfare_project_subject_option wpso ON wpso.id = wpus.selectOptionId
|
||||
LEFT JOIN view_welfare_list vwl on vwl.id = wpus.selectUserId
|
||||
LEFT JOIN view_welfare_list vwl on vwl.id = wpus.selectUserId AND wpus.welfareId=vwl.projectId
|
||||
$condition
|
||||
$monthCnd
|
||||
""").setParam("welfareId", projectId);
|
||||
@@ -530,14 +531,6 @@ public class WelfareSingleServiceImpl extends ViServiceImpl<WelfareProject> impl
|
||||
* 未领取人员信息
|
||||
*
|
||||
* @param projectId
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* @param welfareUnitCode
|
||||
* @return
|
||||
*/
|
||||
@@ -658,27 +651,51 @@ public class WelfareSingleServiceImpl extends ViServiceImpl<WelfareProject> impl
|
||||
optionSql.setParam("projectId", projectId);
|
||||
List<NutMap> options = (List<NutMap>) Daos.query(dao(), optionSql.toString(), Sqls.callback.maps());
|
||||
|
||||
// Sql sql = Sqls.create("""
|
||||
// SELECT
|
||||
// vwl.loginname,
|
||||
// vwl.username,
|
||||
// vwl.unionid,
|
||||
// vwl.unionname,
|
||||
// wpus.userSign,
|
||||
// wpus.selectOptionId,
|
||||
// wpus.selectNum
|
||||
// FROM
|
||||
// view_welfare_list vwl
|
||||
// LEFT JOIN welfare_project_user_selection wpus ON wpus.selectUserId = vwl.id
|
||||
// AND wpus.welfareId = @projectId
|
||||
// WHERE
|
||||
// projectId = @projectId
|
||||
// AND vwl.unionid = @unionId
|
||||
// """);
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
vwl.loginname,
|
||||
vwl.username,
|
||||
vwl.unionid,
|
||||
vwl.unionname,
|
||||
u.loginname,
|
||||
u.username,
|
||||
vwl.welfareUnitId as unionid,
|
||||
gh.unionname as unionname,
|
||||
vwl.welfareSecondLevelUnitId as unitid,
|
||||
dw.`name` as unitname,
|
||||
wpus.userSign,
|
||||
wpus.selectOptionId,
|
||||
wpus.selectNum
|
||||
wpus.selectNum\s
|
||||
FROM
|
||||
view_welfare_list vwl
|
||||
LEFT JOIN welfare_project_user_selection wpus ON wpus.selectUserId = vwl.id
|
||||
AND wpus.welfareId = @projectId
|
||||
welfare_list vwl
|
||||
LEFT join sys_user u on u.id = vwl.userId
|
||||
left join sys_union gh on gh.id = vwl.welfareUnitId
|
||||
left join sys_unit dw on dw.id = vwl.welfareSecondLevelUnitId
|
||||
LEFT JOIN welfare_project_user_selection wpus ON wpus.selectUserId = vwl.userId\s
|
||||
AND wpus.welfareId = @projectId\s
|
||||
WHERE
|
||||
projectId = @projectId
|
||||
AND vwl.unionid = @unionId
|
||||
AND vwl.welfareUnitId = @unionId
|
||||
order by vwl.welfareUnitId,vwl.welfareSecondLevelUnitId
|
||||
""");
|
||||
|
||||
sql.setParam("projectId", projectId);
|
||||
sql.setParam("unionId", welfareUnitId);
|
||||
List<NutMap> list = listMap(sql);
|
||||
list.forEach(l->{
|
||||
list.forEach(l -> {
|
||||
if (StrUtil.isNotBlank(l.getString("userSign"))) {
|
||||
try {
|
||||
ByteArrayOutputStream signOs = new ByteArrayOutputStream();
|
||||
@@ -698,6 +715,10 @@ public class WelfareSingleServiceImpl extends ViServiceImpl<WelfareProject> impl
|
||||
List<ExcelExportEntity> exportEntities = new ArrayList<>();
|
||||
exportEntities.add(new ExcelExportEntity("序号", "no", 20));
|
||||
exportEntities.add(new ExcelExportEntity("姓名", "username", 20));
|
||||
exportEntities.add(new ExcelExportEntity("工号", "loginname", 20));
|
||||
exportEntities.add(new ExcelExportEntity("所在分工会", "unionname", 20));
|
||||
exportEntities.add(new ExcelExportEntity("所在单位", "unitname", 20));
|
||||
|
||||
for (NutMap option : options) {
|
||||
exportEntities.add(new ExcelExportEntity(option.getString("optionName"), option.getString("id"), 20));
|
||||
}
|
||||
@@ -715,6 +736,10 @@ public class WelfareSingleServiceImpl extends ViServiceImpl<WelfareProject> impl
|
||||
NutMap data = NutMap.NEW();
|
||||
NutMap userMap = list.stream().filter(x -> x.getString("loginname").equals(v)).findFirst().get();
|
||||
data.put("username", userMap.getString("username"));
|
||||
data.put("loginname", userMap.getString("loginname"));
|
||||
data.put("unitname", userMap.getString("unitname"));
|
||||
data.put("unionname", userMap.getString("unionname"));
|
||||
|
||||
data.put("qzBytes", userMap.get("qzBytes"));
|
||||
for (NutMap option : options) {
|
||||
if (StrUtil.isNotBlank(userMap.getString("selectOptionId"))) {
|
||||
|
||||
Reference in New Issue
Block a user