Compare commits

..

No commits in common. "c26f8f723f0310652f67eeffccd4ed529d1bffb7" and "d2af9fdf6b5162443ea364fab5ba0de09be37f65" have entirely different histories.

44 changed files with 154 additions and 521 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,12 +5,9 @@ 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.*;
@ -35,9 +32,6 @@ public class BpmOACashController {
@Resource
private BpmOACashService cashService;
@Resource
private ProjectApi projectApi;
@PostMapping("/create")
@Operation(summary = "创建请求申请")
public CommonResult<Long> createCash(@Valid @RequestBody BpmOACashCreateReqVO createReqVO) {
@ -51,13 +45,8 @@ 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(respVO);
return success(cashService.convertCash(cashDO));
}
@GetMapping("/getByProcessInstanceId")
@ -66,12 +55,7 @@ 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(respVO);
return success(cashService.convertCash(cashDO));
}
}

View File

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

View File

@ -5,12 +5,9 @@ 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.*;
@ -34,9 +31,6 @@ public class BpmOAReimbursementController {
@Resource
private BpmOAReimbursementService service;
@Resource
private ProjectApi projectApi;
@PostMapping("/create")
// @PreAuthorize("@ss.hasPermission('bpm:oa-reimbursement:create')")
@Operation(summary = "创建请求申请")
@ -51,13 +45,7 @@ public class BpmOAReimbursementController {
public CommonResult<BpmOAReimbursementRespVO> getReimbursement(@RequestParam("id") Long id) {
BpmOAReimbursementDO reimbursement = service.getReimbursement(id);
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);
return success(service.convert(reimbursement));
}
// @GetMapping("/page")
@ -74,12 +62,6 @@ public class BpmOAReimbursementController {
public CommonResult<BpmOAReimbursementRespVO> getByProcessInstanceId(@RequestParam("processInstanceId") String processInstanceId) {
BpmOAReimbursementDO reimbursement = service.getByProcessInstanceId(processInstanceId);
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);
return success(service.convert(reimbursement));
}
}

View File

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

View File

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

View File

@ -43,12 +43,6 @@ 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,9 +15,6 @@ 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,11 +50,6 @@ 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,11 +79,6 @@ public class BpmOAReimbursementDO extends BaseDO {
*/
private String totalMoneyChinese;
/**
* 项目编号
*/
private String projectNo;
/**
* 报销类型
*/

View File

@ -1,71 +0,0 @@
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

@ -1,9 +0,0 @@
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,7 +13,6 @@ 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;
@ -40,59 +39,32 @@ public abstract class BpmTaskAssignLeaderAbstractScript implements BpmTaskAssign
// 获得发起人
ProcessInstance processInstance = bpmProcessInstanceService.getProcessInstance(execution.getProcessInstanceId());
Long startUserId = NumberUtils.parseLong(processInstance.getStartUserId());
// 获得发起人部门信息
DeptRespDTO startUserDept = getStartUserDept(startUserId);
// 如果发起人部门为空则直接返回空
if (startUserDept == null) {
return emptySet();
// 获得对应 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;
}
}
// 如果发起人部门层级 小于等于 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)) {
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);
return calculateTaskCandidateUsers(execution, level+1) ;
}else {
return asSet(dept.getLeaderUserId());
return emptySet() ;
}
// // 获得对应 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)
.likeIfPresent(BpmProcessCcDO::getCompanyDeptId, String.valueOf(dto.getId())));
.eqIfPresent(BpmProcessCcDO::getCompanyDeptId, dto.getId()));
}
}

View File

@ -4,10 +4,8 @@ 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 接口
@ -42,14 +40,6 @@ public interface BpmOAReimbursementService {
*/
BpmOAReimbursementDO getReimbursement(Long id);
/**
* 获得指定得报销明细
*
* @param reimbursementId 报销主表编号
* @return 明细列表
*/
List<BpmOAReimbursementItemDO> getReimbursementItem(Long reimbursementId);
BpmOAReimbursementRespVO convert(BpmOAReimbursementDO bpmOAReimbursementDO);
/**

View File

@ -3,6 +3,7 @@ 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;
@ -10,16 +11,15 @@ 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,9 +80,6 @@ public class BpmOAReimbursementServiceImpl extends BpmOABaseService implements B
@Resource
private BpmOAImprestMapper bpmOAImprestMapper;
@Resource
private BpmOAReimbursementItemMapper reimbursementItemMapper;
@Resource
private BpmOAProcureService bpmOAProcureService;
@ -105,11 +102,6 @@ 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,
@ -133,7 +125,7 @@ public class BpmOAReimbursementServiceImpl extends BpmOABaseService implements B
//判断是否有 采购报销
List<Long> procureIds = new ArrayList<>();
for (BpmOAReimbursementItemDO data : createDO) {
for (Reimbursement data : reimbursement.getReimbursements()) {
//报销类别为 采购费时
if ("4".equals(data.getType())) {
@ -166,8 +158,7 @@ public class BpmOAReimbursementServiceImpl extends BpmOABaseService implements B
BpmOAReimbursementDO bpmOAReimbursementDO = validateLeaveExists(id);
// 获取明细数据
List<BpmOAReimbursementItemDO> reimbursements = getReimbursementItem(id);
reimbursementMapper.updateById(new BpmOAReimbursementDO().setId(id).setResult(result));
//审核通过 最后节点
if (BpmProcessInstanceResultEnum.APPROVE.getResult().equals(result)) {
@ -178,13 +169,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 (BpmOAReimbursementItemDO 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 (Reimbursement reimbursement : reimbursements) {
//报销类别为 采购费时
if ("4".equals(reimbursement.getType())) {
procureIds.add(reimbursement.getProcureId());
@ -228,7 +219,7 @@ public class BpmOAReimbursementServiceImpl extends BpmOABaseService implements B
}
}
String reason = reimbursements.stream().map(BpmOAReimbursementItemDO::getDetail)
String reason = reimbursements.stream().map(Reimbursement::getDetail)
.filter(StrUtil::isNotEmpty)
.collect(Collectors.joining(","));
@ -273,14 +264,14 @@ 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);
List<Reimbursement> reimbursements = bpmOAReimbursementDO.getReimbursements();
for (BpmOAReimbursementItemDO reimbursement : reimbursements) {
//直接从数据库取出来的List<Reimbursement> 实际上是List<LinkedHashMap>类型 所以不能直接遍历
//将list再次转为json串然后由json串再转为list
String json = JsonUtils.toJsonString(reimbursements);
reimbursements = JsonUtils.parseArray(json, Reimbursement.class);
for (Reimbursement reimbursement : reimbursements) {
//报销类别为 采购费时
if ("4".equals(reimbursement.getType())) {
@ -303,7 +294,7 @@ public class BpmOAReimbursementServiceImpl extends BpmOABaseService implements B
);
}
}
reimbursementMapper.updateById(new BpmOAReimbursementDO().setId(id).setResult(result));
}
private BpmOAReimbursementDO validateLeaveExists(Long id) {
@ -320,28 +311,19 @@ 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<BpmOAReimbursementItemDO> reimbursements = getReimbursementItem(reimbursementDO.getId());
List<Reimbursement> reimbursement = reimbursementDO.getReimbursements();
// List<Reimbursement> reimbursement = reimbursementDO.getReimbursements();
//
// //直接从数据库取出来的List<Reimbursement> 实际上是List<LinkedHashMap>类型 所以不能直接遍历
// //将list再次转为json串然后由json串再转为list
// String json = JsonUtils.toJsonString(reimbursement);
// reimbursement = JsonUtils.parseArray(json, Reimbursement.class);
//直接从数据库取出来的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 (BpmOAReimbursementItemDO data : reimbursements) {
for (Reimbursement data : reimbursement) {
if (data.getDeptId() != null) {
break;
@ -351,9 +333,9 @@ public class BpmOAReimbursementServiceImpl extends BpmOABaseService implements B
}
//获取部门信息map
Map<Long, DeptRespDTO> deptMap = deptApi.getDeptMap(convertSet(reimbursements, BpmOAReimbursementItemDO::getDeptId));
Map<Long, DeptRespDTO> deptMap = deptApi.getDeptMap(convertSet(reimbursement, Reimbursement::getDeptId));
List<ReimbursementDTO> reimbursementDTOS = BeanUtils.toBean(reimbursements, ReimbursementDTO.class);
List<ReimbursementDTO> reimbursementDTOS = BeanUtils.toBean(reimbursement, ReimbursementDTO.class);
BpmOAReimbursementRespVO bpmOAReimbursementRespVO = BeanUtils.toBean(reimbursementDO, BpmOAReimbursementRespVO.class);
bpmOAReimbursementRespVO.setReimbursements(BpmOAReimbursementConvert.INSTANCE.convertList(reimbursementDTOS, deptMap)); //拼接数据

View File

@ -46,13 +46,25 @@ 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

@ -1,123 +0,0 @@
--- #################### 数据库相关配置 ####################
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,6 +1,7 @@
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;
@ -21,9 +22,4 @@ 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,7 +4,6 @@ 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;
@ -24,10 +23,4 @@ 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,6 +35,9 @@ 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,7 +29,6 @@ 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
@ -181,13 +180,4 @@ 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,6 +32,7 @@ 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 roleCodes) {
List<AdminUserDO> list = userService.getUserListByStatus(userType, deptId, status, roleCodes);
@RequestParam(required = false) String menus) {
List<AdminUserDO> list = userService.getUserListByStatus(userType, deptId, status, menus);
// 拼接数据
Map<Long, DeptDO> deptMap = deptService.getDeptMap(
convertList(list, AdminUserDO::getDeptId));

View File

@ -8,7 +8,6 @@ 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;
/**
@ -36,6 +35,4 @@ public interface LaborContractMapper extends BaseMapperX<LaborContractDO> {
* @return
*/
LaborContractDO getTheEarliestContract(@Param("userId") Long userId);
List<LaborContractDO> selectListByRemindDate(@Param("remindDate")LocalDate remindDate);
}

View File

@ -4,12 +4,9 @@ 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
*
@ -24,16 +21,12 @@ 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("roleCodeList") List<String> roleCodeList);
List<AdminUserDO> selectListByCondition(@Param("userType") Integer userType, @Param("deptIds") List<Long> deptIds, @Param("status") Integer status, @Param("menuList") List<String> menuList);
default List<AdminUserDO> selectListByDeptIds(Collection<Long> deptIds, Integer status) {

View File

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

View File

@ -8,11 +8,10 @@ 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;
@ -32,9 +31,9 @@ public class AttendanceMachineJob {
@Resource
private StringRedisTemplate stringRedisTemplate;
@XxlJob("updateAttendanceMachineStatusJob")
@Scheduled(initialDelay = 5000, fixedRate = 30000)
@TenantJob
public ReturnT<String> execute() {
public void updateAttendanceMachineStatus() {
WebSocketSessionManager webSocketSessionManager = SpringContentUtils.getBean(WebSocketSessionManager.class);
@ -63,8 +62,5 @@ public class AttendanceMachineJob {
attendanceMachineService.updateAttendanceMachineStatus(statusUpdateVOS);
}
// 返回执行成功
return ReturnT.SUCCESS;
}
}

View File

@ -269,17 +269,11 @@ 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>()
.eq(DeptDO::getStatus, CommonStatusEnum.ENABLE.getStatus())
.likeLeft(DeptDO::getFlag, "-" + id)
.or()
.likeRight(DeptDO::getFlag, id + "-")
.or()
.like(DeptDO::getFlag, "-" + id + "-"));
.like(DeptDO::getFlag, id)
.eq(DeptDO::getStatus, CommonStatusEnum.ENABLE.getStatus()));
}
@Override

View File

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

View File

@ -165,10 +165,4 @@ 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,7 +6,6 @@ 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 接口
@ -45,14 +44,6 @@ public interface ProjectService {
*/
ProjectDO getProject(Long id);
/**
* 获得项目管理
*
* @param projectNo 项目编号
* @return 项目
*/
ProjectDO getProject(String projectNo);
/**
* 获得项目管理分页
*
@ -61,10 +52,4 @@ public interface ProjectService {
*/
PageResult<ProjectDO> getProjectPage(ProjectPageReqVO pageReqVO);
/**
* 获得我参与的项目列表
* @param userId 用户编号
* @return 项目列表
*/
List<ProjectDO> getMyProject(Long userId);
}

View File

@ -2,7 +2,6 @@ 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;
@ -12,7 +11,6 @@ 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;
@ -67,23 +65,9 @@ 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 roleCodes 角色编码
* @param menus 菜单
* @return 用户们
*/
List<AdminUserDO> getUserListByStatus(Integer userType, Long deptId, Integer status, String roleCodes);
List<AdminUserDO> getUserListByStatus(Integer userType, Long deptId, Integer status, String menus);
/**
* 判断密码是否匹配

View File

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

View File

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

View File

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

View File

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

View File

@ -122,6 +122,29 @@ 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 请求微信公众号平台
--- #################### 芋道相关配置 ####################