|
@@ -4,17 +4,8 @@ import cn.hutool.core.bean.BeanUtil;
|
|
|
import cn.hutool.core.lang.Validator;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
-import com.aliyuncs.utils.StringUtils;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
|
|
-import com.github.pagehelper.util.StringUtil;
|
|
|
-import com.google.gson.JsonArray;
|
|
|
-import com.google.gson.JsonElement;
|
|
|
-import com.google.gson.JsonParser;
|
|
|
-import com.itextpdf.text.Document;
|
|
|
-import com.itextpdf.text.DocumentException;
|
|
|
-import com.itextpdf.text.pdf.PdfDocument;
|
|
|
-import com.itextpdf.text.pdf.PdfWriter;
|
|
|
import com.zhongzheng.common.core.domain.entity.SysMenu;
|
|
|
import com.zhongzheng.common.core.domain.model.LoginUser;
|
|
|
import com.zhongzheng.common.exception.CustomException;
|
|
@@ -119,6 +110,7 @@ public class BsCovenantServiceImpl extends ServiceImpl<BsCovenantMapper, BsCoven
|
|
|
List<BsCovenantVo> covenantVoArrayList = new ArrayList<>();
|
|
|
if (!bsCovenantVos.isEmpty()) {
|
|
|
bsCovenantVos.forEach(bsCovenantVo -> {
|
|
|
+ bsCovenantVo.setCycleWarning(bo.getCycleWarning());
|
|
|
bsCovenantVo.setJiaCompanyName(iCompanyService.getById(bsCovenantVo.getCompanyId()).getCompanyName());
|
|
|
Company yiCompany = iCompanyService.getById(bsCovenantVo.getYiCompanyId());
|
|
|
if (ObjectUtils.isNotNull(yiCompany)) {
|
|
@@ -128,31 +120,27 @@ public class BsCovenantServiceImpl extends ServiceImpl<BsCovenantMapper, BsCoven
|
|
|
bsCovenantBusinessQueryBo.setCovenantId(bsCovenantVo.getCovenantId());
|
|
|
bsCovenantBusinessQueryBo.setStatus(1);
|
|
|
List<BsCovenantBusinessVo> bsCovenantBusinessVos = iBsCovenantBusinessService.queryList(bsCovenantBusinessQueryBo);
|
|
|
- List<BsCovenantBusinessVo> businessVoArrayList = new ArrayList<>();
|
|
|
+ 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());
|
|
|
- businessVoArrayList.add(bsCovenantBusiness);
|
|
|
- });
|
|
|
- bsCovenantVo.setBsCovenantBusinessVos(businessVoArrayList);
|
|
|
- if (!bsCovenantBusinessVos.isEmpty()) {
|
|
|
- bsCovenantBusinessVos.forEach(bsCovenantBusiness -> {
|
|
|
- BsCovenantGoodsQueryBo bsCovenantGoodsQueryBo = new BsCovenantGoodsQueryBo();
|
|
|
- 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());
|
|
|
- bsCovenantGoodsVo.setMajorName(iMajorService.getById(goods.getMajorId()).getCategoryName());
|
|
|
- bsCovenantGoodsVo.setStandPrice(goods.getStandPrice());
|
|
|
- covenantGoodsVos.add(bsCovenantGoodsVo);
|
|
|
- });
|
|
|
- bsCovenantBusiness.setBsCovenantGoodsVos(covenantGoodsVos);
|
|
|
+ BsCovenantGoodsQueryBo bsCovenantGoodsQueryBo = new BsCovenantGoodsQueryBo();
|
|
|
+ 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());
|
|
|
+ bsCovenantGoodsVo.setMajorName(iMajorService.getById(goods.getMajorId()).getCategoryName());
|
|
|
+ bsCovenantGoodsVo.setStandPrice(goods.getStandPrice());
|
|
|
+ covenantGoodsVos.add(bsCovenantGoodsVo);
|
|
|
});
|
|
|
- }
|
|
|
+ bsCovenantBusiness.setBsCovenantGoodsVos(covenantGoodsVos);
|
|
|
+ newBusinessVos.add(bsCovenantBusiness);
|
|
|
+ });
|
|
|
+ bsCovenantVo.setBsCovenantBusinessVos(newBusinessVos);
|
|
|
covenantVoArrayList.add(bsCovenantVo);
|
|
|
});
|
|
|
}
|
|
@@ -164,6 +152,7 @@ public class BsCovenantServiceImpl extends ServiceImpl<BsCovenantMapper, BsCoven
|
|
|
@Transactional
|
|
|
public Boolean insertByAddBo(BsCovenantAddBo bo) {
|
|
|
BsCovenant add = BeanUtil.toBean(bo, BsCovenant.class);
|
|
|
+ add.setFormApp(2L);
|
|
|
String companyId = ServletUtils.getRequest().getHeader("companyId");
|
|
|
add.setCompanyId(Long.valueOf(companyId));
|
|
|
add.setCreateTime(DateUtils.getNowTime());
|
|
@@ -384,6 +373,7 @@ public class BsCovenantServiceImpl extends ServiceImpl<BsCovenantMapper, BsCoven
|
|
|
BsCovenantBusiness bsCovenantBusiness = iBsCovenantBusinessService.getOne(new LambdaQueryWrapper<BsCovenantBusiness>().eq(BsCovenantBusiness::getBusinessId, covenantBusiness.getBusinessId())
|
|
|
.eq(BsCovenantBusiness::getEducationTypeId, covenantBusiness.getEducationTypeId())
|
|
|
.eq(BsCovenantBusiness::getProjectId, covenantBusiness.getProjectId())
|
|
|
+ .eq(BsCovenantBusiness::getCovenantId,newBsCovenant.getCovenantId())
|
|
|
.eq(BsCovenantBusiness::getStatus, 1));
|
|
|
//写入协议业务类型有关商品
|
|
|
bsCovenantBusinessVo.getBsCovenantGoods().forEach(bsCovenantGoodsVo -> {
|
|
@@ -567,20 +557,20 @@ public class BsCovenantServiceImpl extends ServiceImpl<BsCovenantMapper, BsCoven
|
|
|
String uploadPdf = null;
|
|
|
//生成协议pdf文件
|
|
|
PdfUtils.downloadPdf(bean, toPath, sysTenantAccountVo);
|
|
|
-// //上传oss
|
|
|
-// OssRequest ossRequest = new OssRequest();
|
|
|
-// ossRequest.setGradeId(0L);
|
|
|
-// ossRequest.setUserId(0L);
|
|
|
-// ossRequest.setImageStatus(12);
|
|
|
-// File file = new File(toPath);
|
|
|
-// ossRequest.setFile(FileUtils.getMultipartFile(file));
|
|
|
-// try {
|
|
|
-// uploadPdf = ossService.upload(ossRequest);
|
|
|
-// } catch (Exception e) {
|
|
|
-// throw new RuntimeException(e);
|
|
|
-// }
|
|
|
-// //删除本地文件
|
|
|
-// FileUtils.deleteFilePackage(toPath);
|
|
|
+ //上传oss
|
|
|
+ OssRequest ossRequest = new OssRequest();
|
|
|
+ ossRequest.setGradeId(0L);
|
|
|
+ ossRequest.setUserId(0L);
|
|
|
+ ossRequest.setImageStatus(12);
|
|
|
+ File file = new File(toPath);
|
|
|
+ ossRequest.setFile(FileUtils.getMultipartFile(file));
|
|
|
+ try {
|
|
|
+ uploadPdf = ossService.upload(ossRequest);
|
|
|
+ } catch (Exception e) {
|
|
|
+ throw new RuntimeException(e);
|
|
|
+ }
|
|
|
+ //删除本地文件
|
|
|
+ FileUtils.deleteFilePackage(toPath);
|
|
|
return uploadPdf;
|
|
|
}
|
|
|
|
|
@@ -652,7 +642,6 @@ public class BsCovenantServiceImpl extends ServiceImpl<BsCovenantMapper, BsCoven
|
|
|
covenantCheckRecord.setCreateTime(DateUtils.getNowTime());
|
|
|
covenantCheckRecord.setUpdateTime(DateUtils.getNowTime());
|
|
|
iCovenantCheckRecordService.insertByAddBo(covenantCheckRecord);
|
|
|
-
|
|
|
}
|
|
|
BsCovenant bean = BeanUtil.toBean(bsCovenantVo, BsCovenant.class);
|
|
|
bean.setStatus(noCheckInfo.getStatus());
|
|
@@ -672,7 +661,7 @@ public class BsCovenantServiceImpl extends ServiceImpl<BsCovenantMapper, BsCoven
|
|
|
if (ObjectUtils.isNull(bsCovenantVo)) {
|
|
|
throw new CustomException("当前协议不存在");
|
|
|
}
|
|
|
- if (bsCovenantVo.getStatus() != 1) {
|
|
|
+ if (bsCovenantVo.getStopStatus() != 1) {
|
|
|
throw new CustomException("当前协议未处于终止待审核状态");
|
|
|
}
|
|
|
if (noCheckInfo.getStatus()==3){
|
|
@@ -694,14 +683,20 @@ public class BsCovenantServiceImpl extends ServiceImpl<BsCovenantMapper, BsCoven
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public boolean uploadImg(Long covenantId, String path) {
|
|
|
+ public boolean uploadImg(Long covenantId, List<String> paths) {
|
|
|
BsCovenantVo bsCovenantVo = this.queryById(covenantId);
|
|
|
if (ObjectUtils.isNull(bsCovenantVo)) {
|
|
|
throw new CustomException("当前协议不存在");
|
|
|
}
|
|
|
+ if (bsCovenantVo.getStatus()!=2){
|
|
|
+ throw new CustomException("当前协议未审核通过");
|
|
|
+ }
|
|
|
+ if(ObjectUtils.isNull(paths)){
|
|
|
+ throw new CustomException("为上传协议");
|
|
|
+ }
|
|
|
BsCovenant bsCovenant = BeanUtil.toBean(bsCovenantVo, BsCovenant.class);
|
|
|
bsCovenant.setUploadStatus(1);
|
|
|
- bsCovenant.setCovenantImg(path);
|
|
|
+ bsCovenant.setCovenantImg(paths.toString());
|
|
|
bsCovenant.setUpdateTime(DateUtils.getNowTime());
|
|
|
return updateById(bsCovenant);
|
|
|
}
|
|
@@ -712,9 +707,13 @@ public class BsCovenantServiceImpl extends ServiceImpl<BsCovenantMapper, BsCoven
|
|
|
if (ObjectUtils.isNull(bsCovenantVo)) {
|
|
|
throw new CustomException("当前协议不存在");
|
|
|
}
|
|
|
+ if (bsCovenantVo.getUploadStatus()!=1){
|
|
|
+ throw new CustomException("当前协议未上传");
|
|
|
+ }
|
|
|
BsCovenant bean = BeanUtil.toBean(bsCovenantVo, BsCovenant.class);
|
|
|
bean.setUploadStatus(2);
|
|
|
- bean.setStatus(4);
|
|
|
+ bean.setStatus(5);
|
|
|
+ bean.setUpdateTime(DateUtils.getNowTime());
|
|
|
return this.updateById(bean);
|
|
|
}
|
|
|
|
|
@@ -725,7 +724,7 @@ public class BsCovenantServiceImpl extends ServiceImpl<BsCovenantMapper, BsCoven
|
|
|
|
|
|
@Override
|
|
|
public Integer countStopNoCheckNum() {
|
|
|
- return this.baseMapper.selectCount(new LambdaQueryWrapper<BsCovenant>().eq(BsCovenant::getStopStatus, 1));
|
|
|
+ return this.baseMapper.selectCount(new LambdaQueryWrapper<BsCovenant>().eq(BsCovenant::getStopStatus, 1).eq(BsCovenant::getStatus,5));
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -744,6 +743,5 @@ public class BsCovenantServiceImpl extends ServiceImpl<BsCovenantMapper, BsCoven
|
|
|
CovenantCheckRecordQueryBo covenantCheckRecordQueryBo = new CovenantCheckRecordQueryBo();
|
|
|
covenantCheckRecordQueryBo.setCovenantId(covenantId);
|
|
|
return iCovenantCheckRecordService.queryList(covenantCheckRecordQueryBo);
|
|
|
-
|
|
|
}
|
|
|
}
|