Merge branch 'main' of http://gitea.dd3skj.com/c-hongqw1/zhgh_hhu
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
package io.v.nutz.base.utils;
|
||||
|
||||
import okhttp3.*;
|
||||
import org.nutz.http.Header;
|
||||
import org.nutz.http.Http;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
@@ -31,10 +30,10 @@ public class WxHttpUtil {
|
||||
@Inject
|
||||
private WxTokenUtil wxTokenUtil;
|
||||
|
||||
private final OkHttpClient okHttpClient = new OkHttpClient();
|
||||
private final MediaType JSON = MediaType.parse("application/json; charset=utf-8");
|
||||
private final MediaType formData = MediaType.parse("multipart/form-data");
|
||||
private final NutMap jsonHeader = NutMap.NEW().setv("Content-Type", "application/json");
|
||||
// private final OkHttpClient okHttpClient = new OkHttpClient();
|
||||
// private final MediaType JSON = MediaType.parse("application/json; charset=utf-8");
|
||||
// private final MediaType formData = MediaType.parse("multipart/form-data");
|
||||
// private final NutMap jsonHeader = NutMap.NEW().setv("Content-Type", "application/json");
|
||||
|
||||
|
||||
public String env = "unionpal-0ge58oan8d6fa30e";
|
||||
@@ -63,22 +62,24 @@ public class WxHttpUtil {
|
||||
Map<String, String> reqBody = new HashMap<>();
|
||||
reqBody.put("env", this.env);
|
||||
reqBody.put("query", query);
|
||||
Header header = Header.create(jsonHeader);
|
||||
org.nutz.http.Response response = Http.post3(queryUrl, Json.toJson(reqBody), header, 200000);
|
||||
return Json.fromJson(NutMap.class, new InputStreamReader(response.getStream()));
|
||||
// Header header = Header.create(jsonHeader);
|
||||
// org.nutz.http.Response response = Http.post3(queryUrl, Json.toJson(reqBody), header, 200000);
|
||||
// return Json.fromJson(NutMap.class, new InputStreamReader(response.getStream()));
|
||||
return null;
|
||||
}
|
||||
|
||||
public NutMap getCloudResult(String queryUrl, String name, Map<String, Object> reqBody) throws IOException {
|
||||
String url = queryUrl.replace("ACCESS_TOKEN", wxTokenUtil.getWeAppAccesstoken())
|
||||
.replace("ENV", this.env).replace("FUNCTION_NAME", name);
|
||||
RequestBody b = RequestBody.create(Json.toJson(reqBody), JSON);
|
||||
Request request = new Request.Builder()
|
||||
.url(url)
|
||||
.post(b)
|
||||
.build();
|
||||
Call call = okHttpClient.newCall(request);
|
||||
Response response = call.execute();
|
||||
return Json.fromJson(NutMap.class, Objects.requireNonNull(response.body()).string());
|
||||
// String url = queryUrl.replace("ACCESS_TOKEN", wxTokenUtil.getWeAppAccesstoken())
|
||||
// .replace("ENV", this.env).replace("FUNCTION_NAME", name);
|
||||
// RequestBody b = RequestBody.create(Json.toJson(reqBody), JSON);
|
||||
// Request request = new Request.Builder()
|
||||
// .url(url)
|
||||
// .post(b)
|
||||
// .build();
|
||||
// Call call = okHttpClient.newCall(request);
|
||||
// Response response = call.execute();
|
||||
// return Json.fromJson(NutMap.class, Objects.requireNonNull(response.body()).string());
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -89,25 +90,26 @@ public class WxHttpUtil {
|
||||
* @throws IOException
|
||||
*/
|
||||
public String getWxFileUrl(String fileid) throws IOException {
|
||||
String url = this.downloadUrl.replace("ACCESS_TOKEN", wxTokenUtil.getWeAppAccesstoken());
|
||||
Map mf = new HashMap<String, String>();
|
||||
mf.put("fileid", fileid);
|
||||
mf.put("max_age", 7200);
|
||||
ArrayList<Map> fm = new ArrayList<>();
|
||||
fm.add(mf);
|
||||
Map reqbody = new HashMap<String, String>();
|
||||
reqbody.put("env", this.env);
|
||||
reqbody.put("file_list", fm);
|
||||
Header header = Header.create(jsonHeader);
|
||||
org.nutz.http.Response response = Http.post3(url, Json.toJson(reqbody), header, 200000);
|
||||
NutMap map = Json.fromJson(NutMap.class, new InputStreamReader(response.getStream()));
|
||||
if (map.getInt("errcode") == 0 && map.getString("errmsg").equals("ok")) {
|
||||
NutMap res = map.getAsList("file_list", NutMap.class).get(0);
|
||||
return res.getString("download_url");
|
||||
} else {
|
||||
log.error(map.getString("errmsg"));
|
||||
return null;
|
||||
}
|
||||
// String url = this.downloadUrl.replace("ACCESS_TOKEN", wxTokenUtil.getWeAppAccesstoken());
|
||||
// Map mf = new HashMap<String, String>();
|
||||
// mf.put("fileid", fileid);
|
||||
// mf.put("max_age", 7200);
|
||||
// ArrayList<Map> fm = new ArrayList<>();
|
||||
// fm.add(mf);
|
||||
// Map reqbody = new HashMap<String, String>();
|
||||
// reqbody.put("env", this.env);
|
||||
// reqbody.put("file_list", fm);
|
||||
// Header header = Header.create(jsonHeader);
|
||||
// org.nutz.http.Response response = Http.post3(url, Json.toJson(reqbody), header, 200000);
|
||||
// NutMap map = Json.fromJson(NutMap.class, new InputStreamReader(response.getStream()));
|
||||
// if (map.getInt("errcode") == 0 && map.getString("errmsg").equals("ok")) {
|
||||
// NutMap res = map.getAsList("file_list", NutMap.class).get(0);
|
||||
// return res.getString("download_url");
|
||||
// } else {
|
||||
// log.error(map.getString("errmsg"));
|
||||
// return null;
|
||||
// }
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -122,14 +124,15 @@ public class WxHttpUtil {
|
||||
* @return
|
||||
*/
|
||||
public NutMap getUploadFile(String wxfilePath) throws Exception {
|
||||
String Url = this.uploadUrl.replace("ACCESS_TOKEN", wxTokenUtil.getWeAppAccesstoken());
|
||||
Map reqbody = new HashMap<String, String>();
|
||||
reqbody.put("env", this.env);
|
||||
reqbody.put("path", wxfilePath);
|
||||
Header header = Header.create(jsonHeader);
|
||||
org.nutz.http.Response response = Http.post3(Url, Json.toJson(reqbody), header, 200000);
|
||||
NutMap map = Json.fromJson(NutMap.class, new InputStreamReader(response.getStream()));
|
||||
return map;
|
||||
// String Url = this.uploadUrl.replace("ACCESS_TOKEN", wxTokenUtil.getWeAppAccesstoken());
|
||||
// Map reqbody = new HashMap<String, String>();
|
||||
// reqbody.put("env", this.env);
|
||||
// reqbody.put("path", wxfilePath);
|
||||
// Header header = Header.create(jsonHeader);
|
||||
// org.nutz.http.Response response = Http.post3(Url, Json.toJson(reqbody), header, 200000);
|
||||
// NutMap map = Json.fromJson(NutMap.class, new InputStreamReader(response.getStream()));
|
||||
// return map;
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -141,28 +144,29 @@ public class WxHttpUtil {
|
||||
* @throws Exception
|
||||
*/
|
||||
public String uploadFile(NutMap map, TempFile file, String wxfilePath) throws Exception {
|
||||
String url = map.getString("url");
|
||||
String token = map.getString("token");
|
||||
String authorization = map.getString("authorization");
|
||||
String file_id = map.getString("file_id");
|
||||
String cos_file_id = map.getString("cos_file_id");
|
||||
RequestBody fb = RequestBody.create(file.getFile(), formData);
|
||||
RequestBody b = new MultipartBody.Builder()
|
||||
.setType(MultipartBody.FORM)
|
||||
.addFormDataPart("key", wxfilePath)
|
||||
.addFormDataPart("Signature", authorization)
|
||||
.addFormDataPart("x-cos-security-token", token)
|
||||
.addFormDataPart("x-cos-meta-fileid", cos_file_id)
|
||||
.addFormDataPart("file", "filename", fb)
|
||||
.build();
|
||||
|
||||
Request request = new Request.Builder()
|
||||
.url(url)
|
||||
.post(b)
|
||||
.build();
|
||||
Call call = okHttpClient.newCall(request);
|
||||
Response response = call.execute();
|
||||
//没有返回的内容 。。。怎么判断是否成功 难道去查?
|
||||
return file_id;
|
||||
// String url = map.getString("url");
|
||||
// String token = map.getString("token");
|
||||
// String authorization = map.getString("authorization");
|
||||
// String file_id = map.getString("file_id");
|
||||
// String cos_file_id = map.getString("cos_file_id");
|
||||
// RequestBody fb = RequestBody.create(file.getFile(), formData);
|
||||
// RequestBody b = new MultipartBody.Builder()
|
||||
// .setType(MultipartBody.FORM)
|
||||
// .addFormDataPart("key", wxfilePath)
|
||||
// .addFormDataPart("Signature", authorization)
|
||||
// .addFormDataPart("x-cos-security-token", token)
|
||||
// .addFormDataPart("x-cos-meta-fileid", cos_file_id)
|
||||
// .addFormDataPart("file", "filename", fb)
|
||||
// .build();
|
||||
//
|
||||
// Request request = new Request.Builder()
|
||||
// .url(url)
|
||||
// .post(b)
|
||||
// .build();
|
||||
// Call call = okHttpClient.newCall(request);
|
||||
// Response response = call.execute();
|
||||
// //没有返回的内容 。。。怎么判断是否成功 难道去查?
|
||||
// return file_id;
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -184,6 +184,7 @@ public class SickHelpListController {
|
||||
SELECT
|
||||
sick.loginName,
|
||||
sick.userName,
|
||||
IFNULL(NULLIF(sfm.idcard, ''), u.idcard) AS idcard,
|
||||
sick.unitName,
|
||||
sick.medicalFourTotalMoney,
|
||||
sick.selfPayMoney,
|
||||
@@ -243,6 +244,7 @@ public class SickHelpListController {
|
||||
excelExportEntities.add(indexExcelExportEntity);
|
||||
excelExportEntities.add(new ExcelExportEntity("工资号", "loginName", 20));
|
||||
excelExportEntities.add(new ExcelExportEntity("姓名", "userName", 20));
|
||||
excelExportEntities.add(new ExcelExportEntity("身份证号", "idcard", 30));
|
||||
excelExportEntities.add(new ExcelExportEntity("单位", "unitName", 20));
|
||||
excelExportEntities.add(new ExcelExportEntity("状态", "userState", 20));
|
||||
excelExportEntities.add(new ExcelExportEntity("是否会员", "isMember", 20));
|
||||
|
||||
@@ -95,7 +95,7 @@ public class SickFundListController {
|
||||
sfm.remark,
|
||||
u.unitid as unitId,
|
||||
u.unitname as unitName,
|
||||
u.idcard
|
||||
IFNULL(NULLIF(sfm.idcard, ''), u.idcard) AS idcard
|
||||
from sick_fund_member sfm
|
||||
left join `user` u on u.loginname = sfm.loginName
|
||||
$condition
|
||||
@@ -132,6 +132,8 @@ public class SickFundListController {
|
||||
if (StrUtil.isNotBlank(keyWord)) {
|
||||
seg.orLike("sfm.loginName", keyWord);
|
||||
seg.orLike("sfm.userName", keyWord);
|
||||
seg.or("sfm.idcard", "=", keyWord);
|
||||
seg.or("u.idcard", "=", keyWord);
|
||||
cnd.and(seg);
|
||||
}
|
||||
|
||||
@@ -189,7 +191,7 @@ public class SickFundListController {
|
||||
return Result.error("该记录已存在,请勿重复添加!");
|
||||
}*/
|
||||
Trans.exec(() -> {
|
||||
dao.update(Sys_user.class, Chain.make("unitId", fundMember.getUnitId()), Cnd.where("loginname", "=", fundMember.getLoginName()));
|
||||
dao.update(Sys_user.class, Chain.make("unitId", fundMember.getUnitId()).add("idcard", fundMember.getIdcard()), Cnd.where("loginname", "=", fundMember.getLoginName()));
|
||||
dao.update(fundMember);
|
||||
});
|
||||
return null;
|
||||
@@ -211,7 +213,10 @@ public class SickFundListController {
|
||||
if (count > 0) {
|
||||
return Result.error("该记录已存在,请勿重复添加!");
|
||||
}*/
|
||||
dao.insert(fundMember);
|
||||
Trans.exec(() -> {
|
||||
dao.update(Sys_user.class, Chain.make("unitId", fundMember.getUnitId()).add("idcard", fundMember.getIdcard()), Cnd.where("loginname", "=", fundMember.getLoginName()));
|
||||
dao.insert(fundMember);
|
||||
});
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -237,7 +242,7 @@ public class SickFundListController {
|
||||
sfm.remark,
|
||||
u.unitid as unitId,
|
||||
u.unitname as unitName,
|
||||
u.idcard
|
||||
IFNULL(NULLIF(sfm.idcard, ''), u.idcard) AS idcard
|
||||
from sick_fund_member sfm
|
||||
left join `user` u on u.loginname = sfm.loginName
|
||||
$condition
|
||||
@@ -273,6 +278,8 @@ public class SickFundListController {
|
||||
if (StrUtil.isNotBlank(keyWord)) {
|
||||
seg.orLike("sfm.loginName", keyWord);
|
||||
seg.orLike("sfm.userName", keyWord);
|
||||
seg.or("sfm.idcard", "=", keyWord);
|
||||
seg.or("u.idcard", "=", keyWord);
|
||||
cnd.and(seg);
|
||||
}
|
||||
cnd.andEX("u.unionid", "=", unionId);
|
||||
|
||||
@@ -6,13 +6,16 @@ import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.ImportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
||||
import cn.hutool.core.collection.ListUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import io.v.nutz.annontation.ViReturn;
|
||||
import io.v.nutz.sickHelp.model.SickFundMember;
|
||||
import io.v.nutz.sys.models.Sys_user;
|
||||
import io.v.nutz.util.ViTool;
|
||||
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.dao.Chain;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
@@ -28,6 +31,7 @@ import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
import org.nutz.mvc.upload.TempFile;
|
||||
import org.nutz.mvc.upload.UploadAdaptor;
|
||||
import org.nutz.trans.Trans;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
@@ -71,7 +75,7 @@ public class SickHelpMemberController {
|
||||
ImportParams importParams = new ImportParams();
|
||||
List<SickFundMember> list = ExcelImportUtil.importExcel(tempFile.getFile(), SickFundMember.class, importParams);
|
||||
List<String> loginNames = list.stream().map(v -> v.getLoginName()).collect(Collectors.toList());
|
||||
Sql userSql = Sqls.create("select id,loginname,username,unitid,unitname,sex from user where loginname in (@loginNames)");
|
||||
Sql userSql = Sqls.create("select u.id,u.loginname,u.username,u.unitid,u.unitname,u.sex,su.idcard from user u left join sys_user su on su.loginname = u.loginname where u.loginname in (@loginNames)");
|
||||
userSql.setParam("loginNames", loginNames);
|
||||
List<NutMap> users = (List<NutMap>) Daos.query(dao, userSql.toString(), Sqls.callback.maps());
|
||||
Map<String, NutMap> userMap = users.stream().collect(Collectors.toMap(v -> v.getString("loginname"), v -> v));
|
||||
@@ -81,6 +85,7 @@ public class SickHelpMemberController {
|
||||
// Map<String, Long> collect = loginNames.stream().filter(v -> StrUtil.isNotBlank(v)).collect(Collectors.groupingBy(Function.identity(), Collectors.counting()));
|
||||
|
||||
for (SickFundMember fundMember : list) {
|
||||
fundMember.setIdcard(StrUtil.trim(fundMember.getIdcard()));
|
||||
// Cnd cnd = Cnd.where("loginName", "=", fundMember.getLoginName());
|
||||
// cnd.and("userName", "=", fundMember.getUserName());
|
||||
// SickFundMember oldFundMember = dao.fetch(SickFundMember.class, cnd);
|
||||
@@ -96,6 +101,9 @@ public class SickHelpMemberController {
|
||||
fundMember.setUnitId(user.getString("unitid"));
|
||||
fundMember.setUnitName(user.getString("unitname"));
|
||||
fundMember.setSex(user.getString("sex"));
|
||||
if (StrUtil.isBlank(fundMember.getIdcard())) {
|
||||
fundMember.setIdcard(StrUtil.trim(user.getString("idcard")));
|
||||
}
|
||||
// fundMember.setIsMember(true);
|
||||
}
|
||||
fundMember.setIsMember("是".equals(fundMember.getMember()));
|
||||
@@ -117,7 +125,14 @@ public class SickHelpMemberController {
|
||||
List<List<SickFundMember>> splitFundMembers = ListUtil.split(Arrays.asList(fundMembers), 500);
|
||||
for (List<SickFundMember> splitFundMember : splitFundMembers) {
|
||||
new Thread(() -> {
|
||||
dao.insertOrUpdate(splitFundMember);
|
||||
Trans.exec(() -> {
|
||||
for (SickFundMember fundMember : splitFundMember) {
|
||||
if (StrUtil.isNotBlank(fundMember.getIdcard())) {
|
||||
dao.update(Sys_user.class, Chain.make("idcard", fundMember.getIdcard()), Cnd.where("loginname", "=", fundMember.getLoginName()));
|
||||
}
|
||||
}
|
||||
dao.insertOrUpdate(splitFundMember);
|
||||
});
|
||||
}).start();
|
||||
}
|
||||
return null;
|
||||
|
||||
@@ -65,6 +65,12 @@ public class SickFundMember {
|
||||
@ColDefine(type = ColType.VARCHAR, width = 1)
|
||||
private String sex;
|
||||
|
||||
@Column
|
||||
@Comment("身份证号")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
@Excel(name = "身份证号", width = 30)
|
||||
private String idcard;
|
||||
|
||||
@Column
|
||||
@Comment("是否会员")
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
|
||||
@@ -214,6 +214,11 @@ public class SickHelp {
|
||||
*/
|
||||
private String mutualGoldStartTime;
|
||||
|
||||
/**
|
||||
* 身份证号
|
||||
*/
|
||||
private String idcard;
|
||||
|
||||
public void setSubsidyMoney(BigDecimal subsidyMoney) {
|
||||
if (subsidyMoney != null) {
|
||||
subsidyMoney = subsidyMoney.setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||
|
||||
@@ -93,6 +93,8 @@ public class SickHelpImportServiceImpl extends ViServiceImpl<SickHelp> implement
|
||||
|
||||
if (fundMember != null) {
|
||||
|
||||
sick.setIdcard(StrUtil.isNotBlank(fundMember.getIdcard()) ? fundMember.getIdcard() : user == null ? null : user.getIdcard());
|
||||
|
||||
// sick.setUnitName(fundMember.getUnitName());
|
||||
|
||||
//本次导入的excel人员是否有重复数据
|
||||
@@ -175,9 +177,10 @@ public class SickHelpImportServiceImpl extends ViServiceImpl<SickHelp> implement
|
||||
|
||||
@Override
|
||||
public List<SickFundMember> searchUser(String key) {
|
||||
Cnd cnd = Cnd.where(Cnd.likeEX("userName", key)).or(Cnd.likeEX("loginName", key));
|
||||
Cnd cnd = Cnd.where(Cnd.likeEX("m.userName", key)).or(Cnd.likeEX("m.loginName", key));
|
||||
cnd.or(Cnd.likeEX("m.idcard", key)).or(Cnd.likeEX("u.idcard", key));
|
||||
|
||||
Sql sql = Sqls.create("select * from sick_fund_member $condition");
|
||||
Sql sql = Sqls.create("select m.*, IFNULL(NULLIF(m.idcard, ''), u.idcard) AS effectiveIdcard from sick_fund_member m left join user u on u.loginname = m.loginName $condition");
|
||||
sql.setCondition(cnd);
|
||||
Pagination pagination = listPageMap(1, 10, sql);
|
||||
return pagination.getList();
|
||||
|
||||
@@ -51,7 +51,8 @@ public class SickHelpListServiceImpl extends ViServiceImpl<SickHelp> implements
|
||||
SELECT
|
||||
sick.*,
|
||||
u.unionname as unionName,
|
||||
sfm.isMember
|
||||
sfm.isMember,
|
||||
IFNULL(NULLIF(sfm.idcard, ''), u.idcard) AS idcard
|
||||
FROM
|
||||
`sick_help` sick
|
||||
LEFT JOIN sick_fund_member sfm on sfm.loginName = sick.loginName
|
||||
@@ -75,6 +76,8 @@ public class SickHelpListServiceImpl extends ViServiceImpl<SickHelp> implements
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
seg.orLike("sick.userName", subsidyUser);
|
||||
seg.orLike("sick.loginName", subsidyUser);
|
||||
seg.orLike("sfm.idcard", subsidyUser);
|
||||
seg.orLike("u.idcard", subsidyUser);
|
||||
cnd.and(seg);
|
||||
}
|
||||
if (StrUtil.isNotBlank(pageForm.getPageOrderName()) && StrUtil.isNotBlank(pageForm.getPageOrderBy())) {
|
||||
|
||||
@@ -79,7 +79,7 @@ public class NutShiroProcessor extends AbstractProcessor {
|
||||
"/platform/qywechat/.*",
|
||||
"/platform/wechat/.*",
|
||||
"/platform/home/(500|403|404|UnknownAccountError|LockedAccountError)",
|
||||
// "/mobile/login",
|
||||
"/mobile/login",
|
||||
"/mobile/login/doLogin"
|
||||
);
|
||||
if (Arrays.stream(authIgnoreUrlArr).noneMatch(v -> Pattern.compile(v).matcher(requestURI).matches())) {
|
||||
|
||||
@@ -1,26 +1,26 @@
|
||||
nutz.application.name=union_hhu
|
||||
server.port=8081
|
||||
server.port=8080
|
||||
server.host=0.0.0.0
|
||||
jetty.contextPath=/
|
||||
jetty.threadpool.idleTimeout=100000
|
||||
jetty.threadpool.minThreads=10
|
||||
jetty.threadpool.maxThreads=20000
|
||||
jetty.page.403=/error/403.htmla
|
||||
jetty.page.403=/error/403.html
|
||||
jetty.page.404=/error/404.html
|
||||
jetty.page.500=/error/500.html
|
||||
#结合ftp使用,或用nginx代理ftp路径
|
||||
jetty.staticPath=D://files
|
||||
jetty.staticPath=D://filesu
|
||||
#开发模式静态资源
|
||||
jetty.staticPathLocal=
|
||||
jetty.staticPathLocal=D:/gsProject/zhgh_hhu/src/main/resources/static
|
||||
nutz.mvc.ignore=^(.+[.])(jsp|png|gif|jpg|js|css|jpeg|html|mp3|mp4|ico|svg)$
|
||||
nutz.mvc.exclusions=/favicon/*,/assets/*,/druid/*,/upload/*
|
||||
ftp.enabled=true
|
||||
ftp.host=202.119.115.17
|
||||
ftp.port=21
|
||||
ftp.username=ftp_user
|
||||
ftp.password=zhgh@17server
|
||||
ftp.host=192.168.21.203
|
||||
ftp.port=9090
|
||||
ftp.username=ftpuser
|
||||
ftp.password=123456
|
||||
ftp.timeout=100
|
||||
redis.host=202.119.115.17
|
||||
redis.host=127.0.0.1
|
||||
redis.port=6379
|
||||
redis.timeout=2000
|
||||
redis.max_redir=10
|
||||
@@ -29,14 +29,14 @@ redis.maxTotal=850
|
||||
redis.pool.maxTotal=900
|
||||
redis.pool.maxIdle=500
|
||||
redis.pool.minIdle=50
|
||||
redis.password=dd3s
|
||||
#redis.password=dd3s
|
||||
#redis集群模式设置
|
||||
#redis.mode=cluster
|
||||
redis.mode=normal
|
||||
#redis.nodes=192.168.6.31:6377,192.168.6.31:6378,192.168.6.28:6377,192.168.6.28:6378,192.168.6.34:6377,192.168.6.34:6378
|
||||
jdbc.url=jdbc:mysql://202.119.115.17:3306/union?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai
|
||||
jdbc.url=jdbc:mysql://192.168.21.215:3306/union_hhu?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai
|
||||
jdbc.username=root
|
||||
jdbc.password=zhgh@17server
|
||||
jdbc.password=root
|
||||
jdbc.validationQuery=select 1
|
||||
jdbc.maxActive=900
|
||||
jdbc.testWhileIdle=true
|
||||
@@ -57,7 +57,7 @@ xsssql.ignore.urls=/platform/cms/content/article/addDo,/platform/sys/app/conf/ad
|
||||
/platform/reimbursement/applyNew/doAdd,/platform/member/common/saveUser,\
|
||||
/platform/sys/union/mange/unionPageData,/platform/fw/condolence/apply/doAdd
|
||||
#环境 dev/prod
|
||||
v.environment=prod
|
||||
v.environment=dev
|
||||
v.loginUrl=/sso/login
|
||||
v.loginUrlMobile=/mobile/cas/login
|
||||
#shiro.ini.path=shiro.ini
|
||||
@@ -86,7 +86,7 @@ shiro.url.login=/platform
|
||||
shiro.url.logout_redirect=/platform
|
||||
shiro.url.unauth=/platform
|
||||
#开发时设置本地路径,便于调试
|
||||
beetl.RESOURCE.rootLocal=
|
||||
beetl.RESOURCE.rootLocal=D:/gsProject/zhgh_hhu/src/main/resources/views/
|
||||
beetl.RESOURCE.root=views/
|
||||
beetl.DELIMITER_STATEMENT_START=<!--#
|
||||
beetl.DELIMITER_STATEMENT_END=#-->
|
||||
|
||||
@@ -92,6 +92,7 @@ layout("/layouts/platform.html"){
|
||||
<!-- <el-input v-model="row.userName" maxlength="10" size="small"></el-input>-->
|
||||
<!-- </template>-->
|
||||
</el-table-column>
|
||||
<el-table-column label="身份证号" prop="idcard" width="200"></el-table-column>
|
||||
<el-table-column label="单位" prop="unitName" show-overflow-tooltip width="150">
|
||||
<!-- <template scope="{row}">-->
|
||||
<!-- <el-input v-model="row.unitName" maxlength="10" size="small"></el-input>-->
|
||||
|
||||
@@ -76,41 +76,46 @@ layout("/layouts/platform.html"){
|
||||
<vi-title2 title="填写补助数据"></vi-title2>
|
||||
|
||||
<el-row>
|
||||
<el-col :lg="8" :xs="24">
|
||||
<el-col :lg="6" :xs="24">
|
||||
<el-form-item label="工号" prop="loginName">
|
||||
<el-select :disabled="formDisabled"
|
||||
:remote-method="searchUser"
|
||||
@change="userChange"
|
||||
clearable
|
||||
filterable
|
||||
placeholder="输入工号或者姓名查询"
|
||||
placeholder="输入工号、姓名或身份证号查询"
|
||||
remote
|
||||
reserve-keyword
|
||||
style="width: 100%"
|
||||
v-model="formData.loginName">
|
||||
<el-option
|
||||
:key="item.loginName"
|
||||
:label="item.userName+'('+item.loginName+')'"
|
||||
:label="item.userName+'('+item.loginName+') '+(item.effectiveIdcard || '')"
|
||||
:value="item.loginName"
|
||||
v-for="item in userList"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :lg="8" :xs="24">
|
||||
<el-col :lg="6" :xs="24">
|
||||
<el-form-item label="姓名" prop="userName">
|
||||
<el-input :disabled="!this.formData.id"
|
||||
placeholder="输入工号之后自动显示"
|
||||
v-model="formData.userName"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :lg="8" :xs="24">
|
||||
<el-col :lg="6" :xs="24">
|
||||
<el-form-item label="身份证号" prop="idcard">
|
||||
<el-input placeholder="选择工号之后自动显示" readonly
|
||||
v-model="formData.idcard"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :lg="6" :xs="24">
|
||||
<el-form-item label="单位" prop="unitName">
|
||||
<el-input placeholder="输入工号之后自动显示"
|
||||
v-model="formData.unitName"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
@@ -337,6 +342,7 @@ layout("/layouts/platform.html"){
|
||||
this.$set(this.formData, 'subsidyDesc', resp_data.subsidyDesc)
|
||||
this.$set(this.formData, 'subsidyMoney', resp_data.subsidyMoney)
|
||||
this.$set(this.formData, 'unitName', resp_data.unitName)
|
||||
this.$set(this.formData, 'idcard', resp_data.idcard)
|
||||
this.notifySuccess(resp_data.validMsg.join('、'))
|
||||
} else {
|
||||
this.notifyWarning(resp_data.validMsg.join('、'))
|
||||
@@ -376,6 +382,7 @@ layout("/layouts/platform.html"){
|
||||
this.$set(this.formData, 'userName', user.userName)
|
||||
this.$set(this.formData, 'unitName', user.unitName)
|
||||
this.$set(this.formData, 'loginName', user.loginName)
|
||||
this.$set(this.formData, 'idcard', user.effectiveIdcard)
|
||||
await this.getHistoryApplyRecords(user.loginName, this.formData.year)
|
||||
},
|
||||
async getHistoryApplyRecords(loginName, year) {
|
||||
@@ -401,6 +408,8 @@ layout("/layouts/platform.html"){
|
||||
await this.searchUser(loginName)
|
||||
resp.data.year = resp.data.year.toString()
|
||||
this.formData = resp.data
|
||||
const user = this.userList.find(v => v.loginName === loginName)
|
||||
this.$set(this.formData, 'idcard', user ? user.effectiveIdcard : null)
|
||||
await this.getHistoryApplyRecords(loginName, this.formData.year)
|
||||
}
|
||||
},
|
||||
@@ -412,4 +421,4 @@ layout("/layouts/platform.html"){
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
#-->
|
||||
|
||||
@@ -45,7 +45,7 @@ layout("/layouts/platform.html"){
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">补助人:</div>
|
||||
<div class="search-item-option">
|
||||
<el-input clearable maxlength="10" placeholder="可输入补助人的工号或姓名进行查询"
|
||||
<el-input clearable maxlength="50" placeholder="可输入补助人的工号、姓名或身份证号进行查询"
|
||||
v-model.trim="pageForm.subsidyUser"></el-input>
|
||||
</div>
|
||||
</div>
|
||||
@@ -269,6 +269,7 @@ layout("/layouts/platform.html"){
|
||||
{prop: 'year', label: '年度', sortable: true, fixed: 'left'},
|
||||
{prop: 'userName', label: '姓名', fixed: 'left'},
|
||||
{prop: 'loginName', label: '工号', fixed: 'left', width: 120},
|
||||
{prop: 'idcard', label: '身份证号', fixed: 'left', width: 200},
|
||||
{prop: 'unionName', label: '分工会', sortable: true, width: 150},
|
||||
{prop: 'unitName', label: '单位', sortable: true, width: 150},
|
||||
|
||||
|
||||
@@ -100,6 +100,7 @@ layout("/layouts/platform.html"){
|
||||
{prop: 'userName', label: '姓名'},
|
||||
{prop: 'loginName', label: '工号'},
|
||||
{prop: 'sex', label: '性别'},
|
||||
{prop: 'idcard', label: '身份证号'},
|
||||
{prop: 'unitName', label: '单位'},
|
||||
{prop: 'userState', label: '状态'},
|
||||
{prop: 'mutualGoldStartTime', label: '入会时间'},
|
||||
@@ -163,4 +164,4 @@ layout("/layouts/platform.html"){
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
#-->
|
||||
|
||||
@@ -24,9 +24,9 @@ layout("/layouts/platform.html"){
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">工号姓名:</div>
|
||||
<div class="search-item-label">会员信息:</div>
|
||||
<div class="search-item-option">
|
||||
<el-input clearable maxlength="10" placeholder="可输入会员的工号或姓名进行查询"
|
||||
<el-input clearable maxlength="50" placeholder="可输入会员的工号、姓名或身份证号进行查询"
|
||||
v-model.trim="pageForm.keyWord"></el-input>
|
||||
</div>
|
||||
</div>
|
||||
@@ -147,6 +147,10 @@ layout("/layouts/platform.html"){
|
||||
<el-radio-button label="女"></el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="身份证号" prop="idcard">
|
||||
<el-input @input="$refs.form.validateField('idcard')" maxlength="18"
|
||||
v-model.trim="formData.idcard"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="单位" prop="unitId">
|
||||
<el-select clearable filterable style="width: 100%"
|
||||
@@ -194,6 +198,20 @@ layout("/layouts/platform.html"){
|
||||
|
||||
</div>
|
||||
<script>
|
||||
const idcardPattern = /^[1-9]\d{5}(18|19|20|(3\d))\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/
|
||||
|
||||
const validateIdcard = (rule, value, callback) => {
|
||||
if (!value) {
|
||||
callback()
|
||||
return
|
||||
}
|
||||
if (!idcardPattern.test(value)) {
|
||||
callback(new Error('请输入正确的身份证号'))
|
||||
return
|
||||
}
|
||||
callback()
|
||||
}
|
||||
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
@@ -215,6 +233,7 @@ layout("/layouts/platform.html"){
|
||||
loginName: [{required: true, message: '请输入工号', trigger: ['change', 'blur']}],
|
||||
userName: [{required: true, message: '请输入姓名', trigger: ['change', 'blur']}],
|
||||
// sex: [{required: true, message: '请选择性别', trigger: ['change', 'blur']}],
|
||||
idcard: [{validator: validateIdcard, trigger: ['change', 'blur']}],
|
||||
unitName: [{required: false, message: '请输入单位', trigger: ['change', 'blur']}],
|
||||
unitId: [{required: true, message: '请选择单位', trigger: ['change', 'blur']}],
|
||||
isMember: [{required: true, message: '请选择是否会员', trigger: ['change', 'blur']}],
|
||||
@@ -230,6 +249,7 @@ layout("/layouts/platform.html"){
|
||||
userName: null,
|
||||
loginName: null,
|
||||
sex: null,
|
||||
idcard: null,
|
||||
unitName: null,
|
||||
unitId: null,
|
||||
isMember: null,
|
||||
@@ -302,6 +322,12 @@ layout("/layouts/platform.html"){
|
||||
})
|
||||
},
|
||||
async doHandle() {
|
||||
const idcard = (this.formData.idcard || '').trim()
|
||||
if (idcard && !idcardPattern.test(idcard)) {
|
||||
this.notifyWarning('请输入正确的身份证号')
|
||||
return
|
||||
}
|
||||
this.$set(this.formData, 'idcard', idcard || null)
|
||||
const valid = await this.$refs.form.validate()
|
||||
if (!valid) return
|
||||
const url = this.formData.id ? '/doEdit' : '/doAdd'
|
||||
|
||||
@@ -1,10 +1,21 @@
|
||||
package io.v.nutz;
|
||||
|
||||
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||
import cn.afterturn.easypoi.excel.ExcelImportUtil;
|
||||
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.ImportParams;
|
||||
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.service.BaseService;
|
||||
import io.v.nutz.base.utils.MsgApi;
|
||||
import io.v.nutz.base.utils.Roles;
|
||||
import io.v.nutz.data.model.UserSource;
|
||||
import io.v.nutz.member.MemberMode;
|
||||
import io.v.nutz.question.model.Question_issue;
|
||||
import io.v.nutz.question.model.Question_wor;
|
||||
import io.v.nutz.service.AsyncService;
|
||||
import io.v.nutz.sickHelp.model.SickFundMember;
|
||||
import io.v.nutz.sys.models.Sys_user;
|
||||
@@ -13,6 +24,9 @@ import io.v.nutz.sys.models.User;
|
||||
import io.v.nutz.sys.services.SysConfigService;
|
||||
import io.v.nutz.sys.services.SysUserRoleService;
|
||||
import io.v.nutz.sys.services.SysUserService;
|
||||
import lombok.Data;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import org.apache.shiro.crypto.hash.Sha256Hash;
|
||||
import org.apache.shiro.util.ByteSource;
|
||||
import org.junit.Assert;
|
||||
@@ -26,20 +40,28 @@ 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.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.json.Json;
|
||||
import org.nutz.lang.Lang;
|
||||
import org.nutz.lang.random.R;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.trans.Trans;
|
||||
|
||||
import javax.servlet.ServletOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@@ -257,8 +279,157 @@ public class WebTestDemo extends Assert {
|
||||
|
||||
@Test
|
||||
public void testMsgToken2() {
|
||||
msgApi.sendMsg("1",List.of("18571562330"));
|
||||
msgApi.sendMsg("1", List.of("18571562330"));
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void evalQuestion() {
|
||||
String filePath = "C:\\Users\\jug\\Desktop\\新建文本文档.txt";
|
||||
List<Question_issue> issues = new ArrayList<>();
|
||||
Question_issue currentIssue = null;
|
||||
try {
|
||||
List<String> lines = Files.readAllLines(Paths.get(filePath));
|
||||
for (String line : lines) {
|
||||
line = line.trim();
|
||||
if (line.isEmpty()) {
|
||||
continue; // 跳过空行
|
||||
}
|
||||
|
||||
// 检测题目
|
||||
if (line.contains("[单选题]") || line.contains("【单选题】") || line.contains("[多选题]") || line.contains("【多选题】") || line.contains("[判断题]") || line.contains("【判断题】")) {
|
||||
// 如果当前有题目,添加到列表中
|
||||
if (currentIssue != null) {
|
||||
issues.add(currentIssue);
|
||||
}
|
||||
// 创建新的题目
|
||||
currentIssue = new Question_issue();
|
||||
// 去除题目中的标签
|
||||
String title = line.replaceAll("\\[单选题\\]", "").replaceAll("\\[多选题\\]", "")
|
||||
.replaceAll("【单选题】", "").replaceAll("【多选题】", "")
|
||||
.replaceAll("[判断题]", "").replaceAll("【判断题】", "");
|
||||
// 去除序号
|
||||
String[] patterns = {
|
||||
"\\d+、", // 例如:1、
|
||||
"\\d+\\.", // 例如:2.
|
||||
"\\(\\d+\\)", // 例如:(3)
|
||||
"第\\d+题" // 例如:第4题
|
||||
};
|
||||
for (String regex : patterns) {
|
||||
Pattern pattern = Pattern.compile(regex);
|
||||
Matcher matcher = pattern.matcher(title);
|
||||
title = matcher.replaceAll("");
|
||||
}
|
||||
currentIssue.setIname(title);
|
||||
currentIssue.setIisbd(true);
|
||||
// 设置是否单选
|
||||
if (line.contains("【单选题】") || line.contains("[单选题]")) {
|
||||
currentIssue.setItx(1);
|
||||
currentIssue.setIisdx(true);
|
||||
} else if (line.contains("【多选题】") || line.contains("[多选题]")) {
|
||||
currentIssue.setItx(1);
|
||||
currentIssue.setIisdx(false);
|
||||
} else if (line.contains("【判断题】") || line.contains("[判断题]")) {
|
||||
currentIssue.setItx(3);
|
||||
}
|
||||
// 设置分数
|
||||
currentIssue.setFraction(5);
|
||||
// 初始化选项列表
|
||||
currentIssue.setWors(new ArrayList<>());
|
||||
} else {
|
||||
// 处理选项
|
||||
if (currentIssue != null && StrUtil.isNotBlank(line)) {
|
||||
Question_wor wor = new Question_wor();
|
||||
wor.setWtxt(line);
|
||||
// 判断是否为正确答案
|
||||
if (line.contains("(正确答案)") || line.contains("(正确答案)")) {
|
||||
wor.setCorrect(true);
|
||||
// 去除正确答案标记
|
||||
wor.setWtxt(line.replace("(正确答案)", "").replace("(正确答案)", "").trim());
|
||||
} else {
|
||||
wor.setCorrect(false);
|
||||
}
|
||||
currentIssue.getWors().add(wor);
|
||||
}
|
||||
}
|
||||
}
|
||||
// 添加最后一题
|
||||
if (currentIssue != null) {
|
||||
issues.add(currentIssue);
|
||||
}
|
||||
|
||||
// 输出解析结果
|
||||
for (int i = 0; i < issues.size(); i++) {
|
||||
issues.get(i).setIqid("7b44be22c6b042699779c9df5754a4da");
|
||||
issues.get(i).setIpxbh(i + 1);
|
||||
dao.insert(issues.get(i));
|
||||
System.out.println(1);
|
||||
List<Question_wor> wors = new ArrayList<>();
|
||||
for (int i1 = 0; i1 < issues.get(i).getWors().size(); i1++) {
|
||||
Question_wor wor = issues.get(i).getWors().get(i1);
|
||||
wor.setWid(R.UU32());
|
||||
wor.setWiid(issues.get(i).getIid());
|
||||
wor.setWpxbh(i1 + 1);
|
||||
wors.add(wor);
|
||||
}
|
||||
dao.insert(wors);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void exportXlsx() throws IOException {
|
||||
List<a> list = ExcelImportUtil.importExcel(new File("D:\\gooleDownload\\无标题.xlsx"), a.class, new ImportParams());
|
||||
Map<String, List<a>> collect = list.stream().filter(v -> StrUtil.isNotBlank(v.getUnionname())).collect(Collectors.groupingBy(v -> v.getUnionname()));
|
||||
|
||||
ArrayList<ExcelExportEntity> entities = new ArrayList<>();
|
||||
|
||||
Workbook workbook = new XSSFWorkbook();
|
||||
|
||||
//每个分工会为一个sheet页
|
||||
for (Map.Entry<String, List<a>> entry : collect.entrySet()) {
|
||||
String sheetName = entry.getKey();
|
||||
List<a> value = entry.getValue();
|
||||
for (int i = 0; i < value.size(); i++) {
|
||||
value.get(i).setNo(i + 1);
|
||||
}
|
||||
|
||||
ExcelExportService service = new ExcelExportService();
|
||||
ExportParams exportParams = new ExportParams();
|
||||
exportParams.setTitle(sheetName);
|
||||
exportParams.setSheetName(sheetName + "(" + value.size() + ")人");
|
||||
exportParams.setType(ExcelType.XSSF);
|
||||
// service.createSheetForMap(workbook, exportParams, entityList, value);
|
||||
service.createSheet(workbook, exportParams, a.class, value);
|
||||
}
|
||||
|
||||
FileOutputStream outputStream = new FileOutputStream("E:\\a.xlsx");
|
||||
workbook.write(outputStream);
|
||||
outputStream.close();
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class a {
|
||||
@Excel(name = "序号")
|
||||
private Integer no;
|
||||
@Excel(name = "工号", width = 20)
|
||||
private String loginname;
|
||||
@Excel(name = "姓名", width = 20)
|
||||
private String username;
|
||||
@Excel(name = "性别", width = 20)
|
||||
private String sex;
|
||||
@Excel(name = "出生年月", width = 20)
|
||||
private String birthday;
|
||||
@Excel(name = "在职状态", width = 20)
|
||||
private String userState;
|
||||
@Excel(name = "人员类型", width = 20)
|
||||
private String personType;
|
||||
@Excel(name = "单位", width = 20)
|
||||
private String unitName;
|
||||
@Excel(name = "分工会", width = 20)
|
||||
private String unionname;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user