Browse Source

Merge remote-tracking branch 'origin/dev' into dev

heqinwei 7 years ago
parent
commit
485e89f065
16 changed files with 342 additions and 16 deletions
  1. 30 0
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/controller/PurchaseReportController.java
  2. 10 0
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/mapper/PurchasePayMapper.java
  3. 3 0
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/po/PurchaseList.java
  4. 40 0
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/po/report/PurchasePay.java
  5. 10 0
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/PurchaseReportService.java
  6. 56 0
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/impl/PurchaseReportServiceImpl.java
  7. 31 1
      applications/purchase/purchase-server/src/main/resources/mapper/PurchaseListMapper.xml
  8. 32 0
      applications/purchase/purchase-server/src/main/resources/mapper/PurchasePayMapper.xml
  9. 2 2
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/controller/SaleReportController.java
  10. 1 1
      frontend/saas-web/app/view/core/dbfind/DbfindGridPanel.js
  11. 1 1
      frontend/saas-web/app/view/core/dbfind/DbfindTrigger.js
  12. 2 2
      frontend/saas-web/app/view/document/bom/BasePanel.js
  13. 101 0
      frontend/saas-web/app/view/document/bom/FormController.js
  14. 13 7
      frontend/saas-web/app/view/document/bom/FormPanel.js
  15. 9 1
      frontend/saas-web/app/view/sale/sale/QueryPanel.js
  16. 1 1
      frontend/saas-web/app/view/sys/messagelog/DataList.js

+ 30 - 0
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/controller/PurchaseReportController.java

@@ -0,0 +1,30 @@
+package com.usoftchina.saas.purchase.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.purchase.service.PurchaseReportService;
+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;
+
+/**
+ * @author: guq
+ * @create: 2018-11-08 19:18
+ **/
+@RestController
+@RequestMapping("/report")
+public class PurchaseReportController {
+
+    @Autowired
+    private PurchaseReportService purchaseReportService;
+
+    @GetMapping("/purchasePay")
+    public Result PurchasePay(PageRequest page, ListReqDTO req) {
+        PageInfo listData = purchaseReportService.getPurchasePayData(page, req);
+        return Result.success(listData);
+    }
+
+}

+ 10 - 0
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/mapper/PurchasePayMapper.java

@@ -0,0 +1,10 @@
+package com.usoftchina.saas.purchase.mapper;
+
+import com.usoftchina.saas.purchase.po.report.PurchasePay;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+public interface PurchasePayMapper {
+    List<PurchasePay> selectByCondition(@Param("con") String con, @Param("companyId") Long companyId);
+}

+ 3 - 0
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/po/PurchaseList.java

@@ -2,6 +2,7 @@ package com.usoftchina.saas.purchase.po;
 
 
 import com.usoftchina.saas.base.entity.CommonBaseEntity;
+import com.usoftchina.saas.document.dto.ProductDTO;
 import lombok.Data;
 
 import java.io.Serializable;
@@ -116,4 +117,6 @@ public class PurchaseList extends CommonBaseEntity implements Serializable {
     private String pd_text5;
 
     private Double pd_yqty;
+
+    private ProductDTO productDTO;
 }

+ 40 - 0
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/po/report/PurchasePay.java

@@ -0,0 +1,40 @@
+package com.usoftchina.saas.purchase.po.report;
+
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * @author: guq
+ * @create: 2018-11-09 14:22
+ **/
+@Data
+public class PurchasePay {
+    private Integer pb_id;
+
+    private String pb_code;
+
+    private String pu_vendcode;
+
+    private String pu_vendname;
+
+    private String pb_recorder;
+
+    private Date pb_recorddate;
+
+    private String pbd_slcode;
+
+    private String pbd_slkind;
+
+    private Double pbd_amount;
+
+    private Double pbd_nowbalance;
+
+    private Double pb_pbdamount;
+
+    private Double pb_payrate;
+
+    private String pd_remark;
+
+    private Integer companyid;
+}

+ 10 - 0
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/PurchaseReportService.java

@@ -0,0 +1,10 @@
+package com.usoftchina.saas.purchase.service;
+
+import com.github.pagehelper.PageInfo;
+import com.usoftchina.saas.commons.dto.ListReqDTO;
+import com.usoftchina.saas.page.PageRequest;
+
+public interface PurchaseReportService {
+
+    PageInfo getPurchasePayData(PageRequest page, ListReqDTO req);
+}

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

@@ -0,0 +1,56 @@
+package com.usoftchina.saas.purchase.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.purchase.mapper.PurchasePayMapper;
+import com.usoftchina.saas.purchase.service.PurchaseReportService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * @author: guq
+ * @create: 2018-11-09 14:33
+ **/
+@Service
+public class PurchaseReportServiceImpl implements PurchaseReportService{
+
+    @Autowired
+    private PurchasePayMapper purchasePayMapper;
+    @Override
+    public PageInfo getPurchasePayData(PageRequest page, ListReqDTO req) {
+        return getListDATA(page, req, "PurchasePay");
+    }
+
+    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 ("PurchasePay".equals(type)) {
+            list = purchasePayMapper.selectByCondition(con, companyId);
+        }
+        return list;
+    }
+}

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

@@ -54,11 +54,41 @@
         <result column="pd_text4" property="pd_text4" jdbcType="VARCHAR" />
         <result column="pd_text5" property="pd_text5" jdbcType="VARCHAR" />
         <result column="pd_yqty" property="pd_yqty" jdbcType="DOUBLE" />
+        <association property="productDTO" javaType="com.usoftchina.saas.document.dto.ProductDTO">
+            <id column="pr_id" property="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_docdate" property="pr_docdate"/>
+            <result column="pr_recordmanid" property="pr_recordmanid"/>
+            <result column="pr_recordman" property="pr_recordman"/>
+            <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"/>
+        </association>
     </resultMap>
 
     <select id="selectPurchaseListByCondition"  resultMap="BaseResultMap">
         select  *  from purchase left join purchasedetail on pu_id=pd_puid
-        left join product on pd_prodcode=pr_code
+        left join product on pd_prodid=pr_id
         <where>
             <if test="con != null">
                  ${con}

+ 32 - 0
applications/purchase/purchase-server/src/main/resources/mapper/PurchasePayMapper.xml

@@ -0,0 +1,32 @@
+<?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.purchase.mapper.PurchasePayMapper" >
+  <resultMap id="BaseResultMap" type="com.usoftchina.saas.purchase.po.report.PurchasePay" >
+    <result column="pb_id" property="pb_id" jdbcType="INTEGER" />
+    <result column="pb_code" property="pb_code" jdbcType="VARCHAR" />
+    <result column="pu_vendcode" property="pu_vendcode" jdbcType="VARCHAR" />
+    <result column="pu_vendname" property="pu_vendname" jdbcType="VARCHAR" />
+    <result column="pb_recorder" property="pb_recorder" jdbcType="VARCHAR" />
+    <result column="pb_recorddate" property="pb_recorddate" jdbcType="TIMESTAMP" />
+    <result column="pbd_slcode" property="pbd_slcode" jdbcType="VARCHAR" />
+    <result column="pbd_slkind" property="pbd_slkind" jdbcType="VARCHAR" />
+    <result column="pbd_amount" property="pbd_amount" jdbcType="DOUBLE" />
+    <result column="pbd_nowbalance" property="pbd_nowbalance" jdbcType="DOUBLE" />
+    <result column="pb_pbdamount" property="pb_pbdamount" jdbcType="DOUBLE" />
+    <result column="pb_payrate" property="pb_payrate" jdbcType="DOUBLE" />
+    <result column="pd_remark" property="pd_remark" jdbcType="VARCHAR" />
+    <result column="companyid" property="companyid" jdbcType="INTEGER" />
+  </resultMap>
+  <select id="selectByCondition" resultMap="BaseResultMap">
+    select  *  from purchasepay_view
+    <where>
+      <if test="con != null">
+        ${con}
+      </if>
+      <if test="companyId != null">
+        and  companyId = #{companyId}
+      </if>
+    </where>
+    order by pb_recorddate desc
+  </select>
+</mapper>

+ 2 - 2
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/controller/SaleReportController.java

@@ -21,13 +21,13 @@ public class SaleReportController {
     @Autowired
     private SaleReportService saleReportService;
 
-    @GetMapping("/SaleProfit")
+    @GetMapping("/saleProfit")
     public Result SaleProfit(PageRequest page, ListReqDTO req) {
         PageInfo listData = saleReportService.getSaleProfitData(page, req);
         return Result.success(listData);
     }
 
-    @GetMapping("/SaleRec")
+    @GetMapping("/saleRec")
     public Result SaleRec(PageRequest page, ListReqDTO req) {
         PageInfo listData = saleReportService.getSaleRecData(page, req);
         return Result.success(listData);

+ 1 - 1
frontend/saas-web/app/view/core/dbfind/DbfindGridPanel.js

@@ -120,7 +120,7 @@ Ext.define('saas.view.core.dbfind.DbfindGridPanel', {
                         }
                     }
                 }
-                me.ownerCt.trigger.aftertrigger(me.ownerCt.trigger);
+                me.ownerCt.trigger.aftertrigger(me.ownerCt.trigger,record);
             }
             me.ownerCt.close();
         }

+ 1 - 1
frontend/saas-web/app/view/core/dbfind/DbfindTrigger.js

@@ -283,7 +283,7 @@ Ext.define('saas.view.core.dbfind.DbfindTrigger', {
                         }
                     }
                 }
-                me.aftertrigger(me);
+                me.aftertrigger(me,record);
             }
         }
     },

+ 2 - 2
frontend/saas-web/app/view/document/bom/BasePanel.js

@@ -48,8 +48,8 @@ Ext.define('saas.view.document.bom.BasePanel', {
             xtype : "numbercolumn",   
         },{
             text : "母件编号", 
-            width : 200.0, 
-            dataIndex : "bo_mothercode", 
+            dataIndex : "bo_mothercode",
+            width : 200.0,
         }, 
         {
             text : "母件名称", 

+ 101 - 0
frontend/saas-web/app/view/document/bom/FormController.js

@@ -5,6 +5,107 @@ Ext.define('saas.view.document.bom.FormController', {
     init: function (form) {
         var me = this;
         this.control({
+            //放大镜赋值关系 以及 tpl模板
+            'dbfindtrigger[name=bo_mothercode]':{
+                beforerender:function(f){
+                    Ext.apply(f,{
+                        dataUrl:'/api/document/product/list',
+                        addXtype: 'document-product-formpanel',
+                        addTitle: '物料资料',
+                        dbfinds:[
+                        {
+                            from:'pr_code',to:'bo_mothercode'
+                        }, {
+                            from:'pr_detail',to:'bo_mothername'
+                        }, {
+                            from:'pr_spec',to:'pr_spec'
+                        }, {
+                            from:'id',to:'bo_motherid',ignore:true
+                        }],
+                        dbtpls:[{
+                            field:'pr_code',width:100
+                        },{
+                            field:'pr_detail',width:100
+                        }],
+                        defaultCondition: "pr_statuscode='OPEN'",
+                        dbSearchFields:[{
+                            emptyText:'输入物料编号、名称或规格',
+                            xtype : "textfield", 
+                            name : "search", 
+                            width: 200,
+                            getCondition: function(v) {
+                                return "(upper(pr_spec) like '%" + v.toUpperCase()+"%' or upper(pr_code) like '%"+v.toUpperCase()+"%' or upper(pr_detail) like '%"+v.toUpperCase()+"%')";
+                            },
+                            allowBlank : true, 
+                            columnWidth : 0.25
+                        }],
+                        dbColumns:[{
+                            "text": "物料ID",
+                            "hidden": true,
+                            "dataIndex": "id",
+                        }, {
+                            "text": "物料编号",       
+                            "dataIndex": "pr_code",
+                            "width": 200,
+                        }, {
+                            "text": "物料名称",
+                            "width": 200,
+                            "dataIndex": "pr_detail",
+                        }, {
+                            "text": "规格",
+                            "dataIndex": "pr_spec",
+                            "width": 100,
+                        }, {
+                            "text": "单位",
+                            "dataIndex": "pr_unit",
+                            "width": 100,
+                        },{
+                            "text": "仓库id",
+                            "dataIndex": "pr_whid",
+                            "hidden": true,
+                        },{
+                            "text": "仓库编号",
+                            "dataIndex": "pr_whcode",
+                            "hidden": true,
+                        },{
+                            "text": "仓库",
+                            "dataIndex": "pr_whname",
+                            "width": 200,
+                        },{
+                            "text": "总库存数",
+                            "dataIndex": "po_onhand",
+                            "width": 100,
+                            align:'right'
+                        },{
+                            "text": "类型",
+                            "dataIndex": "pr_kind",
+                            "width": 100,
+                        },{
+                            "text": "型号",
+                            "dataIndex": "pr_orispeccode",
+                            "width": 100,
+                        },{
+                            "text": "品牌",
+                            "dataIndex": "pr_brand",
+                            "width": 100,
+                        },{
+                            "text": "供应商",
+                            "dataIndex": "pr_vendname",
+                            "width": 100,
+                        },{
+                            "text": "最小包装",
+                            "dataIndex": "pr_zxbzs",
+                            "width": 100,
+                            align:'right'
+                        },{
+                            "text": "L/T",
+                            "dataIndex": "pr_leadtime",
+                            "width": 100,
+                        }]
+                    }) ;   
+
+                }
+            },
             //从表多选放大镜赋值关系 以及 tpl模板
             'multidbfindtrigger[name=bd_soncode]':{
                 beforerender:function(f){

+ 13 - 7
frontend/saas-web/app/view/document/bom/FormPanel.js

@@ -10,7 +10,7 @@ Ext.define('saas.view.document.bom.FormPanel', {
     //字段属性
     _title:'BOM资料',
     _idField: 'id',
-    _codeField: 'bo_mothercode',
+    _codeField: 'codefield',
     _statusField: 'bo_status',
     _statusCodeField: 'bo_statuscode',
     _readUrl:'/api/document/bom/read/',
@@ -53,21 +53,27 @@ Ext.define('saas.view.document.bom.FormPanel', {
     },{
         xtype: 'hidden',
         name: 'bo_motherid',
-        fieldLabel: '母件id'
+        fieldLabel: '产品id'
+    },{
+        xtype : "dbfindtrigger", 
+        name: 'bo_mothercode',
+        fieldLabel: '产品编号',
+        allowBlank: false
     },{
         xtype: 'textfield',
         name: 'bo_mothername',
-        fieldLabel: '母件名称',
+        fieldLabel: '产品名称',
         allowBlank: false
     },{
         xtype: 'textfield',
-        name: 'bo_mothercode',
-        fieldLabel: '母件编号',
-        allowBlank: false
+        name: 'pr_spec',
+        fieldLabel: '产品规格',
+        reddOnly:true,
+        ignore:true
     },{
         xtype: 'textfield',
         name: 'bo_status',
-        fieldLabel: 'BOM状态'
+        fieldLabel: '产品状态'
     },{
         xtype: 'hidden',
         name: 'bo_statuscode',

+ 9 - 1
frontend/saas-web/app/view/sale/sale/QueryPanel.js

@@ -139,7 +139,7 @@ Ext.define('saas.view.sale.sale.QueryPanel', {
         relativeColumn: [ {
             text: 'id',
             dataIndex: 'sa_id',
-            width: 100,
+            width: 0,
             xtype: 'numbercolumn'
         }, {
             text: '单据编号',
@@ -167,6 +167,14 @@ Ext.define('saas.view.sale.sale.QueryPanel', {
             text: '物料编号',
             dataIndex: 'sd_prodcode',
             width: 120
+        }, {
+            text: '物料名称',
+            dataIndex: 'pe_detail',
+            width: 120
+        }, {
+            text: '物料规格',
+            dataIndex: 'pr_spec',
+            width: 120
         }, {
             text: '数量',
             dataIndex: 'sd_qty',

+ 1 - 1
frontend/saas-web/app/view/sys/messagelog/DataList.js

@@ -21,7 +21,7 @@ Ext.define('saas.view.sys.messagelog.DataList', {
         width: 150,
         name: 'ml_man',
         xtype: 'textfield',
-        emptyText : '处理人'
+        emptyText : '操作人员'
     },{
         cls:'x-formpanel-btn-orange',
         xtype:'button',