From e40fbd2baf5ea4735288f5f6ae3115c95cd5cc7b Mon Sep 17 00:00:00 2001 From: Comair <1464848666@qq.com> Date: Thu, 25 Jul 2024 11:38:29 +0800 Subject: [PATCH] =?UTF-8?q?=E5=86=B2=E5=AD=94=E5=9B=9E=E7=AB=8B=E5=BA=93?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BB=BB=E5=8A=A1=E6=98=8E=E7=BB=86=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=20=E9=87=8D=E5=85=A5=E5=BA=93=E4=BA=8C=E6=AC=A1?= =?UTF-8?q?=E5=88=A4=E6=96=AD=E6=98=AF=E5=90=A6=E6=9C=89=E5=8D=A0=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application-test.yml | 5 +- shkj-admin/src/test/java/com/shkj/testB.java | 219 +++++++++--------- .../java/com/shkj/wms/enums/TaskTypeEnum.java | 2 +- .../java/com/shkj/wms/plc/PlcEventTask.java | 14 +- .../shkj/wms/scheduled/ScheduledTasks.java | 33 ++- .../wms/service/IBaseLocationService.java | 2 + .../service/impl/BaseLocationServiceImpl.java | 9 + .../wms/service/impl/StackServiceImpl.java | 52 ++--- .../impl/SysStockDetailServiceImpl.java | 5 +- .../wms/service/impl/SysStockServiceImpl.java | 2 + 10 files changed, 185 insertions(+), 158 deletions(-) diff --git a/shkj-admin/src/main/resources/application-test.yml b/shkj-admin/src/main/resources/application-test.yml index 784f71c..b187707 100644 --- a/shkj-admin/src/main/resources/application-test.yml +++ b/shkj-admin/src/main/resources/application-test.yml @@ -13,13 +13,12 @@ spring: # 主库数据源 master: url: jdbc:mysql://127.0.0.1:3306/po1_wms_wcs?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 - # url: jdbc:mysql://127.0.0.1:3306/po1testsh?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 username: root - password: 123456 + password: root # 从库数据源 slave: # 从数据源开关/默认关闭 - enabled: false + enabled: falsegetGoodsInfoByDerive url: username: password: diff --git a/shkj-admin/src/test/java/com/shkj/testB.java b/shkj-admin/src/test/java/com/shkj/testB.java index 7ad6b08..1e63782 100644 --- a/shkj-admin/src/test/java/com/shkj/testB.java +++ b/shkj-admin/src/test/java/com/shkj/testB.java @@ -1,104 +1,115 @@ -//package com.shkj; -// -// -//import io.swagger.models.auth.In; -//import org.apache.commons.lang3.tuple.ImmutablePair; -//import org.apache.commons.lang3.tuple.Pair; -//import org.apache.poi.ss.formula.functions.T; -//import org.junit.Test; -// -//import java.util.*; -//import java.util.stream.Collectors; -// -//public class testB { -// -// -// -// -// public class WeightRandomStrategy { -// private TreeMap weightMap = new TreeMap<>(); -// private Map map =new HashMap(); -// private Map nmap =new HashMap(); -// private TreeMap Map = new TreeMap<>(); -// -// public WeightRandomStrategy(List> list) { -// for (Pair pair : list) { -// nmap.put(pair.getKey(),pair.getValue()); -// map.put(String.valueOf(pair.getKey()),0); -// double lastWeight = this.weightMap.size() == 0 ? 0 : this.weightMap.lastKey(); -// this.weightMap.put(pair.getValue().doubleValue() + lastWeight, pair.getKey()); -// } -// } -// -// public java.lang.String randome(){ -// Map.putAll(weightMap); -// String k = random(); -// return k; -// } -// -// public String random() { -// -// Double aDouble = this.Map.lastKey(); -// double random = Math.random(); -// double randomWeight = aDouble* random; -// SortedMap tailMap = this.Map.tailMap(randomWeight, false); -// String k = String.valueOf(this.Map.get(tailMap.firstKey())); -// int o = (Integer) this.nmap.get(k); -// int o2 = (Integer)map.get(k); -// if (o2==o){ -// System.out.println("========"+k); -// Map.remove(tailMap.firstKey()); -// -// if (Map.size()==0){ -// List collect = map.entrySet().stream().map(java.util.Map.Entry::getKey).collect(Collectors.toList()); -// collect.stream().forEach(e->{ -// map.put(String.valueOf(e),0); -// }); -// Map.putAll(weightMap); -// } -// k=random(); -// return k; -// } -// Integer o1 = (Integer) map.get(k); -// map.put(k,o1+1); -// return k; -// } -// } -// @Test -// public void testb(){ -// List> list = new ArrayList<>(); -// list.add(new ImmutablePair<>("RKu", 2)); -// list.add(new ImmutablePair<>("Cku", 2)); -// list.add(new ImmutablePair<>("CKong", 1)); -// list.add(new ImmutablePair<>("YChang", 1)); -// list.add(new ImmutablePair<>("HLiu", 1)); -// list.add(new ImmutablePair<>("JinCK", 1)); -// list.add(new ImmutablePair<>("TE",3)); -// WeightRandomStrategy strategy = new WeightRandomStrategy<>(list); -// int a = 0, b = 0,c = 0,d = 0,e = 0,f =0,g = 0; -// for (int i = 0; i < 10014; i++) { -// String randome = strategy.randome(); -// System.out.println(randome); -// switch (randome){ -// case "RKu": a++;break; -// case "Cku":b++;break; -// case "CKong":c++;break; -// case "YChang":d++;break; -// case "HLiu":e++;break; -// case "JinCK":f++;break; -// case "TE":g++;break; -// } -// } -// System.out.println("a=" + a + ", b=" + b+", c=" + c+", d=" + d+", e=" + e+", f=" + f+", g=" + g); -// System.out.println("a+b=" + (a + b+c+d+e+f+g)); -// -// } -// -// @Test -// public void test01(){ -// List list = new ArrayList(); -// System.out.println(list.size()); -// } -// -// -//} +package com.shkj; + + +import com.shkj.wms.service.ISysAppVersionService; +import io.swagger.models.auth.In; +import org.apache.commons.lang3.tuple.ImmutablePair; +import org.apache.commons.lang3.tuple.Pair; +import org.apache.poi.ss.formula.functions.T; +import org.junit.Test; + +import java.text.SimpleDateFormat; +import java.util.*; +import java.util.stream.Collectors; + +public class testB { + + + + + public class WeightRandomStrategy { + private TreeMap weightMap = new TreeMap<>(); + private Map map =new HashMap(); + private Map nmap =new HashMap(); + private TreeMap Map = new TreeMap<>(); + + public WeightRandomStrategy(List> list) { + for (Pair pair : list) { + nmap.put(pair.getKey(),pair.getValue()); + map.put(String.valueOf(pair.getKey()),0); + double lastWeight = this.weightMap.size() == 0 ? 0 : this.weightMap.lastKey(); + this.weightMap.put(pair.getValue().doubleValue() + lastWeight, pair.getKey()); + } + } + + public java.lang.String randome(){ + Map.putAll(weightMap); + String k = random(); + return k; + } + + public String random() { + + Double aDouble = this.Map.lastKey(); + double random = Math.random(); + double randomWeight = aDouble* random; + SortedMap tailMap = this.Map.tailMap(randomWeight, false); + String k = String.valueOf(this.Map.get(tailMap.firstKey())); + int o = (Integer) this.nmap.get(k); + int o2 = (Integer)map.get(k); + if (o2==o){ + System.out.println("========"+k); + Map.remove(tailMap.firstKey()); + + if (Map.size()==0){ + List collect = map.entrySet().stream().map(java.util.Map.Entry::getKey).collect(Collectors.toList()); + collect.stream().forEach(e->{ + map.put(String.valueOf(e),0); + }); + Map.putAll(weightMap); + } + k=random(); + return k; + } + Integer o1 = (Integer) map.get(k); + map.put(k,o1+1); + return k; + } + } + @Test + public void testb(){ + List> list = new ArrayList<>(); + list.add(new ImmutablePair<>("RKu", 2)); + list.add(new ImmutablePair<>("Cku", 2)); + list.add(new ImmutablePair<>("CKong", 1)); + list.add(new ImmutablePair<>("YChang", 1)); + list.add(new ImmutablePair<>("HLiu", 1)); + list.add(new ImmutablePair<>("JinCK", 1)); + list.add(new ImmutablePair<>("TE",3)); + WeightRandomStrategy strategy = new WeightRandomStrategy<>(list); + int a = 0, b = 0,c = 0,d = 0,e = 0,f =0,g = 0; + for (int i = 0; i < 10014; i++) { + String randome = strategy.randome(); + System.out.println(randome); + switch (randome){ + case "RKu": a++;break; + case "Cku":b++;break; + case "CKong":c++;break; + case "YChang":d++;break; + case "HLiu":e++;break; + case "JinCK":f++;break; + case "TE":g++;break; + } + } + System.out.println("a=" + a + ", b=" + b+", c=" + c+", d=" + d+", e=" + e+", f=" + f+", g=" + g); + System.out.println("a+b=" + (a + b+c+d+e+f+g)); + + } + + @Test + public void test01(){ + List list = new ArrayList(); + System.out.println(list.size()); + } + + @Test + public void tees02(){ + + Calendar c = Calendar.getInstance(); + c.setTime(new Date()); + c.add(Calendar.DATE, 98); + System.out.println("获取的新的时间:"+c.getTime()); + } + + +} diff --git a/shkj-wms/src/main/java/com/shkj/wms/enums/TaskTypeEnum.java b/shkj-wms/src/main/java/com/shkj/wms/enums/TaskTypeEnum.java index 6a50353..c1142c6 100644 --- a/shkj-wms/src/main/java/com/shkj/wms/enums/TaskTypeEnum.java +++ b/shkj-wms/src/main/java/com/shkj/wms/enums/TaskTypeEnum.java @@ -114,7 +114,7 @@ public enum TaskTypeEnum { /** * 指定货位出库 */ - named_loc("22","指定货位出库"), + named_loc("25","指定货位出库"), /** * 23 跨巷道移库出库 diff --git a/shkj-wms/src/main/java/com/shkj/wms/plc/PlcEventTask.java b/shkj-wms/src/main/java/com/shkj/wms/plc/PlcEventTask.java index 0122d82..9580304 100644 --- a/shkj-wms/src/main/java/com/shkj/wms/plc/PlcEventTask.java +++ b/shkj-wms/src/main/java/com/shkj/wms/plc/PlcEventTask.java @@ -136,7 +136,7 @@ public class PlcEventTask { private ScheduledExecutorService executorService = Executors.newScheduledThreadPool(8); - @Scheduled(fixedRate = 200) + // @Scheduled(fixedRate = 200) public void init() { //查询需要连接的PLC,初始化连接对象 List plcList = iWcsPlcConnectService.selectWcsPlcConnectList(new WcsPlcConnect().setIsActive("1")); @@ -219,7 +219,7 @@ public class PlcEventTask { } } - @Scheduled(fixedRate = 200) + // @Scheduled(fixedRate = 200) public void init1() { //查询需要连接的PLC,初始化连接对象 List plcList = iWcsPlcConnectService.selectWcsPlcConnectList(new WcsPlcConnect().setIsActive("1")); @@ -237,7 +237,7 @@ public class PlcEventTask { } } - @Scheduled(fixedRate = 200) + // @Scheduled(fixedRate = 200) public void init2() { //查询需要连接的PLC,初始化连接对象 List plcList = iWcsPlcConnectService.selectWcsPlcConnectList(new WcsPlcConnect().setIsActive("1")); @@ -255,7 +255,7 @@ public class PlcEventTask { } } - @Scheduled(fixedDelay = 6000) + // @Scheduled(fixedDelay = 6000) public void writePlcheartbeat() { //根据连接的plcId获取属性 PlcOperate plcOperate = plcInit.getPlcOperate_41(); @@ -930,10 +930,14 @@ public class PlcEventTask { //重新验证货位状态是否有货,如果有则重新分配货位,只获取当前货位中可用货位 Long locationId = businDataTask.getLocationId(); BaseLocation baseLocation = iBaseLocationService.getById(locationId); - log.info("给堆垛机下发任务时,原货位:"+JsonUtil.toJSONString(baseLocation)); + if (baseLocation == null){ + baseLocation= iBaseLocationService.queryBaseLocationByrcl(businDataTask.getToRow(), businDataTask.getToColumn(),businDataTask.getToLayer(),businDataTask.getTunnel()); + } + String locationStatus = baseLocation.getLocationStatus(); if ("1".equals(locationStatus) || "2".equals(locationStatus) || "5".equals(locationStatus) ){ + log.info("给堆垛机下发任务:"+taskId+" 原货位:"+JsonUtil.toJSONString(baseLocation)); BaseLocationVo baseLocationVo = iBaseLocationService.queryLocationByTunnel(baseLocation.getTunnel()); BaseLocation newLocation = BeanUtil.toBean(baseLocationVo, BaseLocation.class); newLocation.setLocationStatus("4"); diff --git a/shkj-wms/src/main/java/com/shkj/wms/scheduled/ScheduledTasks.java b/shkj-wms/src/main/java/com/shkj/wms/scheduled/ScheduledTasks.java index ec25fab..63efa8f 100644 --- a/shkj-wms/src/main/java/com/shkj/wms/scheduled/ScheduledTasks.java +++ b/shkj-wms/src/main/java/com/shkj/wms/scheduled/ScheduledTasks.java @@ -177,8 +177,7 @@ public class ScheduledTasks { return booleanResult; } - // @PostConstruct -// @Scheduled(cron = "0/3 * * * * ? ") + @Scheduled(fixedRate = 200) public void task() { // log.info("开始获取需要执行的任务"); @@ -236,10 +235,11 @@ public class ScheduledTasks { taskQueryBo.setTaskType("21"); List businDataTaskVo21 = iBusinDataTaskService.selectBusinDataTask1(taskQueryBo); businDataTaskVos.addAll(businDataTaskVo21); - taskQueryBo.setTaskType("22"); - List businDataTaskVo22 = iBusinDataTaskService.selectBusinDataTask1(taskQueryBo); - businDataTaskVos.addAll(businDataTaskVo22); - log.info("要执行的任务信息:"+JsonUtil.toJSONString(businDataTaskVos)); + //指定货位出库 + taskQueryBo.setTaskType("25"); + List businDataTaskVo25 = iBusinDataTaskService.selectBusinDataTask1(taskQueryBo); + businDataTaskVos.addAll(businDataTaskVo25); + // log.info("要执行的任务信息:"+JsonUtil.toJSONString(businDataTaskVos)); for (BusinDataTaskVo businDataTaskVo : businDataTaskVos) { doTask(businDataTaskVo); } @@ -347,10 +347,6 @@ public class ScheduledTasks { Long stkPlcId = null; String agvno = null; - //获取派生 - // TODO 由于逻辑区域换成与车型相匹配,不是与派生匹配,所以注释掉 -// Long dervieId = getLocationByDervie(vehicheModel, color); - String randome = "P01"; if (businDataTaskVo.getWarehouseType().equals("1")) { @@ -1601,6 +1597,23 @@ public class ScheduledTasks { }else if (taskType.equals(TaskTypeEnum.relocation_out.getValue())){ BusinDataTask businDataTask = iBusinDataTaskService.getById(businDataTaskVo.getId()); Result taskResult = outTask(businDataTask); + if (Result.isOk(taskResult)) { + businDataTaskVo.setTaskStatus(TaskStatusEnum.wait_callback.getValue()); + } else { + businDataTaskVo.setExceptionMsg("下发堆垛机失败"); + businDataTask.setTaskStatus(TaskStatusEnum.err.getValue()); + } + } + else if("25".equals(taskType)){ + BusinDataTask businDataTask = iBusinDataTaskService.getById(businDataTaskVo.getId()); + Result taskResult = outTask(businDataTask); + businDataTaskVo.setUpdateTime(DateUtils.getNowDate()); + if (Result.isOk(taskResult)) { + businDataTaskVo.setTaskStatus(TaskStatusEnum.wait_callback.getValue()); + } else { + businDataTaskVo.setExceptionMsg("下发堆垛机失败"); + businDataTask.setTaskStatus(TaskStatusEnum.err.getValue()); + } } log.info("任务号" + businDataTaskVo.getId() + "任务状态" + businDataTaskVo.getTaskStatus() + "点位信息" + businDataTaskVo.getPoints()); //统一提交任务数据 diff --git a/shkj-wms/src/main/java/com/shkj/wms/service/IBaseLocationService.java b/shkj-wms/src/main/java/com/shkj/wms/service/IBaseLocationService.java index 45cabdd..a9614d7 100644 --- a/shkj-wms/src/main/java/com/shkj/wms/service/IBaseLocationService.java +++ b/shkj-wms/src/main/java/com/shkj/wms/service/IBaseLocationService.java @@ -96,6 +96,8 @@ public interface IBaseLocationService extends IService { */ List queryBaseLocationList(BaseLocationQueryPageBo bo); + BaseLocation queryBaseLocationByrcl(String locationRow,String locationCol,String layer,String tunnel); + /** * 查询满足条件下的货位数据对应的巷道号 diff --git a/shkj-wms/src/main/java/com/shkj/wms/service/impl/BaseLocationServiceImpl.java b/shkj-wms/src/main/java/com/shkj/wms/service/impl/BaseLocationServiceImpl.java index 19b30f1..685ff3c 100644 --- a/shkj-wms/src/main/java/com/shkj/wms/service/impl/BaseLocationServiceImpl.java +++ b/shkj-wms/src/main/java/com/shkj/wms/service/impl/BaseLocationServiceImpl.java @@ -214,6 +214,15 @@ public class BaseLocationServiceImpl extends ServiceImpl wrapper = new LambdaQueryWrapper().eq(BaseLocation::getLocationRow, locationRow) + .eq(BaseLocation::getLocationColumn, locationCol).eq(BaseLocation::getLayer, layer).eq(BaseLocation::getTunnel, tunnel).last("limit 1"); + BaseLocation baseLocation = this.getOne(wrapper); + return baseLocation; + } + + @Override @DataScopeConsignor(branchAlias = "bl") public List queryBaseLocationTunnelList(BaseLocationQueryListBo bo) { diff --git a/shkj-wms/src/main/java/com/shkj/wms/service/impl/StackServiceImpl.java b/shkj-wms/src/main/java/com/shkj/wms/service/impl/StackServiceImpl.java index c3e5495..af98d72 100644 --- a/shkj-wms/src/main/java/com/shkj/wms/service/impl/StackServiceImpl.java +++ b/shkj-wms/src/main/java/com/shkj/wms/service/impl/StackServiceImpl.java @@ -279,36 +279,29 @@ public class StackServiceImpl implements IStackService { case 2: //获取当前在冲孔放货口的任务相关信息 if(ObjectUtils.isEmpty(redisTemplate.opsForValue().get(RedisConstant.endPunchingTaskId))){ - break; + return AjaxResult.error("未货位到冲孔信息"); } // 将redis 中的值转成字符串 String endPunchingTaskId = redisTemplate.opsForValue().get(RedisConstant.endPunchingTaskId).toString(); + log.info("冲孔去立库,获取redis中的数据:"+endPunchingTaskId); String[] endIdArr = endPunchingTaskId.split("_"); - - BasePointDeviceVo basePointDeviceVo = new BasePointDeviceVo(); //立库输送线接驳点-入 String toLocation = ""; - BusinTaskExeBo exeBo = new BusinTaskExeBo(); Long plcId = null; Long stkPlcId=null; - List businDataTaskGoodsVos = iBusinDataTaskGoodsService.selectBusinTaskGoodsByTaskCode(Long.valueOf(endIdArr[0])); if(ObjectUtils.isEmpty(businDataTaskGoodsVos)){ - break; + log.info("冲孔入立库,无保险杠信息不可入:"+endIdArr); + return AjaxResult.error("无保险杠明细信息,不可入立库"); } BusinDataTaskGoodsVo goodsVo = businDataTaskGoodsVos.get(0); String vehicheModel = goodsVo.getVehicheModel(); String color =goodsVo.getColor(); String goodsNo = goodsVo.getGoodsNo(); String startPoint = toPointNoTwo; - - //根据派生分配库位 - // TODO: 2024/6/28 zjx - // Result locationVoResult = iBaseLocationService.assignEmptyLocation(vehicheModel,color, DateUtils.getDate(),businDataTaskGoodsVos); - // Result locationVoResult = iBaseLocationService.assignEmptyLocationByStock( goodsNo, vehicheModel,DateUtils.getDate(),businDataTaskGoodsVos); // 2024/07/18 zjx 分配货位统一方法 AssingEmptyLocBo emptyLocBo = new AssingEmptyLocBo(); emptyLocBo.setBatch(DateUtils.getDate()); @@ -317,30 +310,26 @@ public class StackServiceImpl implements IStackService { emptyLocBo.setBusinDataTaskGoodsVos(businDataTaskGoodsVos); Result locationVoResult=iBaseLocationService.assignEmptyLocationAll(emptyLocBo); - String agvno=null; - BaseLocationVo locationVo = locationVoResult.getData(); String tunnel = locationVo.getTunnel(); Long locationId = locationVo.getId(); - for (BusinDataTaskGoodsVo businDataTaskGoodsVo : businDataTaskGoodsVos) { - businDataTaskGoodsVo.setLocationId(locationId); - } int agvTaskType1 = RCSTaskTypeEnum.TO_B_AND_PUT.getValue(); //获取下料点点位 String taskCode = "T_" + DateUtils.dateTimeNow(); - String transId = com.shkj.common.utils.uuid.UUID.randomUUID().toString(); + //String transId = com.shkj.common.utils.uuid.UUID.randomUUID().toString(); BusinDataTask businDataTask =new BusinDataTask(); businDataTask.setTaskCode(taskCode); businDataTask.setTaskStatus(TaskStatusEnum.wait_put.getValue()); businDataTask.setCreateTime(DateUtils.getNowDate()); businDataTask.setBatch(DateUtils.getDate()); - businDataTask.setTransId(transId); + // businDataTask.setTransId(transId); businDataTask.setAgvNo(endIdArr[1]); businDataTask.setContainerId(Long.valueOf(endIdArr[2])); businDataTask.setTaskType("18"); businDataTask.setIsDown(agvTaskType1+""); + businDataTask.setLocationId(locationId); //回填任务的入行高列 businDataTask.setToColumn(locationVo.getLocationColumn()); @@ -363,19 +352,23 @@ public class StackServiceImpl implements IStackService { iBusinDataTaskService.insertBusinDataTask(businDataTask); Long taskId =businDataTask.getId(); + List goodsList = new ArrayList<>(); + for (BusinDataTaskGoodsVo taskGoodsVo : businDataTaskGoodsVos) { + BusinDataTaskGoods businDataTaskGoods = BeanUtil.toBean(taskGoodsVo, BusinDataTaskGoods.class); + businDataTaskGoods.setTaskCode(taskId); + businDataTaskGoods.setCreateTime(DateUtils.getNowDate()); + goodsList.add(businDataTaskGoods); + } + boolean b = iBusinDataTaskGoodsService.saveOrUpdateBatch(goodsList); + if (!b){ + log.info("冲孔去立库添加保险杠明细失败"); + } //获取巷道对应的堆垛机信息 pointQueryBo.setDevType("1"); BaseDevicePlcVo baseDevicePlcVo = baseLocationPlcMapper.selectBaseDevicePlc(pointQueryBo); stkPlcId = baseDevicePlcVo.getPlcId(); - exeBo.setTaskCode(taskId); - exeBo.setBusinDataTaskGoodsVo(businDataTaskGoodsVos); - exeBo.setContainerId(Long.valueOf(endIdArr[2])); - exeBo.setBaseLocationVo(locationVo); - exeBo.setTransNo("1"); - exeBo.setTransQual("1"); - List points = new ArrayList<>(); points.add(startPoint); @@ -416,15 +409,6 @@ public class StackServiceImpl implements IStackService { if (booleanResult1.getCode()== HttpStatus.SUCCESS.getCode()) { businDataTaskVo.setTaskPath(toLocation); businDataTaskVo.setTaskStatus(TaskStatusEnum.wait_callback.getValue()); - //生成入库单 - // Result stringResult = iPutInOutStorageService.exeTaskPutinStorage(exeBo); - //生成入库单成功 -// if (stringResult.getCode() == HttpStatus.SUCCESS.getCode()) { -// businDataTaskVo.setTransId(stringResult.getData()); -// } else { -// businDataTaskVo.setTaskStatus(TaskStatusEnum.err.getValue()); -// businDataTaskVo.setExceptionMsg("生成入库单失败"); - //} //修改冲孔完成 BasePunchRecord basePunchRecord = iBasePunchRecordService.getOne(new LambdaQueryWrapper() .eq(BasePunchRecord::getTaskCode,Long.valueOf(endIdArr[0])) diff --git a/shkj-wms/src/main/java/com/shkj/wms/service/impl/SysStockDetailServiceImpl.java b/shkj-wms/src/main/java/com/shkj/wms/service/impl/SysStockDetailServiceImpl.java index 2fce580..6aa393b 100644 --- a/shkj-wms/src/main/java/com/shkj/wms/service/impl/SysStockDetailServiceImpl.java +++ b/shkj-wms/src/main/java/com/shkj/wms/service/impl/SysStockDetailServiceImpl.java @@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.github.pagehelper.Page; import com.shkj.common.core.domain.Result; +import com.shkj.common.utils.DateUtils; import com.shkj.common.utils.SecurityUtils; import com.shkj.wms.bo.*; import com.shkj.wms.domain.*; @@ -54,7 +55,7 @@ public class SysStockDetailServiceImpl extends ServiceImpl i sysStock = this.getById(sysStockVos.get(0).getId()); sysStock.setStorageId(storageCode); sysStock.setGoodsNo(good.get("goodsNo")); + sysStock.setCreateTime(DateUtils.getNowDate()); BigDecimal oldQty = sysStock.getQty() != null ? sysStock.getQty() : BigDecimal.valueOf(0); sysStock.setQty(oldQty.add(BigDecimal.valueOf(goods.size()))); this.updateById(sysStock);