| | |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.vincent.rsf.framework.common.R; |
| | | import com.vincent.rsf.framework.exception.CoolException; |
| | | import com.vincent.rsf.server.common.constant.Constants; |
| | | import com.vincent.rsf.server.manager.enums.*; |
| | | import com.vincent.rsf.server.manager.entity.*; |
| | | import com.vincent.rsf.server.manager.mapper.WaveMapper; |
| | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R publicTask(Map<String, Object> map, Long loginUserId) { |
| | | List<WaveItem> itemParams = (List<WaveItem>) map.get("waveItem"); |
| | | List<WaveItem> itemParams = JSONArray.parseArray(JSON.toJSONString(map.get("waveItem")), WaveItem.class); |
| | | if (Objects.isNull(itemParams) || itemParams.isEmpty()) { |
| | | throw new CoolException("参数不能为空!!"); |
| | | } |
| | |
| | | if (items.isEmpty()) { |
| | | throw new CoolException("波次明细不存在!!"); |
| | | } |
| | | |
| | | if (!waveItemService.update(new LambdaUpdateWrapper<WaveItem>() |
| | | .set(WaveItem::getExceStatus, WaveItemExceStatus.WAVE_EXCE_STATUS_ING.val) |
| | | .in(WaveItem::getId, waveItems))) { |
| | | throw new CoolException("下发执行异常,请稍候重试!"); |
| | | } |
| | | |
| | | /**生成出库任务*/ |
| | | try { |
| | | generateOutTask(items, loginUserId, waves); |
| | |
| | | log.error("UNK", e); |
| | | throw new CoolException(e.getMessage()); |
| | | } |
| | | return null; |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | |
| | | .setResource(TaskResouceType.TASK_RESOUCE_WAVE_TYPE.val) |
| | | .setBarcode(loc.getBarcode()) |
| | | .setOrgLoc(loc.getCode()) |
| | | .setSort(Constants.TASK_SORT_DEFAULT_VALUE) |
| | | .setCreateBy(loginUserId) |
| | | .setUpdateBy(loginUserId) |
| | | .setTargSite(wave.getTargSite()); |