|
@@ -18,6 +18,7 @@ import com.zhongzheng.common.utils.ServletUtils;
|
|
|
import com.zhongzheng.common.utils.ToolsUtils;
|
|
|
import com.zhongzheng.common.utils.http.HttpUtils;
|
|
|
import com.zhongzheng.modules.base.service.ICertificateTpService;
|
|
|
+import com.zhongzheng.modules.course.bo.CourseBusinessQueryBo;
|
|
|
import com.zhongzheng.modules.course.bo.CourseMenuQueryBo;
|
|
|
import com.zhongzheng.modules.course.domain.CourseBusiness;
|
|
|
import com.zhongzheng.modules.course.domain.CourseEducationType;
|
|
@@ -52,6 +53,8 @@ import com.zhongzheng.modules.user.service.IUserService;
|
|
|
import com.zhongzheng.modules.user.service.IUserStudyRecordPhotoService;
|
|
|
import com.zhongzheng.modules.user.vo.UserVo;
|
|
|
import com.zhongzheng.modules.wx.service.IWxLoginService;
|
|
|
+import org.slf4j.Logger;
|
|
|
+import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -81,6 +84,8 @@ import java.util.stream.Collectors;
|
|
|
@Service
|
|
|
public class UserPeriodServiceImpl extends ServiceImpl<UserPeriodMapper, UserPeriod> implements IUserPeriodService {
|
|
|
|
|
|
+ private static Logger log = LoggerFactory.getLogger(UserPeriodServiceImpl.class);
|
|
|
+
|
|
|
@Autowired
|
|
|
private IUserPeriodStatusService userPeriodStatusService;
|
|
|
|
|
@@ -513,11 +518,15 @@ public class UserPeriodServiceImpl extends ServiceImpl<UserPeriodMapper, UserPer
|
|
|
boolean hasSeven = false;
|
|
|
GoodsVo goodsVo = iGoodsService.selectDetail(bo.getGoodsId());
|
|
|
SyncUserCourseStudyRec studyRec = new SyncUserCourseStudyRec();
|
|
|
+ CourseBusinessQueryBo queryBo = new CourseBusinessQueryBo();
|
|
|
+ queryBo.setId(goodsVo.getBusinessId());
|
|
|
+ String fullName = iCourseBusinessService.queryFullName(queryBo);
|
|
|
if(goodsVo.getBusinessId().longValue()!=business.getId().longValue()){
|
|
|
CourseBusiness business7 = iCourseBusinessService.getOne(new LambdaQueryWrapper<CourseBusiness>().eq(CourseBusiness::getStatus, 1).eq(CourseBusiness::getId,goodsVo.getBusinessId()).last("limit 1"));
|
|
|
if(Validator.isEmpty(business7)||(Validator.isNotEmpty(business7)&&!"七大员".equals(business7.getBusinessName()))){
|
|
|
-
|
|
|
- return null;
|
|
|
+ if(!"继续教育二级造价师".equals(fullName)){
|
|
|
+ return null;
|
|
|
+ }
|
|
|
}
|
|
|
if(Validator.isNotEmpty(business7)&&"七大员".equals(business7.getBusinessName())){
|
|
|
hasSeven = true;
|
|
@@ -532,6 +541,9 @@ public class UserPeriodServiceImpl extends ServiceImpl<UserPeriodMapper, UserPer
|
|
|
if(goodsVo.getBusinessId().longValue()==business.getId().longValue()){
|
|
|
studyRec.setCourseType(5);
|
|
|
}
|
|
|
+ if("继续教育二级造价师".equals(fullName)){
|
|
|
+ studyRec.setCourseType(8);
|
|
|
+ }
|
|
|
|
|
|
String TenantId = ServletUtils.getRequest().getHeader("TenantId");
|
|
|
studyRec.setTenantId(TenantId);
|
|
@@ -552,8 +564,8 @@ public class UserPeriodServiceImpl extends ServiceImpl<UserPeriodMapper, UserPer
|
|
|
GoodsCourseQueryBo goodsCourseQueryBo = new GoodsCourseQueryBo();
|
|
|
goodsCourseQueryBo.setGoodsId(goodsVo.getGoodsId());
|
|
|
List<CourseVo> courseVoList = iGoodsCourseService.selectList(goodsCourseQueryBo);
|
|
|
- //二建
|
|
|
- if(goodsVo.getBusinessId().longValue()==business.getId().longValue()){
|
|
|
+ //二造继教和二建继教
|
|
|
+ if((goodsVo.getBusinessId().longValue()==business.getId().longValue())||("继续教育二级造价师".equals(fullName))){
|
|
|
for(CourseVo courseVo : courseVoList){
|
|
|
CourseMenuQueryBo menuQueryBo = new CourseMenuQueryBo();
|
|
|
menuQueryBo.setCourseId(courseVo.getCourseId());
|
|
@@ -732,8 +744,7 @@ public class UserPeriodServiceImpl extends ServiceImpl<UserPeriodMapper, UserPer
|
|
|
studyRec.setChapterList(ChapterList);
|
|
|
}
|
|
|
//学习记录推送到旧系统
|
|
|
- System.out.println(123);
|
|
|
- System.out.println(studyRec);
|
|
|
+
|
|
|
Map<String, String> params = new HashMap<>();
|
|
|
Long nowTime = DateUtils.getNowTime();
|
|
|
String sign = ToolsUtils.EncoderByMd5(nowTime.toString()+"pubilc2022");
|
|
@@ -743,6 +754,7 @@ public class UserPeriodServiceImpl extends ServiceImpl<UserPeriodMapper, UserPer
|
|
|
String respone = "";
|
|
|
try {
|
|
|
respone = HttpUtils.postFormBody(SYNC_PATH, params);
|
|
|
+ log.info("学时推送业务系统",params+"结果:"+respone);
|
|
|
} catch (IOException e) {
|
|
|
throw new CustomException("同步请求错误"+e.getMessage());
|
|
|
}
|