2,3,5楼仓储看板接口

master
马雪伟 2 days ago
parent 5755eb05d8
commit 6537852996

@ -0,0 +1,34 @@
package com.hw.wms.board.controller;
import com.hw.common.core.web.domain.AjaxResult;
import com.hw.wms.board.service.FifthWmsBorderService;
import com.hw.wms.board.service.SecondWmsBorderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/FifthWmsBorder")
public class FifthWmsBorderController {
@Autowired
private FifthWmsBorderService fifthWmsBorderService;
/**
*
*/
@GetMapping("/locationCount")
public AjaxResult locationCount(){
return AjaxResult.success(fifthWmsBorderService.locationCount());
}
/**
*
*/
@GetMapping("fifthPanake")
public AjaxResult fifthPanake(){
return AjaxResult.success(fifthWmsBorderService.fifthPanake());
}
}

@ -0,0 +1,64 @@
package com.hw.wms.board.controller;
import com.hw.common.core.web.domain.AjaxResult;
import com.hw.wms.board.service.SecondWmsBorderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/SecondWmsBorder")
public class SecondWmsBorderController {
@Autowired
private SecondWmsBorderService secondWmsBorderService;
/**
*
* @return
*/
@GetMapping("/totalStock")
public AjaxResult totalStock(){
return AjaxResult.success(secondWmsBorderService.totalStock());
}
/**
*
*/
@GetMapping("/locationCount")
public AjaxResult locationCount(){
return AjaxResult.success(secondWmsBorderService.locationCount());
}
/**
*
*/
@GetMapping("/tableInfo")
public AjaxResult tableInfo(){
return AjaxResult.success(secondWmsBorderService.tableInfo());
}
/**
* 线
*/
@GetMapping("/inAndOutStockInfo")
public AjaxResult inAndOutStockInfo(){
return AjaxResult.success(secondWmsBorderService.inAndOutStockInfo());
}
/**
*
* @return
*/
@GetMapping("/instockTimeCount")
public AjaxResult instockTimeCount(){
return AjaxResult.success(secondWmsBorderService.instockTimeCount());
}
/**
*
* @return
*/
@GetMapping("/todayInstockAmount")
public AjaxResult todayInstockAmount(){
return AjaxResult.success(secondWmsBorderService.todayInstockAmount());
}
}

@ -0,0 +1,41 @@
package com.hw.wms.board.controller;
import com.hw.common.core.web.domain.AjaxResult;
import com.hw.wms.board.service.SecondWmsBorderService;
import com.hw.wms.board.service.ThirdWmsBorderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/ThirdWmsBorder")
public class ThirdWmsBorderController {
@Autowired
private ThirdWmsBorderService thirdWmsBorderService;
/**
*
*/
@GetMapping("/monthRawAmount")
public AjaxResult monthRawAmount(){
return AjaxResult.success(thirdWmsBorderService.monthRawAmount());
}
/**
*
*/
@GetMapping("/locationStatus")
public AjaxResult locationStatus(){
return AjaxResult.success(thirdWmsBorderService.locationStatus());
}
/**
*
*/
@GetMapping("/productPlan")
public AjaxResult productPlan(){
return AjaxResult.success(thirdWmsBorderService.productPlan());
}
}

@ -0,0 +1,24 @@
package com.hw.wms.board.domain;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
@Data
public class RecordIotenvInstant {
private Long objId;
private String monitorId;
private BigDecimal tempreture;
private BigDecimal humidity;
private BigDecimal illuminance;
private BigDecimal noise;
private BigDecimal concentration;
private BigDecimal pm1;
private BigDecimal pm2;
private BigDecimal pm10;
private BigDecimal standBy;
private Date collectTime;
private Date recodeTime;
}

@ -0,0 +1,18 @@
package com.hw.wms.board.service;
import com.hw.wms.domain.WmsProductInstock;
import com.hw.wms.domain.WmsProductOutstockDetail;
import com.hw.wms.domain.WmsProductStock;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
public interface FifthWmsBorderService {
Map locationCount();
Map fifthPanake();
}

@ -0,0 +1,26 @@
package com.hw.wms.board.service;
import com.hw.wms.domain.WmsProductInstock;
import com.hw.wms.domain.WmsProductOutstock;
import com.hw.wms.domain.WmsProductOutstockDetail;
import com.hw.wms.domain.WmsProductStock;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
public interface SecondWmsBorderService {
List<WmsProductStock> totalStock();
Map<String, BigDecimal> locationCount();
List<WmsProductOutstockDetail> tableInfo();
List<WmsProductInstock> inAndOutStockInfo();
Map<String,Integer> instockTimeCount();
BigDecimal todayInstockAmount();
}

@ -0,0 +1,15 @@
package com.hw.wms.board.service;
import com.hw.wms.domain.WmsBaseLocation;
import com.hw.wms.domain.WmsRawOutstock;
import java.util.List;
import java.util.Map;
public interface ThirdWmsBorderService {
Map monthRawAmount();
List<WmsBaseLocation> locationStatus();
List<WmsRawOutstock> productPlan();
}

@ -0,0 +1,71 @@
package com.hw.wms.board.service.impl;
import com.hw.wms.board.service.FifthWmsBorderService;
import com.hw.wms.board.service.SecondWmsBorderService;
import com.hw.wms.domain.*;
import com.hw.wms.mapper.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@Service
public class FifthWmsBoardServiceImpl implements FifthWmsBorderService {
@Autowired
private WmsProductStockMapper wmsProductStockMapper;
@Autowired
private WmsRawInstockMapper wmsRawInstockMapper;
@Autowired
private WmsRawOutstockMapper wmsRawOutstockMapper;
@Autowired
private WmsProductInstockMapper wmsProductInstockMapper;
@Autowired
private WmsProductOutstockMapper wmsProductOutstockMapper;
@Autowired
private WmsRawStockMapper wmsRawStockMapper;
@Autowired
private WmsBaseLocationMapper wmsBaseLocationMapper;
@Override
public Map locationCount() {
HashMap map = new HashMap<>();
List<WmsProductInstock> list = wmsRawInstockMapper.locationCount();
List<WmsRawOutstock> list1 = wmsRawOutstockMapper.locationCount();
List<WmsProductInstock> list2 = wmsProductInstockMapper.locationCount();
List<WmsProductOutstock> list3 = wmsProductOutstockMapper.locationCount();
for (WmsProductInstock wmsProductInstock : list) {
if (wmsProductInstock.getWarehouseId()==511){
map.put("rawInStock",wmsProductInstock.getInstockAmount());
}
if (wmsProductInstock.getWarehouseId()==512){
map.put("furawInStock",wmsProductInstock.getInstockAmount());
}
}
map.put("rawOutStock",list1.get(0).getOutstockAmount());
map.put("productInStock",list2.get(0).getInstockAmount());
map.put("productOutStock",list3.get(0).getOutstockQty());
return map;
}
@Override
public Map fifthPanake() {
List<WmsRawStock> wmsRawStocks = wmsRawStockMapper.selectRawLocationPercentage();
List<WmsProductStock> productStocks = wmsProductStockMapper.selectProductStockPercentage();
Integer emptyLocationCount = wmsBaseLocationMapper.selectEmptyLocation();
Integer allLocation = wmsBaseLocationMapper.selectAllLocation();
BigDecimal emptyLocationPercentage = new BigDecimal(emptyLocationCount).divide(new BigDecimal(allLocation), 2, BigDecimal.ROUND_HALF_UP);
Integer oppylLocation = allLocation - emptyLocationCount;
BigDecimal opplyLocationPercentage = new BigDecimal(oppylLocation).divide(new BigDecimal(allLocation), 2, BigDecimal.ROUND_HALF_UP);
HashMap<String, Object> map = new HashMap<>();
map.put("wmsRawStocks",wmsRawStocks);
map.put("productStocks",productStocks);
map.put("emptyLocationPercentage",emptyLocationPercentage);
map.put("opplyLocationPercentage",opplyLocationPercentage);
return map;
}
}

@ -0,0 +1,79 @@
package com.hw.wms.board.service.impl;
import com.hw.wms.board.service.SecondWmsBorderService;
import com.hw.wms.domain.WmsProductInstock;
import com.hw.wms.domain.WmsProductOutstock;
import com.hw.wms.domain.WmsProductOutstockDetail;
import com.hw.wms.domain.WmsProductStock;
import com.hw.wms.mapper.WmsProductStockMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@Service
public class SecondWmsBoardServiceImpl implements SecondWmsBorderService {
@Autowired
private WmsProductStockMapper wmsProductStockMapper;
@Override
public List<WmsProductStock> totalStock() {
return wmsProductStockMapper.totalStock();
}
@Override
public BigDecimal todayInstockAmount() {
BigDecimal result = wmsProductStockMapper.todayInstockAmount();
return result;
}
@Override
public Map<String, Integer> instockTimeCount() {
HashMap<String, Integer> result = new HashMap<>();
int oneWeekCount = wmsProductStockMapper.selectOneWeek();
int twoWeekCount = wmsProductStockMapper.selectTwoWeek();
int oneMonthCount = wmsProductStockMapper.selectOneMonth();
int halfYearCount = wmsProductStockMapper.selectHalfYear();
result.put("oneWeekCount",oneWeekCount);
result.put("twoWeekCount",twoWeekCount);
result.put("oneMonthCount",oneMonthCount);
result.put("halfYearCount",halfYearCount);
return result;
}
@Override
public List<WmsProductInstock> inAndOutStockInfo() {
List<WmsProductInstock> instocks = wmsProductStockMapper.selectInStock();
List<WmsProductOutstock> outstocks = wmsProductStockMapper.selectOutStock();
Map<Long,List<WmsProductOutstock>> map = outstocks.stream().collect(Collectors.groupingBy(WmsProductOutstock::getProductId));
for (WmsProductInstock instock : instocks) {
WmsProductOutstock wmsProductOutstock = map.get(instock.getProductId()).get(0);
instock.setOutStockAmount(wmsProductOutstock.getOutstockQty());
}
return instocks;
}
@Override
public List<WmsProductOutstockDetail> tableInfo() {
return wmsProductStockMapper.tableInfo();
}
@Override
public Map<String, BigDecimal> locationCount() {
int availibleLocation = wmsProductStockMapper.selectAvailibleLocation();
int toatlLocation = wmsProductStockMapper.selectTotalLocation();
int opplyLocation = wmsProductStockMapper.selectOpplyLocation();
HashMap<String, BigDecimal> result = new HashMap<>();
BigDecimal bigDecimal = new BigDecimal(toatlLocation);
BigDecimal availibleRate = new BigDecimal(availibleLocation).divide(bigDecimal, 2, BigDecimal.ROUND_HALF_UP);
BigDecimal opplyRate = new BigDecimal(opplyLocation).divide(bigDecimal, 2, BigDecimal.ROUND_HALF_UP);
result.put("availibleRate",availibleRate);
result.put("opplyRate",opplyRate);
return result;
}
}

@ -0,0 +1,46 @@
package com.hw.wms.board.service.impl;
import com.hw.wms.board.service.ThirdWmsBorderService;
import com.hw.wms.domain.WmsBaseLocation;
import com.hw.wms.domain.WmsRawOutstock;
import com.hw.wms.mapper.WmsBaseLocationMapper;
import com.hw.wms.mapper.WmsRawInstockMapper;
import com.hw.wms.mapper.WmsRawOutstockMapper;
import org.springframework.beans.factory.annotation.Autowired;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class ThirdWmsBorderServiceImpl implements ThirdWmsBorderService {
@Autowired
private WmsRawInstockMapper wmsRawInstockMapper;
@Autowired
private WmsRawOutstockMapper wmsRawOutstockMapper;
@Autowired
private WmsBaseLocationMapper wmsBaseLocationMapper;
@Override
public Map monthRawAmount() {
BigDecimal monthRawInAmount = wmsRawInstockMapper.monthRawInAmount();
BigDecimal monthRawOutAmount = wmsRawOutstockMapper.monthRawOutAmount();
HashMap hashMap = new HashMap();
hashMap.put("monthRawInAmount",monthRawInAmount);
hashMap.put("monthRawOutAmount",monthRawOutAmount);
return hashMap;
}
@Override
public List<WmsRawOutstock> productPlan() {
return wmsRawOutstockMapper.productPlan();
}
@Override
public List<WmsBaseLocation> locationStatus() {
List<WmsBaseLocation> list = wmsBaseLocationMapper.locationStatus();
return list;
}
}

@ -172,6 +172,8 @@ public class WmsProductInstock extends BaseEntity {
@Excel(name = "同步给ERP的数量") @Excel(name = "同步给ERP的数量")
private BigDecimal erpAmount; private BigDecimal erpAmount;
private BigDecimal outStockAmount;
/** /**
* *
*/ */
@ -189,7 +191,13 @@ public class WmsProductInstock extends BaseEntity {
private String materialSpec; private String materialSpec;
public BigDecimal getOutStockAmount() {
return outStockAmount;
}
public void setOutStockAmount(BigDecimal outStockAmount) {
this.outStockAmount = outStockAmount;
}
public BigDecimal getPrice() { public BigDecimal getPrice() {
return price; return price;
} }

@ -92,4 +92,9 @@ public interface WmsBaseLocationMapper
*/ */
public int selectCountOfWmsBaseLocation(WmsBaseLocation wmsBaseLocation); public int selectCountOfWmsBaseLocation(WmsBaseLocation wmsBaseLocation);
int selectEmptyLocation();
int selectAllLocation();
List<WmsBaseLocation> locationStatus();
} }

@ -99,4 +99,5 @@ public interface WmsProductInstockMapper
*/ */
List<WmsProductInstock> selectWmsProductInstockJoinList(WmsProductInstock wmsProductInstock); List<WmsProductInstock> selectWmsProductInstockJoinList(WmsProductInstock wmsProductInstock);
List<WmsProductInstock> locationCount();
} }

@ -141,4 +141,6 @@ public interface WmsProductOutstockMapper
* @return * @return
*/ */
WmsProductOutstock selectGetProductOutstockAuditByProductOutstockId(Long productOutstockId); WmsProductOutstock selectGetProductOutstockAuditByProductOutstockId(Long productOutstockId);
List<WmsProductOutstock> locationCount();
} }

@ -2,8 +2,8 @@ package com.hw.wms.mapper;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.List; import java.util.List;
import com.hw.wms.domain.WmsProductStock;
import com.hw.wms.domain.WmsRawStock; import com.hw.wms.domain.*;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
/** /**
@ -132,4 +132,29 @@ public interface WmsProductStockMapper
public List<WmsProductStock> selectWmsProductStocks4Transfer(WmsProductStock wmsProductStock); public List<WmsProductStock> selectWmsProductStocks4Transfer(WmsProductStock wmsProductStock);
List<WmsProductStock> selectProductStockPercentage();
List<WmsProductStock> totalStock();
BigDecimal todayInstockAmount();
int selectOneWeek();
int selectTwoWeek();
int selectOneMonth();
int selectHalfYear();
List<WmsProductInstock> selectInStock();
List<WmsProductOutstock> selectOutStock();
List<WmsProductOutstockDetail> tableInfo();
int selectAvailibleLocation();
int selectTotalLocation();
int selectOpplyLocation();
} }

@ -1,6 +1,9 @@
package com.hw.wms.mapper; package com.hw.wms.mapper;
import java.math.BigDecimal;
import java.util.List; import java.util.List;
import com.hw.wms.domain.WmsProductInstock;
import com.hw.wms.domain.WmsRawInstock; import com.hw.wms.domain.WmsRawInstock;
/** /**
@ -84,4 +87,9 @@ public interface WmsRawInstockMapper
* @return * @return
*/ */
public List<WmsRawInstock> selectWmsRawInstockERPNotSynchronized(WmsRawInstock wmsRawInstock); public List<WmsRawInstock> selectWmsRawInstockERPNotSynchronized(WmsRawInstock wmsRawInstock);
List<WmsProductInstock> locationCount();
BigDecimal monthRawInAmount();
} }

@ -1,5 +1,6 @@
package com.hw.wms.mapper; package com.hw.wms.mapper;
import java.math.BigDecimal;
import java.util.List; import java.util.List;
import com.hw.wms.domain.WmsRawOutstock; import com.hw.wms.domain.WmsRawOutstock;
import com.hw.wms.domain.WmsRawOutstockDetail; import com.hw.wms.domain.WmsRawOutstockDetail;
@ -153,4 +154,10 @@ public interface WmsRawOutstockMapper
* @return * @return
*/ */
List<WmsRawOutstock> selectWmsRawOutstockERPNotSynchronized(WmsRawOutstock rawOutstock); List<WmsRawOutstock> selectWmsRawOutstockERPNotSynchronized(WmsRawOutstock rawOutstock);
List<WmsRawOutstock> locationCount();
BigDecimal monthRawOutAmount();
List<WmsRawOutstock> productPlan();
} }

@ -127,4 +127,5 @@ public interface WmsRawStockMapper {
*/ */
public List<WmsRawStock> selectAutoOutstockRawStockList(@Param("materialId") Long materialId, @Param("poNo") String poNo); public List<WmsRawStock> selectAutoOutstockRawStockList(@Param("materialId") Long materialId, @Param("poNo") String poNo);
List<WmsRawStock> selectRawLocationPercentage();
} }

@ -299,6 +299,25 @@
</where> </where>
order by location_code order by location_code
</select> </select>
<select id="locationStatus" resultType="com.hw.wms.domain.WmsBaseLocation">
select * from wms_base_location
</select>
<select id="selectEmptyLocation" resultType="java.lang.Integer">
select
count(1)
from
`hwjy-cloud`.wms_base_location
where
warehouse_id = 512 and container_code is null
</select>
<select id="selectAllLocation" resultType="java.lang.Integer">
select
count(1)
from
`hwjy-cloud`.wms_base_location
where
warehouse_id = 512
</select>
</mapper> </mapper>

@ -296,4 +296,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where> </where>
order by wpi.apply_date desc order by wpi.apply_date desc
</select> </select>
<select id="locationCount" resultType="com.hw.wms.domain.WmsProductInstock">
select
warehouse_id warehouse_id ,
sum(instock_amount) instock_amount
from
wms_product_instock
where
apply_date > now() - interval 1 month
and warehouse_id = 531
</select>
</mapper> </mapper>

@ -398,6 +398,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join mes_base_material_info mbmi on wro.product_id = mbmi.material_id left join mes_base_material_info mbmi on wro.product_id = mbmi.material_id
where wro.product_outstock_id = #{productOutstockId} where wro.product_outstock_id = #{productOutstockId}
</select> </select>
<select id="locationCount" resultType="com.hw.wms.domain.WmsProductOutstock">
select
warehouse_id warehouse_id ,
sum(outstock_qty) outstock_qty
from
wms_product_outstock
where
apply_date > now() - interval 1 month
and warehouse_id = 531
</select>
<update id="auditWmsProductOutstockByTaskCode" parameterType="WmsProductOutstock"> <update id="auditWmsProductOutstockByTaskCode" parameterType="WmsProductOutstock">
update wms_product_outstock update wms_product_outstock

@ -340,6 +340,68 @@
</where> </where>
order by wbl.loc_column asc, wbl.loc_deep desc limit #{params.limit} order by wbl.loc_column asc, wbl.loc_deep desc limit #{params.limit}
</select> </select>
<select id="totalStock" resultType="com.hw.wms.domain.WmsProductStock">
SELECT product_id,sum(total_amount) total_amount FROM `hwjy-cloud`.wms_product_stock where warehouse_id = 231 group by product_id
</select>
<select id="selectAvailibleLocation" resultType="java.lang.Integer">
select count(1) FROM `hwjy-cloud`.wms_base_location where container_code is null and location_status =1 and warehouse_id =231
</select>
<select id="selectTotalLocation" resultType="java.lang.Integer">
select count(1) FROM `hwjy-cloud`.wms_base_location where warehouse_id =231
</select>
<select id="selectOpplyLocation" resultType="java.lang.Integer">
select count(1) FROM `hwjy-cloud`.wms_base_location where warehouse_id =231 and container_code is not null
</select>
<select id="tableInfo" resultType="com.hw.wms.domain.WmsProductOutstockDetail">
select * from wms_product_outstock_detail where begin_time > now() - interval 1 month and execute_status = 3 order by begin_time asc
</select>
<select id="selectInStock" resultType="com.hw.wms.domain.WmsProductInstock">
SELECT product_id,sum(instock_amount) instock_amount FROM `hwjy-cloud`.wms_product_instock where begin_time > now() - interval 1 week and warehouse_id = 231 group by product_id
</select>
<select id="selectOutStock" resultType="com.hw.wms.domain.WmsProductOutstock">
select
product_id,
sum(outstock_qty) outstock_qty
from
`hwjy-cloud`.wms_product_outstock
where
begin_time > now() - interval 1 week
and warehouse_id = 231
group by
product_id
</select>
<select id="selectOneWeek" resultType="java.lang.Integer">
SELECT count(1) FROM `hwjy-cloud`.wms_product_stock where instock_date > now() - interval 1 week
</select>
<select id="selectTwoWeek" resultType="java.lang.Integer">
SELECT count(1) FROM `hwjy-cloud`.wms_product_stock where instock_date > now() - interval 2 week
</select>
<select id="selectOneMonth" resultType="java.lang.Integer">
SELECT count(1) FROM `hwjy-cloud`.wms_product_stock where instock_date > now() - interval 1 month
</select>
<select id="selectHalfYear" resultType="java.lang.Integer">
SELECT count(1) FROM `hwjy-cloud`.wms_product_stock where instock_date > now() - interval 6 month
</select>
<select id="todayInstockAmount" resultType="java.math.BigDecimal">
select
*
from
`hwjy-cloud`.wms_product_instock
where
warehouse_id = 231
and date_format(end_time, '%Y-%m-%D') = curdate()
</select>
<select id="selectProductStockPercentage" resultType="com.hw.wms.domain.WmsProductStock">
select
product_id ,
sum(total_amount) total_amount
from
`hwjy-cloud`.wms_product_stock
where
warehouse_id = 531
group by
product_id
</select>
<!--select id="selectWmsProductStocksBySaleorder" parameterType="WmsProductStock" resultMap="WmsProductStockResult"> <!--select id="selectWmsProductStocksBySaleorder" parameterType="WmsProductStock" resultMap="WmsProductStockResult">

@ -233,6 +233,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and wri.purchase_order_id is not null and wri.purchase_order_id !=0 and wri.purchase_order_id is not null and wri.purchase_order_id !=0
and mbmi.material_classfication = '1' and mbmi.material_classfication = '1'
</select> </select>
<select id="monthRawInAmount" resultType="java.math.BigDecimal">
select sum(instock_amount) inStock from wms_raw_instock where DATE_FORMAT( apply_date, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' )
</select>
<select id="locationStatus" resultType="com.hw.wms.domain.WmsBaseLocation">
select * from wms_base_location
</select>
<select id="locationCount" resultType="com.hw.wms.domain.WmsProductInstock">
select
warehouse_id warehouse_id,
sum(instock_amount) instock_amount
from
wms_raw_instock
where
apply_date > now() - interval 1 month
and (warehouse_id = 511
or warehouse_id = 512)
group by
warehouse_id
</select>
</mapper> </mapper>

@ -388,5 +388,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where> </where>
</select> </select>
<select id="monthRawOutAmount" resultType="java.math.BigDecimal">
select
sum(real_outstock_amount) outStock
from
wms_raw_outstock
where
DATE_FORMAT( apply_date, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' )
</select>
<select id="productPlan" resultType="com.hw.wms.domain.WmsRawOutstock">
select * from wms_raw_outstock where warehouse_id = 311 order by apply_date desc limit 100
</select>
<select id="locationCount" resultType="com.hw.wms.domain.WmsRawOutstock">
select
warehouse_id warehouse_id ,
sum(real_outstock_amount) real_outstock_amount
from
wms_raw_outstock
where
apply_date > now() - interval 1 month
and warehouse_id = 512
</select>
</mapper> </mapper>

@ -372,6 +372,17 @@
select wrs.raw_stock_id,wrs.warehouse_id,wrs.sale_order_id,wrs.material_id,wrs.instock_batch,wrs.total_amount from wms_raw_stock wrs where wrs.material_id=#{materialId} select wrs.raw_stock_id,wrs.warehouse_id,wrs.sale_order_id,wrs.material_id,wrs.instock_batch,wrs.total_amount from wms_raw_stock wrs where wrs.material_id=#{materialId}
and exists (select 1 from mes_base_barcode_info mbbi where wrs.instock_batch = mbbi.barcode_info and mbbi.po_no=#{poNo} ) and exists (select 1 from mes_base_barcode_info mbbi where wrs.instock_batch = mbbi.barcode_info and mbbi.po_no=#{poNo} )
</select> </select>
<select id="selectRawLocationPercentage" resultType="com.hw.wms.domain.WmsRawStock">
select
material_id,
sum(total_amount) total_amount
from
`hwjy-cloud`.wms_raw_stock
where
warehouse_id = 511
group by
material_id
</select>
</mapper> </mapper>

Loading…
Cancel
Save