Przeglądaj źródła

先交一下 方便更新

jz.kai 5 lat temu
rodzic
commit
577bdfa0ae

+ 70 - 60
src/main/java/com/jpsoft/smart/modules/base/controller/CompanyPositionController.java

@@ -1,12 +1,17 @@
 package com.jpsoft.smart.modules.base.controller;
 
 import com.github.pagehelper.Page;
+import com.jpsoft.smart.modules.base.entity.PersonInfo;
 import com.jpsoft.smart.modules.common.utils.PojoUtils;
 import com.jpsoft.smart.modules.common.dto.Sort;
 import com.jpsoft.smart.modules.common.dto.MessageResult;
 import com.jpsoft.smart.modules.base.entity.CompanyPosition;
 import com.jpsoft.smart.modules.base.service.CompanyPositionService;
+import com.jpsoft.smart.modules.sys.entity.User;
+import com.jpsoft.smart.modules.sys.service.UserService;
 import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
 import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
@@ -26,38 +31,37 @@ public class CompanyPositionController {
 
     @Autowired
     private CompanyPositionService companyPositionService;
+    @Autowired
+    private UserService userService;
 
-    @ApiOperation(value="创建空记录")
-    @GetMapping("create")
-    public MessageResult<CompanyPosition> create(){
-        MessageResult<CompanyPosition> msgResult = new MessageResult<>();
-
-        CompanyPosition companyPosition = new CompanyPosition();
-
-        msgResult.setData(companyPosition);
-        msgResult.setResult(true);
-
-        return msgResult;
-    }
-    
-    @ApiOperation(value="添加信息")
-    @PostMapping("add")
-    public MessageResult<CompanyPosition> add(@RequestBody CompanyPosition companyPosition,@RequestAttribute String subject){
+    @ApiOperation(value="保存信息")
+    @PostMapping("save")
+    public MessageResult<CompanyPosition> save(@RequestBody CompanyPosition companyPosition,@RequestAttribute String subject){
+        User user = userService.get(subject);
         MessageResult<CompanyPosition> msgResult = new MessageResult<>();
 
         try {
-            companyPosition.setId(UUID.randomUUID().toString());
-            companyPosition.setCreateBy(subject);
-            companyPosition.setCreateTime(new Date());
-            
-            int affectCount = companyPositionService.insert(companyPosition);
+            int affectCount = 0;
+            if(StringUtils.isEmpty(companyPosition.getId())) {
+                companyPosition.setCompanyId(user.getCompanyId());
+                companyPosition.setDelFlag(false);
+                companyPosition.setCreateBy(subject);
+                companyPosition.setCreateTime(new Date());
+
+                affectCount = companyPositionService.insert(companyPosition);
+            }else{
+                companyPosition.setUpdateBy(subject);
+                companyPosition.setUpdateTime(new Date());
+
+                affectCount = companyPositionService.update(companyPosition);
+            }
 
             if (affectCount > 0) {
                 msgResult.setResult(true);
                 msgResult.setData(companyPosition);
-            } else {
+            }else{
                 msgResult.setResult(false);
-                msgResult.setMessage("数据库添加失败");
+                msgResult.setMessage("数据库保存失败");
             }
         }
         catch(Exception ex){
@@ -70,9 +74,9 @@ public class CompanyPositionController {
         return msgResult;
     }
 
-    @ApiOperation(value="获取信息")
-    @GetMapping("edit/{id}")
-    public MessageResult<CompanyPosition> edit(@PathVariable("id") String id){
+    @ApiOperation(value="获取详情信息")
+    @GetMapping("detail/{id}")
+    public MessageResult<CompanyPosition> detail(@PathVariable("id") String id){
         MessageResult<CompanyPosition> msgResult = new MessageResult<>();
 
         try {
@@ -96,36 +100,7 @@ public class CompanyPositionController {
         return msgResult;
     }
 
-    @ApiOperation(value="更新用户")
-    @PostMapping("update")
-    public MessageResult<CompanyPosition> update(@RequestBody CompanyPosition companyPosition,@RequestAttribute String subject){
-        MessageResult<CompanyPosition> msgResult = new MessageResult<>();
-
-        try {
-            companyPosition.setUpdateBy(subject);
-            companyPosition.setUpdateTime(new Date());
-            
-            int affectCount = companyPositionService.update(companyPosition);
-
-            if (affectCount > 0) {
-                msgResult.setResult(true);
-                msgResult.setData(companyPosition);
-            } else {
-                msgResult.setResult(false);
-                msgResult.setMessage("数据库更新失败");
-            }
-        }
-        catch(Exception ex){
-            logger.error(ex.getMessage(),ex);
-
-            msgResult.setResult(false);
-            msgResult.setMessage(ex.getMessage());
-        }
-
-        return msgResult;
-    }
-
-	@ApiOperation(value="删除")
+    @ApiOperation(value="删除")
     @PostMapping("delete/{id}")
     public MessageResult<Integer> delete(@PathVariable("id") String id,@RequestAttribute String subject){
         MessageResult<Integer> msgResult = new MessageResult<>();
@@ -156,7 +131,6 @@ public class CompanyPositionController {
         return msgResult;
     }
 
-
     @ApiOperation(value="批量删除")
     @PostMapping("batchDelete")
     public MessageResult<Integer> batchDelete(@RequestBody List<String> idList,@RequestAttribute String subject){
@@ -194,8 +168,11 @@ public class CompanyPositionController {
 
     @ApiOperation(value="列表")
     @RequestMapping(value = "pageList",method = RequestMethod.POST)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "companyId",value = "公司编号", required = false, paramType = "form",dataType = "String"),
+    })
     public MessageResult<Map> pageList(
-            String id,
+            @RequestParam(value="companyId",defaultValue="") String companyId,
             @RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
             @RequestParam(value="pageSize",defaultValue="20") int pageSize,
             @RequestAttribute String subject){
@@ -210,8 +187,8 @@ public class CompanyPositionController {
         List<Sort> sortList = new ArrayList<>();
         sortList.add(new Sort("id_","asc"));
 
-        if (StringUtils.isNotEmpty(id)) {
-            searchParams.put("id","%" + id + "%");
+        if (StringUtils.isNotEmpty(companyId)) {
+            searchParams.put("companyId",companyId);
         }
 
         Page<CompanyPosition> page = companyPositionService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
@@ -221,4 +198,37 @@ public class CompanyPositionController {
 
         return msgResult;
     }
+
+    @ApiOperation(value="根据公司获取详情信息")
+    @GetMapping("detailForCompany")
+    public MessageResult<CompanyPosition> detailForCompany(@RequestAttribute String subject){
+        User user = userService.get(subject);
+        MessageResult<CompanyPosition> msgResult = new MessageResult<>();
+
+        try {
+            Map<String,Object> searchParams = new HashMap<>();
+            searchParams.put("companyId",user.getCompanyId());
+
+            List<Sort> sortList = new ArrayList<>();
+            sortList.add(new Sort("id_","asc"));
+
+            CompanyPosition companyPosition = new CompanyPosition();
+            Page<CompanyPosition> page = companyPositionService.pageSearch(searchParams,1,1,false,sortList);
+
+            if (page.size() > 0) {
+                companyPosition = page.get(0);
+            }
+
+            msgResult.setResult(true);
+            msgResult.setData(companyPosition);
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
 }

+ 383 - 60
src/main/java/com/jpsoft/smart/modules/base/controller/PersonInfoController.java

@@ -6,15 +6,22 @@ import com.jpsoft.smart.modules.common.dto.Sort;
 import com.jpsoft.smart.modules.common.dto.MessageResult;
 import com.jpsoft.smart.modules.base.entity.PersonInfo;
 import com.jpsoft.smart.modules.base.service.PersonInfoService;
+import com.jpsoft.smart.modules.sys.entity.User;
+import com.jpsoft.smart.modules.sys.service.UserService;
 import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
 import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
 
 import javax.servlet.http.HttpServletRequest;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
 import java.text.SimpleDateFormat;
 import java.util.*;
 
@@ -26,39 +33,37 @@ public class PersonInfoController {
 
     @Autowired
     private PersonInfoService personInfoService;
+    @Autowired
+    private UserService userService;
 
-    @ApiOperation(value="创建空记录")
-    @GetMapping("create")
-    public MessageResult<PersonInfo> create(){
-        MessageResult<PersonInfo> msgResult = new MessageResult<>();
-
-        PersonInfo personInfo = new PersonInfo();
-
-        msgResult.setData(personInfo);
-        msgResult.setResult(true);
-
-        return msgResult;
-    }
-    
-    @ApiOperation(value="添加信息")
-    @PostMapping("add")
-    public MessageResult<PersonInfo> add(@RequestBody PersonInfo personInfo,@RequestAttribute String subject){
+    @ApiOperation(value="保存信息")
+    @PostMapping("save")
+    public MessageResult<PersonInfo> save(@RequestBody PersonInfo personInfo,@RequestAttribute String subject){
+        User user = userService.get(subject);
         MessageResult<PersonInfo> msgResult = new MessageResult<>();
 
         try {
-//            personInfo.setId(UUID.randomUUID().toString());
-            personInfo.setDelFlag(false);
-            personInfo.setCreateBy(subject);
-            personInfo.setCreateTime(new Date());
-            
-            int affectCount = personInfoService.insert(personInfo);
+            int affectCount = 0;
+            if(personInfo.getId() != null) {
+                personInfo.setCompanyId(user.getCompanyId());
+                personInfo.setDelFlag(false);
+                personInfo.setCreateBy(subject);
+                personInfo.setCreateTime(new Date());
+
+                affectCount = personInfoService.insert(personInfo);
+            }else{
+                personInfo.setUpdateBy(subject);
+                personInfo.setUpdateTime(new Date());
+
+                affectCount = personInfoService.update(personInfo);
+            }
 
             if (affectCount > 0) {
                 msgResult.setResult(true);
                 msgResult.setData(personInfo);
-            } else {
+            }else{
                 msgResult.setResult(false);
-                msgResult.setMessage("数据库添加失败");
+                msgResult.setMessage("数据库保存失败");
             }
         }
         catch(Exception ex){
@@ -71,9 +76,9 @@ public class PersonInfoController {
         return msgResult;
     }
 
-    @ApiOperation(value="获取信息")
-    @GetMapping("edit/{id}")
-    public MessageResult<PersonInfo> edit(@PathVariable("id") String id){
+    @ApiOperation(value="获取详情信息")
+    @GetMapping("detail/{id}")
+    public MessageResult<PersonInfo> detail(@PathVariable("id") String id){
         MessageResult<PersonInfo> msgResult = new MessageResult<>();
 
         try {
@@ -97,35 +102,6 @@ public class PersonInfoController {
         return msgResult;
     }
 
-    @ApiOperation(value="更新用户")
-    @PostMapping("update")
-    public MessageResult<PersonInfo> update(@RequestBody PersonInfo personInfo,@RequestAttribute String subject){
-        MessageResult<PersonInfo> msgResult = new MessageResult<>();
-
-        try {
-            personInfo.setUpdateBy(subject);
-            personInfo.setUpdateTime(new Date());
-            
-            int affectCount = personInfoService.update(personInfo);
-
-            if (affectCount > 0) {
-                msgResult.setResult(true);
-                msgResult.setData(personInfo);
-            } else {
-                msgResult.setResult(false);
-                msgResult.setMessage("数据库更新失败");
-            }
-        }
-        catch(Exception ex){
-            logger.error(ex.getMessage(),ex);
-
-            msgResult.setResult(false);
-            msgResult.setMessage(ex.getMessage());
-        }
-
-        return msgResult;
-    }
-
 	@ApiOperation(value="删除")
     @PostMapping("delete/{id}")
     public MessageResult<Integer> delete(@PathVariable("id") String id,@RequestAttribute String subject){
@@ -157,7 +133,6 @@ public class PersonInfoController {
         return msgResult;
     }
 
-
     @ApiOperation(value="批量删除")
     @PostMapping("batchDelete")
     public MessageResult<Integer> batchDelete(@RequestBody List<String> idList,@RequestAttribute String subject){
@@ -195,8 +170,21 @@ public class PersonInfoController {
 
     @ApiOperation(value="列表")
     @RequestMapping(value = "pageList",method = RequestMethod.POST)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "name",value = "姓名", required = false, paramType = "form",dataType = "String"),
+            @ApiImplicitParam(name = "position1",value = "一级位置", required = false, paramType = "form",dataType = "String"),
+            @ApiImplicitParam(name = "position2",value = "二级位置", required = false, paramType = "form",dataType = "String"),
+            @ApiImplicitParam(name = "position3",value = "三级位置", required = false, paramType = "form",dataType = "String"),
+            @ApiImplicitParam(name = "position4",value = "四级位置", required = false, paramType = "form",dataType = "String"),
+            @ApiImplicitParam(name = "position5",value = "五级位置", required = false, paramType = "form",dataType = "String")
+    })
     public MessageResult<Map> pageList(
-            String id,
+            @RequestParam(value="name",defaultValue="") String name,
+            @RequestParam(value="position1",defaultValue="") String position1,
+            @RequestParam(value="position2",defaultValue="") String position2,
+            @RequestParam(value="position3",defaultValue="") String position3,
+            @RequestParam(value="position4",defaultValue="") String position4,
+            @RequestParam(value="position5",defaultValue="") String position5,
             @RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
             @RequestParam(value="pageSize",defaultValue="20") int pageSize,
             @RequestAttribute String subject){
@@ -211,8 +199,23 @@ public class PersonInfoController {
         List<Sort> sortList = new ArrayList<>();
         sortList.add(new Sort("id_","asc"));
 
-        if (StringUtils.isNotEmpty(id)) {
-            searchParams.put("id","%" + id + "%");
+        if (StringUtils.isNotEmpty(name)) {
+            searchParams.put("name","%" + name + "%");
+        }
+        if (StringUtils.isNotEmpty(position1)) {
+            searchParams.put("position1",position1);
+        }
+        if (StringUtils.isNotEmpty(position2)) {
+            searchParams.put("position2",position2);
+        }
+        if (StringUtils.isNotEmpty(position3)) {
+            searchParams.put("position3",position3);
+        }
+        if (StringUtils.isNotEmpty(position4)) {
+            searchParams.put("position4",position4);
+        }
+        if (StringUtils.isNotEmpty(position5)) {
+            searchParams.put("position5",position5);
         }
 
         Page<PersonInfo> page = personInfoService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
@@ -222,4 +225,324 @@ public class PersonInfoController {
 
         return msgResult;
     }
+
+    @ApiOperation(value="人脸授权")
+    @PostMapping("EnabledFace")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id",value = "人员编号", required = false, paramType = "form",dataType = "String")
+    })
+    public MessageResult<PersonInfo> EnabledFace(@RequestParam(value="id",defaultValue="") String id,@RequestAttribute String subject){
+        MessageResult<PersonInfo> msgResult = new MessageResult<>();
+
+        try {
+            PersonInfo personInfo = personInfoService.get(id);
+
+            if(personInfo.getFaceEnabled()){
+                personInfo.setFaceEnabled(false);
+            }else{
+                personInfo.setFaceEnabled(true);
+            }
+            personInfo.setUpdateBy(subject);
+            personInfo.setUpdateTime(new Date());
+
+            int affectCount = personInfoService.update(personInfo);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(personInfo);
+            }else{
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库保存失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="刷卡授权")
+    @PostMapping("EnabledCard")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id",value = "人员编号", required = false, paramType = "form",dataType = "String")
+    })
+    public MessageResult<PersonInfo> EnabledCard(@RequestParam(value="id",defaultValue="") String id,@RequestAttribute String subject){
+        MessageResult<PersonInfo> msgResult = new MessageResult<>();
+
+        try {
+            PersonInfo personInfo = personInfoService.get(id);
+
+            if(personInfo.getCardEnabled()){
+                personInfo.setCardEnabled(false);
+            }else{
+                personInfo.setCardEnabled(true);
+            }
+            personInfo.setUpdateBy(subject);
+            personInfo.setUpdateTime(new Date());
+
+            int affectCount = personInfoService.update(personInfo);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(personInfo);
+            }else{
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库保存失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="手机授权")
+    @PostMapping("EnabledApp")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id",value = "人员编号", required = false, paramType = "form",dataType = "String")
+    })
+    public MessageResult<PersonInfo> EnabledApp(@RequestParam(value="id",defaultValue="") String id,@RequestAttribute String subject){
+        MessageResult<PersonInfo> msgResult = new MessageResult<>();
+
+        try {
+            PersonInfo personInfo = personInfoService.get(id);
+
+            if(personInfo.getAppEnabled()){
+                personInfo.setAppEnabled(false);
+            }else{
+                personInfo.setAppEnabled(true);
+            }
+            personInfo.setUpdateBy(subject);
+            personInfo.setUpdateTime(new Date());
+
+            int affectCount = personInfoService.update(personInfo);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(personInfo);
+            }else{
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库保存失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="访客授权")
+    @PostMapping("EnabledGuest")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id",value = "人员编号", required = false, paramType = "form",dataType = "String")
+    })
+    public MessageResult<PersonInfo> EnabledGuest(@RequestParam(value="id",defaultValue="") String id,@RequestAttribute String subject){
+        MessageResult<PersonInfo> msgResult = new MessageResult<>();
+
+        try {
+            PersonInfo personInfo = personInfoService.get(id);
+
+            if(personInfo.getGuestEnabled()){
+                personInfo.setGuestEnabled(false);
+            }else{
+                personInfo.setGuestEnabled(true);
+            }
+            personInfo.setUpdateBy(subject);
+            personInfo.setUpdateTime(new Date());
+
+            int affectCount = personInfoService.update(personInfo);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(personInfo);
+            }else{
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库保存失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+//    @ApiOperation(value="导入企业人员")
+//    @PostMapping("importXls")
+//    @ApiImplicitParams({
+//            @ApiImplicitParam(name = "companyId",value = "企业ID", required = true, paramType = "form",dataType = "String"),
+//            @ApiImplicitParam(name = "uploadFile",value = "上传文件", required = true,paramType="form", dataType = "__file")
+//    })
+//    public MessageResult<String> importXls(@RequestParam(value="companyId",defaultValue="") String companyId,
+//                                           MultipartFile uploadFile,
+//                                           @RequestAttribute String subject){
+//        User user = userService.get(subject);
+//
+//        MessageResult<String> msgResult = new MessageResult<>();
+//        PersonInfo personInfo = new PersonInfo();
+//
+//        try {
+//            POIUtils poiUtils = new POIUtils(uploadFile.getInputStream());
+//            int sheetIndex = 0;
+//            Sheet sheet1 = poiUtils.getSheetAt(sheetIndex);
+//
+//            int affectCount = 0;
+//            int failCount = 0;
+//            int validateColIndex = 7;
+//
+//            for(int rowIndex=1 ; rowIndex<=sheet1.getLastRowNum(); rowIndex++){
+//                try {
+//                    String name = (String)poiUtils.getCellValue(sheetIndex,rowIndex,1);
+//                    String cardType = (String)poiUtils.getCellValue(sheetIndex,rowIndex,2);
+//                    String cardNo = (String)poiUtils.getCellValue(sheetIndex,rowIndex,3);
+//                    String sex = (String)poiUtils.getCellValue(sheetIndex,rowIndex,4);
+////                  String age = array[5].toString();
+//                    String jobName = (String)poiUtils.getCellValue(sheetIndex,rowIndex,5);
+//                    String healthStatus = (String)poiUtils.getCellValue(sheetIndex,rowIndex,6);
+//
+//                    if(StringUtils.isEmpty(name)){
+//                        break;
+//                    }
+//
+//                    Map<String, Object> searchParams = new HashMap<>();
+//                    searchParams.put("companyId", company.getId());
+//                    searchParams.put("cardNo", cardNo);
+//                    searchParams.put("delFlag", false);
+//
+//                    List<Sort> sortList = new ArrayList<>();
+//                    Page<CompanyMember> page = companyMemberService.pageSearch(searchParams, 1, 100, sortList);
+//
+//                    if (page.size() > 0) {
+//                        sheet1.getRow(rowIndex).createCell(validateColIndex).setCellValue("身份证已导入!");
+//                        failCount++;
+//                        continue;
+//                    } else {
+//                        companyMember.setId(UUID.randomUUID().toString());
+//                        if (StringUtils.isNotEmpty(company.getId())) companyMember.setCompanyId(company.getId());
+//                        if (StringUtils.isNotEmpty(name)) companyMember.setName(name);
+//
+//                        CheckIdCard cic = null;
+//
+//                        if(StringUtils.isEmpty(cardNo)){
+//                            sheet1.getRow(rowIndex).createCell(validateColIndex).setCellValue("身份证不能为空!");
+//                            failCount++;
+//                            continue;
+//                        }
+//                        else{
+//                            cardNo = cardNo.trim().toUpperCase();
+//                        }
+//
+//                        for(DataDictionary dd : ddList){
+//                            if(dd.getName().equals(cardType)) {
+//                                companyMember.setCardType(dd.getValue());
+//                                break;
+//                            }
+//                        }
+//
+//                        if (StringUtils.isEmpty(companyMember.getCardType())){
+//                            sheet1.getRow(rowIndex).createCell(validateColIndex).setCellValue("证件类型未选择!");
+//                            failCount++;
+//                            continue;
+//                        }
+//
+//                        if (cardType.contains("身份证")) {
+//                            cic = new CheckIdCard(cardNo);
+//
+//                            if (!cic.validate()){
+//                                sheet1.getRow(rowIndex).createCell(validateColIndex).setCellValue("身份证验证失败!");
+//                                failCount++;
+//
+//                                continue;
+//                            }
+//                        }
+//
+//                        companyMember.setCardNo(cardNo);
+//
+//                        List<Jobs> jobsList = jobsService.findByName(jobsName);
+//
+//                        if (jobsList.size() > 0) {
+//                            companyMember.setJobsId(jobsList.get(0).getId());
+//                        }
+//
+//                        if (StringUtils.isNotEmpty(healthStatus)) companyMember.setHealthStatus(healthStatus);
+//
+//                        companyMember.setStatus("0");
+//                        companyMember.setDelFlag(false);
+//                        companyMember.setCreateBy(principal.getName());
+//                        companyMember.setCreateTime(new Date());
+//
+//                        if (companyMemberService.insert(companyMember) > 0) {
+//                            affectCount++;
+//                        }
+//                    }
+//                }
+//                catch(Exception innerEx){
+//                    logger.error(innerEx.getMessage(),innerEx);
+//                }
+//            }
+//
+//            if (failCount>0){
+//                //有导入失败的记录
+//                msgResult.setResult(false);
+//                msgResult.setMessage("数据成功导入" + affectCount + "条,有" + failCount + "条数据未导入成功,错误原因请查看报表。");
+//
+//                //todo 只保留错误数据的sheet
+//                int rowIndex = 1;
+//
+//                while(rowIndex<= sheet1.getLastRowNum()){
+//                    Cell cell = sheet1.getRow(rowIndex).getCell(validateColIndex);
+//
+//                    if (cell==null || StringUtils.isEmpty(cell.getStringCellValue())){
+//                        sheet1.removeRow(sheet1.getRow(rowIndex));
+//
+//                        if (rowIndex<sheet1.getLastRowNum()) {
+//                            sheet1.shiftRows(rowIndex + 1, sheet1.getLastRowNum(), -1); //删除后下面行上移,则不需要移动rowIndex
+//                        }
+//                    }
+//                    else {
+//                        rowIndex++;
+//                    }
+//                }
+//
+//                //todo 将wb保存到oss
+//                ByteArrayOutputStream output = new ByteArrayOutputStream();
+//                poiUtils.getWorkbook().write(output);
+//
+//                byte[] buffer = output.toByteArray();
+//                ByteArrayInputStream input = new ByteArrayInputStream(buffer);
+//
+//                String downloadUrl = OSSUtil.upload(ossConfig,"import","error.xls",input);
+//
+//                //todo 返回导入失败报表下载链接
+//                msgResult.setData(downloadUrl);
+//            }
+//            else{
+//                msgResult.setResult(true);
+//                msgResult.setMessage("数据成功导入" + affectCount + "条");
+//            }
+//        }
+//        catch(Exception ex){
+//            logger.error(ex.getMessage(),ex);
+//
+//            msgResult.setResult(false);
+//            msgResult.setMessage(ex.getMessage());
+//        }
+//
+//        return msgResult;
+//    }
 }

+ 2 - 2
src/main/resources/mapper/base/CompanyPosition.xml

@@ -100,8 +100,8 @@ id_,company_id,position1_name,position2_name,position3_name,position4_name,posit
 			select * from base_company_position
 		]]>
 		<where>
-			<if test="searchParams.id != null">
-				and ID_ like #{searchParams.id}
+			<if test="searchParams.companyId != null">
+				and company_id like #{searchParams.companyId}
 			</if>
 		</where>
 		<foreach item="sort" collection="sortList"  open="order by" separator=",">

+ 17 - 2
src/main/resources/mapper/base/PersonInfo.xml

@@ -142,8 +142,23 @@
 			select * from base_person_info
 		]]>
         <where>
-            <if test="searchParams.id != null">
-                and ID_ like #{searchParams.id}
+            <if test="searchParams.name != null">
+                and name_ like #{searchParams.name}
+            </if>
+            <if test="searchParams.position1 != null">
+                and position1_ like #{searchParams.position1}
+            </if>
+            <if test="searchParams.position2 != null">
+                and position2_ like #{searchParams.position2}
+            </if>
+            <if test="searchParams.position3 != null">
+                and position3_ like #{searchParams.position3}
+            </if>
+            <if test="searchParams.position4 != null">
+                and position4_ like #{searchParams.position4}
+            </if>
+            <if test="searchParams.position5 != null">
+                and position5_ like #{searchParams.position5}
             </if>
         </where>
         <foreach item="sort" collection="sortList" open="order by" separator=",">