java实现前后端进度条,前端开发上传文件带进度条

//修改头像

publicvoideachJsonUpdatePicture(){

try{

if(employee.getRole()==null||employee.getRole().getRoleId()==null)

employee.setRole(null);

StringcropData=request.getParameter(“cropData”);

if(cropData ==null){

EmployeeemployeeNew=newEmployee();

employeeNew.setEmployeeId(employee.getEmployeeId());

employeeNew=employeeService.queryOne(employeeNew);

employeeNew.setPicture(employee.getPicture());

employeeService.update(employeeNew);

}else{

JSONObjectjsonCropData=newJSONObject(cropData);

Stringinitw=request.getParameter(“initw”);

Stringinith=request.getParameter(“inith”);

if(initw!=null&&inith!=null){

employeeService.updatePicture(employee,jsonCropData.getInt(“x”),jsonCropData.getInt(“y”),Integer.parseInt(inith),Integer.parseInt(initw));

}else{

employeeService.updatePicture(employee,jsonCropData.getInt(“x”),jsonCropData.getInt(“y”),jsonCropData.getInt(“h”),jsonCropData.getInt(“w”));

}

EmployeeemployeeNew=newEmployee();

employeeNew.setEmployeeId(employee.getEmployeeId());

employeeNew=employeeService.queryOne(employeeNew);

this.request.getSession().setAttribute(“currentUser”, employeeNew);

}

JSONObjectjsonResponse=newJSONObject();

jsonResponse.put(“result”,”success”);

jsonResponse.put(“message”,”修改’员工’成功!”);

HttpJsonUtil.writeJsonData(response, jsonResponse);

OperateLogoperateLog=newOperateLog();

operateLog.setOperator((Employee)request.getSession().getAttribute(“currentUser”));

operateLog.setLogType(5);

operateLog.setHappenTime(newDate());

operateLog.setLogContent(“修改’员工’成功!”);

employeeService.saveOrUpdate(operateLog);

}catch(CurrentException ce){

JSONObjectjsonResponse=newJSONObject();

try{

jsonResponse.put(“result”,”failed”);

jsonResponse.put(“message”,ce.getMessage());

HttpJsonUtil.writeJsonData(response, jsonResponse);

}catch(Exception e1){

e1.printStackTrace();

}

OperateLogoperateLog=newOperateLog();

operateLog.setOperator((Employee)request.getSession().getAttribute(“currentUser”));

operateLog.setLogType(5);

operateLog.setHappenTime(newDate());

operateLog.setLogContent(“操作’员工’异常,”+ce.getMessage());

employeeService.saveOrUpdate(operateLog);

}catch(Exception ex){

ex.printStackTrace();

JSONObjectjsonResponse=newJSONObject();

try{

jsonResponse.put(“result”,”failed”);

jsonResponse

.put(“message”,”发生异常!”);

HttpJsonUtil.writeJsonData(response, jsonResponse);

}catch(Exception e1){

e1.printStackTrace();

}

OperateLogoperateLog=newOperateLog();

operateLog.setOperator((Employee)request.getSession().getAttribute(“currentUser”));

operateLog.setLogType(5);

operateLog.setHappenTime(newDate());

operateLog.setLogContent(“操作’员工’异常!”);

employeeService.saveOrUpdate(operateLog);

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值