Browse Source

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

zhoudw 7 years ago
parent
commit
518998500b

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

@@ -426,6 +426,7 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         targetPi.setPi_custname(sourcePi.getPi_custname());
         targetPi.setPi_said(sourcePi.getPi_said());
         targetPi.setPi_sacode(sourcePi.getPi_sacode());
+        targetPi.setPi_address(sourcePi.getPi_address());
         //保存数据
         getMapper().insertSelective(targetPi);
         //插入销售退货单从表

+ 16 - 5
applications/storage/storage-dto/src/main/java/com/usoftchina/saas/storage/po/MakeMaterial.java

@@ -1,6 +1,7 @@
 package com.usoftchina.saas.storage.po;
 
 import com.usoftchina.saas.base.entity.CommonBaseEntity;
+import com.usoftchina.saas.document.dto.ProductDTO;
 import com.usoftchina.saas.document.entities.Product;
 
 import java.io.Serializable;
@@ -24,6 +25,8 @@ public class MakeMaterial extends CommonBaseEntity implements Serializable {
 
     private String mm_whcode;
 
+    private String mm_whname;
+
     private Double mm_price;
 
     private Double mm_oneuseqty;
@@ -36,14 +39,22 @@ public class MakeMaterial extends CommonBaseEntity implements Serializable {
 
     private String mm_remark;
 
-    private Product product;
+    private ProductDTO productDTO;
+
+    public String getMm_whname() {
+        return mm_whname;
+    }
+
+    public void setMm_whname(String mm_whname) {
+        this.mm_whname = mm_whname;
+    }
 
-    public Product getProduct() {
-        return product;
+    public ProductDTO getProductDTO() {
+        return productDTO;
     }
 
-    public void setProduct(Product product) {
-        this.product = product;
+    public void setProductDTO(ProductDTO productDTO) {
+        this.productDTO = productDTO;
     }
 
     public Long getMm_maid() {

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

@@ -89,7 +89,6 @@ public class MakeServiceImpl extends CommonBaseServiceImpl<MakeMapper, Make> imp
                     makeMaterial.setCompanyId(BaseContextHolder.getCompanyId());
                     makeMaterial.setCreatorId(BaseContextHolder.getUserId());
                     makeMaterial.setCreateTime(new Date());
-
                 }
                 makeMaterialMapper.batchInsert(makeMaterialList);
             }
@@ -109,6 +108,7 @@ public class MakeServiceImpl extends CommonBaseServiceImpl<MakeMapper, Make> imp
                 //更新从表
                 for (MakeMaterial makeMaterial : makeMaterialList) {
                     if (makeMaterial.getId() == 0) {
+                        makeMaterial.setMm_maid(make.getId());
                         makeMaterial.setCreatorId(BaseContextHolder.getUserId());
                         makeMaterial.setCreateTime(new Date());
                         makeMaterial.setCompanyId(BaseContextHolder.getCompanyId());
@@ -121,8 +121,12 @@ public class MakeServiceImpl extends CommonBaseServiceImpl<MakeMapper, Make> imp
                     }
                 }
                 //执行插入、更新
-                makeMaterialMapper.batchInsert(insertItems);
-                makeMaterialMapper.batchUpdate(updateItems);
+                if (insertItems.size() > 0) {
+                    makeMaterialMapper.batchInsert(insertItems);
+                }
+                if (updateItems.size() > 0) {
+                    makeMaterialMapper.batchUpdate(updateItems);
+                }
             }
             //记录LOG
             docBaseDTO = generateMsgObj(make.getId(), make.getMa_code());

+ 6 - 6
applications/storage/storage-server/src/main/resources/mapper/MakematerialMapper.xml

@@ -18,7 +18,7 @@
     <result column="companyId" property="companyId" jdbcType="INTEGER" />
     <result column="updaterId" property="updaterId" jdbcType="INTEGER" />
     <result column="updateTime" property="updateTime" jdbcType="TIMESTAMP" />
-    <association property="product" javaType="com.usoftchina.saas.document.dto.ProductDTO">
+    <association property="productDTO" javaType="com.usoftchina.saas.document.dto.ProductDTO">
         <id column="pr_id" property="id" jdbcType="INTEGER" />
         <result column="pr_code" property="pr_code" jdbcType="VARCHAR" />
         <result column="pr_detail" property="pr_detail" jdbcType="VARCHAR" />
@@ -246,18 +246,18 @@
     where mm_id = #{id}
   </update>
   <select id="selectByFK" resultMap="BaseResultMap">
-    SELECT * FROM MAKEMATERIAL LEFT JOIN PRODUCT ON PR_ID=MA_PRODID AND MAKEMATERIAL.COMPANYID=PRODUCT.COMPANYID WHERE MM_MAID=#{id} AND MAKEMATERIAL.COMPANYID={companyId}
+    SELECT * FROM MAKEMATERIAL LEFT JOIN PRODUCT ON PR_ID=MM_PRODID AND MAKEMATERIAL.COMPANYID=PRODUCT.COMPANYID WHERE MM_MAID=#{id} AND MAKEMATERIAL.COMPANYID=#{companyId}
   </select>
   <delete id="deleteByFK">
-    DELETE FROM MAKEMATERIAL WHERE MM_MAID=#{id} AND COMPANYID={companyId}
+    DELETE FROM MAKEMATERIAL WHERE MM_MAID=#{id} AND COMPANYID=#{companyId}
   </delete>
   <insert id="batchInsert" parameterType="java.util.List">
       INSERT INTO MAKEMATERIAL (mm_maid, mm_detno,
       mm_prodid, mm_prodcode, mm_whid,
-      mm_whcode, mm_price, mm_oneuseqty,
+      mm_whcode, mm_price, mm_oneuseqty
       mm_qty, mm_amount, mm_repprodcode,
       mm_remark, companyId, updaterId,
-      updateTime)
+      updateTime,mm_whname)
       VALUES
     <foreach collection="list" item="item" index="index" open="" close="" separator=",">
       (
@@ -266,7 +266,7 @@
       #{item.mm_whcode,jdbcType=VARCHAR}, #{item.mm_price,jdbcType=DOUBLE}, #{item.mm_oneuseqty,jdbcType=DOUBLE},
       #{item.mm_qty,jdbcType=DOUBLE}, #{item.mm_amount,jdbcType=DOUBLE}, #{item.mm_repprodcode,jdbcType=VARCHAR},
       #{item.mm_remark,jdbcType=VARCHAR}, #{item.companyId,jdbcType=INTEGER}, #{item.updaterId,jdbcType=INTEGER},
-      #{item.updateTime,jdbcType=TIMESTAMP}
+      #{item.updateTime,jdbcType=TIMESTAMP},#{item.mm_whname,jdbcType=VARCHAR}
       )
     </foreach>
   </insert>

+ 49 - 34
frontend/saas-web/app/view/core/dbfind/DbfindTrigger.js

@@ -104,7 +104,7 @@ Ext.define('saas.view.core.dbfind.DbfindTrigger', {
                     method: 'GET',
                     success: function(response, opts) {
                         data = Ext.decode(response.responseText);
-                        data = data.data.list;
+                        data = data.data?data.data.list:[];
                         if(data!=null && data.length>0 && me.store && field.length>0){
                             me.store.loadData(data,false);
                             me.expand();
@@ -122,6 +122,7 @@ Ext.define('saas.view.core.dbfind.DbfindTrigger', {
     	}
     },
     onTriggerClick:function(f){
+        f.blur(f);
         //判断dbfindtrigger归属
         f.judge(f);//form
         var panel = f.up('core-tab-panel'),panelEl;
@@ -176,46 +177,60 @@ Ext.define('saas.view.core.dbfind.DbfindTrigger', {
         blur:function(f,e){
             var me = f;
             var count = f.store.getCount();
+            var searchCount = false;//校验数据库是否有该字段
             var dbfinds = me.dbfinds;
-            // if(count==1){
-            //     record = f.store.data.items[0];
-            //     if(dbfinds&&dbfinds.length>0){
-            //         if(me.belong=='grid'){
-            //             for (let index = 0; index < dbfinds.length; index++) {
-            //                 var item = dbfinds[index];
-            //                 var rec = me.column.ownerCt.ownerCt.selModel.getLastSelected();
-            //                 var nowRec = me.column.ownerCt.ownerCt.store.getData().getByKey(rec.id);
-            //                 nowRec.set(item.to,record.get(item.from));
-            //                 if(me.name==item.to){
-            //                     me.column.getEditor().setValue(record.get(item.from));
-            //                 }
-            //             }
-            //         }else if(me.belong=='form'){
-            //             for (let index = 0; index < dbfinds.length; index++) {
-            //                 var item = dbfinds[index];
-            //                 var field = me.ownerCt.down('[name='+item.to+']');
-            //                 if(field){
-            //                     var val = record.get(item.from);
-            //                     if(field.xtype=='dbfindtrigger'){
-            //                         field.setRawValue(val);
-            //                         field.value = val;
-            //                         field.lastTriggerValue=val;
-            //                     }else{
-            //                         field.setValue(val);
-            //                     }    
-            //                 }
-            //             }
-            //         }
-            //     }
-            // }else 
-            if(!f.value||f.value==''){
+            if(count>0){
+                //添加默认条件
+                var searchField = null;
+                var dbCondition = [];
+                if(me.defaultCondition) {
+                    dbCondition.push({
+                        type: 'condition',
+                        value: me.defaultCondition
+                    });
+                }
+                for (let index = 0; index < dbfinds.length; index++) {
+                    var item = dbfinds[index].to;
+                    if(item==me.name){
+                        searchField = dbfinds[index].from;
+                    }
+                }
+                dbCondition.push({
+                    type: 'condition',
+                    value: searchField + "='"+me.value+"'"
+                });
+                Ext.Ajax.request({
+                    url: me.dataUrl,
+                    async:false,
+                    params: {
+                        number: 1,
+                        size: 1,
+                        condition:JSON.stringify(dbCondition),
+                        page: 1,
+                        start: 0,
+                        limit: 10
+                    },
+                    method: 'GET',
+                    success: function(response, opts) {
+                        data = Ext.decode(response.responseText);
+                        data = data.data?data.data.list:[];
+                        if(data.length>0){
+                            searchCount = true
+                        }
+                    },
+                    failure: function(response, opts) {}
+                }); 
+            }
+            if(!f.value||f.value==''||count==0||!searchCount){
                 if(dbfinds&&dbfinds.length>0){
                     if(me.belong=='grid'){
                         for (let index = 0; index < dbfinds.length; index++) {
                             var item = dbfinds[index];
                             var rec = me.column.ownerCt.ownerCt.selModel.getLastSelected();
                             var nowRec = me.column.ownerCt.ownerCt.store.getData().getByKey(rec.id);
-                            nowRec.set(item.to,'');
+                            if(nowRec.get(item.to)&&nowRec.get(item.to)!=""){
+                                nowRec.set(item.to,'');
+                            }
                             if(me.name==item.to){
                                 me.column.getEditor().setValue('');
                             }

+ 49 - 34
frontend/saas-web/app/view/core/dbfind/MultiDbfindTrigger.js

@@ -111,7 +111,7 @@ Ext.define('saas.view.core.dbfind.MultiDbfindTrigger', {
                     method: 'GET',
                     success: function(response, opts) {
                         data = Ext.decode(response.responseText);
-                        data = data.data.list;
+                        data = data.data?data.data.list:[];
                         if(data!=null && data.length>0 && me.store && field.length>0){
                             me.store.loadData(data,false);
                             me.expand();
@@ -129,6 +129,7 @@ Ext.define('saas.view.core.dbfind.MultiDbfindTrigger', {
     	}
     },
     onTriggerClick:function(f){
+        f.blur(f);
         //判断dbfindtrigger归属
         f.judge(f);
         var panel = f.up('core-tab-panel'),panelEl;
@@ -170,46 +171,60 @@ Ext.define('saas.view.core.dbfind.MultiDbfindTrigger', {
         blur:function(f,e){
             var me = f;
             var count = f.store.getCount();
+            var searchCount = false;//校验数据库是否有该字段
             var dbfinds = me.dbfinds;
-            // if(count==1){
-            //     record = f.store.data.items[0];
-            //     if(dbfinds&&dbfinds.length>0){
-            //         if(me.belong=='grid'){
-            //             for (let index = 0; index < dbfinds.length; index++) {
-            //                 var item = dbfinds[index];
-            //                 var rec = me.column.ownerCt.ownerCt.selModel.getLastSelected();
-            //                 var nowRec = me.column.ownerCt.ownerCt.store.getData().getByKey(rec.id);
-            //                 nowRec.set(item.to,record.get(item.from));
-            //                 if(me.name==item.to){
-            //                     me.column.getEditor().setValue(record.get(item.from));
-            //                 }
-            //             }
-            //         }else if(me.belong=='form'){
-            //             for (let index = 0; index < dbfinds.length; index++) {
-            //                 var item = dbfinds[index];
-            //                 var field = me.ownerCt.down('[name='+item.to+']');
-            //                 if(field){
-            //                     var val = record.get(item.from);
-            //                     if(field.xtype=='dbfindtrigger'){
-            //                         field.setRawValue(val);
-            //                         field.value = val;
-            //                         field.lastTriggerValue=val;
-            //                     }else{
-            //                         field.setValue(val);
-            //                     }    
-            //                 }
-            //             }
-            //         }
-            //     }
-            // }else 
-            if(!f.value||f.value==''){
+            if(count>0){
+                //添加默认条件
+                var searchField = null;
+                var dbCondition = [];
+                if(me.defaultCondition) {
+                    dbCondition.push({
+                        type: 'condition',
+                        value: me.defaultCondition
+                    });
+                }
+                for (let index = 0; index < dbfinds.length; index++) {
+                    var item = dbfinds[index].to;
+                    if(item==me.name){
+                        searchField = dbfinds[index].from;
+                    }
+                }
+                dbCondition.push({
+                    type: 'condition',
+                    value: searchField + "='"+me.value+"'"
+                });
+                Ext.Ajax.request({
+                    url: me.dataUrl,
+                    async:false,
+                    params: {
+                        number: 1,
+                        size: 1,
+                        condition:JSON.stringify(dbCondition),
+                        page: 1,
+                        start: 0,
+                        limit: 10
+                    },
+                    method: 'GET',
+                    success: function(response, opts) {
+                        data = Ext.decode(response.responseText);
+                        data = data.data?data.data.list:[];
+                        if(data.length>0){
+                            searchCount = true
+                        }
+                    },
+                    failure: function(response, opts) {}
+                }); 
+            }
+            if(!f.value||f.value==''||count==0||!searchCount){
                 if(dbfinds&&dbfinds.length>0){
                     if(me.belong=='grid'){
                         for (let index = 0; index < dbfinds.length; index++) {
                             var item = dbfinds[index];
                             var rec = me.column.ownerCt.ownerCt.selModel.getLastSelected();
                             var nowRec = me.column.ownerCt.ownerCt.store.getData().getByKey(rec.id);
-                            nowRec.set(item.to,'');
+                            if(nowRec.get(item.to)&&nowRec.get(item.to)!=""){
+                                nowRec.set(item.to,'');
+                            }
                             if(me.name==item.to){
                                 me.column.getEditor().setValue('');
                             }

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

@@ -255,6 +255,7 @@ Ext.define('KitchenSink.view.binding.ChildForm', {
                 hideTrigger : true, 
                 fieldLabel: '流水长度',
                 name: 'mn_number',
+                minValue : 0, 
                 allowBlank:false
             }]
         }

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

@@ -12,7 +12,7 @@ Ext.define('saas.view.document.product.FormController', {
                         dataUrl:'/api/document/vendor/getVendorsByCondition',
                         //赋值 
                         dbfinds:[{
-                            from:'id',to:'pr_vendid'
+                            from:'id',to:'pr_vendid',ignore:true
                         },{
                             from:'ve_code',to:'pr_vendcode'
                         },{

+ 1 - 1
frontend/saas-web/app/view/sys/messagelog/DataList.js

@@ -78,7 +78,7 @@ Ext.define('saas.view.sys.messagelog.DataList', {
         width : 120.0, 
     }, 
     {
-        text : "处理人", 
+        text : "操作人员", 
         dataIndex : "ml_man", 
         width : 200, 
     }],

+ 2 - 2
frontend/saas-web/resources/json/navigation.json

@@ -27,7 +27,7 @@
     }, {
         "text": "报表",
         "items": [{
-            "id": "purchase",
+            "id": "report-purchase",
             "text": "采购明细表",
             "viewType": "purchase-report-purchase"
         }, {
@@ -65,7 +65,7 @@
         "items": [{
             "text": "销售明细表"
         }, {
-            "id": "salein",
+            "id": "report-salein",
             "text": "销售收款一览表",
             "viewType": "sale-report-salein"
         }, {