| | |
| | | import java.util.Collections; |
| | | import java.util.Comparator; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | |
| | | private BasicInfoService basicInfoService; |
| | | @Autowired |
| | | private AnchorService anchorService; |
| | | |
| | | |
| | | @ResponseBody |
| | | @RequestMapping(value = "/to_cs_pinlv.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | public void pinlv(HttpServletRequest request) { |
| | | String tag_id = request.getParameter("tag_id"); |
| | | String hz = request.getParameter("hz"); |
| | | String xieyi = "55BB,ALERT_TAG_HZ,"+hz+","+tag_id+",END"; |
| | | String xieyi = "55BB,ALERT_TAG_HZ," + hz + "," + tag_id + ",END"; |
| | | Udp_Out.udp_to_cs(xieyi); |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @RequestMapping(value = "/to_cs_xiumian_time.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | public void xiumiantime(HttpServletRequest request) { |
| | | String tag_id = request.getParameter("tag_id"); |
| | | String hz = request.getParameter("hz"); |
| | | String xieyi = "55BB,ALERT_SLEEP_TIME,"+hz+","+tag_id+",END"; |
| | | String xieyi = "55BB,ALERT_SLEEP_TIME," + hz + "," + tag_id + ",END"; |
| | | Udp_Out.udp_to_cs(xieyi); |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @RequestMapping(value = "/to_cs_xiumian_.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | public void xiumian(HttpServletRequest request) { |
| | | String tag_id = request.getParameter("tag_id"); |
| | | String hz = request.getParameter("hz"); |
| | | String xieyi = "55BB,OPEN_OR_CLOSE_SLEEP,"+hz+","+tag_id+",END"; |
| | | String xieyi = "55BB,OPEN_OR_CLOSE_SLEEP," + hz + "," + tag_id + ",END"; |
| | | Udp_Out.udp_to_cs(xieyi); |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @RequestMapping(value = "/to_cs_zhendong_.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | public void zhendong(HttpServletRequest request) { |
| | | String tag_id = request.getParameter("tag_id"); |
| | | String hz = request.getParameter("hz"); |
| | | String xieyi = "55BB,TAG_SHAKE,"+hz+","+tag_id+",END"; |
| | | String xieyi = "55BB,TAG_SHAKE," + hz + "," + tag_id + ",END"; |
| | | Udp_Out.udp_to_cs(xieyi); |
| | | } |
| | | |
| | |
| | | int curPage = 1; |
| | | int count = labelService.getLabelManagementCount(); |
| | | int minPage = PageUtil.getMinPage(count); |
| | | //System.out.print(minPage); |
| | | // System.out.print(minPage); |
| | | request.setAttribute("pageList", PageUtil.getPage(minPage)); |
| | | request.setAttribute("curPage", curPage); |
| | | return toPage; |
| | | } |
| | | |
| | | @ResponseBody |
| | | @RequestMapping(value = "/labelManagementa.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | public JSONObject labelManagementa(HttpServletRequest request) { |
| | | List<tb_tag> labelManagementList = labelService.getLabelManagementa(); |
| | | 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(); |
| | | List<tb_tag> labelManagementList = labelService.getLabelManagement(1); |
| | | int curPage = 1; |
| | | int count = labelService.getLabelManagementCount(); |
| | | int minPage = PageUtil.getMinPage(count); |
| | | json.put("dataList", labelManagementList); |
| | | json.put("pageList", PageUtil.getPage(minPage)); |
| | | json.put("curPage", curPage); |
| | | return json; |
| | | } |
| | | |
| | | @RequestMapping(value = "/labelManagement_add.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | public void labelManagement_add(HttpServletRequest request) throws IOException { |
| | | tb_tag tag = new tb_tag(); |
| | |
| | | List<tb_tag> searchLabelManagement = labelService.searchLabelManagement(tag_id); |
| | | if (searchLabelManagement.size() == 0) { |
| | | labelService.labelManagement_add(tag); |
| | | if(("").equals(tag.getState())){ |
| | | if (("").equals(tag.getState())) { |
| | | tag.setState("未绑定"); |
| | | } |
| | | if(("").equals(tag.getGaodu())){ |
| | | if (("").equals(tag.getGaodu())) { |
| | | tag.setGaodu("150"); |
| | | } |
| | | if(("").equals(tag.getSudu())){ |
| | | if (("").equals(tag.getSudu())) { |
| | | tag.setSudu("1000"); |
| | | } |
| | | String xieyi = "BSTOCS1,ADDTAG,"+tag.getTag_id()+","+tag.getState()+","+tag.getGaodu()+","+tag.getSudu()+","+tag.getPinglv()+",END"; |
| | | String xieyi = "BSTOCS1,ADDTAG," + tag.getTag_id() + "," + tag.getState() + "," + tag.getGaodu() + "," |
| | | + tag.getSudu() + "," + tag.getPinglv() + ",END"; |
| | | Udp_Out.udp_to_cs(xieyi); |
| | | // 新增标签同时需要在tb_person中插入一条数据 |
| | | tb_person person = new tb_person(); |
| | |
| | | } |
| | | } |
| | | |
| | | @ResponseBody |
| | | @RequestMapping(value = "/labelManagement_adda.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | public int labelManagement_adda(HttpServletRequest request) throws IOException { |
| | | tb_tag tag = new tb_tag(); |
| | | int aaa = 0; |
| | | String tag_id = request.getParameter("tag_id"); |
| | | 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("tag_id")); |
| | | tag.setState(request.getParameter("state")); |
| | | tag.setGaodu(request.getParameter("gaodu")); |
| | | tag.setSudu(request.getParameter("sudu")); |
| | | tag.setPinglv(request.getParameter("pinglv")); |
| | | tag.setVersion(Config.getVersion()); |
| | | } |
| | | // 如果该tag_id不存在,新增一条 |
| | | List<tb_tag> searchLabelManagement = labelService.searchLabelManagement(tag_id); |
| | | if (searchLabelManagement.size() == 0) { |
| | | aaa = labelService.labelManagement_add(tag); |
| | | if (("").equals(tag.getState())) { |
| | | tag.setState("未绑定"); |
| | | } |
| | | if (("").equals(tag.getGaodu())) { |
| | | tag.setGaodu("150"); |
| | | } |
| | | if (("").equals(tag.getSudu())) { |
| | | tag.setSudu("1000"); |
| | | } |
| | | String xieyi = "BSTOCS1,ADDTAG," + tag.getTag_id() + "," + tag.getState() + "," + tag.getGaodu() + "," |
| | | + tag.getSudu() + "," + tag.getPinglv() + ",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_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); |
| | | } |
| | | return aaa; |
| | | } |
| | | |
| | | @RequestMapping(value = "/labelManagement_modify.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | public void labelManagement_modify(HttpServletRequest request) { |
| | | tb_tag tag = new tb_tag(); |
| | |
| | | tag.setSudu(request.getParameter("sudu")); |
| | | tag.setPinglv(request.getParameter("pinglv")); |
| | | labelService.labelManagement_modify(tag); |
| | | String xieyi = "BSTOCS1,ALTERTAG,"+tag.getTag_id()+","+tag.getState()+","+tag.getGaodu()+","+tag.getSudu()+","+tag.getPinglv()+",END"; |
| | | String xieyi = "BSTOCS1,ALTERTAG," + tag.getTag_id() + "," + tag.getState() + "," + tag.getGaodu() + "," |
| | | + tag.getSudu() + "," + tag.getPinglv() + ",END"; |
| | | Udp_Out.udp_to_cs(xieyi); |
| | | // 修改标签同时需要修改tb_person 需要先查再改否则覆盖空 |
| | | List<tb_person> searchPersonManagement = basicInfoService.searchPersonManagement(tag.getTag_id()); |
| | | if(searchPersonManagement!=null){ |
| | | if (searchPersonManagement != null) { |
| | | tb_person person = searchPersonManagement.get(0); |
| | | person.setP_tagid(tag.getTag_id()); |
| | | person.setP_name(tag.getState()); |
| | |
| | | } |
| | | } |
| | | |
| | | @ResponseBody |
| | | @RequestMapping(value = "/labelManagement_modifya.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | public int labelManagement_modifya(HttpServletRequest request) { |
| | | tb_tag tag = new tb_tag(); |
| | | tag.setTag_id(request.getParameter("tag_id")); |
| | | tag.setState(request.getParameter("state")); |
| | | tag.setGaodu(request.getParameter("gaodu")); |
| | | tag.setSudu(request.getParameter("sudu")); |
| | | tag.setPinglv(request.getParameter("pinglv")); |
| | | int aaa = labelService.labelManagement_modifya(tag); |
| | | String xieyi = "BSTOCS1,ALTERTAG," + tag.getTag_id() + "," + tag.getState() + "," + tag.getGaodu() + "," |
| | | + tag.getSudu() + "," + tag.getPinglv() + ",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); |
| | | } |
| | | return aaa; |
| | | } |
| | | |
| | | // 绑定用户 |
| | | @ResponseBody |
| | | @RequestMapping(value = "/labelManagement_modifyaa.do", method = { RequestMethod.POST, RequestMethod.GET }, produces ="application/json; charset=utf-8") |
| | | public int labelManagement_modifyaa(@RequestBody Map map) { |
| | | tb_tag tag = new tb_tag(); |
| | | tag.setTag_id(map.get("tag_id").toString()); |
| | | tag.setState(map.get("name").toString()); |
| | | List<tb_tag> searchtagManagement = basicInfoService.searchPersonManagementa(tag.getTag_id()); |
| | | int aaa = 0; |
| | | if (searchtagManagement != null) { |
| | | aaa = labelService.labelManagement_modifytag(tag); |
| | | List<tb_tag> tags = labelService.searchLabelManagement(tag.getTag_id()); |
| | | // String xieyi = "BSTOCS1,ALTERTAG," + tag.getTag_id() + "," + tag.getState() + "," + tags.get(0).getGaodu() + "," |
| | | // + tags.get(0).getSudu() + "," + tags.get(0).getPinglv() + ",END"; |
| | | // Udp_Out.udp_to_cs(xieyi); |
| | | tb_person person = new tb_person(); |
| | | person.setP_tagid(tag.getTag_id()); |
| | | person.setP_name(tag.getState()); |
| | | // person.setP_sex(request.getParameter("sex")); |
| | | // person.setP_minzu(request.getParameter("minzu")); |
| | | person.setP_fangkeid(map.get("fangkeid").toString()); |
| | | person.setP_idcardnum(map.get("idcardnum").toString()); |
| | | // person.setP_adress(request.getParameter("adress")); |
| | | // 修改标签同时需要修改tb_person 需要先查再改否则覆盖空 |
| | | List<tb_person> searchPersonManagement = basicInfoService.searchPersonManagement(tag.getTag_id()); |
| | | if (searchPersonManagement != null) { |
| | | labelService.labelManagement_modifyperson(person); |
| | | } |
| | | } |
| | | return aaa; |
| | | } |
| | | |
| | | // 用户解绑 |
| | | @ResponseBody |
| | | @RequestMapping(value = "/labelManagement_modifyaaa.do", method = { RequestMethod.POST, RequestMethod.GET }, produces ="application/json; charset=utf-8") |
| | | public int labelManagement_modifyaaa(@RequestBody Map map) { |
| | | tb_tag tag = new tb_tag(); |
| | | tag.setTag_id(map.get("tag_id").toString()); |
| | | tag.setState("未绑定"); |
| | | List<tb_tag> searchtagManagement = basicInfoService.searchPersonManagementa(tag.getTag_id()); |
| | | int aaa = 0; |
| | | if (searchtagManagement != null) { |
| | | aaa = labelService.labelManagement_modifytag(tag); |
| | | // List<tb_tag> tags = labelService.searchLabelManagement(tag.getTag_id()); |
| | | // String xieyi = "BSTOCS1,ALTERTAG,"+tag.getTag_id()+","+tag.getState()+","+tags.get(0).getGaodu()+","+tags.get(0).getSudu()+","+tags.get(0).getPinglv()+",END"; |
| | | // Udp_Out.udp_to_cs(xieyi); |
| | | tb_person person = new tb_person(); |
| | | person.setP_tagid(tag.getTag_id()); |
| | | person.setP_name(tag.getState()); |
| | | person.setP_sex("-"); |
| | | person.setP_minzu("-"); |
| | | person.setP_phone("-"); |
| | | person.setP_idcardnum("-"); |
| | | person.setP_adress("-"); |
| | | // 修改标签同时需要修改tb_person 需要先查再改否则覆盖空 |
| | | List<tb_person> searchPersonManagement = basicInfoService.searchPersonManagement(tag.getTag_id()); |
| | | if (searchPersonManagement != null) { |
| | | labelService.labelManagement_modifyperson(person); |
| | | } |
| | | } |
| | | return aaa; |
| | | } |
| | | |
| | | @RequestMapping(value = "/labelManagement_modifyAll.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | public void labelManagement_modifyAll(HttpServletRequest request) { |
| | | tb_tag tag = new tb_tag(); |
| | |
| | | tag.setSudu(request.getParameter("sudu")); |
| | | tag.setPinglv(request.getParameter("pinglv")); |
| | | labelService.labelManagement_modifyAll(tag); |
| | | String xieyi = "BSTOCS1,ALTERALLTAG,"+tag.getGaodu()+","+tag.getSudu()+","+tag.getPinglv()+",END"; |
| | | String xieyi = "BSTOCS1,ALTERALLTAG," + tag.getGaodu() + "," + tag.getSudu() + "," + tag.getPinglv() + ",END"; |
| | | Udp_Out.udp_to_cs(xieyi); |
| | | // 需要遍历修改 |
| | | List<tb_tag> labelList = labelService.getLabelManagement(); |
| | |
| | | String tag_id = labelList.get(i).getTag_id(); |
| | | // 修改标签同时需要修改tb_person 需要先查再改否则覆盖空 |
| | | List<tb_person> searchPersonManagement = basicInfoService.searchPersonManagement(tag_id); |
| | | if(searchPersonManagement!=null){ |
| | | if (searchPersonManagement != null) { |
| | | tb_person person = searchPersonManagement.get(0); |
| | | person.setP_tagid(tag.getTag_id()); |
| | | person.setP_name(tag.getState()); |
| | |
| | | } |
| | | |
| | | @ResponseBody |
| | | @RequestMapping(value = "/labelManagement_modifyAlla.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | public int labelManagement_modifyAlla(HttpServletRequest request) { |
| | | tb_tag tag = new tb_tag(); |
| | | tag.setGaodu(request.getParameter("gaodu")); |
| | | tag.setSudu(request.getParameter("sudu")); |
| | | tag.setPinglv(request.getParameter("pinglv")); |
| | | int aaa = labelService.labelManagement_modifyAlla(tag); |
| | | String xieyi = "BSTOCS1,ALTERALLTAG," + tag.getGaodu() + "," + tag.getSudu() + "," + tag.getPinglv() + ",END"; |
| | | Udp_Out.udp_to_cs(xieyi); |
| | | // 需要遍历修改 |
| | | List<tb_tag> labelList = labelService.getLabelManagement(); |
| | | for (int i = 0; i < labelList.size(); i++) { |
| | | String tag_id = labelList.get(i).getTag_id(); |
| | | // 修改标签同时需要修改tb_person 需要先查再改否则覆盖空 |
| | | List<tb_person> searchPersonManagement = basicInfoService.searchPersonManagement(tag_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); |
| | | } |
| | | } |
| | | return aaa; |
| | | } |
| | | |
| | | @ResponseBody |
| | | @RequestMapping(value = "/labelManagement_delete.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | public void labelManagement_delete(HttpServletRequest request) { |
| | | String checkValStr = request.getParameter("checkVal"); |
| | |
| | | String[] checkVal = checkValStr.split(","); |
| | | labelService.labelManagement_delete(checkVal); |
| | | for (int i = 0; i < checkVal.length; i++) { |
| | | String xieyi = "BSTOCS1,DELETETAG,"+checkVal[i]+",END"; |
| | | String xieyi = "BSTOCS1,DELETETAG," + checkVal[i] + ",END"; |
| | | Udp_Out.udp_to_cs(xieyi); |
| | | } |
| | | // 删除标签同时需要删除tb_person |
| | | labelService.labelperson_delete(checkVal); |
| | | labelService.labelperson_delete(checkVal); |
| | | } |
| | | |
| | | @ResponseBody |
| | | @RequestMapping(value = "/labelManagement_deletea.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | public int labelManagement_deletea(HttpServletRequest request) { |
| | | String checkValStr = request.getParameter("checkVal"); |
| | | checkValStr = checkValStr.replaceAll("\"", ""); |
| | | String[] checkVal = checkValStr.split(","); |
| | | // String[] tagids = new String[checkVal.length]; |
| | | // for (int i = 0; i < checkVal.length; i++) { |
| | | // List<tb_tag> tags = labelService.searchidLabelManagement(checkVal[i]); |
| | | // tagids[i] = tags.get(0).getTag_id(); |
| | | // } |
| | | int aaa = labelService.labelManagement_deletea(checkVal); |
| | | // 删除标签同时需要删除tb_person |
| | | labelService.labelperson_delete(checkVal); |
| | | return aaa; |
| | | } |
| | | |
| | | @ResponseBody |
| | |
| | | } |
| | | |
| | | @ResponseBody |
| | | @RequestMapping(value = "/labelManagement_deleteAlla.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | public int labelManagement_deleteAlla(HttpServletRequest request) { |
| | | int aaa = labelService.labelManagement_deleteAlla(); |
| | | String xieyi = "BSTOCS1,DELETEALLTAG,END"; |
| | | Udp_Out.udp_to_cs(xieyi); |
| | | // 删除标签同时需要删除tb_person |
| | | basicInfoService.personManagement_deleteAll(); |
| | | return aaa; |
| | | } |
| | | |
| | | @ResponseBody |
| | | @RequestMapping(value = "/labelManagement_search.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | public String labelManagement_search(HttpServletRequest request) throws IOException { |
| | | JSONObject json = new JSONObject(); |
| | |
| | | } |
| | | |
| | | @ResponseBody |
| | | @RequestMapping(value = "/labelManagement_searcha.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | public JSONObject labelManagement_searcha(HttpServletRequest request) throws IOException { |
| | | JSONObject json = new JSONObject(); |
| | | String input = request.getParameter("tagid"); |
| | | if (("").equals(input) || input == null) { |
| | | 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); |
| | | if (labelManagementList.size() > 0) { |
| | | json.put("result", labelManagementList.get(0)); |
| | | } else { |
| | | json.put("result", "null"); |
| | | } |
| | | |
| | | } else { |
| | | List<tb_tag> labelManagementList = labelService.searchLabelManagement(input); |
| | | json.put("dataList", labelManagementList); |
| | | } |
| | | return json; |
| | | } |
| | | |
| | | @ResponseBody |
| | | @RequestMapping(value = "/labelManagement_page.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | public String labelManagement_page(HttpServletRequest request) { |
| | | String pageStr = request.getParameter("page"); |
| | |
| | | public String labelManagement_exportTemplate(HttpServletRequest request, HttpServletResponse response) { |
| | | String toPage = "forward:/hxzk/label/labelManagement.jsp"; |
| | | List<tb_tag> labelTemplateList = labelService.getLabelManagement(1); |
| | | String[] rowName = { "标签ID", "绑定对象"}; |
| | | String[] rowName = { "标签ID", "绑定对象" }; |
| | | List<Object[]> dataList = labelTemplateobjectToArray(labelTemplateList); |
| | | ExcelUtils excel = new ExcelUtils("标签管理", rowName, dataList); |
| | | OutputStream out; |
| | |
| | | } |
| | | for (MultipartFile file : files) { |
| | | file.transferTo(new File(filePath + file.getOriginalFilename())); |
| | | //System.out.print(file.getOriginalFilename()); |
| | | // System.out.print(file.getOriginalFilename()); |
| | | } |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | |
| | | 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); |
| | | } |
| | | } |
| | | // 释放资源 |
| | |
| | | json.put("image", imageStr); |
| | | return json.toString(); |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @RequestMapping(value = "/labelDeliver_readPoscard.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | public String labelDeliver_readPoscard(HttpServletRequest request) { |
| | | JSONObject json = new JSONObject(); |
| | | List<tb_adress_and_port> adress_and_port = labelService.getAdress_and_port(); |
| | | String rfidnum = ""; |
| | | if(IDcard.M1_MF_HL_Request(adress_and_port)==144) { |
| | | rfidnum=String.valueOf(IDcard.kaohao); |
| | | }; |
| | | if (IDcard.M1_MF_HL_Request(adress_and_port) == 144) { |
| | | rfidnum = String.valueOf(IDcard.kaohao); |
| | | } |
| | | ; |
| | | json.put("rfidnum", rfidnum); |
| | | return json.toString(); |
| | | } |
| | |
| | | } |
| | | |
| | | @ResponseBody |
| | | @RequestMapping(value = "/historicalPower_searchname.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | public String historicalPower_searchname(HttpServletRequest request) { |
| | | String begin = request.getParameter("begin"); |
| | | String end = request.getParameter("end"); |
| | | String tagida = request.getParameter("tagida"); |
| | | System.out.print(begin + "-----" + end + "--------" + tagida); |
| | | int curPage = 1; |
| | | List<Integer> pageList = new ArrayList<Integer>(); |
| | | List<tb_history_power> historicalPowerList = labelService.searchnameHistoricalPower(begin, end, tagida); |
| | | System.out.print(historicalPowerList.get(0)); |
| | | pageList.add(1); |
| | | JSONObject json = new JSONObject(); |
| | | json.put("dataList", historicalPowerList); |
| | | json.put("pageList", pageList); |
| | | json.put("curPage", curPage); |
| | | return json.toString(); |
| | | } |
| | | |
| | | @ResponseBody |
| | | @RequestMapping(value = "/historicalPower_powerAnalysis.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | public String historicalPower_powerAnalysis(HttpServletRequest request) throws Exception { |
| | | String input = request.getParameter("input"); |
| | |
| | | List<Integer> pageList = new ArrayList<Integer>(); |
| | | List<tb_history_power> historicalPowerList = labelService.searchPowerAnalysis(input); |
| | | String sysPath = request.getServletContext().getRealPath("/"); |
| | | LineXy.getJFreeChart_hp(input, historicalPowerList,sysPath); |
| | | LineXy.getJFreeChart_hp(input, historicalPowerList, sysPath); |
| | | pageList.add(1); |
| | | JSONObject json = new JSONObject(); |
| | | String filePath = "hxzk/image/powerAnalysis/" + input + "电量分析.jpeg"; |
| | |
| | | tb_tag tag = (tb_tag) JSONObject.toBean(JSONObject.fromObject(jsonString), tb_tag.class); |
| | | // 显示sql |
| | | String sqlString = "UPDATE tb_tag SET power=" + tag.getPower() + " WHERE tag_id=" + tag.getTag_id(); |
| | | String messageJson = GetNowTime.timestamp2()+ " 收:"+ sqlString ; |
| | | String messageJson = GetNowTime.timestamp2() + " 收:" + sqlString; |
| | | String BaowenPath = Config.getBaowenConfig(); |
| | | String baowenStatus = ModifyConfig.readData(BaowenPath, "baowenSwitch"); |
| | | if (baowenStatus.equals("1")){ |
| | | if (baowenStatus.equals("1")) { |
| | | /* Udp_Receive.mysqlMessage.add(messageJson); */ |
| | | } |
| | | // |
| | | labelService.label_bw_power(tag); |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @RequestMapping(value = "/labeltag_id_search.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | public int labeltag_id_search(HttpServletRequest request) throws IOException { |
| | |
| | | json.put("pageList", pageList); |
| | | json.put("curPage", curPage); |
| | | } |
| | | if(null == labelManagementList || labelManagementList.size() ==0 ) { |
| | | nn=0; |
| | | }else { |
| | | nn=1; |
| | | if (null == labelManagementList || labelManagementList.size() == 0) { |
| | | nn = 0; |
| | | } else { |
| | | nn = 1; |
| | | } |
| | | return nn; |
| | | } |