休假报备、出差报备 删除和修改添加限制
This commit is contained in:
parent
23d865fe9f
commit
bd059632ce
|
|
@ -124,7 +124,7 @@ public class EvectionController extends BaseController {
|
||||||
@Log(title = "流程管理->出差报备->修改出差报备", businessType = BusinessType.UPDATE)
|
@Log(title = "流程管理->出差报备->修改出差报备", businessType = BusinessType.UPDATE)
|
||||||
public AjaxResult edit(@Validated @RequestBody EvectionBean o) {
|
public AjaxResult edit(@Validated @RequestBody EvectionBean o) {
|
||||||
try{
|
try{
|
||||||
AjaxResult result = isCheck(o.getId() + "");
|
AjaxResult result = isCheck(o.getId() + "",1);
|
||||||
if(result!=null){
|
if(result!=null){
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
@ -145,7 +145,7 @@ public class EvectionController extends BaseController {
|
||||||
@Log(title = "流程管理->出差报备->删除出差报备", businessType = BusinessType.DELETE)
|
@Log(title = "流程管理->出差报备->删除出差报备", businessType = BusinessType.DELETE)
|
||||||
public AjaxResult remove(@PathVariable("id") String id) {
|
public AjaxResult remove(@PathVariable("id") String id) {
|
||||||
try{
|
try{
|
||||||
AjaxResult result = isCheck(id);
|
AjaxResult result = isCheck(id,2);
|
||||||
if(result!=null){
|
if(result!=null){
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
@ -163,9 +163,9 @@ public class EvectionController extends BaseController {
|
||||||
* @author cwchen
|
* @author cwchen
|
||||||
* @date 2025/2/12 14:32
|
* @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)){
|
if(!Objects.equals(checkStatus,0)){
|
||||||
return AjaxResult.error("出差报备数据已被核对,无法操作");
|
return AjaxResult.error("出差报备数据已被核对,无法操作");
|
||||||
}else {
|
}else {
|
||||||
|
|
|
||||||
|
|
@ -44,5 +44,5 @@ public interface EvectionDao {
|
||||||
* @author cwchen
|
* @author cwchen
|
||||||
* @date 2025/2/12 15:53
|
* @date 2025/2/12 15:53
|
||||||
*/
|
*/
|
||||||
EvectionBean getEvectionById(String id);
|
EvectionBean getEvectionById(@Param("id") String id,@Param("type") int type);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ import com.bonus.system.dept.entity.ProDeptRoleBean;
|
||||||
import com.bonus.system.dept.entity.ProDeptRoleDo;
|
import com.bonus.system.dept.entity.ProDeptRoleDo;
|
||||||
import com.bonus.system.evection.entity.EvectionBean;
|
import com.bonus.system.evection.entity.EvectionBean;
|
||||||
import com.bonus.system.leaveReporting.entity.LeaveReportingBean;
|
import com.bonus.system.leaveReporting.entity.LeaveReportingBean;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
@ -71,5 +72,5 @@ public interface EvectionService {
|
||||||
* @author cwchen
|
* @author cwchen
|
||||||
* @date 2025/2/12 15:12
|
* @date 2025/2/12 15:12
|
||||||
*/
|
*/
|
||||||
Integer isCheck(String id);
|
Integer isCheck(@Param("id") String id,@Param("type") int type);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -136,9 +136,9 @@ public class EvectionServiceImpl implements EvectionService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Integer isCheck(String id) {
|
public Integer isCheck(String id,int type) {
|
||||||
try {
|
try {
|
||||||
EvectionBean evectionBean = evectionDao.getEvectionById(id);
|
EvectionBean evectionBean = evectionDao.getEvectionById(id,type);
|
||||||
List<Integer> list = evectionDao.isCheck(evectionBean);
|
List<Integer> list = evectionDao.isCheck(evectionBean);
|
||||||
if(CollectionUtils.isNotEmpty(list)){
|
if(CollectionUtils.isNotEmpty(list)){
|
||||||
for (Integer status : list) {
|
for (Integer status : list) {
|
||||||
|
|
|
||||||
|
|
@ -254,6 +254,13 @@
|
||||||
la.leave_end_date AS leaveEndDate,
|
la.leave_end_date AS leaveEndDate,
|
||||||
la.org_id AS orgId
|
la.org_id AS orgId
|
||||||
FROM leave_apply la
|
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>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
Loading…
Reference in New Issue