Browse Source

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

dzx 4 weeks ago
parent
commit
ea8570ade2

+ 13 - 0
src/main/java/com/xjrsoft/module/form/controller/FormExecuteController.java

@@ -11,6 +11,7 @@ import com.xjrsoft.common.constant.GlobalConstant;
 import com.xjrsoft.common.exception.MyException;
 import com.xjrsoft.common.handler.FormContentStyleStrategy;
 import com.xjrsoft.common.model.result.R;
+import com.xjrsoft.common.model.result.RT;
 import com.xjrsoft.common.utils.DatasourceUtil;
 import com.xjrsoft.common.utils.LocalDateTimeUtil;
 import com.xjrsoft.module.authority.dto.BatchSetDataAuthDto;
@@ -35,6 +36,7 @@ import com.xjrsoft.module.form.service.IFormTemplateService;
 import com.xjrsoft.module.generator.constant.ComponentTypeConstant;
 import com.xjrsoft.module.generator.entity.ColumnConfig;
 import com.xjrsoft.module.generator.entity.TableConfig;
+import com.xjrsoft.module.student.service.IStudentConsumeDateService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.AllArgsConstructor;
@@ -84,6 +86,7 @@ public class FormExecuteController {
     private final IFormReleaseService formReleaseService;
     
     private final IFormTemplateService formTemplateService;
+    private final IStudentConsumeDateService studentConsumeDateService;
 
     /**
      * 自定义表单 根据配置获取列表数据 不分页
@@ -305,6 +308,16 @@ public class FormExecuteController {
     @PostMapping("/import")
     @ApiOperation(value = "导入")
     public R importData(@RequestParam String releaseId, @RequestParam MultipartFile file) throws IOException {
+
+        if( "1815674695242059776".equals(releaseId)) {
+            String result = studentConsumeDateService.excelImport(file);
+            if (result.length() > 0) {
+                throw new MyException(result);
+            }
+
+            return R.ok("全部成功", true);
+        }
+
         FormRelease formRelease = formReleaseService.getById(releaseId);
         FormReleaseConfig formReleaseConfig = JSONUtil.toBean(formRelease.getConfigJson(), FormReleaseConfig.class);
         // 配置excel第一行字段名