发票刷新修改,更新同步问题

pro
anthonywj 2 years ago
parent d2b6289733
commit 0f903962a3

@ -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("修改成功!");
}

@ -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<IoOrderInvoiceEntity> orderInvoiceEntities = ioOrderInvoiceService.selectOrderInvoice(orderInvoiceRequest);
List<IoOrderDetailCodeEntity> 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);
}
}

@ -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<IoOrderDetailBizEntity> 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<IoOrderDetailCodeEntity> 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<IoOrderDetailResultEntity> orderDetailResultEntities = syncDataResponse.getOrderDetailResultEntities();
for (IoOrderDetailResultEntity detailResultEntity : orderDetailResultEntities) {
if (detailResultEntity.getOrderIdFk().equals(orderEntity.getBillNo())) {
detailResultEntity.setId(null);
orderDetailResultDao.insert(detailResultEntity);
}
}

@ -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<IoOrderInvoiceEntity> orderInvoiceEntities;
List<IoOrderDetailCodeEntity> orderDetailCodeEntities;
}

@ -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);

Loading…
Cancel
Save