|
|
|
@ -147,8 +147,7 @@ public class IoOrderDetailBizController extends BaseController {
|
|
|
|
|
AuthAdmin authAdmin = getUser();
|
|
|
|
|
if (addBizProductReqeust.getRelId() == null && CollUtil.isEmpty(addBizProductReqeust.getDatas()))
|
|
|
|
|
return ResultVOUtils.error(500, "未选择产品信息");
|
|
|
|
|
if (addBizProductReqeust.getOrderEntity() == null)
|
|
|
|
|
return ResultVOUtils.error(500, "未指定订单");
|
|
|
|
|
if (addBizProductReqeust.getOrderEntity() == null) return ResultVOUtils.error(500, "未指定订单");
|
|
|
|
|
IoOrderEntity orderEntity = addBizProductReqeust.getOrderEntity();
|
|
|
|
|
IoOrderEntity isExit = orderService.findByBillNo(orderEntity.getBillNo());
|
|
|
|
|
if (StrUtil.isEmpty(orderEntity.getBillNo()) || isExit == null) {
|
|
|
|
@ -304,16 +303,14 @@ public class IoOrderDetailBizController extends BaseController {
|
|
|
|
|
outInvCode = invWarehouseEntity.getCode();
|
|
|
|
|
}
|
|
|
|
|
Boolean vailBatchNo = true;
|
|
|
|
|
if (IntUtil.value(bussinessTypeEntity.getVailInvBatchNo()))
|
|
|
|
|
vailBatchNo = false;
|
|
|
|
|
if (IntUtil.value(bussinessTypeEntity.getVailInvBatchNo())) vailBatchNo = false;
|
|
|
|
|
Integer count = invProductServiceNew.vailStockCount(orderDetailBizEntity.getBindRlFk(), orderDetailBizEntity.getBatchNo(), orderDetailBizEntity.getSupId(), null, outInvCode, null, vailBatchNo);
|
|
|
|
|
count = IntUtil.value(count) - orderDetailBizEntity.getCount();
|
|
|
|
|
|
|
|
|
|
if (count < 0) {
|
|
|
|
|
if (count == -1) {
|
|
|
|
|
return ResultVOUtils.error(500, "该产品未入库");
|
|
|
|
|
} else
|
|
|
|
|
return ResultVOUtils.error(500, "当前库存不足");
|
|
|
|
|
} else return ResultVOUtils.error(500, "当前库存不足");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -459,8 +456,7 @@ public class IoOrderDetailBizController extends BaseController {
|
|
|
|
|
@AuthRuleAnnotation("")
|
|
|
|
|
@PostMapping("/udiwms/inout/order/addReceiveOrder")
|
|
|
|
|
@Log(title = "单据管理", businessType = BusinessType.INSERT)
|
|
|
|
|
public BaseResponse addReceiveOrder(@RequestBody PurReceiveEntity purReceiveEntity,
|
|
|
|
|
BindingResult bindingResult) {
|
|
|
|
|
public BaseResponse addReceiveOrder(@RequestBody PurReceiveEntity purReceiveEntity, BindingResult bindingResult) {
|
|
|
|
|
|
|
|
|
|
if (bindingResult.hasErrors()) {
|
|
|
|
|
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
|
|
|
@ -531,8 +527,7 @@ public class IoOrderDetailBizController extends BaseController {
|
|
|
|
|
@AuthRuleAnnotation("")
|
|
|
|
|
@PostMapping("/udiwms/inout/order/addPurOrder")
|
|
|
|
|
@Log(title = "单据管理", businessType = BusinessType.INSERT)
|
|
|
|
|
public BaseResponse addPurOrder(@RequestBody PurOrderEntity purOrderEntity,
|
|
|
|
|
BindingResult bindingResult) {
|
|
|
|
|
public BaseResponse addPurOrder(@RequestBody PurOrderEntity purOrderEntity, BindingResult bindingResult) {
|
|
|
|
|
|
|
|
|
|
if (bindingResult.hasErrors()) {
|
|
|
|
|
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
|
|
|
@ -628,9 +623,7 @@ public class IoOrderDetailBizController extends BaseController {
|
|
|
|
|
}
|
|
|
|
|
String value = systemParamConfigService.selectValueByParamKey("order_detail_visible");
|
|
|
|
|
if (IntUtil.value(value) == 1) {
|
|
|
|
|
list = list.stream()
|
|
|
|
|
.sorted(Comparator.comparing(IoOrderDetailBizResponse::getNameCode))
|
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
list = list.stream().sorted(Comparator.comparing(IoOrderDetailBizResponse::getNameCode)).collect(Collectors.toList());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -679,9 +672,7 @@ public class IoOrderDetailBizController extends BaseController {
|
|
|
|
|
|
|
|
|
|
String value = systemParamConfigService.selectValueByParamKey("order_detail_visible");
|
|
|
|
|
if (IntUtil.value(value) == 1) {
|
|
|
|
|
list = list.stream()
|
|
|
|
|
.sorted(Comparator.comparing(IoOrderDetailBizResponse::getNameCode))
|
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
list = list.stream().sorted(Comparator.comparing(IoOrderDetailBizResponse::getNameCode)).collect(Collectors.toList());
|
|
|
|
|
}
|
|
|
|
|
if (CollUtil.isEmpty(list)) {
|
|
|
|
|
PageInfo<IoOrderDetailBizResponse> pageInfo = new PageInfo<>(list);
|
|
|
|
@ -872,8 +863,7 @@ public class IoOrderDetailBizController extends BaseController {
|
|
|
|
|
String msg = "";
|
|
|
|
|
BigDecimal invoiceAmount = BigDecimal.ZERO;
|
|
|
|
|
for (IoOrderInvoiceEntity orderInvoiceEntity : orderInvoiceEntities) {
|
|
|
|
|
if (StrUtil.trimToEmpty(orderInvoiceEntity.getBatchNo()).equals(StrUtil.trimToEmpty(orderDetailCodeEntity.getBatchNo()))
|
|
|
|
|
&& StrUtil.trimToEmpty(orderInvoiceEntity.getBindRlFk()).equals(StrUtil.trimToEmpty(orderDetailCodeEntity.getBindRlFk() + ""))) {
|
|
|
|
|
if (StrUtil.trimToEmpty(orderInvoiceEntity.getBatchNo()).equals(StrUtil.trimToEmpty(orderDetailCodeEntity.getBatchNo())) && StrUtil.trimToEmpty(orderInvoiceEntity.getBindRlFk()).equals(StrUtil.trimToEmpty(orderDetailCodeEntity.getBindRlFk() + ""))) {
|
|
|
|
|
if (StrUtil.isNotEmpty(orderInvoiceEntity.getPrice())) {
|
|
|
|
|
BigDecimal price = new BigDecimal(orderInvoiceEntity.getPrice());
|
|
|
|
|
invoiceAmount = invoiceAmount.add(price);
|
|
|
|
@ -911,8 +901,7 @@ public class IoOrderDetailBizController extends BaseController {
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@GetMapping("/udiwms/inout/bizDetail/orderOutRecordPage")
|
|
|
|
|
public BaseResponse orderOutRecordPage(FilterOrderDetailBizRequest orderDetailBizRequest,
|
|
|
|
|
BindingResult bindingResult) {
|
|
|
|
|
public BaseResponse orderOutRecordPage(FilterOrderDetailBizRequest orderDetailBizRequest, BindingResult bindingResult) {
|
|
|
|
|
if (bindingResult.hasErrors()) {
|
|
|
|
|
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
|
|
|
|
}
|
|
|
|
@ -930,12 +919,10 @@ public class IoOrderDetailBizController extends BaseController {
|
|
|
|
|
//录入阳光采购的追溯码
|
|
|
|
|
@PostMapping("/udiwms/inout/order/yc/fileUpload")
|
|
|
|
|
@CusRedissonAnnotation(cacheName = RedissonCacheKey.XML_UPLOAD, key = {"#billNo"}, timeOutMsg = "系统正在处理,请勿重复上传")
|
|
|
|
|
public BaseResponse ycFileUpload(@RequestParam("billNo") String billNo, @RequestParam("file") MultipartFile file) {
|
|
|
|
|
alihealthBusService.ycFileUpload(billNo, file);
|
|
|
|
|
return ResultVOUtils.successMsg("上传成功!");
|
|
|
|
|
public BaseResponse ycCodeFileUpload(@RequestParam("billNo") String billNo, @RequestParam("file") MultipartFile file, AuthAdmin authAdmin) {
|
|
|
|
|
return alihealthBusService.ycFileUpload(billNo, file, authAdmin);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//录入阳光采购的采购订单明细
|
|
|
|
|
@PostMapping("/udiwms/inout/order/yc/orderFileUpload")
|
|
|
|
|
@CusRedissonAnnotation(cacheName = RedissonCacheKey.XML_UPLOAD, key = {"#billNoJson"}, timeOutMsg = "系统正在处理,请勿重复上传")
|
|
|
|
@ -1079,7 +1066,7 @@ public class IoOrderDetailBizController extends BaseController {
|
|
|
|
|
|
|
|
|
|
//匹配biz
|
|
|
|
|
IoOrderDetailCodeEntity byRelId = orderDetailCodeService.findByRelNameCode(addOrderRequest.getBillNo(), nameCode, aliYljgBillDetailDrug.getProduceBatchNo());
|
|
|
|
|
if (byRelId!=null){
|
|
|
|
|
if (byRelId != null) {
|
|
|
|
|
codeLostEntity.setBizId(byRelId.getId());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|