bug修复
This commit is contained in:
parent
0831e48fec
commit
e06fb67d85
@ -1,46 +1,25 @@
|
||||
package com.zhgd.xmgl.modules.baotou.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.zhgd.annotation.OperLog;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import java.util.HashMap;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLDecoder;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import com.zhgd.jeecg.common.api.vo.Result;
|
||||
import com.zhgd.jeecg.common.system.query.QueryGenerator;
|
||||
import com.zhgd.jeecg.common.util.oConvertUtils;
|
||||
import org.apache.commons.collections.MapUtils;
|
||||
import com.zhgd.xmgl.modules.baotou.entity.ProjectHomeNotice;
|
||||
import com.zhgd.xmgl.modules.baotou.service.IProjectHomeNoticeService;
|
||||
|
||||
import org.simpleframework.xml.core.Validate;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||
|
||||
import org.apache.commons.collections.MapUtils;
|
||||
import org.simpleframework.xml.core.Validate;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
@ -60,6 +39,7 @@ public class ProjectHomeNoticeController {
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "首页通知公告管理", operType = "分页查询", operDesc = "分页列表查询首页通知公告信息")
|
||||
@ -75,6 +55,7 @@ public class ProjectHomeNoticeController {
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "首页通知公告管理", operType = "列表查询", operDesc = "列表查询首页通知公告信息")
|
||||
@ -86,6 +67,7 @@ public class ProjectHomeNoticeController {
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param projectHomeNotice
|
||||
* @return
|
||||
*/
|
||||
@ -99,6 +81,7 @@ public class ProjectHomeNoticeController {
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param projectHomeNotice
|
||||
* @return
|
||||
*/
|
||||
@ -112,6 +95,7 @@ public class ProjectHomeNoticeController {
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "首页通知公告管理", operType = "删除", operDesc = "删除首页通知公告信息")
|
||||
@ -125,6 +109,7 @@ public class ProjectHomeNoticeController {
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@ -136,4 +121,13 @@ public class ProjectHomeNoticeController {
|
||||
return Result.success(projectHomeNoticeService.queryById(id));
|
||||
}
|
||||
|
||||
@OperLog(operModul = "首页通知公告管理", operType = "添加", operDesc = "从工作流添加首页通知公告")
|
||||
@ApiOperation(value = "从工作流添加首页通知公告", notes = "从工作流添加首页通知公告", httpMethod = "POST")
|
||||
@PostMapping(value = "/flow/add")
|
||||
public Result addFromFlow(@RequestBody @Validate Map<String, Object> param) {
|
||||
log.info("从工作流添加首页通知公告:{}", JSON.toJSONString(param));
|
||||
projectHomeNoticeService.addFromFlow(param);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -67,6 +67,7 @@ public class ProjectHomeWorkController {
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "pageNo", value = "第几页", paramType = "query", required = true, dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "pageSize", value = "每页显示条数", paramType = "query", required = true, dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "seeI", value = "1项目子账号只看到自己的数据", paramType = "query", required = true, dataType = "Integer"),
|
||||
})
|
||||
@GetMapping(value = "/page")
|
||||
public Result<IPage<ProjectHomeWork>> queryPageList(@ApiIgnore @RequestParam HashMap<String, Object> param) {
|
||||
|
||||
@ -10,6 +10,12 @@
|
||||
<if test="param.projectHomeWorkId == null or param.projectHomeWorkId == ''">
|
||||
and t.project_home_work_id is null
|
||||
</if>
|
||||
<if test="param.projectHomeWorkId == null and param.formNameList != null and param.seeI == '1'.toString() and param.accountType == '6'.toString() ">
|
||||
and
|
||||
<foreach collection="param.formNameList" index="index" item="item" open="(" separator="or" close=")">
|
||||
(t.file_url like concat('%',#{item},'%'))
|
||||
</foreach>
|
||||
</if>
|
||||
)t
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
|
||||
@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: 首页通知公告
|
||||
@ -50,4 +51,5 @@ public interface IProjectHomeNoticeService extends IService<ProjectHomeNotice> {
|
||||
*/
|
||||
ProjectHomeNotice queryById(String id);
|
||||
|
||||
void addFromFlow(Map<String, Object> param);
|
||||
}
|
||||
|
||||
@ -39,8 +39,10 @@ import java.util.stream.Collectors;
|
||||
*/
|
||||
@Service
|
||||
public class DeviceUnitServiceImpl extends ServiceImpl<DeviceUnitMapper, DeviceUnit> implements IDeviceUnitService {
|
||||
@Lazy
|
||||
@Autowired
|
||||
IProjectGroupUnitService projectGroupUnitService;
|
||||
@Lazy
|
||||
@Autowired
|
||||
private DeviceUnitMapper deviceUnitMapper;
|
||||
@Lazy
|
||||
@ -49,6 +51,7 @@ public class DeviceUnitServiceImpl extends ServiceImpl<DeviceUnitMapper, DeviceU
|
||||
@Lazy
|
||||
@Autowired
|
||||
private WorkerInfoServiceImpl workerInfoService;
|
||||
@Lazy
|
||||
@Autowired
|
||||
private EnterpriseInfoServiceImpl enterpriseInfoService;
|
||||
|
||||
|
||||
@ -1,9 +1,11 @@
|
||||
package com.zhgd.xmgl.modules.baotou.service.impl;
|
||||
import java.util.Date;
|
||||
|
||||
import com.zhgd.jeecg.common.execption.OpenAlertException;
|
||||
import com.zhgd.xmgl.modules.baotou.entity.ProjectHomeNotice;
|
||||
import com.zhgd.xmgl.modules.baotou.mapper.ProjectHomeNoticeMapper;
|
||||
import com.zhgd.xmgl.modules.baotou.service.IProjectHomeNoticeService;
|
||||
import com.zhgd.xmgl.util.FlowUtil;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
@ -13,6 +15,8 @@ import com.zhgd.xmgl.util.PageUtil;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.zhgd.xmgl.util.RefUtil;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -85,4 +89,15 @@ public class ProjectHomeNoticeServiceImpl extends ServiceImpl<ProjectHomeNoticeM
|
||||
return entity;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addFromFlow(Map<String, Object> param) {
|
||||
ProjectHomeNotice e = new ProjectHomeNotice();
|
||||
e.setProjectSn(FlowUtil.getString(param,"projectSn"));
|
||||
e.setWhichModule(FlowUtil.getInteger(param,"whichModule"));
|
||||
e.setTitle(FlowUtil.getString(param,"title"));
|
||||
e.setContent(FlowUtil.getString(param,"content"));
|
||||
e.setFileUrl(FlowUtil.getString(param,"fileUrl"));
|
||||
baseMapper.insert(e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -6,19 +6,27 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.wflow.bean.vo.ModelGroupVo;
|
||||
import com.wflow.service.ModelGroupService;
|
||||
import com.wflow.utils.UserUtil;
|
||||
import com.zhgd.jeecg.common.execption.OpenAlertException;
|
||||
import com.zhgd.jeecg.common.system.query.QueryGenerator;
|
||||
import com.zhgd.xmgl.modules.baotou.entity.ProjectHomeWork;
|
||||
import com.zhgd.xmgl.modules.baotou.mapper.ProjectHomeWorkMapper;
|
||||
import com.zhgd.xmgl.modules.baotou.service.IProjectHomeWorkService;
|
||||
import com.zhgd.xmgl.security.util.SecurityUtils;
|
||||
import com.zhgd.xmgl.util.PageUtil;
|
||||
import com.zhgd.xmgl.util.RefUtil;
|
||||
import org.apache.commons.collections.MapUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Description: 首页办事指南
|
||||
@ -31,6 +39,9 @@ import java.util.List;
|
||||
public class ProjectHomeWorkServiceImpl extends ServiceImpl<ProjectHomeWorkMapper, ProjectHomeWork> implements IProjectHomeWorkService {
|
||||
@Autowired
|
||||
private ProjectHomeWorkMapper projectHomeWorkMapper;
|
||||
@Lazy
|
||||
@Autowired
|
||||
private ModelGroupService modelGroupService;
|
||||
|
||||
@Override
|
||||
public IPage<ProjectHomeWork> queryPageList(HashMap<String, Object> param) {
|
||||
@ -49,6 +60,16 @@ public class ProjectHomeWorkServiceImpl extends ServiceImpl<ProjectHomeWorkMappe
|
||||
|
||||
private QueryWrapper<ProjectHomeWork> getQueryWrapper(HashMap<String, Object> param) {
|
||||
QueryWrapper<ProjectHomeWork> queryWrapper = QueryGenerator.initPageQueryWrapper(ProjectHomeWork.class, param, true);
|
||||
Integer seeI = MapUtils.getInteger(param, "seeI");
|
||||
if (Objects.equals(seeI, 1)) {
|
||||
Integer accountType = SecurityUtils.getUser().getAccountType();
|
||||
param.put("accountType", accountType);
|
||||
if (accountType == 6) {
|
||||
List<ModelGroupVo> groupModels = modelGroupService.getGroupModels(UserUtil.getLoginUserId(), null);
|
||||
List<String> formNameList = groupModels.stream().flatMap(o -> o.getItems().stream()).map(o -> o.getFormName()).collect(Collectors.toList());
|
||||
param.put("formNameList", formNameList);
|
||||
}
|
||||
}
|
||||
queryWrapper.orderByAsc(RefUtil.fieldNameUlc(ProjectHomeWork::getSort));
|
||||
return queryWrapper;
|
||||
}
|
||||
|
||||
@ -52,10 +52,13 @@ public class NoticeServiceImpl extends ServiceImpl<NoticeMapper, Notice> impleme
|
||||
@Lazy
|
||||
@Autowired
|
||||
SystemUserServiceImpl systemUserService;
|
||||
@Lazy
|
||||
@Autowired
|
||||
private NoticeMapper noticeMapper;
|
||||
@Lazy
|
||||
@Autowired
|
||||
private IMqttSender mqttPushClient;
|
||||
@Lazy
|
||||
@Autowired
|
||||
private SystemUserMapper systemUserMapper;
|
||||
@Value("${mqtt-scope}")
|
||||
@ -63,6 +66,7 @@ public class NoticeServiceImpl extends ServiceImpl<NoticeMapper, Notice> impleme
|
||||
@Lazy
|
||||
@Autowired
|
||||
private UniPushService uniPushService;
|
||||
@Lazy
|
||||
@Autowired
|
||||
private IDeviceUnitService deviceUnitService;
|
||||
|
||||
|
||||
@ -80,6 +80,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
|
||||
|
||||
http.authorizeRequests()
|
||||
//请求路径允许访问
|
||||
.antMatchers("/xmgl/projectHomeNotice/flow/add").permitAll()
|
||||
.antMatchers("/xmgl/promotionalVideo/flow/add").permitAll()
|
||||
.antMatchers("/xmgl/partyBuildingGuidance/flow/add").permitAll()
|
||||
.antMatchers("/xmgl/projectEnterprise/flow/check/param").permitAll()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user