Commit 35a7ff23 by 龙于生

修复审批移除bug

parent f15558f5
......@@ -411,13 +411,15 @@ public class CmsController {
qyxxQueryDto.getCurrentPage() == null ? 1 : qyxxQueryDto.getCurrentPage(),
qyxxQueryDto.getTotalPage() == null ? 10 : qyxxQueryDto.getTotalPage());
Integer userType = userBean.getQyzxEmpLogin().getUserType();
QueryWrapper<CmsContent> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("organization_id", userBean.getOrgCode())
.eq("modularid", 7).eq(r != null && r > -1, "releasestate", r)
.between(!StrUtil.hasBlank(s) && !StrUtil.hasBlank(e), "releasetime",
!StrUtil.hasBlank(s) ? s : "1000-01-01 00:00:00",
!StrUtil.hasBlank(e) ? e : "9999-01-01 00:00:00")
.and(wq -> wq.eq("publisher", userBean.getEmpNum()).or().eq("author", userBean.getUserInfo().getName()).or().inSql("id", "select cms_content_id from cms_content_read where user_id =" + userBean.getEmpNum()))
.and(wq -> wq.eq("publisher", userBean.getEmpNum()).or().eq("author", userBean.getUserInfo().getName())
.or(wp1 -> wp1.eq(userType==2,"releasestate",0).inSql("id", "select cms_content_id from cms_content_read where user_id =" + userBean.getEmpNum())))
.orderByDesc("addeddate");
IPage<CmsContent> cmsContentPage = CmsContent.builder().build().selectPage(page, queryWrapper);
......@@ -785,4 +787,22 @@ public class CmsController {
return ResultUtil.success("删除附件成功");
}
@PostMapping(value = "/addContentReadUsers")
@ApiOperation(value = "addContentReadUsers", httpMethod = "POST", notes = "接口发布说明")
public Result<Object> addContentReadUsers(@CurrentUser UserBean userBean, @RequestBody CmsContentDto cmsContentDto) {
Integer orgCode = userBean.getOrgCode();
Integer empNum = userBean.getEmpNum();
if (!CollectionUtils.isEmpty(cmsContentDto.getCmsContentReads())) {
for (CmsContentRead entity : cmsContentDto.getCmsContentReads()) {
entity.setCmsContentId(cmsContentDto.getId());
entity.setOrgCode(orgCode);
entity.setReadStatus(0);
entity.setDeleteFlag(0);
entity.insert();
}
}
return ResultUtil.success("成功");
}
}
......@@ -802,6 +802,13 @@ public class SpmkController {
// @BindingResultCtrol(title = "审批人审批")
public Result<Object> approving(@CurrentUser UserBean userBean, @Validated @RequestBody ApprovingDto approvingDto) throws Exception {
if (approvingDto.getSts() == 2 && StringUtils.isEmpty(approvingDto.getOpinion())){
approvingDto.setOpinion("同意");
}else if (approvingDto.getSts() == 3 && StringUtils.isEmpty(approvingDto.getOpinion())){
approvingDto.setOpinion("拒绝");
}else if (approvingDto.getSts() == 4 && StringUtils.isEmpty(approvingDto.getOpinion())){
approvingDto.setOpinion("转派");
}
/*判断是否有权限转派*/
if (approvingDto.getSts() == 4) {
......@@ -1540,12 +1547,17 @@ public class SpmkController {
if (spmkApproveDetailDto.getApproveExecuteRecordId()!=null) {
spmkApproveExecuteRecord = SpmkApproveExecuteRecord.builder().id(spmkApproveDetailDto.getApproveExecuteRecordId()).build().selectById();
} else {
spmkApproveExecuteRecord = spmkApproveExecuteRecordMapper.selectExecuteRecordById(Integer.parseInt(currentUser.getId()), spmkApproveDetailSummary.getApproveSummaryId());
List<SpmkApproveExecuteRecord> spmkApproveExecuteRecords = spmkApproveExecuteRecordMapper.selectExecuteRecordListById(Integer.parseInt(currentUser.getId()), spmkApproveDetailSummary.getApproveSummaryId());
spmkApproveExecuteRecord = spmkApproveExecuteRecords.get(spmkApproveDetailDto.getIndex());
// spmkApproveExecuteRecord = spmkApproveExecuteRecordMapper.selectExecuteRecordById(Integer.parseInt(currentUser.getId()), spmkApproveDetailSummary.getApproveSummaryId());
}
//删除操作人记录
if (spmkApproveExecuteRecord != null) {
SpmkExecutor spmkExecutor = SpmkExecutor.builder().build().selectOne(new LambdaQueryWrapper<SpmkExecutor>()
.eq(SpmkExecutor::getApproveExecuteRecordId, spmkApproveExecuteRecord.getId()).eq(SpmkExecutor::getEmpNum, currentUser.getId()));
// SpmkExecutor spmkExecutor = SpmkExecutor.builder().build().selectOne(new LambdaQueryWrapper<SpmkExecutor>()
// .eq(SpmkExecutor::getApproveExecuteRecordId, spmkApproveExecuteRecord.getId()).eq(SpmkExecutor::getEmpNum, currentUser.getId()));
List<SpmkExecutor> spmkExecutors = SpmkExecutor.builder().build().selectList(new LambdaQueryWrapper<SpmkExecutor>()
.eq(SpmkExecutor::getApproveExecuteRecordId, spmkApproveExecuteRecord.getId()));
SpmkExecutor spmkExecutor = spmkExecutors.get(spmkApproveDetailDto.getUserIndex());
if (onlyOne) {
if (spmkExecutor.getSts() != 4) {
spmkApproveExecuteRecordMapper.delExecuteRecordByRecordIds(spmkApproveExecuteRecord.getId(), Integer.parseInt(currentUser.getId()));
......@@ -1786,7 +1798,8 @@ public class SpmkController {
public Result<Object> addFiles(@CurrentUser UserBean userBean, @RequestBody ApprovingDto approvingDto) {
QyzxEmpEntAsso ent = QyzxEmpEntAsso.builder().build().selectOne(new QueryWrapper<QyzxEmpEntAsso>().lambda().eq(QyzxEmpEntAsso::getOrgCode, userBean.getOrgCode()).eq(QyzxEmpEntAsso::getEmpNum, userBean.getEmpNum()));
if (ent != null) {
if (ent.getUserType() == 2) {
System.out.println(!ent.getEmpNum().equals(userBean.getEmpNum()));
if (ent.getUserType() == 2 && !ent.getEmpNum().equals(userBean.getEmpNum())) {
return ResultUtil.error("暂无权限");
}
}
......@@ -1814,7 +1827,7 @@ public class SpmkController {
public Result<Object> delFileList(@CurrentUser UserBean userBean, @RequestBody ApprovingDto approvingDto) {
QyzxEmpEntAsso ent = QyzxEmpEntAsso.builder().build().selectOne(new QueryWrapper<QyzxEmpEntAsso>().lambda().eq(QyzxEmpEntAsso::getOrgCode, userBean.getOrgCode()).eq(QyzxEmpEntAsso::getEmpNum, userBean.getEmpNum()));
if (ent != null) {
if (ent.getUserType() == 2) {
if (ent.getUserType() == 2 && !ent.getEmpNum().equals(userBean.getEmpNum())) {
return ResultUtil.error("暂无权限");
}
}
......@@ -1847,4 +1860,13 @@ public class SpmkController {
return ResultUtil.data("更新成功");
}
@PostMapping(value = "/is_current_execute")
@ApiOperation(value = "查询是否当前审批人", httpMethod = "POST", notes = "查询是否当前审批人")
@Log(title = "查询是否当前审批人", businessType = BusinessType.OTHER)
public Result<Object> isCurrentExecute(@CurrentUser UserBean userBean, @RequestBody SpmkApproveDetailDto sq) {
SpmkApproveExecuteRecord spmkApproveExecuteRecord = spmkApproveExecuteRecordMapper.selectExecuteRecordBySts1(userBean.getEmpNum(), sq.getApproveSummaryId());
return ResultUtil.data(spmkApproveExecuteRecord);
}
}
......@@ -21,7 +21,9 @@ public interface SpmkApproveExecuteRecordMapper extends BaseMapper<SpmkApproveEx
List<SpmkApproveExecuteRecord> selectListByAsId(@Param("id") Integer id);
int delExecuteRecord(@Param("recordId") Integer recordId,@Param("approveSummaryId") Integer approveSummaryId);
SpmkApproveExecuteRecord selectExecuteRecordById(@Param("userId") Integer userId,@Param("approveSummaryId") Integer approveSummaryId);
List<SpmkApproveExecuteRecord> selectExecuteRecordListById(@Param("userId") Integer userId,@Param("approveSummaryId") Integer approveSummaryId);
int delExecuteRecordByRecordIds(@Param("id") Integer id, @Param("uid")Integer uid);
SpmkApproveExecuteRecord selectExecuteRecordReoId(@Param("reoId") Integer reoId,@Param("approveSummaryId") Integer approveSummaryId);
SpmkApproveExecuteRecord selectExecuteRecordBySts1(@Param("userId") Integer userId,@Param("approveSummaryId") Integer approveSummaryId);
}
......@@ -172,6 +172,12 @@
WHERE sr.approve_summary_id = #{approveSummaryId} and se.emp_num = #{userId}
</select>
<select id="selectExecuteRecordListById" resultType="cn.timer.api.bean.spmk.SpmkApproveExecuteRecord">
SELECT sr.id,sr.sts FROM spmk_approve_execute_record sr
LEFT JOIN spmk_executor se ON se.approve_execute_record_id=sr.id
WHERE sr.approve_summary_id = #{approveSummaryId}
</select>
<select id="selectExecuteRecordReoId" resultType="cn.timer.api.bean.spmk.SpmkApproveExecuteRecord">
SELECT sr.id FROM spmk_approve_execute_record sr
LEFT JOIN spmk_executor se ON se.approve_execute_record_id=sr.id
......@@ -190,4 +196,16 @@
WHERE sr.id =#{id} and se.emp_num =#{uid}
</delete>
<select id="selectExecuteRecordBySts1" resultType="cn.timer.api.bean.spmk.SpmkApproveExecuteRecord">
SELECT
*
FROM
spmk_approve_execute_record ser
LEFT JOIN spmk_executor se ON ser.id = se.approve_execute_record_id
WHERE
ser.approve_summary_id = #{approveSummaryId}
AND se.sts = 1
AND se.emp_num = #{userId}
</select>
</mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment