|
|
@@ -1,12 +1,21 @@
|
|
|
package com.sckw.contract.service;
|
|
|
|
|
|
+import com.sckw.contract.dao.KwcContractLogisticsMapper;
|
|
|
+import com.sckw.contract.dao.KwcContractTradeMapper;
|
|
|
+import com.sckw.contract.model.entity.KwcContractLogistics;
|
|
|
+import com.sckw.contract.model.entity.KwcContractTrade;
|
|
|
+import com.sckw.contract.model.vo.req.ESignCallBackReqVo;
|
|
|
+import com.sckw.core.exception.SystemException;
|
|
|
+import com.sckw.core.web.constant.HttpStatus;
|
|
|
import com.sckw.system.api.RemoteSystemService;
|
|
|
import com.sckw.system.api.model.dto.res.EntCacheResDto;
|
|
|
import org.apache.dubbo.config.annotation.DubboReference;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
+import java.util.Objects;
|
|
|
|
|
|
@Service
|
|
|
public class CommonBusinessService {
|
|
|
@@ -14,6 +23,18 @@ public class CommonBusinessService {
|
|
|
@DubboReference(version = "2.0.0", group = "design", check = false)
|
|
|
private RemoteSystemService remoteSystemService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private KwcContractTradeMapper kwcContractTradeMapper;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private KwcContractLogisticsMapper kwcContractLogisticsMapper;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private KwcContractLogisticsService kwcContractLogisticsService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private KwcContractTradeService kwcContractTradeService;
|
|
|
+
|
|
|
/**
|
|
|
* @return Map
|
|
|
* @desc: 查企业
|
|
|
@@ -24,4 +45,27 @@ public class CommonBusinessService {
|
|
|
public Map<Long, EntCacheResDto> queryEntCacheMapByIds(List<Long> entIdList) {
|
|
|
return remoteSystemService.queryEntCacheMapByIds(entIdList);
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param reqVo e签宝回调参数
|
|
|
+ * @desc: 审批
|
|
|
+ * @author: czh
|
|
|
+ * @date: 2023/8/14
|
|
|
+ */
|
|
|
+ public void approval(ESignCallBackReqVo reqVo) {
|
|
|
+ Long contractId = reqVo.getContractId();
|
|
|
+ KwcContractTrade kwcContractTrade = kwcContractTradeMapper.selectById(contractId);
|
|
|
+ if (Objects.nonNull(kwcContractTrade)) {
|
|
|
+ kwcContractTradeService.approval(reqVo.getContractId(), reqVo.getStatus(), reqVo.getRemark());
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ KwcContractLogistics kwcContractLogistics = kwcContractLogisticsMapper.selectById(contractId);
|
|
|
+ if (Objects.nonNull(kwcContractLogistics)) {
|
|
|
+ kwcContractLogisticsService.approval(reqVo.getContractId(), reqVo.getStatus(), reqVo.getRemark());
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ throw new SystemException(HttpStatus.QUERY_FAIL_CODE, HttpStatus.CONTRACT_NOT_EXISTS);
|
|
|
+ }
|
|
|
}
|