Commit 6301545b by 李小惠

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

parents 5b2aea09 c0e7cb29
...@@ -3,6 +3,9 @@ package com.junmp.jyzb.api.bean.dto; ...@@ -3,6 +3,9 @@ package com.junmp.jyzb.api.bean.dto;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
@Data @Data
public class EquipmentListDto { public class EquipmentListDto {
private String typeId; private String typeId;
...@@ -14,6 +17,15 @@ public class EquipmentListDto { ...@@ -14,6 +17,15 @@ public class EquipmentListDto {
private String fixNumber; private String fixNumber;
private String num; private String num;
private String state; private String state;
private String price;
private String accountNumber; private String accountNumber;
private List<PriceInfo> priceInfo;
@Data
public static class PriceInfo
{
private BigDecimal price;
private String num;
private Integer accountNumber;
private BigDecimal stockPrice;
}
} }
package com.junmp.jyzb.api.bean.dto;
import lombok.Data;
import java.math.BigDecimal;
@Data
public class InvSummaryDto {
private String typeId;
private String sizeId;
private String locationId;
private Integer count;
private BigDecimal price;
}
...@@ -11,6 +11,7 @@ public class InventoryMapDto { ...@@ -11,6 +11,7 @@ public class InventoryMapDto {
private String id; private String id;
private String warehouseId; private String warehouseId;
private String warehouseName; private String warehouseName;
private String childrenId;
private Long orgId; private Long orgId;
private String orgName; private String orgName;
private String typeId; private String typeId;
......
...@@ -8,9 +8,11 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; ...@@ -8,9 +8,11 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import org.apache.poi.hpsf.Decimal;
import org.springframework.data.annotation.Id; import org.springframework.data.annotation.Id;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
...@@ -25,7 +27,7 @@ public class BussinessInventoryChildrenDetail implements Serializable { ...@@ -25,7 +27,7 @@ public class BussinessInventoryChildrenDetail implements Serializable {
*/ */
@TableId(value = "id") @TableId(value = "id")
@Id @Id
private String id; private Long id;
/** /**
* 工作流id * 工作流id
...@@ -39,6 +41,16 @@ public class BussinessInventoryChildrenDetail implements Serializable { ...@@ -39,6 +41,16 @@ public class BussinessInventoryChildrenDetail implements Serializable {
@TableField(value = "is_use") @TableField(value = "is_use")
private Integer isUse; private Integer isUse;
/** /**
* 是否已使用
*/
@TableField(value = "price")
private BigDecimal price;
/**
*
*/
@TableField(value = "total_price")
private BigDecimal totalPrice;
/**
* 工作流id * 工作流id
*/ */
@TableField(value = "production_date") @TableField(value = "production_date")
...@@ -60,11 +72,6 @@ public class BussinessInventoryChildrenDetail implements Serializable { ...@@ -60,11 +72,6 @@ public class BussinessInventoryChildrenDetail implements Serializable {
@TableField(value = "num") @TableField(value = "num")
private Integer num; private Integer num;
/**
* 月
*/
@TableField(value = "price")
private Integer price;
/** /**
......
...@@ -24,13 +24,15 @@ public interface InventoryMapper extends BaseMapper<Inventory> { ...@@ -24,13 +24,15 @@ public interface InventoryMapper extends BaseMapper<Inventory> {
//根据单警柜统计装备信息 //根据单警柜统计装备信息
List<WarehouseInvDto> GetViewWarehouseInv(@Param("warehouseId") Long orgId,@Param("typeIdsList") List<String> typeIdsList,@Param("sizeIds") List<String> sizeIds); List<WarehouseInvDto> GetViewWarehouseInv(@Param("warehouseId") String warehouseId,@Param("typeIdsList") List<String> typeIdsList,@Param("sizeIds") List<String> sizeIds);
List<ViewEquipmentDto> GetViewEquipment(@Param("epcList") List<String> epcList); List<ViewEquipmentDto> GetViewEquipment(@Param("epcList") List<String> epcList);
List<EpcListDto> GetViewCountByepcs(@Param("epcList") List<String> epcList); List<EpcListDto> GetViewCountByepcs(@Param("epcList") List<String> epcList);
List<InventoryMapDto> GetViewInventoryMap(@Param("warehouseId") String warehouseId); List<InventoryMapDto> GetViewInventoryMap(@Param("warehouseId") String warehouseId);
Boolean deleteByEpcs(@Param("list") List<String> epcs); Boolean deleteByEpcs(@Param("list") List<String> epcs);
List<InvSummaryDto> selectWarehouseByEpcs(@Param("list") List<String> epcs,@Param("orgId") String orgId);
//根据单警柜统计装备信息 //根据单警柜统计装备信息
boolean SetCabinetInventory(@Param("brokenNumberDays") Integer brokenNumberDays); boolean SetCabinetInventory(@Param("brokenNumberDays") Integer brokenNumberDays);
......
...@@ -441,37 +441,38 @@ public class BussinessInventoryServiceImpl extends ServiceImpl<BussinessInventor ...@@ -441,37 +441,38 @@ public class BussinessInventoryServiceImpl extends ServiceImpl<BussinessInventor
public Boolean UploadStock(UploadInventoryReq req) { public Boolean UploadStock(UploadInventoryReq req) {
//更新之前先把库存表的epc备份 //更新之前先把库存表的epc备份
BussinessInventory BI= this.getById(req.getOrderId()); BussinessInventory BI= this.getById(req.getOrderId());
String type= BI.getInventoryType().toString(); if (BI.getInventoryState().equals("close"))
InventorySumReq sumreq=new InventorySumReq();
String epcList="";
List<WarehouseInventory> details=new ArrayList<>();
if (type.equals("0"))
{
details = warehouseInventoryService.list(
new LambdaQueryWrapper<WarehouseInventory>().eq(WarehouseInventory::getLocationId, BI.getWarehouseId())
);
} else if (type.equals("1"))//按装备类型盘点
{
List<String> typeIds = Arrays.asList(BI.getRules().split(","));
details = warehouseInventoryService.list(
new LambdaQueryWrapper<WarehouseInventory>().eq(WarehouseInventory::getLocationId, BI.getWarehouseId())
.and(qw -> typeIds.forEach(typeId -> qw.or().eq(WarehouseInventory::getTypeId, typeId)))
);
}
else if (type.equals("2"))//按号型盘点
{ {
List<String> sizeIds = Arrays.asList(BI.getRules().split(",")); throw new ServiceException(InventoryExceptionEnum.ORDER_CLOSED);
details = warehouseInventoryService.list(
new LambdaQueryWrapper<WarehouseInventory>().eq(WarehouseInventory::getLocationId, BI.getWarehouseId())
.and(qw -> sizeIds.forEach(size -> qw.or().eq(WarehouseInventory::getSizeId, size)))
);
} }
// String type= BI.getInventoryType().toString();
// InventorySumReq sumreq=new InventorySumReq();
// String epcList="";
// List<WarehouseInventory> details=new ArrayList<>();
// if (type.equals("0"))
// {
//
// details = warehouseInventoryService.list(
// new LambdaQueryWrapper<WarehouseInventory>().eq(WarehouseInventory::getLocationId, BI.getWarehouseId())
// );
//
//
// } else if (type.equals("1"))//按装备类型盘点
// {
// List<String> typeIds = Arrays.asList(BI.getRules().split(","));
// details = warehouseInventoryService.list(
// new LambdaQueryWrapper<WarehouseInventory>().eq(WarehouseInventory::getLocationId, BI.getWarehouseId())
// .and(qw -> typeIds.forEach(typeId -> qw.or().eq(WarehouseInventory::getTypeId, typeId)))
// );
// }
// else if (type.equals("2"))//按号型盘点
// {
// List<String> sizeIds = Arrays.asList(BI.getRules().split(","));
// details = warehouseInventoryService.list(
// new LambdaQueryWrapper<WarehouseInventory>().eq(WarehouseInventory::getLocationId, BI.getWarehouseId())
// .and(qw -> sizeIds.forEach(size -> qw.or().eq(WarehouseInventory::getSizeId, size)))
// );
// }
...@@ -489,35 +490,31 @@ public class BussinessInventoryServiceImpl extends ServiceImpl<BussinessInventor ...@@ -489,35 +490,31 @@ public class BussinessInventoryServiceImpl extends ServiceImpl<BussinessInventor
bussinessInventoryChildrenDetailService.removeBatchByIds(ChildrenDetail); bussinessInventoryChildrenDetailService.removeBatchByIds(ChildrenDetail);
} }
} }
List<BussinessInventoryChildrenDetail> updateInvChilred=new ArrayList<>();
for (BussinessDetail detail : ChildrenList) {//子单据中的数据打上标记,以后不会再使用
List<BussinessInventoryChildrenDetail> ChildrenDetail = bussinessInventoryChildrenDetailService.list(
new LambdaQueryWrapper<BussinessInventoryChildrenDetail>().eq(BussinessInventoryChildrenDetail::getInvDetailId, detail.getId())
);
updateInvChilred.addAll(ChildrenDetail);
}
if (updateInvChilred.size()>0)
{
updateInvChilred.forEach(p->p.setIsUse(1));
updateInvChilred.forEach(p->p.setUpdateTime(DateTimeUtil.getCurrentDateTime()));
bussinessInventoryChildrenDetailService.updateBatchById(updateInvChilred);
}
if (ChildrenList.size()>0) if (ChildrenList.size()>0)
{ {
bussinessInventoryDetailService.removeBatchByIds(ChildrenList); bussinessInventoryDetailService.removeBatchByIds(ChildrenList);
} }
List<BussinessInventoryChildrenDetail> ChildrenInfo=new ArrayList<>();
//将上报的数据传入数据库存储 //将上报的数据传入数据库存储
BeanPlusUtil.copyProperties(req,BI); BeanPlusUtil.copyProperties(req,BI);
List<BussinessDetail> Bussinessdetails=new ArrayList<>(); List<BussinessDetail> Bussinessdetails=new ArrayList<>();
for (EquipmentListDto detail : req.getEquipmentList()) { for (EquipmentListDto detail : req.getEquipmentList()) {
for (EquipmentListDto.PriceInfo priceEq :detail.getPriceInfo())
{
BussinessDetail eqDto = new BussinessDetail(); BussinessDetail eqDto = new BussinessDetail();
BeanPlusUtil.copyProperties(detail, eqDto); BeanPlusUtil.copyProperties(detail, eqDto);
eqDto.setAccountNum(detail.getAccountNumber()); eqDto.setNum(Integer.valueOf(priceEq.getNum()));
eqDto.setPrice(priceEq.getPrice());
eqDto.setStockPrice(priceEq.getStockPrice());
eqDto.setAccountNum(String.valueOf(priceEq.getAccountNumber()));
eqDto.setInventoryId(Long.valueOf(req.getOrderId())); eqDto.setInventoryId(Long.valueOf(req.getOrderId()));
eqDto.setUpdateTime(DateTimeUtil.getCurrentDateTime());
eqDto.setCreateTime(DateTimeUtil.getCurrentDateTime());
Bussinessdetails.add(eqDto); Bussinessdetails.add(eqDto);
}
} }
BI.setEpcUpdate(req.getEpcList()); BI.setEpcUpdate(req.getEpcList());
BI.setResult(req.getState()); BI.setResult(req.getState());
...@@ -533,6 +530,7 @@ public class BussinessInventoryServiceImpl extends ServiceImpl<BussinessInventor ...@@ -533,6 +530,7 @@ public class BussinessInventoryServiceImpl extends ServiceImpl<BussinessInventor
public Boolean UpdateDetail(UpdateDetailReq req) { public Boolean UpdateDetail(UpdateDetailReq req) {
BussinessDetail bd= bussinessInventoryDetailService.getById(req.getDetailId());
List<BussinessInventoryChildrenDetail> ChildrenDetail = bussinessInventoryChildrenDetailService.list( List<BussinessInventoryChildrenDetail> ChildrenDetail = bussinessInventoryChildrenDetailService.list(
new LambdaQueryWrapper<BussinessInventoryChildrenDetail>().eq(BussinessInventoryChildrenDetail::getInvDetailId, req.getDetailId()) new LambdaQueryWrapper<BussinessInventoryChildrenDetail>().eq(BussinessInventoryChildrenDetail::getInvDetailId, req.getDetailId())
); );
...@@ -546,6 +544,8 @@ public class BussinessInventoryServiceImpl extends ServiceImpl<BussinessInventor ...@@ -546,6 +544,8 @@ public class BussinessInventoryServiceImpl extends ServiceImpl<BussinessInventor
BussinessInventoryChildrenDetail Bcd=new BussinessInventoryChildrenDetail(); BussinessInventoryChildrenDetail Bcd=new BussinessInventoryChildrenDetail();
BeanPlusUtil.copyProperties(eqInfo,Bcd); BeanPlusUtil.copyProperties(eqInfo,Bcd);
Bcd.setInvDetailId(req.getDetailId()); Bcd.setInvDetailId(req.getDetailId());
Bcd.setPrice(bd.getPrice());
Bcd.setTotalPrice(bd.getStockPrice());
Bcd.setUpdateTime(DateTimeUtil.getCurrentDateTime()); Bcd.setUpdateTime(DateTimeUtil.getCurrentDateTime());
Bcd.setCreateTime(DateTimeUtil.getCurrentDateTime()); Bcd.setCreateTime(DateTimeUtil.getCurrentDateTime());
AddChildrenDetail.add(Bcd); AddChildrenDetail.add(Bcd);
...@@ -599,7 +599,7 @@ public class BussinessInventoryServiceImpl extends ServiceImpl<BussinessInventor ...@@ -599,7 +599,7 @@ public class BussinessInventoryServiceImpl extends ServiceImpl<BussinessInventor
for (InventorySummary summary : SumResult) { for (InventorySummary summary : SumResult) {
for (BussinessDetail bussiness : bussinessDetail) { for (BussinessDetail bussiness : bussinessDetail) {
if (summary.getTypeId().equals(bussiness.getTypeId())&&summary.getUnitPrice().equals(bussiness.getPrice()) if (summary.getTypeId().equals(bussiness.getTypeId())&&summary.getUnitPrice().equals(bussiness.getPrice())
&& summary.getSizeId().equals(bussiness.getSizeId())) { &&summary.getLocationId().equals(BI.getWarehouseId())&& summary.getSizeId().equals(bussiness.getSizeId())) {
summary.setStockNumber(bussiness.getFixNumber()); summary.setStockNumber(bussiness.getFixNumber());
summary.setOutboundNumber(0); summary.setOutboundNumber(0);
summary.setNumber(bussiness.getFixNumber()); summary.setNumber(bussiness.getFixNumber());
...@@ -635,7 +635,6 @@ public class BussinessInventoryServiceImpl extends ServiceImpl<BussinessInventor ...@@ -635,7 +635,6 @@ public class BussinessInventoryServiceImpl extends ServiceImpl<BussinessInventor
InsertSum.setNumber(bdList.getNum()); InsertSum.setNumber(bdList.getNum());
InsertSum.setOrgId(BI.getOrgId()); InsertSum.setOrgId(BI.getOrgId());
InsertSum.setOrgName(BI.getOrgName()); InsertSum.setOrgName(BI.getOrgName());
InsertSum.setOrgCode(org.getOrgCode()); InsertSum.setOrgCode(org.getOrgCode());
InsertSum.setTypeId(bdList.getTypeId()); InsertSum.setTypeId(bdList.getTypeId());
InsertSum.setTypeName(bdList.getTypeName()); InsertSum.setTypeName(bdList.getTypeName());
...@@ -685,11 +684,23 @@ public class BussinessInventoryServiceImpl extends ServiceImpl<BussinessInventor ...@@ -685,11 +684,23 @@ public class BussinessInventoryServiceImpl extends ServiceImpl<BussinessInventor
} }
List<WarehouseInvDto> DeleteFakeEpc = inventoryMapper.GetViewWarehouseInv(BI.getOrgId(), typeIds, sizeIds); List<WarehouseInvDto> DeleteFakeEpc = inventoryMapper.GetViewWarehouseInv(BI.getWarehouseId(), typeIds, sizeIds);
List<Inventory> addInvList=new ArrayList<>(); List<Inventory> addInvList=new ArrayList<>();
List<WarehouseInventory> addWareInvList=new ArrayList<>(); List<WarehouseInventory> addWareInvList=new ArrayList<>();
List<InventoryMapDto> InvFakeList= inventoryMapper.GetViewInventoryMap(BI.getWarehouseId()); List<InventoryMapDto> InvFakeList= inventoryMapper.GetViewInventoryMap(BI.getWarehouseId());
List<BussinessInventoryChildrenDetail> updateInvChilred=new ArrayList<>();
for (InventoryMapDto detail : InvFakeList) {
BussinessInventoryChildrenDetail ChildrenDetail = bussinessInventoryChildrenDetailService.getById(detail.getChildrenId());
updateInvChilred.add(ChildrenDetail);
}
if (updateInvChilred.size()>0)
{
updateInvChilred.forEach(p->p.setIsUse(1));
updateInvChilred.forEach(p->p.setUpdateTime(DateTimeUtil.getCurrentDateTime()));
bussinessInventoryChildrenDetailService.updateBatchById(updateInvChilred);
}
for (InventoryMapDto invFake:InvFakeList) { for (InventoryMapDto invFake:InvFakeList) {
Random random = new Random(); Random random = new Random();
//先插入仓库实体表 //先插入仓库实体表
...@@ -697,7 +708,8 @@ public class BussinessInventoryServiceImpl extends ServiceImpl<BussinessInventor ...@@ -697,7 +708,8 @@ public class BussinessInventoryServiceImpl extends ServiceImpl<BussinessInventor
String epc="000000"+DateTimeUtil.getCurrentDateTime().getTime()+(random.nextInt(999999 - 100000 + 1) + 100000); String epc="000000"+DateTimeUtil.getCurrentDateTime().getTime()+(random.nextInt(999999 - 100000 + 1) + 100000);
Inventory inventory = new Inventory(); Inventory inventory = new Inventory();
inventory.setEpc(epc); inventory.setEpc(epc);
inventory.setEpcType(1);
inventory.setPrice(invFake.getPrice());
inventory.setSizeId(invFake.getSizeId()); inventory.setSizeId(invFake.getSizeId());
inventory.setTypeId(invFake.getTypeId()); inventory.setTypeId(invFake.getTypeId());
inventory.setPrice(invFake.getPrice()); inventory.setPrice(invFake.getPrice());
...@@ -705,6 +717,7 @@ public class BussinessInventoryServiceImpl extends ServiceImpl<BussinessInventor ...@@ -705,6 +717,7 @@ public class BussinessInventoryServiceImpl extends ServiceImpl<BussinessInventor
inventory.setState("normal"); inventory.setState("normal");
inventory.setBussinessState("normal"); inventory.setBussinessState("normal");
inventory.setCreateTime(DateTimeUtil.getCurrentDateTime()); inventory.setCreateTime(DateTimeUtil.getCurrentDateTime());
inventory.setUpdateTime(DateTimeUtil.getCurrentDateTime());
inventory.setProductionDate(invFake.getProductionDate()); inventory.setProductionDate(invFake.getProductionDate());
inventory.setWarrantyPeriod(invFake.getWarrantyPeriod()); inventory.setWarrantyPeriod(invFake.getWarrantyPeriod());
inventory.setMaintenancePeriod(invFake.getMaintenancePeriod()); inventory.setMaintenancePeriod(invFake.getMaintenancePeriod());
...@@ -720,6 +733,7 @@ public class BussinessInventoryServiceImpl extends ServiceImpl<BussinessInventor ...@@ -720,6 +733,7 @@ public class BussinessInventoryServiceImpl extends ServiceImpl<BussinessInventor
warehouseInventory.setTypeId(invFake.getTypeId()); warehouseInventory.setTypeId(invFake.getTypeId());
warehouseInventory.setSizeId(invFake.getSizeId()); warehouseInventory.setSizeId(invFake.getSizeId());
warehouseInventory.setLocationType("0"); warehouseInventory.setLocationType("0");
warehouseInventory.setUpdateTime(DateTimeUtil.getCurrentDateTime());
warehouseInventory.setLocationState("in"); warehouseInventory.setLocationState("in");
warehouseInventory.setCreateTime(DateTimeUtil.getCurrentDateTime()); warehouseInventory.setCreateTime(DateTimeUtil.getCurrentDateTime());
warehouseInventory.setOrgName(invFake.getOrgName()); warehouseInventory.setOrgName(invFake.getOrgName());
...@@ -747,8 +761,47 @@ public class BussinessInventoryServiceImpl extends ServiceImpl<BussinessInventor ...@@ -747,8 +761,47 @@ public class BussinessInventoryServiceImpl extends ServiceImpl<BussinessInventor
} else { } else {
UpdateInventorys = new ArrayList<>(Collections.singletonList(epcUpdate)); UpdateInventorys = new ArrayList<>(Collections.singletonList(epcUpdate));
} }
//需要对Summary表得数据进行更新
List<InvSummaryDto> Summary=inventoryMapper.selectWarehouseByEpcs(UpdateInventorys, String.valueOf(BI.getOrgId()));//删除同组织机构下EPC所在
List<InventorySummary> UpdateSummary=new ArrayList<>();
List<InventorySummary> DeleteSummary=new ArrayList<>();
for (InvSummaryDto Isum:Summary) {
InventorySumReq summaryreq=new InventorySumReq();
summaryreq.setLocationId(Isum.getLocationId());
summaryreq.setUnitPrice(String.valueOf(Isum.getPrice()));
summaryreq.setTypeId(Isum.getTypeId());
summaryreq.setSizeId(Isum.getSizeId());
InventorySummary InvSum= inventorySummaryService.getOne(summaryreq);
if (InvSum!=null)//同组织原有仓库需要减少数量和价格
{
Integer currentNumber=InvSum.getNumber()-Isum.getCount();
BigDecimal count = new BigDecimal(Isum.getCount());
BigDecimal price = Isum.getPrice();
BigDecimal result = count.multiply(price);
BigDecimal currentPrice=InvSum.getPrice().subtract(result);//当前价格
InvSum.setPrice(currentPrice);
InvSum.setNumber(currentNumber);
InvSum.setStockNumber(currentNumber);
InvSum.setStockNumberPrice(currentPrice);
InvSum.setUpdateTime(DateTimeUtil.getCurrentDateTime());
if (InvSum.getStockNumber()==0&&InvSum.getNumber()==0&&InvSum.getFixNumber()==0&&InvSum.getBrokenNumber()==0&&InvSum.getDestructionNumber()==0&&InvSum.getOutboundNumber()==0)
{
DeleteSummary.add(InvSum);
}
else
{
UpdateSummary.add(InvSum);
}
}
//同组织机构当前仓库需要增加价格和数量
InventorySumReq summaryNowReq=new InventorySumReq();
summaryNowReq.setLocationId(BI.getWarehouseId());
summaryNowReq.setUnitPrice(String.valueOf(Isum.getPrice()));
summaryNowReq.setTypeId(Isum.getTypeId());
summaryNowReq.setSizeId(Isum.getSizeId());
}
List<ViewEquipmentDto> viewEd= inventoryMapper.GetViewEquipment(UpdateInventorys); List<ViewEquipmentDto> viewEd= inventoryMapper.GetViewEquipment(UpdateInventorys);
for (ViewEquipmentDto inv:viewEd for (ViewEquipmentDto inv:viewEd
) { ) {
...@@ -778,6 +831,15 @@ public class BussinessInventoryServiceImpl extends ServiceImpl<BussinessInventor ...@@ -778,6 +831,15 @@ public class BussinessInventoryServiceImpl extends ServiceImpl<BussinessInventor
{ {
warehouseInventoryService.removeBatchByIds(DeleteList); warehouseInventoryService.removeBatchByIds(DeleteList);
} }
if (DeleteSummary.size()>0)
{
inventorySummaryService.removeBatchByIds(DeleteSummary);
}
if (UpdateSummary.size()>0)
{
inventorySummaryService.updateBatchById(UpdateSummary);
}
if (SaveEpcList.size()>0) if (SaveEpcList.size()>0)
{ {
warehouseInventoryService.saveBatch(SaveEpcList); warehouseInventoryService.saveBatch(SaveEpcList);
......
...@@ -76,7 +76,7 @@ ...@@ -76,7 +76,7 @@
FROM FROM
view_warehouse_inv view_warehouse_inv
WHERE WHERE
orgId = #{orgId} locationId = #{warehouseId}
<if test="typeIdsList!=null and typeIdsList.size() > 0"> <if test="typeIdsList!=null and typeIdsList.size() > 0">
AND type_id IN AND type_id IN
...@@ -100,7 +100,7 @@ ...@@ -100,7 +100,7 @@
</select> </select>
<delete id="deleteByEpcs" parameterType="java.util.List"> <delete id="deleteByEpcs" parameterType="java.util.List">
DELETE FROM inventory DELETE FROM base_inventory
WHERE epc IN WHERE epc IN
<foreach item="item" index="index" collection="list" <foreach item="item" index="index" collection="list"
open="(" separator="," close=")"> open="(" separator="," close=")">
...@@ -108,6 +108,26 @@ ...@@ -108,6 +108,26 @@
</foreach> </foreach>
</delete> </delete>
<select id="selectWarehouseByEpcs" resultType="com.junmp.jyzb.api.bean.dto.InvSummaryDto">
SELECT
bi.type_id as typeId,
bi.size_id as sizeId,
COUNT(bi.id) AS count,
bwi.location_id as locationId,
bi.price
FROM
`base_inventory` `bi`
JOIN
`base_warehouse_inventory` `bwi` ON `bi`.`epc` = `bwi`.`epc`
WHERE bi.epc IN
<foreach item="item" index="index" collection="list"
open="(" separator="," close=")">
#{item}
</foreach>
and bwi.org_id=#{orgId}
GROUP BY
bi.size_id, bi.type_id, bi.price,bwi.location_id
</select>
<insert id="SetCabinetInventory"> <insert id="SetCabinetInventory">
INSERT INTO base_inventory_summary_type2 (id,org_id_int,org_name, org_code,type_id,type_name,size_id,size_name,location_id,location_name, INSERT INTO base_inventory_summary_type2 (id,org_id_int,org_name, org_code,type_id,type_name,size_id,size_name,location_id,location_name,
number,unit_price,price,stock_number, outbound_number,destruction_number,expire_number, number,unit_price,price,stock_number, outbound_number,destruction_number,expire_number,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论