diff --git a/src/main/java/com/glxp/api/controller/basic/BasicOrderPrintController.java b/src/main/java/com/glxp/api/controller/basic/BasicOrderPrintController.java index f63903b0..ac6661e8 100644 --- a/src/main/java/com/glxp/api/controller/basic/BasicOrderPrintController.java +++ b/src/main/java/com/glxp/api/controller/basic/BasicOrderPrintController.java @@ -273,7 +273,7 @@ public class BasicOrderPrintController { bizData.put("index", i); bizData.put("nameCode", obj.getNameCode() == null ? ' ' : obj.getNameCode()); String udiCode = "#" + obj.getNameCode() + "#" + obj.getProduceDate() + "#" + obj.getExpireDate() + - "#" + obj.getBatchNo() + "#" + obj.getSerialNo() + "#" + obj.getWarehouseCode() + "#" + obj.getDeptCode(); + "#" + obj.getBatchNo() + "#" + obj.getSerialNo() + "#" + "#"; udiCode = udiCode.replaceAll("#null", "#"); bizData.put("udiCode", udiCode); bizData.put("cpmctymc", udiProductEntity.getCpmctymc() == null ? ' ' : udiProductEntity.getCpmctymc()); diff --git a/src/main/java/com/glxp/api/controller/inout/IoOrderController.java b/src/main/java/com/glxp/api/controller/inout/IoOrderController.java index 668a8925..27826c7f 100644 --- a/src/main/java/com/glxp/api/controller/inout/IoOrderController.java +++ b/src/main/java/com/glxp/api/controller/inout/IoOrderController.java @@ -395,6 +395,10 @@ public class IoOrderController extends BaseController { @PostMapping("udiwms/inout/order/delete") @Log(title = "单据管理", businessType = BusinessType.DELETE) public BaseResponse deletById(@RequestBody DeleteRequest deleteRequest) { + IoOrderEntity orderEntity = orderService.findByBillNo(deleteRequest.getBillNo()); + if (orderEntity.getStatus() != 1 && orderEntity.getStatus() != 3 && orderEntity.getStatus() != 4 && orderEntity.getStatus() != 6) { + return ResultVOUtils.error(500, "单据已提交无法删除!"); + } orderService.deleteByBillNo(deleteRequest.getBillNo()); orderDetailBizService.deleteByOrderId(deleteRequest.getBillNo()); orderDetailCodeService.deleteByOrderId(deleteRequest.getBillNo()); 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 0bdadd55..8d995a24 100644 --- a/src/main/java/com/glxp/api/controller/inout/IoOrderDetailBizController.java +++ b/src/main/java/com/glxp/api/controller/inout/IoOrderDetailBizController.java @@ -2,6 +2,7 @@ package com.glxp.api.controller.inout; import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.StrUtil; import com.github.pagehelper.PageInfo; @@ -27,6 +28,7 @@ import com.glxp.api.entity.thrsys.ThrOrderDetailEntity; import com.glxp.api.entity.thrsys.ThrOrderEntity; import com.glxp.api.entity.thrsys.ThrSystemBusApiEntity; import com.glxp.api.req.inout.*; +import com.glxp.api.req.inv.FilterInvoiceRequest; import com.glxp.api.req.system.DeleteRequest; import com.glxp.api.req.thrsys.FilterThrOrderDetailRequest; import com.glxp.api.res.PageSimpleResponse; @@ -54,6 +56,7 @@ import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import java.math.BigDecimal; import java.util.ArrayList; +import java.util.Arrays; import java.util.Date; import java.util.List; @@ -653,6 +656,23 @@ public class IoOrderDetailBizController extends BaseController { } + + + @GetMapping("/udiwms/inout/biz/parseInvoice") + public BaseResponse parseInvoice(String code) { + List list = Arrays.asList(code.split(",")); + FilterInvoiceRequest filterInvoiceRequest = new FilterInvoiceRequest(); + filterInvoiceRequest.setType(list.get(1)); + filterInvoiceRequest.setInvoiceCode(list.get(2)); + filterInvoiceRequest.setInvoiceEncode(list.get(3)); + filterInvoiceRequest.setPrice(new BigDecimal(list.get(4))); + filterInvoiceRequest.setInvoiceDate(DateUtil.formatDateTime(DateUtil.parse(list.get(5), "yyyyMMdd"))); + return ResultVOUtils.success(filterInvoiceRequest); + } + + + + @PostMapping("/udiwms/inout/biz/updateorderBiz") public BaseResponse updateorderBiz(@RequestBody List list) { String billNo = null; diff --git a/src/main/java/com/glxp/api/controller/inout/IoOrderReviewController.java b/src/main/java/com/glxp/api/controller/inout/IoOrderReviewController.java index ecf03798..7056ceef 100644 --- a/src/main/java/com/glxp/api/controller/inout/IoOrderReviewController.java +++ b/src/main/java/com/glxp/api/controller/inout/IoOrderReviewController.java @@ -327,14 +327,16 @@ public class IoOrderReviewController extends BaseController { if (StrUtil.isNotEmpty(code)) { code = code.replace("\r\n", ""); } - if (code.endsWith("\u001D")) { code = code.replace("\u001D", ""); } - for (IoCodeEntity checkOrderCodesBean : codesList) { - if (checkOrderCodesBean.getCode().toUpperCase(Locale.ROOT).equals(code.toUpperCase(Locale.ROOT))) { - if (checkOrderCodesBean.getStatus() == Constant.DB_CHECK_ED + String checkCode = checkOrderCodesBean.getCode(); + if (checkCode.endsWith("\u001D")) { + checkCode = checkCode.replace("\u001D", ""); + } + if (checkCode.toUpperCase(Locale.ROOT).equals(code.toUpperCase(Locale.ROOT))) { + if (IntUtil.value(checkOrderCodesBean.getStatus()) == Constant.DB_CHECK_ED && IntUtil.value(checkOrderCodesBean.getReCount()) == checkOrderCodesBean.getScanCount()) { return Constant.CHECK_REPEAT; } @@ -351,8 +353,18 @@ public class IoOrderReviewController extends BaseController { public IoCodeEntity isExit(List codeList, String code) { if (CollUtil.isNotEmpty(codeList)) { + if (StrUtil.isNotEmpty(code)) { + code = code.replace("\r\n", ""); + } + if (code.endsWith("\u001D")) { + code = code.replace("\u001D", ""); + } for (IoCodeEntity codeEntity : codeList) { - if (codeEntity.getCode().equals(code)) { + String checkCode = codeEntity.getCode(); + if (checkCode.endsWith("\u001D")) { + checkCode = checkCode.replace("\u001D", ""); + } + if (checkCode.equals(code)) { return codeEntity; } } diff --git a/src/main/java/com/glxp/api/req/inv/FilterInvoiceRequest.java b/src/main/java/com/glxp/api/req/inv/FilterInvoiceRequest.java new file mode 100644 index 00000000..c7a86962 --- /dev/null +++ b/src/main/java/com/glxp/api/req/inv/FilterInvoiceRequest.java @@ -0,0 +1,41 @@ +package com.glxp.api.req.inv; + +import com.glxp.api.util.page.ListPageRequest; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 查询库存预警消息参数 + */ +@Data +public class FilterInvoiceRequest extends ListPageRequest { + + + /** + * 预警类型:10:增值税电子普通发票;01:增值税专用发票;04:增值税普通发票;32:电子发票(普通发票);31:电子发票(增值税专用发票) + */ + private String type; + + /** + * 发票代码 + */ + private String invoiceCode; + + /** + * 发票编码 + */ + private String invoiceEncode; + + /** + * 开票日期 + */ + private String invoiceDate; + + + /** + * 发票价格 + */ + private BigDecimal price; + +} diff --git a/src/main/java/com/glxp/api/service/inout/impl/IoOrderServiceImpl.java b/src/main/java/com/glxp/api/service/inout/impl/IoOrderServiceImpl.java index b426efe3..b1d62bd0 100644 --- a/src/main/java/com/glxp/api/service/inout/impl/IoOrderServiceImpl.java +++ b/src/main/java/com/glxp/api/service/inout/impl/IoOrderServiceImpl.java @@ -276,6 +276,7 @@ public class IoOrderServiceImpl implements IoOrderService { } } + return 0; } diff --git a/src/main/java/com/glxp/api/service/inv/impl/InvInnerOrderPrintServiceImpl.java b/src/main/java/com/glxp/api/service/inv/impl/InvInnerOrderPrintServiceImpl.java index 3152c3cd..f4c4b866 100644 --- a/src/main/java/com/glxp/api/service/inv/impl/InvInnerOrderPrintServiceImpl.java +++ b/src/main/java/com/glxp/api/service/inv/impl/InvInnerOrderPrintServiceImpl.java @@ -116,7 +116,7 @@ public class InvInnerOrderPrintServiceImpl implements InvInnerOrderPrintService UdiProductEntity udiProductEntity = udiProductService.findByNameCode(filterUdiRelevance.getNameCode()); String udiCode = "#" + udiProductEntity.getNameCode() + "#" + obj.getProductDate() + "#" + obj.getExpireDate() + - "#" + obj.getBatchNo() + "#" + udiProductEntity.getSerialNo() + "#" + udiProductEntity.getWarehouseCode() + "#" + udiProductEntity.getDeptCode(); + "#" + obj.getBatchNo() + "#" + udiProductEntity.getSerialNo() + "#" + "#" ; udiCode = udiCode.replaceAll("#null", "#"); innerOrderPrintEntity.setUdiCode(udiCode); invInnerOrderPrintDao.insert(innerOrderPrintEntity); @@ -165,12 +165,10 @@ public class InvInnerOrderPrintServiceImpl implements InvInnerOrderPrintService if (innerOrderQRCodeTextPDFTemplateRequest.getOrderId() != null) { filterStockprintRequest.setSOrderId(innerOrderQRCodeTextPDFTemplateRequest.getOrderId()); deleteStPrintTempRequest.setStockOrderFk(innerOrderQRCodeTextPDFTemplateRequest.getOrderId() + ""); - } else { deleteStPrintTempRequest.setPrintCodeIdFk(innerOrderQRCodeTextPDFTemplateRequest.getQueryId()); filterStockprintRequest.setId(innerOrderQRCodeTextPDFTemplateRequest.getQueryId()); } - innerOrderPdfTempService.delete(deleteStPrintTempRequest); List stockPrintEntities = invInnerOrderPrintService.filterJoinInnerPrint(filterStockprintRequest); if (stockPrintEntities != null && stockPrintEntities.size() > 0) { @@ -285,7 +283,7 @@ public class InvInnerOrderPrintServiceImpl implements InvInnerOrderPrintService UdiProductEntity udiProductEntity = udiProductService.findByNameCode(filterUdiRelevance.getNameCode()); String udiCode = "#" + obj.getNameCode() + "#" + obj.getProductDate() + "#" + obj.getExpireDate() + - "#" + obj.getBatchNo() + "#" + udiProductEntity.getSerialNo() + "#" + udiProductEntity.getWarehouseCode() + "#" + udiProductEntity.getDeptCode(); + "#" + obj.getBatchNo() + "#" + udiProductEntity.getSerialNo() + "#" + "#" ; udiCode = udiCode.replaceAll("#null", "#"); innerOrderPrintEntity.setUdiCode(udiCode); invInnerOrderPrintDao.insert(innerOrderPrintEntity); diff --git a/src/main/java/com/glxp/api/util/udi/UdiCalCountUtil.java b/src/main/java/com/glxp/api/util/udi/UdiCalCountUtil.java index 6af1ec10..28b71af0 100644 --- a/src/main/java/com/glxp/api/util/udi/UdiCalCountUtil.java +++ b/src/main/java/com/glxp/api/util/udi/UdiCalCountUtil.java @@ -20,24 +20,37 @@ public class UdiCalCountUtil { // } public int getActCount(UdiRelevanceResponse udiRelevanceResponse) { - int actCount; - if (!udiRelevanceResponse.getUseDy() && (udiRelevanceResponse.getDiType() == null || udiRelevanceResponse.getDiType() != 2)) { - if (udiRelevanceResponse.getBhzxxsbzsl() == 0) { - actCount = udiRelevanceResponse.getZxxsbzbhsydysl(); - } else { + + //启用使用单元 + if (udiRelevanceResponse.getUseDy()) { + if (udiRelevanceResponse.getDiType() == 1) { + if (udiRelevanceResponse.getZxxsbzbhsydysl() == null || udiRelevanceResponse.getZxxsbzbhsydysl() == 0) { + udiRelevanceResponse.setZxxsbzbhsydysl(1); + } + return udiRelevanceResponse.getZxxsbzbhsydysl(); + } else if (udiRelevanceResponse.getDiType() == 4) { if (udiRelevanceResponse.getBhzxxsbzsl() == 0) { udiRelevanceResponse.setBhzxxsbzsl(1); } if (udiRelevanceResponse.getZxxsbzbhsydysl() == null || udiRelevanceResponse.getZxxsbzbhsydysl() == 0) { udiRelevanceResponse.setZxxsbzbhsydysl(1); } - actCount = udiRelevanceResponse.getBhzxxsbzsl() * udiRelevanceResponse.getZxxsbzbhsydysl(); + return udiRelevanceResponse.getBhzxxsbzsl() * udiRelevanceResponse.getZxxsbzbhsydysl(); + } else { + return udiRelevanceResponse.getBhzxxsbzsl(); + } + } else {//不启用使用单元 + if (udiRelevanceResponse.getDiType() == 1) { + return 1; + } else if (udiRelevanceResponse.getDiType() == 4) { + if (udiRelevanceResponse.getBhzxxsbzsl() == 0) { + udiRelevanceResponse.setBhzxxsbzsl(1); + } + return udiRelevanceResponse.getBhzxxsbzsl(); + } else { + return udiRelevanceResponse.getBhzxxsbzsl(); } - } else { - actCount = udiRelevanceResponse.getBhzxxsbzsl(); } - - return actCount; } public int getActCount(IoCodeTempEntity codeTempEntity) {