OA流程
备用金、报销逻辑修改
This commit is contained in:
parent
cdb3fe978b
commit
ee28419e4e
@ -36,7 +36,6 @@ public class BpmOAContractController {
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建请求申请")
|
||||
public CommonResult<Long> createContract(@Valid @RequestBody BpmOAContractCreateReqVO createReqVO) {
|
||||
|
||||
return success(contractService.createContract(getLoginUserId(), createReqVO));
|
||||
}
|
||||
|
||||
|
@ -60,4 +60,15 @@ public class BpmOAImprestController {
|
||||
|
||||
return success(BpmOAImprestConvert.INSTANCE.convert(imprest));
|
||||
}
|
||||
|
||||
@GetMapping("/getProcessInstanceId")
|
||||
@Operation(summary = "获得备用金表单")
|
||||
@Parameter(name = "reimbursementId", description = "编号", required = true, example = "1024")
|
||||
public CommonResult<BpmOAImprestRespVO> getImprestByReimbursementId(@RequestParam("reimbursementId") Long reimbursementId) {
|
||||
|
||||
//根据user 查询审批通过并且未报销得表单。
|
||||
BpmOAImprestDO imprest = imprestService.getImprestByReimbursementId(reimbursementId);
|
||||
|
||||
return success(BpmOAImprestConvert.INSTANCE.convert(imprest));
|
||||
}
|
||||
}
|
||||
|
@ -6,6 +6,9 @@ import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.shiftjobs.BpmOAShiftjo
|
||||
import cn.iocoder.yudao.module.bpm.convert.oa.BpmOAShiftjobsConvert;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAShiftjobsDO;
|
||||
import cn.iocoder.yudao.module.bpm.service.oa.BpmOAShiftjobsService;
|
||||
import cn.iocoder.yudao.module.system.api.dept.DeptApi;
|
||||
import cn.iocoder.yudao.module.system.api.dept.PostApi;
|
||||
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
@ -33,6 +36,15 @@ public class BpmOAShiftjobsController {
|
||||
@Resource
|
||||
private BpmOAShiftjobsService shiftjobsService;
|
||||
|
||||
@Resource
|
||||
private DeptApi deptApi;
|
||||
|
||||
@Resource
|
||||
private AdminUserApi userApi;
|
||||
|
||||
@Resource
|
||||
private PostApi postApi;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建请求申请")
|
||||
public CommonResult<Long> createShiftjobs(@Valid @RequestBody BpmOAShiftjobsCreateReqVO createReqVO) {
|
||||
@ -47,6 +59,22 @@ public class BpmOAShiftjobsController {
|
||||
|
||||
BpmOAShiftjobsDO shiftjobs = shiftjobsService.getShiftjobs(id);
|
||||
|
||||
return success(BpmOAShiftjobsConvert.INSTANCE.convert(shiftjobs));
|
||||
BpmOAShiftjobsRespVO bpmOAShiftjobsRespVO = BpmOAShiftjobsConvert.INSTANCE.convert(shiftjobs);
|
||||
//设置原部门名称
|
||||
bpmOAShiftjobsRespVO.setOldDeptName(deptApi.getDept(shiftjobs.getOldDeptId()).getCheckedData().getName());
|
||||
//设置原岗位名称
|
||||
bpmOAShiftjobsRespVO.setOldPostName(postApi.getPost(shiftjobs.getOldPostId()).getCheckedData().getName());
|
||||
//设置原负责人昵称
|
||||
bpmOAShiftjobsRespVO.setOldParentName(userApi.getUser(shiftjobs.getOldParentId()).getCheckedData().getNickname());
|
||||
|
||||
//设置新部门名称
|
||||
bpmOAShiftjobsRespVO.setNewDeptName(deptApi.getDept(shiftjobs.getNewDeptId()).getCheckedData().getName());
|
||||
//设置新岗位名称
|
||||
bpmOAShiftjobsRespVO.setNewPostName(postApi.getPost(shiftjobs.getNewPostId()).getCheckedData().getName());
|
||||
//设置新负责人昵称
|
||||
bpmOAShiftjobsRespVO.setNewParentName(userApi.getUser(shiftjobs.getNewParentId()).getCheckedData().getNickname());
|
||||
|
||||
|
||||
return success(bpmOAShiftjobsRespVO);
|
||||
}
|
||||
}
|
||||
|
@ -3,8 +3,6 @@ package cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.contract;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.upload.UploadUserFile;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
@ -20,9 +18,6 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
|
||||
* @author 符溶馨
|
||||
*/
|
||||
@Schema(description = "管理后台 - 合同审批创建 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode()
|
||||
@ToString(callSuper = true)
|
||||
public class BpmOAContractCreateReqVO {
|
||||
|
||||
@Schema(description = "合同名称", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ -52,4 +47,82 @@ public class BpmOAContractCreateReqVO {
|
||||
|
||||
@Schema(description = "上传文件", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private List<UploadUserFile> fileItems;
|
||||
|
||||
public BpmOAContractCreateReqVO() {
|
||||
}
|
||||
|
||||
public BpmOAContractCreateReqVO(String contractName, String contractNumber, LocalDate signingDate, String mCompanyName, String mHeadName, String oCompanyName, String oHeadName, List<UploadUserFile> fileItems) {
|
||||
this.contractName = contractName;
|
||||
this.contractNumber = contractNumber;
|
||||
this.signingDate = signingDate;
|
||||
this.mCompanyName = mCompanyName;
|
||||
this.mHeadName = mHeadName;
|
||||
this.oCompanyName = oCompanyName;
|
||||
this.oHeadName = oHeadName;
|
||||
this.fileItems = fileItems;
|
||||
}
|
||||
|
||||
public String getContractName() {
|
||||
return contractName;
|
||||
}
|
||||
|
||||
public void setContractName(String contractName) {
|
||||
this.contractName = contractName;
|
||||
}
|
||||
|
||||
public String getContractNumber() {
|
||||
return contractNumber;
|
||||
}
|
||||
|
||||
public void setContractNumber(String contractNumber) {
|
||||
this.contractNumber = contractNumber;
|
||||
}
|
||||
|
||||
public LocalDate getSigningDate() {
|
||||
return signingDate;
|
||||
}
|
||||
|
||||
public void setSigningDate(LocalDate signingDate) {
|
||||
this.signingDate = signingDate;
|
||||
}
|
||||
|
||||
public String getmCompanyName() {
|
||||
return mCompanyName;
|
||||
}
|
||||
|
||||
public void setmCompanyName(String mCompanyName) {
|
||||
this.mCompanyName = mCompanyName;
|
||||
}
|
||||
|
||||
public String getmHeadName() {
|
||||
return mHeadName;
|
||||
}
|
||||
|
||||
public void setmHeadName(String mHeadName) {
|
||||
this.mHeadName = mHeadName;
|
||||
}
|
||||
|
||||
public String getoCompanyName() {
|
||||
return oCompanyName;
|
||||
}
|
||||
|
||||
public void setoCompanyName(String oCompanyName) {
|
||||
this.oCompanyName = oCompanyName;
|
||||
}
|
||||
|
||||
public String getoHeadName() {
|
||||
return oHeadName;
|
||||
}
|
||||
|
||||
public void setoHeadName(String oHeadName) {
|
||||
this.oHeadName = oHeadName;
|
||||
}
|
||||
|
||||
public List<UploadUserFile> getFileItems() {
|
||||
return fileItems;
|
||||
}
|
||||
|
||||
public void setFileItems(List<UploadUserFile> fileItems) {
|
||||
this.fileItems = fileItems;
|
||||
}
|
||||
}
|
||||
|
@ -41,6 +41,9 @@ public class BpmOAImprestRespVO extends BpmOABaseRespVO {
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
|
||||
private LocalDate date;
|
||||
|
||||
@Schema(description = "报销流程编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
private Integer reimbursementId;
|
||||
|
||||
@Schema(description = "报销状态", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "报销状态不能为空")
|
||||
private Integer status;
|
||||
|
@ -27,8 +27,11 @@ public class BpmOAReimbursementCreateReqVO {
|
||||
@NotNull(message = "报销总金额中文大写不能为空")
|
||||
private String totalMoneyChinese ;
|
||||
|
||||
@Schema(description = "报销类型", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "报销类型不能为空")
|
||||
private BigDecimal reimbursementType ;
|
||||
|
||||
@Schema(description = "备用金差额", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
@NotNull(message = "备用金差额不能为空")
|
||||
private BigDecimal difference ;
|
||||
|
||||
@Schema(description = "报销发票总数", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
|
@ -28,8 +28,11 @@ public class BpmOAReimbursementRespVO extends BpmOABaseRespVO {
|
||||
@NotNull(message = "报销总金额中文大写不能为空")
|
||||
private String totalMoneyChinese ;
|
||||
|
||||
@Schema(description = "报销类型", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "报销类型不能为空")
|
||||
private BigDecimal reimbursementType ;
|
||||
|
||||
@Schema(description = "备用金差额", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
@NotNull(message = "备用金差额不能为空")
|
||||
private BigDecimal difference ;
|
||||
|
||||
@Schema(description = "报销发票总数", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
|
@ -23,25 +23,25 @@ public class BpmOAShiftjobsRespVO extends BpmOABaseRespVO {
|
||||
@NotNull(message = "调岗类型不能为空")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "原部门编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@Schema(description = "原部门名称", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "原部门不能为空")
|
||||
private Long oldDeptId;
|
||||
private String oldDeptName;
|
||||
|
||||
@Schema(description = "原上级领导编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
private Long oldParentId;
|
||||
@Schema(description = "原上级领导昵称", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
private String oldParentName;
|
||||
|
||||
@Schema(description = "原岗位编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
private Long oldPostId;
|
||||
@Schema(description = "原岗位名称", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
private String oldPostName;
|
||||
|
||||
@Schema(description = "新部门编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@Schema(description = "新部门名臣", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "新部门不能为空")
|
||||
private Long newDeptId;
|
||||
private String newDeptName;
|
||||
|
||||
@Schema(description = "新上级领导编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
private Long newParentId;
|
||||
@Schema(description = "新上级领导昵称", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
private String newParentName;
|
||||
|
||||
@Schema(description = "新岗位编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
private Long newPostId;
|
||||
@Schema(description = "新岗位名称", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
private String newPostName;
|
||||
|
||||
@Schema(description = "备注", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
private String notes;
|
||||
|
@ -21,7 +21,7 @@ import java.util.List;
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
//@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class BpmOAContractDO extends BaseDO {
|
||||
|
@ -69,6 +69,11 @@ public class BpmOAImprestDO extends BaseDO {
|
||||
*/
|
||||
private LocalDate date;
|
||||
|
||||
/**
|
||||
* 报销流程业务编号
|
||||
*/
|
||||
private Long reimbursementId;
|
||||
|
||||
/**
|
||||
* 申请的结果
|
||||
*
|
||||
|
@ -28,6 +28,15 @@ import java.util.List;
|
||||
@AllArgsConstructor
|
||||
public class BpmOAReimbursementDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 1: 自费
|
||||
*/
|
||||
public static final Integer EXPENSE_TYPE = 1;
|
||||
/**
|
||||
* 2: 备用金
|
||||
*/
|
||||
public static final Integer IMPREST_TYPE = 2;
|
||||
|
||||
/**
|
||||
* 请假表单主键
|
||||
*/
|
||||
@ -55,6 +64,11 @@ public class BpmOAReimbursementDO extends BaseDO {
|
||||
*/
|
||||
private String totalMoneyChinese;
|
||||
|
||||
/**
|
||||
* 报销类型
|
||||
*/
|
||||
private Integer reimbursementType;
|
||||
|
||||
/**
|
||||
* 备用差额
|
||||
*/
|
||||
|
@ -18,7 +18,7 @@ public interface BpmOAImprestMapper extends BaseMapperX<BpmOAImprestDO> {
|
||||
default BpmOAImprestDO selectByUserId(Long userId, Integer status){
|
||||
|
||||
return selectOne(new LambdaQueryWrapperX<BpmOAImprestDO>().eq(BpmOAImprestDO::getUserId, userId)
|
||||
.eq(BpmOAImprestDO::getResult, BpmProcessInstanceResultEnum.PROCESS.getResult())
|
||||
.eq(BpmOAImprestDO::getResult, BpmProcessInstanceResultEnum.APPROVE.getResult())
|
||||
.eq(BpmOAImprestDO::getStatus, status));
|
||||
}
|
||||
}
|
||||
|
@ -45,4 +45,12 @@ public interface BpmOAImprestService {
|
||||
* @return 备用金申请
|
||||
*/
|
||||
BpmOAImprestDO getImprestByUserId(Long userId);
|
||||
|
||||
/**
|
||||
* 获得备用金表单
|
||||
*
|
||||
* @param reimbursementId 编号
|
||||
* @return 备用金申请
|
||||
*/
|
||||
BpmOAImprestDO getImprestByReimbursementId(Long reimbursementId);
|
||||
}
|
||||
|
@ -91,4 +91,11 @@ public class BpmOAImprestServiceImpl extends BpmOABaseService implements BpmOAIm
|
||||
//根据user 查询审批通过并且未报销得表单。
|
||||
return imprestMapper.selectByUserId(userId, BpmOAImprestDO.FLAG_FALSE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BpmOAImprestDO getImprestByReimbursementId(Long reimbursementId) {
|
||||
|
||||
//根据报销业务编号获取备用金详情
|
||||
return imprestMapper.selectOne(BpmOAImprestDO::getReimbursementId, reimbursementId);
|
||||
}
|
||||
}
|
||||
|
@ -72,10 +72,10 @@ public class BpmOAReimbursementServiceImpl extends BpmOABaseService implements B
|
||||
// 将工作流的编号,更新到 OA 报销表单中
|
||||
reimbursementMapper.updateById(new BpmOAReimbursementDO().setId(reimbursement.getId()).setProcessInstanceId(processInstanceId));
|
||||
|
||||
//如果是备用金报销,则更新备用金流程status
|
||||
//如果是备用金报销,则更新备用金流程status,并存入当前报销流程ID
|
||||
if (createReqVO.getDifference() != null) {
|
||||
BpmOAImprestDO bpmOAImprestDO = bpmOAImprestService.getImprestByUserId(userId);
|
||||
bpmOAImprestMapper.updateById(new BpmOAImprestDO().setId(bpmOAImprestDO.getId()).setStatus(BpmOAImprestDO.IN_PROGRESS));
|
||||
bpmOAImprestMapper.updateById(new BpmOAImprestDO().setId(bpmOAImprestDO.getId()).setReimbursementId(reimbursement.getId()).setStatus(BpmOAImprestDO.IN_PROGRESS));
|
||||
}
|
||||
|
||||
List<UploadUserFile> fileItems = createReqVO.getFileItems() ;
|
||||
@ -95,7 +95,7 @@ public class BpmOAReimbursementServiceImpl extends BpmOABaseService implements B
|
||||
if (BpmProcessInstanceResultEnum.APPROVE.getResult().equals(result)) {
|
||||
|
||||
ProcessInstance instance = bpmProcessInstanceService.getProcessInstance(processInstanceId);
|
||||
BpmOAImprestDO bpmOAImprestDO = bpmOAImprestMapper.selectByUserId(Long.valueOf(instance.getStartUserId()), BpmOAImprestDO.IN_PROGRESS);
|
||||
BpmOAImprestDO bpmOAImprestDO = bpmOAImprestMapper.selectOne(BpmOAImprestDO::getReimbursementId, id);
|
||||
|
||||
if (instance.isEnded() && bpmOAImprestDO != null) {
|
||||
|
||||
@ -111,8 +111,7 @@ public class BpmOAReimbursementServiceImpl extends BpmOABaseService implements B
|
||||
|| BpmProcessInstanceResultEnum.CANCEL.getResult().equals(result)
|
||||
|| BpmProcessInstanceResultEnum.BACK.getResult().equals(result)) {
|
||||
|
||||
ProcessInstance instance = bpmProcessInstanceService.getProcessInstance(processInstanceId);
|
||||
BpmOAImprestDO bpmOAImprestDO = bpmOAImprestMapper.selectByUserId(Long.valueOf(instance.getStartUserId()), BpmOAImprestDO.IN_PROGRESS);
|
||||
BpmOAImprestDO bpmOAImprestDO = bpmOAImprestMapper.selectOne(BpmOAImprestDO::getReimbursementId, id);
|
||||
|
||||
if (bpmOAImprestDO != null) {
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
package cn.iocoder.yudao.module.system.api.dept;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.module.system.api.dept.dto.PostRespVO;
|
||||
import cn.iocoder.yudao.module.system.enums.ApiConstants;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
@ -22,4 +23,8 @@ public interface PostApi {
|
||||
@Parameter(name = "ids", description = "岗位编号数组", example = "1,2", required = true)
|
||||
CommonResult<Boolean> validPostList(@RequestParam("ids") Collection<Long> ids);
|
||||
|
||||
@GetMapping(PREFIX + "/get")
|
||||
@Operation(summary = "获得部门信息")
|
||||
@Parameter(name = "id", description = "岗位编号", example = "1024", required = true)
|
||||
CommonResult<PostRespVO> getPost(@RequestParam("id") Long id);
|
||||
}
|
||||
|
@ -0,0 +1,15 @@
|
||||
package cn.iocoder.yudao.module.system.api.dept.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "RPC 服务 - 岗位 Response DTO")
|
||||
@Data
|
||||
public class PostRespVO {
|
||||
|
||||
@Schema(description = "岗位编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "岗位名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "总监")
|
||||
private String name;
|
||||
}
|
@ -1,6 +1,9 @@
|
||||
package cn.iocoder.yudao.module.system.api.dept;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.system.api.dept.dto.PostRespVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.dept.PostDO;
|
||||
import cn.iocoder.yudao.module.system.service.dept.PostService;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
@ -23,4 +26,10 @@ public class PostApiImpl implements PostApi {
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<PostRespVO> getPost(Long id) {
|
||||
PostDO postDO = postService.getPost(id);
|
||||
return success(BeanUtils.toBean(postDO, PostRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user