| | |
| | | import com.vincent.rsf.framework.exception.CoolException; |
| | | import com.vincent.rsf.server.api.controller.params.*; |
| | | import com.vincent.rsf.server.api.entity.dto.*; |
| | | import com.vincent.rsf.server.api.entity.enums.OrderType; |
| | | import com.vincent.rsf.server.api.entity.enums.OrderWorkType; |
| | | import com.vincent.rsf.server.manager.enums.OrderType; |
| | | import com.vincent.rsf.server.manager.enums.OrderWorkType; |
| | | import com.vincent.rsf.server.api.service.MobileService; |
| | | import com.vincent.rsf.server.common.config.ConfigProperties; |
| | | import com.vincent.rsf.server.common.enums.WarehouseAreaType; |
| | | import com.vincent.rsf.server.common.security.JwtSubject; |
| | | import com.vincent.rsf.server.common.utils.CommonUtil; |
| | | import com.vincent.rsf.server.common.utils.FieldsUtils; |
| | | import com.vincent.rsf.server.common.utils.JwtUtil; |
| | | import com.vincent.rsf.server.manager.controller.params.GenerateTaskParams; |
| | |
| | | import com.vincent.rsf.server.manager.entity.*; |
| | | import com.vincent.rsf.server.manager.enums.AsnExceStatus; |
| | | import com.vincent.rsf.server.manager.enums.PakinIOStatus; |
| | | import com.vincent.rsf.server.manager.enums.QlyIsptResult; |
| | | import com.vincent.rsf.server.manager.enums.QlyIsptStatus; |
| | | import com.vincent.rsf.server.manager.mapper.*; |
| | | import com.vincent.rsf.server.manager.service.*; |
| | |
| | | import com.vincent.rsf.server.system.service.UserLoginService; |
| | | import com.vincent.rsf.server.system.service.UserService; |
| | | import com.vincent.rsf.server.system.utils.SerialRuleUtils; |
| | | import org.apache.commons.codec.digest.Md5Crypt; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.math.BigDecimal; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | //库存单位为最小单位 |
| | | .setUnit(orderItem.getStockUnit()) |
| | | .setStockUnit(orderItem.getStockUnit()) |
| | | .setBatch(StringUtils.isBlank(orderItem.getBatch()) ? SerialRuleUtils.generateRuleCode(SerialRuleCode.SYS_RECEIPT_BATCH, dto) : orderItem.getBatch()) |
| | | // .setBatch(StringUtils.isBlank(orderItem.getBatch()) ? SerialRuleUtils.generateRuleCode(SerialRuleCode.SYS_RECEIPT_BATCH, dto) : orderItem.getBatch()) |
| | | .setAnfme(dto.getReceiptQty()) |
| | | .setSplrBatch(dto.getSplrBatch()) |
| | | .setMatnrCode(matnr.getCode()) |
| | |
| | | .setShipperId(matnr.getShipperId()); |
| | | //TODO 供应商标识未设置,标识由PO单供应商编码转换 |
| | | WarehouseAreasItem serviceOne = warehouseAreasItemService.getOne(new LambdaQueryWrapper<WarehouseAreasItem>() |
| | | .eq(WarehouseAreasItem::getAsnItemId, item.getAsnItemId()) |
| | | .eq(WarehouseAreasItem::getTrackCode, item.getTrackCode()) |
| | | // .eq(WarehouseAreasItem::getAsnItemId, item.getAsnItemId()) |
| | | .eq(WarehouseAreasItem::getMatnrCode, item.getMatnrCode()) |
| | | .eq(WarehouseAreasItem::getFieldsIndex, item.getFieldsIndex()) |
| | | .eq(StringUtils.isNotBlank(item.getSplrBatch()), WarehouseAreasItem::getSplrBatch, item.getSplrBatch())); |
| | | if (!Objects.isNull(serviceOne)) { |
| | | item.setId(serviceOne.getId()); |
| | | item.setAnfme(item.getAnfme() + serviceOne.getAnfme()); |
| | | } |
| | | |
| | |
| | | */ |
| | | @Override |
| | | public R getReceiptAreas() { |
| | | List<WarehouseAreas> areas = warehouseAreasService.list(new LambdaQueryWrapper<WarehouseAreas>().eq(WarehouseAreas::getType, WarehouseAreaType.WAREHOUSE_AREA_RECEIPT.type)); |
| | | List<WarehouseAreas> areas = warehouseAreasService.list(new LambdaQueryWrapper<WarehouseAreas>() |
| | | .eq(WarehouseAreas::getType, WarehouseAreaType.WAREHOUSE_AREA_RECEIPT.type)); |
| | | return R.ok(areas); |
| | | } |
| | | |
| | |
| | | public R getDeltByCode(Map<String, Object> params) { |
| | | Object code = params.get("code"); |
| | | Object matnrCode = params.get("matnrCode"); |
| | | String batch = null; |
| | | if (!Objects.isNull(params.get("batch"))) { |
| | | batch = params.get("batch").toString(); |
| | | } |
| | | Object asnCode = params.get("asnCode"); |
| | | Object batch = params.get("batch"); |
| | | |
| | | //TODO 后续需根据策略配置,获取组拖数据。如:混装,按批次混装等 |
| | | LambdaQueryWrapper<WarehouseAreasItem> queryWrapper = new QueryWrapper<WarehouseAreasItem>() |
| | | .select("SUM(anfme) as anfme, track_code, asn_code, id, splr_batch, ispt_result, plat_item_id, batch,unit, stock_unit, qty, work_qty, matnr_code, matnr_id, maktx").lambda() |
| | | .eq(!Objects.isNull(code), WarehouseAreasItem::getTrackCode, code) |
| | | .eq(StringUtils.isNotBlank(batch), WarehouseAreasItem::getSplrBatch, batch) |
| | | .eq(!Objects.isNull(matnrCode), WarehouseAreasItem::getMatnrCode, matnrCode) |
| | | .groupBy(WarehouseAreasItem::getSplrBatch, WarehouseAreasItem::getAsnId, WarehouseAreasItem::getAreaId, WarehouseAreasItem::getMatnrId); |
| | | return R.ok(warehouseAreasItemService.list(queryWrapper)); |
| | | LambdaQueryWrapper<WarehouseAreasItem> queryWrapper = new LambdaQueryWrapper<WarehouseAreasItem>() |
| | | .eq(!Cools.isEmpty(code), WarehouseAreasItem::getTrackCode, code) |
| | | .eq(!Cools.isEmpty(batch), WarehouseAreasItem::getSplrBatch, batch) |
| | | .eq(!Cools.isEmpty(matnrCode), WarehouseAreasItem::getMatnrCode, matnrCode) |
| | | .eq(!Cools.isEmpty(asnCode), WarehouseAreasItem::getAsnCode, asnCode); |
| | | List<WarehouseAreasItem> list = warehouseAreasItemService.list(queryWrapper); |
| | | list.removeIf(e -> e.getAnfme() <= e.getWorkQty()); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | /** |
| | |
| | | @Override |
| | | public WaitPakin mergeItems(WaitPakinParam waitPakin, Long userId) { |
| | | return waitPakinService.mergeItems(waitPakin, userId); |
| | | } |
| | | |
| | | @Override |
| | | public WaitPakin mergeMatnrItems(WaitPakinParam waitPakin, Long userId) { |
| | | return waitPakinService.mergeMatnrItems(waitPakin, userId); |
| | | } |
| | | |
| | | /** |
| | |
| | | stock.setAnfme(sum) |
| | | .setSourceId(order.getId()) |
| | | .setType(order.getType()) |
| | | .setUpdateBy(loginUserId) |
| | | .setCreateBy(loginUserId) |
| | | .setWkType(Short.parseShort(order.getWkType())); |
| | | if (!stockService.save(stock)) { |
| | | throw new CoolException("库存保存失败!!"); |
| | |
| | | .setId(null) |
| | | .setLocCode(loc.getCode()) |
| | | .setOrderId(order.getId()) |
| | | .setUpdateBy(loginUserId) |
| | | .setUpdateBy(loginUserId) |
| | | .setOrderItemId(asnOrderItem.getId()) |
| | | .setWkType(Short.parseShort(order.getWkType())) |
| | | .setType(order.getType()); |
| | |
| | | */ |
| | | @Override |
| | | public R getItemByContainer(Map<String, Object> params) { |
| | | if (Objects.isNull(params.get("code"))) { |
| | | throw new CoolException("参数不能为空!!"); |
| | | } |
| | | // if (Objects.isNull(params.get("code"))) { |
| | | // throw new CoolException("参数不能为空!!"); |
| | | // } |
| | | //获取组拖未生成任务的组拖档 |
| | | List<Short> asList = Arrays.asList(Short.valueOf(PakinIOStatus.PAKIN_IO_STATUS_DONE.val), Short.valueOf(PakinIOStatus.PAKIN_IO_STATUS_DONE.val)); |
| | | Short flagDefect = 0; |
| | |
| | | .setSplrBatch(asnOrderItem.getSplrBatch()) |
| | | .setMatnr(asnOrderItem.getMatnrCode()) |
| | | .setInspect(asnOrderItem.getIsptResult$()) //质检结果 |
| | | .setPlatItemId(asnOrderItem.getPlatItemId()) |
| | | ; |
| | | |
| | | Matnr matnr = matnrMapper.selectById(asnOrderItem.getMatnrId()); |