|
@@ -12,6 +12,7 @@ import com.jeeplus.common.persistence.Page;
|
|
import com.jeeplus.common.utils.DateUtils;
|
|
import com.jeeplus.common.utils.DateUtils;
|
|
import com.jeeplus.common.utils.MyBeanUtils;
|
|
import com.jeeplus.common.utils.MyBeanUtils;
|
|
import com.jeeplus.common.utils.StringUtils;
|
|
import com.jeeplus.common.utils.StringUtils;
|
|
|
|
+import com.jeeplus.common.utils.ThisLocalityDownloadUtil;
|
|
import com.jeeplus.common.utils.excel.ExportExcel;
|
|
import com.jeeplus.common.utils.excel.ExportExcel;
|
|
import com.jeeplus.common.utils.excel.ImportExcel;
|
|
import com.jeeplus.common.utils.excel.ImportExcel;
|
|
import com.jeeplus.common.web.BaseController;
|
|
import com.jeeplus.common.web.BaseController;
|
|
@@ -26,9 +27,12 @@ import com.jeeplus.modules.sysimportinfo.service.SysImportInfoService;
|
|
import com.jeeplus.modules.wexinpackage.access.service.WeChatCallbackService;
|
|
import com.jeeplus.modules.wexinpackage.access.service.WeChatCallbackService;
|
|
import com.jeeplus.modules.workprojectnotify.entity.WorkProjectNotify;
|
|
import com.jeeplus.modules.workprojectnotify.entity.WorkProjectNotify;
|
|
import com.jeeplus.modules.workprojectnotify.service.WorkProjectNotifyService;
|
|
import com.jeeplus.modules.workprojectnotify.service.WorkProjectNotifyService;
|
|
|
|
+import com.jeeplus.modules.workreceiptsregister.entity.ResponseEntity;
|
|
import com.jeeplus.modules.workrelationship.entity.WorkRelationship;
|
|
import com.jeeplus.modules.workrelationship.entity.WorkRelationship;
|
|
import com.jeeplus.modules.workstaff.entity.WorkStaffBasicInfo;
|
|
import com.jeeplus.modules.workstaff.entity.WorkStaffBasicInfo;
|
|
|
|
+import com.jeeplus.modules.workstaff.entity.WorkStaffCertificateImport;
|
|
import com.jeeplus.modules.workstaff.service.WorkStaffBasicInfoService;
|
|
import com.jeeplus.modules.workstaff.service.WorkStaffBasicInfoService;
|
|
|
|
+import com.jeeplus.modules.workstaff.service.WorkStaffCertificateService;
|
|
import com.jeeplus.modules.workstaffachiveslog.dao.WorkStaffAchivesLogDao;
|
|
import com.jeeplus.modules.workstaffachiveslog.dao.WorkStaffAchivesLogDao;
|
|
import com.jeeplus.modules.workstaffachiveslog.entity.WorkStaffAchivesLog;
|
|
import com.jeeplus.modules.workstaffachiveslog.entity.WorkStaffAchivesLog;
|
|
import com.jeeplus.modules.workstaffachiveslog.service.WorkStaffAchivesLogService;
|
|
import com.jeeplus.modules.workstaffachiveslog.service.WorkStaffAchivesLogService;
|
|
@@ -79,6 +83,8 @@ public class WorkStaffBasicInfoController extends BaseController {
|
|
private UserService userService;
|
|
private UserService userService;
|
|
@Autowired
|
|
@Autowired
|
|
private WeChatCallbackService weChatCallbackService;
|
|
private WeChatCallbackService weChatCallbackService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private WorkStaffCertificateService workStaffCertificateService;
|
|
|
|
|
|
@ModelAttribute
|
|
@ModelAttribute
|
|
public WorkStaffBasicInfo get(@RequestParam(required=false) String id) {
|
|
public WorkStaffBasicInfo get(@RequestParam(required=false) String id) {
|
|
@@ -281,9 +287,6 @@ public class WorkStaffBasicInfoController extends BaseController {
|
|
/**
|
|
/**
|
|
* 修改员工总审人员信息
|
|
* 修改员工总审人员信息
|
|
* @param workStaffBasicInfo
|
|
* @param workStaffBasicInfo
|
|
- * @param model
|
|
|
|
- * @param redirectAttributes
|
|
|
|
- * @param request
|
|
|
|
* @return
|
|
* @return
|
|
* @throws Exception
|
|
* @throws Exception
|
|
*/
|
|
*/
|
|
@@ -514,6 +517,86 @@ public class WorkStaffBasicInfoController extends BaseController {
|
|
return "redirect:"+Global.getAdminPath()+"/workstaff/workStaffBasicInfo/achivelist?repage";
|
|
return "redirect:"+Global.getAdminPath()+"/workstaff/workStaffBasicInfo/achivelist?repage";
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 下载导入员工信息数据模板
|
|
|
|
+ */
|
|
|
|
+ @RequestMapping(value = "import/template")
|
|
|
|
+ public String importTemplate(HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) {
|
|
|
|
+ try {
|
|
|
|
+ ThisLocalityDownloadUtil download = new ThisLocalityDownloadUtil();
|
|
|
|
+ download.download("职业资格证书表.xlsx",request,response);
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ logger.error("职业资格证书表模板下载失败!",e);
|
|
|
|
+ }
|
|
|
|
+ return "redirect:"+Global.getAdminPath()+"/workstaff/workStaffBasicInfo/?repage";
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 导入职业资格证信息
|
|
|
|
+ * @param file
|
|
|
|
+ * @param redirectAttributes
|
|
|
|
+ * @param request
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @ResponseBody
|
|
|
|
+ @RequestMapping(value = "import", method=RequestMethod.POST)
|
|
|
|
+ public Object importWorkStaffBasicInfo(MultipartFile file, RedirectAttributes redirectAttributes,HttpServletRequest request) {
|
|
|
|
+ ResponseEntity<WorkStaffCertificateImport> responseEntity = new ResponseEntity<>();
|
|
|
|
+ int failureNum = 0;
|
|
|
|
+ try {
|
|
|
|
+ ImportExcel ei = new ImportExcel(file, 1, 0);
|
|
|
|
+ List<WorkStaffCertificateImport> list = ei.getDataList(WorkStaffCertificateImport.class);
|
|
|
|
+ List<WorkStaffCertificateImport> listAll = new ArrayList<>();
|
|
|
|
+ for (WorkStaffCertificateImport info : list) {
|
|
|
|
+ try {
|
|
|
|
+ if (StringUtils.isNotBlank(info.getUserName()) && null != info.getName() && null != info.getNum() && null != info.getIssuingDate()) {
|
|
|
|
+ listAll.add(info);
|
|
|
|
+ } else {
|
|
|
|
+ failureNum++;
|
|
|
|
+ }
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ failureNum++;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //对数据进行新增修改处理
|
|
|
|
+ Map<String, List<String>> listMap = workStaffCertificateService.saveByImport(listAll);
|
|
|
|
+ List<String> nullUser = listMap.get("nullUser");
|
|
|
|
+ List<String> multitudeUser = listMap.get("multitudeUser");
|
|
|
|
+ List<String> updateUser = listMap.get("updateUser");
|
|
|
|
+ //计算新增和修改成功的数量(总量减去查无此人和人员数量超过1的数据量)
|
|
|
|
+ Integer successCount = listAll.size() -(nullUser.size() + multitudeUser.size());
|
|
|
|
+ //处理成员名数量超过1人的数据
|
|
|
|
+ String multitudeStr = String.join(",", multitudeUser);
|
|
|
|
+ //处理修改信息的数据
|
|
|
|
+ String updateStr = String.join(",", updateUser);
|
|
|
|
+
|
|
|
|
+ StringBuffer promptSB = new StringBuffer();
|
|
|
|
+ if(successCount>0){
|
|
|
|
+ promptSB.append("新增成功 "+ successCount + " 条数据。");
|
|
|
|
+ }
|
|
|
|
+ if(failureNum>0){
|
|
|
|
+ promptSB.append("有 "+ failureNum + " 条数据填写不正确,无法添加。");
|
|
|
|
+ }
|
|
|
|
+ if(nullUser.size()>0){
|
|
|
|
+ promptSB.append("有 "+ nullUser.size() + " 条数据查无此人,无法添加。");
|
|
|
|
+ }
|
|
|
|
+ if(multitudeUser.size()>0){
|
|
|
|
+ promptSB.append(multitudeStr + " 人员存在名称重复,无法添加。");
|
|
|
|
+ }
|
|
|
|
+ if(updateUser.size()>0){
|
|
|
|
+ promptSB.append(updateStr + " 数据已存在,已进行更新。");
|
|
|
|
+ }
|
|
|
|
+ responseEntity.setCode(0);
|
|
|
|
+ responseEntity.setMessage(promptSB.toString());
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ responseEntity.setCode(400);
|
|
|
|
+ responseEntity.setMessage("导入执业资格证信息失败!");
|
|
|
|
+ logger.error("导入执业资格证信息失败!",e);
|
|
|
|
+ }
|
|
|
|
+ return responseEntity;
|
|
|
|
+ }
|
|
|
|
+
|
|
@RequestMapping("idCard")
|
|
@RequestMapping("idCard")
|
|
@ResponseBody
|
|
@ResponseBody
|
|
public AjaxJson idCard(String idCard){
|
|
public AjaxJson idCard(String idCard){
|