package com.cmj.oa.controller;
import com.cmj.oa.biz.ClaimVoucherBiz;
import com.cmj.oa.biz.EmployeeBiz;
import com.cmj.oa.biz.impl.ClaimVoucherBizImpl;
import com.cmj.oa.biz.impl.EmployeeBizImpl;
import com.cmj.oa.dto.ClaimVoucherInfo;
import com.cmj.oa.entity.ClaimVoucher;
import com.cmj.oa.entity.ClaimVoucherItem;
import com.cmj.oa.entity.DealRecord;
import com.cmj.oa.entity.Employee;
import com.cmj.oa.global.Contant;
import com.cmj.oa.util.DateUtil;
import com.cmj.oa.util.FileUtil;
import com.cmj.oa.util.ResponseUtil;
import net.sf.json.JSONObject;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.poifs.filesystem.POIFSFileSystem;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
@Controller("claimVoucherController")
@RequestMapping("/claim_voucher")
public class ClaimVoucherController {
@Autowired
private ClaimVoucherBiz claimVoucherBiz;
@Autowired
private EmployeeBiz employeeBiz;
@RequestMapping("/to_add")
public String toAdd(Map<String,Object> map){
map.put("items", Contant.getItems());
map.put("info",new ClaimVoucherInfo());
return "claim_voucher_add";
}
@RequestMapping("/add")
public String add(HttpSession session, ClaimVoucherInfo info){
Employee employee = (Employee)session.getAttribute("employee");
info.getClaimVoucher().setCreateSn(employee.getSn());
claimVoucherBiz.save(info.getClaimVoucher(),info.getItems());
return "redirect:detail?id="+info.getClaimVoucher().getId();
}
@RequestMapping("/detail")
public String detail(int id,Map<String,Object> map){
map.put("claimVoucher",claimVoucherBiz.get(id));
map.put("items",claimVoucherBiz.getItems(id));
map.put("records",claimVoucherBiz.getRecords(id));
return "claim_voucher_detail";
}
@RequestMapping("/self")
public String self(HttpSession session,Map<String,Object> map){
Employee employee = (Employee)session.getAttribute("employee");
map.put("list",claimVoucherBiz.getForSelf(employee.getSn()));
return "claim_voucher_self";
}
@RequestMapping("/deal")
public String deal(HttpSession session,Map<String,Object> map){
Employee employee = (Employee)session.getAttribute("employee");
map.put("list",claimVoucherBiz.getForDeal(employee.getSn()));
return "claim_voucher_deal";
}
@RequestMapping("/to_update")
public String toUpdate(int id,Map<String,Object> map){
map.put("items",Contant.getItems());
ClaimVoucherInfo info = new ClaimVoucherInfo();
info.setClaimVoucher(claimVoucherBiz.get(id));
info.setItems(claimVoucherBiz.getItems(id));
map.put("info",info);
return "claim_voucher_update";
}
@RequestMapping("/update")
public String update(HttpSession session,ClaimVoucherInfo info){
Employee employee = (Employee)session.getAttribute("employee");
info.getClaimVoucher().setCreateSn(employee.getSn());
claimVoucherBiz.update(info.getClaimVoucher(),info.getItems());
return "redirect:deal";
}
@RequestMapping("/submit")
public String submit(int id){
claimVoucherBiz.submit(id);
return "redirect:deal";
}
@RequestMapping("/to_check")
public String toCheck(int id,Map<String,Object> map){
map.put("claimVoucher",claimVoucherBiz.get(id));
map.put("items",claimVoucherBiz.getItems(id));
map.put("records",claimVoucherBiz.getRecords(id));
DealRecord dealRecord =new DealRecord();
dealRecord.setClaimVoucherId(id);
map.put("record",dealRecord);
return "claim_voucher_check";
}
@RequestMapping("/check")
public String check(HttpSession session, DealRecord dealRecord){
Employee employee = (Employee)session.getAttribute("employee");
dealRecord.setDealSn(employee.getSn());
claimVoucherBiz.deal(dealRecord);
return "redirect:deal";
}
@RequestMapping("/fuzzyQuery")
public String fuzzyQuery(HttpSession session,Map<String,Object> map,@RequestParam String status,@RequestParam String total_amount,@RequestParam String create_time) throws ParseException, IOException {
Employee employee = (Employee)session.getAttribute("employee");
String createSn = employee.getSn();
Double totalAmount = null;
if (!total_amount.isEmpty() && total_amount != null){
totalAmount = Double.valueOf(total_amount);
}
map.put("list",claimVoucherBiz.fuzzyQuery(createSn,status,totalAmount,create_time));
return "claim_voucher_self";
}
@RequestMapping("/fuzzyQueryForDeal")
public String fuzzyQueryForDeal(HttpSession session,Map<String,Object> map,@RequestParam String createSn,@RequestParam String status,@RequestParam String total_amount,@RequestParam String create_time){
Employee employee = (Employee)session.getAttribute("employee");
String nextDealSn = employee.getSn();
Double totalAmount = null;
if (!total_amount.isEmpty() && total_amount != null){
totalAmount = Double.valueOf(total_amount);
}
map.put("list",claimVoucherBiz.fuzzyQueryForDeal(createSn,nextDealSn,status,totalAmount,create_time));
return "claim_voucher_deal";
}
@RequestMapping("/delete")
@ResponseBody
public String deleteClaimVoucher(@RequestParam("ids") String ids){
if (ids.length()==0 || ids.isEmpty()){
return null;
}
String[] str = ids.split(",");
List<Integer> id = new ArrayList<>();
for (int i = 0 ; i < str.length ; i++){
id.add(Integer.parseInt(str[i]));
}
for (Integer i : id){
claimVoucherBiz.deleteById(i);
}
return null;
}
@RequestMapping(value = "/export")
public String exportExcel(HttpServletResponse response, HttpServletRequest request,String ids) throws Exception {
if (ids.length()==0 || ids.isEmpty()){
return null;
}
String[] str = ids.split(",");
List<Integer> id = new ArrayList<>();
for (int i = 0 ; i < str.length ; i++){
id.add(Integer.parseInt(str[i]));
}
List<ClaimVoucher> claimVoucherList = new ArrayList<>();
for (Integer i : id) {
claimVoucherList.add(claimVoucherBiz.get(i));
}
String webPath=request.getServletContext().getRealPath("/");
Workbook wb = fillExcelDataWithTemplate(claimVoucherList, webPath+"/static/excel/claim.xls");
ResponseUtil.export(response,wb,"报销单.xls");
return null;
}
public Workbook fillExcelDataWithTemplate(List<ClaimVoucher> list , String templateFileUrl) {
Workbook wb = null ;
try {
POIFSFileSystem fs = new POIFSFileSystem(new FileInputStream(templateFileUrl));
wb = new HSSFWorkbook(fs);
// 取得 模板的 第一个sheet 页
Sheet sheet = wb.getSheetAt(0);
// 拿到sheet页有多少列
int cellNums = sheet.getRow(0).getLastCellNum();
// 从第3行 开始�
没有合适的资源?快使用搜索试试~ 我知道了~
java基于SSM框架的ERP财务报销管理系统源码+数据库.zip
共780个文件
js:236个
gif:158个
css:82个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
5星 · 超过95%的资源 4 下载量 73 浏览量
2022-12-08
21:13:29
上传
评论 2
收藏 11MB ZIP 举报
温馨提示
java基于SSM框架的ERP财务报销管理系统源码+数据库.zip主要针对计算机相关专业的正在做毕设的学生和需要项目实战练习的Java学习者。也可作为课程设计、期末大作业 包含:项目源码、数据库脚本、软件工具、项目说明等,该项目可以直接作为毕设使用。 项目都经过严格调试,确保可以运行! 技术实现 后台框架:SSM 数据库:MySQL 开发环境:JDK、IDEA java基于SSM框架的ERP财务报销管理系统源码+数据库.zip主要针对计算机相关专业的正在做毕设的学生和需要项目实战练习的Java学习者。也可作为课程设计、期末大作业 包含:项目源码、数据库脚本、软件工具、项目说明等,该项目可以直接作为毕设使用。 项目都经过严格调试,确保可以运行! 技术实现 后台框架:SSM 数据库:MySQL 开发环境:JDK、IDEA java基于SSM框架的ERP财务报销管理系统源码+数据库.zip主要针对计算机相关专业的正在做毕设的学生和需要项目实战练习的Java学习者。也可作为课程设计、期末大作业 包含:项目源码、数据库脚本、软件工具、项目说明等,该项目可以直接作为毕设使用。 项目都经过严
资源推荐
资源详情
资源评论
收起资源包目录
java基于SSM框架的ERP财务报销管理系统源码+数据库.zip (780个子文件)
theme.css 549KB
theme.css 549KB
admin-forms.css 114KB
admin-forms.css 114KB
admin-forms.min.css 87KB
admin-forms.min.css 87KB
layui.css 68KB
layui.css 68KB
animate.min.css 52KB
animate.min.css 52KB
iconsweets.css 26KB
iconsweets.css 26KB
glyphicons-pro.css 23KB
glyphicons-pro.css 23KB
icomoon.css 22KB
icomoon.css 22KB
bootstrap-editable.css 21KB
bootstrap-editable.css 21KB
zocial.css 19KB
zocial.css 19KB
ui.fancytree.min.css 15KB
ui.fancytree.min.css 15KB
layer.css 14KB
layer.css 14KB
core.css 12KB
core.css 12KB
octicons.css 11KB
octicons.css 11KB
dropzone.css 11KB
dropzone.css 11KB
fullcalendar.min.css 10KB
fullcalendar.min.css 10KB
summernote.css 10KB
summernote.css 10KB
layui.mobile.css 10KB
layui.mobile.css 10KB
mapplic.css 9KB
mapplic.css 9KB
magnific-popup.css 8KB
magnific-popup.css 8KB
ladda.min.css 8KB
ladda.min.css 8KB
dataTables.bootstrap.css 7KB
dataTables.bootstrap.css 7KB
laydate.css 7KB
laydate.css 7KB
daterangepicker.css 6KB
daterangepicker.css 6KB
bootstrap-datetimepicker.css 6KB
bootstrap-datetimepicker.css 6KB
footable.core.min.css 5KB
footable.core.min.css 5KB
nestable.css 4KB
nestable.css 4KB
slick.css 4KB
slick.css 4KB
dataTables.plugins.css 4KB
dataTables.plugins.css 4KB
dataTables.editor.css 4KB
dataTables.editor.css 4KB
bootstrap-colorpicker.min.css 3KB
bootstrap-colorpicker.min.css 3KB
stateface.css 3KB
stateface.css 3KB
tagmanager.css 2KB
tagmanager.css 2KB
bootstrap-tour.css 2KB
bootstrap-tour.css 2KB
googlecode.css 2KB
googlecode.css 2KB
c3.min.css 2KB
c3.min.css 2KB
github.css 2KB
github.css 2KB
typeahead.js-bootstrap.css 1KB
typeahead.js-bootstrap.css 1KB
code.css 1KB
code.css 1KB
address.css 141B
address.css 141B
dataTables.colReorder.min.css 139B
dataTables.colReorder.min.css 139B
IconSweets-Deluxe.eot 161KB
IconSweets-Deluxed41d.eot 161KB
IconSweets-Deluxe.eot 161KB
IconSweets-Deluxed41d.eot 161KB
glyphicons-regular.eot 143KB
glyphicons-regulard41d.eot 143KB
glyphicons-regular.eot 143KB
glyphicons-regulard41d.eot 143KB
icomoond41d.eot 101KB
icomoon.eot 101KB
icomoond41d.eot 101KB
icomoon.eot 101KB
fontawesome-webfontd41d.eot 59KB
fontawesome-webfonte0a5.eot 59KB
fontawesome-webfontd41d.eot 59KB
fontawesome-webfonte0a5.eot 59KB
iconfont.eot 40KB
iconfont.eot 40KB
共 780 条
- 1
- 2
- 3
- 4
- 5
- 6
- 8
资源评论
- 月影葬孤魂2023-04-12发现一个超赞的资源,赶紧学习起来,大家一起进步,支持!
- 勾勾手4012024-04-09支持这个资源,内容详细,主要是能解决当下的问题,感谢大佬分享~
- m0_665437122023-07-18资源内容详尽,对我有使用价值,谢谢资源主的分享。
- lizong1112222023-11-26简直是宝藏资源,实用价值很高,支持!
程序员张小妍
- 粉丝: 1w+
- 资源: 2788
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功