| | |
| | | @RequestMapping(value = "/add") |
| | | @ResponseBody |
| | | public ResultUtil add(TLine tLine,Integer startSiteId,Integer endSiteId,@RequestParam String subArr,@RequestParam String shuArr) { |
| | | |
| | | JSONArray jsonArray1 = JSON.parseArray(shuArr); |
| | | int size1 = jsonArray1.size(); |
| | | for (int i = 0; i < size1; i++) { |
| | | JSONObject jsonObject = jsonArray1.getJSONObject(i); |
| | | String shiftTime = jsonObject.getString("shiftTime"); |
| | | if (SinataUtil.isNotEmpty(shiftTime)){ |
| | | String[] timeArray = shiftTime.split(" - "); |
| | | String startTime = timeArray[0].split(":")[0]; |
| | | String endTime = timeArray[1].split(":")[0]; |
| | | if(Integer.valueOf(startTime) >= Integer.valueOf(endTime)){ |
| | | return ResultUtil.error("班次结束时间不能小于开始时间"); |
| | | } |
| | | } |
| | | } |
| | | String name = tLine.getName(); |
| | | name = name.replaceAll("& lt;", "<"); |
| | | name = name.replaceAll("& gt;", ">"); |
| | |
| | | @RequestMapping(value = "/update") |
| | | @ResponseBody |
| | | public ResultUtil update(TLine tLine,Integer startSiteId,Integer endSiteId,@RequestParam String subArr,@RequestParam String shuArr) { |
| | | JSONArray jsonArray1 = JSON.parseArray(shuArr); |
| | | int size1 = jsonArray1.size(); |
| | | for (int i = 0; i < size1; i++) { |
| | | JSONObject jsonObject = jsonArray1.getJSONObject(i); |
| | | String shiftTime = jsonObject.getString("shiftTime"); |
| | | if (SinataUtil.isNotEmpty(shiftTime)){ |
| | | String[] timeArray = shiftTime.split(" - "); |
| | | String startTime = timeArray[0].split(":")[0]; |
| | | String endTime = timeArray[1].split(":")[0]; |
| | | if(Integer.valueOf(startTime) >= Integer.valueOf(endTime)){ |
| | | return ResultUtil.error("班次结束时间不能小于开始时间"); |
| | | } |
| | | } |
| | | } |
| | | String name = tLine.getName(); |
| | | name = name.replaceAll("& lt;", "<"); |
| | | name = name.replaceAll("& gt;", ">"); |