add:合箱管理
This commit is contained in:
@@ -94,4 +94,12 @@ public interface MdPbStoragevehicleextMapper extends BaseMapper<MdPbStoragevehic
|
||||
* @return List<JSONObject>
|
||||
*/
|
||||
List<JSONObject> getBigScreenIvt();
|
||||
|
||||
/**
|
||||
* 获取可用库存分页查询
|
||||
* @param page 分页条件
|
||||
* @param whereJson 查询条件
|
||||
* @return IPage<JSONObject>
|
||||
*/
|
||||
IPage<JSONObject> getCanuseIvtQtyAsc(Page<JSONObject> page, @Param("param") Map whereJson);
|
||||
}
|
||||
|
||||
@@ -365,4 +365,68 @@
|
||||
GROUP BY ext.material_id
|
||||
ORDER BY canuse_qty DESC
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getCanuseIvtQtyAsc" resultType="com.alibaba.fastjson.JSONObject">
|
||||
SELECT
|
||||
ext.storagevehicleext_id,
|
||||
ext.storagevehicle_code,
|
||||
ext.material_id,
|
||||
material.material_code,
|
||||
material.material_name,
|
||||
ext.pcsn,
|
||||
ext.qty_unit_id,
|
||||
ext.qty_unit_name,
|
||||
ext.canuse_qty AS qty,
|
||||
ext.frozen_qty,
|
||||
attr.sect_name AS turnout_sect_name,
|
||||
attr.sect_code AS turnout_sect_code,
|
||||
attr.sect_id,
|
||||
attr.stor_id,
|
||||
attr.struct_id,
|
||||
attr.struct_code AS turnout_struct_code
|
||||
FROM
|
||||
md_pb_storagevehicleext ext
|
||||
INNER JOIN md_me_materialbase material ON material.material_id = ext.material_id
|
||||
INNER JOIN st_ivt_structattr attr ON ext.storagevehicle_code = attr.storagevehicle_code
|
||||
INNER JOIN md_pb_groupplate late ON ext.storagevehicle_code = late.storagevehicle_code
|
||||
AND late.material_id = ext.material_id AND late.pcsn = ext.pcsn
|
||||
<where>
|
||||
attr.lock_type = '0'
|
||||
AND attr.is_used = "1"
|
||||
AND late.status = "2"
|
||||
AND ext.canuse_qty > 0
|
||||
<if test="param.stor_id != null and param.stor_id != ''">
|
||||
AND
|
||||
attr.stor_id = #{param.stor_id}
|
||||
</if>
|
||||
|
||||
<if test="param.sect_id != null and param.sect_id != ''">
|
||||
AND
|
||||
attr.sect_id = #{param.sect_id}
|
||||
</if>
|
||||
|
||||
<if test="param.struct_code != null and param.struct_code != ''">
|
||||
AND
|
||||
attr.struct_code LIKE #{param.struct_code}
|
||||
</if>
|
||||
|
||||
<if test="param.material_code != null and param.material_code != ''">
|
||||
AND
|
||||
material.material_code = #{param.material_code}
|
||||
</if>
|
||||
|
||||
<if test="param.pcsn != null and param.pcsn != ''">
|
||||
AND
|
||||
ext.pcsn = #{param.pcsn}
|
||||
</if>
|
||||
|
||||
<if test="param.bake_num != null and param.bake_num != ''">
|
||||
AND
|
||||
late.bake_num = #{param.bake_num}
|
||||
</if>
|
||||
|
||||
</where>
|
||||
ORDER BY ext.canuse_qty
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -216,7 +216,7 @@ public class MdPbStoragevehicleextServiceImpl extends ServiceImpl<MdPbStorageveh
|
||||
moveInsertDto.setTotal_qty(extDao.getCanuse_qty());
|
||||
moveInsertDto.setDetail_count(BigDecimal.ONE);
|
||||
moveInsertDto.setBill_status(IOSEnum.MOVE_MST_STATUS.code("生成"));
|
||||
moveInsertDto.setRemark("由库存状态变更发起!");
|
||||
moveInsertDto.setRemark("由库存状态变更创建!");
|
||||
|
||||
// 组织明细
|
||||
List<JSONObject> dtlList = new ArrayList<>();
|
||||
|
||||
@@ -312,8 +312,10 @@ public class StructattrServiceImpl extends ServiceImpl<StructattrMapper, Structa
|
||||
Structattr attrDao = attrList.stream()
|
||||
.filter(row -> row.getStruct_code().equals(json.getString("struct_code")))
|
||||
.findFirst().orElse(null);
|
||||
attrDao.setLock_type(json.getString("lock_type"));
|
||||
this.update(attrDao);
|
||||
if (ObjectUtil.isNotEmpty(attrDao)) {
|
||||
attrDao.setLock_type(json.getString("lock_type"));
|
||||
this.update(attrDao);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.CodeUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
@@ -11,7 +12,9 @@ import org.nl.config.IdUtil;
|
||||
import org.nl.wms.basedata_manage.enums.BaseDataEnum;
|
||||
import org.nl.wms.sch_manage.enums.TaskEnum;
|
||||
import org.nl.wms.sch_manage.enums.TaskStatus;
|
||||
import org.nl.wms.sch_manage.service.ISchBasePointService;
|
||||
import org.nl.wms.sch_manage.service.ISchBaseTaskService;
|
||||
import org.nl.wms.sch_manage.service.dao.SchBasePoint;
|
||||
import org.nl.wms.sch_manage.service.dao.SchBaseTask;
|
||||
import org.nl.wms.sch_manage.service.util.AbstractTask;
|
||||
import org.nl.wms.sch_manage.service.util.AcsTaskDto;
|
||||
@@ -46,6 +49,12 @@ public class BackInTask extends AbstractTask {
|
||||
@Resource
|
||||
private IOStorInvDisMapper ioStorInvDisMapper;
|
||||
|
||||
/**
|
||||
* 点位服务
|
||||
*/
|
||||
@Autowired
|
||||
private ISchBasePointService iSchBasePointService;
|
||||
|
||||
@Override
|
||||
public String create(JSONObject json) {
|
||||
SchBaseTask task = new SchBaseTask();
|
||||
@@ -146,6 +155,14 @@ public class BackInTask extends AbstractTask {
|
||||
taskObj.setRemark("已完成");
|
||||
taskService.updateById(taskObj);
|
||||
rawAssistIStorService.taskFinish(taskObj);
|
||||
// 更新起点
|
||||
iSchBasePointService.update(
|
||||
new UpdateWrapper<SchBasePoint>().lambda()
|
||||
.set(SchBasePoint::getVehicle_code, null)
|
||||
.set(SchBasePoint::getPoint_status, IOSEnum.POINT_STATUS.code("空位"))
|
||||
.eq(SchBasePoint::getPoint_code, taskObj.getPoint_code1())
|
||||
|
||||
);
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
|
||||
@@ -0,0 +1,228 @@
|
||||
package org.nl.wms.sch_manage.service.util.tasks;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.CodeUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.config.IdUtil;
|
||||
import org.nl.wms.basedata_manage.enums.BaseDataEnum;
|
||||
import org.nl.wms.sch_manage.enums.TaskEnum;
|
||||
import org.nl.wms.sch_manage.enums.TaskStatus;
|
||||
import org.nl.wms.sch_manage.service.ISchBasePointService;
|
||||
import org.nl.wms.sch_manage.service.ISchBaseTaskService;
|
||||
import org.nl.wms.sch_manage.service.dao.SchBasePoint;
|
||||
import org.nl.wms.sch_manage.service.dao.SchBaseTask;
|
||||
import org.nl.wms.sch_manage.service.util.AbstractTask;
|
||||
import org.nl.wms.sch_manage.service.util.AcsTaskDto;
|
||||
import org.nl.wms.sch_manage.service.util.TaskType;
|
||||
import org.nl.wms.warehouse_management.enums.IOSEnum;
|
||||
import org.nl.wms.warehouse_management.service.IRawAssistIStorService;
|
||||
import org.nl.wms.warehouse_management.service.IStIvtCombinedBoxService;
|
||||
import org.nl.wms.warehouse_management.service.dao.IOStorInvDis;
|
||||
import org.nl.wms.warehouse_management.service.dao.IOStorInvDtl;
|
||||
import org.nl.wms.warehouse_management.service.dao.StIvtCombinedBox;
|
||||
import org.nl.wms.warehouse_management.service.dao.mapper.IOStorInvDisMapper;
|
||||
import org.nl.wms.warehouse_management.service.dao.mapper.IOStorInvDtlMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 合箱入库任务类
|
||||
* </p>
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2025-08-22
|
||||
*/
|
||||
@Component(value = "CombinedBoxInTask")
|
||||
@TaskType("CombinedBoxInTask")
|
||||
public class CombinedBoxInTask extends AbstractTask {
|
||||
@Autowired
|
||||
private ISchBaseTaskService taskService;
|
||||
|
||||
/**
|
||||
* 入库服务
|
||||
*/
|
||||
@Resource
|
||||
private IRawAssistIStorService rawAssistIStorService;
|
||||
|
||||
/**
|
||||
* 分配明细mapper
|
||||
*/
|
||||
@Resource
|
||||
private IOStorInvDisMapper ioStorInvDisMapper;
|
||||
|
||||
/**
|
||||
* 点位服务
|
||||
*/
|
||||
@Autowired
|
||||
private ISchBasePointService iSchBasePointService;
|
||||
|
||||
/**
|
||||
* 合箱记录服务
|
||||
*/
|
||||
@Autowired
|
||||
private IStIvtCombinedBoxService iStIvtCombinedBoxService;
|
||||
|
||||
/**
|
||||
* 入库明细服务
|
||||
*/
|
||||
@Autowired
|
||||
private IOStorInvDtlMapper ioStorInvDtlMapper;
|
||||
|
||||
@Override
|
||||
public String create(JSONObject json) {
|
||||
SchBaseTask task = new SchBaseTask();
|
||||
task.setTask_id(IdUtil.getStringId());
|
||||
task.setTask_code(CodeUtil.getNewCode("TASK_CODE"));
|
||||
task.setTask_status(TaskStatus.CREATE.getCode());
|
||||
task.setConfig_code(CombinedBoxInTask.class.getSimpleName());
|
||||
task.setPoint_code1(json.getString("point_code1"));
|
||||
task.setPoint_code2(json.getString("point_code2"));
|
||||
task.setVehicle_code(json.getString("vehicle_code"));
|
||||
task.setMaterial_id(json.getString("material_id"));
|
||||
task.setMaterial_qty(json.getBigDecimal("material_qty"));
|
||||
task.setGroup_id(json.getString("group_id"));
|
||||
task.setRequest_param(json.toString());
|
||||
task.setTask_type(TaskEnum.TASK_TYPE.code("料箱"));
|
||||
task.setPriority(json.getString("Priority"));
|
||||
task.setCreate_id(SecurityUtils.getCurrentUserId());
|
||||
task.setCreate_name(SecurityUtils.getCurrentNickName());
|
||||
task.setCreate_time(DateUtil.now());
|
||||
taskService.save(task);
|
||||
|
||||
// 下发任务
|
||||
this.sendTaskOne(task.getTask_id());
|
||||
return task.getTask_id();
|
||||
}
|
||||
|
||||
@Override
|
||||
public AcsTaskDto sendAcsParam(String taskId) {
|
||||
SchBaseTask taskDao = taskService.getById(taskId);
|
||||
|
||||
// 组织下发给acs的数据
|
||||
AcsTaskDto acsTaskDto = new AcsTaskDto();
|
||||
acsTaskDto.setExt_task_id(taskDao.getTask_id());
|
||||
acsTaskDto.setTask_code(taskDao.getTask_code());
|
||||
acsTaskDto.setStart_device_code(taskDao.getPoint_code1());
|
||||
acsTaskDto.setNext_device_code(taskDao.getPoint_code2());
|
||||
acsTaskDto.setPriority(taskDao.getPriority());
|
||||
acsTaskDto.setVehicle_code(taskDao.getVehicle_code());
|
||||
acsTaskDto.setTask_type("1");
|
||||
|
||||
return acsTaskDto;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void updateStatus(String task_code, TaskStatus status) {
|
||||
// 校验任务
|
||||
SchBaseTask taskObj = taskService.getByCode(task_code);
|
||||
if (taskObj.getTask_status().equals(TaskStatus.FINISHED.getCode())) {
|
||||
throw new BadRequestException("该任务已完成!");
|
||||
}
|
||||
if (taskObj.getTask_status().equals(TaskStatus.CANCELED.getCode())) {
|
||||
throw new BadRequestException("该任务已取消!");
|
||||
}
|
||||
// 根据传来的类型去对任务进行操作
|
||||
if (status.equals(TaskStatus.EXECUTING)) {
|
||||
taskObj.setTask_status(TaskStatus.EXECUTING.getCode());
|
||||
taskObj.setRemark("执行中");
|
||||
taskService.updateById(taskObj);
|
||||
}
|
||||
if (status.equals(TaskStatus.FINISHED)) {
|
||||
this.finishTask(taskObj);
|
||||
}
|
||||
if (status.equals(TaskStatus.CANCELED)) {
|
||||
this.cancelTask(taskObj);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void forceFinish(String task_code) {
|
||||
SchBaseTask taskObj = taskService.getByCode(task_code);
|
||||
if (ObjectUtil.isEmpty(taskObj)) {
|
||||
throw new BadRequestException("该任务不存在");
|
||||
}
|
||||
this.finishTask(taskObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cancel(String task_code) {
|
||||
SchBaseTask taskObj = taskService.getByCode(task_code);
|
||||
if (ObjectUtil.isEmpty(taskObj)) {
|
||||
throw new BadRequestException("该任务不存在");
|
||||
}
|
||||
if (!TaskStatus.CREATE.getCode().equals(taskObj.getTask_status())) {
|
||||
throw new BadRequestException("任务状态必须为生成才能取消任务");
|
||||
}
|
||||
this.cancelTask(taskObj);
|
||||
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void finishTask(SchBaseTask taskObj) {
|
||||
// 任务完成
|
||||
taskObj.setTask_status(TaskStatus.FINISHED.getCode());
|
||||
taskObj.setRemark("已完成");
|
||||
taskService.updateById(taskObj);
|
||||
rawAssistIStorService.taskFinish(taskObj);
|
||||
// 更新起点
|
||||
iSchBasePointService.update(
|
||||
new UpdateWrapper<SchBasePoint>().lambda()
|
||||
.set(SchBasePoint::getVehicle_code, null)
|
||||
.set(SchBasePoint::getPoint_status, IOSEnum.POINT_STATUS.code("空位"))
|
||||
.eq(SchBasePoint::getPoint_code, taskObj.getPoint_code1())
|
||||
|
||||
);
|
||||
this.taskConfirm(taskObj.getTask_code());
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void cancelTask(SchBaseTask taskObj) {
|
||||
// 取消任务
|
||||
taskService.update(new LambdaUpdateWrapper<SchBaseTask>()
|
||||
.set(SchBaseTask::getIs_delete, BaseDataEnum.IS_YES_NOT.code("是"))
|
||||
.set(SchBaseTask::getTask_status, TaskStatus.CANCELED.getCode())
|
||||
.set(SchBaseTask::getRemark, "已取消")
|
||||
.eq(SchBaseTask::getTask_id, taskObj.getTask_id())
|
||||
);
|
||||
//分配表清除任务
|
||||
ioStorInvDisMapper.update(new IOStorInvDis(), new LambdaUpdateWrapper<>(IOStorInvDis.class)
|
||||
.set(IOStorInvDis::getTask_id, null)
|
||||
.set(IOStorInvDis::getPoint_code, null)
|
||||
.set(IOStorInvDis::getIs_issued, 0)
|
||||
.set(IOStorInvDis::getWork_status, IOSEnum.INBILL_DIS_STATUS.code("未生成"))
|
||||
.eq(IOStorInvDis::getTask_id, taskObj.getTask_id())
|
||||
);
|
||||
|
||||
// 更新任务状态
|
||||
taskObj.setTask_status(TaskStatus.CANCELED.getCode());
|
||||
taskObj.setRemark("已取消");
|
||||
taskService.updateById(taskObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void taskConfirm(String task_code) {
|
||||
SchBaseTask taskObj = taskService.getByCode(task_code);
|
||||
// 查询分配明细
|
||||
IOStorInvDis disDao = ioStorInvDisMapper.selectOne(
|
||||
new QueryWrapper<IOStorInvDis>().lambda()
|
||||
.eq(IOStorInvDis::getTask_id, taskObj.getTask_id())
|
||||
);
|
||||
// 查询明细
|
||||
IOStorInvDtl dtlDao = ioStorInvDtlMapper.selectById(disDao.getIostorinvdtl_id());
|
||||
// 更新合箱记录状态为完成
|
||||
StIvtCombinedBox boxDao = iStIvtCombinedBoxService.getById(dtlDao.getSource_bill_code());
|
||||
boxDao.setStatus(IOSEnum.COMBINED_BOX_STATUS.code("完成"));
|
||||
iStIvtCombinedBoxService.updateById(boxDao);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,265 @@
|
||||
package org.nl.wms.sch_manage.service.util.tasks;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.CodeUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.config.IdUtil;
|
||||
import org.nl.wms.basedata_manage.service.IMdPbStoragevehicleextService;
|
||||
import org.nl.wms.basedata_manage.service.IStructattrService;
|
||||
import org.nl.wms.basedata_manage.service.dao.MdPbStoragevehicleext;
|
||||
import org.nl.wms.basedata_manage.service.dao.Structattr;
|
||||
import org.nl.wms.sch_manage.enums.TaskStatus;
|
||||
import org.nl.wms.sch_manage.service.ISchBasePointService;
|
||||
import org.nl.wms.sch_manage.service.ISchBaseTaskService;
|
||||
import org.nl.wms.sch_manage.service.dao.SchBasePoint;
|
||||
import org.nl.wms.sch_manage.service.dao.SchBaseTask;
|
||||
import org.nl.wms.sch_manage.service.util.AbstractTask;
|
||||
import org.nl.wms.sch_manage.service.util.AcsTaskDto;
|
||||
import org.nl.wms.sch_manage.service.util.TaskType;
|
||||
import org.nl.wms.warehouse_management.enums.IOSEnum;
|
||||
import org.nl.wms.warehouse_management.service.IMdPbGroupplateService;
|
||||
import org.nl.wms.warehouse_management.service.IStIvtCombinedBoxService;
|
||||
import org.nl.wms.warehouse_management.service.IStIvtMoveinvService;
|
||||
import org.nl.wms.warehouse_management.service.IStIvtMoveinvdtlService;
|
||||
import org.nl.wms.warehouse_management.service.dao.GroupPlate;
|
||||
import org.nl.wms.warehouse_management.service.dao.StIvtCombinedBox;
|
||||
import org.nl.wms.warehouse_management.service.dao.StIvtMoveinvdtl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 合箱移库任务类
|
||||
* </p>
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2025-08-21
|
||||
*/
|
||||
@Component(value = "CombinedBoxMoveTask")
|
||||
@TaskType("CombinedBoxMoveTask")
|
||||
public class CombinedBoxMoveTask extends AbstractTask {
|
||||
|
||||
/**
|
||||
* 任务服务类
|
||||
*/
|
||||
@Autowired
|
||||
private ISchBaseTaskService taskService;
|
||||
|
||||
/**
|
||||
* 移库主表服务类
|
||||
*/
|
||||
@Autowired
|
||||
private IStIvtMoveinvService iStIvtMoveinvService;
|
||||
|
||||
/**
|
||||
* 移库明细服务类
|
||||
*/
|
||||
@Autowired
|
||||
private IStIvtMoveinvdtlService iStIvtMoveinvdtlService;
|
||||
|
||||
/**
|
||||
* 合箱记录服务
|
||||
*/
|
||||
@Autowired
|
||||
private IStIvtCombinedBoxService iStIvtCombinedBoxService;
|
||||
|
||||
/**
|
||||
* 仓位服务
|
||||
*/
|
||||
@Autowired
|
||||
private IStructattrService iStructattrService;
|
||||
|
||||
/**
|
||||
* 点位服务
|
||||
*/
|
||||
@Autowired
|
||||
private ISchBasePointService iSchBasePointService;
|
||||
|
||||
/**
|
||||
* 库存记录服务
|
||||
*/
|
||||
@Autowired
|
||||
private IMdPbStoragevehicleextService iMdPbStoragevehicleextService;
|
||||
|
||||
/**
|
||||
* 组盘记录服务
|
||||
*/
|
||||
@Autowired
|
||||
private IMdPbGroupplateService iMdPbGroupplateService;
|
||||
|
||||
@Override
|
||||
public String create(JSONObject json) {
|
||||
SchBaseTask task = new SchBaseTask();
|
||||
task.setTask_id(IdUtil.getStringId());
|
||||
task.setTask_code(CodeUtil.getNewCode("TASK_CODE"));
|
||||
task.setTask_status(TaskStatus.CREATE.getCode());
|
||||
task.setConfig_code(CombinedBoxMoveTask.class.getSimpleName());
|
||||
task.setPoint_code1(json.getString("point_code1"));
|
||||
task.setPoint_code2(json.getString("point_code2"));
|
||||
task.setVehicle_code(json.getString("vehicle_code"));
|
||||
task.setGroup_id(json.getString("group_id"));
|
||||
task.setRequest_param(json.toString());
|
||||
task.setPriority(json.getString("Priority"));
|
||||
task.setCreate_id(SecurityUtils.getCurrentUserId());
|
||||
task.setCreate_name(SecurityUtils.getCurrentNickName());
|
||||
task.setCreate_time(DateUtil.now());
|
||||
taskService.save(task);
|
||||
|
||||
// 下发任务
|
||||
this.sendTaskOne(task.getTask_id());
|
||||
return task.getTask_id();
|
||||
}
|
||||
|
||||
@Override
|
||||
public AcsTaskDto sendAcsParam(String taskId) {
|
||||
SchBaseTask taskDao = taskService.getById(taskId);
|
||||
|
||||
// 组织下发给acs的数据
|
||||
AcsTaskDto acsTaskDto = new AcsTaskDto();
|
||||
acsTaskDto.setExt_task_id(taskDao.getTask_id());
|
||||
acsTaskDto.setTask_code(taskDao.getTask_code());
|
||||
acsTaskDto.setStart_device_code(taskDao.getPoint_code1());
|
||||
acsTaskDto.setNext_device_code(taskDao.getPoint_code2());
|
||||
acsTaskDto.setPriority(taskDao.getPriority());
|
||||
acsTaskDto.setVehicle_code(taskDao.getVehicle_code());
|
||||
acsTaskDto.setTask_type("1");
|
||||
return acsTaskDto;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void updateStatus(String task_code, TaskStatus status) {
|
||||
// 校验任务
|
||||
SchBaseTask taskObj = taskService.getByCode(task_code);
|
||||
if (taskObj.getTask_status().equals(TaskStatus.FINISHED.getCode())) {
|
||||
throw new BadRequestException("该任务已完成!");
|
||||
}
|
||||
if (taskObj.getTask_status().equals(TaskStatus.CANCELED.getCode())) {
|
||||
throw new BadRequestException("该任务已取消!");
|
||||
}
|
||||
// 根据传来的类型去对任务进行操作
|
||||
if (status.equals(TaskStatus.EXECUTING)) {
|
||||
// 更新明细状态
|
||||
iStIvtMoveinvService.executing(taskObj);
|
||||
taskObj.setTask_status(TaskStatus.EXECUTING.getCode());
|
||||
taskObj.setRemark("执行中");
|
||||
taskService.updateById(taskObj);
|
||||
}
|
||||
if (status.equals(TaskStatus.FINISHED)) {
|
||||
this.finishTask(taskObj);
|
||||
}
|
||||
if (status.equals(TaskStatus.CANCELED)) {
|
||||
this.cancelTask(taskObj);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void forceFinish(String task_code) {
|
||||
SchBaseTask taskObj = taskService.getByCode(task_code);
|
||||
if (ObjectUtil.isEmpty(taskObj)) {
|
||||
throw new BadRequestException("该任务不存在");
|
||||
}
|
||||
this.finishTask(taskObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cancel(String task_code) {
|
||||
SchBaseTask taskObj = taskService.getByCode(task_code);
|
||||
if (ObjectUtil.isEmpty(taskObj)) {
|
||||
throw new BadRequestException("该任务不存在");
|
||||
}
|
||||
if (Integer.parseInt(taskObj.getTask_status()) > Integer.parseInt(TaskStatus.CREATE.getCode())) {
|
||||
throw new BadRequestException("只能取消生成中的任务!");
|
||||
}
|
||||
this.cancelTask(taskObj);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public void finishTask(SchBaseTask taskObj) {
|
||||
// 完成任务
|
||||
this.taskConfirm(taskObj.getTask_code());
|
||||
// 更新任务状态
|
||||
taskObj.setRemark("已完成");
|
||||
taskObj.setTask_status(TaskStatus.FINISHED.getCode());
|
||||
taskService.updateById(taskObj);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public void cancelTask(SchBaseTask taskObj) {
|
||||
// 删除任务
|
||||
StIvtMoveinvdtl dtlDao = iStIvtMoveinvdtlService.getOne(
|
||||
new QueryWrapper<StIvtMoveinvdtl>().lambda()
|
||||
.eq(StIvtMoveinvdtl::getTask_id, taskObj.getTask_id())
|
||||
);
|
||||
iStIvtMoveinvService.cancelTask(dtlDao);
|
||||
// 更新合箱记录状态
|
||||
StIvtCombinedBox boxDao = iStIvtCombinedBoxService.getById(dtlDao.getSource_bill_code());
|
||||
boxDao.setStatus(IOSEnum.COMBINED_BOX_STATUS.code("生成"));
|
||||
boxDao.setMove_id("");
|
||||
iStIvtCombinedBoxService.updateById(boxDao);
|
||||
|
||||
// 更新任务状态
|
||||
taskObj.setRemark("已取消");
|
||||
taskObj.setTask_status(TaskStatus.CANCELED.getCode());
|
||||
taskService.updateById(taskObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void taskConfirm(String task_code) {
|
||||
SchBaseTask taskObj = taskService.getByCode(task_code);
|
||||
StIvtMoveinvdtl dtlDao = iStIvtMoveinvdtlService.getOne(
|
||||
new QueryWrapper<StIvtMoveinvdtl>().lambda()
|
||||
.eq(StIvtMoveinvdtl::getTask_id, taskObj.getTask_id())
|
||||
);
|
||||
|
||||
// 更新起点
|
||||
iStructattrService.update(
|
||||
new UpdateWrapper<Structattr>().lambda()
|
||||
.eq(Structattr::getStruct_code, taskObj.getPoint_code1())
|
||||
.set(Structattr::getLock_type, IOSEnum.LOCK_TYPE.code("未锁定"))
|
||||
.set(Structattr::getStoragevehicle_code, null)
|
||||
);
|
||||
// 更新终点
|
||||
iSchBasePointService.update(
|
||||
new UpdateWrapper<SchBasePoint>().lambda()
|
||||
.set(SchBasePoint::getVehicle_code, taskObj.getVehicle_code())
|
||||
.set(SchBasePoint::getPoint_status, IOSEnum.POINT_STATUS.code("有箱有料"))
|
||||
.eq(SchBasePoint::getPoint_code, taskObj.getPoint_code2())
|
||||
|
||||
);
|
||||
|
||||
// 更新移库明细状态
|
||||
dtlDao.setWork_status(IOSEnum.MOVE_DTL_STATUS.code("完成"));
|
||||
iStIvtMoveinvdtlService.updateById(dtlDao);
|
||||
// 更新移库主表状态
|
||||
iStIvtMoveinvService.updateMstStatus(dtlDao.getMoveinv_id());
|
||||
|
||||
// 更新合箱记录状态
|
||||
StIvtCombinedBox boxDao = iStIvtCombinedBoxService.getById(dtlDao.getSource_bill_code());
|
||||
boxDao.setStatus(IOSEnum.COMBINED_BOX_STATUS.code("移库完成"));
|
||||
iStIvtCombinedBoxService.updateById(boxDao);
|
||||
|
||||
// 删除库存记录
|
||||
iMdPbStoragevehicleextService.remove(
|
||||
new QueryWrapper<MdPbStoragevehicleext>().lambda()
|
||||
.eq(MdPbStoragevehicleext::getStoragevehicle_code, dtlDao.getStoragevehicle_code())
|
||||
.eq(MdPbStoragevehicleext::getPcsn, dtlDao.getPcsn())
|
||||
.eq(MdPbStoragevehicleext::getMaterial_id, boxDao.getMaterial_id())
|
||||
);
|
||||
|
||||
// 更新组盘记录为生成
|
||||
iMdPbGroupplateService.update(
|
||||
new UpdateWrapper<GroupPlate>().lambda()
|
||||
.set(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("组盘"))
|
||||
.eq(GroupPlate::getStoragevehicle_code, dtlDao.getStoragevehicle_code())
|
||||
.eq(GroupPlate::getPcsn, dtlDao.getPcsn())
|
||||
.eq(GroupPlate::getMaterial_id, boxDao.getMaterial_id())
|
||||
.eq(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("入库"))
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -4,14 +4,18 @@ import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.CodeUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.config.IdUtil;
|
||||
import org.nl.wms.basedata_manage.enums.BaseDataEnum;
|
||||
import org.nl.wms.basedata_manage.service.dao.Structattr;
|
||||
import org.nl.wms.sch_manage.enums.TaskEnum;
|
||||
import org.nl.wms.sch_manage.enums.TaskStatus;
|
||||
import org.nl.wms.sch_manage.service.ISchBasePointService;
|
||||
import org.nl.wms.sch_manage.service.ISchBaseTaskService;
|
||||
import org.nl.wms.sch_manage.service.dao.SchBasePoint;
|
||||
import org.nl.wms.sch_manage.service.dao.SchBaseTask;
|
||||
import org.nl.wms.sch_manage.service.util.AbstractTask;
|
||||
import org.nl.wms.sch_manage.service.util.AcsTaskDto;
|
||||
@@ -46,6 +50,12 @@ public class DetainInTask extends AbstractTask {
|
||||
@Resource
|
||||
private IOStorInvDisMapper ioStorInvDisMapper;
|
||||
|
||||
/**
|
||||
* 点位服务
|
||||
*/
|
||||
@Autowired
|
||||
private ISchBasePointService iSchBasePointService;
|
||||
|
||||
@Override
|
||||
public String create(JSONObject json) {
|
||||
SchBaseTask task = new SchBaseTask();
|
||||
@@ -146,6 +156,14 @@ public class DetainInTask extends AbstractTask {
|
||||
taskObj.setRemark("已完成");
|
||||
taskService.updateById(taskObj);
|
||||
rawAssistIStorService.taskFinish(taskObj);
|
||||
// 更新起点
|
||||
iSchBasePointService.update(
|
||||
new UpdateWrapper<SchBasePoint>().lambda()
|
||||
.set(SchBasePoint::getVehicle_code, null)
|
||||
.set(SchBasePoint::getPoint_status, IOSEnum.POINT_STATUS.code("空位"))
|
||||
.eq(SchBasePoint::getPoint_code, taskObj.getPoint_code1())
|
||||
|
||||
);
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
|
||||
@@ -27,9 +27,12 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* @Author: Liuxy
|
||||
* @Description: 手持定点任务
|
||||
* @Date: 2025/6/6
|
||||
* <p>
|
||||
* 点对点任务类
|
||||
* </p>
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2025-08-21
|
||||
*/
|
||||
@Component(value = "PdaPointTask")
|
||||
@TaskType("PdaPointTask")
|
||||
|
||||
@@ -13,7 +13,9 @@ import org.nl.config.IdUtil;
|
||||
import org.nl.wms.basedata_manage.enums.BaseDataEnum;
|
||||
import org.nl.wms.sch_manage.enums.TaskEnum;
|
||||
import org.nl.wms.sch_manage.enums.TaskStatus;
|
||||
import org.nl.wms.sch_manage.service.ISchBasePointService;
|
||||
import org.nl.wms.sch_manage.service.ISchBaseTaskService;
|
||||
import org.nl.wms.sch_manage.service.dao.SchBasePoint;
|
||||
import org.nl.wms.sch_manage.service.dao.SchBaseTask;
|
||||
import org.nl.wms.sch_manage.service.util.AbstractTask;
|
||||
import org.nl.wms.sch_manage.service.util.AcsTaskDto;
|
||||
@@ -53,6 +55,12 @@ public class SelectBackInTask extends AbstractTask {
|
||||
@Resource
|
||||
private IMdPbGroupplateService iMdPbGroupplateService;
|
||||
|
||||
/**
|
||||
* 点位服务
|
||||
*/
|
||||
@Autowired
|
||||
private ISchBasePointService iSchBasePointService;
|
||||
|
||||
@Override
|
||||
public String create(JSONObject json) {
|
||||
SchBaseTask task = new SchBaseTask();
|
||||
@@ -197,5 +205,13 @@ public class SelectBackInTask extends AbstractTask {
|
||||
.eq(GroupPlate::getPcsn, disDao.getPcsn())
|
||||
.eq(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("出库"))
|
||||
);
|
||||
// 更新起点
|
||||
iSchBasePointService.update(
|
||||
new UpdateWrapper<SchBasePoint>().lambda()
|
||||
.set(SchBasePoint::getVehicle_code, null)
|
||||
.set(SchBasePoint::getPoint_status, IOSEnum.POINT_STATUS.code("空位"))
|
||||
.eq(SchBasePoint::getPoint_code, taskObj.getPoint_code1())
|
||||
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
package org.nl.wms.warehouse_management.controller;
|
||||
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.base.TableDataInfo;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.logging.annotation.Log;
|
||||
import org.nl.wms.warehouse_management.service.IStIvtCombinedBoxService;
|
||||
import org.nl.wms.warehouse_management.service.dao.StIvtCombinedBox;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 合箱管理 控制层
|
||||
* </p>
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2025-08-21
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/api/combinedBox")
|
||||
@Slf4j
|
||||
public class ISIvtCombinedBoxController {
|
||||
|
||||
@Autowired
|
||||
private IStIvtCombinedBoxService iStIvtCombinedBoxService;
|
||||
|
||||
@GetMapping
|
||||
@Log("分页查询")
|
||||
public ResponseEntity<Object> query(@RequestParam Map whereJson, PageQuery page) {
|
||||
return new ResponseEntity<>(TableDataInfo.build(iStIvtCombinedBoxService.queryAll(whereJson, page)), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/getCanuseIvt")
|
||||
@Log("获取可用库存物料")
|
||||
public ResponseEntity<Object> getCanuseIvt(@RequestParam Map whereJson, PageQuery page) {
|
||||
return new ResponseEntity<>(TableDataInfo.build(iStIvtCombinedBoxService.getCanuseIvt(whereJson, page)), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Log("新增合箱")
|
||||
public ResponseEntity<Object> create(@Validated @RequestBody StIvtCombinedBox dto) {
|
||||
iStIvtCombinedBoxService.create(dto);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Log("修改合箱")
|
||||
public ResponseEntity<Object> update(@Validated @RequestBody StIvtCombinedBox dto) {
|
||||
iStIvtCombinedBoxService.update(dto);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
@Log("删除合箱")
|
||||
public ResponseEntity<Object> delete(@RequestBody Set<String> ids) {
|
||||
iStIvtCombinedBoxService.delete(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/sendMoveTask")
|
||||
@Log("下发移库任务")
|
||||
public ResponseEntity<Object> sendMoveTask(@RequestBody StIvtCombinedBox dto) {
|
||||
iStIvtCombinedBoxService.sendMoveTask(dto);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PostMapping("/getWeigh")
|
||||
@Log("获取称重重量")
|
||||
public ResponseEntity<Object> getWeigh(@RequestBody StIvtCombinedBox dto) {
|
||||
return new ResponseEntity<>(iStIvtCombinedBoxService.getWeigh(dto), HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PostMapping("/saveWeigh")
|
||||
@Log("保存称重重量")
|
||||
public ResponseEntity<Object> saveWeigh(@RequestBody StIvtCombinedBox dto) {
|
||||
iStIvtCombinedBoxService.saveWeigh(dto);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PostMapping("/confirmIn")
|
||||
@Log("入库确认")
|
||||
public ResponseEntity<Object> confirmIn(@RequestBody StIvtCombinedBox dto) {
|
||||
iStIvtCombinedBoxService.confirmIn(dto);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -38,11 +38,11 @@ public enum IOSEnum {
|
||||
)),
|
||||
|
||||
// 移库业务类型
|
||||
MOVE_BILL_TYPE(MapOf.of("库内移库","2001")),
|
||||
MOVE_BILL_TYPE(MapOf.of("库内移库","2001", "合箱移库","2002")),
|
||||
|
||||
// 入库任务配置类编码
|
||||
IN_CONFIG_CODE(MapOf.of("0001","DetainInTask", "0002", "BackInTask",
|
||||
"0003", "GeBoxInTask", "0004", "PieceBoxInTask", "0005", "SelectBackInTask", "0009", "HandInTask"
|
||||
"0003", "CombinedBoxInTask", "0004", "PieceBoxInTask", "0005", "SelectBackInTask", "0009", "HandInTask"
|
||||
)),
|
||||
|
||||
// 出库任务配置类编码
|
||||
@@ -51,7 +51,7 @@ public enum IOSEnum {
|
||||
)),
|
||||
|
||||
// 移库任务配置类编码
|
||||
MOVE_CONFIG_CODE(MapOf.of("2001","InsideMoveTask", "2002", "2002",
|
||||
MOVE_CONFIG_CODE(MapOf.of("2001","InsideMoveTask", "2002", "CombinedBoxMoveTask",
|
||||
"2003", "2003", "2004", "2004", "2005", "2005"
|
||||
)),
|
||||
|
||||
@@ -61,6 +61,9 @@ public enum IOSEnum {
|
||||
//组盘记录状态
|
||||
GROUP_PLATE_STATUS(MapOf.of( "组盘", "1", "入库", "2", "出库", "3")),
|
||||
|
||||
//合箱记录状态
|
||||
COMBINED_BOX_STATUS(MapOf.of( "生成", "1", "移库中", "2", "移库完成", "3", "入库中", "4", "完成", "5")),
|
||||
|
||||
// 锁类型
|
||||
LOCK_TYPE(MapOf.of("未锁定", "0", "入库锁", "1", "出库锁", "2"
|
||||
, "移入锁", "3", "移出锁", "4", "空托盘入库锁", "5", "空托盘出库锁", "6",
|
||||
|
||||
@@ -0,0 +1,96 @@
|
||||
package org.nl.wms.warehouse_management.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.wms.warehouse_management.service.dao.StIvtCombinedBox;
|
||||
import org.nl.wms.warehouse_management.service.dto.StIvtCombinedBoxDto;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 合箱记录表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2025-08-21
|
||||
*/
|
||||
public interface IStIvtCombinedBoxService extends IService<StIvtCombinedBox> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param whereJson : {查询参数}
|
||||
* @param page : 分页对象
|
||||
* @return 返回结果
|
||||
*/
|
||||
IPage<StIvtCombinedBoxDto> queryAll(Map whereJson, PageQuery page);
|
||||
|
||||
/**
|
||||
* 新增合箱
|
||||
*
|
||||
* @param dto 实体类
|
||||
*/
|
||||
void create(StIvtCombinedBox dto);
|
||||
|
||||
/**
|
||||
* 修改合箱
|
||||
*
|
||||
* @param dto 实体类
|
||||
*/
|
||||
void update(StIvtCombinedBox dto);
|
||||
|
||||
/**
|
||||
* 删除合箱
|
||||
*
|
||||
* @param ids id集合
|
||||
*/
|
||||
void delete(Set<String> ids);
|
||||
|
||||
/**
|
||||
* 获取可用库存物料
|
||||
*
|
||||
* @param whereJson : {
|
||||
* 分页参数:page,size
|
||||
* stor_id: 仓库id
|
||||
* struct_code: 货位编码
|
||||
* material_code: 物料编码
|
||||
* pcsn: 批次
|
||||
* bake_num: 烘干次数
|
||||
* }
|
||||
* @param page : 分页对象
|
||||
* @return 返回结果
|
||||
*/
|
||||
IPage<JSONObject> getCanuseIvt(Map whereJson, PageQuery page);
|
||||
|
||||
/**
|
||||
* 下发移库任务
|
||||
*
|
||||
* @param dto 实体类
|
||||
*/
|
||||
void sendMoveTask(StIvtCombinedBox dto);
|
||||
|
||||
/**
|
||||
* 获取称重重量
|
||||
* @param dto 实体类dto
|
||||
* @return JSONObject {
|
||||
* weigh_qty
|
||||
* }
|
||||
*/
|
||||
JSONObject getWeigh(StIvtCombinedBox dto);
|
||||
|
||||
/**
|
||||
* 保存称重
|
||||
* @param dto 实体类dto
|
||||
*/
|
||||
void saveWeigh(StIvtCombinedBox dto);
|
||||
|
||||
/**
|
||||
* 入库确认
|
||||
* @param dto 实体类dto
|
||||
*/
|
||||
void confirmIn(StIvtCombinedBox dto);
|
||||
}
|
||||
@@ -93,6 +93,12 @@ public interface IStIvtMoveinvService extends IService<StIvtMoveinv> {
|
||||
*/
|
||||
void executing(SchBaseTask taskObj);
|
||||
|
||||
/**
|
||||
* 更新主表状态
|
||||
* @param moveinv_id 移库单id
|
||||
*/
|
||||
void updateMstStatus(String moveinv_id);
|
||||
|
||||
/**
|
||||
* 强制确认
|
||||
* @param dto 新增修改dto实体类
|
||||
|
||||
@@ -0,0 +1,92 @@
|
||||
package org.nl.wms.warehouse_management.service.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 合箱记录表
|
||||
* </p>
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2025-08-21
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("st_ivt_combinedbox")
|
||||
public class StIvtCombinedBox implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* id标识
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 物料标识
|
||||
*/
|
||||
private String material_id;
|
||||
|
||||
/**
|
||||
* 烘干次数
|
||||
*/
|
||||
private Integer hot_num;
|
||||
|
||||
/**
|
||||
* 半满箱载具编码
|
||||
*/
|
||||
private String vehicle_code;
|
||||
|
||||
/**
|
||||
* 半满箱载具编码
|
||||
*/
|
||||
private String pcsn;
|
||||
|
||||
/**
|
||||
* 半满箱库存数量
|
||||
*/
|
||||
private BigDecimal ivt_qty;
|
||||
|
||||
/**
|
||||
* 移库单明细
|
||||
*/
|
||||
private String move_id;
|
||||
|
||||
/**
|
||||
* 称重重量
|
||||
*/
|
||||
private BigDecimal weight_qty;
|
||||
|
||||
/**
|
||||
* 加料重量
|
||||
*/
|
||||
private BigDecimal material_qty;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String create_id;
|
||||
|
||||
/**
|
||||
* 创建人名称
|
||||
*/
|
||||
private String create_name;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private String create_time;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package org.nl.wms.warehouse_management.service.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.nl.wms.warehouse_management.service.dao.StIvtCombinedBox;
|
||||
import org.nl.wms.warehouse_management.service.dto.StIvtCombinedBoxDto;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 合箱记录表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2025-08-21
|
||||
*/
|
||||
public interface StIvtCombinedBoxMapper extends BaseMapper<StIvtCombinedBox> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页条件
|
||||
* @param whereJson 查询条件
|
||||
* @return IPage<PdmBomCallMaterialDto>
|
||||
*/
|
||||
IPage<StIvtCombinedBoxDto> queryAllByPage(Page<StIvtCombinedBoxDto> page, @Param("param") Map whereJson);
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
<?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="org.nl.wms.warehouse_management.service.dao.mapper.StIvtCombinedBoxMapper">
|
||||
|
||||
<select id="queryAllByPage" resultType="org.nl.wms.warehouse_management.service.dto.StIvtCombinedBoxDto">
|
||||
SELECT
|
||||
box.*,
|
||||
mater.material_code,
|
||||
mater.material_name,
|
||||
mater.material_spec
|
||||
FROM
|
||||
st_ivt_combinedbox box
|
||||
INNER JOIN md_me_materialbase mater ON mater.material_id = box.material_id
|
||||
<where>
|
||||
1 = 1
|
||||
<if test="param.material_code != null and param.material_code != ''">
|
||||
AND
|
||||
(mater.material_code LIKE #{param.material_code} or
|
||||
mater.material_name LIKE #{param.material_code} )
|
||||
</if>
|
||||
|
||||
<if test="param.vehicle_code != null and param.vehicle_code != ''">
|
||||
AND
|
||||
box.vehicle_code LIKE #{param.vehicle_code}
|
||||
</if>
|
||||
|
||||
<if test="param.pcsn != null and param.pcsn != ''">
|
||||
AND
|
||||
box.pcsn LIKE #{param.pcsn}
|
||||
</if>
|
||||
|
||||
<if test="param.status != null and param.status != ''">
|
||||
AND
|
||||
box.status = #{param.status}
|
||||
</if>
|
||||
|
||||
</where>
|
||||
ORDER BY box.create_time Desc
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,32 @@
|
||||
package org.nl.wms.warehouse_management.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import org.nl.wms.warehouse_management.service.dao.StIvtCombinedBox;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 合箱dto
|
||||
* </p>
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2025-08-14
|
||||
*/
|
||||
@Data
|
||||
public class StIvtCombinedBoxDto extends StIvtCombinedBox {
|
||||
|
||||
/**
|
||||
* 物料标批次
|
||||
*/
|
||||
private String material_spec;
|
||||
|
||||
/**
|
||||
* 物料编码
|
||||
*/
|
||||
private String material_code;
|
||||
|
||||
/**
|
||||
* 物料编码
|
||||
*/
|
||||
private String material_name;
|
||||
|
||||
}
|
||||
@@ -214,7 +214,7 @@ public class RawAssistIStorServiceImpl extends ServiceImpl<IOStorInvMapper, IOSt
|
||||
ioStorInvDtl.put("iostorinv_id", iostorinv_id);
|
||||
ioStorInvDtl.put("seq_no", (i + 1) + "");
|
||||
ioStorInvDtl.put("material_id", row.get("material_id"));
|
||||
ioStorInvDtl.put("Pcsn", row.get("pcsn"));
|
||||
ioStorInvDtl.put("pcsn", row.get("pcsn"));
|
||||
ioStorInvDtl.put("bill_status", IOSEnum.BILL_STATUS.code("生成"));
|
||||
ioStorInvDtl.put("qty_unit_id", row.get("qty_unit_id"));
|
||||
ioStorInvDtl.put("qty_unit_name", row.get("qty_unit_name"));
|
||||
|
||||
@@ -0,0 +1,425 @@
|
||||
package org.nl.wms.warehouse_management.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.wms.basedata_manage.service.*;
|
||||
import org.nl.wms.basedata_manage.service.dao.*;
|
||||
import org.nl.wms.basedata_manage.service.dao.mapper.MdPbStoragevehicleextMapper;
|
||||
import org.nl.wms.ext.service.WmsToAcsService;
|
||||
import org.nl.wms.ext.service.util.AcsResponse;
|
||||
import org.nl.wms.sch_manage.service.ISchBasePointService;
|
||||
import org.nl.wms.sch_manage.service.dao.SchBasePoint;
|
||||
import org.nl.wms.warehouse_management.enums.IOSConstant;
|
||||
import org.nl.wms.warehouse_management.enums.IOSEnum;
|
||||
import org.nl.wms.warehouse_management.service.*;
|
||||
import org.nl.wms.warehouse_management.service.dao.*;
|
||||
import org.nl.wms.warehouse_management.service.dao.mapper.IOStorInvDtlMapper;
|
||||
import org.nl.wms.warehouse_management.service.dao.mapper.StIvtCombinedBoxMapper;
|
||||
import org.nl.wms.warehouse_management.service.dto.IOStorInvDisDto;
|
||||
import org.nl.wms.warehouse_management.service.dto.MoveInsertDto;
|
||||
import org.nl.wms.warehouse_management.service.dto.StIvtCombinedBoxDto;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 合箱记录表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2025-08-21
|
||||
*/
|
||||
@Service
|
||||
public class StIvtCombinedBoxServiceImpl extends ServiceImpl<StIvtCombinedBoxMapper, StIvtCombinedBox> implements IStIvtCombinedBoxService {
|
||||
|
||||
/**
|
||||
* 载具扩展属性mapper
|
||||
*/
|
||||
@Resource
|
||||
private MdPbStoragevehicleextMapper mdPbStoragevehicleextMapper;
|
||||
|
||||
/**
|
||||
* 仓位服务
|
||||
*/
|
||||
@Autowired
|
||||
private IStructattrService iStructattrService;
|
||||
|
||||
/**
|
||||
* 物料服务
|
||||
*/
|
||||
@Autowired
|
||||
private IMdMeMaterialbaseService iMdMeMaterialbaseService;
|
||||
|
||||
/**
|
||||
* 计量单位服务
|
||||
*/
|
||||
@Autowired
|
||||
private IMdPbMeasureunitService iMdPbMeasureunitService;
|
||||
|
||||
/**
|
||||
* 移库单服务
|
||||
*/
|
||||
@Autowired
|
||||
private IStIvtMoveinvService iStIvtMoveinvService;
|
||||
|
||||
/**
|
||||
* 移库单明细服务
|
||||
*/
|
||||
@Autowired
|
||||
private IStIvtMoveinvdtlService iStIvtMoveinvdtlService;
|
||||
|
||||
/**
|
||||
* 点位信息服务
|
||||
*/
|
||||
@Autowired
|
||||
private ISchBasePointService iSchBasePointService;
|
||||
|
||||
/**
|
||||
* 载具信息服务
|
||||
*/
|
||||
@Autowired
|
||||
private IMdPbStoragevehicleinfoService iMdPbStoragevehicleinfoService;
|
||||
|
||||
/**
|
||||
* wms调用acs服务
|
||||
*/
|
||||
@Autowired
|
||||
private WmsToAcsService wmsToAcsService;
|
||||
|
||||
/**
|
||||
* 入库服务
|
||||
*/
|
||||
@Autowired
|
||||
private IRawAssistIStorService iRawAssistIStorService;
|
||||
|
||||
/**
|
||||
* 库区服务
|
||||
*/
|
||||
@Autowired
|
||||
private ISectattrService iSectattrService;
|
||||
|
||||
/**
|
||||
* 入库明细服务
|
||||
*/
|
||||
@Autowired
|
||||
private IOStorInvDtlMapper ioStorInvDtlMapper;
|
||||
|
||||
/**
|
||||
* 组盘记录服务
|
||||
*/
|
||||
@Autowired
|
||||
private IMdPbGroupplateService iMdPbGroupplateService;
|
||||
|
||||
@Override
|
||||
public IPage<StIvtCombinedBoxDto> queryAll(Map whereJson, PageQuery page) {
|
||||
return this.baseMapper.queryAllByPage(new Page<>(page.getPage() + 1, page.getSize()),
|
||||
whereJson);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void create(StIvtCombinedBox dto) {
|
||||
dto.setId(IdUtil.getStringId());
|
||||
dto.setStatus(IOSEnum.COMBINED_BOX_STATUS.code("生成"));
|
||||
dto.setCreate_id(SecurityUtils.getCurrentUserId());
|
||||
dto.setCreate_name(SecurityUtils.getCurrentNickName());
|
||||
dto.setCreate_time(DateUtil.now());
|
||||
this.save(dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void update(StIvtCombinedBox dto) {
|
||||
this.updateById(dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void delete(Set<String> ids) {
|
||||
this.removeByIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<JSONObject> getCanuseIvt(Map whereJson, PageQuery page) {
|
||||
return mdPbStoragevehicleextMapper.getCanuseIvtQtyAsc(new Page<>(page.getPage() + 1, page.getSize()),
|
||||
whereJson);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void sendMoveTask(StIvtCombinedBox dto) {
|
||||
// 组织移库生成单据
|
||||
String movedtl_id = createMoveTask(dto);
|
||||
// 更新单据状态
|
||||
dto.setStatus(IOSEnum.COMBINED_BOX_STATUS.code("移库中"));
|
||||
dto.setMove_id(movedtl_id);
|
||||
this.updateById(dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject getWeigh(StIvtCombinedBox dto) {
|
||||
// 判断当前载具是否是称重位上的载具
|
||||
SchBasePoint pointDao = iSchBasePointService.getById(IOSConstant.CZW_POINT);
|
||||
if (!pointDao.getVehicle_code().equals(dto.getVehicle_code())) {
|
||||
throw new BadRequestException("当前称重位载具与合箱载具不符,当前称重位载具为【" + pointDao.getVehicle_code() + "】");
|
||||
}
|
||||
// 获取载具信息
|
||||
MdPbStoragevehicleinfo vehicleDao = iMdPbStoragevehicleinfoService.getByCode(pointDao.getVehicle_code());
|
||||
if (ObjectUtil.isEmpty(vehicleDao.getWeigth())) {
|
||||
throw new BadRequestException("请维护当前载具重量【" + pointDao.getVehicle_code() + "】");
|
||||
}
|
||||
|
||||
// TODO 调用ACS接口获取称重信息
|
||||
AcsResponse weighAcs = wmsToAcsService.getWeighAcs(new JSONObject());
|
||||
JSONObject jsonResult = weighAcs.getResultData();
|
||||
|
||||
// 称重重量
|
||||
double weigh_qty = NumberUtil.round(jsonResult.getDoubleValue("weigh_qty"), 2).doubleValue();
|
||||
// 扣除载具重量
|
||||
double sub_qty = NumberUtil.sub(weigh_qty, vehicleDao.getWeigth().doubleValue());
|
||||
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("weigh_qty", NumberUtil.round(sub_qty, 2));
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void saveWeigh(StIvtCombinedBox dto) {
|
||||
// 更新合箱记录称重重量、加料重量
|
||||
StIvtCombinedBox boxDao = this.getById(dto.getId());
|
||||
boxDao.setWeight_qty(dto.getWeight_qty());
|
||||
boxDao.setMaterial_qty(dto.getMaterial_qty());
|
||||
this.updateById(dto);
|
||||
|
||||
// 更新组盘重量
|
||||
iMdPbGroupplateService.update(
|
||||
new UpdateWrapper<GroupPlate>().lambda()
|
||||
.set(GroupPlate::getQty, dto.getWeight_qty())
|
||||
.eq(GroupPlate::getStoragevehicle_code, dto.getVehicle_code())
|
||||
.eq(GroupPlate::getPcsn, dto.getPcsn())
|
||||
.eq(GroupPlate::getMaterial_id, boxDao.getMaterial_id())
|
||||
.eq(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("组盘"))
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void confirmIn(StIvtCombinedBox dto) {
|
||||
// 组织入库数据
|
||||
JSONObject resultJson = createCombineBoxIn(dto);
|
||||
// 调用分配
|
||||
JSONObject resultMap = divCombineBoxIn(resultJson);
|
||||
// 调用下发
|
||||
sendTask(resultMap);
|
||||
// 更新合箱记录为入库中
|
||||
StIvtCombinedBox boxDao = this.getById(dto.getId());
|
||||
boxDao.setStatus(IOSEnum.COMBINED_BOX_STATUS.code("入库中"));
|
||||
this.updateById(boxDao);
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建移库单并下发任务
|
||||
* @param dto 合箱实体类
|
||||
* @return movedtl_id 明细标识
|
||||
*/
|
||||
private String createMoveTask(StIvtCombinedBox dto) {
|
||||
// 查询移出货位
|
||||
List<Structattr> attrDaoList = iStructattrService.list(
|
||||
new QueryWrapper<Structattr>().lambda()
|
||||
.eq(Structattr::getLock_type, IOSEnum.LOCK_TYPE.code("未锁定"))
|
||||
.ne(Structattr::getIs_emptyvehicle, IOSConstant.ONE)
|
||||
.eq(Structattr::getStoragevehicle_code, dto.getVehicle_code())
|
||||
);
|
||||
if (ObjectUtil.isEmpty(attrDaoList)) {
|
||||
throw new BadRequestException("当前载具正在执行任务或者载具不在库内!");
|
||||
}
|
||||
if (attrDaoList.size() > 1) {
|
||||
throw new BadRequestException("库内载具【"+dto.getVehicle_code()+"】重复,请检查数据!");
|
||||
}
|
||||
|
||||
// 组织主表
|
||||
MoveInsertDto moveInsertDto = new MoveInsertDto();
|
||||
moveInsertDto.setBill_type(IOSEnum.MOVE_BILL_TYPE.code("合箱移库"));
|
||||
moveInsertDto.setBiz_date(DateUtil.today());
|
||||
moveInsertDto.setStor_id(attrDaoList.get(0).getStor_id());
|
||||
moveInsertDto.setTotal_qty(dto.getIvt_qty());
|
||||
moveInsertDto.setDetail_count(BigDecimal.ONE);
|
||||
moveInsertDto.setBill_status(IOSEnum.MOVE_MST_STATUS.code("生成"));
|
||||
moveInsertDto.setRemark("由合箱单据创建!");
|
||||
|
||||
// 组织明细
|
||||
List<JSONObject> dtlList = new ArrayList<>();
|
||||
JSONObject jsonDtl = new JSONObject();
|
||||
jsonDtl.put("turnout_sect_code", attrDaoList.get(0).getSect_code());
|
||||
jsonDtl.put("turnout_struct_code", attrDaoList.get(0).getStruct_code());
|
||||
MdMeMaterialbase materDao = iMdMeMaterialbaseService.getById(dto.getMaterial_id());
|
||||
jsonDtl.put("material_code", materDao.getMaterial_code());
|
||||
jsonDtl.put("material_id", materDao.getMaterial_id());
|
||||
jsonDtl.put("pcsn", dto.getPcsn());
|
||||
MdPbMeasureunit unitDao = iMdPbMeasureunitService.getByCode("KG");
|
||||
jsonDtl.put("qty_unit_id", unitDao.getMeasure_unit_id());
|
||||
jsonDtl.put("qty_unit_name", unitDao.getUnit_name());
|
||||
jsonDtl.put("qty", dto.getIvt_qty());
|
||||
jsonDtl.put("turnin_sect_code", IOSConstant.CZW_POINT);
|
||||
jsonDtl.put("turnin_struct_code", IOSConstant.CZW_POINT);
|
||||
jsonDtl.put("work_status", IOSEnum.MOVE_DTL_STATUS.code("生成"));
|
||||
jsonDtl.put("storagevehicle_code", dto.getVehicle_code());
|
||||
jsonDtl.put("source_bill_code", dto.getId());
|
||||
dtlList.add(jsonDtl);
|
||||
moveInsertDto.setTableData(dtlList);
|
||||
|
||||
// 调用移库单新增
|
||||
String move_id = iStIvtMoveinvService.create(moveInsertDto);
|
||||
// 下发任务
|
||||
StIvtMoveinv moveDao = new StIvtMoveinv();
|
||||
moveDao.setMoveinv_id(move_id);
|
||||
iStIvtMoveinvService.sendTask(moveDao);
|
||||
|
||||
// 查询明细标识
|
||||
StIvtMoveinvdtl dtlDao = iStIvtMoveinvdtlService.getOne(
|
||||
new QueryWrapper<StIvtMoveinvdtl>().lambda()
|
||||
.eq(StIvtMoveinvdtl::getMoveinv_id, move_id)
|
||||
);
|
||||
return dtlDao.getMoveinvdtl_id();
|
||||
}
|
||||
|
||||
/**
|
||||
* 组织入库数据
|
||||
* @param dto 合箱实体类dto
|
||||
* @return JSONObject
|
||||
*/
|
||||
private JSONObject createCombineBoxIn(StIvtCombinedBox dto) {
|
||||
// 查询移库单明细
|
||||
StIvtMoveinvdtl moveDtlDao = iStIvtMoveinvdtlService.getById(dto.getMove_id());
|
||||
// 查询主表
|
||||
StIvtMoveinv moveMstDao = iStIvtMoveinvService.getById(moveDtlDao.getMoveinv_id());
|
||||
// 查询移库仓位
|
||||
Structattr attrDao = iStructattrService.getByCode(moveDtlDao.getTurnout_struct_code());
|
||||
|
||||
// 组织主表数据
|
||||
Map<String, Object> jsonMst = new HashMap<>();
|
||||
jsonMst.put("stor_id", moveMstDao.getStor_id());
|
||||
jsonMst.put("bill_status", IOSEnum.BILL_STATUS.code("生成"));
|
||||
jsonMst.put("total_qty", dto.getWeight_qty());
|
||||
jsonMst.put("detail_count", 1);
|
||||
jsonMst.put("bill_type", IOSEnum.IN_BILL_TYPE.code("合箱入库"));
|
||||
jsonMst.put("biz_date", DateUtil.now());
|
||||
|
||||
// 组织明细数据
|
||||
ArrayList<HashMap> tableData = new ArrayList<>();
|
||||
HashMap<String, String> dtl = new HashMap<>();
|
||||
dtl.put("storagevehicle_code", dto.getVehicle_code());
|
||||
dtl.put("pcsn", dto.getPcsn());
|
||||
dtl.put("qty_unit_id", moveDtlDao.getQty_unit_id());
|
||||
dtl.put("qty_unit_name", moveDtlDao.getQty_unit_name());
|
||||
dtl.put("qty", dto.getWeight_qty().toString());
|
||||
MdMeMaterialbase materDao = iMdMeMaterialbaseService.getById(dto.getMaterial_id());
|
||||
dtl.put("material_code", materDao.getMaterial_code());
|
||||
dtl.put("material_name", materDao.getMaterial_name());
|
||||
dtl.put("material_id", materDao.getMaterial_id());
|
||||
dtl.put("plan_qty", dto.getWeight_qty().toString());
|
||||
dtl.put("ext_code", dto.getId());
|
||||
// 调用新增
|
||||
tableData.add(dtl);
|
||||
jsonMst.put("tableData", tableData);
|
||||
String iostorinv_id = iRawAssistIStorService.insertDtl(jsonMst);
|
||||
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("sect_id", attrDao.getSect_id());
|
||||
result.put("iostorinv_id", iostorinv_id);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 组织分配数据
|
||||
*
|
||||
* @param whereJson {
|
||||
* iostorinv_id
|
||||
* sect_id
|
||||
* }
|
||||
* @return JSONObject
|
||||
*/
|
||||
private JSONObject divCombineBoxIn(JSONObject whereJson) {
|
||||
// 查询库区
|
||||
Sectattr sectDao = iSectattrService.getById(whereJson.getString("sect_id"));
|
||||
// 组织主数据
|
||||
Map<String, Object> jsonMst = new HashMap<>();
|
||||
jsonMst.put("checked", true);
|
||||
jsonMst.put("sect_id", sectDao.getSect_id());
|
||||
jsonMst.put("stor_id", sectDao.getStor_id());
|
||||
// 组织明细数据
|
||||
IOStorInvDtl dtlDao = ioStorInvDtlMapper.selectOne(
|
||||
new QueryWrapper<IOStorInvDtl>().lambda()
|
||||
.eq(IOStorInvDtl::getIostorinv_id, whereJson.getString("iostorinv_id"))
|
||||
);
|
||||
// 查找分配明细
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("iostorinvdtl_id", dtlDao.getIostorinvdtl_id());
|
||||
List<IOStorInvDisDto> disDtl = iRawAssistIStorService.getDisDtl(map);
|
||||
// 类型转换
|
||||
ArrayList<LinkedHashMap> tableMater = new ArrayList<>();
|
||||
disDtl.forEach(item -> {
|
||||
tableMater.add(JSONObject.parseObject(JSONObject.toJSONString(item), LinkedHashMap.class));
|
||||
});
|
||||
jsonMst.put("tableMater", tableMater);
|
||||
// 调用分配
|
||||
iRawAssistIStorService.divStruct(jsonMst);
|
||||
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("storagevehicle_code", disDtl.get(0).getStoragevehicle_code());
|
||||
result.put("point_code", IOSConstant.CZW_POINT);
|
||||
result.put("sect_id", disDtl.get(0).getSect_id());
|
||||
result.put("iostorinv_id", disDtl.get(0).getIostorinv_id());
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 下发任务
|
||||
*
|
||||
* @param whereJson {
|
||||
* storagevehicle_code:载具编码
|
||||
* point_code:点位编码
|
||||
* sect_id:库区
|
||||
* iostorinv_id: id
|
||||
* }
|
||||
*/
|
||||
private void sendTask(JSONObject whereJson) {
|
||||
// 组织主数据
|
||||
Map<String, Object> jsonMst = new HashMap<>();
|
||||
jsonMst.put("point_code", whereJson.getString("point_code"));
|
||||
// 组织明细数据
|
||||
IOStorInvDtl dtlDao = ioStorInvDtlMapper.selectOne(
|
||||
new QueryWrapper<IOStorInvDtl>().lambda()
|
||||
.eq(IOStorInvDtl::getIostorinv_id, whereJson.getString("iostorinv_id"))
|
||||
);
|
||||
// 查找分配明细
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("iostorinvdtl_id", dtlDao.getIostorinvdtl_id());
|
||||
List<IOStorInvDisDto> disDtl = iRawAssistIStorService.getDisDtl(map);
|
||||
// 类型转换
|
||||
ArrayList<LinkedHashMap> tableMater = new ArrayList<>();
|
||||
disDtl.forEach(item -> {
|
||||
tableMater.add(JSONObject.parseObject(JSONObject.toJSONString(item), LinkedHashMap.class));
|
||||
});
|
||||
jsonMst.put("tableMater", tableMater);
|
||||
|
||||
iRawAssistIStorService.divPoint(jsonMst);
|
||||
}
|
||||
}
|
||||
@@ -14,9 +14,7 @@ import org.nl.common.utils.CodeUtil;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.wms.basedata_manage.service.IMdMeMaterialbaseService;
|
||||
import org.nl.wms.basedata_manage.service.IMdPbStoragevehicleextService;
|
||||
import org.nl.wms.basedata_manage.service.IStructattrService;
|
||||
import org.nl.wms.basedata_manage.service.dao.MdMeMaterialbase;
|
||||
import org.nl.wms.basedata_manage.service.dao.Structattr;
|
||||
import org.nl.wms.basedata_manage.service.dao.mapper.MdPbStoragevehicleextMapper;
|
||||
import org.nl.wms.sch_manage.enums.TaskStatus;
|
||||
@@ -24,7 +22,6 @@ import org.nl.wms.sch_manage.service.ISchBaseTaskService;
|
||||
import org.nl.wms.sch_manage.service.dao.SchBaseTask;
|
||||
import org.nl.wms.sch_manage.service.util.AbstractTask;
|
||||
import org.nl.wms.sch_manage.service.util.TaskFactory;
|
||||
import org.nl.wms.sch_manage.service.util.tasks.InsideMoveTask;
|
||||
import org.nl.wms.warehouse_management.enums.IOSConstant;
|
||||
import org.nl.wms.warehouse_management.enums.IOSEnum;
|
||||
import org.nl.wms.warehouse_management.service.IStIvtMoveinvService;
|
||||
@@ -37,7 +34,10 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@@ -141,9 +141,9 @@ public class StIvtMoveinvServiceImpl extends ServiceImpl<StIvtMoveinvMapper, StI
|
||||
@Override
|
||||
@Transactional
|
||||
public void delete(Set<String> ids) {
|
||||
for(String moveinv_id : ids) {
|
||||
for (String moveinv_id : ids) {
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("moveinv_id",moveinv_id);
|
||||
json.put("moveinv_id", moveinv_id);
|
||||
List<JSONObject> moveDtl = iStIvtMoveinvdtlService.getMoveDtl(json);
|
||||
|
||||
// 组织删除参数
|
||||
@@ -181,7 +181,7 @@ public class StIvtMoveinvServiceImpl extends ServiceImpl<StIvtMoveinvMapper, StI
|
||||
delete(idsList);
|
||||
} else {
|
||||
// 删除当前一条明细
|
||||
List<JSONObject> moveDtl = iStIvtMoveinvdtlService.getMoveDtl(JSONObject.parseObject(JSONObject.toJSONString(dtlDao),JSONObject.class));
|
||||
List<JSONObject> moveDtl = iStIvtMoveinvdtlService.getMoveDtl(JSONObject.parseObject(JSONObject.toJSONString(dtlDao), JSONObject.class));
|
||||
// 过滤当前明细
|
||||
List<JSONObject> paramList = moveDtl.stream()
|
||||
.filter(row -> row.getString("moveinvdtl_id").equals(dtlDao.getMoveinvdtl_id()))
|
||||
@@ -297,11 +297,8 @@ public class StIvtMoveinvServiceImpl extends ServiceImpl<StIvtMoveinvMapper, StI
|
||||
this.updateById(dao);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新主表状态
|
||||
* @param moveinv_id 移库单id
|
||||
*/
|
||||
private void updateMstStatus(String moveinv_id) {
|
||||
@Override
|
||||
public void updateMstStatus(String moveinv_id) {
|
||||
StIvtMoveinv mstDao = this.getById(moveinv_id);
|
||||
// 查询所有明细
|
||||
List<StIvtMoveinvdtl> dtlDaoList = iStIvtMoveinvdtlService.list(
|
||||
|
||||
@@ -75,6 +75,7 @@ public class StIvtMoveinvdtlServiceImpl extends ServiceImpl<StIvtMoveinvdtlMappe
|
||||
dtlDao.setWork_status(json.getString("work_status"));
|
||||
dtlDao.setStoragevehicle_code(json.getString("storagevehicle_code"));
|
||||
dtlDao.setStoragevehicle_code2(json.getString("storagevehicle_code2"));
|
||||
dtlDao.setSource_bill_code(json.getString("source_bill_code"));
|
||||
dtlDao.setRemark(json.getString("remark"));
|
||||
moveDtlList.add(dtlDao);
|
||||
// 组织要更新仓位的数据
|
||||
|
||||
218
wms/nladmin-ui/src/views/wms/st/combinedBox/AddDtl.vue
Normal file
218
wms/nladmin-ui/src/views/wms/st/combinedBox/AddDtl.vue
Normal file
@@ -0,0 +1,218 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
title="库存选择"
|
||||
append-to-body
|
||||
:visible.sync="dialogVisible"
|
||||
destroy-on-close
|
||||
width="1000px"
|
||||
@close="close"
|
||||
@open="open"
|
||||
>
|
||||
<!-- 搜索 -->
|
||||
<el-form
|
||||
:inline="true"
|
||||
class="demo-form-inline"
|
||||
label-position="right"
|
||||
label-width="80px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="库区查询">
|
||||
<el-cascader
|
||||
v-model="storId"
|
||||
placeholder="库区"
|
||||
style="width: 200px;"
|
||||
:options="sects"
|
||||
:props="{ checkStrictly: true }"
|
||||
@change="sectQueryChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="货位编码">
|
||||
<el-input
|
||||
v-model="query.struct_code"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="货位号模糊查询"
|
||||
style="width: 200px;"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="物料编码">
|
||||
<el-input
|
||||
v-model="query.material_code"
|
||||
disabled
|
||||
size="mini"
|
||||
placeholder="物料"
|
||||
style="width: 200px;"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="批次">
|
||||
<el-input
|
||||
v-model="query.pcsn"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="批次"
|
||||
style="width: 200px;"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<rrOperation />
|
||||
</el-form>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
style="width: 100%;"
|
||||
border
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
||||
@current-change="clickChange"
|
||||
>
|
||||
<el-table-column label="选择" width="55">
|
||||
<template slot-scope="scope">
|
||||
<el-radio v-model="tableRadio" :label="scope.row"><i /></el-radio>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="turnout_sect_name" label="库区名称" :min-width="flexWidth('turnout_sect_name',crud.data,'库区名称')" />
|
||||
<el-table-column prop="turnout_struct_code" label="货位编码" :min-width="flexWidth('turnout_struct_code',crud.data,'货位编码')" />
|
||||
<el-table-column prop="storagevehicle_code" label="载具编码" :min-width="flexWidth('storagevehicle_code',crud.data,'载具编码')" />
|
||||
<el-table-column prop="material_code" label="物料编码" :min-width="flexWidth('material_code',crud.data,'物料编码')" />
|
||||
<el-table-column prop="material_name" label="物料名称" :min-width="flexWidth('material_name',crud.data,'物料名称')" />
|
||||
<el-table-column prop="pcsn" label="批次" :min-width="flexWidth('pcsn',crud.data,'批次')" />
|
||||
<el-table-column prop="qty" label="数量" :formatter="crud.formatNum3" :min-width="flexWidth('qty',crud.data,'重量')" />
|
||||
<el-table-column prop="frozen_qty" label="冻结数量" :formatter="crud.formatNum3" :min-width="flexWidth('frozen_qty',crud.data,'冻结数量')" />
|
||||
<el-table-column prop="qty_unit_name" label="重量单位" :min-width="flexWidth('qty_unit_name',crud.data,'重量单位')" />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="submit">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import CRUD, { crud, header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import crudSectattr from '@/views/wms/basedata/sectattr/sectattr'
|
||||
|
||||
export default {
|
||||
name: 'AddDtl',
|
||||
components: { crudOperation, rrOperation, pagination },
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '库存物料',
|
||||
optShow: {
|
||||
add: false,
|
||||
edit: false,
|
||||
del: false,
|
||||
reset: true,
|
||||
download: false
|
||||
},
|
||||
url: '/api/combinedBox/getCanuseIvt',
|
||||
idField: 'storagevehicleext_id',
|
||||
sort: 'storagevehicleext_id,desc'
|
||||
})
|
||||
},
|
||||
mixins: [presenter(), header()],
|
||||
dicts: ['d_lock_type'],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
materCode: {
|
||||
type: String
|
||||
},
|
||||
hotNum: {
|
||||
type: String
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tableRadio: null,
|
||||
sects: [],
|
||||
storId: '1582991156504039424',
|
||||
dialogVisible: false,
|
||||
sect: {},
|
||||
rows: []
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue, oldValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
this.crud.resetQuery(false)
|
||||
crudSectattr.getSect({ 'stor_id': this.storId }).then(res => {
|
||||
this.sects = res.content
|
||||
})
|
||||
if (this.sect) {
|
||||
this.query.sect = this.sect
|
||||
if (this.sect.length === 1) {
|
||||
this.query.stor_id = this.sect[0]
|
||||
this.query.sect_id = ''
|
||||
}
|
||||
if (this.sect.length === 0) {
|
||||
this.query.sect_id = ''
|
||||
this.query.stor_id = ''
|
||||
}
|
||||
if (this.sect.length === 2) {
|
||||
this.query.stor_id = this.sect[0]
|
||||
this.query.sect_id = this.sect[1]
|
||||
}
|
||||
}
|
||||
this.query.is_used = '1'
|
||||
this.query.is_delete = '0'
|
||||
this.query.stor_id = this.storId
|
||||
this.query.material_code = this.materCode
|
||||
this.query.bake_num = this.hotNum
|
||||
this.crud.toQuery()
|
||||
},
|
||||
sectQueryChange(val) {
|
||||
if (val.length === 1) {
|
||||
this.query.stor_id = val[0]
|
||||
this.query.sect_id = ''
|
||||
}
|
||||
if (val.length === 0) {
|
||||
this.query.sect_id = ''
|
||||
this.query.stor_id = ''
|
||||
}
|
||||
if (val.length === 2) {
|
||||
this.query.stor_id = val[0]
|
||||
this.query.sect_id = val[1]
|
||||
}
|
||||
this.crud.toQuery()
|
||||
},
|
||||
close() {
|
||||
this.sects = null
|
||||
this.tableRadio = null
|
||||
this.$emit('update:dialogShow', false)
|
||||
},
|
||||
clickChange(item) {
|
||||
this.tableRadio = item
|
||||
},
|
||||
submit() {
|
||||
if (!this.tableRadio) {
|
||||
this.$message('请先勾选仓位')
|
||||
return
|
||||
}
|
||||
this.$emit('update:dialogShow', false)
|
||||
this.$emit('tableChanged', this.tableRadio)
|
||||
this.tableRadio = null
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
178
wms/nladmin-ui/src/views/wms/st/combinedBox/WeighDialog.vue
Normal file
178
wms/nladmin-ui/src/views/wms/st/combinedBox/WeighDialog.vue
Normal file
@@ -0,0 +1,178 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
title="称重信息"
|
||||
append-to-body
|
||||
:visible.sync="dialogVisible"
|
||||
:before-close="handleClose"
|
||||
width="1100px"
|
||||
destroy-on-close
|
||||
@close="close"
|
||||
>
|
||||
<el-form ref="form2" :model="formMst" :rules="rules" size="mini" label-width="130px">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="物料编码:">
|
||||
<el-input v-model="formMst.material_code" disabled size="mini" style="width: 200px" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="物料名称:">
|
||||
<el-input v-model="formMst.material_name" disabled size="mini" style="width: 200px" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="物料规格:">
|
||||
<el-input v-model="formMst.material_spec" disabled size="mini" style="width: 200px" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="物料批次:">
|
||||
<el-input v-model="formMst.pcsn" disabled size="mini" style="width: 200px" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="载具编码:">
|
||||
<el-input v-model="formMst.vehicle_code" disabled size="mini" style="width: 200px" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="烘烤次数:">
|
||||
<el-input v-model="formMst.hot_num" disabled size="mini" style="width: 200px" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="库存重量:">
|
||||
<el-input v-model="formMst.ivt_qty" disabled size="mini" style="width: 200px" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="加料重量:">
|
||||
<el-input v-model="formMst.material_qty" disabled size="mini" style="width: 200px" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="称重重量:">
|
||||
<el-input-number v-model="formMst.weight_qty" :precision="2" :controls="false" :min="0" @change="changeQty" style="width: 200px" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="18">
|
||||
<el-col :span="18" style="border: 1px solid white">
|
||||
<span />
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<span>
|
||||
<el-button icon="el-icon-check" size="mini" type="success" @click="getWeigh">称重</el-button>
|
||||
<el-button icon="el-icon-check" size="mini" type="primary" @click="saveWeigh">保存</el-button>
|
||||
<el-button icon="el-icon-close" size="mini" type="info" @click="close">关闭</el-button>
|
||||
</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="18">
|
||||
<el-col :span="18" style="border: 10px solid white">
|
||||
<span />
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import CRUD, { crud } from '@crud/crud'
|
||||
import crudCombinedBox from '@/views/wms/st/combinedBox/combinedBox'
|
||||
|
||||
export default {
|
||||
name: 'WeighDialog',
|
||||
mixins: [crud()],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
openParamWeigh: {
|
||||
type: Object
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue, oldValue) {
|
||||
this.dialogVisible = newValue
|
||||
this.formMst = this.openParamWeigh
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
formMst: {
|
||||
},
|
||||
current: null,
|
||||
dialogVisible: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleClose(done) {
|
||||
this.$confirm('确认关闭?')
|
||||
.then(_ => {
|
||||
done()
|
||||
})
|
||||
.catch(_ => {
|
||||
})
|
||||
},
|
||||
close() {
|
||||
this.formMst.weight_qty = 0
|
||||
this.formMst.material_qty = 0
|
||||
this.$refs['form2'].resetFields()
|
||||
this.$emit('update:dialogShow', false)
|
||||
},
|
||||
changeQty(val) {
|
||||
this.formMst.material_qty = parseFloat(val) - parseFloat(this.formMst.ivt_qty)
|
||||
},
|
||||
getWeigh() {
|
||||
this.formMst.weight_qty = '100'
|
||||
this.changeQty(this.formMst.weight_qty)
|
||||
/* crudCombinedBox.getWeigh(this.formMst).then(res => {
|
||||
this.formMst.weigh_qty = res.weigh_qty
|
||||
this.changeQty(res.weight_qty)
|
||||
this.crud.notify('称重成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
})*/
|
||||
},
|
||||
saveWeigh() {
|
||||
// 校验称重信息不能为0或者空
|
||||
if (this.formMst.weight_qty === 0) {
|
||||
this.crud.notify('称重重量不能为0!', CRUD.NOTIFICATION_TYPE.ERROR)
|
||||
return
|
||||
}
|
||||
crudCombinedBox.saveWeigh(this.formMst).then(res => {
|
||||
this.crud.notify('操作成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.close()
|
||||
this.crud.toQuery()
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.crud-opts2 {
|
||||
padding: 0 0;
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.crud-opts2 .crud-opts-right2 {
|
||||
margin-left: auto;
|
||||
padding: 4px 4px;
|
||||
}
|
||||
.input-with-select {
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
</style>
|
||||
59
wms/nladmin-ui/src/views/wms/st/combinedBox/combinedBox.js
Normal file
59
wms/nladmin-ui/src/views/wms/st/combinedBox/combinedBox.js
Normal file
@@ -0,0 +1,59 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: 'api/combinedBox',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/combinedBox/',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/combinedBox',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function sendMoveTask(data) {
|
||||
return request({
|
||||
url: 'api/combinedBox/sendMoveTask',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function getWeigh(data) {
|
||||
return request({
|
||||
url: 'api/combinedBox/getWeigh',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function saveWeigh(data) {
|
||||
return request({
|
||||
url: 'api/combinedBox/saveWeigh',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function confirmIn(data) {
|
||||
return request({
|
||||
url: 'api/combinedBox/confirmIn',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, sendMoveTask, getWeigh, saveWeigh, confirmIn }
|
||||
356
wms/nladmin-ui/src/views/wms/st/combinedBox/index.vue
Normal file
356
wms/nladmin-ui/src/views/wms/st/combinedBox/index.vue
Normal file
@@ -0,0 +1,356 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<el-form
|
||||
:inline="true"
|
||||
class="demo-form-inline"
|
||||
label-position="right"
|
||||
label-width="80px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="物料编码">
|
||||
<el-input
|
||||
v-model="query.material_code"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="物料编码"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="载具编码">
|
||||
<el-input
|
||||
v-model="query.vehicle_code"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="载具编码"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="焊材批次">
|
||||
<el-input
|
||||
v-model="query.pcsn"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="焊材批次"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="单据状态">
|
||||
<el-select
|
||||
v-model="query.status"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="全部"
|
||||
class="filter-item"
|
||||
@change="crud.toQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.COMBINED_BOX_STATUS"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<rrOperation />
|
||||
</el-form>
|
||||
</div>
|
||||
<rrOperation />
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission">
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="success"
|
||||
icon="el-icon-position"
|
||||
size="mini"
|
||||
:disabled="crud.selections.length !== 1"
|
||||
:loading="loadingSendTask"
|
||||
@click="sendMoveTask"
|
||||
>
|
||||
下发移出任务
|
||||
</el-button>
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="success"
|
||||
icon="el-icon-position"
|
||||
size="mini"
|
||||
:disabled="crud.selections.length !== 1"
|
||||
@click="openWeigh"
|
||||
>
|
||||
加料称重
|
||||
</el-button>
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="success"
|
||||
icon="el-icon-check"
|
||||
size="mini"
|
||||
:disabled="crud.selections.length !== 1"
|
||||
:loading="loadingSendTask"
|
||||
@click="confirmIn"
|
||||
>
|
||||
入库确认
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<el-dialog
|
||||
:close-on-click-modal="false"
|
||||
:before-close="crud.cancelCU"
|
||||
:visible.sync="crud.status.cu > 0"
|
||||
:title="crud.status.title"
|
||||
width="1100px"
|
||||
>
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="150px">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="物料编码" prop="material_code">
|
||||
<el-input v-model="form.material_code" style="width: 200px;" @change="queryMater" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="物料名称" prop="material_name">
|
||||
<el-input v-model="form.material_name" disabled style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="物料规格" prop="material_spec">
|
||||
<el-input v-model="form.material_spec" disabled style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="烘干次数" prop="hot_num">
|
||||
<el-input-number v-model="form.hot_num" :precision="0" :controls="false" :min="0" :max="3" style="width: 200px" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="载具编码" prop="vehicle_code">
|
||||
<el-input v-model="form.vehicle_code" disabled style="width: 200px;">
|
||||
<el-button slot="append" icon="el-icon-search" @click="queryIvt()" />
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="库存数量" prop="ivt_qty">
|
||||
<el-input v-model="form.ivt_qty" disabled style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="焊材批次" prop="pcsn">
|
||||
<el-input v-model="form.pcsn" disabled style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
size="mini"
|
||||
style="width: 100%;"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column prop="status" label="单据状态" :min-width="flexWidth('status',crud.data,'单据状态')" :formatter="formattStatus" />
|
||||
<el-table-column prop="material_code" label="物料编码" :min-width="flexWidth('material_code',crud.data,'物料编码')" />
|
||||
<el-table-column prop="material_name" label="物料名称" :min-width="flexWidth('material_name',crud.data,'物料名称')" />
|
||||
<el-table-column prop="hot_num" label="烘干次数" :min-width="flexWidth('hot_num',crud.data,'烘干次数')" />
|
||||
<el-table-column prop="vehicle_code" label="载具编码" :min-width="flexWidth('vehicle_code',crud.data,'载具编码')" />
|
||||
<el-table-column prop="pcsn" label="半满箱批次" :min-width="flexWidth('pcsn',crud.data,'半满箱批次')" />
|
||||
<el-table-column prop="ivt_qty" label="半满箱库存重量" :formatter="crud.formatNum3" :min-width="120" />
|
||||
<el-table-column prop="weight_qty" label="称重重量" :formatter="crud.formatNum3" :min-width="100" />
|
||||
<el-table-column prop="material_qty" label="加料重量" :formatter="crud.formatNum3" :min-width="100" />
|
||||
<el-table-column prop="create_name" label="创建人" :min-width="flexWidth('create_name',crud.data,'叫料人')" />
|
||||
<el-table-column prop="create_time" label="创建时间" :min-width="flexWidth('create_time',crud.data,'叫料时间')" />
|
||||
<el-table-column
|
||||
v-permission="['admin','Supplierbase:edit','Supplierbase:del']"
|
||||
label="操作"
|
||||
width="150px"
|
||||
lign="center"
|
||||
fixed="right"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:disabled-dle="scope.row.status !== '1'"
|
||||
:disabled-edit="scope.row.status !== '1'"
|
||||
:permission="permission"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
<AddDtl :dialog-show.sync="AddDtlShow" :mater-code="form.material_code" :hot-num="form.hot_num" @tableChanged="tableChanged" />
|
||||
<WeighDialog :dialog-show.sync="openWeighDialog" :open-param-weigh="openParamWeigh" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudCombinedBox from '@/views/wms/st/combinedBox/combinedBox'
|
||||
import AddDtl from '@/views/wms/st/combinedBox/AddDtl'
|
||||
import WeighDialog from '@/views/wms/st/combinedBox/WeighDialog'
|
||||
import CRUD, { crud, form, header, presenter } from '@crud/crud'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudGroup from '@/views/wms/basedata/group/group'
|
||||
|
||||
const defaultForm = {
|
||||
id: null,
|
||||
status: null,
|
||||
material_id: null,
|
||||
material_code: null,
|
||||
material_name: null,
|
||||
material_spec: null,
|
||||
hot_num: null,
|
||||
vehicle_code: null,
|
||||
pcsn: null,
|
||||
ivt_qty: null,
|
||||
move_id: null,
|
||||
weight_qty: null,
|
||||
material_qty: null,
|
||||
create_id: null,
|
||||
create_name: null,
|
||||
create_time: null
|
||||
}
|
||||
export default {
|
||||
name: 'CombinedBox',
|
||||
components: { pagination, crudOperation, rrOperation, udOperation, AddDtl, WeighDialog },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
// 数据字典
|
||||
dicts: ['COMBINED_BOX_STATUS'],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '合箱记录',
|
||||
url: 'api/combinedBox',
|
||||
optShow: {
|
||||
add: true,
|
||||
edit: false,
|
||||
del: false,
|
||||
download: false,
|
||||
reset: true
|
||||
},
|
||||
idField: 'id',
|
||||
sort: 'id,desc',
|
||||
crudMethod: { ...crudCombinedBox }
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
permission: {},
|
||||
AddDtlShow: false,
|
||||
openWeighDialog: false,
|
||||
loadingSendTask: false,
|
||||
openParamWeigh: null,
|
||||
rules: {
|
||||
material_code: [
|
||||
{ required: true, message: '物料编码不能为空', trigger: 'blur' }
|
||||
],
|
||||
device_code: [
|
||||
{ required: true, message: '设备编码不能为空', trigger: 'blur' }
|
||||
],
|
||||
call_qty: [
|
||||
{ required: true, message: '叫料重量不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
queryMater(value) {
|
||||
crudGroup.queryMater({ 'material_code': value }).then(row => {
|
||||
this.form.material_spec = row.material_spec
|
||||
this.form.material_name = row.material_name
|
||||
this.form.material_id = row.material_id
|
||||
}).catch(() => {
|
||||
this.form.material_spec = ''
|
||||
this.form.material_name = ''
|
||||
this.form.material_code = ''
|
||||
this.form.material_id = ''
|
||||
})
|
||||
},
|
||||
formattStatus(row) {
|
||||
return this.dict.label.COMBINED_BOX_STATUS[row.status]
|
||||
},
|
||||
queryIvt() {
|
||||
if (this.form.material_code === '' || this.form.material_code === null) {
|
||||
this.crud.notify('物料编码不能为空!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
this.AddDtlShow = true
|
||||
},
|
||||
tableChanged(row) {
|
||||
this.form.vehicle_code = row.storagevehicle_code
|
||||
this.form.pcsn = row.pcsn
|
||||
this.form.ivt_qty = row.qty
|
||||
},
|
||||
sendMoveTask() {
|
||||
const data = this.$refs.table.selection[0]
|
||||
if (data.status !== '1') {
|
||||
this.crud.notify('不为生成状态不能下发!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
|
||||
this.loadingSendTask = true
|
||||
crudCombinedBox.sendMoveTask(data).then(res => {
|
||||
this.crud.notify('操作成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
this.loadingSendTask = false
|
||||
}).catch(() => {
|
||||
this.loadingSendTask = false
|
||||
})
|
||||
},
|
||||
openWeigh() {
|
||||
if (this.$refs.table.selection[0].status !== '3') {
|
||||
this.crud.notify('当前状态不为移库完成!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
this.openParamWeigh = this.$refs.table.selection[0]
|
||||
this.openWeighDialog = true
|
||||
},
|
||||
confirmIn() {
|
||||
if (this.$refs.table.selection[0].status !== '3') {
|
||||
this.crud.notify('当前状态不为移库完成!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
this.loadingSendTask = true
|
||||
const data = this.$refs.table.selection[0]
|
||||
crudCombinedBox.confirmIn(data).then(res => {
|
||||
this.crud.notify('操作成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
this.loadingSendTask = false
|
||||
}).catch(() => {
|
||||
this.loadingSendTask = false
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -185,6 +185,7 @@
|
||||
<el-table-column prop="input_time" label="创建日期" :min-width="flexWidth('input_time',crud.data,'创建日期')" />
|
||||
<el-table-column prop="update_optname" label="修改人" :min-width="flexWidth('update_optname',crud.data,'修改人')" />
|
||||
<el-table-column prop="update_time" label="修改日期" :min-width="flexWidth('update_time',crud.data,'修改日期')" />
|
||||
<el-table-column prop="remark" label="备注" :min-width="flexWidth('remark',crud.data,'备注')" />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
|
||||
Reference in New Issue
Block a user