|
@@ -95,7 +95,65 @@ public class BsCovenantServiceImpl extends ServiceImpl<BsCovenantMapper, BsCoven
|
|
|
@Override
|
|
|
public BsCovenantVo queryById(Long covenantId) {
|
|
|
BsCovenant db = this.baseMapper.selectById(covenantId);
|
|
|
- return BeanUtil.toBean(db, BsCovenantVo.class);
|
|
|
+ BsCovenantVo bsCovenantVo = BeanUtil.toBean(db, BsCovenantVo.class);
|
|
|
+ SysTenant tenantId = iSysTenantService.getById(ServletUtils.getRequest().getHeader("TenantId"));
|
|
|
+ String deliveryAddress = tenantId.getDeliveryAddress();
|
|
|
+ if (Validator.isNotEmpty(deliveryAddress)) {
|
|
|
+ List<TenantCovenantInfoAddBo> tenantCovenantInfoAddBos = JSONArray.parseArray(deliveryAddress, TenantCovenantInfoAddBo.class);
|
|
|
+ if (!tenantCovenantInfoAddBos.isEmpty()) {
|
|
|
+ TenantCovenantInfoAddBo tenantCovenantInfoAddBo = tenantCovenantInfoAddBos.get(0);
|
|
|
+ bsCovenantVo.setYiCompanyName(tenantId.getTenantName());
|
|
|
+ bsCovenantVo.setYiCompanyAddress(tenantCovenantInfoAddBo.getYiCompanyAddress());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ CovenantCheckRecord covenantCheckRecord = new CovenantCheckRecord();
|
|
|
+ if (bsCovenantVo.getStatus() == 4) {
|
|
|
+ covenantCheckRecord = iCovenantCheckRecordService.getOne(new LambdaQueryWrapper<CovenantCheckRecord>().eq(CovenantCheckRecord::getCovenantId, bsCovenantVo.getCovenantId())
|
|
|
+ .eq(CovenantCheckRecord::getUserId, bsCovenantVo.getUserId()).eq(CovenantCheckRecord::getStatus, 1).eq(CovenantCheckRecord::getCheckStatus, 1));
|
|
|
+ }
|
|
|
+ if (bsCovenantVo.getStopStatus() == 3) {
|
|
|
+ covenantCheckRecord = iCovenantCheckRecordService.getOne(new LambdaQueryWrapper<CovenantCheckRecord>().eq(CovenantCheckRecord::getCovenantId, bsCovenantVo.getCovenantId())
|
|
|
+ .eq(CovenantCheckRecord::getUserId, bsCovenantVo.getUserId()).eq(CovenantCheckRecord::getStatus, 1).eq(CovenantCheckRecord::getCheckStatus, 2));
|
|
|
+ }
|
|
|
+ if (ObjectUtils.isNotNull(covenantCheckRecord)) {
|
|
|
+ bsCovenantVo.setCheckRecord(covenantCheckRecord.getCheckRecord());
|
|
|
+ }
|
|
|
+ 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);
|
|
|
+ List<BsCovenantBusinessVo> bsCovenantBusinessVos = iBsCovenantBusinessService.queryList(bsCovenantBusinessQueryBo);
|
|
|
+ List<BsCovenantBusinessVo> newBusinessVos = new ArrayList<>();
|
|
|
+ bsCovenantBusinessVos.forEach(bsCovenantBusiness -> {
|
|
|
+ bsCovenantBusiness.setBusinessName(iCourseBusinessService.getById(bsCovenantBusiness.getBusinessId()).getBusinessName());
|
|
|
+ bsCovenantBusiness.setEducationTypeName(iCourseEducationTypeService.getById(bsCovenantBusiness.getEducationTypeId()).getEducationName());
|
|
|
+ bsCovenantBusiness.setProjectName(iCourseProjectTypeService.getById(bsCovenantBusiness.getProjectId()).getProjectName());
|
|
|
+ BsCovenantGoodsQueryBo bsCovenantGoodsQueryBo = new BsCovenantGoodsQueryBo();
|
|
|
+ bsCovenantGoodsQueryBo.setCovenantId(bsCovenantBusiness.getCovenantBusinessId());
|
|
|
+ bsCovenantGoodsQueryBo.setCovenantId(bsCovenantVo.getCovenantId());
|
|
|
+ bsCovenantGoodsQueryBo.setStatus(1);
|
|
|
+ List<BsCovenantGoodsVo> bsCovenantGoodsVos = iBsCovenantGoodsService.queryList(bsCovenantGoodsQueryBo);
|
|
|
+ List<BsCovenantGoodsVo> covenantGoodsVos = new ArrayList<>();
|
|
|
+ bsCovenantGoodsVos.forEach(bsCovenantGoodsVo -> {
|
|
|
+ Goods goods = iGoodsService.getById(bsCovenantGoodsVo.getGoodsId());
|
|
|
+ bsCovenantGoodsVo.setGoodsName(goods.getGoodsName());
|
|
|
+ Long majorId = goods.getMajorId();
|
|
|
+ if (ObjectUtils.isNotNull(majorId)) {
|
|
|
+ Major byId = iMajorService.getById(majorId);
|
|
|
+ bsCovenantGoodsVo.setMajorName(byId.getCategoryName());
|
|
|
+ }
|
|
|
+ bsCovenantGoodsVo.setStandPrice(goods.getStandPrice());
|
|
|
+ covenantGoodsVos.add(bsCovenantGoodsVo);
|
|
|
+ });
|
|
|
+ bsCovenantBusiness.setBsCovenantGoodsVos(covenantGoodsVos);
|
|
|
+ newBusinessVos.add(bsCovenantBusiness);
|
|
|
+ });
|
|
|
+ bsCovenantVo.setBsCovenantBusinessVos(newBusinessVos);
|
|
|
+ return bsCovenantVo;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -449,6 +507,7 @@ public class BsCovenantServiceImpl extends ServiceImpl<BsCovenantMapper, BsCoven
|
|
|
bsCovenantBusinessAddBo.setCompanyId(bo.getCompanyId());
|
|
|
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())
|
|
@@ -462,6 +521,7 @@ public class BsCovenantServiceImpl extends ServiceImpl<BsCovenantMapper, BsCoven
|
|
|
bsCovenantGoodsAddBo.setCompanyId(bo.getCompanyId());
|
|
|
bsCovenantGoodsAddBo.setCreateTime(DateUtils.getNowTime());
|
|
|
bsCovenantGoodsAddBo.setUpdateTime(DateUtils.getNowTime());
|
|
|
+ bsCovenantGoodsAddBo.setStatus(1);
|
|
|
iBsCovenantGoodsService.insertByAddBo(bsCovenantGoodsAddBo);
|
|
|
});
|
|
|
}
|
|
@@ -480,6 +540,7 @@ public class BsCovenantServiceImpl extends ServiceImpl<BsCovenantMapper, BsCoven
|
|
|
bsCovenantBusinessAddBo.setCompanyId(bo.getCompanyId());
|
|
|
bsCovenantBusinessAddBo.setCreateTime(DateUtils.getNowTime());
|
|
|
bsCovenantBusinessAddBo.setUpdateTime(DateUtils.getNowTime());
|
|
|
+ bsCovenantBusinessAddBo.setStatus(1);
|
|
|
Long covenantBusinessId = iBsCovenantBusinessService.insertByAddBo(bsCovenantBusinessAddBo);
|
|
|
if (!bsCovenantBusinessAddBo.getBsCovenantGoodsVos().isEmpty()) {
|
|
|
//写入协议业务类型有关商品
|
|
@@ -489,6 +550,7 @@ public class BsCovenantServiceImpl extends ServiceImpl<BsCovenantMapper, BsCoven
|
|
|
bsCovenantGoodsAddBo.setCovenantBusinessId(covenantBusinessId);
|
|
|
bsCovenantGoodsAddBo.setCreateTime(DateUtils.getNowTime());
|
|
|
bsCovenantGoodsAddBo.setUpdateTime(DateUtils.getNowTime());
|
|
|
+ bsCovenantGoodsAddBo.setStatus(1);
|
|
|
iBsCovenantGoodsService.insertByAddBo(bsCovenantGoodsAddBo);
|
|
|
});
|
|
|
}
|