old mode 100644
new mode 100755
| | |
| | | package com.java110.user.bmo.staffAppAuth.impl; |
| | | |
| | | import com.java110.dto.staffAppAuth.StaffAppAuthDto; |
| | | import com.java110.dto.user.UserDto; |
| | | import com.java110.intf.user.IStaffAppAuthInnerServiceSMO; |
| | | import com.java110.intf.user.IUserInnerServiceSMO; |
| | | import com.java110.user.bmo.staffAppAuth.IGetStaffAppAuthBMO; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.vo.ResultVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | @Service("getStaffAppAuthBMOImpl") |
| | |
| | | @Autowired |
| | | private IStaffAppAuthInnerServiceSMO staffAppAuthInnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IUserInnerServiceSMO userInnerServiceSMOImpl; |
| | | |
| | | /** |
| | | * @param staffAppAuthDto |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | public ResponseEntity<String> get(StaffAppAuthDto staffAppAuthDto) { |
| | | UserDto userDto = new UserDto(); |
| | | userDto.setUserId(staffAppAuthDto.getStaffId()); |
| | | List<UserDto> userDtos = userInnerServiceSMOImpl.getUsers(userDto); |
| | | |
| | | Assert.listOnlyOne(userDtos, "用户不存在"); |
| | | staffAppAuthDto.setStaffName(userDtos.get(0).getName()); |
| | | |
| | | int count = staffAppAuthInnerServiceSMOImpl.queryStaffAppAuthsCount(staffAppAuthDto); |
| | | List<StaffAppAuthDto> staffAppAuthDtos = staffAppAuthInnerServiceSMOImpl.queryStaffAppAuths(staffAppAuthDto); |
| | | |
| | | List<StaffAppAuthDto> staffAppAuthDtos = null; |
| | | if (count > 0) { |
| | | staffAppAuthDtos = staffAppAuthInnerServiceSMOImpl.queryStaffAppAuths(staffAppAuthDto); |
| | | if (staffAppAuthDtos == null || staffAppAuthDtos.size() < 1) { |
| | | staffAppAuthDto.setStateName("未认证"); |
| | | staffAppAuthDto.setState("1001"); |
| | | staffAppAuthDto.setOpenId("-"); |
| | | staffAppAuthDto.setAppType("-"); |
| | | staffAppAuthDto.setOpenName("-"); |
| | | } else { |
| | | staffAppAuthDtos = new ArrayList<>(); |
| | | staffAppAuthDto.setStateName("已认证"); |
| | | staffAppAuthDto.setState("2002"); |
| | | staffAppAuthDto.setOpenId(staffAppAuthDtos.get(0).getOpenId()); |
| | | staffAppAuthDto.setAppType(staffAppAuthDtos.get(0).getAppType()); |
| | | staffAppAuthDto.setOpenName(staffAppAuthDtos.get(0).getOpenName()); |
| | | staffAppAuthDto.setCreateTime(staffAppAuthDtos.get(0).getCreateTime()); |
| | | } |
| | | |
| | | ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) staffAppAuthDto.getRow()), count, staffAppAuthDtos); |
| | | |
| | | ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK); |
| | | |
| | | return responseEntity; |
| | | return ResultVo.createResponseEntity(staffAppAuthDto); |
| | | } |
| | | |
| | | } |