Commit d3da7be4 by 李小惠

新增库存管理页面查询装备接口,修改出入库接口

parent 1011d55d
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.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -142,5 +142,6 @@ public class InventoryDto implements Serializable {
*/
private String instructions;
private Integer property;
}
......@@ -127,8 +127,8 @@ public class LogSummaryReq extends BaseRequest {
private String column;
private String order;
private Date startTime;
private Date endTime;
private String startTime;
private String endTime;
private String typeName;
}
......@@ -298,6 +298,13 @@ public class InventoryController {
return ApiRes.success(inventoryService.EqsImport(req));
}
//查询状态满足的装备(过质保期,报废,销毁)
@PostMapping(path = "/EqsByState",name = "查询状态满足的装备#enable")
@ApiOperation("查询状态满足的装备")
public ApiRes<PageResult<InventoryDto>> EqsByState(@RequestBody InventoryReq req){
return ApiRes.success(inventoryService.EqsByState(req));
}
......
......@@ -74,7 +74,7 @@ public class OutAndInboundController {
@PostMapping(path="/ShowInOutRecordsByItemsCount",name="出入库记录条件查询展示合计#enable")
@ApiOperation("出入库记录条件查询展示合计")
public ApiRes<Integer> ShowInOutRecordsByItemsCount(@RequestBody @Validated(ValidationApi.page.class) LogSummaryReq req){
public ApiRes<LogSummary> ShowInOutRecordsByItemsCount(@RequestBody @Validated(ValidationApi.page.class) LogSummaryReq req){
return ApiRes.success(logSummaryService.ShowInOutRecordsByItemsCount(req));
}
......
......@@ -87,6 +87,14 @@ public interface InventoryMapper extends BaseMapper<Inventory> {
@Param("typeIdList")List<String> typeIdList,
@Param("sizeIdList")List<String> sizeIdList);
int EqsByStateSum(@Param("req") InventoryReq req);
List<InventoryDto> EqsByState(@Param("req") InventoryReq req,
@Param("pageNo") Long pageNo,
@Param("pageSize") Long pageSize);
// IPage<InventoryDto> GetDetailByTerms(@Param("page") Page<Object> defaultPage, @Param("req") InventoryReq req);
......
......@@ -28,6 +28,8 @@ public interface LogSummaryMapper extends BaseMapper<LogSummary> {
int ShowInOutRecordsSum(@Param("orgId")Long orgId, @Param("sizeId")String sizeId,
@Param("typeId")String typeId, @Param("price")BigDecimal price);
LogSummary ShowInOutRecordsByItemsCount(@Param("req") LogSummaryReq req);
}
......
......@@ -88,4 +88,5 @@ public interface InventoryService extends IService<Inventory> {
boolean EqsImport(InventoryReq req);
PageResult<InventoryDto> EqsByState(InventoryReq req);
}
......@@ -24,5 +24,5 @@ public interface LogSummaryService extends IService<LogSummary> {
PageResult<LogSummary> ShowInOutRecords(LogSummaryReq req);
Integer ShowInOutRecordsByItemsCount(LogSummaryReq req);
LogSummary ShowInOutRecordsByItemsCount(LogSummaryReq req);
}
......@@ -666,5 +666,15 @@ public class InventoryServiceImpl extends ServiceImpl<InventoryMapper, Inventory
return false;
}
@Override
public PageResult<InventoryDto> EqsByState(InventoryReq req) {
List<InventoryDto> list=inventoryMapper.EqsByState(req,(req.getPageNo()-1)*req.getPageSize(),req.getPageSize());
int size=inventoryMapper.EqsByStateSum(req);
Page<InventoryDto> page = PageFactory.getDefaultPage(req.getPageNo(), req.getPageSize());
page.setRecords(list);
page.setTotal(size);
return PageResultFactory.createPageResult(page);
}
}
\ No newline at end of file
......@@ -161,6 +161,7 @@ public class TjServiceImpl implements TjService {
finalTjOrgEqsDto.setCkOutboundNumber(0);
finalTjOrgEqsDto.setDjgOutboundNumber(0);
finalTjOrgEqsDto.setDjgStockNumber(0);
finalTjOrgEqsDto.setDestructionNumber(0);
List<String> orgList= inventorySummaryMapper.getTotalData(String.valueOf(req.getOrgId()));
List<TjOrgEqsDto> allData=new ArrayList<>();
......@@ -204,6 +205,7 @@ public class TjServiceImpl implements TjService {
finalTjOrgEqsDto.setCkOutboundNumber(finalTjOrgEqsDto.getCkOutboundNumber()+ tj.getCkOutboundNumber());
finalTjOrgEqsDto.setDjgOutboundNumber(finalTjOrgEqsDto.getDjgOutboundNumber()+ tj.getDjgOutboundNumber());
finalTjOrgEqsDto.setDjgStockNumber(finalTjOrgEqsDto.getDjgStockNumber()+ tj.getDjgStockNumber());
finalTjOrgEqsDto.setDestructionNumber(finalTjOrgEqsDto.getDestructionNumber()+ tj.getDestructionNumber());
}
return finalTjOrgEqsDto;
}
......
......@@ -661,6 +661,58 @@
left JOIN base_supplier bs ON bs.id = t2.supplier_id
</select>
<select id="EqsByStateSum" resultType="java.lang.Integer">
select count(*) from (
select t.* ,et.name as type_name,es.name as size_name FROM(
select
a.*,i.state,i.bussiness_state,i.production_date,i.warranty_period,i.maintenance_period,i.fix_count,i.price,i.property
from
(select * FROM base_warehouse_inventory wi
where org_id=#{req.orgId} and type_id=#{req.typeId} and location_type=#{req.locationType}
) as a
join base_inventory i on a.epc=i.epc
<if test="req.state == 'expire'">
and i.warranty_period != 0 and DATE_ADD(i.production_date, INTERVAL i.warranty_period MONTH) &lt; NOW() and
i.state != "broken" and i.state != "destoty"
</if>
<if test="req.state == 'destory'">
and i.state = "destory"
</if>
<if test="req.state == 'broken'">
and i.state = "broken" and i.location_state = "in"
</if>
) as t
join base_equipment_type et on t.type_id=et.id
join base_equipment_size es on es.id=t.size_id
)as b
</select>
<select id="EqsByState" resultType="com.junmp.jyzb.api.bean.dto.InventoryDto">
select t.* ,et.name as type_name,es.name as size_name FROM(
select
a.*,i.state,i.bussiness_state,i.production_date,i.warranty_period,i.maintenance_period,i.fix_count,i.price,i.property
from
(select * FROM base_warehouse_inventory wi
where org_id=#{req.orgId} and type_id=#{req.typeId} and location_type=#{req.locationType}
) as a
join base_inventory i on a.epc=i.epc
<if test="req.state == 'expire'">
and i.warranty_period != 0 and DATE_ADD(i.production_date, INTERVAL i.warranty_period MONTH) &lt; NOW() and
i.state != "broken" and i.state != "destoty"
</if>
<if test="req.state == 'destory'">
and i.state = "destory"
</if>
<if test="req.state == 'broken'">
and i.state = "broken" and i.location_state = "in"
</if>
<if test="pageNo != null and pageNo != '' and pageSize != null and pageSize != '' ">
limit #{pageNo},#{pageSize}
</if>
) as t
join base_equipment_type et on t.type_id=et.id
join base_equipment_size es on es.id=t.size_id
</select>
</mapper>
\ No newline at end of file
......@@ -92,6 +92,41 @@
where ls.org_id = #{orgId}
and ls.location_type = 0) as b
</select>
<select id="ShowInOutRecordsByItemsCount" resultType="com.junmp.jyzb.entity.LogSummary">
select sum(a.number) as number from (
select number from base_log_summary ls where location_type=#{req.locationType}
<if test="req.orgId != null and req.orgId !=''">
and org_id=#{req.orgId}
</if>
<if test="req.orderMainId != null and req.orderMainId !=''">
and order_main_id=#{req.orderMainId}
</if>
<if test="req.bussinessType != null and req.bussinessType !=''">
and bussiness_type=#{req.bussinessType}
</if>
<if test="req.outInState != null and req.outInState !=''">
and out_in_state=#{req.outInState}
</if>
<if test="req.locationId != null and req.locationId !=''">
and location_id=#{req.locationId}
</if>
<if test="req.userName != null and req.userName !=''">
and user_name=#{req.userName}
</if>
<if test="req.startTime != null and req.startTime != ''">
and use_time &gt;= #{req.startTime}
</if>
<if test="req.endTime != null and req.endTime != ''">
and use_time &lt;= #{req.endTime}
</if>
<if test="req.typeName != null and req.typeName !=''">
and epuipment_list like concat('%',#{req.typeName},'%')
</if>
<if test="req.column != null and req.column != '' and req.order != null and req.order != '' ">
order by ${req.column} ${req.order}
</if>
) as a
</select>
</mapper>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论