1af745c7 张雷

安环资料管理接口开发

1 个父辈 336744f7
......@@ -82,6 +82,7 @@ public class AjhMeetingSendController {
HttpServletRequest req) {
Result<IPage<AjhMeetingSend>> result = new Result<IPage<AjhMeetingSend>>();
QueryWrapper<AjhMeetingSend> queryWrapper = new QueryWrapper<>();
queryWrapper.eq(ConvertUtils.isNotEmpty(ajhMeetingSend.getMeetId()),"meet_id",ajhMeetingSend.getMeetId());
queryWrapper.eq(ConvertUtils.isNotEmpty(ajhMeetingSend.getDepartId()),"depart_id",ajhMeetingSend.getDepartId());
queryWrapper.eq(ConvertUtils.isNotEmpty(ajhMeetingSend.getMeetStatus()),"meet_status",ajhMeetingSend.getMeetStatus());
queryWrapper.eq(ConvertUtils.isNotEmpty(ajhMeetingSend.getSendStatus()),"send_status",ajhMeetingSend.getSendStatus());
......@@ -101,6 +102,7 @@ public class AjhMeetingSendController {
public Result<Map<String,Object>> queryCount(AjhMeetingSend ajhMeetingSend) {
Result<Map<String,Object>> result = new Result<Map<String,Object>>();
QueryWrapper<AjhMeetingSend> queryWrapper = new QueryWrapper<>();
queryWrapper.eq(ConvertUtils.isNotEmpty(ajhMeetingSend.getMeetId()),"meet_id",ajhMeetingSend.getMeetId());
queryWrapper.eq(ConvertUtils.isNotEmpty(ajhMeetingSend.getDepartId()),"depart_id",ajhMeetingSend.getDepartId());
queryWrapper.eq(ConvertUtils.isNotEmpty(ajhMeetingSend.getMeetStatus()),"meet_status",ajhMeetingSend.getMeetStatus());
queryWrapper.eq(ConvertUtils.isNotEmpty(ajhMeetingSend.getSendStatus()),"send_status",ajhMeetingSend.getSendStatus());
......
......@@ -123,4 +123,12 @@ public class AjhMeeting {
@TableField(exist = false)
@ApiModelProperty(value = "机构名称")
private java.lang.String departName;
/**执行情况*/
@TableField(exist = false)
@ApiModelProperty(value = "执行情况")
private java.lang.String executionStatus;
/**参与人数*/
@TableField(exist = false)
@ApiModelProperty(value = "参与人数")
private java.lang.String particNum;
}
......
......@@ -19,25 +19,29 @@
</select>
<select id="queryPageList" resultType="com.skua.modules.ajh.entity.AjhMeeting">
SELECT
*
CONCAT(s1.num,'/',s2.num) execution_status,
ifnull(a.num,0) as partic_num,
m.*
FROM
ajh_meeting
WHERE
1 = 1
ajh_meeting m
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
left join (select meet_id,count(id) num from ajh_meeting_send GROUP BY meet_id) s2 on s2.meet_id = m.id
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
WHERE 1 = 1
<if test="ajhMeeting.departId !=null and ajhMeeting.departId!=''">
AND depart_id = #{ajhMeeting.departId}
AND m.depart_id = #{ajhMeeting.departId}
</if>
<if test="ajhMeeting.sendStatus !=null and ajhMeeting.sendStatus!=''">
AND send_status = #{ajhMeeting.sendStatus}
AND m.send_status = #{ajhMeeting.sendStatus}
</if>
<if test="ajhMeeting.meetTitile !=null and ajhMeeting.meetTitile!=''">
AND meet_titile LIKE CONCAT(CONCAT('%', #{ajhMeeting.meetTitile}),'%')
AND m.meet_titile LIKE CONCAT(CONCAT('%', #{ajhMeeting.meetTitile}),'%')
</if>
<if test="ajhMeeting.startTime !=null and ajhMeeting.endTime!=''">
AND start_time between #{ajhMeeting.startTime} and #{ajhMeeting.endTime}
AND m.start_time between #{ajhMeeting.startTime} and #{ajhMeeting.endTime}
</if>
<if test="ajhMeeting.meetCategory !=null and ajhMeeting.meetCategory!=''">
AND meet_category = #{ajhMeeting.meetCategory}
AND m.meet_category = #{ajhMeeting.meetCategory}
</if>
</select>
......
......@@ -21,10 +21,12 @@
s.meet_qd_qrcode,
s.meet_title,
s.meet_location,
s.meet_content
s.meet_content,
m.meet_category
FROM
ajh_meeting_receipt r
LEFT JOIN ajh_meeting_send s ON s.id = r.meets_id
LEFT JOIN ajh_meeting m ON m.id = s.meet_id
LEFT JOIN ( SELECT * FROM sys_dict_item WHERE dict_id =
( SELECT id FROM sys_dict WHERE dict_code = 'attend_status' ) ) d ON d.item_value = r.status
WHERE
......@@ -38,6 +40,9 @@
<if test="ajhMeetingReceiptVO.meetsId!=null">
and r.meets_id = #{ajhMeetingReceiptVO.meetsId}
</if>
<if test="ajhMeetingReceiptVO.meetCategory!=null">
and m.meet_category = #{ajhMeetingReceiptVO.meetCategory}
</if>
</select>
</mapper>
......
......@@ -65,4 +65,7 @@ public class AjhMeetingReceiptVO {
/**会议内容*/
@ApiModelProperty(value = "会议内容")
private String meetContent;
/**会议类型*/
@ApiModelProperty(value = "会议类型")
private String meetCategory;
}
......
......@@ -37,6 +37,7 @@ import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
......@@ -90,22 +91,21 @@ public class MaterialInfoController {
/**
* 添加
*
* @param MaterialInfo
* @param materialInfo
* @return
*/
@AutoLog(value = "厂区资料管理-添加")
@ApiOperation(value = "厂区资料管理-添加", notes = "厂区资料管理-添加")
@PostMapping(value = "/add")
public Result<MaterialInfo> add(@RequestBody MaterialInfo MaterialInfo) {
public Result<MaterialInfo> add(@RequestBody MaterialInfo materialInfo) {
Result<MaterialInfo> result = new Result<MaterialInfo>();
try {
if (StringUtils.isBlank(MaterialInfo.getDepartId())) {
if (StringUtils.isBlank(materialInfo.getDepartId())) {
String userCode = BaseContextHandler.getUserId();
//根据用户id查询所属厂区 只要第一个
MaterialInfo.setDepartId(materialInfoService.queryFacByUserId(userCode));
materialInfo.setDepartId(materialInfoService.queryFacByUserId(userCode));
}
materialInfoService.save(MaterialInfo);
materialInfoService.save(materialInfo);
result.success("添加成功!");
} catch (Exception e) {
log.error(e.getMessage(), e);
......@@ -116,21 +116,19 @@ public class MaterialInfoController {
/**
* 编辑
*
* @param MaterialInfo
* @param materialInfo
* @return
*/
@AutoLog(value = "厂区资料管理-编辑")
@ApiOperation(value = "厂区资料管理-编辑", notes = "厂区资料管理-编辑")
@PutMapping(value = "/edit")
public Result<MaterialInfo> edit(@RequestBody MaterialInfo MaterialInfo) {
public Result<MaterialInfo> edit(@RequestBody MaterialInfo materialInfo) {
Result<MaterialInfo> result = new Result<MaterialInfo>();
MaterialInfo MaterialInfoEntity = materialInfoService.getById(MaterialInfo.getId());
MaterialInfo MaterialInfoEntity = materialInfoService.getById(materialInfo.getId());
if (MaterialInfoEntity == null) {
result.error500("未找到对应实体");
} else {
boolean ok = materialInfoService.updateById(MaterialInfo);
//TODO 返回false说明什么?
boolean ok = materialInfoService.updateById(materialInfo);
if (ok) {
result.success("修改成功!");
}
......@@ -145,7 +143,6 @@ public class MaterialInfoController {
* </pre>
* @return
* @author Li Yuanyuan, 2022年6月22日 下午2:15:57
* @Description: TODO(这里描述这个方法的需求变更情况)
*/
@AutoLog(value = "厂区资料管理-更新浏览量/下载量")
@ApiOperation(value = "厂区资料管理-更新浏览量/下载量", notes = "厂区资料管理-更新浏览量/下载量")
......@@ -318,14 +315,14 @@ public class MaterialInfoController {
@AutoLog(value = "厂区资料管理-流量统计")
@ApiOperation(value = "厂区资料管理-流量统计", notes = "厂区资料管理-流量统计")
@GetMapping(value = "/flowStatistics")
public Result<List<Map<String, Object>>> flowStatistics(String departId,String startTime,String endTime) {
public Result<List<Map<String, Object>>> flowStatistics(String departId,String startTime,String endTime,String facInformationtype) {
Result<List<Map<String, Object>>> result = new Result<>();
if (StringUtils.isBlank(departId)&&StringUtils.isNotBlank(BaseContextHandler.getDeparts())) {
departId = departService.getChildDepartId(BaseContextHandler.getDeparts());
}else{
departId = departService.getChildDepartId(departId);
}
List<Map<String, Object>> pageList = materialInfoService.flowStatistics(departId,startTime,endTime);
List<Map<String, Object>> pageList = materialInfoService.flowStatistics(departId,startTime,endTime,facInformationtype);
result.setSuccess(true);
result.setResult(pageList);
return result;
......
......@@ -36,7 +36,7 @@ public class MaterialInfo {
/**厂区资料文件名类型*/
@Excel(name = "厂区资料文件名类型", width = 15)
@ApiModelProperty(value = "厂区资料文件名类型")
@Dict(dicCode = "info_type")
@Dict(dicCode = "fac_information_type")
private String facInformationtype;
/**删除状态(0,正常,1已删除)*/
@Excel(name = "删除状态(0,正常,1已删除)", width = 15)
......@@ -85,6 +85,22 @@ public class MaterialInfo {
@Dict(dicCode = "rules_type")
@ApiModelProperty(value = "制度类型")
private String rulesType;
/**法律法规类型*/
@Dict(dicCode = "laws_type")
@ApiModelProperty(value = "法律法规类型")
private String lawsType;
/**法律法规归属*/
@Dict(dicCode = "laws_source")
@ApiModelProperty(value = "法律法规归属")
private String lawsSource;
/**标准规范类型*/
@Dict(dicCode = "standards_type")
@ApiModelProperty(value = "标准规范类型")
private String standardsType;
/**标准规范来源*/
@Dict(dicCode = "standards_source")
@ApiModelProperty(value = "标准规范来源")
private String standardsSource;
/**发布时间*/
@Excel(name = "发布时间", width = 15)
@ApiModelProperty(value = "发布时间")
......
......@@ -15,7 +15,7 @@ public interface MaterialInfoMapper extends BaseMapper<MaterialInfo> {
String queryFacByUserId(@Param("userCode") String userCode);
List<Map<String, Object>> getAnalysis(@Param("facInfo") MaterialInfo facInfo);
List<Map<String, Object>> getAnalysis(@Param("dictCode") String dictCode);
/**
* <pre>
* 流量统计
......@@ -27,7 +27,7 @@ public interface MaterialInfoMapper extends BaseMapper<MaterialInfo> {
* @author Li Yuanyuan, 2022年6月22日 下午3:10:31
* @Description: TODO(这里描述这个方法的需求变更情况)
*/
List<Map<String, Object>> flowStatistics(String departId, String startTime, String endTime);
List<Map<String, Object>> flowStatistics(String departId, String startTime, String endTime, String facInformationtype);
List<MaterialInfo> getList(@Param("materialInfo") MaterialInfo materialInfo, @Param("departIds") String departIds);
}
......
......@@ -14,24 +14,12 @@
<select id="getAnalysis" resultType="java.util.Map">
SELECT
b.item_value id,
ifnull(a.cou,0) count,
0 count,
b.item_text NAME
FROM
( SELECT item_text, item_value FROM sys_dict_item
WHERE dict_id = ( SELECT id FROM sys_dict WHERE dict_code = 'info_type' )
WHERE dict_id = ( SELECT id FROM sys_dict WHERE dict_code = #{dictCode} )
) b
left join
( SELECT fac_informationtype, count( 1 ) cou FROM material_info
<if test="facInfo.departId!=null and facInfo.departId!=''">
where depart_id in
<foreach item="item" index="index" collection="facInfo.departId.split(',')" open="(" separator="," close=")">
'${item}'
</foreach>
</if>
GROUP BY fac_informationtype
) a
ON a.fac_informationtype = b.item_value
</select>
<select id="flowStatistics" resultType="java.util.Map">
SELECT
......@@ -43,13 +31,16 @@
INNER JOIN material_info_handle_record b ON a.id = b.info_id
WHERE
b.create_time &gt;= #{startTime}
AND b.create_time &lt;= #{endTime}
<if test="departId!=null and departId!=''">
and a.depart_id in
<foreach item="item" index="index" collection="departId.split(',')" open="(" separator="," close=")">
'${item}'
</foreach>
</if>
AND b.create_time &lt;= #{endTime}
<if test="departId!=null and departId!=''">
and a.depart_id in
<foreach item="item" index="index" collection="departId.split(',')" open="(" separator="," close=")">
'${item}'
</foreach>
</if>
<if test="facInformationtype!=null and facInformationtype!=''">
AND a.fac_informationtype = #{facInformationtype}
</if>
GROUP BY
b.create_time,b.handle_type
</select>
......
......@@ -41,7 +41,7 @@ public interface IMaterialInfoService extends IService<MaterialInfo> {
* @author Li Yuanyuan, 2022年6月22日 下午3:00:25
* @Description: TODO(这里描述这个方法的需求变更情况)
*/
List<Map<String, Object>> flowStatistics(String departId, String startTime, String endTime);
List<Map<String, Object>> flowStatistics(String departId, String startTime, String endTime,String facInformationtype);
IPage<MaterialInfo> getList(Page<MaterialInfo> page, MaterialInfo materialInfo, String departIds);
}
......
......@@ -24,7 +24,33 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
@Override
public List<Map<String, Object>> getAnalysis(MaterialInfo facInfo) {
return baseMapper.getAnalysis(facInfo);
List<Map<String, Object>> tList = new ArrayList<>();
String departIds = facInfo.getDepartId();
List<MaterialInfo> list = baseMapper.getList(facInfo, departIds);
Map<String, Object> totalMap = new HashMap<>();
totalMap.put("total",list.size());
tList.add(totalMap);
String dictCode = "rules_type";//标准规范:bzgf 法律法规:flfg 公司制度章程:gzzd
if("gzzd".equals(facInfo.getFacInformationtype())){
dictCode = "rules_type";
}else if("bzgf".equals(facInfo.getFacInformationtype())){
dictCode = "standards_type";
}else if("flfg".equals(facInfo.getFacInformationtype())){
dictCode = "laws_type";
}
List<Map<String, Object>> typeList = baseMapper.getAnalysis(dictCode);
for (Map<String, Object> map : typeList) {
String type = map.get("id").toString();
int count = 0;
for(MaterialInfo materialInfo: list){
if(materialInfo.getRulesType().contains(type)){
count++;
}
}
map.put("count",count);
tList.add(map);
}
return tList;
}
@Override
......@@ -33,12 +59,12 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
}
@Override
public List<Map<String, Object>> flowStatistics(String departId, String startTime, String endTime) {
public List<Map<String, Object>> flowStatistics(String departId, String startTime, String endTime, String facInformationtype) {
//日期切片
List<Map<String,Object>> resultList = new ArrayList<Map<String,Object>>();
List<String> timeList = DateUtils.sliceUpDateRange(startTime,endTime,"month");
//获取统计结果
List<Map<String,Object>> dataList = baseMapper.flowStatistics(departId,startTime,endTime);
List<Map<String,Object>> dataList = baseMapper.flowStatistics(departId,startTime,endTime,facInformationtype);
Map<String,Map<String,Object>> resultMap = new HashMap<String,Map<String,Object>>();
for(Map<String,Object> map : dataList) {
resultMap.put(ConvertUtils.getString(map.get("create_time"))+"_"+ConvertUtils.getString(map.get("handle_type")), map);
......
......@@ -40,7 +40,7 @@ public class SysFactoryUserData {
/**证件类型*/
@Excel(name = "证件类型", width = 15)
@ApiModelProperty(value = "证件类型")
@Dict(dicCode = "certifies_type")
@Dict(dicCode = "epiboly_certificate_type")
private String certifiesType;
/**附件*/
@Excel(name = "附件", width = 15)
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!