|
@@ -351,10 +351,11 @@ public class TStaffmgrController extends BaseController
|
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('plant:staffmgr:list')")
|
|
|
@GetMapping("/leftList")
|
|
|
- public List<TStaffmgr> leftList(TStaffmgr tStaffmgr)
|
|
|
+ public TableDataInfo leftList(TStaffmgr tStaffmgr)
|
|
|
{
|
|
|
+ startPage();
|
|
|
List<TStaffmgr> list = tStaffmgrService.selectLeftTStaffmgrList(tStaffmgr);
|
|
|
- return list;
|
|
|
+ return getDataTable(list);
|
|
|
}
|
|
|
|
|
|
//学历统计
|
|
@@ -477,6 +478,12 @@ public class TStaffmgrController extends BaseController
|
|
|
@PostMapping
|
|
|
public AjaxResult add(@RequestBody TStaffmgr tStaffmgr)
|
|
|
{
|
|
|
+ //判断是否重复员工
|
|
|
+ TStaffmgr tStaffmgr1 = tStaffmgrMapper.selectTStaffmgrByStaffId(tStaffmgr.getStaffid());
|
|
|
+ if (tStaffmgr1 != null) {
|
|
|
+ return AjaxResult.error("员工号已存在");
|
|
|
+ }
|
|
|
+
|
|
|
int insertResult = tStaffmgrService.insertTStaffmgr(tStaffmgr);
|
|
|
tStaffmgr.setCreaterCode(getUserId().toString());
|
|
|
if (tStaffmgr.getUnit().equals("10") || tStaffmgr.getUnit().equals("18")|| tStaffmgr.getUnit().equals("20")|| tStaffmgr.getUnit().equals("30")) {
|
|
@@ -545,6 +552,13 @@ public class TStaffmgrController extends BaseController
|
|
|
@PutMapping
|
|
|
public AjaxResult edit(@RequestBody TStaffmgr tStaffmgr)
|
|
|
{
|
|
|
+ //判断是否重复员工
|
|
|
+ TStaffmgr tStaffmgr1 = tStaffmgrMapper.selectTStaffmgrByStaffId(tStaffmgr.getStaffid());
|
|
|
+ if (tStaffmgr1 != null) {
|
|
|
+ if (tStaffmgr1.getId()!= tStaffmgr.getId()) {
|
|
|
+ return AjaxResult.error("员工号已存在");
|
|
|
+ }
|
|
|
+ }
|
|
|
tStaffmgr.setPhoto(null);
|
|
|
tStaffmgr.setUpdaterCode(getUserId().toString());
|
|
|
tStaffmgr.setUpdatedate(new Date());
|