文档更新和bug修复:
- 文档中添加了关于字符串、字节和void数据类型的说明。 - 修正了用户创建操作中的SQL错误,确保UUID正确分配。 - 调整了EntityClass中的重新加载机制,以遵循`flush`参数设置,防止在刷新时意外刷新新实体。
This commit is contained in:
parent
67acf8550a
commit
12fc7df44c
@ -24,6 +24,10 @@ public class Constants {
|
||||
public static final Integer TRUE = 1;
|
||||
|
||||
|
||||
public static final String TRUE_STR = "true";
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 考勤前缀
|
||||
*/
|
||||
|
@ -4,10 +4,13 @@ import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.supplier.BpmOASupplierPageReqVO;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.supplier.BpmOASupplierProductRespVO;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.supplier.BpmOASupplierRespVO;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.supplier.BpmOASupplierSaveReqVO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOASupplierDO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOASupplierProductDO;
|
||||
import cn.iocoder.yudao.module.bpm.service.oa.BpmOASupplierService;
|
||||
import cn.iocoder.yudao.module.bpm.service.oa.BpmOaSupplierProductService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
@ -17,6 +20,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@ -28,6 +32,9 @@ public class BpmOaSupplierController {
|
||||
|
||||
@Resource
|
||||
private BpmOASupplierService oaSupplierService;
|
||||
@Resource
|
||||
private BpmOaSupplierProductService oaSupplierProductService;
|
||||
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建OA供应商审核")
|
||||
@ -59,7 +66,11 @@ public class BpmOaSupplierController {
|
||||
@PreAuthorize("@ss.hasPermission('bpm:oa-supplier:query')")
|
||||
public CommonResult<BpmOASupplierRespVO> getOaSupplier(@RequestParam("id") Long id) {
|
||||
BpmOASupplierDO oaSupplier = oaSupplierService.getOaSupplier(id);
|
||||
return success(BeanUtils.toBean(oaSupplier, BpmOASupplierRespVO.class));
|
||||
BpmOASupplierRespVO vo = BeanUtils.toBean(oaSupplier, BpmOASupplierRespVO.class);
|
||||
List<BpmOASupplierProductDO> items = oaSupplierProductService.getByOaSupplierId(id);
|
||||
List<BpmOASupplierProductRespVO> itemVos = BeanUtils.toBean(items, BpmOASupplierProductRespVO.class);
|
||||
vo.setItems(itemVos);
|
||||
return success(vo);
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
|
@ -54,6 +54,9 @@ public class BpmOASupplierPageReqVO extends PageParam {
|
||||
@Schema(description = "申请结果")
|
||||
private Integer result;
|
||||
|
||||
@Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "流程实例的编号", example = "13296")
|
||||
private String processInstanceId;
|
||||
|
||||
|
@ -1,9 +1,13 @@
|
||||
package cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.supplier;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.UploadUserFile;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "管理后台 - OA供应商审核 Response VO")
|
||||
@Data
|
||||
@ -45,16 +49,21 @@ public class BpmOASupplierRespVO {
|
||||
@Schema(description = "银行开户行")
|
||||
private String bankAccountOpeningBank;
|
||||
|
||||
@Schema(description = "附件信息")
|
||||
private String fileItems;
|
||||
@TableField(typeHandler = JacksonTypeHandler.class)
|
||||
private List<UploadUserFile> fileItems;
|
||||
|
||||
@Schema(description = "申请结果", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Integer result;
|
||||
|
||||
@Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "流程实例的编号", example = "13296")
|
||||
private String processInstanceId;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "子列表", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private List<BpmOASupplierProductRespVO> items;
|
||||
}
|
||||
|
@ -52,9 +52,11 @@ public class BpmOASupplierSaveReqVO {
|
||||
private List<UploadUserFile> fileItems;
|
||||
|
||||
@Schema(description = "申请结果", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "申请结果不能为空")
|
||||
private Integer result;
|
||||
|
||||
@Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "流程实例的编号", example = "13296")
|
||||
private String processInstanceId;
|
||||
|
||||
|
@ -1,15 +1,23 @@
|
||||
package cn.iocoder.yudao.module.bpm.dal.dataobject.oa;
|
||||
|
||||
import lombok.*;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.common.pojo.UploadUserFile;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* OA供应商审核 DO
|
||||
*
|
||||
* @author 艾楷
|
||||
*/
|
||||
@TableName("bpm_oa_supplier")
|
||||
@TableName(value = "bpm_oa_supplier", autoResultMap = true)
|
||||
@KeySequence("bpm_oa_supplier_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ -71,11 +79,16 @@ public class BpmOASupplierDO extends BaseDO {
|
||||
/**
|
||||
* 附件信息
|
||||
*/
|
||||
private String fileItems;
|
||||
@TableField(typeHandler = JacksonTypeHandler.class)
|
||||
private List<UploadUserFile> fileItems;
|
||||
/**
|
||||
* 申请结果
|
||||
*/
|
||||
private Integer result;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 流程实例的编号
|
||||
*/
|
||||
|
@ -6,6 +6,7 @@ import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.supplier.BpmOASupplier
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOASupplierProductDO;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* OA供应商商品 Service 接口
|
||||
@ -52,4 +53,11 @@ public interface BpmOaSupplierProductService {
|
||||
*/
|
||||
PageResult<BpmOASupplierProductDO> getOaSupplierProductPage(BpmOASupplierProductPageReqVO pageReqVO);
|
||||
|
||||
/**
|
||||
* 通过OaSupplierId获取列表
|
||||
*
|
||||
* @param oaSupplierId
|
||||
* @return
|
||||
*/
|
||||
List<BpmOASupplierProductDO> getByOaSupplierId(Long oaSupplierId);
|
||||
}
|
||||
|
@ -6,10 +6,12 @@ import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.supplier.BpmOASupplier
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.supplier.BpmOASupplierProductSaveReqVO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOASupplierProductDO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.mysql.oa.BpmOASupplierProductMapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* OA供应商商品 Service 实现类
|
||||
@ -55,4 +57,10 @@ public class BpmOaSupplierProductServiceImpl implements BpmOaSupplierProductServ
|
||||
return oaSupplierProductMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BpmOASupplierProductDO> getByOaSupplierId(Long oaSupplierId) {
|
||||
return oaSupplierProductMapper.selectList(new LambdaQueryWrapper<BpmOASupplierProductDO>()
|
||||
.eq(BpmOASupplierProductDO::getOaSupplierId, oaSupplierId));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -55,9 +55,9 @@ public class BpmOaSupplierServiceImpl extends BpmOABaseService implements BpmOAS
|
||||
@Resource
|
||||
private SupplierApi supplierApi;
|
||||
/**
|
||||
* OA 现金支出对应的流程定义 KEY
|
||||
* OA 供应商审核 KEY
|
||||
*/
|
||||
public static final String PROCESS_KEY = "oa_supplier";
|
||||
public static final String PROCESS_KEY = "oa_supplier_2";
|
||||
|
||||
@Override
|
||||
public Long createOaSupplier(BpmOASupplierSaveReqVO createReqVO) {
|
||||
|
@ -48,6 +48,9 @@ public class SupplierRpcDTO {
|
||||
@NotNull(message = "申请结果不能为空")
|
||||
private Integer result;
|
||||
|
||||
@Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "流程实例的编号", example = "13296")
|
||||
private String processInstanceId;
|
||||
|
||||
|
@ -46,8 +46,11 @@ public class SupplierPageReqVO extends PageParam {
|
||||
@Schema(description = "附件信息")
|
||||
private String fileItems;
|
||||
|
||||
@Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -57,8 +57,11 @@ public class SupplierRespVO {
|
||||
@ExcelProperty("附件信息")
|
||||
private String fileItems;
|
||||
|
||||
@Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -43,4 +43,7 @@ public class SupplierSaveReqVO {
|
||||
@Schema(description = "附件信息")
|
||||
private String fileItems;
|
||||
|
||||
}
|
||||
@Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String remark;
|
||||
|
||||
}
|
||||
|
@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import java.util.List;
|
||||
@ -72,5 +73,9 @@ public class SupplierDO extends BaseDO {
|
||||
*/
|
||||
@TableField(typeHandler = JacksonTypeHandler.class)
|
||||
private List<UploadUserFile> fileItems;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
}
|
||||
|
@ -282,12 +282,10 @@ public class AttendanceServiceImpl implements AttendanceService {
|
||||
stringRedisTemplate.delete(lastKey);
|
||||
}
|
||||
Object o = stringRedisTemplate.opsForHash().get(key, dateStr);
|
||||
log.info("返回的对象:{}",o);
|
||||
if ("true".equals(String.valueOf(o))){
|
||||
return true;
|
||||
}else {
|
||||
return false;
|
||||
if (o != null) {
|
||||
return Constants.TRUE_STR.equals(String.valueOf(o));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
@ -2,7 +2,6 @@ package cn.iocoder.yudao.module.system.service.attendance.fixed;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.iocoder.yudao.framework.common.Constants;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.date.DateUtils;
|
||||
@ -92,7 +91,7 @@ public class AttendanceFixedServiceImpl implements AttendanceFixedService, Punch
|
||||
}
|
||||
attendanceFixedMapper.updateBatch(editList);
|
||||
}
|
||||
// -- 需要删除的 -
|
||||
// -- 需要删除的 -
|
||||
List<Long> oldIds = oldList.stream().map(AttendanceFixedDO::getId).collect(Collectors.toList());
|
||||
List<Long> newIds = editList.stream().map(AttendanceFixedDO::getId).collect(Collectors.toList());
|
||||
List<Long> delIds = CollectionUtil.subtractToList(oldIds, newIds);
|
||||
@ -168,6 +167,9 @@ public class AttendanceFixedServiceImpl implements AttendanceFixedService, Punch
|
||||
int week = localDateTime.getDayOfWeek().getValue();
|
||||
List<Long> groupIds = fixedList.stream().map(AttendanceGroupDO::getId).collect(Collectors.toList());
|
||||
List<AttendanceFixedDO> attendanceFixedDOS = this.getByGroupIdAndWeek(groupIds, week);
|
||||
// - 获取到补班的列表 - 节假日补班班次
|
||||
List<AttendanceFixedDO> makeUpClassList = this.getByGroupIdAndWeek(groupIds, 8);
|
||||
Map<Long, List<AttendanceFixedDO>> makeUpClassListMap = makeUpClassList.stream().collect(Collectors.groupingBy(AttendanceFixedDO::getAttendanceGroupId));
|
||||
Map<Long, List<AttendanceFixedDO>> attendanceFixedMap = attendanceFixedDOS.stream().collect(Collectors.groupingBy(AttendanceFixedDO::getAttendanceGroupId));
|
||||
for (AttendanceGroupDO activationGroup : fixedList) {
|
||||
// -- 判断是否根据节假日自动排班 - 如果是的话 - 根据排班的来
|
||||
@ -178,7 +180,12 @@ public class AttendanceFixedServiceImpl implements AttendanceFixedService, Punch
|
||||
continue;
|
||||
}
|
||||
AttendanceFixedDO attendanceFixedDO = null;
|
||||
List<AttendanceFixedDO> list = attendanceFixedMap.get(activationGroup.getId());
|
||||
List<AttendanceFixedDO> list;
|
||||
if (isHolidayFlag != null) {
|
||||
list = makeUpClassListMap.get(activationGroup.getId());
|
||||
} else {
|
||||
list = attendanceFixedMap.get(activationGroup.getId());
|
||||
}
|
||||
if (CollectionUtil.isNotEmpty(list)) {
|
||||
attendanceFixedDO = list.get(0);
|
||||
}
|
||||
@ -221,14 +228,13 @@ public class AttendanceFixedServiceImpl implements AttendanceFixedService, Punch
|
||||
// -- 判断是否根据节假日自动排班 - 如果是的话 - 根据排班的来
|
||||
Boolean isHolidayFlag = Constants.TRUE.equals(activationGroup.getAutoHolidaysFlag()) ?
|
||||
attendanceService.isHoliday(dto.getLocalDateTime()) : null;
|
||||
vo.setTodayNeedAttendance(Constants.TRUE);
|
||||
// -- 当前是节假日 并且是放假
|
||||
if (isHolidayFlag != null && isHolidayFlag) {
|
||||
return vo.setTodayNeedAttendance(Constants.FALSE);
|
||||
}
|
||||
//获取到当天是周几
|
||||
int week = dto.getLocalDateTime().getDayOfWeek().getValue();
|
||||
AttendanceFixedDO attendanceFixedDO = this.getByGroupIdAndWeek(activationGroup.getId(), week-1);
|
||||
//获取到当天是周几 - 如果是节假日补班的话 - 班次日期就是8
|
||||
int week = isHolidayFlag != null ? 8 : dto.getLocalDateTime().getDayOfWeek().getValue();
|
||||
AttendanceFixedDO attendanceFixedDO = this.getByGroupIdAndWeek(activationGroup.getId(), week);
|
||||
// -- 当前没有班次 - 不需要考勤
|
||||
if (attendanceFixedDO == null || attendanceFixedDO.getAttendanceGroupShiftId() == null) {
|
||||
return vo.setTodayNeedAttendance(Constants.FALSE);
|
||||
@ -237,7 +243,6 @@ public class AttendanceFixedServiceImpl implements AttendanceFixedService, Punch
|
||||
attendanceService.calculatePunch(dto, vo);
|
||||
vo.setAttendanceGroupId(activationGroup.getId());
|
||||
vo.setUser(dto.getUser());
|
||||
log.info("考勤页面返回:{}",vo);
|
||||
return vo;
|
||||
}
|
||||
|
||||
@ -273,4 +278,4 @@ public class AttendanceFixedServiceImpl implements AttendanceFixedService, Punch
|
||||
return rules;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user