|
@@ -4,13 +4,20 @@ import java.security.interfaces.ECKey;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
|
|
|
+import cn.hutool.core.bean.BeanUtil;
|
|
|
+import com.alibaba.excel.EasyExcel;
|
|
|
+import com.alibaba.excel.ExcelWriter;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import com.fdkankan.sale.common.CacheUtil;
|
|
|
import com.fdkankan.sale.entity.PriceList;
|
|
|
import com.fdkankan.sale.entity.RepairLog;
|
|
|
import com.fdkankan.sale.entity.SysUser;
|
|
|
+import com.fdkankan.sale.service.IExcelService;
|
|
|
import com.fdkankan.sale.service.IRepairLogService;
|
|
|
import com.fdkankan.sale.util.StatusUtil;
|
|
|
-import com.fdkankan.sale.vo.response.PriceListExcelVo;
|
|
|
+import com.fdkankan.sale.vo.request.RepairPayParam;
|
|
|
+import com.fdkankan.sale.vo.response.*;
|
|
|
import com.google.common.collect.Lists;
|
|
|
|
|
|
import com.fdkankan.sale.common.ResultCode;
|
|
@@ -21,13 +28,15 @@ import com.fdkankan.sale.service.impl.RepairInfoService;
|
|
|
import com.fdkankan.sale.util.MyExcelUtil;
|
|
|
import com.fdkankan.sale.util.OrderListVo;
|
|
|
import com.fdkankan.sale.vo.request.RepairInfoListParam;
|
|
|
-import com.fdkankan.sale.vo.response.RepairDetailVo;
|
|
|
import lombok.Data;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
+import javax.servlet.http.HttpServletRequest;
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
+
|
|
|
@RestController
|
|
|
@RequestMapping("/sale/repairInfo")
|
|
|
public class RepairInfoController extends BaseController{
|
|
@@ -38,6 +47,10 @@ public class RepairInfoController extends BaseController{
|
|
|
MyExcelUtil excelUtil;
|
|
|
@Autowired
|
|
|
IRepairLogService repairLogService;
|
|
|
+ @Autowired
|
|
|
+ IRepairService repairService;
|
|
|
+ @Autowired
|
|
|
+ IExcelService excelService;
|
|
|
|
|
|
@GetMapping("/details")
|
|
|
public ResultData details(@RequestParam(required = false) String repairId){
|
|
@@ -73,11 +86,54 @@ public class RepairInfoController extends BaseController{
|
|
|
return ResultData.ok(repairInfoService.getProcessByRepairId(repairId,type));
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 工单查询
|
|
|
+ */
|
|
|
@PostMapping("/list")
|
|
|
public ResultData list(@RequestBody RepairInfoListParam param){
|
|
|
+ CacheUtil.repairInfoListParam = param;
|
|
|
return ResultData.ok(repairInfoService.pageList(param));
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 工单查询导出
|
|
|
+ */
|
|
|
+ @GetMapping("/exportRepairInfo")
|
|
|
+ public void exportRepairInfo(HttpServletRequest request, HttpServletResponse response){
|
|
|
+ RepairInfoListParam param = CacheUtil.repairInfoListParam;
|
|
|
+ param.setPageNum(1);
|
|
|
+ param.setPageSize(500);
|
|
|
+ Page<RepairerVo> voPage = repairService.pageInfoList(param);
|
|
|
+
|
|
|
+ ExcelWriter excelWriter = null;
|
|
|
+ try {
|
|
|
+ excelWriter = EasyExcel.write(response.getOutputStream(),RepairPayVo.class).build();
|
|
|
+ for (int pageNum = 1; pageNum <= voPage.getPages(); pageNum ++ ) {
|
|
|
+ if(pageNum >1){
|
|
|
+ param.setPageNum(pageNum);
|
|
|
+ voPage = repairService.pageInfoList(param);
|
|
|
+ }
|
|
|
+ List<RepairerVo> records = voPage.getRecords();
|
|
|
+ List<RepairInfoExportVo> list = new ArrayList<>();
|
|
|
+ for (RepairerVo record : records) {
|
|
|
+ RepairInfoExportVo vo = new RepairInfoExportVo();
|
|
|
+ BeanUtils.copyProperties(record,vo);
|
|
|
+ list.add(vo);
|
|
|
+ }
|
|
|
+ excelService.commonExport(request,response,"工单详情",list,excelWriter);
|
|
|
+ }
|
|
|
+
|
|
|
+ }catch (Exception e){
|
|
|
+ e.printStackTrace();
|
|
|
+ }finally {
|
|
|
+ if(excelWriter != null){
|
|
|
+ excelWriter.finish();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 0 四维时代服务清单(模板)
|
|
|
* 1 维修服务工作单(模板)
|
|
@@ -97,4 +153,5 @@ public class RepairInfoController extends BaseController{
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
}
|