|
|
|
@ -21,10 +21,7 @@ import com.glxp.api.req.inout.FilterOrderDetailCodeRequest;
|
|
|
|
|
import com.glxp.api.req.inout.IoOrderInvoiceRequest;
|
|
|
|
|
import com.glxp.api.req.inout.RefreshInoiceRequest;
|
|
|
|
|
import com.glxp.api.req.system.DeleteRequest;
|
|
|
|
|
import com.glxp.api.res.inout.IoOrderDetailCodeResponse;
|
|
|
|
|
import com.glxp.api.res.inout.IoOrderInvoiceResponse;
|
|
|
|
|
import com.glxp.api.res.inout.IoOrderResponse;
|
|
|
|
|
import com.glxp.api.res.inout.RefreshInoiceResponse;
|
|
|
|
|
import com.glxp.api.res.inout.*;
|
|
|
|
|
import com.glxp.api.service.auth.CustomerService;
|
|
|
|
|
import com.glxp.api.service.inout.IoOrderDetailBizService;
|
|
|
|
|
import com.glxp.api.service.inout.IoOrderDetailCodeService;
|
|
|
|
@ -95,8 +92,6 @@ public class IoOrderInvoiceController {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//分组查询发票列表
|
|
|
|
|
@AuthRuleAnnotation("")
|
|
|
|
|
@GetMapping("/udiwms/inout/order/group/invoice")
|
|
|
|
@ -162,8 +157,8 @@ public class IoOrderInvoiceController {
|
|
|
|
|
//查询单据详情
|
|
|
|
|
FilterOrderDetailCodeRequest orderDetailBizRequest = new FilterOrderDetailCodeRequest();
|
|
|
|
|
orderDetailBizRequest.setOrderIdFk(orderFk);
|
|
|
|
|
List<IoOrderDetailCodeResponse> ioOrderDetailCodeResponses = orderDetailBizService.getfilterOrderList(orderDetailBizRequest);
|
|
|
|
|
for (IoOrderDetailCodeResponse ioOrderDetailCodeRespons : ioOrderDetailCodeResponses) {
|
|
|
|
|
List<IoOrderDetailResultResponse> ioOrderDetailCodeResponses = orderDetailBizService.getInvoicResultDetail(orderDetailBizRequest);
|
|
|
|
|
for (IoOrderDetailResultResponse ioOrderDetailCodeRespons : ioOrderDetailCodeResponses) {
|
|
|
|
|
IoOrderInvoiceEntity ioOrderInvoiceEntity = new IoOrderInvoiceEntity();
|
|
|
|
|
BeanUtils.copyProperties(ioOrderInvoiceRequest, ioOrderInvoiceEntity);
|
|
|
|
|
ioOrderInvoiceEntity.setId(IdUtil.getSnowflakeNextId());
|
|
|
|
@ -192,7 +187,7 @@ public class IoOrderInvoiceController {
|
|
|
|
|
@Log(title = "发票管理", businessType = BusinessType.UPDATE)
|
|
|
|
|
public BaseResponse uploadInvoice(@RequestBody IoOrderInvoiceEntity ioOrderInvoice) {
|
|
|
|
|
|
|
|
|
|
List<IoOrderInvoiceEntity> ioOrderInvoiceEntityList=ioOrderInvoiceService.list(new QueryWrapper<IoOrderInvoiceEntity>().eq("invoiceEncode",ioOrderInvoice.getInvoiceEncode()));
|
|
|
|
|
List<IoOrderInvoiceEntity> ioOrderInvoiceEntityList = ioOrderInvoiceService.list(new QueryWrapper<IoOrderInvoiceEntity>().eq("invoiceEncode", ioOrderInvoice.getInvoiceEncode()));
|
|
|
|
|
for (IoOrderInvoiceEntity ioOrderInvoiceEntity : ioOrderInvoiceEntityList) {
|
|
|
|
|
ioOrderInvoiceEntity.setInvoiceDate(ioOrderInvoice.getInvoiceDate());
|
|
|
|
|
ioOrderInvoiceEntity.setPrice(ioOrderInvoice.getPrice());
|
|
|
|
@ -215,7 +210,7 @@ public class IoOrderInvoiceController {
|
|
|
|
|
if (StrUtil.isEmpty(deleteRequest.getInvoiceEncode()))
|
|
|
|
|
return ResultVOUtils.error(500, "发票编码不能为空");
|
|
|
|
|
|
|
|
|
|
boolean b = ioOrderInvoiceService.remove(new QueryWrapper<IoOrderInvoiceEntity>().eq("invoiceEncode", deleteRequest.getInvoiceEncode()).eq("orderIdFk",deleteRequest.getBillNo()));
|
|
|
|
|
boolean b = ioOrderInvoiceService.remove(new QueryWrapper<IoOrderInvoiceEntity>().eq("invoiceEncode", deleteRequest.getInvoiceEncode()).eq("orderIdFk", deleteRequest.getBillNo()));
|
|
|
|
|
if (b)
|
|
|
|
|
return ResultVOUtils.success("删除成功!");
|
|
|
|
|
else
|
|
|
|
@ -230,8 +225,8 @@ public class IoOrderInvoiceController {
|
|
|
|
|
return ResultVOUtils.error(500, "发票编码不能为空");
|
|
|
|
|
|
|
|
|
|
List<IoOrderInvoiceEntity> ioOrderInvoiceEntityList = ioOrderInvoiceService.list(new QueryWrapper<IoOrderInvoiceEntity>().eq("invoiceEncode", deleteRequest.getInvoiceEncode()));
|
|
|
|
|
if (CollectionUtils.isNotEmpty(ioOrderInvoiceEntityList) && ioOrderInvoiceEntityList.size()>0){
|
|
|
|
|
return ResultVOUtils.error(999,"发票编码已存在!");
|
|
|
|
|
if (CollectionUtils.isNotEmpty(ioOrderInvoiceEntityList) && ioOrderInvoiceEntityList.size() > 0) {
|
|
|
|
|
return ResultVOUtils.error(999, "发票编码已存在!");
|
|
|
|
|
}
|
|
|
|
|
return ResultVOUtils.success();
|
|
|
|
|
|
|
|
|
|