diff --git a/web-adapter/src/main/java/com/zcloud/edu/web/study/StudentController.java b/web-adapter/src/main/java/com/zcloud/edu/web/study/StudentController.java index 9046380..90d54b0 100644 --- a/web-adapter/src/main/java/com/zcloud/edu/web/study/StudentController.java +++ b/web-adapter/src/main/java/com/zcloud/edu/web/study/StudentController.java @@ -53,13 +53,18 @@ public class StudentController { return studentService.educationUserList(qry); } - + @ApiOperation("获取可推送三方人员") + @PostMapping("/pushCandidateUserList") + public PageResponse pushCandidateUserList(@RequestBody EducationUserQry qry) { + return studentService.pushCandidateUserList(qry); + } @ApiOperation("一人一档分页") @PostMapping("/personnelFileList") public PageResponse personnelFileList(@RequestBody StudentPageQry qry) { return studentService.personnelFileListPage(qry); } + @ApiOperation("培训记录管理分页") @PostMapping("/listPageClassByStudent") public PageResponse listPageClassByStudent(@RequestBody StudentPageQry qry) { @@ -89,6 +94,7 @@ public class StudentController { public SingleResponse getInfoByStudentId(@PathVariable("studentId") String studentId) { return studentService.getInfoByStudentId(studentId); } + @ApiOperation("班级内学员数") @GetMapping("/countStudent/{classId}") public SingleResponse countStudent(@PathVariable("classId") String classId) { @@ -122,4 +128,3 @@ public class StudentController { return SingleResponse.buildSuccess(); } } - diff --git a/web-adapter/src/main/java/com/zcloud/edu/web/training/TrainingThirdPartyPushController.java b/web-adapter/src/main/java/com/zcloud/edu/web/training/TrainingThirdPartyPushController.java new file mode 100644 index 0000000..e6b33fb --- /dev/null +++ b/web-adapter/src/main/java/com/zcloud/edu/web/training/TrainingThirdPartyPushController.java @@ -0,0 +1,37 @@ +package com.zcloud.edu.web.training; + +import com.alibaba.cola.dto.PageResponse; +import com.alibaba.cola.dto.SingleResponse; +import com.zcloud.edu.api.training.TrainingThirdPartyPushServiceI; +import com.zcloud.edu.dto.clientobject.training.TrainingThirdPartyPushLogCO; +import com.zcloud.edu.dto.training.TrainingThirdPartyPushCmd; +import com.zcloud.edu.dto.training.TrainingThirdPartyPushLogPageQry; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.AllArgsConstructor; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@Api(tags = "培训三方推送") +@RequestMapping("/${application.gateway}/trainingThirdPartyPush") +@RestController +@AllArgsConstructor +public class TrainingThirdPartyPushController { + + private final TrainingThirdPartyPushServiceI trainingThirdPartyPushService; + + @ApiOperation("推送三方培训数据") + @PostMapping("/push") + public SingleResponse push(@Validated @RequestBody TrainingThirdPartyPushCmd cmd) { + return trainingThirdPartyPushService.push(cmd); + } + + @ApiOperation("三方推送日志分页") + @PostMapping("/log/list") + public PageResponse logPage(@RequestBody TrainingThirdPartyPushLogPageQry qry) { + return trainingThirdPartyPushService.logPage(qry); + } +} diff --git a/web-app/src/main/java/com/zcloud/edu/command/convertor/training/TrainingThirdPartyPushLogCoConvertor.java b/web-app/src/main/java/com/zcloud/edu/command/convertor/training/TrainingThirdPartyPushLogCoConvertor.java new file mode 100644 index 0000000..c74147b --- /dev/null +++ b/web-app/src/main/java/com/zcloud/edu/command/convertor/training/TrainingThirdPartyPushLogCoConvertor.java @@ -0,0 +1,13 @@ +package com.zcloud.edu.command.convertor.training; + +import com.zcloud.edu.dto.clientobject.training.TrainingThirdPartyPushLogCO; +import com.zcloud.edu.persistence.dataobject.TrainingThirdPartyPushLogDO; +import org.mapstruct.Mapper; + +import java.util.List; + +@Mapper(componentModel = "spring") +public interface TrainingThirdPartyPushLogCoConvertor { + + List converDOsToCOs(List trainingThirdPartyPushLogDOS); +} diff --git a/web-app/src/main/java/com/zcloud/edu/command/query/study/StudentQueryExe.java b/web-app/src/main/java/com/zcloud/edu/command/query/study/StudentQueryExe.java index 1f289a9..85507d2 100644 --- a/web-app/src/main/java/com/zcloud/edu/command/query/study/StudentQueryExe.java +++ b/web-app/src/main/java/com/zcloud/edu/command/query/study/StudentQueryExe.java @@ -256,5 +256,13 @@ public class StudentQueryExe { PageResponse pageResponse = studentRepository.educationUserList(params); return pageResponse; } + + public PageResponse pushCandidateUserList(EducationUserQry qry) { + Map params = PageQueryHelper.toHashMap(qry); + if (!Tools.isEmpty(params.get("likePhone"))) { + params.put("phoneArr", String.valueOf(params.get("likePhone")).split(",")); + } + return studentRepository.pushCandidateUserList(params); + } } diff --git a/web-app/src/main/java/com/zcloud/edu/command/query/training/TrainingThirdPartyPushLogQueryExe.java b/web-app/src/main/java/com/zcloud/edu/command/query/training/TrainingThirdPartyPushLogQueryExe.java new file mode 100644 index 0000000..649c108 --- /dev/null +++ b/web-app/src/main/java/com/zcloud/edu/command/query/training/TrainingThirdPartyPushLogQueryExe.java @@ -0,0 +1,29 @@ +package com.zcloud.edu.command.query.training; + +import com.alibaba.cola.dto.PageResponse; +import com.zcloud.edu.command.convertor.training.TrainingThirdPartyPushLogCoConvertor; +import com.zcloud.edu.dto.clientobject.training.TrainingThirdPartyPushLogCO; +import com.zcloud.edu.dto.training.TrainingThirdPartyPushLogPageQry; +import com.zcloud.edu.persistence.dataobject.TrainingThirdPartyPushLogDO; +import com.zcloud.edu.persistence.repository.training.TrainingThirdPartyPushLogRepository; +import com.zcloud.gbscommon.utils.PageQueryHelper; +import lombok.AllArgsConstructor; +import org.springframework.stereotype.Component; + +import java.util.List; +import java.util.Map; + +@Component +@AllArgsConstructor +public class TrainingThirdPartyPushLogQueryExe { + + private final TrainingThirdPartyPushLogRepository trainingThirdPartyPushLogRepository; + private final TrainingThirdPartyPushLogCoConvertor trainingThirdPartyPushLogCoConvertor; + + public PageResponse execute(TrainingThirdPartyPushLogPageQry qry) { + Map params = PageQueryHelper.toHashMap(qry); + PageResponse pageResponse = trainingThirdPartyPushLogRepository.listPage(params); + List data = trainingThirdPartyPushLogCoConvertor.converDOsToCOs(pageResponse.getData()); + return PageResponse.of(data, pageResponse.getTotalCount(), pageResponse.getPageSize(), pageResponse.getPageIndex()); + } +} diff --git a/web-app/src/main/java/com/zcloud/edu/command/training/ThirdPartyPushFacade.java b/web-app/src/main/java/com/zcloud/edu/command/training/ThirdPartyPushFacade.java new file mode 100644 index 0000000..562b5ff --- /dev/null +++ b/web-app/src/main/java/com/zcloud/edu/command/training/ThirdPartyPushFacade.java @@ -0,0 +1,25 @@ +package com.zcloud.edu.command.training; + +import com.alibaba.cola.exception.BizException; +import com.zcloud.edu.persistence.dataobject.TrainingThirdPartyPushSourceDO; +import lombok.AllArgsConstructor; +import org.springframework.stereotype.Component; + +import java.util.List; + +@Component +@AllArgsConstructor +public class ThirdPartyPushFacade { + + private final ThirdPartyPushSupport thirdPartyPushSupport; + + public void push(List sourceList) { + try { + thirdPartyPushSupport.push(sourceList); + } catch (BizException e) { + throw e; + } catch (Exception e) { + throw new BizException("推送三方失败:" + e.getMessage()); + } + } +} diff --git a/web-app/src/main/java/com/zcloud/edu/command/training/ThirdPartyPushSupport.java b/web-app/src/main/java/com/zcloud/edu/command/training/ThirdPartyPushSupport.java new file mode 100644 index 0000000..1da61fe --- /dev/null +++ b/web-app/src/main/java/com/zcloud/edu/command/training/ThirdPartyPushSupport.java @@ -0,0 +1,186 @@ +package com.zcloud.edu.command.training; + +import cn.hutool.core.util.RandomUtil; +import cn.hutool.core.util.StrUtil; +import cn.hutool.http.HttpResponse; +import cn.hutool.http.HttpUtil; +import com.alibaba.cola.exception.BizException; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.alibaba.fastjson.TypeReference; +import com.zcloud.edu.persistence.dataobject.TrainingThirdPartyPushSourceDO; +import lombok.Data; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Component; + +import javax.crypto.Cipher; +import java.io.ByteArrayOutputStream; +import java.nio.charset.StandardCharsets; +import java.security.KeyFactory; +import java.security.MessageDigest; +import java.security.PublicKey; +import java.security.spec.X509EncodedKeySpec; +import java.util.ArrayList; +import java.util.Base64; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +@Component +public class ThirdPartyPushSupport { + + private static final String SIGN_HEADER = "gjxy-sign"; + private static final String NONCE_HEADER = "gjxy-nonce"; + private static final String TIMESTAMP_HEADER = "gjxy-timestamp"; + + @Value("${gongJiangXueYuanUrl:}") + private String serverUrl; + + @Value("${gongJiangXueYuanSendPublicKey:}") + private String rsaPublicKey; + + @Value("${gongJiangXueYuanSendPrivateKey:}") + private String secretKey; + + public void push(List sourceList) throws Exception { + if (sourceList == null || sourceList.isEmpty()) { + return; + } + if (StrUtil.isBlank(serverUrl) || StrUtil.isBlank(rsaPublicKey) || StrUtil.isBlank(secretKey)) { + throw new BizException("三方推送配置不完整"); + } + + // 将新系统查询到的人员信息转换成三方要求的推送结构。 + List users = sourceList.stream().map(item -> { + UserDTO dto = new UserDTO(); + dto.setUserName(item.getUsername()); + dto.setRealName(item.getRealName()); + dto.setUserSex(resolveUserSex(item.getIdCard())); + dto.setIdCard(item.getIdCard()); + dto.setOrgTree(item.getOrgTree()); + dto.setAvatarUrl(item.getAvatarUrl()); + dto.setPhoneNumber(item.getPhoneNumber()); + return dto; + }).collect(Collectors.toList()); + + Map paramDataMap = new HashMap<>(); + paramDataMap.put("userList", users); + String body = createPostFormHttpRequest("/API-BACKEND/openapi/user/v1/syncNotify", paramDataMap); + Map response = JSONObject.parseObject(body, new TypeReference>() { + }); + if (!"1".equals(response.get("code"))) { + throw new BizException(response.get("message")); + } + Map data = JSONObject.parseObject(response.get("data"), new TypeReference>() { + }); + if (data != null && !String.valueOf(data.get("syncUserTotal")).equals(String.valueOf(data.get("syncSuccessCount")))) { + throw new BizException("三方返回的成功数量与推送数量不一致"); + } + } + + private String createPostFormHttpRequest(String uri, Map paramDataMap) throws Exception { + String paramDataJsonStr = JSON.toJSONString(paramDataMap); + String paramDataRsaEncrypt = encrypt(paramDataJsonStr, rsaPublicKey); + + Map paramMap = new HashMap<>(); + paramMap.put("param", paramDataRsaEncrypt); + + String timestamp = String.valueOf(System.currentTimeMillis()); + String nonce = RandomUtil.randomString(16); + String sign = signBySHA256(secretKey, nonce, timestamp, paramMap); + + HttpResponse response = HttpUtil.createPost(serverUrl + uri) + .header(NONCE_HEADER, nonce) + .header(SIGN_HEADER, sign) + .header(TIMESTAMP_HEADER, timestamp) + .form("param", paramDataRsaEncrypt) + .execute(); + return response.body(); + } + + /** + * 按三方约定的规则,对请求参数生成 SHA-256 签名。 + */ + private String signBySHA256(String secretKey, String nonce, String timestamp, Map paramMap) { + try { + List paramNames = new ArrayList<>(paramMap.keySet()); + Collections.sort(paramNames); + StringBuilder result = new StringBuilder(); + for (String paramName : paramNames) { + if (result.length() > 1) { + result.append("|"); + } + String value = paramMap.get(paramName) == null ? "" : String.valueOf(paramMap.get(paramName)); + if (value.length() > 4096) { + value = value.substring(0, 4096); + } + result.append(paramName).append("=").append(value); + } + result.append(":").append(nonce).append(":").append(secretKey).append("&").append(timestamp); + return sha256(result.toString()); + } catch (Exception e) { + throw new BizException("三方签名失败:" + e.getMessage()); + } + } + + /** + * 使用三方提供的 RSA 公钥对明文参数进行分段加密。 + */ + private String encrypt(String text, String publicKey) throws Exception { + String normalized = publicKey + .replace("-----BEGIN PUBLIC KEY-----", "") + .replace("-----END PUBLIC KEY-----", "") + .replaceAll("\\s+", ""); + byte[] keyBytes = Base64.getDecoder().decode(normalized); + X509EncodedKeySpec keySpec = new X509EncodedKeySpec(keyBytes); + KeyFactory keyFactory = KeyFactory.getInstance("RSA"); + PublicKey pubKey = keyFactory.generatePublic(keySpec); + Cipher cipher = Cipher.getInstance("RSA/ECB/PKCS1Padding"); + cipher.init(Cipher.ENCRYPT_MODE, pubKey); + byte[] data = text.getBytes(StandardCharsets.UTF_8); + int blockSize = 117; + int offset = 0; + ByteArrayOutputStream out = new ByteArrayOutputStream(); + while (data.length - offset > 0) { + int len = Math.min(data.length - offset, blockSize); + byte[] cache = cipher.doFinal(data, offset, len); + out.write(cache, 0, cache.length); + offset += len; + } + return Base64.getEncoder().encodeToString(out.toByteArray()); + } + + private String sha256(String text) throws Exception { + MessageDigest digest = MessageDigest.getInstance("SHA-256"); + byte[] hash = digest.digest(text.getBytes(StandardCharsets.UTF_8)); + StringBuilder sb = new StringBuilder(); + for (byte b : hash) { + sb.append(String.format("%02x", b)); + } + return sb.toString(); + } + + private String resolveUserSex(String idCard) { + if (StrUtil.isBlank(idCard) || idCard.length() < 17) { + return null; + } + char genderCode = idCard.charAt(16); + if (!Character.isDigit(genderCode)) { + return null; + } + return ((genderCode - '0') % 2 == 0) ? "女" : "男"; + } + + @Data + public static class UserDTO { + private String userName; + private String realName; + private String userSex; + private String idCard; + private String orgTree; + private String avatarUrl; + private String phoneNumber; + } +} diff --git a/web-app/src/main/java/com/zcloud/edu/command/training/TrainingThirdPartyPushExe.java b/web-app/src/main/java/com/zcloud/edu/command/training/TrainingThirdPartyPushExe.java new file mode 100644 index 0000000..6b107c8 --- /dev/null +++ b/web-app/src/main/java/com/zcloud/edu/command/training/TrainingThirdPartyPushExe.java @@ -0,0 +1,147 @@ +package com.zcloud.edu.command.training; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.IdUtil; +import cn.hutool.core.util.StrUtil; +import com.alibaba.cola.exception.BizException; +import com.jjb.saas.framework.auth.model.SSOUser; +import com.jjb.saas.framework.auth.utils.AuthContext; +import com.zcloud.edu.dto.training.TrainingThirdPartyPushCmd; +import com.zcloud.edu.persistence.dataobject.TrainingThirdPartyPushLogDO; +import com.zcloud.edu.persistence.dataobject.TrainingThirdPartyPushSourceDO; +import com.zcloud.edu.persistence.repository.training.TrainingThirdPartyPushLogRepository; +import com.zcloud.edu.persistence.repository.training.TrainingUserRepository; +import lombok.AllArgsConstructor; +import org.springframework.stereotype.Component; +import org.springframework.transaction.annotation.Transactional; + +import java.lang.reflect.Method; +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; + +@Component +@AllArgsConstructor +public class TrainingThirdPartyPushExe { + + private final TrainingUserRepository trainingUserRepository; + private final TrainingThirdPartyPushLogRepository trainingThirdPartyPushLogRepository; + private final ThirdPartyPushFacade thirdPartyPushFacade; + + @Transactional(rollbackFor = Exception.class) + public Integer execute(TrainingThirdPartyPushCmd cmd) { + List usernameList = normalizeUsernames(cmd.getUsernameList()); + if (CollUtil.isEmpty(usernameList)) { + throw new BizException("用户名列表不能为空"); + } + + Map params = new HashMap<>(); + params.put("usernameList", usernameList); + List sourceList = trainingUserRepository.listThirdPartyPushUsers(params); + if (CollUtil.isEmpty(sourceList)) { + throw new BizException("未查询到可推送的用户信息"); + } + + List validSourceList = sourceList.stream() + .filter(item -> StrUtil.isNotBlank(item.getUsername())) + .collect(Collectors.toList()); + if (CollUtil.isEmpty(validSourceList)) { + throw new BizException("未查询到有效的推送用户信息"); + } + + // 先调用三方接口,确保三方接收成功后再落日志和回写标记。 + thirdPartyPushFacade.push(validSourceList); + + // 记录本次成功推送的人员快照,便于后续分页查询和追溯。 + List logDOList = buildLogList(validSourceList); + trainingThirdPartyPushLogRepository.saveBatch(logDOList); + + // 推送成功后,将 training_user 中对应手机号标记为第三方培训人员。 + List phones = validSourceList.stream() + .map(TrainingThirdPartyPushSourceDO::getPhoneNumber) + .filter(StrUtil::isNotBlank) + .distinct() + .collect(Collectors.toList()); + if (CollUtil.isNotEmpty(phones)) { + trainingUserRepository.updateThirdPartyFlagByPhones(phones); + } + return validSourceList.size(); + } + + private List normalizeUsernames(List usernameList) { + if (CollUtil.isEmpty(usernameList)) { + return new ArrayList<>(); + } + Set unique = new LinkedHashSet<>(); + for (String username : usernameList) { + if (StrUtil.isNotBlank(username)) { + unique.add(username.trim()); + } + } + return new ArrayList<>(unique); + } + + private List buildLogList(List sourceList) { + SSOUser currentUser = AuthContext.getCurrentUser(); + LocalDateTime now = LocalDateTime.now(); + return sourceList.stream().map(item -> { + TrainingThirdPartyPushLogDO logDO = new TrainingThirdPartyPushLogDO(); + logDO.setTrainingThirdPartyPushLogId(IdUtil.simpleUUID()); + logDO.setUsername(item.getUsername()); + logDO.setRealName(item.getRealName()); + logDO.setUserSex(resolveUserSex(item.getIdCard())); + logDO.setIdCard(item.getIdCard()); + logDO.setOrgTree(item.getOrgTree()); + logDO.setAvatarUrl(item.getAvatarUrl()); + logDO.setPhoneNumber(item.getPhoneNumber()); + logDO.setRelatedCorpNames(item.getRelatedCorpNames()); + logDO.setDeleteEnum("FALSE"); + logDO.setCreateTime(now); + logDO.setUpdateTime(now); + if (currentUser != null) { + logDO.setCreateId(currentUser.getUserId()); + logDO.setUpdateId(currentUser.getUserId()); + logDO.setCreateName(resolveCurrentUserName(currentUser)); + logDO.setUpdateName(resolveCurrentUserName(currentUser)); + logDO.setTenantId(currentUser.getTenantId()); + logDO.setOrgId(currentUser.getOrgId()); + } + return logDO; + }).collect(Collectors.toList()); + } + + private String resolveCurrentUserName(SSOUser currentUser) { + String[] candidates = new String[]{"getUsername", "getUserName", "getName", "getRealName"}; + for (String methodName : candidates) { + try { + Method method = currentUser.getClass().getMethod(methodName); + Object value = method.invoke(currentUser); + if (value != null && StrUtil.isNotBlank(String.valueOf(value))) { + return String.valueOf(value); + } + } catch (Exception ignored) { + } + } + return String.valueOf(currentUser.getUserId()); + } + + /** + * 根据身份证号第 17 位推导性别。 + * 单数记为男,双数记为女。 + */ + private String resolveUserSex(String idCard) { + if (StrUtil.isBlank(idCard) || idCard.length() < 17) { + return null; + } + char genderCode = idCard.charAt(16); + if (!Character.isDigit(genderCode)) { + return null; + } + return ((genderCode - '0') % 2 == 0) ? "女" : "男"; + } +} diff --git a/web-app/src/main/java/com/zcloud/edu/service/TrainingThirdPartyPushServiceImpl.java b/web-app/src/main/java/com/zcloud/edu/service/TrainingThirdPartyPushServiceImpl.java new file mode 100644 index 0000000..dcd8b79 --- /dev/null +++ b/web-app/src/main/java/com/zcloud/edu/service/TrainingThirdPartyPushServiceImpl.java @@ -0,0 +1,30 @@ +package com.zcloud.edu.service; + +import com.alibaba.cola.dto.PageResponse; +import com.alibaba.cola.dto.SingleResponse; +import com.zcloud.edu.api.training.TrainingThirdPartyPushServiceI; +import com.zcloud.edu.command.query.training.TrainingThirdPartyPushLogQueryExe; +import com.zcloud.edu.command.training.TrainingThirdPartyPushExe; +import com.zcloud.edu.dto.clientobject.training.TrainingThirdPartyPushLogCO; +import com.zcloud.edu.dto.training.TrainingThirdPartyPushCmd; +import com.zcloud.edu.dto.training.TrainingThirdPartyPushLogPageQry; +import lombok.AllArgsConstructor; +import org.springframework.stereotype.Service; + +@Service +@AllArgsConstructor +public class TrainingThirdPartyPushServiceImpl implements TrainingThirdPartyPushServiceI { + + private final TrainingThirdPartyPushExe trainingThirdPartyPushExe; + private final TrainingThirdPartyPushLogQueryExe trainingThirdPartyPushLogQueryExe; + + @Override + public SingleResponse push(TrainingThirdPartyPushCmd cmd) { + return SingleResponse.of(trainingThirdPartyPushExe.execute(cmd)); + } + + @Override + public PageResponse logPage(TrainingThirdPartyPushLogPageQry qry) { + return trainingThirdPartyPushLogQueryExe.execute(qry); + } +} diff --git a/web-app/src/main/java/com/zcloud/edu/service/study/StudentServiceImpl.java b/web-app/src/main/java/com/zcloud/edu/service/study/StudentServiceImpl.java index 68a3a4d..bec50c9 100644 --- a/web-app/src/main/java/com/zcloud/edu/service/study/StudentServiceImpl.java +++ b/web-app/src/main/java/com/zcloud/edu/service/study/StudentServiceImpl.java @@ -121,5 +121,10 @@ public class StudentServiceImpl implements StudentServiceI { public PageResponse educationUserList(EducationUserQry qry) { return studentQueryExe.educationUserList(qry); } + + @Override + public PageResponse pushCandidateUserList(EducationUserQry qry) { + return studentQueryExe.pushCandidateUserList(qry); + } } diff --git a/web-app/src/main/java/com/zcloud/edu/utils/ImageOrientationUtil.java b/web-app/src/main/java/com/zcloud/edu/utils/ImageOrientationUtil.java new file mode 100644 index 0000000..d0c1b26 --- /dev/null +++ b/web-app/src/main/java/com/zcloud/edu/utils/ImageOrientationUtil.java @@ -0,0 +1,34 @@ +//package com.zcloud.edu.utils; +// +// +//import lombok.extern.slf4j.Slf4j; +//import net.coobird.thumbnailator.Thumbnails; +//import org.apache.commons.io.IOUtils; +// +//import java.io.ByteArrayInputStream; +//import java.io.ByteArrayOutputStream; +//import java.io.InputStream; +//import java.net.URL; +// +///** +// * @author zhangyue +// * @date 2026/3/11 10:23 +// */ +//public class ImageOrientationUtil { +// public static byte[] fixImageOrientation(String imageUrl) { +// try (InputStream is = new URL(imageUrl).openStream()) { +// ByteArrayOutputStream baos = new ByteArrayOutputStream(); +// +// // Thumbnailator 会自动读取 EXIF 方向信息并正确旋转图片 +// Thumbnails.of(is) +// .keepAspectRatio(true) +// .outputFormat("JPEG") +// .toOutputStream(baos); +// +// return baos.toByteArray(); +// } catch (Exception e) { +// e.printStackTrace(); +// throw new RuntimeException(e); +// } +// } +//} diff --git a/web-client/src/main/java/com/zcloud/edu/api/study/StudentServiceI.java b/web-client/src/main/java/com/zcloud/edu/api/study/StudentServiceI.java index acf1f8f..b253eb6 100644 --- a/web-client/src/main/java/com/zcloud/edu/api/study/StudentServiceI.java +++ b/web-client/src/main/java/com/zcloud/edu/api/study/StudentServiceI.java @@ -52,5 +52,7 @@ public interface StudentServiceI { SingleResponse getInfoByStudentId(String studentId); PageResponse educationUserList(EducationUserQry qry); + + PageResponse pushCandidateUserList(EducationUserQry qry); } diff --git a/web-client/src/main/java/com/zcloud/edu/api/training/TrainingThirdPartyPushServiceI.java b/web-client/src/main/java/com/zcloud/edu/api/training/TrainingThirdPartyPushServiceI.java new file mode 100644 index 0000000..4d4d274 --- /dev/null +++ b/web-client/src/main/java/com/zcloud/edu/api/training/TrainingThirdPartyPushServiceI.java @@ -0,0 +1,14 @@ +package com.zcloud.edu.api.training; + +import com.alibaba.cola.dto.PageResponse; +import com.alibaba.cola.dto.SingleResponse; +import com.zcloud.edu.dto.clientobject.training.TrainingThirdPartyPushLogCO; +import com.zcloud.edu.dto.training.TrainingThirdPartyPushCmd; +import com.zcloud.edu.dto.training.TrainingThirdPartyPushLogPageQry; + +public interface TrainingThirdPartyPushServiceI { + + SingleResponse push(TrainingThirdPartyPushCmd cmd); + + PageResponse logPage(TrainingThirdPartyPushLogPageQry qry); +} diff --git a/web-client/src/main/java/com/zcloud/edu/config/FileUrlConfig.java b/web-client/src/main/java/com/zcloud/edu/config/FileUrlConfig.java index 4ef1196..7890e7b 100644 --- a/web-client/src/main/java/com/zcloud/edu/config/FileUrlConfig.java +++ b/web-client/src/main/java/com/zcloud/edu/config/FileUrlConfig.java @@ -15,7 +15,8 @@ public class FileUrlConfig { prefixUrl = prefixUrlProperties; } public String getPrefixUrl() { -// return "http://192.168.192.201:8991/file/uploadFiles2/"; - return prefixUrl; + // 正式环境 + return "http://192.168.192.201:8991/file/uploadFiles2/"; +// return prefixUrl; } } diff --git a/web-client/src/main/java/com/zcloud/edu/dto/clientobject/training/TrainingThirdPartyPushLogCO.java b/web-client/src/main/java/com/zcloud/edu/dto/clientobject/training/TrainingThirdPartyPushLogCO.java new file mode 100644 index 0000000..bf850a7 --- /dev/null +++ b/web-client/src/main/java/com/zcloud/edu/dto/clientobject/training/TrainingThirdPartyPushLogCO.java @@ -0,0 +1,46 @@ +package com.zcloud.edu.dto.clientobject.training; + +import com.alibaba.cola.dto.ClientObject; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.time.LocalDateTime; + +@Data +public class TrainingThirdPartyPushLogCO extends ClientObject { + + @ApiModelProperty(value = "业务主键id") + private String trainingThirdPartyPushLogId; + + @ApiModelProperty(value = "用户名") + private String username; + + @ApiModelProperty(value = "姓名") + private String realName; + + @ApiModelProperty(value = "性别") + private String userSex; + + @ApiModelProperty(value = "身份证号") + private String idCard; + + @ApiModelProperty(value = "组织树(所属企业/部门)") + private String orgTree; + + @ApiModelProperty(value = "免冠照片url地址") + private String avatarUrl; + + @ApiModelProperty(value = "手机号") + private String phoneNumber; + + @ApiModelProperty(value = "所属相关方") + private String relatedCorpNames; + + @ApiModelProperty(value = "推送时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime createTime; + + @ApiModelProperty(value = "推送人") + private String createName; +} diff --git a/web-client/src/main/java/com/zcloud/edu/dto/training/TrainingThirdPartyPushCmd.java b/web-client/src/main/java/com/zcloud/edu/dto/training/TrainingThirdPartyPushCmd.java new file mode 100644 index 0000000..fdf2882 --- /dev/null +++ b/web-client/src/main/java/com/zcloud/edu/dto/training/TrainingThirdPartyPushCmd.java @@ -0,0 +1,16 @@ +package com.zcloud.edu.dto.training; + +import com.alibaba.cola.dto.Command; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotEmpty; +import java.util.List; + +@Data +public class TrainingThirdPartyPushCmd extends Command { + + @ApiModelProperty(value = "用户名列表", required = true) + @NotEmpty(message = "用户名列表不能为空") + private List usernameList; +} diff --git a/web-client/src/main/java/com/zcloud/edu/dto/training/TrainingThirdPartyPushLogPageQry.java b/web-client/src/main/java/com/zcloud/edu/dto/training/TrainingThirdPartyPushLogPageQry.java new file mode 100644 index 0000000..0707899 --- /dev/null +++ b/web-client/src/main/java/com/zcloud/edu/dto/training/TrainingThirdPartyPushLogPageQry.java @@ -0,0 +1,21 @@ +package com.zcloud.edu.dto.training; + +import com.alibaba.cola.dto.PageQuery; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +public class TrainingThirdPartyPushLogPageQry extends PageQuery { + + @ApiModelProperty(value = "用户名模糊查询") + private String likeUsername; + + @ApiModelProperty(value = "姓名模糊查询") + private String likeRealName; + + @ApiModelProperty(value = "所属相关方模糊查询") + private String likeRelatedCorpNames; + + @ApiModelProperty(value = "推送人模糊查询") + private String likeCreateName; +} diff --git a/web-domain/src/main/java/com/zcloud/edu/domain/model/study/StudentSignE.java b/web-domain/src/main/java/com/zcloud/edu/domain/model/study/StudentSignE.java index bd5cdbd..ccb0af3 100644 --- a/web-domain/src/main/java/com/zcloud/edu/domain/model/study/StudentSignE.java +++ b/web-domain/src/main/java/com/zcloud/edu/domain/model/study/StudentSignE.java @@ -78,13 +78,13 @@ public class StudentSignE extends BaseE { map.put("pic2", faceUrl); String jsonParam = JSON.toJSONString(map); // 正式环境 -// String compareResult = HttpRequestUtil.doPost("http://192.168.192.201:8971/gbs-face/face/compareFace", jsonParam); -// JSONObject jsonObject = JSONObject.parseObject(compareResult); -// jsonObject.getJSONObject("info").getString("confidence"); -// String compareResultStr = jsonObject.getJSONObject("info").getString("confidence"); + String compareResult = HttpRequestUtil.doPost("http://192.168.192.201:8971/gbs-face/face/compareFace", jsonParam); + JSONObject jsonObject = JSONObject.parseObject(compareResult); + jsonObject.getJSONObject("info").getString("confidence"); + String compareResultStr = jsonObject.getJSONObject("info").getString("confidence"); - // 测试环境 - String compareResultStr = FaceUtil.compareFace(templateFace, faceUrl); + // 测试环境 +// String compareResultStr = FaceUtil.compareFace(templateFace, faceUrl); if (Double.valueOf(compareResultStr) < 75) { throw new BizException("人脸不匹配"); } diff --git a/web-domain/src/main/java/com/zcloud/edu/domain/utils/FixedPictureUtils.java b/web-domain/src/main/java/com/zcloud/edu/domain/utils/FixedPictureUtils.java index d5440dd..c083bd3 100644 --- a/web-domain/src/main/java/com/zcloud/edu/domain/utils/FixedPictureUtils.java +++ b/web-domain/src/main/java/com/zcloud/edu/domain/utils/FixedPictureUtils.java @@ -345,4 +345,4 @@ public class FixedPictureUtils { .create(); } } -} \ No newline at end of file +} diff --git a/web-infrastructure/src/main/java/com/zcloud/edu/persistence/dataobject/TrainingThirdPartyPushLogDO.java b/web-infrastructure/src/main/java/com/zcloud/edu/persistence/dataobject/TrainingThirdPartyPushLogDO.java new file mode 100644 index 0000000..e9c32f2 --- /dev/null +++ b/web-infrastructure/src/main/java/com/zcloud/edu/persistence/dataobject/TrainingThirdPartyPushLogDO.java @@ -0,0 +1,46 @@ +package com.zcloud.edu.persistence.dataobject; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.jjb.saas.framework.repository.basedo.BaseDO; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; + +@Data +@TableName("training_third_party_push_log") +@NoArgsConstructor +@EqualsAndHashCode(callSuper = true) +public class TrainingThirdPartyPushLogDO extends BaseDO { + + @ApiModelProperty(value = "业务主键id") + private String trainingThirdPartyPushLogId; + + @ApiModelProperty(value = "用户名") + private String username; + + @ApiModelProperty(value = "姓名") + private String realName; + + @ApiModelProperty(value = "性别") + private String userSex; + + @ApiModelProperty(value = "身份证号") + private String idCard; + + @ApiModelProperty(value = "组织树(所属企业/部门)") + private String orgTree; + + @ApiModelProperty(value = "免冠照片url地址") + private String avatarUrl; + + @ApiModelProperty(value = "手机号") + private String phoneNumber; + + @ApiModelProperty(value = "所属相关方") + private String relatedCorpNames; + + public TrainingThirdPartyPushLogDO(String trainingThirdPartyPushLogId) { + this.trainingThirdPartyPushLogId = trainingThirdPartyPushLogId; + } +} diff --git a/web-infrastructure/src/main/java/com/zcloud/edu/persistence/dataobject/TrainingThirdPartyPushSourceDO.java b/web-infrastructure/src/main/java/com/zcloud/edu/persistence/dataobject/TrainingThirdPartyPushSourceDO.java new file mode 100644 index 0000000..2a4ac96 --- /dev/null +++ b/web-infrastructure/src/main/java/com/zcloud/edu/persistence/dataobject/TrainingThirdPartyPushSourceDO.java @@ -0,0 +1,32 @@ +package com.zcloud.edu.persistence.dataobject; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +public class TrainingThirdPartyPushSourceDO { + + @ApiModelProperty(value = "用户id") + private Long userId; + + @ApiModelProperty(value = "用户名") + private String username; + + @ApiModelProperty(value = "姓名") + private String realName; + + @ApiModelProperty(value = "身份证号") + private String idCard; + + @ApiModelProperty(value = "组织树") + private String orgTree; + + @ApiModelProperty(value = "头像地址") + private String avatarUrl; + + @ApiModelProperty(value = "手机号") + private String phoneNumber; + + @ApiModelProperty(value = "所属相关方") + private String relatedCorpNames; +} diff --git a/web-infrastructure/src/main/java/com/zcloud/edu/persistence/dataobject/TrainingUserDO.java b/web-infrastructure/src/main/java/com/zcloud/edu/persistence/dataobject/TrainingUserDO.java index 3a00c3b..bef8095 100644 --- a/web-infrastructure/src/main/java/com/zcloud/edu/persistence/dataobject/TrainingUserDO.java +++ b/web-infrastructure/src/main/java/com/zcloud/edu/persistence/dataobject/TrainingUserDO.java @@ -1,6 +1,7 @@ package com.zcloud.edu.persistence.dataobject; -import com.baomidou.mybatisplus.annotation.*; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; import com.jjb.saas.framework.repository.basedo.BaseDO; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -9,70 +10,58 @@ import lombok.NoArgsConstructor; import java.time.LocalDateTime; -/** -* web-infrastructure -* @Author makejava -* @Date 2026-01-12 15:41:03 -*/ @Data @TableName("training_user") @NoArgsConstructor @EqualsAndHashCode(callSuper = true) public class TrainingUserDO extends BaseDO { - //业务主键id + @ApiModelProperty(value = "业务主键id") private String trainingUserId; - //手机号 + @ApiModelProperty(value = "手机号") private String phone; - //申请状态1:待审批2:审批通过,3:审批不通过 - @ApiModelProperty(value = "申请状态1:待审批2:审批通过,3:审批不通过") + + @ApiModelProperty(value = "申请状态") private Long applyStatus; - //有效期开始时间 + @ApiModelProperty(value = "有效期开始时间") private LocalDateTime startTime; - //有效期结束时间 + @ApiModelProperty(value = "有效期结束时间") private LocalDateTime endTime; - //考试状态:1.待考试2:考试通过,3:考试不通过 - @ApiModelProperty(value = "考试状态:1.待考试2:考试通过,3:考试不通过") + + @ApiModelProperty(value = "考试状态") private Long examineStatus; - @ApiModelProperty(value = "当前培训证书有效状态 0-无效 1-有效") + @ApiModelProperty(value = "是否由第三方培训 0-否 1-是") + private Integer isThirdParty; + + @ApiModelProperty(value = "当前培训证书有效状态 0-无效 1-有效") @TableField(exist = false) private Integer stateFlag; - - //姓名 @ApiModelProperty(value = "姓名") @TableField(exist = false) private String name; - //所属部门 @ApiModelProperty(value = "所属部门") @TableField(exist = false) private String departmentName; - //所属部门id @ApiModelProperty(value = "所属部门id") @TableField(exist = false) private Long departmentId; - //所属岗位 @ApiModelProperty(value = "所属岗位") @TableField(exist = false) private String postName; - //所属岗位id @ApiModelProperty(value = "所属岗位id") @TableField(exist = false) private Long postId; - - public TrainingUserDO(String trainingUserId) { this.trainingUserId = trainingUserId; } - } - diff --git a/web-infrastructure/src/main/java/com/zcloud/edu/persistence/mapper/TrainingThirdPartyPushLogMapper.java b/web-infrastructure/src/main/java/com/zcloud/edu/persistence/mapper/TrainingThirdPartyPushLogMapper.java new file mode 100644 index 0000000..926465d --- /dev/null +++ b/web-infrastructure/src/main/java/com/zcloud/edu/persistence/mapper/TrainingThirdPartyPushLogMapper.java @@ -0,0 +1,9 @@ +package com.zcloud.edu.persistence.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.zcloud.edu.persistence.dataobject.TrainingThirdPartyPushLogDO; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface TrainingThirdPartyPushLogMapper extends BaseMapper { +} diff --git a/web-infrastructure/src/main/java/com/zcloud/edu/persistence/mapper/TrainingUserMapper.java b/web-infrastructure/src/main/java/com/zcloud/edu/persistence/mapper/TrainingUserMapper.java index 50db4a2..bd6e1c4 100644 --- a/web-infrastructure/src/main/java/com/zcloud/edu/persistence/mapper/TrainingUserMapper.java +++ b/web-infrastructure/src/main/java/com/zcloud/edu/persistence/mapper/TrainingUserMapper.java @@ -1,6 +1,7 @@ package com.zcloud.edu.persistence.mapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.zcloud.edu.persistence.dataobject.TrainingThirdPartyPushSourceDO; import com.zcloud.edu.persistence.dataobject.TrainingUserDO; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.apache.ibatis.annotations.Mapper; @@ -23,5 +24,7 @@ public interface TrainingUserMapper extends BaseMapper { IPage listEduUserPage(IPage page, @Param("params") Map params); List listEduUser(@Param("params") Map params); + List listThirdPartyPushUsers(@Param("params") Map params); + } diff --git a/web-infrastructure/src/main/java/com/zcloud/edu/persistence/mapper/study/StudentMapper.java b/web-infrastructure/src/main/java/com/zcloud/edu/persistence/mapper/study/StudentMapper.java index cb2513c..825cf13 100644 --- a/web-infrastructure/src/main/java/com/zcloud/edu/persistence/mapper/study/StudentMapper.java +++ b/web-infrastructure/src/main/java/com/zcloud/edu/persistence/mapper/study/StudentMapper.java @@ -53,5 +53,7 @@ public interface StudentMapper extends BaseMapper { IPage educationUserList(Page> page, Map params, String menuPerms); + + IPage pushCandidateUserList(Page> page, Map params, String menuPerms); } diff --git a/web-infrastructure/src/main/java/com/zcloud/edu/persistence/repository/impl/TrainingThirdPartyPushLogRepositoryImpl.java b/web-infrastructure/src/main/java/com/zcloud/edu/persistence/repository/impl/TrainingThirdPartyPushLogRepositoryImpl.java new file mode 100644 index 0000000..26e8502 --- /dev/null +++ b/web-infrastructure/src/main/java/com/zcloud/edu/persistence/repository/impl/TrainingThirdPartyPushLogRepositoryImpl.java @@ -0,0 +1,35 @@ +package com.zcloud.edu.persistence.repository.impl; + +import com.alibaba.cola.dto.PageResponse; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.jjb.saas.framework.repository.common.PageHelper; +import com.jjb.saas.framework.repository.repo.impl.BaseRepositoryImpl; +import com.zcloud.edu.persistence.dataobject.TrainingThirdPartyPushLogDO; +import com.zcloud.edu.persistence.mapper.TrainingThirdPartyPushLogMapper; +import com.zcloud.edu.persistence.repository.training.TrainingThirdPartyPushLogRepository; +import com.zcloud.gbscommon.utils.PageQueryHelper; +import com.zcloud.gbscommon.utils.Query; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + +import java.util.Map; + +@Service +@RequiredArgsConstructor +public class TrainingThirdPartyPushLogRepositoryImpl extends BaseRepositoryImpl + implements TrainingThirdPartyPushLogRepository { + + private final TrainingThirdPartyPushLogMapper trainingThirdPartyPushLogMapper; + + @Override + public PageResponse listPage(Map params) { + IPage iPage = new Query().getPage(params); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper = PageQueryHelper.createPageQueryWrapper(queryWrapper, params); + queryWrapper.eq("delete_enum", "FALSE"); + queryWrapper.orderByDesc("create_time"); + IPage result = trainingThirdPartyPushLogMapper.selectPage(iPage, queryWrapper); + return PageHelper.pageToResponse(result, result.getRecords()); + } +} diff --git a/web-infrastructure/src/main/java/com/zcloud/edu/persistence/repository/impl/TrainingUserRepositoryImpl.java b/web-infrastructure/src/main/java/com/zcloud/edu/persistence/repository/impl/TrainingUserRepositoryImpl.java index bebdf3e..d31f0e9 100644 --- a/web-infrastructure/src/main/java/com/zcloud/edu/persistence/repository/impl/TrainingUserRepositoryImpl.java +++ b/web-infrastructure/src/main/java/com/zcloud/edu/persistence/repository/impl/TrainingUserRepositoryImpl.java @@ -3,6 +3,7 @@ package com.zcloud.edu.persistence.repository.impl; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.jjb.saas.framework.repository.common.PageHelper; import com.zcloud.edu.domain.model.training.TrainingUserE; +import com.zcloud.edu.persistence.dataobject.TrainingThirdPartyPushSourceDO; import com.zcloud.edu.persistence.dataobject.TrainingUserDO; import com.zcloud.edu.persistence.mapper.TrainingUserMapper; import com.zcloud.edu.persistence.repository.training.TrainingUserRepository; @@ -60,5 +61,21 @@ public class TrainingUserRepositoryImpl extends BaseRepositoryImpl listAllByPhones(Map params) { return trainingUserMapper.listAllByPhones(params); } + + @Override + public List listThirdPartyPushUsers(Map params) { + return trainingUserMapper.listThirdPartyPushUsers(params); + } + + @Override + public void updateThirdPartyFlagByPhones(List phones) { + if (phones == null || phones.isEmpty()) { + return; + } + UpdateWrapper updateWrapper = new UpdateWrapper<>(); + updateWrapper.in("phone", phones) + .set("is_third_party", 1); + trainingUserMapper.update(null, updateWrapper); + } } diff --git a/web-infrastructure/src/main/java/com/zcloud/edu/persistence/repository/impl/study/StudentRepositoryImpl.java b/web-infrastructure/src/main/java/com/zcloud/edu/persistence/repository/impl/study/StudentRepositoryImpl.java index 2893630..407f8ef 100644 --- a/web-infrastructure/src/main/java/com/zcloud/edu/persistence/repository/impl/study/StudentRepositoryImpl.java +++ b/web-infrastructure/src/main/java/com/zcloud/edu/persistence/repository/impl/study/StudentRepositoryImpl.java @@ -149,5 +149,16 @@ public class StudentRepositoryImpl extends BaseRepositoryImpl pushCandidateUserList(Map params) { + Page> page = new Page<>(Integer.parseInt(params.get("pageIndex").toString()), Integer.parseInt(params.get("pageSize").toString())); + String menuPerms = ""; + if (!org.springframework.util.ObjectUtils.isEmpty(params.get("menuPath"))) { + menuPerms = MenuEnum.getMenuKeyByPath(params.get("menuPath").toString()); + } + IPage iPage = studentMapper.pushCandidateUserList(page, params, menuPerms); + return PageHelper.pageToResponse(iPage, iPage.getRecords()); + } + } diff --git a/web-infrastructure/src/main/java/com/zcloud/edu/persistence/repository/study/StudentRepository.java b/web-infrastructure/src/main/java/com/zcloud/edu/persistence/repository/study/StudentRepository.java index af7665a..027bcee 100644 --- a/web-infrastructure/src/main/java/com/zcloud/edu/persistence/repository/study/StudentRepository.java +++ b/web-infrastructure/src/main/java/com/zcloud/edu/persistence/repository/study/StudentRepository.java @@ -49,5 +49,7 @@ public interface StudentRepository extends BaseRepository { List listStudentCount(Map params); PageResponse educationUserList(Map params); + + PageResponse pushCandidateUserList(Map params); } diff --git a/web-infrastructure/src/main/java/com/zcloud/edu/persistence/repository/training/TrainingThirdPartyPushLogRepository.java b/web-infrastructure/src/main/java/com/zcloud/edu/persistence/repository/training/TrainingThirdPartyPushLogRepository.java new file mode 100644 index 0000000..afbab50 --- /dev/null +++ b/web-infrastructure/src/main/java/com/zcloud/edu/persistence/repository/training/TrainingThirdPartyPushLogRepository.java @@ -0,0 +1,12 @@ +package com.zcloud.edu.persistence.repository.training; + +import com.alibaba.cola.dto.PageResponse; +import com.jjb.saas.framework.repository.repo.BaseRepository; +import com.zcloud.edu.persistence.dataobject.TrainingThirdPartyPushLogDO; + +import java.util.Map; + +public interface TrainingThirdPartyPushLogRepository extends BaseRepository { + + PageResponse listPage(Map params); +} diff --git a/web-infrastructure/src/main/java/com/zcloud/edu/persistence/repository/training/TrainingUserRepository.java b/web-infrastructure/src/main/java/com/zcloud/edu/persistence/repository/training/TrainingUserRepository.java index aaed2e9..366cd0f 100644 --- a/web-infrastructure/src/main/java/com/zcloud/edu/persistence/repository/training/TrainingUserRepository.java +++ b/web-infrastructure/src/main/java/com/zcloud/edu/persistence/repository/training/TrainingUserRepository.java @@ -1,6 +1,7 @@ package com.zcloud.edu.persistence.repository.training; import com.zcloud.edu.domain.model.training.TrainingUserE; +import com.zcloud.edu.persistence.dataobject.TrainingThirdPartyPushSourceDO; import com.zcloud.edu.persistence.dataobject.TrainingUserDO; import com.alibaba.cola.dto.PageResponse; import com.jjb.saas.framework.repository.repo.BaseRepository; @@ -24,5 +25,9 @@ public interface TrainingUserRepository extends BaseRepository { List listAllByPhones(Map params); + + List listThirdPartyPushUsers(Map params); + + void updateThirdPartyFlagByPhones(List phones); } diff --git a/web-infrastructure/src/main/resources/mapper/TrainingUserMapper.xml b/web-infrastructure/src/main/resources/mapper/TrainingUserMapper.xml index 038868a..ce07e60 100644 --- a/web-infrastructure/src/main/resources/mapper/TrainingUserMapper.xml +++ b/web-infrastructure/src/main/resources/mapper/TrainingUserMapper.xml @@ -10,22 +10,18 @@ end_time = #{params.endTime} - phone = #{params.phone} - and ( end_time is null or end_time < #{params.endTime}) + phone = #{params.phone} + and (end_time is null or end_time < #{params.endTime}) - - + - diff --git a/web-infrastructure/src/main/resources/mapper/study/StudentMapper.xml b/web-infrastructure/src/main/resources/mapper/study/StudentMapper.xml index 4ccabcf..1b83739 100644 --- a/web-infrastructure/src/main/resources/mapper/study/StudentMapper.xml +++ b/web-infrastructure/src/main/resources/mapper/study/StudentMapper.xml @@ -484,5 +484,84 @@ group by tau.phone + +