Quellcode durchsuchen

企业缓存新增字段

czh vor 2 Jahren
Ursprung
Commit
a57257a088

+ 5 - 0
sckw-auth/src/main/java/com/sckw/auth/model/vo/res/EntInfoResVo.java

@@ -72,4 +72,9 @@ public class EntInfoResVo {
      */
     private List<EntCertificateResDto> certificateInfo;
 
+    /**
+     * 企业属性
+     */
+    private String entTypes;
+
 }

+ 9 - 2
sckw-auth/src/main/java/com/sckw/auth/service/impl/AuthServiceImpl.java

@@ -83,8 +83,6 @@ public class AuthServiceImpl implements IAuthService {
             afterProcessor(loginResVo);
             return loginResVo;
         }
-        EntInfoResVo entInfoResVo = new EntInfoResVo();
-        entInfoResVo.setDeptInfo(BeanUtils.copyToList(kwsDepts, DeptInfoResVo.class));
 
         /*3、查企业*/
         //目前一个人只能归属于一个企业,所以这里取第一个就行
@@ -95,7 +93,16 @@ public class AuthServiceImpl implements IAuthService {
             afterProcessor(loginResVo);
             return loginResVo;
         }
+
+        EntInfoResVo entInfoResVo = new EntInfoResVo();
         BeanUtils.copyProperties(kwsEnterpriseResDto, entInfoResVo);
+        entInfoResVo.setDeptInfo(BeanUtils.copyToList(kwsDepts, DeptInfoResVo.class));
+
+        //查企业类型
+        List<EntTypeResDto> entTypeResDtos = remoteUserService.queryEntTypeById(entId);
+        if (CollectionUtils.isNotEmpty(entTypeResDtos)) {
+            entInfoResVo.setEntTypes(String.join(Global.COMMA, entTypeResDtos.stream().map(EntTypeResDto::getType).map(String::valueOf).distinct().toList()));
+        }
         loginResVo.setEntInfo(entInfoResVo);
 
         /* 4、查资质*/

+ 5 - 0
sckw-common/sckw-common-core/src/main/java/com/sckw/core/web/model/LoginEntInfo.java

@@ -76,6 +76,11 @@ public class LoginEntInfo {
      */
     private Boolean valid;
 
+    /**
+     * 企业属性
+     */
+    private String entTypes;
+
     /**
      * 资质
      */

+ 8 - 0
sckw-modules-api/sckw-system-api/src/main/java/com/sckw/system/api/RemoteUserService.java

@@ -167,4 +167,12 @@ public interface RemoteUserService {
      */
     void checkRegisterParam(String entName, String phone, Integer systemType);
 
+    /**
+     * @param entId 企业id
+     * @return EntTypeResDto
+     * @desc: 根据企业id 查属性
+     * @author: czh
+     * @date: 2023/7/27
+     */
+    List<EntTypeResDto> queryEntTypeById(Long entId);
 }

+ 5 - 0
sckw-modules-api/sckw-system-api/src/main/java/com/sckw/system/api/model/dto/res/EntCacheResDto.java

@@ -65,6 +65,11 @@ public class EntCacheResDto implements Serializable {
      */
     private String entDeptIds;
 
+    /**
+     * 企业属性 (1供应商,2采购商,34PL物流,43PL物流)
+     */
+    private String entTypes;
+
     /**
      * 机构信息
      */

+ 73 - 0
sckw-modules-api/sckw-system-api/src/main/java/com/sckw/system/api/model/dto/res/EntTypeResDto.java

@@ -0,0 +1,73 @@
+package com.sckw.system.api.model.dto.res;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import jakarta.validation.constraints.Size;
+import lombok.Data;
+
+import java.io.Serial;
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @author czh
+ * @desc 企业类型
+ * @date 2023/7/27
+ */
+@Data
+public class EntTypeResDto implements Serializable {
+
+    @Serial
+    private static final long serialVersionUID = 1158513264803000013L;
+
+    /**
+     * 企业ID或企业子公司所属机构ID
+     */
+    private Long entId;
+
+    /**
+     * 用户类型(1供应商,2采购商,3 4PL物流,4 3PL物流)
+     */
+    private Integer type;
+
+    /**
+     * 主键
+     */
+    private Long id;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+    /**
+     * 状态:0正常/1锁定
+     */
+    private Integer status;
+
+    /**
+     * 创建人
+     */
+    private Long createBy;
+
+    /**
+     * 创建时间
+     */
+    private Date createTime;
+
+    /**
+     * 更新人
+     */
+    private Long updateBy;
+
+    /**
+     * 更新时间
+     */
+    private Date updateTime;
+
+    /**
+     * 删除标识(0正常/-1删除)
+     */
+    private Integer delFlag = 0;
+
+
+}

+ 38 - 0
sckw-modules/sckw-contract/src/main/java/com/sckw/contract/model/vo/req/CompleteReqVo.java

@@ -0,0 +1,38 @@
+package com.sckw.contract.model.vo.req;
+
+import jakarta.validation.constraints.NotNull;
+import lombok.Data;
+
+import java.io.Serial;
+import java.io.Serializable;
+import java.math.BigDecimal;
+
+/**
+ * @author czh
+ * @desc 完结
+ * @date 2023/7/27
+ */
+@Data
+public class CompleteReqVo implements Serializable {
+
+    @Serial
+    private static final long serialVersionUID = 4191696463874543248L;
+
+    /**
+     * 主键id
+     */
+    @NotNull(message = "id不能为空")
+    private Long id;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+    /**
+     * 履约量
+     */
+    @NotNull(message = "履约量不能为空")
+    private BigDecimal performedAmount;
+
+}

+ 13 - 0
sckw-modules/sckw-system/src/main/java/com/sckw/system/dubbo/RemoteBaseService.java

@@ -6,6 +6,7 @@ import com.sckw.core.utils.CollectionUtils;
 import com.sckw.system.api.model.dto.res.*;
 import com.sckw.system.api.model.pojo.DeptInfoPojo;
 import com.sckw.system.dao.KwsEntDeptDao;
+import com.sckw.system.dao.KwsEntTypeDao;
 import com.sckw.system.model.*;
 import com.sckw.system.model.pojo.FindEntDeptInfoPojo;
 import com.sckw.system.model.vo.res.CertificateResVo;
@@ -44,6 +45,9 @@ public class RemoteBaseService {
     @Resource
     private KwsEntDeptDao kwsEntDeptDao;
 
+    @Resource
+    private KwsEntTypeDao kwsEntTypeDao;
+
 
     public KwsEnterpriseResDto queryEnterpriseById(Long id) {
         KwsEnterprise kwsEnterprise = kwsEnterpriseService.queryKwsEnterpriseById(id);
@@ -142,4 +146,13 @@ public class RemoteBaseService {
     public List<KwsEntDept> queryEntDeptCacheByIds(List<Long> entIds) {
         return kwsEntDeptDao.selectByEntPidList(entIds);
     }
+
+    public List<EntTypeResDto> queryEntTypeById(Long entId) {
+        List<KwsEntType> list = kwsEntTypeDao.findListByEntId(entId);
+        if (CollectionUtils.isEmpty(list)) {
+            return Collections.emptyList();
+        }
+
+        return BeanUtils.copyToList(list, EntTypeResDto.class);
+    }
 }

+ 4 - 0
sckw-modules/sckw-system/src/main/java/com/sckw/system/dubbo/RemoteSystemServiceImpl.java

@@ -216,6 +216,10 @@ public class RemoteSystemServiceImpl implements RemoteSystemService {
             BeanUtils.copyProperties(kwsEnterpriseResDto, entCacheResDto);
             entCacheResDto.setDeptInfo(remoteBaseService.queryDeftInfoByEntId(entId));
             entCacheResDto.setCertificateInfo(remoteBaseService.queryCertificateByEntId(entId));
+            List<EntTypeResDto> entTypeResDtos = remoteBaseService.queryEntTypeById(entId);
+            if (CollectionUtils.isNotEmpty(entTypeResDtos)) {
+                entCacheResDto.setEntTypes(String.join(Global.COMMA, entTypeResDtos.stream().map(EntTypeResDto::getType).map(String::valueOf).distinct().toList()));
+            }
             RedissonUtils.putString(key, JSON.toJSONString(entCacheResDto), Global.COMMON_EXPIRE);
             return entCacheResDto;
         }

+ 9 - 0
sckw-modules/sckw-system/src/main/java/com/sckw/system/dubbo/RemoteUserServiceImpl.java

@@ -10,6 +10,7 @@ import com.sckw.system.api.model.dto.req.RegisterReqDto;
 import com.sckw.system.api.model.dto.req.UpdatePasswordReqDto;
 import com.sckw.system.api.model.dto.req.UserLoginReqDto;
 import com.sckw.system.api.model.dto.res.*;
+import com.sckw.system.dao.KwsEntTypeDao;
 import com.sckw.system.dao.KwsEnterpriseDao;
 import com.sckw.system.dao.KwsUserLoginDao;
 import com.sckw.system.dao.SysDictDao;
@@ -56,6 +57,9 @@ public class RemoteUserServiceImpl implements RemoteUserService {
     @Resource
     private KwsEnterpriseDao kwsEnterpriseDao;
 
+    @Resource
+    private KwsEntTypeDao kwsEntTypeDao;
+
     @Resource
     private SysDictDao sysDictDao;
 
@@ -164,6 +168,11 @@ public class RemoteUserServiceImpl implements RemoteUserService {
         kwsUserService.checkAccountValid(phone, systemType);
     }
 
+    @Override
+    public List<EntTypeResDto> queryEntTypeById(Long entId) {
+        return remoteBaseService.queryEntTypeById(entId);
+    }
+
     @Override
     public KwsUserResDto getUserByAccount(String username) {
         return remoteBaseService.getUserByAccount(username);

+ 1 - 1
sckw-modules/sckw-system/src/main/java/com/sckw/system/service/CommonService.java

@@ -19,7 +19,7 @@ import java.util.List;
 
 /**
  * @author czh
- * @desc TODO
+ * @desc 公共方法
  * @date 2023/6/30
  */
 @Service