Browse Source

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

zhuth 7 years ago
parent
commit
f72b615a3a

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

@@ -73,4 +73,7 @@ public interface ProdInOutService extends CommonBaseService<ProdInOutMapper, Pro
     DocBaseDTO open(long id);
 
     void batchOpen(BatchDealBaseDTO baseDTOs);
+
+    void updateYqty(ProdInOut prodInOut);
+
 }

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

@@ -360,7 +360,7 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
 
 
 
-    private void updateYqty(ProdInOut prodInOut) {
+    public void updateYqty(ProdInOut prodInOut) {
         //更新已转数
         if ("采购验收单".equals(prodInOut.getPi_class())){
             purchasedetailMapper.updatePurchaseYqty(prodInOut.getPi_puid());
@@ -401,11 +401,15 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         targetPi.setPi_pucode(sourcePi.getPi_pucode());
         //设置公司id
         targetPi.setCompanyId(sourcePi.getCompanyId());
+        targetPi.setCreatorId(sourcePi.getCreatorId());
+        targetPi.setCreateTime(new Date());
+
+
         //保存数据
         getMapper().insertSelective(targetPi);
         //插入验退单从表
         long pi_id = targetPi.getId();
-         for (int i = 0;i<sourcePids.size();i++){
+        for (int i = 1;i<=sourcePids.size();i++){
              ProdIODetail sourcePid = sourcePids.get(i);
              ProdIODetail targetPid = new ProdIODetail();
              pdInqty = sourcePid.getPd_inqty()==null?0:sourcePid.getPd_inqty();
@@ -423,8 +427,11 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
                  targetPid.setPd_prodid(sourcePid.getPd_prodid());
                  targetPid.setPd_prodcode(sourcePid.getPd_prodcode());
                  targetPid.setPd_ioid(sourcePid.getId());
+                 targetPid.setPd_taxrate(sourcePid.getPd_taxrate());
                  //公司id
                  targetPid.setCompanyId(sourcePid.getCompanyId());
+                 targetPid.setCreateTime(new Date());
+
                  //本次转单数
                  targetPid.setPd_outqty(pdInqty-pdYqty);
                  prodIODetailMapper.insertSelective(targetPid);
@@ -433,6 +440,9 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
                  prodIODetailMapper.updateByPrimaryKeySelective(sourcePid);
              }
          }
+
+        //采购验退单相关计算
+        updateYqty(targetPi);
         DocBaseDTO baseDTO = new DocBaseDTO();
         baseDTO.setId(pi_id);
         baseDTO.setCode(piInoutno);

+ 21 - 2
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/impl/PurchaseServiceImpl.java

@@ -21,6 +21,7 @@ import com.usoftchina.saas.purchase.dto.PurchaseDetailDTO;
 import com.usoftchina.saas.purchase.dto.PurchaseFormDTO;
 import com.usoftchina.saas.purchase.mapper.*;
 import com.usoftchina.saas.purchase.po.*;
+import com.usoftchina.saas.purchase.service.ProdInOutService;
 import com.usoftchina.saas.purchase.service.PurchaseService;
 import com.usoftchina.saas.utils.BeanMapper;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -56,6 +57,10 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
     private ProdIODetailMapper prodIODetailMapper;
     @Autowired
     private MessageLogService messageLogService;
+    @Autowired
+    private ProdInOutService prodInOutService;
+
+
 
     @Override
     public PageInfo<PurchaseList> getListData(PageRequest page, ListReqDTO req) {
@@ -362,6 +367,11 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
     @Override
     @Transactional
     public Result turnProdin(Long id) {
+        //公司ID
+        Long companyId = BaseContextHolder.getCompanyId();
+        //人员Id
+        Long userId = BaseContextHolder.getUserId();
+
         Purchase purchase = getMapper().selectByPrimaryKey(id);
 
         Integer count=0;
@@ -391,7 +401,6 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
         ProdInOut prodInOut = new ProdInOut();
         //生成单号
         String piInoutno =maxnumberService.getMaxnumber(BillCodeSeq.PURCHASEIN.getCaller(),true).getData();
-
         prodInOut.setPi_inoutno(piInoutno);
         prodInOut.setPi_class("采购验收单");
         prodInOut.setPi_date(new Date());
@@ -403,6 +412,11 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
         prodInOut.setPi_vendname(purchase.getPu_vendname());
         prodInOut.setPi_puid(purchase.getId().intValue());
         prodInOut.setPi_pucode(purchase.getPu_code());
+        prodInOut.setCompanyId(purchase.getCompanyId());
+        prodInOut.setCreatorId(purchase.getCreatorId());
+        prodInOut.setCreateTime(new Date());
+
+
         //设置公司id
         prodInOut.setCompanyId(purchase.getCompanyId());
 
@@ -411,7 +425,7 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
         //插入验收单从表
         long pi_id = prodInOut.getId();
 
-        for (int i=0;i<purchaseDetails.size();i++){
+        for (int i=1;i<=purchaseDetails.size();i++){
             PurchaseDetail purchaseDetail =purchaseDetails.get(i);
             ProdIODetail prodIODetail = new ProdIODetail();
             pdQty = purchaseDetail.getPd_qty()==null?0:purchaseDetail.getPd_qty();
@@ -428,8 +442,11 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
                 prodIODetail.setPd_orderprice(purchaseDetail.getPd_price());
                 prodIODetail.setPd_prodid(purchaseDetail.getPd_prodid());
                 prodIODetail.setPd_prodcode(purchaseDetail.getPd_prodcode());
+                prodIODetail.setPd_taxrate(purchaseDetail.getPd_taxrate());
                 //公司id
                 prodIODetail.setCompanyId(purchaseDetail.getCompanyId());
+                prodIODetail.setCreateTime(new Date());
+
                 //本次转单数
                 prodIODetail.setPd_inqty(pdQty-pdYqty);
                 prodIODetailMapper.insertSelective(prodIODetail);
@@ -438,6 +455,8 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
                 purchasedetailMapper.updateByPrimaryKeySelective(purchaseDetail);
             }
         }
+        //采购单相关计算
+        prodInOutService.updateYqty(prodInOut);
         DocBaseDTO baseDTO = new DocBaseDTO();
         baseDTO.setId(pi_id);
         baseDTO.setCode(piInoutno);

+ 4 - 4
frontend/saas-web/app/view/document/product/FormController.js

@@ -115,14 +115,14 @@ Ext.define('saas.view.document.product.FormController', {
                             "width": 100,
                             "xtype": "",
                         },{
-                            "text": "仓库类型",
+                            "text": "仓库名称",
                             "flex": 1,
-                            "dataIndex": "wh_type",
+                            "dataIndex": "wh_description",
                             "xtype": "",
                         },{
-                            "text": "仓库名称",
+                            "text": "仓库类型",
                             "flex": 1,
-                            "dataIndex": "wh_description",
+                            "dataIndex": "wh_type",
                             "xtype": "",
                         }]
                     }) ;   

+ 1 - 1
frontend/saas-web/app/view/document/product/FormPanel.js

@@ -122,7 +122,7 @@ Ext.define('saas.view.document.product.FormPanel', {
         storeUrl:'/api/document/productbrand/getCombo',
         name : "pr_brand", 
         fieldLabel : "物料品牌", 
-        allowBlank : false, 
+        allowBlank : true, 
         columnWidth : 0.25,
         addHandler:function(b){
             var document = Ext.create('saas.view.document.kind.Kind',{});

+ 42 - 32
frontend/saas-web/app/view/money/recBalance/FormPanel.js

@@ -49,7 +49,7 @@ Ext.define('saas.view.money.recBalance.FormPanel', {
         name: "rb_rdamount",
         fieldLabel: "总欠款"
     }, {
-        xtype: 'numberfield',
+        xtype: 'hidden',
         name: 'rb_rbdamount',
         fieldLabel: '本次核销金额'
     }, {
@@ -57,24 +57,24 @@ Ext.define('saas.view.money.recBalance.FormPanel', {
         name: "rb_date",
         fieldLabel: "日期"
     }, {
-        xtype: "textfield",
+        xtype: "hidden",
         name: "rb_manname",
         fieldLabel: "收款人"
     }, {
-        xtype: 'textareafield',
+        xtype: 'hidden',
         name: 'rb_remark',
         fieldLabel: '备注',
         columnWidth: 1
     }, {
-        xtype: "numberfield",
+        xtype: "hidden",
         name: "rb_discounts",
         fieldLabel: "整单折扣"
     }, {
-        xtype: 'numberfield',
+        xtype: 'hidden',
         name: 'rb_preamount',
         fieldLabel : '本次预收款'
     }, {
-        xtype: 'numberfield',
+        xtype: 'hidden',
         name: 'rb_havebalance',
         fieldLabel: '已核销金额'
     }, {
@@ -91,21 +91,24 @@ Ext.define('saas.view.money.recBalance.FormPanel', {
             dataIndex: 'rd_ym',
             editor: {
                 xtype: 'numberfield'
-            }
+            },
+            hidden: true
         }, {
             text: '资金账户ID',
             dataIndex: 'rd_bankid',
             width : 100.0, 
             editor: {
                 xtype: 'numberfield'
-            }
+            },
+            hidden: true
         }, {
             text: '资金账户编号',
             dataIndex: 'rd_bankcode',
             width : 100.0, 
             editor: {
                 xtype: 'textfield'
-            }
+            },
+            hidden: true
         }, {
             text: '资金账户',
             dataIndex: 'rd_bankname',
@@ -152,13 +155,15 @@ Ext.define('saas.view.money.recBalance.FormPanel', {
             dataIndex: 'rbd_ym',
             editor: {
                 xtype: 'numberfield'
-            }
+            },
+            hidden: true
         }, {
             text: '来源ID',
             dataIndex: 'rbd_slid',
             editor: {
                 xtype: 'numberfield'
-            }
+            },
+            hidden: true
         }, {
             text: '来源单号',
             dataIndex: 'rbd_slcode',
@@ -183,50 +188,55 @@ Ext.define('saas.view.money.recBalance.FormPanel', {
             editor: {
                 xtype: 'numberfield'
             }
-        // }, {
-        //     text: "已核销金额",
-        //     dataIndex: "rbd_nowbalance",
-        //     editor: {
-        //         xtype: 'numberfield'
-        //     }
-        // }, {
-        //     text: "未核销金额",
-        //     dataIndex: "pbd_nowbalance",
-        //     editor: {
-        //         xtype: 'numberfield'
-        //     }
         }, {
-            text: "本次核销金额",
+            text: "已核销金额",
+            dataIndex: "rbd_nowbalance",
+            editor: {
+                xtype: 'numberfield'
+            }
+        }, {
+            text: "未核销金额",
             dataIndex: "pbd_nowbalance",
             editor: {
                 xtype: 'numberfield'
             }
         }, {
-            text: '备注',
-            dataIndex: 'rbd_remark',
+            text: "本次核销金额",
+            dataIndex: "pbd_nowbalance",
             editor: {
-                xtype: 'textfield'
+                xtype: 'numberfield'
             }
+        // }, {
+        //     text: '备注',
+        //     dataIndex: 'rbd_remark',
+        //     editor: {
+        //         xtype: 'textfield'
+        //     }
         }]
     }, {
         xtype: 'numberfield',
         name: 'rb_recorderid',
-        fieldLabel: '录入人ID'
+        fieldLabel: '录入人ID',
+        hidden: true
     }, {
         xtype: 'textfield',
         name: 'rb_recorder',
-        fieldLabel: '录入人'
+        fieldLabel: '录入人',
+        hidden: true
     }, {
         xtype: 'numberfield',
         name: 'updaterId',
-        fieldLabel: '更新人ID'
+        fieldLabel: '更新人ID',
+        hidden: true
     }, {
         xtype: 'datefield',
         name: 'updatedate',
-        fieldLabel: '更新时间'
+        fieldLabel: '更新时间',
+        hidden: true
     }, {
         xtype: "datefield",
         name: "rb_recorddate",
-        fieldLabel: "创建时间"
+        fieldLabel: "创建时间",
+        hidden: true
     }]
 });

+ 8 - 5
frontend/saas-web/app/view/money/recBalance/QueryPanel.js

@@ -38,7 +38,8 @@ Ext.define('saas.view.money.recBalance.QueryPanel', {
             text: 'id',
             dataIndex: 'id',
             width: 100,
-            xtype: 'numbercolumn'
+            xtype: 'numbercolumn',
+            hidden: true
         }, {
             text: '单据编号',
             dataIndex: 'rb_code',
@@ -54,21 +55,23 @@ Ext.define('saas.view.money.recBalance.QueryPanel', {
             width: 200
         }, {
             text: '客户编号',
-            dataIndex: 'rb_custcode'
+            dataIndex: 'rb_custcode',
+            hidden: true
         }, {
             text: '客户名称',
-            dataIndex: 'rb_custname'
+            dataIndex: 'rb_custname',
         }, {
             text: '收款人',
             dataIndex: 'rb_manname',
             xtype: 'numbercolumn',
-            width: 120
+            width: 120,
         }, {
             text: '收款金额',
             dataIndex: 'rb_rdamount',
             xtype: 'numbercolumn',
             width: 120,
-            flex: 1
+            flex: 1,
+            hidden: true
         }]
     }
 });

+ 12 - 6
frontend/saas-web/app/view/sys/config/FormPanel.js

@@ -25,13 +25,19 @@ Ext.define('saas.view.sys.config.FormPanel', {
         columnWidth: 0.25,
         blankText: '该字段不能为空'
     },
-    
-    tbar:[{
-        text:'保存',
-        handler:function(){
 
-        }
-    }],
+    tbar:{
+        style: {
+            'border-bottom': '1px solid #35baf6 !important'
+        },
+        frame:true,
+        items:['->',{
+            text:'保存',
+            handler:function(){
+
+            }
+        }]
+    },
 
     items: [{
         xtype: 'hidden',

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

@@ -11,7 +11,7 @@ Ext.define('saas.view.sys.messagelog.DataList', {
         width: 150,
         name: 'ml_name',
         xtype: 'textfield',
-        emptyText : '单据类'
+        emptyText : '单据类'
     },{
         width: 150,
         name: 'ml_code',
@@ -52,7 +52,7 @@ Ext.define('saas.view.sys.messagelog.DataList', {
         dataIndex : "id", 
         xtype : "numbercolumn",   
     },{
-        text:'单据类',
+        text:'单据类',
         dataIndex : "ml_name",
         width : 120.0, 
     },{