|
|
@@ -0,0 +1,64 @@
|
|
|
+package com.usoftchina.saas.storage.service.impl;
|
|
|
+
|
|
|
+import com.github.pagehelper.PageHelper;
|
|
|
+import com.github.pagehelper.PageInfo;
|
|
|
+import com.usoftchina.saas.commons.dto.ListReqDTO;
|
|
|
+import com.usoftchina.saas.context.BaseContextHolder;
|
|
|
+import com.usoftchina.saas.page.PageRequest;
|
|
|
+import com.usoftchina.saas.storage.mapper.ProdInOutReportMapper;
|
|
|
+import com.usoftchina.saas.storage.service.ProdInOutReportService;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+/**
|
|
|
+ * Created by zdw
|
|
|
+ * 2018-11-09 17:09.
|
|
|
+ */
|
|
|
+@Service
|
|
|
+public class ProdInOutReportServiceImpl implements ProdInOutReportService{
|
|
|
+ @Autowired
|
|
|
+ private ProdInOutReportMapper prodInOutReportMapper;
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public PageInfo getProdiodetail(PageRequest page, ListReqDTO req) {
|
|
|
+ return getListDATA(page, req, "Prodiodetail");
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public PageInfo getProdinoutCount(PageRequest page, ListReqDTO req) {
|
|
|
+ return getListDATA(page, req, "ProdinoutCount");
|
|
|
+ }
|
|
|
+
|
|
|
+ private PageInfo getListDATA(PageRequest page, ListReqDTO req, String type) {
|
|
|
+ //设置默认分页
|
|
|
+ if (null == page || page.getSize() == 0 || page.getNumber() == 0) {
|
|
|
+ page = new PageRequest();
|
|
|
+ page.setNumber(1);
|
|
|
+ page.setSize(10);
|
|
|
+ }
|
|
|
+ PageHelper.startPage(page.getNumber(), page.getSize());
|
|
|
+ //查询数据
|
|
|
+ List lists = getListByType(req, type);
|
|
|
+ //取分页信息
|
|
|
+ PageInfo pageInfo = new PageInfo(lists);
|
|
|
+ return pageInfo;
|
|
|
+ }
|
|
|
+
|
|
|
+ private List getListByType(ListReqDTO req, String type) {
|
|
|
+ List list = null;
|
|
|
+ Long companyId = BaseContextHolder.getCompanyId();
|
|
|
+ String con = req.getFinalCondition();
|
|
|
+ if (null == con) {
|
|
|
+ con = "1=1";
|
|
|
+ }
|
|
|
+ if ("Prodiodetail".equals(type)) {
|
|
|
+ list = prodInOutReportMapper.selectProdiodetailByCondition(con, companyId);
|
|
|
+ } else if ("ProdinoutCount".equals(type)){
|
|
|
+ list = prodInOutReportMapper.selectProdinoutCountByCondition(con, companyId);
|
|
|
+ }
|
|
|
+ return list;
|
|
|
+ }
|
|
|
+
|
|
|
+}
|