New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.equipment.UnionInspectionDto; |
| | | import com.panzhihua.common.model.dtos.equipment.UnionReportDto; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.service.community.ComEquipmentUnionInspectionFeign; |
| | | import com.panzhihua.common.service.community.ComEquipmentUnionRePortFeign; |
| | | import com.panzhihua.common.service.user.UserService; |
| | | import io.swagger.annotations.Api; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/unionInspection/") |
| | | @Api(tags = {"户外劳工站巡查"}) |
| | | public class UnionInspectionApi extends BaseController { |
| | | |
| | | @Resource |
| | | private ComEquipmentUnionInspectionFeign comEquipmentUnionInspectionFeign; |
| | | |
| | | @Resource |
| | | private UserService userService; |
| | | |
| | | |
| | | /** |
| | | * 新增户外劳工站巡查 |
| | | * |
| | | * @param unionInspectionDto |
| | | * @return 新增结果 |
| | | */ |
| | | @PostMapping("/add") |
| | | public R add(@RequestBody UnionInspectionDto unionInspectionDto) { |
| | | // LoginUserInfoVO loginUser = this.getLoginUserInfo(); |
| | | // LoginUserInfoVO userInfoByUserId = userService.getUserInfoByUserId(loginUser.getUserId().toString()).getData(); |
| | | LoginUserInfoVO userInfoByUserId = userService.getUserInfoByUserId("1588095866109984769").getData(); |
| | | unionInspectionDto.setCreateUserId(userInfoByUserId.getUserId()); |
| | | return comEquipmentUnionInspectionFeign.add(unionInspectionDto); |
| | | } |
| | | |
| | | /** |
| | | * 分页户外劳工站巡查 |
| | | * |
| | | * @param unionInspectionDto |
| | | * @return 动态结果 |
| | | */ |
| | | @PostMapping("/query") |
| | | public R query(@RequestBody UnionInspectionDto unionInspectionDto) { |
| | | // LoginUserInfoVO loginUser = this.getLoginUserInfo(); |
| | | // LoginUserInfoVO userInfoByUserId = userService.getUserInfoByUserId(loginUser.getUserId().toString()).getData(); |
| | | LoginUserInfoVO userInfoByUserId = userService.getUserInfoByUserId("1588095866109984769").getData(); |
| | | unionInspectionDto.setCreateUserId(userInfoByUserId.getUserId()); |
| | | unionInspectionDto.setIsApplets(1); |
| | | return comEquipmentUnionInspectionFeign.query(unionInspectionDto); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.equipment.UnionReportDto; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.service.community.ComEquipmentUnionRePortFeign; |
| | | import com.panzhihua.common.service.community.ComEquipmentUnionUserFeign; |
| | | import com.panzhihua.common.service.user.UserService; |
| | | import io.swagger.annotations.Api; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/unionReport/") |
| | | @Api(tags = {"户外劳工站上报"}) |
| | | public class UnionReportApi extends BaseController { |
| | | |
| | | @Resource |
| | | private ComEquipmentUnionRePortFeign comEquipmentUnionRePortFeign; |
| | | |
| | | @Resource |
| | | private UserService userService; |
| | | |
| | | |
| | | /** |
| | | * 户外劳工站上报表 |
| | | * |
| | | * @param unionReportDto |
| | | * @return 新增结果 |
| | | */ |
| | | @PostMapping("/add") |
| | | public R add(@RequestBody UnionReportDto unionReportDto) { |
| | | // LoginUserInfoVO loginUser = this.getLoginUserInfo(); |
| | | // LoginUserInfoVO userInfoByUserId = userService.getUserInfoByUserId(loginUser.getUserId().toString()).getData(); |
| | | LoginUserInfoVO userInfoByUserId = userService.getUserInfoByUserId("1588095866109984769").getData(); |
| | | unionReportDto.setCreateUserId(userInfoByUserId.getUserId()); |
| | | return comEquipmentUnionRePortFeign.add(unionReportDto); |
| | | } |
| | | |
| | | /** |
| | | * 分页户外劳工站上报表 |
| | | * |
| | | * @param unionReportDto |
| | | * @return 动态结果 |
| | | */ |
| | | @PostMapping("/query") |
| | | public R query(@RequestBody UnionReportDto unionReportDto) { |
| | | // LoginUserInfoVO loginUser = this.getLoginUserInfo(); |
| | | // LoginUserInfoVO userInfoByUserId = userService.getUserInfoByUserId(loginUser.getUserId().toString()).getData(); |
| | | LoginUserInfoVO userInfoByUserId = userService.getUserInfoByUserId("1588095866109984769").getData(); |
| | | unionReportDto.setCreateUserId(userInfoByUserId.getUserId()); |
| | | unionReportDto.setIsApplets(1); |
| | | return comEquipmentUnionRePortFeign.query(unionReportDto); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | |
| | | import com.panzhihua.common.constants.TokenConstant; |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.equipment.UnionOutdoorSiteDto; |
| | | import com.panzhihua.common.model.dtos.equipment.UnionUserDto; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.acid.ComActAcidRecordVO; |
| | | import com.panzhihua.common.service.community.ComEquipmentUnionOutdoorSiteFeign; |
| | | import com.panzhihua.common.service.community.ComEquipmentUnionUserFeign; |
| | | import com.panzhihua.common.service.user.UserService; |
| | | import com.panzhihua.common.utlis.JWTTokenUtil; |
| | | import io.jsonwebtoken.Claims; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | |
| | | |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/unionUser/") |
| | | @Api(tags = {"户外劳工站登录"}) |
| | | public class UnionUserApi extends BaseController { |
| | | |
| | | @Resource |
| | | private ComEquipmentUnionUserFeign comEquipmentUnionUserFeign; |
| | | |
| | | @Resource |
| | | private UserService userService; |
| | | |
| | | |
| | | /** |
| | | * 总工会户外劳登录 |
| | | * |
| | | * |
| | | * @return 总工会户外劳共用户 |
| | | */ |
| | | @ApiOperation(value = "总工会户外劳登录",response = UnionUserDto.class) |
| | | @GetMapping("/login") |
| | | public R login(){ |
| | | // LoginUserInfoVO loginUser = this.getLoginUserInfo(); |
| | | // LoginUserInfoVO userInfoByUserId = userService.getUserInfoByUserId(loginUser.getUserId().toString()).getData(); |
| | | LoginUserInfoVO userInfoByUserId = userService.getUserInfoByUserId("1588095866109984769").getData(); |
| | | return comEquipmentUnionUserFeign.login(userInfoByUserId); |
| | | } |
| | | |
| | | /** |
| | | * 总工会户外劳工站用户认证 |
| | | * |
| | | * @param unionUserDto |
| | | * @return 总工会户外劳共用户 |
| | | */ |
| | | @ApiOperation(value = "总工会户外劳工站用户认证",response = UnionUserDto.class) |
| | | @PostMapping("/authentication") |
| | | public R authentication(@RequestBody UnionUserDto unionUserDto){ |
| | | // LoginUserInfoVO loginUser = this.getLoginUserInfo(); |
| | | // LoginUserInfoVO userInfoByUserId = userService.getUserInfoByUserId(loginUser.getUserId().toString()).getData(); |
| | | LoginUserInfoVO userInfoByUserId = userService.getUserInfoByUserId("1588095866109984769").getData(); |
| | | unionUserDto.setUserId(userInfoByUserId.getUserId()); |
| | | // unionUserDto.setId(userInfoByUserId.getId); |
| | | return comEquipmentUnionUserFeign.authentication(unionUserDto); |
| | | } |
| | | } |
| | |
| | | public class SwaggerConfig { |
| | | @Bean |
| | | public Docket createRestApi() { |
| | | return new Docket(DocumentationType.SWAGGER_2).apiInfo(apiInfo()).select() |
| | | .apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class)) |
| | | .apis(RequestHandlerSelectors.basePackage("com.panzhihua")).paths(PathSelectors.any()).build(); |
| | | return new Docket(DocumentationType.SWAGGER_2).apiInfo(apiInfo()).enable(true).select() |
| | | // .apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class)) |
| | | .apis(RequestHandlerSelectors.basePackage("com.panzhihua.applets")).build(); |
| | | } |
| | | |
| | | private ApiInfo apiInfo() { |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.equipment; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.time.LocalDateTime; |
| | | @Data |
| | | @ApiModel("户外劳工站巡查表") |
| | | public class UnionInspectionDto { |
| | | |
| | | /** |
| | | * ,主键 |
| | | */ |
| | | @ApiModelProperty(value = "主键") |
| | | private Integer id; |
| | | |
| | | /** |
| | | * 创建人户外劳工站id |
| | | */ |
| | | @ApiModelProperty(value = "创建人户外劳工站id") |
| | | private Long createUnionUserId; |
| | | |
| | | /** |
| | | * 站点id |
| | | */ |
| | | @ApiModelProperty(value = "站点id") |
| | | private Integer siteId; |
| | | |
| | | /** |
| | | * 创建人id |
| | | */ |
| | | @ApiModelProperty(value = "创建人id") |
| | | private Long createUserId; |
| | | |
| | | /** |
| | | * 类型(1正常2异常) |
| | | */ |
| | | @ApiModelProperty(value = "类型(1正常2异常)") |
| | | private Integer type; |
| | | |
| | | /** |
| | | * 内容 |
| | | */ |
| | | @ApiModelProperty(value = "内容") |
| | | private String content; |
| | | |
| | | /** |
| | | * 图片地址 |
| | | */ |
| | | @ApiModelProperty(value = "图片地址") |
| | | private String url; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @ApiModelProperty(value = "创建时间") |
| | | private LocalDateTime createAt; |
| | | |
| | | /** |
| | | * 标题 |
| | | */ |
| | | @ApiModelProperty(value = "标题") |
| | | private String title; |
| | | |
| | | /** |
| | | * 处理人户外劳工站id |
| | | */ |
| | | @ApiModelProperty(value = "处理人户外劳工站id") |
| | | private Integer disposeUnionUserId; |
| | | |
| | | /** |
| | | * 处理内容 |
| | | */ |
| | | @ApiModelProperty(value = "处理内容") |
| | | private String disposeContent; |
| | | |
| | | /** |
| | | * 处理时间 |
| | | */ |
| | | @ApiModelProperty(value = "处理时间") |
| | | private LocalDateTime disposeAt; |
| | | |
| | | /** |
| | | * 处理照片地址 |
| | | */ |
| | | @ApiModelProperty(value = "处理照片地址") |
| | | private String disposeUrl; |
| | | |
| | | /** |
| | | * 状态(1未回复2已回复) |
| | | */ |
| | | @ApiModelProperty(value = "状态(1未接单2已接单3已解决)") |
| | | private Integer status; |
| | | |
| | | |
| | | /** |
| | | * 是否小程序 |
| | | */ |
| | | @ApiModelProperty(value = "是否小程序 1是 0否") |
| | | private Integer isApplets; |
| | | |
| | | @ApiModelProperty(value = "分页-当前页数", example = "1") |
| | | private Long pageNum = 1L; |
| | | |
| | | @ApiModelProperty(value = "分页-每页记录数", example = "10") |
| | | private Long pageSize = 10L; |
| | | |
| | | } |
| | |
| | | private String mobilePhone; |
| | | |
| | | /** |
| | | * 关键词 |
| | | */ |
| | | @ApiModelProperty(value = "关键词") |
| | | private String keyWord; |
| | | |
| | | /** |
| | | * 服务范围 |
| | | */ |
| | | @ApiModelProperty(value = "服务范围") |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.equipment; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Data |
| | | @ApiModel("户外劳工站上报表") |
| | | public class UnionReportDto { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * ,主键 |
| | | */ |
| | | @ApiModelProperty(value = "主键") |
| | | private Integer id; |
| | | |
| | | /** |
| | | * 创建人户外劳工站id |
| | | */ |
| | | @ApiModelProperty(value = "创建人户外劳工站id") |
| | | private Long createUnionUserId; |
| | | |
| | | /** |
| | | * 站点id |
| | | */ |
| | | @ApiModelProperty(value = "站点id") |
| | | private Integer siteId; |
| | | |
| | | /** |
| | | * 创建人id |
| | | */ |
| | | @ApiModelProperty(value = "创建人id") |
| | | private Long createUserId; |
| | | |
| | | |
| | | /** |
| | | * 类型(1意见反馈2故障保修) |
| | | */ |
| | | @ApiModelProperty(value = "类型(1意见反馈2故障保修)") |
| | | private Integer type; |
| | | |
| | | /** |
| | | * 内容 |
| | | */ |
| | | @ApiModelProperty(value = "内容") |
| | | private String content; |
| | | |
| | | /** |
| | | * 图片地址 |
| | | */ |
| | | @ApiModelProperty(value = "图片地址") |
| | | private String url; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @ApiModelProperty(value = "创建时间") |
| | | private LocalDateTime createAt; |
| | | |
| | | /** |
| | | * 标题 |
| | | */ |
| | | @ApiModelProperty(value = "标题") |
| | | private String title; |
| | | |
| | | /** |
| | | * 处理人户外劳工站id |
| | | */ |
| | | @ApiModelProperty(value = "处理人户外劳工站id") |
| | | private Integer disposeUnionUserId; |
| | | |
| | | /** |
| | | * 处理内容 |
| | | */ |
| | | @ApiModelProperty(value = "处理内容") |
| | | private String disposeContent; |
| | | |
| | | /** |
| | | * 处理时间 |
| | | */ |
| | | @ApiModelProperty(value = "处理时间") |
| | | private LocalDateTime disposeAt; |
| | | |
| | | /** |
| | | * 处理照片地址 |
| | | */ |
| | | @ApiModelProperty(value = "处理照片地址") |
| | | private String disposeUrl; |
| | | |
| | | /** |
| | | * 是否小程序 |
| | | */ |
| | | @ApiModelProperty(value = "是否小程序 1是 0否") |
| | | private Integer isApplets; |
| | | |
| | | /** |
| | | * 状态(1未回复2已回复) |
| | | */ |
| | | @ApiModelProperty(value = "状态(1未回复2已回复)") |
| | | private Integer status; |
| | | |
| | | |
| | | @ApiModelProperty(value = "分页-当前页数", example = "1") |
| | | private Long pageNum = 1L; |
| | | |
| | | @ApiModelProperty(value = "分页-每页记录数", example = "10") |
| | | private Long pageSize = 10L; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.equipment; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Data |
| | | @ApiModel("总工会户外劳工站") |
| | | public class UnionUserDto { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键id |
| | | */ |
| | | @ApiModelProperty(value = "主键id") |
| | | private Long id; |
| | | |
| | | /** |
| | | * () |
| | | */ |
| | | @ApiModelProperty(value = "姓名") |
| | | private String name; |
| | | |
| | | /** |
| | | *商家名称 |
| | | */ |
| | | @ApiModelProperty(value = "商家名称") |
| | | private String sex; |
| | | |
| | | /** |
| | | * 联系方式 |
| | | */ |
| | | @ApiModelProperty(value = "联系方式") |
| | | private String phone; |
| | | |
| | | /** |
| | | * 人员类型(1、普通工会用户 2、巡查人员 3、站点负责人 |
| | | */ |
| | | @ApiModelProperty(value = "人员类型(1、普通工会用户 2、巡查人员 3、站点负责人 ") |
| | | private String type; |
| | | |
| | | /** |
| | | * 删除标识 |
| | | */ |
| | | @ApiModelProperty(value = "删除标识") |
| | | private Boolean deleteFlag; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | @ApiModelProperty(value = "备注") |
| | | private String remark; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @ApiModelProperty(value = "创建时间") |
| | | private LocalDateTime createAt; |
| | | |
| | | /** |
| | | * 更新时间 |
| | | */ |
| | | @ApiModelProperty(value = "更新时间") |
| | | private LocalDateTime updateAt; |
| | | |
| | | /** |
| | | * 修改用户 |
| | | */ |
| | | @ApiModelProperty(value = "修改用户") |
| | | private Long updateBy; |
| | | |
| | | /** |
| | | * 创建用户 |
| | | */ |
| | | @ApiModelProperty(value = "创建用户") |
| | | private Long createBy; |
| | | |
| | | /** |
| | | * 认证照片地址 |
| | | */ |
| | | @ApiModelProperty(value = "认证照片地址") |
| | | private String certifiedPhotoUrl; |
| | | |
| | | /** |
| | | * 微信小程序唯一标识 |
| | | */ |
| | | @ApiModelProperty(value = "微信小程序唯一标识") |
| | | private String openid; |
| | | |
| | | /** |
| | | * 身份证号 |
| | | */ |
| | | @ApiModelProperty(value = "身份证号") |
| | | private String idCard; |
| | | |
| | | /** |
| | | * 1 启用 2 禁用 |
| | | */ |
| | | @ApiModelProperty(value = "1 启用 2 禁用") |
| | | private Integer status; |
| | | |
| | | /** |
| | | * 账号 |
| | | */ |
| | | @ApiModelProperty(value = "账号") |
| | | private String account; |
| | | |
| | | /** |
| | | * 昵称 |
| | | */ |
| | | @ApiModelProperty(value = "昵称") |
| | | private String nickName; |
| | | |
| | | /** |
| | | * 密码 |
| | | */ |
| | | @ApiModelProperty(value = "密码") |
| | | private String password; |
| | | |
| | | /** |
| | | * 头像 |
| | | */ |
| | | @ApiModelProperty(value = "头像") |
| | | private String imageUrl; |
| | | |
| | | /** |
| | | * 站点id(普通用户为空) |
| | | */ |
| | | @ApiModelProperty(value = " 站点id(普通用户为空)") |
| | | private Integer siteId; |
| | | |
| | | @ApiModelProperty("花城user_id") |
| | | private Long userId; |
| | | |
| | | |
| | | /** |
| | | * 区域编码 |
| | | */ |
| | | @ApiModelProperty(value = "区域编码") |
| | | private String areaCode; |
| | | |
| | | /** |
| | | * 是否认证 |
| | | */ |
| | | @ApiModelProperty(value = " 是否认证0否1认证") |
| | | private Integer isAuthenticated; |
| | | |
| | | /** |
| | | * 认证图片地址 |
| | | */ |
| | | @ApiModelProperty(value = " 认证图片地址") |
| | | private String authenticatedUrl; |
| | | |
| | | /** |
| | | * 认证图片地址(base_64) |
| | | */ |
| | | @ApiModelProperty(value = " 认证图片地址(base_64)") |
| | | private String authenticatedUrlBase; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.service.community; |
| | | |
| | | import com.panzhihua.common.constants.Constants; |
| | | import com.panzhihua.common.model.dtos.equipment.UnionInspectionDto; |
| | | import com.panzhihua.common.model.dtos.equipment.UnionReportDto; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | |
| | | @FeignClient(name = Constants.SERVICE_EQUIPMENT, contextId = "unionInspection", path = "unionInspection") |
| | | public interface ComEquipmentUnionInspectionFeign { |
| | | |
| | | |
| | | /** |
| | | * 新增户外劳工站巡查 |
| | | * |
| | | * @param unionInspectionDto |
| | | * @return 新增结果 |
| | | */ |
| | | @PostMapping("/add") |
| | | R add(UnionInspectionDto unionInspectionDto); |
| | | |
| | | |
| | | /** |
| | | * 分页户外劳工站巡查 |
| | | * |
| | | * @param unionInspectionDto |
| | | * @return 动态结果 |
| | | */ |
| | | @PostMapping("/query") |
| | | R query(UnionInspectionDto unionInspectionDto); |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.service.community; |
| | | |
| | | import com.panzhihua.common.constants.Constants; |
| | | import com.panzhihua.common.model.dtos.equipment.UnionReportDto; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | |
| | | @FeignClient(name = Constants.SERVICE_EQUIPMENT, contextId = "unionReport", path = "unionReport") |
| | | public interface ComEquipmentUnionRePortFeign { |
| | | |
| | | /** |
| | | * 总工会户外劳登录 |
| | | * |
| | | * @param unionReportDto |
| | | * @return 总工会户外劳工上报 |
| | | */ |
| | | @PostMapping("/add") |
| | | R add(UnionReportDto unionReportDto); |
| | | |
| | | |
| | | /** |
| | | * 分页户外劳工站上报表 |
| | | * |
| | | * @param unionReportDto |
| | | * @return 动态结果 |
| | | */ |
| | | @PostMapping("/query") |
| | | R query(UnionReportDto unionReportDto); |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.service.community; |
| | | |
| | | import com.panzhihua.common.constants.Constants; |
| | | import com.panzhihua.common.model.dtos.equipment.UnionOutdoorSiteDto; |
| | | import com.panzhihua.common.model.dtos.equipment.UnionUserDto; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | |
| | | @FeignClient(name = Constants.SERVICE_EQUIPMENT, contextId = "unionUser", path = "unionUser") |
| | | public interface ComEquipmentUnionUserFeign { |
| | | |
| | | /** |
| | | * 总工会户外劳登录 |
| | | * |
| | | * @param loginUserInfoVO |
| | | * @return 总工会户外劳共用户 |
| | | */ |
| | | @PostMapping("/login") |
| | | R login(LoginUserInfoVO loginUserInfoVO); |
| | | |
| | | /** |
| | | * 总工会户外劳工站用户认证 |
| | | * |
| | | * @param unionUserDto |
| | | * @return 总工会户外劳共用户 |
| | | */ |
| | | @PostMapping("/authentication") |
| | | R authentication(UnionUserDto unionUserDto); |
| | | |
| | | |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * http请求工具类,post请求 |
| | | * |
| | | * @param url |
| | | * url |
| | | * @param param |
| | | * 参数值 仅支持String |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public static String httpPostAndToken(String url, String param,Map headerMap) throws Exception { |
| | | DefaultHttpClient defaultHttpClient = null; |
| | | BufferedReader bufferedReader = null; |
| | | try { |
| | | defaultHttpClient = new DefaultHttpClient(); |
| | | HttpPost httpPost = new HttpPost(url); |
| | | httpPost.setHeader("Content-Type", "application/json;charset=utf-8"); |
| | | httpPost.setHeader("Authorization", headerMap.get("Authorization").toString()); |
| | | httpPost.setHeader("Host", headerMap.get("Host").toString()); |
| | | |
| | | for (Object key : headerMap.keySet()) { |
| | | httpPost.setHeader(key.toString(), headerMap.get(key).toString()); |
| | | } |
| | | if (StringUtils.isNotBlank(param)) { |
| | | log.info("参数值:{}", param); |
| | | HttpEntity httpEntity = new StringEntity(param, "utf-8"); |
| | | httpPost.setEntity(httpEntity); |
| | | // httpPost.setHeader("Content-Length", String.valueOf(httpEntity.getContentLength())); |
| | | } |
| | | HttpResponse httpResponse = defaultHttpClient.execute(httpPost); |
| | | if (httpResponse.getStatusLine().getStatusCode() != 200) { |
| | | int statusCode = httpResponse.getStatusLine().getStatusCode(); |
| | | String errorLog = "请求失败,errorCode:" + httpResponse.getStatusLine().getStatusCode(); |
| | | log.info(errorLog); |
| | | throw new Exception(url + errorLog); |
| | | } |
| | | // 读取返回信息 |
| | | String output; |
| | | bufferedReader = new BufferedReader(new InputStreamReader(httpResponse.getEntity().getContent(), "utf-8")); |
| | | StringBuilder stringBuilder = new StringBuilder(); |
| | | while ((output = bufferedReader.readLine()) != null) { |
| | | stringBuilder.append(output); |
| | | } |
| | | log.info("调用接口返回的参数:" + stringBuilder.toString()); |
| | | return stringBuilder.toString(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | throw e; |
| | | } finally { |
| | | if (defaultHttpClient != null) |
| | | defaultHttpClient.getConnectionManager().shutdown(); |
| | | if (bufferedReader != null) |
| | | bufferedReader.close(); |
| | | } |
| | | } |
| | | |
| | | public static void main(String[] args) throws IOException { |
| | | DefaultHttpClient defaultHttpClient = new DefaultHttpClient(); |
| | | HttpPost httpPost = new HttpPost("https://dptest.d-power.com.cn:14404/v1/face"); |
| | | // httpPost.setHeader("Content-Type", "application/json;charset=utf-8"); |
| | | httpPost.setHeader("Authorization", "DpToken P3JHgjLbyljfLrFnS9OZbATRJmacdt4b"); |
| | | httpPost.setHeader("Host", "123.60.2.66"); |
| | | // httpPost.setHeader("Content-Length", String.valueOf(entity.getContentLength())); |
| | | |
| | | // httpPost.setHeader("User-Agent", "Apache-HttpClient/4.5.12 (Java/1.8.0_162)[\\r][\\n]"); |
| | | httpPost.setEntity(new StringEntity("{\"positions\":[{\"role\":\"occupant\",\"communityId\":\"64f99b2ed26106d4f0fe93f4\",\"unitId\":\"64f99b2ed26106d4f0fe93f7\"}],\"tel\":\"15696695118\",\"name\":\"四月里3\",\"timeout\":10,\"image\":\"fsdfsdfsdf\"}", "utf-8")); |
| | | // httpPost.setHeader("Content-Length", String.valueOf(entity.getContentLength())); |
| | | HttpResponse httpResponse = defaultHttpClient.execute(httpPost); |
| | | System.out.println(httpResponse.getEntity()); |
| | | } |
| | | |
| | | /** |
| | | * get请求 |
| | | * |
New file |
| | |
| | | package com.panzhihua.service_equipment.api; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.panzhihua.common.model.dtos.equipment.UnionInspectionDto; |
| | | import com.panzhihua.common.model.dtos.equipment.UnionReportDto; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.service_equipment.model.dos.UnionReport; |
| | | import com.panzhihua.service_equipment.service.UnionInspectionService; |
| | | import com.panzhihua.service_equipment.service.UnionReportService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/unionInspection") |
| | | public class UnionInspectionApi { |
| | | |
| | | @Resource |
| | | private UnionInspectionService unionInspectionService; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 新增户外劳工站巡查 |
| | | * |
| | | * @param unionInspectionDto |
| | | * @return 新增结果 |
| | | */ |
| | | @PostMapping("/add") |
| | | public R add(@RequestBody UnionInspectionDto unionInspectionDto) { |
| | | return unionInspectionService.add(unionInspectionDto); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 分页户外劳工站巡查 |
| | | * |
| | | * @param unionInspectionDto |
| | | * @return 动态结果 |
| | | */ |
| | | @PostMapping("/query") |
| | | public R<IPage<UnionReport>> query(@RequestBody UnionInspectionDto unionInspectionDto) { |
| | | return unionInspectionService.query(unionInspectionDto); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_equipment.api; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.panzhihua.common.model.dtos.equipment.UnionReportDto; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.service_equipment.model.dos.UnionReport; |
| | | import com.panzhihua.service_equipment.service.UnionReportService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/unionReport") |
| | | public class UnionReportApi { |
| | | |
| | | @Resource |
| | | private UnionReportService unionReportService; |
| | | |
| | | /** |
| | | * 户外劳工站上报表 |
| | | * |
| | | * @param unionReportDto |
| | | * @return 新增结果 |
| | | */ |
| | | @PostMapping("/add") |
| | | public R add(@RequestBody UnionReportDto unionReportDto) { |
| | | return unionReportService.add(unionReportDto); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 分页户外劳工站上报表 |
| | | * |
| | | * @param unionReportDto |
| | | * @return 动态结果 |
| | | */ |
| | | @PostMapping("/query") |
| | | public R<IPage<UnionReport>> query(@RequestBody UnionReportDto unionReportDto) { |
| | | return unionReportService.query(unionReportDto); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_equipment.api; |
| | | |
| | | import com.panzhihua.common.model.dtos.equipment.UnionUserDto; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.service_equipment.model.dos.UnionUser; |
| | | import com.panzhihua.service_equipment.service.UnionUserService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/unionUser") |
| | | public class UnionUserApi { |
| | | |
| | | @Resource |
| | | private UnionUserService userService; |
| | | |
| | | /** |
| | | * 总工会户外劳登录 |
| | | * |
| | | * @param loginUserInfoVO |
| | | * @return 总工会户外劳共用户 |
| | | */ |
| | | @PostMapping("/login") |
| | | public R<UnionUser> login(@RequestBody LoginUserInfoVO loginUserInfoVO){ |
| | | return userService.login(loginUserInfoVO); |
| | | } |
| | | |
| | | /** |
| | | * 总工会户外劳工站用户认证 |
| | | * |
| | | * @param unionUserDto |
| | | * @return 总工会户外劳共用户 |
| | | */ |
| | | @PostMapping("/authentication") |
| | | public R authentication(@RequestBody UnionUserDto unionUserDto){ |
| | | return userService.authentication(unionUserDto); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_equipment.config; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.boot.context.properties.ConfigurationProperties; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | @ApiModel("门禁账号密码") |
| | | @Data |
| | | @Component |
| | | @ConfigurationProperties(prefix = "uni") |
| | | public class AccessConfig { |
| | | |
| | | @Value("${access.username}") |
| | | private String userName; |
| | | // FTP 登录密码 |
| | | @Value("${access.password}") |
| | | private String password; |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_equipment.config; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | import javax.annotation.Resource; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | import static com.panzhihua.common.utlis.HttpClientUtil.*; |
| | | |
| | | |
| | | @Slf4j |
| | | @Service |
| | | public class AccessUtil { |
| | | |
| | | |
| | | @Resource |
| | | private AccessConfig accessConfig; |
| | | |
| | | |
| | | /** |
| | | * 刷新token |
| | | * @return token |
| | | * @throws Exception |
| | | */ |
| | | public Map refreshToken() throws Exception { |
| | | String url = "https://dptest.d-power.com.cn:14404/v1/token/refresh"; |
| | | return JSONObject.parseObject(httpPost(url, JSON.toJSONString(accessConfig)), Map.class); |
| | | } |
| | | |
| | | /** |
| | | * 注册人脸 |
| | | * @return 返回结果 |
| | | * @throws Exception |
| | | */ |
| | | public Map faceEnroll(String tel,String name,String image,String communityId,String unitId) { |
| | | String url="https://dptest.d-power.com.cn:14404/v1/face"; |
| | | String token="DpToken "; |
| | | Map headerMap = new HashMap(); |
| | | try { |
| | | Map map = refreshToken(); |
| | | if (map!=null&&map.get("token")!=null){ |
| | | token =token+map.get("token").toString(); |
| | | log.info("生成的token为:{}",token); |
| | | headerMap.put("Authorization",token); |
| | | headerMap.put("Host","dptest.d-power.com.cn"); |
| | | } |
| | | else { |
| | | log.info("生成token错误"); |
| | | return null; |
| | | } |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | Map result=new HashMap(); |
| | | result.put("role","occupant"); |
| | | result.put("communityId",communityId); |
| | | result.put("unitId",unitId); |
| | | result.put("tel",tel); |
| | | result.put("name",name); |
| | | result.put("timeout",10); |
| | | result.put("image",image); |
| | | try { |
| | | return JSONObject.parseObject(httpPostAndToken(url, JSON.toJSONString(result),headerMap), Map.class); |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 开门 |
| | | * @return 返回结果 |
| | | * @throws Exception |
| | | */ |
| | | public Map deviceOpen(String sn,String opener,String kind,String role) { |
| | | String url="https://dptest.d-power.com.cn:14404/v1/device/open"; |
| | | String token="DpToken "; |
| | | Map headerMap = new HashMap(); |
| | | try { |
| | | Map map = refreshToken(); |
| | | if (map!=null&&map.get("token")!=null){ |
| | | token =token+map.get("token").toString(); |
| | | log.info("生成的token为:{}",token); |
| | | headerMap.put("Authorization",token); |
| | | headerMap.put("Host","dptest.d-power.com.cn"); |
| | | } |
| | | else { |
| | | log.info("生成token错误"); |
| | | return null; |
| | | } |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | Map result=new HashMap(); |
| | | result.put("sn",sn); |
| | | result.put("kind",kind); |
| | | result.put("role",role); |
| | | result.put("opener",opener); |
| | | try { |
| | | return JSONObject.parseObject(httpPostAndToken(url, JSON.toJSONString(result),headerMap), Map.class); |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | //package com.panzhihua.service_equipment.config; |
| | | // |
| | | //import org.apache.commons.lang3.StringUtils; |
| | | //import org.mybatis.logging.Logger; |
| | | //import org.mybatis.logging.LoggerFactory; |
| | | // |
| | | //import javax.swing.filechooser.FileSystemView; |
| | | //import java.io.File; |
| | | // |
| | | ///** |
| | | // * 二维码工具 |
| | | // * @Author:debug (SteadyJack) |
| | | // * @Link: weixin-> debug0868 qq-> 1948831260 |
| | | // * @Date: 2020/11/16 22:38 |
| | | // **/ |
| | | //public class QRCodeUtil { |
| | | // private static final Logger log= LoggerFactory.getLogger(QRCodeUtil.class); |
| | | // |
| | | // //CODE_WIDTH:二维码宽度,单位像素 |
| | | // private static final int CODE_WIDTH = 400; |
| | | // //CODE_HEIGHT:二维码高度,单位像素 |
| | | // private static final int CODE_HEIGHT = 400; |
| | | // //FRONT_COLOR:二维码前景色,0x000000 表示黑色 |
| | | // private static final int FRONT_COLOR = 0x000000; |
| | | // //BACKGROUND_COLOR:二维码背景色,0xFFFFFF 表示白色 |
| | | // //演示用 16 进制表示,和前端页面 CSS 的取色是一样的,注意前后景颜色应该对比明显,如常见的黑白 |
| | | // private static final int BACKGROUND_COLOR = 0xFFFFFF; |
| | | // |
| | | // public static void createCodeToFile(String content, File codeImgFileSaveDir, String fileName) { |
| | | // try { |
| | | // if (StringUtils.isBlank(content) || StringUtils.isBlank(fileName)) { |
| | | // return; |
| | | // } |
| | | // content = content.trim(); |
| | | // if (codeImgFileSaveDir==null || codeImgFileSaveDir.isFile()) { |
| | | // //二维码图片存在目录为空,默认放在桌面... |
| | | // codeImgFileSaveDir = FileSystemView.getFileSystemView().getHomeDirectory(); |
| | | // } |
| | | // if (!codeImgFileSaveDir.exists()) { |
| | | // //二维码图片存在目录不存在,开始创建... |
| | | // codeImgFileSaveDir.mkdirs(); |
| | | // } |
| | | // |
| | | // //核心代码-生成二维码 |
| | | // BufferedImage bufferedImage = getBufferedImage(content); |
| | | // |
| | | // File codeImgFile = new File(codeImgFileSaveDir, fileName); |
| | | // ImageIO.write(bufferedImage, "png", codeImgFile); |
| | | // |
| | | // log.info("二维码图片生成成功:" + codeImgFile.getPath()); |
| | | // } catch (Exception e) { |
| | | // e.printStackTrace(); |
| | | // } |
| | | // } |
| | | // |
| | | // /** |
| | | // * 生成二维码并输出到输出流, 通常用于输出到网页上进行显示,输出到网页与输出到磁盘上的文件中,区别在于最后一句 ImageIO.write |
| | | // * write(RenderedImage im,String formatName,File output):写到文件中 |
| | | // * write(RenderedImage im,String formatName,OutputStream output):输出到输出流中 |
| | | // * @param content :二维码内容 |
| | | // * @param outputStream :输出流,比如 HttpServletResponse 的 getOutputStream |
| | | // */ |
| | | // public static void createCodeToOutputStream(String content, OutputStream outputStream) { |
| | | // try { |
| | | // if (StringUtils.isBlank(content)) { |
| | | // return; |
| | | // } |
| | | // content = content.trim(); |
| | | // //核心代码-生成二维码 |
| | | // BufferedImage bufferedImage = getBufferedImage(content); |
| | | // |
| | | // //区别就是这一句,输出到输出流中,如果第三个参数是 File,则输出到文件中 |
| | | // ImageIO.write(bufferedImage, "png", outputStream); |
| | | // |
| | | // log.info("二维码图片生成到输出流成功..."); |
| | | // } catch (Exception e) { |
| | | // e.printStackTrace(); |
| | | // } |
| | | // } |
| | | // |
| | | // //核心代码-生成二维码 |
| | | // private static BufferedImage getBufferedImage(String content) throws WriterException { |
| | | // |
| | | // //com.google.zxing.EncodeHintType:编码提示类型,枚举类型 |
| | | // Map<EncodeHintType, Object> hints = new HashMap(); |
| | | // |
| | | // //EncodeHintType.CHARACTER_SET:设置字符编码类型 |
| | | // hints.put(EncodeHintType.CHARACTER_SET, "UTF-8"); |
| | | // |
| | | // //EncodeHintType.ERROR_CORRECTION:设置误差校正 |
| | | // //ErrorCorrectionLevel:误差校正等级,L = ~7% correction、M = ~15% correction、Q = ~25% correction、H = ~30% correction |
| | | // //不设置时,默认为 L 等级,等级不一样,生成的图案不同,但扫描的结果是一样的 |
| | | // hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.M); |
| | | // |
| | | // //EncodeHintType.MARGIN:设置二维码边距,单位像素,值越小,二维码距离四周越近 |
| | | // hints.put(EncodeHintType.MARGIN, 1); |
| | | // |
| | | // MultiFormatWriter multiFormatWriter = new MultiFormatWriter(); |
| | | // BitMatrix bitMatrix = multiFormatWriter.encode(content, BarcodeFormat.QR_CODE, CODE_WIDTH, CODE_HEIGHT, hints); |
| | | // BufferedImage bufferedImage = new BufferedImage(CODE_WIDTH, CODE_HEIGHT, BufferedImage.TYPE_INT_BGR); |
| | | // for (int x = 0; x < CODE_WIDTH; x++) { |
| | | // for (int y = 0; y < CODE_HEIGHT; y++) { |
| | | // bufferedImage.setRGB(x, y, bitMatrix.get(x, y) ? FRONT_COLOR : BACKGROUND_COLOR); |
| | | // } |
| | | // } |
| | | // return bufferedImage; |
| | | // } |
| | | //} |
New file |
| | |
| | | package com.panzhihua.service_equipment.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.panzhihua.service_equipment.model.dos.UnionAccess; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | |
| | | /** |
| | | * <p> |
| | | * 户外劳工站门禁设备 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author fengjin |
| | | * @since 2023-09-11 |
| | | */ |
| | | @Mapper |
| | | public interface UnionAccessMapper extends BaseMapper<UnionAccess> { |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_equipment.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.panzhihua.service_equipment.model.dos.UnionInspection; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * <p> |
| | | * 户外劳工站巡查表 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author fengjin |
| | | * @since 2023-08-25 |
| | | */ |
| | | @Mapper |
| | | public interface UnionInspectionMapper extends BaseMapper<UnionInspection> { |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_equipment.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.panzhihua.service_equipment.model.dos.UnionReport; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | /** |
| | | * <p> |
| | | * 户外劳工站上报表 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author fengjin |
| | | * @since 2023-08-24 |
| | | */ |
| | | @Mapper |
| | | public interface UnionReportMapper extends BaseMapper<UnionReport> { |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_equipment.dao; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.panzhihua.service_equipment.model.dos.UnionUser; |
| | | |
| | | /** |
| | | * <p> |
| | | * 户外劳工站用户 |
| | | * </p> |
| | | * |
| | | * @author fengjin |
| | | * @since 2023-08-24 |
| | | */ |
| | | @Mapper |
| | | public interface UnionUserMapper extends BaseMapper<UnionUser> { |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_equipment.model.dos; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | | * 户外劳工站门禁设备 |
| | | * </p> |
| | | * |
| | | * @author fengjin |
| | | * @since 2023-09-11 |
| | | */ |
| | | @TableName("union_access") |
| | | @Data |
| | | @ApiModel("户外劳工站门禁设备") |
| | | public class UnionAccess implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | @ApiModelProperty(value = "主键") |
| | | private Integer id; |
| | | |
| | | /** |
| | | * 站点id |
| | | */ |
| | | @ApiModelProperty(value = "站点id") |
| | | private Integer siteId; |
| | | |
| | | /** |
| | | * 小区id |
| | | */ |
| | | @ApiModelProperty(value = "小区id") |
| | | private String communityExternalId; |
| | | |
| | | /** |
| | | * 小区名 |
| | | */ |
| | | @ApiModelProperty(value = "小区名") |
| | | private String community; |
| | | |
| | | /** |
| | | * 单元id |
| | | */ |
| | | @ApiModelProperty(value = "单元id") |
| | | private String unitId; |
| | | |
| | | /** |
| | | * 设备序列号 |
| | | */ |
| | | @ApiModelProperty(value = "设备序列号") |
| | | private String sn; |
| | | |
| | | /** |
| | | * 设备名 |
| | | */ |
| | | @ApiModelProperty(value = "设备名") |
| | | private String name; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @ApiModelProperty(value = "创建时间") |
| | | private LocalDateTime createAt; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_equipment.model.dos; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | | * 户外劳工站巡查表 |
| | | * </p> |
| | | * |
| | | * @author fengjin |
| | | * @since 2023-08-25 |
| | | */ |
| | | @TableName("union_inspection") |
| | | @Data |
| | | @ApiModel("户外劳工站巡查表") |
| | | public class UnionInspection implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * ,主键 |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | @ApiModelProperty(value = "主键") |
| | | private Integer id; |
| | | |
| | | /** |
| | | * 创建人户外劳工站id |
| | | */ |
| | | @ApiModelProperty(value = "创建人户外劳工站id") |
| | | private Long createUnionUserId; |
| | | |
| | | /** |
| | | * 站点id |
| | | */ |
| | | @ApiModelProperty(value = "站点id") |
| | | private Integer siteId; |
| | | |
| | | /** |
| | | * 创建人id |
| | | */ |
| | | @ApiModelProperty(value = "创建人id") |
| | | private Long createUserId; |
| | | |
| | | /** |
| | | * 类型(1正常2异常) |
| | | */ |
| | | @ApiModelProperty(value = "类型(1正常2异常)") |
| | | private Integer type; |
| | | |
| | | /** |
| | | * 内容 |
| | | */ |
| | | @ApiModelProperty(value = "内容") |
| | | private String content; |
| | | |
| | | /** |
| | | * 图片地址 |
| | | */ |
| | | @ApiModelProperty(value = "图片地址") |
| | | private String url; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @ApiModelProperty(value = "创建时间") |
| | | private LocalDateTime createAt; |
| | | |
| | | /** |
| | | * 标题 |
| | | */ |
| | | @ApiModelProperty(value = "标题") |
| | | private String title; |
| | | |
| | | /** |
| | | * 处理人户外劳工站id |
| | | */ |
| | | @ApiModelProperty(value = "处理人户外劳工站id") |
| | | private Integer disposeUnionUserId; |
| | | |
| | | /** |
| | | * 处理内容 |
| | | */ |
| | | @ApiModelProperty(value = "处理内容") |
| | | private String disposeContent; |
| | | |
| | | /** |
| | | * 处理时间 |
| | | */ |
| | | @ApiModelProperty(value = "处理时间") |
| | | private LocalDateTime disposeAt; |
| | | |
| | | /** |
| | | * 处理照片地址 |
| | | */ |
| | | @ApiModelProperty(value = "处理照片地址") |
| | | private String disposeUrl; |
| | | |
| | | /** |
| | | * 状态(1未回复2已回复) |
| | | */ |
| | | @ApiModelProperty(value = "状态(1未接单2已接单3已解决)") |
| | | private Integer status; |
| | | |
| | | /** |
| | | * 创建人电话 |
| | | */ |
| | | @ApiModelProperty(value = "创建人电话") |
| | | private String createPhone; |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "服务范围") |
| | | private String serviceRange; |
| | | |
| | | /** |
| | | * 站点环境图(,)分隔 |
| | | */ |
| | | @ApiModelProperty(value = "站点环境图(,)分隔") |
| | | private String siteEnvironmentUrl; |
| | | |
| | | /** |
| | | * 服务列表 |
New file |
| | |
| | | package com.panzhihua.service_equipment.model.dos; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | | * 户外劳工站上报表 |
| | | * </p> |
| | | * |
| | | * @author fengjin |
| | | * @since 2023-08-24 |
| | | */ |
| | | @TableName("union_report") |
| | | @Data |
| | | @ApiModel("户外劳工站上报表") |
| | | public class UnionReport implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * ,主键 |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | @ApiModelProperty(value = "主键") |
| | | private Integer id; |
| | | |
| | | /** |
| | | * 创建人户外劳工站id |
| | | */ |
| | | @ApiModelProperty(value = "创建人户外劳工站id") |
| | | private Long createUnionUserId; |
| | | |
| | | /** |
| | | * 站点id |
| | | */ |
| | | @ApiModelProperty(value = "站点id") |
| | | private Integer siteId; |
| | | |
| | | /** |
| | | * 创建人id |
| | | */ |
| | | @ApiModelProperty(value = "创建人id") |
| | | private Long createUserId; |
| | | |
| | | |
| | | /** |
| | | * 类型(1意见反馈2故障保修) |
| | | */ |
| | | @ApiModelProperty(value = "类型(1意见反馈2故障保修)") |
| | | private Integer type; |
| | | |
| | | /** |
| | | * 内容 |
| | | */ |
| | | @ApiModelProperty(value = "内容") |
| | | private String content; |
| | | |
| | | /** |
| | | * 图片地址 |
| | | */ |
| | | @ApiModelProperty(value = "图片地址") |
| | | private String url; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @ApiModelProperty(value = "创建时间") |
| | | private LocalDateTime createAt; |
| | | |
| | | /** |
| | | * 标题 |
| | | */ |
| | | @ApiModelProperty(value = "标题") |
| | | private String title; |
| | | |
| | | /** |
| | | * 处理人户外劳工站id |
| | | */ |
| | | @ApiModelProperty(value = "处理人户外劳工站id") |
| | | private Integer disposeUnionUserId; |
| | | |
| | | /** |
| | | * 处理内容 |
| | | */ |
| | | @ApiModelProperty(value = "处理内容") |
| | | private String disposeContent; |
| | | |
| | | /** |
| | | * 处理时间 |
| | | */ |
| | | @ApiModelProperty(value = "处理时间") |
| | | private LocalDateTime disposeAt; |
| | | |
| | | /** |
| | | * 处理照片地址 |
| | | */ |
| | | @ApiModelProperty(value = "处理照片地址") |
| | | private String disposeUrl; |
| | | |
| | | |
| | | /** |
| | | * 状态(1未回复2已回复) |
| | | */ |
| | | @ApiModelProperty(value = "状态(1未回复2已回复)") |
| | | private Integer status; |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_equipment.model.dos; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | | * 户外劳工站用户 |
| | | * </p> |
| | | * |
| | | * @author fengjin |
| | | * @since 2023-08-24 |
| | | */ |
| | | @TableName("union_user") |
| | | @Data |
| | | @ApiModel("总工会户外劳工站") |
| | | public class UnionUser implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键id |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | @ApiModelProperty(value = "主键id") |
| | | private Long id; |
| | | |
| | | /** |
| | | * () |
| | | */ |
| | | @ApiModelProperty(value = "姓名") |
| | | private String name; |
| | | |
| | | /** |
| | | *商家名称 |
| | | */ |
| | | @ApiModelProperty(value = "商家名称") |
| | | private String sex; |
| | | |
| | | /** |
| | | * 联系方式 |
| | | */ |
| | | @ApiModelProperty(value = "联系方式") |
| | | private String phone; |
| | | |
| | | /** |
| | | * 人员类型(1、普通工会用户 2、巡查人员 3、站点负责人 |
| | | */ |
| | | @ApiModelProperty(value = "人员类型(1、普通工会用户 2、巡查人员 3、站点负责人 ") |
| | | private String type; |
| | | |
| | | /** |
| | | * 删除标识 |
| | | */ |
| | | @ApiModelProperty(value = "删除标识") |
| | | private Boolean deleteFlag; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | @ApiModelProperty(value = "备注") |
| | | private String remark; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @ApiModelProperty(value = "创建时间") |
| | | private LocalDateTime createAt; |
| | | |
| | | /** |
| | | * 更新时间 |
| | | */ |
| | | @ApiModelProperty(value = "更新时间") |
| | | private LocalDateTime updateAt; |
| | | |
| | | /** |
| | | * 修改用户 |
| | | */ |
| | | @ApiModelProperty(value = "修改用户") |
| | | private Long updateBy; |
| | | |
| | | /** |
| | | * 创建用户 |
| | | */ |
| | | @ApiModelProperty(value = "创建用户") |
| | | private Long createBy; |
| | | |
| | | /** |
| | | * 认证照片地址 |
| | | */ |
| | | @ApiModelProperty(value = "认证照片地址") |
| | | private String certifiedPhotoUrl; |
| | | |
| | | /** |
| | | * 微信小程序唯一标识 |
| | | */ |
| | | @ApiModelProperty(value = "微信小程序唯一标识") |
| | | private String openid; |
| | | |
| | | /** |
| | | * 身份证号 |
| | | */ |
| | | @ApiModelProperty(value = "身份证号") |
| | | private String idCard; |
| | | |
| | | /** |
| | | * 1 启用 2 禁用 |
| | | */ |
| | | @ApiModelProperty(value = "1 启用 2 禁用") |
| | | private Integer status; |
| | | |
| | | /** |
| | | * 账号 |
| | | */ |
| | | @ApiModelProperty(value = "账号") |
| | | private String account; |
| | | |
| | | /** |
| | | * 昵称 |
| | | */ |
| | | @ApiModelProperty(value = "昵称") |
| | | private String nickName; |
| | | |
| | | /** |
| | | * 密码 |
| | | */ |
| | | @ApiModelProperty(value = "密码") |
| | | private String password; |
| | | |
| | | /** |
| | | * 头像 |
| | | */ |
| | | @ApiModelProperty(value = "头像") |
| | | private String imageUrl; |
| | | |
| | | /** |
| | | * 站点id(普通用户为空) |
| | | */ |
| | | @ApiModelProperty(value = " 站点id(普通用户为空)") |
| | | private Integer siteId; |
| | | |
| | | @ApiModelProperty("花城user_id") |
| | | private Long userId; |
| | | |
| | | |
| | | /** |
| | | * 区域编码 |
| | | */ |
| | | @ApiModelProperty(value = "区域编码") |
| | | private String areaCode; |
| | | |
| | | /** |
| | | * 是否认证 |
| | | */ |
| | | @ApiModelProperty(value = " 是否认证0否1认证") |
| | | private Integer isAuthenticated; |
| | | |
| | | |
| | | /** |
| | | * 认证图片地址 |
| | | */ |
| | | @ApiModelProperty(value = " 认证图片地址") |
| | | private String authenticatedUrl; |
| | | |
| | | /** |
| | | * 认证图片地址(base_64) |
| | | */ |
| | | @ApiModelProperty(value = " 认证图片地址(base_64)") |
| | | private String authenticatedUrlBase; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_equipment.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.panzhihua.common.model.dtos.equipment.UnionInspectionDto; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.service_equipment.model.dos.UnionReport; |
| | | |
| | | public interface UnionInspectionService { |
| | | |
| | | /** |
| | | * 新增户外劳工站巡查 |
| | | * |
| | | * @param unionInspectionDto |
| | | * @return 新增结果 |
| | | */ |
| | | R add(UnionInspectionDto unionInspectionDto); |
| | | |
| | | |
| | | |
| | | /** |
| | | * 分页户外劳工站巡查 |
| | | * |
| | | * @param unionInspectionDto |
| | | * @return 动态结果 |
| | | */ |
| | | R<IPage<UnionReport>> query(UnionInspectionDto unionInspectionDto); |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_equipment.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.panzhihua.common.model.dtos.equipment.UnionReportDto; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.service_equipment.model.dos.UnionReport; |
| | | |
| | | public interface UnionReportService { |
| | | |
| | | /** |
| | | * 户外劳工站上报表 |
| | | * |
| | | * @param unionReportDto |
| | | * @return 新增结果 |
| | | */ |
| | | R add(UnionReportDto unionReportDto); |
| | | |
| | | |
| | | /** |
| | | * 分页户外劳工站上报表 |
| | | * |
| | | * @param unionReportDto |
| | | * @return 动态结果 |
| | | */ |
| | | R<IPage<UnionReport>> query(UnionReportDto unionReportDto); |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_equipment.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.panzhihua.common.model.dtos.equipment.UnionReportDto; |
| | | import com.panzhihua.common.model.dtos.equipment.UnionUserDto; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.service_equipment.model.dos.UnionReport; |
| | | import com.panzhihua.service_equipment.model.dos.UnionUser; |
| | | |
| | | public interface UnionUserService { |
| | | |
| | | |
| | | /** |
| | | * 总工会户外劳登录 |
| | | * |
| | | * @param loginUserInfoVO |
| | | * @return 总工会户外劳共用户 |
| | | */ |
| | | R<UnionUser> login(LoginUserInfoVO loginUserInfoVO); |
| | | |
| | | /** |
| | | * 总工会户外劳工站用户认证 |
| | | * |
| | | * @param unionUserDto |
| | | * @return 总工会户外劳共用户 |
| | | */ |
| | | R authentication(UnionUserDto unionUserDto); |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_equipment.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.common.model.dtos.equipment.UnionInspectionDto; |
| | | import com.panzhihua.common.model.dtos.equipment.UnionReportDto; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.service_equipment.dao.UnionInspectionMapper; |
| | | import com.panzhihua.service_equipment.dao.UnionUserMapper; |
| | | import com.panzhihua.service_equipment.model.dos.UnionInspection; |
| | | import com.panzhihua.service_equipment.model.dos.UnionReport; |
| | | import com.panzhihua.service_equipment.model.dos.UnionUser; |
| | | import com.panzhihua.service_equipment.service.UnionInspectionService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Slf4j |
| | | @Service |
| | | public class UnionInspectionServiceImpl extends ServiceImpl<UnionInspectionMapper, UnionInspection> implements UnionInspectionService { |
| | | |
| | | @Resource |
| | | private UnionUserMapper unionUserMapper; |
| | | |
| | | |
| | | /** |
| | | * 新增户外劳工站巡查 |
| | | * |
| | | * @param unionInspectionDto |
| | | * @return 新增结果 |
| | | */ |
| | | @Override |
| | | public R add(UnionInspectionDto unionInspectionDto) { |
| | | UnionInspection unionInspection = new UnionInspection(); |
| | | BeanUtils.copyProperties(unionInspectionDto, unionInspection); |
| | | UnionUser unionUser = unionUserMapper |
| | | .selectOne(new QueryWrapper<UnionUser>().eq("user_id", unionInspection.getCreateUserId())); |
| | | if (unionUser!=null){ |
| | | unionInspection.setCreateUnionUserId(unionUser.getId()); |
| | | unionInspection.setCreatePhone(unionUser.getPhone()); |
| | | } |
| | | unionInspection.setStatus(1); |
| | | unionInspection.setCreateAt(LocalDateTime.now()); |
| | | if (baseMapper.insert(unionInspection) > 0) { |
| | | return R.ok(); |
| | | } |
| | | return R.fail(); |
| | | } |
| | | |
| | | /** |
| | | * 分页户外劳工站巡查 |
| | | * |
| | | * @param unionInspectionDto |
| | | * @return 动态结果 |
| | | */ |
| | | @Override |
| | | public R<IPage<UnionReport>> query(UnionInspectionDto unionInspectionDto) { |
| | | Page page = new Page(unionInspectionDto.getPageNum(), unionInspectionDto.getPageSize()); |
| | | QueryWrapper<UnionInspection> unionOutdoorLaborDynamicQueryWrapper = new QueryWrapper<>(); |
| | | if (unionInspectionDto.getIsApplets().equals(1)){ |
| | | unionOutdoorLaborDynamicQueryWrapper.eq("create_user_id",unionInspectionDto.getCreateUserId()).eq("type",2); |
| | | if (unionInspectionDto.getStatus()!=null) |
| | | unionOutdoorLaborDynamicQueryWrapper.eq("status",unionInspectionDto.getStatus()); |
| | | } |
| | | Page pageResult = baseMapper.selectPage(page, unionOutdoorLaborDynamicQueryWrapper); |
| | | pageResult.setTotal(pageResult.getRecords().size()); |
| | | return R.ok(pageResult); |
| | | } |
| | | } |
| | |
| | | case 1: |
| | | case 2: |
| | | case 3: |
| | | case 4: |
| | | unionOutdoorLaborDynamicQueryWrapper.eq("type",unionOutdoorLaborDynamicDto.getType()); |
| | | break; |
| | | } |
| | | } |
| | | return R.ok( baseMapper.selectPage(page, unionOutdoorLaborDynamicQueryWrapper)); |
| | | Page pageResult = baseMapper.selectPage(page, unionOutdoorLaborDynamicQueryWrapper); |
| | | pageResult.setTotal(pageResult.getRecords().size()); |
| | | return R.ok(pageResult); |
| | | } |
| | | |
| | | /** |
| | |
| | | import com.panzhihua.service_equipment.model.dos.UnionOutdoorSite; |
| | | import com.panzhihua.service_equipment.service.UnionOutdoorSiteService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | QueryWrapper<UnionOutdoorSite> unionOutdoorLaborDynamicQueryWrapper = new QueryWrapper<>(); |
| | | if (unionOutdoorSiteDto.getAreaCode()!=null) |
| | | unionOutdoorLaborDynamicQueryWrapper.eq("area_code",unionOutdoorSiteDto.getAreaCode()); |
| | | return R.ok( baseMapper.selectPage(page, unionOutdoorLaborDynamicQueryWrapper)); |
| | | if (unionOutdoorSiteDto.getKeyWord()!=null) |
| | | unionOutdoorLaborDynamicQueryWrapper.and(wrapper -> wrapper.like("name", unionOutdoorSiteDto.getKeyWord()) |
| | | .or() |
| | | .like("introduction", unionOutdoorSiteDto.getKeyWord()) |
| | | .or() |
| | | .like("detailed_address", unionOutdoorSiteDto.getKeyWord())); |
| | | |
| | | Page pageResult = baseMapper.selectPage(page, unionOutdoorLaborDynamicQueryWrapper); |
| | | pageResult.setTotal(pageResult.getRecords().size()); |
| | | return R.ok(pageResult); |
| | | } |
| | | |
| | | @Override |
New file |
| | |
| | | package com.panzhihua.service_equipment.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.common.model.dtos.equipment.UnionOutdoorSiteDto; |
| | | import com.panzhihua.common.model.dtos.equipment.UnionReportDto; |
| | | import com.panzhihua.common.model.dtos.grid.ComActEasyPhotoAddDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.service_equipment.dao.UnionReportMapper; |
| | | import com.panzhihua.service_equipment.dao.UnionUserMapper; |
| | | import com.panzhihua.service_equipment.model.dos.UnionOutdoorSite; |
| | | import com.panzhihua.service_equipment.model.dos.UnionReport; |
| | | import com.panzhihua.service_equipment.model.dos.UnionUser; |
| | | import com.panzhihua.service_equipment.service.UnionReportService; |
| | | import com.panzhihua.service_equipment.service.UnionUserService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.time.LocalDateTime; |
| | | import java.util.Date; |
| | | |
| | | @Service |
| | | @Slf4j |
| | | public class UnionReportServiceImpl extends ServiceImpl<UnionReportMapper, UnionReport> implements UnionReportService { |
| | | |
| | | @Resource |
| | | private UnionUserMapper unionUserMapper; |
| | | |
| | | |
| | | /** |
| | | * 户外劳工站上报表 |
| | | * |
| | | * @param unionReportDto |
| | | * @return 新增结果 |
| | | */ |
| | | @Override |
| | | public R add(UnionReportDto unionReportDto) { |
| | | UnionReport unionReport = new UnionReport(); |
| | | BeanUtils.copyProperties(unionReportDto, unionReport); |
| | | UnionUser unionUser = unionUserMapper |
| | | .selectOne(new QueryWrapper<UnionUser>().eq("user_id", unionReport.getCreateUserId())); |
| | | if (unionUser!=null) |
| | | unionReport.setCreateUnionUserId(unionUser.getId()); |
| | | unionReport.setStatus(1); |
| | | unionReport.setCreateAt(LocalDateTime.now()); |
| | | if (baseMapper.insert(unionReport) > 0) { |
| | | return R.ok(); |
| | | } |
| | | return R.fail(); |
| | | } |
| | | |
| | | /** |
| | | * 分页户外劳工站上报表 |
| | | * |
| | | * @param unionReportDto |
| | | * @return 动态结果 |
| | | */ |
| | | @Override |
| | | public R<IPage<UnionReport>> query(UnionReportDto unionReportDto) { |
| | | Page page = new Page(unionReportDto.getPageNum(), unionReportDto.getPageSize()); |
| | | QueryWrapper<UnionReport> unionOutdoorLaborDynamicQueryWrapper = new QueryWrapper<>(); |
| | | if (unionReportDto.getIsApplets().equals(1)){ |
| | | unionOutdoorLaborDynamicQueryWrapper.eq("create_user_id",unionReportDto.getCreateUserId()); |
| | | if (unionReportDto.getType()!=null) |
| | | unionOutdoorLaborDynamicQueryWrapper.eq("type",unionReportDto.getType()); |
| | | } |
| | | Page pageResult = baseMapper.selectPage(page, unionOutdoorLaborDynamicQueryWrapper); |
| | | pageResult.setTotal(pageResult.getRecords().size()); |
| | | return R.ok(pageResult); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_equipment.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.common.model.dtos.equipment.UnionUserDto; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.service_equipment.config.AccessUtil; |
| | | import com.panzhihua.service_equipment.dao.UnionAccessMapper; |
| | | import com.panzhihua.service_equipment.dao.UnionUserMapper; |
| | | import com.panzhihua.service_equipment.model.dos.UnionAccess; |
| | | import com.panzhihua.service_equipment.model.dos.UnionOutdoorSite; |
| | | import com.panzhihua.service_equipment.model.dos.UnionUser; |
| | | import com.panzhihua.service_equipment.service.UnionUserService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | @Slf4j |
| | | public class UnionUserServiceImpl extends ServiceImpl<UnionUserMapper, UnionUser> implements UnionUserService { |
| | | |
| | | @Resource |
| | | private AccessUtil accessUtil; |
| | | |
| | | @Resource |
| | | private UnionAccessMapper unionAccessMapper; |
| | | |
| | | /** |
| | | * 总工会户外劳登录 |
| | | * |
| | | * @param loginUserInfoVO |
| | | * @return 总工会户外劳共用户 |
| | | */ |
| | | @Override |
| | | public R<UnionUser> login(LoginUserInfoVO loginUserInfoVO) { |
| | | UnionUser unionUser = baseMapper.selectOne(new QueryWrapper<UnionUser>().eq("user_id", loginUserInfoVO.getUserId())); |
| | | if (unionUser != null) { |
| | | return R.ok(unionUser); |
| | | } else { |
| | | unionUser = new UnionUser(); |
| | | unionUser.setSex(loginUserInfoVO.getSex().toString()); |
| | | unionUser.setPhone(loginUserInfoVO.getPhone()); |
| | | unionUser.setDeleteFlag(false); |
| | | unionUser.setCreateAt(LocalDateTime.now()); |
| | | unionUser.setUpdateAt(LocalDateTime.now()); |
| | | unionUser.setStatus(1); |
| | | unionUser.setNickName(loginUserInfoVO.getNickName()); |
| | | unionUser.setUserId(loginUserInfoVO.getUserId()); |
| | | if (loginUserInfoVO.getImageUrl() != null) |
| | | unionUser.setImageUrl(loginUserInfoVO.getImageUrl()); |
| | | int insert = baseMapper.insert(unionUser); |
| | | if (insert > 0) { |
| | | return R.ok(unionUser); |
| | | } else { |
| | | return R.fail(); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 总工会户外劳工站用户认证 |
| | | * |
| | | * @param unionUserDto |
| | | * @return 总工会户外劳共用户 |
| | | */ |
| | | |
| | | @Override |
| | | public R authentication(UnionUserDto unionUserDto){ |
| | | UnionUser unionUser = baseMapper.selectOne(new QueryWrapper<UnionUser>().eq("user_id", unionUserDto.getUserId())); |
| | | if (unionUser != null){ |
| | | log.info("查询到用户开始认证操作{}",unionUser); |
| | | //设备下发照片代码 |
| | | LambdaQueryWrapper<UnionAccess> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.inSql(UnionAccess::getSiteId, "SELECT id FROM union_outdoor_site WHERE area_code='" + unionUserDto.getAreaCode() + "'"); |
| | | List<UnionAccess> unionAccesses = unionAccessMapper.selectList(queryWrapper); |
| | | for (UnionAccess unionAccess : unionAccesses) { |
| | | try { |
| | | log.info("人脸注册"); |
| | | accessUtil.faceEnroll(unionUser.getPhone(), unionUserDto.getName(), unionUserDto.getAuthenticatedUrlBase(), unionAccess.getCommunityExternalId(), unionAccess.getUnitId()); |
| | | } catch (Exception e) { |
| | | // 处理异常 |
| | | e.printStackTrace(); |
| | | return R.fail("认证失败,请验证照片是否符合规范或者联系工作人员"); // 或者抛出自定义异常,根据实际情况进行处理 |
| | | } |
| | | } |
| | | //更改数据库 |
| | | unionUser.setName(unionUserDto.getName()); |
| | | unionUser.setIdCard(unionUserDto.getIdCard()); |
| | | unionUser.setAreaCode(unionUserDto.getAreaCode()); |
| | | unionUser.setAuthenticatedUrl(unionUserDto.getAuthenticatedUrl()); |
| | | unionUser.setAuthenticatedUrlBase(unionUserDto.getAuthenticatedUrlBase()); |
| | | unionUser.setIsAuthenticated(1); |
| | | int i = baseMapper.updateById(unionUser); |
| | | if (i>0){ |
| | | return R.ok("认证成功"); |
| | | } |
| | | else { |
| | | return R.fail("认证失败"); |
| | | } |
| | | } |
| | | else { |
| | | log.info("未查询到用户"); |
| | | return R.fail("认证失败"); |
| | | } |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.panzhihua.service_equipment.dao.UnionAccessMapper"> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.panzhihua.service_equipment.dao.UnionInspectionMapper"> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.panzhihua.service_equipment.dao.UnionReportMapper"> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.panzhihua.service_equipment.dao.UnionUserMapper"> |
| | | |
| | | </mapper> |
| | |
| | | @ComponentScan({"com.panzhihua.service_user", "com.panzhihua.common"}) |
| | | public class ServiceUserApplication { |
| | | |
| | | |
| | | public static void main(String[] args) { |
| | | SpringApplication.run(ServiceUserApplication.class, args); |
| | | } |