2023年5月24日 添加数据同步
This commit is contained in:
parent
9fbd8befa5
commit
0b4cff6cfa
|
@ -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<String, Object> param){
|
||||
//查询数据
|
||||
List<TFwdtShryxx> inDataList = expService.list();
|
||||
List<Xxhbshryxx> 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);
|
||||
}
|
||||
|
||||
}
|
|
@ -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<TFwdtShryxx, ITFwdtShryxxService> {
|
||||
@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<IPage<TFwdtShryxx>> queryPageList(TFwdtShryxx xxhbshryxx,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<TFwdtShryxx> queryWrapper = QueryGenerator.initQueryWrapper(xxhbshryxx, req.getParameterMap());
|
||||
Page<TFwdtShryxx> page = new Page<TFwdtShryxx>(pageNo, pageSize);
|
||||
IPage<TFwdtShryxx> 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<String> 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<String> 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<String> 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<String> 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<TFwdtShryxx> 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);
|
||||
}
|
||||
|
||||
}
|
|
@ -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;
|
||||
}
|
|
@ -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<TFwdtShryxx> {
|
||||
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.jeecg.modules.kc.grab.exports.mapper.TFwdtShryxxMapper">
|
||||
|
||||
</mapper>
|
|
@ -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<TFwdtShryxx> {
|
||||
|
||||
}
|
|
@ -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<TFwdtShryxxMapper, TFwdtShryxx> implements ITFwdtShryxxService {
|
||||
|
||||
}
|
|
@ -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<Xxhbshryxx, IXxhbshryxxService> {
|
||||
@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<IPage<Xxhbshryxx>> queryPageList(Xxhbshryxx xxhbshryxx,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<Xxhbshryxx> queryWrapper = QueryGenerator.initQueryWrapper(xxhbshryxx, req.getParameterMap());
|
||||
Page<Xxhbshryxx> page = new Page<Xxhbshryxx>(pageNo, pageSize);
|
||||
IPage<Xxhbshryxx> 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<String> 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<String> 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<String> 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<String> 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<Xxhbshryxx> 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);
|
||||
}
|
||||
|
||||
}
|
|
@ -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;
|
||||
}
|
|
@ -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<Xxhbshryxx> {
|
||||
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.jeecg.modules.kc.grab.imports.mapper.XxhbshryxxMapper">
|
||||
|
||||
</mapper>
|
|
@ -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<Xxhbshryxx> {
|
||||
/**
|
||||
* 同步数据
|
||||
* @param entityList
|
||||
* @return
|
||||
*/
|
||||
boolean syncList(Collection<Xxhbshryxx> entityList);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param entityList
|
||||
* @param isDelete
|
||||
* @return
|
||||
*/
|
||||
boolean syncList(Collection<Xxhbshryxx> entityList, boolean isDelete);
|
||||
|
||||
}
|
|
@ -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<XxhbshryxxMapper, Xxhbshryxx> implements IXxhbshryxxService {
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = {Exception.class})
|
||||
public boolean syncList(Collection<Xxhbshryxx> entityList) {
|
||||
return syncList(entityList, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = {Exception.class})
|
||||
public boolean syncList(Collection<Xxhbshryxx> entityList, boolean isDelete) {
|
||||
QueryWrapper dqw = new QueryWrapper();
|
||||
if(isDelete){
|
||||
baseMapper.delete(dqw);
|
||||
}
|
||||
return this.saveBatch(entityList, 1000);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue