7b92ac53 张雷

报表表头配置功能开发

1 个父辈 eddb0df0
package com.skua.modules.report.entity;
import java.io.Serializable;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
/**
* 填报表头配置
*/
@Data
@TableName("f_report_header_config")
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="f_report_header_config对象", description="填报表头配置")
public class FReportHeaderConfig {
/**主键id*/
@TableId(type = IdType.ID_WORKER_STR)
@ApiModelProperty(value = "主键id")
private String id;
/**报表id*/
@Excel(name = "报表id", width = 15)
@ApiModelProperty(value = "报表id")
private String reportId;
/**数据项名称*/
@Excel(name = "数据项名称", width = 15)
@ApiModelProperty(value = "数据项名称")
private String itemCode;
/**排序序号*/
@Excel(name = "排序序号", width = 15)
@ApiModelProperty(value = "排序序号")
private Integer sortNum;
/**所属厂区*/
@Excel(name = "所属厂区", width = 15)
@ApiModelProperty(value = "所属厂区")
private String departId;
/**创建人Id*/
@Excel(name = "创建人Id", width = 15)
@ApiModelProperty(value = "创建人Id")
private String createBy;
/**创建时间*/
@Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建时间")
private Date createTime;
/**修改人Id*/
@Excel(name = "修改人Id", width = 15)
@ApiModelProperty(value = "修改人Id")
private String updateBy;
/**修改时间*/
@Excel(name = "修改时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "修改时间")
private Date updateTime;
/**删除标识*/
@Excel(name = "删除标识", width = 15)
@ApiModelProperty(value = "删除标识")
private Integer delFlag;
@TableField(exist=false)
private String itemName;
}
package com.skua.modules.report.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.skua.modules.report.entity.FReportHeaderConfig;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* 填报表头配置
*/
public interface FReportHeaderConfigMapper extends BaseMapper<FReportHeaderConfig> {
}
<?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="com.skua.modules.report.mapper.FReportHeaderConfigMapper">
</mapper>
\ No newline at end of file
package com.skua.modules.report.service;
import com.skua.modules.report.entity.FReportHeaderConfig;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* 填报表头配置
*/
public interface IFReportHeaderConfigService extends IService<FReportHeaderConfig> {
void deleteHeaderConfig(String reportId, String departId);
}
package com.skua.modules.report.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.skua.core.util.ConvertUtils;
import com.skua.modules.report.entity.FReportHeaderConfig;
import com.skua.modules.report.mapper.FReportHeaderConfigMapper;
import com.skua.modules.report.service.IFReportHeaderConfigService;
import com.skua.modules.system.datestandard.entity.SysStructDict;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.ArrayList;
import java.util.List;
/**
* 填报表头配置
*/
@Service
public class FReportHeaderConfigServiceImpl extends ServiceImpl<FReportHeaderConfigMapper, FReportHeaderConfig> implements IFReportHeaderConfigService {
@Autowired
private FReportHeaderConfigMapper reportHeaderConfigMapper;
@Override
public void deleteHeaderConfig(String reportId, String departId) {
List<String> idList = new ArrayList<>();
LambdaQueryWrapper<FReportHeaderConfig> queryWrapper = new LambdaQueryWrapper<FReportHeaderConfig>();
queryWrapper.eq(FReportHeaderConfig::getDepartId, departId);
queryWrapper.eq(FReportHeaderConfig::getReportId, reportId);
List<FReportHeaderConfig> list = reportHeaderConfigMapper.selectList(queryWrapper);
if(list.size() > 0){
for (FReportHeaderConfig config : list) {
if(ConvertUtils.isNotEmpty(config.getId())){
idList.add(config.getId());
}
}
reportHeaderConfigMapper.deleteBatchIds(idList);
}
}
}
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!