feat(入库任务明细): 初始化

This commit is contained in:
LJW 2024-11-05 17:16:29 +08:00
parent 74147f2703
commit 1cdbbdb3b0
6 changed files with 529 additions and 0 deletions

View File

@ -0,0 +1,104 @@
package com.ktg.mes.wm.controller;
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.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ktg.common.annotation.Log;
import com.ktg.common.core.controller.BaseController;
import com.ktg.common.core.domain.AjaxResult;
import com.ktg.common.enums.BusinessType;
import com.ktg.mes.wm.domain.WmsInPlanDetailEntity;
import com.ktg.mes.wm.service.IWmsInPlanDetailEntityService;
import com.ktg.common.utils.poi.ExcelUtil;
import com.ktg.common.core.page.TableDataInfo;
/**
* 入库计划明细实体Controller
*
* @author yinjinlu
* @date 2024-11-05
*/
@RestController
@RequestMapping("/wm/wmsInPlanDetailsEntity")
public class WmsInPlanDetailEntityController extends BaseController
{
@Autowired
private IWmsInPlanDetailEntityService wmsInPlanDetailEntityService;
/**
* 查询入库计划明细实体列表
*/
@PreAuthorize("@ss.hasPermi('wm:wmsInPlanDetailsEntity:list')")
@GetMapping("/list")
public TableDataInfo list(WmsInPlanDetailEntity wmsInPlanDetailEntity)
{
startPage();
List<WmsInPlanDetailEntity> list = wmsInPlanDetailEntityService.selectWmsInPlanDetailEntityList(wmsInPlanDetailEntity);
return getDataTable(list);
}
/**
* 导出入库计划明细实体列表
*/
@PreAuthorize("@ss.hasPermi('wm:wmsInPlanDetailsEntity:export')")
@Log(title = "入库计划明细实体", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, WmsInPlanDetailEntity wmsInPlanDetailEntity)
{
List<WmsInPlanDetailEntity> list = wmsInPlanDetailEntityService.selectWmsInPlanDetailEntityList(wmsInPlanDetailEntity);
ExcelUtil<WmsInPlanDetailEntity> util = new ExcelUtil<WmsInPlanDetailEntity>(WmsInPlanDetailEntity.class);
util.exportExcel(response, list, "入库计划明细实体数据");
}
/**
* 获取入库计划明细实体详细信息
*/
@PreAuthorize("@ss.hasPermi('wm:wmsInPlanDetailsEntity:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(wmsInPlanDetailEntityService.selectWmsInPlanDetailEntityById(id));
}
/**
* 新增入库计划明细实体
*/
@PreAuthorize("@ss.hasPermi('wm:wmsInPlanDetailsEntity:add')")
@Log(title = "入库计划明细实体", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody WmsInPlanDetailEntity wmsInPlanDetailEntity)
{
return toAjax(wmsInPlanDetailEntityService.insertWmsInPlanDetailEntity(wmsInPlanDetailEntity));
}
/**
* 修改入库计划明细实体
*/
@PreAuthorize("@ss.hasPermi('wm:wmsInPlanDetailsEntity:edit')")
@Log(title = "入库计划明细实体", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody WmsInPlanDetailEntity wmsInPlanDetailEntity)
{
return toAjax(wmsInPlanDetailEntityService.updateWmsInPlanDetailEntity(wmsInPlanDetailEntity));
}
/**
* 删除入库计划明细实体
*/
@PreAuthorize("@ss.hasPermi('wm:wmsInPlanDetailsEntity:remove')")
@Log(title = "入库计划明细实体", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(wmsInPlanDetailEntityService.deleteWmsInPlanDetailEntityByIds(ids));
}
}

View File

@ -0,0 +1,111 @@
package com.ktg.mes.wm.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ktg.common.annotation.Excel;
import com.ktg.common.core.domain.BaseEntity;
/**
* 入库计划明细实体对象 WMS_IN_PLAN_DETAIL_ENTITY
*
* @author yinjinlu
* @date 2024-11-05
*/
public class WmsInPlanDetailEntity extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** $column.columnComment */
private Long id;
/** 入库计划ID */
@Excel(name = "入库计划ID")
private String planId;
/** 入库计划明细ID */
@Excel(name = "入库计划明细ID")
private String planDetailsId;
/** 来源 */
@Excel(name = "来源")
private String source;
/** 台账ID */
@Excel(name = "台账ID")
private String knifeId;
/** 消耗寿命 */
@Excel(name = "消耗寿命")
private String comsumeLife;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setPlanId(String planId)
{
this.planId = planId;
}
public String getPlanId()
{
return planId;
}
public void setPlanDetailsId(String planDetailsId)
{
this.planDetailsId = planDetailsId;
}
public String getPlanDetailsId()
{
return planDetailsId;
}
public void setSource(String source)
{
this.source = source;
}
public String getSource()
{
return source;
}
public void setKnifeId(String knifeId)
{
this.knifeId = knifeId;
}
public String getKnifeId()
{
return knifeId;
}
public void setComsumeLife(String comsumeLife)
{
this.comsumeLife = comsumeLife;
}
public String getComsumeLife()
{
return comsumeLife;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("planId", getPlanId())
.append("planDetailsId", getPlanDetailsId())
.append("source", getSource())
.append("knifeId", getKnifeId())
.append("comsumeLife", getComsumeLife())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
}

View File

@ -0,0 +1,61 @@
package com.ktg.mes.wm.mapper;
import java.util.List;
import com.ktg.mes.wm.domain.WmsInPlanDetailEntity;
/**
* 入库计划明细实体Mapper接口
*
* @author yinjinlu
* @date 2024-11-05
*/
public interface WmsInPlanDetailEntityMapper
{
/**
* 查询入库计划明细实体
*
* @param id 入库计划明细实体主键
* @return 入库计划明细实体
*/
public WmsInPlanDetailEntity selectWmsInPlanDetailEntityById(Long id);
/**
* 查询入库计划明细实体列表
*
* @param wmsInPlanDetailEntity 入库计划明细实体
* @return 入库计划明细实体集合
*/
public List<WmsInPlanDetailEntity> selectWmsInPlanDetailEntityList(WmsInPlanDetailEntity wmsInPlanDetailEntity);
/**
* 新增入库计划明细实体
*
* @param wmsInPlanDetailEntity 入库计划明细实体
* @return 结果
*/
public int insertWmsInPlanDetailEntity(WmsInPlanDetailEntity wmsInPlanDetailEntity);
/**
* 修改入库计划明细实体
*
* @param wmsInPlanDetailEntity 入库计划明细实体
* @return 结果
*/
public int updateWmsInPlanDetailEntity(WmsInPlanDetailEntity wmsInPlanDetailEntity);
/**
* 删除入库计划明细实体
*
* @param id 入库计划明细实体主键
* @return 结果
*/
public int deleteWmsInPlanDetailEntityById(Long id);
/**
* 批量删除入库计划明细实体
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteWmsInPlanDetailEntityByIds(Long[] ids);
}

View File

@ -0,0 +1,61 @@
package com.ktg.mes.wm.service;
import java.util.List;
import com.ktg.mes.wm.domain.WmsInPlanDetailEntity;
/**
* 入库计划明细实体Service接口
*
* @author yinjinlu
* @date 2024-11-05
*/
public interface IWmsInPlanDetailEntityService
{
/**
* 查询入库计划明细实体
*
* @param id 入库计划明细实体主键
* @return 入库计划明细实体
*/
public WmsInPlanDetailEntity selectWmsInPlanDetailEntityById(Long id);
/**
* 查询入库计划明细实体列表
*
* @param wmsInPlanDetailEntity 入库计划明细实体
* @return 入库计划明细实体集合
*/
public List<WmsInPlanDetailEntity> selectWmsInPlanDetailEntityList(WmsInPlanDetailEntity wmsInPlanDetailEntity);
/**
* 新增入库计划明细实体
*
* @param wmsInPlanDetailEntity 入库计划明细实体
* @return 结果
*/
public int insertWmsInPlanDetailEntity(WmsInPlanDetailEntity wmsInPlanDetailEntity);
/**
* 修改入库计划明细实体
*
* @param wmsInPlanDetailEntity 入库计划明细实体
* @return 结果
*/
public int updateWmsInPlanDetailEntity(WmsInPlanDetailEntity wmsInPlanDetailEntity);
/**
* 批量删除入库计划明细实体
*
* @param ids 需要删除的入库计划明细实体主键集合
* @return 结果
*/
public int deleteWmsInPlanDetailEntityByIds(Long[] ids);
/**
* 删除入库计划明细实体信息
*
* @param id 入库计划明细实体主键
* @return 结果
*/
public int deleteWmsInPlanDetailEntityById(Long id);
}

View File

@ -0,0 +1,96 @@
package com.ktg.mes.wm.service.impl;
import java.util.List;
import com.ktg.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ktg.mes.wm.mapper.WmsInPlanDetailEntityMapper;
import com.ktg.mes.wm.domain.WmsInPlanDetailEntity;
import com.ktg.mes.wm.service.IWmsInPlanDetailEntityService;
/**
* 入库计划明细实体Service业务层处理
*
* @author yinjinlu
* @date 2024-11-05
*/
@Service
public class WmsInPlanDetailEntityServiceImpl implements IWmsInPlanDetailEntityService
{
@Autowired
private WmsInPlanDetailEntityMapper wmsInPlanDetailEntityMapper;
/**
* 查询入库计划明细实体
*
* @param id 入库计划明细实体主键
* @return 入库计划明细实体
*/
@Override
public WmsInPlanDetailEntity selectWmsInPlanDetailEntityById(Long id)
{
return wmsInPlanDetailEntityMapper.selectWmsInPlanDetailEntityById(id);
}
/**
* 查询入库计划明细实体列表
*
* @param wmsInPlanDetailEntity 入库计划明细实体
* @return 入库计划明细实体
*/
@Override
public List<WmsInPlanDetailEntity> selectWmsInPlanDetailEntityList(WmsInPlanDetailEntity wmsInPlanDetailEntity)
{
return wmsInPlanDetailEntityMapper.selectWmsInPlanDetailEntityList(wmsInPlanDetailEntity);
}
/**
* 新增入库计划明细实体
*
* @param wmsInPlanDetailEntity 入库计划明细实体
* @return 结果
*/
@Override
public int insertWmsInPlanDetailEntity(WmsInPlanDetailEntity wmsInPlanDetailEntity)
{
wmsInPlanDetailEntity.setCreateTime(DateUtils.getNowDate());
return wmsInPlanDetailEntityMapper.insertWmsInPlanDetailEntity(wmsInPlanDetailEntity);
}
/**
* 修改入库计划明细实体
*
* @param wmsInPlanDetailEntity 入库计划明细实体
* @return 结果
*/
@Override
public int updateWmsInPlanDetailEntity(WmsInPlanDetailEntity wmsInPlanDetailEntity)
{
wmsInPlanDetailEntity.setUpdateTime(DateUtils.getNowDate());
return wmsInPlanDetailEntityMapper.updateWmsInPlanDetailEntity(wmsInPlanDetailEntity);
}
/**
* 批量删除入库计划明细实体
*
* @param ids 需要删除的入库计划明细实体主键
* @return 结果
*/
@Override
public int deleteWmsInPlanDetailEntityByIds(Long[] ids)
{
return wmsInPlanDetailEntityMapper.deleteWmsInPlanDetailEntityByIds(ids);
}
/**
* 删除入库计划明细实体信息
*
* @param id 入库计划明细实体主键
* @return 结果
*/
@Override
public int deleteWmsInPlanDetailEntityById(Long id)
{
return wmsInPlanDetailEntityMapper.deleteWmsInPlanDetailEntityById(id);
}
}

View File

@ -0,0 +1,96 @@
<?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.ktg.mes.wm.mapper.WmsInPlanDetailEntityMapper">
<resultMap type="WmsInPlanDetailEntity" id="WmsInPlanDetailEntityResult">
<result property="id" column="ID" />
<result property="planId" column="PLAN_ID" />
<result property="planDetailsId" column="PLAN_DETAILS_ID" />
<result property="source" column="SOURCE" />
<result property="knifeId" column="KNIFE_ID" />
<result property="comsumeLife" column="COMSUME_LIFE" />
<result property="createBy" column="CREATE_BY" />
<result property="createTime" column="CREATE_TIME" />
<result property="updateBy" column="UPDATE_BY" />
<result property="updateTime" column="UPDATE_TIME" />
</resultMap>
<sql id="selectWmsInPlanDetailEntityVo">
select ID, PLAN_ID, PLAN_DETAILS_ID, SOURCE, KNIFE_ID, COMSUME_LIFE, CREATE_BY, CREATE_TIME, UPDATE_BY, UPDATE_TIME from WMS_IN_PLAN_DETAIL_ENTITY
</sql>
<select id="selectWmsInPlanDetailEntityList" parameterType="WmsInPlanDetailEntity" resultMap="WmsInPlanDetailEntityResult">
<include refid="selectWmsInPlanDetailEntityVo"/>
<where>
<if test="planId != null and planId != ''"> and PLAN_ID = #{planId}</if>
<if test="planDetailsId != null and planDetailsId != ''"> and PLAN_DETAILS_ID = #{planDetailsId}</if>
<if test="source != null and source != ''"> and SOURCE = #{source}</if>
<if test="knifeId != null and knifeId != ''"> and KNIFE_ID = #{knifeId}</if>
<if test="comsumeLife != null and comsumeLife != ''"> and COMSUME_LIFE = #{comsumeLife}</if>
<if test="createBy != null and createBy != ''"> and CREATE_BY = #{createBy}</if>
<if test="createTime != null and createTime != ''"> and CREATE_TIME = #{createTime}</if>
<if test="updateBy != null and updateBy != ''"> and UPDATE_BY = #{updateBy}</if>
<if test="updateTime != null and updateTime != ''"> and UPDATE_TIME = #{updateTime}</if>
</where>
</select>
<select id="selectWmsInPlanDetailEntityById" parameterType="Long" resultMap="WmsInPlanDetailEntityResult">
<include refid="selectWmsInPlanDetailEntityVo"/>
where ID = #{id}
</select>
<insert id="insertWmsInPlanDetailEntity" parameterType="WmsInPlanDetailEntity" useGeneratedKeys="true" keyProperty="id">
insert into WMS_IN_PLAN_DETAIL_ENTITY
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="planId != null">PLAN_ID,</if>
<if test="planDetailsId != null">PLAN_DETAILS_ID,</if>
<if test="source != null">SOURCE,</if>
<if test="knifeId != null">KNIFE_ID,</if>
<if test="comsumeLife != null">COMSUME_LIFE,</if>
<if test="createBy != null">CREATE_BY,</if>
<if test="createTime != null">CREATE_TIME,</if>
<if test="updateBy != null">UPDATE_BY,</if>
<if test="updateTime != null">UPDATE_TIME,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="planId != null">#{planId},</if>
<if test="planDetailsId != null">#{planDetailsId},</if>
<if test="source != null">#{source},</if>
<if test="knifeId != null">#{knifeId},</if>
<if test="comsumeLife != null">#{comsumeLife},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateWmsInPlanDetailEntity" parameterType="WmsInPlanDetailEntity">
update WMS_IN_PLAN_DETAIL_ENTITY
<trim prefix="SET" suffixOverrides=",">
<if test="planId != null">PLAN_ID = #{planId},</if>
<if test="planDetailsId != null">PLAN_DETAILS_ID = #{planDetailsId},</if>
<if test="source != null">SOURCE = #{source},</if>
<if test="knifeId != null">KNIFE_ID = #{knifeId},</if>
<if test="comsumeLife != null">COMSUME_LIFE = #{comsumeLife},</if>
<if test="createBy != null">CREATE_BY = #{createBy},</if>
<if test="createTime != null">CREATE_TIME = #{createTime},</if>
<if test="updateBy != null">UPDATE_BY = #{updateBy},</if>
<if test="updateTime != null">UPDATE_TIME = #{updateTime},</if>
</trim>
where ID = #{id}
</update>
<delete id="deleteWmsInPlanDetailEntityById" parameterType="Long">
delete from WMS_IN_PLAN_DETAIL_ENTITY where ID = #{id}
</delete>
<delete id="deleteWmsInPlanDetailEntityByIds" parameterType="String">
delete from WMS_IN_PLAN_DETAIL_ENTITY where ID in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>