|
@@ -47,8 +47,11 @@ import com.zhongzheng.modules.grade.mapper.ClassGradeUserMapper;
|
|
|
import com.zhongzheng.modules.grade.service.*;
|
|
|
import com.zhongzheng.modules.grade.vo.*;
|
|
|
import com.zhongzheng.modules.order.bo.OrderGoodsQueryBo;
|
|
|
+import com.zhongzheng.modules.order.domain.Order;
|
|
|
import com.zhongzheng.modules.order.domain.OrderGoods;
|
|
|
+import com.zhongzheng.modules.order.domain.OrderInput;
|
|
|
import com.zhongzheng.modules.order.service.IOrderGoodsService;
|
|
|
+import com.zhongzheng.modules.order.service.IOrderInputService;
|
|
|
import com.zhongzheng.modules.order.service.IOrderService;
|
|
|
import com.zhongzheng.modules.order.vo.OrderGoodsVo;
|
|
|
import com.zhongzheng.modules.system.domain.SysOldOrg;
|
|
@@ -67,6 +70,7 @@ import com.zhongzheng.modules.user.service.IUserService;
|
|
|
import com.zhongzheng.modules.user.service.IUserStudyRecordPhotoService;
|
|
|
import com.zhongzheng.modules.user.service.IUserStudyRecordService;
|
|
|
import com.zhongzheng.modules.user.vo.*;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -115,6 +119,9 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
|
|
|
@Autowired
|
|
|
private IOrderService iOrderService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private IOrderInputService iOrderInputService;
|
|
|
+
|
|
|
@Autowired
|
|
|
private IOrderGoodsService iOrderGoodsService;
|
|
|
|
|
@@ -179,6 +186,8 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
|
|
|
@Value("${officialPush.sevenPeriodPath}")
|
|
|
private String OFFICIALPUSH_SEVEN_PERIODPATH;
|
|
|
|
|
|
+ @Value("${oldSys.host}")
|
|
|
+ private String OLD_SYS_HOST;
|
|
|
|
|
|
@Autowired
|
|
|
private IUserPeriodService iUserPeriodService;
|
|
@@ -773,6 +782,66 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
|
|
|
SEVEN_OFFICIALPUSH_INFOACCOUNT = configService.selectConfigByKeyNoCache("seven.office.account");
|
|
|
SEVEN_OFFICIALPUSH_TOKEN = configService.selectConfigByKeyNoCache("seven.office.token");
|
|
|
}
|
|
|
+ String jsonStr = configService.selectConfigByKeyNoCache("home.header");
|
|
|
+ boolean sevenPushAuth = false; //无需校验
|
|
|
+ if(Validator.isNotEmpty(jsonStr)){
|
|
|
+ JSONObject objectJson = JSON.parseObject(jsonStr);
|
|
|
+ if(Validator.isNotEmpty(objectJson)&&objectJson.containsKey("sevenPushAuth")){
|
|
|
+ Integer authRs = objectJson.getInteger("sevenPushAuth");
|
|
|
+ if(authRs==1){
|
|
|
+ sevenPushAuth = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(sevenPushAuth){
|
|
|
+ if(userVo.getSevenPushCheck()==0){
|
|
|
+ Map<String, String> params = new HashMap<>();
|
|
|
+ Long nowTime = DateUtils.getNowTime();
|
|
|
+ String sign = ToolsUtils.EncoderByMd5(userVo.getIdCard()+nowTime.toString());
|
|
|
+ params.put("stamp", nowTime.toString());
|
|
|
+ params.put("sign", sign);
|
|
|
+ params.put("idnum", userVo.getIdCard());
|
|
|
+ params.put("name", userVo.getRealName());
|
|
|
+ params.put("mobile", userVo.getTelPhone());
|
|
|
+ params.put("majorname", major.getCategoryName());
|
|
|
+ params.put("orderno", "");
|
|
|
+ params.put("gradeUserId", userVo.getId().toString());
|
|
|
+ Order order = iOrderService.getOne(new LambdaQueryWrapper<Order>()
|
|
|
+ .eq(Order::getOrderSn, orderGoods.getOrderSn()));
|
|
|
+ if(Validator.isNotEmpty(order.getInputOrderSn())){
|
|
|
+ OrderInput orderInput = iOrderInputService.getOne(new LambdaQueryWrapper<OrderInput>()
|
|
|
+ .eq(OrderInput::getInputOrderSn, order.getInputOrderSn()));
|
|
|
+ if(Validator.isNotEmpty(orderInput.getOldOrderSn())){
|
|
|
+ params.put("orderno", orderInput.getOldOrderSn());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ log.info("七大员权限推送参数"+ JSON.toJSONString(params));
|
|
|
+ String respone = "";
|
|
|
+ LambdaUpdateWrapper<ClassGradeUser> objectLambdaUpdateWrapper = Wrappers.lambdaUpdate();
|
|
|
+ objectLambdaUpdateWrapper.eq(ClassGradeUser::getId, userVo.getId());
|
|
|
+ try {
|
|
|
+ respone = HttpUtils.postFormBody(OLD_SYS_HOST+"/system/BussinessApi/QdyCheckInfo", params);
|
|
|
+ log.info("七大员权限推送结果"+ JSON.toJSONString(respone));
|
|
|
+ if (respone.contains("\"Status\":true")) {
|
|
|
+ objectLambdaUpdateWrapper.set(ClassGradeUser::getSevenPushCheck, 1);
|
|
|
+ objectLambdaUpdateWrapper.set(ClassGradeUser::getUpdateTime, DateUtils.getNowTime());
|
|
|
+ iClassGradeUserService.update(null, objectLambdaUpdateWrapper);
|
|
|
+ return "等待权限推送";
|
|
|
+ }else{
|
|
|
+ throw new CustomException("七大员权限请求错误"+JSON.toJSONString(respone));
|
|
|
+ }
|
|
|
+ } catch (IOException e) {
|
|
|
+ throw new CustomException("七大员权限请求错误"+e.getMessage());
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ else if(userVo.getSevenPushCheck()==1){
|
|
|
+ return "等待权限推送";
|
|
|
+ }
|
|
|
+ else if(userVo.getSevenPushCheck()==3){
|
|
|
+ return "无权限推送";
|
|
|
+ }
|
|
|
+ }
|
|
|
Map<String, String> params = new HashMap<>();
|
|
|
params.put("zh", SEVEN_OFFICIALPUSH_INFOACCOUNT);
|
|
|
params.put("bh", userVo.getOfficialName());
|
|
@@ -3408,6 +3477,18 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
|
|
|
return baseMapper.getClassInfoByUser(userId);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public Boolean sevenPushAuthCallBack(SevenPushAuthAddBo bo) {
|
|
|
+ if(Validator.isEmpty(bo.getGradeUserId())||Validator.isEmpty(bo.getPushStatus())){
|
|
|
+ throw new CustomException("参数缺失");
|
|
|
+ }
|
|
|
+ LambdaUpdateWrapper<ClassGradeUser> objectLambdaUpdateWrapper = Wrappers.lambdaUpdate();
|
|
|
+ objectLambdaUpdateWrapper.eq(ClassGradeUser::getId, bo.getGradeUserId());
|
|
|
+ objectLambdaUpdateWrapper.set(ClassGradeUser::getSevenPushCheck, bo.getPushStatus()+1);
|
|
|
+ objectLambdaUpdateWrapper.set(ClassGradeUser::getUpdateTime, DateUtils.getNowTime());
|
|
|
+ return this.update(null, objectLambdaUpdateWrapper);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 实体类转化成视图对象
|