add:叫料管理
This commit is contained in:
@@ -131,6 +131,8 @@
|
||||
ex.material_id = #{material_id}
|
||||
AND
|
||||
st.lock_type = 0
|
||||
AND
|
||||
st.sect_code = 'HG01'
|
||||
<if test="pcsn!= null and pcsn!= ''">
|
||||
AND
|
||||
ex.pcsn = #{pcsn}
|
||||
@@ -139,20 +141,34 @@
|
||||
</select>
|
||||
|
||||
<select id="queryOutAllocation" resultType="org.nl.wms.basedata_manage.service.dto.MdPbStoragevehicleextDto">
|
||||
SELECT ex.*,st.sect_id,st.sect_code,st.sect_name,st.struct_id,st.struct_code,st.struct_name
|
||||
FROM md_pb_storagevehicleext ex LEFT JOIN st_ivt_structattr st on ex.storagevehicle_code = st.storagevehicle_code
|
||||
SELECT
|
||||
ex.*,
|
||||
st.sect_id,
|
||||
st.sect_code,
|
||||
st.sect_name,
|
||||
st.struct_id,
|
||||
st.struct_code,
|
||||
st.struct_name,
|
||||
TIMESTAMPDIFF(DAY,CURDATE(),late.quality_time) AS quality_day
|
||||
FROM
|
||||
md_pb_storagevehicleext ex
|
||||
INNER JOIN st_ivt_structattr st on ex.storagevehicle_code = st.storagevehicle_code
|
||||
INNER JOIN md_pb_groupplate late on ex.storagevehicle_code = late.storagevehicle_code
|
||||
AND ex.material_id = late.material_id AND ex.pcsn = late.pcsn AND late.status = '2'
|
||||
<where>
|
||||
material_id = #{material_id}
|
||||
ex.material_id = #{material_id}
|
||||
AND
|
||||
ex.canuse_qty > 0
|
||||
AND
|
||||
st.lock_type = 0
|
||||
AND
|
||||
st.sect_code = 'HG01'
|
||||
<if test="pcsn!= null and pcsn!= ''">
|
||||
AND
|
||||
pcsn = #{pcsn}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY ex.insert_time,ex.canuse_qty
|
||||
ORDER BY quality_day,ex.insert_time,ex.canuse_qty
|
||||
</select>
|
||||
|
||||
<select id="erpQueryIvt" resultType="com.alibaba.fastjson.JSONObject">
|
||||
|
||||
@@ -323,7 +323,7 @@ public class PdaIosInServiceImpl implements PdaIosInService {
|
||||
jsonMst.put("bill_status", IOSEnum.BILL_STATUS.code("生成"));
|
||||
jsonMst.put("total_qty", total_qty);
|
||||
jsonMst.put("detail_count", 1);
|
||||
jsonMst.put("bill_type", IOSEnum.BILL_TYPE.code("生产入库"));
|
||||
jsonMst.put("bill_type", IOSEnum.IN_BILL_TYPE.code("收货入库"));
|
||||
jsonMst.put("biz_date", DateUtil.now());
|
||||
|
||||
// 组织明细数据
|
||||
|
||||
@@ -47,4 +47,11 @@ public interface IPdmBomCallMaterialService extends IService<PdmBomCallMaterial>
|
||||
* @param ids id集合
|
||||
*/
|
||||
void delete(Set<String> ids);
|
||||
|
||||
/**
|
||||
* 根据工单编码查询
|
||||
* @param bom_code 工单编码
|
||||
* @return PdmBomCallMaterial 实体类
|
||||
*/
|
||||
PdmBomCallMaterial findByCode (String bom_code);
|
||||
}
|
||||
|
||||
@@ -34,6 +34,11 @@ public class PdmBomCallMaterial implements Serializable {
|
||||
*/
|
||||
private String material_id;
|
||||
|
||||
/**
|
||||
* 叫料单号
|
||||
*/
|
||||
private String bom_code;
|
||||
|
||||
/**
|
||||
* 设备编码
|
||||
*/
|
||||
@@ -45,15 +50,30 @@ public class PdmBomCallMaterial implements Serializable {
|
||||
private BigDecimal call_qty;
|
||||
|
||||
/**
|
||||
* 实际重量
|
||||
* 实际出库重量
|
||||
*/
|
||||
private BigDecimal real_qty;
|
||||
|
||||
/**
|
||||
* 实际用料总量
|
||||
*/
|
||||
private BigDecimal real_weigh_qty;
|
||||
|
||||
/**
|
||||
* 工单状态
|
||||
*/
|
||||
private String bom_status;
|
||||
|
||||
/**
|
||||
* 单位标识
|
||||
*/
|
||||
private String qty_unit_id;
|
||||
|
||||
/**
|
||||
* 单位名称
|
||||
*/
|
||||
private String qty_unit_name;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
|
||||
@@ -24,6 +24,11 @@
|
||||
bom.device_code LIKE #{param.device_code}
|
||||
</if>
|
||||
|
||||
<if test="param.bom_code != null and param.bom_code != ''">
|
||||
AND
|
||||
bom.bom_code LIKE #{param.bom_code}
|
||||
</if>
|
||||
|
||||
<if test="param.bom_status != null and param.bom_status != ''">
|
||||
AND
|
||||
bom.bom_status = #{param.bom_status}
|
||||
|
||||
@@ -1,17 +1,22 @@
|
||||
package org.nl.wms.pdm_manage.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
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.utils.CodeUtil;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.wms.basedata_manage.service.IMdPbMeasureunitService;
|
||||
import org.nl.wms.basedata_manage.service.dao.MdPbMeasureunit;
|
||||
import org.nl.wms.pdm_manage.enums.BomEnum;
|
||||
import org.nl.wms.pdm_manage.service.IPdmBomCallMaterialService;
|
||||
import org.nl.wms.pdm_manage.service.dao.PdmBomCallMaterial;
|
||||
import org.nl.wms.pdm_manage.service.dao.mapper.PdmBomCallMaterialMapper;
|
||||
import org.nl.wms.pdm_manage.service.dto.PdmBomCallMaterialDto;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@@ -29,6 +34,12 @@ import java.util.Set;
|
||||
@Service
|
||||
public class PdmBomCallMaterialServiceImpl extends ServiceImpl<PdmBomCallMaterialMapper, PdmBomCallMaterial> implements IPdmBomCallMaterialService {
|
||||
|
||||
/**
|
||||
* 计量单位服务
|
||||
*/
|
||||
@Autowired
|
||||
private IMdPbMeasureunitService iMdPbMeasureunitService;
|
||||
|
||||
@Override
|
||||
public IPage<PdmBomCallMaterialDto> queryAll(Map whereJson, PageQuery page) {
|
||||
return this.baseMapper.queryAllByPage(new Page<>(page.getPage() + 1, page.getSize()),
|
||||
@@ -40,6 +51,11 @@ public class PdmBomCallMaterialServiceImpl extends ServiceImpl<PdmBomCallMateria
|
||||
public void create(PdmBomCallMaterial dto) {
|
||||
dto.setBom_id(IdUtil.getStringId());
|
||||
dto.setBom_status(BomEnum.CALL_BOM_STATUS.code("生成"));
|
||||
dto.setBom_code(CodeUtil.getNewCode("BOM_CODE"));
|
||||
// 计量单位默认重量KG
|
||||
MdPbMeasureunit unitDao = iMdPbMeasureunitService.getByCode("KG");
|
||||
dto.setQty_unit_id(unitDao.getMeasure_unit_id());
|
||||
dto.setQty_unit_name(unitDao.getUnit_name());
|
||||
dto.setCreate_id(SecurityUtils.getCurrentUserId());
|
||||
dto.setCreate_name(SecurityUtils.getCurrentNickName());
|
||||
dto.setCreate_time(DateUtil.now());
|
||||
@@ -57,4 +73,12 @@ public class PdmBomCallMaterialServiceImpl extends ServiceImpl<PdmBomCallMateria
|
||||
public void delete(Set<String> ids) {
|
||||
this.baseMapper.deleteBatchIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PdmBomCallMaterial findByCode(String bom_code) {
|
||||
return this.baseMapper.selectOne(
|
||||
new QueryWrapper<PdmBomCallMaterial>().lambda()
|
||||
.eq(PdmBomCallMaterial::getBom_code, bom_code)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,9 +27,12 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* @Author: Liuxy
|
||||
* @Description: 退货入库任务类
|
||||
* @Date: 2025/8/12
|
||||
* <p>
|
||||
* 收货入库任务类
|
||||
* </p>
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2025-08-15
|
||||
*/
|
||||
@Component(value = "DetainInTask")
|
||||
@TaskType("DetainInTask")
|
||||
|
||||
@@ -4,12 +4,16 @@ 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.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;
|
||||
@@ -25,35 +29,57 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* @Author: Liuxy
|
||||
* @Description: 入库任务类
|
||||
* @Date: 2025/5/25
|
||||
* <p>
|
||||
* 领料出库任务类
|
||||
* </p>
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2025-08-15
|
||||
*/
|
||||
@Component(value = "STOutTask")
|
||||
@TaskType("STOutTask")
|
||||
public class StOutTask extends AbstractTask {
|
||||
@Component(value = "ReceiveOutTask")
|
||||
@TaskType("ReceiveOutTask")
|
||||
public class ReceiveOutTask extends AbstractTask {
|
||||
|
||||
/**
|
||||
* 任务服务
|
||||
*/
|
||||
@Autowired
|
||||
private ISchBaseTaskService taskService;
|
||||
|
||||
/**
|
||||
* 出库服务
|
||||
*/
|
||||
@Resource
|
||||
private IOutBillService outBillService;
|
||||
|
||||
/**
|
||||
* 分配明细mapper
|
||||
*/
|
||||
@Resource
|
||||
private IOStorInvDisMapper ioStorInvDisMapper;
|
||||
|
||||
/**
|
||||
* 点位服务
|
||||
*/
|
||||
@Resource
|
||||
private ISchBasePointService iSchBasePointService;
|
||||
|
||||
@Override
|
||||
public String create(JSONObject json) {
|
||||
SchBaseTask task = new SchBaseTask();
|
||||
task.setTask_id(IdUtil.getStringId());
|
||||
task.setTask_code(json.getString("TaskCode"));
|
||||
task.setTask_status(TaskStatus.CREATE.getCode());
|
||||
task.setConfig_code(json.getString("task_type"));
|
||||
task.setPoint_code1(json.getString("PickingLocation"));
|
||||
task.setPoint_code2(json.getString("PlacedLocation"));
|
||||
task.setConfig_code(ReceiveOutTask.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.setPriority(json.getString("Priority"));
|
||||
task.setTask_type(TaskEnum.TASK_TYPE.code("料箱"));
|
||||
task.setCreate_id(SecurityUtils.getCurrentUserId());
|
||||
task.setCreate_name(SecurityUtils.getCurrentNickName());
|
||||
task.setCreate_time(DateUtil.now());
|
||||
@@ -98,10 +124,10 @@ public class StOutTask extends AbstractTask {
|
||||
taskService.updateById(taskObj);
|
||||
}
|
||||
if (status.equals(TaskStatus.FINISHED)) {
|
||||
this.finishTask(taskObj);
|
||||
this.finishTask(taskObj);
|
||||
}
|
||||
if (status.equals(TaskStatus.CANCELED)) {
|
||||
this.cancelTask(taskObj);
|
||||
this.cancelTask(taskObj);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -111,7 +137,7 @@ public class StOutTask extends AbstractTask {
|
||||
if (ObjectUtil.isEmpty(taskObj)) {
|
||||
throw new BadRequestException("该任务不存在");
|
||||
}
|
||||
this.finishTask(taskObj);
|
||||
this.finishTask(taskObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -132,6 +158,13 @@ public class StOutTask extends AbstractTask {
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void finishTask(SchBaseTask taskObj) {
|
||||
// 更新终点
|
||||
iSchBasePointService.update(
|
||||
new UpdateWrapper<SchBasePoint>().lambda()
|
||||
.eq(SchBasePoint::getPoint_code, taskObj.getPoint_code2())
|
||||
.set(SchBasePoint::getVehicle_code, taskObj.getVehicle_code())
|
||||
.set(SchBasePoint::getPoint_status, IOSEnum.POINT_STATUS.code("有箱有料"))
|
||||
);
|
||||
// 任务完成
|
||||
taskObj.setTask_status(TaskStatus.FINISHED.getCode());
|
||||
taskObj.setRemark("已完成");
|
||||
@@ -146,17 +179,17 @@ public class StOutTask extends AbstractTask {
|
||||
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())
|
||||
.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)
|
||||
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())
|
||||
.eq(IOStorInvDis::getTask_id, taskObj.getTask_id())
|
||||
);
|
||||
|
||||
// 更新任务状态
|
||||
@@ -17,6 +17,11 @@ public class IOSConstant {
|
||||
*/
|
||||
public final static String IS_DELETE_YES = "1";
|
||||
|
||||
/**
|
||||
* 数字2
|
||||
*/
|
||||
public final static String TWO = "2";
|
||||
|
||||
/**
|
||||
* 出入库 入库
|
||||
*/
|
||||
@@ -85,4 +90,9 @@ public class IOSConstant {
|
||||
* 称重位
|
||||
*/
|
||||
public final static String CZW_POINT = "CZW01";
|
||||
|
||||
/**
|
||||
* 物料id:焊丝(盘状)
|
||||
*/
|
||||
public final static String MATERIAL_HS_PZ = "1945687018646409216";
|
||||
}
|
||||
|
||||
@@ -28,13 +28,25 @@ public enum IOSEnum {
|
||||
BILL_STATUS(MapOf.of("生成","10", "分配中", "20", "分配完", "30", "完成", "99")),
|
||||
|
||||
// 入库业务类型
|
||||
BILL_TYPE(MapOf.of("生产入库","0001", "手工入库", "0009")),
|
||||
IN_BILL_TYPE(MapOf.of("收货入库","0001", "退料入库","0002" , "合箱入库","0003"
|
||||
,"拼箱入库", "0004" ,"手工入库", "0009"
|
||||
)),
|
||||
|
||||
// 入库业务类型
|
||||
OUT_BILL_TYPE(MapOf.of("领料出库","1001", "质检出库","1002" , "退货出库","1003"
|
||||
,"烘干出库", "1004" ,"手工出库", "1009"
|
||||
)),
|
||||
|
||||
// 入库任务配置类编码
|
||||
IN_CONFIG_CODE(MapOf.of("0001","DetainInTask", "0002", "BackInTask",
|
||||
"0003", "GeBoxInTask", "0004", "PieceBoxInTask", "0009", "HandInTask"
|
||||
)),
|
||||
|
||||
// 出库任务配置类编码
|
||||
OUT_CONFIG_CODE(MapOf.of("1001","ReceiveOutTask", "1002", "QualityOutTask",
|
||||
"1003", "BackOutTask", "1004", "HotOutTask", "1009", "HandOutTask"
|
||||
)),
|
||||
|
||||
//入库分配明细状态
|
||||
INBILL_DIS_STATUS(MapOf.of("未生成", "00", "生成", "01", "执行中", "02", "完成", "99")),
|
||||
|
||||
|
||||
@@ -101,4 +101,9 @@ public class IOStorInvDtl implements Serializable {
|
||||
* 未分配数量
|
||||
*/
|
||||
private BigDecimal unassign_qty;
|
||||
|
||||
/**
|
||||
* 是否拣选:0-否 1-是
|
||||
*/
|
||||
private String is_check;
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user