Commit 5b2aea09 by 李小惠

增加记账记空账的情况代码,修改批量编辑装备单价接口bug

parent a372d46d
......@@ -1403,7 +1403,7 @@ Was expecting one of:
at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.execute(MybatisMapperMethod.java:77)
at com.baomidou.mybatisplus.core.override.MybatisMapperProxy$PlainMethodInvoker.invoke(MybatisMapperProxy.java:148)
at com.baomidou.mybatisplus.core.override.MybatisMapperProxy.invoke(MybatisMapperProxy.java:89)
at com.sun.proxy.$Proxy273.GetDetailByTerms(Unknown Source)
at com.sun.proxy.$Proxy273.s(Unknown Source)
at com.junmp.jyzb.service.impl.InventoryServiceImpl.GetDetailByTerms(InventoryServiceImpl.java:305)
at com.junmp.jyzb.service.impl.InventoryServiceImpl$$FastClassBySpringCGLIB$$43c51e0c.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -32,7 +32,7 @@ public class OutInLogsReceiver {
*/
@Resource
private LogRecordApi logRecordApi;
@RabbitListener(queues = "11111")//监听队列名
@RabbitListener(queues = "orderResult")//监听队列名
private void a(String msg, Channel channel, @Header(AmqpHeaders.DELIVERY_TAG) long deliveryTag){
LogRecordDto logRecordDTO = LogRecordFactory.createLogRecord(LogConstant.LOG_DEFAULT_NAME, "CabinetLogsRecord");
......
......@@ -312,237 +312,10 @@ public class InventoryServiceImpl extends ServiceImpl<InventoryMapper, Inventory
page1.setTotal(size);
return PageResultFactory.createPageResult(page1);
}
//批量进行调整
// @Override
// @Transactional(rollbackFor = Exception.class)
// public boolean BatchEditingInvsInfo(BatchEditingInvsReq req) {
// //查询inventory表中数据,对响应数据进行修改
// //判断是对整一类的装备进行修改还是说对个别几个装备进行批量修改
//// if (req.getInventoryIdList().size()!=0){
// List<InventorySummary> delList=new ArrayList<>();
// PubOrg pubOrg = pubOrgService.PubOrgExist(req.getOrgId());
// int size = req.getInventoryIdList().size();
// List<Object[]> searchItem=new ArrayList<>();
// if (req.getPrice().compareTo(req.getOriginalPrice())!=0){
// Object[] item=new Object[]{req.getOrgId(),req.getLocationId(),req.getTypeId(),req.getSizeId(),req.getPrice()};
// Object[] item1=new Object[]{req.getOrgId(),req.getLocationId(),req.getTypeId(),req.getSizeId(),req.getOriginalPrice()};
// searchItem.add(item);
// searchItem.add(item1);
// List<InventorySummary> inventorySummaryList = inventorySummaryMapper.selectSumByItems(searchItem);
// if (inventorySummaryList.size()==1){//等于1表示他修改后的单价的汇总信息没有,需要新增一条
// InventorySummary is = inventorySummaryList.get(0);
// is.setStockNumber(Math.max(is.getStockNumber()-size,0));
// is.setNumber(Math.max(is.getNumber()-size,0));
// is.setPrice(is.getUnitPrice().multiply(BigDecimal.valueOf(is.getNumber())));
// if (is.getNumber()==0 && is.getStockNumber()==0 && is.getOutboundNumber()==0 && is.getDestructionNumber()==0){
// delList.add(is);
// }
// //新增一条数据
// InventorySummary inventorySummary = new InventorySummary();
// BeanPlusUtil.copyProperties(req,inventorySummary);
// inventorySummary.setValuekey(pubOrg.getOrgCode()+req.getLocationId()+req.getTypeId()+req.getSizeId()+req.getPrice());
// inventorySummary.setOrgName(pubOrg.getOrgName());
// inventorySummary.setOrgCode(pubOrg.getOrgCode());
// inventorySummary.setNumber(size);
// inventorySummary.setStockNumber(size);
// inventorySummary.setOutboundNumber(0);
// inventorySummary.setLocationType("0");
// inventorySummary.setUnitPrice(req.getPrice());
// inventorySummary.setPrice(req.getOriginalPrice().multiply(BigDecimal.valueOf(size)));
// inventorySummary.setDestructionPrice(BigDecimal.ZERO);
// inventorySummary.setBrokenNumberPrice(BigDecimal.ZERO);
// inventorySummary.setExpireNumberPrice(BigDecimal.ZERO);
// inventorySummary.setBrokenNumber(0);
// inventorySummary.setExpireNumber(0);
// inventorySummary.setDestructionNumber(0);
// inventorySummary.setNearBrokenNumber(0);
// inventorySummaryService.save(inventorySummary);
// inventorySummaryService.updateBatchById(inventorySummaryList);
// }else {
// for (InventorySummary is:inventorySummaryList) {
// if (is.getUnitPrice().compareTo(req.getOriginalPrice())==0){//如果单价和修改前的价格一致
// is.setStockNumber(is.getStockNumber()-size);
// is.setNumber(is.getNumber()-size);
// is.setPrice(is.getUnitPrice().multiply(BigDecimal.valueOf(is.getNumber())));
// if (is.getNumber()==0 && is.getStockNumber()==0 && is.getOutboundNumber()==0 && is.getDestructionNumber()==0){
// delList.add(is);
// }
// }else {//单价和修改后的价格一致
// is.setStockNumber(is.getStockNumber()+size);
// is.setNumber(is.getNumber()+size);
// is.setPrice(is.getUnitPrice().multiply(BigDecimal.valueOf(is.getNumber())));
// }
// }
//
// inventorySummaryService.updateBatchById(inventorySummaryList);
// }
// if (CollectionUtil.isNotEmpty(delList)){
// inventorySummaryService.removeBatchByIds(delList);
// }
// }
//
// List<Inventory> list = list(new LambdaQueryWrapper<Inventory>().in(Inventory::getId, req.getInventoryIdList()));
// if (list.size()==0){
// throw new ServiceException(CabinetExceptionEnum.PARAMETER_ERROR);
// }else {
// //批量修改个别装备
//// List<Inventory> collect = list.stream().map(inventory -> {
//// BeanPlusUtil.copyProperties(req,inventory );
//// if (ObjectUtil.isNotNull(req.getShelfColumns()) && !req.getShelfColumns().toString().trim().isEmpty()
//// && ObjectUtil.isNotNull(req.getShelfRanges()) && !req.getShelfRanges().toString().trim().isEmpty()
//// && ObjectUtil.isNotNull(req.getShelfRows()) && !req.getShelfRows().toString().trim().isEmpty()) {
//// inventory.setShelfLocation(req.getShelfRanges() + "/" + req.getShelfColumns() + "/" + req.getShelfRows());
//// }
//// return inventory;
//// }).collect(Collectors.toList());
//// List<Inventory> list1 = list(new LambdaQueryWrapper<Inventory>().eq(Inventory::getId, list));
// List<Inventory> collect = list.stream().map(inventory -> {
// inventory.setWarrantyPeriod(req.getWarrantyPeriod());
// inventory.setMaintenancePeriod(req.getMaintenancePeriod());
// inventory.setPrice(req.getPrice());
// return inventory;
// }).collect(Collectors.toList());
// return updateBatchById(collect);
// }
//
//// }
//// else {
//// List<Inventory> list = list(createWrapper(req));
//// //直接将一类的数据进行修改
//// List<Inventory> collect = list.stream().map(inventory -> {
//// BeanPlusUtil.copyProperties(req, inventory);
//// if (ObjectUtil.isNotNull(req.getShelfColumns()) && !req.getShelfColumns().toString().trim().isEmpty()
//// && ObjectUtil.isNotNull(req.getShelfRanges()) && !req.getShelfRanges().toString().trim().isEmpty()
//// && ObjectUtil.isNotNull(req.getShelfRows()) && !req.getShelfRows().toString().trim().isEmpty()) {
//// inventory.setShelfLocation(req.getShelfRanges() + "/" + req.getShelfColumns() + "/" + req.getShelfRows());
//// }
//// return inventory;
//// }).collect(Collectors.toList());
//// return updateBatchById(collect);
//// }
// }
@Override
@Transactional(rollbackFor = Exception.class)
// public boolean BatchEditingInvsInfo(BatchEditingInvsReq req) {
// //查询inventory表中数据,对响应数据进行修改
// //判断是对整一类的装备进行修改还是说对个别几个装备进行批量修改
//// if (req.getInventoryIdList().size()!=0){
// List<InventorySummary> delList=new ArrayList<>();
// PubOrg pubOrg = pubOrgService.PubOrgExist(req.getOrgId());
// int size = req.getInventoryIdList().size();
// List<Object[]> searchItem=new ArrayList<>();
// //(判断出库几条,入库几条)
// List<Inventory> list = list(new LambdaQueryWrapper<Inventory>().in(Inventory::getId, req.getInventoryIdList()));
//
// if (req.getPrice().compareTo(req.getOriginalPrice())!=0){
// int stockNum=0;
// int outBoundNum=0;
// for (Inventory inv:list) {
// if (inv.getLocationState().equals("in")){
// stockNum=stockNum+1;
// }else {
// outBoundNum=outBoundNum+1;
// }
//
// Object[] item=new Object[]{req.getOrgId(),inv.getLocationId(),req.getTypeId(),req.getSizeId(),req.getPrice()};
// Object[] item1=new Object[]{req.getOrgId(),inv.getLocationId(),req.getTypeId(),req.getSizeId(),req.getOriginalPrice()};
// searchItem.add(item);
// searchItem.add(item1);
// }
// List<InventorySummary> inventorySummaryList = inventorySummaryMapper.selectSumByItems(searchItem);
//
// if (inventorySummaryList.size()==1){//等于1表示他修改后的单价的汇总信息没有,需要新增一条
// InventorySummary is = inventorySummaryList.get(0);
// if (stockNum!=0){
// is.setStockNumber(is.getStockNumber()-stockNum);
// is.setNumber(is.getNumber()-stockNum);
// is.setPrice(is.getUnitPrice().multiply(BigDecimal.valueOf(is.getNumber())));
// }
// if (outBoundNum!=0){
// is.setOutboundNumber(is.getOutboundNumber()-outBoundNum);
// is.setNumber(is.getNumber()-outBoundNum);
// is.setPrice(is.getUnitPrice().multiply(BigDecimal.valueOf(is.getNumber())));
// }
// if (is.getNumber()==0 && is.getStockNumber()==0 && is.getOutboundNumber()==0 && is.getDestructionNumber()==0){
// delList.add(is);
// }
// //新增一条数据
// InventorySummary inventorySummary = new InventorySummary();
// BeanPlusUtil.copyProperties(req,inventorySummary);
// inventorySummary.setValuekey(pubOrg.getOrgCode()+req.getLocationId()+req.getTypeId()+req.getSizeId()+req.getPrice());
// inventorySummary.setOrgName(pubOrg.getOrgName());
// inventorySummary.setOrgCode(pubOrg.getOrgCode());
// inventorySummary.setNumber(size);
// inventorySummary.setStockNumber(size);
// inventorySummary.setOutboundNumber(0);
// inventorySummary.setLocationType("0");
// inventorySummary.setUnitPrice(req.getPrice());
// inventorySummary.setPrice(req.getOriginalPrice().multiply(BigDecimal.valueOf(size)));
// inventorySummary.setDestructionPrice(BigDecimal.ZERO);
// inventorySummary.setBrokenNumberPrice(BigDecimal.ZERO);
// inventorySummary.setExpireNumberPrice(BigDecimal.ZERO);
// inventorySummary.setUseNumber(0);
// inventorySummary.setBrokenNumber(0);
// inventorySummary.setExpireNumber(0);
// inventorySummary.setDestructionNumber(0);
// inventorySummary.setFixNumber(0);
// inventorySummary.setProperty(0);
// inventorySummaryService.save(inventorySummary);
// inventorySummaryService.updateBatchById(inventorySummaryList);
// }else {
// for (InventorySummary is:inventorySummaryList) {
// if (is.getUnitPrice().compareTo(req.getOriginalPrice())==0){//如果单价和修改前的价格一致
// if (stockNum!=0){
// is.setStockNumber(is.getStockNumber()-stockNum);
// is.setNumber(is.getNumber()-stockNum);
// is.setPrice(is.getUnitPrice().multiply(BigDecimal.valueOf(is.getNumber())));
// }
// if (outBoundNum!=0){
// is.setOutboundNumber(is.getOutboundNumber()-outBoundNum);
// is.setNumber(is.getNumber()-outBoundNum);
// is.setPrice(is.getUnitPrice().multiply(BigDecimal.valueOf(is.getNumber())));
// }
// }else {//单价和修改后的价格不一致
// if (stockNum!=0){
// is.setStockNumber(is.getStockNumber()+stockNum);
// is.setNumber(is.getNumber()+stockNum);
// is.setPrice(is.getUnitPrice().multiply(BigDecimal.valueOf(is.getNumber())));
// }
// if (outBoundNum!=0){
// is.setOutboundNumber(is.getOutboundNumber()+outBoundNum);
// is.setNumber(is.getNumber()+outBoundNum);
// is.setPrice(is.getUnitPrice().multiply(BigDecimal.valueOf(is.getNumber())));
// }
// }
//
// if (is.getNumber()==0 && is.getStockNumber()==0 && is.getOutboundNumber()==0 && is.getDestructionNumber()==0){
// delList.add(is);
// }
// }
//
// inventorySummaryService.updateBatchById(inventorySummaryList);
// }
// if (CollectionUtil.isNotEmpty(delList)){
// inventorySummaryService.removeBatchByIds(delList);
// }
// }
//
// if (list.size()==0){
// throw new ServiceException(CabinetExceptionEnum.PARAMETER_ERROR);
// }else {
// //批量修改个别装备
// List<Inventory> collect = list.stream().map(inventory -> {
// inventory.setWarrantyPeriod(req.getWarrantyPeriod());
// inventory.setMaintenancePeriod(req.getMaintenancePeriod());
// inventory.setPrice(req.getPrice());
// return inventory;
// }).collect(Collectors.toList());
// return updateBatchById(collect);
// }
//
// }
public boolean BatchEditingInvsInfo(BatchEditingInvsReq req) {
//查询inventory表中数据,对响应数据进行修改
//判断是对整一类的装备进行修改还是说对个别几个装备进行批量修改
......@@ -560,8 +333,8 @@ public class InventoryServiceImpl extends ServiceImpl<InventoryMapper, Inventory
String key2 =inv.getLocationId()+inv.getTypeId()+inv.getSizeId()+req.getOriginalPrice()+inv.getProperty();
if (map.containsKey(key)){
InventoryReq inventoryReq = map.get(key);
inventoryReq.setStockNum(inventoryReq.getStockNum()+1);
inventoryReq.setOutBoundNum(inventoryReq.getOutBoundNum()+1);
inventoryReq.setStockNum(inv.getLocationState().equals("in")?inventoryReq.getStockNum()+1:inventoryReq.getStockNum());
inventoryReq.setOutBoundNum(inv.getLocationState().equals("out")?inventoryReq.getOutBoundNum()+1:inventoryReq.getOutBoundNum());
map.put(key,inventoryReq);
}else {
InventoryReq inventoryReq = new InventoryReq();
......@@ -577,8 +350,8 @@ public class InventoryServiceImpl extends ServiceImpl<InventoryMapper, Inventory
}
if (map.containsKey(key2)){
InventoryReq inventoryReq = map.get(key2);
inventoryReq.setStockNum(inventoryReq.getStockNum()+1);
inventoryReq.setOutBoundNum(inventoryReq.getOutBoundNum()+1);
inventoryReq.setStockNum(inv.getLocationState().equals("in")?inventoryReq.getStockNum()+1:inventoryReq.getStockNum());
inventoryReq.setOutBoundNum(inv.getLocationState().equals("out")?inventoryReq.getOutBoundNum()+1:inventoryReq.getOutBoundNum());
map.put(key2,inventoryReq);
}else {
InventoryReq inventoryReq = new InventoryReq();
......@@ -594,69 +367,47 @@ public class InventoryServiceImpl extends ServiceImpl<InventoryMapper, Inventory
}
}
List<InventoryReq> invList=new ArrayList<>();
for (String key:map.keySet()) {
InventoryReq inv = map.get(key);
Object[] item=new Object[]{req.getOrgId(),inv.getLocationId(),inv.getTypeId(),inv.getSizeId(),inv.getPrice(),inv.getProperty()};
searchItem.add(item);
if (inv.getPrice().compareTo(req.getOriginalPrice())==0){
invList.add(inv);
}
}
List<InventorySummary> inventorySummaryList = inventorySummaryMapper.selectSum(searchItem);
for (InventoryReq inv:req.getInventoryList()) {
for (String key:map.keySet() ) {
boolean flag=false;
InventoryReq inv = map.get(key);
for (InventorySummary is:inventorySummaryList) {
if (is.getUnitPrice().toString().substring(0, is.getUnitPrice().toString().length() - 3).equals(req.getOriginalPrice().toString()) ){
if (is.getUnitPrice().toString().substring(0, is.getUnitPrice().toString().length() - 3).equalsIgnoreCase(inv.getPrice().toString()) &&
req.getOriginalPrice().toString().equalsIgnoreCase(inv.getPrice().toString()) && inv.getLocationId().equals(is.getLocationId())){
is.setStockNumber(is.getStockNumber()-inv.getStockNum());
is.setOutboundNumber(is.getOutboundNumber()-inv.getOutBoundNum());
is.setNumber(is.getNumber()-inv.getStockNum()-inv.getOutBoundNum());
is.setPrice(is.getUnitPrice().multiply(BigDecimal.valueOf(is.getNumber())));
}else {
if (is.getNumber()==0 && is.getStockNumber()==0 && is.getOutboundNumber()==0 && is.getDestructionNumber()==0){
delList.add(is);
inventorySummaryList.remove(is);
}
flag=true;
break;
}
if (is.getUnitPrice().toString().substring(0, is.getUnitPrice().toString().length() - 3).equalsIgnoreCase(inv.getPrice().toString()) &&
req.getPrice().toString().equalsIgnoreCase(inv.getPrice().toString()) && inv.getLocationId().equals(is.getLocationId()))
{
is.setStockNumber(is.getStockNumber()+inv.getStockNum());
is.setOutboundNumber(is.getOutboundNumber()+inv.getOutBoundNum());
is.setNumber(is.getNumber()+inv.getStockNum()+inv.getOutBoundNum());
is.setPrice(is.getUnitPrice().multiply(BigDecimal.valueOf(is.getNumber())));
}
flag=true;
if (is.getNumber()==0 && is.getStockNumber()==0 && is.getOutboundNumber()==0 && is.getDestructionNumber()==0){
delList.add(is);
}
break;
}
}
if (!flag){
//新增一条数据
InventorySummary inventorySummary = new InventorySummary();
inventorySummary.setOrgId(inv.getOrgId());
inventorySummary.setTypeId(inv.getTypeId());
inventorySummary.setTypeName(inv.getTypeName());
inventorySummary.setSizeId(inv.getSizeId());
inventorySummary.setSizeName(inv.getSizeName());
inventorySummary.setLocationId(inv.getLocationId());
inventorySummary.setLocationName(inv.getLocationName());
inventorySummary.setValuekey(pubOrg.getOrgCode()+inv.getLocationId()+inv.getTypeId()+inv.getSizeId()+inv.getPrice()+inv.getProperty());
inventorySummary.setOrgName(pubOrg.getOrgName());
inventorySummary.setLocationName(inv.getLocationName());
inventorySummary.setOrgCode(pubOrg.getOrgCode());
inventorySummary.setStockNumber(inv.getStockNum());
inventorySummary.setOutboundNumber(inv.getOutBoundNum());
inventorySummary.setNumber(inv.getStockNum()+inv.getOutBoundNum());
inventorySummary.setLocationType("0");
inventorySummary.setUnitPrice(inv.getPrice());
inventorySummary.setPrice(inv.getPrice().multiply(BigDecimal.valueOf(inventorySummary.getNumber())));
inventorySummary.setDestructionPrice(BigDecimal.ZERO);
inventorySummary.setBrokenNumberPrice(BigDecimal.ZERO);
inventorySummary.setExpireNumberPrice(BigDecimal.ZERO);
inventorySummary.setUseNumber(0);
inventorySummary.setBrokenNumber(0);
inventorySummary.setExpireNumber(0);
inventorySummary.setDestructionNumber(0);
inventorySummary.setFixNumber(0);
inventorySummary.setProperty(ObjectUtil.isNull(inv.getProperty())?0:inv.getProperty());
InventorySummary inventorySummary = addInvSum(inv,pubOrg);
addSumList.add(inventorySummary);
}
......@@ -671,16 +422,10 @@ public class InventoryServiceImpl extends ServiceImpl<InventoryMapper, Inventory
if (CollectionUtil.isNotEmpty(inventorySummaryList)){
inventorySummaryService.updateBatchById(inventorySummaryList);
}
List<Inventory> list=new ArrayList<>();
for (String key:map.keySet()) {
InventoryReq inventoryReq = map.get(key);
if (inventoryReq.getPrice()==req.getPrice()){
List<Inventory> collect = req.getInventoryList().stream().map(inventory1 -> {
Inventory inventory = new Inventory();
BeanPlusUtil.copyProperties(inventoryReq,inventory);
list.add(inventory);
}
}
List<Inventory> collect = list.stream().map(inventory -> {
BeanPlusUtil.copyProperties(inventory1,inventory);
inventory.setWarrantyPeriod(req.getWarrantyPeriod());
inventory.setMaintenancePeriod(req.getMaintenancePeriod());
inventory.setPrice(req.getPrice());
......@@ -702,6 +447,36 @@ public class InventoryServiceImpl extends ServiceImpl<InventoryMapper, Inventory
}
}
private InventorySummary addInvSum(InventoryReq inv,PubOrg pubOrg){
InventorySummary inventorySummary = new InventorySummary();
inventorySummary.setOrgId(inv.getOrgId());
inventorySummary.setTypeId(inv.getTypeId());
inventorySummary.setTypeName(inv.getTypeName());
inventorySummary.setSizeId(inv.getSizeId());
inventorySummary.setSizeName(inv.getSizeName());
inventorySummary.setLocationId(inv.getLocationId());
inventorySummary.setLocationName(inv.getLocationName());
inventorySummary.setValuekey(pubOrg.getOrgCode()+inv.getLocationId()+inv.getTypeId()+inv.getSizeId()+inv.getPrice()+inv.getProperty());
inventorySummary.setOrgName(pubOrg.getOrgName());
inventorySummary.setLocationName(inv.getLocationName());
inventorySummary.setOrgCode(pubOrg.getOrgCode());
inventorySummary.setStockNumber(inv.getStockNum());
inventorySummary.setOutboundNumber(inv.getOutBoundNum());
inventorySummary.setNumber(inv.getStockNum()+inv.getOutBoundNum());
inventorySummary.setLocationType("0");
inventorySummary.setUnitPrice(inv.getPrice());
inventorySummary.setPrice(inv.getPrice().multiply(BigDecimal.valueOf(inventorySummary.getNumber())));
inventorySummary.setDestructionPrice(BigDecimal.ZERO);
inventorySummary.setBrokenNumberPrice(BigDecimal.ZERO);
inventorySummary.setExpireNumberPrice(BigDecimal.ZERO);
inventorySummary.setUseNumber(0);
inventorySummary.setBrokenNumber(0);
inventorySummary.setExpireNumber(0);
inventorySummary.setDestructionNumber(0);
inventorySummary.setFixNumber(0);
inventorySummary.setProperty(ObjectUtil.isNull(inv.getProperty())?0:inv.getProperty());
return inventorySummary;
}
//修改库存信息汇总
......
......@@ -902,10 +902,9 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
}
//前端传递的子单数据
List<UpdateOrderDetailReq> reqList = req.getDetailList();
//将记账数量进行相加
Integer updateQuantity=0;
//将价格进行添加修改
BigDecimal priceTotal=new BigDecimal(0);
//获取子单据
List<OrderDetail> list = orderDetailService.list(new LambdaQueryWrapper<OrderDetail>()
.eq(OrderDetail::getOrderId,req.getId()));
......@@ -929,12 +928,33 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
List<WarehouseInventory> addWareInvList=new ArrayList<>();
//编辑装备(出库)
List<Inventory> updateInvList=new ArrayList<>();
//用于判断是否是空账
boolean flag=false;
//遍历子单
for (UpdateOrderDetailReq uploadDetailReq : reqList) {
OrderDetail orderDetail = new OrderDetail();
BeanPlusUtil.copyProperties(uploadDetailReq,orderDetail);
//记空账(识别0,记账0)
if (uploadDetailReq.getActualNum()==0 && req.getActualQuantity()==0){
//添加出入库日志记录
if (orderMain.getOrderType().equals("in")){
s = s+uploadDetailReq.getTypeName()+"【"+
uploadDetailReq.getSizeName()+"】,单价:"+uploadDetailReq.getPrice()
+",数量实入:0,记账:0"+"\n";
}else {
s = s+uploadDetailReq.getTypeName()+"【"+
uploadDetailReq.getSizeName()+"】,单价:"+uploadDetailReq.getPrice()
+",数量实出:0,记账:0"+"\n";
}
orderDetail.setModifyQuantity(uploadDetailReq.getModifyQuantity());
orderDetail.setUpdateTime(DateTimeUtil.getCurrentDateTime());
orderDetailList.add(orderDetail);
updateQuantity+=orderDetail.getModifyQuantity();
continue;
}
flag=true;
List<DetailJsonReq> JsonList = uploadDetailReq.getChildJson();
String jsonString = JSONObject.toJSONString(JsonList);
orderDetail.setDetailJson(jsonString);
......@@ -945,7 +965,6 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
if (ObjectUtil.isNull(uploadDetailReq.getModifyQuantity())){
throw new ServiceException(OrderExceptionEnum.ORDER_NUM_IS_NULL);
}
if (uploadDetailReq.getModifyQuantity() >= 0 ){
//遍历子单据下面的详细记账信息
......@@ -1089,6 +1108,18 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
throw new ServiceException(OrderExceptionEnum.ORDERDETAIL_ERROR);
}
}
//记账0
if (flag){
orderMain.setActualQuantity(updateQuantity);
orderMain.setOrderState("finished");
//修改记账状态,0未记账,1已记账
orderMain.setManualState(1);
orderMain.setUpdateTime(DateTimeUtil.getCurrentDateTime());
boolean a = orderDetailService.updateBatchById(orderDetailList);
boolean b = updateById(orderMain);
boolean c = saveAccountingLog(req, s, updateQuantity);
return a && b && c;
}
//入库添加虚拟装备
if (CollectionUtil.isNotEmpty(addInvList)){
......
......@@ -805,27 +805,24 @@
</select>
<select id="GetDetailByTerms" resultType="com.junmp.jyzb.api.bean.dto.InventoryDto">
SELECT wi.type_id,wi.size_id,wi.shelf_id,wi.shelf_location, wi.epc,wi.org_id,wi.location_state,
SELECT wi.type_id,wi.size_id,wi.shelf_id,wi.shelf_location, wi.epc,wi.org_id,wi.location_state,wi.location_name,wi.type_name,wi.size_name,wi.org_name,
wi.location_type,wi.location_id,i.id,i.supplier_id,i.price,i.state,i.bussiness_state,
i.production_date,i.warranty_period,i.maintenance_period, i.term_state,i.property,
i.area_id,et.name as type_name,es.name as size_name,po.org_name as org_name,
bs.name as supplier_name,COALESCE(bc.name, bw.name) as location_name,
es.photo as photo,es.instructions as instructions,et.photo as type_photo,es.photo as size_photo
i.area_id,
bs.name as supplier_name,
(select instructions FROM base_equipment_type where id=#{req.typeId}) as instructions,
(select photo FROM base_equipment_type where id=#{req.typeId}) as type_photo,
es.photo as size_photo
FROM base_warehouse_inventory wi
LEFT JOIN base_inventory i ON i.epc = wi.epc
LEFT JOIN base_equipment_type et ON et.id = i.type_id
LEFT JOIN base_equipment_size es ON es.id = i.size_id
LEFT JOIN pub_org po ON i.org_id_int = po.org_id
LEFT JOIN base_equipment_size es ON wi.size_id = es.id
LEFT JOIN base_supplier bs ON bs.id = i.supplier_id
LEFT JOIN base_cabinet_box bcb ON i.location_id = bcb.id AND i.location_type = 1
LEFT JOIN base_cabinet bc ON bcb.cabinet_id = bc.id
LEFT JOIN base_warehouse bw ON i.location_id = bw.id AND i.location_type = 0
WHERE wi.org_id=#{req.orgId} and wi.type_id=#{req.typeId}
<if test="req.locationType !='all' and req.locationType != null">
and wi.location_type=#{req.locationType}
</if>
<if test="req.warehouseId != null and req.warehouseId != ''">
and wi.location_id =#{req.warehouseId}
<if test="req.locationId != null and req.locationId != ''">
and wi.location_id =#{req.locationId}
</if>
<if test="req.termState!= -1">
and i.term_state=#{req.termState}
......@@ -845,7 +842,6 @@
<if test="req.maintenancePeriod != null and req.maintenancePeriod != ''">
and i.maintenance_period=#{req.maintenancePeriod}
</if>
ORDER BY wi.type_id,i.size_id
<if test="pageNo != null and pageNo != '' and pageSize != null and pageSize != '' ">
limit #{pageNo},#{pageSize}
......
......@@ -42,7 +42,7 @@ spring:
redis:
#host: 192.168.3.188
host: 192.168.3.121
host: 192.168.3.188
port: 6379
database: 1
password:
......
......@@ -33,7 +33,7 @@ spring:
virtual-host: /
profiles:
#@spring.active@
active: local
active: prod
servlet:
multipart:
max-request-size: 500MB
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论