Browse Source

Merge remote-tracking branch 'origin/dev' into dev

fanxp 1 week ago
parent
commit
52056bf64a

+ 6 - 0
src/main/java/com/xjrsoft/module/evaluate/dto/AddEvaluateItemDto.java

@@ -49,4 +49,10 @@ public class AddEvaluateItemDto implements Serializable {
     @ApiModelProperty("输入框是否为空")
     private Integer inputNotNull;
 
+    @ApiModelProperty("题目类型")
+    private String type;
+
+    @ApiModelProperty("选项内容")
+    private String optionJson;
+
 }

+ 6 - 0
src/main/java/com/xjrsoft/module/evaluate/entity/EvaluateItem.java

@@ -100,5 +100,11 @@ public class EvaluateItem implements Serializable {
     @ApiModelProperty("输入框是否为空")
     private Integer inputNotNull;
 
+    @ApiModelProperty("题目类型")
+    private String type;
+
+    @ApiModelProperty("选项内容")
+    private String optionJson;
+
 
 }

+ 6 - 0
src/main/java/com/xjrsoft/module/evaluate/entity/EvaluateManageItem.java

@@ -105,4 +105,10 @@ public class EvaluateManageItem implements Serializable {
      */
     @ApiModelProperty("评价项编号")
     private Long evaluateItemId;
+
+    @ApiModelProperty("题目类型")
+    private String type;
+
+    @ApiModelProperty("选项内容")
+    private String optionJson;
 }

+ 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;
 }

+ 4 - 0
src/main/java/com/xjrsoft/module/evaluate/vo/EvaluateItemVo.java

@@ -49,5 +49,9 @@ public class EvaluateItemVo {
     private Integer inputNotNull;
 
 
+    @ApiModelProperty("题目类型")
+    private String type;
 
+    @ApiModelProperty("选项内容")
+    private String optionJson;
 }

+ 6 - 0
src/main/java/com/xjrsoft/module/evaluate/vo/EvaluateManageItemVo.java

@@ -63,4 +63,10 @@ public class EvaluateManageItemVo {
     @ApiModelProperty("建议/意见")
     private String opinion;
 
+    @ApiModelProperty("题目类型")
+    private String type;
+
+    @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;
+                            }
+                        }
+
+                    });
+                }
+            });
+        }
+    }
+}

+ 3 - 1
src/main/java/com/xjrsoft/module/personnel/controller/BasePersonnelLabourCapitalController.java

@@ -182,7 +182,9 @@ public class BasePersonnelLabourCapitalController {
             data.setIdType(datatMap.get(0) == null?null:datatMap.get(0).toString());
             data.setAmountTo(datatMap.get(4) == null?null:datatMap.get(4).toString());
             data.setJobNumber(datatMap.get(2) == null?null:datatMap.get(2).toString());
-            data.setExtendJson(JsonUtil.toJsonString(datatMap));
+            String jsonString = JsonUtil.toJsonString(datatMap);
+            jsonString = jsonString.replaceAll("- 0", "-");
+            data.setExtendJson(jsonString);
             resultList.add(data);
         }
 

+ 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

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

@@ -16,8 +16,8 @@
             base_personnel_labour_capital t
                 LEFT JOIN base_personnel_labour_capital_data t1 ON t1.labour_capital_id = t.id
                 LEFT JOIN xjr_user u ON t1.job_number = u.user_name
-                LEFT JOIN wf_teacher_depart w ON u.id = w.create_user_id
-                LEFT JOIN xjr_department d ON w.dept_name = d.id
+                LEFT JOIN xjr_user_dept_relation w ON u.id = w.user_id
+                LEFT JOIN xjr_department d ON w.dept_id = d.id
         WHERE t.delete_mark = 0
         <if test="dto.year != null and dto.month != null">
             and YEAR(t.date_of_issue) = #{dto.year}
@@ -35,12 +35,12 @@
             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
-                 LEFT JOIN wf_teacher_depart w ON u.id = w.create_user_id
-                 LEFT JOIN xjr_department d ON w.dept_name = d.id
+                 LEFT JOIN xjr_user_dept_relation w ON u.id = w.user_id
+                 LEFT JOIN xjr_department d ON w.dept_id = d.id
                  LEFT JOIN base_personnel_labour_capital_title bp ON bp.labour_capital_id = t.id
         WHERE
             t.delete_mark = 0