Quellcode durchsuchen

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

heqinwei vor 7 Jahren
Ursprung
Commit
bf3011fb1b
21 geänderte Dateien mit 80 neuen und 26 gelöschten Zeilen
  1. 2 2
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/config/WebConfig.java
  2. 0 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/BomController.java
  3. 0 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/CustomerController.java
  4. 2 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/CustomerkindController.java
  5. 0 4
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/WarehouseController.java
  6. 5 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/CustomerkindMapper.java
  7. 2 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/CustomerkindService.java
  8. 1 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/BomServiceImpl.java
  9. 27 2
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/CustomerkindServiceImpl.java
  10. 1 1
      applications/document/document-server/src/main/resources/mapper/AddressMapper.xml
  11. 4 1
      applications/document/document-server/src/main/resources/mapper/CustomerkindMapper.xml
  12. 2 1
      frontend/saas-web/app/view/core/form/RemoteCombo.js
  13. 1 1
      frontend/saas-web/app/view/core/view/BoundListAdd.js
  14. 5 0
      frontend/saas-web/app/view/document/bom/BasePanel.js
  15. 5 0
      frontend/saas-web/app/view/document/customer/BasePanel.js
  16. 3 2
      frontend/saas-web/app/view/document/customer/FormPanel.js
  17. 5 0
      frontend/saas-web/app/view/document/product/BasePanel.js
  18. 7 3
      frontend/saas-web/app/view/document/product/FormController.js
  19. 3 3
      frontend/saas-web/app/view/document/product/FormPanel.js
  20. 4 0
      frontend/saas-web/app/view/document/vendor/BasePanel.js
  21. 1 1
      frontend/saas-web/app/view/document/vendor/FormPanel.js

+ 2 - 2
applications/document/document-server/src/main/java/com/usoftchina/saas/document/config/WebConfig.java

@@ -15,8 +15,8 @@ import java.util.List;
 
 
 
 
 /**
 /**
- * @author: guq
- * @create: 2018-10-30 11:20
+ * @author: chenw
+ * @create: 2018-10-30 18:01
  **/
  **/
 
 
 @Configuration
 @Configuration

+ 0 - 1
applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/BomController.java

@@ -12,7 +12,6 @@ import org.springframework.web.bind.annotation.*;
 
 
 import javax.print.Doc;
 import javax.print.Doc;
 
 
-@CrossOrigin
 @RestController
 @RestController
 @RequestMapping("/bom")
 @RequestMapping("/bom")
 public class BomController {
 public class BomController {

+ 0 - 1
applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/CustomerController.java

@@ -16,7 +16,6 @@ import org.springframework.web.bind.annotation.*;
  * Created by zdw
  * Created by zdw
  * 2018-10-23 11:39.
  * 2018-10-23 11:39.
  */
  */
-@CrossOrigin
 @RestController
 @RestController
 @RequestMapping("/customer")
 @RequestMapping("/customer")
 public class CustomerController {
 public class CustomerController {

+ 2 - 1
applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/CustomerkindController.java

@@ -2,6 +2,7 @@ package com.usoftchina.saas.document.controller;
 
 
 
 
 import com.usoftchina.saas.base.Result;
 import com.usoftchina.saas.base.Result;
+import com.usoftchina.saas.commons.dto.ComboDTO;
 import com.usoftchina.saas.document.entities.Customerkind;
 import com.usoftchina.saas.document.entities.Customerkind;
 import com.usoftchina.saas.document.service.CustomerkindService;
 import com.usoftchina.saas.document.service.CustomerkindService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -36,7 +37,7 @@ public class CustomerkindController {
 
 
     @GetMapping("/getCombo")
     @GetMapping("/getCombo")
     public Result getCombo(){
     public Result getCombo(){
-        List<Customerkind> customerkindList = customerkindService.getCombo();
+        List<ComboDTO> customerkindList = customerkindService.getCombo();
         return Result.success(customerkindList);
         return Result.success(customerkindList);
     }
     }
 }
 }

+ 0 - 4
applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/WarehouseController.java

@@ -33,10 +33,6 @@ public class WarehouseController {
         return Result.success(listData);
         return Result.success(listData);
     }
     }
 
 
-
-
-
-
     /**
     /**
      * 过账
      * 过账
      * @return
      * @return

+ 5 - 1
applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/CustomerkindMapper.java

@@ -1,7 +1,9 @@
 package com.usoftchina.saas.document.mapper;
 package com.usoftchina.saas.document.mapper;
 
 
 import com.usoftchina.saas.base.mapper.CommonBaseMapper;
 import com.usoftchina.saas.base.mapper.CommonBaseMapper;
+import com.usoftchina.saas.commons.dto.ComboDTO;
 import com.usoftchina.saas.document.entities.Customerkind;
 import com.usoftchina.saas.document.entities.Customerkind;
+import org.apache.ibatis.annotations.Param;
 
 
 import java.util.List;
 import java.util.List;
 
 
@@ -18,5 +20,7 @@ public interface CustomerkindMapper extends CommonBaseMapper<Customerkind> {
 
 
     int updateByPrimaryKey(Customerkind record);
     int updateByPrimaryKey(Customerkind record);
 
 
-    List<Customerkind> getCombo();
+    List<ComboDTO> getCombo(@Param("companyId") Long companyId);
+
+    int selectCountByName(@Param("name") String name, @Param("companyId") Long companyId);
 }
 }

+ 2 - 1
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/CustomerkindService.java

@@ -1,6 +1,7 @@
 package com.usoftchina.saas.document.service;
 package com.usoftchina.saas.document.service;
 
 
 import com.usoftchina.saas.base.service.CommonBaseService;
 import com.usoftchina.saas.base.service.CommonBaseService;
+import com.usoftchina.saas.commons.dto.ComboDTO;
 import com.usoftchina.saas.document.entities.Customerkind;
 import com.usoftchina.saas.document.entities.Customerkind;
 import com.usoftchina.saas.document.mapper.CustomerkindMapper;
 import com.usoftchina.saas.document.mapper.CustomerkindMapper;
 
 
@@ -8,6 +9,6 @@ import java.util.List;
 
 
 public interface CustomerkindService extends CommonBaseService<CustomerkindMapper, Customerkind> {
 public interface CustomerkindService extends CommonBaseService<CustomerkindMapper, Customerkind> {
 
 
-    List<Customerkind> getCombo();
+    List<ComboDTO> getCombo();
 
 
 }
 }

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

@@ -101,6 +101,7 @@ public class BomServiceImpl extends CommonBaseServiceImpl<BomMapper, Bom> implem
                 }
                 }
             }
             }
             //记录LOG
             //记录LOG
+            docBaseDTO = generateMsgObj(bom.getId(), bom.getBo_mothercode());
             messageLogService.update(generateMsgObj(bom.getId(), bom.getBo_mothercode()));
             messageLogService.update(generateMsgObj(bom.getId(), bom.getBo_mothercode()));
         }
         }
         return docBaseDTO;
         return docBaseDTO;

+ 27 - 2
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/CustomerkindServiceImpl.java

@@ -2,14 +2,18 @@ package com.usoftchina.saas.document.service.impl;
 
 
 import com.usoftchina.saas.base.service.CommonBaseServiceImpl;
 import com.usoftchina.saas.base.service.CommonBaseServiceImpl;
 import com.usoftchina.saas.commons.api.MessageLogService;
 import com.usoftchina.saas.commons.api.MessageLogService;
+import com.usoftchina.saas.commons.dto.ComboDTO;
 import com.usoftchina.saas.commons.dto.DocBaseDTO;
 import com.usoftchina.saas.commons.dto.DocBaseDTO;
+import com.usoftchina.saas.commons.exception.BizExceptionCode;
 import com.usoftchina.saas.context.BaseContextHolder;
 import com.usoftchina.saas.context.BaseContextHolder;
 import com.usoftchina.saas.document.entities.Customerkind;
 import com.usoftchina.saas.document.entities.Customerkind;
 import com.usoftchina.saas.document.mapper.CustomerkindMapper;
 import com.usoftchina.saas.document.mapper.CustomerkindMapper;
 import com.usoftchina.saas.document.service.CustomerkindService;
 import com.usoftchina.saas.document.service.CustomerkindService;
+import com.usoftchina.saas.exception.BizException;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
+import java.util.Date;
 import java.util.List;
 import java.util.List;
 
 
 @Service
 @Service
@@ -29,10 +33,18 @@ public class CustomerkindServiceImpl extends CommonBaseServiceImpl<CustomerkindM
     public boolean save(Customerkind customerkind){
     public boolean save(Customerkind customerkind){
         if(customerkind.getId() == 0){
         if(customerkind.getId() == 0){
             customerkind.setCompanyId(BaseContextHolder.getCompanyId());
             customerkind.setCompanyId(BaseContextHolder.getCompanyId());
+            customerkind.setCreateTime(new Date());
+            customerkind.setCreatorId(BaseContextHolder.getUserId());
+            //验证名称是否重复
+            validName(customerkind.getCk_name());
             customerkindMapper.insertSelective(customerkind);
             customerkindMapper.insertSelective(customerkind);
             //记录LOG
             //记录LOG
             messageLogService.save(generateMsgObj(customerkind.getId()));
             messageLogService.save(generateMsgObj(customerkind.getId()));
         }else{
         }else{
+            customerkind.setUpdaterId(BaseContextHolder.getUserId());
+            customerkind.setUpdateTime(new Date());
+            //验证名称是否重复
+            validName(customerkind.getCk_name());
             customerkindMapper.updateByPrimaryKeySelective(customerkind);
             customerkindMapper.updateByPrimaryKeySelective(customerkind);
             //记录LOG
             //记录LOG
             messageLogService.update(generateMsgObj(customerkind.getId()));
             messageLogService.update(generateMsgObj(customerkind.getId()));
@@ -64,8 +76,21 @@ public class CustomerkindServiceImpl extends CommonBaseServiceImpl<CustomerkindM
     }
     }
 
 
     @Override
     @Override
-    public List<Customerkind> getCombo() {
-        List<Customerkind> customerkindList = getMapper().getCombo();
+    public List<ComboDTO> getCombo() {
+        List<ComboDTO> customerkindList = getMapper().getCombo(BaseContextHolder.getCompanyId());
         return customerkindList;
         return customerkindList;
     }
     }
+
+    /**
+     * 校验
+     * @param name
+     * @return
+     */
+    private boolean validName(String name){
+        int count = getMapper().selectCountByName(name, BaseContextHolder.getCompanyId());
+        if (count > 0){
+            throw new BizException(BizExceptionCode.REPEAT_NAME);
+        }
+        return true;
+    }
 }
 }

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

@@ -182,7 +182,7 @@
     SELECT * FROM ADDRESS
     SELECT * FROM ADDRESS
   </select>
   </select>
   <select id="selectCountByName" resultType="int">
   <select id="selectCountByName" resultType="int">
-    SELECT * FROM ADDRESS WHERE AD_ADDRESS=#{name} ADN COMPANYID=#{companyId}
+    SELECT * FROM ADDRESS WHERE AD_ADDRESS=#{name} AND COMPANYID=#{companyId}
   </select>
   </select>
     <select id="getCombo" resultType="com.usoftchina.saas.commons.dto.ComboDTO">
     <select id="getCombo" resultType="com.usoftchina.saas.commons.dto.ComboDTO">
         SELECT AD_ADDRESS display,AD_ADDRESS value FROM ADDRESS WHERE COMPANYID=#{companyId}
         SELECT AD_ADDRESS display,AD_ADDRESS value FROM ADDRESS WHERE COMPANYID=#{companyId}

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

@@ -123,6 +123,9 @@
     SELECT * FROM CUSTOMERKIND
     SELECT * FROM CUSTOMERKIND
   </select>
   </select>
   <select id="getCombo" resultType="com.usoftchina.saas.commons.dto.ComboDTO">
   <select id="getCombo" resultType="com.usoftchina.saas.commons.dto.ComboDTO">
-    SELECT ck_name display,ck_name value FROM CUSTOMERKIND
+    SELECT ck_name display,ck_name value FROM CUSTOMERKIND WHERE COMPANYID=#{companyId}
   </select>
   </select>
+    <select id="selectCountByName" resultType="int">
+        SELECT * FROM CUSTOMERKIND WHERE CK_NAME=#{name} AND COMPANYID=#{companyId}
+    </select>
 </mapper>
 </mapper>

+ 2 - 1
frontend/saas-web/app/view/core/form/RemoteCombo.js

@@ -36,7 +36,8 @@ Ext.define('saas.view.core.form.RemoteCombo', {
         var me = this,
         var me = this,
             picker,
             picker,
             pickerCfg = Ext.apply({
             pickerCfg = Ext.apply({
-                height: 180,
+                maxHeight: 180,
+                minHeight: 0,
                 hiddenBtn:me.hiddenBtn,
                 hiddenBtn:me.hiddenBtn,
                 xtype: 'boundlistadd',
                 xtype: 'boundlistadd',
                 id: me.id + '-picker',
                 id: me.id + '-picker',

+ 1 - 1
frontend/saas-web/app/view/core/view/BoundListAdd.js

@@ -255,7 +255,7 @@ Ext.define('saas.view.core.view.BoundListAdd', {
             id: me.id + '-toolbar',
             id: me.id + '-toolbar',
             border: true,
             border: true,
             ownerCt: me,
             ownerCt: me,
-            height:me.hiddenBtn?0:50,
+            hidden:me.hiddenBtn,
             items:[{
             items:[{
                 text:'新增',
                 text:'新增',
                 handler:me.addHandler,
                 handler:me.addHandler,

+ 5 - 0
frontend/saas-web/app/view/document/bom/BasePanel.js

@@ -10,6 +10,7 @@ Ext.define('saas.view.document.bom.BasePanel', {
     //字段属性
     //字段属性
     _formXtype:'document-bom-formpanel',
     _formXtype:'document-bom-formpanel',
     _title:'BOM资料',
     _title:'BOM资料',
+    _deleteUrl:'/api/document/bom/delete/',
     // _dataUrl:'/api/ducument/customer/list',
     // _dataUrl:'/api/ducument/customer/list',
     _batchOpenUrl:'/api/document/bom/batchOpen',
     _batchOpenUrl:'/api/document/bom/batchOpen',
     _batchCloseUrl:'/api/document/bom/batchClose',
     _batchCloseUrl:'/api/document/bom/batchClose',
@@ -57,4 +58,8 @@ Ext.define('saas.view.document.bom.BasePanel', {
         }]
         }]
     },
     },
 
 
+    refresh:function(){
+        this.items.items[0].store.load()
+    }
+
 });
 });

+ 5 - 0
frontend/saas-web/app/view/document/customer/BasePanel.js

@@ -18,6 +18,7 @@ Ext.define('saas.view.document.customer.BasePanel', {
     //字段属性
     //字段属性
     _formXtype:'document-customer-formpanel',
     _formXtype:'document-customer-formpanel',
     _title:'客户资料',
     _title:'客户资料',
+    _deleteUrl:'/api/document/customer/delete/',
     // _dataUrl:'/api/ducument/customer/list',
     // _dataUrl:'/api/ducument/customer/list',
     _batchOpenUrl:'/api/document/customer/batchOpen',
     _batchOpenUrl:'/api/document/customer/batchOpen',
     _batchCloseUrl:'/api/document/customer/batchClose',
     _batchCloseUrl:'/api/document/customer/batchClose',
@@ -75,4 +76,8 @@ Ext.define('saas.view.document.customer.BasePanel', {
         }]
         }]
     },
     },
 
 
+    refresh:function(){
+        this.items.items[0].store.load()
+    }
+
 });
 });

+ 3 - 2
frontend/saas-web/app/view/document/customer/FormPanel.js

@@ -51,6 +51,7 @@ Ext.define('saas.view.document.customer.FormPanel', {
         allowBlank: true,
         allowBlank: true,
         columnWidth: 0.25
         columnWidth: 0.25
     },{
     },{
+        editable:false,
         xtype : "remotecombo", 
         xtype : "remotecombo", 
         storeUrl:'/api/document/customerkind/getCombo',
         storeUrl:'/api/document/customerkind/getCombo',
         name : "cu_type", 
         name : "cu_type", 
@@ -199,7 +200,7 @@ Ext.define('saas.view.document.customer.FormPanel', {
             {
             {
                 editor : {
                 editor : {
                     displayField : "display", 
                     displayField : "display", 
-                    editable : true, 
+                    editable:false,
                     format : "", 
                     format : "", 
                     hideTrigger : false, 
                     hideTrigger : false, 
                     maxLength : 100.0, 
                     maxLength : 100.0, 
@@ -280,8 +281,8 @@ Ext.define('saas.view.document.customer.FormPanel', {
             },
             },
             {
             {
                 editor : {
                 editor : {
+                    editable:false,
                     displayField : "display", 
                     displayField : "display", 
-                    editable : true, 
                     format : "", 
                     format : "", 
                     hideTrigger : false, 
                     hideTrigger : false, 
                     maxLength : 100.0, 
                     maxLength : 100.0, 

+ 5 - 0
frontend/saas-web/app/view/document/product/BasePanel.js

@@ -17,6 +17,7 @@ Ext.define('saas.view.document.product.BasePanel', {
     //字段属性
     //字段属性
     _formXtype:'document-product-formpanel',
     _formXtype:'document-product-formpanel',
     _title:'物料资料',
     _title:'物料资料',
+    _deleteUrl:'/api/document/product/delete/',
     // _dataUrl:'http://192.168.253.31:9480/product/list',
     // _dataUrl:'http://192.168.253.31:9480/product/list',
     _batchOpenUrl:'/api/document/product/batchOpen',
     _batchOpenUrl:'/api/document/product/batchOpen',
     _batchCloseUrl:'/api/document/product/batchClose',
     _batchCloseUrl:'/api/document/product/batchClose',
@@ -64,4 +65,8 @@ Ext.define('saas.view.document.product.BasePanel', {
         }]
         }]
     },
     },
 
 
+    refresh:function(){
+        this.items.items[0].store.load()
+    }
+
 });
 });

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

@@ -27,7 +27,7 @@ Ext.define('saas.view.document.product.FormController', {
                             field:'ve_name',width:100
                             field:'ve_name',width:100
                         }],
                         }],
                         //联想查询条件
                         //联想查询条件
-                        btplfield:"ve_name",
+                        dbtplfield:"ve_name",
                         //放大镜窗口字段
                         //放大镜窗口字段
                         dbSearchFields:[{
                         dbSearchFields:[{
                             xtype : "textfield", 
                             xtype : "textfield", 
@@ -70,15 +70,19 @@ Ext.define('saas.view.document.product.FormController', {
                 beforerender:function(f){
                 beforerender:function(f){
                     Ext.apply(f,{
                     Ext.apply(f,{
                         //数据接口
                         //数据接口
-                        dataUrl:'/api/document/product/getWareHouseByCondition',
+                        dataUrl:'/api/document/warehouse/list',
                         //放大镜赋值设置
                         //放大镜赋值设置
                         dbfinds:[{
                         dbfinds:[{
                             from:'wh_code',to:'pr_whcode'
                             from:'wh_code',to:'pr_whcode'
                         },{
                         },{
                             from:'wh_description',to:'pr_whname'
                             from:'wh_description',to:'pr_whname'
                         }],
                         }],
+                        //新增地址
+                        addXtype:'other-warehouse',
+                        //新增标题
+                        addTitle:'仓库资料', 
                         //联想查询条件
                         //联想查询条件
-                        dbCondition:"CONCAT(wh_code, wh_description) like '{0}%'",
+                        dbtplfield:"pr_whcode",
                         //联想设置
                         //联想设置
                         dbtpls:[{
                         dbtpls:[{
                             field:'wh_code',width:100
                             field:'wh_code',width:100

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

@@ -66,8 +66,8 @@ Ext.define('saas.view.document.product.FormPanel', {
                 bind: {
                 bind: {
                     title: '新增供应商类型'
                     title: '新增供应商类型'
                 },
                 },
-                dataKind:'producttype',
-                belong:document.etc['producttype'],
+                dataKind:'productkind',
+                belong:document.etc['productkind'],
                 _parent:form,
                 _parent:form,
                 _combo:this.ownerCmp,
                 _combo:this.ownerCmp,
                 record:null,
                 record:null,
@@ -115,7 +115,7 @@ Ext.define('saas.view.document.product.FormPanel', {
             this.dialog = form.getController().getView().add({
             this.dialog = form.getController().getView().add({
                 xtype: 'document-kind-childwin',
                 xtype: 'document-kind-childwin',
                 bind: {
                 bind: {
-                    title: '新增物料单位'
+                    title: '新增物料品牌'
                 },
                 },
                 dataKind:'productbrand',
                 dataKind:'productbrand',
                 belong:document.etc['productbrand'],
                 belong:document.etc['productbrand'],

+ 4 - 0
frontend/saas-web/app/view/document/vendor/BasePanel.js

@@ -76,4 +76,8 @@ Ext.define('saas.view.document.vendor.BasePanel', {
             xtype : "",
             xtype : "",
         }]
         }]
     },
     },
+
+    refresh:function(){
+        this.items.items[0].store.load()
+    }
 });
 });

+ 1 - 1
frontend/saas-web/app/view/document/vendor/FormPanel.js

@@ -194,7 +194,7 @@ Ext.define('saas.view.document.vendor.FormPanel', {
             {
             {
                 editor : {
                 editor : {
                     displayField : "display", 
                     displayField : "display", 
-                    editable : true, 
+                    editable:false,
                     format : "", 
                     format : "", 
                     hideTrigger : false, 
                     hideTrigger : false, 
                     maxLength : 100.0, 
                     maxLength : 100.0,