master:系统调优;

pull/1121/head
liujiang 2025-05-14 23:56:56 +08:00
parent c2a4f0abbd
commit 23e2c14d28
5 changed files with 34 additions and 23 deletions

View File

@ -1,5 +1,6 @@
package com.ruoyi.web.controller.system;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysMenu;
@ -11,6 +12,9 @@ import com.ruoyi.framework.web.service.SysLoginService;
import com.ruoyi.framework.web.service.SysPermissionService;
import com.ruoyi.framework.web.service.TokenService;
import com.ruoyi.system.service.ISysMenuService;
import com.ruoyi.xkt.domain.Store;
import com.ruoyi.xkt.mapper.StoreMapper;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
@ -27,17 +31,17 @@ import java.util.Set;
*/
@RestController
public class SysLoginController {
@Autowired
private SysLoginService loginService;
@Autowired
private ISysMenuService menuService;
@Autowired
private SysPermissionService permissionService;
@Autowired
private TokenService tokenService;
@Autowired
private StoreMapper storeMapper;
/**
*
@ -64,6 +68,10 @@ public class SysLoginController {
public AjaxResult getInfo() {
LoginUser loginUser = SecurityUtils.getLoginUser();
SysUser user = loginUser.getUser();
// 如果当前用户有绑定的档口则返回storeId
Store store = this.storeMapper.selectOne(new LambdaQueryWrapper<Store>().eq(Store::getUserId, loginUser.getUserId())
.eq(Store::getDelFlag, Constants.UNDELETED));
user.setStoreId(ObjectUtils.isNotEmpty(store) ? store.getId() : null);
// 角色集合
Set<String> roles = permissionService.getRolePermission(user);
// 权限集合

View File

@ -15,7 +15,7 @@ import java.util.List;
* @version v1.0
* @date 2025/3/27 15:12
*/
@ApiModel("档口客户批量减价、批量抹零")
@ApiModel("档口是否已存在该商品的优惠")
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
public class StoreCusProdDiscExistVO {

View File

@ -119,6 +119,19 @@ public class SysUser extends BaseEntity {
*/
private Long roleId;
/**
* storeId
*/
private Long storeId;
public Long getStoreId() {
return storeId;
}
public void setStoreId(Long storeId) {
this.storeId = storeId;
}
public SysUser() {
}

View File

@ -105,7 +105,14 @@ public class AdminAdvertRoundServiceImpl implements IAdminAdvertRoundService {
// 校验图片审核类型是否存在
AdPicAuditStatus.of(auditDTO.getPicAuditStatus());
advertRound.setPicAuditStatus(auditDTO.getPicAuditStatus()).setRejectReason(auditDTO.getRejectReason());
return this.advertRoundMapper.updateById(advertRound);
int count = this.advertRoundMapper.updateById(advertRound);
// 如果审核通过的话,则将图片保存到系统图片库中
if (Objects.equals(auditDTO.getPicAuditStatus(), AdPicAuditStatus.AUDIT_PASS.getValue())) {
AdvertStoreFile advertStoreFile = new AdvertStoreFile().setAdvertRoundId(advertRound.getId())
.setStoreId(advertRound.getStoreId()).setFileId(advertRound.getPicId()).setTypeId(advertRound.getTypeId());
this.advertStoreFileMapper.insert(advertStoreFile);
}
return count;
}
/**

View File

@ -574,24 +574,7 @@ public class AdvertRoundServiceImpl implements IAdvertRoundService {
int count = this.fileMapper.insert(file);
// 更新推广位的图片ID
advertRound.setPicId(file.getId());
this.advertRoundMapper.updateById(advertRound);
// TODO 是否要保存到AdvertStoreFile 因为还没审核通过
// TODO 是否要保存到AdvertStoreFile 因为还没审核通过
// TODO 是否要保存到AdvertStoreFile 因为还没审核通过
// TODO 是否要保存到AdvertStoreFile 因为还没审核通过
/*// 将档口上传图片保存到AdvertStoreFile
AdvertStoreFile advertStoreFile = new AdvertStoreFile().setAdvertRoundId(advertRound.getId())
.setStoreId(advertRound.getStoreId()).setFileId(file.getId()).setTypeId(advertRound.getTypeId());
this.advertStoreFileMapper.insert(advertStoreFile);*/
return count;
return this.advertRoundMapper.updateById(advertRound);
}
/**