|
@@ -11,7 +11,6 @@ import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
|
|
|
import com.ruoyi.framework.config.RuoYiConfig;
|
|
import com.ruoyi.framework.config.RuoYiConfig;
|
|
|
import com.ruoyi.framework.web.controller.BaseController;
|
|
import com.ruoyi.framework.web.controller.BaseController;
|
|
|
import com.ruoyi.framework.web.domain.AjaxResult;
|
|
import com.ruoyi.framework.web.domain.AjaxResult;
|
|
|
-import com.ruoyi.framework.web.domain.BaseEntity;
|
|
|
|
|
import com.ruoyi.framework.web.page.TableDataInfo;
|
|
import com.ruoyi.framework.web.page.TableDataInfo;
|
|
|
import com.ruoyi.project.common.domain.DataEntity;
|
|
import com.ruoyi.project.common.domain.DataEntity;
|
|
|
import com.ruoyi.project.plant.domain.TStaffmgr;
|
|
import com.ruoyi.project.plant.domain.TStaffmgr;
|
|
@@ -53,8 +52,7 @@ import java.util.concurrent.Executors;
|
|
|
*/
|
|
*/
|
|
|
@RestController
|
|
@RestController
|
|
|
@RequestMapping("/plant/staffmgr")
|
|
@RequestMapping("/plant/staffmgr")
|
|
|
-public class TStaffmgrController extends BaseController
|
|
|
|
|
-{
|
|
|
|
|
|
|
+public class TStaffmgrController extends BaseController {
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private ITStaffmgrService tStaffmgrService;
|
|
private ITStaffmgrService tStaffmgrService;
|
|
|
|
|
|
|
@@ -102,8 +100,7 @@ public class TStaffmgrController extends BaseController
|
|
|
*/
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('plant:staffmgr:list')")
|
|
@PreAuthorize("@ss.hasPermi('plant:staffmgr:list')")
|
|
|
@GetMapping("/listSaiExecutors")
|
|
@GetMapping("/listSaiExecutors")
|
|
|
- public AjaxResult listSaiExecutors()
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ public AjaxResult listSaiExecutors() {
|
|
|
return AjaxResult.success(tStaffmgrService.selectSaiExecutors());
|
|
return AjaxResult.success(tStaffmgrService.selectSaiExecutors());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -112,8 +109,7 @@ public class TStaffmgrController extends BaseController
|
|
|
*/
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('plant:staffmgr:list')")
|
|
@PreAuthorize("@ss.hasPermi('plant:staffmgr:list')")
|
|
|
@GetMapping("/listSaiInspectors")
|
|
@GetMapping("/listSaiInspectors")
|
|
|
- public AjaxResult listSaiInspectors()
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ public AjaxResult listSaiInspectors() {
|
|
|
return AjaxResult.success(tStaffmgrService.selectSaiInspectors());
|
|
return AjaxResult.success(tStaffmgrService.selectSaiInspectors());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -122,15 +118,14 @@ public class TStaffmgrController extends BaseController
|
|
|
*/
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('plant:staffmgr:query')")
|
|
@PreAuthorize("@ss.hasPermi('plant:staffmgr:query')")
|
|
|
@GetMapping(value = "/loginStaffInfo")
|
|
@GetMapping(value = "/loginStaffInfo")
|
|
|
- public AjaxResult getLoginStaffInfo()
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ public AjaxResult getLoginStaffInfo() {
|
|
|
Long userId = getUserId();
|
|
Long userId = getUserId();
|
|
|
SysUser sysUser = sysUserService.selectUserById(userId);
|
|
SysUser sysUser = sysUserService.selectUserById(userId);
|
|
|
String staffId = sysUser.getStaffId();
|
|
String staffId = sysUser.getStaffId();
|
|
|
TStaffmgr staffmgr = tStaffmgrService.selectTStaffmgrByStaffId(staffId);
|
|
TStaffmgr staffmgr = tStaffmgrService.selectTStaffmgrByStaffId(staffId);
|
|
|
if (staffmgr != null) {
|
|
if (staffmgr != null) {
|
|
|
staffmgr.setUserId(userId.toString());
|
|
staffmgr.setUserId(userId.toString());
|
|
|
- if (staffmgr.getActualpost().contains("14")||staffmgr.getActualpost().contains("12")){
|
|
|
|
|
|
|
+ if (staffmgr.getActualpost().contains("14") || staffmgr.getActualpost().contains("12")) {
|
|
|
staffmgr.setChecker(true);
|
|
staffmgr.setChecker(true);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -139,12 +134,12 @@ public class TStaffmgrController extends BaseController
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 获取当前用户id
|
|
* 获取当前用户id
|
|
|
|
|
+ *
|
|
|
* @return 当前用户id
|
|
* @return 当前用户id
|
|
|
*/
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('plant:staffmgr:query')")
|
|
@PreAuthorize("@ss.hasPermi('plant:staffmgr:query')")
|
|
|
@GetMapping("/getStaffId")
|
|
@GetMapping("/getStaffId")
|
|
|
- public AjaxResult getStaffId()
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ public AjaxResult getStaffId() {
|
|
|
Long userId = getUserId();
|
|
Long userId = getUserId();
|
|
|
SysUser sysUser = sysUserService.selectUserById(userId);
|
|
SysUser sysUser = sysUserService.selectUserById(userId);
|
|
|
String staffId = sysUser.getStaffId();
|
|
String staffId = sysUser.getStaffId();
|
|
@@ -153,12 +148,12 @@ public class TStaffmgrController extends BaseController
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 判断当前用户是否为导师
|
|
* 判断当前用户是否为导师
|
|
|
|
|
+ *
|
|
|
* @return 是否为导师
|
|
* @return 是否为导师
|
|
|
*/
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('plant:staffmgr:query')")
|
|
@PreAuthorize("@ss.hasPermi('plant:staffmgr:query')")
|
|
|
@GetMapping("/isMentor")
|
|
@GetMapping("/isMentor")
|
|
|
- public AjaxResult isMentor()
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ public AjaxResult isMentor() {
|
|
|
// 是否为导师
|
|
// 是否为导师
|
|
|
boolean isMentor = false;
|
|
boolean isMentor = false;
|
|
|
ServletUtils.getParameter("sexs");
|
|
ServletUtils.getParameter("sexs");
|
|
@@ -182,8 +177,7 @@ public class TStaffmgrController extends BaseController
|
|
|
*/
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('plant:staffmgr:list')")
|
|
@PreAuthorize("@ss.hasPermi('plant:staffmgr:list')")
|
|
|
@GetMapping("/listMentors")
|
|
@GetMapping("/listMentors")
|
|
|
- public AjaxResult listMentors(TStaffmgr tStaffmgr)
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ public AjaxResult listMentors(TStaffmgr tStaffmgr) {
|
|
|
ServletUtils.getParameter("sexs");
|
|
ServletUtils.getParameter("sexs");
|
|
|
return AjaxResult.success(tStaffmgrService.selectMentorList(tStaffmgr));
|
|
return AjaxResult.success(tStaffmgrService.selectMentorList(tStaffmgr));
|
|
|
}
|
|
}
|
|
@@ -192,8 +186,7 @@ public class TStaffmgrController extends BaseController
|
|
|
* 查询人员管理列表--包含离职人员
|
|
* 查询人员管理列表--包含离职人员
|
|
|
*/
|
|
*/
|
|
|
@GetMapping("/listAll")
|
|
@GetMapping("/listAll")
|
|
|
- public TableDataInfo listAll(TStaffmgr tStaffmgr)
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ public TableDataInfo listAll(TStaffmgr tStaffmgr) {
|
|
|
ServletUtils.getParameter("sexs");
|
|
ServletUtils.getParameter("sexs");
|
|
|
startPage();
|
|
startPage();
|
|
|
logger.info("staffmgr:" + tStaffmgr);
|
|
logger.info("staffmgr:" + tStaffmgr);
|
|
@@ -206,8 +199,7 @@ public class TStaffmgrController extends BaseController
|
|
|
*/
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('plant:staffmgr:list')")
|
|
@PreAuthorize("@ss.hasPermi('plant:staffmgr:list')")
|
|
|
@GetMapping("/list")
|
|
@GetMapping("/list")
|
|
|
- public TableDataInfo list(TStaffmgr tStaffmgr)
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ public TableDataInfo list(TStaffmgr tStaffmgr) {
|
|
|
ServletUtils.getParameter("sexs");
|
|
ServletUtils.getParameter("sexs");
|
|
|
startPage();
|
|
startPage();
|
|
|
logger.info("staffmgr:" + tStaffmgr);
|
|
logger.info("staffmgr:" + tStaffmgr);
|
|
@@ -215,12 +207,31 @@ public class TStaffmgrController extends BaseController
|
|
|
return getDataTable(list);
|
|
return getDataTable(list);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @PreAuthorize("@ss.hasPermi('plant:staffmgr:list')")
|
|
|
|
|
+ @GetMapping("/averageAge")
|
|
|
|
|
+ public AjaxResult averageAge(TStaffmgr tStaffmgr) {
|
|
|
|
|
+ int sumAge = 0;
|
|
|
|
|
+ Calendar calendar = Calendar.getInstance();
|
|
|
|
|
+ List<TStaffmgr> tStaffmgrs = tStaffmgrService.selectTStaffmgrList(tStaffmgr);
|
|
|
|
|
+ for (TStaffmgr staffmgr : tStaffmgrs) {
|
|
|
|
|
+ if (staffmgr.getBirthday() != null) {
|
|
|
|
|
+ calendar.setTime(staffmgr.getBirthday());
|
|
|
|
|
+ int birthYear = calendar.get(Calendar.YEAR);
|
|
|
|
|
+ calendar.setTime(new Date());
|
|
|
|
|
+ int currentYear = calendar.get(Calendar.YEAR);
|
|
|
|
|
+ sumAge += (currentYear - birthYear);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ int result = sumAge / tStaffmgrs.size();
|
|
|
|
|
+ return AjaxResult.success(result);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 通过部门查询人员列表
|
|
* 通过部门查询人员列表
|
|
|
*/
|
|
*/
|
|
|
@GetMapping("/listByDeptAndTeam")
|
|
@GetMapping("/listByDeptAndTeam")
|
|
|
- public TableDataInfo listByDeptAndTeam(TStaffmgr tStaffmgr)
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ public TableDataInfo listByDeptAndTeam(TStaffmgr tStaffmgr) {
|
|
|
startPage();
|
|
startPage();
|
|
|
List<TStaffmgr> list = tStaffmgrService.selectTStaffmgrListByDeptAndTeam(tStaffmgr);
|
|
List<TStaffmgr> list = tStaffmgrService.selectTStaffmgrListByDeptAndTeam(tStaffmgr);
|
|
|
return getDataTable(list);
|
|
return getDataTable(list);
|
|
@@ -231,8 +242,7 @@ public class TStaffmgrController extends BaseController
|
|
|
*/
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('plant:staffmgr:list')")
|
|
@PreAuthorize("@ss.hasPermi('plant:staffmgr:list')")
|
|
|
@GetMapping("/getAllList")
|
|
@GetMapping("/getAllList")
|
|
|
- public TableDataInfo getAllList(TStaffmgr tStaffmgr)
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ public TableDataInfo getAllList(TStaffmgr tStaffmgr) {
|
|
|
ServletUtils.getParameter("sexs");
|
|
ServletUtils.getParameter("sexs");
|
|
|
startPage();
|
|
startPage();
|
|
|
logger.info("staffmgr:" + tStaffmgr);
|
|
logger.info("staffmgr:" + tStaffmgr);
|
|
@@ -243,7 +253,7 @@ public class TStaffmgrController extends BaseController
|
|
|
Iterator<TStaffmgr> iterator = list.iterator();
|
|
Iterator<TStaffmgr> iterator = list.iterator();
|
|
|
while (iterator.hasNext()) {
|
|
while (iterator.hasNext()) {
|
|
|
TStaffmgr t = iterator.next();
|
|
TStaffmgr t = iterator.next();
|
|
|
- if (t.getLeftDate() != null && t.getDelFlag() == 9){
|
|
|
|
|
|
|
+ if (t.getLeftDate() != null && t.getDelFlag() == 9) {
|
|
|
Calendar cal = Calendar.getInstance();
|
|
Calendar cal = Calendar.getInstance();
|
|
|
cal.setTime(t.getLeftDate());
|
|
cal.setTime(t.getLeftDate());
|
|
|
Integer year = cal.get(Calendar.YEAR);//获取年
|
|
Integer year = cal.get(Calendar.YEAR);//获取年
|
|
@@ -254,7 +264,7 @@ public class TStaffmgrController extends BaseController
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- }catch (Exception e) {
|
|
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
logger.error(e.toString());
|
|
logger.error(e.toString());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -267,8 +277,7 @@ public class TStaffmgrController extends BaseController
|
|
|
*/
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('plant:staffmgr:list')")
|
|
@PreAuthorize("@ss.hasPermi('plant:staffmgr:list')")
|
|
|
@GetMapping("/selectTime")
|
|
@GetMapping("/selectTime")
|
|
|
- public TableDataInfo selectTime(TStaffmgr tStaffmgr)
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ public TableDataInfo selectTime(TStaffmgr tStaffmgr) {
|
|
|
startPage();
|
|
startPage();
|
|
|
List<TStaffmgr> list = tStaffmgrService.selectRecordList(tStaffmgr);
|
|
List<TStaffmgr> list = tStaffmgrService.selectRecordList(tStaffmgr);
|
|
|
try {
|
|
try {
|
|
@@ -277,7 +286,7 @@ public class TStaffmgrController extends BaseController
|
|
|
Iterator<TStaffmgr> iterator = list.iterator();
|
|
Iterator<TStaffmgr> iterator = list.iterator();
|
|
|
while (iterator.hasNext()) {
|
|
while (iterator.hasNext()) {
|
|
|
TStaffmgr t = iterator.next();
|
|
TStaffmgr t = iterator.next();
|
|
|
- if (t.getLeftDate() != null && t.getDelFlag() == 9){
|
|
|
|
|
|
|
+ if (t.getLeftDate() != null && t.getDelFlag() == 9) {
|
|
|
Calendar cal = Calendar.getInstance();
|
|
Calendar cal = Calendar.getInstance();
|
|
|
cal.setTime(t.getLeftDate());
|
|
cal.setTime(t.getLeftDate());
|
|
|
Integer year = cal.get(Calendar.YEAR);//获取年
|
|
Integer year = cal.get(Calendar.YEAR);//获取年
|
|
@@ -288,7 +297,7 @@ public class TStaffmgrController extends BaseController
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- }catch (Exception e) {
|
|
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
logger.error(e.toString());
|
|
logger.error(e.toString());
|
|
|
}
|
|
}
|
|
|
logger.info("selectTime:" + list.size());
|
|
logger.info("selectTime:" + list.size());
|
|
@@ -310,8 +319,8 @@ public class TStaffmgrController extends BaseController
|
|
|
if (t.getTrainingDuration() != null) {
|
|
if (t.getTrainingDuration() != null) {
|
|
|
try {
|
|
try {
|
|
|
time = time + Double.parseDouble(t.getTrainingDuration());
|
|
time = time + Double.parseDouble(t.getTrainingDuration());
|
|
|
- }catch (Exception e) {
|
|
|
|
|
- logger.error("转double出错",JSON.toJSONString(e));
|
|
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ logger.error("转double出错", JSON.toJSONString(e));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|
|
@@ -320,7 +329,7 @@ public class TStaffmgrController extends BaseController
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
list.get(finalI).setTrainingTime(String.valueOf(time));
|
|
list.get(finalI).setTrainingTime(String.valueOf(time));
|
|
|
- }finally {
|
|
|
|
|
|
|
+ } finally {
|
|
|
latch.countDown(); //线程计数
|
|
latch.countDown(); //线程计数
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
@@ -336,12 +345,12 @@ public class TStaffmgrController extends BaseController
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 查询人员管理列表
|
|
* 查询人员管理列表
|
|
|
|
|
+ *
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('plant:staffmgr:list')")
|
|
@PreAuthorize("@ss.hasPermi('plant:staffmgr:list')")
|
|
|
@GetMapping("/ogzList")
|
|
@GetMapping("/ogzList")
|
|
|
- public List<TStaffmgr> ogzList(TStaffmgr tStaffmgr)
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ public List<TStaffmgr> ogzList(TStaffmgr tStaffmgr) {
|
|
|
List<TStaffmgr> list = tStaffmgrService.selectTStaffmgrList(tStaffmgr);
|
|
List<TStaffmgr> list = tStaffmgrService.selectTStaffmgrList(tStaffmgr);
|
|
|
return list;
|
|
return list;
|
|
|
}
|
|
}
|
|
@@ -351,8 +360,7 @@ public class TStaffmgrController extends BaseController
|
|
|
*/
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('plant:staffmgr:list')")
|
|
@PreAuthorize("@ss.hasPermi('plant:staffmgr:list')")
|
|
|
@GetMapping("/pIdList")
|
|
@GetMapping("/pIdList")
|
|
|
- public AjaxResult pIdList(TStaffmgr tStaffmgr)
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ public AjaxResult pIdList(TStaffmgr tStaffmgr) {
|
|
|
List<TStaffmgr> list = tStaffmgrService.selectTStaffmgrList(tStaffmgr);
|
|
List<TStaffmgr> list = tStaffmgrService.selectTStaffmgrList(tStaffmgr);
|
|
|
return AjaxResult.success(list);
|
|
return AjaxResult.success(list);
|
|
|
}
|
|
}
|
|
@@ -362,8 +370,7 @@ public class TStaffmgrController extends BaseController
|
|
|
*/
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('plant:staffmgr:list')")
|
|
@PreAuthorize("@ss.hasPermi('plant:staffmgr:list')")
|
|
|
@GetMapping("/leftList")
|
|
@GetMapping("/leftList")
|
|
|
- public TableDataInfo leftList(TStaffmgr tStaffmgr)
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ public TableDataInfo leftList(TStaffmgr tStaffmgr) {
|
|
|
startPage();
|
|
startPage();
|
|
|
List<TStaffmgr> list = tStaffmgrService.selectLeftTStaffmgrList(tStaffmgr);
|
|
List<TStaffmgr> list = tStaffmgrService.selectLeftTStaffmgrList(tStaffmgr);
|
|
|
return getDataTable(list);
|
|
return getDataTable(list);
|
|
@@ -371,19 +378,18 @@ public class TStaffmgrController extends BaseController
|
|
|
|
|
|
|
|
//学历统计
|
|
//学历统计
|
|
|
@GetMapping("/eduData")
|
|
@GetMapping("/eduData")
|
|
|
- public List<DataEntity> eduData(TStaffmgr param)
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ public List<DataEntity> eduData(TStaffmgr param) {
|
|
|
List<DataEntity> list = tStaffmgrMapper.selectEduData(param);
|
|
List<DataEntity> list = tStaffmgrMapper.selectEduData(param);
|
|
|
List<SysDictData> education = iSysDictTypeService.selectDictDataByType("EDUCATION");
|
|
List<SysDictData> education = iSysDictTypeService.selectDictDataByType("EDUCATION");
|
|
|
- for (DataEntity d: list
|
|
|
|
|
- ) {
|
|
|
|
|
- for (SysDictData s: education
|
|
|
|
|
- ) {
|
|
|
|
|
- if (StringUtils.isBlank(d.getDataName())){
|
|
|
|
|
|
|
+ for (DataEntity d : list
|
|
|
|
|
+ ) {
|
|
|
|
|
+ for (SysDictData s : education
|
|
|
|
|
+ ) {
|
|
|
|
|
+ if (StringUtils.isBlank(d.getDataName())) {
|
|
|
d.setDataName("未知");
|
|
d.setDataName("未知");
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
- if (s.getDictValue().equals(d.getDataName())){
|
|
|
|
|
|
|
+ if (s.getDictValue().equals(d.getDataName())) {
|
|
|
d.setDataName(s.getDictLabel());
|
|
d.setDataName(s.getDictLabel());
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
@@ -394,19 +400,18 @@ public class TStaffmgrController extends BaseController
|
|
|
|
|
|
|
|
//年龄统计
|
|
//年龄统计
|
|
|
@GetMapping("/ageData")
|
|
@GetMapping("/ageData")
|
|
|
- public List<DataEntity> ageData(TStaffmgr param)
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ public List<DataEntity> ageData(TStaffmgr param) {
|
|
|
List<DataEntity> list = tStaffmgrMapper.selectAgeData(param);
|
|
List<DataEntity> list = tStaffmgrMapper.selectAgeData(param);
|
|
|
List<SysDictData> education = iSysDictTypeService.selectDictDataByType("EDUCATION");
|
|
List<SysDictData> education = iSysDictTypeService.selectDictDataByType("EDUCATION");
|
|
|
- for (DataEntity d: list
|
|
|
|
|
|
|
+ for (DataEntity d : list
|
|
|
) {
|
|
) {
|
|
|
- for (SysDictData s: education
|
|
|
|
|
|
|
+ for (SysDictData s : education
|
|
|
) {
|
|
) {
|
|
|
- if (StringUtils.isBlank(d.getDataName())){
|
|
|
|
|
|
|
+ if (StringUtils.isBlank(d.getDataName())) {
|
|
|
d.setDataName("未知");
|
|
d.setDataName("未知");
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
- if (s.getDictValue().equals(d.getDataName())){
|
|
|
|
|
|
|
+ if (s.getDictValue().equals(d.getDataName())) {
|
|
|
d.setDataName(s.getDictLabel());
|
|
d.setDataName(s.getDictLabel());
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
@@ -417,19 +422,18 @@ public class TStaffmgrController extends BaseController
|
|
|
|
|
|
|
|
//英语统计
|
|
//英语统计
|
|
|
@GetMapping("/engData")
|
|
@GetMapping("/engData")
|
|
|
- public List<DataEntity> engData(TStaffmgr param)
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ public List<DataEntity> engData(TStaffmgr param) {
|
|
|
List<DataEntity> list = tStaffmgrMapper.selectEngData(param);
|
|
List<DataEntity> list = tStaffmgrMapper.selectEngData(param);
|
|
|
List<SysDictData> englishability = iSysDictTypeService.selectDictDataByType("ENGLISHABILITY");
|
|
List<SysDictData> englishability = iSysDictTypeService.selectDictDataByType("ENGLISHABILITY");
|
|
|
- for (DataEntity d: list
|
|
|
|
|
|
|
+ for (DataEntity d : list
|
|
|
) {
|
|
) {
|
|
|
- for (SysDictData s: englishability
|
|
|
|
|
|
|
+ for (SysDictData s : englishability
|
|
|
) {
|
|
) {
|
|
|
- if (StringUtils.isBlank(d.getDataName())){
|
|
|
|
|
|
|
+ if (StringUtils.isBlank(d.getDataName())) {
|
|
|
d.setDataName("未知");
|
|
d.setDataName("未知");
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
- if (s.getDictValue().equals(d.getDataName())){
|
|
|
|
|
|
|
+ if (s.getDictValue().equals(d.getDataName())) {
|
|
|
d.setDataName(s.getDictLabel());
|
|
d.setDataName(s.getDictLabel());
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
@@ -440,19 +444,18 @@ public class TStaffmgrController extends BaseController
|
|
|
|
|
|
|
|
//班值统计
|
|
//班值统计
|
|
|
@GetMapping("/teamData")
|
|
@GetMapping("/teamData")
|
|
|
- public List<DataEntity> teamData(TStaffmgr param)
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ public List<DataEntity> teamData(TStaffmgr param) {
|
|
|
List<DataEntity> list = tStaffmgrMapper.selectTeamData(param);
|
|
List<DataEntity> list = tStaffmgrMapper.selectTeamData(param);
|
|
|
List<SysDictData> englishability = iSysDictTypeService.selectDictDataByType("TEAM_DIVIDE");
|
|
List<SysDictData> englishability = iSysDictTypeService.selectDictDataByType("TEAM_DIVIDE");
|
|
|
- for (DataEntity d: list
|
|
|
|
|
|
|
+ for (DataEntity d : list
|
|
|
) {
|
|
) {
|
|
|
- for (SysDictData s: englishability
|
|
|
|
|
|
|
+ for (SysDictData s : englishability
|
|
|
) {
|
|
) {
|
|
|
- if (StringUtils.isBlank(d.getDataName())){
|
|
|
|
|
|
|
+ if (StringUtils.isBlank(d.getDataName())) {
|
|
|
d.setDataName("未知");
|
|
d.setDataName("未知");
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
- if (s.getDictValue().equals(d.getDataName())){
|
|
|
|
|
|
|
+ if (s.getDictValue().equals(d.getDataName())) {
|
|
|
d.setDataName(s.getDictLabel());
|
|
d.setDataName(s.getDictLabel());
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
@@ -467,8 +470,7 @@ public class TStaffmgrController extends BaseController
|
|
|
@PreAuthorize("@ss.hasPermi('plant:staffmgr:export')")
|
|
@PreAuthorize("@ss.hasPermi('plant:staffmgr:export')")
|
|
|
@Log(title = "人员管理", businessType = BusinessType.EXPORT)
|
|
@Log(title = "人员管理", businessType = BusinessType.EXPORT)
|
|
|
@GetMapping("/export")
|
|
@GetMapping("/export")
|
|
|
- public AjaxResult export(TStaffmgr tStaffmgr)
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ public AjaxResult export(TStaffmgr tStaffmgr) {
|
|
|
List<TStaffmgr> list = tStaffmgrService.selectTStaffmgrList(tStaffmgr);
|
|
List<TStaffmgr> list = tStaffmgrService.selectTStaffmgrList(tStaffmgr);
|
|
|
ExcelUtil<TStaffmgr> util = new ExcelUtil<TStaffmgr>(TStaffmgr.class);
|
|
ExcelUtil<TStaffmgr> util = new ExcelUtil<TStaffmgr>(TStaffmgr.class);
|
|
|
return util.exportExcel(list, "staffmgr");
|
|
return util.exportExcel(list, "staffmgr");
|
|
@@ -479,8 +481,7 @@ public class TStaffmgrController extends BaseController
|
|
|
*/
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('plant:staffmgr:query')")
|
|
@PreAuthorize("@ss.hasPermi('plant:staffmgr:query')")
|
|
|
@GetMapping(value = "/{id}")
|
|
@GetMapping(value = "/{id}")
|
|
|
- public AjaxResult getInfo(@PathVariable("id") Long id)
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ public AjaxResult getInfo(@PathVariable("id") Long id) {
|
|
|
TStaffmgr staffmgr = tStaffmgrService.selectTStaffmgrById(id);
|
|
TStaffmgr staffmgr = tStaffmgrService.selectTStaffmgrById(id);
|
|
|
return AjaxResult.success(staffmgr);
|
|
return AjaxResult.success(staffmgr);
|
|
|
}
|
|
}
|
|
@@ -490,10 +491,9 @@ public class TStaffmgrController extends BaseController
|
|
|
*/
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('plant:staffmgr:query')")
|
|
@PreAuthorize("@ss.hasPermi('plant:staffmgr:query')")
|
|
|
@GetMapping("/byStaffId/{staffIds}")
|
|
@GetMapping("/byStaffId/{staffIds}")
|
|
|
- public AjaxResult byStaffId(@PathVariable String[] staffIds)
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ public AjaxResult byStaffId(@PathVariable String[] staffIds) {
|
|
|
List<TStaffmgr> staffmgrs = new ArrayList<TStaffmgr>();
|
|
List<TStaffmgr> staffmgrs = new ArrayList<TStaffmgr>();
|
|
|
- for (int i = 0; i <staffIds.length ; i++) {
|
|
|
|
|
|
|
+ for (int i = 0; i < staffIds.length; i++) {
|
|
|
TStaffmgr staffmgr = tStaffmgrService.selectTStaffmgrByStaffId(staffIds[i]);
|
|
TStaffmgr staffmgr = tStaffmgrService.selectTStaffmgrByStaffId(staffIds[i]);
|
|
|
staffmgrs.add(staffmgr);
|
|
staffmgrs.add(staffmgr);
|
|
|
}
|
|
}
|
|
@@ -506,8 +506,7 @@ public class TStaffmgrController extends BaseController
|
|
|
@PreAuthorize("@ss.hasPermi('plant:staffmgr:add')")
|
|
@PreAuthorize("@ss.hasPermi('plant:staffmgr:add')")
|
|
|
@Log(title = "人员管理", businessType = BusinessType.INSERT)
|
|
@Log(title = "人员管理", businessType = BusinessType.INSERT)
|
|
|
@PostMapping
|
|
@PostMapping
|
|
|
- public AjaxResult add(@RequestBody TStaffmgr tStaffmgr)
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ public AjaxResult add(@RequestBody TStaffmgr tStaffmgr) {
|
|
|
//判断是否重复员工
|
|
//判断是否重复员工
|
|
|
TStaffmgr tStaffmgr1 = tStaffmgrMapper.selectTStaffmgrByStaffId(tStaffmgr.getStaffid());
|
|
TStaffmgr tStaffmgr1 = tStaffmgrMapper.selectTStaffmgrByStaffId(tStaffmgr.getStaffid());
|
|
|
if (tStaffmgr1 != null) {
|
|
if (tStaffmgr1 != null) {
|
|
@@ -516,7 +515,7 @@ public class TStaffmgrController extends BaseController
|
|
|
|
|
|
|
|
int insertResult = tStaffmgrService.insertTStaffmgr(tStaffmgr);
|
|
int insertResult = tStaffmgrService.insertTStaffmgr(tStaffmgr);
|
|
|
tStaffmgr.setCreaterCode(getUserId().toString());
|
|
tStaffmgr.setCreaterCode(getUserId().toString());
|
|
|
- if (tStaffmgr.getUnit().equals("10") || tStaffmgr.getUnit().equals("18")|| tStaffmgr.getUnit().equals("20")|| tStaffmgr.getUnit().equals("30")) {
|
|
|
|
|
|
|
+ if (tStaffmgr.getUnit().equals("10") || tStaffmgr.getUnit().equals("18") || tStaffmgr.getUnit().equals("20") || tStaffmgr.getUnit().equals("30")) {
|
|
|
TTrainingrecords tTrainingrecords = new TTrainingrecords();
|
|
TTrainingrecords tTrainingrecords = new TTrainingrecords();
|
|
|
tTrainingrecords.setStaffId(tStaffmgr.getId());
|
|
tTrainingrecords.setStaffId(tStaffmgr.getId());
|
|
|
tTrainingrecords.setPlantCode(tStaffmgr.getPlantCode());
|
|
tTrainingrecords.setPlantCode(tStaffmgr.getPlantCode());
|
|
@@ -580,8 +579,7 @@ public class TStaffmgrController extends BaseController
|
|
|
@PreAuthorize("@ss.hasPermi('plant:staffmgr:edit')")
|
|
@PreAuthorize("@ss.hasPermi('plant:staffmgr:edit')")
|
|
|
@Log(title = "人员管理", businessType = BusinessType.UPDATE)
|
|
@Log(title = "人员管理", businessType = BusinessType.UPDATE)
|
|
|
@PutMapping
|
|
@PutMapping
|
|
|
- public AjaxResult edit(@RequestBody TStaffmgr tStaffmgr)
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ public AjaxResult edit(@RequestBody TStaffmgr tStaffmgr) {
|
|
|
//判断是否重复员工
|
|
//判断是否重复员工
|
|
|
TStaffmgr tStaffmgr1 = tStaffmgrMapper.selectTStaffmgrByStaffId(tStaffmgr.getStaffid());
|
|
TStaffmgr tStaffmgr1 = tStaffmgrMapper.selectTStaffmgrByStaffId(tStaffmgr.getStaffid());
|
|
|
if (tStaffmgr1 != null) {
|
|
if (tStaffmgr1 != null) {
|
|
@@ -606,7 +604,7 @@ public class TStaffmgrController extends BaseController
|
|
|
if (!tStaffmgr.getTeam().equals("18")) {
|
|
if (!tStaffmgr.getTeam().equals("18")) {
|
|
|
//非W班组人员
|
|
//非W班组人员
|
|
|
TWorklicense tWorklicense = tWorklicenseService.selectTWorklicenseByEmployeeid(tStaffmgr.getStaffid());
|
|
TWorklicense tWorklicense = tWorklicenseService.selectTWorklicenseByEmployeeid(tStaffmgr.getStaffid());
|
|
|
- if (tWorklicense == null){
|
|
|
|
|
|
|
+ if (tWorklicense == null) {
|
|
|
TWorklicense newWorklicense = new TWorklicense();
|
|
TWorklicense newWorklicense = new TWorklicense();
|
|
|
newWorklicense.setPlantCode(tStaffmgr.getPlantCode());
|
|
newWorklicense.setPlantCode(tStaffmgr.getPlantCode());
|
|
|
newWorklicense.setClasses(tStaffmgr.getTeam());
|
|
newWorklicense.setClasses(tStaffmgr.getTeam());
|
|
@@ -615,7 +613,7 @@ public class TStaffmgrController extends BaseController
|
|
|
newWorklicense.setPost(tStaffmgr.getActualpost());
|
|
newWorklicense.setPost(tStaffmgr.getActualpost());
|
|
|
newWorklicense.setDeptId(tStaffmgr.getDeptId());
|
|
newWorklicense.setDeptId(tStaffmgr.getDeptId());
|
|
|
tWorklicenseService.insertTWorklicense(newWorklicense);
|
|
tWorklicenseService.insertTWorklicense(newWorklicense);
|
|
|
- }else {
|
|
|
|
|
|
|
+ } else {
|
|
|
tWorklicense.setPlantCode(tStaffmgr.getPlantCode());
|
|
tWorklicense.setPlantCode(tStaffmgr.getPlantCode());
|
|
|
tWorklicense.setClasses(tStaffmgr.getTeam());
|
|
tWorklicense.setClasses(tStaffmgr.getTeam());
|
|
|
tWorklicense.setName(tStaffmgr.getName());
|
|
tWorklicense.setName(tStaffmgr.getName());
|
|
@@ -634,11 +632,10 @@ public class TStaffmgrController extends BaseController
|
|
|
@PreAuthorize("@ss.hasPermi('plant:staffmgr:remove')")
|
|
@PreAuthorize("@ss.hasPermi('plant:staffmgr:remove')")
|
|
|
@Log(title = "人员管理", businessType = BusinessType.DELETE)
|
|
@Log(title = "人员管理", businessType = BusinessType.DELETE)
|
|
|
@DeleteMapping("/{ids}")
|
|
@DeleteMapping("/{ids}")
|
|
|
- public AjaxResult remove(@PathVariable Long[] ids)
|
|
|
|
|
- {
|
|
|
|
|
- for (int i = 0; i <ids.length ; i++) {
|
|
|
|
|
|
|
+ public AjaxResult remove(@PathVariable Long[] ids) {
|
|
|
|
|
+ for (int i = 0; i < ids.length; i++) {
|
|
|
TTrainingrecords tTrainingrecords = tTrainingrecordsService.selectTTrainingrecordsBystaffId(ids[i]);
|
|
TTrainingrecords tTrainingrecords = tTrainingrecordsService.selectTTrainingrecordsBystaffId(ids[i]);
|
|
|
- if (tTrainingrecords!= null) {
|
|
|
|
|
|
|
+ if (tTrainingrecords != null) {
|
|
|
tTrainingrecords.setDelFlag(2l);
|
|
tTrainingrecords.setDelFlag(2l);
|
|
|
tTrainingrecordsService.updateTTrainingrecords(tTrainingrecords);
|
|
tTrainingrecordsService.updateTTrainingrecords(tTrainingrecords);
|
|
|
}
|
|
}
|
|
@@ -673,10 +670,9 @@ public class TStaffmgrController extends BaseController
|
|
|
@PreAuthorize("@ss.hasPermi('plant:staffmgr:remove')")
|
|
@PreAuthorize("@ss.hasPermi('plant:staffmgr:remove')")
|
|
|
@Log(title = "人员管理", businessType = BusinessType.DELETE)
|
|
@Log(title = "人员管理", businessType = BusinessType.DELETE)
|
|
|
@GetMapping("/left/{id}")
|
|
@GetMapping("/left/{id}")
|
|
|
- public AjaxResult removeLeft(@PathVariable Long id)
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ public AjaxResult removeLeft(@PathVariable Long id) {
|
|
|
TTrainingrecords tTrainingrecords = tTrainingrecordsService.selectTTrainingrecordsBystaffId(id);
|
|
TTrainingrecords tTrainingrecords = tTrainingrecordsService.selectTTrainingrecordsBystaffId(id);
|
|
|
- if (tTrainingrecords!= null) {
|
|
|
|
|
|
|
+ if (tTrainingrecords != null) {
|
|
|
tTrainingrecords.setDelFlag(9l);
|
|
tTrainingrecords.setDelFlag(9l);
|
|
|
tTrainingrecordsService.updateTTrainingrecords(tTrainingrecords);
|
|
tTrainingrecordsService.updateTTrainingrecords(tTrainingrecords);
|
|
|
}
|
|
}
|
|
@@ -694,10 +690,9 @@ public class TStaffmgrController extends BaseController
|
|
|
@PreAuthorize("@ss.hasPermi('plant:staffmgr:remove')")
|
|
@PreAuthorize("@ss.hasPermi('plant:staffmgr:remove')")
|
|
|
@Log(title = "人员管理", businessType = BusinessType.DELETE)
|
|
@Log(title = "人员管理", businessType = BusinessType.DELETE)
|
|
|
@GetMapping("/retire/{id}")
|
|
@GetMapping("/retire/{id}")
|
|
|
- public AjaxResult removeRetire(@PathVariable Long id)
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ public AjaxResult removeRetire(@PathVariable Long id) {
|
|
|
TTrainingrecords tTrainingrecords = tTrainingrecordsService.selectTTrainingrecordsBystaffId(id);
|
|
TTrainingrecords tTrainingrecords = tTrainingrecordsService.selectTTrainingrecordsBystaffId(id);
|
|
|
- if (tTrainingrecords!= null) {
|
|
|
|
|
|
|
+ if (tTrainingrecords != null) {
|
|
|
tTrainingrecords.setDelFlag(9l);
|
|
tTrainingrecords.setDelFlag(9l);
|
|
|
tTrainingrecordsService.updateTTrainingrecords(tTrainingrecords);
|
|
tTrainingrecordsService.updateTTrainingrecords(tTrainingrecords);
|
|
|
}
|
|
}
|
|
@@ -715,10 +710,9 @@ public class TStaffmgrController extends BaseController
|
|
|
@PreAuthorize("@ss.hasPermi('plant:staffmgr:remove')")
|
|
@PreAuthorize("@ss.hasPermi('plant:staffmgr:remove')")
|
|
|
@Log(title = "人员管理", businessType = BusinessType.DELETE)
|
|
@Log(title = "人员管理", businessType = BusinessType.DELETE)
|
|
|
@GetMapping("/reLeft/{id}")
|
|
@GetMapping("/reLeft/{id}")
|
|
|
- public AjaxResult reLeft(@PathVariable Long id)
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ public AjaxResult reLeft(@PathVariable Long id) {
|
|
|
TTrainingrecords tTrainingrecords = tTrainingrecordsService.selectTTrainingrecordsBystaffId(id);
|
|
TTrainingrecords tTrainingrecords = tTrainingrecordsService.selectTTrainingrecordsBystaffId(id);
|
|
|
- if(tTrainingrecords!=null){
|
|
|
|
|
|
|
+ if (tTrainingrecords != null) {
|
|
|
tTrainingrecords.setDelFlag(0l);
|
|
tTrainingrecords.setDelFlag(0l);
|
|
|
tTrainingrecordsService.updateTTrainingrecords(tTrainingrecords);
|
|
tTrainingrecordsService.updateTTrainingrecords(tTrainingrecords);
|
|
|
}
|
|
}
|
|
@@ -731,12 +725,11 @@ public class TStaffmgrController extends BaseController
|
|
|
@PreAuthorize("@ss.hasPermi('plant:staffmgr:add')")
|
|
@PreAuthorize("@ss.hasPermi('plant:staffmgr:add')")
|
|
|
@Log(title = "人员管理", businessType = BusinessType.INSERT)
|
|
@Log(title = "人员管理", businessType = BusinessType.INSERT)
|
|
|
@PostMapping("/importData")
|
|
@PostMapping("/importData")
|
|
|
- public AjaxResult importData(@RequestParam("file") MultipartFile file) throws IOException
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ public AjaxResult importData(@RequestParam("file") MultipartFile file) throws IOException {
|
|
|
//获取操作人员ID
|
|
//获取操作人员ID
|
|
|
Long userId = getUserId();
|
|
Long userId = getUserId();
|
|
|
//报错行数统计
|
|
//报错行数统计
|
|
|
- List<Integer> failRow =new ArrayList<Integer>();
|
|
|
|
|
|
|
+ List<Integer> failRow = new ArrayList<Integer>();
|
|
|
Workbook workbook = ExcelUtils.getWorkBook(file);
|
|
Workbook workbook = ExcelUtils.getWorkBook(file);
|
|
|
Sheet sheet = workbook.getSheetAt(0);
|
|
Sheet sheet = workbook.getSheetAt(0);
|
|
|
List<TStaffmgr> list = new ArrayList<TStaffmgr>();
|
|
List<TStaffmgr> list = new ArrayList<TStaffmgr>();
|
|
@@ -833,7 +826,7 @@ public class TStaffmgrController extends BaseController
|
|
|
entity.setCreaterCode(userId.toString());
|
|
entity.setCreaterCode(userId.toString());
|
|
|
logger.info("entity:" + entity);
|
|
logger.info("entity:" + entity);
|
|
|
list.add(entity);
|
|
list.add(entity);
|
|
|
- }catch (Exception e){
|
|
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
failNumber++;
|
|
failNumber++;
|
|
|
logger.info("e:" + e);
|
|
logger.info("e:" + e);
|
|
|
failRow.add(i + 1);
|
|
failRow.add(i + 1);
|
|
@@ -846,7 +839,7 @@ public class TStaffmgrController extends BaseController
|
|
|
failNum++;
|
|
failNum++;
|
|
|
try {
|
|
try {
|
|
|
tStaffmgrService.insertTStaffmgr(t);
|
|
tStaffmgrService.insertTStaffmgr(t);
|
|
|
- if (t.getUnit().equals("10") || t.getUnit().equals("18")|| t.getUnit().equals("20")) {
|
|
|
|
|
|
|
+ if (t.getUnit().equals("10") || t.getUnit().equals("18") || t.getUnit().equals("20")) {
|
|
|
TTrainingrecords tTrainingrecords = new TTrainingrecords();
|
|
TTrainingrecords tTrainingrecords = new TTrainingrecords();
|
|
|
tTrainingrecords.setStaffId(t.getId());
|
|
tTrainingrecords.setStaffId(t.getId());
|
|
|
tTrainingrecords.setPlantCode(t.getPlantCode());
|
|
tTrainingrecords.setPlantCode(t.getPlantCode());
|
|
@@ -902,16 +895,16 @@ public class TStaffmgrController extends BaseController
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
successNumber++;
|
|
successNumber++;
|
|
|
- }catch (Exception e){
|
|
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
failNumber++;
|
|
failNumber++;
|
|
|
logger.info("e:" + e);
|
|
logger.info("e:" + e);
|
|
|
failRow.add(failNum + 1);
|
|
failRow.add(failNum + 1);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
logger.info("list:" + JSON.toJSONString(list));
|
|
logger.info("list:" + JSON.toJSONString(list));
|
|
|
- logger.info("successNumber:" +String.valueOf(successNumber));
|
|
|
|
|
- logger.info("failNumber:" +String.valueOf(failNumber));
|
|
|
|
|
- logger.info("failRow:" +String.valueOf(failRow));
|
|
|
|
|
|
|
+ logger.info("successNumber:" + String.valueOf(successNumber));
|
|
|
|
|
+ logger.info("failNumber:" + String.valueOf(failNumber));
|
|
|
|
|
+ logger.info("failRow:" + String.valueOf(failRow));
|
|
|
return AjaxResult.success(String.valueOf(successNumber), failRow);
|
|
return AjaxResult.success(String.valueOf(successNumber), failRow);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -919,11 +912,9 @@ public class TStaffmgrController extends BaseController
|
|
|
* 证件照上传
|
|
* 证件照上传
|
|
|
*/
|
|
*/
|
|
|
@PostMapping("/uploadPhoto")
|
|
@PostMapping("/uploadPhoto")
|
|
|
- public AjaxResult uploadFile(@RequestParam("file") MultipartFile file,String pType,String pId) throws IOException
|
|
|
|
|
- {
|
|
|
|
|
- if (!file.isEmpty())
|
|
|
|
|
- {
|
|
|
|
|
- String url = FileUploadUtils.upload(RuoYiConfig.getFilePath("/"+ pType), file);
|
|
|
|
|
|
|
+ public AjaxResult uploadFile(@RequestParam("file") MultipartFile file, String pType, String pId) throws IOException {
|
|
|
|
|
+ if (!file.isEmpty()) {
|
|
|
|
|
+ String url = FileUploadUtils.upload(RuoYiConfig.getFilePath("/" + pType), file);
|
|
|
TStaffmgr staffmgr = tStaffmgrService.selectTStaffmgrById(Long.parseLong(pId));
|
|
TStaffmgr staffmgr = tStaffmgrService.selectTStaffmgrById(Long.parseLong(pId));
|
|
|
staffmgr.setPhoto(url);
|
|
staffmgr.setPhoto(url);
|
|
|
tStaffmgrService.updateTStaffmgr(staffmgr);
|
|
tStaffmgrService.updateTStaffmgr(staffmgr);
|