Compare commits

...

9 Commits

Author SHA1 Message Date
aikai
c26f8f723f Merge branch 'dev' of http://git.znkjfw.com/ak/zn-cloud into dev-crm
# Conflicts:
#	yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/job/birthday/BirthdayJob.java
2024-12-03 20:49:39 +08:00
aikai
b0cd88a2e4 refactor(system): 优化用户列表查询功能
- 移除 unused 的 wechatMiniList 静态变量
- 将 menus 参数改为 roleCodes 参数,用于查询用户列表
- 更新相关 mapper 和 SQL 查询逻辑,以适应新的参数- 删除微信公众号和小程序的测试配置
2024-12-03 20:43:19 +08:00
furongxin
9e48b0b302 refactor(bpm): 修改备用金表单接口名称
- 将 getByProcessInstanceId 方法的路径从 /getByProcessInstanceId 改为 /getProcessInstanceId
- 优化接口路径,使其更加简洁和一致
2024-12-03 18:12:56 +08:00
furongxin
66419fe9ab refactor(system): 优化部门和项目查询的 SQL 正则表达式
- 将 getChildDept 方法中的正则表达式替换为更高效的模糊查询组合
- 优化 ProjectMapper 中的参与部门查询条件,提高查询效率
- 在 DeptServiceImpl 中添加数据权限注解,控制访问权限
2024-12-02 09:19:42 +08:00
furongxin
687d35eb53 refactor(system): 优化部门和项目管理的查询逻辑
- 修改DeptServiceImpl中的getChildDept方法,使用正则表达式进行精确匹配- 更新ProjectMapper中的查询条件,使用正则表达式替代like操作以提高查询准确度
2024-11-29 19:41:34 +08:00
furongxin
5c16890397 refactor(bpm): 优化代码结构和导入
- 移除了不必要的导入语句
-调整了部分类的导入方式
- 删除了未使用的变量和方法
2024-11-29 17:08:51 +08:00
furongxin
a2de6d84b1 feat(system): 新增项目管理相关功能
- 新增获取项目信息接口
- 新增获取我参与的项目列表接口
- 优化考勤机状态更新任务
- 重构生日提醒任务逻辑
- 新增合同提醒相关功能
2024-11-29 17:08:37 +08:00
furongxin
9d75942a8b refactor(bpm): 修改任务规则脚本枚举描述
-将 LEADER_X4 的描述从 "审批人的一级领导" 修改为 "审批人的上级领导"
- 这个修改使得枚举描述更加通用,适用于不同的审批场景
2024-11-29 17:06:56 +08:00
furongxin
c51c46262c feat(bpm): 增加项目编号和名称字段,并优化报销功能
- 在 BpmOACash 和 BpmOAReimbursement 模型中添加项目编号字段
- 在 API 接口中增加项目名称的获取和展示
- 新增 BpmOAReimbursementItem 模型和相关 Mapper- 优化报销申请创建逻辑,支持明细数据插入
-调整抄送人处理逻辑,使用事务提交后执行
-重构领导审批规则计算方法,提高灵活性和准确性
2024-11-29 17:05:42 +08:00
44 changed files with 521 additions and 154 deletions

View File

@ -18,7 +18,7 @@ public enum BpmTaskRuleScriptEnum {
LEADER_X1(20L, "流程发起人的一级领导"),
LEADER_X2(21L, "流程发起人的二级领导"),
LEADER_X3(22L, "流程发起人的三级领导"),
LEADER_X4(23L, "审批人的级领导"),
LEADER_X4(23L, "审批人的级领导"),
LEADER_X5(24L, "调岗部门领导"),
LEADER_X6(25L, "分配任务的责任人"),
LEADER_X7(26L, "入职部门领导"),

View File

@ -5,9 +5,12 @@ import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.cash.BpmOACashCreateRe
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.cash.BpmOACashRespVO;
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOACashDO;
import cn.iocoder.yudao.module.bpm.service.oa.BpmOACashService;
import cn.iocoder.yudao.module.system.api.project.ProjectApi;
import cn.iocoder.yudao.module.system.api.project.dto.ProjectDTO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.mapstruct.ap.internal.util.Strings;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@ -32,6 +35,9 @@ public class BpmOACashController {
@Resource
private BpmOACashService cashService;
@Resource
private ProjectApi projectApi;
@PostMapping("/create")
@Operation(summary = "创建请求申请")
public CommonResult<Long> createCash(@Valid @RequestBody BpmOACashCreateReqVO createReqVO) {
@ -45,8 +51,13 @@ public class BpmOACashController {
public CommonResult<BpmOACashRespVO> getCash(@RequestParam("id") Long id) {
BpmOACashDO cashDO = cashService.getCash(id);
BpmOACashRespVO respVO = cashService.convertCash(cashDO);
if (respVO != null && Strings.isNotEmpty(respVO.getProjectNo())) {
ProjectDTO projectDTO = projectApi.getProject(respVO.getProjectNo()).getCheckedData();
respVO.setProjectName(projectDTO.getName());
}
return success(cashService.convertCash(cashDO));
return success(respVO);
}
@GetMapping("/getByProcessInstanceId")
@ -55,7 +66,12 @@ public class BpmOACashController {
public CommonResult<BpmOACashRespVO> getCashByProcessInstanceId(@RequestParam("processInstanceId") String processInstanceId) {
BpmOACashDO cashDO = cashService.getByProcessInstanceId(processInstanceId);
BpmOACashRespVO respVO = cashService.convertCash(cashDO);
if (respVO != null && Strings.isNotEmpty(respVO.getProjectNo())) {
ProjectDTO projectDTO = projectApi.getProject(respVO.getProjectNo()).getCheckedData();
respVO.setProjectName(projectDTO.getName());
}
return success(cashService.convertCash(cashDO));
return success(respVO);
}
}

View File

@ -69,7 +69,7 @@ public class BpmOAImprestController {
return success(respVO);
}
@GetMapping("/getByProcessInstanceId")
@GetMapping("/getProcessInstanceId")
@Operation(summary = "获得备用金表单")
@Parameter(name = "processInstanceId", description = "流程实例编号", required = true, example = "1024")
public CommonResult<BpmOAImprestRespVO> getByProcessInstanceId(@RequestParam("processInstanceId") String processInstanceId) {

View File

@ -5,9 +5,12 @@ import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.reimbursement.BpmOARei
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.reimbursement.BpmOAReimbursementRespVO;
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAReimbursementDO;
import cn.iocoder.yudao.module.bpm.service.oa.BpmOAReimbursementService;
import cn.iocoder.yudao.module.system.api.project.ProjectApi;
import cn.iocoder.yudao.module.system.api.project.dto.ProjectDTO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.mapstruct.ap.internal.util.Strings;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@ -31,6 +34,9 @@ public class BpmOAReimbursementController {
@Resource
private BpmOAReimbursementService service;
@Resource
private ProjectApi projectApi;
@PostMapping("/create")
// @PreAuthorize("@ss.hasPermission('bpm:oa-reimbursement:create')")
@Operation(summary = "创建请求申请")
@ -45,7 +51,13 @@ public class BpmOAReimbursementController {
public CommonResult<BpmOAReimbursementRespVO> getReimbursement(@RequestParam("id") Long id) {
BpmOAReimbursementDO reimbursement = service.getReimbursement(id);
return success(service.convert(reimbursement));
BpmOAReimbursementRespVO respVO = service.convert(reimbursement);
if (respVO != null && Strings.isNotEmpty(respVO.getProjectNo())) {
// 设置项目名称
ProjectDTO projectDTO = projectApi.getProject(respVO.getProjectNo()).getCheckedData();
respVO.setProjectName(projectDTO.getName());
}
return success(respVO);
}
// @GetMapping("/page")
@ -62,6 +74,12 @@ public class BpmOAReimbursementController {
public CommonResult<BpmOAReimbursementRespVO> getByProcessInstanceId(@RequestParam("processInstanceId") String processInstanceId) {
BpmOAReimbursementDO reimbursement = service.getByProcessInstanceId(processInstanceId);
return success(service.convert(reimbursement));
BpmOAReimbursementRespVO respVO = service.convert(reimbursement);
if (respVO != null && Strings.isNotEmpty(respVO.getProjectNo())) {
// 设置项目名称
ProjectDTO projectDTO = projectApi.getProject(respVO.getProjectNo()).getCheckedData();
respVO.setProjectName(projectDTO.getName());
}
return success(respVO);
}
}

View File

@ -31,6 +31,9 @@ public class BpmOACashCreateReqVO {
@NotNull(message = "报销总金额不能为空")
private BigDecimal totalMoney;
@Schema(description = "项目编号")
private String projectNo;
@Schema(description = "备用金申请编号")
private Long imprestId;

View File

@ -37,6 +37,12 @@ public class BpmOACashRespVO extends BpmOABaseRespVO {
@Schema(description = "报销总金额")
private BigDecimal totalMoney;
@Schema(description = "项目编号")
private String projectNo;
@Schema(description = "项目名称")
private String projectName;
@Schema(description = "备用金申请编号")
private Long imprestId;

View File

@ -36,9 +36,12 @@ public class BpmOAReimbursementCreateReqVO {
@NotNull(message = "报销总金额中文大写不能为空")
private String totalMoneyChinese ;
@Schema(description = "报销类型", requiredMode = Schema.RequiredMode.REQUIRED)
@Schema(description = "报销类型 | 1正常报销 2备用金报销", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "报销类型不能为空")
private BigDecimal reimbursementType ;
private BigDecimal reimbursementType;
@Schema(description = "项目编号")
private String projectNo;
@Schema(description = "备用金ID")
private Long imprestId;

View File

@ -43,6 +43,12 @@ public class BpmOAReimbursementRespVO extends BpmOABaseRespVO {
@NotNull(message = "报销类型不能为空")
private BigDecimal reimbursementType ;
@Schema(description = "项目编号")
private String projectNo;
@Schema(description = "项目名称")
private String projectName;
@Schema(description = "备用金金额", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
private BigDecimal amount;

View File

@ -15,6 +15,9 @@ import java.util.Date;
@Data
public class Reimbursement {
@Schema(description = "主键ID")
private Long id;
@Schema(description = "所属部门ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "128")
private Long deptId;

View File

@ -50,6 +50,11 @@ public class BpmOACashDO extends BaseDO {
*/
private BigDecimal totalMoney;
/**
* 项目编号
*/
private String projectNo;
/**
* 备用金申请编号
*/

View File

@ -29,7 +29,7 @@ import java.util.List;
public class BpmOAReimbursementDO extends BaseDO {
/**
* 1: 自费
* 1: 办公报销
*/
public static final Integer EXPENSE_TYPE = 1;
/**
@ -79,6 +79,11 @@ public class BpmOAReimbursementDO extends BaseDO {
*/
private String totalMoneyChinese;
/**
* 项目编号
*/
private String projectNo;
/**
* 报销类型
*/

View File

@ -0,0 +1,71 @@
package cn.iocoder.yudao.module.bpm.dal.dataobject.oa;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.*;
import java.math.BigDecimal;
import java.util.Date;
/**
* OA 报销明细 DO
*
* @author 姚君
*
*/
@TableName(value ="bpm_oa_reimbursement_item", autoResultMap = true)
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class BpmOAReimbursementItemDO extends BaseDO {
/**
* 报销明细表单主键
*/
@TableId
private Long id;
/**
* 报销编号
*/
private Long reimbursementId;
/**
* 费用产生部门编号
*/
private Long deptId;
/**
* 报销金额
*/
private BigDecimal money;
/**
* 费用类型 | 字典值 参考bpm_oa_reimbursement_type
*/
private String type;
/**
* 发生时间
*/
private Date happenTime;
/**
* 发票张数
*/
private Integer quantity ;
/**
* 费用明细
*/
private String detail ;
/**
* 采购申请编号
*/
private Long procureId;
}

View File

@ -0,0 +1,9 @@
package cn.iocoder.yudao.module.bpm.dal.mysql.oa;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAReimbursementItemDO;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface BpmOAReimbursementItemMapper extends BaseMapperX<BpmOAReimbursementItemDO> {
}

View File

@ -13,6 +13,7 @@ import org.springframework.context.annotation.Lazy;
import org.springframework.util.Assert;
import javax.annotation.Resource;
import java.util.Objects;
import java.util.Set;
import static cn.iocoder.yudao.framework.common.util.collection.SetUtils.asSet;
@ -39,32 +40,59 @@ public abstract class BpmTaskAssignLeaderAbstractScript implements BpmTaskAssign
// 获得发起人
ProcessInstance processInstance = bpmProcessInstanceService.getProcessInstance(execution.getProcessInstanceId());
Long startUserId = NumberUtils.parseLong(processInstance.getStartUserId());
// 获得对应 leve 的部门
DeptRespDTO dept = null;
for (int i = 0; i < level; i++) {
// 获得 level 对应的部门
if (dept == null) {
dept = getStartUserDept(startUserId);
if (dept == null) { // 找不到发起人的部门所以无法使用该规则
return emptySet();
}
} else {
DeptRespDTO parentDept = deptApi.getDept(dept.getParentId()).getCheckedData();
if (parentDept == null) { // 找不到父级部门所以只好结束寻找原因是例如说级别比较高的人所在部门层级比较少
break;
}
dept = parentDept;
}
// 获得发起人部门信息
DeptRespDTO startUserDept = getStartUserDept(startUserId);
// 如果发起人部门为空则直接返回空
if (startUserDept == null) {
return emptySet();
}
Long leaderUserId = dept.getLeaderUserId() ;
if( leaderUserId !=null && !startUserId.toString().equals(leaderUserId.toString()) ) {
return asSet(dept.getLeaderUserId()) ;
}else if( leaderUserId !=null && startUserId.toString().equals(leaderUserId.toString()) ) {
// 如果发起人部门层级 小于等于 level则直接返回发起人的部门负责人
if (startUserDept.getLevel() <= level) {
return startUserDept.getLeaderUserId() == null ? emptySet() : asSet(startUserDept.getLeaderUserId());
}
// 获取发起人部门flag
String [] flag = startUserDept.getFlag().split("-");
// 获取指定层级部门信息
DeptRespDTO dept = deptApi.getDept(Long.valueOf(flag[level])).getCheckedData();
Long leaderUserId = dept.getLeaderUserId();
if(leaderUserId == null) {
return emptySet();
}
if (Objects.equals(leaderUserId, startUserId)) {
//如果领导ID和发起人ID一致那么需要再往上级机构寻找
return calculateTaskCandidateUsers(execution, level+1) ;
return calculateTaskCandidateUsers(execution, level+1);
}else {
return emptySet() ;
return asSet(dept.getLeaderUserId());
}
// // 获得对应 leve 的部门
// DeptRespDTO dept = null;
// for (int i = 0; i < level; i++) {
// // 获得 level 对应的部门
// if (dept == null) {
// dept = getStartUserDept(startUserId);
// if (dept == null) { // 找不到发起人的部门所以无法使用该规则
// return emptySet();
// }
// } else {
// DeptRespDTO parentDept = deptApi.getDept(dept.getParentId()).getCheckedData();
// if (parentDept == null) { // 找不到父级部门所以只好结束寻找原因是例如说级别比较高的人所在部门层级比较少
// break;
// }
// dept = parentDept;
// }
// }
// Long leaderUserId = dept.getLeaderUserId() ;
// if( leaderUserId !=null && !startUserId.toString().equals(leaderUserId.toString()) ) {
// return asSet(dept.getLeaderUserId()) ;
// }else if( leaderUserId !=null && startUserId.toString().equals(leaderUserId.toString()) ) {
// //如果领导ID和发起人ID一致那么需要再往上级机构寻找
// return calculateTaskCandidateUsers(execution, level+1) ;
// }else {
// return emptySet() ;
// }
//return dept.getLeaderUserId() != null ? asSet(dept.getLeaderUserId()) : emptySet();
}

View File

@ -83,6 +83,6 @@ public class BpmProcessCcServiceImpl implements BpmProcessCcService {
return processCcMapper.selectList(new LambdaQueryWrapperX<BpmProcessCcDO>()
.likeIfPresent(BpmProcessCcDO::getName, name)
.eqIfPresent(BpmProcessCcDO::getCompanyDeptId, dto.getId()));
.likeIfPresent(BpmProcessCcDO::getCompanyDeptId, String.valueOf(dto.getId())));
}
}

View File

@ -4,8 +4,10 @@ package cn.iocoder.yudao.module.bpm.service.oa;
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.reimbursement.BpmOAReimbursementCreateReqVO;
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.reimbursement.BpmOAReimbursementRespVO;
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAReimbursementDO;
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAReimbursementItemDO;
import javax.validation.Valid;
import java.util.List;
/**
* 报销申请 Service 接口
@ -40,6 +42,14 @@ public interface BpmOAReimbursementService {
*/
BpmOAReimbursementDO getReimbursement(Long id);
/**
* 获得指定得报销明细
*
* @param reimbursementId 报销主表编号
* @return 明细列表
*/
List<BpmOAReimbursementItemDO> getReimbursementItem(Long reimbursementId);
BpmOAReimbursementRespVO convert(BpmOAReimbursementDO bpmOAReimbursementDO);
/**

View File

@ -3,7 +3,6 @@ package cn.iocoder.yudao.module.bpm.service.oa;
import cn.hutool.core.util.StrUtil;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.UploadUserFile;
import cn.iocoder.yudao.framework.common.util.json.JsonUtils;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.bpm.api.task.BpmProcessInstanceApi;
@ -11,15 +10,16 @@ import cn.iocoder.yudao.module.bpm.api.task.dto.BpmProcessInstanceCreateReqDTO;
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.procure.BpmOAProcureListEditReqVO;
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.reimbursement.BpmOAReimbursementCreateReqVO;
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.reimbursement.BpmOAReimbursementRespVO;
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.reimbursement.Reimbursement;
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.reimbursement.ReimbursementDTO;
import cn.iocoder.yudao.module.bpm.convert.oa.BpmOAReimbursementConvert;
import cn.iocoder.yudao.module.bpm.dal.dataobject.financialpayment.FinancialPaymentDO;
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAImprestDO;
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAProcureDO;
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAReimbursementDO;
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAReimbursementItemDO;
import cn.iocoder.yudao.module.bpm.dal.dataobject.task.BpmProcessInstanceExtDO;
import cn.iocoder.yudao.module.bpm.dal.mysql.oa.BpmOAImprestMapper;
import cn.iocoder.yudao.module.bpm.dal.mysql.oa.BpmOAReimbursementItemMapper;
import cn.iocoder.yudao.module.bpm.dal.mysql.oa.BpmOAReimbursementMapper;
import cn.iocoder.yudao.module.bpm.enums.task.BpmProcessInstanceResultEnum;
import cn.iocoder.yudao.module.bpm.service.financialpayment.FinancialPaymentService;
@ -80,6 +80,9 @@ public class BpmOAReimbursementServiceImpl extends BpmOABaseService implements B
@Resource
private BpmOAImprestMapper bpmOAImprestMapper;
@Resource
private BpmOAReimbursementItemMapper reimbursementItemMapper;
@Resource
private BpmOAProcureService bpmOAProcureService;
@ -102,6 +105,11 @@ public class BpmOAReimbursementServiceImpl extends BpmOABaseService implements B
.setResult(BpmProcessInstanceResultEnum.PROCESS.getResult());
reimbursementMapper.insert(reimbursement);
// 同步插入明细数据
List<BpmOAReimbursementItemDO> createDO = BeanUtils.toBean(createReqVO.getReimbursements(), BpmOAReimbursementItemDO.class);
createDO.forEach(item -> item.setReimbursementId(reimbursement.getId()));
reimbursementItemMapper.insertBatch(createDO);
// 发起 BPM 流程
Map<String, Object> processInstanceVariables = new HashMap<>();
String processInstanceId = processInstanceApi.createProcessInstance(userId,
@ -125,7 +133,7 @@ public class BpmOAReimbursementServiceImpl extends BpmOABaseService implements B
//判断是否有 采购报销
List<Long> procureIds = new ArrayList<>();
for (Reimbursement data : reimbursement.getReimbursements()) {
for (BpmOAReimbursementItemDO data : createDO) {
//报销类别为 采购费时
if ("4".equals(data.getType())) {
@ -158,7 +166,8 @@ public class BpmOAReimbursementServiceImpl extends BpmOABaseService implements B
BpmOAReimbursementDO bpmOAReimbursementDO = validateLeaveExists(id);
reimbursementMapper.updateById(new BpmOAReimbursementDO().setId(id).setResult(result));
// 获取明细数据
List<BpmOAReimbursementItemDO> reimbursements = getReimbursementItem(id);
//审核通过 最后节点
if (BpmProcessInstanceResultEnum.APPROVE.getResult().equals(result)) {
@ -169,13 +178,13 @@ public class BpmOAReimbursementServiceImpl extends BpmOABaseService implements B
//判断是否有采购报销
List<Long> procureIds = new ArrayList<>();
List<Reimbursement> reimbursements = bpmOAReimbursementDO.getReimbursements();
//直接从数据库取出来的List<Reimbursement> 实际上是List<LinkedHashMap>类型 所以不能直接遍历
//将list再次转为json串然后由json串再转为list
String json = JsonUtils.toJsonString(reimbursements);
reimbursements = JsonUtils.parseArray(json, Reimbursement.class);
for (Reimbursement reimbursement : reimbursements) {
// List<Reimbursement> reimbursements = bpmOAReimbursementDO.getReimbursements();
//
// //直接从数据库取出来的List<Reimbursement> 实际上是List<LinkedHashMap>类型 所以不能直接遍历
// //将list再次转为json串然后由json串再转为list
// String json = JsonUtils.toJsonString(reimbursements);
// reimbursements = JsonUtils.parseArray(json, Reimbursement.class);
for (BpmOAReimbursementItemDO reimbursement : reimbursements) {
//报销类别为 采购费时
if ("4".equals(reimbursement.getType())) {
procureIds.add(reimbursement.getProcureId());
@ -219,7 +228,7 @@ public class BpmOAReimbursementServiceImpl extends BpmOABaseService implements B
}
}
String reason = reimbursements.stream().map(Reimbursement::getDetail)
String reason = reimbursements.stream().map(BpmOAReimbursementItemDO::getDetail)
.filter(StrUtil::isNotEmpty)
.collect(Collectors.joining(","));
@ -264,14 +273,14 @@ public class BpmOAReimbursementServiceImpl extends BpmOABaseService implements B
//判断是否有采购报销
List<Long> procureIds = new ArrayList<>();
List<Reimbursement> reimbursements = bpmOAReimbursementDO.getReimbursements();
// List<Reimbursement> reimbursements = bpmOAReimbursementDO.getReimbursements();
//
// //直接从数据库取出来的List<Reimbursement> 实际上是List<LinkedHashMap>类型 所以不能直接遍历
// //将list再次转为json串然后由json串再转为list
// String json = JsonUtils.toJsonString(reimbursements);
// reimbursements = JsonUtils.parseArray(json, Reimbursement.class);
//直接从数据库取出来的List<Reimbursement> 实际上是List<LinkedHashMap>类型 所以不能直接遍历
//将list再次转为json串然后由json串再转为list
String json = JsonUtils.toJsonString(reimbursements);
reimbursements = JsonUtils.parseArray(json, Reimbursement.class);
for (Reimbursement reimbursement : reimbursements) {
for (BpmOAReimbursementItemDO reimbursement : reimbursements) {
//报销类别为 采购费时
if ("4".equals(reimbursement.getType())) {
@ -294,7 +303,7 @@ public class BpmOAReimbursementServiceImpl extends BpmOABaseService implements B
);
}
}
reimbursementMapper.updateById(new BpmOAReimbursementDO().setId(id).setResult(result));
}
private BpmOAReimbursementDO validateLeaveExists(Long id) {
@ -311,19 +320,28 @@ public class BpmOAReimbursementServiceImpl extends BpmOABaseService implements B
return reimbursementMapper.selectById(id);
}
@Override
public List<BpmOAReimbursementItemDO> getReimbursementItem(Long reimbursementId) {
return reimbursementItemMapper.selectList(BpmOAReimbursementItemDO::getReimbursementId, reimbursementId);
}
@Override
public BpmOAReimbursementRespVO convert(BpmOAReimbursementDO reimbursementDO) {
List<Reimbursement> reimbursement = reimbursementDO.getReimbursements();
// 获取明细数据
List<BpmOAReimbursementItemDO> reimbursements = getReimbursementItem(reimbursementDO.getId());
//直接从数据库取出来的List<Reimbursement> 实际上是List<LinkedHashMap>类型 所以不能直接遍历
//将list再次转为json串然后由json串再转为list
String json = JsonUtils.toJsonString(reimbursement);
reimbursement = JsonUtils.parseArray(json, Reimbursement.class);
// List<Reimbursement> reimbursement = reimbursementDO.getReimbursements();
//
// //直接从数据库取出来的List<Reimbursement> 实际上是List<LinkedHashMap>类型 所以不能直接遍历
// //将list再次转为json串然后由json串再转为list
// String json = JsonUtils.toJsonString(reimbursement);
// reimbursement = JsonUtils.parseArray(json, Reimbursement.class);
//针对之前的数据 没有设置明细所属部门的 手动设置发起人的部门编号
AdminUserRespDTO userRespDTO = userApi.getUser(reimbursementDO.getUserId()).getCheckedData();
for (Reimbursement data : reimbursement) {
for (BpmOAReimbursementItemDO data : reimbursements) {
if (data.getDeptId() != null) {
break;
@ -333,9 +351,9 @@ public class BpmOAReimbursementServiceImpl extends BpmOABaseService implements B
}
//获取部门信息map
Map<Long, DeptRespDTO> deptMap = deptApi.getDeptMap(convertSet(reimbursement, Reimbursement::getDeptId));
Map<Long, DeptRespDTO> deptMap = deptApi.getDeptMap(convertSet(reimbursements, BpmOAReimbursementItemDO::getDeptId));
List<ReimbursementDTO> reimbursementDTOS = BeanUtils.toBean(reimbursement, ReimbursementDTO.class);
List<ReimbursementDTO> reimbursementDTOS = BeanUtils.toBean(reimbursements, ReimbursementDTO.class);
BpmOAReimbursementRespVO bpmOAReimbursementRespVO = BeanUtils.toBean(reimbursementDO, BpmOAReimbursementRespVO.class);
bpmOAReimbursementRespVO.setReimbursements(BpmOAReimbursementConvert.INSTANCE.convertList(reimbursementDTOS, deptMap)); //拼接数据

View File

@ -46,25 +46,13 @@ spring:
master:
name: ruoyi-vue-pro
url: jdbc:mysql://rm-bp1yloyj508qld78jno.mysql.rds.aliyuncs.com:3306/${spring.datasource.dynamic.datasource.master.name}?allowMultiQueries=true&useUnicode=true&useSSL=false&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&autoReconnect=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例
# url: jdbc:mysql://127.0.0.1:3306/${spring.datasource.dynamic.datasource.master.name}?useSSL=false&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=CTT # MySQL Connector/J 5.X 连接的示例
# url: jdbc:postgresql://127.0.0.1:5432/${spring.datasource.dynamic.datasource.master.name} # PostgreSQL 连接的示例
# url: jdbc:oracle:thin:@127.0.0.1:1521:xe # Oracle 连接的示例
# url: jdbc:sqlserver://127.0.0.1:1433;DatabaseName=${spring.datasource.dynamic.datasource.master.name} # SQLServer 连接的示例
username: root
password: Znalyrds2024
# username: sa
# password: JSm:g(*%lU4ZAkz06cd52KqT3)i1?H7W
slave: # 模拟从库,可根据自己需要修改
name: ruoyi-vue-pro
url: jdbc:mysql://rm-bp1yloyj508qld78jno.mysql.rds.aliyuncs.com:3306/${spring.datasource.dynamic.datasource.slave.name}?allowMultiQueries=true&useUnicode=true&useSSL=false&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&autoReconnect=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例
# url: jdbc:mysql://127.0.0.1:3306/${spring.datasource.dynamic.datasource.slave.name}?useSSL=false&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=CTT # MySQL Connector/J 5.X 连接的示例
# url: jdbc:postgresql://127.0.0.1:5432/${spring.datasource.dynamic.datasource.slave.name} # PostgreSQL 连接的示例
# url: jdbc:oracle:thin:@127.0.0.1:1521:xe # Oracle 连接的示例
# url: jdbc:sqlserver://127.0.0.1:1433;DatabaseName=${spring.datasource.dynamic.datasource.slave.name} # SQLServer 连接的示例
username: root
password: Znalyrds2024
# username: sa
# password: JSm:g(*%lU4ZAkz06cd52KqT3)i1?H7W
# Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优
redis:

View File

@ -0,0 +1,123 @@
--- #################### 数据库相关配置 ####################
spring:
# 数据源配置项
autoconfigure:
exclude:
- com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure # 排除 Druid 的自动配置,使用 dynamic-datasource-spring-boot-starter 配置多数据源
- de.codecentric.boot.admin.client.config.SpringBootAdminClientAutoConfiguration # 禁用 Spring Boot Admin 的 Client 的自动配置
datasource:
druid: # Druid 【监控】相关的全局配置
web-stat-filter:
enabled: true
stat-view-servlet:
enabled: true
allow: # 设置白名单,不填则允许所有访问
url-pattern: /druid/*
login-username: # 控制台管理用户名和密码
login-password:
filter:
stat:
enabled: true
log-slow-sql: true # 慢 SQL 记录
slow-sql-millis: 100
merge-sql: true
wall:
config:
multi-statement-allow: true
dynamic: # 多数据源配置
druid: # Druid 【连接池】相关的全局配置
initial-size: 1 # 初始连接数
min-idle: 1 # 最小连接池数量
max-active: 20 # 最大连接池数量
max-wait: 600000 # 配置获取连接等待超时的时间,单位:毫秒
time-between-eviction-runs-millis: 60000 # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位:毫秒
min-evictable-idle-time-millis: 300000 # 配置一个连接在池中最小生存的时间,单位:毫秒
max-evictable-idle-time-millis: 900000 # 配置一个连接在池中最大生存的时间,单位:毫秒
validation-query: SELECT 1 FROM DUAL # 配置检测连接是否有效
test-while-idle: true
test-on-borrow: false
test-on-return: false
primary: master
datasource:
master:
name: ruoyi-vue-pro
url: jdbc:mysql://rm-bp1yloyj508qld78jno.mysql.rds.aliyuncs.com:3306/${spring.datasource.dynamic.datasource.master.name}?allowMultiQueries=true&useUnicode=true&useSSL=false&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&autoReconnect=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例
driver-class-name: com.mysql.jdbc.Driver
username: root
password: Znalyrds2024
slave: # 模拟从库,可根据自己需要修改 # 模拟从库,可根据自己需要修改
name: ruoyi-vue-pro
url: jdbc:mysql://rm-bp1yloyj508qld78jno.mysql.rds.aliyuncs.com:3306/${spring.datasource.dynamic.datasource.master.name}?allowMultiQueries=true&useUnicode=true&useSSL=false&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&autoReconnect=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例
driver-class-name: com.mysql.jdbc.Driver
username: root
password: Znalyrds2024
# Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优
redis:
host: 127.0.0.1 # 地址
port: 6379 # 端口
database: 0 # 数据库索引
password: yhtkj@2024! # 密码,建议生产环境开启
--- #################### MQ 消息队列相关配置 ####################
--- #################### 定时任务相关配置 ####################
xxl:
job:
enabled: false # 是否开启调度中心,默认为 true 开启
admin:
addresses: http://127.0.0.1:9090/xxl-job-admin # 调度中心部署跟地址
--- #################### 服务保障相关配置 ####################
# Lock4j 配置项
lock4j:
acquire-timeout: 3000 # 获取分布式锁超时时间,默认为 3000 毫秒
expire: 30000 # 分布式锁的超时时间,默认为 30 毫秒
--- #################### 监控相关配置 ####################
# Actuator 监控端点的配置项
management:
endpoints:
web:
base-path: /actuator # Actuator 提供的 API 接口的根目录。默认为 /actuator
exposure:
include: '*' # 需要开放的端点。默认值只打开 health 和 info 两个端点。通过设置 * ,可以开放所有端点。
# Spring Boot Admin 配置项
spring:
boot:
admin:
# Spring Boot Admin Client 客户端的相关配置
client:
instance:
service-host-type: IP # 注册实例时,优先使用 IP [IP, HOST_NAME, CANONICAL_HOST_NAME]
# 日志文件配置
logging:
level:
# 配置自己写的 MyBatis Mapper 打印日志
cn.iocoder.yudao.module.system.dal.mysql: debug
cn.iocoder.yudao.module.system.dal.mysql.sensitiveword.SensitiveWordMapper: INFO # 配置 SensitiveWordMapper 的日志级别为 info
cn.iocoder.yudao.module.system.dal.mysql.sms.SmsChannelMapper: INFO # 配置 SmsChannelMapper 的日志级别为 info
--- #################### 芋道相关配置 ####################
# 芋道配置项,设置当前项目所有自定义的配置
yudao:
env: # 多环境的配置项
tag: ${HOSTNAME}
web:
admin-ui:
url: http://sys.znkjfw.com # Admin 管理后台 UI 的地址
security:
mock-enable: true
xss:
enable: false
access-log: # 访问日志的配置项
enable: false
error-code: # 错误码相关配置项
enable: false
demo: false # 关闭演示模式

View File

@ -1,7 +1,6 @@
package cn.iocoder.yudao.module.system.api.project;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.system.api.position.dto.PositionDTO;
import cn.iocoder.yudao.module.system.api.project.dto.ProjectDTO;
import cn.iocoder.yudao.module.system.enums.ApiConstants;
import io.swagger.v3.oas.annotations.Operation;
@ -22,4 +21,9 @@ public interface ProjectApi {
@PostMapping(PREFIX + "/create")
@Operation(summary = "创建项目")
CommonResult<Long> create(@RequestBody ProjectDTO createReqVO);
@GetMapping(PREFIX + "/get")
@Operation(summary = "获得项目")
@Parameter(name = "projectNo", description = "项目编号", required = true)
CommonResult<ProjectDTO> getProject(@RequestParam("projectNo") String projectNo);
}

View File

@ -4,6 +4,7 @@ import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.module.system.api.project.dto.ProjectDTO;
import cn.iocoder.yudao.module.system.controller.admin.project.vo.ProjectSaveReqVO;
import cn.iocoder.yudao.module.system.dal.dataobject.project.ProjectDO;
import cn.iocoder.yudao.module.system.service.project.ProjectService;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RestController;
@ -23,4 +24,10 @@ public class ProjectApiImpl implements ProjectApi {
public CommonResult<Long> create(ProjectDTO createReqVO) {
return success(projectService.createProject(BeanUtils.toBean(createReqVO, ProjectSaveReqVO.class)));
}
@Override
public CommonResult<ProjectDTO> getProject(String projectNo) {
ProjectDO projectDO = projectService.getProject(projectNo);
return success(BeanUtils.toBean(projectDO, ProjectDTO.class));
}
}

View File

@ -35,9 +35,6 @@ public class SubscribeMessageSendApiImpl implements SubscribeMessageSendApi {
@Resource
private SocialClientService socialClientService;
private final static List<Integer> wechatMiniList = Arrays.asList(SocialTypeEnum.WECHAT_MINI_APP.getType(),
SocialTypeEnum.WECHAT_MINI_APP_CRM.getType());
@SneakyThrows
@Override
public CommonResult<Long> sendMaMsg(SubscribeMessageReqDTO reqDTO) {

View File

@ -29,6 +29,7 @@ import java.util.stream.Collectors;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList;
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertMap;
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
@Tag(name = "管理后台 - 项目管理")
@RestController
@ -180,4 +181,13 @@ public class ProjectController {
return success(respVOs);
}
@GetMapping("/get-my-project")
@Operation(summary = "获得我参与的项目")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('system:project:query')")
public CommonResult<List<ProjectRespVO>> getMyProject() {
List<ProjectDO> projectList = projectService.getMyProject(getLoginUserId());
return success(BeanUtils.toBean(projectList, ProjectRespVO.class));
}
}

View File

@ -32,7 +32,6 @@ public class ProjectSaveReqVO {
private Long responsibleDept;
@Schema(description = "参与部门集合", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "参与部门集合不能为空")
private Set<Long> participationDept;
@Schema(description = "责任人用户编号", requiredMode = Schema.RequiredMode.REQUIRED)

View File

@ -163,8 +163,8 @@ public class UserController {
public CommonResult<List<UserSimpleRespVO>> getSimpleUserList(@RequestParam(required = false, defaultValue = "1") Integer userType,
@RequestParam(required = false) Long deptId,
@RequestParam(required = false, defaultValue = "0") Integer status,
@RequestParam(required = false) String menus) {
List<AdminUserDO> list = userService.getUserListByStatus(userType, deptId, status, menus);
@RequestParam(required = false) String roleCodes) {
List<AdminUserDO> list = userService.getUserListByStatus(userType, deptId, status, roleCodes);
// 拼接数据
Map<Long, DeptDO> deptMap = deptService.getDeptMap(
convertList(list, AdminUserDO::getDeptId));

View File

@ -8,6 +8,7 @@ import cn.iocoder.yudao.module.system.dal.dataobject.laborcontract.LaborContract
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.time.LocalDate;
import java.util.List;
/**
@ -35,4 +36,6 @@ public interface LaborContractMapper extends BaseMapperX<LaborContractDO> {
* @return
*/
LaborContractDO getTheEarliestContract(@Param("userId") Long userId);
List<LaborContractDO> selectListByRemindDate(@Param("remindDate")LocalDate remindDate);
}

View File

@ -4,9 +4,12 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.system.controller.admin.project.vo.ProjectPageReqVO;
import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO;
import cn.iocoder.yudao.module.system.dal.dataobject.project.ProjectDO;
import org.apache.ibatis.annotations.Mapper;
import java.util.Objects;
/**
* 项目管理 Mapper
*
@ -21,12 +24,16 @@ public interface ProjectMapper extends BaseMapperX<ProjectDO> {
.eqIfPresent(ProjectDO::getType, reqVO.getType())
.likeIfPresent(ProjectDO::getName, reqVO.getName())
.eqIfPresent(ProjectDO::getResponsibleDept, reqVO.getResponsibleDept())
.likeIfPresent(ProjectDO::getParticipationDept, reqVO.getParticipationDept())
.eqIfPresent(ProjectDO::getDirectorUserId, reqVO.getDirectorUserId())
.betweenIfPresent(ProjectDO::getStartDate, reqVO.getStartDate())
.betweenIfPresent(ProjectDO::getEndDate, reqVO.getEndDate())
.eqIfPresent(ProjectDO::getIsLongTerm, reqVO.getIsLongTerm())
.eqIfPresent(ProjectDO::getStatus, reqVO.getStatus())
.likeLeft(ProjectDO::getParticipationDept, "-" + reqVO.getParticipationDept())
.or()
.likeRight(ProjectDO::getParticipationDept, reqVO.getParticipationDept() + "-")
.or()
.like(ProjectDO::getParticipationDept, "-" + reqVO.getParticipationDept() + "-")
.orderByDesc(ProjectDO::getId));
}
}

View File

@ -64,7 +64,7 @@ public interface AdminUserMapper extends BaseMapperX<AdminUserDO> {
return selectList(new LambdaQueryWrapperX<AdminUserDO>().like(AdminUserDO::getNickname, nickname));
}
List<AdminUserDO> selectListByCondition(@Param("userType") Integer userType, @Param("deptIds") List<Long> deptIds, @Param("status") Integer status, @Param("menuList") List<String> menuList);
List<AdminUserDO> selectListByCondition(@Param("userType") Integer userType, @Param("deptIds") List<Long> deptIds, @Param("status") Integer status, @Param("roleCodeList") List<String> roleCodeList);
default List<AdminUserDO> selectListByDeptIds(Collection<Long> deptIds, Integer status) {

View File

@ -68,6 +68,7 @@ public class BirthdayJob {
@XxlJob("birthdayJob")
@TenantJob // --- 这个注解 会将租户列表拉出来 完了后逐个租户执行 定时任务需要注意
public ReturnT<String> execute() {
//获取参数
XxlJobContext xxlJobContext = XxlJobContext.getXxlJobContext();
String jobParam = xxlJobContext.getJobParam();
@ -129,14 +130,10 @@ public class BirthdayJob {
// 获得提醒日期
LocalDate remindDate = LocalDate.now().plusDays(remindDuration == null ? 7 : remindDuration);
// 查询所有试用人员
List<AdminUserDO> userDOS = userService.getUserListByUserStaffing(5);
List<Long> userIds = convertList(userDOS, AdminUserDO::getId);
List<LaborContractDO> laborContractDOS = laborContractService.getListByUserIds(userIds);
List<Long> contractUserIds = laborContractDOS.stream().filter(item -> remindDate.isEqual(item.getSigningDate().plusMonths(item.getProbationPeriodTime())))
.map(LaborContractDO::getUserId)
.collect(Collectors.toList());
// 过滤需要提醒的用户
List<AdminUserDO> positiveUserList = userDOS.stream().filter(item -> contractUserIds.contains(item.getId())).collect(Collectors.toList());
// 查询提醒日期内的试用人员合同
List<LaborContractDO> laborContractDOS = laborContractService.getListByRemindDate(remindDate);
// 获取需要提醒的用户
List<AdminUserDO> positiveUserList = userService.getUserList(convertList(laborContractDOS, LaborContractDO::getUserId));
if (CollUtil.isNotEmpty(positiveUserList)) {
List<Long> noticeUserIds = positiveUserList.stream().map(AdminUserDO::getId).collect(Collectors.toList());
List<AdminOauthUserOtherInfoDO> list = new ArrayList<>();

View File

@ -8,10 +8,11 @@ import cn.iocoder.yudao.module.system.controller.admin.equipment.vo.attendancema
import cn.iocoder.yudao.module.system.dal.dataobject.equipment.AttendanceMachineDO;
import cn.iocoder.yudao.module.system.service.equipment.AttendanceMachineService;
import com.github.yulichang.toolkit.SpringContentUtils;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
@ -31,9 +32,9 @@ public class AttendanceMachineJob {
@Resource
private StringRedisTemplate stringRedisTemplate;
@Scheduled(initialDelay = 5000, fixedRate = 30000)
@XxlJob("updateAttendanceMachineStatusJob")
@TenantJob
public void updateAttendanceMachineStatus() {
public ReturnT<String> execute() {
WebSocketSessionManager webSocketSessionManager = SpringContentUtils.getBean(WebSocketSessionManager.class);
@ -62,5 +63,8 @@ public class AttendanceMachineJob {
attendanceMachineService.updateAttendanceMachineStatus(statusUpdateVOS);
}
// 返回执行成功
return ReturnT.SUCCESS;
}
}

View File

@ -269,11 +269,17 @@ public class DeptServiceImpl implements DeptService {
}
@Override
@DataPermission(enable = false)
@Cacheable(cacheNames = RedisKeyConstants.DEPT_CHILDREN_ID_LIST, key = "#id")
public List<DeptDO> getChildDept(Long id) {
return deptMapper.selectList(new LambdaQueryWrapperX<DeptDO>()
.like(DeptDO::getFlag, id)
.eq(DeptDO::getStatus, CommonStatusEnum.ENABLE.getStatus()));
.eq(DeptDO::getStatus, CommonStatusEnum.ENABLE.getStatus())
.likeLeft(DeptDO::getFlag, "-" + id)
.or()
.likeRight(DeptDO::getFlag, id + "-")
.or()
.like(DeptDO::getFlag, "-" + id + "-"));
}
@Override

View File

@ -102,4 +102,12 @@ public interface LaborContractService {
* @return
*/
LaborContractDO getTheEarliestContract(Long userId);
/**
* 获取指定日期内即将转正的人员
*
* @param remindDate 日期
* @return 合同列表
*/
List<LaborContractDO> getListByRemindDate(LocalDate remindDate);
}

View File

@ -165,4 +165,10 @@ public class LaborContractServiceImpl implements LaborContractService {
public LaborContractDO getTheEarliestContract(Long userId) {
return laborContractMapper.getTheEarliestContract(userId);
}
@Override
public List<LaborContractDO> getListByRemindDate(LocalDate remindDate) {
return laborContractMapper.selectListByRemindDate(remindDate);
}
}

View File

@ -6,6 +6,7 @@ import cn.iocoder.yudao.module.system.controller.admin.project.vo.ProjectSaveReq
import cn.iocoder.yudao.module.system.dal.dataobject.project.ProjectDO;
import javax.validation.Valid;
import java.util.List;
/**
* 项目管理 Service 接口
@ -44,6 +45,14 @@ public interface ProjectService {
*/
ProjectDO getProject(Long id);
/**
* 获得项目管理
*
* @param projectNo 项目编号
* @return 项目
*/
ProjectDO getProject(String projectNo);
/**
* 获得项目管理分页
*
@ -52,4 +61,10 @@ public interface ProjectService {
*/
PageResult<ProjectDO> getProjectPage(ProjectPageReqVO pageReqVO);
/**
* 获得我参与的项目列表
* @param userId 用户编号
* @return 项目列表
*/
List<ProjectDO> getMyProject(Long userId);
}

View File

@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.system.service.project;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.system.controller.admin.project.vo.ProjectPageReqVO;
import cn.iocoder.yudao.module.system.controller.admin.project.vo.ProjectSaveReqVO;
import cn.iocoder.yudao.module.system.dal.dataobject.project.ProjectDO;
@ -11,6 +12,7 @@ import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import javax.annotation.Resource;
import java.util.List;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.PROJECT_NOT_EXISTS;
@ -65,9 +67,23 @@ public class ProjectServiceImpl implements ProjectService {
return projectMapper.selectById(id);
}
@Override
public ProjectDO getProject(String projectNo) {
return projectMapper.selectOne(ProjectDO::getProjectNo, projectNo);
}
@Override
public PageResult<ProjectDO> getProjectPage(ProjectPageReqVO pageReqVO) {
return projectMapper.selectPage(pageReqVO);
}
@Override
public List<ProjectDO> getMyProject(Long userId) {
return projectMapper.selectList(new LambdaQueryWrapperX<ProjectDO>()
.eq(ProjectDO::getDirectorUserId, userId)
.or()
.like(ProjectDO::getStaff, userId)
.eq(ProjectDO::getStatus, 1));
}
}

View File

@ -295,10 +295,10 @@ public interface AdminUserService {
* @param userType 用户类型 1公司用户 2工厂用户
* @param deptId
* @param status
* @param menus 菜单
* @param roleCodes 角色编码
* @return 用户们
*/
List<AdminUserDO> getUserListByStatus(Integer userType, Long deptId, Integer status, String menus);
List<AdminUserDO> getUserListByStatus(Integer userType, Long deptId, Integer status, String roleCodes);
/**
* 判断密码是否匹配

View File

@ -686,16 +686,16 @@ public class AdminUserServiceImpl implements AdminUserService {
}
@Override
public List<AdminUserDO> getUserListByStatus(Integer userType, Long deptId, Integer status, String menus) {
public List<AdminUserDO> getUserListByStatus(Integer userType, Long deptId, Integer status, String roleCodes) {
List<Long> deptIds = new ArrayList<>();
if (deptId != null) {
deptIds = convertList(deptService.getChildDept(deptId), DeptDO::getId);
}
List<String> menuList = new ArrayList<>();
if (StringUtil.isNotEmpty(menus)) {
menuList = Arrays.asList(menus.split(","));
List<String> roleCodeList = new ArrayList<>();
if (StringUtil.isNotEmpty(roleCodes)) {
roleCodeList = Arrays.asList(roleCodes.split(","));
}
return userMapper.selectListByCondition(userType, deptIds, status, menuList);
return userMapper.selectListByCondition(userType, deptIds, status, roleCodeList);
}
@Override

View File

@ -125,11 +125,9 @@ logging:
--- #################### 微信公众号、小程序相关配置 ####################
wx:
mp: # 公众号配置(必填),参见 https://github.com/Wechat-Group/WxJava/blob/develop/spring-boot-starters/wx-java-mp-spring-boot-starter/README.md 文档
# app-id: wx041349c6f39b268b
# secret: 5abee519483bc9f8cb37ce280e814bd0
app-id: wx9943f95048ba8472 # 测试号
app-id: wx9943f95048ba8472
secret: f1f5625f210142b6ae31a06c699826df
token: aikaidevtest
token: znkjfwprod
aesKey: RmC9DkIpsq6pK2PGxyI4HQaDHrv5W7de8PXeAO3lqM9
# 存储配置,解决 AccessToken 的跨节点的共享
config-storage:
@ -137,10 +135,8 @@ wx:
key-prefix: wx # Redis Key 的前缀
http-client-type: HttpClient # 采用 HttpClient 请求微信公众号平台
miniapp: # 小程序配置(必填),参见 https://github.com/Wechat-Group/WxJava/blob/develop/spring-boot-starters/wx-java-miniapp-spring-boot-starter/README.md 文档
# appid: wx62056c0d5e8db250
# secret: 333ae72f41552af1e998fe1f54e1584a
appid: wxea777d1b1e12eb32 # wenhualian的接口测试号
secret: 2db58956286099e58e959fa537e046b0
appid: wx2919e237e6018bea # wenhualian的接口测试号
secret: ad7ab17918f6defa85a9677778eb7780
config-storage:
type: RedisTemplate # 采用 RedisTemplate 操作 Redis会自动从 Spring 中获取
key-prefix: wa # Redis Key 的前缀

View File

@ -121,11 +121,9 @@ logging:
--- #################### 微信公众号、小程序相关配置 ####################
wx:
mp: # 公众号配置(必填),参见 https://github.com/Wechat-Group/WxJava/blob/develop/spring-boot-starters/wx-java-mp-spring-boot-starter/README.md 文档
# app-id: wx041349c6f39b268b
# secret: 5abee519483bc9f8cb37ce280e814bd0
app-id: wx9943f95048ba8472 # 测试号
app-id: wx9943f95048ba8472
secret: f1f5625f210142b6ae31a06c699826df
token: aikaidevtest
token: znkjfwprod
aesKey: RmC9DkIpsq6pK2PGxyI4HQaDHrv5W7de8PXeAO3lqM9
# 存储配置,解决 AccessToken 的跨节点的共享
config-storage:
@ -133,10 +131,8 @@ wx:
key-prefix: wx # Redis Key 的前缀
http-client-type: HttpClient # 采用 HttpClient 请求微信公众号平台
miniapp: # 小程序配置(必填),参见 https://github.com/Wechat-Group/WxJava/blob/develop/spring-boot-starters/wx-java-miniapp-spring-boot-starter/README.md 文档
# appid: wx62056c0d5e8db250
# secret: 333ae72f41552af1e998fe1f54e1584a
appid: wxea777d1b1e12eb32 # wenhualian的接口测试号
secret: 2db58956286099e58e959fa537e046b0
appid: wx2919e237e6018bea # wenhualian的接口测试号
secret: ad7ab17918f6defa85a9677778eb7780
config-storage:
type: RedisTemplate # 采用 RedisTemplate 操作 Redis会自动从 Spring 中获取
key-prefix: wa # Redis Key 的前缀

View File

@ -138,18 +138,16 @@ logging:
--- #################### 微信公众号、小程序相关配置 ####################
wx:
mp: # 公众号配置(必填),参见 https://github.com/Wechat-Group/WxJava/blob/develop/spring-boot-starters/wx-java-mp-spring-boot-starter/README.md 文档
# app-id: wx041349c6f39b268b
# secret: 5abee519483bc9f8cb37ce280e814bd0
app-id: wx9943f95048ba8472
secret: f1f5625f210142b6ae31a06c699826df
token: znkjfwprod
aesKey: RmC9DkIpsq6pK2PGxyI4HQaDHrv5W7de8PXeAO3lqM9
# 存储配置,解决 AccessToken 的跨节点的共享
config-storage:
type: RedisTemplate # 采用 RedisTemplate 操作 Redis会自动从 Spring 中获取
key-prefix: wx # Redis Key 的前缀
http-client-type: HttpClient # 采用 HttpClient 请求微信公众号平台
miniapp: # 小程序配置(必填),参见 https://github.com/Wechat-Group/WxJava/blob/develop/spring-boot-starters/wx-java-miniapp-spring-boot-starter/README.md 文档
# appid: wx62056c0d5e8db250
# secret: 333ae72f41552af1e998fe1f54e1584a
appid: wx2919e237e6018bea # wenhualian的接口测试号
secret: ad7ab17918f6defa85a9677778eb7780
config-storage:

View File

@ -29,4 +29,14 @@
system_labor_contract
where deleted = 0 and user_id = #{userId}
</select>
<select id="selectListByRemindDate" resultType="cn.iocoder.yudao.module.system.dal.dataobject.laborcontract.LaborContractDO">
SELECT
*
FROM
system_labor_contract
WHERE
DATE_ADD(signing_date, INTERVAL probation_period_time MONTH) = #{remindDate}
AND status = 1
AND deleted = 0
</select>
</mapper>

View File

@ -21,6 +21,7 @@
a.dept_id = b.id
and a.status = 0
and a.user_type = 1
and a.deleted = 0
and a.dept_id in
<foreach collection="list" item="deptIds" open="(" close=")" separator=",">
#{deptIds}
@ -170,14 +171,12 @@
<select id="selectListByCondition"
resultType="cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO">
select
a.*
DISTINCT a.*
from system_users AS a
<if test="menuList != null and menuList.size() > 0">
<if test="roleCodeList != null and roleCodeList.size() > 0">
LEFT JOIN system_user_role AS b ON a.id = b.user_id
AND b.deleted = 0
LEFT JOIN system_role_menu AS c ON b.role_id = c.role_id
AND c.deleted = 0
LEFT JOIN system_menu AS d ON c.menu_id = d.id
LEFT JOIN system_role AS c ON b.role_id = c.id
AND c.deleted = 0
</if>
<where>
@ -194,10 +193,10 @@
<if test="status != null">
and a.status = #{status}
</if>
<if test="menuList != null and menuList.size() > 0">
and d.permission in
<foreach collection="menuList" item="menu" open="(" close=")" separator=",">
#{menu}
<if test="roleCodeList != null and roleCodeList.size() > 0">
and c.code in
<foreach collection="roleCodeList" item="roleCode" open="(" close=")" separator=",">
#{roleCode}
</foreach>
</if>
</where>

View File

@ -122,29 +122,6 @@ logging:
# 配置自己写的 MyBatis Mapper 打印日志
cn.iocoder.yudao.module.smartfactory.dal.mysql: debug
--- #################### 微信公众号、小程序相关配置 ####################
wx:
mp: # 公众号配置(必填),参见 https://github.com/Wechat-Group/WxJava/blob/develop/spring-boot-starters/wx-java-mp-spring-boot-starter/README.md 文档
# app-id: wx041349c6f39b268b
# secret: 5abee519483bc9f8cb37ce280e814bd0
app-id: wx9943f95048ba8472 # 测试号
secret: f1f5625f210142b6ae31a06c699826df
token: aikaidevtest
aesKey: RmC9DkIpsq6pK2PGxyI4HQaDHrv5W7de8PXeAO3lqM9
# 存储配置,解决 AccessToken 的跨节点的共享
config-storage:
type: RedisTemplate # 采用 RedisTemplate 操作 Redis会自动从 Spring 中获取
key-prefix: wx # Redis Key 的前缀
http-client-type: HttpClient # 采用 HttpClient 请求微信公众号平台
miniapp: # 小程序配置(必填),参见 https://github.com/Wechat-Group/WxJava/blob/develop/spring-boot-starters/wx-java-miniapp-spring-boot-starter/README.md 文档
# appid: wx62056c0d5e8db250
# secret: 333ae72f41552af1e998fe1f54e1584a
appid: wx63c280fe3248a3e7 # wenhualian的接口测试号
secret: 6f270509224a7ae1296bbf1c8cb97aed
config-storage:
type: RedisTemplate # 采用 RedisTemplate 操作 Redis会自动从 Spring 中获取
key-prefix: wa # Redis Key 的前缀
http-client-type: HttpClient # 采用 HttpClient 请求微信公众号平台
--- #################### 芋道相关配置 ####################