| | |
| | | List<DispatcherUnitVO> dispatcherUnitVOS = baseMapper.selectDispatcherUnitPage(page, dispatcherUnitVO); |
| | | dispatcherUnitVOS.forEach(dispatcherUnitVO1 -> { |
| | | //查询派遣记录条数 |
| | | dispatcherUnitVO1.setNum(dispatcherService.getDispatcherCount(dispatcherUnitVO1)); |
| | | dispatcherUnitVO1.setSnum(dispatcherService.getDispatcherCount(dispatcherUnitVO1)); |
| | | }); |
| | | return page.setRecords(dispatcherUnitVOS); |
| | | } |
| | |
| | | |
| | | if (dispatcherUnitExcel.getName()!=null && dispatcherUnitExcel.getName()!=""){ |
| | | //仅中文 |
| | | String chinese = "^[\\u4E00-\\u9FA5\\uF900-\\uFA2D]+$"; |
| | | Pattern compile = Pattern.compile(chinese); |
| | | String name = compile.matcher(dispatcherUnitExcel.getName()).replaceAll(""); |
| | | dispatcherUnit.setName(name); |
| | | // String chinese = "^[\\u4E00-\\u9FA5\\uF900-\\uFA2D]+$"; |
| | | // Pattern compile = Pattern.compile(chinese); |
| | | // String name = compile.matcher(dispatcherUnitExcel.getName()).replaceAll(""); |
| | | dispatcherUnit.setName(dispatcherUnitExcel.getName()); |
| | | } |
| | | |
| | | if (dispatcherUnitExcel.getLinkman()!=null && dispatcherUnitExcel.getLinkman()!=""){ |
| | |
| | | dispatcherUnit.setPhone(dispatcherUnitExcel.getPhone()); |
| | | } |
| | | |
| | | if (dispatcherUnitExcel.getStartTime()!=null){ |
| | | String year = dispatcherUnitExcel.getStartTime().substring(0, 4); |
| | | String month = dispatcherUnitExcel.getStartTime().substring(4, 6); |
| | | String day = dispatcherUnitExcel.getStartTime().substring(6, 8); |
| | | String dateFormat = year + "-" +month+"-" +day; |
| | | try { |
| | | Date date = new SimpleDateFormat("yyyy-MM-dd").parse(dateFormat); |
| | | dispatcherUnit.setStartTime(date); |
| | | } catch (ParseException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | if (dispatcherUnitExcel.getSecurityLinkman()!=null && dispatcherUnitExcel.getSecurityLinkman()!=""){ |
| | | dispatcherUnit.setSecurityLinkman(dispatcherUnitExcel.getSecurityLinkman()); |
| | | } |
| | | |
| | | if (dispatcherUnitExcel.getEndTime()!=null){ |
| | | String year = dispatcherUnitExcel.getEndTime().substring(0, 4); |
| | | String month = dispatcherUnitExcel.getEndTime().substring(4, 6); |
| | | String day = dispatcherUnitExcel.getEndTime().substring(6, 8); |
| | | String dateFormat = year + "-" +month+"-" +day; |
| | | try { |
| | | Date date = new SimpleDateFormat("yyyy-MM-dd").parse(dateFormat); |
| | | dispatcherUnit.setEndTime(date); |
| | | } catch (ParseException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | if (dispatcherUnitExcel.getCell()!=null && dispatcherUnitExcel.getCell()!=""){ |
| | | dispatcherUnit.setCell(dispatcherUnitExcel.getCell()); |
| | | } |
| | | |
| | | if (dispatcherUnitExcel.getServeType()!=null && dispatcherUnitExcel.getServeType()!=""){ |
| | | dispatcherUnit.setServeType(dispatcherUnitExcel.getServeType()); |
| | | } |
| | | |
| | | if (dispatcherUnitExcel.getNum()!=null){ |
| | | dispatcherUnit.setNum(dispatcherUnitExcel.getNum()); |
| | | } |
| | | |
| | | dispatcherUnit.setStartTime(dispatcherUnitExcel.getStartTime()); |
| | | dispatcherUnit.setEndTime(dispatcherUnitExcel.getEndTime()); |
| | | |
| | | // if (dispatcherUnitExcel.getStartTime()!=null){ |
| | | // String year = dispatcherUnitExcel.getStartTime().substring(0, 4); |
| | | // String month = dispatcherUnitExcel.getStartTime().substring(4, 6); |
| | | // String day = dispatcherUnitExcel.getStartTime().substring(6, 8); |
| | | // String dateFormat = year + "-" +month+"-" +day; |
| | | // try { |
| | | // Date date = new SimpleDateFormat("yyyy-MM-dd").parse(dateFormat); |
| | | // dispatcherUnit.setStartTime(date); |
| | | // } catch (ParseException e) { |
| | | // e.printStackTrace(); |
| | | // } |
| | | // } |
| | | // |
| | | // if (dispatcherUnitExcel.getEndTime()!=null){ |
| | | // String year = dispatcherUnitExcel.getEndTime().substring(0, 4); |
| | | // String month = dispatcherUnitExcel.getEndTime().substring(4, 6); |
| | | // String day = dispatcherUnitExcel.getEndTime().substring(6, 8); |
| | | // String dateFormat = year + "-" +month+"-" +day; |
| | | // try { |
| | | // Date date = new SimpleDateFormat("yyyy-MM-dd").parse(dateFormat); |
| | | // dispatcherUnit.setEndTime(date); |
| | | // } catch (ParseException e) { |
| | | // e.printStackTrace(); |
| | | // } |
| | | // } |
| | | |
| | | dispatcherUnit.setCreateTime(new Date()); |
| | | |
| | | //新增 |
| | | this.save(dispatcherUnit); |
| | | |
| | | //数据同步 |
| | | String s1 = |
| | | "insert into sys_dispatcher_unit(id,name,dept_id,linkman,phone,start_time,end_time) " + |
| | | "insert into sys_dispatcher_unit(id,name,dept_id,linkman,phone,create_time,start_time,end_time,serve_type,security_linkman,cell,num) " + |
| | | "values(" + "'" + dispatcherUnit.getId() + "'" + "," + |
| | | "'" + dispatcherUnit.getName() + "'" + "," + |
| | | "'" + dispatcherUnit.getDeptId() + "'" + "," + |
| | | "'" + dispatcherUnit.getLinkman() + "'" + "," + |
| | | "'" + dispatcherUnit.getPhone() + "'" + "," + |
| | | "'" + new SimpleDateFormat("yyyy-MM-dd").format(dispatcherUnit.getStartTime()) + "'" + "," + |
| | | "'" + new SimpleDateFormat("yyyy-MM-dd").format(dispatcherUnit.getEndTime()) + "'" + ")"; |
| | | "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(dispatcherUnit.getCreateTime()) + "'" + "," + |
| | | "'" + new SimpleDateFormat("yyyy/MM/dd").format(dispatcherUnit.getStartTime()) + "'" + "," + |
| | | "'" + new SimpleDateFormat("yyyy/MM/dd").format(dispatcherUnit.getEndTime()) + "'" + "," + |
| | | "'" + dispatcherUnit.getServeType() + "'" + "," + |
| | | "'" + dispatcherUnit.getSecurityLinkman() + "'" + "," + |
| | | "'" + dispatcherUnit.getCell() + "'" + "," + |
| | | "'" + dispatcherUnit.getNum() + "'" + ")"; |
| | | FtpUtil.sqlFileUpload(s1); |
| | | }); |
| | | } |