|
@@ -1,6 +1,7 @@
|
|
package com.iamberry.rst.controllers.cm;
|
|
package com.iamberry.rst.controllers.cm;
|
|
|
|
|
|
import com.iamberry.rst.core.cm.CompanyInfo;
|
|
import com.iamberry.rst.core.cm.CompanyInfo;
|
|
|
|
+import com.iamberry.rst.core.cm.SalesOrder;
|
|
import com.iamberry.rst.core.fm.*;
|
|
import com.iamberry.rst.core.fm.*;
|
|
import com.iamberry.rst.core.order.Product;
|
|
import com.iamberry.rst.core.order.Product;
|
|
import com.iamberry.rst.core.order.ProductColor;
|
|
import com.iamberry.rst.core.order.ProductColor;
|
|
@@ -23,6 +24,7 @@ import com.iamberry.rst.utils.AdminUtils;
|
|
import com.iamberry.rst.utils.GenerateKeyUtil;
|
|
import com.iamberry.rst.utils.GenerateKeyUtil;
|
|
import com.iamberry.rst.utils.StitchAttrUtil;
|
|
import com.iamberry.rst.utils.StitchAttrUtil;
|
|
import com.iamberry.wechat.tools.ResponseJson;
|
|
import com.iamberry.wechat.tools.ResponseJson;
|
|
|
|
+import org.apache.poi.hssf.usermodel.*;
|
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Controller;
|
|
import org.springframework.stereotype.Controller;
|
|
@@ -31,7 +33,10 @@ import org.springframework.web.bind.annotation.RequestParam;
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
|
|
|
|
|
|
+import javax.servlet.ServletOutputStream;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
|
+import java.io.*;
|
|
import java.text.SimpleDateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
import java.util.Calendar;
|
|
import java.util.Calendar;
|
|
import java.util.Date;
|
|
import java.util.Date;
|
|
@@ -261,6 +266,12 @@ public class AdminDetectController {
|
|
}
|
|
}
|
|
ComplaintDetectInfo detectinfo = complaintDetectInfoService.getDetectById(Integer.valueOf(detectId));
|
|
ComplaintDetectInfo detectinfo = complaintDetectInfoService.getDetectById(Integer.valueOf(detectId));
|
|
List<ComplaintDetectImg> imgList = complaintDetectInfoService.listDetectImg(Integer.valueOf(detectId));
|
|
List<ComplaintDetectImg> imgList = complaintDetectInfoService.listDetectImg(Integer.valueOf(detectId));
|
|
|
|
+ List<MaterialItem> listMaterialItem = complaintDetectInfoService.listMaterialItem(Integer.valueOf(detectId));
|
|
|
|
+ List<QcInfo> listQcInfo = complaintDetectInfoService.listQcInfo(Integer.valueOf(detectId));
|
|
|
|
+ List<TreatmentRecordLog> listTreatmentRecordLog = complaintDetectInfoService.listTreatmentRecordLog(Integer.valueOf(detectId));
|
|
|
|
+ mv.addObject("listTreatmentRecordLog",listTreatmentRecordLog);
|
|
|
|
+ mv.addObject("listQcInfo",listQcInfo);
|
|
|
|
+ mv.addObject("listMaterialItem",listMaterialItem);
|
|
mv.addObject("detectinfo",detectinfo);
|
|
mv.addObject("detectinfo",detectinfo);
|
|
mv.addObject("imgList",imgList);
|
|
mv.addObject("imgList",imgList);
|
|
return mv;
|
|
return mv;
|
|
@@ -281,6 +292,37 @@ public class AdminDetectController {
|
|
}
|
|
}
|
|
ComplaintDetectInfo detectinfo = complaintDetectInfoService.getDetectById(Integer.valueOf(detectId));
|
|
ComplaintDetectInfo detectinfo = complaintDetectInfoService.getDetectById(Integer.valueOf(detectId));
|
|
List<ComplaintDetectImg> imgList = complaintDetectInfoService.listDetectImg(Integer.valueOf(detectId));
|
|
List<ComplaintDetectImg> imgList = complaintDetectInfoService.listDetectImg(Integer.valueOf(detectId));
|
|
|
|
+ DetectionItem detectionItem = new DetectionItem();
|
|
|
|
+ detectionItem.setDetectId(Integer.valueOf(detectId));
|
|
|
|
+
|
|
|
|
+ //查询维修配置信息
|
|
|
|
+ List<DetectionConfig> config1 = complaintDetectInfoService.listDetectionConfig(1);
|
|
|
|
+ List<DetectionConfig> config2 = complaintDetectInfoService.listDetectionConfig(2);
|
|
|
|
+ List<DetectionConfig> config3 = complaintDetectInfoService.listDetectionConfig(3);
|
|
|
|
+ List<DetectionConfig> config4 = complaintDetectInfoService.listDetectionConfig(4);
|
|
|
|
+ List<DetectionConfig> config5 = complaintDetectInfoService.listDetectionConfig(5);
|
|
|
|
+ mv.addObject("config1",config1);
|
|
|
|
+ mv.addObject("config2",config2);
|
|
|
|
+ mv.addObject("config3",config3);
|
|
|
|
+ mv.addObject("config4",config4);
|
|
|
|
+ mv.addObject("config5",config5);
|
|
|
|
+ //查询检测现象
|
|
|
|
+ detectionItem.setConfigType(1);
|
|
|
|
+ mv.addObject("detectPhenomenonList",complaintDetectInfoService.listDetectionItem(detectionItem));
|
|
|
|
+ //查询故障原因
|
|
|
|
+ detectionItem.setConfigType(2);
|
|
|
|
+ mv.addObject("detectFailureCauseList",complaintDetectInfoService.listDetectionItem(detectionItem));
|
|
|
|
+ //查询判定结果
|
|
|
|
+ detectionItem.setConfigType(3);
|
|
|
|
+ mv.addObject("detectResultsList",complaintDetectInfoService.listDetectionItem(detectionItem));
|
|
|
|
+ //查询故障指向
|
|
|
|
+ detectionItem.setConfigType(4);
|
|
|
|
+ mv.addObject("detectPointList",complaintDetectInfoService.listDetectionItem(detectionItem));
|
|
|
|
+ //查询原因分析
|
|
|
|
+ detectionItem.setConfigType(5);
|
|
|
|
+ mv.addObject("detectNalysisList",complaintDetectInfoService.listDetectionItem(detectionItem));
|
|
|
|
+
|
|
|
|
+
|
|
mv.addObject("detectInfo",detectinfo);
|
|
mv.addObject("detectInfo",detectinfo);
|
|
mv.addObject("imgList",imgList);
|
|
mv.addObject("imgList",imgList);
|
|
return mv;
|
|
return mv;
|
|
@@ -348,6 +390,18 @@ public class AdminDetectController {
|
|
return msg;
|
|
return msg;
|
|
}
|
|
}
|
|
/*String[] componentsImgs = request.getParameterValues("componentsImg");*/
|
|
/*String[] componentsImgs = request.getParameterValues("componentsImg");*/
|
|
|
|
+ String[] configli1 = request.getParameterValues("configli1");
|
|
|
|
+ String[] configli2 = request.getParameterValues("configli2");
|
|
|
|
+ String[] configli3 = request.getParameterValues("configli3");
|
|
|
|
+ String[] configli4 = request.getParameterValues("configli4");
|
|
|
|
+ String[] configli5 = request.getParameterValues("configli5");
|
|
|
|
+ String[] configli6 = request.getParameterValues("configli6");
|
|
|
|
+ detectInfo.setConfigli1(configli1);
|
|
|
|
+ detectInfo.setConfigli2(configli2);
|
|
|
|
+ detectInfo.setConfigli3(configli3);
|
|
|
|
+ detectInfo.setConfigli4(configli4);
|
|
|
|
+ detectInfo.setConfigli5(configli5);
|
|
|
|
+ detectInfo.setConfigli6(configli6);
|
|
Integer num = complaintDetectInfoService.updateDetectById(detectInfo);
|
|
Integer num = complaintDetectInfoService.updateDetectById(detectInfo);
|
|
|
|
|
|
if (num < 1) {
|
|
if (num < 1) {
|
|
@@ -361,6 +415,74 @@ public class AdminDetectController {
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
|
|
+ * 修改qc检测信息
|
|
|
|
+ * @param request
|
|
|
|
+ * @return
|
|
|
|
+ * @throws Exception
|
|
|
|
+ */
|
|
|
|
+ @RequiresPermissions("info:update:info")
|
|
|
|
+ @ResponseBody
|
|
|
|
+ @RequestMapping("/update_qc")
|
|
|
|
+ public ResponseJson updateQC(HttpServletRequest request, ComplaintDetectInfo detectInfo) throws Exception {
|
|
|
|
+ ResponseJson msg = new ResponseJson();
|
|
|
|
+ if(detectInfo == null){
|
|
|
|
+ msg.setResultCode(500);
|
|
|
|
+ msg.setReturnCode(500);
|
|
|
|
+ return msg;
|
|
|
|
+ }
|
|
|
|
+ if(detectInfo.getDetectId() == null){
|
|
|
|
+ msg.setResultCode(500);
|
|
|
|
+ msg.setReturnCode(500);
|
|
|
|
+ return msg;
|
|
|
|
+ }
|
|
|
|
+ Integer num = complaintDetectInfoService.updateDetectQc(detectInfo);
|
|
|
|
+
|
|
|
|
+ if (num < 1) {
|
|
|
|
+ msg.setResultCode(500);
|
|
|
|
+ msg.setReturnCode(500);
|
|
|
|
+ } else {
|
|
|
|
+ msg.setResultCode(200);
|
|
|
|
+ msg.setReturnCode(200);
|
|
|
|
+ }
|
|
|
|
+ return msg;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 修改维修内容
|
|
|
|
+ * @param request
|
|
|
|
+ * @return
|
|
|
|
+ * @throws Exception
|
|
|
|
+ */
|
|
|
|
+ @RequiresPermissions("info:update:info")
|
|
|
|
+ @ResponseBody
|
|
|
|
+ @RequestMapping("/update_content")
|
|
|
|
+ public ResponseJson update_content(HttpServletRequest request, ComplaintDetectInfo detectInfo) throws Exception {
|
|
|
|
+ ResponseJson msg = new ResponseJson();
|
|
|
|
+ if(detectInfo == null){
|
|
|
|
+ msg.setResultCode(500);
|
|
|
|
+ msg.setReturnCode(500);
|
|
|
|
+ return msg;
|
|
|
|
+ }
|
|
|
|
+ if(detectInfo.getDetectId() == null){
|
|
|
|
+ msg.setResultCode(500);
|
|
|
|
+ msg.setReturnCode(500);
|
|
|
|
+ return msg;
|
|
|
|
+ }
|
|
|
|
+ String[] configli6 = request.getParameterValues("configli6");
|
|
|
|
+ detectInfo.setConfigli6(configli6);
|
|
|
|
+ Integer num = complaintDetectInfoService.updateDetectContent(detectInfo);
|
|
|
|
+
|
|
|
|
+ if (num < 1) {
|
|
|
|
+ msg.setResultCode(500);
|
|
|
|
+ msg.setReturnCode(500);
|
|
|
|
+ } else {
|
|
|
|
+ msg.setResultCode(200);
|
|
|
|
+ msg.setReturnCode(200);
|
|
|
|
+ }
|
|
|
|
+ return msg;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
* 跳转到查看仓储进度页面
|
|
* 跳转到查看仓储进度页面
|
|
*
|
|
*
|
|
* @return
|
|
* @return
|
|
@@ -418,6 +540,17 @@ public class AdminDetectController {
|
|
return mv;
|
|
return mv;
|
|
}
|
|
}
|
|
ComplaintDetectInfo detectInfo = complaintDetectInfoService.getDetectById(Integer.valueOf(detectId));
|
|
ComplaintDetectInfo detectInfo = complaintDetectInfoService.getDetectById(Integer.valueOf(detectId));
|
|
|
|
+ //查询维修配置信息
|
|
|
|
+ List<DetectionConfig> config1 = complaintDetectInfoService.listDetectionConfig(1);
|
|
|
|
+ List<DetectionConfig> config2 = complaintDetectInfoService.listDetectionConfig(2);
|
|
|
|
+ List<DetectionConfig> config3 = complaintDetectInfoService.listDetectionConfig(3);
|
|
|
|
+ List<DetectionConfig> config4 = complaintDetectInfoService.listDetectionConfig(4);
|
|
|
|
+ List<DetectionConfig> config5 = complaintDetectInfoService.listDetectionConfig(5);
|
|
|
|
+ mv.addObject("config1",config1);
|
|
|
|
+ mv.addObject("config2",config2);
|
|
|
|
+ mv.addObject("config3",config3);
|
|
|
|
+ mv.addObject("config4",config4);
|
|
|
|
+ mv.addObject("config5",config5);
|
|
detectInfo.setDetectDate(new Date());
|
|
detectInfo.setDetectDate(new Date());
|
|
mv.addObject("detectId",detectId);
|
|
mv.addObject("detectId",detectId);
|
|
mv.addObject("detectInfo",detectInfo);
|
|
mv.addObject("detectInfo",detectInfo);
|
|
@@ -509,7 +642,16 @@ public class AdminDetectController {
|
|
detectInfo.setDetectDate(format.parse(detectDate));
|
|
detectInfo.setDetectDate(format.parse(detectDate));
|
|
}
|
|
}
|
|
String[] componentsImgs = request.getParameterValues("componentsImg");
|
|
String[] componentsImgs = request.getParameterValues("componentsImg");
|
|
-
|
|
|
|
|
|
+ String[] configli1 = request.getParameterValues("configli1");
|
|
|
|
+ String[] configli2 = request.getParameterValues("configli2");
|
|
|
|
+ String[] configli3 = request.getParameterValues("configli3");
|
|
|
|
+ String[] configli4 = request.getParameterValues("configli4");
|
|
|
|
+ String[] configli5 = request.getParameterValues("configli5");
|
|
|
|
+ detectInfo.setConfigli1(configli1);
|
|
|
|
+ detectInfo.setConfigli2(configli2);
|
|
|
|
+ detectInfo.setConfigli3(configli3);
|
|
|
|
+ detectInfo.setConfigli4(configli4);
|
|
|
|
+ detectInfo.setConfigli5(configli5);
|
|
Integer num = complaintDetectInfoService.updateDetectById(detectInfo,componentsImgs);
|
|
Integer num = complaintDetectInfoService.updateDetectById(detectInfo,componentsImgs);
|
|
if (num < 1) {
|
|
if (num < 1) {
|
|
msg.setResultCode(500);
|
|
msg.setResultCode(500);
|
|
@@ -599,7 +741,8 @@ public class AdminDetectController {
|
|
msg.setReturnCode(500);
|
|
msg.setReturnCode(500);
|
|
return msg;
|
|
return msg;
|
|
}
|
|
}
|
|
- if (!complaintDetectInfoService.customerConfirm(detectInfo)) {
|
|
|
|
|
|
+ Admin admin = AdminUtils.getLoginAdmin();
|
|
|
|
+ if (!complaintDetectInfoService.customerConfirm(detectInfo,admin)) {
|
|
msg.setResultCode(500);
|
|
msg.setResultCode(500);
|
|
msg.setReturnCode(500);
|
|
msg.setReturnCode(500);
|
|
} else {
|
|
} else {
|
|
@@ -610,5 +753,212 @@ public class AdminDetectController {
|
|
}
|
|
}
|
|
return msg;
|
|
return msg;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 查询维修信息条数
|
|
|
|
+ * @param request
|
|
|
|
+ * @param res
|
|
|
|
+ * @param detectInfo
|
|
|
|
+ * @throws Exception
|
|
|
|
+ */
|
|
|
|
+ @ResponseBody
|
|
|
|
+ @RequiresPermissions("detect:select:detect")
|
|
|
|
+ @RequestMapping("/detect_excel_num")
|
|
|
|
+ public ResponseJson salesOrderExcelNum(HttpServletRequest request,HttpServletResponse res
|
|
|
|
+ , ComplaintDetectInfo detectInfo) throws Exception{
|
|
|
|
+ ResponseJson msg = new ResponseJson();
|
|
|
|
+ //根据条件查询维修数据
|
|
|
|
+ List<ComplaintDetectInfo> detectList = complaintDetectInfoService.listComplaintDetect(detectInfo);
|
|
|
|
+ if (detectList == null || detectList.size() == 0) {
|
|
|
|
+ msg.setResultCode(500);
|
|
|
|
+ msg.setReturnCode(500);
|
|
|
|
+ return msg;
|
|
|
|
+ }
|
|
|
|
+ msg.setResultCode(200);
|
|
|
|
+ msg.setReturnCode(200);
|
|
|
|
+ return msg;
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ /**
|
|
|
|
+ * 导出维修信息
|
|
|
|
+ * @param request
|
|
|
|
+ * @param res
|
|
|
|
+ * @param detectInfo
|
|
|
|
+ * @throws Exception
|
|
|
|
+ */
|
|
|
|
+ @RequiresPermissions("detect:select:detect")
|
|
|
|
+ @RequestMapping("/detect_excel")
|
|
|
|
+ public void salesOrderExcel(HttpServletRequest request,HttpServletResponse res
|
|
|
|
+ , ComplaintDetectInfo detectInfo) throws Exception{
|
|
|
|
+ //根据id查询订单数据
|
|
|
|
+ List<ComplaintDetectInfo> detectList = complaintDetectInfoService.listComplaintDetect(detectInfo);
|
|
|
|
+ if (detectList == null || detectList.size() == 0) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ String[] cells = {
|
|
|
|
+ "维修编号","产品名称","颜色","生产月份","机身条码",
|
|
|
|
+ "退货地区","返厂日期","购买日期","客诉日期","客诉类型",
|
|
|
|
+ "客诉问题","售后原因","售后处理类型","工厂检测现象","是否翻新机",
|
|
|
|
+ "故障原因","判断结果","故障指向","原因分析",
|
|
|
|
+ "维修内容","厚膜类型","浮子类型","版本号"
|
|
|
|
+ };
|
|
|
|
+ exportExcel(request,res,cells,detectList);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 导出订单Excel并下载
|
|
|
|
+ * @param request
|
|
|
|
+ * @param res
|
|
|
|
+ * @param cells
|
|
|
|
+ * @param detectList
|
|
|
|
+ * @throws Exception
|
|
|
|
+ */
|
|
|
|
+ public void exportExcel(HttpServletRequest request,HttpServletResponse res,
|
|
|
|
+ String[] cells,List<ComplaintDetectInfo> detectList) throws Exception {
|
|
|
|
+ SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|
+ //创建一个workbook,对应一个Excel文件
|
|
|
|
+ HSSFWorkbook wb = new HSSFWorkbook();
|
|
|
|
+ //在workbook中添加一个sheet,对应Excel中的一个sheet
|
|
|
|
+ HSSFSheet sheet = wb.createSheet("导出维修");
|
|
|
|
+ //在sheet中添加表头第0行,老版本poi对excel行数列数有限制short
|
|
|
|
+ HSSFRow row = sheet.createRow((int) 0);
|
|
|
|
+ //创建单元格,设置值表头,设置表头居中
|
|
|
|
+ HSSFCellStyle style = wb.createCellStyle();
|
|
|
|
+ //居中格式
|
|
|
|
+ style.setAlignment(HSSFCellStyle.ALIGN_CENTER);
|
|
|
|
+ //设置表头
|
|
|
|
+
|
|
|
|
+ if (cells == null || cells.length == 0) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ //循环设置表头
|
|
|
|
+ HSSFCell cell = null;
|
|
|
|
+ for (int i = 0;i < cells.length;i++) {
|
|
|
|
+ String name = cells[i];
|
|
|
|
+ cell = row.createCell(i);
|
|
|
|
+ cell.setCellValue(name);
|
|
|
|
+ cell.setCellStyle(style);
|
|
|
|
+ }
|
|
|
|
+ for (int i = 0; i < detectList.size(); i++) {
|
|
|
|
+ row = sheet.createRow((int) i + 1);
|
|
|
|
+ ComplaintDetectInfo detect = detectList.get(i);
|
|
|
|
+ String detectFilmType = "";
|
|
|
|
+ if(detect.getDetectFilmType() != null){
|
|
|
|
+ switch (detect.getDetectFilmType()) {
|
|
|
|
+ case 1:detectFilmType = "圆";break;
|
|
|
|
+ case 2:detectFilmType = "扁";break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ String detectIsRefurbishing = "";
|
|
|
|
+ if(detect.getDetectIsRefurbishing() != null){
|
|
|
|
+ switch (detect.getDetectIsRefurbishing()) {
|
|
|
|
+ case 1:detectIsRefurbishing = "是";break;
|
|
|
|
+ case 2:detectIsRefurbishing = "否";break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ String detectFloatType = "";
|
|
|
|
+ if(detect.getDetectFloatType() != null){
|
|
|
|
+ switch (detect.getDetectFloatType()) {
|
|
|
|
+ case 1:detectFloatType = "长";break;
|
|
|
|
+ case 2:detectFloatType = "短";break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ // 创建单元格,设置值
|
|
|
|
+ row.createCell(0).setCellValue(detect.getDetectNumber()==null?"":detect.getDetectNumber());
|
|
|
|
+ row.createCell(1).setCellValue(detect.getProductName()==null?"":detect.getProductName());
|
|
|
|
+ row.createCell(2).setCellValue(detect.getColorName()==null?"":detect.getColorName());
|
|
|
|
+ row.createCell(3).setCellValue(detect.getDetectProduction()==null?"":detect.getDetectProduction());
|
|
|
|
+ row.createCell(4).setCellValue(detect.getDetectFuselageBarcode()==null?"":detect.getDetectFuselageBarcode());
|
|
|
|
+ StringBuffer area = new StringBuffer(" ");
|
|
|
|
+ if(detect.getSignclosedAddrProvincesName() == null || detect.getSignclosedAddrProvincesName().equals("")){
|
|
|
|
+ area.append("");
|
|
|
|
+ }else{
|
|
|
|
+ area.append(detect.getSignclosedAddrProvincesName());
|
|
|
|
+ }
|
|
|
|
+ if(detect.getSignclosedAddrProvincesName() == null || detect.getSignclosedAddrProvincesName().equals("")){
|
|
|
|
+ area.append("");
|
|
|
|
+ }else{
|
|
|
|
+ area.append("-"+detect.getSignclosedAddrProvincesName());
|
|
|
|
+ }
|
|
|
|
+ if(detect.getSignclosedAddrCityName() == null || detect.getSignclosedAddrCityName().equals("")){
|
|
|
|
+ area.append("");
|
|
|
|
+ }else{
|
|
|
|
+ area.append("-"+detect.getSignclosedAddrCityName());
|
|
|
|
+ }
|
|
|
|
+ row.createCell(5).setCellValue(area.toString());
|
|
|
|
+ if(detect.getSignclosedDate()==null){
|
|
|
|
+ row.createCell(6).setCellValue( "");
|
|
|
|
+ }else{
|
|
|
|
+ row.createCell(6).setCellValue(detect.getSignclosedDate());
|
|
|
|
+ }
|
|
|
|
+ if(detect.getSalesTime()==null){
|
|
|
|
+ row.createCell(7).setCellValue( "");
|
|
|
|
+ }else{
|
|
|
|
+ row.createCell(7).setCellValue(detect.getSalesTime());
|
|
|
|
+ }
|
|
|
|
+ if(detect.getCustomerCreateTime()==null){
|
|
|
|
+ row.createCell(8).setCellValue("");
|
|
|
|
+ }else{
|
|
|
|
+ row.createCell(8).setCellValue(detect.getCustomerCreateTime());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ row.createCell(9).setCellValue(detect.getProcTypeName()==null?"":detect.getProcTypeName());
|
|
|
|
+ row.createCell(10).setCellValue(detect.getQuestionTitle()==null?"":detect.getQuestionTitle());
|
|
|
|
+ row.createCell(12).setCellValue(detect.getProcMethodName()==null?"":detect.getProcMethodName());
|
|
|
|
+ row.createCell(13).setCellValue(detect.getDetectPhenomenon()==null?"":detect.getDetectPhenomenon());
|
|
|
|
+ row.createCell(14).setCellValue(detectIsRefurbishing);
|
|
|
|
+ row.createCell(15).setCellValue(detect.getDetectFailureCause()==null?"":detect.getDetectFailureCause());
|
|
|
|
+ row.createCell(16).setCellValue(detect.getDetectResults()==null?"":detect.getDetectResults());
|
|
|
|
+ row.createCell(17).setCellValue(detect.getDetectPoint()==null?"":detect.getDetectPoint());
|
|
|
|
+ row.createCell(18).setCellValue(detect.getDetectNalysis()==null?"":detect.getDetectNalysis());
|
|
|
|
+ row.createCell(19).setCellValue(detect.getDetectContent()==null?"":detect.getDetectContent());
|
|
|
|
+ row.createCell(20).setCellValue(detectFilmType);
|
|
|
|
+ row.createCell(21).setCellValue(detectFloatType);
|
|
|
|
+ row.createCell(22).setCellValue(detect.getDetectVersionNumber()==null?"":detect.getDetectVersionNumber());
|
|
|
|
+ }
|
|
|
|
+ //下载导出订单Excel
|
|
|
|
+ downloadOrderExcel(res,wb);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 下载导出订单Excel
|
|
|
|
+ * @param res
|
|
|
|
+ * @param wb
|
|
|
|
+ * @throws Exception
|
|
|
|
+ */
|
|
|
|
+ public void downloadOrderExcel(HttpServletResponse res, HSSFWorkbook wb) throws Exception{
|
|
|
|
+ SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
+ String fileName = format.format(new Date()) + "维修报表";
|
|
|
|
+ ByteArrayOutputStream os = new ByteArrayOutputStream();
|
|
|
|
+ wb.write(os);
|
|
|
|
+ byte[] content = os.toByteArray();
|
|
|
|
+ InputStream is = new ByteArrayInputStream(content);
|
|
|
|
+ // 设置response参数,可以打开下载页面
|
|
|
|
+ res.reset();
|
|
|
|
+ res.setContentType("application/vnd.ms-excel;charset=utf-8");
|
|
|
|
+ res.setHeader("Content-Disposition", "attachment;filename="
|
|
|
|
+ + new String((fileName + ".xls").getBytes(), "iso-8859-1"));
|
|
|
|
+ ServletOutputStream out = res.getOutputStream();
|
|
|
|
+ BufferedInputStream bis = null;
|
|
|
|
+ BufferedOutputStream bos = null;
|
|
|
|
+ try {
|
|
|
|
+ bis = new BufferedInputStream(is);
|
|
|
|
+ bos = new BufferedOutputStream(out);
|
|
|
|
+ byte[] buff = new byte[2048];
|
|
|
|
+ int bytesRead;
|
|
|
|
+ // Simple read/write loop.
|
|
|
|
+ while (-1 != (bytesRead = bis.read(buff, 0, buff.length))) {
|
|
|
|
+ bos.write(buff, 0, bytesRead);
|
|
|
|
+ }
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ // TODO: handle exception
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ } finally {
|
|
|
|
+ if (bis != null)
|
|
|
|
+ bis.close();
|
|
|
|
+ if (bos != null)
|
|
|
|
+ bos.close();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|