机具库存收藏修改
This commit is contained in:
parent
7ccc77c2f7
commit
8922b69069
|
|
@ -6,7 +6,7 @@
|
|||
<c:choose>
|
||||
<c:when test="${page.totalRecord > 0}">
|
||||
<c:forEach items="${page.results}" var="ma" varStatus="index">
|
||||
<tr ondblclick="setChecked(${ma.id})" onclick="topage(${ma.id} , '${ma.processName}')">
|
||||
<tr ondblclick="setChecked(${ma.id})" onclick="topage(${ma.id} , '${ma.processName}' , '${isFinish}')">
|
||||
<th style="vertical-align:middle;" class="center"><label> <input type='checkbox' value='${ma.checkerId}_${ma.processName}' class="ace rowCheck" name="rowCheck" /> <span class='lbl'></span></label></th>
|
||||
<th style="vertical-align:middle;" class="center">${(page.pageNum-1)*page.pageSize+index.index+1}</th>
|
||||
<%-- <th style="vertical-align:middle;" class="center">
|
||||
|
|
@ -209,10 +209,10 @@
|
|||
<script type="text/javascript">
|
||||
var uname = localStorage.getItem("uname");
|
||||
var pwd = localStorage.getItem("pwd");
|
||||
function topage(id,processName) {
|
||||
function topage(id,processName,isFinish) {
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "http://127.0.0.1:21522/gz-car/login/userLogin",
|
||||
url: "http://10.1.0.142:1999/gz_car/login/userLogin",
|
||||
data: {
|
||||
username: uname,
|
||||
password: pwd
|
||||
|
|
@ -224,11 +224,9 @@
|
|||
localStorage.setItem("name", name);
|
||||
//window.open("http://192.168.0.14:21625/gz-gqj/index.html")
|
||||
if(processName === '派车计划'){
|
||||
window.open("http://localhost:63343/gz_car_ui/page/car_demand_plan/child/dispatch_car_detail.html?id="+id +"&token="+data.token)
|
||||
|
||||
window.open("http://10.1.0.142:1999/gz-car/page/car_demand_plan/child/dispatch_car_detail.html?id="+id +"&token="+data.token +"&isFinish="+isFinish)
|
||||
}else if(processName === '用车计划'){
|
||||
window.open("http://localhost:63343/gz_car_ui/page/car_demand_plan/child/apply_plan_detail.html?id="+id +"&token="+data.token)
|
||||
|
||||
window.open("http://10.1.0.142:1999/gz-car/page/car_demand_plan/child/apply_plan_detail.html?id="+id +"&token="+data.token +"&isFinish="+isFinish)
|
||||
}
|
||||
} else {
|
||||
alert("没有权限!");
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
|
|
@ -18,7 +19,11 @@ import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
|||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import com.bonus.exp.POIOutputHelper;
|
||||
import com.bonus.rm.beans.ReturnMaterialTaskRecordBean;
|
||||
|
|
@ -46,15 +51,12 @@ public class ReturnMaterialTaskRecordController extends BaseController<ReturnMat
|
|||
public String show(Model model) {
|
||||
return "/rm/unFinishWorkList";
|
||||
}
|
||||
|
||||
@RequestMapping("detail")
|
||||
public String openFrom(Model model) {
|
||||
return "/rm/unFinishWorkListDetails";
|
||||
}
|
||||
|
||||
@RequestMapping(value = "findUnFinishContent", method = RequestMethod.POST)
|
||||
public String findUnFinishContent(@RequestBody Page<TaskRecordBean> page, HttpServletRequest request,
|
||||
TaskRecordBean o, Model model, HttpSession sess) {
|
||||
public String findUnFinishContent(@RequestBody Page<TaskRecordBean> page,HttpServletRequest request,TaskRecordBean o,Model model, HttpSession sess) {
|
||||
try {
|
||||
String a = request.getParameter("isFinish");
|
||||
String userId = UserShiroHelper.getRealCurrentUser().getId() + "";
|
||||
|
|
@ -62,12 +64,13 @@ public class ReturnMaterialTaskRecordController extends BaseController<ReturnMat
|
|||
// page.setUser(user);
|
||||
page.setIsFinish(a);
|
||||
if (!"1".equals(userId)) {
|
||||
page.setOperationUserId(userId);
|
||||
page.setOperationUserId(userId);
|
||||
}
|
||||
page.setIsFinish(a);
|
||||
page = service.findUnFinishContent(page, o);
|
||||
|
||||
page = service.findUnFinishContent(page,o);
|
||||
model.addAttribute("page", page);
|
||||
} catch (Exception e) {
|
||||
model.addAttribute("isFinish", a);
|
||||
}catch(Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.error(e.toString(), e);
|
||||
}
|
||||
|
|
@ -108,41 +111,6 @@ public class ReturnMaterialTaskRecordController extends BaseController<ReturnMat
|
|||
return ar;
|
||||
}
|
||||
|
||||
// 退租单备注修改
|
||||
@RequestMapping(value = "saveMaterialRequisition", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String, Object> saveMaterialRequisition(ReturnMaterialTaskRecordBean o) {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
try {
|
||||
List<ReturnMaterialTaskRecordBean> beanList = new ArrayList<ReturnMaterialTaskRecordBean>();
|
||||
String[] remarkMachines = o.getRemarkMachine().split(",");
|
||||
int res = service.updateRemarkbyTaskId(o); // 更新WF_TASK_RECORD 的总备注
|
||||
beanList = service.findIdByTaskId(o);
|
||||
|
||||
boolean flag = true;
|
||||
for (int i = 0; i < beanList.size(); i++) {
|
||||
o.setId(beanList.get(i).getId());
|
||||
if (remarkMachines.length > 0) {
|
||||
o.setRemarkMachine(remarkMachines[i]);
|
||||
}
|
||||
int res1 = service.updateRemarkMachinebyId(o);
|
||||
if (res1 != -1) {
|
||||
flag = true;
|
||||
} else {
|
||||
flag = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (flag && res != -1) {
|
||||
map.put("res", "修改成功");
|
||||
} else {
|
||||
map.put("res", "修改失败");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// logger.error(e.toString(), e);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "batchApproval", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
|
|
@ -159,71 +127,114 @@ public class ReturnMaterialTaskRecordController extends BaseController<ReturnMat
|
|||
return ar;
|
||||
}
|
||||
|
||||
// 待办详情
|
||||
//退租单备注修改
|
||||
@RequestMapping(value = "saveMaterialRequisition", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String , Object> saveMaterialRequisition(ReturnMaterialTaskRecordBean o) {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
try {
|
||||
List<ReturnMaterialTaskRecordBean> beanList = new ArrayList<ReturnMaterialTaskRecordBean>();
|
||||
String[] remarkMachines = o.getRemarkMachine().split(",");
|
||||
int res = service.updateRemarkbyTaskId(o); //更新WF_TASK_RECORD 的总备注
|
||||
beanList = service.findIdByTaskId(o);
|
||||
|
||||
boolean flag = true;
|
||||
for(int i = 0;i < beanList.size();i++){
|
||||
o.setId(beanList.get(i).getId());
|
||||
if(remarkMachines.length > 0){
|
||||
o.setRemarkMachine(remarkMachines[i]);
|
||||
}
|
||||
int res1 = service.updateRemarkMachinebyId(o);
|
||||
if(res1 != -1){
|
||||
flag = true;
|
||||
}else{
|
||||
flag = false;
|
||||
}
|
||||
}
|
||||
|
||||
if(flag && res != -1){
|
||||
map.put("res", "修改成功");
|
||||
}else{
|
||||
map.put("res", "修改失败");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error(e.toString(), e);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
//待办详情
|
||||
@RequestMapping(value = "findUnFinishContentDetails", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public List<ReturnMaterialTaskRecordBean> findUnFinishContentDetails(ReturnMaterialTaskRecordBean o) {
|
||||
List<ReturnMaterialTaskRecordBean> list = new ArrayList<ReturnMaterialTaskRecordBean>();
|
||||
try {
|
||||
|
||||
|
||||
list = service.findUnFinishContentDetails(o);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.toString(), e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
// @RequestMapping(value = "export", method = RequestMethod.GET)
|
||||
// public void export(Page<ReturnMaterialTaskRecordBean> page, HttpServletRequest request, HttpServletResponse response,
|
||||
// ReturnMaterialTaskRecordBean o) {
|
||||
// try {
|
||||
// String startTime = o.getStartTime();
|
||||
// String endTime = o.getEndTime();
|
||||
// String fileName = startTime + "-"+ endTime + "退料记录报表";
|
||||
// String companyId = UserShiroHelper.getRealCurrentUser().getCompanyId();
|
||||
// o.setCompanyId(companyId);
|
||||
// page.setPageSize(10000);
|
||||
// Page<ReturnMaterialTaskRecordBean> results = service.findByPage(o, page);
|
||||
// List<ReturnMaterialTaskRecordBean> list = results.getResults();
|
||||
// expOutExcel(response, list, fileName);
|
||||
// } catch (Exception e) {
|
||||
// logger.error(e.toString(), e);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// private void expOutExcel(HttpServletResponse response, List<ReturnMaterialTaskRecordBean> list, String filename) throws Exception {
|
||||
// if (list != null) {
|
||||
// List<Map<String, Object>> results = new ArrayList<Map<String, Object>>();
|
||||
// int size = list.size();
|
||||
// for (int i = 0; i < size; i++) {
|
||||
// ReturnMaterialTaskRecordBean bean = list.get(i);
|
||||
// Map<String, Object> maps = outCheckToMap(i, bean);
|
||||
// results.add(maps);
|
||||
// }
|
||||
// List<String> headers = reportHeader();
|
||||
// HSSFWorkbook workbook = POIOutputHelper.excel(results, headers, filename);
|
||||
// OutputStream out = null;
|
||||
// response.setContentType("application/vnd.ms-excel;charset=UTF-8");
|
||||
// response.addHeader("Content-Disposition",
|
||||
// "attachment;filename=" + URLEncoder.encode(filename, "UTF-8") + ".xls");
|
||||
// response.setHeader("Pragma", "No-cache");
|
||||
// out = response.getOutputStream();
|
||||
// workbook.write(out);
|
||||
// out.flush();
|
||||
// out.close();
|
||||
// }else{
|
||||
// List<Map<String, Object>> results = new ArrayList<Map<String, Object>>();
|
||||
// List<String> headers = reportHeader();
|
||||
// HSSFWorkbook workbook = POIOutputHelper.excel(results, headers, filename);
|
||||
// OutputStream out = null;
|
||||
// response.setContentType("application/vnd.ms-excel;charset=UTF-8");
|
||||
// response.addHeader("Content-Disposition",
|
||||
// "attachment;filename=" + URLEncoder.encode(filename, "UTF-8") + ".xls");
|
||||
// response.setHeader("Pragma", "No-cache");
|
||||
// out = response.getOutputStream();
|
||||
// workbook.write(out);
|
||||
// out.flush();
|
||||
// out.close();
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@RequestMapping(value = "export", method = RequestMethod.GET)
|
||||
public void export(Page<ReturnMaterialTaskRecordBean> page, HttpServletRequest request, HttpServletResponse response,
|
||||
ReturnMaterialTaskRecordBean o) {
|
||||
try {
|
||||
String startTime = o.getStartTime();
|
||||
String endTime = o.getEndTime();
|
||||
String fileName = startTime + "-"+ endTime + "退料记录报表";
|
||||
String companyId = UserShiroHelper.getRealCurrentUser().getCompanyId();
|
||||
o.setCompanyId(companyId);
|
||||
page.setPageSize(10000);
|
||||
Page<ReturnMaterialTaskRecordBean> results = service.findByPage(o, page);
|
||||
List<ReturnMaterialTaskRecordBean> list = results.getResults();
|
||||
expOutExcel(response, list, fileName);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.toString(), e);
|
||||
}
|
||||
}
|
||||
|
||||
private void expOutExcel(HttpServletResponse response, List<ReturnMaterialTaskRecordBean> list, String filename) throws Exception {
|
||||
if (list != null) {
|
||||
List<Map<String, Object>> results = new ArrayList<Map<String, Object>>();
|
||||
int size = list.size();
|
||||
for (int i = 0; i < size; i++) {
|
||||
ReturnMaterialTaskRecordBean bean = list.get(i);
|
||||
Map<String, Object> maps = outCheckToMap(i, bean);
|
||||
results.add(maps);
|
||||
}
|
||||
List<String> headers = reportHeader();
|
||||
HSSFWorkbook workbook = POIOutputHelper.excel(results, headers, filename);
|
||||
OutputStream out = null;
|
||||
response.setContentType("application/vnd.ms-excel;charset=UTF-8");
|
||||
response.addHeader("Content-Disposition",
|
||||
"attachment;filename=" + URLEncoder.encode(filename, "UTF-8") + ".xls");
|
||||
response.setHeader("Pragma", "No-cache");
|
||||
out = response.getOutputStream();
|
||||
workbook.write(out);
|
||||
out.flush();
|
||||
out.close();
|
||||
}else{
|
||||
List<Map<String, Object>> results = new ArrayList<Map<String, Object>>();
|
||||
List<String> headers = reportHeader();
|
||||
HSSFWorkbook workbook = POIOutputHelper.excel(results, headers, filename);
|
||||
OutputStream out = null;
|
||||
response.setContentType("application/vnd.ms-excel;charset=UTF-8");
|
||||
response.addHeader("Content-Disposition",
|
||||
"attachment;filename=" + URLEncoder.encode(filename, "UTF-8") + ".xls");
|
||||
response.setHeader("Pragma", "No-cache");
|
||||
out = response.getOutputStream();
|
||||
workbook.write(out);
|
||||
out.flush();
|
||||
out.close();
|
||||
}
|
||||
}
|
||||
|
||||
private Map<String, Object> outCheckToMap(int i, ReturnMaterialTaskRecordBean o) {
|
||||
Map<String, Object> maps = new LinkedHashMap<String, Object>();
|
||||
|
|
@ -241,15 +252,15 @@ public class ReturnMaterialTaskRecordController extends BaseController<ReturnMat
|
|||
maps.put("thisBackNum", o.getThisBackNum());
|
||||
maps.put("returnMaterialTime", o.getReturnMaterialTime());
|
||||
String rmStatus = o.getRmStatus();
|
||||
if ("1".equals(rmStatus)) {
|
||||
if("1".equals(rmStatus) ){
|
||||
rmStatus = "合格入库";
|
||||
} else if ("4".equals(rmStatus) || "3".equals(rmStatus)) {
|
||||
}else if("4".equals(rmStatus) ||"3".equals(rmStatus) ){
|
||||
rmStatus = "待报废 ";
|
||||
} else if ("7".equals(rmStatus) || "2".equals(rmStatus) || "5".equals(rmStatus)) {
|
||||
}else if("7".equals(rmStatus) || "2".equals(rmStatus) || "5".equals(rmStatus) ){
|
||||
rmStatus = "待修 ";
|
||||
}
|
||||
|
||||
maps.put("rmStatus", rmStatus);
|
||||
maps.put("rmStatus",rmStatus );
|
||||
return maps;
|
||||
}
|
||||
|
||||
|
|
@ -272,4 +283,6 @@ public class ReturnMaterialTaskRecordController extends BaseController<ReturnMat
|
|||
return list;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue