Pu Zhibing
3 天以前 5dacdee9b54c78372b68140e2b068d03a620eab9
ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/CarRentalServiceImpl.java
@@ -3,7 +3,6 @@
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.stylefeng.guns.core.beetl.ShiroExtUtil;
import com.stylefeng.guns.core.shiro.ShiroKit;
import com.stylefeng.guns.core.util.ToolUtil;
import com.stylefeng.guns.modular.system.dao.CarRentalMapper;
import com.stylefeng.guns.modular.system.model.*;
@@ -12,6 +11,7 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
@@ -32,11 +32,13 @@
    @Autowired
    private ITSystemNoticeService systemNoticeService;
   @Resource
   private ShiroExtUtil shiroExtUtil;
    @Override
    public Map<String, Object> list(String createTime, String title, Integer brandId, String insertUser, List<Integer> status, Integer userType, Integer offset, Integer limit) throws Exception {
        Integer companyId = ShiroExtUtil.getUser().getRoleType() == 1 ? null : ShiroExtUtil.getUser().getObjectId();
      Integer companyId = shiroExtUtil.getUser().getRoleType() == 1 ? null : shiroExtUtil.getUser().getObjectId();
        String start = "";
        String end = "";
        if(ToolUtil.isNotEmpty(createTime)){
@@ -55,7 +57,7 @@
    @Override
    public ResultUtil addCarRental(CarRental carRental) throws Exception {
        carRental.setUserType(3);
        carRental.setUserId(ShiroExtUtil.getUser().getObjectId());
       carRental.setUserId(shiroExtUtil.getUser().getObjectId());
        TCarBrand tCarBrand = carBrandService.selectById(carRental.getBrandId());
        carRental.setBrandName(tCarBrand.getName());
        TRegion region = regionService.selectOne(new EntityWrapper<TRegion>().eq("code", carRental.getProvinceCode()));
@@ -64,8 +66,8 @@
        carRental.setCityName(region.getName());
        carRental.setCreateTime(new Date());
        carRental.setFirstPageShow(2);
        carRental.setInsertUser(ShiroExtUtil.getUser().getId());
        if (ShiroExtUtil.getUser().getRoleType() == 1 && carRental.getStatus() == 1) {
       carRental.setInsertUser(shiroExtUtil.getUser().getId());
       if (shiroExtUtil.getUser().getRoleType() == 1 && carRental.getStatus() == 1) {
            carRental.setStatus(4);
        }
        this.insert(carRental);