Merge remote-tracking branch 'origin/develop' into develop
This commit is contained in:
commit
25b4263017
|
|
@ -1651,6 +1651,7 @@ public class NormalPGIController extends BaseController {
|
|||
// 首先判断当前包是否已经收货了
|
||||
WmsPackage pacageScanVO = wmsPackageService.lambdaQuery().eq(WmsPackage::getPackageCode, request.getPackageCode())
|
||||
.one();
|
||||
VUtil.trueThrowBusinessError(CollectionUtil.isEmpty(request.getItems())).throwMessage("没有收货的物料信息");
|
||||
VUtil.trueThrowBusinessError(ObjectUtil.isNull(pacageScanVO)).throwMessage("打包码不存在");
|
||||
VUtil.trueThrowBusinessError(pacageScanVO.getPackageStatus() == 0).throwMessage("此打包码尚未打包");
|
||||
VUtil.trueThrowBusinessError(pacageScanVO.getPackageStatus() == 2).throwMessage("此打包码已完成收货");
|
||||
|
|
|
|||
|
|
@ -442,7 +442,7 @@ public class NormalQMController extends BaseController {
|
|||
zwm3A18DTO.getItem1().add(item1DTO);
|
||||
} else {
|
||||
item1DTO.setErfmg1(item1DTO.getErfmg1().add(code.getQualifiedQty()));
|
||||
item1DTO.setErfmg2(item1DTO.getErfmg2().add(code.getUnqualifiedQty()));
|
||||
item1DTO.setErfmg2(BigDecimal.ZERO);
|
||||
}
|
||||
if (StrUtil.isNotBlank(code.getSerialNum())) {
|
||||
String flag = code.getInspectionResult().equals("合格") ? "X" : "";
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import cn.hutool.core.date.DateUtil;
|
|||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.nflg.wms.admin.pojo.dto.PdfPageDTO;
|
||||
import com.nflg.wms.admin.pojo.request.UpdateItemNumRequest;
|
||||
import com.nflg.wms.admin.repository.InventoryForOutRepository;
|
||||
import com.nflg.wms.admin.repository.OutMaterialScanRecordRespository;
|
||||
import com.nflg.wms.admin.service.BasdeSerialNumberControllerService;
|
||||
|
|
@ -168,6 +169,22 @@ public class OutAssistanceController extends BaseController {
|
|||
return ApiResult.success(vo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改订单项数量
|
||||
*/
|
||||
@PostMapping("updateItemNum")
|
||||
public ApiResult<Void> updateItemNum(@Valid @RequestBody UpdateItemNumRequest request) {
|
||||
WmsOutAssistanceItem item = outAssistanceItemService.getById(request.getId());
|
||||
VUtil.trueThrowBusinessError(Objects.isNull(item)).throwMessage("订单项不存在");
|
||||
BigDecimal min = item.getNum().subtract(item.getLeft());
|
||||
VUtil.trueThrowBusinessError(request.getNum().compareTo(min) < 0).throwMessage("数量不能小于" + min);
|
||||
BigDecimal difference = request.getNum().subtract(item.getNum());
|
||||
item.setLeft(item.getLeft().add(difference));
|
||||
item.setNum(request.getNum());
|
||||
outAssistanceItemService.updateById(item);
|
||||
return ApiResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取订单项(PDA使用)
|
||||
*/
|
||||
|
|
@ -433,7 +450,7 @@ public class OutAssistanceController extends BaseController {
|
|||
);
|
||||
Map<String, List<OutMaterialScanRecord>> dmaps = records.stream().collect(Collectors.groupingBy(OutMaterialScanRecord::getKey7));
|
||||
OptRecordDTO optRecordDTO = new OptRecordDTO();
|
||||
optRecordDTO.setOperationType((short)1);
|
||||
optRecordDTO.setOperationType((short) 1);
|
||||
optRecordDTO.setOrderId(order.getNo());
|
||||
optRecordService.add(optRecordDTO);
|
||||
SubcontractedOrderConfirmDTO dto = sapService.zwm3a04(new SubcontractedOrderConfirmQO()
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import cn.hutool.core.date.DateUtil;
|
|||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.nflg.wms.admin.pojo.dto.PdfPageDTO;
|
||||
import com.nflg.wms.admin.pojo.request.UpdateItemNumRequest;
|
||||
import com.nflg.wms.admin.repository.InventoryForOutRepository;
|
||||
import com.nflg.wms.admin.repository.OutMaterialScanRecordRespository;
|
||||
import com.nflg.wms.admin.service.BasdeSerialNumberControllerService;
|
||||
|
|
@ -171,6 +172,22 @@ public class OutCostCenterController extends BaseController {
|
|||
return ApiResult.success(vo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改订单项数量
|
||||
*/
|
||||
@PostMapping("updateItemNum")
|
||||
public ApiResult<Void> updateItemNum(@Valid @RequestBody UpdateItemNumRequest request) {
|
||||
WmsOutCostcenterItem item = outCostcenterItemService.getById(request.getId());
|
||||
VUtil.trueThrowBusinessError(Objects.isNull(item)).throwMessage("订单项不存在");
|
||||
BigDecimal min = item.getNum().subtract(item.getLeft());
|
||||
VUtil.trueThrowBusinessError(request.getNum().compareTo(min) < 0).throwMessage("数量不能小于" + min);
|
||||
BigDecimal difference = request.getNum().subtract(item.getNum());
|
||||
item.setLeft(item.getLeft().add(difference));
|
||||
item.setNum(request.getNum());
|
||||
outCostcenterItemService.updateById(item);
|
||||
return ApiResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取订单项(PDA使用)
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import cn.hutool.core.date.DateUtil;
|
|||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.nflg.wms.admin.pojo.dto.PdfPageDTO;
|
||||
import com.nflg.wms.admin.pojo.request.UpdateItemNumRequest;
|
||||
import com.nflg.wms.admin.repository.InventoryForOutRepository;
|
||||
import com.nflg.wms.admin.repository.OutMaterialScanRecordRespository;
|
||||
import com.nflg.wms.admin.service.BasdeSerialNumberControllerService;
|
||||
|
|
@ -267,23 +268,25 @@ public class OutProduceController extends BaseController {
|
|||
return ApiResult.success(outProduceService.search(request));
|
||||
}
|
||||
|
||||
/**
|
||||
* 解锁库存(根据订单)
|
||||
*/
|
||||
@PostMapping("0/releaseNumByOrder")
|
||||
public ApiResult<Void> releaseNumByOrder(@Valid @RequestBody @NotEmpty List<Long> ids) {
|
||||
outProduceService.releaseNum(ids);
|
||||
return ApiResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 解锁库存(根据明细)
|
||||
*/
|
||||
@PostMapping("0/releaseNumByItem")
|
||||
public ApiResult<Void> releaseNumByItem(@Valid @RequestBody @NotEmpty List<Long> ids) {
|
||||
outProduceItemService.releaseNum(ids);
|
||||
return ApiResult.success();
|
||||
}
|
||||
// /**
|
||||
// * 解锁库存(根据订单)
|
||||
// * @deprecated 不需要这个方法了
|
||||
// */
|
||||
// @PostMapping("0/releaseNumByOrder")
|
||||
// public ApiResult<Void> releaseNumByOrder(@Valid @RequestBody @NotEmpty List<Long> ids) {
|
||||
// outProduceService.releaseNum(ids);
|
||||
// return ApiResult.success();
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 解锁库存(根据明细)
|
||||
// * @deprecated 不需要这个方法了
|
||||
// */
|
||||
// @PostMapping("0/releaseNumByItem")
|
||||
// public ApiResult<Void> releaseNumByItem(@Valid @RequestBody @NotEmpty List<Long> ids) {
|
||||
// outProduceItemService.releaseNum(ids);
|
||||
// return ApiResult.success();
|
||||
// }
|
||||
|
||||
/**
|
||||
* 修改备注
|
||||
|
|
@ -321,6 +324,21 @@ public class OutProduceController extends BaseController {
|
|||
return ApiResult.success(vo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改订单项数量
|
||||
*/
|
||||
@PostMapping("updateItemNum")
|
||||
public ApiResult<Void> updateItemNum(@Valid @RequestBody UpdateItemNumRequest request) {
|
||||
WmsOutProduceItem item = outProduceItemService.getById(request.getId());
|
||||
VUtil.trueThrowBusinessError(Objects.isNull(item)).throwMessage("订单项不存在");
|
||||
VUtil.trueThrowBusinessError(request.getNum().compareTo(item.getNum()) < 0).throwMessage("数量不能小于" + item.getNum());
|
||||
BigDecimal difference = request.getNum().subtract(item.getSqsl());
|
||||
item.setLockNum(item.getLockNum().add(difference));
|
||||
item.setSqsl(request.getNum());
|
||||
outProduceItemService.updateById(item);
|
||||
return ApiResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取订单项(PDA使用)
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -109,6 +109,7 @@ public class OutPurchaseController extends BaseController {
|
|||
.gt(WmsReturnRequestItem::getLeft, 0)
|
||||
.list();
|
||||
VUtil.trueThrowBusinessError(CollectionUtil.isEmpty(items)).throwMessage("所有物料均已完成");
|
||||
order.setPoNum(items.get(0).getPoNumberNew());
|
||||
ZWM3A05VO vo = new ZWM3A05VO()
|
||||
.setPurchaseOrderId(order.getId())
|
||||
.setLifnr(order.getSupplierCode())
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import cn.hutool.core.util.ObjectUtil;
|
|||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.nflg.wms.admin.pojo.dto.PdfPageDTO;
|
||||
import com.nflg.wms.admin.pojo.request.UpdateItemNumRequest;
|
||||
import com.nflg.wms.admin.service.BasdeSerialNumberControllerService;
|
||||
import com.nflg.wms.admin.service.SapService;
|
||||
import com.nflg.wms.admin.util.PdfGeneratorUtil;
|
||||
|
|
@ -76,6 +77,7 @@ public class PurchaseReturnController extends BaseController {
|
|||
|
||||
/**
|
||||
* 获取送货单的入库信息
|
||||
*
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -93,6 +95,7 @@ public class PurchaseReturnController extends BaseController {
|
|||
|
||||
/**
|
||||
* 获取退货申请单详情
|
||||
*
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -107,8 +110,25 @@ public class PurchaseReturnController extends BaseController {
|
|||
return ApiResult.success(vos);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改订单项数量
|
||||
*/
|
||||
@PostMapping("updateItemNum")
|
||||
public ApiResult<Void> updateItemNum(@Valid @RequestBody UpdateItemNumRequest request) {
|
||||
WmsReturnRequestItem item = returnRequestItemService.getById(request.getId());
|
||||
VUtil.trueThrowBusinessError(Objects.isNull(item)).throwMessage("订单项不存在");
|
||||
BigDecimal min = item.getRequestQuantity().subtract(item.getLeft());
|
||||
VUtil.trueThrowBusinessError(request.getNum().compareTo(min) < 0).throwMessage("数量不能小于" + min);
|
||||
BigDecimal difference = request.getNum().subtract(item.getRequestQuantity());
|
||||
item.setLeft(item.getLeft().add(difference));
|
||||
item.setRequestQuantity(request.getNum());
|
||||
returnRequestItemService.updateById(item);
|
||||
return ApiResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取送货单的入库信息
|
||||
*
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -121,6 +141,7 @@ public class PurchaseReturnController extends BaseController {
|
|||
|
||||
/**
|
||||
* 新增退货申请单
|
||||
*
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -140,6 +161,7 @@ public class PurchaseReturnController extends BaseController {
|
|||
|
||||
/**
|
||||
* 删除申请单
|
||||
*
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -160,6 +182,7 @@ public class PurchaseReturnController extends BaseController {
|
|||
|
||||
/**
|
||||
* 审核申请单
|
||||
*
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -193,7 +216,7 @@ public class PurchaseReturnController extends BaseController {
|
|||
VUtil.trueThrowBusinessError(CollectionUtil.isEmpty(returnRequestItems))
|
||||
.throwMessage("没有有效的数据");
|
||||
if (request.getApprovalStatus().equals(1)) {
|
||||
if (request.getDocumentType().equals(1)) { //25
|
||||
if (request.getDocumentType().equals(1)) { //25 仅退货
|
||||
ZWM3A25HeadDTO headDTO25 = new ZWM3A25HeadDTO();
|
||||
List<ZWM3A25ItemDTO> itemDTOList25 = new ArrayList<>();
|
||||
headDTO25.setReturnType("2");
|
||||
|
|
@ -212,7 +235,18 @@ public class PurchaseReturnController extends BaseController {
|
|||
}
|
||||
ZWM3A25ReturnDTO zwm3a25ReturnDTO = sapService.ZWM3A25(headDTO25, itemDTOList25);
|
||||
log.info(" zwm3a25ReturnDTO: " + JSONUtil.toJsonStr(zwm3a25ReturnDTO));
|
||||
} else if (request.getDocumentType().equals(2)) { //24
|
||||
zwm3a25ReturnDTO.getItemReturnDTOList().forEach(item -> {
|
||||
String materialNo = item.getMatnr().replace("00000000","");
|
||||
WmsReturnRequestItem dbItem = returnRequestItems.stream()
|
||||
.filter(it -> StrUtil.equals(it.getMaterialCode(), materialNo)
|
||||
)
|
||||
.findFirst()
|
||||
.get();
|
||||
dbItem.setPoLineNumberNew(item.getEbelp());
|
||||
dbItem.setPoNumberNew(item.getEbeln());
|
||||
});
|
||||
returnRequestItemService.updateBatchById(returnRequestItems);
|
||||
} else if (request.getDocumentType().equals(2)) { //24 退换货
|
||||
ZWM3A24HeadDTO headDTO24 = new ZWM3A24HeadDTO();
|
||||
List<ZWM3A24ItemDTO> itemDTOList24 = new ArrayList<>();
|
||||
headDTO24.setReturnType("1");
|
||||
|
|
@ -230,22 +264,24 @@ public class PurchaseReturnController extends BaseController {
|
|||
}
|
||||
ZWM3A24ReturnDTO retrunDto24 = sapService.ZWM3A24(headDTO24, itemDTOList24);
|
||||
log.info(" zwm3a24ReturnDTO: " + JSONUtil.toJsonStr(retrunDto24));
|
||||
retrunDto24.getItemReturnDTOList().forEach(item -> {
|
||||
WmsReturnRequestItem dbItem=returnRequestItems.stream()
|
||||
.filter(it -> StrUtil.equals(it.getMaterialCode(), item.getMatnr())
|
||||
&& Objects.equals(Integer.parseInt(it.getPoLineNumber()), item.getEbelp_old())
|
||||
)
|
||||
.findFirst()
|
||||
.get();
|
||||
dbItem.setPoLineNumberNew(item.getEbelp_new());
|
||||
});
|
||||
returnRequestItemService.updateBatchById(returnRequestItems);
|
||||
for (ZWM3A24ItemReturnDTO item : retrunDto24.getItemReturnDTOList()) {
|
||||
if (Objects.equals(item.getRetpo(), "X")) {
|
||||
String materialNo = item.getMatnr().replace("00000000","");
|
||||
WmsReturnRequestItem dbItem = returnRequestItems.stream()
|
||||
.filter(it -> it.getMaterialCode().equals(materialNo))
|
||||
.findFirst().orElse( null);
|
||||
dbItem.setPoLineNumberNew(item.getEbelp());
|
||||
dbItem.setPoNumberNew(item.getEbeln());
|
||||
returnRequestItemService.updateBatchById(returnRequestItems);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
//修改状态
|
||||
returnRequestService.lambdaUpdate()
|
||||
.set(WmsReturnRequest::getApprovalStatus, request.getApprovalStatus())
|
||||
.set(WmsReturnRequest::getDocumentType,request.getDocumentType())
|
||||
.set(WmsReturnRequest::getDocumentType, request.getDocumentType())
|
||||
.set(WmsReturnRequest::getApproveTime, LocalDateTime.now())
|
||||
.set(WmsReturnRequest::getApproverId, UserUtil.getUserId())
|
||||
.set(WmsReturnRequest::getApproverName, UserUtil.getUserName())
|
||||
|
|
@ -256,6 +292,7 @@ public class PurchaseReturnController extends BaseController {
|
|||
|
||||
/**
|
||||
* 码验证
|
||||
*
|
||||
* @param qrCodeMaster
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -301,6 +338,7 @@ public class PurchaseReturnController extends BaseController {
|
|||
|
||||
/**
|
||||
* 保存申请单
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private List<InventoryLockVO> SaveApply(List<PurchaseReturnDTO> purchaseReturnDTOList, Short dataSource) {
|
||||
|
|
@ -357,6 +395,7 @@ public class PurchaseReturnController extends BaseController {
|
|||
|
||||
/**
|
||||
* 申请退货(PDA)
|
||||
*
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -455,17 +494,17 @@ public class PurchaseReturnController extends BaseController {
|
|||
if (CollectionUtil.isEmpty(inventoryLockVOS)) {
|
||||
return ApiResult.success();
|
||||
} else {
|
||||
throw new DataAlertException(STATE.OutOfStock, inventoryLockVOS);
|
||||
return ApiResult.errorWithExtras(STATE.OutOfStock, inventoryLockVOS);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 扫码获取扫码信息
|
||||
*
|
||||
* @param request
|
||||
* @return
|
||||
* @author
|
||||
*
|
||||
*/
|
||||
@PostMapping("pda/scan")
|
||||
@ApiMark(moduleName = "扫码", apiName = "扫码获取扫码信息")
|
||||
|
|
@ -485,6 +524,14 @@ public class PurchaseReturnController extends BaseController {
|
|||
@GetMapping("exportTicket")
|
||||
public void exportTicket(HttpServletResponse response, @Valid @RequestParam @NotNull Long id) throws Exception {
|
||||
WmsReturnRequest order = returnRequestService.getById(id);
|
||||
List<WmsReturnRequestItem> orderItem = returnRequestItemService.lambdaQuery()
|
||||
.eq(WmsReturnRequestItem::getApplicationId, id)
|
||||
.list();
|
||||
if(CollectionUtil.isNotEmpty(orderItem))
|
||||
{
|
||||
order.setPoNum(orderItem.get(0).getPoNumberNew());
|
||||
}
|
||||
|
||||
VUtil.trueThrowBusinessError(Objects.isNull(order)).throwMessage("申请单不存在");
|
||||
VUtil.trueThrowBusinessError(order.getApprovalStatus() != 1).throwMessage("申请单未审核通过");
|
||||
UserSupplier supplier = userSupplierService.getByCode(order.getSupplierCode());
|
||||
|
|
|
|||
|
|
@ -5,10 +5,12 @@ import com.nflg.wms.admin.service.SapService;
|
|||
import com.nflg.wms.common.pojo.ApiResult;
|
||||
import com.nflg.wms.common.pojo.dto.LdapDepartmentDTO;
|
||||
import com.nflg.wms.common.pojo.dto.LdapUserDTO;
|
||||
import com.nflg.wms.common.util.VUtil;
|
||||
import com.nflg.wms.repository.service.ILanguageService;
|
||||
import com.nflg.wms.starter.BaseController;
|
||||
import com.sap.conn.jco.JCoException;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.validation.metadata.ValidateUnwrappedValue;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
|
@ -76,4 +78,10 @@ public class TestController extends BaseController {
|
|||
String ids=basdeSerialNumberControllerService.generateSerialNumber(0);
|
||||
return ApiResult.success(ids);
|
||||
}
|
||||
|
||||
@GetMapping("/businessError")
|
||||
public void testThrowBusinessError() throws Exception {
|
||||
int a=0;
|
||||
Integer b =100/a;
|
||||
}
|
||||
}
|
||||
|
|
@ -10,6 +10,7 @@ import com.nflg.wms.admin.pojo.dto.PdfPageDTO;
|
|||
import com.nflg.wms.admin.pojo.dto.ZWM3A17DTO;
|
||||
import com.nflg.wms.admin.pojo.dto.ZWM3A17Item1DTO;
|
||||
import com.nflg.wms.admin.pojo.dto.ZWM3A17Item2DTO;
|
||||
import com.nflg.wms.admin.pojo.request.UpdateItemNumRequest;
|
||||
import com.nflg.wms.admin.repository.InMaterialScanRecordRespository;
|
||||
import com.nflg.wms.admin.repository.InventoryForOutRepository;
|
||||
import com.nflg.wms.admin.repository.OutMaterialScanRecordRespository;
|
||||
|
|
@ -223,6 +224,22 @@ public class TransferCompanyController extends BaseController {
|
|||
return ApiResult.success(vo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改订单项数量
|
||||
*/
|
||||
@PostMapping("updateItemNum")
|
||||
public ApiResult<Void> updateItemNum(@Valid @RequestBody UpdateItemNumRequest request) {
|
||||
WmsTransferCompanyItem item = transferCompanyItemService.getById(request.getId());
|
||||
VUtil.trueThrowBusinessError(Objects.isNull(item)).throwMessage("订单项不存在");
|
||||
BigDecimal min = item.getNum().subtract(item.getLeft());
|
||||
VUtil.trueThrowBusinessError(request.getNum().compareTo(min) < 0).throwMessage("数量不能小于" + min);
|
||||
BigDecimal difference = request.getNum().subtract(item.getNum());
|
||||
item.setLeft(item.getLeft().add(difference));
|
||||
item.setNum(request.getNum());
|
||||
transferCompanyItemService.updateById(item);
|
||||
return ApiResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取转储单(PDA使用)
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import cn.hutool.core.date.DateUtil;
|
|||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.nflg.wms.admin.pojo.dto.PdfPageDTO;
|
||||
import com.nflg.wms.admin.pojo.request.UpdateItemNumRequest;
|
||||
import com.nflg.wms.admin.repository.InMaterialScanRecordRespository;
|
||||
import com.nflg.wms.admin.repository.InventoryForOutRepository;
|
||||
import com.nflg.wms.admin.repository.OutMaterialScanRecordRespository;
|
||||
|
|
@ -221,6 +222,22 @@ public class TransferFactoryController extends BaseController {
|
|||
return ApiResult.success(vo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改订单项数量
|
||||
*/
|
||||
@PostMapping("updateItemNum")
|
||||
public ApiResult<Void> updateItemNum(@Valid @RequestBody UpdateItemNumRequest request) {
|
||||
WmsTransferFactoryItem item = transferFactoryItemService.getById(request.getId());
|
||||
VUtil.trueThrowBusinessError(Objects.isNull(item)).throwMessage("订单项不存在");
|
||||
BigDecimal min = item.getNum().subtract(item.getLeft());
|
||||
VUtil.trueThrowBusinessError(request.getNum().compareTo(min) < 0).throwMessage("数量不能小于" + min);
|
||||
BigDecimal difference = request.getNum().subtract(item.getNum());
|
||||
item.setLeft(item.getLeft().add(difference));
|
||||
item.setNum(request.getNum());
|
||||
transferFactoryItemService.updateById(item);
|
||||
return ApiResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取调拨单(PDA使用)
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -0,0 +1,21 @@
|
|||
package com.nflg.wms.admin.pojo.request;
|
||||
|
||||
import jakarta.validation.constraints.Min;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class UpdateItemNumRequest {
|
||||
|
||||
@NotNull
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 新的数量
|
||||
*/
|
||||
@NotNull
|
||||
@Min(value = 0)
|
||||
private BigDecimal num;
|
||||
}
|
||||
|
|
@ -3,26 +3,38 @@ package com.nflg.wms.admin;
|
|||
import cn.hutool.core.util.StrUtil;
|
||||
import com.nflg.wms.common.util.DateTimeUtil;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
public class ATest {
|
||||
|
||||
@Test
|
||||
public void test1(){
|
||||
Long index=2L;
|
||||
System.out.println("K"+ StrUtil.padPre(String.valueOf(index),6,"0"));
|
||||
public void test1() {
|
||||
Long index = 2L;
|
||||
System.out.println("K" + StrUtil.padPre(String.valueOf(index), 6, "0"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test2(){
|
||||
String index="0000";
|
||||
System.out.println(StrUtil.removeAllPrefix(index,"0"));
|
||||
public void test2() {
|
||||
String index = "0000";
|
||||
System.out.println(StrUtil.removeAllPrefix(index, "0"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test3(){
|
||||
String date=DateTimeUtil.format(LocalDateTime.now(), "yyMMdd");
|
||||
public void test3() {
|
||||
String date = DateTimeUtil.format(LocalDateTime.now(), "yyMMdd");
|
||||
System.out.println(date);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test4() {
|
||||
BigDecimal num1 = new BigDecimal("5");
|
||||
BigDecimal num2 = new BigDecimal("2");
|
||||
BigDecimal left = new BigDecimal("3");
|
||||
BigDecimal a = left.add(num2.subtract(num1));
|
||||
System.out.println(a);
|
||||
Assert.isTrue(a.compareTo(BigDecimal.ZERO) == 0, "数量错误");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,35 +12,30 @@ public class ZWM3A24ItemReturnDTO{
|
|||
*/
|
||||
private String werks;
|
||||
|
||||
/**
|
||||
* 原订单行号
|
||||
*/
|
||||
private Integer ebelp_old;
|
||||
|
||||
/**
|
||||
* 新单行号
|
||||
* 定单行号
|
||||
*/
|
||||
private Integer ebelp_new;
|
||||
private Integer ebelp;
|
||||
|
||||
/**
|
||||
* 库存地点
|
||||
*/
|
||||
private String lgort;
|
||||
|
||||
// /**
|
||||
// * 物料描述(短文本)
|
||||
// */
|
||||
// private String maktx;
|
||||
/**
|
||||
* 物料描述(短文本)
|
||||
*/
|
||||
private String maktx;
|
||||
|
||||
// /**
|
||||
// * 退货项目
|
||||
// */
|
||||
// private String retpo;
|
||||
/**
|
||||
* 退货项目
|
||||
*/
|
||||
private String retpo;
|
||||
|
||||
// /**
|
||||
// * 采购凭证号
|
||||
// */
|
||||
// private String ebeln;
|
||||
/**
|
||||
* 采购凭证号
|
||||
*/
|
||||
private String ebeln;
|
||||
|
||||
/**
|
||||
* 物料号
|
||||
|
|
|
|||
|
|
@ -5,39 +5,39 @@ import lombok.Data;
|
|||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class ZWM3A25ItemDTO{
|
||||
public class ZWM3A25ItemDTO {
|
||||
|
||||
/**
|
||||
* 工厂
|
||||
*/
|
||||
private String werks;
|
||||
/**
|
||||
* 工厂
|
||||
*/
|
||||
private String werks;
|
||||
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
private BigDecimal menge_Ret;
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
private BigDecimal menge_Ret;
|
||||
|
||||
/**
|
||||
* 消息
|
||||
*/
|
||||
private String msg;
|
||||
/**
|
||||
* 消息
|
||||
*/
|
||||
private String msg;
|
||||
|
||||
/**
|
||||
* 库存地点
|
||||
*/
|
||||
private String lgort;
|
||||
/**
|
||||
* 库存地点
|
||||
*/
|
||||
private String lgort;
|
||||
|
||||
/**
|
||||
* 新单行号
|
||||
*/
|
||||
//private String ebelpNew;
|
||||
/**
|
||||
* 物料号
|
||||
*/
|
||||
private String matnr;
|
||||
/**
|
||||
* 新单行号
|
||||
*/
|
||||
private String ebelpNew;
|
||||
/**
|
||||
* 物料号
|
||||
*/
|
||||
private String matnr;
|
||||
|
||||
/**
|
||||
* 原订单行号
|
||||
*/
|
||||
private Integer ebelp_old;
|
||||
/**
|
||||
* 原订单行号
|
||||
*/
|
||||
private Integer ebelp_old;
|
||||
}
|
||||
|
|
@ -11,9 +11,9 @@ public class ZWM3A25ItemReturnDTO{
|
|||
private String werks;
|
||||
|
||||
/**
|
||||
* 退货单明细
|
||||
* 新的采购单行号
|
||||
*/
|
||||
private String ebelp;
|
||||
private Integer ebelp;
|
||||
|
||||
/**
|
||||
* 库存地点
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ import java.util.List;
|
|||
@Accessors(chain = true)
|
||||
public class QRCodeSearchQO {
|
||||
/**
|
||||
* 包装编号
|
||||
* 物料码编号
|
||||
*/
|
||||
@NotNull
|
||||
@NotBlank
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.nflg.wms.common.pojo.vo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
|
|
@ -56,6 +57,20 @@ public class ApplyReturnRequestItemVO {
|
|||
*/
|
||||
private BigDecimal requestQuantity;
|
||||
|
||||
/**
|
||||
* 剩余数量
|
||||
*/
|
||||
private BigDecimal left;
|
||||
|
||||
/**
|
||||
* 领料数量最小值
|
||||
*/
|
||||
private BigDecimal requestQuantityLimit;
|
||||
|
||||
public BigDecimal getRequestQuantityLimit() {
|
||||
return requestQuantity.subtract(left);
|
||||
}
|
||||
|
||||
/**
|
||||
* 出库状态
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -111,6 +111,15 @@ public class OutAssistanceItemVO {
|
|||
*/
|
||||
private BigDecimal left;
|
||||
|
||||
/**
|
||||
* 领料数量最小值
|
||||
*/
|
||||
private BigDecimal numLimit;
|
||||
|
||||
public BigDecimal getNumLimit() {
|
||||
return num.subtract(left);
|
||||
}
|
||||
|
||||
/**
|
||||
* 发货仓库
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -105,4 +105,13 @@ public class OutCostcenterInfoItemVO {
|
|||
* 待领数量
|
||||
*/
|
||||
private BigDecimal left;
|
||||
|
||||
/**
|
||||
* 领料数量最小值
|
||||
*/
|
||||
private BigDecimal numLimit;
|
||||
|
||||
public BigDecimal getNumLimit() {
|
||||
return num.subtract(left);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -126,6 +126,15 @@ public class OutProduceInfoItemVO {
|
|||
*/
|
||||
private BigDecimal lockNum;
|
||||
|
||||
/**
|
||||
* 申请数量最小值
|
||||
*/
|
||||
private BigDecimal sqslLimit;
|
||||
|
||||
public BigDecimal getSqslLimit() {
|
||||
return num;
|
||||
}
|
||||
|
||||
/**
|
||||
* 已领数量
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -140,6 +140,15 @@ public class TransferCompanyItemVO {
|
|||
return num.subtract(left);
|
||||
}
|
||||
|
||||
/**
|
||||
* 转储数量最小值
|
||||
*/
|
||||
private BigDecimal numLimit;
|
||||
|
||||
public BigDecimal getNumLimit() {
|
||||
return outNum;
|
||||
}
|
||||
|
||||
/**
|
||||
* 已入库数量
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -125,6 +125,15 @@ public class TransferFactoryItemVO {
|
|||
return num.subtract(left);
|
||||
}
|
||||
|
||||
/**
|
||||
* 调库数量最小值
|
||||
*/
|
||||
private BigDecimal numLimit;
|
||||
|
||||
public BigDecimal getNumLimit() {
|
||||
return num.subtract(left);
|
||||
}
|
||||
|
||||
/**
|
||||
* 已入库数量
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -78,17 +78,6 @@ public class WmsReturnRequestItem implements Serializable {
|
|||
*/
|
||||
private BigDecimal requestQuantity;
|
||||
|
||||
/**
|
||||
* 剩余数量
|
||||
*/
|
||||
@TableField(value = "\"left\"")
|
||||
private BigDecimal left;
|
||||
|
||||
/**
|
||||
* sap过账的行号
|
||||
*/
|
||||
private Integer poLineNumberNew;
|
||||
|
||||
/**
|
||||
* 出库状态
|
||||
*/
|
||||
|
|
@ -128,4 +117,20 @@ public class WmsReturnRequestItem implements Serializable {
|
|||
* 单位
|
||||
*/
|
||||
private String unit;
|
||||
|
||||
/**
|
||||
* 剩余数量
|
||||
*/
|
||||
@TableField(value ="\"left\"")
|
||||
private BigDecimal left;
|
||||
|
||||
/**
|
||||
* sap过账的行号
|
||||
*/
|
||||
private Integer poLineNumberNew;
|
||||
|
||||
/**
|
||||
* 新的采购单号
|
||||
*/
|
||||
private String poNumberNew;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -74,15 +74,15 @@ public class WmsStructuralPackageOrderTrayItem implements Serializable {
|
|||
*/
|
||||
private BigDecimal storeNum;
|
||||
|
||||
/**
|
||||
* 图片
|
||||
*/
|
||||
private String image;
|
||||
|
||||
/**
|
||||
* 图号
|
||||
*/
|
||||
private String drawingNo;
|
||||
// /**
|
||||
// * 图片
|
||||
// */
|
||||
// private String image;
|
||||
//
|
||||
// /**
|
||||
// * 图号
|
||||
// */
|
||||
// private String drawingNo;
|
||||
|
||||
/**
|
||||
* 线下交货原因
|
||||
|
|
|
|||
|
|
@ -3,18 +3,18 @@
|
|||
<mapper namespace="com.nflg.wms.repository.mapper.WmsStructuralPackageOrderTrayItemMapper">
|
||||
|
||||
<select id="getListByTrayId" resultType="com.nflg.wms.common.pojo.vo.DeliverStructuralPackageOrderTrayItemVO">
|
||||
SELECT ROW_NUMBER() OVER (ORDER BY o.id) AS "index",oti.*,ot."no" as "tray_no",ot."state",sp."no" as "package_no"
|
||||
,sp."name" as "package_desc"
|
||||
SELECT ROW_NUMBER() OVER (ORDER BY o.id) AS "index",m.image,m.drawing_no,oti.*,ot."no" as "tray_no",ot."state"
|
||||
,sp."no" as "package_no",sp."name" as "package_desc"
|
||||
FROM wms_structural_package_order_tray ot
|
||||
INNER JOIN wms_structural_package_order_tray_item oti ON ot."id"=oti.tray_id
|
||||
INNER JOIN wms_structural_package_order o ON o."id"=ot.order_id
|
||||
LEFT JOIN wms_structural_package sp ON o.package_id=sp."id"
|
||||
LEFT JOIN wms_material m ON oti.material_no=m."no" and oti."version"=m."version"
|
||||
where ot.id=#{id}
|
||||
order by o.id
|
||||
</select>
|
||||
|
||||
<select id="getSimpleListByTrayNo"
|
||||
resultType="com.nflg.wms.common.pojo.vo.DeliverStructuralPackageOrderTrayItemSimpleVO">
|
||||
<select id="getSimpleListByTrayNo" resultType="com.nflg.wms.common.pojo.vo.DeliverStructuralPackageOrderTrayItemSimpleVO">
|
||||
select oti.*
|
||||
from wms_structural_package_order_tray ot
|
||||
inner join wms_structural_package_order_tray_item oti on ot."id"=oti.tray_id
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ public class CodeGeneratorTest {
|
|||
)
|
||||
.strategyConfig(builder -> {
|
||||
builder
|
||||
.addInclude("opt_record") //只生成指定表
|
||||
.addInclude("wms_return_request_item") //只生成指定表
|
||||
.entityBuilder().idType(IdType.ASSIGN_ID)
|
||||
.enableLombok()
|
||||
.enableChainModel()
|
||||
|
|
|
|||
|
|
@ -38,6 +38,11 @@
|
|||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.redisson</groupId>
|
||||
<artifactId>redisson-spring-boot-starter</artifactId>
|
||||
<version>3.52.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sap.conn.jco</groupId>
|
||||
<artifactId>sapjco3</artifactId>
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ public class DeploySitTest {
|
|||
}
|
||||
|
||||
private String getRemoteFileMD5(SSHUtil sshUtil, String remotePath) throws Exception {
|
||||
String md5 = StrUtil.subPre(sshUtil.execWithReturn("md5sum " + remotePath),32);
|
||||
String md5 = StrUtil.subPre(sshUtil.execWithReturn("md5sum " + remotePath), 32);
|
||||
printInfo("远程文件MD5为" + md5);
|
||||
return md5;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.nflg.wms.starter.advice;
|
||||
|
||||
import cn.dev33.satoken.exception.NotLoginException;
|
||||
import cn.hutool.core.exceptions.ExceptionUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.nflg.wms.common.constant.Constant;
|
||||
import com.nflg.wms.common.constant.STATE;
|
||||
|
|
@ -31,30 +32,30 @@ public class GlobalRestControllerAdvice {
|
|||
|
||||
@ExceptionHandler(Exception.class)
|
||||
public ApiResult<Void> handleAllExceptions(Exception ex) {
|
||||
log.error("服务器内部错误: ", ex);
|
||||
printLog("服务器内部错误", ex);
|
||||
return ApiResult.error(STATE.BusinessError, "服务器内部错误,错误号:" + MDC.get(Constant.TRACE_ID));
|
||||
}
|
||||
|
||||
@ExceptionHandler(NflgException.class)
|
||||
public ResponseEntity<Object> handleNflgException(NflgException ex) {
|
||||
if (ex.getState() == STATE.LoginError) {
|
||||
log.error("登录失效: ", ex);
|
||||
printLog("登录失效", ex);
|
||||
return ResponseEntity.status(HttpStatus.UNAUTHORIZED).body(ex.getMsg());
|
||||
} else {
|
||||
log.error("业务错误: ", ex);
|
||||
printLog("业务错误", ex);
|
||||
return ResponseEntity.ok().body(ApiResult.error(ex.getState(), ex.getMsg()));
|
||||
}
|
||||
}
|
||||
|
||||
@ExceptionHandler(ConstraintViolationException.class)
|
||||
public ApiResult<Void> handleConstraintViolationException(ConstraintViolationException ex) {
|
||||
log.error("数据校验失败: ", ex);
|
||||
printLog("数据校验失败", ex);
|
||||
return ApiResult.error(STATE.ParamErr, "数据校验失败: " + StrUtil.join(",", ex.getConstraintViolations().stream().map(ConstraintViolation::getMessage).collect(Collectors.toList())));
|
||||
}
|
||||
|
||||
@ExceptionHandler(MethodArgumentNotValidException.class)
|
||||
public ApiResult<Void> handleMethodArgumentNotValidException(MethodArgumentNotValidException ex) {
|
||||
log.error("数据校验失败: ", ex);
|
||||
printLog("数据校验失败", ex);
|
||||
List<String> errors = new ArrayList<>();
|
||||
ex.getBindingResult().getAllErrors().forEach(error -> {
|
||||
String fieldName = ((FieldError) error).getField();
|
||||
|
|
@ -73,19 +74,23 @@ public class GlobalRestControllerAdvice {
|
|||
@ExceptionHandler(NoResourceFoundException.class)
|
||||
@ResponseStatus(HttpStatus.NOT_FOUND)
|
||||
public ApiResult<Void> handleNoResourceFoundException(NoResourceFoundException ex) {
|
||||
log.error("请求的地址无效: ", ex);
|
||||
printLog("请求的地址无效", ex);
|
||||
return ApiResult.error(STATE.BusinessError, "请求的地址无效:" + ex.getResourcePath());
|
||||
}
|
||||
|
||||
@ExceptionHandler(SAPException.class)
|
||||
public ApiResult<Void> handleSAPException(SAPException ex) {
|
||||
log.error("SAP错误: ", ex);
|
||||
printLog("SAP错误", ex);
|
||||
return ApiResult.error(ex.getState(), "SAP错误:" + ex.getMessage());
|
||||
}
|
||||
|
||||
@ExceptionHandler(DataAlertException.class)
|
||||
public ApiResult<Void> handleDataAlertException(DataAlertException ex) {
|
||||
log.error("返回数据的错误: ", ex);
|
||||
printLog("返回数据的错误", ex);
|
||||
return ApiResult.errorWithExtras(ex.getState(), ex.getObj());
|
||||
}
|
||||
|
||||
private void printLog(String msg, Throwable ex) {
|
||||
log.error("{}:{},{}", msg, ex.getMessage(), ExceptionUtil.stacktraceToString(ex));
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue