| | |
| | | // |
| | | // Source code recreated from a .class file by IntelliJ IDEA |
| | | // (powered by FernFlower decompiler) |
| | | // |
| | | |
| | | package com.hxzkoa.controller; |
| | | |
| | | import com.hxzkoa.json.tb_department; |
| | | import com.hxzkoa.json.tb_icon; |
| | | import com.hxzkoa.json.tb_nav; |
| | | import com.hxzkoa.json.tb_person; |
| | | import com.hxzkoa.json.tb_tag; |
| | | import com.hxzkoa.services.BasicInfoService; |
| | | import com.hxzkoa.services.LabelService; |
| | | import com.hxzkoa.services.ZhwService; |
| | | import com.hxzkoa.udp.GetNowTime; |
| | | import com.hxzkoa.udp.Udp_Out; |
| | | import com.hxzkoa.util.Config; |
| | | import com.hxzkoa.util.ExcelUtils; |
| | | import com.hxzkoa.util.ModifyConfig; |
| | | import com.hxzkoa.util.PageUtil; |
| | | import com.hxzkoa.util.RequestUtils; |
| | | import java.io.File; |
| | | import java.io.IOException; |
| | | import java.io.OutputStream; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import org.hibernate.dialect.function.VarArgsSQLFunction; |
| | | import jxl.Sheet; |
| | | import jxl.Workbook; |
| | | import jxl.read.biff.BiffException; |
| | | import net.sf.json.JSONObject; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import com.hxzkoa.json.tb_department; |
| | | import com.hxzkoa.json.tb_icon; |
| | | import com.hxzkoa.json.tb_led; |
| | | import com.hxzkoa.json.tb_nav; |
| | | import com.hxzkoa.json.tb_person; |
| | | import com.hxzkoa.json.tb_realkaoqing; |
| | | import com.hxzkoa.json.tb_tag; |
| | | import com.hxzkoa.services.BasicInfoService; |
| | | import com.hxzkoa.services.LabelService; |
| | | import com.hxzkoa.services.ZhwService; |
| | | import com.hxzkoa.udp.GetNowTime; |
| | | import com.hxzkoa.udp.Udp_Out; |
| | | /*import com.hxzkoa.udp.Udp_Receive;*/ |
| | | import com.hxzkoa.util.Config; |
| | | import com.hxzkoa.util.ExcelUtils; |
| | | import com.hxzkoa.util.HttpUtil; |
| | | import com.hxzkoa.util.ModifyConfig; |
| | | import com.hxzkoa.util.PageUtil; |
| | | import com.hxzkoa.util.RequestUtils; |
| | | |
| | | import jxl.Sheet; |
| | | import jxl.Workbook; |
| | | import jxl.read.biff.BiffException; |
| | | import net.sf.json.JSONObject; |
| | | |
| | | @Controller |
| | | public class BasicInfoController { |
| | | @Autowired |
| | |
| | | @Autowired |
| | | private ZhwService zhwService; |
| | | |
| | | @RequestMapping(value = "/iconManagement.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | public BasicInfoController() { |
| | | } |
| | | |
| | | @RequestMapping(value = {"/iconManagement.do"}, method = {RequestMethod.POST, RequestMethod.GET} |
| | | ) |
| | | public String iconManagement(HttpServletRequest request) { |
| | | String toPage = "forward:/hxzk/basicInfo/iconManagement.jsp"; |
| | | List<tb_icon> iconManagementList = basicInfoService.getIconManagement(1); |
| | | int count = basicInfoService.getIconManagementCount(); |
| | | List<tb_icon> iconManagementList = this.basicInfoService.getIconManagement(1); |
| | | for (int i=0;i<iconManagementList.size();i++){ |
| | | if(iconManagementList.get(i).getIcon_name().contains(".")){ |
| | | String[] name=iconManagementList.get(i).getIcon_name().split("\\."); |
| | | iconManagementList.get(i).setIcon_name(name[0]); |
| | | } |
| | | } |
| | | int count = this.basicInfoService.getIconManagementCount(); |
| | | int curPage = 1; |
| | | request.setAttribute("iconManagementList", iconManagementList); |
| | | int minPage = PageUtil.getMinPage(count); |
| | | request.setAttribute("pageList", PageUtil.getPage(minPage)); |
| | | request.setAttribute("curPage", curPage); |
| | | request.setAttribute("curPage", Integer.valueOf(curPage)); |
| | | return toPage; |
| | | } |
| | | |
| | | @ResponseBody |
| | | @RequestMapping(value = "/iconManagement_page.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | @RequestMapping(value = {"/iconManagement_page.do"}, method = {RequestMethod.POST, RequestMethod.GET} |
| | | ) |
| | | public String iconManagement_page(HttpServletRequest request) { |
| | | String pageStr = request.getParameter("page"); |
| | | String curPageStr = request.getParameter("curPage"); |
| | | int count = basicInfoService.getIconManagementCount(); |
| | | int count = this.basicInfoService.getIconManagementCount(); |
| | | int minPage = PageUtil.getMinPage(count); |
| | | int curPage = Integer.parseInt(curPageStr); |
| | | int page = 1; |
| | |
| | | } else { |
| | | page = Integer.parseInt(pageStr); |
| | | } |
| | | List<tb_icon> iconManagementList = basicInfoService.getIconManagement(page); |
| | | |
| | | List<tb_icon> iconManagementList = this.basicInfoService.getIconManagement(page); |
| | | for (int i=0;i<iconManagementList.size();i++){ |
| | | if(iconManagementList.get(i).getIcon_name().contains(".")){ |
| | | String[] name=iconManagementList.get(i).getIcon_name().split("\\."); |
| | | iconManagementList.get(i).setIcon_name(name[0]); |
| | | } |
| | | } |
| | | List<Integer> pageList = PageUtil.getPage(PageUtil.getLocPage(page, curPage), page, minPage); |
| | | JSONObject json = new JSONObject(); |
| | | json.put("dataList", iconManagementList); |
| | |
| | | return json.toString(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/uploadIcon.do") |
| | | @RequestMapping({"/uploadIcon.do"}) |
| | | public String upload(@RequestParam("file") MultipartFile[] files, HttpServletRequest request) { |
| | | String toPage = "redirect:/iconManagement.do"; |
| | | String filePath1 = Config.getIconPath() + "/"; |
| | | String filePath2 = request.getServletContext().getRealPath("/") + "hxzk/image/targeticon/"; |
| | | |
| | | File existFile2; |
| | | MultipartFile[] var7; |
| | | int var8; |
| | | int var9; |
| | | MultipartFile file; |
| | | try { |
| | | File existFile1 = new File(filePath1); |
| | | if (!existFile1.exists()) { |
| | | existFile1.mkdir(); |
| | | } |
| | | for (MultipartFile file : files) { |
| | | file.transferTo(new File(filePath1 + file.getOriginalFilename())); |
| | | } |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | try { |
| | | File existFile2 = new File(filePath2); |
| | | existFile2 = new File(filePath1); |
| | | if (!existFile2.exists()) { |
| | | existFile2.mkdir(); |
| | | } |
| | | for (MultipartFile file : files) { |
| | | |
| | | var7 = files; |
| | | var8 = files.length; |
| | | |
| | | for(var9 = 0; var9 < var8; ++var9) { |
| | | file = var7[var9]; |
| | | file.transferTo(new File(filePath1 + file.getOriginalFilename())); |
| | | } |
| | | } catch (IOException var12) { |
| | | var12.printStackTrace(); |
| | | } |
| | | |
| | | try { |
| | | existFile2 = new File(filePath2); |
| | | if (!existFile2.exists()) { |
| | | existFile2.mkdir(); |
| | | } |
| | | |
| | | var7 = files; |
| | | var8 = files.length; |
| | | |
| | | for(var9 = 0; var9 < var8; ++var9) { |
| | | file = var7[var9]; |
| | | file.transferTo(new File(filePath2 + file.getOriginalFilename())); |
| | | } |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } catch (IOException var11) { |
| | | var11.printStackTrace(); |
| | | } |
| | | |
| | | return toPage; |
| | | } |
| | | |
| | | @RequestMapping(value = "/iconManagement_add.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | @RequestMapping( |
| | | value = {"/iconManagement_add.do"}, |
| | | method = {RequestMethod.POST, RequestMethod.GET} |
| | | ) |
| | | public void iconManagement_add(HttpServletRequest request) { |
| | | tb_icon icon = new tb_icon(); |
| | | icon.setIcon_name(request.getParameter("name")); |
| | | icon.setIcon_adress("image/targeticon/" + request.getParameter("filePath")); |
| | | icon.setBeizhu(request.getParameter("beizhu")); |
| | | basicInfoService.iconManagement_add(icon); |
| | | this.basicInfoService.iconManagement_add(icon); |
| | | } |
| | | |
| | | @RequestMapping(value = "/iconManagement_check.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | @RequestMapping( |
| | | value = {"/iconManagement_check.do"}, |
| | | method = {RequestMethod.POST, RequestMethod.GET} |
| | | ) |
| | | @ResponseBody |
| | | public String iconManagement_check(HttpServletRequest request) { |
| | | String iconName = (request.getParameter("name")); |
| | | int exist = basicInfoService.iconManagement_check(iconName); |
| | | String iconName = request.getParameter("name"); |
| | | int exist = this.basicInfoService.iconManagement_check(iconName); |
| | | return String.valueOf(exist); |
| | | } |
| | | |
| | | @ResponseBody |
| | | @RequestMapping(value = "/iconManagement_delete.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | @RequestMapping( |
| | | value = {"/iconManagement_delete.do"}, |
| | | method = {RequestMethod.POST, RequestMethod.GET} |
| | | ) |
| | | public void iconManagement_delete(HttpServletRequest request) { |
| | | String checkValStr = request.getParameter("checkVal"); |
| | | checkValStr = checkValStr.replaceAll("\"", ""); |
| | | String[] checkVal = checkValStr.split(","); |
| | | basicInfoService.iconManagement_delete(checkVal); |
| | | this.basicInfoService.iconManagement_delete(checkVal); |
| | | } |
| | | |
| | | @RequestMapping(value = "/departmentManagement.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | @RequestMapping( |
| | | value = {"/departmentManagement.do"}, |
| | | method = {RequestMethod.POST, RequestMethod.GET} |
| | | ) |
| | | public String departmentManagement(HttpServletRequest request) { |
| | | String toPage = "forward:/hxzk/basicInfo/departmentManagement.jsp"; |
| | | List<tb_department> departmentManagementList = basicInfoService.getDepartmentManagement(1); |
| | | List<tb_department> departmentManagementList = this.basicInfoService.getDepartmentManagement(1); |
| | | request.setAttribute("departmentManagementList", departmentManagementList); |
| | | List<tb_icon> iconList = basicInfoService.getIconList(); |
| | | List<tb_icon> iconList = this.basicInfoService.getIconList(); |
| | | request.setAttribute("iconList", iconList); |
| | | int curPage = 1; |
| | | int count = basicInfoService.getDepartmentManagementCount(); |
| | | int count = this.basicInfoService.getDepartmentManagementCount(); |
| | | int minPage = PageUtil.getMinPage(count); |
| | | request.setAttribute("pageList", PageUtil.getPage(minPage)); |
| | | request.setAttribute("curPage", curPage); |
| | | request.setAttribute("curPage", Integer.valueOf(curPage)); |
| | | return toPage; |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @RequestMapping(value = "/jiedepartment.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | @RequestMapping( |
| | | value = {"/jiedepartment.do"}, |
| | | method = {RequestMethod.POST, RequestMethod.GET} |
| | | ) |
| | | public JSONObject jiedepartment(HttpServletRequest request) { |
| | | JSONObject json = new JSONObject(); |
| | | List<tb_department> departmentManagementList = basicInfoService.getDepartmentManagement2(); |
| | | List<tb_nav> navList = zhwService.getnav(); |
| | | List<tb_department> departmentManagementList = this.basicInfoService.getDepartmentManagement2(); |
| | | List<tb_nav> navList = this.zhwService.getnav(); |
| | | json.put("dataList", departmentManagementList); |
| | | json.put("dataList2", navList); |
| | | return json; |
| | | } |
| | | |
| | | @ResponseBody |
| | | @RequestMapping(value = "/departmentManagement_page.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | @RequestMapping( |
| | | value = {"/departmentManagement_page.do"}, |
| | | method = {RequestMethod.POST, RequestMethod.GET} |
| | | ) |
| | | public String departmentManagement_page(HttpServletRequest request) { |
| | | String pageStr = request.getParameter("page"); |
| | | String curPageStr = request.getParameter("curPage"); |
| | | int count = basicInfoService.getDepartmentManagementCount(); |
| | | int count = this.basicInfoService.getDepartmentManagementCount(); |
| | | int minPage = PageUtil.getMinPage(count); |
| | | int curPage = Integer.parseInt(curPageStr); |
| | | int page = 1; |
| | |
| | | } else { |
| | | page = Integer.parseInt(pageStr); |
| | | } |
| | | List<tb_department> departmentManagementList = basicInfoService.getDepartmentManagement(page); |
| | | |
| | | List<tb_department> departmentManagementList = this.basicInfoService.getDepartmentManagement(page); |
| | | List<Integer> pageList = PageUtil.getPage(PageUtil.getLocPage(page, curPage), page, minPage); |
| | | JSONObject json = new JSONObject(); |
| | | json.put("dataList", departmentManagementList); |
| | |
| | | } |
| | | |
| | | @ResponseBody |
| | | @RequestMapping(value = "/departmentManagement_search.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | @RequestMapping( |
| | | value = {"/departmentManagement_search.do"}, |
| | | method = {RequestMethod.POST, RequestMethod.GET} |
| | | ) |
| | | public String departmentManagement_search(HttpServletRequest request) { |
| | | String input = request.getParameter("input"); |
| | | int curPage = 1; |
| | | List<Integer> pageList = new ArrayList<Integer>(); |
| | | List<tb_department> departmentManagementList = basicInfoService.searchDepartmentManagement(input); |
| | | List<Integer> pageList = new ArrayList(); |
| | | List<tb_department> departmentManagementList = this.basicInfoService.searchDepartmentManagement(input); |
| | | pageList.add(1); |
| | | JSONObject json = new JSONObject(); |
| | | json.put("dataList", departmentManagementList); |
| | | json.put("pageList", pageList); |
| | | json.put("curPage", curPage); |
| | | json.put("curPage", Integer.valueOf(curPage)); |
| | | return json.toString(); |
| | | } |
| | | |
| | | @ResponseBody |
| | | @RequestMapping(value = "/departmentManagement_delete.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | @RequestMapping( |
| | | value = {"/departmentManagement_delete.do"}, |
| | | method = {RequestMethod.POST, RequestMethod.GET} |
| | | ) |
| | | public void departmentManagement_delete(HttpServletRequest request) { |
| | | String checkValStr = request.getParameter("checkVal"); |
| | | checkValStr = checkValStr.replaceAll("\"", ""); |
| | | String[] checkVal = checkValStr.split(","); |
| | | basicInfoService.departmentManagement_delete(checkVal); |
| | | for(int i = 0;i < checkVal.length;i++) { |
| | | String xieyi = "BSTOCS1,DELETEBUMEN,"+checkVal[i]+",END"; |
| | | this.basicInfoService.departmentManagement_delete(checkVal); |
| | | |
| | | for(int i = 0; i < checkVal.length; ++i) { |
| | | String xieyi = "BSTOCS1,DELETEBUMEN," + checkVal[i] + ",END"; |
| | | Udp_Out.udp_to_cs(xieyi); |
| | | } |
| | | |
| | | } |
| | | |
| | | @ResponseBody |
| | | @RequestMapping(value = "/departmentManagement_deleteAll.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | @RequestMapping( |
| | | value = {"/departmentManagement_deleteAll.do"}, |
| | | method = {RequestMethod.POST, RequestMethod.GET} |
| | | ) |
| | | public void departmentManagement_deleteAll(HttpServletRequest request) { |
| | | basicInfoService.departmentManagement_deleteAll(); |
| | | this.basicInfoService.departmentManagement_deleteAll(); |
| | | String xieyi = "BSTOCS1,DELETEALLBUMEN,END"; |
| | | Udp_Out.udp_to_cs(xieyi); |
| | | } |
| | | |
| | | @RequestMapping(value = "/departmentManagement_add.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | @RequestMapping( |
| | | value = {"/departmentManagement_add.do"}, |
| | | method = {RequestMethod.POST, RequestMethod.GET} |
| | | ) |
| | | public void departmentManagement_add(HttpServletRequest request) { |
| | | tb_department department = new tb_department(); |
| | | department.setDepartmentName(request.getParameter("addName")); |
| | | department.setIconadress(request.getParameter("addIcon")); |
| | | basicInfoService.departmentManagement_add(department); |
| | | String xieyi = "BSTOCS1,ADDBUMEN,"+department.getDepartmentName()+","+department.getIconadress()+",END"; |
| | | this.basicInfoService.departmentManagement_add(department); |
| | | String xieyi = "BSTOCS1,ADDBUMEN," + department.getDepartmentName() + "," + department.getIconadress() + ",END"; |
| | | Udp_Out.udp_to_cs(xieyi); |
| | | } |
| | | |
| | | @RequestMapping(value = "/departmentManagement_check.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | @RequestMapping( |
| | | value = {"/departmentManagement_check.do"}, |
| | | method = {RequestMethod.POST, RequestMethod.GET} |
| | | ) |
| | | @ResponseBody |
| | | public String departmentManagement_check(HttpServletRequest request) { |
| | | String name = (request.getParameter("name")); |
| | | int exist = basicInfoService.departmentManagement_check(name); |
| | | String name = request.getParameter("name"); |
| | | int exist = this.basicInfoService.departmentManagement_check(name); |
| | | return String.valueOf(exist); |
| | | } |
| | | |
| | | @RequestMapping(value = "/departmentManagement_modify.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | @RequestMapping( |
| | | value = {"/departmentManagement_modify.do"}, |
| | | method = {RequestMethod.POST, RequestMethod.GET} |
| | | ) |
| | | public void departmentManagement_modify(HttpServletRequest request) { |
| | | tb_department department = new tb_department(); |
| | | department.setId(Integer.parseInt(request.getParameter("id"))); |
| | | department.setDepartmentName(request.getParameter("addName")); |
| | | department.setIconadress(request.getParameter("addIcon")); |
| | | basicInfoService.departmentManagement_modify(department); |
| | | String xieyi = "BSTOCS1,ALTERBUMEN,"+department.getDepartmentName()+","+department.getIconadress()+",END"; |
| | | this.basicInfoService.departmentManagement_modify(department); |
| | | String xieyi = "BSTOCS1,ALTERBUMEN," + department.getDepartmentName() + "," + department.getIconadress() + ",END"; |
| | | Udp_Out.udp_to_cs(xieyi); |
| | | } |
| | | |
| | | // 对象转数组 |
| | | public static List<Object[]> objectToArray(List<tb_department> departmentManagementList) { |
| | | List<Object[]> reList = new ArrayList<>(); |
| | | for (int i = 0; i < departmentManagementList.size(); i++) { |
| | | List<String> words = new ArrayList<String>(); |
| | | tb_department department = (tb_department) departmentManagementList.get(i); |
| | | List<Object[]> reList = new ArrayList(); |
| | | |
| | | for(int i = 0; i < departmentManagementList.size(); ++i) { |
| | | List<String> words = new ArrayList(); |
| | | tb_department department = (tb_department)departmentManagementList.get(i); |
| | | words.add(department.getDepartmentName()); |
| | | words.add(department.getIconadress()); |
| | | words.add(String.valueOf(department.getAddtime())); |
| | | String[] array = words.toArray(new String[0]); |
| | | String[] array = (String[])words.toArray(new String[0]); |
| | | reList.add(array); |
| | | } |
| | | |
| | | return reList; |
| | | } |
| | | |
| | | @ResponseBody |
| | | @RequestMapping(value = "/departmentManagement_export.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | @RequestMapping( |
| | | value = {"/departmentManagement_export.do"}, |
| | | method = {RequestMethod.POST, RequestMethod.GET} |
| | | ) |
| | | public String departmentManagement_export(HttpServletRequest request, HttpServletResponse response) { |
| | | String toPage = "forward:/hxzk/basicInfo/departmentManagement.jsp"; |
| | | List<tb_department> departmentManagementList = basicInfoService.getDepartmentManagement(); |
| | | String[] rowName = { "部门名称", "图标预览", "添加时间" }; |
| | | List<tb_department> departmentManagementList = this.basicInfoService.getDepartmentManagement(); |
| | | String[] rowName = new String[]{"部门名称", "图标预览", "添加时间"}; |
| | | List<Object[]> dataList = objectToArray(departmentManagementList); |
| | | ExcelUtils excel = new ExcelUtils("部门管理", rowName, dataList); |
| | | OutputStream out; |
| | | |
| | | try { |
| | | String fileName = "Excel-" + String.valueOf(System.currentTimeMillis()).substring(4, 13) + ".xls"; |
| | | String headStr = "attachment; filename=\"" + fileName + "\""; |
| | | response.setContentType("APPLICATION/OCTET-STREAM"); |
| | | response.setHeader("Content-Disposition", headStr); |
| | | out = response.getOutputStream(); |
| | | OutputStream out = response.getOutputStream(); |
| | | excel.export(out); |
| | | out.flush(); |
| | | out.close(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } catch (Exception var11) { |
| | | var11.printStackTrace(); |
| | | } |
| | | |
| | | return toPage; |
| | | } |
| | | |
| | | @RequestMapping(value = "/personManagement.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | @RequestMapping( |
| | | value = {"/personManagement.do"}, |
| | | method = {RequestMethod.POST, RequestMethod.GET} |
| | | ) |
| | | public String personManagement(HttpServletRequest request) { |
| | | String toPage = "forward:/hxzk/basicInfo/personManagement.jsp"; |
| | | List<tb_person> personManagementList = basicInfoService.getPersonManagement(1); |
| | | List<tb_person> personManagementList = this.basicInfoService.getPersonManagement(1); |
| | | request.setAttribute("personManagementList", personManagementList); |
| | | List<tb_department> departmentList = basicInfoService.getDepartmentList(); |
| | | List<tb_department> departmentList = this.basicInfoService.getDepartmentList(); |
| | | request.setAttribute("departmentList", departmentList); |
| | | int curPage = 1; |
| | | int count = basicInfoService.getPersonManagementCount(); |
| | | int count = this.basicInfoService.getPersonManagementCount(); |
| | | int minPage = PageUtil.getMinPage(count); |
| | | request.setAttribute("pageList", PageUtil.getPage(minPage)); |
| | | request.setAttribute("curPage", curPage); |
| | | request.setAttribute("curPage", Integer.valueOf(curPage)); |
| | | return toPage; |
| | | } |
| | | |
| | | @RequestMapping(value = "/cheliangManagement.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | |
| | | @RequestMapping( |
| | | value = {"/cheliangManagement.do"}, |
| | | method = {RequestMethod.POST, RequestMethod.GET} |
| | | ) |
| | | public String cheliangManagement(HttpServletRequest request) { |
| | | String toPage = "forward:/hxzk/basicInfo/cheliangManagement.jsp"; |
| | | List<tb_person> personManagementList = basicInfoService.getPersonManagement2(1); |
| | | List<tb_person> personManagementList = this.basicInfoService.getPersonManagement2(1); |
| | | request.setAttribute("personManagementList", personManagementList); |
| | | List<tb_department> departmentList = basicInfoService.getDepartmentList(); |
| | | List<tb_department> departmentList = this.basicInfoService.getDepartmentList(); |
| | | request.setAttribute("departmentList", departmentList); |
| | | int curPage = 1; |
| | | int count = basicInfoService.getPersonManagementCount2(); |
| | | int count = this.basicInfoService.getPersonManagementCount2(); |
| | | int minPage = PageUtil.getMinPage(count); |
| | | request.setAttribute("pageList", PageUtil.getPage(minPage)); |
| | | request.setAttribute("curPage", curPage); |
| | | request.setAttribute("curPage", Integer.valueOf(curPage)); |
| | | return toPage; |
| | | } |
| | | |
| | | @RequestMapping(value = "/wuziManagement.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | |
| | | @RequestMapping( |
| | | value = {"/wuziManagement.do"}, |
| | | method = {RequestMethod.POST, RequestMethod.GET} |
| | | ) |
| | | public String wuziManagement(HttpServletRequest request) { |
| | | String toPage = "forward:/hxzk/basicInfo/wuziManagement.jsp"; |
| | | List<tb_person> personManagementList = basicInfoService.getPersonManagement3(1); |
| | | List<tb_person> personManagementList = this.basicInfoService.getPersonManagement3(1); |
| | | request.setAttribute("personManagementList", personManagementList); |
| | | List<tb_department> departmentList = basicInfoService.getDepartmentList(); |
| | | List<tb_department> departmentList = this.basicInfoService.getDepartmentList(); |
| | | request.setAttribute("departmentList", departmentList); |
| | | int curPage = 1; |
| | | int count = basicInfoService.getPersonManagementCount3(); |
| | | int count = this.basicInfoService.getPersonManagementCount3(); |
| | | int minPage = PageUtil.getMinPage(count); |
| | | request.setAttribute("pageList", PageUtil.getPage(minPage)); |
| | | request.setAttribute("curPage", curPage); |
| | | request.setAttribute("curPage", Integer.valueOf(curPage)); |
| | | return toPage; |
| | | } |
| | | |
| | | @RequestMapping(value = "/personManagement2.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | |
| | | @RequestMapping( |
| | | value = {"/personManagement2.do"}, |
| | | method = {RequestMethod.POST, RequestMethod.GET} |
| | | ) |
| | | public String personManagement2(HttpServletRequest request) { |
| | | String toPage = "forward:/hxzk/basicInfo/personManagement.jsp"; |
| | | List<tb_person> personManagementList = basicInfoService.getPersonManagement4(1); |
| | | List<tb_person> personManagementList = this.basicInfoService.getPersonManagement4(1); |
| | | request.setAttribute("personManagementList", personManagementList); |
| | | List<tb_department> departmentList = basicInfoService.getDepartmentList(); |
| | | List<tb_department> departmentList = this.basicInfoService.getDepartmentList(); |
| | | request.setAttribute("departmentList", departmentList); |
| | | int curPage = 1; |
| | | int count = basicInfoService.getPersonManagementCount4(); |
| | | int count = this.basicInfoService.getPersonManagementCount4(); |
| | | int minPage = PageUtil.getMinPage(count); |
| | | request.setAttribute("pageList", PageUtil.getPage(minPage)); |
| | | request.setAttribute("curPage", curPage); |
| | | request.setAttribute("curPage", Integer.valueOf(curPage)); |
| | | return toPage; |
| | | } |
| | | |
| | | @ResponseBody |
| | | @RequestMapping(value = "/personManagement_page.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | @RequestMapping( |
| | | value = {"/personManagement_page.do"}, |
| | | method = {RequestMethod.POST, RequestMethod.GET} |
| | | ) |
| | | public String personManagement_page(HttpServletRequest request) { |
| | | String pageStr = request.getParameter("page"); |
| | | String curPageStr = request.getParameter("curPage"); |
| | | int count = basicInfoService.getPersonManagementCount(); |
| | | int count = this.basicInfoService.getPersonManagementCount(); |
| | | int minPage = PageUtil.getMinPage(count); |
| | | int curPage = Integer.parseInt(curPageStr); |
| | | int page = 1; |
| | |
| | | } else { |
| | | page = Integer.parseInt(pageStr); |
| | | } |
| | | List<tb_person> personManagementList = basicInfoService.getPersonManagement(page); |
| | | |
| | | List<tb_person> personManagementList = this.basicInfoService.getPersonManagement(page); |
| | | List<Integer> pageList = PageUtil.getPage(PageUtil.getLocPage(page, curPage), page, minPage); |
| | | JSONObject json = new JSONObject(); |
| | | json.put("dataList", personManagementList); |
| | |
| | | json.put("curPage", page); |
| | | return json.toString(); |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @RequestMapping(value = "/personManagement_page2.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | @RequestMapping( |
| | | value = {"/personManagement_page2.do"}, |
| | | method = {RequestMethod.POST, RequestMethod.GET} |
| | | ) |
| | | public String personManagement_page2(HttpServletRequest request) { |
| | | String pageStr = request.getParameter("page"); |
| | | String curPageStr = request.getParameter("curPage"); |
| | | int count = basicInfoService.getPersonManagementCount2(); |
| | | int count = this.basicInfoService.getPersonManagementCount2(); |
| | | int minPage = PageUtil.getMinPage(count); |
| | | int curPage = Integer.parseInt(curPageStr); |
| | | int page = 1; |
| | |
| | | } else { |
| | | page = Integer.parseInt(pageStr); |
| | | } |
| | | List<tb_person> personManagementList = basicInfoService.getPersonManagement2(page); |
| | | |
| | | List<tb_person> personManagementList = this.basicInfoService.getPersonManagement2(page); |
| | | List<Integer> pageList = PageUtil.getPage(PageUtil.getLocPage(page, curPage), page, minPage); |
| | | JSONObject json = new JSONObject(); |
| | | json.put("dataList", personManagementList); |
| | |
| | | json.put("curPage", page); |
| | | return json.toString(); |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @RequestMapping(value = "/personManagement_page3.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | @RequestMapping( |
| | | value = {"/personManagement_page3.do"}, |
| | | method = {RequestMethod.POST, RequestMethod.GET} |
| | | ) |
| | | public String personManagement_page3(HttpServletRequest request) { |
| | | String pageStr = request.getParameter("page"); |
| | | String curPageStr = request.getParameter("curPage"); |
| | | int count = basicInfoService.getPersonManagementCount3(); |
| | | int count = this.basicInfoService.getPersonManagementCount3(); |
| | | int minPage = PageUtil.getMinPage(count); |
| | | int curPage = Integer.parseInt(curPageStr); |
| | | int page = 1; |
| | |
| | | } else { |
| | | page = Integer.parseInt(pageStr); |
| | | } |
| | | List<tb_person> personManagementList = basicInfoService.getPersonManagement3(page); |
| | | |
| | | List<tb_person> personManagementList = this.basicInfoService.getPersonManagement3(page); |
| | | List<Integer> pageList = PageUtil.getPage(PageUtil.getLocPage(page, curPage), page, minPage); |
| | | JSONObject json = new JSONObject(); |
| | | json.put("dataList", personManagementList); |
| | |
| | | json.put("curPage", page); |
| | | return json.toString(); |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @RequestMapping(value = "/personManagement_page4.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | @RequestMapping( |
| | | value = {"/personManagement_page4.do"}, |
| | | method = {RequestMethod.POST, RequestMethod.GET} |
| | | ) |
| | | public String personManagement_page4(HttpServletRequest request) { |
| | | String pageStr = request.getParameter("page"); |
| | | String curPageStr = request.getParameter("curPage"); |
| | | int count = basicInfoService.getPersonManagementCount4(); |
| | | int count = this.basicInfoService.getPersonManagementCount4(); |
| | | int minPage = PageUtil.getMinPage(count); |
| | | int curPage = Integer.parseInt(curPageStr); |
| | | int page = 1; |
| | |
| | | } else { |
| | | page = Integer.parseInt(pageStr); |
| | | } |
| | | List<tb_person> personManagementList = basicInfoService.getPersonManagement4(page); |
| | | |
| | | List<tb_person> personManagementList = this.basicInfoService.getPersonManagement4(page); |
| | | List<Integer> pageList = PageUtil.getPage(PageUtil.getLocPage(page, curPage), page, minPage); |
| | | JSONObject json = new JSONObject(); |
| | | json.put("dataList", personManagementList); |
| | |
| | | } |
| | | |
| | | @ResponseBody |
| | | @RequestMapping(value = "/personManagement_search.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | @RequestMapping( |
| | | value = {"/personManagement_search.do"}, |
| | | method = {RequestMethod.POST, RequestMethod.GET} |
| | | ) |
| | | public String personManagement_search(HttpServletRequest request) throws IOException { |
| | | JSONObject json = new JSONObject(); |
| | | String input = request.getParameter("input"); |
| | | if (("").equals(input) || input == null) { |
| | | List personManagementList; |
| | | if (!"".equals(input) && input != null) { |
| | | int curPage = 1; |
| | | List<Integer> pageList = new ArrayList(); |
| | | personManagementList = this.basicInfoService.searchPersonManagement(input); |
| | | pageList.add(1); |
| | | json.put("dataList", personManagementList); |
| | | json.put("pageList", pageList); |
| | | json.put("curPage", Integer.valueOf(curPage)); |
| | | } else { |
| | | String jsonString = RequestUtils.getRequestJsonString(request, Config.getCharset()); |
| | | tb_tag tag = (tb_tag) JSONObject.toBean(JSONObject.fromObject(jsonString), tb_tag.class); |
| | | tb_tag tag = (tb_tag)JSONObject.toBean(JSONObject.fromObject(jsonString), tb_tag.class); |
| | | input = tag.getTag_id(); |
| | | List<tb_person> personManagementList = basicInfoService.searchPersonManagement(input); |
| | | if (personManagementList.size()>0){ |
| | | personManagementList = this.basicInfoService.searchPersonManagement(input); |
| | | if (personManagementList.size() > 0) { |
| | | json.put("result", personManagementList.get(0)); |
| | | } else { |
| | | json.put("result", "null"); |
| | | } |
| | | } else { |
| | | int curPage = 1; |
| | | List<Integer> pageList = new ArrayList<Integer>(); |
| | | List<tb_person> personManagementList = basicInfoService.searchPersonManagement(input); |
| | | pageList.add(1); |
| | | json.put("dataList", personManagementList); |
| | | json.put("pageList", pageList); |
| | | json.put("curPage", curPage); |
| | | } |
| | | return json.toString(); |
| | | } |
| | | |
| | | @ResponseBody |
| | | @RequestMapping(value = "/personManagement_search2.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | public String personManagement_search2(HttpServletRequest request) throws IOException { |
| | | JSONObject json = new JSONObject(); |
| | | String input = request.getParameter("input"); |
| | | 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_person> personManagementList = basicInfoService.searchPersonManagement2(input); |
| | | if (personManagementList.size()>0){ |
| | | json.put("result", personManagementList.get(0)); |
| | | } else { |
| | | json.put("result", "null"); |
| | | } |
| | | } else { |
| | | int curPage = 1; |
| | | List<Integer> pageList = new ArrayList<Integer>(); |
| | | List<tb_person> personManagementList = basicInfoService.searchPersonManagement2(input); |
| | | pageList.add(1); |
| | | json.put("dataList", personManagementList); |
| | | json.put("pageList", pageList); |
| | | json.put("curPage", curPage); |
| | | } |
| | | return json.toString(); |
| | | } |
| | | |
| | | @ResponseBody |
| | | @RequestMapping(value = "/personManagement_search3.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | public String personManagement_search3(HttpServletRequest request) throws IOException { |
| | | JSONObject json = new JSONObject(); |
| | | String input = request.getParameter("input"); |
| | | 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_person> personManagementList = basicInfoService.searchPersonManagement3(input); |
| | | if (personManagementList.size()>0){ |
| | | json.put("result", personManagementList.get(0)); |
| | | } else { |
| | | json.put("result", "null"); |
| | | } |
| | | } else { |
| | | int curPage = 1; |
| | | List<Integer> pageList = new ArrayList<Integer>(); |
| | | List<tb_person> personManagementList = basicInfoService.searchPersonManagement3(input); |
| | | pageList.add(1); |
| | | json.put("dataList", personManagementList); |
| | | json.put("pageList", pageList); |
| | | json.put("curPage", curPage); |
| | | } |
| | | return json.toString(); |
| | | } |
| | | |
| | | @ResponseBody |
| | | @RequestMapping(value = "/personManagement_search4.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | public String personManagement_search4(HttpServletRequest request) throws IOException { |
| | | JSONObject json = new JSONObject(); |
| | | String input = request.getParameter("input"); |
| | | 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_person> personManagementList = basicInfoService.searchPersonManagement4(input); |
| | | if (personManagementList.size()>0){ |
| | | json.put("result", personManagementList.get(0)); |
| | | } else { |
| | | json.put("result", "null"); |
| | | } |
| | | } else { |
| | | int curPage = 1; |
| | | List<Integer> pageList = new ArrayList<Integer>(); |
| | | List<tb_person> personManagementList = basicInfoService.searchPersonManagement4(input); |
| | | pageList.add(1); |
| | | json.put("dataList", personManagementList); |
| | | json.put("pageList", pageList); |
| | | json.put("curPage", curPage); |
| | | } |
| | | |
| | | return json.toString(); |
| | | } |
| | | |
| | | @ResponseBody |
| | | @RequestMapping(value = "/personManagement_delete.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | @RequestMapping( |
| | | value = {"/personManagement_search2.do"}, |
| | | method = {RequestMethod.POST, RequestMethod.GET} |
| | | ) |
| | | public String personManagement_search2(HttpServletRequest request) throws IOException { |
| | | JSONObject json = new JSONObject(); |
| | | String input = request.getParameter("input"); |
| | | List personManagementList; |
| | | if (!"".equals(input) && input != null) { |
| | | int curPage = 1; |
| | | List<Integer> pageList = new ArrayList(); |
| | | personManagementList = this.basicInfoService.searchPersonManagement2(input); |
| | | pageList.add(1); |
| | | json.put("dataList", personManagementList); |
| | | json.put("pageList", pageList); |
| | | json.put("curPage", Integer.valueOf(curPage)); |
| | | } else { |
| | | String jsonString = RequestUtils.getRequestJsonString(request, Config.getCharset()); |
| | | tb_tag tag = (tb_tag)JSONObject.toBean(JSONObject.fromObject(jsonString), tb_tag.class); |
| | | input = tag.getTag_id(); |
| | | personManagementList = this.basicInfoService.searchPersonManagement2(input); |
| | | if (personManagementList.size() > 0) { |
| | | json.put("result", personManagementList.get(0)); |
| | | } else { |
| | | json.put("result", "null"); |
| | | } |
| | | } |
| | | |
| | | return json.toString(); |
| | | } |
| | | |
| | | @ResponseBody |
| | | @RequestMapping( |
| | | value = {"/personManagement_search3.do"}, |
| | | method = {RequestMethod.POST, RequestMethod.GET} |
| | | ) |
| | | public String personManagement_search3(HttpServletRequest request) throws IOException { |
| | | JSONObject json = new JSONObject(); |
| | | String input = request.getParameter("input"); |
| | | List personManagementList; |
| | | if (!"".equals(input) && input != null) { |
| | | int curPage = 1; |
| | | List<Integer> pageList = new ArrayList(); |
| | | personManagementList = this.basicInfoService.searchPersonManagement3(input); |
| | | pageList.add(1); |
| | | json.put("dataList", personManagementList); |
| | | json.put("pageList", pageList); |
| | | json.put("curPage", Integer.valueOf(curPage)); |
| | | } else { |
| | | String jsonString = RequestUtils.getRequestJsonString(request, Config.getCharset()); |
| | | tb_tag tag = (tb_tag)JSONObject.toBean(JSONObject.fromObject(jsonString), tb_tag.class); |
| | | input = tag.getTag_id(); |
| | | personManagementList = this.basicInfoService.searchPersonManagement3(input); |
| | | if (personManagementList.size() > 0) { |
| | | json.put("result", personManagementList.get(0)); |
| | | } else { |
| | | json.put("result", "null"); |
| | | } |
| | | } |
| | | |
| | | return json.toString(); |
| | | } |
| | | |
| | | @ResponseBody |
| | | @RequestMapping( |
| | | value = {"/personManagement_search4.do"}, |
| | | method = {RequestMethod.POST, RequestMethod.GET} |
| | | ) |
| | | public String personManagement_search4(HttpServletRequest request) throws IOException { |
| | | JSONObject json = new JSONObject(); |
| | | String input = request.getParameter("input"); |
| | | List personManagementList; |
| | | if (!"".equals(input) && input != null) { |
| | | int curPage = 1; |
| | | List<Integer> pageList = new ArrayList(); |
| | | personManagementList = this.basicInfoService.searchPersonManagement4(input); |
| | | pageList.add(1); |
| | | json.put("dataList", personManagementList); |
| | | json.put("pageList", pageList); |
| | | json.put("curPage", Integer.valueOf(curPage)); |
| | | } else { |
| | | String jsonString = RequestUtils.getRequestJsonString(request, Config.getCharset()); |
| | | tb_tag tag = (tb_tag)JSONObject.toBean(JSONObject.fromObject(jsonString), tb_tag.class); |
| | | input = tag.getTag_id(); |
| | | personManagementList = this.basicInfoService.searchPersonManagement4(input); |
| | | if (personManagementList.size() > 0) { |
| | | json.put("result", personManagementList.get(0)); |
| | | } else { |
| | | json.put("result", "null"); |
| | | } |
| | | } |
| | | |
| | | return json.toString(); |
| | | } |
| | | |
| | | @ResponseBody |
| | | @RequestMapping( |
| | | value = {"/personManagement_delete.do"}, |
| | | method = {RequestMethod.POST, RequestMethod.GET} |
| | | ) |
| | | public void personManagement_delete(HttpServletRequest request) { |
| | | String checkValStr = request.getParameter("checkVal"); |
| | | checkValStr = checkValStr.replaceAll("\"", ""); |
| | | String[] checkVal = checkValStr.split(","); |
| | | for (int i = 0; i < checkVal.length; i++) { |
| | | basicInfoService.personManagement_delete(checkVal[i]); |
| | | String xieyi = "BSTOCS1,DELETEFPERSON,"+checkVal[i]+",END"; |
| | | |
| | | for(int i = 0; i < checkVal.length; ++i) { |
| | | this.basicInfoService.personManagement_delete(checkVal[i]); |
| | | String xieyi = "BSTOCS1,DELETEFPERSON," + checkVal[i] + ",END"; |
| | | Udp_Out.udp_to_cs(xieyi); |
| | | } |
| | | // 删除tb_person同时需要删除标签 |
| | | labelService.labelManagement_delete(checkVal); |
| | | |
| | | this.labelService.labelManagement_delete(checkVal); |
| | | } |
| | | |
| | | @ResponseBody |
| | | @RequestMapping(value = "/personManagement_deleteAll.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | @RequestMapping( |
| | | value = {"/personManagement_deleteAll.do"}, |
| | | method = {RequestMethod.POST, RequestMethod.GET} |
| | | ) |
| | | public void personManagement_deleteAll(HttpServletRequest request) { |
| | | basicInfoService.personManagement_deleteAll(); |
| | | this.basicInfoService.personManagement_deleteAll(); |
| | | String xieyi = "BSTOCS1,DELETEALLPERSON,END"; |
| | | Udp_Out.udp_to_cs(xieyi); |
| | | // 删除tb_person同时需要删除标签 |
| | | labelService.labelManagement_deleteAll(); |
| | | this.labelService.labelManagement_deleteAll(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/personManagement_modify.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | @RequestMapping( |
| | | value = {"/personManagement_modify.do"}, |
| | | method = {RequestMethod.POST, RequestMethod.GET} |
| | | ) |
| | | public void personManagement_modify(HttpServletRequest request) { |
| | | tb_person person = new tb_person(); |
| | | person.setP_tagid(request.getParameter("p_tagid")); |
| | |
| | | person.setP_name(request.getParameter("p_name")); |
| | | person.setP_sex(request.getParameter("p_sex")); |
| | | person.setP_phone(request.getParameter("p_phone")); |
| | | // List<tb_department> departments = basicInfoService.searchDepartmentManagement(request.getParameter("p_department")); |
| | | // person.setP_image(departments.get(0).getIconadress()); |
| | | basicInfoService.personManagement_modify(person); |
| | | String xieyi = "BSTOCS1,ALTERPERSON,"+person.getP_name()+","+person.getP_tagid()+","+person.getP_sex()+","+person.getP_department()+","+person.getP_phone()+",END"; |
| | | this.basicInfoService.personManagement_modify(person); |
| | | String xieyi = "BSTOCS1,ALTERPERSON," + person.getP_name() + "," + person.getP_tagid() + "," + person.getP_sex() + "," + person.getP_department() + "," + person.getP_phone() + ",END"; |
| | | Udp_Out.udp_to_cs(xieyi); |
| | | // 修改tb_person同时需要修改标签 需要先查再改否则覆盖空 |
| | | List<tb_tag> searchLabelManagement = labelService.searchLabelManagement(person.getP_tagid()); |
| | | if(searchLabelManagement!=null){ |
| | | tb_tag tag = searchLabelManagement.get(0); |
| | | List<tb_tag> searchLabelManagement = this.labelService.searchLabelManagement(person.getP_tagid()); |
| | | if (searchLabelManagement != null) { |
| | | tb_tag tag = (tb_tag)searchLabelManagement.get(0); |
| | | tag.setState(person.getP_name()); |
| | | labelService.labelManagement_modify(tag); |
| | | this.labelService.labelManagement_modify(tag); |
| | | } |
| | | |
| | | } |
| | | |
| | | @RequestMapping(value = "/personManagement_modify2.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | |
| | | @RequestMapping( |
| | | value = {"/personManagement_modify2.do"}, |
| | | method = {RequestMethod.POST, RequestMethod.GET} |
| | | ) |
| | | public void personManagement_modify2(HttpServletRequest request) { |
| | | tb_person person = new tb_person(); |
| | | person.setP_tagid(request.getParameter("p_tagid")); |
| | | person.setP_department(request.getParameter("p_department")); |
| | | person.setP_name(request.getParameter("p_name")); |
| | | basicInfoService.personManagement_modify2(person); |
| | | String xieyi = "BSTOCS1,ALTERCAR,"+person.getP_name()+","+person.getP_tagid()+","+person.getP_department()+",END"; |
| | | this.basicInfoService.personManagement_modify2(person); |
| | | String xieyi = "BSTOCS1,ALTERCAR," + person.getP_name() + "," + person.getP_tagid() + "," + person.getP_department() + ",END"; |
| | | Udp_Out.udp_to_cs(xieyi); |
| | | // 修改tb_person同时需要修改标签 需要先查再改否则覆盖空 |
| | | List<tb_tag> searchLabelManagement = labelService.searchLabelManagement(person.getP_tagid()); |
| | | if(searchLabelManagement!=null){ |
| | | tb_tag tag = searchLabelManagement.get(0); |
| | | List<tb_tag> searchLabelManagement = this.labelService.searchLabelManagement(person.getP_tagid()); |
| | | if (searchLabelManagement != null) { |
| | | tb_tag tag = (tb_tag)searchLabelManagement.get(0); |
| | | tag.setState(person.getP_name()); |
| | | labelService.labelManagement_modify(tag); |
| | | this.labelService.labelManagement_modify(tag); |
| | | } |
| | | |
| | | } |
| | | |
| | | @RequestMapping(value = "/uploadPerson.do") |
| | | @RequestMapping({"/uploadPerson.do"}) |
| | | public String uploadPerson(@RequestParam("file") MultipartFile[] files, HttpServletRequest request) { |
| | | String toPage = "forward:/hxzk/basicInfo/personManagement.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) { |
| | | |
| | | MultipartFile[] var7 = files; |
| | | int var8 = files.length; |
| | | |
| | | for(int var9 = 0; var9 < var8; ++var9) { |
| | | MultipartFile file = var7[var9]; |
| | | file.transferTo(new File(filePath + file.getOriginalFilename())); |
| | | ////System.out.print(file.getOriginalFilename()); |
| | | } |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } catch (IOException var21) { |
| | | var21.printStackTrace(); |
| | | } |
| | | |
| | | int result = 0; |
| | | String path = filePath + filename; |
| | | // 选取Excel文件得到工作薄 |
| | | Workbook workbook; |
| | | |
| | | int i; |
| | | try { |
| | | File file = new File(path); |
| | | workbook = Workbook.getWorkbook(file); |
| | | // 选择工作表,通过Workbook的getSheet方法选择第一个工作表(从0开始) |
| | | Workbook workbook = Workbook.getWorkbook(file); |
| | | Sheet sheet = workbook.getSheet(0); |
| | | int rows = sheet.getRows(); |
| | | // 选择Cell,读取单元格 通过Sheet的getCell方法选择位置为C2的单元格(两个参数都从0开始) |
| | | for (int i = 3; i < rows; i++) { |
| | | // 读取信息,通过Cell的getContents方法读取单元格的值把单元格中的信息以字符的形式读取出来 |
| | | |
| | | for(i = 3; i < rows; ++i) { |
| | | String p_name = sheet.getCell(0, i).getContents(); |
| | | String p_tagid = sheet.getCell(1, i).getContents(); |
| | | String p_sex = sheet.getCell(2, i).getContents(); |
| | | String p_department = sheet.getCell(3, i).getContents(); |
| | | String p_phone = sheet.getCell(4, i).getContents(); |
| | | if (!("").equals(p_tagid)) { |
| | | if (!"".equals(p_tagid)) { |
| | | tb_person person = new tb_person(); |
| | | person.setP_name(p_name); |
| | | person.setP_tagid(p_tagid); |
| | | person.setP_sex(p_sex); |
| | | person.setP_department(p_department); |
| | | person.setP_phone(p_phone); |
| | | basicInfoService.personManagement_add(person); |
| | | this.basicInfoService.personManagement_add(person); |
| | | result = 1; |
| | | } |
| | | } |
| | | // 释放资源 |
| | | |
| | | workbook.close(); |
| | | } catch (BiffException e) { |
| | | e.printStackTrace(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } catch (BiffException var19) { |
| | | var19.printStackTrace(); |
| | | } catch (IOException var20) { |
| | | var20.printStackTrace(); |
| | | } |
| | | request.setAttribute("resultList", result); |
| | | List<tb_person> personManagementList = basicInfoService.getPersonManagement(1); |
| | | |
| | | request.setAttribute("resultList", Integer.valueOf(result)); |
| | | List<tb_person> personManagementList = this.basicInfoService.getPersonManagement(1); |
| | | request.setAttribute("personManagementList", personManagementList); |
| | | List<tb_department> departmentList = basicInfoService.getDepartmentList(); |
| | | List<tb_department> departmentList = this.basicInfoService.getDepartmentList(); |
| | | request.setAttribute("departmentList", departmentList); |
| | | int curPage = 1; |
| | | int count = basicInfoService.getPersonManagementCount(); |
| | | int minPage = PageUtil.getMinPage(count); |
| | | i = this.basicInfoService.getPersonManagementCount(); |
| | | int minPage = PageUtil.getMinPage(i); |
| | | request.setAttribute("pageList", PageUtil.getPage(minPage)); |
| | | request.setAttribute("curPage", curPage); |
| | | File file = new File(path); |
| | | file.delete(); |
| | | return toPage; |
| | | } |
| | | |
| | | @RequestMapping(value = "/uploadPerson2.do") |
| | | public String uploadPerson2(@RequestParam("file") MultipartFile[] files, HttpServletRequest request) { |
| | | String toPage = "forward:/hxzk/basicInfo/cheliangManagement.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 p_name = sheet.getCell(0, i).getContents(); |
| | | String p_tagid = sheet.getCell(1, i).getContents(); |
| | | String p_sex = ""; |
| | | String p_department = sheet.getCell(2, i).getContents(); |
| | | String p_phone = ""; |
| | | if (!("").equals(p_tagid)) { |
| | | tb_person person = new tb_person(); |
| | | person.setP_name(p_name); |
| | | person.setP_tagid(p_tagid); |
| | | person.setP_sex(p_sex); |
| | | person.setP_department(p_department); |
| | | person.setP_phone(p_phone); |
| | | basicInfoService.personManagement_add(person); |
| | | result = 1; |
| | | } |
| | | } |
| | | // 释放资源 |
| | | workbook.close(); |
| | | } catch (BiffException e) { |
| | | e.printStackTrace(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | request.setAttribute("resultList", result); |
| | | List<tb_person> personManagementList = basicInfoService.getPersonManagement2(1); |
| | | request.setAttribute("personManagementList", personManagementList); |
| | | List<tb_department> departmentList = basicInfoService.getDepartmentList(); |
| | | request.setAttribute("departmentList", departmentList); |
| | | int curPage = 1; |
| | | int count = basicInfoService.getPersonManagementCount2(); |
| | | 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 = "/uploadPerson3.do") |
| | | public String uploadPerson3(@RequestParam("file") MultipartFile[] files, HttpServletRequest request) { |
| | | String toPage = "forward:/hxzk/basicInfo/wuziManagement.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 p_name = sheet.getCell(0, i).getContents(); |
| | | String p_tagid = sheet.getCell(1, i).getContents(); |
| | | String p_sex = ""; |
| | | String p_department = sheet.getCell(2, i).getContents(); |
| | | String p_phone = ""; |
| | | if (!("").equals(p_tagid)) { |
| | | tb_person person = new tb_person(); |
| | | person.setP_name(p_name); |
| | | person.setP_tagid(p_tagid); |
| | | person.setP_sex(p_sex); |
| | | person.setP_department(p_department); |
| | | person.setP_phone(p_phone); |
| | | basicInfoService.personManagement_add(person); |
| | | result = 1; |
| | | } |
| | | } |
| | | // 释放资源 |
| | | workbook.close(); |
| | | } catch (BiffException e) { |
| | | e.printStackTrace(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | request.setAttribute("resultList", result); |
| | | List<tb_person> personManagementList = basicInfoService.getPersonManagement3(1); |
| | | request.setAttribute("personManagementList", personManagementList); |
| | | List<tb_department> departmentList = basicInfoService.getDepartmentList(); |
| | | request.setAttribute("departmentList", departmentList); |
| | | int curPage = 1; |
| | | int count = basicInfoService.getPersonManagementCount3(); |
| | | 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 = "/uploadPerson4.do") |
| | | public String uploadPerson4(@RequestParam("file") MultipartFile[] files, HttpServletRequest request) { |
| | | String toPage = "forward:/hxzk/basicInfo/personManagement.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 p_name = sheet.getCell(0, i).getContents(); |
| | | String p_tagid = sheet.getCell(1, i).getContents(); |
| | | String p_sex = sheet.getCell(2, i).getContents(); |
| | | String p_department = sheet.getCell(3, i).getContents(); |
| | | String p_phone = sheet.getCell(4, i).getContents(); |
| | | if (!("").equals(p_tagid)) { |
| | | tb_person person = new tb_person(); |
| | | person.setP_name(p_name); |
| | | person.setP_tagid(p_tagid); |
| | | person.setP_sex(p_sex); |
| | | person.setP_department(p_department); |
| | | person.setP_phone(p_phone); |
| | | basicInfoService.renyuandaoru(person); |
| | | tb_tag tag = new tb_tag(); |
| | | tag.setState(p_name); |
| | | tag.setTag_id(p_tagid); |
| | | labelService.updatetagname(tag); |
| | | result = 1; |
| | | } |
| | | } |
| | | // 释放资源 |
| | | workbook.close(); |
| | | } catch (BiffException e) { |
| | | e.printStackTrace(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | request.setAttribute("resultList", result); |
| | | List<tb_person> personManagementList = basicInfoService.getPersonManagement4(1); |
| | | request.setAttribute("personManagementList", personManagementList); |
| | | List<tb_department> departmentList = basicInfoService.getDepartmentList(); |
| | | request.setAttribute("departmentList", departmentList); |
| | | int curPage = 1; |
| | | int count = basicInfoService.getPersonManagementCount4(); |
| | | int minPage = PageUtil.getMinPage(count); |
| | | request.setAttribute("pageList", PageUtil.getPage(minPage)); |
| | | request.setAttribute("curPage", curPage); |
| | | request.setAttribute("curPage", Integer.valueOf(curPage)); |
| | | File file = new File(path); |
| | | file.delete(); |
| | | return toPage; |
| | | } |
| | | |
| | | // 对象转数组 |
| | | @RequestMapping({"/uploadPerson2.do"}) |
| | | public String uploadPerson2(@RequestParam("file") MultipartFile[] files, HttpServletRequest request) { |
| | | String toPage = "forward:/hxzk/basicInfo/cheliangManagement.jsp"; |
| | | String filePath = request.getServletContext().getRealPath("/") + "hxzk\\upload\\"; |
| | | String filename = files[0].getOriginalFilename(); |
| | | |
| | | try { |
| | | File existFile = new File(filePath); |
| | | if (!existFile.exists()) { |
| | | existFile.mkdir(); |
| | | } |
| | | |
| | | MultipartFile[] var7 = files; |
| | | int var8 = files.length; |
| | | |
| | | for(int var9 = 0; var9 < var8; ++var9) { |
| | | MultipartFile file = var7[var9]; |
| | | file.transferTo(new File(filePath + file.getOriginalFilename())); |
| | | } |
| | | } catch (IOException var21) { |
| | | var21.printStackTrace(); |
| | | } |
| | | |
| | | int result = 0; |
| | | String path = filePath + filename; |
| | | |
| | | int i; |
| | | try { |
| | | File file = new File(path); |
| | | Workbook workbook = Workbook.getWorkbook(file); |
| | | Sheet sheet = workbook.getSheet(0); |
| | | int rows = sheet.getRows(); |
| | | |
| | | for(i = 3; i < rows; ++i) { |
| | | String p_name = sheet.getCell(0, i).getContents(); |
| | | String p_tagid = sheet.getCell(1, i).getContents(); |
| | | String p_sex = ""; |
| | | String p_department = sheet.getCell(2, i).getContents(); |
| | | String p_phone = ""; |
| | | if (!"".equals(p_tagid)) { |
| | | tb_person person = new tb_person(); |
| | | person.setP_name(p_name); |
| | | person.setP_tagid(p_tagid); |
| | | person.setP_sex(p_sex); |
| | | person.setP_department(p_department); |
| | | person.setP_phone(p_phone); |
| | | this.basicInfoService.personManagement_add(person); |
| | | result = 1; |
| | | } |
| | | } |
| | | |
| | | workbook.close(); |
| | | } catch (BiffException var19) { |
| | | var19.printStackTrace(); |
| | | } catch (IOException var20) { |
| | | var20.printStackTrace(); |
| | | } |
| | | |
| | | request.setAttribute("resultList", Integer.valueOf(result)); |
| | | List<tb_person> personManagementList = this.basicInfoService.getPersonManagement2(1); |
| | | request.setAttribute("personManagementList", personManagementList); |
| | | List<tb_department> departmentList = this.basicInfoService.getDepartmentList(); |
| | | request.setAttribute("departmentList", departmentList); |
| | | int curPage = 1; |
| | | i = this.basicInfoService.getPersonManagementCount2(); |
| | | int minPage = PageUtil.getMinPage(i); |
| | | request.setAttribute("pageList", PageUtil.getPage(minPage)); |
| | | request.setAttribute("curPage", Integer.valueOf(curPage)); |
| | | File file = new File(path); |
| | | file.delete(); |
| | | return toPage; |
| | | } |
| | | |
| | | @RequestMapping({"/uploadPerson3.do"}) |
| | | public String uploadPerson3(@RequestParam("file") MultipartFile[] files, HttpServletRequest request) { |
| | | String toPage = "forward:/hxzk/basicInfo/wuziManagement.jsp"; |
| | | String filePath = request.getServletContext().getRealPath("/") + "hxzk\\upload\\"; |
| | | String filename = files[0].getOriginalFilename(); |
| | | |
| | | try { |
| | | File existFile = new File(filePath); |
| | | if (!existFile.exists()) { |
| | | existFile.mkdir(); |
| | | } |
| | | |
| | | MultipartFile[] var7 = files; |
| | | int var8 = files.length; |
| | | |
| | | for(int var9 = 0; var9 < var8; ++var9) { |
| | | MultipartFile file = var7[var9]; |
| | | file.transferTo(new File(filePath + file.getOriginalFilename())); |
| | | } |
| | | } catch (IOException var21) { |
| | | var21.printStackTrace(); |
| | | } |
| | | |
| | | int result = 0; |
| | | String path = filePath + filename; |
| | | |
| | | int i; |
| | | try { |
| | | File file = new File(path); |
| | | Workbook workbook = Workbook.getWorkbook(file); |
| | | Sheet sheet = workbook.getSheet(0); |
| | | int rows = sheet.getRows(); |
| | | |
| | | for(i = 3; i < rows; ++i) { |
| | | String p_name = sheet.getCell(0, i).getContents(); |
| | | String p_tagid = sheet.getCell(1, i).getContents(); |
| | | String p_sex = ""; |
| | | String p_department = sheet.getCell(2, i).getContents(); |
| | | String p_phone = ""; |
| | | if (!"".equals(p_tagid)) { |
| | | tb_person person = new tb_person(); |
| | | person.setP_name(p_name); |
| | | person.setP_tagid(p_tagid); |
| | | person.setP_sex(p_sex); |
| | | person.setP_department(p_department); |
| | | person.setP_phone(p_phone); |
| | | this.basicInfoService.personManagement_add(person); |
| | | result = 1; |
| | | } |
| | | } |
| | | |
| | | workbook.close(); |
| | | } catch (BiffException var19) { |
| | | var19.printStackTrace(); |
| | | } catch (IOException var20) { |
| | | var20.printStackTrace(); |
| | | } |
| | | |
| | | request.setAttribute("resultList", Integer.valueOf(result)); |
| | | List<tb_person> personManagementList = this.basicInfoService.getPersonManagement3(1); |
| | | request.setAttribute("personManagementList", personManagementList); |
| | | List<tb_department> departmentList = this.basicInfoService.getDepartmentList(); |
| | | request.setAttribute("departmentList", departmentList); |
| | | int curPage = 1; |
| | | i = this.basicInfoService.getPersonManagementCount3(); |
| | | int minPage = PageUtil.getMinPage(i); |
| | | request.setAttribute("pageList", PageUtil.getPage(minPage)); |
| | | request.setAttribute("curPage", Integer.valueOf(curPage)); |
| | | File file = new File(path); |
| | | file.delete(); |
| | | return toPage; |
| | | } |
| | | |
| | | @RequestMapping({"/uploadPerson4.do"}) |
| | | public String uploadPerson4(@RequestParam("file") MultipartFile[] files, HttpServletRequest request) { |
| | | String toPage = "forward:/hxzk/basicInfo/personManagement.jsp"; |
| | | String filePath = request.getServletContext().getRealPath("/") + "hxzk\\upload\\"; |
| | | String filename = files[0].getOriginalFilename(); |
| | | |
| | | try { |
| | | File existFile = new File(filePath); |
| | | if (!existFile.exists()) { |
| | | existFile.mkdir(); |
| | | } |
| | | |
| | | MultipartFile[] var7 = files; |
| | | int var8 = files.length; |
| | | |
| | | for(int var9 = 0; var9 < var8; ++var9) { |
| | | MultipartFile file = var7[var9]; |
| | | file.transferTo(new File(filePath + file.getOriginalFilename())); |
| | | } |
| | | } catch (IOException var22) { |
| | | var22.printStackTrace(); |
| | | } |
| | | |
| | | int result = 0; |
| | | String path = filePath + filename; |
| | | |
| | | int i; |
| | | try { |
| | | File file = new File(path); |
| | | Workbook workbook = Workbook.getWorkbook(file); |
| | | Sheet sheet = workbook.getSheet(0); |
| | | int rows = sheet.getRows(); |
| | | |
| | | for(i = 3; i < rows; ++i) { |
| | | String p_name = sheet.getCell(0, i).getContents(); |
| | | String p_tagid = sheet.getCell(1, i).getContents(); |
| | | String p_sex = sheet.getCell(2, i).getContents(); |
| | | String p_department = sheet.getCell(3, i).getContents(); |
| | | String p_phone = sheet.getCell(4, i).getContents(); |
| | | if (!"".equals(p_tagid)) { |
| | | tb_person person = new tb_person(); |
| | | person.setP_name(p_name); |
| | | person.setP_tagid(p_tagid); |
| | | person.setP_sex(p_sex); |
| | | person.setP_department(p_department); |
| | | person.setP_phone(p_phone); |
| | | this.basicInfoService.renyuandaoru(person); |
| | | tb_tag tag = new tb_tag(); |
| | | tag.setState(p_name); |
| | | tag.setTag_id(p_tagid); |
| | | this.labelService.updatetagname(tag); |
| | | result = 1; |
| | | } |
| | | } |
| | | |
| | | workbook.close(); |
| | | } catch (BiffException var20) { |
| | | var20.printStackTrace(); |
| | | } catch (IOException var21) { |
| | | var21.printStackTrace(); |
| | | } |
| | | |
| | | request.setAttribute("resultList", Integer.valueOf(result)); |
| | | List<tb_person> personManagementList = this.basicInfoService.getPersonManagement4(1); |
| | | request.setAttribute("personManagementList", personManagementList); |
| | | List<tb_department> departmentList = this.basicInfoService.getDepartmentList(); |
| | | request.setAttribute("departmentList", departmentList); |
| | | int curPage = 1; |
| | | i = this.basicInfoService.getPersonManagementCount4(); |
| | | int minPage = PageUtil.getMinPage(i); |
| | | request.setAttribute("pageList", PageUtil.getPage(minPage)); |
| | | request.setAttribute("curPage", Integer.valueOf(curPage)); |
| | | File file = new File(path); |
| | | file.delete(); |
| | | return toPage; |
| | | } |
| | | |
| | | public static List<Object[]> personobjectToArray(List<tb_person> personList) { |
| | | List<Object[]> reList = new ArrayList<>(); |
| | | for (int i = 0; i < personList.size(); i++) { |
| | | List<String> words = new ArrayList<String>(); |
| | | tb_person person = (tb_person) personList.get(i); |
| | | List<Object[]> reList = new ArrayList(); |
| | | |
| | | for(int i = 0; i < personList.size(); ++i) { |
| | | List<String> words = new ArrayList(); |
| | | tb_person person = (tb_person)personList.get(i); |
| | | words.add(String.valueOf(person.getId())); |
| | | words.add(person.getP_name()); |
| | | words.add(person.getP_tagid()); |
| | |
| | | words.add(person.getP_power()); |
| | | words.add(person.getP_image()); |
| | | words.add(person.getP_addtiem()); |
| | | String[] array = words.toArray(new String[0]); |
| | | String[] array = (String[])words.toArray(new String[0]); |
| | | reList.add(array); |
| | | } |
| | | |
| | | return reList; |
| | | } |
| | | |
| | | |
| | | public static List<Object[]> personobjectToArray2(List<tb_person> personList) { |
| | | List<Object[]> reList = new ArrayList<>(); |
| | | for (int i = 0; i < personList.size(); i++) { |
| | | List<String> words = new ArrayList<String>(); |
| | | tb_person person = (tb_person) personList.get(i); |
| | | List<Object[]> reList = new ArrayList(); |
| | | |
| | | for(int i = 0; i < personList.size(); ++i) { |
| | | List<String> words = new ArrayList(); |
| | | tb_person person = (tb_person)personList.get(i); |
| | | words.add(String.valueOf(person.getId())); |
| | | words.add(person.getP_name()); |
| | | words.add(person.getP_tagid()); |
| | |
| | | words.add(person.getP_power()); |
| | | words.add(person.getP_image()); |
| | | words.add(person.getP_addtiem()); |
| | | String[] array = words.toArray(new String[0]); |
| | | String[] array = (String[])words.toArray(new String[0]); |
| | | reList.add(array); |
| | | } |
| | | |
| | | return reList; |
| | | } |
| | | |
| | | // 对象转数组 |
| | | public static List<Object[]> personTemplateobjectToArray(List<tb_person> personList) { |
| | | List<Object[]> reList = new ArrayList<>(); |
| | | for (int i = 0; i < personList.size(); i++) { |
| | | List<String> words = new ArrayList<String>(); |
| | | tb_person person = (tb_person) personList.get(i); |
| | | words.add(person.getP_name()); |
| | | words.add(person.getP_tagid()); |
| | | words.add(person.getP_sex()); |
| | | words.add(person.getP_department()); |
| | | words.add(person.getP_phone()); |
| | | String[] array = words.toArray(new String[0]); |
| | | reList.add(array); |
| | | } |
| | | return reList; |
| | | } |
| | | |
| | | public static List<Object[]> personTemplateobjectToArray2(List<tb_person> personList) { |
| | | List<Object[]> reList = new ArrayList<>(); |
| | | for (int i = 0; i < personList.size(); i++) { |
| | | List<String> words = new ArrayList<String>(); |
| | | tb_person person = (tb_person) personList.get(i); |
| | | words.add(person.getP_name()); |
| | | words.add(person.getP_tagid()); |
| | | words.add(person.getP_department()); |
| | | String[] array = words.toArray(new String[0]); |
| | | reList.add(array); |
| | | } |
| | | return reList; |
| | | |
| | | public static List<Object[]> personTemplateobjectToArray(List<tb_person> personList) { |
| | | List<Object[]> reList = new ArrayList(); |
| | | |
| | | for(int i = 0; i < personList.size(); ++i) { |
| | | List<String> words = new ArrayList(); |
| | | tb_person person = (tb_person)personList.get(i); |
| | | words.add(person.getP_name()); |
| | | words.add(person.getP_tagid()); |
| | | words.add(person.getP_sex()); |
| | | words.add(person.getP_department()); |
| | | words.add(person.getP_phone()); |
| | | String[] array = (String[])words.toArray(new String[0]); |
| | | reList.add(array); |
| | | } |
| | | |
| | | return reList; |
| | | } |
| | | |
| | | public static List<Object[]> personTemplateobjectToArray2(List<tb_person> personList) { |
| | | List<Object[]> reList = new ArrayList(); |
| | | |
| | | for(int i = 0; i < personList.size(); ++i) { |
| | | List<String> words = new ArrayList(); |
| | | tb_person person = (tb_person)personList.get(i); |
| | | words.add(person.getP_name()); |
| | | words.add(person.getP_tagid()); |
| | | words.add(person.getP_department()); |
| | | String[] array = (String[])words.toArray(new String[0]); |
| | | reList.add(array); |
| | | } |
| | | |
| | | return reList; |
| | | } |
| | | |
| | | @ResponseBody |
| | | @RequestMapping(value = "/personManagement_export.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | @RequestMapping( |
| | | value = {"/personManagement_export.do"}, |
| | | method = {RequestMethod.POST, RequestMethod.GET} |
| | | ) |
| | | public String personManagement_export(HttpServletRequest request, HttpServletResponse response) { |
| | | String toPage = "forward:/hxzk/basicInfo/personmentManagement.jsp"; |
| | | List<tb_person> personList = basicInfoService.getPersonManagement(); |
| | | String[] rowName = { "序号", "姓名", "标签ID", "性别", "部门", "电话", "电量%", "图标", "添加时间" }; |
| | | List<tb_person> personList = this.basicInfoService.getPersonManagement(); |
| | | String[] rowName = new String[]{"序号", "姓名", "标签ID", "性别", "部门", "电话", "电量%", "图标", "添加时间"}; |
| | | List<Object[]> dataList = personobjectToArray(personList); |
| | | ExcelUtils excel = new ExcelUtils("人员管理", rowName, dataList); |
| | | OutputStream out; |
| | | |
| | | try { |
| | | String fileName = "Excel-" + String.valueOf(System.currentTimeMillis()).substring(4, 13) + ".xls"; |
| | | String headStr = "attachment; filename=\"" + fileName + "\""; |
| | | response.setContentType("APPLICATION/OCTET-STREAM"); |
| | | response.setHeader("Content-Disposition", headStr); |
| | | out = response.getOutputStream(); |
| | | OutputStream out = response.getOutputStream(); |
| | | excel.export(out); |
| | | out.flush(); |
| | | out.close(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } catch (Exception var11) { |
| | | var11.printStackTrace(); |
| | | } |
| | | |
| | | return toPage; |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @RequestMapping(value = "/personManagement_export2.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | @RequestMapping( |
| | | value = {"/personManagement_export2.do"}, |
| | | method = {RequestMethod.POST, RequestMethod.GET} |
| | | ) |
| | | public String personManagement_export2(HttpServletRequest request, HttpServletResponse response) { |
| | | String toPage = "forward:/hxzk/basicInfo/cheliangmentManagement.jsp"; |
| | | List<tb_person> personList = basicInfoService.getPersonManagement2(); |
| | | String[] rowName = { "序号", "车辆名称", "标签ID", "部门", "电量%", "图标", "添加时间" }; |
| | | List<tb_person> personList = this.basicInfoService.getPersonManagement2(); |
| | | String[] rowName = new String[]{"序号", "车辆名称", "标签ID", "部门", "电量%", "图标", "添加时间"}; |
| | | List<Object[]> dataList = personobjectToArray2(personList); |
| | | ExcelUtils excel = new ExcelUtils("车辆管理", rowName, dataList); |
| | | OutputStream out; |
| | | |
| | | try { |
| | | String fileName = "Excel-" + String.valueOf(System.currentTimeMillis()).substring(4, 13) + ".xls"; |
| | | String headStr = "attachment; filename=\"" + fileName + "\""; |
| | | response.setContentType("APPLICATION/OCTET-STREAM"); |
| | | response.setHeader("Content-Disposition", headStr); |
| | | out = response.getOutputStream(); |
| | | OutputStream out = response.getOutputStream(); |
| | | excel.export(out); |
| | | out.flush(); |
| | | out.close(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } catch (Exception var11) { |
| | | var11.printStackTrace(); |
| | | } |
| | | |
| | | return toPage; |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @RequestMapping(value = "/personManagement_export3.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | @RequestMapping( |
| | | value = {"/personManagement_export3.do"}, |
| | | method = {RequestMethod.POST, RequestMethod.GET} |
| | | ) |
| | | public String personManagement_export3(HttpServletRequest request, HttpServletResponse response) { |
| | | String toPage = "forward:/hxzk/basicInfo/wuzimentManagement.jsp"; |
| | | List<tb_person> personList = basicInfoService.getPersonManagement3(); |
| | | String[] rowName = { "序号", "物资名称", "标签ID", "部门", "电量%", "图标", "添加时间" }; |
| | | List<tb_person> personList = this.basicInfoService.getPersonManagement3(); |
| | | String[] rowName = new String[]{"序号", "物资名称", "标签ID", "部门", "电量%", "图标", "添加时间"}; |
| | | List<Object[]> dataList = personobjectToArray2(personList); |
| | | ExcelUtils excel = new ExcelUtils("物资管理", rowName, dataList); |
| | | OutputStream out; |
| | | |
| | | try { |
| | | String fileName = "Excel-" + String.valueOf(System.currentTimeMillis()).substring(4, 13) + ".xls"; |
| | | String headStr = "attachment; filename=\"" + fileName + "\""; |
| | | response.setContentType("APPLICATION/OCTET-STREAM"); |
| | | response.setHeader("Content-Disposition", headStr); |
| | | out = response.getOutputStream(); |
| | | OutputStream out = response.getOutputStream(); |
| | | excel.export(out); |
| | | out.flush(); |
| | | out.close(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } catch (Exception var11) { |
| | | var11.printStackTrace(); |
| | | } |
| | | |
| | | return toPage; |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @RequestMapping(value = "/personManagement_export4.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | @RequestMapping( |
| | | value = {"/personManagement_export4.do"}, |
| | | method = {RequestMethod.POST, RequestMethod.GET} |
| | | ) |
| | | public String personManagement_export4(HttpServletRequest request, HttpServletResponse response) { |
| | | String toPage = "forward:/hxzk/basicInfo/personmentManagement.jsp"; |
| | | List<tb_person> personList = basicInfoService.getPersonManagement4(); |
| | | String[] rowName = { "序号", "姓名", "标签ID", "性别", "部门", "电话", "电量%", "图标", "添加时间" }; |
| | | List<tb_person> personList = this.basicInfoService.getPersonManagement4(); |
| | | String[] rowName = new String[]{"序号", "姓名", "标签ID", "性别", "部门", "电话", "电量%", "图标", "添加时间"}; |
| | | List<Object[]> dataList = personobjectToArray(personList); |
| | | ExcelUtils excel = new ExcelUtils("人员管理", rowName, dataList); |
| | | OutputStream out; |
| | | |
| | | try { |
| | | String fileName = "Excel-" + String.valueOf(System.currentTimeMillis()).substring(4, 13) + ".xls"; |
| | | String headStr = "attachment; filename=\"" + fileName + "\""; |
| | | response.setContentType("APPLICATION/OCTET-STREAM"); |
| | | response.setHeader("Content-Disposition", headStr); |
| | | out = response.getOutputStream(); |
| | | OutputStream out = response.getOutputStream(); |
| | | excel.export(out); |
| | | out.flush(); |
| | | out.close(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } catch (Exception var11) { |
| | | var11.printStackTrace(); |
| | | } |
| | | |
| | | return toPage; |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @RequestMapping(value = "/personManagement_exportTemplate.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | @RequestMapping( |
| | | value = {"/personManagement_exportTemplate.do"}, |
| | | method = {RequestMethod.POST, RequestMethod.GET} |
| | | ) |
| | | public String personManagement_exportTemplate(HttpServletRequest request, HttpServletResponse response) { |
| | | String toPage = "forward:/hxzk/basicInfo/personmentManagement.jsp"; |
| | | List<tb_person> personTemplateList = basicInfoService.getPersonManagementTemplate(1); |
| | | String[] rowName = { "姓名", "标签ID", "性别", "部门", "电话"}; |
| | | List<tb_person> personTemplateList = this.basicInfoService.getPersonManagementTemplate(1); |
| | | String[] rowName = new String[]{"姓名", "标签ID", "性别", "部门", "电话"}; |
| | | List<Object[]> dataList = personTemplateobjectToArray(personTemplateList); |
| | | ExcelUtils excel = new ExcelUtils("人员管理", rowName, dataList); |
| | | OutputStream out; |
| | | |
| | | try { |
| | | String fileName = "Excel-" + String.valueOf(System.currentTimeMillis()).substring(4, 13) + ".xls"; |
| | | String headStr = "attachment; filename=\"" + fileName + "\""; |
| | | response.setContentType("APPLICATION/OCTET-STREAM"); |
| | | response.setHeader("Content-Disposition", headStr); |
| | | out = response.getOutputStream(); |
| | | OutputStream out = response.getOutputStream(); |
| | | excel.export(out); |
| | | out.flush(); |
| | | out.close(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } catch (Exception var11) { |
| | | var11.printStackTrace(); |
| | | } |
| | | |
| | | return toPage; |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @RequestMapping(value = "/personManagement_exportTemplate2.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | @RequestMapping( |
| | | value = {"/personManagement_exportTemplate2.do"}, |
| | | method = {RequestMethod.POST, RequestMethod.GET} |
| | | ) |
| | | public String personManagement_exportTemplate2(HttpServletRequest request, HttpServletResponse response) { |
| | | String toPage = "forward:/hxzk/basicInfo/cheliangmentManagement.jsp"; |
| | | List<tb_person> personTemplateList = basicInfoService.getPersonManagementTemplate2(1); |
| | | String[] rowName = { "车辆名称", "标签ID", "部门"}; |
| | | List<tb_person> personTemplateList = this.basicInfoService.getPersonManagementTemplate2(1); |
| | | String[] rowName = new String[]{"车辆名称", "标签ID", "部门"}; |
| | | List<Object[]> dataList = personTemplateobjectToArray2(personTemplateList); |
| | | ExcelUtils excel = new ExcelUtils("车辆管理", rowName, dataList); |
| | | OutputStream out; |
| | | |
| | | try { |
| | | String fileName = "Excel-" + String.valueOf(System.currentTimeMillis()).substring(4, 13) + ".xls"; |
| | | String headStr = "attachment; filename=\"" + fileName + "\""; |
| | | response.setContentType("APPLICATION/OCTET-STREAM"); |
| | | response.setHeader("Content-Disposition", headStr); |
| | | out = response.getOutputStream(); |
| | | OutputStream out = response.getOutputStream(); |
| | | excel.export(out); |
| | | out.flush(); |
| | | out.close(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } catch (Exception var11) { |
| | | var11.printStackTrace(); |
| | | } |
| | | |
| | | return toPage; |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @RequestMapping(value = "/personManagement_exportTemplate3.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | @RequestMapping( |
| | | value = {"/personManagement_exportTemplate3.do"}, |
| | | method = {RequestMethod.POST, RequestMethod.GET} |
| | | ) |
| | | public String personManagement_exportTemplate3(HttpServletRequest request, HttpServletResponse response) { |
| | | String toPage = "forward:/hxzk/basicInfo/wuzimentManagement.jsp"; |
| | | List<tb_person> personTemplateList = basicInfoService.getPersonManagementTemplate3(1); |
| | | String[] rowName = { "物资名称", "标签ID", "部门"}; |
| | | List<tb_person> personTemplateList = this.basicInfoService.getPersonManagementTemplate3(1); |
| | | String[] rowName = new String[]{"物资名称", "标签ID", "部门"}; |
| | | List<Object[]> dataList = personTemplateobjectToArray2(personTemplateList); |
| | | ExcelUtils excel = new ExcelUtils("物资管理", rowName, dataList); |
| | | OutputStream out; |
| | | |
| | | try { |
| | | String fileName = "Excel-" + String.valueOf(System.currentTimeMillis()).substring(4, 13) + ".xls"; |
| | | String headStr = "attachment; filename=\"" + fileName + "\""; |
| | | response.setContentType("APPLICATION/OCTET-STREAM"); |
| | | response.setHeader("Content-Disposition", headStr); |
| | | out = response.getOutputStream(); |
| | | OutputStream out = response.getOutputStream(); |
| | | excel.export(out); |
| | | out.flush(); |
| | | out.close(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } catch (Exception var11) { |
| | | var11.printStackTrace(); |
| | | } |
| | | |
| | | return toPage; |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @RequestMapping(value = "/personManagement_exportTemplate4.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | @RequestMapping( |
| | | value = {"/personManagement_exportTemplate4.do"}, |
| | | method = {RequestMethod.POST, RequestMethod.GET} |
| | | ) |
| | | public String personManagement_exportTemplate4(HttpServletRequest request, HttpServletResponse response) { |
| | | String toPage = "forward:/hxzk/basicInfo/personmentManagement.jsp"; |
| | | List<tb_person> personTemplateList = basicInfoService.getPersonManagementTemplate4(1); |
| | | String[] rowName = { "姓名", "标签ID", "性别", "部门", "电话"}; |
| | | List<tb_person> personTemplateList = this.basicInfoService.getPersonManagementTemplate4(1); |
| | | String[] rowName = new String[]{"姓名", "标签ID", "性别", "部门", "电话"}; |
| | | List<Object[]> dataList = personTemplateobjectToArray(personTemplateList); |
| | | ExcelUtils excel = new ExcelUtils("人员管理", rowName, dataList); |
| | | OutputStream out; |
| | | |
| | | try { |
| | | String fileName = "Excel-" + String.valueOf(System.currentTimeMillis()).substring(4, 13) + ".xls"; |
| | | String headStr = "attachment; filename=\"" + fileName + "\""; |
| | | response.setContentType("APPLICATION/OCTET-STREAM"); |
| | | response.setHeader("Content-Disposition", headStr); |
| | | out = response.getOutputStream(); |
| | | OutputStream out = response.getOutputStream(); |
| | | excel.export(out); |
| | | out.flush(); |
| | | out.close(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } catch (Exception var11) { |
| | | var11.printStackTrace(); |
| | | } |
| | | |
| | | return toPage; |
| | | } |
| | | |
| | | @RequestMapping(value = "/person_bw_kaoqin.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | @RequestMapping( |
| | | value = {"/person_bw_kaoqin.do"}, |
| | | method = {RequestMethod.POST, RequestMethod.GET} |
| | | ) |
| | | public void person_bw_kaoqin(HttpServletRequest request) throws IOException { |
| | | String jsonString = RequestUtils.getRequestJsonString(request, Config.getCharset()); |
| | | tb_person person = (tb_person) JSONObject.toBean(JSONObject.fromObject(jsonString), tb_person.class); |
| | | //显示sql |
| | | String sqlString = "UPDATE tb_person SET p_kaoqin = "+person.getP_kaoqing() +"WHERE p_tagid= +"+person.getP_tagid(); |
| | | String messageJson = GetNowTime.timestamp2()+ " 收:"+ sqlString ; |
| | | tb_person person = (tb_person)JSONObject.toBean(JSONObject.fromObject(jsonString), tb_person.class); |
| | | String sqlString = "UPDATE tb_person SET p_kaoqin = " + person.getP_kaoqing() + "WHERE p_tagid= +" + person.getP_tagid(); |
| | | (new StringBuilder()).append(GetNowTime.timestamp2()).append(" 收:").append(sqlString).toString(); |
| | | String BaowenPath = Config.getBaowenConfig(); |
| | | String baowenStatus = ModifyConfig.readData(BaowenPath, "baowenSwitch"); |
| | | if (baowenStatus.equals("1")){ |
| | | /* Udp_Receive.mysqlMessage.add(messageJson); */ |
| | | if (baowenStatus.equals("1")) { |
| | | } |
| | | // |
| | | basicInfoService.person_modify_kaoqin(person); |
| | | } |
| | | @RequestMapping(value = "/person_bw_power.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | public void person_bw_power(HttpServletRequest request) throws IOException { |
| | | String jsonString = RequestUtils.getRequestJsonString(request, Config.getCharset()); |
| | | tb_person person = (tb_person) JSONObject.toBean(JSONObject.fromObject(jsonString), tb_person.class); |
| | | //显示sql |
| | | String sqlString = "UPDATE tb_person SET p_kaoqin = "+person.getP_kaoqing() +"WHERE p_tagid= +"+person.getP_tagid(); |
| | | String messageJson = GetNowTime.timestamp2()+ " 收:"+ sqlString ; |
| | | String BaowenPath = Config.getBaowenConfig(); |
| | | String baowenStatus = ModifyConfig.readData(BaowenPath, "baowenSwitch"); |
| | | if (baowenStatus.equals("1")){ |
| | | /* Udp_Receive.mysqlMessage.add(messageJson); */ |
| | | } |
| | | // |
| | | basicInfoService.person_modify_power(person); |
| | | } |
| | | |
| | | @RequestMapping(value = "/person_bw_SOS.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | public void person_bw_SOS(HttpServletRequest request) throws IOException { |
| | | String jsonString = RequestUtils.getRequestJsonString(request, Config.getCharset()); |
| | | tb_person person = (tb_person) JSONObject.toBean(JSONObject.fromObject(jsonString), tb_person.class); |
| | | //显示sql |
| | | String sqlString = "UPDATE tb_person SET p_sos = "+person.getP_sos() +"WHERE p_tagid= +"+person.getP_tagid(); |
| | | String messageJson = GetNowTime.timestamp2()+ " 收:"+ sqlString ; |
| | | String BaowenPath = Config.getBaowenConfig(); |
| | | String baowenStatus = ModifyConfig.readData(BaowenPath, "baowenSwitch"); |
| | | if (baowenStatus.equals("1")){ |
| | | /* Udp_Receive.mysqlMessage.add(messageJson); */ |
| | | } |
| | | // |
| | | basicInfoService.person_modify_sos(person); |
| | | } |
| | | |
| | | @RequestMapping(value = "/person_bw_warning.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | public void person_bw_warning(HttpServletRequest request) throws IOException { |
| | | String jsonString = RequestUtils.getRequestJsonString(request, Config.getCharset()); |
| | | tb_person person = (tb_person) JSONObject.toBean(JSONObject.fromObject(jsonString), tb_person.class); |
| | | //显示sql |
| | | String sqlString = "UPDATE tb_person SET p_sos = "+person.getP_sos() +"WHERE p_tagid= +"+person.getP_tagid(); |
| | | String messageJson = GetNowTime.timestamp2()+ " 收:"+ sqlString ; |
| | | String BaowenPath = Config.getBaowenConfig(); |
| | | String baowenStatus = ModifyConfig.readData(BaowenPath, "baowenSwitch"); |
| | | if (baowenStatus.equals("1")){ |
| | | /* Udp_Receive.mysqlMessage.add(messageJson); */ |
| | | } |
| | | // |
| | | basicInfoService.person_modify_warning(person); |
| | | } |
| | | |
| | | @RequestMapping(value = "/person_bw_XYF.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | public void person_bw_XYF(HttpServletRequest request) throws IOException { |
| | | String jsonString = RequestUtils.getRequestJsonString(request, Config.getCharset()); |
| | | tb_person person = (tb_person) JSONObject.toBean(JSONObject.fromObject(jsonString), tb_person.class); |
| | | //显示sql |
| | | String sqlString = "UPDATE tb_person SET p_x = "+person.getP_x()+",p_y = "+person.getP_y()+",p_floor = "+person.getP_floor()+"WHERE p_tagid= "+person.getP_tagid(); |
| | | String messageJson = GetNowTime.timestamp2()+ " 收:"+ sqlString ; |
| | | String BaowenPath = Config.getBaowenConfig(); |
| | | String baowenStatus = ModifyConfig.readData(BaowenPath, "baowenSwitch"); |
| | | if (baowenStatus.equals("1")){ |
| | | /* Udp_Receive.mysqlMessage.add(messageJson); */ |
| | | } |
| | | // |
| | | basicInfoService.person_modify_XYF(person); |
| | | |
| | | this.basicInfoService.person_modify_kaoqin(person); |
| | | } |
| | | |
| | | @RequestMapping( |
| | | value = {"/person_bw_power.do"}, |
| | | method = {RequestMethod.POST, RequestMethod.GET} |
| | | ) |
| | | public void person_bw_power(HttpServletRequest request) throws IOException { |
| | | String jsonString = RequestUtils.getRequestJsonString(request, Config.getCharset()); |
| | | tb_person person = (tb_person)JSONObject.toBean(JSONObject.fromObject(jsonString), tb_person.class); |
| | | String sqlString = "UPDATE tb_person SET p_kaoqin = " + person.getP_kaoqing() + "WHERE p_tagid= +" + person.getP_tagid(); |
| | | (new StringBuilder()).append(GetNowTime.timestamp2()).append(" 收:").append(sqlString).toString(); |
| | | String BaowenPath = Config.getBaowenConfig(); |
| | | String baowenStatus = ModifyConfig.readData(BaowenPath, "baowenSwitch"); |
| | | if (baowenStatus.equals("1")) { |
| | | } |
| | | |
| | | this.basicInfoService.person_modify_power(person); |
| | | } |
| | | |
| | | @RequestMapping( |
| | | value = {"/person_bw_SOS.do"}, |
| | | method = {RequestMethod.POST, RequestMethod.GET} |
| | | ) |
| | | public void person_bw_SOS(HttpServletRequest request) throws IOException { |
| | | String jsonString = RequestUtils.getRequestJsonString(request, Config.getCharset()); |
| | | tb_person person = (tb_person)JSONObject.toBean(JSONObject.fromObject(jsonString), tb_person.class); |
| | | String sqlString = "UPDATE tb_person SET p_sos = " + person.getP_sos() + "WHERE p_tagid= +" + person.getP_tagid(); |
| | | (new StringBuilder()).append(GetNowTime.timestamp2()).append(" 收:").append(sqlString).toString(); |
| | | String BaowenPath = Config.getBaowenConfig(); |
| | | String baowenStatus = ModifyConfig.readData(BaowenPath, "baowenSwitch"); |
| | | if (baowenStatus.equals("1")) { |
| | | } |
| | | |
| | | this.basicInfoService.person_modify_sos(person); |
| | | } |
| | | |
| | | @RequestMapping( |
| | | value = {"/person_bw_warning.do"}, |
| | | method = {RequestMethod.POST, RequestMethod.GET} |
| | | ) |
| | | public void person_bw_warning(HttpServletRequest request) throws IOException { |
| | | String jsonString = RequestUtils.getRequestJsonString(request, Config.getCharset()); |
| | | tb_person person = (tb_person)JSONObject.toBean(JSONObject.fromObject(jsonString), tb_person.class); |
| | | String sqlString = "UPDATE tb_person SET p_sos = " + person.getP_sos() + "WHERE p_tagid= +" + person.getP_tagid(); |
| | | (new StringBuilder()).append(GetNowTime.timestamp2()).append(" 收:").append(sqlString).toString(); |
| | | String BaowenPath = Config.getBaowenConfig(); |
| | | String baowenStatus = ModifyConfig.readData(BaowenPath, "baowenSwitch"); |
| | | if (baowenStatus.equals("1")) { |
| | | } |
| | | |
| | | this.basicInfoService.person_modify_warning(person); |
| | | } |
| | | |
| | | @RequestMapping( |
| | | value = {"/person_bw_XYF.do"}, |
| | | method = {RequestMethod.POST, RequestMethod.GET} |
| | | ) |
| | | public void person_bw_XYF(HttpServletRequest request) throws IOException { |
| | | String jsonString = RequestUtils.getRequestJsonString(request, Config.getCharset()); |
| | | tb_person person = (tb_person)JSONObject.toBean(JSONObject.fromObject(jsonString), tb_person.class); |
| | | String sqlString = "UPDATE tb_person SET p_x = " + person.getP_x() + ",p_y = " + person.getP_y() + ",p_floor = " + person.getP_floor() + "WHERE p_tagid= " + person.getP_tagid(); |
| | | (new StringBuilder()).append(GetNowTime.timestamp2()).append(" 收:").append(sqlString).toString(); |
| | | String BaowenPath = Config.getBaowenConfig(); |
| | | String baowenStatus = ModifyConfig.readData(BaowenPath, "baowenSwitch"); |
| | | if (baowenStatus.equals("1")) { |
| | | } |
| | | |
| | | this.basicInfoService.person_modify_XYF(person); |
| | | } |
| | | } |