commit
This commit is contained in:
@@ -104,7 +104,7 @@ public class WelfareListController {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
CASE
|
||||
|
||||
|
||||
WHEN
|
||||
wus.selectUserId IS NOT NULL THEN
|
||||
1 ELSE 0
|
||||
@@ -116,6 +116,7 @@ public class WelfareListController {
|
||||
wl.userState,
|
||||
wl.unionname,
|
||||
wl.unitname,
|
||||
wl.unitid,
|
||||
wl.listId,
|
||||
wus.userSign,
|
||||
wus.courierNumber,
|
||||
@@ -171,7 +172,17 @@ public class WelfareListController {
|
||||
}
|
||||
|
||||
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
|
||||
@@ -518,7 +529,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
|
||||
@@ -559,12 +570,12 @@ public class WelfareListController {
|
||||
List<NutMap> v = new ArrayList<>();
|
||||
if (un.equals("在职教职工")) {
|
||||
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());
|
||||
}
|
||||
if (un.equals("劳务派遣")) {
|
||||
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("空状态")) {
|
||||
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.groupBy("wpus.id");
|
||||
if(StrUtil.isBlank(optionId)) {
|
||||
if (StrUtil.isBlank(optionId)) {
|
||||
cnd.groupBy("u.id");
|
||||
}
|
||||
cnd.and("wpus.welfareId", "=", projectId);
|
||||
@@ -647,9 +658,9 @@ public class WelfareListController {
|
||||
sql.setCondition(cnd);
|
||||
List<NutMap> mapList = welfareListService.listMap(sql);
|
||||
|
||||
if(StrUtil.isBlank(optionId)){
|
||||
if (StrUtil.isBlank(optionId)) {
|
||||
for (NutMap map : mapList) {
|
||||
map.put("selectNum",null);
|
||||
map.put("selectNum", null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -674,26 +685,25 @@ public class WelfareListController {
|
||||
}
|
||||
|
||||
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@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)) {
|
||||
return null;
|
||||
}
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
id,
|
||||
loginname,
|
||||
username,
|
||||
unitid,
|
||||
unitname
|
||||
FROM
|
||||
`user`
|
||||
$condition
|
||||
AND id not in (select userId from welfare_list where projectId = @projectId)
|
||||
""").setParam("projectId", projectId);
|
||||
SELECT
|
||||
id,
|
||||
loginname,
|
||||
username,
|
||||
unitid,
|
||||
unitname
|
||||
FROM
|
||||
`user`
|
||||
$condition
|
||||
AND id not in (select userId from welfare_list where projectId = @projectId)
|
||||
""").setParam("projectId", projectId);
|
||||
Cnd cnd = Cnd.NEW();
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
seg.orLike("loginname", query);
|
||||
@@ -740,7 +750,7 @@ public class WelfareListController {
|
||||
@ViReturn
|
||||
@RequiresPermissions("welfare.list.mange")
|
||||
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)) {
|
||||
String link = Globals.AppDomain + "/mobile/welfare/list/receive?projectId=%s".formatted(projectId);
|
||||
msgApi.sendMsg(List.of("DingTalk"), loginname, 2, title, content, "", link);
|
||||
@@ -752,14 +762,14 @@ public class WelfareListController {
|
||||
@At
|
||||
@Ok("void")
|
||||
@RequiresPermissions("welfare.list.mange")
|
||||
public void doExportWelfareBySearch(@Param(value = "searchName",required = false) String searchName,
|
||||
@Param(value = "searchKeyWord",required = false) String searchKeyWord,
|
||||
@Param(value = "projectId",required = false) String projectId,
|
||||
@Param(value = "unionId",required = false) String unionId,
|
||||
@Param(value = "units",required = false) String[] units,
|
||||
@Param(value = "threeUnitId",required = false) String threeUnitId,
|
||||
@Param(value = "isChoose",required = false) Integer isChoose,
|
||||
HttpServletResponse response){
|
||||
public void doExportWelfareBySearch(@Param(value = "searchName", required = false) String searchName,
|
||||
@Param(value = "searchKeyWord", required = false) String searchKeyWord,
|
||||
@Param(value = "projectId", required = false) String projectId,
|
||||
@Param(value = "unionId", required = false) String unionId,
|
||||
@Param(value = "units", required = false) String[] units,
|
||||
@Param(value = "threeUnitId", required = false) String threeUnitId,
|
||||
@Param(value = "isChoose", required = false) Integer isChoose,
|
||||
HttpServletResponse response) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
CASE
|
||||
@@ -819,10 +829,12 @@ public class WelfareListController {
|
||||
exportEntities.add(new ExcelExportEntity("单位", "unitname", 20));
|
||||
exportEntities.add(new ExcelExportEntity("科室", "threeUnitName", 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 {
|
||||
ViTool.excelResponse(response,"福利名单.xls");
|
||||
ViTool.excelResponse(response, "福利名单.xls");
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), exportEntities, list);
|
||||
workbook.write(response.getOutputStream());
|
||||
} catch (IOException e) {
|
||||
|
||||
Reference in New Issue
Block a user