add:新增出库任务
This commit is contained in:
@@ -1,6 +1,5 @@
|
|||||||
package org.nl.wms.config_manage.form_struc.service.dao;
|
package org.nl.wms.config_manage.form_struc.service.dao;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
@@ -8,8 +7,6 @@ import com.baomidou.mybatisplus.annotation.TableId;
|
|||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
|
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -21,7 +21,8 @@ public class StructEvent extends PublishEvent {
|
|||||||
|
|
||||||
private String task_status;
|
private String task_status;
|
||||||
|
|
||||||
private String struct_code;
|
private String point_code1;
|
||||||
|
private String point_code2;
|
||||||
|
|
||||||
private String source_form_id;
|
private String source_form_id;
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,85 @@
|
|||||||
|
package org.nl.wms.dispatch_manage.task.handler.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.nl.common.domain.exception.BadRequestException;
|
||||||
|
import org.nl.common.enums.StatusEnum;
|
||||||
|
import org.nl.common.utils.CodeUtil;
|
||||||
|
import org.nl.common.utils.IdUtil;
|
||||||
|
import org.nl.common.utils.SecurityUtils;
|
||||||
|
import org.nl.wms.base_manage.vehicle.vehicleMater.service.IMdPbVehicleMaterService;
|
||||||
|
import org.nl.wms.dispatch_manage.task.handler.TaskHandler;
|
||||||
|
import org.nl.wms.dispatch_manage.task.service.ISchBaseTaskService;
|
||||||
|
import org.nl.wms.dispatch_manage.task.service.dao.SchBaseTask;
|
||||||
|
import org.nl.wms.stor_manage.struct.service.IStIvtStructattrService;
|
||||||
|
import org.nl.wms.stor_manage.struct.service.dao.StIvtStructattr;
|
||||||
|
import org.nl.wms.system_manage.service.param.ISysParamService;
|
||||||
|
import org.nl.wms.system_manage.service.param.dao.Param;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @author ZZQ
|
||||||
|
* @Date 2024/5/6 14:34
|
||||||
|
* 出库任务入库任务
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class OutStorageTaskHandler implements TaskHandler {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISchBaseTaskService taskService;
|
||||||
|
@Autowired
|
||||||
|
private ISysParamService iSysParamService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IStIvtStructattrService iStIvtStructattrService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public JSONObject process(JSONObject from, JSONObject param) {
|
||||||
|
//区分出库还是入库
|
||||||
|
//根据不同的仓位设置不同的终点
|
||||||
|
Param outStorage = iSysParamService.findByCode("OutStorage");
|
||||||
|
if (outStorage==null || StringUtils.isEmpty(outStorage.getValue())){
|
||||||
|
throw new BadRequestException("创建任务失败:OutStorageTaskHandler#process()未配置出库对应点位");
|
||||||
|
}
|
||||||
|
JSONObject outStorageConfig = JSONObject.parseObject(outStorage.getValue());
|
||||||
|
String end_point = outStorageConfig.getString(from.getString("stor_code"));
|
||||||
|
|
||||||
|
String vehicle_code = from.getString("vehicle_code");
|
||||||
|
StIvtStructattr struct = iStIvtStructattrService.getOne(new QueryWrapper<StIvtStructattr>().eq("vehicle_code", vehicle_code));
|
||||||
|
String struct_code = struct.getStruct_code();
|
||||||
|
if (StringUtils.isEmpty(vehicle_code) ||StringUtils.isEmpty(end_point)||StringUtils.isEmpty(struct_code)){
|
||||||
|
throw new BadRequestException("创建任务失败:OutStorageTaskHandler#process()方法请求参数不能为空");
|
||||||
|
}
|
||||||
|
List<SchBaseTask> list = taskService.list(new QueryWrapper<SchBaseTask>().eq("vehicle_code", vehicle_code)
|
||||||
|
.ne("task_status", StatusEnum.FORM_STATUS.code("完成")));
|
||||||
|
if (!CollectionUtils.isEmpty(list)){
|
||||||
|
throw new BadRequestException("当前载具存在任务:"+list.stream().map(SchBaseTask::getTask_code).collect(Collectors.joining(",")));
|
||||||
|
}
|
||||||
|
SchBaseTask task = new SchBaseTask();
|
||||||
|
task.setId(IdUtil.getStringId());
|
||||||
|
task.setTask_code(CodeUtil.getNewCode("TASK_CODE"));
|
||||||
|
task.setTask_status(StatusEnum.FORM_STATUS.code("生成"));
|
||||||
|
task.setHandle_class(this.getClass().getName());
|
||||||
|
task.setAcs_type("");
|
||||||
|
task.setCreate_time(DateUtil.now());
|
||||||
|
task.setCreate_name(SecurityUtils.getCurrentNickName());
|
||||||
|
task.setTask_type(param.getString("task_type"));
|
||||||
|
task.setVehicle_code(vehicle_code);
|
||||||
|
task.setPoint_code1(struct_code);
|
||||||
|
task.setPoint_code2(end_point);
|
||||||
|
taskService.save(task);
|
||||||
|
Boolean isSend = param.getBoolean("is_send");
|
||||||
|
if (isSend){
|
||||||
|
//参数封装,调acs接口
|
||||||
|
}
|
||||||
|
return (JSONObject)JSON.toJSON(task);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -38,20 +38,9 @@ public class StackingTaskHandler implements TaskHandler {
|
|||||||
@Override
|
@Override
|
||||||
public JSONObject process(JSONObject from, JSONObject param) {
|
public JSONObject process(JSONObject from, JSONObject param) {
|
||||||
//区分出库还是入库
|
//区分出库还是入库
|
||||||
Boolean in = StatusEnum.TASK_TYPE.check(param.getString("task_type"));
|
|
||||||
String vehicle_code = from.getString("vehicle_code");
|
String vehicle_code = from.getString("vehicle_code");
|
||||||
|
String point_code1 = from.getString("struct_code");
|
||||||
String point_code1;
|
String point_code2 = param.getString("start_point");
|
||||||
String point_code2;
|
|
||||||
if(in){
|
|
||||||
point_code1 = from.getString("struct_code");
|
|
||||||
point_code2 = param.getString("start_point");
|
|
||||||
}else {
|
|
||||||
point_code2 = from.getString("struct_code");
|
|
||||||
point_code1 = param.getString("start_point");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (StringUtils.isEmpty(vehicle_code) ||StringUtils.isEmpty(point_code1)||StringUtils.isEmpty(point_code2)){
|
if (StringUtils.isEmpty(vehicle_code) ||StringUtils.isEmpty(point_code1)||StringUtils.isEmpty(point_code2)){
|
||||||
throw new BadRequestException("创建任务失败:StackingTaskHandler#process()方法请求参数不能为空");
|
throw new BadRequestException("创建任务失败:StackingTaskHandler#process()方法请求参数不能为空");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,7 +51,9 @@ public class TaskStatusHandler implements TaskHandler {
|
|||||||
.task_status(schBaseTask.getTask_status())
|
.task_status(schBaseTask.getTask_status())
|
||||||
.source_form_id(vehicleMater.getSource_form_id())
|
.source_form_id(vehicleMater.getSource_form_id())
|
||||||
.source_form_type(vehicleMater.getSource_form_type())
|
.source_form_type(vehicleMater.getSource_form_type())
|
||||||
.vehicle_code(schBaseTask.getVehicle_code()).struct_code(schBaseTask.getPoint_code2())
|
.vehicle_code(schBaseTask.getVehicle_code())
|
||||||
|
.point_code1(schBaseTask.getPoint_code1())
|
||||||
|
.point_code2(schBaseTask.getPoint_code2())
|
||||||
.build());
|
.build());
|
||||||
return from;
|
return from;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,7 +49,8 @@
|
|||||||
sch_base_task.point_code1,
|
sch_base_task.point_code1,
|
||||||
sch_base_task.point_code2,
|
sch_base_task.point_code2,
|
||||||
sch_base_task.task_type,
|
sch_base_task.task_type,
|
||||||
sch_base_task.task_status
|
sch_base_task.task_status,
|
||||||
|
sch_base_task.task_code
|
||||||
FROM
|
FROM
|
||||||
md_pb_vehicleMater
|
md_pb_vehicleMater
|
||||||
LEFT JOIN st_ivt_structattr ON md_pb_vehicleMater.vehicle_code = st_ivt_structattr.vehicle_code
|
LEFT JOIN st_ivt_structattr ON md_pb_vehicleMater.vehicle_code = st_ivt_structattr.vehicle_code
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|||||||
import org.nl.common.domain.entity.PageQuery;
|
import org.nl.common.domain.entity.PageQuery;
|
||||||
import org.nl.common.domain.exception.BadRequestException;
|
import org.nl.common.domain.exception.BadRequestException;
|
||||||
import org.nl.common.enums.StatusEnum;
|
import org.nl.common.enums.StatusEnum;
|
||||||
|
import org.nl.common.utils.CodeUtil;
|
||||||
import org.nl.common.utils.ListOf;
|
import org.nl.common.utils.ListOf;
|
||||||
import org.nl.common.utils.SecurityUtils;
|
import org.nl.common.utils.SecurityUtils;
|
||||||
import org.nl.wms.dispatch_manage.task.service.dao.SchBaseTask;
|
import org.nl.wms.dispatch_manage.task.service.dao.SchBaseTask;
|
||||||
@@ -89,7 +90,7 @@ public class SchBaseTaskServiceImpl extends ServiceImpl<SchBaseTaskMapper, SchBa
|
|||||||
Assert.notNull(entity.getTask_status(), "任务状态不能为空!");
|
Assert.notNull(entity.getTask_status(), "任务状态不能为空!");
|
||||||
|
|
||||||
entity.setId(IdUtil.getSnowflake(1, 1).nextIdStr());
|
entity.setId(IdUtil.getSnowflake(1, 1).nextIdStr());
|
||||||
entity.setTask_code(IdUtil.getSnowflake(1, 1).nextIdStr());
|
entity.setTask_code(CodeUtil.getNewCode("TASK_CODE"));
|
||||||
entity.setCreate_name(nickName);
|
entity.setCreate_name(nickName);
|
||||||
entity.setCreate_time(now);
|
entity.setCreate_time(now);
|
||||||
entity.setUpdate_name(nickName);
|
entity.setUpdate_name(nickName);
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ import org.nl.wms.flow_manage.flow.service.deployment.dao.ActReProcdef;
|
|||||||
import org.nl.wms.flow_manage.flow.service.execution.dao.ActRuExecution;
|
import org.nl.wms.flow_manage.flow.service.execution.dao.ActRuExecution;
|
||||||
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.util.CollectionUtils;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
@@ -65,14 +66,28 @@ public class SubProcessActivityBehavior extends FlowNodeActivityBehavior<JSONObj
|
|||||||
List<JSONObject> subList = new ArrayList<>();
|
List<JSONObject> subList = new ArrayList<>();
|
||||||
for (int i = 0; i < items.size(); i++) {
|
for (int i = 0; i < items.size(); i++) {
|
||||||
JSONObject item = items.getJSONObject(i);
|
JSONObject item = items.getJSONObject(i);
|
||||||
String[] vehicle_codes = item.getString("vehicle_code").split(",");
|
JSONObject t = (JSONObject)item.remove("t");
|
||||||
|
String[] vehicle_codes = t.getString("vehicle_code").split(",");
|
||||||
for (String vehicle_code : vehicle_codes) {
|
for (String vehicle_code : vehicle_codes) {
|
||||||
|
JSONObject subt = new JSONObject(t);
|
||||||
|
subt.put("vehicle_code",vehicle_code);
|
||||||
JSONObject sub = new JSONObject(item);
|
JSONObject sub = new JSONObject(item);
|
||||||
sub.put("vehicle_code",vehicle_code);
|
sub.put("t",subt);
|
||||||
subList.add(sub);
|
subList.add(sub);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (subList!=null){
|
if (!CollectionUtils.isEmpty(subList)){
|
||||||
|
// for (JSONObject o : subList) {
|
||||||
|
// ExecutionEntity subEntity = new ExecutionEntity();
|
||||||
|
// subEntity.setParent_id(entity.getProc_inst_id());
|
||||||
|
// subEntity.setForm_id(entity.getForm_id());
|
||||||
|
// subEntity.setForm_type(entity.getForm_type());
|
||||||
|
// subEntity.setDeploymentId(entity.getDeploymentId());
|
||||||
|
// subEntity.setCurrentFlowElement(startEvent);
|
||||||
|
// subEntity.setT(o);
|
||||||
|
// //在endEvent中有个所有子流程结束的判断:如果判断成功会触发父流程:startEvent暂时通过等待处理防止自动流程导致endEvent判断出错
|
||||||
|
// commandExecutor.execute(new StartInstanceCmd(), subEntity);
|
||||||
|
// }
|
||||||
//子流程并行,子流程单一的时候直接串行
|
//子流程并行,子流程单一的时候直接串行
|
||||||
subList.stream().map((Function<Object, CompletableFuture>) o -> CompletableFuture.runAsync(() -> {
|
subList.stream().map((Function<Object, CompletableFuture>) o -> CompletableFuture.runAsync(() -> {
|
||||||
ExecutionEntity subEntity = new ExecutionEntity();
|
ExecutionEntity subEntity = new ExecutionEntity();
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ 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 org.nl.common.domain.exception.BadRequestException;
|
import org.nl.common.domain.exception.BadRequestException;
|
||||||
import org.nl.common.enums.StatusEnum;
|
import org.nl.common.enums.StatusEnum;
|
||||||
|
import org.nl.common.utils.ListOf;
|
||||||
import org.nl.common.utils.RedissonUtils;
|
import org.nl.common.utils.RedissonUtils;
|
||||||
import org.nl.wms.stor_manage.struct.service.IStIvtStructattrService;
|
import org.nl.wms.stor_manage.struct.service.IStIvtStructattrService;
|
||||||
import org.nl.wms.stor_manage.struct.service.dao.StIvtStructattr;
|
import org.nl.wms.stor_manage.struct.service.dao.StIvtStructattr;
|
||||||
@@ -16,6 +17,7 @@ import org.nl.wms.stor_manage.io.service.in.iostor_dtl.IStIvtIostorinvdtlService
|
|||||||
import org.nl.wms.stor_manage.io.service.in.iostor_dtl.dao.StIvtIostorinvdtl;
|
import org.nl.wms.stor_manage.io.service.in.iostor_dtl.dao.StIvtIostorinvdtl;
|
||||||
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.Propagation;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
@@ -64,7 +66,7 @@ public class DecisionHandler extends TypeHandler<JSONObject,ExecutionEntity<JSON
|
|||||||
item_json.put("struct_code",collect);
|
item_json.put("struct_code",collect);
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
@Transactional
|
@Transactional(propagation= Propagation.REQUIRES_NEW)
|
||||||
public List<StIvtStructattr> dispense(List<String> params, StIvtIostorinvdtl iostorinvdtl) {
|
public List<StIvtStructattr> dispense(List<String> params, StIvtIostorinvdtl iostorinvdtl) {
|
||||||
AtomicReference<List<StIvtStructattr>> structCode = new AtomicReference<>();
|
AtomicReference<List<StIvtStructattr>> structCode = new AtomicReference<>();
|
||||||
RedissonUtils.lock(()->{
|
RedissonUtils.lock(()->{
|
||||||
@@ -89,16 +91,22 @@ public class DecisionHandler extends TypeHandler<JSONObject,ExecutionEntity<JSON
|
|||||||
throw new BadRequestException("当前分配策略无可用货位");
|
throw new BadRequestException("当前分配策略无可用货位");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
System.out.println(list);
|
|
||||||
if (CollectionUtils.isEmpty(list)){
|
if (CollectionUtils.isEmpty(list)){
|
||||||
throw new BadRequestException("无可分配货位!");
|
throw new BadRequestException("无可分配货位!");
|
||||||
}
|
}
|
||||||
|
//如果是入库的话只分配一个,出库的话有可能多个货位
|
||||||
|
if (iostorinvdtl.getIn_storage()){
|
||||||
|
list= ListOf.of(list.get(0));
|
||||||
|
}
|
||||||
structCode.set(list);
|
structCode.set(list);
|
||||||
|
System.out.println("分配的货位"+list.toString());
|
||||||
iStIvtStructattrService.update(new UpdateWrapper<StIvtStructattr>()
|
iStIvtStructattrService.update(new UpdateWrapper<StIvtStructattr>()
|
||||||
// .set("vehicle_code", iostorinvdtl.getVehicle_code())
|
// .set("vehicle_code", iostorinvdtl.getVehicle_code())
|
||||||
.set("lock_type", StatusEnum.LOCK.code(iostorinvdtl.getIn_storage()?"入":"出"))
|
.set("lock_type", StatusEnum.LOCK.code(iostorinvdtl.getIn_storage()?"入":"出"))
|
||||||
.in("struct_code", list.stream().map(StIvtStructattr::getStruct_code).collect(Collectors.toList())));
|
.in("struct_code", list.stream().map(StIvtStructattr::getStruct_code).collect(Collectors.toList())));
|
||||||
},"入",2);
|
System.out.println("货位绑定成功");
|
||||||
|
},"入",2);
|
||||||
|
System.out.println("货位绑定成功------");
|
||||||
return structCode.get();
|
return structCode.get();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,6 +50,11 @@ public class FlowOperationServiceImpl implements IFlowOperationService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String startUp(String model_key, Consumer callback, ExecutionDto dto) {
|
public String startUp(String model_key, Consumer callback, ExecutionDto dto) {
|
||||||
|
ActRuExecution one = iActRuExecutionService.getOne(new QueryWrapper<ActRuExecution>()
|
||||||
|
.eq("form_type", dto.getForm_type()).eq("form_id", dto.getForm_id()));
|
||||||
|
if (one!=null){
|
||||||
|
throw new BadRequestException("当前单据流程已存在:"+dto.getForm_type()+"_"+dto.getForm_id());
|
||||||
|
}
|
||||||
ActReProcdef deployment = actReProcdefService.getCurrentVersion(model_key);
|
ActReProcdef deployment = actReProcdefService.getCurrentVersion(model_key);
|
||||||
if (deployment==null){
|
if (deployment==null){
|
||||||
throw new BadRequestException("当前单据类型未配置业务流程");
|
throw new BadRequestException("当前单据类型未配置业务流程");
|
||||||
@@ -64,8 +69,8 @@ public class FlowOperationServiceImpl implements IFlowOperationService {
|
|||||||
entity.setCurrentFlowElement(bpmnModel.getStartEvent());
|
entity.setCurrentFlowElement(bpmnModel.getStartEvent());
|
||||||
entity.setT(JSONObject.toJSON(dto));
|
entity.setT(JSONObject.toJSON(dto));
|
||||||
entity.setCallback(callback);
|
entity.setCallback(callback);
|
||||||
entity.setForm_type(dto.getSource_form_type());
|
entity.setForm_type(dto.getForm_type());
|
||||||
entity.setForm_id(dto.getSource_form_id());
|
entity.setForm_id(dto.getForm_id());
|
||||||
entity.setStartActivityId(entity.getActivityId());
|
entity.setStartActivityId(entity.getActivityId());
|
||||||
entity.setDeploymentId(deployment.getDeployment_id());
|
entity.setDeploymentId(deployment.getDeployment_id());
|
||||||
commandExecutor.execute(new StartInstanceCmd(),entity);
|
commandExecutor.execute(new StartInstanceCmd(),entity);
|
||||||
|
|||||||
@@ -41,13 +41,16 @@ public class StIvtIostorinvOutController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private ISchBaseTaskService iSchBaseTaskService;
|
private ISchBaseTaskService iSchBaseTaskService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@GetMapping
|
@GetMapping
|
||||||
public ResponseEntity<Object> getAll(StorInvOutQuery query, PageQuery page) {
|
public ResponseEntity<Object> getAll(StorInvOutQuery query, PageQuery page) {
|
||||||
Page<StIvtIostorinvOut> result = iStIvtIostorinvOutService.page(page.build(), query.build());
|
Page<StIvtIostorinvOut> result = iStIvtIostorinvOutService.page(page.build(), query.build());
|
||||||
return new ResponseEntity<>(TableDataInfo.build(result), HttpStatus.OK);
|
return new ResponseEntity<>(TableDataInfo.build(result), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
@PostMapping("delete")
|
||||||
|
public ResponseEntity<Object> delete(@RequestBody List<String> ids) {
|
||||||
|
iStIvtIostorinvOutService.removeByIds(ids);
|
||||||
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
|
}
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public ResponseEntity<Object> save(@RequestBody JSONObject form) {
|
public ResponseEntity<Object> save(@RequestBody JSONObject form) {
|
||||||
iStIvtIostorinvOutService.save(form);
|
iStIvtIostorinvOutService.save(form);
|
||||||
@@ -87,5 +90,11 @@ public class StIvtIostorinvOutController {
|
|||||||
List<Map> dis = iSchBaseTaskService.getByVehicle(dtl.getString("vehicle_code"));
|
List<Map> dis = iSchBaseTaskService.getByVehicle(dtl.getString("vehicle_code"));
|
||||||
return new ResponseEntity<>(TableDataInfo.build(dis),HttpStatus.OK);
|
return new ResponseEntity<>(TableDataInfo.build(dis),HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/taskOpen")
|
||||||
|
public ResponseEntity<Object> taskOpen(@RequestBody JSONObject dtl) {
|
||||||
|
iStIvtIostorinvOutService.taskOpen(dtl);
|
||||||
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,4 +20,6 @@ public interface IStIvtIostorinvOutService extends IService<StIvtIostorinvOut> {
|
|||||||
String dispense(JSONObject form);
|
String dispense(JSONObject form);
|
||||||
|
|
||||||
String canceldispense(JSONObject form);
|
String canceldispense(JSONObject form);
|
||||||
|
|
||||||
|
void taskOpen(JSONObject form);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,11 @@
|
|||||||
package org.nl.wms.stor_manage.io.service.out.iostor.dao;
|
package org.nl.wms.stor_manage.io.service.out.iostor.dao;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
@@ -15,7 +19,7 @@ import lombok.EqualsAndHashCode;
|
|||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
@TableName("st_ivt_iostorinv_out")
|
@TableName(value = "st_ivt_iostorinv_out", autoResultMap = true)
|
||||||
public class StIvtIostorinvOut implements Serializable {
|
public class StIvtIostorinvOut implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
@@ -33,7 +37,7 @@ public class StIvtIostorinvOut implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 出入类型
|
* 出入类型
|
||||||
*/
|
*/
|
||||||
private Boolean bill_type;
|
private String bill_type;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -90,7 +94,8 @@ public class StIvtIostorinvOut implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 自定义映射数据
|
* 自定义映射数据
|
||||||
*/
|
*/
|
||||||
private String form_data;
|
@TableField(typeHandler = FastjsonTypeHandler.class)
|
||||||
|
private JSONObject form_data;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,10 +7,16 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.nl.common.domain.exception.BadRequestException;
|
import org.nl.common.domain.exception.BadRequestException;
|
||||||
import org.nl.common.enums.StatusEnum;
|
import org.nl.common.enums.StatusEnum;
|
||||||
|
import org.nl.common.publish.BussEventMulticaster;
|
||||||
import org.nl.common.utils.CodeUtil;
|
import org.nl.common.utils.CodeUtil;
|
||||||
import org.nl.common.utils.IdUtil;
|
import org.nl.common.utils.IdUtil;
|
||||||
|
import org.nl.common.utils.MapOf;
|
||||||
import org.nl.common.utils.SecurityUtils;
|
import org.nl.common.utils.SecurityUtils;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.nl.wms.base_manage.vehicle.vehicleMater.service.dao.MdPbVehicleMater;
|
||||||
|
import org.nl.wms.flow_manage.monitor.event.FlowStartEvent;
|
||||||
|
import org.nl.wms.md_manage.group_dick.service.dao.MdGruopDick;
|
||||||
|
import org.nl.wms.md_manage.group_dick.service.dao.MdGruopDtl;
|
||||||
import org.nl.wms.stor_manage.io.service.out.iostor.IStIvtIostorinvOutService;
|
import org.nl.wms.stor_manage.io.service.out.iostor.IStIvtIostorinvOutService;
|
||||||
import org.nl.wms.stor_manage.io.service.out.iostor.dao.StIvtIostorinvOut;
|
import org.nl.wms.stor_manage.io.service.out.iostor.dao.StIvtIostorinvOut;
|
||||||
import org.nl.wms.stor_manage.io.service.out.iostor.dao.mapper.StIvtIostorinvOutMapper;
|
import org.nl.wms.stor_manage.io.service.out.iostor.dao.mapper.StIvtIostorinvOutMapper;
|
||||||
@@ -23,9 +29,11 @@ import org.springframework.stereotype.Service;
|
|||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.function.Consumer;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -111,4 +119,31 @@ public class StIvtIostorinvOutServiceImpl extends ServiceImpl<StIvtIostorinvOutM
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void taskOpen(JSONObject form) {
|
||||||
|
|
||||||
|
StIvtIostorinvOut iostorinv = form.toJavaObject(StIvtIostorinvOut.class);
|
||||||
|
//查询明细
|
||||||
|
List<StIvtIostorinvdtlOut> dtls = iStIvtIostorinvDtlOutService.list(new QueryWrapper<StIvtIostorinvdtlOut>().eq("inv_id", iostorinv.getId()));
|
||||||
|
List<Map> dtlJson = new ArrayList<>();
|
||||||
|
if (!CollectionUtils.isEmpty(dtls)){
|
||||||
|
for (StIvtIostorinvdtlOut dtl : dtls) {
|
||||||
|
dtlJson.add(MapOf.of("form_id",dtl.getId()
|
||||||
|
,"t",JSONObject.toJSON(dtl)
|
||||||
|
,"source_form_type",dtl.getSource_form_type()
|
||||||
|
,"source_form_id",dtl.getSource_form_id()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
BussEventMulticaster.Publish(new FlowStartEvent("st_ivt_iostorinv_out", null)
|
||||||
|
.build("st_ivt_iostorinv_out",iostorinv.getId(),iostorinv.getSource_form_type(),iostorinv.getSource_form_id(),form)
|
||||||
|
.build("st_ivt_iostorinvdtl_out",dtlJson)
|
||||||
|
,true);
|
||||||
|
|
||||||
|
this.update(new UpdateWrapper<StIvtIostorinvOut>()
|
||||||
|
.set("status",StatusEnum.FORM_STATUS.code("执行中"))
|
||||||
|
.set("update_time",DateUtil.now())
|
||||||
|
.set("update_name",SecurityUtils.getCurrentNickName())
|
||||||
|
.eq("id",form.getString("id")));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,8 @@ import org.nl.wms.flow_manage.monitor.event.FlowEndEvent;
|
|||||||
import org.nl.wms.flow_manage.monitor.event.FlowStartEvent;
|
import org.nl.wms.flow_manage.monitor.event.FlowStartEvent;
|
||||||
import org.nl.wms.stor_manage.io.service.in.iostor.IStIvtIostorinvInService;
|
import org.nl.wms.stor_manage.io.service.in.iostor.IStIvtIostorinvInService;
|
||||||
import org.nl.wms.stor_manage.io.service.in.iostor.dao.StIvtIostorinvIn;
|
import org.nl.wms.stor_manage.io.service.in.iostor.dao.StIvtIostorinvIn;
|
||||||
|
import org.nl.wms.stor_manage.io.service.out.iostor.IStIvtIostorinvOutService;
|
||||||
|
import org.nl.wms.stor_manage.io.service.out.iostor.dao.StIvtIostorinvOut;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
@@ -27,6 +29,8 @@ public class FlowEndEventListener extends AbstraceListener<FlowEndEvent> {
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IStIvtIostorinvInService iStIvtIostorinvInService;
|
private IStIvtIostorinvInService iStIvtIostorinvInService;
|
||||||
|
@Autowired
|
||||||
|
private IStIvtIostorinvOutService iStIvtIostorinvOutService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String doEvent(FlowEndEvent event) {
|
protected String doEvent(FlowEndEvent event) {
|
||||||
@@ -41,6 +45,11 @@ public class FlowEndEventListener extends AbstraceListener<FlowEndEvent> {
|
|||||||
.set("status", StatusEnum.FORM_STATUS.code("完成"))
|
.set("status", StatusEnum.FORM_STATUS.code("完成"))
|
||||||
.set("update_time", DateUtil.now()).eq("id",form_id));
|
.set("update_time", DateUtil.now()).eq("id",form_id));
|
||||||
}
|
}
|
||||||
|
if (form_type.equals("st_ivt_iostorinv_out")){
|
||||||
|
iStIvtIostorinvOutService.update(new UpdateWrapper<StIvtIostorinvOut>()
|
||||||
|
.set("status", StatusEnum.FORM_STATUS.code("完成"))
|
||||||
|
.set("update_time", DateUtil.now()).eq("id",form_id));
|
||||||
|
}
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,7 +39,8 @@ public class StructEventListener extends AbstraceListener<StructEvent> {
|
|||||||
}
|
}
|
||||||
if (task_status.equals(StatusEnum.FORM_STATUS.code("完成"))){
|
if (task_status.equals(StatusEnum.FORM_STATUS.code("完成"))){
|
||||||
//更新出入库单明细状态;如果单据类型是其他的则从from-data表中更新
|
//更新出入库单明细状态;如果单据类型是其他的则从from-data表中更新
|
||||||
structattrService.changeStruct(event.getStruct_code(),event.getVehicle_code(),task_type);
|
Boolean in = StatusEnum.IOBILL_TYPE_IN.check(task_type);
|
||||||
|
structattrService.changeStruct(in?event.getPoint_code2():event.getPoint_code1(),in?event.getVehicle_code():null,task_type);
|
||||||
}
|
}
|
||||||
if (task_status.equals(StatusEnum.FORM_STATUS.code("取消"))){
|
if (task_status.equals(StatusEnum.FORM_STATUS.code("取消"))){
|
||||||
|
|
||||||
|
|||||||
@@ -38,6 +38,10 @@ public class StIvtStructivtflow implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private String struct_code;
|
private String struct_code;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 载具编码
|
||||||
|
*/
|
||||||
|
private String vehicle_code;
|
||||||
/**
|
/**
|
||||||
* 物料标识
|
* 物料标识
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -127,6 +127,15 @@ public class StIvtStructattr implements Serializable {
|
|||||||
* 创建时间
|
* 创建时间
|
||||||
*/
|
*/
|
||||||
private String create_time;
|
private String create_time;
|
||||||
|
/**
|
||||||
|
* 修改时间
|
||||||
|
*/
|
||||||
|
private String update_time;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改人
|
||||||
|
*/
|
||||||
|
private String update_name;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否临时仓位
|
* 是否临时仓位
|
||||||
|
|||||||
@@ -65,18 +65,20 @@ public class StIvtStructattrServiceImpl extends ServiceImpl<StIvtStructattrMappe
|
|||||||
@Override
|
@Override
|
||||||
public void changeStruct(String struct_code, String vehicle_code, String task_type) {
|
public void changeStruct(String struct_code, String vehicle_code, String task_type) {
|
||||||
List<MdPbVehicleMater> vehicleMaters = vehicleMaterService.list(new QueryWrapper<MdPbVehicleMater>().eq("vehicle_code", vehicle_code));
|
List<MdPbVehicleMater> vehicleMaters = vehicleMaterService.list(new QueryWrapper<MdPbVehicleMater>().eq("vehicle_code", vehicle_code));
|
||||||
this.update(new UpdateWrapper<StIvtStructattr>()
|
|
||||||
.set("vehicle_code",vehicle_code)
|
|
||||||
.set("lock_type", StatusEnum.LOCK.code("无"))
|
|
||||||
.eq("struct_code",struct_code));
|
|
||||||
Boolean in = StatusEnum.TASK_TYPE.check(task_type);
|
|
||||||
|
|
||||||
String now = DateUtil.now();
|
String now = DateUtil.now();
|
||||||
|
|
||||||
|
this.update(new UpdateWrapper<StIvtStructattr>()
|
||||||
|
.set("vehicle_code",vehicle_code)
|
||||||
|
.set("update_time",now)
|
||||||
|
.set("lock_type", StatusEnum.LOCK.code("无"))
|
||||||
|
.eq("struct_code",struct_code));
|
||||||
|
|
||||||
List<StIvtStructivtflow> records = new ArrayList<>();
|
List<StIvtStructivtflow> records = new ArrayList<>();
|
||||||
for (MdPbVehicleMater vehicleMater : vehicleMaters) {
|
for (MdPbVehicleMater vehicleMater : vehicleMaters) {
|
||||||
StIvtStructivtflow record = new StIvtStructivtflow();
|
StIvtStructivtflow record = new StIvtStructivtflow();
|
||||||
record.setId(IdUtil.getStringId());
|
record.setId(IdUtil.getStringId());
|
||||||
record.setUpdate_time(now);
|
record.setUpdate_time(now);
|
||||||
|
record.setVehicle_code(vehicleMater.getVehicle_code());
|
||||||
record.setMaterial_id(vehicleMater.getMaterial_id());
|
record.setMaterial_id(vehicleMater.getMaterial_id());
|
||||||
record.setPcsn(vehicleMater.getPcsn());
|
record.setPcsn(vehicleMater.getPcsn());
|
||||||
record.setQty(vehicleMater.getQty());
|
record.setQty(vehicleMater.getQty());
|
||||||
@@ -87,7 +89,7 @@ public class StIvtStructattrServiceImpl extends ServiceImpl<StIvtStructattrMappe
|
|||||||
record.setUnit_id(vehicleMater.getUnit_id());
|
record.setUnit_id(vehicleMater.getUnit_id());
|
||||||
record.setStruct_code(struct_code);
|
record.setStruct_code(struct_code);
|
||||||
record.setVehicle_form_data(vehicleMater.getForm_data());
|
record.setVehicle_form_data(vehicleMater.getForm_data());
|
||||||
record.setGrowth(in);
|
record.setGrowth( StatusEnum.IOBILL_TYPE_IN.check(task_type));
|
||||||
records.add(record);
|
records.add(record);
|
||||||
}
|
}
|
||||||
structivtflowService.saveBatch(records);
|
structivtflowService.saveBatch(records);
|
||||||
|
|||||||
@@ -247,11 +247,10 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
[CRUD.HOOK.beforeSubmit]() {
|
[CRUD.HOOK.beforeSubmit]() {
|
||||||
debugger
|
|
||||||
// 提交前校验
|
// 提交前校验
|
||||||
if (this.tableData.length === 0) {
|
if (this.tableData.length === 0) {
|
||||||
this.crud.notify('请至少选择一条明细', CRUD.NOTIFICATION_TYPE.INFO)
|
this.crud.notify('请至少选择一条明细', CRUD.NOTIFICATION_TYPE.INFO)
|
||||||
return true
|
return false
|
||||||
}
|
}
|
||||||
this.form.item = this.tableData
|
this.form.item = this.tableData
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
@change="crud.toQuery"
|
@change="crud.toQuery"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in dict.IOBILL_TYPE_IN"
|
v-for="item in statusEnum.IOBILL_TYPE_IN"
|
||||||
:key="item.value"
|
:key="item.value"
|
||||||
:label="item.label"
|
:label="item.label"
|
||||||
:value="item.value"
|
:value="item.value"
|
||||||
@@ -80,7 +80,7 @@
|
|||||||
@change="crud.toQuery"
|
@change="crud.toQuery"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in dict.FORM_STATUS"
|
v-for="item in statusEnum.FORM_STATUS"
|
||||||
:key="item.value"
|
:key="item.value"
|
||||||
:label="item.label"
|
:label="item.label"
|
||||||
:value="item.value"
|
:value="item.value"
|
||||||
@@ -144,12 +144,12 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="bill_type" label="业务类型">
|
<el-table-column prop="bill_type" label="业务类型">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
{{ dict.label.IOBILL_TYPE_IN[scope.row.bill_type] }}
|
{{ statusEnum.label.IOBILL_TYPE_IN[scope.row.bill_type] }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="status" label="状态">
|
<el-table-column prop="status" label="状态">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
{{ dict.label.FORM_STATUS[scope.row.status] }}
|
{{ statusEnum.label.FORM_STATUS[scope.row.status] }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column show-overflow-tooltip prop="source_form_type" min-width="120" label="源单类型" />
|
<el-table-column show-overflow-tooltip prop="source_form_type" min-width="120" label="源单类型" />
|
||||||
@@ -215,7 +215,7 @@ export default {
|
|||||||
},
|
},
|
||||||
mixins: [presenter(), header(), crud()],
|
mixins: [presenter(), header(), crud()],
|
||||||
// 数据字典
|
// 数据字典
|
||||||
dicts: [ 'FORM_STATUS','IOBILL_TYPE_IN' ],
|
statusEnums: [ 'FORM_STATUS','IOBILL_TYPE_IN' ],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
cols:[],
|
cols:[],
|
||||||
@@ -280,7 +280,7 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
stateFormat(row, column) {
|
stateFormat(row, column) {
|
||||||
return this.dict.label.IO_BILL_STATUS[row.bill_status]
|
return this.statusEnum.label.IO_BILL_STATUS[row.bill_status]
|
||||||
},
|
},
|
||||||
divOpen() {
|
divOpen() {
|
||||||
crudProductIn.getIosInvDtl({ 'bill_code': this.currentRow.bill_code }).then(res => {
|
crudProductIn.getIosInvDtl({ 'bill_code': this.currentRow.bill_code }).then(res => {
|
||||||
@@ -347,7 +347,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
bill_typeFormat(row, column) {
|
bill_typeFormat(row, column) {
|
||||||
return this.dict.label.ST_INV_CP_IN_TYPE[row.bill_type]
|
return this.statusEnum.label.ST_INV_CP_IN_TYPE[row.bill_type]
|
||||||
},
|
},
|
||||||
querytable() {
|
querytable() {
|
||||||
this.onSelectAll()
|
this.onSelectAll()
|
||||||
|
|||||||
@@ -232,7 +232,9 @@ export default {
|
|||||||
storlist: [],
|
storlist: [],
|
||||||
billtypelist: [],
|
billtypelist: [],
|
||||||
rules: {
|
rules: {
|
||||||
|
bill_type: [
|
||||||
|
{ required: true, message: '单据类型不能为空', trigger: 'blur' }
|
||||||
|
],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -276,11 +278,10 @@ export default {
|
|||||||
this.materShow = true
|
this.materShow = true
|
||||||
},
|
},
|
||||||
[CRUD.HOOK.beforeSubmit]() {
|
[CRUD.HOOK.beforeSubmit]() {
|
||||||
debugger
|
|
||||||
// 提交前校验
|
// 提交前校验
|
||||||
if (this.tableData.length === 0) {
|
if (this.tableData.length === 0) {
|
||||||
this.crud.notify('请至少选择一条明细', CRUD.NOTIFICATION_TYPE.INFO)
|
this.crud.notify('请至少选择一条明细', CRUD.NOTIFICATION_TYPE.INFO)
|
||||||
return true
|
return false
|
||||||
}
|
}
|
||||||
this.form.item = this.tableData
|
this.form.item = this.tableData
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -254,7 +254,7 @@ export default {
|
|||||||
this.tableData = res
|
this.tableData = res
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
this.divdis(row)
|
this.tabledis = []
|
||||||
},
|
},
|
||||||
divCancel() {
|
divCancel() {
|
||||||
if (!this.currentDtl) {
|
if (!this.currentDtl) {
|
||||||
@@ -266,7 +266,7 @@ export default {
|
|||||||
this.tableData = res
|
this.tableData = res
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
this.divdis(row)
|
this.tabledis = []
|
||||||
},
|
},
|
||||||
divdis(row){
|
divdis(row){
|
||||||
crudProductout.divDis(row).then(res => {
|
crudProductout.divDis(row).then(res => {
|
||||||
|
|||||||
@@ -13,25 +13,6 @@
|
|||||||
<label slot="label">单 据 号:</label>
|
<label slot="label">单 据 号:</label>
|
||||||
<el-input v-model="form.code" disabled clearable style="width: 210px" />
|
<el-input v-model="form.code" disabled clearable style="width: 210px" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="仓 库">
|
|
||||||
<el-select
|
|
||||||
style="width: 210px"
|
|
||||||
v-model="form.product_code"
|
|
||||||
clearable
|
|
||||||
size="mini"
|
|
||||||
placeholder="全部"
|
|
||||||
:disabled="true"
|
|
||||||
class="filter-item"
|
|
||||||
@change="crud.toQuery"
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="item in dict.product_area"
|
|
||||||
:key="item.value"
|
|
||||||
:label="item.label"
|
|
||||||
:value="item.value"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="业务类型">
|
<el-form-item label="业务类型">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="form.bill_type"
|
v-model="form.bill_type"
|
||||||
@@ -44,7 +25,7 @@
|
|||||||
class="filter-item"
|
class="filter-item"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in dict.IOBILL_TYPE_OUT"
|
v-for="item in statusEnum.IOBILL_TYPE_OUT"
|
||||||
:key="item.value"
|
:key="item.value"
|
||||||
:label="item.label"
|
:label="item.label"
|
||||||
:value="item.value"
|
:value="item.value"
|
||||||
@@ -60,7 +41,7 @@
|
|||||||
disabled
|
disabled
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in dict.FORM_STATUS"
|
v-for="item in statusEnum.FORM_STATUS"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
:label="item.label"
|
:label="item.label"
|
||||||
:value="item.value"
|
:value="item.value"
|
||||||
@@ -138,19 +119,23 @@
|
|||||||
border
|
border
|
||||||
:highlight-current-row="true"
|
:highlight-current-row="true"
|
||||||
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
||||||
@current-change="handleDisCurrentChange"
|
|
||||||
>
|
>
|
||||||
|
<el-table-column show-overflow-tooltip prop="vehicle_code" label="托盘号" align="center" />
|
||||||
<el-table-column min-width="120" show-overflow-tooltip prop="material_code" label="物料编码" align="center" />
|
<el-table-column min-width="120" show-overflow-tooltip prop="material_code" label="物料编码" align="center" />
|
||||||
<el-table-column min-width="120" show-overflow-tooltip prop="material_name" label="物料名称" align="center" />
|
<el-table-column min-width="120" show-overflow-tooltip prop="material_name" label="物料名称" align="center" />
|
||||||
<el-table-column min-width="120" show-overflow-tooltip prop="material_spec" label="物料规格" align="center" />
|
<el-table-column min-width="120" show-overflow-tooltip prop="material_spec" label="物料规格" align="center" />
|
||||||
<el-table-column prop="pcsn" label="批次" align="center" width="150" />
|
<el-table-column prop="pcsn" label="批次" align="center" width="150" />
|
||||||
<el-table-column show-overflow-tooltip prop="vehicle_code" label="托盘号" align="center" />
|
<el-table-column prop="qty" :formatter="crud.formatNum3" label="数量" align="center" />
|
||||||
<el-table-column show-overflow-tooltip prop="bucketunique" label="箱号" align="center" />
|
<el-table-column min-width="120" show-overflow-tooltip prop="stor_code" label="仓库" align="center" />
|
||||||
<el-table-column prop="plan_qty" :formatter="crud.formatNum3" label="数量" align="center" />
|
<el-table-column min-width="120" show-overflow-tooltip prop="struct_code" label="载具所在仓位" align="center" />
|
||||||
<el-table-column prop="point_code1" label="起始位置" align="center" width="120"/>
|
<el-table-column prop="point_code1" label="任务起始位置" align="center" width="120"/>
|
||||||
<el-table-column prop="point_code2" label="目的位置" align="center" width="120"/>
|
<el-table-column prop="point_code2" label="任务目的位置" align="center" width="120"/>
|
||||||
<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" :formatter="formatStatus"/>
|
<el-table-column prop="task_status" label="任务状态">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ statusEnum.label.FORM_STATUS[scope.row.task_status] }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column prop="source_form_type" label="源单类型" align="center" width="150"/>
|
<el-table-column prop="source_form_type" label="源单类型" align="center" width="150"/>
|
||||||
<el-table-column show-overflow-tooltip prop="source_form_id" label="源单id" align="center" width="150"/>
|
<el-table-column show-overflow-tooltip prop="source_form_id" label="源单id" align="center" width="150"/>
|
||||||
</el-table>
|
</el-table>
|
||||||
@@ -168,7 +153,7 @@ export default {
|
|||||||
name: 'ViewDialog',
|
name: 'ViewDialog',
|
||||||
components: { formstruc },
|
components: { formstruc },
|
||||||
mixins: [crud()],
|
mixins: [crud()],
|
||||||
dicts: [ 'FORM_STATUS','IOBILL_TYPE_OUT' ],
|
statusEnums: [ 'FORM_STATUS','IOBILL_TYPE_OUT' ],
|
||||||
props: {
|
props: {
|
||||||
dialogShow: {
|
dialogShow: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
@@ -221,15 +206,11 @@ export default {
|
|||||||
close() {
|
close() {
|
||||||
this.dialogVisible = false
|
this.dialogVisible = false
|
||||||
},
|
},
|
||||||
stateFormat(row, column) {
|
|
||||||
return this.dict.label.FORM_STATUS[row.bill_status]
|
|
||||||
},
|
|
||||||
|
|
||||||
handleDtlCurrentChange(current) {
|
handleDtlCurrentChange(current) {
|
||||||
if (current !== null) {
|
if (current !== null) {
|
||||||
this.tabledis = []
|
this.tabledis = []
|
||||||
this.currentdtl = current
|
this.currentdtl = current
|
||||||
this.queryTableDdis()
|
this.divdis(this.currentdtl)
|
||||||
} else {
|
} else {
|
||||||
this.tabledis = []
|
this.tabledis = []
|
||||||
this.currentdtl = {}
|
this.currentdtl = {}
|
||||||
@@ -242,28 +223,15 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleDisCurrentChange(current) {
|
|
||||||
this.currentDis = current
|
|
||||||
},
|
|
||||||
queryTableDtl(id) {
|
queryTableDtl(id) {
|
||||||
crudProductIn.getIosInvDtl(id).then(res => {
|
crudProductIn.getIosInvDtl(id).then(res => {
|
||||||
this.tableDtl = res
|
this.tableDtl = res
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
queryTableDdis() {
|
divdis(row){
|
||||||
if (this.currentdtl !== null) {
|
crudProductIn.divDis(row).then(res => {
|
||||||
crudProductIn.getVehicleTask({ 'vehicle_code': this.currentdtl.vehicle_code }).then(res => {
|
this.tabledis = res.content
|
||||||
this.tabledis = res
|
})
|
||||||
}).catch(() => {
|
|
||||||
this.tabledis = []
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
formatStatus(row) {
|
|
||||||
return this.dict.label.FORM_STATUS[row.task_status]
|
|
||||||
},
|
|
||||||
formatBaseType(row) {
|
|
||||||
return this.dict.label.PCS_SAL_TYPE[row.base_bill_type]
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -154,8 +154,6 @@
|
|||||||
<udOperation
|
<udOperation
|
||||||
:data="scope.row"
|
:data="scope.row"
|
||||||
:permission="permission"
|
:permission="permission"
|
||||||
:disabled-edit="canUd(scope.row)"
|
|
||||||
:disabled-dle="canUd(scope.row)"
|
|
||||||
/>
|
/>
|
||||||
</template>-->
|
</template>-->
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@@ -282,16 +280,22 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
taskOpen() {
|
taskOpen() {
|
||||||
crudProductOut.getIosInvDtl({ 'bill_code': this.currentRow.bill_code }).then(res => {
|
if (!this.currentRow) {
|
||||||
this.taskOpenParam = res
|
this.crud.notify('请选择一条单据', CRUD.NOTIFICATION_TYPE.INFO)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
crudProductOut.taskOpen(this.currentRow ).then(res => {
|
||||||
|
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||||
|
this.crud.toQuery()
|
||||||
})
|
})
|
||||||
this.taskShow = true
|
|
||||||
},
|
},
|
||||||
fun(val) {
|
handleCurrentChange(currentRow) {
|
||||||
return Number(val).toFixed(3)
|
if (currentRow === null) {
|
||||||
},
|
this.dis_flag = true
|
||||||
canUd(row) {
|
this.confirm_flag = true
|
||||||
return row.bill_status !== '10'
|
this.task_flag = true
|
||||||
|
this.currentRow = {}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
handleSelectionChange(val, row) {
|
handleSelectionChange(val, row) {
|
||||||
if (val.length > 1) {
|
if (val.length > 1) {
|
||||||
@@ -304,10 +308,6 @@ export default {
|
|||||||
this.handleCurrentChange(null)
|
this.handleCurrentChange(null)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onSelectAll() {
|
|
||||||
this.$refs.table.clearSelection()
|
|
||||||
this.handleCurrentChange(null)
|
|
||||||
},
|
|
||||||
buttonChange(currentRow) {
|
buttonChange(currentRow) {
|
||||||
if (currentRow !== null) {
|
if (currentRow !== null) {
|
||||||
this.currentRow = currentRow
|
this.currentRow = currentRow
|
||||||
@@ -328,16 +328,9 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleCurrentChange(currentRow) {
|
onSelectAll() {
|
||||||
if (currentRow === null) {
|
this.$refs.table.clearSelection()
|
||||||
this.dis_flag = true
|
this.handleCurrentChange(null)
|
||||||
this.confirm_flag = true
|
|
||||||
this.task_flag = true
|
|
||||||
this.currentRow = {}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
bill_typeFormat(row, column) {
|
|
||||||
return this.dict.label.ST_outV_CP_out_TYPE[row.bill_type]
|
|
||||||
},
|
},
|
||||||
querytable() {
|
querytable() {
|
||||||
this.onSelectAll()
|
this.onSelectAll()
|
||||||
|
|||||||
@@ -59,6 +59,13 @@ export function divDis(data) {
|
|||||||
data
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
export function taskOpen(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/stIvtIostorinvOut/taskOpen',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
export default {
|
export default {
|
||||||
add,
|
add,
|
||||||
edit,
|
edit,
|
||||||
@@ -68,4 +75,5 @@ export default {
|
|||||||
outDecision,
|
outDecision,
|
||||||
cancelDecision,
|
cancelDecision,
|
||||||
divDis,
|
divDis,
|
||||||
|
taskOpen,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user