|
|
@@ -2,12 +2,15 @@ package com.jzg.organization.service.impl;
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
import cn.hutool.core.convert.Convert;
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.jzg.commons.core.base.BaseController;
|
|
|
import com.jzg.commons.core.page.HttpResult;
|
|
|
import com.jzg.commons.entity.dto.AgreementAddParam;
|
|
|
+import com.jzg.commons.entity.dto.AgreementCopyParam;
|
|
|
import com.jzg.commons.entity.dto.AgreementEditParam;
|
|
|
import com.jzg.commons.entity.dto.AgreementParam;
|
|
|
import com.jzg.commons.entity.enums.YesNoEnum;
|
|
|
@@ -34,6 +37,8 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
import java.time.LocalDateTime;
|
|
|
import java.util.List;
|
|
|
import java.util.Objects;
|
|
|
+import java.util.Set;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* @author dongxin
|
|
|
@@ -63,6 +68,9 @@ public class PtlAgreementServiceImpl extends ServiceImpl<PtlAgreementMapper, Ptl
|
|
|
@Autowired
|
|
|
private PtlAgreementUndwrtRulesService agreementRulesService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private PtlAgreementCostService agreementCostService;
|
|
|
+
|
|
|
@Autowired
|
|
|
private PtlAgreementUndwrtRulesAttrService agreementUndwrtRulesAttrService;
|
|
|
|
|
|
@@ -101,7 +109,8 @@ public class PtlAgreementServiceImpl extends ServiceImpl<PtlAgreementMapper, Ptl
|
|
|
@Override
|
|
|
public AgreementInfoVo queryById(String id) {
|
|
|
AgreementVo agreementVo = this.isExistById(id);
|
|
|
-
|
|
|
+ String fileUrl = MinioUtils.getPresignedObjectUrl(bucketName,agreementVo.getFileName());
|
|
|
+ agreementVo.setFileUrl(fileUrl);
|
|
|
// 获取协议授权
|
|
|
List<PtlAgreementDept> deptList = agreementDeptService.getByAgreementId(id);
|
|
|
AgreementInfoVo agreementInfoVo = new AgreementInfoVo(agreementVo,deptList);
|
|
|
@@ -220,6 +229,21 @@ public class PtlAgreementServiceImpl extends ServiceImpl<PtlAgreementMapper, Ptl
|
|
|
baseMapper.updateById(agreement);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public void agreementCopy(AgreementCopyParam param) {
|
|
|
+ List<String> costIds = param.getCostIds();
|
|
|
+ List<PtlAgreementCost> costList = agreementCostService.listByIds(costIds);
|
|
|
+ if(CollUtil.isEmpty(costList)){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ Set<String> agreementIds = costList.stream().map(PtlAgreementCost::getPtlAgreementId)
|
|
|
+ .collect(Collectors.toSet());
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|