Browse Source

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

zhuth 7 years ago
parent
commit
eda3682080

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

@@ -40,7 +40,7 @@ public enum BizExceptionCode implements BaseExceptionCode {
     SALE_CLOSE(72001, "单据已关闭,无法进行操作"),
     SALE_YQTYBEYONDQTY(72001, "明细行已转数量大于数量"),
     SALE_NULL_BILL(72002, "单据不存在或者明细为空"),
-    SALEOUT_ALL_TURNIN(72003, "该销售出货单已全部转退货,无法转销售退货单"),
+    SALEOUT_ALL_TURNIN(72003, "该出货单已全部转退货,无法转销售退货单"),
     SALEOUT_POSTSTATUS_ERROR(72004,"当前单据状态无法进行此操作。"),
     SALEOUT_POST_ERROR(72005,""),
     //资金

+ 1 - 1
applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/po/BillCodeSeq.java

@@ -22,7 +22,7 @@ public enum  BillCodeSeq {
 
     SALE("销售订单", "Sale"),
 
-    SALEOUT("销售出货单", "SaleOut"),
+    SALEOUT("出货单", "SaleOut"),
 
     SALEIN("销售退货单", "SaleIn"),
 

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

@@ -149,8 +149,8 @@ public class ProdInOutController {
 
     @PostMapping("/turnProdIn/{id}")
     public Result turnProdin(@PathVariable("id") Long id){
-        prodInOutService.turnProdin(id);
-        return Result.success();
+        DocBaseDTO baseDTO  = prodInOutService.turnProdin(id);
+        return Result.success(baseDTO);
     };
 
     @PostMapping("/close/{id}")

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

@@ -118,5 +118,5 @@ public interface ProdInOutService extends CommonBaseService<ProdInOutMapper, Pro
      * 出库单转退货单
      * @param id
      */
-    Result turnProdin(Long id);
+    DocBaseDTO turnProdin(Long id);
 }

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

@@ -363,7 +363,7 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
     }
 
     @Override
-    public Result turnProdin(Long id) {
+    public DocBaseDTO turnProdin(Long id) {
         Integer count=0;
         double pdOutqty=0;
         double pdYqty=0;
@@ -389,7 +389,7 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         }
         //判断可转数
         if (count==0) {
-            return Result.error(ExceptionCode.TURNINNUM_NOT_EXIST);
+            throw  new BizException(ExceptionCode.TURNINNUM_NOT_EXIST);
         }
         //插入销售退货单主表
         ProdInOut targetPi = new ProdInOut();
@@ -455,7 +455,11 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
                 prodIODetailMapper.updateByPrimaryKeySelective(sourcePid);
             }
         }
-        return Result.success();
+
+        //日志记录
+        DocBaseDTO baseDTO = new DocBaseDTO(pi_id, piInoutno, BillCodeSeq.SALEIN.getCaller());
+        //messageLogService.customizeLog(baseDTO, Operation.);
+        return baseDTO;
 
     }
 
@@ -548,7 +552,7 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         Integer count = "0".equals(String.valueOf(id)) ? prodInOutMapper.validateCodeWhenInsert(code,pi_class) :
                 prodInOutMapper.validateCodeWhenUpdate(code, id);
         String caller ="";
-        if(pi_class.equals("销售出货单")){
+        if(pi_class.equals("出货单")){
             caller = BillCodeSeq.SALEOUT.getCaller();
         }else {//销售退货单
             caller = BillCodeSeq.SALEIN.getCaller();
@@ -580,7 +584,7 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
     private void setTotal(ProdInOut prodInOut ) {
         String pi_class = prodInOut.getPi_class();
         Long id = prodInOut.getId();
-        if(BillCodeSeq.SALEOUT.getName().equals(pi_class)){//销售出货单
+        if(BillCodeSeq.SALEOUT.getName().equals(pi_class)){//出货单
             //更新明细
             prodIODetailMapper.updatePDSaleOut(id);
             //更新主表

+ 2 - 2
applications/sale/sale-server/src/main/resources/mapper/ProdIODetailMapper.xml

@@ -746,13 +746,13 @@ update prodiodetail a
           and pd_piid=#{id}  GROUP BY pd_ioid ) b
           where IFNULL(b.pd_ioid ,0)= a.pd_id
      ),0)
-where a.pd_id in (select pd_ioid from prodiodetail where pd_piid=#{id} and pi_class='销售出货单')
+where a.pd_id in (select pd_ioid from prodiodetail where pd_piid=#{id} and pi_class='出货单')
   </update>
   <update id="updateSaleYqty" parameterType="long">
 
     update saledetail a set a.sd_yqty =IFNULL( ( select b.pd_outqty from (
     select pd_sdid,sum(pd_outqty) pd_outqty from prodiodetail left join
-    prodinout on pd_piid = pi_id where pd_piclass='销售出货单' and pi_said=#{id}
+    prodinout on pd_piid = pi_id where pd_piclass='出货单' and pi_said=#{id}
     GROUP BY pd_sdid) b where IFNULL(b.pd_sdid ,0) = a.sd_id ),0) where a.sd_said =#{id}
   </update>
 

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

@@ -26,7 +26,7 @@ Ext.define('saas.view.sale.sale.FormPanel', {
  
      toolBtns: [{
          xtype: 'button',
-         text: '转销售出货单',
+         text: '转出货单',
          handler: 'turnOut'
      }],
 
@@ -46,7 +46,9 @@ Ext.define('saas.view.sale.sale.FormPanel', {
     }, {
         xtype : "dbfindtrigger", 
         name : "sa_custname", 
-        fieldLabel : "客户名称"
+        fieldLabel : "客户名称",
+        allowBlank : false
+
     }, {
         xtype : "textfield", 
         name : "sa_toplace", 
@@ -74,6 +76,7 @@ Ext.define('saas.view.sale.sale.FormPanel', {
                 dataIndex : "sd_prodcode", 
                 xtype : "", 
                 items : null,
+                allowBlank:false,
                 editor : {
                     displayField : "display", 
                     editable : true, 
@@ -113,6 +116,7 @@ Ext.define('saas.view.sale.sale.FormPanel', {
                 xtype : "numbercolumn", 
                 format:'0,000.00',
                 items : null,
+                allowBlank:false,
                 summaryType: 'sum'
             },  {
                 text : "已转数", 
@@ -156,11 +160,11 @@ Ext.define('saas.view.sale.sale.FormPanel', {
                 text : "交货日期", 
                 dataIndex : "sd_delivery", 
                 xtype:'datecolumn',
-                format : "Y-m-d H:i:s", 
+                format : "Y-m-d", 
                 editor : {
                     xtype : "datefield",
                     editable : true, 
-                    format : "Y-m-d H:i:s", 
+                    format : "Y-m-d", 
                     hideTrigger : false
                 }
             },{

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

@@ -209,7 +209,8 @@ Ext.define('saas.view.sale.sale.FormPanelController', {
                 openTab('sale-saleout-formpanel',name+"("+codeValue+")",codeValue+intValue, {
                     initId: intValue
                 });
-                showToast('转单成功');    
+                showToast('转单成功');  
+                form.FormUtil.loadData(form);
             }
         })
         .catch(function(res) {

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

@@ -12,6 +12,10 @@ Ext.define('saas.view.sale.sale.QueryPanel', {
         name: 'sa_id',
         fieldLabel: 'ID',
         columnWidth: 0
+    }, {
+        xtype: 'textfield',
+        name: 'sa_code',
+        fieldLabel: '销售编号'
     }, {
         xtype: 'hidden',
         name: 'sa_custcode',
@@ -116,7 +120,12 @@ Ext.define('saas.view.sale.sale.QueryPanel', {
         }, {
             text: '收货地址',
             dataIndex: 'sa_toplace',
-            width: 120
+            width: 200
+        }, {
+            text: '备注',
+            dataIndex: 'sa_remark',
+            width: 250,
+            flex:1
         }
     ],
         relativeColumn: [ {

+ 15 - 2
frontend/saas-web/app/view/sale/saleIn/FormPanel.js

@@ -34,7 +34,8 @@ Ext.define('saas.view.sale.saleIn.FormPanel', {
         fieldLabel : "单据类型", 
         readOnly:true,
         allowBlank : false, 
-        defaultValue:'销售退货单'
+        defaultValue:'销售退货单',
+        allowBlank:false
     },{
         xtype : "hidden", 
         name : "pi_custid",  
@@ -46,7 +47,8 @@ Ext.define('saas.view.sale.saleIn.FormPanel', {
     }, {
         xtype : "dbfindtrigger", 
         name : "pi_custname", 
-        fieldLabel : "客户名称"
+        fieldLabel : "客户名称",
+        allowBlank:false,
     }, {
         xtype : "textfield", 
         name : "pi_address", 
@@ -72,6 +74,7 @@ Ext.define('saas.view.sale.saleIn.FormPanel', {
                 text : "物料编号", 
                 width : 200.0, 
                 dataIndex : "pd_prodcode", 
+                allowBlank:false,
                 editor : {
                     displayField : "display", 
                     editable : true, 
@@ -104,6 +107,7 @@ Ext.define('saas.view.sale.saleIn.FormPanel', {
             }, {
                 text : "数量", 
                 dataIndex : "pd_inqty", 
+                allowBlank:false,
                 editor : {
                     xtype : "numberfield"
                 },
@@ -111,9 +115,18 @@ Ext.define('saas.view.sale.saleIn.FormPanel', {
                 xtype : "numbercolumn", 
                 format:'0',
                 summaryType: 'sum'
+            }, {
+                text : "仓库ID", 
+                dataIndex : "pd_whid", 
+                width : 0
+            }, {
+                text : "仓库", 
+                dataIndex : "pd_whcode", 
+                width :0
             }, {
                 text : "仓库", 
                 dataIndex : "pd_whname", 
+                allowBlank:false,
                 width : 120.0, 
                 editor : {
                     displayField : "display", 

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

@@ -9,7 +9,7 @@ Ext.define('saas.view.sale.saleout.FormPanel', {
     caller:'SaleOut',
     
     //字段属性
-    _title:'销售出货单',
+    _title:'出货单',
     _idField: 'id',
     _codeField: 'pi_inoutno',
     _statusField: 'pi_status',
@@ -43,7 +43,7 @@ Ext.define('saas.view.sale.saleout.FormPanel', {
         fieldLabel : "单据类型", 
         readOnly:true,
         allowBlank : false, 
-        defaultValue:'销售出货单'
+        defaultValue:'出货单'
     }, {
         xtype : "hidden", 
         name : "pi_custid", 
@@ -55,7 +55,8 @@ Ext.define('saas.view.sale.saleout.FormPanel', {
     }, {
         xtype : "dbfindtrigger", 
         name : "pi_custname", 
-        fieldLabel : "客户名称"
+        fieldLabel : "客户名称",
+        allowBlank:false,
     }, {
         xtype : "textfield", 
         name : "pi_address", 
@@ -83,6 +84,7 @@ Ext.define('saas.view.sale.saleout.FormPanel', {
                 dataIndex : "pd_prodcode", 
                 xtype : "", 
                 items : null,
+                allowBlank:false,
                 editor : {
                     displayField : "display", 
                     editable : true, 
@@ -122,7 +124,8 @@ Ext.define('saas.view.sale.saleout.FormPanel', {
                 xtype : "numbercolumn", 
                 format:'0,000.00',
                 items : null,
-                summaryType: 'sum'
+                summaryType: 'sum',
+                allowBlank:false,
             }, {
                 text : "仓库ID", 
                 dataIndex : "pd_whid", 
@@ -136,6 +139,7 @@ Ext.define('saas.view.sale.saleout.FormPanel', {
                 dataIndex : "pd_whname", 
                 width : 120.0, 
                 items : null,
+                allowBlank:false,
                 editor : {
                     displayField : "display", 
                     editable : true, 

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

@@ -254,7 +254,7 @@ Ext.define('saas.view.sale.saleout.FormPanelController', {
         id = form.getForm().findField(form._idField);
         form.BaseUtil.request({
             url: form._turnInUrl+id.value,
-            method: 'GET',
+            method: 'POST',
         })
         .then(function(localJson) {
             if(localJson.success){
@@ -264,7 +264,8 @@ Ext.define('saas.view.sale.saleout.FormPanelController', {
                 openTab('sale-salein-formpanel',name+"("+codeValue+")",codeValue+intValue, {
                     initId: intValue
                 });
-                showToast('转单成功');    
+                showToast('转单成功');  
+                form.FormUtil.loadData(form);  
             }
         })
         .catch(function(res) {

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

@@ -67,9 +67,9 @@ Ext.define('saas.view.sale.saleout.QueryPanel', {
     queryGridConfig: {
         idField:'id',
         codeField:'pi_inoutno',
-        addTitle:'销售出货单',
+        addTitle:'出货单',
         addXtype:'sale-saleout-formpanel',
-        defaultCondition:' pi_class = \'销售出货单\'',
+        defaultCondition:' pi_class = \'出货单\'',
         baseVastUrl: '/api/sale/prodinout/',
         baseColumn: [{
             text: 'id',