Browse Source

Merge branch 'feat-20230920-b2b' into temp-pre

lixuesong 1 year ago
parent
commit
8e73bf5343

+ 5 - 0
hnqz-upms/hnqz-upms-api/src/main/java/com/qunzhixinxi/hnqz/admin/api/constant/CacheConstants.java

@@ -192,4 +192,9 @@ public interface CacheConstants {
 	 */
 	 */
 	String TERMINATE_PACKAGE_KEY = "TERMINATE:PACKAGE:KEY:";
 	String TERMINATE_PACKAGE_KEY = "TERMINATE:PACKAGE:KEY:";
 
 
+	/**
+	 * 企业任务类型缓存key
+	 */
+	String ENT_TASK_CACHE_KEY = "ENT:TASK:CACHE:KEY:";
+
 }
 }

+ 89 - 3
hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/controller/WmDeptTaskController.java

@@ -3,9 +3,11 @@ package com.qunzhixinxi.hnqz.admin.controller;
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.util.StrUtil;
 import cn.hutool.core.util.StrUtil;
+import cn.hutool.json.JSONUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.qunzhixinxi.hnqz.admin.api.constant.CacheConstants;
 import com.qunzhixinxi.hnqz.admin.api.entity.SysUser;
 import com.qunzhixinxi.hnqz.admin.api.entity.SysUser;
 import com.qunzhixinxi.hnqz.admin.entity.WmScorePackage;
 import com.qunzhixinxi.hnqz.admin.entity.WmScorePackage;
 import com.qunzhixinxi.hnqz.admin.entity.WmTask;
 import com.qunzhixinxi.hnqz.admin.entity.WmTask;
@@ -25,8 +27,10 @@ import com.qunzhixinxi.hnqz.common.log.annotation.SysLog;
 import com.qunzhixinxi.hnqz.common.security.util.SecurityUtils;
 import com.qunzhixinxi.hnqz.common.security.util.SecurityUtils;
 import lombok.AllArgsConstructor;
 import lombok.AllArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
+import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.bind.annotation.RestController;
@@ -55,6 +59,7 @@ public class WmDeptTaskController {
     private final WmTaskService wmTaskService;
     private final WmTaskService wmTaskService;
     private final WmTaskTypeService wmTaskTypeService;
     private final WmTaskTypeService wmTaskTypeService;
     private final SysUserService sysUserService;
     private final SysUserService sysUserService;
+    private final RedisTemplate redisTemplate;
 
 
     /**
     /**
      * 查询关联的企业积分包
      * 查询关联的企业积分包
@@ -65,7 +70,7 @@ public class WmDeptTaskController {
     public R<?> listRelatedEntPackage() {
     public R<?> listRelatedEntPackage() {
         Integer deptId = SecurityUtils.getUser().getDeptId();
         Integer deptId = SecurityUtils.getUser().getDeptId();
 
 
-        List<WmScorePackage> packageList = wmScorePackageService.getScorePackagekfpjf(deptId, new String[]{"0", "1", "2"});
+        List<WmScorePackage> packageList = wmScorePackageService.getScorePackagekfpjf(deptId, new String[]{"0", "1", "2"}, null);
 
 
         List<Map<String, String>> results = new ArrayList<>();
         List<Map<String, String>> results = new ArrayList<>();
         if (CollUtil.isNotEmpty(packageList)) {
         if (CollUtil.isNotEmpty(packageList)) {
@@ -110,6 +115,9 @@ public class WmDeptTaskController {
         }
         }
         // 积分包id列表
         // 积分包id列表
         Set<String> packageIdSet = relatedPackages.stream().map(WmScorePackage::getId).collect(Collectors.toSet());
         Set<String> packageIdSet = relatedPackages.stream().map(WmScorePackage::getId).collect(Collectors.toSet());
+        // 积分包名称map
+        Map<String, String> packageNameMap = relatedPackages.stream()
+                .collect(Collectors.toMap(WmScorePackage::getId, WmScorePackage::getScorePackageName));
 
 
         // 查询积分包下的企业任务
         // 查询积分包下的企业任务
         Page<WmTask> taskPage = wmTaskService.page(new Page<>(page.getCurrent(), page.getSize()), Wrappers.<WmTask>lambdaQuery()
         Page<WmTask> taskPage = wmTaskService.page(new Page<>(page.getCurrent(), page.getSize()), Wrappers.<WmTask>lambdaQuery()
@@ -135,10 +143,12 @@ public class WmDeptTaskController {
 
 
         List<WmTaskVO> vos = taskPage.getRecords().stream().map(wmTask -> {
         List<WmTaskVO> vos = taskPage.getRecords().stream().map(wmTask -> {
             WmTaskVO wmTaskVO = BeanUtil.copyProperties(wmTask, WmTaskVO.class);
             WmTaskVO wmTaskVO = BeanUtil.copyProperties(wmTask, WmTaskVO.class);
+            // 积分包名称
+            wmTaskVO.setScorePackageName(packageNameMap.getOrDefault(wmTask.getScorePackageId(), ""));
             // 任务类型名称
             // 任务类型名称
-            wmTaskVO.setTaskTypeName(taskTypeIdMap.getOrDefault(wmTaskVO.getTaskTypeId(), ""));
+            wmTaskVO.setTaskTypeName(taskTypeIdMap.getOrDefault(wmTask.getTaskTypeId(), ""));
             // 姓名
             // 姓名
-            wmTaskVO.setTaskUsername(userMap.getOrDefault(Integer.parseInt(wmTaskVO.getTaskUserId()), ""));
+            wmTaskVO.setTaskUsername(userMap.getOrDefault(Integer.parseInt(wmTask.getTaskUserId()), ""));
             // 报告审核状态
             // 报告审核状态
             wmTaskVO.setApprovalOpinionName("");
             wmTaskVO.setApprovalOpinionName("");
             if (StrUtil.isNotBlank(wmTask.getReportDrugApprovalOpinion())) {
             if (StrUtil.isNotBlank(wmTask.getReportDrugApprovalOpinion())) {
@@ -210,4 +220,80 @@ public class WmDeptTaskController {
 
 
         return R.ok(wmDeptTaskService.saveEntTaskForTaskType63(params));
         return R.ok(wmDeptTaskService.saveEntTaskForTaskType63(params));
     }
     }
+
+    /**
+     * 企业任务保存-企业通用-缓存
+     *
+     * @param params 参数
+     * @return {@link R}<{@link ?}> 结果
+     */
+    @SysLog("企业任务保存-企业通用-缓存")
+    @PostMapping("/dept-task/save-task-type61-temp")
+    public R<?> saveEntTaskForTaskType61Temp(@Validated @RequestBody DeptTaskDTO.TaskType61 params) {
+        log.info("企业任务保存-企业通用-缓存:{}", params);
+
+        String cacheKey = String.format("%s-%s-%s", CacheConstants.ENT_TASK_CACHE_KEY, "61", SecurityUtils.getUser().getId());
+        redisTemplate.opsForValue().set(cacheKey, JSONUtil.toJsonStr(params));
+
+        return R.ok();
+    }
+
+    /**
+     * 企业任务保存-医学会各级年会及卫星会-缓存
+     *
+     * @param params 参数
+     * @return {@link R}<{@link ?}> 结果
+     */
+    @SysLog("企业任务保存-医学会各级年会及卫星会-缓存")
+    @PostMapping("/dept-task/save-task-type62-temp")
+    public R<?> saveEntTaskForTaskType62Temp(@Validated @RequestBody DeptTaskDTO.TaskType62 params) {
+        log.info("企业任务保存-医学会各级年会及卫星会-缓存:{}", params);
+
+        String cacheKey = String.format("%s-%s-%s", CacheConstants.ENT_TASK_CACHE_KEY, "62", SecurityUtils.getUser().getId());
+        redisTemplate.opsForValue().set(cacheKey, JSONUtil.toJsonStr(params));
+
+        return R.ok();
+    }
+
+    /**
+     * 企业任务保存-专家共识巡讲会-缓存
+     *
+     * @param params 参数
+     * @return {@link R}<{@link ?}> 结果
+     */
+    @SysLog("企业任务保存-专家共识巡讲会-缓存")
+    @PostMapping("/dept-task/save-task-type63-temp")
+    public R<?> saveEntTaskForTaskType63Temp(@Validated @RequestBody DeptTaskDTO.TaskType63 params) {
+        log.info("企业任务保存-专家共识巡讲会-缓存:{}", params);
+
+        String cacheKey = String.format("%s-%s-%s", CacheConstants.ENT_TASK_CACHE_KEY, "63", SecurityUtils.getUser().getId());
+        redisTemplate.opsForValue().set(cacheKey, JSONUtil.toJsonStr(params));
+
+        return R.ok();
+    }
+
+    /**
+     * 获取企业任务保存缓存数据
+     *
+     * @param taskTypeId 任务类型 ID
+     * @return {@link R}<{@link ?}> 结果
+     */
+    @GetMapping("/dept-task/task-type-temp/{taskTypeId}")
+    public R<?> getEntTaskTemp(@PathVariable("taskTypeId") String taskTypeId) {
+        String cacheKey = String.format("%s-%s-%s", CacheConstants.ENT_TASK_CACHE_KEY, taskTypeId, SecurityUtils.getUser().getId());
+        String jsonStr = (String) redisTemplate.opsForValue().get(cacheKey);
+        if (StrUtil.isBlank(jsonStr)) {
+            return R.ok();
+        }
+        switch (taskTypeId) {
+            case "61":
+                return R.ok(JSONUtil.toBean(jsonStr, DeptTaskDTO.TaskType61.class));
+            case "62":
+                return R.ok(JSONUtil.toBean(jsonStr, DeptTaskDTO.TaskType62.class));
+            case "63":
+                return R.ok(JSONUtil.toBean(jsonStr, DeptTaskDTO.TaskType63.class));
+            default:
+                return R.ok();
+        }
+    }
 }
 }

+ 4 - 3
hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/service/WmScorePackageService.java

@@ -216,9 +216,10 @@ public interface WmScorePackageService extends IService<WmScorePackage> {
 	/**
 	/**
 	 * 获取指定企业下积分包的可分配积分值
 	 * 获取指定企业下积分包的可分配积分值
 	 *
 	 *
-	 * @param deptId 企业id
-	 * @param typeIds 企业类型
+	 * @param deptId     企业id
+	 * @param typeIds    企业类型
+	 * @param packageIds 积分包id
 	 * @return 结果
 	 * @return 结果
 	 */
 	 */
-	List<WmScorePackage> getScorePackagekfpjf(Integer deptId, String[] typeIds);
+	List<WmScorePackage> getScorePackagekfpjf(Integer deptId, String[] typeIds, String[] packageIds);
 }
 }

+ 59 - 17
hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/service/impl/WmDeptTaskServiceImpl.java

@@ -2,9 +2,11 @@ package com.qunzhixinxi.hnqz.admin.service.impl;
 
 
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.util.ArrayUtil;
 import cn.hutool.core.util.ArrayUtil;
+import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.qunzhixinxi.hnqz.admin.api.constant.UpmsType;
 import com.qunzhixinxi.hnqz.admin.api.constant.UpmsType;
 import com.qunzhixinxi.hnqz.admin.api.entity.WmTaskSubmissionPercentRule;
 import com.qunzhixinxi.hnqz.admin.api.entity.WmTaskSubmissionPercentRule;
+import com.qunzhixinxi.hnqz.admin.config.UpmsConfig;
 import com.qunzhixinxi.hnqz.admin.entity.WmScorePackage;
 import com.qunzhixinxi.hnqz.admin.entity.WmScorePackage;
 import com.qunzhixinxi.hnqz.admin.entity.WmScorePackageStatus;
 import com.qunzhixinxi.hnqz.admin.entity.WmScorePackageStatus;
 import com.qunzhixinxi.hnqz.admin.entity.WmTask;
 import com.qunzhixinxi.hnqz.admin.entity.WmTask;
@@ -52,6 +54,7 @@ public class WmDeptTaskServiceImpl implements WmDeptTaskService {
     private final WmTaskService wmTaskService;
     private final WmTaskService wmTaskService;
     private final WmTaskTypeService wmTaskTypeService;
     private final WmTaskTypeService wmTaskTypeService;
     private final Sequence taskSequence;
     private final Sequence taskSequence;
+    private final UpmsConfig upmsConfig;
 
 
     /**
     /**
      * 企业任务保存-企业通用
      * 企业任务保存-企业通用
@@ -81,7 +84,10 @@ public class WmDeptTaskServiceImpl implements WmDeptTaskService {
         WmScorePackage scorePackage = wmScorePackageService.getById(params.getPackageId());
         WmScorePackage scorePackage = wmScorePackageService.getById(params.getPackageId());
 
 
         // 校验是否超过可分配积分值
         // 校验是否超过可分配积分值
-        if (params.getScore() > scorePackage.getKfpjf()) {
+        List<WmScorePackage> scorePackagekfpjf =
+                wmScorePackageService.getScorePackagekfpjf(SecurityUtils.getUser().getDeptId(),
+                        new String[]{"0", "1", "2"}, new String[]{params.getPackageId()});
+        if (params.getScore() > scorePackagekfpjf.get(0).getKfpjf()) {
             throw new RuntimeException("可分配积分不足!");
             throw new RuntimeException("可分配积分不足!");
         }
         }
 
 
@@ -114,11 +120,21 @@ public class WmDeptTaskServiceImpl implements WmDeptTaskService {
         // 时间
         // 时间
         taskContent.setTemp3(params.getMeetingTime());
         taskContent.setTemp3(params.getMeetingTime());
         // 文件上传
         // 文件上传
-        taskContent.setTemp4(String.join(",", params.getFiles()));
+        StringBuilder temp4 = new StringBuilder();
+        if (ArrayUtil.isNotEmpty(params.getFiles())) {
+            for (int i = 0; i < params.getFiles().length; i++) {
+                String file = params.getFiles()[i];
+                temp4.append(StrUtil.startWith(file, "http")? file : upmsConfig.getClientUrl() + file);
+                if (i < params.getFiles().length - 1) {
+                    temp4.append(",");
+                }
+            }
+        }
+        taskContent.setTemp4(temp4.toString());
         // 外采费用
         // 外采费用
         taskContent.setTemp5(params.getOutsourcingAmount());
         taskContent.setTemp5(params.getOutsourcingAmount());
         // 凭证
         // 凭证
-        taskContent.setTemp6(String.join(",", params.getOutsourcingAmountProof()));
+        taskContent.setTemp6(this.convertFileUrlArrayToString(params.getFiles()));
         // 任务积分
         // 任务积分
         taskContent.setTemp7(String.valueOf(params.getScore()));
         taskContent.setTemp7(String.valueOf(params.getScore()));
         // 总结
         // 总结
@@ -165,7 +181,10 @@ public class WmDeptTaskServiceImpl implements WmDeptTaskService {
         int score = wmTaskTypeService.getWmTaskTypeByEnt(wmTaskType);
         int score = wmTaskTypeService.getWmTaskTypeByEnt(wmTaskType);
 
 
         // 校验是否超过可分配积分值
         // 校验是否超过可分配积分值
-        if (score > scorePackage.getKfpjf()) {
+        List<WmScorePackage> scorePackagekfpjf =
+                wmScorePackageService.getScorePackagekfpjf(SecurityUtils.getUser().getDeptId(),
+                        new String[]{"0", "1", "2"}, new String[]{params.getPackageId()});
+        if (score > scorePackagekfpjf.get(0).getKfpjf()) {
             throw new RuntimeException("可分配积分不足!");
             throw new RuntimeException("可分配积分不足!");
         }
         }
 
 
@@ -200,19 +219,19 @@ public class WmDeptTaskServiceImpl implements WmDeptTaskService {
         // 会议人次
         // 会议人次
         taskContent.setTemp4(params.getMeetingNumber());
         taskContent.setTemp4(params.getMeetingNumber());
         // 会议邀请函
         // 会议邀请函
-        taskContent.setTemp5(String.join(",", params.getMeetingInvitationUrl()));
+        taskContent.setTemp5(this.convertFileUrlArrayToString(params.getMeetingInvitationUrl()));
         // 会议计划表
         // 会议计划表
-        taskContent.setTemp6(String.join(",", params.getMeetingPlanUrl()));
+        taskContent.setTemp6(this.convertFileUrlArrayToString(params.getMeetingPlanUrl()));
         // 会议签到表
         // 会议签到表
-        taskContent.setTemp7(String.join(",", params.getMeetingCheckInUrl()));
+        taskContent.setTemp7(this.convertFileUrlArrayToString(params.getMeetingCheckInUrl()));
         // 现场照片
         // 现场照片
-        taskContent.setTemp8(String.join(",", params.getLivePhotosUrl()));
+        taskContent.setTemp8(this.convertFileUrlArrayToString(params.getLivePhotosUrl()));
         // 会议内容
         // 会议内容
-        taskContent.setTemp9(String.join(",", params.getMeetingContentUrl()));
+        taskContent.setTemp9(this.convertFileUrlArrayToString(params.getMeetingContentUrl()));
         // 外采费用
         // 外采费用
         taskContent.setTemp10(params.getOutsourcingAmount());
         taskContent.setTemp10(params.getOutsourcingAmount());
         // 外采费用凭证
         // 外采费用凭证
-        taskContent.setTemp11(String.join(",", params.getOutsourcingAmountProof()));
+        taskContent.setTemp11(this.convertFileUrlArrayToString(params.getOutsourcingAmountProof()));
         // 总结
         // 总结
         taskContent.setTemp12(params.getMeetingSummary());
         taskContent.setTemp12(params.getMeetingSummary());
         log.info("保存taskContent参数:{}", taskContent);
         log.info("保存taskContent参数:{}", taskContent);
@@ -256,7 +275,10 @@ public class WmDeptTaskServiceImpl implements WmDeptTaskService {
         int score = wmTaskTypeService.getWmTaskTypeByEnt(wmTaskType);
         int score = wmTaskTypeService.getWmTaskTypeByEnt(wmTaskType);
 
 
         // 校验是否超过可分配积分值
         // 校验是否超过可分配积分值
-        if (score > scorePackage.getKfpjf()) {
+        List<WmScorePackage> scorePackagekfpjf =
+                wmScorePackageService.getScorePackagekfpjf(SecurityUtils.getUser().getDeptId(),
+                        new String[]{"0", "1", "2"}, new String[]{params.getPackageId()});
+        if (score > scorePackagekfpjf.get(0).getKfpjf()) {
             throw new RuntimeException("可分配积分不足!");
             throw new RuntimeException("可分配积分不足!");
         }
         }
 
 
@@ -291,19 +313,19 @@ public class WmDeptTaskServiceImpl implements WmDeptTaskService {
         // 参加人次
         // 参加人次
         taskContent.setTemp4(params.getMeetingNumber());
         taskContent.setTemp4(params.getMeetingNumber());
         // 活动策划书
         // 活动策划书
-        taskContent.setTemp5(String.join(",", params.getEventPlannerUrl()));
+        taskContent.setTemp5(this.convertFileUrlArrayToString(params.getEventPlannerUrl()));
         // 活动计划表
         // 活动计划表
-        taskContent.setTemp6(String.join(",", params.getMeetingPlanUrl()));
+        taskContent.setTemp6(this.convertFileUrlArrayToString(params.getMeetingPlanUrl()));
         // 会议签到表
         // 会议签到表
-        taskContent.setTemp7(String.join(",", params.getMeetingCheckInUrl()));
+        taskContent.setTemp7(this.convertFileUrlArrayToString(params.getMeetingCheckInUrl()));
         // 现场照片
         // 现场照片
-        taskContent.setTemp8(String.join(",", params.getLivePhotosUrl()));
+        taskContent.setTemp8(this.convertFileUrlArrayToString(params.getLivePhotosUrl()));
         // 会议内容
         // 会议内容
-        taskContent.setTemp9(String.join(",", params.getMeetingContentUrl()));
+        taskContent.setTemp9(this.convertFileUrlArrayToString(params.getMeetingContentUrl()));
         // 外采费用
         // 外采费用
         taskContent.setTemp10(params.getOutsourcingAmount());
         taskContent.setTemp10(params.getOutsourcingAmount());
         // 外采费用凭证
         // 外采费用凭证
-        taskContent.setTemp11(String.join(",", params.getOutsourcingAmountProof()));
+        taskContent.setTemp11(this.convertFileUrlArrayToString(params.getOutsourcingAmountProof()));
         // 总结
         // 总结
         taskContent.setTemp12(params.getMeetingSummary());
         taskContent.setTemp12(params.getMeetingSummary());
         log.info("保存taskContent参数:{}", taskContent);
         log.info("保存taskContent参数:{}", taskContent);
@@ -389,4 +411,24 @@ public class WmDeptTaskServiceImpl implements WmDeptTaskService {
         wmScorePackageService.updateById(updatePackage);
         wmScorePackageService.updateById(updatePackage);
     }
     }
 
 
+    /**
+     * 将文件地址数组转换为字符串
+     *
+     * @param array 数组
+     * @return {@link String}
+     */
+    private String convertFileUrlArrayToString(String[] array) {
+        StringBuilder temp = new StringBuilder();
+        if (ArrayUtil.isNotEmpty(array)) {
+            for (int i = 0; i < array.length; i++) {
+                String file = array[i];
+                temp.append(StrUtil.startWith(file, "http")? file : upmsConfig.getClientUrl() + file);
+                if (i < array.length - 1) {
+                    temp.append(",");
+                }
+            }
+        }
+        return temp.toString();
+    }
+
 }
 }

+ 15 - 7
hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/service/impl/WmScorePackageServiceImpl.java

@@ -19,6 +19,7 @@ package com.qunzhixinxi.hnqz.admin.service.impl;
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.collection.CollectionUtil;
 import cn.hutool.core.collection.CollectionUtil;
+import cn.hutool.core.util.ArrayUtil;
 import cn.hutool.core.util.DesensitizedUtil;
 import cn.hutool.core.util.DesensitizedUtil;
 import cn.hutool.core.util.NumberUtil;
 import cn.hutool.core.util.NumberUtil;
 import cn.hutool.core.util.RandomUtil;
 import cn.hutool.core.util.RandomUtil;
@@ -546,7 +547,7 @@ public class WmScorePackageServiceImpl extends ServiceImpl<WmScorePackageMapper,
 //		wmScorePackage.setDeptId(deptId);
 //		wmScorePackage.setDeptId(deptId);
 //		wmScorePackage.setTypeid("0,1,2");
 //		wmScorePackage.setTypeid("0,1,2");
 //		wmScorePackage.setSendPackageDeptId(wmScorePackage.getRelatedService());
 //		wmScorePackage.setSendPackageDeptId(wmScorePackage.getRelatedService());
-		List<WmScorePackage> packageList = this.getScorePackagekfpjf(deptId, new String[]{"0", "1", "2"});
+		List<WmScorePackage> packageList = this.getScorePackagekfpjf(deptId, new String[]{"0", "1", "2"}, null);
 
 
 		for (WmScorePackage wmScorePackage1 : packageList) {
 		for (WmScorePackage wmScorePackage1 : packageList) {
 			List<WmScoreTaskType> taskTypelist = wmScoreTaskTypeMapper.getScoreTaskTypeByScoreId(wmScorePackage1.getId());
 			List<WmScoreTaskType> taskTypelist = wmScoreTaskTypeMapper.getScoreTaskTypeByScoreId(wmScorePackage1.getId());
@@ -3177,19 +3178,26 @@ public class WmScorePackageServiceImpl extends ServiceImpl<WmScorePackageMapper,
 	/**
 	/**
 	 * 获取指定企业下积分包的可分配积分值
 	 * 获取指定企业下积分包的可分配积分值
 	 *
 	 *
-	 * @param deptId  企业id
-	 * @param typeIds 企业类型
+	 * @param deptId     企业id
+	 * @param typeIds    企业类型
+	 * @param packageIds 积分包id
 	 * @return 结果
 	 * @return 结果
 	 */
 	 */
 	@Override
 	@Override
-	public List<WmScorePackage> getScorePackagekfpjf(Integer deptId, String[] typeIds) {
+	public List<WmScorePackage> getScorePackagekfpjf(Integer deptId, String[] typeIds, String[] packageIds) {
 		// 查询企业下的积分包
 		// 查询企业下的积分包
-		List<WmScorePackage> packages = this.list(Wrappers.<WmScorePackage>lambdaQuery()
-				.eq(WmScorePackage::getDeptId, deptId)
+		LambdaQueryWrapper<WmScorePackage> queryWrapper = Wrappers.<WmScorePackage>lambdaQuery()
 				.in(WmScorePackage::getTypeid, typeIds)
 				.in(WmScorePackage::getTypeid, typeIds)
 				.eq(WmScorePackage::getDelFlag, DelEnum.NOT_DEL.val())
 				.eq(WmScorePackage::getDelFlag, DelEnum.NOT_DEL.val())
 				.eq(WmScorePackage::getEnableFlag, EnableEnum.ENABLE.val())
 				.eq(WmScorePackage::getEnableFlag, EnableEnum.ENABLE.val())
-				.eq(WmScorePackage::getOldPackage, "0"));
+				.eq(WmScorePackage::getOldPackage, "0");
+		if (deptId != null) {
+			queryWrapper.eq(WmScorePackage::getDeptId, deptId);
+		}
+		if (ArrayUtil.isNotEmpty(packageIds)) {
+			queryWrapper.in(WmScorePackage::getId, packageIds);
+		}
+		List<WmScorePackage> packages = this.list(queryWrapper);
 
 
 		if (CollUtil.isNotEmpty(packages)) {
 		if (CollUtil.isNotEmpty(packages)) {
 			// 查询积分包的子包
 			// 查询积分包的子包