ソースを参照

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

大数据与最优化研究所 1 年間 前
コミット
bd4aa7ee10

+ 8 - 0
src/main/java/com/xjrsoft/module/student/controller/StudentManagerController.java

@@ -38,6 +38,7 @@ import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.multipart.MultipartFile;
 
 import javax.validation.Valid;
 import java.util.ArrayList;
@@ -163,4 +164,11 @@ public class StudentManagerController {
         Long userId = StpUtil.getLoginIdAsLong();
         return R.ok(studentManagerService.getStudentClass(userId));
     }
+
+
+    @PostMapping("/import")
+    @ApiOperation(value = "导入学生信息")
+    public RT<Boolean> importData(@RequestParam("file") MultipartFile file){
+        return RT.ok(true);
+    }
 }

+ 13 - 25
src/main/java/com/xjrsoft/module/workflow/utils/WorkFlowUtil.java

@@ -260,36 +260,24 @@ public class WorkFlowUtil {
         String nameTemplate = workflowSchemaConfig.getProcessConfig().getNameRuleConfigs().stream().map(NameRuleConfig::getKey).map(String::valueOf).collect(Collectors.joining(StringPool.SPACE));
         String replacePlaceHolder = WorkFlowUtil.replacePlaceHolder(nameTemplate, workflowSchema, workflowSerialNumber, workflowSerialNumber);
         if(dto.getFormData() != null){
+            String nameStr = "";
             Map<String, Map<String, Object>> formData = dto.getFormData();
-            String title_last = null;
-            for (Map<String, Object> value : formData.values()) {
-                if(title_last != null){
-                    continue;
+            String[] names = replacePlaceHolder.split(" ");
+            for(int i = 0; i < names.length; i ++){
+                String name = names[i];
+                if(i == 0){
+                    nameStr += "【" + name + "】";
+                }else{
+                    nameStr += name;
                 }
-                //物品申购特殊处理
-                if(value.containsKey("wf_subscription_listList")){
-                    ArrayList<Map<String, Object>> list = (ArrayList<Map<String, Object>>) value.get("wf_subscription_listList");
-                    if(list.size() > 0){
-                        Map<String, Object> objectMap = list.get(0);
-//                        Set<String> keys = objectMap.keySet();
-                        String firstKey = "name_of_the_purchased_item";
-//                        for (String key : keys) {
-//                            if(firstKey != null){
-//                                continue;
-//                            }
-//                            firstKey = key;
-//                        }
-                        title_last = objectMap.get(firstKey).toString();
-                    }
-                }
-                for (Object o : value.values()) {
-                    if(title_last != null){
-                        continue;
+                for (Map<String, Object> value : formData.values()) {
+                    if(value.containsKey(name)){
+                        nameStr = nameStr.replace(name, value.get(name).toString());
                     }
-                    title_last = o.toString();
                 }
             }
-            return "【" + replacePlaceHolder + "】" + title_last;
+
+            return nameStr;
         }
         return replacePlaceHolder;
     }