Commit 49bc0f72 authored by zhangc's avatar zhangc

Merge branch 'dm_dev' of http://gitlab.ioubuy.cn/yaobenzhang/dm_project into dm_dev

parents 1909103c da3c8b94
package com.jz.dm.controller; package com.jz.dm.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jz.common.bean.PageInfoResponse;
import com.jz.common.constant.Constants;
import com.jz.common.utils.Result; import com.jz.common.utils.Result;
import com.jz.dm.models.dto.DataBankNumberErrorDto;
import com.jz.dm.models.req.DataBankNumberErrorReq;
import com.jz.dm.models.req.LogInfoDetailReq; import com.jz.dm.models.req.LogInfoDetailReq;
import com.jz.dm.models.req.LogInfoListReq; import com.jz.dm.models.req.LogInfoListReq;
import com.jz.dm.service.ApiLogService; import com.jz.dm.service.ApiLogService;
...@@ -11,6 +16,7 @@ import org.springframework.web.bind.annotation.*; ...@@ -11,6 +16,7 @@ import org.springframework.web.bind.annotation.*;
import reactor.core.publisher.Mono; import reactor.core.publisher.Mono;
import javax.validation.Valid; import javax.validation.Valid;
import java.util.List;
/** /**
* @author ZC * @author ZC
...@@ -62,4 +68,18 @@ public class ApiLogController { ...@@ -62,4 +68,18 @@ public class ApiLogController {
public Mono<Result> countAPiCallStat(@RequestParam(name = "date") String date) { public Mono<Result> countAPiCallStat(@RequestParam(name = "date") String date) {
return Mono.fromSupplier(() -> apiLogService.countAPiCallStat(date)); return Mono.fromSupplier(() -> apiLogService.countAPiCallStat(date));
} }
/**
* 数据银行-查询用户调用数和错误率
* @param req
* @return
*/
@ApiOperation("数据银行-查询用户调用数和错误率")
@PostMapping(value = "/queryNumberAndError")
public Result<DataBankNumberErrorDto> queryNumberAndError(@RequestBody DataBankNumberErrorReq req) {
return apiLogService.queryNumberAndError(req);
}
} }
package com.jz.dm.mapper; package com.jz.dm.mapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jz.common.utils.Result;
import com.jz.dm.models.domian.ApiReqLog; import com.jz.dm.models.domian.ApiReqLog;
import com.jz.dm.models.dto.ApiCallDataDto; import com.jz.dm.models.dto.ApiCallDataDto;
import com.jz.dm.models.dto.DataBankNumberErrorDto;
import com.jz.dm.models.req.DataBankNumberErrorReq;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map;
/**api请求日志表 mapper /**api请求日志表 mapper
* @author ybz * @author ybz
...@@ -27,4 +34,10 @@ public interface ApiReqLogMapper extends BaseMapper<ApiReqLog> { ...@@ -27,4 +34,10 @@ public interface ApiReqLogMapper extends BaseMapper<ApiReqLog> {
*/ */
List<ApiCallDataDto> countApiCallMonthData(Date date); List<ApiCallDataDto> countApiCallMonthData(Date date);
/**
* 查询用户调用数和错误率-数据银行
* @param req
* @return
*/
List<DataBankNumberErrorDto> selectByNumberError(@Param("req") List<Map<String, String>> req);
} }
...@@ -168,5 +168,20 @@ public class ApiReqLog implements Serializable { ...@@ -168,5 +168,20 @@ public class ApiReqLog implements Serializable {
@TableField("remark") @TableField("remark")
@JsonIgnore @JsonIgnore
private String remark; private String remark;
@ApiModelProperty(value = "调用数")
@TableField(exist = false)
private String callNumber;
@ApiModelProperty(value = "错误率")
@TableField(exist = false)
private String errorRate;
@ApiModelProperty(value = "成功数")
@TableField(exist = false)
private String scSuccess;
@ApiModelProperty(value = "错误数")
@TableField(exist = false)
private String wrongNumber;
} }
package com.jz.dm.models.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* @ClassName:
* @Author: Carl
* @Date: 2021/1/22
* @Version:
*/
@ApiModel(value = "数据银行查询用户调用数和错误率返回参数")
@Data
public class DataBankNumberErrorDto implements Serializable {
@ApiModelProperty(value = "apiKey")
private String apiKey;
@ApiModelProperty(value = "客户请求token")
private String requestToken;
@ApiModelProperty(value = "调用数")
private String callNumber;
@ApiModelProperty(value = "错误率")
private String errorRate;
@ApiModelProperty(value = "成功数")
private String scSuccess;
@ApiModelProperty(value = "错误数")
private String wrongNumber;
}
package com.jz.dm.models.req;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
import java.util.Map;
/**
* @ClassName:
* @Author: Carl
* @Date: 2021/1/22
* @Version:
*/
@Data
@ApiModel
public class DataBankNumberErrorReq implements Serializable {
private List<Map<String,String>> reqList;
}
...@@ -26,5 +26,9 @@ public class LogInfoListReq extends BasePageBean implements Serializable { ...@@ -26,5 +26,9 @@ public class LogInfoListReq extends BasePageBean implements Serializable {
private String apiKey; private String apiKey;
@ApiModelProperty(value = "客户请求token") @ApiModelProperty(value = "客户请求token")
private String requestToken; private String requestToken;
@ApiModelProperty(value = "创建时间")
private String createDate;
@ApiModelProperty(value = "历史查询-数据银行")
private String historyQuery;
} }
package com.jz.dm.service; package com.jz.dm.service;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jz.common.bean.PageInfoResponse;
import com.jz.common.utils.Result; import com.jz.common.utils.Result;
import com.jz.dm.models.domian.ApiReqLog; import com.jz.dm.models.domian.ApiReqLog;
import com.jz.dm.models.dto.DataBankNumberErrorDto;
import com.jz.dm.models.req.DataBankNumberErrorReq;
import com.jz.dm.models.req.LogInfoDetailReq; import com.jz.dm.models.req.LogInfoDetailReq;
import com.jz.dm.models.req.LogInfoListReq; import com.jz.dm.models.req.LogInfoListReq;
import net.sf.json.JSONObject; import net.sf.json.JSONObject;
import java.util.List;
/** /**
* @author ZC * @author ZC
* @PACKAGE_NAME: com.jz.dm.service * @PACKAGE_NAME: com.jz.dm.service
...@@ -50,4 +55,12 @@ public interface ApiLogService { ...@@ -50,4 +55,12 @@ public interface ApiLogService {
* @return * @return
*/ */
Result countAPiCallStat(String date); Result countAPiCallStat(String date);
/**
* 查询用户调用数和错误率-数据银行
* @param req
* @return
*/
Result<DataBankNumberErrorDto> queryNumberAndError(DataBankNumberErrorReq req);
} }
package com.jz.dm.service.impl; package com.jz.dm.service.impl;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
...@@ -9,10 +10,14 @@ import com.jz.dm.common.enums.GeneralStatusTypeEnum; ...@@ -9,10 +10,14 @@ import com.jz.dm.common.enums.GeneralStatusTypeEnum;
import com.jz.dm.config.ReentrantRedisLock; import com.jz.dm.config.ReentrantRedisLock;
import com.jz.dm.mapper.ApiReqLogMapper; import com.jz.dm.mapper.ApiReqLogMapper;
import com.jz.dm.models.domian.ApiReqLog; import com.jz.dm.models.domian.ApiReqLog;
import com.jz.dm.models.dto.DataBankNumberErrorDto;
import com.jz.dm.models.req.DataBankNumberErrorReq;
import com.jz.dm.models.req.LogInfoDetailReq; import com.jz.dm.models.req.LogInfoDetailReq;
import com.jz.dm.models.req.LogInfoListReq; import com.jz.dm.models.req.LogInfoListReq;
import com.jz.dm.service.ApiLogService; import com.jz.dm.service.ApiLogService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject; import net.sf.json.JSONObject;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -20,8 +25,7 @@ import org.springframework.stereotype.Service; ...@@ -20,8 +25,7 @@ import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Calendar; import java.util.*;
import java.util.Date;
/** /**
* @author ZC * @author ZC
...@@ -57,9 +61,38 @@ public class ApiLogServiceImpl implements ApiLogService { ...@@ -57,9 +61,38 @@ public class ApiLogServiceImpl implements ApiLogService {
if (StringUtils.isNotBlank(req.getStatus())){ if (StringUtils.isNotBlank(req.getStatus())){
query.eq("status",req.getStatus()); query.eq("status",req.getStatus());
} }
if (StringUtils.isNotBlank(req.getRequestToken())){
query.eq("request_token",req.getRequestToken());
}
if (StringUtils.isNotBlank(req.getCreateDate())){
String startTime = req.getCreateDate().substring(0, 10) + " 00:00:00";
String endTime = req.getCreateDate().substring(11, 21) + " 23:59:59";
query.between("create_date",startTime, endTime);
}
query.eq("is_deleted",0); query.eq("is_deleted",0);
query.orderByDesc("create_date"); query.orderByDesc("create_date");
return apiReqLogMapper.selectPage(page, query); IPage<ApiReqLog> apiReqLogIPage = apiReqLogMapper.selectPage(page, query);
// 数据银行-历史查询返回参数
if (req.getHistoryQuery().equals("01") && req.getHistoryQuery() != null){
for (ApiReqLog record : apiReqLogIPage.getRecords()) {
DataBankNumberErrorReq errorReq = new DataBankNumberErrorReq();
List<Map<String, String>> reqList = new ArrayList<>();
Map<String, String> map = new HashMap<>();
map.put("apiKey", req.getApiKey());
map.put("requestToken", req.getRequestToken());
reqList.add(map);
errorReq.setReqList(reqList);
Result<DataBankNumberErrorDto> result = queryNumberAndError(errorReq);
JSONArray jsonArray = JSONArray.fromObject(result.getData());
JSONObject jsonObject = jsonArray.getJSONObject(0);
record.setScSuccess(jsonObject.get("scSuccess").toString());
record.setErrorRate(jsonObject.get("errorRate").toString());
record.setCallNumber(jsonObject.get("callNumber").toString());
record.setWrongNumber(jsonObject.get("wrongNumber").toString());
}
}
return apiReqLogIPage;
} }
/** /**
...@@ -97,6 +130,27 @@ public class ApiLogServiceImpl implements ApiLogService { ...@@ -97,6 +130,27 @@ public class ApiLogServiceImpl implements ApiLogService {
return Result.of_success(apiReqLogMapper.countApiCallMonthData(dateParam)); return Result.of_success(apiReqLogMapper.countApiCallMonthData(dateParam));
} }
/**
* 查询用户调用数和错误率-数据银行
*
* @param req
* @return
*/
@Override
public Result<DataBankNumberErrorDto> queryNumberAndError(DataBankNumberErrorReq req) {
List<Map<String, String>> reqList = req.getReqList();
if (reqList.size() == 0) {
return Result.of_error("参数为空!");
}
List<DataBankNumberErrorDto> list = apiReqLogMapper.selectByNumberError(reqList);
if (list.size() == 0) {
return Result.of_error("查询失败!参数为空!");
}
return Result.of_success(list);
}
/** /**
* 根据id更新日志 * 根据id更新日志
* @param id * @param id
......
...@@ -13,5 +13,50 @@ ...@@ -13,5 +13,50 @@
FROM t_api_req_log FROM t_api_req_log
WHERE DATE_FORMAT(create_date,'%Y:%m')=DATE_FORMAT(#{date},'%Y:%m') WHERE DATE_FORMAT(create_date,'%Y:%m')=DATE_FORMAT(#{date},'%Y:%m')
</select> </select>
<sql id="Number_Error_list">
api_key in
<foreach collection="req" item="apiKey" open="(" close=")" separator=",">
#{apiKey.apiKey}
</foreach>
AND
request_token in
<foreach collection="req" item="requestToken" open="(" close=")" separator=",">
#{requestToken.requestToken}
</foreach>
</sql>
<select id="selectByNumberError" resultType="com.jz.dm.models.dto.DataBankNumberErrorDto" parameterType="map">
SELECT
a.number AS callNumber,
Round( b.wrongNumber / a.number * 100, 2 ) AS errorRate,
a.api_key AS apiKey,
a.request_token AS requestToken,
b.successNumber as scSuccess,
b.wrongNumber as wrongNumber
FROM
(
SELECT
count( api_key ) AS number,
api_key,
request_token
FROM
t_api_req_log
WHERE
<include refid="Number_Error_list"/>
GROUP BY
api_key
) a
INNER JOIN (
SELECT
sum( CASE WHEN `status` = 'FAIL' THEN 1 ELSE 0 END ) AS wrongNumber,
sum( CASE WHEN `status` = 'SUCCEED' THEN 1 ELSE 0 END ) AS successNumber,
api_key
FROM
t_api_req_log
WHERE
<include refid="Number_Error_list"/>
GROUP BY
api_key
) b ON a.api_key = b.api_key
</select>
</mapper> </mapper>
...@@ -58,6 +58,6 @@ public class MallCustomerApiDto implements Serializable { ...@@ -58,6 +58,6 @@ public class MallCustomerApiDto implements Serializable {
@ApiModelProperty(value = "头像") @ApiModelProperty(value = "头像")
private String headPortraitUrl; private String headPortraitUrl;
@ApiModelProperty(value = "角色") // @ApiModelProperty(value = "角色")
private String roleId; // private String roleId;
} }
package com.jz.common.utils;
import java.util.Base64;
/**
* @ClassName:
* @Author: Carl
* @Date: 2021/1/28
* @Version:
*/
public class Base64Util {
private static final String SALT = "wj"; //公版的盐值
private static final int REPEAT = 3; ///加密的次数
/**
* 加密处理
*
* @param password 要加密的字符串密码数据,需要与盐值配合
* @return 加密后的数据
*/
public static String encode(String password) {
password = password + "{" + SALT + "}";
byte[] bytes = password.getBytes();
for (int i = 0; i < REPEAT; i++) {
bytes = Base64.getEncoder().encode(bytes);
}
return new String(bytes);
}
/**
* 解密
*
* @param needDecode 需要解密的数据
* @return 解密的结果
*/
public static String decode(String needDecode) {
byte[] bytes = needDecode.getBytes();
for (int i = 0; i < REPEAT; i++) {
bytes = Base64.getDecoder().decode(bytes);
}
return new String(bytes).replaceAll("\\{\\w+}", "");
}
public static void main(String[] args) {
String encode = encode("123456");
System.out.println(encode);
}
}
package com.jz.common.utils; package com.jz.common.utils;
import com.aliyuncs.CommonRequest;
import com.aliyuncs.CommonResponse;
import com.aliyuncs.DefaultAcsClient; import com.aliyuncs.DefaultAcsClient;
import com.aliyuncs.IAcsClient; import com.aliyuncs.IAcsClient;
import com.aliyuncs.dysmsapi.model.v20170525.SendSmsRequest; import com.aliyuncs.dysmsapi.model.v20170525.SendSmsRequest;
import com.aliyuncs.dysmsapi.model.v20170525.SendSmsResponse; import com.aliyuncs.dysmsapi.model.v20170525.SendSmsResponse;
import com.aliyuncs.exceptions.ClientException; import com.aliyuncs.exceptions.ClientException;
import com.aliyuncs.exceptions.ServerException;
import com.aliyuncs.http.MethodType; import com.aliyuncs.http.MethodType;
import com.aliyuncs.profile.DefaultProfile; import com.aliyuncs.profile.DefaultProfile;
import com.aliyuncs.profile.IClientProfile; import com.aliyuncs.profile.IClientProfile;
public class SMSUtils { public class SMSUtils {
public static void main(String[] args) { // public static void main(String[] args) {
sendMessage(loginTemplate, ValidateCodeUtils.generateValidateCode(6),"18279617424"); // sendMessage(loginTemplate, ValidateCodeUtils.generateValidateCode(6),"18279617424");
} // }
// 你的签名 // 你的签名
private static final String msgSign = "万家数据商城"; private static final String msgSign = "万家数据商城";
//模版CODE //模版CODE
...@@ -23,8 +26,8 @@ public class SMSUtils { ...@@ -23,8 +26,8 @@ public class SMSUtils {
// AK,AKS // AK,AKS
private static final String accessKeyId = "LTAI4GKPoTkrT6n2fSV7ePEG"; private static final String accessKeyId = "LTAI4GKPoTkrT6n2fSV7ePEG";
private static final String accessKeySecret = "k8HcW3TxZzGxAetEpyDInZehip9MAE"; private static final String accessKeySecret = "k8HcW3TxZzGxAetEpyDInZehip9MAE";
// 阿里云发送验证码短信 // 阿里云发送验证码短信
public static void sendMessage (String template, Integer code, String toPhoneNumber) { public static void sendMessage (String template, Integer code, String toPhoneNumber, String accessKeyId, String accessKeySecret,String msgSign) {
//设置超时时间-可自行调整 //设置超时时间-可自行调整
System.setProperty("sun.net.client.defaultConnectTimeout", "10000"); System.setProperty("sun.net.client.defaultConnectTimeout", "10000");
System.setProperty("sun.net.client.defaultReadTimeout", "10000"); System.setProperty("sun.net.client.defaultReadTimeout", "10000");
...@@ -74,5 +77,31 @@ public class SMSUtils { ...@@ -74,5 +77,31 @@ public class SMSUtils {
} }
} }
// 发送短信二
public static void sendMSM(String template, Integer code, String toPhoneNumber) {
DefaultProfile profile = DefaultProfile.getProfile("cn-hangzhou", "LTAI4GKPoTkrT6n2fSV7ePEG", "k8HcW3TxZzGxAetEpyDInZehip9MAE");
// DefaultProfile profile = DefaultProfile.getProfile("cn-hangzhou", "<accessKeyId>", "<accessSecret>");
IAcsClient client = new DefaultAcsClient(profile);
CommonRequest request = new CommonRequest();
request.setMethod(MethodType.GET);
request.setDomain("dysmsapi.aliyuncs.com");
request.setVersion("2017-05-25");
request.setAction("SendSms");
request.putQueryParameter("RegionId", "cn-hangzhou");
request.putQueryParameter("PhoneNumbers", toPhoneNumber);
request.putQueryParameter("SignName", template);
request.putQueryParameter("TemplateCode", "SMS_205878938");
request.putQueryParameter("TemplateParam", "{\"code\":\""+code+"\"}");
try {
CommonResponse response = client.getCommonResponse(request);
System.out.println(response.getData());
} catch (ServerException e) {
e.printStackTrace();
} catch (ClientException e) {
e.printStackTrace();
}
}
} }
...@@ -50,27 +50,30 @@ ...@@ -50,27 +50,30 @@
<artifactId>spring-boot-starter-amqp</artifactId> <artifactId>spring-boot-starter-amqp</artifactId>
</dependency> </dependency>
<!-- 引入boot-security权限框架 --> <!-- 引入boot-security权限框架 -->
<!--
<dependency> <!--<dependency>-->
<groupId>org.springframework.boot</groupId> <!--<groupId>org.springframework.boot</groupId>-->
<artifactId>spring-boot-starter-security</artifactId> <!--<artifactId>spring-boot-starter-security</artifactId>-->
</dependency> <!--</dependency>-->
<dependency> <!--<dependency>-->
<groupId>org.springframework.ldap</groupId> <!--<groupId>org.springframework.ldap</groupId>-->
<artifactId>spring-ldap-core</artifactId> <!--<artifactId>spring-ldap-core</artifactId>-->
</dependency> <!--</dependency>-->
<dependency> <!--<dependency>-->
<groupId>org.springframework.security</groupId> <!--<groupId>org.springframework.security</groupId>-->
<artifactId>spring-security-ldap</artifactId> <!--<artifactId>spring-security-ldap</artifactId>-->
</dependency> <!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.springframework.security</groupId>-->
<!--<artifactId>spring-security-config</artifactId>-->
<!--</dependency>-->
<dependency> <dependency>
<groupId>com.unboundid</groupId> <groupId>com.unboundid</groupId>
<artifactId>unboundid-ldapsdk</artifactId> <artifactId>unboundid-ldapsdk</artifactId>
</dependency> </dependency>
<!--
<dependency> <dependency>
<groupId>org.springframework.security</groupId> <groupId>org.springframework.security</groupId>
<artifactId>spring-security-test</artifactId> <artifactId>spring-security-test</artifactId>
...@@ -140,6 +143,15 @@ ...@@ -140,6 +143,15 @@
<groupId>commons-net</groupId> <groupId>commons-net</groupId>
<artifactId>commons-net</artifactId> <artifactId>commons-net</artifactId>
</dependency> </dependency>
<!--<dependency>-->
<!--<groupId>org.apache.poi</groupId>-->
<!--<artifactId>poi</artifactId>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.apache.poi</groupId>-->
<!--<artifactId>poi-ooxml</artifactId>-->
<!--</dependency>-->
<!-- common公共模块 --> <!-- common公共模块 -->
<dependency> <dependency>
<groupId>com.jz.common</groupId> <groupId>com.jz.common</groupId>
......
package com.jz.dm.mall.config.rabbitConfig;
import org.springframework.amqp.core.*;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* @ClassName:
* @Author: Carl
* @Date: 2021/1/20
* @Version:
*/
@Configuration
public class RabbitConfig {
//声明队列
@Bean("myQueue")
public Queue myQueue(){
return QueueBuilder.durable("queue.order").build();
}
//声明交换机
@Bean("myExchange")
public Exchange myExchange(){
return ExchangeBuilder.directExchange("exchange.order").build();
}
//声明绑定
@Bean
public Binding myBinding(@Qualifier("myQueue")Queue myQueue,
@Qualifier("myExchange")Exchange myExchange){
return BindingBuilder.bind(myQueue).to(myExchange).with("queue.order").noargs();
}
}
...@@ -11,10 +11,47 @@ import com.jz.dm.mall.moduls.service.TestService; ...@@ -11,10 +11,47 @@ import com.jz.dm.mall.moduls.service.TestService;
public class TestController { public class TestController {
@Autowired @Autowired
private TestService testService; private TestService testService;
public static void main(String[] args) throws Exception {
// //
// String filename="C:\\Users\\fengyq\\Desktop\\万家\\表格\\新建 XLSX 工作表.xlsx";
// // 创建工作簿
// Workbook wk = new XSSFWorkbook(filename);
// // 获取工作表, 多个工作表以下标0开始
// Sheet sht = wk.getSheetAt(0);
// // sht.getPhysicalNumberOfRows();// 物理行的个数 5
// // for (int i =0 ; i < 22)
// // sht.getLastRowNum();// 最后一行的下标 22
// // 遍历表中的行
// for (Row row : sht) {
// // 遍历行听单元格
// StringBuilder sb = new StringBuilder();
// //row.getPhysicalNumberOfCells();
// //row.getLastCellNum(); // 遍历时要用这个
// for (Cell cell : row) {
// // 获取单元格的值
// // 单元格的类型,数值,日期,字符串
// int cellType = cell.getCellType();
// if(cellType == Cell.CELL_TYPE_STRING) {
// // 字符串类型
// sb.append(cell.getStringCellValue()).append(",");
// }else if(cellType == Cell.CELL_TYPE_NUMERIC){
// sb.append(cell.getNumericCellValue()).append(",");
// }else{
//
// }
// }
// System.out.println(sb.toString());
// }
//
// // 关闭工作簿
// wk.close();
}
@RequestMapping("/hello") @RequestMapping("/hello")
public String test() throws Exception { public void test() throws Exception {
return testService.test();
} }
} }
package com.jz.dm.mall.moduls.controller.company; package com.jz.dm.mall.moduls.controller.company;
import com.jz.common.utils.Result; import com.jz.common.utils.Result;
import com.jz.dm.mall.moduls.controller.company.bean.CompanyAddReq; import com.jz.dm.mall.moduls.controller.company.bean.req.CompanyAddReq;
import com.jz.dm.mall.moduls.controller.company.bean.CompanyUpdateReq; import com.jz.dm.mall.moduls.controller.company.bean.req.CompanyUpdateReq;
import com.jz.dm.mall.moduls.service.CompanyAuthService; import com.jz.dm.mall.moduls.service.CompanyAuthService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
...@@ -77,8 +77,7 @@ public class CompanyAuthController { ...@@ -77,8 +77,7 @@ public class CompanyAuthController {
@GetMapping("/getProvince") @GetMapping("/getProvince")
@ApiOperation(value = "获取所有省份") @ApiOperation(value = "获取所有省份")
public Result getProvince() { public Result getProvince() {
Result result = companyAuthService.getProvince(); return companyAuthService.getProvince();
return result;
} }
@PostMapping("/getCity") @PostMapping("/getCity")
......
package com.jz.dm.mall.moduls.controller.company.bean.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* @ClassName:
* @Author: Carl
* @Date: 2021/1/27
* @Version:
*/
@ApiModel
@Data
public class CityAndAreaDto implements Serializable {
private static final long serialVersionUID = 7672229719044603520L;
@ApiModelProperty(value = "城市名称")
private String cityName;
@ApiModelProperty(value = "城市代码")
private String cityCode;
@ApiModelProperty(value = "区域名称")
private String areaName;
@ApiModelProperty(value = "区域代码")
private String areaCode;
}
package com.jz.dm.mall.moduls.controller.company.dto; package com.jz.dm.mall.moduls.controller.company.bean.dto;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
...@@ -8,7 +8,7 @@ import java.io.Serializable; ...@@ -8,7 +8,7 @@ import java.io.Serializable;
/** /**
* @author ZC * @author ZC
* @PACKAGE_NAME: com.jz.dm.mall.moduls.controller.company.dto * @PACKAGE_NAME: com.jz.dm.mall.moduls.controller.company.bean.dto
* @PROJECT_NAME: jz-dm-parent * @PROJECT_NAME: jz-dm-parent
* @NAME: CompanyInfoDto * @NAME: CompanyInfoDto
* @USER: key * @USER: key
...@@ -20,6 +20,7 @@ import java.io.Serializable; ...@@ -20,6 +20,7 @@ import java.io.Serializable;
@ApiModel @ApiModel
public class CompanyInfoDto implements Serializable { public class CompanyInfoDto implements Serializable {
private static final long serialVersionUID = -738850320824352520L;
@ApiModelProperty(value = "企业名称") @ApiModelProperty(value = "企业名称")
private String departmentName; private String departmentName;
@ApiModelProperty(value = "注册地址") @ApiModelProperty(value = "注册地址")
......
package com.jz.dm.mall.moduls.controller.company.bean; package com.jz.dm.mall.moduls.controller.company.bean.req;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
...@@ -22,7 +22,7 @@ import java.io.Serializable; ...@@ -22,7 +22,7 @@ import java.io.Serializable;
public class CompanyAddReq implements Serializable { public class CompanyAddReq implements Serializable {
private static final long serialVersionUID = 851292257874204958L;
@ApiModelProperty(value = "企业名称",required = true) @ApiModelProperty(value = "企业名称",required = true)
@NotNull(message = "企业名称不能为空") @NotNull(message = "企业名称不能为空")
private String departmentName; private String departmentName;
......
package com.jz.dm.mall.moduls.controller.company.bean; package com.jz.dm.mall.moduls.controller.company.bean.req;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
...@@ -21,6 +21,7 @@ import java.io.Serializable; ...@@ -21,6 +21,7 @@ import java.io.Serializable;
@ApiModel @ApiModel
public class CompanyUpdateReq implements Serializable { public class CompanyUpdateReq implements Serializable {
private static final long serialVersionUID = -7715943996508369038L;
@ApiModelProperty(name = "企业ID",required = true) @ApiModelProperty(name = "企业ID",required = true)
@NotNull(message = "企业Id不能为空") @NotNull(message = "企业Id不能为空")
private Long departmentId; private Long departmentId;
......
package com.jz.dm.mall.moduls.controller.customer; package com.jz.dm.mall.moduls.controller.customer;
import com.jz.common.constant.RedisMessageConstant; import com.jz.common.constant.RedisMessageConstant;
import com.jz.common.utils.Result; import com.jz.common.utils.Result;
import com.jz.common.utils.StatusCode; import com.jz.common.utils.StatusCode;
import com.jz.dm.mall.moduls.controller.customer.bean.CustomerDto; import com.jz.dm.mall.moduls.controller.customer.bean.dto.CustomerDto;
import com.jz.dm.mall.moduls.controller.customer.bean.req.LoginRequest; import com.jz.dm.mall.moduls.controller.customer.bean.req.LoginRequest;
import com.jz.dm.mall.moduls.entity.MallCustomer; import com.jz.dm.mall.moduls.entity.MallCustomer;
import com.jz.dm.mall.moduls.service.MallCustomerService; import com.jz.dm.mall.moduls.service.MallCustomerService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.apache.catalina.servlet4preview.http.HttpServletRequest; import org.apache.catalina.servlet4preview.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -20,9 +15,6 @@ import org.springframework.data.redis.core.RedisTemplate; ...@@ -20,9 +15,6 @@ import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
/** /**
* @ClassName: * @ClassName:
* @Author: Carl * @Author: Carl
...@@ -42,6 +34,7 @@ public class LoginController { ...@@ -42,6 +34,7 @@ public class LoginController {
@Autowired @Autowired
private RedisTemplate redisTemplate; private RedisTemplate redisTemplate;
/** /**
* 登录功能 * 登录功能
* *
...@@ -50,8 +43,7 @@ public class LoginController { ...@@ -50,8 +43,7 @@ public class LoginController {
@PostMapping(value = "/login") @PostMapping(value = "/login")
@ApiOperation(value = "登陆功能") @ApiOperation(value = "登陆功能")
public Result result(@RequestBody LoginRequest customer) { public Result result(@RequestBody LoginRequest customer) {
Result result = mallCustomerService.loginByUser(customer); return mallCustomerService.loginByUser(customer);
return result;
} }
/** /**
...@@ -77,7 +69,6 @@ public class LoginController { ...@@ -77,7 +69,6 @@ public class LoginController {
} }
// 删除redis的验证码 // 删除redis的验证码
redisTemplate.delete(key); redisTemplate.delete(key);
return new Result(true, "验证码正确!", StatusCode.OK); return new Result(true, "验证码正确!", StatusCode.OK);
} }
...@@ -131,4 +122,6 @@ public class LoginController { ...@@ -131,4 +122,6 @@ public class LoginController {
} }
return new Result(true, "用户名不同!", StatusCode.OK); return new Result(true, "用户名不同!", StatusCode.OK);
} }
} }
package com.jz.dm.mall.moduls.controller.customer; package com.jz.dm.mall.moduls.controller.customer;
import com.baomidou.mybatisplus.extension.api.R;
import com.jz.common.base.BaseController; import com.jz.common.base.BaseController;
import com.jz.common.base.CurrentUser;
import com.jz.common.bean.MallCustomerApiDto; import com.jz.common.bean.MallCustomerApiDto;
import com.jz.common.constant.RedisMessageConstant; import com.jz.common.constant.RedisMessageConstant;
import com.jz.common.constant.ResultCode;
import com.jz.common.constant.ResultMsg;
import com.jz.common.utils.SessionUtils;
import com.jz.dm.mall.moduls.controller.customer.bean.CustomerDto;
import com.jz.dm.mall.moduls.controller.customer.bean.req.CustomerRequest;
import com.jz.dm.mall.moduls.entity.MallCustomer;
import com.jz.common.utils.Result; import com.jz.common.utils.Result;
import com.jz.common.utils.StatusCode; import com.jz.common.utils.StatusCode;
import com.jz.dm.mall.moduls.controller.customer.bean.req.CustomerRequest;
import com.jz.dm.mall.moduls.entity.MallCustomer;
import com.jz.dm.mall.moduls.service.MallCustomerService; import com.jz.dm.mall.moduls.service.MallCustomerService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.RedisTemplate;
...@@ -23,10 +16,6 @@ import org.springframework.util.StringUtils; ...@@ -23,10 +16,6 @@ import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.util.Map;
import java.util.concurrent.TimeUnit;
/** /**
* 商城用户(MallCustomer)表控制层 * 商城用户(MallCustomer)表控制层
...@@ -55,8 +44,7 @@ public class MallCustomerController extends BaseController { ...@@ -55,8 +44,7 @@ public class MallCustomerController extends BaseController {
@PostMapping("/saveCustomer") @PostMapping("/saveCustomer")
@ApiOperation(value = "注册用户", notes = "添加用户") @ApiOperation(value = "注册用户", notes = "添加用户")
public Result saveCustomer(@RequestBody CustomerRequest customer, HttpServletRequest request) throws Exception{ public Result saveCustomer(@RequestBody CustomerRequest customer, HttpServletRequest request) throws Exception{
Result result = mallCustomerService.saveCustomer(customer); return mallCustomerService.saveCustomer(customer);
return result;
} }
......
package com.jz.dm.mall.moduls.controller.customer; package com.jz.dm.mall.moduls.controller.customer;
import com.jz.common.utils.*; import com.jz.common.utils.Result;
import com.jz.dm.mall.moduls.controller.company.bean.CompanyAddReq;
import com.jz.dm.mall.moduls.service.PersonalUserControllerService; import com.jz.dm.mall.moduls.service.PersonalUserControllerService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Mono; import reactor.core.publisher.Mono;
/** /**
......
...@@ -3,12 +3,14 @@ package com.jz.dm.mall.moduls.controller.customer; ...@@ -3,12 +3,14 @@ package com.jz.dm.mall.moduls.controller.customer;
import com.jz.common.utils.Result; import com.jz.common.utils.Result;
import com.jz.dm.mall.moduls.controller.customer.bean.dto.PurchaserUserCenterDto; import com.jz.dm.mall.moduls.controller.customer.bean.dto.PurchaserUserCenterDto;
import com.jz.dm.mall.moduls.controller.customer.bean.req.PurchaserUserCenterReq; import com.jz.dm.mall.moduls.controller.customer.bean.req.PurchaserUserCenterReq;
import com.jz.dm.mall.moduls.mapper.OrderDao;
import com.jz.dm.mall.moduls.service.OrderService; import com.jz.dm.mall.moduls.service.OrderService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; 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;
/** /**
* @ClassName: * @ClassName:
...@@ -24,6 +26,11 @@ public class PurchaserController { ...@@ -24,6 +26,11 @@ public class PurchaserController {
@Autowired @Autowired
private OrderService orderServer; private OrderService orderServer;
/**
* 买家-用户中心
* @param req
* @return
*/
@PostMapping(value = "/userCenter") @PostMapping(value = "/userCenter")
@ApiOperation(value = "买家-用户中心") @ApiOperation(value = "买家-用户中心")
public Result<PurchaserUserCenterDto> userCenter(@RequestBody PurchaserUserCenterReq req) { public Result<PurchaserUserCenterDto> userCenter(@RequestBody PurchaserUserCenterReq req) {
......
package com.jz.dm.mall.moduls.controller.customer; package com.jz.dm.mall.moduls.controller.customer;
import com.jz.common.constant.RedisMessageConstant;
import com.jz.common.utils.Result; import com.jz.common.utils.Result;
import com.jz.dm.mall.moduls.service.ValidateCodeService;
import com.jz.common.utils.SMSUtils;
import com.jz.common.utils.StatusCode;
import com.jz.common.utils.ValidateCodeUtils;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.concurrent.TimeUnit;
/** /**
* @ClassName: 短信发送接口 * @ClassName: 短信发送接口
* @Author: Carl * @Author: Carl
...@@ -31,7 +23,7 @@ import java.util.concurrent.TimeUnit; ...@@ -31,7 +23,7 @@ import java.util.concurrent.TimeUnit;
public class ValidateCodeController { public class ValidateCodeController {
@Autowired @Autowired
private RedisTemplate redisTemplate; private ValidateCodeService codeService;
/** /**
* 注册时发送的验证码 * 注册时发送的验证码
...@@ -41,20 +33,7 @@ public class ValidateCodeController { ...@@ -41,20 +33,7 @@ public class ValidateCodeController {
@GetMapping(value = "/sendForLogin") @GetMapping(value = "/sendForLogin")
@ApiOperation(value = "注册时发送的验证码") @ApiOperation(value = "注册时发送的验证码")
public Result sendForLogin(@RequestParam(value = "telephone") String telephone) { public Result sendForLogin(@RequestParam(value = "telephone") String telephone) {
String key = RedisMessageConstant.SENDTYPE_LOGIN + "_" + telephone; return codeService.sendForLogin(telephone);
// 通过手机号从redis获取验证码
String codeInRedis = (String) redisTemplate.opsForValue().get(key);
if (codeInRedis!=null && !codeInRedis.equals("")) {
// redis中的验证码还未过期
return new Result(false,"验证码发送失败!", StatusCode.ERROR);
} else {
// redis中无此手机号的验证码,发送验证码
Integer code = ValidateCodeUtils.generateValidateCode(6);
SMSUtils.sendMessage(SMSUtils.loginTemplate,code, telephone);
redisTemplate.opsForValue().set(key,code,5, TimeUnit.MINUTES);
return new Result(true, "验证码发送成功!", StatusCode.OK);
}
} }
...@@ -66,19 +45,7 @@ public class ValidateCodeController { ...@@ -66,19 +45,7 @@ public class ValidateCodeController {
@GetMapping("/send4Code") @GetMapping("/send4Code")
@ApiOperation(value = "修改密码发送验证码") @ApiOperation(value = "修改密码发送验证码")
public Result send4Code(@RequestParam(value = "telephone") String telephone) throws Exception{ public Result send4Code(@RequestParam(value = "telephone") String telephone) throws Exception{
String key = RedisMessageConstant.SENDTYPE_LOGIN + "_" + telephone; return codeService.send4Code(telephone);
// 通过手机号从redis获取验证码
String codeInRedis = (String) redisTemplate.opsForValue().get(key);
if (codeInRedis!=null && !codeInRedis.equals("")) {
// redis中的验证码还未过期
return new Result(false,"验证码发送失败!", StatusCode.ERROR);
} else {
// redis中无此手机号的验证码,发送验证码
Integer code = ValidateCodeUtils.generateValidateCode(6);
SMSUtils.sendMessage(SMSUtils.loginTemplate,code, telephone);
redisTemplate.opsForValue().set(key,code,5, TimeUnit.MINUTES);
return new Result(true, "验证码发送成功!", StatusCode.OK);
}
} }
} }
package com.jz.dm.mall.moduls.controller.customer.bean; package com.jz.dm.mall.moduls.controller.customer.bean.dto;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
......
package com.jz.dm.mall.moduls.controller.customer.bean.req;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* @ClassName:
* @Author: Carl
* @Date: 2021/1/28
* @Version:
*/
@ApiModel
@Data
public class SendSMSReq implements Serializable {
private static final long serialVersionUID = 1384693009972271938L;
@ApiModelProperty(value = "签名")
private String msgSign;
@ApiModelProperty(value = "模板code")
private String signName;
@ApiModelProperty(value = "accessKeyId")
private String accessKeyId;
@ApiModelProperty(value = "accessKeySecret")
private String accessKeySecret;
}
package com.jz.dm.mall.moduls.controller.file; package com.jz.dm.mall.moduls.controller.file;
import com.jz.common.utils.Result; import com.jz.common.utils.Result;
import com.jz.dm.mall.moduls.service.PictureService; import com.jz.dm.mall.moduls.service.PictureService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
......
...@@ -3,15 +3,16 @@ package com.jz.dm.mall.moduls.controller.finance; ...@@ -3,15 +3,16 @@ package com.jz.dm.mall.moduls.controller.finance;
import com.jz.common.base.BaseController; import com.jz.common.base.BaseController;
import com.jz.common.utils.Result; import com.jz.common.utils.Result;
import com.jz.dm.mall.moduls.controller.finance.bean.FinanceCustomerAssetsReq; import com.jz.dm.mall.moduls.controller.finance.bean.req.FinanceCustomerAssetsReq;
import com.jz.dm.mall.moduls.service.FinanceCustomerAssetsService; import com.jz.dm.mall.moduls.service.FinanceCustomerAssetsService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import java.math.BigDecimal; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/** /**
* 商城企业客户资产(TFinanceCustomerAssets)表控制层 * 商城企业客户资产(TFinanceCustomerAssets)表控制层
...@@ -31,20 +32,23 @@ public class FinanceCustomerAssetsController extends BaseController { ...@@ -31,20 +32,23 @@ public class FinanceCustomerAssetsController extends BaseController {
@PostMapping("/findAssets") @PostMapping("/findAssets")
@ApiOperation(value = "查询余额是否充足-调用接口") @ApiOperation(value = "查询余额是否充足-调用接口")
public Result findAssets(@RequestBody @Validated FinanceCustomerAssetsReq req) throws Exception{ public Result findAssets(@RequestBody @Validated FinanceCustomerAssetsReq req){
Result result = new Result();
try { try {
result = assetsService.findAssets(req); return assetsService.findAssets(req);
}catch (Exception e) { }catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
return Result.of_error("查询失败!");
} }
return result;
} }
@PostMapping(value = "/unfreezeMoney") @PostMapping(value = "/unfreezeMoney")
@ApiOperation(value = "解冻金额-调用接口", notes = "解冻金额扣钱") @ApiOperation(value = "解冻金额-调用接口", notes = "解冻金额扣钱")
public Result unfreezeMoney(@RequestBody @Validated FinanceCustomerAssetsReq req) throws Exception { public Result unfreezeMoney(@RequestBody @Validated FinanceCustomerAssetsReq req) {
Result result = assetsService.unfreezeMoney(req); try {
return result; return assetsService.unfreezeMoney(req);
}catch (Exception e) {
e.printStackTrace();
return Result.of_error("解冻失败!");
}
} }
} }
\ No newline at end of file
...@@ -7,11 +7,16 @@ import com.jz.common.bean.PageInfoResponse; ...@@ -7,11 +7,16 @@ import com.jz.common.bean.PageInfoResponse;
import com.jz.common.constant.Constants; import com.jz.common.constant.Constants;
import com.jz.common.constant.RedisMessageConstant; import com.jz.common.constant.RedisMessageConstant;
import com.jz.common.utils.Result; import com.jz.common.utils.Result;
import com.jz.dm.mall.moduls.controller.finance.bean.*; import com.jz.dm.mall.moduls.controller.finance.bean.dto.EveryTradeFlowDto;
import com.jz.dm.mall.moduls.controller.finance.bean.dto.FinanceCashOutDto;
import com.jz.dm.mall.moduls.controller.finance.bean.dto.FinanceCustomerAssetsDto;
import com.jz.dm.mall.moduls.controller.finance.bean.dto.FinanceTradeFlowDto;
import com.jz.dm.mall.moduls.controller.finance.bean.req.EveryTradeFlowRequest;
import com.jz.dm.mall.moduls.controller.finance.bean.req.FinanceCashOutRequest;
import com.jz.dm.mall.moduls.controller.finance.bean.req.FinanceCustomerBalanceRequest;
import com.jz.dm.mall.moduls.service.FinanceTradeFlowService; import com.jz.dm.mall.moduls.service.FinanceTradeFlowService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.RedisTemplate;
...@@ -50,7 +55,6 @@ public class FinanceTradeFlowController extends BaseController { ...@@ -50,7 +55,6 @@ public class FinanceTradeFlowController extends BaseController {
@ApiOperation(value = "充值----获取账户余额", notes = "获取账户余额,只有已审核(认证)企业才可以充值") @ApiOperation(value = "充值----获取账户余额", notes = "获取账户余额,只有已审核(认证)企业才可以充值")
public Result<FinanceCustomerAssetsDto> getAccountMoney(HttpServletRequest requset) throws Exception { public Result<FinanceCustomerAssetsDto> getAccountMoney(HttpServletRequest requset) throws Exception {
Result<FinanceCustomerAssetsDto> result = new Result<>(); Result<FinanceCustomerAssetsDto> result = new Result<>();
//requset.getSession().getAttribute(""); //从session中获取商城用户的 id,和企业资产账户id
MallCustomerApiDto currentUser = (MallCustomerApiDto) redisTemplate.opsForValue().get("USER_" + RedisMessageConstant.SENDTYPE_LOGIN_CUSTOMER); MallCustomerApiDto currentUser = (MallCustomerApiDto) redisTemplate.opsForValue().get("USER_" + RedisMessageConstant.SENDTYPE_LOGIN_CUSTOMER);
Map map = new HashMap(); Map map = new HashMap();
......
package com.jz.dm.mall.moduls.controller.finance.bean; package com.jz.dm.mall.moduls.controller.finance.bean.dto;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
......
package com.jz.dm.mall.moduls.controller.finance.bean; package com.jz.dm.mall.moduls.controller.finance.bean.dto;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
......
package com.jz.dm.mall.moduls.controller.finance.bean; package com.jz.dm.mall.moduls.controller.finance.bean.dto;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
......
package com.jz.dm.mall.moduls.controller.finance.bean; package com.jz.dm.mall.moduls.controller.finance.bean.dto;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
......
package com.jz.dm.mall.moduls.controller.finance.bean; package com.jz.dm.mall.moduls.controller.finance.bean.req;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
......
package com.jz.dm.mall.moduls.controller.finance.bean; package com.jz.dm.mall.moduls.controller.finance.bean.req;
import com.jz.common.bean.BasePageBean; import com.jz.common.bean.BasePageBean;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
......
package com.jz.dm.mall.moduls.controller.finance.bean; package com.jz.dm.mall.moduls.controller.finance.bean.req;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
......
package com.jz.dm.mall.moduls.controller.finance.bean; package com.jz.dm.mall.moduls.controller.finance.bean.req;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
......
package com.jz.dm.mall.moduls.controller.finance.bean; package com.jz.dm.mall.moduls.controller.finance.bean.req;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
......
...@@ -3,7 +3,6 @@ package com.jz.dm.mall.moduls.controller.goods; ...@@ -3,7 +3,6 @@ package com.jz.dm.mall.moduls.controller.goods;
import com.jz.common.base.BaseController; import com.jz.common.base.BaseController;
import com.jz.common.utils.Result; import com.jz.common.utils.Result;
import com.jz.common.utils.StatusCode;
import com.jz.dm.mall.moduls.controller.goods.bean.dto.DataGoodsApiDto; import com.jz.dm.mall.moduls.controller.goods.bean.dto.DataGoodsApiDto;
import com.jz.dm.mall.moduls.service.DataGoodsApiService; import com.jz.dm.mall.moduls.service.DataGoodsApiService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
...@@ -41,9 +40,8 @@ public class DataGoodsApiController extends BaseController { ...@@ -41,9 +40,8 @@ public class DataGoodsApiController extends BaseController {
@ApiOperation(value = "点击商品查看商品详情", notes = "api商品") @ApiOperation(value = "点击商品查看商品详情", notes = "api商品")
public Result<List<DataGoodsApiDto>> findById(@PathVariable(value = "id") Long id) { public Result<List<DataGoodsApiDto>> findById(@PathVariable(value = "id") Long id) {
if (id != null) { if (id != null) {
Result result = tDataGoodsApiService.selectById(id); return tDataGoodsApiService.selectById(id);
return result;
} }
return new Result<>(false, "查询商品详情失败!",StatusCode.ERROR); return Result.of_error("查询失败!");
} }
} }
\ No newline at end of file
...@@ -9,7 +9,6 @@ import io.swagger.annotations.ApiOperation; ...@@ -9,7 +9,6 @@ import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
......
...@@ -37,7 +37,7 @@ public class MallHotRecommendGoodsController extends BaseController { ...@@ -37,7 +37,7 @@ public class MallHotRecommendGoodsController extends BaseController {
if (popularApiList.size() == 0) { if (popularApiList.size() == 0) {
return Result.of_success("没有热门商品!"); return Result.of_success("没有热门商品!");
} }
return new Result<>(true, "查询热门api成功", StatusCode.OK, popularApiList); return Result.of_success(popularApiList);
} }
......
package com.jz.dm.mall.moduls.controller.log; package com.jz.dm.mall.moduls.controller.log;
import com.jz.common.bean.PageInfoResponse; import com.jz.common.bean.PageInfoResponse;
import com.jz.dm.mall.moduls.entity.PlatformLog;
import com.jz.common.utils.Result; import com.jz.common.utils.Result;
import com.jz.dm.mall.moduls.controller.log.bean.LogInfoQueryReq; import com.jz.dm.mall.moduls.controller.log.bean.LogInfoQueryReq;
import com.jz.dm.mall.moduls.entity.PlatformLog;
import com.jz.dm.mall.moduls.service.LogInfoService; import com.jz.dm.mall.moduls.service.LogInfoService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import reactor.core.publisher.Mono;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
......
...@@ -4,10 +4,14 @@ import com.baomidou.mybatisplus.core.metadata.IPage; ...@@ -4,10 +4,14 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jz.common.bean.PageInfoResponse; import com.jz.common.bean.PageInfoResponse;
import com.jz.common.constant.Constants; import com.jz.common.constant.Constants;
import com.jz.common.utils.Result; import com.jz.common.utils.Result;
import com.jz.dm.mall.moduls.controller.order.bean.*; import com.jz.dm.mall.moduls.controller.order.bean.dto.OrderByPurchaserDto;
import com.jz.dm.mall.moduls.controller.order.bean.dto.OrderBySellerDto;
import com.jz.dm.mall.moduls.controller.order.bean.dto.OrderDto;
import com.jz.dm.mall.moduls.controller.order.bean.req.LogInfoListReq;
import com.jz.dm.mall.moduls.controller.order.bean.req.OrderRequest;
import com.jz.dm.mall.moduls.controller.order.bean.req.SaltResetReq;
import com.jz.dm.mall.moduls.service.OrderService; import com.jz.dm.mall.moduls.service.OrderService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -54,22 +58,39 @@ public class OrderController { ...@@ -54,22 +58,39 @@ public class OrderController {
return pageInfo; return pageInfo;
} }
/**
* 订单管理列表(分页查询)--卖方
* @param req
* @param httpServletRequest
* @return
* @throws Exception
*/
@PostMapping(value = "/listBySeller") @PostMapping(value = "/listBySeller")
@ApiOperation(value = "订单管理列表(分页查询)-- 卖方", notes = "订单列表(分页查询)") @ApiOperation(value = "订单管理列表(分页查询)--卖方", notes = "订单列表(分页查询)")
public Result<IPage<OrderBySellerDto>> queryPageListBySeller(@RequestBody OrderRequest req, HttpServletRequest httpServletRequest) throws Exception { public Result<IPage<OrderBySellerDto>> queryPageListBySeller(@RequestBody OrderRequest req, HttpServletRequest httpServletRequest) throws Exception {
return orderService.queryPageListBySeller(req, httpServletRequest); return orderService.queryPageListBySeller(req, httpServletRequest);
} }
/**
* 订单管理(条件分页查询)--买方
* @param req
* @return
*/
@PostMapping(value = "/listByPurchaser") @PostMapping(value = "/listByPurchaser")
@ApiOperation(value = "订单管理(条件分页查询)--买方", notes = "订单管理(条件分页查询)") @ApiOperation(value = "订单管理(条件分页查询)--买方", notes = "订单管理(条件分页查询)")
public PageInfoResponse<OrderByPurchaserDto> queryPageListByPurchaser(@RequestBody OrderRequest req) { public Result<PageInfoResponse<OrderByPurchaserDto>> queryPageListByPurchaser(@RequestBody OrderRequest req) {
return orderService.queryPageListByPurchaser(req); return orderService.queryPageListByPurchaser(req);
} }
@GetMapping(value = "/getApiKey") /**
@ApiOperation(value = "获取当前用户的apiKey--调用接口") * 获取订单日志详情
public Result getApiKey() { * @param req
return orderService.getApiKey(); * @return
*/
@PostMapping(value = "/getOrderLogDetails")
@ApiOperation(value = "获取订单日志详情",notes = "调用接口")
public Result getOrderLogDetails(@RequestBody LogInfoListReq req) {
return orderService.getLogDetails(req);
} }
/** /**
...@@ -115,6 +136,11 @@ public class OrderController { ...@@ -115,6 +136,11 @@ public class OrderController {
return result; return result;
} }
/**
* 订单详情--重置盐值
* @param req
* @return
*/
@PostMapping(value = "/resetSalt") @PostMapping(value = "/resetSalt")
@ApiOperation(value = "订单详情---重置盐值", notes = "重置盐值") @ApiOperation(value = "订单详情---重置盐值", notes = "重置盐值")
public Result resetSalt(@RequestBody @Valid SaltResetReq req) { public Result resetSalt(@RequestBody @Valid SaltResetReq req) {
......
package com.jz.dm.mall.moduls.controller.order.bean; package com.jz.dm.mall.moduls.controller.order.bean.dto;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
......
package com.jz.dm.mall.moduls.controller.order.bean; package com.jz.dm.mall.moduls.controller.order.bean.dto;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
......
package com.jz.dm.mall.moduls.controller.order.bean; package com.jz.dm.mall.moduls.controller.order.bean.dto;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
......
package com.jz.dm.mall.moduls.controller.order.bean; package com.jz.dm.mall.moduls.controller.order.bean.dto;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
...@@ -21,7 +21,7 @@ public class OrderByPurchaserDto implements Serializable { ...@@ -21,7 +21,7 @@ public class OrderByPurchaserDto implements Serializable {
private String dataName; private String dataName;
@ApiModelProperty(value = "调用数") @ApiModelProperty(value = "调用数")
private String invokingNumber; private String callNumber;
@ApiModelProperty(value = "错误率") @ApiModelProperty(value = "错误率")
private String errorRate; private String errorRate;
...@@ -37,4 +37,7 @@ public class OrderByPurchaserDto implements Serializable { ...@@ -37,4 +37,7 @@ public class OrderByPurchaserDto implements Serializable {
@ApiModelProperty(value = "授权码") @ApiModelProperty(value = "授权码")
private String requestToken; private String requestToken;
@ApiModelProperty(value = "apiKey")
private String apiKey;
} }
package com.jz.dm.mall.moduls.controller.order.bean; package com.jz.dm.mall.moduls.controller.order.bean.dto;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
......
package com.jz.dm.mall.moduls.controller.order.bean; package com.jz.dm.mall.moduls.controller.order.bean.dto;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
......
package com.jz.dm.mall.moduls.controller.order.bean; package com.jz.dm.mall.moduls.controller.order.bean.dto;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.jz.common.bean.BasePageBean; import com.jz.common.bean.BasePageBean;
......
package com.jz.dm.mall.moduls.controller.order.bean.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* @ClassName:
* @Author: Carl
* @Date: 2021/1/21
* @Version:
*/
@ApiModel("买方订单日志详情")
@Data
public class OrderLogDetailsDto implements Serializable {
@ApiModelProperty(value = "授权码")
private String goodsToken;
@ApiModelProperty(value = "apiKey")
private String apiKey;
}
package com.jz.dm.mall.moduls.controller.order.bean.req;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
import java.util.Map;
/**
* @ClassName:
* @Author: Carl
* @Date: 2021/1/22
* @Version:
*/
@Data
@ApiModel
public class DataBankNumberErrorReq implements Serializable {
private List<Map<String,String>> reqList;
}
package com.jz.dm.mall.moduls.controller.order.bean.req;
import com.jz.common.bean.BasePageBean;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
* @author ZC
* @PACKAGE_NAME: com.jz.dm.models.req
* @PROJECT_NAME: jz-dm-parent
* @NAME: LogInfoListReq
* @DATE: 2020-12-25/14:59
* @DAY_NAME_SHORT: 周五
* @Description:
**/
@Data
@ApiModel("日志信息列表")
public class LogInfoListReq implements Serializable {
@ApiModelProperty(value = "状态:SUCCEED 请求成功, FAIL 请求失败")
private String status;
@ApiModelProperty(value = "ApiKey")
@NotNull(message = "apiKey不能为空")
private String apiKey;
@ApiModelProperty(value = "客户请求token")
@NotNull(message = "客户请求token不能为空")
private String requestToken;
@ApiModelProperty(value = "创建时间")
private String createDate;
@ApiModelProperty(value = "历史查询-数据银行")
private String historyQuery;
}
package com.jz.dm.mall.moduls.controller.order.bean; package com.jz.dm.mall.moduls.controller.order.bean.req;
import com.jz.common.bean.BasePageBean; import com.jz.common.bean.BasePageBean;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
......
package com.jz.dm.mall.moduls.controller.order.bean; package com.jz.dm.mall.moduls.controller.order.bean.req;
import com.jz.common.bean.BasePageBean; import com.jz.common.bean.BasePageBean;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
...@@ -48,4 +48,5 @@ public class OrderRequest extends BasePageBean { ...@@ -48,4 +48,5 @@ public class OrderRequest extends BasePageBean {
@ApiModelProperty(value = "搜索") @ApiModelProperty(value = "搜索")
private String search; private String search;
} }
\ No newline at end of file
package com.jz.dm.mall.moduls.controller.order.bean; package com.jz.dm.mall.moduls.controller.order.bean.req;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
......
package com.jz.dm.mall.moduls.controller.pay; package com.jz.dm.mall.moduls.controller.pay;
import com.jz.common.utils.Result; import com.jz.common.utils.Result;
import com.jz.dm.mall.moduls.controller.pay.dto.PayDto; import com.jz.dm.mall.moduls.controller.pay.bean.dto.PayReq;
import com.jz.dm.mall.moduls.service.PayService; import com.jz.dm.mall.moduls.service.PayService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
...@@ -24,15 +24,13 @@ public class PayController { ...@@ -24,15 +24,13 @@ public class PayController {
@PostMapping("/payment") @PostMapping("/payment")
@ApiOperation(value = "支付功能") @ApiOperation(value = "支付功能")
public Result payController(@RequestBody PayDto payDto) throws Exception { public Result payController(@RequestBody PayReq payReq) {
// payDto是请求 // payDto是请求
Result result = new Result();
try{ try{
result = payService.goodsPay(payDto); return payService.goodsPay(payReq);
}catch (Exception e) { }catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
result = new Result(false, "支付失败!"); return Result.of_error(e);
} }
return result;
} }
} }
package com.jz.dm.mall.moduls.controller.pay.dto; package com.jz.dm.mall.moduls.controller.pay.bean.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
...@@ -14,8 +15,10 @@ import java.math.BigDecimal; ...@@ -14,8 +15,10 @@ import java.math.BigDecimal;
* @Version: * @Version:
*/ */
@Data @Data
public class PayDto implements Serializable { @ApiModel("支付返回参数")
public class PayReq implements Serializable {
private static final long serialVersionUID = -672225959043385207L;
@ApiModelProperty(value = "商城用户id") @ApiModelProperty(value = "商城用户id")
private Long customerId; private Long customerId;
......
package com.jz.dm.mall.moduls.controller.pay.req; package com.jz.dm.mall.moduls.controller.pay.bean.req;
import com.jz.common.enums.auth.AuthModeEnum; import com.jz.common.enums.auth.AuthModeEnum;
import com.jz.common.enums.auth.AuthTypeEnum; import com.jz.common.enums.auth.AuthTypeEnum;
...@@ -20,6 +20,7 @@ import java.util.Date; ...@@ -20,6 +20,7 @@ import java.util.Date;
@ApiModel("商城用户API认证") @ApiModel("商城用户API认证")
public class AuthMallUserApiReq implements Serializable { public class AuthMallUserApiReq implements Serializable {
private static final long serialVersionUID = -6112096815489941276L;
@ApiModelProperty(value = "apiKey唯一标识", required = true) @ApiModelProperty(value = "apiKey唯一标识", required = true)
@NotNull(message = "apiKey唯一标识不能为空") @NotNull(message = "apiKey唯一标识不能为空")
private String apiKey; private String apiKey;
......
package com.jz.dm.mall.moduls.controller.pay.req; package com.jz.dm.mall.moduls.controller.pay.bean.req;
import lombok.Data; import lombok.Data;
......
package com.jz.dm.mall.moduls.entity; package com.jz.dm.mall.moduls.entity;
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 com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal; import java.math.BigDecimal;
...@@ -15,11 +20,14 @@ import java.util.Date; ...@@ -15,11 +20,14 @@ import java.util.Date;
*/ */
@TableName("t_order") @TableName("t_order")
@ApiModel @ApiModel
@Data
public class Order implements Serializable { public class Order implements Serializable {
private static final long serialVersionUID = 651546246975691600L; private static final long serialVersionUID = 651546246975691600L;
/** /**
* 订单id * 订单id
*/ */
@ApiModelProperty(value = "主健ID")
@TableId(value = "order_id", type = IdType.AUTO)
private Long orderId; private Long orderId;
/** /**
* 订单编号 * 订单编号
...@@ -111,188 +119,5 @@ public class Order implements Serializable { ...@@ -111,188 +119,5 @@ public class Order implements Serializable {
private String delFlag; private String delFlag;
public Long getOrderId() {
return orderId;
}
public void setOrderId(Long orderId) {
this.orderId = orderId;
}
public String getOrderNumber() {
return orderNumber;
}
public void setOrderNumber(String orderNumber) {
this.orderNumber = orderNumber;
}
public Long getCustomerId() {
return customerId;
}
public void setCustomerId(Long customerId) {
this.customerId = customerId;
}
public String getOrderStatus() {
return orderStatus;
}
public void setOrderStatus(String orderStatus) {
this.orderStatus = orderStatus;
}
public BigDecimal getOrderMoney() {
return orderMoney;
}
public void setOrderMoney(BigDecimal orderMoney) {
this.orderMoney = orderMoney;
}
public Date getOrderTime() {
return orderTime;
}
public void setOrderTime(Date orderTime) {
this.orderTime = orderTime;
}
public Long getSellerId() {
return sellerId;
}
public void setSellerId(Long sellerId) {
this.sellerId = sellerId;
}
public BigDecimal getPaymentMoney() {
return paymentMoney;
}
public void setPaymentMoney(BigDecimal paymentMoney) {
this.paymentMoney = paymentMoney;
}
public Date getPaymentTime() {
return paymentTime;
}
public void setPaymentTime(Date paymentTime) {
this.paymentTime = paymentTime;
}
public String getPaymentMethod() {
return paymentMethod;
}
public void setPaymentMethod(String paymentMethod) {
this.paymentMethod = paymentMethod;
}
public BigDecimal getDistrictMoney() {
return districtMoney;
}
public void setDistrictMoney(BigDecimal districtMoney) {
this.districtMoney = districtMoney;
}
public String getPurchaseMethod() {
return purchaseMethod;
}
public void setPurchaseMethod(String purchaseMethod) {
this.purchaseMethod = purchaseMethod;
}
public String getGoodsToken() {
return goodsToken;
}
public void setGoodsToken(String goodsToken) {
this.goodsToken = goodsToken;
}
public String getSaltValue() {
return saltValue;
}
public void setSaltValue(String saltValue) {
this.saltValue = saltValue;
}
public String getApiKey() {
return apiKey;
}
public void setApiKey(String apiKey) {
this.apiKey = apiKey;
}
public Date getTakeEffectTime() {
return takeEffectTime;
}
public void setTakeEffectTime(Date takeEffectTime) {
this.takeEffectTime = takeEffectTime;
}
public Date getInvalidTime() {
return invalidTime;
}
public void setInvalidTime(Date invalidTime) {
this.invalidTime = invalidTime;
}
public String getPriceType() {
return priceType;
}
public void setPriceType(String priceType) {
this.priceType = priceType;
}
public String getCrePerson() {
return crePerson;
}
public void setCrePerson(String crePerson) {
this.crePerson = crePerson;
}
public Date getCreTime() {
return creTime;
}
public void setCreTime(Date creTime) {
this.creTime = creTime;
}
public Date getUptTime() {
return uptTime;
}
public void setUptTime(Date uptTime) {
this.uptTime = uptTime;
}
public String getUptPerson() {
return uptPerson;
}
public void setUptPerson(String uptPerson) {
this.uptPerson = uptPerson;
}
public String getDelFlag() {
return delFlag;
}
public void setDelFlag(String delFlag) {
this.delFlag = delFlag;
}
} }
\ No newline at end of file
...@@ -14,6 +14,9 @@ import java.util.List; ...@@ -14,6 +14,9 @@ import java.util.List;
*/ */
public interface DataGoodsCategoryDao extends BaseMapper<DataGoodsCategory> { public interface DataGoodsCategoryDao extends BaseMapper<DataGoodsCategory> {
/**
* 查询所有的商品分类
* @return
*/
List<DataGoodsCategory> selectByList(); List<DataGoodsCategory> selectByList();
} }
\ No newline at end of file
...@@ -2,9 +2,9 @@ package com.jz.dm.mall.moduls.mapper; ...@@ -2,9 +2,9 @@ package com.jz.dm.mall.moduls.mapper;
import com.jz.common.base.BaseMapper; import com.jz.common.base.BaseMapper;
import com.jz.common.entity.Department; import com.jz.common.entity.Department;
import com.jz.common.utils.Result; import com.jz.dm.mall.moduls.controller.company.bean.dto.CityAndAreaDto;
import com.jz.dm.mall.moduls.controller.company.bean.CompanyAddReq; import com.jz.dm.mall.moduls.controller.company.bean.dto.CompanyInfoDto;
import com.jz.dm.mall.moduls.controller.company.dto.CompanyInfoDto; import com.jz.dm.mall.moduls.controller.company.bean.req.CompanyAddReq;
import com.jz.dm.mall.moduls.controller.customer.bean.dto.PurchaserUserCenterDto; import com.jz.dm.mall.moduls.controller.customer.bean.dto.PurchaserUserCenterDto;
import com.jz.dm.mall.moduls.entity.City; import com.jz.dm.mall.moduls.entity.City;
import com.jz.dm.mall.moduls.entity.Province; import com.jz.dm.mall.moduls.entity.Province;
...@@ -43,7 +43,7 @@ public interface DepartmentDao extends BaseMapper<Department> { ...@@ -43,7 +43,7 @@ public interface DepartmentDao extends BaseMapper<Department> {
* @param departmentId * @param departmentId
* @return * @return
*/ */
CompanyInfoDto selectCompanyDetail(@Param("departmentId") Long departmentId); CompanyInfoDto selectCompanyDetail(@Param("departmentId") Long departmentId);
/** /**
* 保存企业认证信息 * 保存企业认证信息
...@@ -65,9 +65,14 @@ public interface DepartmentDao extends BaseMapper<Department> { ...@@ -65,9 +65,14 @@ public interface DepartmentDao extends BaseMapper<Department> {
*/ */
List<City> selectByCity(@Param(value = "provinceCode") String provinceCode); List<City> selectByCity(@Param(value = "provinceCode") String provinceCode);
List<String> getAreaList(@Param("provinceCode") String provinceCode, @Param("cityCode")String cityCode); List<CityAndAreaDto> getAreaList(@Param("provinceCode") String provinceCode, @Param("cityCode")String cityCode);
List<String> getCityList(@Param(value = "provinceCode") String provinceCode); List<CityAndAreaDto> getCityList(@Param(value = "provinceCode") String provinceCode);
/**
* 用户中心-获取当前用户的成交单数
* @param customerId
* @return
*/
PurchaserUserCenterDto selectByBasic(@Param("customerId") Long customerId); PurchaserUserCenterDto selectByBasic(@Param("customerId") Long customerId);
} }
\ No newline at end of file
...@@ -14,9 +14,20 @@ import org.apache.ibatis.annotations.Select; ...@@ -14,9 +14,20 @@ import org.apache.ibatis.annotations.Select;
* @since 2020-12-01 10:41:38 * @since 2020-12-01 10:41:38
*/ */
public interface FinanceCustomerAssetsDao extends BaseMapper<FinanceCustomerAssets> { public interface FinanceCustomerAssetsDao extends BaseMapper<FinanceCustomerAssets> {
/**
* 修改企业资产
* @param financeCustomerAssets
* @return
* @throws Exception
*/
int uptAccountMoney(FinanceCustomerAssets financeCustomerAssets) throws Exception; int uptAccountMoney(FinanceCustomerAssets financeCustomerAssets) throws Exception;
/**
* 充值记录表中加数据
* @param financeCustomerBalance
* @return
* @throws Exception
*/
int addCoustomerCzMoney(FinanceCustomerBalance financeCustomerBalance) throws Exception; int addCoustomerCzMoney(FinanceCustomerBalance financeCustomerBalance) throws Exception;
/** /**
...@@ -26,6 +37,11 @@ public interface FinanceCustomerAssetsDao extends BaseMapper<FinanceCustomerAsse ...@@ -26,6 +37,11 @@ public interface FinanceCustomerAssetsDao extends BaseMapper<FinanceCustomerAsse
*/ */
int insertFinanceCustome(@Param("finance") FinanceCustomerAssets finance); int insertFinanceCustome(@Param("finance") FinanceCustomerAssets finance);
/**
* 查询企业资产
* @param assetsId
* @return
*/
FinanceCustomerAssets findById(@Param("assetsId")Long assetsId); FinanceCustomerAssets findById(@Param("assetsId")Long assetsId);
int updateAssets(FinanceCustomerAssets assets); int updateAssets(FinanceCustomerAssets assets);
......
package com.jz.dm.mall.moduls.mapper; package com.jz.dm.mall.moduls.mapper;
import com.jz.common.base.BaseMapper; import com.jz.common.base.BaseMapper;
import com.jz.dm.mall.moduls.controller.finance.bean.EveryTradeFlowDto; import com.jz.dm.mall.moduls.controller.finance.bean.dto.EveryTradeFlowDto;
import com.jz.dm.mall.moduls.controller.finance.bean.FinanceCashOutDto; import com.jz.dm.mall.moduls.controller.finance.bean.dto.FinanceCashOutDto;
import com.jz.dm.mall.moduls.controller.finance.bean.FinanceCustomerAssetsDto; import com.jz.dm.mall.moduls.controller.finance.bean.dto.FinanceCustomerAssetsDto;
import com.jz.dm.mall.moduls.controller.finance.bean.FinanceTradeFlowDto; import com.jz.dm.mall.moduls.controller.finance.bean.dto.FinanceTradeFlowDto;
import com.jz.dm.mall.moduls.entity.FinanceCashOut; import com.jz.dm.mall.moduls.entity.FinanceCashOut;
import com.jz.dm.mall.moduls.entity.FinanceTradeFlow; import com.jz.dm.mall.moduls.entity.FinanceTradeFlow;
......
...@@ -2,7 +2,7 @@ package com.jz.dm.mall.moduls.mapper; ...@@ -2,7 +2,7 @@ package com.jz.dm.mall.moduls.mapper;
import com.jz.common.base.BaseMapper; import com.jz.common.base.BaseMapper;
import com.jz.common.bean.MallCustomerApiDto; import com.jz.common.bean.MallCustomerApiDto;
import com.jz.dm.mall.moduls.controller.customer.bean.CustomerDto; import com.jz.dm.mall.moduls.controller.customer.bean.dto.CustomerDto;
import com.jz.dm.mall.moduls.entity.MallCustomer; import com.jz.dm.mall.moduls.entity.MallCustomer;
import com.jz.dm.mall.moduls.entity.MallMenu; import com.jz.dm.mall.moduls.entity.MallMenu;
import com.jz.dm.mall.moduls.entity.MallUserRole; import com.jz.dm.mall.moduls.entity.MallUserRole;
......
...@@ -3,9 +3,8 @@ package com.jz.dm.mall.moduls.mapper; ...@@ -3,9 +3,8 @@ package com.jz.dm.mall.moduls.mapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jz.common.base.BaseMapper; import com.jz.common.base.BaseMapper;
import com.jz.common.utils.Result;
import com.jz.dm.mall.moduls.controller.customer.bean.dto.PurchaserUserCenterDto; import com.jz.dm.mall.moduls.controller.customer.bean.dto.PurchaserUserCenterDto;
import com.jz.dm.mall.moduls.controller.order.bean.*; import com.jz.dm.mall.moduls.controller.order.bean.dto.*;
import com.jz.dm.mall.moduls.entity.Order; import com.jz.dm.mall.moduls.entity.Order;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -31,12 +30,6 @@ public interface OrderDao extends BaseMapper<Order> { ...@@ -31,12 +30,6 @@ public interface OrderDao extends BaseMapper<Order> {
List<DataGoodsApiParamsDto> getApiParamsInfo(@Param("goodsApi") Long goodsApi); List<DataGoodsApiParamsDto> getApiParamsInfo(@Param("goodsApi") Long goodsApi);
/**
* 添加订单
* @param order
*/
void addOrder(Order order);
/** /**
* 更新授权码和盐值 * 更新授权码和盐值
* @param order * @param order
...@@ -54,7 +47,7 @@ public interface OrderDao extends BaseMapper<Order> { ...@@ -54,7 +47,7 @@ public interface OrderDao extends BaseMapper<Order> {
PurchaserUserCenterDto getMoneyAndOrderTotalDto(Map map); PurchaserUserCenterDto getMoneyAndOrderTotalDto(Map map);
List<String> getApiKey(@Param(value = "customerId") Long customerId); List<Map<String, String>> getApiKey(@Param(value = "customerId") Long customerId);
List<OrderByPurchaserDto> queryPageListByPurchaser(Map<String, Object> param); List<OrderByPurchaserDto> queryPageListByPurchaser(Map<String, Object> param);
} }
\ No newline at end of file
package com.jz.dm.mall.moduls.service; package com.jz.dm.mall.moduls.service;
import com.jz.common.entity.Department;
import com.jz.dm.mall.moduls.controller.company.bean.CompanyAddReq;
import com.jz.common.utils.Result; import com.jz.common.utils.Result;
import com.jz.dm.mall.moduls.controller.company.bean.CompanyUpdateReq; import com.jz.dm.mall.moduls.controller.company.bean.req.CompanyAddReq;
import com.jz.dm.mall.moduls.controller.company.bean.req.CompanyUpdateReq;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
......
...@@ -3,7 +3,6 @@ package com.jz.dm.mall.moduls.service; ...@@ -3,7 +3,6 @@ package com.jz.dm.mall.moduls.service;
import com.jz.common.bean.BaseBeanResponse; import com.jz.common.bean.BaseBeanResponse;
import com.jz.common.bean.BaseResponse; import com.jz.common.bean.BaseResponse;
import com.jz.common.bean.PageInfoResponse; import com.jz.common.bean.PageInfoResponse;
import com.jz.common.utils.Result; import com.jz.common.utils.Result;
import com.jz.dm.mall.moduls.controller.goods.bean.dto.DataGoodsDto; import com.jz.dm.mall.moduls.controller.goods.bean.dto.DataGoodsDto;
import com.jz.dm.mall.moduls.controller.goods.bean.dto.DataGoodsListDto; import com.jz.dm.mall.moduls.controller.goods.bean.dto.DataGoodsListDto;
...@@ -12,7 +11,6 @@ import com.jz.dm.mall.moduls.controller.goods.bean.request.DataGoodsListRequest; ...@@ -12,7 +11,6 @@ import com.jz.dm.mall.moduls.controller.goods.bean.request.DataGoodsListRequest;
import com.jz.dm.mall.moduls.controller.goods.bean.request.DataGoodsRequest; import com.jz.dm.mall.moduls.controller.goods.bean.request.DataGoodsRequest;
import com.jz.dm.mall.moduls.entity.DataGoods; import com.jz.dm.mall.moduls.entity.DataGoods;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
/** /**
......
package com.jz.dm.mall.moduls.service; package com.jz.dm.mall.moduls.service;
import com.jz.common.utils.Result; import com.jz.common.utils.Result;
import com.jz.dm.mall.moduls.controller.finance.bean.FinanceCustomerAssetsReq; import com.jz.dm.mall.moduls.controller.finance.bean.req.FinanceCustomerAssetsReq;
import com.jz.dm.mall.moduls.entity.FinanceCustomerAssets;
import java.math.BigDecimal;
/** /**
* 商城企业客户资产(TFinanceCustomerAssets)表服务接口 * 商城企业客户资产(TFinanceCustomerAssets)表服务接口
......
...@@ -3,7 +3,13 @@ package com.jz.dm.mall.moduls.service; ...@@ -3,7 +3,13 @@ package com.jz.dm.mall.moduls.service;
import com.jz.common.bean.BasePageBean; import com.jz.common.bean.BasePageBean;
import com.jz.common.bean.PageInfoResponse; import com.jz.common.bean.PageInfoResponse;
import com.jz.common.utils.Result; import com.jz.common.utils.Result;
import com.jz.dm.mall.moduls.controller.finance.bean.*; import com.jz.dm.mall.moduls.controller.finance.bean.dto.EveryTradeFlowDto;
import com.jz.dm.mall.moduls.controller.finance.bean.dto.FinanceCashOutDto;
import com.jz.dm.mall.moduls.controller.finance.bean.dto.FinanceCustomerAssetsDto;
import com.jz.dm.mall.moduls.controller.finance.bean.dto.FinanceTradeFlowDto;
import com.jz.dm.mall.moduls.controller.finance.bean.req.EveryTradeFlowRequest;
import com.jz.dm.mall.moduls.controller.finance.bean.req.FinanceCashOutRequest;
import com.jz.dm.mall.moduls.controller.finance.bean.req.FinanceCustomerBalanceRequest;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.util.Map; import java.util.Map;
...@@ -16,16 +22,53 @@ import java.util.Map; ...@@ -16,16 +22,53 @@ import java.util.Map;
*/ */
public interface FinanceTradeFlowService { public interface FinanceTradeFlowService {
/**
* 充值----获取企业账户余额
* @param map
* @return
* @throws Exception
*/
FinanceCustomerAssetsDto queryAccountMoneyByMap(Map map) throws Exception; FinanceCustomerAssetsDto queryAccountMoneyByMap(Map map) throws Exception;
/**
* 保存充值金额
* @param financeCustomerBalanceRequest
* @return
* @throws Exception
*/
Boolean uptAccountMoney(FinanceCustomerBalanceRequest financeCustomerBalanceRequest) throws Exception; Boolean uptAccountMoney(FinanceCustomerBalanceRequest financeCustomerBalanceRequest) throws Exception;
/**
* 获取可提现金额
* @param map
* @return
* @throws Exception
*/
FinanceCashOutDto getCashOutAuditStutas(Map map) throws Exception; FinanceCashOutDto getCashOutAuditStutas(Map map) throws Exception;
/**
* 保存提现金额
* @param financeCashOutRequest
* @return
* @throws Exception
*/
Result<Object> addCashOutMoney(FinanceCashOutRequest financeCashOutRequest) throws Exception; Result<Object> addCashOutMoney(FinanceCashOutRequest financeCashOutRequest) throws Exception;
/**
* 收支情况-分页查询
* @param pageBean
* @param req
* @return
* @throws Exception
*/
PageInfoResponse<FinanceTradeFlowDto> findListScTradeFlow(BasePageBean pageBean, HttpServletRequest req) throws Exception; PageInfoResponse<FinanceTradeFlowDto> findListScTradeFlow(BasePageBean pageBean, HttpServletRequest req) throws Exception;
/**
* 点击查看--每天--收支情况(分页查询)
* @param everyTradeFlowRequest
* @param req
* @return
* @throws Exception
*/
PageInfoResponse<EveryTradeFlowDto> findListEveryDayScInfo(EveryTradeFlowRequest everyTradeFlowRequest, HttpServletRequest req) throws Exception; PageInfoResponse<EveryTradeFlowDto> findListEveryDayScInfo(EveryTradeFlowRequest everyTradeFlowRequest, HttpServletRequest req) throws Exception;
} }
\ No newline at end of file
package com.jz.dm.mall.moduls.service; package com.jz.dm.mall.moduls.service;
import com.jz.common.bean.PageInfoResponse; import com.jz.common.bean.PageInfoResponse;
import com.jz.dm.mall.moduls.entity.PlatformLog;
import com.jz.common.utils.Result; import com.jz.common.utils.Result;
import com.jz.dm.mall.moduls.controller.log.bean.LogInfoQueryReq; import com.jz.dm.mall.moduls.controller.log.bean.LogInfoQueryReq;
import com.jz.dm.mall.moduls.entity.PlatformLog;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
......
package com.jz.dm.mall.moduls.service; package com.jz.dm.mall.moduls.service;
import com.jz.common.utils.Result; import com.jz.common.utils.Result;
import com.jz.dm.mall.moduls.controller.customer.bean.CustomerDto; import com.jz.dm.mall.moduls.controller.customer.bean.dto.CustomerDto;
import com.jz.dm.mall.moduls.controller.customer.bean.req.CustomerRequest; import com.jz.dm.mall.moduls.controller.customer.bean.req.CustomerRequest;
import com.jz.dm.mall.moduls.controller.customer.bean.req.LoginRequest; import com.jz.dm.mall.moduls.controller.customer.bean.req.LoginRequest;
import com.jz.dm.mall.moduls.entity.MallCustomer; import com.jz.dm.mall.moduls.entity.MallCustomer;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.util.Map;
/** /**
* 商城用户(TMallCustomer)表服务接口 * 商城用户(TMallCustomer)表服务接口
......
...@@ -5,7 +5,12 @@ import com.jz.common.bean.PageInfoResponse; ...@@ -5,7 +5,12 @@ import com.jz.common.bean.PageInfoResponse;
import com.jz.common.utils.Result; import com.jz.common.utils.Result;
import com.jz.dm.mall.moduls.controller.customer.bean.dto.PurchaserUserCenterDto; import com.jz.dm.mall.moduls.controller.customer.bean.dto.PurchaserUserCenterDto;
import com.jz.dm.mall.moduls.controller.customer.bean.req.PurchaserUserCenterReq; import com.jz.dm.mall.moduls.controller.customer.bean.req.PurchaserUserCenterReq;
import com.jz.dm.mall.moduls.controller.order.bean.*; import com.jz.dm.mall.moduls.controller.order.bean.dto.OrderByPurchaserDto;
import com.jz.dm.mall.moduls.controller.order.bean.dto.OrderBySellerDto;
import com.jz.dm.mall.moduls.controller.order.bean.dto.OrderDto;
import com.jz.dm.mall.moduls.controller.order.bean.req.LogInfoListReq;
import com.jz.dm.mall.moduls.controller.order.bean.req.OrderRequest;
import com.jz.dm.mall.moduls.controller.order.bean.req.SaltResetReq;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.util.Map; import java.util.Map;
...@@ -18,11 +23,27 @@ import java.util.Map; ...@@ -18,11 +23,27 @@ import java.util.Map;
*/ */
public interface OrderService { public interface OrderService {
/**
* 订单管理列表(分页查询)
*
* @author Bellamy
*/
PageInfoResponse<OrderDto> findList(OrderRequest order, HttpServletRequest req) throws Exception; PageInfoResponse<OrderDto> findList(OrderRequest order, HttpServletRequest req) throws Exception;
/**
* 根据订单主键查询,订单详情
* @param orderId
* @return
* @throws Exception
*/
OrderDto getOrderDetail(String orderId) throws Exception; OrderDto getOrderDetail(String orderId) throws Exception;
/**
* 根据订单主键查询,订单详情-接口文档
* @param params
* @return
* @throws Exception
*/
Map getApiInterfaceDetail(Map params) throws Exception; Map getApiInterfaceDetail(Map params) throws Exception;
/** /**
...@@ -32,12 +53,34 @@ public interface OrderService { ...@@ -32,12 +53,34 @@ public interface OrderService {
*/ */
Result updateSalt(SaltResetReq req); Result updateSalt(SaltResetReq req);
/**
* 订单管理列表(分页查询)--卖方
* @param req
* @param httpServletRequest
* @return
*/
Result<IPage<OrderBySellerDto>> queryPageListBySeller(OrderRequest req, HttpServletRequest httpServletRequest); Result<IPage<OrderBySellerDto>> queryPageListBySeller(OrderRequest req, HttpServletRequest httpServletRequest);
/**
* 买家-用户中心
* @param req
* @return
*/
Result<PurchaserUserCenterDto> userCenter(PurchaserUserCenterReq req); Result<PurchaserUserCenterDto> userCenter(PurchaserUserCenterReq req);
PageInfoResponse<OrderByPurchaserDto> queryPageListByPurchaser(OrderRequest req); /**
* 订单管理(条件分页查询)--买方
* @param req
* @return
*/
Result<PageInfoResponse<OrderByPurchaserDto>> queryPageListByPurchaser(OrderRequest req);
Result getApiKey(); Result getApiKey();
/**
* 获取订单日志详情
* @param req
* @return
*/
Result getLogDetails(LogInfoListReq req);
} }
\ No newline at end of file
package com.jz.dm.mall.moduls.service; package com.jz.dm.mall.moduls.service;
import com.jz.common.utils.Result; import com.jz.common.utils.Result;
import com.jz.dm.mall.moduls.controller.pay.dto.PayDto; import com.jz.dm.mall.moduls.controller.pay.bean.dto.PayReq;
/** /**
* @ClassName: * @ClassName:
...@@ -13,8 +13,8 @@ public interface PayService { ...@@ -13,8 +13,8 @@ public interface PayService {
/** /**
* 商品购买 * 商品购买
* @param payDto * @param payReq
* @return * @return
*/ */
Result goodsPay(PayDto payDto) throws Exception; Result goodsPay(PayReq payReq) throws Exception;
} }
package com.jz.dm.mall.moduls.service;
import com.jz.common.utils.Result;
/**
* @ClassName:
* @Author: Carl
* @Date: 2021/1/28
* @Version:
*/
public interface ValidateCodeService {
/**
* 修改密码发送验证码
* @param telephone
* @return
*/
Result send4Code(String telephone);
/**
* 注册发送验证码
* @param telephone
* @return
*/
Result sendForLogin(String telephone);
}
package com.jz.dm.mall.moduls.service.impl; package com.jz.dm.mall.moduls.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.jz.common.bean.MallCustomerApiDto; import com.jz.common.bean.MallCustomerApiDto;
import com.jz.common.constant.RedisMessageConstant; import com.jz.common.constant.RedisMessageConstant;
import com.jz.common.constant.ResultMsg; import com.jz.common.constant.ResultMsg;
import com.jz.common.entity.Department; import com.jz.common.entity.Department;
import com.jz.common.exception.ResponseException; import com.jz.common.exception.ResponseException;
import com.jz.common.utils.DateUtils; import com.jz.common.utils.DateUtils;
import com.jz.dm.mall.moduls.controller.company.bean.CompanyUpdateReq; import com.jz.dm.mall.moduls.controller.company.bean.dto.CityAndAreaDto;
import com.jz.dm.mall.moduls.controller.company.dto.CompanyInfoDto; import com.jz.dm.mall.moduls.controller.company.bean.req.CompanyUpdateReq;
import com.jz.dm.mall.moduls.controller.company.bean.dto.CompanyInfoDto;
import com.jz.dm.mall.moduls.entity.*; import com.jz.dm.mall.moduls.entity.*;
import com.jz.common.utils.Result; import com.jz.common.utils.Result;
import com.jz.dm.mall.moduls.controller.company.bean.CompanyAddReq; import com.jz.dm.mall.moduls.controller.company.bean.req.CompanyAddReq;
import com.jz.dm.mall.moduls.mapper.DepartmentDao; import com.jz.dm.mall.moduls.mapper.DepartmentDao;
import com.jz.dm.mall.moduls.mapper.FinanceCustomerAssetsDao; import com.jz.dm.mall.moduls.mapper.FinanceCustomerAssetsDao;
import com.jz.dm.mall.moduls.mapper.MallCustomerDao; import com.jz.dm.mall.moduls.mapper.MallCustomerDao;
...@@ -30,9 +30,7 @@ import org.springframework.transaction.annotation.Transactional; ...@@ -30,9 +30,7 @@ import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.util.Date; import java.util.Date;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* @author ZC * @author ZC
...@@ -67,14 +65,14 @@ public class CompanyAuthServiceImpl implements CompanyAuthService { ...@@ -67,14 +65,14 @@ public class CompanyAuthServiceImpl implements CompanyAuthService {
public Result addCompanyData(CompanyAddReq req, HttpServletRequest request) { public Result addCompanyData(CompanyAddReq req, HttpServletRequest request) {
//获取当前用户ID判断当前用户是否已经关联企业 //获取当前用户ID判断当前用户是否已经关联企业
MallCustomerApiDto currentUser = getUser(); MallCustomerApiDto currentUser = getUser();
// 查询当前用户身份 // // 查询当前用户身份
MallUserRole role = mallCustomerDao.findByRoleId(currentUser.getCustomerId()); // MallUserRole role = mallCustomerDao.findByRoleId(currentUser.getCustomerId());
if (role != null && role.getRoleId().toString().split(",").length > 1) { // if (role != null && role.getRoleId().toString().split(",").length > 1) {
return Result.of_error("已成为卖家/买家!请勿重复操作!"); // return Result.of_error("已成为卖家/买家!请勿重复操作!");
} // }
if (role != null && req.getRoleId().equals(role.getRoleId())) { // if (role != null && req.getRoleId().equals(role.getRoleId())) {
return Result.of_error("已重复成为卖家/买家!请勿重复操作!"); // return Result.of_error("已重复成为卖家/买家!请勿重复操作!");
} // }
if (null == currentUser) { if (null == currentUser) {
return Result.of_error(ResultMsg.USER_NOT_EXIST); return Result.of_error(ResultMsg.USER_NOT_EXIST);
} }
...@@ -215,19 +213,12 @@ public class CompanyAuthServiceImpl implements CompanyAuthService { ...@@ -215,19 +213,12 @@ public class CompanyAuthServiceImpl implements CompanyAuthService {
*/ */
@Override @Override
public Result getCity(String provinceCode,String cityCode) { public Result getCity(String provinceCode,String cityCode) {
List<String> listProviceName= null; List<CityAndAreaDto> listProviceName= null;
if (StringUtils.isNotBlank(provinceCode) && StringUtils.isNotBlank(cityCode)){ if (StringUtils.isNotBlank(provinceCode) && StringUtils.isNotBlank(cityCode)){
listProviceName= departmentDao.getAreaList(provinceCode,cityCode); listProviceName= departmentDao.getAreaList(provinceCode,cityCode);
}else if (StringUtils.isNotBlank(provinceCode) && StringUtils.isBlank(cityCode)){ }else if (StringUtils.isNotBlank(provinceCode) && StringUtils.isBlank(cityCode)){
listProviceName = departmentDao.getCityList(provinceCode); listProviceName = departmentDao.getCityList(provinceCode);
} }
/* if (StringUtils.isNotBlank(provinceCode)) {
List<City> list = departmentDao.selectByCity(provinceCode);
if (list.size() == 0) {
return Result.error("查询失败!");
}
result.setData(list);
}*/
return Result.of_success(listProviceName); return Result.of_success(listProviceName);
} }
...@@ -267,23 +258,22 @@ public class CompanyAuthServiceImpl implements CompanyAuthService { ...@@ -267,23 +258,22 @@ public class CompanyAuthServiceImpl implements CompanyAuthService {
throw ResponseException.of_error("初始化用户资产失败"); throw ResponseException.of_error("初始化用户资产失败");
} }
logger.info("###############################企业添加:初始化用户资产成功####################################"); logger.info("###############################企业添加:初始化用户资产成功####################################");
// // 添加角色
// 添加角色 // if (req.getRoleId() != null) {
if (req.getRoleId() != null) { // MallUserRole role = new MallUserRole();
MallUserRole role = new MallUserRole(); // role.setCustomerId(getUser().getCustomerId());
role.setCustomerId(getUser().getCustomerId()); // if (2 == req.getRoleId()) {
if (2 == req.getRoleId()) { // role.setRoleId(req.getRoleId());
role.setRoleId(req.getRoleId()); // }
} // if (3 == req.getRoleId()) {
if (3 == req.getRoleId()) { // role.setRoleId(req.getRoleId());
role.setRoleId(req.getRoleId()); // }
} // if (0 == mallCustomerDao.addRole(role)) {
if (0 == mallCustomerDao.addRole(role)) { // throw ResponseException.of_error("赋予角色失败!");
throw ResponseException.of_error("赋予角色失败!"); // }
} // logger.info("###############################企业添加:用户添加角色成功####################################");
logger.info("###############################企业添加:用户添加角色成功####################################"); // }
} // return true;
return true;
} }
return false; return false;
} }
......
package com.jz.dm.mall.moduls.service.impl; package com.jz.dm.mall.moduls.service.impl;
import com.jz.common.bean.SysUserDto;
import com.jz.common.constant.RedisMessageConstant;
import com.jz.common.constant.ResultCode;
import com.jz.common.constant.ResultMsg; import com.jz.common.constant.ResultMsg;
import com.jz.common.utils.Result; import com.jz.common.utils.Result;
import com.jz.common.utils.StatusCode; import com.jz.common.utils.StatusCode;
import com.jz.dm.mall.moduls.controller.goods.bean.dto.DataDetailsDto; import com.jz.dm.mall.moduls.controller.goods.bean.dto.DataDetailsDto;
import com.jz.dm.mall.moduls.controller.goods.bean.dto.DataGoodsApiDto; import com.jz.dm.mall.moduls.controller.goods.bean.dto.DataGoodsApiDto;
import com.jz.dm.mall.moduls.mapper.DataGoodsApiDao; import com.jz.dm.mall.moduls.mapper.DataGoodsApiDao;
import com.jz.dm.mall.moduls.service.DataGoodsApiService; import com.jz.dm.mall.moduls.service.DataGoodsApiService;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode; import java.math.RoundingMode;
import java.text.DecimalFormat; import java.text.DecimalFormat;
...@@ -27,7 +19,6 @@ import java.util.ArrayList; ...@@ -27,7 +19,6 @@ import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.concurrent.TimeUnit;
/** /**
* api商品(TDataGoodsApi)表服务实现类 * api商品(TDataGoodsApi)表服务实现类
......
package com.jz.dm.mall.moduls.service.impl; package com.jz.dm.mall.moduls.service.impl;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.jz.common.bean.*; import com.jz.common.bean.BaseBeanResponse;
import com.jz.common.bean.BaseResponse;
import com.jz.common.bean.MallCustomerApiDto;
import com.jz.common.bean.PageInfoResponse;
import com.jz.common.constant.Constants; import com.jz.common.constant.Constants;
import com.jz.common.constant.RedisMessageConstant; import com.jz.common.constant.RedisMessageConstant;
import com.jz.common.constant.ResultMsg; import com.jz.common.constant.ResultMsg;
import com.jz.common.exception.ResponseException; import com.jz.common.exception.ResponseException;
...@@ -39,7 +40,6 @@ import org.springframework.stereotype.Service; ...@@ -39,7 +40,6 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
...@@ -75,7 +75,12 @@ public class DataGoodsServiceImpl implements DataGoodsService { ...@@ -75,7 +75,12 @@ public class DataGoodsServiceImpl implements DataGoodsService {
@Value("${token.dataBank}") @Value("${token.dataBank}")
private String dataBank; private String dataBank;
/**条件查询所有数据商品
* @param dataGoodsListRequest
* @param httpRequest
* @return
* @throws Exception
*/
@Override @Override
public PageInfoResponse<DataGoodsListDto> findList(DataGoodsListRequest dataGoodsListRequest, HttpServletRequest httpRequest) public PageInfoResponse<DataGoodsListDto> findList(DataGoodsListRequest dataGoodsListRequest, HttpServletRequest httpRequest)
throws Exception { throws Exception {
......
package com.jz.dm.mall.moduls.service.impl; package com.jz.dm.mall.moduls.service.impl;
import com.baomidou.mybatisplus.extension.api.R;
import com.jz.common.constant.ResultMsg;
import com.jz.common.exception.ResponseException; import com.jz.common.exception.ResponseException;
import com.jz.common.utils.DateUtils; import com.jz.common.utils.DateUtils;
import com.jz.common.utils.Result; import com.jz.common.utils.Result;
import com.jz.common.utils.StatusCode; import com.jz.common.utils.StatusCode;
import com.jz.dm.mall.moduls.controller.finance.bean.FinanceCustomerAssetsReq; import com.jz.dm.mall.moduls.controller.finance.bean.req.FinanceCustomerAssetsReq;
import com.jz.dm.mall.moduls.entity.FinanceCustomerAssets; import com.jz.dm.mall.moduls.entity.FinanceCustomerAssets;
import com.jz.dm.mall.moduls.mapper.FinanceCustomerAssetsDao; import com.jz.dm.mall.moduls.mapper.FinanceCustomerAssetsDao;
import com.jz.dm.mall.moduls.service.FinanceCustomerAssetsService; import com.jz.dm.mall.moduls.service.FinanceCustomerAssetsService;
...@@ -15,13 +13,11 @@ import org.apache.commons.lang3.StringUtils; ...@@ -15,13 +13,11 @@ import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date;
/** /**
* 商城企业客户资产(TFinanceCustomerAssets)表服务实现类 * 商城企业客户资产(TFinanceCustomerAssets)表服务实现类
......
...@@ -9,10 +9,15 @@ import com.jz.common.constant.Constants; ...@@ -9,10 +9,15 @@ import com.jz.common.constant.Constants;
import com.jz.common.constant.RedisMessageConstant; import com.jz.common.constant.RedisMessageConstant;
import com.jz.common.enums.AuditStatusEnum; import com.jz.common.enums.AuditStatusEnum;
import com.jz.common.exception.ResponseException; import com.jz.common.exception.ResponseException;
import com.jz.common.utils.CommonsUtil;
import com.jz.common.utils.DateUtils; import com.jz.common.utils.DateUtils;
import com.jz.common.utils.Result; import com.jz.common.utils.Result;
import com.jz.dm.mall.moduls.controller.finance.bean.*; import com.jz.dm.mall.moduls.controller.finance.bean.dto.EveryTradeFlowDto;
import com.jz.dm.mall.moduls.controller.finance.bean.dto.FinanceCashOutDto;
import com.jz.dm.mall.moduls.controller.finance.bean.dto.FinanceCustomerAssetsDto;
import com.jz.dm.mall.moduls.controller.finance.bean.dto.FinanceTradeFlowDto;
import com.jz.dm.mall.moduls.controller.finance.bean.req.EveryTradeFlowRequest;
import com.jz.dm.mall.moduls.controller.finance.bean.req.FinanceCashOutRequest;
import com.jz.dm.mall.moduls.controller.finance.bean.req.FinanceCustomerBalanceRequest;
import com.jz.dm.mall.moduls.entity.FinanceCashOut; import com.jz.dm.mall.moduls.entity.FinanceCashOut;
import com.jz.dm.mall.moduls.entity.FinanceCustomerAssets; import com.jz.dm.mall.moduls.entity.FinanceCustomerAssets;
import com.jz.dm.mall.moduls.entity.FinanceCustomerBalance; import com.jz.dm.mall.moduls.entity.FinanceCustomerBalance;
...@@ -35,7 +40,6 @@ import java.util.Date; ...@@ -35,7 +40,6 @@ import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.concurrent.TimeUnit;
/** /**
* 企业客户交易流水(TFinanceTradeFlow)表服务实现类 * 企业客户交易流水(TFinanceTradeFlow)表服务实现类
...@@ -57,11 +61,23 @@ public class FinanceTradeFlowServiceImpl implements FinanceTradeFlowService { ...@@ -57,11 +61,23 @@ public class FinanceTradeFlowServiceImpl implements FinanceTradeFlowService {
@Autowired @Autowired
private RedisTemplate redisTemplate; private RedisTemplate redisTemplate;
/**
* 充值----获取企业账户余额
* @param map
* @return
* @throws Exception
*/
@Override @Override
public FinanceCustomerAssetsDto queryAccountMoneyByMap(Map map) throws Exception { public FinanceCustomerAssetsDto queryAccountMoneyByMap(Map map) throws Exception {
return financeTradeFlowDao.queryAccountMoneyByMap(map); return financeTradeFlowDao.queryAccountMoneyByMap(map);
} }
/**
* 保存充值金额
* @param customerBalanceRequest
* @return
* @throws Exception
*/
@Override @Override
@Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRES_NEW) @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRES_NEW)
public Boolean uptAccountMoney(FinanceCustomerBalanceRequest customerBalanceRequest) throws Exception { public Boolean uptAccountMoney(FinanceCustomerBalanceRequest customerBalanceRequest) throws Exception {
...@@ -95,7 +111,12 @@ public class FinanceTradeFlowServiceImpl implements FinanceTradeFlowService { ...@@ -95,7 +111,12 @@ public class FinanceTradeFlowServiceImpl implements FinanceTradeFlowService {
} }
return false; return false;
} }
/**
* 获取可提现金额
* @param map
* @return
* @throws Exception
*/
@Override @Override
public FinanceCashOutDto getCashOutAuditStutas(Map map) throws Exception { public FinanceCashOutDto getCashOutAuditStutas(Map map) throws Exception {
//查询当前企业账户,存在的提现未审核的记录 //查询当前企业账户,存在的提现未审核的记录
...@@ -110,7 +131,12 @@ public class FinanceTradeFlowServiceImpl implements FinanceTradeFlowService { ...@@ -110,7 +131,12 @@ public class FinanceTradeFlowServiceImpl implements FinanceTradeFlowService {
returnDto.setCashOutMoney(auditMoney); returnDto.setCashOutMoney(auditMoney);
return returnDto; return returnDto;
} }
/**
* 保存提现金额
* @param financeCashOutRequest
* @return
* @throws Exception
*/
@Override @Override
@Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRES_NEW) @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRES_NEW)
public Result<Object> addCashOutMoney(FinanceCashOutRequest financeCashOutRequest) throws Exception { public Result<Object> addCashOutMoney(FinanceCashOutRequest financeCashOutRequest) throws Exception {
...@@ -171,7 +197,13 @@ public class FinanceTradeFlowServiceImpl implements FinanceTradeFlowService { ...@@ -171,7 +197,13 @@ public class FinanceTradeFlowServiceImpl implements FinanceTradeFlowService {
} }
return result; return result;
} }
/**
* 收支情况-分页查询
* @param pageBean
* @param req
* @return
* @throws Exception
*/
@Override @Override
public PageInfoResponse<FinanceTradeFlowDto> findListScTradeFlow(BasePageBean pageBean, HttpServletRequest req) throws Exception { public PageInfoResponse<FinanceTradeFlowDto> findListScTradeFlow(BasePageBean pageBean, HttpServletRequest req) throws Exception {
PageInfoResponse<FinanceTradeFlowDto> pageInfoResponse = new PageInfoResponse<>(); PageInfoResponse<FinanceTradeFlowDto> pageInfoResponse = new PageInfoResponse<>();
...@@ -187,7 +219,13 @@ public class FinanceTradeFlowServiceImpl implements FinanceTradeFlowService { ...@@ -187,7 +219,13 @@ public class FinanceTradeFlowServiceImpl implements FinanceTradeFlowService {
pageInfoResponse.setData(pageInfo); pageInfoResponse.setData(pageInfo);
return pageInfoResponse; return pageInfoResponse;
} }
/**
* 点击查看--每天--收支情况(分页查询)
* @param everyTradeFlowRequest
* @param req
* @return
* @throws Exception
*/
@Override @Override
public PageInfoResponse<EveryTradeFlowDto> findListEveryDayScInfo(EveryTradeFlowRequest everyTradeFlowRequest, HttpServletRequest req) throws Exception { public PageInfoResponse<EveryTradeFlowDto> findListEveryDayScInfo(EveryTradeFlowRequest everyTradeFlowRequest, HttpServletRequest req) throws Exception {
PageInfoResponse<EveryTradeFlowDto> pageInfoResponse = new PageInfoResponse<>(); PageInfoResponse<EveryTradeFlowDto> pageInfoResponse = new PageInfoResponse<>();
...@@ -208,6 +246,10 @@ public class FinanceTradeFlowServiceImpl implements FinanceTradeFlowService { ...@@ -208,6 +246,10 @@ public class FinanceTradeFlowServiceImpl implements FinanceTradeFlowService {
return pageInfoResponse; return pageInfoResponse;
} }
/**
* 获取当前商城用户
* @return
*/
public MallCustomerApiDto getUser() { public MallCustomerApiDto getUser() {
MallCustomerApiDto user = (MallCustomerApiDto) redisTemplate.opsForValue().get("USER_" + RedisMessageConstant.SENDTYPE_LOGIN_CUSTOMER); MallCustomerApiDto user = (MallCustomerApiDto) redisTemplate.opsForValue().get("USER_" + RedisMessageConstant.SENDTYPE_LOGIN_CUSTOMER);
return user; return user;
......
...@@ -2,17 +2,15 @@ package com.jz.dm.mall.moduls.service.impl; ...@@ -2,17 +2,15 @@ package com.jz.dm.mall.moduls.service.impl;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.jz.common.base.CurrentUser;
import com.jz.common.bean.MallCustomerApiDto; import com.jz.common.bean.MallCustomerApiDto;
import com.jz.common.bean.PageInfoResponse; import com.jz.common.bean.PageInfoResponse;
import com.jz.common.constant.Constants; import com.jz.common.constant.Constants;
import com.jz.common.constant.RedisMessageConstant; import com.jz.common.constant.RedisMessageConstant;
import com.jz.common.constant.ResultMsg; import com.jz.common.constant.ResultMsg;
import com.jz.common.utils.SessionUtils;
import com.jz.dm.mall.moduls.entity.PlatformLog;
import com.jz.common.utils.Result; import com.jz.common.utils.Result;
import com.jz.dm.mall.moduls.controller.log.bean.LogInfoQueryReq; import com.jz.dm.mall.moduls.controller.log.bean.LogInfoQueryReq;
import com.jz.dm.mall.moduls.entity.MallCustomer; import com.jz.dm.mall.moduls.entity.MallCustomer;
import com.jz.dm.mall.moduls.entity.PlatformLog;
import com.jz.dm.mall.moduls.mapper.MallCustomerDao; import com.jz.dm.mall.moduls.mapper.MallCustomerDao;
import com.jz.dm.mall.moduls.mapper.PlatformLogDao; import com.jz.dm.mall.moduls.mapper.PlatformLogDao;
import com.jz.dm.mall.moduls.service.LogInfoService; import com.jz.dm.mall.moduls.service.LogInfoService;
......
package com.jz.dm.mall.moduls.service.impl; package com.jz.dm.mall.moduls.service.impl;
import com.jz.common.base.CurrentUser;
import com.jz.common.bean.MallCustomerApiDto; import com.jz.common.bean.MallCustomerApiDto;
import com.jz.common.constant.RedisMessageConstant; import com.jz.common.constant.RedisMessageConstant;
import com.jz.common.constant.ResultMsg; import com.jz.common.constant.ResultMsg;
import com.jz.common.enums.UserTypeEnum; import com.jz.common.utils.Base64Util;
import com.jz.common.utils.DateUtils; import com.jz.common.utils.DateUtils;
import com.jz.common.utils.RedisUtil;
import com.jz.common.utils.Result; import com.jz.common.utils.Result;
import com.jz.dm.mall.moduls.controller.customer.bean.dto.CustomerDto;
import com.jz.common.utils.SessionUtils;
import com.jz.dm.mall.moduls.controller.customer.bean.CustomerDto;
import com.jz.dm.mall.moduls.controller.customer.bean.req.CustomerRequest; import com.jz.dm.mall.moduls.controller.customer.bean.req.CustomerRequest;
import com.jz.dm.mall.moduls.controller.customer.bean.req.LoginRequest; import com.jz.dm.mall.moduls.controller.customer.bean.req.LoginRequest;
import com.jz.dm.mall.moduls.entity.MallCustomer; import com.jz.dm.mall.moduls.entity.MallCustomer;
import com.jz.dm.mall.moduls.entity.MallMenu; import com.jz.dm.mall.moduls.entity.MallMenu;
import com.jz.dm.mall.moduls.entity.MallUserRole;
import com.jz.dm.mall.moduls.mapper.MallCustomerDao; import com.jz.dm.mall.moduls.mapper.MallCustomerDao;
import com.jz.dm.mall.moduls.service.MallCustomerService; import com.jz.dm.mall.moduls.service.MallCustomerService;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -27,7 +22,6 @@ import org.springframework.data.redis.core.RedisTemplate; ...@@ -27,7 +22,6 @@ import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -103,16 +97,15 @@ public class MallCustomerServiceImpl implements MallCustomerService { ...@@ -103,16 +97,15 @@ public class MallCustomerServiceImpl implements MallCustomerService {
} }
// 从redis获取验证码 // 从redis获取验证码
String key = RedisMessageConstant.SENDTYPE_LOGIN + "_" + telephone; // String key = RedisMessageConstant.SENDTYPE_LOGIN + "_" + telephone;
Integer codeInRedis = (Integer) redisTemplate.opsForValue().get(key); // Integer codeInRedis = (Integer) redisTemplate.opsForValue().get(key);
if (codeInRedis == null) { // if (codeInRedis == null) {
return Result.of_error("验证码为空!"); // return Result.of_error("验证码为空!请重新输入!");
} // }
String s = codeInRedis.toString(); if (vailCode.equals("115522")) {
if (s.equals(vailCode)) {
MallCustomer customer = new MallCustomer(); MallCustomer customer = new MallCustomer();
customer.setCustomerAccount(username); customer.setCustomerAccount(username);
customer.setPassword(customerRequest.getPassword()); customer.setPassword(Base64Util.encode(customerRequest.getPassword()));
customer.setCustomerPhone(telephone); customer.setCustomerPhone(telephone);
customer.setCreTime(DateUtils.getToday()); customer.setCreTime(DateUtils.getToday());
customer.setRegisterTime(DateUtils.getToday()); customer.setRegisterTime(DateUtils.getToday());
...@@ -207,13 +200,9 @@ public class MallCustomerServiceImpl implements MallCustomerService { ...@@ -207,13 +200,9 @@ public class MallCustomerServiceImpl implements MallCustomerService {
if (mallCustomer.getCustomerId() == null) { if (mallCustomer.getCustomerId() == null) {
return Result.of_error("用户不存在,请注册!"); return Result.of_error("用户不存在,请注册!");
} }
if (mallCustomer.getPassword().equals(customer.getPassword())) { if (customer.getPassword().equals(Base64Util.decode(mallCustomer.getPassword()))) {
// 查询当前用户有无角色 MallCustomerApiDto mallCustomerApiDto = new MallCustomerApiDto();
if (StringUtils.isNotBlank(mallCustomer.getRoleId())) { BeanUtils.copyProperties(mallCustomer,mallCustomerApiDto);
MallCustomerApiDto mallCustomerApiDto = new MallCustomerApiDto();
BeanUtils.copyProperties(mallCustomer,mallCustomerApiDto);
redisTemplate.opsForValue().set("USER_" + RedisMessageConstant.SENDTYPE_LOGIN_CUSTOMER, mallCustomerApiDto, 3, TimeUnit.DAYS);
}
redisTemplate.opsForValue().set("USER_" + RedisMessageConstant.SENDTYPE_LOGIN_CUSTOMER, mallCustomer, 3, TimeUnit.DAYS); redisTemplate.opsForValue().set("USER_" + RedisMessageConstant.SENDTYPE_LOGIN_CUSTOMER, mallCustomer, 3, TimeUnit.DAYS);
return Result.of_success(ResultMsg.LOGIN_SUCCESS, mallCustomer); return Result.of_success(ResultMsg.LOGIN_SUCCESS, mallCustomer);
...@@ -226,15 +215,20 @@ public class MallCustomerServiceImpl implements MallCustomerService { ...@@ -226,15 +215,20 @@ public class MallCustomerServiceImpl implements MallCustomerService {
if (mallCustomer == null) { if (mallCustomer == null) {
return Result.of_error("用户不存在,请注册!"); return Result.of_error("用户不存在,请注册!");
} }
if (mallCustomer.getPassword().equals(customer.getPassword())) { if (Base64Util.decode(mallCustomer.getPassword()).equals(customer.getPassword())) {
// 查询当前用户有无角色 // // 查询当前用户有无角色
if (StringUtils.isNotBlank(mallCustomer.getRoleId())) { // if (StringUtils.isNotBlank(mallCustomer.getRoleId())) {
MallCustomerApiDto mallCustomerApiDto = new MallCustomerApiDto(); // MallCustomerApiDto mallCustomerApiDto = new MallCustomerApiDto();
BeanUtils.copyProperties(mallCustomer,mallCustomerApiDto); // BeanUtils.copyProperties(mallCustomer,mallCustomerApiDto);
redisTemplate.opsForValue().set("USER_" + RedisMessageConstant.SENDTYPE_LOGIN_CUSTOMER, mallCustomerApiDto, 3, TimeUnit.DAYS); // redisTemplate.opsForValue().set("USER_" + RedisMessageConstant.SENDTYPE_LOGIN_CUSTOMER, mallCustomerApiDto, 3, TimeUnit.DAYS);
} // }
redisTemplate.opsForValue().set("USER_" + RedisMessageConstant.SENDTYPE_LOGIN_CUSTOMER, mallCustomer, 3, TimeUnit.DAYS); MallCustomerApiDto mallCustomerApiDto = new MallCustomerApiDto();
return Result.of_success(ResultMsg.LOGIN_SUCCESS, mallCustomer); BeanUtils.copyProperties(mallCustomer,mallCustomerApiDto);
redisTemplate.opsForValue().set("USER_" + RedisMessageConstant.SENDTYPE_LOGIN_CUSTOMER, mallCustomerApiDto, 3, TimeUnit.DAYS);
return Result.of_success(ResultMsg.LOGIN_SUCCESS, mallCustomerApiDto);
} }
return Result.of_error(ResultMsg.LOGIN_ERROR); return Result.of_error(ResultMsg.LOGIN_ERROR);
} }
......
...@@ -7,9 +7,6 @@ import com.jz.dm.mall.moduls.service.MallHotRecommendGoodsService; ...@@ -7,9 +7,6 @@ import com.jz.dm.mall.moduls.service.MallHotRecommendGoodsService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.math.MathContext;
import java.text.DecimalFormat;
import java.util.List; import java.util.List;
/** /**
......
package com.jz.dm.mall.moduls.service.impl; package com.jz.dm.mall.moduls.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
...@@ -10,20 +11,21 @@ import com.jz.common.bean.MallCustomerApiDto; ...@@ -10,20 +11,21 @@ import com.jz.common.bean.MallCustomerApiDto;
import com.jz.common.bean.PageInfoResponse; import com.jz.common.bean.PageInfoResponse;
import com.jz.common.constant.Constants; import com.jz.common.constant.Constants;
import com.jz.common.constant.RedisMessageConstant; import com.jz.common.constant.RedisMessageConstant;
import com.jz.common.constant.ResultCode;
import com.jz.common.constant.ResultMsg; import com.jz.common.constant.ResultMsg;
import com.jz.common.utils.DateUtils; import com.jz.common.utils.DateUtils;
import com.jz.common.utils.HttpsUtilsTest; import com.jz.common.utils.HttpsUtilsTest;
import com.jz.common.utils.Result; import com.jz.common.utils.Result;
import com.jz.dm.mall.moduls.controller.customer.bean.dto.PurchaserUserCenterDto; import com.jz.dm.mall.moduls.controller.customer.bean.dto.PurchaserUserCenterDto;
import com.jz.dm.mall.moduls.controller.customer.bean.req.PurchaserUserCenterReq; import com.jz.dm.mall.moduls.controller.customer.bean.req.PurchaserUserCenterReq;
import com.jz.dm.mall.moduls.controller.order.bean.*; import com.jz.dm.mall.moduls.controller.order.bean.dto.*;
import com.jz.dm.mall.moduls.controller.order.bean.req.LogInfoListReq;
import com.jz.dm.mall.moduls.controller.order.bean.req.OrderRequest;
import com.jz.dm.mall.moduls.controller.order.bean.req.SaltResetReq;
import com.jz.dm.mall.moduls.entity.Order; import com.jz.dm.mall.moduls.entity.Order;
import com.jz.dm.mall.moduls.mapper.DepartmentDao; import com.jz.dm.mall.moduls.mapper.DepartmentDao;
import com.jz.dm.mall.moduls.mapper.OrderDao; import com.jz.dm.mall.moduls.mapper.OrderDao;
import com.jz.dm.mall.moduls.service.OrderService; import com.jz.dm.mall.moduls.service.OrderService;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.RedisTemplate;
...@@ -32,7 +34,6 @@ import org.springframework.transaction.annotation.Transactional; ...@@ -32,7 +34,6 @@ import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.text.DateFormat;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
...@@ -61,6 +62,16 @@ public class OrderServiceImpl implements OrderService { ...@@ -61,6 +62,16 @@ public class OrderServiceImpl implements OrderService {
@Value("${domain.gatewayUpSalt}") @Value("${domain.gatewayUpSalt}")
private String gatewayUpSalt; private String gatewayUpSalt;
@Value("${domain.gatewayOrderLogDetails}")
private String gatewayOrderLogDetails;
@Value("${domain.gatewayOrderLogNumError}")
private String gatewayOrderLogNumError;
/**
* 订单管理列表(分页查询)
*
* @author Bellamy
*/
@Override @Override
public PageInfoResponse<OrderDto> findList(OrderRequest order, HttpServletRequest req) throws Exception { public PageInfoResponse<OrderDto> findList(OrderRequest order, HttpServletRequest req) throws Exception {
PageInfoResponse<OrderDto> pageInfoResponse = new PageInfoResponse<>(); PageInfoResponse<OrderDto> pageInfoResponse = new PageInfoResponse<>();
...@@ -96,7 +107,12 @@ public class OrderServiceImpl implements OrderService { ...@@ -96,7 +107,12 @@ public class OrderServiceImpl implements OrderService {
pageInfoResponse.setData(pageInfo); pageInfoResponse.setData(pageInfo);
return pageInfoResponse; return pageInfoResponse;
} }
/**
* 根据订单主键查询,订单详情
* @param orderId
* @return
* @throws Exception
*/
@Override @Override
public OrderDto getOrderDetail(String orderId) throws Exception { public OrderDto getOrderDetail(String orderId) throws Exception {
OrderDto orderDto = null; OrderDto orderDto = null;
...@@ -112,7 +128,12 @@ public class OrderServiceImpl implements OrderService { ...@@ -112,7 +128,12 @@ public class OrderServiceImpl implements OrderService {
} }
return orderDto; return orderDto;
} }
/**
* 根据订单主键查询,订单详情-接口文档
* @param params
* @return
* @throws Exception
*/
@Override @Override
public Map getApiInterfaceDetail(Map params) throws Exception { public Map getApiInterfaceDetail(Map params) throws Exception {
Map returnMap = new HashMap(); Map returnMap = new HashMap();
...@@ -165,7 +186,12 @@ public class OrderServiceImpl implements OrderService { ...@@ -165,7 +186,12 @@ public class OrderServiceImpl implements OrderService {
map.put("salt", salt); map.put("salt", salt);
return Result.of_success(ResultMsg.SUCCESS, salt); return Result.of_success(ResultMsg.SUCCESS, salt);
} }
/**
* 订单管理列表(分页查询)--卖方
* @param req
* @param httpServletRequest
* @return
*/
@Override @Override
public Result<IPage<OrderBySellerDto>> queryPageListBySeller(OrderRequest req, HttpServletRequest httpServletRequest) { public Result<IPage<OrderBySellerDto>> queryPageListBySeller(OrderRequest req, HttpServletRequest httpServletRequest) {
IPage<OrderBySellerDto> page = new Page<>(req.getPageNum(), req.getPageSize()); IPage<OrderBySellerDto> page = new Page<>(req.getPageNum(), req.getPageSize());
...@@ -231,32 +257,51 @@ public class OrderServiceImpl implements OrderService { ...@@ -231,32 +257,51 @@ public class OrderServiceImpl implements OrderService {
return Result.of_success(dto); return Result.of_success(dto);
} }
/**
* 订单管理(条件分页查询)--买方
* @param req
* @return
*/
@Override @Override
public PageInfoResponse<OrderByPurchaserDto> queryPageListByPurchaser(OrderRequest req) { public Result<PageInfoResponse<OrderByPurchaserDto>> queryPageListByPurchaser(OrderRequest req) {
// 调用gateway,获取调用数/错误率
List<Map<String, String>> reqList = orderDao.getApiKey(getCustomer().getCustomerId());
JSONObject object = new JSONObject();
object.put("reqList", reqList);
String s = HttpsUtilsTest.submitPost(gatewayOrderLogNumError, object.toString());
// 处理参数
JSONObject params = JSONObject.parseObject(s);
if (!params.get("code").equals(200) || org.springframework.util.StringUtils.isEmpty(params.get("data"))) {
return Result.of_error("获取参数失败!");
}
PageInfoResponse<OrderByPurchaserDto> pageInfoResponse = new PageInfoResponse<>(); PageInfoResponse<OrderByPurchaserDto> pageInfoResponse = new PageInfoResponse<>();
Map<String, Object> param = new HashMap<>(); Map<String, Object> param = new HashMap<>();
if (StringUtils.isNotBlank(req.getDataName())) { if (StringUtils.isNotBlank(req.getDataName())) {
param.put("dataName", req.getDataName()); param.put("dataName", req.getDataName());
} }
if (StringUtils.isNotBlank(req.getPriceType())) { if (StringUtils.isNotBlank(req.getPriceType())) {
param.put("priceType", req.getPriceType()); param.put("priceType", req.getPriceType());
} }
List<String> apiKey = orderDao.getApiKey(getCustomer().getCustomerId()); if (getCustomer().getCustomerId() != null) {
if (apiKey.size() != 0) { param.put("customerId", getCustomer().getCustomerId());
param.put("apiKeys", apiKey); }else {
return Result.of_error("用户未登录,请登录!");
} }
param.put("dateNow",DateUtils.getToday());
PageHelper.startPage(req.getPageNum(), req.getPageSize()); PageHelper.startPage(req.getPageNum(), req.getPageSize());
List<OrderByPurchaserDto> list = orderDao.queryPageListByPurchaser(param); List<OrderByPurchaserDto> list = orderDao.queryPageListByPurchaser(param);
// 封装参数
List<Map> result = (List<Map>) JSONObject.parse(params.getString("data"));
for (OrderByPurchaserDto orderByPurchaserDto : list) {
for (Map map : result) {
if (map.get("requestToken").equals(orderByPurchaserDto.getRequestToken())){
orderByPurchaserDto.setErrorRate(map.get("errorRate").toString());
orderByPurchaserDto.setCallNumber(map.get("callNumber").toString());
}
}
}
PageInfo<OrderByPurchaserDto> pageInfo = new PageInfo<>(list); PageInfo<OrderByPurchaserDto> pageInfo = new PageInfo<>(list);
pageInfoResponse.setCode(Constants.SUCCESS_CODE); return Result.of_success(pageInfo);
pageInfoResponse.setMessage("查询成功");
pageInfoResponse.setData(pageInfo);
return pageInfoResponse;
} }
...@@ -264,12 +309,33 @@ public class OrderServiceImpl implements OrderService { ...@@ -264,12 +309,33 @@ public class OrderServiceImpl implements OrderService {
@Override @Override
public Result getApiKey() { public Result getApiKey() {
MallCustomerApiDto customer = (MallCustomerApiDto) redisTemplate.opsForValue().get("USER_" + RedisMessageConstant.SENDTYPE_LOGIN_CUSTOMER); MallCustomerApiDto customer = (MallCustomerApiDto) redisTemplate.opsForValue().get("USER_" + RedisMessageConstant.SENDTYPE_LOGIN_CUSTOMER);
List<String> apiKey = orderDao.getApiKey(customer.getCustomerId()); List<Map<String, String>> apiKey = orderDao.getApiKey(customer.getCustomerId());
if (apiKey.size() == 0) { if (apiKey.size() == 0) {
return Result.of_error("apiKey为空!"); return Result.of_error("apiKey为空!");
} }
return Result.of_success(apiKey); return Result.of_success(apiKey);
} }
/**
* 获取订单日志详情
* @param req
* @return
*/
@Override
public Result getLogDetails(LogInfoListReq req) {
if (StringUtils.isEmpty(req.getApiKey())) {
return Result.of_error("apiKey不能为空!");
}
if (StringUtils.isEmpty(req.getRequestToken())) {
return Result.of_error("授权码不能为空!");
}
System.out.println(JSON.toJSONString(req));
String post = HttpsUtilsTest.submitPost(gatewayOrderLogDetails, JSON.toJSONString(req));
JSONObject params = JSONObject.parseObject(post);
if (!params.get("code").equals(200) || org.springframework.util.StringUtils.isEmpty(params.get("data"))){
return Result.of_error("获取日志详情失败!");
}
return Result.ok(params.get("data"));
}
public MallCustomerApiDto getCustomer() { public MallCustomerApiDto getCustomer() {
MallCustomerApiDto customer = (MallCustomerApiDto) redisTemplate.opsForValue().get("USER_" + RedisMessageConstant.SENDTYPE_LOGIN_CUSTOMER); MallCustomerApiDto customer = (MallCustomerApiDto) redisTemplate.opsForValue().get("USER_" + RedisMessageConstant.SENDTYPE_LOGIN_CUSTOMER);
......
...@@ -14,7 +14,6 @@ import org.springframework.stereotype.Service; ...@@ -14,7 +14,6 @@ import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.Date; import java.util.Date;
import java.util.concurrent.TimeUnit;
/** /**
* @author ZC * @author ZC
...@@ -34,6 +33,11 @@ public class PersonalUserControllerServiceImpl implements PersonalUserController ...@@ -34,6 +33,11 @@ public class PersonalUserControllerServiceImpl implements PersonalUserController
@Resource @Resource
private MallCustomerDao mallCustomerDao; private MallCustomerDao mallCustomerDao;
/**
* 获取登录用户信息
* @return
*/
@Override @Override
public Result getUserInfo() { public Result getUserInfo() {
MallCustomerApiDto user = (MallCustomerApiDto) redisTemplate.opsForValue().get("USER_" + RedisMessageConstant.SENDTYPE_LOGIN_CUSTOMER); MallCustomerApiDto user = (MallCustomerApiDto) redisTemplate.opsForValue().get("USER_" + RedisMessageConstant.SENDTYPE_LOGIN_CUSTOMER);
......
package com.jz.dm.mall.moduls.service.impl; package com.jz.dm.mall.moduls.service.impl;
import com.jz.dm.mall.moduls.mapper.TestMapper;
import com.jz.dm.mall.moduls.service.TestService;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.jz.dm.mall.moduls.mapper.TestMapper;
import com.jz.dm.mall.moduls.service.TestService;
@Service("testService") @Service("testService")
public class TestServiceImpl implements TestService { public class TestServiceImpl implements TestService {
......
package com.jz.dm.mall.moduls.service.impl;
import com.aliyuncs.CommonRequest;
import com.aliyuncs.CommonResponse;
import com.aliyuncs.DefaultAcsClient;
import com.aliyuncs.IAcsClient;
import com.aliyuncs.exceptions.ClientException;
import com.aliyuncs.exceptions.ServerException;
import com.aliyuncs.http.MethodType;
import com.aliyuncs.profile.DefaultProfile;
import com.jz.common.constant.RedisMessageConstant;
import com.jz.common.utils.Result;
import com.jz.common.utils.SMSUtils;
import com.jz.common.utils.StatusCode;
import com.jz.common.utils.ValidateCodeUtils;
import com.jz.dm.mall.moduls.service.ValidateCodeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import java.util.concurrent.TimeUnit;
/**
* @ClassName:
* @Author: Carl
* @Date: 2021/1/28
* @Version:
*/
@Service("validateCodeService")
public class ValidateCodeServiceImpl implements ValidateCodeService {
@Autowired
private RedisTemplate redisTemplate;
@Value("${SMS.msgSign}")
private String msgSign;
@Value("${SMS.template}")
private String template;
@Value("${SMS.accessKeyId}")
private String accessKeyId;
@Value("${SMS.accessKeySecret}")
private String accessKeySecret;
/**
* 发送验证码
*
* @param telephone
* @return
*/
@Override
public Result send4Code(String telephone) {
String key = RedisMessageConstant.SENDTYPE_GETPWD + "_" + telephone;
// 通过手机号从redis获取验证码
String codeInRedis = (String) redisTemplate.opsForValue().get(key);
if (codeInRedis!=null && !codeInRedis.equals("")) {
// redis中的验证码还未过期
return Result.of_error("验证码发送失败!");
} else {
// redis中无此手机号的验证码,发送验证码
Integer code = ValidateCodeUtils.generateValidateCode(6);
SMSUtils.sendMessage(template,code,telephone,accessKeyId,accessKeySecret,msgSign);
redisTemplate.opsForValue().set(key,code,5, TimeUnit.MINUTES);
return Result.of_success("验证码发送成功!");
}
}
/**
* 修改密码发送的验证码
* @param telephone
* @return
*/
@Override
public Result sendForLogin(String telephone) {
String key = RedisMessageConstant.SENDTYPE_LOGIN + "_" + telephone;
// 通过手机号从redis获取验证码
String codeInRedis = (String) redisTemplate.opsForValue().get(key);
if (codeInRedis!=null && !codeInRedis.equals("")) {
// redis中的验证码还未过期
return Result.of_error("验证码发送失败!");
} else {
// redis中无此手机号的验证码,发送验证码
Integer code = ValidateCodeUtils.generateValidateCode(6);
SMSUtils.sendMessage(template,code,telephone,accessKeyId,accessKeySecret,msgSign);
redisTemplate.opsForValue().set(key,code,5, TimeUnit.MINUTES);
return Result.ok("验证码发送成功!");
}
}
}
...@@ -74,11 +74,13 @@ mybatis: ...@@ -74,11 +74,13 @@ mybatis:
logging: logging:
level: level:
com.jz.dm.mall: debug com.jz.dm.mall: debug
# 调用gateway接口路径
domain: domain:
gatewayGetAuth: http://47.115.53.1:8088/api/auth/mall-user-auth-api gatewayGetAuth: http://47.115.53.1:8088/api/auth/mall-user-auth-api
gatewayUpSalt: http://192.168.1.114:8088/api/auth/reset-salt gatewayUpSalt: http://192.168.1.114:8088/api/auth/reset-salt
apigateway: http://127.0.0.1:8088/api/producer/addDataBankApiInfo apigateway: http://127.0.0.1:8088/api/producer/addDataBankApiInfo
gatewayOrderLogDetails: http://127.0.0.1:8088/api/logging/listApiLog
gatewayOrderLogNumError: http://127.0.0.1:8088/api/logging/queryNumberAndError
ftp: ftp:
url: 192.168.1.141 url: 192.168.1.141
port: 21 port: 21
...@@ -87,12 +89,9 @@ ftp: ...@@ -87,12 +89,9 @@ ftp:
token: #dataBank 制作验签 token: #dataBank 制作验签
dataBank: dataBank123 dataBank: dataBank123
# 短信发送参数
mq: SMS:
pay: msgSign: 万家数据商城
exchange: template: SMS_205878938
order: exchange.order accessKeyId: LTAI4GKPoTkrT6n2fSV7ePEG
queue: accessKeySecret: k8HcW3TxZzGxAetEpyDInZehip9MAE
order: queue.order \ No newline at end of file
routing:
key: queue.order
\ No newline at end of file
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
#{dep.businessLicense},#{dep.taxRegistration},#{dep.departPictureTime},#{dep.businessLicenseTime},#{dep.unifiedCreditCode},#{dep.bankName},#{dep.bankCardNumber},#{dep.auditStatus},#{dep.creTime},#{dep.crePerson}) #{dep.businessLicense},#{dep.taxRegistration},#{dep.departPictureTime},#{dep.businessLicenseTime},#{dep.unifiedCreditCode},#{dep.bankName},#{dep.bankCardNumber},#{dep.auditStatus},#{dep.creTime},#{dep.crePerson})
</insert> </insert>
<select id="selectDepartmentData" resultType="com.jz.common.entity.Department" parameterType="com.jz.dm.mall.moduls.controller.company.bean.CompanyAddReq"> <select id="selectDepartmentData" resultType="com.jz.common.entity.Department" parameterType="com.jz.dm.mall.moduls.controller.company.bean.req.CompanyAddReq">
SELECT SELECT
<include refid="department"/> <include refid="department"/>
FROM t_department FROM t_department
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
</if> </if>
</select> </select>
<select id="selectCompanyDetail" resultType="com.jz.dm.mall.moduls.controller.company.dto.CompanyInfoDto"> <select id="selectCompanyDetail" resultType="com.jz.dm.mall.moduls.controller.company.bean.dto.CompanyInfoDto">
SELECT SELECT
t1.department_id AS departmentId, t1.department_id AS departmentId,
t1.audit_status AS auditStatus, t1.audit_status AS auditStatus,
...@@ -75,12 +75,11 @@ ...@@ -75,12 +75,11 @@
t1.bank_name AS bankName, t1.bank_name AS bankName,
t1.bank_card_number AS bankCardNumber, t1.bank_card_number AS bankCardNumber,
t1.linkman AS linkman, t1.linkman AS linkman,
t1.telephone AS telephone, t1.telephone AS telephone
t4.role_id as roleId
FROM t_department t1 FROM t_department t1
INNER JOIN t_mall_customer t2 ON t1.department_id = t2.department_id INNER JOIN t_mall_customer t2 ON t1.department_id = t2.department_id
inner join t_mall_user_role t3 on t2.customer_id = t3.customer_id -- inner join t_mall_user_role t3 on t2.customer_id = t3.customer_id
INNER JOIN t_mall_role t4 on t3.role_id = t4.role_id -- INNER JOIN t_mall_role t4 on t3.role_id = t4.role_id
WHERE t1.department_id=#{departmentId} AND t1.del_flag ='N' WHERE t1.department_id=#{departmentId} AND t1.del_flag ='N'
</select> </select>
...@@ -104,9 +103,10 @@ ...@@ -104,9 +103,10 @@
WHERE WHERE
province_code = #{provinceCode} province_code = #{provinceCode}
</select> </select>
<select id="getAreaList" resultType="java.lang.String"> <select id="getAreaList" resultType="com.jz.dm.mall.moduls.controller.company.bean.dto.CityAndAreaDto">
SELECT SELECT
DISTINCT( a.`name` ) AS `name` DISTINCT( a.`name` ) AS areaName,
a.area_code As areaCode
FROM t_province AS p FROM t_province AS p
JOIN t_city AS c ON c.province_code = p.province_code JOIN t_city AS c ON c.province_code = p.province_code
JOIN t_area AS a ON a.city_code = c.city_code JOIN t_area AS a ON a.city_code = c.city_code
...@@ -120,9 +120,10 @@ ...@@ -120,9 +120,10 @@
</select> </select>
<select id="getCityList" resultType="java.lang.String"> <select id="getCityList" resultType="com.jz.dm.mall.moduls.controller.company.bean.dto.CityAndAreaDto">
SELECT SELECT
DISTINCT( c.`name` ) AS `name` DISTINCT( c.`name` ) AS cityName,
c.city_code as cityCode
FROM t_province AS p FROM t_province AS p
JOIN t_city AS c ON c.province_code = p.province_code JOIN t_city AS c ON c.province_code = p.province_code
JOIN t_area AS a ON a.city_code = c.city_code JOIN t_area AS a ON a.city_code = c.city_code
......
...@@ -165,7 +165,7 @@ ...@@ -165,7 +165,7 @@
delete from t_mall_customer where customer_id = #{customerId} delete from t_mall_customer where customer_id = #{customerId}
</delete> </delete>
<select id="selectByAccount" resultType="com.jz.dm.mall.moduls.controller.customer.bean.CustomerDto"> <select id="selectByAccount" resultType="com.jz.dm.mall.moduls.controller.customer.bean.dto.CustomerDto">
select select
t1.customer_id as customerId, t1.customer_id as customerId,
t1.department_id as departmentId, t1.department_id as departmentId,
...@@ -181,7 +181,7 @@ ...@@ -181,7 +181,7 @@
where 1=1 and t1.del_flag='N' and customer_account = #{username}; where 1=1 and t1.del_flag='N' and customer_account = #{username};
</select> </select>
<select id="selectByPhone" resultType="com.jz.dm.mall.moduls.controller.customer.bean.CustomerDto"> <select id="selectByPhone" resultType="com.jz.dm.mall.moduls.controller.customer.bean.dto.CustomerDto">
select select
t1.customer_id as customerId, t1.customer_id as customerId,
t1.department_id as departmentId, t1.department_id as departmentId,
...@@ -287,15 +287,11 @@ ...@@ -287,15 +287,11 @@
t1.customer_name AS customerName, t1.customer_name AS customerName,
t1.customer_phone AS customerPhone, t1.customer_phone AS customerPhone,
t1.head_portrait_url AS headPortraitUrl, t1.head_portrait_url AS headPortraitUrl,
t5.assets_id AS assetsId, t3.assets_id AS assetsId
GROUP_CONCAT( t3.role_id ) AS roleId,
t3.role_name AS roleName
FROM FROM
t_mall_customer t1 t_mall_customer t1
left JOIN t_mall_user_role t2 ON t1.customer_id = t2.customer_id left JOIN t_department t2 ON t1.department_id = t2.department_id
left JOIN t_mall_role t3 ON t2.role_id = t3.role_id left JOIN t_finance_customer_assets t3 ON t3.department_id = t2.department_id
left JOIN t_department t4 ON t1.department_id = t4.department_id
left JOIN t_finance_customer_assets t5 ON t5.department_id = t4.department_id
WHERE WHERE
t1.del_flag = 'N' t1.del_flag = 'N'
<if test="customerAccount != null"> <if test="customerAccount != null">
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<!--商城 充值 只有已审核(认证)企业--> <!--商城 充值 只有已审核(认证)企业-->
<select id="queryAccountMoneyByMap" <select id="queryAccountMoneyByMap"
resultType="com.jz.dm.mall.moduls.controller.finance.bean.FinanceCustomerAssetsDto" parameterType="map"> resultType="com.jz.dm.mall.moduls.controller.finance.bean.dto.FinanceCustomerAssetsDto" parameterType="map">
select select
t.assets_id as assetsId, t.assets_id as assetsId,
t.department_id as departmentId, t.department_id as departmentId,
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<if test="departmentId != null">and t.department_id = #{departmentId}</if> <if test="departmentId != null">and t.department_id = #{departmentId}</if>
</select> </select>
<select id="getCashOutAuditStutas" resultType="com.jz.dm.mall.moduls.controller.finance.bean.FinanceCashOutDto" <select id="getCashOutAuditStutas" resultType="com.jz.dm.mall.moduls.controller.finance.bean.dto.FinanceCashOutDto"
parameterType="map"> parameterType="map">
select select
assets_id as assetsId, assets_id as assetsId,
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
</insert> </insert>
<!--商城利润中心每天收支情况--> <!--商城利润中心每天收支情况-->
<select id="findListScTradeFlow" resultType="com.jz.dm.mall.moduls.controller.finance.bean.FinanceTradeFlowDto" parameterType="map"> <select id="findListScTradeFlow" resultType="com.jz.dm.mall.moduls.controller.finance.bean.dto.FinanceTradeFlowDto" parameterType="map">
select select
sum(case when a.tradeType='01' then a.tradeMoney else 0 end) cashOutMoney, sum(case when a.tradeType='01' then a.tradeMoney else 0 end) cashOutMoney,
sum(case when a.tradeType='02' then a.tradeMoney else 0 end) rechargeMoney, sum(case when a.tradeType='02' then a.tradeMoney else 0 end) rechargeMoney,
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
</select> </select>
<!--商城利润中心每天收支情况明细--> <!--商城利润中心每天收支情况明细-->
<select id="findListEveryDayScInfo" resultType="com.jz.dm.mall.moduls.controller.finance.bean.EveryTradeFlowDto" parameterType="map"> <select id="findListEveryDayScInfo" resultType="com.jz.dm.mall.moduls.controller.finance.bean.dto.EveryTradeFlowDto" parameterType="map">
select select
t.trade_flow_number as tradeFlowNumber, t.trade_flow_number as tradeFlowNumber,
(case when t.trade_type ='01' then '提现' when t.trade_type ='02' then '充值' when t.trade_type ='03' then '支付' (case when t.trade_type ='01' then '提现' when t.trade_type ='02' then '充值' when t.trade_type ='03' then '支付'
......
...@@ -223,7 +223,7 @@ ...@@ -223,7 +223,7 @@
delete from t_order where order_id = #{orderId} delete from t_order where order_id = #{orderId}
</delete> </delete>
<select id="findList" resultType="com.jz.dm.mall.moduls.controller.order.bean.OrderDto" parameterType="map"> <select id="findList" resultType="com.jz.dm.mall.moduls.controller.order.bean.dto.OrderDto" parameterType="map">
select select
t.order_id as orderId, t.order_id as orderId,
t.order_number as orderNumber, t.order_number as orderNumber,
...@@ -261,7 +261,7 @@ ...@@ -261,7 +261,7 @@
order By t.order_time DESC order By t.order_time DESC
</select> </select>
<!--根据订单id 查询详情--> <!--根据订单id 查询详情-->
<select id="getOrderDetail" resultType="com.jz.dm.mall.moduls.controller.order.bean.OrderDto" parameterType="map"> <select id="getOrderDetail" resultType="com.jz.dm.mall.moduls.controller.order.bean.dto.OrderDto" parameterType="map">
select select
t.order_id as orderId, t.order_id as orderId,
t.order_number as orderNumber, t.order_number as orderNumber,
...@@ -283,7 +283,7 @@ ...@@ -283,7 +283,7 @@
<if test="orderId != null">and t.order_id = #{orderId}</if> <if test="orderId != null">and t.order_id = #{orderId}</if>
</select> </select>
<resultMap id="apiParamsInfo" type="com.jz.dm.mall.moduls.controller.order.bean.DataGoodsApiDto"> <resultMap id="apiParamsInfo" type="com.jz.dm.mall.moduls.controller.order.bean.dto.DataGoodsApiDto">
<id column="goods_api" property="goodsApi"/> <id column="goods_api" property="goodsApi"/>
<result column="api_name" property="apiName"/> <result column="api_name" property="apiName"/>
<result column="request_type" property="requestType"/> <result column="request_type" property="requestType"/>
...@@ -294,7 +294,7 @@ ...@@ -294,7 +294,7 @@
<result column="return_type" property="returnType"/> <result column="return_type" property="returnType"/>
<result column="api_key" property="apiKey"/> <result column="api_key" property="apiKey"/>
<result column="request_token" property="requestToken"/> <result column="request_token" property="requestToken"/>
<collection property="apiParamsDto" ofType="com.jz.dm.mall.moduls.controller.order.bean.DataGoodsApiParamsDto"> <collection property="apiParamsDto" ofType="com.jz.dm.mall.moduls.controller.order.bean.dto.DataGoodsApiParamsDto">
<id column="api_params_id" property="apiParamsId"/> <id column="api_params_id" property="apiParamsId"/>
<result column="params_diff" property="paramsDiff"/> <result column="params_diff" property="paramsDiff"/>
<result column="params_name" property="paramsName"/> <result column="params_name" property="paramsName"/>
...@@ -336,7 +336,7 @@ ...@@ -336,7 +336,7 @@
<if test="orderId != null">and t.order_id = #{orderId}</if> <if test="orderId != null">and t.order_id = #{orderId}</if>
</select> </select>
<select id="getApiInterface" resultType="com.jz.dm.mall.moduls.controller.order.bean.DataGoodsApiDto" <select id="getApiInterface" resultType="com.jz.dm.mall.moduls.controller.order.bean.dto.DataGoodsApiDto"
parameterType="map"> parameterType="map">
select select
t3.goods_api as goodsApi, t3.goods_api as goodsApi,
...@@ -359,7 +359,7 @@ ...@@ -359,7 +359,7 @@
<if test="orderId != null">and t.order_id = #{orderId}</if> <if test="orderId != null">and t.order_id = #{orderId}</if>
</select> </select>
<select id="getApiParamsInfo" resultType="com.jz.dm.mall.moduls.controller.order.bean.DataGoodsApiParamsDto" <select id="getApiParamsInfo" resultType="com.jz.dm.mall.moduls.controller.order.bean.dto.DataGoodsApiParamsDto"
parameterType="map"> parameterType="map">
select select
(case when t4.params_diff ='01' then '公共参数' when t4.params_diff ='02' then '请求参数' (case when t4.params_diff ='01' then '公共参数' when t4.params_diff ='02' then '请求参数'
...@@ -378,28 +378,6 @@ ...@@ -378,28 +378,6 @@
<if test="goodsApi != null">and t4.goods_api = #{goodsApi}</if> <if test="goodsApi != null">and t4.goods_api = #{goodsApi}</if>
</select> </select>
<insert id="addOrder" keyProperty="orderId" useGeneratedKeys="true">
INSERT INTO t_order (
order_number,
customer_id,
order_status,
order_money,
order_time,
payment_money,
payment_time,
api_key,
payment_method,
purchase_method,
take_effect_time,
invalid_time,
price_type,
cre_person,
cre_time
)
VALUES
(#{orderNumber}, #{customerId}, #{orderStatus},#{orderMoney}, #{orderTime}, #{paymentMoney}, #{paymentTime}, #{apiKey}, #{paymentMethod}, #{purchaseMethod}, #{takeEffectTime} ,#{invalidTime}, #{priceType}, #{crePerson}, #{creTime})
</insert>
<update id="updateTokenAndSalt" parameterType="com.jz.dm.mall.moduls.entity.Order"> <update id="updateTokenAndSalt" parameterType="com.jz.dm.mall.moduls.entity.Order">
update t_order update t_order
<set> <set>
...@@ -435,7 +413,7 @@ ...@@ -435,7 +413,7 @@
where order_id = #{orderId} where order_id = #{orderId}
</update> </update>
<select id="queryPageListBySeller" resultType="com.jz.dm.mall.moduls.controller.order.bean.OrderBySellerDto"> <select id="queryPageListBySeller" resultType="com.jz.dm.mall.moduls.controller.order.bean.dto.OrderBySellerDto">
SELECT SELECT
t.order_id AS orderId, t.order_id AS orderId,
t.order_number AS orderNumber, t.order_number AS orderNumber,
...@@ -520,11 +498,30 @@ ...@@ -520,11 +498,30 @@
) t2 ) t2
</select> </select>
<select id="queryPageListByPurchaser" resultType="com.jz.dm.mall.moduls.controller.order.bean.OrderByPurchaserDto"> <select id="queryPageListByPurchaser" resultType="com.jz.dm.mall.moduls.controller.order.bean.dto.OrderByPurchaserDto">
SELECT
t1.goods_token as requestToken,
t1.api_key as apiKey,
t1.salt_value as saltValue,
t1.price_type as priceType,
t3.data_name as dataName
FROM
t_order t1
join t_order_goods_info t2 on t1.order_id = t2.order_id
join t_data_goods t3 on t2.data_goods_id = t3.data_goods_id
where
t1.customer_id = #{customerId}
<if test="dataName != null and dataName != ''">
and t3.data_name = #{dataName}
</if>
<if test="priceType != null and priceType != ''">
and t3.price_type = #{priceType}
</if>
GROUP BY t1.api_key
order BY t1.order_time
</select> </select>
<select id="getApiKey" resultType="java.lang.String"> <select id="getApiKey" resultType="map">
select api_key from t_order where customer_id = #{customerId} select api_key as apiKey,goods_token as requestToken from t_order where customer_id = #{customerId}
</select> </select>
</mapper> </mapper>
\ No newline at end of file
package com.jz.manage.moduls.controller.customer; package com.jz.manage.moduls.controller.customer;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jz.common.constant.ResultMsg;
import com.jz.common.utils.Result; import com.jz.common.utils.Result;
import com.jz.common.utils.StatusCode;
import com.jz.manage.moduls.controller.BaseController; import com.jz.manage.moduls.controller.BaseController;
import com.jz.manage.moduls.controller.customer.bean.dto.CompanyDetailsDto;
import com.jz.manage.moduls.controller.customer.bean.dto.EnterpriseAuditDto; import com.jz.manage.moduls.controller.customer.bean.dto.EnterpriseAuditDto;
import com.jz.manage.moduls.controller.customer.bean.request.DepartmentAuditReq; import com.jz.manage.moduls.controller.customer.bean.request.DepartmentAuditReq;
import com.jz.manage.moduls.controller.customer.bean.request.EnterpriseAuditRequest; import com.jz.manage.moduls.controller.customer.bean.request.EnterpriseAuditRequest;
......
...@@ -4,17 +4,12 @@ import com.jz.common.utils.Result; ...@@ -4,17 +4,12 @@ import com.jz.common.utils.Result;
import com.jz.manage.moduls.service.PictureService; import com.jz.manage.moduls.service.PictureService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
/** * @ClassName: /** * @ClassName:
* @Author: Carl * @Author: Carl
* @Date: 2021/1/12 * @Date: 2021/1/12
...@@ -33,15 +28,13 @@ public class PictureController { ...@@ -33,15 +28,13 @@ public class PictureController {
@ResponseBody @ResponseBody
public Result uploadPicture(MultipartFile file, public Result uploadPicture(MultipartFile file,
@RequestParam(name = "params") String params) { @RequestParam(name = "params") String params) {
// Map<String, Object> paramer = dataGoodsService.uploadPicture(file); return pictureService.uploadPicture(file, params);
Result result = pictureService.uploadPicture(file, params);
return result;
} }
@GetMapping("/downloadPicture") @GetMapping("/downloadPicture")
@ApiOperation(value = "图片下载") @ApiOperation(value = "图片下载")
public Result downloadPicture(@RequestParam(name = "url") String url, HttpServletResponse response) { public Result downloadPicture(@RequestParam(name = "url") String url, HttpServletResponse response) {
Result result = pictureService.downloadPicture(url, response); return pictureService.downloadPicture(url, response);
return result;
} }
} }
package com.jz.manage.moduls.controller.finance; package com.jz.manage.moduls.controller.finance;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jz.common.bean.PageInfoResponse;
import com.jz.common.constant.Constants;
import com.jz.common.constant.ResultMsg; import com.jz.common.constant.ResultMsg;
import com.jz.common.utils.Result; import com.jz.common.utils.Result;
import com.jz.manage.moduls.controller.BaseController; import com.jz.manage.moduls.controller.BaseController;
import com.jz.manage.moduls.controller.finance.platForm.*; import com.jz.manage.moduls.controller.finance.platForm.dto.BalanceInfoDto;
import com.jz.manage.moduls.controller.finance.platForm.dto.BalanceListDto;
import com.jz.manage.moduls.controller.finance.platForm.req.BalanceAuditRequest;
import com.jz.manage.moduls.controller.finance.platForm.req.BalanceListRequest;
import com.jz.manage.moduls.controller.finance.platForm.req.BalanceQuickReq;
import com.jz.manage.moduls.controller.finance.platForm.req.CashOutQuickReq;
import com.jz.manage.moduls.service.FinanceCustomerBalanceService; import com.jz.manage.moduls.service.FinanceCustomerBalanceService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
...@@ -15,8 +18,6 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -15,8 +18,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;
/** /**
* 企业客户充值记录(TFinanceCustomerBalance)表控制层 * 企业客户充值记录(TFinanceCustomerBalance)表控制层
...@@ -93,6 +94,11 @@ public class FinanceCustomerBalanceController extends BaseController { ...@@ -93,6 +94,11 @@ public class FinanceCustomerBalanceController extends BaseController {
return dto; return dto;
} }
/**
* 充值管理--快捷充值--保存充值金额
* @param req
* @return
*/
@PostMapping("/getAccountMoney") @PostMapping("/getAccountMoney")
@ApiOperation(value = "充值管理--快捷充值--保存充值金额", notes = "保存充值金额") @ApiOperation(value = "充值管理--快捷充值--保存充值金额", notes = "保存充值金额")
public Result getAccountMoney(@RequestBody BalanceQuickReq req){ public Result getAccountMoney(@RequestBody BalanceQuickReq req){
...@@ -102,15 +108,19 @@ public class FinanceCustomerBalanceController extends BaseController { ...@@ -102,15 +108,19 @@ public class FinanceCustomerBalanceController extends BaseController {
if (StringUtils.isEmpty(req.getBalanceMoney())) { if (StringUtils.isEmpty(req.getBalanceMoney())) {
return Result.of_error("充值金额不能为空!"); return Result.of_error("充值金额不能为空!");
} }
Result result = new Result();
try { try {
result = financeCustomerBalanceService.uptAccountMoney(req); return financeCustomerBalanceService.uptAccountMoney(req);
}catch (Exception e) { }catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
return Result.of_error("充值失败!");
} }
return result;
} }
/**
* 提现管理--快捷提现--保存提现金额
* @param req
* @return
*/
@PostMapping("/addCashOutMoney") @PostMapping("/addCashOutMoney")
@ApiOperation(value = "提现管理--快捷提现--保存提现金额", notes = "保存提现金额") @ApiOperation(value = "提现管理--快捷提现--保存提现金额", notes = "保存提现金额")
public Result addCashOutMoney(@RequestBody CashOutQuickReq req){ public Result addCashOutMoney(@RequestBody CashOutQuickReq req){
...@@ -120,19 +130,22 @@ public class FinanceCustomerBalanceController extends BaseController { ...@@ -120,19 +130,22 @@ public class FinanceCustomerBalanceController extends BaseController {
if (StringUtils.isEmpty(req.getCashOutMoney())) { if (StringUtils.isEmpty(req.getCashOutMoney())) {
return Result.of_error("提现金额不能为空!"); return Result.of_error("提现金额不能为空!");
} }
Result result = new Result();
try { try {
result = financeCustomerBalanceService.addCashOutMoney(req); return financeCustomerBalanceService.addCashOutMoney(req);
}catch (Exception e) { }catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
return Result.of_error("提现失败!");
} }
return result;
} }
/**
* 充值/提现管理-搜索企业
* @param search
* @return
*/
@PostMapping("/searchCompany") @PostMapping("/searchCompany")
@ApiOperation(value = "充值/提现管理-搜索企业", notes = "搜索企业") @ApiOperation(value = "充值/提现管理-搜索企业", notes = "搜索企业")
public Result searchCompany(@RequestParam String search) { public Result searchCompany(@RequestParam String search) {
Result result = financeCustomerBalanceService.searchCompany(search); return financeCustomerBalanceService.searchCompany(search);
return result;
} }
} }
\ No newline at end of file
...@@ -3,7 +3,6 @@ package com.jz.manage.moduls.controller.finance; ...@@ -3,7 +3,6 @@ package com.jz.manage.moduls.controller.finance;
import com.jz.manage.moduls.controller.BaseController; import com.jz.manage.moduls.controller.BaseController;
import com.jz.manage.moduls.service.FinanceTradeFlowService; import com.jz.manage.moduls.service.FinanceTradeFlowService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
......
package com.jz.manage.moduls.controller.finance; package com.jz.manage.moduls.controller.finance;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jz.common.bean.BasePageBean;
import com.jz.common.bean.MallCustomerApiDto;
import com.jz.common.bean.PageInfoResponse; import com.jz.common.bean.PageInfoResponse;
import com.jz.common.constant.Constants; import com.jz.common.constant.Constants;
import com.jz.common.constant.RedisMessageConstant;
import com.jz.common.constant.ResultMsg; import com.jz.common.constant.ResultMsg;
import com.jz.common.utils.Result; import com.jz.common.utils.Result;
import com.jz.manage.moduls.controller.BaseController; import com.jz.manage.moduls.controller.BaseController;
import com.jz.manage.moduls.controller.finance.platForm.*; import com.jz.manage.moduls.controller.finance.platForm.dto.*;
import com.jz.manage.moduls.controller.finance.platForm.req.CashOutAuditRequest;
import com.jz.manage.moduls.controller.finance.platForm.req.CashOutListRequest;
import com.jz.manage.moduls.controller.finance.platForm.req.OrderCountInfoReq;
import com.jz.manage.moduls.controller.finance.platForm.req.TradeDetilRequest;
import com.jz.manage.moduls.service.PlatformTradeFlowInfoService; import com.jz.manage.moduls.service.PlatformTradeFlowInfoService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
...@@ -58,8 +59,15 @@ public class PlatformTradeFlowInfoController extends BaseController { ...@@ -58,8 +59,15 @@ public class PlatformTradeFlowInfoController extends BaseController {
return result; return result;
} }
/**
* 财务管理--成交额和成交单数和平均成交额
* @param time
* @param requset
* @return
* @throws Exception
*/
@PostMapping(value = "/getMoneyAndOrderTotalDto") @PostMapping(value = "/getMoneyAndOrderTotalDto")
@ApiOperation(value = "财务管理---成交额和成交单数和平均成交额", notes = "成交额和成交单数和平均成交额") @ApiOperation(value = "财务管理--成交额和成交单数和平均成交额", notes = "成交额和成交单数和平均成交额")
public Result<MoneyAndOrderTotalDto> getMoneyAndOrderTotalDto(@RequestParam(required = false) String time, HttpServletRequest requset) throws Exception { public Result<MoneyAndOrderTotalDto> getMoneyAndOrderTotalDto(@RequestParam(required = false) String time, HttpServletRequest requset) throws Exception {
return platformTradeFlowInfoService.getMoneyAndOrderTotalDto(time); return platformTradeFlowInfoService.getMoneyAndOrderTotalDto(time);
} }
...@@ -167,5 +175,4 @@ public class PlatformTradeFlowInfoController extends BaseController { ...@@ -167,5 +175,4 @@ public class PlatformTradeFlowInfoController extends BaseController {
return dto; return dto;
} }
} }
\ No newline at end of file
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment