| | |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | import com.stylefeng.guns.core.beetl.ShiroExtUtil; |
| | | import com.stylefeng.guns.core.common.constant.factory.PageFactory; |
| | | import com.stylefeng.guns.core.shiro.ShiroKit; |
| | | import com.stylefeng.guns.core.util.DateUtil; |
| | | import com.stylefeng.guns.core.log.LogObjectHolder; |
| | | import com.stylefeng.guns.core.util.SinataUtil; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.system.model.TDriverLine; |
| | | import com.stylefeng.guns.modular.system.model.TLocation; |
| | | import com.stylefeng.guns.modular.system.model.TRegion; |
| | | import com.stylefeng.guns.modular.system.model.TSite; |
| | | import com.stylefeng.guns.modular.system.service.ITLocationService; |
| | | import com.stylefeng.guns.modular.system.service.ITRegionService; |
| | | import com.stylefeng.guns.modular.system.service.ITSiteService; |
| | | import com.stylefeng.guns.modular.system.util.GDMapElectricFenceUtil; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import org.springframework.ui.Model; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import com.stylefeng.guns.core.log.LogObjectHolder; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import com.stylefeng.guns.modular.system.model.TSite; |
| | | import com.stylefeng.guns.modular.system.service.ITSiteService; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | |
| | | |
| | | @Autowired |
| | | private ITSiteService tSiteService; |
| | | |
| | | |
| | | @Autowired |
| | | private ITRegionService tRegionService; |
| | | |
| | | |
| | | @Autowired |
| | | private ITLocationService itLocationService; |
| | | |
| | | |
| | | @Autowired |
| | | private GDMapElectricFenceUtil gdMapElectricFenceUtil; |
| | | |
| | | |
| | | |
| | | @Resource |
| | | private ShiroExtUtil shiroExtUtil; |
| | | |
| | | |
| | | /** |
| | | * 跳转到跨城站点管理首页 |
| | | */ |
| | |
| | | public Object list(String insertTime,String name,String insertUser,String city,Integer state) { |
| | | String beginTime = null; |
| | | String endTime = null; |
| | | if (SinataUtil.isNotEmpty(insertTime)){ |
| | | if (SinataUtil.isNotEmpty(insertTime)) { |
| | | String[] timeArray = insertTime.split(" - "); |
| | | beginTime = timeArray[0]; |
| | | endTime = timeArray[1]; |
| | | } |
| | | Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); |
| | | if (ShiroExtUtil.getUser().getRoleType() != 1) { |
| | | if (shiroExtUtil.getUser().getRoleType() != 1) { |
| | | page.setRecords(null); |
| | | } else { |
| | | page.setRecords(tSiteService.getSiteList(page, beginTime, endTime, name, insertUser, city, state)); |
| | |
| | | @ResponseBody |
| | | public Object add(TSite tSite,@RequestParam String subArr) { |
| | | tSite.setInsertTime(new Date()); |
| | | tSite.setInsertUserId(ShiroExtUtil.getUser().getId()); |
| | | tSite.setInsertUserId(shiroExtUtil.getUser().getId()); |
| | | tSite.setState(1); |
| | | tSiteService.insert(tSite); |
| | | |
| | | |
| | | //添加站点区域 |
| | | addLocation(subArr,tSite.getId()); |
| | | addLocation(subArr, tSite.getId()); |
| | | return ResultUtil.success(); |
| | | } |
| | | |