#
6. 大屏添加作业类型 (全盘,还是分拣 IOType)
10.平库出库时,当前平库ID是写死在Sql里,需修改
11.平库出库没有判断是否预约出库,且生成拣货单时没有锁定库存,需确认是否考虑回库问题
26. 已拣过货的任务明细,可以再次拣货,拣货明细需添加一个拣货状态
47. 确认发货前,需判断是否已绑定至集货区
48. CTU出库后,库位103不再删除原有库位信息
| | |
| | | const matChecked = ref([]);
|
| | | const matQueryList = ref(null);
|
| | | const matFetching = ref(false);
|
| | | const searchText = ref('')
|
| | | const matSelectList = ref([]);
|
| | | const addDetl = () => {
|
| | | openAddDetl.value = true;
|
| | |
| | | }
|
| | |
|
| | | const handleSearch = debounce(val => {
|
| | | searchText.value = val
|
| | | matQuery(val);
|
| | | }, 600)
|
| | |
|
| | |
| | | }
|
| | |
|
| | | matQuery(null);
|
| | |
|
| | | function matQuery(condition) {
|
| | | matFetching.value = true;
|
| | | post('/api/mat/page', {
|
| | |
| | |
|
| | | <a-modal v-model:open="openAddDetl" :title="formatMessage('component.orderDetl.edit.addDetl', '添加明细')"
|
| | | @ok="handleAddDetlOk" @cancel="handleAddDetlCancel">
|
| | | <a-select v-model:value="matChecked" :options="matQueryList" mode="multiple"
|
| | | <a-select v-model:value="matChecked" :options="matQueryList" mode="multiple" :searchValue="searchText"
|
| | | :placeholder="formatMessage('component.orderDetl.edit.selectMat', '请选择物料')" @search="handleSearch"
|
| | | :filter-option="false" :not-found-content="matFetching ? undefined : null" @select="handleSelect"
|
| | | :filter-option="false" :not-found-content="matFetching ? undefined : null" @select="handleSelect" allowClear
|
| | | @deselect="handleDeselect"></a-select>
|
| | | </a-modal>
|
| | | </div>
|
| | |
| | | </script>
|
| | |
|
| | | <style>
|
| | | .col {
|
| | | color: ;
|
| | | }
|
| | |
|
| | | </style>
|
| | |
| | | import com.zy.asrs.wms.apis.wcs.entity.request.RfidSingalRequest; |
| | | import com.zy.asrs.wms.apis.wcs.entity.request.TasksStatusCallbackParam; |
| | | import com.zy.asrs.wms.apis.wcs.services.WcsApiService; |
| | | import com.zy.asrs.wms.asrs.entity.param.BindPlatformParam; |
| | | import com.zy.asrs.wms.asrs.service.PlatformService; |
| | | import com.zy.asrs.wms.system.controller.BaseController; |
| | | import io.netty.util.internal.StringUtil; |
| | |
| | | |
| | | @Autowired |
| | | private WcsApiService wcsApiService; |
| | | |
| | | @Autowired |
| | | private PlatformService platformService; |
| | | |
| | | |
| | | /** |
| | |
| | | return wcsApiService.getPlatforms(); |
| | | } |
| | | |
| | | |
| | | // /** |
| | | // * 绑定订单与集货区关系 |
| | | // * @param platform |
| | | // * @return |
| | | // */ |
| | | // @PostMapping("/bind/shipping/platform") |
| | | // public R bindShippingAndPlatform(@RequestBody BindPlatformParam platform) { |
| | | // return platformService.bindShippingPlatform(platform); |
| | | // } |
| | | // |
| | | |
| | | |
| | | } |
| | |
| | | */ |
| | | private String batch; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 库存 |
| | | */ |
| | |
| | | import com.zy.asrs.wms.apis.wcs.entity.domain.WaveTaskDetl; |
| | | import com.zy.asrs.wms.apis.wcs.entity.response.SowSeeds; |
| | | import com.zy.asrs.wms.apis.wcs.services.WaveManagentService; |
| | | import com.zy.asrs.wms.asrs.entity.CacheSite; |
| | | import com.zy.asrs.wms.asrs.entity.Order; |
| | | import com.zy.asrs.wms.asrs.entity.OrderDetl; |
| | | import com.zy.asrs.wms.asrs.entity.Task; |
| | | import com.zy.asrs.wms.asrs.entity.*; |
| | | import com.zy.asrs.wms.asrs.entity.dto.LargeScreenTaskDto; |
| | | import com.zy.asrs.wms.asrs.entity.enums.OrderPickStatus; |
| | | import com.zy.asrs.wms.asrs.entity.enums.TaskStsType; |
| | | import com.zy.asrs.wms.asrs.entity.param.WaveSeedReviewParam; |
| | | import com.zy.asrs.wms.asrs.mapper.CacheSiteMapper; |
| | | import com.zy.asrs.wms.asrs.mapper.OrderDetlMapper; |
| | | import com.zy.asrs.wms.asrs.mapper.OrderMapper; |
| | | import com.zy.asrs.wms.asrs.mapper.TaskMapper; |
| | | import com.zy.asrs.wms.asrs.mapper.*; |
| | | import com.zy.asrs.wms.asrs.service.TaskService; |
| | | import com.zy.asrs.wms.asrs.service.WaveSeedService; |
| | | import org.aspectj.weaver.ast.Or; |
| | |
| | | private TaskService taskService; |
| | | @Autowired |
| | | private TaskMapper taskMapper; |
| | | |
| | | @Autowired |
| | | private TaskTypeMapper taskTypeMapper; |
| | | @Autowired |
| | | private OrderMapper orderMapper; |
| | | @Autowired |
| | |
| | | |
| | | @Override |
| | | public R getTask() { |
| | | List<LargeScreenTaskDto> taskDtos = taskMapper.getTaskIntegrateByTaskNo(new LambdaQueryWrapper<Task>().eq(Task::getTaskSts, TaskStsType.WAVE_SEED.id)); |
| | | List<LargeScreenTaskDto> taskDtos = taskMapper.getTaskIntegrateByTaskNo(new LambdaQueryWrapper<Task>().eq(Task::getTaskSts, TaskStsType.WAVE_SEED.id).orderByAsc(Task::getUpdateTime).last("limit 1")); |
| | | |
| | | return R.ok(taskDtos); |
| | | } |
| | | |
| | |
| | | }
|
| | | } else { //出库任务
|
| | | if (callbackParam.getEventType().equals(EssTaskStatus.TASK_EVENT_TOTE_LOAD.event)) { //上报取箱状态
|
| | | //TODO 定时器开启后,要删除 || task.getTaskType() == TaskStsType.GENERATE_OUT.id
|
| | | if (task.getTaskSts() == TaskStsType.WCS_EXECUTE_OUT.id || task.getTaskSts() == TaskStsType.GENERATE_OUT.id) {
|
| | | if (task.getTaskSts() == TaskStsType.WCS_EXECUTE_OUT.id ) {
|
| | | taskStsType = TaskStsType.WCS_EXECUTE_OUT_TOTE_LOAD;
|
| | | } else {
|
| | | String errMsg = "任务编号:" + task.getTaskNo() + "状态为不匹配," + "不能执行:" + TaskStsType.WCS_EXECUTE_OUT_TOTE_LOAD.desc + "任务";
|
| | |
| | | }
|
| | |
|
| | | //更新出库状态及相关字段
|
| | | taskService.update(new LambdaUpdateWrapper<Task>()
|
| | | boolean update = taskService.update(new LambdaUpdateWrapper<Task>()
|
| | | .set(Task::getRobotCode, callbackParam.getRobotCode())
|
| | | .set(Task::getSysTaskCode, callbackParam.getSysTaskCode())
|
| | | .set(Task::getTaskSts, taskStsType.id)
|
| | |
| | | .set(Task::getTaskDesc, callbackParam.getMessage())
|
| | | .eq(Task::getBarcode, callbackParam.getContainerCode())
|
| | | .eq(Task::getTaskNo, callbackParam.getTaskCode()));
|
| | |
|
| | | if (!update) {
|
| | | throw new CoolException("任务更新失败!!");
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
| | | * @param request
|
| | | */
|
| | | @Override
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | public void slapLightLogic(Map<String, Object> request) {
|
| | | String taskNo = request.get("taskNo").toString();
|
| | | String orderNo = request.get("orderNo").toString();
|
| | |
| | | */ |
| | | private String waveNo; |
| | | |
| | | /** |
| | | * 任务类型 |
| | | */ |
| | | private String title; |
| | | |
| | | private Long id; |
| | | /** |
| | | * 拖盘码 |
| | |
| | | */ |
| | | private String taskNo; |
| | | /** |
| | | * 任务类型 |
| | | */ |
| | | private String taskType; |
| | | |
| | | /** |
| | | * 任务状态 |
| | | */ |
| | | private Integer taskSts; |
| | |
| | |
|
| | | private Long platformId;
|
| | |
|
| | | private String siteNo;
|
| | | private String waveId;
|
| | |
|
| | | private String orderNo;
|
| | | private String orderId;
|
| | |
|
| | | private String siteNo;
|
| | |
|
| | | }
|
| | |
| | | List<OrderOutMergeParam> mergeParam = params.stream().filter(par -> {
|
| | | return !StringUtils.isNullOrEmpty(par.getLocNo());
|
| | | }).collect(Collectors.toList());
|
| | | //数据分类 1.平库数据 2. TUC数据
|
| | | //数据分类 1.平库数据 2. CTU数据
|
| | | Map<Long, List<OrderOutMergeParam>> listMap = mergeParam.stream().collect(Collectors.groupingBy(OrderOutMergeParam::getTypeId));
|
| | |
|
| | | listMap.keySet().forEach(key -> {
|
| | |
| | | //锁定库存量
|
| | | locDetl.setWorkQty(locDetl.getWorkQty() + outOder.getAnfme());
|
| | |
|
| | | if (!locDetlService.updateById(locDetl)) {
|
| | | throw new CoolException("库存加锁失败!!");
|
| | | }
|
| | |
|
| | | });
|
| | |
|
| | | });
|
| | |
| | |
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | public void cancelWave(List<Long> waveIds) {
|
| | | if (waveIds == null) {
|
| | | throw new CoolException("参数不能为空");
|
| | |
| | | throw new CoolException("已存在任务,禁止取消波次");
|
| | | }
|
| | |
|
| | | List<PickSheet> pickSheets = pickSheetService.list(new LambdaQueryWrapper<PickSheet>()
|
| | | .eq(PickSheet::getWaveNo, wave.getWaveNo())
|
| | | .eq(PickSheet::getDeleted, 0)
|
| | | .eq(PickSheet::getStatus, 1));
|
| | | if (!pickSheets.isEmpty()) {
|
| | | throw new CoolException("当前波次有拣货单存在!!");
|
| | | }
|
| | |
|
| | | List<Order> orders = orderService.list(new LambdaQueryWrapper<Order>().eq(Order::getWaveId, wave.getId()));
|
| | | for (Order order : orders) {
|
| | | order.setWaveId(null);
|
| | |
| | | throw new CoolException("订单反写失败");
|
| | | }
|
| | |
|
| | | CacheSite cacheSite = cacheSiteService.getOne(new LambdaQueryWrapper<CacheSite>().eq(CacheSite::getOrderId, order.getId()));
|
| | | if (cacheSite == null) {
|
| | | throw new CoolException("缓存站不存在");
|
| | | }
|
| | | cacheSite.setSiteStatus(CacheSiteStatusType.O.id);
|
| | | cacheSite.setOrderId(null);
|
| | | cacheSite.setOrderNo(null);
|
| | | cacheSite.setUpdateTime(new Date());
|
| | | if (!cacheSiteService.updateById(cacheSite)) {
|
| | | throw new CoolException("缓存站清空失败");
|
| | | }
|
| | | // CacheSite cacheSite = cacheSiteService.getOne(new LambdaQueryWrapper<CacheSite>().eq(CacheSite::getOrderId, order.getId()));
|
| | | // if (cacheSite == null) {
|
| | | // throw new CoolException("缓存站不存在");
|
| | | // }
|
| | | // cacheSite.setSiteStatus(CacheSiteStatusType.O.id);
|
| | | // cacheSite.setOrderId(null);
|
| | | // cacheSite.setOrderNo(null);
|
| | | // cacheSite.setUpdateTime(new Date());
|
| | | // if (!cacheSiteService.updateById(cacheSite)) {
|
| | | // throw new CoolException("缓存站清空失败");
|
| | | // }
|
| | | }
|
| | |
|
| | | waveDetlService.removeById(waveDetl.getId());
|
| | |
| | |
|
| | | List<Map<String,Object>> listSuitableMat( @Param("param") List<FieldParam> param, @Param("sortParam") List<FieldSortParam> sortParam);
|
| | |
|
| | | List<Map<String, Object>> queryFlatStock(@Param("matnr") String matnr, @Param("batch") String batch,@Param("params") List<FieldParam> params);
|
| | | List<Map<String, Object>> queryFlatStock(@Param("matnr") String matnr, @Param("batch") String batch, @Param("params") List<FieldParam> params, @Param("typeId") Long id);
|
| | | }
|
| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
| | | import com.zy.asrs.framework.exception.CoolException;
|
| | | import com.zy.asrs.wms.asrs.entity.*;
|
| | | import com.zy.asrs.wms.asrs.entity.enums.LocAreaTypeSts;
|
| | | import com.zy.asrs.wms.asrs.entity.enums.LocStsType;
|
| | | import com.zy.asrs.wms.asrs.entity.param.FieldParam;
|
| | | import com.zy.asrs.wms.asrs.entity.param.FieldSortParam;
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | public void locDetlFreeze(LocDetlFreezeParam param) {
|
| | | if (param == null) {
|
| | | throw new CoolException("参数不能为空");
|
| | |
| | | @Override
|
| | | public List<LocDetl> queryFlatStock(String matnr, String batch, List<FieldParam> params) {
|
| | | //获取平库中符合条件的库位
|
| | | List<Map<String, Object>> list = viewLocDetlMapper.queryFlatStock(matnr, batch, params);
|
| | | List<Map<String, Object>> list = viewLocDetlMapper.queryFlatStock(matnr, batch, params, LocAreaTypeSts.LOC_AREA_TYPE_FLAT.id);
|
| | | List<LocDetl> detls = new ArrayList<>();
|
| | | list.forEach(action -> {
|
| | | LocDetl parseObject = JSONObject.parseObject(JSON.toJSONString(action), LocDetl.class);
|
| | |
| | |
|
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
| | | import com.baomidou.mybatisplus.extension.service.IService;
|
| | | import com.zy.asrs.framework.common.R;
|
| | | import com.zy.asrs.framework.exception.CoolException;
|
| | | import com.zy.asrs.wms.asrs.entity.*;
|
| | |
| | | import com.zy.asrs.wms.system.entity.Host;
|
| | | import com.zy.asrs.wms.system.service.HostService;
|
| | | import io.netty.util.internal.StringUtil;
|
| | | import org.aspectj.weaver.ast.Or;
|
| | | import org.springframework.beans.BeanUtils;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.stereotype.Service;
|
| | |
| | | private WaveSeedLogService waveSeedLogService;
|
| | | @Autowired
|
| | | private OrderDetlLogService orderDetlLogService;
|
| | |
|
| | | @Autowired
|
| | | private PlatformDetlService platformDetlService;
|
| | | @Autowired
|
| | | private PlatformDetlLogService platformDetlLogService;
|
| | |
|
| | |
|
| | |
|
| | | @Override
|
| | |
| | | .eq(PickSheet::getDeleted, 0)
|
| | | .eq(PickSheet::getStatus, 1)
|
| | | );
|
| | | BeanUtils.copyProperties(pickSheet, pickDetlDto);
|
| | | if (Objects.isNull(pickDetlDto)) {
|
| | | throw new CoolException("对象复制失败!!");
|
| | | if (Objects.isNull(pickSheet)) {
|
| | | throw new CoolException("拣货单不存在!!");
|
| | | }
|
| | | BeanUtils.copyProperties(pickSheet, pickDetlDto);
|
| | |
|
| | | List<PickSheetDetl> sheetDetls = pickSheetDetlService.list(new LambdaQueryWrapper<PickSheetDetl>()
|
| | | .eq(PickSheetDetl::getPickId, pickSheet.getId())
|
| | | .eq(PickSheetDetl::getStatus, 1)
|
| | |
| | | throw new CoolException("数据错误!!");
|
| | | }
|
| | | //更新锁定库存
|
| | | BigDecimal workQty = BigDecimal.valueOf(detl.getAnfme()).subtract(pickDetl.getAnfme());
|
| | | detl.setWorkQty(workQty.doubleValue());
|
| | | // BigDecimal workQty = BigDecimal.valueOf(detl.getAnfme()).subtract(pickDetl.getAnfme());
|
| | | detl.setWorkQty(0.0);
|
| | | //计算结果小于等于零,移出库存明细
|
| | | BigDecimal qty = BigDecimal.valueOf(detl.getAnfme()).subtract(pickDetl.getAnfme());
|
| | | detl.setAnfme(qty.doubleValue());
|
| | |
| | | .set(Loc::getBarcode, null)
|
| | | .set(Loc::getUpdateTime, new Date())
|
| | | .set(Loc::getLocStsId, LocStsType.O.val()));
|
| | | if (update) {
|
| | | if (!update) {
|
| | | throw new CoolException("库存更新失败!! ");
|
| | | }
|
| | | }
|
| | |
| | | if (params.isEmpty()) {
|
| | | throw new CoolException("发货单据明细为空,不可执行发货操作!!");
|
| | | }
|
| | |
|
| | | //获取当前上传所有订单号
|
| | | Set<String> orderNoSet = params.stream().map(ShippingOrderDetlDto::getOrderNo).collect(Collectors.toSet());
|
| | | if (orderNoSet.isEmpty()) {
|
| | | throw new CoolException("主单信息不存在,请核对出库订单!!");
|
| | | }
|
| | |
|
| | | List<Order> orderList = orderService.list(new LambdaQueryWrapper<Order>().in(Order::getOrderNo, orderNoSet));
|
| | | if (orderList.isEmpty()) {
|
| | | throw new CoolException("订单不存在!!");
|
| | | }
|
| | |
|
| | | params.forEach(order -> {
|
| | | OrderDetl byId = orderDetlService.getById(order.getId());
|
| | | if (Objects.isNull(byId)) {
|
| | |
| | | }
|
| | | });
|
| | |
|
| | | //获取当前上传所有订单号
|
| | | Set<String> orderNoSet = params.stream().map(ShippingOrderDetlDto::getOrderNo).collect(Collectors.toSet());
|
| | | if (orderNoSet.isEmpty()) {
|
| | | throw new CoolException("主单信息不存在,请核对出库订单!!");
|
| | | }
|
| | |
|
| | | List<Order> orderList = orderService.list(new LambdaQueryWrapper<Order>().in(Order::getOrderNo, orderNoSet));
|
| | | if (orderList.isEmpty()) {
|
| | | throw new CoolException("订单不存在!!");
|
| | | }
|
| | | orderList.forEach(one -> {
|
| | | OrderLog orderLog = new OrderLog();
|
| | | BeanUtils.copyProperties(one, orderLog);
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | Set<Long> ordersSet = orderList.stream().map(Order::getId).collect(Collectors.toSet());
|
| | | List<PlatformDetl> platDetls = platformDetlService.list(new LambdaQueryWrapper<PlatformDetl>().in(PlatformDetl::getOrderId, ordersSet));
|
| | | if (platDetls.isEmpty()) {
|
| | | throw new CoolException("订单信息未进集货区!!");
|
| | | }
|
| | | ArrayList<PlatformDetlLog> platformDetls = new ArrayList<>();
|
| | | platDetls.forEach(plat -> {
|
| | | PlatformDetlLog detl = new PlatformDetlLog();
|
| | | BeanUtils.copyProperties(plat, detl);
|
| | | detl.setId(null);
|
| | | platformDetls.add(detl);
|
| | | });
|
| | | //集货区转历史档
|
| | | if (!platformDetlLogService.saveBatch(platformDetls)) {
|
| | | throw new CoolException("集货区订单转历史档失败!!");
|
| | | }
|
| | |
|
| | | return R.ok("发货完成!!");
|
| | | }
|
| | |
|
| | |
| | | package com.zy.asrs.wms.asrs.service.impl;
|
| | |
|
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
| | | import com.zy.asrs.framework.common.R;
|
| | | import com.zy.asrs.framework.exception.CoolException;
|
| | | import com.zy.asrs.wms.asrs.entity.*;
|
| | |
| | | import com.zy.asrs.wms.asrs.mapper.PlatformMapper;
|
| | | import com.zy.asrs.wms.asrs.service.*;
|
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
| | | import org.springframework.beans.BeanUtils;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | |
| | | import java.util.ArrayList;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | | import java.util.Objects;
|
| | |
|
| | | @Service("platformService")
|
| | | public class PlatformServiceImpl extends ServiceImpl<PlatformMapper, Platform> implements PlatformService {
|
| | |
| | | private WaveLogService waveLogService;
|
| | | @Autowired
|
| | | private WaveDetlLogService waveDetlLogService;
|
| | | @Autowired
|
| | | private WaveSeedService waveSeedService;
|
| | |
|
| | | @Override
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | public R bindShippingPlatform(BindPlatformParam platform) {
|
| | | return null;
|
| | | if (Objects.isNull(platform.getPlatformId())) {
|
| | | throw new CoolException("集货区标识不能为空!!");
|
| | | }
|
| | | if (Objects.isNull(platform.getOrderId())) {
|
| | | throw new CoolException("订单编码不能为空!!");
|
| | | }
|
| | | if (Objects.isNull(platform.getWaveId())) {
|
| | | throw new CoolException("波次ID不能为空!!");
|
| | | }
|
| | | Platform pl = this.getById(platform.getPlatformId());
|
| | | if (Objects.isNull(pl)) {
|
| | | throw new CoolException("集货区不存在!!");
|
| | | }
|
| | | List<WaveSeed> waveSeeds = waveSeedService.list(new LambdaQueryWrapper<WaveSeed>().eq(WaveSeed::getWaveId, platform.getWaveId()).eq(WaveSeed::getOrderId, platform.getOrderId()));
|
| | | if (waveSeeds.isEmpty()) {
|
| | | throw new CoolException("分拣明细信息不存在,数据错误!!");
|
| | | }
|
| | | ArrayList<PlatformDetl> detls = new ArrayList<>();
|
| | | waveSeeds.forEach(waveSeed -> {
|
| | | PlatformDetl platformDetl = new PlatformDetl();
|
| | | BeanUtils.copyProperties(waveSeed, platformDetl);
|
| | | platformDetl.setPlatformId(pl.getId());
|
| | | platformDetl.setPlatformNo(pl.getPlatformNo());
|
| | |
|
| | | List<PlatformDetl> list = platformDetlService.list(new LambdaQueryWrapper<PlatformDetl>().eq(PlatformDetl::getTaskDetlId, waveSeed.getTaskDetlId()).eq(PlatformDetl::getOrderDetlId, waveSeed.getOrderDetlId()).eq(PlatformDetl::getMatnr, waveSeed.getMatnr()));
|
| | | if (!list.isEmpty()) {
|
| | | throw new CoolException("订单已入集货区!!");
|
| | | }
|
| | | detls.add(platformDetl);
|
| | | });
|
| | |
|
| | | if (!platformDetlService.saveOrUpdateBatch(detls)) {
|
| | | throw new CoolException("集货区明细保存失败!!");
|
| | | }
|
| | |
|
| | | List<CacheSite> list = cacheSiteService.list(new LambdaQueryWrapper<CacheSite>().eq(CacheSite::getOrderId, platform.getOrderId()));
|
| | | if (list.isEmpty()) {
|
| | | throw new CoolException("订单未绑定播种库位,请完成拣货后,再打印订单!!");
|
| | | }
|
| | |
|
| | | boolean update = cacheSiteService.update(new LambdaUpdateWrapper<CacheSite>()
|
| | | .eq(CacheSite::getOrderId, platform.getOrderId())
|
| | | .set(CacheSite::getPlatformId, pl.getId())
|
| | | .set(CacheSite::getPlatformNo, pl.getPlatformNo()));
|
| | |
|
| | | if (!update) {
|
| | | throw new CoolException("播种墙站点绑定集货区失败!!");
|
| | | }
|
| | |
|
| | | return R.ok("绑定成功!!");
|
| | | }
|
| | | }
|
| | |
| | | throw new CoolException("库位类型不存在");
|
| | | }
|
| | | LocType locType = locTypeService.getById(locTypeBind.getTypeId());
|
| | |
|
| | | if(locType == null){
|
| | | throw new CoolException("库位类型不存在");
|
| | | }
|
| | | LocTypeHeightType locTypeHeightType = LocTypeHeightType.get(locType.getFlag());
|
| | |
|
| | | if(locTypeHeightType == null){
|
| | | throw new CoolException("高低库位类型不存在");
|
| | | }
|
| | |
| | | throw new CoolException("任务明细不存在");
|
| | | }
|
| | | TaskDetl taskDetl = taskDetls.get(0);
|
| | |
|
| | | //生成新的库位 !important
|
| | | Loc loc = this.generateLoc(taskType, taskDetl.getMatId(), taskDetl.getBatch(), taskDetl.getUniqueField(), locTypeHeightType.id);
|
| | |
|
| | | // Loc loc = this.generateLoc(taskType, taskDetl.getMatId(), taskDetl.getBatch(), taskDetl.getUniqueField(), locTypeHeightType.id);
|
| | | // if(loc == null) {
|
| | | // throw new CoolException("没有空库位");
|
| | | // }
|
| | | Loc loc = locService.getOne(new LambdaQueryWrapper<Loc>().eq(Loc::getLocNo, task.getOriginLoc()));
|
| | | if(loc == null) {
|
| | | throw new CoolException("没有空库位");
|
| | | }
|
| | | //102拣料此处需修改为WCS_CONTAINER_RECEIVE,定时任务查询后,自动下发入库任务至ESS
|
| | | task.setTaskSts(TaskStsType.WCS_CONTAINER_RECEIVE.id);//1.生成入库任务
|
| | | task.setTaskType(taskType);
|
| | | task.setTargetLoc(loc.getLocNo());
|
| | | //原库位变目标库位, 原站点变目标站点
|
| | | //todo 需确认原站点为空,该怎么处理
|
| | | task.setTargetLoc(task.getOriginLoc());
|
| | | task.setUpdateTime(new Date());
|
| | | if (!taskService.updateById(task)) {
|
| | | throw new CoolException("拣料失败");
|
| | | }
|
| | |
|
| | | //库位O => S
|
| | | //库位状态改为预约入库 R => S
|
| | | loc.setLocStsId(LocStsType.S.val());
|
| | | loc.setUpdateTime(new Date());
|
| | | boolean locUpdate = locService.updateById(loc);
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | public boolean locAdjust(LocAdjustParam param) {
|
| | | if (param == null) {
|
| | | throw new CoolException("参数不能为空");
|
| | |
| | |
|
| | | if (taskDetls.isEmpty()) {
|
| | | throw new CoolException("任务明细不存在");
|
| | | } else { //TODO 先更新订单,后删除任务明细。任务为53时,需更新明细。
|
| | | } else {
|
| | | //任务类型为53,根据WaveId修改订单明细
|
| | | for (TaskDetl taskDetl : taskDetls) {
|
| | | if (taskDetl.getDetlId() == null) {
|
| | |
| | | taskLog.setId(null);
|
| | | if (!taskLogService.save(taskLog)) {
|
| | | throw new CoolException("保存任务历史档失败");
|
| | | } else { //fixme 历史任务档保存后,修改订单状态信息后,再删除任务档
|
| | | } else {
|
| | | //更新订单信息
|
| | | taskDetls.forEach(taskDetl -> {
|
| | | if (taskDetl.getDetlId() != null) {
|
| | |
| | | import com.zy.asrs.wms.asrs.entity.enums.LocStsType;
|
| | | import com.zy.asrs.wms.asrs.entity.enums.TaskStsType;
|
| | | import com.zy.asrs.wms.asrs.service.*;
|
| | | import io.jsonwebtoken.lang.Collections;
|
| | | import lombok.extern.slf4j.Slf4j;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.scheduling.annotation.Scheduled;
|
| | |
| | | import org.springframework.transaction.annotation.Transactional;
|
| | | import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
| | |
|
| | | import java.util.Collection;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | | import java.util.stream.Collectors;
|
| | |
|
| | | @Slf4j
|
| | | @Component
|
| | |
| | |
|
| | |
|
| | | /**
|
| | | * // fixme 舍弃
|
| | | * 1. 定时拉取需要执行回库任务列表数据,
|
| | | * 2. 删除原始库位明细,原始库位状态置成O.空库
|
| | | * 3.
|
| | | */
|
| | | @Scheduled(cron = "0/3 * * * * ? ")
|
| | | // @Scheduled(cron = "0/3 * * * * ? ")
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | public void rollbackStock() {
|
| | | //获取需要执行回库的任务,更新库存信息
|
| | |
| | | //拣料再入库
|
| | | private void executeTask53(Task task) {
|
| | | Long hostId = task.getHostId();
|
| | | //fixme 将任务当前
|
| | | Loc loc = locService.getOne(new LambdaQueryWrapper<Loc>().eq(Loc::getLocNo, task.getTargetLoc()).eq(Loc::getHostId, hostId));
|
| | | if (loc == null) {
|
| | | throw new CoolException("库位不存在");
|
| | |
| | | throw new CoolException("任务明细不存在");
|
| | | }
|
| | |
|
| | | //添加库存明细
|
| | | //修改库存明细
|
| | | for (TaskDetl taskDetl : taskDetls) {
|
| | | double anfme = taskDetl.getStock() - taskDetl.getAnfme();
|
| | | if (anfme <= 0) {
|
| | | continue;
|
| | | LocDetl locdetl = locDetlService.getOne(new LambdaQueryWrapper<LocDetl>()
|
| | | .eq(LocDetl::getLocId, loc.getId())
|
| | | .eq(LocDetl::getBatch, taskDetl.getBatch())
|
| | | .eq(LocDetl::getMatId, taskDetl.getMatId()));
|
| | |
|
| | | List<LocDetlField> detlFields = locDetlFieldService.list(new LambdaQueryWrapper<LocDetlField>().eq(LocDetlField::getDetlId, locdetl.getId()).eq(LocDetlField::getHostId, hostId));
|
| | | if (!detlFields.isEmpty()) {
|
| | | if (!locDetlFieldService.removeBatchByIds(detlFields)) {
|
| | | throw new CoolException("删除明细扩展字段失败");
|
| | | }
|
| | | }
|
| | |
|
| | | LocDetl locDetl = new LocDetl();
|
| | | locDetl.setLocId(loc.getId());
|
| | | locDetl.setLocNo(loc.getLocNo());
|
| | | locDetl.setMatId(taskDetl.getMatId());
|
| | | locDetl.setMatnr(taskDetl.getMat$().getMatnr());
|
| | | locDetl.setOrderNo(taskDetl.getOrderNo());
|
| | | locDetl.setBatch(taskDetl.getBatch());
|
| | | locDetl.setAnfme(anfme);
|
| | | locDetl.setHostId(hostId);
|
| | | if (!locDetlService.save(locDetl)) {
|
| | | throw new CoolException("插入库存明细失败");
|
| | | if (!locDetlService.removeById(locdetl)) {
|
| | | throw new CoolException("库存明细删除失败!!");
|
| | | }
|
| | | } else {
|
| | | LocDetl locdetl = locDetlService.getOne(new LambdaQueryWrapper<LocDetl>()
|
| | | .eq(LocDetl::getLocId, loc.getId())
|
| | | .eq(LocDetl::getBatch, taskDetl.getBatch())
|
| | | .eq(LocDetl::getMatId, taskDetl.getMatId()));
|
| | | locdetl.setWorkQty(0.0);
|
| | | locdetl.setAnfme(anfme);
|
| | |
|
| | | //添加库存明细扩展字段
|
| | | List<TaskDetlField> detlFields = taskDetlFieldService.list(new LambdaQueryWrapper<TaskDetlField>().eq(TaskDetlField::getDetlId, taskDetl.getId()).eq(TaskDetlField::getHostId, hostId));
|
| | | for (TaskDetlField detlField : detlFields) {
|
| | | LocDetlField locDetlField = new LocDetlField();
|
| | | locDetlField.setDetlId(locDetl.getId());
|
| | | locDetlField.setFieldId(detlField.getFieldId());
|
| | | locDetlField.setName(detlField.getName());
|
| | | locDetlField.setValue(detlField.getValue());
|
| | | locDetlField.setHostId(hostId);
|
| | | if (!locDetlFieldService.save(locDetlField)) {
|
| | | throw new CoolException("插入明细扩展字段失败");
|
| | | if (!locDetlService.updateById(locdetl)) {
|
| | | throw new CoolException("库存明细更新失败!!");
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * 将原有库存明细删除
|
| | | * 库存状态设置为空库状态
|
| | | * @param task
|
| | | */
|
| | | //拣料出库
|
| | | private void executeTask103(Task task) {
|
| | | Long hostId = task.getHostId();
|
| | |
| | | if (loc == null) {
|
| | | throw new CoolException("库位不存在");
|
| | | }
|
| | | if (loc.getLocStsId() != LocStsType.R.val()) {
|
| | | if (loc.getLocStsId() != LocStsType.S.val()) {
|
| | | throw new CoolException("库位状态不处于R.出库预约");
|
| | | }
|
| | | List<TaskDetl> taskDetls = taskDetlService.getTaskDetlByTaskId(task.getId());
|
| | |
| | | SELECT
|
| | | mt.task_no,
|
| | | mt.barcode,
|
| | | mt.task_type,
|
| | | mtt.title,
|
| | | mt.update_time,
|
| | | mtd.wave_no,
|
| | | SUM( mtd.anfme ) anfme,
|
| | | mt.id,
|
| | |
| | | FROM
|
| | | man_task mt
|
| | | INNER JOIN man_task_detl mtd ON mt.id = mtd.task_id
|
| | | INNER JOIN man_task_type mtt ON mt.task_type = mtt.id
|
| | | GROUP BY
|
| | | mt.task_no,
|
| | | mtd.wave_no
|
| | |
| | | view_man_loc_detl
|
| | | WHERE
|
| | | deleted = 0
|
| | | AND type_id IN ( SELECT type_id FROM man_loc_area_type WHERE parent_id = 7 OR id = 7 )
|
| | | AND type_id IN ( SELECT type_id FROM man_loc_area_type WHERE parent_id = #{typeId} OR id = #{typeId} )
|
| | | ) t
|
| | | WHERE 1 = 1
|
| | | <if test="matnr != null and matnr != ''">
|