package com.two.studentRoll.service.impl;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import javax.annotation.Resource;
import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
import org.apache.commons.compress.archivers.zip.ZipFile;
import org.apache.commons.io.FileUtils;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.my.ms.framework.persistence.hibernate.IBaseDao;
import com.my.ms.framework.persistence.model.Page;
import com.two.studentRoll.model.Classes;
import com.two.studentRoll.model.Degree;
import com.two.studentRoll.model.Student;
import com.two.studentRoll.service.IClassService;
import com.two.studentRoll.service.IStudentService;
/**
* 学生
*
* @author The bird is my most loving smile
* @version 1.0
* @updated 19-二月-2014 20:46:09
*
*/
@Service("studentService")
@Transactional(readOnly = true)
public class StudentServiceImpl implements IStudentService {
@Resource(name = "ClassService")
private IClassService classService;
@Resource
private IBaseDao dao;
// 用来输出日志
private static final Logger LOG = LoggerFactory
.getLogger(StudentServiceImpl.class);
@Override
@Transactional(readOnly = false)
public void addStudent(Student student, int classId, int degreeId) {
Degree degree = dao.queryEntityById(Degree.class, degreeId);
Classes classes = dao.queryEntityById(Classes.class, classId);
student.setDegree(degree);
student.setCla(classes);
dao.addEntity(student);
}
@Override
public void exportStudentBasic(Map<String, Object> outPutMap,
OutputStream out, InputStream templateFile) {
String fileName = (String) outPutMap.get("fileName");
int classId = (Integer) outPutMap.get("classId");
String className = (String) outPutMap.get("className");
List<Student> list = dao.queryEntitys("from Student where cla.id=? ",
new Object[] { classId });
this.outputString(list, className, fileName, out, templateFile);
}
@SuppressWarnings("deprecation")
public void outputString(List<Student> list, String className,
String filteName, OutputStream out, InputStream templateFile) {
HSSFWorkbook wb;
try {
wb = new HSSFWorkbook(templateFile);
HSSFSheet sheet = wb.getSheetAt(0);
// 设置标题
sheet.getRow(0).getCell(0).setCellValue(className + "学生信息表");
// 取得模板行数据
HSSFRow templateRow = sheet.getRow(2);
int startRow = 2;
for (Student s : list) {
HSSFRow row = sheet.createRow(startRow);
// ID
HSSFCell cell_id = row.createCell(0);
cell_id.setCellStyle(templateRow.getCell(0).getCellStyle());
cell_id.setCellValue(s.getId());
// 学生姓名
HSSFCell cell_name = row.createCell(1);
cell_name.setCellStyle(templateRow.getCell(1).getCellStyle());
cell_name.setCellValue(s.getName());
// 学生性别
HSSFCell cell_sex = row.createCell(2);
cell_sex.setCellStyle(templateRow.getCell(2).getCellStyle());
cell_sex.setCellValue(s.getSex());
// 学生年龄
HSSFCell cell_age = row.createCell(3);
cell_age.setCellStyle(templateRow.getCell(3).getCellStyle());
cell_age.setCellValue(s.getAge());
// 学生报名编号
HSSFCell cell_code = row.createCell(4);
cell_code.setCellStyle(templateRow.getCell(4).getCellStyle());
cell_code.setCellValue(s.getSchoolStartCode());
// 学生报名时间
HSSFCell cell_stadeTime = row.createCell(5);
cell_stadeTime.setCellStyle(templateRow.getCell(5)
.getCellStyle());
cell_stadeTime.setCellValue(new SimpleDateFormat("yyyy-mm-dd")
.format(s.getSchoolStartTime()));
// 学生所在班级
HSSFCell cell_classes = row.createCell(6);
cell_classes
.setCellStyle(templateRow.getCell(6).getCellStyle());
cell_classes.setCellValue(s.getCla().getClassName());
// 计算机程度
HSSFCell cell_computerKnow = row.createCell(7);
cell_computerKnow.setCellStyle(templateRow.getCell(7)
.getCellStyle());
cell_computerKnow.setCellValue(s.getComputerKnow());
// 毕业学院
HSSFCell cell_graduateSchool = row.createCell(8);
cell_graduateSchool.setCellStyle(templateRow.getCell(8)
.getCellStyle());
cell_graduateSchool.setCellValue(s.getGraduateSchool());
// 身份证号
HSSFCell cell_iDcard = row.createCell(9);
cell_iDcard.setCellStyle(templateRow.getCell(9).getCellStyle());
cell_iDcard.setCellValue(s.getiDcard());
// 专业
HSSFCell cell_major = row.createCell(10);
cell_major.setCellStyle(templateRow.getCell(10).getCellStyle());
cell_major.setCellValue(s.getMajor());
// 家长电话
HSSFCell cell_partentPhone = row.createCell(11);
cell_partentPhone.setCellStyle(templateRow.getCell(11)
.getCellStyle());
cell_partentPhone.setCellValue(s.getPartentPhone());
// 学生电话
HSSFCell cell_studentPhone = row.createCell(12);
cell_studentPhone.setCellStyle(templateRow.getCell(12)
.getCellStyle());
cell_studentPhone.setCellValue(s.getStudentPhone());
// 信产部考试
HSSFCell cell_seTest = row.createCell(13);
cell_seTest
.setCellStyle(templateRow.getCell(13).getCellStyle());
cell_seTest.setCellValue(s.getSeTest());
// 是否住宿
HSSFCell cell_isDormitory = row.createCell(14);
cell_isDormitory.setCellStyle(templateRow.getCell(14)
.getCellStyle());
cell_isDormitory.setCellValue(s.getIsDormitory());
// 学历
HSSFCell cell_degree = row.createCell(15);
cell_degree
.setCellStyle(templateRow.getCell(15).getCellStyle());
cell_degree.setCellValue(s.getDegree().getDegreeName());
// 备注
HSSFCell cell_remark = row.createCell(16);
cell_remark
.setCellStyle(templateRow.getCell(16).getCellStyle());
cell_remark.setCellValue(s.getRemark());
startRow = startRow + 1;
}
wb.write(out);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
@Override
public Student findByStudentId(int studentId) {
Student stu = dao.queryEntityById(Student.class, studentId);
return stu;
}
// @Override
public Page<Student> findByStudentItem(Map queryMap, int pageNO) {
StringBuffer hql = new StringBuffer("from Student s where 1=1 ");
List<Object> params = new ArrayList<Object>();
if (queryMap.containsKey("studentName")) {
hql.append("and s.name like ?");
params.add(queryMap.get("studentName"));
}
if (queryMap.containsKey("classesId")) {
hql.append("and s.cla.id = ?");
params.add(queryMap.get("classesId"));
}
if (queryMap.containsKey("age")) {
hql.append("and s.age = ?");
params.add(queryMap.get("age"));
}
if (queryMap.containsKey("degreeId")) {
hql.append("and s.degree.id = ?");
params.add(queryMap.get("degreeId"));
}
if (queryMap.containsKey("sex")) {
hql.append("and s.sex = ?");
params.add(queryMap.get("sex"));
}
if (queryMap.containsKey("state")) {
hql.append("and s.state = ?");
params.add(queryMap.get("state"));
}
if (queryMap.containsKey("isDormitory")) {
hql.append("and s.isDormitory = ?");
params.add(queryMap.get("isDormitory"));
}
Page p = this.dao.queryEntityByPage(pageNO, pageCount, hql.toString(),
params.toArray());
return p;
}
没有合适的资源?快使用搜索试试~ 我知道了~
仿soul交友脱单盲盒源码程序带图文搭建教程
共440个文件
java:80个
class:80个
js:59个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
5星 · 超过95%的资源 2 下载量 188 浏览量
2022-07-09
21:53:42
上传
评论 5
收藏 19.76MB RAR 举报
温馨提示
仿soul交友脱单盲盒源码程序带图文搭建教程 2022-07-09 永久尊享 7 推广 PS 本源码提供给大家学习研究借鉴美工之用,请勿用于商业和非法用途,无任何技术支持! 提供仿soul交友盲盒系统源码/全开源版,内置微信免签接口以及个人码支付接口,API部分开源,有能力的可以自己去二次开发。 运行环境 PHP+MYSQL 风格截图 搭建说明 详见压缩包内! 资源下载 下载权限终身VIP专享仅限终身VIP下载立即下载 版权免责声明 01、本站所有的资源都来源于互联网搜集并整理,如有侵权请邮件联系站长! 02、本站分享的资源仅供参考和学习,您必须在下载后的24个小时之内删除! 03、本站分享目的仅供学习研究和借鉴,请不要用于商业用途以及违法用途! 04、本站提供的源码不保证资源的完整性以及安全性,不附带任何技术服务! 05、禁止用本站源码用于非法商业用途,不得违反国家法律,否则后果自负! 06、如发现资源链接无法下载、失效或广告,请联系管理员或提交工单处理! 07、所有资源均可通过日常签到等任务进行免费兑换,记得每天到本站签到! 08、本站所有资源积分兑换只是赞助,
资源推荐
资源详情
资源评论
收起资源包目录
仿soul交友脱单盲盒源码程序带图文搭建教程 (440个子文件)
StudentServiceImpl.class 16KB
ClassesAction.class 11KB
JobServiceImpl.class 11KB
JobAction.class 9KB
SchoolRollAction.class 9KB
UserAction.class 8KB
GradeAction.class 8KB
UserServiceImpl.class 8KB
StudentInputOutPutAction.class 7KB
Student.class 7KB
PayMoneyAction.class 7KB
GradeServiceImpl.class 7KB
DormitoryAction.class 7KB
StudentAction.class 6KB
SchoolRollServiceImpl.class 6KB
ClassServiceImpl.class 6KB
Classes.class 6KB
RoleAction.class 6KB
Job.class 5KB
ClassTypeAction.class 5KB
GradeCountAction.class 4KB
JobStatisticsAction.class 4KB
PayMoneyServiceImpl.class 4KB
RoleServiceImpl.class 4KB
PostAction.class 4KB
User.class 4KB
ModelAction.class 3KB
Dormitory.class 3KB
DormitoryServiceImpl.class 3KB
Grade.class 3KB
ClassTypeServiceImpl.class 3KB
DegreeAction.class 3KB
PayMoney.class 3KB
FileUploadAction.class 3KB
SchoolRoll.class 3KB
SchoolRollStatistics.class 3KB
Role.class 3KB
SchoolRollTypeAction.class 3KB
ClassType.class 3KB
SubjectsServiceImpl.class 2KB
ModelServiceImpl.class 2KB
ClassStage.class 2KB
Models.class 2KB
GradeCount.class 2KB
Select.class 2KB
PositionServiceImpl.class 2KB
JobStatistics.class 2KB
MoneyTongji.class 2KB
Degree.class 2KB
GradeCountServiceImpl.class 2KB
SchoolRollType.class 2KB
SpringMvcOppensessionInView.class 2KB
Subjects.class 2KB
SchoolRollTypeServiceImpl.class 2KB
SelectServiceImpl.class 2KB
ClassStageServiceImpl.class 2KB
DegreeServiceImpl.class 1KB
IStudentService.class 1KB
Position.class 1KB
IJobService.class 1KB
Tool.class 1KB
IClassService.class 1KB
IntConverter.class 1KB
DoubleConverter.class 1KB
DateConverter.class 1KB
IClassTypeService.class 1018B
IUserService.class 989B
ISchoolRollService.class 838B
IPayMoneyService.class 750B
IGradeService.class 722B
IRoleService.class 639B
IPosition.class 600B
ISubjectsService.class 575B
IDormitoryService.class 569B
IGradeCountService.class 554B
IClassStageService.class 386B
ISelectService.class 377B
ISchoolRollTypeService.class 366B
IDegreeService.class 323B
IModelService.class 312B
.classpath 588B
org.eclipse.wst.common.component 490B
org.eclipse.wst.jsdt.ui.superType.container 49B
bootstrap-cyborg.css 113KB
bootstrap-cyborg.css 113KB
bootstrap-cerulean.css 106KB
bootstrap-cerulean.css 106KB
bootstrap.min.css 104KB
bootstrap.min.css 103KB
style.css 103KB
bootstrap-classic.css 98KB
bootstrap-classic.css 98KB
bootstrap-classic.min.css 81KB
bootstrap-classic.min.css 81KB
jquery-ui-1.8.21.custom.css 32KB
jquery-ui-1.8.21.custom.css 32KB
font-awesome.min.css 21KB
bootstrap-responsive.min.css 16KB
bootstrap-responsive.css 14KB
bootstrap-responsive.css 14KB
共 440 条
- 1
- 2
- 3
- 4
- 5
资源评论
- Ar.芭比2023-12-05资源内容总结地很全面,值得借鉴,对我来说很有用,解决了我的燃眉之急。
- qq_411469322023-07-24资源很好用,有较大的参考价值,资源不错,支持一下。
送涂图
- 粉丝: 102
- 资源: 163
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功