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")
public TableDataInfo<CapitalApplicationVo> list(CapitalApplicationBo bo, PageQuery 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)
@RepeatSubmit()
@PostMapping()

View File

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

View File

@@ -36,7 +36,7 @@ public class AttendanceGroup extends TenantEntity {
/**
* 状态(1:启用,0:禁用)
*/
private Long status;
private Integer status;
/**
* 考勤类型(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;
/**
* 类型0拜访1邀约
*/
private Integer type;
/**
* 被访人
*/

View File

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

View File

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

View File

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

View File

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

View File

@@ -37,7 +37,7 @@ public class CapitalInfoBo extends BaseEntity {
* 资产类型
*/
@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 })
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 DATERANGE = 1;
//启用禁用0禁用 1启用
public static final Integer DISABLE = 0;
public static final Integer ENABLE = 1;
public static final Integer NORMAL = 1;

View File

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

View File

@@ -1,15 +1,12 @@
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.ExcelProperty;
import org.dromara.common.excel.annotation.ExcelDictFormat;
import org.dromara.common.excel.convert.ExcelDictConvert;
import io.github.linpeilie.annotations.AutoMapper;
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.Serializable;
@@ -62,5 +59,7 @@ public class AttendanceGroupVo implements Serializable {
List<AttendanceShift> attendanceList;
List<AttendanceClockDate> clockDateList;
}

View File

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

View File

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

View File

@@ -69,6 +69,9 @@ public class TbVisitorManagementVo implements Serializable {
@ExcelProperty(value = "被访人")
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.getEndDate() != null, AttendanceClockDate::getEndDate, bo.getEndDate());
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;
}

View File

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

View File

@@ -1,6 +1,7 @@
package org.dromara.property.service.impl;
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.StringUtils;
import org.dromara.common.mybatis.core.page.TableDataInfo;
@@ -11,7 +12,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
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.springframework.stereotype.Service;
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.springframework.transaction.annotation.Transactional;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Collection;
import java.util.*;
/**
* 资产申请Service业务层处理
@@ -86,16 +84,20 @@ public class CapitalApplicationServiceImpl implements ICapitalApplicationService
if (CollUtil.isNotEmpty(suppliersList)) {
Suppliers suppliers = suppliersList.stream()
.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)) {
ResidentPerson residentPerson = residentPeopleList.stream()
.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()
.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)
public Boolean insertByBo(CapitalApplicationBo bo) {
CapitalApplication add = MapstructUtils.convert(bo, CapitalApplication.class);
validEntityBeforeSave(add);
boolean flag = baseMapper.insert(add) > 0;
if (flag) {
bo.setId(add.getId());
@@ -145,7 +148,7 @@ public class CapitalApplicationServiceImpl implements ICapitalApplicationService
CapitalInfo capitalInfo = MapstructUtils.convert(s, CapitalInfo.class);
capitalMapper.insert(capitalInfo);
//validCapitalInfoBefore(add,capitalInfo);
validEntityBeforeSave(add);
});
}
return flag;
@@ -162,16 +165,19 @@ public class CapitalApplicationServiceImpl implements ICapitalApplicationService
public Boolean updateByBo(CapitalApplicationBo bo) {
CapitalApplication update = MapstructUtils.convert(bo, CapitalApplication.class);
validEntityBeforeUpdate(update);
bo.getCapitalInfoBolist().stream().forEach(s -> {
CapitalInfo capitalInfo = MapstructUtils.convert(s, CapitalInfo.class);
capitalMapper.deleteById(capitalInfo);
capitalMapper.insert(capitalInfo);
//TODO 做一些数据校验,如唯一约束
CapitalApplication capitalApplication = baseMapper.selectById(bo.getId());
if (bo.getState().equals("1") && !bo.getState().equals(capitalApplication.getState())) {
validCapitalInfoBefore(update, capitalInfo);
}
});
if(CollUtil.isNotEmpty(bo.getCapitalInfoBolist())){
bo.getCapitalInfoBolist().stream().forEach(s -> {
CapitalInfo capitalInfo = MapstructUtils.convert(s, CapitalInfo.class);
capitalMapper.deleteById(capitalInfo);
capitalMapper.insert(capitalInfo);
//TODO 做一些数据校验,如唯一约束
CapitalApplication capitalApplication = baseMapper.selectById(bo.getId());
if (bo.getState().equals("1") && !bo.getState().equals(capitalApplication.getState())) {
validCapitalInfoBefore(update, capitalInfo);
}
});
}
return baseMapper.updateById(update) > 0;
}
@@ -186,7 +192,7 @@ public class CapitalApplicationServiceImpl implements ICapitalApplicationService
List<Asset> assets = assetsMapper.selectList(assetQueryWrapper);
if (assets.isEmpty()) {
Asset asset = new Asset();
asset.setModel(capitalInfo.getCapitalType());
asset.setModel(capitalInfo.getCapitalType().toString());
asset.setName(capitalInfo.getCapitalName());
asset.setSpecs(capitalInfo.getSpec());
asset.setSpecs(capitalInfo.getSpec());
@@ -214,7 +220,7 @@ public class CapitalApplicationServiceImpl implements ICapitalApplicationService
* 保存前的数据校验
*/
private void validEntityBeforeSave(CapitalApplication entity) {
entity.setState("0");
}
/**