Browse Source

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

guq 7 years ago
parent
commit
b3501786d1

+ 26 - 0
applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/controller/MakeController.java

@@ -40,6 +40,32 @@ public class MakeController {
         return Result.success(docBaseDTO);
     }
 
+    /**
+     * 制造单批量审核
+     *
+     * @param baseDTOs
+     * @return
+     */
+    @PostMapping("/batchAudit")
+    public Result batchAudit(@RequestBody BatchDealBaseDTO baseDTOs) {
+        String res = makeService.batchAudit(baseDTOs);
+        return Result.success(res);
+    }
+
+    /**
+     * 制造单批量反审核
+     *
+     * @param baseDTOs
+     * @return
+     */
+    @PostMapping("/batchUnAudit")
+    public Result batchUnAudit(@RequestBody BatchDealBaseDTO baseDTOs) {
+        String res = makeService.batchUnAudit(baseDTOs);
+        return Result.success(res);
+    }
+
+
+
     @PostMapping("/save")
     public Result save(@RequestBody MakeListDTO makeListDTO){
         DocBaseDTO docBaseDTO = makeService.saveOrUpdate(makeListDTO);

+ 4 - 2
applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/service/MakeService.java

@@ -11,8 +11,6 @@ import com.usoftchina.saas.storage.dto.MakeListDTO;
 import com.usoftchina.saas.storage.mapper.MakeMapper;
 import com.usoftchina.saas.storage.po.Make;
 
-import java.util.List;
-
 public interface MakeService extends CommonBaseService<MakeMapper, Make> {
 
     /**
@@ -100,4 +98,8 @@ public interface MakeService extends CommonBaseService<MakeMapper, Make> {
      * @return
      */
     boolean batchDelete(BatchDealBaseDTO batchDealBaseDTO);
+
+    String batchAudit(BatchDealBaseDTO baseDTOs);
+
+    String batchUnAudit(BatchDealBaseDTO baseDTOs);
 }

+ 64 - 8
applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/service/impl/MakeServiceImpl.java

@@ -27,6 +27,7 @@ import com.usoftchina.saas.storage.po.ProdInOut;
 import com.usoftchina.saas.storage.service.MakeService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Propagation;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.StringUtils;
 
@@ -246,21 +247,29 @@ public class MakeServiceImpl extends CommonBaseServiceImpl<MakeMapper, Make> imp
     }
 
     @Override
-    @Transactional(rollbackFor = Exception.class)
     public DocBaseDTO audit(MakeListDTO makeListDTO) {
-        //1.获取主从表数据
+        Long id = makeListDTO.getMain().getId();
+        DocBaseDTO baseDTO = new DocBaseDTO();
         Make make = makeListDTO.getMain();
-        List<MakeMaterial> items = makeListDTO.getItems();
         //如果ID为0,先执行保存
-        if (makeListDTO.getMain().getId() == 0){
+        if (make.getId() == 0 || StringUtils.isEmpty(id)){
             DocBaseDTO docBaseDTO = saveOrUpdate(makeListDTO);
             make.setId(docBaseDTO.getId());
         }
+        //审核
+        singleAudit(makeListDTO);
+        baseDTO = generateMsgObj(make.getId(), make.getMa_code());
+        return baseDTO;
+    }
+
+    @Transactional(propagation = Propagation.REQUIRED)
+    public void singleAudit(MakeListDTO makeListDTO) {
+        //1.获取主从表数据
+        Make make = makeListDTO.getMain();
         //2.校验库存是否足够
         validStorage(makeListDTO);
         //3.生成  完工入库单和领料单 并 过账
         generateProdIO(makeListDTO);
-
         //4.修改单据状态
         Make updateMake = new Make();
         updateMake.setId(make.getId());
@@ -274,9 +283,33 @@ public class MakeServiceImpl extends CommonBaseServiceImpl<MakeMapper, Make> imp
         DocBaseDTO docBaseDTO = generateMsgObj(make.getId(), make.getMa_code());
         //5.记录LOG
         messageLogService.audit(docBaseDTO);
-        return docBaseDTO;
     }
 
+
+    @Override
+    public String batchAudit(BatchDealBaseDTO baseDTOs) {
+        if (null == baseDTOs || null == baseDTOs.getBaseDTOs() ||
+                baseDTOs.getBaseDTOs().size() == 0) {
+            return "没有可审核单据。";
+        }
+        StringBuffer errorMsg = new StringBuffer();
+        for (DocBaseDTO base : baseDTOs.getBaseDTOs()) {
+            try {
+                Long id =  base.getId();
+                Make make = getMapper().selectByPrimaryKey(id);
+                List<MakeMaterial> makeMaterials = makeMaterialMapper.selectByFK(id,BaseContextHolder.getCompanyId());
+                MakeListDTO makeListDTO = new MakeListDTO();
+                makeListDTO.setMain(make);
+                makeListDTO.setItems(makeMaterials);
+                singleAudit(makeListDTO);
+            } catch (Exception e){
+                errorMsg.append("编号:" + base.getCode() + "处理失败," + e.getMessage());
+            }
+        }
+        return errorMsg.toString();
+    }
+
+
     /**
      * 1.生成  完工入库单和生产领料单
      * 2.过账
@@ -518,8 +551,12 @@ public class MakeServiceImpl extends CommonBaseServiceImpl<MakeMapper, Make> imp
     }
 
     @Override
-    @Transactional(rollbackFor = Exception.class)
     public DocBaseDTO resAudit(Long id) {
+        return singleUnAudit(id);
+    }
+
+    @Transactional(rollbackFor = Exception.class)
+    public DocBaseDTO singleUnAudit(Long id) {
         //1.获取主从表数据
         Make make = getMapper().selectByPrimaryKey(id);
         List<MakeMaterial> items = makeMaterialMapper.selectByFK(id, BaseContextHolder.getCompanyId());
@@ -541,6 +578,24 @@ public class MakeServiceImpl extends CommonBaseServiceImpl<MakeMapper, Make> imp
         //6.记录LOG
         messageLogService.unAudit(docBaseDTO);
         return docBaseDTO;
+    };
+
+    @Override
+    public String batchUnAudit(BatchDealBaseDTO baseDTOs) {
+        if (null == baseDTOs || null == baseDTOs.getBaseDTOs() ||
+                baseDTOs.getBaseDTOs().size() == 0) {
+            return "无可反审核单据。";
+        }
+        StringBuffer errorMsg = new StringBuffer();
+        for (DocBaseDTO base : baseDTOs.getBaseDTOs()) {
+            try {
+                Long id =  base.getId();
+                singleUnAudit(id);
+            }catch (Exception e) {
+                errorMsg.append("编号:" + base.getCode() + "处理失败," + e.getMessage());
+            }
+        }
+        return errorMsg.toString();
     }
 
     @Override
@@ -581,6 +636,7 @@ public class MakeServiceImpl extends CommonBaseServiceImpl<MakeMapper, Make> imp
         return true;
     }
 
+
     /**
      * 1.查找制造单关联的出入库单据
      * 2.反过账
@@ -649,7 +705,7 @@ public class MakeServiceImpl extends CommonBaseServiceImpl<MakeMapper, Make> imp
      * @Author: chenwei
      * @Date: 2018/10/26
      */
-    private String pushMaxnubmer(String code, Long id) {
+    private synchronized String pushMaxnubmer(String code, Long id) {
         if (null == code) {
             throw new BizException(BizExceptionCode.NULL_CODE);
         }

+ 1 - 1
applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/service/impl/ProdInOutServiceImpl.java

@@ -441,7 +441,7 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         return baseDTO;
     }
 
-    private String pushMaxnubmer(ProdInOut prodInOut) {
+    private synchronized String pushMaxnubmer(ProdInOut prodInOut) {
         String pi_inoutno = prodInOut.getPi_inoutno();
         String pi_class = prodInOut.getPi_class();
         Long id = prodInOut.getId();

+ 3 - 0
frontend/saas-web/app/view/core/base/BasePanel.js

@@ -5,11 +5,13 @@ Ext.define('saas.view.core.base.BasePanel', {
     controller: 'core-base-basepanel',
     viewModel: 'core-base-basepanel',
 
+    cls:'core-base-basepanel',
     //工具类
     FormUtil: Ext.create('saas.util.FormUtil'),
     BaseUtil: Ext.create('saas.util.BaseUtil'),
 
     //基础属性
+    frame:false,
     autoScroll: true,
     border: 1,
     bodyPadding: 5,
@@ -38,6 +40,7 @@ Ext.define('saas.view.core.base.BasePanel', {
 
         Ext.apply(me, {
             dockedItems: [{
+                frame:false,
                 xtype: 'toolbar',
                 dock: 'top',
                 style: {

+ 33 - 0
frontend/saas-web/app/view/core/base/BasePanel.scss

@@ -0,0 +1,33 @@
+.core-base-basepanel{
+    .x-panel-default-outer-border-trl {
+        border-top-color: #fff !important;
+        border-top-width: 1px !important;
+        border-right-color: #fff !important;
+        border-right-width: 1px !important;
+        border-left-color: #fff !important;
+        border-left-width: 1px !important;
+    }
+    .x-panel-default-outer-border-rbl {
+        border-top-color: #fff !important;
+        border-top-width: 1px !important;
+        border-right-color: #fff !important;
+        border-right-width: 1px !important;
+        border-left-color: #fff !important;
+        border-left-width: 1px !important;
+        border-bottom-color: #fff !important;
+        border-bottom-width: 1px !important;
+    }
+}
+.core-base-gridpanel{
+    .x-grid-body{
+        border:1px solid #abdaff !important;
+        border-top-width: 0 !important;
+    }
+    .x-grid-header-ct{
+        border:1px solid #abdaff !important;
+    }
+}
+.x-basepanel-pagingtoolbar{
+    border:1px solid #abdaff !important;
+    border-top-width: 0 !important;
+}

+ 4 - 0
frontend/saas-web/app/view/core/base/GridPanel.js

@@ -8,6 +8,8 @@ Ext.define('saas.view.core.base.GridPanel', {
         mode : "MULTI" ,
         ignoreRightMouseSelection : false
     },
+
+    cls:'core-base-gridpanel',
     
     dataUrl: '',
     dbSearchFields: [],
@@ -15,6 +17,7 @@ Ext.define('saas.view.core.base.GridPanel', {
 
     initComponent: function() {
         var me = this;
+        me.frame = false;
         if(me.columns){
             var fields = me.columns.map(column => column.dataIndex);
             me.columns = me.insertFirstColumn(me.columns);
@@ -129,6 +132,7 @@ Ext.define('saas.view.core.base.GridPanel', {
                 },{
                     xtype: 'pagingtoolbar',
                     dock: 'bottom',
+                    cls:'x-basepanel-pagingtoolbar',
                     displayInfo: true,
                     store: me.store
                 }]

+ 1 - 1
frontend/saas-web/app/view/document/kind/ChildForm.js

@@ -260,7 +260,7 @@ Ext.define('KitchenSink.view.binding.ChildForm', {
             },{
                 readOnly:true,
                 xtype:'textfield',
-                fieldLabel: '状态',
+                fieldLabel: '仓库状态',
                 name: 'wh_status',   
                 value:'已开启',
                 maxLength: 20

+ 12 - 4
frontend/saas-web/app/view/stock/report/Prodiodetail.js

@@ -33,10 +33,14 @@ Ext.define('saas.view.stock.report.Prodiodetail', {
             ["库存初始化","库存初始化"]
         ]
     }, {		
-        xtype: 'dbfindtrigger',
+        xtype: 'textfield',
         name: 'pd_prodcode',
-        fieldLabel: '物料编号',
-        columnWidth: 0.2
+        fieldLabel: '',
+        emptyText:'输入单号,订单号或物料编号',
+        columnWidth: 0.2,
+        getCondition:function(v){
+            return "pd_prodcode='"+v+"' or pi_inoutno='"+v+"' or pd_ordercode='"+v+"'";
+        }
     }, {
         xtype: 'condatefield',
         name: 'pi_date',
@@ -119,7 +123,11 @@ Ext.define('saas.view.stock.report.Prodiodetail', {
         xtype: 'numbercolumn',
         dataIndex: 'pd_price',
         xtype: 'numbercolumn'
-    }, {
+    },{
+        text: '订单号',
+        dataIndex: 'pd_ordercode',
+        width: 200
+    },{
         text: '备注',
         dataIndex: 'pd_text1',
         width: 250

+ 100 - 99
frontend/saas-web/app/view/stock/report/ProdiodetailController.js

@@ -3,107 +3,108 @@ Ext.define('saas.view.stock.report.ProdiodetailController', {
     alias: 'controller.stock-report-prodiodetail',
     init: function (form) {
         this.control({
+
             //放大镜赋值关系 以及 tpl模板
-            'dbfindtrigger[name=pd_prodcode]':{
-                beforerender:function(f){
-                    Ext.apply(f,{
-                        dataUrl:'/api/document/product/list',
-                        addXtype: 'document-product-formpanel',
-                        addTitle: '物料资料',
-                        dbfinds:[
-                        {
-                            from:'pr_code',to:'pd_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,
-                            xtype: 'numbercolumn',
-                            align:'end'
-                        },{
-                            "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,
-                            xtype: 'numbercolumn',
-                            align:'end'
-                        },{
-                            "text": "L/T",
-                            "dataIndex": "pr_leadtime",
-                            "width": 100,
-                        }]
-                    }) ;   
+            // 'dbfindtrigger[name=pd_prodcode]':{
+            //     beforerender:function(f){
+            //         Ext.apply(f,{
+            //             dataUrl:'/api/document/product/list',
+            //             addXtype: 'document-product-formpanel',
+            //             addTitle: '物料资料',
+            //             dbfinds:[
+            //             {
+            //                 from:'pr_code',to:'pd_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,
+            //                 xtype: 'numbercolumn',
+            //                 align:'end'
+            //             },{
+            //                 "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,
+            //                 xtype: 'numbercolumn',
+            //                 align:'end'
+            //             },{
+            //                 "text": "L/T",
+            //                 "dataIndex": "pr_leadtime",
+            //                 "width": 100,
+            //             }]
+            //         }) ;   
 
-                }
-            }
+            //     }
+            // }            
          });
         }
 });

+ 28 - 31
frontend/saas-web/app/view/sys/account/DataList.js

@@ -16,14 +16,14 @@ Ext.define('saas.view.sys.account.DataList', {
 
     tbar: [{
         width: 150,
-        name: 'mn_name',
+        name: 'username',
         xtype: 'textfield',
         emptyText : '账户名称'
     },{
         width: 150,
-        name: 'mn_leadcode',
+        name: 'mobile',
         xtype: 'textfield',
-        emptyText : '账户编号'
+        emptyText : '电话'
     },{
         cls:'x-formpanel-btn-orange',
         xtype:'button',
@@ -49,28 +49,44 @@ Ext.define('saas.view.sys.account.DataList', {
 
     columns : [{
         text : 'id', 
-        width : 0, 
+        hidden:true,
         dataIndex : 'id', 
-        xtype : 'numbercolumn', 
+        xtype : 'numbercolumn',   
+    },{
+        text : 'accountId', 
+        hidden:true,
+        dataIndex : 'accountId', 
+        xtype : 'numbercolumn',   
     },{
         text : '账户名称', 
         width : 200.0, 
-        dataIndex : 'mn_name', 
+        dataIndex : 'username', 
         xtype : '', 
     }, 
     {
-        text : '账户编号', 
-        dataIndex : 'mn_leadcode', 
+        text : '真实姓名', 
+        dataIndex : 'realname', 
         width : 120.0, 
         xtype : '', 
     }, 
     {
-        text : '单据规则', 
-        dataIndex : 'mn_rule', 
+        text : '联系电话', 
+        dataIndex : 'mobile', 
         width : 220.0,
     },{
-        text : '流水长度', 
-        dataIndex : 'mn_number', 
+        text : '联系邮箱', 
+        dataIndex : 'email', 
+        width : 120.0, 
+        xtype : '', 
+    },{
+        text : '关联角色id', 
+        hidden:true,
+        dataIndex : 'roleIds', 
+        width : 120.0, 
+        xtype : '', 
+    },{
+        text : '关联角色', 
+        dataIndex : 'roleNames', 
         width : 120.0, 
         xtype : '', 
     }],
@@ -185,25 +201,6 @@ Ext.define('saas.view.sys.account.DataList', {
                     session: true
                 });
                 this.dialog.show();
-            }else if(classList.indexOf('fa-trash-o')>-1){
-                //删除
-                var id = record.get('id');
-                if(id){
-                    grid.BaseUtil.request({
-                        url: grid.deleteUrl+id,
-                        method: 'POST',
-                    })
-                    .then(function(localJson) {
-                        if(localJson.success){
-                            //解析参数
-                            showToast('删除成功');
-                            view.ownerCt.store.load();
-                        }
-                    })
-                    .catch(function() {
-                        showToast('删除失败');
-                    });
-                }
             }
         }
     },

+ 2 - 1
frontend/saas-web/app/view/sys/manager/FormPanel.js

@@ -19,7 +19,7 @@ Ext.define('saas.view.sys.manager.FormPanel', {
     },
 
     defaults: {
-        iconAlign: 'top',
+        iconAlign: 'left',
         bodyPadding: 15
     },
 
@@ -29,6 +29,7 @@ Ext.define('saas.view.sys.manager.FormPanel', {
         title: '公司设置',
         xtype:'sys-config-formpanel'
     }, {
+        cls:'sys-account-datalist',
         iconCls:'x-fa fa-key',
         title: '账户设置',
         xtype:'sys-account-datalist' 

+ 5 - 0
frontend/saas-web/app/view/sys/manager/FormPanel.scss

@@ -33,6 +33,11 @@
         }
     }
 }
+.sys-account-datalist{
+    .x-grid-body{
+        padding:0 !important;
+    }
+}
 .sys-power-formpanel{
     .x-panel-body-default-framed{
         padding:0 !important;

+ 1 - 11
frontend/saas-web/resources/json/navigation.json

@@ -288,21 +288,11 @@
             "text": "新手导航",
             "viewType": "sys-guide-formpanel",
             "leaf": true
-        },{  
+        }, {  
             "id":"sys-manager-formpanel",
             "text": "系统管理",
             "viewType": "sys-manager-formpanel",
             "leaf": true
-        }, {  
-            "id":"sys-config-formpanel",
-            "text": "公司设置",
-            "viewType": "sys-config-formpanel",
-            "leaf": true
-        }, {
-            "id":"sys-power-formpanel",
-            "text": "权限设置",
-            "viewType": "sys-power-formpanel",
-            "leaf": true
         }, {
             "id":"sys-messagelog-datalist",
             "text": "操作日志",