Merge remote-tracking branch 'origin/main'

This commit is contained in:
@jyuhsin
2025-11-13 14:41:40 +08:00
21 changed files with 446 additions and 332 deletions
@@ -373,7 +373,7 @@ public class SysUnionController {
@SaCheckPermission("sys.manager.union.partUnit")
public Result branchUnionPartUnitTransferData(String unionId) {
// List<Sys_unit> units = dao.query(Sys_unit.class, Cnd.where("unitLevel", "=", 2).asc("unitcode"));
List<Sys_unit> units = dao.query(Sys_unit.class, Cnd.where("unitTypeCode", "=", "1").asc("unitcode"));
List<Sys_unit> units = dao.query(Sys_unit.class, Cnd.where("unitTypeCode", "=", "1").and("LENGTH(unitcode)", "=", 7).asc("unitcode"));
List<String> selectUnitIds = units.stream().filter(unit -> StrUtil.isNotBlank(unit.getUnionId()) && unit.getUnionId().equals(unionId)).map(Sys_unit::getId).toList();
List<Sys_unit> matchUnits = units.stream().filter(unit -> StrUtil.isBlank(unit.getUnionId()) || (StrUtil.isNotBlank(unit.getUnionId()) && unit.getUnionId().equals(unionId))).toList();
NutMap transferData = NutMap.NEW().addv("selectUnitIds", selectUnitIds).addv("allUnits", matchUnits);
@@ -136,6 +136,7 @@ public class CommonController {
Cnd cnd = Cnd.NEW();
cnd.andEX("unit.unionId", "=", unionId);
cnd.and("unit.unitTypeCode", "=", "1");
cnd.and("unit.unionId", "is not", null);
cnd.asc("unit.unitcode");
sql.setCondition(cnd);
List<NutMap> unitList = sysUserService.listMap(sql);
@@ -114,7 +114,8 @@ public class ProposalConfigUnitController {
@SLog(tag = "提案", msg = "承办单位同步系统单位")
public Result syncSysUnit() {
Sql sql = Sqls.create("select code from proposal_undertake");
List<Sys_unit> sysUnits = dao.query(Sys_unit.class, Cnd.where(Sys_unit::getUnitcode, "not in", sql).and(Sys_unit::getUnitTypeCode, "=", 1));
List<Sys_unit> sysUnits = dao.query(Sys_unit.class, Cnd.where(Sys_unit::getUnitcode, "not in", sql)
.and(Sys_unit::getUnitTypeCode, "=", 1).and("unionId", "is not", null));
List<ProposalUndertake> proposalUndertakes = sysUnits.stream().map(unit -> {
ProposalUndertake proposalUndertake = new ProposalUndertake();
proposalUndertake.setId(unit.getId());
@@ -198,10 +199,10 @@ public class ProposalConfigUnitController {
//查询全部的校领导
Sql sql = Sqls.create("select id,username,loginname,unitname,concat(username,'(',loginname,')') label from vw_user where unitId in (@unitId)");
ProposalConfig proposalConfig = dao.fetch(ProposalConfig.class, Cnd.NEW());
if(ObjectUtil.isNull(proposalConfig)){
if (ObjectUtil.isNull(proposalConfig)) {
return Result.error("提案全局配置未配置,请在提案管理-基础配置-提案配置页面进行配置。");
}
if(ObjectUtil.isEmpty(proposalConfig.getSchoolLeaderUnitIds())){
if (ObjectUtil.isEmpty(proposalConfig.getSchoolLeaderUnitIds())) {
return Result.error("校领导单位未配置,请在提案管理-基础配置-提案配置页面进行配置。");
}
@@ -230,8 +231,8 @@ public class ProposalConfigUnitController {
Sql sql = Sqls.create("select id,username,loginname,unitname,concat(username,'(',loginname,')') label from vw_user $condition");
Cnd cnd = Cnd.NEW();
cnd.and("unitCode","=",proposalUndertake.getCode());
cnd.orEX("id","in",selectUserIds);
cnd.and("unitCode", "=", proposalUndertake.getCode());
cnd.orEX("id", "in", selectUserIds);
sql.setCondition(cnd);
// sql.setParam("unitCode", proposalUndertake.getCode());
// sql.setParam("selectUserIds", selectUserIds);
@@ -179,7 +179,7 @@ public class TeacherCongressDelegationController {
seg.orEX("id", "in", selectUnitIds);
// Cnd cnd = Cnd.where("unitLevel", "=", 2);
Cnd cnd = Cnd.where("unitTypeCode", "=", "1");
Cnd cnd = Cnd.where("unitTypeCode", "=", "1").and("unionId","is not",null);
if (!seg.isEmpty()) {
cnd.and(seg);
}
@@ -9,11 +9,13 @@ import com.budwk.app.base.constant.RoleConstant;
import com.budwk.app.base.page.Pagination;
import com.budwk.app.base.param.PageForm;
import com.budwk.app.base.result.Result;
import com.budwk.app.base.utils.CommonDownloadUtil;
import com.budwk.app.base.utils.PageUtil;
import com.budwk.app.flow.engine.FlowEngine;
import com.budwk.app.sys.views.View_user;
import com.budwk.app.web.commons.auth.utils.AuthUtil;
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
import com.budwk.app.zhgh.democratic.proposal.models.ProposalInfo;
import com.budwk.app.zhgh.staffbenefit.condolence.model.Condolence;
import com.budwk.app.zhgh.staffbenefit.condolence.model.CondolenceType;
import com.budwk.app.zhgh.staffbenefit.condolence.service.CondolenceService;
@@ -21,8 +23,10 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.dao.Cnd;
import org.nutz.dao.FieldFilter;
import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql;
import org.nutz.dao.util.Daos;
import org.nutz.dao.util.cri.SqlExpressionGroup;
import org.nutz.ioc.aop.Aop;
import org.nutz.ioc.loader.annotation.Inject;
@@ -33,6 +37,11 @@ import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
/**
* @ClassName CondolenceApplyController
* @Author JyuHsin
@@ -138,4 +147,16 @@ public class CondolenceMineController {
nutMap.put("typeName", type.getName());
return Result.success(nutMap);
}
@At
@ApiOperation("导出单个慰问申请信息")
@SaCheckPermission("condolence")
public void onExport(@Valid String id, HttpServletResponse response){
Condolence condolence = condolenceService.fetch(id);
String fileName;
}
}
@@ -39,29 +39,31 @@ import java.util.List;
@Ok("json:full")
public class CondolenceSchoolUnionApprovalController {
@Inject
private CondolenceService condolenceService;
@Inject
private CondolenceService condolenceService;
@At("/")
@Ok("beetl:/platform/zhgh/staffbenefit/condolence/schoolUnionApproval/index.html")
@SaCheckPermission("condolence.schoolUnionApproval")
public void index() {}
@At("/")
@Ok("beetl:/platform/zhgh/staffbenefit/condolence/schoolUnionApproval/index.html")
@SaCheckPermission("condolence.schoolUnionApproval")
public void index() {
}
@At("/h5")
@Ok("beetl:/platform/zhghh5/staffbenefit/condolence/schoolUnionApproval/index.html")
@SaCheckPermission("h5.condolence.schoolUnionApproval")
public void h5Index() {}
@At("/h5")
@Ok("beetl:/platform/zhghh5/staffbenefit/condolence/schoolUnionApproval/index.html")
@SaCheckPermission("h5.condolence.schoolUnionApproval")
public void h5Index() {
}
@At
@ApiOperation("分页查询")
@SaCheckPermission(value = {"condolence.schoolUnionApproval", "h5.condolence.schoolUnionApproval"}, mode = SaMode.OR)
public Result pageData(PageForm pageForm,
@Param(value = "year") Integer year,
@Param(value = "type") String type,
@Param(value = "unionId") String unionId,
@Param(value = "unitId") String unitId,
@Param(value = "approval") Boolean approval) {
Sql sql = Sqls.create("""
@At
@ApiOperation("分页查询")
@SaCheckPermission(value = {"condolence.schoolUnionApproval", "h5.condolence.schoolUnionApproval"}, mode = SaMode.OR)
public Result pageData(PageForm pageForm,
@Param(value = "year") Integer year,
@Param(value = "type") String type,
@Param(value = "unionId") String unionId,
@Param(value = "unitId") String unitId,
@Param(value = "approval") Boolean approval) {
Sql sql = Sqls.create("""
SELECT
info.*,
type.name as typeName,
@@ -91,35 +93,35 @@ public class CondolenceSchoolUnionApprovalController {
LEFT JOIN wf_process_task rt ON rt.processInstanceId = ins.id AND rt.taskParentId = t.id AND rt.taskState = 10
$condition
""");
Cnd cnd = Cnd.NEW();
if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
SqlExpressionGroup seg = new SqlExpressionGroup();
seg.or(Condolence::getHelpUserName, "like", "%" + pageForm.getSearchKeyword() + "%");
seg.or(Condolence::getHelpLoginName, "like", "%" + pageForm.getSearchKeyword() + "%");
cnd.and(seg);
}
cnd.andEX("info.type", "=", type);
cnd.andEX("YEAR(info.createTime)", "=", year);
cnd.andEX("info.applyUnionId", "=", unionId);
cnd.andEX("info.applyUnitId", "=", unitId);
Cnd cnd = Cnd.NEW();
if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
SqlExpressionGroup seg = new SqlExpressionGroup();
seg.or(Condolence::getHelpUserName, "like", "%" + pageForm.getSearchKeyword() + "%");
seg.or(Condolence::getHelpLoginName, "like", "%" + pageForm.getSearchKeyword() + "%");
cnd.and(seg);
}
cnd.andEX("info.type", "=", type);
cnd.andEX("YEAR(info.createTime)", "=", year);
cnd.andEX("info.applyUnionId", "=", unionId);
cnd.andEX("info.applyUnitId", "=", unitId);
cnd.and("t.taskName", "=", "ecdaef3b-edf4-4143-9a96-887dd5921711");
cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId()));
cnd.and("t.taskName", "=", "ecdaef3b-edf4-4143-9a96-887dd5921711");
cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId()));
if (approval) {
cnd.and("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode()));
} else {
cnd.and("t.taskState", "=", ProcessTaskStateEnum.DOING.getCode());
}
if (approval) {
cnd.and("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode()));
} else {
cnd.and("t.taskState", "=", ProcessTaskStateEnum.DOING.getCode());
}
if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
cnd.desc("info.createTime");
} else {
cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
}
cnd.groupBy("t.id");
sql.setCondition(cnd);
Pagination<NutMap> pageVO = condolenceService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
return Result.success(pageVO);
}
if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
cnd.desc("info.createTime");
} else {
cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
}
cnd.groupBy("t.id");
sql.setCondition(cnd);
Pagination<NutMap> pageVO = condolenceService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
return Result.success(pageVO);
}
}
@@ -8,6 +8,7 @@ import lombok.EqualsAndHashCode;
import org.nutz.dao.entity.annotation.*;
import org.nutz.dao.interceptor.annotation.PrevInsert;
import javax.validation.constraints.Size;
import java.util.List;
/**
@@ -185,4 +186,9 @@ public class Condolence extends BaseModel {
@ColDefine(type = ColType.VARCHAR, width = 30)
private String createTime;
@Column
@Comment("职务")
@ColDefine(type = ColType.VARCHAR, width = 50)
private String position;
}