1.提交查询汇总记录列表接口
parent
18d17933be
commit
9a9b292495
@ -0,0 +1,48 @@
|
||||
package com.glxp.api.controller.inout;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.glxp.api.common.res.BaseResponse;
|
||||
import com.glxp.api.common.util.ResultVOUtils;
|
||||
import com.glxp.api.entity.inout.IoStatOrderEntity;
|
||||
import com.glxp.api.req.inout.FilterStatDataRequest;
|
||||
import com.glxp.api.service.inout.IoStatDayService;
|
||||
import com.glxp.api.service.inout.IoStatMonthService;
|
||||
import com.glxp.api.service.inout.IoStatOrderService;
|
||||
import com.glxp.api.service.inout.IoStatYearService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 出入库汇总数据接口
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
public class IoStatDataController {
|
||||
|
||||
@Resource
|
||||
private IoStatOrderService statOrderService;
|
||||
@Resource
|
||||
private IoStatDayService statDayService;
|
||||
@Resource
|
||||
private IoStatMonthService statMonthService;
|
||||
@Resource
|
||||
private IoStatYearService statYearService;
|
||||
|
||||
/**
|
||||
* 查询汇总记录列表
|
||||
*
|
||||
* @param statDataRequest
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/udiwms/inout/stat/filter")
|
||||
public BaseResponse filterList(FilterStatDataRequest statDataRequest) {
|
||||
List<IoStatOrderEntity> list = statOrderService.filterList(statDataRequest);
|
||||
PageInfo<IoStatOrderEntity> pageInfo = new PageInfo<>(list);
|
||||
return ResultVOUtils.page(pageInfo);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
package com.glxp.api.req.inout;
|
||||
|
||||
import com.glxp.api.util.page.ListPageRequest;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 查询出入库汇总记录详情接口参数
|
||||
*/
|
||||
@Data
|
||||
public class FilterStatDataDetailRequest extends ListPageRequest {
|
||||
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 产品名称
|
||||
*/
|
||||
private String productName;
|
||||
|
||||
/**
|
||||
* 批次号
|
||||
*/
|
||||
private String batchNo;
|
||||
|
||||
/**
|
||||
* 汇总记录号
|
||||
*/
|
||||
private String recordKey;
|
||||
|
||||
}
|
@ -0,0 +1,136 @@
|
||||
package com.glxp.api.res.inout;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 出入库汇总数据VO
|
||||
*/
|
||||
@Data
|
||||
public class IoStatDataResponse {
|
||||
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 记录号外键
|
||||
*/
|
||||
private String recordKeyFk;
|
||||
|
||||
/**
|
||||
* 年度
|
||||
*/
|
||||
private Integer year;
|
||||
|
||||
/**
|
||||
* 季度
|
||||
*/
|
||||
private Integer quarter;
|
||||
|
||||
/**
|
||||
* 月份
|
||||
*/
|
||||
private Integer month;
|
||||
|
||||
/**
|
||||
* 日
|
||||
*/
|
||||
private Integer day;
|
||||
|
||||
/**
|
||||
* 物资编码主键
|
||||
*/
|
||||
private String relIdFk;
|
||||
|
||||
/**
|
||||
* 产品DI
|
||||
*/
|
||||
private String nameCode;
|
||||
|
||||
/**
|
||||
* 产品名称
|
||||
*/
|
||||
private String productName;
|
||||
|
||||
/**
|
||||
* 规格型号
|
||||
*/
|
||||
private String ggxh;
|
||||
|
||||
/**
|
||||
* 批次号
|
||||
*/
|
||||
private String batchNo;
|
||||
|
||||
/**
|
||||
* 期初数量
|
||||
*/
|
||||
private Integer beginCount;
|
||||
|
||||
/**
|
||||
* 期初价格
|
||||
*/
|
||||
private BigDecimal beginPrice;
|
||||
|
||||
/**
|
||||
* 期初金额
|
||||
*/
|
||||
private BigDecimal beginAmount;
|
||||
|
||||
/**
|
||||
* 入库数量
|
||||
*/
|
||||
private Integer inCount;
|
||||
|
||||
/**
|
||||
* 入库价格
|
||||
*/
|
||||
private BigDecimal inPrice;
|
||||
|
||||
/**
|
||||
* 入库金额
|
||||
*/
|
||||
private BigDecimal inAmount;
|
||||
|
||||
/**
|
||||
* 出库数量
|
||||
*/
|
||||
private Integer outCount;
|
||||
|
||||
/**
|
||||
* 出库价格
|
||||
*/
|
||||
private BigDecimal outPrice;
|
||||
|
||||
/**
|
||||
* 出库金额
|
||||
*/
|
||||
private BigDecimal outAmount;
|
||||
|
||||
/**
|
||||
* 结余数量
|
||||
*/
|
||||
private Integer balanceCount;
|
||||
|
||||
/**
|
||||
* 结余价格
|
||||
*/
|
||||
private BigDecimal balancePrice;
|
||||
|
||||
/**
|
||||
* 结余金额
|
||||
*/
|
||||
private BigDecimal balanceAmount;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
}
|
@ -1,7 +1,20 @@
|
||||
package com.glxp.api.service.inout;
|
||||
|
||||
import com.glxp.api.entity.inout.IoStatOrderEntity;
|
||||
import com.glxp.api.req.inout.FilterStatDataRequest;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 物资出入库汇总 - 总表 Service
|
||||
*/
|
||||
public interface IoStatOrderService {
|
||||
|
||||
/**
|
||||
* 查询出入库汇总列表
|
||||
*
|
||||
* @param statDataRequest
|
||||
* @return
|
||||
*/
|
||||
List<IoStatOrderEntity> filterList(FilterStatDataRequest statDataRequest);
|
||||
}
|
||||
|
@ -1,12 +1,34 @@
|
||||
package com.glxp.api.service.inout.impl;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.glxp.api.dao.inout.IoStatOrderDao;
|
||||
import com.glxp.api.entity.inout.IoStatOrderEntity;
|
||||
import com.glxp.api.req.inout.FilterStatDataRequest;
|
||||
import com.glxp.api.service.inout.IoStatOrderService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class IoStatOrderServiceImpl implements IoStatOrderService {
|
||||
|
||||
@Resource
|
||||
private IoStatOrderDao statOrderDao;
|
||||
|
||||
@Override
|
||||
public List<IoStatOrderEntity> filterList(FilterStatDataRequest statDataRequest) {
|
||||
if (null == statDataRequest) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
if (null != statDataRequest.getPage() && null != statDataRequest.getLimit()) {
|
||||
PageHelper.offsetPage((statDataRequest.getPage() - 1) * statDataRequest.getLimit(), statDataRequest.getLimit());
|
||||
}
|
||||
return statOrderDao.filterList(statDataRequest);
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,23 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.glxp.api.dao.inout.IoStatOrderDao">
|
||||
<select id="filterList" resultType="com.glxp.api.entity.inout.IoStatOrderEntity">
|
||||
select *
|
||||
from io_stat_order
|
||||
<where>
|
||||
<if test="type != null and type != ''">
|
||||
and type = #{type}
|
||||
</if>
|
||||
<if test="recordKey != null and recordKey != ''">
|
||||
and recordKey like concat('%', #{recordKey}, '#')
|
||||
</if>
|
||||
<if test="startDate != null and startDate != ''">
|
||||
and format(date, '%Y-%m-%d') >= format(#{startDate}, '%Y-%m-%d')
|
||||
</if>
|
||||
<if test="endDate != null and endDate != ''">
|
||||
and format(date, '%Y-%m-%d') <= format(#{endDate}, '%Y-%m-%d')
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue