xiangpei
2024-08-16 983b100e79431dea9a471168dae451d2f7399b76
ycl-server/src/main/java/com/ycl/platform/service/impl/ReportServiceImpl.java
@@ -63,6 +63,9 @@
        Report entity = ReportForm.getEntityByForm(form, null);
        entity.setStatus(0);
        entity.setIdentify(IdUtils.timeAddRandomNO(3));
        Date now = new Date();
        entity.setCreateTime(now);
        entity.setUpdateTime(now);
        if(baseMapper.insert(entity) > 0) {
            return Result.ok("添加成功");
        }
@@ -80,7 +83,8 @@
        Report entity = baseMapper.selectById(form.getId());
        // 为空抛IllegalArgumentException,做全局异常处理
        Assert.notNull(entity, "记录不存在");
        Date now = new Date();
        entity.setUpdateTime(now);
        if (0 == entity.getStatus()) {
            // 待审核的直接改
            BeanUtils.copyProperties(form, entity);