会员
This commit is contained in:
@@ -5,35 +5,47 @@ import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||
import cn.afterturn.easypoi.excel.entity.ImportParams;
|
||||
import cn.hutool.core.date.DateUnit;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import io.v.nutz.base.service.BaseService;
|
||||
import io.v.nutz.base.utils.MsgApi;
|
||||
import io.v.nutz.base.utils.Roles;
|
||||
import io.v.nutz.sys.models.Sys_unit;
|
||||
import io.v.nutz.sys.models.Sys_user;
|
||||
import io.v.nutz.sys.models.Sys_user_role;
|
||||
import io.v.nutz.sys.services.SysLocalProcessService;
|
||||
import io.v.nutz.web.commons.base.Globals;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.zhgh.activity.models.ActivityUserScope;
|
||||
import io.v.nutz.zhgh.data.model.UserSource;
|
||||
import io.v.nutz.zhgh.fitnessWalk.model.FitnessWalkActivity;
|
||||
import io.v.nutz.zhgh.fitnessWalk.model.FitnessWalkAwardUser;
|
||||
import io.v.nutz.zhgh.fitnessWalk.model.FitnessWalkStep;
|
||||
import io.v.nutz.zhgh.fitnessWalk.service.FitnessWalkCommonService;
|
||||
import io.v.nutz.zhgh.medicalMutualAidFund.model.MedicalMutualAidFund;
|
||||
import io.v.nutz.zhgh.staffmanage.sourcechange.model.SourceChangeConfig;
|
||||
import io.v.nutz.zhgh.welfare.model.WelfareCourierNumber;
|
||||
import io.v.nutz.zhgh.proposal.constants.ProposalToDoHandler;
|
||||
import io.v.nutz.zhgh.proposal.models.ProposalReply;
|
||||
import io.v.nutz.zhgh.proposal.services.ProposalCommonService;
|
||||
import io.v.nutz.zhgh.welfare.model.WelfareList;
|
||||
import io.v.nutz.zhgh.welfare.model.WelfareUserSelection;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.apache.shiro.crypto.hash.Sha256Hash;
|
||||
import org.apache.shiro.util.ByteSource;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.boot.NbApp;
|
||||
import org.nutz.boot.starter.logback.exts.loglevel.LoglevelProperty;
|
||||
import org.nutz.boot.test.junit4.NbJUnit4Runner;
|
||||
import org.nutz.dao.Chain;
|
||||
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.integration.jedis.RedisService;
|
||||
import org.nutz.ioc.aop.Aop;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
@@ -42,14 +54,19 @@ import org.nutz.lang.Lang;
|
||||
import org.nutz.lang.random.R;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.*;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@IocBean
|
||||
@@ -481,29 +498,141 @@ public class JugTest {
|
||||
|
||||
@Test
|
||||
public void testThreeUnitId(){
|
||||
List<Sys_unit> list = dao.query(Sys_unit.class, Cnd.where("unionid", "=", "4c1e4f43474f4861a3abcd9ed517d692"));
|
||||
List<Sys_unit> insertList = list.stream().map(v -> {
|
||||
Sys_unit unit = new Sys_unit();
|
||||
unit.setId(v.getId() + "SJDW");
|
||||
unit.setParentId(v.getId());
|
||||
unit.setName(v.getName());
|
||||
unit.setUnitcode(v.getId() + "SJDW");
|
||||
unit.setUnitlevel(3);
|
||||
return unit;
|
||||
}).toList();
|
||||
dao.insert(insertList);
|
||||
|
||||
String content = "叮~2025端午慰问满意度调查邀您参与";
|
||||
String link = Globals.AppDomain + "/platform/h5/welfare/evaluate?id=%s&type=welfare".formatted("dbdc7ccf818d4318ae2094e62feb594d");
|
||||
// msgApi.sendMsg(List.of("DingTalk"), List.of("2020000035", "2020000098"), 2, "满意度调查", content, "", link);
|
||||
|
||||
|
||||
//// String inputFilePath = "F:\\mini-2025-07-08-5368.log";
|
||||
//// String outputFilePath = "F:\\extracted_inserts.log";
|
||||
//
|
||||
// String inputFilePath = "F:\\extracted_inserts.log";
|
||||
// String outputFilePath = "F:\\formatted_inserts.sql";
|
||||
//
|
||||
// try {
|
||||
// extractInsertStatements(inputFilePath, outputFilePath);
|
||||
// System.out.println("提取完成,结果已保存到: " + outputFilePath);
|
||||
// } catch (IOException e) {
|
||||
// System.err.println("处理文件时出错: " + e.getMessage());
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
public static void extractInsertStatements(String inputPath, String outputPath) throws IOException {
|
||||
|
||||
try (BufferedReader reader = new BufferedReader(
|
||||
new InputStreamReader(
|
||||
new FileInputStream(inputPath), StandardCharsets.UTF_8));
|
||||
BufferedWriter writer = new BufferedWriter(
|
||||
new OutputStreamWriter(
|
||||
new FileOutputStream(outputPath), StandardCharsets.UTF_8))) {
|
||||
|
||||
String line;
|
||||
while ((line = reader.readLine()) != null) {
|
||||
// 跳过空行
|
||||
if (line.trim().isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// 去除开头和结尾的引号
|
||||
String formattedLine = line.replaceAll("^\"|\"$", "");
|
||||
|
||||
// 在行尾添加分号(如果还没有)
|
||||
if (!formattedLine.trim().endsWith(";")) {
|
||||
formattedLine += ";";
|
||||
}
|
||||
|
||||
writer.write(formattedLine);
|
||||
writer.newLine();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void processContent(StringBuilder content, Pattern pattern, BufferedWriter writer) throws IOException {
|
||||
Matcher matcher = pattern.matcher(content.toString());
|
||||
while (matcher.find()) {
|
||||
String insertStatement = matcher.group();
|
||||
writer.write(insertStatement);
|
||||
writer.newLine();
|
||||
writer.newLine(); // 每个INSERT语句之间空一行
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@Inject
|
||||
private MsgApi msgApi;
|
||||
@Inject
|
||||
private SysLocalProcessService localProcessService;
|
||||
@Inject
|
||||
private ProposalCommonService proposalCommonService;
|
||||
|
||||
@Test
|
||||
public void t10(){
|
||||
SourceChangeConfig config = dao.fetch(SourceChangeConfig.class, Cnd.NEW());
|
||||
List<SourceChangeConfig.MemberSift> memberSiftList = config.getMemberSiftList();
|
||||
for (SourceChangeConfig.MemberSift sift : memberSiftList) {
|
||||
Object siftValue = sift.getSiftValue();
|
||||
System.out.println(siftValue);
|
||||
List<String> list = (List<String>) siftValue;
|
||||
System.out.println(list);
|
||||
}
|
||||
// List<String> list = List.of(
|
||||
// "9c166b8dc09343079b6af2e44455266c",
|
||||
// "a7c47c306f0c41b38fd958a559888ccc",
|
||||
// "17c751f77c33433eba9d1c19f03b553a",
|
||||
// "8c5391a82290470ca29ef7b5101b6100",
|
||||
// "8a338dbdab484a33af7d485ba840bb6e",
|
||||
// "18ac213eddb44ac1af0178f78147f39d",
|
||||
// "c0b726dfc1de4773a91e65bf986f4dbc",
|
||||
// "f87d24d2e99e4557a18e439cc0ff8fc8",
|
||||
// "badd9c0bbe9a40feb7b00b80bb3aa770",
|
||||
// "73543dedd0884d2ea536622c8343b4ee",
|
||||
// "3b0607a9365243089d749ddde6d4654f",
|
||||
// "8cd4d0bd05dd42aaaefca14dcc82e25f",
|
||||
// "7921f4d9dad74ea99d0d4635abd665a3",
|
||||
// "ff29bb6caf464386a3895a497fe000ad",
|
||||
// "37b0d8ee75714a6cb6392ca6cdd5eba6",
|
||||
// "26e1d548ec3b4182a7eda6cf3a45f34e",
|
||||
// "53b4df702f62453d879b166dcfe2e4e5",
|
||||
// "35bbb8a98cb2472d8ff5ce0644d4f68a",
|
||||
// "af4e738d4b7049b1b535e682bfa5b91a",
|
||||
// "877e03535b3f4f17b30eb66e76c7e2b2",
|
||||
// "79f5511b9c8245e9b15d2939732c1075",
|
||||
// "aa06d6a1dc9147c299323537f1ce77f7",
|
||||
// "6e6af7d696d3457293673e530b8f0b33",
|
||||
// "639a95df53dd4b3c934b8e15083f1ac5",
|
||||
// "2fb25ba1a5734953a9b4e565b29284dc"
|
||||
// );
|
||||
//
|
||||
//
|
||||
// list.forEach(v -> {
|
||||
// localProcessService.updateProcessNodeName(
|
||||
// "proposal_info@" + v,
|
||||
// "承办单位办理"
|
||||
// );
|
||||
//
|
||||
// //查询主办、协办答复配置
|
||||
// Sql sql = Sqls.fetchRecord(Sqls.create("SELECT t1.* FROM `proposal_config` t INNER JOIN proposal_reply_config t1 on t1.id = t.slaveUnitConfigId").toString());
|
||||
// dao.execute(sql);
|
||||
// Record slaveReplyConfig = (Record) sql.getResult();
|
||||
// //协办需要答复吗
|
||||
// boolean slaveNeedReply = slaveReplyConfig.getInt("isNeedReply") == 1;
|
||||
//
|
||||
// //查询最大一次的replyNumber
|
||||
// int maxReplyNumber = dao.func(ProposalReply.class, "max", "replyNumber", Cnd.where("proposalId", "=", v));
|
||||
//
|
||||
// List<ProposalReply> replies = dao.query(ProposalReply.class, Cnd.where("proposalId", "=", v).and("replyNumber", "=", maxReplyNumber).and("undertakeType", "in", slaveNeedReply ? Lang.list(1, 2) : Lang.list(1)));
|
||||
// for (ProposalReply reply : replies) {
|
||||
// localProcessService.createTask("proposal_info@" + v, "proposal_reply@" + reply.getId(), "承办单位办理", "qcmlivs3oggfmrl0rnoqlcce8p", proposalCommonService.getUnderTakeLeader(reply.getReplyUnitId()), "/platform/proposal/transact/reply", "/platform/proposal/transact/reply", null, null);
|
||||
// }
|
||||
// });
|
||||
|
||||
|
||||
// List<Sys_user> userList = dao.query(Sys_user.class, Cnd.where("loginname", "in", List.of("2005000019", "2010000010", "1992000003", "1998000001")));
|
||||
//
|
||||
// String linkUrl = "https://zhgh.hmc.edu.cn/mobile/proposal/seconded";
|
||||
//
|
||||
// for (Sys_user user : userList) {
|
||||
// String template = "{}代表,您好,{}代表的提案《{}》邀请您作为附议人,请您点击此消息或登录“智慧工会”系统进行附议,感谢您对教代会提案工作的大力支持!";
|
||||
// String content = StrUtil.format(template, user.getUsername(), "王黎芳", "关于进一步提升我校教职工归属感的若干举措建议");
|
||||
// System.out.println(content);
|
||||
//// msgApi.sendMsg(List.of("DingTalk"), user.getLoginname(), 2, "提案附议邀请", content, "", linkUrl);
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user