|
@@ -20,6 +20,8 @@ import cn.iocoder.yudao.module.expense.dal.dataobject.expenseinfo.ExpenseInfoObj
|
|
|
import cn.iocoder.yudao.module.expense.dal.mysql.expenseinfo.ExpenseInfoMapper;
|
|
|
import cn.iocoder.yudao.module.expense.dal.mysql.expenseinfo.ExpenseInfoObjMapper;
|
|
|
import cn.iocoder.yudao.module.infra.api.file.FileApi;
|
|
|
+import cn.iocoder.yudao.module.system.api.permission.PermissionApi;
|
|
|
+import cn.iocoder.yudao.module.system.api.permission.dto.DeptDataPermissionRespDTO;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
@@ -52,6 +54,9 @@ public class ExpenseInfoServiceImpl implements ExpenseInfoService {
|
|
|
@Resource
|
|
|
private FileApi fileApi;
|
|
|
|
|
|
+ @Resource
|
|
|
+ private PermissionApi permissionApi;
|
|
|
+
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public Long createInfo(ExpenseInfoSaveReqVO createReqVO) {
|
|
@@ -72,7 +77,7 @@ public class ExpenseInfoServiceImpl implements ExpenseInfoService {
|
|
|
List<ExpenseInfoObjDO> oaExpenseObjs = createReqVO.getExpenseInfoObjs();
|
|
|
for (ExpenseInfoObjDO oaExpenseObj : oaExpenseObjs) {
|
|
|
// 设置费用明细的创建人
|
|
|
- oaExpenseObj.setCreator(String.valueOf(loginEmployee.getId()));
|
|
|
+ // oaExpenseObj.setCreator(String.valueOf(loginEmployee.getId()));
|
|
|
oaExpenseObj.setMoney(oaExpenseObj.getMoney().setScale(2, BigDecimal.ROUND_HALF_UP));
|
|
|
oaExpenseObj.setExpenseObjUuid(IdUtil.fastSimpleUUID());
|
|
|
|
|
@@ -116,7 +121,7 @@ public class ExpenseInfoServiceImpl implements ExpenseInfoService {
|
|
|
info.setStatus("0");
|
|
|
info.setUserId(loginUserId);
|
|
|
info.setCreateEmployeeId(loginEmployee.getId());
|
|
|
- info.setCreator(String.valueOf(loginEmployee.getId()));
|
|
|
+ // info.setCreator(String.valueOf(loginEmployee.getId()));
|
|
|
// 插入费用主表数据
|
|
|
infoMapper.insert(info);
|
|
|
|
|
@@ -150,7 +155,7 @@ public class ExpenseInfoServiceImpl implements ExpenseInfoService {
|
|
|
List<ExpenseInfoObjDO> oaExpenseObjs = updateReqVO.getExpenseInfoObjs();
|
|
|
for (ExpenseInfoObjDO oaExpenseObj : oaExpenseObjs) {
|
|
|
// 设置费用明细的创建人
|
|
|
- oaExpenseObj.setCreator(String.valueOf(loginEmployee.getId()));
|
|
|
+ // oaExpenseObj.setCreator(String.valueOf(loginEmployee.getId()));
|
|
|
oaExpenseObj.setMoney(oaExpenseObj.getMoney().setScale(2, BigDecimal.ROUND_HALF_UP));
|
|
|
oaExpenseObj.setExpenseObjUuid(IdUtil.fastSimpleUUID());
|
|
|
|
|
@@ -231,6 +236,11 @@ public class ExpenseInfoServiceImpl implements ExpenseInfoService {
|
|
|
|
|
|
@Override
|
|
|
public PageResult<ExpenseInfoRespVO> getInfoPage(ExpenseInfoPageReqVO pageReqVO) {
|
|
|
+ // 数据权限
|
|
|
+ Long loginUserId = SecurityFrameworkUtils.getLoginUserId();
|
|
|
+ DeptDataPermissionRespDTO deptDataPermission = permissionApi.getDeptDataPermission(loginUserId);
|
|
|
+ pageReqVO.setDeptDataPermission(deptDataPermission);
|
|
|
+ pageReqVO.setUserId(loginUserId);
|
|
|
|
|
|
pageReqVO.setPageNo((pageReqVO.getPageNo() - 1) * pageReqVO.getPageSize());
|
|
|
|