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 a13d604..e5668b3 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 @@ -3,6 +3,7 @@ package com.glxp.udi.admin.service.inout; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.glxp.udi.admin.dao.inout.OrderDetailDao; import com.glxp.udi.admin.entity.inout.OrderDetailEntity; import com.glxp.udi.admin.req.inout.DeleteRequest; @@ -39,7 +40,16 @@ public class OrderDetailService { } public void updateOrderDetail(OrderDetailEntity orderDetailEntity) { - orderDetailDao.updateById(orderDetailEntity); + UpdateWrapper updateWrapper = new UpdateWrapper<>(); + updateWrapper.setEntity(orderDetailEntity); + updateWrapper + .set("price", orderDetailEntity.getPrice()) + .set("firstSalesInvNo", orderDetailEntity.getFirstSalesInvNo()) + .set("secSalesInvNo", orderDetailEntity.getSecSalesInvNo()) + .set("secSalesListNo", orderDetailEntity.getSecSalesListNo()) + .set("invoiceDate", orderDetailEntity.getInvoiceDate()) + .eq("id", orderDetailEntity.getId()); + orderDetailDao.update(orderDetailEntity, updateWrapper); } public long statCount(String orderId) { diff --git a/src/main/java/com/glxp/udi/admin/thread/InvProductsTrService.java b/src/main/java/com/glxp/udi/admin/thread/InvProductsTrService.java index 908b91a..ff936df 100644 --- a/src/main/java/com/glxp/udi/admin/thread/InvProductsTrService.java +++ b/src/main/java/com/glxp/udi/admin/thread/InvProductsTrService.java @@ -1,7 +1,6 @@ package com.glxp.udi.admin.thread; import cn.hutool.core.collection.CollUtil; -import cn.hutool.core.util.StrUtil; import com.glxp.udi.admin.constant.ConstantStatus; import com.glxp.udi.admin.constant.TypeConstant; import com.glxp.udi.admin.entity.inout.*; @@ -97,32 +96,26 @@ public class InvProductsTrService { //查询码详情数据,用于生成库存 WarehouseQueryRequest warehouseQueryRequest = new WarehouseQueryRequest(); warehouseQueryRequest.setOrderId(orderId); - warehouseQueryRequest.setUdi(invProductEntity.getNameCode()); - if (StrUtil.isNotBlank(invProductEntity.getBatchNo())) { - warehouseQueryRequest.setBatchNo(invProductEntity.getBatchNo()); - } List warehouseEntities = codesService.filterWarehouse(warehouseQueryRequest); if (CollUtil.isNotEmpty(warehouseEntities)) { for (WarehouseEntity warehouseEntity : warehouseEntities) { UdiInfoEntity tempUdi = udiInfoService.findByNameCode(warehouseEntity.getNameCode(), customerId); - if (tempUdi.getUuid().equals(orderDetailEntity.getUuidFk())) { - InvProductDetailEntity invProductDetailEntity = new InvProductDetailEntity(); - invProductDetailEntity.setProductIdFk(invProductEntity.getRelIdFk() + ""); - invProductDetailEntity.setInvProductIdFk(String.valueOf(invProductEntity.getId())); - invProductDetailEntity.setCode(warehouseEntity.getCode()); - invProductDetailEntity.setOrderIdFk(warehouseEntity.getOrderId()); - int actCount = inoutUtils.getActCount(tempUdi); - invProductDetailEntity.setCount(actCount * warehouseEntity.getCount()); - invProductDetailEntity.setAction(warehouseEntity.getAction()); - invProductDetailEntity.setBatchNo(warehouseEntity.getBatchNo()); - invProductDetailEntity.setMainAction(warehouseEntity.getMainAction()); - invProductDetailEntity.setProductDate(warehouseEntity.getProduceDate()); - invProductDetailEntity.setExpireDate(warehouseEntity.getExpireDate()); - invProductDetailEntity.setUpdateTime(new Date()); - invProductDetailEntity.setCustomerId(orderEntity.getCustomerId() + ""); - invProductDetailEntity.setLocStorageCode(warehouseEntity.getLocStorageCode()); - invProductDetailService.insertInvProduct(invProductDetailEntity); - } + InvProductDetailEntity invProductDetailEntity = new InvProductDetailEntity(); + invProductDetailEntity.setProductIdFk(invProductEntity.getRelIdFk() + ""); + invProductDetailEntity.setInvProductIdFk(String.valueOf(invProductEntity.getId())); + invProductDetailEntity.setCode(warehouseEntity.getCode()); + invProductDetailEntity.setOrderIdFk(warehouseEntity.getOrderId()); + int actCount = inoutUtils.getActCount(tempUdi); + invProductDetailEntity.setCount(actCount * warehouseEntity.getCount()); + invProductDetailEntity.setAction(warehouseEntity.getAction()); + invProductDetailEntity.setBatchNo(warehouseEntity.getBatchNo()); + invProductDetailEntity.setMainAction(warehouseEntity.getMainAction()); + invProductDetailEntity.setProductDate(warehouseEntity.getProduceDate()); + invProductDetailEntity.setExpireDate(warehouseEntity.getExpireDate()); + invProductDetailEntity.setUpdateTime(new Date()); + invProductDetailEntity.setCustomerId(orderEntity.getCustomerId() + ""); + invProductDetailEntity.setLocStorageCode(warehouseEntity.getLocStorageCode()); + invProductDetailService.insertInvProduct(invProductDetailEntity); } } } 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 a4e0ed5..f8ea956 100644 --- a/src/main/java/com/glxp/udi/admin/thread/TransInoutService.java +++ b/src/main/java/com/glxp/udi/admin/thread/TransInoutService.java @@ -200,7 +200,8 @@ public class TransInoutService { 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 billType = postOrder.getCodes().get(0).getAction(); //单据类型 + BussinessTypeEntity bussinessTypeEntity = bussinessTypeService.findBTByAction(billType, String.valueOf(customerId)); String orderId = gennerOrderUtils.createScOrderNo(new OrderNoTypeBean(Constant.SCAN_ORDER + StrUtil.trimToEmpty(bussinessTypeEntity.getPrefix()), "yyyyMMdd")); OrderEntity orderSaveRequest = new OrderEntity(); orderSaveRequest.setOrderId(orderId); diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index a0714d4..cb43ae1 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -3,10 +3,10 @@ spring: pathmatch: matching-strategy: ant_path_matcher datasource: - url: jdbc:mysql://192.168.235.137:3306/udims?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true + url: jdbc:p6spy:mysql://192.168.235.137:3306/udims?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true username: root password: root - driver-class-name: com.mysql.cj.jdbc.Driver + driver-class-name: com.p6spy.engine.spy.P6SpyDriver data: mongodb: uri: mongodb://192.168.0.66:27017/udiwms