feat: 增加抄送标记未读功能
This commit is contained in:
@@ -66,7 +66,14 @@ public class HrmFlowCcController extends BaseController {
|
|||||||
Long userId = LoginHelper.getUserId();
|
Long userId = LoginHelper.getUserId();
|
||||||
return toAjax(service.markRead(ccId, userId));
|
return toAjax(service.markRead(ccId, userId));
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 标记抄送未读(新增)
|
||||||
|
*/
|
||||||
|
@PostMapping("/{ccId}/unread")
|
||||||
|
public R<Void> unread(@PathVariable Long ccId) {
|
||||||
|
Long userId = LoginHelper.getUserId();
|
||||||
|
return toAjax(service.markUnread(ccId, userId));
|
||||||
|
}
|
||||||
@GetMapping("/ping")
|
@GetMapping("/ping")
|
||||||
public R<String> ping(@RequestParam @NotNull String x) {
|
public R<String> ping(@RequestParam @NotNull String x) {
|
||||||
return R.ok(x);
|
return R.ok(x);
|
||||||
|
|||||||
@@ -27,5 +27,9 @@ public interface IHrmFlowCcService {
|
|||||||
* 标记已读
|
* 标记已读
|
||||||
*/
|
*/
|
||||||
Boolean markRead(Long ccId, Long userId);
|
Boolean markRead(Long ccId, Long userId);
|
||||||
|
/**
|
||||||
|
* 标记未读
|
||||||
|
*/
|
||||||
|
Boolean markUnread(Long ccId, Long userId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -99,6 +99,23 @@ public class HrmFlowCcServiceImpl implements IHrmFlowCcService {
|
|||||||
.eq(HrmFlowCc::getDelFlag, 0)
|
.eq(HrmFlowCc::getDelFlag, 0)
|
||||||
) > 0;
|
) > 0;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 标记未读
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean markUnread(Long ccId, Long userId) {
|
||||||
|
if (ccId == null || userId == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return baseMapper.update(
|
||||||
|
null,
|
||||||
|
Wrappers.<HrmFlowCc>lambdaUpdate()
|
||||||
|
.set(HrmFlowCc::getReadFlag, 0)
|
||||||
|
.eq(HrmFlowCc::getCcId, ccId)
|
||||||
|
.eq(HrmFlowCc::getCcUserId, userId)
|
||||||
|
.eq(HrmFlowCc::getDelFlag, 0)
|
||||||
|
) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
private LambdaQueryWrapper<HrmFlowCc> buildQueryWrapper(HrmFlowCcBo bo) {
|
private LambdaQueryWrapper<HrmFlowCc> buildQueryWrapper(HrmFlowCcBo bo) {
|
||||||
LambdaQueryWrapper<HrmFlowCc> lqw = Wrappers.lambdaQuery();
|
LambdaQueryWrapper<HrmFlowCc> lqw = Wrappers.lambdaQuery();
|
||||||
|
|||||||
@@ -16,7 +16,13 @@ export function readCc(ccId) {
|
|||||||
method: 'post'
|
method: 'post'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
// 标记抄送为未读
|
||||||
|
export function unreadCc(ccId) {
|
||||||
|
return request({
|
||||||
|
url: `/hrm/flow/cc/${ccId}/unread`,
|
||||||
|
method: 'post'
|
||||||
|
})
|
||||||
|
}
|
||||||
// 手动抄送
|
// 手动抄送
|
||||||
export function addCc(data) {
|
export function addCc(data) {
|
||||||
return request({
|
return request({
|
||||||
|
|||||||
@@ -56,8 +56,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { listCc, readCc } from '@/api/hrm/cc';
|
|
||||||
import applyTypeMinix from '@/views/hrm/minix/applyTypeMinix.js';
|
import applyTypeMinix from '@/views/hrm/minix/applyTypeMinix.js';
|
||||||
|
import { listCc, readCc, unreadCc } from '@/api/hrm/cc';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'HrmFlowCc',
|
name: 'HrmFlowCc',
|
||||||
@@ -115,6 +115,14 @@ export default {
|
|||||||
this.getList()
|
this.getList()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
// 标记未读
|
||||||
|
handleUnread(row) {
|
||||||
|
unreadCc(row.ccId).then(() => {
|
||||||
|
this.$modal.msgSuccess('已标记为未读')
|
||||||
|
// 刷新当前列表(这条记录会移到未读列表)
|
||||||
|
this.getList()
|
||||||
|
})
|
||||||
|
},
|
||||||
handleRefresh () {
|
handleRefresh () {
|
||||||
this.getList()
|
this.getList()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user