|
@@ -29,6 +29,7 @@ import com.zhongzheng.modules.bs.covenant.vo.BsCovenantGoodsVo;
|
|
|
import com.zhongzheng.modules.bs.covenant.vo.BsCovenantVo;
|
|
|
import com.zhongzheng.modules.bs.covenant.vo.NoCheckInfo;
|
|
|
import com.zhongzheng.modules.course.domain.CourseBusiness;
|
|
|
+import com.zhongzheng.modules.course.domain.Major;
|
|
|
import com.zhongzheng.modules.course.service.ICourseBusinessService;
|
|
|
import com.zhongzheng.modules.course.service.ICourseEducationTypeService;
|
|
|
import com.zhongzheng.modules.course.service.ICourseProjectTypeService;
|
|
@@ -119,7 +120,11 @@ public class BsCovenantServiceImpl extends ServiceImpl<BsCovenantMapper, BsCoven
|
|
|
bsCovenantGoodsVos.forEach(bsCovenantGoodsVo -> {
|
|
|
Goods goods = iGoodsService.getById(bsCovenantGoodsVo.getGoodsId());
|
|
|
bsCovenantGoodsVo.setGoodsName(goods.getGoodsName());
|
|
|
- bsCovenantGoodsVo.setMajorName(iMajorService.getById(goods.getMajorId()).getCategoryName());
|
|
|
+ Long majorId = goods.getMajorId();
|
|
|
+ if (ObjectUtils.isNotNull(majorId)){
|
|
|
+ Major byId = iMajorService.getById(majorId);
|
|
|
+ bsCovenantGoodsVo.setMajorName(byId.getCategoryName());
|
|
|
+ }
|
|
|
bsCovenantGoodsVo.setStandPrice(goods.getStandPrice());
|
|
|
covenantGoodsVos.add(bsCovenantGoodsVo);
|
|
|
});
|
|
@@ -260,7 +265,8 @@ public class BsCovenantServiceImpl extends ServiceImpl<BsCovenantMapper, BsCoven
|
|
|
if (!bo.getBsCovenantBusinessList().isEmpty()) {
|
|
|
//写入协议业务类型
|
|
|
bo.getBsCovenantBusinessList().forEach(bsCovenantBusinessAddBo -> {
|
|
|
- CourseBusiness courseBusiness = iCourseBusinessService.getOne(new LambdaQueryWrapper<CourseBusiness>().eq(CourseBusiness::getProjectId, bsCovenantBusinessAddBo.getProjectId()).eq(CourseBusiness::getStatus, 1));
|
|
|
+ CourseBusiness courseBusiness = iCourseBusinessService.getOne(new LambdaQueryWrapper<CourseBusiness>().eq(CourseBusiness::getId, bsCovenantBusinessAddBo.getBusinessId()).eq(CourseBusiness::getStatus, 1));
|
|
|
+ bsCovenantBusinessAddBo.setProjectId(Long.valueOf(courseBusiness.getProjectId()));
|
|
|
bsCovenantBusinessAddBo.setBusinessId(courseBusiness.getId());
|
|
|
bsCovenantBusinessAddBo.setCovenantId(newBsCovenant.getCovenantId());
|
|
|
bsCovenantBusinessAddBo.setCreateTime(DateUtils.getNowTime());
|
|
@@ -283,11 +289,14 @@ public class BsCovenantServiceImpl extends ServiceImpl<BsCovenantMapper, BsCoven
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
+ }else {
|
|
|
+ throw new CustomException("请选择是否复制协议数据");
|
|
|
}
|
|
|
- throw new CustomException("请选择是否复制协议数据");
|
|
|
}
|
|
|
bo.getBsCovenantBusinessList().forEach(bsCovenantBusinessAddBo -> {
|
|
|
- CourseBusiness courseBusiness = iCourseBusinessService.getOne(new LambdaQueryWrapper<CourseBusiness>().eq(CourseBusiness::getProjectId, bsCovenantBusinessAddBo.getProjectId()).eq(CourseBusiness::getStatus, 1));
|
|
|
+ CourseBusiness courseBusiness = iCourseBusinessService.getOne(new LambdaQueryWrapper<CourseBusiness>().eq(CourseBusiness::getId, bsCovenantBusinessAddBo.getBusinessId()).eq(CourseBusiness::getStatus, 1));
|
|
|
+ bsCovenantBusinessAddBo.setProjectId(Long.valueOf(courseBusiness.getProjectId()));
|
|
|
+ bsCovenantBusinessAddBo.setCovenantId(newBsCovenant.getCovenantId());
|
|
|
bsCovenantBusinessAddBo.setBusinessId(courseBusiness.getId());
|
|
|
bsCovenantBusinessAddBo.setCreateTime(DateUtils.getNowTime());
|
|
|
bsCovenantBusinessAddBo.setUpdateTime(DateUtils.getNowTime());
|
|
@@ -384,8 +393,10 @@ public class BsCovenantServiceImpl extends ServiceImpl<BsCovenantMapper, BsCoven
|
|
|
if (!bo.getBsCovenantBusinessList().isEmpty()) {
|
|
|
//写入协议业务类型
|
|
|
bo.getBsCovenantBusinessList().forEach(bsCovenantBusinessAddBo -> {
|
|
|
- CourseBusiness courseBusiness = iCourseBusinessService.getOne(new LambdaQueryWrapper<CourseBusiness>().eq(CourseBusiness::getProjectId, bsCovenantBusinessAddBo.getProjectId()).eq(CourseBusiness::getStatus, 1));
|
|
|
+ CourseBusiness courseBusiness = iCourseBusinessService.getOne(new LambdaQueryWrapper<CourseBusiness>().eq(CourseBusiness::getId, bsCovenantBusinessAddBo.getBusinessId()).eq(CourseBusiness::getStatus, 1));
|
|
|
+ bsCovenantBusinessAddBo.setProjectId(Long.valueOf(courseBusiness.getProjectId()));
|
|
|
bsCovenantBusinessAddBo.setBusinessId(courseBusiness.getId());
|
|
|
+ bsCovenantBusinessAddBo.setCovenantId(newBsCovenant.getCovenantId());
|
|
|
bsCovenantBusinessAddBo.setCompanyId(bo.getCompanyId());
|
|
|
bsCovenantBusinessAddBo.setCreateTime(DateUtils.getNowTime());
|
|
|
bsCovenantBusinessAddBo.setUpdateTime(DateUtils.getNowTime());
|
|
@@ -408,12 +419,15 @@ public class BsCovenantServiceImpl extends ServiceImpl<BsCovenantMapper, BsCoven
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
+ }else {
|
|
|
+ throw new CustomException("请选择是否复制协议数据");
|
|
|
}
|
|
|
- throw new CustomException("请选择是否复制协议数据");
|
|
|
}
|
|
|
bo.getBsCovenantBusinessList().forEach(bsCovenantBusinessAddBo -> {
|
|
|
- CourseBusiness courseBusiness = iCourseBusinessService.getOne(new LambdaQueryWrapper<CourseBusiness>().eq(CourseBusiness::getProjectId, bsCovenantBusinessAddBo.getProjectId()).eq(CourseBusiness::getStatus, 1));
|
|
|
+ CourseBusiness courseBusiness = iCourseBusinessService.getOne(new LambdaQueryWrapper<CourseBusiness>().eq(CourseBusiness::getId, bsCovenantBusinessAddBo.getBusinessId()).eq(CourseBusiness::getStatus, 1));
|
|
|
+ bsCovenantBusinessAddBo.setProjectId(Long.valueOf(courseBusiness.getProjectId()));
|
|
|
bsCovenantBusinessAddBo.setBusinessId(courseBusiness.getId());
|
|
|
+ bsCovenantBusinessAddBo.setCovenantId(newBsCovenant.getCovenantId());
|
|
|
bsCovenantBusinessAddBo.setCompanyId(bo.getCompanyId());
|
|
|
bsCovenantBusinessAddBo.setCreateTime(DateUtils.getNowTime());
|
|
|
bsCovenantBusinessAddBo.setUpdateTime(DateUtils.getNowTime());
|
|
@@ -511,8 +525,9 @@ public class BsCovenantServiceImpl extends ServiceImpl<BsCovenantMapper, BsCoven
|
|
|
if (!bo.getBsCovenantBusinessList().isEmpty()) {
|
|
|
//写入协议业务类型
|
|
|
bo.getBsCovenantBusinessList().forEach(bsCovenantBusinessVo -> {
|
|
|
- CourseBusiness courseBusiness = iCourseBusinessService.getOne(new LambdaQueryWrapper<CourseBusiness>().eq(CourseBusiness::getProjectId, bsCovenantBusinessVo.getProjectId()).eq(CourseBusiness::getStatus, 1));
|
|
|
+ CourseBusiness courseBusiness = iCourseBusinessService.getOne(new LambdaQueryWrapper<CourseBusiness>().eq(CourseBusiness::getId, bsCovenantBusinessVo.getBusinessId()).eq(CourseBusiness::getStatus, 1));
|
|
|
BsCovenantBusinessAddBo covenantBusiness = BeanUtil.toBean(bsCovenantBusinessVo, BsCovenantBusinessAddBo.class);
|
|
|
+ covenantBusiness.setProjectId(Long.valueOf(courseBusiness.getProjectId()));
|
|
|
covenantBusiness.setBusinessId(courseBusiness.getId());
|
|
|
covenantBusiness.setCreateTime(DateUtils.getNowTime());
|
|
|
covenantBusiness.setUpdateTime(DateUtils.getNowTime());
|
|
@@ -535,12 +550,14 @@ public class BsCovenantServiceImpl extends ServiceImpl<BsCovenantMapper, BsCoven
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
+ }else {
|
|
|
+ throw new CustomException("请选择是否复制协议数据");
|
|
|
}
|
|
|
- throw new CustomException("请选择是否复制协议数据");
|
|
|
}
|
|
|
bo.getBsCovenantBusinessList().forEach(bsCovenantBusinessVo -> {
|
|
|
- CourseBusiness courseBusiness = iCourseBusinessService.getOne(new LambdaQueryWrapper<CourseBusiness>().eq(CourseBusiness::getProjectId, bsCovenantBusinessVo.getProjectId()).eq(CourseBusiness::getStatus, 1));
|
|
|
+ CourseBusiness courseBusiness = iCourseBusinessService.getOne(new LambdaQueryWrapper<CourseBusiness>().eq(CourseBusiness::getId, bsCovenantBusinessVo.getBusinessId()).eq(CourseBusiness::getStatus, 1));
|
|
|
BsCovenantBusinessAddBo covenantBusiness = BeanUtil.toBean(bsCovenantBusinessVo, BsCovenantBusinessAddBo.class);
|
|
|
+ covenantBusiness.setProjectId(Long.valueOf(courseBusiness.getProjectId()));
|
|
|
covenantBusiness.setBusinessId(courseBusiness.getId());
|
|
|
covenantBusiness.setCreateTime(DateUtils.getNowTime());
|
|
|
covenantBusiness.setUpdateTime(DateUtils.getNowTime());
|
|
@@ -614,7 +631,7 @@ public class BsCovenantServiceImpl extends ServiceImpl<BsCovenantMapper, BsCoven
|
|
|
}
|
|
|
BsCovenantExportVo bean = BeanUtil.toBean(bsCovenantVo, BsCovenantExportVo.class);
|
|
|
String zhiyuan = System.getProperty("user.dir");
|
|
|
- String toPath = zhiyuan + "/zhongzheng-admin-business/src/main/resources/" + "培训服务协议" + ".pdf";
|
|
|
+ String toPath = zhiyuan + "/zhongzheng-admin-business/src/main/resources/" +DateUtils.getNowTime()+ "培训服务协议" + ".pdf";
|
|
|
String uploadPdf = null;
|
|
|
//生成协议pdf文件
|
|
|
PdfUtils.downloadPdf(bean, toPath, sysTenantAccountVo);
|