Browse Source

BUG处理

guq 7 years ago
parent
commit
071fdd0cd6
20 changed files with 402 additions and 14 deletions
  1. 1 0
      applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/exception/BizExceptionCode.java
  2. 6 0
      applications/commons/commons-server/pom.xml
  3. 7 2
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/ProductController.java
  4. 2 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/ProductMapper.java
  5. 2 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/WarehouseMapper.java
  6. 2 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/ProductService.java
  7. 90 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/ProductServiceImpl.java
  8. 4 0
      applications/document/document-server/src/main/resources/mapper/ProductMapper.xml
  9. 3 0
      applications/document/document-server/src/main/resources/mapper/WarehouseMapper.xml
  10. 5 2
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/controller/ProdInOutController.java
  11. 1 0
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/mapper/ProdInOutListMapper.java
  12. 2 0
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/ProdInOutService.java
  13. 17 0
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/impl/ProdInOutServiceImpl.java
  14. 117 4
      applications/purchase/purchase-server/src/main/resources/mapper/ProdInOutListMapper.xml
  15. 7 0
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/controller/ProdInOutController.java
  16. 1 1
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/mapper/ProdInOutListMapper.java
  17. 2 3
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/service/ProdInOutService.java
  18. 15 0
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/service/impl/ProdInOutServiceImpl.java
  19. 117 0
      applications/sale/sale-server/src/main/resources/mapper/ProdInOutListMapper.xml
  20. 1 1
      frontend/saas-web/app/view/home/infoCardList/UnauditSaleOut.js

+ 1 - 0
applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/exception/BizExceptionCode.java

@@ -35,6 +35,7 @@ public enum BizExceptionCode implements BaseExceptionCode {
     BIZ_RELUPDATE_CODEANDNAME(79311,"存在关联单据,不允许更新编号,名称"),
     BIZ_RELUPDATE_AMOUNT(79312,"存在关联单据,不允许更新期初应收,期初预收,期初日期"),
     NO_OPRATIONDATA(79400,"无可操作单据"),
+    NULL_DATA(23232,"无数据"),
 
     BOM_SAVE(79401, "产品编号+版本号已存在"),
     REPEAT_NAME(79501, "名称重复"),

+ 6 - 0
applications/commons/commons-server/pom.xml

@@ -65,6 +65,12 @@
             <artifactId>test-starter</artifactId>
             <scope>test</scope>
         </dependency>
+
+        <dependency>
+            <groupId>org.apache.poi</groupId>
+            <artifactId>poi-ooxml</artifactId>
+            <version>3.17</version>
+        </dependency>
     </dependencies>
 
     <build>

+ 7 - 2
applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/ProductController.java

@@ -16,9 +16,7 @@ import com.usoftchina.saas.page.PageRequest;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 
 @RestController
 @RequestMapping("/product")
@@ -107,4 +105,11 @@ public class ProductController {
         return Result.success(productService.getReserveCost(page, listReqDTO));
     }
 
+    //导入保存至列表
+    @RequestMapping("/saveToFormal")
+    public Result saveToFormal(Integer id, boolean update) {
+        productService.saveToFormal(id, update);
+        return Result.success();
+    }
+
 }

+ 2 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/ProductMapper.java

@@ -48,4 +48,6 @@ public interface ProductMapper extends CommonBaseMapper<Product> {
     boolean deleteProdIOByCode(@Param("code") String code, @Param("companyId") Long companyId);
 
     boolean deleteProdIODetailByCode(@Param("code") String code, @Param("companyId") Long companyId);
+
+    Long selectIdByCode(@Param("code") String code, @Param("companyId") Long companyId);
 }

+ 2 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/WarehouseMapper.java

@@ -44,4 +44,6 @@ public interface WarehouseMapper extends CommonBaseMapper<Warehouse> {
     int selectCountByCode(@Param("code") String code, @Param("companyId") Long companyId, @Param("id") Long id);
 
     int deleteCheckProdIO(@Param("id") Long id, @Param("companyId") Long companyId);
+
+    Warehouse selectWareHouse(@Param("code") String code, @Param("companyId") Long companyId);
 }

+ 2 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/ProductService.java

@@ -117,4 +117,6 @@ public interface ProductService extends CommonBaseService<ProductMapper, Product
      * @return
      */
     boolean deleteDetailById(Long id);
+
+    void saveToFormal(Integer id, boolean update);
 }

+ 90 - 1
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/ProductServiceImpl.java

@@ -1,8 +1,8 @@
 package com.usoftchina.saas.document.service.impl;
 
+import com.alibaba.fastjson.JSONObject;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
-import com.usoftchina.saas.base.Result;
 import com.usoftchina.saas.base.service.CommonBaseServiceImpl;
 import com.usoftchina.saas.commons.api.MaxnumberService;
 import com.usoftchina.saas.commons.api.MessageLogService;
@@ -12,6 +12,7 @@ import com.usoftchina.saas.commons.dto.DocBaseDTO;
 import com.usoftchina.saas.commons.dto.ListReqDTO;
 import com.usoftchina.saas.commons.exception.BizExceptionCode;
 import com.usoftchina.saas.commons.po.BillCodeSeq;
+import com.usoftchina.saas.commons.po.DataImportDetail;
 import com.usoftchina.saas.commons.po.Operation;
 import com.usoftchina.saas.commons.po.Status;
 import com.usoftchina.saas.context.BaseContextHolder;
@@ -19,12 +20,15 @@ import com.usoftchina.saas.document.dto.ProductDTO;
 import com.usoftchina.saas.document.dto.ProductListDTO;
 import com.usoftchina.saas.document.dto.ProductReserveCostDTO;
 import com.usoftchina.saas.document.entities.*;
+import com.usoftchina.saas.document.mapper.DataImportMapper;
 import com.usoftchina.saas.document.mapper.ProductDetailMapper;
 import com.usoftchina.saas.document.mapper.ProductMapper;
+import com.usoftchina.saas.document.mapper.WarehouseMapper;
 import com.usoftchina.saas.document.service.ProductService;
 import com.usoftchina.saas.document.service.WarehouseService;
 import com.usoftchina.saas.exception.BizException;
 import com.usoftchina.saas.page.PageRequest;
+import com.usoftchina.saas.utils.CollectionUtils;
 import com.usoftchina.saas.utils.RegexpUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -44,6 +48,10 @@ public class ProductServiceImpl extends CommonBaseServiceImpl<ProductMapper, Pro
     private WarehouseService warehouseService;
     @Autowired
     private ProductDetailMapper productDetailMapper;
+    @Autowired
+    private DataImportMapper dataImportMapper;
+    @Autowired
+    private WarehouseMapper warehouseMapper;
 
     @Override
     public PageInfo<ProductDTO> getProductsByCondition(PageRequest page, ListReqDTO listReqDTO) {
@@ -518,6 +526,87 @@ public class ProductServiceImpl extends CommonBaseServiceImpl<ProductMapper, Pro
         return true;
     }
 
+
+
+    @Override
+    public void saveToFormal(Integer id, boolean update) {
+        if (null == id || "0".equals(id)) {
+            return;
+        }
+        Long companyId = BaseContextHolder.getCompanyId();
+        StringBuilder err = new StringBuilder();
+        List<ProductListDTO> list = new ArrayList<>();
+        ProductListDTO listDTO = null;
+        List<DataImportDetail> details = dataImportMapper.selectDataById(id);
+        if (!CollectionUtils.isEmpty(details)) {
+            Map<String, List<DataImportDetail>> datas = CollectionUtils.groupBy(details, DataImportDetail::getDd_codevalue);
+            Integer detno = null;
+            for (String code : datas.keySet()) {
+                listDTO = new ProductListDTO();
+                List<ProductDetail> productDetails = new ArrayList<>();
+                int i = getMapper().validateCodeWhenInsert(code, companyId);
+                List<DataImportDetail> data = datas.get(code);
+                DataImportDetail main = dataImportMapper.selectProductBycode(code, companyId);
+                Product product = JSONObject.parseObject(main.getDd_maindata(), Product.class);
+                Warehouse warehouse = null;
+                //验证仓库
+                if (!StringUtils.isEmpty(product.getPr_whcode())) {
+                    warehouse = warehouseMapper.selectWareHouse(product.getPr_whcode(), companyId);
+                    if (null == warehouse) {
+                        err.append("物料编号为: " + product.getPr_code() + " 的物料仓库: "+ product.getPr_whname() +" 在系统中不存在,请确认数据是否正确");
+                        break;
+                    }
+                    product.setPr_whid(warehouse.getId());
+                    product.setPr_status(Status.OPEN.getDisplay());
+                    product.setPr_statuscode(Status.OPEN.name());
+                }
+                //添加从表
+                if (data.size() > 0) {
+                    detno = 1;
+                    for (DataImportDetail productDetail : data) {
+                        ProductDetail detail = JSONObject.parseObject(productDetail.getDd_detaildata(), ProductDetail.class);
+                        if (null != detail) {
+                            //验证仓库
+                            if (!StringUtils.isEmpty(product.getPr_whcode())) {
+                                warehouse = warehouseMapper.selectWareHouse(detail.getPd_whcode(), companyId);
+                                if (null == warehouse) {
+                                    err.append("物料编号为: " + product.getPr_code() + " 的物料仓库: "+ product.getPr_whname() +" 在系统中不存在,请确认数据是否正确");
+                                    break;
+                                }
+                                detail.setPd_whid(Integer.valueOf(warehouse.getId().toString()));
+                                detail.setPd_detno(detno);
+                                detno++;
+                            }
+                            productDetails.add(detail);
+                        }
+                    }
+                }
+                //编号不存在
+                if (i == 0) {
+                    product.setId(0l);
+                //编号存在、需要更新
+                } else if (update){
+                    Long pr_id = getMapper().selectIdByCode(code, companyId);
+                    product.setId(pr_id);
+                //编号存在、不需要处理
+                } else {
+                    continue;
+                }
+                listDTO.setMain(product);
+                listDTO.setItems(productDetails);
+                list.add(listDTO);
+            }
+            if (err.length() > 0) {
+                dataImportMapper.updateDataImportError(err.toString(), id);
+                throw new BizException(12345, err.toString());
+            }
+            for (ProductListDTO  dto : list) {
+                saveData(dto);
+            }
+            dataImportMapper.updateDataImport(id);
+        }
+    }
+
     private List<ProductReserveCostDTO> geReserveCost(ListReqDTO listReqDTO) {
         Long companyId = BaseContextHolder.getCompanyId();
         String condition = listReqDTO.getFinalCondition();

+ 4 - 0
applications/document/document-server/src/main/resources/mapper/ProductMapper.xml

@@ -901,5 +901,9 @@
     <delete id="deleteProdIODetailByCode">
         DELETE FROM PRODIODETAIL WHERE PD_PIID IN (SELECT PI_ID FROM PRODINOUT WHERE PI_INOUTNO=#{code} AND PRODINOUT.COMPANYID = #{companyId}) AND PRODIODETAIL.COMPANYID = #{companyId}
     </delete>
+
+    <select id="selectIdByCode" parameterType="long">
+        select pr_id from product where pr_code=#{code} and companyId=#{companyId}
+    </select>
 </mapper>
 

+ 3 - 0
applications/document/document-server/src/main/resources/mapper/WarehouseMapper.xml

@@ -370,5 +370,8 @@
     <select id="deleteCheckProdIO" resultType="int">
         SELECT COUNT(*) FROM PRODIODETAIL WHERE pd_whid = #{id} and companyid = #{companyId}
     </select>
+    <select id="selectWareHouse" resultMap="WarehouseResultMapper">
+        select * from warehouse where wh_code=#{code} and companyId=#{companyId}
+    </select>
 </mapper>
 

+ 5 - 2
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/controller/ProdInOutController.java

@@ -210,6 +210,9 @@ public class ProdInOutController {
         return prodInOutService.turnProdOut(id);
     }
 
-
-
+    @GetMapping("/homepageList")
+    public Result homepageList(PageRequest page, ListReqDTO req){
+        PageInfo pageInfo = prodInOutService.homepageList(page, req);
+         return Result.success(pageInfo);
+    }
 }

+ 1 - 0
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/mapper/ProdInOutListMapper.java

@@ -16,4 +16,5 @@ public interface ProdInOutListMapper {
     List<ProdInOutList> selectProdInOutBycondition(@Param("con") String con,@Param("companyId") Long companyId);
 
 
+    List<ProdInOutList> selectHomePageList(@Param("con") String con, @Param("companyId") Long companyId);
 }

+ 2 - 0
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/ProdInOutService.java

@@ -83,4 +83,6 @@ public interface ProdInOutService extends CommonBaseService<ProdInOutMapper, Pro
     String getMaxnumber(BillCodeSeq bill);
 
     void getDefaultWarehouseByProduct(Long pi_id);
+
+    PageInfo homepageList(PageRequest page, ListReqDTO req);
 }

+ 17 - 0
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/impl/ProdInOutServiceImpl.java

@@ -18,6 +18,7 @@ import com.usoftchina.saas.context.BaseContextHolder;
 import com.usoftchina.saas.document.api.WarehouseApi;
 import com.usoftchina.saas.exception.BizException;
 import com.usoftchina.saas.exception.ExceptionCode;
+import com.usoftchina.saas.page.PageDefault;
 import com.usoftchina.saas.page.PageRequest;
 import com.usoftchina.saas.purchase.dto.ProdIODetailDTO;
 import com.usoftchina.saas.purchase.dto.ProdInOutDTO;
@@ -60,6 +61,20 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
     @Autowired
     private CommonService commonService;
 
+    @Override
+    public PageInfo homepageList(@PageDefault(size = 10) PageRequest page, ListReqDTO req) {
+        PageHelper.startPage(page.getNumber(), page.getSize());
+        List<ProdInOutList> lists = null;
+        Long companyId = BaseContextHolder.getCompanyId();
+        String con = req.getFinalCondition();
+        if (null == con) {
+            con = "1=1";
+        }
+        lists = prodInOutListMapper.selectHomePageList(con,companyId);
+        //取分页信息
+        PageInfo<ProdInOutList> pageInfo = new PageInfo<ProdInOutList>(lists);
+        return pageInfo;
+    }
 
     @Override
     public PageInfo<ProdInOutList> getListData(PageRequest page, ListReqDTO req) {
@@ -603,6 +618,8 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
     }
 
 
+
+
     private ProdInOut checkAndReturnOrder (Long id){
         if(id == null || id <= 0) {
             throw new BizException(BizExceptionCode.ILLEGAL_ID);

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

@@ -101,6 +101,107 @@
     <result column="pr_text4" property="pr_text4"/>
   </resultMap>
 
+  <resultMap id="homePageList" type="com.usoftchina.saas.purchase.po.ProdHomePageList">
+    <id column="pi_id" jdbcType="INTEGER" property="id" />
+    <result column="pi_inoutno" jdbcType="VARCHAR" property="pi_inoutno" />
+    <result column="pi_class" jdbcType="VARCHAR" property="pi_class" />
+    <result column="pi_date" jdbcType="TIMESTAMP" property="pi_date" />
+    <result column="pi_vendid" jdbcType="INTEGER" property="pi_vendid" />
+    <result column="pi_vendcode" jdbcType="VARCHAR" property="pi_vendcode" />
+    <result column="pi_vendname" jdbcType="VARCHAR" property="pi_vendname" />
+    <result column="pi_custid" jdbcType="INTEGER" property="pi_custid" />
+    <result column="pi_custcode" jdbcType="VARCHAR" property="pi_custcode" />
+    <result column="pi_custname" jdbcType="VARCHAR" property="pi_custname" />
+    <result column="pi_puid" jdbcType="INTEGER" property="pi_puid" />
+    <result column="pi_pucode" jdbcType="VARCHAR" property="pi_pucode" />
+    <result column="pi_said" jdbcType="INTEGER" property="pi_said" />
+    <result column="pi_sacode" jdbcType="VARCHAR" property="pi_sacode" />
+    <result column="pi_total" jdbcType="DOUBLE" property="pi_total" />
+    <result column="pi_status" jdbcType="VARCHAR" property="pi_status" />
+    <result column="pi_statuscode" jdbcType="VARCHAR" property="pi_statuscode" />
+    <result column="pi_printstatus" jdbcType="VARCHAR" property="pi_printstatus" />
+    <result column="pi_printstatuscode" jdbcType="VARCHAR" property="pi_printstatuscode" />
+    <result column="pi_text1" jdbcType="VARCHAR" property="pi_text1" />
+    <result column="pi_text2" jdbcType="VARCHAR" property="pi_text2" />
+    <result column="pi_text3" jdbcType="VARCHAR" property="pi_text3" />
+    <result column="pi_text4" jdbcType="VARCHAR" property="pi_text4" />
+    <result column="pi_text5" jdbcType="VARCHAR" property="pi_text5" />
+    <result column="pi_auditdate" jdbcType="TIMESTAMP" property="pi_auditdate" />
+    <result column="pi_auditman" jdbcType="VARCHAR" property="pi_auditman" />
+    <result column="pi_address" jdbcType="VARCHAR" property="pi_address" />
+    <result column="pi_remark" jdbcType="VARCHAR" property="pi_remark" />
+    <result column="pd_piid" jdbcType="INTEGER" property="pd_piid" />
+    <result column="pd_inoutno" jdbcType="VARCHAR" property="pd_inoutno" />
+    <result column="pd_piclass" jdbcType="VARCHAR" property="pd_piclass" />
+    <result column="pd_pdno" jdbcType="INTEGER" property="pd_pdno" />
+    <result column="pd_ordercode" jdbcType="VARCHAR" property="pd_ordercode" />
+    <result column="pd_orderdetno" jdbcType="INTEGER" property="pd_orderdetno" />
+    <result column="pd_prodid" jdbcType="INTEGER" property="pd_prodid" />
+    <result column="pd_prodcode" jdbcType="VARCHAR" property="pd_prodcode" />
+    <result column="pd_unit" jdbcType="VARCHAR" property="pd_unit" />
+    <result column="pd_inqty" jdbcType="DOUBLE" property="pd_inqty" />
+    <result column="pd_outqty" jdbcType="DOUBLE" property="pd_outqty" />
+    <result column="pd_orderprice" jdbcType="DOUBLE" property="pd_orderprice" />
+    <result column="pd_sendprice" jdbcType="DOUBLE" property="pd_sendprice" />
+    <result column="pd_price" jdbcType="DOUBLE" property="pd_price" />
+    <result column="pd_total" jdbcType="DOUBLE" property="pd_total" />
+    <result column="pd_taxrate" jdbcType="DOUBLE" property="pd_taxrate" />
+    <result column="pd_netprice" jdbcType="DOUBLE" property="pd_netprice" />
+    <result column="pd_nettotal" jdbcType="DOUBLE" property="pd_nettotal" />
+    <result column="pd_whid" jdbcType="INTEGER" property="pd_whid" />
+    <result column="pd_whcode" jdbcType="VARCHAR" property="pd_whcode" />
+    <result column="pd_whname" jdbcType="VARCHAR" property="pd_whname" />
+    <result column="pd_inwhid" jdbcType="INTEGER" property="pd_inwhid" />
+    <result column="pd_inwhcode" jdbcType="VARCHAR" property="pd_inwhcode" />
+    <result column="pd_inwhname" jdbcType="VARCHAR" property="pd_inwhname" />
+    <result column="pd_orderid" jdbcType="INTEGER" property="pd_orderid" />
+    <result column="pd_sdid" jdbcType="INTEGER" property="pd_sdid" />
+    <result column="pd_status" jdbcType="INTEGER" property="pd_status" />
+    <result column="companyid" property="companyId" jdbcType="BIGINT" />
+    <result column="updaterId" property="updaterId" jdbcType="INTEGER" />
+    <result column="updaterName" jdbcType="VARCHAR" property="updaterName" />
+    <result column="updateTime" property="updateTime" jdbcType="TIMESTAMP" />
+    <result column="creatorId" property="creatorId" jdbcType="INTEGER"/>
+    <result column="creatorName" jdbcType="VARCHAR" property="creatorName" />
+    <result column="createTime" property="createTime" jdbcType="TIMESTAMP" />
+    <result column="pd_text1" jdbcType="VARCHAR" property="pd_text1" />
+    <result column="pd_text2" jdbcType="VARCHAR" property="pd_text2" />
+    <result column="pd_text3" jdbcType="VARCHAR" property="pd_text3" />
+    <result column="pd_text4" jdbcType="VARCHAR" property="pd_text4" />
+    <result column="pd_text5" jdbcType="VARCHAR" property="pd_text5" />
+    <result column="pd_ym" jdbcType="INTEGER" property="pd_ym" />
+    <result column="pd_yqty" jdbcType="DOUBLE" property="pd_yqty" />
+    <result column="pd_ioid" jdbcType="INTEGER" property="pd_ioid" />
+    <result column="pi_iocode" jdbcType="VARCHAR" property="pi_iocode" />
+    <result column="pd_remark" jdbcType="VARCHAR" property="pd_remark" />
+    <result column="pr_id" property="pr_id"/>
+    <result column="pr_code" property="pr_code"/>
+    <result column="pr_detail" property="pr_detail"/>
+    <result column="pr_spec" property="pr_spec"/>
+    <result column="pr_unit" property="pr_unit"/>
+    <result column="pr_kind" property="pr_kind"/>
+    <result column="pr_orispeccode" property="pr_orispeccode"/>
+    <result column="pr_whid" property="pr_whid"/>
+    <result column="pr_whcode" property="pr_whcode"/>
+    <result column="pr_whname" property="pr_whname"/>
+    <result column="pr_zxbzs" property="pr_zxbzs"/>
+    <result column="pr_leadtime" property="pr_leadtime"/>
+    <result column="pr_brand" property="pr_brand"/>
+    <result column="pr_standardprice" property="pr_standardprice"/>
+    <result column="pr_purcprice" property="pr_purcprice"/>
+    <result column="pr_saleprice" property="pr_saleprice"/>
+    <result column="pr_vendid" property="pr_vendid"/>
+    <result column="pr_vendname" property="pr_vendname"/>
+    <result column="pr_vendcode" property="pr_vendcode"/>
+    <result column="pr_status" property="pr_status"/>
+    <result column="pr_statuscode" property="pr_statuscode"/>
+    <result column="pr_text1" property="pr_text1"/>
+    <result column="pr_text2" property="pr_text2"/>
+    <result column="pr_text3" property="pr_text3"/>
+    <result column="pr_text4" property="pr_text4"/>
+    <result column="qty" property="qty"/>
+  </resultMap>
+
   <select id="selectProdInOutBycondition"  resultMap="BaseResultMap">
     select  *  from prodinout
     <where>
@@ -113,6 +214,22 @@
     </where>  order by pi_id desc
   </select>
 
+  <select id="selectHomePageList" resultMap="homePageList">
+    select  *,
+    case WHEN pi_class='采购验收单' then pd_inqty when pi_class='采购验退单' then pd_outqty else 0 end qty
+    from prodinout left join prodiodetail on pi_id = pd_piid left join vendor on pi_vendid=ve_id
+    left join product on pd_prodid=pr_id
+    <where>
+      <if test="con != null">
+        ${con}
+      </if>
+      <if test="companyId != null">
+        and  prodinout.companyid = #{companyId}
+      </if>
+    </where>
+    order by pi_id desc,pd_pdno desc
+  </select>
+
   <select id="selectProdInOutListByCondition"  resultMap="BaseResultMap">
     select  *  from prodinout left join prodiodetail on pi_id = pd_piid left join vendor on pi_vendid=ve_id
     left join product on pd_prodid=pr_id
@@ -126,8 +243,4 @@
     </where>
     order by pi_id desc,pd_pdno desc
   </select>
-
-
-
-
 </mapper>

+ 7 - 0
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/controller/ProdInOutController.java

@@ -39,6 +39,13 @@ public class ProdInOutController {
         return Result.success(listData);
     }
 
+    @GetMapping("/homepageList")
+    public Result homepageList(PageRequest page, ListReqDTO req){
+        PageInfo pageInfo = prodInOutService.homepageList(page, req);
+        return Result.success(pageInfo);
+    }
+
+
     /**
      * 获取出入库单表单
      *

+ 1 - 1
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/mapper/ProdInOutListMapper.java

@@ -16,5 +16,5 @@ public interface ProdInOutListMapper {
 
     List<ProdInOutList> selectProdInOutBycondition(@Param("con") String con, @Param("companyId") Long companyId);
 
-
+    List<ProdInOutList> selectHomePageList(@Param("con") String con, @Param("companyId") Long companyId);
 }

+ 2 - 3
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/service/ProdInOutService.java

@@ -1,17 +1,14 @@
 package com.usoftchina.saas.sale.service;
 
 import com.github.pagehelper.PageInfo;
-import com.usoftchina.saas.base.Result;
 import com.usoftchina.saas.base.service.CommonBaseService;
 import com.usoftchina.saas.commons.dto.BatchDealBaseDTO;
 import com.usoftchina.saas.commons.dto.DocBaseDTO;
-import com.usoftchina.saas.commons.dto.DocSavedDTO;
 import com.usoftchina.saas.commons.dto.ListReqDTO;
 import com.usoftchina.saas.commons.po.BillCodeSeq;
 import com.usoftchina.saas.page.PageRequest;
 
 import com.usoftchina.saas.sale.dto.ProdInOutFormDTO;
-import com.usoftchina.saas.sale.dto.ProdInOutReqDTO;
 import com.usoftchina.saas.sale.mapper.ProdInOutMapper;
 import com.usoftchina.saas.storage.po.ProdInOut;
 import com.usoftchina.saas.storage.po.ProdInOutList;
@@ -122,4 +119,6 @@ public interface ProdInOutService extends CommonBaseService<ProdInOutMapper, Pro
     DocBaseDTO turnProdin(Long id);
 
     String getMaxnumber(BillCodeSeq bill);
+
+    PageInfo homepageList(PageRequest page, ListReqDTO req);
 }

+ 15 - 0
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/service/impl/ProdInOutServiceImpl.java

@@ -362,6 +362,21 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         return pageInfo;
     }
 
+    @Override
+    public PageInfo homepageList(@PageDefault(size = 10) PageRequest page, ListReqDTO req) {
+        PageHelper.startPage(page.getNumber(), page.getSize());
+        List<ProdInOutList> lists = null;
+        Long companyId = BaseContextHolder.getCompanyId();
+        String con = req.getFinalCondition();
+        if (null == con) {
+            con = "1=1";
+        }
+        lists = prodInOutListMapper.selectHomePageList(con,companyId);
+        //取分页信息
+        PageInfo<ProdInOutList> pageInfo = new PageInfo<ProdInOutList>(lists);
+        return pageInfo;
+    }
+
     private List<ProdInOutList> getListByMode(ListReqDTO req) {
         List<ProdInOutList> list = null;
         Long companyId = BaseContextHolder.getCompanyId();

+ 117 - 0
applications/sale/sale-server/src/main/resources/mapper/ProdInOutListMapper.xml

@@ -74,6 +74,107 @@
     <result column="pd_ordertotal" jdbcType="DOUBLE" property="pd_ordertotal" />
   </resultMap>
 
+  <resultMap id="homePageList" type="com.usoftchina.saas.sale.po.ProdHomePageList">
+    <id column="pi_id" jdbcType="INTEGER" property="id" />
+    <result column="pi_inoutno" jdbcType="VARCHAR" property="pi_inoutno" />
+    <result column="pi_class" jdbcType="VARCHAR" property="pi_class" />
+    <result column="pi_date" jdbcType="TIMESTAMP" property="pi_date" />
+    <result column="pi_vendid" jdbcType="INTEGER" property="pi_vendid" />
+    <result column="pi_vendcode" jdbcType="VARCHAR" property="pi_vendcode" />
+    <result column="pi_vendname" jdbcType="VARCHAR" property="pi_vendname" />
+    <result column="pi_custid" jdbcType="INTEGER" property="pi_custid" />
+    <result column="pi_custcode" jdbcType="VARCHAR" property="pi_custcode" />
+    <result column="pi_custname" jdbcType="VARCHAR" property="pi_custname" />
+    <result column="pi_puid" jdbcType="INTEGER" property="pi_puid" />
+    <result column="pi_pucode" jdbcType="VARCHAR" property="pi_pucode" />
+    <result column="pi_said" jdbcType="INTEGER" property="pi_said" />
+    <result column="pi_sacode" jdbcType="VARCHAR" property="pi_sacode" />
+    <result column="pi_total" jdbcType="DOUBLE" property="pi_total" />
+    <result column="pi_status" jdbcType="VARCHAR" property="pi_status" />
+    <result column="pi_statuscode" jdbcType="VARCHAR" property="pi_statuscode" />
+    <result column="pi_printstatus" jdbcType="VARCHAR" property="pi_printstatus" />
+    <result column="pi_printstatuscode" jdbcType="VARCHAR" property="pi_printstatuscode" />
+    <result column="pi_text1" jdbcType="VARCHAR" property="pi_text1" />
+    <result column="pi_text2" jdbcType="VARCHAR" property="pi_text2" />
+    <result column="pi_text3" jdbcType="VARCHAR" property="pi_text3" />
+    <result column="pi_text4" jdbcType="VARCHAR" property="pi_text4" />
+    <result column="pi_text5" jdbcType="VARCHAR" property="pi_text5" />
+    <result column="pi_auditdate" jdbcType="TIMESTAMP" property="pi_auditdate" />
+    <result column="pi_auditman" jdbcType="VARCHAR" property="pi_auditman" />
+    <result column="pi_address" jdbcType="VARCHAR" property="pi_address" />
+    <result column="pi_remark" jdbcType="VARCHAR" property="pi_remark" />
+    <result column="pd_piid" jdbcType="INTEGER" property="pd_piid" />
+    <result column="pd_inoutno" jdbcType="VARCHAR" property="pd_inoutno" />
+    <result column="pd_piclass" jdbcType="VARCHAR" property="pd_piclass" />
+    <result column="pd_pdno" jdbcType="INTEGER" property="pd_pdno" />
+    <result column="pd_ordercode" jdbcType="VARCHAR" property="pd_ordercode" />
+    <result column="pd_orderdetno" jdbcType="INTEGER" property="pd_orderdetno" />
+    <result column="pd_prodid" jdbcType="INTEGER" property="pd_prodid" />
+    <result column="pd_prodcode" jdbcType="VARCHAR" property="pd_prodcode" />
+    <result column="pd_unit" jdbcType="VARCHAR" property="pd_unit" />
+    <result column="pd_inqty" jdbcType="DOUBLE" property="pd_inqty" />
+    <result column="pd_outqty" jdbcType="DOUBLE" property="pd_outqty" />
+    <result column="pd_orderprice" jdbcType="DOUBLE" property="pd_orderprice" />
+    <result column="pd_sendprice" jdbcType="DOUBLE" property="pd_sendprice" />
+    <result column="pd_price" jdbcType="DOUBLE" property="pd_price" />
+    <result column="pd_total" jdbcType="DOUBLE" property="pd_total" />
+    <result column="pd_taxrate" jdbcType="DOUBLE" property="pd_taxrate" />
+    <result column="pd_netprice" jdbcType="DOUBLE" property="pd_netprice" />
+    <result column="pd_nettotal" jdbcType="DOUBLE" property="pd_nettotal" />
+    <result column="pd_whid" jdbcType="INTEGER" property="pd_whid" />
+    <result column="pd_whcode" jdbcType="VARCHAR" property="pd_whcode" />
+    <result column="pd_whname" jdbcType="VARCHAR" property="pd_whname" />
+    <result column="pd_inwhid" jdbcType="INTEGER" property="pd_inwhid" />
+    <result column="pd_inwhcode" jdbcType="VARCHAR" property="pd_inwhcode" />
+    <result column="pd_inwhname" jdbcType="VARCHAR" property="pd_inwhname" />
+    <result column="pd_orderid" jdbcType="INTEGER" property="pd_orderid" />
+    <result column="pd_sdid" jdbcType="INTEGER" property="pd_sdid" />
+    <result column="pd_status" jdbcType="INTEGER" property="pd_status" />
+    <result column="companyid" property="companyId" jdbcType="BIGINT" />
+    <result column="updaterId" property="updaterId" jdbcType="INTEGER" />
+    <result column="updaterName" jdbcType="VARCHAR" property="updaterName" />
+    <result column="updateTime" property="updateTime" jdbcType="TIMESTAMP" />
+    <result column="creatorId" property="creatorId" jdbcType="INTEGER"/>
+    <result column="creatorName" jdbcType="VARCHAR" property="creatorName" />
+    <result column="createTime" property="createTime" jdbcType="TIMESTAMP" />
+    <result column="pd_text1" jdbcType="VARCHAR" property="pd_text1" />
+    <result column="pd_text2" jdbcType="VARCHAR" property="pd_text2" />
+    <result column="pd_text3" jdbcType="VARCHAR" property="pd_text3" />
+    <result column="pd_text4" jdbcType="VARCHAR" property="pd_text4" />
+    <result column="pd_text5" jdbcType="VARCHAR" property="pd_text5" />
+    <result column="pd_ym" jdbcType="INTEGER" property="pd_ym" />
+    <result column="pd_yqty" jdbcType="DOUBLE" property="pd_yqty" />
+    <result column="pd_ioid" jdbcType="INTEGER" property="pd_ioid" />
+    <result column="pi_iocode" jdbcType="VARCHAR" property="pi_iocode" />
+    <result column="pd_remark" jdbcType="VARCHAR" property="pd_remark" />
+    <result column="pr_id" property="pr_id"/>
+    <result column="pr_code" property="pr_code"/>
+    <result column="pr_detail" property="pr_detail"/>
+    <result column="pr_spec" property="pr_spec"/>
+    <result column="pr_unit" property="pr_unit"/>
+    <result column="pr_kind" property="pr_kind"/>
+    <result column="pr_orispeccode" property="pr_orispeccode"/>
+    <result column="pr_whid" property="pr_whid"/>
+    <result column="pr_whcode" property="pr_whcode"/>
+    <result column="pr_whname" property="pr_whname"/>
+    <result column="pr_zxbzs" property="pr_zxbzs"/>
+    <result column="pr_leadtime" property="pr_leadtime"/>
+    <result column="pr_brand" property="pr_brand"/>
+    <result column="pr_standardprice" property="pr_standardprice"/>
+    <result column="pr_purcprice" property="pr_purcprice"/>
+    <result column="pr_saleprice" property="pr_saleprice"/>
+    <result column="pr_vendid" property="pr_vendid"/>
+    <result column="pr_vendname" property="pr_vendname"/>
+    <result column="pr_vendcode" property="pr_vendcode"/>
+    <result column="pr_status" property="pr_status"/>
+    <result column="pr_statuscode" property="pr_statuscode"/>
+    <result column="pr_text1" property="pr_text1"/>
+    <result column="pr_text2" property="pr_text2"/>
+    <result column="pr_text3" property="pr_text3"/>
+    <result column="pr_text4" property="pr_text4"/>
+    <result column="qty" property="qty"/>
+  </resultMap>
+
 
   <select id="selectProdInOutListByCondition" resultMap="BaseResultMap">
     select  *  from prodinout
@@ -101,4 +202,20 @@
       order by pi_id desc
   </select>
 
+  <select id="selectHomePageList" resultMap="homePageList">
+    select  *,
+    case WHEN pi_class='出货单' then pd_outqty when pi_class='销售退货单' then pd_inqty else 0 end qty
+    from prodinout left join prodiodetail on pi_id = pd_piid left join product on pr_id = pd_prodid
+    left join customer on pi_custid=cu_id
+    <where>
+      <if test="con != null">
+        ${con}
+      </if>
+      <if test="companyId != null">
+        and  prodinout.companyId = #{companyId}
+      </if>
+    </where>
+    order by pi_id desc
+  </select>
+
 </mapper>

+ 1 - 1
frontend/saas-web/app/view/home/infoCardList/UnauditSaleOut.js

@@ -65,7 +65,7 @@ Ext.define('saas.view.home.infoCardList.UnauditSaleOut', {
         dataIndex: 'pr_detail',
         width: 150
     }, {
-        text: '出货数量',
+        text: '数量',
         dataIndex: 'pd_outqty',
         xtype:'numbercolumn',
         width: 110,