mirror of
https://gitee.com/elegant_wings/dbd-meeting.git
synced 2025-06-21 22:59:36 +08:00
工单导出
This commit is contained in:
parent
cca5ba996e
commit
17920f225c
@ -8,6 +8,8 @@ import com.ics.admin.domain.RepairDeviceType;
|
|||||||
import com.ics.admin.service.IRepairIOSerice;
|
import com.ics.admin.service.IRepairIOSerice;
|
||||||
import com.ics.admin.service.IRepairService;
|
import com.ics.admin.service.IRepairService;
|
||||||
import com.ics.admin.utils.EasyPoiUtils;
|
import com.ics.admin.utils.EasyPoiUtils;
|
||||||
|
import com.ics.admin.utils.ExcelView;
|
||||||
|
import com.ics.admin.vo.RepairExportVo;
|
||||||
import com.ics.common.core.controller.BaseController;
|
import com.ics.common.core.controller.BaseController;
|
||||||
import com.ics.common.core.domain.R;
|
import com.ics.common.core.domain.R;
|
||||||
import com.ics.common.utils.DateUtils;
|
import com.ics.common.utils.DateUtils;
|
||||||
@ -31,6 +33,7 @@ import org.apache.poi.ss.usermodel.Workbook;
|
|||||||
import org.apache.poi.ss.util.CellRangeAddress;
|
import org.apache.poi.ss.util.CellRangeAddress;
|
||||||
import org.apache.poi.ss.util.CellRangeAddressList;
|
import org.apache.poi.ss.util.CellRangeAddressList;
|
||||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||||
|
import org.jxls.common.Context;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
@ -44,6 +47,7 @@ import javax.servlet.ServletOutputStream;
|
|||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -276,4 +280,25 @@ public class RepairIOController extends BaseController {
|
|||||||
return R.ok("成功导入" + count + "条工单数据");
|
return R.ok("成功导入" + count + "条工单数据");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Ignore
|
||||||
|
//@RequiresPermissions(value = {"repair:manage:operator"})
|
||||||
|
@RequestMapping("/exportRepair")
|
||||||
|
public void exportData(String startDate, String endDate) {
|
||||||
|
Date start, end;
|
||||||
|
try {
|
||||||
|
start = DateUtils.dateTime(DateUtils.YYYY_MM_DD_HH_MM_SS, startDate + " 00:00:00");
|
||||||
|
end = DateUtils.dateTime(DateUtils.YYYY_MM_DD_HH_MM_SS, endDate + " 23:59:59");
|
||||||
|
List<RepairExportVo> list = repairIOSerice.exportRepair(start, end);
|
||||||
|
Context context = new Context();
|
||||||
|
context.putVar("startDate", startDate);
|
||||||
|
context.putVar("endDate", endDate);
|
||||||
|
context.putVar("list", list);
|
||||||
|
new ExcelView("excel/工单导出模版.xls", "零星维修进度情况跟踪表.xls", context);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
package com.ics.admin.mapper;
|
package com.ics.admin.mapper;
|
||||||
|
|
||||||
import com.ics.admin.vo.RepairCheckVo;
|
import com.ics.admin.vo.RepairCheckVo;
|
||||||
|
import com.ics.admin.vo.RepairExportVo;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -34,4 +36,11 @@ public interface RepairCheckMapper {
|
|||||||
*/
|
*/
|
||||||
List<RepairCheckVo> checkAddress(@Param("addressName") String addressName, @Param("floorName") String floorName);
|
List<RepairCheckVo> checkAddress(@Param("addressName") String addressName, @Param("floorName") String floorName);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出工单列表
|
||||||
|
* @param startTime
|
||||||
|
* @param endTime
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<RepairExportVo> exportList(@Param("startTime") Date startTime, @Param("endTime") Date endTime);
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,9 @@ import com.ics.admin.domain.RepairAddress;
|
|||||||
import com.ics.admin.domain.RepairAddressFloor;
|
import com.ics.admin.domain.RepairAddressFloor;
|
||||||
import com.ics.admin.domain.RepairDevice;
|
import com.ics.admin.domain.RepairDevice;
|
||||||
import com.ics.admin.domain.RepairDeviceType;
|
import com.ics.admin.domain.RepairDeviceType;
|
||||||
|
import com.ics.admin.vo.RepairExportVo;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public interface IRepairIOSerice {
|
public interface IRepairIOSerice {
|
||||||
@ -26,4 +28,13 @@ public interface IRepairIOSerice {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
String checkRepair(Repair repair);
|
String checkRepair(Repair repair);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询工单导出 列表
|
||||||
|
*
|
||||||
|
* @param startTime 时间范围,开始
|
||||||
|
* @param endTime 时间范围,结束
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<RepairExportVo> exportRepair(Date startTime, Date endTime);
|
||||||
}
|
}
|
||||||
|
@ -12,9 +12,11 @@ import com.ics.admin.mapper.RepairDeviceMapper;
|
|||||||
import com.ics.admin.mapper.RepairDeviceTypeMapper;
|
import com.ics.admin.mapper.RepairDeviceTypeMapper;
|
||||||
import com.ics.admin.service.IRepairIOSerice;
|
import com.ics.admin.service.IRepairIOSerice;
|
||||||
import com.ics.admin.vo.RepairCheckVo;
|
import com.ics.admin.vo.RepairCheckVo;
|
||||||
|
import com.ics.admin.vo.RepairExportVo;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -76,4 +78,15 @@ public class RepairIOSericeImpl implements IRepairIOSerice {
|
|||||||
repair.setFloorId(repairCheckVo.getSid());
|
repair.setFloorId(repairCheckVo.getSid());
|
||||||
return IRepairIOSerice.OK;
|
return IRepairIOSerice.OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<RepairExportVo> exportRepair(Date startTime, Date endTime) {
|
||||||
|
List<RepairExportVo> list = repairCheckMapper.exportList(startTime, endTime);
|
||||||
|
if (list != null && list.size() > 0) {
|
||||||
|
for (int i = 0; i < list.size(); i++) {
|
||||||
|
list.get(i).setNumber(i + 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,50 @@
|
|||||||
|
package com.ics.admin.vo;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工单导出
|
||||||
|
* created at 2024-8-25 21:38
|
||||||
|
*
|
||||||
|
* @author lujiang
|
||||||
|
* @version 1.0.0
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class RepairExportVo implements Serializable {
|
||||||
|
private static final long serialVersionUID = -202408252138L;
|
||||||
|
|
||||||
|
private int number;
|
||||||
|
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
private String createTime;
|
||||||
|
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
private String source;
|
||||||
|
|
||||||
|
private String explain;
|
||||||
|
|
||||||
|
private String bm;
|
||||||
|
|
||||||
|
private String username;
|
||||||
|
|
||||||
|
private String wx;
|
||||||
|
|
||||||
|
private String repairLevel;
|
||||||
|
|
||||||
|
private String duration;
|
||||||
|
|
||||||
|
private String timeout;
|
||||||
|
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
private String resolve;
|
||||||
|
}
|
BIN
shoot-hand/ics-admin/src/main/resources/excel/工单导出模版.xls
Normal file
BIN
shoot-hand/ics-admin/src/main/resources/excel/工单导出模版.xls
Normal file
Binary file not shown.
@ -28,4 +28,27 @@
|
|||||||
and b.name = #{floorName}
|
and b.name = #{floorName}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<!--工单导出-->
|
||||||
|
<select id="exportList" resultType="com.ics.admin.vo.RepairExportVo">
|
||||||
|
<![CDATA[
|
||||||
|
select
|
||||||
|
rep.id,DATE_FORMAT(rep.create_time,'%Y-%m-%d') create_time,rep.`name`,
|
||||||
|
case when rep.remark ='5110' then '5110' else '微信小程序' end AS source,
|
||||||
|
rep.`explain`,floor.bm,staff.username,
|
||||||
|
case when rep.`status`>=5 and rep.`status`<>11 then '是' else '否' end as wx,
|
||||||
|
rep.repair_level,
|
||||||
|
case when rep.end_date is not null then TIMESTAMPDIFF(DAY,rep.create_time,rep.end_date) ELSE '' END as duration,
|
||||||
|
case when rep.timeout=1 then '正常' when rep.timeout=3 then '超时' when rep.timeout=5 then '严重超时' else '' end as timeout,
|
||||||
|
case when rep.`status`=11 then '无效申请' when rep.`status`=9 or rep.`status`=13 then '已完成' else '处理中' end as `status`,
|
||||||
|
case when rep.resolve=1 then '已解决' when rep.resolve=0 then '未解决' else '' end as resolve
|
||||||
|
from
|
||||||
|
ics_repair rep,ics_repair_address_floor floor,ics_customer_staff staff
|
||||||
|
where
|
||||||
|
rep.delete_flag=0 and floor.delete_flag=0 and staff.delete_flag =0 and rep.floor_id=floor.id and floor.admin_Id=staff.id
|
||||||
|
and rep.create_time between #{startTime} and #{endTime}
|
||||||
|
order by rep.create_time
|
||||||
|
|
||||||
|
]]>
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
Loading…
x
Reference in New Issue
Block a user