|
|
@@ -60,6 +60,7 @@ import org.springblade.los.check.entity.LosAuditPathsLevels;
|
|
|
import org.springblade.los.check.service.IAuditPathsActsService;
|
|
|
import org.springblade.los.check.service.IAuditPathsLevelsService;
|
|
|
import org.springblade.los.check.service.IAuditProecessService;
|
|
|
+import org.springblade.los.enums.ReceiptStationEnum;
|
|
|
import org.springblade.los.finance.fee.entity.FeeCenter;
|
|
|
import org.springblade.los.finance.fee.entity.FinAccBills;
|
|
|
import org.springblade.los.finance.fee.service.IFeeCenterService;
|
|
|
@@ -79,6 +80,7 @@ import org.springblade.system.feign.ISysClient;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
|
|
+import org.springframework.util.StringUtils;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
import java.math.MathContext;
|
|
|
@@ -3500,4 +3502,48 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
|
|
|
baseMapper.updateById(bills);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public R<String> getReceiptUrl(Long billId) {
|
|
|
+ Bills bills = baseMapper.selectById(billId);
|
|
|
+ if (org.springframework.util.ObjectUtils.isEmpty(bills)) {
|
|
|
+ return R.fail("单据不存在");
|
|
|
+ }
|
|
|
+ if (!StringUtils.hasText(bills.getMblno())) {
|
|
|
+ return R.fail("提单号不存在, 不允许复制");
|
|
|
+ }
|
|
|
+ BCorps corps = ibCorpsService.getById(bills.getCarrierId());
|
|
|
+ if (org.springframework.util.ObjectUtils.isEmpty(corps)) {
|
|
|
+ return R.fail("船公司不存在");
|
|
|
+ }
|
|
|
+ String returnUrl = "http://www.jms-logistics.com:7805/ep/CtnTicket/JMS/%s/%s?cyCode=";
|
|
|
+ List<String> corpNoList = Arrays.asList("QDCMA", "QDCNC", "QDANL");
|
|
|
+ R<String> successR = R.success("复制成功,内容已复制到剪切板");
|
|
|
+ if (corpNoList.contains(corps.getCode())) {
|
|
|
+ String shipCode = "LIANYUNGANG".equals(bills.getPodEnName()) ? "CMA_LYG" : "CMA_TAO";
|
|
|
+ successR.setData(String.format(returnUrl, shipCode, bills.getMblno()));
|
|
|
+ return successR;
|
|
|
+ }
|
|
|
+ if ("QDHMM".equals(corps.getCode())) {
|
|
|
+ String mblNo = bills.getMblno().startsWith("HDMU") ? bills.getMblno().replace("HDMU", "") : bills.getMblno();
|
|
|
+ successR.setData(String.format(returnUrl, "HMM_TAO", mblNo));
|
|
|
+ return successR;
|
|
|
+ }
|
|
|
+ if ("QDPIL".equals(corps.getCode())) {
|
|
|
+ successR.setData(String.format(returnUrl, "PIL_TAO", bills.getMblno()));
|
|
|
+ return successR;
|
|
|
+ }
|
|
|
+ if ("ONE".equals(corps.getCode())) {
|
|
|
+ if (org.springframework.util.ObjectUtils.isEmpty(bills.getCyId())) {
|
|
|
+ return R.fail("ONE 船公司必须选择场站!");
|
|
|
+ }
|
|
|
+ ReceiptStationEnum receiptEnum = ReceiptStationEnum.getById(bills.getCyId());
|
|
|
+ if (receiptEnum == null) {
|
|
|
+ return R.fail("当前场站不在支持范围内!");
|
|
|
+ }
|
|
|
+ successR.setData(String.format(returnUrl, "ONE_TAO", bills.getMblno()) + receiptEnum.code);
|
|
|
+ return successR;
|
|
|
+ }
|
|
|
+ return R.fail("仅 CMA/NAL/CNC/HMM/ONE/PIL 可以复制背箱小票连接地址!");
|
|
|
+ }
|
|
|
+
|
|
|
}
|