修改接口
parent
338cb4fe7c
commit
5ab3eed0f8
|
@ -1,7 +1,9 @@
|
|||
package com.fate.firm.domain.request;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.fate.common.core.annotation.Excel;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
|
@ -22,6 +24,10 @@ import java.util.Date;
|
|||
@AllArgsConstructor
|
||||
public class FirmRequest {
|
||||
|
||||
@Excel(name = "企业主键", cellType = Excel.ColumnType.NUMERIC)
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Integer firmId;
|
||||
|
||||
@Excel(name = "企业名称")
|
||||
@TableField("firm_name")
|
||||
private String firmName;
|
||||
|
|
|
@ -10,11 +10,8 @@ import com.fate.common.security.utils.SecurityUtils;
|
|||
import com.fate.common.system.domain.LoginUser;
|
||||
import com.fate.common.system.domain.SysRole;
|
||||
import com.fate.firm.domain.Firm;
|
||||
import com.fate.firm.domain.FirmType;
|
||||
import com.fate.firm.mapper.FirmMapper;
|
||||
import com.fate.firm.service.FirmService;
|
||||
import io.swagger.models.auth.In;
|
||||
import jdk.jpackage.internal.Log;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
@ -100,13 +97,12 @@ public class FirmServiceImpl extends ServiceImpl<FirmMapper, Firm> implements Fi
|
|||
Long userid = SecurityUtils.getLoginUser().getUserid();
|
||||
firm.setUpdateBy(userid.toString());
|
||||
firm.setUpdateTime(new Date());
|
||||
firm.setFirmStaus(2);
|
||||
int i = firmMapper.updateById(firm);
|
||||
return i > 0 ? Result.success("成功") : Result.error("失败");
|
||||
}
|
||||
|
||||
/**
|
||||
* 管理员查询
|
||||
* 是否管理员查询
|
||||
* @author: ZhuoXin
|
||||
* @date: 2023/11/21 13:45
|
||||
* @param: [firm]
|
||||
|
@ -128,15 +124,45 @@ public class FirmServiceImpl extends ServiceImpl<FirmMapper, Firm> implements Fi
|
|||
if (StringUtils.isNotEmpty(firm.getFirmHead())) {
|
||||
queryWrapper.like(Firm::getFirmHead, firm.getFirmHead());
|
||||
}
|
||||
|
||||
// 逻辑删除 不显示状态为2的
|
||||
queryWrapper.eq(Firm::getFirmTombstone,1);
|
||||
|
||||
List<SysRole> roles = SecurityUtils.getLoginUser().getSysUser().getRoles();
|
||||
int role = 0;
|
||||
for (SysRole item : roles) {
|
||||
role = Math.toIntExact(item.getRoleId());
|
||||
if(1 == role){
|
||||
break;
|
||||
}
|
||||
}
|
||||
// 获取角色的id
|
||||
if( 1 != role){
|
||||
queryWrapper.eq(Firm::getCreateBy,role);
|
||||
}
|
||||
|
||||
List<Firm> list = firmMapper.selectList(queryWrapper);
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 提交与驳回
|
||||
* @author: ZhuoXin
|
||||
* @date: 2023/11/25 12:59
|
||||
* @param: [firm]
|
||||
* @return: com.fate.common.core.domain.Result
|
||||
**/
|
||||
@Override
|
||||
public Result updateStatus(Firm firm) {
|
||||
firm.setUpdateBy("1");
|
||||
List<SysRole> roles = SecurityUtils.getLoginUser().getSysUser().getRoles();
|
||||
int role = 0;
|
||||
for (SysRole item : roles) {
|
||||
role = Math.toIntExact(item.getRoleId());
|
||||
if(1 == role){
|
||||
break;
|
||||
}
|
||||
}
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
firm.setUpdateBy(userId.toString());
|
||||
firm.setUpdateTime(new Date());
|
||||
int insert = firmMapper.insert(firm);
|
||||
return insert > 0 ? Result.success("成功") : Result.error("失败");
|
||||
|
@ -166,6 +192,7 @@ public class FirmServiceImpl extends ServiceImpl<FirmMapper, Firm> implements Fi
|
|||
@Override
|
||||
public Result manage(Firm firm) {
|
||||
Long roleId = SecurityUtils.getLoginUser().getSysUser().getRoleId();
|
||||
|
||||
return Result.success(roleId);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue