Commit acfe256e by 赵剑炜

Merge branch 'develop' of http://gitlab.sothing.top/843502640/jyzb_platformV2 into develop-zhaojw

parents b07771f3 a372d46d
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.
...@@ -198,4 +198,10 @@ public class InventoryReq extends BaseRequest { ...@@ -198,4 +198,10 @@ public class InventoryReq extends BaseRequest {
private Integer zkCount; private Integer zkCount;
private Integer stockNum;
private Integer outBoundNum;
private Integer property;
} }
package com.junmp.jyzb.api.bean.req; package com.junmp.jyzb.api.bean.req;
import com.junmp.jyzb.api.bean.query.InventoryReq;
import com.junmp.v2.common.bean.request.ValidationApi; import com.junmp.v2.common.bean.request.ValidationApi;
import lombok.Data; import lombok.Data;
...@@ -39,7 +40,7 @@ public class BatchEditingInvsReq { ...@@ -39,7 +40,7 @@ public class BatchEditingInvsReq {
/** /**
*装备id *装备id
*/ */
private List<String> inventoryIdList; private List<InventoryReq> inventoryList;
/** /**
*生产日期 *生产日期
......
...@@ -215,4 +215,7 @@ public class Inventory implements Serializable { ...@@ -215,4 +215,7 @@ public class Inventory implements Serializable {
@TableField(value = "property") @TableField(value = "property")
private Integer property; private Integer property;
} }
\ No newline at end of file
...@@ -3,6 +3,7 @@ package com.junmp.jyzb.service.impl; ...@@ -3,6 +3,7 @@ package com.junmp.jyzb.service.impl;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
...@@ -423,141 +424,286 @@ public class InventoryServiceImpl extends ServiceImpl<InventoryMapper, Inventory ...@@ -423,141 +424,286 @@ public class InventoryServiceImpl extends ServiceImpl<InventoryMapper, Inventory
@Override @Override
@Transactional(rollbackFor = Exception.class) @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) { public boolean BatchEditingInvsInfo(BatchEditingInvsReq req) {
//查询inventory表中数据,对响应数据进行修改 //查询inventory表中数据,对响应数据进行修改
//判断是对整一类的装备进行修改还是说对个别几个装备进行批量修改 //判断是对整一类的装备进行修改还是说对个别几个装备进行批量修改
// if (req.getInventoryIdList().size()!=0){ // if (req.getInventoryIdList().size()!=0){
List<InventorySummary> delList=new ArrayList<>(); List<InventorySummary> delList=new ArrayList<>();
PubOrg pubOrg = pubOrgService.PubOrgExist(req.getOrgId()); PubOrg pubOrg = pubOrgService.PubOrgExist(req.getOrgId());
int size = req.getInventoryIdList().size();
List<Object[]> searchItem=new ArrayList<>(); List<Object[]> searchItem=new ArrayList<>();
//(判断出库几条,入库几条) //(判断出库几条,入库几条)
List<Inventory> list = list(new LambdaQueryWrapper<Inventory>().in(Inventory::getId, req.getInventoryIdList())); List<InventorySummary> addSumList=new ArrayList<>();
int stockNum=0; Map<String,InventoryReq> map=new HashMap<>();
int outBoundNum=0;
for (Inventory inv:list) {
if (inv.getLocationState().equals("in")){
stockNum=stockNum+1;
}else {
outBoundNum=outBoundNum+1;
}
}
if (req.getPrice().compareTo(req.getOriginalPrice())!=0){ 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()}; for (InventoryReq inv:req.getInventoryList()) {
searchItem.add(item); String key =inv.getLocationId()+inv.getTypeId()+inv.getSizeId()+req.getPrice()+inv.getProperty();
searchItem.add(item1); String key2 =inv.getLocationId()+inv.getTypeId()+inv.getSizeId()+req.getOriginalPrice()+inv.getProperty();
List<InventorySummary> inventorySummaryList = inventorySummaryMapper.selectSumByItems(searchItem); if (map.containsKey(key)){
if (inventorySummaryList.size()==1){//等于1表示他修改后的单价的汇总信息没有,需要新增一条 InventoryReq inventoryReq = map.get(key);
InventorySummary is = inventorySummaryList.get(0); inventoryReq.setStockNum(inventoryReq.getStockNum()+1);
is.setStockNumber(Math.max(is.getStockNumber()-size,0)); inventoryReq.setOutBoundNum(inventoryReq.getOutBoundNum()+1);
is.setNumber(Math.max(is.getNumber()-size,0)); map.put(key,inventoryReq);
is.setPrice(is.getUnitPrice().multiply(BigDecimal.valueOf(is.getNumber()))); }else {
if (is.getNumber()==0 && is.getStockNumber()==0 && is.getOutboundNumber()==0 && is.getDestructionNumber()==0){ InventoryReq inventoryReq = new InventoryReq();
delList.add(is); BeanPlusUtil.copyProperties(inv,inventoryReq);
inventoryReq.setStockNum(ObjectUtil.isNull(inv.getStockNum())?
(inv.getLocationState().equals("in")?1:0)
:(inv.getLocationState().equals("in")?inv.getStockNum()+1:inv.getStockNum()));
inventoryReq.setOutBoundNum(ObjectUtil.isNull(inv.getOutBoundNum())?
(inv.getLocationState().equals("out")?1:0)
:(inv.getLocationState().equals("out")?inv.getOutBoundNum()+1:inv.getOutBoundNum()));
inventoryReq.setPrice(req.getPrice());
map.put(key,inventoryReq);
} }
//新增一条数据 if (map.containsKey(key2)){
InventorySummary inventorySummary = new InventorySummary(); InventoryReq inventoryReq = map.get(key2);
BeanPlusUtil.copyProperties(req,inventorySummary); inventoryReq.setStockNum(inventoryReq.getStockNum()+1);
inventorySummary.setValuekey(pubOrg.getOrgCode()+req.getLocationId()+req.getTypeId()+req.getSizeId()+req.getPrice()); inventoryReq.setOutBoundNum(inventoryReq.getOutBoundNum()+1);
inventorySummary.setOrgName(pubOrg.getOrgName()); map.put(key2,inventoryReq);
inventorySummary.setOrgCode(pubOrg.getOrgCode()); }else {
inventorySummary.setNumber(size); InventoryReq inventoryReq = new InventoryReq();
inventorySummary.setStockNumber(size); BeanPlusUtil.copyProperties(inv,inventoryReq);
inventorySummary.setOutboundNumber(0); inventoryReq.setStockNum(ObjectUtil.isNull(inv.getStockNum())?
inventorySummary.setLocationType("0"); (inv.getLocationState().equals("in")?1:0)
inventorySummary.setUnitPrice(req.getPrice()); :(inv.getLocationState().equals("in")?inv.getStockNum()+1:inv.getStockNum()));
inventorySummary.setPrice(req.getOriginalPrice().multiply(BigDecimal.valueOf(size))); inventoryReq.setOutBoundNum(ObjectUtil.isNull(inv.getOutBoundNum())?
inventorySummary.setDestructionPrice(BigDecimal.ZERO); (inv.getLocationState().equals("out")?1:0)
inventorySummary.setBrokenNumberPrice(BigDecimal.ZERO); :(inv.getLocationState().equals("out")?inv.getOutBoundNum()+1:inv.getOutBoundNum()));
inventorySummary.setExpireNumberPrice(BigDecimal.ZERO); inventoryReq.setPrice(req.getOriginalPrice());
inventorySummary.setBrokenNumber(0); map.put(key2,inventoryReq);
inventorySummary.setExpireNumber(0); }
inventorySummary.setDestructionNumber(0);
inventorySummary.setFixNumber(0); }
inventorySummary.setProperty(0); List<InventoryReq> invList=new ArrayList<>();
inventorySummaryService.save(inventorySummary); for (String key:map.keySet()) {
inventorySummaryService.updateBatchById(inventorySummaryList); InventoryReq inv = map.get(key);
}else { 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()) {
boolean flag=false;
for (InventorySummary is:inventorySummaryList) { for (InventorySummary is:inventorySummaryList) {
if (is.getUnitPrice().compareTo(req.getOriginalPrice())==0){//如果单价和修改前的价格一致
if (stockNum!=0){ if (is.getUnitPrice().toString().substring(0, is.getUnitPrice().toString().length() - 3).equals(req.getOriginalPrice().toString()) ){
is.setStockNumber(is.getStockNumber()-stockNum);
is.setNumber(is.getNumber()-stockNum); is.setStockNumber(is.getStockNumber()-inv.getStockNum());
is.setPrice(is.getUnitPrice().multiply(BigDecimal.valueOf(is.getNumber()))); is.setOutboundNumber(is.getOutboundNumber()-inv.getOutBoundNum());
} is.setNumber(is.getNumber()-inv.getStockNum()-inv.getOutBoundNum());
if (outBoundNum!=0){ is.setPrice(is.getUnitPrice().multiply(BigDecimal.valueOf(is.getNumber())));
is.setOutboundNumber(is.getOutboundNumber()-outBoundNum); }else {
is.setNumber(is.getNumber()-outBoundNum); is.setStockNumber(is.getStockNumber()+inv.getStockNum());
is.setPrice(is.getUnitPrice().multiply(BigDecimal.valueOf(is.getNumber()))); is.setOutboundNumber(is.getOutboundNumber()+inv.getOutBoundNum());
} is.setNumber(is.getNumber()+inv.getStockNum()+inv.getOutBoundNum());
if (is.getNumber()==0 && is.getStockNumber()==0 && is.getOutboundNumber()==0 && is.getDestructionNumber()==0){ is.setPrice(is.getUnitPrice().multiply(BigDecimal.valueOf(is.getNumber())));
delList.add(is); }
} flag=true;
}else {//单价和修改后的价格不一致
if (stockNum!=0){ if (is.getNumber()==0 && is.getStockNumber()==0 && is.getOutboundNumber()==0 && is.getDestructionNumber()==0){
is.setStockNumber(is.getStockNumber()+stockNum); delList.add(is);
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);
}
} }
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());
addSumList.add(inventorySummary);
} }
inventorySummaryService.updateBatchById(inventorySummaryList);
} }
if (CollectionUtil.isNotEmpty(delList)){ if (CollectionUtil.isNotEmpty(delList)){
inventorySummaryService.removeBatchByIds(delList); inventorySummaryService.removeBatchByIds(delList);
} }
if (CollectionUtil.isNotEmpty(addSumList)){
inventorySummaryService.saveBatch(addSumList);
}
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()){
Inventory inventory = new Inventory();
BeanPlusUtil.copyProperties(inventoryReq,inventory);
list.add(inventory);
}
}
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);
} }
if (list.size()==0){ else {
throw new ServiceException(CabinetExceptionEnum.PARAMETER_ERROR);
}else {
//批量修改个别装备 //批量修改个别装备
// List<Inventory> collect = list.stream().map(inventory -> { List<Inventory> collect = req.getInventoryList().stream().map(inventory1 -> {
// BeanPlusUtil.copyProperties(req,inventory ); Inventory inventory = new Inventory();
// if (ObjectUtil.isNotNull(req.getShelfColumns()) && !req.getShelfColumns().toString().trim().isEmpty() BeanPlusUtil.copyProperties(inventory,inventory1);
// && 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.setWarrantyPeriod(req.getWarrantyPeriod());
inventory.setMaintenancePeriod(req.getMaintenancePeriod()); inventory.setMaintenancePeriod(req.getMaintenancePeriod());
inventory.setPrice(req.getPrice());
return inventory; return inventory;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
return updateBatchById(collect); 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);
// }
} }
//修改库存信息汇总 //修改库存信息汇总
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public boolean setInventorySummary(BatchEditingInvsReq req){ public boolean setInventorySummary(BatchEditingInvsReq req){
......
...@@ -1031,6 +1031,7 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain ...@@ -1031,6 +1031,7 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
inventory.setLocationType(0); inventory.setLocationType(0);
inventory.setPrice(ObjectUtil.isNull(detailJsonReq.getPrice())?price:detailJsonReq.getPrice()); inventory.setPrice(ObjectUtil.isNull(detailJsonReq.getPrice())?price:detailJsonReq.getPrice());
inventory.setProperty(0); inventory.setProperty(0);
inventory.setEpcType(1);
inventory.setState("normal"); inventory.setState("normal");
inventory.setBussinessState("normal"); inventory.setBussinessState("normal");
inventory.setCreateTime(DateTimeUtil.getCurrentDateTime()); inventory.setCreateTime(DateTimeUtil.getCurrentDateTime());
...@@ -1053,6 +1054,7 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain ...@@ -1053,6 +1054,7 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
warehouseInventory.setLocationState("in"); warehouseInventory.setLocationState("in");
warehouseInventory.setCreateTime(DateTimeUtil.getCurrentDateTime()); warehouseInventory.setCreateTime(DateTimeUtil.getCurrentDateTime());
warehouseInventory.setOrgName(orgName); warehouseInventory.setOrgName(orgName);
warehouseInventory.setEpcType(1);
warehouseInventory.setTypeName(uploadDetailReq.getTypeName()); warehouseInventory.setTypeName(uploadDetailReq.getTypeName());
warehouseInventory.setSizeName(uploadDetailReq.getSizeName()); warehouseInventory.setSizeName(uploadDetailReq.getSizeName());
warehouseInventory.setLocationName(detailJsonReq.getLocationName()); warehouseInventory.setLocationName(detailJsonReq.getLocationName());
...@@ -1894,6 +1896,7 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain ...@@ -1894,6 +1896,7 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
existingSummary.setStockNumber(existingSummary.getStockNumber() + summary.getStockNumber()); existingSummary.setStockNumber(existingSummary.getStockNumber() + summary.getStockNumber());
existingSummary.setBrokenNumber(existingSummary.getBrokenNumber() + summary.getBrokenNumber()); existingSummary.setBrokenNumber(existingSummary.getBrokenNumber() + summary.getBrokenNumber());
existingSummary.setNumber(existingSummary.getNumber() + summary.getNumber()); existingSummary.setNumber(existingSummary.getNumber() + summary.getNumber());
resultMap.put(key,existingSummary);
} else { } else {
resultMap.put(key, summary); resultMap.put(key, summary);
} }
......
...@@ -468,7 +468,7 @@ ...@@ -468,7 +468,7 @@
<select id="GetGroupByCount" resultType="com.junmp.jyzb.api.bean.dto.LargeScreenDto.GroupByCountDto"> <select id="GetGroupByCount" resultType="com.junmp.jyzb.api.bean.dto.LargeScreenDto.GroupByCountDto">
select t.`value`,base_equipment_type.name as `name`,base_equipment_type.id as typeId FROM( select t.`value`,base_equipment_type.name as `name`,base_equipment_type.id as typeId FROM(
select sum(bis.number) as value,SUBSTRING_INDEX(et.parent_ids, ",", 1) AS type_parent_id FROM ( select sum(bis.number) as value,SUBSTRING_INDEX(et.parent_ids, ",", 1) AS type_parent_id FROM (
select number,type_id FROM base_inventory_summary bis where SUBSTRING( org_code, 1, #{length} ) = #{req.findCode} and bis.location_type=0 select number,type_id FROM base_inventory_summary bis where SUBSTRING( org_code, 1, #{length} ) = #{req.findCode}
<if test="length != 12"> <if test="length != 12">
<if test="req.levelType == 0"> <if test="req.levelType == 0">
...@@ -488,7 +488,7 @@ ...@@ -488,7 +488,7 @@
sum(outbound_number)as outboundNumber,sum(destruction_number)as destructionNumber, sum(outbound_number)as outboundNumber,sum(destruction_number)as destructionNumber,
sum(expire_number)as expireNumber,sum(broken_number)as brokenNumber, sum(expire_number)as expireNumber,sum(broken_number)as brokenNumber,
sum(fix_number)as fixNumber,sum(use_number)as useNumber sum(fix_number)as fixNumber,sum(use_number)as useNumber
FROM base_inventory_summary where SUBSTRING( org_code, 1, #{length} ) = #{req.findCode} and location_type=0 FROM base_inventory_summary where SUBSTRING( org_code, 1, #{length} ) = #{req.findCode}
<if test="length != 12"> <if test="length != 12">
<if test="req.levelType == 0"> <if test="req.levelType == 0">
...@@ -591,7 +591,7 @@ ...@@ -591,7 +591,7 @@
FROM FROM
`vie_equipment_count_summary` `vie_equipment_count_summary`
WHERE WHERE
SUBSTRING( org_code, 1, 4 ) = "3302" and year=YEAR(NOW()) and month=MONTH(NOW()) SUBSTRING( org_code, 1, #{length} ) = #{req.findCode} and year=YEAR(NOW()) and month=MONTH(NOW())
<if test="req.levelType == 0"> <if test="req.levelType == 0">
and org_id_int =(select org_id FROM pub_org where find_code=#{req.findCode} ORDER BY level_flag asc limit 0,1 ) and org_id_int =(select org_id FROM pub_org where find_code=#{req.findCode} ORDER BY level_flag asc limit 0,1 )
</if> </if>
...@@ -610,7 +610,7 @@ ...@@ -610,7 +610,7 @@
FROM FROM
`vie_equipment_count_summary` `vie_equipment_count_summary`
WHERE WHERE
SUBSTRING( org_code, 1, 4 ) = "3302" and year=YEAR(NOW()) and month=MONTH(NOW()) SUBSTRING( org_code, 1, #{length} ) = #{req.findCode} and year=YEAR(NOW()) and month=MONTH(NOW())
<if test="req.levelType == 0"> <if test="req.levelType == 0">
and org_id_int =(select org_id FROM pub_org where find_code=#{req.findCode} ORDER BY level_flag asc limit 0,1 ) and org_id_int =(select org_id FROM pub_org where find_code=#{req.findCode} ORDER BY level_flag asc limit 0,1 )
</if> </if>
...@@ -628,7 +628,7 @@ ...@@ -628,7 +628,7 @@
FROM FROM
`vie_equipment_count_summary` `vie_equipment_count_summary`
WHERE WHERE
SUBSTRING( org_code, 1, 4 ) = "3302" and year=YEAR(NOW()) and month=MONTH(NOW()) SUBSTRING( org_code, 1, #{length} ) = #{req.findCode} and year=YEAR(NOW()) and month=MONTH(NOW())
<if test="req.levelType == 0"> <if test="req.levelType == 0">
and org_id_int =(select org_id FROM pub_org where find_code=#{req.findCode} ORDER BY level_flag asc limit 0,1 ) and org_id_int =(select org_id FROM pub_org where find_code=#{req.findCode} ORDER BY level_flag asc limit 0,1 )
</if> </if>
...@@ -670,7 +670,7 @@ ...@@ -670,7 +670,7 @@
AND level_flag = 2 AND level_flag = 2
) AS subquery ON 1=1 ) AS subquery ON 1=1
WHERE WHERE
SUBSTRING(base_inventory_summary.org_code, 1, 4) = subquery.find_code and base_inventory_summary.location_type=0 SUBSTRING(base_inventory_summary.org_code, 1, 4) = subquery.find_code
GROUP BY GROUP BY
type_org_code) as t type_org_code) as t
</select> </select>
...@@ -700,7 +700,7 @@ ...@@ -700,7 +700,7 @@
AND level_flag = 2 AND level_flag = 2
) AS subquery ON 1=1 ) AS subquery ON 1=1
WHERE WHERE
SUBSTRING(base_inventory_summary.org_code, 1, 4) = subquery.find_code and base_inventory_summary.location_type=0 SUBSTRING(base_inventory_summary.org_code, 1, 4) = subquery.find_code
GROUP BY GROUP BY
findCode findCode
) as t left join pub_org on t.findCode=pub_org.find_code ) as t left join pub_org on t.findCode=pub_org.find_code
...@@ -721,7 +721,7 @@ ...@@ -721,7 +721,7 @@
FROM FROM
base_inventory_summary base_inventory_summary
WHERE WHERE
SUBSTRING(base_inventory_summary.org_code, 1, 4) = #{dto.findCode} and base_inventory_summary.location_type=0 SUBSTRING(base_inventory_summary.org_code, 1, 4) = #{dto.findCode}
GROUP BY type_id GROUP BY type_id
order by type_id order by type_id
</select> </select>
......
...@@ -807,7 +807,7 @@ ...@@ -807,7 +807,7 @@
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_type,wi.location_id,i.id,i.supplier_id,i.price,i.state,i.bussiness_state, 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.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, 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, 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 es.photo as photo,es.instructions as instructions,et.photo as type_photo,es.photo as size_photo
......
...@@ -42,7 +42,7 @@ spring: ...@@ -42,7 +42,7 @@ spring:
redis: redis:
#host: 192.168.3.188 #host: 192.168.3.188
host: 192.168.3.188 host: 192.168.3.121
port: 6379 port: 6379
database: 1 database: 1
password: password:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论