|
@@ -127,7 +127,11 @@ public class BsCovenantServiceImpl extends ServiceImpl<BsCovenantMapper, BsCoven
|
|
|
bsCovenantVo.setCheckRecord(covenantCheckRecord.getCheckRecord());
|
|
|
}
|
|
|
bsCovenantVo.setCycleWarning(bo.getCycleWarning());
|
|
|
- bsCovenantVo.setJiaCompanyName(iCompanyService.getById(bsCovenantVo.getCompanyId()).getCompanyName());
|
|
|
+ if(bsCovenantVo.getFormApp()!=3){
|
|
|
+ bsCovenantVo.setJiaCompanyName(iCompanyService.getById(bsCovenantVo.getCompanyId()).getCompanyName());
|
|
|
+ }else{
|
|
|
+ bsCovenantVo.setJiaCompanyName(iCompanyService.getOne(new LambdaQueryWrapper<Company>().eq(Company::getSaleCompanyId, bsCovenantVo.getCompanyId())).getCompanyName());
|
|
|
+ }
|
|
|
BsCovenantBusinessQueryBo bsCovenantBusinessQueryBo = new BsCovenantBusinessQueryBo();
|
|
|
bsCovenantBusinessQueryBo.setCovenantId(bsCovenantVo.getCovenantId());
|
|
|
bsCovenantBusinessQueryBo.setStatus(1);
|
|
@@ -251,6 +255,7 @@ public class BsCovenantServiceImpl extends ServiceImpl<BsCovenantMapper, BsCoven
|
|
|
SysTenant yiSysTenant = iSysTenantService.getOne(new LambdaQueryWrapper<SysTenant>().eq(SysTenant::getTenantId, ServletUtils.getRequest().getHeader("TenantId")));
|
|
|
add.setYiCompanyContract(yiSysTenant.getLinkMan());
|
|
|
add.setYiCompanyPhone(yiSysTenant.getCompanyPh());
|
|
|
+ add.setStatus(1);
|
|
|
int insert = this.baseMapper.insert(add);
|
|
|
BsCovenant newBsCovenant = this.getOne(new LambdaQueryWrapper<BsCovenant>().eq(BsCovenant::getCovenantNum, bo.getCovenantNum()).eq(BsCovenant::getStatus, 1));
|
|
|
//写入协议审核流程
|
|
@@ -295,15 +300,16 @@ public class BsCovenantServiceImpl extends ServiceImpl<BsCovenantMapper, BsCoven
|
|
|
throw new CustomException("当前协议不存在");
|
|
|
}
|
|
|
} else if (bo.getCopyStatus() == 0) {
|
|
|
- if (!bo.getBsCovenantBusinessList().isEmpty()) {
|
|
|
+ if (!bo.getBsCovenantBusinessVos().isEmpty()) {
|
|
|
//写入协议业务类型
|
|
|
- bo.getBsCovenantBusinessList().forEach(bsCovenantBusinessAddBo -> {
|
|
|
+ bo.getBsCovenantBusinessVos().forEach(bsCovenantBusinessAddBo -> {
|
|
|
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());
|
|
|
bsCovenantBusinessAddBo.setUpdateTime(DateUtils.getNowTime());
|
|
|
+ bsCovenantBusinessAddBo.setStatus(1);
|
|
|
iBsCovenantBusinessService.insertByAddBo(bsCovenantBusinessAddBo);
|
|
|
if (!bsCovenantBusinessAddBo.getBsCovenantGoodsVos().isEmpty()) {
|
|
|
BsCovenantBusiness bsCovenantBusiness = iBsCovenantBusinessService.getOne(new LambdaQueryWrapper<BsCovenantBusiness>().eq(BsCovenantBusiness::getBusinessId, bsCovenantBusinessAddBo.getBusinessId())
|
|
@@ -316,6 +322,7 @@ public class BsCovenantServiceImpl extends ServiceImpl<BsCovenantMapper, BsCoven
|
|
|
bsCovenantGoodsAddBo.setCovenantBusinessId(bsCovenantBusiness.getCovenantBusinessId());
|
|
|
bsCovenantGoodsAddBo.setCreateTime(DateUtils.getNowTime());
|
|
|
bsCovenantGoodsAddBo.setUpdateTime(DateUtils.getNowTime());
|
|
|
+ bsCovenantGoodsAddBo.setStatus(1);
|
|
|
iBsCovenantGoodsService.insertByAddBo(bsCovenantGoodsAddBo);
|
|
|
});
|
|
|
}
|
|
@@ -326,25 +333,23 @@ public class BsCovenantServiceImpl extends ServiceImpl<BsCovenantMapper, BsCoven
|
|
|
throw new CustomException("请选择是否复制协议数据");
|
|
|
}
|
|
|
}
|
|
|
- bo.getBsCovenantBusinessList().forEach(bsCovenantBusinessAddBo -> {
|
|
|
+ bo.getBsCovenantBusinessVos().forEach(bsCovenantBusinessAddBo -> {
|
|
|
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());
|
|
|
- iBsCovenantBusinessService.insertByAddBo(bsCovenantBusinessAddBo);
|
|
|
+ bsCovenantBusinessAddBo.setStatus(1);
|
|
|
+ Long covenantBusinessId = iBsCovenantBusinessService.insertByAddBo(bsCovenantBusinessAddBo);
|
|
|
if (!bsCovenantBusinessAddBo.getBsCovenantGoodsVos().isEmpty()) {
|
|
|
- BsCovenantBusiness bsCovenantBusiness = iBsCovenantBusinessService.getOne(new LambdaQueryWrapper<BsCovenantBusiness>().eq(BsCovenantBusiness::getBusinessId, bsCovenantBusinessAddBo.getBusinessId())
|
|
|
- .eq(BsCovenantBusiness::getEducationTypeId, bsCovenantBusinessAddBo.getEducationTypeId())
|
|
|
- .eq(BsCovenantBusiness::getProjectId, bsCovenantBusinessAddBo.getProjectId())
|
|
|
- .eq(BsCovenantBusiness::getStatus, 1));
|
|
|
//写入协议业务类型有关商品
|
|
|
bsCovenantBusinessAddBo.getBsCovenantGoodsVos().forEach(bsCovenantGoodsAddBo -> {
|
|
|
bsCovenantGoodsAddBo.setCovenantId(newBsCovenant.getCovenantId());
|
|
|
- bsCovenantGoodsAddBo.setCovenantBusinessId(bsCovenantBusiness.getCovenantBusinessId());
|
|
|
+ bsCovenantGoodsAddBo.setCovenantBusinessId(covenantBusinessId);
|
|
|
bsCovenantGoodsAddBo.setCreateTime(DateUtils.getNowTime());
|
|
|
bsCovenantGoodsAddBo.setUpdateTime(DateUtils.getNowTime());
|
|
|
+ bsCovenantGoodsAddBo.setStatus(1);
|
|
|
iBsCovenantGoodsService.insertByAddBo(bsCovenantGoodsAddBo);
|
|
|
});
|
|
|
}
|
|
@@ -379,7 +384,7 @@ public class BsCovenantServiceImpl extends ServiceImpl<BsCovenantMapper, BsCoven
|
|
|
throw new CustomException("协议编号重复");
|
|
|
}
|
|
|
BsCovenant add = BeanUtil.toBean(bo, BsCovenant.class);
|
|
|
- if (ObjectUtils.isNotNull(bo.getCompanyId())) {
|
|
|
+ if (ObjectUtils.isNotNull(bo.getCompanyId())&&bo.getFormApp()!=3L) {
|
|
|
Company byId = iCompanyService.getById(bo.getCompanyId());
|
|
|
add.setJiaCompanyAddress(byId.getCompanyAddress());
|
|
|
add.setJiaCompanyContract(byId.getCompanyContacts());
|
|
@@ -392,12 +397,11 @@ public class BsCovenantServiceImpl extends ServiceImpl<BsCovenantMapper, BsCoven
|
|
|
add.setCreateTime(DateUtils.getNowTime());
|
|
|
add.setUpdateTime(DateUtils.getNowTime());
|
|
|
this.baseMapper.insert(add);
|
|
|
- BsCovenant newBsCovenant = this.getOne(new LambdaQueryWrapper<BsCovenant>().eq(BsCovenant::getCovenantNum, bo.getCovenantNum()).eq(BsCovenant::getStatus, 1));
|
|
|
//写入协议审核流程
|
|
|
SysTenant sysTenant = iSysTenantService.getById(ServletUtils.getRequest().getHeader("TenantId"));
|
|
|
if (ObjectUtils.isNotNull(sysTenant)) {
|
|
|
BsCovenantCheckAddBo bsCovenantCheckAddBo = new BsCovenantCheckAddBo();
|
|
|
- bsCovenantCheckAddBo.setCovenantId(newBsCovenant.getCovenantId());
|
|
|
+ bsCovenantCheckAddBo.setCovenantId(add.getCovenantId());
|
|
|
bsCovenantCheckAddBo.setCompanyId(bo.getCompanyId());
|
|
|
if (!sysTenant.getAppList().isEmpty()) {
|
|
|
List<String> list1 = Arrays.asList(sysTenant.getAppList().split(","));
|
|
@@ -435,13 +439,13 @@ public class BsCovenantServiceImpl extends ServiceImpl<BsCovenantMapper, BsCoven
|
|
|
throw new CustomException("当前协议不存在");
|
|
|
}
|
|
|
} else if (bo.getCopyStatus() == 0) {
|
|
|
- if (!bo.getBsCovenantBusinessList().isEmpty()) {
|
|
|
+ if (!bo.getBsCovenantBusinessVos().isEmpty()) {
|
|
|
//写入协议业务类型
|
|
|
- bo.getBsCovenantBusinessList().forEach(bsCovenantBusinessAddBo -> {
|
|
|
+ bo.getBsCovenantBusinessVos().forEach(bsCovenantBusinessAddBo -> {
|
|
|
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.setCovenantId(add.getCovenantId());
|
|
|
bsCovenantBusinessAddBo.setCompanyId(bo.getCompanyId());
|
|
|
bsCovenantBusinessAddBo.setCreateTime(DateUtils.getNowTime());
|
|
|
bsCovenantBusinessAddBo.setUpdateTime(DateUtils.getNowTime());
|
|
@@ -453,7 +457,7 @@ public class BsCovenantServiceImpl extends ServiceImpl<BsCovenantMapper, BsCoven
|
|
|
.eq(BsCovenantBusiness::getStatus, 1));
|
|
|
//写入协议业务类型有关商品
|
|
|
bsCovenantBusinessAddBo.getBsCovenantGoodsVos().forEach(bsCovenantGoodsAddBo -> {
|
|
|
- bsCovenantGoodsAddBo.setCovenantId(newBsCovenant.getCovenantId());
|
|
|
+ bsCovenantGoodsAddBo.setCovenantId(add.getCovenantId());
|
|
|
bsCovenantGoodsAddBo.setCovenantBusinessId(bsCovenantBusiness.getCovenantBusinessId());
|
|
|
bsCovenantGoodsAddBo.setCompanyId(bo.getCompanyId());
|
|
|
bsCovenantGoodsAddBo.setCreateTime(DateUtils.getNowTime());
|
|
@@ -468,26 +472,21 @@ public class BsCovenantServiceImpl extends ServiceImpl<BsCovenantMapper, BsCoven
|
|
|
throw new CustomException("请选择是否复制协议数据");
|
|
|
}
|
|
|
}
|
|
|
- bo.getBsCovenantBusinessList().forEach(bsCovenantBusinessAddBo -> {
|
|
|
+ bo.getBsCovenantBusinessVos().forEach(bsCovenantBusinessAddBo -> {
|
|
|
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.setCovenantId(add.getCovenantId());
|
|
|
bsCovenantBusinessAddBo.setCompanyId(bo.getCompanyId());
|
|
|
bsCovenantBusinessAddBo.setCreateTime(DateUtils.getNowTime());
|
|
|
bsCovenantBusinessAddBo.setUpdateTime(DateUtils.getNowTime());
|
|
|
- iBsCovenantBusinessService.insertByAddBo(bsCovenantBusinessAddBo);
|
|
|
+ Long covenantBusinessId = iBsCovenantBusinessService.insertByAddBo(bsCovenantBusinessAddBo);
|
|
|
if (!bsCovenantBusinessAddBo.getBsCovenantGoodsVos().isEmpty()) {
|
|
|
- BsCovenantBusiness bsCovenantBusiness = iBsCovenantBusinessService.getOne(new LambdaQueryWrapper<BsCovenantBusiness>().eq(BsCovenantBusiness::getBusinessId, bsCovenantBusinessAddBo.getBusinessId())
|
|
|
- .eq(BsCovenantBusiness::getEducationTypeId, bsCovenantBusinessAddBo.getEducationTypeId())
|
|
|
- .eq(BsCovenantBusiness::getProjectId, bsCovenantBusinessAddBo.getProjectId())
|
|
|
- .eq(BsCovenantBusiness::getCovenantId, newBsCovenant.getCovenantId())
|
|
|
- .eq(BsCovenantBusiness::getStatus, 1));
|
|
|
//写入协议业务类型有关商品
|
|
|
bsCovenantBusinessAddBo.getBsCovenantGoodsVos().forEach(bsCovenantGoodsAddBo -> {
|
|
|
- bsCovenantGoodsAddBo.setCovenantId(newBsCovenant.getCovenantId());
|
|
|
+ bsCovenantGoodsAddBo.setCovenantId(add.getCovenantId());
|
|
|
bsCovenantGoodsAddBo.setCompanyId(bo.getCompanyId());
|
|
|
- bsCovenantGoodsAddBo.setCovenantBusinessId(bsCovenantBusiness.getCovenantBusinessId());
|
|
|
+ bsCovenantGoodsAddBo.setCovenantBusinessId(covenantBusinessId);
|
|
|
bsCovenantGoodsAddBo.setCreateTime(DateUtils.getNowTime());
|
|
|
bsCovenantGoodsAddBo.setUpdateTime(DateUtils.getNowTime());
|
|
|
iBsCovenantGoodsService.insertByAddBo(bsCovenantGoodsAddBo);
|
|
@@ -641,8 +640,8 @@ public class BsCovenantServiceImpl extends ServiceImpl<BsCovenantMapper, BsCoven
|
|
|
BsCovenant bean = BeanUtil.toBean(bsCovenantVo, BsCovenant.class);
|
|
|
bean.setUpdateTime(DateUtils.getNowTime());
|
|
|
this.updateById(bean);
|
|
|
- iBsCovenantBusinessService.update(new LambdaUpdateWrapper<BsCovenantBusiness>().set(BsCovenantBusiness::getStatus, 0).eq(BsCovenantBusiness::getCovenantId, covenantId));
|
|
|
- iBsCovenantGoodsService.update(new LambdaUpdateWrapper<BsCovenantGoods>().set(BsCovenantGoods::getStatus, 0).eq(BsCovenantGoods::getCovenantId, covenantId));
|
|
|
+/* iBsCovenantBusinessService.update(new LambdaUpdateWrapper<BsCovenantBusiness>().set(BsCovenantBusiness::getStatus, 0).eq(BsCovenantBusiness::getCovenantId, covenantId));
|
|
|
+ iBsCovenantGoodsService.update(new LambdaUpdateWrapper<BsCovenantGoods>().set(BsCovenantGoods::getStatus, 0).eq(BsCovenantGoods::getCovenantId, covenantId));*/
|
|
|
}
|
|
|
return true;
|
|
|
}
|