Browse Source

Merge branch 'dev' of ssh://10.10.100.21/source/saas-platform into dev

zhuth 7 years ago
parent
commit
7ac0dc78cc

+ 4 - 0
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/mapper/ProdInOutMapper.java

@@ -24,4 +24,8 @@ public interface ProdInOutMapper extends CommonBaseMapper<ProdInOut> {
     Integer validateCodeWhenUpdate(@Param("pi_inoutno") String pi_inoutno, @Param("id") Long id,@Param("companyId") Long companyId);
 
     String selectCodeById(Long id);
+
+    int checkQtyFromPurchase(String pu_code);
+
+    int checkQtyFromProdIn(String pu_code);
 }

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

@@ -192,6 +192,13 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         if (updateDetails.size()>0) {
             prodIODetailMapper.batchUpdate(updateDetails);
         }
+
+        //检查更新后数据是否
+        String pu_code = prodInOut.getPi_pucode();
+        if (!StringUtils.isEmpty(pu_code)){
+            checkUpdateQty(pu_code,pi_class);
+        }
+
         baseDTO = getBaseDTOById(pi_id,pi_class,pi_inoutno);
         //计算金额,未税单价,未税金额等
         calcProdInout(pi_id,pi_class);
@@ -202,6 +209,7 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         return baseDTO;
     }
 
+
     @Override
     @Transactional
     public void delete(Long id) {
@@ -358,6 +366,22 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         }
     }
 
+    private void checkUpdateQty(String pu_code, String pi_class) {
+        int count = 0;
+        if ("采购验收单".equals(pi_class)) {
+            count = getMapper().checkQtyFromPurchase(pu_code);
+            if (count>0){
+                throw new BizException(500, "明细行数量超过来源采购单明细行数量");
+            }
+        } else if ("采购验退单".equals(pi_class)) {
+            count = getMapper().checkQtyFromProdIn(pu_code);
+            if (count>0){
+                throw new BizException(500, "明细行数量超过来源采购验收单明细行数量");
+            }
+        }
+
+    }
+
 
 
     public void updateYqty(ProdInOut prodInOut) {

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

@@ -435,8 +435,16 @@
     select pi_inoutno from prodinout where pi_id=#{id}
   </select>
 
+  <select id="checkQtyFromPurchase" resultType="int" parameterType="string">
+  select count(1) from(
+  select sum(pd_inqty) nowqty,(select pd_qty from purchasedetail where pd_id = pd_orderid) totalqty   from prodiodetail   where pd_ordercode=#{pu_code}
+  GROUP BY pd_orderid) t  where t.nowqty>t.totalqty
+  </select>
 
-
-
+  <select id="checkQtyFromProdIn" resultType="int" parameterType="string">
+  select count(1) from(
+  select sum(b.pd_outqty) nowqty,(select a.pd_inqty from prodiodetail a where a.pd_id = b.pd_ioid and a.pd_piclass='采购验收单') totalqty from prodiodetail b where b.pd_ordercode=#{pu_code} and b.pd_piclass='采购验退单'
+  GROUP BY b.pd_ioid) t where t.nowqty>t.totalqty
+  </select>
 
 </mapper>

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

@@ -164,7 +164,7 @@ Ext.define('saas.view.core.dbfind.DbfindTrigger', {
         if(f.ownerCt.xtype.trim().toUpperCase().indexOf('QUERYFORMPANEL')>-1){
             f.belong = 'form';
             return f.ownerCt.ownerCt
-        }else if(f.ownerCt.xtype.trim().toUpperCase().indexOf('FORMPANEL')>-1){
+        }else if(f.ownerCt.xtype.trim().toUpperCase().indexOf('FORM')>-1){
             f.belong = 'form';
             return f.ownerCt
         }else if(f.column){

+ 3 - 2
frontend/saas-web/app/view/money/fundtransfer/QueryPanel.js

@@ -8,9 +8,10 @@ Ext.define('saas.view.money.fundtransfer.QueryPanel', {
     viewName: 'money-fundtransfer-querypanel',
     
     queryFormItems: [{
-        xtype : "datefield", 
+        xtype : "condatefield", 
         name : "ft_date", 
-        fieldLabel : "单据日期"
+        fieldLabel : "单据日期",
+        columnWidth: 0.5
     }],
     moreQueryFormItems: [],
     queryGridConfig: {

+ 5 - 5
frontend/saas-web/app/view/purchase/report/Purchase.js

@@ -11,23 +11,23 @@ Ext.define('saas.view.purchase.report.Purchase', {
     listUrl: '/api/purchase/purchase/list',
     defaultCondition: null,
     reportTitle: '采购明细报表',
-    QueryWidth:0.25,
+    QueryWidth:0.1,
     //筛选:供应商、日期(必填)、业务状态			
     searchItems: [ {
         xtype: 'dbfindtrigger',
         name: 'pu_vendname',
         fieldLabel: '供应商名称',
-        columnWidth: 0.25
+        columnWidth: 0.2
     }, {
         xtype: 'condatefield',
         name: 'pu_date',
         fieldLabel: '单据日期',
-        columnWidth: 0.25
+        columnWidth: 0.5
     }, {
         xtype: 'multicombo',
         name: 'pu_acceptstatuscode',
         fieldLabel: '业务状态',
-        columnWidth: 0.25,
+        columnWidth: 0.2,
         datas: [
             ["TURNIN", "已入库"],
             ["UNTURNIN", "未入库"],
@@ -55,7 +55,7 @@ Ext.define('saas.view.purchase.report.Purchase', {
         width: 200
     }, {
         text: '业务状态',
-        dataIndex: 'pu_status'
+        dataIndex: 'pu_acceptstatus'
     }, {
         text: '采购员',
         dataIndex: 'pu_buyername'

+ 2 - 3
frontend/saas-web/app/view/purchase/report/PurchaseController.js

@@ -11,8 +11,6 @@ Ext.define('saas.view.purchase.report.PurchaseController', {
                         addXtype: 'document-vendor-formpanel',
                         addTitle: '供应商资料',
                         dbfinds:[{
-                            from:'ve_code',to:'pu_vendcode'
-                        },{
                             from:'ve_name',to:'pu_vendname'
                         }],
                         dbtpls:[{
@@ -31,7 +29,8 @@ Ext.define('saas.view.purchase.report.PurchaseController', {
                             allowBlank : true, 
                             columnWidth : 0.25
                         }],
-                        dbColumns:[{
+                        dbColumns:[
+                        {
                             "text": "供应商ID",
                             "hidden": true,
                             "dataIndex": "id",

+ 12 - 10
frontend/saas-web/app/view/sale/report/Sale.js

@@ -11,24 +11,24 @@ Ext.define('saas.view.sale.report.Sale', {
     listUrl: '/api/sale/sale/list',
     defaultCondition: null,
     reportTitle: '销售明细报表',
-    QueryWidth:0.25,
+    QueryWidth:0.1,
     searchItems: [
     {
         xtype: 'dbfindtrigger',
         name: 'sa_custname',
         fieldLabel: '客户名称',
-        columnWidth: 0.25
+        columnWidth: 0.2
     }, {
         xtype: 'condatefield',
         name: 'sa_date',
         fieldLabel: '单据日期',
-        columnWidth: 0.25
+        columnWidth: 0.5
     }, {
         xtype: 'multicombo',
         name: 'sa_sendstatuscode',
         fieldLabel: '业务状态',
         allowBlank: true,
-        columnWidth: 0.25,
+        columnWidth: 0.2,
         datas: [
             ["TURNOUT", "已出库"],
             ["UNTURNOUT", "未出库"],
@@ -73,10 +73,12 @@ Ext.define('saas.view.sale.report.Sale', {
         dataIndex: 'sd_detno'
     }, {
         text: '物料编号',
-        dataIndex: 'sd_prodcode'
+        dataIndex: 'sd_prodcode',
+        width: 200
     }, {
         text: '物料名称',
-        dataIndex: 'pr_detail'
+        dataIndex: 'pr_detail',
+        width: 200
     }, {
         text: '物料规格',
         dataIndex: 'pr_spec'
@@ -113,10 +115,10 @@ Ext.define('saas.view.sale.report.Sale', {
         }
     }, {
         text: '税率',
-        dataIndex: 'pd_taxrate'
+        dataIndex: 'sd_taxrate'
     }, {//∑金额
         text: '金额',
-        dataIndex: 'pd_total',
+        dataIndex: 'sd_total',
         renderer : function(v) {
             var arr = (v + '.').split('.');
             var xr = (new Array(arr[1].length)).fill('0');
@@ -132,7 +134,7 @@ Ext.define('saas.view.sale.report.Sale', {
         }
     }, {//∑不含税金额
         text: '不含税金额',
-        dataIndex: 'pd_taxprice',
+        dataIndex: 'sd_nettotal',
         renderer : function(v) {
             var arr = (v + '.').split('.');
             var xr = (new Array(arr[1].length)).fill('0');
@@ -157,7 +159,7 @@ Ext.define('saas.view.sale.report.Sale', {
         }
     }, {
         text : "备注", 
-        dataIndex : "sd_text1",
+        dataIndex : "sd_remark",
         width : 250 
     }]
 

+ 10 - 7
frontend/saas-web/app/view/sale/report/SaleProfit.js

@@ -12,22 +12,22 @@ Ext.define('saas.view.sale.report.SaleProfit', {
     defaultCondition: null,
     reportTitle: '销售毛利润表',
 //筛选:客户、物料、时间	
-    QueryWidth:0.25, 	
+    QueryWidth:0.1, 	
     searchItems: [{
         xtype: 'dbfindtrigger',
         name: 'sa_custname',
         fieldLabel: '客户',
-        columnWidth: 0.25
+        columnWidth: 0.2
     }, {
         xtype: 'dbfindtrigger',
         name: 'sd_prodcode',
         fieldLabel: '物料',
-        columnWidth: 0.25
+        columnWidth: 0.2
     }, {
         xtype: 'condatefield',
         name: 'sa_custname',
         fieldLabel: '时间',
-        columnWidth: 0.25
+        columnWidth: 0.5
     }],
 
     reportColumns: [
@@ -56,7 +56,8 @@ Ext.define('saas.view.sale.report.SaleProfit', {
         dataIndex: 'sa_date'
     }, {
         text: '单据编号',
-        dataIndex: 'pd_inoutno'
+        dataIndex: 'pd_inoutno',
+        width: 200
     }, {
         text: '单据类型',
         dataIndex: 'pd_piclass'
@@ -65,10 +66,12 @@ Ext.define('saas.view.sale.report.SaleProfit', {
         dataIndex: 'pr_kind'
     }, {
         text: '物料编号',
-        dataIndex: 'pr_code'
+        dataIndex: 'pr_code',
+        width: 200
     }, {
         text: '物料名称',
-        dataIndex: 'pr_detail'
+        dataIndex: 'pr_detail',
+        width: 200
     }, {
         text: '物料规格',
         dataIndex: 'pr_spec'

+ 99 - 0
frontend/saas-web/app/view/sale/report/SaleProfitController.js

@@ -101,6 +101,105 @@ Ext.define('saas.view.sale.report.SaleProfitController', {
                             }]
                     }) ;   
                 }
+            },
+            //放大镜赋值关系 以及 tpl模板
+            'dbfindtrigger[name=sd_prodcode]':{
+                beforerender:function(f){
+                    Ext.apply(f,{
+                        dataUrl:'/api/document/product/list',
+                        addXtype: 'document-product-formpanel',
+                        addTitle: '物料资料',
+                        dbfinds:[
+                        {
+                            from:'pr_code',to:'sd_prodcode'
+                        }, {
+                            from:'pr_detail',to:'pr_detail'
+                        }, {
+                            from:'pr_spec',to:'pr_spec'
+                        }],
+                        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,
+                        }]
+                    }) ;   
+
+                }
             }
         });
     }

+ 4 - 1
frontend/saas-web/app/view/sale/sale/FormPanel.js

@@ -51,7 +51,10 @@ Ext.define('saas.view.sale.sale.FormPanel', {
         name : "sa_custname", 
         fieldLabel : "客户名称",
         allowBlank : false
-
+    }, {
+        xtype : "datefield", 
+        name : "sa_date", 
+        fieldLabel : "单据日期"
     }, {
         xtype : "textfield", 
         name : "sa_toplace", 

+ 2 - 2
frontend/saas-web/app/view/sale/sale/FormPanelController.js

@@ -116,13 +116,13 @@ Ext.define('saas.view.sale.sale.FormPanelController', {
                         addTitle: '物料资料',
                         dbfinds:[
                         {
-                            from:'pr_code',to:'sd_prodcode',ignore:true
+                            from:'pr_code',to:'sd_prodcode'
                         }, {
                             from:'pr_detail',to:'pr_detail'
                         }, {
                             from:'pr_spec',to:'pr_spec'
                         }, {
-                            from:'id',to:'sd_prodid'
+                            from:'id',to:'sd_prodid',ignore:true
                         }],
                         dbtpls:[{
                             field:'pr_code',width:100

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

@@ -18,7 +18,7 @@ Ext.define('saas.view.sale.sale.QueryPanel', {
         fieldLabel: '销售编号'
     }, {
         xtype: 'condatefield',
-        name: 'sa_recorddate',
+        name: 'sa_date',
         fieldLabel: '单据日期',
         columnWidth: 0.5
     }, {
@@ -110,7 +110,7 @@ Ext.define('saas.view.sale.sale.QueryPanel', {
             width: 120
         }, {
             text: '单据日期',
-            dataIndex: 'sa_recorddate',
+            dataIndex: 'sa_date',
             xtype: 'datecolumn',
             width: 200
         }, {
@@ -151,7 +151,7 @@ Ext.define('saas.view.sale.sale.QueryPanel', {
             width: 120
         }, {
             text: '单据日期',
-            dataIndex: 'sa_recorddate',
+            dataIndex: 'sa_date',
             xtype: 'datecolumn',
             width: 200
         }, {