Commit 0fd1f0dd authored by qyx's avatar qyx

Merge remote-tracking branch 'origin/master'

parents 7068dfea ef7eb657
package com.ruoyi.employment.controller;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.employment.domain.ApprovalInstance;
import com.ruoyi.employment.service.IApprovalInstanceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 人事管理审批关联Controller
*
* @author ruoyi
* @date 2025-03-25
*/
@RestController
@RequestMapping("/system/instance")
public class ApprovalInstanceController extends BaseController
{
@Autowired
private IApprovalInstanceService approvalInstanceService;
/**
* 查询人事管理审批关联列表
*/
@PreAuthorize("@ss.hasPermi('system:instance:list')")
@GetMapping("/list")
public TableDataInfo list(ApprovalInstance approvalInstance)
{
startPage();
List<ApprovalInstance> list = approvalInstanceService.selectApprovalInstanceList(approvalInstance);
return getDataTable(list);
}
/**
* 导出人事管理审批关联列表
*/
@PreAuthorize("@ss.hasPermi('system:instance:export')")
@Log(title = "人事管理审批关联", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, ApprovalInstance approvalInstance)
{
List<ApprovalInstance> list = approvalInstanceService.selectApprovalInstanceList(approvalInstance);
ExcelUtil<ApprovalInstance> util = new ExcelUtil<ApprovalInstance>(ApprovalInstance.class);
util.exportExcel(response, list, "人事管理审批关联数据");
}
/**
* 获取人事管理审批关联详细信息
*/
@PreAuthorize("@ss.hasPermi('system:instance:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(approvalInstanceService.selectApprovalInstanceById(id));
}
/**
* 新增人事管理审批关联
*/
@PreAuthorize("@ss.hasPermi('system:instance:add')")
@Log(title = "人事管理审批关联", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody ApprovalInstance approvalInstance)
{
return toAjax(approvalInstanceService.insertApprovalInstance(approvalInstance));
}
/**
* 修改人事管理审批关联
*/
@PreAuthorize("@ss.hasPermi('system:instance:edit')")
@Log(title = "人事管理审批关联", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody ApprovalInstance approvalInstance)
{
return toAjax(approvalInstanceService.updateApprovalInstance(approvalInstance));
}
/**
* 删除人事管理审批关联
*/
@PreAuthorize("@ss.hasPermi('system:instance:remove')")
@Log(title = "人事管理审批关联", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(approvalInstanceService.deleteApprovalInstanceByIds(ids));
}
}
\ No newline at end of file
...@@ -31,7 +31,8 @@ public class EmploymentApprovalController extends BaseController ...@@ -31,7 +31,8 @@ public class EmploymentApprovalController extends BaseController
/** /**
* 查询入职审批列表 * 查询入职审批列表
*/ */
@PreAuthorize("@ss.hasPermi('approval:approval:list')") //@PreAuthorize("@ss.hasPermi('approval:approval:list')")
@PreAuthorize("@ss.hasRole('admin') or @ss.hasRole('project-manager') or @ss.hasRole('hr') or @ss.hasRole('general-manager')")
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo list(EmploymentApproval employmentApproval) public TableDataInfo list(EmploymentApproval employmentApproval)
{ {
...@@ -43,7 +44,8 @@ public class EmploymentApprovalController extends BaseController ...@@ -43,7 +44,8 @@ public class EmploymentApprovalController extends BaseController
/** /**
* 导出入职审批列表 * 导出入职审批列表
*/ */
@PreAuthorize("@ss.hasPermi('approval:approval:export')") //@PreAuthorize("@ss.hasPermi('approval:approval:export')")
@PreAuthorize("@ss.hasRole('admin') or @ss.hasRole('project-manager') or @ss.hasRole('hr') or @ss.hasRole('general-manager')")
@Log(title = "入职审批", businessType = BusinessType.EXPORT) @Log(title = "入职审批", businessType = BusinessType.EXPORT)
@PostMapping("/export") @PostMapping("/export")
public void export(HttpServletResponse response, EmploymentApproval employmentApproval) public void export(HttpServletResponse response, EmploymentApproval employmentApproval)
...@@ -53,7 +55,8 @@ public class EmploymentApprovalController extends BaseController ...@@ -53,7 +55,8 @@ public class EmploymentApprovalController extends BaseController
util.exportExcel(response, list, "入职审批数据"); util.exportExcel(response, list, "入职审批数据");
} }
@PreAuthorize("@ss.hasPermi('approval:approval:import')") //@PreAuthorize("@ss.hasPermi('approval:approval:import')")
@PreAuthorize("@ss.hasRole('admin') or @ss.hasRole('project-manager') or @ss.hasRole('hr') or @ss.hasRole('general-manager')")
@Log(title = "入职审批", businessType = BusinessType.IMPORT) @Log(title = "入职审批", businessType = BusinessType.IMPORT)
@PostMapping("/importData") @PostMapping("/importData")
public AjaxResult importData(@RequestParam("file") MultipartFile file) throws Exception { public AjaxResult importData(@RequestParam("file") MultipartFile file) throws Exception {
...@@ -80,7 +83,8 @@ public class EmploymentApprovalController extends BaseController ...@@ -80,7 +83,8 @@ public class EmploymentApprovalController extends BaseController
/** /**
* 获取入职审批详细信息 * 获取入职审批详细信息
*/ */
@PreAuthorize("@ss.hasPermi('approval:approval:query')") //@PreAuthorize("@ss.hasPermi('approval:approval:query')")
@PreAuthorize("@ss.hasRole('admin') or @ss.hasRole('project-manager') or @ss.hasRole('hr') or @ss.hasRole('general-manager')")
@GetMapping(value = "/{id}") @GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) public AjaxResult getInfo(@PathVariable("id") Long id)
{ {
...@@ -90,7 +94,8 @@ public class EmploymentApprovalController extends BaseController ...@@ -90,7 +94,8 @@ public class EmploymentApprovalController extends BaseController
/** /**
* 新增入职审批 * 新增入职审批
*/ */
@PreAuthorize("@ss.hasPermi('approval:approval:add')") //@PreAuthorize("@ss.hasPermi('approval:approval:add')")
@PreAuthorize("@ss.hasRole('admin') or @ss.hasRole('project-manager') or @ss.hasRole('hr') or @ss.hasRole('general-manager')")
@Log(title = "入职审批", businessType = BusinessType.INSERT) @Log(title = "入职审批", businessType = BusinessType.INSERT)
@PostMapping @PostMapping
public AjaxResult add(@RequestBody EmploymentApproval employmentApproval) public AjaxResult add(@RequestBody EmploymentApproval employmentApproval)
...@@ -101,7 +106,8 @@ public class EmploymentApprovalController extends BaseController ...@@ -101,7 +106,8 @@ public class EmploymentApprovalController extends BaseController
/** /**
* 修改入职审批 * 修改入职审批
*/ */
@PreAuthorize("@ss.hasPermi('approval:approval:edit')") //@PreAuthorize("@ss.hasPermi('approval:approval:edit')")
@PreAuthorize("@ss.hasRole('admin') or @ss.hasRole('project-manager') or @ss.hasRole('hr') or @ss.hasRole('general-manager')")
@Log(title = "入职审批", businessType = BusinessType.UPDATE) @Log(title = "入职审批", businessType = BusinessType.UPDATE)
@PutMapping @PutMapping
public AjaxResult edit(@RequestBody EmploymentApproval employmentApproval) public AjaxResult edit(@RequestBody EmploymentApproval employmentApproval)
...@@ -112,7 +118,8 @@ public class EmploymentApprovalController extends BaseController ...@@ -112,7 +118,8 @@ public class EmploymentApprovalController extends BaseController
/** /**
* 删除入职审批 * 删除入职审批
*/ */
@PreAuthorize("@ss.hasPermi('approval:approval:remove')") //@PreAuthorize("@ss.hasPermi('approval:approval:remove')")
@PreAuthorize("@ss.hasRole('admin') or @ss.hasRole('project-manager') or @ss.hasRole('hr') or @ss.hasRole('general-manager')")
@Log(title = "入职审批", businessType = BusinessType.DELETE) @Log(title = "入职审批", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}") @DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) public AjaxResult remove(@PathVariable Long[] ids)
...@@ -126,7 +133,8 @@ public class EmploymentApprovalController extends BaseController ...@@ -126,7 +133,8 @@ public class EmploymentApprovalController extends BaseController
/** /**
* 查询入职审批列表 * 查询入职审批列表
*/ */
@PreAuthorize("@ss.hasPermi('approval:approval:check')") //@PreAuthorize("@ss.hasPermi('approval:approval:check')")
@PreAuthorize("@ss.hasRole('admin') or @ss.hasRole('project-manager') or @ss.hasRole('hr') or @ss.hasRole('general-manager')")
@GetMapping("/listDraft") @GetMapping("/listDraft")
public TableDataInfo draft(EmploymentApproval employmentApproval) public TableDataInfo draft(EmploymentApproval employmentApproval)
{ {
...@@ -138,7 +146,8 @@ public class EmploymentApprovalController extends BaseController ...@@ -138,7 +146,8 @@ public class EmploymentApprovalController extends BaseController
/** /**
* 入职草稿箱新增 * 入职草稿箱新增
*/ */
@PreAuthorize("@ss.hasPermi('approval:approval:addDraft')") //@PreAuthorize("@ss.hasPermi('approval:approval:addDraft')")
@PreAuthorize("@ss.hasRole('admin') or @ss.hasRole('project-manager') or @ss.hasRole('hr') or @ss.hasRole('general-manager')")
@Log(title = "入职审批", businessType = BusinessType.INSERT) @Log(title = "入职审批", businessType = BusinessType.INSERT)
@PostMapping("/addDraft") @PostMapping("/addDraft")
public AjaxResult addDraft(@RequestBody EmploymentApproval employmentApproval) public AjaxResult addDraft(@RequestBody EmploymentApproval employmentApproval)
...@@ -150,7 +159,8 @@ public class EmploymentApprovalController extends BaseController ...@@ -150,7 +159,8 @@ public class EmploymentApprovalController extends BaseController
/** /**
* 入职草稿箱修改 * 入职草稿箱修改
*/ */
@PreAuthorize("@ss.hasPermi('approval:approval:updateDraft')") //@PreAuthorize("@ss.hasPermi('approval:approval:updateDraft')")
@PreAuthorize("@ss.hasRole('admin') or @ss.hasRole('project-manager') or @ss.hasRole('hr') or @ss.hasRole('general-manager')")
@Log(title = "入职审批", businessType = BusinessType.UPDATE) @Log(title = "入职审批", businessType = BusinessType.UPDATE)
@PutMapping("/updateDraft") @PutMapping("/updateDraft")
public AjaxResult updateDraft(@RequestBody EmploymentApproval employmentApproval) public AjaxResult updateDraft(@RequestBody EmploymentApproval employmentApproval)
...@@ -158,4 +168,18 @@ public class EmploymentApprovalController extends BaseController ...@@ -158,4 +168,18 @@ public class EmploymentApprovalController extends BaseController
return toAjax(employmentApprovalService.updateEmploymentApprovalDraft(employmentApproval)); return toAjax(employmentApprovalService.updateEmploymentApprovalDraft(employmentApproval));
} }
@PreAuthorize("@ss.hasRole('admin') or @ss.hasRole('project-manager') or @ss.hasRole('hr') or @ss.hasRole('general-manager')")
@PostMapping("/updateApproval")
public AjaxResult updateApproval(@RequestBody EmploymentApproval employmentApproval)
{
return toAjax(employmentApprovalService.updateApproval(employmentApproval));
}
@PreAuthorize("@ss.hasRole('admin') or @ss.hasRole('project-manager') or @ss.hasRole('hr') or @ss.hasRole('general-manager')")
@PostMapping("/updateApproval2")
public AjaxResult updateApproval2(@RequestBody EmploymentApproval employmentApproval)
{
return toAjax(employmentApprovalService.updateApproval2(employmentApproval));
}
} }
package com.ruoyi.employment.domain;
import com.ruoyi.common.core.domain.BaseEntity;
import lombok.Data;
@Data
public class ApprovalInstance extends BaseEntity {
private static final long serialVersionUID = 1L;
/** $column.columnComment */
private Long id;
private Integer apid;
private Long userId;
private Integer state;
private Long approverId;
private EmploymentApproval employmentApproval;
}
...@@ -201,10 +201,10 @@ public class EmploymentApproval extends BaseEntity ...@@ -201,10 +201,10 @@ public class EmploymentApproval extends BaseEntity
private String processState; private String processState;
/** 当前节点 */ /** 当前节点 */
private String currentNode; private Integer currentNode;
/** 当前负责人 */ /** 当前负责人 */
private String currentResponsiblePerson; private Integer currentResponsiblePerson;
private Integer serviceCompany; private Integer serviceCompany;
...@@ -214,4 +214,10 @@ public class EmploymentApproval extends BaseEntity ...@@ -214,4 +214,10 @@ public class EmploymentApproval extends BaseEntity
private Integer isDraft; private Integer isDraft;
private ApprovalInstance approvalInstance = new ApprovalInstance(); // 初始化
private Long empId;
} }
package com.ruoyi.employment.mapper;
import com.ruoyi.employment.domain.ApprovalInstance;
import java.util.List;
public interface ApprovalInstanceMapper {
/**
* 查询人事管理审批关联
*
* @param id 人事管理审批关联主键
* @return 人事管理审批关联
*/
public ApprovalInstance selectApprovalInstanceById(Long id);
/**
* 查询人事管理审批关联列表
*
* @param approvalInstance 人事管理审批关联
* @return 人事管理审批关联集合
*/
public List<ApprovalInstance> selectApprovalInstanceList(ApprovalInstance approvalInstance);
/**
* 新增人事管理审批关联
*
* @param approvalInstance 人事管理审批关联
* @return 结果
*/
public int insertApprovalInstance(ApprovalInstance approvalInstance);
/**
* 修改人事管理审批关联
*
* @param approvalInstance 人事管理审批关联
* @return 结果
*/
public int updateApprovalInstance(ApprovalInstance approvalInstance);
/**
* 删除人事管理审批关联
*
* @param id 人事管理审批关联主键
* @return 结果
*/
public int deleteApprovalInstanceById(Long id);
/**
* 批量删除人事管理审批关联
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteApprovalInstanceByIds(Long[] ids);
}
package com.ruoyi.employment.mapper; package com.ruoyi.employment.mapper;
import java.util.List; import java.util.List;
import com.ruoyi.employment.domain.ApprovalInstance;
import com.ruoyi.employment.domain.EmploymentApproval; import com.ruoyi.employment.domain.EmploymentApproval;
/** /**
...@@ -84,4 +86,8 @@ public interface EmploymentApprovalMapper ...@@ -84,4 +86,8 @@ public interface EmploymentApprovalMapper
public int updateEmploymentApprovalDraft(EmploymentApproval employmentApproval); public int updateEmploymentApprovalDraft(EmploymentApproval employmentApproval);
public int updateApproval(EmploymentApproval employmentApproval);
public int updateApproval2(EmploymentApproval employmentApproval);
} }
package com.ruoyi.employment.service;
import com.ruoyi.employment.domain.ApprovalInstance;
import java.util.List;
public interface IApprovalInstanceService
{
/**
* 查询人事管理审批关联
*
* @param id 人事管理审批关联主键
* @return 人事管理审批关联
*/
public ApprovalInstance selectApprovalInstanceById(Long id);
/**
* 查询人事管理审批关联列表
*
* @param approvalInstance 人事管理审批关联
* @return 人事管理审批关联集合
*/
public List<ApprovalInstance> selectApprovalInstanceList(ApprovalInstance approvalInstance);
/**
* 新增人事管理审批关联
*
* @param approvalInstance 人事管理审批关联
* @return 结果
*/
public int insertApprovalInstance(ApprovalInstance approvalInstance);
/**
* 修改人事管理审批关联
*
* @param approvalInstance 人事管理审批关联
* @return 结果
*/
public int updateApprovalInstance(ApprovalInstance approvalInstance);
/**
* 批量删除人事管理审批关联
*
* @param ids 需要删除的人事管理审批关联主键集合
* @return 结果
*/
public int deleteApprovalInstanceByIds(Long[] ids);
/**
* 删除人事管理审批关联信息
*
* @param id 人事管理审批关联主键
* @return 结果
*/
public int deleteApprovalInstanceById(Long id);
}
\ No newline at end of file
...@@ -80,4 +80,7 @@ public interface IEmploymentApprovalService ...@@ -80,4 +80,7 @@ public interface IEmploymentApprovalService
public int updateEmploymentApprovalDraft(EmploymentApproval employmentApproval); public int updateEmploymentApprovalDraft(EmploymentApproval employmentApproval);
public int updateApproval(EmploymentApproval employmentApproval);
public int updateApproval2(EmploymentApproval employmentApproval);
} }
package com.ruoyi.employment.service.impl;
import com.ruoyi.employment.domain.ApprovalInstance;
import com.ruoyi.employment.mapper.ApprovalInstanceMapper;
import com.ruoyi.employment.service.IApprovalInstanceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class ApprovalInstanceServiceImpl implements IApprovalInstanceService
{
@Autowired
private ApprovalInstanceMapper approvalInstanceMapper;
/**
* 查询人事管理审批关联
*
* @param id 人事管理审批关联主键
* @return 人事管理审批关联
*/
@Override
public ApprovalInstance selectApprovalInstanceById(Long id)
{
return approvalInstanceMapper.selectApprovalInstanceById(id);
}
/**
* 查询人事管理审批关联列表
*
* @param approvalInstance 人事管理审批关联
* @return 人事管理审批关联
*/
@Override
public List<ApprovalInstance> selectApprovalInstanceList(ApprovalInstance approvalInstance)
{
return approvalInstanceMapper.selectApprovalInstanceList(approvalInstance);
}
/**
* 新增人事管理审批关联
*
* @param approvalInstance 人事管理审批关联
* @return 结果
*/
@Override
public int insertApprovalInstance(ApprovalInstance approvalInstance)
{
return approvalInstanceMapper.insertApprovalInstance(approvalInstance);
}
/**
* 修改人事管理审批关联
*
* @param approvalInstance 人事管理审批关联
* @return 结果
*/
@Override
public int updateApprovalInstance(ApprovalInstance approvalInstance)
{
return approvalInstanceMapper.updateApprovalInstance(approvalInstance);
}
/**
* 批量删除人事管理审批关联
*
* @param ids 需要删除的人事管理审批关联主键
* @return 结果
*/
@Override
public int deleteApprovalInstanceByIds(Long[] ids)
{
return approvalInstanceMapper.deleteApprovalInstanceByIds(ids);
}
/**
* 删除人事管理审批关联信息
*
* @param id 人事管理审批关联主键
* @return 结果
*/
@Override
public int deleteApprovalInstanceById(Long id)
{
return approvalInstanceMapper.deleteApprovalInstanceById(id);
}
}
\ No newline at end of file
...@@ -4,6 +4,8 @@ import java.util.List; ...@@ -4,6 +4,8 @@ import java.util.List;
import com.ruoyi.common.exception.ServiceException; import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.employment.domain.ApprovalInstance;
import com.ruoyi.employment.mapper.ApprovalInstanceMapper;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -22,6 +24,8 @@ public class EmploymentApprovalServiceImpl implements IEmploymentApprovalService ...@@ -22,6 +24,8 @@ public class EmploymentApprovalServiceImpl implements IEmploymentApprovalService
{ {
@Autowired @Autowired
private EmploymentApprovalMapper employmentApprovalMapper; private EmploymentApprovalMapper employmentApprovalMapper;
@Autowired
private ApprovalInstanceMapper approvalInstanceMapper;
/** /**
* 查询入职审批 * 查询入职审批
...@@ -56,7 +60,13 @@ public class EmploymentApprovalServiceImpl implements IEmploymentApprovalService ...@@ -56,7 +60,13 @@ public class EmploymentApprovalServiceImpl implements IEmploymentApprovalService
@Override @Override
public int insertEmploymentApproval(EmploymentApproval employmentApproval) public int insertEmploymentApproval(EmploymentApproval employmentApproval)
{ {
return employmentApprovalMapper.insertEmploymentApproval(employmentApproval); employmentApprovalMapper.insertEmploymentApproval(employmentApproval);
ApprovalInstance approvalInstance = employmentApproval.getApprovalInstance();
approvalInstance.setApid(17);
approvalInstance.setUserId(employmentApproval.getId());
approvalInstance.setState(0);
approvalInstanceMapper.insertApprovalInstance(approvalInstance);
return 1;
} }
/** /**
...@@ -149,4 +159,18 @@ public class EmploymentApprovalServiceImpl implements IEmploymentApprovalService ...@@ -149,4 +159,18 @@ public class EmploymentApprovalServiceImpl implements IEmploymentApprovalService
employmentApproval.setIsDraft(1); employmentApproval.setIsDraft(1);
return employmentApprovalMapper.updateEmploymentApprovalDraft(employmentApproval); return employmentApprovalMapper.updateEmploymentApprovalDraft(employmentApproval);
} }
@Override
public int updateApproval(EmploymentApproval employmentApproval)
{
employmentApproval.setUpdateTime(DateUtils.getNowDate());
return employmentApprovalMapper.updateApproval(employmentApproval);
}
@Override
public int updateApproval2(EmploymentApproval employmentApproval)
{
employmentApproval.setUpdateTime(DateUtils.getNowDate());
return employmentApprovalMapper.updateApproval2(employmentApproval);
}
} }
...@@ -37,7 +37,8 @@ public class ApprovalRegularizationController extends BaseController ...@@ -37,7 +37,8 @@ public class ApprovalRegularizationController extends BaseController
/** /**
* 查询转正审批列表 * 查询转正审批列表
*/ */
@PreAuthorize("@ss.hasPermi('regularization:regularization:list')") //@PreAuthorize("@ss.hasPermi('regularization:regularization:list')")
@PreAuthorize("@ss.hasRole('admin') or @ss.hasRole('project-manager') or @ss.hasRole('hr') or @ss.hasRole('general-manager')")
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo list(ApprovalRegularization approvalRegularization) public TableDataInfo list(ApprovalRegularization approvalRegularization)
{ {
...@@ -49,7 +50,8 @@ public class ApprovalRegularizationController extends BaseController ...@@ -49,7 +50,8 @@ public class ApprovalRegularizationController extends BaseController
/** /**
* 导出转正审批列表 * 导出转正审批列表
*/ */
@PreAuthorize("@ss.hasPermi('regularization:regularization:export')") //@PreAuthorize("@ss.hasPermi('regularization:regularization:export')")
@PreAuthorize("@ss.hasRole('admin') or @ss.hasRole('project-manager') or @ss.hasRole('hr') or @ss.hasRole('general-manager')")
@Log(title = "转正审批", businessType = BusinessType.EXPORT) @Log(title = "转正审批", businessType = BusinessType.EXPORT)
@PostMapping("/export") @PostMapping("/export")
public void export(HttpServletResponse response, ApprovalRegularization approvalRegularization) public void export(HttpServletResponse response, ApprovalRegularization approvalRegularization)
...@@ -62,7 +64,8 @@ public class ApprovalRegularizationController extends BaseController ...@@ -62,7 +64,8 @@ public class ApprovalRegularizationController extends BaseController
/** /**
* 获取转正审批详细信息 * 获取转正审批详细信息
*/ */
@PreAuthorize("@ss.hasPermi('regularization:regularization:query')") //@PreAuthorize("@ss.hasPermi('regularization:regularization:query')")
@PreAuthorize("@ss.hasRole('admin') or @ss.hasRole('project-manager') or @ss.hasRole('hr') or @ss.hasRole('general-manager')")
@GetMapping(value = "/{id}") @GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) public AjaxResult getInfo(@PathVariable("id") Long id)
{ {
...@@ -72,7 +75,8 @@ public class ApprovalRegularizationController extends BaseController ...@@ -72,7 +75,8 @@ public class ApprovalRegularizationController extends BaseController
/** /**
* 新增转正审批 * 新增转正审批
*/ */
@PreAuthorize("@ss.hasPermi('regularization:regularization:add')") //@PreAuthorize("@ss.hasPermi('regularization:regularization:add')")
@PreAuthorize("@ss.hasRole('admin') or @ss.hasRole('project-manager') or @ss.hasRole('hr') or @ss.hasRole('general-manager') or @ss.hasRole('common')")
@Log(title = "转正审批", businessType = BusinessType.INSERT) @Log(title = "转正审批", businessType = BusinessType.INSERT)
@PostMapping @PostMapping
public AjaxResult add(@RequestBody ApprovalRegularization approvalRegularization) public AjaxResult add(@RequestBody ApprovalRegularization approvalRegularization)
...@@ -83,7 +87,8 @@ public class ApprovalRegularizationController extends BaseController ...@@ -83,7 +87,8 @@ public class ApprovalRegularizationController extends BaseController
/** /**
* 修改转正审批 * 修改转正审批
*/ */
@PreAuthorize("@ss.hasPermi('regularization:regularization:edit')") //@PreAuthorize("@ss.hasPermi('regularization:regularization:edit')")
@PreAuthorize("@ss.hasRole('admin') or @ss.hasRole('project-manager') or @ss.hasRole('hr') or @ss.hasRole('general-manager')")
@Log(title = "转正审批", businessType = BusinessType.UPDATE) @Log(title = "转正审批", businessType = BusinessType.UPDATE)
@PutMapping @PutMapping
public AjaxResult edit(@RequestBody ApprovalRegularization approvalRegularization) public AjaxResult edit(@RequestBody ApprovalRegularization approvalRegularization)
...@@ -94,11 +99,31 @@ public class ApprovalRegularizationController extends BaseController ...@@ -94,11 +99,31 @@ public class ApprovalRegularizationController extends BaseController
/** /**
* 删除转正审批 * 删除转正审批
*/ */
@PreAuthorize("@ss.hasPermi('regularization:regularization:remove')") //@PreAuthorize("@ss.hasPermi('regularization:regularization:remove')")
@PreAuthorize("@ss.hasRole('admin') or @ss.hasRole('project-manager') or @ss.hasRole('hr') or @ss.hasRole('general-manager')")
@Log(title = "转正审批", businessType = BusinessType.DELETE) @Log(title = "转正审批", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}") @DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) public AjaxResult remove(@PathVariable Long[] ids)
{ {
return toAjax(approvalRegularizationService.deleteApprovalRegularizationByIds(ids)); return toAjax(approvalRegularizationService.deleteApprovalRegularizationByIds(ids));
} }
@PreAuthorize("@ss.hasRole('admin') or @ss.hasRole('project-manager') or @ss.hasRole('hr') or @ss.hasRole('general-manager')")
@Log(title = "转正审批", businessType = BusinessType.UPDATE)
@PostMapping("/updateRegular")
public AjaxResult updateRegular(@RequestBody ApprovalRegularization approvalRegularization)
{
return toAjax(approvalRegularizationService.updateRegular(approvalRegularization));
}
@PreAuthorize("@ss.hasRole('admin') or @ss.hasRole('project-manager') or @ss.hasRole('hr') or @ss.hasRole('general-manager')")
@Log(title = "转正审批", businessType = BusinessType.UPDATE)
@PostMapping("/updateRegular2")
public AjaxResult updateRegular2(@RequestBody ApprovalRegularization approvalRegularization)
{
return toAjax(approvalRegularizationService.updateRegular2(approvalRegularization));
}
} }
...@@ -104,4 +104,6 @@ public class ApprovalRegularization extends BaseEntity ...@@ -104,4 +104,6 @@ public class ApprovalRegularization extends BaseEntity
private Integer confirmationApprovalState; private Integer confirmationApprovalState;
/** 当前节点 */
private Integer currentNode;
} }
...@@ -58,4 +58,10 @@ public interface ApprovalRegularizationMapper ...@@ -58,4 +58,10 @@ public interface ApprovalRegularizationMapper
* @return 结果 * @return 结果
*/ */
public int deleteApprovalRegularizationByIds(Long[] ids); public int deleteApprovalRegularizationByIds(Long[] ids);
public int updateRegular(ApprovalRegularization approvalRegularization);
public int updateRegular2(ApprovalRegularization approvalRegularization);
} }
...@@ -58,4 +58,9 @@ public interface IApprovalRegularizationService ...@@ -58,4 +58,9 @@ public interface IApprovalRegularizationService
* @return 结果 * @return 结果
*/ */
public int deleteApprovalRegularizationById(Long id); public int deleteApprovalRegularizationById(Long id);
public int updateRegular(ApprovalRegularization approvalRegularization);
public int updateRegular2(ApprovalRegularization approvalRegularization);
} }
...@@ -90,4 +90,18 @@ public class ApprovalRegularizationServiceImpl implements IApprovalRegularizatio ...@@ -90,4 +90,18 @@ public class ApprovalRegularizationServiceImpl implements IApprovalRegularizatio
{ {
return approvalRegularizationMapper.deleteApprovalRegularizationById(id); return approvalRegularizationMapper.deleteApprovalRegularizationById(id);
} }
@Override
public int updateRegular(ApprovalRegularization approvalRegularization)
{
return approvalRegularizationMapper.updateRegular(approvalRegularization);
}
@Override
public int updateRegular2(ApprovalRegularization approvalRegularization)
{
return approvalRegularizationMapper.updateRegular2(approvalRegularization);
}
} }
...@@ -37,7 +37,8 @@ public class ResignationApplicationController extends BaseController ...@@ -37,7 +37,8 @@ public class ResignationApplicationController extends BaseController
/** /**
* 查询离职申请列表 * 查询离职申请列表
*/ */
@PreAuthorize("@ss.hasPermi('resignation:resignation:list')") //@PreAuthorize("@ss.hasPermi('resignation:resignation:list')")
@PreAuthorize("@ss.hasRole('admin') or @ss.hasRole('project-manager') or @ss.hasRole('hr') or @ss.hasRole('general-manager') or @ss.hasRole('work-manage')")
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo list(ResignationApplication resignationApplication) public TableDataInfo list(ResignationApplication resignationApplication)
{ {
...@@ -49,7 +50,8 @@ public class ResignationApplicationController extends BaseController ...@@ -49,7 +50,8 @@ public class ResignationApplicationController extends BaseController
/** /**
* 导出离职申请列表 * 导出离职申请列表
*/ */
@PreAuthorize("@ss.hasPermi('resignation:resignation:export')") //@PreAuthorize("@ss.hasPermi('resignation:resignation:export')")
@PreAuthorize("@ss.hasRole('admin') or @ss.hasRole('project-manager') or @ss.hasRole('hr') or @ss.hasRole('general-manager')")
@Log(title = "离职申请", businessType = BusinessType.EXPORT) @Log(title = "离职申请", businessType = BusinessType.EXPORT)
@PostMapping("/export") @PostMapping("/export")
public void export(HttpServletResponse response, ResignationApplication resignationApplication) public void export(HttpServletResponse response, ResignationApplication resignationApplication)
...@@ -62,7 +64,8 @@ public class ResignationApplicationController extends BaseController ...@@ -62,7 +64,8 @@ public class ResignationApplicationController extends BaseController
/** /**
* 获取离职申请详细信息 * 获取离职申请详细信息
*/ */
@PreAuthorize("@ss.hasPermi('resignation:resignation:query')") //@PreAuthorize("@ss.hasPermi('resignation:resignation:query')")
@PreAuthorize("@ss.hasRole('admin') or @ss.hasRole('project-manager') or @ss.hasRole('hr') or @ss.hasRole('general-manager')")
@GetMapping(value = "/{id}") @GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) public AjaxResult getInfo(@PathVariable("id") Long id)
{ {
...@@ -72,7 +75,8 @@ public class ResignationApplicationController extends BaseController ...@@ -72,7 +75,8 @@ public class ResignationApplicationController extends BaseController
/** /**
* 新增离职申请 * 新增离职申请
*/ */
@PreAuthorize("@ss.hasPermi('resignation:resignation:add')") //@PreAuthorize("@ss.hasPermi('resignation:resignation:add')")
@PreAuthorize("@ss.hasRole('admin') or @ss.hasRole('project-manager') or @ss.hasRole('hr') or @ss.hasRole('general-manager') or @ss.hasRole('common')")
@Log(title = "离职申请", businessType = BusinessType.INSERT) @Log(title = "离职申请", businessType = BusinessType.INSERT)
@PostMapping @PostMapping
public AjaxResult add(@RequestBody ResignationApplication resignationApplication) public AjaxResult add(@RequestBody ResignationApplication resignationApplication)
...@@ -83,7 +87,8 @@ public class ResignationApplicationController extends BaseController ...@@ -83,7 +87,8 @@ public class ResignationApplicationController extends BaseController
/** /**
* 修改离职申请 * 修改离职申请
*/ */
@PreAuthorize("@ss.hasPermi('resignation:resignation:edit')") //@PreAuthorize("@ss.hasPermi('resignation:resignation:edit')")
@PreAuthorize("@ss.hasRole('admin') or @ss.hasRole('project-manager') or @ss.hasRole('hr') or @ss.hasRole('general-manager')")
@Log(title = "离职申请", businessType = BusinessType.UPDATE) @Log(title = "离职申请", businessType = BusinessType.UPDATE)
@PutMapping @PutMapping
public AjaxResult edit(@RequestBody ResignationApplication resignationApplication) public AjaxResult edit(@RequestBody ResignationApplication resignationApplication)
...@@ -94,11 +99,30 @@ public class ResignationApplicationController extends BaseController ...@@ -94,11 +99,30 @@ public class ResignationApplicationController extends BaseController
/** /**
* 删除离职申请 * 删除离职申请
*/ */
@PreAuthorize("@ss.hasPermi('resignation:resignation:remove')") //@PreAuthorize("@ss.hasPermi('resignation:resignation:remove')")
@PreAuthorize("@ss.hasRole('admin') or @ss.hasRole('project-manager') or @ss.hasRole('hr') or @ss.hasRole('general-manager')")
@Log(title = "离职申请", businessType = BusinessType.DELETE) @Log(title = "离职申请", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}") @DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) public AjaxResult remove(@PathVariable Long[] ids)
{ {
return toAjax(resignationApplicationService.deleteResignationApplicationByIds(ids)); return toAjax(resignationApplicationService.deleteResignationApplicationByIds(ids));
} }
@PreAuthorize("@ss.hasRole('admin') or @ss.hasRole('project-manager') or @ss.hasRole('hr') or @ss.hasRole('general-manager') or @ss.hasRole('work-manage')")
@Log(title = "离职申请", businessType = BusinessType.UPDATE)
@PostMapping("/updateResignation")
public AjaxResult updateResignation(@RequestBody ResignationApplication resignationApplication)
{
return toAjax(resignationApplicationService.updateResignation(resignationApplication));
}
@PreAuthorize("@ss.hasRole('admin') or @ss.hasRole('project-manager') or @ss.hasRole('hr') or @ss.hasRole('general-manager') or @ss.hasRole('work-manage')")
@Log(title = "离职申请", businessType = BusinessType.UPDATE)
@PostMapping("/updateResignation2")
public AjaxResult updateResignation2(@RequestBody ResignationApplication resignationApplication)
{
return toAjax(resignationApplicationService.updateResignation2(resignationApplication));
}
} }
...@@ -132,6 +132,10 @@ public class ResignationApplication extends BaseEntity ...@@ -132,6 +132,10 @@ public class ResignationApplication extends BaseEntity
private Integer managerConfirm; private Integer managerConfirm;
/** 离职审批状态 */ /** 离职审批状态 */
private Integer leaveApprovalState; private Integer leaveApprovalState;
/** 当前节点 */
private Integer currentNode;
private Integer managerOpinion;
/** 交接事务信息 */ /** 交接事务信息 */
......
...@@ -87,4 +87,11 @@ public interface ResignationApplicationMapper ...@@ -87,4 +87,11 @@ public interface ResignationApplicationMapper
public int deleteResignationMatterByApplicationId(Long id); public int deleteResignationMatterByApplicationId(Long id);
public int updateResignation(ResignationApplication resignationApplication);
public int updateResignation2(ResignationApplication resignationApplication);
} }
...@@ -60,4 +60,10 @@ public interface IResignationApplicationService ...@@ -60,4 +60,10 @@ public interface IResignationApplicationService
public int deleteResignationApplicationById(Long id); public int deleteResignationApplicationById(Long id);
public int updateResignation(ResignationApplication resignationApplication);
public int updateResignation2(ResignationApplication resignationApplication);
} }
...@@ -131,4 +131,21 @@ public class ResignationApplicationServiceImpl implements IResignationApplicatio ...@@ -131,4 +131,21 @@ public class ResignationApplicationServiceImpl implements IResignationApplicatio
} }
} }
@Override
public int updateResignation(ResignationApplication resignationApplication)
{
return resignationApplicationMapper.updateResignation(resignationApplication);
}
@Override
public int updateResignation2(ResignationApplication resignationApplication)
{
return resignationApplicationMapper.updateResignation2(resignationApplication);
}
} }
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.employment.mapper.ApprovalInstanceMapper">
<resultMap type="ApprovalInstance" id="ApprovalInstanceResult">
<result property="id" column="instance_id" />
<result property="apid" column="apid" />
<result property="userId" column="user_id" />
<result property="state" column="state" />
<result property="approverId" column="approver_id" />
</resultMap>
<sql id="selectApprovalInstanceVo">
approval_instance.id as empid, apid, user_id, state, approver_id
</sql>
<select id="selectApprovalInstanceList" parameterType="ApprovalInstance" resultMap="ApprovalInstanceResult">
select
<include refid="selectApprovalInstanceVo"/>,
approval_instance.id as instance_id,
employment_approval.id as approval_id
from approval_instance
inner join employment_approval on approval_instance.user_id = employment_approval.id
<where>
<if test="apid != null">and apid = #{apid}</if>
<if test="userId != null">and approval_instance.user_id = #{userId}</if>
<if test="state != null">and state = #{state}</if>
<if test="approverId != null">and approver_id = #{approverId}</if>
</where>
</select>
<select id="selectApprovalInstanceById" parameterType="Long" resultMap="ApprovalInstanceResult">
<trim prefix="select" suffixOverrides=",">
<include refid="selectApprovalInstanceVo"/>
</trim>
from approval_instance
where id = #{id}
</select>
<insert id="insertApprovalInstance" parameterType="ApprovalInstance" useGeneratedKeys="true" keyProperty="id">
insert into approval_instance
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="apid != null">apid,</if>
<if test="userId != null">user_id,</if>
<if test="state != null">state,</if>
<if test="approverId != null">approver_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="apid != null">#{apid},</if>
<if test="userId != null">#{userId},</if>
<if test="state != null">#{state},</if>
<if test="approverId != null">#{approverId},</if>
</trim>
</insert>
<update id="updateApprovalInstance" parameterType="ApprovalInstance">
update approval_instance
<trim prefix="SET" suffixOverrides=",">
<if test="apid != null">apid = #{apid},</if>
<if test="userId != null">user_id = #{userId},</if>
<if test="state != null">state = #{state},</if>
<if test="approverId != null">approver_id = #{approverId},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteApprovalInstanceById" parameterType="Long">
delete from approval_instance where id = #{id}
</delete>
<delete id="deleteApprovalInstanceByIds" parameterType="String">
delete from approval_instance where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
...@@ -58,10 +58,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -58,10 +58,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="serviceCompany" column="service_company" /> <result property="serviceCompany" column="service_company" />
<result property="employmentApprovalState" column="employment_approval_state" /> <result property="employmentApprovalState" column="employment_approval_state" />
<result property="isDraft" column="is_draft" /> <result property="isDraft" column="is_draft" />
<result property="empId" column="emp_id"/>
</resultMap> </resultMap>
<sql id="selectEmploymentApprovalVo"> <sql id="selectEmploymentApprovalVo">
select id, name, id_number, gender, birthday, phone, home_type, native_place, nationality, home_address, permanent_address, political_outlook, marital_status, work_date, worker_pic, emergency_contact_name, emergency_contact_phone, emergency_contact_relation, insured_city, social_security_account, housing_fund_account, bank_account, opening_bank, service_date, service_depart, entry_position, employment_form, formal_salary, employee_state, is_trial_period,trial_period_salary, trial_period_day, date_of_confirmation, education_level,diploma_pic, degree_pic, other_certification, signature, application_time, manager_opinion, approval_time, manager_signature, submitter, submission_time, update_time, process_state, current_node, current_responsible_person,is_borrow_company_assets,assets_name,service_company,employment_approval_state,is_draft from employment_approval select id, name, id_number, gender, birthday, phone, home_type, native_place, nationality, home_address, permanent_address, political_outlook, marital_status, work_date, worker_pic, emergency_contact_name, emergency_contact_phone, emergency_contact_relation, insured_city, social_security_account, housing_fund_account, bank_account, opening_bank, service_date, service_depart, entry_position, employment_form, formal_salary, employee_state, is_trial_period,trial_period_salary, trial_period_day, date_of_confirmation, education_level,diploma_pic, degree_pic, other_certification, signature, application_time, manager_opinion, approval_time, manager_signature, submitter, submission_time, update_time, process_state, current_node, current_responsible_person,is_borrow_company_assets,assets_name,service_company,employment_approval_state,is_draft,emp_id from employment_approval
</sql> </sql>
<select id="selectEmploymentApprovalList" parameterType="EmploymentApproval" resultMap="EmploymentApprovalResult"> <select id="selectEmploymentApprovalList" parameterType="EmploymentApproval" resultMap="EmploymentApprovalResult">
...@@ -119,7 +121,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -119,7 +121,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="serviceCompany != null and serviceCompany != ''"> and service_company = #{serviceCompany}</if> <if test="serviceCompany != null and serviceCompany != ''"> and service_company = #{serviceCompany}</if>
<if test="employmentApprovalState != null and employmentApprovalState != ''"> and employment_approval_state = #{employmentApprovalState}</if> <if test="employmentApprovalState != null and employmentApprovalState != ''"> and employment_approval_state = #{employmentApprovalState}</if>
and is_draft = 1 and is_draft = 1
<if test="empId != null and empId != ''"> and emp_id = #{empId}</if>
</where> </where>
order by employment_approval_state
</select> </select>
<select id="selectEmploymentApprovalById" parameterType="Long" resultMap="EmploymentApprovalResult"> <select id="selectEmploymentApprovalById" parameterType="Long" resultMap="EmploymentApprovalResult">
...@@ -157,7 +161,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -157,7 +161,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="entryPosition != null">entry_position,</if> <if test="entryPosition != null">entry_position,</if>
<if test="employmentForm != null">employment_form,</if> <if test="employmentForm != null">employment_form,</if>
<if test="formalSalary != null">formal_salary,</if> <if test="formalSalary != null">formal_salary,</if>
<if test="employeeState != null">employee_state,</if> employee_state,
<if test="isTrialPeriod != null">is_trial_period,</if> <if test="isTrialPeriod != null">is_trial_period,</if>
<if test="trialPeriodSalary != null ">trial_period_salary,</if> <if test="trialPeriodSalary != null ">trial_period_salary,</if>
<if test="trialPeriodDay != null">trial_period_day,</if> <if test="trialPeriodDay != null">trial_period_day,</if>
...@@ -175,13 +179,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -175,13 +179,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="submissionTime != null">submission_time,</if> <if test="submissionTime != null">submission_time,</if>
<if test="updateTime != null">update_time,</if> <if test="updateTime != null">update_time,</if>
<if test="processState != null">process_state,</if> <if test="processState != null">process_state,</if>
<if test="currentNode != null">current_node,</if> current_node,
<if test="currentResponsiblePerson != null">current_responsible_person,</if> <if test="currentResponsiblePerson != null">current_responsible_person,</if>
<if test="isBorrowCompanyAssets != null">is_borrow_company_assets,</if> <if test="isBorrowCompanyAssets != null">is_borrow_company_assets,</if>
<if test="assetsName != null">assets_name,</if> <if test="assetsName != null">assets_name,</if>
<if test="serviceCompany != null">service_company,</if> <if test="serviceCompany != null">service_company,</if>
<if test="employmentApprovalState != null">employment_approval_state,</if> employment_approval_state,
<if test="isDraft != null">is_draft,</if> is_draft,
<if test="empId != null">emp_id,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="name != null">#{name},</if> <if test="name != null">#{name},</if>
...@@ -211,7 +216,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -211,7 +216,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="entryPosition != null">#{entryPosition},</if> <if test="entryPosition != null">#{entryPosition},</if>
<if test="employmentForm != null">#{employmentForm},</if> <if test="employmentForm != null">#{employmentForm},</if>
<if test="formalSalary != null">#{formalSalary},</if> <if test="formalSalary != null">#{formalSalary},</if>
<if test="employeeState != null">#{employeeState},</if> 0,
<if test="isTrialPeriod != null">#{isTrialPeriod},</if> <if test="isTrialPeriod != null">#{isTrialPeriod},</if>
<if test="trialPeriodSalary != null ">#{trialPeriodSalary},</if> <if test="trialPeriodSalary != null ">#{trialPeriodSalary},</if>
<if test="trialPeriodDay != null">#{trialPeriodDay},</if> <if test="trialPeriodDay != null">#{trialPeriodDay},</if>
...@@ -229,13 +234,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -229,13 +234,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="submissionTime != null">#{submissionTime},</if> <if test="submissionTime != null">#{submissionTime},</if>
<if test="updateTime != null">#{updateTime},</if> <if test="updateTime != null">#{updateTime},</if>
<if test="processState != null">#{processState},</if> <if test="processState != null">#{processState},</if>
<if test="currentNode != null">#{currentNode},</if> 101,
<if test="currentResponsiblePerson != null">#{currentResponsiblePerson},</if> <if test="currentResponsiblePerson != null">#{currentResponsiblePerson},</if>
<if test="isBorrowCompanyAssets != null">#{isBorrowCompanyAssets},</if> <if test="isBorrowCompanyAssets != null">#{isBorrowCompanyAssets},</if>
<if test="assetsName != null">#{assetsName},</if> <if test="assetsName != null">#{assetsName},</if>
<if test="serviceCompany != null">#{serviceCompany},</if> <if test="serviceCompany != null">#{serviceCompany},</if>
<if test="employmentApprovalState != null">#{employmentApprovalState},</if> 0,
<if test="isDraft != null">#{isDraft},</if> 1,
<if test="empId != null">#{empId},</if>
</trim> </trim>
</insert> </insert>
...@@ -294,10 +300,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -294,10 +300,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="serviceCompany != null">service_company = #{serviceCompany},</if> <if test="serviceCompany != null">service_company = #{serviceCompany},</if>
<if test="employmentApprovalState != null">employment_approval_state = #{employmentApprovalState},</if> <if test="employmentApprovalState != null">employment_approval_state = #{employmentApprovalState},</if>
<if test="isDraft != null">is_draft = #{isDraft},</if> <if test="isDraft != null">is_draft = #{isDraft},</if>
<if test="empId != null">emp_id = #{empId},</if>
</trim> </trim>
where id = #{id} where id = #{id}
</update> </update>
<update id="updateApproval" parameterType="EmploymentApproval">
update employment_approval
set employment_approval_state = CASE
WHEN current_node = 103 THEN 2
ELSE 0
END,
current_node = CASE
WHEN current_node = 103 THEN current_node
ELSE current_node + 1
END
where id = #{id}
</update>
<update id="updateApproval2" parameterType="EmploymentApproval">
update employment_approval set employment_approval_state = 1 where id = #{id}
</update>
<delete id="deleteEmploymentApprovalById" parameterType="Long"> <delete id="deleteEmploymentApprovalById" parameterType="Long">
delete from employment_approval where id = #{id} delete from employment_approval where id = #{id}
</delete> </delete>
...@@ -309,6 +334,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -309,6 +334,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach> </foreach>
</delete> </delete>
<delete id="deleteApprovalInstanceByIdNumbers" parameterType="String">
delete from approval_instance where id_number in
<foreach item="idNumber" collection="array" open="(" separator="," close=")">
#{idNumber}
</foreach>
</delete>
<delete id="deleteApprovalInstanceByIdNumber" parameterType="Long">
delete from approval_instance where id_number = #{idNumber}
</delete>
<insert id="batchApprovalInstance">
insert into approval_instance( id, apid, user_id, id_number, state) values
<foreach item="item" index="index" collection="list" separator=",">
( #{item.id}, #{item.apid}, #{item.userId}, #{item.idNumber}, #{item.state})
</foreach>
</insert>
<select id="checkExists" resultType="boolean"> <select id="checkExists" resultType="boolean">
SELECT COUNT(1) SELECT COUNT(1)
FROM employment_approval FROM employment_approval
...@@ -374,6 +417,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -374,6 +417,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="serviceCompany != null and serviceCompany != ''"> and service_company = #{serviceCompany}</if> <if test="serviceCompany != null and serviceCompany != ''"> and service_company = #{serviceCompany}</if>
<if test="employmentApprovalState != null and employmentApprovalState != ''"> and employment_approval_state = #{employmentApprovalState}</if> <if test="employmentApprovalState != null and employmentApprovalState != ''"> and employment_approval_state = #{employmentApprovalState}</if>
and is_draft != 1 and is_draft != 1
<if test="empId !=null and empId !=''"> and emp_id = #{empId}</if>
</where> </where>
</select> </select>
...@@ -431,7 +475,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -431,7 +475,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="assetsName != null">assets_name,</if> <if test="assetsName != null">assets_name,</if>
<if test="serviceCompany != null">service_company,</if> <if test="serviceCompany != null">service_company,</if>
<if test="employmentApprovalState != null">employment_approval_state,</if> <if test="employmentApprovalState != null">employment_approval_state,</if>
is_draft is_draft,
<if test="empId !=null and empId !=''">#{empId},</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="name != null">#{name},</if> <if test="name != null">#{name},</if>
...@@ -485,7 +530,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -485,7 +530,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="assetsName != null">#{assetsName},</if> <if test="assetsName != null">#{assetsName},</if>
<if test="serviceCompany != null">#{serviceCompany},</if> <if test="serviceCompany != null">#{serviceCompany},</if>
<if test="employmentApprovalState != null">#{employmentApprovalState},</if> <if test="employmentApprovalState != null">#{employmentApprovalState},</if>
1 0,
<if test="empId !=null and empId !=''">#{empId},</if>
</trim> </trim>
</insert> </insert>
...@@ -545,6 +591,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -545,6 +591,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="serviceCompany != null">service_company = #{serviceCompany},</if> <if test="serviceCompany != null">service_company = #{serviceCompany},</if>
<if test="employmentApprovalState != null">employment_approval_state = #{employmentApprovalState},</if> <if test="employmentApprovalState != null">employment_approval_state = #{employmentApprovalState},</if>
<if test="isDraft != null">is_draft = #{isDraft},</if> <if test="isDraft != null">is_draft = #{isDraft},</if>
<if test="empId !=null and empId !=''">emp_id = #{empId},</if>
</trim> </trim>
where id = #{id} where id = #{id}
</update> </update>
......
...@@ -26,10 +26,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -26,10 +26,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="officialConversionDate" column="official_conversion_date" /> <result property="officialConversionDate" column="official_conversion_date" />
<result property="managerConfirm" column="manager_confirm" /> <result property="managerConfirm" column="manager_confirm" />
<result property="confirmationApprovalState" column="confirmation_approval_state" /> <result property="confirmationApprovalState" column="confirmation_approval_state" />
<result property="currentNode" column="current_node" />
</resultMap> </resultMap>
<sql id="selectApprovalRegularizationVo"> <sql id="selectApprovalRegularizationVo">
select id, achievement_description, self_evaluation, confirmation_materials, name, application_time, work_number, service_depart, position, employment_form, id_number, service_date, proposed_date, formal_salary, trial_period_salary, depart_head, is_pass_period, depart_manager_signature, official_conversion_date, manager_confirm, confirmation_approval_state from approval_regularization select id, achievement_description, self_evaluation, confirmation_materials, name, application_time, work_number, service_depart, position, employment_form, id_number, service_date, proposed_date, formal_salary, trial_period_salary, depart_head, is_pass_period, depart_manager_signature, official_conversion_date, manager_confirm, confirmation_approval_state,current_node from approval_regularization
</sql> </sql>
<select id="selectApprovalRegularizationList" parameterType="ApprovalRegularization" resultMap="ApprovalRegularizationResult"> <select id="selectApprovalRegularizationList" parameterType="ApprovalRegularization" resultMap="ApprovalRegularizationResult">
...@@ -54,8 +55,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -54,8 +55,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="departManagerSignature != null and departManagerSignature != ''"> and depart_manager_signature = #{departManagerSignature}</if> <if test="departManagerSignature != null and departManagerSignature != ''"> and depart_manager_signature = #{departManagerSignature}</if>
<if test="officialConversionDate != null "> and official_conversion_date = #{officialConversionDate}</if> <if test="officialConversionDate != null "> and official_conversion_date = #{officialConversionDate}</if>
<if test="managerConfirm != null "> and manager_confirm = #{managerConfirm}</if> <if test="managerConfirm != null "> and manager_confirm = #{managerConfirm}</if>
<if test="confirmationApprovalState != null "> and confirmation_approval_state = #{confirmationApprovalState}</if> <if test="confirmationApprovalState != null "> and confirmation_approval_state = #{confirmationApprovalState}</if>
<if test="currentNode != null "> and current_node = #{currentNode}</if>
</where> </where>
order by confirmation_approval_state
</select> </select>
<select id="selectApprovalRegularizationById" parameterType="Long" resultMap="ApprovalRegularizationResult"> <select id="selectApprovalRegularizationById" parameterType="Long" resultMap="ApprovalRegularizationResult">
...@@ -85,6 +88,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -85,6 +88,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="departManagerSignature != null">depart_manager_signature,</if> <if test="departManagerSignature != null">depart_manager_signature,</if>
<if test="officialConversionDate != null">official_conversion_date,</if> <if test="officialConversionDate != null">official_conversion_date,</if>
<if test="managerConfirm != null">manager_confirm,</if> <if test="managerConfirm != null">manager_confirm,</if>
current_node,
confirmation_approval_state confirmation_approval_state
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
...@@ -107,6 +111,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -107,6 +111,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="departManagerSignature != null">#{departManagerSignature},</if> <if test="departManagerSignature != null">#{departManagerSignature},</if>
<if test="officialConversionDate != null">#{officialConversionDate},</if> <if test="officialConversionDate != null">#{officialConversionDate},</if>
<if test="managerConfirm != null">#{managerConfirm},</if> <if test="managerConfirm != null">#{managerConfirm},</if>
90,
0 0
</trim> </trim>
</insert> </insert>
...@@ -133,15 +138,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -133,15 +138,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="departManagerSignature != null">depart_manager_signature = #{departManagerSignature},</if> <if test="departManagerSignature != null">depart_manager_signature = #{departManagerSignature},</if>
<if test="officialConversionDate != null">official_conversion_date = #{officialConversionDate},</if> <if test="officialConversionDate != null">official_conversion_date = #{officialConversionDate},</if>
<if test="managerConfirm != null">manager_confirm = #{managerConfirm},</if> <if test="managerConfirm != null">manager_confirm = #{managerConfirm},</if>
<choose> <if test="currentNode != null">current_node = #{currentNode},</if>
<when test="isPassPeriod == 0">confirmation_approval_state = 1,</when> <if test="confirmationApprovalState != null">confirmation_approval_state = #{confirmationApprovalState},</if>
<when test="isPassPeriod == 1">confirmation_approval_state = 2,</when>
<otherwise>confirmation_approval_state = #{confirmationApprovalState},</otherwise>
</choose>
</trim> </trim>
where id = #{id} where id = #{id}
</update> </update>
<update id="updateRegular" parameterType="ApprovalRegularization">
update approval_regularization
set confirmation_approval_state = CASE
WHEN current_node = 92 THEN 2
ELSE 0
END,
current_node = CASE
WHEN current_node = 92 THEN current_node
ELSE current_node + 1
END
where id = #{id}
</update>
<update id="updateRegular2" parameterType="ApprovalRegularization">
update approval_regularization set confirmation_approval_state = 1 where id = #{id}
</update>
<delete id="deleteApprovalRegularizationById" parameterType="Long"> <delete id="deleteApprovalRegularizationById" parameterType="Long">
delete from approval_regularization where id = #{id} delete from approval_regularization where id = #{id}
</delete> </delete>
......
...@@ -32,6 +32,8 @@ ...@@ -32,6 +32,8 @@
<result property="formalResignationDate" column="formal_resignation_date" /> <result property="formalResignationDate" column="formal_resignation_date" />
<result property="managerConfirm" column="manager_confirm" /> <result property="managerConfirm" column="manager_confirm" />
<result property="leaveApprovalState" column="leave_approval_state" /> <result property="leaveApprovalState" column="leave_approval_state" />
<result property="currentNode" column="current_node" />
<result property="managerOpinion" column="manager_opinion" />
</resultMap> </resultMap>
<resultMap id="ResignationApplicationResignationMatterResult" type="ResignationApplication" extends="ResignationApplicationResult"> <resultMap id="ResignationApplicationResignationMatterResult" type="ResignationApplication" extends="ResignationApplicationResult">
...@@ -46,7 +48,7 @@ ...@@ -46,7 +48,7 @@
</resultMap> </resultMap>
<sql id="selectResignationApplicationVo"> <sql id="selectResignationApplicationVo">
select id, name, application_date, work_number, id_number, service_depart, position, employment_form, service_date, depart_head, hr_name, expected_date_resignation, resignation_reason, work_handover_person, handover_date, matter, is_handover, handover_person_confirm, handover_person_signature, resignate_signature, resignate_signature_date, communication_record, depart_head_signature, depart_head_signature_date, formal_resignation_date, manager_confirm, leave_approval_state from resignation_application select id, name, application_date, work_number, id_number, service_depart, position, employment_form, service_date, depart_head, hr_name, expected_date_resignation, resignation_reason, work_handover_person, handover_date, matter, is_handover, handover_person_confirm, handover_person_signature, resignate_signature, resignate_signature_date, communication_record, depart_head_signature, depart_head_signature_date, formal_resignation_date, manager_confirm, leave_approval_state,current_node,manager_opinion from resignation_application
</sql> </sql>
<select id="selectResignationApplicationList" parameterType="ResignationApplication" resultMap="ResignationApplicationResult"> <select id="selectResignationApplicationList" parameterType="ResignationApplication" resultMap="ResignationApplicationResult">
...@@ -78,11 +80,14 @@ ...@@ -78,11 +80,14 @@
<if test="formalResignationDate != null "> and formal_resignation_date = #{formalResignationDate}</if> <if test="formalResignationDate != null "> and formal_resignation_date = #{formalResignationDate}</if>
<if test="managerConfirm != null "> and manager_confirm = #{managerConfirm}</if> <if test="managerConfirm != null "> and manager_confirm = #{managerConfirm}</if>
<if test="leaveApprovalState != null "> and leave_approval_state = #{leaveApprovalState}</if> <if test="leaveApprovalState != null "> and leave_approval_state = #{leaveApprovalState}</if>
<if test="currentNode != null "> and current_node = #{currentNode}</if>
<if test="managerOpinion != null "> and manager_opinion = #{managerOpinion}</if>
</where> </where>
order by leave_approval_state
</select> </select>
<select id="selectResignationApplicationById" parameterType="Long" resultMap="ResignationApplicationResignationMatterResult"> <select id="selectResignationApplicationById" parameterType="Long" resultMap="ResignationApplicationResignationMatterResult">
select id, name, application_date, work_number, id_number, service_depart, position, employment_form, service_date, depart_head, hr_name, expected_date_resignation, resignation_reason, work_handover_person, handover_date, matter, is_handover, handover_person_confirm, handover_person_signature, resignate_signature, resignate_signature_date, communication_record, depart_head_signature, depart_head_signature_date, formal_resignation_date, manager_confirm, leave_approval_state select id, name, application_date, work_number, id_number, service_depart, position, employment_form, service_date, depart_head, hr_name, expected_date_resignation, resignation_reason, work_handover_person, handover_date, matter, is_handover, handover_person_confirm, handover_person_signature, resignate_signature, resignate_signature_date, communication_record, depart_head_signature, depart_head_signature_date, formal_resignation_date, manager_confirm, leave_approval_state,current_node,manager_opinion
from resignation_application from resignation_application
where id = #{id} where id = #{id}
</select> </select>
...@@ -121,7 +126,9 @@ ...@@ -121,7 +126,9 @@
<if test="departHeadSignatureDate != null">depart_head_signature_date,</if> <if test="departHeadSignatureDate != null">depart_head_signature_date,</if>
<if test="formalResignationDate != null">formal_resignation_date,</if> <if test="formalResignationDate != null">formal_resignation_date,</if>
<if test="managerConfirm != null">manager_confirm,</if> <if test="managerConfirm != null">manager_confirm,</if>
<if test="leaveApprovalState != null">leave_approval_state,</if> leave_approval_state,
current_node
<if test="managerOpinion != null">,manager_opinion</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="name != null">#{name},</if> <if test="name != null">#{name},</if>
...@@ -149,7 +156,9 @@ ...@@ -149,7 +156,9 @@
<if test="departHeadSignatureDate != null">#{departHeadSignatureDate},</if> <if test="departHeadSignatureDate != null">#{departHeadSignatureDate},</if>
<if test="formalResignationDate != null">#{formalResignationDate},</if> <if test="formalResignationDate != null">#{formalResignationDate},</if>
<if test="managerConfirm != null">#{managerConfirm},</if> <if test="managerConfirm != null">#{managerConfirm},</if>
<if test="leaveApprovalState != null">#{leaveApprovalState},</if> 0,
107
<if test="managerOpinion != null">#{managerOpinion}</if>
</trim> </trim>
</insert> </insert>
...@@ -182,10 +191,30 @@ ...@@ -182,10 +191,30 @@
<if test="formalResignationDate != null">formal_resignation_date = #{formalResignationDate},</if> <if test="formalResignationDate != null">formal_resignation_date = #{formalResignationDate},</if>
<if test="managerConfirm != null">manager_confirm = #{managerConfirm},</if> <if test="managerConfirm != null">manager_confirm = #{managerConfirm},</if>
<if test="leaveApprovalState != null">leave_approval_state = #{leaveApprovalState},</if> <if test="leaveApprovalState != null">leave_approval_state = #{leaveApprovalState},</if>
<if test="currentNode != null">current_node = #{currentNode},</if>
<if test="managerOpinion != null">manager_opinion = #{managerOpinion},</if>
</trim> </trim>
where id = #{id} where id = #{id}
</update> </update>
<update id="updateResignation" parameterType="ResignationApplication">
update resignation_application
set leave_approval_state = CASE
WHEN current_node = 109 THEN 2
ELSE 0
END,
current_node = CASE
WHEN current_node = 109 THEN current_node
ELSE current_node + 1
END
where id = #{id}
</update>
<update id="updateResignation2" parameterType="ResignationApplication">
update resignation_application set leave_approval_state = 1 where id = #{id}
</update>
<delete id="deleteResignationApplicationById" parameterType="Long"> <delete id="deleteResignationApplicationById" parameterType="Long">
delete from resignation_application where id = #{id} delete from resignation_application where id = #{id}
</delete> </delete>
......
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