Commit ee0c4727 by 李小惠

修改基础信息存在的问题,新增号型标签类型参数

parent b2d73920
...@@ -81,4 +81,7 @@ public class EquipmentSizeDto { ...@@ -81,4 +81,7 @@ public class EquipmentSizeDto {
private String maintenancePeriod; private String maintenancePeriod;
private String warrantyPeriod; private String warrantyPeriod;
//EPc类型,1,单标签,2双标签,3三标签,往后递推
private Integer epcType;
} }
...@@ -4,6 +4,7 @@ import lombok.AllArgsConstructor; ...@@ -4,6 +4,7 @@ import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import java.math.BigDecimal;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
...@@ -24,6 +25,7 @@ public class EquipmentTypeDto { ...@@ -24,6 +25,7 @@ public class EquipmentTypeDto {
private Boolean isLeaf; private Boolean isLeaf;
private List<String> supplierList; private List<String> supplierList;
private String photo; private String photo;
private BigDecimal price;
private Integer childCount; private Integer childCount;
private List<EquipmentTypeDto> children = new ArrayList<>(); private List<EquipmentTypeDto> children = new ArrayList<>();
......
...@@ -31,4 +31,6 @@ public class UpdateEquipmentSizeReq { ...@@ -31,4 +31,6 @@ public class UpdateEquipmentSizeReq {
private String instructions; private String instructions;
private Long updateTime; private Long updateTime;
//EPc类型,1,单标签,2双标签,3三标签,往后递推
private Integer epcType;
} }
...@@ -5,6 +5,7 @@ import lombok.Data; ...@@ -5,6 +5,7 @@ import lombok.Data;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
...@@ -39,4 +40,8 @@ public class UpdateEquipmentTypeReq { ...@@ -39,4 +40,8 @@ public class UpdateEquipmentTypeReq {
private List<String> supplierList; private List<String> supplierList;
private Long updateTime; private Long updateTime;
private BigDecimal price;
private Integer epcType;
} }
...@@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; ...@@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
...@@ -123,6 +124,9 @@ public class EquipmentType implements Serializable { ...@@ -123,6 +124,9 @@ public class EquipmentType implements Serializable {
@ApiModelProperty(value = "物资阈值") @ApiModelProperty(value = "物资阈值")
private Integer threshold; private Integer threshold;
@ApiModelProperty(value = "单价")
private BigDecimal price;
......
...@@ -16,10 +16,7 @@ import com.junmp.jyzb.api.exception.enums.EquipmentExceptionEnum; ...@@ -16,10 +16,7 @@ import com.junmp.jyzb.api.exception.enums.EquipmentExceptionEnum;
import com.junmp.jyzb.entity.*; import com.junmp.jyzb.entity.*;
import com.junmp.jyzb.mapper.EquipmentCountSummaryMapper; import com.junmp.jyzb.mapper.EquipmentCountSummaryMapper;
import com.junmp.jyzb.mapper.PriceSumSummaryMapper; import com.junmp.jyzb.mapper.PriceSumSummaryMapper;
import com.junmp.jyzb.service.EquipmentTypeService; import com.junmp.jyzb.service.*;
import com.junmp.jyzb.service.InventorySummaryService;
import com.junmp.jyzb.service.SupplierService;
import com.junmp.jyzb.service.SupplierTypeService;
import com.junmp.jyzb.utils.*; import com.junmp.jyzb.utils.*;
import com.junmp.v2.common.exception.base.ServiceException; import com.junmp.v2.common.exception.base.ServiceException;
import com.junmp.v2.common.util.BeanPlusUtil; import com.junmp.v2.common.util.BeanPlusUtil;
...@@ -55,6 +52,9 @@ public class EquipmentTypeServiceImpl extends ServiceImpl<EquipmentTypeMapper, E ...@@ -55,6 +52,9 @@ public class EquipmentTypeServiceImpl extends ServiceImpl<EquipmentTypeMapper, E
private PriceSumSummaryMapper priceSumSummaryMapper; private PriceSumSummaryMapper priceSumSummaryMapper;
@Resource @Resource
private EquipmentCountSummaryMapper equipmentCountSummaryMapper; private EquipmentCountSummaryMapper equipmentCountSummaryMapper;
@Resource
private EquipmentSizeService equipmentSizeService;
private static final String REDIS_TYPE = "Type_"; private static final String REDIS_TYPE = "Type_";
private List<EquipmentTypeDto> typeDto; private List<EquipmentTypeDto> typeDto;
private ArrayList<String> ids; private ArrayList<String> ids;
...@@ -149,8 +149,12 @@ public class EquipmentTypeServiceImpl extends ServiceImpl<EquipmentTypeMapper, E ...@@ -149,8 +149,12 @@ public class EquipmentTypeServiceImpl extends ServiceImpl<EquipmentTypeMapper, E
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@Override @Override
public Boolean updateEquipment(UpdateEquipmentTypeReq req) { public Boolean updateEquipment(UpdateEquipmentTypeReq req) {
if (req.getEpcType()!=null){
equipmentSizeService.update(new LambdaUpdateWrapper<EquipmentSize>()
.set(EquipmentSize::getEpcType,req.getEpcType())
.eq(EquipmentSize::getTypeId,req.getId()));
}
EquipmentType type = this.queryEqType(req); EquipmentType type = this.queryEqType(req);
List<String> chekResult = supplierService.CheckSupplierList(req.getSupplierList()); List<String> chekResult = supplierService.CheckSupplierList(req.getSupplierList());
if (chekResult.size() == 0) { if (chekResult.size() == 0) {
// 先增加code码 // 先增加code码
......
...@@ -361,7 +361,6 @@ public class InventoryServiceImpl extends ServiceImpl<InventoryMapper, Inventory ...@@ -361,7 +361,6 @@ public class InventoryServiceImpl extends ServiceImpl<InventoryMapper, Inventory
//新增一条数据 //新增一条数据
InventorySummary inventorySummary = new InventorySummary(); InventorySummary inventorySummary = new InventorySummary();
BeanPlusUtil.copyProperties(req,inventorySummary); BeanPlusUtil.copyProperties(req,inventorySummary);
is.setValuekey(pubOrg.getOrgCode()+req.getTypeId()+req.getSizeId()+req.getLocationId()+req.getPrice());
inventorySummary.setValuekey(pubOrg.getOrgCode()+req.getLocationId()+req.getTypeId()+req.getSizeId()+req.getPrice()); inventorySummary.setValuekey(pubOrg.getOrgCode()+req.getLocationId()+req.getTypeId()+req.getSizeId()+req.getPrice());
inventorySummary.setOrgName(pubOrg.getOrgName()); inventorySummary.setOrgName(pubOrg.getOrgName());
inventorySummary.setOrgCode(pubOrg.getOrgCode()); inventorySummary.setOrgCode(pubOrg.getOrgCode());
...@@ -395,11 +394,12 @@ public class InventoryServiceImpl extends ServiceImpl<InventoryMapper, Inventory ...@@ -395,11 +394,12 @@ public class InventoryServiceImpl extends ServiceImpl<InventoryMapper, Inventory
is.setPrice(is.getUnitPrice().multiply(BigDecimal.valueOf(is.getNumber()))); is.setPrice(is.getUnitPrice().multiply(BigDecimal.valueOf(is.getNumber())));
} }
} }
if (CollectionUtil.isNotEmpty(delList)){
inventorySummaryService.removeBatchByIds(delList);
}
inventorySummaryService.updateBatchById(inventorySummaryList); inventorySummaryService.updateBatchById(inventorySummaryList);
} }
if (CollectionUtil.isNotEmpty(delList)){
inventorySummaryService.removeBatchByIds(delList);
}
} }
List<Inventory> list = list(new LambdaQueryWrapper<Inventory>().in(Inventory::getId, req.getInventoryIdList())); List<Inventory> list = list(new LambdaQueryWrapper<Inventory>().in(Inventory::getId, req.getInventoryIdList()));
......
...@@ -196,6 +196,8 @@ public class LogSummaryServiceImpl extends ServiceImpl<LogSummaryMapper, LogSumm ...@@ -196,6 +196,8 @@ public class LogSummaryServiceImpl extends ServiceImpl<LogSummaryMapper, LogSumm
c1 = warehouseInventoryService.saveBatch(warehouseInventoryList); c1 = warehouseInventoryService.saveBatch(warehouseInventoryList);
c=inventoryService.saveBatch(collect1); c=inventoryService.saveBatch(collect1);
} }
} }
//3.处理出入库记录对象 //3.处理出入库记录对象
...@@ -222,6 +224,8 @@ public class LogSummaryServiceImpl extends ServiceImpl<LogSummaryMapper, LogSumm ...@@ -222,6 +224,8 @@ public class LogSummaryServiceImpl extends ServiceImpl<LogSummaryMapper, LogSumm
// 对出入库记录进行分类汇总存储() // 对出入库记录进行分类汇总存储()
public List<NormalInOutDto> saveInOutRecords(OutInLogsReq req) { public List<NormalInOutDto> saveInOutRecords(OutInLogsReq req) {
//返回结果,用于日常出入库时计算更新库存汇总表 //返回结果,用于日常出入库时计算更新库存汇总表
List<SummaryLogReq> logSummaryList = req.getLogList(); List<SummaryLogReq> logSummaryList = req.getLogList();
...@@ -265,9 +269,9 @@ public class LogSummaryServiceImpl extends ServiceImpl<LogSummaryMapper, LogSumm ...@@ -265,9 +269,9 @@ public class LogSummaryServiceImpl extends ServiceImpl<LogSummaryMapper, LogSumm
normalInOutDto.setOutInState(logSummary.getOutInState()); normalInOutDto.setOutInState(logSummary.getOutInState());
returnList.add(normalInOutDto); returnList.add(normalInOutDto);
} }
//判断logSummary是否为采购 //判断logSummary是否为采购,快速移库,和领用出库
//如果是采购则不处理,因为采购的inventory是跟着单子来处理的,其他的单子直接根据出入库记录来处理 //如果是采购则不处理,因为采购的inventory是跟着单子来处理的,其他的单子直接根据出入库记录来处理
if (!logreq.getBussinessType().equals("purchase")){ if (!logreq.getBussinessType().equals("purchase") && !logreq.getBussinessType().equals("quick") && !logreq.getBussinessType().equals("use")){
// if (logreq.getOutInState().equals("in")){ // if (logreq.getOutInState().equals("in")){
Inventory inventory = saveInventory(logreq.getOrgId(),logreq.getLocationId(),logreq,detailLogReq, map, logSummary.getOutInState()); Inventory inventory = saveInventory(logreq.getOrgId(),logreq.getLocationId(),logreq,detailLogReq, map, logSummary.getOutInState());
inventoryList.add(inventory); inventoryList.add(inventory);
...@@ -278,6 +282,10 @@ public class LogSummaryServiceImpl extends ServiceImpl<LogSummaryMapper, LogSumm ...@@ -278,6 +282,10 @@ public class LogSummaryServiceImpl extends ServiceImpl<LogSummaryMapper, LogSumm
// } // }
} }
//如果是快速移库,那么直接将物资的locationId进行修改
if(logreq.getBussinessType().equals("quick")){
}
//存放logdetail信息 //存放logdetail信息
LogDetail logDetail = new LogDetail(); LogDetail logDetail = new LogDetail();
BeanPlusUtil.copyProperties(detailLogReq, logDetail); BeanPlusUtil.copyProperties(detailLogReq, logDetail);
......
...@@ -1441,8 +1441,52 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain ...@@ -1441,8 +1441,52 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
List<Object[]> searchCriteria=new ArrayList<>(); List<Object[]> searchCriteria=new ArrayList<>();
//新建的入库单查询条件list(根据条件查询库存汇总表中是否包含有相同条件的数据) //新建的入库单查询条件list(根据条件查询库存汇总表中是否包含有相同条件的数据)
List<Object[]> updateCriteria=new ArrayList<>(); List<Object[]> updateCriteria=new ArrayList<>();
addQuickOrder(existOrder,searchCriteria,updateCriteria); //创建新的orderMain入库单
OrderMain orderMain = new OrderMain();
BeanPlusUtil.copyProperties(existOrder,orderMain);
orderMain.setEndOrgId(existOrder.getStartOrgId());
orderMain.setEndOrgName(existOrder.getStartOrgName());
orderMain.setOrderType("in");
orderMain.setId(UUID.randomUUID().toString());
//工作流流程设为空
orderMain.setProcessId(null);
//修改订单编号,设置为入库的单号
UpdateOrderReq req = new UpdateOrderReq();
BeanPlusUtil.copyProperties(orderMain,req);
OrderNum orderNum = setOrderCode(req);
String codeValue=String.format("%04d",orderNum.getNum());
orderMain.setOrderCode(orderNum.getBussinessType()+orderNum.getYear()+
String.format("%02d",LocalDateTime.now().getMonth().getValue())+
String.format("%02d",LocalDateTime.now().getDayOfMonth())+codeValue);
//保存入库单
save(orderMain);
//查询出库子单用于赋值到入库单中
List<OrderDetail> list = orderDetailService.list(new LambdaQueryWrapper<OrderDetail>()
.eq(OrderDetail::getOrderId, existOrder.getId()));
//查询条件,将所有查询条件放在searchCriteria中,用于修改库存表中的装备的仓库位置
//仓库id
String locationId = orderMain.getLocationId();
String locationName = orderMain.getLocationName();
//创建入库单子单
List<OrderDetail> collect = list.stream().map(orderDetail -> {
OrderDetail orderDetail1 = new OrderDetail();
BeanPlusUtil.copyProperties(orderDetail, orderDetail1);
orderDetail1.setId(null);
//修改主单据id
orderDetail1.setOrderId(orderMain.getId());
//修改单据出入状态
orderDetail1.setType("in");
//修改仓库id
orderDetail1.setWarehouseId(locationId);
orderDetail1.setWarehouseName(locationName);
Object[] criteria=new Object[]{existOrder.getStartOrgId(),orderDetail.getWarehouseId(),orderDetail.getTypeId(),orderDetail.getSizeId(),orderDetail.getPrice()};
searchCriteria.add(criteria);
Object[] update=new Object[]{orderMain.getEndOrgId(),locationId,orderDetail1.getTypeId(),orderDetail1.getSizeId(),orderDetail1.getPrice()};
updateCriteria.add(update);
return orderDetail1;
}).collect(Collectors.toList());
orderDetailService.saveBatch(collect);
//将summary汇总表中数据进行修改(修改该组织机构下的装备汇总信息将库存信息的在库数,库存总数,总价还有其他数据数量进行修改) //将summary汇总表中数据进行修改(修改该组织机构下的装备汇总信息将库存信息的在库数,库存总数,总价还有其他数据数量进行修改)
//那么首先将原来的仓库下的装备汇总信息进行查询出来,对其进行修改 //那么首先将原来的仓库下的装备汇总信息进行查询出来,对其进行修改
...@@ -1450,100 +1494,100 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain ...@@ -1450,100 +1494,100 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
//其次查询出修改后的仓库下面的汇总信息,判断该仓库下是否已经存在该号型、类型、单价相同的装备数据 //其次查询出修改后的仓库下面的汇总信息,判断该仓库下是否已经存在该号型、类型、单价相同的装备数据
List<InventorySummary> newSummaryList = inventorySummaryMapper.selectSumByItems(updateCriteria); List<InventorySummary> newSummaryList = inventorySummaryMapper.selectSumByItems(updateCriteria);
//第一步:判断是否将报废区的数据也同样进行移库(flag=true表示将报废区的数量进行一起移动),如果都没有报废数量,默认是true; //第一步:判断是否将报废区的数据也同样进行移库(flag=true表示将报废区的数量进行一起移动),如果都没有报废数量,默认是true;
// boolean flag = oldSummaryList.stream() boolean flag = oldSummaryList.stream()
// .noneMatch(oldsum -> oldsum.getBrokenNumber() > 0) .noneMatch(oldsum -> oldsum.getBrokenNumber() > 0)
// || oldSummaryList.stream() || oldSummaryList.stream()
// .filter(oldsum -> oldsum.getBrokenNumber() > 0) .filter(oldsum -> oldsum.getBrokenNumber() > 0)
// .anyMatch(oldsum -> list.stream() .anyMatch(oldsum -> list.stream()
// .anyMatch(orderDetail -> orderDetail.getSizeId().equals(oldsum.getSizeId()) .anyMatch(orderDetail -> orderDetail.getSizeId().equals(oldsum.getSizeId())
// && orderDetail.getTypeId().equals(oldsum.getTypeId()) && orderDetail.getTypeId().equals(oldsum.getTypeId())
// && orderDetail.getPrice().compareTo(oldsum.getUnitPrice()) == 0 && orderDetail.getPrice().compareTo(oldsum.getUnitPrice()) == 0
// && oldsum.getBrokenNumber() + orderDetail.getPlanNum() == oldsum.getStockNumber()) && oldsum.getBrokenNumber() + orderDetail.getPlanNum() == oldsum.getStockNumber())
// ); );
//创建删除列表用于将没用的数据汇总信息进行删除 //创建删除列表用于将没用的数据汇总信息进行删除
List<InventorySummary> deleteList=new ArrayList<>(); List<InventorySummary> deleteList=new ArrayList<>();
//将修改的信息直接保存(需要的只是各种数量方便计算) //将修改的信息直接保存(需要的只是各种数量方便计算)
List<InventorySummary> saveList=new ArrayList<>(); List<InventorySummary> saveList=new ArrayList<>();
//如果整个报废区进行移动,那么将各个数量进行修改 //如果整个报废区进行移动,那么将各个数量进行修改
// if (flag){ if (flag){
// //修改的的是移出仓库的数量 //修改的的是移出仓库的数量
// for (OrderDetail orderDetail: list ) { for (OrderDetail orderDetail: list ) {
// for (InventorySummary oldSum : oldSummaryList) { for (InventorySummary oldSum : oldSummaryList) {
// //如果组织机构、仓库id、sizeId、typeId、unitPrice相同,那么修改其各项数值(不会存在两个列表长度不对等的情况,一定是一对一的,只不过是顺序问题,所以需要进行遍历) //如果组织机构、仓库id、sizeId、typeId、unitPrice相同,那么修改其各项数值(不会存在两个列表长度不对等的情况,一定是一对一的,只不过是顺序问题,所以需要进行遍历)
// if (orderDetail.getSizeId().equals(oldSum.getSizeId()) if (orderDetail.getSizeId().equals(oldSum.getSizeId())
// && orderDetail.getTypeId().equals(oldSum.getTypeId()) && orderDetail.getTypeId().equals(oldSum.getTypeId())
// && orderDetail.getPrice().compareTo(oldSum.getUnitPrice()) == 0) { && orderDetail.getPrice().compareTo(oldSum.getUnitPrice()) == 0) {
// InventorySummary inventorySummary = new InventorySummary(); InventorySummary inventorySummary = new InventorySummary();
// BeanPlusUtil.copyProperties(oldSum,inventorySummary); BeanPlusUtil.copyProperties(oldSum,inventorySummary);
// inventorySummary.setLocationId(locationId); inventorySummary.setLocationId(locationId);
// inventorySummary.setLocationName(locationName); inventorySummary.setLocationName(locationName);
// inventorySummary.setNumber(orderDetail.getPlanNum()+oldSum.getOutboundNumber()); inventorySummary.setNumber(orderDetail.getPlanNum()+oldSum.getOutboundNumber());
// inventorySummary.setPrice(orderDetail.getPrice().multiply(BigDecimal.valueOf(orderDetail.getPlanNum()))); inventorySummary.setPrice(orderDetail.getPrice().multiply(BigDecimal.valueOf(orderDetail.getPlanNum())));
// inventorySummary.setStockNumber(orderDetail.getPlanNum()); inventorySummary.setStockNumber(orderDetail.getPlanNum());
// inventorySummary.setDestructionNumber(0); inventorySummary.setDestructionNumber(0);
// //销毁金额也为0 //销毁金额也为0
// inventorySummary.setDestructionPrice(BigDecimal.ZERO); inventorySummary.setDestructionPrice(BigDecimal.ZERO);
// inventorySummary.setId(null); inventorySummary.setId(null);
// inventorySummary.setValuekey(null); inventorySummary.setValuekey(null);
// saveList.add(inventorySummary); saveList.add(inventorySummary);
// //如果存在删减数量完成之后所有的数量值都是0的情况,那么将这一条数据进行删除操作 //如果存在删减数量完成之后所有的数量值都是0的情况,那么将这一条数据进行删除操作
// if (oldSum.getDestructionNumber() == 0) { if (oldSum.getDestructionNumber() == 0) {
// deleteList.add(oldSum); deleteList.add(oldSum);
// }else { }else {
// oldSum.setBrokenNumber(0); oldSum.setBrokenNumber(0);
// oldSum.setNumber(0); oldSum.setNumber(0);
// oldSum.setPrice(BigDecimal.ZERO); oldSum.setPrice(BigDecimal.ZERO);
// oldSum.setStockNumber(0); oldSum.setStockNumber(0);
// oldSum.setOutboundNumber(0); oldSum.setOutboundNumber(0);
// oldSum.setUseNumber(0); oldSum.setUseNumber(0);
// oldSum.setExpireNumber(0); oldSum.setExpireNumber(0);
// oldSum.setNearBrokenNumber(0); oldSum.setNearBrokenNumber(0);
// } }
// break;//查询到直接跳过该循环进入下一循环 break;//查询到直接跳过该循环进入下一循环
// } }
// } }
// } }
// }else {//不将报废区的进行移动(修改的是移出仓库的库存数量) }else {//不将报废区的进行移动(修改的是移出仓库的库存数量)
// for (OrderDetail orderDetail: list ) { for (OrderDetail orderDetail: list ) {
// for (InventorySummary oldSum : oldSummaryList) { for (InventorySummary oldSum : oldSummaryList) {
// //如果组织机构、仓库id、sizeId、typeId、unitPrice相同,那么修改其各项数值( //如果组织机构、仓库id、sizeId、typeId、unitPrice相同,那么修改其各项数值(
// // 不会存在两个列表长度不对等的情况,一定是一对一的,只不过是顺序问题,所以需要进行遍历) // 不会存在两个列表长度不对等的情况,一定是一对一的,只不过是顺序问题,所以需要进行遍历)
// if (orderDetail.getSizeId().equals(oldSum.getSizeId()) if (orderDetail.getSizeId().equals(oldSum.getSizeId())
// && orderDetail.getTypeId().equals(oldSum.getTypeId()) && orderDetail.getTypeId().equals(oldSum.getTypeId())
// && orderDetail.getPrice().compareTo(oldSum.getUnitPrice()) == 0) { && orderDetail.getPrice().compareTo(oldSum.getUnitPrice()) == 0) {
// InventorySummary inventorySummary = new InventorySummary(); InventorySummary inventorySummary = new InventorySummary();
// BeanPlusUtil.copyProperties(oldSum,inventorySummary); BeanPlusUtil.copyProperties(oldSum,inventorySummary);
// inventorySummary.setLocationId(locationId); inventorySummary.setLocationId(locationId);
// inventorySummary.setLocationName(locationName); inventorySummary.setLocationName(locationName);
// //在库数量进行修改并且报废数设为0 //在库数量进行修改并且报废数设为0
// inventorySummary.setBrokenNumber(0); inventorySummary.setBrokenNumber(0);
// inventorySummary.setNumber(orderDetail.getPlanNum()+oldSum.getOutboundNumber()); inventorySummary.setNumber(orderDetail.getPlanNum()+oldSum.getOutboundNumber());
// inventorySummary.setPrice(orderDetail.getPrice().multiply(BigDecimal.valueOf(orderDetail.getPlanNum()+oldSum.getOutboundNumber()))); inventorySummary.setPrice(orderDetail.getPrice().multiply(BigDecimal.valueOf(orderDetail.getPlanNum()+oldSum.getOutboundNumber())));
// inventorySummary.setStockNumber(orderDetail.getPlanNum()); inventorySummary.setStockNumber(orderDetail.getPlanNum());
// inventorySummary.setDestructionNumber(0); inventorySummary.setDestructionNumber(0);
// inventorySummary.setDestructionPrice(BigDecimal.ZERO); inventorySummary.setDestructionPrice(BigDecimal.ZERO);
// inventorySummary.setId(null); inventorySummary.setId(null);
// inventorySummary.setValuekey(null); inventorySummary.setValuekey(null);
// saveList.add(inventorySummary); saveList.add(inventorySummary);
//
// oldSum.setNumber(oldSum.getNumber()-orderDetail.getPlanNum()); oldSum.setNumber(oldSum.getNumber()-orderDetail.getPlanNum());
// oldSum.setPrice(oldSum.getPrice().subtract(orderDetail.getPrice().multiply(BigDecimal.valueOf(orderDetail.getPlanNum())))); oldSum.setPrice(oldSum.getPrice().subtract(orderDetail.getPrice().multiply(BigDecimal.valueOf(orderDetail.getPlanNum()))));
// oldSum.setStockNumber(oldSum.getNumber()-orderDetail.getPlanNum()); oldSum.setStockNumber(oldSum.getNumber()-orderDetail.getPlanNum());
// oldSum.setOutboundNumber(0); oldSum.setOutboundNumber(0);
// oldSum.setNearBrokenNumber(0); oldSum.setNearBrokenNumber(0);
// oldSum.setExpireNumber(0); oldSum.setExpireNumber(0);
// oldSum.setUseNumber(0); oldSum.setUseNumber(0);
//
// //如果存在删减数量完成之后所有的数量值都是0的情况,那么将这一条数据进行删除操作 //如果存在删减数量完成之后所有的数量值都是0的情况,那么将这一条数据进行删除操作
// if (oldSum.getBrokenNumber()==0&& oldSum.getDestructionNumber() == 0) { if (oldSum.getBrokenNumber()==0&& oldSum.getDestructionNumber() == 0) {
// deleteList.add(oldSum); deleteList.add(oldSum);
// } }
// break;//查询到直接跳过该循环进入下一循环 break;//查询到直接跳过该循环进入下一循环
// } }
// } }
// } }
// } }
//判断查询到的newList是否有值,如果有值直接进行修改即可,但是如果不存在,则默认新增一条数据 //判断查询到的newList是否有值,如果有值直接进行修改即可,但是如果不存在,则默认新增一条数据
//修改的是移入仓库的值 //修改的是移入仓库的值
...@@ -1587,10 +1631,10 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain ...@@ -1587,10 +1631,10 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
totalSumList.addAll(newSummaryList); totalSumList.addAll(newSummaryList);
boolean c =inventorySummaryService.updateBatchById(totalSumList); boolean c =inventorySummaryService.updateBatchById(totalSumList);
//将库存表inventory中的装备的仓库id进行修改 // //将库存表inventory中的装备的仓库id进行修改
//需要判断是否将报废区的数据进行移库,如果移动,那么所有的装备修改仓库id // //需要判断是否将报废区的数据进行移库,如果移动,那么所有的装备修改仓库id
//如果保留报废区,那么将报废区的数量不进行修改,其余数据进行修改 // //如果保留报废区,那么将报废区的数量不进行修改,其余数据进行修改
List<Inventory> eqsList = inventoryService.selectEqsByItem(searchCriteria); // List<Inventory> eqsList = inventoryService.selectEqsByItem(searchCriteria);
// for (Inventory inventory : eqsList) { // for (Inventory inventory : eqsList) {
// for (OrderDetail detail2 : collect) { // for (OrderDetail detail2 : collect) {
// if (inventory.getOrgId().equals(existOrder.getStartOrgId()) // if (inventory.getOrgId().equals(existOrder.getStartOrgId())
...@@ -1603,62 +1647,10 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain ...@@ -1603,62 +1647,10 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
// } // }
// } // }
// } // }
boolean d=inventoryService.updateBatchById(eqsList); // boolean d=inventoryService.updateBatchById(eqsList);
return a && b && c && d; return a && b && c;
} }
private Map<String,Object> addQuickOrder (OrderMain existOrder,List<Object[]> searchCriteria,List<Object[]> updateCriteria){
//创建新的orderMain入库单
OrderMain orderMain = new OrderMain();
BeanPlusUtil.copyProperties(existOrder,orderMain);
orderMain.setEndOrgId(existOrder.getStartOrgId());
orderMain.setEndOrgName(existOrder.getStartOrgName());
orderMain.setOrderType("in");
orderMain.setId(UUID.randomUUID().toString());
//工作流流程设为空
orderMain.setProcessId(null);
//修改订单编号,设置为入库的单号
UpdateOrderReq req = new UpdateOrderReq();
BeanPlusUtil.copyProperties(orderMain,req);
OrderNum orderNum = setOrderCode(req);
String codeValue=String.format("%04d",orderNum.getNum());
orderMain.setOrderCode(orderNum.getBussinessType()+orderNum.getYear()+
String.format("%02d",LocalDateTime.now().getMonth().getValue())+
String.format("%02d",LocalDateTime.now().getDayOfMonth())+codeValue);
//保存入库单
save(orderMain);
//查询出库子单用于赋值到入库单中
List<OrderDetail> list = orderDetailService.list(new LambdaQueryWrapper<OrderDetail>()
.eq(OrderDetail::getOrderId, existOrder.getId()));
//查询条件,将所有查询条件放在searchCriteria中,用于修改库存表中的装备的仓库位置
//仓库id
String locationId = orderMain.getLocationId();
String locationName = orderMain.getLocationName();
//创建入库单子单
List<OrderDetail> collect = list.stream().map(orderDetail -> {
OrderDetail orderDetail1 = new OrderDetail();
BeanPlusUtil.copyProperties(orderDetail, orderDetail1);
orderDetail1.setId(null);
//修改主单据id
orderDetail1.setOrderId(orderMain.getId());
//修改单据出入状态
orderDetail1.setType("in");
//修改仓库id
orderDetail1.setWarehouseId(locationId);
orderDetail1.setWarehouseName(locationName);
Object[] criteria=new Object[]{existOrder.getStartOrgId(),orderDetail.getWarehouseId(),orderDetail.getTypeId(),orderDetail.getSizeId(),orderDetail.getPrice()};
searchCriteria.add(criteria);
Object[] update=new Object[]{orderMain.getEndOrgId(),locationId,orderDetail1.getTypeId(),orderDetail1.getSizeId(),orderDetail1.getPrice()};
updateCriteria.add(update);
return orderDetail1;
}).collect(Collectors.toList());
orderDetailService.saveBatch(collect);
Map<String,Object> map=new HashMap<>();
map.put("list",list);
return map;
}
......
...@@ -831,10 +831,10 @@ public class PubOrgServiceImpl extends ServiceImpl<PubOrgMapper, PubOrg> implem ...@@ -831,10 +831,10 @@ public class PubOrgServiceImpl extends ServiceImpl<PubOrgMapper, PubOrg> implem
//修改组织机构信息 //修改组织机构信息
@Override @Override
public boolean updatePubOrg(UpdateOrgReq req) { public boolean updatePubOrg(UpdateOrgReq req) {
List<PubOrg> list = list(new LambdaQueryWrapper<PubOrg>().eq(PubOrg::getOrgName, req.getOrgName())); // List<PubOrg> list = list(new LambdaQueryWrapper<PubOrg>().eq(PubOrg::getOrgName, req.getOrgName()));
if (list.size()>0){ // if (list.size()>0){
throw new ServiceException(PubOrgExceptionEnum.ORG_IS_EXIST); // throw new ServiceException(PubOrgExceptionEnum.ORG_IS_EXIST);
} // }
PubOrg pubOrg = new PubOrg(); PubOrg pubOrg = new PubOrg();
BeanPlusUtil.copyProperties(req,pubOrg); BeanPlusUtil.copyProperties(req,pubOrg);
return updateById(pubOrg); return updateById(pubOrg);
......
...@@ -164,14 +164,14 @@ ...@@ -164,14 +164,14 @@
FROM vie_price_sum_summary vpss FROM vie_price_sum_summary vpss
left join pub_org po on vpss.org_id_int=po.org_id left join pub_org po on vpss.org_id_int=po.org_id
where vpss.`year`= #{year} and po.del_flag=1 where vpss.`year`= #{year} and po.del_flag=1
AND (po.org_id = org_id_param OR (`po`.org_parent_ids like CONCAT('%', org_id_param, '%') AND (po.org_id = #{orgId} OR (`po`.org_parent_ids like CONCAT('%', #{orgId}, '%')
AND(case when #{levelFlag} >=3 then 1=1 else SUBSTRING(`po`.`org_code`, 5, 2) = '00' end )) AND(case when #{levelFlag} >=3 then 1=1 else SUBSTRING(`po`.`org_code`, 5, 2) = '00' end ))
AND ( AND (
`po`.`level_flag` > ( `po`.`level_flag` > (
SELECT `level_flag` FROM `pub_org` WHERE `org_id` = org_id_param SELECT `level_flag` FROM `pub_org` WHERE `org_id` = #{orgId}
) + 1 ) + 1
OR (`po`.`level_flag` = ( OR (`po`.`level_flag` = (
SELECT `level_flag` FROM `pub_org` WHERE `org_id` = org_id_param SELECT `level_flag` FROM `pub_org` WHERE `org_id` = #{orgId}
)))) ))))
<if test="typeIdsList!=null and typeIdsList.size() > 0"> <if test="typeIdsList!=null and typeIdsList.size() > 0">
and type_id in and type_id in
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论