Min 1 年間 前
コミット
046048dd03

+ 1 - 1
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/ProductController.java

@@ -126,7 +126,7 @@ public class ProductController {
                 return msg;
             }
             if(idList.size()>0){
-                List<Product> productList = productService.list(new LambdaQueryWrapper<Product>().eq(Product::getId, idList));
+                List<Product> productList = productService.list(new LambdaQueryWrapper<Product>().in(Product::getId, idList));
                 productList.forEach(p->{
                     p.setIsDelete(1);
                 });

+ 5 - 3
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/AttachmentCenter.java

@@ -1,6 +1,8 @@
 package com.management.platform.entity;
 
+import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.extension.activerecord.Model;
+import com.baomidou.mybatisplus.annotation.TableId;
 import java.time.LocalDateTime;
 import com.baomidou.mybatisplus.annotation.TableField;
 import java.io.Serializable;
@@ -14,7 +16,7 @@ import lombok.experimental.Accessors;
  * </p>
  *
  * @author Seyason
- * @since 2024-04-15
+ * @since 2024-04-17
  */
 @Data
 @EqualsAndHashCode(callSuper = false)
@@ -23,7 +25,7 @@ public class AttachmentCenter extends Model<AttachmentCenter> {
 
     private static final long serialVersionUID=1L;
 
-    @TableField("id")
+    @TableId(value = "id", type = IdType.AUTO)
     private Integer id;
 
     /**
@@ -80,7 +82,7 @@ public class AttachmentCenter extends Model<AttachmentCenter> {
 
     @Override
     protected Serializable pkVal() {
-        return null;
+        return this.id;
     }
 
 }

+ 5 - 3
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/AuditLogCenter.java

@@ -1,6 +1,8 @@
 package com.management.platform.entity;
 
+import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.extension.activerecord.Model;
+import com.baomidou.mybatisplus.annotation.TableId;
 import java.time.LocalDateTime;
 import com.baomidou.mybatisplus.annotation.TableField;
 import java.io.Serializable;
@@ -14,7 +16,7 @@ import lombok.experimental.Accessors;
  * </p>
  *
  * @author Seyason
- * @since 2024-04-15
+ * @since 2024-04-17
  */
 @Data
 @EqualsAndHashCode(callSuper = false)
@@ -23,7 +25,7 @@ public class AuditLogCenter extends Model<AuditLogCenter> {
 
     private static final long serialVersionUID=1L;
 
-    @TableField("id")
+    @TableId(value = "id", type = IdType.AUTO)
     private Integer id;
 
     /**
@@ -65,7 +67,7 @@ public class AuditLogCenter extends Model<AuditLogCenter> {
 
     @Override
     protected Serializable pkVal() {
-        return null;
+        return this.id;
     }
 
 }

+ 1 - 1
fhKeeper/formulahousekeeper/management-crm/src/main/resources/mapper/AttachmentCenterMapper.xml

@@ -4,7 +4,7 @@
 
     <!-- 通用查询映射结果 -->
     <resultMap id="BaseResultMap" type="com.management.platform.entity.AttachmentCenter">
-        <result column="id" property="id" />
+        <id column="id" property="id" />
         <result column="attachment_name" property="attachmentName" />
         <result column="server_name" property="serverName" />
         <result column="url" property="url" />

+ 1 - 1
fhKeeper/formulahousekeeper/management-crm/src/main/resources/mapper/AuditLogCenterMapper.xml

@@ -4,7 +4,7 @@
 
     <!-- 通用查询映射结果 -->
     <resultMap id="BaseResultMap" type="com.management.platform.entity.AuditLogCenter">
-        <result column="id" property="id" />
+        <id column="id" property="id" />
         <result column="module_id" property="moduleId" />
         <result column="module_code" property="moduleCode" />
         <result column="audit_time" property="auditTime" />

+ 12 - 6
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/FeishuInfoController.java

@@ -22,6 +22,7 @@ import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.http.*;
+import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.StringUtils;
 import org.springframework.web.bind.annotation.*;
 
@@ -655,9 +656,11 @@ public class FeishuInfoController {
                 allNeedTodo.addAll(departmentArray);
                 for (int i = 0; i < departmentArray.size(); i++) {
                     JSONObject ob = departmentArray.getJSONObject(i);
-                    JSONArray jsonArray = getSubDepartmentList(feishuInfo, ob.getString("open_department_id"));
-                    if(jsonArray!=null&&jsonArray.size()>0){
-                        allNeedTodo.addAll(jsonArray);
+                    if(ob.getString("open_department_id")!=null){
+                        JSONArray jsonArray = getSubDepartmentList(feishuInfo, ob.getString("open_department_id"));
+                        if(jsonArray!=null&&jsonArray.size()>0){
+                            allNeedTodo.addAll(jsonArray);
+                        }
                     }
                 }
                 List<Department> departmentList=new ArrayList<>();
@@ -815,6 +818,7 @@ public class FeishuInfoController {
     }
 
     @RequestMapping("/getFeishuMembsFromPlatform")
+    @Transactional(rollbackFor = Exception.class)
     public HttpRespMsg getFeishuMembsFromPlatform(HttpServletRequest request){
         HttpRespMsg msg=new HttpRespMsg();
         Integer companyId = userMapper.selectById(request.getHeader("token")).getCompanyId();
@@ -847,9 +851,11 @@ public class FeishuInfoController {
         allNeedTodo.addAll(departmentArray);
         for (int i = 0; i < departmentArray.size(); i++) {
             JSONObject ob = departmentArray.getJSONObject(i);
-            JSONArray jsonArray = getSubDepartmentList(feishuInfo, ob.getString("open_department_id"));
-            if(jsonArray!=null&&jsonArray.size()>0){
-                allNeedTodo.addAll(jsonArray);
+            if(ob.getString("open_department_id")!=null){
+                JSONArray jsonArray = getSubDepartmentList(feishuInfo, ob.getString("open_department_id"));
+                if(jsonArray!=null&&jsonArray.size()>0){
+                    allNeedTodo.addAll(jsonArray);
+                }
             }
         }
         List<Department> departmentList=new ArrayList<>();

+ 3 - 2
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/FeishuInfoServiceImpl.java

@@ -178,7 +178,7 @@ public class FeishuInfoServiceImpl extends ServiceImpl<FeishuInfoMapper, FeishuI
                 Map resultMap=new HashMap();
                 JSONArray departmentResult=new JSONArray();
                 JSONArray userResult=new JSONArray();
-                String url = GET_AVAILABLE_RANGE;
+                String url = GET_AVAILABLE_RANGE+"?page_size={page_size}";
                 HttpHeaders headers = new HttpHeaders();
                 RestTemplate restTemplate = new RestTemplate();
                 MediaType type = MediaType.parseMediaType("application/json; charset=UTF-8");
@@ -191,8 +191,9 @@ public class FeishuInfoServiceImpl extends ServiceImpl<FeishuInfoMapper, FeishuI
                 map.put("page_token",null);
                 if(pageToken!=null){
                         map.put("page_token",pageToken);
+                        url+="&page_token={page_token}";
                 }
-                ResponseEntity<String> ResponseEntity = restTemplate.exchange(url+"?page_size={page_size}&page_token={page_token}",HttpMethod.GET,httpEntity,String.class,map);
+                ResponseEntity<String> ResponseEntity = restTemplate.exchange(url,HttpMethod.GET,httpEntity,String.class,map);
                 if (ResponseEntity.getStatusCode() == HttpStatus.OK) {
                         String resp = ResponseEntity.getBody();
                         JSONObject respJson = JSONObject.parseObject(resp);