|
@@ -36,6 +36,8 @@ import com.pj.project.tb_business_item.TbBusinessItem;
|
|
|
import com.pj.project.tb_business_item.TbBusinessItemService;
|
|
|
import com.pj.project.tb_business_people.TbBusinessPeople;
|
|
|
import com.pj.project.tb_business_people.TbBusinessPeopleService;
|
|
|
+import com.pj.project.tb_business_sort.TbBusinessSort;
|
|
|
+import com.pj.project.tb_business_sort.TbBusinessSortService;
|
|
|
import com.pj.project.tb_car.TbCar;
|
|
|
import com.pj.project.tb_car.TbCarService;
|
|
|
import com.pj.project.tb_car_no_color.TbCarNoColor;
|
|
@@ -56,6 +58,8 @@ import com.pj.project.tb_notices.TbNoticesMapper;
|
|
|
import com.pj.project.tb_notices.TbNoticesService;
|
|
|
import com.pj.project.tb_pass_record.TbPassRecord;
|
|
|
import com.pj.project.tb_pass_record.TbPassRecordService;
|
|
|
+import com.pj.project.tb_sort_group.TbSortGroup;
|
|
|
+import com.pj.project.tb_sort_group.TbSortGroupService;
|
|
|
import com.pj.project.tb_unit.TbUnit;
|
|
|
import com.pj.project.tb_unit.TbUnitService;
|
|
|
import com.pj.project4sp.admin.SpAdmin;
|
|
@@ -136,6 +140,11 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
|
|
|
@Resource
|
|
|
private SpAdminService spAdminService;
|
|
|
|
|
|
+ @Resource
|
|
|
+ private TbBusinessSortService tbBusinessSortService;
|
|
|
+ @Resource
|
|
|
+ private TbSortGroupService tbSortGroupService;
|
|
|
+
|
|
|
|
|
|
private final List<String> CAR_LIST = StrUtil.splitTrim("浙,粤,京,津,冀,晋,蒙,辽,黑,沪,吉,苏,皖,赣,鲁,豫,鄂,湘,桂,琼,渝,川,贵,云,藏, 陕, 甘, 青, 宁", ",");
|
|
|
|
|
@@ -491,10 +500,12 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
|
|
|
String businessId = car.getBusinessId();
|
|
|
Integer businessType = car.getBusinessType();
|
|
|
result.put("type", businessType);
|
|
|
+ result.put("showPay", true);
|
|
|
List<TbBusinessCar> cars = new ArrayList<>();
|
|
|
List<TbBusinessItem> items = new ArrayList<>();
|
|
|
cars.add(car);
|
|
|
//其他业务
|
|
|
+ String itemTypeId = "";
|
|
|
if (TbBusiness.BusinessType.CAR_DISINCLE.getCode().equals(businessType)) {
|
|
|
List<TbBusiness> businesses = this.findOtherBusinessByCarId(carId);
|
|
|
businesses = businesses.stream()
|
|
@@ -506,6 +517,7 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
|
|
|
.collect(Collectors.toList());
|
|
|
List<String> businessIdList = businesses.stream().map(TbBusiness::getId).collect(Collectors.toList());
|
|
|
if (!businessIdList.isEmpty()) {
|
|
|
+ itemTypeId = businesses.get(0).getItemTypeId();
|
|
|
items = tbBusinessItemService.findByBusinessIdList(businessIdList);
|
|
|
businessId = String.join(",", businessIdList);
|
|
|
}
|
|
@@ -523,7 +535,7 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
|
|
|
Date inTime = tbBusinessCar.getRealInTime();
|
|
|
BigDecimal partMoney = new BigDecimal("0");
|
|
|
String carNo = tbBusinessCar.getCarNo().substring(0, 1);
|
|
|
- if (inTime != null&&tbBusinessCar.getRealOutTime()==null) {
|
|
|
+ if (inTime != null && tbBusinessCar.getRealOutTime() == null) {
|
|
|
if (tbBusinessCar.getPay() == 1 && tbBusinessCar.getPayTime() != null) {
|
|
|
inTime = tbBusinessCar.getPayTime();
|
|
|
}
|
|
@@ -567,6 +579,17 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
|
|
|
}
|
|
|
result.put("itemsPrice", itemsPrice);
|
|
|
result.put("itemList", itemList);
|
|
|
+ if (TbBusiness.BusinessType.CAR_DISINCLE.getCode().equals(businessType) && StrUtil.isNotEmpty(itemTypeId)) {
|
|
|
+ TbBusinessSort tbBusinessSort = tbBusinessSortService.findByItemTypeId(itemTypeId);
|
|
|
+ TbSortGroup sortGroup = tbSortGroupService.getById(tbBusinessSort.getGroupId());
|
|
|
+ if (sortGroup.getCompletePay().equals(1)&&sortGroup.getStatus().equals(1)) {
|
|
|
+ List<TbBusinessSort> sorts = tbBusinessSortService.findByGroupId(sortGroup.getId());
|
|
|
+ if (sorts.size() > items.size()) {
|
|
|
+ result.put("showPay", false);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
return result;
|
|
|
}
|
|
|
|
|
@@ -604,7 +627,7 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
|
|
|
public void deleteOtherBusiness(String id) {
|
|
|
TbBusiness db = super.getById(id);
|
|
|
TbBusinessCar tbBusinessCar = tbBusinessCarService.getById(db.getBusinessCarId());
|
|
|
- if (tbBusinessCar==null||tbBusinessCar.getRealInTime()==null){
|
|
|
+ if (tbBusinessCar == null || tbBusinessCar.getRealInTime() == null) {
|
|
|
List<TbBusiness> businesses = this.findOtherBusinessByCarId(db.getBusinessCarId());
|
|
|
if (businesses.size() == 1) {
|
|
|
tbBusinessCarService.removeById(db.getBusinessCarId());
|