[修改] 报告名称不能重复问题
This commit is contained in:
@@ -116,6 +116,28 @@ public class ReportManageConroller {
|
|||||||
return Result.success(map);
|
return Result.success(map);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断报告名称是否被占用
|
||||||
|
* @param vo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation("判断报告名称是否被占用")
|
||||||
|
@PostMapping("/isReportNameOccupy")
|
||||||
|
@ReportLog(description = "新增或编辑")
|
||||||
|
public ResponseMessage isReportNameOccupy(@RequestBody ReportVo vo) throws IOException {
|
||||||
|
|
||||||
|
long count = reportDao.isReportNameOccupyByEO(vo);
|
||||||
|
if (count > 0){
|
||||||
|
return Result.error("报告名称已存在");
|
||||||
|
}
|
||||||
|
long count1 = reportDao.isReportNameOccupyByAct(vo);
|
||||||
|
if (count1 > 0){
|
||||||
|
return Result.error("报告名称已流程中存在");
|
||||||
|
}
|
||||||
|
|
||||||
|
return Result.success();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 报告详情接口
|
* 报告详情接口
|
||||||
* @param reportId
|
* @param reportId
|
||||||
|
|||||||
@@ -62,6 +62,10 @@ public interface ReportDao extends BaseMapper<ReportEntity> {
|
|||||||
|
|
||||||
long selectByidAndName(@Param("Vo")ReportEntity entity);
|
long selectByidAndName(@Param("Vo")ReportEntity entity);
|
||||||
|
|
||||||
|
long isReportNameOccupyByEO(@Param("Vo")ReportVo Vo);
|
||||||
|
|
||||||
|
long isReportNameOccupyByAct(ReportVo vo);
|
||||||
|
|
||||||
void saveReportAct(@Param("Vo") TtReportManageAct ttReportManageAct);
|
void saveReportAct(@Param("Vo") TtReportManageAct ttReportManageAct);
|
||||||
|
|
||||||
ReportDetailVo reportDetail(@Param("reportId") String reportId);
|
ReportDetailVo reportDetail(@Param("reportId") String reportId);
|
||||||
@@ -72,4 +76,5 @@ public interface ReportDao extends BaseMapper<ReportEntity> {
|
|||||||
*/
|
*/
|
||||||
List<ReportEntity> selectDDL();
|
List<ReportEntity> selectDDL();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -623,21 +623,6 @@ public class IReportServiceImpl extends ServiceImpl<ReportDao, ReportEntity>
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> isAct(ReportQueryVo vo) {
|
public List<String> isAct(ReportQueryVo vo) {
|
||||||
boolean flag = false;
|
|
||||||
//判断是不是管理员
|
|
||||||
boolean admin = false;
|
|
||||||
List<RoleEO> roleEOList = roleEODao.selectByuserId(UserUtils.getUserId());
|
|
||||||
for (RoleEO roleEO : roleEOList) {
|
|
||||||
if ("管理员".equals(roleEO.getName())){
|
|
||||||
admin= !admin;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (admin) {
|
|
||||||
vo.setUsid(null);
|
|
||||||
} else {
|
|
||||||
vo.setUsid(UserUtils.getUserId());
|
|
||||||
}
|
|
||||||
|
|
||||||
List<String> act = baseMapper.isAct(vo);
|
List<String> act = baseMapper.isAct(vo);
|
||||||
return act;
|
return act;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -250,7 +250,29 @@
|
|||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
<select id="isReportNameOccupyByEO" resultType="java.lang.Long">
|
||||||
|
select count(1) from tt_report_manage rep
|
||||||
|
<where>
|
||||||
|
rep.Name = #{Vo.name}
|
||||||
|
and rep.del_flag = 0
|
||||||
|
<if test="Vo.id != null and Vo.id != ''">
|
||||||
|
and rep.id != #{Vo.id}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
<select id="isReportNameOccupyByAct" resultType="java.lang.Long">
|
||||||
|
select count(1) from tt_report_manage_act rep
|
||||||
|
LEFT JOIN bus_process_name pro on rep.prc_id=pro.PRC_ID
|
||||||
|
<where>
|
||||||
|
pro.SUBMIT_STATUS = 1
|
||||||
|
and rep.Name = #{Vo.name}
|
||||||
|
and rep.del_flag = 0
|
||||||
|
<if test="Vo.id != null and Vo.id != ''">
|
||||||
|
and rep.report_id != #{Vo.id}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
|
||||||
|
</select>
|
||||||
|
|
||||||
<select id="reportDetail" resultType="com.adc.da.report.vo.ReportDetailVo">
|
<select id="reportDetail" resultType="com.adc.da.report.vo.ReportDetailVo">
|
||||||
SELECT
|
SELECT
|
||||||
|
|||||||
Binary file not shown.
BIN
Binary file not shown.
Reference in New Issue
Block a user