多端同时提交
This commit is contained in:
@@ -8,4 +8,7 @@ import org.apache.ibatis.annotations.Param;
|
|||||||
public interface SystemBuildingShopMapper extends tk.mybatis.mapper.common.Mapper<SystemBuildingShopDO> {
|
public interface SystemBuildingShopMapper extends tk.mybatis.mapper.common.Mapper<SystemBuildingShopDO> {
|
||||||
void updateAuditByShopId(@Param("auditId") Long auditId,
|
void updateAuditByShopId(@Param("auditId") Long auditId,
|
||||||
@Param("shopId") Long shopId);
|
@Param("shopId") Long shopId);
|
||||||
|
|
||||||
|
SystemBuildingShopDO selectByShopId(@Param("shopId") Long shopId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,5 +13,10 @@
|
|||||||
set audit_id = #{auditId}
|
set audit_id = #{auditId}
|
||||||
where shop_id = #{shopId}
|
where shop_id = #{shopId}
|
||||||
</update>
|
</update>
|
||||||
|
<select id="selectByShopId" resultType="com.cool.store.entity.SystemBuildingShopDO">
|
||||||
|
select * from xfsg_system_building_shop
|
||||||
|
where shop_id = #{shopId};
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -95,6 +95,10 @@ public class SysStoreAppServiceImpl implements SysStoreAppService, AuditResultSe
|
|||||||
if (Objects.isNull(request)) {
|
if (Objects.isNull(request)) {
|
||||||
throw new ServiceException(ErrorCodeEnum.PARAMS_VALIDATE_ERROR);
|
throw new ServiceException(ErrorCodeEnum.PARAMS_VALIDATE_ERROR);
|
||||||
}
|
}
|
||||||
|
SystemBuildingShopDO isExist = systemBuildingShopMapper.selectByShopId(request.getShopId());
|
||||||
|
if (Objects.nonNull(isExist) && Objects.isNull(request.getId())){
|
||||||
|
throw new ServiceException(ErrorCodeEnum.DUPLICATE_SUBMISSION);
|
||||||
|
}
|
||||||
String lockKey = "submitSysBuildStore:" + request.getShopId();
|
String lockKey = "submitSysBuildStore:" + request.getShopId();
|
||||||
String lockValue = UUID.randomUUID().toString();
|
String lockValue = UUID.randomUUID().toString();
|
||||||
boolean acquired = false;
|
boolean acquired = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user