Merge remote-tracking branch 'origin/master'
正在显示
23 个修改的文件
包含
597 行增加
和
74 行删除
... | @@ -95,8 +95,7 @@ public class AjhMeetingReceiptController { | ... | @@ -95,8 +95,7 @@ public class AjhMeetingReceiptController { |
95 | @GetMapping(value = "/get") | 95 | @GetMapping(value = "/get") |
96 | public Result<IPage<AjhMeetingReceiptVO>> getPageList(AjhMeetingReceiptVO ajhMeetingReceiptVO, | 96 | public Result<IPage<AjhMeetingReceiptVO>> getPageList(AjhMeetingReceiptVO ajhMeetingReceiptVO, |
97 | @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, | 97 | @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
98 | @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, | 98 | @RequestParam(name="pageSize", defaultValue="10") Integer pageSize) { |
99 | HttpServletRequest req) { | ||
100 | Result<IPage<AjhMeetingReceiptVO>> result = new Result<IPage<AjhMeetingReceiptVO>>(); | 99 | Result<IPage<AjhMeetingReceiptVO>> result = new Result<IPage<AjhMeetingReceiptVO>>(); |
101 | Page<AjhMeetingReceiptVO> page = new Page<AjhMeetingReceiptVO>(pageNo, pageSize); | 100 | Page<AjhMeetingReceiptVO> page = new Page<AjhMeetingReceiptVO>(pageNo, pageSize); |
102 | IPage<AjhMeetingReceiptVO> pageList = ajhMeetingReceiptService.get(page, ajhMeetingReceiptVO); | 101 | IPage<AjhMeetingReceiptVO> pageList = ajhMeetingReceiptService.get(page, ajhMeetingReceiptVO); | ... | ... |
... | @@ -81,14 +81,51 @@ public class AjhMeetingSendController { | ... | @@ -81,14 +81,51 @@ public class AjhMeetingSendController { |
81 | @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, | 81 | @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
82 | HttpServletRequest req) { | 82 | HttpServletRequest req) { |
83 | Result<IPage<AjhMeetingSend>> result = new Result<IPage<AjhMeetingSend>>(); | 83 | Result<IPage<AjhMeetingSend>> result = new Result<IPage<AjhMeetingSend>>(); |
84 | QueryWrapper<AjhMeetingSend> queryWrapper = QueryGenerator.initQueryWrapper(ajhMeetingSend, req.getParameterMap()); | 84 | QueryWrapper<AjhMeetingSend> queryWrapper = new QueryWrapper<>(); |
85 | queryWrapper.eq(ConvertUtils.isNotEmpty(ajhMeetingSend.getMeetId()),"meet_id",ajhMeetingSend.getMeetId()); | ||
86 | queryWrapper.eq(ConvertUtils.isNotEmpty(ajhMeetingSend.getDepartId()),"depart_id",ajhMeetingSend.getDepartId()); | ||
87 | queryWrapper.eq(ConvertUtils.isNotEmpty(ajhMeetingSend.getMeetStatus()),"meet_status",ajhMeetingSend.getMeetStatus()); | ||
88 | queryWrapper.eq(ConvertUtils.isNotEmpty(ajhMeetingSend.getSendStatus()),"send_status",ajhMeetingSend.getSendStatus()); | ||
89 | queryWrapper.like(ConvertUtils.isNotEmpty(ajhMeetingSend.getMeetTitle()),"meet_title",ajhMeetingSend.getMeetTitle()); | ||
90 | queryWrapper.between(ConvertUtils.isNotEmpty(ajhMeetingSend.getMeetStartTime()),"meet_start_time", | ||
91 | ajhMeetingSend.getMeetStartTime()+" 00:00:00",ajhMeetingSend.getMeetEndTime()+" 23:59:59"); | ||
85 | Page<AjhMeetingSend> page = new Page<AjhMeetingSend>(pageNo, pageSize); | 92 | Page<AjhMeetingSend> page = new Page<AjhMeetingSend>(pageNo, pageSize); |
86 | IPage<AjhMeetingSend> pageList = ajhMeetingSendService.page(page, queryWrapper); | 93 | IPage<AjhMeetingSend> pageList = ajhMeetingSendService.queryPage(page, queryWrapper); |
87 | result.setSuccess(true); | 94 | result.setSuccess(true); |
88 | result.setResult(pageList); | 95 | result.setResult(pageList); |
89 | return result; | 96 | return result; |
90 | } | 97 | } |
91 | 98 | ||
99 | @AutoLog(value = "会议记录-数量统计") | ||
100 | @ApiOperation(value="会议记录-数量统计", notes="会议记录-数量统计") | ||
101 | @GetMapping(value = "/count") | ||
102 | public Result<Map<String,Object>> queryCount(AjhMeetingSend ajhMeetingSend) { | ||
103 | Result<Map<String,Object>> result = new Result<Map<String,Object>>(); | ||
104 | QueryWrapper<AjhMeetingSend> queryWrapper = new QueryWrapper<>(); | ||
105 | queryWrapper.eq(ConvertUtils.isNotEmpty(ajhMeetingSend.getMeetId()),"meet_id",ajhMeetingSend.getMeetId()); | ||
106 | queryWrapper.eq(ConvertUtils.isNotEmpty(ajhMeetingSend.getDepartId()),"depart_id",ajhMeetingSend.getDepartId()); | ||
107 | queryWrapper.eq(ConvertUtils.isNotEmpty(ajhMeetingSend.getMeetStatus()),"meet_status",ajhMeetingSend.getMeetStatus()); | ||
108 | queryWrapper.eq(ConvertUtils.isNotEmpty(ajhMeetingSend.getSendStatus()),"send_status",ajhMeetingSend.getSendStatus()); | ||
109 | queryWrapper.like(ConvertUtils.isNotEmpty(ajhMeetingSend.getMeetTitle()),"meet_title",ajhMeetingSend.getMeetTitle()); | ||
110 | queryWrapper.between(ConvertUtils.isNotEmpty(ajhMeetingSend.getMeetStartTime()),"meet_start_time", | ||
111 | ajhMeetingSend.getMeetStartTime()+" 00:00:00",ajhMeetingSend.getMeetEndTime()+" 23:59:59"); | ||
112 | Map<String,Object> map = new HashMap<>(); | ||
113 | int yes = 0;int no = 0; | ||
114 | List<AjhMeetingSend> list = ajhMeetingSendService.list(queryWrapper); | ||
115 | for (AjhMeetingSend bean : list) { | ||
116 | if("0".equals(bean.getSendStatus())){ | ||
117 | no++; | ||
118 | }else if("1".equals(bean.getSendStatus())){ | ||
119 | yes++; | ||
120 | }else{} | ||
121 | } | ||
122 | map.put("yes", yes); | ||
123 | map.put("no", no); | ||
124 | result.setSuccess(true); | ||
125 | result.setResult(map); | ||
126 | return result; | ||
127 | } | ||
128 | |||
92 | /** | 129 | /** |
93 | * <pre> | 130 | * <pre> |
94 | * 添加 | 131 | * 添加 | ... | ... |
... | @@ -123,4 +123,12 @@ public class AjhMeeting { | ... | @@ -123,4 +123,12 @@ public class AjhMeeting { |
123 | @TableField(exist = false) | 123 | @TableField(exist = false) |
124 | @ApiModelProperty(value = "机构名称") | 124 | @ApiModelProperty(value = "机构名称") |
125 | private java.lang.String departName; | 125 | private java.lang.String departName; |
126 | /**执行情况*/ | ||
127 | @TableField(exist = false) | ||
128 | @ApiModelProperty(value = "执行情况") | ||
129 | private java.lang.String executionStatus; | ||
130 | /**参与人数*/ | ||
131 | @TableField(exist = false) | ||
132 | @ApiModelProperty(value = "参与人数") | ||
133 | private java.lang.String particNum; | ||
126 | } | 134 | } | ... | ... |
... | @@ -31,7 +31,6 @@ public class AjhMeetingSend { | ... | @@ -31,7 +31,6 @@ public class AjhMeetingSend { |
31 | @ApiModelProperty(value = "主键") | 31 | @ApiModelProperty(value = "主键") |
32 | private String id; | 32 | private String id; |
33 | /**会议ID*/ | 33 | /**会议ID*/ |
34 | @Excel(name = "会议ID", width = 15) | ||
35 | @ApiModelProperty(value = "会议ID") | 34 | @ApiModelProperty(value = "会议ID") |
36 | private String meetId; | 35 | private String meetId; |
37 | /**机构ID*/ | 36 | /**机构ID*/ |
... | @@ -111,30 +110,33 @@ public class AjhMeetingSend { | ... | @@ -111,30 +110,33 @@ public class AjhMeetingSend { |
111 | @Dict(dicCode = "meetting_status") | 110 | @Dict(dicCode = "meetting_status") |
112 | private Integer meetStatus; | 111 | private Integer meetStatus; |
113 | /**创建人*/ | 112 | /**创建人*/ |
114 | @Excel(name = "创建人", width = 15) | ||
115 | @ApiModelProperty(value = "创建人") | 113 | @ApiModelProperty(value = "创建人") |
116 | private String createBy; | 114 | private String createBy; |
117 | /**创建时间*/ | 115 | /**创建时间*/ |
118 | @Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss") | ||
119 | @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") | 116 | @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") |
120 | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") | 117 | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
121 | @ApiModelProperty(value = "创建时间") | 118 | @ApiModelProperty(value = "创建时间") |
122 | private Date createTime; | 119 | private Date createTime; |
123 | /**更新人*/ | 120 | /**更新人*/ |
124 | @Excel(name = "更新人", width = 15) | ||
125 | @ApiModelProperty(value = "更新人") | 121 | @ApiModelProperty(value = "更新人") |
126 | private String updateBy; | 122 | private String updateBy; |
127 | /**更新时间*/ | 123 | /**更新时间*/ |
128 | @Excel(name = "更新时间", width = 20, format = "yyyy-MM-dd HH:mm:ss") | ||
129 | @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") | 124 | @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") |
130 | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") | 125 | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
131 | @ApiModelProperty(value = "更新时间") | 126 | @ApiModelProperty(value = "更新时间") |
132 | private Date updateTime; | 127 | private Date updateTime; |
133 | 128 | ||
134 | 129 | /**机构名称*/ | |
135 | /**附件*/ | ||
136 | @TableField(exist = false) | 130 | @TableField(exist = false) |
137 | @ApiModelProperty(value = "机构名称") | 131 | @ApiModelProperty(value = "机构名称") |
138 | private java.lang.String departName; | 132 | private java.lang.String departName; |
133 | /**邀请人数*/ | ||
134 | @TableField(exist = false) | ||
135 | @ApiModelProperty(value = "邀请人数") | ||
136 | private java.lang.String inviteNum; | ||
137 | /**参与人数*/ | ||
138 | @TableField(exist = false) | ||
139 | @ApiModelProperty(value = "参与人数") | ||
140 | private java.lang.String particNum; | ||
139 | 141 | ||
140 | } | 142 | } | ... | ... |
1 | package com.skua.modules.ajh.mapper; | 1 | package com.skua.modules.ajh.mapper; |
2 | 2 | ||
3 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||
4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
3 | import com.skua.core.api.vo.LoginUser; | 5 | import com.skua.core.api.vo.LoginUser; |
4 | import com.skua.modules.ajh.entity.AjhMeetingSend; | 6 | import com.skua.modules.ajh.entity.AjhMeetingSend; |
5 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; | 7 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
6 | import org.apache.ibatis.annotations.Param; | 8 | import org.apache.ibatis.annotations.Param; |
9 | import org.apache.ibatis.annotations.Select; | ||
7 | 10 | ||
8 | import java.util.List; | 11 | import java.util.List; |
9 | 12 | ||
... | @@ -25,8 +28,9 @@ public interface AjhMeetingSendMapper extends BaseMapper<AjhMeetingSend> { | ... | @@ -25,8 +28,9 @@ public interface AjhMeetingSendMapper extends BaseMapper<AjhMeetingSend> { |
25 | */ | 28 | */ |
26 | public AjhMeetingSend queryByMeetId(@Param("meetId") String meetId); | 29 | public AjhMeetingSend queryByMeetId(@Param("meetId") String meetId); |
27 | 30 | ||
28 | 31 | @Select("SELECT *,IFNULL( r.count, 0 ) AS invite_num,IFNULL( a.count, 0 ) AS partic_num " + | |
29 | 32 | " FROM ajh_meeting_send " + | |
30 | 33 | " LEFT JOIN ( SELECT count( id ) count, meets_id FROM ajh_meeting_receipt GROUP BY meets_id ) r ON r.meets_id = id " + | |
31 | 34 | " LEFT JOIN ( SELECT count( id ) count, meets_id FROM ajh_meeting_attend GROUP BY meets_id ) a ON a.meets_id = id ${ew.customSqlSegment}") | |
35 | List<AjhMeetingSend> getListByWrapper(Page page,@Param("ew") QueryWrapper<AjhMeetingSend> queryWrapper); | ||
32 | } | 36 | } | ... | ... |
... | @@ -19,25 +19,29 @@ | ... | @@ -19,25 +19,29 @@ |
19 | </select> | 19 | </select> |
20 | <select id="queryPageList" resultType="com.skua.modules.ajh.entity.AjhMeeting"> | 20 | <select id="queryPageList" resultType="com.skua.modules.ajh.entity.AjhMeeting"> |
21 | SELECT | 21 | SELECT |
22 | * | 22 | CONCAT(s1.num,'/',s2.num) execution_status, |
23 | ifnull(a.num,0) as partic_num, | ||
24 | m.* | ||
23 | FROM | 25 | FROM |
24 | ajh_meeting | 26 | ajh_meeting m |
25 | WHERE | 27 | left join (select meet_id,count(id) num from ajh_meeting_send where send_status = 1 GROUP BY meet_id) s1 on s1.meet_id = m.id |
26 | 1 = 1 | 28 | left join (select meet_id,count(id) num from ajh_meeting_send GROUP BY meet_id) s2 on s2.meet_id = m.id |
29 | left join (select DISTINCT sa.meet_id,ma.num from ajh_meeting_send sa left join (select meets_id,count(id) num from ajh_meeting_attend GROUP BY meets_id) ma on ma.meets_id = sa.id) a on a.meet_id = s2.meet_id | ||
30 | WHERE 1 = 1 | ||
27 | <if test="ajhMeeting.departId !=null and ajhMeeting.departId!=''"> | 31 | <if test="ajhMeeting.departId !=null and ajhMeeting.departId!=''"> |
28 | AND depart_id = #{ajhMeeting.departId} | 32 | AND m.depart_id = #{ajhMeeting.departId} |
29 | </if> | 33 | </if> |
30 | <if test="ajhMeeting.sendStatus !=null and ajhMeeting.sendStatus!=''"> | 34 | <if test="ajhMeeting.sendStatus !=null and ajhMeeting.sendStatus!=''"> |
31 | AND send_status = #{ajhMeeting.sendStatus} | 35 | AND m.send_status = #{ajhMeeting.sendStatus} |
32 | </if> | 36 | </if> |
33 | <if test="ajhMeeting.meetTitile !=null and ajhMeeting.meetTitile!=''"> | 37 | <if test="ajhMeeting.meetTitile !=null and ajhMeeting.meetTitile!=''"> |
34 | AND meet_titile LIKE CONCAT(CONCAT('%', #{ajhMeeting.meetTitile}),'%') | 38 | AND m.meet_titile LIKE CONCAT(CONCAT('%', #{ajhMeeting.meetTitile}),'%') |
35 | </if> | 39 | </if> |
36 | <if test="ajhMeeting.startTime !=null and ajhMeeting.endTime!=''"> | 40 | <if test="ajhMeeting.startTime !=null and ajhMeeting.endTime!=''"> |
37 | AND start_time between #{ajhMeeting.startTime} and #{ajhMeeting.endTime} | 41 | AND m.start_time between #{ajhMeeting.startTime} and #{ajhMeeting.endTime} |
38 | </if> | 42 | </if> |
39 | <if test="ajhMeeting.meetCategory !=null and ajhMeeting.meetCategory!=''"> | 43 | <if test="ajhMeeting.meetCategory !=null and ajhMeeting.meetCategory!=''"> |
40 | AND meet_category = #{ajhMeeting.meetCategory} | 44 | AND m.meet_category = #{ajhMeeting.meetCategory} |
41 | </if> | 45 | </if> |
42 | </select> | 46 | </select> |
43 | 47 | ... | ... |
... | @@ -21,10 +21,12 @@ | ... | @@ -21,10 +21,12 @@ |
21 | s.meet_qd_qrcode, | 21 | s.meet_qd_qrcode, |
22 | s.meet_title, | 22 | s.meet_title, |
23 | s.meet_location, | 23 | s.meet_location, |
24 | s.meet_content | 24 | s.meet_content, |
25 | m.meet_category | ||
25 | FROM | 26 | FROM |
26 | ajh_meeting_receipt r | 27 | ajh_meeting_receipt r |
27 | LEFT JOIN ajh_meeting_send s ON s.id = r.meets_id | 28 | LEFT JOIN ajh_meeting_send s ON s.id = r.meets_id |
29 | LEFT JOIN ajh_meeting m ON m.id = s.meet_id | ||
28 | LEFT JOIN ( SELECT * FROM sys_dict_item WHERE dict_id = | 30 | LEFT JOIN ( SELECT * FROM sys_dict_item WHERE dict_id = |
29 | ( SELECT id FROM sys_dict WHERE dict_code = 'attend_status' ) ) d ON d.item_value = r.status | 31 | ( SELECT id FROM sys_dict WHERE dict_code = 'attend_status' ) ) d ON d.item_value = r.status |
30 | WHERE | 32 | WHERE |
... | @@ -38,6 +40,9 @@ | ... | @@ -38,6 +40,9 @@ |
38 | <if test="ajhMeetingReceiptVO.meetsId!=null"> | 40 | <if test="ajhMeetingReceiptVO.meetsId!=null"> |
39 | and r.meets_id = #{ajhMeetingReceiptVO.meetsId} | 41 | and r.meets_id = #{ajhMeetingReceiptVO.meetsId} |
40 | </if> | 42 | </if> |
43 | <if test="ajhMeetingReceiptVO.meetCategory!=null"> | ||
44 | and m.meet_category = #{ajhMeetingReceiptVO.meetCategory} | ||
45 | </if> | ||
41 | </select> | 46 | </select> |
42 | 47 | ||
43 | </mapper> | 48 | </mapper> | ... | ... |
1 | package com.skua.modules.ajh.service; | 1 | package com.skua.modules.ajh.service; |
2 | 2 | ||
3 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||
4 | import com.baomidou.mybatisplus.core.metadata.IPage; | ||
5 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
3 | import com.skua.modules.ajh.entity.AjhMeetingSend; | 6 | import com.skua.modules.ajh.entity.AjhMeetingSend; |
4 | import com.baomidou.mybatisplus.extension.service.IService; | 7 | import com.baomidou.mybatisplus.extension.service.IService; |
5 | import com.skua.modules.ajh.vo.AjhMeetingVO; | 8 | import com.skua.modules.ajh.vo.AjhMeetingVO; |
... | @@ -30,4 +33,6 @@ public interface IAjhMeetingSendService extends IService<AjhMeetingSend> { | ... | @@ -30,4 +33,6 @@ public interface IAjhMeetingSendService extends IService<AjhMeetingSend> { |
30 | * @return | 33 | * @return |
31 | */ | 34 | */ |
32 | public AjhMeetingSend queryByMeetId(String meetId); | 35 | public AjhMeetingSend queryByMeetId(String meetId); |
36 | |||
37 | IPage<AjhMeetingSend> queryPage(Page<AjhMeetingSend> page, QueryWrapper<AjhMeetingSend> queryWrapper); | ||
33 | } | 38 | } | ... | ... |
1 | package com.skua.modules.ajh.service.impl; | 1 | package com.skua.modules.ajh.service.impl; |
2 | 2 | ||
3 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||
4 | import com.baomidou.mybatisplus.core.metadata.IPage; | ||
5 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
3 | import com.skua.core.api.vo.LoginUser; | 6 | import com.skua.core.api.vo.LoginUser; |
4 | import com.skua.modules.ajh.entity.AjhMeetingAttend; | 7 | import com.skua.modules.ajh.entity.AjhMeetingAttend; |
5 | import com.skua.modules.ajh.entity.AjhMeetingMinutes; | 8 | import com.skua.modules.ajh.entity.AjhMeetingMinutes; |
... | @@ -170,4 +173,11 @@ public class AjhMeetingSendServiceImpl extends ServiceImpl<AjhMeetingSendMapper, | ... | @@ -170,4 +173,11 @@ public class AjhMeetingSendServiceImpl extends ServiceImpl<AjhMeetingSendMapper, |
170 | public AjhMeetingSend queryByMeetId(String meetId){ | 173 | public AjhMeetingSend queryByMeetId(String meetId){ |
171 | return ajhMeetingSendMapper.queryByMeetId( meetId ); | 174 | return ajhMeetingSendMapper.queryByMeetId( meetId ); |
172 | } | 175 | } |
176 | |||
177 | @Override | ||
178 | public IPage<AjhMeetingSend> queryPage(Page<AjhMeetingSend> page, QueryWrapper<AjhMeetingSend> queryWrapper) { | ||
179 | List<AjhMeetingSend> list = ajhMeetingSendMapper.getListByWrapper(page, queryWrapper); | ||
180 | page.setRecords(list); | ||
181 | return page; | ||
182 | } | ||
173 | } | 183 | } | ... | ... |
... | @@ -65,4 +65,7 @@ public class AjhMeetingReceiptVO { | ... | @@ -65,4 +65,7 @@ public class AjhMeetingReceiptVO { |
65 | /**会议内容*/ | 65 | /**会议内容*/ |
66 | @ApiModelProperty(value = "会议内容") | 66 | @ApiModelProperty(value = "会议内容") |
67 | private String meetContent; | 67 | private String meetContent; |
68 | /**会议类型*/ | ||
69 | @ApiModelProperty(value = "会议类型") | ||
70 | private String meetCategory; | ||
68 | } | 71 | } | ... | ... |
... | @@ -37,6 +37,7 @@ import javax.servlet.http.HttpServletResponse; | ... | @@ -37,6 +37,7 @@ import javax.servlet.http.HttpServletResponse; |
37 | import java.io.IOException; | 37 | import java.io.IOException; |
38 | import java.io.UnsupportedEncodingException; | 38 | import java.io.UnsupportedEncodingException; |
39 | import java.net.URLDecoder; | 39 | import java.net.URLDecoder; |
40 | import java.util.ArrayList; | ||
40 | import java.util.Arrays; | 41 | import java.util.Arrays; |
41 | import java.util.List; | 42 | import java.util.List; |
42 | import java.util.Map; | 43 | import java.util.Map; |
... | @@ -66,7 +67,6 @@ public class MaterialInfoController { | ... | @@ -66,7 +67,6 @@ public class MaterialInfoController { |
66 | * @param materialInfo | 67 | * @param materialInfo |
67 | * @param pageNo | 68 | * @param pageNo |
68 | * @param pageSize | 69 | * @param pageSize |
69 | * @param req | ||
70 | * @return | 70 | * @return |
71 | */ | 71 | */ |
72 | @AutoLog(value = "厂区资料管理-分页列表查询") | 72 | @AutoLog(value = "厂区资料管理-分页列表查询") |
... | @@ -74,8 +74,7 @@ public class MaterialInfoController { | ... | @@ -74,8 +74,7 @@ public class MaterialInfoController { |
74 | @GetMapping(value = "/list") | 74 | @GetMapping(value = "/list") |
75 | public Result<IPage<MaterialInfo>> queryPageList(MaterialInfo materialInfo, | 75 | public Result<IPage<MaterialInfo>> queryPageList(MaterialInfo materialInfo, |
76 | @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, | 76 | @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, |
77 | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, | 77 | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { |
78 | HttpServletRequest req) { | ||
79 | String departIds = null; | 78 | String departIds = null; |
80 | Result<IPage<MaterialInfo>> result = new Result<IPage<MaterialInfo>>(); | 79 | Result<IPage<MaterialInfo>> result = new Result<IPage<MaterialInfo>>(); |
81 | Page<MaterialInfo> page = new Page<MaterialInfo>(pageNo, pageSize); | 80 | Page<MaterialInfo> page = new Page<MaterialInfo>(pageNo, pageSize); |
... | @@ -92,22 +91,21 @@ public class MaterialInfoController { | ... | @@ -92,22 +91,21 @@ public class MaterialInfoController { |
92 | 91 | ||
93 | /** | 92 | /** |
94 | * 添加 | 93 | * 添加 |
95 | * | 94 | * @param materialInfo |
96 | * @param MaterialInfo | ||
97 | * @return | 95 | * @return |
98 | */ | 96 | */ |
99 | @AutoLog(value = "厂区资料管理-添加") | 97 | @AutoLog(value = "厂区资料管理-添加") |
100 | @ApiOperation(value = "厂区资料管理-添加", notes = "厂区资料管理-添加") | 98 | @ApiOperation(value = "厂区资料管理-添加", notes = "厂区资料管理-添加") |
101 | @PostMapping(value = "/add") | 99 | @PostMapping(value = "/add") |
102 | public Result<MaterialInfo> add(@RequestBody MaterialInfo MaterialInfo) { | 100 | public Result<MaterialInfo> add(@RequestBody MaterialInfo materialInfo) { |
103 | Result<MaterialInfo> result = new Result<MaterialInfo>(); | 101 | Result<MaterialInfo> result = new Result<MaterialInfo>(); |
104 | try { | 102 | try { |
105 | if (StringUtils.isBlank(MaterialInfo.getDepartId())) { | 103 | if (StringUtils.isBlank(materialInfo.getDepartId())) { |
106 | String userCode = BaseContextHandler.getUserId(); | 104 | String userCode = BaseContextHandler.getUserId(); |
107 | //根据用户id查询所属厂区 只要第一个 | 105 | //根据用户id查询所属厂区 只要第一个 |
108 | MaterialInfo.setDepartId(materialInfoService.queryFacByUserId(userCode)); | 106 | materialInfo.setDepartId(materialInfoService.queryFacByUserId(userCode)); |
109 | } | 107 | } |
110 | materialInfoService.save(MaterialInfo); | 108 | materialInfoService.save(materialInfo); |
111 | result.success("添加成功!"); | 109 | result.success("添加成功!"); |
112 | } catch (Exception e) { | 110 | } catch (Exception e) { |
113 | log.error(e.getMessage(), e); | 111 | log.error(e.getMessage(), e); |
... | @@ -118,21 +116,19 @@ public class MaterialInfoController { | ... | @@ -118,21 +116,19 @@ public class MaterialInfoController { |
118 | 116 | ||
119 | /** | 117 | /** |
120 | * 编辑 | 118 | * 编辑 |
121 | * | 119 | * @param materialInfo |
122 | * @param MaterialInfo | ||
123 | * @return | 120 | * @return |
124 | */ | 121 | */ |
125 | @AutoLog(value = "厂区资料管理-编辑") | 122 | @AutoLog(value = "厂区资料管理-编辑") |
126 | @ApiOperation(value = "厂区资料管理-编辑", notes = "厂区资料管理-编辑") | 123 | @ApiOperation(value = "厂区资料管理-编辑", notes = "厂区资料管理-编辑") |
127 | @PutMapping(value = "/edit") | 124 | @PutMapping(value = "/edit") |
128 | public Result<MaterialInfo> edit(@RequestBody MaterialInfo MaterialInfo) { | 125 | public Result<MaterialInfo> edit(@RequestBody MaterialInfo materialInfo) { |
129 | Result<MaterialInfo> result = new Result<MaterialInfo>(); | 126 | Result<MaterialInfo> result = new Result<MaterialInfo>(); |
130 | MaterialInfo MaterialInfoEntity = materialInfoService.getById(MaterialInfo.getId()); | 127 | MaterialInfo MaterialInfoEntity = materialInfoService.getById(materialInfo.getId()); |
131 | if (MaterialInfoEntity == null) { | 128 | if (MaterialInfoEntity == null) { |
132 | result.error500("未找到对应实体"); | 129 | result.error500("未找到对应实体"); |
133 | } else { | 130 | } else { |
134 | boolean ok = materialInfoService.updateById(MaterialInfo); | 131 | boolean ok = materialInfoService.updateById(materialInfo); |
135 | //TODO 返回false说明什么? | ||
136 | if (ok) { | 132 | if (ok) { |
137 | result.success("修改成功!"); | 133 | result.success("修改成功!"); |
138 | } | 134 | } |
... | @@ -147,7 +143,6 @@ public class MaterialInfoController { | ... | @@ -147,7 +143,6 @@ public class MaterialInfoController { |
147 | * </pre> | 143 | * </pre> |
148 | * @return | 144 | * @return |
149 | * @author Li Yuanyuan, 2022年6月22日 下午2:15:57 | 145 | * @author Li Yuanyuan, 2022年6月22日 下午2:15:57 |
150 | * @Description: TODO(这里描述这个方法的需求变更情况) | ||
151 | */ | 146 | */ |
152 | @AutoLog(value = "厂区资料管理-更新浏览量/下载量") | 147 | @AutoLog(value = "厂区资料管理-更新浏览量/下载量") |
153 | @ApiOperation(value = "厂区资料管理-更新浏览量/下载量", notes = "厂区资料管理-更新浏览量/下载量") | 148 | @ApiOperation(value = "厂区资料管理-更新浏览量/下载量", notes = "厂区资料管理-更新浏览量/下载量") |
... | @@ -320,14 +315,14 @@ public class MaterialInfoController { | ... | @@ -320,14 +315,14 @@ public class MaterialInfoController { |
320 | @AutoLog(value = "厂区资料管理-流量统计") | 315 | @AutoLog(value = "厂区资料管理-流量统计") |
321 | @ApiOperation(value = "厂区资料管理-流量统计", notes = "厂区资料管理-流量统计") | 316 | @ApiOperation(value = "厂区资料管理-流量统计", notes = "厂区资料管理-流量统计") |
322 | @GetMapping(value = "/flowStatistics") | 317 | @GetMapping(value = "/flowStatistics") |
323 | public Result<List<Map<String, Object>>> flowStatistics(String departId,String startTime,String endTime) { | 318 | public Result<List<Map<String, Object>>> flowStatistics(String departId,String startTime,String endTime,String facInformationtype) { |
324 | Result<List<Map<String, Object>>> result = new Result<>(); | 319 | Result<List<Map<String, Object>>> result = new Result<>(); |
325 | if (StringUtils.isBlank(departId)&&StringUtils.isNotBlank(BaseContextHandler.getDeparts())) { | 320 | if (StringUtils.isBlank(departId)&&StringUtils.isNotBlank(BaseContextHandler.getDeparts())) { |
326 | departId = departService.getChildDepartId(BaseContextHandler.getDeparts()); | 321 | departId = departService.getChildDepartId(BaseContextHandler.getDeparts()); |
327 | }else{ | 322 | }else{ |
328 | departId = departService.getChildDepartId(departId); | 323 | departId = departService.getChildDepartId(departId); |
329 | } | 324 | } |
330 | List<Map<String, Object>> pageList = materialInfoService.flowStatistics(departId,startTime,endTime); | 325 | List<Map<String, Object>> pageList = materialInfoService.flowStatistics(departId,startTime,endTime,facInformationtype); |
331 | result.setSuccess(true); | 326 | result.setSuccess(true); |
332 | result.setResult(pageList); | 327 | result.setResult(pageList); |
333 | return result; | 328 | return result; | ... | ... |
... | @@ -36,7 +36,7 @@ public class MaterialInfo { | ... | @@ -36,7 +36,7 @@ public class MaterialInfo { |
36 | /**厂区资料文件名类型*/ | 36 | /**厂区资料文件名类型*/ |
37 | @Excel(name = "厂区资料文件名类型", width = 15) | 37 | @Excel(name = "厂区资料文件名类型", width = 15) |
38 | @ApiModelProperty(value = "厂区资料文件名类型") | 38 | @ApiModelProperty(value = "厂区资料文件名类型") |
39 | @Dict(dicCode = "info_type") | 39 | @Dict(dicCode = "fac_information_type") |
40 | private String facInformationtype; | 40 | private String facInformationtype; |
41 | /**删除状态(0,正常,1已删除)*/ | 41 | /**删除状态(0,正常,1已删除)*/ |
42 | @Excel(name = "删除状态(0,正常,1已删除)", width = 15) | 42 | @Excel(name = "删除状态(0,正常,1已删除)", width = 15) |
... | @@ -85,6 +85,22 @@ public class MaterialInfo { | ... | @@ -85,6 +85,22 @@ public class MaterialInfo { |
85 | @Dict(dicCode = "rules_type") | 85 | @Dict(dicCode = "rules_type") |
86 | @ApiModelProperty(value = "制度类型") | 86 | @ApiModelProperty(value = "制度类型") |
87 | private String rulesType; | 87 | private String rulesType; |
88 | /**法律法规类型*/ | ||
89 | @Dict(dicCode = "laws_type") | ||
90 | @ApiModelProperty(value = "法律法规类型") | ||
91 | private String lawsType; | ||
92 | /**法律法规归属*/ | ||
93 | @Dict(dicCode = "laws_source") | ||
94 | @ApiModelProperty(value = "法律法规归属") | ||
95 | private String lawsSource; | ||
96 | /**标准规范类型*/ | ||
97 | @Dict(dicCode = "standards_type") | ||
98 | @ApiModelProperty(value = "标准规范类型") | ||
99 | private String standardsType; | ||
100 | /**标准规范来源*/ | ||
101 | @Dict(dicCode = "standards_source") | ||
102 | @ApiModelProperty(value = "标准规范来源") | ||
103 | private String standardsSource; | ||
88 | /**发布时间*/ | 104 | /**发布时间*/ |
89 | @Excel(name = "发布时间", width = 15) | 105 | @Excel(name = "发布时间", width = 15) |
90 | @ApiModelProperty(value = "发布时间") | 106 | @ApiModelProperty(value = "发布时间") | ... | ... |
... | @@ -15,7 +15,7 @@ public interface MaterialInfoMapper extends BaseMapper<MaterialInfo> { | ... | @@ -15,7 +15,7 @@ public interface MaterialInfoMapper extends BaseMapper<MaterialInfo> { |
15 | 15 | ||
16 | String queryFacByUserId(@Param("userCode") String userCode); | 16 | String queryFacByUserId(@Param("userCode") String userCode); |
17 | 17 | ||
18 | List<Map<String, Object>> getAnalysis(@Param("facInfo") MaterialInfo facInfo); | 18 | List<Map<String, Object>> getAnalysis(@Param("dictCode") String dictCode); |
19 | /** | 19 | /** |
20 | * <pre> | 20 | * <pre> |
21 | * 流量统计 | 21 | * 流量统计 |
... | @@ -27,7 +27,7 @@ public interface MaterialInfoMapper extends BaseMapper<MaterialInfo> { | ... | @@ -27,7 +27,7 @@ public interface MaterialInfoMapper extends BaseMapper<MaterialInfo> { |
27 | * @author Li Yuanyuan, 2022年6月22日 下午3:10:31 | 27 | * @author Li Yuanyuan, 2022年6月22日 下午3:10:31 |
28 | * @Description: TODO(这里描述这个方法的需求变更情况) | 28 | * @Description: TODO(这里描述这个方法的需求变更情况) |
29 | */ | 29 | */ |
30 | List<Map<String, Object>> flowStatistics(String departId, String startTime, String endTime); | 30 | List<Map<String, Object>> flowStatistics(String departId, String startTime, String endTime, String facInformationtype); |
31 | 31 | ||
32 | List<MaterialInfo> getList(@Param("materialInfo") MaterialInfo materialInfo, @Param("departIds") String departIds); | 32 | List<MaterialInfo> getList(@Param("materialInfo") MaterialInfo materialInfo, @Param("departIds") String departIds); |
33 | } | 33 | } | ... | ... |
... | @@ -14,24 +14,12 @@ | ... | @@ -14,24 +14,12 @@ |
14 | <select id="getAnalysis" resultType="java.util.Map"> | 14 | <select id="getAnalysis" resultType="java.util.Map"> |
15 | SELECT | 15 | SELECT |
16 | b.item_value id, | 16 | b.item_value id, |
17 | ifnull(a.cou,0) count, | 17 | 0 count, |
18 | b.item_text NAME | 18 | b.item_text NAME |
19 | FROM | 19 | FROM |
20 | ( SELECT item_text, item_value FROM sys_dict_item | 20 | ( SELECT item_text, item_value FROM sys_dict_item |
21 | WHERE dict_id = ( SELECT id FROM sys_dict WHERE dict_code = 'info_type' ) | 21 | WHERE dict_id = ( SELECT id FROM sys_dict WHERE dict_code = #{dictCode} ) |
22 | ) b | 22 | ) b |
23 | left join | ||
24 | ( SELECT fac_informationtype, count( 1 ) cou FROM material_info | ||
25 | <if test="facInfo.departId!=null and facInfo.departId!=''"> | ||
26 | where depart_id in | ||
27 | <foreach item="item" index="index" collection="facInfo.departId.split(',')" open="(" separator="," close=")"> | ||
28 | '${item}' | ||
29 | </foreach> | ||
30 | </if> | ||
31 | GROUP BY fac_informationtype | ||
32 | ) a | ||
33 | ON a.fac_informationtype = b.item_value | ||
34 | |||
35 | </select> | 23 | </select> |
36 | <select id="flowStatistics" resultType="java.util.Map"> | 24 | <select id="flowStatistics" resultType="java.util.Map"> |
37 | SELECT | 25 | SELECT |
... | @@ -43,13 +31,16 @@ | ... | @@ -43,13 +31,16 @@ |
43 | INNER JOIN material_info_handle_record b ON a.id = b.info_id | 31 | INNER JOIN material_info_handle_record b ON a.id = b.info_id |
44 | WHERE | 32 | WHERE |
45 | b.create_time >= #{startTime} | 33 | b.create_time >= #{startTime} |
46 | AND b.create_time <= #{endTime} | 34 | AND b.create_time <= #{endTime} |
47 | <if test="departId!=null and departId!=''"> | 35 | <if test="departId!=null and departId!=''"> |
48 | and a.depart_id in | 36 | and a.depart_id in |
49 | <foreach item="item" index="index" collection="departId.split(',')" open="(" separator="," close=")"> | 37 | <foreach item="item" index="index" collection="departId.split(',')" open="(" separator="," close=")"> |
50 | '${item}' | 38 | '${item}' |
51 | </foreach> | 39 | </foreach> |
52 | </if> | 40 | </if> |
41 | <if test="facInformationtype!=null and facInformationtype!=''"> | ||
42 | AND a.fac_informationtype = #{facInformationtype} | ||
43 | </if> | ||
53 | GROUP BY | 44 | GROUP BY |
54 | b.create_time,b.handle_type | 45 | b.create_time,b.handle_type |
55 | </select> | 46 | </select> |
... | @@ -68,5 +59,8 @@ | ... | @@ -68,5 +59,8 @@ |
68 | <if test="materialInfo.facInformationName!=null and materialInfo.facInformationName!=''"> | 59 | <if test="materialInfo.facInformationName!=null and materialInfo.facInformationName!=''"> |
69 | and fac_information_name like CONCAT(CONCAT('%', #{materialInfo.facInformationName}),'%') | 60 | and fac_information_name like CONCAT(CONCAT('%', #{materialInfo.facInformationName}),'%') |
70 | </if> | 61 | </if> |
62 | <if test="materialInfo.rulesType!=null and materialInfo.rulesType!=''"> | ||
63 | and rules_type like CONCAT(CONCAT('%', #{materialInfo.rulesType}),'%') | ||
64 | </if> | ||
71 | </select> | 65 | </select> |
72 | </mapper> | 66 | </mapper> | ... | ... |
... | @@ -41,7 +41,7 @@ public interface IMaterialInfoService extends IService<MaterialInfo> { | ... | @@ -41,7 +41,7 @@ public interface IMaterialInfoService extends IService<MaterialInfo> { |
41 | * @author Li Yuanyuan, 2022年6月22日 下午3:00:25 | 41 | * @author Li Yuanyuan, 2022年6月22日 下午3:00:25 |
42 | * @Description: TODO(这里描述这个方法的需求变更情况) | 42 | * @Description: TODO(这里描述这个方法的需求变更情况) |
43 | */ | 43 | */ |
44 | List<Map<String, Object>> flowStatistics(String departId, String startTime, String endTime); | 44 | List<Map<String, Object>> flowStatistics(String departId, String startTime, String endTime,String facInformationtype); |
45 | 45 | ||
46 | IPage<MaterialInfo> getList(Page<MaterialInfo> page, MaterialInfo materialInfo, String departIds); | 46 | IPage<MaterialInfo> getList(Page<MaterialInfo> page, MaterialInfo materialInfo, String departIds); |
47 | } | 47 | } | ... | ... |
... | @@ -24,7 +24,33 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat | ... | @@ -24,7 +24,33 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat |
24 | 24 | ||
25 | @Override | 25 | @Override |
26 | public List<Map<String, Object>> getAnalysis(MaterialInfo facInfo) { | 26 | public List<Map<String, Object>> getAnalysis(MaterialInfo facInfo) { |
27 | return baseMapper.getAnalysis(facInfo); | 27 | List<Map<String, Object>> tList = new ArrayList<>(); |
28 | String departIds = facInfo.getDepartId(); | ||
29 | List<MaterialInfo> list = baseMapper.getList(facInfo, departIds); | ||
30 | Map<String, Object> totalMap = new HashMap<>(); | ||
31 | totalMap.put("total",list.size()); | ||
32 | tList.add(totalMap); | ||
33 | String dictCode = "rules_type";//标准规范:bzgf 法律法规:flfg 公司制度章程:gzzd | ||
34 | if("gzzd".equals(facInfo.getFacInformationtype())){ | ||
35 | dictCode = "rules_type"; | ||
36 | }else if("bzgf".equals(facInfo.getFacInformationtype())){ | ||
37 | dictCode = "standards_type"; | ||
38 | }else if("flfg".equals(facInfo.getFacInformationtype())){ | ||
39 | dictCode = "laws_type"; | ||
40 | } | ||
41 | List<Map<String, Object>> typeList = baseMapper.getAnalysis(dictCode); | ||
42 | for (Map<String, Object> map : typeList) { | ||
43 | String type = map.get("id").toString(); | ||
44 | int count = 0; | ||
45 | for(MaterialInfo materialInfo: list){ | ||
46 | if(materialInfo.getRulesType().contains(type)){ | ||
47 | count++; | ||
48 | } | ||
49 | } | ||
50 | map.put("count",count); | ||
51 | tList.add(map); | ||
52 | } | ||
53 | return tList; | ||
28 | } | 54 | } |
29 | 55 | ||
30 | @Override | 56 | @Override |
... | @@ -33,12 +59,12 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat | ... | @@ -33,12 +59,12 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat |
33 | } | 59 | } |
34 | 60 | ||
35 | @Override | 61 | @Override |
36 | public List<Map<String, Object>> flowStatistics(String departId, String startTime, String endTime) { | 62 | public List<Map<String, Object>> flowStatistics(String departId, String startTime, String endTime, String facInformationtype) { |
37 | //日期切片 | 63 | //日期切片 |
38 | List<Map<String,Object>> resultList = new ArrayList<Map<String,Object>>(); | 64 | List<Map<String,Object>> resultList = new ArrayList<Map<String,Object>>(); |
39 | List<String> timeList = DateUtils.sliceUpDateRange(startTime,endTime,"month"); | 65 | List<String> timeList = DateUtils.sliceUpDateRange(startTime,endTime,"month"); |
40 | //获取统计结果 | 66 | //获取统计结果 |
41 | List<Map<String,Object>> dataList = baseMapper.flowStatistics(departId,startTime,endTime); | 67 | List<Map<String,Object>> dataList = baseMapper.flowStatistics(departId,startTime,endTime,facInformationtype); |
42 | Map<String,Map<String,Object>> resultMap = new HashMap<String,Map<String,Object>>(); | 68 | Map<String,Map<String,Object>> resultMap = new HashMap<String,Map<String,Object>>(); |
43 | for(Map<String,Object> map : dataList) { | 69 | for(Map<String,Object> map : dataList) { |
44 | resultMap.put(ConvertUtils.getString(map.get("create_time"))+"_"+ConvertUtils.getString(map.get("handle_type")), map); | 70 | resultMap.put(ConvertUtils.getString(map.get("create_time"))+"_"+ConvertUtils.getString(map.get("handle_type")), map); | ... | ... |
... | @@ -189,18 +189,27 @@ | ... | @@ -189,18 +189,27 @@ |
189 | v9.CSPH as csph, | 189 | v9.CSPH as csph, |
190 | v9.CSTN as cstn, | 190 | v9.CSTN as cstn, |
191 | v9.CSZL as cstp, | 191 | v9.CSZL as cstp, |
192 | v9.JSSS as jsss, | ||
193 | v9.CSSS as csss, | ||
192 | v3.qt5,v3.qt4,v3.qt3,v3.qt2,v3.qt1, | 194 | v3.qt5,v3.qt4,v3.qt3,v3.qt2,v3.qt1, |
193 | v3.scqk5,v3.scqk4,v3.scqk3,v3.scqk2,v3.scqk1, | 195 | v3.scqk5,v3.scqk4,v3.scqk3,v3.scqk2,v3.scqk1, |
194 | v3.id,v3.zwncb,v3.tnlgyy,v3.sjtnl, | 196 | v3.id,v3.zwncb,v3.tnlgyy,v3.sjtnl, |
195 | v3.lltnl,v3.wnndgyy,v3.zsjwnnd,v3.llwnnd,v3.yjyy,v3.dhyy, | 197 | v3.lltnl,v3.wnndgyy,v3.zsjwnnd,v3.llwnnd,v3.yjyy,v3.dhyy, |
196 | v8.dlhj,v8.yjhl,v8.wnl, | 198 | v8.dlhj,v8.yjhl,v8.wnl, |
197 | v2.zclsl,v2.rjclsl | 199 | v2.zclsl,v2.rjclsl, |
200 | t.target_power as dsdhnmb, | ||
201 | round(v8.dlhj/(v2.zclsl*10000),2) as dsdhzsj, | ||
202 | '' as dsdhdb, | ||
203 | t.target_drug as yjnmb, | ||
204 | round(v8.yjhl/(v2.zclsl*10000),2) as yjzsj, | ||
205 | '' as yjdb, | ||
206 | f.pro_scale as sjgm | ||
198 | FROM | 207 | FROM |
199 | sys_depart d | 208 | sys_depart d |
200 | LEFT JOIN (SELECT * FROM view_30a8 WHERE depart_id = #{departId} AND time = #{dataTime} AND zs = #{week}) v3 on v3.depart_id = d.id | 209 | LEFT JOIN (SELECT * FROM view_30a8 WHERE depart_id = #{departId} AND time = #{dataTime} AND zs = #{week}) v3 on v3.depart_id = d.id |
201 | LEFT JOIN (SELECT | 210 | LEFT JOIN (SELECT |
202 | ROUND(AVG(JSCOD),2) JSCOD,ROUND(AVG(JSAD),2) JSAD,ROUND(AVG(JSPH),2) JSPH,ROUND(AVG(JSZD),2) JSZD,ROUND(AVG(JSZL),2) JSZL, | 211 | ROUND(AVG(JSCOD),2) JSCOD,ROUND(AVG(JSAD),2) JSAD,ROUND(AVG(JSPH),2) JSPH,ROUND(AVG(JSZD),2) JSZD,ROUND(AVG(JSZL),2) JSZL,ROUND(AVG(JSSS),2) JSSS, |
203 | ROUND(AVG(CSCOD),2) CSCOD,ROUND(AVG(CSAD),2) CSAD,ROUND(AVG(CSPH),2) CSPH,ROUND(AVG(CSTN),2) CSTN,ROUND(AVG(CSZL),2) CSZL, | 212 | ROUND(AVG(CSCOD),2) CSCOD,ROUND(AVG(CSAD),2) CSAD,ROUND(AVG(CSPH),2) CSPH,ROUND(AVG(CSTN),2) CSTN,ROUND(AVG(CSZL),2) CSZL,ROUND(AVG(CSSS),2) CSSS, |
204 | depart_id | 213 | depart_id |
205 | FROM view_9bff | 214 | FROM view_9bff |
206 | WHERE depart_id = #{departId} AND time >= #{startDate} AND time <= #{endDate} ) v9 on v9.depart_id = d.id | 215 | WHERE depart_id = #{departId} AND time >= #{startDate} AND time <= #{endDate} ) v9 on v9.depart_id = d.id |
... | @@ -216,6 +225,8 @@ | ... | @@ -216,6 +225,8 @@ |
216 | depart_id | 225 | depart_id |
217 | FROM view_2119 | 226 | FROM view_2119 |
218 | WHERE depart_id = #{departId} AND time >= #{startDate} AND time <= #{endDate} ) v2 on v2.depart_id = d.id | 227 | WHERE depart_id = #{departId} AND time >= #{startDate} AND time <= #{endDate} ) v2 on v2.depart_id = d.id |
228 | LEFT JOIN sys_factory_info f on f.depart_id = d.id | ||
229 | LEFT JOIN report_target_config t on t.depart_id = d.id | ||
219 | WHERE | 230 | WHERE |
220 | d.id = #{departId} | 231 | d.id = #{departId} |
221 | </select> | 232 | </select> | ... | ... |
sk-module-system/src/main/java/com/skua/modules/system/controller/SysFactoryUserDataController.java
0 → 100644
1 | package com.skua.modules.system.controller; | ||
2 | |||
3 | import java.util.Arrays; | ||
4 | import java.util.List; | ||
5 | import java.util.Map; | ||
6 | import java.io.IOException; | ||
7 | import java.io.UnsupportedEncodingException; | ||
8 | import java.net.URLDecoder; | ||
9 | import javax.servlet.http.HttpServletRequest; | ||
10 | import javax.servlet.http.HttpServletResponse; | ||
11 | import com.skua.core.api.vo.Result; | ||
12 | import com.skua.core.aspect.annotation.AutoLog; | ||
13 | import com.skua.core.context.BaseContextHandler; | ||
14 | import com.skua.core.query.QueryGenerator; | ||
15 | import com.skua.core.service.ISequenceService; | ||
16 | import com.skua.core.util.ConvertUtils; | ||
17 | import com.skua.modules.system.entity.SysFactoryUserData; | ||
18 | import com.skua.modules.system.service.ISysFactoryUserDataService; | ||
19 | import java.util.Date; | ||
20 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||
21 | import com.baomidou.mybatisplus.core.metadata.IPage; | ||
22 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
23 | import lombok.extern.slf4j.Slf4j; | ||
24 | |||
25 | import org.jeecgframework.poi.excel.ExcelImportUtil; | ||
26 | import org.jeecgframework.poi.excel.def.NormalExcelConstants; | ||
27 | import org.jeecgframework.poi.excel.entity.ExportParams; | ||
28 | import org.jeecgframework.poi.excel.entity.ImportParams; | ||
29 | import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; | ||
30 | |||
31 | import org.springframework.beans.factory.annotation.Autowired; | ||
32 | import org.springframework.web.bind.annotation.*; | ||
33 | import org.springframework.web.multipart.MultipartFile; | ||
34 | import org.springframework.web.multipart.MultipartHttpServletRequest; | ||
35 | import org.springframework.web.servlet.ModelAndView; | ||
36 | import com.alibaba.fastjson.JSON; | ||
37 | import io.swagger.annotations.Api; | ||
38 | import io.swagger.annotations.ApiOperation; | ||
39 | |||
40 | /** | ||
41 | * 人员证书管理 | ||
42 | */ | ||
43 | @Slf4j | ||
44 | @Api(tags="人员证书管理") | ||
45 | @RestController | ||
46 | @RequestMapping("/system/sysFactoryUserData") | ||
47 | public class SysFactoryUserDataController { | ||
48 | @Autowired | ||
49 | private ISysFactoryUserDataService sysFactoryUserDataService; | ||
50 | |||
51 | /** | ||
52 | * <pre> | ||
53 | * 分页列表查询 | ||
54 | * </pre> | ||
55 | * @param sysFactoryUserData | ||
56 | * @param pageNo | ||
57 | * @param pageSize | ||
58 | * @param req | ||
59 | * @return | ||
60 | * @author 开发者姓名, 开发时间 | ||
61 | * @Description: TODO(这里描述这个方法的需求变更情况) | ||
62 | */ | ||
63 | |||
64 | @AutoLog(value = "人员证书管理-分页列表查询") | ||
65 | @ApiOperation(value="人员证书管理-分页列表查询", notes="人员证书管理-分页列表查询") | ||
66 | @GetMapping(value = "/list") | ||
67 | public Result<IPage<SysFactoryUserData>> queryPageList(SysFactoryUserData sysFactoryUserData, | ||
68 | @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, | ||
69 | @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, | ||
70 | HttpServletRequest req) { | ||
71 | Result<IPage<SysFactoryUserData>> result = new Result<IPage<SysFactoryUserData>>(); | ||
72 | QueryWrapper<SysFactoryUserData> queryWrapper = QueryGenerator.initQueryWrapper(sysFactoryUserData, req.getParameterMap()); | ||
73 | Page<SysFactoryUserData> page = new Page<SysFactoryUserData>(pageNo, pageSize); | ||
74 | IPage<SysFactoryUserData> pageList = sysFactoryUserDataService.page(page, queryWrapper); | ||
75 | result.setSuccess(true); | ||
76 | result.setResult(pageList); | ||
77 | return result; | ||
78 | } | ||
79 | |||
80 | /** | ||
81 | * <pre> | ||
82 | * 添加 | ||
83 | * </pre> | ||
84 | * @param sysFactoryUserData | ||
85 | * @return | ||
86 | * @author 开发者姓名, 开发时间 | ||
87 | * @Description: TODO(这里描述这个方法的需求变更情况) | ||
88 | */ | ||
89 | @AutoLog(value = "人员证书管理-添加") | ||
90 | @ApiOperation(value="人员证书管理-添加", notes="人员证书管理-添加") | ||
91 | @PostMapping(value = "/add") | ||
92 | public Result<SysFactoryUserData> add(@RequestBody SysFactoryUserData sysFactoryUserData) { | ||
93 | Result<SysFactoryUserData> result = new Result<SysFactoryUserData>(); | ||
94 | try { | ||
95 | sysFactoryUserDataService.save(sysFactoryUserData); | ||
96 | result.success("添加成功!"); | ||
97 | } catch (Exception e) { | ||
98 | log.error(e.getMessage(),e); | ||
99 | result.error500("操作失败"); | ||
100 | } | ||
101 | return result; | ||
102 | } | ||
103 | /** | ||
104 | * <pre> | ||
105 | * 编辑 | ||
106 | * </pre> | ||
107 | * @param sysFactoryUserData | ||
108 | * @return | ||
109 | * @author 开发者姓名, 开发时间 | ||
110 | * @Description: TODO(这里描述这个方法的需求变更情况) | ||
111 | */ | ||
112 | @AutoLog(value = "人员证书管理-编辑") | ||
113 | @ApiOperation(value="人员证书管理-编辑", notes="人员证书管理-编辑") | ||
114 | @PutMapping(value = "/edit") | ||
115 | public Result<SysFactoryUserData> edit(@RequestBody SysFactoryUserData sysFactoryUserData) { | ||
116 | Result<SysFactoryUserData> result = new Result<SysFactoryUserData>(); | ||
117 | SysFactoryUserData sysFactoryUserDataEntity = sysFactoryUserDataService.getById(sysFactoryUserData.getId()); | ||
118 | if(sysFactoryUserDataEntity==null) { | ||
119 | result.error500("未找到对应实体"); | ||
120 | }else { | ||
121 | boolean ok = sysFactoryUserDataService.updateById(sysFactoryUserData); | ||
122 | //TODO 返回false说明什么? | ||
123 | if(ok) { | ||
124 | result.success("修改成功!"); | ||
125 | } | ||
126 | } | ||
127 | |||
128 | return result; | ||
129 | } | ||
130 | /** | ||
131 | * <pre> | ||
132 | * 通过id删除 | ||
133 | * </pre> | ||
134 | * @param id | ||
135 | * @return | ||
136 | * @author 开发者姓名, 开发时间 | ||
137 | * @Description: TODO(这里描述这个方法的需求变更情况) | ||
138 | */ | ||
139 | @AutoLog(value = "人员证书管理-通过id删除") | ||
140 | @ApiOperation(value="人员证书管理-通过id删除", notes="人员证书管理-通过id删除") | ||
141 | @DeleteMapping(value = "/delete") | ||
142 | public Result<?> delete(@RequestParam(name="id",required=true) String id) { | ||
143 | try { | ||
144 | sysFactoryUserDataService.removeById(id); | ||
145 | } catch (Exception e) { | ||
146 | log.error("删除失败",e.getMessage()); | ||
147 | return Result.error("删除失败!"); | ||
148 | } | ||
149 | return Result.ok("删除成功!"); | ||
150 | } | ||
151 | |||
152 | /** | ||
153 | * <pre> | ||
154 | * 批量删除 | ||
155 | * </pre> | ||
156 | * @param ids | ||
157 | * @return | ||
158 | * @author 开发者姓名, 开发时间 | ||
159 | * @Description: TODO(这里描述这个方法的需求变更情况) | ||
160 | */ | ||
161 | @AutoLog(value = "人员证书管理-批量删除") | ||
162 | @ApiOperation(value="人员证书管理-批量删除", notes="人员证书管理-批量删除") | ||
163 | @DeleteMapping(value = "/deleteBatch") | ||
164 | public Result<SysFactoryUserData> deleteBatch(@RequestParam(name="ids",required=true) String ids) { | ||
165 | Result<SysFactoryUserData> result = new Result<SysFactoryUserData>(); | ||
166 | if(ids==null || "".equals(ids.trim())) { | ||
167 | result.error500("参数不识别!"); | ||
168 | }else { | ||
169 | this.sysFactoryUserDataService.removeByIds(Arrays.asList(ids.split(","))); | ||
170 | result.success("删除成功!"); | ||
171 | } | ||
172 | return result; | ||
173 | } | ||
174 | /** | ||
175 | * <pre> | ||
176 | * 通过id查询 | ||
177 | * </pre> | ||
178 | * @param id | ||
179 | * @return | ||
180 | * @author 开发者姓名, 开发时间 | ||
181 | * @Description: TODO(这里描述这个方法的需求变更情况) | ||
182 | */ | ||
183 | @AutoLog(value = "人员证书管理-通过id查询") | ||
184 | @ApiOperation(value="人员证书管理-通过id查询", notes="人员证书管理-通过id查询") | ||
185 | @GetMapping(value = "/queryById") | ||
186 | public Result<SysFactoryUserData> queryById(@RequestParam(name="id",required=true) String id) { | ||
187 | Result<SysFactoryUserData> result = new Result<SysFactoryUserData>(); | ||
188 | SysFactoryUserData sysFactoryUserData = sysFactoryUserDataService.getById(id); | ||
189 | if(sysFactoryUserData==null) { | ||
190 | result.error500("未找到对应实体"); | ||
191 | }else { | ||
192 | result.setResult(sysFactoryUserData); | ||
193 | result.setSuccess(true); | ||
194 | } | ||
195 | return result; | ||
196 | } | ||
197 | |||
198 | /** | ||
199 | * <pre> | ||
200 | * 导出excel | ||
201 | * </pre> | ||
202 | * @param request | ||
203 | * @param response | ||
204 | * @return | ||
205 | * @author 开发者姓名, 开发时间 | ||
206 | * @Description: TODO(这里描述这个方法的需求变更情况) | ||
207 | */ | ||
208 | |||
209 | @RequestMapping(value = "/exportXls") | ||
210 | public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) { | ||
211 | // Step.1 组装查询条件 | ||
212 | QueryWrapper<SysFactoryUserData> queryWrapper = null; | ||
213 | try { | ||
214 | String paramsStr = request.getParameter("paramsStr"); | ||
215 | if (ConvertUtils.isNotEmpty(paramsStr)) { | ||
216 | String deString = URLDecoder.decode(paramsStr, "UTF-8"); | ||
217 | SysFactoryUserData sysFactoryUserData = JSON.parseObject(deString, SysFactoryUserData.class); | ||
218 | queryWrapper = QueryGenerator.initQueryWrapper(sysFactoryUserData, request.getParameterMap()); | ||
219 | } | ||
220 | } catch (UnsupportedEncodingException e) { | ||
221 | e.printStackTrace(); | ||
222 | } | ||
223 | |||
224 | //Step.2 AutoPoi 导出Excel | ||
225 | ModelAndView mv = new ModelAndView(new JeecgEntityExcelView()); | ||
226 | List<SysFactoryUserData> pageList = sysFactoryUserDataService.list(queryWrapper); | ||
227 | //导出文件名称 | ||
228 | mv.addObject(NormalExcelConstants.FILE_NAME, "人员证书管理列表"); | ||
229 | mv.addObject(NormalExcelConstants.CLASS, SysFactoryUserData.class); | ||
230 | mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("人员证书管理列表数据", "导出人:Jeecg", "导出信息")); | ||
231 | mv.addObject(NormalExcelConstants.DATA_LIST, pageList); | ||
232 | return mv; | ||
233 | } | ||
234 | |||
235 | /** | ||
236 | * <pre> | ||
237 | * 通过excel导入数据 | ||
238 | * </pre> | ||
239 | * @param request | ||
240 | * @param response | ||
241 | * @return | ||
242 | * @author 开发者姓名, 开发时间 | ||
243 | * @Description: TODO(这里描述这个方法的需求变更情况) | ||
244 | */ | ||
245 | @RequestMapping(value = "/importExcel", method = RequestMethod.POST) | ||
246 | public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { | ||
247 | MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; | ||
248 | Map<String, MultipartFile> fileMap = multipartRequest.getFileMap(); | ||
249 | for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) { | ||
250 | MultipartFile file = entity.getValue();// 获取上传文件对象 | ||
251 | ImportParams params = new ImportParams(); | ||
252 | params.setTitleRows(2); | ||
253 | params.setHeadRows(1); | ||
254 | params.setNeedSave(true); | ||
255 | try { | ||
256 | List<SysFactoryUserData> listSysFactoryUserDatas = ExcelImportUtil.importExcel(file.getInputStream(), SysFactoryUserData.class, params); | ||
257 | sysFactoryUserDataService.saveBatch(listSysFactoryUserDatas); | ||
258 | return Result.ok("文件导入成功!数据行数:" + listSysFactoryUserDatas.size()); | ||
259 | } catch (Exception e) { | ||
260 | log.error(e.getMessage(),e); | ||
261 | return Result.error("文件导入失败:"+e.getMessage()); | ||
262 | } finally { | ||
263 | try { | ||
264 | file.getInputStream().close(); | ||
265 | } catch (IOException e) { | ||
266 | e.printStackTrace(); | ||
267 | } | ||
268 | } | ||
269 | } | ||
270 | return Result.ok("文件导入失败!"); | ||
271 | } | ||
272 | |||
273 | } |
1 | package com.skua.modules.system.entity; | ||
2 | |||
3 | import java.util.Date; | ||
4 | import com.baomidou.mybatisplus.annotation.IdType; | ||
5 | import com.baomidou.mybatisplus.annotation.TableId; | ||
6 | import com.baomidou.mybatisplus.annotation.TableName; | ||
7 | import com.skua.core.aspect.annotation.Dict; | ||
8 | import io.swagger.annotations.ApiModel; | ||
9 | import io.swagger.annotations.ApiModelProperty; | ||
10 | import lombok.Data; | ||
11 | import lombok.EqualsAndHashCode; | ||
12 | import lombok.experimental.Accessors; | ||
13 | import com.fasterxml.jackson.annotation.JsonFormat; | ||
14 | import org.springframework.format.annotation.DateTimeFormat; | ||
15 | import org.jeecgframework.poi.excel.annotation.Excel; | ||
16 | |||
17 | /** | ||
18 | * 人员证书管理 | ||
19 | */ | ||
20 | @Data | ||
21 | @TableName("sys_factory_user_data") | ||
22 | @EqualsAndHashCode(callSuper = false) | ||
23 | @Accessors(chain = true) | ||
24 | @ApiModel(value="sys_factory_user_data对象", description="人员证书管理") | ||
25 | public class SysFactoryUserData { | ||
26 | |||
27 | /**主键*/ | ||
28 | @TableId(type = IdType.ID_WORKER_STR) | ||
29 | @ApiModelProperty(value = "主键") | ||
30 | private String id; | ||
31 | /**成员ID*/ | ||
32 | @Excel(name = "成员ID", width = 15) | ||
33 | @ApiModelProperty(value = "成员ID") | ||
34 | @Dict(dicCode = "id",dictTable = "sys_user",dicText = "realname") | ||
35 | private String userId; | ||
36 | /**证件名称*/ | ||
37 | @Excel(name = "证件名称", width = 15) | ||
38 | @ApiModelProperty(value = "证件名称") | ||
39 | private String certifiesName; | ||
40 | /**证件类型*/ | ||
41 | @Excel(name = "证件类型", width = 15) | ||
42 | @ApiModelProperty(value = "证件类型") | ||
43 | @Dict(dicCode = "epiboly_certificate_type") | ||
44 | private String certifiesType; | ||
45 | /**附件*/ | ||
46 | @Excel(name = "附件", width = 15) | ||
47 | @ApiModelProperty(value = "附件") | ||
48 | private String certifiesFile; | ||
49 | /**到期时间*/ | ||
50 | @Excel(name = "到期时间", width = 15) | ||
51 | @ApiModelProperty(value = "到期时间") | ||
52 | private String endTime; | ||
53 | /**备注*/ | ||
54 | @Excel(name = "备注", width = 15) | ||
55 | @ApiModelProperty(value = "备注") | ||
56 | private String remark; | ||
57 | /**上传人*/ | ||
58 | @Excel(name = "上传人", width = 15) | ||
59 | @ApiModelProperty(value = "上传人") | ||
60 | private String createBy; | ||
61 | /**上传时间*/ | ||
62 | @Excel(name = "上传时间", width = 20, format = "yyyy-MM-dd HH:mm:ss") | ||
63 | @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") | ||
64 | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") | ||
65 | @ApiModelProperty(value = "上传时间") | ||
66 | private Date createTime; | ||
67 | /**更新人*/ | ||
68 | @Excel(name = "更新人", width = 15) | ||
69 | @ApiModelProperty(value = "更新人") | ||
70 | private String updateBy; | ||
71 | /**更新时间*/ | ||
72 | @Excel(name = "更新时间", width = 20, format = "yyyy-MM-dd HH:mm:ss") | ||
73 | @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") | ||
74 | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") | ||
75 | @ApiModelProperty(value = "更新时间") | ||
76 | private Date updateTime; | ||
77 | /**厂站ID*/ | ||
78 | @Excel(name = "厂站ID", width = 15) | ||
79 | @ApiModelProperty(value = "厂站ID") | ||
80 | private String createDept; | ||
81 | /**delFlag*/ | ||
82 | @Excel(name = "delFlag", width = 15) | ||
83 | @ApiModelProperty(value = "delFlag") | ||
84 | private Integer delFlag; | ||
85 | } |
sk-module-system/src/main/java/com/skua/modules/system/mapper/SysFactoryUserDataMapper.java
0 → 100644
1 | package com.skua.modules.system.mapper; | ||
2 | |||
3 | import java.util.List; | ||
4 | |||
5 | import org.apache.ibatis.annotations.Param; | ||
6 | import com.skua.modules.system.entity.SysFactoryUserData; | ||
7 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||
8 | |||
9 | /** | ||
10 | * 人员证书管理 | ||
11 | */ | ||
12 | public interface SysFactoryUserDataMapper extends BaseMapper<SysFactoryUserData> { | ||
13 | |||
14 | } |
sk-module-system/src/main/java/com/skua/modules/system/mapper/xml/SysFactoryUserDataMapper.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.system.mapper.SysFactoryUserDataMapper"> | ||
4 | |||
5 | </mapper> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | package com.skua.modules.system.service.impl; | ||
2 | |||
3 | import com.skua.modules.system.entity.SysFactoryUserData; | ||
4 | import com.skua.modules.system.mapper.SysFactoryUserDataMapper; | ||
5 | import com.skua.modules.system.service.ISysFactoryUserDataService; | ||
6 | import org.springframework.stereotype.Service; | ||
7 | |||
8 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||
9 | |||
10 | /** | ||
11 | * 人员证书管理 | ||
12 | */ | ||
13 | @Service | ||
14 | public class SysFactoryUserDataServiceImpl extends ServiceImpl<SysFactoryUserDataMapper, SysFactoryUserData> implements ISysFactoryUserDataService { | ||
15 | |||
16 | } |
-
请 注册 或 登录 后发表评论