Browse Source

2024年9月26日17:04:05

纪新园 1 year ago
parent
commit
27535b6b74
26 changed files with 1214 additions and 79 deletions
  1. 34 0
      blade-service-api/blade-user-api/src/main/java/org/springblade/system/user/store/goods/dto/AppDTO.java
  2. 34 0
      blade-service-api/blade-user-api/src/main/java/org/springblade/system/user/store/goods/dto/AppVersionDTO.java
  3. 137 0
      blade-service-api/blade-user-api/src/main/java/org/springblade/system/user/store/goods/entity/App.java
  4. 115 0
      blade-service-api/blade-user-api/src/main/java/org/springblade/system/user/store/goods/entity/AppVersion.java
  5. 36 0
      blade-service-api/blade-user-api/src/main/java/org/springblade/system/user/store/goods/vo/AppVO.java
  6. 36 0
      blade-service-api/blade-user-api/src/main/java/org/springblade/system/user/store/goods/vo/AppVersionVO.java
  7. 5 11
      blade-service/blade-deliver-goods/src/main/java/org/springblade/deliver/goods/service/impl/DeliveryServiceImpl.java
  8. 1 0
      blade-service/blade-los/src/main/java/org/springblade/los/business/sea/service/impl/BillsServiceImpl.java
  9. 7 3
      blade-service/blade-los/src/main/java/org/springblade/los/trade/service/impl/AgentServiceImpl.java
  10. 24 30
      blade-service/blade-purchase-sales/src/main/java/org/springblade/purchase/sales/service/impl/OrderServiceImpl.java
  11. 0 2
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/corps/controller/CorpsDescController.java
  12. 0 1
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/corps/fegin/PJCorprClient.java
  13. 0 1
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/corps/service/impl/CorpsAttnServiceImpl.java
  14. 75 28
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/corps/service/impl/CorpsDescServiceImpl.java
  15. 0 2
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/shoppingCart/service/impl/ShoppingCartServiceImpl.java
  16. 1 1
      blade-service/blade-user/src/main/java/org/springblade/system/user/service/impl/UserServiceImpl.java
  17. 136 0
      blade-service/blade-user/src/main/java/org/springblade/system/user/store/goods/controller/AppController.java
  18. 165 0
      blade-service/blade-user/src/main/java/org/springblade/system/user/store/goods/controller/AppVersionController.java
  19. 43 0
      blade-service/blade-user/src/main/java/org/springblade/system/user/store/goods/mapper/AppMapper.java
  20. 24 0
      blade-service/blade-user/src/main/java/org/springblade/system/user/store/goods/mapper/AppMapper.xml
  21. 43 0
      blade-service/blade-user/src/main/java/org/springblade/system/user/store/goods/mapper/AppVersionMapper.java
  22. 21 0
      blade-service/blade-user/src/main/java/org/springblade/system/user/store/goods/mapper/AppVersionMapper.xml
  23. 64 0
      blade-service/blade-user/src/main/java/org/springblade/system/user/store/goods/service/IAppService.java
  24. 41 0
      blade-service/blade-user/src/main/java/org/springblade/system/user/store/goods/service/IAppVersionService.java
  25. 131 0
      blade-service/blade-user/src/main/java/org/springblade/system/user/store/goods/service/impl/AppServiceImpl.java
  26. 41 0
      blade-service/blade-user/src/main/java/org/springblade/system/user/store/goods/service/impl/AppVersionServiceImpl.java

+ 34 - 0
blade-service-api/blade-user-api/src/main/java/org/springblade/system/user/store/goods/dto/AppDTO.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.system.user.store.goods.dto;
+
+import org.springblade.system.user.store.goods.entity.App;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * app应用表数据传输对象实体类
+ *
+ * @author BladeX
+ * @since 2021-12-13
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class AppDTO extends App {
+	private static final long serialVersionUID = 1L;
+
+}

+ 34 - 0
blade-service-api/blade-user-api/src/main/java/org/springblade/system/user/store/goods/dto/AppVersionDTO.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.system.user.store.goods.dto;
+
+import org.springblade.system.user.store.goods.entity.AppVersion;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * app版本表数据传输对象实体类
+ *
+ * @author BladeX
+ * @since 2021-12-13
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class AppVersionDTO extends AppVersion {
+	private static final long serialVersionUID = 1L;
+
+}

+ 137 - 0
blade-service-api/blade-user-api/src/main/java/org/springblade/system/user/store/goods/entity/App.java

@@ -0,0 +1,137 @@
+/*
+ *      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.system.user.store.goods.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * app应用表实体类
+ *
+ * @author BladeX
+ * @since 2021-12-13
+ */
+@Data
+@TableName("blade_app")
+@ApiModel(value = "App对象", description = "app应用表")
+public class App implements Serializable {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * app
+	 */
+	@ApiModelProperty(value = "app")
+	private Long id;
+	/**
+	 * app名称
+	 */
+	@ApiModelProperty(value = "app名称")
+	private String appName;
+	/**
+	 * logo
+	 */
+	@ApiModelProperty(value = "logo")
+	private String logo;
+	/**
+	 * 小图标logo
+	 */
+	@ApiModelProperty(value = "小图标logo")
+	private String miniLogo;
+	/**
+	 * 0为安卓,1为苹果
+	 */
+	@ApiModelProperty(value = "0为安卓,1为苹果")
+	private Integer type;
+	/**
+	 * 安卓包名
+	 */
+	@ApiModelProperty(value = "安卓包名")
+	private String packageName;
+	/**
+	 * 苹果url_schema
+	 */
+	@ApiModelProperty(value = "苹果url_schema")
+	private String urlSchema;
+	/**
+	 * 苹果app_store_id
+	 */
+	@ApiModelProperty(value = "苹果app_store_id")
+	private String appStoreId;
+	/**
+	 * 苹果bundle_id
+	 */
+	@ApiModelProperty(value = "苹果bundle_id")
+	private String bundleId;
+	/**
+	 * app应用描述
+	 */
+	@ApiModelProperty(value = "app应用描述")
+	private String appDesc;
+
+	/**
+	 * 创建时间
+	 */
+	@ApiModelProperty(value = "创建时间")
+	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+	protected Date createTime;
+
+	/**
+	 * 创建人
+	 */
+	@ApiModelProperty(value = "创建人")
+	protected Long createUser;
+
+	/**
+	 * 修改时间
+	 */
+	@ApiModelProperty(value = "修改时间")
+	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+	protected Date updateTime;
+
+	/**
+	 * 修改人
+	 */
+	@ApiModelProperty(value = "修改人")
+	protected Long updateUser;
+
+	/**
+	 * 租户id
+	 */
+	@ApiModelProperty(value = "租户id")
+	private String tenantId;
+
+	@TableField(exist = false)
+	@ApiModelProperty(value = "最新的app版本")
+	private AppVersion appVersion;
+
+	@TableField(exist = false)
+	@ApiModelProperty(value = "app版本历史列表")
+	private List<AppVersion> appVersionList;
+
+}

+ 115 - 0
blade-service-api/blade-user-api/src/main/java/org/springblade/system/user/store/goods/entity/AppVersion.java

@@ -0,0 +1,115 @@
+/*
+ *      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.system.user.store.goods.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * app版本表实体类
+ *
+ * @author BladeX
+ * @since 2021-12-13
+ */
+@Data
+@TableName("blade_app_version")
+@ApiModel(value = "AppVersion对象", description = "app版本表")
+public class AppVersion implements Serializable {
+
+	private static final long serialVersionUID = 1L;
+
+	private Long id;
+	/**
+	 * 属于的app的id
+	 */
+	@ApiModelProperty(value = "属于的app的id")
+	@TableField("appId")
+	private Long appid;
+	/**
+	 * 版本名称
+	 */
+	@ApiModelProperty(value = "版本名称")
+	private String versionName;
+	/**
+	 * 版本号
+	 */
+	@ApiModelProperty(value = "版本号")
+	private String versionCode;
+	/**
+	 * 版本号
+	 */
+	@ApiModelProperty(value = "最新版本号")
+	private String lastVersionCode;
+	/**
+	 * 版本更新描述
+	 */
+	@ApiModelProperty(value = "版本更新描述")
+	private String versionDesc;
+	/**
+	 * 下载地址
+	 */
+	@ApiModelProperty(value = "下载地址")
+	private String downloadUrl;
+	/**
+	 * 是否发布  0待发布 1发布
+	 */
+	@ApiModelProperty(value = "是否发布  0待发布 1发布")
+	private Integer isRelease;
+
+	/**
+	 * 创建时间
+	 */
+	@ApiModelProperty(value = "创建时间")
+	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+	protected Date createTime;
+
+	/**
+	 * 创建人
+	 */
+	@ApiModelProperty(value = "创建人")
+	protected Long createUser;
+
+	/**
+	 * 修改时间
+	 */
+	@ApiModelProperty(value = "修改时间")
+	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+	protected Date updateTime;
+
+	/**
+	 * 修改人
+	 */
+	@ApiModelProperty(value = "修改人")
+	protected Long updateUser;
+
+	/**
+	 * 租户id
+	 */
+	@ApiModelProperty(value = "租户id")
+	private String tenantId;
+
+}

+ 36 - 0
blade-service-api/blade-user-api/src/main/java/org/springblade/system/user/store/goods/vo/AppVO.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.system.user.store.goods.vo;
+
+import org.springblade.system.user.store.goods.entity.App;
+import io.swagger.annotations.ApiModel;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * app应用表视图实体类
+ *
+ * @author BladeX
+ * @since 2021-12-13
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "AppVO对象", description = "app应用表")
+public class AppVO extends App {
+	private static final long serialVersionUID = 1L;
+
+}

+ 36 - 0
blade-service-api/blade-user-api/src/main/java/org/springblade/system/user/store/goods/vo/AppVersionVO.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.system.user.store.goods.vo;
+
+import org.springblade.system.user.store.goods.entity.AppVersion;
+import io.swagger.annotations.ApiModel;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * app版本表视图实体类
+ *
+ * @author BladeX
+ * @since 2021-12-13
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "AppVersionVO对象", description = "app版本表")
+public class AppVersionVO extends AppVersion {
+	private static final long serialVersionUID = 1L;
+
+}

+ 5 - 11
blade-service/blade-deliver-goods/src/main/java/org/springblade/deliver/goods/service/impl/DeliveryServiceImpl.java

@@ -168,7 +168,6 @@ public class DeliveryServiceImpl extends ServiceImpl<DeliveryMapper, Delivery> i
 	 * @return
 	 */
 	@Override
-	@Transactional(rollbackFor = Exception.class)
 	@GlobalTransactional(rollbackFor = Exception.class, timeoutMills = 12000000)
 	public R<Delivery> submitDelivery(Delivery delivery) {
 		String status = null;//订单状态
@@ -389,7 +388,6 @@ public class DeliveryServiceImpl extends ServiceImpl<DeliveryMapper, Delivery> i
 	 * 确认收货及撤销确认收货
 	 */
 	@Override
-	@Transactional(rollbackFor = Exception.class)
 	@GlobalTransactional(rollbackFor = Exception.class, timeoutMills = 12000000)
 	public R submit(Delivery delivery) {
 
@@ -569,7 +567,7 @@ public class DeliveryServiceImpl extends ServiceImpl<DeliveryMapper, Delivery> i
 	}
 
 	@Override
-	@Transactional(rollbackFor = Exception.class)
+	@GlobalTransactional(rollbackFor = Exception.class, timeoutMills = 12000000)
 	public R revocation(Delivery delivery) {
 		Long deliveryId = delivery.getId();
 		Delivery select = baseMapper.selectById(deliveryId);
@@ -720,7 +718,7 @@ public class DeliveryServiceImpl extends ServiceImpl<DeliveryMapper, Delivery> i
 	}
 
 	@Override
-	@Transactional(rollbackFor = Exception.class)
+	@GlobalTransactional(rollbackFor = Exception.class, timeoutMills = 12000000)
 	public Delivery comfire(Delivery delivery) {
 		//防重校验
 		Long deliveryId = delivery.getId();
@@ -1368,8 +1366,7 @@ public class DeliveryServiceImpl extends ServiceImpl<DeliveryMapper, Delivery> i
 	}
 
 	@Override
-	@Transactional(rollbackFor = Exception.class)
-	@GlobalTransactional(timeoutMills = 12000000)
+	@GlobalTransactional(rollbackFor = Exception.class, timeoutMills = 12000000)
 	public void cancel(Delivery delivery) {
 		//防重校验
 		Long deliveryId = delivery.getId();
@@ -1584,8 +1581,7 @@ public class DeliveryServiceImpl extends ServiceImpl<DeliveryMapper, Delivery> i
 	}
 
 	@Override
-	@Transactional(rollbackFor = Exception.class)
-	@GlobalTransactional(timeoutMills = 12000000)
+	@GlobalTransactional(rollbackFor = Exception.class, timeoutMills = 12000000)
 	public R affirmAllot(Delivery delivery) {
 		Delivery select = baseMapper.selectById(delivery.getId());
 		if (select == null) {
@@ -1611,8 +1607,7 @@ public class DeliveryServiceImpl extends ServiceImpl<DeliveryMapper, Delivery> i
 	}
 
 	@Override
-	@Transactional(rollbackFor = Exception.class)
-	@GlobalTransactional(timeoutMills = 12000000)
+	@GlobalTransactional(rollbackFor = Exception.class, timeoutMills = 12000000)
 	public R repealAllot(Delivery delivery) {
 		Delivery select = baseMapper.selectById(delivery.getId());
 		if (select == null) {
@@ -1638,7 +1633,6 @@ public class DeliveryServiceImpl extends ServiceImpl<DeliveryMapper, Delivery> i
 	}
 
 	@Override
-	@Transactional(rollbackFor = Exception.class)
 	public R documentaryStatusUpdate(Delivery delivery) {
 		if (null == delivery.getId()) {
 			throw new RuntimeException("缺少必要参数");

+ 1 - 0
blade-service/blade-los/src/main/java/org/springblade/los/business/sea/service/impl/BillsServiceImpl.java

@@ -3122,6 +3122,7 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 	}
 
 	@Override
+	@Transactional(rollbackFor = Exception.class)
 	public R retreatPledge(String ids, String type) {
 		if (ObjectUtils.isNull(ids)) {
 			throw new RuntimeException("缺少必要参数");

+ 7 - 3
blade-service/blade-los/src/main/java/org/springblade/los/trade/service/impl/AgentServiceImpl.java

@@ -1783,8 +1783,12 @@ public class AgentServiceImpl extends ServiceImpl<AgentMapper, Agent> implements
 				auditProecessDTO.setCorpId(declare.getCorpId());
 				auditProecessDTO.setSalesCompanyId(deptUtils.getDeptPid());
 				auditProecessDTO.setSalesCompanyName(declare.getCreateDeptName());
-				auditProecessDTO.setPayAmount(declare.getSumAmount());
-				auditProecessDTO.setReceivableAmount(declare.getSumAmount());
+				if ("D".equals(declare.getDc())){
+					auditProecessDTO.setReceivableAmount(declare.getActualAmount());
+				}else{
+					auditProecessDTO.setPayAmount(declare.getActualAmount());
+				}
+				auditProecessDTO.setGrossProfit(declare.getProfit());
 				R financeProcess = auditProecessService.createFinanceProcess(auditProecessDTO);
 				if (!financeProcess.isSuccess()) {
 					throw new SecurityException("操作失败,请联系管理员");
@@ -3983,7 +3987,7 @@ public class AgentServiceImpl extends ServiceImpl<AgentMapper, Agent> implements
 			if (new BigDecimal("0").compareTo(finalPaymentReceived) != 0) {
 				BigDecimal amount = feeCenterList.stream().filter(e -> "WK".equals(e.getFeeCode()) && item.getContractNo().equals(e.getBillNo()))
 					.map(FeeCenter::getAmountLoc).reduce(BigDecimal.ZERO, BigDecimal::add);
-				item.setFinalPaymentReceived(item.getFinalPaymentReceived().add(amount));
+				item.setFinalPaymentReceived(item.getFinalPaymentReceived().subtract(amount));
 				item.setFinalPaymentReceivedDate(null);
 				item.setOrderStatus("已收首款未收尾款");
 			}

+ 24 - 30
blade-service/blade-purchase-sales/src/main/java/org/springblade/purchase/sales/service/impl/OrderServiceImpl.java

@@ -217,7 +217,6 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
 	}
 
 	@Override
-//	@Transactional(rollbackFor = Exception.class)
 	@GlobalTransactional(rollbackFor = Exception.class, timeoutMills = 12000000)
 	public R saveOrderMessage(Order order) {
 		// 校验单号重复-新增
@@ -706,7 +705,6 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
 	}
 
 	@Override
-	@Transactional(rollbackFor = Exception.class)
 	@GlobalTransactional(rollbackFor = Exception.class, timeoutMills = 12000000)
 	public R saveOrderMessageApp(Order order) {
 		// 校验单号重复-新增
@@ -979,7 +977,6 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
 	 * @return
 	 */
 	@Override
-	@Transactional(rollbackFor = Exception.class)
 	@GlobalTransactional(rollbackFor = Exception.class, timeoutMills = 12000000)
 	public R affirm(Order order) {
 		// 订单时间
@@ -1268,7 +1265,6 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
 	}
 
 	@Override
-	@Transactional(rollbackFor = Exception.class)
 	@GlobalTransactional(rollbackFor = Exception.class, timeoutMills = 12000000)
 	public void checkOrder(Order order) {
 		Order salesOrder = baseMapper.selectById(order.getId());
@@ -1468,7 +1464,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
 	}
 
 	@Override
-	@Transactional(rollbackFor = Exception.class)
+	@GlobalTransactional(rollbackFor = Exception.class, timeoutMills = 12000000)
 	public void checkChargeBack(Order order) {
 		Order salesOrder = baseMapper.selectById(order.getId());
 
@@ -1877,7 +1873,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
 	 * 申请退单审批通过
 	 */
 	@Override
-	@Transactional(rollbackFor = Exception.class)
+	@GlobalTransactional(rollbackFor = Exception.class, timeoutMills = 12000000)
 	public void checkPassCancel(Long id) {
 		//获得当前销售订单信息
 		Order orderMessage = baseMapper.selectById(id);
@@ -2109,7 +2105,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
 	}
 
 	@Override
-	@Transactional(rollbackFor = Exception.class)
+	@GlobalTransactional(rollbackFor = Exception.class, timeoutMills = 12000000)
 	public void repealCancel(Order orderMessage) {
 		LambdaQueryWrapper<Order> orderLambdaQueryWrapper = new LambdaQueryWrapper<>();
 		orderLambdaQueryWrapper
@@ -2269,7 +2265,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
 	 * @return
 	 */
 	@Override
-	@Transactional(rollbackFor = Exception.class)
+	@GlobalTransactional(rollbackFor = Exception.class, timeoutMills = 12000000)
 	public R dealerSubmit(Order order) {
 		// dealer 1 确认订单 2 取消订单
 		Order selectById = baseMapper.selectById(order.getId());
@@ -3087,7 +3083,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
 	}
 
 	@Override
-	@Transactional(rollbackFor = Exception.class)
+	@GlobalTransactional(rollbackFor = Exception.class, timeoutMills = 12000000)
 	public R revoke(Order order) {
 		Order selectOrder = baseMapper.selectById(order.getId());
 		if (ObjectUtils.isNotNull(selectOrder)) {
@@ -3207,7 +3203,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
 
 
 	@Override
-	@Transactional(rollbackFor = Exception.class)
+	@GlobalTransactional(rollbackFor = Exception.class, timeoutMills = 12000000)
 	public R collectPayment(Order order) {
 		CorpsDesc corpsDesc = new CorpsDesc();
 		if (ObjectUtils.isNotNull(order.getCorpId())) {
@@ -3344,7 +3340,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
 	}
 
 	@Override
-	@Transactional(rollbackFor = Exception.class)
+	@GlobalTransactional(rollbackFor = Exception.class, timeoutMills = 12000000)
 	public R quickBilling(Order order) {
 		// 校验单号重复-新增
 		if (order.getId() == null && StringUtils.isNotBlank(order.getOrderNo())) {
@@ -4921,7 +4917,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
 		return baseMapper.turnoverAnalysisList(AuthUtil.getTenantId(), type, statusDate, endDate, billType);
 	}
 
-	@Transactional(rollbackFor = Exception.class)
+	@GlobalTransactional(rollbackFor = Exception.class, timeoutMills = 12000000)
 	@Override
 	public R returnGoodsRefund(Order order) {
 
@@ -5119,7 +5115,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
 	}
 
 	@Override
-	@Transactional(rollbackFor = Exception.class)
+	@GlobalTransactional(rollbackFor = Exception.class, timeoutMills = 12000000)
 	public boolean shippingOrder(Order order) {
 		// 业务处理
 		LambdaQueryWrapper<Order> lambdaQueryWrapper = new LambdaQueryWrapper<>();
@@ -5205,7 +5201,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
 	}
 
 	@Override
-	@Transactional(rollbackFor = Exception.class)
+	@GlobalTransactional(rollbackFor = Exception.class, timeoutMills = 12000000)
 	public R collectHairGoods(Order order) {
 		if (order.getId() == null) {
 			throw new RuntimeException("缺少必要参数");
@@ -5531,7 +5527,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
 	}
 
 	@Override
-	@Transactional(rollbackFor = Exception.class)
+	@GlobalTransactional(rollbackFor = Exception.class, timeoutMills = 12000000)
 	public R offset(Order order) {
 		Order selectOrder = baseMapper.selectById(order.getId());
 		if (ObjectUtils.isNotNull(selectOrder) && ObjectUtils.isNotNull(selectOrder.getCorpId())) {
@@ -5555,7 +5551,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
 	}
 
 	@Override
-	@Transactional(rollbackFor = Exception.class)
+	@GlobalTransactional(rollbackFor = Exception.class, timeoutMills = 12000000)
 	public R cancelOrder(Order order) {
 		if (order.getId() == null) {
 			throw new RuntimeException("缺少必要参数");
@@ -5686,7 +5682,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
 	}
 
 	@Override
-	@Transactional(rollbackFor = Exception.class)
+	@GlobalTransactional(rollbackFor = Exception.class, timeoutMills = 12000000)
 	public R generatePurchase(Order order) {
 		if (null == order.getId()) {
 			throw new RuntimeException("缺少必要参数");
@@ -5754,7 +5750,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
 	}
 
 	@Override
-	@Transactional(rollbackFor = Exception.class)
+	@GlobalTransactional(rollbackFor = Exception.class, timeoutMills = 12000000)
 	public R generateShipment(Order order) {
 		// 获取销售单主表信息
 		Order orderMessage = baseMapper.selectById(order.getId());
@@ -5800,7 +5796,6 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
 	}
 
 	@Override
-	@Transactional(rollbackFor = Exception.class)
 	@GlobalTransactional(rollbackFor = Exception.class, timeoutMills = 12000000)
 	public R generatePurchaseBill(List<OrderItems> itemsList) {
 		if (ObjectUtils.isNull(itemsList)) {
@@ -6055,7 +6050,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
 	}
 
 	@Override
-	@Transactional(rollbackFor = Exception.class)
+	@GlobalTransactional(rollbackFor = Exception.class, timeoutMills = 12000000)
 	public R purchaseStatusUpdate(Order order) {
 		if (null == order.getId()) {
 			throw new RuntimeException("缺少必要参数");
@@ -6236,7 +6231,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
 	}
 
 	@Override
-	@Transactional(rollbackFor = Exception.class)
+	@GlobalTransactional(rollbackFor = Exception.class, timeoutMills = 12000000)
 	public R cancelPurchaseStatus(Order order) {
 		if (null == order.getId()) {
 			throw new RuntimeException("缺少必要参数");
@@ -6449,7 +6444,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
 	}
 
 	@Override
-	@Transactional(rollbackFor = Exception.class)
+	@GlobalTransactional(rollbackFor = Exception.class, timeoutMills = 12000000)
 	public R quickBillingWX(Order order) {
 		// 校验单号重复-新增
 		if (order.getId() == null && StringUtils.isNotBlank(order.getOrderNo())) {
@@ -6722,7 +6717,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
 	}
 
 	@Override
-	@Transactional(rollbackFor = Exception.class)
+	@GlobalTransactional(rollbackFor = Exception.class, timeoutMills = 12000000)
 	public R quickBillingWXIntegral(Order order) {
 		// 校验单号重复-新增
 		if (order.getId() == null && StringUtils.isNotBlank(order.getOrderNo())) {
@@ -7014,7 +7009,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
 	 * 确认发货,收货
 	 */
 	@Override
-	@Transactional(rollbackFor = Exception.class)
+	@GlobalTransactional(rollbackFor = Exception.class, timeoutMills = 12000000)
 	public R delivery(Order order) {
 		if (order.getId() == null) {
 			throw new RuntimeException("缺少必要参数");
@@ -7211,7 +7206,6 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
 	}
 
 	@Override
-	@Transactional(rollbackFor = Exception.class)
 	@GlobalTransactional(rollbackFor = Exception.class, timeoutMills = 12000000)
 	public R savePlaceOrderMall(Order order) {
 		// 校验单号重复-新增
@@ -7449,7 +7443,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
 	}
 
 	@Override
-	@Transactional(rollbackFor = Exception.class)
+	@GlobalTransactional(rollbackFor = Exception.class, timeoutMills = 12000000)
 	public R quickBillingMall(Order order) {
 
 		Order details = vocationalWork(order);
@@ -7655,7 +7649,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
 	}
 
 	@Override
-	@Transactional(rollbackFor = Exception.class)
+	@GlobalTransactional(rollbackFor = Exception.class, timeoutMills = 12000000)
 	public R cancelOrderMall(Order order) {
 		if (order.getId() == null) {
 			throw new RuntimeException("缺少必要参数");
@@ -8015,7 +8009,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
 	}
 
 	@Override
-	@Transactional(rollbackFor = Exception.class)
+	@GlobalTransactional(rollbackFor = Exception.class, timeoutMills = 12000000)
 	public R synchronization(Long billId, String ordNo, String primaryOrdNo) {
 		Order order = new Order();
 		order.setId(billId);
@@ -8504,7 +8498,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
 	 * @param itemType 付款类型: 采购 销售 收货 发货
 	 */
 
-	@Transactional(rollbackFor = Exception.class)
+	@GlobalTransactional(rollbackFor = Exception.class, timeoutMills = 12000000)
 	public void paymentApply(Order order, String billType, String itemType) {
 		//获取所属公司中文名
 		if (order.getBelongToCorpId() != null) {
@@ -8739,7 +8733,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
 	 * @param itemType 付款类型: 采购 销售 收货 发货
 	 */
 
-	@Transactional(rollbackFor = Exception.class)
+	@GlobalTransactional(rollbackFor = Exception.class, timeoutMills = 12000000)
 	public void paymentApplyFD(Order order, String billType, String itemType) {
 		//获取所属公司中文名
 		if (order.getBelongToCorpId() != null) {

+ 0 - 2
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/corps/controller/CorpsDescController.java

@@ -183,7 +183,6 @@ public class CorpsDescController extends BladeController {
 	@ApiOperationSupport(order = 5)
 	@ApiOperation(value = "修改", notes = "传入corpsDesc")
 	@Transactional(rollbackFor = Exception.class)
-	@GlobalTransactional(rollbackFor = Exception.class, timeoutMills = 12000000)
 	public R update(@Valid @RequestBody PjCorpsDesc corpsDesc) {
 		if (!AuthUtil.getUserRole().contains("admin")) {
 			throw new RuntimeException("暂无权限,删除失败");
@@ -249,7 +248,6 @@ public class CorpsDescController extends BladeController {
 	@ApiOperationSupport(order = 7)
 	@ApiOperation(value = "删除", notes = "传入ids")
 	@Transactional(rollbackFor = Exception.class)
-	@GlobalTransactional(rollbackFor = Exception.class, timeoutMills = 12000000)
 	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
 		if (!AuthUtil.getUserRole().contains("admin")) {
 			throw new RuntimeException("暂无权限,删除失败");

+ 0 - 1
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/corps/fegin/PJCorprClient.java

@@ -66,7 +66,6 @@ public class PJCorprClient implements IPJCorpClient {
 
 	@Override
 	@Transactional(rollbackFor = Exception.class)
-	@GlobalTransactional(rollbackFor = Exception.class, timeoutMills = 12000000)
 	@TenantIgnore
 	public R updateIntegral(List<PjOrder> orderList) {
 		List<User> users = new ArrayList<>();

+ 0 - 1
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/corps/service/impl/CorpsAttnServiceImpl.java

@@ -66,7 +66,6 @@ public class CorpsAttnServiceImpl extends ServiceImpl<CorpsAttnMapper, PjCorpsAt
 	 * @return
 	 */
 	@Override
-	@Transactional(rollbackFor = Exception.class)
 	@GlobalTransactional(rollbackFor = Exception.class, timeoutMills = 12000000)
 	public R createUser(PjCorpsAttn corpsAttn) {
 		PjCorpsAttn attn = baseMapper.selectById(corpsAttn.getId());

+ 75 - 28
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/corps/service/impl/CorpsDescServiceImpl.java

@@ -23,7 +23,6 @@ import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.baomidou.mybatisplus.core.toolkit.StringUtils;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import io.seata.spring.annotation.GlobalTransactional;
 import lombok.AllArgsConstructor;
 import org.springblade.client.entity.CorpsDesc;
 import org.springblade.core.secure.utils.AuthUtil;
@@ -39,6 +38,9 @@ import org.springblade.salesPart.entity.*;
 import org.springblade.salesPart.excel.CorpsDescImportExcel;
 import org.springblade.salesPart.excel.CorpsImportBrandExcel;
 import org.springblade.salesPart.excel.SupplierImportExcel;
+import org.springblade.salesPart.order.mapper.OrderMapper;
+import org.springblade.salesPart.settlement.mapper.SettlementMapper;
+import org.springblade.salesPart.ship.mapper.ShipMapper;
 import org.springblade.salesPart.storage.service.IStorageDescService;
 import org.springblade.salesPart.vo.CorpsDescVO;
 import org.springblade.system.entity.Dept;
@@ -79,6 +81,12 @@ public class CorpsDescServiceImpl extends ServiceImpl<CorpsDescMapper, PjCorpsDe
 
 	private final IBrandDescService brandDescService;
 
+	private final OrderMapper orderMapper;
+
+	private final ShipMapper shipMapper;
+
+	private final SettlementMapper settlementMapper;
+
 
 	static final int GB_SP_DIFF = 160;
 	// 存放国标一级汉字不同读音的起始区位码
@@ -172,7 +180,6 @@ public class CorpsDescServiceImpl extends ServiceImpl<CorpsDescMapper, PjCorpsDe
 	 */
 	@Override
 	@Transactional(rollbackFor = Exception.class)
-	@GlobalTransactional(rollbackFor = Exception.class, timeoutMills = 12000000)
 	public R submit(PjCorpsDesc corpsDesc) {
 		Long userId = SecureUtil.getUserId();
 		Date date = new Date();
@@ -221,6 +228,51 @@ public class CorpsDescServiceImpl extends ServiceImpl<CorpsDescMapper, PjCorpsDe
 			corpsDesc.setCreateDept(Long.valueOf(SecureUtil.getDeptId()));
 			corpsDesc.setUpdateUser(AuthUtil.getUserId());
 			baseMapper.updateById(corpsDesc);
+
+			/*List<PjOrder> orderList = orderMapper.selectList(new LambdaQueryWrapper<PjOrder>()
+				.eq(PjOrder::getTenantId, AuthUtil.getTenantId())
+				.eq(PjOrder::getIsDeleted, 0)
+				.eq(PjOrder::getCustomerId, corpsDesc.getId()));
+			if (!orderList.isEmpty()) {
+				List<PjOrder> orders = orderList.stream().filter(item -> !corpsDesc.getCname().equals(item.getCustomerName()))
+					.collect(Collectors.toList());
+				for (PjOrder item : orders) {
+					item.setCustomerName(corpsDesc.getCname());
+					item.setUpdateTime(new Date());
+					item.setUpdateUser(AuthUtil.getUserId());
+					item.setUpdateUserName(AuthUtil.getUserName());
+					orderMapper.updateById(item);
+				}
+			}
+			List<PjShip> shipList = shipMapper.selectList(new LambdaQueryWrapper<PjShip>()
+				.eq(PjShip::getTenantId, AuthUtil.getTenantId())
+				.eq(PjShip::getIsDeleted, 0)
+				.eq(PjShip::getCustomerId, corpsDesc.getId()));
+			if (!shipList.isEmpty()) {
+				List<PjShip> ships = shipList.stream().filter(item -> !corpsDesc.getCname().equals(item.getCustomerName()))
+					.collect(Collectors.toList());
+				for (PjShip item : ships) {
+					item.setCustomerName(corpsDesc.getCname());
+					item.setUpdateTime(new Date());
+					item.setUpdateUser(AuthUtil.getUserId());
+					item.setUpdateUserName(AuthUtil.getUserName());
+					shipMapper.updateById(item);
+				}
+			}
+			List<PjSettlement> settlementList = settlementMapper.selectList(new LambdaQueryWrapper<PjSettlement>()
+				.eq(PjSettlement::getTenantId, AuthUtil.getTenantId())
+				.eq(PjSettlement::getIsDeleted, 0)
+				.eq(PjSettlement::getCorpId, corpsDesc.getId()));
+			if (!settlementList.isEmpty()) {
+				List<PjSettlement> settlements = settlementList.stream().filter(item -> !corpsDesc.getCname().equals(item.getCorpName()))
+					.collect(Collectors.toList());
+				for (PjSettlement item : settlements) {
+					item.setCorpName(corpsDesc.getCname());
+					item.setUpdateTime(new Date());
+					item.setUpdateUser(AuthUtil.getUserId());
+					settlementMapper.updateById(item);
+				}
+			}*/
 		}
 		Long pId = corpsDesc.getId();
 		String tenantId = corpsDesc.getTenantId();
@@ -252,7 +304,6 @@ public class CorpsDescServiceImpl extends ServiceImpl<CorpsDescMapper, PjCorpsDe
 	 */
 	@Override
 	@Transactional(rollbackFor = Exception.class)
-	@GlobalTransactional(rollbackFor = Exception.class, timeoutMills = 12000000)
 	public R importUser(List<CorpsDescImportExcel> data) {
 		try {
 			if (CollectionUtils.isEmpty(data)) {
@@ -484,7 +535,6 @@ public class CorpsDescServiceImpl extends ServiceImpl<CorpsDescMapper, PjCorpsDe
 	 */
 	@Override
 	@Transactional(rollbackFor = Exception.class)
-	@GlobalTransactional(rollbackFor = Exception.class, timeoutMills = 12000000)
 	public R supplierImport(List<SupplierImportExcel> data) {
 		try {
 			if (CollectionUtils.isEmpty(data)) {
@@ -814,7 +864,6 @@ public class CorpsDescServiceImpl extends ServiceImpl<CorpsDescMapper, PjCorpsDe
 
 	@Override
 	@Transactional(rollbackFor = Exception.class)
-	@GlobalTransactional(rollbackFor = Exception.class, timeoutMills = 12000000)
 	public R saveCorpsDescApp(PjCorpsDesc corpsDesc) {
 		Long userId = SecureUtil.getUserId();
 		Long deptId = Long.valueOf(AuthUtil.getDeptId());
@@ -918,14 +967,14 @@ public class CorpsDescServiceImpl extends ServiceImpl<CorpsDescMapper, PjCorpsDe
 				corpsAttn.setUserId(user.getId());
 			}
 			List<PjCorpsAttn> corpsAttnList = corpsAttnService.list(new LambdaQueryWrapper<PjCorpsAttn>()
-				.eq(PjCorpsAttn::getTel,corpsDesc.getTel())
-				.eq(PjCorpsAttn::getTenantId,AuthUtil.getTenantId())
-				.eq(PjCorpsAttn::getIsDeleted,0));
-			if (!corpsAttnList.isEmpty()){
+				.eq(PjCorpsAttn::getTel, corpsDesc.getTel())
+				.eq(PjCorpsAttn::getTenantId, AuthUtil.getTenantId())
+				.eq(PjCorpsAttn::getIsDeleted, 0));
+			if (!corpsAttnList.isEmpty()) {
 				PjCorpsDesc pjCorpsDesc1 = baseMapper.selectById(corpsAttnList.get(0).getPid());
-				if (pjCorpsDesc1 != null){
-					throw new RuntimeException("该手机号:"+corpsDesc.getTel()+"已经在客户:"+pjCorpsDesc1.getCname()+"注册,请修改客户名称");
-				}else{
+				if (pjCorpsDesc1 != null) {
+					throw new RuntimeException("该手机号:" + corpsDesc.getTel() + "已经在客户:" + pjCorpsDesc1.getCname() + "注册,请修改客户名称");
+				} else {
 					throw new RuntimeException("该手机号未查到客户信息");
 				}
 			}
@@ -1087,7 +1136,6 @@ public class CorpsDescServiceImpl extends ServiceImpl<CorpsDescMapper, PjCorpsDe
 
 	@Override
 	@Transactional(rollbackFor = Exception.class)
-	@GlobalTransactional(rollbackFor = Exception.class, timeoutMills = 12000000)
 	public R importBrand(List<CorpsImportBrandExcel> data) {
 		if (CollectionUtils.isEmpty(data)) {
 			throw new SecurityException("导入数据不能为空");
@@ -1151,7 +1199,6 @@ public class CorpsDescServiceImpl extends ServiceImpl<CorpsDescMapper, PjCorpsDe
 	 */
 	@Override
 	@Transactional(rollbackFor = Exception.class)
-	@GlobalTransactional(rollbackFor = Exception.class, timeoutMills = 12000000)
 	public R saveCorpsDesc(PjCorpsDesc corpsDesc) {
 		Long userId = SecureUtil.getUserId();
 		Long deptId = Long.valueOf(AuthUtil.getDeptId());
@@ -1266,14 +1313,14 @@ public class CorpsDescServiceImpl extends ServiceImpl<CorpsDescMapper, PjCorpsDe
 				//保存客户联系人信息
 				PjCorpsAttn corpsAttn = new PjCorpsAttn();
 				List<PjCorpsAttn> corpsAttnList = corpsAttnService.list(new LambdaQueryWrapper<PjCorpsAttn>()
-					.eq(PjCorpsAttn::getTel,corpsDesc.getTel())
-					.eq(PjCorpsAttn::getTenantId,AuthUtil.getTenantId())
-					.eq(PjCorpsAttn::getIsDeleted,0));
-				if (!corpsAttnList.isEmpty()){
+					.eq(PjCorpsAttn::getTel, corpsDesc.getTel())
+					.eq(PjCorpsAttn::getTenantId, AuthUtil.getTenantId())
+					.eq(PjCorpsAttn::getIsDeleted, 0));
+				if (!corpsAttnList.isEmpty()) {
 					PjCorpsDesc pjCorpsDesc1 = baseMapper.selectById(corpsAttnList.get(0).getPid());
-					if (pjCorpsDesc1 != null){
-						throw new RuntimeException("该手机号:"+corpsDesc.getTel()+"已经在客户:"+pjCorpsDesc1.getCname()+"注册,请修改客户名称");
-					}else{
+					if (pjCorpsDesc1 != null) {
+						throw new RuntimeException("该手机号:" + corpsDesc.getTel() + "已经在客户:" + pjCorpsDesc1.getCname() + "注册,请修改客户名称");
+					} else {
 						throw new RuntimeException("该手机号未查到客户信息");
 					}
 				}
@@ -1406,19 +1453,19 @@ public class CorpsDescServiceImpl extends ServiceImpl<CorpsDescMapper, PjCorpsDe
 	 */
 	public R saveOrUpdateAttn(PjCorpsDesc corpsDesc, Long userId, Long pId, String tenantId, Date date) {
 		if (CollectionUtils.isNotEmpty(corpsDesc.getCorpsAttnList())) {
-			String tel  = corpsDesc.getCorpsAttnList().stream().map(PjCorpsAttn::getTel).filter(Objects::nonNull)
+			String tel = corpsDesc.getCorpsAttnList().stream().map(PjCorpsAttn::getTel).filter(Objects::nonNull)
 				.distinct().collect(Collectors.joining(","));
 			List<PjCorpsAttn> pjCorpsAttnList = corpsAttnService.list(new LambdaQueryWrapper<PjCorpsAttn>()
-				.eq(PjCorpsAttn::getIsDeleted,0)
-				.eq(PjCorpsAttn::getTenantId,AuthUtil.getTenantId())
-				.apply("find_in_set(tel,'"+tel+"')"));
+				.eq(PjCorpsAttn::getIsDeleted, 0)
+				.eq(PjCorpsAttn::getTenantId, AuthUtil.getTenantId())
+				.apply("find_in_set(tel,'" + tel + "')"));
 			for (PjCorpsAttn corpsAttn : corpsDesc.getCorpsAttnList()) {
 				corpsAttn.setPid(pId);
-				List<PjCorpsAttn> pjCorpsAttns = pjCorpsAttnList.stream().filter(e-> e.getTel().equals(corpsAttn.getTel()))
+				List<PjCorpsAttn> pjCorpsAttns = pjCorpsAttnList.stream().filter(e -> e.getTel().equals(corpsAttn.getTel()))
 					.collect(Collectors.toList());
 				if (corpsAttn.getId() == null) {
-					if (!pjCorpsAttns.isEmpty()){
-						throw new RuntimeException("手机号:"+corpsAttn.getTel()+"已存在,请勿重复添加");
+					if (!pjCorpsAttns.isEmpty()) {
+						throw new RuntimeException("手机号:" + corpsAttn.getTel() + "已存在,请勿重复添加");
 					}
 					corpsAttn.setTenantId(tenantId);
 					corpsAttn.setCreateTime(date);

+ 0 - 2
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/shoppingCart/service/impl/ShoppingCartServiceImpl.java

@@ -127,7 +127,6 @@ public class ShoppingCartServiceImpl extends ServiceImpl<ShoppingCartMapper, PjS
 	 */
 	@Override
 	@Transactional(rollbackFor = Exception.class)
-	@GlobalTransactional(rollbackFor = Exception.class, timeoutMills = 12000000)
 	public R generateOrder(String address, List<Map<String, Object>> list, String payType) {
 
 		StringBuilder ids = new StringBuilder();
@@ -335,7 +334,6 @@ public class ShoppingCartServiceImpl extends ServiceImpl<ShoppingCartMapper, PjS
 
 	@Override
 	@Transactional(rollbackFor = Exception.class)
-	@GlobalTransactional(rollbackFor = Exception.class, timeoutMills = 12000000)
 	public R activityGenerateOrder(String address, List<Map<String, Object>> list, String payType) {
 		StringBuilder ids = new StringBuilder();
 		StringBuilder goodsName = new StringBuilder();

+ 1 - 1
blade-service/blade-user/src/main/java/org/springblade/system/user/service/impl/UserServiceImpl.java

@@ -106,7 +106,7 @@ public class UserServiceImpl extends BaseServiceImpl<UserMapper, User> implement
 			.eq(User::getAppletsId, user.getAppletsId())
 		);
 		if (userCount > 0 && Func.isEmpty(user.getId())) {
-			throw new ServiceException(StringUtil.format("当前用户 [{}] 已存在!", user.getAccount()));
+			throw new RuntimeException(StringUtil.format("当前用户 [{}] 已存在!", user.getAccount()));
 		}
 		return save(user) && submitUserDept(user);
 	}

+ 136 - 0
blade-service/blade-user/src/main/java/org/springblade/system/user/store/goods/controller/AppController.java

@@ -0,0 +1,136 @@
+/*
+ *      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.system.user.store.goods.controller;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import org.springblade.system.user.store.goods.entity.App;
+import org.springblade.system.user.store.goods.entity.AppVersion;
+import org.springblade.system.user.store.goods.service.IAppService;
+import org.springblade.system.user.store.goods.service.IAppVersionService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import lombok.AllArgsConstructor;
+import org.springblade.core.boot.ctrl.BladeController;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.secure.utils.AuthUtil;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+import org.springframework.web.bind.annotation.*;
+
+import javax.validation.Valid;
+import java.util.List;
+
+/**
+ * app应用表 控制器
+ *
+ * @author BladeX
+ * @since 2021-12-13
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("/app")
+@Api(value = "app应用管理", tags = "app应用表接口")
+public class AppController extends BladeController {
+
+	private final IAppService appService;
+
+	private final IAppVersionService appVersionService;
+
+	/**
+	 * 详情
+	 */
+	@GetMapping("/detail")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "查看app应用", notes = "传入app")
+	public R<App> detail(App app) {
+		App detail = appService.getOne(Condition.getQueryWrapper(app));
+		//获取全部的版本记录
+		List<AppVersion> list = appVersionService.list(new LambdaQueryWrapper<AppVersion>().eq(AppVersion::getAppid, detail.getId()).orderByDesc(AppVersion::getVersionCode));
+		detail.setAppVersionList(list);
+		return R.data(detail);
+	}
+
+	/**
+	 * 分页 app应用表
+	 */
+	@GetMapping("/list")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "app应用列表", notes = "传入app")
+	public R<IPage<App>> list(App app, Query query) {
+		try {
+			Page<App> page = new Page<>(query.getCurrent(), query.getSize());
+			IPage<App> pageList = appService.page(page, new LambdaQueryWrapper<App>().eq(App::getTenantId, AuthUtil.getTenantId()).orderByDesc(App::getCreateTime));
+			pageList.getRecords().forEach(it -> {
+				//获取最新的版本信息
+				it.setAppVersion(appService.getLatestVersionById(it.getId(), null));
+			});
+			return R.data(pageList);
+		} catch (Exception e) {
+			return R.fail(e.getMessage());
+		}
+	}
+
+	/**
+	 * 分页列表查询更新历史记录
+	 *
+	 * @return
+	 */
+	@RequestMapping(value = "/versionHistory", method = RequestMethod.GET)
+	public R versionHistory(App app, Query query) {
+		Page<AppVersion> page = new Page<>(query.getCurrent(), query.getSize());
+		IPage<AppVersion> pageList = appVersionService.page(page, new LambdaQueryWrapper<AppVersion>().eq(AppVersion::getAppid, app.getId()).orderByDesc(AppVersion::getVersionCode));
+		return R.data(pageList);
+	}
+
+
+	/**
+	 * 新增 app应用表
+	 */
+	@PostMapping("/save")
+	@ApiOperationSupport(order = 4)
+	@ApiOperation(value = "新增app应用", notes = "传入app")
+	public R<App> save(@Valid @RequestBody App app) {
+		return R.data(appService.saveApp(app));
+	}
+
+	/**
+	 * 修改 app应用表
+	 */
+	@PostMapping("/update")
+	@ApiOperationSupport(order = 5)
+	@ApiOperation(value = "修改", notes = "传入app")
+	public R update(@Valid @RequestBody App app) {
+		return R.status(appService.updateById(app));
+	}
+
+	/**
+	 * 删除 app应用表
+	 */
+	@PostMapping("/remove")
+	@ApiOperationSupport(order = 8)
+	@ApiOperation(value = "删除", notes = "传入ids")
+	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+		return R.status(appService.removeByAppIds(Func.toLongList(ids)));
+	}
+
+
+}

+ 165 - 0
blade-service/blade-user/src/main/java/org/springblade/system/user/store/goods/controller/AppVersionController.java

@@ -0,0 +1,165 @@
+/*
+ *      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.system.user.store.goods.controller;
+
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import org.springblade.system.user.store.goods.entity.App;
+import org.springblade.system.user.store.goods.entity.AppVersion;
+import org.springblade.system.user.store.goods.service.IAppService;
+import org.springblade.system.user.store.goods.service.IAppVersionService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import lombok.AllArgsConstructor;
+import org.springblade.core.boot.ctrl.BladeController;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * app版本表 控制器
+ *
+ * @author BladeX
+ * @since 2021-12-13
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("/appversion")
+@Api(value = "app版本表", tags = "app版本表接口")
+public class AppVersionController extends BladeController {
+
+	private final IAppVersionService appVersionService;
+
+	private final IAppService appService;
+
+
+	/**
+	 * 通过包名-获取应用最新版本
+	 */
+	@GetMapping("/getLatestVersion")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "通过包名-获取应用最新版本", notes = " ")
+	public R<App> getLatestVersion(@ApiParam(value = "当前app包名,必填", required = true) @RequestParam String packageName,
+								   @RequestParam(required = false, name = "type", defaultValue = "0") Integer type) {
+		List<Integer> list = new ArrayList<>();
+		list.add(1);
+		App app = appService.getLatestVersion(packageName, list, type);
+		if (app == null) {
+			return R.fail("该应用还未上传");
+		}
+		return R.data(app);
+	}
+
+	/**
+	 * 发布应用/取消版本
+	 *
+	 * @param
+	 * @return
+	 */
+	@PutMapping("/versionRelease")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "发布/取消app应用版本", notes = "传入AppVersion")
+	public R release(@RequestBody AppVersion appVersion) {
+		Long appVersionId = appVersion.getId();
+		AppVersion version = appVersionService.getById(appVersionId);
+		version.setIsRelease(version.getIsRelease() == 0 ? 1 : 0);
+		appVersionService.updateById(version);
+		return R.success("操作成功");
+	}
+
+
+	/**
+	 * 详情
+	 *//*
+	@GetMapping("/detail")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "详情", notes = "传入appVersion")
+	public R<AppVersion> detail(AppVersion appVersion) {
+		AppVersion detail = appVersionService.getOne(Condition.getQueryWrapper(appVersion));
+		return R.data(detail);
+	}
+
+	*//**
+	 * 分页 app版本表
+	 *//*
+	@GetMapping("/list")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页", notes = "传入appVersion")
+	public R<IPage<AppVersion>> list(AppVersion appVersion, Query query) {
+		IPage<AppVersion> pages = appVersionService.page(Condition.getPage(query), Condition.getQueryWrapper(appVersion));
+		return R.data(pages);
+	}
+
+	*//**
+	 * 自定义分页 app版本表
+	 *//*
+	@GetMapping("/page")
+	@ApiOperationSupport(order = 3)
+	@ApiOperation(value = "分页", notes = "传入appVersion")
+	public R<IPage<AppVersionVO>> page(AppVersionVO appVersion, Query query) {
+		IPage<AppVersionVO> pages = appVersionService.selectAppVersionPage(Condition.getPage(query), appVersion);
+		return R.data(pages);
+	}
+
+	*//**
+	 * 新增 app版本表
+	 *//*
+	@PostMapping("/save")
+	@ApiOperationSupport(order = 4)
+	@ApiOperation(value = "新增", notes = "传入appVersion")
+	public R save(@Valid @RequestBody AppVersion appVersion) {
+		return R.status(appVersionService.save(appVersion));
+	}
+
+	*//**
+	 * 修改 app版本表
+	 *//*
+	@PostMapping("/update")
+	@ApiOperationSupport(order = 5)
+	@ApiOperation(value = "修改", notes = "传入appVersion")
+	public R update(@Valid @RequestBody AppVersion appVersion) {
+		return R.status(appVersionService.updateById(appVersion));
+	}
+
+	*/
+
+	/**
+	 * 新增或修改 app版本表
+	 *//*
+	@PostMapping("/submit")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "新增或修改", notes = "传入appVersion")
+	public R submit(@Valid @RequestBody AppVersion appVersion) {
+		return R.status(appVersionService.saveOrUpdate(appVersion));
+	}
+
+
+	/**
+	 * 删除 app版本表
+	 */
+	@PostMapping("/remove")
+	@ApiOperationSupport(order = 8)
+	@ApiOperation(value = "删除", notes = "传入ids")
+	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+		return R.status(appVersionService.removeByIds(Func.toLongList(ids)));
+	}
+
+
+}

+ 43 - 0
blade-service/blade-user/src/main/java/org/springblade/system/user/store/goods/mapper/AppMapper.java

@@ -0,0 +1,43 @@
+/*
+ *      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.system.user.store.goods.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.system.user.store.goods.entity.App;
+import org.springblade.system.user.store.goods.vo.AppVO;
+
+import java.util.List;
+
+/**
+ * app应用表 Mapper 接口
+ *
+ * @author BladeX
+ * @since 2021-12-13
+ */
+public interface AppMapper extends BaseMapper<App> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param app
+	 * @return
+	 */
+	List<AppVO> selectAppPage(IPage page, AppVO app);
+
+}

+ 24 - 0
blade-service/blade-user/src/main/java/org/springblade/system/user/store/goods/mapper/AppMapper.xml

@@ -0,0 +1,24 @@
+<?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.system.user.store.goods.mapper.AppMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="appResultMap" type="org.springblade.system.user.store.goods.entity.App">
+        <id column="id" property="id"/>
+        <result column="app_name" property="appName"/>
+        <result column="logo" property="logo"/>
+        <result column="mini_logo" property="miniLogo"/>
+        <result column="type" property="type"/>
+        <result column="package_name" property="packageName"/>
+        <result column="url_schema" property="urlSchema"/>
+        <result column="app_store_id" property="appStoreId"/>
+        <result column="bundle_id" property="bundleId"/>
+        <result column="app_desc" property="appDesc"/>
+    </resultMap>
+
+
+    <select id="selectAppPage" resultMap="appResultMap">
+        select * from blade_app where is_deleted = 0
+    </select>
+
+</mapper>

+ 43 - 0
blade-service/blade-user/src/main/java/org/springblade/system/user/store/goods/mapper/AppVersionMapper.java

@@ -0,0 +1,43 @@
+/*
+ *      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.system.user.store.goods.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.system.user.store.goods.entity.AppVersion;
+import org.springblade.system.user.store.goods.vo.AppVersionVO;
+
+import java.util.List;
+
+/**
+ * app版本表 Mapper 接口
+ *
+ * @author BladeX
+ * @since 2021-12-13
+ */
+public interface AppVersionMapper extends BaseMapper<AppVersion> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param appVersion
+	 * @return
+	 */
+	List<AppVersionVO> selectAppVersionPage(IPage page, AppVersionVO appVersion);
+
+}

+ 21 - 0
blade-service/blade-user/src/main/java/org/springblade/system/user/store/goods/mapper/AppVersionMapper.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.system.user.store.goods.mapper.AppVersionMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="appVersionResultMap" type="org.springblade.system.user.store.goods.entity.AppVersion">
+        <id column="id" property="id"/>
+        <result column="appId" property="appid"/>
+        <result column="version_name" property="versionName"/>
+        <result column="version_code" property="versionCode"/>
+        <result column="version_desc" property="versionDesc"/>
+        <result column="download_url" property="downloadUrl"/>
+        <result column="is_release" property="isRelease"/>
+    </resultMap>
+
+
+    <select id="selectAppVersionPage" resultMap="appVersionResultMap">
+        select * from blade_app_version where is_deleted = 0
+    </select>
+
+</mapper>

+ 64 - 0
blade-service/blade-user/src/main/java/org/springblade/system/user/store/goods/service/IAppService.java

@@ -0,0 +1,64 @@
+/*
+ *      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.system.user.store.goods.service;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.service.IService;
+import org.springblade.system.user.store.goods.entity.App;
+import org.springblade.system.user.store.goods.entity.AppVersion;
+import org.springblade.system.user.store.goods.vo.AppVO;
+
+import java.util.List;
+
+/**
+ * app应用表 服务类
+ *
+ * @author BladeX
+ * @since 2021-12-13
+ */
+public interface IAppService extends IService<App> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param app
+	 * @return
+	 */
+	IPage<AppVO> selectAppPage(IPage<AppVO> page, AppVO app);
+
+	/**
+	 * 获取最新app版本信息
+	 */
+	AppVersion getLatestVersionById(Long id, List<Integer> release);
+
+	/**
+	 * 通过包名获取最新版本信息
+	 */
+	App getLatestVersion(String packageName, List<Integer> isRelease, Integer type);
+
+	/**
+	 * 保存、保存明细
+	 */
+	App saveApp(App app);
+
+	/**
+	 * 删除、删除明细
+	 */
+	boolean removeByAppIds(List<Long> idList);
+
+}

+ 41 - 0
blade-service/blade-user/src/main/java/org/springblade/system/user/store/goods/service/IAppVersionService.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.system.user.store.goods.service;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.service.IService;
+import org.springblade.system.user.store.goods.entity.AppVersion;
+import org.springblade.system.user.store.goods.vo.AppVersionVO;
+
+/**
+ * app版本表 服务类
+ *
+ * @author BladeX
+ * @since 2021-12-13
+ */
+public interface IAppVersionService extends IService<AppVersion> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param appVersion
+	 * @return
+	 */
+	IPage<AppVersionVO> selectAppVersionPage(IPage<AppVersionVO> page, AppVersionVO appVersion);
+
+}

+ 131 - 0
blade-service/blade-user/src/main/java/org/springblade/system/user/store/goods/service/impl/AppServiceImpl.java

@@ -0,0 +1,131 @@
+/*
+ *      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.system.user.store.goods.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springblade.system.user.store.goods.entity.App;
+import org.springblade.system.user.store.goods.entity.AppVersion;
+import org.springblade.system.user.store.goods.mapper.AppMapper;
+import org.springblade.system.user.store.goods.mapper.AppVersionMapper;
+import org.springblade.system.user.store.goods.service.IAppService;
+import org.springblade.system.user.store.goods.vo.AppVO;
+import org.springblade.core.secure.utils.AuthUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * app应用表 服务实现类
+ *
+ * @author BladeX
+ * @since 2021-12-13
+ */
+@Service
+public class AppServiceImpl extends ServiceImpl<AppMapper, App> implements IAppService {
+	@Autowired
+	private AppVersionMapper appVersionMapper;
+
+	@Override
+	public IPage<AppVO> selectAppPage(IPage<AppVO> page, AppVO app) {
+		return page.setRecords(baseMapper.selectAppPage(page, app));
+	}
+
+	@Override
+	public AppVersion getLatestVersionById(Long id, List<Integer> release) {
+		//查询此app应用下最新的版本信息
+		try {
+			LambdaQueryWrapper<AppVersion> wrapper = new LambdaQueryWrapper<AppVersion>()
+				.eq(AppVersion::getAppid, id)
+				.in(release != null, AppVersion::getIsRelease, release)
+				.orderByDesc(AppVersion::getVersionCode).last("limit 1");
+			return appVersionMapper.selectOne(wrapper);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw new SecurityException("应用不存在");
+		}
+	}
+
+	@Override
+	public App getLatestVersion(String packageName, List<Integer> isRelease, Integer type) {
+		App app = baseMapper.selectOne(new LambdaQueryWrapper<App>().eq(type != null, App::getType, type).eq(App::getAppName, packageName));
+		try {
+			AppVersion appVersion = getLatestVersionById(app.getId(), isRelease);
+			app.setAppVersion(appVersion);
+			return app;
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw new SecurityException("应用不存在");
+		}
+	}
+
+	@Override
+	@Transactional(rollbackFor = Exception.class)
+	public App saveApp(App app) {
+		if (app.getId() != null) {
+			app.setUpdateTime(new Date());
+			app.setUpdateUser(AuthUtil.getUserId());
+			baseMapper.updateById(app);
+		} else {
+			app.setCreateTime(new Date());
+			app.setCreateUser(AuthUtil.getUserId());
+			app.setTenantId(AuthUtil.getTenantId());
+			baseMapper.insert(app);
+		}
+
+		app.getAppVersionList().forEach(appVersion -> {
+			if (appVersion.getIsRelease() == 0) {
+				int count = appVersionMapper.selectCount(new LambdaQueryWrapper<AppVersion>()
+					.eq(AppVersion::getAppid, app.getId())
+					.ne(appVersion.getId() != null, AppVersion::getId, appVersion.getId()));
+				if (count > 0) {
+					throw new SecurityException("存在已发布的版本");
+				}
+			}
+
+			if (appVersion.getId() != null) {
+				appVersion.setUpdateTime(new Date());
+				appVersion.setUpdateUser(AuthUtil.getUserId());
+				appVersionMapper.updateById(appVersion);
+			} else {
+				appVersion.setAppid(app.getId());
+				appVersion.setCreateTime(new Date());
+				appVersion.setCreateUser(AuthUtil.getUserId());
+				appVersion.setTenantId(AuthUtil.getTenantId());
+				appVersionMapper.insert(appVersion);
+			}
+		});
+
+		App temp = baseMapper.selectById(app.getId());
+		temp.setAppVersionList(appVersionMapper.selectList(new LambdaQueryWrapper<AppVersion>().eq(AppVersion::getAppid, app.getId()).orderByDesc(AppVersion::getVersionCode)));
+		return temp;
+	}
+
+	@Override
+	@Transactional(rollbackFor = Exception.class)
+	public boolean removeByAppIds(List<Long> idList) {
+		idList.forEach(id -> {
+			appVersionMapper.delete(new LambdaQueryWrapper<AppVersion>().eq(AppVersion::getAppid, id));
+		});
+		return baseMapper.deleteBatchIds(idList) >= 1;
+	}
+
+}

+ 41 - 0
blade-service/blade-user/src/main/java/org/springblade/system/user/store/goods/service/impl/AppVersionServiceImpl.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.system.user.store.goods.service.impl;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springblade.system.user.store.goods.entity.AppVersion;
+import org.springblade.system.user.store.goods.mapper.AppVersionMapper;
+import org.springblade.system.user.store.goods.service.IAppVersionService;
+import org.springblade.system.user.store.goods.vo.AppVersionVO;
+import org.springframework.stereotype.Service;
+
+/**
+ * app版本表 服务实现类
+ *
+ * @author BladeX
+ * @since 2021-12-13
+ */
+@Service
+public class AppVersionServiceImpl extends ServiceImpl<AppVersionMapper, AppVersion> implements IAppVersionService {
+
+	@Override
+	public IPage<AppVersionVO> selectAppVersionPage(IPage<AppVersionVO> page, AppVersionVO appVersion) {
+		return page.setRecords(baseMapper.selectAppVersionPage(page, appVersion));
+	}
+
+}