|
@@ -48,8 +48,9 @@ import com.sckw.system.api.RemoteSystemService;
|
|
|
import com.sckw.system.api.model.dto.res.EntCacheResDto;
|
|
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.SysDictResDto;
|
|
|
import com.sckw.system.api.model.dto.res.UserCacheResDto;
|
|
import com.sckw.system.api.model.dto.res.UserCacheResDto;
|
|
|
|
|
+import com.sckw.transport.common.config.MessageUrlConfig;
|
|
|
|
|
+import com.sckw.transport.common.enums.OrderTypeEnum;
|
|
|
import com.sckw.transport.dao.*;
|
|
import com.sckw.transport.dao.*;
|
|
|
-import com.sckw.transport.enums.OrderTypeEnum;
|
|
|
|
|
import com.sckw.transport.model.*;
|
|
import com.sckw.transport.model.*;
|
|
|
import com.sckw.transport.model.dto.*;
|
|
import com.sckw.transport.model.dto.*;
|
|
|
import com.sckw.transport.model.param.AcceptCarriageOrderQuery;
|
|
import com.sckw.transport.model.param.AcceptCarriageOrderQuery;
|
|
@@ -69,6 +70,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.util.ObjectUtils;
|
|
import org.springframework.util.ObjectUtils;
|
|
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
|
|
|
+import java.math.RoundingMode;
|
|
|
import java.text.DecimalFormat;
|
|
import java.text.DecimalFormat;
|
|
|
import java.text.ParseException;
|
|
import java.text.ParseException;
|
|
|
import java.time.LocalDate;
|
|
import java.time.LocalDate;
|
|
@@ -107,6 +109,12 @@ public class AcceptCarriageOrderService {
|
|
|
@DubboReference(version = "1.0.0", group = "design", check = false, timeout = 6000)
|
|
@DubboReference(version = "1.0.0", group = "design", check = false, timeout = 6000)
|
|
|
PaymentDubboService paymentDubboService;
|
|
PaymentDubboService paymentDubboService;
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ TransportCommonService transportCommonService;
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private MessageUrlConfig messageUrlConfig;
|
|
|
|
|
+
|
|
|
@Autowired
|
|
@Autowired
|
|
|
public CommonService commonService;
|
|
public CommonService commonService;
|
|
|
|
|
|
|
@@ -1466,6 +1474,17 @@ public class AcceptCarriageOrderService {
|
|
|
log.info("承运订单-分包托运-手动完结订单异常,传递信息:{},返回信息:{}", JSONObject.toJSONString(tradeOrder), JSONObject.toJSONString(httpResult));
|
|
log.info("承运订单-分包托运-手动完结订单异常,传递信息:{},返回信息:{}", JSONObject.toJSONString(tradeOrder), JSONObject.toJSONString(httpResult));
|
|
|
throw new BusinessException("单据完结出现错误!" + httpResult.getMsg());
|
|
throw new BusinessException("单据完结出现错误!" + httpResult.getMsg());
|
|
|
}
|
|
}
|
|
|
|
|
+ /**将生成的分配量->贸易订单*/
|
|
|
|
|
+ CreateOrCancelLogisticsOrderParam param = new CreateOrCancelLogisticsOrderParam();
|
|
|
|
|
+ param.setTOrderId(Long.valueOf(logisticsOrder.getTOrderId()));
|
|
|
|
|
+ param.setEntrustAmount(orderFinishDTO.getLoadAmount().subtract(logisticsOrder.getAmount()));
|
|
|
|
|
+ param.setUpdateBy(LoginUserHolder.getUserId());
|
|
|
|
|
+ param.setUpdateByName(LoginUserHolder.getUserName());
|
|
|
|
|
+ HttpResult result1 = tradeOrderInfoService.createOrCancelLogisticsOrder(param);
|
|
|
|
|
+ if (result1.getCode() != HttpStatus.SUCCESS_CODE) {
|
|
|
|
|
+ log.info("{}拒绝接单->贸易订单失败!,返回信息:{}", "id:" + logisticsOrder.getTOrderId() + "orderNo" + logisticsOrder.getTOrderNo(), JSONObject.toJSONString(result1));
|
|
|
|
|
+ throw new BusinessException("{" + logisticsOrder.getTOrderNo() + "} 拒绝接单->贸易订单失败!");
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//修改合同履约量
|
|
//修改合同履约量
|
|
@@ -1504,6 +1523,8 @@ public class AcceptCarriageOrderService {
|
|
|
// }
|
|
// }
|
|
|
// }
|
|
// }
|
|
|
// }
|
|
// }
|
|
|
|
|
+ transportCommonService.closeHandle(logisticsOrder.getId());
|
|
|
|
|
+ waybillOrderService.cancelSendCar(logisticsOrder.getId());
|
|
|
return HttpResult.ok("承运订单-分包托运完结订单成功");
|
|
return HttpResult.ok("承运订单-分包托运完结订单成功");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1733,14 +1754,14 @@ public class AcceptCarriageOrderService {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
if (unitOne != null) {
|
|
if (unitOne != null) {
|
|
|
- orderDetailVO.setConsignCompanyId(unitOne.getId());
|
|
|
|
|
|
|
+ orderDetailVO.setConsignCompanyId(unitOne.getEntId());
|
|
|
orderDetailVO.setConsignCompany(unitOne.getFirmName());
|
|
orderDetailVO.setConsignCompany(unitOne.getFirmName());
|
|
|
orderDetailVO.setConsignContacts(unitOne.getContacts());
|
|
orderDetailVO.setConsignContacts(unitOne.getContacts());
|
|
|
orderDetailVO.setConsignPhone(unitOne.getPhone());
|
|
orderDetailVO.setConsignPhone(unitOne.getPhone());
|
|
|
orderDetailVO.setCollectionCompany(unitOne.getFirmName());
|
|
orderDetailVO.setCollectionCompany(unitOne.getFirmName());
|
|
|
}
|
|
}
|
|
|
if (unitTwo != null) {
|
|
if (unitTwo != null) {
|
|
|
- orderDetailVO.setCarrierCompanyId(unitTwo.getId());
|
|
|
|
|
|
|
+ orderDetailVO.setCarrierCompanyId(unitTwo.getEntId());
|
|
|
orderDetailVO.setCarrierCompany(unitTwo.getFirmName());
|
|
orderDetailVO.setCarrierCompany(unitTwo.getFirmName());
|
|
|
orderDetailVO.setCarrierContacts(unitTwo.getContacts());
|
|
orderDetailVO.setCarrierContacts(unitTwo.getContacts());
|
|
|
orderDetailVO.setCarrierPhone(unitTwo.getPhone());
|
|
orderDetailVO.setCarrierPhone(unitTwo.getPhone());
|
|
@@ -1924,6 +1945,13 @@ public class AcceptCarriageOrderService {
|
|
|
System.out.println("承运订单新建订单-消息列表推送 start");
|
|
System.out.println("承运订单新建订单-消息列表推送 start");
|
|
|
commonService.publicLogisticsConsignmentPushMessage(consignUnit, carriageUnit, lOrderNo, LoginUserHolder.getUserId(), LoginUserHolder.getEntId()
|
|
commonService.publicLogisticsConsignmentPushMessage(consignUnit, carriageUnit, lOrderNo, LoginUserHolder.getUserId(), LoginUserHolder.getEntId()
|
|
|
, MessageEnum.CARRIAGE_NEW_LOGISTICS, MessageEnum.CARRIAGE_NEW_LOGISTICS_ORDER);
|
|
, MessageEnum.CARRIAGE_NEW_LOGISTICS, MessageEnum.CARRIAGE_NEW_LOGISTICS_ORDER);
|
|
|
|
|
+
|
|
|
|
|
+ commonService.pushMessageByUrl(consignUnit, carriageUnit, lOrderNo, LoginUserHolder.getUserId(), LoginUserHolder.getEntId()
|
|
|
|
|
+ , MessageEnum.CARRIAGE_NEW_LOGISTICS, MessageEnum.CARRIAGE_NEW_LOGISTICS_ORDER
|
|
|
|
|
+ , messageUrlConfig.getPc().getConsignLogisticsAddOrderUrl(), messageUrlConfig.getPc().getCarriageLogisticsAddOrderUrl()
|
|
|
|
|
+ , messageUrlConfig.getApp().getConsignLogisticsAddOrderUrl(), messageUrlConfig.getApp().getCarriageLogisticsAddOrderUrl()
|
|
|
|
|
+ );
|
|
|
|
|
+
|
|
|
System.out.println("承运订单新建订单-消息列表推送 end ");
|
|
System.out.println("承运订单新建订单-消息列表推送 end ");
|
|
|
return HttpResult.ok();
|
|
return HttpResult.ok();
|
|
|
}
|
|
}
|
|
@@ -2120,7 +2148,7 @@ public class AcceptCarriageOrderService {
|
|
|
unit.setEntId(Long.parseLong(orderDTO.getAcceptCompanyId()));
|
|
unit.setEntId(Long.parseLong(orderDTO.getAcceptCompanyId()));
|
|
|
EntCacheResDto ent1 = entMap.get(Long.parseLong(orderDTO.getAcceptCompanyId()));
|
|
EntCacheResDto ent1 = entMap.get(Long.parseLong(orderDTO.getAcceptCompanyId()));
|
|
|
if (Objects.isNull(ent1)) {
|
|
if (Objects.isNull(ent1)) {
|
|
|
- throw new BusinessException("企业:" + orderDTO.getConsignCompany() + "的一级企业信息不存在!");
|
|
|
|
|
|
|
+ throw new BusinessException("企业:" + orderDTO.getAcceptCompany() + "的一级企业信息不存在!");
|
|
|
}
|
|
}
|
|
|
unit.setContactsId(Long.parseLong(orderDTO.getAcceptContactsId()));
|
|
unit.setContactsId(Long.parseLong(orderDTO.getAcceptContactsId()));
|
|
|
unit.setTopEntId(ent1.getId());
|
|
unit.setTopEntId(ent1.getId());
|
|
@@ -2751,13 +2779,13 @@ public class AcceptCarriageOrderService {
|
|
|
vo.setLastTotalPrice(lastWeek.getTotalPrice());
|
|
vo.setLastTotalPrice(lastWeek.getTotalPrice());
|
|
|
|
|
|
|
|
/**计算待承运量*/
|
|
/**计算待承运量*/
|
|
|
- computeCompareWaitingAmount(resultVO,currentWeek,lastWeek);
|
|
|
|
|
|
|
+ computeCompareWaitingAmount(resultVO, currentWeek, lastWeek);
|
|
|
|
|
|
|
|
/**承运量*/
|
|
/**承运量*/
|
|
|
- computeCompareAmount(resultVO,currentWeek,lastWeek);
|
|
|
|
|
|
|
+ computeCompareAmount(resultVO, currentWeek, lastWeek);
|
|
|
|
|
|
|
|
/**总金额(费用)*/
|
|
/**总金额(费用)*/
|
|
|
- computeCompareTotalPrice(resultVO,currentWeek,lastWeek);
|
|
|
|
|
|
|
+ computeCompareTotalPrice(resultVO, currentWeek, lastWeek);
|
|
|
|
|
|
|
|
/**待处理的金额*/
|
|
/**待处理的金额*/
|
|
|
SettlementMoney settlementMoney = paymentDubboService.countCarrier(id, dateType);
|
|
SettlementMoney settlementMoney = paymentDubboService.countCarrier(id, dateType);
|
|
@@ -2825,7 +2853,7 @@ public class AcceptCarriageOrderService {
|
|
|
resultVO.setAmountVO(amountVO);
|
|
resultVO.setAmountVO(amountVO);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private void computeCompareWaitingAmount(StatisticsResultVO resultVO,StatisticsByOrderVO currentWeek,StatisticsByOrderVO lastWeek) {
|
|
|
|
|
|
|
+ private void computeCompareWaitingAmount(StatisticsResultVO resultVO, StatisticsByOrderVO currentWeek, StatisticsByOrderVO lastWeek) {
|
|
|
Integer flag = 1;
|
|
Integer flag = 1;
|
|
|
BigDecimal chainRatio = new BigDecimal("0.00");
|
|
BigDecimal chainRatio = new BigDecimal("0.00");
|
|
|
if (currentWeek.getWaitingAmount().compareTo(new BigDecimal("0.00")) == 0
|
|
if (currentWeek.getWaitingAmount().compareTo(new BigDecimal("0.00")) == 0
|
|
@@ -2886,7 +2914,20 @@ public class AcceptCarriageOrderService {
|
|
|
//结束时间
|
|
//结束时间
|
|
|
String dateEnd = cn.hutool.core.date.DateUtil.format(dateTime, DEF_DATE_FORMAT);
|
|
String dateEnd = cn.hutool.core.date.DateUtil.format(dateTime, DEF_DATE_FORMAT);
|
|
|
|
|
|
|
|
- List<LogisticsOrderStatisticsVO> list = logisticsOrderMapper.workbenchLogisticsOrderStatisticsByMonth(id, statusList, OrderTypeEnum.ACCEPT_CARRIAGE_ORDER.getType(), dateStart, dateEnd);
|
|
|
|
|
|
|
+ List<LogisticsOrderStatisticsVO> list = logisticsOrderMapper.workbenchLogisticsOrderStatisticsByMonth(id, statusList,
|
|
|
|
|
+ OrderTypeEnum.ACCEPT_CARRIAGE_ORDER.getType(), dateStart, dateEnd, logisticsOrderStatistics.getTypeOne(), logisticsOrderStatistics.getTypeTwo());
|
|
|
|
|
+ if (logisticsOrderStatistics.getTypeOne().equals("2")){
|
|
|
|
|
+ list.forEach(vo -> {
|
|
|
|
|
+ vo.setTypeTwo(vo.getTypeTwo().setScale(2,RoundingMode.HALF_UP));
|
|
|
|
|
+ vo.setTypeOne(vo.getTypeOne().divide(new BigDecimal("10000")).setScale(2, RoundingMode.HALF_UP));
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ if (logisticsOrderStatistics.getTypeTwo().equals("2")){
|
|
|
|
|
+ list.forEach(vo -> {
|
|
|
|
|
+ vo.setTypeOne(vo.getTypeOne().setScale(2,RoundingMode.HALF_UP));
|
|
|
|
|
+ vo.setTypeTwo(vo.getTypeTwo().divide(new BigDecimal("10000")).setScale(2, RoundingMode.HALF_UP));
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
return HttpResult.ok(list);
|
|
return HttpResult.ok(list);
|
|
|
} else if (String.valueOf(NumberConstant.ONE).equals(logisticsOrderStatistics.getDateType())) {
|
|
} else if (String.valueOf(NumberConstant.ONE).equals(logisticsOrderStatistics.getDateType())) {
|
|
|
//开始时间
|
|
//开始时间
|
|
@@ -2899,7 +2940,20 @@ public class AcceptCarriageOrderService {
|
|
|
}
|
|
}
|
|
|
//结束时间
|
|
//结束时间
|
|
|
String dateEnd = DateUtil.getLastWeekDateEndToString(0);
|
|
String dateEnd = DateUtil.getLastWeekDateEndToString(0);
|
|
|
- List<LogisticsOrderStatisticsVO> list = logisticsOrderMapper.workbenchLogisticsOrderStatisticsByDays(id, statusList, OrderTypeEnum.ACCEPT_CARRIAGE_ORDER.getType(), dateStart, dateEnd);
|
|
|
|
|
|
|
+ List<LogisticsOrderStatisticsVO> list = logisticsOrderMapper.workbenchLogisticsOrderStatisticsByDays(id, statusList,
|
|
|
|
|
+ OrderTypeEnum.ACCEPT_CARRIAGE_ORDER.getType(), dateStart, dateEnd, logisticsOrderStatistics.getTypeOne(), logisticsOrderStatistics.getTypeTwo());
|
|
|
|
|
+ if (logisticsOrderStatistics.getTypeOne().equals("2")){
|
|
|
|
|
+ list.forEach(vo -> {
|
|
|
|
|
+ vo.setTypeTwo(vo.getTypeTwo().setScale(2,RoundingMode.HALF_UP));
|
|
|
|
|
+ vo.setTypeOne(vo.getTypeOne().divide(new BigDecimal("10000")).setScale(2, RoundingMode.HALF_UP));
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ if (logisticsOrderStatistics.getTypeTwo().equals("2")){
|
|
|
|
|
+ list.forEach(vo -> {
|
|
|
|
|
+ vo.setTypeOne(vo.getTypeOne().setScale(2,RoundingMode.HALF_UP));
|
|
|
|
|
+ vo.setTypeTwo(vo.getTypeTwo().divide(new BigDecimal("10000")).setScale(2, RoundingMode.HALF_UP));
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
return HttpResult.ok(list);
|
|
return HttpResult.ok(list);
|
|
|
}
|
|
}
|
|
|
return null;
|
|
return null;
|