|
|
@@ -3,9 +3,13 @@ package com.zhongzheng.modules.top.order.service.impl;
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
import cn.hutool.core.lang.Validator;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import com.zhongzheng.common.exception.CustomException;
|
|
|
import com.zhongzheng.common.utils.DateUtils;
|
|
|
+import com.zhongzheng.common.utils.ToolsUtils;
|
|
|
+import com.zhongzheng.common.utils.http.HttpUtils;
|
|
|
import com.zhongzheng.modules.bank.domain.ExamQuestion;
|
|
|
+import com.zhongzheng.modules.grade.domain.ClassGradeUser;
|
|
|
import com.zhongzheng.modules.top.order.bo.TopOrderRecNoteAddBo;
|
|
|
import com.zhongzheng.modules.top.order.bo.TopOrderRecNoteEditBo;
|
|
|
import com.zhongzheng.modules.top.order.bo.TopOrderRecNoteQueryBo;
|
|
|
@@ -19,9 +23,8 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.github.pagehelper.Page;
|
|
|
|
|
|
-import java.util.Collection;
|
|
|
-import java.util.Collections;
|
|
|
-import java.util.List;
|
|
|
+import java.io.IOException;
|
|
|
+import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
@@ -84,6 +87,10 @@ public class TopOrderRecNoteServiceImpl extends ServiceImpl<TopOrderRecNoteMappe
|
|
|
validEntityBeforeSave(add);
|
|
|
add.setCreateTime(DateUtils.getNowTime());
|
|
|
add.setUpdateTime(DateUtils.getNowTime());
|
|
|
+ if(bo.getNoteType()==1){
|
|
|
+ pushOldNote(bo.getOrderSn());
|
|
|
+ bo.setLastTime(DateUtils.getNowTime());
|
|
|
+ }
|
|
|
return this.save(add);
|
|
|
}
|
|
|
|
|
|
@@ -98,9 +105,33 @@ public class TopOrderRecNoteServiceImpl extends ServiceImpl<TopOrderRecNoteMappe
|
|
|
TopOrderRecNote update = BeanUtil.toBean(bo, TopOrderRecNote.class);
|
|
|
validEntityBeforeSave(update);
|
|
|
update.setUpdateTime(DateUtils.getNowTime());
|
|
|
+ if(bo.getNoteType()==1){
|
|
|
+ pushOldNote(bo.getOrderSn());
|
|
|
+ bo.setLastTime(DateUtils.getNowTime());
|
|
|
+ }
|
|
|
return this.updateById(update);
|
|
|
}
|
|
|
|
|
|
+ private boolean pushOldNote(String orderSn){
|
|
|
+ Map<String, String> params = new HashMap<>();
|
|
|
+ Long nowTime = DateUtils.getNowTime();
|
|
|
+ String sign = ToolsUtils.EncoderByMd5(orderSn+"pubilc2022");
|
|
|
+ params.put("stamp", nowTime.toString());
|
|
|
+ params.put("sign", sign);
|
|
|
+ params.put("orderNos", orderSn);
|
|
|
+ String respone = "";
|
|
|
+ String path = "http://gdxypx.xy.com/WitSystem/BussinessApi/PressMsg";
|
|
|
+ try {
|
|
|
+ respone = HttpUtils.postFormBody(path, params);
|
|
|
+ if (!respone.contains("\"Status\":true")) {
|
|
|
+ throw new CustomException("同步请求错误"+respone);
|
|
|
+ }
|
|
|
+ } catch (IOException e) {
|
|
|
+ throw new CustomException("同步请求错误"+e.getMessage());
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 保存前的数据校验
|
|
|
*
|