This commit is contained in:
15066119699 2025-03-13 15:13:14 +08:00
parent 9a5ce38c19
commit 14c02e9c6d
6 changed files with 448 additions and 23 deletions

View File

@ -8,6 +8,7 @@ import javax.xml.stream.Location;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONObject;
import com.ruoyi.app.domain.*;
import com.ruoyi.app.domain.DTO.OtherStockInRequest;
import com.ruoyi.app.domain.DTO.PickCompleteReq;
@ -15,6 +16,7 @@ import com.ruoyi.app.service.*;
import com.ruoyi.app.service.impl.AppPendingStorageServiceImpl;
import com.ruoyi.common.annotation.Anonymous;
import com.ruoyi.common.constant.AppConstants;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.OrderCodeFactory;
@ -78,6 +80,8 @@ public class AppTaskController extends BaseController
private IAppVehicleService appVehicleService;
@Autowired
private IAppPmsOrderOutService appPmsOrderOutService;
@Autowired
private IAppWaveService appWaveService;
/**
* 查询请填写功能名称列表
*/
@ -509,7 +513,59 @@ public class AppTaskController extends BaseController
{
return success();
}
/**
* 出库单生成波次请求
* appPmsOrderOutList 生成波次列表
* @return 结果
*/
@ApiOperation("生成波次")
@PostMapping("/createWaveRequestByOrders")
@Transactional(rollbackFor = Exception.class)
@Anonymous
public AjaxResult createWaveRequestByOrders(@RequestBody List<AppPmsOrderOut> appPmsOrderOutList)
{
logger.info("接收生成波次请求:{}", JSONObject.toJSONString(appPmsOrderOutList));
//1.判断是否已生成波次
String orderCode = OrderCodeFactory.getOrderCode("", "");
for (AppPmsOrderOut appPmsOrderOut : appPmsOrderOutList) {
if(appPmsOrderOut.getGenerateWave() == 1){
return error("已生成波次的,不能重复生成");
}
//如果部分手动出库或者全部出库的也不能再次生成波次
if(appPmsOrderOut.getOrderStatus() == 1 || appPmsOrderOut.getOrderStatus() == 2){
return error("手动部分出库或者全部出库的,不能再次生成波次");
}
//状态为锁定的也不能再次生成波次
if(StringUtils.compare("1", appPmsOrderOut.getIsLock()) == 0){
return error("锁定的,不能再次生成波次");
}
AppPmsOrderOut appPmsOrderOut1 = new AppPmsOrderOut();
appPmsOrderOut1.setRecordId(appPmsOrderOut.getRecordId());
appPmsOrderOut1.setOrderWave(orderCode);
appPmsOrderOut1.setGenerateWave(1);
appPmsOrderOut1.setUpdateTime(new Date());
appPmsOrderOut1.setUpdateBy(getUsername());
appPmsOrderOutService.updateAppPmsOrderOut(appPmsOrderOut1);
}
AppWave appWave = new AppWave();
appWave.setWaveStatus(0);
appWave.setIsChad(0);
appWave.setOutRule(1);
appWave.setCreateTime(new Date());
appWave.setUpdateTime(new Date());
appWave.setCreateBy(getUsername());
appWave.setUpdateBy(getUsername());
appWave.setRemark("");
appWave.setWaveDestination("1");
appWave.setWaveId(orderCode);
appWave.setOrderWbs(orderCode);
appWaveService.insertAppWave(appWave);
return success("创建波次成功");
}
/**
* 出库单出库请求
* appPmsOrderOutList 出库单列表

View File

@ -0,0 +1,67 @@
package com.ruoyi.web.controller.app;
import java.util.List;
import java.util.stream.Collectors;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.app.domain.AppPmsOrderOut;
import com.ruoyi.app.domain.AppWaveConstitute;
import com.ruoyi.app.service.IAppPmsOrderOutService;
import org.springframework.beans.BeanUtils;
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.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 波次构成Controller
*
* @author ruoyi
* @date 2025-03-13
*/
@RestController
@RequestMapping("/system/waveConstitute")
public class AppWaveConstituteController extends BaseController
{
@Autowired
private IAppPmsOrderOutService appPmsOrderOutService;
/**
* 查询波次构成列表
*/
@PreAuthorize("@ss.hasPermi('system:waveConstitute:list')")
@GetMapping("/list")
public TableDataInfo list(AppPmsOrderOut appPmsOrderOut)
{
startPage();
List<AppPmsOrderOut> list = appPmsOrderOutService.selectAppPmsOrderOutList(appPmsOrderOut);
return getDataTable(list);
}
/**
* 导出波次构成列表
*/
@PreAuthorize("@ss.hasPermi('system:waveConstitute:export')")
@Log(title = "波次构成", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, AppPmsOrderOut appPmsOrderOut)
{
List<AppPmsOrderOut> list = appPmsOrderOutService.selectAppPmsOrderOutList(appPmsOrderOut);
List<AppWaveConstitute> result = list.stream().map(data -> convertAppWaveConstitute(data)).collect(Collectors.toList());
ExcelUtil<AppWaveConstitute> util = new ExcelUtil<AppWaveConstitute>(AppWaveConstitute.class);
util.exportExcel(response, result, "波次构成数据");
}
private AppWaveConstitute convertAppWaveConstitute(AppPmsOrderOut data) {
AppWaveConstitute appWaveConstitute = new AppWaveConstitute();
BeanUtils.copyProperties(data,appWaveConstitute);
return appWaveConstitute;
}
}

View File

@ -20,15 +20,15 @@ public class AppWave extends BaseEntity
/** 出库规则 */
@Excel(name = "出库规则")
private Long outRule;
private Integer outRule;
/** 是否插队 */
@Excel(name = "是否插队")
private Long isChad;
private Integer isChad;
/** 状态 */
@Excel(name = "状态")
private Long waveStatus;
private Integer waveStatus;
/** 订单WBS */
@Excel(name = "订单WBS")
@ -47,33 +47,31 @@ public class AppWave extends BaseEntity
{
return waveId;
}
public void setOutRule(Long outRule)
{
public Integer getOutRule() {
return outRule;
}
public void setOutRule(Integer outRule) {
this.outRule = outRule;
}
public Long getOutRule()
{
return outRule;
public Integer getIsChad() {
return isChad;
}
public void setIsChad(Long isChad)
{
public void setIsChad(Integer isChad) {
this.isChad = isChad;
}
public Long getIsChad()
{
return isChad;
public Integer getWaveStatus() {
return waveStatus;
}
public void setWaveStatus(Long waveStatus)
{
public void setWaveStatus(Integer waveStatus) {
this.waveStatus = waveStatus;
}
public Long getWaveStatus()
{
return waveStatus;
}
public void setOrderWbs(String orderWbs)
{
this.orderWbs = orderWbs;

View File

@ -0,0 +1,279 @@
package com.ruoyi.app.domain;
import java.math.BigDecimal;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* 波次构成对象 app_pms_order_out
*
* @author ruoyi
* @date 2025-03-13
*/
public class AppWaveConstitute extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 波次号 */
@Excel(name = "波次号")
private String orderWave;
/** 记录号 */
private String recordId;
/** wms订单号 */
@Excel(name = "wms订单号")
private String orderId;
/** 出库单号 */
@Excel(name = "出库单号")
private String listId;
/** 出库单类型 */
@Excel(name = "出库单类型")
private Integer orderType;
/** 客户名称 */
// @Excel(name = "客户名称")
private String customerId;
/** 物料号 */
@Excel(name = "物料号")
private String goodsId;
/** 订单出库数量 */
@Excel(name = "订单出库数量")
private BigDecimal goodsNum;
/** 总出库数量 */
@Excel(name = "总出库数量")
private BigDecimal pickNum;
/** 确认出库数量 */
@Excel(name = "确认出库数量")
private BigDecimal trNum;
/** 本次出库数量 */
@Excel(name = "本次出库数量")
private BigDecimal shelvesNum;
/** 库存数量 */
@Excel(name = "库存数量")
private BigDecimal stockNum;
/** 物料描述 */
@Excel(name = "物料描述")
private String goodsDesc;
// /** 预留1 */
// @Excel(name = "预留1")
private String spare1;
//
// /** 预留2 */
// @Excel(name = "预留2")
private String spare2;
/** 订单状态 0未出库 1部分出库 2全部出库 */
@Excel(name = "订单状态", readConverterExp = "0=未出库,1=部分出库,2=全部出库")
private Integer orderStatus;
/** 是否锁定 */
@Excel(name = "是否锁定", readConverterExp = "0=否,1=是")
private String isLock;
/** 0未生成 1生成波次 */
// @Excel(name = "0未生成 1生成波次")
private Integer generateWave;
public void setRecordId(String recordId)
{
this.recordId = recordId;
}
public String getRecordId()
{
return recordId;
}
public void setOrderId(String orderId)
{
this.orderId = orderId;
}
public String getOrderId()
{
return orderId;
}
public void setListId(String listId)
{
this.listId = listId;
}
public String getListId()
{
return listId;
}
public void setOrderType(Integer orderType)
{
this.orderType = orderType;
}
public Integer getOrderType()
{
return orderType;
}
public void setCustomerId(String customerId)
{
this.customerId = customerId;
}
public String getCustomerId()
{
return customerId;
}
public void setGoodsId(String goodsId)
{
this.goodsId = goodsId;
}
public String getGoodsId()
{
return goodsId;
}
public void setGoodsNum(BigDecimal goodsNum)
{
this.goodsNum = goodsNum;
}
public BigDecimal getGoodsNum()
{
return goodsNum;
}
public void setPickNum(BigDecimal pickNum)
{
this.pickNum = pickNum;
}
public BigDecimal getPickNum()
{
return pickNum;
}
public void setTrNum(BigDecimal trNum)
{
this.trNum = trNum;
}
public BigDecimal getTrNum()
{
return trNum;
}
public void setShelvesNum(BigDecimal shelvesNum)
{
this.shelvesNum = shelvesNum;
}
public BigDecimal getShelvesNum()
{
return shelvesNum;
}
public void setStockNum(BigDecimal stockNum)
{
this.stockNum = stockNum;
}
public BigDecimal getStockNum()
{
return stockNum;
}
public void setGoodsDesc(String goodsDesc)
{
this.goodsDesc = goodsDesc;
}
public String getGoodsDesc()
{
return goodsDesc;
}
public void setSpare1(String spare1)
{
this.spare1 = spare1;
}
public String getSpare1()
{
return spare1;
}
public void setSpare2(String spare2)
{
this.spare2 = spare2;
}
public String getSpare2()
{
return spare2;
}
public void setOrderStatus(Integer orderStatus)
{
this.orderStatus = orderStatus;
}
public Integer getOrderStatus()
{
return orderStatus;
}
public void setIsLock(String isLock)
{
this.isLock = isLock;
}
public String getIsLock()
{
return isLock;
}
public void setGenerateWave(Integer generateWave)
{
this.generateWave = generateWave;
}
public Integer getGenerateWave()
{
return generateWave;
}
public void setOrderWave(String orderWave)
{
this.orderWave = orderWave;
}
public String getOrderWave()
{
return orderWave;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("recordId", getRecordId())
.append("orderId", getOrderId())
.append("listId", getListId())
.append("orderType", getOrderType())
.append("customerId", getCustomerId())
.append("goodsId", getGoodsId())
.append("goodsNum", getGoodsNum())
.append("pickNum", getPickNum())
.append("trNum", getTrNum())
.append("shelvesNum", getShelvesNum())
.append("stockNum", getStockNum())
.append("goodsDesc", getGoodsDesc())
.append("spare1", getSpare1())
.append("spare2", getSpare2())
.append("orderStatus", getOrderStatus())
.append("isLock", getIsLock())
.append("createTime", getCreateTime())
.append("createBy", getCreateBy())
.append("updateTime", getUpdateTime())
.append("generateWave", getGenerateWave())
.append("orderWave", getOrderWave())
.toString();
}
}

View File

@ -20,7 +20,6 @@
<result property="invAge" column="inv_age" />
<result property="goodsStatus" column="goods_status" />
<result property="stockStatus" column="stock_status" />
<result property="createTime" column="create_time" />
<result property="createUser" column="create_user" />
<result property="lastUpdateTime" column="last_update_time" />
<result property="lastUpdateUser" column="last_update_user" />
@ -34,11 +33,15 @@
<result property="packingNum" column="packing_num" />
<result property="productionDate" column="production_date" />
<result property="goodsDesc" column="goods_desc" />
<result property="createTime" column="create_time" />
<result property="createBy" column="create_by" />
<result property="updateTime" column="update_time" />
<result property="updateBy" column="update_by" />
</resultMap>
<sql id="selectAppStockVo">
select stock_id, list_id, vehicle_id, location_id, goods_id, goods_name, goods_unit, provider_id, provider_name, remain_num, origin_num, batch_no, inv_age, goods_status, stock_status, create_time, create_user, last_update_time, last_update_user, remark ,
ware_date, storage_mode,storage_id, area_id, goods_type_id, occupy_num, packing_num, production_date,goods_desc from app_stock
ware_date, storage_mode,storage_id, area_id, goods_type_id, occupy_num, packing_num, production_date,goods_desc, create_by, update_by,update_time from app_stock
</sql>
<select id="selectAppStockList" parameterType="AppStock" resultMap="AppStockResult">
@ -102,6 +105,9 @@
<if test="packingNum != null">packing_num,</if>
<if test="productionDate != null">production_date,</if>
<if test="goodsDesc != null">goods_desc,</if>
<if test="createBy != null">create_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="updateBy != null">update_by,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="stockId != null">#{stockId},</if>
@ -133,6 +139,9 @@
<if test="packingNum != null">#{packingNum},</if>
<if test="productionDate != null">#{productionDate},</if>
<if test="goodsDesc != null">#{goodsDesc},</if>
<if test="createBy != null">#{createBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="updateBy != null">#{updateBy},</if>
</trim>
</insert>
@ -168,6 +177,8 @@
<if test="packingNum != null">packing_num = #{packingNum},</if>
<if test="productionDate != null">production_date = #{productionDate},</if>
<if test="goodsDesc != null">goods_desc = #{goodsDesc},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
</trim>
where stock_id = #{stockId}
</update>

View File

@ -12,10 +12,14 @@
<result property="orderWbs" column="order_wbs" />
<result property="remark" column="remark" />
<result property="waveDestination" column="wave_destination" />
<result property="createTime" column="create_time" />
<result property="createBy" column="create_by" />
<result property="updateTime" column="update_time" />
<result property="updateBy" column="update_by" />
</resultMap>
<sql id="selectAppWaveVo">
select wave_id, out_rule, is_chad, wave_status, order_wbs, remark, wave_destination from app_wave
select wave_id, out_rule, is_chad, wave_status, order_wbs, remark, wave_destination,create_time, create_by, update_time, update_by from app_wave
</sql>
<select id="selectAppWaveList" parameterType="AppWave" resultMap="AppWaveResult">
@ -44,6 +48,10 @@
<if test="orderWbs != null">order_wbs,</if>
<if test="remark != null">remark,</if>
<if test="waveDestination != null and waveDestination != ''">wave_destination,</if>
<if test="createTime != null">create_time,</if>
<if test="createBy != null">create_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="updateBy != null">update_by,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="waveId != null">#{waveId},</if>
@ -53,6 +61,10 @@
<if test="orderWbs != null">#{orderWbs},</if>
<if test="remark != null">#{remark},</if>
<if test="waveDestination != null and waveDestination != ''">#{waveDestination},</if>
<if test="createTime != null">#{createTime},</if>
<if test="createBy != null">#{createBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="updateBy != null">#{updateBy},</if>
</trim>
</insert>
@ -65,6 +77,8 @@
<if test="orderWbs != null">order_wbs = #{orderWbs},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="waveDestination != null and waveDestination != ''">wave_destination = #{waveDestination},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
</trim>
where wave_id = #{waveId}
</update>