dzx пре 1 недеља
родитељ
комит
4ff37703ee

+ 3 - 0
src/main/java/com/xjrsoft/module/evaluate/entity/EvaluateResult.java

@@ -104,4 +104,7 @@ public class EvaluateResult implements Serializable {
      */
     @ApiModelProperty("提交记录主键编号")
     private String submitRecordId;
+
+    @ApiModelProperty("选项内容")
+    private String optionJson;
 }

+ 3 - 0
src/main/java/com/xjrsoft/module/evaluate/vo/EvaluateResultDetailPageDetailList.java

@@ -43,4 +43,7 @@ public class EvaluateResultDetailPageDetailList {
     @ApiModelProperty("建议/意见")
     private String opinion;
 
+    @ApiModelProperty("选项内容")
+    private String optionJson;
+
 }

+ 81 - 0
src/main/java/com/xjrsoft/module/liteflow/node/WfUpdateStateNode.java

@@ -0,0 +1,81 @@
+package com.xjrsoft.module.liteflow.node;
+
+import cn.hutool.core.convert.Convert;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.xjrsoft.common.enums.WorkflowApproveType;
+import com.xjrsoft.module.schedule.entity.WfCourseAdjust;
+import com.xjrsoft.module.student.service.IBaseStudentAssessmentClassRelationService;
+import com.xjrsoft.module.workflow.entity.WorkflowRecord;
+import com.xjrsoft.module.workflow.mapper.WorkflowRecordMapper;
+import com.xjrsoft.module.workflow.service.IWorkflowExecuteService;
+import com.yomahub.liteflow.core.NodeComponent;
+import org.apache.commons.lang.StringUtils;
+import org.camunda.bpm.engine.history.HistoricProcessInstance;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import org.springframework.transaction.support.TransactionSynchronization;
+import org.springframework.transaction.support.TransactionSynchronizationManager;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.concurrent.CompletableFuture;
+
+/**
+ * 学生班级巡查考核流程结束处理
+ */
+@Component("wf_approve_type_node")
+public class WfUpdateStateNode extends NodeComponent {
+
+    @Autowired
+    private WorkflowRecordMapper workflowRecordMapper;
+
+    @Autowired
+    private IWorkflowExecuteService workflowExecuteService;
+
+
+    @Override
+    public void process() throws Exception {
+        // 获取表单中数据编号
+        Map<String, Object> params = this.getFirstContextBean();
+        Object value = util.getFormDatKey(params, "id");
+        Long formId = Convert.toLong(value);
+        Object processInstanceId = params.get("processInstanceId");
+        if (processInstanceId == null) {
+            return;
+        }
+        String processInstanceIdStr = Convert.toStr(processInstanceId);
+        if (formId != null && StringUtils.isNotEmpty(processInstanceIdStr)) {
+            TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronization() {
+                @Override
+                public void afterCommit() {
+                    CompletableFuture.runAsync(() -> {
+                        Optional<HistoricProcessInstance> historicProcessInstanceOptional = workflowExecuteService.getHistoricProcessInstance(processInstanceId.toString());
+
+                        if (historicProcessInstanceOptional.isEmpty()) {
+                            return;
+                        }
+                        HistoricProcessInstance historicProcessInstance = historicProcessInstanceOptional.get();
+                        if (!historicProcessInstance.getState().equals(HistoricProcessInstance.STATE_ACTIVE)) {
+                            // 获取流程记录中的非正常结束
+                            LambdaQueryWrapper<WorkflowRecord> workflowRecordLambdaQueryWrapper = new LambdaQueryWrapper<>();
+                            workflowRecordLambdaQueryWrapper
+                                    .and(wq -> wq.eq(WorkflowRecord::getWorkflowApproveType, WorkflowApproveType.DISAGREE.getCode())
+                                            .or()
+                                            .eq(WorkflowRecord::getWorkflowApproveType, WorkflowApproveType.WITHDRAW.getCode())
+                                    )
+                                    .eq(WorkflowRecord::getProcessId, processInstanceId)
+                            ;
+                            List<WorkflowRecord> workflowRecordList = workflowRecordMapper.selectList(workflowRecordLambdaQueryWrapper);
+
+                            if (!workflowRecordList.isEmpty()) {
+                                return;
+                            }
+                        }
+
+                    });
+                }
+            });
+        }
+    }
+}

+ 1 - 1
src/main/resources/mapper/evaluate/EvaluateResultMapper.xml

@@ -123,7 +123,7 @@
             t.problem,
             t.topic,
             t1.score as actualScore,
-            t1.opinion
+            t1.opinion,t1.option_json
         from evaluate_manage_item t
                  left join evaluate_result t1 on t1.evaluate_item_id = t.id
         where t.delete_mark = 0

+ 1 - 1
src/main/resources/mapper/personnel/BasePersonnelLabourCapitalMapper.xml

@@ -35,7 +35,7 @@
             month(t1.date_of_issue) as month,
             t.amount_to as amount,
             SUM(replace(t.amount_to,',','')) OVER (PARTITION BY t.create_user_id, MONTH(t1.date_of_issue)) as monthAmount,
-            (SELECT SUM(replace(amount_to,',','')) FROM base_personnel_labour_capital_data WHERE name = t.name) as yearAmount
+            (SELECT SUM(REPLACE(amount_to,',','')) FROM base_personnel_labour_capital_data WHERE NAME = t.name AND job_number = t.job_number AND delete_mark = 0) AS yearAmount
         from base_personnel_labour_capital_data t
                  LEFT JOIN base_personnel_labour_capital t1 ON t.labour_capital_id = t1.id
                  LEFT JOIN xjr_user u ON t.job_number = u.user_name