diff --git a/src/main/java/com/glxp/api/controller/inout/IoOrderDetailBizController.java b/src/main/java/com/glxp/api/controller/inout/IoOrderDetailBizController.java index e253e8c2..ee1eb4f1 100644 --- a/src/main/java/com/glxp/api/controller/inout/IoOrderDetailBizController.java +++ b/src/main/java/com/glxp/api/controller/inout/IoOrderDetailBizController.java @@ -593,10 +593,26 @@ public class IoOrderDetailBizController extends BaseController { @PostMapping("/udiwms/inout/biz/updateById") @Log(title = "发票管理", businessType = BusinessType.UPDATE) - public BaseResponse deleteById(@RequestBody IoOrderInvoiceRequest ioOrderInvoiceRequest) { - + public BaseResponse updateById(@RequestBody IoOrderInvoiceRequest ioOrderInvoiceRequest) { + IoOrderEntity orderEntity = orderService.findByBillNo(ioOrderInvoiceRequest.getOrderIdFk()); + if (orderEntity != null) { + orderEntity.setUpdateTime(new Date()); + orderService.update(orderEntity); + } return ResultVOUtils.success(ioOrderInvoiceService.updateByInvId(ioOrderInvoiceRequest)); + } + + @PostMapping("/udiwms/inout/bizDetail/updateById") + @Log(title = "发票管理", businessType = BusinessType.UPDATE) + public BaseResponse updateBizById(@RequestBody IoOrderDetailBizEntity ioOrderDetailBizEntity) { + IoOrderEntity orderEntity = orderService.findByBillNo(ioOrderDetailBizEntity.getOrderIdFk()); + if (orderEntity != null) { + orderEntity.setUpdateTime(new Date()); + orderService.update(orderEntity); + } + boolean b = orderDetailBizService.updateOrderDetailBiz(ioOrderDetailBizEntity); + return ResultVOUtils.success("修改成功!"); } diff --git a/src/main/java/com/glxp/api/controller/inout/IoOrderInvoiceController.java b/src/main/java/com/glxp/api/controller/inout/IoOrderInvoiceController.java index f086f0aa..bffa41e7 100644 --- a/src/main/java/com/glxp/api/controller/inout/IoOrderInvoiceController.java +++ b/src/main/java/com/glxp/api/controller/inout/IoOrderInvoiceController.java @@ -6,9 +6,12 @@ import com.glxp.api.annotation.Log; import com.glxp.api.common.res.BaseResponse; import com.glxp.api.common.util.ResultVOUtils; import com.glxp.api.constant.BusinessType; +import com.glxp.api.entity.inout.IoOrderDetailCodeEntity; import com.glxp.api.entity.inout.IoOrderInvoiceEntity; import com.glxp.api.req.inout.IoOrderInvoiceRequest; import com.glxp.api.req.inout.RefreshInoiceRequest; +import com.glxp.api.res.inout.RefreshInoiceResponse; +import com.glxp.api.service.inout.IoOrderDetailCodeService; import com.glxp.api.service.inout.IoOrderInvoiceService; import org.springframework.beans.BeanUtils; import org.springframework.web.bind.annotation.PostMapping; @@ -23,6 +26,8 @@ public class IoOrderInvoiceController { @Resource IoOrderInvoiceService ioOrderInvoiceService; RefreshInoiceRequest refreshInoiceRequest; + @Resource + IoOrderDetailCodeService orderDetailCodeService; @AuthRuleAnnotation("") @@ -33,8 +38,13 @@ public class IoOrderInvoiceController { IoOrderInvoiceRequest orderInvoiceRequest = new IoOrderInvoiceRequest(); BeanUtils.copyProperties(refreshInoiceRequest, orderInvoiceRequest); List orderInvoiceEntities = ioOrderInvoiceService.selectOrderInvoice(orderInvoiceRequest); + List orderDetailCodeEntities = orderDetailCodeService.findByOrderId(orderInvoiceRequest.getOrderIdFk()); + + RefreshInoiceResponse response = new RefreshInoiceResponse(); + response.setOrderInvoiceEntities(orderInvoiceEntities); + response.setOrderDetailCodeEntities(orderDetailCodeEntities); if (CollUtil.isEmpty(orderInvoiceEntities)) return ResultVOUtils.error(500, "查无发票信息!"); - return ResultVOUtils.success(orderInvoiceEntities); + return ResultVOUtils.success(response); } } diff --git a/src/main/java/com/glxp/api/controller/sync/SpsSyncDownloadController.java b/src/main/java/com/glxp/api/controller/sync/SpsSyncDownloadController.java index f580f0f3..def94b8a 100644 --- a/src/main/java/com/glxp/api/controller/sync/SpsSyncDownloadController.java +++ b/src/main/java/com/glxp/api/controller/sync/SpsSyncDownloadController.java @@ -652,12 +652,10 @@ public class SpsSyncDownloadController { orderEntity.setOutChangeEnable(syncDataBustypeEntity.isSyncChange()); } } - IoOrderEntity temp = orderService.findById(orderEntity.getBillNo()); - - + IoOrderEntity temp = orderService.findByBillNo(orderEntity.getBillNo()); if (temp == null) { - // 过滤使用出库单,转换成一级库出库单(条件:往来类型为客户信息,出入库类型为出库,仓库类型为入账库,是否更改库存为是 + //过滤使用出库单,转换成一级库出库单(条件:往来类型为客户信息,出入库类型为出库,仓库类型为入账库,是否更改库存为是 BasicBussinessTypeEntity basicBussinessTypeEntity = basicBussinessTypeService.findByAction(orderEntity.getAction()); if (basicBussinessTypeEntity.getCorpType() == ConstantStatus.CORP_TYPE_INPUT && basicBussinessTypeEntity.getMainAction().equals(ConstantType.TYPE_OUT) @@ -694,7 +692,6 @@ public class SpsSyncDownloadController { List orderDetailBizEntities = syncDataResponse.getOrderDetailBizEntities(); for (IoOrderDetailBizEntity bizEntity : orderDetailBizEntities) { if (bizEntity.getOrderIdFk().equals(orderEntity.getBillNo())) { - bizEntity.setId(null); orderDetailBizDao.insert(bizEntity); } } @@ -705,7 +702,6 @@ public class SpsSyncDownloadController { List orderDetailCodeEntities = syncDataResponse.getOrderDetailCodeEntities(); for (IoOrderDetailCodeEntity codeEntity : orderDetailCodeEntities) { if (codeEntity.getOrderIdFk().equals(orderEntity.getBillNo())) { - codeEntity.setId(null); orderDetailCodeDao.insert(codeEntity); } } @@ -717,7 +713,6 @@ public class SpsSyncDownloadController { List orderDetailResultEntities = syncDataResponse.getOrderDetailResultEntities(); for (IoOrderDetailResultEntity detailResultEntity : orderDetailResultEntities) { if (detailResultEntity.getOrderIdFk().equals(orderEntity.getBillNo())) { - detailResultEntity.setId(null); orderDetailResultDao.insert(detailResultEntity); } } diff --git a/src/main/java/com/glxp/api/res/inout/RefreshInoiceResponse.java b/src/main/java/com/glxp/api/res/inout/RefreshInoiceResponse.java new file mode 100644 index 00000000..58e68c38 --- /dev/null +++ b/src/main/java/com/glxp/api/res/inout/RefreshInoiceResponse.java @@ -0,0 +1,14 @@ +package com.glxp.api.res.inout; + +import com.glxp.api.entity.inout.IoOrderDetailCodeEntity; +import com.glxp.api.entity.inout.IoOrderInvoiceEntity; +import lombok.Data; + +import java.util.List; + +@Data +public class RefreshInoiceResponse { + + List orderInvoiceEntities; + List orderDetailCodeEntities; +} diff --git a/src/main/resources/schemas/schema_v2.1.sql b/src/main/resources/schemas/schema_v2.1.sql index c46b149b..fb98ec3c 100644 --- a/src/main/resources/schemas/schema_v2.1.sql +++ b/src/main/resources/schemas/schema_v2.1.sql @@ -373,6 +373,8 @@ CALL Pro_Temp_ColumnWork('basic_bussiness_type', 'spaceOut', 'tinyint', 1); CALL Pro_Temp_ColumnWork('io_order_detail_code', 'id', 'bigint ', 2); CALL Pro_Temp_ColumnWork('io_order_detail_biz', 'id', 'bigint ', 2); +CALL Pro_Temp_ColumnWork('io_order_invoice', 'bizIdFk', 'bigint ', 2); +