From db137098ca20ecaa8937cd626fd86fb32bdf75c9 Mon Sep 17 00:00:00 2001 From: liyanqi <15181887205@163.com> Date: 星期五, 16 九月 2022 16:48:23 +0800 Subject: [PATCH] 上报 --- ycl-common/src/main/java/com/ycl/service/platform/zf/impl/EnforcelawReportServiceImpl.java | 20 ++++++++++++++++++++ 1 files changed, 20 insertions(+), 0 deletions(-) diff --git a/ycl-common/src/main/java/com/ycl/service/platform/zf/impl/EnforcelawReportServiceImpl.java b/ycl-common/src/main/java/com/ycl/service/platform/zf/impl/EnforcelawReportServiceImpl.java index efac0b7..7a52f9a 100644 --- a/ycl-common/src/main/java/com/ycl/service/platform/zf/impl/EnforcelawReportServiceImpl.java +++ b/ycl-common/src/main/java/com/ycl/service/platform/zf/impl/EnforcelawReportServiceImpl.java @@ -1,10 +1,18 @@ package com.ycl.service.platform.zf.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ycl.api.BaseEntity; import com.ycl.entity.platform.zf.EnforcelawReport; +import com.ycl.enums.common.ResultCode; +import com.ycl.exception.ApiException; import com.ycl.mapper.platform.zf.EnforcelawReportMapper; import com.ycl.service.platform.zf.IEnforcelawReportService; +import com.ycl.vo.zf.ZfVO; +import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; /** * <p> @@ -17,4 +25,16 @@ @Service public class EnforcelawReportServiceImpl extends ServiceImpl<EnforcelawReportMapper, EnforcelawReport> implements IEnforcelawReportService { + @Resource + private EnforcelawReportMapper enforcelawReportMapper; + + @Override + @Transactional(rollbackFor = Exception.class) + public void report(ZfVO.ZfReportVO params) { + EnforcelawReport enforcelawReport = new EnforcelawReport(); + BeanUtils.copyProperties(params, enforcelawReport); + if (enforcelawReportMapper.insert(enforcelawReport) != 1) { + throw new ApiException(ResultCode.RECORD_SAVE_FAIL); + } + } } -- Gitblit v1.8.0