Browse Source

更新出转单,出入库单代码

zhoudw 7 years ago
parent
commit
f76d7080f9

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

@@ -147,7 +147,11 @@ public class ProdInOutController {
         return Result.success();
     }
 
-
+    @GetMapping("/turnProdOut/{id}")
+    public Result turnProdin(@PathVariable("id") Long id){
+        prodInOutService.turnProdOut(id);
+        return Result.success();
+    };
 
 
 

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

@@ -159,8 +159,8 @@ public class PurchaseController {
         return Result.success();
     }
 
-    @GetMapping("/turnProdin")
-    public Result turnProdin(Long id){
+    @GetMapping("/turnProdin/{id}")
+    public Result turnProdin(@PathVariable("id") Long id){
         purchaseService.turnProdin(id);
         return Result.success();
     };

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

@@ -309,11 +309,13 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
         //插入验收单主表
         ProdInOut prodInOut = new ProdInOut();
         //生成单号
-        String piInoutno ="test0001";
+        String piInoutno ="YS0001";
 
         prodInOut.setPi_inoutno(piInoutno);
         prodInOut.setPi_class("采购验收单");
-//        prodInOut.setPiDate(new Date());
+        prodInOut.setPi_date(new Date());
+        prodInOut.setPi_status("未审核");
+        prodInOut.setPi_statuscode("UNAUDITED");
         prodInOut.setPi_recorddate(new Date());
         prodInOut.setPi_vendid(purchase.getPu_vendid());
         prodInOut.setPi_vendcode(purchase.getPu_vendcode());

+ 7 - 7
applications/purchase/purchase-server/src/main/resources/mapper/ProdIODetailMapper.xml

@@ -734,14 +734,14 @@
       <if test="pd_status != null">
         pd_status = #{pd_status,jdbcType=INTEGER},
       </if>
-      <if test="companyid != null">
-        companyid = #{companyid,jdbcType=INTEGER},
+      <if test="companyId != null">
+        companyid = #{companyId,jdbcType=INTEGER},
       </if>
-      <if test="updaterid != null">
-        updaterid = #{updaterid,jdbcType=INTEGER},
+      <if test="updaterId != null">
+        updaterid = #{updaterId,jdbcType=INTEGER},
       </if>
-      <if test="updatetime != null">
-        updatetime = #{updatetime,jdbcType=TIMESTAMP},
+      <if test="updateTime != null">
+        updatetime = #{updateTime,jdbcType=TIMESTAMP},
       </if>
       <if test="pd_text1 != null">
         pd_text1 = #{pd_text1,jdbcType=VARCHAR},
@@ -768,7 +768,7 @@
         pd_remark = #{pd_remark,jdbcType=LONGVARCHAR},
       </if>
     </set>
-    where pd_id = #{pd_id,jdbcType=INTEGER}
+    where pd_id = #{id,jdbcType=INTEGER}
   </update>
   <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.usoftchina.saas.purchase.po.ProdIODetail">
     update prodiodetail

+ 42 - 42
applications/purchase/purchase-server/src/main/resources/mapper/PurchasedetailMapper.xml

@@ -248,50 +248,50 @@
   <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.purchase.po.PurchaseDetail" >
     update purchasedetail
     <set >
-      <if test="pdPuid != null" >
-        PD_PUID = #{pdPuid,jdbcType=INTEGER},
+      <if test="pd_puid != null" >
+        PD_PUID = #{pd_puid,jdbcType=INTEGER},
       </if>
-      <if test="pdCode != null" >
-        PD_CODE = #{pdCode,jdbcType=VARCHAR},
+      <if test="pd_code != null" >
+        PD_CODE = #{pd_code,jdbcType=VARCHAR},
       </if>
-      <if test="pdDetno != null" >
-        PD_DETNO = #{pdDetno,jdbcType=INTEGER},
+      <if test="pd_detno != null" >
+        PD_DETNO = #{pd_detno,jdbcType=INTEGER},
       </if>
-      <if test="pdProdid != null" >
-        PD_PRODID = #{pdProdid,jdbcType=INTEGER},
+      <if test="pd_prodid != null" >
+        PD_PRODID = #{pd_prodid,jdbcType=INTEGER},
       </if>
-      <if test="pdProdcode != null" >
-        PD_PRODCODE = #{pdProdcode,jdbcType=VARCHAR},
+      <if test="pd_prodcode != null" >
+        PD_PRODCODE = #{pd_prodcode,jdbcType=VARCHAR},
       </if>
-      <if test="pdUnit != null" >
-        PD_UNIT = #{pdUnit,jdbcType=VARCHAR},
+      <if test="pd_unit != null" >
+        PD_UNIT = #{pd_unit,jdbcType=VARCHAR},
       </if>
-      <if test="pdQty != null" >
-        PD_QTY = #{pdQty,jdbcType=DOUBLE},
+      <if test="pd_qty != null" >
+        PD_QTY = #{pd_qty,jdbcType=DOUBLE},
       </if>
-      <if test="pdPrice != null" >
-        PD_PRICE = #{pdPrice,jdbcType=DOUBLE},
+      <if test="pd_price != null" >
+        PD_PRICE = #{pd_price,jdbcType=DOUBLE},
       </if>
-      <if test="pdTotal != null" >
-        PD_TOTAL = #{pdTotal,jdbcType=DOUBLE},
+      <if test="pd_total != null" >
+        PD_TOTAL = #{pd_total,jdbcType=DOUBLE},
       </if>
-      <if test="pdTaxtotal != null" >
-        PD_TAXTOTAL = #{pdTaxtotal,jdbcType=DOUBLE},
+      <if test="pd_taxtotal != null" >
+        PD_TAXTOTAL = #{pd_taxtotal,jdbcType=DOUBLE},
       </if>
-      <if test="pdAcceptqty != null" >
-        PD_ACCEPTQTY = #{pdAcceptqty,jdbcType=DOUBLE},
+      <if test="pd_acceptqty != null" >
+        PD_ACCEPTQTY = #{pd_acceptqty,jdbcType=DOUBLE},
       </if>
-      <if test="pdDelivery != null" >
-        PD_DELIVERY = #{pdDelivery,jdbcType=DOUBLE},
+      <if test="pd_delivery != null" >
+        PD_DELIVERY = #{pd_delivery,jdbcType=DOUBLE},
       </if>
-      <if test="pdSalecode != null" >
-        PD_SALECODE = #{pdSalecode,jdbcType=VARCHAR},
+      <if test="pd_salecode != null" >
+        PD_SALECODE = #{pd_salecode,jdbcType=VARCHAR},
       </if>
-      <if test="pdSaledetno != null" >
-        PD_SALEDETNO = #{pdSaledetno,jdbcType=INTEGER},
+      <if test="pd_saledetno != null" >
+        PD_SALEDETNO = #{pd_saledetno,jdbcType=INTEGER},
       </if>
-      <if test="pdSdid != null" >
-        PD_SDID = #{pdSdid,jdbcType=INTEGER},
+      <if test="pd_sdid != null" >
+        PD_SDID = #{pd_sdid,jdbcType=INTEGER},
       </if>
       <if test="companyId != null" >
         companyId = #{companyId,jdbcType=INTEGER},
@@ -302,23 +302,23 @@
       <if test="updateTime != null" >
         updateTime = #{updateTime,jdbcType=TIMESTAMP},
       </if>
-      <if test="pdText1 != null" >
-        pd_text1 = #{pdText1,jdbcType=VARCHAR},
+      <if test="pd_text1 != null" >
+        pd_text1 = #{pd_text1,jdbcType=VARCHAR},
       </if>
-      <if test="pdText2 != null" >
-        pd_text2 = #{pdText2,jdbcType=VARCHAR},
+      <if test="pd_text2 != null" >
+        pd_text2 = #{pd_text2,jdbcType=VARCHAR},
       </if>
-      <if test="pdText3 != null" >
-        pd_text3 = #{pdText3,jdbcType=VARCHAR},
+      <if test="pd_text3 != null" >
+        pd_text3 = #{pd_text3,jdbcType=VARCHAR},
       </if>
-      <if test="pdText4 != null" >
-        pd_text4 = #{pdText4,jdbcType=VARCHAR},
+      <if test="pd_text4 != null" >
+        pd_text4 = #{pd_text4,jdbcType=VARCHAR},
       </if>
-      <if test="pdText5 != null" >
-        pd_text5 = #{pdText5,jdbcType=VARCHAR},
+      <if test="pd_text5 != null" >
+        pd_text5 = #{pd_text5,jdbcType=VARCHAR},
       </if>
-      <if test="pdYqty != null" >
-        pd_yqty = #{pdYqty,jdbcType=DOUBLE},
+      <if test="pd_yqty != null" >
+        pd_yqty = #{pd_yqty,jdbcType=DOUBLE},
       </if>
     </set>
     where PD_ID = #{id,jdbcType=INTEGER}

+ 6 - 1
frontend/saas-web/app/view/main/Navigation.js

@@ -28,7 +28,12 @@ Ext.define('saas.view.main.Navigation', {
                             text: '采购验收单',
                             formType:'purchase-purchase-formpanel',
                             queryType: 'purchase-purchaseIn-querypanel'
-                        }, {
+                        },{
+                            id: 'purchaseOut',
+                            text: '采购验退单',
+                            formType:'purchase-purchaseOut-formpanel',
+                            queryType: 'purchase-purchaseOut-querypanel'
+                        },{
                             id: 'form1',
                             text: '测试-采购单明细界面',
                             formType: 'test-order-formpanel'

+ 21 - 1
frontend/saas-web/app/view/purchase/purchase/FormController.js

@@ -133,5 +133,25 @@ Ext.define('saas.view.purchase.purchase.FormController', {
             renderTo:this.ownerCmp.ownerCt.getEl()
         }).show();
 
-    }
+    },
+
+    turnIn: function() {
+        var me = this,
+        form = me.getView(),
+        id = form.getForm().findField(form._idField);
+        form.BaseUtil.request({
+            url: form._turnInUrl+id.value,
+            method: 'GET',
+        })
+        .then(function(res) {
+            var localJson = new Ext.decode(res.responseText);
+            if(localJson.success){
+                Ext.Msg.alert('提示','转单成功');
+              
+            }
+        })
+        .catch(function() {
+            Ext.Msg.alert('提示','转单失败');
+        });
+     }
 });

+ 9 - 10
frontend/saas-web/app/view/purchase/purchase/FormPanel.js

@@ -13,19 +13,18 @@ Ext.define('saas.view.purchase.purchase.FormPanel', {
      _statusCodeField: 'pu_statuscode',
      _detnoColumn:  'pd_detno',
      _relationColumn: 'pd_puid',
-     _readUrl:'http://192.168.253.58:8800/purchase/read/',
-     _saveUrl:'http://192.168.253.58:8800/purchase/save',
-     _auditUrl:'http://192.168.253.58:8800/purchase/audit',
-     _deleteUrl:'http://192.168.253.58:8800/purchase/delete/',
-     _deleteDetailUrl:'http://192.168.253.58:8800/purchase/deleteItem/',
+     _readUrl:'http://localhost:8800/purchase/read/',
+     _saveUrl:'http://localhost:8800/purchase/save',
+     _auditUrl:'http://localhost:8800/purchase/audit',
+     _deleteUrl:'http://localhost:8800/purchase/delete/',
+     _deleteDetailUrl:'http://localhost:8800/purchase/deleteItem/',
+     _turnInUrl:'http://localhost:8800/purchase/turnProdin/',
      initId:0,
  
      toolBtns: [{
          xtype: 'button',
-         text: '转单按钮',
-         handler: function() {
-             console.log('11');
-         }
+         text: '转验收单按钮',
+         handler: 'turnIn'
      }],
 
     defaultItems: [{
@@ -159,7 +158,7 @@ Ext.define('saas.view.purchase.purchase.FormPanel', {
             },
             {
                 text : "数量", 
-                dataIndex : "pd_yqty", 
+                dataIndex : "pd_qty", 
                 editor : {
                     xtype : "numberfield"
                 },

+ 20 - 1
frontend/saas-web/app/view/purchase/purchaseIn/FormController.js

@@ -143,5 +143,24 @@ Ext.define('saas.view.purchase.purchaseIn.FormController', {
             renderTo:this.ownerCmp.ownerCt.getEl()
         }).show();
 
-    }
+    },
+    turnOut: function() {
+        var me = this,
+        form = me.getView(),
+        id = form.getForm().findField(form._idField);
+        form.BaseUtil.request({
+            url: form._turnOutUrl+id.value,
+            method: 'GET',
+        })
+        .then(function(res) {
+            var localJson = new Ext.decode(res.responseText);
+            if(localJson.success){
+                Ext.Msg.alert('提示','转单成功');
+              
+            }
+        })
+        .catch(function() {
+            Ext.Msg.alert('提示','转单失败');
+        });
+     }
 });

+ 3 - 4
frontend/saas-web/app/view/purchase/purchaseIn/FormPanel.js

@@ -18,14 +18,13 @@ Ext.define('saas.view.purchase.purchaseIn.FormPanel', {
     _deleteUrl:'http://192.168.253.228:8800/prodinout/delete/',
     _deleteDetailUrl:'http://192.168.253.228:8800/prodinout/deleteItem/',
    _baseVastUrl:'http://192.168.253.228:8800/prodinout/',
+   _turnOutUrl:'http://localhost:8800/prodinout/turnProdOut/',
     initId:11,
 
     toolBtns: [{
         xtype: 'button',
-        text: '转单按钮',
-        handler: function() {
-            console.log('11');
-        }
+        text: '转验退单按钮',
+        handler: 'turnOut'
     }],
 
     defaultItems: [{

+ 1 - 7
frontend/saas-web/app/view/purchase/purchaseOut/FormPanel.js

@@ -19,13 +19,7 @@ Ext.define('saas.view.purchase.purchaseOut.FormPanel', {
     _deleteDetailUrl:'http://192.168.253.228:8800/prodinout/deleteItem/',
     initId:11,
 
-    toolBtns: [{
-        xtype: 'button',
-        text: '转单按钮',
-        handler: function() {
-            console.log('11');
-        }
-    }],
+    toolBtns: [],
 
     defaultItems: [{
         xtype: 'hidden',