|
@@ -1,5 +1,6 @@
|
|
|
package com.ruoyi.project.production.controller;
|
|
|
|
|
|
+import com.ruoyi.common.utils.StringUtils;
|
|
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
|
import com.ruoyi.framework.aspectj.lang.annotation.Log;
|
|
|
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
|
|
@@ -10,10 +11,10 @@ import com.ruoyi.project.plant.domain.TStaffmgr;
|
|
|
import com.ruoyi.project.plant.service.ITStaffmgrService;
|
|
|
import com.ruoyi.project.production.domain.TPpePerson;
|
|
|
import com.ruoyi.project.production.service.ITPpePersonService;
|
|
|
+import com.ruoyi.project.system.domain.SysUser;
|
|
|
import com.ruoyi.project.system.service.ISysUserService;
|
|
|
import com.ruoyi.project.training.domain.TWorklicense;
|
|
|
import com.ruoyi.project.training.service.ITWorklicenseService;
|
|
|
-import org.apache.commons.collections4.CollectionUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
@@ -91,7 +92,6 @@ public class TPpePersonController extends BaseController {
|
|
|
@PostMapping
|
|
|
public AjaxResult add(@RequestBody TPpePerson tPpePerson) {
|
|
|
TStaffmgr tStaffmgr = new TStaffmgr();
|
|
|
- tStaffmgr.setActualpost("36");
|
|
|
tStaffmgr.setTeam("18");
|
|
|
for (TStaffmgr staffmgr : tStaffmgrService.selectTStaffmgrList(tStaffmgr)) {
|
|
|
TPpePerson person = new TPpePerson();
|
|
@@ -105,7 +105,11 @@ public class TPpePersonController extends BaseController {
|
|
|
person.setHotarea("0");
|
|
|
person.setColdarea("0");
|
|
|
person.setDeptId(staffmgr.getDeptId());
|
|
|
- person.setOperator("1");
|
|
|
+ if ("36".equals(staffmgr.getActualpost())) {
|
|
|
+ person.setOperator("1");
|
|
|
+ } else {
|
|
|
+ person.setOperator("0");
|
|
|
+ }
|
|
|
insertOrUpdate(person);
|
|
|
}
|
|
|
for (TWorklicense tWorklicense : tWorklicenseService.selectTWorklicenseList(new TWorklicense())) {
|
|
@@ -134,12 +138,12 @@ public class TPpePersonController extends BaseController {
|
|
|
|
|
|
private void insertOrUpdate(TPpePerson person) {
|
|
|
TPpePerson ppePerson = tPpePersonService.selectTPpePersonByEmployeeid(person.getEmployeeid());
|
|
|
- if ( ppePerson!= null) {
|
|
|
+ if (ppePerson != null) {
|
|
|
person.setId(ppePerson.getId());
|
|
|
person.setUpdatedate(new Date());
|
|
|
person.setUpdaterCode(getUserId().toString());
|
|
|
tPpePersonService.updateTPpePerson(person);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
person.setCreaterCode(getUserId().toString());
|
|
|
person.setCreatedate(new Date());
|
|
|
tPpePersonService.insertTPpePerson(person);
|