Просмотр исходного кода

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

lazhaoqian 4 лет назад
Родитель
Сommit
016eeb8368
53 измененных файлов с 2046 добавлено и 125 удалено
  1. 4 0
      blade-service-api/blade-deliver-goods-api/src/main/java/org/springblade/deliver/goods/entity/DeliveryFees.java
  2. 21 0
      blade-service-api/blade-deliver-goods-api/src/main/java/org/springblade/deliver/goods/feign/IDeliveryClient.java
  3. 7 0
      blade-service-api/blade-purchase-sales-api/src/main/java/org/springblade/purchase/sales/feign/IOrderItemsClient.java
  4. 34 0
      blade-service-api/trade-finance-api/src/main/java/org/springblade/finance/dto/JdCorpsDTO.java
  5. 34 0
      blade-service-api/trade-finance-api/src/main/java/org/springblade/finance/dto/JdEmployeeDTO.java
  6. 34 0
      blade-service-api/trade-finance-api/src/main/java/org/springblade/finance/dto/JdModuleDTO.java
  7. 34 0
      blade-service-api/trade-finance-api/src/main/java/org/springblade/finance/dto/JdTenantDTO.java
  8. 63 0
      blade-service-api/trade-finance-api/src/main/java/org/springblade/finance/entity/JdCorps.java
  9. 62 0
      blade-service-api/trade-finance-api/src/main/java/org/springblade/finance/entity/JdEmployee.java
  10. 68 0
      blade-service-api/trade-finance-api/src/main/java/org/springblade/finance/entity/JdModule.java
  11. 57 0
      blade-service-api/trade-finance-api/src/main/java/org/springblade/finance/entity/JdTenant.java
  12. 36 0
      blade-service-api/trade-finance-api/src/main/java/org/springblade/finance/vo/JdCorpsVO.java
  13. 36 0
      blade-service-api/trade-finance-api/src/main/java/org/springblade/finance/vo/JdEmployeeVO.java
  14. 36 0
      blade-service-api/trade-finance-api/src/main/java/org/springblade/finance/vo/JdModuleVO.java
  15. 36 0
      blade-service-api/trade-finance-api/src/main/java/org/springblade/finance/vo/JdTenantVO.java
  16. 7 0
      blade-service/blade-check/src/main/java/org/springblade/check/service/impl/AuditProecessServiceImpl.java
  17. 12 0
      blade-service/blade-client/pom.xml
  18. 30 2
      blade-service/blade-client/src/main/java/org/springblade/client/corps/controller/CorpsDescController.java
  19. 12 0
      blade-service/blade-client/src/main/java/org/springblade/client/goods/controller/GoodsDescController.java
  20. 7 0
      blade-service/blade-deliver-goods/src/main/java/org/springblade/deliver/goods/controller/DeliveryItemsController.java
  21. 35 2
      blade-service/blade-deliver-goods/src/main/java/org/springblade/deliver/goods/feign/DeliveryClient.java
  22. 2 1
      blade-service/blade-deliver-goods/src/main/java/org/springblade/deliver/goods/service/impl/DeliveryItemsServiceImpl.java
  23. 6 0
      blade-service/blade-mocha-item/src/main/java/org/springblade/mocha/excel/PriceItemExcel.java
  24. 4 0
      blade-service/blade-mocha-item/src/main/java/org/springblade/mocha/service/impl/PriceItemServiceImpl.java
  25. 123 90
      blade-service/blade-purchase-sales/src/main/java/org/springblade/purchase/sales/controller/OrderController.java
  26. 10 0
      blade-service/blade-purchase-sales/src/main/java/org/springblade/purchase/sales/controller/OrderItemsController.java
  27. 7 0
      blade-service/blade-purchase-sales/src/main/java/org/springblade/purchase/sales/feign/OrderItemsClient.java
  28. 4 4
      blade-service/blade-purchase-sales/src/main/java/org/springblade/purchase/sales/mapper/OrderMapper.xml
  29. 1 0
      blade-service/blade-purchase-sales/src/main/java/org/springblade/purchase/sales/service/impl/OrderServiceImpl.java
  30. 9 21
      blade-service/blade-stock/src/main/java/org/springblade/stock/mapper/StockGoodsMapper.xml
  31. 2 0
      blade-service/trade-finance/src/main/java/org/springblade/finance/controller/AccController.java
  32. 126 0
      blade-service/trade-finance/src/main/java/org/springblade/finance/controller/JdCorpsController.java
  33. 126 0
      blade-service/trade-finance/src/main/java/org/springblade/finance/controller/JdEmployeeController.java
  34. 126 0
      blade-service/trade-finance/src/main/java/org/springblade/finance/controller/JdModuleController.java
  35. 126 0
      blade-service/trade-finance/src/main/java/org/springblade/finance/controller/JdTenantController.java
  36. 42 0
      blade-service/trade-finance/src/main/java/org/springblade/finance/mapper/JdCorpsMapper.java
  37. 19 0
      blade-service/trade-finance/src/main/java/org/springblade/finance/mapper/JdCorpsMapper.xml
  38. 42 0
      blade-service/trade-finance/src/main/java/org/springblade/finance/mapper/JdEmployeeMapper.java
  39. 19 0
      blade-service/trade-finance/src/main/java/org/springblade/finance/mapper/JdEmployeeMapper.xml
  40. 42 0
      blade-service/trade-finance/src/main/java/org/springblade/finance/mapper/JdModuleMapper.java
  41. 20 0
      blade-service/trade-finance/src/main/java/org/springblade/finance/mapper/JdModuleMapper.xml
  42. 42 0
      blade-service/trade-finance/src/main/java/org/springblade/finance/mapper/JdTenantMapper.java
  43. 21 0
      blade-service/trade-finance/src/main/java/org/springblade/finance/mapper/JdTenantMapper.xml
  44. 41 0
      blade-service/trade-finance/src/main/java/org/springblade/finance/service/IJdCorpsService.java
  45. 41 0
      blade-service/trade-finance/src/main/java/org/springblade/finance/service/IJdEmployeeService.java
  46. 41 0
      blade-service/trade-finance/src/main/java/org/springblade/finance/service/IJdModuleService.java
  47. 41 0
      blade-service/trade-finance/src/main/java/org/springblade/finance/service/IJdTenantService.java
  48. 41 0
      blade-service/trade-finance/src/main/java/org/springblade/finance/service/impl/JdCorpsServiceImpl.java
  49. 41 0
      blade-service/trade-finance/src/main/java/org/springblade/finance/service/impl/JdEmployeeServiceImpl.java
  50. 41 0
      blade-service/trade-finance/src/main/java/org/springblade/finance/service/impl/JdModuleServiceImpl.java
  51. 41 0
      blade-service/trade-finance/src/main/java/org/springblade/finance/service/impl/JdTenantServiceImpl.java
  52. 133 5
      blade-service/trade-finance/src/main/java/org/springblade/finance/service/impl/SettlementServiceImpl.java
  53. 1 0
      blade-service/trade-finance/src/main/java/org/springblade/finance/tool/JdyTool.java

+ 4 - 0
blade-service-api/blade-deliver-goods-api/src/main/java/org/springblade/deliver/goods/entity/DeliveryFees.java

@@ -180,5 +180,9 @@ public class DeliveryFees implements Serializable {
 	@ApiModelProperty(value = "1.应收 2.应付")
 		private int feesType;
 
+	private String srcOrderNo;
+	private BigDecimal refundSettlmentAmount;
+	private Integer isCheck;
+
 
 }

+ 21 - 0
blade-service-api/blade-deliver-goods-api/src/main/java/org/springblade/deliver/goods/feign/IDeliveryClient.java

@@ -1,10 +1,18 @@
 package org.springblade.deliver.goods.feign;
 
+import io.swagger.annotations.ApiParam;
 import org.springblade.common.constant.LauncherConstant;
 import org.springblade.core.tool.api.R;
 import org.springblade.deliver.goods.entity.Delivery;
+import org.springblade.deliver.goods.entity.DeliveryFees;
+import org.springblade.deliver.goods.entity.DeliveryItems;
 import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestParam;
+
+import java.util.List;
 
 @FeignClient(
 	value = LauncherConstant.APPLICATION_DELIVER_GOODS_NAME
@@ -12,6 +20,9 @@ import org.springframework.web.bind.annotation.PostMapping;
 public interface IDeliveryClient {
 	String API_PREFIX = "/client";
 	String CREATE_DELIVER_GOODS = API_PREFIX + "create-deliver-goods";
+	String LIST_BY_ITEM_ID = API_PREFIX + "listByItemId";
+	String GET_FEES_BY_ID = API_PREFIX + "getFeesById";
+	String SUBMIT_FEES = API_PREFIX + "submitFees";
 
 	/**
 	 * 生成发货单
@@ -20,4 +31,14 @@ public interface IDeliveryClient {
 	 */
 	@PostMapping(CREATE_DELIVER_GOODS)
 	R createDeliverGoods(Delivery delivery);
+
+	@GetMapping(LIST_BY_ITEM_ID)
+	R<List<DeliveryItems>> listByItemId(@RequestParam Long itemId);
+
+	@GetMapping(GET_FEES_BY_ID)
+	R<DeliveryFees> getFeesById(@RequestParam Long feeId);
+
+	@PostMapping(SUBMIT_FEES)
+	R submitFees (@RequestBody DeliveryFees deliveryFees);
+
 }

+ 7 - 0
blade-service-api/blade-purchase-sales-api/src/main/java/org/springblade/purchase/sales/feign/IOrderItemsClient.java

@@ -1,12 +1,16 @@
 package org.springblade.purchase.sales.feign;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import io.swagger.annotations.ApiParam;
 import org.springblade.common.constant.LauncherConstant;
 import org.springblade.core.tool.api.R;
+import org.springblade.purchase.sales.entity.OrderItems;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestParam;
 
 import java.math.BigDecimal;
+import java.util.List;
 
 @FeignClient(
 	value = LauncherConstant.APPLICATION_PURCHASE_SALES_NAME
@@ -35,4 +39,7 @@ public interface IOrderItemsClient {
 						   @RequestParam("actualWeight")BigDecimal actualWeight,
 						   @RequestParam("deliveryType")int deliveryType);
 
+    @GetMapping("/orderitems/listByItemId")
+	R<List<OrderItems>> listByItemId(@RequestParam("itemId") Long itemId);
+
 }

+ 34 - 0
blade-service-api/trade-finance-api/src/main/java/org/springblade/finance/dto/JdCorpsDTO.java

@@ -0,0 +1,34 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.finance.dto;
+
+import org.springblade.finance.entity.JdCorps;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 数据传输对象实体类
+ *
+ * @author BladeX
+ * @since 2022-01-20
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class JdCorpsDTO extends JdCorps {
+	private static final long serialVersionUID = 1L;
+
+}

+ 34 - 0
blade-service-api/trade-finance-api/src/main/java/org/springblade/finance/dto/JdEmployeeDTO.java

@@ -0,0 +1,34 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.finance.dto;
+
+import org.springblade.finance.entity.JdEmployee;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 数据传输对象实体类
+ *
+ * @author BladeX
+ * @since 2022-01-20
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class JdEmployeeDTO extends JdEmployee {
+	private static final long serialVersionUID = 1L;
+
+}

+ 34 - 0
blade-service-api/trade-finance-api/src/main/java/org/springblade/finance/dto/JdModuleDTO.java

@@ -0,0 +1,34 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.finance.dto;
+
+import org.springblade.finance.entity.JdModule;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 租户jd模块表数据传输对象实体类
+ *
+ * @author BladeX
+ * @since 2022-01-20
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class JdModuleDTO extends JdModule {
+	private static final long serialVersionUID = 1L;
+
+}

+ 34 - 0
blade-service-api/trade-finance-api/src/main/java/org/springblade/finance/dto/JdTenantDTO.java

@@ -0,0 +1,34 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.finance.dto;
+
+import org.springblade.finance.entity.JdTenant;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 租户jd配置信息表数据传输对象实体类
+ *
+ * @author BladeX
+ * @since 2022-01-20
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class JdTenantDTO extends JdTenant {
+	private static final long serialVersionUID = 1L;
+
+}

+ 63 - 0
blade-service-api/trade-finance-api/src/main/java/org/springblade/finance/entity/JdCorps.java

@@ -0,0 +1,63 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.finance.entity;
+
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * 实体类
+ *
+ * @author BladeX
+ * @since 2022-01-20
+ */
+@Data
+@ApiModel(value = "JdCorps对象", description = "JdCorps对象")
+public class JdCorps implements Serializable {
+
+	private static final long serialVersionUID = 1L;
+
+	private Long id;
+	/**
+	* 供应商名称
+	*/
+		@ApiModelProperty(value = "供应商名称")
+		private String corpsName;
+	/**
+	* 供应商编号
+	*/
+		@ApiModelProperty(value = "供应商编号")
+		private String corpsCode;
+	/**
+	* 所属账套id
+	*/
+		@ApiModelProperty(value = "所属账套id")
+		private String accountId;
+	/**
+	* 所属账套
+	*/
+		@ApiModelProperty(value = "所属账套")
+		private String accountName;
+
+	@ApiModelProperty(value = "租户id")
+	private String tenantId;
+
+
+}

+ 62 - 0
blade-service-api/trade-finance-api/src/main/java/org/springblade/finance/entity/JdEmployee.java

@@ -0,0 +1,62 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.finance.entity;
+
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * 实体类
+ *
+ * @author BladeX
+ * @since 2022-01-20
+ */
+@Data
+@ApiModel(value = "JdEmployee对象", description = "JdEmployee对象")
+public class JdEmployee implements Serializable {
+
+	private static final long serialVersionUID = 1L;
+
+	private Long id;
+	/**
+	* 业务员
+	*/
+		@ApiModelProperty(value = "业务员")
+		private String employeeName;
+	/**
+	* 业务员编码
+	*/
+		@ApiModelProperty(value = "业务员编码")
+		private String employeeCode;
+	/**
+	* 所属账套id
+	*/
+		@ApiModelProperty(value = "所属账套id")
+		private String accountId;
+	/**
+	* 所属账套
+	*/
+		@ApiModelProperty(value = "所属账套")
+		private String accountName;
+
+
+	@ApiModelProperty(value = "租户id")
+	private String tenantId;
+}

+ 68 - 0
blade-service-api/trade-finance-api/src/main/java/org/springblade/finance/entity/JdModule.java

@@ -0,0 +1,68 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.finance.entity;
+
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * 租户jd模块表实体类
+ *
+ * @author BladeX
+ * @since 2022-01-20
+ */
+@Data
+@ApiModel(value = "JdModule对象", description = "租户jd模块表")
+public class JdModule implements Serializable {
+
+	private static final long serialVersionUID = 1L;
+
+	private Long id;
+	/**
+	* 模块名称
+	*/
+		@ApiModelProperty(value = "模块名称")
+		private String module;
+	/**
+	* d 或 c
+	*/
+		@ApiModelProperty(value = "d 或 c")
+		private String dc;
+	/**
+	* 科目编码
+	*/
+		@ApiModelProperty(value = "科目编码")
+		private String projectCode;
+	/**
+	* 所属账套id
+	*/
+		@ApiModelProperty(value = "所属账套id")
+		private String accountId;
+	/**
+	* 所属账套
+	*/
+		@ApiModelProperty(value = "所属账套")
+		private String accountName;
+
+	@ApiModelProperty(value = "租户id")
+	private String tenantId;
+
+
+}

+ 57 - 0
blade-service-api/trade-finance-api/src/main/java/org/springblade/finance/entity/JdTenant.java

@@ -0,0 +1,57 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.finance.entity;
+
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * 租户jd配置信息表实体类
+ *
+ * @author BladeX
+ * @since 2022-01-20
+ */
+@Data
+@ApiModel(value = "JdTenant对象", description = "租户jd配置信息表")
+public class JdTenant implements Serializable {
+
+	private static final long serialVersionUID = 1L;
+
+	private Long id;
+	/**
+	* 租户名称
+	*/
+		@ApiModelProperty(value = "租户名称")
+		private String tenantName;
+	private String clientId;
+	private String clientSecret;
+	private String username;
+	private String password;
+	/**
+	* 0.未启动 1启动
+	*/
+		@ApiModelProperty(value = "0.未启动 1启动")
+		private Boolean isEnable;
+
+	@ApiModelProperty(value = "租户id")
+	private String tenantId;
+
+
+}

+ 36 - 0
blade-service-api/trade-finance-api/src/main/java/org/springblade/finance/vo/JdCorpsVO.java

@@ -0,0 +1,36 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.finance.vo;
+
+import org.springblade.finance.entity.JdCorps;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+
+/**
+ * 视图实体类
+ *
+ * @author BladeX
+ * @since 2022-01-20
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "JdCorpsVO对象", description = "JdCorpsVO对象")
+public class JdCorpsVO extends JdCorps {
+	private static final long serialVersionUID = 1L;
+
+}

+ 36 - 0
blade-service-api/trade-finance-api/src/main/java/org/springblade/finance/vo/JdEmployeeVO.java

@@ -0,0 +1,36 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.finance.vo;
+
+import org.springblade.finance.entity.JdEmployee;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+
+/**
+ * 视图实体类
+ *
+ * @author BladeX
+ * @since 2022-01-20
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "JdEmployeeVO对象", description = "JdEmployeeVO对象")
+public class JdEmployeeVO extends JdEmployee {
+	private static final long serialVersionUID = 1L;
+
+}

+ 36 - 0
blade-service-api/trade-finance-api/src/main/java/org/springblade/finance/vo/JdModuleVO.java

@@ -0,0 +1,36 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.finance.vo;
+
+import org.springblade.finance.entity.JdModule;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+
+/**
+ * 租户jd模块表视图实体类
+ *
+ * @author BladeX
+ * @since 2022-01-20
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "JdModuleVO对象", description = "租户jd模块表")
+public class JdModuleVO extends JdModule {
+	private static final long serialVersionUID = 1L;
+
+}

+ 36 - 0
blade-service-api/trade-finance-api/src/main/java/org/springblade/finance/vo/JdTenantVO.java

@@ -0,0 +1,36 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.finance.vo;
+
+import org.springblade.finance.entity.JdTenant;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+
+/**
+ * 租户jd配置信息表视图实体类
+ *
+ * @author BladeX
+ * @since 2022-01-20
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "JdTenantVO对象", description = "租户jd配置信息表")
+public class JdTenantVO extends JdTenant {
+	private static final long serialVersionUID = 1L;
+
+}

+ 7 - 0
blade-service/blade-check/src/main/java/org/springblade/check/service/impl/AuditProecessServiceImpl.java

@@ -140,6 +140,7 @@ public class AuditProecessServiceImpl extends ServiceImpl<AuditProecessMapper, A
 					message.setUserName(AuthUtil.getUserName());
 					message.setToUserId(Long.valueOf(e.getAuditUserId()));
 				    message.setMessageType(1);
+				    message.setParameter(String.valueOf(auditProecessDTO.getBillId()));
 					message.setMessageBody("你有新的审批待操作,请及时处理");
 			      	message.setUrl("/approveData/index");
 					R save = messageClient.save(message);
@@ -195,6 +196,7 @@ public class AuditProecessServiceImpl extends ServiceImpl<AuditProecessMapper, A
 		}
 		//信息
 		Message sendMessage=new Message();
+		sendMessage.setParameter(String.valueOf(auditProecess.getBillId()));
 		sendMessage.setUserName(AuthUtil.getUserName());
 		sendMessage.setUserId(AuthUtil.getUserId());
 		sendMessage.setToUserId(auditProecess.getSendUserId());
@@ -265,6 +267,7 @@ public class AuditProecessServiceImpl extends ServiceImpl<AuditProecessMapper, A
 				Message message=new Message();
 				message.setUserName(AuthUtil.getUserName());
 				message.setUserId(AuthUtil.getUserId());
+				message.setParameter(String.valueOf(auditProecess.getBillId()));
 				//消息通知下一级
 				message.setToUserId(Long.valueOf(proecess.getAuditUserId()));
 				message.setMessageType(1);
@@ -373,6 +376,7 @@ public class AuditProecessServiceImpl extends ServiceImpl<AuditProecessMapper, A
 		}
 		//信息
 		Message sendMessage=new Message();
+		sendMessage.setParameter(String.valueOf(auditProecess.getBillId()));
 		sendMessage.setUserName(AuthUtil.getUserName());
 		sendMessage.setUserId(AuthUtil.getUserId());
 		sendMessage.setToUserId(auditProecess.getSendUserId());
@@ -441,6 +445,7 @@ public class AuditProecessServiceImpl extends ServiceImpl<AuditProecessMapper, A
 				proecess.setAuditStatus("S");
 				baseMapper.updateById(proecess);
 				Message message=new Message();
+				message.setParameter(String.valueOf(auditProecess.getBillId()));
 				message.setUserName(AuthUtil.getUserName());
 				message.setUserId(AuthUtil.getUserId());
 				//消息通知下一级
@@ -550,6 +555,7 @@ public class AuditProecessServiceImpl extends ServiceImpl<AuditProecessMapper, A
 		}
 		//信息
 		Message sendMessage=new Message();
+		sendMessage.setParameter(String.valueOf(auditProecess.getBillId()));
 		sendMessage.setUserName(AuthUtil.getUserName());
 		sendMessage.setUserId(AuthUtil.getUserId());
 		sendMessage.setToUserId(auditProecess.getSendUserId());
@@ -618,6 +624,7 @@ public class AuditProecessServiceImpl extends ServiceImpl<AuditProecessMapper, A
 				proecess.setAuditStatus("S");
 				baseMapper.updateById(proecess);
 				Message message=new Message();
+				message.setParameter(String.valueOf(auditProecess.getBillId()));
 				message.setUserName(AuthUtil.getUserName());
 				message.setUserId(AuthUtil.getUserId());
 				//消息通知下一级

+ 12 - 0
blade-service/blade-client/pom.xml

@@ -125,6 +125,18 @@
             <version>2.8.2.RELEASE</version>
             <scope>compile</scope>
         </dependency>
+        <dependency>
+            <groupId>org.springblade</groupId>
+            <artifactId>blade-purchase-sales-api</artifactId>
+            <version>2.8.2.RELEASE</version>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springblade</groupId>
+            <artifactId>trade-finance-api</artifactId>
+            <version>2.8.2.RELEASE</version>
+            <scope>compile</scope>
+        </dependency>
     </dependencies>
 
 

+ 30 - 2
blade-service/blade-client/src/main/java/org/springblade/client/corps/controller/CorpsDescController.java

@@ -1,6 +1,5 @@
 package org.springblade.client.corps.controller;
 
-import com.alibaba.excel.event.Order;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -29,6 +28,10 @@ import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.secure.utils.SecureUtil;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.Func;
+import org.springblade.finance.feign.IFinanceClient;
+import org.springblade.finance.vojo.Acc;
+import org.springblade.purchase.sales.entity.Order;
+import org.springblade.purchase.sales.feign.IOrderDescClient;
 import org.springblade.system.user.entity.User;
 import org.springblade.system.user.feign.IUserClient;
 import org.springframework.web.bind.annotation.*;
@@ -54,6 +57,9 @@ public class CorpsDescController extends BladeController {
 
 	private final ICorpsDescService corpsDescService;
 	private final IUserClient userClient;
+	private final IOrderDescClient orderDescClient;
+	private final IFinanceClient financeClient;
+
 
 	/**
 	 * 详情
@@ -126,10 +132,32 @@ public class CorpsDescController extends BladeController {
 	@ApiOperationSupport(order = 5)
 	@ApiOperation(value = "修改", notes = "传入corpsDesc")
 	public R update(@Valid @RequestBody CorpsDesc corpsDesc) {
-		//
 		if (corpsDesc.getId() == null) {
 			return R.data(500, "请选择要删除的数据", "error");
 		}
+		//删除客户详情,增加校验
+
+		//采购销售校验
+		Order order=new Order();
+		order.setCorpId(corpsDesc.getId());
+		order.setTenantId(AuthUtil.getTenantId());
+		R<List<Order>> byConditions = orderDescClient.getByConditions(order);
+		if(byConditions.isSuccess()&&byConditions.getData().size()>0)
+		{
+         throw new SecurityException("存在绑定的订单信息,禁止删除");
+		}
+		//财务校验
+		Acc acc=new Acc();
+		acc.setCorpId(corpsDesc.getId());
+		acc.setTenantId(AuthUtil.getTenantId());
+		R<List<Acc>> accListByCondition = financeClient.getAccListByCondition(acc);
+		if(accListByCondition.isSuccess()&&accListByCondition.getData().size()>0)
+		{
+			throw new SecurityException("存在绑定的财务信息,禁止删除");
+		}
+
+
+
 		corpsDesc.setIsDeleted(1);
 		return R.status(corpsDescService.updateById(corpsDesc));
 	}

+ 12 - 0
blade-service/blade-client/src/main/java/org/springblade/client/goods/controller/GoodsDescController.java

@@ -49,6 +49,8 @@ import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.secure.utils.SecureUtil;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.Func;
+import org.springblade.purchase.sales.entity.OrderItems;
+import org.springblade.purchase.sales.feign.IOrderItemsClient;
 import org.springblade.stock.entity.StockGoods;
 import org.springblade.stock.feign.IStockGoodsClient;
 import org.springframework.beans.BeanUtils;
@@ -88,6 +90,8 @@ public class GoodsDescController extends BladeController {
     private final IGoodsTypeService goodsDescType;
 
     private final IStockGoodsClient stockGoodsClient;//库存接口
+
+	private final IOrderItemsClient orderItemsClient;
 	/**
 	 * 详情
 	 */
@@ -247,6 +251,14 @@ public class GoodsDescController extends BladeController {
 			return R.fail(500,"请选择要删除的数据");
 		}
 		goodsDesc.setIsDeleted(1);
+
+
+		R<List<OrderItems>> listR = orderItemsClient.listByItemId(goodsDesc.getId());
+		if(listR.isSuccess()&&listR.getData().size()>0)
+		{
+			throw new SecurityException("存在绑定明细信息,禁止删除");
+		}
+
 		return R.status(goodsDescService.updateById(goodsDesc));
 	}
 

+ 7 - 0
blade-service/blade-deliver-goods/src/main/java/org/springblade/deliver/goods/controller/DeliveryItemsController.java

@@ -16,6 +16,7 @@
  */
 package org.springblade.deliver.goods.controller;
 
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.StringUtils;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -33,6 +34,7 @@ import org.springblade.deliver.goods.entity.Delivery;
 import org.springblade.deliver.goods.entity.DeliveryFees;
 import org.springblade.deliver.goods.enums.DeliveryStatusEnum;
 import org.springblade.deliver.goods.service.IDeliveryService;
+import org.springblade.purchase.sales.entity.OrderItems;
 import org.springframework.web.bind.annotation.*;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import org.springblade.deliver.goods.entity.DeliveryItems;
@@ -40,6 +42,8 @@ import org.springblade.deliver.goods.vo.DeliveryItemsVO;
 import org.springblade.deliver.goods.service.IDeliveryItemsService;
 import org.springblade.core.boot.ctrl.BladeController;
 
+import java.util.List;
+
 /**
  * 发货明细 控制器
  *
@@ -146,4 +150,7 @@ public class DeliveryItemsController extends BladeController {
 	}
 
 
+
+
+
 }

+ 35 - 2
blade-service/blade-deliver-goods/src/main/java/org/springblade/deliver/goods/feign/DeliveryClient.java

@@ -1,20 +1,29 @@
 package org.springblade.deliver.goods.feign;
 
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import io.swagger.annotations.ApiParam;
 import lombok.AllArgsConstructor;
 import org.springblade.core.tenant.annotation.NonDS;
 import org.springblade.core.tool.api.R;
 import org.springblade.deliver.goods.entity.Delivery;
+import org.springblade.deliver.goods.entity.DeliveryFees;
+import org.springblade.deliver.goods.entity.DeliveryItems;
+import org.springblade.deliver.goods.service.IDeliveryFeesService;
+import org.springblade.deliver.goods.service.IDeliveryItemsService;
 import org.springblade.deliver.goods.service.IDeliveryService;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 import springfox.documentation.annotations.ApiIgnore;
 
+import java.util.List;
+
 @NonDS
 @ApiIgnore()
 @RestController
 @AllArgsConstructor
 public class DeliveryClient implements IDeliveryClient{
 	private IDeliveryService deliveryService;//发货 收货信息
+	private IDeliveryItemsService deliveryItemsService;
+	private IDeliveryFeesService feesService;
 
 	/**
 	 * 生成发货信息
@@ -26,4 +35,28 @@ public class DeliveryClient implements IDeliveryClient{
 	public R createDeliverGoods(Delivery delivery) {
 		return deliveryService.submitDelivery(delivery);
 	}
+
+	@Override
+	@GetMapping(LIST_BY_ITEM_ID)
+	public R<List<DeliveryItems>> listByItemId(Long itemId) {
+		LambdaQueryWrapper<DeliveryItems> orderItemsLambdaQueryWrapper=new LambdaQueryWrapper<>();
+		orderItemsLambdaQueryWrapper.eq(DeliveryItems::getItemId,itemId).eq(DeliveryItems::getIsDeleted,0);
+		List<DeliveryItems> list = deliveryItemsService.list(orderItemsLambdaQueryWrapper);
+		return R.data(list);
+	}
+
+	@Override
+	@GetMapping(GET_FEES_BY_ID)
+	public R<DeliveryFees> getFeesById(Long feeId) {
+
+		return R.data(feesService.getById(feeId));
+	}
+
+	@Override
+	@PostMapping(SUBMIT_FEES)
+	public R submitFees(@RequestBody DeliveryFees deliveryFees)
+	{
+		feesService.updateById(deliveryFees);
+		return R.success("操作成功");
+	}
 }

+ 2 - 1
blade-service/blade-deliver-goods/src/main/java/org/springblade/deliver/goods/service/impl/DeliveryItemsServiceImpl.java

@@ -555,7 +555,8 @@ public class DeliveryItemsServiceImpl extends ServiceImpl<DeliveryItemsMapper, D
 				List<DeliveryItems> deliveryItems = baseMapper.selectItem(SecureUtil.getTenantId(),DeliveryStatusEnum.DELIVER.getType(),srcOrderNo,tradeType);
 				newDelivery = itemsList.stream().reduce(BigDecimal.ZERO,(x,y) ->{ return x.add(y.getContractAmount().multiply(y.getExRate())); },BigDecimal::add);//本次发货金额
 				oldDelivery = deliveryItems.stream().reduce(BigDecimal.ZERO,(x,y) ->{ return x.add(y.getContractAmount().multiply(y.getExRate())); },BigDecimal::add);//历史发货金额
-				if (gathering.subtract(newDelivery.add(oldDelivery)).compareTo(BigDecimal.ZERO) <= 0){
+				//原来的判断 条件 : if (gathering.subtract(newDelivery.add(oldDelivery)).compareTo(BigDecimal.ZERO) <= 0){
+				if (gathering.subtract(newDelivery.add(oldDelivery)).compareTo(BigDecimal.ZERO) == -1){
 					throw new RuntimeException("订单"+srcOrderNo+"发货金额超出 ,可发货金额为(CNY):"+(gathering.subtract(oldDelivery)).setScale(2,BigDecimal.ROUND_UP));
 				}
 				/*if (gathering.compareTo((newDelivery.add(oldDelivery))) < 0){

+ 6 - 0
blade-service/blade-mocha-item/src/main/java/org/springblade/mocha/excel/PriceItemExcel.java

@@ -56,4 +56,10 @@ public class PriceItemExcel implements Serializable {
 	 */
 	@ExcelProperty("采购价格")
 	private BigDecimal purchasePrice;
+
+	@ExcelProperty("运费")
+	private BigDecimal freightFees;
+
+	@ExcelProperty("标签")
+	private BigDecimal labelFees;
 }

+ 4 - 0
blade-service/blade-mocha-item/src/main/java/org/springblade/mocha/service/impl/PriceItemServiceImpl.java

@@ -101,11 +101,15 @@ public class PriceItemServiceImpl extends ServiceImpl<PriceItemMapper, PriceItem
 			}
 			PriceItem item = baseMapper.selectOne(new QueryWrapper<PriceItem>().eq("code", priceItemExcel.getCode()).eq("is_deleted", 0).eq("tenant_id", SecureUtil.getTenantId()));
 			if (item == null){
+				priceItem.setFreightFees(priceItemExcel.getFreightFees());
+				priceItem.setLabelFees(priceItemExcel.getLabelFees());
 				priceItem.setCreateUser(SecureUtil.getUserId());
 				priceItem.setCreateTime(new Date());
 				priceItem.setTenantId(SecureUtil.getTenantId());
 				baseMapper.insert(priceItem);
 			}else {
+				priceItem.setFreightFees(priceItemExcel.getFreightFees());
+				priceItem.setLabelFees(priceItemExcel.getLabelFees());
 				priceItem.setId(item.getId());
 				priceItem.setUpdateUser(SecureUtil.getUserId());
 				priceItem.setUpdateTime(new Date());

+ 123 - 90
blade-service/blade-purchase-sales/src/main/java/org/springblade/purchase/sales/controller/OrderController.java

@@ -19,6 +19,7 @@ package org.springblade.purchase.sales.controller;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+import com.baomidou.mybatisplus.core.toolkit.StringUtils;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.trade.purchase.order.enums.OrderTypeEnum;
 import io.swagger.annotations.Api;
@@ -339,12 +340,26 @@ public class OrderController extends BladeController {
 	@ApiOperation(value = "统计分析")
 	public R listOrderStatisticAnalysis(Order order, Query query)
 	{
+
+	/*	LambdaQueryWrapper<Order> orderLambdaQueryWrapper=new LambdaQueryWrapper<>();
+		orderLambdaQueryWrapper.eq(StringUtils.isNotBlank(order.getOrderNo()),Order::getOrderNo,order.getOrderNo());
+		orderLambdaQueryWrapper.between(StringUtils.isNotBlank(order.getStartTime())&&StringUtils.isNotBlank(order.getEndTime()),Order::getCreateTime,order.getStartTime(),order.getEndTime());
+		IPage<Order> iPage = orderService.page(Condition.getPage(query), orderLambdaQueryWrapper);
+		List<Order> records = iPage.getRecords();*/
 		Page<OrderStatisticAnalysisVO> iPage = new Page(query.getCurrent(),query.getSize());
 		IPage<OrderStatisticAnalysisVO> orderStatisticAnalysisVOIPage = orderService.listOrderStatisticAnalysis(iPage, AuthUtil.getTenantId(), order.getOrderNo(),order.getStartTime(),order.getEndTime());
 		List<OrderStatisticAnalysisVO> records = orderStatisticAnalysisVOIPage.getRecords();
 		if(CollectionUtils.isNotEmpty(records))
 		{
 			records.forEach(e->{
+				Long orderId = e.getOrderId();
+				//采购主表信息
+				LambdaQueryWrapper<Order> orderLambdaQueryWrapper=new LambdaQueryWrapper<>();
+				orderLambdaQueryWrapper
+					.eq(Order::getId,orderId)
+					.eq(Order::getTenantId,AuthUtil.getTenantId())
+					.eq(Order::getIsDeleted,0);
+				Order service = orderService.getOne(orderLambdaQueryWrapper);
 				//供应商名称
 				if(e.getCorpId()!=null)
 				{
@@ -354,47 +369,19 @@ public class OrderController extends BladeController {
 						e.setCorpName(corpMessage.getData().getCname());
 					}
 				}
-				//客户名称
-				if(e.getSaleCorpId()!=null)
-				{
-					R<CorpsDesc> corpsDescClientCorpMessage = corpsDescClient.getCorpMessage(e.getSaleCorpId());
-					if(corpsDescClientCorpMessage.isSuccess())
-					{
-						e.setSaleCorpName(corpsDescClientCorpMessage.getData().getCname());
-					}
-				}
-				//业务员名称
-				if(e.getCreateUser()!=null)
-				{
-					R<User> info = userClient.userInfoById(e.getCreateUser());
-					if(info.isSuccess())
-					{
-						e.setCreateUserName(info.getData().getRealName());
-					}
-				}
-				//采购主表id
-				Long orderId = e.getOrderId();
-				LambdaQueryWrapper<Order> orderLambdaQueryWrapper=new LambdaQueryWrapper<>();
-				orderLambdaQueryWrapper
-					.eq(Order::getId,orderId)
-					.eq(Order::getTenantId,AuthUtil.getTenantId())
-					.eq(Order::getIsDeleted,0);
-
-				Order service = orderService.getOne(orderLambdaQueryWrapper);
-
-
 				//调用-费用微服务-获取关税设置详情
 				R<FeesDesc> customDuty = feesDescClient.getFeesByName("关税");
 				Long customDutyId=null;
-                if(customDuty.isSuccess()&&customDuty.getData()!=null)
-                {
+				if(customDuty.isSuccess()&&customDuty.getData()!=null)
+				{
 					customDutyId=customDuty.getData().getId();
 				}
+
 				//关税
 				BigDecimal customDutyMoney=BigDecimal.ZERO;
-                //查询采购订单关税的费用明细
-                if(customDutyId!=null)
-                {
+				//查询采购订单关税的费用明细
+				if(customDutyId!=null)
+				{
 					LambdaQueryWrapper<OrderFees> orderFeesLambdaQueryWrapper=new LambdaQueryWrapper<>();
 					orderFeesLambdaQueryWrapper
 						.eq(OrderFees::getPid,orderId)
@@ -426,19 +413,64 @@ public class OrderController extends BladeController {
 
 						}
 					}
-                }
+				}
 				e.setCustomDutyMoney(customDutyMoney);
 
 
+				//调用-费用微服务-获取物流费设置详情
+				Long deliverId=null;
+				R<FeesDesc> deliver = feesDescClient.getFeesByName("物流费");
+				if(deliver.isSuccess()&&deliver.getData()!=null)
+				{
+					deliverId=deliver.getData().getId();
+				}
+				BigDecimal deliverMoney=BigDecimal.ZERO;
+				if(deliverId!=null)
+				{
+					LambdaQueryWrapper<OrderFees> quotaLambdaQueryWrapper=new LambdaQueryWrapper<>();
+					quotaLambdaQueryWrapper
+						.eq(OrderFees::getPid,orderId)
+						.eq(OrderFees::getItemId,deliverId);
+					List<Long> deliverIds = orderFeesService.list(quotaLambdaQueryWrapper).stream().map(OrderFees::getId).collect(Collectors.toList());
+
+					if(CollectionUtils.isNotEmpty(deliverIds))
+					{
+						Acc customDutyAcc=new Acc();
+						customDutyAcc.setSrcType(2);
+						customDutyAcc.setSrcFeesIds(deliverIds);
+						//只有 itemType=采购 && billType=申请 才是付钱
+						customDutyAcc.setItemType("采购");
+						customDutyAcc.setBillType("申请");
+						R<List<Acc>> accListByCondition = iFinanceClient.getAccListByCondition(customDutyAcc);
+						if(accListByCondition.isSuccess())
+						{
+							List<Acc> deliverList = accListByCondition.getData();
+							//物流费
+
+							if(CollectionUtils.isNotEmpty(deliverList))
+							{
+								deliverMoney=deliverList.stream().reduce(BigDecimal.ZERO,(x,y) ->{ return x.add(y.getAmount().multiply(y.getExchangeRate())); },BigDecimal::add);
+							}
+							else
+							{
+								deliverMoney=BigDecimal.ZERO;
+							}
+
+						}
+					}
+
+				}
+				e.setDeliverMoney(deliverMoney);
+
 
-                //调用-费用微服务-获取配额设置详情
+				//调用-费用微服务-获取配额设置详情
 				Long quotaId=null;
 				R<FeesDesc> quota = feesDescClient.getFeesByName("配额");
 				if(quota.isSuccess()&&quota.getData()!=null)
 				{
 					quotaId=quota.getData().getId();
 				}
-                //配额
+				//配额
 				BigDecimal quotaMoney=BigDecimal.ZERO;
 				//查询采购订单配额的费用明细
 				if(quotaId!=null)
@@ -479,8 +511,7 @@ public class OrderController extends BladeController {
 				e.setQuotaMoney(quotaMoney);
 
 
-
-                //调用-费用微服务-获取增值税设置详情
+				//调用-费用微服务-获取增值税设置详情
 				Long gstId=null;
 				R<FeesDesc> GST = feesDescClient.getFeesByName("增值税");
 				if(GST.isSuccess()&&GST.getData()!=null)
@@ -527,54 +558,6 @@ public class OrderController extends BladeController {
 				e.setGstMoney(gstMoney);
 
 
-
-				//调用-费用微服务-获取物流费设置详情
-				Long deliverId=null;
-				R<FeesDesc> deliver = feesDescClient.getFeesByName("物流费");
-				if(deliver.isSuccess()&&deliver.getData()!=null)
-				{
-					deliverId=deliver.getData().getId();
-				}
-				BigDecimal deliverMoney=BigDecimal.ZERO;
-				if(deliverId!=null)
-				{
-					LambdaQueryWrapper<OrderFees> quotaLambdaQueryWrapper=new LambdaQueryWrapper<>();
-					quotaLambdaQueryWrapper
-						.eq(OrderFees::getPid,orderId)
-						.eq(OrderFees::getItemId,deliverId);
-					List<Long> deliverIds = orderFeesService.list(quotaLambdaQueryWrapper).stream().map(OrderFees::getId).collect(Collectors.toList());
-
-					if(CollectionUtils.isNotEmpty(deliverIds))
-					{
-						Acc customDutyAcc=new Acc();
-						customDutyAcc.setSrcType(2);
-						customDutyAcc.setSrcFeesIds(deliverIds);
-						//只有 itemType=采购 && billType=申请 才是付钱
-						customDutyAcc.setItemType("采购");
-						customDutyAcc.setBillType("申请");
-						R<List<Acc>> accListByCondition = iFinanceClient.getAccListByCondition(customDutyAcc);
-						if(accListByCondition.isSuccess())
-						{
-							List<Acc> deliverList = accListByCondition.getData();
-							//物流费
-
-							if(CollectionUtils.isNotEmpty(deliverList))
-							{
-								deliverMoney=deliverList.stream().reduce(BigDecimal.ZERO,(x,y) ->{ return x.add(y.getAmount().multiply(y.getExchangeRate())); },BigDecimal::add);
-							}
-							else
-							{
-								deliverMoney=BigDecimal.ZERO;
-							}
-
-						}
-					}
-
-				}
-				e.setDeliverMoney(deliverMoney);
-
-
-
 				//获取货款账单明细
 				Acc itemAcc=new Acc();
 				itemAcc.setSrcType(1);
@@ -601,14 +584,64 @@ public class OrderController extends BladeController {
 				}
 
 				e.setItemMoney(itemMoney.setScale(2,BigDecimal.ROUND_HALF_UP));
+
+
+				//成本单价=(货款+关税+配额)/发票重量---精确小数点2位
+				BigDecimal unitPrice=null;
+				if(service.getInvoiceWeight()==null || service.getInvoiceWeight().compareTo(BigDecimal.ZERO)==0)
+				{
+					unitPrice=BigDecimal.ZERO;
+				}
+				else
+				{
+					unitPrice=((itemMoney.add(quotaMoney)).add(customDutyMoney)).divide(service.getInvoiceWeight(),2,BigDecimal.ROUND_HALF_UP);
+				}
+				e.setUnitPrice(unitPrice);
+
 				//销售主表信息
 				LambdaQueryWrapper<Order> saleOrderWrapper=new LambdaQueryWrapper<>();
 				saleOrderWrapper.eq(Order::getId,e.getOrderSaleId()).eq(Order::getTenantId,AuthUtil.getTenantId());
 				Order serviceOne = orderService.getOne(saleOrderWrapper);
+				if(serviceOne==null)
+				{
+                  return;
+				}
+
+				//客户名称
+				if(e.getSaleCorpId()!=null)
+				{
+					R<CorpsDesc> corpsDescClientCorpMessage = corpsDescClient.getCorpMessage(e.getSaleCorpId());
+					if(corpsDescClientCorpMessage.isSuccess())
+					{
+						e.setSaleCorpName(corpsDescClientCorpMessage.getData().getCname());
+					}
+				}
+				//业务员名称
+				if(e.getCreateUser()!=null)
+				{
+					R<User> info = userClient.userInfoById(e.getCreateUser());
+					if(info.isSuccess())
+					{
+						e.setCreateUserName(info.getData().getRealName());
+					}
+				}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 
-				//成本单价=(货款+关税+配额)/发票重量---精确小数点2位
-                BigDecimal unitPrice=((itemMoney.add(quotaMoney)).add(customDutyMoney)).divide(service.getInvoiceWeight(),2,BigDecimal.ROUND_HALF_UP);
-                e.setUnitPrice(unitPrice);
 				if(serviceOne.getExchangeRate()==null)
 				{
                    throw new SecurityException("销售订单:"+serviceOne.getOrderNo()+",汇率未填,无法完成统计");

+ 10 - 0
blade-service/blade-purchase-sales/src/main/java/org/springblade/purchase/sales/controller/OrderItemsController.java

@@ -16,6 +16,7 @@
  */
 package org.springblade.purchase.sales.controller;
 
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.StringUtils;
 import org.springblade.core.excel.util.ExcelUtil;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
@@ -173,4 +174,13 @@ public class OrderItemsController extends BladeController {
 	}
 
 
+	@GetMapping("listByItemId")
+	public R<List<OrderItems>> listByItemId(@ApiParam(value = "主键集合", required = true) @RequestParam Long itemId)
+	{
+		LambdaQueryWrapper<OrderItems> orderItemsLambdaQueryWrapper=new LambdaQueryWrapper<>();
+		orderItemsLambdaQueryWrapper.eq(OrderItems::getItemId,itemId).eq(OrderItems::getIsDeleted,0);
+		List<OrderItems> list = orderItemsService.list(orderItemsLambdaQueryWrapper);
+		return R.data(list);
+	}
+
 }

+ 7 - 0
blade-service/blade-purchase-sales/src/main/java/org/springblade/purchase/sales/feign/OrderItemsClient.java

@@ -12,6 +12,8 @@ import org.springframework.web.bind.annotation.RestController;
 import springfox.documentation.annotations.ApiIgnore;
 
 import java.math.BigDecimal;
+import java.util.List;
+
 @Slf4j
 @NonDS
 @ApiIgnore()
@@ -89,4 +91,9 @@ public class OrderItemsClient implements IOrderItemsClient{
 		}
 		return R.data(orderItemsService.updateById(items));
 	}
+
+	@Override
+	public R<List<OrderItems>> listByItemId(Long itemId) {
+		return null;
+	}
 }

+ 4 - 4
blade-service/blade-purchase-sales/src/main/java/org/springblade/purchase/sales/mapper/OrderMapper.xml

@@ -403,7 +403,7 @@
         a.bill_weight as billWeight,
         a.invoice_weight as invoiceWeight,
         b.*
-        from business_order a ,
+        from business_order a  left join
         (
         SELECT
         a.id as orderSaleId,
@@ -432,9 +432,9 @@
            and t.order_no=#{orderNo}
         </if>
         )
-        order by  b.create_time desc
-      )   b
-      where a.order_no=b.orgOrderNo
+        order by  a.create_time desc
+      )   b  on a.order_no=b.orgOrderNo
+      where  a.bill_type='CG' and  a.trade_type='JK'
         <if test='startTime != null and endTime!= null'>
             and a.create_time between #{startTime} and #{endTime}
         </if>

+ 1 - 0
blade-service/blade-purchase-sales/src/main/java/org/springblade/purchase/sales/service/impl/OrderServiceImpl.java

@@ -691,6 +691,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
 			//获取此销售订单下,所有明细的库存
 			LambdaQueryWrapper<OrderItems> orderItemsLambdaQueryWrapper=new LambdaQueryWrapper<>();
 			orderItemsLambdaQueryWrapper
+				.eq(OrderItems::getGoodType,0)
 				.eq(OrderItems::getPid,id)
 				.eq(OrderItems::getIsDeleted,0);
 			List<OrderItems> orderItems = orderItemsMapper.selectList(orderItemsLambdaQueryWrapper);

+ 9 - 21
blade-service/blade-stock/src/main/java/org/springblade/stock/mapper/StockGoodsMapper.xml

@@ -55,30 +55,19 @@
         select * from business_stock_goods where is_deleted = 0
     </select>
 
-    <select id="" resultType="org.springblade.stock.entity.StockGoods">
-        SELECT
+    <select id="groupByStock" resultType="org.springblade.stock.entity.StockGoods">
+    SELECT
 	a.bill_no as billNo,
 	a.contract_number as contractNumber,
 	a.goods_id as goodsId,
 	a.storage_id as storageId,
-	sum(a.in_weight) as lockingWeight ,
-	sum(a.in_volumn) as outQuantity ,
-	sum(a.in_amount) as lockingQuantity ,
-	sum(a.in_quantity) as balanceQuantity,
-	sum(a.surplus_route_quantity) as inWeight,
-	sum(a.out_quantity) as outWeight,
-	sum(a.out_quantity) as lockingWeight,
-	sum(a.out_quantity) as balanceWeight,
-	sum(a.out_quantity) as inVolumn,
-	sum(a.out_quantity) as lockingVolumn,
-	sum(a.out_quantity) as balanceVolumn,
-	sum(a.out_quantity) as enRouteQuantity,
-	sum(a.out_quantity) as surplusRouteQuantity,
-	sum(a.out_quantity) as inAmount,
-	sum(a.out_quantity) as outAmount,
-	sum(a.out_quantity) as balanceAmount,
-	sum(a.out_quantity) as outVolumn
-
+	sum(a.surplus_route_quantity) as surplusRouteQuantity,
+	sum(a.in_weight) as inWeight ,
+	sum(a.in_quantity) as inQuantity,
+	sum(a.out_quantity) as outQuantity ,
+	sum(a.out_weight) as outWeight ,
+	sum(a.balance_quantity) as balanceQuantity ,
+	sum(a.balance_weight) as balanceWeight
     FROM
 	business_stock_goods a
     where a.tenant_id=#{tenantId}
@@ -86,7 +75,6 @@
 	a.bill_no,
 	a.contract_number,
 	a.goods_id
-
     </select>
 
 </mapper>

+ 2 - 0
blade-service/trade-finance/src/main/java/org/springblade/finance/controller/AccController.java

@@ -188,7 +188,9 @@ public class AccController extends BladeController {
 		accLambdaQueryWrapper
 			.in(CollectionUtils.isNotEmpty(acc.getSrcFeesIds()),Acc::getSrcFeesId,acc.getSrcFeesIds())
 			.eq(Acc::getTenantId, AuthUtil.getTenantId())
+			.eq(Acc::getIsDeleted,0)
 			.eq(Acc::getSrcType,acc.getSrcType())
+			.eq(acc.getCorpId()!=null,Acc::getCorpId,acc.getCorpId())
 			.eq(StringUtils.isNotBlank(acc.getBillType()),Acc::getBillType,acc.getBillType())
 			.eq(StringUtils.isNotBlank(acc.getItemType()),Acc::getItemType,acc.getItemType())
 			.eq(acc.getSrcParentId()!=null,Acc::getSrcParentId,acc.getSrcParentId())

+ 126 - 0
blade-service/trade-finance/src/main/java/org/springblade/finance/controller/JdCorpsController.java

@@ -0,0 +1,126 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.finance.controller;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import lombok.AllArgsConstructor;
+import javax.validation.Valid;
+
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+import org.springframework.web.bind.annotation.*;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.finance.entity.JdCorps;
+import org.springblade.finance.vo.JdCorpsVO;
+import org.springblade.finance.service.IJdCorpsService;
+import org.springblade.core.boot.ctrl.BladeController;
+
+/**
+ *  控制器
+ *
+ * @author BladeX
+ * @since 2022-01-20
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("/jdcorps")
+@Api(value = "", tags = "接口")
+public class JdCorpsController extends BladeController {
+
+	private final IJdCorpsService jdCorpsService;
+
+	/**
+	 * 详情
+	 */
+	@GetMapping("/detail")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "详情", notes = "传入jdCorps")
+	public R<JdCorps> detail(JdCorps jdCorps) {
+		JdCorps detail = jdCorpsService.getOne(Condition.getQueryWrapper(jdCorps));
+		return R.data(detail);
+	}
+
+	/**
+	 * 分页 
+	 */
+	@GetMapping("/list")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页", notes = "传入jdCorps")
+	public R<IPage<JdCorps>> list(JdCorps jdCorps, Query query) {
+		IPage<JdCorps> pages = jdCorpsService.page(Condition.getPage(query), Condition.getQueryWrapper(jdCorps));
+		return R.data(pages);
+	}
+
+	/**
+	 * 自定义分页 
+	 */
+	@GetMapping("/page")
+	@ApiOperationSupport(order = 3)
+	@ApiOperation(value = "分页", notes = "传入jdCorps")
+	public R<IPage<JdCorpsVO>> page(JdCorpsVO jdCorps, Query query) {
+		IPage<JdCorpsVO> pages = jdCorpsService.selectJdCorpsPage(Condition.getPage(query), jdCorps);
+		return R.data(pages);
+	}
+
+	/**
+	 * 新增 
+	 */
+	@PostMapping("/save")
+	@ApiOperationSupport(order = 4)
+	@ApiOperation(value = "新增", notes = "传入jdCorps")
+	public R save(@Valid @RequestBody JdCorps jdCorps) {
+		return R.status(jdCorpsService.save(jdCorps));
+	}
+
+	/**
+	 * 修改 
+	 */
+	@PostMapping("/update")
+	@ApiOperationSupport(order = 5)
+	@ApiOperation(value = "修改", notes = "传入jdCorps")
+	public R update(@Valid @RequestBody JdCorps jdCorps) {
+		return R.status(jdCorpsService.updateById(jdCorps));
+	}
+
+	/**
+	 * 新增或修改 
+	 */
+	@PostMapping("/submit")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "新增或修改", notes = "传入jdCorps")
+	public R submit(@Valid @RequestBody JdCorps jdCorps) {
+		return R.status(jdCorpsService.saveOrUpdate(jdCorps));
+	}
+
+	
+	/**
+	 * 删除 
+	 */
+	@PostMapping("/remove")
+	@ApiOperationSupport(order = 8)
+	@ApiOperation(value = "删除", notes = "传入ids")
+	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+		return R.status(jdCorpsService.removeByIds(Func.toLongList(ids)));
+	}
+
+	
+}

+ 126 - 0
blade-service/trade-finance/src/main/java/org/springblade/finance/controller/JdEmployeeController.java

@@ -0,0 +1,126 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.finance.controller;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import lombok.AllArgsConstructor;
+import javax.validation.Valid;
+
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+import org.springframework.web.bind.annotation.*;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.finance.entity.JdEmployee;
+import org.springblade.finance.vo.JdEmployeeVO;
+import org.springblade.finance.service.IJdEmployeeService;
+import org.springblade.core.boot.ctrl.BladeController;
+
+/**
+ *  控制器
+ *
+ * @author BladeX
+ * @since 2022-01-20
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("/jdemployee")
+@Api(value = "", tags = "接口")
+public class JdEmployeeController extends BladeController {
+
+	private final IJdEmployeeService jdEmployeeService;
+
+	/**
+	 * 详情
+	 */
+	@GetMapping("/detail")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "详情", notes = "传入jdEmployee")
+	public R<JdEmployee> detail(JdEmployee jdEmployee) {
+		JdEmployee detail = jdEmployeeService.getOne(Condition.getQueryWrapper(jdEmployee));
+		return R.data(detail);
+	}
+
+	/**
+	 * 分页 
+	 */
+	@GetMapping("/list")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页", notes = "传入jdEmployee")
+	public R<IPage<JdEmployee>> list(JdEmployee jdEmployee, Query query) {
+		IPage<JdEmployee> pages = jdEmployeeService.page(Condition.getPage(query), Condition.getQueryWrapper(jdEmployee));
+		return R.data(pages);
+	}
+
+	/**
+	 * 自定义分页 
+	 */
+	@GetMapping("/page")
+	@ApiOperationSupport(order = 3)
+	@ApiOperation(value = "分页", notes = "传入jdEmployee")
+	public R<IPage<JdEmployeeVO>> page(JdEmployeeVO jdEmployee, Query query) {
+		IPage<JdEmployeeVO> pages = jdEmployeeService.selectJdEmployeePage(Condition.getPage(query), jdEmployee);
+		return R.data(pages);
+	}
+
+	/**
+	 * 新增 
+	 */
+	@PostMapping("/save")
+	@ApiOperationSupport(order = 4)
+	@ApiOperation(value = "新增", notes = "传入jdEmployee")
+	public R save(@Valid @RequestBody JdEmployee jdEmployee) {
+		return R.status(jdEmployeeService.save(jdEmployee));
+	}
+
+	/**
+	 * 修改 
+	 */
+	@PostMapping("/update")
+	@ApiOperationSupport(order = 5)
+	@ApiOperation(value = "修改", notes = "传入jdEmployee")
+	public R update(@Valid @RequestBody JdEmployee jdEmployee) {
+		return R.status(jdEmployeeService.updateById(jdEmployee));
+	}
+
+	/**
+	 * 新增或修改 
+	 */
+	@PostMapping("/submit")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "新增或修改", notes = "传入jdEmployee")
+	public R submit(@Valid @RequestBody JdEmployee jdEmployee) {
+		return R.status(jdEmployeeService.saveOrUpdate(jdEmployee));
+	}
+
+	
+	/**
+	 * 删除 
+	 */
+	@PostMapping("/remove")
+	@ApiOperationSupport(order = 8)
+	@ApiOperation(value = "删除", notes = "传入ids")
+	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+		return R.status(jdEmployeeService.removeByIds(Func.toLongList(ids)));
+	}
+
+	
+}

+ 126 - 0
blade-service/trade-finance/src/main/java/org/springblade/finance/controller/JdModuleController.java

@@ -0,0 +1,126 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.finance.controller;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import lombok.AllArgsConstructor;
+import javax.validation.Valid;
+
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+import org.springframework.web.bind.annotation.*;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.finance.entity.JdModule;
+import org.springblade.finance.vo.JdModuleVO;
+import org.springblade.finance.service.IJdModuleService;
+import org.springblade.core.boot.ctrl.BladeController;
+
+/**
+ * 租户jd模块表 控制器
+ *
+ * @author BladeX
+ * @since 2022-01-20
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("/jdmodule")
+@Api(value = "租户jd模块表", tags = "租户jd模块表接口")
+public class JdModuleController extends BladeController {
+
+	private final IJdModuleService jdModuleService;
+
+	/**
+	 * 详情
+	 */
+	@GetMapping("/detail")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "详情", notes = "传入jdModule")
+	public R<JdModule> detail(JdModule jdModule) {
+		JdModule detail = jdModuleService.getOne(Condition.getQueryWrapper(jdModule));
+		return R.data(detail);
+	}
+
+	/**
+	 * 分页 租户jd模块表
+	 */
+	@GetMapping("/list")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页", notes = "传入jdModule")
+	public R<IPage<JdModule>> list(JdModule jdModule, Query query) {
+		IPage<JdModule> pages = jdModuleService.page(Condition.getPage(query), Condition.getQueryWrapper(jdModule));
+		return R.data(pages);
+	}
+
+	/**
+	 * 自定义分页 租户jd模块表
+	 */
+	@GetMapping("/page")
+	@ApiOperationSupport(order = 3)
+	@ApiOperation(value = "分页", notes = "传入jdModule")
+	public R<IPage<JdModuleVO>> page(JdModuleVO jdModule, Query query) {
+		IPage<JdModuleVO> pages = jdModuleService.selectJdModulePage(Condition.getPage(query), jdModule);
+		return R.data(pages);
+	}
+
+	/**
+	 * 新增 租户jd模块表
+	 */
+	@PostMapping("/save")
+	@ApiOperationSupport(order = 4)
+	@ApiOperation(value = "新增", notes = "传入jdModule")
+	public R save(@Valid @RequestBody JdModule jdModule) {
+		return R.status(jdModuleService.save(jdModule));
+	}
+
+	/**
+	 * 修改 租户jd模块表
+	 */
+	@PostMapping("/update")
+	@ApiOperationSupport(order = 5)
+	@ApiOperation(value = "修改", notes = "传入jdModule")
+	public R update(@Valid @RequestBody JdModule jdModule) {
+		return R.status(jdModuleService.updateById(jdModule));
+	}
+
+	/**
+	 * 新增或修改 租户jd模块表
+	 */
+	@PostMapping("/submit")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "新增或修改", notes = "传入jdModule")
+	public R submit(@Valid @RequestBody JdModule jdModule) {
+		return R.status(jdModuleService.saveOrUpdate(jdModule));
+	}
+
+	
+	/**
+	 * 删除 租户jd模块表
+	 */
+	@PostMapping("/remove")
+	@ApiOperationSupport(order = 8)
+	@ApiOperation(value = "删除", notes = "传入ids")
+	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+		return R.status(jdModuleService.removeByIds(Func.toLongList(ids)));
+	}
+
+	
+}

+ 126 - 0
blade-service/trade-finance/src/main/java/org/springblade/finance/controller/JdTenantController.java

@@ -0,0 +1,126 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.finance.controller;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import lombok.AllArgsConstructor;
+import javax.validation.Valid;
+
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+import org.springframework.web.bind.annotation.*;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.finance.entity.JdTenant;
+import org.springblade.finance.vo.JdTenantVO;
+import org.springblade.finance.service.IJdTenantService;
+import org.springblade.core.boot.ctrl.BladeController;
+
+/**
+ * 租户jd配置信息表 控制器
+ *
+ * @author BladeX
+ * @since 2022-01-20
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("/jdtenant")
+@Api(value = "租户jd配置信息表", tags = "租户jd配置信息表接口")
+public class JdTenantController extends BladeController {
+
+	private final IJdTenantService jdTenantService;
+
+	/**
+	 * 详情
+	 */
+	@GetMapping("/detail")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "详情", notes = "传入jdTenant")
+	public R<JdTenant> detail(JdTenant jdTenant) {
+		JdTenant detail = jdTenantService.getOne(Condition.getQueryWrapper(jdTenant));
+		return R.data(detail);
+	}
+
+	/**
+	 * 分页 租户jd配置信息表
+	 */
+	@GetMapping("/list")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页", notes = "传入jdTenant")
+	public R<IPage<JdTenant>> list(JdTenant jdTenant, Query query) {
+		IPage<JdTenant> pages = jdTenantService.page(Condition.getPage(query), Condition.getQueryWrapper(jdTenant));
+		return R.data(pages);
+	}
+
+	/**
+	 * 自定义分页 租户jd配置信息表
+	 */
+	@GetMapping("/page")
+	@ApiOperationSupport(order = 3)
+	@ApiOperation(value = "分页", notes = "传入jdTenant")
+	public R<IPage<JdTenantVO>> page(JdTenantVO jdTenant, Query query) {
+		IPage<JdTenantVO> pages = jdTenantService.selectJdTenantPage(Condition.getPage(query), jdTenant);
+		return R.data(pages);
+	}
+
+	/**
+	 * 新增 租户jd配置信息表
+	 */
+	@PostMapping("/save")
+	@ApiOperationSupport(order = 4)
+	@ApiOperation(value = "新增", notes = "传入jdTenant")
+	public R save(@Valid @RequestBody JdTenant jdTenant) {
+		return R.status(jdTenantService.save(jdTenant));
+	}
+
+	/**
+	 * 修改 租户jd配置信息表
+	 */
+	@PostMapping("/update")
+	@ApiOperationSupport(order = 5)
+	@ApiOperation(value = "修改", notes = "传入jdTenant")
+	public R update(@Valid @RequestBody JdTenant jdTenant) {
+		return R.status(jdTenantService.updateById(jdTenant));
+	}
+
+	/**
+	 * 新增或修改 租户jd配置信息表
+	 */
+	@PostMapping("/submit")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "新增或修改", notes = "传入jdTenant")
+	public R submit(@Valid @RequestBody JdTenant jdTenant) {
+		return R.status(jdTenantService.saveOrUpdate(jdTenant));
+	}
+
+	
+	/**
+	 * 删除 租户jd配置信息表
+	 */
+	@PostMapping("/remove")
+	@ApiOperationSupport(order = 8)
+	@ApiOperation(value = "删除", notes = "传入ids")
+	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+		return R.status(jdTenantService.removeByIds(Func.toLongList(ids)));
+	}
+
+	
+}

+ 42 - 0
blade-service/trade-finance/src/main/java/org/springblade/finance/mapper/JdCorpsMapper.java

@@ -0,0 +1,42 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.finance.mapper;
+
+import org.springblade.finance.entity.JdCorps;
+import org.springblade.finance.vo.JdCorpsVO;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import java.util.List;
+
+/**
+ *  Mapper 接口
+ *
+ * @author BladeX
+ * @since 2022-01-20
+ */
+public interface JdCorpsMapper extends BaseMapper<JdCorps> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param jdCorps
+	 * @return
+	 */
+	List<JdCorpsVO> selectJdCorpsPage(IPage page, JdCorpsVO jdCorps);
+
+}

+ 19 - 0
blade-service/trade-finance/src/main/java/org/springblade/finance/mapper/JdCorpsMapper.xml

@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.springblade.finance.mapper.JdCorpsMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="jdCorpsResultMap" type="org.springblade.finance.entity.JdCorps">
+        <id column="id" property="id"/>
+        <result column="corps_name" property="corpsName"/>
+        <result column="corps_code" property="corpsCode"/>
+        <result column="account_id" property="accountId"/>
+        <result column="account_name" property="accountName"/>
+    </resultMap>
+
+
+    <select id="selectJdCorpsPage" resultMap="jdCorpsResultMap">
+        select * from jd_corps where is_deleted = 0
+    </select>
+
+</mapper>

+ 42 - 0
blade-service/trade-finance/src/main/java/org/springblade/finance/mapper/JdEmployeeMapper.java

@@ -0,0 +1,42 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.finance.mapper;
+
+import org.springblade.finance.entity.JdEmployee;
+import org.springblade.finance.vo.JdEmployeeVO;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import java.util.List;
+
+/**
+ *  Mapper 接口
+ *
+ * @author BladeX
+ * @since 2022-01-20
+ */
+public interface JdEmployeeMapper extends BaseMapper<JdEmployee> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param jdEmployee
+	 * @return
+	 */
+	List<JdEmployeeVO> selectJdEmployeePage(IPage page, JdEmployeeVO jdEmployee);
+
+}

+ 19 - 0
blade-service/trade-finance/src/main/java/org/springblade/finance/mapper/JdEmployeeMapper.xml

@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.springblade.finance.mapper.JdEmployeeMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="jdEmployeeResultMap" type="org.springblade.finance.entity.JdEmployee">
+        <id column="id" property="id"/>
+        <result column="employee_name" property="employeeName"/>
+        <result column="employee_code" property="employeeCode"/>
+        <result column="account_id" property="accountId"/>
+        <result column="account_name" property="accountName"/>
+    </resultMap>
+
+
+    <select id="selectJdEmployeePage" resultMap="jdEmployeeResultMap">
+        select * from jd_employee where is_deleted = 0
+    </select>
+
+</mapper>

+ 42 - 0
blade-service/trade-finance/src/main/java/org/springblade/finance/mapper/JdModuleMapper.java

@@ -0,0 +1,42 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.finance.mapper;
+
+import org.springblade.finance.entity.JdModule;
+import org.springblade.finance.vo.JdModuleVO;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import java.util.List;
+
+/**
+ * 租户jd模块表 Mapper 接口
+ *
+ * @author BladeX
+ * @since 2022-01-20
+ */
+public interface JdModuleMapper extends BaseMapper<JdModule> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param jdModule
+	 * @return
+	 */
+	List<JdModuleVO> selectJdModulePage(IPage page, JdModuleVO jdModule);
+
+}

+ 20 - 0
blade-service/trade-finance/src/main/java/org/springblade/finance/mapper/JdModuleMapper.xml

@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.springblade.finance.mapper.JdModuleMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="jdModuleResultMap" type="org.springblade.finance.entity.JdModule">
+        <id column="id" property="id"/>
+        <result column="module" property="module"/>
+        <result column="dc" property="dc"/>
+        <result column="project_code" property="projectCode"/>
+        <result column="account_id" property="accountId"/>
+        <result column="account_name" property="accountName"/>
+    </resultMap>
+
+
+    <select id="selectJdModulePage" resultMap="jdModuleResultMap">
+        select * from jd_module where is_deleted = 0
+    </select>
+
+</mapper>

+ 42 - 0
blade-service/trade-finance/src/main/java/org/springblade/finance/mapper/JdTenantMapper.java

@@ -0,0 +1,42 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.finance.mapper;
+
+import org.springblade.finance.entity.JdTenant;
+import org.springblade.finance.vo.JdTenantVO;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import java.util.List;
+
+/**
+ * 租户jd配置信息表 Mapper 接口
+ *
+ * @author BladeX
+ * @since 2022-01-20
+ */
+public interface JdTenantMapper extends BaseMapper<JdTenant> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param jdTenant
+	 * @return
+	 */
+	List<JdTenantVO> selectJdTenantPage(IPage page, JdTenantVO jdTenant);
+
+}

+ 21 - 0
blade-service/trade-finance/src/main/java/org/springblade/finance/mapper/JdTenantMapper.xml

@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.springblade.finance.mapper.JdTenantMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="jdTenantResultMap" type="org.springblade.finance.entity.JdTenant">
+        <id column="id" property="id"/>
+        <result column="tenant_name" property="tenantName"/>
+        <result column="client_id" property="clientId"/>
+        <result column="client_secret" property="clientSecret"/>
+        <result column="username" property="username"/>
+        <result column="password" property="password"/>
+        <result column="is_enable" property="isEnable"/>
+    </resultMap>
+
+
+    <select id="selectJdTenantPage" resultMap="jdTenantResultMap">
+        select * from jd_tenant where is_deleted = 0
+    </select>
+
+</mapper>

+ 41 - 0
blade-service/trade-finance/src/main/java/org/springblade/finance/service/IJdCorpsService.java

@@ -0,0 +1,41 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.finance.service;
+
+import org.springblade.finance.entity.JdCorps;
+import org.springblade.finance.vo.JdCorpsVO;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ *  服务类
+ *
+ * @author BladeX
+ * @since 2022-01-20
+ */
+public interface IJdCorpsService extends IService<JdCorps> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param jdCorps
+	 * @return
+	 */
+	IPage<JdCorpsVO> selectJdCorpsPage(IPage<JdCorpsVO> page, JdCorpsVO jdCorps);
+
+}

+ 41 - 0
blade-service/trade-finance/src/main/java/org/springblade/finance/service/IJdEmployeeService.java

@@ -0,0 +1,41 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.finance.service;
+
+import org.springblade.finance.entity.JdEmployee;
+import org.springblade.finance.vo.JdEmployeeVO;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ *  服务类
+ *
+ * @author BladeX
+ * @since 2022-01-20
+ */
+public interface IJdEmployeeService extends IService<JdEmployee> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param jdEmployee
+	 * @return
+	 */
+	IPage<JdEmployeeVO> selectJdEmployeePage(IPage<JdEmployeeVO> page, JdEmployeeVO jdEmployee);
+
+}

+ 41 - 0
blade-service/trade-finance/src/main/java/org/springblade/finance/service/IJdModuleService.java

@@ -0,0 +1,41 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.finance.service;
+
+import org.springblade.finance.entity.JdModule;
+import org.springblade.finance.vo.JdModuleVO;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ * 租户jd模块表 服务类
+ *
+ * @author BladeX
+ * @since 2022-01-20
+ */
+public interface IJdModuleService extends IService<JdModule> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param jdModule
+	 * @return
+	 */
+	IPage<JdModuleVO> selectJdModulePage(IPage<JdModuleVO> page, JdModuleVO jdModule);
+
+}

+ 41 - 0
blade-service/trade-finance/src/main/java/org/springblade/finance/service/IJdTenantService.java

@@ -0,0 +1,41 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.finance.service;
+
+import org.springblade.finance.entity.JdTenant;
+import org.springblade.finance.vo.JdTenantVO;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ * 租户jd配置信息表 服务类
+ *
+ * @author BladeX
+ * @since 2022-01-20
+ */
+public interface IJdTenantService extends IService<JdTenant> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param jdTenant
+	 * @return
+	 */
+	IPage<JdTenantVO> selectJdTenantPage(IPage<JdTenantVO> page, JdTenantVO jdTenant);
+
+}

+ 41 - 0
blade-service/trade-finance/src/main/java/org/springblade/finance/service/impl/JdCorpsServiceImpl.java

@@ -0,0 +1,41 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.finance.service.impl;
+
+import org.springblade.finance.entity.JdCorps;
+import org.springblade.finance.vo.JdCorpsVO;
+import org.springblade.finance.mapper.JdCorpsMapper;
+import org.springblade.finance.service.IJdCorpsService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ *  服务实现类
+ *
+ * @author BladeX
+ * @since 2022-01-20
+ */
+@Service
+public class JdCorpsServiceImpl extends ServiceImpl<JdCorpsMapper, JdCorps> implements IJdCorpsService {
+
+	@Override
+	public IPage<JdCorpsVO> selectJdCorpsPage(IPage<JdCorpsVO> page, JdCorpsVO jdCorps) {
+		return page.setRecords(baseMapper.selectJdCorpsPage(page, jdCorps));
+	}
+
+}

+ 41 - 0
blade-service/trade-finance/src/main/java/org/springblade/finance/service/impl/JdEmployeeServiceImpl.java

@@ -0,0 +1,41 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.finance.service.impl;
+
+import org.springblade.finance.entity.JdEmployee;
+import org.springblade.finance.vo.JdEmployeeVO;
+import org.springblade.finance.mapper.JdEmployeeMapper;
+import org.springblade.finance.service.IJdEmployeeService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ *  服务实现类
+ *
+ * @author BladeX
+ * @since 2022-01-20
+ */
+@Service
+public class JdEmployeeServiceImpl extends ServiceImpl<JdEmployeeMapper, JdEmployee> implements IJdEmployeeService {
+
+	@Override
+	public IPage<JdEmployeeVO> selectJdEmployeePage(IPage<JdEmployeeVO> page, JdEmployeeVO jdEmployee) {
+		return page.setRecords(baseMapper.selectJdEmployeePage(page, jdEmployee));
+	}
+
+}

+ 41 - 0
blade-service/trade-finance/src/main/java/org/springblade/finance/service/impl/JdModuleServiceImpl.java

@@ -0,0 +1,41 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.finance.service.impl;
+
+import org.springblade.finance.entity.JdModule;
+import org.springblade.finance.vo.JdModuleVO;
+import org.springblade.finance.mapper.JdModuleMapper;
+import org.springblade.finance.service.IJdModuleService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ * 租户jd模块表 服务实现类
+ *
+ * @author BladeX
+ * @since 2022-01-20
+ */
+@Service
+public class JdModuleServiceImpl extends ServiceImpl<JdModuleMapper, JdModule> implements IJdModuleService {
+
+	@Override
+	public IPage<JdModuleVO> selectJdModulePage(IPage<JdModuleVO> page, JdModuleVO jdModule) {
+		return page.setRecords(baseMapper.selectJdModulePage(page, jdModule));
+	}
+
+}

+ 41 - 0
blade-service/trade-finance/src/main/java/org/springblade/finance/service/impl/JdTenantServiceImpl.java

@@ -0,0 +1,41 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.finance.service.impl;
+
+import org.springblade.finance.entity.JdTenant;
+import org.springblade.finance.vo.JdTenantVO;
+import org.springblade.finance.mapper.JdTenantMapper;
+import org.springblade.finance.service.IJdTenantService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ * 租户jd配置信息表 服务实现类
+ *
+ * @author BladeX
+ * @since 2022-01-20
+ */
+@Service
+public class JdTenantServiceImpl extends ServiceImpl<JdTenantMapper, JdTenant> implements IJdTenantService {
+
+	@Override
+	public IPage<JdTenantVO> selectJdTenantPage(IPage<JdTenantVO> page, JdTenantVO jdTenant) {
+		return page.setRecords(baseMapper.selectJdTenantPage(page, jdTenant));
+	}
+
+}

+ 133 - 5
blade-service/trade-finance/src/main/java/org/springblade/finance/service/impl/SettlementServiceImpl.java

@@ -18,9 +18,12 @@ package org.springblade.finance.service.impl;
 
 
 import com.alibaba.fastjson.JSONObject;
+import com.aliyun.tea.TeaConverter;
+import com.aliyun.tea.TeaPair;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.jdy.v7sdk.models.AccountGroupRequest;
 import org.springblade.check.dto.AuditProecessDTO;
 import org.springblade.check.entity.AuditPathsActs;
 import org.springblade.check.entity.AuditPathsLevels;
@@ -29,9 +32,14 @@ import org.springblade.client.entity.CorpsDesc;
 import org.springblade.core.secure.utils.SecureUtil;
 import org.springblade.core.tool.api.R;
 import org.springblade.deliver.goods.entity.Delivery;
+import org.springblade.deliver.goods.entity.DeliveryFees;
 import org.springblade.deliver.goods.entity.DeliveryItems;
+import org.springblade.deliver.goods.feign.IDeliveryClient;
+import org.springblade.finance.TokenRequestQuery;
 import org.springblade.finance.dto.SettlementDTO;
+import org.springblade.finance.entity.JdTenant;
 import org.springblade.finance.enums.SettlementEnum;
+import org.springblade.finance.mapper.JdTenantMapper;
 import org.springblade.finance.vojo.*;
 import org.springblade.finance.mapper.AccMapper;
 import org.springblade.finance.mapper.ItemsMapper;
@@ -63,9 +71,7 @@ import org.springframework.transaction.annotation.Transactional;
 import java.math.BigDecimal;
 import java.math.BigInteger;
 import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
+import java.util.*;
 import java.util.stream.Collectors;
 
 /**
@@ -95,6 +101,10 @@ public class SettlementServiceImpl extends ServiceImpl<SettlementMapper, Settlem
 
 	private final IBusinessOverpaymentClient businessOverpaymentClient; //溢付款对外访问接口
 
+	private IDeliveryClient deliveryClient;
+
+	private JdTenantMapper jdTenantMapper;
+
 
 	@Override
 	public IPage<SettlementVO> selectSettlementPage(IPage<SettlementVO> page, SettlementVO settlement) {
@@ -414,6 +424,29 @@ public class SettlementServiceImpl extends ServiceImpl<SettlementMapper, Settlem
 			orderFees.setSettlmentAmount(decimal);
 			orderFeesClient.submit(orderFees);
 		}
+		else if(type ==3)
+		{
+			Long srcFeesId = acc.getSrcFeesId();
+			if (srcFeesId == null) {
+				throw new SecurityException("撤销账单失败,未获取到原业务信息");
+			}
+
+			R<DeliveryFees> feesR = deliveryClient.getFeesById(srcFeesId);
+			if (feesR.getData() == null) {
+				throw new SecurityException("修改原单据失败");
+			}
+			//回退原业务表数据
+			DeliveryFees deliveryFees = feesR.getData();
+			if (deliveryFees.getSettlmentAmount() == null) {
+				throw new SecurityException("撤销账单失败,原业务表已收金额为空");
+			}
+			BigDecimal decimal = deliveryFees.getSettlmentAmount().subtract(items.getThisAmount());
+			if (decimal.compareTo(BigDecimal.ZERO) == -1) {
+				throw new SecurityException("撤销账单失败,剩余已收金额不够本次扣款");
+			}
+			deliveryFees.setSettlmentAmount(decimal);
+			deliveryClient.submitFees(deliveryFees);
+		}
 
 	}
 
@@ -535,10 +568,31 @@ public class SettlementServiceImpl extends ServiceImpl<SettlementMapper, Settlem
 			orderFees.setSettlmentAmount(orderFees.getSettlmentAmount() != null ? orderFees.getSettlmentAmount().add(items.getThisAmount()) : new BigDecimal("0").add(items.getThisAmount()));
 			accMapper.updateById(acc);
 			orderFeesClient.submit(orderFees);
-		} else {
+		}
+		else if(type==3)
+		{
+			Long srcFeesId = acc.getSrcFeesId();
+			if (srcFeesId == null)
+			{
+				throw new SecurityException("操作失败,未获取到原业务信息");
+			}
+			R<DeliveryFees> feesById = deliveryClient.getFeesById(srcFeesId);
+			if(!feesById.isSuccess()&&feesById.getData()==null)
+			{
+				throw new SecurityException("修改原单据失败");
+			}
+			DeliveryFees deliveryFees = feesById.getData();
+			acc.setSettlementAmount(acc.getSettlementAmount() != null ? acc.getSettlementAmount().add(items.getThisAmount()) : new BigDecimal("0").add(items.getThisAmount()));
+			deliveryFees.setSettlmentAmount(deliveryFees.getSettlmentAmount() != null ? deliveryFees.getSettlmentAmount().add(items.getThisAmount()) : new BigDecimal("0").add(items.getThisAmount()));
+			accMapper.updateById(acc);
+			deliveryClient.submitFees(deliveryFees);
+		}
+
+		else {
 			throw new SecurityException("操作失败,财务类型为空无法结算");
 		}
 
+
 		//验证结算总金额是否超限
 
 		/*BigDecimal orderAmount = client.getSettlmentAmount();
@@ -592,6 +646,22 @@ public class SettlementServiceImpl extends ServiceImpl<SettlementMapper, Settlem
 					throw new SecurityException("财务-修改原单据的费用明细错误");
 				}
 			}
+			else if(e.getSrcType() == 3)
+			{
+				R<DeliveryFees> fees = deliveryClient.getFeesById(e.getSrcFeesId());
+				DeliveryFees feesData = fees.getData();
+					if (feesData == null)
+					{
+						throw new SecurityException("未查到原单据的费用明细,无法修改状态");
+					}
+					feesData.setIsCheck(1);
+					R submit = deliveryClient.submitFees(feesData);
+					if (!submit.isSuccess()) {
+						throw new SecurityException("财务-修改原单据的费用明细错误");
+					}
+
+
+			}
 			e.setId(null);
 			e.setPid(settlement.getId());
 			e.setCreateTime(new Date());
@@ -604,7 +674,8 @@ public class SettlementServiceImpl extends ServiceImpl<SettlementMapper, Settlem
 				e.setCorpName(corpMessage.getData().getCname());
 			}
 			//todo 金蝶测试-凭证保存
-			toJinDie(e);
+
+			//toJinDie(e);
 
 		});
 		List<CorpsBank> corpsBanks = corpsDescClient.listBankByCorpId(settlement.getCorpId());
@@ -941,4 +1012,61 @@ public class SettlementServiceImpl extends ServiceImpl<SettlementMapper, Settlem
 		return businessOverpaymentClient.updateOverpayment(overpayment);
 	}
 
+
+	public void testSaveVoucher() throws Exception {
+
+		//非达沃特用户直接返回
+		if(!AuthUtil.getTenantId().equals("681169"))
+		{
+			return;
+		}
+		//1.获取AccountGroupRequest
+		AccountGroupRequest accountGroupRequest = this.getAccountGroupRequest();
+		if(accountGroupRequest==null)
+		{
+			throw new SecurityException("获取账套配置信息失败");
+		}
+		//2.获取账套
+		Map<String, String> group = this.getGroup(accountGroupRequest, "金蝶开发者测试账套");
+
+
+
+	}
+
+	//测试获取AccountGroupRequest
+	public AccountGroupRequest getAccountGroupRequest() throws Exception
+	{
+		//校验当前租户配置,如果存在配置,返回token
+		LambdaQueryWrapper<JdTenant> jdTenantLambdaQueryWrapper=new LambdaQueryWrapper<>();
+		jdTenantLambdaQueryWrapper
+			.eq(JdTenant::getTenantId,AuthUtil.getTenantId())
+			.eq(JdTenant::getIsEnable,1);
+		JdTenant jdTenant = jdTenantMapper.selectOne(jdTenantLambdaQueryWrapper);
+		if(jdTenant==null)
+		{
+			throw new SecurityException("当前租户未配置凭证信息");
+		}
+		TokenRequestQuery tokenRequestQuery = TokenRequestQuery.build(TeaConverter.buildMap(
+			new TeaPair("clientId", jdTenant.getClientId()),
+			new TeaPair("clientSecret", jdTenant.getClientSecret()),
+			new TeaPair("username", jdTenant.getUsername()),
+			new TeaPair("password", jdTenant.getPassword())
+		));
+		//获取token
+		com.jdy.v7sdk.auth auth = new com.jdy.v7sdk.auth();
+		AccountGroupRequest accessTokenObject = auth.getToken(tokenRequestQuery);
+		return accessTokenObject;
+	}
+
+	//测试获取套账
+	public Map<String, String> getGroup (AccountGroupRequest accountGroupRequest,String accountName) throws Exception {
+		com.jdy.v7sdk.auth auth = new com.jdy.v7sdk.auth();
+		java.util.List<?> accountGroups = auth.getAccount(accountGroupRequest);
+		java.util.Map<String, Object> accountService = com.aliyun.teautil.Common.assertAsMap(accountGroups.get(0));
+		java.util.List<Object> groups = com.aliyun.teautil.Common.assertAsArray(accountService.get("accountGroups"));
+		java.util.Map<String, String> group = com.aliyun.teautil.Common.stringifyMapValue(com.aliyun.teautil.Common.assertAsMap(groups.get(1)));
+		return new HashMap();
+	}
+
+
 }

+ 1 - 0
blade-service/trade-finance/src/main/java/org/springblade/finance/tool/JdyTool.java

@@ -38,6 +38,7 @@ public class JdyTool
 		//获取账套
 		java.util.List<?> accountGroups = auth.getAccount(accessTokenObject);
 		//账套可能有多条,这里示例默认取第一条。
+
 		java.util.Map<String, Object> accountService = com.aliyun.teautil.Common.assertAsMap(accountGroups.get(0));
 		java.util.List<Object> groups = com.aliyun.teautil.Common.assertAsArray(accountService.get("accountGroups"));
 		java.util.Map<String, String> group = com.aliyun.teautil.Common.stringifyMapValue(com.aliyun.teautil.Common.assertAsMap(groups.get(1)));