箱码查询
parent
df4809d9b0
commit
3683578f41
@ -0,0 +1,103 @@
|
|||||||
|
package com.op.mes.controller;
|
||||||
|
|
||||||
|
import java.util.Calendar;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
//import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import com.op.common.log.annotation.Log;
|
||||||
|
import com.op.common.core.web.controller.BaseController;
|
||||||
|
import com.op.common.core.web.domain.AjaxResult;
|
||||||
|
import com.op.common.log.enums.BusinessType;
|
||||||
|
import com.op.mes.domain.WcsTrayBoxs;
|
||||||
|
import com.op.mes.service.IWcsTrayBoxsService;
|
||||||
|
import com.op.common.core.utils.poi.ExcelUtil;
|
||||||
|
import com.op.common.core.web.page.TableDataInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 【请填写功能名称】Controller
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2025-04-23
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/boxs")
|
||||||
|
public class WcsTrayBoxsController extends BaseController
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private IWcsTrayBoxsService wcsTrayBoxsService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询【d打码信息】列表
|
||||||
|
*/
|
||||||
|
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(WcsTrayBoxs wcsTrayBoxs, @RequestParam(value = "startTime", required = false)
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date startTime,
|
||||||
|
@RequestParam(value = "endTime", required = false)
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date endTime)
|
||||||
|
{
|
||||||
|
// 设置时间范围到查询对象
|
||||||
|
wcsTrayBoxs.setStartTime(startTime);
|
||||||
|
wcsTrayBoxs.setEndTime(endTime);
|
||||||
|
startPage();
|
||||||
|
List<WcsTrayBoxs> list = wcsTrayBoxsService.selectWcsTrayBoxsList(wcsTrayBoxs);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出【打码信息】列表
|
||||||
|
*/
|
||||||
|
@Log(title = "【打码信息】", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(HttpServletResponse response, WcsTrayBoxs wcsTrayBoxs)
|
||||||
|
{
|
||||||
|
// 导出逻辑保持不变,底层复用相同的查询方法
|
||||||
|
List<WcsTrayBoxs> list = wcsTrayBoxsService.selectWcsTrayBoxsList(wcsTrayBoxs);
|
||||||
|
ExcelUtil<WcsTrayBoxs> util = new ExcelUtil<>(WcsTrayBoxs.class);
|
||||||
|
util.exportExcel(response, list, "打码信息数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取【打码信息】详细信息
|
||||||
|
*/
|
||||||
|
|
||||||
|
@GetMapping(value = "/{id}")
|
||||||
|
public AjaxResult getInfo(@PathVariable("id") String id)
|
||||||
|
{
|
||||||
|
return success(wcsTrayBoxsService.selectWcsTrayBoxsById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增【打码信息】
|
||||||
|
*/
|
||||||
|
@Log(title = "【打码信息】", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
public AjaxResult add(@RequestBody WcsTrayBoxs wcsTrayBoxs)
|
||||||
|
{
|
||||||
|
return toAjax(wcsTrayBoxsService.insertWcsTrayBoxs(wcsTrayBoxs));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改【打码信息】
|
||||||
|
*/
|
||||||
|
@Log(title = "【打码信息】", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public AjaxResult edit(@RequestBody WcsTrayBoxs wcsTrayBoxs)
|
||||||
|
{
|
||||||
|
return toAjax(wcsTrayBoxsService.updateWcsTrayBoxs(wcsTrayBoxs));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除【打码信息】
|
||||||
|
*/
|
||||||
|
@Log(title = "【打码信息】", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public AjaxResult remove(@PathVariable String[] ids)
|
||||||
|
{
|
||||||
|
return toAjax(wcsTrayBoxsService.deleteWcsTrayBoxsByIds(ids));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,61 @@
|
|||||||
|
package com.op.mes.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.op.mes.domain.WcsTrayBoxs;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 【打码信息】Mapper接口
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2025-04-23
|
||||||
|
*/
|
||||||
|
public interface WcsTrayBoxsMapper
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询【打码信息】
|
||||||
|
*
|
||||||
|
* @param id 【打码信息】主键
|
||||||
|
* @return 【打码信息】
|
||||||
|
*/
|
||||||
|
public WcsTrayBoxs selectWcsTrayBoxsById(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询【打码信息】列表
|
||||||
|
*
|
||||||
|
* @param wcsTrayBoxs 【打码信息】
|
||||||
|
* @return 【打码信息】集合
|
||||||
|
*/
|
||||||
|
public List<WcsTrayBoxs> selectWcsTrayBoxsList(WcsTrayBoxs wcsTrayBoxs);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增【打码信息】
|
||||||
|
*
|
||||||
|
* @param wcsTrayBoxs 【打码信息】
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertWcsTrayBoxs(WcsTrayBoxs wcsTrayBoxs);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改【打码信息】
|
||||||
|
*
|
||||||
|
* @param wcsTrayBoxs 【打码信息】
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateWcsTrayBoxs(WcsTrayBoxs wcsTrayBoxs);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除【打码信息】
|
||||||
|
*
|
||||||
|
* @param id 【打码信息】主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteWcsTrayBoxsById(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除【打码信息】
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteWcsTrayBoxsByIds(String[] ids);
|
||||||
|
}
|
@ -0,0 +1,61 @@
|
|||||||
|
package com.op.mes.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.op.mes.domain.WcsTrayBoxs;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 【打码信息】Service接口
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2025-04-23
|
||||||
|
*/
|
||||||
|
public interface IWcsTrayBoxsService
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询【打码信息】
|
||||||
|
*
|
||||||
|
* @param id 【打码信息】主键
|
||||||
|
* @return 【打码信息】
|
||||||
|
*/
|
||||||
|
public WcsTrayBoxs selectWcsTrayBoxsById(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询【打码信息】列表
|
||||||
|
*
|
||||||
|
* @param wcsTrayBoxs 【打码信息】
|
||||||
|
* @return 【打码信息】集合
|
||||||
|
*/
|
||||||
|
public List<WcsTrayBoxs> selectWcsTrayBoxsList(WcsTrayBoxs wcsTrayBoxs);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增【打码信息】
|
||||||
|
*
|
||||||
|
* @param wcsTrayBoxs 【打码信息】
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertWcsTrayBoxs(WcsTrayBoxs wcsTrayBoxs);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改【打码信息】
|
||||||
|
*
|
||||||
|
* @param wcsTrayBoxs 【打码信息】
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateWcsTrayBoxs(WcsTrayBoxs wcsTrayBoxs);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除【打码信息】
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的【打码信息】主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteWcsTrayBoxsByIds(String[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除【打码信息】信息
|
||||||
|
*
|
||||||
|
* @param id 【打码信息】主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteWcsTrayBoxsById(String id);
|
||||||
|
}
|
@ -0,0 +1,98 @@
|
|||||||
|
package com.op.mes.service.impl;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||||
|
import com.op.common.core.utils.DateUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.op.mes.mapper.WcsTrayBoxsMapper;
|
||||||
|
import com.op.mes.domain.WcsTrayBoxs;
|
||||||
|
import com.op.mes.service.IWcsTrayBoxsService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 【请填写功能名称】Service业务层处理
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2025-04-23
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class WcsTrayBoxsServiceImpl implements IWcsTrayBoxsService
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private WcsTrayBoxsMapper wcsTrayBoxsMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询【请填写功能名称】
|
||||||
|
*
|
||||||
|
* @param id 【请填写功能名称】主键
|
||||||
|
* @return 【请填写功能名称】
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@DS("#header.poolName")
|
||||||
|
public WcsTrayBoxs selectWcsTrayBoxsById(String id)
|
||||||
|
{
|
||||||
|
return wcsTrayBoxsMapper.selectWcsTrayBoxsById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询【请填写功能名称】列表
|
||||||
|
*
|
||||||
|
* @param wcsTrayBoxs 【请填写功能名称】
|
||||||
|
* @return 【请填写功能名称】
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@DS("#header.poolName")
|
||||||
|
public List<WcsTrayBoxs> selectWcsTrayBoxsList(WcsTrayBoxs wcsTrayBoxs)
|
||||||
|
{
|
||||||
|
return wcsTrayBoxsMapper.selectWcsTrayBoxsList(wcsTrayBoxs);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增【请填写功能名称】
|
||||||
|
*
|
||||||
|
* @param wcsTrayBoxs 【请填写功能名称】
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertWcsTrayBoxs(WcsTrayBoxs wcsTrayBoxs)
|
||||||
|
{
|
||||||
|
return wcsTrayBoxsMapper.insertWcsTrayBoxs(wcsTrayBoxs);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改【请填写功能名称】
|
||||||
|
*
|
||||||
|
* @param wcsTrayBoxs 【请填写功能名称】
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateWcsTrayBoxs(WcsTrayBoxs wcsTrayBoxs)
|
||||||
|
{
|
||||||
|
return wcsTrayBoxsMapper.updateWcsTrayBoxs(wcsTrayBoxs);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除【请填写功能名称】
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的【请填写功能名称】主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteWcsTrayBoxsByIds(String[] ids)
|
||||||
|
{
|
||||||
|
return wcsTrayBoxsMapper.deleteWcsTrayBoxsByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除【请填写功能名称】信息
|
||||||
|
*
|
||||||
|
* @param id 【请填写功能名称】主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteWcsTrayBoxsById(String id)
|
||||||
|
{
|
||||||
|
return wcsTrayBoxsMapper.deleteWcsTrayBoxsById(id);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,78 @@
|
|||||||
|
<?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">
|
||||||
|
<mapper namespace="com.op.mes.mapper.WcsTrayBoxsMapper">
|
||||||
|
|
||||||
|
<resultMap type="WcsTrayBoxs" id="WcsTrayBoxsResult">
|
||||||
|
<result property="id" column="id" />
|
||||||
|
<result property="trayCode" column="tray_code" />
|
||||||
|
<result property="boxCode" column="box_code" />
|
||||||
|
<result property="lineCode" column="line_code" />
|
||||||
|
<result property="createTime" column="create_time" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectWcsTrayBoxsVo">
|
||||||
|
select id, tray_code, box_code, line_code, create_time from wcs_tray_boxs
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectWcsTrayBoxsList" parameterType="WcsTrayBoxs" resultMap="WcsTrayBoxsResult">
|
||||||
|
<include refid="selectWcsTrayBoxsVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="trayCode != null and trayCode != ''"> and tray_code = #{trayCode}</if>
|
||||||
|
<if test="boxCode != null and boxCode != ''"> and box_code = #{boxCode}</if>
|
||||||
|
<if test="lineCode != null and lineCode != ''"> and line_code = #{lineCode}</if>
|
||||||
|
|
||||||
|
<!-- 时间范围查询 -->
|
||||||
|
<if test="startTime != null and endTime != null">
|
||||||
|
AND create_time BETWEEN #{startTime,jdbcType=TIMESTAMP} AND #{endTime,jdbcType=TIMESTAMP}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
ORDER BY create_time DESC
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectWcsTrayBoxsById" parameterType="String" resultMap="WcsTrayBoxsResult">
|
||||||
|
<include refid="selectWcsTrayBoxsVo"/>
|
||||||
|
where id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertWcsTrayBoxs" parameterType="WcsTrayBoxs">
|
||||||
|
insert into wcs_tray_boxs
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="id != null">id,</if>
|
||||||
|
<if test="trayCode != null">tray_code,</if>
|
||||||
|
<if test="boxCode != null">box_code,</if>
|
||||||
|
<if test="lineCode != null">line_code,</if>
|
||||||
|
<if test="createTime != null">create_time,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="id != null">#{id},</if>
|
||||||
|
<if test="trayCode != null">#{trayCode},</if>
|
||||||
|
<if test="boxCode != null">#{boxCode},</if>
|
||||||
|
<if test="lineCode != null">#{lineCode},</if>
|
||||||
|
<if test="createTime != null">#{createTime},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateWcsTrayBoxs" parameterType="WcsTrayBoxs">
|
||||||
|
update wcs_tray_boxs
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="trayCode != null">tray_code = #{trayCode},</if>
|
||||||
|
<if test="boxCode != null">box_code = #{boxCode},</if>
|
||||||
|
<if test="lineCode != null">line_code = #{lineCode},</if>
|
||||||
|
<if test="createTime != null">create_time = #{createTime},</if>
|
||||||
|
</trim>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteWcsTrayBoxsById" parameterType="String">
|
||||||
|
delete from wcs_tray_boxs where id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteWcsTrayBoxsByIds" parameterType="String">
|
||||||
|
delete from wcs_tray_boxs where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
</mapper>
|
Loading…
Reference in New Issue