发票新增,或更新同步问题

pro
anthonywj 2 years ago
parent e4864f67e4
commit 795b57b500

@ -40,6 +40,7 @@ import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
@ -137,15 +138,15 @@ public class IoOrderController extends BaseController {
List<IoOrderResponse> list = orderService.getfilterList(filterOrderRequest);
for (IoOrderResponse ioOrderResponse : list) {
if(ioOrderResponse.getCheckStatus() == null){
ioOrderResponse.setCheckStatus(0+"");
if (ioOrderResponse.getCheckStatus() == null) {
ioOrderResponse.setCheckStatus(0 + "");
}
FilterOrderDetailCodeRequest filterOrderDetailCodeRequest = new FilterOrderDetailCodeRequest();
filterOrderDetailCodeRequest.setOrderIdFk(ioOrderResponse.getBillNo());
List<IoOrderDetailCodeResponse> ioOrderDetailCodeResponses = orderDetailBizService.getfilterList(filterOrderDetailCodeRequest);
BigDecimal amount=new BigDecimal(0.00);
BigDecimal amount = new BigDecimal(0.00);
for (IoOrderDetailCodeResponse ioOrderDetailCodeRespons : ioOrderDetailCodeResponses) {
if(ioOrderDetailCodeRespons.getCount() != 0 && ioOrderDetailCodeRespons.getPrice()!=null) {
if (ioOrderDetailCodeRespons.getCount() != 0 && ioOrderDetailCodeRespons.getPrice() != null) {
amount = amount.add(new BigDecimal(ioOrderDetailCodeRespons.getCount()).multiply(ioOrderDetailCodeRespons.getPrice()));
}
}
@ -632,6 +633,7 @@ public class IoOrderController extends BaseController {
@PostMapping("/udiwms/inout/order/updateOrder")
@Log(title = "单据管理", businessType = BusinessType.UPDATE)
public BaseResponse updateOrder(@RequestBody IoOrderEntity ioOrderEntity) {
ioOrderEntity.setUpdateTime(new Date());
orderService.updateByBillNo(ioOrderEntity);
return ResultVOUtils.success();
}

@ -603,7 +603,7 @@ public class IoOrderDetailBizController extends BaseController {
@PostMapping("/udiwms/inout/biz/insertInvoice")
@Log(title = "发票管理", businessType = BusinessType.INSERT)
public BaseResponse insertInvoice(@RequestBody IoOrderInvoiceEntity ioOrderInvoice) {
String billNo = null;
for (IoOrderDetailBizEntity ioOrderDetailBizEntity : ioOrderInvoice.getList()) {
IoOrderInvoiceEntity ioOrderInvoiceEntity = new IoOrderInvoiceEntity();
ioOrderInvoiceEntity.setOrderIdFk(ioOrderDetailBizEntity.getOrderIdFk());
@ -623,17 +623,26 @@ public class IoOrderDetailBizController extends BaseController {
ioOrderInvoiceEntity.setRemark(ioOrderInvoice.getRemark());
ioOrderInvoiceEntity.setLicenseUrl(ioOrderInvoice.getLicenseUrl());
boolean b = ioOrderInvoiceService.insertInvoice(ioOrderInvoiceEntity);
billNo = ioOrderDetailBizEntity.getOrderIdFk();
}
IoOrderEntity orderEntity = orderService.findByBillNo(billNo);
orderEntity.setUpdateTime(new Date());
orderService.update(orderEntity);
return ResultVOUtils.success("成功");
}
@PostMapping("/udiwms/inout/biz/updateorderBiz")
public BaseResponse updateorderBiz(@RequestBody List<IoOrderDetailCodeEntity> list) {
String billNo = null;
for (IoOrderDetailCodeEntity ioOrderDetailBizEntity : list) {
ioOrderDetailBizEntity.setRegStatus(true);
orderDetailCodeService.updateOrderDetailBiz(ioOrderDetailBizEntity);
billNo = ioOrderDetailBizEntity.getOrderIdFk();
}
IoOrderEntity orderEntity = orderService.findByBillNo(billNo);
orderEntity.setUpdateTime(new Date());
orderService.update(orderEntity);
return ResultVOUtils.success("成功");
}

Loading…
Cancel
Save