Merge remote-tracking branch 'origin/master'
Some checks are pending
Gitea Actions Demo / Explore-Gitea-Actions (push) Waiting to run

This commit is contained in:
2025-07-27 19:47:17 +08:00
20 changed files with 92 additions and 49 deletions

View File

@@ -40,7 +40,7 @@ public class CapitalApplicationController extends BaseController {
/** /**
* 查询资产申请列表 * 查询资产申请列表
*/ */
@SaCheckPermission("domain:application:list") // @SaCheckPermission("domain:application:list")
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo<CapitalApplicationVo> list(CapitalApplicationBo bo, PageQuery pageQuery) { public TableDataInfo<CapitalApplicationVo> list(CapitalApplicationBo bo, PageQuery pageQuery) {
return capitalApplicationService.queryPageList(bo, pageQuery); return capitalApplicationService.queryPageList(bo, pageQuery);
@@ -72,7 +72,7 @@ public class CapitalApplicationController extends BaseController {
/** /**
* 新增资产申请 * 新增资产申请
*/ */
@SaCheckPermission("domain:application:add") // @SaCheckPermission("domain:application:add")
@Log(title = "资产申请", businessType = BusinessType.INSERT) @Log(title = "资产申请", businessType = BusinessType.INSERT)
@RepeatSubmit() @RepeatSubmit()
@PostMapping() @PostMapping()

View File

@@ -59,10 +59,6 @@ public class AttendanceClockDate extends TenantEntity {
*/ */
private String reason; private String reason;
/**
* 创建人
*/
private Long createdBy;
} }

View File

@@ -36,7 +36,7 @@ public class AttendanceGroup extends TenantEntity {
/** /**
* 状态(1:启用,0:禁用) * 状态(1:启用,0:禁用)
*/ */
private Long status; private Integer status;
/** /**
* 考勤类型(0:固定班制,1:排班制) * 考勤类型(0:固定班制,1:排班制)

View File

@@ -36,7 +36,7 @@ public class CapitalInfo extends TenantEntity {
/** /**
* 资产类型 * 资产类型
*/ */
private String capitalType; private Long capitalType;
/** /**
* 规格 * 规格

View File

@@ -49,6 +49,11 @@ public class TbVisitorManagement extends TenantEntity {
*/ */
private String visitingReason; private String visitingReason;
/**
* 类型0拜访1邀约
*/
private Integer type;
/** /**
* 被访人 * 被访人
*/ */

View File

@@ -58,10 +58,6 @@ public class AttendanceClockDateBo extends BaseEntity {
*/ */
private String reason; private String reason;
/**
* 创建人
*/
private Long createdBy;
} }

View File

@@ -40,7 +40,7 @@ public class AttendanceGroupBo extends BaseEntity {
/** /**
* 状态(1:启用,0:禁用) * 状态(1:启用,0:禁用)
*/ */
private Long status; private Integer status;
/** /**
* 考勤类型(0:固定班制,1:排班制) * 考勤类型(0:固定班制,1:排班制)

View File

@@ -34,7 +34,7 @@ public class AttendanceWeekSetBo extends BaseEntity {
/** /**
* 星期1代表周一7代表周日 * 星期1代表周一7代表周日
*/ */
private Long dayOfWeek; private Integer dayOfWeek;
/** /**
* 是否休息0不休息1休息 * 是否休息0不休息1休息

View File

@@ -95,7 +95,7 @@ public class CapitalApplicationBo extends BaseEntity {
* 申请时间 * 申请时间
*/ */
private Date applicationTime; private Date applicationTime;
@NotEmpty(message = "资产不能为空", groups = { AddGroup.class, EditGroup.class })
private List<CapitalInfoBo> capitalInfoBolist; private List<CapitalInfoBo> capitalInfoBolist;

View File

@@ -37,7 +37,7 @@ public class CapitalInfoBo extends BaseEntity {
* 资产类型 * 资产类型
*/ */
@NotBlank(message = "资产类型不能为空", groups = { AddGroup.class, EditGroup.class }) @NotBlank(message = "资产类型不能为空", groups = { AddGroup.class, EditGroup.class })
private String capitalType; private Long capitalType;
/** /**
* 规格 * 规格

View File

@@ -52,6 +52,9 @@ public class TbVisitorManagementBo extends BaseEntity {
@NotBlank(message = "拜访事由不能为空", groups = { AddGroup.class, EditGroup.class }) @NotBlank(message = "拜访事由不能为空", groups = { AddGroup.class, EditGroup.class })
private String visitingReason; private String visitingReason;
@NotBlank(message = "类型不能为空", groups = { AddGroup.class, EditGroup.class })
private Integer type;
/** /**
* 被访人 * 被访人
*/ */

View File

@@ -22,6 +22,10 @@ public class StatusConstant {
public static final Integer SINGLEDATE = 0; public static final Integer SINGLEDATE = 0;
public static final Integer DATERANGE = 1; public static final Integer DATERANGE = 1;
//启用禁用0禁用 1启用
public static final Integer DISABLE = 0;
public static final Integer ENABLE = 1;
public static final Integer NORMAL = 1; public static final Integer NORMAL = 1;

View File

@@ -73,11 +73,6 @@ public class AttendanceClockDateVo implements Serializable {
@ExcelProperty(value = "必须/无需打卡原因") @ExcelProperty(value = "必须/无需打卡原因")
private String reason; private String reason;
/**
* 创建人
*/
@ExcelProperty(value = "创建人")
private Long createdBy;
} }

View File

@@ -1,15 +1,12 @@
package org.dromara.property.domain.vo; package org.dromara.property.domain.vo;
import org.dromara.property.domain.AttendanceGroup; import org.dromara.property.domain.*;
import cn.idev.excel.annotation.ExcelIgnoreUnannotated; import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
import cn.idev.excel.annotation.ExcelProperty; import cn.idev.excel.annotation.ExcelProperty;
import org.dromara.common.excel.annotation.ExcelDictFormat; import org.dromara.common.excel.annotation.ExcelDictFormat;
import org.dromara.common.excel.convert.ExcelDictConvert; import org.dromara.common.excel.convert.ExcelDictConvert;
import io.github.linpeilie.annotations.AutoMapper; import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data; import lombok.Data;
import org.dromara.property.domain.AttendanceShift;
import org.dromara.property.domain.AttendanceWeekSet;
import org.dromara.property.domain.AttendanceWeeksetShift;
import java.io.Serial; import java.io.Serial;
import java.io.Serializable; import java.io.Serializable;
@@ -62,5 +59,7 @@ public class AttendanceGroupVo implements Serializable {
List<AttendanceShift> attendanceList; List<AttendanceShift> attendanceList;
List<AttendanceClockDate> clockDateList;
} }

View File

@@ -14,7 +14,7 @@ import lombok.Data;
import java.io.Serial; import java.io.Serial;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
@@ -131,5 +131,9 @@ public class CapitalApplicationVo implements Serializable {
@ExcelProperty(value = "搜索值") @ExcelProperty(value = "搜索值")
private String searchValue; private String searchValue;
/**
* 资产信息
*/
private List<CapitalInfoVo> capitalInfoVoList;
} }

View File

@@ -45,7 +45,7 @@ public class CapitalInfoVo implements Serializable {
* 资产类型 * 资产类型
*/ */
@ExcelProperty(value = "资产类型") @ExcelProperty(value = "资产类型")
private String capitalType; private Long capitalType;
/** /**
* 规格 * 规格

View File

@@ -69,6 +69,9 @@ public class TbVisitorManagementVo implements Serializable {
@ExcelProperty(value = "被访人") @ExcelProperty(value = "被访人")
private String interviewedPerson; private String interviewedPerson;
@ExcelProperty(value = "访客类型")
private Integer type;
/** /**
* 被访单位 * 被访单位
*/ */

View File

@@ -80,7 +80,7 @@ public class AttendanceClockDateServiceImpl implements IAttendanceClockDateServi
lqw.eq(bo.getStartDate() != null, AttendanceClockDate::getStartDate, bo.getStartDate()); lqw.eq(bo.getStartDate() != null, AttendanceClockDate::getStartDate, bo.getStartDate());
lqw.eq(bo.getEndDate() != null, AttendanceClockDate::getEndDate, bo.getEndDate()); lqw.eq(bo.getEndDate() != null, AttendanceClockDate::getEndDate, bo.getEndDate());
lqw.eq(StringUtils.isNotBlank(bo.getReason()), AttendanceClockDate::getReason, bo.getReason()); lqw.eq(StringUtils.isNotBlank(bo.getReason()), AttendanceClockDate::getReason, bo.getReason());
lqw.eq(bo.getCreatedBy() != null, AttendanceClockDate::getCreatedBy, bo.getCreatedBy()); // lqw.eq(bo.getCreateBy() != null, AttendanceClockDate::getCreateBy, bo.getCreateBy());
return lqw; return lqw;
} }

View File

@@ -74,6 +74,7 @@ public class AttendanceGroupServiceImpl implements IAttendanceGroupService {
List<AttendanceShift> shifts = attendanceShiftMapper.selectList(Wrappers.<AttendanceShift>lambdaQuery().in(AttendanceShift::getId, shiftIds)); List<AttendanceShift> shifts = attendanceShiftMapper.selectList(Wrappers.<AttendanceShift>lambdaQuery().in(AttendanceShift::getId, shiftIds));
//1.6将查询后的数据封装到attendanceGroupVo中 //1.6将查询后的数据封装到attendanceGroupVo中
vo.setAttendanceList(shifts); vo.setAttendanceList(shifts);
vo.setWeekList(weekSets);
} else if(Objects.equals(attendanceType, SHIFTSCHEDULE)) { } else if(Objects.equals(attendanceType, SHIFTSCHEDULE)) {
//2.排班制 //2.排班制
//2.1根据id参数查询考勤周期表 //2.1根据id参数查询考勤周期表
@@ -90,6 +91,10 @@ public class AttendanceGroupServiceImpl implements IAttendanceGroupService {
vo.setAttendanceList(shifts); vo.setAttendanceList(shifts);
} }
//根据id查询attendance_clock_date表
List<AttendanceClockDate> clockDates = attendanceClockDateMapper.selectList(Wrappers.<AttendanceClockDate>lambdaQuery().eq(AttendanceClockDate::getGroupId, id));
vo.setClockDateList(clockDates);
return vo; return vo;
} }
@@ -140,6 +145,9 @@ public class AttendanceGroupServiceImpl implements IAttendanceGroupService {
@Override @Override
public Boolean insertByBo(AttendanceGroupBo bo) { public Boolean insertByBo(AttendanceGroupBo bo) {
AttendanceGroup add = MapstructUtils.convert(bo, AttendanceGroup.class); AttendanceGroup add = MapstructUtils.convert(bo, AttendanceGroup.class);
if (bo.getStatus() == null) {
add.setStatus(StatusConstant.ENABLE);
}
validEntityBeforeSave(add); validEntityBeforeSave(add);
@@ -163,6 +171,7 @@ public class AttendanceGroupServiceImpl implements IAttendanceGroupService {
BeanUtils.copyProperties(weekSet, attendanceWeekSet); BeanUtils.copyProperties(weekSet, attendanceWeekSet);
attendanceWeekSet.setGroupId(add.getId()); attendanceWeekSet.setGroupId(add.getId());
attendanceWeekSet.setDayOfWeek(weekSet.getDayOfWeek()); attendanceWeekSet.setDayOfWeek(weekSet.getDayOfWeek());
// attendanceWeekSet.setShiftId(weekSet.getShiftId());
weekSetMapper.insert(attendanceWeekSet); weekSetMapper.insert(attendanceWeekSet);
//查询出周期表的id //查询出周期表的id
Long weekSetId = attendanceWeekSet.getId(); Long weekSetId = attendanceWeekSet.getId();
@@ -209,6 +218,7 @@ public class AttendanceGroupServiceImpl implements IAttendanceGroupService {
} }
// insertAttendaanceClockDate(bo);
return flag; return flag;
} }
@@ -254,6 +264,28 @@ public class AttendanceGroupServiceImpl implements IAttendanceGroupService {
AttendanceGroup update = MapstructUtils.convert(bo, AttendanceGroup.class); AttendanceGroup update = MapstructUtils.convert(bo, AttendanceGroup.class);
validEntityBeforeSave(update); validEntityBeforeSave(update);
//根据参数判断当前是固定班制还是排班制
if (Objects.equals(update.getAttendanceType(), FIXEDSCHEDULE)) {
//1.固定班制
//取出考勤组id
Long groupId = update.getId();
//根据考勤组id查询出attendance_week_set表中的数据
List<AttendanceWeekSet> weekSets = weekSetMapper.selectList(Wrappers.<AttendanceWeekSet>lambdaQuery().eq(AttendanceWeekSet::getGroupId, groupId));
//根据weekSets修改考勤周期表中的数据
weekSets.forEach(
weekSet -> {
AttendanceWeekSet attendanceWeekSet = new AttendanceWeekSet();
BeanUtils.copyProperties(weekSet, attendanceWeekSet);
attendanceWeekSet.setGroupId(update.getId());
attendanceWeekSet.setDayOfWeek(weekSet.getDayOfWeek());
attendanceWeekSet.setShiftId(weekSet.getShiftId());
weekSetMapper.updateById(attendanceWeekSet);
}
);
}
return baseMapper.updateById(update) > 0; return baseMapper.updateById(update) > 0;
} }

View File

@@ -1,6 +1,7 @@
package org.dromara.property.service.impl; package org.dromara.property.service.impl;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.ObjectUtil;
import org.dromara.common.core.utils.MapstructUtils; import org.dromara.common.core.utils.MapstructUtils;
import org.dromara.common.core.utils.StringUtils; import org.dromara.common.core.utils.StringUtils;
import org.dromara.common.mybatis.core.page.TableDataInfo; import org.dromara.common.mybatis.core.page.TableDataInfo;
@@ -11,7 +12,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.dromara.property.domain.*; import org.dromara.property.domain.*;
import org.dromara.property.domain.vo.CostItemsVo; import org.dromara.property.domain.vo.CapitalInfoVo;
import org.dromara.property.mapper.*; import org.dromara.property.mapper.*;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.dromara.property.domain.bo.CapitalApplicationBo; import org.dromara.property.domain.bo.CapitalApplicationBo;
@@ -19,10 +20,7 @@ import org.dromara.property.domain.vo.CapitalApplicationVo;
import org.dromara.property.service.ICapitalApplicationService; import org.dromara.property.service.ICapitalApplicationService;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.Date; import java.util.*;
import java.util.List;
import java.util.Map;
import java.util.Collection;
/** /**
* 资产申请Service业务层处理 * 资产申请Service业务层处理
@@ -86,16 +84,20 @@ public class CapitalApplicationServiceImpl implements ICapitalApplicationService
if (CollUtil.isNotEmpty(suppliersList)) { if (CollUtil.isNotEmpty(suppliersList)) {
Suppliers suppliers = suppliersList.stream() Suppliers suppliers = suppliersList.stream()
.filter(vo -> vo.getId() != null && vo.getId().equals(capitalApplicationVo.getSupplier())).findFirst().orElse(null); .filter(vo -> vo.getId() != null && vo.getId().equals(capitalApplicationVo.getSupplier())).findFirst().orElse(null);
capitalApplicationVo.setSupplierName(suppliers.getSuppliersName()); capitalApplicationVo.setSupplierName(ObjectUtil.isNotEmpty(suppliers)?suppliers.getSuppliersName():null);
} }
if (CollUtil.isNotEmpty(residentPeopleList)) { if (CollUtil.isNotEmpty(residentPeopleList)) {
ResidentPerson residentPerson = residentPeopleList.stream() ResidentPerson residentPerson = residentPeopleList.stream()
.filter(vo -> vo.getId() != null && vo.getId().equals(capitalApplicationVo.getApplicat())).findFirst().orElse(null); .filter(vo -> vo.getId() != null && vo.getId().equals(capitalApplicationVo.getApplicat())).findFirst().orElse(null);
capitalApplicationVo.setApplicatName(residentPerson.getUserName()); capitalApplicationVo.setApplicatName(ObjectUtil.isNotEmpty(residentPerson)?residentPerson.getUserName():null);
ResidentPerson residentPersons = residentPeopleList.stream() ResidentPerson residentPersons = residentPeopleList.stream()
.filter(vo -> vo.getId() != null && vo.getId().equals(capitalApplicationVo.getAudit())).findFirst().orElse(null); .filter(vo -> vo.getId() != null && vo.getId().equals(capitalApplicationVo.getAudit())).findFirst().orElse(null);
capitalApplicationVo.setAuditName(residentPersons.getUserName()); capitalApplicationVo.setAuditName(ObjectUtil.isNotEmpty(residentPersons)?residentPersons.getUserName():null);
} }
LambdaQueryWrapper<CapitalInfo> capitalInfoWrapper = new LambdaQueryWrapper<>();
capitalInfoWrapper.eq(CapitalInfo::getCapitalApplicationId,capitalApplicationVo.getId());
List<CapitalInfoVo> capitalInfoVoList = capitalMapper.selectVoList(capitalInfoWrapper);
capitalApplicationVo.setCapitalInfoVoList(capitalInfoVoList);
} }
/** /**
@@ -137,6 +139,7 @@ public class CapitalApplicationServiceImpl implements ICapitalApplicationService
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public Boolean insertByBo(CapitalApplicationBo bo) { public Boolean insertByBo(CapitalApplicationBo bo) {
CapitalApplication add = MapstructUtils.convert(bo, CapitalApplication.class); CapitalApplication add = MapstructUtils.convert(bo, CapitalApplication.class);
validEntityBeforeSave(add);
boolean flag = baseMapper.insert(add) > 0; boolean flag = baseMapper.insert(add) > 0;
if (flag) { if (flag) {
bo.setId(add.getId()); bo.setId(add.getId());
@@ -145,7 +148,7 @@ public class CapitalApplicationServiceImpl implements ICapitalApplicationService
CapitalInfo capitalInfo = MapstructUtils.convert(s, CapitalInfo.class); CapitalInfo capitalInfo = MapstructUtils.convert(s, CapitalInfo.class);
capitalMapper.insert(capitalInfo); capitalMapper.insert(capitalInfo);
//validCapitalInfoBefore(add,capitalInfo); //validCapitalInfoBefore(add,capitalInfo);
validEntityBeforeSave(add);
}); });
} }
return flag; return flag;
@@ -162,16 +165,19 @@ public class CapitalApplicationServiceImpl implements ICapitalApplicationService
public Boolean updateByBo(CapitalApplicationBo bo) { public Boolean updateByBo(CapitalApplicationBo bo) {
CapitalApplication update = MapstructUtils.convert(bo, CapitalApplication.class); CapitalApplication update = MapstructUtils.convert(bo, CapitalApplication.class);
validEntityBeforeUpdate(update); validEntityBeforeUpdate(update);
bo.getCapitalInfoBolist().stream().forEach(s -> { if(CollUtil.isNotEmpty(bo.getCapitalInfoBolist())){
CapitalInfo capitalInfo = MapstructUtils.convert(s, CapitalInfo.class); bo.getCapitalInfoBolist().stream().forEach(s -> {
capitalMapper.deleteById(capitalInfo); CapitalInfo capitalInfo = MapstructUtils.convert(s, CapitalInfo.class);
capitalMapper.insert(capitalInfo); capitalMapper.deleteById(capitalInfo);
//TODO 做一些数据校验,如唯一约束 capitalMapper.insert(capitalInfo);
CapitalApplication capitalApplication = baseMapper.selectById(bo.getId()); //TODO 做一些数据校验,如唯一约束
if (bo.getState().equals("1") && !bo.getState().equals(capitalApplication.getState())) { CapitalApplication capitalApplication = baseMapper.selectById(bo.getId());
validCapitalInfoBefore(update, capitalInfo); if (bo.getState().equals("1") && !bo.getState().equals(capitalApplication.getState())) {
} validCapitalInfoBefore(update, capitalInfo);
}); }
});
}
return baseMapper.updateById(update) > 0; return baseMapper.updateById(update) > 0;
} }
@@ -186,7 +192,7 @@ public class CapitalApplicationServiceImpl implements ICapitalApplicationService
List<Asset> assets = assetsMapper.selectList(assetQueryWrapper); List<Asset> assets = assetsMapper.selectList(assetQueryWrapper);
if (assets.isEmpty()) { if (assets.isEmpty()) {
Asset asset = new Asset(); Asset asset = new Asset();
asset.setModel(capitalInfo.getCapitalType()); asset.setModel(capitalInfo.getCapitalType().toString());
asset.setName(capitalInfo.getCapitalName()); asset.setName(capitalInfo.getCapitalName());
asset.setSpecs(capitalInfo.getSpec()); asset.setSpecs(capitalInfo.getSpec());
asset.setSpecs(capitalInfo.getSpec()); asset.setSpecs(capitalInfo.getSpec());
@@ -214,7 +220,7 @@ public class CapitalApplicationServiceImpl implements ICapitalApplicationService
* 保存前的数据校验 * 保存前的数据校验
*/ */
private void validEntityBeforeSave(CapitalApplication entity) { private void validEntityBeforeSave(CapitalApplication entity) {
entity.setState("0");
} }
/** /**