|
@@ -0,0 +1,108 @@
|
|
|
|
+package com.qunzhixinxi.hnqz.admin.oe.controller;
|
|
|
|
+
|
|
|
|
+import cn.hutool.core.map.MapUtil;
|
|
|
|
+import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
+import com.beust.jcommander.internal.Maps;
|
|
|
|
+import com.qunzhixinxi.hnqz.admin.oe.entity.dto.OeTeamRequest;
|
|
|
|
+import com.qunzhixinxi.hnqz.admin.oe.entity.dto.OeTenantRequest;
|
|
|
|
+import com.qunzhixinxi.hnqz.admin.oe.entity.vo.OeTeamVO;
|
|
|
|
+import com.qunzhixinxi.hnqz.admin.oe.entity.vo.OeTenantVO;
|
|
|
|
+import com.qunzhixinxi.hnqz.common.core.util.R;
|
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
+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.time.LocalDateTime;
|
|
|
|
+import java.util.ArrayList;
|
|
|
|
+import java.util.HashMap;
|
|
|
|
+import java.util.List;
|
|
|
|
+import java.util.Map;
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * oe团队管理控制器
|
|
|
|
+ *
|
|
|
|
+ * @author lixuesong
|
|
|
|
+ * @date 2023/08/08
|
|
|
|
+ */
|
|
|
|
+@Slf4j
|
|
|
|
+@RestController
|
|
|
|
+@RequestMapping("/oe/team")
|
|
|
|
+public class OeTeamController {
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 分页查询团队
|
|
|
|
+ *
|
|
|
|
+ * @param page 分页参数
|
|
|
|
+ * @return {@link R}<{@link IPage}<{@link OeTeamVO}>>
|
|
|
|
+ */
|
|
|
|
+ @GetMapping("/page")
|
|
|
|
+ public R<IPage<OeTeamVO>> pageTeam(Page<OeTeamVO> page) {
|
|
|
|
+ int total = 20;
|
|
|
|
+ List<OeTeamVO> list = new ArrayList<>();
|
|
|
|
+ for (int i = Math.toIntExact(page.getCurrent()); i <= page.getSize() && i <= total; i++) {
|
|
|
|
+ OeTeamVO vo = new OeTeamVO();
|
|
|
|
+ vo.setId((long) i);
|
|
|
|
+ vo.setName("测试团队"+i);
|
|
|
|
+ vo.setLeaderName(new String[]{"负责人1", "负责人2"});
|
|
|
|
+ vo.setLeader(new Long[]{1L, 2L});
|
|
|
|
+ vo.setMemberName(new String[]{"成员1", "成员2"});
|
|
|
|
+ vo.setMember(new Long[]{1L, 2L});
|
|
|
|
+ list.add(vo);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ page.setRecords(list);
|
|
|
|
+ page.setTotal(total);
|
|
|
|
+ page.setPages((total + page.getSize() - 1) / page.getSize());
|
|
|
|
+
|
|
|
|
+ return R.ok(page);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 查询团队列表
|
|
|
|
+ *
|
|
|
|
+ * @return {@link R}<{@link List}<{@link OeTeamVO}>>
|
|
|
|
+ */
|
|
|
|
+ @GetMapping("/list")
|
|
|
|
+ public R<List<Map<String, Object>>> listTeam() {
|
|
|
|
+ int total = 5;
|
|
|
|
+ List<Map<String, Object>> list = new ArrayList<>();
|
|
|
|
+ for (int i = 0; i < total; i++) {
|
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
|
+ map.put("name", "测试团队"+i);
|
|
|
|
+ map.put("id", (long) i);
|
|
|
|
+ list.add(map);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return R.ok(list);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 保存团队
|
|
|
|
+ *
|
|
|
|
+ * @param toSave 保存参数
|
|
|
|
+ * @return {@link R}<{@link Boolean}>
|
|
|
|
+ */
|
|
|
|
+ @PostMapping("/save")
|
|
|
|
+ public R<Boolean> saveTeam(@RequestBody OeTeamRequest.ToSave toSave) {
|
|
|
|
+ log.info("oe保存团队参数:{}", toSave);
|
|
|
|
+
|
|
|
|
+ return R.ok(Boolean.TRUE);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 更新团队
|
|
|
|
+ *
|
|
|
|
+ * @param toUpdate 更新
|
|
|
|
+ * @return {@link R}<{@link Boolean}>
|
|
|
|
+ */
|
|
|
|
+ @PostMapping("/update")
|
|
|
|
+ public R<Boolean> updateTeam(@RequestBody OeTeamRequest.ToUpdate toUpdate) {
|
|
|
|
+ log.info("更新团队参数:{}", toUpdate);
|
|
|
|
+
|
|
|
|
+ return R.ok(Boolean.TRUE);
|
|
|
|
+ }
|
|
|
|
+}
|