浏览代码

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

zhuth 7 年之前
父节点
当前提交
ecf7409f10
共有 42 个文件被更改,包括 246 次插入50 次删除
  1. 3 0
      applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/exception/BizExceptionCode.java
  2. 5 0
      applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/po/Operation.java
  3. 1 0
      applications/commons/commons-server/src/main/resources/i18n/messages_zh_CN.properties
  4. 2 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/AddressMapper.java
  5. 2 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/CustomerkindMapper.java
  6. 2 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/ProductbrandMapper.java
  7. 2 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/ProducttypeMapper.java
  8. 2 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/ProductunitMapper.java
  9. 2 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/VendorkindMapper.java
  10. 13 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/AddressServiceImpl.java
  11. 3 2
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/BomServiceImpl.java
  12. 3 2
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/CustomerServiceImpl.java
  13. 13 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/CustomerkindServiceImpl.java
  14. 3 2
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/ProductServiceImpl.java
  15. 15 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/ProductbrandServiceImpl.java
  16. 12 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/ProducttypeServiceImpl.java
  17. 12 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/ProductunitServiceImpl.java
  18. 3 2
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/VendorServiceImpl.java
  19. 12 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/VendorkindServiceImpl.java
  20. 3 2
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/WarehouseServiceImpl.java
  21. 3 0
      applications/document/document-server/src/main/resources/mapper/AddressMapper.xml
  22. 4 0
      applications/document/document-server/src/main/resources/mapper/BankinformationMapper.xml
  23. 3 0
      applications/document/document-server/src/main/resources/mapper/CustomerkindMapper.xml
  24. 3 0
      applications/document/document-server/src/main/resources/mapper/ProductbrandMapper.xml
  25. 3 0
      applications/document/document-server/src/main/resources/mapper/ProducttypeMapper.xml
  26. 3 0
      applications/document/document-server/src/main/resources/mapper/ProductunitMapper.xml
  27. 3 0
      applications/document/document-server/src/main/resources/mapper/VendorkindMapper.xml
  28. 1 1
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/FundtransferdetailMapper.java
  29. 19 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Fundtransferdetail.java
  30. 2 2
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/FundtransferServiceImpl.java
  31. 15 0
      applications/money/money-server/src/main/resources/mapper/FundtransferdetailMapper.xml
  32. 1 1
      applications/money/money-server/src/main/resources/mapper/PaybalancedetMapper.xml
  33. 1 1
      applications/money/money-server/src/main/resources/mapper/RecbalancedetMapper.xml
  34. 4 0
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/mapper/PurchaseMapper.java
  35. 11 0
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/impl/PurchaseServiceImpl.java
  36. 9 0
      applications/purchase/purchase-server/src/main/resources/mapper/PurchaseMapper.xml
  37. 4 4
      base-servers/auth/auth-server/src/main/java/com/usoftchina/saas/auth/controller/AuthController.java
  38. 0 28
      framework/server-starter/src/main/java/com/usoftchina/saas/server/error/ServletErrorUtils.java
  39. 41 0
      framework/server-starter/src/main/java/com/usoftchina/saas/server/web/ServletUtils.java
  40. 2 1
      frontend/saas-web/Dockerfile
  41. 1 1
      frontend/saas-web/app/view/money/othspendings/FormPanel.js
  42. 0 1
      frontend/saas-web/app/view/purchase/purchaseIn/QueryPanel.js

+ 3 - 0
applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/exception/BizExceptionCode.java

@@ -46,6 +46,9 @@ public enum BizExceptionCode implements BaseExceptionCode {
     DEAL_FAILED(79800, "编号:<u>%s</u>处理失败,%s"),
     USING_EXISTS(79504, ""),
 
+    VENDOR_ISCLOSE(79505, "供应商已关闭"),
+    PRODUCT_ISCLOSE(79506, "物料已关闭"),
+    CUSTOMER_ISCLOSE(79507, "客户资料已关闭"),
 
 
     //采购 70000-71999

+ 5 - 0
applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/po/Operation.java

@@ -51,6 +51,11 @@ public enum Operation {
      */
     BANNED("msg.banned", "msg.bannedSuccess"),
 
+    /**
+     * 启用操作
+     */
+    ENABLE("msg.enable", "msg.enableSuccess"),
+
     /**
      * 记账
      */

+ 1 - 0
applications/commons/commons-server/src/main/resources/i18n/messages_zh_CN.properties

@@ -33,6 +33,7 @@ msg.resHungSuccess=\u89e3\u6302\u6210\u529f
 msg.checkSuccess=\u6838\u5bf9\u6210\u529f
 msg.printSuccess=\u6253\u5370\u6210\u529f
 msg.bannedSuccess=\u7981\u7528\u6210\u529f
+msg.enableSuccess=\u542f\u7528\u6210\u529f
 msg.resBannedSuccess=\u53cd\u7981\u7528\u6210\u529f
 msg.modifySuccess=\u6570\u636e\u66f4\u65b0\u6210\u529f
 msg.modifyDetailSuccess=\u66f4\u65b0\u660e\u7ec6\u6570\u636e\u6210\u529f

+ 2 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/AddressMapper.java

@@ -30,4 +30,6 @@ public interface AddressMapper extends CommonBaseMapper<Address> {
     List<ComboDTO> getCombo(@Param("companyId") Long companyId);
 
     List<Address> selectAll(@Param("companyId") Long companyId);
+
+    int getCountFromPurchase(@Param("id") Long id, @Param("companyId") Long companyId);
 }

+ 2 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/CustomerkindMapper.java

@@ -25,4 +25,6 @@ public interface CustomerkindMapper extends CommonBaseMapper<Customerkind> {
     int selectCountByName(@Param("name") String name, @Param("companyId") Long companyId, @Param("id") Long id);
 
     List<Customerkind> selectAll(@Param("companyId") Long companyId);
+
+    int getCountFromCustomer(@Param("id") Long id, @Param("companyId") Long companyId);
 }

+ 2 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/ProductbrandMapper.java

@@ -26,4 +26,6 @@ public interface ProductbrandMapper extends CommonBaseMapper<Productbrand> {
     int selectCountByName(@Param("name") String name, @Param("companyId") Long companyId, @Param("id") Long id);
 
     List<Productbrand> selectAll(@Param("companyId") Long companyId);
+
+    int getCountFromProduct(@Param("id") Long id, @Param("companyId") Long companyId);
 }

+ 2 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/ProducttypeMapper.java

@@ -25,4 +25,6 @@ public interface ProducttypeMapper extends CommonBaseMapper<Producttype> {
     List<ComboDTO> getCombo(@Param("companyId") Long companyId);
 
     List<Producttype> selectAll(@Param("companyId") Long companyId);
+
+    int getCountFromProduct(@Param("id") Long id, @Param("companyId") Long companyId);
 }

+ 2 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/ProductunitMapper.java

@@ -25,4 +25,6 @@ public interface ProductunitMapper extends CommonBaseMapper<Productunit> {
     List<ComboDTO> getCombo(@Param("companyId") Long companyId);
 
     List<Productunit> selectAll(@Param("companyId") Long companyId);
+
+    int getCountFromProduct(@Param("id") Long id, @Param("companyId") Long companyId);
 }

+ 2 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/VendorkindMapper.java

@@ -26,4 +26,6 @@ public interface VendorkindMapper extends CommonBaseMapper<Vendorkind> {
     int selectCountByName(@Param("name") String name, @Param("companyId") Long companyId, @Param("id") Long id);
 
     List<Vendorkind> selectAll(@Param("companyId") Long companyId);
+
+    int getCountFromVendor(@Param("id") Long id, @Param("companyId") Long companyId);
 }

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

@@ -65,12 +65,25 @@ public class AddressServiceImpl extends CommonBaseServiceImpl<AddressMapper, Add
     @Override
     public boolean removeByPrimaryKey(Long id){
         if(id != null && id > 0){
+            //校验是否有采购单使用了这个地址
+            validUse(id);
             addressMapper.deleteByPrimaryKey(id);
             messageLogService.delete(generateMsgObj(id));
         }
         return true;
     }
 
+    /**
+     * 校验采购地址是否已经被使用
+     * @param id
+     */
+    private void validUse(Long id) {
+        int count = getMapper().getCountFromPurchase(id, BaseContextHolder.getCompanyId());
+        if (count > 0){
+            throw new BizException(BizExceptionCode.BIZ_RELDELETE);
+        }
+    }
+
     /**
      * 批量删除
      * @param ids

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

@@ -10,6 +10,7 @@ import com.usoftchina.saas.commons.dto.DocBaseDTO;
 import com.usoftchina.saas.commons.dto.ListReqDTO;
 import com.usoftchina.saas.commons.exception.BizExceptionCode;
 import com.usoftchina.saas.commons.po.BillCodeSeq;
+import com.usoftchina.saas.commons.po.Operation;
 import com.usoftchina.saas.commons.po.Status;
 import com.usoftchina.saas.context.BaseContextHolder;
 import com.usoftchina.saas.document.entities.Bom;
@@ -200,7 +201,7 @@ public class BomServiceImpl extends CommonBaseServiceImpl<BomMapper, Bom> implem
             getMapper().updateByPrimaryKeySelective(bom);
             //记录LOG
             DocBaseDTO docBaseDTO = generateMsgObj(id, code);
-            messageLogService.close(docBaseDTO);
+            messageLogService.customizeLog(docBaseDTO, Operation.BANNED);
             return docBaseDTO;
         }else{
             throw new BizException(BizExceptionCode.ILLEGAL_ID);
@@ -226,7 +227,7 @@ public class BomServiceImpl extends CommonBaseServiceImpl<BomMapper, Bom> implem
                 getMapper().updateByPrimaryKeySelective(bom);
                 //记录LOG
                 DocBaseDTO docBaseDTO = generateMsgObj(id, code);
-                messageLogService.open(docBaseDTO);
+                messageLogService.customizeLog(docBaseDTO, Operation.ENABLE);
                 return docBaseDTO;
             }else {
                 throw new BizException(BizExceptionCode.BIZ_OPEN);

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

@@ -10,6 +10,7 @@ import com.usoftchina.saas.commons.dto.DocBaseDTO;
 import com.usoftchina.saas.commons.dto.ListReqDTO;
 import com.usoftchina.saas.commons.exception.BizExceptionCode;
 import com.usoftchina.saas.commons.po.BillCodeSeq;
+import com.usoftchina.saas.commons.po.Operation;
 import com.usoftchina.saas.commons.po.Status;
 import com.usoftchina.saas.context.BaseContextHolder;
 import com.usoftchina.saas.document.dto.CustomerDTO;
@@ -365,7 +366,7 @@ public class CustomerServiceImpl extends CommonBaseServiceImpl<CustomerMapper, C
             getMapper().updateByPrimaryKeySelective(customer);
             docBaseDTO = getBaseDTOById(id);
             //日志
-            messageLogService.close(docBaseDTO);
+            messageLogService.customizeLog(docBaseDTO, Operation.BANNED);
         }
         return docBaseDTO;
     }
@@ -400,7 +401,7 @@ public class CustomerServiceImpl extends CommonBaseServiceImpl<CustomerMapper, C
             getMapper().updateByPrimaryKeySelective(customer);
             docBaseDTO = getBaseDTOById(id);
             //日志
-        messageLogService.open(docBaseDTO);
+        messageLogService.customizeLog(docBaseDTO, Operation.ENABLE);
         }
         return docBaseDTO;
     }

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

@@ -60,12 +60,25 @@ public class CustomerkindServiceImpl extends CommonBaseServiceImpl<CustomerkindM
     @Override
     public boolean removeByPrimaryKey(Long id){
         if(id != null && id > 0){
+            //查找客户资料里是否用了该客户类型
+            validUse(id);
             customerkindMapper.deleteByPrimaryKey(id);
             messageLogService.delete(generateMsgObj(id));
         }
         return true;
     }
 
+    /**
+     * 校验客户资料里是否已使用这个客户类型
+     * @param id
+     */
+    private void validUse(Long id) {
+        int count = getMapper().getCountFromCustomer(id, BaseContextHolder.getCompanyId());
+        if (count > 0){
+            throw new BizException(BizExceptionCode.BIZ_RELDELETE);
+        }
+    }
+
     /**
      * 构造 记录日志对象
      * @param id

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

@@ -12,6 +12,7 @@ import com.usoftchina.saas.commons.dto.DocBaseDTO;
 import com.usoftchina.saas.commons.dto.ListReqDTO;
 import com.usoftchina.saas.commons.exception.BizExceptionCode;
 import com.usoftchina.saas.commons.po.BillCodeSeq;
+import com.usoftchina.saas.commons.po.Operation;
 import com.usoftchina.saas.commons.po.Status;
 import com.usoftchina.saas.context.BaseContextHolder;
 import com.usoftchina.saas.document.dto.ProductDTO;
@@ -309,7 +310,7 @@ public class ProductServiceImpl extends CommonBaseServiceImpl<ProductMapper, Pro
             getMapper().updateByPrimaryKeySelective(product);
             //记录LOG
             docBaseDTO = generateMsgObj(id, code);
-            messageLogService.close(docBaseDTO);
+            messageLogService.customizeLog(docBaseDTO, Operation.BANNED);
             return docBaseDTO;
         }else{
             throw new BizException(BizExceptionCode.ILLEGAL_ID);
@@ -336,7 +337,7 @@ public class ProductServiceImpl extends CommonBaseServiceImpl<ProductMapper, Pro
                 getMapper().updateByPrimaryKeySelective(product);
                 //记录LOG
                 docBaseDTO = generateMsgObj(id, code);
-                messageLogService.open(docBaseDTO);
+                messageLogService.customizeLog(docBaseDTO, Operation.ENABLE);
                 return docBaseDTO;
             }
         }else{

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

@@ -56,6 +56,10 @@ public class ProductbrandServiceImpl extends CommonBaseServiceImpl<ProductbrandM
 
     @Override
     public boolean removeByPrimaryKey(Long id){
+        if (id == null || id < 0){
+            throw new BizException(BizExceptionCode.ILLEGAL_ID);
+        }
+        validUse(id);
         productbrandMapper.deleteByPrimaryKey(id);
         //记录日志
         DocBaseDTO docBaseDTO = new DocBaseDTO(id, null, LOG_NAME);
@@ -63,6 +67,17 @@ public class ProductbrandServiceImpl extends CommonBaseServiceImpl<ProductbrandM
         return true;
     }
 
+    /**
+     * 校验物料品牌是否已经在使用
+     * @param id
+     */
+    private void validUse(Long id) {
+        int count = getMapper().getCountFromProduct(id, BaseContextHolder.getCompanyId());
+        if (count > 0){
+            throw new BizException(BizExceptionCode.BIZ_RELDELETE);
+        }
+    }
+
     @Override
     public List<ComboDTO> getCombo() {
         return getMapper().getCombo(BaseContextHolder.getCompanyId());

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

@@ -64,6 +64,7 @@ public class ProducttypeServiceImpl extends CommonBaseServiceImpl<ProducttypeMap
     @Override
     public boolean removeByPrimaryKey(Long id){
         if(id != null && id > 0){
+            validUse(id);
             producttypeMapper.deleteByPrimaryKey(id);
             //记录LOG
             messageLogService.delete(generateMsgObj(id));
@@ -71,6 +72,17 @@ public class ProducttypeServiceImpl extends CommonBaseServiceImpl<ProducttypeMap
         return true;
     }
 
+    /**
+     * 校验物料类型是否已经被物料资料所使用
+     * @param id
+     */
+    private void validUse(Long id) {
+        int count = getMapper().getCountFromProduct(id, BaseContextHolder.getCompanyId());
+        if (count > 0){
+            throw new BizException(BizExceptionCode.BIZ_RELDELETE);
+        }
+    }
+
     /**
      * 构造 记录日志对象
      * @param id

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

@@ -52,6 +52,7 @@ public class ProductunitServiceImpl extends CommonBaseServiceImpl<ProductunitMap
     @Override
     public boolean removeByPrimaryKey(Long id){
         if(id != null && id > 0){
+            validUse(id);
             getMapper().deleteByPrimaryKey(id);
             //记录LOG
             messageLogService.delete(generateMsgObj(id));
@@ -59,6 +60,17 @@ public class ProductunitServiceImpl extends CommonBaseServiceImpl<ProductunitMap
         return true;
     }
 
+    /**
+     * 校验物料单位是否已使用
+     * @param id
+     */
+    private void validUse(Long id) {
+        int count = getMapper().getCountFromProduct(id, BaseContextHolder.getCompanyId());
+        if (count > 0){
+            throw new BizException(BizExceptionCode.BIZ_RELDELETE);
+        }
+    }
+
     @Override
     public List<Productunit> findAll(){
         List<Productunit> productunitList = getMapper().selectAll();

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

@@ -11,6 +11,7 @@ import com.usoftchina.saas.commons.dto.DocBaseDTO;
 import com.usoftchina.saas.commons.dto.ListReqDTO;
 import com.usoftchina.saas.commons.exception.BizExceptionCode;
 import com.usoftchina.saas.commons.po.BillCodeSeq;
+import com.usoftchina.saas.commons.po.Operation;
 import com.usoftchina.saas.commons.po.Status;
 import com.usoftchina.saas.context.BaseContextHolder;
 import com.usoftchina.saas.document.dto.VendorDTO;
@@ -303,7 +304,7 @@ public class VendorServiceImpl extends CommonBaseServiceImpl<VendorMapper, Vendo
             getMapper().updateByPrimaryKeySelective(vendor);
             //记录LOG
             DocBaseDTO docBaseDTO = generateMsgObj(id, code);
-            messageLogService.close(docBaseDTO);
+            messageLogService.customizeLog(docBaseDTO, Operation.BANNED);
             return docBaseDTO;
         }else{
             throw new BizException(BizExceptionCode.ILLEGAL_ID);
@@ -331,7 +332,7 @@ public class VendorServiceImpl extends CommonBaseServiceImpl<VendorMapper, Vendo
                 getMapper().updateByPrimaryKeySelective(vendor);
                 //记录LOG
                 DocBaseDTO docBaseDTO = generateMsgObj(id, code);
-                messageLogService.open(docBaseDTO);
+                messageLogService.customizeLog(docBaseDTO, Operation.ENABLE);
                 return docBaseDTO;
             }else {
                 throw new BizException(BizExceptionCode.BIZ_OPEN);

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

@@ -54,6 +54,7 @@ public class VendorkindServiceImpl extends CommonBaseServiceImpl<VendorkindMappe
     @Override
     public boolean removeByPrimaryKey(Long id){
         if(id != null && id > 0){
+            validUse(id);
             vendorkindMapper.deleteByPrimaryKey(id);
             //记录LOG
             messageLogService.delete(generateMsgObj(id));
@@ -61,6 +62,17 @@ public class VendorkindServiceImpl extends CommonBaseServiceImpl<VendorkindMappe
         return true;
     }
 
+    /**
+     * 校验供应商类型是否已被供应商资料使用
+     * @param id
+     */
+    private void validUse(Long id) {
+        int count = getMapper().getCountFromVendor(id, BaseContextHolder.getCompanyId());
+        if (count > 0){
+            throw new BizException(BizExceptionCode.BIZ_RELDELETE);
+        }
+    }
+
     /**
      * 构造 记录日志对象
      * @param id

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

@@ -10,6 +10,7 @@ import com.usoftchina.saas.commons.dto.DocBaseDTO;
 import com.usoftchina.saas.commons.dto.ListReqDTO;
 import com.usoftchina.saas.commons.exception.BizExceptionCode;
 import com.usoftchina.saas.commons.po.BillCodeSeq;
+import com.usoftchina.saas.commons.po.Operation;
 import com.usoftchina.saas.commons.po.Status;
 import com.usoftchina.saas.context.BaseContextHolder;
 import com.usoftchina.saas.document.entities.Warehouse;
@@ -180,7 +181,7 @@ public class WarehouseServiceImpl extends CommonBaseServiceImpl<WarehouseMapper,
             getMapper().updateByPrimaryKeySelective(warehouse);
             //记录LOG
             DocBaseDTO docBaseDTO = generateMsgObj(id, code);
-            messageLogService.close(docBaseDTO);
+            messageLogService.customizeLog(docBaseDTO, Operation.BANNED);
             return docBaseDTO;
         }else{
             throw new BizException(BizExceptionCode.ILLEGAL_ID);
@@ -206,7 +207,7 @@ public class WarehouseServiceImpl extends CommonBaseServiceImpl<WarehouseMapper,
                 getMapper().updateByPrimaryKeySelective(warehouse);
                 //记录LOG
                 DocBaseDTO docBaseDTO = generateMsgObj(id, code);
-                messageLogService.open(docBaseDTO);
+                messageLogService.customizeLog(docBaseDTO, Operation.ENABLE);
                 return docBaseDTO;
             }else {
                 throw new BizException(BizExceptionCode.BIZ_OPEN);

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

@@ -198,4 +198,7 @@
     <select id="getCombo" resultType="com.usoftchina.saas.commons.dto.ComboDTO">
         SELECT AD_ADDRESS display,AD_ADDRESS value FROM ADDRESS WHERE COMPANYID=#{companyId}
     </select>
+    <select id="getCountFromPurchase" resultType="int">
+        SELECT COUNT(*) FROM PURCHASE WHERE PU_SHIPADDRESSCODE = (SELECT AD_ADDRESS FROM ADDRESS WHERE AD_ID = #{id}) AND companyId = #{companyId}
+    </select>
 </mapper>

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

@@ -340,6 +340,10 @@
         select bk_bankcode from bankinformation where bk_bankcode = #{bk_bankcode,jdbcType=VARCHAR}
     </select>
 
+  <select id="selectBankId" parameterType="java.lang.String" resultType="java.lang.Long">
+        select bk_id from bankinformation where bk_bankcode = #{bk_bankcode,jdbcType=VARCHAR}
+   </select>
+
   <select id="check" parameterMap="checkParamMap" statementType="CALLABLE">
         CALL SP_LIMITBASE(?, ?, ?, ?,?)
     </select>

+ 3 - 0
applications/document/document-server/src/main/resources/mapper/CustomerkindMapper.xml

@@ -139,4 +139,7 @@
             </if>
         </where>
     </select>
+    <select id="getCountFromCustomer" resultType="int">
+        SELECT COUNT(*) FROM CUSTOMER WHERE CU_TYPE = (SELECT CK_NAME FROM CUSTOMERKIND WHERE CK_ID = #{id}) AND companyid = #{companyId};
+    </select>
 </mapper>

+ 3 - 0
applications/document/document-server/src/main/resources/mapper/ProductbrandMapper.xml

@@ -146,4 +146,7 @@
         </if>
     </where>
   </select>
+    <select id="getCountFromProduct" resultType="int">
+        SELECT COUNT(*) FROM PRODUCT WHERE PR_BRAND = (SELECT PB_NAME FROM PRODUCTBRAND WHERE PB_ID = #{id}) AND companyId = #{companyId}
+    </select>
 </mapper>

+ 3 - 0
applications/document/document-server/src/main/resources/mapper/ProducttypeMapper.xml

@@ -145,4 +145,7 @@
     <select id="getCombo" resultType="com.usoftchina.saas.commons.dto.ComboDTO">
         SELECT PT_NAME display,PT_NAME value FROM PRODUCTTYPE WHERE COMPANYID=#{companyId}
     </select>
+    <select id="getCountFromProduct" resultType="int">
+        SELECT COUNT(*) FROM PRODUCT WHERE PR_KIND = (SELECT PT_NAME FROM PRODUCTTYPE WHERE PT_ID = #{id}) AND companyId=#{companyId}
+    </select>
 </mapper>

+ 3 - 0
applications/document/document-server/src/main/resources/mapper/ProductunitMapper.xml

@@ -139,4 +139,7 @@
     <select id="getCombo" resultType="com.usoftchina.saas.commons.dto.ComboDTO">
         SELECT PU_NAME display,PU_NAME value FROM PRODUCTUNIT WHERE COMPANYID=#{companyId}
     </select>
+    <select id="getCountFromProduct" resultType="int">
+        SELECT COUNT(*) FROM PRODUCT WHERE PR_UNIT = (SELECT PU_NAME FROM PRODUCTUNIT WHERE PU_ID = #{id}) AND companyId = #{companyId}
+    </select>
 </mapper>

+ 3 - 0
applications/document/document-server/src/main/resources/mapper/VendorkindMapper.xml

@@ -145,4 +145,7 @@
         </if>
     </where>
   </select>
+    <select id="getCountFromVendor" resultType="int">
+        SELECT COUNT(*) FROM VENDOR WHERE VE_TYPE = (SELECT VK_NAME FROM VENDORKIND WHERE VK_ID = #{id}) AND companyId = #{companyId}
+    </select>
 </mapper>

+ 1 - 1
applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/FundtransferdetailMapper.java

@@ -13,7 +13,7 @@ public interface FundtransferdetailMapper {
 
     int insertSelective(Fundtransferdetail record);
 
-    List<Fundtransferdetail> selectByPrimaryKey(@Param("id") Integer ftdId, @Param("companyId") Integer companyId);
+    List<Fundtransferdetail> selectByPrimaryKeyList(@Param("id") Integer ftdId, @Param("companyId") Integer companyId);
 
     int updateByPrimaryKeySelective(Fundtransferdetail record);
 

+ 19 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Fundtransferdetail.java

@@ -47,6 +47,25 @@ public class Fundtransferdetail extends CommonBaseEntity implements Serializable
 
     private String ftd_text5;
 
+    private Double bk_outthisamount;
+    private Double bk_inthisamount;
+
+    public Double getBk_outthisamount() {
+        return bk_outthisamount;
+    }
+
+    public void setBk_outthisamount(Double bk_outthisamount) {
+        this.bk_outthisamount = bk_outthisamount;
+    }
+
+    public Double getBk_inthisamount() {
+        return bk_inthisamount;
+    }
+
+    public void setBk_inthisamount(Double bk_inthisamount) {
+        this.bk_inthisamount = bk_inthisamount;
+    }
+
     public Date getFt_date() {
         return ft_date;
     }

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

@@ -200,7 +200,7 @@ public class FundtransferServiceImpl extends CommonBaseServiceImpl<FundtransferM
 
         //资金
         //取从表金额
-        List<Fundtransferdetail> fundtransferdetailList = fundtransferdetailMapper.selectByPrimaryKey(id, Math.toIntExact(BaseContextHolder.getCompanyId()));
+        List<Fundtransferdetail> fundtransferdetailList = fundtransferdetailMapper.selectByPrimaryKeyList(id, Math.toIntExact(BaseContextHolder.getCompanyId()));
         Iterator isList = fundtransferdetailList.iterator();
         while (isList.hasNext()){
             Fundtransferdetail fundtransferdetail = (Fundtransferdetail) isList.next();
@@ -305,7 +305,7 @@ public class FundtransferServiceImpl extends CommonBaseServiceImpl<FundtransferM
     public Fundtran select(int id) {
         Fundtran fundtran = new Fundtran();
         fundtran.setMain(fundtransferMapper.selectByPrimaryKey(id));
-        fundtran.setItems(fundtransferdetailMapper.selectByPrimaryKey(id, Math.toIntExact(BaseContextHolder.getCompanyId())));
+        fundtran.setItems(fundtransferdetailMapper.selectByPrimaryKeyList(id, Math.toIntExact(BaseContextHolder.getCompanyId())));
         return fundtran;
     }
 

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

@@ -25,12 +25,17 @@
     <result column="ftd_text3" property="ftd_text3" jdbcType="VARCHAR" />
     <result column="ftd_text4" property="ftd_text4" jdbcType="VARCHAR" />
     <result column="ftd_text5" property="ftd_text5" jdbcType="VARCHAR" />
+      <result column="bk_outthisamount" property="bk_outthisamount" jdbcType="DOUBLE" />
+      <result column="bk_inthisamount" property="bk_inthisamount" jdbcType="DOUBLE" />
   </resultMap>
   <sql id="Base_Column_List" >
     ftd_id, ftd_ftid, ftd_detno, ftd_ym, ftd_bankid, ftd_bankcode, ftd_bankname, ftd_inbankid, 
     ftd_inbankcode, ftd_inbankname, ftd_nowbalance, ftd_paymethod, ftd_paycode, ftd_remark, 
     companyid, updaterId, updatedate, ftd_text1, ftd_text2, ftd_text3, ftd_text4, ftd_text5
   </sql>
+    <sql id="Bank_Column_List">
+        b.bk_thisamount as bk_outthisamount,c.bk_thisamount as bk_inthisamount
+    </sql>
   <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
     select 
     <include refid="Base_Column_List" />
@@ -38,6 +43,16 @@
     where ftd_ftid = #{id,jdbcType=INTEGER} and companyId = #{companyId}
   </select>
 
+    <select id="selectByPrimaryKeyList" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
+    select
+    <include refid="Base_Column_List"/>,
+        <include refid="Bank_Column_List" />
+    from fundtransferdetail,
+    (select bk_id,bk_thisamount from bankinformation) b,
+    (select bk_id, bk_thisamount from bankinformation)c
+    where ftd_ftid = #{id,jdbcType=INTEGER} and companyId = #{companyId} and ftd_bankid = b.bk_id and
+    ftd_inbankid = c.bk_id
+    </select>
   <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
     delete from fundtransferdetail
     where ftd_ftid = #{id,jdbcType=INTEGER}

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

@@ -32,7 +32,7 @@
     select 
     <include refid="Base_Column_List" />
     from paybalancedet
-    where pd_pbid = #{id,jdbcType=INTEGER} order by pd_id desc
+    where pd_pbid = #{id,jdbcType=INTEGER} order by pd_detno asc
   </select>
   <delete id="deleteItem" parameterType="java.lang.Integer" >
     delete from paybalancedet

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

@@ -90,7 +90,7 @@
     select 
     <include refid="Base_Column_List" />
     from recbalancedet
-    where rd_rbid = #{id,jdbcType=INTEGER} order by rd_id desc
+    where rd_rbid = #{id,jdbcType=INTEGER} order by rd_detno asc
   </select>
   <delete id="deleteItem" parameterType="java.lang.Integer">
     delete from recbalancedet

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

@@ -32,4 +32,8 @@ public interface PurchaseMapper extends CommonBaseMapper<Purchase>{
     Integer checkTurnInstatus(Long id);
 
     void updateCreator(@Param("userId") Long userId,@Param("userName") String userName,@Param("id") Long pu_id);
+
+    Integer validateVendor(@Param("id") Long id);
+
+    Integer validateProduct(@Param("id") Long id);
 }

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

@@ -499,6 +499,17 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
     public Result singleAudit(Long id) {
         DocBaseDTO docBaseDTO = getBaseDTOById(id);
         Result result = Result.success(docBaseDTO);
+        //检查供应商是否开启状态
+        Integer count =0;
+        count = purchaseMapper.validateVendor(id);
+        if (count != 0) {
+            throw new BizException(BizExceptionCode.VENDOR_ISCLOSE);
+        }
+        //检查物料是否开启状态
+        count = purchaseMapper.validateProduct(id);
+        if (count != 0) {
+            throw new BizException(BizExceptionCode.PRODUCT_ISCLOSE);
+        }
         //检查最小包装数
         result.setMessage(purchasedetailMapper.checkzxbzs(id));
         commonService.commonAudit("purchase", "pu_id=" + id, "pu_status",

+ 9 - 0
applications/purchase/purchase-server/src/main/resources/mapper/PurchaseMapper.xml

@@ -436,5 +436,14 @@
     update purchase set creatorId = #{userId} , creatorName=#{userName} where pu_id=#{id}
   </update>
 
+  <select id="validateVendor" resultType="int" >
+    select count(1) from vendor where ve_id = (select pu_vendid from purchase where pu_id=#{id}) and ve_statuscode='CLOSE';
+  </select>
+
+  <select id="validateProduct" resultType="int" >
+    select count(1) from purchasedetail left join product on PD_PRODID=pr_id where  pd_puid=#{id} and pr_statuscode='CLOSE';
+  </select>
+
+
 
 </mapper>

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

@@ -21,7 +21,7 @@ import com.usoftchina.saas.exception.BizException;
 import com.usoftchina.saas.exception.ExceptionCode;
 import com.usoftchina.saas.page.PageDefault;
 import com.usoftchina.saas.page.PageRequest;
-import com.usoftchina.saas.server.error.ServletErrorUtils;
+import com.usoftchina.saas.server.web.ServletUtils;
 import com.usoftchina.saas.socket.api.SocketMessageApi;
 import com.usoftchina.saas.utils.BeanMapper;
 import com.usoftchina.saas.utils.CollectionUtils;
@@ -136,7 +136,7 @@ public class AuthController {
                     accountDTO = createAccountByCookieInfo(info);
                 } else {
                     logger.error(result.getMessage());
-                    ServletErrorUtils.writeJsonPMessage(response, callback, false);
+                    ServletUtils.writeJsonPMessage(response, callback, false);
                     return;
                 }
             } else {
@@ -147,7 +147,7 @@ public class AuthController {
                     Result updateResult = accountApi.update(BeanMapper.map(accountDTO, AccountUpdateDTO.class));
                     if (!updateResult.isSuccess()) {
                         logger.error(updateResult.getMessage());
-                        ServletErrorUtils.writeJsonPMessage(response, callback, false);
+                        ServletUtils.writeJsonPMessage(response, callback, false);
                         return;
                     }
                 }
@@ -170,7 +170,7 @@ public class AuthController {
                 socketMessageApi.sendToClient(clientId, "/sso/callback",
                         JsonUtils.toJsonString(new AuthDTO(tokenDTO, accountDTO)));
             }
-            ServletErrorUtils.writeJsonPMessage(response, callback, true);
+            ServletUtils.writeJsonPMessage(response, callback, true);
         }
     }
 

+ 0 - 28
framework/server-starter/src/main/java/com/usoftchina/saas/server/error/ServletErrorUtils.java

@@ -50,32 +50,4 @@ public class ServletErrorUtils {
         writer.flush();
     }
 
-    public static void writeMessage(HttpServletResponse response, String text) throws IOException {
-        response.setContentType(MediaType.TEXT_HTML_VALUE);
-        response.setCharacterEncoding("UTF-8");
-        PrintWriter writer = response.getWriter();
-        writer.print(text);
-        writer.flush();
-    }
-
-    /**
-     * 输出jsonp
-     *
-     * @param response
-     * @param callbackFn
-     * @param success
-     * @throws IOException
-     */
-    public static void writeJsonPMessage(HttpServletResponse response, String callbackFn, boolean success) throws IOException {
-        response.setContentType(MediaType.TEXT_HTML_VALUE);
-        response.setCharacterEncoding("UTF-8");
-        PrintWriter writer = response.getWriter();
-        writer.print(buildJsonPMessage(callbackFn, success));
-        writer.flush();
-    }
-
-    public static String buildJsonPMessage(String callbackFn, boolean success) {
-        return String.format("%s({success:\"%s\"})", callbackFn, success ? 1 : 0);
-    }
-
 }

+ 41 - 0
framework/server-starter/src/main/java/com/usoftchina/saas/server/web/ServletUtils.java

@@ -0,0 +1,41 @@
+package com.usoftchina.saas.server.web;
+
+import org.springframework.http.MediaType;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.PrintWriter;
+
+/**
+ * @author yingp
+ * @date 2018/11/19
+ */
+public class ServletUtils {
+    public static void writeMessage(HttpServletResponse response, String text) throws IOException {
+        response.setContentType(MediaType.TEXT_HTML_VALUE);
+        response.setCharacterEncoding("UTF-8");
+        PrintWriter writer = response.getWriter();
+        writer.print(text);
+        writer.flush();
+    }
+
+    /**
+     * 输出jsonp
+     *
+     * @param response
+     * @param callbackFn
+     * @param success
+     * @throws IOException
+     */
+    public static void writeJsonPMessage(HttpServletResponse response, String callbackFn, boolean success) throws IOException {
+        response.setContentType(MediaType.TEXT_HTML_VALUE);
+        response.setCharacterEncoding("UTF-8");
+        PrintWriter writer = response.getWriter();
+        writer.print(buildJsonPMessage(callbackFn, success));
+        writer.flush();
+    }
+
+    public static String buildJsonPMessage(String callbackFn, boolean success) {
+        return String.format("%s({success:\"%s\"})", callbackFn, success ? 1 : 0);
+    }
+}

+ 2 - 1
frontend/saas-web/Dockerfile

@@ -2,4 +2,5 @@ FROM hub.c.163.com/library/nginx
 MAINTAINER USOFTCHINA <yingp@usoftchina.com>
 RUN rm /etc/nginx/conf.d/default.conf
 ADD runtime/nginx/default.conf /etc/nginx/conf.d/
-COPY build/production/saas/ /usr/share/nginx/html/
+COPY build/production/saas/ /usr/share/nginx/html/
+COPY set-token.html /usr/share/nginx/html/

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

@@ -97,7 +97,7 @@ Ext.define('saas.view.money.othspendings.FormPanel', {
                         this.dialog = form.getController().getView().add({
                             xtype: 'document-kind-childwin',
                             bind: {
-                                title: '新增收入类别'
+                                title: '新增支出类别'
                             },
                             dataKind:'inoutkind',
                             belong:document.etc['inoutkind'],

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

@@ -233,7 +233,6 @@ Ext.define('saas.view.purchase.purchaseIn.QueryPanel', {
         },{
             text: '相关单号',
             dataIndex: 'pd_ordercode',
-            xtype:'numbercolumn',
             width: 120
         }]
     }