进度+文件上传重构+文件权限控制
This commit is contained in:
@@ -4,6 +4,7 @@ import java.util.List;
|
||||
import java.util.Arrays;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import com.ruoyi.oa.domain.bo.BatchBo;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.constraints.*;
|
||||
@@ -86,6 +87,16 @@ public class OaProjectScheduleStepController extends BaseController {
|
||||
return toAjax(iOaProjectScheduleStepService.updateByBo(bo));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改项目进度步骤跟踪
|
||||
*/
|
||||
@RepeatSubmit()
|
||||
@PutMapping("/change-batch")
|
||||
public R<Void> changeBatch(@Validated(EditGroup.class) @RequestBody BatchBo batchBo) {
|
||||
return toAjax(iOaProjectScheduleStepService.changeBatch(batchBo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除项目进度步骤跟踪
|
||||
*
|
||||
|
||||
@@ -1,102 +0,0 @@
|
||||
package com.ruoyi.oa.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Arrays;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import com.ruoyi.common.annotation.RepeatSubmit;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.core.validate.AddGroup;
|
||||
import com.ruoyi.common.core.validate.EditGroup;
|
||||
import com.ruoyi.common.core.validate.QueryGroup;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.oa.domain.vo.SysOaFileVo;
|
||||
import com.ruoyi.oa.domain.bo.SysOaFileBo;
|
||||
import com.ruoyi.oa.service.ISysOaFileService;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 文件存储
|
||||
*
|
||||
* @author hdka
|
||||
* @date 2024-12-15
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/system/oaFile")
|
||||
public class SysOaFileController extends BaseController {
|
||||
|
||||
private final ISysOaFileService iSysOaFileService;
|
||||
|
||||
/**
|
||||
* 查询文件存储列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<SysOaFileVo> list(SysOaFileBo bo, PageQuery pageQuery) {
|
||||
return iSysOaFileService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出文件存储列表
|
||||
*/
|
||||
@Log(title = "文件存储", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(SysOaFileBo bo, HttpServletResponse response) {
|
||||
List<SysOaFileVo> list = iSysOaFileService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "文件存储", SysOaFileVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取文件存储详细信息
|
||||
*
|
||||
* @param fileId 主键
|
||||
*/
|
||||
@GetMapping("/{fileId}")
|
||||
public R<SysOaFileVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long fileId) {
|
||||
return R.ok(iSysOaFileService.queryById(fileId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增文件存储
|
||||
*/
|
||||
@Log(title = "文件存储", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody SysOaFileBo bo) {
|
||||
return toAjax(iSysOaFileService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改文件存储
|
||||
*/
|
||||
@Log(title = "文件存储", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody SysOaFileBo bo) {
|
||||
return toAjax(iSysOaFileService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除文件存储
|
||||
*
|
||||
* @param fileIds 主键串
|
||||
*/
|
||||
@Log(title = "文件存储", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{fileIds}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] fileIds) {
|
||||
return toAjax(iSysOaFileService.deleteWithValidByIds(Arrays.asList(fileIds), true));
|
||||
}
|
||||
}
|
||||
@@ -6,13 +6,11 @@ import java.util.Arrays;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DSTransactional;
|
||||
import com.ruoyi.oa.domain.bo.SysOaWarehouseDetailBo;
|
||||
import com.ruoyi.oa.domain.vo.SysOaFileVo;
|
||||
import com.ruoyi.oa.domain.vo.SysOaOutWarehouseListVo;
|
||||
import com.ruoyi.oa.mapper.SysOaTaskMapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import com.ruoyi.common.annotation.RepeatSubmit;
|
||||
|
||||
@@ -114,7 +114,7 @@ public class SysOaWarehouseController extends BaseController {
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody SysOaWarehouseBo bo) {
|
||||
return toAjax(iSysOaWarehouseService.insertByBo(bo));
|
||||
return toAjax(iSysOaWarehouseService.insertByBo(bo)>0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -55,15 +55,6 @@ public class SysOaWarehouseMasterController extends BaseController {
|
||||
return iSysOaWarehouseMasterService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询出库单管理列表
|
||||
*/
|
||||
@GetMapping("/list-task")
|
||||
public TableDataInfo<SysOaWarehouseMasterVo> listTask(SysOaWarehouseMasterBo bo, PageQuery pageQuery) {
|
||||
bo.setType(2L);
|
||||
return iSysOaWarehouseMasterService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出出库单管理列表
|
||||
*/
|
||||
@@ -102,8 +93,9 @@ public class SysOaWarehouseMasterController extends BaseController {
|
||||
@RepeatSubmit()
|
||||
@PostMapping("/in")
|
||||
public R<Void> addIn(@Validated(AddGroup.class) @RequestBody SysOaWarehouseBo bo) {
|
||||
warehouseService.insertByBo(bo);
|
||||
return toAjax(iSysOaWarehouseMasterService.insertInWarehouse(bo));
|
||||
Long id = warehouseService.insertByBo(bo);
|
||||
System.out.println(warehouseService.queryById(id));
|
||||
return toAjax(iSysOaWarehouseMasterService.insertInWarehouse(bo,id));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.ruoyi.oa.controller;
|
||||
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.oa.domain.vo.SysUserVo;
|
||||
import com.ruoyi.oa.service.SysOssAclService;
|
||||
import lombok.Data;
|
||||
import org.flowable.spring.security.UserDto;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/oa/oss/acl")
|
||||
public class SysOssAclController {
|
||||
|
||||
@Autowired
|
||||
private SysOssAclService aclService;
|
||||
|
||||
/** 授权 */
|
||||
@PostMapping("/grant")
|
||||
public R<?> grant(@RequestBody GrantDto dto) {
|
||||
aclService.grant(dto.getOssId(), dto.getUserId(), dto.getGrantBy());
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/** 取消共享 */
|
||||
@DeleteMapping("/revoke")
|
||||
public R<?> revoke(@RequestBody RevokeDto dto) {
|
||||
aclService.revoke(dto.getOssId(), dto.getUserId());
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/** 判断权限(示例) */
|
||||
@GetMapping("/check")
|
||||
public R<Boolean> check(@RequestParam Long ossId,
|
||||
@RequestParam Long userId) {
|
||||
return R.ok(aclService.hasPerm(userId, ossId));
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
public R<List<SysUserVo>> list(@RequestParam Long ossId) {
|
||||
return R.ok(aclService.listUsersByOssId(ossId));
|
||||
}
|
||||
|
||||
|
||||
// ====================== DTO ======================
|
||||
@Data
|
||||
public static class GrantDto {
|
||||
@NotNull private Long ossId;
|
||||
@NotNull private Long userId;
|
||||
@NotNull private Long grantBy;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class RevokeDto {
|
||||
@NotNull private Long ossId;
|
||||
@NotNull private Long userId;
|
||||
}
|
||||
}
|
||||
@@ -76,4 +76,12 @@ public class OaProjectScheduleStep extends BaseEntity {
|
||||
@TableLogic
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 使用标志
|
||||
*/
|
||||
private Long useFlag;
|
||||
|
||||
|
||||
private Long batchId;
|
||||
|
||||
}
|
||||
|
||||
@@ -3,9 +3,6 @@ package com.ruoyi.oa.domain;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
|
||||
26
ruoyi-oa/src/main/java/com/ruoyi/oa/domain/SysOssAcl.java
Normal file
26
ruoyi-oa/src/main/java/com/ruoyi/oa/domain/SysOssAcl.java
Normal file
@@ -0,0 +1,26 @@
|
||||
package com.ruoyi.oa.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
@TableName("sys_oss_acl")
|
||||
public class SysOssAcl {
|
||||
|
||||
/** 主键 */
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long aclId;
|
||||
|
||||
/** 文件 ID */
|
||||
private Long ossId;
|
||||
|
||||
/** 被授权用户 */
|
||||
private Long userId;
|
||||
|
||||
/** 授权人 */
|
||||
private Long grantBy;
|
||||
|
||||
/** 授权时间 */
|
||||
private LocalDateTime grantTime;
|
||||
}
|
||||
13
ruoyi-oa/src/main/java/com/ruoyi/oa/domain/bo/BatchBo.java
Normal file
13
ruoyi-oa/src/main/java/com/ruoyi/oa/domain/bo/BatchBo.java
Normal file
@@ -0,0 +1,13 @@
|
||||
package com.ruoyi.oa.domain.bo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class BatchBo {
|
||||
|
||||
private Long currentStep;
|
||||
|
||||
private List<OaProjectScheduleStepBo> boList;
|
||||
}
|
||||
@@ -91,4 +91,11 @@ public class OaProjectScheduleStepBo extends BaseEntity {
|
||||
*/
|
||||
private String header;
|
||||
|
||||
/**
|
||||
* 使用标志
|
||||
*/
|
||||
private Long useFlag;
|
||||
|
||||
private Long batchId;
|
||||
|
||||
}
|
||||
|
||||
12
ruoyi-oa/src/main/java/com/ruoyi/oa/domain/bo/OssUserBo.java
Normal file
12
ruoyi-oa/src/main/java/com/ruoyi/oa/domain/bo/OssUserBo.java
Normal file
@@ -0,0 +1,12 @@
|
||||
package com.ruoyi.oa.domain.bo;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class OssUserBo {
|
||||
|
||||
private Long ossId;
|
||||
|
||||
private String userIds;
|
||||
}
|
||||
@@ -1,10 +1,7 @@
|
||||
package com.ruoyi.oa.domain.bo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ruoyi.common.core.validate.AddGroup;
|
||||
import com.ruoyi.common.core.validate.EditGroup;
|
||||
import com.ruoyi.oa.domain.SysOaClaimDetail;
|
||||
import com.ruoyi.oa.domain.SysOaFile;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@@ -63,4 +63,7 @@ public class SysOaWarehouseDetailBo extends BaseEntity {
|
||||
private Double signPrice;
|
||||
|
||||
private Long masterId;
|
||||
|
||||
// 当为1的时候为入库单
|
||||
private Long type;
|
||||
}
|
||||
|
||||
@@ -97,4 +97,14 @@ public class OaProjectScheduleStepVo {
|
||||
/** 附件列表(1 步骤可多附件) */
|
||||
private List<SysOss> fileList; // 建议用 List
|
||||
|
||||
/**
|
||||
* 使用标志
|
||||
*/
|
||||
private Long useFlag;
|
||||
|
||||
/**
|
||||
* 批次号
|
||||
*/
|
||||
private Long batchId;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,51 +0,0 @@
|
||||
package com.ruoyi.oa.domain.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.ruoyi.common.annotation.ExcelDictFormat;
|
||||
import com.ruoyi.common.convert.ExcelDictConvert;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 文件存储视图对象 sys_oa_file
|
||||
*
|
||||
* @author hdka
|
||||
* @date 2024-12-15
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class SysOaFileVo extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@ExcelProperty(value = "主键id")
|
||||
private Long fileId;
|
||||
|
||||
/**
|
||||
* 文件存储路径
|
||||
*/
|
||||
@ExcelProperty(value = "文件存储路径")
|
||||
private String fileUrl;
|
||||
|
||||
/**
|
||||
* 文件类型0打卡1出入库
|
||||
*/
|
||||
@ExcelProperty(value = "文件类型", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(dictType = "file_status")
|
||||
private Long status;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@@ -15,9 +15,9 @@ import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
*/
|
||||
public interface OaProjectScheduleStepMapper extends BaseMapperPlus<OaProjectScheduleStepMapper, OaProjectScheduleStep, OaProjectScheduleStepVo> {
|
||||
|
||||
Page<OaProjectScheduleStepVo> selectVoPagePlus(@Param("page")Page<Object> build, @Param(Constants.WRAPPER) QueryWrapper<OaProjectScheduleStep> lqw);
|
||||
Page<OaProjectScheduleStepVo> selectVoPagePlus(@Param("page")Page<Object> build, @Param(Constants.WRAPPER) QueryWrapper<OaProjectScheduleStep> lqw, @Param("userId") Long userId);
|
||||
|
||||
OaProjectScheduleStepVo selectVoPlusById(Long trackId);
|
||||
OaProjectScheduleStepVo selectVoPlusById(@Param("trackId") Long trackId, @Param("userId") Long userId);
|
||||
|
||||
OaProjectScheduleStepVo maxStepByScheduleId(Long scheduleId);
|
||||
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
package com.ruoyi.oa.mapper;
|
||||
|
||||
import com.ruoyi.oa.domain.SysOaFile;
|
||||
import com.ruoyi.oa.domain.vo.SysOaFileVo;
|
||||
import com.ruoyi.common.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 文件存储Mapper接口
|
||||
*
|
||||
* @author hdka
|
||||
* @date 2024-12-15
|
||||
*/
|
||||
public interface SysOaFileMapper extends BaseMapperPlus<SysOaFileMapper, SysOaFile, SysOaFileVo> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package com.ruoyi.oa.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.ruoyi.oa.domain.SysOssAcl;
|
||||
|
||||
public interface SysOssAclMapper extends BaseMapper<SysOssAcl> {
|
||||
/* 这里通常不需要额外方法,BaseMapper 提供了增删改查 */
|
||||
}
|
||||
@@ -1,13 +1,11 @@
|
||||
package com.ruoyi.oa.service;
|
||||
|
||||
import com.ruoyi.oa.domain.OaProjectScheduleStep;
|
||||
import com.ruoyi.oa.domain.bo.BatchBo;
|
||||
import com.ruoyi.oa.domain.vo.OaProjectScheduleStepVo;
|
||||
import com.ruoyi.oa.domain.bo.OaProjectScheduleStepBo;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
@@ -55,4 +53,11 @@ public interface IOaProjectScheduleStepService {
|
||||
|
||||
OaProjectScheduleStepVo selectByCurrentStepAndScheduleId(Long currentStep, Long scheduleId);
|
||||
|
||||
/**
|
||||
* 更换进度时间线
|
||||
* @param boList
|
||||
* @return
|
||||
*/
|
||||
int changeBatch(BatchBo boList);
|
||||
|
||||
}
|
||||
|
||||
@@ -1,59 +0,0 @@
|
||||
package com.ruoyi.oa.service;
|
||||
|
||||
import com.ruoyi.oa.domain.SysOaFile;
|
||||
import com.ruoyi.oa.domain.vo.SysOaFileVo;
|
||||
import com.ruoyi.oa.domain.bo.SysOaFileBo;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 文件存储Service接口
|
||||
*
|
||||
* @author hdka
|
||||
* @date 2024-12-15
|
||||
*/
|
||||
public interface ISysOaFileService {
|
||||
|
||||
/**
|
||||
* 查询文件存储
|
||||
*/
|
||||
SysOaFileVo queryById(Long fileId);
|
||||
|
||||
/**
|
||||
* 查询文件存储列表
|
||||
*/
|
||||
TableDataInfo<SysOaFileVo> queryPageList(SysOaFileBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询文件存储列表
|
||||
*/
|
||||
List<SysOaFileVo> queryList(SysOaFileBo bo);
|
||||
|
||||
/**
|
||||
* 新增文件存储
|
||||
*/
|
||||
Boolean insertByBo(SysOaFileBo bo);
|
||||
|
||||
/**
|
||||
* 修改文件存储
|
||||
*/
|
||||
Boolean updateByBo(SysOaFileBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除文件存储信息
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
|
||||
Long insertByBoReturnId(SysOaFileBo bo);
|
||||
|
||||
/**
|
||||
* 新增文件返回他们的ID
|
||||
* @param fileUrls
|
||||
* @return
|
||||
*/
|
||||
String insertFiles(List<String> fileUrls);
|
||||
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.ruoyi.oa.service;
|
||||
|
||||
import com.ruoyi.oa.domain.SysOaWarehouseMaster;
|
||||
import com.ruoyi.oa.domain.bo.SysOaWarehouseBo;
|
||||
import com.ruoyi.oa.domain.vo.SysOaWarehouseMasterVo;
|
||||
import com.ruoyi.oa.domain.bo.SysOaWarehouseMasterBo;
|
||||
@@ -50,8 +49,10 @@ public interface ISysOaWarehouseMasterService {
|
||||
|
||||
/**
|
||||
* 单个入库接口
|
||||
*
|
||||
* @param bo
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
int insertInWarehouse(SysOaWarehouseBo bo);
|
||||
int insertInWarehouse(SysOaWarehouseBo bo, Long id);
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ public interface ISysOaWarehouseService {
|
||||
/**
|
||||
* 新增仓库管理
|
||||
*/
|
||||
Boolean insertByBo(SysOaWarehouseBo bo);
|
||||
Long insertByBo(SysOaWarehouseBo bo);
|
||||
|
||||
/**
|
||||
* 修改仓库管理
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.ruoyi.oa.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.ruoyi.oa.domain.SysOssAcl;
|
||||
import com.ruoyi.oa.domain.vo.SysUserVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface SysOssAclService extends IService<SysOssAcl> {
|
||||
|
||||
/** 授权(有则更新,无则插入) */
|
||||
void grant(Long ossId, Long userId, Long grantBy);
|
||||
|
||||
/** 取消共享 */
|
||||
void revoke(Long ossId, Long userId);
|
||||
|
||||
/** 校验用户是否拥有 >= 指定权限 */
|
||||
boolean hasPerm(Long userId, Long ossId);
|
||||
|
||||
List<SysUserVo> listUsersByOssId(Long ossId);
|
||||
|
||||
}
|
||||
@@ -23,6 +23,7 @@ import com.ruoyi.oa.domain.vo.OaProjectScheduleVo;
|
||||
import com.ruoyi.oa.domain.OaProjectSchedule;
|
||||
import com.ruoyi.oa.mapper.OaProjectScheduleMapper;
|
||||
import com.ruoyi.oa.service.IOaProjectScheduleService;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
@@ -123,6 +124,7 @@ public class OaProjectScheduleServiceImpl implements IOaProjectScheduleService {
|
||||
OaProjectScheduleStepBo step = bo.getSteps().get(i);
|
||||
step.setScheduleId(add.getScheduleId());
|
||||
step.setStepOrder((long) (i+1));
|
||||
step.setBatchId(1L);
|
||||
if (i==0){
|
||||
step.setActualStart(new Date());
|
||||
}
|
||||
@@ -172,6 +174,7 @@ public class OaProjectScheduleServiceImpl implements IOaProjectScheduleService {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean complete(OaProjectScheduleBo bo) {
|
||||
// 0首先判断是否到最后一部
|
||||
OaProjectScheduleStepVo scheduleStepVo = projectScheduleStepService.maxStepByScheduleId(bo.getScheduleId());
|
||||
@@ -180,11 +183,13 @@ public class OaProjectScheduleServiceImpl implements IOaProjectScheduleService {
|
||||
// 1未完成全部进度,此时将currentStep更新到下一位 然后将当前的step的完成标志status改为1标志完成
|
||||
projectScheduleStepService.updateByStepAndScheduleId(bo.getCurrentStep(),bo.getScheduleId());
|
||||
bo.setCurrentStep(bo.getCurrentStep()+1L);
|
||||
OaProjectScheduleStepVo stepVo = projectScheduleStepService.selectByCurrentStepAndScheduleId(bo.getCurrentStep()+1L,bo.getScheduleId());
|
||||
OaProjectScheduleStepVo stepVo = projectScheduleStepService.selectByCurrentStepAndScheduleId(bo.getCurrentStep(),bo.getScheduleId());
|
||||
stepVo.setActualStart(new Date());
|
||||
OaProjectScheduleStepBo update = BeanUtil.toBean(stepVo, OaProjectScheduleStepBo.class);
|
||||
projectScheduleStepService.updateByBo(update);
|
||||
}else{
|
||||
// 将最后一步完成
|
||||
projectScheduleStepService.updateByStepAndScheduleId(bo.getCurrentStep(),bo.getScheduleId());
|
||||
// 2完成了全部进度,此时将此对象的status直接改为2代表完成了全部操作
|
||||
OaProjectScheduleStepVo stepVo = projectScheduleStepService.selectByCurrentStepAndScheduleId(bo.getCurrentStep(),bo.getScheduleId());
|
||||
OaProjectScheduleStepBo update = BeanUtil.toBean(stepVo, OaProjectScheduleStepBo.class);
|
||||
|
||||
@@ -1,13 +1,17 @@
|
||||
package com.ruoyi.oa.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.ruoyi.common.helper.LoginHelper;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.ruoyi.oa.domain.OaProjectSchedule;
|
||||
import com.ruoyi.oa.domain.bo.BatchBo;
|
||||
import com.ruoyi.oa.mapper.OaProjectScheduleMapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.oa.domain.bo.OaProjectScheduleStepBo;
|
||||
@@ -15,10 +19,9 @@ import com.ruoyi.oa.domain.vo.OaProjectScheduleStepVo;
|
||||
import com.ruoyi.oa.domain.OaProjectScheduleStep;
|
||||
import com.ruoyi.oa.mapper.OaProjectScheduleStepMapper;
|
||||
import com.ruoyi.oa.service.IOaProjectScheduleStepService;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 项目进度步骤跟踪Service业务层处理
|
||||
@@ -32,12 +35,14 @@ public class OaProjectScheduleStepServiceImpl implements IOaProjectScheduleStepS
|
||||
|
||||
private final OaProjectScheduleStepMapper baseMapper;
|
||||
|
||||
private final OaProjectScheduleMapper scheduleMapper;
|
||||
|
||||
/**
|
||||
* 查询项目进度步骤跟踪
|
||||
*/
|
||||
@Override
|
||||
public OaProjectScheduleStepVo queryById(Long trackId){
|
||||
return baseMapper.selectVoPlusById(trackId);
|
||||
return baseMapper.selectVoPlusById(trackId, LoginHelper.getUserId());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -46,7 +51,7 @@ public class OaProjectScheduleStepServiceImpl implements IOaProjectScheduleStepS
|
||||
@Override
|
||||
public TableDataInfo<OaProjectScheduleStepVo> queryPageList(OaProjectScheduleStepBo bo, PageQuery pageQuery) {
|
||||
QueryWrapper<OaProjectScheduleStep> lqw = buildQueryWrapper(bo);
|
||||
Page<OaProjectScheduleStepVo> result = baseMapper.selectVoPagePlus(pageQuery.build(), lqw);
|
||||
Page<OaProjectScheduleStepVo> result = baseMapper.selectVoPagePlus(pageQuery.build(), lqw,LoginHelper.getUserId());
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
@@ -62,6 +67,7 @@ public class OaProjectScheduleStepServiceImpl implements IOaProjectScheduleStepS
|
||||
private QueryWrapper<OaProjectScheduleStep> buildQueryWrapper(OaProjectScheduleStepBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
QueryWrapper<OaProjectScheduleStep> lqw = Wrappers.query();
|
||||
lqw.eq("opss.use_flag", 1);
|
||||
lqw.eq(bo.getScheduleId() != null, "opss.schedule_id", bo.getScheduleId());
|
||||
lqw.eq("opss.del_flag", 0);
|
||||
lqw.eq(bo.getStepOrder() != null, "opss.step_order", bo.getStepOrder());
|
||||
@@ -89,6 +95,8 @@ public class OaProjectScheduleStepServiceImpl implements IOaProjectScheduleStepS
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(OaProjectScheduleStepBo bo) {
|
||||
|
||||
// 除了做更新还需要编辑文件权限将涉及到的所有文件 都涉及到userId
|
||||
OaProjectScheduleStep update = BeanUtil.toBean(bo, OaProjectScheduleStep.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
@@ -127,4 +135,56 @@ public class OaProjectScheduleStepServiceImpl implements IOaProjectScheduleStepS
|
||||
public OaProjectScheduleStepVo selectByCurrentStepAndScheduleId(Long currentStep, Long scheduleId) {
|
||||
return baseMapper.selectByCurrentStepAndScheduleId(currentStep,scheduleId);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int changeBatch(BatchBo batchBo) {
|
||||
List<OaProjectScheduleStepBo> boList = batchBo.getBoList();
|
||||
OaProjectScheduleStepBo oaProjectScheduleStepBo = boList.get(0);
|
||||
LambdaQueryWrapper<OaProjectScheduleStep> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(OaProjectScheduleStep::getScheduleId, oaProjectScheduleStepBo.getScheduleId());
|
||||
wrapper.eq(OaProjectScheduleStep::getUseFlag, 1L);
|
||||
List<OaProjectScheduleStep> oaProjectScheduleSteps = baseMapper.selectList(wrapper);
|
||||
Long batchId = 1L;
|
||||
// 首先将上一批次的全部关闭
|
||||
for (OaProjectScheduleStep oaProjectScheduleStep : oaProjectScheduleSteps) {
|
||||
oaProjectScheduleStep.setUseFlag(0L);
|
||||
System.out.println(oaProjectScheduleStep);
|
||||
baseMapper.updateById(oaProjectScheduleStep);
|
||||
batchId = oaProjectScheduleStep.getBatchId();
|
||||
}
|
||||
|
||||
|
||||
OaProjectSchedule oaProjectSchedule = new OaProjectSchedule();
|
||||
oaProjectSchedule.setScheduleId(oaProjectScheduleStepBo.getScheduleId());
|
||||
oaProjectSchedule.setCurrentStep(batchBo.getCurrentStep());
|
||||
scheduleMapper.updateById(oaProjectSchedule);
|
||||
// 新批次进入
|
||||
int flag = 0;
|
||||
batchId = batchId+1;
|
||||
for (OaProjectScheduleStepBo projectScheduleStepBo : boList) {
|
||||
projectScheduleStepBo.setTrackId(null);
|
||||
projectScheduleStepBo.setUseFlag(1L);
|
||||
projectScheduleStepBo.setScheduleId(oaProjectScheduleStepBo.getScheduleId());
|
||||
projectScheduleStepBo.setBatchId(batchId);
|
||||
|
||||
// 将新增后的
|
||||
if (projectScheduleStepBo.getStepOrder()> batchBo.getCurrentStep()){
|
||||
projectScheduleStepBo.setActualStart(null);
|
||||
projectScheduleStepBo.setActualEnd(null);
|
||||
projectScheduleStepBo.setStatus(0L);
|
||||
}
|
||||
|
||||
// 将新增后的
|
||||
if (Objects.equals(projectScheduleStepBo.getStepOrder(), batchBo.getCurrentStep())){
|
||||
projectScheduleStepBo.setActualStart(new Date());
|
||||
projectScheduleStepBo.setActualEnd(null);
|
||||
projectScheduleStepBo.setStatus(0L);
|
||||
}
|
||||
this.insertByBo(projectScheduleStepBo);
|
||||
flag =1;
|
||||
}
|
||||
|
||||
return flag;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,13 +64,12 @@ public class OaScheduleTemplateStepServiceImpl implements IOaScheduleTemplateSte
|
||||
QueryWrapper<OaScheduleTemplateStep> lqw = Wrappers.query();
|
||||
|
||||
lqw.eq(bo.getTemplateId() != null, "template_id", bo.getTemplateId());
|
||||
|
||||
lqw.eq(bo.getStepOrder() != null, "step_order", bo.getStepOrder());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getStepName()), "step_name", bo.getStepName());
|
||||
lqw.eq(bo.getExpectedDays() != null,"expected_days", bo.getExpectedDays());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getHeader()), "header", bo.getHeader());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getDescription()), "description", bo.getDescription());
|
||||
lqw.groupBy("step_name","header","step_id");
|
||||
lqw.groupBy("step_name","header","expected_days","description");
|
||||
return lqw;
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.ruoyi.oa.domain.bo.SysOaClaimDetailBo;
|
||||
import com.ruoyi.oa.domain.bo.SysOaFileBo;
|
||||
import com.ruoyi.oa.service.ISysOaClaimDetailService;
|
||||
import com.ruoyi.oa.service.ISysOaFileService;
|
||||
import com.ruoyi.system.service.ISysOssService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -26,6 +26,7 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 差旅费报销Service业务层处理
|
||||
@@ -43,7 +44,8 @@ public class SysOaClaimServiceImpl implements ISysOaClaimService {
|
||||
private ISysOaClaimDetailService sysOaClaimDetailService;
|
||||
|
||||
@Autowired
|
||||
private ISysOaFileService sysOaFileService;
|
||||
private ISysOssService ossService;
|
||||
|
||||
|
||||
/**
|
||||
* 查询差旅费报销
|
||||
@@ -128,15 +130,8 @@ public class SysOaClaimServiceImpl implements ISysOaClaimService {
|
||||
validEntityBeforeSave(add);
|
||||
|
||||
// 处理文件
|
||||
List<Long> fileIds = new ArrayList<>();
|
||||
for (SysOaFileBo sysOaFile : bo.getFileList()) {
|
||||
Long fileId = sysOaFileService.insertByBoReturnId(sysOaFile);
|
||||
fileIds.add(fileId);
|
||||
}
|
||||
String fileIdsString = fileIds.stream()
|
||||
.map(String::valueOf) // 将 Long 转换为 String
|
||||
.reduce((id1, id2) -> id1 + "," + id2) // 合并为一个逗号分隔的字符串
|
||||
.orElse(""); // 如果列表为空,返回空字符串
|
||||
List<String> fileUrls = bo.getFileList().stream().map(SysOaFileBo::getFileUrl).collect(Collectors.toList());
|
||||
String fileIdsString = ossService.insertFiles(fileUrls);
|
||||
add.setFileIds(fileIdsString);
|
||||
add.setUserId(LoginHelper.getUserId());
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
|
||||
@@ -1,149 +0,0 @@
|
||||
package com.ruoyi.oa.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.oa.domain.bo.SysOaFileBo;
|
||||
import com.ruoyi.oa.domain.vo.SysOaFileVo;
|
||||
import com.ruoyi.oa.domain.SysOaFile;
|
||||
import com.ruoyi.oa.mapper.SysOaFileMapper;
|
||||
import com.ruoyi.oa.service.ISysOaFileService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 文件存储Service业务层处理
|
||||
*
|
||||
* @author hdka
|
||||
* @date 2024-12-15
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class SysOaFileServiceImpl implements ISysOaFileService {
|
||||
|
||||
private final SysOaFileMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询文件存储
|
||||
*/
|
||||
@Override
|
||||
public SysOaFileVo queryById(Long fileId){
|
||||
return baseMapper.selectVoById(fileId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询文件存储列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<SysOaFileVo> queryPageList(SysOaFileBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<SysOaFile> lqw = buildQueryWrapper(bo);
|
||||
Page<SysOaFileVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询文件存储列表
|
||||
*/
|
||||
@Override
|
||||
public List<SysOaFileVo> queryList(SysOaFileBo bo) {
|
||||
LambdaQueryWrapper<SysOaFile> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<SysOaFile> buildQueryWrapper(SysOaFileBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<SysOaFile> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getFileUrl()), SysOaFile::getFileUrl, bo.getFileUrl());
|
||||
lqw.eq(bo.getStatus() != null, SysOaFile::getStatus, bo.getStatus());
|
||||
lqw.like(bo.getQueryCreateTime() != null, SysOaFile::getCreateTime, bo.getQueryCreateTime());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增文件存储
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(SysOaFileBo bo) {
|
||||
SysOaFile add = BeanUtil.toBean(bo, SysOaFile.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setFileId(add.getFileId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增文件存储
|
||||
*/
|
||||
@Override
|
||||
public Long insertByBoReturnId(SysOaFileBo bo) {
|
||||
SysOaFile add = BeanUtil.toBean(bo, SysOaFile.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setFileId(add.getFileId());
|
||||
}
|
||||
return add.getFileId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String insertFiles(List<String> fileUrls) {
|
||||
// 用于存放插入后返回的 fileId
|
||||
List<Long> fileIds = fileUrls.stream().map(fileUrl -> {
|
||||
// 这里假设你有一个插入方法, 返回插入后的主键ID:
|
||||
// Long fileId = fileDao.insertFile(fileUrl);
|
||||
|
||||
// 这里只是示例,假设插入后自增ID就是某个数字:
|
||||
// 为演示,这里用当前时间戳模拟
|
||||
SysOaFile sysOaFile = new SysOaFile();
|
||||
sysOaFile.setFileUrl(fileUrl);
|
||||
baseMapper.insert(sysOaFile);
|
||||
|
||||
// 真实代码中应该返回数据库生成的主键ID
|
||||
return sysOaFile.getFileId();
|
||||
}).collect(Collectors.toList());
|
||||
// 将 fileIds 转为逗号分隔的字符串
|
||||
return fileIds.stream()
|
||||
.map(String::valueOf)
|
||||
.collect(Collectors.joining(","));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改文件存储
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(SysOaFileBo bo) {
|
||||
SysOaFile update = BeanUtil.toBean(bo, SysOaFile.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(SysOaFile entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除文件存储
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,7 @@ import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.ruoyi.oa.service.ISysOaFileService;
|
||||
import com.ruoyi.system.service.ISysOssService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.oa.domain.bo.SysOaTaskItemBo;
|
||||
@@ -33,7 +33,9 @@ public class SysOaTaskItemServiceImpl implements ISysOaTaskItemService {
|
||||
|
||||
private final SysOaTaskItemMapper baseMapper;
|
||||
|
||||
private final ISysOaFileService fileService;
|
||||
|
||||
|
||||
private final ISysOssService ossService;
|
||||
|
||||
/**
|
||||
* 查询报工任务单元
|
||||
@@ -133,7 +135,7 @@ public class SysOaTaskItemServiceImpl implements ISysOaTaskItemService {
|
||||
List<String> fileUrls = Arrays.stream(bo.getFiles().split(","))
|
||||
.map(String::valueOf)
|
||||
.collect(Collectors.toList());
|
||||
String fileIds = fileService.insertFiles(fileUrls);
|
||||
String fileIds = ossService.insertFiles(fileUrls);
|
||||
bo.setFiles(fileIds);
|
||||
}
|
||||
SysOaTaskItem update = BeanUtil.toBean(bo, SysOaTaskItem.class);
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
package com.ruoyi.oa.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.core.domain.entity.SysDictData;
|
||||
import com.ruoyi.common.helper.LoginHelper;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
@@ -14,9 +10,8 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.ruoyi.oa.domain.*;
|
||||
import com.ruoyi.oa.domain.bo.SysOaTaskItemBo;
|
||||
import com.ruoyi.oa.mapper.SysOaTaskItemMapper;
|
||||
import com.ruoyi.oa.service.ISysOaFileService;
|
||||
import com.ruoyi.oa.service.ISysOaTaskItemService;
|
||||
import com.ruoyi.system.service.ISysDictTypeService;
|
||||
import com.ruoyi.system.service.ISysOssService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -43,13 +38,11 @@ public class SysOaTaskServiceImpl implements ISysOaTaskService {
|
||||
|
||||
private final SysOaTaskMapper baseMapper;
|
||||
|
||||
private final ISysDictTypeService dictTypeService;
|
||||
|
||||
private final ISysOaTaskItemService taskItemService;
|
||||
|
||||
private final SysOaTaskItemMapper taskItemMapper;
|
||||
|
||||
private final ISysOaFileService fileService;
|
||||
private final ISysOssService ossService;
|
||||
|
||||
/**
|
||||
* 查询任务管理
|
||||
@@ -175,7 +168,7 @@ public class SysOaTaskServiceImpl implements ISysOaTaskService {
|
||||
List<String> fileUrls = Arrays.stream(bo.getAccessory().split(","))
|
||||
.map(String::valueOf)
|
||||
.collect(Collectors.toList());
|
||||
String fileIds = fileService.insertFiles(fileUrls);
|
||||
String fileIds = ossService.insertFiles(fileUrls);
|
||||
|
||||
bo.setAccessory(fileIds);
|
||||
}
|
||||
@@ -183,7 +176,7 @@ public class SysOaTaskServiceImpl implements ISysOaTaskService {
|
||||
List<String> fileUrls = Arrays.stream(bo.getFiles().split(","))
|
||||
.map(String::valueOf)
|
||||
.collect(Collectors.toList());
|
||||
String fileIds = fileService.insertFiles(fileUrls);
|
||||
String fileIds = ossService.insertFiles(fileUrls);
|
||||
|
||||
bo.setFiles(fileIds);
|
||||
}
|
||||
|
||||
@@ -137,18 +137,21 @@ public class SysOaWarehouseDetailServiceImpl implements ISysOaWarehouseDetailSer
|
||||
public Boolean insertByBo(SysOaWarehouseDetailBo bo) {
|
||||
SysOaWarehouseDetail decrease = toBean(bo, SysOaWarehouseDetail.class);
|
||||
validEntityBeforeSave(decrease);
|
||||
SysOaWarehouse warehouse = warehouseMapper.selectById(decrease.getWarehouseId());
|
||||
// 1 如果对应仓库表项目数量-将要出库数量<0,出库失败, 繁殖 , 增加该条
|
||||
if(warehouse == null) {
|
||||
throw new Error("已不存在该物料"+decrease.getWarehouseId());
|
||||
}
|
||||
if(warehouse.getInventory() - decrease.getAmount() < 0) {
|
||||
throw new Error("剩余数量不足,出库失败");
|
||||
}
|
||||
else {
|
||||
warehouse.setInventory(warehouse.getInventory() - decrease.getAmount());
|
||||
warehouse.setUpdateTime(new Date());
|
||||
warehouseMapper.updateById(warehouse);
|
||||
|
||||
if (!Objects.nonNull(bo.getType()) || bo.getType() != 1) {
|
||||
SysOaWarehouse warehouse = warehouseMapper.selectById(decrease.getWarehouseId());
|
||||
// 1 如果对应仓库表项目数量-将要出库数量<0,出库失败, 繁殖 , 增加该条
|
||||
if(warehouse == null) {
|
||||
throw new Error("已不存在该物料"+decrease.getWarehouseId());
|
||||
}
|
||||
if(warehouse.getInventory() - decrease.getAmount() < 0) {
|
||||
throw new Error("剩余数量不足,出库失败");
|
||||
}
|
||||
else {
|
||||
warehouse.setInventory(warehouse.getInventory() - decrease.getAmount());
|
||||
warehouse.setUpdateTime(new Date());
|
||||
warehouseMapper.updateById(warehouse);
|
||||
}
|
||||
}
|
||||
|
||||
// 2、减少仓库表中对应项目的数量
|
||||
|
||||
@@ -7,14 +7,12 @@ import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.ruoyi.oa.domain.SysOaWarehouseDetail;
|
||||
import com.ruoyi.oa.domain.bo.SysOaWarehouseBo;
|
||||
import com.ruoyi.oa.domain.bo.SysOaWarehouseDetailBo;
|
||||
import com.ruoyi.oa.mapper.SysOaWarehouseDetailMapper;
|
||||
import com.ruoyi.oa.service.ISysOaWarehouseDetailService;
|
||||
import com.ruoyi.oa.service.ISysOaWarehouseService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.oa.domain.bo.SysOaWarehouseMasterBo;
|
||||
@@ -40,7 +38,6 @@ public class SysOaWarehouseMasterServiceImpl implements ISysOaWarehouseMasterSer
|
||||
private final SysOaWarehouseMasterMapper baseMapper;
|
||||
|
||||
private final ISysOaWarehouseDetailService warehouseDetailService;
|
||||
private final SysOaWarehouseDetailMapper warehouseDetailMapper;
|
||||
|
||||
|
||||
|
||||
@@ -98,8 +95,7 @@ public class SysOaWarehouseMasterServiceImpl implements ISysOaWarehouseMasterSer
|
||||
// 单子新增后 新增出库元素同时减去现有的,这里要记录一个出库时单价
|
||||
for (SysOaWarehouseDetailBo sysOaWarehouseDetailBo : bo.getWarehouseList()) {
|
||||
sysOaWarehouseDetailBo.setMasterId(add.getMasterId());
|
||||
SysOaWarehouseDetail add2 = toBean(sysOaWarehouseDetailBo, SysOaWarehouseDetail.class);
|
||||
warehouseDetailMapper.insert(add2);
|
||||
warehouseDetailService.insertByBo(sysOaWarehouseDetailBo);
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
@@ -110,6 +106,7 @@ public class SysOaWarehouseMasterServiceImpl implements ISysOaWarehouseMasterSer
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(SysOaWarehouseMasterBo bo) {
|
||||
System.out.println(bo);
|
||||
// 判断是否为采购单,采购单,用户是直接点击完成按钮,所以直接更新单子状态就可以
|
||||
if (bo.getType()!=2L){
|
||||
SysOaWarehouseMaster update = BeanUtil.toBean(bo, SysOaWarehouseMaster.class);
|
||||
@@ -119,10 +116,12 @@ public class SysOaWarehouseMasterServiceImpl implements ISysOaWarehouseMasterSer
|
||||
List<SysOaWarehouseDetailBo> warehouseList = bo.getWarehouseList();
|
||||
for (SysOaWarehouseDetailBo sysOaWarehouseDetailBo : warehouseList) {
|
||||
sysOaWarehouseDetailBo.setMasterId(bo.getMasterId());
|
||||
sysOaWarehouseDetailBo.setType(bo.getType());
|
||||
warehouseDetailService.insertByBo(sysOaWarehouseDetailBo);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return flag;
|
||||
}else{
|
||||
SysOaWarehouseMaster update = BeanUtil.toBean(bo, SysOaWarehouseMaster.class);
|
||||
@@ -152,7 +151,7 @@ public class SysOaWarehouseMasterServiceImpl implements ISysOaWarehouseMasterSer
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertInWarehouse(SysOaWarehouseBo bo) {
|
||||
public int insertInWarehouse(SysOaWarehouseBo bo, Long id) {
|
||||
SysOaWarehouseMaster sysOaWarehouseMaster = new SysOaWarehouseMaster();
|
||||
sysOaWarehouseMaster.setMasterNum(UUID.randomUUID().toString());
|
||||
sysOaWarehouseMaster.setRemark(bo.getRemark());
|
||||
@@ -169,7 +168,10 @@ public class SysOaWarehouseMasterServiceImpl implements ISysOaWarehouseMasterSer
|
||||
sysOaWarehouseDetailBo.setCreateBy(LoginHelper.getNickName());
|
||||
sysOaWarehouseDetailBo.setUpdateBy(LoginHelper.getNickName());
|
||||
sysOaWarehouseDetailBo.setMasterId(sysOaWarehouseMaster.getMasterId());
|
||||
sysOaWarehouseDetailBo.setType(sysOaWarehouseMaster.getType());
|
||||
sysOaWarehouseDetailBo.setWarehouseId(id);
|
||||
warehouseDetailService.insertByBo(sysOaWarehouseDetailBo);
|
||||
|
||||
return flag;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,22 +2,18 @@ package com.ruoyi.oa.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.excel.ExcelResult;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.oa.domain.bo.SysOaWarehouseDetailBo;
|
||||
import com.ruoyi.oa.domain.bo.SysOaWarehouseMasterBo;
|
||||
import com.ruoyi.oa.listener.SysOaWarehouseListener;
|
||||
import com.ruoyi.oa.mapper.SysOaWarehouseDetailMapper;
|
||||
import com.ruoyi.oa.mapper.SysOaWarehouseMasterMapper;
|
||||
import com.ruoyi.oa.service.ISysOaWarehouseMasterService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.oa.domain.bo.SysOaWarehouseBo;
|
||||
import com.ruoyi.oa.domain.vo.SysOaWarehouseVo;
|
||||
@@ -33,6 +29,7 @@ import java.util.*;
|
||||
* @author liuzongkun999
|
||||
* @date 2024-11-02
|
||||
*/
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class SysOaWarehouseServiceImpl implements ISysOaWarehouseService {
|
||||
@@ -75,6 +72,7 @@ public class SysOaWarehouseServiceImpl implements ISysOaWarehouseService {
|
||||
.like(StringUtils.isNotBlank(bo.getName()), "sow.model", bo.getName());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getModel()), "sow.model", bo.getModel());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getBrand()), "sow.brand", bo.getBrand());
|
||||
lqw.eq("sow.del_flag", 0);
|
||||
if (b){
|
||||
lqw.apply("sow.inventory < sow.threshold");
|
||||
}else{
|
||||
@@ -141,7 +139,7 @@ public class SysOaWarehouseServiceImpl implements ISysOaWarehouseService {
|
||||
* 新增仓库管理
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(SysOaWarehouseBo bo) {
|
||||
public Long insertByBo(SysOaWarehouseBo bo) {
|
||||
SysOaWarehouse add = BeanUtil.toBean(bo, SysOaWarehouse.class);
|
||||
validEntityBeforeSave(add);
|
||||
// 1、查询仓库中是否有已存在项目
|
||||
@@ -150,17 +148,16 @@ public class SysOaWarehouseServiceImpl implements ISysOaWarehouseService {
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getModel()), SysOaWarehouse::getModel, bo.getModel());
|
||||
SysOaWarehouse select = baseMapper.selectOne(lqw);
|
||||
// 2、 无则直接新增项目 有则直接增加库存数量
|
||||
boolean flag;
|
||||
Long flag;
|
||||
if (select == null) {
|
||||
flag = baseMapper.insert(add) > 0;
|
||||
baseMapper.insert(add);
|
||||
flag = add.getId();
|
||||
} else {
|
||||
select.setInventory(select.getInventory() + bo.getInventory());
|
||||
select.setPrice((select.getPrice()*select.getInventory() + bo.getPrice()*bo.getInventory())/(select.getInventory()+bo.getInventory()));
|
||||
flag = baseMapper.updateById(select) > 0;
|
||||
}
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
flag = select.getId();
|
||||
}
|
||||
|
||||
return flag;
|
||||
}
|
||||
|
||||
@@ -175,12 +172,14 @@ public class SysOaWarehouseServiceImpl implements ISysOaWarehouseService {
|
||||
lqw.eq(SysOaWarehouse::getName, bo.getName());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getModel()), SysOaWarehouse::getModel, bo.getModel());
|
||||
SysOaWarehouse select = baseMapper.selectOne(lqw);
|
||||
System.out.println(select);
|
||||
// 2、 无则直接新增项目 有则直接增加库存数量
|
||||
if (select == null) {
|
||||
baseMapper.insert(add);
|
||||
return add.getId();
|
||||
} else {
|
||||
select.setInventory(select.getInventory() + bo.getInventory());
|
||||
System.out.println(select);
|
||||
select.setInventory(select.getInventory() + bo.getTaskInventory());
|
||||
select.setPrice((select.getPrice()*select.getInventory() + bo.getPrice()*bo.getInventory())/(select.getInventory()+bo.getInventory()));
|
||||
baseMapper.updateById(select);
|
||||
return select.getId();
|
||||
|
||||
@@ -0,0 +1,111 @@
|
||||
package com.ruoyi.oa.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.common.helper.LoginHelper;
|
||||
import com.ruoyi.oa.domain.SysOssAcl;
|
||||
import com.ruoyi.oa.domain.vo.SysUserVo;
|
||||
import com.ruoyi.oa.mapper.SysOssAclMapper;
|
||||
import com.ruoyi.oa.service.SysOssAclService;
|
||||
import com.ruoyi.system.domain.SysOss;
|
||||
import com.ruoyi.system.mapper.SysOssMapper;
|
||||
import com.ruoyi.system.mapper.SysUserMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
public class SysOssAclServiceImpl extends ServiceImpl<SysOssAclMapper, SysOssAcl> implements SysOssAclService {
|
||||
|
||||
|
||||
@Autowired
|
||||
private SysUserMapper userMapper;
|
||||
|
||||
@Autowired
|
||||
private SysOssMapper sysOssMapper;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void grant(Long ossId, Long userId, Long grantBy) {
|
||||
grantBy = LoginHelper.getUserId();
|
||||
SysOssAcl acl = lambdaQuery()
|
||||
.eq(SysOssAcl::getOssId, ossId)
|
||||
.eq(SysOssAcl::getUserId, userId)
|
||||
.one();
|
||||
|
||||
if (acl == null) {
|
||||
acl = new SysOssAcl();
|
||||
acl.setOssId(ossId);
|
||||
acl.setUserId(userId);
|
||||
acl.setGrantBy(grantBy);
|
||||
save(acl);
|
||||
} else {
|
||||
updateById(acl);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void revoke(Long ossId, Long userId) {
|
||||
lambdaUpdate()
|
||||
.eq(SysOssAcl::getOssId, ossId)
|
||||
.eq(SysOssAcl::getUserId, userId)
|
||||
.remove();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasPerm(Long userId, Long ossId) {
|
||||
SysOssAcl acl = lambdaQuery()
|
||||
.eq(SysOssAcl::getOssId, ossId)
|
||||
.eq(SysOssAcl::getUserId, userId)
|
||||
.one();
|
||||
return acl != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysUserVo> listUsersByOssId(Long ossId) {
|
||||
/* 1. 校验文件是否存在 / 是否已公开 */
|
||||
System.out.println(ossId);
|
||||
SysOss oss = sysOssMapper.selectById(ossId);
|
||||
if (oss == null) {
|
||||
throw new ServiceException("文件不存在");
|
||||
}
|
||||
if (oss.getIsPublic() == 1) {
|
||||
// 公开文件:直接返回空集(前端可用 isPublic 判断)
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
/* 2. 查询 ACL 获得已授权用户 ID */
|
||||
List<SysOssAcl> aclList = this.lambdaQuery()
|
||||
.eq(SysOssAcl::getOssId, ossId)
|
||||
.list();
|
||||
if (aclList.isEmpty()) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
List<Long> userIds = aclList.stream()
|
||||
.map(SysOssAcl::getUserId)
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
|
||||
/* 3. 批量查询用户表 */
|
||||
List<SysUser> users = userMapper.selectBatchIds(userIds);
|
||||
System.out.println(users);
|
||||
/* 4. 转成 DTO */
|
||||
return users.stream().map(u -> {
|
||||
SysUserVo dto = new SysUserVo();
|
||||
dto.setUserId(u.getUserId());
|
||||
dto.setNickName(u.getNickName());
|
||||
dto.setPhonenumber(u.getPhonenumber());
|
||||
// 若 SysUser 中已有 deptName,可直接取;否则自行拼装
|
||||
if (u.getDept() != null) {
|
||||
dto.setDept(u.getDept());
|
||||
}
|
||||
return dto;
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
@@ -22,57 +22,53 @@
|
||||
|
||||
|
||||
<select id="selectVoPagePlus" resultType="com.ruoyi.oa.domain.vo.OaProjectScheduleVo">
|
||||
SELECT
|
||||
ops.schedule_id,
|
||||
ops.project_id,
|
||||
ops.template_id,
|
||||
ops.current_step,
|
||||
opss.step_name AS currentStepName,
|
||||
ops.start_time,
|
||||
ops.end_time,
|
||||
ops.status,
|
||||
ops.remark,
|
||||
SELECT ops.schedule_id,
|
||||
ops.project_id,
|
||||
ops.template_id,
|
||||
ops.current_step,
|
||||
opss.step_name AS currentStepName,
|
||||
ops.start_time,
|
||||
ops.end_time,
|
||||
ops.status,
|
||||
ops.remark,
|
||||
|
||||
-- 项目信息
|
||||
op.project_id AS opProjectId,
|
||||
op.project_name,
|
||||
op.project_num,
|
||||
op.project_type,
|
||||
op.address,
|
||||
op.funds,
|
||||
op.functionary,
|
||||
op.begin_time,
|
||||
op.finish_time,
|
||||
op.introduction,
|
||||
op.project_grade,
|
||||
op.project_status,
|
||||
op.trade_type,
|
||||
op.pre_pay,
|
||||
opss.plan_end,
|
||||
/* ======================== 项目信息 ==================== */
|
||||
op.project_id AS opProjectId,
|
||||
op.project_name,
|
||||
op.project_num,
|
||||
op.project_type,
|
||||
op.address,
|
||||
op.funds,
|
||||
op.functionary,
|
||||
op.begin_time,
|
||||
op.finish_time,
|
||||
op.introduction,
|
||||
op.project_grade,
|
||||
op.project_status,
|
||||
op.trade_type,
|
||||
op.pre_pay,
|
||||
opss.plan_end,
|
||||
TIMESTAMPDIFF(DAY, NOW(), opss.plan_end) AS remainTime,
|
||||
ROUND(
|
||||
(
|
||||
(ops.current_step - CASE WHEN opss.status = 0 THEN 1 ELSE 0 END)
|
||||
/ NULLIF(maxs.max_order, 0)
|
||||
) * 100,
|
||||
2
|
||||
) AS schedulePercentage
|
||||
|
||||
-- 剩余天数
|
||||
TIMESTAMPDIFF(DAY, NOW(), opss.plan_end) AS remainTime,
|
||||
|
||||
-- 进度百分比:当 current_step=1 时强制为0,否则按公式计算
|
||||
CASE
|
||||
WHEN ops.current_step = 1 THEN 0
|
||||
ELSE ROUND((ops.current_step / NULLIF(maxs.max_order,0)) * 100, 2)
|
||||
END AS schedulePercentage -- 添加 NULLIF 防止除以0
|
||||
|
||||
FROM oa_project_schedule ops
|
||||
LEFT JOIN sys_oa_project op ON ops.project_id = op.project_id
|
||||
LEFT JOIN oa_project_schedule_step opss
|
||||
FROM oa_project_schedule AS ops
|
||||
LEFT JOIN sys_oa_project AS op ON ops.project_id = op.project_id
|
||||
LEFT JOIN oa_project_schedule_step AS opss
|
||||
ON ops.schedule_id = opss.schedule_id
|
||||
AND opss.step_order = ops.current_step
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
schedule_id,
|
||||
MAX(step_order) AS max_order
|
||||
FROM oa_project_schedule_step
|
||||
GROUP BY schedule_id
|
||||
) maxs ON maxs.schedule_id = ops.schedule_id
|
||||
AND opss.use_flag = '1'
|
||||
LEFT JOIN (SELECT schedule_id,
|
||||
MAX(step_order) AS max_order
|
||||
FROM oa_project_schedule_step
|
||||
WHERE use_flag = '1'
|
||||
GROUP BY schedule_id) AS maxs ON maxs.schedule_id = ops.schedule_id
|
||||
${ew.getCustomSqlSegment}
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
@@ -20,17 +20,29 @@
|
||||
<result property="actualEnd" column="actual_end"/>
|
||||
<result property="status" column="status"/>
|
||||
<result property="expectedDays" column="expected_days"/>
|
||||
<result property="useFlag" column="use_flag"/>
|
||||
|
||||
<!-- ========== 附件列表:多对一 折叠 ========= -->
|
||||
<collection property="fileList"
|
||||
ofType="com.ruoyi.system.domain.SysOss"
|
||||
javaType="java.util.ArrayList">
|
||||
<result property="ossId" column="attach_oss_id"/>
|
||||
<result property="ossId" column="oss_id"/>
|
||||
<result property="url" column="attach_url"/>
|
||||
<result property="fileName" column="attach_file_name"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="isPublic" column="is_public"/>
|
||||
<result property="ownerId" column="owner_id"/>
|
||||
</collection>
|
||||
</resultMap>
|
||||
|
||||
<sql id="OssVisibleCondition">
|
||||
( so.is_public = 1
|
||||
OR so.owner_id = #{userId}
|
||||
OR EXISTS (SELECT 1 FROM sys_oss_acl a
|
||||
WHERE a.oss_id = so.oss_id
|
||||
AND a.user_id = #{userId}) )
|
||||
</sql>
|
||||
|
||||
<update id="updateByStepAndScheduleId">
|
||||
UPDATE oa_project_schedule_step
|
||||
SET
|
||||
@@ -40,6 +52,7 @@
|
||||
schedule_id = #{scheduleId}
|
||||
AND step_order = #{currentStep}
|
||||
AND del_flag = '0'
|
||||
and use_flag = '1'
|
||||
</update>
|
||||
<select id="maxStepByScheduleId" resultMap="OaProjectScheduleStepResult">
|
||||
SELECT opss.track_id,
|
||||
@@ -54,6 +67,7 @@
|
||||
opss.status,
|
||||
opss.del_flag,
|
||||
opss.header,
|
||||
opss.use_flag,
|
||||
osts.expected_days,
|
||||
osts.description
|
||||
FROM oa_project_schedule_step opss
|
||||
@@ -61,12 +75,15 @@
|
||||
LEFT JOIN fad_oa.oa_schedule_template_step osts ON osts.template_id = ops.template_id AND osts.step_order = opss.step_order
|
||||
WHERE opss.schedule_id = #{scheduleId}
|
||||
AND opss.del_flag = '0'
|
||||
and opss.use_flag = '1'
|
||||
AND opss.step_order = (
|
||||
SELECT MAX(step_order)
|
||||
FROM oa_project_schedule_step
|
||||
WHERE schedule_id = #{scheduleId}
|
||||
AND del_flag = '0'
|
||||
and use_flag = '1'
|
||||
)
|
||||
|
||||
</select>
|
||||
<select id="selectVoPagePlus" resultMap="OaProjectScheduleStepResult">
|
||||
select opss.track_id,
|
||||
@@ -81,42 +98,53 @@
|
||||
opss.status,
|
||||
opss.del_flag,
|
||||
opss.header,
|
||||
opss.use_flag,
|
||||
osts.expected_days,
|
||||
osts.description,
|
||||
so.oss_id AS oss_id,
|
||||
so.url AS attach_url,
|
||||
so.original_name AS attach_file_name, -- 如有需要
|
||||
so.create_by
|
||||
so.create_by,
|
||||
so.is_public,
|
||||
so.owner_id,
|
||||
batch_id
|
||||
from oa_project_schedule_step opss
|
||||
left join fad_oa.oa_project_schedule ops on ops.schedule_id = opss.schedule_id
|
||||
left join fad_oa.oa_schedule_template_step osts on osts.template_id = ops.template_id and osts.step_order = opss.step_order
|
||||
LEFT JOIN sys_oss so ON FIND_IN_SET(so.oss_id, opss.accessory)
|
||||
LEFT JOIN sys_oss so ON FIND_IN_SET(so.oss_id, opss.accessory)
|
||||
AND <include refid="OssVisibleCondition"/>
|
||||
${ew.getCustomSqlSegment}
|
||||
</select>
|
||||
<select id="selectVoPlusById" resultMap="OaProjectScheduleStepResult">
|
||||
select opss.track_id,
|
||||
opss.accessory,
|
||||
opss.schedule_id,
|
||||
opss.step_order,
|
||||
opss.step_name,
|
||||
opss.plan_start,
|
||||
opss.plan_end,
|
||||
opss.actual_start,
|
||||
opss.actual_end,
|
||||
opss.status,
|
||||
opss.del_flag,
|
||||
opss.header,
|
||||
osts.expected_days,
|
||||
osts.description,
|
||||
so.oss_id AS oss_id,
|
||||
so.url AS attach_url,
|
||||
so.original_name AS attach_file_name, -- 如有需要
|
||||
so.create_by
|
||||
opss.accessory,
|
||||
opss.schedule_id,
|
||||
opss.step_order,
|
||||
opss.step_name,
|
||||
opss.plan_start,
|
||||
opss.plan_end,
|
||||
opss.actual_start,
|
||||
opss.actual_end,
|
||||
opss.status,
|
||||
opss.use_flag,
|
||||
opss.del_flag,
|
||||
opss.header,
|
||||
osts.expected_days,
|
||||
osts.description,
|
||||
so.oss_id AS oss_id,
|
||||
so.url AS attach_url,
|
||||
so.original_name AS attach_file_name, -- 如有需要
|
||||
so.create_by,
|
||||
so.owner_id,
|
||||
so.is_public
|
||||
from oa_project_schedule_step opss
|
||||
left join fad_oa.oa_project_schedule ops on ops.schedule_id = opss.schedule_id
|
||||
left join fad_oa.oa_schedule_template_step osts on osts.template_id = ops.template_id and osts.step_order = opss.step_order
|
||||
LEFT JOIN sys_oss so ON FIND_IN_SET(so.oss_id, opss.accessory)
|
||||
where opss.track_id = #{trackId} and opss.del_flag='0'
|
||||
left join fad_oa.oa_project_schedule ops on ops.schedule_id = opss.schedule_id
|
||||
left join fad_oa.oa_schedule_template_step osts on osts.template_id = ops.template_id and osts.step_order =
|
||||
opss.step_order
|
||||
LEFT JOIN sys_oss so ON FIND_IN_SET(so.oss_id, opss.accessory)
|
||||
AND
|
||||
<include refid="OssVisibleCondition"/>
|
||||
where opss.track_id = #{trackId} and opss.del_flag='0' and opss.use_flag = '1'
|
||||
</select>
|
||||
|
||||
|
||||
@@ -130,11 +158,13 @@
|
||||
plan_end,
|
||||
actual_start,
|
||||
actual_end,
|
||||
opss.use_flag,
|
||||
status,
|
||||
header
|
||||
from oa_project_schedule_step opss
|
||||
WHERE schedule_id = #{scheduleId}
|
||||
AND step_order = #{currentStep}
|
||||
and use_flag = '1'
|
||||
AND del_flag = '0'
|
||||
</select>
|
||||
|
||||
|
||||
@@ -20,17 +20,12 @@
|
||||
</resultMap>
|
||||
<select id="selectVoPagePlus" resultType="com.ruoyi.oa.domain.vo.OaScheduleTemplateStepVo">
|
||||
|
||||
select ANY_VALUE(step_id),
|
||||
template_id,
|
||||
step_order,
|
||||
select max(step_id) as stepId,
|
||||
max(template_id) as templateId,
|
||||
max(step_order) as stepOrder,
|
||||
step_name,
|
||||
expected_days,
|
||||
header,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time,
|
||||
del_flag,
|
||||
description
|
||||
from oa_schedule_template_step
|
||||
${ew.getCustomSqlSegment}
|
||||
|
||||
@@ -26,7 +26,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="projectName" column="project_name"/>
|
||||
<result property="address" column="address"/>
|
||||
<collection property="detailList" javaType="list" resultMap="SysOaClaimDetailResult"/>
|
||||
<collection property="fileList" javaType="list" resultMap="SysOaFileResult"/>
|
||||
<collection property="fileList" javaType="list" resultMap="SysOssResult"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap type="com.ruoyi.oa.domain.SysOaClaimDetail" id="SysOaClaimDetailResult">
|
||||
@@ -42,16 +42,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</resultMap>
|
||||
|
||||
|
||||
<resultMap type="com.ruoyi.oa.domain.SysOaFile" id="SysOaFileResult">
|
||||
<result property="fileId" column="file_id"/>
|
||||
<result property="fileUrl" column="file_url"/>
|
||||
<result property="status" column="status"/>
|
||||
<resultMap type="com.ruoyi.system.domain.SysOss" id="SysOssResult">
|
||||
<result property="ossId" column="oss_id"/>
|
||||
<result property="url" column="file_url"/>
|
||||
<result property="fileName" column="file_name"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="remark" column="remark"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="selectSysOaClaimVoById" resultMap="SysOaClaimResult" parameterType="Long">
|
||||
@@ -73,9 +71,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
soc.del_flag,
|
||||
soc.proc_ins_id,
|
||||
soc.completed_time,
|
||||
sof.file_id,
|
||||
file_url,
|
||||
status,
|
||||
so.oss_id,
|
||||
url,
|
||||
so.file_name,
|
||||
socd.claim_detail_id,
|
||||
claim_type,
|
||||
socd.begin_time ,
|
||||
@@ -93,7 +91,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
sop.project_name
|
||||
FROM sys_oa_claim soc
|
||||
left join sys_oa_claim_detail socd on soc.claim_id = socd.claim_id
|
||||
left JOIN sys_oa_file sof ON FIND_IN_SET(sof.file_id, soc.file_ids) > 0
|
||||
left join sys_oss so on FIND_IN_SET(so.oss_id, soc.file_ids) > 0
|
||||
left join sys_oa_project sop on soc.project_id = sop.project_id
|
||||
where soc.claim_id = #{claimId}
|
||||
</select>
|
||||
@@ -144,9 +142,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
soc.del_flag,
|
||||
soc.proc_ins_id,
|
||||
soc.completed_time,
|
||||
sof.file_id,
|
||||
file_url,
|
||||
status,
|
||||
so.oss_id,
|
||||
url,
|
||||
so.file_name,
|
||||
socd.claim_detail_id,
|
||||
claim_type,
|
||||
socd.begin_time ,
|
||||
@@ -164,7 +162,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
sop.project_name
|
||||
FROM sys_oa_claim soc
|
||||
left join sys_oa_claim_detail socd on soc.claim_id = socd.claim_id
|
||||
left JOIN sys_oa_file sof ON FIND_IN_SET(sof.file_id, soc.file_ids) > 0
|
||||
left join sys_oss so on FIND_IN_SET(so.oss_id, soc.file_ids) > 0
|
||||
left join sys_oa_project sop on soc.project_id = sop.project_id
|
||||
where soc.proc_ins_id = #{procInsId}
|
||||
</select>
|
||||
|
||||
@@ -356,7 +356,7 @@
|
||||
end AS sign_time,
|
||||
|
||||
GROUP_CONCAT(
|
||||
f.file_url
|
||||
so.url
|
||||
SEPARATOR ','
|
||||
) AS file_urls
|
||||
|
||||
@@ -373,11 +373,11 @@
|
||||
LEFT JOIN sys_oa_task_item ti
|
||||
ON t.task_id = ti.task_id
|
||||
|
||||
LEFT JOIN sys_oa_file f
|
||||
LEFT JOIN sys_oss so
|
||||
ON (
|
||||
(t.status = 0 AND FIND_IN_SET(CONCAT(f.file_id, ''), t.files) > 0)
|
||||
(t.status = 0 AND FIND_IN_SET(CONCAT(so.oss_id, ''), t.files) > 0)
|
||||
OR
|
||||
(t.status = 1 AND FIND_IN_SET(CONCAT(f.file_id, ''), ti.files) > 0)
|
||||
(t.status = 1 AND FIND_IN_SET(CONCAT(so.oss_id, ''), ti.files) > 0)
|
||||
)
|
||||
${ew.getCustomSqlSegment}
|
||||
</select>
|
||||
|
||||
@@ -62,9 +62,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
sot.completed_time,
|
||||
sot.content,
|
||||
(
|
||||
SELECT GROUP_CONCAT(sof.file_url SEPARATOR ',')
|
||||
FROM sys_oa_file sof
|
||||
WHERE FIND_IN_SET(sof.file_id, sot.accessory) > 0
|
||||
SELECT GROUP_CONCAT(so.url SEPARATOR ',')
|
||||
FROM sys_oss so
|
||||
WHERE FIND_IN_SET(so.oss_id, sot.accessory) > 0
|
||||
) AS accessory,
|
||||
|
||||
sot.rank_number,
|
||||
@@ -90,9 +90,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
ELSE 0
|
||||
END AS overDays,
|
||||
(
|
||||
SELECT GROUP_CONCAT(sof.file_url SEPARATOR ',')
|
||||
FROM sys_oa_file sof
|
||||
WHERE FIND_IN_SET(sof.file_id, soti.files) > 0
|
||||
|
||||
SELECT GROUP_CONCAT(so.url SEPARATOR ',')
|
||||
FROM sys_oss so
|
||||
WHERE FIND_IN_SET(so.oss_id, soti.files) > 0
|
||||
) AS files
|
||||
|
||||
FROM sys_oa_task sot
|
||||
@@ -148,9 +149,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
su2.nick_name AS workerNickName,
|
||||
|
||||
(
|
||||
SELECT GROUP_CONCAT(sof.file_url SEPARATOR ',')
|
||||
FROM sys_oa_file sof
|
||||
WHERE FIND_IN_SET(sof.file_id, sot.accessory) > 0
|
||||
SELECT GROUP_CONCAT(so.url SEPARATOR ',')
|
||||
FROM sys_oss so
|
||||
WHERE FIND_IN_SET(so.oss_id, sot.accessory) > 0
|
||||
) AS accessory,
|
||||
|
||||
sot.rank_number,
|
||||
@@ -177,9 +178,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
soti.end_time AS itemEndTime,
|
||||
soti.remark AS itemRemark,
|
||||
(
|
||||
SELECT GROUP_CONCAT(sof.file_url SEPARATOR ',')
|
||||
FROM sys_oa_file sof
|
||||
WHERE FIND_IN_SET(sof.file_id, soti.files) > 0
|
||||
SELECT GROUP_CONCAT(so.url SEPARATOR ',')
|
||||
FROM sys_oss so
|
||||
WHERE FIND_IN_SET(so.oss_id, soti.files) > 0
|
||||
) AS files,
|
||||
CASE
|
||||
WHEN sot.completed_time IS NULL
|
||||
@@ -325,9 +326,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
sot.completed_time,
|
||||
sot.content,
|
||||
(
|
||||
SELECT GROUP_CONCAT(sof.file_url SEPARATOR ',')
|
||||
FROM sys_oa_file sof
|
||||
WHERE FIND_IN_SET(sof.file_id, sot.accessory) > 0
|
||||
SELECT GROUP_CONCAT(so.url SEPARATOR ',')
|
||||
FROM sys_oss so
|
||||
WHERE FIND_IN_SET(so.oss_id, sot.accessory) > 0
|
||||
) AS accessory,
|
||||
|
||||
sot.rank_number,
|
||||
@@ -353,9 +354,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
ELSE 0
|
||||
END AS overDays,
|
||||
(
|
||||
SELECT GROUP_CONCAT(sof.file_url SEPARATOR ',')
|
||||
FROM sys_oa_file sof
|
||||
WHERE FIND_IN_SET(sof.file_id, soti.files) > 0
|
||||
SELECT GROUP_CONCAT(so.url SEPARATOR ',')
|
||||
FROM sys_oss so
|
||||
WHERE FIND_IN_SET(so.oss_id, soti.files) > 0
|
||||
) AS files
|
||||
|
||||
FROM sys_oa_task_user sotu
|
||||
@@ -378,16 +379,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
sot.create_user_id,
|
||||
sot.worker_id,
|
||||
(
|
||||
SELECT GROUP_CONCAT(sof.file_url SEPARATOR ',')
|
||||
FROM sys_oa_file sof
|
||||
WHERE FIND_IN_SET(sof.file_id, sot.accessory) > 0
|
||||
SELECT GROUP_CONCAT(so.url SEPARATOR ',')
|
||||
FROM sys_oss so
|
||||
WHERE FIND_IN_SET(so.oss_id, sot.accessory) > 0
|
||||
) AS accessory,
|
||||
su1.nick_name AS createUserNickName,
|
||||
su2.nick_name AS workerNickName,
|
||||
(
|
||||
SELECT GROUP_CONCAT(sof.file_url SEPARATOR ',')
|
||||
FROM sys_oa_file sof
|
||||
WHERE FIND_IN_SET(sof.file_id, soti.files) > 0
|
||||
SELECT GROUP_CONCAT(so.url SEPARATOR ',')
|
||||
FROM sys_oss so
|
||||
WHERE FIND_IN_SET(so.oss_id, soti.files) > 0
|
||||
) AS files
|
||||
FROM sys_oa_task sot
|
||||
LEFT JOIN sys_user su1 ON su1.user_id = sot.create_user_id
|
||||
@@ -399,14 +400,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
AND sot.del_flag = '0'
|
||||
AND (
|
||||
IFNULL((
|
||||
SELECT GROUP_CONCAT(sof.file_url SEPARATOR ',')
|
||||
FROM sys_oa_file sof
|
||||
WHERE FIND_IN_SET(sof.file_id, sot.accessory) > 0
|
||||
SELECT GROUP_CONCAT(so.url SEPARATOR ',')
|
||||
FROM sys_oss so
|
||||
WHERE FIND_IN_SET(so.oss_id, sot.accessory) > 0
|
||||
), '') != ''
|
||||
OR IFNULL((
|
||||
SELECT GROUP_CONCAT(sof.file_url SEPARATOR ',')
|
||||
FROM sys_oa_file sof
|
||||
WHERE FIND_IN_SET(sof.file_id, soti.files) > 0
|
||||
SELECT GROUP_CONCAT(so.url SEPARATOR ',')
|
||||
FROM sys_oss so
|
||||
WHERE FIND_IN_SET(so.oss_id, soti.files) > 0
|
||||
), '') != ''
|
||||
)
|
||||
|
||||
|
||||
@@ -106,4 +106,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -4,69 +4,101 @@
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.oa.mapper.SysOaWarehouseMasterMapper">
|
||||
|
||||
<resultMap type="com.ruoyi.oa.domain.vo.SysOaWarehouseMasterVo" id="SysOaWarehouseMasterResult">
|
||||
<result property="masterId" column="master_id"/>
|
||||
<result property="masterNum" column="master_num"/>
|
||||
<result property="type" column="type"/>
|
||||
<result property="projectId" column="project_id"/>
|
||||
<result property="signTime" column="sign_time"/>
|
||||
<result property="signUser" column="sign_user"/>
|
||||
<result property="remark" column="remark"/>
|
||||
|
||||
<!-- ===================================================== -->
|
||||
<!-- 主表 + 子表 统一 ResultMap -->
|
||||
<!-- ===================================================== -->
|
||||
<resultMap id="SysOaWarehouseMasterResult"
|
||||
type="com.ruoyi.oa.domain.vo.SysOaWarehouseMasterVo">
|
||||
|
||||
<id property="masterId" column="master_id"/>
|
||||
<result property="masterNum" column="master_num"/>
|
||||
<result property="type" column="type"/>
|
||||
<result property="projectId" column="project_id"/>
|
||||
<result property="signTime" column="sign_time"/>
|
||||
<result property="signUser" column="sign_user"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="projectName" column="project_name"/>
|
||||
<result property="status" column="status"/>
|
||||
<collection property="warehouseList" ofType="com.ruoyi.oa.domain.vo.SysOaWarehouseDetailVo" javaType="list">
|
||||
<result property="signPrice" column="sign_price"/>
|
||||
<result property="id" column="outId"/>
|
||||
<result property="projectName" column="project_name"/>
|
||||
<result property="model" column="model"/>
|
||||
<result property="specifications" column="specifications"/>
|
||||
<result property="projectId" column="project_id"/>
|
||||
<result property="amount" column="amount"/>
|
||||
<result property="warehouseName" column="warehouseName"/>
|
||||
</collection>
|
||||
<collection property="warehouseTaskList" resultMap="SysOaWarehouseTaskResult" javaType="list"/>
|
||||
<result property="status" column="status"/>
|
||||
|
||||
<collection property="warehouseList"
|
||||
column="master_id"
|
||||
javaType="list"
|
||||
ofType="com.ruoyi.oa.domain.vo.SysOaWarehouseDetailVo"
|
||||
select="selectDetailByMasterId"/>
|
||||
|
||||
<collection property="warehouseTaskList"
|
||||
column="master_id"
|
||||
javaType="list"
|
||||
ofType="com.ruoyi.oa.domain.SysOaWarehouseTask"
|
||||
select="selectTaskByMasterId"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
<resultMap type="com.ruoyi.oa.domain.SysOaWarehouseTask" id="SysOaWarehouseTaskResult">
|
||||
<result property="taskId" column="task_id"/>
|
||||
<result property="masterId" column="master_id"/>
|
||||
<result property="name" column="name"/>
|
||||
<result property="model" column="model"/>
|
||||
<result property="taskInventory" column="task_inventory"/>
|
||||
<result property="brand" column="brand"/>
|
||||
<result property="specifications" column="specifications"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
|
||||
<select id="selectVoPagePlus" resultMap="SysOaWarehouseMasterResult">
|
||||
select sowm.master_id,
|
||||
sowm.sign_time,
|
||||
sowm.sign_user,
|
||||
sowd.sign_price,
|
||||
sowm.master_num,
|
||||
sowm.type,
|
||||
sowd.amount,
|
||||
sow.name as warehouseName,
|
||||
sowm.remark,
|
||||
sop.project_id,
|
||||
sop.project_name,
|
||||
sowm.status,
|
||||
sowd.id as outId,
|
||||
task_id,
|
||||
sowt.name,
|
||||
COALESCE(sow.model,sowt.model) as model,
|
||||
task_inventory,
|
||||
COALESCE(sow.brand,sowt.brand) as brand,
|
||||
COALESCE(sow.specifications,sowt.specifications) as specifications
|
||||
from sys_oa_warehouse_master sowm
|
||||
left join sys_oa_warehouse_detail sowd on sowd.master_id = sowm.master_id and sowd.del_flag='0'
|
||||
left join sys_oa_warehouse sow on sow.id = sowd.warehouse_id
|
||||
left join sys_oa_warehouse_task sowt on sowm.master_id = sowt.master_id
|
||||
left join sys_oa_project sop on sowm.project_id = sop.project_id
|
||||
<!-- ===================================================== -->
|
||||
<!-- 分页查询(只查主表字段,真正参与 LIMIT / OFFSET) -->
|
||||
<!-- ===================================================== -->
|
||||
<select id="selectVoPagePlus"
|
||||
resultMap="SysOaWarehouseMasterResult">
|
||||
SELECT
|
||||
sowm.master_id,
|
||||
sowm.master_num,
|
||||
sowm.type,
|
||||
sowm.project_id,
|
||||
sowm.sign_time,
|
||||
sowm.sign_user,
|
||||
sowm.remark,
|
||||
sowm.status,
|
||||
sop.project_name
|
||||
FROM sys_oa_warehouse_master sowm
|
||||
LEFT JOIN sys_oa_project sop
|
||||
ON sop.project_id = sowm.project_id
|
||||
${ew.getCustomSqlSegment}
|
||||
</select>
|
||||
|
||||
<!-- ===================================================== -->
|
||||
<!-- 子查询:明细列表 by masterId -->
|
||||
<!-- ===================================================== -->
|
||||
<select id="selectDetailByMasterId"
|
||||
parameterType="long"
|
||||
resultType="com.ruoyi.oa.domain.vo.SysOaWarehouseDetailVo">
|
||||
SELECT
|
||||
sowd.id AS outId,
|
||||
sowd.master_id,
|
||||
sowd.sign_price,
|
||||
sowd.amount,
|
||||
sowd.project_id,
|
||||
sow.name AS warehouseName,
|
||||
COALESCE(sow.model, sowt.model) AS model,
|
||||
COALESCE(sow.brand, sowt.brand) AS brand,
|
||||
COALESCE(sow.specifications, sowt.specifications) AS specifications,
|
||||
sowt.task_inventory,
|
||||
sop.project_name
|
||||
FROM sys_oa_warehouse_detail sowd
|
||||
LEFT JOIN sys_oa_warehouse sow ON sow.id = sowd.warehouse_id
|
||||
LEFT JOIN sys_oa_warehouse_task sowt ON sowt.master_id = sowd.master_id
|
||||
LEFT JOIN sys_oa_project sop ON sop.project_id = sowd.project_id
|
||||
WHERE sowd.del_flag = '0'
|
||||
AND sowd.master_id = #{masterId}
|
||||
ORDER BY sowd.id
|
||||
</select>
|
||||
|
||||
<!-- ===================================================== -->
|
||||
<!-- 子查询:任务列表 by masterId -->
|
||||
<!-- ===================================================== -->
|
||||
<select id="selectTaskByMasterId"
|
||||
parameterType="long"
|
||||
resultType="com.ruoyi.oa.domain.SysOaWarehouseTask">
|
||||
SELECT
|
||||
task_id,
|
||||
master_id,
|
||||
name,
|
||||
model,
|
||||
task_inventory,
|
||||
brand,
|
||||
specifications
|
||||
FROM sys_oa_warehouse_task
|
||||
WHERE master_id = #{masterId}
|
||||
ORDER BY task_id
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user