|
@@ -122,12 +122,12 @@ public class TbFeeDetailsService extends ServiceImpl<TbFeeDetailsMapper, TbFeeDe
|
|
|
return getOne(qw);
|
|
|
}
|
|
|
|
|
|
- public TbFeeDetails getByBusinessCarIdAndCarNoAndFeeType(String businessCarId, String carNo, Integer feeType){
|
|
|
+ public List<TbFeeDetails> getByBusinessCarIdAndCarNoAndFeeType(String businessCarId, String carNo, Integer feeType){
|
|
|
QueryWrapper<TbFeeDetails> qw = new QueryWrapper<>();
|
|
|
qw.eq("business_car_id", businessCarId);
|
|
|
qw.eq("car_no", carNo);
|
|
|
qw.eq("fee_type", feeType);
|
|
|
- return getOne(qw);
|
|
|
+ return list(qw);
|
|
|
}
|
|
|
|
|
|
|
|
@@ -142,21 +142,21 @@ public class TbFeeDetailsService extends ServiceImpl<TbFeeDetailsMapper, TbFeeDe
|
|
|
TbBusinessCar car = tbBusinessCarService.getById(bo1.getId());
|
|
|
TbBusiness business = tbBusinessService.getById(car.getBusinessId());
|
|
|
String carNo = car.getCarNo();
|
|
|
- TbFeeDetails parkFee;
|
|
|
- if(business != null){
|
|
|
- parkFee = getByBusinessIdAndCarNoAndFeeType(car.getBusinessId(), carNo, TbFeeDetails.fee.PARK_FEE.getCode());
|
|
|
- } else {
|
|
|
- parkFee = getByBusinessCarIdAndCarNoAndFeeType(car.getId(), carNo, TbFeeDetails.fee.PARK_FEE.getCode());
|
|
|
- }
|
|
|
+ TbFeeDetails parkFee = null;
|
|
|
+// if(business != null){
|
|
|
+// parkFee = getByBusinessIdAndCarNoAndFeeType(car.getBusinessId(), carNo, TbFeeDetails.fee.PARK_FEE.getCode());
|
|
|
+// } else {
|
|
|
+// parkFee = getByBusinessCarIdAndCarNoAndFeeType(car.getId(), carNo, TbFeeDetails.fee.PARK_FEE.getCode());
|
|
|
+// }
|
|
|
if(parkFee == null){
|
|
|
parkFee = new TbFeeDetails();
|
|
|
parkFee.setTaxRate(partConfig.getTaxRate());
|
|
|
}
|
|
|
- BigDecimal taxPrice = car.getMoney().divide(BigDecimal.valueOf(1).add(parkFee.getTaxRate()),2, BigDecimal.ROUND_HALF_UP).multiply(parkFee.getTaxRate());
|
|
|
- BigDecimal noTaxPrice = car.getMoney().subtract(taxPrice);
|
|
|
+ BigDecimal taxPrice = bo1.getP().divide(BigDecimal.valueOf(1).add(parkFee.getTaxRate()),2, BigDecimal.ROUND_HALF_UP).multiply(parkFee.getTaxRate());
|
|
|
+ BigDecimal noTaxPrice = bo1.getP().subtract(taxPrice);
|
|
|
parkFee.setBusinessId(car.getBusinessId()).setBusinessCarId(car.getId())
|
|
|
.setCarNo(car.getCarNo())
|
|
|
- .setItemPrice(car.getMoney()).setUnitPrice(car.getMoney()).setNoTaxPrice(noTaxPrice).setTaxPrice(taxPrice)
|
|
|
+ .setItemPrice(bo1.getP()).setUnitPrice(car.getMoney()).setNoTaxPrice(noTaxPrice).setTaxPrice(taxPrice)
|
|
|
.setFeeType(TbFeeDetails.fee.PARK_FEE.getCode()).setItemTypeName("停车业务")
|
|
|
.setPayDay(toDay).setPayType(3).setCreateTime(now)
|
|
|
.setNum(1).setIsSettle(1).setPayMode(1).setPayTime(nowStr)
|
|
@@ -169,56 +169,7 @@ public class TbFeeDetailsService extends ServiceImpl<TbFeeDetailsMapper, TbFeeDe
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- //@Async
|
|
|
- public void chargeBusinessFee(List<TbBusinessItem> items) {
|
|
|
- Date now = new Date();
|
|
|
- String nowStr = DateUtil.format(now, "yyyy-MM-dd HH:mm:ss");
|
|
|
- String toDay = DateUtil.format(now, "yyyy-MM-dd");
|
|
|
- for (TbBusinessItem item : items) {
|
|
|
- int feeType = -1;
|
|
|
- String itemType = item.getItemTypeName();
|
|
|
- if (itemType.contains("核酸")) {
|
|
|
- feeType = TbFeeDetails.fee.NUCLEIC_FEE.getCode();
|
|
|
- } else if (itemType.contains("消毒") || itemType.contains("消杀")) {
|
|
|
- feeType = TbFeeDetails.fee.DISINFECT_FEE.getCode();
|
|
|
- } else if (itemType.contains("装卸")) {
|
|
|
- feeType = TbFeeDetails.fee.STEVEDORE_FEE.getCode();
|
|
|
- } else if (StrUtil.equals(itemType, "特殊车辆") || StrUtil.equals(itemType, "汽车吊")) {
|
|
|
- feeType = TbFeeDetails.fee.STEVEDORE_FEE.getCode();
|
|
|
- } else if (itemType.contains("入场管理")) {
|
|
|
- feeType = TbFeeDetails.fee.MANAGE_FEE.getCode();
|
|
|
- } else if (StrUtil.equals(itemType, "充电打冷")) {
|
|
|
- feeType = TbFeeDetails.fee.CHARGE_FEE.getCode();
|
|
|
- }
|
|
|
- TbBusiness business = tbBusinessService.getById(item.getBusinessId());
|
|
|
- TbFeeDetails businessFeeDetail = this.getByBusinessIdAndCarNoAndItemType(item.getBusinessId(), business.getCardNo(), item.getItemTypeId());
|
|
|
- if (businessFeeDetail == null) {
|
|
|
- businessFeeDetail = new TbFeeDetails();
|
|
|
- businessFeeDetail.setTaxRate(BigDecimal.valueOf(TbFeeStatistics.taxRate.BUSINESS.getValue()));
|
|
|
- }
|
|
|
- BigDecimal taxPrice = item.getItemPrice()
|
|
|
- .divide(BigDecimal.valueOf(1).add(businessFeeDetail.getTaxRate()),2, BigDecimal.ROUND_HALF_UP)
|
|
|
- .multiply(businessFeeDetail.getTaxRate());
|
|
|
- BigDecimal noTaxPrice = item.getItemPrice().subtract(taxPrice);
|
|
|
|
|
|
- String carNo = business.getCardNo();
|
|
|
- if(StrUtil.isEmpty(business.getCardNo())){
|
|
|
- carNo = business.getChinaCarNo();
|
|
|
- }
|
|
|
- businessFeeDetail.setBusinessId(item.getBusinessId()).setBusinessNo(business.getNo())
|
|
|
- .setBusinessItemNo(item.getNo())
|
|
|
- .setCarNo(carNo)
|
|
|
- .setItemPrice(item.getItemPrice()).setUnitPrice(item.getItemPrice()).setNoTaxPrice(noTaxPrice).setTaxPrice(taxPrice)
|
|
|
- .setFeeType(feeType)
|
|
|
- .setItemTypeId(item.getItemTypeId()).setItemTypeName(item.getItemTypeName())
|
|
|
- .setItemId(item.getItemId()).setItemName(item.getItemName())
|
|
|
- .setPayDay(toDay).setPayType(3).setCreateTime(now)
|
|
|
- .setBusinessItemId(item.getId() + "")
|
|
|
- .setPickCustomerName(item.getPickCustomerName())
|
|
|
- .setNum(1).setIsSettle(1).setPayMode(1).setPayTime(nowStr).setWeight(business.getNetWeight());
|
|
|
- this.saveOrUpdate(businessFeeDetail);
|
|
|
- }
|
|
|
- }
|
|
|
|
|
|
public String export(SoMap so) throws Exception{
|
|
|
Date now = new Date();
|