| | |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import com.hxzkoa.json.tb_achor; |
| | | import com.hxzkoa.json.tb_adress_and_port; |
| | | import com.hxzkoa.json.tb_department; |
| | | import com.hxzkoa.json.tb_fence; |
| | | import com.hxzkoa.json.tb_history_power; |
| | | import com.hxzkoa.json.tb_map; |
| | | import com.hxzkoa.json.tb_person; |
| | | import com.hxzkoa.json.tb_tag; |
| | | import com.hxzkoa.json.tb_tagpower; |
| | |
| | | import com.hxzkoa.json.vo_tp_t_p; |
| | | import com.hxzkoa.services.AnchorService; |
| | | import com.hxzkoa.services.BasicInfoService; |
| | | import com.hxzkoa.services.FenceService; |
| | | import com.hxzkoa.services.LabelService; |
| | | import com.hxzkoa.services.MapService; |
| | | import com.hxzkoa.udp.ControTag; |
| | | import com.hxzkoa.udp.GetNowTime; |
| | | import com.hxzkoa.udp.IDcard; |
| | |
| | | private BasicInfoService basicInfoService; |
| | | @Autowired |
| | | private AnchorService anchorService; |
| | | @Autowired |
| | | private MapService mapService; |
| | | @Autowired |
| | | private FenceService fenceService; |
| | | |
| | | @ResponseBody |
| | | @RequestMapping(value = "/to_cs_pinlv.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | |
| | | public String labelManagement(HttpServletRequest request) { |
| | | String toPage = "forward:/hxzk/label/labelManagement.jsp"; |
| | | List<tb_tag> labelManagementList = labelService.getLabelManagement(1); |
| | | List<tb_tag> labelManagementListaa = labelService.getLabelManagementa(); |
| | | List<String> realAttendance_k = new ArrayList<String>(); |
| | | List<tb_department> departments = basicInfoService.getDepartmentManagement2(); |
| | | for (int i =0;i < departments.size(); i++) { |
| | | realAttendance_k.add(departments.get(i).getDepartmentName()); |
| | | } |
| | | List<String> leixings = labelService.findleixing(); |
| | | String[] strs = new String[4]; |
| | | int renyuannum = 0; |
| | | int chezainum = 0; |
| | | int wuzinum = 0; |
| | | int weibangdingnum = 0; |
| | | for (int i=0; i<labelManagementListaa.size(); i++) { |
| | | if (labelManagementListaa.get(i).getType().equals("车载带屏") || labelManagementListaa.get(i).getType().equals("车载无屏")) { |
| | | chezainum += 1; |
| | | } else if (labelManagementListaa.get(i).getType().equals("物资标签")) { |
| | | wuzinum += 1; |
| | | } else { |
| | | renyuannum += 1; |
| | | } |
| | | } |
| | | weibangdingnum = labelService.getweibangding(); |
| | | strs[0] = String.valueOf(renyuannum); |
| | | strs[1] = String.valueOf(chezainum); |
| | | strs[2] = String.valueOf(wuzinum); |
| | | strs[3] = String.valueOf(weibangdingnum); |
| | | request.setAttribute("tongji", strs); |
| | | request.setAttribute("leixing", leixings); |
| | | request.setAttribute("bumen", realAttendance_k); |
| | | request.setAttribute("labelManagementList", labelManagementList); |
| | | request.setAttribute("labelManagementListaa", labelManagementListaa); |
| | | int curPage = 1; |
| | | int count = labelService.getLabelManagementCount(); |
| | | int minPage = PageUtil.getMinPage(count); |
| | |
| | | } |
| | | |
| | | @ResponseBody |
| | | @RequestMapping(value = "/labelManagementad.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | public JSONObject labelManagementad(HttpServletRequest request) { |
| | | List<tb_person> labelManagementList = labelService.getLabelManagementa2(); |
| | | JSONObject json = new JSONObject(); |
| | | json.put("dataList", labelManagementList); |
| | | return json; |
| | | } |
| | | |
| | | @ResponseBody |
| | | @RequestMapping(value = "/labelManagementaa.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | public JSONObject labelManagementaa(HttpServletRequest request) { |
| | | JSONObject json = new JSONObject(); |
| | |
| | | tag.setGaodu(request.getParameter("gaodu")); |
| | | tag.setSudu(request.getParameter("sudu")); |
| | | tag.setPinglv(request.getParameter("pinglv")); |
| | | tag.setType(request.getParameter("type")); |
| | | tag.setVersion(Config.getVersion()); |
| | | } |
| | | // 如果该tag_id不存在,新增一条 |
| | | List<tb_tag> searchLabelManagement = labelService.searchLabelManagement(tag_id); |
| | | if (searchLabelManagement.size() == 0) { |
| | | labelService.labelManagement_add(tag); |
| | | // labelService.labelManagement_add(tag); |
| | | if (("").equals(tag.getState())) { |
| | | tag.setState("未绑定"); |
| | | } |
| | |
| | | tag.setSudu("1000"); |
| | | } |
| | | String xieyi = "BSTOCS1,ADDTAG," + tag.getTag_id() + "," + tag.getState() + "," + tag.getGaodu() + "," |
| | | + tag.getSudu() + "," + tag.getPinglv() + ",END"; |
| | | + tag.getSudu() + "," + tag.getPinglv() + "," + tag.getType() + ",END"; |
| | | Udp_Out.udp_to_cs(xieyi); |
| | | // 新增标签同时需要在tb_person中插入一条数据 |
| | | tb_person person = new tb_person(); |
| | |
| | | person.setP_kaoqing("0"); |
| | | person.setP_fence("0"); |
| | | person.setP_image("image/targeticon/default.png"); |
| | | basicInfoService.personManagement_add(person); |
| | | // basicInfoService.personManagement_add(person); |
| | | } |
| | | } |
| | | |
| | |
| | | tag.setGaodu(request.getParameter("gaodu")); |
| | | tag.setSudu(request.getParameter("sudu")); |
| | | tag.setPinglv(request.getParameter("pinglv")); |
| | | tag.setType(request.getParameter("type")); |
| | | tag.setVersion(Config.getVersion()); |
| | | } |
| | | // 如果该tag_id不存在,新增一条 |
| | | List<tb_tag> searchLabelManagement = labelService.searchLabelManagement(tag_id); |
| | | if (searchLabelManagement.size() == 0) { |
| | | aaa = labelService.labelManagement_add(tag); |
| | | aaa = labelService.labelManagement_adda(tag); |
| | | if (("").equals(tag.getState())) { |
| | | tag.setState("未绑定"); |
| | | } |
| | |
| | | } |
| | | return aaa; |
| | | } |
| | | |
| | | @ResponseBody |
| | | @RequestMapping(value = "/labelManagement_addad.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | public String labelManagement_addad(HttpServletRequest request) throws IOException { |
| | | tb_tag tag = new tb_tag(); |
| | | String str = "1"; |
| | | String bumen = ""; |
| | | String fence = ""; |
| | | int aaa = 0; |
| | | Boolean abc = isLetterDigit(request.getParameter("tagid")); |
| | | List<tb_tag> lables = labelService.searchLabelManagement(request.getParameter("tagid")); |
| | | if(abc.equals(true) && (lables.size() == 0)){ |
| | | String tag_id = request.getParameter("tagid"); |
| | | if (("").equals(tag_id) || tag_id == null) { |
| | | // 接口处理逻辑 |
| | | String jsonString = RequestUtils.getRequestJsonString(request, Config.getCharset()); |
| | | tag = (tb_tag) JSONObject.toBean(JSONObject.fromObject(jsonString), tb_tag.class); |
| | | tag_id = tag.getTag_id(); |
| | | } else { |
| | | // 网页请求逻辑 |
| | | tag.setTag_id(request.getParameter("tagid")); |
| | | tag.setState(request.getParameter("name")); |
| | | tag.setGaodu(request.getParameter("height")); |
| | | tag.setSudu("1000"); |
| | | tag.setPinglv("1"); |
| | | bumen = request.getParameter("department"); |
| | | fence = request.getParameter("fencename"); |
| | | tag.setVersion(Config.getVersion()); |
| | | } |
| | | // 如果该tag_id不存在,新增一条 |
| | | List<tb_tag> searchLabelManagement = labelService.searchLabelManagement(tag_id); |
| | | if (searchLabelManagement.size() == 0) { |
| | | aaa = labelService.labelManagement_adda(tag); |
| | | if (("").equals(tag.getState())) { |
| | | tag.setState("未绑定"); |
| | | } |
| | | if (("").equals(tag.getGaodu())) { |
| | | tag.setGaodu("150"); |
| | | } |
| | | if (("").equals(tag.getSudu())) { |
| | | tag.setSudu("1000"); |
| | | } |
| | | if (("").equals(tag.getPinglv())) { |
| | | tag.setPinglv("1"); |
| | | } |
| | | String xieyi = "BSTOCS1,U1ADDTAG," + tag.getTag_id() + "," + tag.getState() + "," + tag.getGaodu() + "," + bumen + "," + fence + ",END"; |
| | | Udp_Out.udp_to_cs(xieyi); |
| | | // 新增标签同时需要在tb_person中插入一条数据 |
| | | tb_person person = new tb_person(); |
| | | person.setP_tagid(tag.getTag_id()); |
| | | person.setP_name(tag.getState()); |
| | | person.setP_department(bumen); |
| | | person.setBaoliu4(tag.getGaodu()); |
| | | person.setBaoliu12(fence); |
| | | person.setP_sex("男"); |
| | | person.setP_minzu("汉") ; |
| | | person.setP_phone("131******88"); |
| | | person.setP_department("系统默认"); |
| | | person.setP_x("0"); |
| | | person.setP_y("0"); |
| | | person.setP_floor("0"); |
| | | person.setP_sos("0"); |
| | | person.setP_online("0"); |
| | | person.setP_kaoqing("0"); |
| | | person.setP_fence("0"); |
| | | person.setP_image("image/targeticon/default.png"); |
| | | basicInfoService.personManagement_add(person); |
| | | } |
| | | } else if (lables.size() != 0){ |
| | | str = "标签ID已存在"; |
| | | } else { |
| | | str = "标签ID只能使用数字或字母"; |
| | | } |
| | | return str; |
| | | } |
| | | |
| | | @RequestMapping(value = "/labelManagement_modify.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | public void labelManagement_modify(HttpServletRequest request) { |
| | |
| | | tag.setGaodu(request.getParameter("gaodu")); |
| | | tag.setSudu(request.getParameter("sudu")); |
| | | tag.setPinglv(request.getParameter("pinglv")); |
| | | tag.setType(request.getParameter("type")); |
| | | labelService.labelManagement_modify(tag); |
| | | String xieyi = "BSTOCS1,ALTERTAG," + tag.getTag_id() + "," + tag.getState() + "," + tag.getGaodu() + "," |
| | | + tag.getSudu() + "," + tag.getPinglv() + ",END"; |
| | | + tag.getSudu() + "," + tag.getPinglv() + "," + tag.getType() + ",END"; |
| | | Udp_Out.udp_to_cs(xieyi); |
| | | // 修改标签同时需要修改tb_person 需要先查再改否则覆盖空 |
| | | List<tb_person> searchPersonManagement = basicInfoService.searchPersonManagement(tag.getTag_id()); |
| | |
| | | tag.setGaodu(request.getParameter("gaodu")); |
| | | tag.setSudu(request.getParameter("sudu")); |
| | | tag.setPinglv(request.getParameter("pinglv")); |
| | | tag.setType(request.getParameter("type")); |
| | | int aaa = labelService.labelManagement_modifya(tag); |
| | | String xieyi = "BSTOCS1,ALTERTAG," + tag.getTag_id() + "," + tag.getState() + "," + tag.getGaodu() + "," |
| | | + tag.getSudu() + "," + tag.getPinglv() + ",END"; |
| | |
| | | } |
| | | return aaa; |
| | | } |
| | | |
| | | //修改标签 |
| | | @ResponseBody |
| | | @RequestMapping(value = "/labelManagement_modifyad.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | public String labelManagement_modifyad(HttpServletRequest request) { |
| | | tb_tag tag = new tb_tag(); |
| | | String str = "1"; |
| | | if(isLetterDigit(request.getParameter("tagid"))){ |
| | | tag.setTag_id(request.getParameter("tagid")); |
| | | tag.setState(request.getParameter("name")); |
| | | tag.setGaodu(request.getParameter("height")); |
| | | String bumen = request.getParameter("department"); |
| | | String fence = request.getParameter("fencename"); |
| | | // int aaa = labelService.labelManagement_modifya(tag); |
| | | if (("").equals(tag.getState())) { |
| | | tag.setState("未绑定"); |
| | | } |
| | | if (("").equals(tag.getGaodu())) { |
| | | tag.setGaodu("150"); |
| | | } |
| | | if (("").equals(tag.getSudu())) { |
| | | tag.setSudu("1000"); |
| | | } |
| | | if (("").equals(tag.getPinglv())) { |
| | | tag.setPinglv("1"); |
| | | } |
| | | // String xieyi = "BSTOCS1,ALTERTAG," + tag.getTag_id() + "," + tag.getState() + "," + bumen + "," |
| | | // + fence + ",END"; |
| | | String xieyi = "BSTOCS1,U1ALTERTAG,"+tag.getTag_id()+","+tag.getState()+","+tag.getGaodu()+","+bumen+","+fence+",END"; |
| | | Udp_Out.udp_to_cs(xieyi); |
| | | // 修改标签同时需要修改tb_person 需要先查再改否则覆盖空 |
| | | List<tb_person> searchPersonManagement = basicInfoService.searchPersonManagement(tag.getTag_id()); |
| | | if (searchPersonManagement != null) { |
| | | // tb_person person = searchPersonManagement.get(0); |
| | | // person.setP_tagid(tag.getTag_id()); |
| | | // person.setP_name(tag.getState()); |
| | | // person.setP_power(tag.getPower()); |
| | | // basicInfoService.personManagement_modify(person); |
| | | } |
| | | } else { |
| | | str = "标签ID只能使用数字或字母"; |
| | | } |
| | | return str; |
| | | } |
| | | |
| | | // 绑定用户 |
| | | @ResponseBody |
| | |
| | | |
| | | @ResponseBody |
| | | @RequestMapping(value = "/labelManagement_deletea.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | public int labelManagement_deletea(HttpServletRequest request) { |
| | | public String labelManagement_deletea(HttpServletRequest request) { |
| | | String checkValStr = request.getParameter("checkVal"); |
| | | checkValStr = checkValStr.replaceAll("\"", ""); |
| | | String[] checkVal = checkValStr.split(","); |
| | |
| | | // List<tb_tag> tags = labelService.searchidLabelManagement(checkVal[i]); |
| | | // tagids[i] = tags.get(0).getTag_id(); |
| | | // } |
| | | for (int i = 0; i < checkVal.length; i++) { |
| | | // String xieyi = "BSTOCS1,DELETETAG," + checkVal[i] + ",END"; |
| | | String xieyi = "BSTOCS1,U1DELETETAG," + checkVal[i] + ",END"; |
| | | Udp_Out.udp_to_cs(xieyi); |
| | | } |
| | | int aaa = labelService.labelManagement_deletea(checkVal); |
| | | // 删除标签同时需要删除tb_person |
| | | labelService.labelperson_delete(checkVal); |
| | | return aaa; |
| | | return ""+aaa; |
| | | } |
| | | |
| | | @ResponseBody |
| | |
| | | String jsonString = RequestUtils.getRequestJsonString(request, Config.getCharset()); |
| | | tb_tag tag = (tb_tag) JSONObject.toBean(JSONObject.fromObject(jsonString), tb_tag.class); |
| | | input = tag.getTag_id(); |
| | | List<tb_tag> labelManagementList = labelService.searchLabelManagement(input); |
| | | List<tb_tag> labelManagementList = labelService.searchLabelManagementaa(input); |
| | | if (labelManagementList.size() > 0) { |
| | | json.put("result", labelManagementList.get(0)); |
| | | } else { |
| | |
| | | } |
| | | |
| | | } else { |
| | | List<tb_tag> labelManagementList = labelService.searchLabelManagement(input); |
| | | List<tb_tag> labelManagementList = labelService.searchLabelManagementaa(input); |
| | | json.put("dataList", labelManagementList); |
| | | } |
| | | return json; |
| | |
| | | String tag_id = sheet.getCell(0, i).getContents(); |
| | | String state = sheet.getCell(1, i).getContents(); |
| | | if (!("").equals(tag_id)) { |
| | | tb_tag tag = new tb_tag(); |
| | | List<tb_tag> labelManagementList = labelService.searchLabelManagement(tag_id); |
| | | if (labelManagementList.size() == 0) { |
| | | result = 1; |
| | | tb_tag tag = new tb_tag(); |
| | | // tag.setStatus(status); |
| | | tag.setTag_id(tag_id); |
| | | tag.setState(state); |
| | | tag.setPower("100"); |
| | | tag.setGaodu("150"); |
| | | tag.setSudu("无"); |
| | | tag.setPinglv("1"); |
| | | tag.setVersion("无"); |
| | | tag.setType(""); |
| | | // result = labelService.labelManagement_add(tag); |
| | | // tb_person person = new tb_person(); |
| | | // person.setP_tagid(tag.getTag_id()); |
| | | // person.setP_name(tag.getState()); |
| | | // person.setP_power(tag.getPower()); |
| | | // person.setP_sex("男"); |
| | | // person.setP_minzu("汉"); |
| | | // person.setP_phone("131******88"); |
| | | // person.setP_department("系统默认"); |
| | | // person.setP_x("0"); |
| | | // person.setP_y("0"); |
| | | // person.setP_floor("0"); |
| | | // person.setP_sos("0"); |
| | | // person.setP_online("0"); |
| | | // person.setP_kaoqing("0"); |
| | | // person.setP_fence("0"); |
| | | // person.setP_image("image/targeticon/default.png"); |
| | | // basicInfoService.personManagement_add(person); |
| | | String xieyi = "BSTOCS1,ADDTAG," + tag.getTag_id() + "," + tag.getState() + "," + tag.getGaodu() + "," |
| | | + tag.getSudu() + "," + tag.getPinglv() + "," + tag.getType() + ",END"; |
| | | Udp_Out.udp_to_cs(xieyi); |
| | | } |
| | | } |
| | | } |
| | | // 释放资源 |
| | | workbook.close(); |
| | | } catch (BiffException e) { |
| | | e.printStackTrace(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | System.out.print(result+"-------------"); |
| | | request.setAttribute("resultList", result); |
| | | List<tb_tag> labelManagementList = labelService.getLabelManagement(1); |
| | | request.setAttribute("labelManagementList", labelManagementList); |
| | | int curPage = 1; |
| | | int count = labelService.getLabelManagementCount(); |
| | | int minPage = PageUtil.getMinPage(count); |
| | | request.setAttribute("pageList", PageUtil.getPage(minPage)); |
| | | request.setAttribute("curPage", curPage); |
| | | File file = new File(path); |
| | | file.delete(); |
| | | return toPage; |
| | | } |
| | | |
| | | @RequestMapping(value = "/uploadLabel2.do") |
| | | public String uploadPerson2(@RequestParam("file") MultipartFile[] files, HttpServletRequest request) { |
| | | String toPage = "forward:/hxzk/label/labelManagement.jsp"; |
| | | String filePath = request.getServletContext().getRealPath("/") + "hxzk\\upload\\"; |
| | | String filename = files[0].getOriginalFilename(); |
| | | try { |
| | | File existFile = new File(filePath); |
| | | if (!existFile.exists()) { |
| | | existFile.mkdir(); |
| | | } |
| | | for (MultipartFile file : files) { |
| | | file.transferTo(new File(filePath + file.getOriginalFilename())); |
| | | // System.out.print(file.getOriginalFilename()); |
| | | } |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | int result = 0; |
| | | String path = filePath + filename; |
| | | // 选取Excel文件得到工作薄 |
| | | Workbook workbook; |
| | | try { |
| | | File file = new File(path); |
| | | workbook = Workbook.getWorkbook(file); |
| | | // 选择工作表,通过Workbook的getSheet方法选择第一个工作表(从0开始) |
| | | Sheet sheet = workbook.getSheet(0); |
| | | int rows = sheet.getRows(); |
| | | // 选择Cell,读取单元格 通过Sheet的getCell方法选择位置为C2的单元格(两个参数都从0开始) |
| | | for (int i = 3; i < rows; i++) { |
| | | // 读取信息,通过Cell的getContents方法读取单元格的值把单元格中的信息以字符的形式读取出来 |
| | | // String status = sheet.getCell(0, i).getContents(); |
| | | String tag_id = sheet.getCell(0, i).getContents(); |
| | | String jingdu = sheet.getCell(1, i).getContents(); |
| | | jingdu = todufen(jingdu.substring(0, 3),jingdu.substring(3, 5),jingdu.substring(5)); |
| | | String weidu = sheet.getCell(2, i).getContents(); |
| | | weidu = todufen(weidu.substring(0, 2),weidu.substring(2,4),weidu.substring(4)); |
| | | if (!("").equals(tag_id)) { |
| | | tb_achor achor = new tb_achor(); |
| | | // tag.setStatus(status); |
| | | tag.setTag_id(tag_id); |
| | | tag.setState(state); |
| | | tag.setPower("100"); |
| | | tag.setGaodu("150"); |
| | | tag.setSudu("无"); |
| | | tag.setPinglv("无"); |
| | | tag.setVersion("无"); |
| | | result = labelService.labelManagement_add(tag); |
| | | tb_person person = new tb_person(); |
| | | person.setP_tagid(tag.getTag_id()); |
| | | person.setP_name(tag.getState()); |
| | | person.setP_power(tag.getPower()); |
| | | person.setP_sex("男"); |
| | | person.setP_minzu("汉"); |
| | | person.setP_phone("131******88"); |
| | | person.setP_department("系统默认"); |
| | | person.setP_x("0"); |
| | | person.setP_y("0"); |
| | | person.setP_floor("0"); |
| | | person.setP_sos("0"); |
| | | person.setP_online("0"); |
| | | person.setP_kaoqing("0"); |
| | | person.setP_fence("0"); |
| | | person.setP_image("image/targeticon/default.png"); |
| | | basicInfoService.personManagement_add(person); |
| | | achor.setAnchorid(tag_id); |
| | | achor.setBaoliu6(jingdu); |
| | | achor.setBaoliu7(weidu); |
| | | result = labelService.anchorManagement_modifyaa(achor); |
| | | } |
| | | } |
| | | // 释放资源 |
| | |
| | | tag.setPinglv(request.getParameter("pinglv")); |
| | | tag.setImu(request.getParameter("imu")); |
| | | tag.setDong_status(request.getParameter("dong_status")); |
| | | labelService.labelManagement_more(tag); |
| | | if (request.getParameter("tag_id").equals("ALL")) { |
| | | List<tb_tag> persons = labelService.getLabelManagement(); |
| | | for (int i=0; i<persons.size(); i++) { |
| | | tag.setTag_id(persons.get(i).getTag_id()); |
| | | labelService.labelManagement_more(tag); |
| | | } |
| | | } else { |
| | | tag.setTag_id(request.getParameter("tag_id")); |
| | | labelService.labelManagement_more(tag); |
| | | } |
| | | } |
| | | |
| | | @ResponseBody |
| | |
| | | } |
| | | return nn; |
| | | } |
| | | |
| | | @RequestMapping( value = "/toaddTask.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | public String toaddTask(HttpServletRequest request) { |
| | | String toPage = "forward:/hxzk/label/addTask.jsp"; |
| | | List<tb_map> maps = mapService.getMapManagement(); |
| | | request.setAttribute("mapList", maps); |
| | | return toPage; |
| | | } |
| | | |
| | | @ResponseBody |
| | | @RequestMapping( value="getMapFence.do", method={ RequestMethod.POST,RequestMethod.GET }) |
| | | public String getMapFence(HttpServletRequest request) { |
| | | JSONObject json = new JSONObject(); |
| | | String map = request.getParameter("value"); |
| | | List<tb_fence> fences = fenceService.searchFenceLista(map); |
| | | json.put("fenceList", fences); |
| | | return json.toString(); |
| | | } |
| | | |
| | | @ResponseBody |
| | | @RequestMapping(value="shailabel.do",method= {RequestMethod.POST,RequestMethod.GET}) |
| | | public String shailabel(HttpServletRequest request) { |
| | | JSONObject json = new JSONObject(); |
| | | String leixing = request.getParameter("leixing"); |
| | | String bumen = request.getParameter("bumen"); |
| | | List<tb_tag> tags = new ArrayList<>(); |
| | | if(!leixing.equals("全部") && !bumen.equals("全部")) { |
| | | if (leixing.equals("人员标签")) { |
| | | List<tb_tag> tags1 = labelService.shailabel1("系统默认", bumen); |
| | | List<tb_tag> tags2 = labelService.shailabel1("融合终端", bumen); |
| | | List<tb_tag> tags3 = labelService.shailabel1("心率带屏", bumen); |
| | | List<tb_tag> tags4 = labelService.shailabel1("工牌标签", bumen); |
| | | List<tb_tag> tags5 = labelService.shailabel1("安全帽标签", bumen); |
| | | List<tb_tag> tags6 = labelService.shailabel1("URT+CO", bumen); |
| | | if (tags2.size() > 0) { |
| | | for (int i=0; i<tags2.size(); i++) { |
| | | tags1.add(tags2.get(i)); |
| | | } |
| | | } |
| | | if (tags3.size() > 0) { |
| | | for (int i=0; i<tags3.size(); i++) { |
| | | tags1.add(tags3.get(i)); |
| | | } |
| | | } |
| | | if (tags4.size() > 0) { |
| | | for (int i=0; i<tags4.size(); i++) { |
| | | tags1.add(tags4.get(i)); |
| | | } |
| | | } |
| | | if (tags5.size() > 0) { |
| | | for (int i=0; i<tags5.size(); i++) { |
| | | tags1.add(tags5.get(i)); |
| | | } |
| | | } |
| | | if (tags6.size() > 0) { |
| | | for (int i=0; i<tags6.size(); i++) { |
| | | tags1.add(tags6.get(i)); |
| | | } |
| | | } |
| | | tags = tags1; |
| | | } else if (leixing.equals("车辆标签")) { |
| | | List<tb_tag> tags1 = labelService.shailabel1("车载带屏", bumen); |
| | | List<tb_tag> tags2 = labelService.shailabel1("车载无屏", bumen); |
| | | if (tags2.size() > 0) { |
| | | for (int i=0; i<tags2.size(); i++) { |
| | | tags1.add(tags2.get(i)); |
| | | } |
| | | } |
| | | tags = tags1; |
| | | } else if (leixing.equals("物资标签")) { |
| | | tags = labelService.shailabel1("物资标签", bumen); |
| | | } |
| | | } else if (leixing.equals("全部")) { |
| | | tags = labelService.shailabel2(bumen); |
| | | } else if (bumen.equals("全部")) { |
| | | if (leixing.equals("人员标签")) { |
| | | List<tb_tag> tags1 = labelService.shailabel3("系统默认"); |
| | | List<tb_tag> tags2 = labelService.shailabel3("融合终端"); |
| | | List<tb_tag> tags3 = labelService.shailabel3("心率带屏"); |
| | | List<tb_tag> tags4 = labelService.shailabel3("工牌标签"); |
| | | List<tb_tag> tags5 = labelService.shailabel3("安全帽标签"); |
| | | List<tb_tag> tags6 = labelService.shailabel1("URT+CO", bumen); |
| | | if (tags2.size() > 0) { |
| | | for (int i=0; i<tags2.size(); i++) { |
| | | tags1.add(tags2.get(i)); |
| | | } |
| | | } |
| | | if (tags3.size() > 0) { |
| | | for (int i=0; i<tags3.size(); i++) { |
| | | tags1.add(tags3.get(i)); |
| | | } |
| | | } |
| | | if (tags4.size() > 0) { |
| | | for (int i=0; i<tags4.size(); i++) { |
| | | tags1.add(tags4.get(i)); |
| | | } |
| | | } |
| | | if (tags5.size() > 0) { |
| | | for (int i=0; i<tags5.size(); i++) { |
| | | tags1.add(tags5.get(i)); |
| | | } |
| | | } |
| | | if (tags6.size() > 0) { |
| | | for (int i=0; i<tags6.size(); i++) { |
| | | tags1.add(tags6.get(i)); |
| | | } |
| | | } |
| | | tags = tags1; |
| | | } else if (leixing.equals("车辆标签")) { |
| | | List<tb_tag> tags1 = labelService.shailabel3("车载带屏"); |
| | | List<tb_tag> tags2 = labelService.shailabel3("车载无屏"); |
| | | if (tags2.size() > 0) { |
| | | for (int i=0; i<tags2.size(); i++) { |
| | | tags1.add(tags2.get(i)); |
| | | } |
| | | } |
| | | tags = tags1; |
| | | } else if (leixing.equals("物资标签")) { |
| | | tags = labelService.shailabel3("物资标签"); |
| | | } |
| | | } |
| | | json.put("dataList", tags); |
| | | return json.toString(); |
| | | } |
| | | |
| | | //度分转度 |
| | | public static String todufen(String Du, String Fen, String Miao) { |
| | | Float strDu = Float.valueOf(Du); |
| | | Float strFen = Float.valueOf(Fen) / 60; |
| | | Float strMiao = Float.valueOf(Miao) / 60; |
| | | Float dufenmiao = strDu + strFen + strMiao; |
| | | String format = String.format("%.6f", dufenmiao); |
| | | return format; |
| | | } |
| | | |
| | | public static boolean isLetterDigit(String str) { |
| | | |
| | | String regex = "^[a-z0-9A-Z]+$"; |
| | | |
| | | return str.matches(regex); |
| | | |
| | | } |
| | | } |