Pārlūkot izejas kodu

管理员账号验证

huangzhiyong 6 gadi atpakaļ
vecāks
revīzija
8e4db5a8cc

+ 1 - 2
svr/svr-healthy-house/src/main/java/com/yihu/jw/healthyhouse/controller/facilities/FacilitiesController.java

@ -290,8 +290,7 @@ public class FacilitiesController extends EnvelopRestEndpoint {
    public ObjEnvelop importData(
            @ApiParam(name = "file", value = "文件", required = true)
            @RequestPart(value = "file") MultipartFile file,
            HttpServletRequest request,
            HttpServletResponse response) throws IOException, ManageException {
            HttpServletRequest request) throws IOException, ManageException {
        try {
            request.setCharacterEncoding("UTF-8");
            AExcelReader excelReader = new FacilityMsgReader();

+ 9 - 0
svr/svr-healthy-house/src/main/java/com/yihu/jw/healthyhouse/controller/user/UserController.java

@ -159,6 +159,15 @@ public class UserController  extends EnvelopRestEndpoint {
        return ObjEnvelop.getSuccess("身份证认证完成!");
    }
    @GetMapping("/existence")
    @ApiOperation(value = "【管理员】-验证管理员是否存在")
    public Envelop existence(
            @ApiParam(name = "telephone", value = "管理员账号", required = true)@RequestParam(required = true, name = "telephone") String telephone  ) throws ManageException {
        userService.checkManageUser( telephone);
        return ObjEnvelop.getSuccess("该管理员账号存在!");
    }
    @GetMapping("/exportToExcel")
    @ApiOperation(value = "用户列表导出excel")

+ 1 - 0
svr/svr-healthy-house/src/main/java/com/yihu/jw/healthyhouse/service/facility/FacilityService.java

@ -179,6 +179,7 @@ public class FacilityService extends BaseJpaService<Facility, FacilityDao> {
            facility.setCountyCode(townCode);
            facility.setCountyName(facilityMsg.getCounty());
            facility.setStreet(facilityMsg.getStreet());
            facility.setAddress( facilityMsg.getCity() + facilityMsg.getCounty() + facilityMsg.getStreet());
            facility.setStatus(facilityMsg.getStatus());
            facility.setOrgName(facilityMsg.getOrgName());
            facility.setServiceDay(facilityMsg.getServiceDate());

+ 14 - 1
svr/svr-healthy-house/src/main/java/com/yihu/jw/healthyhouse/service/user/UserService.java

@ -276,7 +276,20 @@ public class UserService extends BaseJpaService<User, UserDao> {
        userDao.save(user1);
    }
   
    /**
     *  验证管理员是否存在
     * @param userCode   登录账号
     * @throws ManageException
     */
    public void checkManageUser(String userCode) throws ManageException {
        User user1 = findByLoginCodeAndUserType(userCode, LoginInfo.USER_TYPE_SUPER_AdminManager);
        if (user1==null) {
            throw new ManageException("该管理员账号不存在");
        }
    }
    //excel中添加固定内容
    private void addStaticCell(Sheet sheet){
        //设置样式