Browse Source

Merge remote-tracking branch 'origin/dev'

guq 7 years ago
parent
commit
b08f5978a1

+ 3 - 3
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/ProductServiceImpl.java

@@ -449,6 +449,7 @@ public class ProductServiceImpl extends CommonBaseServiceImpl<ProductMapper, Pro
     }
 
     @Override
+    @Transactional
     public boolean deleteByPrimaryKey(Long id) {
         Product productTemp = getMapper().selectByPrimaryKey(id);
         if (ObjectUtils.isEmpty(productTemp)){
@@ -587,11 +588,10 @@ public class ProductServiceImpl extends CommonBaseServiceImpl<ProductMapper, Pro
 
     @Override
     public boolean deleteDetailById(Long id) {
-        Product productTemp = getMapper().selectByPrimaryKey(id);
-        if (ObjectUtils.isEmpty(productTemp)){
+        Long prodId = productDetailMapper.selectProdidByPrimaryKey(id);
+        if (prodId == null){
             throw new BizException(BizExceptionCode.ORDER_NOT_EXITTS);
         }
-        Long prodId = productDetailMapper.selectProdidByPrimaryKey(id);
         validProductOperation(prodId, BizExceptionCode.BIZ_RELDELETE_DELETEPROD);
         String prCode = getMapper().selectByPrimaryKey(prodId).getPr_code();
         //找到原始单据,反过账并删除

+ 0 - 30
applications/transfers/transfers-server/src/main/java/com/usoftchina/saas/transfers/task/TaskSchedulerConfig.java

@@ -1,30 +0,0 @@
-package com.usoftchina.saas.transfers.task;
-
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.scheduling.annotation.EnableScheduling;
-import org.springframework.scheduling.annotation.SchedulingConfigurer;
-import org.springframework.scheduling.config.ScheduledTaskRegistrar;
-
-import java.util.concurrent.Executor;
-import java.util.concurrent.Executors;
-
-/**
- * @author: guq
- * @create: 2018-12-29 09:38
- **/
-@Configuration
-@EnableScheduling
-public class TaskSchedulerConfig implements SchedulingConfigurer{
-
-    @Override
-    public void configureTasks(ScheduledTaskRegistrar scheduledTaskRegistrar) {
-        scheduledTaskRegistrar.setScheduler(taskScheduler());
-    }
-
-    @Bean(destroyMethod = "shutdown")
-    public Executor taskScheduler() {
-        return Executors.newScheduledThreadPool(100);
-    }
-
-}

+ 3 - 3
base-servers/auth/auth-server/src/main/java/com/usoftchina/saas/auth/controller/AuthController.java

@@ -94,7 +94,8 @@ public class AuthController {
      * @return
      */
     @PostMapping("/authorize")
-    public Result<AuthDTO> authorize(HttpServletRequest request, @RequestParam String username, @RequestParam String password) {
+    public Result<AuthDTO> authorize(HttpServletRequest request, @RequestParam String username, @RequestParam String password,
+                                     @RequestParam(value = "companyId", required = false) Long companyId) {
         // 非法操作(登录失败次数过多...)导致被冻结
         if (authorizeCountService.isFrozen(username)) {
             return Result.error(ExceptionCode.AUTH_FROZEN);
@@ -104,8 +105,7 @@ public class AuthController {
             authorizeCountService.clear(username);
 
             AccountDTO accountDTO = result.getData();
-            Long companyId = null;
-            if (!CollectionUtils.isEmpty(accountDTO.getCompanies())) {
+            if (null == companyId && !CollectionUtils.isEmpty(accountDTO.getCompanies())) {
                 companyId = accountDTO.getCompanies().get(0).getId();
             }
             // TODO

+ 8 - 0
base-servers/gateway-server/src/main/java/com/usoftchina/saas/gateway/config/AuthFilter.java

@@ -19,7 +19,9 @@ import com.usoftchina.saas.exception.ExceptionCode;
 import com.usoftchina.saas.gateway.error.PermissionException;
 import com.usoftchina.saas.gateway.util.AntPathRequestMatcher;
 import com.usoftchina.saas.utils.CollectionUtils;
+import com.usoftchina.saas.utils.JsonUtils;
 import com.usoftchina.saas.utils.RedisUtil;
+import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.context.properties.EnableConfigurationProperties;
@@ -57,6 +59,8 @@ public class AuthFilter implements GlobalFilter, Ordered {
     @Autowired
     private AuthApi authApi;
 
+    private static final Logger LOGGER = LoggerFactory.getLogger(AuthFilter.class);
+
     @Override
     public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) {
         try {
@@ -118,6 +122,8 @@ public class AuthFilter implements GlobalFilter, Ordered {
      * @param accountDTO
      */
     private void checkPermission(ServerHttpRequest request, JwtInfo jwt, AccountDTO accountDTO) {
+        LOGGER.info("JwtInfo: " + JsonUtils.toJsonString(jwt));
+        LOGGER.info("accountDTO:" + JsonUtils.toJsonString(accountDTO));
         if (!accountDTO.isAdmin(jwt.getCompanyId())) {
             // 非管理账户,需要鉴权
             List<UrlResourceDTO> resources = ResourceCache.current().getUrlResources();
@@ -129,6 +135,8 @@ public class AuthFilter implements GlobalFilter, Ordered {
                 }).collect(Collectors.toList());
                 if (!CollectionUtils.isEmpty(permissions)) {
                     Set<Long> resourceIds = accountDTO.getResources(jwt.getAppId(), jwt.getCompanyId());
+                    LOGGER.info("permissions: " + permissions);
+                    LOGGER.info("resourceIds: " + resourceIds);
                     boolean permitted = false;
                     if (null != resourceIds) {
                         // 权限匹配

+ 1 - 0
frontend/saas-portal-web/src/components/conenter/addenterprise.vue

@@ -492,6 +492,7 @@ import { setTimeout, clearTimeout } from 'timers';
                                     document.documentElement.scrollTop = 0;
                                     let session = Session.get();
                                     session.account.realname = name;
+                                    session.account.email = email;
                                     Session.set(session);
                                     // this.$router.push({name:'company'})
                                     this.$router.push({path: '/enterprise'});

+ 12 - 31
frontend/saas-portal-web/src/components/conenter/invitation.vue

@@ -2,9 +2,7 @@
     <div class="invitation">
         <div class="zhezhao" v-if="istanchaung"></div>
         <div class="Popup" v-if="istanchaung">
-        <!-- <div class="Popup"> -->
             <div class="shang">
-                <!-- <img src="/static/img/caidian2x.png" alt=""> -->
                 <img src="/static/img/tijiao.png" alt="">
                 <img class="xs" @click="hidden" src="/static/img/assets/chahao.png" alt="">
             </div>
@@ -54,6 +52,7 @@
 <script>
 import Session from '@/utils/session'
 import { setTimeout } from 'timers';
+import { log } from 'util';
     export default {
         data(){
             return {
@@ -170,10 +169,7 @@ import { setTimeout } from 'timers';
                     let phone = this.$refs.phone.value;//手机 
                     this.$ajax({
                         url: this.$url.api+'/api/commons/share/getSmsCode'+`?mobile=${phone}`,//http://192.168.253.31:8560
-                        method:'POST',
-                        headers:{
-                            "Authorization":Session.getToken(),
-                        }
+                        method:'POST'
                     })
                     .then(res=>{
                         if (res.data.success) {
@@ -216,9 +212,6 @@ import { setTimeout } from 'timers';
                             roleId:roleid,
                             validCode:Verification,
                         },
-                        headers:{
-                            "Authorization":Session.getToken(),
-                        }
                     })
                     .then(res=>{
                         if (res.data.success) {
@@ -251,9 +244,6 @@ import { setTimeout } from 'timers';
                 let companyId = this.enterprise.companyId;
                 this.$ajax({
                     url: this.$url.api+'/api/account/role/list/'+companyId,
-                    headers:{
-                        "Authorization":Session.getToken(),
-                    }
                 })
                 .then(res=>{
                     if (res.data.success) {
@@ -261,32 +251,23 @@ import { setTimeout } from 'timers';
                     }
                 })
             },
-            //获取页面参数
-            param(){
+            //同步获取页面参数
+            param: async function () {
                 let url1 = window.location.href;
                 let param = url1.substring(url1.lastIndexOf('=')+1, url1.length);
-                this.$ajax({
+                let data = await this.$ajax({
                     url: this.$url.api+"/api/commons/share/valid/param?param="+param,
                     method:'POST',
                     headers:{
-                        "Authorization":Session.getToken(),
                         "Content-Type":"application/x-www-form-urlencoded",
                     }
-                })
-                .then(res=>{
-                    if (res.data.success) {
-                        this.enterprise = res.data.data;
-                        //获取角色
-                        setTimeout(()=>{
-                            this.role()
-                        },800)
-                    } else {
-                        this.$message.error({
-                            message:res.data.message,
-                            });
-                        this.$router.push({path:'/failure'})
-                    }
-                })
+                });
+                if (data.data.success) {
+                    this.enterprise = data.data.data;
+                    this.role();//获取角色
+                } else {
+                    this.$router.push({path:'/failure'})
+                }
             },
             //关闭弹窗
             hidden(){

+ 1 - 1
frontend/saas-portal-web/src/pages/invitation_mobile_join/invitation_mobile_join.html

@@ -174,7 +174,7 @@
                     has_icon:true,
                     has_close_btn:false,
                     fullscreen:false,
-                    timeout:233000,
+                    timeout:2000,
                     position_class: "toast-top-center",
                     sticky:false,
                     has_progress:false,

+ 1 - 2
frontend/saas-portal-web/static/css/toast.style.css

@@ -20,8 +20,7 @@ i {
   -moz-osx-font-smoothing: grayscale; }
 
 .toast-icon-error:before {
-  content: "E";
-  font-weight: 600;}
+  content: "!";}
 
 .toast-icon-info:before {
   content: ""; }

File diff suppressed because it is too large
+ 0 - 0
frontend/saas-portal-web/static/js/stomp.min.js


+ 39 - 4
frontend/saas-web/app/view/core/form/SettingWin.js

@@ -25,7 +25,14 @@ Ext.define('saas.view.core.form.SettingWin', {
             text: '序号',
             dataIndex: 'index',
             align: 'center',
-            width: 80
+            width: 80,
+            renderer: function(v, m, r) {
+                m.tdCls = 'x-cell-index'; 
+                if(r.get('locked')) {
+                    m.tdCls += ' x-cell-index-locek'; 
+                }
+                return v;
+            }
         }, {
             text: '标识名称',
             dataIndex: 'name',
@@ -49,6 +56,22 @@ Ext.define('saas.view.core.form.SettingWin', {
             width: 150,
             editor: {
                 xtype: 'textfield',
+                maxLength: 10,
+                validator: function (val) {
+                    var grid = this.up('grid'),
+                    store = grid.store,
+                    s = grid.getSelection()[0],
+                    errMsg = "显示名称不能重复",
+                    count = 0;
+
+                    store.each(function(r) {
+                        if(s.data.alias != val && r.get('alias') == val) {
+                            count++;
+                        }
+                    });
+
+                    return (!val || count < 1) ? true : errMsg;
+                }
             }
         }, {
             text: '类型',
@@ -154,11 +177,12 @@ Ext.define('saas.view.core.form.SettingWin', {
                             containerScroll: true,
                             dragGroup: 'dd-grid-group',
                             dropGroup: 'dd-grid-group',
-                            dragText: '移动到此位置'
+                            dragText: '移动到此位置',
                         }
                     },
         
                     listeners: {
+                        beforedrop: 'onBeforeDrop',
                         drop: 'onDrop'
                     }
                 },
@@ -172,7 +196,9 @@ Ext.define('saas.view.core.form.SettingWin', {
                         { name: 'alias', type: 'string' },
                         { name: 'type', type: 'string' },
                         { name: 'enable', type: 'boolean' },
-                        { name: 'width', type: 'float'}
+                        { name: 'width', type: 'float'},
+                        { name: 'disabled', type: 'boolean'},
+                        { name: 'locked', type: 'boolean'},
                     ],
                     data: [],
                 }),
@@ -254,7 +280,8 @@ Ext.define('saas.view.core.form.SettingWin', {
                 alias: me.getFieldAlias(item, settype),
                 type: me.getFieldType(item, settype),
                 enable: !item.hidden,
-                width: me.getFieldWidth(item, settype)
+                width: me.getFieldWidth(item, settype),
+                locked: me.getFieldLocked(item, settype)
             }
         });
 
@@ -362,6 +389,14 @@ Ext.define('saas.view.core.form.SettingWin', {
         return width;
     },
 
+    getFieldLocked: function(item, settype) {
+        var locked = false;
+        if(settype != 'main') {
+            locked = !!item.locked;
+        }
+        return locked;
+    },
+
     isContainsAny: function (arr1, arr2) {
         for (var i = 0; i < arr2.length; i++) {
             var a2 = arr2[i];

+ 4 - 0
frontend/saas-web/app/view/core/form/SettingWin.scss

@@ -13,6 +13,10 @@
         font-weight: bold;
     }
 
+    .x-cell-index-locek {
+        opacity: 0.3;
+    }
+
     .x-keyboard-mode .x-grid-item-focused,
     .x-cell-required {
         &>div {

+ 10 - 3
frontend/saas-web/app/view/core/form/SettingWinController.js

@@ -8,18 +8,16 @@ Ext.define('saas.view.core.form.SettingWinController', {
     },
 
     isEnableDisabled: function(view, rowIdx, colIdx, item, record) {
-        return !record.data.allowBlank;
+        return !record.data.allowBlank || record.get('disabled');
     },
 
     onBeforeEdit: function(editor, context, eOpts) {
         let record = context.record,
         column = context.column,
-        disabled = record.get('disabled'),
         type = record.get('type'),
         flag = true;
 
         if(
-            (disabled && column.dataIndex == 'enable') ||
             ['grid'].indexOf(type) != -1 ||
             (['group'].indexOf(type) != -1 && column.dataIndex == 'width')
         ) {
@@ -36,6 +34,15 @@ Ext.define('saas.view.core.form.SettingWinController', {
         }
     },
 
+    onBeforeDrop: function(node, data, overModel, dropPosition, dropHandlers, eOpts) {
+        var fdata = data.records[0].data,
+        tdata = overModel.data,
+        fLocked = fdata.locked,
+        tLocked = tdata.locked;
+        
+        return !fLocked && !tLocked;
+    },
+
     onDrop: function() {
         var me = this,
         win = me.getView(),

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

@@ -160,6 +160,10 @@ Ext.define('saas.view.document.product.FormController', {
         detailGrid = form.down('detailGridField');
         form.getForm().findField('qcsz').resetOriginalValue();
         detailGrid.setHidden(!value);
+
+        if(detailGrid.store.getCount() == 0) {
+            detailGrid.add10EmptyRow(3);
+        }
     },
 
     amount_change:function() {

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

@@ -449,24 +449,24 @@ Ext.define('saas.view.document.product.FormPanel', {
                 hidden: true,
                 initHidden: false
             }],
-
-            listeners: {
-                load: function (form, data) {
-                    var viewModel = form.getViewModel();
-                    var store = viewModel.get('detail0').detailStore,
-                        detailGrid = form.down('grid'),
-                        trueData = detailGrid.getTrueData();
-
-                    viewModel.set('qcsz', trueData.length > 0);
-                    viewModel.set('qcsz_disabled', trueData.length > 0);
-                    viewModel.notify();
-                    form.getForm().findField('qcsz').resetOriginalValue();
-                }
-            },
         });
         this.callParent(arguments);
     },
 
+    listeners: {
+        load: function (form, data) {
+            var viewModel = form.getViewModel();
+            var store = viewModel.get('detail0').detailStore,
+                detailGrid = form.down('grid'),
+                trueData = detailGrid.getTrueData();
+
+            viewModel.set('qcsz', trueData.length > 0);
+            viewModel.set('qcsz_disabled', trueData.length > 0);
+            viewModel.notify();
+            form.getForm().findField('qcsz').resetOriginalValue();
+        }
+    },
+
     beforeSave: function () {
         var me = this,
             controller = me.getController(),

+ 1 - 1
frontend/saas-web/app/view/money/report/PayDetail.js

@@ -6,7 +6,7 @@ Ext.define('saas.view.money.report.PayDetail', {
     viewModel: 'money-report-paydetail',
     viewName: 'money-report-paydetail',
 
-    groupField:'pd_vendid',
+    groupField:'pd_vendname',
     groupHeaderTpl: '供应商名称: {[values.rows[0].data.pd_vendname]}',
     listUrl: '/api/money/report/payDetail',
     defaultCondition: null,

+ 1 - 1
frontend/saas-web/app/view/money/report/RecDetail.js

@@ -7,7 +7,7 @@ Ext.define('saas.view.money.report.RecDetail', {
 
     viewName: 'money-report-recdetail',
 
-    groupField: 'rd_custid',
+    groupField: 'rd_custname',
     groupHeaderTpl: '客户名称: {[values.rows[0].data.rd_custname]}',
     listUrl: '/api/money/report/recDetail',
     defaultCondition: null,

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

@@ -53,14 +53,6 @@ Ext.define('saas.view.stock.report.Prodiodetail', {
         text: 'id',
         dataIndex: 'id',
         hidden: true
-    }, {
-        text: '单号',
-        dataIndex: 'pi_inoutno',
-        width: 150
-    }, {
-        text: '业务类型',
-        dataIndex: 'pi_class',
-        width: 100
     }, {
         text: '单据日期',
         dataIndex: 'pi_date',
@@ -78,6 +70,14 @@ Ext.define('saas.view.stock.report.Prodiodetail', {
         renderer: function(v) {
             return saas.util.BaseUtil.numberFormat(v, 0, false);
         }
+    }, {
+        text: '单号',
+        dataIndex: 'pi_inoutno',
+        width: 150
+    }, {
+        text: '业务类型',
+        dataIndex: 'pi_class',
+        width: 100
     }, {
         text: '物料编号',
         dataIndex: 'pd_prodcode',

Some files were not shown because too many files changed in this diff