Browse Source

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

hy 7 years ago
parent
commit
10730d344e
100 changed files with 1524 additions and 303 deletions
  1. 2 3
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/AddressController.java
  2. 2 3
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/FundinouttypeController.java
  3. 2 3
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/ProductbrandController.java
  4. 2 3
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/ProducttypeController.java
  5. 2 3
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/ProductunitController.java
  6. 2 3
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/VendorkindController.java
  7. 1 2
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/BankinformationMapper.java
  8. 3 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/AddressService.java
  9. 3 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/FundinouttypeService.java
  10. 3 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/ProductbrandService.java
  11. 3 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/ProducttypeService.java
  12. 3 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/ProductunitService.java
  13. 3 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/VendorkindService.java
  14. 7 4
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/AddressServiceImpl.java
  15. 7 4
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/FundinouttypeServiceImpl.java
  16. 5 4
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/ProductbrandServiceImpl.java
  17. 8 4
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/ProducttypeServiceImpl.java
  18. 7 4
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/ProductunitServiceImpl.java
  19. 1 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/VendorServiceImpl.java
  20. 8 4
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/VendorkindServiceImpl.java
  21. 0 10
      applications/document/document-server/src/main/resources/mapper/BankinformationMapper.xml
  22. 1 1
      applications/document/document-server/src/main/resources/mapper/BomMapper.xml
  23. 2 2
      applications/document/document-server/src/main/resources/mapper/CustomerListMapper.xml
  24. 1 0
      applications/document/document-server/src/main/resources/mapper/ProductMapper.xml
  25. 1 1
      applications/document/document-server/src/main/resources/mapper/VendorMapper.xml
  26. 1 1
      applications/document/document-server/src/main/resources/mapper/WarehouseMapper.xml
  27. 4 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/BanksubledgerMapper.java
  28. 5 5
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Paybalancedet.java
  29. 30 1
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/FundtransferServiceImpl.java
  30. 4 7
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/OthreceiptsServiceImpl.java
  31. 23 1
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/OthspendingsServiceImpl.java
  32. 6 6
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/PaybalanceServiceImpl.java
  33. 12 1
      applications/money/money-server/src/main/resources/mapper/BanksubledgerMapper.xml
  34. 1 5
      applications/money/money-server/src/main/resources/mapper/FundtransferMapper.xml
  35. 1 1
      applications/money/money-server/src/main/resources/mapper/FundtransferdetailMapper.xml
  36. 1 1
      applications/money/money-server/src/main/resources/mapper/OthreceiptsdetailMapper.xml
  37. 1 1
      applications/money/money-server/src/main/resources/mapper/OthspendingsdetailMapper.xml
  38. 1 1
      applications/money/money-server/src/main/resources/mapper/PaybalanceMapper.xml
  39. 13 13
      applications/money/money-server/src/main/resources/mapper/PaybalancedetMapper.xml
  40. 4 0
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/mapper/ProdInOutMapper.java
  41. 24 0
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/impl/ProdInOutServiceImpl.java
  42. 10 2
      applications/purchase/purchase-server/src/main/resources/mapper/ProdInOutMapper.xml
  43. 1 2
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/service/impl/SaleServiceImpl.java
  44. 2 2
      applications/sale/sale-server/src/main/resources/mapper/SaleMapper.xml
  45. 3 0
      applications/sale/sale-server/src/main/resources/mapper/SaledetailMapper.xml
  46. 3 3
      applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/controller/MakeController.java
  47. 3 0
      applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/mapper/ProdIODetailMapper.java
  48. 8 0
      applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/mapper/ProdInOutMapper.java
  49. 2 2
      applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/service/MakeService.java
  50. 56 30
      applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/service/impl/MakeServiceImpl.java
  51. 1 1
      applications/storage/storage-server/src/main/resources/mapper/MakeMapper.xml
  52. 1 0
      applications/storage/storage-server/src/main/resources/mapper/MakematerialMapper.xml
  53. 3 0
      applications/storage/storage-server/src/main/resources/mapper/ProdIODetailMapper.xml
  54. 16 3
      applications/storage/storage-server/src/main/resources/mapper/ProdInOutMapper.xml
  55. 1 1
      frontend/saas-web/app/model/money/PayBalance1.js
  56. 1 1
      frontend/saas-web/app/view/core/dbfind/DbfindTrigger.js
  57. 15 18
      frontend/saas-web/app/view/core/form/FormPanel.js
  58. 10 4
      frontend/saas-web/app/view/core/form/FormPanel.scss
  59. 2 3
      frontend/saas-web/app/view/core/report/ReportPanel.js
  60. 2 0
      frontend/saas-web/app/view/document/bom/FormController.js
  61. 54 18
      frontend/saas-web/app/view/document/bom/FormPanel.js
  62. 4 2
      frontend/saas-web/app/view/main/Main.js
  63. 24 5
      frontend/saas-web/app/view/main/Main.scss
  64. 4 2
      frontend/saas-web/app/view/main/MainContainerWrap.js
  65. 61 4
      frontend/saas-web/app/view/main/MainController.js
  66. 2 0
      frontend/saas-web/app/view/main/MainModel.js
  67. 33 17
      frontend/saas-web/app/view/main/Navigation.scss
  68. 3 3
      frontend/saas-web/app/view/money/fundtransfer/FormPanel.js
  69. 6 2
      frontend/saas-web/app/view/money/fundtransfer/FormPanelController.js
  70. 5 5
      frontend/saas-web/app/view/money/fundtransfer/QueryPanel.js
  71. 4 2
      frontend/saas-web/app/view/money/fundtransfer/QueryPanelModel.js
  72. 9 7
      frontend/saas-web/app/view/money/othreceipts/FormPanel.js
  73. 1 0
      frontend/saas-web/app/view/money/othreceipts/FormPanelController.js
  74. 4 2
      frontend/saas-web/app/view/money/othreceipts/QueryPanelModel.js
  75. 9 12
      frontend/saas-web/app/view/money/othspendings/FormPanel.js
  76. 13 1
      frontend/saas-web/app/view/money/othspendings/FormPanelController.js
  77. 4 2
      frontend/saas-web/app/view/money/othspendings/QueryPanelModel.js
  78. 2 7
      frontend/saas-web/app/view/money/payBalance/FormPanel.js
  79. 1 1
      frontend/saas-web/app/view/money/payBalance/FormPanelController.js
  80. 4 2
      frontend/saas-web/app/view/money/payBalance/QueryPanelModel.js
  81. 2 7
      frontend/saas-web/app/view/money/recBalance/FormPanel.js
  82. 4 2
      frontend/saas-web/app/view/money/recBalance/QueryPanelModel.js
  83. 1 1
      frontend/saas-web/app/view/purchase/purchase/FormPanel.js
  84. 1 1
      frontend/saas-web/app/view/purchase/purchase/QueryPanel.js
  85. 30 11
      frontend/saas-web/app/view/purchase/report/Purchase.js
  86. 76 1
      frontend/saas-web/app/view/purchase/report/PurchaseController.js
  87. 116 0
      frontend/saas-web/app/view/purchase/report/PurchasePay.js
  88. 80 0
      frontend/saas-web/app/view/purchase/report/PurchasePayController.js
  89. 4 0
      frontend/saas-web/app/view/purchase/report/PurchasePayModel.js
  90. 166 0
      frontend/saas-web/app/view/sale/report/Sale.js
  91. 107 0
      frontend/saas-web/app/view/sale/report/SaleController.js
  92. 7 2
      frontend/saas-web/app/view/sale/report/SaleIn.js
  93. 4 0
      frontend/saas-web/app/view/sale/report/SaleModel.js
  94. 108 0
      frontend/saas-web/app/view/sale/report/SaleProfit.js
  95. 206 0
      frontend/saas-web/app/view/sale/report/SaleProfitController.js
  96. 4 0
      frontend/saas-web/app/view/sale/report/SaleProfitModel.js
  97. 6 3
      frontend/saas-web/app/view/sale/sale/FormPanel.js
  98. 2 2
      frontend/saas-web/app/view/sale/sale/FormPanelController.js
  99. 0 1
      frontend/saas-web/app/view/sale/sale/FormPanelModel.js
  100. 3 3
      frontend/saas-web/app/view/sale/sale/QueryPanel.js

+ 2 - 3
applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/AddressController.java

@@ -18,8 +18,7 @@ public class AddressController {
 
     @PostMapping("/save")
     public Result save(@RequestBody Address address){
-        addressService.save(address);
-        return Result.success();
+        return Result.success(addressService.saveData(address));
     }
 
     @PostMapping("/delete/{id}")
@@ -36,7 +35,7 @@ public class AddressController {
 
     @GetMapping("/list")
     public Result<List<Address>> getAll(){
-        List<Address> addresseList = addressService.findAll();
+        List<Address> addresseList = addressService.selectAll();
         return Result.success(addresseList);
     }
 

+ 2 - 3
applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/FundinouttypeController.java

@@ -18,8 +18,7 @@ public class FundinouttypeController {
 
     @PostMapping("/save")
     public Result save(@RequestBody Fundinouttype fundinouttype){
-        fundinouttypeService.save(fundinouttype);
-        return Result.success();
+        return Result.success(fundinouttypeService.saveData(fundinouttype));
     }
 
     @PostMapping("/delete/{id}")
@@ -30,7 +29,7 @@ public class FundinouttypeController {
 
     @GetMapping("/list")
     public Result getAll(){
-        List<Fundinouttype> fundinouttypeList = fundinouttypeService.findAll();
+        List<Fundinouttype> fundinouttypeList = fundinouttypeService.selectAll();
         return Result.success(fundinouttypeList);
     }
 

+ 2 - 3
applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/ProductbrandController.java

@@ -22,8 +22,7 @@ public class ProductbrandController {
      */
     @PostMapping("/save")
     public Result save(@RequestBody Productbrand productbrand){
-        productbrandService.save(productbrand);
-        return Result.success();
+        return Result.success(productbrandService.saveData(productbrand));
     }
 
     /**
@@ -43,7 +42,7 @@ public class ProductbrandController {
      */
     @GetMapping("/list")
     public Result getAll(){
-        List<Productbrand> productbrandList = productbrandService.findAll();
+        List<Productbrand> productbrandList = productbrandService.selectAll();
         return Result.success(productbrandList);
     }
 

+ 2 - 3
applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/ProducttypeController.java

@@ -18,14 +18,13 @@ public class ProducttypeController {
 
     @GetMapping("/list")
     public Result<List<Producttype>> getAll(){
-        List<Producttype> producttypeList = producttypeService.findAll();
+        List<Producttype> producttypeList = producttypeService.selectAll();
         return Result.success(producttypeList);
     }
 
     @PostMapping("/save")
     public Result save(@RequestBody Producttype producttype){
-        producttypeService.save(producttype);
-        return Result.success();
+        return Result.success(producttypeService.saveData(producttype));
     }
 
     @PostMapping("/delete/{id}")

+ 2 - 3
applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/ProductunitController.java

@@ -19,8 +19,7 @@ public class ProductunitController {
 
     @PostMapping("/save")
     public Result save(@RequestBody Productunit productunit){
-        productunitService.save(productunit);
-        return Result.success();
+        return Result.success(productunitService.saveData(productunit));
     }
 
     @PostMapping("/delete/{id}")
@@ -31,7 +30,7 @@ public class ProductunitController {
 
     @GetMapping("/list")
     public Result getAll(){
-        List<Productunit> productunitList = productunitService.findAll();
+        List<Productunit> productunitList = productunitService.selectAll();
         return Result.success(productunitList);
     }
 

+ 2 - 3
applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/VendorkindController.java

@@ -17,8 +17,7 @@ public class VendorkindController {
 
     @PostMapping("/save")
     public Result save(@RequestBody Vendorkind vendorkind){
-        vendorkindService.save(vendorkind);
-        return Result.success();
+        return Result.success(vendorkindService.saveData(vendorkind));
     }
 
     @PostMapping("/delete/{id}")
@@ -29,7 +28,7 @@ public class VendorkindController {
 
     @GetMapping("/list")
     public Result<Vendorkind> getAll(){
-        List<Vendorkind> vendorkindList = vendorkindService.findAll();
+        List<Vendorkind> vendorkindList = vendorkindService.selectAll();
         return Result.success(vendorkindList);
     }
 

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

@@ -20,9 +20,8 @@ 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);
 
     List<ComboDTO> getCombo(@Param("companyId") Long companyId);
+
 }

+ 3 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/AddressService.java

@@ -2,6 +2,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.commons.dto.DocBaseDTO;
 import com.usoftchina.saas.document.entities.Address;
 import com.usoftchina.saas.document.mapper.AddressMapper;
 
@@ -14,4 +15,6 @@ public interface AddressService extends CommonBaseService<AddressMapper, Address
     List<ComboDTO> getCombo();
 
     List<Address> selectAll();
+
+    DocBaseDTO saveData(Address address);
 }

+ 3 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/FundinouttypeService.java

@@ -2,6 +2,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.commons.dto.DocBaseDTO;
 import com.usoftchina.saas.document.entities.Fundinouttype;
 import com.usoftchina.saas.document.mapper.FundinouttypeMapper;
 import org.apache.ibatis.annotations.Param;
@@ -13,4 +14,6 @@ public interface FundinouttypeService extends CommonBaseService<FundinouttypeMap
     List<ComboDTO> getCombo();
 
     List<Fundinouttype> selectAll();
+
+    DocBaseDTO saveData(Fundinouttype fundinouttype);
 }

+ 3 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/ProductbrandService.java

@@ -2,6 +2,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.commons.dto.DocBaseDTO;
 import com.usoftchina.saas.document.entities.Productbrand;
 import com.usoftchina.saas.document.mapper.ProductbrandMapper;
 
@@ -12,4 +13,6 @@ public interface ProductbrandService extends CommonBaseService<ProductbrandMappe
     List<ComboDTO> getCombo();
 
     List<Productbrand> selectAll();
+
+    DocBaseDTO saveData(Productbrand productbrand);
 }

+ 3 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/ProducttypeService.java

@@ -2,6 +2,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.commons.dto.DocBaseDTO;
 import com.usoftchina.saas.document.entities.Producttype;
 import com.usoftchina.saas.document.mapper.ProducttypeMapper;
 
@@ -12,4 +13,6 @@ public interface ProducttypeService extends CommonBaseService<ProducttypeMapper,
     List<ComboDTO> getCombo();
 
     List<Producttype> selectAll();
+
+    DocBaseDTO saveData(Producttype producttype);
 }

+ 3 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/ProductunitService.java

@@ -2,6 +2,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.commons.dto.DocBaseDTO;
 import com.usoftchina.saas.document.entities.Productunit;
 import com.usoftchina.saas.document.mapper.ProductunitMapper;
 
@@ -12,4 +13,6 @@ public interface ProductunitService extends CommonBaseService<ProductunitMapper,
     List<ComboDTO> getCombo();
 
     List<Productunit> selectAll();
+
+    DocBaseDTO saveData(Productunit productunit);
 }

+ 3 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/VendorkindService.java

@@ -2,6 +2,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.commons.dto.DocBaseDTO;
 import com.usoftchina.saas.document.entities.Vendorkind;
 import com.usoftchina.saas.document.mapper.VendorkindMapper;
 
@@ -12,4 +13,6 @@ public interface VendorkindService extends CommonBaseService<VendorkindMapper, V
     List<ComboDTO> getCombo();
 
     List<Vendorkind> selectAll();
+
+    DocBaseDTO saveData(Vendorkind vendorkind);
 }

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

@@ -32,7 +32,8 @@ public class AddressServiceImpl extends CommonBaseServiceImpl<AddressMapper, Add
      * @return
      */
     @Override
-    public boolean save(Address address){
+    public DocBaseDTO saveData(Address address){
+        DocBaseDTO docBaseDTO = new DocBaseDTO();
         if(address.getId() == 0){
             address.setCompanyId(BaseContextHolder.getCompanyId());
             address.setCreateTime(new Date());
@@ -41,7 +42,8 @@ public class AddressServiceImpl extends CommonBaseServiceImpl<AddressMapper, Add
             validName(address.getAd_address(), address.getId());
             addressMapper.insertSelective(address);
             //记录LOG
-            messageLogService.save(generateMsgObj(address.getId()));
+            docBaseDTO = generateMsgObj(address.getId());
+            messageLogService.save(docBaseDTO);
         }else{
             address.setUpdaterId(BaseContextHolder.getUserId());
             address.setUpdateTime(new Date());
@@ -49,9 +51,10 @@ public class AddressServiceImpl extends CommonBaseServiceImpl<AddressMapper, Add
             validName(address.getAd_address(), address.getId());
             addressMapper.updateByPrimaryKeySelective(address);
             //记录LOG
-            messageLogService.update(generateMsgObj(address.getId()));
+            docBaseDTO = generateMsgObj(address.getId());
+            messageLogService.update(docBaseDTO);
         }
-        return true;
+        return docBaseDTO;
     }
 
     /**

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

@@ -29,7 +29,8 @@ public class FundinouttypeServiceImpl extends CommonBaseServiceImpl<Fundinouttyp
      * @return
      */
     @Override
-    public boolean save(Fundinouttype fundinouttype){
+    public DocBaseDTO saveData(Fundinouttype fundinouttype){
+        DocBaseDTO docBaseDTO = new DocBaseDTO();
         if(fundinouttype.getId() == 0){
             fundinouttype.setCompanyId(BaseContextHolder.getCompanyId());
             fundinouttype.setCreatorId(BaseContextHolder.getUserId());
@@ -39,7 +40,8 @@ public class FundinouttypeServiceImpl extends CommonBaseServiceImpl<Fundinouttyp
 
             getMapper().insertSelective(fundinouttype);
             //记录LOG
-            messageLogService.save(generateMsgObj(fundinouttype.getId()));
+            docBaseDTO = generateMsgObj(fundinouttype.getId());
+            messageLogService.save(docBaseDTO);
         }else{
             fundinouttype.setUpdaterId(BaseContextHolder.getUserId());
             fundinouttype.setUpdateTime(new Date());
@@ -48,9 +50,10 @@ public class FundinouttypeServiceImpl extends CommonBaseServiceImpl<Fundinouttyp
 
             getMapper().updateByPrimaryKeySelective(fundinouttype);
             //记录LOG
-            messageLogService.update(generateMsgObj(fundinouttype.getId()));
+            docBaseDTO = generateMsgObj(fundinouttype.getId());
+            messageLogService.update(docBaseDTO);
         }
-        return true;
+        return docBaseDTO;
     }
 
     /**

+ 5 - 4
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/ProductbrandServiceImpl.java

@@ -27,7 +27,8 @@ public class ProductbrandServiceImpl extends CommonBaseServiceImpl<ProductbrandM
     private final String LOG_NAME = "ProductBrand";
 
     @Override
-    public boolean save(Productbrand productbrand){
+    public DocBaseDTO saveData(Productbrand productbrand){
+        DocBaseDTO docBaseDTO = null;
         productbrand.setCompanyId(BaseContextHolder.getCompanyId());
         if(productbrand.getId() == 0){
             productbrand.setCompanyId(BaseContextHolder.getCompanyId());
@@ -38,7 +39,7 @@ public class ProductbrandServiceImpl extends CommonBaseServiceImpl<ProductbrandM
 
             productbrandMapper.insertSelective(productbrand);
             //记录日志
-            DocBaseDTO docBaseDTO = new DocBaseDTO(productbrand.getId(), null, LOG_NAME);
+            docBaseDTO = new DocBaseDTO(productbrand.getId(), null, LOG_NAME);
             messageLogService.save(docBaseDTO);
         }else{
             productbrand.setUpdaterId(BaseContextHolder.getUserId());
@@ -47,10 +48,10 @@ public class ProductbrandServiceImpl extends CommonBaseServiceImpl<ProductbrandM
             validName(productbrand.getPb_name(), productbrand.getId());
             productbrandMapper.updateByPrimaryKeySelective(productbrand);
             //记录日志
-            DocBaseDTO docBaseDTO = new DocBaseDTO(productbrand.getId(), null, LOG_NAME);
+            docBaseDTO = new DocBaseDTO(productbrand.getId(), null, LOG_NAME);
             messageLogService.update(docBaseDTO);
         }
-        return true;
+        return docBaseDTO;
     }
 
     @Override

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

@@ -13,6 +13,7 @@ import com.usoftchina.saas.exception.BizException;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import javax.print.Doc;
 import java.util.Date;
 import java.util.List;
 
@@ -30,7 +31,8 @@ public class ProducttypeServiceImpl extends CommonBaseServiceImpl<ProducttypeMap
      * @return
      */
     @Override
-    public boolean save(Producttype producttype){
+    public DocBaseDTO saveData(Producttype producttype){
+        DocBaseDTO docBaseDTO = null;
         if(producttype.getId() == 0){
             producttype.setCompanyId(BaseContextHolder.getCompanyId());
             producttype.setCreatorId(BaseContextHolder.getUserId());
@@ -39,7 +41,8 @@ public class ProducttypeServiceImpl extends CommonBaseServiceImpl<ProducttypeMap
             validName(producttype.getPt_name(), producttype.getId());
             producttypeMapper.insertSelective(producttype);
             //记录LOG
-            messageLogService.save(generateMsgObj(producttype.getId()));
+            docBaseDTO = generateMsgObj(producttype.getId());
+            messageLogService.save(docBaseDTO);
         }else{
             producttype.setUpdaterId(BaseContextHolder.getUserId());
             producttype.setUpdateTime(new Date());
@@ -47,9 +50,10 @@ public class ProducttypeServiceImpl extends CommonBaseServiceImpl<ProducttypeMap
             validName(producttype.getPt_name(), producttype.getId());
             producttypeMapper.updateByPrimaryKeySelective(producttype);
             //记录LOG
-            messageLogService.update(generateMsgObj(producttype.getId()));
+            docBaseDTO = generateMsgObj(producttype.getId());
+            messageLogService.update(docBaseDTO);
         }
-        return true;
+        return docBaseDTO;
     }
 
     /**

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

@@ -23,7 +23,8 @@ public class ProductunitServiceImpl extends CommonBaseServiceImpl<ProductunitMap
     private MessageLogService messageLogService;
 
     @Override
-    public boolean save(Productunit productunit){
+    public DocBaseDTO saveData(Productunit productunit){
+        DocBaseDTO docBaseDTO = null;
         if(productunit.getId() == 0){
             productunit.setCompanyId(BaseContextHolder.getCompanyId());
             productunit.setCreatorId(BaseContextHolder.getUserId());
@@ -33,7 +34,8 @@ public class ProductunitServiceImpl extends CommonBaseServiceImpl<ProductunitMap
 
             getMapper().insertSelective(productunit);
             //记录LOG
-            messageLogService.save(generateMsgObj(productunit.getId()));
+            docBaseDTO = generateMsgObj(productunit.getId());
+            messageLogService.save(docBaseDTO);
         }else{
             productunit.setUpdaterId(BaseContextHolder.getUserId());
             productunit.setUpdateTime(new Date());
@@ -41,9 +43,10 @@ public class ProductunitServiceImpl extends CommonBaseServiceImpl<ProductunitMap
             validName(productunit.getPu_name(), productunit.getId());
             getMapper().updateByPrimaryKeySelective(productunit);
             //记录LOG
-            messageLogService.update(generateMsgObj(productunit.getId()));
+            docBaseDTO = generateMsgObj(productunit.getId());
+            messageLogService.update(docBaseDTO);
         }
-        return true;
+        return docBaseDTO;
     }
 
     @Override

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

@@ -260,9 +260,9 @@ public class VendorServiceImpl extends CommonBaseServiceImpl<VendorMapper, Vendo
 
     @Override
     public boolean deleteContact(Long id) {
-        vendorcontactMapper.deleteByPrimaryKey(id);
         Long ve_id = vendorcontactMapper.selectByPrimaryKey(id).getVc_veid();
         String code = getMapper().getCodeById(ve_id, BaseContextHolder.getCompanyId());
+        vendorcontactMapper.deleteByPrimaryKey(id);
         //记录LOG
         messageLogService.deleteDetail(generateMsgObj(id, code));
         return true;

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

@@ -13,6 +13,7 @@ import com.usoftchina.saas.exception.BizException;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import javax.print.Doc;
 import java.util.Date;
 import java.util.List;
 
@@ -25,7 +26,8 @@ public class VendorkindServiceImpl extends CommonBaseServiceImpl<VendorkindMappe
     private MessageLogService messageLogService;
 
     @Override
-    public boolean save(Vendorkind vendorkind){
+    public DocBaseDTO saveData(Vendorkind vendorkind){
+        DocBaseDTO docBaseDTO = null;
         if(vendorkind.getId() == 0){
             vendorkind.setCompanyId(BaseContextHolder.getCompanyId());
             vendorkind.setCreatorId(BaseContextHolder.getUserId());
@@ -34,7 +36,8 @@ public class VendorkindServiceImpl extends CommonBaseServiceImpl<VendorkindMappe
             validName(vendorkind.getVk_name(), vendorkind.getId());
             vendorkindMapper.insertSelective(vendorkind);
             //记录LOG
-            messageLogService.save(generateMsgObj(vendorkind.getId()));
+            docBaseDTO = generateMsgObj(vendorkind.getId());
+            messageLogService.save(docBaseDTO);
         }else{
             vendorkind.setUpdaterId(BaseContextHolder.getUserId());
             vendorkind.setUpdateTime(new Date());
@@ -42,9 +45,10 @@ public class VendorkindServiceImpl extends CommonBaseServiceImpl<VendorkindMappe
             validName(vendorkind.getVk_name(), vendorkind.getId());
             vendorkindMapper.updateByPrimaryKeySelective(vendorkind);
             //记录LOG
-            messageLogService.update(generateMsgObj(vendorkind.getId()));
+            docBaseDTO = generateMsgObj(vendorkind.getId());
+            messageLogService.update(docBaseDTO);
         }
-        return true;
+        return docBaseDTO;
     }
 
     @Override

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

@@ -292,16 +292,6 @@
       bk_remark = #{bkRemark,jdbcType=LONGVARCHAR}
     where bk_id = #{bkId,jdbcType=INTEGER}
   </update>
-  <update id="updateBankcode">
-    update bankinformation
-    set bk_thisamount = nvl(#{bk_thisamount,jdbcType=DOUBLE},0) ${symbol} #{nowbalance}
-    where bk_bankcode = #{bankcode,jdbcType=VARCHAR}
-  </update>
-
-  <select id="selectThisamount" resultType="java.lang.Double" parameterType="com.usoftchina.saas.document.entities.Bankinformation">
-   select bk_thisamount from bankinformation
-    where bk_bankcode = #{bankcode,jdbcType=VARCHAR}
-  </select>
 
   <select id="selectAll" resultMap="BaseResultMap">
     SELECT * FROM bankinformation

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

@@ -267,6 +267,6 @@
         AND companyId = #{companyId}
       </if>
     </where>
-    ORDER BY BO_ID
+    ORDER BY BO_ID DESC
   </select>
 </mapper>

+ 2 - 2
applications/document/document-server/src/main/resources/mapper/CustomerListMapper.xml

@@ -49,7 +49,7 @@
       <if test="companyId != null">
         and   customer.companyid = #{companyId}
       </if>
-    </where>  order by cu_id
+    </where>  order by cu_id DESC
   </select>
 
   <select id="selectDbFind" resultMap="BaseResultMap">
@@ -75,7 +75,7 @@
         and  companyid = #{companyId}
       </if>
     </where>
-    order by cu_id
+    order by cu_id DESC
   </select>
 
 

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

@@ -70,6 +70,7 @@
                 and  PRODUCT.companyid = #{companyId}
             </if>
         </where>
+        ORDER BY PR_ID DESC
     </select>
 
     <select id="getProdUnit" resultType="com.usoftchina.saas.commons.dto.ComboDTO">

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

@@ -50,7 +50,7 @@
                 AND companyId = #{companyId}
             </if>
         </where>
-        ORDER BY VE_ID
+        ORDER BY VE_ID DESC
     </select>
 
     <resultMap id="VendorListResultMapper" type="com.usoftchina.saas.document.entities.VendorList">

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

@@ -326,7 +326,7 @@
                 and  companyid = #{companyId}
             </if>
         </where>
-        order by wh_id
+        order by wh_id DESC
     </select>
 
     <select id="selectCountByName" resultType="int">

+ 4 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/BanksubledgerMapper.java

@@ -35,4 +35,8 @@ public interface BanksubledgerMapper extends CommonBaseMapper<Banksubledger> {
     int updateByPrimaryKeySelective(Banksubledger record);
 
     int updateByPrimaryKey(Banksubledger record);
+
+    int updateBankcode(@Param("bk_thisamount") Double bk_thisamount, @Param("nowbalance") Double nowbalance,
+                       @Param("bankcode") String bankcode, @Param("symbol") String symbol);
+    Double selectThisamount(String bankcode);
 }

+ 5 - 5
applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Paybalancedet.java

@@ -7,7 +7,7 @@ import java.util.Date;
 
 public class Paybalancedet extends CommonBaseEntity implements Serializable {
 
-    private Integer pd_rbid;
+    private Integer pd_pbid;
 
     private Integer pd_detno;
 
@@ -39,12 +39,12 @@ public class Paybalancedet extends CommonBaseEntity implements Serializable {
 
     private String pd_text5;
 
-    public Integer getPd_rbid() {
-        return pd_rbid;
+    public Integer getPd_pbid() {
+        return pd_pbid;
     }
 
-    public void setPd_rbid(Integer pd_rbid) {
-        this.pd_rbid = pd_rbid;
+    public void setPd_pbid(Integer pd_pbid) {
+        this.pd_pbid = pd_pbid;
     }
 
     public Integer getPd_detno() {

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

@@ -93,6 +93,20 @@ public class FundtransferServiceImpl implements FundtransferService {
         }else {
             fundtransferMapper.updateByPrimaryKeySelective(fundtransfer);
         }
+
+
+        //取从表金额
+        List<Fundtransferdetail> fundtransferdetailList = fundtran.getItems();
+        Iterator isList = fundtransferdetailList.iterator();
+        while (isList.hasNext()){
+            Fundtransferdetail fundtransferdetail = (Fundtransferdetail) isList.next();
+            Double amount = banksubledgerMapper.selectThisamount(fundtransferdetail.getFtd_bankcode());
+            Double inamount = banksubledgerMapper.selectThisamount(fundtransferdetail.getFtd_inbankcode());
+            banksubledgerMapper.updateBankcode(amount, fundtransferdetail.getFtd_nowbalance(),
+                    fundtransferdetail.getFtd_bankcode(), "-");
+            banksubledgerMapper.updateBankcode(inamount, fundtransferdetail.getFtd_nowbalance(),
+                    fundtransferdetail.getFtd_bankcode(), "+");
+        }
     }
 
     @Override
@@ -106,6 +120,20 @@ public class FundtransferServiceImpl implements FundtransferService {
         //删除中间表
         fundtransfer = fundtransferMapper.selectByPrimaryKey(id);
         banksubledgerMapper.deleteByPrimaryKey(fundtransfer.getFt_code(), "其他收入单");
+
+        //资金
+        //取从表金额
+        List<Fundtransferdetail> fundtransferdetailList = fundtransferdetailMapper.selectByPrimaryKey(id);
+        Iterator isList = fundtransferdetailList.iterator();
+        while (isList.hasNext()){
+            Fundtransferdetail fundtransferdetail = (Fundtransferdetail) isList.next();
+            Double amount = banksubledgerMapper.selectThisamount(fundtransferdetail.getFtd_bankcode());
+            Double inamount = banksubledgerMapper.selectThisamount(fundtransferdetail.getFtd_inbankcode());
+            banksubledgerMapper.updateBankcode(amount, fundtransferdetail.getFtd_nowbalance(),
+                    fundtransferdetail.getFtd_bankcode(), "+");
+            banksubledgerMapper.updateBankcode(inamount, fundtransferdetail.getFtd_nowbalance(),
+                    fundtransferdetail.getFtd_bankcode(), "-");
+        }
     }
 
 
@@ -140,7 +168,8 @@ public class FundtransferServiceImpl implements FundtransferService {
             fundtransfer.setFt_statuscode(Status.AUDITED.name());
             Fundtran fundtran = this.select(Math.toIntExact(fundtransfer.getId()));
             this.changBankUntil(fundtran);
-            fundtransferMapper.updateByPrimaryKeySelective(fundtransfer);
+            this.insert(fundtran);
+//            fundtransferMapper.updateByPrimaryKeySelective(fundtransfer);
         }
     }
 

+ 4 - 7
applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/OthreceiptsServiceImpl.java

@@ -10,7 +10,6 @@ import com.usoftchina.saas.commons.exception.BizExceptionCode;
 import com.usoftchina.saas.commons.po.BillCodeSeq;
 import com.usoftchina.saas.commons.po.Status;
 import com.usoftchina.saas.context.BaseContextHolder;
-import com.usoftchina.saas.document.mapper.BankinformationMapper;
 import com.usoftchina.saas.exception.BizException;
 import com.usoftchina.saas.money.mapper.BanksubledgerMapper;
 import com.usoftchina.saas.money.mapper.OthreceiptsMapper;
@@ -40,8 +39,6 @@ public class OthreceiptsServiceImpl implements OthreceiptsService {
     private MaxnumberService maxnumberService;
     @Autowired
     private BanksubledgerMapper banksubledgerMapper;
-    @Autowired
-    private BankinformationMapper bankinformationMapper;
 
     @Override
     public DocBaseDTO insert(Othte othte) {
@@ -98,13 +95,13 @@ public class OthreceiptsServiceImpl implements OthreceiptsService {
             othreceiptsMapper.updateByPrimaryKeySelective(othreceipts);
         }
 
-        Double amount = bankinformationMapper.selectThisamount(othreceipts.getOr_bankcode());
+        Double amount = banksubledgerMapper.selectThisamount(othreceipts.getOr_bankcode());
         //取从表金额
         List<Othreceiptsdetail> othreceiptsdetailList = othte.getItems();
         Iterator isList = othreceiptsdetailList.iterator();
         while (isList.hasNext()){
             Othreceiptsdetail othreceiptsdetail = (Othreceiptsdetail) isList.next();
-            bankinformationMapper.updateBankcode(amount, othreceiptsdetail.getOrd_nowbalance(),
+            banksubledgerMapper.updateBankcode(amount, othreceiptsdetail.getOrd_nowbalance(),
                     othreceipts.getOr_bankcode(), "+");
         }
     }
@@ -122,12 +119,12 @@ public class OthreceiptsServiceImpl implements OthreceiptsService {
         banksubledgerMapper.deleteByPrimaryKey(othreceipts.getOr_code(), "其他收入单");
 
         //更新资金
-        Double amount = bankinformationMapper.selectThisamount(othreceipts.getOr_bankcode());
+        Double amount = banksubledgerMapper.selectThisamount(othreceipts.getOr_bankcode());
         List<Othreceiptsdetail> othreceiptsdetailList = othreceiptsdetailMapper.selectByPrimaryKey(id);
         Iterator isList = othreceiptsdetailList.iterator();
         while (isList.hasNext()){
             Othreceiptsdetail othreceiptsdetail = (Othreceiptsdetail) isList.next();
-            bankinformationMapper.updateBankcode(amount, othreceiptsdetail.getOrd_nowbalance(),
+            banksubledgerMapper.updateBankcode(amount, othreceiptsdetail.getOrd_nowbalance(),
                     othreceipts.getOr_bankcode(), "-");
         }
 

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

@@ -122,6 +122,16 @@ public class OthspendingsServiceImpl implements OthspendingsService {
         }else {
             othspendingsMapper.updateByPrimaryKeySelective(othspendings);
         }
+
+        Double amount = banksubledgerMapper.selectThisamount(othspendings.getOs_bankcode());
+        //取从表金额
+        List<Othspendingsdetail> othspendingsdetailList = othsp.getItems();
+        Iterator isList = othspendingsdetailList.iterator();
+        while (isList.hasNext()){
+            Othspendingsdetail othspendingsdetail = (Othspendingsdetail) isList.next();
+            banksubledgerMapper.updateBankcode(amount, othspendingsdetail.getOsd_nowbalance(),
+                    othspendings.getOs_bankcode(), "+");
+        }
     }
 
     @Override
@@ -135,6 +145,17 @@ public class OthspendingsServiceImpl implements OthspendingsService {
         //删除中间表
         othspendings = othspendingsMapper.selectByPrimaryKey(id);
         banksubledgerMapper.deleteByPrimaryKey(othspendings.getOs_code(), "其他收入单");
+
+        //资金
+        Double amount = banksubledgerMapper.selectThisamount(othspendings.getOs_bankcode());
+        //取从表金额
+        List<Othspendingsdetail> othspendingsdetailList = othspendingsdetailMapper.selectByPrimaryKey(id);
+        Iterator isList = othspendingsdetailList.iterator();
+        while (isList.hasNext()){
+            Othspendingsdetail othspendingsdetail = (Othspendingsdetail) isList.next();
+            banksubledgerMapper.updateBankcode(amount, othspendingsdetail.getOsd_nowbalance(),
+                    othspendings.getOs_bankcode(), "-");
+        }
     }
 
     @Override
@@ -157,7 +178,8 @@ public class OthspendingsServiceImpl implements OthspendingsService {
             othspendings.setOs_statuscode(Status.AUDITED.name());
             Othsp othsp = this.select(Math.toIntExact(othspendings.getId()));
             this.changBankUntil(othsp);
-            othspendingsMapper.updateByPrimaryKeySelective(othspendings);
+            this.insert(othsp);
+//            othspendingsMapper.updateByPrimaryKeySelective(othspendings);
         }
     }
 

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

@@ -57,7 +57,7 @@ public class PaybalanceServiceImpl implements PaybalanceService {
 
         System.out.println("code:"+paybalance.getPb_code());
 
-        Long rbId = paybalance.getId();
+        Long pbId = paybalance.getId();
 
         //校验数据
         checkPaybalance(pay);
@@ -67,14 +67,14 @@ public class PaybalanceServiceImpl implements PaybalanceService {
         }else {
             paybalance.setCompanyId(BaseContextHolder.getCompanyId());
             paybalanceMapper.insertSelective(paybalance);
-            rbId = paybalance.getId();
-            System.out.println("rbid:" + rbId);
+            pbId = paybalance.getId();
+            System.out.println("rbid:" + pbId);
         }
 
         Iterator isdet = paybalancedet.iterator();
         while (isdet.hasNext()){
             Paybalancedet paybalancedet1 = (Paybalancedet) isdet.next();
-            paybalancedet1.setPd_rbid(Math.toIntExact(rbId));
+            paybalancedet1.setPd_pbid(Math.toIntExact(pbId));
             paybalancedet1.setCompanyId(BaseContextHolder.getCompanyId());
             if (paybalancedet1.getId() > 0 ){
                 paybalancedetMapper.updateByPrimaryKeySelective(paybalancedet1);
@@ -86,7 +86,7 @@ public class PaybalanceServiceImpl implements PaybalanceService {
         Iterator isdetl = paybalancedetail.iterator();
         while (isdetl.hasNext()){
             Paybalancedetail paybalancedetail1 = (Paybalancedetail) isdetl.next();
-            paybalancedetail1.setPbd_pbid(Math.toIntExact(rbId));
+            paybalancedetail1.setPbd_pbid(Math.toIntExact(pbId));
             paybalancedetail1.setCompanyId(BaseContextHolder.getCompanyId());
             if (paybalancedetail1.getId() > 0 ){
                 paybalancedetailMapper.updateByPrimaryKeySelective(paybalancedetail1);
@@ -94,7 +94,7 @@ public class PaybalanceServiceImpl implements PaybalanceService {
                 paybalancedetailMapper.insertSelective(paybalancedetail1);
             }
         }
-        return new DocBaseDTO(rbId, pb_code, BillCodeSeq.PAYBALANCE.getCaller());
+        return new DocBaseDTO(pbId, pb_code, BillCodeSeq.PAYBALANCE.getCaller());
     }
 
     /**

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

@@ -430,10 +430,21 @@
       updatedate = #{updatedate,jdbcType=TIMESTAMP}
     where bl_id = #{bl_id,jdbcType=INTEGER}
   </update>
-    <select id="selectCode" parameterType="java.lang.String" resultMap="BaseResultMap">
+    <select id="selectCode" parameterType="java.lang.String" resultType="java.lang.String">
         select bl_code
         from banksubledger
         where bl_code = #{bl_code,jdbcType=VARCHAR}
     </select>
 
+    <update id="updateBankcode">
+    update bankinformation
+    set bk_thisamount = (IFNULL(#{bk_thisamount,jdbcType=DOUBLE},0) ${symbol} #{nowbalance})
+    where bk_bankcode = #{bankcode,jdbcType=VARCHAR}
+  </update>
+
+    <select id="selectThisamount" resultType="java.lang.Double" parameterType="java.lang.String">
+   select bk_thisamount from bankinformation
+    where bk_bankcode = #{bankcode,jdbcType=VARCHAR}
+  </select>
+
 </mapper>

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

@@ -88,9 +88,7 @@
       <if test="updaterId != null" >
         updaterId,
       </if>
-      <if test="updatedate != null" >
         updatedate,
-      </if>
       <if test="ft_text1 != null" >
         ft_text1,
       </if>
@@ -138,9 +136,7 @@
       <if test="updaterId != null" >
         #{updaterId,jdbcType=INTEGER},
       </if>
-      <if test="updatedate != null" >
-        #{updatedate,jdbcType=TIMESTAMP},
-      </if>
+        #{now(),jdbcType=TIMESTAMP},
       <if test="ft_text1 != null" >
         #{ft_text1,jdbcType=VARCHAR},
       </if>

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

@@ -208,7 +208,7 @@
         ftd_detno = #{ftd_detno,jdbcType=INTEGER},
       </if>
       <if test="ftd_ym != null" >
-        ftd_ym = #{ftd_ym,jdbcType=INTEGER},
+        ftd_ym = to_char(#{ftd_ym,jdbcType=INTEGER},'yyyymm'),
       </if>
       <if test="ftd_bankid != null" >
         ftd_bankid = #{ftd_bankid,jdbcType=INTEGER},

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

@@ -150,7 +150,7 @@
         ord_detno = #{ord_detno,jdbcType=INTEGER},
       </if>
       <if test="ord_ym != null" >
-        ord_ym = #{ord_ym,jdbcType=INTEGER},
+        ord_ym = to_char(#{ord_ym,jdbcType=INTEGER},'yyyymm'),
       </if>
       <if test="ord_type != null" >
         ord_type = #{ord_type,jdbcType=VARCHAR},

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

@@ -156,7 +156,7 @@
         osd_detno = #{osd_detno,jdbcType=INTEGER},
       </if>
       <if test="osd_ym != null" >
-        osd_ym = #{osd_ym,jdbcType=INTEGER},
+        osd_ym = to_char(#{osd_ym,jdbcType=INTEGER}, 'yyyymm'),
       </if>
       <if test="osd_type != null" >
         osd_type = #{osd_type,jdbcType=VARCHAR},

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

@@ -444,7 +444,7 @@
   select
   <include refid="Base_Column_List" />
   from paybalance
-    left join paybalancedet on pb_id=pd_rbid left join paybalancedetail on pb_id=pbd_rbid
+    left join paybalancedet on pb_id=pd_pbid left join paybalancedetail on pb_id=pbd_rbid
     <where>
       <if test="con != null">
         ${con}

+ 13 - 13
applications/money/money-server/src/main/resources/mapper/PaybalancedetMapper.xml

@@ -3,7 +3,7 @@
 <mapper namespace="com.usoftchina.saas.money.mapper.PaybalancedetMapper" >
   <resultMap id="BaseResultMap" type="com.usoftchina.saas.money.po.Paybalancedet" >
     <id column="pd_id" property="id" jdbcType="INTEGER" />
-    <result column="pd_rbid" property="pd_rbid" jdbcType="INTEGER" />
+    <result column="pd_pbid" property="pd_pbid" jdbcType="INTEGER" />
     <result column="pd_detno" property="pd_detno" jdbcType="INTEGER" />
     <result column="pd_ym" property="pd_ym" jdbcType="INTEGER" />
     <result column="pd_bankid" property="pd_bankid" jdbcType="INTEGER" />
@@ -23,7 +23,7 @@
     <result column="pd_text5" property="pd_text5" jdbcType="VARCHAR" />
   </resultMap>
   <sql id="Base_Column_List" >
-    pd_id, pd_rbid, pd_detno, pd_ym, pd_bankid, pd_bankcode, pd_bankname, pd_amount, 
+    pd_id, pd_pbid, pd_detno, pd_ym, pd_bankid, pd_bankcode, pd_bankname, pd_amount,
     pd_paymethod, pd_paycode, pd_remark, companyId, updaterId, updatedate, pd_text1, 
     pd_text2, pd_text3, pd_text4, pd_text5
   </sql>
@@ -31,7 +31,7 @@
     select 
     <include refid="Base_Column_List" />
     from paybalancedet
-    where pd_rbid = #{id,jdbcType=INTEGER}
+    where pd_pbid = #{id,jdbcType=INTEGER}
   </select>
   <delete id="deleteItem" parameterType="java.lang.Integer" >
     delete from paybalancedet
@@ -40,12 +40,12 @@
 
   <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
     delete from paybalancedet
-    where pd_rbid = #{id,jdbcType=INTEGER}
+    where pd_pbid = #{id,jdbcType=INTEGER}
   </delete>
 
   <!--<insert id="insert" parameterType="com.usoftchina.saas.money.po.Paybalancedet" >-->
   <insert id="insert" parameterType="com.usoftchina.saas.money.po.Paybalancedet" >
-    insert into paybalancedet (pd_id, pd_rbid, pd_detno,
+    insert into paybalancedet (pd_id, pd_pbid, pd_detno,
       pd_ym, pd_bankid, pd_bankcode,
       pd_bankname, pd_amount, pd_paymethod,
       pd_paycode, pd_remark, companyId,
@@ -64,8 +64,8 @@
   <insert id="insertSelective" parameterType="com.usoftchina.saas.money.po.Paybalancedet" >
     insert into paybalancedet
     <trim prefix="(" suffix=")" suffixOverrides="," >
-      <if test="pd_rbid != null" >
-        pd_rbid,
+      <if test="pd_pbid != null" >
+        pd_pbid,
       </if>
       <if test="pd_detno != null" >
         pd_detno,
@@ -120,8 +120,8 @@
       </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides="," >
-      <if test="pd_rbid != null" >
-        #{pd_rbid,jdbcType=INTEGER},
+      <if test="pd_pbid != null" >
+        #{pd_pbid,jdbcType=INTEGER},
       </if>
       <if test="pd_detno != null" >
         #{pd_detno,jdbcType=INTEGER},
@@ -179,8 +179,8 @@
   <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.money.po.Paybalancedet" >
     update paybalancedet
     <set >
-      <if test="pd_rbid != null" >
-        pd_rbid = #{pd_rbid,jdbcType=INTEGER},
+      <if test="pd_pbid != null" >
+        pd_pbid = #{pd_pbid,jdbcType=INTEGER},
       </if>
       <if test="pd_detno != null" >
         pd_detno = #{pd_detno,jdbcType=INTEGER},
@@ -238,7 +238,7 @@
   </update>
   <update id="updateByPrimaryKey" parameterType="com.usoftchina.saas.money.po.Paybalancedet" >
     update paybalancedet
-    set pd_rbid = #{pdRbid,jdbcType=INTEGER},
+    set pd_pbid = #{pdPbid,jdbcType=INTEGER},
       pd_detno = #{pdDetno,jdbcType=INTEGER},
       pd_ym = #{pdYm,jdbcType=INTEGER},
       pd_bankid = #{pdBankid,jdbcType=INTEGER},
@@ -276,7 +276,7 @@
     select
     <include refid="Base_Column_List" />
     from paybalance
-    left join paybalancedet on pb_id=pd_rbid left join paybalancedetail on pb_id=pbd_rbid
+    left join paybalancedet on pb_id=pd_pbid left join paybalancedetail on pb_id=pbd_rbid
     <where>
       <if test="con != null">
         ${con}

+ 4 - 0
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/mapper/ProdInOutMapper.java

@@ -24,4 +24,8 @@ public interface ProdInOutMapper extends CommonBaseMapper<ProdInOut> {
     Integer validateCodeWhenUpdate(@Param("pi_inoutno") String pi_inoutno, @Param("id") Long id,@Param("companyId") Long companyId);
 
     String selectCodeById(Long id);
+
+    int checkQtyFromPurchase(String pu_code);
+
+    int checkQtyFromProdIn(String pu_code);
 }

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

@@ -192,6 +192,13 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         if (updateDetails.size()>0) {
             prodIODetailMapper.batchUpdate(updateDetails);
         }
+
+        //检查更新后数据是否
+        String pu_code = prodInOut.getPi_pucode();
+        if (!StringUtils.isEmpty(pu_code)){
+            checkUpdateQty(pu_code,pi_class);
+        }
+
         baseDTO = getBaseDTOById(pi_id,pi_class,pi_inoutno);
         //计算金额,未税单价,未税金额等
         calcProdInout(pi_id,pi_class);
@@ -202,6 +209,7 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         return baseDTO;
     }
 
+
     @Override
     @Transactional
     public void delete(Long id) {
@@ -358,6 +366,22 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         }
     }
 
+    private void checkUpdateQty(String pu_code, String pi_class) {
+        int count = 0;
+        if ("采购验收单".equals(pi_class)) {
+            count = getMapper().checkQtyFromPurchase(pu_code);
+            if (count>0){
+                throw new BizException(500, "明细行数量超过来源采购单明细行数量");
+            }
+        } else if ("采购验退单".equals(pi_class)) {
+            count = getMapper().checkQtyFromProdIn(pu_code);
+            if (count>0){
+                throw new BizException(500, "明细行数量超过来源采购验收单明细行数量");
+            }
+        }
+
+    }
+
 
 
     public void updateYqty(ProdInOut prodInOut) {

+ 10 - 2
applications/purchase/purchase-server/src/main/resources/mapper/ProdInOutMapper.xml

@@ -435,8 +435,16 @@
     select pi_inoutno from prodinout where pi_id=#{id}
   </select>
 
+  <select id="checkQtyFromPurchase" resultType="int" parameterType="string">
+  select count(1) from(
+  select sum(pd_inqty) nowqty,(select pd_qty from purchasedetail where pd_id = pd_orderid) totalqty   from prodiodetail   where pd_ordercode=#{pu_code}
+  GROUP BY pd_orderid) t  where t.nowqty>t.totalqty
+  </select>
 
-
-
+  <select id="checkQtyFromProdIn" resultType="int" parameterType="string">
+  select count(1) from(
+  select sum(b.pd_outqty) nowqty,(select a.pd_inqty from prodiodetail a where a.pd_id = b.pd_ioid and a.pd_piclass='采购验收单') totalqty from prodiodetail b where b.pd_ordercode=#{pu_code} and b.pd_piclass='采购验退单'
+  GROUP BY b.pd_ioid) t where t.nowqty>t.totalqty
+  </select>
 
 </mapper>

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

@@ -278,7 +278,7 @@ public class SaleServiceImpl implements SaleService{
         }
         //检测出货状态为未出货
         Integer num = saleMapper.checkSendStatus(id);
-        if (num == 0) {
+        if (num > 0) {
             throw new BizException(BizExceptionCode.SALEOUT_UNAUDIT_ERROR);
         }
         singleUnAudit(id);
@@ -478,7 +478,6 @@ public class SaleServiceImpl implements SaleService{
             //更新已转数
             saleDetail.setSd_yqty(saleDetail.getSd_qty());
             saledetailMapper.updateByPrimaryKeySelective(saleDetail);
-
         }
         //更新存在字段
         saleMapper.updateByPrimaryKeySelective(sale);

+ 2 - 2
applications/sale/sale-server/src/main/resources/mapper/SaleMapper.xml

@@ -385,7 +385,7 @@
   </update>
 
   <select id="checkSendStatus" parameterType="long" resultType="java.lang.Integer">
-    select count(1) from sale where sa_id = #{id}
-    and ifnull(sa_sendstatuscode,'UNTURNOUT') = 'UNTURNOUT';
+    select count(1) from saledetail where sd_said = #{id}
+    and ifnull(sd_yqty, 0) > 0;
   </select>
 </mapper>

+ 3 - 0
applications/sale/sale-server/src/main/resources/mapper/SaledetailMapper.xml

@@ -254,6 +254,9 @@
       <if test="sd_qty != null" >
         sd_qty = #{sd_qty,jdbcType=DOUBLE},
       </if>
+      <if test="sd_yqty != null" >
+        sd_yqty = #{sd_yqty,jdbcType=DOUBLE},
+      </if>
       <if test="sd_price != null" >
         sd_price = #{sd_price,jdbcType=DOUBLE},
       </if>

+ 3 - 3
applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/controller/MakeController.java

@@ -28,9 +28,9 @@ public class MakeController {
         return Result.success(makeListDTO);
     }
 
-    @PostMapping("/audit/{id}")
-    public Result audit(@PathVariable("id") Long id){
-        DocBaseDTO docBaseDTO = makeService.audit(id);
+    @PostMapping("/audit")
+    public Result audit(@RequestBody MakeListDTO makeListDTO){
+        DocBaseDTO docBaseDTO = makeService.audit(makeListDTO);
         return Result.success(docBaseDTO);
     }
 

+ 3 - 0
applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/mapper/ProdIODetailMapper.java

@@ -3,6 +3,7 @@ package com.usoftchina.saas.storage.mapper;
 
 import com.usoftchina.saas.base.mapper.CommonBaseMapper;
 import com.usoftchina.saas.storage.po.ProdIODetail;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 
@@ -34,4 +35,6 @@ public interface ProdIODetailMapper extends CommonBaseMapper<ProdIODetail> {
     void calcProdIn(Long pi_id);
 
     void calcProdOut(Long pi_id);
+
+    boolean deleteByInOutNo(@Param("code") String code, @Param("type") String type, @Param("companyId") Long companyId);
 }

+ 8 - 0
applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/mapper/ProdInOutMapper.java

@@ -5,6 +5,8 @@ import com.usoftchina.saas.base.mapper.CommonBaseMapper;
 import com.usoftchina.saas.storage.po.ProdInOut;
 import org.apache.ibatis.annotations.Param;
 
+import java.util.Map;
+
 public interface ProdInOutMapper extends CommonBaseMapper<ProdInOut> {
 
 
@@ -25,4 +27,10 @@ public interface ProdInOutMapper extends CommonBaseMapper<ProdInOut> {
     Integer validateCodeWhenUpdate(@Param("pi_inoutno") String pi_inoutno, @Param("id") Long id, @Param("companyId") Long companyId);
 
     String selectCodeById(Long id);
+
+    boolean deleteByInOutNo(@Param("code") String code, @Param("type") String type, @Param("companyId") Long companyId);
+
+    void post(Map<String, Object> map);
+
+    void unPost(Map<String, Object> map);
 }

+ 2 - 2
applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/service/MakeService.java

@@ -68,10 +68,10 @@ public interface MakeService extends CommonBaseService<MakeMapper, Make> {
 
     /**
      * 审核
-     * @param id
+     * @param makeListDTO
      * @return
      */
-    DocBaseDTO audit(Long id);
+    DocBaseDTO audit(MakeListDTO makeListDTO);
 
     /**
      * 反审核

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

@@ -28,6 +28,7 @@ import com.usoftchina.saas.storage.po.ProdInOut;
 import com.usoftchina.saas.storage.service.MakeService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Isolation;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.StringUtils;
 
@@ -87,7 +88,8 @@ public class MakeServiceImpl extends CommonBaseServiceImpl<MakeMapper, Make> imp
             String code = pushMaxnubmer(make.getMa_code(), make.getId());
             make.setMa_code(code);
             make.setCompanyId(BaseContextHolder.getCompanyId());
-            make.setCreateTime(new Date());
+            //make.setCreateTime(new Date());
+            make.setMa_recorddate(make.getCreateTime());
             make.setCreatorId(BaseContextHolder.getUserId());
 
             getMapper().insertSelective(make);
@@ -164,7 +166,12 @@ public class MakeServiceImpl extends CommonBaseServiceImpl<MakeMapper, Make> imp
             }
         }else if ("拆件".equals(make.getMa_type())){
             double qty = make.getMa_qty();
-            double onHand = getMapper().getOnHand(make.getMa_prodcode(),make.getMa_whcode(),BaseContextHolder.getCompanyId());
+            double onHand = 0;
+            try {
+                onHand = getMapper().getOnHand(make.getMa_prodcode(), make.getMa_whcode(), BaseContextHolder.getCompanyId());
+            }catch (Exception e){
+                throw new BizException(79402, make.getMa_prodcode() + ":库存不足");
+            }
             if(onHand < qty){
                 throw new BizException(79402, make.getMa_prodcode() + ":库存不足");
             }
@@ -215,24 +222,36 @@ public class MakeServiceImpl extends CommonBaseServiceImpl<MakeMapper, Make> imp
 
     @Override
     public boolean delete(Long id) {
+        DocBaseDTO docBaseDTO = generateMsgObj(id, getMapper().selectByPrimaryKey(id).getMa_code());
         getMapper().deleteByPrimaryKey(id);
         makeMaterialMapper.deleteByFK(id, BaseContextHolder.getCompanyId());
+        //记录LOG
+        messageLogService.delete(docBaseDTO);
         return true;
     }
 
     @Override
     public boolean deleteDetail(Long id) {
-        makeMaterialMapper.deleteByFK(id, BaseContextHolder.getCompanyId());
+        Long ma_id = makeMaterialMapper.selectByPrimaryKey(id).getMm_maid();
+        String code = getMapper().selectByPrimaryKey(ma_id).getMa_code();
+        makeMaterialMapper.deleteByPrimaryKey(id);
+        DocBaseDTO docBaseDTO = generateMsgObj(id, code);
+        //记录LOG
+        messageLogService.deleteDetail(docBaseDTO);
         return true;
     }
 
     @Override
-    @Transactional
-    public DocBaseDTO audit(Long id) {
+    @Transactional(rollbackFor = Exception.class)
+    public DocBaseDTO audit(MakeListDTO makeListDTO) {
         //1.获取主从表数据
-        Make make = getMapper().selectByPrimaryKey(id);
-        List<MakeMaterial> items = makeMaterialMapper.selectByFK(id, BaseContextHolder.getCompanyId());
-        MakeListDTO makeListDTO = new MakeListDTO(make, items);
+        Make make = makeListDTO.getMain();
+        List<MakeMaterial> items = makeListDTO.getItems();
+        //如果ID为0,先执行保存
+        if (makeListDTO.getMain().getId() == 0){
+            DocBaseDTO docBaseDTO = saveOrUpdate(makeListDTO);
+            make.setId(docBaseDTO.getId());
+        }
         //2.校验库存是否足够
         validStorage(makeListDTO);
         //3.生成  完工入库单和领料单 并 过账
@@ -243,7 +262,8 @@ public class MakeServiceImpl extends CommonBaseServiceImpl<MakeMapper, Make> imp
         make.setMa_statuscode(Status.AUDITED.name());
         make.setUpdateTime(new Date());
         make.setUpdaterId(BaseContextHolder.getUserId());
-        DocBaseDTO docBaseDTO = generateMsgObj(id, make.getMa_code());
+        getMapper().updateByPrimaryKeySelective(make);
+        DocBaseDTO docBaseDTO = generateMsgObj(make.getId(), make.getMa_code());
         //5.记录LOG
         messageLogService.audit(docBaseDTO);
         return docBaseDTO;
@@ -311,9 +331,9 @@ public class MakeServiceImpl extends CommonBaseServiceImpl<MakeMapper, Make> imp
             map.put("commitid", BaseContextHolder.getUserId());
             map.put("companyId", BaseContextHolder.getCompanyId());
             map.put("result", null);
-            Result result = warehouseApi.post(map);
-            if (!StringUtils.isEmpty(result.getData())){
-                throw new BizException(76201, result.getData().toString());
+            prodInOutMapper.post(map);
+            if (!StringUtils.isEmpty(map.get("result"))){
+                throw new BizException(76201, map.get("result").toString());
             }
             /** 2.完工入库单 **/
             //a.主表
@@ -360,9 +380,9 @@ public class MakeServiceImpl extends CommonBaseServiceImpl<MakeMapper, Make> imp
             map.put("commitid", BaseContextHolder.getUserId());
             map.put("companyId", BaseContextHolder.getCompanyId());
             map.put("result", null);
-            result = warehouseApi.post(map);
-            if (!StringUtils.isEmpty(result.getData())){
-                throw new BizException(76202, result.getData().toString());
+            prodInOutMapper.post(map);
+            if (!StringUtils.isEmpty(map.get("result"))){
+                throw new BizException(76201, map.get("result").toString());
             }
         }else if ("拆件".equals(make.getMa_type())){
             /** 1.生产领料单 **/
@@ -412,9 +432,9 @@ public class MakeServiceImpl extends CommonBaseServiceImpl<MakeMapper, Make> imp
             map.put("commitid", BaseContextHolder.getUserId());
             map.put("companyId", BaseContextHolder.getCompanyId());
             map.put("result", null);
-            Result result = warehouseApi.post(map);
-            if (!StringUtils.isEmpty(result.getData())){
-                throw new BizException(76201, result.getData().toString());
+            prodInOutMapper.post(map);
+            if (!StringUtils.isEmpty(map.get("result"))){
+                throw new BizException(76201, map.get("result").toString());
             }
             /** 2.完工入库单 **/
             //a.主表
@@ -467,15 +487,15 @@ public class MakeServiceImpl extends CommonBaseServiceImpl<MakeMapper, Make> imp
             map.put("commitid", BaseContextHolder.getUserId());
             map.put("companyId", BaseContextHolder.getCompanyId());
             map.put("result", null);
-            result = warehouseApi.post(map);
-            if (!StringUtils.isEmpty(result.getData())){
-                throw new BizException(76202, result.getData().toString());
+            prodInOutMapper.post(map);
+            if (!StringUtils.isEmpty(map.get("result"))){
+                throw new BizException(76202, map.get("result").toString());
             }
         }
     }
 
     @Override
-    @Transactional
+    @Transactional(rollbackFor = Exception.class)
     public DocBaseDTO resAudit(Long id) {
         //1.获取主从表数据
         Make make = getMapper().selectByPrimaryKey(id);
@@ -492,6 +512,7 @@ public class MakeServiceImpl extends CommonBaseServiceImpl<MakeMapper, Make> imp
         make.setMa_statuscode(Status.UNAUDITED.name());
         make.setUpdateTime(new Date());
         make.setUpdaterId(BaseContextHolder.getUserId());
+        getMapper().updateByPrimaryKeySelective(make);
         DocBaseDTO docBaseDTO = generateMsgObj(id, make.getMa_code());
         //6.记录LOG
         messageLogService.unAudit(docBaseDTO);
@@ -544,26 +565,31 @@ public class MakeServiceImpl extends CommonBaseServiceImpl<MakeMapper, Make> imp
     private void selectProdIO(Make make) {
         String code = make.getMa_code();
         Long companyId = BaseContextHolder.getCompanyId();
-        String InCode = getMapper().selectMakeInOutCode(code, companyId, "完工入库单");
+        String inCode = getMapper().selectMakeInOutCode(code, companyId, "完工入库单");
         String outCode = getMapper().selectMakeInOutCode(code, companyId, "生产领料单");
         Map<String, Object> map = new HashMap<String, Object>();
-        map.put("inoutNo", InCode);
+        map.put("inoutNo", inCode);
         map.put("class", "完工入库单");
         map.put("commitid", BaseContextHolder.getUserId());
         map.put("companyId", companyId);
         map.put("result", null);
         //完工入库单反过账
-        Result result = warehouseApi.unPost(map);
-        if(!StringUtils.isEmpty(result)){
-            throw new BizException(76203, result.getData().toString());
+        prodInOutMapper.unPost(map);
+        if(!StringUtils.isEmpty(map.get("result"))){
+            throw new BizException(76203, map.get("result").toString());
         }
+        prodInOutMapper.deleteByInOutNo(inCode, "完工入库单", BaseContextHolder.getCompanyId());
+        prodIODetailMapper.deleteByInOutNo(inCode, "完工入库单", BaseContextHolder.getCompanyId());
+
         map.put("inoutNo", outCode);
         map.put("class", "生产领料单");
         //生产领料单反过账
-        result = warehouseApi.unPost(map);
-        if(!StringUtils.isEmpty(result)){
-            throw new BizException(76204, result.getData().toString());
+        prodInOutMapper.unPost(map);
+        if(!StringUtils.isEmpty(map.get("result"))){
+            throw new BizException(76204, map.get("result").toString());
         }
+        prodInOutMapper.deleteByInOutNo(outCode, "生产领料单", BaseContextHolder.getCompanyId());
+        prodIODetailMapper.deleteByInOutNo(outCode, "生产领料单", BaseContextHolder.getCompanyId());
     }
 
     /**

+ 1 - 1
applications/storage/storage-server/src/main/resources/mapper/MakeMapper.xml

@@ -380,7 +380,7 @@
   </select>
 
     <select id="getOnHand" resultType="double">
-        SELECT PW_ONHAND FROM PRODUCTWH WHERE PW_PRODCODE=#{prodcode} AND PW_WHCODE=#{whcode} and COMPANYID=#{companyId}
+        SELECT IFNULL(PW_ONHAND,0) FROM PRODUCTWH WHERE PW_PRODCODE=#{prodcode} AND PW_WHCODE=#{whcode} and COMPANYID=#{companyId}
     </select>
 
     <select id="selectMakeInOutCode" resultType="string">

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

@@ -334,6 +334,7 @@
           updateTime = #{item.updateTime,jdbcType=TIMESTAMP},
         </if>
       </set>
+        where mm_id=#{item.id}
     </foreach>
   </update>
 </mapper>

+ 3 - 0
applications/storage/storage-server/src/main/resources/mapper/ProdIODetailMapper.xml

@@ -752,4 +752,7 @@
     update prodinout set pi_nettotal = (select sum(pd_nettotal) from prodiodetail where pd_piid = #{pi_id,jdbcType=INTEGER} ) where pi_id = #{pi_id,jdbcType=INTEGER};
   </update>
 
+  <delete id="deleteByInOutNo" >
+      DELETE FROM prodiodetail WHERE PD_INOUTNO=#{code} AND PD_PICLASS=#{type} AND COMPANYID=#{companyId}
+  </delete>
 </mapper>

+ 16 - 3
applications/storage/storage-server/src/main/resources/mapper/ProdInOutMapper.xml

@@ -435,8 +435,21 @@
     select pi_inoutno from prodinout where pi_id=#{id}
   </select>
 
+  <delete id="deleteByInOutNo" >
+      DELETE FROM prodinout WHERE PI_CLASS=#{type} AND PI_INOUTNO=#{code} AND COMPANYID=#{companyId}
+  </delete>
 
-
-
-
+    <select id="post" parameterMap="postParamMap" statementType="CALLABLE">
+        CALL SP_COMMITPRODINOUT(?, ?, ?, ?, ?)
+    </select>
+    <select id="unPost" parameterMap="postParamMap" statementType="CALLABLE">
+        CALL SP_UNCOMMITPRODINOUT(?, ?, ?, ?, ?)
+    </select>
+    <parameterMap id="postParamMap" type="java.util.Map">
+        <parameter property="inoutNo" jdbcType="VARCHAR" mode="IN" />
+        <parameter property="class" jdbcType="VARCHAR" mode="IN" />
+        <parameter property="commitid" jdbcType="INTEGER" mode="IN" />
+        <parameter property="companyId" jdbcType="INTEGER" mode="IN" />
+        <parameter property="result" jdbcType="VARCHAR" mode="OUT" />
+    </parameterMap>
 </mapper>

+ 1 - 1
frontend/saas-web/app/model/money/PayBalance1.js

@@ -3,7 +3,7 @@ Ext.define('saas.model.money.PayBalance1', {
     fields: [
         { name: 'id', type: 'int' },
         { name: 'pd_id', type: 'int' },
-        { name: 'pd_rbid', type: 'int' },
+        { name: 'pd_pbid', type: 'int' },
         { name: 'pd_detno', type: 'int' },
         { name: 'pd_ym', type: 'int' },
         { name: 'pd_bankid', type: 'int' },

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

@@ -164,7 +164,7 @@ Ext.define('saas.view.core.dbfind.DbfindTrigger', {
         if(f.ownerCt.xtype.trim().toUpperCase().indexOf('QUERYFORMPANEL')>-1){
             f.belong = 'form';
             return f.ownerCt.ownerCt
-        }else if(f.ownerCt.xtype.trim().toUpperCase().indexOf('FORMPANEL')>-1){
+        }else if(f.ownerCt.xtype.trim().toUpperCase().indexOf('FORM')>-1){
             f.belong = 'form';
             return f.ownerCt
         }else if(f.column){

+ 15 - 18
frontend/saas-web/app/view/core/form/FormPanel.js

@@ -21,7 +21,6 @@ Ext.define('saas.view.core.form.FormPanel', {
     initId: 0,
     layout: 'column',
     autoScroll: true,
-    border: 1,
     bodyPadding: 5,
 
     fieldDefaults: {
@@ -94,9 +93,6 @@ Ext.define('saas.view.core.form.FormPanel', {
             dockedItems: [{
                 xtype: 'toolbar',
                 dock: 'top',
-                style: {
-                    'border-bottom': '1px solid #35baf6 !important'
-                },
                 items: me.getToolBarItems(),
             }],
             listeners: {
@@ -331,23 +327,24 @@ Ext.define('saas.view.core.form.FormPanel', {
                 return;
             }
 
-            // 设置model绑定
-            if (!ignore) {
-                if (bind) {
-                    if (!Ext.isString(bind)) {
-                        Ext.apply(bind, {
-                            value: '{' + name + '}'
-                        });
-                    } else {
-                        item.bind = '{' + name + '}';
-                    }
+            if (bind) {
+                if (!Ext.isString(bind)) {
+                    Ext.apply(bind, {
+                        value: '{' + name + '}'
+                    });
                 } else {
                     item.bind = '{' + name + '}';
                 }
-                // 设置默认值
-                if (defaultValue) {
-                    viewModel.set(name, defaultValue);
-                }
+            } else {
+                item.bind = '{' + name + '}';
+            }
+            // 设置默认值
+            if (defaultValue) {
+                viewModel.set(name, defaultValue);
+            }
+
+            // 设置model绑定
+            if (!ignore) {
                 if(!Ext.Array.contains(bindFields, name)) {
                     bindFields.push(name);
                 }

+ 10 - 4
frontend/saas-web/app/view/core/form/FormPanel.scss

@@ -1,17 +1,19 @@
 .x-core-form {
+    padding: 10px;
 
     .x-tb {
-        color: #AEB1B5;
+        color: #A2A2A2;
+        // letter-spacing: 0.72px;
+        // text-align: left;
+        font-size: 16px;
     }
     .x-no {
-        font-size: 18px;
     }
     .x-code {
-        font-size: 16px;
     }
     .x-codeeditor {
         top: 0px !important;
-        left: 43px !important;
+        left: 39px !important;
 
         .x-form-trigger-wrap {
             border-top: none;
@@ -36,6 +38,10 @@
             color: #52C41A;
         }
 
+        .fa-edit {
+            color: #A2A2A2;
+        }
+
         &:hover {
             .fa-edit {
                 color: black;

+ 2 - 3
frontend/saas-web/app/view/core/report/ReportPanel.js

@@ -24,9 +24,8 @@ Ext.define('saas.view.core.report.ReportPanel', {
 
     initComponent: function() {
         var me = this;
-
         var store = me.initStore();
-
+        columnWidth: 0.25,
         Ext.apply(me, {
             items: [{
                 xtype: 'form',
@@ -40,7 +39,7 @@ Ext.define('saas.view.core.report.ReportPanel', {
                 },
                 items: me.initSearchItems().concat([{
                     xtype: 'container',
-                    columnWidth: 0.5,
+                    columnWidth: me.QueryWidth || 0.5,
                     items: [{
                         xtype: 'button',
                         text: '查询',

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

@@ -22,6 +22,8 @@ Ext.define('saas.view.document.bom.FormController', {
                             from:'pr_spec',to:'pr_spec'
                         },{
                             from:'pr_unit',to:'bd_unit'
+                        },{
+                            from:'id',to:'bd_sonid',ignore:true 
                         }],
                         //联想设置
                         dbtpls:[{

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

@@ -57,12 +57,12 @@ Ext.define('saas.view.document.bom.FormPanel', {
     },{
         xtype: 'textfield',
         name: 'bo_mothername',
-        fieldLabel: 'BOM名称',
+        fieldLabel: '母件名称',
         allowBlank: false
     },{
         xtype: 'textfield',
         name: 'bo_mothercode',
-        fieldLabel: 'BOM编号',
+        fieldLabel: '母件编号',
         allowBlank: false
     },{
         xtype: 'textfield',
@@ -73,13 +73,9 @@ Ext.define('saas.view.document.bom.FormPanel', {
         name: 'bo_statuscode',
         fieldLabel: '状态码'
     },{
-        xtype : "datefield", 
-        name : "createTime", 
-        fieldLabel : "创建时间"
-    },{  
-        xtype : "datefield", 
-        name : "updateTime", 
-        fieldLabel : "更新时间"
+        xtype: 'textfield',
+        name: 'bo_version',
+        fieldLabel: '版本'
     }, {
         xtype : "detailGridField",
         detnoColumn: 'bd_detno',
@@ -101,7 +97,7 @@ Ext.define('saas.view.document.bom.FormPanel', {
             },
             {
                 allowBlank:false,
-                text : "子件编号", 
+                text : "物料编号", 
                 dataIndex : "bd_soncode", 
                 editor : {
                     displayField : "display", 
@@ -116,8 +112,26 @@ Ext.define('saas.view.document.bom.FormPanel', {
                     valueField : "value", 
                     xtype : "multidbfindtrigger"
                 }
-            },
-            {
+            }, {
+                allowBlank:false,
+                text : "物料ID", 
+                hidden : true, 
+                dataIndex : "bd_sonid", 
+            }, {
+                text : "物料名称", 
+                dataIndex : "pr_detail",
+                ignore:true,
+                renderer: function (v, m, r) {
+                    return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:v;
+                }
+            }, {
+                text : "物料规格", 
+                dataIndex : "pr_spec",
+                ignore:true,
+                renderer: function (v, m, r) {
+                    return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:v;
+                }
+            }, {
                 allowBlank:false,
                 text : "单位", 
                 editor : {
@@ -127,14 +141,20 @@ Ext.define('saas.view.document.bom.FormPanel', {
             },
             {
                 allowBlank:false,
-                text : "单位用量", 
+                text : "用量", 
+                dataIndex : "bd_baseqty",
                 editor : {
-                    xtype : "textfield"
+                    xtype : "numberfield",
+                    decimalPrecision: 3,
+                    minValue:0
                 },
-                dataIndex : "bd_baseqty", 
-            },
-            {
-                allowBlank:false,
+                renderer : function(v) {
+                    var arr = (v + '.').split('.');
+                    var xr = (new Array(arr[1].length)).fill('0');
+                    var format = '0.' + xr.join();
+                    return Ext.util.Format.number(v, format);
+                }
+            }, {
                 text : "替代料", 
                 dataIndex : "bd_replace", 
                 editor : {
@@ -150,7 +170,23 @@ Ext.define('saas.view.document.bom.FormPanel', {
                     valueField : "value", 
                     xtype : "multidbfindtrigger"
                 }
+            }, {
+                text : "备注", 
+                dataIndex : "bd_remark",
+                width : 250, 
+                items : null,
+                editor : {
+                    xtype : "textfield"
+                },
             }]
+    },{
+        xtype : "datefield", 
+        name : "createTime", 
+        fieldLabel : "创建时间"
+    },{  
+        xtype : "datefield", 
+        name : "updateTime", 
+        fieldLabel : "更新时间"
     }],
 
     auditTexts: {

+ 4 - 2
frontend/saas-web/app/view/main/Main.js

@@ -30,8 +30,10 @@ Ext.define('saas.view.main.Main', {
                     xtype: 'component',
                     reference: 'mainLogo',
                     cls: 'main-logo-wrap',
-                    html: '<div class="main-logo"><img src="resources/images/default/logo-default.png">优企云服</div>',
-                    width: 160
+                    html: '<div class="main-logo"><img src="resources/images/default/logo-default.png"/><div class="logo-text">优企云服</div></div>',
+                    bind: {
+                        width: '{navWidth}'
+                    }
                 },
                 {
                     margin: '0 0 0 8',

+ 24 - 5
frontend/saas-web/app/view/main/Main.scss

@@ -41,9 +41,19 @@ $treelist-nav-ui: (
     padding-left: 10px;
 }
 
+.main-right-tabpanel {
+    
+    .x-panel-bodyWrap {
+
+        #main-tab-panel-body {
+            background: #EEF4F9;
+        }
+    }
+}
+
 .main-logo-wrap {
     background-color: $base-color;
-    height: 65px;
+    height: 70px;
 
     font-size: 16px;
     font-weight: $font-weight-bold;
@@ -51,14 +61,23 @@ $treelist-nav-ui: (
     margin-left: 17px;
 
     .main-logo {
-        line-height: 65px;
+        background: #34BAF6;
 
         img {
-            margin-left: 15px;
-            margin-right: 15px;
-            top: 10px;
+            width: 64px;
+            top: 0px;
+            left: 20px;
             position: relative;
         }
+
+        .logo-text {
+            font-size: 18px;
+            color: #FFFFFF;
+            text-align: left;
+            top: 23px;
+            position: absolute;
+            right: 28px;
+        }
     }
 }
 

+ 4 - 2
frontend/saas-web/app/view/main/MainContainerWrap.js

@@ -15,7 +15,9 @@ Ext.define('saas.view.main.MainContainerWrap', {
         {
             xtype: 'main-navigation',
             region: 'west',
-            width: 160,
+            bind: {
+                width: '{navWidth}'
+            }
         },
         {
             xtype: 'tabpanel',
@@ -27,7 +29,7 @@ Ext.define('saas.view.main.MainContainerWrap', {
             itemId: 'contentPanel',
             defaults: {
                 closable: true,
-                margin: 10
+                margin: 20
             },
             plugins: [new Ext.ux.TabCloseMenu({
                 closeTabText: '关闭当前页',

+ 61 - 4
frontend/saas-web/app/view/main/MainController.js

@@ -30,19 +30,76 @@ Ext.define('saas.view.main.MainController', {
 
     onToggleNavigationSize: function () {
         var me = this,
+        viewModel = me.getViewModel(),
         refs = me.getReferences(),
         navigationList = refs.navigationTreeList,
         navCollapsed = !navigationList.navCollapsed,
-        new_width = navCollapsed ? 64 : 160,
+        new_width = navCollapsed ? viewModel.get('smallNavWidth') : viewModel.get('navWidth'),
+        newLogoImgStyle = navCollapsed ? {
+            width: 50,
+            top: 7,
+            left: 6
+        } : {
+            width: 64,
+            top: 0,
+            left: 20
+        },
+        newLogoTextStyle = navCollapsed ? {
+            10: {
+                opacity: 0.7
+            },
+            30: {
+                opacity: 0
+            },
+            100: {
+                opacity: 0
+            }
+        } : {
+            25: {
+                opacity: 0 
+            },
+            50: {
+                opacity: 1
+            }
+        },
+        newNavIconStyle = navCollapsed ? {
+            marginLeft: 6,
+            fontSize: 28
+        } : {
+            marginLeft: 40,
+            fontSize: 24
+        },
+        newNavTextStyle = navCollapsed ? {
+            opacity: 0
+        } : {
+            opacity: 1
+        },
         ope = navCollapsed ? 'addCls' : 'removeCls';
         
-        refs.mainLogo.animate({dynamic: true, to: {width: new_width}});
-        navigationList.body.animate({dynamic: true, to: {width: new_width}});
-        navigationList.animate({dynamic: true, to: {width: new_width}});
+        var mainLogo = refs.mainLogo;
+        var logoImg = mainLogo.el.dom.getElementsByTagName('img')[0];
+        var logoText = mainLogo.el.dom.getElementsByClassName('logo-text')[0];
+        var navItems = navigationList.el.dom.getElementsByClassName('x-navitem');
+
+        mainLogo.animate({dynamic: true, duration: 500, to: {width: new_width}});
+        Ext.fly(logoImg).animate({dynamic: true, duration: 500, to: newLogoImgStyle});
+        Ext.fly(logoText).animate({dynamic: true, duration: 500, keyframes: newLogoTextStyle});
+        navigationList.body.animate({dynamic: true, duration: 500, to: {width: new_width}});
+        navigationList.animate({dynamic: true, duration: 500, to: {width: new_width}});
+
+        for(var i = 0; i < navItems.length; i++) {
+            var item = navItems[i];
+            var icon = item.getElementsByClassName('nav-inner-icon')[0];
+            var text = item.getElementsByClassName('nav-inner-text')[0];
+
+            Ext.fly(icon).animate({dynamic: true, duration: 500, to: newNavIconStyle});
+            Ext.fly(text).animate({dynamic: true, duration: 500, to: newNavTextStyle});
+        }
 
         navigationList.el[ope]('nav-collapsed');
 
         navigationList.navCollapsed = navCollapsed;
+
     },
 
     selectCompany: function(item) {

+ 2 - 0
frontend/saas-web/app/view/main/MainModel.js

@@ -7,5 +7,7 @@ Ext.define('saas.view.main.MainModel', {
     alias: 'viewmodel.main',
 
     data: {
+        navWidth: 200,
+        smallNavWidth: 64,
     }
 });

+ 33 - 17
frontend/saas-web/app/view/main/Navigation.scss

@@ -1,3 +1,6 @@
+$nav-font-size: 16px;
+$nav-font-color: #FFFFFF;
+
 .x-navpanel {
     overflow: visible;
 
@@ -14,7 +17,7 @@
             overflow: visible;
     
             .x-autocontainer-outerCt {
-                background-color: #3C4A57;
+                background-color: #484A69;
     
                 .x-autocontainer-innerCt {
     
@@ -34,45 +37,58 @@
                             outline: none !important;
                             
                             .x-navitem-body {
-                                background-color: #3C4A57;
+                                background: #505275;
     
                                 .nav-inner-wrap {
-                                    position: relative;
                                     position: relative;
                                     overflow: hidden;
                                     list-style: none;
-                                    max-height: 64px;
+                                    max-height: 60px;
                                     padding: 0 10px;
     
                                     .nav-inner-icon {
-                                        color: #adb3b8;
-                                        font-size: 18px;
+                                        opacity: 0.4;
+
+                                        color: $nav-font-color;
+                                        font-size: 24px;
                                         text-align: center;
-                                        background-repeat: no-repeat;
-                                        background-position: 0 center;
-                                        margin-left: 10px;
+                                        margin-left: 40px;
                                         display: inline;
+                                        margin-right: 42px;
     
                                         &:before {
-                                            line-height: 64px;
+                                            line-height: 60px;
                                         }
                                     }
     
                                     .nav-inner-text {
-                                        cursor: default;
-                                        color: #adb3b8;
-                                        margin-left: 20px;
-                                        margin-right: 24px;
-                                        font-size: 14px;
-                                        line-height: 64px;
+                                        font-size: $nav-font-size;
+                                        color: $nav-font-color;
+                                        letter-spacing: 0.64px;
+                                        text-align: left;
+                                        opacity: 0.46;
                                         display: inline;
+                                        line-height: 60px;
+
                                     }
                                 }
                             }
                         }
                         .x-navitem-over {
                             .x-navitem-body {
-                                background-color: #475360;
+                                background: #474968;
+                                box-shadow: inset 0 1px 4px 0 rgba(0,0,0,0.50);
+
+                                .nav-inner-wrap {
+
+                                    .nav-inner-icon {
+                                        opacity: 1;
+                                    }
+
+                                    .nav-inner-text {
+                                        opacity: 1;
+                                    }
+                                }
                             }
                         }
                     }

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

@@ -50,9 +50,9 @@ Ext.define('saas.view.money.fundtransfer.FormPanel', {
                 editor : {
                     xtype : "numberfield"
                 },
-                width : 120.0, 
-                xtype : "hidden",
-                items : null
+                width : 120.0,
+                items : null,
+                hidden: true
             }, {
                 text : "转出账户ID", 
                 dataIndex : "ftd_bankid", 

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

@@ -9,6 +9,8 @@ Ext.define('saas.view.money.fundtransfer.FormPanelController', {
                 beforerender:function(f){
                     Ext.apply(f,{
                         dataUrl:'/api/document/bankinformation/list',
+                        addXtype: 'other-bankinformation',
+                        addTitle:'账户资料',
                         dbfinds:[
                         {
                             from:'bk_bankcode',to:'ftd_bankcode'
@@ -16,7 +18,7 @@ Ext.define('saas.view.money.fundtransfer.FormPanelController', {
                             from:'bk_bankname',to:'ftd_bankname'
                         },{
                             from:'id',to:'ftd_bankid'
-                    }],
+                        }],
                         dbtpls:[{
                             field:'bk_bankcode',width:100
                         },{
@@ -76,6 +78,8 @@ Ext.define('saas.view.money.fundtransfer.FormPanelController', {
                 beforerender:function(f){
                     Ext.apply(f,{
                         dataUrl:'/api/document/bankinformation/list',
+                        addXtype: 'other-bankinformation',
+                        addTitle:'账户资料',
                         dbfinds:[
                         {
                             from:'bk_bankcode',to:'ftd_inbankcode'
@@ -83,7 +87,7 @@ Ext.define('saas.view.money.fundtransfer.FormPanelController', {
                             from:'bk_bankname',to:'ftd_inbankname'
                         },{
                             from:'id',to:'ftd_inbankid'
-                    }],
+                        }],
                         dbtpls:[{
                             field:'bk_bankcode',width:100
                         },{

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

@@ -8,23 +8,23 @@ Ext.define('saas.view.money.fundtransfer.QueryPanel', {
     viewName: 'money-fundtransfer-querypanel',
     
     queryFormItems: [{
-        xtype : "datefield", 
+        xtype : "condatefield", 
         name : "ft_date", 
-        fieldLabel : "单据日期"
+        fieldLabel : "单据日期",
+        columnWidth: 0.5
     }],
     moreQueryFormItems: [],
     queryGridConfig: {
         idField: 'id',
         codeField: 'ft_code',
-        addTitle: '其它收入单',
+        addTitle: '资金转存',
         addXtype: 'money-fundtransfer-formpanel',
         defaultCondition:'',
         baseVastUrl: '/api/money/fundtransfer/',
         baseColumn: [{
             text: 'id',
             dataIndex: 'id',
-            width: 0,
-            xtype: 'hidden'
+            width: 0
         }, {
             text: '单据编号',
             dataIndex: 'ft_code',

+ 4 - 2
frontend/saas-web/app/view/money/fundtransfer/QueryPanelModel.js

@@ -1,5 +1,7 @@
 Ext.define('saas.view.money.fundtransfer.QueryPanelModel', {
     extend: 'saas.view.core.query.QueryPanelModel',
-    alias: 'viewmodel.money-fundtransfer-querypanel'
-
+    alias: 'viewmodel.money-fundtransfer-querypanel',
+    data: {
+        closeEnable:false
+    }
 });

+ 9 - 7
frontend/saas-web/app/view/money/othreceipts/FormPanel.js

@@ -37,9 +37,10 @@ Ext.define('saas.view.money.othreceipts.FormPanel', {
      }, {
          xtype : "dbfindtrigger", 
          name : "or_custname", 
-         fieldLabel : "客户名称"
+         fieldLabel : "客户名称",
+         allowBlank : false
      }, {
-        xtype : 'hidden',
+         xtype : 'hidden',
          name : 'or_bankid', 
          fieldLabel : '账户ID'
      }, {
@@ -49,7 +50,8 @@ Ext.define('saas.view.money.othreceipts.FormPanel', {
      }, {
          xtype : "dbfindtrigger", 
          name : "or_bankname", 
-         fieldLabel : "账户名称"
+         fieldLabel : "账户名称",
+         allowBlank : false
      }, {
         name : "detailGridField", 
         xtype : "detailGridField", 
@@ -64,13 +66,13 @@ Ext.define('saas.view.money.othreceipts.FormPanel', {
                 xtype : "numbercolumn",
                 width:0
             }, {
-                text : "期间", 
-                dataIndex : "ord_ym", 
+                text : "期间",
+                dataIndex : "ord_ym",
                 editor : {
                     xtype : "numberfield"
                 },
-                width : 120.0, 
-                xtype : "numbercolumn", 
+                width : 120.0,
+                hidden: true,
                 items : null
             }, {
                 text : "收入类别", 

+ 1 - 0
frontend/saas-web/app/view/money/othreceipts/FormPanelController.js

@@ -113,6 +113,7 @@ Ext.define('saas.view.money.othreceipts.FormPanelController', {
                 beforerender: function (f) {
                     Ext.apply(f, {
                         dataUrl: '/api/document/bankinformation/list',
+                        addTitle: '账户资料',
                         dbfinds: [{
                             from: 'bk_bankcode',
                             to: 'or_bankcode'

+ 4 - 2
frontend/saas-web/app/view/money/othreceipts/QueryPanelModel.js

@@ -1,5 +1,7 @@
 Ext.define('saas.view.money.othreceipts.QueryPanelModel', {
     extend: 'saas.view.core.query.QueryPanelModel',
-    alias: 'viewmodel.money-othreceipts-querypanel'
-
+    alias: 'viewmodel.money-othreceipts-querypanel',
+    data: {
+        closeEnable:false
+    }
 });

+ 9 - 12
frontend/saas-web/app/view/money/othspendings/FormPanel.js

@@ -37,7 +37,8 @@ Ext.define('saas.view.money.othspendings.FormPanel', {
      }, {
          xtype : "dbfindtrigger",
          name : "os_vendname", 
-         fieldLabel : "供应商名称"
+         fieldLabel : "供应商名称",
+         allowBlank : false
      }, {
         xtype : 'hidden',
          name : 'os_bankid', 
@@ -49,15 +50,12 @@ Ext.define('saas.view.money.othspendings.FormPanel', {
      }, {
          xtype : "dbfindtrigger",
          name : "os_bankname", 
-         fieldLabel : "结算账户名称"
+         fieldLabel : "账户名称",
+         allowBlank : false
      }, {
         xtype:'datefield',
         name : 'os_date',
         fieldLabel : '单据日期'
-    },{
-        xtype : 'numberfield',
-        name : 'os_amount',
-        fieldLabel : '付款金额'
     },{
         name : "detailGridField", 
         xtype : "detailGridField", 
@@ -78,7 +76,7 @@ Ext.define('saas.view.money.othspendings.FormPanel', {
                     xtype : "numberfield"
                 },
                 width : 120.0, 
-                xtype : "hidden",
+                hidden: true,
                 items : null
             }, {
                 text : "支出类别", 
@@ -136,11 +134,10 @@ Ext.define('saas.view.money.othspendings.FormPanel', {
                 },
             }
         ]
-    }, {
-        xtype : "numberfield", 
-        name : "os_amount", 
-        fieldLabel : "收款金额",
-        readOnly:true
+    },{
+        xtype : 'numberfield',
+        name : 'os_amount',
+        fieldLabel : '付款金额'
     },{
         xtype : "textfield", 
         name : "os_remark", 

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

@@ -90,6 +90,7 @@ Ext.define('saas.view.money.othspendings.FormPanelController', {
                 beforerender: function (f) {
                     Ext.apply(f, {
                         dataUrl: '/api/document/bankinformation/list',
+                        addTitle: '账户资料',
                         dbfinds: [{
                             from: 'bk_bankcode',
                             to: 'os_bankcode'
@@ -97,9 +98,20 @@ Ext.define('saas.view.money.othspendings.FormPanelController', {
                             from: 'bk_bankname',
                             to: 'os_bankname'
                         }, {
-                            from: 'bk_id',
+                            from: 'id',
                             to: 'os_bankid'
                         }],
+                        defaultCondition: "1=1",
+                        dbSearchFields:[{
+                            emptyText:'输入账户编号或名称',
+                            xtype : "textfield",
+                            name : "search",
+                            getCondition: function(v) {
+                                return "(upper(bk_bankname) like '%"+v.toUpperCase()+"%' or upper(bk_bankcode) like '%"+v.toUpperCase()+"%')";
+                            },
+                            allowBlank : true,
+                            columnWidth : 0.25
+                        }],
                         dbtpls: [{
                             field: 'bk_bankcode',
                             width: 100

+ 4 - 2
frontend/saas-web/app/view/money/othspendings/QueryPanelModel.js

@@ -1,5 +1,7 @@
 Ext.define('saas.view.money.othspendings.QueryPanelModel', {
     extend: 'saas.view.core.query.QueryPanelModel',
-    alias: 'viewmodel.money-othspendings-querypanel'
-
+    alias: 'viewmodel.money-othspendings-querypanel',
+    data: {
+        closeEnable:false
+    }
 });

+ 2 - 7
frontend/saas-web/app/view/money/payBalance/FormPanel.js

@@ -39,7 +39,8 @@ Ext.define('saas.view.money.payBalance.FormPanel', {
         xtype: 'textfield',
         name: 'pb_kind',
         fieldLabel: '单据类型',
-        defaultValue: '付款单'
+        defaultValue: '付款单',
+        readOnly: true
     },  {
         xtype: 'hidden',
         name: 'pb_vendid',
@@ -176,12 +177,6 @@ Ext.define('saas.view.money.payBalance.FormPanel', {
         detnoColumn: 'pbd_detno',
         allowEmpty: true,
         deleteDetailUrl: '/api/money/paybalance/deleteDetail2/',
-        tbar: ['->', {
-            xtype:'dbfindtrigger',
-            columnWidth: 1,
-            fieldLabel:'选择源单',
-            name: 'choseSource'
-        }],
         columns: [{
             text: 'ID',
             dataIndex: 'id',

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

@@ -164,7 +164,7 @@ Ext.define('saas.view.money.payBalance.FormPanelController', {
                 beforerender: function (f) {
                     Ext.apply(f, {
                         dataUrl: '/api/document/bankinformation/list',
-                        // addXtype: 'document-banksubledger-formpanel',
+                        addXtype: 'other-bankinformation',
                         addTitle: '账户资料',
                         dbfinds: [{
                             from: 'id',

+ 4 - 2
frontend/saas-web/app/view/money/payBalance/QueryPanelModel.js

@@ -1,5 +1,7 @@
 Ext.define('saas.view.money.paybalance.QueryPanelModel', {
     extend: 'saas.view.core.query.QueryPanelModel',
-    alias: 'viewmodel.money-paybalance-querypanel'
-
+    alias: 'viewmodel.money-paybalance-querypanel',
+    data: {
+        closeEnable:false
+    }
 });

+ 2 - 7
frontend/saas-web/app/view/money/recBalance/FormPanel.js

@@ -35,7 +35,8 @@ Ext.define('saas.view.money.recBalance.FormPanel', {
         xtype: 'textfield',
         name: 'rb_kind',
         fieldLabel: '单据类型',
-        defaultValue: '收款单'
+        defaultValue: '收款单',
+        readOnly: true
     }, {
         xtype: 'hidden',
         name: 'rb_custcode',
@@ -171,12 +172,6 @@ Ext.define('saas.view.money.recBalance.FormPanel', {
         storeModel: 'saas.model.money.RecBalance2',
         detnoColumn: 'rbd_detno',
         deleteDetailUrl: '/api/money/recbalance/deleteDetail2/',
-        tbar: ['->', {
-            xtype:'dbfindtrigger',
-            columnWidth: 1,
-            fieldLabel:'选择源单',
-            name: 'choseSource'
-        }],
         columns: [{
             text: 'ID',
             dataIndex: 'id',

+ 4 - 2
frontend/saas-web/app/view/money/recBalance/QueryPanelModel.js

@@ -1,5 +1,7 @@
 Ext.define('saas.view.money.recBalance.QueryPanelModel', {
     extend: 'saas.view.core.query.QueryPanelModel',
-    alias: 'viewmodel.money-recbalance-querypanel'
-
+    alias: 'viewmodel.money-recbalance-querypanel',
+    data: {
+        closeEnable:false
+    }
 });

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

@@ -144,7 +144,7 @@ Ext.define('saas.view.purchase.purchase.FormPanel', {
                 allowBlank : false,
                 editor : {
                     xtype : "numberfield",
-                    decimalPrecision: 8,
+                    decimalPrecision: 3,
                     minValue:0
                 },
                 renderer : function(v) {

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

@@ -69,7 +69,7 @@ Ext.define('saas.view.purchase.purchase.QueryPanel', {
     }, {
         xtype: 'multicombo',
         name: 'pu_acceptstatuscode',
-        fieldLabel: '入库状态',
+        fieldLabel: '业务状态',
         datas: [
             ["TURNIN", "已入库"],
             ["UNTURNIN", "未入库"],

+ 30 - 11
frontend/saas-web/app/view/purchase/report/Purchase.js

@@ -11,22 +11,39 @@ Ext.define('saas.view.purchase.report.Purchase', {
     listUrl: '/api/purchase/purchase/list',
     defaultCondition: null,
     reportTitle: '采购明细报表',
-
-    searchItems: [{
+    QueryWidth:0.1,
+    //筛选:供应商、日期(必填)、业务状态			
+    searchItems: [ {
+        xtype: 'dbfindtrigger',
+        name: 'pu_vendname',
+        fieldLabel: '供应商名称',
+        columnWidth: 0.2
+    }, {
         xtype: 'condatefield',
         name: 'pu_date',
         fieldLabel: '单据日期',
         columnWidth: 0.5
+    }, {
+        xtype: 'multicombo',
+        name: 'pu_acceptstatuscode',
+        fieldLabel: '业务状态',
+        columnWidth: 0.2,
+        datas: [
+            ["TURNIN", "已入库"],
+            ["UNTURNIN", "未入库"],
+            ["PART2IN", "部分入库"],
+            ["CLOSE", "已关闭"]
+        ]
     }],
 
-    reportColumns: [{
+    reportColumns: [
+    {
         text: 'id',
         dataIndex: 'pu_id',
         hidden: true
     }, {
         text: '采购单号',
         dataIndex: 'pu_code',
-        summaryType: 'count',
         width: 200
     }, {
         text: '供应商编号',
@@ -38,7 +55,7 @@ Ext.define('saas.view.purchase.report.Purchase', {
         width: 200
     }, {
         text: '业务状态',
-        dataIndex: 'pu_status'
+        dataIndex: 'pu_acceptstatus'
     }, {
         text: '采购员',
         dataIndex: 'pu_buyername'
@@ -66,7 +83,8 @@ Ext.define('saas.view.purchase.report.Purchase', {
         dataIndex: 'pr_unit'
     }, {
         text: '采购数量',
-        dataIndex: 'pd_qty'
+        dataIndex: 'pd_qty',
+        summaryType: 'count'
     }, {
         text: '单价',
         dataIndex: 'pd_price'
@@ -75,19 +93,20 @@ Ext.define('saas.view.purchase.report.Purchase', {
         dataIndex: 'pd_taxrate'
     }, {
         text: '金额',
-        dataIndex: 'pd_total'
+        dataIndex: 'pd_total',
+        summaryType: 'count'
     }, {
         text: '不含税单价',
-        dataIndex: 'rbd_remark'
+        dataIndex: 'pd_taxprice'
     }, {
         text: '不含税金额',
-        dataIndex: 'pd_taxprice'
+        dataIndex: 'pd_taxtotal'
     }, {
         text: '收货数量',
-        dataIndex: 'pd_yqty'
+        dataIndex: 'pd_acceptqty'
     }, {
         text: '收货金额',
-        dataIndex: 'pd_total'
+        dataIndex: 'pd_accepttotal'
     }, {
         text: '备注'
     }]

+ 76 - 1
frontend/saas-web/app/view/purchase/report/PurchaseController.js

@@ -1,4 +1,79 @@
 Ext.define('saas.view.purchase.report.PurchaseController', {
     extend: 'saas.view.core.report.ReportPanelController',
-    alias: 'controller.purchase-report-purchase'
+    alias: 'controller.purchase-report-purchase',
+    init: function (form) {
+        this.control({
+            // 供应商编号
+            'dbfindtrigger[name=pu_vendname]':{
+                beforerender:function(f){
+                    Ext.apply(f,{
+                        dataUrl:'/api/document/vendor/list',
+                        addXtype: 'document-vendor-formpanel',
+                        addTitle: '供应商资料',
+                        dbfinds:[{
+                            from:'ve_name',to:'pu_vendname'
+                        }],
+                        dbtpls:[{
+                            field:'ve_code',width:100
+                        },{
+                            field:'ve_name',width:100
+                        }],
+                        defaultCondition: "ve_statuscode='OPEN'",
+                        dbSearchFields:[{
+                            emptyText:'输入供应商编号或名称',
+                            xtype : "textfield", 
+                            name : "search", 
+                            getCondition: function(v) {
+                                return "(upper(ve_code) like '%"+v.toUpperCase()+"%' or upper(ve_name) like '%"+v.toUpperCase()+"%')";
+                            },
+                            allowBlank : true, 
+                            columnWidth : 0.25
+                        }],
+                        dbColumns:[
+                        {
+                            "text": "供应商ID",
+                            "hidden": true,
+                            "dataIndex": "id",
+                            "width": 100,
+                            "xtype": "numbercolumn"
+                        },{
+                            "text": "供应商编号",
+                            "dataIndex": "ve_code",
+                            "width": 200
+                        }, {
+                            "text": "供应商名称",
+                            "dataIndex": "ve_name",
+                            "width": 200
+                        }, {
+                            "text": "供应商类型",
+                            "dataIndex": "ve_type",
+                            "width": 180,
+                            "items": null
+                        }, {
+                            "text": "税率",
+                            "dataIndex": "ve_taxrate",
+                            "width": 100
+                        }, {
+                            "text": "承付天数",
+                            "dataIndex": "ve_promisedays",
+                            "width": 100
+                        }, {
+                            "text": "纳税人识别号",
+                            "dataIndex": "ve_bankaccount",
+                            "width": 150
+                        }, {
+                            "text": "开户银行",
+                            "dataIndex": "ve_bankaccount",
+                            "width": 100
+                        }, {
+                            "text": "银行账户",
+                            "dataIndex": "ve_bankcode",
+                            "width": 100
+                        }]
+                    }) ;   
+
+                }
+            }
+        });
+    }
 });

+ 116 - 0
frontend/saas-web/app/view/purchase/report/PurchasePay.js

@@ -0,0 +1,116 @@
+Ext.define('saas.view.purchase.report.PurchasePay', {
+    extend: 'saas.view.core.report.ReportPanel',
+    xtype: 'purchase-report-purchasepay',
+
+    controller: 'purchase-report-purchasepay',
+    viewModel: 'purchase-report-purchasepay',
+
+    viewName: 'purchase-report-purchasepay',
+//按供应商分组 付款金额合计
+    groupField: 'pu_vendname',
+    listUrl: '/api/money/paybalance/list',
+    defaultCondition: null,
+    reportTitle: '采购付款一览表',
+    QueryWidth:0.25,
+    searchItems: [
+    {
+        xtype: 'dbfindtrigger',
+        name: 'pu_vendname',
+        fieldLabel: '供应商名称',
+        columnWidth: 0.25
+    }, {
+        xtype: 'condatefield',
+        name: 'pu_date',
+        fieldLabel: '单据日期',
+        columnWidth: 0.5
+    }],
+
+    reportColumns: [
+    {
+        text: 'id',
+        dataIndex: 'pb_id',
+        hidden: true
+    }, {
+        text: '付款单号',
+        dataIndex: 'pb_code',
+        width: 200
+    }, {
+        text: '供应商编号',
+        dataIndex: 'pu_vendcode',
+        width: 200
+    }, {
+        text: '供应商名称',
+        dataIndex: 'pu_vendname',
+        width: 200
+    }, {
+        text: '录入人',
+        dataIndex: 'pb_recorder',
+        width: 200
+    }, {
+        text : "日期", 
+        dataIndex : "pb_recorddate", 
+        xtype:'datecolumn'
+    }, {
+        text: '来源单号',
+        dataIndex: 'pbd_slcode',
+        width: 200
+    }, {
+        text: '类型',
+        dataIndex: 'pbd_slkind',
+        width: 200
+    }, {//∑求和
+        text: '采购金额',
+        dataIndex: 'pbd_amount',
+        width: 200,
+        renderer : function(v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length)).fill('0');
+            var format = '0,000.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        },
+        summaryType: 'sum',
+        summaryRenderer: function(v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length)).fill('0');
+            var format = '0,000.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        }
+    }, {//∑求和
+        text: '本次付款',
+        dataIndex: 'pbd_nowbalance',
+        width: 200,
+        renderer : function(v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length)).fill('0');
+            var format = '0,000.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        },
+        summaryType: 'sum',
+        summaryRenderer: function(v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length)).fill('0');
+            var format = '0,000.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        }
+    }, {
+        text: '应付余额',
+        dataIndex: 'pb_pbdamount',
+        width: 200,
+        renderer : function(v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length)).fill('0');
+            var format = '0,000.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        },
+    }, {
+        text: '付款比例',
+        //本次付款/采购金额*100%
+        dataIndex: 'pb_payrate',
+        width: 200
+    }, {
+        text: '备注',
+        dataIndex: 'pd_remark',
+        width: 200
+    }]
+
+});

+ 80 - 0
frontend/saas-web/app/view/purchase/report/PurchasePayController.js

@@ -0,0 +1,80 @@
+Ext.define('saas.view.purchase.report.PurchasePayController', {
+    extend: 'saas.view.core.report.ReportPanelController',
+    alias: 'controller.purchase-report-purchasepay',
+    init: function (form) {
+        this.control({
+            // 供应商编号
+            'dbfindtrigger[name=pu_vendname]':{
+                beforerender:function(f){
+                    Ext.apply(f,{
+                        dataUrl:'/api/document/vendor/list',
+                        addXtype: 'document-vendor-formpanel',
+                        addTitle: '供应商资料',
+                        dbfinds:[{
+                            from:'ve_code',to:'pu_vendcode'
+                        },{
+                            from:'ve_name',to:'pu_vendname'
+                        }],
+                        dbtpls:[{
+                            field:'ve_code',width:100
+                        },{
+                            field:'ve_name',width:100
+                        }],
+                        defaultCondition: "ve_statuscode='OPEN'",
+                        dbSearchFields:[{
+                            emptyText:'输入供应商编号或名称',
+                            xtype : "textfield", 
+                            name : "search", 
+                            getCondition: function(v) {
+                                return "(upper(ve_code) like '%"+v.toUpperCase()+"%' or upper(ve_name) like '%"+v.toUpperCase()+"%')";
+                            },
+                            allowBlank : true, 
+                            columnWidth : 0.25
+                        }],
+                        dbColumns:[{
+                            "text": "供应商ID",
+                            "hidden": true,
+                            "dataIndex": "id",
+                            "width": 100,
+                            "xtype": "numbercolumn"
+                        },{
+                            "text": "供应商编号",
+                            "dataIndex": "ve_code",
+                            "width": 200
+                        }, {
+                            "text": "供应商名称",
+                            "dataIndex": "ve_name",
+                            "width": 200
+                        }, {
+                            "text": "供应商类型",
+                            "dataIndex": "ve_type",
+                            "width": 180,
+                            "items": null
+                        }, {
+                            "text": "税率",
+                            "dataIndex": "ve_taxrate",
+                            "width": 100
+                        }, {
+                            "text": "承付天数",
+                            "dataIndex": "ve_promisedays",
+                            "width": 100
+                        }, {
+                            "text": "纳税人识别号",
+                            "dataIndex": "ve_bankaccount",
+                            "width": 150
+                        }, {
+                            "text": "开户银行",
+                            "dataIndex": "ve_bankaccount",
+                            "width": 100
+                        }, {
+                            "text": "银行账户",
+                            "dataIndex": "ve_bankcode",
+                            "width": 100
+                        }]
+                    }) ;   
+
+                }
+            }
+        });
+    }
+});

+ 4 - 0
frontend/saas-web/app/view/purchase/report/PurchasePayModel.js

@@ -0,0 +1,4 @@
+Ext.define('saas.view.purchase.report.PurchasePayModel', {
+    extend: 'saas.view.core.report.ReportPanelModel',
+    alias: 'viewmodel.purchase-report-purchasepay'
+});

+ 166 - 0
frontend/saas-web/app/view/sale/report/Sale.js

@@ -0,0 +1,166 @@
+Ext.define('saas.view.sale.report.Sale', {
+    extend: 'saas.view.core.report.ReportPanel',
+    xtype: 'sale-report-sale',
+
+    controller: 'sale-report-sale',
+    viewModel: 'sale-report-sale',
+
+    viewName: 'sale-report-sale',
+
+    groupField: null,
+    listUrl: '/api/sale/sale/list',
+    defaultCondition: null,
+    reportTitle: '销售明细报表',
+    QueryWidth:0.1,
+    searchItems: [
+    {
+        xtype: 'dbfindtrigger',
+        name: 'sa_custname',
+        fieldLabel: '客户名称',
+        columnWidth: 0.2
+    }, {
+        xtype: 'condatefield',
+        name: 'sa_date',
+        fieldLabel: '单据日期',
+        columnWidth: 0.5
+    }, {
+        xtype: 'multicombo',
+        name: 'sa_sendstatuscode',
+        fieldLabel: '业务状态',
+        allowBlank: true,
+        columnWidth: 0.2,
+        datas: [
+            ["TURNOUT", "已出库"],
+            ["UNTURNOUT", "未出库"],
+            ["PARTOUT", "部分出库"],
+            ["CLOSE", "已关闭"]
+        ]
+    }],
+
+    reportColumns: [
+    {
+        text: 'id',
+        dataIndex: 'sa_id',
+        hidden: true
+    }, {
+        text: '销售单号',
+        dataIndex: 'sa_code',
+        width: 200
+    }, {
+        text: '客户编号',
+        dataIndex: 'sa_custcode',
+        width: 200
+    }, {
+        text: '客户名称',
+        dataIndex: 'sa_custname',
+        width: 200
+    }, {
+        text: '业务状态',
+        dataIndex: 'sa_status'
+    }, {
+        text: '业务员编号',
+        dataIndex: 'sa_sellercode',
+        hidden:true
+    }, {
+        text: '业务员',
+        dataIndex: 'sa_seller'
+    }, {
+        text: '单据日期',
+        xtype: 'datecolumn',
+        dataIndex: 'sa_date'
+    }, {
+        text: '序号',
+        dataIndex: 'sd_detno'
+    }, {
+        text: '物料编号',
+        dataIndex: 'sd_prodcode',
+        width: 200
+    }, {
+        text: '物料名称',
+        dataIndex: 'pr_detail',
+        width: 200
+    }, {
+        text: '物料规格',
+        dataIndex: 'pr_spec'
+    }, {
+        text: '品牌',
+        dataIndex: 'pr_brand'
+    }, {
+        text: '单位',
+        dataIndex: 'pr_unit'
+    }, {//∑数量
+        text: '数量',
+        dataIndex: 'sd_qty',
+        renderer : function(v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length)).fill('0');
+            var format = '0.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        },
+        summaryType: 'sum',
+        summaryRenderer: function(v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length)).fill('0');
+            var format = '0.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        }
+    }, {
+        text: '单价',
+        dataIndex: 'sd_price',
+        renderer : function(v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length)).fill('0');
+            var format = '0,000.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        }
+    }, {
+        text: '税率',
+        dataIndex: 'sd_taxrate'
+    }, {//∑金额
+        text: '金额',
+        dataIndex: 'sd_total',
+        renderer : function(v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length)).fill('0');
+            var format = '0,000.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        },
+        summaryType: 'sum',
+        summaryRenderer: function(v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length)).fill('0');
+            var format = '0,000.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        }
+    }, {//∑不含税金额
+        text: '不含税金额',
+        dataIndex: 'sd_nettotal',
+        renderer : function(v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length)).fill('0');
+            var format = '0,000.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        },
+        summaryType: 'sum',
+        summaryRenderer: function(v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length)).fill('0');
+            var format = '0,000.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        }
+    }, {
+        text: '出货数量',
+        dataIndex: 'sd_sendqty',
+        renderer : function(v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length)).fill('0');
+            var format = '0.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        }
+    }, {
+        text : "备注", 
+        dataIndex : "sd_remark",
+        width : 250 
+    }]
+
+});

+ 107 - 0
frontend/saas-web/app/view/sale/report/SaleController.js

@@ -0,0 +1,107 @@
+Ext.define('saas.view.sale.report.SaleController', {
+    extend: 'saas.view.core.report.ReportPanelController',
+    alias: 'controller.sale-report-sale',
+    init: function (form) {
+        this.control({
+            //放大镜赋值关系 以及 tpl模板
+            'dbfindtrigger[name=sa_custname]':{
+                beforerender:function(f){
+                    Ext.apply(f,{
+                        dataUrl:'/api/document/customer/dbfind',
+                        addXtype: 'document-customer-formpanel',
+                        addTitle: '客户资料',
+                        defaultCondition:"cu_statuscode='OPEN'",
+                        dbfinds:[
+                            {
+                                from:'id',to:'sa_custid',ignore:true
+                            },{
+                                from:'cu_code',to:'sa_custcode'
+                            },{
+                                from:'cu_name',to:'sa_custname'
+                            },{
+                                from:'ca_address',to:'sa_toplace'
+                        }],
+                        dbtpls:[{
+                            field:'cu_code',width:100
+                        },{
+                            field:'cu_name',width:100
+                        }],
+                        dbSearchFields:[{
+                            emptyText:'输入客户编号或客户名称',
+                            xtype : "textfield", 
+                            name : "search", 
+                            getCondition: function(v) {
+                                return "(upper(cu_code) like '%"+v.toUpperCase()+"%' or upper(cu_name) like '%"+v.toUpperCase()+"%')";
+                            },
+                            allowBlank : true, 
+                            columnWidth : 0.25
+                        }],
+                        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
+                            }]
+                    }) ;   
+                }
+            }
+        });
+    }
+});

+ 7 - 2
frontend/saas-web/app/view/sale/report/SaleIn.js

@@ -11,8 +11,13 @@ Ext.define('saas.view.sale.report.SaleIn', {
     listUrl: '/api/money/recbalance/list',
     defaultCondition: null,
     reportTitle: '销售收款报表',
-
-    searchItems: [{
+    QueryWidth:0.25,
+    searchItems: [{//筛选:客户、日期	
+        xtype: 'dbfindtrigger',
+        name: 'sa_custname',
+        fieldLabel: '客户',
+        columnWidth: 0.25
+    }, {
         xtype: 'condatefield',
         name: 'rb_date',
         fieldLabel: '日期',

+ 4 - 0
frontend/saas-web/app/view/sale/report/SaleModel.js

@@ -0,0 +1,4 @@
+Ext.define('saas.view.sale.report.SaleModel', {
+    extend: 'saas.view.core.report.ReportPanelModel',
+    alias: 'viewmodel.sale-report-sale'
+});

+ 108 - 0
frontend/saas-web/app/view/sale/report/SaleProfit.js

@@ -0,0 +1,108 @@
+Ext.define('saas.view.sale.report.SaleProfit', {
+    extend: 'saas.view.core.report.ReportPanel',
+    xtype: 'sale-report-saleprofit',
+
+    controller: 'sale-report-saleprofit',
+    viewModel: 'sale-report-saleprofit',
+
+    viewName: 'sale-report-saleprofit',
+
+    groupField: null,
+    listUrl: '/api/sale/sale/list',
+    defaultCondition: null,
+    reportTitle: '销售毛利润表',
+//筛选:客户、物料、时间	
+    QueryWidth:0.1, 	
+    searchItems: [{
+        xtype: 'dbfindtrigger',
+        name: 'sa_custname',
+        fieldLabel: '客户',
+        columnWidth: 0.2
+    }, {
+        xtype: 'dbfindtrigger',
+        name: 'sd_prodcode',
+        fieldLabel: '物料',
+        columnWidth: 0.2
+    }, {
+        xtype: 'condatefield',
+        name: 'sa_custname',
+        fieldLabel: '时间',
+        columnWidth: 0.5
+    }],
+
+    reportColumns: [
+    {
+        text: 'id',
+        dataIndex: 'sa_id',
+        hidden: true
+    }, {
+        text: '客户编号',
+        dataIndex: 'sa_custcode',
+        width: 200
+    }, {
+        text: '客户名称',
+        dataIndex: 'sa_custname',
+        width: 200
+    }, {
+        text: '业务员编号',
+        dataIndex: 'sa_sellercode',
+        hidden:true
+    }, {
+        text: '业务员',
+        dataIndex: 'sa_seller'
+    }, {
+        text: '单据日期',
+        xtype: 'datecolumn',
+        dataIndex: 'sa_date'
+    }, {
+        text: '单据编号',
+        dataIndex: 'pd_inoutno',
+        width: 200
+    }, {
+        text: '单据类型',
+        dataIndex: 'pd_piclass'
+    }, {
+        text: '物料类别',
+        dataIndex: 'pr_kind'
+    }, {
+        text: '物料编号',
+        dataIndex: 'pr_code',
+        width: 200
+    }, {
+        text: '物料名称',
+        dataIndex: 'pr_detail',
+        width: 200
+    }, {
+        text: '物料规格',
+        dataIndex: 'pr_spec'
+    }, {
+        text: '单位',
+        dataIndex: 'pr_unit'
+    }, {
+        text: '数量',
+        dataIndex: 'pd_outqty'
+    }, {
+        text: '单价',
+        dataIndex: 'pd_sendprice'
+    }, {
+        text: '税率%',
+        dataIndex: 'pd_taxrate'
+    }, {
+        text: '含税金额',
+        dataIndex: 'pd_ordertotal'
+    }, {
+        text: '成本金额',
+        dataIndex: 'pd_total'
+    }, {
+        text: '毛利润',
+        dataIndex: 'pd_profit'
+    }, {
+        text: '毛利率%',
+        dataIndex: 'pd_profitpresent'
+    }, {
+        text : "备注", 
+        dataIndex : "pd_remark",
+        width : 250 
+    }]
+
+});

+ 206 - 0
frontend/saas-web/app/view/sale/report/SaleProfitController.js

@@ -0,0 +1,206 @@
+Ext.define('saas.view.sale.report.SaleProfitController', {
+    extend: 'saas.view.core.report.ReportPanelController',
+    alias: 'controller.sale-report-saleprofit',
+    init: function (form) {
+        this.control({
+            //放大镜赋值关系 以及 tpl模板
+            'dbfindtrigger[name=sa_custname]':{
+                beforerender:function(f){
+                    Ext.apply(f,{
+                        dataUrl:'/api/document/customer/dbfind',
+                        addXtype: 'document-customer-formpanel',
+                        addTitle: '客户资料',
+                        defaultCondition:"cu_statuscode='OPEN'",
+                        dbfinds:[
+                            {
+                                from:'id',to:'sa_custid',ignore:true
+                            },{
+                                from:'cu_code',to:'sa_custcode'
+                            },{
+                                from:'cu_name',to:'sa_custname'
+                            },{
+                                from:'ca_address',to:'sa_toplace'
+                        }],
+                        dbtpls:[{
+                            field:'cu_code',width:100
+                        },{
+                            field:'cu_name',width:100
+                        }],
+                        dbSearchFields:[{
+                            emptyText:'输入客户编号或客户名称',
+                            xtype : "textfield", 
+                            name : "search", 
+                            getCondition: function(v) {
+                                return "(upper(cu_code) like '%"+v.toUpperCase()+"%' or upper(cu_name) like '%"+v.toUpperCase()+"%')";
+                            },
+                            allowBlank : true, 
+                            columnWidth : 0.25
+                        }],
+                        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
+                            }]
+                    }) ;   
+                }
+            },
+            //放大镜赋值关系 以及 tpl模板
+            'dbfindtrigger[name=sd_prodcode]':{
+                beforerender:function(f){
+                    Ext.apply(f,{
+                        dataUrl:'/api/document/product/list',
+                        addXtype: 'document-product-formpanel',
+                        addTitle: '物料资料',
+                        dbfinds:[
+                        {
+                            from:'pr_code',to:'sd_prodcode'
+                        }, {
+                            from:'pr_detail',to:'pr_detail'
+                        }, {
+                            from:'pr_spec',to:'pr_spec'
+                        }],
+                        dbtpls:[{
+                            field:'pr_code',width:100
+                        },{
+                            field:'pr_detail',width:100
+                        }],
+                        defaultCondition: "pr_statuscode='OPEN'",
+                        dbSearchFields:[{
+                            emptyText:'输入物料编号、名称或规格',
+                            xtype : "textfield", 
+                            name : "search", 
+                            width: 200,
+                            getCondition: function(v) {
+                                return "(upper(pr_spec) like '%" + v.toUpperCase()+"%' or upper(pr_code) like '%"+v.toUpperCase()+"%' or upper(pr_detail) like '%"+v.toUpperCase()+"%')";
+                            },
+                            allowBlank : true, 
+                            columnWidth : 0.25
+                        }],
+                        dbColumns:[{
+                            "text": "物料ID",
+                            "hidden": true,
+                            "dataIndex": "id",
+                        }, {
+                            "text": "物料编号",       
+                            "dataIndex": "pr_code",
+                            "width": 200,
+                        }, {
+                            "text": "物料名称",
+                            "width": 200,
+                            "dataIndex": "pr_detail",
+                        }, {
+                            "text": "规格",
+                            "dataIndex": "pr_spec",
+                            "width": 100,
+                        }, {
+                            "text": "单位",
+                            "dataIndex": "pr_unit",
+                            "width": 100,
+                        },{
+                            "text": "仓库id",
+                            "dataIndex": "pr_whid",
+                            "hidden": true,
+                        },{
+                            "text": "仓库编号",
+                            "dataIndex": "pr_whcode",
+                            "hidden": true,
+                        },{
+                            "text": "仓库",
+                            "dataIndex": "pr_whname",
+                            "width": 200,
+                        },{
+                            "text": "总库存数",
+                            "dataIndex": "po_onhand",
+                            "width": 100,
+                            align:'right'
+                        },{
+                            "text": "类型",
+                            "dataIndex": "pr_kind",
+                            "width": 100,
+                        },{
+                            "text": "型号",
+                            "dataIndex": "pr_orispeccode",
+                            "width": 100,
+                        },{
+                            "text": "品牌",
+                            "dataIndex": "pr_brand",
+                            "width": 100,
+                        },{
+                            "text": "供应商",
+                            "dataIndex": "pr_vendname",
+                            "width": 100,
+                        },{
+                            "text": "最小包装",
+                            "dataIndex": "pr_zxbzs",
+                            "width": 100,
+                            align:'right'
+                        },{
+                            "text": "L/T",
+                            "dataIndex": "pr_leadtime",
+                            "width": 100,
+                        }]
+                    }) ;   
+
+                }
+            }
+        });
+    }
+});

+ 4 - 0
frontend/saas-web/app/view/sale/report/SaleProfitModel.js

@@ -0,0 +1,4 @@
+Ext.define('saas.view.sale.report.SaleProfitModel', {
+    extend: 'saas.view.core.report.ReportPanelModel',
+    alias: 'viewmodel.sale-report-saleprofit'
+});

+ 6 - 3
frontend/saas-web/app/view/sale/sale/FormPanel.js

@@ -51,7 +51,10 @@ Ext.define('saas.view.sale.sale.FormPanel', {
         name : "sa_custname", 
         fieldLabel : "客户名称",
         allowBlank : false
-
+    }, {
+        xtype : "datefield", 
+        name : "sa_date", 
+        fieldLabel : "单据日期"
     }, {
         xtype : "textfield", 
         name : "sa_toplace", 
@@ -138,7 +141,7 @@ Ext.define('saas.view.sale.sale.FormPanel', {
                 hidden : true,
                 editor : {
                     xtype : "numberfield",
-                    decimalPrecision: 2
+                    decimalPrecision: 3
                 },
                 renderer : function(v) {
                     var arr = (v + '.').split('.');
@@ -160,7 +163,7 @@ Ext.define('saas.view.sale.sale.FormPanel', {
                 width : 120.0,
                 editor : {
                     xtype : "numberfield",
-                    decimalPrecision: 8,
+                    decimalPrecision: 3,
                     minValue:0
                 },
                 renderer : function(v) {

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

@@ -116,13 +116,13 @@ Ext.define('saas.view.sale.sale.FormPanelController', {
                         addTitle: '物料资料',
                         dbfinds:[
                         {
-                            from:'pr_code',to:'sd_prodcode',ignore:true
+                            from:'pr_code',to:'sd_prodcode'
                         }, {
                             from:'pr_detail',to:'pr_detail'
                         }, {
                             from:'pr_spec',to:'pr_spec'
                         }, {
-                            from:'id',to:'sd_prodid'
+                            from:'id',to:'sd_prodid',ignore:true
                         }],
                         dbtpls:[{
                             field:'pr_code',width:100

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

@@ -1,5 +1,4 @@
 Ext.define('saas.view.sale.sale.FormPanelModel', {
     extend: 'saas.view.core.form.FormPanelModel',
     alias: 'viewmodel.sale-sale-formpanel',
-
 });

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

@@ -18,7 +18,7 @@ Ext.define('saas.view.sale.sale.QueryPanel', {
         fieldLabel: '销售编号'
     }, {
         xtype: 'condatefield',
-        name: 'sa_recorddate',
+        name: 'sa_date',
         fieldLabel: '单据日期',
         columnWidth: 0.5
     }, {
@@ -110,7 +110,7 @@ Ext.define('saas.view.sale.sale.QueryPanel', {
             width: 120
         }, {
             text: '单据日期',
-            dataIndex: 'sa_recorddate',
+            dataIndex: 'sa_date',
             xtype: 'datecolumn',
             width: 200
         }, {
@@ -151,7 +151,7 @@ Ext.define('saas.view.sale.sale.QueryPanel', {
             width: 120
         }, {
             text: '单据日期',
-            dataIndex: 'sa_recorddate',
+            dataIndex: 'sa_date',
             xtype: 'datecolumn',
             width: 200
         }, {

Some files were not shown because too many files changed in this diff