修改入库问题
This commit is contained in:
parent
6d84c3100f
commit
ac6e269e3f
@ -50,6 +50,10 @@ public class ReqComponentEnterRecordDto {
|
||||
*/
|
||||
private Integer stockInType;
|
||||
|
||||
/**
|
||||
* 单价
|
||||
*/
|
||||
private Double price;
|
||||
/**
|
||||
* 中控信息列表,包含所有ECU部件的入库记录。
|
||||
*/
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.cdzy.ebikeoperate.model.pojo;
|
||||
|
||||
import com.mybatisflex.annotation.Column;
|
||||
import com.mybatisflex.annotation.Id;
|
||||
import com.mybatisflex.annotation.Table;
|
||||
import java.io.Serializable;
|
||||
@ -57,7 +58,8 @@ public class EbikeComponentInventorycount implements Serializable {
|
||||
/**
|
||||
* 部件数量
|
||||
*/
|
||||
private Integer count;
|
||||
@Column(onInsertValue = "0")
|
||||
private long itemCount;
|
||||
|
||||
/**
|
||||
* 单位
|
||||
|
||||
@ -79,7 +79,6 @@ public class EbikeComponentServiceImpl implements EbikeComponentService {
|
||||
String userId = getStaffId(); // 获取当前操作用户ID
|
||||
Long orgId = getOrgId(); // 获取当前操作用户所在组织ID
|
||||
EbikeComponentTypeInfo ebikeComponentTypeInfo = getComponentTypeInfo(params.getComponentType()); // 获取部件信息
|
||||
|
||||
// 获取或新增部件记录
|
||||
EbikeComponentEnterRecords ebikeComponentEnterRecords = buildEnterRecord(params, ebikeComponentTypeInfo, stockInType, orgId);
|
||||
saveOrUpdateEnterRecord(ebikeComponentEnterRecords, params.getComponentEnterRecordId(), userId);
|
||||
@ -154,7 +153,8 @@ public class EbikeComponentServiceImpl implements EbikeComponentService {
|
||||
ebikeComponentEnterRecords.setComponentType(params.getComponentType());
|
||||
ebikeComponentEnterRecords.setEnterQuantity(params.getEnterQuantity());
|
||||
ebikeComponentEnterRecords.setComponentOutRecordId(params.getComponentOutRecordId());
|
||||
ebikeComponentEnterRecords.setComponentPrice(ebikeComponentTypeInfo.getPrice());
|
||||
// ebikeComponentEnterRecords.setComponentPrice(ebikeComponentTypeInfo.getPrice());
|
||||
ebikeComponentEnterRecords.setComponentPrice(params.getPrice());
|
||||
ebikeComponentEnterRecords.setState(stockInType == 1 ? "1" : "0"); // 暂存为 0 入库为1
|
||||
return ebikeComponentEnterRecords;
|
||||
}
|
||||
@ -257,9 +257,9 @@ public class EbikeComponentServiceImpl implements EbikeComponentService {
|
||||
ebikeComponentInventorycountMapper.insert(ebikeComponentInventorycount);
|
||||
} else {
|
||||
if (type == 1) {//入库
|
||||
ebikeComponentInventorycount.setCount(ebikeComponentInventorycount.getCount() + size);
|
||||
ebikeComponentInventorycount.setItemCount(ebikeComponentInventorycount.getItemCount() + size);
|
||||
} else {//出库
|
||||
ebikeComponentInventorycount.setCount(ebikeComponentInventorycount.getCount() - size);
|
||||
ebikeComponentInventorycount.setItemCount(ebikeComponentInventorycount.getItemCount() - size);
|
||||
}
|
||||
ebikeComponentInventorycountMapper.update(ebikeComponentInventorycount);
|
||||
}
|
||||
@ -376,7 +376,7 @@ public class EbikeComponentServiceImpl implements EbikeComponentService {
|
||||
query1.eq("code", componentType);
|
||||
EbikeComponentInventorycount ebikeComponentInventorycount = ebikeComponentInventorycountMapper.selectOneByQuery(query1);
|
||||
if (ebikeComponentInventorycount != null) {
|
||||
ebikeComponentInventorycount.setCount(ebikeComponentInventorycount.getCount() - size);
|
||||
ebikeComponentInventorycount.setItemCount(ebikeComponentInventorycount.getItemCount() - size);
|
||||
ebikeComponentInventorycountMapper.update(ebikeComponentInventorycount);
|
||||
}
|
||||
}
|
||||
@ -393,7 +393,7 @@ public class EbikeComponentServiceImpl implements EbikeComponentService {
|
||||
query1.eq("code", componentType);
|
||||
EbikeComponentInventorycount ebikeComponentInventorycount = ebikeComponentInventorycountMapper.selectOneByQuery(query1);
|
||||
if (ebikeComponentInventorycount != null) {
|
||||
ebikeComponentInventorycount.setCount(ebikeComponentInventorycount.getCount() + size);
|
||||
ebikeComponentInventorycount.setItemCount(ebikeComponentInventorycount.getItemCount() + size);
|
||||
ebikeComponentInventorycountMapper.update(ebikeComponentInventorycount);
|
||||
}
|
||||
}
|
||||
@ -424,7 +424,7 @@ public class EbikeComponentServiceImpl implements EbikeComponentService {
|
||||
if (ebikeComponentInventorycount == null) {
|
||||
return JsonResult.failed("未找到相应的部件库存信息");
|
||||
}
|
||||
Integer count = ebikeComponentInventorycount.getCount(); // 获取剩余数量
|
||||
long count = ebikeComponentInventorycount.getItemCount(); // 获取剩余数量
|
||||
String name = ebikeComponentInventorycount.getName(); // 获取部件名称
|
||||
// 判断库存是否足够
|
||||
if (stockInType == 1 && count < outQuantity) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user