feat(report): 新增经营目标拆分功能
- 添加 ReportTargetConfigSub 实体类 - 创建 IReportTargetConfigSubService 接口及实现类 - 开发 ReportTargetConfigSubController 控制器- 编写 ReportTargetConfigSubMapper 接口及 XML 文件- 在 ReportTargetConfig 中添加费用目标字段
正在显示
7 个修改的文件
包含
162 行增加
和
0 行删除
此文件的差异被折叠,
点击展开。
... | @@ -36,6 +36,10 @@ public class ReportTargetConfig { | ... | @@ -36,6 +36,10 @@ public class ReportTargetConfig { |
36 | @Excel(name = "水量目标", width = 15) | 36 | @Excel(name = "水量目标", width = 15) |
37 | @ApiModelProperty(value = "水量目标") | 37 | @ApiModelProperty(value = "水量目标") |
38 | private String targetWater; | 38 | private String targetWater; |
39 | /**费用目标*/ | ||
40 | @Excel(name = "费用目标", width = 15) | ||
41 | @ApiModelProperty(value = "费用目标") | ||
42 | private String targetCost; | ||
39 | /**电量目标*/ | 43 | /**电量目标*/ |
40 | @Excel(name = "电量目标", width = 15) | 44 | @Excel(name = "电量目标", width = 15) |
41 | @ApiModelProperty(value = "电量目标") | 45 | @ApiModelProperty(value = "电量目标") |
... | ... |
sk-module-datafill/src/main/java/com/skua/modules/report/entity/ReportTargetConfigSub.java
0 → 100644
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("report_target_config_sub") | ||
23 | @EqualsAndHashCode(callSuper = false) | ||
24 | @Accessors(chain = true) | ||
25 | @ApiModel(value="report_target_config_sub对象", description="经营目标拆分") | ||
26 | public class ReportTargetConfigSub { | ||
27 | |||
28 | /**主键id*/ | ||
29 | @TableId(type = IdType.ID_WORKER_STR) | ||
30 | @ApiModelProperty(value = "主键id") | ||
31 | private String id; | ||
32 | /**所属厂区*/ | ||
33 | @Excel(name = "所属厂区", width = 15) | ||
34 | @ApiModelProperty(value = "所属厂区") | ||
35 | private String departId; | ||
36 | /**目标时间*/ | ||
37 | @Excel(name = "目标时间", width = 15) | ||
38 | @ApiModelProperty(value = "目标时间") | ||
39 | private String targetTime; | ||
40 | /**目标类型*/ | ||
41 | @Excel(name = "目标类型", width = 15) | ||
42 | @ApiModelProperty(value = "目标类型") | ||
43 | private String targetType; | ||
44 | /**目标值*/ | ||
45 | @Excel(name = "目标值", width = 15) | ||
46 | @ApiModelProperty(value = "目标值") | ||
47 | private String targetValue; | ||
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 | } |
sk-module-datafill/src/main/java/com/skua/modules/report/mapper/ReportTargetConfigSubMapper.java
0 → 100644
1 | package com.skua.modules.report.mapper; | ||
2 | |||
3 | import com.skua.tool.annotation.Anonymous; | ||
4 | import org.apache.ibatis.annotations.Param; | ||
5 | import com.skua.modules.report.entity.ReportTargetConfigSub; | ||
6 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||
7 | |||
8 | import java.util.List; | ||
9 | |||
10 | /** | ||
11 | * 经营目标拆分 | ||
12 | */ | ||
13 | public interface ReportTargetConfigSubMapper extends BaseMapper<ReportTargetConfigSub> { | ||
14 | |||
15 | void batchDeleteData(@Param("departId") String departId, @Param("year") String year, @Param("type") String type); | ||
16 | |||
17 | @Anonymous | ||
18 | List<ReportTargetConfigSub> getList(@Param("departId") String departId, @Param("year") String year, @Param("targetType") String targetType); | ||
19 | } |
sk-module-datafill/src/main/java/com/skua/modules/report/mapper/xml/ReportTargetConfigSubMapper.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.ReportTargetConfigSubMapper"> | ||
4 | |||
5 | <delete id="batchDeleteData"> | ||
6 | DELETE FROM report_target_config_sub | ||
7 | WHERE depart_id = #{departId} AND target_type = #{type} AND target_time like concat(#{year},'%') | ||
8 | </delete> | ||
9 | |||
10 | <select id="getList" resultType="com.skua.modules.report.entity.ReportTargetConfigSub"> | ||
11 | SELECT * FROM report_target_config_sub | ||
12 | WHERE depart_id = #{departId} AND target_type = #{targetType} AND target_time like concat(#{year},'%') | ||
13 | </select> | ||
14 | |||
15 | </mapper> |
sk-module-datafill/src/main/java/com/skua/modules/report/service/IReportTargetConfigSubService.java
0 → 100644
1 | package com.skua.modules.report.service; | ||
2 | |||
3 | import com.skua.modules.report.entity.ReportTargetConfigSub; | ||
4 | import com.baomidou.mybatisplus.extension.service.IService; | ||
5 | import com.skua.tool.annotation.Anonymous; | ||
6 | |||
7 | import java.util.List; | ||
8 | |||
9 | /** | ||
10 | * 经营目标拆分 | ||
11 | */ | ||
12 | public interface IReportTargetConfigSubService extends IService<ReportTargetConfigSub> { | ||
13 | |||
14 | boolean batchDeleteData(String departId, String year, String type); | ||
15 | |||
16 | List<ReportTargetConfigSub> getList(ReportTargetConfigSub reportTargetConfigSub); | ||
17 | } |
1 | package com.skua.modules.report.service.impl; | ||
2 | |||
3 | import com.skua.modules.report.entity.ReportTargetConfigSub; | ||
4 | import com.skua.modules.report.mapper.ReportTargetConfigSubMapper; | ||
5 | import com.skua.modules.report.service.IReportTargetConfigSubService; | ||
6 | import org.springframework.beans.factory.annotation.Autowired; | ||
7 | import org.springframework.stereotype.Service; | ||
8 | |||
9 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||
10 | |||
11 | import java.util.Collections; | ||
12 | import java.util.List; | ||
13 | |||
14 | /** | ||
15 | * 经营目标拆分 | ||
16 | */ | ||
17 | @Service | ||
18 | public class ReportTargetConfigSubServiceImpl extends ServiceImpl<ReportTargetConfigSubMapper, ReportTargetConfigSub> implements IReportTargetConfigSubService { | ||
19 | |||
20 | @Autowired | ||
21 | ReportTargetConfigSubMapper reportTargetSubMapper; | ||
22 | |||
23 | @Override | ||
24 | public boolean batchDeleteData(String departId, String year, String type) { | ||
25 | reportTargetSubMapper.batchDeleteData(departId,year,type); | ||
26 | return true; | ||
27 | } | ||
28 | |||
29 | @Override | ||
30 | public List<ReportTargetConfigSub> getList(ReportTargetConfigSub reportTargetConfigSub) { | ||
31 | return reportTargetSubMapper.getList(reportTargetConfigSub.getDepartId(), reportTargetConfigSub.getTargetTime(), | ||
32 | reportTargetConfigSub.getTargetType()); | ||
33 | } | ||
34 | |||
35 | } |
-
请 注册 或 登录 后发表评论