1.修复生成库存详情数据缺失问题

master
x_z 3 years ago
parent 6272b47af9
commit 02a30d7e2c

@ -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<OrderDetailEntity> 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) {

@ -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<WarehouseEntity> 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);
}
}
}

@ -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);

@ -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

Loading…
Cancel
Save