Browse Source

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

chenw 7 years ago
parent
commit
6dfc271aa7

+ 7 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/CustomerServiceImpl.java

@@ -30,6 +30,7 @@ import com.usoftchina.saas.page.PageRequest;
 import com.usoftchina.saas.utils.BeanMapper;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.StringUtils;
 
 import java.util.ArrayList;
@@ -98,6 +99,7 @@ public class CustomerServiceImpl extends CommonBaseServiceImpl<CustomerMapper, C
     }
 
     @Override
+    @Transactional
     public DocBaseDTO saveFormData(CustomerFormDTO data) {
         if (null == data || null == data.getMain()){
             throw new BizException(500, "数据为空,请填写后再保存");
@@ -223,6 +225,7 @@ public class CustomerServiceImpl extends CommonBaseServiceImpl<CustomerMapper, C
         singleDelete(id);
     }
 
+    @Transactional
     private void singleDelete(Long id) {
         if (null!=id) {
             DocBaseDTO docBaseDTO = getBaseDTOById(id);
@@ -249,6 +252,7 @@ public class CustomerServiceImpl extends CommonBaseServiceImpl<CustomerMapper, C
     }
 
     @Override
+    @Transactional
     public void deletecontact(Long id) {
         customercontactMapper.deleteByPrimaryKey(id);
         DocBaseDTO docBaseDTO = getBaseDTOById(id);
@@ -257,6 +261,7 @@ public class CustomerServiceImpl extends CommonBaseServiceImpl<CustomerMapper, C
     }
 
     @Override
+    @Transactional
     public void deleteaddress(Long id) {
         customeraddressMapper.deleteByPrimaryKey(id);
         DocBaseDTO docBaseDTO = getBaseDTOById(id);
@@ -264,6 +269,7 @@ public class CustomerServiceImpl extends CommonBaseServiceImpl<CustomerMapper, C
         messageLogService.deleteDetail(docBaseDTO);
     }
 
+    @Transactional
     private DocBaseDTO singleClose(Long id) {
         DocBaseDTO docBaseDTO = null;
         if (null!=id) {
@@ -298,6 +304,7 @@ public class CustomerServiceImpl extends CommonBaseServiceImpl<CustomerMapper, C
         }
     }
 
+    @Transactional
     private DocBaseDTO singleOpen(Long id) {
         DocBaseDTO docBaseDTO = null;
         if (null!=id) {

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

@@ -475,7 +475,7 @@
         <result column="wh_name" property="rc_whName" jdbcType="VARCHAR" />
         <result column="pw_onhand" property="rc_number" jdbcType="DOUBLE" />
         <result column="pw_avprice" property="rc_price" jdbcType="DOUBLE" />
-        <result column="pw_amount" property="rc_amount" jdbcType="DOOUBLE" />
+        <result column="pw_amount" property="rc_amount" jdbcType="DOUBLE" />
     </resultMap>
     <select id="selectReserveCost" resultMap="ProdReserveCostResultMap">
         select * from productWH tab left join Product on pw_prodcode=pr_code left join warehouse on pw_whcode=wh_code

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

@@ -13,6 +13,7 @@ import com.usoftchina.saas.commons.exception.BizExceptionCode;
 import com.usoftchina.saas.commons.po.BillCodeSeq;
 import com.usoftchina.saas.commons.po.Status;
 import com.usoftchina.saas.context.BaseContextHolder;
+import com.usoftchina.saas.document.api.ProductApi;
 import com.usoftchina.saas.exception.BizException;
 import com.usoftchina.saas.exception.ExceptionCode;
 import com.usoftchina.saas.page.PageRequest;
@@ -47,8 +48,8 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
     private PurchasedetailMapper purchasedetailMapper;
     @Autowired
     private PurchaseListMapper purchaseListMapper;
-   /* @Autowired
-    private ProductApi productApi;*/
+    @Autowired
+    private ProductApi productApi;
     @Autowired
     private MaxnumberService maxnumberService;
     @Autowired
@@ -179,6 +180,12 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
         }
         baseDTO = getBaseDTOById(pu_id);
 
+        //取供应商汇率
+        getVendorTaxrate(pu_id);
+        //取价
+        getPrice(pu_id);
+
+
         //计算金额,未税单价,未税金额等
         calcPurchase(pu_id);
         //日志
@@ -186,6 +193,15 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
         return baseDTO;
     }
 
+    private void getVendorTaxrate(Long pu_id) {
+        purchasedetailMapper.getVendorTaxrate(pu_id);
+    }
+
+    private void getPrice(Long pu_id) {
+        purchasedetailMapper.getPrice(pu_id);
+    }
+
+
     @Override
     @Transactional
     public void delete(Long id) {
@@ -474,7 +490,7 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
         //更新存在字段
         purchaseMapper.updateByPrimaryKeySelective(purchase);
         //更新最新采购单价
-        //productApi.updateLatestPurchasePrice(id);
+        productApi.updateLatestPurchasePrice(id);
         DocBaseDTO docBaseDTO = getBaseDTOById(id);
         //日志
         messageLogService.audit(docBaseDTO);

+ 2 - 2
frontend/saas-web/app/model/sale/Saledetail.js

@@ -5,8 +5,8 @@ Ext.define('saas.model.sale.Saledetail', {
         { name: 'sd_detno', type: 'int' },
         { name: 'id', type: 'int' },
         { name: 'sd_prodcode', type: 'string' },
-        { name: 'sd_qty', type: 'int' },
-        { name: 'sd_yqty', type: 'int' },
+        { name: 'sd_qty', type: 'float' },
+        { name: 'sd_yqty', type: 'float' },
         { name: 'sd_price', type: 'float' },
         { name: 'sd_taxrate', type: 'float' },
         { name: 'sd_total', type: 'float' },

+ 1 - 1
frontend/saas-web/app/util/FormUtil.js

@@ -221,7 +221,7 @@ Ext.define('saas.util.FormUtil', {
                             var detnoColumn = grid.detnoColumn;
                             var datas = [];
                             
-                            Ext.Array.each(new Array(3), function() {
+                            Ext.Array.each(new Array(10), function() {
                                 detno += 1;
                                 var data = {};
                                 data[detnoColumn] = detno;

+ 16 - 6
frontend/saas-web/app/view/core/dbfind/DbfindTrigger.js

@@ -42,7 +42,7 @@ Ext.define('saas.view.core.dbfind.DbfindTrigger', {
                             if(i==0){
                                 span=span+'<span style="width:'+dbtpls[i].width+'px;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;float:left;">{'+dbtpls[i].field+'}</span>';//display:block;
                             }else{
-                                span=span+'<span style="width:'+dbtpls[i].width+'px;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;float:left;">{'+dbtpls[i].field+'}</span>';
+                                span=span+'<span style="padding:0 0 0 20px;width:'+dbtpls[i].width+'px;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;float:left;">{'+dbtpls[i].field+'}</span>';
                             }
                             if(dbtpls[i].dbField=="true"){
                                 me.searchFieldArray=dbtpls[i].field;
@@ -68,11 +68,21 @@ Ext.define('saas.view.core.dbfind.DbfindTrigger', {
                 }
                 //加载数据
                 var data,dbCondition=[];
-                if(me.dbtplcondition){
-                    dbCondition = [{
-                        type: 'condition',
-                        value:me.dbtplcondition,
-                    }];
+                if(me.dbfinds){
+                    var dbtplcondition = "";
+                    for (let index = 0; index < dbfinds.length; index++) {
+                        var item = dbfinds[index].from;
+                        if(!dbfinds[index].ignore){
+                            dbtplcondition+= "upper("+item+") like '%"+queryString.toUpperCase()+"%' or ";
+                        }
+                    }
+                    dbtplcondition = "(" + dbtplcondition.substring(0,dbtplcondition.length-4) + ")";
+                    if(dbtplcondition.length>0){
+                        dbCondition = [{
+                            type: 'condition',
+                            value:dbtplcondition
+                        }];
+                    }
                 }
                 //添加默认条件
                 if(me.defaultCondition) {

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

@@ -86,7 +86,7 @@ Ext.define('saas.view.document.product.FormController', {
                         defaultCondition:"wh_statuscode='OPEN'",
                         //联想设置
                         dbtpls:[{
-                            field:'wh_code',width:100
+                            field:'wh_code',width:180
                         },{
                             field:'wh_description',width:100
                         }],

+ 1 - 1
frontend/saas-web/app/view/purchase/purchase/FormPanelController.js

@@ -15,7 +15,7 @@ Ext.define('saas.view.purchase.purchase.FormPanelController', {
                         defaultCondition:"ve_statuscode='OPEN'",
                         //赋值 
                         dbfinds:[{
-                            from:'id',to:'pu_vendid'
+                            from:'id',to:'pu_vendid',ignore:true
                         },{
                             from:'ve_code',to:'pu_vendcode'
                         },{

+ 1 - 0
frontend/saas-web/app/view/sale/sale/FormPanel.js

@@ -133,6 +133,7 @@ Ext.define('saas.view.sale.sale.FormPanel', {
                 text : "已转数", 
                 dataIndex : "sd_yqty", 
                 width : 120.0, 
+                hidden : true,
                 editor : {
                     xtype : "numberfield",
                     decimalPrecision: 2

+ 2 - 2
frontend/saas-web/app/view/sale/sale/QueryPanel.js

@@ -90,11 +90,11 @@ Ext.define('saas.view.sale.sale.QueryPanel', {
         }, {
             text: '客户编号',
             dataIndex: 'sa_custcode',
-            width: 120
+            width: 150
         }, {
             text: '客户名称',
             dataIndex: 'sa_custname',
-            width: 120
+            width: 180
         }, {
             text: '审核状态',
             dataIndex: 'sa_status',

+ 12 - 1
frontend/saas-web/app/view/sys/config/FormPanel.js

@@ -110,5 +110,16 @@ Ext.define('saas.view.sys.config.FormPanel', {
         allowBlank : true, 
         editable:false,
         columnWidth : 0.25
-    }]
+    }],
+
+    initComponent: function () {
+        var me = this,
+        viewModel = me.getViewModel();
+
+        viewModel.set('createTime', Ext.Date.format(new Date(), 'Y-m-d H:i:s'));
+        viewModel.set('updateTime', Ext.Date.format(new Date(), 'Y-m-d H:i:s'));
+        viewModel.setFormulas(o);
+        viewModel.set(statusCodeField, auditTexts.unAuditCode);
+        me.callParent(arguments);
+    }
 });