| | |
| | | import com.stylefeng.guns.core.util.SinataUtil; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.ui.Model; |
| | |
| | | beginTime = timeArray[0]; |
| | | endTime = timeArray[1]; |
| | | } |
| | | Integer companyType = null; |
| | | Integer companyId = null; |
| | | if(1 != user.getRoleType()){ |
| | | companyType = user.getRoleType(); |
| | | companyId = user.getObjectId(); |
| | | } |
| | | Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); |
| | | page.setRecords(driverActivityService.getList(page,beginTime,endTime,name,user.getRoleType(),user.getObjectId())); |
| | | page.setRecords(driverActivityService.getList(page,beginTime,endTime,name,companyType,companyId)); |
| | | return super.packForBT(page); |
| | | } |
| | | |
| | |
| | | @RequestMapping(value = "/updateStatus") |
| | | @ResponseBody |
| | | public Object updateStatus(DriverActivity driverActivity) { |
| | | DriverActivity driverActivity1 = driverActivityService.selectById(driverActivity.getId()); |
| | | if(System.currentTimeMillis() >= driverActivity1.getEndTime().getTime()){ |
| | | return ResultUtil.error("活动已结束,修改状态失败"); |
| | | } |
| | | driverActivityService.updateById(driverActivity); |
| | | return SUCCESS_TIP; |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | @RequestMapping("/driverActivity_detail/{driverActivityId}") |