Merge branch 'master' of http://121.40.234.130:8899/root/hl_one
This commit is contained in:
@@ -4,7 +4,8 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.enums.AcsTaskEnum;
|
||||
import org.nl.modules.wql.util.SpringContextHolder;
|
||||
import org.nl.wms.ext.acs.service.impl.AcsToWmsServiceImpl;
|
||||
import org.nl.wms.product_manage.sch.tasks.SpeMachineryTask;
|
||||
import org.nl.wms.product_manage.sch.tasks.SpeMachinery.SpeEmpTask;
|
||||
import org.nl.wms.product_manage.sch.tasks.SpeMachinery.SpeFullTask;
|
||||
import org.nl.wms.product_manage.sch.tasks.WashMachineryTask;
|
||||
import org.nl.wms.product_manage.sch.tasks.callMaterial.WrapCallMaterialTask;
|
||||
import org.nl.wms.product_manage.sch.tasks.sendEmpty.WrapSendEmptyTask;
|
||||
@@ -19,8 +20,8 @@ public class ConventConfig implements SmartLifecycle {
|
||||
|
||||
@Override
|
||||
public void start() {
|
||||
AcsToWmsServiceImpl.Task_Collent.put(AcsTaskEnum.REQUEST_CALLTYPE_FULL, SpringContextHolder.getBean(SpeMachineryTask.class));
|
||||
AcsToWmsServiceImpl.Task_Collent.put(AcsTaskEnum.REQUEST_CALLTYPE_EMP, SpringContextHolder.getBean(SpeMachineryTask.class));
|
||||
AcsToWmsServiceImpl.Task_Collent.put(AcsTaskEnum.REQUEST_CALLTYPE_FULL, SpringContextHolder.getBean(SpeFullTask.class));
|
||||
AcsToWmsServiceImpl.Task_Collent.put(AcsTaskEnum.REQUEST_CALLTYPE_EMP, SpringContextHolder.getBean(SpeEmpTask.class));
|
||||
AcsToWmsServiceImpl.Task_Collent.put(AcsTaskEnum.REQUEST_WASH_EMP, SpringContextHolder.getBean(WashMachineryTask.class));
|
||||
AcsToWmsServiceImpl.Task_Collent.put(AcsTaskEnum.REQUEST_PLOTTER_SEND_FULL, SpringContextHolder.getBean(PlotterSendMaterialTask.class));
|
||||
AcsToWmsServiceImpl.Task_Collent.put(AcsTaskEnum.REQUEST_WARP_CALL_FULL, SpringContextHolder.getBean(WrapCallMaterialTask.class));
|
||||
|
||||
@@ -57,10 +57,10 @@ public class CodeGenerator {
|
||||
mpg.setGlobalConfig(gc);
|
||||
// 数据源配置
|
||||
DataSourceConfig dsc = new DataSourceConfig();
|
||||
dsc.setUrl("jdbc:mysql://192.168.81.252:3306/hl_one_mes?setUnicode=true&characterEncoding=utf8");
|
||||
dsc.setUrl("jdbc:mysql://192.168.46.5:3306/hl_one_mes_test?serverTimezone=GMT&setUnicode=true&characterEncoding=utf8");
|
||||
dsc.setDriverName("com.mysql.cj.jdbc.Driver");
|
||||
dsc.setUsername("root");
|
||||
dsc.setPassword("Root.123456");
|
||||
dsc.setPassword("123456");
|
||||
mpg.setDataSource(dsc);
|
||||
// 包配置
|
||||
PackageConfig pc = new PackageConfig();
|
||||
|
||||
@@ -1,25 +1,33 @@
|
||||
package org.nl.wms.ext.acs.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.hutool.crypto.digest.MD5;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.nl.common.domain.ConstantParam;
|
||||
import org.nl.common.enums.StatusEnum;
|
||||
import org.nl.common.utils.MapOf;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.wql.WQL;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.common.utils.PointLockUtils;
|
||||
import org.nl.wms.product_manage.service.device.IPdmBiDeviceService;
|
||||
import org.nl.wms.scheduler_manage.service.cacheline.ISchCachelineVehicleService;
|
||||
import org.nl.wms.scheduler_manage.service.cacheline.dao.SchCachelineVehicle;
|
||||
import org.nl.wms.scheduler_manage.service.point.ISchBasePointService;
|
||||
import org.nl.wms.scheduler_manage.service.point.dao.SchBasePoint;
|
||||
import org.nl.wms.scheduler_manage.service.scheduler.ISchProcessRouteService;
|
||||
import org.nl.wms.scheduler_manage.service.scheduler.SchedulerService;
|
||||
import org.nl.wms.scheduler_manage.service.scheduler.dao.SchProcessRoute;
|
||||
import org.nl.wms.scheduler_manage.service.scheduler.labelConverter.impl.FlowElement;
|
||||
import org.nl.wms.scheduler_manage.service.task.ISchBaseTaskService;
|
||||
import org.nl.wms.scheduler_manage.service.task.dao.SchBaseTask;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/*
|
||||
@@ -33,12 +41,18 @@ public class AgvInstService {
|
||||
|
||||
@Autowired
|
||||
private ISchBasePointService basePointService;
|
||||
@Autowired
|
||||
private SchedulerService schedulerService;
|
||||
@Autowired
|
||||
private ISchProcessRouteService schProcessRouteService;
|
||||
@Autowired
|
||||
private IPdmBiDeviceService deviceService;
|
||||
@Autowired
|
||||
private ISchBaseTaskService taskService;
|
||||
@Autowired
|
||||
private ISchCachelineVehicleService cachelineVehicleService;
|
||||
|
||||
|
||||
public static void main(String[] args) {
|
||||
String a = "HCX04JG04_SHCX04";
|
||||
MD5 md5 = MD5.create();
|
||||
System.out.println(md5.digest(a));
|
||||
}
|
||||
|
||||
//满料请求点位确认
|
||||
//1.判断当前设备路由表是否配置下一道路由设备,如果不是则说明直接到清洗
|
||||
@@ -47,59 +61,79 @@ public class AgvInstService {
|
||||
//4.有则创建agv指令,
|
||||
// 没有则创建缓存架任务
|
||||
public void fullMaster(JSONObject task){
|
||||
String point_code = task.getString("point_code1");
|
||||
String quantity = task.getString("material_qty");
|
||||
//获取当前生产工序下一道工序
|
||||
Map<String,String> workprodure = basePointService.findDeviceWorkprodure(task.getString("point_code"));
|
||||
FlowElement next = getFlowElement(task,workprodure).next();
|
||||
String nextPoint = null;
|
||||
//判断缓存线是不是去深坑清洗:深坑区域15个点:判断空的物料坑位:
|
||||
String cacheVehile = "";
|
||||
Map query = MapOf.of("workprocedure_id", workprodure.get("workprocedure_id")
|
||||
, "qty", quantity);
|
||||
if (next.getName().equals("深坑清洗")){
|
||||
query.put("material_id",task.getString("material_id"));
|
||||
}
|
||||
List<Map<String,String>> list = deviceService.workproceduceDevices(query);
|
||||
|
||||
if (!CollectionUtils.isEmpty(list)){
|
||||
nextPoint = list.get(0).get("point_code");
|
||||
}else {
|
||||
if (next.getParams().get("cacheLine") == null){
|
||||
throw new BadRequestException("当前任务下一道工序无可用设备");
|
||||
}
|
||||
nextPoint = next.getParams().get("cacheLine");
|
||||
cacheVehile = getCacheVehile(nextPoint, null);
|
||||
}
|
||||
if (StringUtils.isBlank(nextPoint)){
|
||||
throw new BadRequestException("逻辑非配错误,请检查代码");
|
||||
}
|
||||
basePointService.update(new UpdateWrapper<SchBasePoint>()
|
||||
.set("lock_type",StatusEnum.LOCK_ON.getCode()).set("task_id",task.getString("task_id")).eq("point_code",nextPoint));
|
||||
|
||||
SchBaseTask schBaseTask = task.toJavaObject(SchBaseTask.class);
|
||||
schBaseTask.setVehicle_code(cacheVehile);
|
||||
schBaseTask.setPoint_code2(nextPoint);
|
||||
schBaseTask.setTask_status(StatusEnum.TASK_START_END_P.getCode());
|
||||
schBaseTask.setUpdate_time(new Date());
|
||||
taskService.updateById(schBaseTask);
|
||||
};
|
||||
|
||||
public FlowElement getFlowElement(JSONObject task,Map<String,String> workprodure){
|
||||
if (CollectionUtils.isEmpty(workprodure)){
|
||||
throw new BadRequestException("当前点位所属设备无对应工序");
|
||||
}
|
||||
String point_code = task.getString("point_code1");
|
||||
String material_id = task.getString("material_id");
|
||||
SchBasePoint devicePoint = basePointService.getOne(new QueryWrapper<SchBasePoint>()
|
||||
.eq("point_code", point_code)
|
||||
.eq("is_delete", "0")
|
||||
.eq("is_used", "1")
|
||||
);
|
||||
String nextPoint;
|
||||
//判断缓存线是不是去深坑清洗:深坑区域15个点:判断空的物料坑位:
|
||||
String cacheVehile = "";
|
||||
if (devicePoint.getNext_region_code().equals(ConstantParam.SK_REGION)){
|
||||
//查询生坑重量是否超限:深坑需要乘以系数
|
||||
JSONArray nextPointList = WQL.getWO("sch_point").addParamMap(MapOf.of("flag","7","region_code", devicePoint.getNext_region_code(),"qty",Integer.valueOf(quantity)*ConstantParam.MATERAIL_RATIO)).process().getResultJSONArray(0);
|
||||
if (nextPointList.size() == 0){
|
||||
throw new BadRequestException("深坑清洗储料仓:"+devicePoint.getNext_region_code()+"无可用点位");
|
||||
}
|
||||
nextPoint = nextPointList.getJSONObject(0).getString("point_code");
|
||||
}else {
|
||||
//专机的话:需要判断专机上料口物料是否满足数量
|
||||
JSONArray nextPointList = WQL.getWO("sch_point").addParamMap(MapOf.of("flag","3","region_code", devicePoint.getNext_region_code(),"qty",quantity)).process().getResultJSONArray(0);
|
||||
if (nextPointList.size() == 0){
|
||||
JSONObject cacheLine = WQLObject.getWQLObject("SCH_cacheLine_region_relation").query("region_code = '"+devicePoint.getRegion_code()+"'").uniqueResult(0);
|
||||
nextPoint = cacheLine.getString("cacheline_code");
|
||||
//满料请求:查询缓存线空载具列表
|
||||
cacheVehile = getCacheVehile(nextPoint, null);
|
||||
if (StringUtils.isBlank(cacheVehile)) {
|
||||
throw new BadRequestException("缓存线:"+nextPoint+"没有可用空载具");
|
||||
}
|
||||
}else {
|
||||
nextPoint = nextPointList.getJSONObject(0).getString("point_code");
|
||||
}
|
||||
SchProcessRoute processRoute = schProcessRouteService.findByMaterialId(material_id,devicePoint.getRegion_code());
|
||||
if (processRoute == null){
|
||||
throw new BadRequestException("当前没有配置对应工序调度线路:"+material_id+"/"+devicePoint.getRegion_code());
|
||||
}
|
||||
if (StringUtils.isBlank(nextPoint)){
|
||||
throw new BadRequestException("设备:"+point_code+"没有可用点位");
|
||||
//workprocedure_code,r.workprocedure_id
|
||||
FlowElement flowElement = schedulerService.currentFlow(processRoute.getProcess_id(), workprodure.get("workprocedure_code"));
|
||||
if (flowElement == null){
|
||||
throw new BadRequestException("当前工序调度线路:"+processRoute.getProcess_id()+"没有对应工序配置"+workprodure.get("workprocedure_code"));
|
||||
}
|
||||
WQLObject.getWQLObject("sch_base_point").update(MapOf.of("task_id",task.getString("task_id"),"lock_type",StatusEnum.LOCK_ON.getCode(),"point_code = '"+nextPoint+"'"));
|
||||
task.put("vehicle_code",cacheVehile);
|
||||
task.put("point_code2",nextPoint);
|
||||
task.put("task_status",StatusEnum.TASK_START_END_P.getCode());
|
||||
task.put("update_time", DateUtil.now());
|
||||
WQLObject.getWQLObject("sch_base_task").update(task);
|
||||
};
|
||||
return flowElement;
|
||||
}
|
||||
//缺料请求:上料位
|
||||
//1.判断当前设备表对应的缓存线是否开放
|
||||
//2.根据当前设备绑定的物料id,从缓存线中获取相同物料对应载具列表
|
||||
//3.agv根据对应载具列表行进扫码匹配:匹配到对应物料则创建点对点任务
|
||||
public void callMatter(JSONObject task){
|
||||
public void empMatter(JSONObject task){
|
||||
//参数
|
||||
String targetDevice = task.getString("next_point_code");
|
||||
String material_id = task.getString("material_id");
|
||||
JSONObject devicePoint = WQLObject.getWQLObject("SCH_BASE_Point").query("point_code = '" + targetDevice + "' and is_delete = 0 and is_used = 1").uniqueResult(0);
|
||||
JSONObject cacheLine = WQLObject.getWQLObject("SCH_cacheLine_region_relation").query("region_code = '"+devicePoint.getString("region_code")+"' and is_active = '"+StatusEnum.STATUS_TRUE.getCode()+"'").uniqueResult(0);
|
||||
Assert.notNull(cacheLine, String.format("区域%s对应缓存线信息不存在", devicePoint.getString("region_code")));
|
||||
SchBasePoint devicePoint = basePointService.getOne(new QueryWrapper<SchBasePoint>()
|
||||
.eq("point_code", targetDevice)
|
||||
.eq("is_delete", "0")
|
||||
.eq("is_used", "1"));
|
||||
JSONObject cacheLine = WQLObject.getWQLObject("SCH_cacheLine_region_relation").query("region_code = '"+devicePoint.getRegion_code()+"' and is_active = '"+StatusEnum.STATUS_TRUE.getCode()+"'").uniqueResult(0);
|
||||
Assert.notNull(cacheLine, String.format("区域%s对应缓存线信息不存在", devicePoint.getRegion_code()));
|
||||
//缓存线位置编码 :缺料请求获取缓存线满载具列表
|
||||
String startPoint = cacheLine.getString("cacheline_code");
|
||||
String cacheVehile = getCacheVehile(startPoint, material_id);
|
||||
@@ -107,27 +141,28 @@ public class AgvInstService {
|
||||
throw new BadRequestException("缓存线:"+startPoint+"没有物料"+material_id+"对应可用载具");
|
||||
}
|
||||
//判断当前物料载具已经任务分配数量:如果>物料已经分配任务。说明满了,不允许再分配
|
||||
JSONArray allocateTask = WQLObject.getWQLObject("SCH_base_task").query("point_code1 = '" + startPoint + "' and material_id = '" + material_id + "' and task_status <" + StatusEnum.TASK_FINISH.getCode()).getResultJSONArray(0);
|
||||
List<SchBaseTask> allocateTask = taskService.list(new QueryWrapper<SchBaseTask>().eq("point_code1", startPoint).eq("material_id", material_id).lt("task_status", StatusEnum.TASK_FINISH.getCode()));
|
||||
if (allocateTask.size()>=cacheVehile.split(",").length){
|
||||
log.error("callMatter 缓存线:{}上含有物料:{}的载具分配完,任务id:{}",startPoint,material_id,allocateTask.stream().map(o-> ((JSONObject)o).getString("task_id")).collect(Collectors.joining(",")));
|
||||
log.error("callMatter 缓存线:{}上含有物料:{}的载具分配完,任务id:{}",startPoint,material_id,allocateTask.stream().map(SchBaseTask::getTask_id).collect(Collectors.joining(",")));
|
||||
throw new BadRequestException(String.format("缓存线%s上含物料%s的载具已分配完",startPoint,material_id));
|
||||
}
|
||||
task.put("vehicle_code",cacheVehile);
|
||||
task.put("start_point_code",startPoint);
|
||||
task.put("return_point_code",startPoint);
|
||||
task.put("task_status",StatusEnum.TASK_START_END_P.getCode());
|
||||
task.put("update_time", DateUtil.now());
|
||||
WQLObject.getWQLObject("SCH_base_task").update(task);
|
||||
SchBaseTask schBaseTask = task.toJavaObject(SchBaseTask.class);
|
||||
schBaseTask.setVehicle_code(cacheVehile);
|
||||
schBaseTask.setPoint_code1(startPoint);
|
||||
schBaseTask.setPoint_code3(startPoint);
|
||||
schBaseTask.setTask_status(StatusEnum.TASK_START_END_P.getCode());
|
||||
schBaseTask.setUpdate_time(new Date());
|
||||
taskService.updateById(schBaseTask);
|
||||
|
||||
}
|
||||
|
||||
public String getCacheVehile(String cacheLine,String materialId){
|
||||
JSONArray runingTask = WQLObject.getWQLObject("sch_base_task").query("point_code2 = '" + cacheLine + "' and task_status < '" + StatusEnum.TASK_FINISH.getCode() + "'").getResultJSONArray(0);
|
||||
int count = taskService.count(new QueryWrapper<SchBaseTask>().eq("point_code2", cacheLine).lt("task_status", StatusEnum.TASK_FINISH.getCode()));
|
||||
String status = StringUtils.isBlank(materialId) ? StatusEnum.CACHE_VEL_EMT.getCode() : StatusEnum.CACHE_VEL_FULL.getCode();
|
||||
JSONArray result = WQL.getWO("sch_point").addParamMap(MapOf.of("flag", "6", "vehicle_status", status, "material_id", materialId)).process().getResultJSONArray(0);
|
||||
if (result.size()>0){
|
||||
if (result.size()>runingTask.size()){
|
||||
return result.stream().map(a -> ((JSONObject) a).getString("vehicle_code")).collect(Collectors.joining(","));
|
||||
List<SchCachelineVehicle> vehicle = cachelineVehicleService.getCachelineVehicle(MapOf.of("vehicle_status", status, "material_id", materialId));
|
||||
if (vehicle.size()>0){
|
||||
if (vehicle.size()>count){
|
||||
return vehicle.stream().map(SchCachelineVehicle::getVehicle_code).collect(Collectors.joining(","));
|
||||
}
|
||||
}
|
||||
return "";
|
||||
|
||||
@@ -72,10 +72,10 @@ public class SectattrController {
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/getSect")
|
||||
@PostMapping("/getSect")
|
||||
@Log("查询库区下拉框")
|
||||
@ApiOperation("查询库区下拉框")
|
||||
public ResponseEntity<Object> querySect(@RequestBody(required = false) JSONObject query) {
|
||||
public ResponseEntity<Object> querySect(@RequestBody JSONObject query) {
|
||||
List<Map> list = isectattrService.getSect(query);
|
||||
return new ResponseEntity<>(TableDataInfo.build(list), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
@@ -18,6 +19,7 @@ import java.util.Date;
|
||||
* @since 2023-05-04
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("st_ivt_structattr")
|
||||
public class StIvtStructattr implements Serializable {
|
||||
|
||||
@@ -120,7 +120,7 @@ public class StIvtSectattrServiceImpl extends ServiceImpl<StIvtSectattrMapper, S
|
||||
List sect_ja = new ArrayList<>();
|
||||
for (Map<String, String> map : sectList) {
|
||||
Map sect_cas = new HashMap<>();
|
||||
sect_cas.put("value", map.get("sect_id"));
|
||||
sect_cas.put("value", String.valueOf(map.get("sect_id")));
|
||||
sect_cas.put("label", map.get("sect_name"));
|
||||
sect_ja.add(sect_cas);
|
||||
}
|
||||
|
||||
@@ -249,6 +249,15 @@ public class CacheLineHandController {
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/checkEnd")
|
||||
@Log("修改缓存线盘点状态")
|
||||
@ApiOperation("修改缓存线盘点状态")
|
||||
public ResponseEntity<Object> checkEnd(@RequestBody JSONObject param) {
|
||||
log.info("海亮缓存线手持服务 [盘点] 接口被请求, 请求参数-{}", param);
|
||||
cacheLineHandService.check(param);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/agvInBoxExceptionQuery")
|
||||
@Log("AGV入箱异常-查询")
|
||||
@ApiOperation("AGV入箱异常-查询")
|
||||
|
||||
@@ -890,7 +890,7 @@ public class CacheLineHandServiceImpl implements CacheLineHandService {
|
||||
|
||||
@Override
|
||||
public void check(JSONObject param) {
|
||||
String option = param.getString("option");
|
||||
String option = param.getString("check_option");
|
||||
if (StrUtil.isEmpty(option)) {
|
||||
throw new BadRequestException("缺少关键参数option");
|
||||
}
|
||||
|
||||
@@ -0,0 +1,241 @@
|
||||
package org.nl.wms.product_manage.sch.tasks.SpeMachinery;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.enums.AcsTaskEnum;
|
||||
import org.nl.common.enums.InterfaceLogType;
|
||||
import org.nl.common.enums.StatusEnum;
|
||||
import org.nl.common.utils.MapOf;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.system.util.CodeUtil;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.wms.ext.acs.service.impl.AgvInstService;
|
||||
import org.nl.wms.product_manage.sch.manage.AbstractAcsTask;
|
||||
import org.nl.wms.product_manage.sch.manage.TaskStatusEnum;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 专机任务
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class SpeEmpTask extends AbstractAcsTask {
|
||||
|
||||
@Autowired
|
||||
AgvInstService agvInstService;
|
||||
private final Map<String,SpeStatusHandler > SpeHandles= new HashMap<>();
|
||||
private static String OPT_NAME = "ACS回调# ";
|
||||
|
||||
|
||||
public SpeEmpTask() {
|
||||
SpeHandles.put(AcsTaskEnum.TASK_PRODUCT_MAC.name() ,new Spe2Spe());
|
||||
SpeHandles.put(AcsTaskEnum.TASK_PRODUCT_CACHE.name() ,new Spe2Cache());
|
||||
SpeHandles.put(AcsTaskEnum.TASK_CACHELINE_OUT.name() ,new Cache2Spe());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTaskStatus(JSONObject param,String status) {
|
||||
WQLObject taskTable = WQLObject.getWQLObject("sch_base_task");
|
||||
log.info(InterfaceLogType.ACS_TO_LMS.getDesc());
|
||||
// 指令执行中
|
||||
JSONObject task = taskTable.query("task_id = '" + param.getString("task_id") + "'").uniqueResult(0);
|
||||
AcsTaskEnum taskType = AcsTaskEnum.getType(task.getString("task_type"),"TASK_");
|
||||
try {
|
||||
SpeHandles.get(taskType.name()).handle(param,status,task);
|
||||
}catch (Exception ex){
|
||||
log.error(OPT_NAME+"updateStatus error:{}",ex);
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public String createTask(JSONObject param) {
|
||||
|
||||
String point_code = param.getString("device_code");
|
||||
String quantity = param.getString("quantity");
|
||||
String type = param.getString("type");
|
||||
JSONObject order = WQLObject.getWQLObject("PDM_produce_workOrder").query("workorder_code = '" + param.getString("workorder_code") + "' and is_delete = 0 and workorder_status != "+StatusEnum.TASK_FINISH.getCode()).uniqueResult(0);
|
||||
Assert.notNull(order, String.format("下发工单%s不存在未完成工单", param.getString("workorder_code")));
|
||||
JSONArray chectIndDatabase = WQLObject.getWQLObject("SCH_BASE_Task").query((AcsTaskEnum.REQUEST_CALLTYPE_FULL.getCode().equals(type) ? "point_code1" : "point_code2") + "= '" + point_code + "' and task_status < " + StatusEnum.TASK_FINISH.getCode()).getResultJSONArray(0);
|
||||
if (ObjectUtil.isNotEmpty(chectIndDatabase)){
|
||||
Assert.notNull(order, String.format("设备%s存在未完成任务", param.getString("point_code")));
|
||||
|
||||
}
|
||||
JSONObject form = new JSONObject(MapOf.of("start_point_code","",
|
||||
"next_point_code",point_code,"return_point_code", "","vehicle_code",
|
||||
"","product_area",order.getString("product_area"),"quantity", quantity,"type",type,"material_id", order.getString("material_id")));
|
||||
String taskId = IdUtil.getSnowflake(1, 1).nextId() + "";
|
||||
|
||||
JSONObject task = packageParam(form, taskId);
|
||||
WQLObject.getWQLObject("SCH_BASE_Task").insert(task);
|
||||
try {
|
||||
pointConfirm(task);
|
||||
//下发
|
||||
}catch (Exception ex){
|
||||
task.put("task_status", TaskStatusEnum.SURE_START_ERROR.getCode());
|
||||
task.put("remark",ex.getMessage());
|
||||
WQLObject.getWQLObject("sch_base_task").update(task);
|
||||
}
|
||||
return taskId;
|
||||
}
|
||||
|
||||
private JSONObject packageParam(JSONObject form, String task_id) {
|
||||
JSONObject task = new JSONObject();
|
||||
参数封装:{
|
||||
AcsTaskEnum taskEnum = AcsTaskEnum.getType(form.getString("type"), "REQUEST_");
|
||||
task.put("task_id", task_id);
|
||||
task.put("task_name", taskEnum.getDesc());
|
||||
task.put("task_code", CodeUtil.getNewCode("TASK_CODE"));
|
||||
task.put("task_type", form.getString("type"));
|
||||
task.put("acs_task_type", AcsTaskEnum.ACS_TASK_TYPE_NOBLE_DOUBLE_TASK.getCode());
|
||||
task.put("task_status", TaskStatusEnum.CREATED.getCode());
|
||||
task.put("point_code1", form.getString("start_point_code"));
|
||||
task.put("point_code2", form.getString("next_point_code"));
|
||||
task.put("point_code3", form.getString("return_point_code"));
|
||||
task.put("vehicle_code2", form.getString("vehicle_code2"));
|
||||
task.put("vehicle_code", form.getString("vehicle_code"));
|
||||
task.put("material_id", form.getString("material_id"));
|
||||
task.put("material_qty", form.getString("quantity"));
|
||||
task.put("handle_class", this.getClass().getName());
|
||||
task.put("finished_type", "1");
|
||||
task.put("is_delete", StatusEnum.LOCK_OFF.getCode());
|
||||
task.put("create_id", SecurityUtils.getCurrentUserId());
|
||||
task.put("create_name", SecurityUtils.getCurrentNickName());
|
||||
task.put("update_optid", SecurityUtils.getCurrentUserId());
|
||||
task.put("update_optname", SecurityUtils.getCurrentNickName());
|
||||
task.put("create_time", DateUtil.now());
|
||||
task.put("update_time", DateUtil.now());
|
||||
task.put("priority", "1");}
|
||||
return task;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cancel(String taskId) {
|
||||
log.info(OPT_NAME+"cancel taskID:{}",taskId);
|
||||
WQLObject taskTable = WQLObject.getWQLObject("sch_base_task");
|
||||
//专机-专机
|
||||
//专机-缓存线
|
||||
//缓存线出库
|
||||
taskTable.update(MapOf.of("task_status",StatusEnum.TASK_CANNEL.getCode()),"task_id = '"+taskId+"'");
|
||||
|
||||
}
|
||||
interface SpeStatusHandler{
|
||||
void handle(JSONObject param,String status,JSONObject task);
|
||||
}
|
||||
class Spe2Spe implements SpeStatusHandler{
|
||||
@Override
|
||||
public void handle(JSONObject param, String sta,JSONObject task) {
|
||||
AcsTaskEnum status = AcsTaskEnum.getType(sta,"status_");
|
||||
WQLObject taskTable = WQLObject.getWQLObject("sch_base_task");
|
||||
WQLObject pointTable = WQLObject.getWQLObject("SCH_BASE_Point");
|
||||
WQLObject deviceTable = WQLObject.getWQLObject("pdm_bi_device");
|
||||
|
||||
switch (status){
|
||||
case STATUS_START:
|
||||
taskTable.update(MapOf.of("task_status",StatusEnum.TASK_RUNNING.getCode(),"update_name","acs","update_time", DateUtil.now()),"task_id = '"+task.getString("task_id")+"'");
|
||||
break;
|
||||
case STATUS_FINISH:
|
||||
taskTable.update(MapOf.of("task_status",StatusEnum.TASK_FINISH.getCode(),"update_name","acs","update_time", DateUtil.now()),"task_id = '"+task.getString("task_id")+"'");
|
||||
//到专机:更新设备上料位物料数量
|
||||
String point_code2 = task.getString("point_code2");
|
||||
JSONObject pointInfo = pointTable.query("point_code = '" + point_code2 + "'").uniqueResult(0);
|
||||
JSONObject device = deviceTable.query("device_code = '" + pointInfo.getString("device_code") + "'").uniqueResult(0);
|
||||
task.getDouble("material_qty");
|
||||
double currentQty = device.getDouble("deviceinstor_qty") + task.getDouble("material_qty");
|
||||
deviceTable.update(MapOf.of("deviceinstor_qty", String.valueOf(currentQty)), "device_code = '" + pointInfo.getString("device_code") + "'");
|
||||
break;
|
||||
case STATUS_CANNEL:
|
||||
cancel(param.getString("task_id"));
|
||||
break;
|
||||
default:
|
||||
log.error(OPT_NAME+"未定义任务状态:{}",sta);
|
||||
throw new BadRequestException(OPT_NAME+"未定义任务状态:"+sta);
|
||||
}
|
||||
}
|
||||
}
|
||||
class Spe2Cache implements SpeStatusHandler{
|
||||
@Override
|
||||
public void handle(JSONObject param, String sta,JSONObject task) {
|
||||
AcsTaskEnum status = AcsTaskEnum.getType(sta,"status_");
|
||||
WQLObject taskTable = WQLObject.getWQLObject("sch_base_task");
|
||||
WQLObject cacheVehTable = WQLObject.getWQLObject("sch_cacheline_vehilematerial");
|
||||
String workprocedureCode = param.getString("workorder_code");
|
||||
String inboxtxm = param.getString("inboxtxm");
|
||||
String outboxtxm = param.getString("outboxtxm");
|
||||
switch (status){
|
||||
case STATUS_START:
|
||||
taskTable.update(MapOf.of("task_status",StatusEnum.TASK_RUNNING.getCode(),"update_name","acs","update_time", DateUtil.now()),"task_id = '"+task.getString("task_id")+"'");
|
||||
cacheVehTable.delete("vehicle_code = '" + outboxtxm + "'");
|
||||
break;
|
||||
case STATUS_FINISH:
|
||||
taskTable.update(MapOf.of("task_status",StatusEnum.TASK_FINISH.getCode(),"update_name","acs","update_time", DateUtil.now()),"task_id = '"+task.getString("task_id")+"'");
|
||||
cacheVehTable.insert(MapOf.of("quantity", task.getString("material_qty"),
|
||||
"material_id", task.getString("material_id"),
|
||||
"vehicle_code", inboxtxm,
|
||||
"vehicle_status", StatusEnum.CACHE_VEL_FULL.getCode(),
|
||||
//工单,工序?
|
||||
"workorder_code", workprocedureCode,
|
||||
"create_time", DateUtil.now(),
|
||||
"update_time", DateUtil.now()
|
||||
//物料规格,物料名称 从物料信息表关联查询
|
||||
));
|
||||
break;
|
||||
case STATUS_CANNEL:
|
||||
cancel(param.getString("task_id"));
|
||||
break;
|
||||
default:
|
||||
throw new BadRequestException(OPT_NAME+"未定义任务状态:"+sta);
|
||||
}
|
||||
}
|
||||
}
|
||||
class Cache2Spe implements SpeStatusHandler{
|
||||
@Override
|
||||
public void handle(JSONObject param, String sta,JSONObject task) {
|
||||
AcsTaskEnum status = AcsTaskEnum.getType(sta,"status_");
|
||||
WQLObject taskTable = WQLObject.getWQLObject("sch_base_task");
|
||||
WQLObject cacheVehTable = WQLObject.getWQLObject("sch_cacheline_vehilematerial");
|
||||
WQLObject pointTable = WQLObject.getWQLObject("SCH_BASE_Point");
|
||||
WQLObject deviceTable = WQLObject.getWQLObject("pdm_bi_device");
|
||||
String outboxtxm = param.getString("outboxtxm");
|
||||
|
||||
switch (status){
|
||||
case STATUS_START:
|
||||
taskTable.update(MapOf.of("task_status",StatusEnum.TASK_RUNNING.getCode(),"update_name","acs","update_time", DateUtil.now()),"task_id = '"+task.getString("task_id")+"'");
|
||||
cacheVehTable.delete("vehicle_code = '" + outboxtxm + "'");
|
||||
break;
|
||||
case STATUS_FINISH:
|
||||
taskTable.update(MapOf.of("task_status",StatusEnum.TASK_FINISH.getCode(),"update_name","acs","update_time", DateUtil.now()),"task_id = '"+task.getString("task_id")+"'");
|
||||
|
||||
String point_code2 = task.getString("point_code2");
|
||||
JSONObject pointInfo = pointTable.query("point_code = '" + point_code2 + "'").uniqueResult(0);
|
||||
JSONObject device = deviceTable.query("device_code = '" + pointInfo.getString("device_code") + "'").uniqueResult(0);
|
||||
task.getDouble("material_qty");
|
||||
double currentQty = device.getDouble("deviceinstor_qty") + task.getDouble("material_qty");
|
||||
deviceTable.update(MapOf.of("deviceinstor_qty", String.valueOf(currentQty)), "device_code = '" + pointInfo.getString("device_code") + "'");
|
||||
break;
|
||||
case STATUS_CANNEL:
|
||||
cancel(param.getString("task_id"));
|
||||
break;
|
||||
default:
|
||||
throw new BadRequestException(OPT_NAME+"未定义任务状态:"+sta);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void pointConfirm(JSONObject param) {
|
||||
agvInstService.empMatter(param);
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.nl.wms.product_manage.sch.tasks;
|
||||
package org.nl.wms.product_manage.sch.tasks.SpeMachinery;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.lang.Assert;
|
||||
@@ -11,9 +11,9 @@ import org.nl.common.enums.AcsTaskEnum;
|
||||
import org.nl.common.enums.InterfaceLogType;
|
||||
import org.nl.common.enums.StatusEnum;
|
||||
import org.nl.common.utils.MapOf;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.system.util.CodeUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.modules.wql.WQL;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.wms.ext.acs.service.impl.AgvInstService;
|
||||
@@ -23,7 +23,6 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -32,7 +31,7 @@ import java.util.Map;
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class SpeMachineryTask extends AbstractAcsTask {
|
||||
public class SpeFullTask extends AbstractAcsTask {
|
||||
|
||||
@Autowired
|
||||
AgvInstService agvInstService;
|
||||
@@ -40,7 +39,7 @@ public class SpeMachineryTask extends AbstractAcsTask {
|
||||
private static String OPT_NAME = "ACS回调# ";
|
||||
|
||||
|
||||
public SpeMachineryTask() {
|
||||
public SpeFullTask() {
|
||||
SpeHandles.put(AcsTaskEnum.TASK_PRODUCT_MAC.name() ,new Spe2Spe());
|
||||
SpeHandles.put(AcsTaskEnum.TASK_PRODUCT_CACHE.name() ,new Spe2Cache());
|
||||
SpeHandles.put(AcsTaskEnum.TASK_CACHELINE_OUT.name() ,new Cache2Spe());
|
||||
@@ -73,23 +72,16 @@ public class SpeMachineryTask extends AbstractAcsTask {
|
||||
JSONArray chectIndDatabase = WQLObject.getWQLObject("SCH_BASE_Task").query((AcsTaskEnum.REQUEST_CALLTYPE_FULL.getCode().equals(type) ? "point_code1" : "point_code2") + "= '" + point_code + "' and task_status < " + StatusEnum.TASK_FINISH.getCode()).getResultJSONArray(0);
|
||||
if (ObjectUtil.isNotEmpty(chectIndDatabase)){
|
||||
Assert.notNull(order, String.format("设备%s存在未完成任务", param.getString("point_code")));
|
||||
}
|
||||
JSONObject empPoint = WQL.getWO("sch_point").addParamMap(MapOf.of("flag", "2", "point_code", point_code, "point_type", StatusEnum.POINT_LOCATION_EMP.getCode())).process().uniqueResult(0);
|
||||
JSONObject form = new JSONObject(MapOf.of("start_point_code",point_code,
|
||||
"next_point_code","","return_point_code", empPoint.getString("point_code"),"vehicle_code",
|
||||
"","product_area",order.getString("product_area"),"quantity", quantity,"type",type,"material_id", order.getString("material_id")));
|
||||
|
||||
}
|
||||
JSONObject form = null;
|
||||
if (AcsTaskEnum.REQUEST_CALLTYPE_FULL.getCode().equals(type)){
|
||||
JSONObject empPoint = WQL.getWO("sch_point").addParamMap(MapOf.of("flag", "2", "point_code", point_code, "point_type", StatusEnum.POINT_LOCATION_EMP.getCode())).process().uniqueResult(0);
|
||||
form = new JSONObject(MapOf.of("start_point_code",point_code,
|
||||
"next_point_code","","return_point_code", empPoint.getString("point_code"),"vehicle_code",
|
||||
"","product_area",order.getString("product_area"),"quantity", quantity,"type",type,"material_id", order.getString("material_id")));
|
||||
}
|
||||
if (AcsTaskEnum.REQUEST_CALLTYPE_EMP.getCode().equals(type)){
|
||||
form = new JSONObject(MapOf.of("start_point_code","",
|
||||
"next_point_code",point_code,"return_point_code", "","vehicle_code",
|
||||
"","product_area",order.getString("product_area"),"quantity", quantity,"type",type,"material_id", order.getString("material_id")));
|
||||
}
|
||||
String taskId = IdUtil.getSnowflake(1, 1).nextId() + "";
|
||||
JSONObject task = packageParam(form, taskId);
|
||||
WQLObject.getWQLObject("SCH_BASE_Task").insert(task);
|
||||
|
||||
try {
|
||||
pointConfirm(task);
|
||||
//下发
|
||||
@@ -246,12 +238,7 @@ public class SpeMachineryTask extends AbstractAcsTask {
|
||||
|
||||
@Override
|
||||
public void pointConfirm(JSONObject param) {
|
||||
String type = param.getString("task_type");
|
||||
if (AcsTaskEnum.REQUEST_CALLTYPE_FULL.getCode().equals(type)){
|
||||
agvInstService.fullMaster(param);
|
||||
}
|
||||
if (AcsTaskEnum.REQUEST_CALLTYPE_EMP.getCode().equals(type)){
|
||||
agvInstService.callMatter(param);
|
||||
}
|
||||
agvInstService.fullMaster(param);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -19,4 +19,13 @@ public interface IPdmBiDeviceService extends IService<PdmBiDevice> {
|
||||
|
||||
List<Map> getNotWorkDeviceByWorkproceduceId(JSONObject param);
|
||||
|
||||
/**
|
||||
* 获取生产工序对应可用设备
|
||||
* 重量/物料校验
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
List<Map> workproceduceDevices(Map<String,Object> param);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ public class PdmBiDevice implements Serializable {
|
||||
private BigDecimal deviceinitinstor_qty;
|
||||
|
||||
/**
|
||||
* 设备实时来料仓数
|
||||
* 设备实时来料仓数:用于数量校验
|
||||
*/
|
||||
private BigDecimal deviceinstor_qty;
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.nl.wms.product_manage.service.device.dao.mapper;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.wms.product_manage.service.device.dao.PdmBiDevice;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
@@ -17,4 +18,6 @@ import java.util.Map;
|
||||
public interface PdmBiDeviceMapper extends BaseMapper<PdmBiDevice> {
|
||||
|
||||
List<Map> getNotWorkDevice(Map<String,Object> query);
|
||||
|
||||
List<Map> workproceduceDevices(Map<String,Object> query);
|
||||
}
|
||||
|
||||
@@ -18,4 +18,22 @@
|
||||
from PDM_produce_workOrder o
|
||||
where '5' > o.workorder_status and o.is_delete = '0' )
|
||||
</select>
|
||||
<select id="workproceduceDevices" resultType="java.util.Map">
|
||||
select
|
||||
GROUP_CONCAT(sch_base_task.task_id),
|
||||
pdm_bi_device.inupperlimit_qty - ifnull( sum( sch_base_task.material_qty ), 0 ) - pdm_bi_device.deviceinstor_qty AS currentQty,
|
||||
pdm_bi_device.device_code,
|
||||
sch_base_point.point_code,
|
||||
from sch_base_point
|
||||
left join pdm_bi_device on pdm_bi_device.device_code = sch_base_point.device_code
|
||||
left JOIN sch_base_task ON sch_base_point.point_code = point_code2 and '7' > task_status
|
||||
where
|
||||
sch_base_point.point_type = '4'
|
||||
and workprocedure_id = #{workprocedure_id}
|
||||
<if test="material_id != null and material_id != ''">
|
||||
and pdm_bi_device.material_id = #{material_id}
|
||||
</if>
|
||||
GROUP BY pdm_bi_device.device_code
|
||||
HAVING currentQty > #{qty}
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -25,4 +25,9 @@ public class PdmBiDeviceServiceImpl extends ServiceImpl<PdmBiDeviceMapper, PdmBi
|
||||
public List<Map> getNotWorkDeviceByWorkproceduceId(JSONObject param) {
|
||||
return this.baseMapper.getNotWorkDevice(param);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map> workproceduceDevices(Map<String, Object> param) {
|
||||
return this.baseMapper.workproceduceDevices(param);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,14 +6,23 @@ package org.nl.wms.scheduler_manage.controller.scheduler;
|
||||
*/
|
||||
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.nl.common.TableDataInfo;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.wms.scheduler_manage.service.scheduler.ISchProcessRouteService;
|
||||
import org.nl.wms.scheduler_manage.service.scheduler.SchedulerService;
|
||||
import org.nl.wms.scheduler_manage.service.scheduler.dao.SchProcessRoute;
|
||||
import org.nl.wms.scheduler_manage.service.scheduler.labelConverter.impl.FlowElement;
|
||||
import org.nl.wms.scheduler_manage.service.scheduler.labelConverter.impl.ProcessElement;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/shceduler")
|
||||
@@ -23,6 +32,9 @@ public class SchedulerController {
|
||||
@Autowired
|
||||
SchedulerService schedulerService;
|
||||
|
||||
@Autowired
|
||||
ISchProcessRouteService processRouteService;
|
||||
|
||||
@GetMapping("/all")
|
||||
public ResponseEntity<Object> allprocess(){
|
||||
return new ResponseEntity<>(schedulerService.all(), HttpStatus.OK);
|
||||
@@ -36,4 +48,49 @@ public class SchedulerController {
|
||||
FlowElement element = schedulerService.currentFlow(process, flow);
|
||||
return new ResponseEntity<>(element, HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/route")
|
||||
public ResponseEntity<Object> route(String blurry){
|
||||
QueryWrapper<SchProcessRoute> query = new QueryWrapper<>();
|
||||
if (StringUtils.isNotEmpty(blurry)){
|
||||
query.like("process_id", blurry)
|
||||
.or()
|
||||
.like("process_name", blurry)
|
||||
.or()
|
||||
.like("material_spec", blurry);
|
||||
}
|
||||
List<SchProcessRoute> list = processRouteService.list(query);
|
||||
return new ResponseEntity<>(TableDataInfo.build(list), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/routeDelete")
|
||||
public ResponseEntity<Object> routeDelete(@RequestBody String[] materialSpecs){
|
||||
processRouteService.removeByIds(Arrays.asList(materialSpecs));
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/routeCreate")
|
||||
public ResponseEntity<Object> routeCreate(@RequestBody JSONObject form){
|
||||
SchProcessRoute route = form.toJavaObject(SchProcessRoute.class);
|
||||
ProcessElement process = schedulerService.getProcess(route.getProcess_id());
|
||||
if (process == null){
|
||||
throw new BadRequestException("当前工序路由id"+route.getProcess_id()+"没有对应xml配置文件配置");
|
||||
}
|
||||
route.setProcess_name(process.getName());
|
||||
processRouteService.save(route);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
@PostMapping("/routeUpdate")
|
||||
public ResponseEntity<Object> routeUpdate(@RequestBody JSONObject form){
|
||||
SchProcessRoute route = form.toJavaObject(SchProcessRoute.class);
|
||||
ProcessElement process = schedulerService.getProcess(route.getProcess_id());
|
||||
if (process == null){
|
||||
throw new BadRequestException("当前工序路由id"+route.getProcess_id()+"没有对应xml配置文件配置");
|
||||
}
|
||||
route.setProcess_name(process.getName());
|
||||
processRouteService.updateById(route);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -3,6 +3,9 @@ package org.nl.wms.scheduler_manage.service.cacheline;
|
||||
import org.nl.wms.scheduler_manage.service.cacheline.dao.SchCachelineVehicle;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 缓存线载具条码表 服务类
|
||||
@@ -13,4 +16,5 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||
*/
|
||||
public interface ISchCachelineVehicleService extends IService<SchCachelineVehicle> {
|
||||
|
||||
List<SchCachelineVehicle> getCachelineVehicle(Map query);
|
||||
}
|
||||
|
||||
@@ -3,6 +3,9 @@ package org.nl.wms.scheduler_manage.service.cacheline.dao.mapper;
|
||||
import org.nl.wms.scheduler_manage.service.cacheline.dao.SchCachelineVehicle;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 缓存线载具条码表 Mapper 接口
|
||||
@@ -13,4 +16,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
*/
|
||||
public interface SchCachelineVehicleMapper extends BaseMapper<SchCachelineVehicle> {
|
||||
|
||||
List<SchCachelineVehicle> getCachelineVehicle(Map<String,String> query);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -2,4 +2,17 @@
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.nl.wms.scheduler_manage.service.cacheline.dao.mapper.SchCachelineVehicleMapper">
|
||||
|
||||
<select id="getCachelineVehicle"
|
||||
resultType="org.nl.wms.scheduler_manage.service.cacheline.dao.SchCachelineVehicle">
|
||||
SELECT
|
||||
v.vehicle_code,v.vehicle_status,v.material_id
|
||||
FROM
|
||||
sch_cacheline_vehilematerial v
|
||||
LEFT JOIN sch_cacheline_position p ON p.vehicle_code = v.vehicle_code
|
||||
WHERE p.vehicle_code <> '' and
|
||||
v.vehicle_status = #{vehicle_status}
|
||||
<if test="material_id != null and material_id != ''">
|
||||
v.material_id = #{material_id}
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -6,6 +6,9 @@ import org.nl.wms.scheduler_manage.service.cacheline.ISchCachelineVehicleService
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 缓存线载具条码表 服务实现类
|
||||
@@ -17,4 +20,8 @@ import org.springframework.stereotype.Service;
|
||||
@Service
|
||||
public class SchCachelineVehicleServiceImpl extends ServiceImpl<SchCachelineVehicleMapper, SchCachelineVehicle> implements ISchCachelineVehicleService {
|
||||
|
||||
@Override
|
||||
public List<SchCachelineVehicle> getCachelineVehicle(Map query) {
|
||||
return this.baseMapper.getCachelineVehicle(query);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,4 +39,11 @@ public interface ISchBasePointService extends IService<SchBasePoint> {
|
||||
*/
|
||||
void changeActive(JSONObject form);
|
||||
|
||||
/**
|
||||
* 根据设备点位查询设备对应工序
|
||||
* @param point_code
|
||||
* @return
|
||||
*/
|
||||
Map findDeviceWorkprodure(String point_code);
|
||||
|
||||
}
|
||||
|
||||
@@ -28,4 +28,6 @@ public interface SchBasePointMapper extends BaseMapper<SchBasePoint> {
|
||||
* @return
|
||||
*/
|
||||
List<Map> selectPoint(Map<String,Object> map);
|
||||
|
||||
Map getDeviceWorkprodure(String pointCode);
|
||||
}
|
||||
|
||||
@@ -89,4 +89,11 @@
|
||||
AND ruledis.load_series >= #{loadSeries}
|
||||
</if>
|
||||
</select>
|
||||
<select id="getDeviceWorkprodure" resultType="java.util.Map">
|
||||
select
|
||||
r.workprocedure_code,r.workprocedure_id from pdm_bi_device dev
|
||||
LEFT join sch_base_point p on p.device_code = dev.device_code
|
||||
LEFT JOIN pdm_bi_workprocedure r on dev.workprocedure_id = r.workprocedure_id
|
||||
where p.point_code = #{pointCode};
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -140,4 +140,12 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
|
||||
WQLObject.getWQLObject("sch_base_point").update(form);
|
||||
//BussEventMulticaster.Publish(new PointEvent());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map findDeviceWorkprodure(String point_code) {
|
||||
if (StringUtils.isNotEmpty(point_code)){
|
||||
return this.baseMapper.getDeviceWorkprodure(point_code);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
package org.nl.wms.scheduler_manage.service.scheduler;
|
||||
|
||||
import org.nl.wms.scheduler_manage.service.scheduler.dao.SchProcessRoute;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 物料系列调度线路配置表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-05-23
|
||||
*/
|
||||
public interface ISchProcessRouteService extends IService<SchProcessRoute> {
|
||||
|
||||
SchProcessRoute findByMaterialId(String materialId,String regionCode);
|
||||
}
|
||||
@@ -10,8 +10,6 @@ import org.nl.wms.scheduler_manage.service.scheduler.labelConverter.BaseElement;
|
||||
import org.nl.wms.scheduler_manage.service.scheduler.labelConverter.impl.FlowElement;
|
||||
import org.nl.wms.scheduler_manage.service.scheduler.labelConverter.impl.ProcessElement;
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.beans.factory.config.BeanPostProcessor;
|
||||
import org.springframework.core.io.FileSystemResourceLoader;
|
||||
import org.springframework.core.io.Resource;
|
||||
@@ -36,7 +34,6 @@ import java.util.function.Function;
|
||||
*/
|
||||
@Service
|
||||
public class SchedulerService implements BeanPostProcessor {
|
||||
@Value("${schedulerFile}")
|
||||
|
||||
private static Map<String,BaseConverter> converterMap =new HashMap<>();
|
||||
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
package org.nl.wms.scheduler_manage.service.scheduler.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 物料系列调度线路配置表
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-05-23
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("sch_process_route")
|
||||
public class SchProcessRoute implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 规则(物料系列/区域)
|
||||
*/
|
||||
@TableId(value ="rule_code" )
|
||||
private String rule_code;
|
||||
|
||||
/**
|
||||
* 袋唯一标识
|
||||
*/
|
||||
private String process_id;
|
||||
|
||||
private String process_name;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package org.nl.wms.scheduler_manage.service.scheduler.dao.mapper;
|
||||
|
||||
import org.nl.wms.scheduler_manage.service.scheduler.dao.SchProcessRoute;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 物料系列调度线路配置表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-05-23
|
||||
*/
|
||||
public interface SchProcessRouteMapper extends BaseMapper<SchProcessRoute> {
|
||||
|
||||
SchProcessRoute findByMaterialId(String materialId);
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.nl.wms.scheduler_manage.service.scheduler.dao.mapper.SchProcessRouteMapper">
|
||||
|
||||
<select id="findByMaterialId"
|
||||
resultType="org.nl.wms.scheduler_manage.service.scheduler.dao.SchProcessRoute">
|
||||
select
|
||||
sch_process_route.* from sch_process_route
|
||||
left join md_me_materialbase on sch_process_route.rule_code = md_me_materialbase.material_spec
|
||||
where md_me_materialbase.material_id = #{materialId}
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,41 @@
|
||||
package org.nl.wms.scheduler_manage.service.scheduler.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.nl.wms.scheduler_manage.service.scheduler.dao.SchProcessRoute;
|
||||
import org.nl.wms.scheduler_manage.service.scheduler.dao.mapper.SchProcessRouteMapper;
|
||||
import org.nl.wms.scheduler_manage.service.scheduler.ISchProcessRouteService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 物料系列调度线路配置表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-05-23
|
||||
*/
|
||||
@Service
|
||||
public class SchProcessRouteServiceImpl extends ServiceImpl<SchProcessRouteMapper, SchProcessRoute> implements ISchProcessRouteService {
|
||||
|
||||
@Autowired
|
||||
ISysParamService iSysParamService;
|
||||
|
||||
@Override
|
||||
public SchProcessRoute findByMaterialId(String materialId, String regionCode) {
|
||||
Param one = iSysParamService.getOne(new QueryWrapper<Param>().eq("code", "process_route"));
|
||||
String value = one.getValue();
|
||||
if (value.equals("1")){
|
||||
return this.getOne(new QueryWrapper<SchProcessRoute>().eq("rule_code",regionCode));
|
||||
}else {
|
||||
if (StringUtils.isNotEmpty(materialId)){
|
||||
return this.baseMapper.findByMaterialId(materialId);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -36,9 +36,7 @@ public class FlowConverter implements BaseConverter {
|
||||
}
|
||||
if (XMLStreamConstants.START_ELEMENT == xtr.next()){
|
||||
System.out.println(xtr.getLocalName());
|
||||
Map<String, String> param = new HashMap();
|
||||
param.put(xtr.getAttributeValue(null,"id"),xtr.getAttributeValue(null,"value"));
|
||||
element.getParams().add(param);
|
||||
element.getParams().put(xtr.getAttributeValue(null,"id"),xtr.getAttributeValue(null,"value"));
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package org.nl.wms.scheduler_manage.service.scheduler.labelConverter.impl;
|
||||
import org.nl.wms.scheduler_manage.service.scheduler.labelConverter.BaseElement;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -16,7 +17,7 @@ public class FlowElement extends BaseElement {
|
||||
private FlowElement targetRef;
|
||||
private String sourceRefId;
|
||||
private String targetRefId;
|
||||
private List<Map<String,String>> params = new ArrayList<>();
|
||||
private Map<String,String> params = new HashMap<>();
|
||||
|
||||
|
||||
|
||||
@@ -54,11 +55,11 @@ public class FlowElement extends BaseElement {
|
||||
this.targetRefId = targetRefId;
|
||||
}
|
||||
|
||||
public List<Map<String, String>> getParams() {
|
||||
public Map<String, String> getParams() {
|
||||
return params;
|
||||
}
|
||||
|
||||
public void setParams(List<Map<String, String>> params) {
|
||||
public void setParams(Map<String, String> params) {
|
||||
this.params = params;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
package org.nl.wms.scheduler_manage.service.task.dao;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -17,6 +20,7 @@ import lombok.EqualsAndHashCode;
|
||||
* @since 2023-05-11
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("sch_base_task")
|
||||
public class SchBaseTask implements Serializable {
|
||||
@@ -26,6 +30,7 @@ public class SchBaseTask implements Serializable {
|
||||
/**
|
||||
* 任务标识
|
||||
*/
|
||||
@TableId(value = "task_id")
|
||||
private String task_id;
|
||||
|
||||
/**
|
||||
|
||||
@@ -98,4 +98,28 @@ public class IStivtlostorivnCpInController {
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/unDivStruct")
|
||||
@Log("取消分配")
|
||||
@ApiOperation("取消分配")
|
||||
public ResponseEntity<Object> unDivStruct(@RequestBody JSONObject whereJson){
|
||||
iStIvtIostorinvCpService.unDivStruct(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/setPoint")
|
||||
@Log("设置起点")
|
||||
@ApiOperation("设置起点")
|
||||
public ResponseEntity<Object> setPoint(@RequestBody JSONObject whereJson){
|
||||
iStIvtIostorinvCpService.setPoint(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/confirm")
|
||||
@Log("强制确认")
|
||||
@ApiOperation("强制确认")
|
||||
public ResponseEntity<Object> confirm(@RequestBody JSONObject whereJson){
|
||||
iStIvtIostorinvCpService.confirm(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -117,4 +117,31 @@ public interface IStIvtIostorinvCpService extends IService<StIvtIostorinvCp> {
|
||||
* }
|
||||
*/
|
||||
void divStruct(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 取消分配
|
||||
* @param whereJson
|
||||
* {
|
||||
* 分配明细
|
||||
* }
|
||||
*/
|
||||
void unDivStruct(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 设置起点
|
||||
* @param whereJson
|
||||
* {
|
||||
* 分配明细
|
||||
* }
|
||||
*/
|
||||
void setPoint(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 强制确认
|
||||
* @param whereJson
|
||||
* {
|
||||
* "iostorinv_id": 主表标识
|
||||
* }
|
||||
*/
|
||||
void confirm(JSONObject whereJson);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.nl.wms.storage_manage.productmanage.service.iostorInv.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
@@ -27,6 +28,7 @@ public class StIvtIostorinvdisCp implements Serializable {
|
||||
/**
|
||||
* 出入单分配标识
|
||||
*/
|
||||
@TableId
|
||||
private String iostorinvdis_id;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.nl.wms.storage_manage.productmanage.service.iostorInv.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.*;
|
||||
import lombok.experimental.Accessors;
|
||||
@@ -25,6 +26,7 @@ public class StIvtIostorinvdtlCp implements Serializable {
|
||||
/**
|
||||
* 出入单明细标识
|
||||
*/
|
||||
@TableId
|
||||
private String iostorinvdtl_id;
|
||||
|
||||
/**
|
||||
|
||||
@@ -76,7 +76,7 @@
|
||||
AND mst.bill_code =#{bill_code}
|
||||
</if>
|
||||
<if test="iostorinv_id != null and iostorinv_id != ''">
|
||||
AND mst.bill_code =#{iostorinv_id}
|
||||
AND mst.iostorinv_id =#{iostorinv_id}
|
||||
</if>
|
||||
order by dtl.seq_no ASC
|
||||
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
package org.nl.wms.storage_manage.productmanage.service.iostorInv.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
@@ -11,6 +13,8 @@ import io.jsonwebtoken.lang.Assert;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.nl.common.TableDataInfo;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.publish.BussEventMulticaster;
|
||||
import org.nl.common.publish.event.PointEvent;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
@@ -23,7 +27,15 @@ import org.nl.wms.masterdata_manage.storage.service.storage.IStIvtBsrealstorattr
|
||||
import org.nl.wms.masterdata_manage.storage.service.storage.IStIvtStructattrService;
|
||||
import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtBsrealstorattr;
|
||||
import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtStructattr;
|
||||
import org.nl.wms.product_manage.sch.manage.TaskStatusEnum;
|
||||
import org.nl.wms.scheduler_manage.service.point.ISchBasePointService;
|
||||
import org.nl.wms.scheduler_manage.service.point.dao.SchBasePoint;
|
||||
import org.nl.wms.scheduler_manage.service.task.ISchBaseTaskService;
|
||||
import org.nl.wms.scheduler_manage.service.task.dao.SchBaseTask;
|
||||
import org.nl.wms.storage_manage.CHANGE_BILL_TYPE_ENUM;
|
||||
import org.nl.wms.storage_manage.IOSEnum;
|
||||
import org.nl.wms.storage_manage.basedata.service.record.dto.StIvtStructivtflowDto;
|
||||
import org.nl.wms.storage_manage.basedata.service.record.service.IStIvtStructivtflowService;
|
||||
import org.nl.wms.storage_manage.productmanage.service.iostorInv.IStIvtIostorinvCpService;
|
||||
import org.nl.wms.storage_manage.productmanage.service.iostorInv.IStIvtIostorinvdisCpService;
|
||||
import org.nl.wms.storage_manage.productmanage.service.iostorInv.IStIvtIostorinvdisdtlCpService;
|
||||
@@ -41,7 +53,10 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@@ -79,6 +94,14 @@ public class StIvtIostorinvCpServiceImpl extends ServiceImpl<StIvtIostorinvCpMap
|
||||
@Autowired
|
||||
protected IStIvtStructattrService iStIvtStructattrService; // 仓位属性服务
|
||||
|
||||
@Autowired
|
||||
private IStIvtStructivtflowService structivtflowService; // 仓位变动记录服务
|
||||
|
||||
@Autowired
|
||||
private ISchBaseTaskService iSchBaseTaskService; // 任务表服务
|
||||
|
||||
@Autowired
|
||||
private ISchBasePointService iSchBasePointService; // 点位服务
|
||||
|
||||
@Override
|
||||
public Object pageQuery(IostorInvQuery query, PageQuery page) {
|
||||
@@ -321,6 +344,10 @@ public class StIvtIostorinvCpServiceImpl extends ServiceImpl<StIvtIostorinvCpMap
|
||||
6.更新库存、日物流表等、
|
||||
*/
|
||||
|
||||
// 判断是否已分配
|
||||
StIvtIostorinvdisCp disDao = iostorinvdisCpService.getOne(new QueryWrapper<StIvtIostorinvdisCp>().lambda()
|
||||
.eq(StIvtIostorinvdisCp::getIostorinvdis_id, whereJson.getString("iostorinvdis_id")));
|
||||
if (ObjectUtil.isNotEmpty(disDao.getStruct_code())) throw new BadRequestException("此明细已分配");
|
||||
|
||||
String struct_id = whereJson.getString("struct_id");
|
||||
StIvtStructattr attrDao = new StIvtStructattr();
|
||||
@@ -359,6 +386,196 @@ public class StIvtIostorinvCpServiceImpl extends ServiceImpl<StIvtIostorinvCpMap
|
||||
// TODO 更新库存、物流等
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void unDivStruct(JSONObject whereJson) {
|
||||
/*
|
||||
将分配下的所有分配明细取消
|
||||
*/
|
||||
// 1.校验是否已生成任务并已经下发
|
||||
StIvtIostorinvdisCp disDao = iostorinvdisCpService.getOne(
|
||||
new QueryWrapper<StIvtIostorinvdisCp>().lambda()
|
||||
.eq(StIvtIostorinvdisCp::getIostorinvdis_id, whereJson.getString("iostorinvdis_id"))
|
||||
);
|
||||
if (ObjectUtil.isEmpty(disDao)) throw new BadRequestException("分配明细不存在!");
|
||||
|
||||
|
||||
SchBaseTask taskDao = iSchBaseTaskService.getOne(
|
||||
new QueryWrapper<SchBaseTask>().lambda()
|
||||
.eq(SchBaseTask::getTask_id, disDao.getTask_id())
|
||||
.gt(SchBaseTask::getTask_status, TaskStatusEnum.START_AND_POINT.getCode())
|
||||
);
|
||||
if (ObjectUtil.isNotEmpty(taskDao)) throw new BadRequestException("任务已下发,不可取消!");
|
||||
|
||||
// 2.更新分配明细
|
||||
iStIvtIostorinvdisdtlCpService.update(
|
||||
new StIvtIostorinvdisdtlCp()
|
||||
.setStruct_name("")
|
||||
.setStruct_code("")
|
||||
.setStruct_id("")
|
||||
.setSect_id("")
|
||||
.setSect_code("")
|
||||
.setSect_name(""),
|
||||
new QueryWrapper<StIvtIostorinvdisdtlCp>().lambda()
|
||||
.eq(StIvtIostorinvdisdtlCp::getIostorinvdis_id,disDao.getIostorinvdis_id())
|
||||
);
|
||||
|
||||
// 3.更新任务
|
||||
iSchBaseTaskService.update(
|
||||
new SchBaseTask().setIs_delete(true),
|
||||
new QueryWrapper<SchBaseTask>().lambda()
|
||||
.eq(SchBaseTask::getTask_id, disDao.getTask_id())
|
||||
.lt(SchBaseTask::getTask_status, TaskStatusEnum.ISSUE.getCode())
|
||||
);
|
||||
|
||||
// 解锁货位
|
||||
iStIvtStructattrService.update(
|
||||
new StIvtStructattr()
|
||||
.setLock_type("1") // TODO 暂时写死
|
||||
.setInv_code("")
|
||||
.setInv_type("")
|
||||
.setInv_id(""),
|
||||
new QueryWrapper<StIvtStructattr>().lambda()
|
||||
.eq(StIvtStructattr::getStruct_code, disDao.getStruct_code())
|
||||
);
|
||||
|
||||
// 4.更新分配
|
||||
iostorinvdisCpService.updateById(
|
||||
disDao.setStruct_name("").setStruct_code("")
|
||||
.setStruct_id("").setSect_id("")
|
||||
.setSect_code("").setSect_name("")
|
||||
.setPoint_id("").setPoint_code("")
|
||||
.setPoint_name("")
|
||||
);
|
||||
|
||||
// 5.更新明细
|
||||
StIvtIostorinvdtlCp dtlDao = iostorinvdtlCpService.getOne(
|
||||
new QueryWrapper<StIvtIostorinvdtlCp>().lambda()
|
||||
.eq(StIvtIostorinvdtlCp::getIostorinvdtl_id, disDao.getIostorinvdtl_id())
|
||||
);
|
||||
|
||||
if (StrUtil.equals(dtlDao.getBill_status(), IOSEnum.BILL_STATUS.code("生成"))) {
|
||||
throw new BadRequestException("没有可取消的分配明细!");
|
||||
}
|
||||
|
||||
dtlDao.setAssign_qty(NumberUtil.sub(dtlDao.getAssign_qty(),disDao.getReal_qty()));
|
||||
dtlDao.setUnassign_qty(disDao.getReal_qty());
|
||||
|
||||
if (dtlDao.getAssign_qty().doubleValue() == 0) {
|
||||
dtlDao.setBill_status(IOSEnum.BILL_STATUS.code("生成"));
|
||||
} else if (dtlDao.getAssign_qty().doubleValue() > 0) {
|
||||
dtlDao.setBill_status(IOSEnum.BILL_STATUS.code("分配中"));
|
||||
}
|
||||
|
||||
iostorinvdtlCpService.updateById(dtlDao);
|
||||
|
||||
// 6.更新主表
|
||||
updateMst(dtlDao.getIostorinv_id());
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void setPoint(JSONObject whereJson) {
|
||||
StIvtIostorinvdisCp disDao = iostorinvdisCpService.getById(whereJson.getString("iostorinvdis_id"));
|
||||
|
||||
// 1.校验是否设置过起点
|
||||
if (ObjectUtil.isNotEmpty(disDao.getPoint_id())) throw new BadRequestException("此明细已生成任务!");
|
||||
|
||||
// 2.下发任务
|
||||
SchBasePoint pointDao = iSchBasePointService.getOne(
|
||||
new QueryWrapper<SchBasePoint>().lambda()
|
||||
.eq(SchBasePoint::getPoint_code, whereJson.getString("point_code"))
|
||||
);
|
||||
|
||||
PointEvent event = PointEvent.builder()
|
||||
.type(CHANGE_BILL_TYPE_ENUM.IOSTORINV_IN_SEND.getCode())
|
||||
.point_code1(disDao.getStruct_code())
|
||||
.point_code2(pointDao.getPoint_code())
|
||||
.callback((Consumer<String>) disDao::setTask_id)
|
||||
.build();
|
||||
BussEventMulticaster.Publish(event);
|
||||
|
||||
// 3.更新分配表
|
||||
iostorinvdisCpService.updateById(
|
||||
disDao.setPoint_id(pointDao.getPoint_id())
|
||||
.setPoint_code(pointDao.getPoint_code())
|
||||
.setPoint_name(pointDao.getPoint_name())
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void confirm(JSONObject whereJson) {
|
||||
|
||||
// 1.更新主表为完成
|
||||
StIvtIostorinvCp mstDao = this.getById(whereJson.getString("iostorinv_id"));
|
||||
mstDao.setBill_status(IOSEnum.BILL_STATUS.code("完成"));
|
||||
mstDao.setConfirm_id(SecurityUtils.getCurrentUserId());
|
||||
mstDao.setConfirm_name(SecurityUtils.getCurrentNickName());
|
||||
mstDao.setConfirm_time(DateUtil.now());
|
||||
this.updateById(mstDao);
|
||||
|
||||
// 2.判断所有明细是否为分配完
|
||||
List<StIvtIostorinvdtlCp> dtlDaoList = iostorinvdtlCpService.list(
|
||||
new QueryWrapper<StIvtIostorinvdtlCp>().lambda()
|
||||
.eq(StIvtIostorinvdtlCp::getIostorinv_id, whereJson.getString("iostorinv_id"))
|
||||
);
|
||||
|
||||
boolean is_dis = dtlDaoList.stream()
|
||||
.anyMatch(row -> row.getBill_status().equals(IOSEnum.BILL_STATUS.code("分配完")));
|
||||
|
||||
if (!is_dis) throw new BadRequestException("请先分配单据!");
|
||||
|
||||
// 3.更新明细表为完成
|
||||
iostorinvdtlCpService.update(
|
||||
new StIvtIostorinvdtlCp()
|
||||
.setBill_status(IOSEnum.BILL_STATUS.code("完成")),
|
||||
new QueryWrapper<StIvtIostorinvdtlCp>().lambda()
|
||||
.eq(StIvtIostorinvdtlCp::getIostorinv_id, whereJson.getString("iostorinv_id"))
|
||||
);
|
||||
|
||||
// 3.更新任务为完成、更新库存
|
||||
List<StIvtIostorinvdisCp> disDaoList = iostorinvdisCpService.list(
|
||||
new QueryWrapper<StIvtIostorinvdisCp>().lambda()
|
||||
.eq(StIvtIostorinvdisCp::getIostorinv_id, whereJson.getString("iostorinv_id"))
|
||||
);
|
||||
|
||||
Map<String, List<StIvtIostorinvdisCp>> collect = disDaoList.stream()
|
||||
.collect(Collectors.groupingBy(StIvtIostorinvdisCp::getTask_id));
|
||||
|
||||
for (String task_id : collect.keySet()) {
|
||||
// 1)更新任务为完成
|
||||
SchBaseTask taskDao = iSchBaseTaskService.getById(task_id);
|
||||
// 已完成则不更新
|
||||
if (StrUtil.equals(taskDao.getTask_id(), TaskStatusEnum.FINISHED.getCode())) continue;
|
||||
|
||||
taskDao.setTask_status(TaskStatusEnum.FINISHED.getCode());
|
||||
iSchBaseTaskService.updateById(taskDao);
|
||||
|
||||
// 2)更新库存
|
||||
List<StIvtIostorinvdisCp> disList = collect.get(task_id);
|
||||
for (StIvtIostorinvdisCp dao : disList) {
|
||||
// 根据托盘对应货位更新
|
||||
structivtflowService.recordStructivtFlow(
|
||||
StIvtStructivtflowDto.builder()
|
||||
.bill_code(mstDao.getBill_code())
|
||||
.change_type_scode(CHANGE_BILL_TYPE_ENUM.IOSTORINV_IN_SEND)
|
||||
.bill_table("st_ivt_iostorinv_cp")
|
||||
.material_id(dao.getMaterial_id())
|
||||
.pcsn(dao.getPcsn())
|
||||
.struct_code(dao.getStruct_code())
|
||||
.result_qty(dao.getReal_qty())
|
||||
.change_qty(dao.getReal_qty())
|
||||
.task_id(dao.getTask_id())
|
||||
.storagevehicle_code(dao.getStoragevehicle_code())
|
||||
.build()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private StIvtIostorinvCp packageMstForm(StIvtIostorinvCp stIvtIostorinvCp,JSONObject whereJson,Boolean isUpdate) {
|
||||
JSONArray rows = whereJson.getJSONArray("tableData");
|
||||
@@ -378,6 +595,7 @@ public class StIvtIostorinvCpServiceImpl extends ServiceImpl<StIvtIostorinvCpMap
|
||||
stIvtIostorinvCp.setSysdeptid("111");
|
||||
stIvtIostorinvCp.setSyscompanyid("111");
|
||||
}else {
|
||||
|
||||
// 修改
|
||||
stIvtIostorinvCp.setUpdate_id(SecurityUtils.getCurrentUserId());
|
||||
stIvtIostorinvCp.setUpdate_name(SecurityUtils.getCurrentNickName());
|
||||
@@ -493,6 +711,13 @@ public class StIvtIostorinvCpServiceImpl extends ServiceImpl<StIvtIostorinvCpMap
|
||||
mstDao.setBill_status(IOSEnum.BILL_STATUS.code("分配中"));
|
||||
}
|
||||
|
||||
// 判断是否为生成
|
||||
boolean is_create = dtlDaoList
|
||||
.stream()
|
||||
.allMatch(row -> row.getBill_status().equals(IOSEnum.BILL_STATUS.code("生成")));
|
||||
|
||||
if (is_create) mstDao.setBill_status(IOSEnum.BILL_STATUS.code("生成"));
|
||||
|
||||
this.updateById(mstDao);
|
||||
}
|
||||
|
||||
|
||||
@@ -45,7 +45,8 @@ public class DivRuleCpServiceImpl implements DivRuleCpService {
|
||||
.isNull(StIvtStructattr::getStoragevehicle_code)
|
||||
.eq(StIvtStructattr::getIs_used, "1") //TODO 暂时写死
|
||||
.eq(StIvtStructattr::getLock_type, "1") //TODO 暂时写死
|
||||
);
|
||||
.orderByAsc(StIvtStructattr::getStruct_code)
|
||||
,false);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,8 +2,12 @@
|
||||
<definitions>
|
||||
<process id="JGXJ" name="机关下料">
|
||||
<start id="start" name="Starter" targetRef="A1_JGXJ"></start>
|
||||
<flow id="A1_JGXJ" name="机关下料工序" sourceRef="start" targetRef="A1_TWYTJ"></flow>
|
||||
<flow id="A1_TWYTJ" name="推弯工序" sourceRef="A1_JGXJ" targetRef="A1_SKQX"></flow>
|
||||
<flow id="A1_JGXJ" name="机关下料工序" has="1" sourceRef="start" targetRef="A1_TWYTJ">
|
||||
<param id="cacheLine" value="A1_HCX_01"/>
|
||||
</flow>
|
||||
<flow id="A1_TWYTJ" name="推弯工序" has="1" sourceRef="A1_JGXJ" targetRef="A1_SKQX">
|
||||
<param id="cacheLine" value="A1_HCX_01"/>
|
||||
</flow>
|
||||
<flow id="A1_SKQX" name="深坑清洗" sourceRef="A1_TWYTJ" targetRef="end"></flow>
|
||||
<end id="end" name="Junior Reject End" sourceRef="A1_SKQX"></end>
|
||||
</process>
|
||||
|
||||
@@ -27,7 +27,7 @@ export function edit(data) {
|
||||
export function getSect(data) {
|
||||
return request({
|
||||
url: 'api/sectattr/getSect',
|
||||
method: 'get',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
102
mes/qd/src/views/wms/scheduler_manage/scheduler/index.vue
Normal file
102
mes/qd/src/views/wms/scheduler_manage/scheduler/index.vue
Normal file
@@ -0,0 +1,102 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--表单组件-->
|
||||
<el-dialog append-to-body :close-on-click-modal="false" :before-close="crud.cancelCU" :visible="crud.status.cu > 0"
|
||||
:title="crud.status.title" width="500px">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="80px">
|
||||
<el-form-item label="物料系列" prop="code">
|
||||
<el-input v-model="form.material_spec" style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="工序调度编号">
|
||||
<el-input v-model="form.process_id" style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||
<el-button :loading="crud.status.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!-- 字典列表 -->
|
||||
<el-card class="box-card">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<!-- 搜索 -->
|
||||
<el-input v-model="query.blurry" clearable size="mini" placeholder="输入名称或者描述搜索" style="width: 200px;"
|
||||
class="filter-item" @keyup.enter.native="crud.toQuery"/>
|
||||
<rrOperation/>
|
||||
</div>
|
||||
<crudOperation :permission="permission"/>
|
||||
</div>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
highlight-current-row
|
||||
style="width: 100%;"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
@current-change="handleCurrentChange">
|
||||
<el-table-column type="selection" width="55"/>
|
||||
<el-table-column show-overflow-tooltip prop="material_spec" label="物料系列"/>
|
||||
<el-table-column show-overflow-tooltip prop="process_id" label="工序调度编号"/>
|
||||
<el-table-column show-overflow-tooltip prop="process_name" label="工序调度名称"/>
|
||||
<el-table-column v-permission="['admin','dict:edit','dict:del']" label="操作" width="130px" align="center"
|
||||
fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination/>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudRoute from '@/views/wms/scheduler_manage/scheduler/schedulerRoute.js'
|
||||
import CRUD, {presenter, header, form} from '@crud/crud'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
|
||||
const defaultForm = {material_spec: null, process_id: null, process_name: null}
|
||||
|
||||
export default {
|
||||
name: 'SchedulerRoute',
|
||||
components: {crudOperation, pagination, rrOperation, udOperation},
|
||||
cruds() {
|
||||
return [
|
||||
CRUD({title: '物料对应工序调度', url: '/api/shceduler/route', idField: 'material_spec', crudMethod: {...crudRoute}})
|
||||
]
|
||||
},
|
||||
mixins: [presenter(), header(), form(defaultForm)],
|
||||
data() {
|
||||
return {
|
||||
queryTypeOptions: [
|
||||
{key: 'name', display_name: '字典名称'},
|
||||
{key: 'description', display_name: '描述'}
|
||||
],
|
||||
rules: {
|
||||
material_spec: [
|
||||
{required: true, message: '请输入编码', trigger: 'blur'}
|
||||
]
|
||||
},
|
||||
permission: {
|
||||
add: ['admin', 'dict:add'],
|
||||
edit: ['admin', 'dict:edit'],
|
||||
del: ['admin', 'dict:del']
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
||||
@@ -0,0 +1,34 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function getRoutes() {
|
||||
return request({
|
||||
url: '/api/shceduler/route',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: '/api/shceduler/routeCreate',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: '/api/shceduler/routeDelete',
|
||||
method: 'post',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: '/api/shceduler/routeUpdate',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { getRoutes, add, edit, del }
|
||||
@@ -62,28 +62,6 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="车间" prop="workshop_id">
|
||||
<label slot="label">车间</label>
|
||||
<el-select
|
||||
v-model="form.workshop_id"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="全部"
|
||||
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="仓位" prop="struct_id">
|
||||
<label slot="label">仓位:</label>
|
||||
<el-input v-model="form.struct_id" size="mini" disabled style="width: 210px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="单据状态" prop="bill_status">
|
||||
<el-select
|
||||
v-model="form.bill_status"
|
||||
@@ -226,7 +204,7 @@ import CRUD, { crud, form } from '@crud/crud'
|
||||
import crudProductIn from '@/views/wms/storage_manage/product/productIn/productin'
|
||||
import MaterDtl from '@/views/wms/pub/MaterDialog'
|
||||
import AddDtl from '@/views/wms/storage_manage/product/productIn/AddDtl'
|
||||
import crudStorattr from "@/api/wms/basedata/st/storattr"
|
||||
import crudStorattr, {getStor} from '@/views/wms/storage_manage/basedata/basedata'
|
||||
|
||||
const defaultForm = {
|
||||
bill_code: '',
|
||||
@@ -288,7 +266,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
crudStorattr.queryStor().then(res => {
|
||||
crudStorattr.getStor({ 'stor_type': '4' }).then(res => {
|
||||
this.storlist = res.content
|
||||
})
|
||||
},
|
||||
|
||||
@@ -487,25 +487,6 @@ export default {
|
||||
row.qty = row.storage_qty
|
||||
this.bucketuniqueObj = row
|
||||
},
|
||||
divPoint() {
|
||||
if (!this.form.point_code) {
|
||||
this.crud.notify('请选择入库点', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
if (this.form.tableMater.length === 0) {
|
||||
this.crud.notify('请先选择一条明细!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
crudProductIn.divPoint(this.form).then(res => {
|
||||
crudProductIn.getIODtl({ 'iostorinv_id': this.form.dtl_row.iostorinv_id, 'open_flag': '1' }).then(res => {
|
||||
this.openParam = res
|
||||
})
|
||||
crudProductIn.getDisDtl(this.form.dtl_row).then(res => {
|
||||
this.form.tableMater = res
|
||||
this.crud.notify('设置起点成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
})
|
||||
})
|
||||
},
|
||||
divStruct() {
|
||||
if (this.dis_row === null) {
|
||||
this.crud.notify('请先选择一条分配明细!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
@@ -519,17 +500,16 @@ export default {
|
||||
if (this.form.checked) {
|
||||
this.divBtn = true
|
||||
|
||||
debugger
|
||||
this.dis_row.stor_id = this.stor_id
|
||||
this.dis_row.sect_id = this.sect_id
|
||||
crudProductIn.divStruct(this.dis_row).then(res => {
|
||||
/* crudProductIn.getIODtl({ 'iostorinv_id': this.form.dtl_row.iostorinv_id, 'open_flag': '1' }).then(res => {
|
||||
crudProductIn.getIosInvDtl({ 'iostorinv_id': this.dis_row.iostorinv_id }).then(res => {
|
||||
this.openParam = res
|
||||
this.form.tableMater = []
|
||||
this.dis_row = null
|
||||
this.crud.notify('分配成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
})
|
||||
crudProductIn.getDisDtl(this.form.dtl_row).then(res => {
|
||||
this.form.tableMater = res
|
||||
this.divBtn = false
|
||||
this.crud.notify('分配货位成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
})*/
|
||||
}).finally(() => {
|
||||
this.divBtn = false
|
||||
})
|
||||
@@ -539,23 +519,36 @@ export default {
|
||||
}
|
||||
},
|
||||
unDivStruct() {
|
||||
if (this.form.tableMater.length <= 0) {
|
||||
this.crud.notify('不存在载具明细!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
if (this.dis_row === null) {
|
||||
this.crud.notify('请先选择一条分配明细!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
const flag = this.form.tableMater.some(mater => !mater.struct_code)
|
||||
if (flag) {
|
||||
this.crud.notify('明细存在未分配货位!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
// 如果勾选了,直接跳后台
|
||||
crudProductIn.unDivStruct(this.form).then(res => {
|
||||
crudProductIn.getIODtl({ 'iostorinv_id': this.form.dtl_row.iostorinv_id, 'open_flag': '1' }).then(res => {
|
||||
|
||||
crudProductIn.unDivStruct(this.dis_row).then(res => {
|
||||
crudProductIn.getIosInvDtl({ 'iostorinv_id': this.dis_row.iostorinv_id }).then(res => {
|
||||
this.openParam = res
|
||||
this.form.tableMater = []
|
||||
this.dis_row = null
|
||||
this.crud.notify('取消成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
})
|
||||
crudProductIn.getDisDtl(this.form.dtl_row).then(res => {
|
||||
this.form.tableMater = res
|
||||
this.crud.notify('取消分配成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
})
|
||||
},
|
||||
divPoint() {
|
||||
if (!this.form.point_code) {
|
||||
this.crud.notify('请选择入库点', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
if (this.dis_row === null) {
|
||||
this.crud.notify('请先选择一条明细!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
this.dis_row.point_code = this.form.point_code
|
||||
crudProductIn.setPoint(this.dis_row).then(res => {
|
||||
crudProductIn.getIosInvDtl({ 'iostorinv_id': this.dis_row.iostorinv_id }).then(res => {
|
||||
this.openParam = res
|
||||
this.form.tableMater = []
|
||||
this.dis_row = null
|
||||
this.crud.notify('操作成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
@@ -235,7 +235,7 @@ import DateRangePicker from '@/components/DateRangePicker/index'
|
||||
import AddDialog from '@/views/wms/storage_manage/product/productIn/AddDialog'
|
||||
import DivDialog from '@/views/wms/storage_manage/product/productIn/DivDialog'
|
||||
import ViewDialog from '@/views/wms/storage_manage/product/productIn/ViewDialog'
|
||||
import crudStorattr from '@/api/wms/basedata/st/storattr'
|
||||
import crudStorattr, {getStor} from '@/views/wms/storage_manage/basedata/basedata'
|
||||
import { mapGetters } from 'vuex'
|
||||
|
||||
export default {
|
||||
@@ -281,7 +281,7 @@ export default {
|
||||
}
|
||||
},
|
||||
created() {
|
||||
crudStorattr.queryStor().then(res => {
|
||||
crudStorattr.getStor({ 'stor_type': '4' }).then(res => {
|
||||
this.storlist = res.content
|
||||
})
|
||||
},
|
||||
@@ -341,7 +341,7 @@ export default {
|
||||
this.crud.notify('请选择一条单据', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
crudProductIn.confirm(this.currentRow).then(res => {
|
||||
crudProductIn.confirm({ 'iostorinv_id': this.currentRow.iostorinv_id }).then(res => {
|
||||
this.crud.notify('单据确认成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
})
|
||||
|
||||
@@ -66,7 +66,31 @@ export function getSect(data) {
|
||||
|
||||
export function divStruct(data) {
|
||||
return request({
|
||||
url: '/api/stIvtSectattr/divStruct',
|
||||
url: '/api/productIn/divStruct',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function unDivStruct(data) {
|
||||
return request({
|
||||
url: '/api/productIn/unDivStruct',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function setPoint(data) {
|
||||
return request({
|
||||
url: '/api/productIn/setPoint',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function confirm(data) {
|
||||
return request({
|
||||
url: '/api/productIn/confirm',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
@@ -81,5 +105,8 @@ export default {
|
||||
vehicleCheck,
|
||||
confirmvehicle,
|
||||
getSect,
|
||||
divStruct
|
||||
divStruct,
|
||||
unDivStruct,
|
||||
setPoint,
|
||||
confirm
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user