diff --git a/src/main/java/com/budwk/app/zhgh/activity/declarereimbursement/declare/controller/ActivityDeclareMineController.java b/src/main/java/com/budwk/app/zhgh/activity/declarereimbursement/declare/controller/ActivityDeclareMineController.java index 62952dd..54d0158 100644 --- a/src/main/java/com/budwk/app/zhgh/activity/declarereimbursement/declare/controller/ActivityDeclareMineController.java +++ b/src/main/java/com/budwk/app/zhgh/activity/declarereimbursement/declare/controller/ActivityDeclareMineController.java @@ -32,6 +32,7 @@ import com.deepoove.poi.config.Configure; import com.deepoove.poi.plugin.table.LoopRowTableRenderPolicy; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; +import org.ddr.poi.html.HtmlRenderPolicy; import org.nutz.aop.interceptor.ioc.TransAop; import org.nutz.dao.Cnd; import org.nutz.dao.Dao; @@ -132,7 +133,6 @@ public class ActivityDeclareMineController { } else { cnd.orderBy("info." + pageParam.getPageOrderName(), PageUtil.getOrder(pageParam.getPageOrderBy())); } - cnd.groupBy("info.id"); sql.setCondition(cnd); Pagination pagination = activityDeclareService.listPageMap(pageParam.getPageNumber(), pageParam.getPageSize(), sql); return Result.success().addData(pagination); @@ -278,11 +278,15 @@ public class ActivityDeclareMineController { docData.put("budgets", list); LoopRowTableRenderPolicy policy = new LoopRowTableRenderPolicy(); + HtmlRenderPolicy htmlRenderPolicy = new HtmlRenderPolicy(); + htmlRenderPolicy.getConfig().setShowDefaultTableBorderInTableCell(true); + Configure config = Configure.builder() .bind("budgets", policy) + .bind("info.activityContent", htmlRenderPolicy) .build(); - String fileName = Globals.AppName + "【" + info.getString("activityName") + "】申报表.docx"; + String fileName = "【" + info.getString("activityName") + "】申报表.docx"; try (ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream()) { XWPFTemplate.compile(sysOfficeTemplateUtil.getTemplate("activity_declare"), config).render(docData).writeAndClose(byteArrayOutputStream); diff --git a/src/main/java/com/budwk/app/zhgh/activity/declarereimbursement/reimbursement/controller/ActivityReimbursementApplyController.java b/src/main/java/com/budwk/app/zhgh/activity/declarereimbursement/reimbursement/controller/ActivityReimbursementApplyController.java index edc14c0..7ad3436 100644 --- a/src/main/java/com/budwk/app/zhgh/activity/declarereimbursement/reimbursement/controller/ActivityReimbursementApplyController.java +++ b/src/main/java/com/budwk/app/zhgh/activity/declarereimbursement/reimbursement/controller/ActivityReimbursementApplyController.java @@ -226,13 +226,22 @@ public class ActivityReimbursementApplyController { reiDecIdList = reiDecIdList.stream().filter(v -> StrUtil.isNotBlank(v)).toList(); Cnd cnd = Cnd.NEW(); - cnd.and("outlayManageSource", "=", outlayManageSource); + cnd.and("info.outlayManageSource", "=", outlayManageSource); if (Objects.equals(outlayManageSource, "ACTIVITY_BUDGET_TYPE_TWO")) { - cnd.and("unionId", "=", SecurityUtil.getUnionId()); + cnd.and("info.unionId", "=", SecurityUtil.getUnionId()); } else if (Objects.equals(outlayManageSource, "ACTIVITY_BUDGET_TYPE_THREE")) { - cnd.and("clubId", "=", clubId); + cnd.and("info.clubId", "=", clubId); } - Sql sql = Sqls.create("select declareId from activity_reimbursement_info $condition"); + cnd.and("ins.state", "in", List.of(10, 20)); + + Sql sql = Sqls.create(""" + SELECT + info.declareId + FROM + activity_reimbursement_info info + LEFT JOIN wf_process_instance ins ON ins.businessNo = info.id + $condition + """); sql.setCondition(cnd); sql.setCallback(Sqls.callback.strList()); dao.execute(sql); @@ -249,7 +258,6 @@ public class ActivityReimbursementApplyController { $condition """); Cnd applyCnd = Cnd.NEW(); - if (Objects.equals(outlayManageSource, "ACTIVITY_BUDGET_TYPE_TWO")) { applyCnd.and("info.unionId", "=", SecurityUtil.getUnionId()); activityType = "BRANCH_UNION"; diff --git a/src/main/java/com/budwk/app/zhgh/democratic/executiveCommittee/controller/ExecutiveCommitteePushController.java b/src/main/java/com/budwk/app/zhgh/democratic/executiveCommittee/controller/ExecutiveCommitteePushController.java index 610c901..7d0b5a9 100644 --- a/src/main/java/com/budwk/app/zhgh/democratic/executiveCommittee/controller/ExecutiveCommitteePushController.java +++ b/src/main/java/com/budwk/app/zhgh/democratic/executiveCommittee/controller/ExecutiveCommitteePushController.java @@ -140,7 +140,7 @@ public class ExecutiveCommitteePushController { ExecutiveCommitteeConfig config = dao.fetch(ExecutiveCommitteeConfig.class, Cnd.where("teacherMeetId", "=", teacherMeetId)); - /* if (ObjectUtil.isEmpty(config)) { + if (ObjectUtil.isEmpty(config)) { return Result.error("请先配置基础信息"); } if (config.getFirstStartTime().getTime() > System.currentTimeMillis()) { @@ -148,7 +148,7 @@ public class ExecutiveCommitteePushController { } if (config.getFirstEndTime().getTime() < System.currentTimeMillis()) { return Result.error("一次预选已结束"); - }*/ + } int dbCount = dao.count(ExecutiveCommitteeOnePush.class, Cnd.where("teacherMeetId", "=", teacherMeetId) @@ -206,6 +206,9 @@ public class ExecutiveCommitteePushController { if (ObjectUtil.isEmpty(config)) { return Result.error("请先配置基础信息"); } + if (config.getFirstEndTime().getTime() < System.currentTimeMillis()) { + return Result.error("预选已结束不能删除!"); + } int num = dao.clear(ExecutiveCommitteeOnePush.class, Cnd.where("id", "=", id)); return num >= 0 ? Result.success() : Result.error(); } diff --git a/src/main/java/com/budwk/app/zhgh/democratic/proposal/service/common/ProposalCommonServiceImpl.java b/src/main/java/com/budwk/app/zhgh/democratic/proposal/service/common/ProposalCommonServiceImpl.java index cf77bd9..5f1b98e 100644 --- a/src/main/java/com/budwk/app/zhgh/democratic/proposal/service/common/ProposalCommonServiceImpl.java +++ b/src/main/java/com/budwk/app/zhgh/democratic/proposal/service/common/ProposalCommonServiceImpl.java @@ -29,6 +29,7 @@ import com.budwk.app.zhgh.democratic.proposal.models.ProposalConsolidation; import com.budwk.app.zhgh.democratic.proposal.models.ProposalInfo; import com.budwk.app.zhgh.democratic.proposal.models.ProposalMerge; import com.budwk.app.zhgh.democratic.proposal.models.ProposalUndertake; +import com.budwk.app.zhgh.democratic.proposal.param.ProposalQueryComprehensiveParam; import com.budwk.app.zhgh.democratic.teachercongress.prepare.models.Teacher_congress_session; import com.deepoove.poi.XWPFTemplate; import com.deepoove.poi.config.Configure; @@ -436,18 +437,18 @@ public class ProposalCommonServiceImpl extends BaseServiceImpl imp return delegationIds; } - @Override - public ProposalUndertake getSelfManageUndertake() { - Sys_role role = sysRoleService.getByCode(RoleConstant.PROPOSAL_UNIT_LEADER.name()); - Sys_user_role userRole = dao().fetch(Sys_user_role.class, Cnd.where(Sys_user_role::getRoleId, "=", role.getId()) - .and(Sys_user_role::getUserId, "=", SecurityUtil.getUserId())); - if(Lang.isEmpty(userRole)) { - throw new RuntimeException("当前登录用户不是" + role.getName()); - } - return dao().fetch(ProposalUndertake.class, Cnd.where(ProposalUndertake::getId, "=", userRole.getUnderTakeId())); - } + @Override + public ProposalUndertake getSelfManageUndertake() { + Sys_role role = sysRoleService.getByCode(RoleConstant.PROPOSAL_UNIT_LEADER.name()); + Sys_user_role userRole = dao().fetch(Sys_user_role.class, Cnd.where(Sys_user_role::getRoleId, "=", role.getId()) + .and(Sys_user_role::getUserId, "=", SecurityUtil.getUserId())); + if (Lang.isEmpty(userRole)) { + throw new RuntimeException("当前登录用户不是" + role.getName()); + } + return dao().fetch(ProposalUndertake.class, Cnd.where(ProposalUndertake::getId, "=", userRole.getUnderTakeId())); + } - @Override + @Override public List getConsolidation(String id) { ProposalConsolidation consolidation = dao().fetch(ProposalConsolidation.class, Cnd.where(new Static("JSON_CONTAINS(consolidationIds,'\"" + id + "\"')"))); if (ObjectUtil.isNotEmpty(consolidation)) { @@ -462,6 +463,7 @@ public class ProposalCommonServiceImpl extends BaseServiceImpl imp Teacher_congress_session session = dao().fetch(Teacher_congress_session.class, sessionId); docData.put("sessionName", session.getFullName()); + docData.put("startDate", DateUtil.format(session.getStartDate(), "yyyy年MM月dd日")); Sql sql = Sqls.create(""" SELECT @@ -489,26 +491,43 @@ public class ProposalCommonServiceImpl extends BaseServiceImpl imp docData.put("notCaseFilingSum", list.stream().filter(v -> StrUtil.isNotBlank(v.getString("caseFilingResult")) && v.getString("caseFilingResult").equals("NOT")).count()); Set underTakeNames = new HashSet<>(); - Sql caseUnitSql = Sqls.create(""" SELECT - task.extVariable + info.*, + IF(mer.proposalId IS NOT NULL, 1, 0) AS merge, + type.name AS typeName, + tcs.fullName AS sessionName, + tcd.`name` AS delegationName, + ins.id AS instanceId, + ins.businessNo, + ins.state instanceState, + ins.variable instanceVariable, + ins.processDefineId instanceProcessDefineId, + t.displayName curTaskName, + GROUP_CONCAT(DISTINCT CASE WHEN pru.isMaster = 1 THEN pru.unitName END) AS masterUnitName, + GROUP_CONCAT(DISTINCT CASE WHEN pru.isMaster = 0 THEN pru.unitName END) AS slaveUnitNames FROM - bpm_process_task task - INNER JOIN ( SELECT processInstanceId, MAX( endOn ) AS maxEndOn FROM bpm_process_task WHERE processTaskNodeCode = 70 AND taskStatus = 'COMPLETE' GROUP BY processInstanceId ) latestTask ON task.processInstanceId = latestTask.processInstanceId\s - AND task.endOn = latestTask.maxEndOn - LEFT JOIN bpm_process_instance inst ON inst.id = task.processInstanceId - WHERE - inst.processInstanceBusinessId IN (@businessIds) - """); - caseUnitSql.setParam("businessIds", list.stream().map(v -> v.getString("id")).toList()); + proposal_info info + LEFT JOIN proposal_type type on type.id = info.typeId + LEFT JOIN proposal_merge mer ON mer.proposalId = info.id + LEFT JOIN teacher_congress_session tcs on tcs.id = info.sessionId + LEFT JOIN teacher_congress_delegation tcd on tcd.id = info.delegationId + LEFT JOIN teacher_congress_delegate tcde on tcde.loginName = info.createUserLoginName + LEFT JOIN wf_process_instance ins ON ins.businessNo = info.id + LEFT JOIN wf_process_task t ON t.processInstanceId = ins.id AND t.taskState = 10 + LEFT JOIN proposal_reply_unit pru ON pru.proposalId = info.id + WHERE info.sessionId=@sessionId GROUP BY info.id + """).setParam("sessionId", sessionId); List caseUnitList = listMap(caseUnitSql); for (NutMap v : caseUnitList) { - JSONObject extVariable = Json.fromJson(JSONObject.class, v.getString("extVariable")); - String hostUnitName = extVariable.getStr("hostUnit"); - List helpUnitNames = extVariable.getBeanList("helpUnits", String.class); - underTakeNames.add(hostUnitName); - underTakeNames.addAll(helpUnitNames); + String hostUnitName = v.getString("masterUnitName"); + if (StrUtil.isNotBlank(hostUnitName)){ + underTakeNames.add(hostUnitName); + } + if (StrUtil.isNotBlank(v.getString("slaveUnitNames"))){ + List helpUnitNames = Arrays.asList(v.getString("slaveUnitNames").split("、")); + underTakeNames.addAll(helpUnitNames); + } } //承办单位数量 @@ -519,7 +538,7 @@ public class ProposalCommonServiceImpl extends BaseServiceImpl imp //提案办理的详细情况 Sql transactSql = Sqls.create(""" SELECT - concat( type.`name`, '(', type.CODE, ')' ) AS typeName, + type.`name` AS typeName, count( info.id ) AS sum, count(case when info.caseFilingResult = 'CONFIRM_FILING' then info.id end) confirmFilingCount, count(case when info.caseFilingResult = 'SUGGESTION' then info.id end) suggestionCount, @@ -536,6 +555,13 @@ public class ProposalCommonServiceImpl extends BaseServiceImpl imp transactSql.setParam("sessionId", sessionId); List transactList = listMap(transactSql); + docData.put("typesSummary", transactList.stream() + .map(proposal -> proposal.getString("typeName") + ": " + proposal.getInt("sum") + "条") + .collect(Collectors.joining(","))); + docData.put("typeNames", transactList.stream() + .map(proposal -> proposal.getString("typeName")) + .collect(Collectors.joining(","))); + int sum = transactList.stream().mapToInt(v -> v.getInt("sum")).sum(); docData.put("transactSum", sum); docData.put("transactConfirmFilingSum", transactList.stream().mapToInt(v -> v.getInt("confirmFilingCount")).sum()); diff --git a/src/main/java/com/budwk/app/zhgh/democratic/teachercongress/delegate/service/TeacherCongressDelegatePushServiceImpl.java b/src/main/java/com/budwk/app/zhgh/democratic/teachercongress/delegate/service/TeacherCongressDelegatePushServiceImpl.java index f8d1cc2..fd20d14 100644 --- a/src/main/java/com/budwk/app/zhgh/democratic/teachercongress/delegate/service/TeacherCongressDelegatePushServiceImpl.java +++ b/src/main/java/com/budwk/app/zhgh/democratic/teachercongress/delegate/service/TeacherCongressDelegatePushServiceImpl.java @@ -190,6 +190,7 @@ public class TeacherCongressDelegatePushServiceImpl extends BaseServiceImpl { + debugger const formData = { ...this.formData, submitType: val @@ -207,7 +209,7 @@ layout("/layouts/platform_h5.html"){ // 不满意 if (this.formData.tf_feedback === 'DISSATISFIED') { const caseInfo = await this.getCaseInfo(this.formData.instanceId) - formData.tf_hostUnitId = caseInfo.tf_hostUnitId + formData.tf_masterUnitId = caseInfo.tf_masterUnitId } this.$axios.post("/flow/common/executeTask", { @@ -226,7 +228,16 @@ layout("/layouts/platform_h5.html"){ } }, - +// 获取立案信息 + async getCaseInfo(instId) { + const { + data, + code + } = await this.$axios.post('/platform/proposal/feedbackEvaluation/caseInfo', {instId}) + if (code === 0) { + return data + } + }, onRevoke(row) { this.$dialog.confirm({ title: "提示",