|
|
@@ -6,12 +6,19 @@ import com.jpsoft.employment.modules.base.service.UserAuthenticationApproveServi
|
|
|
import com.jpsoft.employment.modules.common.dto.MessageResult;
|
|
|
import com.jpsoft.employment.modules.common.dto.Sort;
|
|
|
import com.jpsoft.employment.modules.common.utils.PojoUtils;
|
|
|
+import com.jpsoft.employment.modules.job.entity.JobUser;
|
|
|
+import com.jpsoft.employment.modules.job.service.JobUserService;
|
|
|
+import com.jpsoft.employment.modules.sys.entity.DataDictionary;
|
|
|
+import com.jpsoft.employment.modules.sys.entity.User;
|
|
|
+import com.jpsoft.employment.modules.sys.service.DataDictionaryService;
|
|
|
+import com.jpsoft.employment.modules.sys.service.UserService;
|
|
|
import io.swagger.annotations.Api;
|
|
|
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.transaction.annotation.Transactional;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
@@ -26,6 +33,12 @@ public class UserAuthenticationApproveController {
|
|
|
|
|
|
@Autowired
|
|
|
private UserAuthenticationApproveService userAuthenticationApproveService;
|
|
|
+ @Autowired
|
|
|
+ private DataDictionaryService dataDictionaryService;
|
|
|
+ @Autowired
|
|
|
+ private JobUserService jobUserService;
|
|
|
+ @Autowired
|
|
|
+ private UserService userService;
|
|
|
|
|
|
@ApiOperation(value="创建空记录")
|
|
|
@GetMapping("create")
|
|
|
@@ -196,30 +209,73 @@ public class UserAuthenticationApproveController {
|
|
|
@ApiOperation(value="列表")
|
|
|
@RequestMapping(value = "pageList",method = RequestMethod.POST)
|
|
|
public MessageResult<Map> pageList(
|
|
|
- String id,
|
|
|
+ String approvalStatus,
|
|
|
@RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
|
|
|
@RequestParam(value="pageSize",defaultValue="20") int pageSize,
|
|
|
@RequestAttribute String subject){
|
|
|
-
|
|
|
- //当前用户ID
|
|
|
- System.out.println(subject);
|
|
|
-
|
|
|
MessageResult<Map> msgResult = new MessageResult<>();
|
|
|
|
|
|
Map<String,Object> searchParams = new HashMap<>();
|
|
|
|
|
|
List<Sort> sortList = new ArrayList<>();
|
|
|
- sortList.add(new Sort("id_","asc"));
|
|
|
+ sortList.add(new Sort("create_time","asc"));
|
|
|
|
|
|
- if (StringUtils.isNotEmpty(id)) {
|
|
|
- searchParams.put("id","%" + id + "%");
|
|
|
+ if (StringUtils.isNotEmpty(approvalStatus)) {
|
|
|
+ searchParams.put("approvalStatus",approvalStatus);
|
|
|
}
|
|
|
|
|
|
Page<UserAuthenticationApprove> page = userAuthenticationApproveService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
|
|
|
+ for(UserAuthenticationApprove userAuthenticationApprove : page.getResult()){
|
|
|
+ userAuthenticationApprove.setApprovalStatusName(dataDictionaryService.findNameByCatalogNameAndValue("实名制状态",userAuthenticationApprove.getApprovalStatus()));
|
|
|
+ JobUser jobUser = jobUserService.get(userAuthenticationApprove.getJobUserId());
|
|
|
+ userAuthenticationApprove.setJobUserName(jobUser.getRealName());
|
|
|
+ if(StringUtils.isNotEmpty(userAuthenticationApprove.getApprovePersonId())){
|
|
|
+ User user = userService.get(userAuthenticationApprove.getApprovePersonId());
|
|
|
+ userAuthenticationApprove.setApprovePersonName(user.getRealName());
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
msgResult.setResult(true);
|
|
|
msgResult.setData(PojoUtils.pageWrapper(page));
|
|
|
|
|
|
return msgResult;
|
|
|
}
|
|
|
+
|
|
|
+ @ApiOperation(value="实名审核")
|
|
|
+ @PostMapping("checked")
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ public MessageResult<UserAuthenticationApprove> checked(String id,@RequestAttribute String subject){
|
|
|
+ MessageResult<UserAuthenticationApprove> msgResult = new MessageResult<>();
|
|
|
+
|
|
|
+ try {
|
|
|
+ UserAuthenticationApprove userAuthenticationApprove = userAuthenticationApproveService.get(id);
|
|
|
+ userAuthenticationApprove.setApprovalStatus("2");
|
|
|
+ userAuthenticationApprove.setUpdateBy(subject);
|
|
|
+ userAuthenticationApprove.setUpdateTime(new Date());
|
|
|
+
|
|
|
+ int affectCount = userAuthenticationApproveService.update(userAuthenticationApprove);
|
|
|
+
|
|
|
+ if (affectCount > 0) {
|
|
|
+ JobUser jobUser = jobUserService.get(userAuthenticationApprove.getJobUserId());
|
|
|
+ jobUser.setIsAuthentication("1");
|
|
|
+ jobUser.setUpdateBy(subject);
|
|
|
+ jobUser.setUpdateTime(new Date());
|
|
|
+ jobUserService.update(jobUser);
|
|
|
+
|
|
|
+ msgResult.setResult(true);
|
|
|
+ msgResult.setData(userAuthenticationApprove);
|
|
|
+ } else {
|
|
|
+ msgResult.setResult(false);
|
|
|
+ msgResult.setMessage("数据库更新失败");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ catch(Exception ex){
|
|
|
+ logger.error(ex.getMessage(),ex);
|
|
|
+
|
|
|
+ msgResult.setResult(false);
|
|
|
+ msgResult.setMessage(ex.getMessage());
|
|
|
+ }
|
|
|
+
|
|
|
+ return msgResult;
|
|
|
+ }
|
|
|
}
|