姜永辉 2 лет назад
Родитель
Сommit
c8fa4b04d4

+ 21 - 9
src/main/java/com/dk/mdm/controller/mst/StaffController.java

@@ -1,13 +1,13 @@
 package com.dk.mdm.controller.mst;
 
 import com.dk.common.model.pojo.PageList;
-import com.dk.common.model.vo.core.StaffEntity;
+import com.dk.common.response.ResponseResultUtil;
 import com.dk.common.response.ResponseResultVO;
 import com.dk.common.util.ExcelUtils;
-import com.dk.mdm.model.pojo.mst.Staff; 
+import com.dk.mdm.model.pojo.mst.Staff;
 import com.dk.common.service.BaseService;
 import com.dk.mdm.model.query.mst.StaffQuery;
-import com.dk.mdm.model.response.mst.StaffResponse;
+import com.dk.common.model.response.mst.StaffResponse;
 import com.dk.mdm.model.vo.mst.StaffVO;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.transaction.annotation.Transactional;
@@ -22,14 +22,14 @@ import java.util.ArrayList;
 import java.util.List;
 
 /**
- * @desc   : 员工API接口
  * @author : 姜永辉
- * @date   : 2023/1/4 9:25
+ * @desc : 员工API接口
+ * @date : 2023/1/4 9:25
  */
 @Api(tags = "员工API接口")
 @RestController
 @RequestMapping("/mst/staff")
-public class StaffController{
+public class StaffController {
 
     public BaseService<Staff> getService() {
         return staffService;
@@ -164,15 +164,27 @@ public class StaffController{
     }
 
     /**
-     * @desc   : 导出模板
+     * @desc : 导出模板
      * @author : 洪旭东
-     * @date   : 2023-08-01 11:44
+     * @date : 2023-08-01 11:44
      */
     @ApiOperation(value = "导出模板", notes = "导出模板")
     @GetMapping("export_template")
-    public void exportTemplate(HttpServletResponse response){
+    public void exportTemplate(HttpServletResponse response) {
         String title = "员工导入模板";
         ExcelUtils.exportExcel(new ArrayList<>(), title, title, StaffVO.class, title + ".xls", response);
     }
 
+
+    /**
+     * @desc : 体验产品-从oauth服务调用的函数
+     * @author : 姜永辉
+     * @date : 2023-11-02 16:27
+     */
+    @PostMapping({"/feign_get_experience"})
+    ResponseResultVO<StaffResponse> getFeignExperience(@RequestBody StaffQuery staffQuery) {
+        ResponseResultVO<PageList<StaffResponse>> pageListResponseResultVO = staffService.selectByCond(staffQuery);
+        return ResponseResultUtil.success(pageListResponseResultVO.getData().getList().get(0));
+    }
+
 }

+ 1 - 1
src/main/java/com/dk/mdm/infrastructure/convert/mst/StaffConvert.java

@@ -2,7 +2,7 @@ package com.dk.mdm.infrastructure.convert.mst;
 
 import com.dk.common.model.vo.core.StaffEntity;
 import com.dk.mdm.model.pojo.mst.Staff;
-import com.dk.mdm.model.response.mst.StaffResponse;
+import com.dk.common.model.response.mst.StaffResponse;
 import com.dk.mdm.model.vo.mst.StaffVO;
 import org.mapstruct.Mapper;
 

+ 1 - 3
src/main/java/com/dk/mdm/infrastructure/util/AuthUtils.java

@@ -9,9 +9,7 @@ import com.dk.common.util.oauth.AESSecurityUtil;
 import com.dk.common.util.oauth.JwtUtil;
 import com.dk.mdm.infrastructure.convert.mst.StaffConvert;
 import com.dk.mdm.mapper.mst.StaffMapper;
-import com.dk.mdm.model.pojo.mst.Staff;
-import com.dk.mdm.model.response.mst.StaffResponse;
-import com.dk.mdm.service.mst.StaffService;
+import com.dk.common.model.response.mst.StaffResponse;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;

+ 1 - 1
src/main/java/com/dk/mdm/mapper/mst/StaffMapper.java

@@ -3,7 +3,7 @@ package com.dk.mdm.mapper.mst;
 import com.dk.mdm.model.pojo.mst.Staff;
 import com.dk.common.mapper.BaseMapper;
 import com.dk.mdm.model.query.mst.StaffQuery;
-import com.dk.mdm.model.response.mst.StaffResponse;
+import com.dk.common.model.response.mst.StaffResponse;
 import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Repository;
 

+ 1 - 1
src/main/java/com/dk/mdm/mapper/mst/StaffMapper.xml

@@ -12,7 +12,7 @@
     </sql>
 
     <!-- 通用查询映射结果 -->
-    <resultMap id="BaseResultMap" type="com.dk.mdm.model.response.mst.StaffResponse">
+    <resultMap id="BaseResultMap" type="com.dk.common.model.response.mst.StaffResponse">
         <id column="staff_id" property="staffId" typeHandler="UuidTypeHandler"/>
         <result column="staff_code" property="staffCode"/>
         <result column="staff_name" property="staffName"/>

+ 0 - 2
src/main/java/com/dk/mdm/mapper/mst/SupplierMapper.java

@@ -1,11 +1,9 @@
 package com.dk.mdm.mapper.mst;
 
-import com.dk.mdm.model.pojo.mst.Org;
 import com.dk.mdm.model.pojo.mst.Supplier;
 import com.dk.common.mapper.BaseMapper;
 import com.dk.mdm.model.query.mst.SupplierQuery;
 import com.dk.mdm.model.response.mst.SpplierResponse;
-import com.dk.mdm.model.response.mst.StaffResponse;
 import com.dk.mdm.model.vo.mst.SupplierVo;
 import org.springframework.stereotype.Repository;
 

+ 0 - 245
src/main/java/com/dk/mdm/model/response/mst/StaffResponse.java

@@ -1,245 +0,0 @@
-package com.dk.mdm.model.response.mst;
-
-import cn.afterturn.easypoi.excel.annotation.Excel;
-import com.baomidou.mybatisplus.annotation.TableField;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-import com.dk.common.infrastructure.annotaiton.ExportTitle;
-import com.dk.common.infrastructure.handler.TimestampTypeHandler;
-import com.dk.common.infrastructure.handler.UuidListTypeHandler;
-import com.dk.common.infrastructure.handler.UuidTypeHandler;
-import com.dk.common.model.pojo.PageInfo;
-import com.fasterxml.jackson.annotation.JsonFormat;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.NoArgsConstructor;
-import lombok.experimental.Accessors;
-
-import java.io.Serializable;
-import java.time.LocalDateTime;
-import java.util.List;
-
-/**
- *  员工
- */
-@Data
-@AllArgsConstructor
-@NoArgsConstructor
-@EqualsAndHashCode(callSuper = true)
-@Accessors(chain = true)
-@ExportTitle("员工")
-@TableName(value = "t_mst_staff", autoResultMap = true)
-@ApiModel(value="实体类:员工", description="表名:t_mst_staff")
-public class StaffResponse extends PageInfo<StaffResponse> implements Serializable {
-
-    /*
-     * 数据库字段
-     */
-
-    /**
-     * 员工ID
-     */
-    @TableId(value = "staff_id")
-    @ApiModelProperty(value = "员工ID")
-    @TableField(typeHandler = UuidTypeHandler.class)
-    private String staffId;
-
-
-    /**
-     * 员工编码
-     */
-    @Excel(name = "员工编码")
-    @ApiModelProperty(value = "员工编码")
-    private String staffCode;
-
-
-    /**
-     * 员工名称
-     */
-    @Excel(name = "员工名称")
-    @ApiModelProperty(value = "员工名称")
-    private String staffName;
-
-    /**
-     * 员工电话
-     */
-    @Excel(name = "员工电话")
-    @ApiModelProperty(value = "员工电话")
-    private String staffPhone;
-
-    /**
-     * 员工工种
-     */
-    @Excel(name = "微信用户")
-    @ApiModelProperty(value = "微信用户")
-    private String wxUserId;
-
-
-    /**
-     * 组织部门
-     */
-    @Excel(name = "组织部门")
-    @ApiModelProperty(value = "组织部门")
-    @TableField(typeHandler = UuidTypeHandler.class)
-    private String orgId;
-
-
-    /**
-     * 备注
-     */
-    @Excel(name = "备注")
-    @ApiModelProperty(value = "备注")
-    private String remarks;
-
-    /**
-     * 登录标识
-     */
-    @ApiModelProperty(value = "登录标识")
-    private Boolean flgCanLogin;
-
-    /**
-     * 有效标识 (1:正常 0:停用)
-     */
-    @Excel(name = "有效标识 (1:正常 0:停用)")
-    @ApiModelProperty(value = "有效标识 (1:正常 0:停用)")
-    private Boolean flgValid;
-
-    /**
-     * @desc   : 角色list
-     */
-    @ApiModelProperty(value = "角色list")
-    @TableField(typeHandler = UuidListTypeHandler.class)
-    private List<String> roleIds;
-
-    /**
-     * @desc   : 角色
-     */
-    @ApiModelProperty(value = "员工角色名称")
-    private String roleNames;
-
-
-    /**
-     * 企业ID
-     */
-    @Excel(name = "企业ID")
-    @ApiModelProperty(value = "企业ID")
-    private Integer cpId;
-
-    /**
-     * 企业编码
-     */
-    @Excel(name = "企业编码")
-    @ApiModelProperty(value = "企业编码")
-    private String cpCode;
-
-    /**
-     * 登录标识1能登录 0不能登录
-     */
-    @Excel(name = "登录标识")
-    @ApiModelProperty(value = "登录标识")
-    private Integer hrStatus;
-
-    /**
-     * @desc   : 登录标识
-     */
-    @ApiModelProperty(value = "登录标识")
-    private String hrStatusName;
-
-    /**
-     * 创建时间 (触发器自动处理)
-     */
-    @Excel(name = "创建时间 (触发器自动处理)", format = "yyyy-MM-dd HH:mm:ss", width = 20)
-    @ApiModelProperty(value = "创建时间 (触发器自动处理)")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
-    @TableField(typeHandler = TimestampTypeHandler.class)
-    private LocalDateTime opCreateTime;
-
-
-    /**
-     * 创建用户 (触发器自动处理)
-     */
-    @Excel(name = "创建用户 (触发器自动处理)")
-    @ApiModelProperty(value = "创建用户 (触发器自动处理)")
-    @TableField(typeHandler = UuidTypeHandler.class)
-    private String opCreateUserId;
-
-
-    /**
-     * 修改时间 (触发器自动处理)
-     */
-    @Excel(name = "修改时间 (触发器自动处理)", format = "yyyy-MM-dd HH:mm:ss", width = 20)
-    @ApiModelProperty(value = "修改时间 (触发器自动处理)")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
-    @TableField(typeHandler = TimestampTypeHandler.class)
-    private LocalDateTime opUpdateTime;
-
-
-    /**
-     * 修改用户 (触发器自动处理)
-     */
-    @Excel(name = "修改用户 (触发器自动处理)")
-    @ApiModelProperty(value = "修改用户 (触发器自动处理)")
-    @TableField(typeHandler = UuidTypeHandler.class)
-    private String opUpdateUserId;
-
-
-    /**
-     * 数据操作应用 (触发器自动处理)
-     */
-    @Excel(name = "数据操作应用 (触发器自动处理)")
-    @ApiModelProperty(value = "数据操作应用 (触发器自动处理)")
-    private String opAppCode;
-
-
-    /**
-     * 数据时间戳 (触发器自动处理)
-     */
-    @Excel(name = "数据时间戳 (触发器自动处理)")
-    @ApiModelProperty(value = "数据时间戳 (触发器自动处理)")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
-    @TableField(typeHandler = TimestampTypeHandler.class)
-    private LocalDateTime opTimestamp;
-
-
-    /**
-     * 数据操作数据库用户 (触发器自动处理)
-     */
-    @Excel(name = "数据操作数据库用户 (触发器自动处理)")
-    @ApiModelProperty(value = "数据操作数据库用户 (触发器自动处理)")
-    private String opDbUser;
-
-
-    /*
-     * 相关属性
-     * @TableField(exist = false)
-     */
-
-    @ApiModelProperty(value = "关联工号ID")
-    private List<Integer> userIds;
-
-    /**
-     * 组织部门名称
-     */
-    @Excel(name = "组织部门名称")
-    @ApiModelProperty(value = "组织部门名称")
-    private String orgName;
-
-    /**
-     * 员工状态名称
-     */
-    @Excel(name = "员工状态名称")
-    @ApiModelProperty(value = "员工状态名称")
-    private String staffStatusName;
-
-    /**
-     * 部门全称
-     */
-    @Excel(name = "部门全称")
-    @ApiModelProperty(value = "部门全称")
-    private String orgLevelName;
-    private static final long serialVersionUID = 1L;
-
-}

+ 1 - 5
src/main/java/com/dk/mdm/service/common/CommonService.java

@@ -1,13 +1,11 @@
 package com.dk.mdm.service.common;
 
-import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.dk.common.infrastructure.constant.Constant;
 import com.dk.common.infrastructure.enums.ErrorCodeEnum;
 import com.dk.common.mapper.BaseMapper;
 import com.dk.common.model.pojo.PageList;
 import com.dk.common.model.vo.core.StaffEntity;
-import com.dk.common.model.vo.core.UserVO;
 import com.dk.common.response.ResponseCodeEnum;
 import com.dk.common.response.ResponseResultUtil;
 import com.dk.common.response.ResponseResultVO;
@@ -15,16 +13,14 @@ import com.dk.common.service.BaseService;
 import com.dk.mdm.mapper.common.CommonMapper;
 import com.dk.mdm.infrastructure.util.AuthUtils;
 import com.dk.mdm.mapper.mst.StaffMapper;
-import com.dk.mdm.model.response.mst.StaffResponse;
+import com.dk.common.model.response.mst.StaffResponse;
 import lombok.extern.slf4j.Slf4j;
 import org.postgresql.util.PGobject;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
-import org.springframework.util.CollectionUtils;
 
 import java.util.*;
-import java.util.stream.Collectors;
 
 /**
  * @author : 周兴

+ 1 - 2
src/main/java/com/dk/mdm/service/mst/CusFollowService.java

@@ -22,7 +22,7 @@ import com.dk.mdm.model.query.mst.CusFollowQuery;
 import com.dk.mdm.model.query.mst.CustomerQuery;
 import com.dk.mdm.model.response.mst.CusFollowResponse;
 import com.dk.mdm.model.response.mst.CustomerResponse;
-import com.dk.mdm.model.response.mst.StaffResponse;
+import com.dk.common.model.response.mst.StaffResponse;
 import com.dk.mdm.model.vo.mst.CusFollowVO;
 import com.dk.mdm.service.common.CommonService;
 import org.springframework.stereotype.Service;
@@ -30,7 +30,6 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
 
 import java.time.LocalDateTime;
-import java.time.ZoneOffset;
 import java.util.*;
 
 @Service

+ 1 - 5
src/main/java/com/dk/mdm/service/mst/StaffService.java

@@ -1,10 +1,8 @@
 package com.dk.mdm.service.mst;
 
-import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.dk.common.infrastructure.annotaiton.Pagination;
 import com.dk.common.infrastructure.constant.Constant;
 import com.dk.common.model.pojo.PageList;
-import com.dk.common.model.vo.core.StaffEntity;
 import com.dk.common.response.ResponseCodeEnum;
 import com.dk.common.response.ResponseResultUtil;
 import com.dk.common.response.ResponseResultVO;
@@ -15,7 +13,7 @@ import com.dk.mdm.mapper.mst.StaffMapper;
 import com.dk.common.service.BaseService;
 import com.dk.common.mapper.BaseMapper;
 import com.dk.mdm.model.query.mst.StaffQuery;
-import com.dk.mdm.model.response.mst.StaffResponse;
+import com.dk.common.model.response.mst.StaffResponse;
 import com.dk.mdm.model.vo.mst.StaffVO;
 import com.dk.mdm.service.common.CommonService;
 import org.springframework.stereotype.Service;
@@ -25,8 +23,6 @@ import org.springframework.util.CollectionUtils;
 
 import java.util.List;
 import java.util.Map;
-import java.util.Random;
-import java.util.UUID;
 
 /**
  * @author : 姜永辉

+ 1 - 1
src/main/resources/dev/bootstrap.yml

@@ -2,7 +2,7 @@ server:
   port: 7008
 spring:
   application:
-    name: mdm-server-dkic-b1-chn
+    name: mdm-server-dkic-b1-jyh
   cloud:
     nacos:
       config: