|
@@ -4,17 +4,16 @@ import cn.hutool.core.bean.BeanUtil;
|
|
|
import cn.hutool.core.bean.copier.CopyOptions;
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
|
-import cn.hutool.core.date.DatePattern;
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
import cn.hutool.core.io.FileUtil;
|
|
|
import cn.hutool.core.lang.Assert;
|
|
|
+import cn.hutool.core.map.MapUtil;
|
|
|
import cn.hutool.core.util.IdUtil;
|
|
|
import cn.hutool.core.util.ArrayUtil;
|
|
|
import cn.hutool.core.util.IdcardUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import cn.hutool.json.JSONUtil;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
-import com.alibaba.fastjson.JSONPObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
@@ -25,17 +24,15 @@ import com.qunzhixinxi.hnqz.admin.api.constant.CacheConstants;
|
|
|
import com.qunzhixinxi.hnqz.admin.api.constant.UpmsType;
|
|
|
import com.qunzhixinxi.hnqz.admin.api.dto.UserDTO;
|
|
|
import com.qunzhixinxi.hnqz.admin.api.entity.SysDept;
|
|
|
+import com.qunzhixinxi.hnqz.admin.api.entity.SysDeptCsm;
|
|
|
import com.qunzhixinxi.hnqz.admin.api.entity.SysDictItem;
|
|
|
import com.qunzhixinxi.hnqz.admin.api.entity.SysRole;
|
|
|
import com.qunzhixinxi.hnqz.admin.api.entity.SysUser;
|
|
|
import com.qunzhixinxi.hnqz.admin.api.entity.WmAdRecord;
|
|
|
import com.qunzhixinxi.hnqz.admin.api.entity.WmTaskSubmissionRule;
|
|
|
-import com.qunzhixinxi.hnqz.admin.api.enums.SignatureStatusEnum;
|
|
|
import com.qunzhixinxi.hnqz.admin.api.vo.UserVO;
|
|
|
import com.qunzhixinxi.hnqz.admin.config.UpmsConfig;
|
|
|
-import com.qunzhixinxi.hnqz.admin.entity.SysCertResultRecord;
|
|
|
import com.qunzhixinxi.hnqz.admin.entity.SysDeptSub;
|
|
|
-import com.qunzhixinxi.hnqz.admin.entity.SysUserExtRecord;
|
|
|
import com.qunzhixinxi.hnqz.admin.entity.WmDaAgent;
|
|
|
import com.qunzhixinxi.hnqz.admin.entity.WmDaDistribution;
|
|
|
import com.qunzhixinxi.hnqz.admin.entity.WmDaDrugEnt;
|
|
@@ -67,7 +64,7 @@ import com.qunzhixinxi.hnqz.admin.enums.PackageTypeEnum;
|
|
|
import com.qunzhixinxi.hnqz.admin.enums.SubjectLocation;
|
|
|
import com.qunzhixinxi.hnqz.admin.enums.SubjectTypeEnum;
|
|
|
import com.qunzhixinxi.hnqz.admin.enums.UserSignResultEnum;
|
|
|
-import com.qunzhixinxi.hnqz.admin.mapper.SysCertResultRecordMapper;
|
|
|
+import com.qunzhixinxi.hnqz.admin.service.SysDeptCsmService;
|
|
|
import com.qunzhixinxi.hnqz.admin.service.SysDeptService;
|
|
|
import com.qunzhixinxi.hnqz.admin.service.SysDeptSubService;
|
|
|
import com.qunzhixinxi.hnqz.admin.service.SysDictItemService;
|
|
@@ -93,7 +90,6 @@ import com.qunzhixinxi.hnqz.admin.service.WmTaskRuleService;
|
|
|
import com.qunzhixinxi.hnqz.admin.service.WmTaskService;
|
|
|
import com.qunzhixinxi.hnqz.admin.service.WmTaskSubmissionRuleService;
|
|
|
import com.qunzhixinxi.hnqz.admin.service.WmTaskTypeService;
|
|
|
-import com.qunzhixinxi.hnqz.admin.service.WmTaskTypeSubCategoryService;
|
|
|
import com.qunzhixinxi.hnqz.admin.service.WmUserSignDetailService;
|
|
|
import com.qunzhixinxi.hnqz.admin.service.WmUserSignService;
|
|
|
import com.qunzhixinxi.hnqz.admin.service.WmWkAlbumService;
|
|
@@ -106,22 +102,10 @@ import com.qunzhixinxi.hnqz.admin.util.QRCodeGenerator;
|
|
|
import com.qunzhixinxi.hnqz.admin.view.user.UserUpdateInput;
|
|
|
import com.qunzhixinxi.hnqz.common.core.constant.CommonConstants;
|
|
|
import com.qunzhixinxi.hnqz.common.core.util.R;
|
|
|
-import com.qunzhixinxi.hnqz.common.ding.config.DingConfig;
|
|
|
-import com.qunzhixinxi.hnqz.common.ding.entity.EmployCheckResponse;
|
|
|
-import com.qunzhixinxi.hnqz.common.ding.entity.EmployCheckResultItem;
|
|
|
-import com.qunzhixinxi.hnqz.common.ding.enums.DingEnum;
|
|
|
-import com.qunzhixinxi.hnqz.common.ding.service.DingService;
|
|
|
import com.qunzhixinxi.hnqz.common.log.annotation.SysLog;
|
|
|
-import com.qunzhixinxi.hnqz.common.oss.service.OssTemplate;
|
|
|
import com.qunzhixinxi.hnqz.common.security.annotation.Inner;
|
|
|
import com.qunzhixinxi.hnqz.common.security.service.HnqzUser;
|
|
|
import com.qunzhixinxi.hnqz.common.security.util.SecurityUtils;
|
|
|
-import com.qunzhixinxi.hnqz.common.taxhelper.config.TaxHelperConfig;
|
|
|
-import com.qunzhixinxi.hnqz.common.taxhelper.entity.model.TaxHelperAddMemberModel;
|
|
|
-import com.qunzhixinxi.hnqz.common.taxhelper.entity.request.TaxHelperAddMemberRequest;
|
|
|
-import com.qunzhixinxi.hnqz.common.taxhelper.entity.response.TaxHelperResponse;
|
|
|
-import com.qunzhixinxi.hnqz.common.taxhelper.enums.TaxHelperCertStatus;
|
|
|
-import com.qunzhixinxi.hnqz.common.taxhelper.service.TaxHelperService;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
|
import io.swagger.annotations.ApiImplicitParams;
|
|
@@ -163,11 +147,9 @@ import java.text.ParseException;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.time.Duration;
|
|
|
import java.time.Instant;
|
|
|
-import java.time.LocalDate;
|
|
|
import java.time.LocalDateTime;
|
|
|
import java.time.LocalTime;
|
|
|
import java.time.ZoneId;
|
|
|
-import java.time.temporal.ChronoUnit;
|
|
|
import java.time.temporal.TemporalAdjusters;
|
|
|
import java.util.*;
|
|
|
import java.util.concurrent.TimeUnit;
|
|
@@ -175,10 +157,11 @@ import java.util.stream.Collectors;
|
|
|
import java.util.stream.Stream;
|
|
|
|
|
|
/**
|
|
|
- * @author hnqz
|
|
|
- * @date 2018/11/14
|
|
|
- * <p>
|
|
|
- * 手机验证码
|
|
|
+ * 小程序请求接口
|
|
|
+ *
|
|
|
+ * @author jimmy
|
|
|
+ * @version 1.0.0
|
|
|
+ * @date 2022-10-10 12:45
|
|
|
*/
|
|
|
@Slf4j
|
|
|
@RestController
|
|
@@ -206,12 +189,8 @@ public class ApiController {
|
|
|
private final SysFileService sysFileService;
|
|
|
private final WmFeedbackService wmFeedbackService;
|
|
|
private final WmDaPharmacyService wmDaPharmacyService;
|
|
|
- private final RedisTemplate redisTemplate;
|
|
|
- private final OssTemplate minioTemplate;
|
|
|
- private final DingService dingService;
|
|
|
+ private final RedisTemplate<String, Object> redisTemplate;
|
|
|
private final UpmsConfig upmsConfig;
|
|
|
- private final TaxHelperService taxHelperService;
|
|
|
- private final SysCertResultRecordMapper sysCertResultRecordMapper;
|
|
|
private final SysDeptSubService sysDeptSubService;
|
|
|
private final SysPublicParamService sysPublicParamService;
|
|
|
private final WmWkAlbumService wmWkAlbumService;
|
|
@@ -221,7 +200,7 @@ public class ApiController {
|
|
|
private final SysUserSignCertService sysUserSignCertService;
|
|
|
private final SysUserExtRecordService sysUserExtRecordService;
|
|
|
private final WmTaskSubmissionRuleService taskSubmissionRuleService;
|
|
|
- private final WmTaskTypeSubCategoryService taskTypeSubCategoryService;
|
|
|
+ private final SysDeptCsmService deptCsmService;
|
|
|
|
|
|
@SysLog("通过任务类型获取表单配置")
|
|
|
@ApiOperation(value = "任务类型表单配置-通过任务类型获取表单配置", notes = "根据任务类型获取表单配置")
|
|
@@ -594,244 +573,219 @@ public class ApiController {
|
|
|
return R.ok(connfigMap);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 用户信息-获取用户基本信息
|
|
|
+ *
|
|
|
+ * @param code 小程序信息code
|
|
|
+ * @param avatar 头像
|
|
|
+ * @return 用户信息
|
|
|
+ */
|
|
|
@ApiOperation(value = "用户信息-获取用户基本信息", notes = "登录认证成功后,调用此接口获取用户基本信息")
|
|
|
- @ApiImplicitParams({
|
|
|
- @ApiImplicitParam(name = "code", value = "小程序信息code", dataType = "String", paramType = "query")})
|
|
|
+ @ApiImplicitParams({@ApiImplicitParam(name = "code", value = "小程序信息code", dataType = "String", paramType = "query")})
|
|
|
@GetMapping("/getUserInfoByCode")
|
|
|
- public R getUserInfo(String code, String avatar) {
|
|
|
+ public R<Map<String, Object>> getUserInfo(String code, String avatar) {
|
|
|
Map<String, Object> result = new HashMap<>();
|
|
|
|
|
|
- UserDTO userDTO = new UserDTO();
|
|
|
- userDTO.setPlatId(SecurityUtils.getUser().getPlatId());
|
|
|
//获取用户基本信息
|
|
|
+ HnqzUser hnqzUser = SecurityUtils.getUser();
|
|
|
+ UserDTO userDTO = new UserDTO();
|
|
|
+ userDTO.setPlatId(hnqzUser.getPlatId());
|
|
|
List<UserVO> sysUserList = sysUserService.getUserVoByPlatId(userDTO);
|
|
|
|
|
|
- if (sysUserList.size() == 0) {
|
|
|
+ if (CollUtil.isEmpty(sysUserList)) {
|
|
|
return R.failed("账号信息异常,请联系管理员");
|
|
|
}
|
|
|
|
|
|
//获取小程序openid
|
|
|
- Map<String, Object> opemMap = GetOpenIDUtil.oauth2GetOpenid(code, upmsConfig.getWechatEnv());
|
|
|
- System.out.println("opemMap:" + opemMap);
|
|
|
- if (null != opemMap) {
|
|
|
- String openid = opemMap.get("openid") + "";
|
|
|
-
|
|
|
- SysUser sysUser1 = sysUserService.getById(SecurityUtils.getUser().getId());
|
|
|
- if (null == sysUser1.getWxOpenid() || null == sysUser1.getAvatar()) {
|
|
|
- sysUser1.setWxOpenid(openid);
|
|
|
- sysUser1.setAvatar(avatar);
|
|
|
- sysUserService.saveOrUpdate(sysUser1);
|
|
|
+ SysUser u = sysUserService.getById(hnqzUser.getId());
|
|
|
+ if (StrUtil.isBlank(u.getWxOpenid()) || StrUtil.isBlank(u.getAvatar())) {
|
|
|
+ Map<String, Object> opemMap = GetOpenIDUtil.oauth2GetOpenid(code, upmsConfig.getWechatEnv());
|
|
|
+ log.info("opemMap: {}", opemMap);
|
|
|
+ if (MapUtil.isNotEmpty(opemMap)) {
|
|
|
+ String openid = (String) opemMap.get("openid");
|
|
|
+ u.setWxOpenid(openid);
|
|
|
+ u.setAvatar(avatar);
|
|
|
+ sysUserService.saveOrUpdate(u);
|
|
|
}
|
|
|
}
|
|
|
- Integer completedCount = 0;
|
|
|
- Integer sumCount = 0;
|
|
|
-
|
|
|
|
|
|
List<Integer> roleList = new ArrayList<>();
|
|
|
- if (null != sysUserList && sysUserList.size() > 0) {
|
|
|
- List<Map<String, Object>> list = new ArrayList<>();
|
|
|
- for (UserVO sysU : sysUserList) {
|
|
|
- Integer onTheWay = 0;
|
|
|
- Integer waitApprove = 0;
|
|
|
- Map<String, Object> mapOne = new HashMap<>();
|
|
|
- mapOne.put("userId", sysU.getUserId() + "");
|
|
|
- mapOne.put("realname", sysU.getRealname() + "");
|
|
|
- mapOne.put("phone", sysU.getPhone() + "");
|
|
|
- mapOne.put("idCardNumber", sysU.getIdCardNumber());
|
|
|
- mapOne.put("certStatus", sysU.getCertStatus());
|
|
|
- mapOne.put("rljCertStatus", sysU.getRljCertStatus());
|
|
|
- mapOne.put("userSign", sysU.getUserSign());
|
|
|
- mapOne.put("certRemark", sysU.getCertRemark());
|
|
|
- mapOne.put("taxHelperAgreementSignature", sysU.getTaxHelperAgreementSignature());
|
|
|
- mapOne.put("bankCardNumber", sysU.getBankCardNumber());
|
|
|
- mapOne.put("bankPhone", sysU.getBankPhone());
|
|
|
-
|
|
|
- if (redisTemplate.hasKey(CacheConstants.USER_NOTICE_KEY + sysU.getUserId())) {
|
|
|
- mapOne.put("notice", true);
|
|
|
- }
|
|
|
- if (redisTemplate.hasKey(CacheConstants.USER_ADD_NOTICE_KEY + sysU.getUserId())) {
|
|
|
- mapOne.put("userNewFlag", true);
|
|
|
- }
|
|
|
|
|
|
- if (null == sysU.getAvatar() || "".equals(sysU.getAvatar())) {
|
|
|
- mapOne.put("avatar", avatar);
|
|
|
- SysUser sysUser2 = sysUserService.getById(sysU.getUserId());
|
|
|
- sysUser2.setAvatar(avatar);
|
|
|
- sysUserService.updateById(sysUser2);
|
|
|
- } else {
|
|
|
- mapOne.put("avatar", sysU.getAvatar() + "");
|
|
|
- }
|
|
|
+ List<Map<String, Object>> list = new ArrayList<>(sysUserList.size());
|
|
|
+ for (UserVO sysU : sysUserList) {
|
|
|
+
|
|
|
+ Map<String, Object> mapOne = new HashMap<>();
|
|
|
+ mapOne.put("userId", sysU.getUserId().toString());
|
|
|
+ mapOne.put("realname", sysU.getRealname());
|
|
|
+ mapOne.put("phone", sysU.getPhone());
|
|
|
+ mapOne.put("idCardNumber", sysU.getIdCardNumber());
|
|
|
+ mapOne.put("certStatus", sysU.getCertStatus());
|
|
|
+ mapOne.put("rljCertStatus", sysU.getRljCertStatus());
|
|
|
+ mapOne.put("userSign", sysU.getUserSign());
|
|
|
+ mapOne.put("certRemark", sysU.getCertRemark());
|
|
|
+ mapOne.put("taxHelperAgreementSignature", sysU.getTaxHelperAgreementSignature());
|
|
|
+ mapOne.put("bankCardNumber", sysU.getBankCardNumber());
|
|
|
+ mapOne.put("bankPhone", sysU.getBankPhone());
|
|
|
+
|
|
|
+ if (Boolean.TRUE.equals(redisTemplate.hasKey(CacheConstants.USER_NOTICE_KEY + sysU.getUserId()))) {
|
|
|
+ mapOne.put("notice", true);
|
|
|
+ }
|
|
|
+ if (Boolean.TRUE.equals(redisTemplate.hasKey(CacheConstants.USER_ADD_NOTICE_KEY + sysU.getUserId()))) {
|
|
|
+ mapOne.put("userNewFlag", true);
|
|
|
+ }
|
|
|
|
|
|
- SysDept sysDept = sysDeptService.getById(sysU.getDeptId());
|
|
|
- if (null != sysDept) {
|
|
|
- mapOne.put("deptId", sysDept.getDeptId() + "");
|
|
|
- mapOne.put("deptName", sysDept.getName() + "");
|
|
|
- }
|
|
|
+ if (StrUtil.isBlank(sysU.getAvatar())) {
|
|
|
+ mapOne.put("avatar", avatar);
|
|
|
+ SysUser sysUser2 = sysUserService.getById(sysU.getUserId());
|
|
|
+ sysUser2.setAvatar(avatar);
|
|
|
+ sysUserService.updateById(sysUser2);
|
|
|
+ } else {
|
|
|
+ mapOne.put("avatar", sysU.getAvatar());
|
|
|
+ }
|
|
|
|
|
|
- String management;
|
|
|
- Boolean managementFlag = false;
|
|
|
- if (sysDept.getLevel() == 2) {
|
|
|
- WmDaDrugEnt drugEnt = wmDaDrugEntService.selectByDeptId(sysDept.getDeptId());
|
|
|
- mapOne.put("management", drugEnt.getManagement() + "");
|
|
|
- management = drugEnt.getManagement();
|
|
|
- } else {
|
|
|
- WmDaAgent agent = wmDaAgentService.selectByDeptId(sysDept.getDeptId());
|
|
|
- mapOne.put("management", agent.getManagement() + "");
|
|
|
- management = agent.getManagement();
|
|
|
- }
|
|
|
+ // 获取部门信息
|
|
|
+ SysDept sysDept = sysDeptService.getById(sysU.getDeptId());
|
|
|
+ mapOne.put("deptId", sysDept.getDeptId().toString());
|
|
|
+ mapOne.put("deptName", sysDept.getName() );
|
|
|
|
|
|
- // 小程序角色:5-全职学术信息沟通专员, 6-兼职学术信息沟通专员, 10-兼职CRC, 13-HCP
|
|
|
- List<Integer> roleIdList = sysU.getRoleList().stream().filter(item ->
|
|
|
- item.getRoleId() == 5 || item.getRoleId() == 6 || item.getRoleId() == 10 || item.getRoleId() == 13)
|
|
|
- .map(SysRole::getRoleId).collect(Collectors.toList());
|
|
|
-
|
|
|
- if ("2".equals(management) && roleIdList.contains(5)) {
|
|
|
- managementFlag = true;
|
|
|
- } else if ("3".equals(management) && roleIdList.contains(6)) {
|
|
|
- managementFlag = true;
|
|
|
- } else if ("3".equals(management) && roleIdList.contains(10)) {
|
|
|
- managementFlag = true;
|
|
|
- } else if ("4".equals(management)) {
|
|
|
- managementFlag = true;
|
|
|
- }
|
|
|
- mapOne.put("managementFlag", managementFlag);
|
|
|
+ // 获取csm信息
|
|
|
+ SysDeptCsm deptCsm = deptCsmService.getOne(Wrappers.<SysDeptCsm>lambdaQuery().eq(SysDeptCsm::getDeptId, sysU.getDeptId()));
|
|
|
+ mapOne.put("csm", deptCsm);
|
|
|
|
|
|
- WmDaDrugEnt wmDaDrugEnt = wmDaDrugEntService.getById(sysU.getDrugEntId());
|
|
|
- if (null != wmDaDrugEnt) {
|
|
|
- mapOne.put("drugEntId", wmDaDrugEnt.getId() + "");
|
|
|
- mapOne.put("drugEntName", wmDaDrugEnt.getEntname() + "");
|
|
|
- }
|
|
|
+ String management;
|
|
|
+ if (sysDept.getLevel() == 2) {
|
|
|
+ WmDaDrugEnt drugEnt = wmDaDrugEntService.selectByDeptId(sysDept.getDeptId());
|
|
|
+ mapOne.put("management", drugEnt.getManagement());
|
|
|
+ management = drugEnt.getManagement();
|
|
|
+ } else {
|
|
|
+ WmDaAgent agent = wmDaAgentService.selectByDeptId(sysDept.getDeptId());
|
|
|
+ mapOne.put("management", agent.getManagement());
|
|
|
+ management = agent.getManagement();
|
|
|
+ }
|
|
|
|
|
|
- mapOne.put("roles", roleIdList);
|
|
|
- mapOne.put("temp1", sysU.getTemp1() + "");
|
|
|
- mapOne.put("temp2", sysU.getTemp2() + "");
|
|
|
- mapOne.put("temp3", sysU.getTemp3() + "");
|
|
|
- mapOne.put("temp4", sysU.getTemp4() + "");
|
|
|
- mapOne.put("temp5", sysU.getTemp5() + "");
|
|
|
+ // 小程序角色:5-全职学术信息沟通专员, 6-兼职学术信息沟通专员, 10-兼职CRC, 13-HCP
|
|
|
+ List<Integer> roleIdList =
|
|
|
+ sysU.getRoleList().stream()
|
|
|
+ .filter(item -> item.getRoleId() == 5 || item.getRoleId() == 6 || item.getRoleId() == 10 || item.getRoleId() == 13)
|
|
|
+ .map(SysRole::getRoleId).collect(Collectors.toList());
|
|
|
+
|
|
|
+ boolean managementFlag =("2".equals(management) && roleIdList.contains(5))
|
|
|
+ || ("3".equals(management) && (roleIdList.contains(6) ||roleIdList.contains(10)))
|
|
|
+ ||("4".equals(management));
|
|
|
+ mapOne.put("managementFlag", managementFlag);
|
|
|
+
|
|
|
+ WmDaDrugEnt wmDaDrugEnt = wmDaDrugEntService.getById(sysU.getDrugEntId());
|
|
|
+ if (null != wmDaDrugEnt) {
|
|
|
+ mapOne.put("drugEntId", wmDaDrugEnt.getId());
|
|
|
+ mapOne.put("drugEntName", wmDaDrugEnt.getEntname());
|
|
|
+ }
|
|
|
|
|
|
- /**
|
|
|
- * 查询待审核包
|
|
|
- */
|
|
|
- WmScorePackageStatus wmScorePackageStatus = new WmScorePackageStatus();
|
|
|
- wmScorePackageStatus.setUserId(sysU.getUserId() + "");
|
|
|
- wmScorePackageStatus.setTaskAddFlag("1");
|
|
|
- wmScorePackageStatus.setDelFlag("0");
|
|
|
- wmScorePackageStatus.setEnableFlag("0");
|
|
|
- List<WmScorePackageStatus> statusList = wmScorePackageStatusService.
|
|
|
- list(Wrappers.query(wmScorePackageStatus));
|
|
|
-
|
|
|
- List<Map<String, Object>> listMap = new ArrayList<>();
|
|
|
-
|
|
|
- for (WmScorePackageStatus item : statusList) {
|
|
|
- WmScorePackage wmScorePackage = wmScorePackageService.getById(item.getPackageId());
|
|
|
- if (null != wmScorePackage) {
|
|
|
- if ("1".equals(item.getStatus())) {
|
|
|
- waitApprove++;
|
|
|
- } else if ("2".equals(item.getStatus())) {
|
|
|
- onTheWay++;
|
|
|
- Map<String, Object> map = new HashMap<>();
|
|
|
- map.put("label", wmScorePackage.getScorePackageName());
|
|
|
- map.put("value", wmScorePackage.getId());
|
|
|
- listMap.add(map);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- mapOne.put("packageList", listMap);
|
|
|
- mapOne.put("waitApprove", waitApprove + "");
|
|
|
- mapOne.put("onTheWay", onTheWay + "");
|
|
|
- mapOne.put("userType", sysU.getUserType());
|
|
|
- mapOne.put("jumpFlag", "0");
|
|
|
- if ("北京遥领医疗科技有限公司".equals(sysDept.getName())) {
|
|
|
- mapOne.put("jumpFlag", "1");
|
|
|
- }
|
|
|
- /**
|
|
|
- * @Modify: start
|
|
|
- * @Version: v2021.4.16
|
|
|
- * @Author: ryz
|
|
|
- * @Date: 2021/4/28
|
|
|
- */
|
|
|
- SysDeptSub query = new SysDeptSub();
|
|
|
- query.setDeptId(sysU.getDeptId());
|
|
|
- query.setEnableFlag(SubjectTypeEnum.ENABLE_FLAG_TRUE.getCode());
|
|
|
- List<SysDeptSub> subList = sysDeptSubService.list(Wrappers.query(query));
|
|
|
-// List<String> subTypeList = new ArrayList<>();
|
|
|
-// for (SysDeptSub item : subList) {
|
|
|
-// subTypeList.add(item.getSubjectType());
|
|
|
-// if(SubjectTypeEnum.TYPE_SHUIBANGYUN.getCode().equals(item.getSubjectType())
|
|
|
-// && "北京遥领医疗科技有限公司".equals(item.getSubjectName())){
|
|
|
-// mapOne.put("jumpFlag", "1");
|
|
|
-// }
|
|
|
-// }
|
|
|
- List<String> subTypeList = subList.stream()
|
|
|
- .map(SysDeptSub::getSubjectType)
|
|
|
- .distinct()
|
|
|
- .collect(Collectors.toList());
|
|
|
- mapOne.put("subList", subTypeList);
|
|
|
-
|
|
|
- // 税源地
|
|
|
- List<SubjectLocation> subjectLocationList = subList.stream()
|
|
|
- .map(SysDeptSub::getSubjectLocation)
|
|
|
- .sorted(Comparator.comparing(SubjectLocation::getSort))
|
|
|
- .collect(Collectors.toList());
|
|
|
- mapOne.put("subjectLocationList", subjectLocationList);
|
|
|
-
|
|
|
- // 查询配置了任务类型模板的任务类型
|
|
|
- mapOne.put("hasTaskTypeTemplate", wmDeptTaskTypeTemplateService.listTaskTypeByDeptId(sysU.getDeptId()));
|
|
|
-
|
|
|
- // 税源地和channel对应关系
|
|
|
- Map<String, Integer> collect = sysDeptSubService.list(Wrappers.<SysDeptSub>lambdaQuery().eq(SysDeptSub::getDeptId, sysU.getDeptId()))
|
|
|
- .stream()
|
|
|
- .collect(Collectors.toMap(sysDeptSub -> sysDeptSub.getSubjectLocation().name(), SysDeptSub::getSubjectChannel));
|
|
|
- mapOne.put("subjectTypeAndChannel", collect);
|
|
|
-
|
|
|
-
|
|
|
- // 认证服务信息回显
|
|
|
- List<SysUserSubVO> userSignCertList = sysUserSignCertService.listUserSignCertForApi(sysU.getUserId(), sysU.getDeptId());
|
|
|
- mapOne.put("certList", userSignCertList);
|
|
|
-
|
|
|
- // 查询是否已认证过E证通
|
|
|
- mapOne.put("existEidResult", sysUserExtRecordService.existUserExtRecord());
|
|
|
-
|
|
|
- // 获取发起认证的令牌
|
|
|
- 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);
|
|
|
+ mapOne.put("roles", roleIdList);
|
|
|
+ mapOne.put("temp1", String.valueOf(sysU.getTemp1()));
|
|
|
+ mapOne.put("temp2", String.valueOf(sysU.getTemp2()));
|
|
|
+ mapOne.put("temp3", String.valueOf(sysU.getTemp3()));
|
|
|
+ mapOne.put("temp4", String.valueOf(sysU.getTemp4()));
|
|
|
+ mapOne.put("temp5", String.valueOf(sysU.getTemp5()));
|
|
|
+
|
|
|
+ // 查询待审核包
|
|
|
+ List<WmScorePackageStatus> statusList = wmScorePackageStatusService.list(Wrappers.<WmScorePackageStatus>lambdaQuery()
|
|
|
+ .eq(WmScorePackageStatus::getUserId, String.valueOf(sysU.getUserId()))
|
|
|
+ .eq(WmScorePackageStatus::getTaskAddFlag, "1")
|
|
|
+ .eq(WmScorePackageStatus::getDelFlag, CommonConstants.STATUS_NORMAL)
|
|
|
+ .eq(WmScorePackageStatus::getEnableFlag, CommonConstants.STATUS_NORMAL)
|
|
|
+ );
|
|
|
+
|
|
|
+ long onTheWay = 0;
|
|
|
+ long waitApprove = statusList.stream().filter(item -> "1".equals(item.getStatus())).count();
|
|
|
+
|
|
|
+ Set<String> pkgIds = statusList.stream().filter(item -> "2".equals(item.getStatus())).map(WmScorePackageStatus::getPackageId).collect(Collectors.toSet());
|
|
|
+ List<Map<String, Object>> listMap;
|
|
|
+ if (CollUtil.isNotEmpty(pkgIds)){
|
|
|
+ List<WmScorePackage> pkgs = wmScorePackageService.listByIds(pkgIds);
|
|
|
+ listMap = pkgs.stream().map(pkg -> {
|
|
|
+ Map<String, Object> map = new HashMap<>(2);
|
|
|
+ map.put("label", pkg.getScorePackageName());
|
|
|
+ map.put("value", pkg.getId());
|
|
|
+ return map;
|
|
|
+ }).collect(Collectors.toList());
|
|
|
+ onTheWay = listMap.size();
|
|
|
+ } else {
|
|
|
+ listMap = Collections.emptyList();
|
|
|
+ }
|
|
|
+
|
|
|
+ mapOne.put("packageList", listMap);
|
|
|
+ mapOne.put("waitApprove", String.valueOf(waitApprove));
|
|
|
+ mapOne.put("onTheWay", String.valueOf(onTheWay));
|
|
|
+ mapOne.put("userType", sysU.getUserType());
|
|
|
+ mapOne.put("jumpFlag", "北京遥领医疗科技有限公司".equals(sysDept.getName()) ? "1" : "0");
|
|
|
+
|
|
|
+ // 结算渠道
|
|
|
+ List<SysDeptSub> subList = sysDeptSubService.list(Wrappers.<SysDeptSub>lambdaQuery()
|
|
|
+ .eq(SysDeptSub::getDeptId, sysU.getDeptId())
|
|
|
+ .eq(SysDeptSub::getEnableFlag, SubjectTypeEnum.ENABLE_FLAG_TRUE.getCode())
|
|
|
+ );
|
|
|
+ List<String> subTypeList = subList.stream()
|
|
|
+ .map(SysDeptSub::getSubjectType)
|
|
|
+ .distinct()
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ mapOne.put("subList", subTypeList);
|
|
|
+
|
|
|
+ // 税源地
|
|
|
+ List<SubjectLocation> subjectLocationList = subList.stream()
|
|
|
+ .map(SysDeptSub::getSubjectLocation)
|
|
|
+ .sorted(Comparator.comparing(SubjectLocation::getSort))
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ mapOne.put("subjectLocationList", subjectLocationList);
|
|
|
+
|
|
|
+ // 查询配置了任务类型模板的任务类型
|
|
|
+ mapOne.put("hasTaskTypeTemplate", wmDeptTaskTypeTemplateService.listTaskTypeByDeptId(sysU.getDeptId()));
|
|
|
+
|
|
|
+ // 税源地和channel对应关系
|
|
|
+ Map<String, Integer> collect = sysDeptSubService.list(Wrappers.<SysDeptSub>lambdaQuery().eq(SysDeptSub::getDeptId, sysU.getDeptId()))
|
|
|
+ .stream()
|
|
|
+ .collect(Collectors.toMap(sysDeptSub -> sysDeptSub.getSubjectLocation().name(), SysDeptSub::getSubjectChannel));
|
|
|
+ mapOne.put("subjectTypeAndChannel", collect);
|
|
|
+
|
|
|
+
|
|
|
+ // 认证服务信息回显
|
|
|
+ List<SysUserSubVO> userSignCertList = sysUserSignCertService.listUserSignCertForApi(sysU.getUserId(), sysU.getDeptId());
|
|
|
+ mapOne.put("certList", userSignCertList);
|
|
|
+
|
|
|
+ // 查询是否已认证过E证通
|
|
|
+ mapOne.put("existEidResult", sysUserExtRecordService.existUserExtRecord());
|
|
|
+
|
|
|
+ // 获取发起认证的令牌
|
|
|
+ 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);
|
|
|
|
|
|
- }
|
|
|
+ }
|
|
|
|
|
|
- result.put("userInfo", list);
|
|
|
- result.put("roles", roleList);
|
|
|
+ result.put("userInfo", list);
|
|
|
+ result.put("roles", roleList);
|
|
|
|
|
|
|
|
|
- result.put("completedCount", completedCount);
|
|
|
- result.put("sumCount", sumCount);
|
|
|
- result.put("taskProgress", 0);
|
|
|
- if (sumCount > 0) {
|
|
|
- double d = Math.ceil(completedCount * 100 / sumCount);
|
|
|
- if (d > 100) {
|
|
|
- d = 100;
|
|
|
- }
|
|
|
- result.put("taskProgress", new Double(d).intValue());
|
|
|
- }
|
|
|
+ result.put("completedCount", 0);
|
|
|
+ result.put("sumCount", 0);
|
|
|
+ result.put("taskProgress", 0);
|
|
|
|
|
|
- }
|
|
|
return R.ok(result);
|
|
|
}
|
|
|
|