|
|
@@ -28,6 +28,7 @@ import com.sckw.order.api.dubbo.TradeOrderInfoService;
|
|
|
import com.sckw.order.api.model.ContractSignCompletedParam;
|
|
|
import com.sckw.product.api.dubbo.GoodsInfoService;
|
|
|
import com.sckw.product.api.model.KwpGoods;
|
|
|
+import com.sckw.system.api.model.dto.res.EntCacheResDto;
|
|
|
import com.sckw.system.api.model.dto.res.SysDictResDto;
|
|
|
import com.sckw.system.api.model.dto.res.UserCacheResDto;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
@@ -40,6 +41,7 @@ import com.sckw.system.api.RemoteSystemService;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
+
|
|
|
import com.sckw.contract.dao.KwcContractTradeMapper;
|
|
|
|
|
|
/**
|
|
|
@@ -87,9 +89,21 @@ public class KwcContractTradeService {
|
|
|
PageHelper.startPage(reqVo.getPage(), reqVo.getPageSize());
|
|
|
QueryListReqDto queryListReqDto = new QueryListReqDto();
|
|
|
BeanUtils.copyProperties(reqVo, queryListReqDto);
|
|
|
+ List<Long> allEnt = new ArrayList<>();
|
|
|
if (Objects.isNull(reqVo.getEntId())) {
|
|
|
queryListReqDto.setEntId(LoginUserHolder.getEntId());
|
|
|
}
|
|
|
+ allEnt.add(queryListReqDto.getEntId());
|
|
|
+
|
|
|
+ EntCacheResDto entCacheResDto = remoteSystemService.queryEntTreeById(queryListReqDto.getEntId());
|
|
|
+ if (Objects.nonNull(entCacheResDto)) {
|
|
|
+ EntCacheResDto entCacheResDto1 = remoteSystemService.queryEntTreeById(entCacheResDto.getId());
|
|
|
+ List<EntCacheResDto> child = entCacheResDto1.getChild();
|
|
|
+ if (CollectionUtils.isNotEmpty(child)) {
|
|
|
+ allEnt.addAll(child.stream().map(EntCacheResDto::getId).toList());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ queryListReqDto.setAllEnt(allEnt);
|
|
|
List<QueryListResDto> queryListResDtos = kwcContractTradeMapper.queryList(queryListReqDto);
|
|
|
if (CollectionUtils.isEmpty(queryListResDtos)) {
|
|
|
return PageHelperUtil.getPageResult(new PageInfo<>());
|
|
|
@@ -415,15 +429,13 @@ public class KwcContractTradeService {
|
|
|
*/
|
|
|
private void sign(ContractTradeReqVo reqVo, Long id) {
|
|
|
if (DictEnum.SIGNING_WAY_1.getValue().equals(String.valueOf(reqVo.getBaseInfo().getSigningWay()))) {
|
|
|
- if (DictEnum.SIGNING_WAY_1.getValue().equals(String.valueOf(reqVo.getBaseInfo().getSigningWay()))) {
|
|
|
- commonBusinessService.postToEsign(reqVo.getBaseInfo().getProvidePhone(),
|
|
|
- reqVo.getBaseInfo().getPurchasePhone(),
|
|
|
- reqVo.getBaseInfo().getProvideEntId(),
|
|
|
- reqVo.getBaseInfo().getPurchaseEntId(),
|
|
|
- reqVo.getContractFile(),
|
|
|
- id,
|
|
|
- reqVo.getBaseInfo().getContractName());
|
|
|
- }
|
|
|
+ commonBusinessService.postToEsign(reqVo.getBaseInfo().getProvidePhone(),
|
|
|
+ reqVo.getBaseInfo().getPurchasePhone(),
|
|
|
+ reqVo.getBaseInfo().getProvideEntId(),
|
|
|
+ reqVo.getBaseInfo().getPurchaseEntId(),
|
|
|
+ reqVo.getContractFile(),
|
|
|
+ id,
|
|
|
+ reqVo.getBaseInfo().getContractName());
|
|
|
}
|
|
|
|
|
|
//线下签约直接通过
|
|
|
@@ -655,9 +667,21 @@ public class KwcContractTradeService {
|
|
|
|
|
|
QueryListReqDto queryListReqDto = new QueryListReqDto();
|
|
|
BeanUtils.copyProperties(reqVo, queryListReqDto);
|
|
|
+ List<Long> allEnt = new ArrayList<>();
|
|
|
if (Objects.isNull(reqVo.getEntId())) {
|
|
|
queryListReqDto.setEntId(LoginUserHolder.getEntId());
|
|
|
}
|
|
|
+ allEnt.add(queryListReqDto.getEntId());
|
|
|
+
|
|
|
+ EntCacheResDto entCacheResDto = remoteSystemService.queryEntTreeById(queryListReqDto.getEntId());
|
|
|
+ if (Objects.nonNull(entCacheResDto)) {
|
|
|
+ EntCacheResDto entCacheResDto1 = remoteSystemService.queryEntTreeById(entCacheResDto.getId());
|
|
|
+ List<EntCacheResDto> child = entCacheResDto1.getChild();
|
|
|
+ if (CollectionUtils.isNotEmpty(child)) {
|
|
|
+ allEnt.addAll(child.stream().map(EntCacheResDto::getId).toList());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ queryListReqDto.setAllEnt(allEnt);
|
|
|
List<QueryListResDto> queryListResDtoList = kwcContractTradeMapper.queryList(queryListReqDto);
|
|
|
if (CollectionUtils.isNotEmpty(queryListResDtoList)) {
|
|
|
Map<Integer, List<QueryListResDto>> collect = queryListResDtoList.stream().collect(Collectors.groupingBy(QueryListResDto::getStatus));
|