瀏覽代碼

员工列表创建时间,公司名称

lyhzzz 2 年之前
父節點
當前提交
ee612ca47b

+ 2 - 0
src/main/java/com/fdkankan/manage_jp/common/Constant.java

@@ -10,6 +10,8 @@ public class Constant {
 
 
     public static final String DEFAULT_AGENT = "4dage";
     public static final String DEFAULT_AGENT = "4dage";
 
 
+    public static final String AGENT_PATH = "/mnt/4Dkankan/agent/";
+
 
 
     public static String AUDIT_COMPANY_EMAIL_SUBJECT="エンタープライズ認証監査結果のフィードバック";
     public static String AUDIT_COMPANY_EMAIL_SUBJECT="エンタープライズ認証監査結果のフィードバック";
 }
 }

+ 36 - 0
src/main/java/com/fdkankan/manage_jp/controller/UploadController.java

@@ -0,0 +1,36 @@
+package com.fdkankan.manage_jp.controller;
+
+import com.fdkankan.fyun.face.FYunFileServiceInterface;
+import com.fdkankan.manage_jp.common.Constant;
+import com.fdkankan.manage_jp.common.Result;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+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 java.io.File;
+import java.io.IOException;
+
+@RestController
+@RequestMapping("/manage_jp/file")
+public class UploadController {
+
+    @Autowired
+    FYunFileServiceInterface fYunFileServiceInterface;
+
+    @PostMapping("/uploadImg")
+    public Result uploadImg(@RequestParam("file") MultipartFile file) throws IOException {
+        Long date = System.currentTimeMillis();
+        String fileName = date + file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."));
+        String filePath = Constant.AGENT_PATH + "company/" + File.separator + fileName;
+        File targetFile = new File(filePath);
+        if(!targetFile.getParentFile().exists()){
+            targetFile.getParentFile().mkdirs();
+        }
+        file.transferTo(targetFile);
+        String url = fYunFileServiceInterface.uploadFile(filePath,"img/".concat(fileName));
+        return Result.success("",url);
+    }
+}

+ 6 - 0
src/main/java/com/fdkankan/manage_jp/service/impl/UserServiceImpl.java

@@ -167,6 +167,12 @@ public class UserServiceImpl extends ServiceImpl<IUserMapper, User> implements I
                 Role role = roleService.getById(userRoleList.get(0).getRoleId());
                 Role role = roleService.getById(userRoleList.get(0).getRoleId());
                 vo.setRoleName(role.getRoleName());
                 vo.setRoleName(role.getRoleName());
             }
             }
+            if(record.getCompanyId() != null){
+                Company company = companyService.getById(record.getCompanyId());
+                if(company != null){
+                    vo.setCompanyName(company.getCompanyName());
+                }
+            }
             userVos.add(vo);
             userVos.add(vo);
         }
         }
         Page<UserVo> pageVo = new Page<>(param.getPage(),param.getLimit());
         Page<UserVo> pageVo = new Page<>(param.getPage(),param.getLimit());

+ 6 - 0
src/main/java/com/fdkankan/manage_jp/vo/response/UserVo.java

@@ -35,4 +35,10 @@ public class UserVo {
 
 
     private String roleName;
     private String roleName;
 
 
+    private String createTime;
+
+    private Long companyId;
+
+    private String companyName;
+
 }
 }