Commit 6a3e641c by 李小惠

修改出入库数据结构以及涉及到的接口,修改记账接口

parent 73f369aa
......@@ -19,5 +19,4 @@ public class DetailJsonReq {
//Epc类型(0固定资产1库存物资非固定资产)
private Integer property;
private List<DetailJsonReq> childDetailJson;
}
......@@ -14,7 +14,7 @@ public class UpdateEquipmentSizeReq {
@NotBlank(message = "装备号型主键不能为空", groups = {ValidationApi.edit.class, ValidationApi.delete.class, ValidationApi.detail.class})
private String id;
@NotBlank(message = "装备类型id不能为空", groups = {ValidationApi.edit.class, ValidationApi.add.class})
@NotBlank(message = "装备类型id不能为空", groups = { ValidationApi.add.class})
private String typeId;
private String code;
......
......@@ -18,16 +18,16 @@ public class UpdateEquipmentTypeReq {
private String state;
private String unitType;
@NotBlank(message = "编码不能为空", groups = {ValidationApi.edit.class, ValidationApi.add.class})
// @NotBlank(message = "编码不能为空", groups = { ValidationApi.add.class})
private String code;
@NotBlank(message = "名称不能为空", groups = {ValidationApi.edit.class, ValidationApi.add.class})
private String name;
private String nickName;
private String note;
@NotBlank(message = "上级不能为空", groups = {ValidationApi.edit.class, ValidationApi.add.class})
@NotBlank(message = "上级不能为空", groups = { ValidationApi.add.class})
private String parentId;
@NotBlank(message = "上级集合不能为空", groups = {ValidationApi.edit.class, ValidationApi.add.class})
@NotBlank(message = "上级集合不能为空", groups = { ValidationApi.add.class})
private String parentIds;
private int warrantyPeriod;
......
......@@ -11,6 +11,7 @@ public enum WarehouseExceptionEnum implements IExceptionEnum {
* 仓库信息不存在
*/
WAREHOUSE_NOT_EXIST(CommonConstant.DEFAULT_USER_ERROR_CODE + JYZBConstant.JYZB_EXCEPTION_STEP_CODE + 12, "仓库信息不存在"),
WAREHOUSE_IS_LOCKED(CommonConstant.DEFAULT_USER_ERROR_CODE + JYZBConstant.JYZB_EXCEPTION_STEP_CODE + 12, "仓库锁库中,记账失败"),
;
......
......@@ -179,7 +179,11 @@ public class EquipmentTypeServiceImpl extends ServiceImpl<EquipmentTypeMapper, E
.collect(Collectors.toSet());
// 获取传入的supplierList中的所有供应商ID集合
Set<String> newSupplierIds = new HashSet<>(req.getSupplierList());
Set<String> newSupplierIds=new HashSet<>();
if (CollectionUtil.isNotEmpty(req.getSupplierList())){
newSupplierIds = new HashSet<>(req.getSupplierList());
}
// 需要新增的供应商关联数据
List<SupplierType> supplierTypeToAdd = new ArrayList<>();
......
......@@ -126,8 +126,8 @@ public class LogSummaryServiceImpl extends ServiceImpl<LogSummaryMapper, LogSumm
boolean c1=true;
if (ObjectUtil.isNotNull(order)){
//设置出入库仓库以及出入库数量
List<DetailJsonReq> detailJson = order.getDetailJson();
String jsonString = JSONObject.toJSONString(detailJson);
// List<DetailJsonReq> detailJson = order.getDetailJson();
// String jsonString = JSONObject.toJSONString(detailJson);
List<DetailOrderReq> orderDetailList = order.getOrderDetail();
OrderMain one = orderMainService.getOne(new LambdaQueryWrapper<OrderMain>()
.eq(OrderMain::getId, order.getId()));
......@@ -136,7 +136,7 @@ public class LogSummaryServiceImpl extends ServiceImpl<LogSummaryMapper, LogSumm
one.setActualQuantity(0);
}
// one.setActualQuantity(order.getActualQuantity()+one.getActualQuantity());
one.setDetailJson(jsonString);
// one.setDetailJson(jsonString);
one.setActualQuantity(order.getActualQuantity());
one.setOrderState(one.getOrderState());
one.setOrderState("finished");
......@@ -152,8 +152,10 @@ public class LogSummaryServiceImpl extends ServiceImpl<LogSummaryMapper, LogSumm
orderDetail.setActualNum(0);
}
// orderDetail.setModifyQuantity(orderDetail.getActualNum()+detailReq.getActualNum());
orderDetail.setDetailJson(JSONObject.toJSONString(detailReq.getDetailJson()));
orderDetail.setModifyQuantity(detailReq.getActualNum());
orderDetail.setActualNum(detailReq.getActualNum());
orderDetail.setActualTotalPrice(detailReq.getPrice());
orderDetail.setUpdateTime(DateTimeUtil.getCurrentDateTime());
flag=true;
break;
......@@ -162,6 +164,7 @@ public class LogSummaryServiceImpl extends ServiceImpl<LogSummaryMapper, LogSumm
if (!flag){
orderDetail.setActualNum(0);
orderDetail.setModifyQuantity(0);
orderDetail.setActualTotalPrice(BigDecimal.ZERO);
orderDetail.setUpdateTime(DateTimeUtil.getCurrentDateTime());
}
}
......@@ -307,14 +310,14 @@ public class LogSummaryServiceImpl extends ServiceImpl<LogSummaryMapper, LogSumm
string=string+logSummary.getLocationName()+":出库【"+logSummary.getEquipmentList()+"】,数量:"+logSummary.getNumber()+"\n";
}
LogSummary logSummaryQuick=new LogSummary();
if (logreq.getBussinessType().equals("quick")){
if (logreq.getBussinessType().equals("quick")){//如果是快速出库的同时需要创建快速入库
logSummaryQuick= saveLogSummary(logreq,ordermain.getLocationId(),ordermain.getLocationName(),"in");
sumList.add(logSummaryQuick);
stringQuick=stringQuick+logSummaryQuick.getLocationName()+":入库【"+logSummaryQuick.getEquipmentList()+"】,数量:"+logSummary.getNumber()+"\n";
}
sumList.add(logSummary);
logSummaryService.saveBatch(sumList);
sumList.clear();
Map<String, String> map = setState(logreq.getOutInState(), logreq.getBussinessType());
......@@ -347,9 +350,9 @@ public class LogSummaryServiceImpl extends ServiceImpl<LogSummaryMapper, LogSumm
// }
}
//如果是快速移库,那么直接将物资的locationId进行修改
// //如果是快速移库,那么直接将物资的locationId进行修改
if(logreq.getBussinessType().equals("quick")){
Inventory inventory = saveInventory(logreq.getOrgId(),logreq.getLocationId(),logreq,detailLogReq, map, logSummary.getOutInState());
Inventory inventory = saveInventory(logreq.getOrgId(),ordermain.getLocationId(),logreq,detailLogReq, map, "in");
inventoryList.add(inventory);
}
//存放logdetail信息
......@@ -404,6 +407,7 @@ public class LogSummaryServiceImpl extends ServiceImpl<LogSummaryMapper, LogSumm
LambdaUpdateWrapper<Inventory> allocateInWrapper1 = Wrappers.lambdaUpdate();
LambdaUpdateWrapper<WarehouseInventory> updateStateWrapper2 = Wrappers.lambdaUpdate();
LambdaUpdateWrapper<WarehouseInventory> allocateInWrapper2 = Wrappers.lambdaUpdate();
LambdaQueryWrapper<WarehouseInventory> destroyOutWrapper =Wrappers.lambdaQuery();
for (Inventory inventory:inventoryList) {
if (inventory.getBussinessType().equals("allocate") && inventory.getLocationState().equals("in") && !ObjectUtil.isNull(ordermain)){
//调拨入库
......@@ -426,7 +430,14 @@ public class LogSummaryServiceImpl extends ServiceImpl<LogSummaryMapper, LogSumm
.set(WarehouseInventory::getOrgId,null)
.set(WarehouseInventory::getLocationId,null)
.set(WarehouseInventory::getLocationState,"out");
}else {
}else if (inventory.getBussinessType().equals("destruction")){
updateStateWrapper1.or().eq(Inventory::getEpc,inventory.getEpc())
.set(Inventory::getLocationState,"out")
.set(Inventory::getBussinessState,"destruction")
.set(Inventory::getLocationId,inventory.getLocationId())
.set(Inventory::getState,"destory");
destroyOutWrapper.or().eq(WarehouseInventory::getEpc,inventory.getEpc());
}else{
//其他情况
if (inventory.getBussinessType().equals("quick")){
updateStateWrapper1.or().eq(Inventory::getEpc,inventory.getEpc())
......@@ -446,8 +457,10 @@ public class LogSummaryServiceImpl extends ServiceImpl<LogSummaryMapper, LogSumm
updateStateWrapper2.or().eq(WarehouseInventory::getEpc,inventory.getEpc())
.set(WarehouseInventory::getLocationState,inventory.getLocationState());
}
}
}
......@@ -458,7 +471,7 @@ public class LogSummaryServiceImpl extends ServiceImpl<LogSummaryMapper, LogSumm
warehouseInventoryService.update(updateStateWrapper2);
}
System.out.println(1111);
if (!allocateInWrapper1.isEmptyOfWhere()){
inventoryService.update(allocateInWrapper1);
......
......@@ -319,10 +319,10 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
case "quickOrder":
//更新出入库单
//将销毁数加回来
if (bussinessType.equals("destruction")){
List<UpdateOrderDetailReq> list=quickSuggestionsMapper.getOrderMainDetail(task.getProcessInstanceId());
boolean b = addOrRevokeAgentDestructionNum(list);
}
// if (bussinessType.equals("destruction")){
// List<UpdateOrderDetailReq> list=quickSuggestionsMapper.getOrderMainDetail(task.getProcessInstanceId());
// boolean b = addOrRevokeAgentDestructionNum(list);
// }
quickSuggestionsMapper.updateOrderMain(task.getProcessInstanceId());
break;
case "bussinessOrder":
......@@ -1102,6 +1102,7 @@ return null;
List<Object[]> searchItem=new ArrayList<>();
for (UpdateOrderDetailReq detialReq:list) {
//我先去数据库查询summary表中的数据
Object[] item=new Object[]{detialReq.getOrgId(),detialReq.getWarehouseId(),detialReq.getTypeId(),detialReq.getSizeId(),detialReq.getPrice()};
searchItem.add(item);
}
......@@ -1111,7 +1112,7 @@ return null;
for (InventorySummaryReq is:inventorySummaryList) {
if (detialReq.getWarehouseId().equals(is.getLocationId()) && detialReq.getTypeId().equals(is.getTypeId())
&& detialReq.getSizeId().equals(is.getSizeId()) && detialReq.getPrice().compareTo(is.getUnitPrice())==0){
&& detialReq.getSizeId().equals(is.getSizeId()) && new BigDecimal(detialReq.getPrice()).compareTo(is.getUnitPrice())==0){
if (ObjectUtil.isNull(is.getDestructionNumber())){
is.setDestructionNumber(0);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论