diff --git a/jeecg-module-main/src/main/java/org/jeecg/modules/kc/grab/SynchronizationService/SyncTFwdtShryxx.java b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/grab/SynchronizationService/SyncTFwdtShryxx.java new file mode 100644 index 00000000..ba76384e --- /dev/null +++ b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/grab/SynchronizationService/SyncTFwdtShryxx.java @@ -0,0 +1,70 @@ +package org.jeecg.modules.kc.grab.SynchronizationService; + +import cn.hutool.core.bean.BeanUtil; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.compress.utils.Lists; +import org.jeecg.modules.kc.grab.SynchronizationService.base.BaseSync; +import org.jeecg.modules.kc.grab.exports.entity.TFwdtShryxx; +import org.jeecg.modules.kc.grab.exports.entity.TJwKcxxb; +import org.jeecg.modules.kc.grab.exports.service.ITFwdtShryxxService; +import org.jeecg.modules.kc.grab.exports.service.ITJwKcxxbService; +import org.jeecg.modules.kc.grab.imports.entity.Xxhbkcxxb; +import org.jeecg.modules.kc.grab.imports.entity.Xxhbshryxx; +import org.jeecg.modules.kc.grab.imports.entity.Xxhbsynclog; +import org.jeecg.modules.kc.grab.imports.service.IXxhbkcxxbService; +import org.jeecg.modules.kc.grab.imports.service.IXxhbshryxxService; +import org.quartz.JobExecutionContext; +import org.springframework.beans.factory.annotation.Autowired; + +import java.util.List; +import java.util.Map; + +@Slf4j +public class SyncTFwdtShryxx extends BaseSync { + + @Autowired + private ITFwdtShryxxService expService; + + @Autowired + private IXxhbshryxxService impService; + + /** + * 若参数变量名修改 QuartzJobController中也需对应修改 + */ + + @Override + public void execute(JobExecutionContext jobExecutionContext) { + start(); + run(getParamMap()); + end(); + } + + + /** + * 有参定时任务实现 + * @param param + */ + public void run(Map param){ + //查询数据 + List inDataList = expService.list(); + List outDataList = Lists.newArrayList(); + + //清洗数据 + inDataList.forEach(x -> outDataList.add(BeanUtil.toBean(x, Xxhbshryxx.class))); + + //保存到胃 + impService.syncList(outDataList); + + Xxhbsynclog xxhbsynclog = new Xxhbsynclog(); + xxhbsynclog.setSyncRowNum(String.valueOf(outDataList.size())); + saveLog(xxhbsynclog, Xxhbshryxx.class); + } + + /** + * 无参定时任务实现 + */ + public void run(){ + run(null); + } + +} diff --git a/jeecg-module-main/src/main/java/org/jeecg/modules/kc/grab/exports/controller/TFwdtShryxxController.java b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/grab/exports/controller/TFwdtShryxxController.java new file mode 100644 index 00000000..41c63ef7 --- /dev/null +++ b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/grab/exports/controller/TFwdtShryxxController.java @@ -0,0 +1,163 @@ +package org.jeecg.modules.kc.grab.exports.controller; + +import java.util.Arrays; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import org.jeecg.common.api.vo.Result; +import org.jeecg.common.system.query.QueryGenerator; +import org.jeecg.modules.kc.grab.exports.entity.TFwdtShryxx; +import org.jeecg.modules.kc.grab.exports.service.ITFwdtShryxxService; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import lombok.extern.slf4j.Slf4j; + +import org.jeecg.common.system.base.controller.JeecgController; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.servlet.ModelAndView; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.jeecg.common.aspect.annotation.AutoLog; +import org.apache.shiro.authz.annotation.RequiresPermissions; + + /** + * @Description: 同步数据表(shryxx) + * @Author: jeecg-boot + * @Date: 2023-05-24 + * @Version: V1.0 + */ +@Api(tags="同步数据表(shryxx)") +@RestController +@RequestMapping("/grab/xxhbshryxx") +@Slf4j +public class TFwdtShryxxController extends JeecgController { + @Autowired + private ITFwdtShryxxService xxhbshryxxService; + + /** + * 分页列表查询 + * + * @param xxhbshryxx + * @param pageNo + * @param pageSize + * @param req + * @return + */ + //@AutoLog(value = "同步数据表(shryxx)-分页列表查询") + @ApiOperation(value="同步数据表(shryxx)-分页列表查询", notes="同步数据表(shryxx)-分页列表查询") + @GetMapping(value = "/list") + public Result> queryPageList(TFwdtShryxx xxhbshryxx, + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, + HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(xxhbshryxx, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + IPage pageList = xxhbshryxxService.page(page, queryWrapper); + return Result.OK(pageList); + } + + /** + * 添加 + * + * @param xxhbshryxx + * @return + */ + @AutoLog(value = "同步数据表(shryxx)-添加") + @ApiOperation(value="同步数据表(shryxx)-添加", notes="同步数据表(shryxx)-添加") + @RequiresPermissions("grab:xxhbshryxx:add") + @PostMapping(value = "/add") + public Result add(@RequestBody TFwdtShryxx xxhbshryxx) { + xxhbshryxxService.save(xxhbshryxx); + return Result.OK("添加成功!"); + } + + /** + * 编辑 + * + * @param xxhbshryxx + * @return + */ + @AutoLog(value = "同步数据表(shryxx)-编辑") + @ApiOperation(value="同步数据表(shryxx)-编辑", notes="同步数据表(shryxx)-编辑") + @RequiresPermissions("grab:xxhbshryxx:edit") + @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) + public Result edit(@RequestBody TFwdtShryxx xxhbshryxx) { + xxhbshryxxService.updateById(xxhbshryxx); + return Result.OK("编辑成功!"); + } + + /** + * 通过id删除 + * + * @param id + * @return + */ + @AutoLog(value = "同步数据表(shryxx)-通过id删除") + @ApiOperation(value="同步数据表(shryxx)-通过id删除", notes="同步数据表(shryxx)-通过id删除") + @RequiresPermissions("grab:xxhbshryxx:delete") + @DeleteMapping(value = "/delete") + public Result delete(@RequestParam(name="id",required=true) String id) { + xxhbshryxxService.removeById(id); + return Result.OK("删除成功!"); + } + + /** + * 批量删除 + * + * @param ids + * @return + */ + @AutoLog(value = "同步数据表(shryxx)-批量删除") + @ApiOperation(value="同步数据表(shryxx)-批量删除", notes="同步数据表(shryxx)-批量删除") + @RequiresPermissions("grab:xxhbshryxx:deleteBatch") + @DeleteMapping(value = "/deleteBatch") + public Result deleteBatch(@RequestParam(name="ids",required=true) String ids) { + this.xxhbshryxxService.removeByIds(Arrays.asList(ids.split(","))); + return Result.OK("批量删除成功!"); + } + + /** + * 通过id查询 + * + * @param id + * @return + */ + //@AutoLog(value = "同步数据表(shryxx)-通过id查询") + @ApiOperation(value="同步数据表(shryxx)-通过id查询", notes="同步数据表(shryxx)-通过id查询") + @GetMapping(value = "/queryById") + public Result queryById(@RequestParam(name="id",required=true) String id) { + TFwdtShryxx xxhbshryxx = xxhbshryxxService.getById(id); + if(xxhbshryxx==null) { + return Result.error("未找到对应数据"); + } + return Result.OK(xxhbshryxx); + } + + /** + * 导出excel + * + * @param request + * @param xxhbshryxx + */ + @RequiresPermissions("grab:xxhbshryxx:exportXls") + @RequestMapping(value = "/exportXls") + public ModelAndView exportXls(HttpServletRequest request, TFwdtShryxx xxhbshryxx) { + return super.exportXls(request, xxhbshryxx, TFwdtShryxx.class, "同步数据表(shryxx)"); + } + + /** + * 通过excel导入数据 + * + * @param request + * @param response + * @return + */ + @RequiresPermissions("grab:xxhbshryxx:importExcel") + @RequestMapping(value = "/importExcel", method = RequestMethod.POST) + public Result importExcel(HttpServletRequest request, HttpServletResponse response) { + return super.importExcel(request, response, TFwdtShryxx.class); + } + +} diff --git a/jeecg-module-main/src/main/java/org/jeecg/modules/kc/grab/exports/entity/TFwdtShryxx.java b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/grab/exports/entity/TFwdtShryxx.java new file mode 100644 index 00000000..88dcc5e6 --- /dev/null +++ b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/grab/exports/entity/TFwdtShryxx.java @@ -0,0 +1,59 @@ +package org.jeecg.modules.kc.grab.exports.entity; + +import java.io.Serializable; + +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.springframework.format.annotation.DateTimeFormat; +import org.jeecgframework.poi.excel.annotation.Excel; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + * @Description: 同步数据表(shryxx) + * @Author: jeecg-boot + * @Date: 2023-05-24 + * @Version: V1.0 + */ +@Data +@TableName("t_fwdt_shryxx") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@ApiModel(value="TFwdtShryxx对象", description="同步数据表(shryxx)") +public class TFwdtShryxx implements Serializable { + private static final long serialVersionUID = 1L; + + /**工号*/ + @Excel(name = "工号", width = 15) + @ApiModelProperty(value = "工号") + private java.lang.String gh; + /**姓名*/ + @Excel(name = "姓名", width = 15) + @ApiModelProperty(value = "姓名") + private java.lang.String xm; + /**单位号*/ + @Excel(name = "单位号", width = 15) + @ApiModelProperty(value = "单位号") + private java.lang.String dwh; + /**职务代码*/ + @Excel(name = "职务代码", width = 15) + @ApiModelProperty(value = "职务代码") + private java.lang.String zwdm; + /**职务名称*/ + @Excel(name = "职务名称", width = 15) + @ApiModelProperty(value = "职务名称") + private java.lang.String zwmc; + /**年级*/ + @Excel(name = "年级", width = 15) + @ApiModelProperty(value = "年级") + private java.lang.String nj; + /**时间戳*/ + @Excel(name = "时间戳", width = 15, format = "yyyy-MM-dd") + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") + @DateTimeFormat(pattern="yyyy-MM-dd") + @ApiModelProperty(value = "时间戳") + private java.util.Date timestamps; +} diff --git a/jeecg-module-main/src/main/java/org/jeecg/modules/kc/grab/exports/mapper/TFwdtShryxxMapper.java b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/grab/exports/mapper/TFwdtShryxxMapper.java new file mode 100644 index 00000000..c46dd42f --- /dev/null +++ b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/grab/exports/mapper/TFwdtShryxxMapper.java @@ -0,0 +1,14 @@ +package org.jeecg.modules.kc.grab.exports.mapper; + +import org.jeecg.modules.kc.grab.exports.entity.TFwdtShryxx; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * @Description: 同步数据表(shryxx) + * @Author: jeecg-boot + * @Date: 2023-05-24 + * @Version: V1.0 + */ +public interface TFwdtShryxxMapper extends BaseMapper { + +} diff --git a/jeecg-module-main/src/main/java/org/jeecg/modules/kc/grab/exports/mapper/xml/TFwdtShryxxMapper.xml b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/grab/exports/mapper/xml/TFwdtShryxxMapper.xml new file mode 100644 index 00000000..2a402742 --- /dev/null +++ b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/grab/exports/mapper/xml/TFwdtShryxxMapper.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/jeecg-module-main/src/main/java/org/jeecg/modules/kc/grab/exports/service/ITFwdtShryxxService.java b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/grab/exports/service/ITFwdtShryxxService.java new file mode 100644 index 00000000..316d3979 --- /dev/null +++ b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/grab/exports/service/ITFwdtShryxxService.java @@ -0,0 +1,14 @@ +package org.jeecg.modules.kc.grab.exports.service; + +import org.jeecg.modules.kc.grab.exports.entity.TFwdtShryxx; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * @Description: 同步数据表(shryxx) + * @Author: jeecg-boot + * @Date: 2023-05-24 + * @Version: V1.0 + */ +public interface ITFwdtShryxxService extends IService { + +} diff --git a/jeecg-module-main/src/main/java/org/jeecg/modules/kc/grab/exports/service/impl/TFwdtShryxxServiceImpl.java b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/grab/exports/service/impl/TFwdtShryxxServiceImpl.java new file mode 100644 index 00000000..73471f63 --- /dev/null +++ b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/grab/exports/service/impl/TFwdtShryxxServiceImpl.java @@ -0,0 +1,21 @@ +package org.jeecg.modules.kc.grab.exports.service.impl; + +import com.baomidou.dynamic.datasource.annotation.DS; +import org.jeecg.modules.kc.grab.exports.entity.TFwdtShryxx; +import org.jeecg.modules.kc.grab.exports.mapper.TFwdtShryxxMapper; +import org.jeecg.modules.kc.grab.exports.service.ITFwdtShryxxService; +import org.springframework.stereotype.Service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +/** + * @Description: 同步数据表(shryxx) + * @Author: jeecg-boot + * @Date: 2023-05-24 + * @Version: V1.0 + */ +@DS("multi-oracle") +@Service +public class TFwdtShryxxServiceImpl extends ServiceImpl implements ITFwdtShryxxService { + +} diff --git a/jeecg-module-main/src/main/java/org/jeecg/modules/kc/grab/imports/controller/XxhbshryxxController.java b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/grab/imports/controller/XxhbshryxxController.java new file mode 100644 index 00000000..329c0984 --- /dev/null +++ b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/grab/imports/controller/XxhbshryxxController.java @@ -0,0 +1,162 @@ +package org.jeecg.modules.kc.grab.imports.controller; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.jeecg.common.api.vo.Result; +import org.jeecg.common.aspect.annotation.AutoLog; +import org.jeecg.common.system.base.controller.JeecgController; +import org.jeecg.common.system.query.QueryGenerator; +import org.jeecg.modules.kc.grab.imports.entity.Xxhbshryxx; +import org.jeecg.modules.kc.grab.imports.service.IXxhbshryxxService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.servlet.ModelAndView; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.util.Arrays; + + /** + * @Description: 同步数据表(shryxx) + * @Author: jeecg-boot + * @Date: 2023-05-24 + * @Version: V1.0 + */ +@Api(tags="同步数据表(shryxx)") +@RestController +@RequestMapping("/grab/imports/xxhbshryxx") +@Slf4j +public class XxhbshryxxController extends JeecgController { + @Autowired + private IXxhbshryxxService xxhbshryxxService; + + /** + * 分页列表查询 + * + * @param xxhbshryxx + * @param pageNo + * @param pageSize + * @param req + * @return + */ + //@AutoLog(value = "同步数据表(shryxx)-分页列表查询") + @ApiOperation(value="同步数据表(shryxx)-分页列表查询", notes="同步数据表(shryxx)-分页列表查询") + @GetMapping(value = "/list") + public Result> queryPageList(Xxhbshryxx xxhbshryxx, + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, + HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(xxhbshryxx, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + IPage pageList = xxhbshryxxService.page(page, queryWrapper); + return Result.OK(pageList); + } + + /** + * 添加 + * + * @param xxhbshryxx + * @return + */ + @AutoLog(value = "同步数据表(shryxx)-添加") + @ApiOperation(value="同步数据表(shryxx)-添加", notes="同步数据表(shryxx)-添加") + @RequiresPermissions("grab:xxhbshryxx:add") + @PostMapping(value = "/add") + public Result add(@RequestBody Xxhbshryxx xxhbshryxx) { + xxhbshryxxService.save(xxhbshryxx); + return Result.OK("添加成功!"); + } + + /** + * 编辑 + * + * @param xxhbshryxx + * @return + */ + @AutoLog(value = "同步数据表(shryxx)-编辑") + @ApiOperation(value="同步数据表(shryxx)-编辑", notes="同步数据表(shryxx)-编辑") + @RequiresPermissions("grab:xxhbshryxx:edit") + @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) + public Result edit(@RequestBody Xxhbshryxx xxhbshryxx) { + xxhbshryxxService.updateById(xxhbshryxx); + return Result.OK("编辑成功!"); + } + + /** + * 通过id删除 + * + * @param id + * @return + */ + @AutoLog(value = "同步数据表(shryxx)-通过id删除") + @ApiOperation(value="同步数据表(shryxx)-通过id删除", notes="同步数据表(shryxx)-通过id删除") + @RequiresPermissions("grab:xxhbshryxx:delete") + @DeleteMapping(value = "/delete") + public Result delete(@RequestParam(name="id",required=true) String id) { + xxhbshryxxService.removeById(id); + return Result.OK("删除成功!"); + } + + /** + * 批量删除 + * + * @param ids + * @return + */ + @AutoLog(value = "同步数据表(shryxx)-批量删除") + @ApiOperation(value="同步数据表(shryxx)-批量删除", notes="同步数据表(shryxx)-批量删除") + @RequiresPermissions("grab:xxhbshryxx:deleteBatch") + @DeleteMapping(value = "/deleteBatch") + public Result deleteBatch(@RequestParam(name="ids",required=true) String ids) { + this.xxhbshryxxService.removeByIds(Arrays.asList(ids.split(","))); + return Result.OK("批量删除成功!"); + } + + /** + * 通过id查询 + * + * @param id + * @return + */ + //@AutoLog(value = "同步数据表(shryxx)-通过id查询") + @ApiOperation(value="同步数据表(shryxx)-通过id查询", notes="同步数据表(shryxx)-通过id查询") + @GetMapping(value = "/queryById") + public Result queryById(@RequestParam(name="id",required=true) String id) { + Xxhbshryxx xxhbshryxx = xxhbshryxxService.getById(id); + if(xxhbshryxx==null) { + return Result.error("未找到对应数据"); + } + return Result.OK(xxhbshryxx); + } + + /** + * 导出excel + * + * @param request + * @param xxhbshryxx + */ + @RequiresPermissions("grab:xxhbshryxx:exportXls") + @RequestMapping(value = "/exportXls") + public ModelAndView exportXls(HttpServletRequest request, Xxhbshryxx xxhbshryxx) { + return super.exportXls(request, xxhbshryxx, Xxhbshryxx.class, "同步数据表(shryxx)"); + } + + /** + * 通过excel导入数据 + * + * @param request + * @param response + * @return + */ + @RequiresPermissions("grab:xxhbshryxx:importExcel") + @RequestMapping(value = "/importExcel", method = RequestMethod.POST) + public Result importExcel(HttpServletRequest request, HttpServletResponse response) { + return super.importExcel(request, response, Xxhbshryxx.class); + } + +} diff --git a/jeecg-module-main/src/main/java/org/jeecg/modules/kc/grab/imports/entity/Xxhbshryxx.java b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/grab/imports/entity/Xxhbshryxx.java new file mode 100644 index 00000000..45e88cf9 --- /dev/null +++ b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/grab/imports/entity/Xxhbshryxx.java @@ -0,0 +1,59 @@ +package org.jeecg.modules.kc.grab.imports.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; +import org.jeecgframework.poi.excel.annotation.Excel; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; + +/** + * @Description: 同步数据表(shryxx) + * @Author: jeecg-boot + * @Date: 2023-05-24 + * @Version: V1.0 + */ +@Data +@TableName("xxhbshryxx") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@ApiModel(value="xxhbshryxx对象", description="同步数据表(shryxx)") +public class Xxhbshryxx implements Serializable { + private static final long serialVersionUID = 1L; + + /**工号*/ + @Excel(name = "工号", width = 15) + @ApiModelProperty(value = "工号") + private java.lang.String gh; + /**姓名*/ + @Excel(name = "姓名", width = 15) + @ApiModelProperty(value = "姓名") + private java.lang.String xm; + /**单位号*/ + @Excel(name = "单位号", width = 15) + @ApiModelProperty(value = "单位号") + private java.lang.String dwh; + /**职务代码*/ + @Excel(name = "职务代码", width = 15) + @ApiModelProperty(value = "职务代码") + private java.lang.String zwdm; + /**职务名称*/ + @Excel(name = "职务名称", width = 15) + @ApiModelProperty(value = "职务名称") + private java.lang.String zwmc; + /**年级*/ + @Excel(name = "年级", width = 15) + @ApiModelProperty(value = "年级") + private java.lang.String nj; + /**时间戳*/ + @Excel(name = "时间戳", width = 15, format = "yyyy-MM-dd") + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") + @DateTimeFormat(pattern="yyyy-MM-dd") + @ApiModelProperty(value = "时间戳") + private java.util.Date timestamps; +} diff --git a/jeecg-module-main/src/main/java/org/jeecg/modules/kc/grab/imports/mapper/XxhbshryxxMapper.java b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/grab/imports/mapper/XxhbshryxxMapper.java new file mode 100644 index 00000000..ee443a25 --- /dev/null +++ b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/grab/imports/mapper/XxhbshryxxMapper.java @@ -0,0 +1,14 @@ +package org.jeecg.modules.kc.grab.imports.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.jeecg.modules.kc.grab.imports.entity.Xxhbshryxx; + +/** + * @Description: 同步数据表(shryxx) + * @Author: jeecg-boot + * @Date: 2023-05-24 + * @Version: V1.0 + */ +public interface XxhbshryxxMapper extends BaseMapper { + +} diff --git a/jeecg-module-main/src/main/java/org/jeecg/modules/kc/grab/imports/mapper/xml/XxhbshryxxMapper.xml b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/grab/imports/mapper/xml/XxhbshryxxMapper.xml new file mode 100644 index 00000000..e0da494a --- /dev/null +++ b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/grab/imports/mapper/xml/XxhbshryxxMapper.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/jeecg-module-main/src/main/java/org/jeecg/modules/kc/grab/imports/service/IXxhbshryxxService.java b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/grab/imports/service/IXxhbshryxxService.java new file mode 100644 index 00000000..dd1dd5ad --- /dev/null +++ b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/grab/imports/service/IXxhbshryxxService.java @@ -0,0 +1,30 @@ +package org.jeecg.modules.kc.grab.imports.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import org.jeecg.modules.kc.grab.imports.entity.Xxhbshryxx; + +import java.util.Collection; + +/** + * @Description: 同步数据表(shryxx) + * @Author: jeecg-boot + * @Date: 2023-05-24 + * @Version: V1.0 + */ +public interface IXxhbshryxxService extends IService { + /** + * 同步数据 + * @param entityList + * @return + */ + boolean syncList(Collection entityList); + + /** + * + * @param entityList + * @param isDelete + * @return + */ + boolean syncList(Collection entityList, boolean isDelete); + +} diff --git a/jeecg-module-main/src/main/java/org/jeecg/modules/kc/grab/imports/service/impl/XxhbshryxxServiceImpl.java b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/grab/imports/service/impl/XxhbshryxxServiceImpl.java new file mode 100644 index 00000000..31e3b64c --- /dev/null +++ b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/grab/imports/service/impl/XxhbshryxxServiceImpl.java @@ -0,0 +1,37 @@ +package org.jeecg.modules.kc.grab.imports.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.jeecg.modules.kc.grab.imports.entity.Xxhbshryxx; +import org.jeecg.modules.kc.grab.imports.mapper.XxhbshryxxMapper; +import org.jeecg.modules.kc.grab.imports.service.IXxhbshryxxService; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Collection; + +/** + * @Description: 同步数据表(shryxx) + * @Author: jeecg-boot + * @Date: 2023-05-24 + * @Version: V1.0 + */ +@Service +public class XxhbshryxxServiceImpl extends ServiceImpl implements IXxhbshryxxService { + + @Override + @Transactional(rollbackFor = {Exception.class}) + public boolean syncList(Collection entityList) { + return syncList(entityList, true); + } + + @Override + @Transactional(rollbackFor = {Exception.class}) + public boolean syncList(Collection entityList, boolean isDelete) { + QueryWrapper dqw = new QueryWrapper(); + if(isDelete){ + baseMapper.delete(dqw); + } + return this.saveBatch(entityList, 1000); + } +}