add:成品移库功能

This commit is contained in:
zhangzhiqiang
2023-09-12 15:22:09 +08:00
parent 9ec53a5ba0
commit 17c1c99928
24 changed files with 530 additions and 363 deletions

View File

@@ -32,21 +32,24 @@ public enum AcsTaskEnum {
TASK_PLOTTER_EMPTY("6","刻字机-呼叫空框"),//判断是否铁料框(否的话: 不处理人工处理跟acs反馈sucess):一体机加一个呼叫空框请求功能 TASK_PLOTTER_EMPTY("6","刻字机-呼叫空框"),//判断是否铁料框(否的话: 不处理人工处理跟acs反馈sucess):一体机加一个呼叫空框请求功能
TASK_WARP_MAC("7","包装机-叫料出库"), TASK_WARP_MAC("7","包装机-叫料出库"),
TASK_WARP_EMPTY("8","包装机-送空框"), TASK_WARP_EMPTY("8","包装机-送空框"),
TASK_STRUCT_IN("9","入库-半成品-生产入库"), TASK_STRUCT_IN("9","入库-半成品-生产入库"),
TASK_STRUCT_OUT("10","出库-半成品-生产出库"), TASK_STRUCT_OUT("10","出库-半成品-生产出库"),
TASK_STRUCT_CP_IN("11","入库-成品-生产入库"),
TASK_STRUCT_CP_OUT("12","出库-成品-生产出库"),
TASK_STRUCT_CP_CHECK("13","成品-盘点"),
TASK_STRUCT_CHECK("14","半成品-盘点"), TASK_STRUCT_CHECK("14","半成品-盘点"),
TASK_STRUCT_SHUT("15","半成品-拼盘任务出"), TASK_STRUCT_SHUT("15","半成品-拼盘任务出"),
TASK_STRUCT_SHUT_IN("16","半成品-拼盘任务入"), TASK_STRUCT_SHUT_IN("16","半成品-拼盘任务入"),
TASK_STRUCT_BCP_EMPOUT("17","半成品-空托盘出库"), TASK_STRUCT_BCP_EMPOUT("17","半成品-空托盘出库"),
TASK_STRUCT_CP_IN("11","入库-成品-生产入"), TASK_STRUCT_CP_MOVE("18","成品-移"),
TASK_STRUCT_CP_OUT("12","出库-成品-生产出"), TASK_STRUCT_BCP_MOVE("19","半成品-移"),
TASK_STRUCT_HR_IN("26","入库-海柔半成品-生产入库"), TASK_STRUCT_HR_IN("26","入库-海柔半成品-生产入库"),
TASK_STRUCT_HR_OUT("27","出库-海柔半成品-生产出库"), TASK_STRUCT_HR_OUT("27","出库-海柔半成品-生产出库"),
TASK_STRUCT_HR_CHECK("28","海柔半成品-盘点"), TASK_STRUCT_HR_CHECK("28","海柔半成品-盘点"),
TASK_STRUCT_HR_EMP_IN("29","入库-海柔半成品-空托盘"), TASK_STRUCT_HR_EMP_IN("29","入库-海柔半成品-空托盘"),
TASK_STRUCT_HR_EMP_OUT("30","出库-海柔半成品-空托盘"), TASK_STRUCT_HR_EMP_OUT("30","出库-海柔半成品-空托盘"),
TASK_STRUCT_CP_CHECK("13","成品-盘点"),
TASK_STRUCT_CP_MOVE("14","成品-移库"),
TASK_WASH_SEND_MATERIAL("20","清洗机-上料请求"), TASK_WASH_SEND_MATERIAL("20","清洗机-上料请求"),
TASK_WASH_EMP("21","清洗机-空框请求"), TASK_WASH_EMP("21","清洗机-空框请求"),
TASK_WASH_FULL_AUTO("22","清洗机-满料请求自动"),//去半成品入库:参数不全也去异常处理位 TASK_WASH_FULL_AUTO("22","清洗机-满料请求自动"),//去半成品入库:参数不全也去异常处理位

View File

@@ -3,9 +3,11 @@ package org.nl.common.enums;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import lombok.Getter; import lombok.Getter;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.formula.functions.T;
import org.nl.common.domain.query.LConsumer; import org.nl.common.domain.query.LConsumer;
import java.util.Collection; import java.util.Collection;
import java.util.function.Consumer;
/* /*
* @author ZZQ * @author ZZQ
@@ -28,18 +30,20 @@ public enum QueryTEnum {
}); });
}), }),
LE((q, k, v) -> { q.le(k[0],v); }), LE((q, k, v) -> { q.le(k[0],v); }),
BY((q, k, v) -> { q.orderByDesc(k[0],v); }), BY((q, k, v) -> { q.orderByDesc(k[0],String.valueOf(v)); }),
NO((q, k, v) -> { q.isNull(k[0]); }), NO((q, k, v) -> { q.isNull(k[0]); }),
NULL_OR_EMPTY((queryWrapper, k, v) -> { queryWrapper.nested(a->a.isNull(k[0]).or().eq(k[0],"")); }),
LT((q, k, v) -> { q.lt(k[0],v); }), LT((q, k, v) -> { q.lt(k[0],v); }),
OREQ((q, k, v) -> { if (StringUtils.isBlank((String)v)){ q.isNull(k[0]); }else { q.eq(k[0],v); } }); OREQ((q, k, v) -> { if (StringUtils.isBlank((String)v)){ q.isNull(k[0]); }else { q.eq(k[0],v); } });
private LConsumer<QueryWrapper,String[], Object> doP; private LConsumer<QueryWrapper<T>,String[], Object> doP;
QueryTEnum(LConsumer<QueryWrapper,String[], Object> doP) { QueryTEnum(LConsumer<QueryWrapper<T>,String[], Object> doP) {
this.doP = doP; this.doP = doP;
} }
public static void build(QueryTEnum type, QueryWrapper q, String[] k , Object v){ public static void build(QueryTEnum type, QueryWrapper q, String[] k , Object v){
type.getDoP().accept(q,k,v); type.getDoP().accept(q,k,v);
} }
} }

View File

@@ -2,6 +2,7 @@ package org.nl.wms.masterdata_manage.storage.service.storage.dto;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import lombok.Data; import lombok.Data;
import org.apache.commons.lang3.StringUtils;
import org.nl.common.domain.query.BaseQuery; import org.nl.common.domain.query.BaseQuery;
import org.nl.common.domain.query.QParam; import org.nl.common.domain.query.QParam;
import org.nl.common.enums.QueryTEnum; import org.nl.common.enums.QueryTEnum;
@@ -23,10 +24,13 @@ public class StructarrQuery extends BaseQuery<StIvtStructattr> {
private String sect_id; private String sect_id;
private String struct_code; private String struct_code;
private String lock_type; private String lock_type;
private Boolean is_used;
private Boolean emptyvehicle;
private String blurry; private String blurry;
@Override @Override
public void paramMapping() { public void paramMapping() {
super.doP.put("blurry", QParam.builder().k(new String[]{"struct_code"}).type(QueryTEnum.LK).build()); super.doP.put("blurry", QParam.builder().k(new String[]{"struct_code"}).type(QueryTEnum.LK).build());
super.doP.put("emptyvehicle", QParam.builder().k(new String[]{"storagevehicle_code"}).type(QueryTEnum.NULL_OR_EMPTY).build());
} }
} }

View File

@@ -16,7 +16,7 @@ public enum TaskStatusEnum {
private String name; private String name;
private String code; private String code;
private TaskStatusEnum(String code, String name) { TaskStatusEnum(String code, String name) {
this.code = code; this.code = code;
this.name = name; this.name = name;
} }

View File

@@ -115,7 +115,7 @@ public class SchBaseTaskServiceImpl extends ServiceImpl<SchBaseTaskMapper, SchBa
acsToWmsService.receiveTaskStatusAcs(JSON.toJSONString(finish)); acsToWmsService.receiveTaskStatusAcs(JSON.toJSONString(finish));
break; break;
case "cancel": case "cancel":
if (taskObj.getTask_status().equals(StatusEnum.TASK_RUNNING.getCode())||taskObj.getTask_status().equals(StatusEnum.TASK_PUBLISH.getCode())){ if (taskObj.getTask_status().equals(StatusEnum.TASK_RUNNING.getCode())){
JSONArray cancel = new JSONArray(); JSONArray cancel = new JSONArray();
JSONObject res2 = new JSONObject(); JSONObject res2 = new JSONObject();
res2.put("task_id", task_id); res2.put("task_id", task_id);

View File

@@ -16,7 +16,7 @@ import java.util.Map;
@Getter @Getter
public enum IOSEnum { public enum IOSEnum {
//出入库类型 //出入库类型
IO_TYPE(MapOf.of("入库", "0", "出库", "1")), IO_TYPE(MapOf.of("入库", "0", "出库", "1","移库", "2")),
//是否 //是否
IS_USED(MapOf.of("", "1", "", "0")), IS_USED(MapOf.of("", "1", "", "0")),
//仓库编码 //仓库编码

View File

@@ -40,14 +40,14 @@ public class StIvtMoveinvCpController {
@GetMapping @GetMapping
@Log("查询盘点单主表") @Log("查询移库主表")
//("查询盘点单主表") //("查询盘点单主表")
public ResponseEntity<Object> query(MoveInvQuery query, PageQuery page) { public ResponseEntity<Object> query(MoveInvQuery query, PageQuery page) {
return new ResponseEntity<>(TableDataInfo.build(moveinvcpService.page(page.build(StIvtMoveinvCp.class),query.build())), HttpStatus.OK); return new ResponseEntity<>(TableDataInfo.build(moveinvcpService.page(page.build(StIvtMoveinvCp.class),query.build())), HttpStatus.OK);
} }
@PostMapping @PostMapping
@Log("创建盘点") @Log("创建移库")
//("创建盘点单") //("创建盘点单")
public ResponseEntity<Object> create(@RequestBody JSONObject whereJson) { public ResponseEntity<Object> create(@RequestBody JSONObject whereJson) {
moveinvcpService.create(whereJson); moveinvcpService.create(whereJson);
@@ -67,5 +67,13 @@ public class StIvtMoveinvCpController {
moveinvcpService.update(whereJson); moveinvcpService.update(whereJson);
return new ResponseEntity<>(TableDataInfo.build(),HttpStatus.OK); return new ResponseEntity<>(TableDataInfo.build(),HttpStatus.OK);
} }
@PostMapping("/cancel")
@Log("取消单据")
//("查询盘点明细")
public ResponseEntity<Object> cancel(@RequestBody JSONObject whereJson) {
moveinvcpService.cancel(whereJson);
return new ResponseEntity<>(TableDataInfo.build(),HttpStatus.OK);
}
} }

View File

@@ -28,7 +28,7 @@ import java.util.function.Consumer;
* @since 2023-05-04 * @since 2023-05-04
*/ */
@RestController @RestController
@RequestMapping("/stIvtMoveinvdtlCp") @RequestMapping("api/stIvtMoveinvdtlCp")
public class StIvtMoveinvdtlCpController { public class StIvtMoveinvdtlCpController {

View File

@@ -25,6 +25,8 @@ public interface IStIvtMoveinvCpService extends IService<StIvtMoveinvCp> {
*/ */
void update(JSONObject form); void update(JSONObject form);
void cancel(JSONObject form);
/** /**
* 任务回调处理 * 任务回调处理
* @param form * @param form

View File

@@ -118,7 +118,7 @@ public class StIvtMoveinvCp implements Serializable {
/** /**
* 修改时间 * 修改时间
*/ */
private LocalDateTime update_time; private String update_time;
/** /**
* 是否删除 * 是否删除

View File

@@ -9,6 +9,7 @@ import com.alibaba.fastjson.serializer.SerializerFeature;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.commons.lang3.StringUtils;
import org.nl.common.enums.AcsTaskEnum; import org.nl.common.enums.AcsTaskEnum;
import org.nl.common.utils.IdUtil; import org.nl.common.utils.IdUtil;
import org.nl.common.utils.MapOf; import org.nl.common.utils.MapOf;
@@ -17,6 +18,8 @@ import org.nl.modules.common.exception.BadRequestException;
import org.nl.modules.system.util.CodeUtil; import org.nl.modules.system.util.CodeUtil;
import org.nl.wms.masterdata_manage.storage.service.storage.IStIvtStructattrService; import org.nl.wms.masterdata_manage.storage.service.storage.IStIvtStructattrService;
import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtStructattr; import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtStructattr;
import org.nl.wms.mps_manage.saleorder.service.IMpsSaleOrderService;
import org.nl.wms.mps_manage.saleorder.service.dao.MpsSaleOrder;
import org.nl.wms.scheduler_manage.service.extendtask.manage.TaskStatusEnum; import org.nl.wms.scheduler_manage.service.extendtask.manage.TaskStatusEnum;
import org.nl.wms.scheduler_manage.service.task.dao.SchBaseTask; import org.nl.wms.scheduler_manage.service.task.dao.SchBaseTask;
import org.nl.wms.storage_manage.CHECKEnum; import org.nl.wms.storage_manage.CHECKEnum;
@@ -36,11 +39,10 @@ import org.nl.wms.storage_manage.productmanage.util.ChangeIvtUtil;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList; import java.util.*;
import java.util.HashSet; import java.util.stream.Collectors;
import java.util.List;
import java.util.Set;
/** /**
* <p> * <p>
@@ -68,7 +70,6 @@ public class StIvtMoveinvCpServiceImpl extends ServiceImpl<StIvtMoveinvCpMapper,
public void create(JSONObject form) { public void create(JSONObject form) {
JSONArray rows = form.getJSONArray("tableData"); JSONArray rows = form.getJSONArray("tableData");
if (ObjectUtil.isEmpty(rows)) throw new BadRequestException("请求参数不能为空"); if (ObjectUtil.isEmpty(rows)) throw new BadRequestException("请求参数不能为空");
// 调用主表 插入/更新方法 // 调用主表 插入/更新方法
StIvtMoveinvCp mst = new StIvtMoveinvCp(); StIvtMoveinvCp mst = new StIvtMoveinvCp();
// 新增 // 新增
@@ -90,14 +91,20 @@ public class StIvtMoveinvCpServiceImpl extends ServiceImpl<StIvtMoveinvCpMapper,
mst.setRemark(form.getString("remark")); mst.setRemark(form.getString("remark"));
//调用明细表 插入方法 //调用明细表 插入方法
List<StIvtMoveinvdtlCp> itemList = new ArrayList<>(); List<StIvtMoveinvdtlCp> itemList = new ArrayList<>();
Set<String> lockStructList = new HashSet<>(); Set<String> lockInStructList = new HashSet<>();
Set<String> lockOutStructList = new HashSet<>();
for (int i = 0; i < rows.size(); i++) { for (int i = 0; i < rows.size(); i++) {
JSONObject item = rows.getJSONObject(i); JSONObject item = rows.getJSONObject(i);
if (StringUtils.isEmpty(item.getString("turnin_struct_id"))){
throw new BadRequestException("移入货位没有配置齐全");
}
StIvtMoveinvdtlCp moveinvdtlCp = new StIvtMoveinvdtlCp(); StIvtMoveinvdtlCp moveinvdtlCp = new StIvtMoveinvdtlCp();
moveinvdtlCp.setMoveinv_id(mst.getMoveinv_id()); moveinvdtlCp.setMoveinv_id(mst.getMoveinv_id());
moveinvdtlCp.setMoveinvdtl_id(IdUtil.getStringId()); moveinvdtlCp.setMoveinvdtl_id(IdUtil.getStringId());
moveinvdtlCp.setSeq_no(i+1); moveinvdtlCp.setSeq_no(i+1);
moveinvdtlCp.setBill_status(mst.getBill_status()); moveinvdtlCp.setBill_status(mst.getBill_status());
moveinvdtlCp.setSource_billdtl_id(item.getString("sale_id"));
moveinvdtlCp.setSale_id(item.getString("sale_id"));
material: { material: {
moveinvdtlCp.setIs_active(true); moveinvdtlCp.setIs_active(true);
moveinvdtlCp.setIvt_level(IVTEnum.IVT_LEVEL.code("一级")); moveinvdtlCp.setIvt_level(IVTEnum.IVT_LEVEL.code("一级"));
@@ -128,19 +135,20 @@ public class StIvtMoveinvCpServiceImpl extends ServiceImpl<StIvtMoveinvCpMapper,
moveinvdtlCp.setTurnout_struct_id(item.getString("struct_id")); moveinvdtlCp.setTurnout_struct_id(item.getString("struct_id"));
} }
itemList.add(moveinvdtlCp); itemList.add(moveinvdtlCp);
lockStructList.add(moveinvdtlCp.getTurnin_struct_code()); lockInStructList.add(moveinvdtlCp.getTurnin_struct_code());
lockStructList.add(moveinvdtlCp.getTurnout_struct_code()); lockOutStructList.add(moveinvdtlCp.getTurnout_struct_code());
} }
if (lockStructList.size()<rows.size()*2){ if (lockInStructList.size()!=lockOutStructList.size()){
throw new BadRequestException("不允许选择相同货位进行分配"); throw new BadRequestException("不允许选择相同货位进行分配");
} }
this.save(mst); this.save(mst);
moveinvdtlCpService.saveBatch(itemList); moveinvdtlCpService.saveBatch(itemList);
lockInStructList.addAll(lockOutStructList);
structattrService.update( structattrService.update(
new UpdateWrapper<StIvtStructattr>().lambda() new UpdateWrapper<StIvtStructattr>().lambda()
.set(StIvtStructattr::getLock_type, IOSEnum.LOCK_TYPE.code("移库锁")) .set(StIvtStructattr::getLock_type, IOSEnum.LOCK_TYPE.code("移库锁"))
.set(StIvtStructattr::getInv_code,mst.getBill_code()) .set(StIvtStructattr::getInv_code,mst.getBill_code())
.in(StIvtStructattr::getStruct_code, lockStructList) .in(StIvtStructattr::getStruct_code, lockInStructList)
); );
} }
@@ -164,7 +172,8 @@ public class StIvtMoveinvCpServiceImpl extends ServiceImpl<StIvtMoveinvCpMapper,
.in(StIvtStructattr::getStruct_code, unLockStructList) .in(StIvtStructattr::getStruct_code, unLockStructList)
); );
List<StIvtMoveinvdtlCp> itemList = new ArrayList<>(); List<StIvtMoveinvdtlCp> itemList = new ArrayList<>();
Set<String> lockStructList = new HashSet<>(); Set<String> lockOutStructList = new HashSet<>();
Set<String> lockInStructList = new HashSet<>();
for (int i = 0; i < rows.size(); i++) { for (int i = 0; i < rows.size(); i++) {
JSONObject item = rows.getJSONObject(i); JSONObject item = rows.getJSONObject(i);
StIvtMoveinvdtlCp moveinvdtlCp = JSONObject.parseObject(JSON.toJSONString(item), StIvtMoveinvdtlCp.class); StIvtMoveinvdtlCp moveinvdtlCp = JSONObject.parseObject(JSON.toJSONString(item), StIvtMoveinvdtlCp.class);
@@ -174,101 +183,163 @@ public class StIvtMoveinvCpServiceImpl extends ServiceImpl<StIvtMoveinvCpMapper,
moveinvdtlCp.setTurnout_struct_id(item.getString("struct_id")); moveinvdtlCp.setTurnout_struct_id(item.getString("struct_id"));
} }
itemList.add(moveinvdtlCp); itemList.add(moveinvdtlCp);
lockStructList.add(moveinvdtlCp.getTurnin_struct_code()); lockInStructList.add(moveinvdtlCp.getTurnin_struct_code());
lockStructList.add(moveinvdtlCp.getTurnout_struct_code()); lockOutStructList.add(moveinvdtlCp.getTurnout_struct_code());
} }
if (lockStructList.size()<rows.size()*2){ if (lockOutStructList.size()!=lockInStructList.size()){
throw new BadRequestException("不允许选择相同货位进行分配"); throw new BadRequestException("不允许选择相同货位进行分配");
} }
lockInStructList.addAll(lockOutStructList);
//校验点位有没有锁定
List<StIvtStructattr> list = structattrService.list(new QueryWrapper<StIvtStructattr>()
.in("struct_code", lockInStructList)
.nested(i -> i.eq("is_used", false)
.or()
.gt("lock_type", IOSEnum.LOCK_TYPE.code("未锁定"))));
if (!CollectionUtils.isEmpty(list)){
throw new BadRequestException("选择点位已经锁定禁用:"+list.stream().map(StIvtStructattr::getStruct_code).collect(Collectors.joining(",")));
}
moveinvdtlCpService.updateBatchById(itemList); moveinvdtlCpService.updateBatchById(itemList);
structattrService.update( structattrService.update(
new UpdateWrapper<StIvtStructattr>().lambda() new UpdateWrapper<StIvtStructattr>().lambda()
.set(StIvtStructattr::getLock_type, IOSEnum.LOCK_TYPE.code("移库锁")) .set(StIvtStructattr::getLock_type, IOSEnum.LOCK_TYPE.code("移库锁"))
.set(StIvtStructattr::getInv_code,form.getString("bill_code")) .set(StIvtStructattr::getInv_code,form.getString("bill_code"))
.in(StIvtStructattr::getStruct_code, lockStructList) .in(StIvtStructattr::getStruct_code, lockInStructList)
); );
} }
@Override
@Transactional
public void cancel(JSONObject form) {
List<StIvtMoveinvdtlCp> dtlList = moveinvdtlCpService.list(new QueryWrapper<StIvtMoveinvdtlCp>().eq("moveinv_id", form.getString("moveinv_id")));
//调用明细表 插入方法
Set<String> unLockStructList = new HashSet<>();
for (StIvtMoveinvdtlCp cp : dtlList) {
if (cp.getBill_status().equals(MoveInvEnum.BILL_STATUS.code("完成"))||cp.getBill_status().equals(MoveInvEnum.BILL_STATUS.code("移库中"))){
throw new BadRequestException("存在已完成明细不允许直接取消单据");
}
unLockStructList.add(cp.getTurnin_struct_code());
unLockStructList.add(cp.getTurnout_struct_code());
}
structattrService.update(
new UpdateWrapper<StIvtStructattr>().lambda()
.set(StIvtStructattr::getLock_type, IOSEnum.LOCK_TYPE.code("未锁定"))
.set(StIvtStructattr::getInv_code,"")
.in(StIvtStructattr::getStruct_code, unLockStructList)
);
moveinvdtlCpService.update(new UpdateWrapper<StIvtMoveinvdtlCp>()
.set("bill_status",MoveInvEnum.BILL_STATUS.code("取消"))
.set("task_id","").eq("moveinv_id", form.getString("moveinv_id")));
this.update(new UpdateWrapper<StIvtMoveinvCp>()
.set("bill_status",MoveInvEnum.BILL_STATUS.code("取消"))
.set("update_name",SecurityUtils.getCurrentUsername())
.set("update_id",SecurityUtils.getCurrentUserId())
.set("update_time",DateUtil.now())
.eq("moveinv_id", form.getString("moveinv_id")));
}
@Override @Override
public void taskOperate(JSONObject form) { public void taskOperate(JSONObject form) {
String task_id = form.getString("task_id"); AcsTaskEnum status = AcsTaskEnum.getType(form.getString("status"),"status_");
String status = form.getString("status"); List<StIvtMoveinvdtlCp> dtls = moveinvdtlCpService.list(new QueryWrapper<StIvtMoveinvdtlCp>()
StIvtMoveinvdtlCp dtl = moveinvdtlCpService.getOne(new QueryWrapper<StIvtMoveinvdtlCp>().eq("task_id", task_id)); .eq("task_id", form.getString("task_id")));
StIvtMoveinvCp mst = this.getById(dtl.getMoveinv_id()); if (CollectionUtils.isEmpty(dtls)){
if (status.equals(AcsTaskEnum.STATUS_FINISH.getCode())) { return;
}
moveinvdtlCpService.update(new UpdateWrapper<StIvtMoveinvdtlCp>() StIvtMoveinvCp mst = this.getById(dtls.get(0).getMoveinv_id());
.set("bill_status",MoveInvEnum.BILL_STATUS.code("完成")).eq("moveinvdtl_id",dtl.getMoveinvdtl_id())); switch (status){
List<StIvtMoveinvdtlCp> list = moveinvdtlCpService.list(new QueryWrapper<StIvtMoveinvdtlCp>() case STATUS_START:
.eq("moveinv_id", dtl.getMoveinv_id()) mst.setBill_status(MoveInvEnum.BILL_STATUS.code("移库中"));
.ne("bill_status", MoveInvEnum.BILL_STATUS.code("完成"))); mst.setUpdate_time(DateUtil.now());
if (list.size() == 0) { mst.setUpdate_name("acs");
this.update(new UpdateWrapper<StIvtMoveinvCp>() this.updateById(mst);
.set("bill_status",MoveInvEnum.BILL_STATUS.code("完成")) break;
.eq("moveinv_id",dtl.getMoveinv_id())); case STATUS_FINISH:
} StIvtStructattr one = structattrService.getOne(new QueryWrapper<StIvtStructattr>()
//减出库。加入库 .eq("struct_id", dtls.get(0).getTurnin_struct_id())
JSONObject ivtOutParam = new JSONObject(); .eq("storagevehicle_code", dtls.get(0).getStoragevehicle_code()));
ivtOutParam.put("struct_id", dtl.getTurnout_struct_id()); if (one==null){
ivtOutParam.put("material_id", dtl.getMaterial_id()); for (StIvtMoveinvdtlCp dtl : dtls) {
ivtOutParam.put("pcsn", dtl.getPcsn()); if (!dtl.getBill_status().equals(MoveInvEnum.BILL_STATUS.code("完成"))){
ivtOutParam.put("quality_scode", dtl.getQuality_scode()); //减出库。加入库
ivtOutParam.put("ivt_level", dtl.getIvt_level()); JSONObject ivtOutParam = new JSONObject();
ivtOutParam.put("change_qty", dtl.getQty()); ivtOutParam.put("struct_id", dtl.getTurnout_struct_id());
ivtOutParam.put("change_type", ChangeIvtUtil.SUB_SUBIVT_QTY); ivtOutParam.put("material_id", dtl.getMaterial_id());
ivtOutParam.put("sale_id", dtl.getSale_id()); ivtOutParam.put("pcsn", dtl.getPcsn());
ivtOutParam.put("bill_code",mst.getBill_code()); ivtOutParam.put("quality_scode", dtl.getQuality_scode());
ivtOutParam.put("inv_id",mst.getMoveinv_id()); ivtOutParam.put("ivt_level", dtl.getIvt_level());
ivtOutParam.put("bill_type_scode",mst.getBill_type()); ivtOutParam.put("change_qty", dtl.getQty());
iStIvtStructivtCpService.UpdateIvt(ivtOutParam); ivtOutParam.put("change_type", ChangeIvtUtil.SUB_SUBIVT_QTY);
// 解锁仓位 ivtOutParam.put("sale_id", dtl.getSale_id());
structattrService.update( ivtOutParam.put("bill_code",mst.getBill_code());
new StIvtStructattr() ivtOutParam.put("inv_id",mst.getMoveinv_id());
.setLock_type(IOSEnum.LOCK_TYPE.code("未锁定")) ivtOutParam.put("bill_type_scode",mst.getBill_type());
.setInv_id("") iStIvtStructivtCpService.UpdateIvt(ivtOutParam);
.setInv_type("") //加入库
.setInv_code(""), JSONObject ivtInParam = new JSONObject();
new QueryWrapper<StIvtStructattr>().lambda() ivtInParam.put("struct_id", dtl.getTurnin_struct_id());
.eq(StIvtStructattr::getStruct_id, dtl.getTurnout_struct_id()) ivtInParam.put("material_id", dtl.getMaterial_id());
); ivtInParam.put("pcsn", dtl.getPcsn());
//加入库 ivtInParam.put("quality_scode", dtl.getQuality_scode());
JSONObject ivtInParam = new JSONObject(); ivtInParam.put("ivt_level", dtl.getIvt_level());
ivtInParam.put("struct_id", dtl.getTurnin_struct_id()); ivtInParam.put("change_qty", dtl.getQty());
ivtInParam.put("material_id", dtl.getMaterial_id()); ivtInParam.put("change_type", ChangeIvtUtil.ADD_SUBIVT_QTY);
ivtInParam.put("pcsn", dtl.getPcsn()); ivtInParam.put("sale_id", dtl.getSale_id());
ivtInParam.put("quality_scode", dtl.getQuality_scode()); ivtInParam.put("bill_code",mst.getBill_code());
ivtInParam.put("ivt_level", dtl.getIvt_level()); ivtInParam.put("inv_id",mst.getMoveinv_id());
ivtInParam.put("change_qty", dtl.getQty()); ivtInParam.put("bill_type_scode",mst.getBill_type());
ivtInParam.put("change_type", ChangeIvtUtil.ADD_SUBIVT_QTY); iStIvtStructivtCpService.UpdateIvt(ivtInParam);
ivtInParam.put("sale_id", dtl.getSale_id()); }
ivtInParam.put("bill_code",mst.getBill_code()); }
ivtInParam.put("inv_id",mst.getMoveinv_id()); // 解锁仓位
ivtInParam.put("bill_type_scode",mst.getBill_type()); structattrService.update(
iStIvtStructivtCpService.UpdateIvt(ivtInParam); new StIvtStructattr()
.setLock_type(IOSEnum.LOCK_TYPE.code("未锁定"))
structattrService.update( .setInv_id("")
new StIvtStructattr() .setInv_type("")
.setLock_type(IOSEnum.LOCK_TYPE.code("未锁定")) .setStoragevehicle_code("")
.setInv_id("") .setInv_code(""),
.setInv_type("") new QueryWrapper<StIvtStructattr>().lambda()
.setStoragevehicle_code(dtl.getStoragevehicle_code()) .eq(StIvtStructattr::getStruct_id, dtls.get(0).getTurnout_struct_id())
.setInv_code(""), );
new QueryWrapper<StIvtStructattr>().lambda() structattrService.update(
.eq(StIvtStructattr::getStruct_id, dtl.getTurnin_struct_id()) new StIvtStructattr()
); .setLock_type(IOSEnum.LOCK_TYPE.code("未锁定"))
.setInv_id(mst.getMoveinv_id())
.setInv_type(IOSEnum.IO_TYPE.code("移库"))
.setStoragevehicle_code(dtls.get(0).getStoragevehicle_code())
.setInv_code(mst.getBill_code()),
new QueryWrapper<StIvtStructattr>().lambda()
.eq(StIvtStructattr::getStruct_id, dtls.get(0).getTurnin_struct_id())
);
//更新明细
moveinvdtlCpService.update(new UpdateWrapper<StIvtMoveinvdtlCp>()
.set("bill_status", MoveInvEnum.BILL_STATUS.code("完成"))
.in("moveinvdtl_id",dtls.stream().map(StIvtMoveinvdtlCp::getMoveinvdtl_id).collect(Collectors.toList())));
//更新主单据
List<StIvtMoveinvdtlCp> list = moveinvdtlCpService.list(new QueryWrapper<StIvtMoveinvdtlCp>()
.eq("moveinv_id", mst.getMoveinv_id())
.ne("bill_status", MoveInvEnum.BILL_STATUS.code("完成"))
.ne("bill_status", MoveInvEnum.BILL_STATUS.code("取消")));
if (list.size() == 0) {
this.update(new UpdateWrapper<StIvtMoveinvCp>()
.set("bill_status",MoveInvEnum.BILL_STATUS.code("完成"))
.set("update_time",DateUtil.now())
.set("update_name",SecurityUtils.getCurrentUsername())
.set("update_id",SecurityUtils.getCurrentUserId())
.eq("moveinv_id",mst.getMoveinv_id()));
}
}
break;
case STATUS_CANNEL:
//更新明细
moveinvdtlCpService.update(new UpdateWrapper<StIvtMoveinvdtlCp>()
.set("bill_status", MoveInvEnum.BILL_STATUS.code("取消"))
.set("task_id","")
.in("moveinvdtl_id",dtls.stream().map(StIvtMoveinvdtlCp::getMoveinvdtl_id).collect(Collectors.toList())));
break;
} }
// if (status.equals(AcsTaskEnum.STATUS_CANNEL.getCode())) {
// structattrService.update(
// new StIvtStructattr()
// .setLock_type(IOSEnum.LOCK_TYPE.code("未锁定"))
// .setInv_id("")
// .setInv_type("")
// .setInv_code(""),
// new QueryWrapper<StIvtStructattr>().lambda()
// .in(StIvtStructattr::getStruct_id, dtl.getTurnin_struct_id(),dtl.getTurnout_struct_id())
// );
// }
} }

View File

@@ -1,6 +1,8 @@
package org.nl.wms.storage_manage.productmanage.service.moveInv.impl; package org.nl.wms.storage_manage.productmanage.service.moveInv.impl;
import com.alibaba.fastjson.JSONObject; 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.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.nl.common.enums.AcsTaskEnum; import org.nl.common.enums.AcsTaskEnum;
@@ -13,15 +15,19 @@ import org.nl.wms.scheduler_manage.service.extendtask.manage.TaskStatusEnum;
import org.nl.wms.scheduler_manage.service.task.ISchBaseTaskService; import org.nl.wms.scheduler_manage.service.task.ISchBaseTaskService;
import org.nl.wms.scheduler_manage.service.task.dao.SchBaseTask; import org.nl.wms.scheduler_manage.service.task.dao.SchBaseTask;
import org.nl.wms.storage_manage.MoveInvEnum; import org.nl.wms.storage_manage.MoveInvEnum;
import org.nl.wms.storage_manage.productmanage.service.moveInv.IStIvtMoveinvCpService;
import org.nl.wms.storage_manage.productmanage.service.moveInv.IStIvtMoveinvdtlCpService; import org.nl.wms.storage_manage.productmanage.service.moveInv.IStIvtMoveinvdtlCpService;
import org.nl.wms.storage_manage.productmanage.service.moveInv.dao.StIvtMoveinvdtlCp; import org.nl.wms.storage_manage.productmanage.service.moveInv.dao.StIvtMoveinvdtlCp;
import org.nl.wms.storage_manage.productmanage.service.moveInv.dao.mapper.StIvtMoveinvdtlCpMapper; import org.nl.wms.storage_manage.productmanage.service.moveInv.dao.mapper.StIvtMoveinvdtlCpMapper;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.function.Consumer; import java.util.function.Consumer;
import java.util.stream.Collectors;
/** /**
* <p> * <p>
@@ -38,6 +44,9 @@ public class StIvtMoveinvdtlCpServiceImpl extends ServiceImpl<StIvtMoveinvdtlCpM
@Autowired @Autowired
private ISchBaseTaskService taskService; private ISchBaseTaskService taskService;
@Autowired
private IStIvtMoveinvCpService moveinvCpService;
@Override @Override
public List<Map> listJoinTask(String moveinv_id) { public List<Map> listJoinTask(String moveinv_id) {
if (StringUtils.isEmpty(moveinv_id)){ if (StringUtils.isEmpty(moveinv_id)){
@@ -47,11 +56,18 @@ public class StIvtMoveinvdtlCpServiceImpl extends ServiceImpl<StIvtMoveinvdtlCpM
} }
@Override @Override
@Transactional
public void taskOption(JSONObject form, String option) { public void taskOption(JSONObject form, String option) {
StIvtMoveinvdtlCp moveinvdtl = this.getById(form.getString("moveinvdtl_id")); List<StIvtMoveinvdtlCp> list = this.list(new QueryWrapper<StIvtMoveinvdtlCp>()
.eq("moveinv_id", form.getString("moveinv_id"))
.eq("turnout_struct_code", form.getString("turnout_struct_code")));
List<StIvtMoveinvdtlCp> collect = list.stream().filter(a -> a.getBill_status().equals(MoveInvEnum.BILL_STATUS.code("完成"))).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(collect)){
throw new BadRequestException("当前明细存在正在执行的单据");
}
switch (option){ switch (option){
case "immediateNotifyAcs": case "immediateNotifyAcs":
StIvtMoveinvdtlCp moveinvdtlCp = list.get(0);
PointEvent event = PointEvent.builder() PointEvent event = PointEvent.builder()
.type(AcsTaskEnum.TASK_STRUCT_CP_MOVE) .type(AcsTaskEnum.TASK_STRUCT_CP_MOVE)
.acs_task_type(AcsTaskEnum.ACS_TASK_TYPE_RT.getCode()) .acs_task_type(AcsTaskEnum.ACS_TASK_TYPE_RT.getCode())
@@ -60,25 +76,30 @@ public class StIvtMoveinvdtlCpServiceImpl extends ServiceImpl<StIvtMoveinvdtlCpM
.point_code3(form.getString("turnin_struct_code")) .point_code3(form.getString("turnin_struct_code"))
.vehicle_code(form.getString("storagevehicle_code")) .vehicle_code(form.getString("storagevehicle_code"))
.product_area("A1") .product_area("A1")
.callback((Consumer<String>) moveinvdtl::setTask_id) .callback((Consumer<String>) moveinvdtlCp::setTask_id)
.build(); .build();
BussEventMulticaster.Publish(event); BussEventMulticaster.Publish(event);
moveinvdtl.setBill_status(MoveInvEnum.BILL_STATUS.code("移库中")); this.update(new UpdateWrapper<StIvtMoveinvdtlCp>()
.set("task_id",moveinvdtlCp.getTask_id())
.set("turnin_struct_code",form.getString("turnin_struct_code"))
.set("bill_status",MoveInvEnum.BILL_STATUS.code("移库中"))
.eq("moveinv_id", form.getString("moveinv_id"))
.eq("turnout_struct_code", form.getString("turnout_struct_code")));
form.put("task_id",moveinvdtlCp.getTask_id());
break; break;
case "forceFinish": case "forceFinish":
moveinvdtl.setBill_status(MoveInvEnum.BILL_STATUS.code("完成"));
break; break;
case "cannel": case "cancel":
String task_id = moveinvdtl.getTask_id(); SchBaseTask task = taskService.getById(form.getString("task_id"));
SchBaseTask task = taskService.getById(task_id); if (task.getTask_status().equals(TaskStatusEnum.EXECUTING.getCode())||task.getTask_status().equals(TaskStatusEnum.FINISHED.getCode())){
if (task.getTask_status().equals(TaskStatusEnum.ISSUE.getCode())||task.getTask_status().equals(TaskStatusEnum.EXECUTING.getCode())){ throw new BadRequestException("当前移库任务已下发执行,不允许取消");
throw new BadRequestException("当前移库任务正在执行中,不允许取消");
} }
moveinvdtl.setBill_status(MoveInvEnum.BILL_STATUS.code("取消")); this.update(new UpdateWrapper<StIvtMoveinvdtlCp>()
moveinvdtl.setTask_id(""); .set("bill_status", MoveInvEnum.BILL_STATUS.code("生成"))
.set("task_id","")
.in("moveinvdtl_id",list.stream().map(StIvtMoveinvdtlCp::getMoveinvdtl_id).collect(Collectors.toList())));
break; break;
} }
this.updateById(moveinvdtl); taskService.operation(MapOf.of("method_name",option,"task_id", form.getString("task_id")));
taskService.operation(MapOf.of("method_name",option,"task_id",form.getString("task_id")));
} }
} }

View File

@@ -104,11 +104,11 @@ public class StIvtStructivtCpServiceImpl extends ServiceImpl<StIvtStructivtCpMap
subFrozenSubQty(json); subFrozenSubQty(json);
break; break;
case ChangeIvtUtil.SUB_SUBIVT_QTY: case ChangeIvtUtil.SUB_SUBIVT_QTY:
// 减冻结、减库存 // 减库存
subSubQty(json); subSubQty(json);
break; break;
case ChangeIvtUtil.ADD_SUBIVT_QTY: case ChangeIvtUtil.ADD_SUBIVT_QTY:
// 减冻结、减库存 // 库存
AddQty(json); AddQty(json);
break; break;
default: default:
@@ -521,6 +521,7 @@ public class StIvtStructivtCpServiceImpl extends ServiceImpl<StIvtStructivtCpMap
dao.setStor_id(json.getString("stor_id")); dao.setStor_id(json.getString("stor_id"));
dao.setUnit_weight(materDao.getNet_weight()); dao.setUnit_weight(materDao.getNet_weight());
dao.setBill_type(json.getString("bill_type_scode")); dao.setBill_type(json.getString("bill_type_scode"));
dao.setInstorage_time(DateUtil.now());
this.save(dao); this.save(dao);
// 插入库存变动记录 // 插入库存变动记录

View File

@@ -97,12 +97,21 @@
<if test="query.material_search != null and query.material_search != ''"> <if test="query.material_search != null and query.material_search != ''">
and (mb.material_code = #{query.material_search} OR mb.material_name = #{query.material_search}) and (mb.material_code = #{query.material_search} OR mb.material_name = #{query.material_search})
</if> </if>
<if test="query.struct_search != null and query.struct_search.size>0">
and sa.struct_code in
<foreach collection="query.struct_search" item="item" index="index" separator="," open="(" close=")">
#{item}
</foreach>
</if>
<if test="query.sect_id != null and query.sect_id != ''"> <if test="query.sect_id != null and query.sect_id != ''">
and sa.sect_id = #{query.sect_id} and sa.sect_id = #{query.sect_id}
</if> </if>
<if test="query.struct_id != null and query.struct_id != ''"> <if test="query.struct_id != null and query.struct_id != ''">
and sa.struct_id = #{query.struct_id} and sa.struct_id = #{query.struct_id}
</if> </if>
<if test="query.struct_code != null and query.struct_code != ''">
and sa.struct_code = #{query.struct_code}
</if>
</where> </where>
</select> </select>

View File

@@ -6,6 +6,8 @@ import org.nl.common.domain.query.QParam;
import org.nl.common.enums.QueryTEnum; import org.nl.common.enums.QueryTEnum;
import org.nl.wms.storage_manage.rawmanage.service.structIvt.dao.StIvtStructivtYl; import org.nl.wms.storage_manage.rawmanage.service.structIvt.dao.StIvtStructivtYl;
import java.util.List;
/* /*
* @author ZZQ * @author ZZQ
* @Date 2023/5/4 19:49 * @Date 2023/5/4 19:49
@@ -18,11 +20,13 @@ public class StructIvtYLQuery extends BaseQuery<StIvtStructivtYl> {
private String struct_id; private String struct_id;
private String struct_code;
private String material_search; private String material_search;
private String stor_id; private String stor_id;
private String struct_search; private List struct_search;
private Boolean is_delete = false; private Boolean is_delete = false;

View File

@@ -103,6 +103,7 @@ public class UserController {
//("修改密码") //("修改密码")
@PostMapping(value = "/updatePass") @PostMapping(value = "/updatePass")
@Log("修改密码")
public ResponseEntity<Object> updatePass(@RequestBody JSONObject passVo) throws Exception { public ResponseEntity<Object> updatePass(@RequestBody JSONObject passVo) throws Exception {
userService.updatePass(passVo); userService.updatePass(passVo);
return new ResponseEntity<>(HttpStatus.OK); return new ResponseEntity<>(HttpStatus.OK);

View File

@@ -14,6 +14,9 @@ INSERT INTO `hl_one_mes`.`sys_dict`(`dict_id`, `code`, `name`, `label`, `value`,
INSERT INTO `hl_one_mes`.`sys_dict`(`dict_id`, `code`, `name`, `label`, `value`, `dict_sort`, `dict_type`, `para1`, `para2`, `para3`, `create_id`, `create_name`, `create_time`, `update_id`, `update_name`, `update_time`) VALUES ('1699310839531704320', 'MOVE_BILL_STATUS', '移库单状态', '完成', '99', 3, NULL, NULL, NULL, NULL, '1694303357524643840', '管理员', '2023-09-06 14:37:30', '1694303357524643840', '管理员', '2023-09-06 14:37:30'); INSERT INTO `hl_one_mes`.`sys_dict`(`dict_id`, `code`, `name`, `label`, `value`, `dict_sort`, `dict_type`, `para1`, `para2`, `para3`, `create_id`, `create_name`, `create_time`, `update_id`, `update_name`, `update_time`) VALUES ('1699310839531704320', 'MOVE_BILL_STATUS', '移库单状态', '完成', '99', 3, NULL, NULL, NULL, NULL, '1694303357524643840', '管理员', '2023-09-06 14:37:30', '1694303357524643840', '管理员', '2023-09-06 14:37:30');
INSERT INTO `hl_one_mes`.`sys_dict`(`dict_id`, `code`, `name`, `label`, `value`, `dict_sort`, `dict_type`, `para1`, `para2`, `para3`, `create_id`, `create_name`, `create_time`, `update_id`, `update_name`, `update_time`) VALUES ('1699310801569058816', 'MOVE_BILL_STATUS', '移库单状态', '移库中', '20', 2, NULL, NULL, NULL, NULL, '1694303357524643840', '管理员', '2023-09-06 14:37:21', '1694303357524643840', '管理员', '2023-09-06 14:37:21'); INSERT INTO `hl_one_mes`.`sys_dict`(`dict_id`, `code`, `name`, `label`, `value`, `dict_sort`, `dict_type`, `para1`, `para2`, `para3`, `create_id`, `create_name`, `create_time`, `update_id`, `update_name`, `update_time`) VALUES ('1699310801569058816', 'MOVE_BILL_STATUS', '移库单状态', '移库中', '20', 2, NULL, NULL, NULL, NULL, '1694303357524643840', '管理员', '2023-09-06 14:37:21', '1694303357524643840', '管理员', '2023-09-06 14:37:21');
INSERT INTO `hl_one_mes`.`sys_dict`(`dict_id`, `code`, `name`, `label`, `value`, `dict_sort`, `dict_type`, `para1`, `para2`, `para3`, `create_id`, `create_name`, `create_time`, `update_id`, `update_name`, `update_time`) VALUES ('1699310669570117632', 'MOVE_BILL_STATUS', '移库单状态', '生成', '10', 1, NULL, NULL, NULL, NULL, '1694303357524643840', '管理员', '2023-09-06 14:36:49', '1694303357524643840', '管理员', '2023-09-06 14:36:49'); INSERT INTO `hl_one_mes`.`sys_dict`(`dict_id`, `code`, `name`, `label`, `value`, `dict_sort`, `dict_type`, `para1`, `para2`, `para3`, `create_id`, `create_name`, `create_time`, `update_id`, `update_name`, `update_time`) VALUES ('1699310669570117632', 'MOVE_BILL_STATUS', '移库单状态', '生成', '10', 1, NULL, NULL, NULL, NULL, '1694303357524643840', '管理员', '2023-09-06 14:36:49', '1694303357524643840', '管理员', '2023-09-06 14:36:49');
-- 字典添加库存变动类型
INSERT INTO `hl_one_mes`.`sys_dict`(`dict_id`, `code`, `name`, `label`, `value`, `dict_sort`, `dict_type`, `para1`, `para2`, `para3`, `create_id`, `create_name`, `create_time`, `update_id`, `update_name`, `update_time`) VALUES ('1701435666942005248', 'CHANGE_TYPE_SCODE', '变动类型', '加库存(移库)', '8', 8, NULL, NULL, NULL, NULL, '1694303357524643840', '管理员', '2023-09-12 11:20:48', '1694303357524643840', '管理员', '2023-09-12 11:20:48');
INSERT INTO `hl_one_mes`.`sys_dict`(`dict_id`, `code`, `name`, `label`, `value`, `dict_sort`, `dict_type`, `para1`, `para2`, `para3`, `create_id`, `create_name`, `create_time`, `update_id`, `update_name`, `update_time`) VALUES ('1701435629621088256', 'CHANGE_TYPE_SCODE', '变动类型', '减库存(移库)', '7', 7, NULL, NULL, NULL, NULL, '1694303357524643840', '管理员', '2023-09-12 11:20:39', '1694303357524643840', '管理员', '2023-09-12 11:20:39');

View File

@@ -121,16 +121,16 @@
> >
添加移库物料 添加移库物料
</el-button> </el-button>
<el-button <!-- <el-button-->
slot="left" <!-- slot="left"-->
class="filter-item" <!-- class="filter-item"-->
type="primary" <!-- type="primary"-->
icon="el-icon-plus" <!-- icon="el-icon-plus"-->
size="mini" <!-- size="mini"-->
@click="queryDtl()" <!-- @click="queryDtl()"-->
> <!-- >-->
自动分配 <!-- 自动分配-->
</el-button> <!-- </el-button>-->
</span> </span>
</div> </div>
@@ -150,7 +150,7 @@
<el-table-column prop="turnout_struct_code" label="移出货位" align="center" /> <el-table-column prop="turnout_struct_code" label="移出货位" align="center" />
<el-table-column prop="turnin_struct_code" label="移入货位" align="center" > <el-table-column prop="turnin_struct_code" label="移入货位" align="center" >
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-show="isedit" v-model="scope.row.turnin_struct_code" clearable style="width: 150px" @clear="scope.row.turnin_struct_code='',scope.row.turnin_struct_name=''"> <el-input v-show="isedit" v-model="scope.row.turnin_struct_code" clearable style="width: 170px" @clear="structClear(scope.row)">
<el-button slot="append" icon="el-icon-plus" @click="queryStruct(scope.$index,scope.row)" ></el-button> <el-button slot="append" icon="el-icon-plus" @click="queryStruct(scope.$index,scope.row)" ></el-button>
</el-input> </el-input>
<span v-show="!isedit">{{ scope.row.turnin_struct_code }}</span> <span v-show="!isedit">{{ scope.row.turnin_struct_code }}</span>
@@ -164,7 +164,7 @@
class="filter-item" class="filter-item"
size="mini" size="mini"
icon="el-icon-delete" icon="el-icon-delete"
@click.native.prevent="deleteRow(scope.$index, form.tableData)" @click.native.prevent="deleteRow(scope.row, form.tableData)"
/> />
</template> </template>
</el-table-column> </el-table-column>
@@ -176,7 +176,7 @@
<script> <script>
import CRUD, { crud, form } from '@crud/crud' import CRUD, { crud, form } from '@crud/crud'
import AddDtl from '@/views/wms/storage_manage/product/productCheck/StructIvt' import AddDtl from '@/views/wms/storage_manage/product/moveInv/StructIvt'
import AddStruct from '@/views/wms/storage_manage/product/moveInv/AddStruct' import AddStruct from '@/views/wms/storage_manage/product/moveInv/AddStruct'
import moveInv from '@/views/wms/storage_manage/product/moveInv/moveInv' import moveInv from '@/views/wms/storage_manage/product/moveInv/moveInv'
import crudStorattr from '@/views/wms/storage_manage/basedata/basedata' import crudStorattr from '@/views/wms/storage_manage/basedata/basedata'
@@ -282,12 +282,25 @@ export default {
this.nowrow = row this.nowrow = row
this.structShow = true this.structShow = true
}, },
structClear(row){
this.form.tableData.forEach((a,index)=>{
if (a.struct_code === row.struct_code){
this.$set(a,'turnin_struct_code',"")
this.$set(a,'turnin_struct_name',"")
this.$set(a,'turnin_struct_id',"")
this.form.tableData.splice(index, 1, a)
}
})
},
structChanged(rows){ structChanged(rows){
console.log(rows[0].struct_code) this.form.tableData.forEach((a,index)=>{
this.$set(this.nowrow,'turnin_struct_code',rows[0].struct_code) if (a.struct_code === this.nowrow.struct_code){
this.$set(this.nowrow,'turnin_struct_name',rows[0].struct_name) this.$set(a,'turnin_struct_code',rows[0].struct_code)
this.$set(this.nowrow,'turnin_struct_id',rows[0].struct_id) this.$set(a,'turnin_struct_name',rows[0].struct_name)
this.form.tableData.splice(this.nowindex, 1, this.nowrow) this.$set(a,'turnin_struct_id',rows[0].struct_id)
this.form.tableData.splice(index, 1, a)
}
})
}, },
tableChanged(rows) { tableChanged(rows) {
const tablemap = new Map() const tablemap = new Map()
@@ -314,8 +327,12 @@ export default {
} }
this.form.dtl_num = this.form.tableData.length this.form.dtl_num = this.form.tableData.length
}, },
deleteRow(index, rows) { deleteRow(row, rows) {
rows.splice(index, 1) var indexSet = []
let filter = rows.filter(a=>{
return a.turnout_struct_code !== row.turnout_struct_code
});
this.form.tableData = filter
this.nowindex = '' this.nowindex = ''
this.nowrow = {} this.nowrow = {}
this.form.dtl_num = this.form.tableData.length this.form.dtl_num = this.form.tableData.length

View File

@@ -1,173 +0,0 @@
<!--suppress ALL -->
<template>
<el-dialog
title="库存选择"
append-to-body
:visible.sync="dialogVisible"
destroy-on-close
:show-close="false"
width="1000px"
@close="close"
@open="open"
>
<el-row>
<el-col :span="6">
<!-- 搜索 -->
<el-cascader
placeholder="库区"
:options="sects"
:props="{ checkStrictly: true }"
clearable
@change="sectQueryChange"
/>
</el-col>
<el-col :span="6">
<el-input
v-model="query.struct_code"
clearable
size="mini"
placeholder="货位号模糊查询"
style="width: 200px;"
class="filter-item"
@keyup.enter.native="crud.toQuery"
/>
</el-col>
<el-col :span="6">
<el-input
v-model="query.remark"
clearable
size="mini"
placeholder="物料"
style="width: 200px;"
class="filter-item"
@keyup.enter.native="crud.toQuery"
/>
</el-col>
<el-col :span="6">
<rrOperation />
</el-col>
</el-row>
<!--表格渲染-->
<el-table
ref="table"
v-loading="crud.loading"
:data="crud.data"
style="width: 100%;"
border
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
>
<el-table-column type="selection" width="55" />
<el-table-column show-overflow-tooltip prop="sect_name" label="库区" width="110px" />
<el-table-column show-overflow-tooltip prop="struct_code" label="货位" width="110px" />
<el-table-column show-overflow-tooltip prop="storagevehicle_code" label="载具号" />
<el-table-column show-overflow-tooltip prop="material_code" label="物料编码" width="150px" />
<el-table-column show-overflow-tooltip prop="material_name" label="物料名称" width="110px" />
<el-table-column show-overflow-tooltip prop="base_qty" label="桶数" :formatter="crud.formatNum0" />
<el-table-column show-overflow-tooltip prop="qty_unit_name" label="计量单位" />
<el-table-column show-overflow-tooltip prop="storage_qty" :formatter="crud.formatNum3" label="重量" width="110px" />
</el-table>
<!--分页组件-->
<pagination />
<span slot="footer" class="dialog-footer">
<el-button slot="left" type="info" @click="dialogVisible = false">关闭</el-button>
<el-button slot="left" type="primary" @click="submit">保存</el-button>
</span>
</el-dialog>
</template>
<script>
import CRUD, { header, presenter } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import pagination from '@crud/Pagination'
import crudSectattr from '@/api/wms/basedata/st/sectattr'
export default {
name: 'AddDtl',
components: { rrOperation, pagination },
cruds() {
return CRUD({ title: '用户', idField: 'stockrecord_id', url: 'api/check/getStructIvt',
query: {
struct_code: '',
remark: '',
sect_id: '',
stor_id: ''
},
optShow: {
add: false,
edit: false,
del: false,
reset: true,
download: false
}})
},
mixins: [presenter(), header()],
props: {
dialogShow: {
type: Boolean,
default: false
},
openParam: {
type: String
}
},
data() {
return {
dialogVisible: false,
opendtlParam: '',
sects: [],
rows: []
}
},
watch: {
dialogShow: {
handler(newValue, oldValue) {
this.dialogVisible = newValue
}
},
openParam: {
handler(newValue, oldValue) {
this.opendtlParam = newValue
}
}
},
methods: {
open() {
crudSectattr.getSect({ is_materialstore: '1' }).then(res => {
this.sects = res.content
})
this.crud.toQuery()
},
close() {
this.crud.resetQuery(false)
this.$emit('update:dialogShow', false)
},
sectQueryChange(val) {
if (val.length === 1) {
this.crud.query.stor_id = val[0]
this.crud.query.sect_id = ''
}
if (val.length === 0) {
this.crud.query.sect_id = ''
this.crud.query.stor_id = ''
}
if (val.length === 2) {
this.crud.query.stor_id = val[0]
this.crud.query.sect_id = val[1]
}
},
submit() {
this.rows = this.$refs.table.selection
if (this.rows.length <= 0) {
this.$message('请先勾选载具物料')
return
}
this.crud.resetQuery(false)
this.$emit('update:dialogShow', false)
this.$emit('tableChanged', this.rows)
}
}
}
</script>

View File

@@ -91,7 +91,10 @@ export default {
struct_code: '', struct_code: '',
remark: '', remark: '',
sect_id: '1528631043496742912', sect_id: '1528631043496742912',
stor_id: '1528627995269533696' stor_id: '1528627995269533696',
is_used: true,
lock_type: '0',
emptyvehicle: true
}, },
optShow: { optShow: {
add: false, add: false,

View File

@@ -70,6 +70,7 @@
@row-click="clcikRow" @row-click="clcikRow"
> >
<el-table-column prop="seq_no" label="序号" width="50" align="center" /> <el-table-column prop="seq_no" label="序号" width="50" align="center" />
<el-table-column :formatter="stateFormat" prop="bill_status" label="移库明细状态" width="50" align="center" />
<el-table-column prop="turnout_sect_name" label="移库库区" align="center" /> <el-table-column prop="turnout_sect_name" label="移库库区" align="center" />
<el-table-column show-overflow-tooltip prop="material_code" label="物料编码" width="120" align="center" /> <el-table-column show-overflow-tooltip prop="material_code" label="物料编码" width="120" align="center" />
<el-table-column prop="qty" label="数量" align="center" :formatter="crud.formatNum0" /> <el-table-column prop="qty" label="数量" align="center" :formatter="crud.formatNum0" />
@@ -78,7 +79,7 @@
<el-table-column prop="turnout_struct_code" label="移出货位" align="center" /> <el-table-column prop="turnout_struct_code" label="移出货位" align="center" />
<el-table-column prop="turnin_struct_code" label="移入货位" align="center" /> <el-table-column prop="turnin_struct_code" label="移入货位" align="center" />
<el-table-column prop="task_code" label="任务编号" align="center" /> <el-table-column prop="task_code" label="任务编号" align="center" />
<el-table-column prop="task_status" label="任务状态" align="center" /> <el-table-column :formatter="formatStatus" prop="task_status" label="任务状态" align="center" />
</el-table> </el-table>
</el-card> </el-card>
</el-dialog> </el-dialog>
@@ -87,12 +88,14 @@
<script> <script>
import CRUD, { crud } from '@crud/crud' import CRUD, { crud } from '@crud/crud'
import crudProductIn from '@/views/wms/storage_manage/product/productIn/productin' import crudProductIn from '@/views/wms/storage_manage/product/productIn/productin'
import moveInv from '@/views/wms/storage_manage/product/moveInv/moveInv'
export default { export default {
name: 'MoveTaskDialog', name: 'MoveTaskDialog',
components: {}, components: {},
mixins: [crud()], mixins: [crud()],
dicts: ['SCH_TASK_TYPE_DTL', 'task_status', 'PCS_SAL_TYPE'], dicts: ['task_status', 'MOVE_BILL_STATUS'],
props: { props: {
dialogShow: { dialogShow: {
type: Boolean, type: Boolean,
@@ -141,38 +144,27 @@ export default {
clcikRow(row) { clcikRow(row) {
this.form.dtl_row = row this.form.dtl_row = row
}, },
refreshMethod(){
moveInv.getMoveDtl({ 'moveinv_id': this.form.dtl_row.moveinv_id }).then(res => {
this.openParam = res.content
})
},
delTask() { delTask() {
this.fullscreenLoading = true moveInv.moveTAskOption(this.form.dtl_row,"cancel").then(res => {
crudProductIn.delTask({ 'iostorinvdis_id': this.dis_row.iostorinvdis_id }).then(res => { this.refreshMethod()
this.crud.notify('删除成功!', CRUD.NOTIFICATION_TYPE.SUCCESS) this.crud.notify('操作成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.fullscreenLoading = false
this.queryTableDdis()
this.initFlag()
}).catch(() => {
this.fullscreenLoading = false
}) })
}, },
sendTask() { sendTask() {
console.log(this.form.dtl_row) moveInv.moveTAskOption(this.form.dtl_row,"immediateNotifyAcs").then(res => {
// this.fullscreenLoading = true this.refreshMethod()
// crudProductIn.sendTask({ 'task_id': this.dis_row.task_id }).then(res => { this.crud.notify('操作成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
// this.crud.notify('下发成功!', CRUD.NOTIFICATION_TYPE.SUCCESS) })
// this.fullscreenLoading = false
// this.queryTableDdis()
// this.initFlag()
// }).catch(() => {
// this.fullscreenLoading = false
// })
}, },
confirmTask() { confirmTask() {
this.fullscreenLoading = true moveInv.moveTAskOption(this.form.dtl_row,"forceFinish").then(res => {
crudProductIn.confirmTask({ 'task_id': this.dis_row.task_id }).then(res => { this.refreshMethod()
this.crud.notify('操作成功!', CRUD.NOTIFICATION_TYPE.SUCCESS) this.crud.notify('操作成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.fullscreenLoading = false
this.queryTableDdis()
this.initFlag()
}).catch(() => {
this.fullscreenLoading = false
}) })
}, },
tableRowClassName({ row, rowIndex }) { tableRowClassName({ row, rowIndex }) {
@@ -187,20 +179,17 @@ export default {
}) })
} }
}, },
stateFormat(row) {
return this.dict.label.MOVE_BILL_STATUS[row.bill_status]
},
formatStatus(row) { formatStatus(row) {
return this.dict.label.task_status[row.task_status] return this.dict.label.task_status[row.task_status]
}, },
formatType(row) {
return this.dict.label.SCH_TASK_TYPE_DTL[row.task_type]
},
initFlag() { initFlag() {
this.dis_del = true this.dis_del = true
this.dis_send = true this.dis_send = true
this.dis_confirm = true this.dis_confirm = true
}, },
formatBaseType(row) {
return this.dict.label.PCS_SAL_TYPE[row.base_bill_type]
}
} }
} }
</script> </script>

View File

@@ -0,0 +1,177 @@
<!--suppress ALL -->
<template>
<el-dialog
title="库存选择"
append-to-body
:visible.sync="dialogVisible"
destroy-on-close
width="1200px"
@close="close"
@open="open"
>
<div class="head-container">
<div v-if="crud.props.searchToggle">
<!-- 搜索 -->
<el-form
:inline="true"
class="demo-form-inline"
label-position="right"
label-width="80px"
label-suffix=":"
>
<el-form-item label="日期">
<date-range-picker v-model="query.createTime" class="date-item" value-format="yyyy-MM-dd"/>
</el-form-item>
<el-form-item label="库区/货位">
<el-input
v-model="query.struct_code"
clearable
size="mini"
placeholder="库区/货位"
style="width: 200px;"
class="filter-item"
@keyup.enter.native="crud.toQuery"
/>
</el-form-item>
<el-form-item label="物料">
<el-input
v-model="query.material_search"
clearable
size="mini"
placeholder="物料"
style="width: 230px;"
class="filter-item"
@keyup.enter.native="crud.toQuery"
/>
</el-form-item>
<rrOperation/>
</el-form>
</div>
<!--如果想在工具栏加入更多按钮可以使用插槽方式 slot = 'left' or 'right'-->
<crudOperation/>
<!--表格渲染-->
<el-table
ref="multipleTable"
v-loading="crud.loading"
:data="crud.data"
style="width: 100%;"
@selection-change="crud.selectionChangeHandler"
>
<el-table-column type="selection" width="55"/>
<el-table-column show-overflow-tooltip width="150" prop="sect_code" label="库区"/>
<el-table-column show-overflow-tooltip width="150" prop="struct_name" label="货位"/>
<el-table-column show-overflow-tooltip prop="material_code" width="250" label="物料编号"/>
<el-table-column show-overflow-tooltip width="100" prop="material_name" label="物料名称"/>
<el-table-column show-overflow-tooltip width="150" prop="class_name" label="物料类别"/>
<el-table-column show-overflow-tooltip width="150" prop="canuse_qty" label="重量"/>
<el-table-column show-overflow-tooltip prop="qty_unit_name" label="重量单位"/>
<el-table-column show-overflow-tooltip prop="storagevehicle_code" label="载具号"/>
</el-table>
<!--分页组件-->
<pagination/>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="submit"> </el-button>
</span>
</el-dialog>
</template>
<script>
import CRUD, {crud, header, presenter} from '@crud/crud'
import qs from 'qs'
import rrOperation from '@crud/RR.operation'
import crudOperation from '@crud/CRUD.operation'
import pagination from '@crud/Pagination'
import DateRangePicker from '@/components/DateRangePicker/index'
import moveInv from '@/views/wms/storage_manage/product/moveInv/moveInv'
import {getProductIvt} from "./moveInv";
import {setUserInfo} from "../../../../../store/modules/user";
const start = new Date()
export default {
name: 'AddDtl',
components: {crudOperation, rrOperation, pagination, DateRangePicker},
cruds() {
return CRUD({
title: '成品可用库存',
url: '/api/stIvtStructivtYl/getProductIvt',
crudMethod: {},
optShow: {
reset: true
}
})
},
mixins: [presenter(), header(), crud()],
props: {
dialogShow: {
type: Boolean,
default: false
}
},
data() {
return {
dialogVisible: false,
rows: [],
tableData: []
}
},
watch: {
dialogShow: {
handler(newValue, oldValue) {
this.dialogVisible = newValue
}
}
},
methods: {
objectSpanMethod({row, column, rowIndex, columnIndex}) {
if (columnIndex === 0) {
if (rowIndex % 2 === 0) {
return {
rowspan: 2,
colspan: 1
}
} else {
return {
rowspan: 0,
colspan: 0
}
}
}
},
open() {
this.crud.toQuery()
},
close() {
this.$emit('update:dialogShow', false)
this.query.struct_search = []
this.query.size = 10
},
submit() {
//struct_code
this.$emit('update:dialogShow', false)
var structs = ''
this.$refs.multipleTable.selection.forEach(a =>{
structs=a.struct_code+","+structs
})
moveInv.getProductIvt({'struct_search':structs,'size':999,'page':0}).then(res => {
this.rows = res.content
var i =1;
this.rows.forEach(a => {
a.seq_no=i
a.turnout_sect_name = a.sect_name
a.turnout_struct_code = a.struct_code
a.qty = a.canuse_qty
i++
})
this.$emit('tableChanged', this.rows)
})
}
}
}
</script>

View File

@@ -126,9 +126,9 @@
:disabled="confirm_flag" :disabled="confirm_flag"
icon="el-icon-check" icon="el-icon-check"
size="mini" size="mini"
@click="confirm" @click="cancel"
> >
强制完成 取消单据
</el-button> </el-button>
<!--<el-button <!--<el-button
slot="right" slot="right"
@@ -207,6 +207,7 @@ import MoveTaskDialog from '@/views/wms/storage_manage/product/moveInv/MoveTaskD
import crudStorattr from "@/views/wms/storage_manage/basedata/basedata"; import crudStorattr from "@/views/wms/storage_manage/basedata/basedata";
import {download} from '@/api/data' import {download} from '@/api/data'
import {downloadFile} from '@/utils' import {downloadFile} from '@/utils'
import {cancel} from "./moveInv";
export default { export default {
name: 'moveInv', name: 'moveInv',
@@ -286,12 +287,7 @@ export default {
if (current !== null) { if (current !== null) {
this.currentRow = current this.currentRow = current
this.downdtl_flag = false this.downdtl_flag = false
if (current.status === '10' || current.status === '30') { if (current.bill_status === '10' ) {
this.check_flag = false
} else {
this.check_flag = true
}
if (current.status === '30' && current.is_nok) {
this.confirm_flag = false this.confirm_flag = false
} else { } else {
this.confirm_flag = true this.confirm_flag = true
@@ -331,10 +327,11 @@ export default {
}) })
this.taskShow = true this.taskShow = true
}, },
confirm() { cancel() {
if (this.currentRow !== null) { check.cancel(this.currentRow).then(res => {
this.$refs.child2.setForm(this.currentRow) this.crud.notify('操作成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
} })
this.crud.toQuery()
}, },
downdtl() { downdtl() {
if (this.currentRow !== null) { if (this.currentRow !== null) {

View File

@@ -39,11 +39,37 @@ export function getStructIvt(params) {
}) })
} }
export function getProductIvt(params) {
return request({
url: '/api/stIvtStructivtYl/getProductIvt',
method: 'get',
params
})
}
export function moveTAskOption(params,option) {
return request({
url: '/api/stIvtMoveinvdtlCp/task/'+option,
method: 'post',
data:params
})
}
export function cancel(params) {
return request({
url: '/api/stIvtMoveinvCp/cancel',
method: 'post',
data:params
})
}
export default { export default {
add, add,
edit, edit,
del, del,
getMoveDtl, getMoveDtl,
getStructIvt cancel,
getStructIvt,
moveTAskOption,
getProductIvt
} }