no message
parent
8482bae482
commit
332c585e35
|
|
@ -1,10 +1,22 @@
|
||||||
package org.cpte.modules.agvTask.controller;
|
package org.cpte.modules.agvTask.controller;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.io.IOException;
|
||||||
|
import java.net.URLEncoder;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
|
import java.text.ParseException;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.apache.poi.ss.usermodel.Workbook;
|
||||||
|
import org.cpte.modules.agvTask.mapper.AgvTaskMapper;
|
||||||
|
import org.cpte.modules.agvTask.vo.ExportAgvTask;
|
||||||
import org.cpte.modules.constant.enums.AgvStatusEnum;
|
import org.cpte.modules.constant.enums.AgvStatusEnum;
|
||||||
|
import org.cpte.modules.constant.enums.BusinessTypeEnum;
|
||||||
|
import org.cpte.modules.constant.enums.InventoryStatusEnum;
|
||||||
|
import org.cpte.modules.inventory.vo.ExportInventory;
|
||||||
import org.jeecg.common.api.vo.Result;
|
import org.jeecg.common.api.vo.Result;
|
||||||
import org.jeecg.common.system.query.QueryGenerator;
|
import org.jeecg.common.system.query.QueryGenerator;
|
||||||
import org.cpte.modules.agvTask.entity.AgvTask;
|
import org.cpte.modules.agvTask.entity.AgvTask;
|
||||||
|
|
@ -14,9 +26,11 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.jeecg.common.system.base.controller.JeecgController;
|
import org.jeecg.common.system.base.controller.JeecgController;
|
||||||
|
import org.jeecgframework.poi.excel.ExcelExportUtil;
|
||||||
|
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||||
|
import org.jeecgframework.poi.excel.entity.params.ExcelExportEntity;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.servlet.ModelAndView;
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||||
|
|
@ -34,6 +48,9 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class AgvTaskController extends JeecgController<AgvTask, IAgvTaskService> {
|
public class AgvTaskController extends JeecgController<AgvTask, IAgvTaskService> {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private AgvTaskMapper agvTaskMapper;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IAgvTaskService agvTaskService;
|
private IAgvTaskService agvTaskService;
|
||||||
|
|
||||||
|
|
@ -148,8 +165,74 @@ public class AgvTaskController extends JeecgController<AgvTask, IAgvTaskService>
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions("agvTask:data_agv_task:exportXls")
|
@RequiresPermissions("agvTask:data_agv_task:exportXls")
|
||||||
@RequestMapping(value = "/exportXls")
|
@RequestMapping(value = "/exportXls")
|
||||||
public ModelAndView exportXls(HttpServletRequest request, AgvTask agvTask) {
|
public void exportXls(HttpServletRequest request, HttpServletResponse response, AgvTask agvTask) {
|
||||||
return super.exportXls(request, agvTask, AgvTask.class, "AGV任务表");
|
try {
|
||||||
|
|
||||||
|
List<ExportAgvTask> agvTaskList = agvTaskMapper.queryExportAgvTask(agvTask);
|
||||||
|
|
||||||
|
List<Map<String, Object>> dataList = new ArrayList<>();
|
||||||
|
for (ExportAgvTask agv : agvTaskList) {
|
||||||
|
Map<String, Object> dataMap = new HashMap<>();
|
||||||
|
dataMap.put("TES任务号", agv.getTesId());
|
||||||
|
dataMap.put("任务号", agv.getId());
|
||||||
|
dataMap.put("柜号", agv.getConNo());
|
||||||
|
dataMap.put("物料", agv.getItemCode());
|
||||||
|
dataMap.put("容器", agv.getCarrierCode());
|
||||||
|
dataMap.put("业务类型", BusinessTypeEnum.getDescByValue(agv.getType()));
|
||||||
|
dataMap.put("起点", agv.getStartCode());
|
||||||
|
dataMap.put("终点", agv.getEndCode());
|
||||||
|
dataMap.put("创建时间", agv.getCreateTime());
|
||||||
|
dataMap.put("下发时间", agv.getStartTime());
|
||||||
|
dataMap.put("完成时间", agv.getEndTime());
|
||||||
|
dataMap.put("完成耗时", agv.getEndConst());
|
||||||
|
dataMap.put("顶升时间", agv.getOutBinTime());
|
||||||
|
dataMap.put("顶升耗时", agv.getOutConst());
|
||||||
|
// 添加其他需要导出的字段
|
||||||
|
dataList.add(dataMap);
|
||||||
|
}
|
||||||
|
|
||||||
|
List<ExcelExportEntity> entityList = new ArrayList<>();
|
||||||
|
// 根据实际的库存实体字段设置表头
|
||||||
|
entityList.add(new ExcelExportEntity("TES任务号", "TES任务号", 10));
|
||||||
|
entityList.add(new ExcelExportEntity("任务号", "任务号", 20));
|
||||||
|
entityList.add(new ExcelExportEntity("柜号", "柜号", 15));
|
||||||
|
entityList.add(new ExcelExportEntity("物料", "物料", 15));
|
||||||
|
entityList.add(new ExcelExportEntity("容器", "容器", 15));
|
||||||
|
entityList.add(new ExcelExportEntity("业务类型", "业务类型", 15));
|
||||||
|
entityList.add(new ExcelExportEntity("起点", "起点", 20));
|
||||||
|
entityList.add(new ExcelExportEntity("终点", "终点", 20));
|
||||||
|
entityList.add(new ExcelExportEntity("创建时间", "创建时间", 20));
|
||||||
|
entityList.add(new ExcelExportEntity("下发时间", "下发时间", 20));
|
||||||
|
entityList.add(new ExcelExportEntity("完成时间", "完成时间", 20));
|
||||||
|
entityList.add(new ExcelExportEntity("完成耗时", "完成耗时", 20));
|
||||||
|
entityList.add(new ExcelExportEntity("顶升时间", "顶升时间", 20));
|
||||||
|
entityList.add(new ExcelExportEntity("顶升耗时", "顶升耗时", 20));
|
||||||
|
|
||||||
|
Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(null, "TES任务信息"), entityList, dataList);
|
||||||
|
/* // 自动调整列宽
|
||||||
|
Sheet sheet = workbook.getSheetAt(0);
|
||||||
|
for (int i = 0; i < entityList.size(); i++) {
|
||||||
|
sheet.autoSizeColumn(i);
|
||||||
|
}*/
|
||||||
|
// 设置响应头
|
||||||
|
response.setContentType("application/vnd.ms-excel");
|
||||||
|
String fileName = "TES任务信息.xls";
|
||||||
|
// 对文件名进行URL编码,解决中文字符编码问题
|
||||||
|
String encodedFileName = URLEncoder.encode(fileName, StandardCharsets.UTF_8).replaceAll("\\+", "%20");
|
||||||
|
response.setHeader("Content-disposition", "attachment;filename*=UTF-8''" + encodedFileName);
|
||||||
|
|
||||||
|
// 直接写入响应输出流
|
||||||
|
workbook.write(response.getOutputStream());
|
||||||
|
response.flushBuffer();
|
||||||
|
} catch (IOException e) {
|
||||||
|
log.info("excel导出错误:" + e.getMessage());
|
||||||
|
try {
|
||||||
|
response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
|
||||||
|
response.getWriter().write("导出失败: " + e.getMessage());
|
||||||
|
} catch (IOException ex) {
|
||||||
|
log.error("导出错误处理失败", ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,6 @@
|
||||||
package org.cpte.modules.agvTask.entity;
|
package org.cpte.modules.agvTask.entity;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.sql.Timestamp;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
|
@ -13,11 +11,7 @@ import lombok.*;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import org.jeecg.common.aspect.annotation.Dict;
|
import org.jeecg.common.aspect.annotation.Dict;
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
import javax.persistence.Column;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: AGV任务表
|
* @Description: AGV任务表
|
||||||
|
|
@ -45,15 +39,13 @@ public class AgvTask implements Serializable {
|
||||||
/**
|
/**
|
||||||
* 上游ID
|
* 上游ID
|
||||||
*/
|
*/
|
||||||
@Excel(name = "上游ID", width = 15)
|
@Schema(description = "TES任务号")
|
||||||
@Schema(description = "上游ID")
|
|
||||||
@JsonSerialize(using = ToStringSerializer.class)
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
private java.lang.Long tesId;
|
private java.lang.Long tesId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 业务ID
|
* 业务ID
|
||||||
*/
|
*/
|
||||||
@Excel(name = "业务ID", width = 15)
|
|
||||||
@Schema(description = "业务ID")
|
@Schema(description = "业务ID")
|
||||||
@JsonSerialize(using = ToStringSerializer.class)
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
private java.lang.Long businessDetailId;
|
private java.lang.Long businessDetailId;
|
||||||
|
|
@ -61,7 +53,6 @@ public class AgvTask implements Serializable {
|
||||||
/**
|
/**
|
||||||
* 物料
|
* 物料
|
||||||
*/
|
*/
|
||||||
@Excel(name = "物料", width = 15)
|
|
||||||
@Schema(description = "物料")
|
@Schema(description = "物料")
|
||||||
@Dict(dictTable = "base_item", dicCode = "id", dicText = "item_code")
|
@Dict(dictTable = "base_item", dicCode = "id", dicText = "item_code")
|
||||||
@JsonSerialize(using = ToStringSerializer.class)
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
|
|
@ -73,66 +64,69 @@ public class AgvTask implements Serializable {
|
||||||
/**
|
/**
|
||||||
* 柜号
|
* 柜号
|
||||||
*/
|
*/
|
||||||
@Excel(name = "柜号", width = 15)
|
|
||||||
@Schema(description = "柜号")
|
@Schema(description = "柜号")
|
||||||
private java.lang.String conNo;
|
private java.lang.String conNo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 载具编号
|
* 载具编号
|
||||||
*/
|
*/
|
||||||
@Excel(name = "载具编号", width = 15)
|
|
||||||
@Schema(description = "载具编号")
|
@Schema(description = "载具编号")
|
||||||
private java.lang.String carrierCode;
|
private java.lang.String carrierCode;
|
||||||
/**
|
/**
|
||||||
* 载具类型
|
* 载具类型
|
||||||
*/
|
*/
|
||||||
@Excel(name = "载具类型", width = 15)
|
|
||||||
@Schema(description = "载具类型")
|
@Schema(description = "载具类型")
|
||||||
private java.lang.String carrierType;
|
private java.lang.String carrierType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 任务类型
|
* 任务类型
|
||||||
*/
|
*/
|
||||||
@Excel(name = "任务类型", width = 15)
|
|
||||||
@Schema(description = "任务类型")
|
@Schema(description = "任务类型")
|
||||||
private java.lang.String taskType;
|
private java.lang.String taskType;
|
||||||
/**
|
/**
|
||||||
* 业务类型
|
* 业务类型
|
||||||
*/
|
*/
|
||||||
@Excel(name = "业务类型", width = 15)
|
|
||||||
@Schema(description = "业务类型")
|
@Schema(description = "业务类型")
|
||||||
@Dict(dicCode = "business_type")
|
@Dict(dicCode = "business_type")
|
||||||
private java.lang.String type;
|
private java.lang.String type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 多状态查询库存
|
||||||
|
*/
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String type_MultiString;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 任务状态
|
* 任务状态
|
||||||
*/
|
*/
|
||||||
@Excel(name = "任务状态", width = 15)
|
|
||||||
@Schema(description = "任务状态")
|
@Schema(description = "任务状态")
|
||||||
@Dict(dicCode = "agv_task_status")
|
@Dict(dicCode = "agv_task_status")
|
||||||
private java.lang.Integer status;
|
private java.lang.Integer status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 多状态查询库存
|
||||||
|
*/
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String status_MultiString;
|
||||||
/**
|
/**
|
||||||
* 优先级
|
* 优先级
|
||||||
*/
|
*/
|
||||||
@Excel(name = "优先级", width = 15)
|
|
||||||
@Schema(description = "优先级")
|
@Schema(description = "优先级")
|
||||||
private java.lang.Integer priority;
|
private java.lang.Integer priority;
|
||||||
/**
|
/**
|
||||||
* 起点位置
|
* 起点位置
|
||||||
*/
|
*/
|
||||||
@Excel(name = "起点位置", width = 15)
|
|
||||||
@Schema(description = "起点位置")
|
@Schema(description = "起点位置")
|
||||||
private java.lang.String startCode;
|
private java.lang.String startCode;
|
||||||
/**
|
/**
|
||||||
* 终点位置
|
* 终点位置
|
||||||
*/
|
*/
|
||||||
@Excel(name = "终点位置", width = 15)
|
|
||||||
@Schema(description = "终点位置")
|
@Schema(description = "终点位置")
|
||||||
private java.lang.String endCode;
|
private java.lang.String endCode;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* AGV供应商
|
* AGV供应商
|
||||||
*/
|
*/
|
||||||
@Excel(name = "AGV供应商", width = 15)
|
|
||||||
@Schema(description = "AGV供应商")
|
@Schema(description = "AGV供应商")
|
||||||
@Dict(dicCode = "agv_vendor")
|
@Dict(dicCode = "agv_vendor")
|
||||||
private java.lang.String agvVendor;
|
private java.lang.String agvVendor;
|
||||||
|
|
@ -140,14 +134,12 @@ public class AgvTask implements Serializable {
|
||||||
/**
|
/**
|
||||||
* 是否整托0整托,1拆托
|
* 是否整托0整托,1拆托
|
||||||
*/
|
*/
|
||||||
@Excel(name = "是否整托", width = 15)
|
|
||||||
@Schema(description = "是否整托")
|
@Schema(description = "是否整托")
|
||||||
private java.lang.Integer izAll;
|
private java.lang.Integer izAll;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 返回报文
|
* 返回报文
|
||||||
*/
|
*/
|
||||||
@Excel(name = "返回报文", width = 15)
|
|
||||||
@Schema(description = "返回报文")
|
@Schema(description = "返回报文")
|
||||||
private java.lang.String resMessage;
|
private java.lang.String resMessage;
|
||||||
/**
|
/**
|
||||||
|
|
@ -180,7 +172,6 @@ public class AgvTask implements Serializable {
|
||||||
/**
|
/**
|
||||||
* 租户ID
|
* 租户ID
|
||||||
*/
|
*/
|
||||||
@Excel(name = "租户ID", width = 15)
|
|
||||||
@Schema(description = "租户ID")
|
@Schema(description = "租户ID")
|
||||||
private java.lang.Long tenantId;
|
private java.lang.Long tenantId;
|
||||||
/**
|
/**
|
||||||
|
|
@ -195,6 +186,13 @@ public class AgvTask implements Serializable {
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
@Schema(description = "创建日期")
|
@Schema(description = "创建日期")
|
||||||
private java.util.Date createTime;
|
private java.util.Date createTime;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String createTime_begin;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String createTime_end;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新人
|
* 更新人
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ import org.apache.ibatis.annotations.Param;
|
||||||
import org.apache.ibatis.annotations.Select;
|
import org.apache.ibatis.annotations.Select;
|
||||||
import org.cpte.modules.agvTask.entity.AgvTask;
|
import org.cpte.modules.agvTask.entity.AgvTask;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.cpte.modules.agvTask.vo.ExportAgvTask;
|
||||||
import org.cpte.modules.dashboard.vo.WorkstationTask;
|
import org.cpte.modules.dashboard.vo.WorkstationTask;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
@ -16,6 +17,14 @@ import java.util.Map;
|
||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
*/
|
*/
|
||||||
public interface AgvTaskMapper extends BaseMapper<AgvTask> {
|
public interface AgvTaskMapper extends BaseMapper<AgvTask> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询导出AGV数据
|
||||||
|
*
|
||||||
|
* @return List<AgvTask>
|
||||||
|
*/
|
||||||
|
List<ExportAgvTask> queryExportAgvTask(@Param("agvTask") AgvTask agvTask);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据容器编码验证AGV任务是否存在
|
* 根据容器编码验证AGV任务是否存在
|
||||||
*
|
*
|
||||||
|
|
@ -29,7 +38,7 @@ public interface AgvTaskMapper extends BaseMapper<AgvTask> {
|
||||||
* 根据起点编码验证AGV任务是否存在
|
* 根据起点编码验证AGV任务是否存在
|
||||||
*
|
*
|
||||||
* @param startCode 起点
|
* @param startCode 起点
|
||||||
* @param agvVendor 供应商;AGV/TES
|
* @param agvVendor 供应商;AGV/TES
|
||||||
*/
|
*/
|
||||||
@Select(value = "select 1 from data_agv_task where start_code = #{startCode} and status in (2,3) and agv_vendor = #{agvVendor} LIMIT 1 ")
|
@Select(value = "select 1 from data_agv_task where start_code = #{startCode} and status in (2,3) and agv_vendor = #{agvVendor} LIMIT 1 ")
|
||||||
Integer existsByStartCode(@Param("startCode") String startCode, @Param("agvVendor") String agvVendor);
|
Integer existsByStartCode(@Param("startCode") String startCode, @Param("agvVendor") String agvVendor);
|
||||||
|
|
@ -38,8 +47,8 @@ public interface AgvTaskMapper extends BaseMapper<AgvTask> {
|
||||||
/**
|
/**
|
||||||
* 根据终点编码验证AGV任务是否存在
|
* 根据终点编码验证AGV任务是否存在
|
||||||
*
|
*
|
||||||
* @param endCode 终点
|
* @param endCode 终点
|
||||||
* @param agvVendor 供应商;AGV/TES
|
* @param agvVendor 供应商;AGV/TES
|
||||||
*/
|
*/
|
||||||
@Select(value = "select 1 from data_agv_task where end_code = #{endCode} and status in (2,3) and agv_vendor = #{agvVendor} LIMIT 1 ")
|
@Select(value = "select 1 from data_agv_task where end_code = #{endCode} and status in (2,3) and agv_vendor = #{agvVendor} LIMIT 1 ")
|
||||||
Integer existsByEndCode(@Param("endCode") String endCode, @Param("agvVendor") String agvVendor);
|
Integer existsByEndCode(@Param("endCode") String endCode, @Param("agvVendor") String agvVendor);
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,72 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="org.cpte.modules.agvTask.mapper.AgvTaskMapper">
|
<mapper namespace="org.cpte.modules.agvTask.mapper.AgvTaskMapper">
|
||||||
|
<select id="queryExportAgvTask" resultType="org.cpte.modules.agvTask.vo.ExportAgvTask">
|
||||||
|
select
|
||||||
|
agv.tes_id,
|
||||||
|
agv.id,
|
||||||
|
agv.con_no,
|
||||||
|
agv.carrier_code,
|
||||||
|
item.item_code,
|
||||||
|
agv.type,
|
||||||
|
agv.status,
|
||||||
|
agv.start_code,
|
||||||
|
agv.end_code,
|
||||||
|
agv.create_time,
|
||||||
|
agv.start_time,
|
||||||
|
agv.end_time,
|
||||||
|
CONCAT(
|
||||||
|
FLOOR(TIMESTAMPDIFF(SECOND, agv.start_time, agv.end_time) / 60),
|
||||||
|
'分',
|
||||||
|
MOD(TIMESTAMPDIFF(SECOND, agv.start_time, agv.end_time), 60),
|
||||||
|
'秒'
|
||||||
|
) AS end_const,
|
||||||
|
agv.out_bin_time,
|
||||||
|
CONCAT(
|
||||||
|
FLOOR(TIMESTAMPDIFF(SECOND, agv.out_bin_time, agv.end_time) / 60),
|
||||||
|
'分',
|
||||||
|
MOD(TIMESTAMPDIFF(SECOND, agv.out_bin_time, agv.end_time), 60),
|
||||||
|
'秒'
|
||||||
|
) AS out_const
|
||||||
|
from data_agv_task agv
|
||||||
|
left join base_item item on item.id=agv.item_id
|
||||||
|
<where>
|
||||||
|
<if test="agvTask.id != null">
|
||||||
|
AND agv.id = #{agvTask.id}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="agvTask.carrierCode != null">
|
||||||
|
AND agv.carrier_code = #{agvTask.carrierCode}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="agvTask.status_MultiString != null and agvTask.status_MultiString != ''">
|
||||||
|
AND agv.status IN
|
||||||
|
<foreach collection="agvTask.status_MultiString.split(',')"
|
||||||
|
item="status"
|
||||||
|
open="("
|
||||||
|
separator=","
|
||||||
|
close=")">
|
||||||
|
#{status}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="agvTask.type_MultiString != null and agvTask.type_MultiString != ''">
|
||||||
|
AND agv.type IN
|
||||||
|
<foreach collection="agvTask.type_MultiString.split(',')"
|
||||||
|
item="type"
|
||||||
|
open="("
|
||||||
|
separator=","
|
||||||
|
close=")">
|
||||||
|
#{type}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
<if test="agvTask.createTime != null">
|
||||||
|
AND agv.create_time >= #{agvTask.createTime}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
order by agv.id
|
||||||
|
</select>
|
||||||
|
|
||||||
<select id="queryByLastEndCode" resultType="org.cpte.modules.agvTask.entity.AgvTask">
|
<select id="queryByLastEndCode" resultType="org.cpte.modules.agvTask.entity.AgvTask">
|
||||||
(SELECT * FROM data_agv_task
|
(SELECT * FROM data_agv_task
|
||||||
WHERE start_code = #{endCode}
|
WHERE start_code = #{endCode}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,25 @@
|
||||||
|
package org.cpte.modules.agvTask.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ExportAgvTask {
|
||||||
|
private Long tesId;
|
||||||
|
private Long id;
|
||||||
|
private String conNo;
|
||||||
|
private String carrierCode;
|
||||||
|
private String itemCode;
|
||||||
|
private String type;
|
||||||
|
private Integer status;
|
||||||
|
private String startCode;
|
||||||
|
private String endCode;
|
||||||
|
private String createTime;
|
||||||
|
private String startTime;
|
||||||
|
private String endTime;
|
||||||
|
private String endConst;
|
||||||
|
private String outBinTime;
|
||||||
|
private String outConst;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -22,31 +22,17 @@ import org.cpte.modules.constant.enums.InventoryStatusEnum;
|
||||||
import org.cpte.modules.inventory.mapper.InventoryMapper;
|
import org.cpte.modules.inventory.mapper.InventoryMapper;
|
||||||
import org.cpte.modules.inventory.vo.ExportInventory;
|
import org.cpte.modules.inventory.vo.ExportInventory;
|
||||||
import org.jeecg.common.api.vo.Result;
|
import org.jeecg.common.api.vo.Result;
|
||||||
import org.jeecg.common.system.query.QueryGenerator;
|
|
||||||
import org.jeecg.common.system.query.QueryRuleEnum;
|
|
||||||
import org.jeecg.common.util.oConvertUtils;
|
|
||||||
import org.cpte.modules.inventory.entity.Inventory;
|
import org.cpte.modules.inventory.entity.Inventory;
|
||||||
import org.cpte.modules.inventory.service.IInventoryService;
|
import org.cpte.modules.inventory.service.IInventoryService;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import org.jeecgframework.poi.excel.ExcelExportUtil;
|
import org.jeecgframework.poi.excel.ExcelExportUtil;
|
||||||
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
|
||||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
|
||||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||||
import org.jeecgframework.poi.excel.entity.ImportParams;
|
|
||||||
import org.jeecgframework.poi.excel.entity.params.ExcelExportEntity;
|
import org.jeecgframework.poi.excel.entity.params.ExcelExportEntity;
|
||||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
|
||||||
import org.jeecg.common.system.base.controller.JeecgController;
|
import org.jeecg.common.system.base.controller.JeecgController;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
|
||||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
|
||||||
import org.springframework.web.servlet.ModelAndView;
|
|
||||||
import com.alibaba.fastjson.JSON;
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,6 @@ public class Inventory implements Serializable {
|
||||||
/**
|
/**
|
||||||
* 物料ID
|
* 物料ID
|
||||||
*/
|
*/
|
||||||
@Excel(name = "物料", width = 15,dictTable ="base_item",dicText = "item_code",dicCode = "id")
|
|
||||||
@Schema(description = "物料")
|
@Schema(description = "物料")
|
||||||
@Dict(dictTable = "base_item", dicCode = "id", dicText = "item_code")
|
@Dict(dictTable = "base_item", dicCode = "id", dicText = "item_code")
|
||||||
@JsonSerialize(using = ToStringSerializer.class)
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
|
|
@ -59,7 +58,6 @@ public class Inventory implements Serializable {
|
||||||
/**
|
/**
|
||||||
* 库位
|
* 库位
|
||||||
*/
|
*/
|
||||||
@Excel(name = "库位", width = 15,dictTable ="base_point",dicText = "point_code",dicCode = "id")
|
|
||||||
@Schema(description = "库位")
|
@Schema(description = "库位")
|
||||||
@Dict(dictTable = "base_point", dicCode = "id", dicText = "point_code")
|
@Dict(dictTable = "base_point", dicCode = "id", dicText = "point_code")
|
||||||
@JsonSerialize(using = ToStringSerializer.class)
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
|
|
@ -68,7 +66,6 @@ public class Inventory implements Serializable {
|
||||||
/**
|
/**
|
||||||
* 容器
|
* 容器
|
||||||
*/
|
*/
|
||||||
@Excel(name = "容器", width = 15,dictTable ="base_stock",dicText = "stock_code",dicCode = "id")
|
|
||||||
@Schema(description = "容器")
|
@Schema(description = "容器")
|
||||||
@Dict(dictTable = "base_stock", dicCode = "id", dicText = "stock_code")
|
@Dict(dictTable = "base_stock", dicCode = "id", dicText = "stock_code")
|
||||||
@JsonSerialize(using = ToStringSerializer.class)
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
|
|
@ -76,20 +73,17 @@ public class Inventory implements Serializable {
|
||||||
/**
|
/**
|
||||||
* 数量
|
* 数量
|
||||||
*/
|
*/
|
||||||
@Excel(name = "数量", width = 15)
|
|
||||||
@Schema(description = "数量")
|
@Schema(description = "数量")
|
||||||
private java.math.BigDecimal quantity;
|
private java.math.BigDecimal quantity;
|
||||||
/**
|
/**
|
||||||
* 分配数
|
* 分配数
|
||||||
*/
|
*/
|
||||||
@Excel(name = "分配数", width = 15)
|
|
||||||
@Schema(description = "分配数")
|
@Schema(description = "分配数")
|
||||||
private java.math.BigDecimal queuedQty;
|
private java.math.BigDecimal queuedQty;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 库存状态
|
* 库存状态
|
||||||
*/
|
*/
|
||||||
@Excel(name = "库存状态", width = 15,dicCode="inventory_status")
|
|
||||||
@Schema(description = "库存状态")
|
@Schema(description = "库存状态")
|
||||||
@Dict(dicCode = "inventory_status")
|
@Dict(dicCode = "inventory_status")
|
||||||
private java.lang.Integer status;
|
private java.lang.Integer status;
|
||||||
|
|
@ -115,7 +109,6 @@ public class Inventory implements Serializable {
|
||||||
/**
|
/**
|
||||||
* 外部仓库
|
* 外部仓库
|
||||||
*/
|
*/
|
||||||
@Excel(name="仓库代码",width = 15,dictTable ="base_item_key",dicText = "wh_code",dicCode = "id")
|
|
||||||
@Schema(description = "仓库代码")
|
@Schema(description = "仓库代码")
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private java.lang.String whCode;
|
private java.lang.String whCode;
|
||||||
|
|
@ -123,21 +116,18 @@ public class Inventory implements Serializable {
|
||||||
/**
|
/**
|
||||||
* 项目号
|
* 项目号
|
||||||
*/
|
*/
|
||||||
@Excel(name = "项目号", width = 15)
|
|
||||||
@Schema(description = "项目号")
|
@Schema(description = "项目号")
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private java.lang.String project;
|
private java.lang.String project;
|
||||||
/**
|
/**
|
||||||
* 任务号
|
* 任务号
|
||||||
*/
|
*/
|
||||||
@Excel(name = "任务号", width = 15)
|
|
||||||
@Schema(description = "任务号")
|
@Schema(description = "任务号")
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private java.lang.String taskNo;
|
private java.lang.String taskNo;
|
||||||
/**
|
/**
|
||||||
* 批次号
|
* 批次号
|
||||||
*/
|
*/
|
||||||
@Excel(name = "批次号", width = 15)
|
|
||||||
@Schema(description = "批次号")
|
@Schema(description = "批次号")
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private java.lang.String propC1;
|
private java.lang.String propC1;
|
||||||
|
|
@ -145,7 +135,6 @@ public class Inventory implements Serializable {
|
||||||
/**
|
/**
|
||||||
* 外部库存状态
|
* 外部库存状态
|
||||||
*/
|
*/
|
||||||
@Excel(name = "赛意库存状态", width = 15)
|
|
||||||
@Schema(description = "赛意库存状态")
|
@Schema(description = "赛意库存状态")
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private java.lang.String propC3;
|
private java.lang.String propC3;
|
||||||
|
|
@ -169,7 +158,6 @@ public class Inventory implements Serializable {
|
||||||
/**
|
/**
|
||||||
* 创建日期
|
* 创建日期
|
||||||
*/
|
*/
|
||||||
@Excel(name = "日期", width = 15,format = "yyyy-MM-dd")
|
|
||||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
@Schema(description = "创建日期")
|
@Schema(description = "创建日期")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue