|
|
@ -9,6 +9,8 @@ import com.smart.common.util.ShiroUtils;
|
|
|
|
import com.smart.module.car.entity.CarParkingRecord;
|
|
|
|
import com.smart.module.car.entity.CarParkingRecord;
|
|
|
|
import com.smart.module.car.repository.CarParkingRecordRepository;
|
|
|
|
import com.smart.module.car.repository.CarParkingRecordRepository;
|
|
|
|
import com.smart.module.car.service.CarParkingRecordService;
|
|
|
|
import com.smart.module.car.service.CarParkingRecordService;
|
|
|
|
|
|
|
|
import com.smart.module.finance.entity.Order;
|
|
|
|
|
|
|
|
import com.smart.module.finance.service.OrderService;
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.data.domain.PageRequest;
|
|
|
|
import org.springframework.data.domain.PageRequest;
|
|
|
@ -28,12 +30,29 @@ public class CarParkingRecordServiceImpl implements CarParkingRecordService {
|
|
|
|
private DynamicQuery dynamicQuery;
|
|
|
|
private DynamicQuery dynamicQuery;
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
private CarParkingRecordRepository carParkingRecordRepository;
|
|
|
|
private CarParkingRecordRepository carParkingRecordRepository;
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
|
|
|
private OrderService orderService;
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
@Transactional(rollbackFor=Exception.class)
|
|
|
|
@Transactional(rollbackFor=Exception.class)
|
|
|
|
public Result save(CarParkingRecord entity) {
|
|
|
|
public Result save(CarParkingRecord entity) {
|
|
|
|
|
|
|
|
if(entity.getId()!=null){
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 临时车 生成订单
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
if(entity.getType().shortValue() != SystemConstant.CAR_TYPE_TEMP){
|
|
|
|
|
|
|
|
Order order = new Order();
|
|
|
|
|
|
|
|
order.setOrgId(entity.getOrgId());
|
|
|
|
|
|
|
|
order.setParkManageId(entity.getParkManageId());
|
|
|
|
|
|
|
|
order.setUserCreate(-1L);
|
|
|
|
|
|
|
|
order.setBody("临时车辆");
|
|
|
|
|
|
|
|
order.setStatus(SystemConstant.PAY_STATUS_NO);
|
|
|
|
|
|
|
|
order.setGmtCreate(DateUtils.getTimestamp());
|
|
|
|
|
|
|
|
order.setPlateNumber(entity.getPlateNumber());
|
|
|
|
|
|
|
|
order.setTotalFee(entity.getCost());
|
|
|
|
|
|
|
|
orderService.save(order);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
carParkingRecordRepository.saveAndFlush(entity);
|
|
|
|
carParkingRecordRepository.saveAndFlush(entity);
|
|
|
|
return Result.ok("保存成功");
|
|
|
|
return Result.ok("保存成功");
|
|
|
|
}
|
|
|
|
}
|
|
|
|