当前位置: 首页 > news >正文

网站百度快照不更新做外贸翻译用那个网站

网站百度快照不更新,做外贸翻译用那个网站,哈尔滨工程项目建设网,百度竞价推广一个月多少钱这个系统是帮我一同学的哥哥的做的座位编排系统#xff0c;他是某个学校的教育从事者 基本需求#xff1a;就是能够根据他提供的各个分科班级同学的成绩单来选择相同分科的考场编排#xff08;按成绩高低#xff09;#xff0c;同时输入相应的考场数#xff0c;和每个考…这个系统是帮我一同学的哥哥的做的座位编排系统他是某个学校的教育从事者 基本需求就是能够根据他提供的各个分科班级同学的成绩单来选择相同分科的考场编排按成绩高低同时输入相应的考场数和每个考场的人数。如果某个分科的人数超过了规定的考场数与规定的考场人数的乘积那么就会将人数均匀的分配到前几个考场此外还有一种情况如果分科后的人数对每个考场的人数取余后不为0那么就是要将余出来的人进行均匀分配同样往前面几个考场依次插入。 效果展示 提供的excel 输出的excel 这里用到了aly的easyexcel 直接上代码了 package com.csh.student_places.gui;import com.alibaba.excel.EasyExcel; import com.alibaba.excel.context.AnalysisContext; import com.alibaba.excel.event.AnalysisEventListener; import com.csh.student_places.entity.PlaceStudent; import com.csh.student_places.entity.StudentInfo; import org.springframework.beans.BeanUtils;import javax.swing.*; import java.awt.*; import java.awt.event.ActionEvent; import java.security.SecureRandom; import java.util.*; import java.util.List; import java.util.stream.Collectors;public class MainView extends JFrame {public void mainview(){//主界面的进入JFrame jFrame new JFrame(学生考场分配系统);//创建对象jFrame.setVisible(true);//窗口的可视化jFrame.setBounds(650, 150, 700, 400);//窗口的初始化jFrame.setResizable(false);Container container jFrame.getContentPane();container.setBackground(Color.lightGray);jFrame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);//关闭事件container.setLayout(null);//初始化按钮信息JLabel jLabelr new JLabel(学生考场分配系统By陈某宏);jLabelr.setFont(new Font(行书, Font.BOLD, 30));jLabelr.setForeground(Color.BLUE);jLabelr.setBounds(180, 250, 400, 100);container.add(jLabelr);JLabel label1 new JLabel(输入学生基本信息Excel表的绝对路径);JTextField inexcel new JTextField();label1.setBounds(5,0,400,100);label1.setFont(new Font(行书, Font.BOLD, 20));inexcel.setBounds(360,35,500,30);JLabel inexcellable new JLabel(考场数);inexcellable.setBounds(5,30,100,100);inexcellable.setFont(new Font(行书, Font.BOLD, 20));JTextField numberplace new JTextField();numberplace.setBounds(80,65,60,30);JLabel inexcellable1 new JLabel(考场人数);inexcellable1.setBounds(150,30,200,100);inexcellable1.setFont(new Font(行书, Font.BOLD, 20));JTextField numberperson new JTextField();numberperson.setBounds(250,65,60,30);JLabel label2 new JLabel(输出的学生考场信息Excel表的绝对路径);JTextField outexcel new JTextField();label2.setBounds(5,60,400,100);label2.setFont(new Font(行书, Font.BOLD, 20));outexcel.setBounds(380,95,500,30);JButton jButton new JButton(生成);jButton.setBounds(250,200,200,30);container.add(jButton);container.add(label2);container.add(outexcel);container.add(inexcellable1);container.add(numberperson);container.add(numberplace);container.add(inexcellable);container.add(label1);container.add(inexcel);jFrame.update(jFrame.getGraphics());jButton.addActionListener(new AbstractAction() {Overridepublic void actionPerformed(ActionEvent e) {//点击这个按钮之后开始读取String inexcelname inexcel.getText();//取到输入表的路径String outexcelname outexcel.getText();//输出表的路径String numberplace1 numberplace.getText();//考场数String numberperson1 numberperson.getText();//考场人数int n Integer.parseInt(numberplace1);//考场数int m Integer.parseInt(numberperson1);//考场人数String substring inexcelname.substring(1);String substring1 outexcelname.substring(1);ArrayListStudentInfo studentInfos new ArrayList();EasyExcel.read(substring, StudentInfo.class, new AnalysisEventListenerStudentInfo() {// 每解析一行数据,该方法会被调用一次Overridepublic void invoke(StudentInfo studentInfo, AnalysisContext analysisContext) {studentInfos.add(studentInfo);}// 全部解析完成被调用Overridepublic void doAfterAllAnalysed(AnalysisContext analysisContext) {System.out.println(解析完成...);// 可以将解析的数据保存到数据库}}).sheet().doRead(); // System.out.println(studentInfos.toString());//拿到了学生的所有数据//进行分组int size studentInfos.size();//拿到了所有的人数MapString, ListStudentInfo studentMap1 studentInfos.stream().collect(Collectors.groupingBy(StudentInfo::getGroup)); // System.out.println(studentMap.toString());ListMap.EntryString, ListStudentInfo list new LinkedList(studentMap1.entrySet());Collections.sort(list, new ComparatorMap.EntryString, ListStudentInfo() {public int compare(Map.EntryString, ListStudentInfo o1, Map.EntryString, ListStudentInfo o2) {return o2.getKey().length() - o1.getKey().length();}});MapString, ListStudentInfo studentMap new LinkedHashMap();for (Map.EntryString, ListStudentInfo entry : list) {studentMap.put(entry.getKey(), entry.getValue());}ArrayListPlaceStudent placeStudents new ArrayList();//总的排考表int testplace1;int lastplace1;ArrayListArrayListPlaceStudent all new ArrayList();ArrayListPlaceStudent placeStudents1 new ArrayList();//全到这个map里面了,每一个组合在一个map中遍历整个map取出每一个mapfor (Map.EntryString, ListStudentInfo entry : studentMap.entrySet()) { //key是分组条件name//通过key取valuevalue是Person对象可能有多个用list取ListStudentInfo list11 (ListStudentInfo) studentMap.get(entry.getKey()); // System.out.println(list11.toString()); // System.out.println(**********************************);int size1 list11.size();//取到每个组合的人数System.out.println(size1);//随机打乱顺序 // Random random new SecureRandom(); // Collections.shuffle(list11, random);// System.out.println(list11.toString()); // System.out.println(__________________________________________________________________________________);for(StudentInfo s: list11){if(s.getGrade()null||!Character.isDigit(s.getGrade().charAt(0))){s.setGrade(0);}}list11.sort(new AgeComparator());//判断余数int lastperson size1 % m;//剩的人int i1 size1 / m;//看这个组合需要多少考场向下取整这里//先排一下if(lastperson0){i1;}ArrayListArrayListPlaceStudent arrayLists newArrayList(i1);//这个组合的考场集合for (int i 0; i i1; i) {arrayLists.add(new ArrayListPlaceStudent(2000)); // 向 arrayLists 中添加 i1 个空的 ArrayListStudentInfo 元素}int flag0;for (int i0;ii1;i){ // ArrayListStudentInfo studentInfos1 new ArrayList();//类比于当中的一个考场for(int j0;jm;j){if(flagsize1){//此时已全部取完break;}PlaceStudent placeStudent new PlaceStudent();BeanUtils.copyProperties(list11.get(flag),placeStudent);placeStudent.setPlace(testplace);//设置考场数placeStudent.setSeatnumber(j1);if(testplace10){if(j9){placeStudent.setTestid(list11.get(flag).getClass1()0testplace0(j1));}else{placeStudent.setTestid(list11.get(flag).getClass1()0testplace(j1));}}else{if(j9){placeStudent.setTestid(list11.get(flag).getClass1()testplace0(j1));}else{placeStudent.setTestid(list11.get(flag).getClass1()testplace(j1));}}arrayLists.get(i).add(placeStudent);flag;//向下取}testplace;}if(lastperson25lastperson!0){//此时将人往前面考场排向下取整的考场数int flag10;ArrayListPlaceStudent laststudentInfos arrayLists.get(i1 - 1);//n拿到的是最后一个教室要往前排的人i1--;//减少一个考场while(lastperson0)//还有要排的人{for(int i0;ii1;i)//往前加人,除去最后一个教室{if(lastperson0){PlaceStudent placeStudent laststudentInfos.get(flag1);placeStudent.setPlace(lastplacei);placeStudent.setSeatnumber(arrayLists.get(i).size()1);//学生考号if(lastplacei10){placeStudent.setTestid(placeStudent.getClass1()0(lastplacei)placeStudent.getSeatnumber());}else{placeStudent.setTestid(placeStudent.getClass1()(lastplacei)placeStudent.getSeatnumber());}arrayLists.get(i).add(placeStudent);flag1;lastperson--;}else{testplace--;break;}}}}else{//此时不需要往前塞人了//这个考场已经排满}//再合并起来ArrayListPlaceStudent studentInfos1 new ArrayList();for(int i0;ii1;i){studentInfos1.addAll(arrayLists.get(i));} // System.out.println(studentInfos1.toString());lastplacetestplace;all.add(studentInfos1);placeStudents1.addAll(studentInfos1);}System.out.println(placeStudents1.toString());System.out.println(all.toString());System.out.println(substring1);EasyExcel.write(substring1, PlaceStudent.class).sheet(2).doWrite(placeStudents1);}});}} class AgeComparator implements ComparatorStudentInfo {public int compare(StudentInfo p1, StudentInfo p2) {return p2.getGrade().compareTo(p1.getGrade());} }
http://www.yutouwan.com/news/326697/

相关文章:

  • 免费网站模版 好用的最新国际新闻摘抄
  • 哪里可以做游戏视频网站湛江网站建设公司哪家好
  • 没有网站做分类信息群发网页设计个人主页模板图片
  • 顺德网站建设公司有哪些武乡网站建设
  • 安徽网站建设公司排名东莞高端网站建设首页排名
  • 北京建设网站哪里好元宇宙app技术开发
  • 营销型网站的三元素网站开发服务器配置
  • 网站布局策划案鲜花购物网站源码
  • 网上建设网站淮北矿业工程建设有限公司网站
  • 模板网站什么意思国外网站翻墙怎么做
  • 大型自适应的网站开发wordpress自带的代码高亮
  • 专业建设网站服务公司网站开发项目风险
  • 手机网站建设是什么规划网站站点需要遵循哪些原则
  • 易语言如何建设网站网站下载不了怎么解决
  • 无锡网站建设 网站制作开发公司安全生产管理制度
  • 专门做图片是网站网站购买后如何做
  • 企业网站文案外包wordpress 空白主题
  • 律师行业网站模板二次元wordpress博客主题
  • 网站建设都一般步骤电厂cms系统是什么
  • 徐州专门做网站黄骅港一期码头潮汐表
  • 梅州建网站建设什么网站
  • 外贸soho网站制作北京活动策划公司排行
  • 大同市建设工程招标投标网站谷歌浏览器网页
  • 梓潼网站建设彩票网站的统计怎么做
  • 湖南湘潭网站建设宁夏网页制作公司
  • 做网站怎么学郑州买房三大网站
  • 南阳微网站开发网络营销品牌案例分析
  • 什么网站做的好看又便宜网站建设制作软件
  • 购物网站开发分工wordpress弃用react
  • 承德网站制作重庆旅游景点