|
@@ -1,455 +1,60 @@
|
|
-//package com.dragoninfo.dcuc.authweb.restcontroller.user;
|
|
|
|
-//
|
|
|
|
-//import com.dragoninfo.dcuc.authweb.common.SysConstants;
|
|
|
|
-//import com.dragoninfo.dcuc.authweb.restcontroller.user.manager.utils.AuthUtils;
|
|
|
|
-//import com.dragoninfo.dcuc.authweb.restcontroller.user.manager.utils.ExportExcelUtils;
|
|
|
|
-//import com.dragoninfo.dcuc.authweb.restcontroller.user.manager.utils.ImpExcelUtils;
|
|
|
|
-//import com.dragoninfo.dcuc.authweb.restcontroller.user.vo.AuxiliryVo;
|
|
|
|
-//import com.dragoninfo.dcuc.authweb.util.UserUtils;
|
|
|
|
-//import com.dragoninfo.dcuc.duceap.facade.IDuceapUploadFacade;
|
|
|
|
-//import com.dragoninfo.dcuc.duceap.upload.dto.DocContentDTO;
|
|
|
|
-//import com.dragoninfo.dcuc.org.org.entity.OrgInfo;
|
|
|
|
-//import com.dragoninfo.dcuc.org.org.facade.IOrgInfoFacade;
|
|
|
|
-//import com.dragoninfo.dcuc.user.admin.facade.IManageInfoFacade;
|
|
|
|
-//import com.dragoninfo.dcuc.user.admin.facade.IUserMtAuthFacade;
|
|
|
|
-//import com.dragoninfo.dcuc.user.admin.vo.NoticeUserVO;
|
|
|
|
-//import com.dragoninfo.dcuc.user.user.entity.UserInfo;
|
|
|
|
-//import com.dragoninfo.dcuc.user.user.entity.UserInfoView;
|
|
|
|
-//import com.dragoninfo.dcuc.user.user.enumresources.JobTypeEnum;
|
|
|
|
-//import com.dragoninfo.dcuc.user.user.enumresources.UserTypeEnum;
|
|
|
|
-//import com.dragoninfo.dcuc.user.user.facade.IAccountInfoFacade;
|
|
|
|
-//import com.dragoninfo.dcuc.user.user.facade.IPostInfoFacade;
|
|
|
|
-//import com.dragoninfo.dcuc.user.user.facade.IUserInfoFacade;
|
|
|
|
-//import com.dragoninfo.duceap.core.enums.ResultEnum;
|
|
|
|
-//import com.dragoninfo.duceap.core.response.Result;
|
|
|
|
-//import com.dragonsoft.duceap.base.entity.http.ResponseStatus;
|
|
|
|
-//import com.dragonsoft.duceap.base.entity.search.SearchDTO;
|
|
|
|
-//import com.dragonsoft.duceap.base.entity.uploader.FileHolder;
|
|
|
|
-//import com.dragonsoft.duceap.base.exception.ApplicationException;
|
|
|
|
-//import com.dragonsoft.duceap.commons.util.collections.CollectionUtils;
|
|
|
|
-//import com.dragonsoft.duceap.commons.util.json.JsonUtils;
|
|
|
|
-//import com.dragonsoft.duceap.commons.util.string.StringUtils;
|
|
|
|
-//import com.dragonsoft.duceap.core.context.ContextUtils;
|
|
|
|
-//import com.dragonsoft.duceap.core.search.Searchable;
|
|
|
|
-//import com.dragonsoft.duceap.core.search.enums.SearchOperator;
|
|
|
|
-//import com.dragonsoft.duceap.web.controller.BaseController;
|
|
|
|
-//import io.swagger.annotations.Api;
|
|
|
|
-//import io.swagger.annotations.ApiImplicitParam;
|
|
|
|
-//import io.swagger.annotations.ApiImplicitParams;
|
|
|
|
-//import io.swagger.annotations.ApiOperation;
|
|
|
|
-//import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
-//import org.springframework.data.domain.Page;
|
|
|
|
-//import org.springframework.web.bind.annotation.*;
|
|
|
|
-//
|
|
|
|
-//import javax.annotation.Resource;
|
|
|
|
-//import javax.servlet.http.HttpServletRequest;
|
|
|
|
-//import javax.servlet.http.HttpServletResponse;
|
|
|
|
-//import java.io.ByteArrayInputStream;
|
|
|
|
-//import java.io.IOException;
|
|
|
|
-//import java.io.InputStream;
|
|
|
|
-//import java.math.BigDecimal;
|
|
|
|
-//import java.util.Arrays;
|
|
|
|
-//import java.util.HashMap;
|
|
|
|
-//import java.util.List;
|
|
|
|
-//import java.util.Map;
|
|
|
|
-//
|
|
|
|
-//import static org.apache.commons.lang.StringUtils.isNotEmpty;
|
|
|
|
-//
|
|
|
|
-///** 辅警 Controller
|
|
|
|
-// * Created by yica on 2018/5/24.
|
|
|
|
-// */
|
|
|
|
-//@Api(tags = {"辅警管理接口"})
|
|
|
|
-//@RestController
|
|
|
|
-//@RequestMapping(value = "/usersvr")
|
|
|
|
-//public class AuxiliryPoliceController extends BaseController {
|
|
|
|
-//
|
|
|
|
-// @Autowired
|
|
|
|
-// private IOrgInfoFacade orgInfoFacade;
|
|
|
|
-// @Autowired
|
|
|
|
-// private IUserInfoFacade userInfoFacade;
|
|
|
|
-// @Autowired
|
|
|
|
-// private IAccountInfoFacade accountInfoFacade;
|
|
|
|
-// @Autowired
|
|
|
|
-// private IPostInfoFacade postInfoFacade;
|
|
|
|
-// @Autowired
|
|
|
|
-// IManageInfoFacade iManageInfoFacade;
|
|
|
|
-// @Resource
|
|
|
|
-// private IDuceapUploadFacade uploadhandler;
|
|
|
|
-// @Autowired
|
|
|
|
-// private IUserMtAuthFacade iUserMtAuthFacade;
|
|
|
|
-// @ApiOperation(value = "辅警查询列表")
|
|
|
|
-// @ApiImplicitParam(name = "SearchDTO", value = "查询条件")
|
|
|
|
-// @PostMapping(value = "auxiliarys")
|
|
|
|
-// public Result auxiliryPage(SearchDTO searchDTO) {
|
|
|
|
-// Searchable searchable=Searchable.toSearchable(searchDTO);
|
|
|
|
-// searchable.addSearchFilter("deleted", SearchOperator.eq,"0");
|
|
|
|
-// searchable.addSearchFilter("userType",SearchOperator.eq,UserTypeEnum.HELPER.getValue());
|
|
|
|
-// if(!searchDTO.getSearchCondition().contains("userStatus")){
|
|
|
|
-// searchable.addSearchFilter("userStatus",SearchOperator.ne,"0");
|
|
|
|
-// }
|
|
|
|
-// Page<UserInfo> page = userInfoFacade.userList(searchable.toSearchDTO());
|
|
|
|
-// return Result.success(page.getTotalElements(),page.getContent());
|
|
|
|
-// }
|
|
|
|
-//
|
|
|
|
-// /**
|
|
|
|
-// * 保存
|
|
|
|
-// *
|
|
|
|
-// * @return Result
|
|
|
|
-// */
|
|
|
|
-// @ApiOperation(value = "辅警修改")
|
|
|
|
-// @ApiImplicitParam(name = "AuxiliryVo", value = "辅警所有要保存的字段")
|
|
|
|
-// @PutMapping(value = "auxiliary/{id}")
|
|
|
|
-// public Result update(@RequestBody AuxiliryVo auxiliryVo) {
|
|
|
|
-// try {
|
|
|
|
-// auxiliryVo.setPoliceNumber(auxiliryVo.getPoliceNumber().toUpperCase());
|
|
|
|
-// UserInfo info=new UserInfo();
|
|
|
|
-// UserUtils.copyObject(info,auxiliryVo);
|
|
|
|
-// info.setFileHolders(auxiliryVo.getFile());
|
|
|
|
-// //姓名不能为ADMIN
|
|
|
|
-// if(UserUtils.verificaName(info)){
|
|
|
|
-// return Result.fail(ResultEnum.FAIL.getKey(),"姓名不能为ADMIN");
|
|
|
|
-// }
|
|
|
|
-// //判断是否重复
|
|
|
|
-// ResponseStatus responseStatus = userInfoFacade.checkUserNotRepeat(info);
|
|
|
|
-// if (!ResponseStatus.SUCCESS_CODE.equals(responseStatus.getStatusCode())) {
|
|
|
|
-// return Result.fail(ResultEnum.FAIL.getKey(),responseStatus.getMessage());
|
|
|
|
-// }
|
|
|
|
-// setUser(info);
|
|
|
|
-// userInfoFacade.saveOrUpdateAuxiliry(info);
|
|
|
|
-// } catch (Exception e) {
|
|
|
|
-// logger.error("保存失败",e);
|
|
|
|
-// Result.fail(ResultEnum.FAIL.getValue(), "保存失败");
|
|
|
|
-// }
|
|
|
|
-// return Result.success();
|
|
|
|
-// }
|
|
|
|
-//
|
|
|
|
-// /**
|
|
|
|
-// * 辅警属性赋值
|
|
|
|
-// * @param info
|
|
|
|
-// */
|
|
|
|
-// public void setUser(UserInfo info) {
|
|
|
|
-// //辅警属性赋值
|
|
|
|
-// //若由辅警转为警员,删除原有职位
|
|
|
|
-// if(UserTypeEnum.POLICE.getValue().equals(info.getUserType())){
|
|
|
|
-// postInfoFacade.del(info.getId());
|
|
|
|
-// }
|
|
|
|
-// OrgInfo orgInfo = orgInfoFacade.detail(info.getOrgId());
|
|
|
|
-// info.setOrgName(orgInfo.getFullName());
|
|
|
|
-// info.setOrgCode(orgInfo.getCode());
|
|
|
|
-// info.setOrgLevel(orgInfo.getOrgLevel());
|
|
|
|
-// info.setDeleted("0");
|
|
|
|
-// info.setBirth(isNotEmpty(info.getBirth())?info.getBirth().replaceAll("-","").substring(0,8):"");
|
|
|
|
-// info.setUserType(UserTypeEnum.HELPER.getValue());
|
|
|
|
-// }
|
|
|
|
-//
|
|
|
|
-// /**
|
|
|
|
-// * 保存
|
|
|
|
-// *
|
|
|
|
-// * @return Result
|
|
|
|
-// */
|
|
|
|
-// @ApiOperation(value = "辅警新增")
|
|
|
|
-// @ApiImplicitParam(name = "AuxiliryVo", value = "辅警所有要保存的字段")
|
|
|
|
-// @PostMapping(value = "auxiliary")
|
|
|
|
-// public Result save(@RequestBody AuxiliryVo auxiliryVo) {
|
|
|
|
-// try {
|
|
|
|
-// auxiliryVo.setPoliceNumber(auxiliryVo.getPoliceNumber().toUpperCase());
|
|
|
|
-// UserInfo info=new UserInfo();
|
|
|
|
-// UserUtils.copyObject(info,auxiliryVo);
|
|
|
|
-// info.setFileHolders(auxiliryVo.getFile());
|
|
|
|
-// //姓名不能为ADMIN
|
|
|
|
-// if(UserUtils.verificaName(info)){
|
|
|
|
-// return Result.fail(ResultEnum.FAIL.getKey(),"姓名不能为ADMIN");
|
|
|
|
-// }
|
|
|
|
-// //判断是否重复
|
|
|
|
-// ResponseStatus responseStatus = userInfoFacade.checkUserNotRepeat(info);
|
|
|
|
-// if (!ResponseStatus.SUCCESS_CODE.equals(responseStatus.getStatusCode())) {
|
|
|
|
-// return Result.fail(ResultEnum.FAIL.getKey(),responseStatus.getMessage());
|
|
|
|
-// }
|
|
|
|
-// //辅警属性赋值
|
|
|
|
-// setUser(info);
|
|
|
|
-// userInfoFacade.saveOrUpdateAuxiliry(info);
|
|
|
|
-// } catch (Exception e) {
|
|
|
|
-// logger.error("保存失败",e);
|
|
|
|
-// Result.fail(ResultEnum.FAIL.getKey(), "保存失败");
|
|
|
|
-// }
|
|
|
|
-// return Result.success("保存成功");
|
|
|
|
-// }
|
|
|
|
-//
|
|
|
|
-//
|
|
|
|
-// @PostMapping(value = "auxiliary/sort")
|
|
|
|
-// @ApiOperation(value = "辅警排序")
|
|
|
|
-// @ApiImplicitParams({
|
|
|
|
-// @ApiImplicitParam(name = "id", value = "ID", required = true),
|
|
|
|
-// @ApiImplicitParam(name = "sort", value = "排序 10:上升,20:下降", required = true)
|
|
|
|
-// })
|
|
|
|
-// public Result jySortPo(@RequestBody Map map) {
|
|
|
|
-// String id = (String) map.get("id");
|
|
|
|
-// String sort = (String) map.get("sort");
|
|
|
|
-// try {
|
|
|
|
-// userInfoFacade.jySort(id, sort);
|
|
|
|
-// return Result.success();
|
|
|
|
-// } catch (Exception e) {
|
|
|
|
-// logger.error("排序失败",e);
|
|
|
|
-// return Result.fail();
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
-//
|
|
|
|
-//
|
|
|
|
-// /**
|
|
|
|
-// * 详情
|
|
|
|
-// *
|
|
|
|
-// * @param id
|
|
|
|
-// * @return
|
|
|
|
-// */
|
|
|
|
-// @ApiOperation(value = "获取辅警")
|
|
|
|
-// @GetMapping(value = "auxiliary/{id}")
|
|
|
|
-// @ApiImplicitParam(name="id",value="id",required=true)
|
|
|
|
-// public Result detail(@PathVariable("id")String id) {
|
|
|
|
-// UserInfo userInfo = new UserInfo();
|
|
|
|
-// AuxiliryVo auxiliryVo=new AuxiliryVo();
|
|
|
|
-// userInfo = userInfoFacade.userDetail(id);
|
|
|
|
-// UserUtils.copyObject( auxiliryVo,userInfo);
|
|
|
|
-// //TODO 如果 user 和web 不在同一个库会不会有问题
|
|
|
|
-// List<FileHolder> fileHolders = uploadhandler.queryByBusiId(auxiliryVo.getId(), "");
|
|
|
|
-// auxiliryVo.setCreateTime(UserUtils.transformDate(userInfo.getCreateTime()));
|
|
|
|
-// auxiliryVo.setBirth( UserUtils.birthTransform(userInfo.getBirth(),"8"));
|
|
|
|
-// auxiliryVo.setFile(fileHolders);
|
|
|
|
-// return Result.success(auxiliryVo);
|
|
|
|
-// }
|
|
|
|
-//
|
|
|
|
-//
|
|
|
|
-// @ApiOperation(value = "获取辅警号和排序号")
|
|
|
|
-// @GetMapping(value = "/auxiliary/number")
|
|
|
|
-// public Result getAuxiliryNumber() {
|
|
|
|
-// try {
|
|
|
|
-// String policeNumber = userInfoFacade.policeNumber(UserTypeEnum.HELPER.getValue());
|
|
|
|
-// if (policeNumber.startsWith("FJ")) {
|
|
|
|
-// policeNumber = policeNumber.substring(2);
|
|
|
|
-// }
|
|
|
|
-// int pn = Integer.valueOf(policeNumber) + 1;
|
|
|
|
-// BigDecimal num = new BigDecimal(1);
|
|
|
|
-// BigDecimal sort = userInfoFacade.sortNew(UserTypeEnum.HELPER.getValue()).add(num);
|
|
|
|
-// HashMap<String, String> map = new HashMap<>();
|
|
|
|
-// map.put("policeNumber","FJ"+pn);
|
|
|
|
-// map.put("sortNo",sort+"");
|
|
|
|
-// return Result.success(map);
|
|
|
|
-// }catch (Exception e){
|
|
|
|
-// logger.error("获取警号失败",e);
|
|
|
|
-// return Result.fail();
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
-//
|
|
|
|
-//// /**
|
|
|
|
-//// * 详情
|
|
|
|
-//// *
|
|
|
|
-//// * @return
|
|
|
|
-//// */
|
|
|
|
-//// @ApiOperation("详情")
|
|
|
|
-//// @GetMapping(value = "detail")
|
|
|
|
-//// @ApiImplicitParams({
|
|
|
|
-//// @ApiImplicitParam(name="id",value="id",required=true),
|
|
|
|
-//// @ApiImplicitParam(name="type",value="type")
|
|
|
|
-//// })
|
|
|
|
-//// public Result detail(@RequestParam("id")String id) {
|
|
|
|
-//// //todo type 拿出来的userinfo做什么用
|
|
|
|
-//// // String type = (String) map.get("type");
|
|
|
|
-//// UserInfo userInfo = new UserInfo();
|
|
|
|
-//// HashMap resultMap = new HashMap<>();
|
|
|
|
-//// userInfo = userInfoFacade.userDetail(id);
|
|
|
|
-//// String policeBusiness = "";
|
|
|
|
-//// if (StringUtils.isNotEmpty(userInfo.getPoliceBusiness())) {
|
|
|
|
-//// String[] businesses = null;
|
|
|
|
-//// businesses = userInfo.getPoliceBusiness().split(",");
|
|
|
|
-//// for (String business : businesses) {
|
|
|
|
-//// String str = CodeResourceUtils.convert("DM_POLICE_BUSINESS", business, "", "CODE");
|
|
|
|
-//// policeBusiness += str + ",";
|
|
|
|
-//// }
|
|
|
|
-//// if (policeBusiness.length() > 1) {
|
|
|
|
-//// policeBusiness = policeBusiness.substring(0, policeBusiness.length() - 1);
|
|
|
|
-//// }
|
|
|
|
-//// }
|
|
|
|
-////// if (StringUtils.isNotEmpty(type) && "search".equals(type)) {
|
|
|
|
-////// boolean enable = userListFacade.isEnable(UserUtils.getSysUserListId());
|
|
|
|
-////// if (enable) {
|
|
|
|
-////// String userIds = userListFacade.userListDetailListStrByListId(UserUtils.getSysUserListId());
|
|
|
|
-////// userInfo = UserUtils.objectHandler(userInfo, userIds);
|
|
|
|
-////// }
|
|
|
|
-////// resultMap.put("type", type);
|
|
|
|
-////// }
|
|
|
|
-//// UserInfo adminUser=new UserInfo();
|
|
|
|
-//// List<NoticeUserVO> targetList =this.getAdmins(userInfo.getOrgId());
|
|
|
|
-//// if (CollectionUtils.isNotEmpty(targetList)) {//找到管理员
|
|
|
|
-//// adminUser = userInfoFacade.userDetail(targetList.get(0).getUserId());
|
|
|
|
-//// adminUser.setMobilePrivate(targetList.get(0).getMobile());
|
|
|
|
-//// }
|
|
|
|
-//// AuxiliryVo auxiliryVo=new AuxiliryVo();
|
|
|
|
-//// UserUtils.copyObject(auxiliryVo,userInfo);
|
|
|
|
-//// List<FileHolder> fileHolders = uploadhandler.queryByBusiId(auxiliryVo.getId(), "");
|
|
|
|
-//// auxiliryVo.setFile(fileHolders);
|
|
|
|
-//// auxiliryVo.setCreateTime(UserUtils.TransformDate(userInfo.getCreateTime()));
|
|
|
|
-//// resultMap.put("adminUser",adminUser);
|
|
|
|
-//// resultMap.put("userBusiness", policeBusiness);
|
|
|
|
-//// resultMap.put("model", auxiliryVo);
|
|
|
|
-//// return Result.success(resultMap);
|
|
|
|
-//// }
|
|
|
|
-//
|
|
|
|
-// private List<NoticeUserVO> getAdmins(String orgId){
|
|
|
|
-// List<NoticeUserVO> targetList = iManageInfoFacade.getOrgMgeManager(orgId);
|
|
|
|
-// if(CollectionUtils.isEmpty(targetList)){
|
|
|
|
-// OrgInfo orgInfo = orgInfoFacade.detail(orgId);
|
|
|
|
-// if (StringUtils.isNotBlank(orgInfo.getUpGovId())){
|
|
|
|
-// String upGovId = orgInfo.getUpGovId();
|
|
|
|
-// targetList = getAdmins(upGovId);
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
-// return targetList;
|
|
|
|
-// }
|
|
|
|
-//
|
|
|
|
-//
|
|
|
|
-//// @PostMapping(value = "getInfo")
|
|
|
|
-//// public Result getInfo(Model model) {
|
|
|
|
-//// AccountInfo accountInfo = new AccountInfo();
|
|
|
|
-//// model.addAttribute("model", accountInfo);
|
|
|
|
-//// return Result.success(accountInfo);
|
|
|
|
-//// }
|
|
|
|
-//
|
|
|
|
-//
|
|
|
|
-//
|
|
|
|
-// /**
|
|
|
|
-// * 删除
|
|
|
|
-// *
|
|
|
|
-// * @return
|
|
|
|
-// */
|
|
|
|
-// @DeleteMapping(value = "auxiliary/{id}")
|
|
|
|
-// @ApiOperation(value = "辅警删除")
|
|
|
|
-// @ApiImplicitParam(name="id",value="id",required=true)
|
|
|
|
-// public Result del(@PathVariable("id") String id) {
|
|
|
|
-// try {
|
|
|
|
-// userInfoFacade.deleteUser(id);
|
|
|
|
-// accountInfoFacade.del(id);
|
|
|
|
-// } catch (Exception e) {
|
|
|
|
-// Result.fail(ResultEnum.SERVICE_FAIL.getValue(), "删除失败");
|
|
|
|
-// }
|
|
|
|
-// return Result.success("删除成功");
|
|
|
|
-// }
|
|
|
|
-//
|
|
|
|
-//
|
|
|
|
-// @PostMapping(value = "auxiliary/import")
|
|
|
|
-// @ApiImplicitParam(name = "fileId", value = "导入文件id")
|
|
|
|
-// @ApiOperation(value = "警辅导入")
|
|
|
|
-// public Result<Object> impExcel(@RequestBody String fileId) {
|
|
|
|
-// try {
|
|
|
|
-// fileId = JsonUtils.parseObject(fileId).getString("fileId");
|
|
|
|
-// DocContentDTO fileContent = uploadhandler.getFileContent(fileId);
|
|
|
|
-// byte[] fileData = fileContent.getFileData();
|
|
|
|
-// InputStream inputStream = new ByteArrayInputStream(fileData);
|
|
|
|
-// List<UserInfo> list = ImpExcelUtils.loadScoreInfo(inputStream, UserTypeEnum.HELPER.getValue());
|
|
|
|
-// String message = this.impAuxiliry(list);
|
|
|
|
-// if (message != null) {
|
|
|
|
-// if(message.startsWith("身份证或警号重复,未保存人员")){
|
|
|
|
-// throw new NumberFormatException(message);
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
-// return Result.success("导入成功");
|
|
|
|
-// }catch (IOException e) {
|
|
|
|
-// logger.error(e.getMessage(), e);
|
|
|
|
-// return Result.fail("300","导入文件类型错误");
|
|
|
|
-// } catch (NumberFormatException e) {
|
|
|
|
-//
|
|
|
|
-// return Result.fail("300",e.getMessage());
|
|
|
|
-// } catch (Exception e) {
|
|
|
|
-// logger.error(e.getMessage(), e);
|
|
|
|
-// return Result.fail("300","导入失败");
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
-//
|
|
|
|
-//
|
|
|
|
-//
|
|
|
|
-// @ApiOperation(value = "辅警导出信息")
|
|
|
|
-// @ApiImplicitParam(name = "SearchDTO", value = "查询条件")
|
|
|
|
-// @PostMapping(value = "auxiliary/exports")
|
|
|
|
-// public void listExport(SearchDTO searchDTO, HttpServletRequest request, HttpServletResponse response) {
|
|
|
|
-// try {
|
|
|
|
-// Searchable searchable=Searchable.toSearchable(searchDTO);
|
|
|
|
-// searchable.addSearchFilter("deleted",SearchOperator.eq,"0");
|
|
|
|
-// searchable.addSearchFilter("userType",SearchOperator.eq,UserTypeEnum.HELPER.getValue());
|
|
|
|
-// searchable.addSearchFilter("jobType", SearchOperator.notIn, JobTypeEnum.LZ.getValue());
|
|
|
|
-// searchDTO = searchable.toSearchDTO();
|
|
|
|
-// searchDTO.setSize(String.valueOf(SysConstants.EXPORT_NUMBER_MAX));
|
|
|
|
-// List<UserInfo> list = userInfoFacade.userList(searchDTO).getContent();
|
|
|
|
-// for(UserInfo userInfo : list){
|
|
|
|
-// userInfo.setPoliceBusiness("");
|
|
|
|
-// }
|
|
|
|
-// searchDTO.setMetadata("[{\"name\":\"name\",\"displyName\":\"姓名\"},{\"name\":\"policeNumber\",\"displyName\":\"辅警编号\"}," +
|
|
|
|
-// "{\"name\":\"idcard\",\"displyName\":\"身份证\"}," +
|
|
|
|
-// "{\"name\":\"orgCode\",\"displyName\":\"单位机构代码\"}," +
|
|
|
|
-// "{\"name\":\"mobileWork\",\"displyName\":\"手机号码(接收短信验证码)\"}," +
|
|
|
|
-// "{\"name\":\"nation\",\"displyName\":\"民族(表码)\"}," +
|
|
|
|
-// "{\"name\":\"auxiliaryType\",\"displyName\":\"人员类型(表码)\"}," +
|
|
|
|
-// "{\"name\":\"policeCategory\",\"displyName\":\"警种(表码)\"},{\"name\":\"userStatus\",\"displyName\":\"人员状态(表码)\"}" +
|
|
|
|
-// "]");
|
|
|
|
-//// exportExcel(name, list, searchable.getMetaData(), request, response);
|
|
|
|
-// ExportExcelUtils.exportAuxiliarypolice("辅警信息", list, Searchable.toSearchable(searchDTO).getMetaData(), request, response);
|
|
|
|
-// } catch (Exception e) {
|
|
|
|
-// throw new ApplicationException(300, "导出失败", e);
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
-//
|
|
|
|
-// @ApiOperation(value = "辅警批量导出信息")
|
|
|
|
-// @ApiImplicitParam(name = "SearchDTO", value = "查询条件")
|
|
|
|
-// @GetMapping(value="auxiliary/exports/{orgIds}")
|
|
|
|
-// private void batchExport(@PathVariable String orgIds,HttpServletRequest request,HttpServletResponse response){
|
|
|
|
-// try{
|
|
|
|
-// SearchDTO searchDTO=new SearchDTO();
|
|
|
|
-// List<String>lists = Arrays.asList(orgIds.split(","));
|
|
|
|
-// List<UserInfoView> userInfoViews = userInfoFacade.batchExportAuxil(lists);
|
|
|
|
-// searchDTO.setMetadata("[{\"name\":\"name\",\"displyName\":\"姓名\"},{\"name\":\"policeNumber\",\"displyName\":\"辅警编号\"}," +
|
|
|
|
-// "{\"name\":\"idcard\",\"displyName\":\"身份证\"}," +
|
|
|
|
-// "{\"name\":\"orgCode\",\"displyName\":\"单位机构代码\"}," +
|
|
|
|
-// "{\"name\":\"mobileWork\",\"displyName\":\"手机号码(接收短信验证码)\"}," +
|
|
|
|
-// "{\"name\":\"nation\",\"displyName\":\"民族(表码)\"}," +
|
|
|
|
-// "{\"name\":\"auxiliaryType\",\"displyName\":\"人员类型(表码)\"}," +
|
|
|
|
-// "{\"name\":\"policeCategory\",\"displyName\":\"警种(表码)\"},{\"name\":\"userStatus\",\"displyName\":\"人员状态(表码)\"}" +
|
|
|
|
-// "]");
|
|
|
|
-// ExportExcelUtils.batchExportAuxiliarypolice("辅警信息", userInfoViews, Searchable.toSearchable(searchDTO).getMetaData(), request, response);
|
|
|
|
-//// exportExcel("辅警信息", userInfoViews, Searchable.toSearchable(searchDTO).getMetaData(), request, response);
|
|
|
|
-// }catch (Exception e){
|
|
|
|
-// logger.error(e.getMessage(), e);
|
|
|
|
-// throw new ApplicationException(300, "导出失败", e);
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
-//
|
|
|
|
-//
|
|
|
|
-//
|
|
|
|
-//
|
|
|
|
-// public String impAuxiliry(List<UserInfo> list) {
|
|
|
|
-// List<String>orgMgeMt = iUserMtAuthFacade.mgeUserRightRangeList(ContextUtils.getUserInfo().getId());
|
|
|
|
-// BigDecimal num = new BigDecimal(1);
|
|
|
|
-// BigDecimal sort = userInfoFacade.sortNew(UserTypeEnum.HELPER.getValue()).add(num);
|
|
|
|
-// int auto_increment = 1;
|
|
|
|
-// for (UserInfo info : list) {
|
|
|
|
-//// OrgInfo orgInfo = orgInfoFacade.detail(info.getOrgId());
|
|
|
|
-// OrgInfo orgInfo = orgInfoFacade.getOrgInfoByCode(info.getOrgCode());
|
|
|
|
-// if (orgInfo == null) {
|
|
|
|
-// throw new NumberFormatException("身份证"+info.getIdcard()+"用户的单位机构代码不存在!");
|
|
|
|
-// }
|
|
|
|
-// if(!AuthUtils.isHaveAuth(orgMgeMt,orgInfo)){
|
|
|
|
-// throw new NumberFormatException("没有身份证"+info.getIdcard()+"用户所填写单位机构代码的管理权限!");
|
|
|
|
-// }
|
|
|
|
-// if(StringUtils.isBlank(info.getPoliceNumber())){
|
|
|
|
-// String policeNumber = userInfoFacade.policeNumber(UserTypeEnum.HELPER.getValue());
|
|
|
|
-// int pn = Integer.valueOf(policeNumber.substring(2)) + auto_increment;
|
|
|
|
-// info.setPoliceNumber("FJ" + String.format("%06d", pn));
|
|
|
|
-// }
|
|
|
|
-// info.setSortNo(sort);
|
|
|
|
-// info.setOrgId(orgInfo.getId());
|
|
|
|
-// info.setOrgName(orgInfo.getFullName());
|
|
|
|
-// info.setOrgCode(orgInfo.getCode());
|
|
|
|
-// info.setOrgLevel(orgInfo.getOrgLevel());
|
|
|
|
-// sort = sort.add(num);
|
|
|
|
-// auto_increment++;
|
|
|
|
-// }
|
|
|
|
-// return userInfoFacade.impAuxiliryGd(list);
|
|
|
|
-// }
|
|
|
|
-//
|
|
|
|
-//}
|
|
|
|
|
|
+package com.dragoninfo.dcuc.authweb.restcontroller.user;
|
|
|
|
+
|
|
|
|
+import com.dragoninfo.dcuc.authweb.restcontroller.user.vo.AuxiliryVo;
|
|
|
|
+import com.dragoninfo.dcuc.authweb.util.UserUtils;
|
|
|
|
+import com.dragoninfo.dcuc.duceap.facade.IDuceapUploadFacade;
|
|
|
|
+import com.dragoninfo.dcuc.user.admin.facade.IManageInfoFacade;
|
|
|
|
+import com.dragoninfo.dcuc.user.user.entity.UserInfo;
|
|
|
|
+import com.dragoninfo.dcuc.user.user.facade.IUserInfoFacade;
|
|
|
|
+import com.dragoninfo.duceap.core.response.Result;
|
|
|
|
+import com.dragonsoft.duceap.base.entity.uploader.FileHolder;
|
|
|
|
+import com.dragonsoft.duceap.web.controller.BaseController;
|
|
|
|
+import io.swagger.annotations.Api;
|
|
|
|
+import io.swagger.annotations.ApiImplicitParam;
|
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
+
|
|
|
|
+import javax.annotation.Resource;
|
|
|
|
+import java.util.List;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+/** 辅警 Controller
|
|
|
|
+ * Created by yica on 2018/5/24.
|
|
|
|
+ */
|
|
|
|
+@Api(tags = {"辅警管理接口"})
|
|
|
|
+@RestController
|
|
|
|
+@RequestMapping(value = "/usersvr/v2")
|
|
|
|
+public class AuxiliryPoliceController extends BaseController {
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ private IUserInfoFacade userInfoFacade;
|
|
|
|
+ @Autowired
|
|
|
|
+ IManageInfoFacade iManageInfoFacade;
|
|
|
|
+ @Resource
|
|
|
|
+ private IDuceapUploadFacade uploadhandler;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 详情
|
|
|
|
+ *
|
|
|
|
+ * @param id
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @ApiOperation(value = "获取辅警")
|
|
|
|
+ @GetMapping(value = "auxiliary/{id}")
|
|
|
|
+ @ApiImplicitParam(name="id",value="id",required=true)
|
|
|
|
+ public Result detail(@PathVariable("id")String id) {
|
|
|
|
+ UserInfo userInfo = new UserInfo();
|
|
|
|
+ AuxiliryVo auxiliryVo=new AuxiliryVo();
|
|
|
|
+ userInfo = userInfoFacade.userDetail(id);
|
|
|
|
+ UserUtils.copyObject( auxiliryVo,userInfo);
|
|
|
|
+ //TODO 如果 user 和web 不在同一个库会不会有问题
|
|
|
|
+ List<FileHolder> fileHolders = uploadhandler.queryByBusiId(auxiliryVo.getId(), "");
|
|
|
|
+ auxiliryVo.setCreateTime(UserUtils.transformDate(userInfo.getCreateTime()));
|
|
|
|
+ auxiliryVo.setBirth( UserUtils.birthTransform(userInfo.getBirth(),"8"));
|
|
|
|
+ auxiliryVo.setFile(fileHolders);
|
|
|
|
+ return Result.success(auxiliryVo);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+}
|