Browse Source

修改采购模块

zhoudw 7 years ago
parent
commit
aa9dfa3a5a

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

@@ -323,6 +323,8 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
     private DocBaseDTO singleOpen(Long id) {
         Purchase purchase = purchaseMapper.selectByPrimaryKey(id);
         DocBaseDTO docBaseDTO = null;
+        Double acceptqty=new Double(0),qty=new Double(0);
+
         if(!Status.CLOSE.name().equals(purchase.getPu_acceptstatuscode())){
             throw new BizException(BizExceptionCode.BIZ_OPEN);
         }
@@ -331,10 +333,12 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
         int partTurnCount = 0,turnCount = 0;
         if(purchaseDetailList != null && purchaseDetailList.size() > 0){
             for(PurchaseDetail purchaseDetail : purchaseDetailList){
+                acceptqty = purchaseDetail.getPd_acceptqty()==null?0:purchaseDetail.getPd_acceptqty();
+                qty = purchaseDetail.getPd_qty()==null?0:purchaseDetail.getPd_qty();
                 //入库数大于等于采购数
-                if(purchaseDetail.getPd_acceptqty() >= purchaseDetail.getPd_qty()){
+                if(acceptqty >= qty){
                     turnCount++;
-                }else if(purchaseDetail.getPd_acceptqty() > 0 && purchaseDetail.getPd_acceptqty() < purchaseDetail.getPd_qty()){
+                }else if(acceptqty > 0 && acceptqty < qty){
                     //     0 < 入库数 < 采购数
                     partTurnCount++;
                 }
@@ -478,12 +482,14 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
         purchase.setId(id);
         purchase.setPu_status(Status.AUDITED.getDisplay());
         purchase.setPu_statuscode(Status.AUDITED.name());
+        purchase.setPu_acceptstatus(Status.UNTURNIN.getDisplay());
+        purchase.setPu_acceptstatuscode(Status.UNAUDITED.name());
         purchase.setUpdateTime(new Date());
         purchase.setUpdaterId(BaseContextHolder.getUserId());
         //更新存在字段
         purchaseMapper.updateByPrimaryKeySelective(purchase);
         //更新最新采购单价
-        productApi.updateLatestPurchasePrice(id);
+//        productApi.updateLatestPurchasePrice(id);
         //日志
         messageLogService.audit(docBaseDTO);
         return result;

+ 4 - 0
frontend/saas-web/app/view/stock/appropriationInOut/FormPanel.js

@@ -129,6 +129,7 @@ Ext.define('saas.view.stock.appropriationInOut.FormPanel', {
                 dataIndex : "pd_prodcode", 
                 xtype : "", 
                 items : null,
+                allowBlank:false,
                 editor : {
                     displayField : "display", 
                     editable : true, 
@@ -163,6 +164,7 @@ Ext.define('saas.view.stock.appropriationInOut.FormPanel', {
                 text : "数量", 
                 dataIndex : "pd_inqty", 
                 width : 120.0,
+                allowBlank:false,
                 editor : {
                     xtype : "numberfield",
                     decimalPrecision: 8,
@@ -197,6 +199,7 @@ Ext.define('saas.view.stock.appropriationInOut.FormPanel', {
                 dataIndex : "pd_whname", 
                 width : 120.0, 
                 items : null,
+                allowBlank:false,
                 editor : {
                     displayField : "display", 
                     editable : true, 
@@ -225,6 +228,7 @@ Ext.define('saas.view.stock.appropriationInOut.FormPanel', {
                 text : "拨入仓库", 
                 dataIndex : "pd_inwhname", 
                 width : 120.0, 
+                allowBlank:false,
                 items : null,
                 editor : {
                     displayField : "display", 

+ 14 - 2
frontend/saas-web/app/view/stock/make/FormPanelController.js

@@ -250,6 +250,10 @@ Ext.define('saas.view.stock.make.FormPanelController', {
                             from:'bo_mothercode',to:'ma_prodcode'
                         },{
                             from:'bo_mothername',to:'ma_proddetail'
+                        },{
+                            from:'pr_spec',to:'ma_prodspec'
+                        },{
+                            from:'bo_version',to:'ma_version'
                         }],
                         //联想设置
                         dbtpls:[{
@@ -279,13 +283,21 @@ Ext.define('saas.view.stock.make.FormPanelController', {
                             "hidden": true,
                             "dataIndex": "id",
                         }, {
-                            "text": "物料编号",       
+                            "text": "产品编号",       
                             "dataIndex": "bo_mothercode",
                             "width": 200,
                         }, {
-                            "text": "物料名称",
+                            "text": "产品名称",
                             "width": 200,
                             "dataIndex": "bo_mothername",
+                        }, {
+                            "text": "产品规格",
+                            "width": 200,
+                            "dataIndex": "pr_spec",
+                        }, {
+                            "text": "版本",
+                            "width": 200,
+                            "dataIndex": "bo_version",
                         }
                         // ,{
                         //     "text": "规格",