| | |
| | | // strategy.setTablePrefix(pc.getModuleName() + ""); |
| | | // strategy.setLikeTable(new LikeTable("room")); |
| | | //strategy.setLikeTable(new LikeTable("member")); |
| | | strategy.setLikeTable(new LikeTable("t_sys_pay_record"));// 生成表名 |
| | | strategy.setLikeTable(new LikeTable("t_sys_message_config"));// 生成表名 |
| | | // strategy.setLikeTable(new LikeTable("t_hotel"));// 生成表名 |
| | | // strategy.setLikeTable(new LikeTable("t_scan_message"));// 生成表名 |
| | | // strategy.setNotLikeTable(new LikeTable("hotel_info"));// 不生成表名 |
New file |
| | |
| | | package com.ruoyi.web.controller.api; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * <p> |
| | | * 供应商仓库关联表 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2025-09-22 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/t-crm-supplier-to-warehouse") |
| | | public class TCrmSupplierToWarehouseController { |
| | | |
| | | } |
| | | |
| | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.framework.web.service.TokenService; |
| | | import com.ruoyi.system.dto.TCrmWarehouseDTO; |
| | | import com.ruoyi.system.model.TCrmSupplier; |
| | | import com.ruoyi.system.model.TCrmSupplierToWarehouse; |
| | | import com.ruoyi.system.model.TCrmWarehouse; |
| | | import com.ruoyi.system.query.TCrmWarehouseQuery; |
| | | import com.ruoyi.system.service.ISysUserService; |
| | | import com.ruoyi.system.service.TCrmSupplierService; |
| | | import com.ruoyi.system.service.TCrmSupplierToWarehouseService; |
| | | import com.ruoyi.system.service.TCrmWarehouseService; |
| | | import com.ruoyi.system.vo.TCrmWarehouseVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | |
| | | private final TCrmWarehouseService crmWarehouseService; |
| | | private final ISysUserService sysUserService; |
| | | private final TokenService tokenService; |
| | | private final TCrmSupplierToWarehouseService crmSupplierToWarehouseService; |
| | | private final TCrmSupplierService crmSupplierService; |
| | | @Autowired |
| | | public TCrmWarehouseController(TCrmWarehouseService crmWarehouseService, ISysUserService sysUserService) { |
| | | public TCrmWarehouseController(TCrmWarehouseService crmWarehouseService, ISysUserService sysUserService, TokenService tokenService, TCrmSupplierToWarehouseService crmSupplierToWarehouseService, TCrmSupplierService crmSupplierService) { |
| | | this.crmWarehouseService = crmWarehouseService; |
| | | this.sysUserService = sysUserService; |
| | | this.tokenService = tokenService; |
| | | this.crmSupplierToWarehouseService = crmSupplierToWarehouseService; |
| | | this.crmSupplierService = crmSupplierService; |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | /** |
| | | * 获取crm仓库管理管理列表 |
| | | */ |
| | | @ApiOperation(value = "获取crm供应商下的仓库管理列表") |
| | | @PostMapping(value = "/listBySupplierId") |
| | | public R<List<TCrmWarehouse>> listBySupplierId() { |
| | | Integer roleType = tokenService.getLoginUser().getUser().getRoleType(); |
| | | Long userId = tokenService.getLoginUser().getUserId(); |
| | | if(roleType == 4){ |
| | | TCrmSupplier crmSupplier = crmSupplierService.getOne(Wrappers.lambdaQuery(TCrmSupplier.class) |
| | | .eq(TCrmSupplier::getUserId, userId) |
| | | .last("LIMIT 1")); |
| | | List<TCrmSupplierToWarehouse> list = crmSupplierToWarehouseService.list(Wrappers.lambdaQuery(TCrmSupplierToWarehouse.class) |
| | | .eq(TCrmSupplierToWarehouse::getSupplierId, crmSupplier.getId())); |
| | | if(CollectionUtils.isEmpty(list)){ |
| | | return R.ok(); |
| | | } |
| | | List<String> warehouseIds = list.stream().map(TCrmSupplierToWarehouse::getWarehouseId).collect(Collectors.toList()); |
| | | List<TCrmWarehouse> crmWarehouseList = crmWarehouseService.list(Wrappers.lambdaQuery(TCrmWarehouse.class) |
| | | .eq(TCrmWarehouse::getStatus, 1) |
| | | .in(TCrmWarehouse::getId, warehouseIds) |
| | | .orderByDesc(TCrmWarehouse::getCreateTime)); |
| | | return R.ok(crmWarehouseList); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 添加crm仓库管理管理 |
| | | */ |
| | | @Log(title = "crm仓库管理信息-新增crm仓库管理", businessType = BusinessType.INSERT) |
| | |
| | | package com.ruoyi.web.controller.task; |
| | | |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.ruoyi.common.constant.Constants; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.redis.RedisCache; |
| | | import com.ruoyi.common.utils.http.HttpUtils; |
| | | import com.ruoyi.system.utils.util.AIUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.util.Set; |
| | | |
| | | /** |
| | | * @author xiaochen |
| | |
| | | @Component |
| | | public class TaskUtil { |
| | | |
| | | @Scheduled(cron = "0 0 0 * * ?") |
| | | @Autowired |
| | | private RedisCache redisCache; |
| | | @Autowired |
| | | private AIUtil aiUtil; |
| | | |
| | | @Scheduled(fixedRate = 86460000) |
| | | // @Scheduled(cron = "10 0 0 * * ?") |
| | | public void dayOfProportionBill() { |
| | | try { |
| | | |
| | | |
| | | |
| | | // 查询跳转检测的用户 |
| | | Set<String> cacheSet = redisCache.getCacheSet(Constants.AI_USER_INSPECTION); |
| | | // 获取前一天时间 |
| | | LocalDate lastDay = LocalDate.now().minusDays(1); |
| | | for (String phone : cacheSet) { |
| | | R<JSONObject> result = aiUtil.reportQuery(phone, lastDay.toString(), lastDay.toString()); |
| | | JSONObject data = result.getData(); |
| | | System.err.println(data); |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | |
| | | import com.aliyun.tea.TeaException; |
| | | import com.aliyun.teaopenapi.models.Config; |
| | | import com.aliyun.teautil.models.RuntimeOptions; |
| | | import com.ruoyi.system.model.TSysMessageConfig; |
| | | import com.ruoyi.system.service.TSysMessageConfigService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.util.Map; |
| | | |
| | | @Component |
| | | @Slf4j |
| | | public class MsgUtils { |
| | | |
| | | @Value("${code.config.accessKeyId}") |
| | | private String accessKeyId; |
| | | @Value("${code.config.accessKeySecret}") |
| | | private String accessKeySecret; |
| | | @Value("${code.config.signName}") |
| | | private String signName; |
| | | @Autowired |
| | | private TSysMessageConfigService messageConfigService; |
| | | |
| | | /** |
| | | * 使用AK&SK初始化账号Client |
| | |
| | | return new com.aliyun.dysmsapi20170525.Client(config); |
| | | } |
| | | |
| | | public void sendMsg(String phone,String code,String templateCode) throws Exception { |
| | | com.aliyun.dysmsapi20170525.Client client = MsgUtils.createClient(accessKeyId,accessKeySecret); |
| | | public void sendMsg(String phone, Map<String,String> params, String templateCode) throws Exception { |
| | | TSysMessageConfig sysMessageConfig = messageConfigService.getById(1); |
| | | com.aliyun.dysmsapi20170525.Client client = MsgUtils.createClient(sysMessageConfig.getAccessKeyId(),sysMessageConfig.getAccessKeySecret()); |
| | | SendSmsRequest sendSmsRequest = new SendSmsRequest() |
| | | .setSignName(signName) |
| | | .setSignName(sysMessageConfig.getSignName()) |
| | | .setTemplateCode(templateCode) |
| | | .setPhoneNumbers(phone) |
| | | .setTemplateParam("{\"code\":\""+code+"\"}"); |
| | | .setPhoneNumbers(phone); |
| | | if(!CollectionUtils.isEmpty(params)){ |
| | | StringBuilder builder = new StringBuilder(); |
| | | params.forEach((key,value)->{ |
| | | builder.append("\""+key+"\":\""+value+"\""); |
| | | builder.append(","); |
| | | }); |
| | | builder.deleteCharAt(builder.length()-1); |
| | | sendSmsRequest.setTemplateParam("{"+builder.toString()+"}"); |
| | | } |
| | | RuntimeOptions runtime = new RuntimeOptions(); |
| | | try { |
| | | // 复制代码运行请自行打印 API 的返回值 |
| | |
| | | log.info("短信发送失败:{}",error.message); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | prefix: https://xzgt.test.591taxi.cn:${server.port}${server.servlet.context-path} |
| | | wx: |
| | | conf: |
| | | appId: wxe91f1af7638aa5dd |
| | | secretId: a787e1a462715604e0c9528b6d8960d1 |
| | | #OSS及短信配置 |
| | | code: |
| | | config: |
| | | accessKeyId: LTAI5t99NH2Wwoq48ho72u8M |
| | | accessKeySecret: wAGHKUEBrrTgDcbfjnBKTEt5858Ru5 |
| | | signName: "海诊通" |
| | | appId: wxa17e8d1331e50934 |
| | | secretId: 79c234527fd3b6553679d52be5e29b19 |
| | | lakala: |
| | | MerchantNo: 822290059430BFA |
| | | TermNo: D9261078 |
| | |
| | | |
| | | |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.constant.Constants; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.redis.RedisCache; |
| | | import com.ruoyi.common.utils.DateUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.framework.web.service.TokenService; |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.HashSet; |
| | | import java.util.Objects; |
| | | import java.util.Set; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | private final TokenService tokenService; |
| | | private final TSysAppUserService sysAppUserService; |
| | | private final AIUtil aiUtil; |
| | | private final RedisCache redisCache; |
| | | @Autowired |
| | | public TSysInspectionController(TSysInspectionService sysInspectionService, TokenService tokenService, TSysAppUserService sysAppUserService, AIUtil aiUtil) { |
| | | public TSysInspectionController(TSysInspectionService sysInspectionService, TokenService tokenService, TSysAppUserService sysAppUserService, AIUtil aiUtil, RedisCache redisCache) { |
| | | this.sysInspectionService = sysInspectionService; |
| | | this.tokenService = tokenService; |
| | | this.sysAppUserService = sysAppUserService; |
| | | this.aiUtil = aiUtil; |
| | | this.redisCache = redisCache; |
| | | } |
| | | |
| | | /** |
| | |
| | | public R<String> ssoLogin() { |
| | | String userId = tokenService.getLoginUserApplet().getUserId(); |
| | | TSysAppUser sysAppUser = sysAppUserService.getById(userId); |
| | | if(StringUtils.isEmpty(sysAppUser.getNickName()) || Objects.isNull(sysAppUser.getSex()) || Objects.isNull(sysAppUser.getBirthTime())){ |
| | | if(StringUtils.isEmpty(sysAppUser.getNickName()) || Objects.isNull(sysAppUser.getSex()) || Objects.isNull(sysAppUser.getBirthTime()) || StringUtils.isEmpty(sysAppUser.getPhone())){ |
| | | return R.fail("请先完善用户信息"); |
| | | } |
| | | int code = aiUtil.ssoLogin().getCode(); |
| | | R<String> ssoLogin = aiUtil.ssoLogin(userId); |
| | | int code = ssoLogin.getCode(); |
| | | if(code != 200){ |
| | | return R.fail("单点登录失败"); |
| | | } |
| | |
| | | if(code != 200){ |
| | | return R.fail("初始化用户失败"); |
| | | } |
| | | return R.ok(); |
| | | // 存储用户当日检测 |
| | | Set<String> userSet = new HashSet<>(); |
| | | userSet.add(sysAppUser.getPhone()); |
| | | redisCache.setCacheSet(Constants.AI_USER_INSPECTION,userSet); |
| | | return R.ok(ssoLogin.getData()); |
| | | } |
| | | |
| | | } |
| | |
| | | .and(e->e.eq(TSysAppUser::getOpenId, appletUserDecodeData.getOpenId()).or() |
| | | .eq(TSysAppUser::getPhone, appletUserDecodeData.getPhoneNumber()))); |
| | | if (sysAppUser==null){ |
| | | // appUser.setTenantAttributes(); |
| | | // appUser.setTenantType(); |
| | | sysAppUser = new TSysAppUser(); |
| | | sysAppUser.setPhone(appletUserDecodeData.getPhoneNumber()); |
| | | // sysAppUser.setAccount(appletUserDecodeData.getPhoneNumber()); |
| | | // sysAppUser.setPassword(SecurityUtils.encryptPassword(appletUserDecodeData.getPhoneNumber().substring(5))); |
| | | sysAppUser.setOpenId(appletUserDecodeData.getOpenId()); |
| | | // 手机号中间四位替换为* |
| | | sysAppUser.setNickName(appletUserDecodeData.getPhoneNumber().replaceAll("(\\d{3})\\d{4}(\\d{4})", "$1****$2")); |
| | | sysAppUserService.save(sysAppUser); |
| | | }else { |
| | | // 手机号相同但openId为空的情况 |
| | | sysAppUser.setOpenId(appletUserDecodeData.getOpenId()); |
| | | } |
| | | LoginUserApplet loginUserApplet = new LoginUserApplet(); |
| | | TSysUserResp sysUserResp = new TSysUserResp(); |
| | |
| | | wx: |
| | | conf: |
| | | appId: wxa17e8d1331e50934 |
| | | secretId: a787e1a462715604e0c9528b6d8960d1 |
| | | code: |
| | | config: |
| | | accessKeyId: LTAI5t99NH2Wwoq48ho72u8M |
| | | accessKeySecret: wAGHKUEBrrTgDcbfjnBKTEt5858Ru5 |
| | | signName: "海诊通" |
| | | secretId: 79c234527fd3b6553679d52be5e29b19 |
| | | payment: |
| | | wx: |
| | | # 微信appid |
| | |
| | | apiKey: V7mKp9qL2Rs4jU6tX8wZ0bC3eF5hN1yD4gA |
| | | # 加签证书地址 |
| | | privateKeyPath: D:/app/cert/weixin/apiclient_key.pem |
| | | # 微信支付公钥id |
| | | publicKeyId: PUB_KEY_ID_0117217579152025091800181718000000 |
| | | # 微信支付公钥证书 |
| | | publicKeyPath: D:/app/cert/weixin/apiclient_cert.pem |
| | | # 证书序列号 |
| | | mchSerialNo: 52C3F27D42CB31E70F93C2E9A3FF4F0BD845EA6B |
| | | mchSerialNo: 39C7F6152E38A62B5786634D5C1F984FB5A38AD5 |
| | | # 支付成功回调地址 |
| | | notifyPayUrl: http://221.182.45.100/wx/pay/notify |
| | | # 支付退款回调地址 |
| | |
| | | */ |
| | | public static final String LIVE_APPOINTMENT_PUSH = "live:appointmentPush:"; |
| | | /** |
| | | * 直播推送 |
| | | * AI token 缓存 |
| | | */ |
| | | public static final String H5AI_ACCESS_TOKEN = "h5ai_accessToken:"; |
| | | /** |
| | | * AI token 缓存 |
| | | */ |
| | | public static final String DATA_ACCESS_TOKEN = "data_accessToken:"; |
| | | /** |
| | | * 用户检测缓存 |
| | | */ |
| | | public static final String AI_USER_INSPECTION = "ai_user_inspection:"; |
| | | } |
| | |
| | | import java.io.InputStream; |
| | | import java.io.InputStreamReader; |
| | | import java.io.PrintWriter; |
| | | import java.net.ConnectException; |
| | | import java.net.SocketTimeoutException; |
| | | import java.net.URL; |
| | | import java.net.URLConnection; |
| | | import java.net.*; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.security.cert.X509Certificate; |
| | | import java.util.Iterator; |
| | | import java.util.Map; |
| | | import javax.net.ssl.HostnameVerifier; |
| | | import javax.net.ssl.HttpsURLConnection; |
| | | import javax.net.ssl.SSLContext; |
| | | import javax.net.ssl.SSLSession; |
| | | import javax.net.ssl.TrustManager; |
| | | import javax.net.ssl.X509TrustManager; |
| | | |
| | | import com.ruoyi.common.exception.ServiceException; |
| | | import org.apache.http.Consts; |
| | | import org.apache.http.HttpResponse; |
| | | import org.apache.http.HttpStatus; |
| | | import org.apache.http.client.ClientProtocolException; |
| | | import org.apache.http.client.config.RequestConfig; |
| | | import org.apache.http.client.methods.CloseableHttpResponse; |
| | | import org.apache.http.client.methods.HttpGet; |
| | | import org.apache.http.client.methods.HttpPost; |
| | | import org.apache.http.client.methods.HttpUriRequest; |
| | | import org.apache.http.client.protocol.HttpClientContext; |
| | | import org.apache.http.client.utils.URIBuilder; |
| | | import org.apache.http.entity.StringEntity; |
| | | import org.apache.http.impl.client.CloseableHttpClient; |
| | | import org.apache.http.impl.client.HttpClientBuilder; |
| | | import org.apache.http.util.EntityUtils; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import com.ruoyi.common.constant.Constants; |
| | |
| | | } |
| | | return result.toString(); |
| | | } |
| | | /** |
| | | * 向指定 URL 发送GET方法的请求 |
| | | * |
| | | * @param url 发送请求的 URL |
| | | * @param param 请求参数,请求参数应该是 name1=value1&name2=value2 的形式。 |
| | | * @param contentType 编码类型 |
| | | * @return 所代表远程资源的响应结果 |
| | | */ |
| | | public static String sendGet(String url, String param, String contentType,String token) |
| | | { |
| | | StringBuilder result = new StringBuilder(); |
| | | BufferedReader in = null; |
| | | try |
| | | { |
| | | String urlNameString = StringUtils.isNotBlank(param) ? url + "?" + param : url; |
| | | log.info("sendGet - {}", urlNameString); |
| | | URL realUrl = new URL(urlNameString); |
| | | URLConnection connection = realUrl.openConnection(); |
| | | connection.setRequestProperty("accept", "*/*"); |
| | | connection.setRequestProperty("connection", "Keep-Alive"); |
| | | connection.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)"); |
| | | connection.setRequestProperty("Authorization","bearer "+ token); |
| | | connection.connect(); |
| | | in = new BufferedReader(new InputStreamReader(connection.getInputStream(), contentType)); |
| | | String line; |
| | | while ((line = in.readLine()) != null) |
| | | { |
| | | result.append(line); |
| | | } |
| | | log.info("recv - {}", result); |
| | | } |
| | | catch (ConnectException e) |
| | | { |
| | | log.error("调用HttpUtils.sendGet ConnectException, url=" + url + ",param=" + param, e); |
| | | } |
| | | catch (SocketTimeoutException e) |
| | | { |
| | | log.error("调用HttpUtils.sendGet SocketTimeoutException, url=" + url + ",param=" + param, e); |
| | | } |
| | | catch (IOException e) |
| | | { |
| | | log.error("调用HttpUtils.sendGet IOException, url=" + url + ",param=" + param, e); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | log.error("调用HttpsUtil.sendGet Exception, url=" + url + ",param=" + param, e); |
| | | } |
| | | finally |
| | | { |
| | | try |
| | | { |
| | | if (in != null) |
| | | { |
| | | in.close(); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | log.error("调用in.close Exception, url=" + url + ",param=" + param, ex); |
| | | } |
| | | } |
| | | return result.toString(); |
| | | } |
| | | |
| | | /*** |
| | | * get请求(带参数) |
| | | * @param url |
| | | * @return String |
| | | */ |
| | | public static String getReq(String url, Map<String, String> params,String token) { |
| | | String result = null; |
| | | try { |
| | | URIBuilder uriBuilder = new URIBuilder(url); |
| | | Iterator maplist = params.entrySet().iterator(); |
| | | while (maplist.hasNext()) { |
| | | Map.Entry<String, String> map = (Map.Entry<String, String>) maplist.next(); |
| | | uriBuilder.addParameter(map.getKey(), map.getValue()); |
| | | } |
| | | CloseableHttpClient client = HttpClientBuilder.create().build(); |
| | | HttpGet get = new HttpGet(uriBuilder.build()); |
| | | get.addHeader("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.81 Safari/537.36"); |
| | | get.addHeader("Authorization","bearer "+ token); |
| | | HttpResponse response = client.execute(get); |
| | | result = EntityUtils.toString(response.getEntity(), "UTF-8"); |
| | | } catch (URISyntaxException e) { |
| | | e.printStackTrace(); |
| | | } catch (ClientProtocolException e) { |
| | | e.printStackTrace(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return result; |
| | | } |
| | | /*** |
| | | * get请求(带参数) |
| | | * @param url |
| | | * @return String |
| | | */ |
| | | public static String postReq(String url, Map<String, String> params,String token) { |
| | | String result = null; |
| | | try { |
| | | URIBuilder uriBuilder = new URIBuilder(url); |
| | | Iterator maplist = params.entrySet().iterator(); |
| | | while (maplist.hasNext()) { |
| | | Map.Entry<String, String> map = (Map.Entry<String, String>) maplist.next(); |
| | | uriBuilder.addParameter(map.getKey(), map.getValue()); |
| | | } |
| | | CloseableHttpClient client = HttpClientBuilder.create().build(); |
| | | HttpPost post = new HttpPost(uriBuilder.build()); |
| | | post.addHeader("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.81 Safari/537.36"); |
| | | post.addHeader("Authorization",token); |
| | | HttpResponse response = client.execute(post); |
| | | result = EntityUtils.toString(response.getEntity(), "UTF-8"); |
| | | } catch (URISyntaxException e) { |
| | | e.printStackTrace(); |
| | | } catch (ClientProtocolException e) { |
| | | e.printStackTrace(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return result; |
| | | } |
| | | /** |
| | | * 向指定 URL 发送POST方法的请求 |
| | | * |
| | |
| | | conn.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)"); |
| | | conn.setRequestProperty("Accept-Charset", "utf-8"); |
| | | conn.setRequestProperty("contentType", "utf-8"); |
| | | conn.setRequestProperty("Authorization","bearer "+ token); |
| | | conn.setRequestProperty("Authorization",token); |
| | | conn.setDoOutput(true); |
| | | conn.setDoInput(true); |
| | | out = new PrintWriter(conn.getOutputStream()); |
| | |
| | | "/operations/getBySingleNum/**", |
| | | "/user/getUserInfoByNumber/**", |
| | | "/wxLogin/**","/t-contract/import-template","/t-contract/importContracts", |
| | | "/open/**","/cos/get/**" |
| | | "/open/**","/cos/get/**","/openIdByJsCode" |
| | | ).permitAll() |
| | | // 静态资源,可匿名访问 |
| | | .antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll() |
| | |
| | | import com.ruoyi.framework.manager.AsyncManager; |
| | | import com.ruoyi.framework.manager.factory.AsyncFactory; |
| | | import com.ruoyi.framework.security.context.AuthenticationContextHolder; |
| | | import com.ruoyi.system.model.TSysAppUser; |
| | | import com.ruoyi.system.service.ISysConfigService; |
| | | import com.ruoyi.system.service.ISysUserService; |
| | | import com.ruoyi.system.service.TSysAppUserService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | private ISysConfigService configService; |
| | | @Autowired |
| | | private SysPermissionService permissionService; |
| | | @Autowired |
| | | private TSysAppUserService sysAppUserService; |
| | | |
| | | /** |
| | | * 登录验证 |
| | |
| | | AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("not.null"))); |
| | | throw new UserNotExistsException(); |
| | | } |
| | | // 用户验证 |
| | | // TTenant user = tenantService.getOne(Wrappers.<TTenant>lambdaQuery().eq(TTenant::getAccount,username)); |
| | | // if (StringUtils.isNull(user)){ |
| | | // log.info("登录用户:{} 不存在.", username); |
| | | // throw new ServiceException(MessageUtils.message("user.not.exists")); |
| | | // } else if (user.getDisabled()) { |
| | | // log.info("登录用户:{} 已被删除.", username); |
| | | // throw new ServiceException(MessageUtils.message("user.password.delete")); |
| | | // } |
| | | // 校验验证码 |
| | | // Object cacheObject = redisCache.getCacheObject(user.getAccount()); |
| | | // if(!code.equals(String.valueOf(cacheObject))){ |
| | | // log.info("登录用户:{} 短信验证码错误{}", username,code); |
| | | // throw new ServiceException("短信验证码错误"); |
| | | // } |
| | | // AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_SUCCESS, MessageUtils.message("user.login.success"))); |
| | | // TTenantResp tTenantResp = new TTenantResp(); |
| | | // BeanUtils.copyProperties(user,tTenantResp); |
| | | // LoginUserApplet loginUser = new LoginUserApplet(user.getId(), null, tTenantResp, null); |
| | | Object cacheObject = redisCache.getCacheObject(username); |
| | | if(!code.equals(String.valueOf(cacheObject))){ |
| | | log.info("登录用户:{} 短信验证码错误{}", username,code); |
| | | throw new ServiceException("短信验证码错误"); |
| | | } |
| | | // 用户验证 |
| | | TSysAppUser sysAppUser = sysAppUserService.getOne(Wrappers.<TSysAppUser>lambdaQuery().eq(TSysAppUser::getPhone,username)); |
| | | if (StringUtils.isNull(sysAppUser)){ |
| | | sysAppUser = new TSysAppUser(); |
| | | sysAppUser.setPhone(username); |
| | | sysAppUser.setNickName(username.replaceAll("(\\d{3})\\d{4}(\\d{4})", "$1****$2")); |
| | | sysAppUserService.save(sysAppUser); |
| | | } |
| | | AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_SUCCESS, MessageUtils.message("user.login.success"))); |
| | | TSysUserResp user = new TSysUserResp(); |
| | | BeanUtils.copyProperties(sysAppUser,user); |
| | | LoginUserApplet loginUser = new LoginUserApplet(user.getId(), null, user, null); |
| | | // 生成token |
| | | return new LoginUserApplet(); |
| | | return loginUser; |
| | | } |
| | | |
| | | |
| | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel(value = "crm供应商DTO") |
| | | public class TCrmSupplierDTO extends TCrmSupplier { |
| | |
| | | @ApiModelProperty(value = "密码") |
| | | private String password; |
| | | |
| | | @ApiModelProperty(value = "仓库id集合") |
| | | private List<String> warehouseIds; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.system.model.TCrmSupplierToWarehouse; |
| | | |
| | | /** |
| | | * <p> |
| | | * 供应商仓库关联表 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2025-09-22 |
| | | */ |
| | | public interface TCrmSupplierToWarehouseMapper extends BaseMapper<TCrmSupplierToWarehouse> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.system.model.TSysMessageConfig; |
| | | |
| | | /** |
| | | * <p> |
| | | * 短信配置 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2025-09-23 |
| | | */ |
| | | public interface TSysMessageConfigMapper extends BaseMapper<TSysMessageConfig> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | 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 lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * <p> |
| | | * 供应商仓库关联表 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2025-09-22 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("t_crm_supplier_to_warehouse") |
| | | @ApiModel(value="TCrmSupplierToWarehouse对象", description="供应商仓库关联表") |
| | | public class TCrmSupplierToWarehouse implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "id", type = IdType.ASSIGN_ID) |
| | | private String id; |
| | | |
| | | @ApiModelProperty(value = "供应商id") |
| | | @TableField("supplier_id") |
| | | private String supplierId; |
| | | |
| | | @ApiModelProperty(value = "仓库id") |
| | | @TableField("warehouse_id") |
| | | private String warehouseId; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * <p> |
| | | * 短信配置 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2025-09-23 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("t_sys_message_config") |
| | | @ApiModel(value="TSysMessageConfig对象", description="短信配置") |
| | | public class TSysMessageConfig implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @TableField("access_key_id") |
| | | private String accessKeyId; |
| | | |
| | | @TableField("access_key_secret") |
| | | private String accessKeySecret; |
| | | |
| | | @TableField("sign_name") |
| | | private String signName; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.system.model.TCrmSupplierToWarehouse; |
| | | |
| | | /** |
| | | * <p> |
| | | * 供应商仓库关联表 服务类 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2025-09-22 |
| | | */ |
| | | public interface TCrmSupplierToWarehouseService extends IService<TCrmSupplierToWarehouse> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.system.model.TSysMessageConfig; |
| | | |
| | | /** |
| | | * <p> |
| | | * 短信配置 服务类 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2025-09-23 |
| | | */ |
| | | public interface TSysMessageConfigService extends IService<TSysMessageConfig> { |
| | | |
| | | } |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.domain.R; |
| | |
| | | import com.ruoyi.system.dto.TCrmSupplierDTO; |
| | | import com.ruoyi.system.mapper.TCrmSupplierMapper; |
| | | import com.ruoyi.system.model.TCrmSupplier; |
| | | import com.ruoyi.system.model.TCrmSupplierToWarehouse; |
| | | import com.ruoyi.system.query.TCrmSupplierQuery; |
| | | import com.ruoyi.system.service.ISysUserService; |
| | | import com.ruoyi.system.service.TCrmSupplierService; |
| | | import com.ruoyi.system.service.TCrmSupplierToWarehouseService; |
| | | import com.ruoyi.system.vo.TCrmSupplierVO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | |
| | | @Autowired |
| | | private ISysUserService sysUserService; |
| | | @Autowired |
| | | private TCrmSupplierToWarehouseService crmSupplierToWarehouseService; |
| | | |
| | | @Override |
| | | public PageInfo<TCrmSupplierVO> pageList(TCrmSupplierQuery query) { |
| | | PageInfo<TCrmSupplierVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<TCrmSupplierVO> list = this.baseMapper.pageList(query,pageInfo); |
| | | if(CollectionUtils.isEmpty(list)){ |
| | | return pageInfo; |
| | | } |
| | | List<String> supplierIds = list.stream().map(TCrmSupplierVO::getId).collect(Collectors.toList()); |
| | | List<TCrmSupplierToWarehouse> crmSupplierToWarehouses = crmSupplierToWarehouseService.list(Wrappers.lambdaQuery(TCrmSupplierToWarehouse.class) |
| | | .eq(TCrmSupplierToWarehouse::getSupplierId, supplierIds)); |
| | | for (TCrmSupplierVO crmSupplierVO : list) { |
| | | List<TCrmSupplierToWarehouse> supplierToWarehouses = crmSupplierToWarehouses.stream().filter(crmSupplierToWarehouse -> crmSupplierToWarehouse.getSupplierId().equals(crmSupplierVO.getId())).collect(Collectors.toList()); |
| | | if(!CollectionUtils.isEmpty(supplierToWarehouses)){ |
| | | List<String> warehouseIds = supplierToWarehouses.stream().map(TCrmSupplierToWarehouse::getWarehouseId).collect(Collectors.toList()); |
| | | crmSupplierVO.setWarehouseIds(warehouseIds); |
| | | } |
| | | } |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | |
| | | return R.fail(dto.getAccount()+"-账号已存在"); |
| | | } |
| | | this.save(dto); |
| | | // 添加供应商和仓库关联关系 |
| | | TCrmSupplierToWarehouse crmSupplierToWarehouse = new TCrmSupplierToWarehouse(); |
| | | List<String> warehouseIds = dto.getWarehouseIds(); |
| | | if(!CollectionUtils.isEmpty(warehouseIds)){ |
| | | List<TCrmSupplierToWarehouse> crmSupplierToWarehouses = new ArrayList<>(); |
| | | for (String warehouseId : warehouseIds) { |
| | | crmSupplierToWarehouse.setSupplierId(dto.getId()); |
| | | crmSupplierToWarehouse.setWarehouseId(warehouseId); |
| | | crmSupplierToWarehouses.add(crmSupplierToWarehouse); |
| | | } |
| | | crmSupplierToWarehouseService.saveBatch(crmSupplierToWarehouses); |
| | | } |
| | | // 添加账号 |
| | | SysUser user = new SysUser(); |
| | | user.setUserName(dto.getAccount()); |
| | |
| | | } |
| | | SysUser user = sysUserService.selectUserById(dto.getUserId()); |
| | | this.updateById(dto); |
| | | // 删除供应商和仓库关联关系 |
| | | crmSupplierToWarehouseService.remove(Wrappers.lambdaQuery(TCrmSupplierToWarehouse.class).eq(TCrmSupplierToWarehouse::getSupplierId, dto.getId())); |
| | | // 添加供应商和仓库关联关系 |
| | | List<String> warehouseIds = dto.getWarehouseIds(); |
| | | if(!CollectionUtils.isEmpty(warehouseIds)){ |
| | | List<TCrmSupplierToWarehouse> crmSupplierToWarehouses = new ArrayList<>(); |
| | | for (String warehouseId : warehouseIds) { |
| | | TCrmSupplierToWarehouse crmSupplierToWarehouse = new TCrmSupplierToWarehouse(); |
| | | crmSupplierToWarehouse.setSupplierId(dto.getId()); |
| | | crmSupplierToWarehouse.setWarehouseId(warehouseId); |
| | | crmSupplierToWarehouses.add(crmSupplierToWarehouse); |
| | | } |
| | | crmSupplierToWarehouseService.saveBatch(crmSupplierToWarehouses); |
| | | } |
| | | if(Objects.nonNull(user)){ |
| | | // 修改账号 |
| | | user.setPhonenumber(dto.getPhone()); |
New file |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.system.mapper.TCrmSupplierToWarehouseMapper; |
| | | import com.ruoyi.system.model.TCrmSupplierToWarehouse; |
| | | import com.ruoyi.system.service.TCrmSupplierToWarehouseService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 供应商仓库关联表 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2025-09-22 |
| | | */ |
| | | @Service |
| | | public class TCrmSupplierToWarehouseServiceImpl extends ServiceImpl<TCrmSupplierToWarehouseMapper, TCrmSupplierToWarehouse> implements TCrmSupplierToWarehouseService { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.system.mapper.TSysMessageConfigMapper; |
| | | import com.ruoyi.system.model.TSysMessageConfig; |
| | | import com.ruoyi.system.service.TSysMessageConfigService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 短信配置 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2025-09-23 |
| | | */ |
| | | @Service |
| | | public class TSysMessageConfigServiceImpl extends ServiceImpl<TSysMessageConfigMapper, TSysMessageConfig> implements TSysMessageConfigService { |
| | | |
| | | } |
| | |
| | | import com.ruoyi.system.model.TSysAiConfig; |
| | | import com.ruoyi.system.service.TSysAiConfigService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import okhttp3.OkHttpClient; |
| | | import okhttp3.Request; |
| | | import okhttp3.Response; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.util.StringUtils; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | @Slf4j |
| | |
| | | */ |
| | | public static final String ACCESS_TOKEN_URL = "https://www.ai-tongue.com/backend/auth/invoker/pwd/signin"; |
| | | /** |
| | | * 获取数据查询access_token |
| | | */ |
| | | public static final String DATA_TOKEN_URL = "https://www.ai-tongue.com/backend/auth/user/pwd/signin"; |
| | | /** |
| | | * 会员单点登录 |
| | | */ |
| | | public static final String SSO_URL = "https://www.ai-tongue.com/h5/sso"; |
| | |
| | | * 初始化会员信息 |
| | | */ |
| | | public static final String INIT_USER_URL = "https://www.ai-tongue.com/backend/check/i/secret/thirdUser/init"; |
| | | /** |
| | | * 初始化会员信息 |
| | | */ |
| | | public static final String REPORT_QUERY_URL = "https://www.ai-tongue.com/backend/devicecheck/m/report/query"; |
| | | |
| | | /** |
| | | * 获取企业应用access_token |
| | |
| | | redisCache.setCacheObject(Constants.H5AI_ACCESS_TOKEN, accessToken, expiresIn-20, TimeUnit.SECONDS); |
| | | return accessToken; |
| | | } |
| | | /** |
| | | * 获取企业应用access_token |
| | | * @return |
| | | */ |
| | | public String getDataToken() { |
| | | String accessToken = redisCache.getCacheObject(Constants.DATA_ACCESS_TOKEN); |
| | | if(StringUtils.hasLength(accessToken)){ |
| | | return accessToken; |
| | | } |
| | | TSysAiConfig sysAiConfig = sysAiConfigService.getById(1); |
| | | Map<String, String> params = new HashMap<>(); |
| | | params.put("loginName", sysAiConfig.getLoginName()); |
| | | params.put("loginPassword", MD5Util.md5Hex(sysAiConfig.getLoginPassword())); |
| | | String result = HttpUtils.postReq(DATA_TOKEN_URL, params,"Basic Y2xvdWRhcHA6MTIzNDU2"); |
| | | log.info("获取access_token:{}", result); |
| | | JSONObject object = JSONObject.parseObject(result); |
| | | if(object.getInteger("code") != 0){ |
| | | throw new ServiceException(object.getString("msg")); |
| | | } |
| | | JSONObject data = object.getJSONObject("data"); |
| | | accessToken = data.getString("access_token"); |
| | | Integer expiresIn = data.getInteger("expires_in"); |
| | | redisCache.setCacheObject(Constants.DATA_ACCESS_TOKEN, accessToken, expiresIn-20, TimeUnit.SECONDS); |
| | | return accessToken; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 会员单点登录 |
| | | * @return |
| | | */ |
| | | public R ssoLogin() { |
| | | public R<String> ssoLogin(String userId) { |
| | | String accessToken = redisCache.getCacheObject(Constants.H5AI_ACCESS_TOKEN); |
| | | if(!StringUtils.hasLength(accessToken)){ |
| | | accessToken = getAccessToken(); |
| | | } |
| | | TSysAiConfig sysAiConfig = sysAiConfigService.getById(1); |
| | | String result = HttpUtils.sendGet(SSO_URL, "access_token="+accessToken |
| | | +"&encryptedThirdId="+sysAiConfig.getRsaPublicKey() |
| | | +"&signEncryptedThirdId="+sysAiConfig.getDevRsaPublicKey() |
| | | String result = null; |
| | | try { |
| | | String encryptedThirdId = RsaSimpleUtil.encrypt(userId, sysAiConfig.getRsaPublicKey()); |
| | | String signEncryptedThirdId = RsaSimpleUtil.sign(encryptedThirdId, sysAiConfig.getDevRsaPrivateKey()); |
| | | result = HttpUtils.sendGet(SSO_URL, "access_token="+accessToken |
| | | +"&encryptedThirdId="+ encryptedThirdId |
| | | +"&signEncryptedThirdId="+signEncryptedThirdId |
| | | +"&capture=all&diseaseCode=C00.D00"); |
| | | log.info("会员单点登录结果:{}", result); |
| | | JSONObject object = JSONObject.parseObject(result); |
| | | if(object.getInteger("code") != 0){ |
| | | throw new ServiceException(object.getString("msg")); |
| | | } catch (Exception e) { |
| | | throw new ServiceException("会员单点登录失败:"+e.getMessage()); |
| | | } |
| | | return R.ok(); |
| | | log.info("会员单点登录结果:{}", result); |
| | | return R.ok(result); |
| | | } |
| | | |
| | | |
| | |
| | | accessToken = getAccessToken(); |
| | | } |
| | | TSysAiConfig sysAiConfig = sysAiConfigService.getById(1); |
| | | String result = HttpUtils.sendPost(INIT_USER_URL, "devId="+sysAiConfig.getDevId() |
| | | +"&thirdId="+userId |
| | | +"&signEncryptedThirdId="+sysAiConfig.getDevRsaPublicKey() |
| | | +"&thirdName="+nickName |
| | | +"&sex="+sex |
| | | +"&birthday="+birthday,accessToken); |
| | | |
| | | JSONObject params = new JSONObject(); |
| | | params.put("devId", sysAiConfig.getDevId()); |
| | | params.put("thirdId", userId); |
| | | params.put("signEncryptedThirdId", sysAiConfig.getDevRsaPublicKey()); |
| | | params.put("thirdName", nickName); |
| | | params.put("sex", sex.toString()); |
| | | params.put("birthday", birthday); |
| | | |
| | | String result = HttpClientUtils.postFromJson(INIT_USER_URL, params.toJSONString(),"Bearer " + accessToken); |
| | | log.info("会员创建初始化结果:{}", result); |
| | | JSONObject object = JSONObject.parseObject(result); |
| | | if(object.getInteger("code") != 0){ |
| | | throw new ServiceException(object.getString("msg")); |
| | | } |
| | | return R.ok(); |
| | | return R.ok(object); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 检测报告检索 |
| | | * @param phone |
| | | * @param start |
| | | * @param end |
| | | * @return |
| | | */ |
| | | public R<JSONObject> reportQuery(String phone,String start,String end){ |
| | | String accessToken = redisCache.getCacheObject(Constants.DATA_ACCESS_TOKEN); |
| | | if(!StringUtils.hasLength(accessToken)){ |
| | | accessToken = getDataToken(); |
| | | } |
| | | Map<String, String> params = new HashMap<>(); |
| | | params.put("phone", phone); |
| | | params.put("start", start); |
| | | params.put("end", end); |
| | | String result = HttpUtils.getReq(REPORT_QUERY_URL, params, accessToken); |
| | | log.info("检测报告检索结果:{}", result); |
| | | JSONObject object = JSONObject.parseObject(result); |
| | | if(object.getInteger("code") != 0){ |
| | | throw new ServiceException(object.getString("msg")); |
| | | } |
| | | return R.ok(object); |
| | | } |
| | | |
| | | } |
| | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel(value = "TCrmSupplierVO对象", description = "crm供应商VO") |
| | | public class TCrmSupplierVO extends TCrmSupplier { |
| | | |
| | | @ApiModelProperty(value = "仓库id集合") |
| | | private List<String> warehouseIds; |
| | | |
| | | } |
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.ruoyi.system.mapper.TCrmSupplierToWarehouseMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.system.model.TCrmSupplierToWarehouse"> |
| | | <id column="id" property="id" /> |
| | | <result column="supplier_id" property="supplierId" /> |
| | | <result column="warehouse_id" property="warehouseId" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, supplier_id, warehouse_id |
| | | </sql> |
| | | |
| | | </mapper> |