add:库内移库,库存状态变更
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package org.nl.wms.basedata_manage.controller;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.base.TableDataInfo;
|
||||
@@ -9,10 +10,7 @@ import org.nl.common.logging.annotation.Log;
|
||||
import org.nl.wms.basedata_manage.service.IMdPbStoragevehicleextService;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Map;
|
||||
@@ -40,4 +38,11 @@ public class StructIvtController {
|
||||
public ResponseEntity<Object> query(@RequestParam Map whereJson, PageQuery page) {
|
||||
return new ResponseEntity<>(TableDataInfo.build(iMdPbStoragevehicleextService.queryAll(whereJson, page)), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/statusChange")
|
||||
@Log("状态变更")
|
||||
public ResponseEntity<Object> statusChange(@RequestBody JSONObject whereJson) {
|
||||
iMdPbStoragevehicleextService.statusChange(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,6 +41,12 @@ public class StructattrController {
|
||||
return new ResponseEntity<>(TableDataInfo.build(structattrService.queryAll(whereJson, page)), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/getMoveStruct")
|
||||
@Log("查询移入仓位")
|
||||
public ResponseEntity<Object> getMoveStruct(@RequestParam Map whereJson, PageQuery page) {
|
||||
return new ResponseEntity<>(TableDataInfo.build(structattrService.getMoveStruct(whereJson, page)), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Log("新增仓位")
|
||||
public ResponseEntity<Object> create(@Validated @RequestBody Structattr dto) {
|
||||
|
||||
@@ -41,4 +41,10 @@ public interface IMdPbStoragevehicleextService extends IService<MdPbStoragevehic
|
||||
* }
|
||||
*/
|
||||
void updateIvt(List<JSONObject> updateIvtList);
|
||||
|
||||
/**
|
||||
* 品质类型变更
|
||||
* @param whereJson 库存记录
|
||||
*/
|
||||
void statusChange(JSONObject whereJson);
|
||||
}
|
||||
|
||||
@@ -29,6 +29,15 @@ public interface IStructattrService extends IService<Structattr> {
|
||||
*/
|
||||
IPage<Structattr> queryAll(Map whereJson, PageQuery page);
|
||||
|
||||
/**
|
||||
* 查询数据分页
|
||||
*
|
||||
* @param whereJson 条件
|
||||
* @param page 分页参数
|
||||
* @return Map<String, Object>
|
||||
*/
|
||||
IPage<Structattr> getMoveStruct(Map whereJson, PageQuery page);
|
||||
|
||||
/**
|
||||
* 根据ID查询
|
||||
*
|
||||
@@ -101,4 +110,5 @@ public interface IStructattrService extends IService<Structattr> {
|
||||
* @return Structattr
|
||||
*/
|
||||
Structattr getByCode(String struct_code);
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.nl.wms.basedata_manage.service.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
@@ -89,5 +90,11 @@ public class MdPbStoragevehicleext implements Serializable {
|
||||
*/
|
||||
private String insert_time;
|
||||
|
||||
/**
|
||||
* 仓位编码
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String struct_code;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -30,6 +30,14 @@ public interface MdPbStoragevehicleextMapper extends BaseMapper<MdPbStoragevehic
|
||||
*/
|
||||
IPage<JSONObject> getCanuseIvt(Page<JSONObject> page, @Param("param") Map whereJson);
|
||||
|
||||
/**
|
||||
* 获取可用库存托盘
|
||||
* @param page 分页条件
|
||||
* @param whereJson 查询条件
|
||||
* @return IPage<JSONObject>
|
||||
*/
|
||||
IPage<JSONObject> getCanuseVheicle(Page<JSONObject> page, @Param("param") Map whereJson);
|
||||
|
||||
/**
|
||||
* 根据批次和物料查看可用库存总和
|
||||
* @param pcsn
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
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
|
||||
@@ -56,6 +57,58 @@
|
||||
ORDER BY ext.insert_time Desc
|
||||
</select>
|
||||
|
||||
<select id="getCanuseVheicle" resultType="com.alibaba.fastjson.JSONObject">
|
||||
SELECT
|
||||
ext.storagevehicleext_id,
|
||||
ext.material_id,
|
||||
material.material_code,
|
||||
material.material_name,
|
||||
material.material_spec,
|
||||
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.storagevehicle_code,
|
||||
attr.is_emptyvehicle,
|
||||
attr.struct_code AS turnout_struct_code
|
||||
FROM
|
||||
st_ivt_structattr attr
|
||||
LEFT JOIN md_pb_storagevehicleext ext ON ext.storagevehicle_code = attr.storagevehicle_code
|
||||
LEFT JOIN md_me_materialbase material ON material.material_id = ext.material_id
|
||||
<where>
|
||||
attr.lock_type = '0'
|
||||
AND attr.is_used = "1"
|
||||
AND IFNULL(attr.storagevehicle_code,'') != ''
|
||||
<if test="param.stor_id != null and param.stor_id != ''">
|
||||
AND
|
||||
attr.stor_id LIKE #{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.storagevehicle_code != null and param.storagevehicle_code != ''">
|
||||
AND
|
||||
attr.storagevehicle_code LIKE #{param.storagevehicle_code}
|
||||
</if>
|
||||
|
||||
<if test="param.struct_code != null and param.struct_code != ''">
|
||||
AND
|
||||
attr.struct_code LIKE #{param.struct_code}
|
||||
</if>
|
||||
|
||||
</where>
|
||||
ORDER BY attr.struct_code
|
||||
</select>
|
||||
|
||||
<select id="queryAllByPage" resultType="com.alibaba.fastjson.JSONObject">
|
||||
SELECT
|
||||
ext.storagevehicleext_id,
|
||||
@@ -70,25 +123,28 @@
|
||||
attr.struct_name,
|
||||
attr.stor_name,
|
||||
attr.sect_name,
|
||||
mater.material_id,
|
||||
mater.material_code,
|
||||
mater.material_name,
|
||||
mater.material_spec
|
||||
mater.material_spec,
|
||||
late.quality_time,
|
||||
late.produce_time,
|
||||
late.quality_type,
|
||||
late.quality_type AS old_quality_type,
|
||||
late.bake_num,
|
||||
false AS edit,
|
||||
(
|
||||
CASE late.quality_type
|
||||
WHEN '1' THEN '待检'
|
||||
WHEN '2' THEN '合格'
|
||||
WHEN '3' THEN '不合格'
|
||||
END
|
||||
) AS quality_name
|
||||
FROM
|
||||
md_pb_storagevehicleext ext
|
||||
INNER JOIN st_ivt_structattr attr ON ext.storagevehicle_code = attr.storagevehicle_code
|
||||
INNER JOIN md_me_materialbase mater ON mater.material_id = ext.material_id
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
material_id,
|
||||
storagevehicle_code,
|
||||
pcsn
|
||||
FROM
|
||||
md_pb_groupplate
|
||||
WHERE
|
||||
status = '2'
|
||||
GROUP BY
|
||||
material_id,storagevehicle_code,pcsn
|
||||
) late ON late.material_id = ext.material_id and late.pcsn = ext.pcsn and late.storagevehicle_code = ext.storagevehicle_code
|
||||
LEFT JOIN md_pb_groupplate late ON late.material_id = ext.material_id and late.pcsn = ext.pcsn and late.storagevehicle_code = ext.storagevehicle_code
|
||||
<where>
|
||||
1 = 1
|
||||
<if test="param.stor_id != null and param.stor_id != ''">
|
||||
|
||||
@@ -1,17 +1,36 @@
|
||||
package org.nl.wms.basedata_manage.service.impl;
|
||||
|
||||
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 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.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.MdPbStoragevehicleext;
|
||||
import org.nl.wms.basedata_manage.service.dao.Structattr;
|
||||
import org.nl.wms.basedata_manage.service.dao.mapper.MdPbStoragevehicleextMapper;
|
||||
import org.nl.wms.warehouse_management.enums.IOSConstant;
|
||||
import org.nl.wms.warehouse_management.enums.IOSEnum;
|
||||
import org.nl.wms.warehouse_management.service.IMdPbGroupplateService;
|
||||
import org.nl.wms.warehouse_management.service.IStIvtMoveinvService;
|
||||
import org.nl.wms.warehouse_management.service.dao.GroupPlate;
|
||||
import org.nl.wms.warehouse_management.service.dao.StIvtMoveinv;
|
||||
import org.nl.wms.warehouse_management.service.dto.MoveInsertDto;
|
||||
import org.nl.wms.warehouse_management.service.util.UpdateIvtUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -32,6 +51,30 @@ public class MdPbStoragevehicleextServiceImpl extends ServiceImpl<MdPbStorageveh
|
||||
@Autowired
|
||||
private UpdateIvtUtils updateIvtUtils;
|
||||
|
||||
/**
|
||||
* 仓位服务
|
||||
*/
|
||||
@Autowired
|
||||
private IStructattrService iStructattrService;
|
||||
|
||||
/**
|
||||
* 物料服务
|
||||
*/
|
||||
@Autowired
|
||||
private IMdMeMaterialbaseService iMdMeMaterialbaseService;
|
||||
|
||||
/**
|
||||
* 移库单服务
|
||||
*/
|
||||
@Autowired
|
||||
private IStIvtMoveinvService iStIvtMoveinvService;
|
||||
|
||||
/**
|
||||
* 组盘记录服务
|
||||
*/
|
||||
@Autowired
|
||||
private IMdPbGroupplateService iMdPbGroupplateService;
|
||||
|
||||
@Override
|
||||
public IPage<JSONObject> queryAll(Map whereJson, PageQuery page) {
|
||||
return this.baseMapper.queryAllByPage(new Page<>(page.getPage() + 1, page.getSize()),
|
||||
@@ -44,4 +87,162 @@ public class MdPbStoragevehicleextServiceImpl extends ServiceImpl<MdPbStorageveh
|
||||
updateIvtUtils.updateIvt(json);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void statusChange(JSONObject whereJson) {
|
||||
// 查询载具扩展属性
|
||||
MdPbStoragevehicleext extDao = this.getOne(
|
||||
new QueryWrapper<MdPbStoragevehicleext>().lambda()
|
||||
.eq(MdPbStoragevehicleext::getStoragevehicle_code, whereJson.getString("storagevehicle_code"))
|
||||
.eq(MdPbStoragevehicleext::getMaterial_id, whereJson.getString("material_id"))
|
||||
.eq(MdPbStoragevehicleext::getPcsn, whereJson.getString("pcsn"))
|
||||
);
|
||||
if (ObjectUtil.isEmpty(extDao)) {
|
||||
throw new BadRequestException("当前库存数据不存在,请检查数据!");
|
||||
}
|
||||
|
||||
// 校验仓位是否锁定
|
||||
Structattr attrDao = iStructattrService.getOne(
|
||||
new QueryWrapper<Structattr>().lambda()
|
||||
.eq(Structattr::getStoragevehicle_code, whereJson.getString("storagevehicle_code"))
|
||||
);
|
||||
if (ObjectUtil.isEmpty(attrDao)) {
|
||||
throw new BadRequestException("未找到对应仓位!");
|
||||
}
|
||||
if (!attrDao.getLock_type().equals(IOSEnum.LOCK_TYPE.code("未锁定"))) {
|
||||
throw new BadRequestException("当前仓位【" + attrDao.getStruct_code() + "】有其他任务正在进行中,请稍后在试!");
|
||||
}
|
||||
|
||||
// 判断库区
|
||||
String sectc_code = "";
|
||||
|
||||
String quality_type = whereJson.getString("quality_type");
|
||||
switch (quality_type) {
|
||||
case IOSConstant.ONE:
|
||||
sectc_code = IOSEnum.SECT_CODE.code("待检区");
|
||||
break;
|
||||
case IOSConstant.TWO:
|
||||
sectc_code = IOSEnum.SECT_CODE.code("合格区");
|
||||
break;
|
||||
case IOSConstant.THREE:
|
||||
sectc_code = IOSEnum.SECT_CODE.code("不合格区");
|
||||
break;
|
||||
}
|
||||
|
||||
// 分配相同库区且有空托盘的仓位
|
||||
JSONObject jsonParam = new JSONObject();
|
||||
jsonParam.put("stor_id", attrDao.getStor_id());
|
||||
jsonParam.put("sectc_code", sectc_code);
|
||||
Structattr newAttr = divStruct(jsonParam);
|
||||
|
||||
// 创建移库单据并下发任务
|
||||
extDao.setStruct_code(attrDao.getStruct_code());
|
||||
createMove(extDao, newAttr);
|
||||
|
||||
// 更新组盘记录品质类型
|
||||
iMdPbGroupplateService.update(
|
||||
new UpdateWrapper<GroupPlate>().lambda()
|
||||
.set(GroupPlate::getQuality_type, quality_type)
|
||||
.eq(GroupPlate::getMaterial_id, extDao.getMaterial_id())
|
||||
.eq(GroupPlate::getStoragevehicle_code, extDao.getStoragevehicle_code())
|
||||
.eq(GroupPlate::getPcsn, extDao.getPcsn())
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分配仓位:空托盘优先
|
||||
*
|
||||
* @param jsonParam {
|
||||
* stor_id: 仓库id
|
||||
* sectc_code: 库区 编码
|
||||
* }
|
||||
* @return Structattr
|
||||
*/
|
||||
private Structattr divStruct(JSONObject jsonParam) {
|
||||
|
||||
Structattr structattr = new Structattr();
|
||||
|
||||
List<Structattr> vehicleAttrList = iStructattrService.list(
|
||||
new QueryWrapper<Structattr>().lambda()
|
||||
.eq(Structattr::getStor_id, jsonParam.getString("stor_id"))
|
||||
.eq(Structattr::getSect_code, jsonParam.getString("sectc_code"))
|
||||
.eq(Structattr::getIs_delete, IOSConstant.IS_DELETE_NO)
|
||||
.eq(Structattr::getIs_used, IOSConstant.ONE)
|
||||
.eq(Structattr::getLock_type, IOSEnum.LOCK_TYPE.code("未锁定"))
|
||||
.eq(Structattr::getIs_emptyvehicle, IOSConstant.ONE)
|
||||
.and(wrapper -> wrapper.isNotNull(Structattr::getStoragevehicle_code).or().ne(Structattr::getStoragevehicle_code, ""))
|
||||
.orderByAsc(Structattr::getStruct_code)
|
||||
);
|
||||
if (ObjectUtil.isNotEmpty(vehicleAttrList)) {
|
||||
structattr = vehicleAttrList.get(0);
|
||||
} else {
|
||||
List<Structattr> attrList = iStructattrService.list(
|
||||
new QueryWrapper<Structattr>().lambda()
|
||||
.eq(Structattr::getStor_id, jsonParam.getString("stor_id"))
|
||||
.eq(Structattr::getSect_code, jsonParam.getString("sectc_code"))
|
||||
.eq(Structattr::getIs_delete, IOSConstant.IS_DELETE_NO)
|
||||
.eq(Structattr::getIs_used, IOSConstant.ONE)
|
||||
.eq(Structattr::getLock_type, IOSEnum.LOCK_TYPE.code("未锁定"))
|
||||
.ne(Structattr::getIs_emptyvehicle, IOSConstant.ONE)
|
||||
.and(wrapper -> wrapper.isNull(Structattr::getStoragevehicle_code).or().eq(Structattr::getStoragevehicle_code, ""))
|
||||
.orderByAsc(Structattr::getStruct_code)
|
||||
);
|
||||
if (ObjectUtil.isNotEmpty(attrList)) {
|
||||
structattr = attrList.get(0);
|
||||
}
|
||||
}
|
||||
|
||||
if (ObjectUtil.isEmpty(structattr)) {
|
||||
throw new BadRequestException("当前库区【" + jsonParam.getString("sectc_code") + "】没有可用仓位");
|
||||
}
|
||||
return structattr;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建移库单据
|
||||
*
|
||||
* @param extDao 载具扩展属性实体类
|
||||
* @param newAttr 仓位实体类
|
||||
*/
|
||||
private void createMove(MdPbStoragevehicleext extDao, Structattr newAttr) {
|
||||
// 查询移出货位
|
||||
Structattr oldAttr = iStructattrService.getByCode(extDao.getStruct_code());
|
||||
// 组织主表
|
||||
MoveInsertDto moveInsertDto = new MoveInsertDto();
|
||||
moveInsertDto.setBill_type(IOSEnum.MOVE_BILL_TYPE.code("库内移库"));
|
||||
moveInsertDto.setBiz_date(DateUtil.today());
|
||||
moveInsertDto.setStor_id(newAttr.getStor_id());
|
||||
moveInsertDto.setTotal_qty(extDao.getCanuse_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", oldAttr.getSect_code());
|
||||
jsonDtl.put("turnout_struct_code", oldAttr.getStruct_code());
|
||||
MdMeMaterialbase materDao = iMdMeMaterialbaseService.getById(extDao.getMaterial_id());
|
||||
jsonDtl.put("material_code", materDao.getMaterial_code());
|
||||
jsonDtl.put("material_id", materDao.getMaterial_id());
|
||||
jsonDtl.put("pcsn", extDao.getPcsn());
|
||||
jsonDtl.put("qty_unit_id", extDao.getQty_unit_id());
|
||||
jsonDtl.put("qty_unit_name", extDao.getQty_unit_name());
|
||||
jsonDtl.put("qty", extDao.getCanuse_qty());
|
||||
jsonDtl.put("turnin_sect_code", newAttr.getSect_code());
|
||||
jsonDtl.put("turnin_struct_code", newAttr.getStruct_code());
|
||||
jsonDtl.put("work_status", IOSEnum.MOVE_DTL_STATUS.code("生成"));
|
||||
jsonDtl.put("storagevehicle_code", oldAttr.getStoragevehicle_code());
|
||||
jsonDtl.put("storagevehicle_code2", newAttr.getStoragevehicle_code());
|
||||
dtlList.add(jsonDtl);
|
||||
moveInsertDto.setTableData(dtlList);
|
||||
|
||||
// 调用移库单新增
|
||||
String move_id = iStIvtMoveinvService.create(moveInsertDto);
|
||||
// 下发任务
|
||||
StIvtMoveinv moveDao = new StIvtMoveinv();
|
||||
moveDao.setMoveinv_id(move_id);
|
||||
iStIvtMoveinvService.sendTask(moveDao);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,6 +67,7 @@ public class StructattrServiceImpl extends ServiceImpl<StructattrMapper, Structa
|
||||
String layer_num = (String) whereJson.get("layer_num");
|
||||
String is_used = (String) whereJson.get("is_used");
|
||||
String is_have = (String) whereJson.get("is_have");
|
||||
String not_point = (String) whereJson.get("not_point");
|
||||
String storagevehicle_type = (String) whereJson.get("storagevehicle_type");
|
||||
|
||||
return structattrMapper.selectPage(new Page<>(page.getPage() + 1 ,page.getSize()), new LambdaQueryWrapper<Structattr>()
|
||||
@@ -74,6 +75,7 @@ public class StructattrServiceImpl extends ServiceImpl<StructattrMapper, Structa
|
||||
.eq(StrUtil.isNotEmpty(sect_id),Structattr::getSect_id, sect_id)
|
||||
.eq(StrUtil.isNotEmpty(lock_type),Structattr::getLock_type, lock_type)
|
||||
.eq(StrUtil.isNotEmpty(layer_num),Structattr::getLayer_num, layer_num)
|
||||
.ne(StrUtil.isNotEmpty(not_point),Structattr::getStruct_id, not_point)
|
||||
.eq(StrUtil.isNotEmpty(storagevehicle_type),Structattr::getStoragevehicle_type, storagevehicle_type)
|
||||
.eq(StrUtil.isNotEmpty(is_used),Structattr::getIs_used, is_used)
|
||||
.eq(Structattr::getIs_delete, BaseDataEnum.IS_YES_NOT.code("否"))
|
||||
@@ -85,6 +87,32 @@ public class StructattrServiceImpl extends ServiceImpl<StructattrMapper, Structa
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<Structattr> getMoveStruct(Map whereJson, PageQuery page) {
|
||||
|
||||
String search = (String) whereJson.get("search");
|
||||
String stor_id = (String) whereJson.get("stor_id");
|
||||
String sect_id = (String) whereJson.get("sect_id");
|
||||
String lock_type = (String) whereJson.get("lock_type");
|
||||
String layer_num = (String) whereJson.get("layer_num");
|
||||
String is_used = (String) whereJson.get("is_used");
|
||||
String not_point = (String) whereJson.get("not_point");
|
||||
String storagevehicle_type = (String) whereJson.get("storagevehicle_type");
|
||||
|
||||
return structattrMapper.selectPage(new Page<>(page.getPage() + 1 ,page.getSize()), new LambdaQueryWrapper<Structattr>()
|
||||
.eq(StrUtil.isNotEmpty(stor_id),Structattr::getStor_id, stor_id)
|
||||
.eq(StrUtil.isNotEmpty(sect_id),Structattr::getSect_id, sect_id)
|
||||
.eq(StrUtil.isNotEmpty(lock_type),Structattr::getLock_type, lock_type)
|
||||
.eq(StrUtil.isNotEmpty(layer_num),Structattr::getLayer_num, layer_num)
|
||||
.ne(StrUtil.isNotEmpty(not_point),Structattr::getStruct_id, not_point)
|
||||
.eq(StrUtil.isNotEmpty(storagevehicle_type),Structattr::getStoragevehicle_type, storagevehicle_type)
|
||||
.eq(StrUtil.isNotEmpty(is_used),Structattr::getIs_used, is_used)
|
||||
.eq(Structattr::getIs_delete, BaseDataEnum.IS_YES_NOT.code("否"))
|
||||
.like(StrUtil.isNotEmpty(search),Structattr::getStruct_code, search)
|
||||
.orderByAsc(Structattr::getStoragevehicle_code)
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Structattr findById(String struct_id) {
|
||||
return structattrMapper.selectById(struct_id);
|
||||
|
||||
@@ -3,52 +3,48 @@ 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.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
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.IStructattrService;
|
||||
import org.nl.wms.basedata_manage.service.dao.Structattr;
|
||||
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.dao.IOStorInvDis;
|
||||
import org.nl.wms.warehouse_management.service.dao.mapper.IOStorInvDisMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* @Author: Liuxy
|
||||
* @Description: 余料回库类
|
||||
* @Date: 2025/6/6
|
||||
* <p>
|
||||
* 退料入库任务类
|
||||
* </p>
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2025-08-20
|
||||
*/
|
||||
@Component(value = "BackInTask")
|
||||
@TaskType("BackInTask")
|
||||
public class BackInTask extends AbstractTask {
|
||||
|
||||
/**
|
||||
* 任务服务类
|
||||
*/
|
||||
@Autowired
|
||||
private ISchBaseTaskService taskService;
|
||||
|
||||
/**
|
||||
* 点位服务
|
||||
*/
|
||||
@Autowired
|
||||
private ISchBasePointService iSchBasePointService;
|
||||
@Resource
|
||||
private IRawAssistIStorService rawAssistIStorService;
|
||||
|
||||
/**
|
||||
* 仓位服务
|
||||
*/
|
||||
@Autowired
|
||||
private IStructattrService iStructattrService;
|
||||
@Resource
|
||||
private IOStorInvDisMapper ioStorInvDisMapper;
|
||||
|
||||
@Override
|
||||
public String create(JSONObject json) {
|
||||
@@ -56,11 +52,15 @@ public class BackInTask extends AbstractTask {
|
||||
task.setTask_id(IdUtil.getStringId());
|
||||
task.setTask_code(CodeUtil.getNewCode("TASK_CODE"));
|
||||
task.setTask_status(TaskStatus.CREATE.getCode());
|
||||
task.setConfig_code(json.getString("config_code"));
|
||||
task.setConfig_code(BackInTask.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());
|
||||
@@ -85,6 +85,7 @@ public class BackInTask extends AbstractTask {
|
||||
acsTaskDto.setPriority(taskDao.getPriority());
|
||||
acsTaskDto.setVehicle_code(taskDao.getVehicle_code());
|
||||
acsTaskDto.setTask_type("1");
|
||||
|
||||
return acsTaskDto;
|
||||
}
|
||||
|
||||
@@ -100,7 +101,6 @@ public class BackInTask extends AbstractTask {
|
||||
}
|
||||
// 根据传来的类型去对任务进行操作
|
||||
if (status.equals(TaskStatus.EXECUTING)) {
|
||||
// 更新明细状态
|
||||
taskObj.setTask_status(TaskStatus.EXECUTING.getCode());
|
||||
taskObj.setRemark("执行中");
|
||||
taskService.updateById(taskObj);
|
||||
@@ -111,6 +111,7 @@ public class BackInTask extends AbstractTask {
|
||||
if (status.equals(TaskStatus.CANCELED)) {
|
||||
this.cancelTask(taskObj);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -119,7 +120,10 @@ public class BackInTask extends AbstractTask {
|
||||
if (ObjectUtil.isEmpty(taskObj)) {
|
||||
throw new BadRequestException("该任务不存在");
|
||||
}
|
||||
this.finishTask(taskObj);
|
||||
rawAssistIStorService.taskFinish(taskObj);
|
||||
taskObj.setTask_status(TaskStatus.FINISHED.getCode());
|
||||
taskObj.setRemark("已完成");
|
||||
taskService.updateById(taskObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -128,51 +132,47 @@ public class BackInTask extends AbstractTask {
|
||||
if (ObjectUtil.isEmpty(taskObj)) {
|
||||
throw new BadRequestException("该任务不存在");
|
||||
}
|
||||
if (Integer.parseInt(taskObj.getTask_status()) > Integer.parseInt(TaskStatus.CREATE.getCode())) {
|
||||
throw new BadRequestException("只能取消生成中的任务!");
|
||||
if (!TaskStatus.CREATE.getCode().equals(taskObj.getTask_status())) {
|
||||
throw new BadRequestException("任务状态必须为生成才能取消任务");
|
||||
}
|
||||
this.cancelTask(taskObj);
|
||||
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);
|
||||
}
|
||||
|
||||
@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) {
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public void finishTask(SchBaseTask taskObj) {
|
||||
// 更新终点
|
||||
iStructattrService.update(
|
||||
new UpdateWrapper<Structattr>().lambda()
|
||||
.eq(Structattr::getStruct_code, taskObj.getPoint_code2())
|
||||
.set(Structattr::getStoragevehicle_code, taskObj.getVehicle_code())
|
||||
.set(Structattr::getTaskdtl_id, null)
|
||||
.set(Structattr::getLock_type, IOSEnum.LOCK_TYPE.code("未锁定"))
|
||||
);
|
||||
// 更新起点
|
||||
iSchBasePointService.update(
|
||||
new UpdateWrapper<SchBasePoint>().lambda()
|
||||
.eq(SchBasePoint::getPoint_code, taskObj.getPoint_code1())
|
||||
.set(SchBasePoint::getVehicle_code, null)
|
||||
.set(SchBasePoint::getIos_id, null)
|
||||
);
|
||||
// 更新任务
|
||||
taskObj.setRemark("已完成");
|
||||
taskObj.setTask_status(TaskStatus.FINISHED.getCode());
|
||||
taskService.updateById(taskObj);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public void cancelTask(SchBaseTask taskObj) {
|
||||
// 更新终点
|
||||
iStructattrService.update(
|
||||
new UpdateWrapper<Structattr>().lambda()
|
||||
.eq(Structattr::getStruct_code, taskObj.getPoint_code2())
|
||||
.set(Structattr::getTaskdtl_id, null)
|
||||
.set(Structattr::getLock_type, IOSEnum.LOCK_TYPE.code("未锁定"))
|
||||
);
|
||||
// 更新任务
|
||||
taskObj.setRemark("已取消");
|
||||
taskObj.setTask_status(TaskStatus.CANCELED.getCode());
|
||||
taskService.updateById(taskObj);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,13 +22,16 @@ import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* @Author: Liuxy
|
||||
* @Description: 移库任务类
|
||||
* @Date: 2025/5/25
|
||||
* <p>
|
||||
* 库内移库任务类
|
||||
* </p>
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2025-08-20
|
||||
*/
|
||||
@Component(value = "MoveTask")
|
||||
@TaskType("MoveTask")
|
||||
public class MoveTask extends AbstractTask {
|
||||
@Component(value = "InsideMoveTask")
|
||||
@TaskType("InsideMoveTask")
|
||||
public class InsideMoveTask extends AbstractTask {
|
||||
|
||||
/**
|
||||
* 任务服务类
|
||||
@@ -54,10 +57,12 @@ public class MoveTask extends AbstractTask {
|
||||
task.setTask_id(IdUtil.getStringId());
|
||||
task.setTask_code(CodeUtil.getNewCode("TASK_CODE"));
|
||||
task.setTask_status(TaskStatus.CREATE.getCode());
|
||||
task.setConfig_code(json.getString("config_code"));
|
||||
task.setConfig_code(InsideMoveTask.class.getSimpleName());
|
||||
task.setPoint_code1(json.getString("point_code1"));
|
||||
task.setPoint_code2(json.getString("point_code2"));
|
||||
task.setVehicle_code(json.getString("vehicle_code"));
|
||||
task.setVehicle_code2(json.getString("vehicle_code2"));
|
||||
task.setGroup_id(json.getString("group_id"));
|
||||
task.setRequest_param(json.toString());
|
||||
task.setPriority(json.getString("Priority"));
|
||||
task.setCreate_id(SecurityUtils.getCurrentUserId());
|
||||
@@ -130,7 +135,7 @@ public class MoveTask extends AbstractTask {
|
||||
if (Integer.parseInt(taskObj.getTask_status()) > Integer.parseInt(TaskStatus.CREATE.getCode())) {
|
||||
throw new BadRequestException("只能取消生成中的任务!");
|
||||
}
|
||||
this.cancelTask(taskObj);
|
||||
this.cancelTask(taskObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1,13 +1,13 @@
|
||||
package org.nl.wms.warehouse_management.controller;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
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.IStIvtMoveinvService;
|
||||
import org.nl.wms.warehouse_management.service.dao.StIvtMoveinv;
|
||||
import org.nl.wms.warehouse_management.service.dto.MoveInsertDto;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
@@ -20,7 +20,7 @@ import java.util.Set;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 基础分类表 控制层
|
||||
* 移库管理 控制层
|
||||
* </p>
|
||||
*
|
||||
* @author Liuxy
|
||||
@@ -62,6 +62,13 @@ public class MoveStorController {
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/sendTask")
|
||||
@Log("下发任务")
|
||||
public ResponseEntity<Object> sendTask(@RequestBody StIvtMoveinv dao) {
|
||||
iStIvtMoveinvService.sendTask(dao);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/getMoveDtl")
|
||||
@Log("查询移库单明细")
|
||||
public ResponseEntity<Object> getMoveDtl(@RequestParam Map whereJson) {
|
||||
@@ -71,7 +78,7 @@ public class MoveStorController {
|
||||
@GetMapping("/getCanuseIvt")
|
||||
@Log("获取可用库存物料")
|
||||
public ResponseEntity<Object> getCanuseIvt(@RequestParam Map whereJson, PageQuery page) {
|
||||
return new ResponseEntity<>(TableDataInfo.build(iStIvtMoveinvService.getCanuseIvt(whereJson,page)),HttpStatus.OK);
|
||||
return new ResponseEntity<>(TableDataInfo.build(iStIvtMoveinvService.getCanuseIvt(whereJson, page)), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/confirm")
|
||||
|
||||
@@ -17,11 +17,26 @@ public class IOSConstant {
|
||||
*/
|
||||
public final static String IS_DELETE_YES = "1";
|
||||
|
||||
/**
|
||||
* 数字0
|
||||
*/
|
||||
public final static String ZERO = "0";
|
||||
|
||||
/**
|
||||
* 数字1
|
||||
*/
|
||||
public final static String ONE = "1";
|
||||
|
||||
/**
|
||||
* 数字2
|
||||
*/
|
||||
public final static String TWO = "2";
|
||||
|
||||
/**
|
||||
* 数字3
|
||||
*/
|
||||
public final static String THREE = "3";
|
||||
|
||||
/**
|
||||
* 出入库 入库
|
||||
*/
|
||||
|
||||
@@ -32,11 +32,14 @@ public enum IOSEnum {
|
||||
,"拼箱入库", "0004" ,"拣选回库", "0005", "手工入库", "0009"
|
||||
)),
|
||||
|
||||
// 入库业务类型
|
||||
// 出库业务类型
|
||||
OUT_BILL_TYPE(MapOf.of("领料出库","1001", "质检出库","1002" , "退货出库","1003"
|
||||
,"烘干出库", "1004" ,"手工出库", "1009"
|
||||
)),
|
||||
|
||||
// 移库业务类型
|
||||
MOVE_BILL_TYPE(MapOf.of("库内移库","2001")),
|
||||
|
||||
// 入库任务配置类编码
|
||||
IN_CONFIG_CODE(MapOf.of("0001","DetainInTask", "0002", "BackInTask",
|
||||
"0003", "GeBoxInTask", "0004", "PieceBoxInTask", "0005", "SelectBackInTask", "0009", "HandInTask"
|
||||
@@ -47,6 +50,11 @@ public enum IOSEnum {
|
||||
"1003", "BackOutTask", "1004", "HotOutTask", "1009", "HandOutTask"
|
||||
)),
|
||||
|
||||
// 移库任务配置类编码
|
||||
MOVE_CONFIG_CODE(MapOf.of("2001","InsideMoveTask", "2002", "2002",
|
||||
"2003", "2003", "2004", "2004", "2005", "2005"
|
||||
)),
|
||||
|
||||
//入库分配明细状态
|
||||
INBILL_DIS_STATUS(MapOf.of("未生成", "00", "生成", "01", "执行中", "02", "完成", "99")),
|
||||
|
||||
@@ -59,6 +67,9 @@ public enum IOSEnum {
|
||||
"其他锁","9"
|
||||
)),
|
||||
|
||||
// 库区编码
|
||||
SECT_CODE(MapOf.of("合格区", "HG01", "待检区", "DJ01", "不合格区", "BHG01")),
|
||||
|
||||
// 存放载具类型
|
||||
VEHICLE_TYPE_PUT(MapOf.of("大料架(短边)", "1", "大料架(长边)", "2", "金属托盘", "3"
|
||||
, "小料架", "4")),
|
||||
|
||||
@@ -34,8 +34,9 @@ public interface IStIvtMoveinvService extends IService<StIvtMoveinv> {
|
||||
/**
|
||||
* 新增移库单
|
||||
* @param dto:新增修改dto实体类
|
||||
* @return move_id
|
||||
*/
|
||||
void create(MoveInsertDto dto);
|
||||
String create(MoveInsertDto dto);
|
||||
|
||||
/**
|
||||
* 修改移库单
|
||||
@@ -97,4 +98,10 @@ public interface IStIvtMoveinvService extends IService<StIvtMoveinv> {
|
||||
* @param dto 新增修改dto实体类
|
||||
*/
|
||||
void confirm(MoveInsertDto dto);
|
||||
|
||||
/**
|
||||
* 下发任务
|
||||
* @param dao 移库主表实体类
|
||||
*/
|
||||
void sendTask(StIvtMoveinv dao);
|
||||
}
|
||||
|
||||
@@ -99,6 +99,11 @@ public class StIvtMoveinvdtl implements Serializable {
|
||||
*/
|
||||
private String storagevehicle_code;
|
||||
|
||||
/**
|
||||
* 存储载具编码
|
||||
*/
|
||||
private String storagevehicle_code2;
|
||||
|
||||
/**
|
||||
* 是否已下发
|
||||
*/
|
||||
|
||||
@@ -15,18 +15,21 @@
|
||||
dtl.qty_unit_id,
|
||||
dtl.qty_unit_name,
|
||||
dtl.storagevehicle_code,
|
||||
dtl.storagevehicle_code2,
|
||||
attrout.sect_name AS turnout_sect_name,
|
||||
attrout.sect_code AS turnout_sect_code,
|
||||
attrout.struct_code AS turnout_struct_code,
|
||||
attrin.sect_name AS turnin_sect_name,
|
||||
attrin.sect_code AS turnin_sect_code,
|
||||
attrin.struct_code AS turnin_struct_code
|
||||
attrin.struct_code AS turnin_struct_code,
|
||||
task.task_code
|
||||
FROM
|
||||
st_ivt_moveinvdtl dtl
|
||||
LEFT JOIN st_ivt_moveinv ios ON ios.moveinv_id = dtl.moveinv_id
|
||||
LEFT JOIN md_me_materialbase material ON material.material_code = dtl.material_code
|
||||
LEFT JOIN st_ivt_structattr attrout ON attrout.struct_code = dtl.turnout_struct_code
|
||||
LEFT JOIN st_ivt_structattr attrin ON attrin.struct_code = dtl.turnin_struct_code
|
||||
LEFT JOIN sch_base_task task ON task.task_id = dtl.task_id
|
||||
<where>
|
||||
ios.is_delete = '0'
|
||||
<if test="param.moveinv_id != null and param.moveinv_id != ''">
|
||||
|
||||
@@ -70,6 +70,7 @@ public class MoveInsertDto {
|
||||
* qty_unit_id 计量单位标识
|
||||
* qty_unit_name 计量单位名称
|
||||
* storagevehicle_code 载具编码
|
||||
* storagevehicle_code2 载具编码
|
||||
* turnin_sect_code 移入库区
|
||||
* turnin_struct_code 移入仓位
|
||||
* turnout_sect_code 移出库区
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package org.nl.wms.warehouse_management.service.impl;
|
||||
|
||||
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;
|
||||
@@ -8,6 +9,7 @@ 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.CodeUtil;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
@@ -17,9 +19,12 @@ 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;
|
||||
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.tasks.MoveTask;
|
||||
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;
|
||||
@@ -52,12 +57,6 @@ public class StIvtMoveinvServiceImpl extends ServiceImpl<StIvtMoveinvMapper, StI
|
||||
@Autowired
|
||||
private MdPbStoragevehicleextMapper mdPbStoragevehicleextMapper;
|
||||
|
||||
/**
|
||||
* 载具扩展属性服务类
|
||||
*/
|
||||
@Autowired
|
||||
private IMdPbStoragevehicleextService iMdPbStoragevehicleextService;
|
||||
|
||||
/**
|
||||
* 移库单明细服务
|
||||
*/
|
||||
@@ -83,10 +82,10 @@ public class StIvtMoveinvServiceImpl extends ServiceImpl<StIvtMoveinvMapper, StI
|
||||
private ISchBaseTaskService iSchBaseTaskService;
|
||||
|
||||
/**
|
||||
* 移库任务配置类
|
||||
* 任务工厂服务
|
||||
*/
|
||||
@Autowired
|
||||
private MoveTask moveTask;
|
||||
private TaskFactory taskFactory;
|
||||
|
||||
@Override
|
||||
public IPage<JSONObject> queryAll(Map whereJson, PageQuery page) {
|
||||
@@ -96,7 +95,7 @@ public class StIvtMoveinvServiceImpl extends ServiceImpl<StIvtMoveinvMapper, StI
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void create(MoveInsertDto dto) {
|
||||
public String create(MoveInsertDto dto) {
|
||||
// 主表数据
|
||||
StIvtMoveinv moveDao = new StIvtMoveinv();
|
||||
moveDao.setMoveinv_id(IdUtil.getStringId());
|
||||
@@ -117,6 +116,7 @@ public class StIvtMoveinvServiceImpl extends ServiceImpl<StIvtMoveinvMapper, StI
|
||||
// 新增明细以及任务
|
||||
dto.setMoveinv_id(moveDao.getMoveinv_id());
|
||||
iStIvtMoveinvdtlService.createMoveDtl(dto);
|
||||
return moveDao.getMoveinv_id();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -163,7 +163,7 @@ public class StIvtMoveinvServiceImpl extends ServiceImpl<StIvtMoveinvMapper, StI
|
||||
|
||||
@Override
|
||||
public IPage<JSONObject> getCanuseIvt(Map whereJson, PageQuery page) {
|
||||
return mdPbStoragevehicleextMapper.getCanuseIvt(new Page<>(page.getPage() + 1, page.getSize()),
|
||||
return mdPbStoragevehicleextMapper.getCanuseVheicle(new Page<>(page.getPage() + 1, page.getSize()),
|
||||
whereJson);
|
||||
}
|
||||
|
||||
@@ -196,47 +196,32 @@ public class StIvtMoveinvServiceImpl extends ServiceImpl<StIvtMoveinvMapper, StI
|
||||
|
||||
@Override
|
||||
public void confirmTask(StIvtMoveinvdtl dtlDao) {
|
||||
// 需要更新库存集合
|
||||
List<JSONObject> updateIvtList = new ArrayList<>();
|
||||
// 查询物料
|
||||
MdMeMaterialbase materDao = iMdMeMaterialbaseService.getOne(
|
||||
new QueryWrapper<MdMeMaterialbase>().lambda()
|
||||
.eq(MdMeMaterialbase::getMaterial_code, dtlDao.getMaterial_code())
|
||||
);
|
||||
|
||||
JSONObject jsonIvt = new JSONObject();
|
||||
jsonIvt.put("type", IOSConstant.UPDATE_IVT_TYPE_SUB_FROZEN);
|
||||
jsonIvt.put("storagevehicle_code", dtlDao.getStoragevehicle_code());
|
||||
jsonIvt.put("material_id", materDao.getMaterial_id());
|
||||
jsonIvt.put("pcsn", dtlDao.getPcsn());
|
||||
jsonIvt.put("qty_unit_id", dtlDao.getQty_unit_id());
|
||||
jsonIvt.put("qty_unit_name", dtlDao.getQty_unit_name());
|
||||
jsonIvt.put("change_qty", dtlDao.getQty());
|
||||
updateIvtList.add(jsonIvt);
|
||||
JSONObject jsonIvtTwo = new JSONObject();
|
||||
jsonIvtTwo.put("type", IOSConstant.UPDATE_IVT_TYPE_ADD_CANUSE);
|
||||
jsonIvtTwo.put("storagevehicle_code", dtlDao.getStoragevehicle_code());
|
||||
jsonIvtTwo.put("material_id", materDao.getMaterial_id());
|
||||
jsonIvtTwo.put("pcsn", dtlDao.getPcsn());
|
||||
jsonIvtTwo.put("qty_unit_id", dtlDao.getQty_unit_id());
|
||||
jsonIvtTwo.put("qty_unit_name", dtlDao.getQty_unit_name());
|
||||
jsonIvtTwo.put("change_qty", dtlDao.getQty());
|
||||
updateIvtList.add(jsonIvtTwo);
|
||||
iMdPbStoragevehicleextService.updateIvt(updateIvtList);
|
||||
|
||||
// 查询移入货位
|
||||
Structattr inStruct = iStructattrService.getByCode(dtlDao.getTurnin_struct_code());
|
||||
// 查询移出货位
|
||||
Structattr outStruct = iStructattrService.getByCode(dtlDao.getTurnout_struct_code());
|
||||
// 更新起点
|
||||
iStructattrService.update(
|
||||
new UpdateWrapper<Structattr>().lambda()
|
||||
.eq(Structattr::getStruct_code, dtlDao.getTurnout_struct_code())
|
||||
.set(Structattr::getLock_type, IOSEnum.LOCK_TYPE.code("未锁定"))
|
||||
.set(Structattr::getStoragevehicle_code, null)
|
||||
.set(Structattr::getStoragevehicle_code, dtlDao.getStoragevehicle_code2())
|
||||
.set(Structattr::getIs_emptyvehicle,
|
||||
inStruct.getIs_emptyvehicle().equals(IOSConstant.IS_DELETE_YES) ? IOSConstant.IS_DELETE_YES
|
||||
: IOSConstant.IS_DELETE_NO
|
||||
)
|
||||
);
|
||||
|
||||
// 更新终点
|
||||
iStructattrService.update(
|
||||
new UpdateWrapper<Structattr>().lambda()
|
||||
.eq(Structattr::getStruct_code, dtlDao.getTurnin_struct_code())
|
||||
.set(Structattr::getLock_type, IOSEnum.LOCK_TYPE.code("未锁定"))
|
||||
.set(Structattr::getStoragevehicle_code, dtlDao.getStoragevehicle_code())
|
||||
.set(Structattr::getIs_emptyvehicle,
|
||||
outStruct.getIs_emptyvehicle().equals(IOSConstant.IS_DELETE_YES) ? IOSConstant.IS_DELETE_YES
|
||||
: IOSConstant.IS_DELETE_NO
|
||||
)
|
||||
);
|
||||
|
||||
// 更新明细状态
|
||||
@@ -261,28 +246,57 @@ public class StIvtMoveinvServiceImpl extends ServiceImpl<StIvtMoveinvMapper, StI
|
||||
@Override
|
||||
@Transactional
|
||||
public void confirm(MoveInsertDto dto) {
|
||||
StIvtMoveinv mstDao = this.getById(dto.getMoveinv_id());
|
||||
// 查询所有明细
|
||||
List<StIvtMoveinvdtl> dtlDaoList = iStIvtMoveinvdtlService.list(
|
||||
new QueryWrapper<StIvtMoveinvdtl>().lambda()
|
||||
.eq(StIvtMoveinvdtl::getMoveinv_id, dto.getMoveinv_id())
|
||||
);
|
||||
List<SchBaseTask> taskDaoList = iSchBaseTaskService.list(
|
||||
new QueryWrapper<SchBaseTask>().lambda()
|
||||
.in(SchBaseTask::getTask_id,
|
||||
dtlDaoList.stream()
|
||||
.map(StIvtMoveinvdtl::getTask_id)
|
||||
.collect(Collectors.toList())
|
||||
)
|
||||
);
|
||||
|
||||
for (StIvtMoveinvdtl dao : dtlDaoList) {
|
||||
SchBaseTask taskDao = taskDaoList.stream()
|
||||
.filter(row -> row.getTask_id().equals(dao.getTask_id()))
|
||||
.findFirst().orElse(null);
|
||||
moveTask.finishTask(taskDao);
|
||||
if (ObjectUtil.isNotEmpty(dao.getTask_id())) {
|
||||
SchBaseTask taskDao = iSchBaseTaskService.getById(dao.getTask_id());
|
||||
AbstractTask task = taskFactory.getTask(IOSEnum.MOVE_CONFIG_CODE.code(mstDao.getBill_type()));
|
||||
task.updateTaskStatus(taskDao.getTask_code(), TaskStatus.FINISHED);
|
||||
} else {
|
||||
this.confirmTask(dao);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void sendTask(StIvtMoveinv dao) {
|
||||
StIvtMoveinv mstDao = this.getById(dao.getMoveinv_id());
|
||||
if (!mstDao.getBill_status().equals(IOSEnum.MORE_MST_STATUS.code("生成"))) {
|
||||
throw new BadRequestException("当前移库单已下发任务!");
|
||||
}
|
||||
|
||||
List<StIvtMoveinvdtl> dtlList = iStIvtMoveinvdtlService.list(
|
||||
new QueryWrapper<StIvtMoveinvdtl>().lambda()
|
||||
.eq(StIvtMoveinvdtl::getMoveinv_id, dao.getMoveinv_id())
|
||||
);
|
||||
|
||||
AbstractTask task = taskFactory.getTask(IOSEnum.MOVE_CONFIG_CODE.code(mstDao.getBill_type()));
|
||||
for (StIvtMoveinvdtl dtlDao : dtlList) {
|
||||
JSONObject jsonTask = new JSONObject();
|
||||
jsonTask.put("point_code1", dtlDao.getTurnout_struct_code());
|
||||
jsonTask.put("point_code2", dtlDao.getTurnin_struct_code());
|
||||
jsonTask.put("vehicle_code", dtlDao.getStoragevehicle_code());
|
||||
jsonTask.put("vehicle_code2", dtlDao.getStoragevehicle_code2());
|
||||
String task_id = task.create(jsonTask);
|
||||
|
||||
// 更新明细任务标识
|
||||
dtlDao.setTask_id(task_id);
|
||||
}
|
||||
iStIvtMoveinvdtlService.updateBatchById(dtlList);
|
||||
|
||||
// 更新主表状态为提交
|
||||
dao.setBill_status(IOSEnum.MOVE_MST_STATUS.code("提交"));
|
||||
this.updateById(dao);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新主表状态
|
||||
* @param moveinv_id 移库单id
|
||||
|
||||
@@ -10,13 +10,8 @@ import org.nl.common.utils.IdUtil;
|
||||
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.sch_manage.enums.TaskEnum;
|
||||
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.tasks.MoveTask;
|
||||
import org.nl.wms.warehouse_management.enums.IOSConstant;
|
||||
import org.nl.wms.warehouse_management.enums.IOSEnum;
|
||||
import org.nl.wms.warehouse_management.service.IStIvtMoveinvdtlService;
|
||||
import org.nl.wms.warehouse_management.service.dao.StIvtMoveinvdtl;
|
||||
@@ -26,8 +21,9 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -40,12 +36,6 @@ import java.util.stream.Collectors;
|
||||
@Service
|
||||
public class StIvtMoveinvdtlServiceImpl extends ServiceImpl<StIvtMoveinvdtlMapper, StIvtMoveinvdtl> implements IStIvtMoveinvdtlService {
|
||||
|
||||
/**
|
||||
* 载具扩展属性服务
|
||||
*/
|
||||
@Autowired
|
||||
private IMdPbStoragevehicleextService iMdPbStoragevehicleextService;
|
||||
|
||||
/**
|
||||
* 仓位服务
|
||||
*/
|
||||
@@ -58,43 +48,21 @@ public class StIvtMoveinvdtlServiceImpl extends ServiceImpl<StIvtMoveinvdtlMappe
|
||||
@Autowired
|
||||
private ISchBaseTaskService iSchBaseTaskService;
|
||||
|
||||
/**
|
||||
* 物料服务
|
||||
*/
|
||||
@Autowired
|
||||
private IMdMeMaterialbaseService iMdMeMaterialbaseService;
|
||||
|
||||
/**
|
||||
* 移库任务配置类
|
||||
*/
|
||||
@Autowired
|
||||
private MoveTask moveTask;
|
||||
|
||||
@Override
|
||||
public void createMoveDtl(MoveInsertDto dto) {
|
||||
// 批量插入明细集合
|
||||
List<StIvtMoveinvdtl> moveDtlList = new ArrayList<>();
|
||||
// 批量更新库存集合
|
||||
List<JSONObject> updateIvtList = new ArrayList<>();
|
||||
// 批量更新仓位
|
||||
List<JSONObject> updateAttrList = new ArrayList<>();
|
||||
// 处理明细数据
|
||||
List<JSONObject> tableData = dto.getTableData();
|
||||
for (int i = 0; i < tableData.size(); i++) {
|
||||
JSONObject json = tableData.get(i);
|
||||
// 组织任务数据
|
||||
JSONObject jsonTask = new JSONObject();
|
||||
jsonTask.put("config_code", IOSConstant.MOVE_CONFIG_TASK);
|
||||
jsonTask.put("point_code1",json.getString("turnout_struct_code"));
|
||||
jsonTask.put("point_code2",json.getString("turnin_struct_code"));
|
||||
jsonTask.put("vehicle_code",json.getString("storagevehicle_code"));
|
||||
jsonTask.put("Priority", TaskEnum.ACS_PRIORITY.code("1"));
|
||||
String task_id = moveTask.create(jsonTask);
|
||||
// 明细数据
|
||||
StIvtMoveinvdtl dtlDao = new StIvtMoveinvdtl();
|
||||
dtlDao.setMoveinvdtl_id(IdUtil.getStringId());
|
||||
dtlDao.setMoveinv_id(dto.getMoveinv_id());
|
||||
dtlDao.setSeq_no(BigDecimal.valueOf(i+1));
|
||||
dtlDao.setSeq_no(BigDecimal.valueOf(i + 1));
|
||||
dtlDao.setTurnout_sect_code(json.getString("turnout_sect_code"));
|
||||
dtlDao.setTurnout_struct_code(json.getString("turnout_struct_code"));
|
||||
dtlDao.setMaterial_code(json.getString("material_code"));
|
||||
@@ -106,33 +74,20 @@ public class StIvtMoveinvdtlServiceImpl extends ServiceImpl<StIvtMoveinvdtlMappe
|
||||
dtlDao.setTurnin_struct_code(json.getString("turnin_struct_code"));
|
||||
dtlDao.setWork_status(json.getString("work_status"));
|
||||
dtlDao.setStoragevehicle_code(json.getString("storagevehicle_code"));
|
||||
dtlDao.setStoragevehicle_code2(json.getString("storagevehicle_code2"));
|
||||
dtlDao.setRemark(json.getString("remark"));
|
||||
dtlDao.setTask_id(task_id);
|
||||
moveDtlList.add(dtlDao);
|
||||
// 组织要更新库存的数据
|
||||
JSONObject jsonIvt = new JSONObject();
|
||||
jsonIvt.put("type", IOSConstant.UPDATE_IVT_TYPE_ADD_FROZEN);
|
||||
jsonIvt.put("storagevehicle_code", dtlDao.getStoragevehicle_code());
|
||||
jsonIvt.put("material_id", json.getString("material_id"));
|
||||
jsonIvt.put("pcsn", dtlDao.getPcsn());
|
||||
jsonIvt.put("qty_unit_id", dtlDao.getQty_unit_id());
|
||||
jsonIvt.put("qty_unit_name", dtlDao.getQty_unit_name());
|
||||
jsonIvt.put("change_qty", dtlDao.getQty());
|
||||
jsonIvt.put("struct_code_out", dtlDao.getTurnout_struct_code());
|
||||
jsonIvt.put("struct_code_in", dtlDao.getTurnin_struct_code());
|
||||
updateIvtList.add(jsonIvt);
|
||||
// 组织要更新仓位的数据
|
||||
JSONObject jsonAttrIn = new JSONObject();
|
||||
jsonAttrIn.put("struct_code",dtlDao.getTurnin_struct_code());
|
||||
jsonAttrIn.put("lock_type",IOSEnum.LOCK_TYPE.code("移入锁"));
|
||||
jsonAttrIn.put("struct_code", dtlDao.getTurnin_struct_code());
|
||||
jsonAttrIn.put("lock_type", IOSEnum.LOCK_TYPE.code("移入锁"));
|
||||
updateAttrList.add(jsonAttrIn);
|
||||
JSONObject jsonAttrOut = new JSONObject();
|
||||
jsonAttrOut.put("struct_code",dtlDao.getTurnout_struct_code());
|
||||
jsonAttrOut.put("lock_type",IOSEnum.LOCK_TYPE.code("移出锁"));
|
||||
jsonAttrOut.put("struct_code", dtlDao.getTurnout_struct_code());
|
||||
jsonAttrOut.put("lock_type", IOSEnum.LOCK_TYPE.code("移出锁"));
|
||||
updateAttrList.add(jsonAttrOut);
|
||||
}
|
||||
this.saveBatch(moveDtlList);
|
||||
iMdPbStoragevehicleextService.updateIvt(updateIvtList);
|
||||
// 锁定仓位
|
||||
iStructattrService.updateLock(updateAttrList);
|
||||
}
|
||||
@@ -151,39 +106,13 @@ public class StIvtMoveinvdtlServiceImpl extends ServiceImpl<StIvtMoveinvdtlMappe
|
||||
lambda.eq(StIvtMoveinvdtl::getTask_id, dto.getTask_id());
|
||||
}
|
||||
List<StIvtMoveinvdtl> oldDtlDao = this.list(lambda);
|
||||
// 查询物料
|
||||
List<MdMeMaterialbase> materialList = iMdMeMaterialbaseService.list(
|
||||
new QueryWrapper<MdMeMaterialbase>().lambda()
|
||||
.in(MdMeMaterialbase::getMaterial_code,
|
||||
oldDtlDao.stream()
|
||||
.map(StIvtMoveinvdtl::getMaterial_code)
|
||||
.collect(Collectors.toList())
|
||||
)
|
||||
);
|
||||
|
||||
// 需要删除的任务
|
||||
List<String> taskDeleteList = new ArrayList<>();
|
||||
// 需要更新的库存集合
|
||||
List<JSONObject> updateIvtList = new ArrayList<>();
|
||||
// 需要更新的仓位集合
|
||||
List<String> updateAttrList = new ArrayList<>();
|
||||
for (StIvtMoveinvdtl dao : oldDtlDao) {
|
||||
taskDeleteList.add(dao.getTask_id());
|
||||
|
||||
// 更新库存数据组织
|
||||
JSONObject jsonIvt = new JSONObject();
|
||||
jsonIvt.put("type", IOSConstant.UPDATE_IVT_TYPE_SUB_FROZEN_ADD_CANUSE);
|
||||
jsonIvt.put("storagevehicle_code", dao.getStoragevehicle_code());
|
||||
MdMeMaterialbase materDao = materialList.stream()
|
||||
.filter(row -> row.getMaterial_code().equals(dao.getMaterial_code()))
|
||||
.findFirst().orElse(null);
|
||||
jsonIvt.put("material_id", materDao.getMaterial_id());
|
||||
jsonIvt.put("pcsn", dao.getPcsn());
|
||||
jsonIvt.put("qty_unit_id", dao.getQty_unit_id());
|
||||
jsonIvt.put("qty_unit_name", dao.getQty_unit_name());
|
||||
jsonIvt.put("change_qty", dao.getQty());
|
||||
updateIvtList.add(jsonIvt);
|
||||
|
||||
// 需要更新的仓位
|
||||
updateAttrList.add(dao.getTurnin_struct_code());
|
||||
updateAttrList.add(dao.getTurnout_struct_code());
|
||||
@@ -191,15 +120,13 @@ public class StIvtMoveinvdtlServiceImpl extends ServiceImpl<StIvtMoveinvdtlMappe
|
||||
// 删除明细
|
||||
this.remove(
|
||||
new QueryWrapper<StIvtMoveinvdtl>().lambda()
|
||||
.eq(StIvtMoveinvdtl::getMoveinv_id, dto.getMoveinv_id())
|
||||
.eq(StIvtMoveinvdtl::getMoveinv_id, dto.getMoveinv_id())
|
||||
);
|
||||
// 更新库存
|
||||
iMdPbStoragevehicleextService.updateIvt(updateIvtList);
|
||||
// 更新仓位
|
||||
iStructattrService.update(
|
||||
new UpdateWrapper<Structattr>().lambda()
|
||||
.in(Structattr::getStruct_code, updateAttrList)
|
||||
.set(Structattr::getLock_type, IOSEnum.LOCK_TYPE.code("未锁定"))
|
||||
.in(Structattr::getStruct_code, updateAttrList)
|
||||
.set(Structattr::getLock_type, IOSEnum.LOCK_TYPE.code("未锁定"))
|
||||
);
|
||||
// 删除任务
|
||||
iSchBaseTaskService.removeByIds(taskDeleteList);
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
placeholder="所属库区"
|
||||
:options="sects"
|
||||
:props="{ checkStrictly: true }"
|
||||
clearable
|
||||
@change="sectQueryChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
@@ -55,6 +54,9 @@
|
||||
<el-table-column prop="struct_code" label="货位编码" />
|
||||
<el-table-column prop="struct_name" label="货位名称" />
|
||||
<el-table-column prop="sect_name" label="库区名称" />
|
||||
<el-table-column prop="storagevehicle_code" label="载具编码" />
|
||||
<el-table-column prop="is_emptyvehicle" label="是否空载具" :formatter="isEmpVehihcle" />
|
||||
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
@@ -80,7 +82,7 @@ export default {
|
||||
return CRUD({
|
||||
title: '仓位',
|
||||
optShow: {},
|
||||
url: 'api/structattr',
|
||||
url: 'api/structattr/getMoveStruct',
|
||||
idField: 'struct_id',
|
||||
sort: 'struct_id,desc',
|
||||
query: { search: '', is_lock: '0', lock_type: '0', sect_id: '', stor_id: '' },
|
||||
@@ -100,7 +102,11 @@ export default {
|
||||
type: String,
|
||||
default: String
|
||||
},
|
||||
layerNum: {
|
||||
defaultList: {
|
||||
type: String,
|
||||
default: Array
|
||||
},
|
||||
notPoint: {
|
||||
type: String,
|
||||
default: String
|
||||
}
|
||||
@@ -114,8 +120,7 @@ export default {
|
||||
checkrow: {},
|
||||
rows: [],
|
||||
dialogDis: true,
|
||||
lock: '',
|
||||
defaultList: ['1582991156504039424', '1645705331612979200']
|
||||
lock: ''
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@@ -155,6 +160,7 @@ export default {
|
||||
this.query.is_lock = '0'
|
||||
this.query.lock_type = this.lock
|
||||
this.query.is_used = '1'
|
||||
this.query.not_point = this.notPoint
|
||||
this.crud.toQuery()
|
||||
},
|
||||
handleSelectionChange(val, row) {
|
||||
@@ -196,6 +202,13 @@ export default {
|
||||
}
|
||||
this.$emit('update:dialogShow', false)
|
||||
this.$emit('tableChanged', this.checkrow)
|
||||
},
|
||||
isEmpVehihcle(row) {
|
||||
if (row.is_emptyvehicle === '1') {
|
||||
return '是'
|
||||
} else {
|
||||
return '否'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -179,11 +179,11 @@
|
||||
{{ scope.row.vehicle_code ? scope.row.vehicle_code : '-' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!--<el-table-column prop="vehicle_code2" label="载具编码2" :min-width="flexWidth('vehicle_code2',crud.data,'载具编码2')">
|
||||
<el-table-column prop="vehicle_code2" label="载具编码2" :min-width="flexWidth('vehicle_code2',crud.data,'载具编码2')">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.vehicle_code2 ? scope.row.vehicle_code2 : '-' }}
|
||||
</template>
|
||||
</el-table-column>-->
|
||||
</el-table-column>
|
||||
<!-- <el-table-column prop="task_class_id" label="任务分类" :min-width="flexWidth('task_class_id',crud.data,'任务分类')" />-->
|
||||
<el-table-column prop="task_status" label="任务状态" :min-width="flexWidth('task_status',crud.data,'任务状态')">
|
||||
<template slot-scope="scope">
|
||||
|
||||
257
wms/nladmin-ui/src/views/wms/st/ivtstatuschanage/index.vue
Normal file
257
wms/nladmin-ui/src/views/wms/st/ivtstatuschanage/index.vue
Normal file
@@ -0,0 +1,257 @@
|
||||
<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="90px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="所属库区">
|
||||
<el-cascader
|
||||
placeholder="所属库区"
|
||||
:options="sects"
|
||||
:props="{ checkStrictly: true }"
|
||||
clearable
|
||||
class="filter-item"
|
||||
style="width: 200px;"
|
||||
@change="sectQueryChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="仓位搜索">
|
||||
<el-input
|
||||
v-model="query.struct_code"
|
||||
clearable
|
||||
size="small"
|
||||
placeholder="仓位编码或名称"
|
||||
style="width: 200px;"
|
||||
class="filter-item"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="物料搜索">
|
||||
<el-input
|
||||
v-model="query.material_code"
|
||||
clearable
|
||||
size="small"
|
||||
placeholder="物料编码、名称或规格"
|
||||
style="width: 200px;"
|
||||
class="filter-item"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="批次号">
|
||||
<el-input
|
||||
v-model="query.pcsn"
|
||||
clearable
|
||||
size="small"
|
||||
placeholder="批次号"
|
||||
style="width: 200px;"
|
||||
class="filter-item"
|
||||
/>
|
||||
</el-form-item>
|
||||
<rrOperation :crud="crud" />
|
||||
</el-form>
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission">
|
||||
</crudOperation>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
size="mini"
|
||||
style="width: 100%;"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
>
|
||||
<el-table-column prop="struct_code" label="仓位编码" :min-width="flexWidth('struct_code',crud.data,'仓位编码')" />
|
||||
<el-table-column prop="struct_name" label="仓位名称" :min-width="flexWidth('struct_name',crud.data,'仓位名称')" />
|
||||
<el-table-column prop="stor_name" label="仓库" :min-width="flexWidth('stor_name',crud.data,'仓库')" />
|
||||
<el-table-column prop="sect_name" label="库区" :min-width="flexWidth('sect_name',crud.data,'库区')" />
|
||||
<el-table-column prop="quality_type" label="品质类型" min-width="140">
|
||||
<template scope="scope">
|
||||
<el-select
|
||||
v-if="scope.row.edit"
|
||||
v-model="scope.row.quality_type"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="全部"
|
||||
style="width: 110px;"
|
||||
class="filter-item"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.QUALITY_TYPE"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
<div v-if="!scope.row.edit">{{scope.row.quality_name}}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<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="material_spec" label="物料规格" :min-width="flexWidth('material_spec',crud.data,'物料规格')" />
|
||||
<el-table-column prop="pcsn" label="批次号" :min-width="flexWidth('pcsn',crud.data,'批次号')" />
|
||||
<el-table-column prop="storagevehicle_code" label="载具号" :min-width="flexWidth('storagevehicle_code',crud.data,'载具号')" />
|
||||
<el-table-column prop="canuse_qty" label="可用数" :formatter="crud.formatNum3" :min-width="100" />
|
||||
<el-table-column prop="frozen_qty" label="冻结数" :formatter="crud.formatNum3" :min-width="100" />
|
||||
<el-table-column prop="qty_unit_name" label="计量单位" :min-width="flexWidth('qty_unit_name',crud.data,'计量单位')" />
|
||||
<el-table-column prop="produce_time" label="生产日期" :min-width="flexWidth('produce_time',crud.data,'生产日期')" />
|
||||
<el-table-column prop="quality_time" label="有效日期" :min-width="flexWidth('quality_time',crud.data,'有效日期')" />
|
||||
<el-table-column prop="bake_num" label="烘干次数" :min-width="flexWidth('bake_num',crud.data,'烘干次数')" />
|
||||
<el-table-column prop="remark" label="备注" :min-width="flexWidth('remark',crud.data,'备注')" />
|
||||
<el-table-column prop="insert_time" label="入库时间" :min-width="flexWidth('insert_time',crud.data,'入库时间')" />
|
||||
<el-table-column align="center" width="200" label="操作" fixed="right">
|
||||
<template scope="scope">
|
||||
<el-button
|
||||
v-show="!scope.row.edit"
|
||||
type="primary"
|
||||
class="filter-item"
|
||||
size="mini"
|
||||
icon="el-icon-edit"
|
||||
@click="handleEdit(scope.$index, scope.row)"
|
||||
>编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
v-show="scope.row.edit"
|
||||
type="success"
|
||||
class="filter-item"
|
||||
size="mini"
|
||||
icon="el-icon-check"
|
||||
@click="handleEdit(scope.$index, scope.row)"
|
||||
>完成
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
class="filter-item"
|
||||
size="mini"
|
||||
icon="el-icon-refresh-right"
|
||||
:loading="loadingConfirm"
|
||||
@click="statusChange(scope.$index, scope.row)"
|
||||
>变更
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudStructivt from '@/views/wms/statement/structivt/structivt'
|
||||
import CRUD, { presenter, header, crud } 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'
|
||||
import { download } from '@/api/data'
|
||||
import { downloadFile } from '@/utils'
|
||||
|
||||
export default {
|
||||
name: 'IvtStatusChanage',
|
||||
components: { pagination, crudOperation, rrOperation },
|
||||
mixins: [presenter(), header(), crud()],
|
||||
dicts: ['QUALITY_TYPE'],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '状态变更', url: 'api/structivt', idField: 'stockrecord_id', sort: 'stockrecord_id,desc',
|
||||
optShow: {
|
||||
add: false,
|
||||
edit: false,
|
||||
showDtlLoading: false,
|
||||
del: false,
|
||||
download: false,
|
||||
reset: true
|
||||
},
|
||||
crudMethod: { ...crudStructivt }
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
sects: [],
|
||||
loadingConfirm: false,
|
||||
permission: {},
|
||||
rules: {}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
crudSectattr.getSect({ 'stor_id': '' }).then(res => {
|
||||
this.sects = res.content
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
hand(value) {
|
||||
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()
|
||||
},
|
||||
querytable() {
|
||||
this.crud.toQuery()
|
||||
},
|
||||
downdtl() {
|
||||
if (this.currentRow !== null) {
|
||||
this.showDtlLoading = true
|
||||
download('/api/structivt/download', this.crud.query).then(result => {
|
||||
downloadFile(result, '成品库存', 'xlsx')
|
||||
this.showDtlLoading = false
|
||||
}).catch(() => {
|
||||
this.showDtlLoading = false
|
||||
})
|
||||
}
|
||||
},
|
||||
formattQuality(row) {
|
||||
return this.dict.label.QUALITY_TYPE[row.quality_type]
|
||||
},
|
||||
handleEdit(index, row) {
|
||||
// 判断是否可以关闭编辑状态
|
||||
row.edit = !row.edit
|
||||
this.$refs.table.selection.split(index, 1, row)
|
||||
},
|
||||
statusChange(index, row) {
|
||||
if (!row.edit) {
|
||||
this.crud.notify('请点击编辑后在变更!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
if (row.old_quality_type === row.quality_type) {
|
||||
this.crud.notify('变更品质类型相同!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
this.loadingConfirm = true
|
||||
crudStructivt.statusChange(row).then(res => {
|
||||
this.crud.notify('操作成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
this.loadingConfirm = false
|
||||
}).catch(() => {
|
||||
this.loadingConfirm = false
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -65,6 +65,7 @@
|
||||
<el-select
|
||||
v-model="form.bill_type"
|
||||
placeholder="业务类型"
|
||||
:disabled="crud.status.view > 0"
|
||||
class="filter-item"
|
||||
>
|
||||
<el-option
|
||||
@@ -144,7 +145,7 @@
|
||||
size="mini"
|
||||
@click="queryDtl()"
|
||||
>
|
||||
添加库存物料
|
||||
添加库存托盘
|
||||
</el-button>
|
||||
</span>
|
||||
|
||||
@@ -159,14 +160,10 @@
|
||||
>
|
||||
<el-table-column type="index" label="序号" width="50" align="center" />
|
||||
<el-table-column v-if="crud.status.add!==1" prop="work_status" label="状态" align="center" :formatter="bill_statusFormat" :min-width="flexWidth('work_status',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" align="center" :min-width="flexWidth('qty',crud.data,'重量')" />
|
||||
<el-table-column prop="qty_unit_name" label="单位" align="center" :min-width="flexWidth('qty_unit_name',crud.data,'单位')" />
|
||||
<el-table-column prop="storagevehicle_code" label="载具号" :min-width="flexWidth('storagevehicle_code',crud.data,'载具号')" />
|
||||
<el-table-column prop="storagevehicle_code" label="移出载具号" :min-width="flexWidth('storagevehicle_code',crud.data,'移出载具号')" />
|
||||
<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_code2" label="移入载具号" :min-width="flexWidth('storagevehicle_code2',crud.data,'移入载具号')" />
|
||||
<el-table-column prop="turnin_sect_name" label="移入库区" :min-width="flexWidth('turnin_sect_name',crud.data,'移入库区')" />
|
||||
<el-table-column prop="turnin_struct_code" label="移入货位" :min-width="flexWidth('turnin_struct_code',crud.data,'移入货位')" align="center">
|
||||
<template scope="scope">
|
||||
@@ -176,6 +173,7 @@
|
||||
<span v-show="scope.row.edit">{{ scope.row.turnin_struct_code }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="crud.status.view > 0" prop="task_code" label="任务编码" :min-width="flexWidth('task_code',crud.data,'任务编码')" />
|
||||
<el-table-column v-if="crud.status.cu > 0" align="center" width="160" label="操作" fixed="right">
|
||||
<template scope="scope">
|
||||
<el-button
|
||||
@@ -207,7 +205,7 @@
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<AddDtl :dialog-show.sync="dtlShow" :sect-list="sectList" :stor-id="storId" @tableChanged="tableChanged" />
|
||||
<StructDiv ref="child" :stor-id="storId" :dialog-show.sync="structShow" @tableChanged="structChanged" />
|
||||
<StructDiv ref="child" :stor-id="storId" :default-list="defaultList" :not-point="not_point" :dialog-show.sync="structShow" @tableChanged="structChanged" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
@@ -227,7 +225,7 @@ const defaultForm = {
|
||||
bill_status: '10',
|
||||
total_qty: '0',
|
||||
detail_count: '0',
|
||||
bill_type: '29',
|
||||
bill_type: '2001',
|
||||
remark: '',
|
||||
biz_date: new Date(),
|
||||
create_mode: '',
|
||||
@@ -251,11 +249,13 @@ export default {
|
||||
structShow: false,
|
||||
structShow2: false,
|
||||
flagnow: false,
|
||||
not_point: null,
|
||||
nowrow: {},
|
||||
storId: null,
|
||||
nowindex: '',
|
||||
storlist: [],
|
||||
sectList: [],
|
||||
defaultList: [],
|
||||
invtypelist: [],
|
||||
rules: {
|
||||
stor_id: [
|
||||
@@ -334,6 +334,9 @@ export default {
|
||||
this.$refs.child.getMsg(false)
|
||||
this.nowindex = index
|
||||
this.nowrow = row
|
||||
this.not_point = row.struct_id
|
||||
this.defaultList.push(row.stor_id)
|
||||
this.defaultList.push(row.sect_id)
|
||||
},
|
||||
tableChanged(rows) {
|
||||
const tablemap = new Map()
|
||||
@@ -385,6 +388,7 @@ export default {
|
||||
this.form.tableData[i].turnin_sect_id = row.sect_id
|
||||
this.form.tableData[i].turnin_sect_code = row.sect_code
|
||||
this.form.tableData[i].turnin_sect_name = row.sect_name
|
||||
this.form.tableData[i].storagevehicle_code2 = row.storagevehicle_code
|
||||
this.form.tableData.splice(i, 1, this.form.tableData[i]) // 通过splice 替换数据 触发视图更新
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
title="库存物料选择"
|
||||
title="库存载具选择"
|
||||
append-to-body
|
||||
:visible.sync="dialogVisible"
|
||||
destroy-on-close
|
||||
@@ -38,23 +38,12 @@
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="物料编码">
|
||||
<el-form-item label="载具编码">
|
||||
<el-input
|
||||
v-model="query.material_code"
|
||||
v-model="query.storagevehicle_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.pcsn"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="批次"
|
||||
placeholder="载具"
|
||||
style="width: 200px;"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
@@ -75,12 +64,12 @@
|
||||
<el-table-column type="selection" width="55" />
|
||||
<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="qty_unit_name" label="重量单位" :min-width="flexWidth('qty_unit_name',crud.data,'重量单位')" />
|
||||
<el-table-column prop="storagevehicle_code" label="载具编码" :min-width="flexWidth('storagevehicle_code',crud.data,'载具编码')">
|
||||
<template slot-scope="scope">
|
||||
<el-link type="warning" @click="toView(scope.$index, scope.row)">{{ scope.row.storagevehicle_code }}</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="is_emptyvehicle" label="是否空载具" :formatter="isEmpVehihcle" :min-width="flexWidth('is_emptyvehicle',crud.data,'是否空载具')" />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
@@ -88,6 +77,7 @@
|
||||
<el-button slot="left" type="info" @click="dialogVisible = false">关闭</el-button>
|
||||
<el-button slot="left" type="primary" @click="submit">保存</el-button>
|
||||
</span>
|
||||
<ViewMaterDialog :dialog-show.sync="viewMaterDialog" :open-param="viewMaterParam" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
@@ -97,10 +87,11 @@ import CRUD, { header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import crudSectattr from '@/views/wms/basedata/sectattr/sectattr'
|
||||
import ViewMaterDialog from '@/views/wms/st/movebill/ViewMaterDialog'
|
||||
|
||||
export default {
|
||||
name: 'AddDtl',
|
||||
components: { rrOperation, pagination },
|
||||
components: { rrOperation, pagination, ViewMaterDialog },
|
||||
cruds() {
|
||||
return CRUD({ title: '用户', idField: 'storagevehicleext_id', url: 'api/moveStor/getCanuseIvt',
|
||||
query: {
|
||||
@@ -138,6 +129,8 @@ export default {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
opendtlParam: '',
|
||||
viewMaterDialog: false,
|
||||
viewMaterParam: null,
|
||||
sects: [],
|
||||
rows: [],
|
||||
defaultList: []
|
||||
@@ -177,11 +170,9 @@ export default {
|
||||
this.crud.resetQuery(false)
|
||||
this.$emit('update:dialogShow', false)
|
||||
},
|
||||
ivt_levelFormat(row, column) {
|
||||
return this.dict.label.ST_IVT_LEVEL[row.ivt_level]
|
||||
},
|
||||
is_activeFormat(row, column) {
|
||||
return this.dict.label.is_usable[row.is_active]
|
||||
toView(index, row) {
|
||||
this.viewMaterParam = row
|
||||
this.viewMaterDialog = true
|
||||
},
|
||||
sectQueryChange(val) {
|
||||
if (val.length === 1) {
|
||||
@@ -207,6 +198,13 @@ export default {
|
||||
this.$emit('update:dialogShow', false)
|
||||
this.$emit('tableChanged', this.rows)
|
||||
this.crud.resetQuery(false)
|
||||
},
|
||||
isEmpVehihcle(row) {
|
||||
if (row.is_emptyvehicle === '1') {
|
||||
return '是'
|
||||
} else {
|
||||
return '否'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
129
wms/nladmin-ui/src/views/wms/st/movebill/ViewMaterDialog.vue
Normal file
129
wms/nladmin-ui/src/views/wms/st/movebill/ViewMaterDialog.vue
Normal file
@@ -0,0 +1,129 @@
|
||||
<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.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.qty_unit_name" disabled size="mini" style="width: 200px" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="22">
|
||||
<el-col :span="22" style="border: 1px solid white">
|
||||
<span />
|
||||
</el-col>
|
||||
<el-col :span="2">
|
||||
<el-button icon="el-icon-close" size="mini" type="info" @click="close">关闭</el-button>
|
||||
</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 } from '@crud/crud'
|
||||
|
||||
export default {
|
||||
name: 'ViewMaterDialog',
|
||||
mixins: [crud()],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
openParam: {
|
||||
type: Object
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue, oldValue) {
|
||||
this.dialogVisible = newValue
|
||||
this.formMst = this.openParam
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
formMst: {
|
||||
},
|
||||
dialogVisible: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleClose(done) {
|
||||
this.$confirm('确认关闭?')
|
||||
.then(_ => {
|
||||
done()
|
||||
})
|
||||
.catch(_ => {
|
||||
})
|
||||
},
|
||||
close() {
|
||||
this.$refs['form2'].resetFields()
|
||||
this.$emit('update:dialogShow', false)
|
||||
}
|
||||
}
|
||||
}
|
||||
</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>
|
||||
@@ -117,6 +117,17 @@
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission">
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="success"
|
||||
icon="el-icon-position"
|
||||
size="mini"
|
||||
:disabled="confirm_flag"
|
||||
@click="sendTask"
|
||||
>
|
||||
任务下发
|
||||
</el-button>
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
@@ -326,6 +337,12 @@ export default {
|
||||
this.querytable()
|
||||
})
|
||||
},
|
||||
sendTask() {
|
||||
movestor.sendTask({ 'moveinv_id': this.currentRow.moveinv_id }).then(res => {
|
||||
this.crud.notify('任务下发成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.querytable()
|
||||
})
|
||||
},
|
||||
querytable() {
|
||||
this.onSelectAll()
|
||||
this.crud.toQuery()
|
||||
|
||||
@@ -40,4 +40,12 @@ export function confirm(data) {
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, getMoveDtl, confirm }
|
||||
export function sendTask(data) {
|
||||
return request({
|
||||
url: '/api/moveStor/sendTask',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, getMoveDtl, confirm, sendTask }
|
||||
|
||||
@@ -90,6 +90,9 @@
|
||||
<el-table-column prop="canuse_qty" label="可用数" :formatter="crud.formatNum3" :min-width="100" />
|
||||
<el-table-column prop="frozen_qty" label="冻结数" :formatter="crud.formatNum3" :min-width="100" />
|
||||
<el-table-column prop="qty_unit_name" label="计量单位" :min-width="flexWidth('qty_unit_name',crud.data,'计量单位')" />
|
||||
<el-table-column prop="produce_time" label="生产日期" :min-width="flexWidth('produce_time',crud.data,'生产日期')" />
|
||||
<el-table-column prop="quality_time" label="有效日期" :min-width="flexWidth('quality_time',crud.data,'有效日期')" />
|
||||
<el-table-column prop="bake_num" label="烘干次数" :min-width="flexWidth('bake_num',crud.data,'烘干次数')" />
|
||||
<el-table-column prop="remark" label="备注" :min-width="flexWidth('remark',crud.data,'备注')" />
|
||||
<el-table-column prop="insert_time" label="入库时间" :min-width="flexWidth('insert_time',crud.data,'入库时间')" />
|
||||
</el-table>
|
||||
|
||||
@@ -62,4 +62,12 @@ export function excelImport(data) {
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, getStruct, getStructById, getUnits, save, excelImport }
|
||||
export function statusChange(data) {
|
||||
return request({
|
||||
url: 'api/structivt/statusChange',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, getStruct, getStructById, getUnits, save, excelImport, statusChange }
|
||||
|
||||
Reference in New Issue
Block a user