| | |
| | | private ITSiteService itSiteService; |
| | | |
| | | @Autowired |
| | | private ITServerCarmodelService itServerCarmodelService; |
| | | |
| | | @Autowired |
| | | private ITLineSiteService itLineSiteService; |
| | | |
| | | @Autowired |
| | | private ITLinePriceService itLinePriceService; |
| | | |
| | | @Autowired |
| | | private ITLineShiftService itLineShiftService; |
| | | |
| | |
| | | List<TSite> siteList = itSiteService.selectList(new EntityWrapper<TSite>().eq("state", 1) |
| | | .eq(null != companyId, "companyId", companyId)); |
| | | model.addAttribute("siteList",siteList); |
| | | //跨城车型 |
| | | List<TServerCarmodel> carmodelList = itServerCarmodelService.selectList(new EntityWrapper<TServerCarmodel>().eq("type", 2).eq("state", 1)); |
| | | model.addAttribute("carmodelList",carmodelList); |
| | | return PREFIX + "tLine_add.html"; |
| | | } |
| | | |
| | |
| | | List<TSite> siteList = itSiteService.selectList(new EntityWrapper<TSite>().eq("state", 1) |
| | | .eq(null != companyId, "companyId", companyId)); |
| | | model.addAttribute("siteList",siteList); |
| | | //跨城车型 |
| | | List<TServerCarmodel> carmodelList = itServerCarmodelService.selectList(new EntityWrapper<TServerCarmodel>().eq("type", 2).eq("state", 1)); |
| | | model.addAttribute("carmodelList",carmodelList); |
| | | //查询所有站点 |
| | | List<Map<String, Object>> linePriceList = tLineService.getLinePriceList(tLineId); |
| | | model.addAttribute("linePriceList",linePriceList); |
| | | //查询所有班次 |
| | | List<TLineShift> lineShiftList = itLineShiftService.selectList(new EntityWrapper<TLineShift>().eq("lineId", tLineId).last(" and not FIND_IN_SET(state,'3')")); |
| | | model.addAttribute("lineShiftList",lineShiftList); |
| | |
| | | */ |
| | | @RequestMapping(value = "/list") |
| | | @ResponseBody |
| | | public Object list(String insertTime,String name,String insertUser,String modelStr,Integer state) { |
| | | public Object list(String insertTime,String name,String insertUser,Integer state) { |
| | | String beginTime = null; |
| | | String endTime = null; |
| | | if (SinataUtil.isNotEmpty(insertTime)) { |
| | |
| | | if(ShiroKit.getUser().getRoleType() != 1){ |
| | | companyId = ShiroKit.getUser().getObjectId(); |
| | | } |
| | | page.setRecords(tLineService.getLineList(page, beginTime, endTime, name, insertUser, modelStr, state, companyId)); |
| | | page.setRecords(tLineService.getLineList(page, beginTime, endTime, name, insertUser, state, companyId)); |
| | | return super.packForBT(page); |
| | | } |
| | | |
| | |
| | | */ |
| | | @RequestMapping(value = "/add") |
| | | @ResponseBody |
| | | public ResultUtil add(TLine tLine,Integer startSiteId,Integer endSiteId,@RequestParam String subArr, |
| | | public ResultUtil add(TLine tLine,Integer startSiteId,Integer endSiteId,@RequestParam(required = false) String subArr, |
| | | @RequestParam String shuArr, @RequestParam(required = false) String destArr) { |
| | | if (!hasCommissionSetting(tLine.getOutSetting())) { |
| | | return ResultUtil.error("请设置司机抽成"); |
| | |
| | | end.setSiteId(endSiteId); |
| | | end.setType(2); |
| | | itLineSiteService.insert(end); |
| | | |
| | | //添加价格设置 |
| | | addPrice(tLine.getId(), subArr); |
| | | |
| | | //添加班次设置 |
| | | ResultUtil shiftResult = addShift(tLine.getId(), shuArr); |
| | |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 添加线路价格 |
| | | * @param lineId |
| | | * @param subArr |
| | | */ |
| | | private void addPrice(Integer lineId, @RequestParam String subArr) { |
| | | JSONArray jsonArray = JSON.parseArray(subArr); |
| | | int size = jsonArray.size(); |
| | | for (int i = 0; i < size; i++) { |
| | | JSONObject jsonObject = jsonArray.getJSONObject(i); |
| | | TLinePrice price = new TLinePrice(); |
| | | price.setLineId(lineId); |
| | | price.setServerCarModelId(jsonObject.getInteger("serverModelId")); |
| | | price.setType(jsonObject.getInteger("type")); |
| | | price.setContent(jsonObject.getString("content")); |
| | | price.setContentStr(jsonObject.getString("contentStr")); |
| | | price.setState(1); |
| | | price.setInsertTime(new Date()); |
| | | price.setAddTime(jsonObject.getString("time")); |
| | | itLinePriceService.insert(price); |
| | | } |
| | | } |
| | | |
| | |
| | | */ |
| | | @RequestMapping(value = "/update") |
| | | @ResponseBody |
| | | public ResultUtil update(TLine tLine,Integer startSiteId,Integer endSiteId,@RequestParam String subArr, |
| | | public ResultUtil update(TLine tLine,Integer startSiteId,Integer endSiteId,@RequestParam(required = false) String subArr, |
| | | @RequestParam String shuArr, @RequestParam(required = false) String destArr) { |
| | | if (!hasCommissionSetting(tLine.getOutSetting())) { |
| | | return ResultUtil.error("请设置司机抽成"); |
| | |
| | | itLineSiteService.insert(end); |
| | | } |
| | | |
| | | //删除线路价格 |
| | | itLinePriceService.delete(new EntityWrapper<TLinePrice>().eq("lineId",tLine.getId())); |
| | | //添加价格设置 |
| | | addPrice(tLine.getId(), subArr); |
| | | //删除线路班次 |
| | | itLineShiftService.delete(new EntityWrapper<TLineShift>().eq("lineId",tLine.getId())); |
| | | //添加班次设置 |