diff --git a/src/main/java/com/glxp/udi/admin/controller/info/CompanyController.java b/src/main/java/com/glxp/udi/admin/controller/info/CompanyController.java index d133d80..416e2f8 100644 --- a/src/main/java/com/glxp/udi/admin/controller/info/CompanyController.java +++ b/src/main/java/com/glxp/udi/admin/controller/info/CompanyController.java @@ -6,6 +6,7 @@ import com.glxp.udi.admin.annotation.AuthRuleAnnotation; import com.glxp.udi.admin.common.res.BaseResponse; import com.glxp.udi.admin.constant.CacheKey; import com.glxp.udi.admin.entity.auth.CustomerContactEntity; +import com.glxp.udi.admin.entity.auth.CustomerInfoEntity; import com.glxp.udi.admin.entity.info.CompanyEntity; import com.glxp.udi.admin.entity.info.CompanyUpdateLogEntity; import com.glxp.udi.admin.req.info.CompanyRequest; @@ -13,6 +14,7 @@ import com.glxp.udi.admin.req.info.FilterCompanyRequest; import com.glxp.udi.admin.res.PageSimpleResponse; import com.glxp.udi.admin.service.auth.AuthAdminService; import com.glxp.udi.admin.service.auth.CustomerContactService; +import com.glxp.udi.admin.service.auth.CustomerInfoService; import com.glxp.udi.admin.service.info.CompanyService; import com.glxp.udi.admin.service.info.CompanyUpdateLogService; import com.glxp.udi.admin.util.RedisUtil; @@ -52,6 +54,8 @@ public class CompanyController { private UdiDlHttpClient udiDlHttpClient; @Resource private RedisUtil redisUtil; + @Resource + private CustomerInfoService customerInfoService; @AuthRuleAnnotation("") @GetMapping("/warehouse/info/company") @@ -146,6 +150,15 @@ public class CompanyController { customerContactEntity.setCustomerId(companyEntity.getCustomerId()); customerContactService.updateCustomerContact(customerContactEntity); + + //同步更新客户表数据 + CustomerInfoEntity customerInfoEntity = customerInfoService.selectById(companyEntity.getCustomerId()); + customerInfoEntity.setCompanyName(companyEntity.getCompanyName()); + customerInfoEntity.setCustomerName(companyEntity.getCompanyName()); + customerInfoEntity.setArea(companyEntity.getArea()); + customerInfoEntity.setDetailAddr(companyEntity.getDetailAddr()); + customerInfoEntity.setCreditNum(companyEntity.getCreditNum()); + customerInfoService.updateCustomerInfo(customerInfoEntity); return ResultVOUtils.success("修改成功"); } diff --git a/src/main/java/com/glxp/udi/admin/controller/inout/InvProductsController.java b/src/main/java/com/glxp/udi/admin/controller/inout/InvProductsController.java index eb5bf3f..a890939 100644 --- a/src/main/java/com/glxp/udi/admin/controller/inout/InvProductsController.java +++ b/src/main/java/com/glxp/udi/admin/controller/inout/InvProductsController.java @@ -85,6 +85,7 @@ public class InvProductsController { for (InvProductEntity invProductEntity : invProductEntities) { InvProductResponse invProductResponse = new InvProductResponse(); BeanUtil.copyProperties(invProductEntity, invProductResponse); + invProductResponse.setProductionDate(invProductEntity.getProductDate()); invProductResponse.setInvStorageCode(invProductEntity.getLocStorageCode()); invProductResponse.setInvStorageName(invWarehouseService.findNameByCode(invProductEntity.getLocStorageCode())); result.add(invProductResponse); @@ -104,14 +105,14 @@ public class InvProductsController { if (StringUtils.isNotBlank(filterInvProductRequest.getUdiCode())) { filterUdiInfoRequest.setNameCode(FilterUdiUtils.getDiStr(filterInvProductRequest.getUdiCode())); } + String customerId = String.valueOf(customerService.getCustomerId()); + filterUdiInfoRequest.setCustomerId(customerId); filterUdiInfoRequest.setCpmctymc(filterInvProductRequest.getProductsName()); IPage page = udiInfoService.filterUdiInfo(filterUdiInfoRequest); - List uuids = new ArrayList<>(); - for (UdiInfoEntity udiInfoEntity : page.getRecords()) { - uuids.add(udiInfoEntity.getUuid()); - } - filterInvProductRequest.setUuids(uuids); - if (uuids.size() <= 0) { + if (page.getTotal() > 0) { + filterInvProductRequest.setNameCode(page.getRecords().get(0).getNameCode()); + filterInvProductRequest.setCustomerId(customerId); + } else { return ResultVOUtils.success(new PageSimpleResponse<>()); } } @@ -126,7 +127,7 @@ public class InvProductsController { List invProductEntities = page.getRecords(); List invProductResponses = new ArrayList<>(); for (InvProductEntity invProductEntity : invProductEntities) { - UdiInfoEntity udiInfoEntity = udiInfoService.findByUuid(invProductEntity.getRelIdFk(), invProductEntity.getCustomerId()); + UdiInfoEntity udiInfoEntity = udiInfoService.findById(invProductEntity.getRelIdFk()); invProductEntity.setNameCode(udiInfoEntity.getNameCode()); invProductEntity.setGgxh(udiInfoEntity.getGgxh()); diff --git a/src/main/java/com/glxp/udi/admin/entity/inout/WarehousetempEntity.java b/src/main/java/com/glxp/udi/admin/entity/inout/WarehousetempEntity.java index be4d241..3ccd5cf 100644 --- a/src/main/java/com/glxp/udi/admin/entity/inout/WarehousetempEntity.java +++ b/src/main/java/com/glxp/udi/admin/entity/inout/WarehousetempEntity.java @@ -1,6 +1,7 @@ package com.glxp.udi.admin.entity.inout; import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; @@ -112,4 +113,10 @@ public class WarehousetempEntity { */ private String supId; + /** + * 手持终端传输使用的nameCode参数 + */ + @TableField(exist = false) + private String udi; + } diff --git a/src/main/java/com/glxp/udi/admin/req/inout/FilterOrderDetailRequest.java b/src/main/java/com/glxp/udi/admin/req/inout/FilterOrderDetailRequest.java index 38c606a..fc24ad6 100644 --- a/src/main/java/com/glxp/udi/admin/req/inout/FilterOrderDetailRequest.java +++ b/src/main/java/com/glxp/udi/admin/req/inout/FilterOrderDetailRequest.java @@ -27,4 +27,9 @@ public class FilterOrderDetailRequest extends ListPageRequest { private String uuidFk; List orderIds; + /** + * 产品ID + */ + private String relId; + } diff --git a/src/main/java/com/glxp/udi/admin/res/inventory/InvProductResponse.java b/src/main/java/com/glxp/udi/admin/res/inventory/InvProductResponse.java index 8841037..2ae2a35 100644 --- a/src/main/java/com/glxp/udi/admin/res/inventory/InvProductResponse.java +++ b/src/main/java/com/glxp/udi/admin/res/inventory/InvProductResponse.java @@ -11,6 +11,10 @@ public class InvProductResponse { private String relIdFk; private String ggxh; private String batchNo; + + /** + * 生产日期 + */ private String productionDate; private String expireDate; private String ylqxzcrbarmc; diff --git a/src/main/java/com/glxp/udi/admin/service/inout/OrderDetailService.java b/src/main/java/com/glxp/udi/admin/service/inout/OrderDetailService.java index c1b4f77..a13d604 100644 --- a/src/main/java/com/glxp/udi/admin/service/inout/OrderDetailService.java +++ b/src/main/java/com/glxp/udi/admin/service/inout/OrderDetailService.java @@ -60,6 +60,7 @@ public class OrderDetailService { .eq(StrUtil.isNotBlank(orderDetailRequest.getOrderIdFk()), "orderIdFk", orderDetailRequest.getOrderIdFk()) .eq(null != orderDetailRequest.getCustomerId(), "customerId", orderDetailRequest.getCustomerId()) .eq(StrUtil.isNotBlank(orderDetailRequest.getUuidFk()), "uuidFk", orderDetailRequest.getUuidFk()) + .eq(StrUtil.isNotBlank(orderDetailRequest.getRelId()),"relId", orderDetailRequest.getRelId()) .eq(StrUtil.isNotBlank(orderDetailRequest.getLotno()), "batchNo", orderDetailRequest.getLotno()); return wrapper; } diff --git a/src/main/java/com/glxp/udi/admin/service/inout/OrderService.java b/src/main/java/com/glxp/udi/admin/service/inout/OrderService.java index ec55da3..0057635 100644 --- a/src/main/java/com/glxp/udi/admin/service/inout/OrderService.java +++ b/src/main/java/com/glxp/udi/admin/service/inout/OrderService.java @@ -2,6 +2,8 @@ package com.glxp.udi.admin.service.inout; import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.date.DatePattern; +import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.ReflectUtil; import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; @@ -92,8 +94,8 @@ public class OrderService { QueryWrapper wrapper = new QueryWrapper<>(); wrapper.eq(StrUtil.isNotBlank(orderFilterRequest.getId()), "orderId", orderFilterRequest.getId()) .in(CollUtil.isNotEmpty(orderFilterRequest.getInvCodes()), "locStorageCode", orderFilterRequest.getInvCodes()) - .le(StrUtil.isNotBlank(orderFilterRequest.getStartTime()), "actDate", orderFilterRequest.getStartTime()) - .ge(StrUtil.isNotBlank(orderFilterRequest.getEndTime()), "actDate", orderFilterRequest.getEndTime()) + .ge(StrUtil.isNotBlank(orderFilterRequest.getStartTime()), "actDate", StrUtil.isBlank(orderFilterRequest.getStartTime()) ? null : DateUtil.parse(orderFilterRequest.getStartTime()).toString(DatePattern.NORM_DATETIME_PATTERN)) + .le(StrUtil.isNotBlank(orderFilterRequest.getEndTime()), "actDate", StrUtil.isBlank(orderFilterRequest.getEndTime()) ? null : DateUtil.parse(orderFilterRequest.getEndTime()).toString(DatePattern.NORM_DATETIME_PATTERN)) .eq(StrUtil.isNotBlank(orderFilterRequest.getIsError()), "status", orderFilterRequest.getStatus()) .eq(StrUtil.isNotBlank(orderFilterRequest.getAction()), "action", orderFilterRequest.getAction()) .ne(StrUtil.isBlank(orderFilterRequest.getAction()), "action", "StockCheck") @@ -103,7 +105,8 @@ public class OrderService { .eq(StrUtil.isNotBlank(orderFilterRequest.getExportStatus()), "exportStatus", orderFilterRequest.getExportStatus()) .eq(null != orderFilterRequest.getCustomerId(), "customerId", orderFilterRequest.getCustomerId()) .eq(StrUtil.isNotBlank(orderFilterRequest.getCorpOrderId()), "corpOrderId", orderFilterRequest.getCorpOrderId()) - .eq(null != orderFilterRequest.getReceiveStatus(), "receiveStatus", orderFilterRequest.getReceiveStatus()); + .eq(null != orderFilterRequest.getReceiveStatus(), "receiveStatus", orderFilterRequest.getReceiveStatus()) + .ne(null == orderFilterRequest.getReceiveStatus() && ConstantStatus.ORDER_STATUS_SUCCESS.equals(orderFilterRequest.getStatus()), "receiveStatus", ConstantStatus.RECEIVE_UN); return wrapper; } diff --git a/src/main/java/com/glxp/udi/admin/service/inout/WarehouseService.java b/src/main/java/com/glxp/udi/admin/service/inout/WarehouseService.java index a5426e8..4002ffb 100644 --- a/src/main/java/com/glxp/udi/admin/service/inout/WarehouseService.java +++ b/src/main/java/com/glxp/udi/admin/service/inout/WarehouseService.java @@ -167,7 +167,7 @@ public class WarehouseService { //查询单据详情 FilterOrderDetailRequest filterOrderDetailRequest = new FilterOrderDetailRequest(); filterOrderDetailRequest.setOrderIdFk(order.getOrderId()); - filterOrderDetailRequest.setUuidFk(invProductEntity.getRelIdFk()); + filterOrderDetailRequest.setRelId(invProductEntity.getRelIdFk()); filterOrderDetailRequest.setLotno(warehouseMdEntity.getBatchNo()); List erpOrderEntities = orderDetailService.filterOrderDetails(filterOrderDetailRequest); if (CollUtil.isNotEmpty(erpOrderEntities)) { diff --git a/src/main/java/com/glxp/udi/admin/thread/TransInoutService.java b/src/main/java/com/glxp/udi/admin/thread/TransInoutService.java index c3ca6a0..a4e0ed5 100644 --- a/src/main/java/com/glxp/udi/admin/thread/TransInoutService.java +++ b/src/main/java/com/glxp/udi/admin/thread/TransInoutService.java @@ -199,6 +199,7 @@ public class TransInoutService { List warehousetempList = postOrder.getCodes(); if (warehousetempList != null && warehousetempList.size() > 0) { WarehousetempEntity warehousetempEntity = warehousetempList.get(0); + warehousetempEntity.setNameCode(warehousetempEntity.getUdi()); //拷贝nameCode参数值 BussinessTypeEntity bussinessTypeEntity = bussinessTypeService.findBTByAction(postOrder.getBillType(), String.valueOf(customerId)); String orderId = gennerOrderUtils.createScOrderNo(new OrderNoTypeBean(Constant.SCAN_ORDER + StrUtil.trimToEmpty(bussinessTypeEntity.getPrefix()), "yyyyMMdd")); OrderEntity orderSaveRequest = new OrderEntity(); diff --git a/src/main/java/com/glxp/udi/admin/util/inout/InoutUtils.java b/src/main/java/com/glxp/udi/admin/util/inout/InoutUtils.java index 22c1036..1d8423c 100644 --- a/src/main/java/com/glxp/udi/admin/util/inout/InoutUtils.java +++ b/src/main/java/com/glxp/udi/admin/util/inout/InoutUtils.java @@ -246,21 +246,21 @@ public class InoutUtils { } List erpOrderEntities = new ArrayList<>(); - for (UdiInfoEntity erpDetailCodeEntity : returnOrderDetail) { + for (UdiInfoEntity udiInfoEntity : returnOrderDetail) { OrderDetailEntity orderDetailEntity = new OrderDetailEntity(); - orderDetailEntity.setNameCode(erpDetailCodeEntity.getNameCode()); - orderDetailEntity.setPackRatio(erpDetailCodeEntity.getPackRatio()); - orderDetailEntity.setProductName(erpDetailCodeEntity.getCpmctymc()); - orderDetailEntity.setBatchNo(erpDetailCodeEntity.getBatchNo()); - orderDetailEntity.setProduceDate(erpDetailCodeEntity.getProduceDate()); - orderDetailEntity.setExpireDate(erpDetailCodeEntity.getExpireDate()); - orderDetailEntity.setCount(erpDetailCodeEntity.getCount()); + orderDetailEntity.setNameCode(udiInfoEntity.getNameCode()); + orderDetailEntity.setPackRatio(udiInfoEntity.getPackRatio()); + orderDetailEntity.setProductName(udiInfoEntity.getCpmctymc()); + orderDetailEntity.setBatchNo(udiInfoEntity.getBatchNo()); + orderDetailEntity.setProduceDate(udiInfoEntity.getProduceDate()); + orderDetailEntity.setExpireDate(udiInfoEntity.getExpireDate()); + orderDetailEntity.setCount(udiInfoEntity.getCount()); orderDetailEntity.setOrderIdFk(warehouseEntityList.get(0).getOrderId()); - orderDetailEntity.setProductCompany(erpDetailCodeEntity.getYlqxzcrbarmc()); - orderDetailEntity.setZczbhhzbapzbh(erpDetailCodeEntity.getZczbhhzbapzbh()); - orderDetailEntity.setUuidFk(orderDetailEntity.getUuidFk()); - orderDetailEntity.setRelId(String.valueOf(erpDetailCodeEntity.getId())); - orderDetailEntity.setGgxh(erpDetailCodeEntity.getGgxh()); + orderDetailEntity.setProductCompany(udiInfoEntity.getYlqxzcrbarmc()); + orderDetailEntity.setZczbhhzbapzbh(udiInfoEntity.getZczbhhzbapzbh()); + orderDetailEntity.setUuidFk(udiInfoEntity.getUuid()); + orderDetailEntity.setRelId(String.valueOf(udiInfoEntity.getId())); + orderDetailEntity.setGgxh(udiInfoEntity.getGgxh()); erpOrderEntities.add(orderDetailEntity); } if (CollUtil.isNotEmpty(erpOrderEntities)) {