|
@@ -62,6 +62,11 @@ public class TTrainingMatrixController extends BaseController {
|
|
|
private ITTrainingbccService trainingbccService;
|
|
|
@Autowired
|
|
|
private ITTrainingbccDeviceService trainingbccDeviceService;
|
|
|
+ @Autowired
|
|
|
+ private ITTrainingDeviceService tTrainingDeviceService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ITTrainingService tTrainingService;
|
|
|
/**
|
|
|
* 查询培训矩阵列表
|
|
|
*/
|
|
@@ -160,6 +165,9 @@ public class TTrainingMatrixController extends BaseController {
|
|
|
public AjaxResult batchAddTraining(@PathVariable Long[] ids) {
|
|
|
for (int i = 0; i < ids.length; i++) {
|
|
|
TTrainingMatrix tm = tTrainingMatrixService.selectTTrainingMatrixById(ids[i]);
|
|
|
+ if (tm.getDeptId() == 103l) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
TTrainingRegular tr = new TTrainingRegular();
|
|
|
tr.setDeptId(tm.getDeptId());
|
|
|
tr.setActualpostId(tm.getActualpostId());
|
|
@@ -171,6 +179,92 @@ public class TTrainingMatrixController extends BaseController {
|
|
|
Calendar cal = Calendar.getInstance();
|
|
|
tr.setYear(String.valueOf(cal.get(Calendar.YEAR)));
|
|
|
int doInsert = tTrainingRegularService.insertTTrainingRegular(tr);
|
|
|
+ //新增培训计划定期类
|
|
|
+ TTraining tTraining = new TTraining();
|
|
|
+ tTraining.setTrainingType("10");
|
|
|
+ tTraining.setYear(tr.getYear());
|
|
|
+ tTraining.setCourse(tr.getItem());
|
|
|
+ tTraining.setCourseid(tr.getCourseCode());
|
|
|
+ tTraining.setDuration(tr.getHour());
|
|
|
+ tTraining.setTrainer(tr.getLecturer());
|
|
|
+ tTraining.setPosition(tr.getActualpostId());
|
|
|
+ tTraining.setIsfinish(Long.parseLong("0"));
|
|
|
+ tTraining.setDeptId(tr.getDeptId());
|
|
|
+ tTraining.setRegularId(tr.getId());
|
|
|
+ tTrainingService.insertTTraining(tTraining);
|
|
|
+ Long trainingId = tTraining.getId();
|
|
|
+ //新增人员-装置级关系
|
|
|
+ // 参培岗位人员
|
|
|
+ if (tr.getActualpostId() != null) {
|
|
|
+ logger.info("参培岗位人员");
|
|
|
+ TStaffmgr staffmgr = new TStaffmgr();
|
|
|
+ staffmgr.setActualposts(tr.getActualpostId());
|
|
|
+ List<TStaffmgr> staffmgrs = tStaffmgrService.selectAllTStaffmgrList(staffmgr);
|
|
|
+ try {
|
|
|
+ //判断离职
|
|
|
+ if (!org.apache.commons.lang.StringUtils.isEmpty(tr.getYear())) {
|
|
|
+ Iterator<TStaffmgr> iterator = staffmgrs.iterator();
|
|
|
+ while (iterator.hasNext()) {
|
|
|
+ TStaffmgr t = iterator.next();
|
|
|
+ if (t.getDelFlag() == 9){
|
|
|
+ iterator.remove();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }catch (Exception e) {
|
|
|
+ logger.error(e.toString());
|
|
|
+ }
|
|
|
+ for (TStaffmgr s : staffmgrs) {
|
|
|
+ TTrainingDevice tTrainingDevice = new TTrainingDevice();
|
|
|
+ tTrainingDevice.setStaffId(s.getStaffid());
|
|
|
+ tTrainingDevice.setRegularId(trainingId);
|
|
|
+ tTrainingDevice.setStartDate(tr.getPlanTrainingdate());
|
|
|
+ tTrainingDevice.setSupplementary("0");
|
|
|
+ tTrainingDeviceService.insertTTrainingDevice(tTrainingDevice);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //指定岗位人员
|
|
|
+ if (tr.getDesignatedStaff() != null) {
|
|
|
+ logger.info("指定岗位人员");
|
|
|
+ String[] designatedStaffs = tr.getDesignatedStaff().split(",");
|
|
|
+ for (String staffId : designatedStaffs) {
|
|
|
+ TTrainingDevice tTrainingDevice = new TTrainingDevice();
|
|
|
+ tTrainingDevice.setStaffId(staffId);
|
|
|
+ tTrainingDevice.setRegularId(trainingId);
|
|
|
+ tTrainingDevice.setStartDate(tr.getPlanTrainingdate());
|
|
|
+ tTrainingDevice.setSupplementary("0");
|
|
|
+ tTrainingDeviceService.insertTTrainingDevice(tTrainingDevice);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //涉及其他部门
|
|
|
+ if (tr.getInvolvedMoc().equals("true")){
|
|
|
+ logger.info("涉及MOC人员");
|
|
|
+ TStaffmgr staffmgrMoc = new TStaffmgr();
|
|
|
+ staffmgrMoc.setActualposts(tr.getDesignatedOther());
|
|
|
+ List<TStaffmgr> staffmgrsMoc = tStaffmgrService.selectAllTStaffmgrList(staffmgrMoc);
|
|
|
+ try {
|
|
|
+ //判断离职
|
|
|
+ if (!org.apache.commons.lang.StringUtils.isEmpty(tr.getYear())) {
|
|
|
+ Iterator<TStaffmgr> iterator = staffmgrsMoc.iterator();
|
|
|
+ while (iterator.hasNext()) {
|
|
|
+ TStaffmgr t = iterator.next();
|
|
|
+ if (t.getDelFlag() == 9){
|
|
|
+ iterator.remove();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }catch (Exception e) {
|
|
|
+ logger.error(e.toString());
|
|
|
+ }
|
|
|
+ for (TStaffmgr s : staffmgrsMoc) {
|
|
|
+ TTrainingDevice tTrainingDevice = new TTrainingDevice();
|
|
|
+ tTrainingDevice.setStaffId(s.getStaffid());
|
|
|
+ tTrainingDevice.setRegularId(trainingId);
|
|
|
+ tTrainingDevice.setStartDate(tr.getPlanTrainingdate());
|
|
|
+ tTrainingDevice.setSupplementary("0");
|
|
|
+ tTrainingDeviceService.insertTTrainingDevice(tTrainingDevice);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
for (int i = 0; i < ids.length; i++) {
|
|
|
TTrainingMatrix matrix = tTrainingMatrixService.selectTTrainingMatrixById(ids[i]);
|
|
@@ -220,11 +314,8 @@ public class TTrainingMatrixController extends BaseController {
|
|
|
Iterator<TStaffmgr> iterator = staffmgrs.iterator();
|
|
|
while (iterator.hasNext()) {
|
|
|
TStaffmgr t = iterator.next();
|
|
|
- if (t.getLeftDate() != null && t.getDelFlag() == 9){
|
|
|
- if (t.getLeftDate().getTime() - tTrainingRegular.getPlanTrainingdate().getTime() < 0l ) {
|
|
|
- logger.debug(t.getName() + "离职时间小于培训时间");
|
|
|
- iterator.remove();
|
|
|
- }
|
|
|
+ if (t.getDelFlag() == 9){
|
|
|
+ iterator.remove();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -270,11 +361,8 @@ public class TTrainingMatrixController extends BaseController {
|
|
|
Iterator<TStaffmgr> iterator = staffmgrsMoc.iterator();
|
|
|
while (iterator.hasNext()) {
|
|
|
TStaffmgr t = iterator.next();
|
|
|
- if (t.getLeftDate() != null && t.getDelFlag() == 9){
|
|
|
- if (t.getLeftDate().getTime() - tTrainingRegular.getPlanTrainingdate().getTime() > 0l ) {
|
|
|
- logger.debug(t.getName() + "离职时间小于培训时间");
|
|
|
- iterator.remove();
|
|
|
- }
|
|
|
+ if (t.getDelFlag() == 9){
|
|
|
+ iterator.remove();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -306,10 +394,47 @@ public class TTrainingMatrixController extends BaseController {
|
|
|
public AjaxResult batchAddCompany(@PathVariable Long[] ids) {
|
|
|
for (int i = 0; i < ids.length; i++) {
|
|
|
TTrainingMatrix tm = tTrainingMatrixService.selectTTrainingMatrixById(ids[i]);
|
|
|
+ if (tm.getTrainingLevel().equals("14")) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
TTrainingCompanylevel tr = new TTrainingCompanylevel();
|
|
|
tr.setDeptId(tm.getDeptId());
|
|
|
tr.setCourseCode(tm.getCourseCode());
|
|
|
tr.setItem(tm.getItem());
|
|
|
+ tr.setFrequency(tm.getFrequency());
|
|
|
+
|
|
|
+ // 根据岗位找出该装置的人员,设置到staffId字段
|
|
|
+ if (tm.getActualpostId() != null && !tm.getActualpostId().trim().isEmpty()) {
|
|
|
+ StringBuilder staffIds = new StringBuilder();
|
|
|
+ TStaffmgr staffmgr = new TStaffmgr();
|
|
|
+ staffmgr.setActualposts(tm.getActualpostId());
|
|
|
+ staffmgr.setDeptId(tm.getDeptId());
|
|
|
+ // 使用不带数据权限的查询方法,避免定时任务权限问题
|
|
|
+ List<TStaffmgr> staffmgrs = tStaffmgrService.selectAllTStaffmgrListWithoutScope(staffmgr);
|
|
|
+
|
|
|
+ // 过滤掉已离职的员工
|
|
|
+ Iterator<TStaffmgr> iterator = staffmgrs.iterator();
|
|
|
+ while (iterator.hasNext()) {
|
|
|
+ TStaffmgr staff = iterator.next();
|
|
|
+ if (staff.getDelFlag() == 9) { // 9表示已离职
|
|
|
+ iterator.remove();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 收集员工编号
|
|
|
+ for (TStaffmgr staff : staffmgrs) {
|
|
|
+ if (staff.getStaffid() != null && !staff.getStaffid().trim().isEmpty()) {
|
|
|
+ staffIds.append(staff.getStaffid()).append(",");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 移除最后的逗号
|
|
|
+ if (staffIds.length() > 0) {
|
|
|
+ staffIds.setLength(staffIds.length() - 1);
|
|
|
+ tr.setStaffId(staffIds.toString());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
Calendar cal = Calendar.getInstance();
|
|
|
int doInsert = tTrainingCompanylevelService.insertTTrainingCompanylevel(tr);
|
|
|
}
|
|
@@ -388,220 +513,76 @@ public class TTrainingMatrixController extends BaseController {
|
|
|
}
|
|
|
}
|
|
|
} else if (j == 5) {
|
|
|
- for (SysDictData actualpost : actualposts) {
|
|
|
- if (actualpost.getDictLabel().equals(cellValue.trim())) {
|
|
|
- entity.setLecturer(actualpost.getDictValue());
|
|
|
+ // 处理多选授课人,支持逗号分隔
|
|
|
+ StringBuilder lecturerBuilder = new StringBuilder();
|
|
|
+ String[] lecturerNames = cellValue.split(",");
|
|
|
+ for (String lecturerName : lecturerNames) {
|
|
|
+ lecturerName = lecturerName.trim();
|
|
|
+ boolean found = false;
|
|
|
+ for (SysDictData actualpost : actualposts) {
|
|
|
+ if (actualpost.getDictLabel().equals(lecturerName)) {
|
|
|
+ lecturerBuilder.append(actualpost.getDictLabel()).append(",");
|
|
|
+ found = true;
|
|
|
+ break;
|
|
|
+ }
|
|
|
}
|
|
|
+ // 如果在字典中找不到,直接使用输入的名称
|
|
|
+ if (!found && !lecturerName.isEmpty()) {
|
|
|
+ lecturerBuilder.append(lecturerName).append(",");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 移除最后的逗号
|
|
|
+ if (lecturerBuilder.length() > 0) {
|
|
|
+ lecturerBuilder.setLength(lecturerBuilder.length() - 1);
|
|
|
+ entity.setLecturer(lecturerBuilder.toString());
|
|
|
}
|
|
|
} else if (j == 6) {
|
|
|
entity.setHour(cellValue);
|
|
|
} else if (j == 7) {
|
|
|
- for (SysDictData actualpost : actualposts) {
|
|
|
- if (actualpost.getDictLabel().equals("首席经理")) {
|
|
|
- if ("M".equals(cellValue) || "X".equals(cellValue) || "m".equals(cellValue) || "x".equals(cellValue)) {
|
|
|
- actualpostId.append(actualpost.getDictValue()).append(",");
|
|
|
- } else if ("(M)".equals(cellValue) || "(X)".equals(cellValue) || "(m)".equals(cellValue) || "(x)".equals(cellValue)||"(M)".equals(cellValue) || "(X)".equals(cellValue) || "(m)".equals(cellValue) || "(x)".equals(cellValue)) {
|
|
|
- designatedOther.append(actualpost.getDictValue()).append(",");
|
|
|
- } else if ("I".equals(cellValue) || "i".equals(cellValue)) {
|
|
|
- designatedPosition.append(actualpost.getDictValue()).append(",");
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ processPositionField("首席经理", cellValue, actualposts, actualpostId, designatedOther, designatedPosition);
|
|
|
} else if (j == 8) {
|
|
|
- for (SysDictData actualpost : actualposts) {
|
|
|
- if (actualpost.getDictLabel().equals("装置经理")) {
|
|
|
- if ("M".equals(cellValue) || "X".equals(cellValue) || "m".equals(cellValue) || "x".equals(cellValue)) {
|
|
|
- actualpostId.append(actualpost.getDictValue()).append(",");
|
|
|
- } else if ("(M)".equals(cellValue) || "(X)".equals(cellValue) || "(m)".equals(cellValue) || "(x)".equals(cellValue)||"(M)".equals(cellValue) || "(X)".equals(cellValue) || "(m)".equals(cellValue) || "(x)".equals(cellValue)) {
|
|
|
- designatedOther.append(actualpost.getDictValue()).append(",");
|
|
|
- } else if ("I".equals(cellValue) || "i".equals(cellValue)) {
|
|
|
- designatedPosition.append(actualpost.getDictValue()).append(",");
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ processPositionField("首席专家", cellValue, actualposts, actualpostId, designatedOther, designatedPosition);
|
|
|
} else if (j == 9) {
|
|
|
- for (SysDictData actualpost : actualposts) {
|
|
|
- if (actualpost.getDictLabel().equals("资深工程师")) {
|
|
|
- if ("M".equals(cellValue) || "X".equals(cellValue) || "m".equals(cellValue) || "x".equals(cellValue)) {
|
|
|
- actualpostId.append(actualpost.getDictValue()).append(",");
|
|
|
- } else if ("(M)".equals(cellValue) || "(X)".equals(cellValue) || "(m)".equals(cellValue) || "(x)".equals(cellValue)||"(M)".equals(cellValue) || "(X)".equals(cellValue) || "(m)".equals(cellValue) || "(x)".equals(cellValue)) {
|
|
|
- designatedOther.append(actualpost.getDictValue()).append(",");
|
|
|
- } else if ("I".equals(cellValue) || "i".equals(cellValue)) {
|
|
|
- designatedPosition.append(actualpost.getDictValue()).append(",");
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ processPositionField("装置经理", cellValue, actualposts, actualpostId, designatedOther, designatedPosition);
|
|
|
} else if (j == 10) {
|
|
|
- for (SysDictData actualpost : actualposts) {
|
|
|
- if (actualpost.getDictLabel().equals("生产主管")) {
|
|
|
- if ("M".equals(cellValue) || "X".equals(cellValue) || "m".equals(cellValue) || "x".equals(cellValue)) {
|
|
|
- actualpostId.append(actualpost.getDictValue()).append(",");
|
|
|
- } else if ("(M)".equals(cellValue) || "(X)".equals(cellValue) || "(m)".equals(cellValue) || "(x)".equals(cellValue)||"(M)".equals(cellValue) || "(X)".equals(cellValue) || "(m)".equals(cellValue) || "(x)".equals(cellValue)) {
|
|
|
- designatedOther.append(actualpost.getDictValue()).append(",");
|
|
|
- } else if ("I".equals(cellValue) || "i".equals(cellValue)) {
|
|
|
- designatedPosition.append(actualpost.getDictValue()).append(",");
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ processPositionField("资深工程师", cellValue, actualposts, actualpostId, designatedOther, designatedPosition);
|
|
|
} else if (j == 11) {
|
|
|
- for (SysDictData actualpost : actualposts) {
|
|
|
- if (actualpost.getDictLabel().equals("片区工长")) {
|
|
|
- if ("M".equals(cellValue) || "X".equals(cellValue) || "m".equals(cellValue) || "x".equals(cellValue)) {
|
|
|
- actualpostId.append(actualpost.getDictValue()).append(",");
|
|
|
- } else if ("(M)".equals(cellValue) || "(X)".equals(cellValue) || "(m)".equals(cellValue) || "(x)".equals(cellValue)||"(M)".equals(cellValue) || "(X)".equals(cellValue) || "(m)".equals(cellValue) || "(x)".equals(cellValue)) {
|
|
|
- designatedOther.append(actualpost.getDictValue()).append(",");
|
|
|
- } else if ("I".equals(cellValue) || "i".equals(cellValue)) {
|
|
|
- designatedPosition.append(actualpost.getDictValue()).append(",");
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ processPositionField("生产主管", cellValue, actualposts, actualpostId, designatedOther, designatedPosition);
|
|
|
} else if (j == 12) {
|
|
|
- for (SysDictData actualpost : actualposts) {
|
|
|
- if (actualpost.getDictLabel().equals("职员")) {
|
|
|
- if ("M".equals(cellValue) || "X".equals(cellValue) || "m".equals(cellValue) || "x".equals(cellValue)) {
|
|
|
- actualpostId.append(actualpost.getDictValue()).append(",");
|
|
|
- } else if ("(M)".equals(cellValue) || "(X)".equals(cellValue) || "(m)".equals(cellValue) || "(x)".equals(cellValue)||"(M)".equals(cellValue) || "(X)".equals(cellValue) || "(m)".equals(cellValue) || "(x)".equals(cellValue)) {
|
|
|
- designatedOther.append(actualpost.getDictValue()).append(",");
|
|
|
- } else if ("I".equals(cellValue) || "i".equals(cellValue)) {
|
|
|
- designatedPosition.append(actualpost.getDictValue()).append(",");
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ processPositionField("片区工长", cellValue, actualposts, actualpostId, designatedOther, designatedPosition);
|
|
|
} else if (j == 13) {
|
|
|
- for (SysDictData actualpost : actualposts) {
|
|
|
- if (actualpost.getDictLabel().equals("EHS督导")) {
|
|
|
- if ("M".equals(cellValue) || "X".equals(cellValue) || "m".equals(cellValue) || "x".equals(cellValue)) {
|
|
|
- actualpostId.append(actualpost.getDictValue()).append(",");
|
|
|
- } else if ("(M)".equals(cellValue) || "(X)".equals(cellValue) || "(m)".equals(cellValue) || "(x)".equals(cellValue)||"(M)".equals(cellValue) || "(X)".equals(cellValue) || "(m)".equals(cellValue) || "(x)".equals(cellValue)) {
|
|
|
- designatedOther.append(actualpost.getDictValue()).append(",");
|
|
|
- } else if ("I".equals(cellValue) || "i".equals(cellValue)) {
|
|
|
- designatedPosition.append(actualpost.getDictValue()).append(",");
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ processPositionField("职员", cellValue, actualposts, actualpostId, designatedOther, designatedPosition);
|
|
|
} else if (j == 14) {
|
|
|
- for (SysDictData actualpost : actualposts) {
|
|
|
- if (actualpost.getDictLabel().equals("倒班班长")) {
|
|
|
- if ("M".equals(cellValue) || "X".equals(cellValue) || "m".equals(cellValue) || "x".equals(cellValue)) {
|
|
|
- actualpostId.append(actualpost.getDictValue()).append(",");
|
|
|
- } else if ("(M)".equals(cellValue) || "(X)".equals(cellValue) || "(m)".equals(cellValue) || "(x)".equals(cellValue)||"(M)".equals(cellValue) || "(X)".equals(cellValue) || "(m)".equals(cellValue) || "(x)".equals(cellValue)) {
|
|
|
- designatedOther.append(actualpost.getDictValue()).append(",");
|
|
|
- } else if ("I".equals(cellValue) || "i".equals(cellValue)) {
|
|
|
- designatedPosition.append(actualpost.getDictValue()).append(",");
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ processPositionField("安全专员", cellValue, actualposts, actualpostId, designatedOther, designatedPosition);
|
|
|
} else if (j == 15) {
|
|
|
- for (SysDictData actualpost : actualposts) {
|
|
|
- if (actualpost.getDictLabel().equals("倒班副班长")) {
|
|
|
- if ("M".equals(cellValue) || "X".equals(cellValue) || "m".equals(cellValue) || "x".equals(cellValue)) {
|
|
|
- actualpostId.append(actualpost.getDictValue()).append(",");
|
|
|
- } else if ("(M)".equals(cellValue) || "(X)".equals(cellValue) || "(m)".equals(cellValue) || "(x)".equals(cellValue)||"(M)".equals(cellValue) || "(X)".equals(cellValue) || "(m)".equals(cellValue) || "(x)".equals(cellValue)) {
|
|
|
- designatedOther.append(actualpost.getDictValue()).append(",");
|
|
|
- } else if ("I".equals(cellValue) || "i".equals(cellValue)) {
|
|
|
- designatedPosition.append(actualpost.getDictValue()).append(",");
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ processPositionField("OTS培训专员", cellValue, actualposts, actualpostId, designatedOther, designatedPosition);
|
|
|
} else if (j == 16) {
|
|
|
- for (SysDictData actualpost : actualposts) {
|
|
|
- if (actualpost.getDictLabel().equals("主操")) {
|
|
|
- if ("M".equals(cellValue) || "X".equals(cellValue) || "m".equals(cellValue) || "x".equals(cellValue)) {
|
|
|
- actualpostId.append(actualpost.getDictValue()).append(",");
|
|
|
- } else if ("(M)".equals(cellValue) || "(X)".equals(cellValue) || "(m)".equals(cellValue) || "(x)".equals(cellValue)||"(M)".equals(cellValue) || "(X)".equals(cellValue) || "(m)".equals(cellValue) || "(x)".equals(cellValue)) {
|
|
|
- designatedOther.append(actualpost.getDictValue()).append(",");
|
|
|
- } else if ("I".equals(cellValue) || "i".equals(cellValue)) {
|
|
|
- designatedPosition.append(actualpost.getDictValue()).append(",");
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ processPositionField("倒班班长", cellValue, actualposts, actualpostId, designatedOther, designatedPosition);
|
|
|
} else if (j == 17) {
|
|
|
- for (SysDictData actualpost : actualposts) {
|
|
|
- if (actualpost.getDictLabel().equals("副操")) {
|
|
|
- if ("M".equals(cellValue) || "X".equals(cellValue) || "m".equals(cellValue) || "x".equals(cellValue)) {
|
|
|
- actualpostId.append(actualpost.getDictValue()).append(",");
|
|
|
- } else if ("(M)".equals(cellValue) || "(X)".equals(cellValue) || "(m)".equals(cellValue) || "(x)".equals(cellValue)||"(M)".equals(cellValue) || "(X)".equals(cellValue) || "(m)".equals(cellValue) || "(x)".equals(cellValue)) {
|
|
|
- designatedOther.append(actualpost.getDictValue()).append(",");
|
|
|
- } else if ("I".equals(cellValue) || "i".equals(cellValue)) {
|
|
|
- designatedPosition.append(actualpost.getDictValue()).append(",");
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ processPositionField("倒班副班长", cellValue, actualposts, actualpostId, designatedOther, designatedPosition);
|
|
|
} else if (j == 18) {
|
|
|
- for (SysDictData actualpost : actualposts) {
|
|
|
- if (actualpost.getDictLabel().equals("主操(白班)")) {
|
|
|
- if ("M".equals(cellValue) || "X".equals(cellValue) || "m".equals(cellValue) || "x".equals(cellValue)) {
|
|
|
- actualpostId.append(actualpost.getDictValue()).append(",");
|
|
|
- } else if ("(M)".equals(cellValue) || "(X)".equals(cellValue) || "(m)".equals(cellValue) || "(x)".equals(cellValue)||"(M)".equals(cellValue) || "(X)".equals(cellValue) || "(m)".equals(cellValue) || "(x)".equals(cellValue)) {
|
|
|
- designatedOther.append(actualpost.getDictValue()).append(",");
|
|
|
- } else if ("I".equals(cellValue) || "i".equals(cellValue)) {
|
|
|
- designatedPosition.append(actualpost.getDictValue()).append(",");
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ processPositionField("主操", cellValue, actualposts, actualpostId, designatedOther, designatedPosition);
|
|
|
} else if (j == 19) {
|
|
|
- for (SysDictData actualpost : actualposts) {
|
|
|
- if (actualpost.getDictLabel().equals("机械维修人员")) {
|
|
|
- if ("M".equals(cellValue) || "X".equals(cellValue) || "m".equals(cellValue) || "x".equals(cellValue)) {
|
|
|
- actualpostId.append(actualpost.getDictValue()).append(",");
|
|
|
- } else if ("(M)".equals(cellValue) || "(X)".equals(cellValue) || "(m)".equals(cellValue) || "(x)".equals(cellValue)||"(M)".equals(cellValue) || "(X)".equals(cellValue) || "(m)".equals(cellValue) || "(x)".equals(cellValue)) {
|
|
|
- designatedOther.append(actualpost.getDictValue()).append(",");
|
|
|
- } else if ("I".equals(cellValue) || "i".equals(cellValue)) {
|
|
|
- designatedPosition.append(actualpost.getDictValue()).append(",");
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ processPositionField("副操", cellValue, actualposts, actualpostId, designatedOther, designatedPosition);
|
|
|
} else if (j == 20) {
|
|
|
- for (SysDictData actualpost : actualposts) {
|
|
|
- if (actualpost.getDictLabel().equals("电仪维修人员")) {
|
|
|
- if ("M".equals(cellValue) || "X".equals(cellValue) || "m".equals(cellValue) || "x".equals(cellValue)) {
|
|
|
- actualpostId.append(actualpost.getDictValue()).append(",");
|
|
|
- } else if ("(M)".equals(cellValue) || "(X)".equals(cellValue) || "(m)".equals(cellValue) || "(x)".equals(cellValue)||"(M)".equals(cellValue) || "(X)".equals(cellValue) || "(m)".equals(cellValue) || "(x)".equals(cellValue)) {
|
|
|
- designatedOther.append(actualpost.getDictValue()).append(",");
|
|
|
- } else if ("I".equals(cellValue) || "i".equals(cellValue)) {
|
|
|
- designatedPosition.append(actualpost.getDictValue()).append(",");
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ processPositionField("主操(白班)", cellValue, actualposts, actualpostId, designatedOther, designatedPosition);
|
|
|
} else if (j == 21) {
|
|
|
- for (SysDictData actualpost : actualposts) {
|
|
|
- if (actualpost.getDictLabel().equals("实验室人员")) {
|
|
|
- if ("M".equals(cellValue) || "X".equals(cellValue) || "m".equals(cellValue) || "x".equals(cellValue)) {
|
|
|
- actualpostId.append(actualpost.getDictValue()).append(",");
|
|
|
- } else if ("(M)".equals(cellValue) || "(X)".equals(cellValue) || "(m)".equals(cellValue) || "(x)".equals(cellValue)||"(M)".equals(cellValue) || "(X)".equals(cellValue) || "(m)".equals(cellValue) || "(x)".equals(cellValue)) {
|
|
|
- designatedOther.append(actualpost.getDictValue()).append(",");
|
|
|
- } else if ("I".equals(cellValue) || "i".equals(cellValue)) {
|
|
|
- designatedPosition.append(actualpost.getDictValue()).append(",");
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ processPositionField("机械维修经理", cellValue, actualposts, actualpostId, designatedOther, designatedPosition);
|
|
|
} else if (j == 22) {
|
|
|
- for (SysDictData actualpost : actualposts) {
|
|
|
- if (actualpost.getDictLabel().equals("见习生")) {
|
|
|
- if ("M".equals(cellValue) || "X".equals(cellValue) || "m".equals(cellValue) || "x".equals(cellValue)) {
|
|
|
- actualpostId.append(actualpost.getDictValue()).append(",");
|
|
|
- } else if ("(M)".equals(cellValue) || "(X)".equals(cellValue) || "(m)".equals(cellValue) || "(x)".equals(cellValue)||"(M)".equals(cellValue) || "(X)".equals(cellValue) || "(m)".equals(cellValue) || "(x)".equals(cellValue)) {
|
|
|
- designatedOther.append(actualpost.getDictValue()).append(",");
|
|
|
- } else if ("I".equals(cellValue) || "i".equals(cellValue)) {
|
|
|
- designatedPosition.append(actualpost.getDictValue()).append(",");
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ processPositionField("机械维修人员", cellValue, actualposts, actualpostId, designatedOther, designatedPosition);
|
|
|
} else if (j == 23) {
|
|
|
- for (SysDictData actualpost : actualposts) {
|
|
|
- if (actualpost.getDictLabel().equals("工程师")) {
|
|
|
- if ("M".equals(cellValue) || "X".equals(cellValue) || "m".equals(cellValue) || "x".equals(cellValue)) {
|
|
|
- actualpostId.append(actualpost.getDictValue()).append(",");
|
|
|
- } else if ("(M)".equals(cellValue) || "(X)".equals(cellValue) || "(m)".equals(cellValue) || "(x)".equals(cellValue)||"(M)".equals(cellValue) || "(X)".equals(cellValue) || "(m)".equals(cellValue) || "(x)".equals(cellValue)) {
|
|
|
- designatedOther.append(actualpost.getDictValue()).append(",");
|
|
|
- } else if ("I".equals(cellValue) || "i".equals(cellValue)) {
|
|
|
- designatedPosition.append(actualpost.getDictValue()).append(",");
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ processPositionField("电仪维修经理", cellValue, actualposts, actualpostId, designatedOther, designatedPosition);
|
|
|
} else if (j == 24) {
|
|
|
- entity.setRemarks(cellValue);
|
|
|
+ processPositionField("电仪维修人员", cellValue, actualposts, actualpostId, designatedOther, designatedPosition);
|
|
|
} else if (j == 25) {
|
|
|
+ processPositionField("工程师", cellValue, actualposts, actualpostId, designatedOther, designatedPosition);
|
|
|
+ } else if (j == 26) {
|
|
|
+ processPositionField("见习生", cellValue, actualposts, actualpostId, designatedOther, designatedPosition);
|
|
|
+ } else if (j == 27) {
|
|
|
+ processPositionField("实验室人员", cellValue, actualposts, actualpostId, designatedOther, designatedPosition);
|
|
|
+ } else if (j == 28) {
|
|
|
+ entity.setRemarks(cellValue);
|
|
|
+ } else if (j == 29) {
|
|
|
for (SysDept d : dept) {
|
|
|
if (d.getDeptName().equals(cellValue.trim())) {
|
|
|
entity.setDeptId(d.getDeptId());//部门编号
|
|
@@ -649,4 +630,33 @@ public class TTrainingMatrixController extends BaseController {
|
|
|
logger.info("failRow:" + failRow);
|
|
|
return AjaxResult.success(String.valueOf(successNumber), failRow);
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 处理岗位字段
|
|
|
+ */
|
|
|
+ private void processPositionField(String positionName, String cellValue, List<SysDictData> actualposts,
|
|
|
+ StringBuilder actualpostId, StringBuilder designatedOther, StringBuilder designatedPosition) {
|
|
|
+ boolean found = false;
|
|
|
+ for (SysDictData actualpost : actualposts) {
|
|
|
+ if (actualpost.getDictLabel().equals(positionName)) {
|
|
|
+ found = true;
|
|
|
+ logger.info("找到岗位: {} -> {}, 单元格值: {}", positionName, actualpost.getDictValue(), cellValue);
|
|
|
+ if ("M".equals(cellValue) || "X".equals(cellValue) || "m".equals(cellValue) || "x".equals(cellValue)) {
|
|
|
+ actualpostId.append(actualpost.getDictValue()).append(",");
|
|
|
+ logger.info("添加到actualpostId: {}", actualpost.getDictValue());
|
|
|
+ } else if ("(M)".equals(cellValue) || "(X)".equals(cellValue) || "(m)".equals(cellValue) || "(x)".equals(cellValue)||"(M)".equals(cellValue) || "(X)".equals(cellValue) || "(m)".equals(cellValue) || "(x)".equals(cellValue)) {
|
|
|
+ designatedOther.append(actualpost.getDictValue()).append(",");
|
|
|
+ logger.info("添加到designatedOther: {}", actualpost.getDictValue());
|
|
|
+ } else if ("I".equals(cellValue) || "i".equals(cellValue)) {
|
|
|
+ designatedPosition.append(actualpost.getDictValue()).append(",");
|
|
|
+ logger.info("添加到designatedPosition: {}", actualpost.getDictValue());
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!found) {
|
|
|
+ logger.warn("未找到岗位: {}, 可用岗位列表: {}", positionName,
|
|
|
+ actualposts.stream().map(SysDictData::getDictLabel).collect(java.util.stream.Collectors.toList()));
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|