Merge remote-tracking branch 'origin/master'
正在显示
6 个修改的文件
包含
488 行增加
和
0 行删除
1 | package com.skua.modules.report.controller; | ||
2 | |||
3 | import java.util.ArrayList; | ||
4 | import java.util.Arrays; | ||
5 | import java.util.List; | ||
6 | import java.util.Map; | ||
7 | import java.io.IOException; | ||
8 | import java.io.UnsupportedEncodingException; | ||
9 | import java.net.URLDecoder; | ||
10 | import javax.servlet.http.HttpServletRequest; | ||
11 | import javax.servlet.http.HttpServletResponse; | ||
12 | |||
13 | import com.alibaba.fastjson.JSONArray; | ||
14 | import com.alibaba.fastjson.JSONObject; | ||
15 | import com.skua.core.api.vo.Result; | ||
16 | import com.skua.core.aspect.annotation.AutoLog; | ||
17 | import com.skua.core.query.QueryGenerator; | ||
18 | import com.skua.core.util.ConvertUtils; | ||
19 | import com.skua.modules.report.entity.FReportHeaderConfig; | ||
20 | import com.skua.modules.report.entity.FReportItem; | ||
21 | import com.skua.modules.report.service.IFReportHeaderConfigService; | ||
22 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||
23 | import com.baomidou.mybatisplus.core.metadata.IPage; | ||
24 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
25 | import com.skua.modules.report.service.IFReportItemService; | ||
26 | import lombok.extern.slf4j.Slf4j; | ||
27 | |||
28 | import org.jeecgframework.poi.excel.ExcelImportUtil; | ||
29 | import org.jeecgframework.poi.excel.def.NormalExcelConstants; | ||
30 | import org.jeecgframework.poi.excel.entity.ExportParams; | ||
31 | import org.jeecgframework.poi.excel.entity.ImportParams; | ||
32 | import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; | ||
33 | |||
34 | import org.springframework.beans.factory.annotation.Autowired; | ||
35 | import org.springframework.web.bind.annotation.*; | ||
36 | import org.springframework.web.multipart.MultipartFile; | ||
37 | import org.springframework.web.multipart.MultipartHttpServletRequest; | ||
38 | import org.springframework.web.servlet.ModelAndView; | ||
39 | import com.alibaba.fastjson.JSON; | ||
40 | import io.swagger.annotations.Api; | ||
41 | import io.swagger.annotations.ApiOperation; | ||
42 | |||
43 | /** | ||
44 | * <pre> | ||
45 | * 填报报表表头配置 | ||
46 | * </pre> | ||
47 | * @author zhanglei | ||
48 | * @version V0.1, 开发时间 | ||
49 | */ | ||
50 | @Slf4j | ||
51 | @Api(tags="填报报表表头配置") | ||
52 | @RestController | ||
53 | @RequestMapping("/report/headerConfig") | ||
54 | public class FReportHeaderConfigController { | ||
55 | @Autowired | ||
56 | private IFReportHeaderConfigService fReportHeaderConfigService; | ||
57 | @Autowired | ||
58 | private IFReportItemService fReportItemService; | ||
59 | |||
60 | /** | ||
61 | * <pre> | ||
62 | * 分页列表查询 | ||
63 | * </pre> | ||
64 | * @param fReportHeaderConfig | ||
65 | * @param pageNo | ||
66 | * @param pageSize | ||
67 | * @param req | ||
68 | * @return | ||
69 | * @author 开发者姓名, 开发时间 | ||
70 | * @Description: TODO(这里描述这个方法的需求变更情况) | ||
71 | */ | ||
72 | |||
73 | @AutoLog(value = "填报报表表头配置-分页列表查询") | ||
74 | @ApiOperation(value="填报报表表头配置-分页列表查询", notes="填报报表表头配置-分页列表查询") | ||
75 | @GetMapping(value = "/list") | ||
76 | public Result<IPage<FReportHeaderConfig>> queryPageList(FReportHeaderConfig fReportHeaderConfig, | ||
77 | @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, | ||
78 | @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, | ||
79 | HttpServletRequest req) { | ||
80 | Result<IPage<FReportHeaderConfig>> result = new Result<IPage<FReportHeaderConfig>>(); | ||
81 | QueryWrapper<FReportHeaderConfig> queryWrapper = QueryGenerator.initQueryWrapper(fReportHeaderConfig, req.getParameterMap()); | ||
82 | Page<FReportHeaderConfig> page = new Page<FReportHeaderConfig>(pageNo, pageSize); | ||
83 | IPage<FReportHeaderConfig> pageList = fReportHeaderConfigService.page(page, queryWrapper); | ||
84 | result.setSuccess(true); | ||
85 | result.setResult(pageList); | ||
86 | return result; | ||
87 | } | ||
88 | |||
89 | /** | ||
90 | * <pre> | ||
91 | * 添加 | ||
92 | * </pre> | ||
93 | * @param fReportHeaderConfig | ||
94 | * @return | ||
95 | * @author 开发者姓名, 开发时间 | ||
96 | * @Description: TODO(这里描述这个方法的需求变更情况) | ||
97 | */ | ||
98 | @AutoLog(value = "填报报表表头配置-添加") | ||
99 | @ApiOperation(value="填报报表表头配置-添加", notes="填报报表表头配置-添加") | ||
100 | @PostMapping(value = "/add") | ||
101 | public Result<FReportHeaderConfig> add(@RequestBody FReportHeaderConfig fReportHeaderConfig) { | ||
102 | Result<FReportHeaderConfig> result = new Result<FReportHeaderConfig>(); | ||
103 | try { | ||
104 | fReportHeaderConfigService.save(fReportHeaderConfig); | ||
105 | result.success("添加成功!"); | ||
106 | } catch (Exception e) { | ||
107 | log.error(e.getMessage(),e); | ||
108 | result.error500("操作失败"); | ||
109 | } | ||
110 | return result; | ||
111 | } | ||
112 | |||
113 | /** | ||
114 | * <pre> | ||
115 | * 编辑 | ||
116 | * </pre> | ||
117 | * @param fReportHeaderConfig | ||
118 | * @return | ||
119 | * @author 开发者姓名, 开发时间 | ||
120 | * @Description: TODO(这里描述这个方法的需求变更情况) | ||
121 | */ | ||
122 | @AutoLog(value = "填报报表表头配置-编辑") | ||
123 | @ApiOperation(value="填报报表表头配置-编辑", notes="填报报表表头配置-编辑") | ||
124 | @PutMapping(value = "/edit") | ||
125 | public Result<FReportHeaderConfig> edit(@RequestBody FReportHeaderConfig fReportHeaderConfig) { | ||
126 | Result<FReportHeaderConfig> result = new Result<FReportHeaderConfig>(); | ||
127 | FReportHeaderConfig fReportHeaderConfigEntity = fReportHeaderConfigService.getById(fReportHeaderConfig.getId()); | ||
128 | if(fReportHeaderConfigEntity==null) { | ||
129 | result.error500("未找到对应实体"); | ||
130 | }else { | ||
131 | boolean ok = fReportHeaderConfigService.updateById(fReportHeaderConfig); | ||
132 | //TODO 返回false说明什么? | ||
133 | if(ok) { | ||
134 | result.success("修改成功!"); | ||
135 | } | ||
136 | } | ||
137 | |||
138 | return result; | ||
139 | } | ||
140 | |||
141 | @AutoLog(value = "报表数据项值-配置") | ||
142 | @ApiOperation(value="报表数据项值-配置", notes="报表数据项值-配置") | ||
143 | @PostMapping(value = "/save") | ||
144 | public Result<List<FReportHeaderConfig>> save(@RequestBody JSONObject jsonObject) { | ||
145 | Result<List<FReportHeaderConfig>> result = new Result<List<FReportHeaderConfig>>(); | ||
146 | JSONArray array = jsonObject.getJSONArray("list"); | ||
147 | String reportId = jsonObject.getString("reportId"); | ||
148 | String departId = jsonObject.getString("departId"); | ||
149 | List<FReportHeaderConfig> list = JSONObject.parseArray(array.toJSONString(), FReportHeaderConfig.class); | ||
150 | if(list.size()>0){ | ||
151 | List<FReportHeaderConfig> configList = new ArrayList<>(); | ||
152 | fReportHeaderConfigService.deleteHeaderConfig(reportId,departId); | ||
153 | for (FReportHeaderConfig config : list) { | ||
154 | config.setDepartId(departId); | ||
155 | config.setReportId(reportId); | ||
156 | configList.add(config); | ||
157 | } | ||
158 | fReportHeaderConfigService.saveBatch(configList); | ||
159 | } | ||
160 | return result; | ||
161 | } | ||
162 | |||
163 | @AutoLog(value = "填报报表表头配置-获取表头配置") | ||
164 | @ApiOperation(value="填报报表表头配置-获取表头配置", notes="填报报表表头配置-获取表头配置") | ||
165 | @GetMapping(value = "/get") | ||
166 | public Result<List<FReportHeaderConfig>> queryConfigList(FReportHeaderConfig fReportHeaderConfig) { | ||
167 | Result<List<FReportHeaderConfig>> result = new Result<List<FReportHeaderConfig>>(); | ||
168 | List<FReportHeaderConfig> list = new ArrayList<>(); | ||
169 | QueryWrapper<FReportHeaderConfig> queryWrapper = new QueryWrapper<>(); | ||
170 | if(ConvertUtils.isNotEmpty(fReportHeaderConfig.getDepartId()) | ||
171 | &&ConvertUtils.isNotEmpty(fReportHeaderConfig.getReportId())){ | ||
172 | queryWrapper.in("depart_id", fReportHeaderConfig.getDepartId()); | ||
173 | queryWrapper.in("report_id", fReportHeaderConfig.getReportId()); | ||
174 | queryWrapper.orderByAsc("sort_num"); | ||
175 | list = fReportHeaderConfigService.list(queryWrapper); | ||
176 | if(list.size() == 0){ | ||
177 | List<FReportItem> itemList = fReportItemService.getListByReportId(fReportHeaderConfig.getReportId()); | ||
178 | for (FReportItem reportItem : itemList) { | ||
179 | FReportHeaderConfig config = new FReportHeaderConfig(); | ||
180 | config.setReportId(fReportHeaderConfig.getReportId()); | ||
181 | config.setDepartId(fReportHeaderConfig.getDepartId()); | ||
182 | config.setItemCode(reportItem.getItemCode()); | ||
183 | config.setItemName(reportItem.getItemAlias()); | ||
184 | config.setSortNum(reportItem.getSortNum()); | ||
185 | list.add(config); | ||
186 | } | ||
187 | } | ||
188 | result.setSuccess(true); | ||
189 | }else{ | ||
190 | result.setSuccess(false); | ||
191 | } | ||
192 | result.setResult(list); | ||
193 | return result; | ||
194 | } | ||
195 | |||
196 | /** | ||
197 | * <pre> | ||
198 | * 通过id删除 | ||
199 | * </pre> | ||
200 | * @param id | ||
201 | * @return | ||
202 | * @author 开发者姓名, 开发时间 | ||
203 | * @Description: TODO(这里描述这个方法的需求变更情况) | ||
204 | */ | ||
205 | @AutoLog(value = "填报报表表头配置-通过id删除") | ||
206 | @ApiOperation(value="填报报表表头配置-通过id删除", notes="填报报表表头配置-通过id删除") | ||
207 | @DeleteMapping(value = "/delete") | ||
208 | public Result<?> delete(@RequestParam(name="id",required=true) String id) { | ||
209 | try { | ||
210 | fReportHeaderConfigService.removeById(id); | ||
211 | } catch (Exception e) { | ||
212 | log.error("删除失败",e.getMessage()); | ||
213 | return Result.error("删除失败!"); | ||
214 | } | ||
215 | return Result.ok("删除成功!"); | ||
216 | } | ||
217 | |||
218 | /** | ||
219 | * <pre> | ||
220 | * 批量删除 | ||
221 | * </pre> | ||
222 | * @param ids | ||
223 | * @return | ||
224 | * @author 开发者姓名, 开发时间 | ||
225 | * @Description: TODO(这里描述这个方法的需求变更情况) | ||
226 | */ | ||
227 | @AutoLog(value = "填报报表表头配置-批量删除") | ||
228 | @ApiOperation(value="填报报表表头配置-批量删除", notes="填报报表表头配置-批量删除") | ||
229 | @DeleteMapping(value = "/deleteBatch") | ||
230 | public Result<FReportHeaderConfig> deleteBatch(@RequestParam(name="ids",required=true) String ids) { | ||
231 | Result<FReportHeaderConfig> result = new Result<FReportHeaderConfig>(); | ||
232 | if(ids==null || "".equals(ids.trim())) { | ||
233 | result.error500("参数不识别!"); | ||
234 | }else { | ||
235 | this.fReportHeaderConfigService.removeByIds(Arrays.asList(ids.split(","))); | ||
236 | result.success("删除成功!"); | ||
237 | } | ||
238 | return result; | ||
239 | } | ||
240 | /** | ||
241 | * <pre> | ||
242 | * 通过id查询 | ||
243 | * </pre> | ||
244 | * @param id | ||
245 | * @return | ||
246 | * @author 开发者姓名, 开发时间 | ||
247 | * @Description: TODO(这里描述这个方法的需求变更情况) | ||
248 | */ | ||
249 | @AutoLog(value = "填报报表表头配置-通过id查询") | ||
250 | @ApiOperation(value="填报报表表头配置-通过id查询", notes="填报报表表头配置-通过id查询") | ||
251 | @GetMapping(value = "/queryById") | ||
252 | public Result<FReportHeaderConfig> queryById(@RequestParam(name="id",required=true) String id) { | ||
253 | Result<FReportHeaderConfig> result = new Result<FReportHeaderConfig>(); | ||
254 | FReportHeaderConfig fReportHeaderConfig = fReportHeaderConfigService.getById(id); | ||
255 | if(fReportHeaderConfig==null) { | ||
256 | result.error500("未找到对应实体"); | ||
257 | }else { | ||
258 | result.setResult(fReportHeaderConfig); | ||
259 | result.setSuccess(true); | ||
260 | } | ||
261 | return result; | ||
262 | } | ||
263 | |||
264 | /** | ||
265 | * <pre> | ||
266 | * 导出excel | ||
267 | * </pre> | ||
268 | * @param request | ||
269 | * @param response | ||
270 | * @return | ||
271 | * @author 开发者姓名, 开发时间 | ||
272 | * @Description: TODO(这里描述这个方法的需求变更情况) | ||
273 | */ | ||
274 | |||
275 | @RequestMapping(value = "/exportXls") | ||
276 | public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) { | ||
277 | // Step.1 组装查询条件 | ||
278 | QueryWrapper<FReportHeaderConfig> queryWrapper = null; | ||
279 | try { | ||
280 | String paramsStr = request.getParameter("paramsStr"); | ||
281 | if (ConvertUtils.isNotEmpty(paramsStr)) { | ||
282 | String deString = URLDecoder.decode(paramsStr, "UTF-8"); | ||
283 | FReportHeaderConfig fReportHeaderConfig = JSON.parseObject(deString, FReportHeaderConfig.class); | ||
284 | queryWrapper = QueryGenerator.initQueryWrapper(fReportHeaderConfig, request.getParameterMap()); | ||
285 | } | ||
286 | } catch (UnsupportedEncodingException e) { | ||
287 | e.printStackTrace(); | ||
288 | } | ||
289 | |||
290 | //Step.2 AutoPoi 导出Excel | ||
291 | ModelAndView mv = new ModelAndView(new JeecgEntityExcelView()); | ||
292 | List<FReportHeaderConfig> pageList = fReportHeaderConfigService.list(queryWrapper); | ||
293 | //导出文件名称 | ||
294 | mv.addObject(NormalExcelConstants.FILE_NAME, "填报报表表头配置列表"); | ||
295 | mv.addObject(NormalExcelConstants.CLASS, FReportHeaderConfig.class); | ||
296 | mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("填报报表表头配置列表数据", "导出人:Jeecg", "导出信息")); | ||
297 | mv.addObject(NormalExcelConstants.DATA_LIST, pageList); | ||
298 | return mv; | ||
299 | } | ||
300 | |||
301 | /** | ||
302 | * <pre> | ||
303 | * 通过excel导入数据 | ||
304 | * </pre> | ||
305 | * @param request | ||
306 | * @param response | ||
307 | * @return | ||
308 | * @author 开发者姓名, 开发时间 | ||
309 | * @Description: TODO(这里描述这个方法的需求变更情况) | ||
310 | */ | ||
311 | @RequestMapping(value = "/importExcel", method = RequestMethod.POST) | ||
312 | public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { | ||
313 | MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; | ||
314 | Map<String, MultipartFile> fileMap = multipartRequest.getFileMap(); | ||
315 | for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) { | ||
316 | MultipartFile file = entity.getValue();// 获取上传文件对象 | ||
317 | ImportParams params = new ImportParams(); | ||
318 | params.setTitleRows(2); | ||
319 | params.setHeadRows(1); | ||
320 | params.setNeedSave(true); | ||
321 | try { | ||
322 | List<FReportHeaderConfig> listFReportHeaderConfigs = ExcelImportUtil.importExcel(file.getInputStream(), FReportHeaderConfig.class, params); | ||
323 | fReportHeaderConfigService.saveBatch(listFReportHeaderConfigs); | ||
324 | return Result.ok("文件导入成功!数据行数:" + listFReportHeaderConfigs.size()); | ||
325 | } catch (Exception e) { | ||
326 | log.error(e.getMessage(),e); | ||
327 | return Result.error("文件导入失败:"+e.getMessage()); | ||
328 | } finally { | ||
329 | try { | ||
330 | file.getInputStream().close(); | ||
331 | } catch (IOException e) { | ||
332 | e.printStackTrace(); | ||
333 | } | ||
334 | } | ||
335 | } | ||
336 | return Result.ok("文件导入失败!"); | ||
337 | } | ||
338 | |||
339 | } |
1 | package com.skua.modules.report.entity; | ||
2 | |||
3 | import java.io.Serializable; | ||
4 | import java.util.Date; | ||
5 | import com.baomidou.mybatisplus.annotation.IdType; | ||
6 | import com.baomidou.mybatisplus.annotation.TableId; | ||
7 | import com.baomidou.mybatisplus.annotation.TableName; | ||
8 | import com.baomidou.mybatisplus.annotation.TableField; | ||
9 | import io.swagger.annotations.ApiModel; | ||
10 | import io.swagger.annotations.ApiModelProperty; | ||
11 | import lombok.Data; | ||
12 | import lombok.EqualsAndHashCode; | ||
13 | import lombok.experimental.Accessors; | ||
14 | import com.fasterxml.jackson.annotation.JsonFormat; | ||
15 | import org.springframework.format.annotation.DateTimeFormat; | ||
16 | import org.jeecgframework.poi.excel.annotation.Excel; | ||
17 | |||
18 | /** | ||
19 | * 填报表头配置 | ||
20 | */ | ||
21 | @Data | ||
22 | @TableName("f_report_header_config") | ||
23 | @EqualsAndHashCode(callSuper = false) | ||
24 | @Accessors(chain = true) | ||
25 | @ApiModel(value="f_report_header_config对象", description="填报表头配置") | ||
26 | public class FReportHeaderConfig { | ||
27 | |||
28 | /**主键id*/ | ||
29 | @TableId(type = IdType.ID_WORKER_STR) | ||
30 | @ApiModelProperty(value = "主键id") | ||
31 | private String id; | ||
32 | /**报表id*/ | ||
33 | @Excel(name = "报表id", width = 15) | ||
34 | @ApiModelProperty(value = "报表id") | ||
35 | private String reportId; | ||
36 | /**数据项名称*/ | ||
37 | @Excel(name = "数据项名称", width = 15) | ||
38 | @ApiModelProperty(value = "数据项名称") | ||
39 | private String itemCode; | ||
40 | /**排序序号*/ | ||
41 | @Excel(name = "排序序号", width = 15) | ||
42 | @ApiModelProperty(value = "排序序号") | ||
43 | private Integer sortNum; | ||
44 | /**所属厂区*/ | ||
45 | @Excel(name = "所属厂区", width = 15) | ||
46 | @ApiModelProperty(value = "所属厂区") | ||
47 | private String departId; | ||
48 | /**创建人Id*/ | ||
49 | @Excel(name = "创建人Id", width = 15) | ||
50 | @ApiModelProperty(value = "创建人Id") | ||
51 | private String createBy; | ||
52 | /**创建时间*/ | ||
53 | @Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss") | ||
54 | @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") | ||
55 | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") | ||
56 | @ApiModelProperty(value = "创建时间") | ||
57 | private Date createTime; | ||
58 | /**修改人Id*/ | ||
59 | @Excel(name = "修改人Id", width = 15) | ||
60 | @ApiModelProperty(value = "修改人Id") | ||
61 | private String updateBy; | ||
62 | /**修改时间*/ | ||
63 | @Excel(name = "修改时间", width = 20, format = "yyyy-MM-dd HH:mm:ss") | ||
64 | @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") | ||
65 | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") | ||
66 | @ApiModelProperty(value = "修改时间") | ||
67 | private Date updateTime; | ||
68 | /**删除标识*/ | ||
69 | @Excel(name = "删除标识", width = 15) | ||
70 | @ApiModelProperty(value = "删除标识") | ||
71 | private Integer delFlag; | ||
72 | |||
73 | @TableField(exist=false) | ||
74 | private String itemName; | ||
75 | } |
sk-module-datafill/src/main/java/com/skua/modules/report/mapper/FReportHeaderConfigMapper.java
0 → 100644
1 | package com.skua.modules.report.mapper; | ||
2 | |||
3 | import java.util.List; | ||
4 | |||
5 | import org.apache.ibatis.annotations.Param; | ||
6 | import com.skua.modules.report.entity.FReportHeaderConfig; | ||
7 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||
8 | |||
9 | /** | ||
10 | * 填报表头配置 | ||
11 | */ | ||
12 | public interface FReportHeaderConfigMapper extends BaseMapper<FReportHeaderConfig> { | ||
13 | |||
14 | } |
sk-module-datafill/src/main/java/com/skua/modules/report/mapper/xml/FReportHeaderConfigMapper.xml
0 → 100644
1 | <?xml version="1.0" encoding="UTF-8"?> | ||
2 | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | ||
3 | <mapper namespace="com.skua.modules.report.mapper.FReportHeaderConfigMapper"> | ||
4 | |||
5 | </mapper> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
sk-module-datafill/src/main/java/com/skua/modules/report/service/IFReportHeaderConfigService.java
0 → 100644
1 | package com.skua.modules.report.service; | ||
2 | |||
3 | import com.skua.modules.report.entity.FReportHeaderConfig; | ||
4 | import com.baomidou.mybatisplus.extension.service.IService; | ||
5 | |||
6 | /** | ||
7 | * 填报表头配置 | ||
8 | */ | ||
9 | public interface IFReportHeaderConfigService extends IService<FReportHeaderConfig> { | ||
10 | |||
11 | void deleteHeaderConfig(String reportId, String departId); | ||
12 | |||
13 | } |
1 | package com.skua.modules.report.service.impl; | ||
2 | |||
3 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||
4 | import com.skua.core.util.ConvertUtils; | ||
5 | import com.skua.modules.report.entity.FReportHeaderConfig; | ||
6 | import com.skua.modules.report.mapper.FReportHeaderConfigMapper; | ||
7 | import com.skua.modules.report.service.IFReportHeaderConfigService; | ||
8 | import com.skua.modules.system.datestandard.entity.SysStructDict; | ||
9 | import org.springframework.beans.factory.annotation.Autowired; | ||
10 | import org.springframework.stereotype.Service; | ||
11 | |||
12 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||
13 | |||
14 | import java.util.ArrayList; | ||
15 | import java.util.List; | ||
16 | |||
17 | /** | ||
18 | * 填报表头配置 | ||
19 | */ | ||
20 | @Service | ||
21 | public class FReportHeaderConfigServiceImpl extends ServiceImpl<FReportHeaderConfigMapper, FReportHeaderConfig> implements IFReportHeaderConfigService { | ||
22 | |||
23 | @Autowired | ||
24 | private FReportHeaderConfigMapper reportHeaderConfigMapper; | ||
25 | |||
26 | @Override | ||
27 | public void deleteHeaderConfig(String reportId, String departId) { | ||
28 | List<String> idList = new ArrayList<>(); | ||
29 | LambdaQueryWrapper<FReportHeaderConfig> queryWrapper = new LambdaQueryWrapper<FReportHeaderConfig>(); | ||
30 | queryWrapper.eq(FReportHeaderConfig::getDepartId, departId); | ||
31 | queryWrapper.eq(FReportHeaderConfig::getReportId, reportId); | ||
32 | List<FReportHeaderConfig> list = reportHeaderConfigMapper.selectList(queryWrapper); | ||
33 | if(list.size() > 0){ | ||
34 | for (FReportHeaderConfig config : list) { | ||
35 | if(ConvertUtils.isNotEmpty(config.getId())){ | ||
36 | idList.add(config.getId()); | ||
37 | } | ||
38 | } | ||
39 | reportHeaderConfigMapper.deleteBatchIds(idList); | ||
40 | } | ||
41 | } | ||
42 | } |
-
请 注册 或 登录 后发表评论