休假报备、出差报备 删除和修改添加限制

This commit is contained in:
cwchen 2025-02-13 10:34:26 +08:00
parent 23d865fe9f
commit bd059632ce
5 changed files with 17 additions and 9 deletions

View File

@ -124,7 +124,7 @@ public class EvectionController extends BaseController {
@Log(title = "流程管理->出差报备->修改出差报备", businessType = BusinessType.UPDATE)
public AjaxResult edit(@Validated @RequestBody EvectionBean o) {
try{
AjaxResult result = isCheck(o.getId() + "");
AjaxResult result = isCheck(o.getId() + "",1);
if(result!=null){
return result;
}
@ -145,7 +145,7 @@ public class EvectionController extends BaseController {
@Log(title = "流程管理->出差报备->删除出差报备", businessType = BusinessType.DELETE)
public AjaxResult remove(@PathVariable("id") String id) {
try{
AjaxResult result = isCheck(id);
AjaxResult result = isCheck(id,2);
if(result!=null){
return result;
}
@ -163,9 +163,9 @@ public class EvectionController extends BaseController {
* @author cwchen
* @date 2025/2/12 14:32
*/
public AjaxResult isCheck(String id) {
public AjaxResult isCheck(String id,int type) {
// 判断休假报备数据是否被核对
Integer checkStatus = evectionService.isCheck(id);
Integer checkStatus = evectionService.isCheck(id,type);
if(!Objects.equals(checkStatus,0)){
return AjaxResult.error("出差报备数据已被核对,无法操作");
}else {

View File

@ -44,5 +44,5 @@ public interface EvectionDao {
* @author cwchen
* @date 2025/2/12 15:53
*/
EvectionBean getEvectionById(String id);
EvectionBean getEvectionById(@Param("id") String id,@Param("type") int type);
}

View File

@ -8,6 +8,7 @@ import com.bonus.system.dept.entity.ProDeptRoleBean;
import com.bonus.system.dept.entity.ProDeptRoleDo;
import com.bonus.system.evection.entity.EvectionBean;
import com.bonus.system.leaveReporting.entity.LeaveReportingBean;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
@ -71,5 +72,5 @@ public interface EvectionService {
* @author cwchen
* @date 2025/2/12 15:12
*/
Integer isCheck(String id);
Integer isCheck(@Param("id") String id,@Param("type") int type);
}

View File

@ -136,9 +136,9 @@ public class EvectionServiceImpl implements EvectionService {
}
@Override
public Integer isCheck(String id) {
public Integer isCheck(String id,int type) {
try {
EvectionBean evectionBean = evectionDao.getEvectionById(id);
EvectionBean evectionBean = evectionDao.getEvectionById(id,type);
List<Integer> list = evectionDao.isCheck(evectionBean);
if(CollectionUtils.isNotEmpty(list)){
for (Integer status : list) {

View File

@ -254,6 +254,13 @@
la.leave_end_date AS leaveEndDate,
la.org_id AS orgId
FROM leave_apply la
WHERE la.id = #{id}
<where>
<if test="type == 1">
AND la.id = #{id}
</if>
<if test="type == 2">
AND la.leave_form_id = #{id} AND submit_id = user_id
</if>
</where>
</select>
</mapper>