ソースを参照

修改采购模块,新增物料出入库明细报表接口

zhoudw 7 年 前
コミット
953e0eb93f

+ 1 - 1
applications/document/document-server/src/main/resources/mapper/CustomerListMapper.xml

@@ -63,7 +63,7 @@
         and customer.companyid = #{companyId}
       </if>
     </where>
-    order by cu_id
+    order by cu_id desc
   </select>
 
   <select id="selectCustomerBycondition"  resultMap="BaseResultMap">

+ 2 - 2
applications/purchase/purchase-server/src/main/resources/mapper/ProdInOutListMapper.xml

@@ -82,7 +82,7 @@
       <if test="companyId != null">
         and   companyid = #{companyId}
       </if>
-    </where>  order by pi_id
+    </where>  order by pi_id desc
   </select>
 
   <select id="selectProdInOutListByCondition"  resultMap="BaseResultMap">
@@ -96,7 +96,7 @@
         and  prodinout.companyid = #{companyId}
       </if>
     </where>
-    order by pi_id,pd_pdno
+    order by pi_id desc,pd_pdno desc
   </select>
 
 

+ 2 - 2
applications/purchase/purchase-server/src/main/resources/mapper/PurchaseListMapper.xml

@@ -96,7 +96,7 @@
             <if test="companyId != null">
               and   purchase.companyId = #{companyId}
             </if>
-        </where>  order by pu_id,pd_detno
+        </where>  order by pu_id desc,pd_detno desc
     </select>
 
     <select id="selectPurchaseBycondition"  resultMap="BaseResultMap">
@@ -109,7 +109,7 @@
                and  companyId = #{companyId}
             </if>
         </where>
-        order by pu_id
+        order by pu_id desc
     </select>
 
 </mapper>

+ 13 - 0
applications/storage/storage-dto/src/main/java/com/usoftchina/saas/storage/po/report/ProdinoutCountView.java

@@ -0,0 +1,13 @@
+package com.usoftchina.saas.storage.po.report;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * Created by zdw
+ * 2018-11-10 15:16.
+ */
+@Data
+public class ProdinoutCountView implements Serializable{
+}

+ 33 - 0
applications/storage/storage-dto/src/main/java/com/usoftchina/saas/storage/po/report/ProdiodetailView.java

@@ -0,0 +1,33 @@
+package com.usoftchina.saas.storage.po.report;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * Created by zdw
+ * 2018-11-10 15:16.
+ */
+@Data
+public class ProdiodetailView implements Serializable{
+
+    private String pi_inoutno;
+    private String pi_class;
+    private String bizcode;
+    private String bizname;
+    private Date pi_date;
+    private Integer pd_pdno;
+    private String pr_kind;
+    private String pd_prodcode;
+    private String pr_detail;
+    private String pr_spec;
+    private String pr_unit;
+    private Double inqty;
+    private Double outqty;
+    private Double pd_price;
+    private String pd_remark;
+    private Integer companyid;
+
+
+}

+ 44 - 0
applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/controller/ProdInOutReportController.java

@@ -0,0 +1,44 @@
+package com.usoftchina.saas.storage.controller;
+
+import com.github.pagehelper.PageInfo;
+import com.usoftchina.saas.base.Result;
+import com.usoftchina.saas.commons.dto.ListReqDTO;
+import com.usoftchina.saas.page.PageRequest;
+import com.usoftchina.saas.storage.service.ProdInOutReportService;
+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("/report")
+public class ProdInOutReportController {
+
+    @Autowired
+    private ProdInOutReportService prodInOutReportService;
+
+    /**
+     * 物料出入库明细表
+     * @param page
+     * @param req
+     * @return
+     */
+    @GetMapping("/prodioDetail")
+    public Result getProdiodetail(PageRequest page, ListReqDTO req){
+        PageInfo listData = prodInOutReportService.getProdiodetail(page, req);
+        return Result.success(listData);
+    }
+
+    /**
+     * 物料收发汇总表
+     * @param page
+     * @param req
+     * @return
+     */
+    @GetMapping("/prodinoutCount")
+    public Result getProdinoutCount(PageRequest page, ListReqDTO req){
+        PageInfo listData = prodInOutReportService.getProdinoutCount(page, req);
+        return Result.success(listData);
+    }
+
+}

+ 18 - 0
applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/mapper/ProdInOutReportMapper.java

@@ -0,0 +1,18 @@
+package com.usoftchina.saas.storage.mapper;
+
+
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * Created by zdw
+ * 2018-10-18 16:57.
+ */
+public interface ProdInOutReportMapper {
+
+
+    List selectProdiodetailByCondition(@Param("con") String con,@Param("companyId") Long companyId);
+
+    List selectProdinoutCountByCondition(@Param("con") String con,@Param("companyId") Long companyId);
+}

+ 15 - 0
applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/service/ProdInOutReportService.java

@@ -0,0 +1,15 @@
+package com.usoftchina.saas.storage.service;
+
+import com.github.pagehelper.PageInfo;
+import com.usoftchina.saas.commons.dto.ListReqDTO;
+import com.usoftchina.saas.page.PageRequest;
+
+/**
+ * Created by zdw
+ * 2018-11-09 16:57.
+ */
+public interface ProdInOutReportService {
+    PageInfo getProdiodetail(PageRequest page, ListReqDTO req);
+
+    PageInfo getProdinoutCount(PageRequest page, ListReqDTO req);
+}

+ 64 - 0
applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/service/impl/ProdInOutReportServiceImpl.java

@@ -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;
+    }
+
+}

+ 2 - 2
applications/storage/storage-server/src/main/resources/mapper/ProdInOutListMapper.xml

@@ -86,7 +86,7 @@
       <if test="companyId != null">
         and   prodinout.companyid = #{companyId}
       </if>
-    </where>  order by pi_id,pd_pdno
+    </where>  order by pi_id desc,pd_pdno desc
   </select>
 
   <select id="selectProdInOutBycondition"  resultMap="BaseResultMap">
@@ -99,7 +99,7 @@
         and  companyid = #{companyId}
       </if>
     </where>
-    order by pi_id
+    order by pi_id desc
   </select>
 
 

+ 56 - 0
applications/storage/storage-server/src/main/resources/mapper/ProdInOutReportMapper.xml

@@ -0,0 +1,56 @@
+<?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.usoftchina.saas.storage.mapper.ProdInOutReportMapper">
+
+  <resultMap id="ProdiodetailMap" type="com.usoftchina.saas.storage.po.report.ProdiodetailView">
+    <result column="pi_inoutno" jdbcType="VARCHAR" property="pi_inoutno" />
+    <result column="pi_class" jdbcType="VARCHAR" property="pi_class" />
+    <result column="bizcode" jdbcType="VARCHAR" property="bizcode" />
+    <result column="bizname" jdbcType="VARCHAR" property="bizname" />
+    <result column="pi_date" jdbcType="TIMESTAMP" property="pi_date" />
+    <result column="pd_pdno" jdbcType="INTEGER" property="pd_pdno" />
+    <result column="pr_kind" jdbcType="VARCHAR" property="pr_kind" />
+    <result column="pd_prodcode" jdbcType="VARCHAR" property="pd_prodcode" />
+    <result column="pr_detail" jdbcType="VARCHAR" property="pr_detail" />
+    <result column="pr_spec" jdbcType="VARCHAR" property="pr_spec" />
+    <result column="pr_unit" jdbcType="VARCHAR" property="pr_unit" />
+    <result column="inqty" jdbcType="DOUBLE" property="inqty" />
+    <result column="outqty" jdbcType="DOUBLE" property="outqty" />
+    <result column="pd_price" jdbcType="DOUBLE" property="pd_price" />
+    <result column="pd_remark" jdbcType="VARCHAR" property="pd_remark" />
+    <result column="companyid" jdbcType="INTEGER" property="companyid" />
+  </resultMap>
+
+
+
+  <select id="selectProdiodetailByCondition" resultMap="ProdiodetailMap">
+    select  *  from prodiodetail_view
+    <where>
+      <if test="con != null">
+        ${con}
+      </if>
+      <if test="companyId != null">
+        and  companyid = #{companyId}
+      </if>
+    </where>
+    order by pi_date desc
+  </select>
+
+
+  <select id="selectProdinoutCountByCondition"  resultMap="ProdiodetailMap">
+    select  *  from prodinout
+    <where>
+      <if test="con != null">
+        ${con}
+      </if>
+      <if test="companyId != null">
+        and  companyid = #{companyId}
+      </if>
+    </where>
+    order by pi_id
+  </select>
+
+
+
+
+</mapper>