|
@@ -7,11 +7,14 @@ import cn.hutool.core.util.IdUtil;
|
|
import cn.hutool.core.util.StrUtil;
|
|
import cn.hutool.core.util.StrUtil;
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
|
import com.zhongzheng.common.core.redis.RedisCache;
|
|
import com.zhongzheng.common.core.redis.RedisCache;
|
|
import com.zhongzheng.common.core.redis.RedisLockEntity;
|
|
import com.zhongzheng.common.core.redis.RedisLockEntity;
|
|
import com.zhongzheng.common.exception.CustomException;
|
|
import com.zhongzheng.common.exception.CustomException;
|
|
import com.zhongzheng.common.utils.AES;
|
|
import com.zhongzheng.common.utils.AES;
|
|
import com.zhongzheng.common.utils.DateUtils;
|
|
import com.zhongzheng.common.utils.DateUtils;
|
|
|
|
+import com.zhongzheng.common.utils.http.HttpUtils;
|
|
|
|
+import com.zhongzheng.common.utils.polyv.PolyvUtils;
|
|
import com.zhongzheng.modules.goods.service.IGoodsService;
|
|
import com.zhongzheng.modules.goods.service.IGoodsService;
|
|
import com.zhongzheng.modules.goods.vo.GoodsVo;
|
|
import com.zhongzheng.modules.goods.vo.GoodsVo;
|
|
import com.zhongzheng.modules.grade.bo.*;
|
|
import com.zhongzheng.modules.grade.bo.*;
|
|
@@ -48,7 +51,11 @@ import com.zhongzheng.modules.grade.service.IClassGradeUserService;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.util.CollectionUtils;
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
|
|
+import java.io.IOException;
|
|
|
|
+import java.io.UnsupportedEncodingException;
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
|
|
+import java.security.MessageDigest;
|
|
|
|
+import java.security.NoSuchAlgorithmException;
|
|
import java.util.*;
|
|
import java.util.*;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
@@ -336,8 +343,103 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public Boolean pushOfficialInfo(ClassGradeUserQueryBo bo) {
|
|
|
|
- return null;
|
|
|
|
|
|
+ public Boolean pushOfficialInfo(ClassGradeUserQueryBo bo){
|
|
|
|
+ ClassGradeUserVo userVo = this.baseMapper.selectUser(bo);
|
|
|
|
+ if(Validator.isEmpty(userVo)){
|
|
|
|
+ throw new CustomException("用户不存在");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ Map<String, String> params = new HashMap<>();
|
|
|
|
+ params.put("zh","peixunjigou");
|
|
|
|
+ params.put("bh",userVo.getClassName());
|
|
|
|
+ params.put("xm",userVo.getRealName());
|
|
|
|
+ params.put("sfz",userVo.getIdCard());
|
|
|
|
+ params.put("dh",userVo.getTelPhone());
|
|
|
|
+ params.put("bmrq","2022-2-15");
|
|
|
|
+ String dataTxt = params.get("zh")+params.get("bh")+params.get("xm")+params.get("sfz")+params.get("dh")+params.get("bmrq");
|
|
|
|
+ System.out.println(dataTxt);
|
|
|
|
+ String encrypted = dataSign(dataTxt,"0ca175b9c0f726a831d895e26933246");
|
|
|
|
+ System.out.println(encrypted);
|
|
|
|
+ params.put("SignMsg",encrypted);
|
|
|
|
+ String respone = "";
|
|
|
|
+ try{
|
|
|
|
+ respone = HttpUtils.postFormBody("http://jypt-dev.gdcic.net/organjxjy/ShangBaoMingdan",params);
|
|
|
|
+ System.out.println(respone);
|
|
|
|
+ }catch (IOException e){
|
|
|
|
+ throw new CustomException("请求错误");
|
|
|
|
+ }
|
|
|
|
+ /*ClassGradeUserOfficialBo officialBo = new ClassGradeUserOfficialBo();
|
|
|
|
+ officialBo.setZh("peixunjigou");
|
|
|
|
+ officialBo.setBh(userVo.getClassName());
|
|
|
|
+ officialBo.setSfz(userVo.getIdCard());
|
|
|
|
+ officialBo.setXm(userVo.getRealName());
|
|
|
|
+ officialBo.setDh(userVo.getTelPhone());
|
|
|
|
+ officialBo.setBmrq("2022-2-15");*/
|
|
|
|
+
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ public String dataSign(String SourceMsg,String PKey)
|
|
|
|
+ {
|
|
|
|
+ try{
|
|
|
|
+ String TempPKey;
|
|
|
|
+ TempPKey = getMD5(PKey,"UTF-16LE");
|
|
|
|
+ System.out.println(TempPKey);
|
|
|
|
+ TempPKey = SourceMsg + TempPKey;
|
|
|
|
+ System.out.println(TempPKey);
|
|
|
|
+ TempPKey = getMD5(TempPKey,"UTF-16LE");
|
|
|
|
+ System.out.println(TempPKey);
|
|
|
|
+ return TempPKey;
|
|
|
|
+ }catch (NoSuchAlgorithmException e){
|
|
|
|
+ throw new CustomException("数据错误");
|
|
|
|
+ }catch (UnsupportedEncodingException exception){
|
|
|
|
+ throw new CustomException("数据错误");
|
|
|
|
+ }catch (Exception exception2){
|
|
|
|
+ throw new CustomException("数据错误");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public static String MD5Encode(String origin) {
|
|
|
|
+ StringBuffer sb = new StringBuffer();
|
|
|
|
+ try {
|
|
|
|
+ MessageDigest md = MessageDigest.getInstance("MD5");
|
|
|
|
+ md.update(origin.getBytes("utf8"));
|
|
|
|
+ byte[] result = md.digest();
|
|
|
|
+ for (int i = 0; i < result.length; i++) {
|
|
|
|
+ //int val = result[i] & 0xff;
|
|
|
|
+ //sb.append(Integer.toHexString(val));
|
|
|
|
+ int val = (result[i] & 0x000000ff) | 0xffffff00;
|
|
|
|
+ sb.append(Integer.toHexString(val).substring(6));
|
|
|
|
+ }
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return sb.toString();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public String getMD5(String str, String encoding) throws Exception {
|
|
|
|
+
|
|
|
|
+ MessageDigest md = MessageDigest.getInstance("MD5");
|
|
|
|
+
|
|
|
|
+ md.update(str.getBytes(encoding));
|
|
|
|
+
|
|
|
|
+ byte[] result = md.digest();
|
|
|
|
+
|
|
|
|
+ StringBuffer sb = new StringBuffer();
|
|
|
|
+
|
|
|
|
+ for (int i = 0; i < result.length; i++) {
|
|
|
|
+
|
|
|
|
+ int val = result[i] & 0xff;
|
|
|
|
+
|
|
|
|
+ sb.append(Integer.toHexString(val));
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ return sb.toString();
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|