Browse Source

Merge remote-tracking branch 'origin/dev' into dev

heqinwei 7 năm trước cách đây
mục cha
commit
6772b4302c

+ 1 - 1
applications/document/document-server/src/main/resources/mapper/CustomerMapper.xml

@@ -404,7 +404,7 @@
 
   <select id="validNameAndCodeWhenRelated" parameterType="com.usoftchina.saas.document.entities.Customer" resultType="int">
     select count(1) from customer where (cu_code != #{cu_code,jdbcType=VARCHAR} or cu_name != #{cu_name,jdbcType=VARCHAR})
-    and cu_id != #{id} and companyId =#{companyId}
+    and cu_id = #{id} and companyId =#{companyId}
   </select>
 
 

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

@@ -171,8 +171,6 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
             //日志记录
             messageLogService.save(baseDTO);
             return baseDTO;
-        }else{
-            //setUpdateInfo(prodInOut);
         }
         //更新操作
         getMapper().updateByPrimaryKeySelective(prodInOut);
@@ -181,7 +179,6 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
             ProdIODetail detail = BeanMapper.map(item, ProdIODetail.class);
             detail.setUpdaterId(userId);
             detail.setUpdateTime(new Date());
-//            detail.setUpdater(userName);
             if (StringUtils.isEmpty(detail.getId()) || "0".equals(detail.getId().toString())) {
                 detail.setCompanyId(companyId);
                 detail.setCreatorId(userId);
@@ -448,9 +445,9 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         targetPi.setCompanyId(sourcePi.getCompanyId());
         targetPi.setCreateTime(new Date());
         targetPi.setCreatorId(userId);
-//        targetPi.setCreator(userName);
+        targetPi.setCreatorName(userName);
         targetPi.setUpdaterId(userId);
-//        targetPi.setUpdater(userName);
+        targetPi.setUpdaterName(userName);
         targetPi.setUpdateTime(new Date());
 
         //保存数据
@@ -485,9 +482,9 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
                  targetPid.setCompanyId(sourcePid.getCompanyId());
                  targetPid.setCreateTime(new Date());
                  targetPid.setCreatorId(userId);
-//                 targetPid.setCreator(userName);
+                 targetPid.setCreatorName(userName);
                  targetPid.setUpdaterId(userId);
-//                 targetPid.setUpdater(userName);
+                 targetPid.setUpdaterName(userName);
                  targetPid.setUpdateTime(new Date());
                  //本次转单数
                  targetPid.setPd_outqty(pdInqty-pdYqty);
@@ -514,7 +511,6 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
             }
             prodInOut.setPi_statuscode(Status.CLOSE.name());
             prodInOut.setPi_status(Status.CLOSE.getDisplay());
-            //setUpdateInfo(prodInOut);
             getMapper().updateByPrimaryKeySelective(prodInOut);
             docBaseDTO = getBaseDTOById(id,prodInOut.getPi_class(),prodInOut.getPi_inoutno());
             //日志

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

@@ -442,9 +442,9 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
         prodInOut.setCompanyId(purchase.getCompanyId());
         prodInOut.setCreatorId(userId);
         prodInOut.setCreateTime(new Date());
-//        prodInOut.setCreator(userName);
+        prodInOut.setCreatorName(userName);
         prodInOut.setUpdaterId(userId);
-//        prodInOut.setUpdater(userName);
+        prodInOut.setUpdaterName(userName);
         prodInOut.setUpdateTime(new Date());
         prodInOutMapper.insertSelective(prodInOut);
         //插入验收单从表
@@ -472,10 +472,10 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
                 prodIODetail.setCompanyId(purchaseDetail.getCompanyId());
                 prodIODetail.setCreatorId(userId);
                 prodIODetail.setCreateTime(new Date());
-//                prodIODetail.setCreator(userName);
+                prodIODetail.setCreatorName(userName);
                 prodIODetail.setUpdaterId(userId);
                 prodIODetail.setUpdateTime(new Date());
-//                prodIODetail.setUpdater(userName);
+                prodIODetail.setUpdaterName(userName);
                 //本次转单数
                 prodIODetail.setPd_inqty(pdQty-pdYqty);
                 prodIODetailMapper.insertSelective(prodIODetail);
@@ -484,6 +484,8 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
                 purchasedetailMapper.updateByPrimaryKeySelective(purchaseDetail);
             }
         }
+        //取默认仓库
+        prodIODetailMapper.getDefaultWarehouseByProduct(pi_id);
         //采购验收单相关计算
         prodInOutService.calcProdInout(pi_id,"采购验收单");
         //日志记录到采购单

+ 9 - 0
framework/core/src/main/java/com/usoftchina/saas/utils/DateUtils.java

@@ -231,6 +231,15 @@ public class DateUtils {
         return format(new Date(), null);
     }
 
+    /**
+     * 当前时间
+     *
+     * @return <h3>String</h3>
+     */
+    public static String getCurrentDate(String format) {
+        return format(new Date(), format);
+    }
+
     /**
      * 截取指定日期的年月
      *

+ 14 - 0
framework/core/src/main/java/com/usoftchina/saas/utils/StringUtils.java

@@ -1,10 +1,14 @@
 package com.usoftchina.saas.utils;
 
+import java.util.Date;
+
 /**
  * @author yingp
  * @date 2018/10/10
  */
 public abstract class StringUtils extends org.springframework.util.StringUtils{
+
+    private final static String BUSINESSCODE_PREFIX = "SAASTRADE";
     /**
      * 为空取值
      *
@@ -25,4 +29,14 @@ public abstract class StringUtils extends org.springframework.util.StringUtils{
     public static String nullIf(String target) {
         return nullIf(target, "");
     }
+    /**
+    * @Description 随机生成企业执照号
+    * @Param: []
+    * @return: java.lang.String
+    * @Author: guq
+    * @Date: 2018/11/22
+    */
+    public static String createBusinessCode() {
+        return BUSINESSCODE_PREFIX + DateUtils.getCurrentDate("yyyyMMdd") + (int)(Math.random()*1000 + 1000);
+    }
 }

+ 10 - 0
frontend/saas-web/app/view/core/base/ImportWindow.js

@@ -0,0 +1,10 @@
+Ext.define('saas.view.core.base.ImportWindow', {
+    extend: 'Ext.window.Window',
+    xtype: 'importwindow',
+
+    initComponent: function() {
+        var me = this;
+        me.callParent(arguments);
+    }
+
+});

+ 16 - 0
frontend/saas-web/app/view/core/dbfind/MultiDbfindGridPanel.js

@@ -179,6 +179,22 @@ Ext.define('saas.view.core.dbfind.MultiDbfindGridPanel', {
                                 grid.selModel.deselectAll();
                                 grid.selModel.select(grid.selectRecordArr);
                                 grid.selModel.noChange = false;
+                                //刷新展示数据
+                                var dataCount = grid.selectRecordArr.length,msg;
+                                var display = b.ownerCt.child('#displayItem');
+                                if (dataCount === 0) {
+                                    msg = b.ownerCt.emptyMsg;
+                                } else {
+                                    msg = Ext.String.format(
+                                        b.ownerCt.displayMsg,
+                                        1,
+                                        dataCount,
+                                        dataCount
+                                    );
+                                }
+                                display.setText(msg);
+                                b.ownerCt.child('#inputItem').setValue(1);
+                                b.ownerCt.child("#afterTextItem").setText('页,共'+dataCount+'页');
                             }else{
                                 grid.selModel.noChange = true;
                                 grid.selModel.deselectAll();

+ 4 - 2
frontend/saas-web/app/view/core/form/MultiCombo.js

@@ -148,8 +148,10 @@ Ext.define('saas.view.core.form.MultiCombo', {
     hideMenu: function(b) {
         if (this.hasVisibleMenu()) {
             var target=b.parentEvent.relatedTarget;
-            if(!((target.className && target.className.indexOf('x-menu')!=-1) || (target.name && target.name.indexOf(this.name)!=-1))){
-                this.menu.hide();
+            if(target){
+                if(!((target.className && target.className.indexOf('x-menu')!=-1) || (target.name && target.name.indexOf(this.name)!=-1))){
+                    this.menu.hide();
+                }
             }
         }
         return this;

+ 51 - 9
frontend/saas-web/app/view/core/query/QueryFormPanel.js

@@ -8,6 +8,10 @@ Ext.define('saas.view.core.query.QueryFormPanel', {
     bodyPadding: '14 10 0 10',
     labelSeparator : ':',
 
+    requires: [
+        'Ext.container.ButtonGroup'
+    ],
+
     cls: 'x-queryform',
 
     defaults:{
@@ -19,16 +23,54 @@ Ext.define('saas.view.core.query.QueryFormPanel', {
 	},
 
     dockedItems: [{
+        width:110,
+        height: 40,
         xtype: 'toolbar',
-        dock: 'bottom',
-        items: ['->', {
-        //     xtype: 'button',
-        //     text: '更多查询',
-        //     handler: 'moreQuery'
-        // }, {
-            xtype: 'button',
-            text: '查询',
-            handler: 'onQuery'
+        dock: 'right',
+        items: [{
+            margin:'8 0 0 0',
+            xtype: 'buttongroup',
+            cls:'x-query-buttongroup',
+            items:[{
+                height:24,
+                width:50,
+                style:'min-width: 0px;min-height: 0px;',
+                xtype: 'button',
+                text: '查询',
+                handler: 'onQuery',
+            },{
+                height:24,
+                style:'min-width: 0px;min-height: 0px;border-color: #fff;background-color: #fff; height: 24px;width: 24px;margin-top: -4px;',
+                xtype: 'button',
+                iconCls:'x-fa fa-caret-square-o-down',
+                handler: 'showMore',
+                name:'showMore',
+                tooltip:'更多',
+                listeners:{
+                    afterrender:function(b){
+                        var columnWidthCount = 0;
+                        var items = b.ownerCt.ownerCt.ownerCt.items.items;
+                        Ext.each(items, function(item, index){
+                            if(item.xtype != 'hidden'){
+                                columnWidthCount+= item.columnWidth
+                            }
+                        });
+                        columnWidthCount = Math.ceil(columnWidthCount);
+                        if(columnWidthCount<=1){
+                            b.hide();
+                        }
+                    }
+                }
+            },{
+                name:'hideMore',
+                hidden:true,
+                height:24,
+                tooltip:'隐藏',
+                style:'min-width: 0px;min-height: 0px;border-color: #fff;background-color: #fff; height: 24px;width: 24px;margin-top: -4px;',
+                xtype: 'button',
+                iconCls:'x-fa fa-caret-square-o-up',
+                handler: 'hideMore'
+            }]
         },'->']
     }],
 

+ 1 - 0
frontend/saas-web/app/view/core/query/QueryPanel.js

@@ -16,6 +16,7 @@ Ext.define('saas.view.core.query.QueryPanel', {
         reference: 'queryform',
         xtype: 'core-query-queryformpanel',
         width: '100%',
+        height:56,
         margin: '0 0 12 0',
     }, {
         // margin: '12 0 0 0',

+ 12 - 0
frontend/saas-web/app/view/core/query/QueryPanel.scss

@@ -3,6 +3,7 @@
     .x-panel-bodyWrap {
 
         .x-panel-body {
+            overflow: hidden !important;
             cursor: pointer;
 
             .x-box-inner {
@@ -18,6 +19,7 @@
                                 padding: 6px 0 16px 8px;
 
                                 .x-box-inner {
+                                    height: 36px !important;
                                     background: #FFFFFF;
         
                                 }
@@ -49,4 +51,14 @@
             }
         }
     }
+}
+
+.x-query-buttongroup{
+    border: 1px solid #ffffff !important;
+    .x-btn-group-body-default-framed .x-table-layout{
+        border-spacing: 2px !important;
+    }
+    .x-btn-default-toolbar-small .x-btn-inner-default-toolbar-small{
+        height:24px !important;
+    }
 }

+ 28 - 0
frontend/saas-web/app/view/core/query/QueryPanelController.js

@@ -22,6 +22,34 @@ Ext.define('saas.view.core.query.QueryPanelController', {
         viewModel.set('moreQuery', false);
         queryGrid.store.loadPage(1);
     },
+    showMore:function (){
+        var me = this,
+        queryPanel = me.getView(),
+        queryForm = queryPanel.down('core-query-queryformpanel');
+        var items = queryForm.items.items;
+        var columnWidthCount = 0;
+        Ext.each(items, function(item, index){
+            if(item.xtype != 'hidden'){
+                columnWidthCount+= item.columnWidth
+            }
+        });
+        columnWidthCount = Math.ceil(columnWidthCount);
+        if(columnWidthCount>1){
+            //展开
+            queryForm.animate({dynamic: true, duration: 500, to: {height: (24+42*columnWidthCount)+'px'}})
+            queryForm.dockedItems.items[0].down('[name=showMore]').hide();
+            queryForm.dockedItems.items[0].down('[name=hideMore]').show();
+        }
+    },
+    hideMore:function (){
+        var me = this,
+        queryPanel = me.getView(),
+        queryForm = queryPanel.down('core-query-queryformpanel');
+        //收缩
+        queryForm.animate({dynamic: true, duration: 500, to: {height: '56px'}})
+        queryForm.dockedItems.items[0].down('[name=hideMore]').hide();
+        queryForm.dockedItems.items[0].down('[name=showMore]').show();
+    },
     onMoreQuery: function() {
         var me = this,
         queryPanel = me.getView(),

+ 48 - 0
pom.xml

@@ -446,5 +446,53 @@
                 </pluginManagement>
             </build>
         </profile>
+        <profile>
+            <!-- mvn deploy -P docker-prod -->
+            <id>docker-prod</id>
+            <properties>
+                <docker.repository>10.10.100.200:5000</docker.repository>
+            </properties>
+            <build>
+                <pluginManagement>
+                    <plugins>
+                        <!-- Docker maven plugin -->
+                        <plugin>
+                            <groupId>com.spotify</groupId>
+                            <artifactId>docker-maven-plugin</artifactId>
+                            <version>1.0.0</version>
+                            <configuration>
+                                <dockerDirectory>${project.basedir}/src/main/docker</dockerDirectory>
+                                <registryUrl>${docker.repository}</registryUrl>
+                                <pushImage>true</pushImage>
+                                <forceTags>true</forceTags>
+                                <imageName>
+                                    ${docker.repository}/${docker.registry.name}/${project.artifactId}:${project.version}
+                                </imageName>
+                                <imageTags>
+                                    <imageTag>latest</imageTag>
+                                </imageTags>
+                                <resources>
+                                    <resource>
+                                        <targetPath>/</targetPath>
+                                        <directory>${project.build.directory}</directory>
+                                        <include>${project.build.finalName}.jar</include>
+                                    </resource>
+                                </resources>
+                            </configuration>
+                            <executions>
+                                <execution>
+                                    <id>build-image</id>
+                                    <phase>package</phase>
+                                    <goals>
+                                        <goal>build</goal>
+                                    </goals>
+                                </execution>
+                            </executions>
+                        </plugin>
+                        <!-- Docker maven plugin -->
+                    </plugins>
+                </pluginManagement>
+            </build>
+        </profile>
     </profiles>
 </project>