home il y a 2 ans
Parent
commit
f7510a5231

+ 7 - 0
hx-common/common-tool/src/main/java/com/fjhx/base/BaseService.java

@@ -71,6 +71,13 @@ public interface BaseService<T> extends IService<T> {
     /**
      * 条件查询
      */
+    default List<Map<String, Object>> listMaps(SFunction<T, ?> column, Object val) {
+        return listMaps(Wrappers.<T>lambdaQuery().eq(column, val));
+    }
+
+    /**
+     * 条件查询
+     */
     default T getOne(SFunction<T, ?> column, Object val) {
         return lambdaQuery().eq(column, val).last("limit 1").one();
     }

+ 1 - 1
hx-common/common-tool/src/main/java/com/fjhx/utils/HxUtils.java → hx-common/common-tool/src/main/java/com/fjhx/utils/HxUtil.java

@@ -9,7 +9,7 @@ import java.util.Objects;
 import java.util.StringJoiner;
 import java.util.stream.Collectors;
 
-public class HxUtils {
+public class HxUtil {
 
     /**
      * list转str,用,拼接

+ 4 - 4
hx-common/common-tool/src/main/java/com/fjhx/utils/TreeUtil.java

@@ -70,13 +70,13 @@ public class TreeUtil {
         List<Object> tempIdValue = new ArrayList<>();
 
         for (T t : objList) {
-            Object idValue = HxUtils.reflectGet(t, idName);
+            Object idValue = HxUtil.reflectGet(t, idName);
             tempIdValue.add(idValue);
 
             Map<String, Object> tempMap = new HashMap<>();
             tempMap.put(ID_NAME, idValue);
-            tempMap.put(LABEL_NAME, HxUtils.reflectGet(t, labelName));
-            tempMap.put(PARENT_ID_NAME, HxUtils.reflectGet(t, parentIdName));
+            tempMap.put(LABEL_NAME, HxUtil.reflectGet(t, labelName));
+            tempMap.put(PARENT_ID_NAME, HxUtil.reflectGet(t, parentIdName));
             tempMapList.add(tempMap);
         }
 
@@ -149,7 +149,7 @@ public class TreeUtil {
                 //设置是否允许访问,不是修改原来的访问权限修饰词。
                 field.setAccessible(true);
                 String key = field.getName();
-                Object value = HxUtils.reflectGet(object, key);
+                Object value = HxUtil.reflectGet(object, key);
 
                 if (key.equals(idName) && ObjectUtil.isNotEmpty(value)) {
                     idSet.add(value);

+ 16 - 5
hx-common/service-flow/src/main/java/com/fjhx/controller/example/ExampleInfoController.java

@@ -1,11 +1,17 @@
 package com.fjhx.controller.example;
 
+import com.fjhx.entity.example.ExampleInfo;
 import com.fjhx.service.example.ExampleInfoService;
 import org.springblade.core.tool.api.R;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import java.util.List;
+import java.util.Map;
+
 /**
  * <p>
  * 流程实例 前端控制器
@@ -21,11 +27,16 @@ public class ExampleInfoController {
     @Autowired
     private ExampleInfoService exampleInfoService;
 
-//    @Autowired
-//    public R serviceNameList() {
-//
-//        return R.data();
-//    }
+    /**
+     * 审批记录
+     */
+    @PostMapping("/record")
+    public R record(@RequestBody ExampleInfo exampleInfo) {
+
+        List<Map<String, Object>> result = exampleInfoService.record(exampleInfo.getFlowLinkNo());
+
+        return R.data(result);
+    }
 
 
 }

+ 5 - 0
hx-common/service-flow/src/main/java/com/fjhx/service/example/ExampleInfoService.java

@@ -3,6 +3,9 @@ package com.fjhx.service.example;
 import com.fjhx.base.BaseService;
 import com.fjhx.entity.example.ExampleInfo;
 
+import java.util.List;
+import java.util.Map;
+
 /**
  * <p>
  * 流程实例 服务类
@@ -13,4 +16,6 @@ import com.fjhx.entity.example.ExampleInfo;
  */
 public interface ExampleInfoService extends BaseService<ExampleInfo> {
 
+    List<Map<String, Object>> record(Long flowLinkNo);
+
 }

+ 35 - 0
hx-common/service-flow/src/main/java/com/fjhx/service/example/impl/ExampleInfoServiceImpl.java

@@ -1,15 +1,23 @@
 package com.fjhx.service.example.impl;
 
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fjhx.base.BaseEntity;
+import com.fjhx.entity.example.ExampleDetails;
 import com.fjhx.entity.example.ExampleInfo;
 import com.fjhx.mapper.example.ExampleInfoMapper;
+import com.fjhx.service.example.ExampleDetailsService;
 import com.fjhx.service.example.ExampleInfoService;
 import com.fjhx.service.process.ProcessInfoService;
 import com.fjhx.service.process.ProcessNodeButtonService;
 import com.fjhx.service.process.ProcessTenantService;
+import com.fjhx.utils.Assert;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
+import java.util.Map;
+
 /**
  * <p>
  * 流程实例 服务实现类
@@ -30,4 +38,31 @@ public class ExampleInfoServiceImpl extends ServiceImpl<ExampleInfoMapper, Examp
     @Autowired
     private ProcessNodeButtonService processNodeButtonService;
 
+    @Autowired
+    private ExampleDetailsService exampleDetailsService;
+
+    @Override
+    public List<Map<String, Object>> record(Long flowLinkNo) {
+        Assert.notEmpty(flowLinkNo, "业务关联编码不能为空");
+
+        ExampleInfo exampleInfo = getOne(ExampleInfo::getFlowLinkNo, flowLinkNo);
+
+        // 查询已处理节点
+        List<Map<String, Object>> list = exampleDetailsService.listMaps(
+                Wrappers.<ExampleDetails>query()
+                        .select("handle_user_id userId", // 处理人id
+                                "remarks", // 审批意见
+                                "process_node_id nodeId", // 节点id
+                                "name_type type" // 处理类型
+                        )
+                        .lambda()
+                        .eq(ExampleDetails::getExampleInfoId, exampleInfo.getId())
+                        .orderByAsc(BaseEntity::getId)
+        );
+
+        // 查询为处理节点
+
+
+        return null;
+    }
 }