超市,食堂模块接口
This commit is contained in:
1 parent
93b4cdcf7c
commit
2ff1876f9f
5 files changed
+66
-16
No files matched your search
+23
-13
@@ -27,6 +27,7 @@ import com.bsd.pjcloud.app.service.AppUserService;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.common.security.annotation.Inner;
|
||||
import com.bsd.pjcloud.thirdparty.api.feign.RemoterThirdPartyAuthService;
|
||||
import com.bsd.pjcloud.thirdparty.dto.SHJNSSODTO;
|
||||
import com.bsd.pjcloud.thirdparty.dto.ZZDUserDTO;
|
||||
import com.bsd.pjcloud.thirdparty.entity.ThirdPartyUserEntity;
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
@@ -34,6 +35,8 @@ import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.seata.spring.annotation.GlobalTransactional;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
@@ -51,7 +54,7 @@ import java.util.Map;
|
||||
/**
|
||||
* app用户表
|
||||
*
|
||||
* @author aeizzz
|
||||
* @author zjf
|
||||
* @date 2022-12-07 09:52:03
|
||||
*/
|
||||
@RestController
|
||||
@@ -178,23 +181,29 @@ public class AppUserAutoLoginController {
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 诗画sdk获取参数
|
||||
*
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
// @PostMapping("/shjnsso")
|
||||
// @Inner(value = false)
|
||||
// @Operation(summary = "诗画江南单点登录")
|
||||
// public R shjnsso(@RequestBody @Valid SHJNSSOReqVO shjnsso) {
|
||||
// ZZDUserDTO zzdUserDTO=ssoApi.shjnsso(shjnsso.getAccountId(),shjnsso.getSessionId());
|
||||
// ZZDUserDTO.Ext ext = zzdUserDTO.getExt();
|
||||
// String mobile = zzdUserDTO.getMobile();
|
||||
// AdminUserRespDTO userByMobileOrEmployeeCode = adminUserApi.getUserByMobileOrEmployeeCode(null, mobile);
|
||||
// if(userByMobileOrEmployeeCode!=null){
|
||||
// return createTokenAfterLoginSuccess(userByMobileOrEmployeeCode.getId(), mobile, LoginLogTypeEnum.LOGIN_SSO);
|
||||
// }
|
||||
@PostMapping("/shjnsso")
|
||||
@Inner(value = false)
|
||||
@Operation(summary = "诗画江南单点登录")
|
||||
public R shjnsso(@RequestBody @Valid SHJNSSODTO shjnsso) {
|
||||
R rdata = remoterThirdPartyAuthService.shjnsso(shjnsso.getAccountId(), shjnsso.getSessionId());
|
||||
ZZDUserDTO zzdUserDTO = (ZZDUserDTO) rdata.getData();
|
||||
ZZDUserDTO.Ext ext = zzdUserDTO.getExt();
|
||||
String mobile = zzdUserDTO.getMobile();
|
||||
R<List<SysUser>> rListSysUser = remoteUserService.getUserByMobileOrEmployeeCode(null, mobile);
|
||||
List<SysUser> sysUsers = rListSysUser.getData();
|
||||
if(!CollectionUtils.isEmpty(sysUsers)){
|
||||
//登录成功生成token
|
||||
UserTokenDTO userTokenDTO = new UserTokenDTO();
|
||||
userTokenDTO.setSysUser(sysUsers.get(0));
|
||||
remoteTokenService.generateToken(userTokenDTO);
|
||||
}
|
||||
// log.info("用户不存在,尝试创建用户");
|
||||
// CreateUserDto createUserDto = new CreateUserDto();
|
||||
// createUserDto.setUsername(zzdUserDTO.getUsername());
|
||||
@@ -207,7 +216,8 @@ public class AppUserAutoLoginController {
|
||||
// AdminUserRespDTO adminUserRespDTONew=adminUserApi.createSysUser(createUserDto);
|
||||
// log.info("创建用户成功,用户id为:{}",adminUserRespDTONew.getId());
|
||||
// return createTokenAfterLoginSuccess(adminUserRespDTONew.getId(), mobile, LoginLogTypeEnum.LOGIN_SSO);
|
||||
// }
|
||||
return R.failed("不存在用户");
|
||||
}
|
||||
|
||||
|
||||
@Inner(value = false)
|
||||
|
||||
+16
-1
@@ -10,8 +10,12 @@ import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.common.log.annotation.SysLog;
|
||||
import com.bsd.pjcloud.common.security.util.SecurityUtils;
|
||||
import com.bsd.pjcloud.supermarket.dto.SupermarketSpuUpdateStockReqDTO;
|
||||
import com.bsd.pjcloud.supermarket.entity.SupermarketAuxiliaryCodeEntity;
|
||||
import com.bsd.pjcloud.supermarket.entity.SupermarketSpuEntity;
|
||||
import com.bsd.pjcloud.supermarket.entity.SupermarketUnitEntity;
|
||||
import com.bsd.pjcloud.supermarket.service.SupermarketAuxiliaryCodeService;
|
||||
import com.bsd.pjcloud.supermarket.service.SupermarketSpuService;
|
||||
import com.bsd.pjcloud.supermarket.service.SupermarketUnitService;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import com.bsd.pjcloud.common.excel.annotation.ResponseExcel;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
@@ -39,6 +43,10 @@ public class SupermarketSpuController {
|
||||
|
||||
private final SupermarketSpuService supermarketSpuService;
|
||||
|
||||
private final SupermarketUnitService supermarketUnitService;
|
||||
|
||||
private final SupermarketAuxiliaryCodeService supermarketAuxiliaryCodeService;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param page 分页对象
|
||||
@@ -66,7 +74,14 @@ public class SupermarketSpuController {
|
||||
@GetMapping("/{id}" )
|
||||
@PreAuthorize("@pms.hasPermission('supermarket_supermarketSpu_view')" )
|
||||
public R getById(@PathVariable("id" ) Long id) {
|
||||
return R.ok(supermarketSpuService.getById(id));
|
||||
SupermarketSpuEntity supermarketSpuEntity = supermarketSpuService.getById(id);
|
||||
List<SupermarketUnitEntity> list = supermarketUnitService.list(new LambdaQueryWrapper<SupermarketUnitEntity>().eq(SupermarketUnitEntity::getSpuId, id));
|
||||
supermarketSpuEntity.setSupermarketUnitEntityList(list);
|
||||
supermarketSpuEntity.setSupermarketAuxiliaryCodeEntityList(
|
||||
supermarketAuxiliaryCodeService.list(new LambdaQueryWrapper<SupermarketAuxiliaryCodeEntity>().eq(SupermarketAuxiliaryCodeEntity::getSpuId, id))
|
||||
);
|
||||
|
||||
return R.ok(id);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+4
@@ -44,6 +44,10 @@ public interface RemoterThirdPartyAuthService {
|
||||
R zzdsso(@RequestParam("token") String token);
|
||||
|
||||
|
||||
@NoToken
|
||||
@GetMapping("/thirdPartyOAth2/zzd/shjnsso")
|
||||
R shjnsso(@RequestParam("accountId") String accountId,@RequestParam("sessionId") String sessionId);
|
||||
|
||||
/**
|
||||
* 根据钉钉号查询第三方表里面是否有这个人,也就是浙政钉总体系人员表
|
||||
* @param employeeCode
|
||||
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package com.bsd.pjcloud.thirdparty.dto;
|
||||
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class SHJNSSODTO {
|
||||
|
||||
@NotNull(message = "账号id不能为空")
|
||||
private String accountId;
|
||||
|
||||
@NotNull(message = "会员id不能为空")
|
||||
private String sessionId;
|
||||
}
|
||||
+9
-2
@@ -26,8 +26,15 @@ public class ThirdPartyOAth2Cotroller {
|
||||
|
||||
@Operation(summary = "浙政钉token" )
|
||||
@GetMapping("/zzd/sso" )
|
||||
public R getThirdPartyDeptPage(@RequestParam("token")String token) {
|
||||
public R getThirdPartyzzdsso(@RequestParam("token")String token) {
|
||||
return R.ok(thirdPartyOAuth2Service.getZZDUserInfo(token));
|
||||
|
||||
}
|
||||
|
||||
@Operation(summary = "诗画token" )
|
||||
@GetMapping("/sh/sso" )
|
||||
public R getThirdPartyshsso(@RequestParam("accountId") String accountId,@RequestParam("sessionId") String sessionId) {
|
||||
return R.ok(thirdPartyOAuth2Service.shjnsso(accountId,sessionId));
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user