Эх сурвалжийг харах

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

rainco 7 жил өмнө
parent
commit
a89e3a205c
100 өөрчлөгдсөн 1387 нэмэгдсэн , 551 устгасан
  1. 52 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/config/WebConfig.java
  2. 5 2
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/BankinformationController.java
  3. 0 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/BomController.java
  4. 0 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/CustomerController.java
  5. 2 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/CustomerkindController.java
  6. 0 4
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/WarehouseController.java
  7. 6 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/BankinformationMapper.java
  8. 5 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/CustomerkindMapper.java
  9. 8 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/BankinformationService.java
  10. 2 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/CustomerkindService.java
  11. 37 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/BankinformationServiceImpl.java
  12. 1 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/BomServiceImpl.java
  13. 1 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/CustomerServiceImpl.java
  14. 27 2
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/CustomerkindServiceImpl.java
  15. 1 1
      applications/document/document-server/src/main/resources/mapper/AddressMapper.xml
  16. 14 0
      applications/document/document-server/src/main/resources/mapper/BankinformationMapper.xml
  17. 4 1
      applications/document/document-server/src/main/resources/mapper/CustomerkindMapper.xml
  18. 52 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/config/WebConfig.java
  19. 3 1
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/PaybalanceServiceImpl.java
  20. 1 1
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/RecbalanceServiceImpl.java
  21. 1 1
      applications/money/money-server/src/main/resources/mapper/RecbalancedetailMapper.xml
  22. 5 4
      applications/purchase/purchase-dto/src/main/java/com/usoftchina/saas/purchase/dto/PurchaseDetailDTO.java
  23. 2 0
      applications/purchase/purchase-dto/src/main/java/com/usoftchina/saas/purchase/dto/PurchaseListDTO.java
  24. 52 0
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/config/WebConfig.java
  25. 1 2
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/controller/ProdInOutController.java
  26. 3 3
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/controller/PurchaseController.java
  27. 4 3
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/po/PurchaseDetail.java
  28. 3 0
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/po/PurchaseList.java
  29. 5 1
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/impl/ProdInOutServiceImpl.java
  30. 6 1
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/impl/PurchaseServiceImpl.java
  31. 16 4
      applications/purchase/purchase-server/src/main/resources/mapper/PurchasedetailMapper.xml
  32. 4 0
      applications/sale/sale-dto/src/main/java/com/usoftchina/saas/sale/dto/SaleDTO.java
  33. 1 1
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/controller/SaleController.java
  34. 1 1
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/po/Sale.java
  35. 6 2
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/service/impl/SaleServiceImpl.java
  36. 52 0
      applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/config/WebConfig.java
  37. 2 2
      base-servers/account/account-api/src/main/java/com/usoftchina/saas/account/api/AccountApi.java
  38. 10 2
      base-servers/account/account-dto/src/main/java/com/usoftchina/saas/account/dto/AccountDTO.java
  39. 2 1
      base-servers/account/account-server/src/main/resources/application.yml
  40. 12 0
      base-servers/account/account-server/src/main/resources/config/application-docker-dev.yml
  41. 6 0
      base-servers/account/account-server/src/main/resources/logback-spring.xml
  42. 13 2
      base-servers/auth/auth-api/src/main/java/com/usoftchina/saas/auth/api/AuthApi.java
  43. 0 23
      base-servers/auth/auth-api/src/main/java/com/usoftchina/saas/auth/api/TokenApi.java
  44. 10 7
      base-servers/auth/auth-api/src/main/java/com/usoftchina/saas/auth/cache/TokenCache.java
  45. 4 0
      base-servers/auth/auth-dto/pom.xml
  46. 47 0
      base-servers/auth/auth-dto/src/main/java/com/usoftchina/saas/auth/dto/AuthDTO.java
  47. 9 0
      base-servers/auth/auth-server/pom.xml
  48. 58 5
      base-servers/auth/auth-server/src/main/java/com/usoftchina/saas/auth/controller/AuthController.java
  49. 29 7
      base-servers/auth/auth-server/src/main/resources/application.yml
  50. BIN
      base-servers/auth/auth-server/src/main/resources/auth/pub.key
  51. 12 0
      base-servers/auth/auth-server/src/main/resources/config/application-docker-dev.yml
  52. 10 0
      base-servers/auth/auth-server/src/main/resources/config/application-docker.yml
  53. 6 0
      base-servers/auth/auth-server/src/main/resources/logback-spring.xml
  54. 0 4
      base-servers/auth/auth-server/src/main/resources/mapper/AccountMapper.xml
  55. 0 4
      base-servers/auth/auth-server/src/main/resources/mapper/AccountRoleMapper.xml
  56. 0 4
      base-servers/auth/auth-server/src/main/resources/mapper/ResourcesMapper.xml
  57. 0 4
      base-servers/auth/auth-server/src/main/resources/mapper/RoleMapper.xml
  58. 0 4
      base-servers/auth/auth-server/src/main/resources/mapper/RoleResourceMapper.xml
  59. 38 0
      base-servers/gateway-server/src/main/java/com/usoftchina/saas/gateway/config/AuthFilter.java
  60. 2 3
      base-servers/gateway-server/src/main/resources/application.yml
  61. 1 0
      framework/core/src/main/java/com/usoftchina/saas/exception/ExceptionCode.java
  62. 2 1
      frontend/saas-web/app/model/document/productDTO.js
  63. 2 4
      frontend/saas-web/app/model/purchase/prodIODetail.js
  64. 1 1
      frontend/saas-web/app/model/purchase/purchasedetail.js
  65. 23 5
      frontend/saas-web/app/util/FormUtil.js
  66. 23 7
      frontend/saas-web/app/view/core/form/FormPanel.js
  67. 2 44
      frontend/saas-web/app/view/core/form/FormPanelController.js
  68. 5 0
      frontend/saas-web/app/view/core/form/RemoteCombo.js
  69. 43 0
      frontend/saas-web/app/view/core/form/field/DetailGridField.js
  70. 1 0
      frontend/saas-web/app/view/core/view/BoundListAdd.js
  71. 5 0
      frontend/saas-web/app/view/document/bom/BasePanel.js
  72. 2 2
      frontend/saas-web/app/view/document/bom/FormPanel.js
  73. 13 28
      frontend/saas-web/app/view/document/customer/BasePanel.js
  74. 17 24
      frontend/saas-web/app/view/document/customer/FormPanel.js
  75. 15 0
      frontend/saas-web/app/view/document/kind/ChildForm.js
  76. 14 1
      frontend/saas-web/app/view/document/kind/Kind.js
  77. 100 9
      frontend/saas-web/app/view/document/kind/KindModel.js
  78. 25 0
      frontend/saas-web/app/view/document/other/ProductUnit.js
  79. 8 29
      frontend/saas-web/app/view/document/product/BasePanel.js
  80. 7 3
      frontend/saas-web/app/view/document/product/FormController.js
  81. 24 49
      frontend/saas-web/app/view/document/product/FormPanel.js
  82. 12 27
      frontend/saas-web/app/view/document/vendor/BasePanel.js
  83. 18 26
      frontend/saas-web/app/view/document/vendor/FormPanel.js
  84. 19 13
      frontend/saas-web/app/view/money/fundtransfer/FormPanel.js
  85. 32 6
      frontend/saas-web/app/view/money/fundtransfer/FormPanelController.js
  86. 1 1
      frontend/saas-web/app/view/money/fundtransfer/QueryPanel.js
  87. 6 19
      frontend/saas-web/app/view/money/othreceipts/FormPanel.js
  88. 80 28
      frontend/saas-web/app/view/money/othreceipts/FormPanelController.js
  89. 80 28
      frontend/saas-web/app/view/money/othreceipts/QueryPanelController.js
  90. 6 19
      frontend/saas-web/app/view/money/othspendings/FormPanel.js
  91. 49 18
      frontend/saas-web/app/view/money/othspendings/FormPanelController.js
  92. 1 1
      frontend/saas-web/app/view/money/othspendings/QueryPanel.js
  93. 45 14
      frontend/saas-web/app/view/money/othspendings/QueryPanelController.js
  94. 1 5
      frontend/saas-web/app/view/money/payBalance/FormPanel.js
  95. 0 4
      frontend/saas-web/app/view/money/recBalance/FormPanel.js
  96. 9 6
      frontend/saas-web/app/view/purchase/purchase/FormPanel.js
  97. 9 3
      frontend/saas-web/app/view/purchase/purchase/FormPanelController.js
  98. 26 12
      frontend/saas-web/app/view/purchase/purchaseIn/FormPanel.js
  99. 6 0
      frontend/saas-web/app/view/purchase/purchaseIn/FormPanelController.js
  100. 1 1
      frontend/saas-web/app/view/purchase/purchaseOut/FormPanel.js

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

@@ -0,0 +1,52 @@
+package com.usoftchina.saas.document.config;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.http.converter.HttpMessageConverter;
+import org.springframework.http.converter.StringHttpMessageConverter;
+import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
+import org.springframework.web.servlet.config.annotation.ContentNegotiationConfigurer;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
+
+import java.nio.charset.Charset;
+import java.text.SimpleDateFormat;
+import java.util.List;
+
+
+/**
+ * @author: chenw
+ * @create: 2018-10-30 18:01
+ **/
+
+@Configuration
+public class WebConfig extends WebMvcConfigurationSupport{
+    @Bean
+    public HttpMessageConverter<String> responseBodyConverter() {
+        StringHttpMessageConverter converter = new StringHttpMessageConverter(Charset.forName("UTF-8"));
+        return converter;
+    }
+
+    @Bean
+    public MappingJackson2HttpMessageConverter MappingJacksonHttpMessageConverter(){
+        MappingJackson2HttpMessageConverter converter = new MappingJackson2HttpMessageConverter();
+        ObjectMapper objectMapper = new ObjectMapper();
+        objectMapper.setDateFormat(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"));
+        converter.setObjectMapper(objectMapper);
+        return converter;
+    }
+
+    @Override
+    public void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
+        super.configureMessageConverters(converters);
+        converters.add(responseBodyConverter());
+        converters.add(MappingJacksonHttpMessageConverter());
+    }
+
+    @Override
+    public void configureContentNegotiation(ContentNegotiationConfigurer configurer) {
+        configurer.favorPathExtension(false);
+    }
+
+}
+

+ 5 - 2
applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/BankinformationController.java

@@ -1,8 +1,11 @@
 package com.usoftchina.saas.document.controller;
 
+import com.github.pagehelper.PageInfo;
 import com.usoftchina.saas.base.Result;
+import com.usoftchina.saas.commons.dto.ListReqDTO;
 import com.usoftchina.saas.document.entities.Bankinformation;
 import com.usoftchina.saas.document.service.BankinformationService;
+import com.usoftchina.saas.page.PageRequest;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
@@ -31,8 +34,8 @@ public class BankinformationController {
     }
 
     @GetMapping("/list")
-    public Result getAll(){
-        List<Bankinformation> bankinformationList = bankinformationService.findAll();
+    public Result getAll(PageRequest page, ListReqDTO condition){
+        PageInfo<Bankinformation> bankinformationList = bankinformationService.selectList(page, condition);
         return Result.success(bankinformationList);
     }
 }

+ 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;
 
-@CrossOrigin
 @RestController
 @RequestMapping("/bom")
 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
  * 2018-10-23 11:39.
  */
-@CrossOrigin
 @RestController
 @RequestMapping("/customer")
 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.commons.dto.ComboDTO;
 import com.usoftchina.saas.document.entities.Customerkind;
 import com.usoftchina.saas.document.service.CustomerkindService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -36,7 +37,7 @@ public class CustomerkindController {
 
     @GetMapping("/getCombo")
     public Result getCombo(){
-        List<Customerkind> customerkindList = customerkindService.getCombo();
+        List<ComboDTO> customerkindList = customerkindService.getCombo();
         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

+ 6 - 1
applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/BankinformationMapper.java

@@ -2,11 +2,14 @@ package com.usoftchina.saas.document.mapper;
 
 import com.usoftchina.saas.base.mapper.CommonBaseMapper;
 import com.usoftchina.saas.document.entities.Bankinformation;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 public interface BankinformationMapper extends CommonBaseMapper<Bankinformation> {
     int deleteByPrimaryKey(Integer bkId);
 
-    int insert(Bankinformation record);
+//    int insert(Bankinformation record);
 
     int insertSelective(Bankinformation record);
 
@@ -17,4 +20,6 @@ public interface BankinformationMapper extends CommonBaseMapper<Bankinformation>
     int updateByPrimaryKeyWithBLOBs(Bankinformation record);
 
     int updateByPrimaryKey(Bankinformation record);
+
+    List<Bankinformation> selectBankinformationBycondition(@Param("con") String con, @Param("companyId") Long companyId);
 }

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

+ 8 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/BankinformationService.java

@@ -1,8 +1,14 @@
 package com.usoftchina.saas.document.service;
 
+import com.github.pagehelper.PageInfo;
 import com.usoftchina.saas.base.service.CommonBaseService;
+import com.usoftchina.saas.commons.dto.ListReqDTO;
 import com.usoftchina.saas.document.entities.Bankinformation;
 import com.usoftchina.saas.document.mapper.BankinformationMapper;
+import com.usoftchina.saas.page.PageRequest;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 /**
  * @author heqw
@@ -13,5 +19,7 @@ public interface BankinformationService extends CommonBaseService<Bankinformatio
 
     boolean removeByPrimaryKey(int id);
 
+    PageInfo<Bankinformation> selectList(PageRequest page, ListReqDTO condition);
+
 
 }

+ 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;
 
 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.mapper.CustomerkindMapper;
 
@@ -8,6 +9,6 @@ import java.util.List;
 
 public interface CustomerkindService extends CommonBaseService<CustomerkindMapper, Customerkind> {
 
-    List<Customerkind> getCombo();
+    List<ComboDTO> getCombo();
 
 }

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

@@ -1,11 +1,19 @@
 package com.usoftchina.saas.document.service.impl;
 
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
 import com.usoftchina.saas.base.service.CommonBaseServiceImpl;
+import com.usoftchina.saas.commons.dto.ListReqDTO;
+import com.usoftchina.saas.context.BaseContextHolder;
 import com.usoftchina.saas.document.entities.Bankinformation;
 import com.usoftchina.saas.document.mapper.BankinformationMapper;
 import com.usoftchina.saas.document.service.BankinformationService;
+import com.usoftchina.saas.page.PageRequest;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.util.StringUtils;
+
+import java.util.List;
 
 /**
  * @author heqw
@@ -31,4 +39,33 @@ public class BankinformationServiceImpl extends CommonBaseServiceImpl<Bankinform
         bankinformationMapper.deleteByPrimaryKey(id);
         return true;
     }
+
+    @Override
+    public PageInfo<Bankinformation> selectList(PageRequest page, ListReqDTO condition) {
+        //设置默认分页
+        if (null == page || page.getSize() == 0 || page.getNumber() == 0) {
+            page = new PageRequest();
+            page.setNumber(1);
+            page.setSize(10);
+        }
+        PageHelper.startPage(page.getNumber(), page.getSize());
+        List<Bankinformation> recbalancesList = this.getListByMode(condition);
+        //取分页信息
+        PageInfo<Bankinformation> pageInfo = new PageInfo<Bankinformation>(recbalancesList);
+        return pageInfo;
+    }
+
+    private List<Bankinformation> getListByMode(ListReqDTO req) {
+        List<Bankinformation> recbalancesList = null;
+        Long companyId = BaseContextHolder.getCompanyId();
+        if (StringUtils.isEmpty(req)) {
+            return  null;
+        }
+        String con = req.getFinalCondition();
+        if (null == con) {
+            con = "1=1";
+        }
+        recbalancesList = bankinformationMapper.selectBankinformationBycondition(con, companyId);
+        return recbalancesList;
+    }
 }

+ 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
+            docBaseDTO = generateMsgObj(bom.getId(), bom.getBo_mothercode());
             messageLogService.update(generateMsgObj(bom.getId(), bom.getBo_mothercode()));
         }
         return docBaseDTO;

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

@@ -154,6 +154,7 @@ public class CustomerServiceImpl extends CommonBaseServiceImpl<CustomerMapper, C
                 detail2.setCompanyId(companyId);
                 detail2.setCreatorId(userId);
                 detail2.setCreateTime(new Date());
+                insertDetail2.add(detail2);
             }
             //插入从表
             if (insertDetail2.size()>0) {

+ 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.commons.api.MessageLogService;
+import com.usoftchina.saas.commons.dto.ComboDTO;
 import com.usoftchina.saas.commons.dto.DocBaseDTO;
+import com.usoftchina.saas.commons.exception.BizExceptionCode;
 import com.usoftchina.saas.context.BaseContextHolder;
 import com.usoftchina.saas.document.entities.Customerkind;
 import com.usoftchina.saas.document.mapper.CustomerkindMapper;
 import com.usoftchina.saas.document.service.CustomerkindService;
+import com.usoftchina.saas.exception.BizException;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.Date;
 import java.util.List;
 
 @Service
@@ -29,10 +33,18 @@ public class CustomerkindServiceImpl extends CommonBaseServiceImpl<CustomerkindM
     public boolean save(Customerkind customerkind){
         if(customerkind.getId() == 0){
             customerkind.setCompanyId(BaseContextHolder.getCompanyId());
+            customerkind.setCreateTime(new Date());
+            customerkind.setCreatorId(BaseContextHolder.getUserId());
+            //验证名称是否重复
+            validName(customerkind.getCk_name());
             customerkindMapper.insertSelective(customerkind);
             //记录LOG
             messageLogService.save(generateMsgObj(customerkind.getId()));
         }else{
+            customerkind.setUpdaterId(BaseContextHolder.getUserId());
+            customerkind.setUpdateTime(new Date());
+            //验证名称是否重复
+            validName(customerkind.getCk_name());
             customerkindMapper.updateByPrimaryKeySelective(customerkind);
             //记录LOG
             messageLogService.update(generateMsgObj(customerkind.getId()));
@@ -64,8 +76,21 @@ public class CustomerkindServiceImpl extends CommonBaseServiceImpl<CustomerkindM
     }
 
     @Override
-    public List<Customerkind> getCombo() {
-        List<Customerkind> customerkindList = getMapper().getCombo();
+    public List<ComboDTO> getCombo() {
+        List<ComboDTO> customerkindList = getMapper().getCombo(BaseContextHolder.getCompanyId());
         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>
   <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 id="getCombo" resultType="com.usoftchina.saas.commons.dto.ComboDTO">
         SELECT AD_ADDRESS display,AD_ADDRESS value FROM ADDRESS WHERE COMPANYID=#{companyId}

+ 14 - 0
applications/document/document-server/src/main/resources/mapper/BankinformationMapper.xml

@@ -320,4 +320,18 @@
   <select id="selectAll" resultMap="BaseResultMap">
     SELECT * FROM bankinformation
   </select>
+
+  <select id="selectBankinformationBycondition" resultMap="BaseResultMap">
+    select
+    <include refid="Base_Column_List" />
+    from bankinformation
+    <where>
+      <if test="con != null">
+        ${con}
+      </if>
+      <if test="companyId != null">
+        and   bankinformation.companyId = #{companyId}
+      </if>
+    </where>  order by bk_id
+  </select>
 </mapper>

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

@@ -123,6 +123,9 @@
     SELECT * FROM CUSTOMERKIND
   </select>
   <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 id="selectCountByName" resultType="int">
+        SELECT * FROM CUSTOMERKIND WHERE CK_NAME=#{name} AND COMPANYID=#{companyId}
+    </select>
 </mapper>

+ 52 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/config/WebConfig.java

@@ -0,0 +1,52 @@
+package com.usoftchina.saas.money.config;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.http.converter.HttpMessageConverter;
+import org.springframework.http.converter.StringHttpMessageConverter;
+import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
+import org.springframework.web.servlet.config.annotation.ContentNegotiationConfigurer;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
+
+import java.nio.charset.Charset;
+import java.text.SimpleDateFormat;
+import java.util.List;
+
+
+/**
+ * @author: guq
+ * @create: 2018-10-30 11:20
+ **/
+
+@Configuration
+public class WebConfig extends WebMvcConfigurationSupport{
+    @Bean
+    public HttpMessageConverter<String> responseBodyConverter() {
+        StringHttpMessageConverter converter = new StringHttpMessageConverter(Charset.forName("UTF-8"));
+        return converter;
+    }
+
+    @Bean
+    public MappingJackson2HttpMessageConverter MappingJacksonHttpMessageConverter(){
+        MappingJackson2HttpMessageConverter converter = new MappingJackson2HttpMessageConverter();
+        ObjectMapper objectMapper = new ObjectMapper();
+        objectMapper.setDateFormat(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"));
+        converter.setObjectMapper(objectMapper);
+        return converter;
+    }
+
+    @Override
+    public void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
+        super.configureMessageConverters(converters);
+        converters.add(responseBodyConverter());
+        converters.add(MappingJacksonHttpMessageConverter());
+    }
+
+    @Override
+    public void configureContentNegotiation(ContentNegotiationConfigurer configurer) {
+        configurer.favorPathExtension(false);
+    }
+
+}
+

+ 3 - 1
applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/PaybalanceServiceImpl.java

@@ -51,6 +51,8 @@ public class PaybalanceServiceImpl implements PaybalanceService {
         //单号赋值
         paybalance.setPb_code(pb_code);
 
+        System.out.println("code:"+paybalance.getPb_code());
+
         Long rbId = paybalance.getId();
 
         if (paybalance.getId() > 0){
@@ -197,7 +199,7 @@ public class PaybalanceServiceImpl implements PaybalanceService {
         Long companyId = BaseContextHolder.getCompanyId();
         Integer count = "0".equals(String.valueOf(id)) ? paybalanceMapper.validateCodeWhenInsert(code, companyId) :
                 paybalanceMapper.validateCodeWhenUpdate(code, id, companyId);
-        return maxnumberService.pushMaxnubmer(count, code, BillCodeSeq.RECBALANCE.getCaller()).getData();
+        return maxnumberService.pushMaxnubmer(count, code, BillCodeSeq.PAYBALANCE.getCaller()).getData();
     }
 
     private List<Paybalance> getListByMode(ListReqDTO req) {

+ 1 - 1
applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/RecbalanceServiceImpl.java

@@ -70,7 +70,7 @@ public class RecbalanceServiceImpl implements RecbalanceService {
             recbalancedet1.setRd_rbid(Math.toIntExact(rbId));
             recbalancedet1.setCompanyId(BaseContextHolder.getCompanyId());
             if (recbalancedet1.getId() > 0 ){
-                recbalancedetMapper.updateByPrimaryKey(recbalancedet1);
+                recbalancedetMapper.updateByPrimaryKeySelective(recbalancedet1);
             }else {
                 recbalancedetMapper.insertSelective(recbalancedet1);
             }

+ 1 - 1
applications/money/money-server/src/main/resources/mapper/RecbalancedetailMapper.xml

@@ -31,7 +31,7 @@
     select 
     <include refid="Base_Column_List" />
     from recbalancedetail
-    where rd_rbid = #{id,jdbcType=INTEGER}
+    where rbd_rbid = #{id,jdbcType=INTEGER}
   </select>
   <delete id="deleteItem" parameterType="java.lang.Integer" >
     delete from recbalancedetail

+ 5 - 4
applications/purchase/purchase-dto/src/main/java/com/usoftchina/saas/purchase/dto/PurchaseDetailDTO.java

@@ -1,11 +1,10 @@
 package com.usoftchina.saas.purchase.dto;
 
 import com.usoftchina.saas.base.dto.CommonBaseDTO;
-import com.usoftchina.saas.document.entities.Product;
+import com.usoftchina.saas.document.dto.ProductDTO;
 import lombok.Data;
 
 import java.io.Serializable;
-import java.util.Date;
 
 /**
  * @author yingp
@@ -20,7 +19,7 @@ public class PurchaseDetailDTO extends CommonBaseDTO implements Serializable{
 
     private Integer pd_detno;
 
-    private Integer pd_prodid;
+    private Long pd_prodid;
 
     private String pd_prodcode;
 
@@ -32,6 +31,8 @@ public class PurchaseDetailDTO extends CommonBaseDTO implements Serializable{
 
     private Double pd_total;
 
+    private Double pd_taxrate;
+
     private Double pd_taxtotal;
 
     private Double pd_acceptqty;
@@ -56,6 +57,6 @@ public class PurchaseDetailDTO extends CommonBaseDTO implements Serializable{
 
     private Double pd_yqty;
 
-    private Product product;
+    private ProductDTO productDTO;
 
 }

+ 2 - 0
applications/purchase/purchase-dto/src/main/java/com/usoftchina/saas/purchase/dto/PurchaseListDTO.java

@@ -88,6 +88,8 @@ public class PurchaseListDTO extends CommonBaseDTO implements Serializable {
 
     private Double pd_total;
 
+    private Double pd_taxrate;
+
     private Double pd_taxtotal;
 
     private Double pd_acceptqty;

+ 52 - 0
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/config/WebConfig.java

@@ -0,0 +1,52 @@
+package com.usoftchina.saas.purchase.config;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.http.converter.HttpMessageConverter;
+import org.springframework.http.converter.StringHttpMessageConverter;
+import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
+import org.springframework.web.servlet.config.annotation.ContentNegotiationConfigurer;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
+
+import java.nio.charset.Charset;
+import java.text.SimpleDateFormat;
+import java.util.List;
+
+
+/**
+ * @author: guq
+ * @create: 2018-10-30 11:20
+ **/
+
+@Configuration
+public class WebConfig extends WebMvcConfigurationSupport{
+    @Bean
+    public HttpMessageConverter<String> responseBodyConverter() {
+        StringHttpMessageConverter converter = new StringHttpMessageConverter(Charset.forName("UTF-8"));
+        return converter;
+    }
+
+    @Bean
+    public MappingJackson2HttpMessageConverter MappingJacksonHttpMessageConverter(){
+        MappingJackson2HttpMessageConverter converter = new MappingJackson2HttpMessageConverter();
+        ObjectMapper objectMapper = new ObjectMapper();
+        objectMapper.setDateFormat(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"));
+        converter.setObjectMapper(objectMapper);
+        return converter;
+    }
+
+    @Override
+    public void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
+        super.configureMessageConverters(converters);
+        converters.add(responseBodyConverter());
+        converters.add(MappingJacksonHttpMessageConverter());
+    }
+
+    @Override
+    public void configureContentNegotiation(ContentNegotiationConfigurer configurer) {
+        configurer.favorPathExtension(false);
+    }
+
+}
+

+ 1 - 2
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/controller/ProdInOutController.java

@@ -198,8 +198,7 @@ public class ProdInOutController {
 
     @PostMapping("/turnProdOut/{id}")
     public Result turnProdin(@PathVariable("id") Long id){
-        prodInOutService.turnProdOut(id);
-        return Result.success();
+        return prodInOutService.turnProdOut(id);
     }
 
 

+ 3 - 3
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/controller/PurchaseController.java

@@ -18,6 +18,7 @@ import org.springframework.web.bind.annotation.*;
  * @author yingp
  * @date 2018/10/9
  */
+@CrossOrigin
 @RestController
 @RequestMapping("/purchase")
 public class PurchaseController {
@@ -154,14 +155,13 @@ public class PurchaseController {
 
     @PostMapping("/open/{id}")
     public Result openPurchase(@PathVariable(value = "id") long id){
-        purchaseService.openPurchase(id);
+         purchaseService.openPurchase(id);
         return Result.success();
     }
 
     @PostMapping("/turnProdin/{id}")
     public Result turnProdin(@PathVariable("id") Long id){
-        purchaseService.turnProdin(id);
-        return Result.success();
+        return purchaseService.turnProdin(id);
     }
 
 }

+ 4 - 3
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/po/PurchaseDetail.java

@@ -1,8 +1,7 @@
 package com.usoftchina.saas.purchase.po;
 
 import com.usoftchina.saas.base.entity.CommonBaseEntity;
-
-import com.usoftchina.saas.document.entities.Product;
+import com.usoftchina.saas.document.dto.ProductDTO;
 import lombok.Data;
 
 import java.io.Serializable;
@@ -28,6 +27,8 @@ public class PurchaseDetail extends CommonBaseEntity implements Serializable {
 
     private Double pd_total;
 
+    private Double pd_taxrate;
+
     private Double pd_taxtotal;
 
     private Double pd_acceptqty;
@@ -52,5 +53,5 @@ public class PurchaseDetail extends CommonBaseEntity implements Serializable {
 
     private Double pd_yqty;
 
-    private Product product;
+    private ProductDTO productDTO;
 }

+ 3 - 0
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/po/PurchaseList.java

@@ -35,6 +35,7 @@ public class PurchaseList extends CommonBaseEntity implements Serializable {
 
     private Date pu_delivery;
 
+
     private Double pu_taxtotal;
 
     private Double pu_total;
@@ -88,6 +89,8 @@ public class PurchaseList extends CommonBaseEntity implements Serializable {
 
     private Double pd_total;
 
+    private Double pd_taxrate;
+
     private Double pd_taxtotal;
 
     private Double pd_acceptqty;

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

@@ -414,7 +414,11 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
                  prodIODetailMapper.updateByPrimaryKeySelective(sourcePid);
              }
          }
-        return Result.success();
+        DocBaseDTO baseDTO = new DocBaseDTO();
+        baseDTO.setId(pi_id);
+        baseDTO.setCode(piInoutno);
+        baseDTO.setName("采购验退单");
+        return Result.success(baseDTO);
     }
 
     private DocBaseDTO singleClose(Long id) {

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

@@ -404,9 +404,14 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
         //更新主表入库状态
         purchase.setPu_acceptstatus("已入库");
         purchase.setPu_acceptstatuscode("TURNIN");
+
+        DocBaseDTO baseDTO = new DocBaseDTO();
+        baseDTO.setId(pi_id);
+        baseDTO.setCode(piInoutno);
+        baseDTO.setName("采购验收单");
         //更新存在字段
         int affect = getMapper().updateByPrimaryKeySelective(purchase);
-        return Result.success();
+        return Result.success(baseDTO);
     }
 
     private void singleAudit(Long id) {

+ 16 - 4
applications/purchase/purchase-server/src/main/resources/mapper/PurchasedetailMapper.xml

@@ -12,6 +12,7 @@
     <result column="PD_QTY" property="pd_qty" jdbcType="DOUBLE" />
     <result column="PD_PRICE" property="pd_price" jdbcType="DOUBLE" />
     <result column="PD_TOTAL" property="pd_total" jdbcType="DOUBLE" />
+    <result column="PD_TAXRATE" property="pd_taxrate" jdbcType="DOUBLE" />
     <result column="PD_TAXTOTAL" property="pd_taxtotal" jdbcType="DOUBLE" />
     <result column="PD_ACCEPTQTY" property="pd_acceptqty" jdbcType="DOUBLE" />
     <result column="PD_DELIVERY" property="pd_delivery" jdbcType="DOUBLE" />
@@ -27,7 +28,7 @@
     <result column="pd_text4" property="pd_text4" jdbcType="VARCHAR" />
     <result column="pd_text5" property="pd_text5" jdbcType="VARCHAR" />
     <result column="pd_yqty" property="pd_yqty" jdbcType="DOUBLE" />
-    <association property="product" javaType="com.usoftchina.saas.document.entities.Product">
+    <association property="productDTO" javaType="com.usoftchina.saas.document.dto.ProductDTO">
       <id column="pr_id" property="id"/>
       <result column="pr_code" property="pr_code"/>
       <result column="pr_detail" property="pr_detail"/>
@@ -60,7 +61,7 @@
   </resultMap>
   <sql id="Base_Column_List" >
     PD_ID, PD_PUID, PD_CODE, PD_DETNO, PD_PRODID, PD_PRODCODE, PD_UNIT, PD_QTY, PD_PRICE,
-    PD_TOTAL, PD_TAXTOTAL, PD_ACCEPTQTY, PD_DELIVERY, PD_SALECODE, PD_SALEDETNO, PD_SDID,
+    PD_TOTAL, PD_TAXRATE,PD_TAXTOTAL, PD_ACCEPTQTY, PD_DELIVERY, PD_SALECODE, PD_SALEDETNO, PD_SDID,
     companyId, updaterId, updateTime, pd_text1, pd_text2, pd_text3, pd_text4, pd_text5,
     pd_yqty
   </sql>
@@ -124,6 +125,9 @@
       <if test="pdTotal != null" >
         PD_TOTAL,
       </if>
+      <if test="PD_TAXRATE != null" >
+        PD_TAXRATE,
+      </if>
       <if test="pdTaxtotal != null" >
         PD_TAXTOTAL,
       </if>
@@ -198,6 +202,9 @@
       <if test="pdTotal != null" >
         #{pdTotal,jdbcType=DOUBLE},
       </if>
+      <if test="PD_TAXRATE != null" >
+        #{PD_TAXRATE,jdbcType=DOUBLE},
+      </if>
       <if test="pdTaxtotal != null" >
         #{pdTaxtotal,jdbcType=DOUBLE},
       </if>
@@ -275,6 +282,10 @@
       <if test="pd_total != null" >
         PD_TOTAL = #{pd_total,jdbcType=DOUBLE},
       </if>
+      <if test="pd_taxrate != null" >
+        PD_TAXRATE = #{pd_taxrate,jdbcType=DOUBLE},
+      </if>
+
       <if test="pd_taxtotal != null" >
         PD_TAXTOTAL = #{pd_taxtotal,jdbcType=DOUBLE},
       </if>
@@ -355,7 +366,7 @@
     insert into purchasedetail ( PD_PUID, PD_CODE,
     PD_DETNO, PD_PRODID, PD_PRODCODE,
     PD_UNIT, PD_QTY, PD_PRICE,
-    PD_TOTAL, PD_TAXTOTAL, PD_ACCEPTQTY,
+    PD_TOTAL,PD_TAXRATE, PD_TAXTOTAL, PD_ACCEPTQTY,
     PD_DELIVERY, PD_SALECODE, PD_SALEDETNO,
     PD_SDID, companyId, updaterId,
     updateTime, pd_text1, pd_text2,
@@ -367,7 +378,7 @@
       #{item.pd_puid,jdbcType=INTEGER}, #{item.pd_code,jdbcType=VARCHAR},
       #{item.pd_detno,jdbcType=INTEGER}, #{item.pd_prodid,jdbcType=INTEGER}, #{item.pd_prodcode,jdbcType=VARCHAR},
       #{item.pd_unit,jdbcType=VARCHAR}, #{item.pd_qty,jdbcType=DOUBLE}, #{item.pd_price,jdbcType=DOUBLE},
-      #{item.pd_total,jdbcType=DOUBLE}, #{item.pd_taxtotal,jdbcType=DOUBLE}, #{item.pd_acceptqty,jdbcType=DOUBLE},
+      #{item.pd_total,jdbcType=DOUBLE},#{item.pd_taxrate,jdbcType=DOUBLE}, #{item.pd_taxtotal,jdbcType=DOUBLE}, #{item.pd_acceptqty,jdbcType=DOUBLE},
       #{item.pd_delivery,jdbcType=DOUBLE}, #{item.pd_salecode,jdbcType=VARCHAR}, #{item.pd_saledetno,jdbcType=INTEGER},
       #{item.pd_sdid,jdbcType=INTEGER}, #{item.companyId,jdbcType=INTEGER}, #{item.updaterId,jdbcType=INTEGER},
       #{item.updateTime,jdbcType=TIMESTAMP}, #{item.pd_text1,jdbcType=VARCHAR}, #{item.pd_text2,jdbcType=VARCHAR},
@@ -388,6 +399,7 @@
       PD_QTY = #{item.pd_qty},
       PD_PRICE = #{item.pd_price},
       PD_TOTAL = #{item.pd_total},
+      PD_TAXRATE = #{item.pd_taxrate},
       PD_TAXTOTAL = #{item.pd_taxtotal},
       PD_ACCEPTQTY = #{item.pd_acceptqty},
       PD_DELIVERY = #{item.pd_delivery},

+ 4 - 0
applications/sale/sale-dto/src/main/java/com/usoftchina/saas/sale/dto/SaleDTO.java

@@ -24,6 +24,8 @@ public class SaleDTO extends CommonBaseDTO{
 
     private String sa_totalupper;
 
+    private String sa_toplace;
+
     private String sa_status;
 
     private String sa_statuscode;
@@ -42,6 +44,8 @@ public class SaleDTO extends CommonBaseDTO{
 
     private Date sa_recorddate;
 
+    private String sa_remark;
+
     private String sa_text1;
 
     private String sa_text2;

+ 1 - 1
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/controller/SaleController.java

@@ -165,6 +165,6 @@ public class SaleController {
 
     @GetMapping("/test")
     public String test() {
-        return "配置构建success";
+        return "配置构建success-1";
     }
 }

+ 1 - 1
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/po/Sale.java

@@ -39,7 +39,7 @@ public class Sale extends CommonBaseEntity{
 
     private String sa_printstatuscode;
 
-    private Integer sa_recorderid;
+    private Long sa_recorderid;
 
     private String sa_recorder;
 

+ 6 - 2
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/service/impl/SaleServiceImpl.java

@@ -114,6 +114,8 @@ public class SaleServiceImpl implements SaleService{
         sale.setCompanyId(companyId);
         sale.setCreatorId(userId);
         sale.setCreateTime(new Date());
+        sale.setSa_recorderid(userId);
+        sale.setSa_recorder("test");
 
         //编号校验
         sa_code = pushMaxnubmer(sa_code, sa_id);
@@ -129,6 +131,7 @@ public class SaleServiceImpl implements SaleService{
                 SaleDetail detail = BeanMapper.map(item, SaleDetail.class);
                 detail.setSd_said(sa_id);
                 detail.setSd_code(sa_code);
+                detail.setSd_yqty(0.0);
                 insertDetails.add(detail);
             }
             //插入从表
@@ -384,6 +387,7 @@ public class SaleServiceImpl implements SaleService{
         Integer count = 0;
         double pdQty = 0;
         double pdYqty = 0;
+        Long companyId = BaseContextHolder.getCompanyId();
         Sale sale = saleMapper.selectByPrimaryKey(id);
         List<SaleDetail> details = saledetailMapper.selectByFK(id);
         if (null == sale || StringUtils.isEmpty(sale.getSa_code()) || details.size() == 0) {
@@ -428,7 +432,7 @@ public class SaleServiceImpl implements SaleService{
         prodInOut.setPi_said(sale.getId());
         prodInOut.setPi_sacode(sale.getSa_code());
         //设置公司id
-        prodInOut.setCompanyId(sale.getCompanyId());
+        prodInOut.setCompanyId(companyId);
 
         prodInOutMapper.insertSelective(prodInOut);
         //插入出货单从表
@@ -448,7 +452,7 @@ public class SaleServiceImpl implements SaleService{
             prodIODetail.setPd_prodid(saleDetail.getSd_prodid());
             prodIODetail.setPd_prodcode(saleDetail.getSd_prodcode());
             //公司id
-            prodIODetail.setCompanyId(saleDetail.getCompanyId());
+            prodIODetail.setCompanyId(companyId);
             //本次转单数
             prodIODetail.setPd_inqty((saleDetail.getSd_qty()-saleDetail.getSd_yqty()));
             prodIODetailMapper.insertSelective(prodIODetail);

+ 52 - 0
applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/config/WebConfig.java

@@ -0,0 +1,52 @@
+package com.usoftchina.saas.storage.config;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.http.converter.HttpMessageConverter;
+import org.springframework.http.converter.StringHttpMessageConverter;
+import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
+import org.springframework.web.servlet.config.annotation.ContentNegotiationConfigurer;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
+
+import java.nio.charset.Charset;
+import java.text.SimpleDateFormat;
+import java.util.List;
+
+
+/**
+ * @author: guq
+ * @create: 2018-10-30 11:20
+ **/
+
+@Configuration
+public class WebConfig extends WebMvcConfigurationSupport{
+    @Bean
+    public HttpMessageConverter<String> responseBodyConverter() {
+        StringHttpMessageConverter converter = new StringHttpMessageConverter(Charset.forName("UTF-8"));
+        return converter;
+    }
+
+    @Bean
+    public MappingJackson2HttpMessageConverter MappingJacksonHttpMessageConverter(){
+        MappingJackson2HttpMessageConverter converter = new MappingJackson2HttpMessageConverter();
+        ObjectMapper objectMapper = new ObjectMapper();
+        objectMapper.setDateFormat(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"));
+        converter.setObjectMapper(objectMapper);
+        return converter;
+    }
+
+    @Override
+    public void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
+        super.configureMessageConverters(converters);
+        converters.add(responseBodyConverter());
+        converters.add(MappingJacksonHttpMessageConverter());
+    }
+
+    @Override
+    public void configureContentNegotiation(ContentNegotiationConfigurer configurer) {
+        configurer.favorPathExtension(false);
+    }
+
+}
+

+ 2 - 2
base-servers/account/account-api/src/main/java/com/usoftchina/saas/account/api/AccountApi.java

@@ -19,7 +19,7 @@ public interface AccountApi {
      * @param password 明文密码
      * @return
      */
-    @GetMapping(value = "/pwd/check")
+    @GetMapping(value = "/account/pwd/check")
     Result<AccountDTO> validByUsernameAndPwd(@RequestParam(value = "username") String username, @RequestParam(value = "password") String password);
 
     /**
@@ -28,6 +28,6 @@ public interface AccountApi {
      * @param username
      * @return
      */
-    @GetMapping
+    @GetMapping(value = "/account/read")
     Result<AccountDTO> getAccount(@RequestParam(value = "username") String username);
 }

+ 10 - 2
base-servers/account/account-dto/src/main/java/com/usoftchina/saas/account/dto/AccountDTO.java

@@ -29,13 +29,12 @@ public class AccountDTO implements Serializable {
      * 所绑定的角色(按绑定的公司ID分组成Map)
      */
     private Map<Long, List<RoleBaseDTO>> rolesMap;
-
     /**
      * 所拥有的资源
      *
      * @return
      */
-
+    private Map<Long, List<UrlResourceDTO>> resourcesMap;
 
     public Long getId() {
         return id;
@@ -101,6 +100,14 @@ public class AccountDTO implements Serializable {
         this.rolesMap = rolesMap;
     }
 
+    public Map<Long, List<UrlResourceDTO>> getResourcesMap() {
+        return resourcesMap;
+    }
+
+    public void setResourcesMap(Map<Long, List<UrlResourceDTO>> resourcesMap) {
+        this.resourcesMap = resourcesMap;
+    }
+
     @Override
     public String toString() {
         return "AccountDTO{" +
@@ -112,6 +119,7 @@ public class AccountDTO implements Serializable {
                 ", type=" + type +
                 ", companies=" + companies +
                 ", rolesMap=" + rolesMap +
+                ", resourcesMap=" + resourcesMap +
                 '}';
     }
 }

+ 2 - 1
base-servers/account/account-server/src/main/resources/application.yml

@@ -40,13 +40,14 @@ eureka:
     leaseRenewalIntervalInSeconds: 10
     health-check-url-path: /actuator/health
     status-page-url-path: /actuator/info
+    prefer-ip-address: true
     metadata-map:
       user.name: ${spring.security.user.name}
       user.password: ${spring.security.user.password}
   client:
     registryFetchIntervalSeconds: 5
     serviceUrl:
-      defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@192.168.0.181:8510/eureka/
+      defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@127.0.0.1:8500/eureka/
 server:
   port: 8580
   tomcat:

+ 12 - 0
base-servers/account/account-server/src/main/resources/config/application-docker-dev.yml

@@ -0,0 +1,12 @@
+eureka:
+  instance:
+    hostname: saas-account-server-dev
+    prefer-ip-address: false
+  client:
+    serviceUrl:
+      defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@saas-eureka-server-dev:8510/eureka/
+spring:
+  rabbitmq:
+    virtual-host: dev
+server:
+  port: 8590

+ 6 - 0
base-servers/account/account-server/src/main/resources/logback-spring.xml

@@ -103,4 +103,10 @@
         </root>
     </springProfile>
 
+    <springProfile name="docker-dev">
+        <root level="INFO">
+            <appender-ref ref="CONSOLE_APPENDER"/>
+        </root>
+    </springProfile>
+
 </configuration>

+ 13 - 2
base-servers/auth/auth-api/src/main/java/com/usoftchina/saas/auth/api/AuthApi.java

@@ -1,8 +1,10 @@
 package com.usoftchina.saas.auth.api;
 
+import com.usoftchina.saas.auth.dto.AuthDTO;
 import com.usoftchina.saas.auth.dto.TokenDTO;
 import com.usoftchina.saas.base.Result;
 import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestParam;
 
@@ -13,12 +15,21 @@ import org.springframework.web.bind.annotation.RequestParam;
 @FeignClient(name = "auth-server")
 public interface AuthApi {
     /**
-     * 登录认证获取token
+     * 登录认证获取token、公司列表
      *
      * @param username
      * @param password
      * @return
      */
     @PostMapping(value = "/api/auth")
-    Result<TokenDTO> authorize(@RequestParam(value = "username") String username, @RequestParam(value = "password") String password);
+    Result<AuthDTO> authorize(@RequestParam(value = "username") String username, @RequestParam(value = "password") String password);
+
+    /**
+     * 切换公司
+     *
+     * @param companyId
+     * @return
+     */
+    @GetMapping(value = "/api/auth/switch/company")
+    Result<TokenDTO> switchCompany(@RequestParam(value = "companyId") String companyId);
 }

+ 0 - 23
base-servers/auth/auth-api/src/main/java/com/usoftchina/saas/auth/api/TokenApi.java

@@ -1,23 +0,0 @@
-package com.usoftchina.saas.auth.api;
-
-import com.usoftchina.saas.auth.dto.TokenDTO;
-import com.usoftchina.saas.base.Result;
-import org.springframework.cloud.openfeign.FeignClient;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-
-/**
- * @author yingp
- * @date 2018/9/30
- */
-@FeignClient(name = "auth-server")
-public interface TokenApi {
-    /**
-     * 登录获取token
-     *
-     * @param userName
-     * @return
-     */
-    @PostMapping(value = "/client/login")
-    Result<TokenDTO> login(@RequestParam(value = "userName") String userName);
-}

+ 10 - 7
base-servers/auth/auth-api/src/main/java/com/usoftchina/saas/auth/cache/TokenCache.java

@@ -1,6 +1,6 @@
 package com.usoftchina.saas.auth.cache;
 
-import com.usoftchina.saas.auth.api.TokenApi;
+import com.usoftchina.saas.auth.api.AuthApi;
 import com.usoftchina.saas.cache.RedisHashCache;
 import com.usoftchina.saas.context.SpringContextHolder;
 import org.springframework.data.redis.core.RedisTemplate;
@@ -15,16 +15,19 @@ public class TokenCache extends RedisHashCache<String, String, String> {
 
     private final String account;
 
-    private final TokenApi tokenApi;
+    private final String password;
 
-    private TokenCache(String account) {
+    private final AuthApi authApi;
+
+    private TokenCache(String account, String password) {
         super(() -> SpringContextHolder.getBean(RedisTemplate.class));
         this.account = account;
-        this.tokenApi = SpringContextHolder.getBean(TokenApi.class);
+        this.password = password;
+        this.authApi = SpringContextHolder.getBean(AuthApi.class);
     }
 
-    public static TokenCache of(String account) {
-        return new TokenCache(account);
+    public static TokenCache of(String account, String password) {
+        return new TokenCache(account, password);
     }
 
     @Override
@@ -39,6 +42,6 @@ public class TokenCache extends RedisHashCache<String, String, String> {
 
     @Override
     protected Supplier<String> getSupplier() {
-        return () -> tokenApi.login(account).getData().getToken();
+        return () -> authApi.authorize(account, password).getData().getToken().getToken();
     }
 }

+ 4 - 0
base-servers/auth/auth-dto/pom.xml

@@ -13,6 +13,10 @@
     <description>authentication data transfer object</description>
 
     <dependencies>
+        <dependency>
+            <groupId>com.usoftchina.saas</groupId>
+            <artifactId>account-dto</artifactId>
+        </dependency>
         <dependency>
             <groupId>io.springfox</groupId>
             <artifactId>springfox-swagger2</artifactId>

+ 47 - 0
base-servers/auth/auth-dto/src/main/java/com/usoftchina/saas/auth/dto/AuthDTO.java

@@ -0,0 +1,47 @@
+package com.usoftchina.saas.auth.dto;
+
+import com.usoftchina.saas.account.dto.CompanyBaseDTO;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * @author yingp
+ * @date 2018/10/26
+ */
+public class AuthDTO implements Serializable{
+    private TokenDTO token;
+    private List<CompanyBaseDTO> companies;
+
+    public AuthDTO() {
+    }
+
+    public AuthDTO(TokenDTO token, List<CompanyBaseDTO> companies) {
+        this.token = token;
+        this.companies = companies;
+    }
+
+    public TokenDTO getToken() {
+        return token;
+    }
+
+    public void setToken(TokenDTO token) {
+        this.token = token;
+    }
+
+    public List<CompanyBaseDTO> getCompanies() {
+        return companies;
+    }
+
+    public void setCompanies(List<CompanyBaseDTO> companies) {
+        this.companies = companies;
+    }
+
+    @Override
+    public String toString() {
+        return "AuthDTO{" +
+                "token=" + token +
+                ", companies=" + companies +
+                '}';
+    }
+}

+ 9 - 0
base-servers/auth/auth-server/pom.xml

@@ -48,6 +48,15 @@
             <artifactId>springfox-swagger2</artifactId>
         </dependency>
 
+        <!-- sleuth -->
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-zipkin</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.amqp</groupId>
+            <artifactId>spring-rabbit</artifactId>
+        </dependency>
         <dependency>
             <groupId>net.logstash.logback</groupId>
             <artifactId>logstash-logback-encoder</artifactId>

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

@@ -5,27 +5,38 @@ import com.usoftchina.saas.account.dto.AccountDTO;
 import com.usoftchina.saas.auth.common.jwt.JwtHelper;
 import com.usoftchina.saas.auth.common.jwt.JwtInfo;
 import com.usoftchina.saas.auth.common.jwt.TokenVO;
+import com.usoftchina.saas.auth.dto.AuthDTO;
 import com.usoftchina.saas.auth.dto.TokenDTO;
 import com.usoftchina.saas.base.Result;
+import com.usoftchina.saas.exception.ExceptionCode;
 import com.usoftchina.saas.utils.BeanMapper;
+import com.usoftchina.saas.utils.CollectionUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.web.bind.annotation.*;
 
+import javax.servlet.http.HttpServletRequest;
+
 /**
  * @author yingp
  * @date 2018/10/2
  */
 @RestController
-@RequestMapping(path = "/api/auth")
+@RequestMapping
 public class AuthController {
 
     @Autowired
     private AccountApi accountApi;
 
+    @Value("${auth.public-key}")
+    private String publicKeyPath;
+
     @Value("${auth.private-key}")
     private String privateKeyPath;
 
+    @Value("${auth.header:Authorization}")
+    private String authHeader;
+
     @Value("${auth.expire:18000}")
     private int expire;
 
@@ -36,17 +47,59 @@ public class AuthController {
      * @param password
      * @return
      */
-    @PostMapping
-    public Result<TokenDTO> authorize(@RequestParam(value = "username") String username, @RequestParam(value = "password") String password) {
+    @PostMapping("/authorize")
+    public Result<AuthDTO> authorize(@RequestParam String username, @RequestParam String password) {
         Result<AccountDTO> result = accountApi.validByUsernameAndPwd(username, password);
         if (result.isSuccess()) {
             AccountDTO accountDTO = result.getData();
+            Long companyId = null;
+            if (!CollectionUtils.isEmpty(accountDTO.getCompanies())) {
+                companyId = accountDTO.getCompanies().get(0).getId();
+            }
             // TODO
-            JwtInfo info = new JwtInfo(null, null, accountDTO.getId(), accountDTO.getUsername());
+            String appId = "trade-app";
+
+            JwtInfo info = new JwtInfo(appId, companyId, accountDTO.getId(), accountDTO.getUsername());
             TokenVO tokenVO = JwtHelper.generateToken(info, privateKeyPath, expire);
             TokenDTO tokenDTO = BeanMapper.map(tokenVO, TokenDTO.class);
-            return Result.success(tokenDTO);
+            return Result.success(new AuthDTO(tokenDTO, accountDTO.getCompanies()));
         }
         return Result.error(result.getCode(), result.getMessage());
     }
+
+    /**
+     * 切换公司
+     *
+     * @param request
+     * @param companyId
+     * @return
+     */
+    @GetMapping("/switch/company")
+    public Result<TokenDTO> switchCompany(HttpServletRequest request, @RequestParam Long companyId) {
+        String token = request.getHeader(authHeader);
+        JwtInfo infoFromToken = JwtHelper.getInfoFromToken(token, publicKeyPath);
+        if (isCompanyAvailable(infoFromToken, companyId)) {
+            JwtInfo info = new JwtInfo(infoFromToken.getAppId(), companyId, infoFromToken.getUserId(),
+                    infoFromToken.getUserName());
+            TokenVO tokenVO = JwtHelper.generateToken(info, privateKeyPath, expire);
+            return Result.success(BeanMapper.map(tokenVO, TokenDTO.class));
+        }
+        return Result.error(ExceptionCode.COMPANY_NOT_BIND);
+    }
+
+    /**
+     * 指定公司是否可用:
+     * 公司是否存在 + 是否已绑定
+     *
+     * @param infoFromToken
+     * @param companyId
+     * @return
+     */
+    private boolean isCompanyAvailable(JwtInfo infoFromToken, Long companyId) {
+        Result<AccountDTO> accountDTO = accountApi.getAccount(infoFromToken.getUserName());
+        if (!CollectionUtils.isEmpty(accountDTO.getData().getCompanies())) {
+            return accountDTO.getData().getCompanies().stream().anyMatch(cmp -> cmp.getId().equals(companyId));
+        }
+        return false;
+    }
 }

+ 29 - 7
base-servers/auth/auth-server/src/main/resources/application.yml

@@ -7,12 +7,32 @@ spring:
     user:
       name: admin
       password: select111***
+  rabbitmq:
+    host: 192.168.0.176
+    port: 5672
+    virtual-host: dev
+    username: saas
+    password: select123***
+  zipkin:
+    sender:
+      type: rabbit
+    locator:
+      discovery:
+        enabled: true
+  sleuth:
+    sampler:
+      probability: 1.0
   datasource:
+    driver-class-name: com.mysql.cj.jdbc.Driver
+    url: jdbc:mysql://192.168.253.12:3306/saas_auth?characterEncoding=utf-8&useSSL=false
+    username: root
+    password: select111***
     hikari:
-      driver-class-name: com.mysql.cj.jdbc.Driver
-      jdbc-url: jdbc:mysql://192.168.253.12:3306/saas_auth?characterEncoding=utf-8&useSSL=false
-      username: root
-      password: select111***
+      minimum-idle: 5
+      maximum-pool-size: 50
+      idle-timeout: 30000
+      max-lifetime: 1800000
+      connection-timeout: 30000
   messages:
     basename: i18n/messages
 eureka:
@@ -20,15 +40,16 @@ eureka:
     leaseRenewalIntervalInSeconds: 10
     health-check-url-path: /actuator/health
     status-page-url-path: /actuator/info
+    prefer-ip-address: true
     metadata-map:
       user.name: ${spring.security.user.name}
       user.password: ${spring.security.user.password}
   client:
     registryFetchIntervalSeconds: 5
     serviceUrl:
-      defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@192.168.0.181:8510/eureka/
+      defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@127.0.0.1:8500/eureka/
 server:
-  port: 8580
+  port: 8600
   tomcat:
     uri-encoding: UTF-8
 info:
@@ -41,4 +62,5 @@ mybatis:
   type-aliases-package: com.usoftchina.saas.auth.po
   mapper-locations: classpath:mapper/*.xml
 auth:
-  private-key: auth/pri.key
+  private-key: auth/pri.key
+  public-key: auth/pub.key

BIN
base-servers/auth/auth-server/src/main/resources/auth/pub.key


+ 12 - 0
base-servers/auth/auth-server/src/main/resources/config/application-docker-dev.yml

@@ -0,0 +1,12 @@
+eureka:
+  instance:
+    hostname: saas-auth-server-dev
+    prefer-ip-address: false
+  client:
+    serviceUrl:
+      defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@saas-eureka-server-dev:8510/eureka/
+spring:
+  rabbitmq:
+    virtual-host: dev
+server:
+  port: 8610

+ 10 - 0
base-servers/auth/auth-server/src/main/resources/config/application-docker.yml

@@ -0,0 +1,10 @@
+eureka:
+  instance:
+    hostname: saas-auth-server
+    prefer-ip-address: false
+  client:
+    serviceUrl:
+      defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@saas-eureka-server:8500/eureka/
+spring:
+  rabbitmq:
+    virtual-host: docker

+ 6 - 0
base-servers/auth/auth-server/src/main/resources/logback-spring.xml

@@ -103,4 +103,10 @@
         </root>
     </springProfile>
 
+    <springProfile name="docker-dev">
+        <root level="INFO">
+            <appender-ref ref="CONSOLE_APPENDER"/>
+        </root>
+    </springProfile>
+
 </configuration>

+ 0 - 4
base-servers/auth/auth-server/src/main/resources/mapper/AccountMapper.xml

@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
-<mapper namespace="com.usoftchina.saas.auth.mapper.AccountMapper">
-</mapper>

+ 0 - 4
base-servers/auth/auth-server/src/main/resources/mapper/AccountRoleMapper.xml

@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
-<mapper namespace="com.usoftchina.saas.auth.mapper.AccountRoleMapper">
-</mapper>

+ 0 - 4
base-servers/auth/auth-server/src/main/resources/mapper/ResourcesMapper.xml

@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
-<mapper namespace="com.usoftchina.saas.auth.mapper.ResourcesMapper">
-</mapper>

+ 0 - 4
base-servers/auth/auth-server/src/main/resources/mapper/RoleMapper.xml

@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
-<mapper namespace="com.usoftchina.saas.auth.mapper.RoleMapper">
-</mapper>

+ 0 - 4
base-servers/auth/auth-server/src/main/resources/mapper/RoleResourceMapper.xml

@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
-<mapper namespace="com.usoftchina.saas.auth.mapper.RoleResourceMapper">
-</mapper>

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

@@ -1,23 +1,61 @@
 package com.usoftchina.saas.gateway.config;
 
+import com.usoftchina.saas.auth.common.jwt.JwtHelper;
+import com.usoftchina.saas.auth.common.jwt.JwtInfo;
+import com.usoftchina.saas.exception.BizException;
+import com.usoftchina.saas.exception.ExceptionCode;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
 import org.springframework.cloud.gateway.filter.GatewayFilterChain;
 import org.springframework.cloud.gateway.filter.GlobalFilter;
+import org.springframework.context.annotation.Configuration;
 import org.springframework.core.Ordered;
+import org.springframework.http.server.reactive.ServerHttpRequest;
 import org.springframework.web.server.ServerWebExchange;
 import reactor.core.publisher.Mono;
 
+import java.util.List;
+
 /**
  * 全局过滤器鉴权
  *
  * @author yingp
  * @date 2018/10/13
  */
+@Configuration
+@EnableConfigurationProperties(AuthConfig.class)
 public class AuthFilter implements GlobalFilter, Ordered {
+
+    @Autowired
+    private AuthConfig authConfig;
+
     @Override
     public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) {
+        if (!isIgnore(exchange.getRequest())) {
+            // 鉴别身份信息
+//            JwtInfo jwt = getJwtInfoFromHeader(exchange.getRequest());
+            // 鉴别角色权限
+        }
         return chain.filter(exchange);
     }
 
+    private boolean isIgnore(ServerHttpRequest request) {
+        String path = request.getPath().value();
+        return authConfig.getIgnores().stream().anyMatch(ignore -> ignore.equals(path));
+    }
+
+    private JwtInfo getJwtInfoFromHeader(ServerHttpRequest request) {
+        if (!request.getHeaders().containsKey(authConfig.getAuthHeader())) {
+            throw new BizException(ExceptionCode.JWT_ILLEGAL_ARGUMENT);
+        }
+        List<String> headers = request.getHeaders().get(authConfig.getAuthHeader());
+        if (headers.isEmpty()) {
+            throw new BizException(ExceptionCode.JWT_ILLEGAL_ARGUMENT);
+        }
+        String token = headers.get(0).trim();
+        return JwtHelper.getInfoFromToken(token, authConfig.getPublicKey());
+    }
+
     @Override
     public int getOrder() {
         return -100;

+ 2 - 3
base-servers/gateway-server/src/main/resources/application.yml

@@ -153,8 +153,7 @@ info:
   spring-boot-version: '@spring.boot.version@'
   spring-cloud-version: '@spring.cloud.version@'
 auth:
+  auth-header: Authorization
   public-key: auth/pub.key
   ignores:
-    - /api/auth
-    # 忽略全部
-    - /
+    - /api/auth/authorize

+ 1 - 0
framework/core/src/main/java/com/usoftchina/saas/exception/ExceptionCode.java

@@ -26,6 +26,7 @@ public enum ExceptionCode implements BaseExceptionCode {
     COMPANY_CODE_EXIST(52001, "公司商业登记证号已注册"),
     COMPANY_DOMAIN_EXIST(52002, "域名已存在"),
     COMPANY_NOT_EXIST(52003, "公司不存在"),
+    COMPANY_NOT_BIND(52004, "未绑定该公司"),
     USER_NAME_EXIST(53000, "用户名已注册"),
     USER_MOBILE_EXIST(53001, "手机号已注册"),
     USER_EMAIL_EXIST(53002, "邮箱已注册"),

+ 2 - 1
frontend/saas-web/app/model/document/productDTO.js

@@ -2,6 +2,7 @@ Ext.define('saas.model.document.ProductDTO', {
     extend: 'saas.model.Base',
     fields: [
         { name: 'pr_detail', type: 'string' },
-        { name: 'pr_unit', type: 'string' }
+        { name: 'pr_unit', type: 'string' },
+        { name: 'pr_spec', type: 'string' }
     ]
 });

+ 2 - 4
frontend/saas-web/app/model/purchase/prodIODetail.js

@@ -20,7 +20,6 @@ Ext.define('saas.model.purchase.ProdIODetail', {
         { name: 'pd_price', type: 'float' },
         { name: 'pd_total', type: 'float' },
         { name: 'pd_taxrate', type: 'float' },
-        { name: 'pd_qty', type: 'int' },
         { name: 'pd_netprice', type: 'float' },
         { name: 'pd_nettotal', type: 'float' },
         { name: 'pd_whid', type: 'int' },
@@ -35,9 +34,8 @@ Ext.define('saas.model.purchase.ProdIODetail', {
         { name: 'pd_ym', type: 'int' },
         { name: 'pd_yqty', type: 'int' },
         { name: 'pd_remark', type: 'string' },
-        { name: 'pd_ioid', type: 'int' },
-        { name: 'pd_delivery', type: 'date' }
+        { name: 'pd_ioid', type: 'int' }
     ],
     //一对一映射
-    associations: [{ type: 'hasOne', model: 'saas.model.document.Product', associationKey: 'product'}]
+    associations: [{ type: 'hasOne', model: 'saas.model.document.ProductDTO', associationKey: 'ProductDTO'}]
 });

+ 1 - 1
frontend/saas-web/app/model/purchase/purchasedetail.js

@@ -14,5 +14,5 @@ Ext.define('saas.model.purchase.Purchasedetail', {
         { name: 'pd_taxtotal', type: 'float' }
     ],
     //一对一映射
-    associations: [{ type: 'hasOne', model: 'saas.model.document.Product', associationKey: 'product'}]
+    associations: [{ type: 'hasOne', model: 'saas.model.document.ProductDTO', associationKey: 'ProductDTO'}]
 });

+ 23 - 5
frontend/saas-web/app/util/FormUtil.js

@@ -35,6 +35,11 @@ Ext.define('saas.util.FormUtil', {
                         Ext.apply(item, cusItem);
                     });
                     Ext.Array.each(items, function(item) {
+
+                        if(item.xtype == 'datefield') {
+                            item.format = 'Y-m-d H:i:s'
+                        }
+
                         if(item.xtype == 'numberfield') {
                             Ext.applyIf(item, {
                                 hideTrigger: true, // 隐藏trigger
@@ -62,6 +67,7 @@ Ext.define('saas.util.FormUtil', {
 
                             Ext.Array.each(columns, function(c) {
 
+
                                 // 不可锁定
                                 Ext.applyIf(c, {
                                     lockable: false
@@ -71,13 +77,25 @@ Ext.define('saas.util.FormUtil', {
                                 if(c.logic=='necessaryField'){
                                     c.cls = 'x-grid-necessary';
                                 }
+
+                                if(c.xtype == 'datecolumn') {
+                                    Ext.apply(c.xtype, {
+                                        format: 'Y-m-d H:i:s'
+                                    });
+                                }
                                 
                                 var editor = c.editor;
-                                if(editor && editor.xtype == 'numberfield') {
-                                    Ext.applyIf(editor, {
-                                        hideTrigger: true, // 隐藏trigger
-                                        mouseWheelEnabled: false // 取消滚轮事件
-                                    });
+                                if(editor) {
+                                    if(editor.xtype == 'numberfield') {
+                                        Ext.applyIf(editor, {
+                                            hideTrigger: true, // 隐藏trigger
+                                            mouseWheelEnabled: false // 取消滚轮事件
+                                        });
+                                    }else if(editor.xtype == 'datefield') {
+                                        Ext.apply(editor, {
+                                            format: 'Y-m-d H:i:s'
+                                        });
+                                    }
                                 }
                             });
 

+ 23 - 7
frontend/saas-web/app/view/core/form/FormPanel.js

@@ -133,8 +133,8 @@ Ext.define('saas.view.core.form.FormPanel', {
             viewModel = me.getViewModel();
 
         viewModel.set(codeField, '');
-        viewModel.set('createTime', new Date());
-        viewModel.set('updateTime', new Date());
+        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'));
 
         if (statusCodeField) {
             var o = {};
@@ -169,10 +169,15 @@ Ext.define('saas.view.core.form.FormPanel', {
             allData = viewModel.getData(),
             bindFields = allData.base.bindFields,
             detailCount = me.detailCount,
-            formData = {};
+            formData = {},
+            detailGrids = me.query('detailGridField');
 
         Ext.Array.each(bindFields, function(field) {
-            formData[field] = allData[field];
+            var v = allData[field];
+            if(Ext.isDate(v)) {
+                v = Ext.Date.format(v, 'Y-m-d H:i:s');
+            }
+            formData[field] = v;
         });
 
         var data = {
@@ -180,10 +185,21 @@ Ext.define('saas.view.core.form.FormPanel', {
         };
 
         for (var i = 0; i < detailCount; i++) {
-            var detail = allData['detail' + i],
-                store = detail.detailStore;
+            var g = detailGrids[i];
+            var gridDirtyData = g.getDirtyData();
+            var modelDetail = allData['detail' + i];
+            var detailBindFields = modelDetail.detailBindFields;
+
+            Ext.Array.each(gridDirtyData, function(d) {
+                for(k in d) {
+                    if(!Ext.Array.contains(detailBindFields, k)) {
+                        delete d[k];
+                    }
+                }
+            });
+            
 
-            data['detail' + i] = store.getData().items;
+            data['detail' + i] = gridDirtyData;
         }
 
         return data;

+ 2 - 44
frontend/saas-web/app/view/core/form/FormPanelController.js

@@ -77,28 +77,7 @@ Ext.define('saas.view.core.form.FormPanelController', {
         };
 
         for(var i = 0; i < detailCount; i++) {
-            var detailData = formData['detail' + i];
-            var modelDetail = modelData['detail' + i];
-            var dirtyGridData = [];
-            var detailBindFields = modelDetail.detailBindFields;
-
-            Ext.Array.each(detailData, function(item){
-                var d = Object.assign({}, item.data),
-                dirty = item.dirty;
-
-                if(dirty){
-                    if((typeof d.id) != "number" && d.id.indexOf('-')>-1){
-                        d.id = 0;
-                    }
-                    for(k in d) {
-                        if(!Ext.Array.contains(detailBindFields, k)) {
-                            delete d[k];
-                        }
-                    }
-                    dirtyGridData.push(d);
-                }
-            });
-            params['items' + ( i + 1)] = dirtyGridData;
+            params['items' + ( i + 1)] = formData['detail' + i];
         }
 
         // 只有一个从表时从表字段改为items
@@ -147,28 +126,7 @@ Ext.define('saas.view.core.form.FormPanelController', {
         };
 
         for(var i = 0; i < detailCount; i++) {
-            var detailData = formData['detail' + i];
-            var modelDetail = modelData['detail' + i];
-            var dirtyGridData = [];
-            var detailBindFields = modelDetail.detailBindFields;
-
-            Ext.Array.each(detailData, function(item){
-                var d = Object.assign({}, item.data),
-                dirty = item.dirty;
-
-                if(dirty){
-                    if((typeof d.id) != "number" && d.id.indexOf('-')>-1){
-                        d.id = 0;
-                    }
-                    for(k in d) {
-                        if(!Ext.Array.contains(detailBindFields, k)) {
-                            delete d[k];
-                        }
-                    }
-                    dirtyGridData.push(d);
-                }
-            });
-            params['items' + ( i + 1)] = dirtyGridData;
+            params['items' + ( i + 1)] = formData['detail' + i];
         }
 
         // 只有一个从表时从表字段改为items

+ 5 - 0
frontend/saas-web/app/view/core/form/RemoteCombo.js

@@ -4,6 +4,8 @@
 Ext.define('saas.view.core.form.RemoteCombo', {
     extend: 'Ext.form.field.ComboBox',
     alias: 'widget.remotecombo',
+    displayField: 'display',
+    valueField: 'value',
     queryMode: 'local',//只在组件加载的时候请求一次
     initComponent: function() {
         var me = this;
@@ -34,6 +36,9 @@ Ext.define('saas.view.core.form.RemoteCombo', {
         var me = this,
             picker,
             pickerCfg = Ext.apply({
+                maxHeight: 180,
+                minHeight: 0,
+                hiddenBtn:me.hiddenBtn,
                 xtype: 'boundlistadd',
                 id: me.id + '-picker',
                 pickerField: me,

+ 43 - 0
frontend/saas-web/app/view/core/form/field/DetailGridField.js

@@ -114,6 +114,12 @@ Ext.define('saas.view.core.form.field.DetailGridField', {
                 '</div>';
             },
         };
+
+        Ext.Array.each(columns, function(c) {
+            Ext.applyIf(c, {
+                allowBlank: true
+            });
+        });
         if (detnoField) {
             Ext.apply(me, { columns: [indexColumn].concat(columns) });
         }
@@ -287,6 +293,43 @@ Ext.define('saas.view.core.form.field.DetailGridField', {
                 typeof e.setDisabled == 'function' && e.setDisabled(!able);
             }
         });
+    },
+    isValid: function() {
+        var me = this,
+        columns = me.columns;
+
+        // 判断列必填
+        Ext.Array.each(columns, function(c) {
+            var allowBlank = c.allowBlank;
+            if(!allowBlank) {
+                
+            }
+        });
+    },
+
+    getDirtyData: function() {
+        var me = this,
+        store = me.getStore(),
+        allData = store.getData().items,
+        dirtyData = [];
+
+        Ext.Array.each(allData, function(item){
+            var d = Object.assign({}, item.data),
+            dirty = item.dirty;
+
+            if(dirty){
+                if((typeof d.id) != "number" && d.id.indexOf('-')>-1){
+                    d.id = 0;
+                }
+                for(k in d) {
+                    if(Ext.isDate(d[k])) {
+                        d[k] = Ext.Date.format(d[k], 'Y-m-d H:i:s');
+                    }
+                }
+                dirtyData.push(d);
+            }
+        });
+        return dirtyData;
     }
 
 });

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

@@ -255,6 +255,7 @@ Ext.define('saas.view.core.view.BoundListAdd', {
             id: me.id + '-toolbar',
             border: true,
             ownerCt: me,
+            hidden:me.hiddenBtn,
             items:[{
                 text:'新增',
                 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',
     _title:'BOM资料',
+    _deleteUrl:'/api/document/bom/delete/',
     // _dataUrl:'/api/ducument/customer/list',
     _batchOpenUrl:'/api/document/bom/batchOpen',
     _batchCloseUrl:'/api/document/bom/batchClose',
@@ -57,4 +58,8 @@ Ext.define('saas.view.document.bom.BasePanel', {
         }]
     },
 
+    refresh:function(){
+        this.items.items[0].store.load()
+    }
+
 });

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

@@ -150,13 +150,13 @@ Ext.define('saas.view.document.bom.FormPanel', {
                 bind: '{' + statusCodeField + '}',
                 get: function(value) {
                     viewModel.set(statusField, value == 'OPEN' ? '已开启' : '已关闭');
-                    return value == 'OPEN' ? '已关闭' : '已开启'
+                    return value == 'OPEN' ? '禁用' : '启用'
                 }
             };
             viewModel.setFormulas(o);
             viewModel.set(statusCodeField, "OPEN");
         }else {
-            viewModel.set('auditBtnText', "已关闭");
+            viewModel.set('auditBtnText', "禁用");
         }
     }
 });

+ 13 - 28
frontend/saas-web/app/view/document/customer/BasePanel.js

@@ -6,43 +6,19 @@ Ext.define('saas.view.document.customer.BasePanel', {
     viewModel: 'document-customer-basepanel',
 
     searchField:[{
+        editable:false,
+        hiddenBtn:true,
         xtype : "remotecombo", 
         storeUrl:'/api/document/customerkind/getCombo',
         name : "cu_type", 
         emptyText : "请选择客户类型", 
-        allowBlank : true, 
-        queryMode: 'local',
-        displayField: 'display',
-        valueField: 'value',
-        columnWidth : 0.25,
-        etc:{
-            customerkind:{
-                keyField:'id',
-                dataField:'ck_name',
-                reqUrl:'/api/document/customerkind/save',
-                delUrl:'/api/document/customerkind/delete'
-            }
-        },
-        addHandler:function(b){
-            var form = this.ownerCmp.ownerCt.ownerCt;
-            this.dialog = form.getController().getView().add({
-                xtype: 'document-kind-childwin',
-                bind: {
-                    title: '新增客户类型'
-                },
-                dataKind:'customerkind',
-                belong:this.ownerCmp.etc['customerkind'],
-                _parent:form,
-                record:null,
-                session: true
-            });
-            this.dialog.show();
-        }  
+        columnWidth : 0.25
     }],
 
     //字段属性
     _formXtype:'document-customer-formpanel',
     _title:'客户资料',
+    _deleteUrl:'/api/document/customer/delete/',
     // _dataUrl:'/api/ducument/customer/list',
     _batchOpenUrl:'/api/document/customer/batchOpen',
     _batchCloseUrl:'/api/document/customer/batchClose',
@@ -83,6 +59,11 @@ Ext.define('saas.view.document.customer.BasePanel', {
             dataIndex : "cu_uu", 
             width : 120.0, 
         }, 
+        {
+            text : "客户类型", 
+            dataIndex : "cu_type", 
+            width : 120.0, 
+        }, 
         {
             text : "默认客户地址", 
             dataIndex : "ca_address", 
@@ -95,4 +76,8 @@ Ext.define('saas.view.document.customer.BasePanel', {
         }]
     },
 
+    refresh:function(){
+        this.items.items[0].store.load()
+    }
+
 });

+ 17 - 24
frontend/saas-web/app/view/document/customer/FormPanel.js

@@ -51,24 +51,16 @@ Ext.define('saas.view.document.customer.FormPanel', {
         allowBlank: true,
         columnWidth: 0.25
     },{
+        editable:false,
         xtype : "remotecombo", 
         storeUrl:'/api/document/customerkind/getCombo',
         name : "cu_type", 
         fieldLabel : "客户类型", 
-        allowBlank : true, 
-        queryMode: 'local',
-        displayField: 'display',
-        valueField: 'value',
+        allowBlank : false, 
         columnWidth : 0.25,
-        etc:{
-            customerkind:{
-                keyField:'id',
-                dataField:'ck_name',
-                reqUrl:'/api/document/customerkind/save',
-                delUrl:'/api/document/customerkind/delete'
-            }
-        },
+        hiddenBtn:false,//true 则会关闭新增按钮功能
         addHandler:function(b){
+            var document = Ext.create('saas.view.document.kind.Kind',{});
             var form = this.ownerCmp.ownerCt;
             this.dialog = form.getController().getView().add({
                 xtype: 'document-kind-childwin',
@@ -76,8 +68,9 @@ Ext.define('saas.view.document.customer.FormPanel', {
                     title: '新增客户类型'
                 },
                 dataKind:'customerkind',
-                belong:this.ownerCmp.etc['customerkind'],
+                belong:document.etc['customerkind'],
                 _parent:form,
+                _combo:this.ownerCmp,
                 record:null,
                 session: true
             });
@@ -125,13 +118,13 @@ Ext.define('saas.view.document.customer.FormPanel', {
         allowBlank : true, 
         columnWidth : 0.25   
     },{
-        xtype : "numberfield", 
-        name : "cu_ta", 
-        fieldLabel : "应收款余额", 
-        allowBlank : true, 
-        readOnly:true,
-        editable:false,
-        columnWidth : 0.25     
+        // xtype : "numberfield", 
+        // name : "cu_ta", 
+        // fieldLabel : "应收款余额", 
+        // allowBlank : true, 
+        // readOnly:true,
+        // editable:false,
+        // columnWidth : 0.25     
     },{
         xtype:'textfield',
         name : "cu_uu", 
@@ -207,7 +200,7 @@ Ext.define('saas.view.document.customer.FormPanel', {
             {
                 editor : {
                     displayField : "display", 
-                    editable : true, 
+                    editable:false,
                     format : "", 
                     hideTrigger : false, 
                     maxLength : 100.0, 
@@ -288,8 +281,8 @@ Ext.define('saas.view.document.customer.FormPanel', {
             },
             {
                 editor : {
+                    editable:false,
                     displayField : "display", 
-                    editable : true, 
                     format : "", 
                     hideTrigger : false, 
                     maxLength : 100.0, 
@@ -348,13 +341,13 @@ Ext.define('saas.view.document.customer.FormPanel', {
                 bind: '{' + statusCodeField + '}',
                 get: function(value) {
                     viewModel.set(statusField, value == 'OPEN' ? '已开启' : '已关闭');
-                    return value == 'OPEN' ? '已关闭' : '已开启'
+                    return value == 'OPEN' ? '禁用' : '启用'
                 }
             };
             viewModel.setFormulas(o);
             viewModel.set(statusCodeField, "OPEN");
         }else {
-            viewModel.set('auditBtnText', "已关闭");
+            viewModel.set('auditBtnText', "禁用");
         }
     }
 });

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

@@ -96,6 +96,17 @@ Ext.define('KitchenSink.view.binding.ChildForm', {
                 allowBlank:false,
                 fieldLabel:'类型'
             }]
+        },  
+        productunit:{
+            items:[{
+                xtype:'hidden',
+                name:'id'
+            },{
+                xtype:'textfield',
+                name:'pu_name',
+                allowBlank:false,
+                fieldLabel:'计量单位'
+            }]
         },
         inoutkind:{
             items:[{
@@ -178,6 +189,7 @@ Ext.define('KitchenSink.view.binding.ChildForm', {
     onSave:function(){
         var belong = this.belong;
         var form=this.down('form');
+        var combo = this._combo;
         var params = {};
         var names = belong.columns.map(column => column.dataIndex);
         Ext.Array.each(names,function(name) {
@@ -203,6 +215,9 @@ Ext.define('KitchenSink.view.binding.ChildForm', {
                 if(grid){
                     grid.store.load();
                 }
+                if(combo){
+                    combo.store.load();
+                }
                 form.ownerCt.close();
             }
         })

+ 14 - 1
frontend/saas-web/app/view/document/kind/Kind.js

@@ -10,6 +10,9 @@ Ext.define('saas.view.document.kind.Kind', {
     viewModel: {
         type: 'document-kind'
     },
+    //工具类
+    FormUtil: Ext.create('saas.util.FormUtil'),
+    BaseUtil: Ext.create('saas.util.BaseUtil'),
     defaultType:'',
     requires: [
         'Ext.button.Segmented'
@@ -92,7 +95,7 @@ Ext.define('saas.view.document.kind.Kind', {
             keyField:'id',
             reqUrl:'/api/document/producttype/save',
             delUrl:'/api/document/producttype/delete'
-        },
+        }, 
         productbrand:{
             columns: [{
                 text: '物料品牌',
@@ -103,6 +106,16 @@ Ext.define('saas.view.document.kind.Kind', {
             reqUrl:'/api/document/productbrand/save',
             delUrl:'/api/document/productbrand/delete'
         },
+        productunit:{
+            columns: [{
+                text: '计量单位',
+                dataIndex: 'pu_name',
+                flex: 1
+            }],
+            keyField:'id',
+            reqUrl:'/api/document/productunit/save',
+            delUrl:'/api/document/productunit/delete'
+        },
         bankinformation:{
             columns: [{
                 text: '账户编号',

+ 100 - 9
frontend/saas-web/app/view/document/kind/KindModel.js

@@ -25,7 +25,15 @@ Ext.define('saas.view.document.kind.KindModel', {
                 }
             },
             pageSize: null,
-            autoLoad: false
+            autoLoad: false,
+            listeners: {
+                beforeload: function (store, op) {
+                    Ext.apply(store.proxy.extraParams, {
+                        number: 1,
+                        size: 1000
+                    });
+                }
+            }
         },
         vendorkind:{
             fields:[
@@ -44,7 +52,15 @@ Ext.define('saas.view.document.kind.KindModel', {
                 }
             },
             pageSize: null,
-            autoLoad: false
+            autoLoad: false,
+            listeners: {
+                beforeload: function (store, op) {
+                    Ext.apply(store.proxy.extraParams, {
+                        number: 1,
+                        size: 1000
+                    });
+                }
+            }
         },
         productkind:{
             fields:[
@@ -63,7 +79,15 @@ Ext.define('saas.view.document.kind.KindModel', {
                 }
             },
             pageSize: null,
-            autoLoad: false
+            autoLoad: false,
+            listeners: {
+                beforeload: function (store, op) {
+                    Ext.apply(store.proxy.extraParams, {
+                        number: 1,
+                        size: 1000
+                    });
+                }
+            }
         },
         productbrand:{
             fields:[
@@ -82,7 +106,15 @@ Ext.define('saas.view.document.kind.KindModel', {
                 }
             },
             pageSize: null,
-            autoLoad: false
+            autoLoad: false,
+            listeners: {
+                beforeload: function (store, op) {
+                    Ext.apply(store.proxy.extraParams, {
+                        number: 1,
+                        size: 1000
+                    });
+                }
+            }
         },
         bankinformation:{
             fields:[
@@ -106,7 +138,15 @@ Ext.define('saas.view.document.kind.KindModel', {
                 }
             },
             pageSize: null,
-            autoLoad: false
+            autoLoad: false,
+            listeners: {
+                beforeload: function (store, op) {
+                    Ext.apply(store.proxy.extraParams, {
+                        number: 1,
+                        size: 1000
+                    });
+                }
+            }
         },
         inoutkind:{ 
             fields:[
@@ -126,7 +166,15 @@ Ext.define('saas.view.document.kind.KindModel', {
                 }
             },
             pageSize: null,
-            autoLoad: false
+            autoLoad: false,
+            listeners: {
+                beforeload: function (store, op) {
+                    Ext.apply(store.proxy.extraParams, {
+                        number: 1,
+                        size: 1000
+                    });
+                }
+            }
         },
         warehouse: {
             fields:[
@@ -148,7 +196,15 @@ Ext.define('saas.view.document.kind.KindModel', {
                 }
             },
             pageSize: null,
-            autoLoad: false
+            autoLoad: false,
+            listeners: {
+                beforeload: function (store, op) {
+                    Ext.apply(store.proxy.extraParams, {
+                        number: 1,
+                        size: 1000
+                    });
+                }
+            }
         },
         address: {
             fields:[
@@ -164,11 +220,46 @@ Ext.define('saas.view.document.kind.KindModel', {
                 },
                 reader: {
                     type: 'json',
-                    rootProperty: 'data.list'
+                    rootProperty: 'data'
+                }
+            },
+            pageSize: null,
+            autoLoad: false,
+            listeners: {
+                beforeload: function (store, op) {
+                    Ext.apply(store.proxy.extraParams, {
+                        number: 1,
+                        size: 1000
+                    });
+                }
+            }
+        },
+        productunit: {
+            fields:[
+                {name: 'id', type: 'int'},
+                {name: 'pu_name',  type: 'string'}
+            ],
+            proxy: {
+                type: 'ajax',
+                url: '/api/document/productunit/list',
+                actionMethods: {
+                    read: 'GET'
+                },
+                reader: {
+                    type: 'json',
+                    rootProperty: 'data'
                 }
             },
             pageSize: null,
-            autoLoad: false
+            autoLoad: false,
+            listeners: {
+                beforeload: function (store, op) {
+                    Ext.apply(store.proxy.extraParams, {
+                        number: 1,
+                        size: 1000
+                    });
+                }
+            }
         }
     }
 });

+ 25 - 0
frontend/saas-web/app/view/document/other/ProductUnit.js

@@ -0,0 +1,25 @@
+/**
+ * Created by zhouy on 2018/10/18.
+ */
+Ext.define('saas.view.document.other.ProductUnit', {
+    extend: 'saas.view.document.kind.Kind',
+    xtype: 'other-productunit',
+    autoScroll: true,
+    layout:'fit',
+    defaultType:'productunit',
+    tbar: ['->',{
+        xtype:'button',
+        text:'新增',
+        listeners: {
+            click: 'onAdd'
+        }
+    },{
+        xtype:'button',
+        text:'刷新',
+        listeners: {
+            click: 'onRefresh'
+        }
+    }]
+})
+
+

+ 8 - 29
frontend/saas-web/app/view/document/product/BasePanel.js

@@ -6,43 +6,18 @@ Ext.define('saas.view.document.product.BasePanel', {
     viewModel: 'document-product-basepanel',
 
     searchField:[{
+        editable:false,
+        hiddenBtn:true,
         xtype : "remotecombo", 
         storeUrl: '/api/document/producttype/getCombo',
         name : "pr_type", 
-        emptyText : "请选择物料类型", 
-        allowBlank : true, 
-        queryMode: 'local',
-        displayField: 'display',
-        valueField: 'value',
-        columnWidth : 0.25,
-        etc:{
-            producttype:{
-                keyField:'id',
-                dataField:'pr_name',
-                reqUrl:'/api/document/producttype/save',
-                delUrl:'/api/document/producttype/delete'
-            }
-        },
-        addHandler:function(b){
-            var form = this.ownerCmp.ownerCt.ownerCt;
-            this.dialog = form.getController().getView().add({
-                xtype: 'document-kind-childwin',
-                bind: {
-                    title: '新增物料类型'
-                },
-                dataKind:'producttype',
-                belong:this.ownerCmp.etc['producttype'],
-                _parent:form,
-                record:null,
-                session: true
-            });
-            this.dialog.show();
-        }  
+        emptyText : "请选择物料类型"
     }],
 
     //字段属性
     _formXtype:'document-product-formpanel',
     _title:'物料资料',
+    _deleteUrl:'/api/document/product/delete/',
     // _dataUrl:'http://192.168.253.31:9480/product/list',
     _batchOpenUrl:'/api/document/product/batchOpen',
     _batchCloseUrl:'/api/document/product/batchClose',
@@ -90,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
                         }],
                         //联想查询条件
-                        btplfield:"ve_name",
+                        dbtplfield:"ve_name",
                         //放大镜窗口字段
                         dbSearchFields:[{
                             xtype : "textfield", 
@@ -70,15 +70,19 @@ Ext.define('saas.view.document.product.FormController', {
                 beforerender:function(f){
                     Ext.apply(f,{
                         //数据接口
-                        dataUrl:'/api/document/product/getWareHouseByCondition',
+                        dataUrl:'/api/document/warehouse/list',
                         //放大镜赋值设置
                         dbfinds:[{
                             from:'wh_code',to:'pr_whcode'
                         },{
                             from:'wh_description',to:'pr_whname'
                         }],
+                        //新增地址
+                        addXtype:'other-warehouse',
+                        //新增标题
+                        addTitle:'仓库资料', 
                         //联想查询条件
-                        dbCondition:"CONCAT(wh_code, wh_description) like '{0}%'",
+                        dbtplfield:"pr_whcode",
                         //联想设置
                         dbtpls:[{
                             field:'wh_code',width:100

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

@@ -51,101 +51,76 @@ Ext.define('saas.view.document.product.FormPanel', {
         allowBlank: true,
         columnWidth: 0.25
     },{
+        editable:false,
         xtype : "remotecombo", 
         storeUrl:'/api/document/producttype/getCombo',
         name : "pr_type", 
         fieldLabel : "物料类型", 
-        allowBlank : true, 
-        queryMode: 'local',
-        displayField: 'display',
-        valueField: 'value',
+        allowBlank : false, 
         columnWidth : 0.25,
-        etc:{
-            producttype:{
-                keyField:'id',
-                dataField:'pr_name',
-                reqUrl:'/api/document/producttype/save',
-                delUrl:'/api/document/producttype/delete'
-            }
-        },
         addHandler:function(b){
+            var document = Ext.create('saas.view.document.kind.Kind',{});
             var form = this.ownerCmp.ownerCt;
             this.dialog = form.getController().getView().add({
                 xtype: 'document-kind-childwin',
                 bind: {
-                    title: '新增物料类型'
+                    title: '新增供应商类型'
                 },
-                dataKind:'producttype',
-                belong:this.ownerCmp.etc['producttype'],
+                dataKind:'productkind',
+                belong:document.etc['productkind'],
                 _parent:form,
+                _combo:this.ownerCmp,
                 record:null,
                 session: true
             });
             this.dialog.show();
         }
     },{
+        editable:false,
         xtype : "remotecombo", 
-        storeUrl:'/api/document/product/getProdUnit',
+        storeUrl:'/api/document/productunit/getCombo',
         name : "pr_unit", 
-        bind : "{pr_unit}", 
         fieldLabel : "物料单位", 
-        allowBlank : true, 
-        queryMode: 'local',
-        displayField: 'display',
-        valueField: 'value',
+        allowBlank : false, 
         columnWidth : 0.25,
-        etc:{
-            produnit:{
-                keyField:'id',
-                dataField:'vk_name',
-                reqUrl:'/api/document/produnit/save',
-                delUrl:'/api/document/produnit/delete'
-            }
-        },
+        editable:false,
         addHandler:function(b){
+            var document = Ext.create('saas.view.document.kind.Kind',{});
             var form = this.ownerCmp.ownerCt;
             this.dialog = form.getController().getView().add({
                 xtype: 'document-kind-childwin',
                 bind: {
                     title: '新增物料单位'
                 },
-                dataKind:'vendorkind',
-                belong:this.ownerCmp.etc['vendorkind'],
+                dataKind:'productunit',
+                belong:document.etc['productunit'],
                 _parent:form,
+                _combo:this.ownerCmp,
                 record:null,
                 session: true
             });
             this.dialog.show();
         }
     },{
+        editable:false,
         xtype : "remotecombo", 
-        storeUrl:'/api/document/product/getProdBrand',
+        storeUrl:'/api/document/productbrand/getCombo',
         name : "pr_brand", 
-        bind : "{pr_brand}", 
         fieldLabel : "物料品牌", 
-        allowBlank : true, 
-        queryMode: 'local',
-        displayField: 'display',
-        valueField: 'value',
+        allowBlank : false, 
         columnWidth : 0.25,
-        etc:{
-            productbrand:{
-                keyField:'id',
-                dataField:'pb_name',
-                reqUrl:'/api/document/productbrand/save',
-                delUrl:'/api/document/productbrand/delete'
-            }
-        },
         addHandler:function(b){
+            var document = Ext.create('saas.view.document.kind.Kind',{});
             var form = this.ownerCmp.ownerCt;
             this.dialog = form.getController().getView().add({
                 xtype: 'document-kind-childwin',
                 bind: {
-                    title: '新增物料单位'
+                    title: '新增物料品牌'
                 },
                 dataKind:'productbrand',
-                belong:this.ownerCmp.etc['productbrand'],
+                belong:document.etc['productbrand'],
                 _parent:form,
+                _combo:this.ownerCmp,
                 record:null,
                 session: true
             });
@@ -222,13 +197,13 @@ Ext.define('saas.view.document.product.FormPanel', {
                 bind: '{' + statusCodeField + '}',
                 get: function(value) {
                     viewModel.set(statusField, value == 'OPEN' ? '已开启' : '已关闭');
-                    return value == 'OPEN' ? '已关闭' : '已开启'
+                    return value == 'OPEN' ? '禁用' : '启用'
                 }
             };
             viewModel.setFormulas(o);
             viewModel.set(statusCodeField, "OPEN");
         }else {
-            viewModel.set('auditBtnText', "已关闭");
+            viewModel.set('auditBtnText', "禁用");
         }
     }
 });

+ 12 - 27
frontend/saas-web/app/view/document/vendor/BasePanel.js

@@ -5,38 +5,13 @@ Ext.define('saas.view.document.vendor.BasePanel', {
     viewModel: 'document-vendor-basepanel',
 
     searchField:[{
+        editable:false,
         xtype : "remotecombo", 
         storeUrl:'/api/document/vendorkind/getCombo',
         name : "ve_type", 
         emptyText : "请选择供应商类型", 
-        allowBlank : true, 
-        queryMode: 'local',
-        displayField: 'display',
-        valueField: 'value',
         columnWidth : 0.25,
-        etc:{
-            vendorkind:{
-                keyField:'id',
-                dataField:'vk_name',
-                reqUrl:'/api/document/vendorkind/save',
-                delUrl:'/api/document/vendorkind/delete'
-            }
-        },
-        addHandler:function(b){
-            var form = this.ownerCmp.ownerCt.ownerCt;
-            this.dialog = form.getController().getView().add({
-                xtype: 'document-kind-childwin',
-                bind: {
-                    title: '新增供应商类型'
-                },
-                dataKind:'vendorkind',
-                belong:this.ownerCmp.etc['vendorkind'],
-                _parent:form,
-                record:null,
-                session: true
-            });
-            this.dialog.show();
-        }  
+        hiddenBtn:true
     }],
 
     //字段属性
@@ -70,6 +45,12 @@ Ext.define('saas.view.document.vendor.BasePanel', {
             width : 120.0, 
             xtype : "", 
         }, 
+        {
+            text : "供应商类型", 
+            dataIndex : "ve_type", 
+            width : 120.0, 
+            xtype : "", 
+        }, 
         {
             text : "供应商状态", 
             dataIndex : "ve_status", 
@@ -95,4 +76,8 @@ Ext.define('saas.view.document.vendor.BasePanel', {
             xtype : "",
         }]
     },
+
+    refresh:function(){
+        this.items.items[0].store.load()
+    }
 });

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

@@ -51,24 +51,15 @@ Ext.define('saas.view.document.vendor.FormPanel', {
         allowBlank: true,
         columnWidth: 0.25
     },{
+        editable:false,
         xtype : "remotecombo", 
         storeUrl:'/api/document/vendorkind/getCombo',
         name : "ve_type", 
         fieldLabel : "供应商类型", 
-        allowBlank : true, 
-        queryMode: 'local',
-        displayField: 'display',
-        valueField: 'value',
+        allowBlank : false, 
         columnWidth : 0.25,
-        etc:{
-            vendorkind:{
-                keyField:'id',
-                dataField:'vk_name',
-                reqUrl:'/api/document/vendorkind/save',
-                delUrl:'/api/document/vendorkind/delete'
-            }
-        },
         addHandler:function(b){
+            var document = Ext.create('saas.view.document.kind.Kind',{});
             var form = this.ownerCmp.ownerCt;
             this.dialog = form.getController().getView().add({
                 xtype: 'document-kind-childwin',
@@ -76,8 +67,9 @@ Ext.define('saas.view.document.vendor.FormPanel', {
                     title: '新增供应商类型'
                 },
                 dataKind:'vendorkind',
-                belong:this.ownerCmp.etc['vendorkind'],
+                belong:document.etc['vendorkind'],
                 _parent:form,
+                _combo:this.ownerCmp,
                 record:null,
                 session: true
             });
@@ -100,14 +92,14 @@ Ext.define('saas.view.document.vendor.FormPanel', {
     },{ 
         xtype : "numberfield", 
         hideTrigger:true,
-        name : "ve_beginaramount", 
+        name : "ve_beginapamount", 
         fieldLabel : "期初应收", 
         allowBlank : true, 
         columnWidth : 0.25
     },{ 
         xtype : "numberfield", 
-        hideTrigger:true,
-        name : "ve_beginprerecamount", 
+        hideTrigger:true, 
+        name : "ve_beginprepayamount", 
         fieldLabel : "期初预收", 
         allowBlank : true, 
         columnWidth : 0.25    
@@ -125,13 +117,13 @@ Ext.define('saas.view.document.vendor.FormPanel', {
         allowBlank : true, 
         columnWidth : 0.25   
     },{
-        xtype : "numberfield", 
-        name : "ve_ta", 
-        fieldLabel : "应收款余额", 
-        allowBlank : true, 
-        readOnly:true,
-        editable:false,
-        columnWidth : 0.25     
+        // xtype : "numberfield", 
+        // name : "ve_ta", 
+        // fieldLabel : "应收款余额", 
+        // allowBlank : true, 
+        // readOnly:true,
+        // editable:false,
+        // columnWidth : 0.25     
     },{
         xtype:'textfield',
         name : "ve_uu", 
@@ -202,7 +194,7 @@ Ext.define('saas.view.document.vendor.FormPanel', {
             {
                 editor : {
                     displayField : "display", 
-                    editable : true, 
+                    editable:false,
                     format : "", 
                     hideTrigger : false, 
                     maxLength : 100.0, 
@@ -255,13 +247,13 @@ Ext.define('saas.view.document.vendor.FormPanel', {
                 bind: '{' + statusCodeField + '}',
                 get: function(value) {
                     viewModel.set(statusField, value == 'OPEN' ? '已开启' : '已关闭');
-                    return value == 'OPEN' ? '已关闭' : '已开启'
+                    return value == 'OPEN' ? '禁用' : '启用'
                 }
             };
             viewModel.setFormulas(o);
             viewModel.set(statusCodeField, "OPEN");
         }else {
-            viewModel.set('auditBtnText', "已关闭");
+            viewModel.set('auditBtnText', "禁用");
         }
     }
 });

+ 19 - 13
frontend/saas-web/app/view/money/fundtransfer/FormPanel.js

@@ -125,23 +125,29 @@ Ext.define('saas.view.money.fundtransfer.FormPanel', {
                 }
             }, {
                 text : "结算方式", 
-                width : 200.0, 
+                width : 150.0, 
                 dataIndex : "ftd_paymethod", 
                 xtype : "", 
                 items : null,
-                editor : {
-                    displayField : "display", 
-                    editable : true, 
-                    format : "", 
-                    hideTrigger : false, 
-                    maxLength : 100.0, 
-                    minValue : null, 
-                    positiveNum : false, 
-                    queryMode : "local", 
-                    store : null, 
-                    valueField : "value", 
-                    xtype : "dbfindtrigger"
+                editor:{
+                    xtype: 'combobox',
+                    name: 'ftd_paymethod',
+                    queryMode: 'local',
+                    displayField: 'ftd_paymethod_d',
+                    valueField: 'ftd_paymethod',
+                    editable:false,
+                    store: Ext.create('Ext.data.ArrayStore', {
+                        fields: ['ftd_paymethod', 'ftd_paymethod_d'],
+                        data: [
+                            ["无", "无"],
+                            ["支付宝转账", "支付宝转账"],
+                            ["微信转账", "微信转账"],
+                            ["现金", "现金"],
+                            ["银行转账", "银行转账"]
+                        ]
+                    })
                 }
+                
             }, {
                 text : "备注", 
                 dataIndex : "ftd_remark",

+ 32 - 6
frontend/saas-web/app/view/money/fundtransfer/FormPanelController.js

@@ -32,19 +32,32 @@ Ext.define('saas.view.money.fundtransfer.FormPanelController', {
                             "text": "账户编号",
                             "flex": 1,
                             "dataIndex": "bk_bankcode",
-                            "width": 100,
+                            "width": 120,
                             "xtype": ""
                         }, {
                             "text": "账户名称",
                             "flex": 1,
                             "dataIndex": "bk_bankname",
+                            "width": 150,
                             "xtype": ""
                         }, {
                             "text": "账户类型",
-                            "flex": 0,
+                            "flex": 1,
                             "dataIndex": "bk_type",
-                            "width": 200,
+                            "width": 120,
                             "xtype": ""
+                        }, {
+                            "text": "账户余额",
+                            "flex": 1,
+                            "dataIndex": "bk_thisamount",
+                            "width": 120,
+                            "xtype": ""
+                        }, {
+                            "text": "建帐日期",
+                            "flex": 1,
+                            "dataIndex": "bk_date",
+                            "width": 120,
+                            "xtype": "datecolumn"
                         }]
                     }) ;   
 
@@ -77,19 +90,32 @@ Ext.define('saas.view.money.fundtransfer.FormPanelController', {
                             "text": "账户编号",
                             "flex": 1,
                             "dataIndex": "bk_bankcode",
-                            "width": 100,
+                            "width": 120,
                             "xtype": ""
                         }, {
                             "text": "账户名称",
                             "flex": 1,
                             "dataIndex": "bk_bankname",
+                            "width": 150,
                             "xtype": ""
                         }, {
                             "text": "账户类型",
-                            "flex": 0,
+                            "flex": 1,
                             "dataIndex": "bk_type",
-                            "width": 200,
+                            "width": 120,
                             "xtype": ""
+                        }, {
+                            "text": "账户余额",
+                            "flex": 1,
+                            "dataIndex": "bk_thisamount",
+                            "width": 120,
+                            "xtype": ""
+                        }, {
+                            "text": "建帐日期",
+                            "flex": 1,
+                            "dataIndex": "bk_date",
+                            "width": 120,
+                            "xtype": "datecolumn"
                         }]
                     }) ;   
 

+ 1 - 1
frontend/saas-web/app/view/money/fundtransfer/QueryPanel.js

@@ -29,7 +29,7 @@ Ext.define('saas.view.money.fundtransfer.QueryPanel', {
         }, {
             text: '单据编号',
             dataIndex: 'ft_code',
-            width: 120
+            width: 150
         }, {
             text: '单据状态',
             dataIndex: 'ft_status',

+ 6 - 19
frontend/saas-web/app/view/money/othreceipts/FormPanel.js

@@ -78,32 +78,19 @@ Ext.define('saas.view.money.othreceipts.FormPanel', {
                 items : null,
                 editor : {
                     xtype : "remotecombo", 
-                    storeUrl:'/api/document/fundinoutType/list',
-                    name : "ord_type", 
-                    fieldLabel : "收入类别", 
-                    allowBlank : true, 
-                    queryMode: 'local',
-                    displayField: 'display',
-                    valueField: 'value',
-                    columnWidth : 0.25,
-                    etc:{
-                        inoutkind:{
-                            keyField:'id',
-                            dataField:'ft_name',
-                            reqUrl:'/api/document/fundinoutType/save',
-                            delUrl:'/api/document/fundinoutType/delete'
-                        }
-                    },
+                    storeUrl:'/api/document/inoutkind/getCombo',
                     addHandler:function(b){
-                        var form = this.ownerCmp.ownerCt.ownerCmp.ownerCt;
+                        var document = Ext.create('saas.view.document.kind.Kind',{});
+                        var form =this.ownerCmp.ownerCt.ownerCmp.ownerCt;
                         this.dialog = form.getController().getView().add({
                             xtype: 'document-kind-childwin',
                             bind: {
-                                title: '新增收入类型'
+                                title: '新增收入类别类型'
                             },
                             dataKind:'inoutkind',
-                            belong:this.ownerCmp.etc['inoutkind'],
+                            belong:document.etc['inoutkind'],
                             _parent:form,
+                            _combo:this.ownerCmp,
                             record:null,
                             session: true
                         });

+ 80 - 28
frontend/saas-web/app/view/money/othreceipts/FormPanelController.js

@@ -8,7 +8,7 @@ Ext.define('saas.view.money.othreceipts.FormPanelController', {
             'dbfindtrigger[name=or_custname]':{
                 beforerender:function(f){
                     Ext.apply(f,{
-                        dataUrl:'/api/document/customer/list',
+                        dataUrl:'/api/document/customer/dbfind',
                         addXtype: 'document-customer-formpanel',
                         addTitle: '客户资料',
                         dbfinds:[{
@@ -23,30 +23,69 @@ Ext.define('saas.view.money.othreceipts.FormPanelController', {
                         },{
                             field:'cu_name',width:100
                         }],
-                        dbColumns:[{
-                            "text": "客户ID",
-                            "flex": 0,
-                            "dataIndex": "id",
-                            "width": 100,
-                            "xtype": ""
-                        },{
-                            "text": "客户编号",
-                            "flex": 1,
-                            "dataIndex": "cu_code",
-                            "width": 100,
-                            "xtype": ""
-                        }, {
-                            "text": "客户名称",
-                            "flex": 1,
-                            "dataIndex": "cu_name",
-                            "xtype": ""
-                        }, {
-                            "text": "客户类型",
-                            "flex": 0,
-                            "dataIndex": "cu_type",
-                            "width": 200,
-                            "xtype": ""
-                        }]
+                        dbColumns:[
+                            {
+                                conditionCode:'id',
+                                "text": "客户ID",
+                                "flex": 0,
+                                "dataIndex": "id",
+                                "width": 0,
+                                "xtype": "",
+                                "items": null
+                            },{
+                                conditionCode:'cu_code',
+                                "text": "客户编号",
+                                "flex": 1,
+                                "dataIndex": "cu_code",
+                                "width": 100,
+                                "xtype": "",
+                                "items": null
+                            }, {
+                                conditionCode:'cu_name',
+                                "text": "客户名称",
+                                "flex": 1,
+                                "dataIndex": "cu_name",
+                                "xtype": "",
+                                "items": null
+                            }, {
+                                conditionCode:'cu_type',
+                                "text": "客户类型",
+                                "flex": 1,
+                                "dataIndex": "cu_type",
+                                "width": 200,
+                                "xtype": "",
+                                "items": null
+                            }, {
+                                "text": "业务员编号",
+                                "flex": 1,
+                                "dataIndex": "cu_sellercode",
+                                "width": 100
+                            }, {
+                                "text": "业务员",
+                                "flex": 1,
+                                "dataIndex": "cu_sellername",
+                                "width": 100
+                            }, {
+                                "text": "税率",
+                                "flex": 1,
+                                "dataIndex": "cu_taxrate",
+                                "width": 100
+                            }, {
+                                "text": "承付天数",
+                                "flex": 1,
+                                "dataIndex": "cu_promisedays",
+                                "width": 100
+                            }, {
+                                "text": "额度",
+                                "flex": 1,
+                                "dataIndex": "cu_credit",
+                                "width": 100
+                            }, {
+                                "text": "客户地址",
+                                "flex": 1,
+                                "dataIndex": "ca_address",
+                                "width": 250
+                            }]
                     }) ;   
 
                 }
@@ -78,19 +117,32 @@ Ext.define('saas.view.money.othreceipts.FormPanelController', {
                             "text": "账户编号",
                             "flex": 1,
                             "dataIndex": "bk_bankcode",
-                            "width": 100,
+                            "width": 120,
                             "xtype": ""
                         }, {
                             "text": "账户名称",
                             "flex": 1,
                             "dataIndex": "bk_bankname",
+                            "width": 150,
                             "xtype": ""
                         }, {
                             "text": "账户类型",
-                            "flex": 0,
+                            "flex": 1,
                             "dataIndex": "bk_type",
-                            "width": 200,
+                            "width": 120,
                             "xtype": ""
+                        }, {
+                            "text": "账户余额",
+                            "flex": 1,
+                            "dataIndex": "bk_thisamount",
+                            "width": 120,
+                            "xtype": ""
+                        }, {
+                            "text": "建帐日期",
+                            "flex": 1,
+                            "dataIndex": "bk_date",
+                            "width": 120,
+                            "xtype": "datecolumn"
                         }]
                     }) ;   
 

+ 80 - 28
frontend/saas-web/app/view/money/othreceipts/QueryPanelController.js

@@ -8,7 +8,7 @@ Ext.define('saas.view.money.othreceipts.QueryPanelController', {
             'dbfindtrigger[name=or_custname]':{
                 beforerender:function(f){
                     Ext.apply(f,{
-                        dataUrl:'/api/document/customer/list',
+                        dataUrl:'/api/document/customer/dbfind',
                         addXtype: 'document-customer-formpanel',
                         addTitle: '客户资料',
                         dbfinds:[{
@@ -23,30 +23,69 @@ Ext.define('saas.view.money.othreceipts.QueryPanelController', {
                         },{
                             field:'cu_name',width:100
                         }],
-                        dbColumns:[{
-                            "text": "客户ID",
-                            "flex": 0,
-                            "dataIndex": "id",
-                            "width": 100,
-                            "xtype": ""
-                        },{
-                            "text": "客户编号",
-                            "flex": 1,
-                            "dataIndex": "cu_code",
-                            "width": 100,
-                            "xtype": ""
-                        }, {
-                            "text": "客户名称",
-                            "flex": 1,
-                            "dataIndex": "cu_name",
-                            "xtype": ""
-                        }, {
-                            "text": "客户类型",
-                            "flex": 0,
-                            "dataIndex": "cu_type",
-                            "width": 200,
-                            "xtype": ""
-                        }]
+                        dbColumns:[
+                            {
+                                conditionCode:'id',
+                                "text": "客户ID",
+                                "flex": 0,
+                                "dataIndex": "id",
+                                "width": 0,
+                                "xtype": "",
+                                "items": null
+                            },{
+                                conditionCode:'cu_code',
+                                "text": "客户编号",
+                                "flex": 1,
+                                "dataIndex": "cu_code",
+                                "width": 100,
+                                "xtype": "",
+                                "items": null
+                            }, {
+                                conditionCode:'cu_name',
+                                "text": "客户名称",
+                                "flex": 1,
+                                "dataIndex": "cu_name",
+                                "xtype": "",
+                                "items": null
+                            }, {
+                                conditionCode:'cu_type',
+                                "text": "客户类型",
+                                "flex": 1,
+                                "dataIndex": "cu_type",
+                                "width": 200,
+                                "xtype": "",
+                                "items": null
+                            }, {
+                                "text": "业务员编号",
+                                "flex": 1,
+                                "dataIndex": "cu_sellercode",
+                                "width": 100
+                            }, {
+                                "text": "业务员",
+                                "flex": 1,
+                                "dataIndex": "cu_sellername",
+                                "width": 100
+                            }, {
+                                "text": "税率",
+                                "flex": 1,
+                                "dataIndex": "cu_taxrate",
+                                "width": 100
+                            }, {
+                                "text": "承付天数",
+                                "flex": 1,
+                                "dataIndex": "cu_promisedays",
+                                "width": 100
+                            }, {
+                                "text": "额度",
+                                "flex": 1,
+                                "dataIndex": "cu_credit",
+                                "width": 100
+                            }, {
+                                "text": "客户地址",
+                                "flex": 1,
+                                "dataIndex": "ca_address",
+                                "width": 250
+                            }]
                     }) ;   
 
                 }
@@ -78,19 +117,32 @@ Ext.define('saas.view.money.othreceipts.QueryPanelController', {
                             "text": "账户编号",
                             "flex": 1,
                             "dataIndex": "bk_bankcode",
-                            "width": 100,
+                            "width": 120,
                             "xtype": ""
                         }, {
                             "text": "账户名称",
                             "flex": 1,
                             "dataIndex": "bk_bankname",
+                            "width": 150,
                             "xtype": ""
                         }, {
                             "text": "账户类型",
-                            "flex": 0,
+                            "flex": 1,
                             "dataIndex": "bk_type",
-                            "width": 200,
+                            "width": 120,
                             "xtype": ""
+                        }, {
+                            "text": "账户余额",
+                            "flex": 1,
+                            "dataIndex": "bk_thisamount",
+                            "width": 120,
+                            "xtype": ""
+                        }, {
+                            "text": "建帐日期",
+                            "flex": 1,
+                            "dataIndex": "bk_date",
+                            "width": 120,
+                            "xtype": "datecolumn"
                         }]
                     }) ;   
 

+ 6 - 19
frontend/saas-web/app/view/money/othspendings/FormPanel.js

@@ -78,32 +78,19 @@ Ext.define('saas.view.money.othspendings.FormPanel', {
                 items : null,
                 editor : {
                     xtype : "remotecombo", 
-                    storeUrl:'/api/document/fundinoutType/list',
-                    name : "osd_type", 
-                    fieldLabel : "支出类别", 
-                    allowBlank : true, 
-                    queryMode: 'local',
-                    displayField: 'display',
-                    valueField: 'value',
-                    columnWidth : 0.25,
-                    etc:{
-                        inoutkind:{
-                            keyField:'id',
-                            dataField:'ft_name',
-                            reqUrl:'/api/document/fundinoutType/save',
-                            delUrl:'/api/document/fundinoutType/delete'
-                        }
-                    },
+                    storeUrl:'/api/document/inoutkind/getCombo',
                     addHandler:function(b){
-                        var form = this.ownerCmp.ownerCt.ownerCmp.ownerCt;
+                        var document = Ext.create('saas.view.document.kind.Kind',{});
+                        var form =this.ownerCmp.ownerCt.ownerCmp.ownerCt;
                         this.dialog = form.getController().getView().add({
                             xtype: 'document-kind-childwin',
                             bind: {
-                                title: '新增收入类型'
+                                title: '新增收入类别类型'
                             },
                             dataKind:'inoutkind',
-                            belong:this.ownerCmp.etc['inoutkind'],
+                            belong:document.etc['inoutkind'],
                             _parent:form,
+                            _combo:this.ownerCmp,
                             record:null,
                             session: true
                         });

+ 49 - 18
frontend/saas-web/app/view/money/othspendings/FormPanelController.js

@@ -28,31 +28,53 @@ Ext.define('saas.view.money.othspendings.FormPanelController', {
                             field: 've_name',
                             width: 100
                         }],
-                        dbColumns: [{
+                        dbColumns:[{
                             "text": "供应商ID",
                             "flex": 0,
                             "dataIndex": "id",
                             "width": 100,
                             "xtype": "numbercolumn"
-                        }, {
-                            conditionCode: 've_code',
+                        },{
                             "text": "供应商编号",
                             "flex": 1,
                             "dataIndex": "ve_code",
                             "width": 100
                         }, {
-                            conditionCode: 've_name',
                             "text": "供应商名称",
                             "flex": 1,
                             "dataIndex": "ve_name",
                             "width": 100
                         }, {
-                            conditionCode: 'cu_type',
                             "text": "供应商类型",
                             "flex": 0,
                             "dataIndex": "ve_type",
                             "width": 200,
                             "items": null
+                        }, {
+                            "text": "税率",
+                            "flex": 1,
+                            "dataIndex": "ve_taxrate",
+                            "width": 100
+                        }, {
+                            "text": "承付天数",
+                            "flex": 1,
+                            "dataIndex": "ve_promisedays",
+                            "width": 100
+                        }, {
+                            "text": "纳税人识别号",
+                            "flex": 1,
+                            "dataIndex": "ve_bankaccount",
+                            "width": 100
+                        }, {
+                            "text": "开户银行",
+                            "flex": 1,
+                            "dataIndex": "ve_bankaccount",
+                            "width": 100
+                        }, {
+                            "text": "银行账户",
+                            "flex": 1,
+                            "dataIndex": "ve_bankcode",
+                            "width": 100
                         }]
                     });
 
@@ -80,33 +102,42 @@ Ext.define('saas.view.money.othspendings.FormPanelController', {
                             field: 'bk_bankname',
                             width: 100
                         }],
-                        dbColumns: [{
+                        dbColumns:[{
                             "text": "账户ID",
                             "flex": 0,
                             "dataIndex": "id",
                             "width": 0,
-                            "xtype": "",
-                            "items": null
-                        }, {
+                            "xtype": ""
+                        },{
                             "text": "账户编号",
                             "flex": 1,
                             "dataIndex": "bk_bankcode",
-                            "width": 100,
-                            "xtype": "",
-                            "items": null
+                            "width": 120,
+                            "xtype": ""
                         }, {
                             "text": "账户名称",
                             "flex": 1,
                             "dataIndex": "bk_bankname",
-                            "xtype": "",
-                            "items": null
+                            "width": 150,
+                            "xtype": ""
                         }, {
                             "text": "账户类型",
-                            "flex": 0,
+                            "flex": 1,
                             "dataIndex": "bk_type",
-                            "width": 200,
-                            "xtype": "",
-                            "items": null
+                            "width": 120,
+                            "xtype": ""
+                        }, {
+                            "text": "账户余额",
+                            "flex": 1,
+                            "dataIndex": "bk_thisamount",
+                            "width": 120,
+                            "xtype": ""
+                        }, {
+                            "text": "建帐日期",
+                            "flex": 1,
+                            "dataIndex": "bk_date",
+                            "width": 120,
+                            "xtype": "datecolumn"
                         }]
                     });
 

+ 1 - 1
frontend/saas-web/app/view/money/othspendings/QueryPanel.js

@@ -54,7 +54,7 @@ Ext.define('saas.view.money.othspendings.QueryPanel', {
         }, {
             text: '单据编号',
             dataIndex: 'os_code',
-            width: 120
+            width: 150
         }, {
             text: '单据状态',
             dataIndex: 'os_status',

+ 45 - 14
frontend/saas-web/app/view/money/othspendings/QueryPanelController.js

@@ -30,24 +30,46 @@ Ext.define('saas.view.money.othspendings.QueryPanelController', {
                             "width": 100,
                             "xtype": "numbercolumn"
                         },{
-                            conditionCode:'ve_code',
                             "text": "供应商编号",
                             "flex": 1,
                             "dataIndex": "ve_code",
                             "width": 100
                         }, {
-                            conditionCode:'ve_name',
                             "text": "供应商名称",
                             "flex": 1,
                             "dataIndex": "ve_name",
                             "width": 100
                         }, {
-                            conditionCode:'cu_type',
                             "text": "供应商类型",
                             "flex": 0,
                             "dataIndex": "ve_type",
                             "width": 200,
                             "items": null
+                        }, {
+                            "text": "税率",
+                            "flex": 1,
+                            "dataIndex": "ve_taxrate",
+                            "width": 100
+                        }, {
+                            "text": "承付天数",
+                            "flex": 1,
+                            "dataIndex": "ve_promisedays",
+                            "width": 100
+                        }, {
+                            "text": "纳税人识别号",
+                            "flex": 1,
+                            "dataIndex": "ve_bankaccount",
+                            "width": 100
+                        }, {
+                            "text": "开户银行",
+                            "flex": 1,
+                            "dataIndex": "ve_bankaccount",
+                            "width": 100
+                        }, {
+                            "text": "银行账户",
+                            "flex": 1,
+                            "dataIndex": "ve_bankcode",
+                            "width": 100
                         }]
                     }) ;   
 
@@ -76,28 +98,37 @@ Ext.define('saas.view.money.othspendings.QueryPanelController', {
                             "flex": 0,
                             "dataIndex": "id",
                             "width": 0,
-                            "xtype": "numbercolumn",
-                            "items": null
+                            "xtype": ""
                         },{
                             "text": "账户编号",
                             "flex": 1,
                             "dataIndex": "bk_bankcode",
-                            "width": 100,
-                            "xtype": "",
-                            "items": null
+                            "width": 120,
+                            "xtype": ""
                         }, {
                             "text": "账户名称",
                             "flex": 1,
                             "dataIndex": "bk_bankname",
-                            "xtype": "",
-                            "items": null
+                            "width": 150,
+                            "xtype": ""
                         }, {
                             "text": "账户类型",
-                            "flex": 0,
+                            "flex": 1,
                             "dataIndex": "bk_type",
-                            "width": 200,
-                            "xtype": "",
-                            "items": null
+                            "width": 120,
+                            "xtype": ""
+                        }, {
+                            "text": "账户余额",
+                            "flex": 1,
+                            "dataIndex": "bk_thisamount",
+                            "width": 120,
+                            "xtype": ""
+                        }, {
+                            "text": "建帐日期",
+                            "flex": 1,
+                            "dataIndex": "bk_date",
+                            "width": 120,
+                            "xtype": "datecolumn"
                         }]
                     }) ;   
 

+ 1 - 5
frontend/saas-web/app/view/money/payBalance/FormPanel.js

@@ -18,7 +18,7 @@ Ext.define('saas.view.money.payBalance.FormPanel', {
     _readUrl: '/api/money/paybalance/read/',
     _saveUrl: '/api/money/paybalance/save/',
     _auditUrl: '/api/money/paybalance/audit/',
-    _unAuditUrl: 'api/money/paybalance/unAudit/',
+    _unAuditUrl: '/api/money/paybalance/unAudit/',
     _deleteUrl: '/api/money/paybalance/delete/',
 
     // _readUrl: 'http://192.168.253.129:8940/money/paybalance/read/',
@@ -164,10 +164,6 @@ Ext.define('saas.view.money.payBalance.FormPanel', {
         name: 'pb_remark',
         columnWidth: 1,
         fieldLabel: '备注'
-    }, {
-        xtype: 'textfield',
-        name: 'companyid',
-        fieldLabel: '公司ID'
     }, {
         xtype: 'numberfield',
         name: 'pb_recorderid',

+ 0 - 4
frontend/saas-web/app/view/money/recBalance/FormPanel.js

@@ -208,10 +208,6 @@ Ext.define('saas.view.money.recBalance.FormPanel', {
                 xtype: 'textfield'
             }
         }]
-    }, {
-        xtype: 'numberfield',
-        name: 'companyid',
-        fieldLabel: '公司id'
     }, {
         xtype: 'numberfield',
         name: 'rb_recorderid',

+ 9 - 6
frontend/saas-web/app/view/purchase/purchase/FormPanel.js

@@ -17,8 +17,8 @@ Ext.define('saas.view.purchase.purchase.FormPanel', {
      _relationColumn: 'pd_puid',
 
      _readUrl:'/api/purchase/purchase/read/',
-     _saveUrl:'/api/purchase/purchase/save/',
-     _auditUrl:'/api/purchase/purchase/audit/',
+     _saveUrl:'/api/purchase/purchase/save',
+     _auditUrl:'/api/purchase/purchase/audit',
      _unAuditUrl: '/api/purchase/purchase/unAudit/',
      _deleteUrl:'/api/purchase/purchase/delete/',
      _turnInUrl:'/api/purchase/purchase/turnProdin/',
@@ -26,7 +26,7 @@ Ext.define('saas.view.purchase.purchase.FormPanel', {
     // _readUrl:'http://localhost:8800/purchase/read/',
     // _saveUrl:'http://localhost:8800/purchase/save',
     // _auditUrl:'http://localhost:8800/purchase/audit',
-    // _unAuditUrl: '/api/purchase/purchase/unAudit/',
+    // _unAuditUrl:'http://localhost:8800/purchase/unAudit/',
     // _deleteUrl:'http://localhost:8800/purchase/delete/',
     // _turnInUrl:'http://localhost:8800/purchase/turnProdin/',
 
@@ -35,6 +35,9 @@ Ext.define('saas.view.purchase.purchase.FormPanel', {
      toolBtns: [{
          xtype: 'button',
          text: '转采购验收单',
+         bind: {
+            hidden: '{!id}'
+        },
          handler: 'turnIn'
      }],
 
@@ -85,7 +88,7 @@ Ext.define('saas.view.purchase.purchase.FormPanel', {
     }, {
         name : "detailGridField", 
         xtype : "detailGridField", 
-        storeModel:'saas.model.purchase.ProdIODetail',
+        storeModel:'saas.model.purchase.Purchasedetail',
         detnoColumn:  'pd_detno',
         deleteDetailUrl:'/api/purchase/purchase/deleteDetail/',
         columns : [
@@ -120,7 +123,7 @@ Ext.define('saas.view.purchase.purchase.FormPanel', {
                 dataIndex : "pr_detail",
                 ignore:true,
                 renderer: function (v, m, r) {
-                    return r.data["product"]?r.data["product"][m.column.dataIndex]:v;
+                    return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:v;
                 }
             },
             {
@@ -128,7 +131,7 @@ Ext.define('saas.view.purchase.purchase.FormPanel', {
                 dataIndex : "pr_spec",
                 ignore:true,
                 renderer: function (v, m, r) {
-                    return r.data["product"]?r.data["product"][m.column.dataIndex]:v;
+                    return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:v;
                 }
             },
             {

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

@@ -145,7 +145,8 @@ Ext.define('saas.view.purchase.purchase.FormPanelController', {
                 beforerender:function(f){
                     Ext.apply(f,{
                         //数据接口
-                        dataUrl:'http://192.168.253.31:9480/product/getProductsByCondition',
+                        // dataUrl:'http://192.168.253.31:9480/product/getProductsByCondition',
+                        dataUrl: '/api/document/product/list',
                         //放大镜赋值设置
                         dbfinds:[{
                             from:'pr_code',to:'pd_prodcode'
@@ -215,8 +216,13 @@ Ext.define('saas.view.purchase.purchase.FormPanelController', {
         })
         .then(function(localJson) {
             if(localJson.success){
-                showToast('转单成功');
-              
+                var intValue = localJson.data.id,
+                    codeValue= localJson.data.code,
+                    name = localJson.data.name;
+                openTab('purchase-purchasein-formpanel',name+"("+codeValue+")",codeValue+intValue, {
+                    initId: intValue
+                });
+                showToast('转单成功');    
             }
         })
         .catch(function(res) {

+ 26 - 12
frontend/saas-web/app/view/purchase/purchaseIn/FormPanel.js

@@ -37,6 +37,9 @@ Ext.define('saas.view.purchase.purchaseIn.FormPanel', {
     toolBtns: [{
         xtype: 'button',
         text: '转采购验退单',
+        bind: {
+            hidden: '{!id}'
+        },
         handler: 'turnOut'
     }],
 
@@ -104,7 +107,7 @@ Ext.define('saas.view.purchase.purchaseIn.FormPanel', {
     }, {
         name : "detailGridField", 
         xtype : "detailGridField",
-        storeModel:'saas.model.document.ProductDTO',
+        storeModel:'saas.model.purchase.ProdIODetail',
         // deleteDetailUrl:'http://localhost:8800/prodinout/deleteDetail/',
         deleteDetailUrl:'api/purchase/prodinout/deleteDetail/',
         detnoColumn:  'pd_pdno',
@@ -192,17 +195,28 @@ Ext.define('saas.view.purchase.purchaseIn.FormPanel', {
                 width : 120.0, 
                 items : null,
                 editor : {
-                    displayField : "display", 
-                    editable : true, 
-                    format : "", 
-                    hideTrigger : false, 
-                    maxLength : 100.0, 
-                    minValue : null, 
-                    positiveNum : false, 
-                    queryMode : "local", 
-                    store : null, 
-                    valueField : "value", 
-                    xtype : "dbfindtrigger"
+                    editable:false,
+                    xtype : "remotecombo", 
+                    storeUrl:'/api/document/warehouse/getCombo',
+                    name : "wh_name", 
+                    hiddenBtn:false,//true 则会关闭新增按钮功能
+                    addHandler:function(b){
+                        var document = Ext.create('saas.view.document.kind.Kind',{});
+                        var form =this.ownerCmp.ownerCt.ownerCmp.ownerCt;
+                        this.dialog = form.getController().getView().add({
+                            xtype: 'document-kind-childwin',
+                            bind: {
+                                title: '新增供应商类型'
+                            },
+                            dataKind:'warehouse',
+                            belong:document.etc['warehouse'],
+                            _parent:form,
+                            _combo:this.ownerCmp,
+                            record:null,
+                            session: true
+                        });
+                        this.dialog.show();
+                    }
                 }
             },
             {

+ 6 - 0
frontend/saas-web/app/view/purchase/purchaseIn/FormPanelController.js

@@ -215,6 +215,12 @@ Ext.define('saas.view.purchase.purchaseIn.FormPanelController', {
         })
         .then(function(localJson) {
             if(localJson.success){
+                var intValue = localJson.data.id,
+                codeValue= localJson.data.code,
+                name = localJson.data.name;
+                openTab('purchase-purchaseout-formpanel',name+"("+codeValue+")",codeValue+intValue, {
+                    initId: intValue
+                });
                 showToast('转单成功');
               
             }

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

@@ -99,7 +99,7 @@ Ext.define('saas.view.purchase.purchaseOut.FormPanel', {
     }, {
         name : "detailGridField", 
         xtype : "detailGridField",
-        storeModel:'saas.model.document.ProductDTO',
+        storeModel:'saas.model.purchase.ProdIODetail',
         // deleteDetailUrl:'http://localhost:8800/prodinout/deleteDetail/',
         deleteDetailUrl:'api/purchase/prodinout/deleteDetail/',
         detnoColumn:  'pd_pdno',

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно