|
@@ -121,6 +121,7 @@ import lombok.extern.slf4j.Slf4j;
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
import org.apache.commons.io.IOUtils;
|
|
import org.apache.commons.io.IOUtils;
|
|
import org.apache.commons.lang3.ArrayUtils;
|
|
import org.apache.commons.lang3.ArrayUtils;
|
|
|
|
+import org.apache.commons.lang3.RandomStringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.springframework.data.redis.core.RedisTemplate;
|
|
import org.springframework.data.redis.core.RedisTemplate;
|
|
import org.springframework.mock.web.MockMultipartFile;
|
|
import org.springframework.mock.web.MockMultipartFile;
|
|
@@ -658,7 +659,7 @@ public class ApiController {
|
|
|
|
|
|
// 小程序角色:5-全职学术信息沟通专员, 6-兼职学术信息沟通专员, 10-兼职CRC, 13-HCP
|
|
// 小程序角色:5-全职学术信息沟通专员, 6-兼职学术信息沟通专员, 10-兼职CRC, 13-HCP
|
|
List<Integer> roleIdList = sysU.getRoleList().stream().filter(item ->
|
|
List<Integer> roleIdList = sysU.getRoleList().stream().filter(item ->
|
|
- item.getRoleId() == 5 || item.getRoleId() == 6 || item.getRoleId() == 10 || item.getRoleId() == 13)
|
|
|
|
|
|
+ item.getRoleId() == 5 || item.getRoleId() == 6 || item.getRoleId() == 10 || item.getRoleId() == 13)
|
|
.map(SysRole::getRoleId).collect(Collectors.toList());
|
|
.map(SysRole::getRoleId).collect(Collectors.toList());
|
|
|
|
|
|
if ("2".equals(management) && roleIdList.contains(5)) {
|
|
if ("2".equals(management) && roleIdList.contains(5)) {
|
|
@@ -757,6 +758,24 @@ public class ApiController {
|
|
List<SysUserSubVO> userSignCertList = sysUserSignCertService.listUserSignCertForApi(sysU.getUserId());
|
|
List<SysUserSubVO> userSignCertList = sysUserSignCertService.listUserSignCertForApi(sysU.getUserId());
|
|
mapOne.put("certList", userSignCertList);
|
|
mapOne.put("certList", userSignCertList);
|
|
|
|
|
|
|
|
+ // 获取发起认证的令牌
|
|
|
|
+ String randomStr;
|
|
|
|
+
|
|
|
|
+ // 获取操作员
|
|
|
|
+ HnqzUser finaAdmin = SecurityUtils.getUser();
|
|
|
|
+ final String token = String.format("%d:batch_channel_cert:%d:token", finaAdmin.getTenantId(), finaAdmin.getId());
|
|
|
|
+
|
|
|
|
+ // 返回缓存生成好的
|
|
|
|
+ if (Boolean.TRUE.equals(redisTemplate.hasKey(token))) {
|
|
|
|
+ randomStr = (String) redisTemplate.opsForValue().get(token);
|
|
|
|
+ } else {
|
|
|
|
+ // 生成缓存key,将token缓存到redis
|
|
|
|
+ do {
|
|
|
|
+ randomStr = RandomStringUtils.randomNumeric(6);
|
|
|
|
+ } while (Boolean.FALSE.equals(redisTemplate.opsForValue().setIfAbsent(token, randomStr)));
|
|
|
|
+ }
|
|
|
|
+ mapOne.put("certToken", randomStr);
|
|
|
|
+
|
|
list.add(mapOne);
|
|
list.add(mapOne);
|
|
|
|
|
|
roleList.addAll(roleIdList);
|
|
roleList.addAll(roleIdList);
|
|
@@ -819,16 +838,16 @@ public class ApiController {
|
|
.in(WmTaskType::getParentId, parentId));
|
|
.in(WmTaskType::getParentId, parentId));
|
|
|
|
|
|
// 按照父id分组
|
|
// 按照父id分组
|
|
- Map<String,Map<String, List<WmTaskType>>> pTaskTypeMap = baseTypeList1.stream()
|
|
|
|
- .collect(Collectors.groupingBy(WmTaskType::getParentId,Collectors.groupingBy(WmTaskType::getBaseId)));
|
|
|
|
|
|
+ Map<String, Map<String, List<WmTaskType>>> pTaskTypeMap = baseTypeList1.stream()
|
|
|
|
+ .collect(Collectors.groupingBy(WmTaskType::getParentId, Collectors.groupingBy(WmTaskType::getBaseId)));
|
|
|
|
|
|
// 查询所有子id对应的taskType列表
|
|
// 查询所有子id对应的taskType列表
|
|
List<WmTaskType> baseTypeList2 = wmTaskTypeService.
|
|
List<WmTaskType> baseTypeList2 = wmTaskTypeService.
|
|
list(Wrappers.<WmTaskType>query().lambda().eq(WmTaskType::getTaskTypeLevel, "1").in(WmTaskType::getId, id));
|
|
list(Wrappers.<WmTaskType>query().lambda().eq(WmTaskType::getTaskTypeLevel, "1").in(WmTaskType::getId, id));
|
|
|
|
|
|
// 所有子id对应的taskType列表 按照父id分组
|
|
// 所有子id对应的taskType列表 按照父id分组
|
|
- Map<String,Map<String, List<WmTaskType>>> cTaskTypeMap = baseTypeList2.stream()
|
|
|
|
- .collect(Collectors.groupingBy(WmTaskType::getParentId,Collectors.groupingBy(WmTaskType::getBaseId)));
|
|
|
|
|
|
+ Map<String, Map<String, List<WmTaskType>>> cTaskTypeMap = baseTypeList2.stream()
|
|
|
|
+ .collect(Collectors.groupingBy(WmTaskType::getParentId, Collectors.groupingBy(WmTaskType::getBaseId)));
|
|
// 对应的parentId
|
|
// 对应的parentId
|
|
Set<String> cPidSet = cTaskTypeMap.keySet();
|
|
Set<String> cPidSet = cTaskTypeMap.keySet();
|
|
|
|
|
|
@@ -2863,7 +2882,6 @@ public class ApiController {
|
|
sysUserService.updateById(sysUser);
|
|
sysUserService.updateById(sysUser);
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
return R.ok();
|
|
return R.ok();
|
|
}
|
|
}
|
|
|
|
|
|
@@ -3245,21 +3263,20 @@ public class ApiController {
|
|
|
|
|
|
List<Map<String, Object>> listMap = new ArrayList<>();
|
|
List<Map<String, Object>> listMap = new ArrayList<>();
|
|
|
|
|
|
-
|
|
|
|
- statusList.parallelStream().forEach(item -> {
|
|
|
|
|
|
+ for (WmScorePackageStatus item : statusList) {
|
|
WmScorePackage wmScorePackage = wmScorePackageService.getById(item.getPackageId());
|
|
WmScorePackage wmScorePackage = wmScorePackageService.getById(item.getPackageId());
|
|
if (null != wmScorePackage) {
|
|
if (null != wmScorePackage) {
|
|
if ("0".equals(wmScorePackage.getTaskAddFlag())) {
|
|
if ("0".equals(wmScorePackage.getTaskAddFlag())) {
|
|
- return;
|
|
|
|
|
|
+ continue;
|
|
}
|
|
}
|
|
if ("1".equals(wmScorePackage.getEnableFlag())) {
|
|
if ("1".equals(wmScorePackage.getEnableFlag())) {
|
|
- return;
|
|
|
|
|
|
+ continue;
|
|
}
|
|
}
|
|
if ("2".equals(wmScorePackage.getPackageType2())) {
|
|
if ("2".equals(wmScorePackage.getPackageType2())) {
|
|
- return;
|
|
|
|
|
|
+ continue;
|
|
}
|
|
}
|
|
if ("3".equals(wmScorePackage.getPackageType1())) {
|
|
if ("3".equals(wmScorePackage.getPackageType1())) {
|
|
- return;
|
|
|
|
|
|
+ continue;
|
|
}
|
|
}
|
|
/**
|
|
/**
|
|
* 过滤有效任务类型
|
|
* 过滤有效任务类型
|
|
@@ -3281,44 +3298,7 @@ public class ApiController {
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
- });
|
|
|
|
-
|
|
|
|
-// for (WmScorePackageStatus item : statusList) {
|
|
|
|
-// WmScorePackage wmScorePackage = wmScorePackageService.getById(item.getPackageId());
|
|
|
|
-// if (null != wmScorePackage) {
|
|
|
|
-// if ("0".equals(wmScorePackage.getTaskAddFlag())) {
|
|
|
|
-// continue;
|
|
|
|
-// }
|
|
|
|
-// if ("1".equals(wmScorePackage.getEnableFlag())) {
|
|
|
|
-// continue;
|
|
|
|
-// }
|
|
|
|
-// if ("2".equals(wmScorePackage.getPackageType2())) {
|
|
|
|
-// continue;
|
|
|
|
-// }
|
|
|
|
-// if ("3".equals(wmScorePackage.getPackageType1())) {
|
|
|
|
-// continue;
|
|
|
|
-// }
|
|
|
|
-// /**
|
|
|
|
-// * 过滤有效任务类型
|
|
|
|
-// */
|
|
|
|
-// WmScoreTaskType taskType = new WmScoreTaskType();
|
|
|
|
-// taskType.setTaskTypeId(type);
|
|
|
|
-// taskType.setScoreId(wmScorePackage.getId());
|
|
|
|
-//// List<WmScoreTaskType> taskTypes = wmScoreTaskTypeService.
|
|
|
|
-//// list(Wrappers.query(taskType));
|
|
|
|
-// int total = wmScoreTaskTypeService.count(Wrappers.query(taskType));
|
|
|
|
-//
|
|
|
|
-// if (total != 0) {
|
|
|
|
-// Map<String, Object> map = new HashMap<>();
|
|
|
|
-// map.put("label", wmScorePackage.getScorePackageName());
|
|
|
|
-// map.put("value", wmScorePackage.getId());
|
|
|
|
-// String drugProducer = ArrayUtils.isEmpty(wmScorePackage.getDrugProducerList()) ? "" : String.join(StrUtil.COMMA, wmScorePackage.getDrugProducerList());
|
|
|
|
-// map.put("drugProducer", drugProducer);
|
|
|
|
-// listMap.add(map);
|
|
|
|
-// }
|
|
|
|
-//
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
|
|
+ }
|
|
|
|
|
|
return R.ok(listMap);
|
|
return R.ok(listMap);
|
|
}
|
|
}
|
|
@@ -3441,7 +3421,7 @@ public class ApiController {
|
|
* @param packageId 积分包id
|
|
* @param packageId 积分包id
|
|
* @param sharePicUrl 分享图片链接
|
|
* @param sharePicUrl 分享图片链接
|
|
* @param taskCategoryName 任务类别名称
|
|
* @param taskCategoryName 任务类别名称
|
|
- * @param remark 备注
|
|
|
|
|
|
+ * @param remark 备注
|
|
* @return 结果
|
|
* @return 结果
|
|
*/
|
|
*/
|
|
private R<?> shareAndReadTaskMethod(String id, String shareUserId, String openUserId, String type, String packageId,
|
|
private R<?> shareAndReadTaskMethod(String id, String shareUserId, String openUserId, String type, String packageId,
|
|
@@ -3951,12 +3931,13 @@ public class ApiController {
|
|
|
|
|
|
/**
|
|
/**
|
|
* 记录广告点击情况
|
|
* 记录广告点击情况
|
|
|
|
+ *
|
|
* @param json 请求参数
|
|
* @param json 请求参数
|
|
* @return 记录结果
|
|
* @return 记录结果
|
|
*/
|
|
*/
|
|
@PostMapping(value = "/ad-record")
|
|
@PostMapping(value = "/ad-record")
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
- public R<Boolean> insertAdRecord(@RequestBody String json){
|
|
|
|
|
|
+ public R<Boolean> insertAdRecord(@RequestBody String json) {
|
|
JSONObject jsonObject = JSONObject.parseObject(json);
|
|
JSONObject jsonObject = JSONObject.parseObject(json);
|
|
WmAdRecord record = new WmAdRecord();
|
|
WmAdRecord record = new WmAdRecord();
|
|
record.setUrl(jsonObject.getString("url"));
|
|
record.setUrl(jsonObject.getString("url"));
|