commit
This commit is contained in:
@@ -116,6 +116,7 @@ public class WelfareListController {
|
|||||||
wl.userState,
|
wl.userState,
|
||||||
wl.unionname,
|
wl.unionname,
|
||||||
wl.unitname,
|
wl.unitname,
|
||||||
|
wl.unitid,
|
||||||
wl.listId,
|
wl.listId,
|
||||||
wus.userSign,
|
wus.userSign,
|
||||||
wus.courierNumber,
|
wus.courierNumber,
|
||||||
@@ -171,7 +172,17 @@ public class WelfareListController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sql.setCondition(cnd);
|
sql.setCondition(cnd);
|
||||||
return welfareListService.list(pageForm, sql);
|
Pagination list = welfareListService.list(pageForm, sql);
|
||||||
|
List<NutMap> listMap = list.getList();
|
||||||
|
if (!ShiroUtil.hasAnyRoles("sysadmin")) {
|
||||||
|
listMap.forEach(map -> {
|
||||||
|
if (map.getString("unitid").equals("DZJF000")) {
|
||||||
|
map.put("receiveAddress", StrUtil.isNotBlank(map.getString("receiveAddress")) ? "********" : "");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
list.setList(listMap);
|
||||||
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
@At
|
@At
|
||||||
@@ -559,12 +570,12 @@ public class WelfareListController {
|
|||||||
List<NutMap> v = new ArrayList<>();
|
List<NutMap> v = new ArrayList<>();
|
||||||
if (un.equals("在职教职工")) {
|
if (un.equals("在职教职工")) {
|
||||||
v = mapList.stream().filter(m -> StrUtil.isNotBlank(m.getString("personType")) &&
|
v = mapList.stream().filter(m -> StrUtil.isNotBlank(m.getString("personType")) &&
|
||||||
(!m.getString("personType").equals("劳务人才派遣") && !m.getString("personType").equals("其他类"))
|
(!m.getString("personType").equals("劳务人才派遣") && !m.getString("personType").equals("其他类"))
|
||||||
).collect(Collectors.toList());
|
).collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
if (un.equals("劳务派遣")) {
|
if (un.equals("劳务派遣")) {
|
||||||
v = mapList.stream().filter(m -> StrUtil.isNotBlank(m.getString("personType")) &&
|
v = mapList.stream().filter(m -> StrUtil.isNotBlank(m.getString("personType")) &&
|
||||||
(m.getString("personType").equals("劳务人才派遣") || m.getString("personType").equals("其他类"))).collect(Collectors.toList());
|
(m.getString("personType").equals("劳务人才派遣") || m.getString("personType").equals("其他类"))).collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
if (un.equals("空状态")) {
|
if (un.equals("空状态")) {
|
||||||
v = mapList.stream().filter(m -> StrUtil.isBlank(m.getString("personType"))).collect(Collectors.toList());
|
v = mapList.stream().filter(m -> StrUtil.isBlank(m.getString("personType"))).collect(Collectors.toList());
|
||||||
@@ -623,7 +634,7 @@ public class WelfareListController {
|
|||||||
""");
|
""");
|
||||||
Cnd cnd = Cnd.NEW();
|
Cnd cnd = Cnd.NEW();
|
||||||
cnd.groupBy("wpus.id");
|
cnd.groupBy("wpus.id");
|
||||||
if(StrUtil.isBlank(optionId)) {
|
if (StrUtil.isBlank(optionId)) {
|
||||||
cnd.groupBy("u.id");
|
cnd.groupBy("u.id");
|
||||||
}
|
}
|
||||||
cnd.and("wpus.welfareId", "=", projectId);
|
cnd.and("wpus.welfareId", "=", projectId);
|
||||||
@@ -647,9 +658,9 @@ public class WelfareListController {
|
|||||||
sql.setCondition(cnd);
|
sql.setCondition(cnd);
|
||||||
List<NutMap> mapList = welfareListService.listMap(sql);
|
List<NutMap> mapList = welfareListService.listMap(sql);
|
||||||
|
|
||||||
if(StrUtil.isBlank(optionId)){
|
if (StrUtil.isBlank(optionId)) {
|
||||||
for (NutMap map : mapList) {
|
for (NutMap map : mapList) {
|
||||||
map.put("selectNum",null);
|
map.put("selectNum", null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -674,26 +685,25 @@ public class WelfareListController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@At
|
@At
|
||||||
@ViReturn
|
@ViReturn
|
||||||
@RequiresPermissions("welfare.list.mange")
|
@RequiresPermissions("welfare.list.mange")
|
||||||
public Object queryNotWelfareListUsers(@Param("projectId") String projectId, @Param("query") String query){
|
public Object queryNotWelfareListUsers(@Param("projectId") String projectId, @Param("query") String query) {
|
||||||
if (StrUtil.isBlank(query)) {
|
if (StrUtil.isBlank(query)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
Sql sql = Sqls.create("""
|
Sql sql = Sqls.create("""
|
||||||
SELECT
|
SELECT
|
||||||
id,
|
id,
|
||||||
loginname,
|
loginname,
|
||||||
username,
|
username,
|
||||||
unitid,
|
unitid,
|
||||||
unitname
|
unitname
|
||||||
FROM
|
FROM
|
||||||
`user`
|
`user`
|
||||||
$condition
|
$condition
|
||||||
AND id not in (select userId from welfare_list where projectId = @projectId)
|
AND id not in (select userId from welfare_list where projectId = @projectId)
|
||||||
""").setParam("projectId", projectId);
|
""").setParam("projectId", projectId);
|
||||||
Cnd cnd = Cnd.NEW();
|
Cnd cnd = Cnd.NEW();
|
||||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||||
seg.orLike("loginname", query);
|
seg.orLike("loginname", query);
|
||||||
@@ -740,7 +750,7 @@ public class WelfareListController {
|
|||||||
@ViReturn
|
@ViReturn
|
||||||
@RequiresPermissions("welfare.list.mange")
|
@RequiresPermissions("welfare.list.mange")
|
||||||
public Object sendMsg(@Param("projectId") String projectId, @Param("title") String title,
|
public Object sendMsg(@Param("projectId") String projectId, @Param("title") String title,
|
||||||
@Param("content") String content, @Param("loginname") String loginname){
|
@Param("content") String content, @Param("loginname") String loginname) {
|
||||||
if (StrUtil.isNotBlank(loginname)) {
|
if (StrUtil.isNotBlank(loginname)) {
|
||||||
String link = Globals.AppDomain + "/mobile/welfare/list/receive?projectId=%s".formatted(projectId);
|
String link = Globals.AppDomain + "/mobile/welfare/list/receive?projectId=%s".formatted(projectId);
|
||||||
msgApi.sendMsg(List.of("DingTalk"), loginname, 2, title, content, "", link);
|
msgApi.sendMsg(List.of("DingTalk"), loginname, 2, title, content, "", link);
|
||||||
@@ -752,14 +762,14 @@ public class WelfareListController {
|
|||||||
@At
|
@At
|
||||||
@Ok("void")
|
@Ok("void")
|
||||||
@RequiresPermissions("welfare.list.mange")
|
@RequiresPermissions("welfare.list.mange")
|
||||||
public void doExportWelfareBySearch(@Param(value = "searchName",required = false) String searchName,
|
public void doExportWelfareBySearch(@Param(value = "searchName", required = false) String searchName,
|
||||||
@Param(value = "searchKeyWord",required = false) String searchKeyWord,
|
@Param(value = "searchKeyWord", required = false) String searchKeyWord,
|
||||||
@Param(value = "projectId",required = false) String projectId,
|
@Param(value = "projectId", required = false) String projectId,
|
||||||
@Param(value = "unionId",required = false) String unionId,
|
@Param(value = "unionId", required = false) String unionId,
|
||||||
@Param(value = "units",required = false) String[] units,
|
@Param(value = "units", required = false) String[] units,
|
||||||
@Param(value = "threeUnitId",required = false) String threeUnitId,
|
@Param(value = "threeUnitId", required = false) String threeUnitId,
|
||||||
@Param(value = "isChoose",required = false) Integer isChoose,
|
@Param(value = "isChoose", required = false) Integer isChoose,
|
||||||
HttpServletResponse response){
|
HttpServletResponse response) {
|
||||||
Sql sql = Sqls.create("""
|
Sql sql = Sqls.create("""
|
||||||
SELECT
|
SELECT
|
||||||
CASE
|
CASE
|
||||||
@@ -819,10 +829,12 @@ public class WelfareListController {
|
|||||||
exportEntities.add(new ExcelExportEntity("单位", "unitname", 20));
|
exportEntities.add(new ExcelExportEntity("单位", "unitname", 20));
|
||||||
exportEntities.add(new ExcelExportEntity("科室", "threeUnitName", 20));
|
exportEntities.add(new ExcelExportEntity("科室", "threeUnitName", 20));
|
||||||
exportEntities.add(new ExcelExportEntity("所选福利", "gist_list", 20));
|
exportEntities.add(new ExcelExportEntity("所选福利", "gist_list", 20));
|
||||||
exportEntities.add(new ExcelExportEntity("收货地址", "receiveAddress", 20));
|
if (!ShiroUtil.hasAnyRoles("sysadmin")){
|
||||||
|
exportEntities.add(new ExcelExportEntity("收货地址", "receiveAddress", 20));
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
ViTool.excelResponse(response,"福利名单.xls");
|
ViTool.excelResponse(response, "福利名单.xls");
|
||||||
Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), exportEntities, list);
|
Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), exportEntities, list);
|
||||||
workbook.write(response.getOutputStream());
|
workbook.write(response.getOutputStream());
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user