|
@@ -27,6 +27,8 @@ import com.pj.project.tb_business_car.TbBusinessCar;
|
|
import com.pj.project.tb_business_car.TbBusinessCarService;
|
|
import com.pj.project.tb_business_car.TbBusinessCarService;
|
|
import com.pj.project.tb_business_item.TbBusinessItem;
|
|
import com.pj.project.tb_business_item.TbBusinessItem;
|
|
import com.pj.project.tb_business_item.TbBusinessItemService;
|
|
import com.pj.project.tb_business_item.TbBusinessItemService;
|
|
|
|
+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.TbCar;
|
|
import com.pj.project.tb_car.TbCarService;
|
|
import com.pj.project.tb_car.TbCarService;
|
|
import com.pj.project.tb_costomer.TbCostomer;
|
|
import com.pj.project.tb_costomer.TbCostomer;
|
|
@@ -109,6 +111,9 @@ public class ApiService {
|
|
@Resource
|
|
@Resource
|
|
private TbItemTypeService tbItemTypeService;
|
|
private TbItemTypeService tbItemTypeService;
|
|
|
|
|
|
|
|
+ @Resource
|
|
|
|
+ private TbBusinessSortService tbBusinessSortService;
|
|
|
|
+
|
|
private final List<String> CAR_LIST = StrUtil.splitTrim("浙,粤,京,津,冀,晋,蒙,辽,黑,沪,吉,苏,皖,赣,鲁,豫,鄂,湘,桂,琼,渝,川,贵,云,藏, 陕, 甘, 青, 宁", ",");
|
|
private final List<String> CAR_LIST = StrUtil.splitTrim("浙,粤,京,津,冀,晋,蒙,辽,黑,沪,吉,苏,皖,赣,鲁,豫,鄂,湘,桂,琼,渝,川,贵,云,藏, 陕, 甘, 青, 宁", ",");
|
|
|
|
|
|
|
|
|
|
@@ -307,6 +312,23 @@ public class ApiService {
|
|
throw new BusinessException("请选择明细");
|
|
throw new BusinessException("请选择明细");
|
|
}
|
|
}
|
|
String carNo = otherBusinessBO.getCarNo().trim().toUpperCase();
|
|
String carNo = otherBusinessBO.getCarNo().trim().toUpperCase();
|
|
|
|
+ SoMap soMap = SoMap.getRequestSoMap();
|
|
|
|
+ List<TbBusinessSort> sorts = tbBusinessSortService.getList(soMap);
|
|
|
|
+ LocalDateTime now = LocalDateTime.now();
|
|
|
|
+ int i = 1;
|
|
|
|
+ for (TbBusinessSort tbBusinessSort : sorts) {
|
|
|
|
+ if (i > 1) {
|
|
|
|
+ TbBusinessSort beforeItem = sorts.get(i - 1);
|
|
|
|
+ String typeId = beforeItem.getTypeId();
|
|
|
|
+ Integer interval = tbBusinessSort.getIntervalTime();
|
|
|
|
+ LocalDateTime endTime = now.minusMinutes(interval);
|
|
|
|
+ int count = tbBusinessCarService.checkCarBusinessType(typeId, carNo, endTime.toString());
|
|
|
|
+ if (count > 0) {
|
|
|
|
+ throw new BusinessException(beforeItem.getTypeName() + "后" + tbBusinessSort.getIntervalTime() + "才可以执行" + tbBusinessSort.getTypeName());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ i++;
|
|
|
|
+ }
|
|
for (TbItem tbItem1 : tbItems) {
|
|
for (TbItem tbItem1 : tbItems) {
|
|
List<TbBusinessCar> tbBusinessCarList = tbBusinessCarService.findTodayRecord(carNo, tbItem1.getId());
|
|
List<TbBusinessCar> tbBusinessCarList = tbBusinessCarService.findTodayRecord(carNo, tbItem1.getId());
|
|
if (!tbBusinessCarList.isEmpty()) {
|
|
if (!tbBusinessCarList.isEmpty()) {
|
|
@@ -329,6 +351,8 @@ public class ApiService {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
TbBusiness tbBusiness = new TbBusiness();
|
|
TbBusiness tbBusiness = new TbBusiness();
|
|
|
|
+ db.setBusinessType(TbBusiness.BusinessType.CAR_DISINCLE.getCode());
|
|
|
|
+ tbBusinessCarService.updateById(db);
|
|
tbBusiness.setBusinessCarId(db.getId()).setPayStep(tbItemType.getPayStep());
|
|
tbBusiness.setBusinessCarId(db.getId()).setPayStep(tbItemType.getPayStep());
|
|
TbCostomer tbCostomer = tbCostomerService.getById(customerId);
|
|
TbCostomer tbCostomer = tbCostomerService.getById(customerId);
|
|
if (tbCostomer != null) {
|
|
if (tbCostomer != null) {
|