Parcourir la source

1.门店app,经销商app接口修改

纪新园 il y a 2 mois
Parent
commit
740b096004
26 fichiers modifiés avec 513 ajouts et 61 suppressions
  1. 2 1
      blade-auth/src/main/java/org/springblade/auth/verification/verificationController.java
  2. 9 0
      blade-service-api/gubersail-dealer-admin-api/src/main/java/com/gubersail/dealer/admin/api/claim/vo/BladeClaimAttachmentVO.java
  3. 9 0
      blade-service-api/gubersail-dealer-admin-api/src/main/java/com/gubersail/dealer/admin/api/claim/vo/BladeClaimAuditVO.java
  4. 2 2
      blade-service-api/gubersail-dealer-admin-api/src/main/java/com/gubersail/dealer/admin/api/claim/vo/BladeClaimVO.java
  5. 9 0
      blade-service-api/gubersail-dealer-admin-api/src/main/java/com/gubersail/dealer/admin/api/complaint/vo/BladeComplaintAttachmentVO.java
  6. 9 0
      blade-service-api/gubersail-dealer-admin-api/src/main/java/com/gubersail/dealer/admin/api/complaint/vo/BladeComplaintReplyVO.java
  7. 2 2
      blade-service-api/gubersail-dealer-admin-api/src/main/java/com/gubersail/dealer/admin/api/complaint/vo/BladeComplaintVO.java
  8. 9 0
      blade-service-api/gubersail-dealer-admin-api/src/main/java/com/gubersail/dealer/admin/api/lead/vo/BladeSalesLeadDetailVO.java
  9. 1 1
      blade-service-api/gubersail-dealer-admin-api/src/main/java/com/gubersail/dealer/admin/api/lead/vo/BladeSalesLeadVO.java
  10. 22 0
      blade-service-api/gubersail-shop-app-api/src/main/java/com/gubersail/shop/app/api/insurance/entity/ShopAppTireInsuranceRegister.java
  11. 23 0
      blade-service/gubersail-dealer-admin/src/main/java/com/gubersail/admin/annotation/VersionControl.java
  12. 70 0
      blade-service/gubersail-dealer-admin/src/main/java/com/gubersail/admin/aspectj/VersionControlAspectj.java
  13. 2 0
      blade-service/gubersail-dealer-admin/src/main/java/com/gubersail/admin/claim/controller/BladeClaimController.java
  14. 57 22
      blade-service/gubersail-dealer-admin/src/main/java/com/gubersail/admin/claim/service/impl/BladeClaimServiceImpl.java
  15. 54 6
      blade-service/gubersail-dealer-admin/src/main/java/com/gubersail/admin/complaint/service/impl/BladeComplaintServiceImpl.java
  16. 35 0
      blade-service/gubersail-dealer-admin/src/main/java/com/gubersail/admin/enums/FinalMap.java
  17. 2 0
      blade-service/gubersail-dealer-admin/src/main/java/com/gubersail/admin/lead/controller/BladeSalesLeadController.java
  18. 35 17
      blade-service/gubersail-dealer-admin/src/main/java/com/gubersail/admin/lead/service/impl/BladeSalesLeadServiceImpl.java
  19. 23 0
      blade-service/gubersail-dealer-app/src/main/java/com/gubersail/app/annotation/VersionControl.java
  20. 70 0
      blade-service/gubersail-dealer-app/src/main/java/com/gubersail/app/aspectj/VersionControlAspectj.java
  21. 2 0
      blade-service/gubersail-dealer-app/src/main/java/com/gubersail/app/claim/controller/AppClaimController.java
  22. 3 6
      blade-service/gubersail-dealer-app/src/main/java/com/gubersail/app/claim/service/impl/AppClaimServiceImpl.java
  23. 14 1
      blade-service/gubersail-dealer-app/src/main/java/com/gubersail/app/corp/controller/AppCorpsDescController.java
  24. 35 0
      blade-service/gubersail-dealer-app/src/main/java/com/gubersail/app/enums/FinalMap.java
  25. 11 1
      blade-service/gubersail-shop-app/src/main/java/com/gubersail/shop/app/corp/controller/ShopAppCorpsDescController.java
  26. 3 2
      blade-service/gubersail-shop-app/src/main/java/com/gubersail/shop/app/insurance/service/impl/ShopAppTireInsuranceRegisterServiceImpl.java

+ 2 - 1
blade-auth/src/main/java/org/springblade/auth/verification/verificationController.java

@@ -69,7 +69,8 @@ public class verificationController {
 		if (Objects.nonNull(redisCode)) {
 			return R.fail("验证码已发送,请勿重复发送");
 		}
-		String code = VerificationCodeUtil.getVerificationCode(NumberEnum.SIX.number);
+//		String code = VerificationCodeUtil.getVerificationCode(NumberEnum.SIX.number);
+		String code = "123456";
 		System.out.println("验证码:" + code);
 		// TODO: 需要短信发送
 		String params = "TemplateParamSet:[\"" + code + "\"]";

+ 9 - 0
blade-service-api/gubersail-dealer-admin-api/src/main/java/com/gubersail/dealer/admin/api/claim/vo/BladeClaimAttachmentVO.java

@@ -33,4 +33,13 @@ import io.swagger.annotations.ApiModel;
 public class BladeClaimAttachmentVO extends BladeClaimAttachment {
 	private static final long serialVersionUID = 1L;
 
+	/**
+	 * 创建人名称
+	 */
+	private String createUserName;
+	/**
+	 * 更新人名称
+	 */
+	private String updateUserName;
+
 }

+ 9 - 0
blade-service-api/gubersail-dealer-admin-api/src/main/java/com/gubersail/dealer/admin/api/claim/vo/BladeClaimAuditVO.java

@@ -33,4 +33,13 @@ import io.swagger.annotations.ApiModel;
 public class BladeClaimAuditVO extends BladeClaimAudit {
 	private static final long serialVersionUID = 1L;
 
+	/**
+	 * 创建人名称
+	 */
+	private String createUserName;
+	/**
+	 * 更新人名称
+	 */
+	private String updateUserName;
+
 }

+ 2 - 2
blade-service-api/gubersail-dealer-admin-api/src/main/java/com/gubersail/dealer/admin/api/claim/vo/BladeClaimVO.java

@@ -52,11 +52,11 @@ public class BladeClaimVO extends BladeClaim {
 	/**
 	 * 理赔审核结果及客户反馈
 	 */
-	private List<BladeClaimAudit> bladeClaimAuditList;
+	private List<BladeClaimAuditVO> bladeClaimAuditList;
 
 	/**
 	 * 理赔附件表
 	 */
-	private List<BladeClaimAttachment> claimAttachmentList;
+	private List<BladeClaimAttachmentVO> claimAttachmentList;
 
 }

+ 9 - 0
blade-service-api/gubersail-dealer-admin-api/src/main/java/com/gubersail/dealer/admin/api/complaint/vo/BladeComplaintAttachmentVO.java

@@ -33,4 +33,13 @@ import io.swagger.annotations.ApiModel;
 public class BladeComplaintAttachmentVO extends BladeComplaintAttachment {
 	private static final long serialVersionUID = 1L;
 
+	/**
+	 * 创建人名称
+	 */
+	private String createUserName;
+	/**
+	 * 更新人名称
+	 */
+	private String updateUserName;
+
 }

+ 9 - 0
blade-service-api/gubersail-dealer-admin-api/src/main/java/com/gubersail/dealer/admin/api/complaint/vo/BladeComplaintReplyVO.java

@@ -33,4 +33,13 @@ import io.swagger.annotations.ApiModel;
 public class BladeComplaintReplyVO extends BladeComplaintReply {
 	private static final long serialVersionUID = 1L;
 
+	/**
+	 * 创建人名称
+	 */
+	private String createUserName;
+	/**
+	 * 更新人名称
+	 */
+	private String updateUserName;
+
 }

+ 2 - 2
blade-service-api/gubersail-dealer-admin-api/src/main/java/com/gubersail/dealer/admin/api/complaint/vo/BladeComplaintVO.java

@@ -40,12 +40,12 @@ public class BladeComplaintVO extends BladeComplaint {
 	/**
 	 * 投诉附件明细
 	 */
-	private List<BladeComplaintAttachment> complaintAttachmentList;
+	private List<BladeComplaintAttachmentVO> complaintAttachmentList;
 
 	/**
 	 * 投诉回复记录
 	 */
-	private List<BladeComplaintReply> complaintReplyList;
+	private List<BladeComplaintReplyVO> complaintReplyList;
 
 	/**
 	 * 创建人名称

+ 9 - 0
blade-service-api/gubersail-dealer-admin-api/src/main/java/com/gubersail/dealer/admin/api/lead/vo/BladeSalesLeadDetailVO.java

@@ -33,4 +33,13 @@ import io.swagger.annotations.ApiModel;
 public class BladeSalesLeadDetailVO extends BladeSalesLeadDetail {
 	private static final long serialVersionUID = 1L;
 
+	/**
+	 * 创建人名称
+	 */
+	private String createUserName;
+	/**
+	 * 更新人名称
+	 */
+	private String updateUserName;
+
 }

+ 1 - 1
blade-service-api/gubersail-dealer-admin-api/src/main/java/com/gubersail/dealer/admin/api/lead/vo/BladeSalesLeadVO.java

@@ -39,7 +39,7 @@ public class BladeSalesLeadVO extends BladeSalesLead {
 	/**
 	 * 销售线索详细
 	 */
-	private List<BladeSalesLeadDetail> salesLeadDetailList;
+	private List<BladeSalesLeadDetailVO> salesLeadDetailList;
 
 	/**
 	 * 创建人名称

+ 22 - 0
blade-service-api/gubersail-shop-app-api/src/main/java/com/gubersail/shop/app/api/insurance/entity/ShopAppTireInsuranceRegister.java

@@ -141,5 +141,27 @@ public class ShopAppTireInsuranceRegister implements Serializable {
 	@ApiModelProperty(value = "轮胎花纹照片地址")
 	private String tirePatternUrl;
 
+	/**
+	 * 行驶证照片JSON
+	 */
+	@ApiModelProperty(value = "行驶证照片JSON")
+	private String vehicleLicense;
+	/**
+	 * 车辆整体照片JSON
+	 */
+	@ApiModelProperty(value = "车辆整体照片JSON")
+	private String overallVehicle;
+	/**
+	 * 轮胎DOT照片JSON
+	 */
+	@ApiModelProperty(value = "轮胎DOT照片JSON")
+	private String tireDot;
+	/**
+	 * 轮胎花纹照片JSON
+	 */
+	@ApiModelProperty(value = "轮胎花纹照片JSON")
+	private String tirePattern;
+
+
 
 }

+ 23 - 0
blade-service/gubersail-dealer-admin/src/main/java/com/gubersail/admin/annotation/VersionControl.java

@@ -0,0 +1,23 @@
+package com.gubersail.admin.annotation;
+
+
+import java.lang.annotation.*;
+
+/**
+ * 版本控制
+ * 返回值必须是 R
+ * @author Rain
+ */
+@Target(ElementType.METHOD)
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+public @interface VersionControl {
+
+
+	/**
+	 * service 地址
+	 * @return 无
+	 */
+	String value() default "";
+
+}

+ 70 - 0
blade-service/gubersail-dealer-admin/src/main/java/com/gubersail/admin/aspectj/VersionControlAspectj.java

@@ -0,0 +1,70 @@
+package com.gubersail.admin.aspectj;
+
+import com.alibaba.fastjson.JSONObject;
+import com.gubersail.admin.annotation.VersionControl;
+import com.gubersail.admin.enums.FinalMap;
+import org.aspectj.lang.ProceedingJoinPoint;
+import org.aspectj.lang.annotation.Around;
+import org.aspectj.lang.annotation.Aspect;
+import org.aspectj.lang.annotation.Pointcut;
+import org.aspectj.lang.reflect.MethodSignature;
+import org.springblade.common.enums.CommonEnum;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.SpringUtil;
+import org.springframework.stereotype.Component;
+import org.springframework.util.ObjectUtils;
+import org.springframework.util.StringUtils;
+
+import java.io.Serializable;
+import java.lang.reflect.Method;
+
+/**
+ * @author Rain
+ */
+@Aspect
+@Component
+public class VersionControlAspectj {
+
+
+	@Pointcut("@annotation(com.gubersail.admin.annotation.VersionControl)")
+	public void versionControlCut() {
+	}
+
+
+	@Around("versionControlCut()")
+	public R doAround(ProceedingJoinPoint joinPoint) throws Throwable {
+		try {
+			MethodSignature signature = (MethodSignature) joinPoint.getSignature();
+			VersionControl customAnnotation = signature.getMethod().getAnnotation(VersionControl.class);
+			Object obj = joinPoint.getArgs()[0];
+			JSONObject jsonObject = JSONObject.parseObject(JSONObject.toJSONString(obj));
+			String id = jsonObject.getString(FinalMap.ID);
+			String sourceVersion = jsonObject.getString(FinalMap.VERSION);
+			has: if (StringUtils.hasText(id) && StringUtils.hasText(sourceVersion)) {
+				Object objBean = SpringUtil.getBean(customAnnotation.value());
+				Method method = objBean.getClass().getDeclaredMethod(FinalMap.GET_BY_ID, Serializable.class);
+				method.setAccessible(true);
+				Object result = method.invoke(objBean, Long.valueOf(id));
+				if (ObjectUtils.isEmpty(result)) {
+					break has;
+				}
+				JSONObject entityData = JSONObject.parseObject(JSONObject.toJSONString(result));
+				if (entityData.containsKey(FinalMap.IS_DELETE)) {
+					if (CommonEnum.ONE.info.equals(entityData.getString(FinalMap.IS_DELETE))) {
+						return R.fail("该单据已被删除,请返回列表页刷新后重试");
+					}
+				}
+				if (!entityData.containsKey(FinalMap.VERSION)) {
+					break has;
+				}
+				if (!sourceVersion.equals(entityData.getString(FinalMap.VERSION))) {
+					return R.fail(601, "数据已被其他用户更新,请等待刷新后重试");
+				}
+			}
+		} catch (Exception e) {
+			throw new RuntimeException(e);
+		}
+		return (R) joinPoint.proceed();
+	}
+
+}

+ 2 - 0
blade-service/gubersail-dealer-admin/src/main/java/com/gubersail/admin/claim/controller/BladeClaimController.java

@@ -21,6 +21,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import com.gubersail.admin.annotation.VersionControl;
 import com.gubersail.admin.claim.service.IBladeClaimService;
 import com.gubersail.admin.util.DeptUtils;
 import com.gubersail.admin.wrapper.ClaimWrapper;
@@ -174,6 +175,7 @@ public class BladeClaimController extends BladeController {
 	@PostMapping("/submit")
 	@ApiOperationSupport(order = 6)
 	@ApiOperation(value = "新增或修改", notes = "传入bladeClaim")
+	@VersionControl("bladeClaimServiceImpl")
 	public R submit(@Valid @RequestBody BladeClaimVO bladeClaim) {
 		return bladeClaimService.submit(bladeClaim);
 	}

+ 57 - 22
blade-service/gubersail-dealer-admin/src/main/java/com/gubersail/admin/claim/service/impl/BladeClaimServiceImpl.java

@@ -30,6 +30,8 @@ import com.gubersail.admin.zcrm.customer.service.IViewCustomerSelService;
 import com.gubersail.dealer.admin.api.claim.entity.BladeClaim;
 import com.gubersail.dealer.admin.api.claim.entity.BladeClaimAttachment;
 import com.gubersail.dealer.admin.api.claim.entity.BladeClaimAudit;
+import com.gubersail.dealer.admin.api.claim.vo.BladeClaimAttachmentVO;
+import com.gubersail.dealer.admin.api.claim.vo.BladeClaimAuditVO;
 import com.gubersail.dealer.admin.api.claim.vo.BladeClaimVO;
 import com.gubersail.dealer.admin.api.zcrm.customer.entity.ViewCustomerSel;
 import lombok.AllArgsConstructor;
@@ -69,7 +71,7 @@ public class BladeClaimServiceImpl extends ServiceImpl<BladeClaimMapper, BladeCl
 
 	private final IViewCustomerSelService viewCustomerSelService;
 
-    @Override
+	@Override
 	public IPage<BladeClaimVO> selectBladeClaimPage(IPage<BladeClaimVO> page, BladeClaimVO bladeClaim) {
 		return page.setRecords(baseMapper.selectBladeClaimPage(page, bladeClaim));
 	}
@@ -114,15 +116,7 @@ public class BladeClaimServiceImpl extends ServiceImpl<BladeClaimMapper, BladeCl
 				claim.setSourceName(customerSel.getCustomerName());
 			}
 		} else {
-			BladeClaim dataSourceClaim = baseMapper.selectOne(new LambdaQueryWrapper<BladeClaim>().select(BladeClaim::getId, BladeClaim::getVersion)
-				.eq(BladeClaim::getId, claim.getId()));
-			if (!Objects.equals(dataSourceClaim.getVersion(), claim.getVersion())) {
-				return R.fail(601, "数据已被其他用户更新,请等待刷新后重试");
-			}
-			// 每更新一次往上累加一次版本
-			// 旧数据处理
-			int version = dataSourceClaim.getVersion() == null ? 1 : dataSourceClaim.getVersion();
-			claim.setVersion(version + 1);
+			claim.setVersion(claim.getVersion() == null ? 1 : claim.getVersion() + 1);
 			claim.setUpdateUser(AuthUtil.getUserId());
 			claim.setUpdateTime(new Date());
 		}
@@ -130,7 +124,8 @@ public class BladeClaimServiceImpl extends ServiceImpl<BladeClaimMapper, BladeCl
 		this.saveOrUpdate(claim);
 		//判断是否存在理赔审核结果及客户反馈数据
 		if (ObjectUtils.isNotNull(bladeClaim.getBladeClaimAuditList()) && !bladeClaim.getBladeClaimAuditList().isEmpty()) {
-			for (BladeClaimAudit item : bladeClaim.getBladeClaimAuditList()) {
+			List<BladeClaimAudit> bladeClaimAuditList = BeanUtil.copy(bladeClaim.getBladeClaimAuditList(), BladeClaimAudit.class);
+			for (BladeClaimAudit item : bladeClaimAuditList) {
 				//添加理赔主表关联数据
 				item.setClaimId(claim.getId());
 				item.setClaimNo(claim.getClaimNo());
@@ -145,11 +140,12 @@ public class BladeClaimServiceImpl extends ServiceImpl<BladeClaimMapper, BladeCl
 				}
 			}
 			//批量保存理赔审核结果及客户反馈数据
-			bladeClaimAuditService.saveOrUpdateBatch(bladeClaim.getBladeClaimAuditList());
+			bladeClaimAuditService.saveOrUpdateBatch(bladeClaimAuditList);
 		}
 		//判断是否存在理赔附件数据
 		if (ObjectUtils.isNotNull(bladeClaim.getClaimAttachmentList()) && !bladeClaim.getClaimAttachmentList().isEmpty()) {
-			for (BladeClaimAttachment item : bladeClaim.getClaimAttachmentList()) {
+			List<BladeClaimAttachment> claimAttachmentList = BeanUtil.copy(bladeClaim.getClaimAttachmentList(), BladeClaimAttachment.class);
+			for (BladeClaimAttachment item : claimAttachmentList) {
 				//添加理赔主表关联数据
 				item.setClaimId(claim.getId());
 				//判断是否是第一次保存
@@ -163,7 +159,7 @@ public class BladeClaimServiceImpl extends ServiceImpl<BladeClaimMapper, BladeCl
 				}
 			}
 			//批量保存理赔附件数据数据
-			bladeClaimAttachmentService.saveOrUpdateBatch(bladeClaim.getClaimAttachmentList());
+			bladeClaimAttachmentService.saveOrUpdateBatch(claimAttachmentList);
 		}
 		return R.data(claim);
 	}
@@ -175,23 +171,64 @@ public class BladeClaimServiceImpl extends ServiceImpl<BladeClaimMapper, BladeCl
 		//数据实体类转换
 		BladeClaimVO bladeClaimVO = ClaimWrapper.build().entityVO(claim);
 		R<User> createUserR = userClient.userInfoById(claim.getCreateUser());
-		if (createUserR.isSuccess() && ObjectUtils.isNotNull(createUserR.getData())){
+		if (createUserR.isSuccess() && ObjectUtils.isNotNull(createUserR.getData())) {
 			bladeClaimVO.setCreateUserName(createUserR.getData().getRealName());
 		}
 		R<User> updateUserR = userClient.userInfoById(claim.getUpdateUser());
-		if (updateUserR.isSuccess() && ObjectUtils.isNotNull(updateUserR.getData())){
+		if (updateUserR.isSuccess() && ObjectUtils.isNotNull(updateUserR.getData())) {
 			bladeClaimVO.setUpdateUserName(updateUserR.getData().getRealName());
 		}
 		//查询理赔附件数据
 		List<BladeClaimAttachment> claimAttachmentList = bladeClaimAttachmentService.list(new LambdaQueryWrapper<BladeClaimAttachment>()
 			.eq(BladeClaimAttachment::getClaimId, claim.getId())
 			.eq(BladeClaimAttachment::getIsDeleted, 0));
-		bladeClaimVO.setClaimAttachmentList(claimAttachmentList.isEmpty() ? new ArrayList<>() : claimAttachmentList);
+		List<BladeClaimAttachmentVO> claimAttachmentListVO = BeanUtil.copy(claimAttachmentList, BladeClaimAttachmentVO.class);
+		List<Long> userList = new ArrayList<>();
+		if (!claimAttachmentListVO.isEmpty()) {
+			userList.addAll(claimAttachmentListVO.stream().map(BladeClaimAttachmentVO::getUpdateUser)
+				.filter(Objects::nonNull).distinct().collect(Collectors.toList()));
+			userList.addAll(claimAttachmentListVO.stream().map(BladeClaimAttachmentVO::getCreateUser)
+				.filter(Objects::nonNull).distinct().collect(Collectors.toList()));
+		}
 		//查询理赔审核结果及客户反馈数据
 		List<BladeClaimAudit> claimAuditList = bladeClaimAuditService.list(new LambdaQueryWrapper<BladeClaimAudit>()
 			.eq(BladeClaimAudit::getClaimId, claim.getId())
 			.eq(BladeClaimAudit::getIsDeleted, 0));
-		bladeClaimVO.setBladeClaimAuditList(claimAuditList.isEmpty() ? new ArrayList<>() : claimAuditList);
+		List<BladeClaimAuditVO> bladeClaimAuditListVO = BeanUtil.copy(claimAuditList, BladeClaimAuditVO.class);
+		if (!bladeClaimAuditListVO.isEmpty()) {
+			userList.addAll(bladeClaimAuditListVO.stream().map(BladeClaimAuditVO::getUpdateUser)
+				.filter(Objects::nonNull).distinct().collect(Collectors.toList()));
+			userList.addAll(bladeClaimAuditListVO.stream().map(BladeClaimAuditVO::getCreateUser)
+				.filter(Objects::nonNull).distinct().collect(Collectors.toList()));
+		}
+		List<User> users = new ArrayList<>();
+		if (!userList.isEmpty()) {
+			users = userClient.userListGetByIds(userList.stream().distinct().collect(Collectors.toList()));
+		}
+		if (!users.isEmpty()) {
+			for (BladeClaimAttachmentVO item : claimAttachmentListVO) {
+				//赋值创建人名称
+				if (ObjectUtils.isNotNull(item.getCreateUser())) {
+					users.stream().filter(e -> e.getId().equals(item.getCreateUser())).findFirst().ifPresent(user -> item.setCreateUserName(user.getRealName()));
+				}
+				//赋值修改人名称
+				if (ObjectUtils.isNotNull(item.getUpdateUser())) {
+					users.stream().filter(e -> e.getId().equals(item.getUpdateUser())).findFirst().ifPresent(user -> item.setUpdateUserName(user.getRealName()));
+				}
+			}
+			for (BladeClaimAuditVO item : bladeClaimAuditListVO) {
+				//赋值创建人名称
+				if (ObjectUtils.isNotNull(item.getCreateUser())) {
+					users.stream().filter(e -> e.getId().equals(item.getCreateUser())).findFirst().ifPresent(user -> item.setCreateUserName(user.getRealName()));
+				}
+				//赋值修改人名称
+				if (ObjectUtils.isNotNull(item.getUpdateUser())) {
+					users.stream().filter(e -> e.getId().equals(item.getUpdateUser())).findFirst().ifPresent(user -> item.setUpdateUserName(user.getRealName()));
+				}
+			}
+		}
+		bladeClaimVO.setClaimAttachmentList(claimAttachmentListVO.isEmpty() ? new ArrayList<>() : claimAttachmentListVO);
+		bladeClaimVO.setBladeClaimAuditList(bladeClaimAuditListVO.isEmpty() ? new ArrayList<>() : bladeClaimAuditListVO);
 		return bladeClaimVO;
 	}
 
@@ -207,8 +244,7 @@ public class BladeClaimServiceImpl extends ServiceImpl<BladeClaimMapper, BladeCl
 		claim.setAuditStatus(1);
 		claim.setUpdateTime(new Date());
 		claim.setUpdateUser(AuthUtil.getUserId());
-		int version = claim.getVersion() == null ? 1 : claim.getVersion();
-		claim.setVersion(version + 1);
+		claim.setVersion(claim.getVersion() == null ? 1 : claim.getVersion() + 1);
 		this.updateById(claim);
 		return R.success("操作成功");
 	}
@@ -225,8 +261,7 @@ public class BladeClaimServiceImpl extends ServiceImpl<BladeClaimMapper, BladeCl
 		claim.setAuditStatus(0);
 		claim.setUpdateTime(new Date());
 		claim.setUpdateUser(AuthUtil.getUserId());
-		int version = claim.getVersion() == null ? 1 : claim.getVersion();
-		claim.setVersion(version + 1);
+		claim.setVersion(claim.getVersion() == null ? 1 : claim.getVersion() + 1);
 		this.updateById(claim);
 		return R.success("操作成功");
 	}

+ 54 - 6
blade-service/gubersail-dealer-admin/src/main/java/com/gubersail/admin/complaint/service/impl/BladeComplaintServiceImpl.java

@@ -29,6 +29,8 @@ import com.gubersail.admin.wrapper.ComplaintWrapper;
 import com.gubersail.dealer.admin.api.complaint.entity.BladeComplaint;
 import com.gubersail.dealer.admin.api.complaint.entity.BladeComplaintAttachment;
 import com.gubersail.dealer.admin.api.complaint.entity.BladeComplaintReply;
+import com.gubersail.dealer.admin.api.complaint.vo.BladeComplaintAttachmentVO;
+import com.gubersail.dealer.admin.api.complaint.vo.BladeComplaintReplyVO;
 import com.gubersail.dealer.admin.api.complaint.vo.BladeComplaintVO;
 import lombok.AllArgsConstructor;
 import org.springblade.common.enums.NumberEnum;
@@ -46,6 +48,8 @@ import org.springframework.util.StringUtils;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
+import java.util.Objects;
+import java.util.stream.Collectors;
 
 /**
  * 投诉主表 服务实现类
@@ -92,7 +96,8 @@ public class BladeComplaintServiceImpl extends ServiceImpl<BladeComplaintMapper,
 		this.saveOrUpdate(complaint);
 		//判断是否存在投诉附件数据
 		if (ObjectUtils.isNotNull(bladeComplaint.getComplaintAttachmentList()) && !bladeComplaint.getComplaintAttachmentList().isEmpty()) {
-			for (BladeComplaintAttachment item : bladeComplaint.getComplaintAttachmentList()) {
+			List<BladeComplaintAttachment> complaintAttachmentList = BeanUtil.copy(bladeComplaint.getComplaintAttachmentList(), BladeComplaintAttachment.class);
+			for (BladeComplaintAttachment item : complaintAttachmentList) {
 				//添加投诉主表关联数据
 				item.setComplaintId(complaint.getId());
 				//判断是否是第一次保存
@@ -106,11 +111,12 @@ public class BladeComplaintServiceImpl extends ServiceImpl<BladeComplaintMapper,
 				}
 			}
 			//批量保存投诉附件数据
-			bladeComplaintAttachmentService.saveOrUpdateBatch(bladeComplaint.getComplaintAttachmentList());
+			bladeComplaintAttachmentService.saveOrUpdateBatch(complaintAttachmentList);
 		}
 		//判断是否存在投诉回复记录数据
 		if (ObjectUtils.isNotNull(bladeComplaint.getComplaintReplyList()) && !bladeComplaint.getComplaintReplyList().isEmpty()) {
-			for (BladeComplaintReply item : bladeComplaint.getComplaintReplyList()) {
+			List<BladeComplaintReply> complaintReplyList = BeanUtil.copy(bladeComplaint.getComplaintReplyList(), BladeComplaintReply.class);
+			for (BladeComplaintReply item : complaintReplyList) {
 				//添加投诉主表关联数据
 				item.setComplaintId(complaint.getId());
 				item.setComplaintNo(complaint.getComplaintNo());
@@ -125,7 +131,7 @@ public class BladeComplaintServiceImpl extends ServiceImpl<BladeComplaintMapper,
 				}
 			}
 			//批量保存投诉回复记录数据
-			bladeComplaintReplyService.saveOrUpdateBatch(bladeComplaint.getComplaintReplyList());
+			bladeComplaintReplyService.saveOrUpdateBatch(complaintReplyList);
 		}
 		return R.data(complaint);
 	}
@@ -148,13 +154,55 @@ public class BladeComplaintServiceImpl extends ServiceImpl<BladeComplaintMapper,
 		List<BladeComplaintAttachment> complaintAttachmentList = bladeComplaintAttachmentService.list(new LambdaQueryWrapper<BladeComplaintAttachment>()
 			.eq(BladeComplaintAttachment::getComplaintId, bladeComplaint.getId())
 			.eq(BladeComplaintAttachment::getIsDeleted, 0));
-		bladeComplaintVO.setComplaintAttachmentList(complaintAttachmentList.isEmpty() ? new ArrayList<>() : complaintAttachmentList);
+		List<BladeComplaintAttachmentVO> complaintAttachmentVOList = BeanUtil.copy(complaintAttachmentList, BladeComplaintAttachmentVO.class);
+		List<Long> userList = new ArrayList<>();
+		if (!complaintAttachmentVOList.isEmpty()) {
+			userList.addAll(complaintAttachmentVOList.stream().map(BladeComplaintAttachmentVO::getUpdateUser)
+				.filter(Objects::nonNull).distinct().collect(Collectors.toList()));
+			userList.addAll(complaintAttachmentVOList.stream().map(BladeComplaintAttachmentVO::getCreateUser)
+				.filter(Objects::nonNull).distinct().collect(Collectors.toList()));
+		}
 		//查询投诉回复记录数据
 		List<BladeComplaintReply> complaintReplyList = bladeComplaintReplyService.list(new LambdaQueryWrapper<BladeComplaintReply>()
 			.eq(BladeComplaintReply::getComplaintId, bladeComplaint.getId())
 			.eq(BladeComplaintReply::getIsDeleted, 0)
 			.orderByDesc(BladeComplaintReply::getCreateTime));
-		bladeComplaintVO.setComplaintReplyList(complaintReplyList.isEmpty() ? new ArrayList<>() : complaintReplyList);
+		List<BladeComplaintReplyVO> complaintReplyVOList = BeanUtil.copy(complaintReplyList, BladeComplaintReplyVO.class);
+		if (!complaintReplyVOList.isEmpty()) {
+			userList.addAll(complaintReplyVOList.stream().map(BladeComplaintReplyVO::getUpdateUser)
+				.filter(Objects::nonNull).distinct().collect(Collectors.toList()));
+			userList.addAll(complaintReplyVOList.stream().map(BladeComplaintReplyVO::getCreateUser)
+				.filter(Objects::nonNull).distinct().collect(Collectors.toList()));
+		}
+		List<User> users = new ArrayList<>();
+		if (!userList.isEmpty()) {
+			users = userClient.userListGetByIds(userList.stream().distinct().collect(Collectors.toList()));
+		}
+		if (!users.isEmpty()) {
+			for (BladeComplaintAttachmentVO item : complaintAttachmentVOList) {
+				//赋值创建人名称
+				if (ObjectUtils.isNotNull(item.getCreateUser())) {
+					users.stream().filter(e -> e.getId().equals(item.getCreateUser())).findFirst().ifPresent(user -> item.setCreateUserName(user.getRealName()));
+				}
+				//赋值修改人名称
+				if (ObjectUtils.isNotNull(item.getUpdateUser())) {
+					users.stream().filter(e -> e.getId().equals(item.getUpdateUser())).findFirst().ifPresent(user -> item.setUpdateUserName(user.getRealName()));
+				}
+			}
+			for (BladeComplaintReplyVO item : complaintReplyVOList) {
+				//赋值创建人名称
+				if (ObjectUtils.isNotNull(item.getCreateUser())) {
+					users.stream().filter(e -> e.getId().equals(item.getCreateUser())).findFirst().ifPresent(user -> item.setCreateUserName(user.getRealName()));
+				}
+				//赋值修改人名称
+				if (ObjectUtils.isNotNull(item.getUpdateUser())) {
+					users.stream().filter(e -> e.getId().equals(item.getUpdateUser())).findFirst().ifPresent(user -> item.setUpdateUserName(user.getRealName()));
+				}
+			}
+		}
+		bladeComplaintVO.setComplaintReplyList(complaintReplyVOList.isEmpty() ? new ArrayList<>() : complaintReplyVOList);
+		bladeComplaintVO.setComplaintAttachmentList(complaintAttachmentVOList.isEmpty() ? new ArrayList<>() : complaintAttachmentVOList);
+
 		return bladeComplaintVO;
 	}
 

+ 35 - 0
blade-service/gubersail-dealer-admin/src/main/java/com/gubersail/admin/enums/FinalMap.java

@@ -0,0 +1,35 @@
+package com.gubersail.admin.enums;
+
+import java.math.BigDecimal;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * @author Rain
+ */
+public class FinalMap {
+
+
+	public static final List<String> PAY_TYPE_LIST = Arrays.asList("W01", "A01", "U01", "S01");
+
+	public static final BigDecimal ZERO_POINT_ZERO = new BigDecimal("0.00");
+
+	/**
+	 * equals 使用,其余情况与 BigDecimal.ONE 相同
+	 */
+	public static final BigDecimal ONE = new BigDecimal(1);
+
+	public static final BigDecimal TWO = new BigDecimal(2);
+
+	public static final Integer FIFTEEN = 15;
+
+
+	public static final String VERSION = "version";
+
+	public static final String IS_DELETE = "isDeleted";
+
+	public static final String ID = "id";
+
+	public static final String GET_BY_ID = "getById";
+
+}

+ 2 - 0
blade-service/gubersail-dealer-admin/src/main/java/com/gubersail/admin/lead/controller/BladeSalesLeadController.java

@@ -21,6 +21,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import com.gubersail.admin.annotation.VersionControl;
 import com.gubersail.admin.lead.service.IBladeSalesLeadService;
 import com.gubersail.admin.util.DeptUtils;
 import com.gubersail.admin.wrapper.SalesLeadWrapper;
@@ -176,6 +177,7 @@ public class BladeSalesLeadController extends BladeController {
 	@PostMapping("/submit")
 	@ApiOperationSupport(order = 6)
 	@ApiOperation(value = "新增或修改", notes = "传入bladeSalesLead")
+	@VersionControl("bladeSalesLeadServiceImpl")
 	public R submit(@Valid @RequestBody BladeSalesLeadVO bladeSalesLead) {
 		return bladeSalesLeadService.submit(bladeSalesLead);
 	}

+ 35 - 17
blade-service/gubersail-dealer-admin/src/main/java/com/gubersail/admin/lead/service/impl/BladeSalesLeadServiceImpl.java

@@ -26,8 +26,12 @@ import com.gubersail.admin.lead.service.IBladeSalesLeadService;
 import com.gubersail.admin.util.BillCodeUtil;
 import com.gubersail.admin.wrapper.SalesLeadWrapper;
 import com.gubersail.admin.zcrm.customer.service.IViewCustomerSelService;
+import com.gubersail.dealer.admin.api.claim.entity.BladeClaimAttachment;
+import com.gubersail.dealer.admin.api.claim.vo.BladeClaimAttachmentVO;
+import com.gubersail.dealer.admin.api.claim.vo.BladeClaimAuditVO;
 import com.gubersail.dealer.admin.api.lead.entity.BladeSalesLead;
 import com.gubersail.dealer.admin.api.lead.entity.BladeSalesLeadDetail;
+import com.gubersail.dealer.admin.api.lead.vo.BladeSalesLeadDetailVO;
 import com.gubersail.dealer.admin.api.lead.vo.BladeSalesLeadVO;
 import com.gubersail.dealer.admin.api.zcrm.customer.entity.ViewCustomerSel;
 import lombok.AllArgsConstructor;
@@ -87,7 +91,31 @@ public class BladeSalesLeadServiceImpl extends ServiceImpl<BladeSalesLeadMapper,
 		List<BladeSalesLeadDetail> salesLeadDetailList = bladeSalesLeadDetailService.list(new LambdaQueryWrapper<BladeSalesLeadDetail>()
 			.eq(BladeSalesLeadDetail::getLeadId, salesLead.getId())
 			.eq(BladeSalesLeadDetail::getIsDeleted, 0));
-		salesLeadVO.setSalesLeadDetailList(salesLeadDetailList.isEmpty() ? new ArrayList<>() : salesLeadDetailList);
+		List<Long> userList = new ArrayList<>();
+		List<BladeSalesLeadDetailVO> salesLeadDetailVOList = BeanUtil.copy(salesLeadDetailList, BladeSalesLeadDetailVO.class);
+		if (!salesLeadDetailVOList.isEmpty()){
+			userList.addAll(salesLeadDetailVOList.stream().map(BladeSalesLeadDetailVO::getUpdateUser)
+				.filter(Objects::nonNull).distinct().collect(Collectors.toList()));
+			userList.addAll(salesLeadDetailVOList.stream().map(BladeSalesLeadDetailVO::getCreateUser)
+				.filter(Objects::nonNull).distinct().collect(Collectors.toList()));
+		}
+		List<User> users = new ArrayList<>();
+		if (!userList.isEmpty()){
+			users = userClient.userListGetByIds(userList.stream().distinct().collect(Collectors.toList()));
+		}
+		if (!users.isEmpty()){
+			for (BladeSalesLeadDetailVO item : salesLeadDetailVOList){
+				//赋值创建人名称
+				if (ObjectUtils.isNotNull(item.getCreateUser())){
+					users.stream().filter(e -> e.getId().equals(item.getCreateUser())).findFirst().ifPresent(user -> item.setCreateUserName(user.getRealName()));
+				}
+				//赋值修改人名称
+				if (ObjectUtils.isNotNull(item.getUpdateUser())){
+					users.stream().filter(e -> e.getId().equals(item.getUpdateUser())).findFirst().ifPresent(user -> item.setUpdateUserName(user.getRealName()));
+				}
+			}
+		}
+		salesLeadVO.setSalesLeadDetailList(salesLeadDetailVOList.isEmpty() ? new ArrayList<>() : salesLeadDetailVOList);
 		return salesLeadVO;
 	}
 
@@ -135,16 +163,7 @@ public class BladeSalesLeadServiceImpl extends ServiceImpl<BladeSalesLeadMapper,
 				salesLead.setCustomerName(customerSel.getCustomerName());
 			}
 		} else {
-			BladeSalesLead dataSourceLead = baseMapper.selectOne(new LambdaQueryWrapper<BladeSalesLead>()
-				.select(BladeSalesLead::getId, BladeSalesLead::getVersion)
-				.eq(BladeSalesLead::getId, salesLead.getId()));
-			if (!Objects.equals(dataSourceLead.getVersion(), salesLead.getVersion())) {
-				return R.fail(601, "数据已被其他用户更新,请等待刷新后重试");
-			}
-			// 每更新一次往上累加一次版本
-			// 旧数据处理
-			int version = dataSourceLead.getVersion() == null ? 1 : dataSourceLead.getVersion();
-			salesLead.setVersion(version + 1);
+			salesLead.setVersion(salesLead.getVersion() == null ? 1 : salesLead.getVersion() + 1);
 			salesLead.setUpdateUser(AuthUtil.getUserId());
 			salesLead.setUpdateTime(new Date());
 		}
@@ -152,7 +171,8 @@ public class BladeSalesLeadServiceImpl extends ServiceImpl<BladeSalesLeadMapper,
 		this.saveOrUpdate(salesLead);
 		//判断是否存在销售线索明细数据
 		if (ObjectUtils.isNotNull(bladeSalesLead.getSalesLeadDetailList()) && !bladeSalesLead.getSalesLeadDetailList().isEmpty()) {
-			for (BladeSalesLeadDetail item : bladeSalesLead.getSalesLeadDetailList()) {
+			List<BladeSalesLeadDetail> salesLeadDetailList = BeanUtil.copy(bladeSalesLead.getSalesLeadDetailList(), BladeSalesLeadDetail.class);
+			for (BladeSalesLeadDetail item : salesLeadDetailList) {
 				//添加销售线索主表关联数据
 				item.setLeadId(salesLead.getId());
 				//判断是否是第一次保存
@@ -166,7 +186,7 @@ public class BladeSalesLeadServiceImpl extends ServiceImpl<BladeSalesLeadMapper,
 				}
 			}
 			//批量保存销售线索明细数据
-			bladeSalesLeadDetailService.saveOrUpdateBatch(bladeSalesLead.getSalesLeadDetailList());
+			bladeSalesLeadDetailService.saveOrUpdateBatch(salesLeadDetailList);
 		}
 		return R.data(salesLead);
 	}
@@ -200,8 +220,7 @@ public class BladeSalesLeadServiceImpl extends ServiceImpl<BladeSalesLeadMapper,
 		salesLead.setStatus(1);
 		salesLead.setUpdateTime(new Date());
 		salesLead.setUpdateUser(AuthUtil.getUserId());
-		int version = salesLead.getVersion() == null ? 1 : salesLead.getVersion();
-		salesLead.setVersion(version + 1);
+		salesLead.setVersion(salesLead.getVersion() == null ? 1 : salesLead.getVersion() + 1);
 		this.updateById(salesLead);
 		return R.success("操作成功");
 	}
@@ -218,8 +237,7 @@ public class BladeSalesLeadServiceImpl extends ServiceImpl<BladeSalesLeadMapper,
 		salesLead.setStatus(0);
 		salesLead.setUpdateTime(new Date());
 		salesLead.setUpdateUser(AuthUtil.getUserId());
-		int version = salesLead.getVersion() == null ? 1 : salesLead.getVersion();
-		salesLead.setVersion(version + 1);
+		salesLead.setVersion(salesLead.getVersion() == null ? 1 : salesLead.getVersion() + 1);
 		this.updateById(salesLead);
 		return R.success("操作成功");
 	}

+ 23 - 0
blade-service/gubersail-dealer-app/src/main/java/com/gubersail/app/annotation/VersionControl.java

@@ -0,0 +1,23 @@
+package com.gubersail.app.annotation;
+
+
+import java.lang.annotation.*;
+
+/**
+ * 版本控制
+ * 返回值必须是 R
+ * @author Rain
+ */
+@Target(ElementType.METHOD)
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+public @interface VersionControl {
+
+
+	/**
+	 * service 地址
+	 * @return 无
+	 */
+	String value() default "";
+
+}

+ 70 - 0
blade-service/gubersail-dealer-app/src/main/java/com/gubersail/app/aspectj/VersionControlAspectj.java

@@ -0,0 +1,70 @@
+package com.gubersail.app.aspectj;
+
+import com.alibaba.fastjson.JSONObject;
+import com.gubersail.app.annotation.VersionControl;
+import com.gubersail.app.enums.FinalMap;
+import org.aspectj.lang.ProceedingJoinPoint;
+import org.aspectj.lang.annotation.Around;
+import org.aspectj.lang.annotation.Aspect;
+import org.aspectj.lang.annotation.Pointcut;
+import org.aspectj.lang.reflect.MethodSignature;
+import org.springblade.common.enums.CommonEnum;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.SpringUtil;
+import org.springframework.stereotype.Component;
+import org.springframework.util.ObjectUtils;
+import org.springframework.util.StringUtils;
+
+import java.io.Serializable;
+import java.lang.reflect.Method;
+
+/**
+ * @author Rain
+ */
+@Aspect
+@Component
+public class VersionControlAspectj {
+
+
+	@Pointcut("@annotation(com.gubersail.app.annotation.VersionControl)")
+	public void versionControlCut() {
+	}
+
+
+	@Around("versionControlCut()")
+	public R doAround(ProceedingJoinPoint joinPoint) throws Throwable {
+		try {
+			MethodSignature signature = (MethodSignature) joinPoint.getSignature();
+			VersionControl customAnnotation = signature.getMethod().getAnnotation(VersionControl.class);
+			Object obj = joinPoint.getArgs()[0];
+			JSONObject jsonObject = JSONObject.parseObject(JSONObject.toJSONString(obj));
+			String id = jsonObject.getString(FinalMap.ID);
+			String sourceVersion = jsonObject.getString(FinalMap.VERSION);
+			has: if (StringUtils.hasText(id) && StringUtils.hasText(sourceVersion)) {
+				Object objBean = SpringUtil.getBean(customAnnotation.value());
+				Method method = objBean.getClass().getDeclaredMethod(FinalMap.GET_BY_ID, Serializable.class);
+				method.setAccessible(true);
+				Object result = method.invoke(objBean, Long.valueOf(id));
+				if (ObjectUtils.isEmpty(result)) {
+					break has;
+				}
+				JSONObject entityData = JSONObject.parseObject(JSONObject.toJSONString(result));
+				if (entityData.containsKey(FinalMap.IS_DELETE)) {
+					if (CommonEnum.ONE.info.equals(entityData.getString(FinalMap.IS_DELETE))) {
+						return R.fail("该单据已被删除,请返回列表页刷新后重试");
+					}
+				}
+				if (!entityData.containsKey(FinalMap.VERSION)) {
+					break has;
+				}
+				if (!sourceVersion.equals(entityData.getString(FinalMap.VERSION))) {
+					return R.fail(601, "数据已被其他用户更新,请等待刷新后重试");
+				}
+			}
+		} catch (Exception e) {
+			throw new RuntimeException(e);
+		}
+		return (R) joinPoint.proceed();
+	}
+
+}

+ 2 - 0
blade-service/gubersail-dealer-app/src/main/java/com/gubersail/app/claim/controller/AppClaimController.java

@@ -21,6 +21,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import com.gubersail.app.annotation.VersionControl;
 import com.gubersail.app.api.claim.entity.AppClaim;
 import com.gubersail.app.api.claim.vo.AppClaimVO;
 import com.gubersail.app.claim.service.IAppClaimAttachmentService;
@@ -145,6 +146,7 @@ public class AppClaimController extends BladeController {
 	@PostMapping("/submit")
 	@ApiOperationSupport(order = 6)
 	@ApiOperation(value = "新增或修改", notes = "传入bladeClaim")
+	@VersionControl("appClaimServiceImpl")
 	public R submit(@Valid @RequestBody AppClaimVO bladeClaim) {
 		return bladeClaimService.submit(bladeClaim);
 	}

+ 3 - 6
blade-service/gubersail-dealer-app/src/main/java/com/gubersail/app/claim/service/impl/AppClaimServiceImpl.java

@@ -124,8 +124,7 @@ public class AppClaimServiceImpl extends ServiceImpl<AppClaimMapper, AppClaim> i
 			}
 			// 每更新一次往上累加一次版本
 			// 旧数据处理
-			int version = dataSourceClaim.getVersion() == null ? 1 : dataSourceClaim.getVersion();
-			claim.setVersion(version + 1);
+			claim.setVersion(claim.getVersion() == null ? 1 : claim.getVersion() + 1);
 			claim.setUpdateUser(AuthUtil.getUserId());
 			claim.setUpdateTime(new Date());
 		}
@@ -210,8 +209,7 @@ public class AppClaimServiceImpl extends ServiceImpl<AppClaimMapper, AppClaim> i
 		claim.setAuditStatus(1);
 		claim.setUpdateTime(new Date());
 		claim.setUpdateUser(AuthUtil.getUserId());
-		int version = claim.getVersion() == null ? 1 : claim.getVersion();
-		claim.setVersion(version + 1);
+		claim.setVersion(claim.getVersion() == null ? 1 : claim.getVersion() + 1);
 		this.updateById(claim);
 		return R.success("操作成功");
 	}
@@ -228,8 +226,7 @@ public class AppClaimServiceImpl extends ServiceImpl<AppClaimMapper, AppClaim> i
 		claim.setAuditStatus(0);
 		claim.setUpdateTime(new Date());
 		claim.setUpdateUser(AuthUtil.getUserId());
-		int version = claim.getVersion() == null ? 1 : claim.getVersion();
-		claim.setVersion(version + 1);
+		claim.setVersion(claim.getVersion() == null ? 1 : claim.getVersion() + 1);
 		this.updateById(claim);
 		return R.success("操作成功");
 	}

+ 14 - 1
blade-service/gubersail-dealer-app/src/main/java/com/gubersail/app/corp/controller/AppCorpsDescController.java

@@ -18,6 +18,7 @@ import com.gubersail.app.corp.service.IAppCorpsTypeService;
 import com.gubersail.app.wrapper.AppCorpsWrapper;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
 import lombok.AllArgsConstructor;
 import org.springblade.common.annotation.RepeatSubmit;
 import org.springblade.core.boot.ctrl.BladeController;
@@ -26,6 +27,8 @@ import org.springblade.core.mp.support.Query;
 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.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.*;
 
 import javax.validation.Valid;
@@ -129,7 +132,6 @@ public class AppCorpsDescController extends BladeController {
 		LambdaQueryWrapper<AppPjCorpsType> lambdaQueryWrapper = new LambdaQueryWrapper<>();
 		lambdaQueryWrapper.eq(AppPjCorpsType::getTenantId, AuthUtil.getTenantId())
 			.eq(AppPjCorpsType::getIsDeleted, 0)
-			.eq(AppPjCorpsType::getSalesCompanyId, AuthUtil.getDeptId())
 			.like(ObjectUtils.isNotNull(corpsType.getCname()), AppPjCorpsType::getCname, corpsType.getCname());
 		List<AppPjCorpsType> list = corpsTypeService.list(lambdaQueryWrapper);
 		return R.data(list);
@@ -166,4 +168,15 @@ public class AppCorpsDescController extends BladeController {
 		return R.data(list);
 	}
 
+
+	/**
+	 * 删除附件
+	 */
+	@PostMapping("/removeFiles")
+	@RepeatSubmit
+	public R removeFiles(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+		return R.status(corpsFilesService.removeByIds(Func.toLongList(ids)));
+	}
+
+
 }

+ 35 - 0
blade-service/gubersail-dealer-app/src/main/java/com/gubersail/app/enums/FinalMap.java

@@ -0,0 +1,35 @@
+package com.gubersail.app.enums;
+
+import java.math.BigDecimal;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * @author Rain
+ */
+public class FinalMap {
+
+
+	public static final List<String> PAY_TYPE_LIST = Arrays.asList("W01", "A01", "U01", "S01");
+
+	public static final BigDecimal ZERO_POINT_ZERO = new BigDecimal("0.00");
+
+	/**
+	 * equals 使用,其余情况与 BigDecimal.ONE 相同
+	 */
+	public static final BigDecimal ONE = new BigDecimal(1);
+
+	public static final BigDecimal TWO = new BigDecimal(2);
+
+	public static final Integer FIFTEEN = 15;
+
+
+	public static final String VERSION = "version";
+
+	public static final String IS_DELETE = "isDeleted";
+
+	public static final String ID = "id";
+
+	public static final String GET_BY_ID = "getById";
+
+}

+ 11 - 1
blade-service/gubersail-shop-app/src/main/java/com/gubersail/shop/app/corp/controller/ShopAppCorpsDescController.java

@@ -18,6 +18,7 @@ import com.gubersail.shop.app.corp.service.IShopAppCorpsTypeService;
 import com.gubersail.shop.app.wrapper.ShopAppCorpsWrapper;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
 import lombok.AllArgsConstructor;
 import org.springblade.common.annotation.RepeatSubmit;
 import org.springblade.core.boot.ctrl.BladeController;
@@ -26,6 +27,7 @@ import org.springblade.core.mp.support.Query;
 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.springframework.web.bind.annotation.*;
 
 import javax.validation.Valid;
@@ -129,7 +131,6 @@ public class ShopAppCorpsDescController extends BladeController {
 		LambdaQueryWrapper<ShopAppPjCorpsType> lambdaQueryWrapper = new LambdaQueryWrapper<>();
 		lambdaQueryWrapper.eq(ShopAppPjCorpsType::getTenantId, AuthUtil.getTenantId())
 			.eq(ShopAppPjCorpsType::getIsDeleted, 0)
-			.eq(ShopAppPjCorpsType::getSalesCompanyId, AuthUtil.getDeptId())
 			.like(ObjectUtils.isNotNull(corpsType.getCname()), ShopAppPjCorpsType::getCname, corpsType.getCname());
 		List<ShopAppPjCorpsType> list = corpsTypeService.list(lambdaQueryWrapper);
 		return R.data(list);
@@ -166,4 +167,13 @@ public class ShopAppCorpsDescController extends BladeController {
 		return R.data(list);
 	}
 
+	/**
+	 * 删除附件
+	 */
+	@PostMapping("/removeFiles")
+	@RepeatSubmit
+	public R removeFiles(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+		return R.status(corpsFilesService.removeByIds(Func.toLongList(ids)));
+	}
+
 }

+ 3 - 2
blade-service/gubersail-shop-app/src/main/java/com/gubersail/shop/app/insurance/service/impl/ShopAppTireInsuranceRegisterServiceImpl.java

@@ -161,8 +161,9 @@ public class ShopAppTireInsuranceRegisterServiceImpl extends ServiceImpl<ShopApp
 		claim.setTireQuantity(tireInsuranceRegister.getTireQuantity());     // 轮胎数量
 		claim.setTyreNo(tireInsuranceRegister.getInsuranceNo());            // 胎号/轮胎宝编号
 		claim.setTyreSpecs(tireInsuranceRegister.getTyreSpecs());           // 规格型号
-		claim.setAuditStatus(0);                                            // 审核状态
+		claim.setAuditStatus(1);                                            // 审核状态
 		claim.setSubmitTime(new Date());                                    // 提交时间
+		claim.setClaimReason("");
 		// 7. 设置理赔来源信息(区分管理员和普通用户)
 		if (AuthUtil.getUserRole().contains("admin")) {
 			// 管理员直接使用用户信息
@@ -184,7 +185,7 @@ public class ShopAppTireInsuranceRegisterServiceImpl extends ServiceImpl<ShopApp
 			}
 
 			// 7.2 查询门店详情信息
-			ShopAppPjCorpsDesc corpsDesc = corpsDescService.getById(attn.getId());
+			ShopAppPjCorpsDesc corpsDesc = corpsDescService.getById(attn.getPid());
 			if (corpsDesc == null) {
 				throw new RuntimeException("未查到对应门店信息");
 			}