Commit 436ffdf8 authored by zhangc's avatar zhangc

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

parents a571f762 f4b145f8
*.iml
*.jar
*.idea
*.class
*.target
alter table t_finance_customer_assets add remark text COMMENT '备注';
alter table t_platform_log add caller_type char(2) NOT NULL COMMENT '调用类型:01商城用户,02平台用户';
alter table t_finance_trade_flow add assets_id Bigint(20) default NULL COMMENT'企业资产id';
\ No newline at end of file
alter table t_finance_trade_flow add assets_id Bigint(20) default NULL COMMENT'企业资产id';
alter table t_finance_customer_balance add balance_time datetime default NULL COMMENT'充值时间';
alter table t_finance_trade_flow add balance_money decimal(20,5) NOT NULL DEFAULT '0' COMMENT '结余';
\ No newline at end of file
alter table t_data_goods add use_person varchar(64) DEFAULT '0' COMMENT '使用人数';
\ No newline at end of file
package com.jz.common.base;
import com.jz.common.bean.MallCustomerApiDto;
import org.apache.commons.lang3.StringUtils;
import javax.servlet.http.HttpServletRequest;
/**
......@@ -9,20 +11,22 @@ import javax.servlet.http.HttpServletRequest;
* @Date: 2020/12/3
* @Version:
*/
public class CurrentUser {
public class CurrentUser {
/**
* 获取用户信息
*
* @param req
* @return
*/
public static MallCustomerApiDto getCurrentUser(HttpServletRequest req){
MallCustomerApiDto mallCustomerApiDto =(MallCustomerApiDto) req.getAttribute("mallCustomer");
public static MallCustomerApiDto getCurrentUser(HttpServletRequest req) {
MallCustomerApiDto mallCustomerApiDto = (MallCustomerApiDto) req.getAttribute("mallCustomer");
return mallCustomerApiDto;
}
/**
* 用户id
*
* @param request
* @return
*/
......@@ -33,12 +37,31 @@ public class CurrentUser {
/**
* 企业id
*
* @param request
* @return
*/
public static Long getDepartmentId(HttpServletRequest request) {
public static String getDepartmentId(HttpServletRequest request) {
Long departmentId = getCurrentUser(request).getDepartmentId();
return departmentId;
if (departmentId != null) {
String id = String.valueOf(departmentId);
return id;
}
return null;
}
/**
* 用户资产id
* @Author Bellamy
* @param request
* @return
*/
public static String getAssetsId(HttpServletRequest request) {
String assetsId = getCurrentUser(request).getAssetsId();
if (StringUtils.isNotEmpty(assetsId)) {
return assetsId;
}
return null;
}
}
......@@ -38,6 +38,12 @@ public class MallCustomerApiDto implements Serializable {
@ApiModelProperty(value = "用户真实姓名")
private String customerName;
/**
* 资产账户id
*/
@ApiModelProperty(value = "资产账户id")
private String assetsId;
public static long getSerialVersionUID() {
return serialVersionUID;
}
......@@ -81,4 +87,12 @@ public class MallCustomerApiDto implements Serializable {
public void setCustomerName(String customerName) {
this.customerName = customerName;
}
public String getAssetsId() {
return assetsId;
}
public void setAssetsId(String assetsId) {
this.assetsId = assetsId;
}
}
package com.jz.common.enums;
/**
* 订单方式
*
* @author Bellamy
* @since 2020-12-09 14:30:23
*/
public enum OrderMethodEnum {
/**
* 年
*/
YEAR("YEAR", "01"),
/**
* 季
*/
SEASON("SEASON", "02"),
/**
* 月
*/
MONTH("MONTH", "03"),
/**
* 次
*/
SECOND("SECOND", "04"),
;
private String code;
private String value;
OrderMethodEnum(String code, String value) {
this.code = code;
this.value = value;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public static OrderMethodEnum get(String code) {
if (code == null) {
return null;
}
for (OrderMethodEnum status : values()) {
if (status.getCode().equalsIgnoreCase(code)) {
return status;
}
}
return null;
}
}
package com.jz.common.enums;
/**
* 支付方式
*
* @author Bellamy
* @since 2020-12-09 14:30:23
*/
public enum PaymentMethodEnum {
/**
* 余额
*/
YE("YE", "01"),
/**
* 支付宝
*/
ZFB("ZFB", "02"),
/**
* 微信
*/
WX("WX", "03"),
/**
* 其他
*/
OTHER("OTHER", "04"),
;
private String code;
private String value;
PaymentMethodEnum(String code, String value) {
this.code = code;
this.value = value;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public static PaymentMethodEnum get(String code) {
if (code == null) {
return null;
}
for (PaymentMethodEnum status : values()) {
if (status.getCode().equalsIgnoreCase(code)) {
return status;
}
}
return null;
}
}
package com.jz.common.enums;
/**
* @ClassName: 商品价格类型
* @Author: Carl
* @Date: 2020/12/8
* @Version:
*/
public enum PriceTypeEnum {
/**
* 免费
*/
MF("MF", "01"),
/**
* 收费
*/
SF("SF", "02"),
;
private String code;
private String value;
PriceTypeEnum(String code, String value) {
this.code = code;
this.value = value;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public static PriceTypeEnum get(String code) {
if (code == null) {
return null;
}
for (PriceTypeEnum status : values()) {
if (status.getCode().equalsIgnoreCase(code)) {
return status;
}
}
return null;
}
}
package com.jz.common.enums;
/**
* 交易流水类型
*
* @author Bellamy
* @since 2020-12-07 14:30:23
*/
public enum TradeFlowEnum {
/**
* 提现
*/
TX("TX", "01"),
/**
* 充值
*/
CZ("CZ", "02"),
/**
* 付款(订单)
*/
FK("FK", "03"),
/**
* 收款
*/
SK("SK", "04"),
/**
* 续费
*/
XF("XF", "05"),
;
private String code;
private String value;
TradeFlowEnum(String code, String value) {
this.code = code;
this.value = value;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public static TradeFlowEnum get(String code) {
if (code == null) {
return null;
}
for (TradeFlowEnum status : values()) {
if (status.getCode().equalsIgnoreCase(code)) {
return status;
}
}
return null;
}
}
package com.jz.common.utils;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
......@@ -288,6 +290,40 @@ public class DateUtils {
return calendar.getTime();
}
//获取时间差方法
public static String getTime(Date currentTime,Date firstTime){
long diff = currentTime.getTime() - firstTime.getTime();//这样得到的差值是微秒级别
Calendar currentTimes =dataToCalendar(currentTime);//当前系统时间转Calendar类型
Calendar firstTimes =dataToCalendar(firstTime);//查询的数据时间转Calendar类型
int year = currentTimes.get(Calendar.YEAR) - firstTimes.get(Calendar.YEAR);//获取年
int month = currentTimes.get(Calendar.MONTH) - firstTimes.get(Calendar.MONTH);
int day = currentTimes.get(Calendar.DAY_OF_MONTH) - firstTimes.get(Calendar.DAY_OF_MONTH);
if (day < 0) {
month -= 1;
currentTimes.add(Calendar.MONTH, -1);
day = day + currentTimes.getActualMaximum(Calendar.DAY_OF_MONTH);//获取日
}
if (month < 0) {
month = (month + 12) % 12;//获取月
year--;
}
long days = diff / (1000 * 60 * 60 * 24);
long hours = (diff-days*(1000 * 60 * 60 * 24))/(1000* 60 * 60); //获取时
long minutes = (diff-days*(1000 * 60 * 60 * 24)-hours*(1000* 60 * 60))/(1000* 60); //获取分钟
long s=(diff/1000-days*24*60*60-hours*60*60-minutes*60);//获取秒
String CountTime=""+month+"月"+day+"天"+hours+"小时"+minutes+"分";
// String CountTime=""+month+"月"+day+"天"+hours+"小时"+minutes+"分"+s+"秒";
return CountTime;
}
//Date类型转Calendar类型
public static Calendar dataToCalendar(Date date) {
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
return calendar;
}
public static void main(String[] args) {
try {
System.out.println("本周一" + parseDate2String(getThisWeekMonday()));
......
......@@ -7,8 +7,8 @@ package com.jz.common.utils;
* @Version:
*/
public class StatusCode {
public static final int OK = 30000; // 成功
public static final int ERROR = 30001; // 失败
public static final int OK = 200; // 成功
public static final int ERROR = 201; // 失败
public static final int LOGINERROR = 30002; // 用户名或密码错误
public static final int ACCESSERROR = 30003; // 权限不足
}
......@@ -78,7 +78,7 @@
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
</dependency>
<!-- mybatis plus -->
<dependency>
<groupId>com.baomidou</groupId>
......
package com.jz.dm.mall.moduls.controller.customer;
import com.jz.common.base.CurrentUser;
import com.jz.common.bean.MallCustomerApiDto;
import com.jz.common.constant.RedisMessageConstant;
import com.jz.dm.mall.moduls.entity.MallCustomer;
import com.jz.common.utils.Result;
import com.jz.common.utils.SessionUtils;
import com.jz.common.utils.StatusCode;
import com.jz.dm.mall.moduls.controller.customer.bean.CustomerDto;
import com.jz.dm.mall.moduls.entity.MallCustomer;
import com.jz.dm.mall.moduls.service.MallCustomerService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.catalina.servlet4preview.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;
import org.apache.catalina.servlet4preview.http.HttpServletRequest;
import java.util.Map;
......@@ -37,29 +38,34 @@ public class LoginController {
@Autowired
private RedisTemplate redisTemplate;
/**
* 登录功能
*
* @param username 账号
* @param password 密码
* @return
*/
@PostMapping(value = "/login")
public Result<MallCustomer> login(String username, String password, HttpServletRequest request) throws Exception{
@ApiOperation(value = "登录功能", notes = "登录功能")
public Result<CustomerDto> login(@RequestParam(value = "username") String username,
@RequestParam(value = "password") String password, HttpServletRequest request) throws Exception {
// 手机
String ph = "^[1][34578]\\d{9}$";
// 如果是手机验证
if (username.matches(username)) {
MallCustomer mallCustomer = mallCustomerService.selectByPhone(username, request);
if (username.matches(ph)) {
CustomerDto mallCustomer = mallCustomerService.selectByPhone(username, request);
request.getSession().getAttribute("mallCustomer");
if (mallCustomer != null) {
if (mallCustomer.getCustomerPhone().equals(username) && mallCustomer.getPassword().equals(password)){
if (mallCustomer.getCustomerPhone().equals(username) && mallCustomer.getPassword().equals(password)) {
return new Result<>(true, "登录成功!", StatusCode.OK);
}
return new Result<>(false, "用户名或密码错误!", StatusCode.ERROR);
}
}
MallCustomer mallCustomer = mallCustomerService.selectByAccount(username, request);
CustomerDto mallCustomer = mallCustomerService.selectByAccount(username, request);
if (mallCustomer != null) {
if (mallCustomer.getCustomerAccount().equals(username) && mallCustomer.getPassword().equals(password)){
if (mallCustomer.getCustomerAccount().equals(username) && mallCustomer.getPassword().equals(password)) {
return new Result<>(true, "登录成功!", StatusCode.OK);
}
}
......@@ -69,11 +75,12 @@ public class LoginController {
/**
* 手机获取验证码
*
* @param paramMap
* @return
*/
@PostMapping(value = "/getCode")
public Result loginCheck(@RequestParam(required = false) Map<String, String> paramMap) {
public Result loginCheck(@RequestParam(required = true) Map<String, String> paramMap) {
// 获取手机号码
String telephone = paramMap.get("telephone");
String key = RedisMessageConstant.SENDTYPE_LOGIN + "_" + telephone;
......@@ -94,12 +101,13 @@ public class LoginController {
/**
* 手机号码校验
*
* @param telephone
* @return
*/
@GetMapping(value = "/phoneCheck")
@ApiOperation(value = "手机号码校验接口", notes = "手机号码是否已注册")
public Result phoneCheck(String telephone) {
public Result phoneCheck(@RequestParam("telephone") String telephone) {
if (telephone == null) {
return new Result(false, "请重新输入手机号!");
}
......@@ -113,6 +121,7 @@ public class LoginController {
/**
* 手机号码及用户名重复校验
*
* @param username
* @param telephone
* @param request
......@@ -120,7 +129,8 @@ public class LoginController {
*/
@GetMapping(value = "/phoneUserCheck")
@ApiOperation(value = "手机号用户名重复校验接口", notes = "手机号用户名是否重复")
public Result phoneCheck(String username, String telephone, HttpServletRequest request) {
public Result phoneCheck(@RequestParam(value = "username") String username ,
@RequestParam(value = "password") String telephone, HttpServletRequest request) {
String ph = "^[1][34578]\\d{9}$";
if (telephone.matches(ph)) {
MallCustomer mallCustomer = mallCustomerService.selectByPhone(telephone);
......@@ -131,7 +141,7 @@ public class LoginController {
}
}
// 根据手机号查询用户信息
MallCustomer mallCustomer = mallCustomerService.selectByAccount(username, request);
CustomerDto mallCustomer = mallCustomerService.selectByAccount(username, request);
if (mallCustomer != null) {
if (mallCustomer.getCustomerAccount().equals(username)) {
return new Result(false, "用户名相同!");
......
......@@ -3,15 +3,18 @@ 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.CurrentUser;
import com.jz.common.bean.MallCustomerApiDto;
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.entity.MallCustomer;
import com.jz.common.utils.Result;
import com.jz.common.utils.StatusCode;
import com.jz.dm.mall.moduls.service.MallCustomerService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
......@@ -49,7 +52,7 @@ public class MallCustomerController extends BaseController {
*/
@PostMapping("/saveCustomer")
@ApiOperation(value = "注册用户", notes = "添加用户")
public Result saveCustomer(@RequestParam(required = false) Map<String, String> paramMap, HttpServletRequest request) {
public Result saveCustomer(@RequestParam(required = true) Map<String, String> paramMap, HttpServletRequest request) {
if (paramMap != null) {
String username = paramMap.get("username");
String telephone = paramMap.get("telephone");
......@@ -63,7 +66,7 @@ public class MallCustomerController extends BaseController {
}
}
// 根据手机号查询用户信息
MallCustomer mallCustomer = mallCustomerService.selectByAccount(username, request);
CustomerDto mallCustomer = mallCustomerService.selectByAccount(username, request);
if (mallCustomer != null) {
if (mallCustomer.getCustomerAccount().equals(username)) {
return new Result(false, "用户名相同");
......@@ -81,13 +84,13 @@ public class MallCustomerController extends BaseController {
* @return
*/
@GetMapping("/getLoginUserName")
@ApiOperation(value = "注册用户", notes = "添加用户")
@ApiOperation(value = "获取用户信息")
public Result getLoginUserName (HttpServletRequest request) {
// 从session中获取id
try {
MallCustomer mallCustomer = (MallCustomer) SessionUtils.getUserCurrent(request,"mallCustomer");
Long customerId = 1L;
// Long customerId = mallCustomer.getCustomerId();
MallCustomerApiDto mallCustomer = (MallCustomerApiDto) SessionUtils.getUserCurrent(request,"mallCustomer");
// Long customerId = 1L;
Long customerId = mallCustomer.getCustomerId();
MallCustomer user = mallCustomerService.selectByUser(customerId);
return new Result(true, "获取用户信息成功!", StatusCode.OK, user);
}catch (Exception e) {
......@@ -97,7 +100,9 @@ public class MallCustomerController extends BaseController {
}
@PostMapping(value = "/updatePassword")
public Result updatePassword(String oldPassword, String newPassword,HttpServletRequest request) throws Exception {
@ApiModelProperty(value = "密码修改")
public Result updatePassword(@RequestParam(value = "oldPassWard") String oldPassword,
@RequestParam(value = "newPassword")String newPassword,HttpServletRequest request) throws Exception {
// 获取用户信息
MallCustomer mallCustomer = (MallCustomer) getLoginUserName(request).getData();
// 如果密码一致
......
package com.jz.dm.mall.moduls.controller.customer.bean;
import io.swagger.annotations.ApiModel;
/**
* @ClassName: CustomerDto
* @Description: 商城用户返回对象参数
* @Author Bellamy
* @Date 2020/12/9
* @Version 1.0
*/
@ApiModel(value = "商城用户--返回参数对象", description = "返回参数对象")
public class CustomerDto {
/**
* 用户id
*/
private Long customerId;
/**
* 企业id
*/
private Long departmentId;
/**
* 密码
*/
private String password;
/**
* 账户
*/
private String customerAccount;
/**
* 用户真实姓名
*/
private String customerName;
/**
* 联系电话
*/
private String customerPhone;
/**
* 资产账户id
*/
private String assetsId;
public Long getCustomerId() {
return customerId;
}
public void setCustomerId(Long customerId) {
this.customerId = customerId;
}
public Long getDepartmentId() {
return departmentId;
}
public void setDepartmentId(Long departmentId) {
this.departmentId = departmentId;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getCustomerAccount() {
return customerAccount;
}
public void setCustomerAccount(String customerAccount) {
this.customerAccount = customerAccount;
}
public String getCustomerName() {
return customerName;
}
public void setCustomerName(String customerName) {
this.customerName = customerName;
}
public String getCustomerPhone() {
return customerPhone;
}
public void setCustomerPhone(String customerPhone) {
this.customerPhone = customerPhone;
}
public String getAssetsId() {
return assetsId;
}
public void setAssetsId(String assetsId) {
this.assetsId = assetsId;
}
}
......@@ -2,8 +2,17 @@ package com.jz.dm.mall.moduls.controller.goods;
import com.jz.common.base.BaseController;
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.entity.DataGoodsApi;
import com.jz.dm.mall.moduls.service.DataGoodsApiService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
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.RestController;
......@@ -15,6 +24,7 @@ import org.springframework.web.bind.annotation.RestController;
*/
@RestController
@RequestMapping("dataGoodsApi")
@Api("api商品详情")
public class DataGoodsApiController extends BaseController {
/**
* 服务对象
......@@ -22,5 +32,18 @@ public class DataGoodsApiController extends BaseController {
@Autowired
private DataGoodsApiService tDataGoodsApiService;
/**
* 根据主键查询商品详情-api
* @param id
* @return
*/
@GetMapping("/getGoodsDetails/{id}")
@ApiOperation(value = "点击商品查看商品详情", notes = "api商品")
public Result<DataGoodsApiDto> findById(@PathVariable(value = "id") Long id) {
if (id != null) {
DataGoodsApiDto dataGoodsApi = tDataGoodsApiService.selectById(id);
return new Result<DataGoodsApiDto>(true, "查询商品详情成功!", StatusCode.OK, dataGoodsApi);
}
return new Result<>(false, "查询商品详情失败!");
}
}
\ No newline at end of file
......@@ -5,11 +5,13 @@ import com.jz.common.bean.BaseBeanResponse;
import com.jz.common.bean.BaseResponse;
import com.jz.common.bean.PageInfoResponse;
import com.jz.common.constant.Constants;
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.DataGoodsListDto;
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.entity.DataGoods;
import com.jz.dm.mall.moduls.service.DataGoodsService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
......@@ -30,35 +32,37 @@ public class DataGoodsController extends BaseController {
*/
@Autowired
private DataGoodsService dataGoodsService;
/**列表查询数据商品
* @param DataGoodsRequest
/**
* 列表查询商品数据
* @param dataGoodsListRequest
* @param httpRequest
* @return
*/
@PostMapping(value = "/findList")
public PageInfoResponse<DataGoodsDto> findList(@RequestBody DataGoodsRequest DataGoodsRequest, HttpServletRequest httpRequest){
PageInfoResponse<DataGoodsDto> pageInfo = new PageInfoResponse<DataGoodsDto>();
@ApiOperation(value = "分页展示商品列表", notes = "首页点击分类展示商品列表")
public PageInfoResponse<DataGoodsListDto> findByCategory(@RequestBody DataGoodsListRequest dataGoodsListRequest, HttpServletRequest httpRequest) {
PageInfoResponse<DataGoodsListDto> pageInfo = new PageInfoResponse<DataGoodsListDto>();
try {
pageInfo = dataGoodsService.findList(DataGoodsRequest, httpRequest);
pageInfo = dataGoodsService.findList(dataGoodsListRequest, httpRequest);
} catch (Exception e) {
pageInfo.setMessage("查询失败");
pageInfo.setCode(Constants.FAILURE_CODE);
e.printStackTrace();
}
return pageInfo;
}
/**主键查询数据商品
* @param DataGoodsRequest
* @param dataGoodsRequest
* @return
*/
@RequestMapping(method = RequestMethod.POST, value = "/view")
public BaseBeanResponse<DataGoodsDto> view(@RequestBody DataGoodsRequest DataGoodsRequest, HttpServletRequest httpRequest){
public BaseBeanResponse<DataGoodsDto> view(@RequestBody DataGoodsRequest dataGoodsRequest, HttpServletRequest httpRequest){
BaseBeanResponse<DataGoodsDto> baseBeanResponse = new BaseBeanResponse<DataGoodsDto>();
try {
baseBeanResponse = dataGoodsService.findById(DataGoodsRequest, httpRequest);
baseBeanResponse = dataGoodsService.findById(dataGoodsRequest, httpRequest);
} catch (Exception e) {
baseBeanResponse.setMessage("请求失败");
baseBeanResponse.setCode(Constants.FAILURE_CODE);
......@@ -69,14 +73,14 @@ public class DataGoodsController extends BaseController {
}
/**删除数据商品
* @param DataGoodsRequest
* @param dataGoodsRequest
* @return
*/
@RequestMapping(method = RequestMethod.POST, value = "/delete")
public BaseResponse delete(@RequestBody DataGoodsRequest DataGoodsRequest, HttpServletRequest httpRequest){
public BaseResponse delete(@RequestBody DataGoodsRequest dataGoodsRequest, HttpServletRequest httpRequest){
BaseResponse baseResponse = new BaseResponse();
try {
baseResponse = dataGoodsService.deleteById(DataGoodsRequest, httpRequest);
baseResponse = dataGoodsService.deleteById(dataGoodsRequest, httpRequest);
} catch (Exception e) {
baseResponse.setMessage("删除失败");
baseResponse.setCode(Constants.FAILURE_CODE);
......@@ -87,7 +91,7 @@ public class DataGoodsController extends BaseController {
}
/**新增数据商品
* @param DataGoodsRequest
* @param dataGoods
* @return
*/
@RequestMapping(method = RequestMethod.POST, value = "/add")
......@@ -105,7 +109,7 @@ public class DataGoodsController extends BaseController {
}
/**修改数据商品
* @param DataGoodsRequest
* @param dataGoods
* @return
*/
@RequestMapping(method = RequestMethod.POST, value = "/edit")
......@@ -122,10 +126,4 @@ public class DataGoodsController extends BaseController {
return baseBeanResponse;
}
// @PostMapping(value = "/search")
// @ApiOperation(value = "条件查询商品列表")
// public Result<List<DataGoodsRequest>> findList(@RequestBody(required = false) DataGoodsRequest dataGoodsRequest, HttpServletRequest request) {
// dataGoodsService.findList(dataGoodsRequest, request);
// }
}
\ No newline at end of file
package com.jz.dm.mall.moduls.controller.goods;
import com.jz.common.base.BaseController;
import com.jz.common.utils.Result;
import com.jz.common.utils.StatusCode;
import com.jz.dm.mall.moduls.controller.goods.bean.dto.MallHotRecommendGoodsDto;
import com.jz.dm.mall.moduls.service.MallHotRecommendGoodsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* 热门推荐商品(TMallHotRecommendGoods)表控制层
*
* @author Bellamy
* @since 2020-12-01 10:41:40
*/
@RestController
@RequestMapping("mallHotRecommendGoods")
@Api(tags = "热门商品api")
public class MallHotRecommendGoodsController extends BaseController {
/**
* 服务对象
*/
@Autowired
private MallHotRecommendGoodsService tMallHotRecommendGoodsService;
@GetMapping(value = "/popularApi")
@ApiOperation(value = "热门商品api", notes = "热门商品api展示")
public Result<List<MallHotRecommendGoodsDto>> popularApi() {
List<MallHotRecommendGoodsDto> popularApiList = tMallHotRecommendGoodsService.selectByPopularApi();
return new Result<>(true, "查询热门api成功", StatusCode.OK, popularApiList);
}
}
\ No newline at end of file
package com.jz.dm.mall.moduls.controller.goods.bean.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* @ClassName: 商品详情参数封装
* @Author: Carl
* @Date: 2020/12/8
* @Version:
*/
@ApiModel(value = "商品详情--商品详情参数对象", description = "商品详情参数对象")
public class DataGoodsApiDto implements Serializable {
/**
* api商品id
*/
@ApiModelProperty(value = "api商品id")
private Long goodsApi;
/**
* 数据id
*/
@ApiModelProperty(value = "数据id")
private Long dataGoodsId;
/**
* api参数id
*/
@ApiModelProperty(value = "api参数id")
private Long apiParamsId;
/**
* api服务名称
*/
@ApiModelProperty(value = "api服务名称")
private String apiName;
/**
* 请求类型(方式)
*/
@ApiModelProperty(value = "请求类型(方式)")
private String requestType;
/**
* api接口地址
*/
@ApiModelProperty(value = "api接口地址")
private String apiUrl;
/**
* api接口方法
*/
@ApiModelProperty(value = "api接口方法")
private String apiMethod;
/**
* api请求协议
*/
@ApiModelProperty(value = "api请求协议")
private String apiProtocl;
/**
* 返回类型
*/
@ApiModelProperty(value = "返回类型")
private String returnType;
/**
* 更新时间
*/
@ApiModelProperty(value = "更新时间")
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date uptTime;
/**
* 价格类型
*/
@ApiModelProperty(value = "价格类型")
private String priceType;
/**
* 供应商名称
*/
@ApiModelProperty(value = "供应商名称")
private String supplierName;
/**
* 参数分类
*/
@ApiModelProperty(value = "参数分类:01公共参数,02请求参数,03响应参数,04请求头参数,05状态码参数")
private String paramsDiff;
@ApiModelProperty(value = "年(元)")
private BigDecimal yearType;
@ApiModelProperty(value = "季(元)")
private BigDecimal seasonType;
@ApiModelProperty(value = "月(元)")
private BigDecimal monthType;
@ApiModelProperty(value = "次(元)")
private BigDecimal secondType;
/**
* 参数名称
*/
@ApiModelProperty(value = "参数名称")
private String paramsName;
/**
* 参数类型
*/
@ApiModelProperty(value = "参数类型")
private String paramsTYpe;
/**
* 参数描述
*/
@ApiModelProperty(value = "参数描述")
private String paramsDesc;
/**
* 默认值
*/
@ApiModelProperty(value = "默认值")
private String defaultValue;
/**
* 是否必选
*/
@ApiModelProperty(value = "是否必选:Y是,N否")
private String ifRequird;
/**
* 数据类型
*/
@ApiModelProperty(value = "数据类型")
private String dataType;
/**
* api返回数据样例
*/
@ApiModelProperty(value = "api返回数据样例")
private String returnDataExample;
/**
* api请求样例
*/
@ApiModelProperty(value = "api请求样例")
private String requestExample;
public Long getGoodsApi() {
return goodsApi;
}
public void setGoodsApi(Long goodsApi) {
this.goodsApi = goodsApi;
}
public Long getDataGoodsId() {
return dataGoodsId;
}
public void setDataGoodsId(Long dataGoodsId) {
this.dataGoodsId = dataGoodsId;
}
public String getApiName() {
return apiName;
}
public void setApiName(String apiName) {
this.apiName = apiName;
}
public String getRequestType() {
return requestType;
}
public void setRequestType(String requestType) {
this.requestType = requestType;
}
public String getApiUrl() {
return apiUrl;
}
public void setApiUrl(String apiUrl) {
this.apiUrl = apiUrl;
}
public String getApiMethod() {
return apiMethod;
}
public void setApiMethod(String apiMethod) {
this.apiMethod = apiMethod;
}
public String getApiProtocl() {
return apiProtocl;
}
public void setApiProtocl(String apiProtocl) {
this.apiProtocl = apiProtocl;
}
public String getReturnType() {
return returnType;
}
public void setReturnType(String returnType) {
this.returnType = returnType;
}
public Date getUptTime() {
return uptTime;
}
public void setUptTime(Date uptTime) {
this.uptTime = uptTime;
}
public String getPriceType() {
return priceType;
}
public void setPriceType(String priceType) {
this.priceType = priceType;
}
public String getSupplierName() {
return supplierName;
}
public void setSupplierName(String supplierName) {
this.supplierName = supplierName;
}
public String getDataType() {
return dataType;
}
public void setDataType(String dataType) {
this.dataType = dataType;
}
public Long getApiParamsId() {
return apiParamsId;
}
public void setApiParamsId(Long apiParamsId) {
this.apiParamsId = apiParamsId;
}
public String getParamsDiff() {
return paramsDiff;
}
public void setParamsDiff(String paramsDiff) {
this.paramsDiff = paramsDiff;
}
public String getParamsName() {
return paramsName;
}
public void setParamsName(String paramsName) {
this.paramsName = paramsName;
}
public String getParamsTYpe() {
return paramsTYpe;
}
public void setParamsTYpe(String paramsTYpe) {
this.paramsTYpe = paramsTYpe;
}
public String getParamsDesc() {
return paramsDesc;
}
public void setParamsDesc(String paramsDesc) {
this.paramsDesc = paramsDesc;
}
public String getDefaultValue() {
return defaultValue;
}
public void setDefaultValue(String defaultValue) {
this.defaultValue = defaultValue;
}
public String getIfRequird() {
return ifRequird;
}
public void setIfRequird(String ifRequird) {
this.ifRequird = ifRequird;
}
public String getReturnDataExample() {
return returnDataExample;
}
public void setReturnDataExample(String returnDataExample) {
this.returnDataExample = returnDataExample;
}
public String getRequestExample() {
return requestExample;
}
public void setRequestExample(String requestExample) {
this.requestExample = requestExample;
}
}
package com.jz.dm.mall.moduls.controller.goods.bean.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.math.BigDecimal;
/**
* @ClassName: 商品列表返回对象
* @Author: Carl
* @Date: 2020/12/9
* @Version:
*/
@ApiModel(value = "商品列表", description = "商品列表参数对象")
public class DataGoodsListDto {
/**
* 数据商品id
*/
@ApiModelProperty(value = "数据商品id")
private Long dataGoodsId;
/**
* 商品分类id
*/
@ApiModelProperty(value = "商品分类id")
private Long categoryId;
/**
* 数据商品名称
*/
@ApiModelProperty(value = "数据商品名称")
private String dataName;
/**
* 分类名称
*/
@ApiModelProperty(value = "分类名称")
private String categoryName;
/**
* 数据类型
*/
@ApiModelProperty(value = "数据类型:01api,02数据包")
private String dataType;
/**
* 数据商品标签
*/
@ApiModelProperty(value = "数据商品标签")
private String dataLabel;
/**
* 数据商品图片
*/
@ApiModelProperty(value = "数据商品图片")
private String dataPicture;
/**
* 数据商品价格
*/
@ApiModelProperty(value = "数据商品价格")
private String dataPrice;
/**
* 价格类型
*/
@ApiModelProperty(value = "价格类型")
private String priceType;
/**
* 年(元)
*/
@ApiModelProperty(value = "年(元)")
private BigDecimal yearType;
/**
* 季(元)
*/
@ApiModelProperty(value = "季(元)")
private BigDecimal seasonType;
/**
* 月(元)
*/
@ApiModelProperty(value = "月(元)")
private BigDecimal monthType;
/**
* 次(元)
*/
@ApiModelProperty(value = "次(元)")
private BigDecimal secondType;
public Long getDataGoodsId() {
return dataGoodsId;
}
public void setDataGoodsId(Long dataGoodsId) {
this.dataGoodsId = dataGoodsId;
}
public Long getCategoryId() {
return categoryId;
}
public void setCategoryId(Long categoryId) {
this.categoryId = categoryId;
}
public String getDataName() {
return dataName;
}
public void setDataName(String dataName) {
this.dataName = dataName;
}
public String getCategoryName() {
return categoryName;
}
public void setCategoryName(String categoryName) {
this.categoryName = categoryName;
}
public String getDataType() {
return dataType;
}
public void setDataType(String dataType) {
this.dataType = dataType;
}
public String getDataLabel() {
return dataLabel;
}
public void setDataLabel(String dataLabel) {
this.dataLabel = dataLabel;
}
public String getDataPicture() {
return dataPicture;
}
public void setDataPicture(String dataPicture) {
this.dataPicture = dataPicture;
}
public String getDataPrice() {
return dataPrice;
}
public void setDataPrice(String dataPrice) {
this.dataPrice = dataPrice;
}
public String getPriceType() {
return priceType;
}
public void setPriceType(String priceType) {
this.priceType = priceType;
}
public BigDecimal getYearType() {
return yearType;
}
public void setYearType(BigDecimal yearType) {
this.yearType = yearType;
}
public BigDecimal getSeasonType() {
return seasonType;
}
public void setSeasonType(BigDecimal seasonType) {
this.seasonType = seasonType;
}
public BigDecimal getMonthType() {
return monthType;
}
public void setMonthType(BigDecimal monthType) {
this.monthType = monthType;
}
public BigDecimal getSecondType() {
return secondType;
}
public void setSecondType(BigDecimal secondType) {
this.secondType = secondType;
}
}
package com.jz.dm.mall.moduls.controller.goods.bean.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
/**
* @ClassName:
* @Author: Carl
* @Date: 2020/12/9
* @Version:
*/
@ApiModel("热门商品api")
public class MallHotRecommendGoodsDto implements Serializable {
@ApiModelProperty(value = "数据商品id")
private Long dataGoodsId;
@ApiModelProperty(value = "数据商品名称")
private String dataName;
@ApiModelProperty(value = "数据商品类型")
private String dataType;
@ApiModelProperty(value = "数据商品标签")
private String dataLabel;
@ApiModelProperty(value = "数据商品图片")
private String dataPicture;
@ApiModelProperty(value = "数据商品价格")
private String dataPrice;
@ApiModelProperty(value = "优惠价格")
private String discountPrice;
@ApiModelProperty(value = "用户使用人数")
private Long usePerson;
public Long getDataGoodsId() {
return dataGoodsId;
}
public void setDataGoodsId(Long dataGoodsId) {
this.dataGoodsId = dataGoodsId;
}
public String getDataName() {
return dataName;
}
public void setDataName(String dataName) {
this.dataName = dataName;
}
public String getDataType() {
return dataType;
}
public void setDataType(String dataType) {
this.dataType = dataType;
}
public String getDataLabel() {
return dataLabel;
}
public void setDataLabel(String dataLabel) {
this.dataLabel = dataLabel;
}
public String getDataPicture() {
return dataPicture;
}
public void setDataPicture(String dataPicture) {
this.dataPicture = dataPicture;
}
public String getDataPrice() {
return dataPrice;
}
public void setDataPrice(String dataPrice) {
this.dataPrice = dataPrice;
}
public String getDiscountPrice() {
return discountPrice;
}
public void setDiscountPrice(String discountPrice) {
this.discountPrice = discountPrice;
}
public Long getUsePerson() {
return usePerson;
}
public void setUsePerson(Long usePerson) {
this.usePerson = usePerson;
}
}
package com.jz.dm.mall.moduls.controller.goods.bean.request;
import com.jz.common.bean.BasePageBean;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
/**
* @ClassName:
* @Author: Carl
* @Date: 2020/12/9
* @Version:
*/
@ApiModel(value = "数据集市--数据商品列表参数对象", description = "数据商品列表参数对象")
public class DataGoodsListRequest extends BasePageBean {
/**
* 商品分类id
*/
@ApiModelProperty(value = "商品分类id")
private Long categoryId;
/**
* 价格类型
*/
@ApiModelProperty(value = "价格类型")
private String priceType;
/**
* 综合排序
*/
@ApiModelProperty(value = "综合排序")
private String synthesizeRank;
/**
* 更新时间
*/
@ApiModelProperty(value = "更新时间")
private Date uptTime;
/**
* 数据商品名称
*/
@ApiModelProperty(value = "数据商品名称")
private String dataName;
/**
* 使用人数
*/
@ApiModelProperty(value = "使用人数")
private Long usePerson;
/**
* 数据类型
*/
@ApiModelProperty(value = "数据类型:01api,02数据包")
private String dataType;
public Long getUsePerson() {
return usePerson;
}
public void setUsePerson(Long usePerson) {
this.usePerson = usePerson;
}
public Long getCategoryId() {
return categoryId;
}
public void setCategoryId(Long categoryId) {
this.categoryId = categoryId;
}
public String getPriceType() {
return priceType;
}
public void setPriceType(String priceType) {
this.priceType = priceType;
}
public String getSynthesizeRank() {
return synthesizeRank;
}
public void setSynthesizeRank(String synthesizeRank) {
this.synthesizeRank = synthesizeRank;
}
public Date getUptTime() {
return uptTime;
}
public void setUptTime(Date uptTime) {
this.uptTime = uptTime;
}
public String getDataName() {
return dataName;
}
public void setDataName(String dataName) {
this.dataName = dataName;
}
public String getDataType() {
return dataType;
}
public void setDataType(String dataType) {
this.dataType = dataType;
}
}
package com.jz.dm.mall.moduls.controller.goods.bean.request;
import com.jz.common.bean.BasePageBean;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.math.BigDecimal;
import java.util.Date;
......@@ -9,150 +11,180 @@ import java.util.Date;
* @author ybz
*
*/
@ApiModel(value = "数据集市--数据商品参数对象", description = "数据商品参数对象")
public class DataGoodsRequest extends BasePageBean {
/**
* 数据商品id
*/
@ApiModelProperty(value = "数据商品id")
private Long dataGoodsId;
/**
* 商品分类id(行业)
*/
@ApiModelProperty(value = "商品分类id(行业)")
private Long categoryId;
/**
* 数据商户id
*/
@ApiModelProperty(value = "数据商户id")
private Long userId;
/**
* 数据商品名称
*/
@ApiModelProperty(value = "数据商品名称")
private String dataName;
/**
* 数据类型:01api,02数据包
*/
@ApiModelProperty(value = "数据类型")
private String dataType;
/**
* 数据商品标签
*/
@ApiModelProperty(value = "数据商品标签")
private String dataLabel;
/**
* 数据商品图片
*/
@ApiModelProperty(value = "数据商品图片")
private String dataPicture;
/**
* 数据商品价格
*/
@ApiModelProperty(value = "数据商品价格")
private BigDecimal dataPrice;
/**
* 优惠价格
*/
@ApiModelProperty(value = "优惠价格")
private BigDecimal discountPrice;
/**
* 价格类型:01免费,02收费
*/
@ApiModelProperty(value = "价格类型")
private String priceType;
/**
* 商品规格
*/
@ApiModelProperty(value = "商品规格")
private String goodsStandards;
/**
* 数据状态:01预售,02在售中,03下架,04上架
*/
@ApiModelProperty(value = "数据状态")
private String dataStatus;
/**
* 审核状态:01待审核,02已审核,03未通过
*/
@ApiModelProperty(value = "审核状态")
private String auditStatus;
/**
* 清洗规则(脱敏校验)
*/
@ApiModelProperty(value = "清洗规则")
private String cleanRule;
/**
* 驳回原因
*/
@ApiModelProperty(value = "驳回原因")
private String rejectReason;
/**
* 审核人
*/
@ApiModelProperty(value = "审核人")
private String auditPerson;
/**
* 审核时间起
*/
@ApiModelProperty(value = "审核时间起")
private Date auditTimeStart;
/**
* 审核时间止
*/
@ApiModelProperty(value = "审核时间止")
private Date auditTimeEnd;
/**
* 创建时间起
*/
@ApiModelProperty(value = "创建时间起")
private Date creTimeStart;
/**
* 创建时间止
*/
@ApiModelProperty(value = "创建时间止")
private Date creTimeEnd;
/**
* 创建人
*/
@ApiModelProperty(value = "创建人")
private String crePerson;
/**
* 更新时间起
*/
@ApiModelProperty(value = "更新时间起")
private Date uptTimeStart;
/**
* 更新时间止
*/
@ApiModelProperty(value = "更新时间止")
private Date uptTimeEnd;
/**
* 更新人
*/
@ApiModelProperty(value = "更新人")
private String uptPerson;
/**
* 删除标识
*/
@ApiModelProperty(value = "删除标识")
private String delFlag;
/**
* 年(元)
*/
@ApiModelProperty(value = "年(元)")
private BigDecimal yearType;
/**
* 季(元)
*/
@ApiModelProperty(value = "季(元)")
private BigDecimal seasonType;
/**
* 月(元)
*/
@ApiModelProperty(value = "月(元)")
private BigDecimal monthType;
/**
* 次(元)
*/
@ApiModelProperty(value = "次(元)")
private BigDecimal secondType;
public Long getDataGoodsId() {
......
......@@ -102,6 +102,10 @@ public class OrderDto {
*/
@ApiModelProperty(value = "失效日期")
private Date invalidTime;
@ApiModelProperty(value = "有效期")
private String indate;
/**
* 价格类型:01免费,02收费
*/
......@@ -137,6 +141,13 @@ public class OrderDto {
@ApiModelProperty(value = "数据分类")
private String dataType;
public String getIndate() {
return indate;
}
public void setIndate(String indate) {
this.indate = indate;
}
public Long getOrderId() {
return orderId;
......@@ -337,4 +348,5 @@ public class OrderDto {
public void setDataType(String dataType) {
this.dataType = dataType;
}
}
\ No newline at end of file
package com.jz.dm.mall.moduls.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import java.io.Serializable;
import java.util.Date;
/**
* 热门推荐商品(TMallHotRecommendGoods)实体类
*
* @author Bellamy
* @since 2020-12-01 10:41:40
*/
@TableName("t_mall_hot_recommend_goods")
@ApiModel
public class MallHotRecommendGoods implements Serializable {
private static final long serialVersionUID = -35734333969077853L;
/**
* 热门推荐商品id
*/
private Long hotRecommendGoods;
/**
* 数据id
*/
private Long dataGoodsId;
/**
* 用户id
*/
private Long customerId;
/**
* 删除标识:Y是,N否
*/
private String delFlag;
/**
* 创建时间
*/
private Date creTime;
public Long getHotRecommendGoods() {
return hotRecommendGoods;
}
public void setHotRecommendGoods(Long hotRecommendGoods) {
this.hotRecommendGoods = hotRecommendGoods;
}
public Long getDataGoodsId() {
return dataGoodsId;
}
public void setDataGoodsId(Long dataGoodsId) {
this.dataGoodsId = dataGoodsId;
}
public Long getCustomerId() {
return customerId;
}
public void setCustomerId(Long customerId) {
this.customerId = customerId;
}
public String getDelFlag() {
return delFlag;
}
public void setDelFlag(String delFlag) {
this.delFlag = delFlag;
}
public Date getCreTime() {
return creTime;
}
public void setCreTime(Date creTime) {
this.creTime = creTime;
}
}
\ No newline at end of file
package com.jz.dm.mall.moduls.mapper;
import com.jz.common.base.BaseMapper;
import com.jz.common.entity.DataGoodsApi;
import com.jz.dm.mall.moduls.controller.goods.bean.dto.DataGoodsApiDto;
import com.jz.dm.mall.moduls.entity.DataGoodsApi;
import org.apache.ibatis.annotations.Param;
/**
* api商品(TDataGoodsApi)表数据库访问层
......@@ -11,6 +14,11 @@ import com.jz.common.entity.DataGoodsApi;
*/
public interface DataGoodsApiDao extends BaseMapper<DataGoodsApi> {
/**
* 根据主键查询商品详情
* @param id
* @return
*/
DataGoodsApiDto selectById(@Param("goodsApi") Long id);
}
\ No newline at end of file
......@@ -6,6 +6,7 @@ import java.util.Map;
import com.jz.common.base.BaseMapper;
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.entity.DataGoods;
......@@ -57,7 +58,7 @@ public interface DataGoodsDao extends BaseMapper<DataGoods> {
* @return
* @throws Exception
*/
public List<DataGoodsDto> findList(Map<String, Object> param)throws Exception;
public List<DataGoodsListDto> findList(Map<String, Object> param)throws Exception;
/**主键查询数据商品
* @param DataGoodsId
......
package com.jz.dm.mall.moduls.mapper;
import com.jz.common.base.BaseMapper;
import com.jz.dm.mall.moduls.controller.customer.bean.CustomerDto;
import com.jz.dm.mall.moduls.entity.MallCustomer;
import org.apache.ibatis.annotations.*;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
......@@ -20,7 +20,7 @@ public interface MallCustomerDao extends BaseMapper<MallCustomer> {
* @param username
* @return
*/
MallCustomer selectByAccount(String username);
CustomerDto selectByAccount(String username);
/**
......@@ -28,7 +28,7 @@ public interface MallCustomerDao extends BaseMapper<MallCustomer> {
* @param username
* @return
*/
MallCustomer selectByPhone(String username);
CustomerDto selectByPhone(String username);
/**
* 根据手机号查询是否已注册
......@@ -54,7 +54,10 @@ public interface MallCustomerDao extends BaseMapper<MallCustomer> {
MallCustomer findById(@Param("customerId") Long customerId);
/**
* 修改密码
* @param map
*/
void updatePassword(Map map);
MallCustomer selectByCustomerId(Long customerId);
}
\ No newline at end of file
package com.jz.dm.mall.moduls.mapper;
import com.jz.common.base.BaseMapper;
import com.jz.dm.mall.moduls.controller.goods.bean.dto.MallHotRecommendGoodsDto;
import com.jz.dm.mall.moduls.entity.MallHotRecommendGoods;
import java.util.List;
/**
* 热门推荐商品(TMallHotRecommendGoods)表数据库访问层
*
* @author Bellamy
* @since 2020-12-01 10:41:40
*/
public interface MallHotRecommendGoodsDao extends BaseMapper<MallHotRecommendGoods> {
List<MallHotRecommendGoodsDto> selectByPopularApi();
}
\ No newline at end of file
package com.jz.dm.mall.moduls.service;
import com.jz.dm.mall.moduls.controller.goods.bean.dto.DataGoodsApiDto;
/**
* api商品(TDataGoodsApi)表服务接口
*
......@@ -8,5 +11,10 @@ package com.jz.dm.mall.moduls.service;
*/
public interface DataGoodsApiService {
/**
* 根据主键查询商品api详情
* @param id
* @return
*/
DataGoodsApiDto selectById(Long id);
}
\ No newline at end of file
......@@ -5,6 +5,8 @@ import com.jz.common.bean.BaseResponse;
import com.jz.common.bean.PageInfoResponse;
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.request.DataGoodsListRequest;
import com.jz.dm.mall.moduls.controller.goods.bean.request.DataGoodsRequest;
import com.jz.dm.mall.moduls.entity.DataGoods;
......@@ -21,12 +23,12 @@ public interface DataGoodsService {
/**条件查询所有数据商品
* @param DataGoodsRequest
* @param dataGoodsListRequest
* @param httpRequest
* @return
* @throws Exception
*/
public PageInfoResponse<DataGoodsDto> findList(DataGoodsRequest dataGoodsRequest, HttpServletRequest httpRequest)throws Exception;
public PageInfoResponse<DataGoodsListDto> findList(DataGoodsListRequest dataGoodsListRequest, HttpServletRequest httpRequest)throws Exception;
/**新增数据商品
......@@ -61,6 +63,4 @@ public interface DataGoodsService {
*/
public BaseResponse deleteById(DataGoodsRequest dataGoodsRequest, HttpServletRequest httpRequest)throws Exception;
}
\ No newline at end of file
package com.jz.dm.mall.moduls.service;
import com.jz.dm.mall.moduls.controller.customer.bean.CustomerDto;
import com.jz.dm.mall.moduls.entity.MallCustomer;
import org.apache.ibatis.annotations.Param;
import javax.servlet.http.HttpServletRequest;
import java.util.Map;
......@@ -19,14 +19,14 @@ public interface MallCustomerService {
* @param username
* @return
*/
MallCustomer selectByAccount(String username,HttpServletRequest request);
CustomerDto selectByAccount(String username,HttpServletRequest request);
/**
* 通过手机号进行查询
* @param username
* @return
*/
MallCustomer selectByPhone(String username, HttpServletRequest request);
CustomerDto selectByPhone(String username, HttpServletRequest request);
/**
* 注册账号
......
package com.jz.dm.mall.moduls.service;
import com.jz.dm.mall.moduls.controller.goods.bean.dto.MallHotRecommendGoodsDto;
import java.util.List;
/**
* 热门推荐商品(TMallHotRecommendGoods)表服务接口
*
* @author Bellamy
* @since 2020-12-01 10:41:40
*/
public interface MallHotRecommendGoodsService {
/**
* 查询热门api数据
* @return
*/
List<MallHotRecommendGoodsDto> selectByPopularApi();
}
\ No newline at end of file
package com.jz.dm.mall.moduls.service.impl;
import com.jz.common.enums.PriceTypeEnum;
import com.jz.dm.mall.moduls.controller.goods.bean.dto.DataGoodsApiDto;
import com.jz.dm.mall.moduls.entity.DataGoodsApi;
import com.jz.dm.mall.moduls.mapper.DataGoodsApiDao;
import com.jz.dm.mall.moduls.service.DataGoodsApiService;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -17,4 +20,16 @@ public class DataGoodsApiServiceImpl implements DataGoodsApiService {
@Autowired
private DataGoodsApiDao tDataGoodsApiDao;
/**
* 根据主键查询商品api详情
*
* @param id
* @return
*/
@Override
public DataGoodsApiDto selectById(Long id) {
DataGoodsApiDto dataGoodsApiDto = tDataGoodsApiDao.selectById(id);
return dataGoodsApiDto;
}
}
\ No newline at end of file
......@@ -8,6 +8,8 @@ import com.jz.common.bean.PageInfoResponse;
import com.jz.common.constant.Constants;
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.request.DataGoodsListRequest;
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.mapper.DataGoodsDao;
......@@ -35,131 +37,44 @@ public class DataGoodsServiceImpl implements DataGoodsService {
private DataGoodsDao dataGoodsDao;
@Override
public PageInfoResponse<DataGoodsDto> findList(DataGoodsRequest dataGoodsRequest, HttpServletRequest httpRequest)
public PageInfoResponse<DataGoodsListDto> findList(DataGoodsListRequest dataGoodsListRequest, HttpServletRequest httpRequest)
throws Exception {
PageInfoResponse<DataGoodsDto> pageInfoResponse = new PageInfoResponse<>();
PageInfoResponse<DataGoodsListDto> pageInfoResponse = new PageInfoResponse<>();
Map<String, Object> param = new HashMap<>();
//数据商品id
if (dataGoodsRequest.getDataGoodsId() != null) {
param.put("dataGoodsId", dataGoodsRequest.getDataGoodsId());
}
//商品分类id(行业)
if (dataGoodsRequest.getCategoryId() != null) {
param.put("categoryId", dataGoodsRequest.getCategoryId());
}
//数据商户id
if (dataGoodsRequest.getUserId() != null) {
param.put("userId", dataGoodsRequest.getUserId());
if (dataGoodsListRequest.getCategoryId() != null) {
param.put("categoryId", dataGoodsListRequest.getCategoryId());
}
//数据商品名称
if (!StringUtils.isEmpty(dataGoodsRequest.getDataName())) {
param.put("dataName", dataGoodsRequest.getDataName());
if (!StringUtils.isEmpty(dataGoodsListRequest.getDataName())) {
param.put("dataName", dataGoodsListRequest.getDataName());
}
//数据类型:01api,02数据包
if (!StringUtils.isEmpty(dataGoodsRequest.getDataType())) {
param.put("dataType", dataGoodsRequest.getDataType());
}
//数据商品标签
if (!StringUtils.isEmpty(dataGoodsRequest.getDataLabel())) {
param.put("dataLabel", dataGoodsRequest.getDataLabel());
}
//数据商品图片
if (!StringUtils.isEmpty(dataGoodsRequest.getDataPicture())) {
param.put("dataPicture", dataGoodsRequest.getDataPicture());
}
//数据商品价格
if (dataGoodsRequest.getDataPrice() != null) {
param.put("dataPrice", dataGoodsRequest.getDataPrice());
}
//优惠价格
if (dataGoodsRequest.getDiscountPrice() != null) {
param.put("discountPrice", dataGoodsRequest.getDiscountPrice());
if (!StringUtils.isEmpty(dataGoodsListRequest.getDataType())) {
param.put("dataType", dataGoodsListRequest.getDataType());
}
//价格类型:01免费,02收费
if (!StringUtils.isEmpty(dataGoodsRequest.getPriceType())) {
param.put("priceType", dataGoodsRequest.getPriceType());
}
//商品规格
if (!StringUtils.isEmpty(dataGoodsRequest.getGoodsStandards())) {
param.put("goodsStandards", dataGoodsRequest.getGoodsStandards());
}
//数据状态:01预售,02在售中,03下架,04上架
if (!StringUtils.isEmpty(dataGoodsRequest.getDataStatus())) {
param.put("dataStatus", dataGoodsRequest.getDataStatus());
}
//审核状态:01待审核,02已审核,03未通过
if (!StringUtils.isEmpty(dataGoodsRequest.getAuditStatus())) {
param.put("auditStatus", dataGoodsRequest.getAuditStatus());
}
//清洗规则(脱敏校验)
if (!StringUtils.isEmpty(dataGoodsRequest.getCleanRule())) {
param.put("cleanRule", dataGoodsRequest.getCleanRule());
}
//驳回原因
if (!StringUtils.isEmpty(dataGoodsRequest.getRejectReason())) {
param.put("rejectReason", dataGoodsRequest.getRejectReason());
}
//审核人
if (!StringUtils.isEmpty(dataGoodsRequest.getAuditPerson())) {
param.put("auditPerson", dataGoodsRequest.getAuditPerson());
}
//审核时间起
if (dataGoodsRequest.getAuditTimeStart() != null) {
param.put("auditTimeStart", dataGoodsRequest.getAuditTimeStart());
if (!StringUtils.isEmpty(dataGoodsListRequest.getPriceType())) {
param.put("priceType", dataGoodsListRequest.getPriceType());
}
//审核时间止
if (dataGoodsRequest.getAuditTimeEnd() != null) {
param.put("auditTimeEnd", dataGoodsRequest.getAuditTimeEnd());
}
//创建时间起
if (dataGoodsRequest.getCreTimeStart() != null) {
param.put("creTimeStart", dataGoodsRequest.getCreTimeStart());
}
//创建时间止
if (dataGoodsRequest.getCreTimeEnd() != null) {
param.put("creTimeEnd", dataGoodsRequest.getCreTimeEnd());
}
//创建人
if (!StringUtils.isEmpty(dataGoodsRequest.getCrePerson())) {
param.put("crePerson", dataGoodsRequest.getCrePerson());
}
//更新时间起
if (dataGoodsRequest.getUptTimeStart() != null) {
param.put("uptTimeStart", dataGoodsRequest.getUptTimeStart());
}
//更新时间止
if (dataGoodsRequest.getUptTimeEnd() != null) {
param.put("uptTimeEnd", dataGoodsRequest.getUptTimeEnd());
}
//更新人
if (!StringUtils.isEmpty(dataGoodsRequest.getUptPerson())) {
param.put("uptPerson", dataGoodsRequest.getUptPerson());
}
//删除标识
if (!StringUtils.isEmpty(dataGoodsRequest.getDelFlag())) {
param.put("delFlag", dataGoodsRequest.getDelFlag());
}
//年(元)
if (dataGoodsRequest.getYearType() != null) {
param.put("yearType", dataGoodsRequest.getYearType());
}
//季(元)
if (dataGoodsRequest.getSeasonType() != null) {
param.put("seasonType", dataGoodsRequest.getSeasonType());
//更新时间排序
if (dataGoodsListRequest.getUptTime() != null) {
param.put("uptTime", dataGoodsListRequest.getUptTime());
}
//月(元)
if (dataGoodsRequest.getMonthType() != null) {
param.put("monthType", dataGoodsRequest.getMonthType());
// 使用人数
if (dataGoodsListRequest.getUsePerson() != null) {
param.put("usePerson", dataGoodsListRequest.getUsePerson());
}
//次(元)
if (dataGoodsRequest.getSecondType() != null) {
param.put("secondType", dataGoodsRequest.getSecondType());
// 综合排序
if (dataGoodsListRequest.getSynthesizeRank() != null) {
param.put("synthesizeRank", dataGoodsListRequest.getSynthesizeRank());
}
PageHelper.startPage(dataGoodsRequest.getPageNum(), dataGoodsRequest.getPageSize());
List<DataGoodsDto> list = dataGoodsDao.findList(param);
PageInfo<DataGoodsDto> pageInfo = new PageInfo<>(list);
PageHelper.startPage(dataGoodsListRequest.getPageNum(), dataGoodsListRequest.getPageSize());
List<DataGoodsListDto> list = dataGoodsDao.findList(param);
PageInfo<DataGoodsListDto> pageInfo = new PageInfo<>(list);
pageInfoResponse.setCode(Constants.SUCCESS_CODE);
pageInfoResponse.setMessage("查询成功");
......@@ -247,4 +162,5 @@ public class DataGoodsServiceImpl implements DataGoodsService {
return baseResponse;
}
}
\ No newline at end of file
package com.jz.dm.mall.moduls.service.impl;
import com.jz.common.bean.MallCustomerApiDto;
import com.jz.common.constant.RedisMessageConstant;
import com.jz.common.enums.UserTypeEnum;
import com.jz.common.utils.DateUtils;
import com.jz.common.utils.Result;
import com.jz.common.utils.SessionUtils;
import com.jz.common.bean.MallCustomerApiDto;
import com.jz.dm.mall.moduls.controller.customer.bean.CustomerDto;
import com.jz.dm.mall.moduls.entity.MallCustomer;
import com.jz.dm.mall.moduls.mapper.MallCustomerDao;
import com.jz.dm.mall.moduls.service.MallCustomerService;
import freemarker.template.utility.DateUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletRequest;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.TimeUnit;
......@@ -44,8 +41,8 @@ public class MallCustomerServiceImpl implements MallCustomerService {
* @return
*/
@Override
public MallCustomer selectByAccount(String username, HttpServletRequest request) {
MallCustomer mallCustomer = tMallCustomerDao.selectByAccount(username);
public CustomerDto selectByAccount(String username, HttpServletRequest request) {
CustomerDto mallCustomer = tMallCustomerDao.selectByAccount(username);
// String customer = JSON.toJSONString(mallCustomer);
if (mallCustomer != null) {
......@@ -56,10 +53,11 @@ public class MallCustomerServiceImpl implements MallCustomerService {
mallCustomerApiDto.setUserTypeEnum(UserTypeEnum.COMPANY_ROLE);
mallCustomerApiDto.setCustomerAccount(mallCustomer.getCustomerAccount());
mallCustomerApiDto.setCustomerName(mallCustomer.getCustomerName());
mallCustomerApiDto.setAssetsId(mallCustomer.getAssetsId());
// 存入到session
request.getSession().setAttribute("mallCustomer", mallCustomerApiDto);
// 存入到redis
redisTemplate.opsForValue().set("user_" + RedisMessageConstant.SENDTYPE_LOGIN_CUSTOMER , mallCustomerApiDto, 3, TimeUnit.DAYS);
// redisTemplate.opsForValue().set("user_" + RedisMessageConstant.SENDTYPE_LOGIN_CUSTOMER, mallCustomerApiDto, 3, TimeUnit.DAYS);
}
return mallCustomer;
}
......@@ -71,8 +69,8 @@ public class MallCustomerServiceImpl implements MallCustomerService {
* @return
*/
@Override
public MallCustomer selectByPhone(String username, HttpServletRequest request) {
MallCustomer mallCustomer = tMallCustomerDao.selectByPhone(username);
public CustomerDto selectByPhone(String username, HttpServletRequest request) {
CustomerDto mallCustomer = tMallCustomerDao.selectByPhone(username);
if (mallCustomer != null) {
MallCustomerApiDto mallCustomerApiDto = new MallCustomerApiDto();
// 赋值
......@@ -81,10 +79,11 @@ public class MallCustomerServiceImpl implements MallCustomerService {
mallCustomerApiDto.setUserTypeEnum(UserTypeEnum.COMPANY_ROLE);
mallCustomerApiDto.setCustomerAccount(mallCustomer.getCustomerAccount());
mallCustomerApiDto.setCustomerName(mallCustomer.getCustomerName());
mallCustomerApiDto.setAssetsId(mallCustomer.getAssetsId());
// 存入到session
SessionUtils.setUserCurrent("mallCustomer", mallCustomerApiDto, request);
request.getSession().setAttribute("mallCustomer", mallCustomerApiDto);
// 存入到redis
redisTemplate.opsForValue().set("user_" + RedisMessageConstant.SENDTYPE_LOGIN_CUSTOMER , mallCustomerApiDto, 3, TimeUnit.DAYS);
//redisTemplate.opsForValue().set("user_" + RedisMessageConstant.SENDTYPE_LOGIN_CUSTOMER, mallCustomerApiDto, 3, TimeUnit.DAYS);
}
return mallCustomer;
}
......@@ -139,7 +138,7 @@ public class MallCustomerServiceImpl implements MallCustomerService {
*/
@Override
public void updatePassword(Long customerId, String password) {
MallCustomer mallCustomer = tMallCustomerDao.selectByCustomerId(customerId);
MallCustomer mallCustomer = tMallCustomerDao.findById(customerId);
if (mallCustomer != null) {
Map map = new HashMap();
map.put("password", password);
......@@ -156,7 +155,7 @@ public class MallCustomerServiceImpl implements MallCustomerService {
*/
@Override
public MallCustomer selectByUser(Long customerId) {
MallCustomer mallCustomer = tMallCustomerDao.selectByCustomerId(customerId);
MallCustomer mallCustomer = tMallCustomerDao.findById(customerId);
return mallCustomer;
}
......
package com.jz.dm.mall.moduls.service.impl;
import com.jz.dm.mall.moduls.controller.goods.bean.dto.MallHotRecommendGoodsDto;
import com.jz.dm.mall.moduls.mapper.MallHotRecommendGoodsDao;
import com.jz.dm.mall.moduls.service.MallHotRecommendGoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 热门推荐商品(TMallHotRecommendGoods)表服务实现类
*
* @author Bellamy
* @since 2020-12-01 10:41:40
*/
@Service("mallHotRecommendGoodsService")
public class MallHotRecommendGoodsServiceImpl implements MallHotRecommendGoodsService {
@Autowired
private MallHotRecommendGoodsDao tMallHotRecommendGoodsDao;
/**
* 查询热门api数据
*
* @return
*/
@Override
public List<MallHotRecommendGoodsDto> selectByPopularApi() {
List<MallHotRecommendGoodsDto> popularApiList = tMallHotRecommendGoodsDao.selectByPopularApi();
return popularApiList;
}
}
\ No newline at end of file
......@@ -4,6 +4,7 @@ import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.jz.common.bean.PageInfoResponse;
import com.jz.common.constant.Constants;
import com.jz.common.utils.DateUtils;
import com.jz.dm.mall.moduls.controller.order.bean.*;
import com.jz.dm.mall.moduls.mapper.OrderDao;
import com.jz.dm.mall.moduls.service.OrderService;
......@@ -13,6 +14,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletRequest;
import java.text.SimpleDateFormat;
import java.util.*;
/**
......@@ -71,14 +73,10 @@ public class OrderServiceImpl implements OrderService {
if (StringUtils.isNotEmpty(orderId)) {
orderDto = orderDao.getOrderDetail(orderId);
if (orderDto != null) {
/*SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
long effectTimes = orderDto.getTakeEffectTime().getTime(); //开始生效日期
long invalidTimes = orderDto.getInvalidTime().getTime(); //有效结束日期
long syTime = invalidTimes - effectTimes; //有效时间毫秒数
Date mtime = new Date(syTime);
int month = mtime.getMonth();*/
//getEffectTime(orderDto.getTakeEffectTime(), orderDto.getInvalidTime());
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date endTime = orderDto.getInvalidTime();
String indate = DateUtils.getTime(endTime, DateUtils.getToday());
orderDto.setIndate(indate);
}
}
return orderDto;
......@@ -101,34 +99,4 @@ public class OrderServiceImpl implements OrderService {
return returnMap;
}
public void getEffectTime(Date takeEffectTime, Date invalidTime) {
Calendar startTime = Calendar.getInstance();
startTime.setTime(takeEffectTime); //开始日期
Calendar endCalendar = Calendar.getInstance();
endCalendar.setTime(invalidTime); //结束日期
int hour = endCalendar.get(Calendar.HOUR_OF_DAY) - startTime.get(Calendar.HOUR_OF_DAY);
int day = endCalendar.get(Calendar.DAY_OF_MONTH) - startTime.get(Calendar.DAY_OF_MONTH);
int month = endCalendar.get(Calendar.MONTH) - startTime.get(Calendar.MONTH);
int year = endCalendar.get(Calendar.YEAR) - startTime.get(Calendar.YEAR);
// 按照减法原理,先day相减,不够向month借;然后month相减,不够向year借;最后year相减。
if (day < 0) {
month -= 1;
endCalendar.add(Calendar.MONTH, -1);// 得到上一个月,用来得到上个月的天数。
day = day + endCalendar.getActualMaximum(Calendar.DAY_OF_MONTH);
}
if (month < 0) {
month = (month + 12) % 12;
year--;
}
System.out.println("结果:" + year + "年" + month + "月" + day + "天");
/*for (int i = 0; i < month; i++) {
endCalendar.add(Calendar.MONTH, -1);// 得到上一个月,用来得到上个月的天数。
day = day + endCalendar.getActualMaximum(Calendar.DAY_OF_MONTH);
}
System.out.println("过去时间与现在有:" + year + "年" + "" + day + "天");*/
}
}
\ No newline at end of file
......@@ -21,6 +21,42 @@
<result property="delFlag" column="del_flag" jdbcType="VARCHAR"/>
</resultMap>
<!--根据主键查询商品详情-->
<select id="selectById" parameterType="map" resultType="com.jz.dm.mall.moduls.controller.goods.bean.dto.DataGoodsApiDto">
SELECT
t1.goods_api AS goodsApi,
t1.data_goods_id AS dataGoodsId,
t1.api_name AS apiName,
t1.request_type AS requestType,
t1.api_url AS apiUrl,
t1.api_method AS apiMethod,
t1.api_protocl AS apiProtocl,
t1.return_type AS returnType,
t1.upt_time AS uptTime,
t1.return_data_example AS returnDataExample,
t1.request_example AS requestExample,
t3.supplier_name AS supplierName,
t4.api_params_id AS apiParamsId,
t4.params_name AS paramsName,
t4.params_type AS paramsType,
t4.params_desc AS paramsDesc,
t4.if_requird AS ifRequird,
t4.default_value AS defaultValue,
t2.year_type as yearType,
t2.season_type as seasonType,
t2.month_type as monthType,
t2.second_type as secondType,
( CASE WHEN t2.data_type = '01' THEN 'api' WHEN t2.data_type = '02' THEN '数据包' END ) AS dataType,
( CASE WHEN t2.price_type = '01' THEN '免费' WHEN t2.price_type = '02' THEN '收费' END ) AS priceType,
( CASE WHEN t4.params_diff = '01' THEN '公共参数' WHEN t4.params_diff = '02' THEN '请求参数' WHEN t4.params_diff = '03' THEN '响应参数' WHEN t4.params_diff = '04' THEN '请求头参数' WHEN t4.params_diff = '05' THEN '状态码参数' end ) AS paramsDiff
FROM
t_data_goods_api t1
INNER JOIN t_data_goods t2 ON t1.data_goods_id = t2.data_goods_id
INNER JOIN t_sys_user t3 ON t3.user_id = t2.user_id
INNER JOIN t_data_goods_api_params t4 ON t4.goods_api = t1.goods_api
WHERE
1 = 1
AND t1.del_flag = 'N'
<if test="goodsApi != null"> and t1.goods_api = #{goodsApi}</if>
</select>
</mapper>
\ No newline at end of file
......@@ -47,95 +47,6 @@
limit #{offset}, #{limit}
</select>
<!--通过实体作为筛选条件查询-->
<select id="queryAll" resultMap="TDataGoodsMap">
select
data_goods_id, category_id, user_id, data_name, data_type, data_label, data_picture, data_price, discount_price,
price_type, goods_standards, data_status, audit_status, clean_rule, reject_reason, audit_person, audit_time,
cre_time, cre_person, upt_time, upt_person, del_flag, year_type, season_type, month_type, second_type
from t_data_goods
<where>
<if test="dataGoodsId != null">
and data_goods_id = #{dataGoodsId}
</if>
<if test="categoryId != null">
and category_id = #{categoryId}
</if>
<if test="userId != null">
and user_id = #{userId}
</if>
<if test="dataName != null and dataName != ''">
and data_name = #{dataName}
</if>
<if test="dataType != null and dataType != ''">
and data_type = #{dataType}
</if>
<if test="dataLabel != null and dataLabel != ''">
and data_label = #{dataLabel}
</if>
<if test="dataPicture != null and dataPicture != ''">
and data_picture = #{dataPicture}
</if>
<if test="dataPrice != null">
and data_price = #{dataPrice}
</if>
<if test="discountPrice != null">
and discount_price = #{discountPrice}
</if>
<if test="priceType != null and priceType != ''">
and price_type = #{priceType}
</if>
<if test="goodsStandards != null and goodsStandards != ''">
and goods_standards = #{goodsStandards}
</if>
<if test="dataStatus != null and dataStatus != ''">
and data_status = #{dataStatus}
</if>
<if test="auditStatus != null and auditStatus != ''">
and audit_status = #{auditStatus}
</if>
<if test="cleanRule != null and cleanRule != ''">
and clean_rule = #{cleanRule}
</if>
<if test="rejectReason != null and rejectReason != ''">
and reject_reason = #{rejectReason}
</if>
<if test="auditPerson != null and auditPerson != ''">
and audit_person = #{auditPerson}
</if>
<if test="auditTime != null">
and audit_time = #{auditTime}
</if>
<if test="creTime != null">
and cre_time = #{creTime}
</if>
<if test="crePerson != null and crePerson != ''">
and cre_person = #{crePerson}
</if>
<if test="uptTime != null">
and upt_time = #{uptTime}
</if>
<if test="uptPerson != null and uptPerson != ''">
and upt_person = #{uptPerson}
</if>
<if test="delFlag != null and delFlag != ''">
and del_flag = #{delFlag}
</if>
<if test="yearType != null">
and year_type = #{yearType}
</if>
<if test="seasonType != null">
and season_type = #{seasonType}
</if>
<if test="monthType != null">
and month_type = #{monthType}
</if>
<if test="secondType != null">
and second_type = #{secondType}
</if>
</where>
</select>
<!--新增所有列-->
<insert id="insert" keyProperty="dataGoodsId" useGeneratedKeys="true">
insert into t_data_goods(category_id, user_id, data_name, data_type, data_label, data_picture, data_price, discount_price, price_type, goods_standards, data_status, audit_status, clean_rule, reject_reason, audit_person, audit_time, cre_time, cre_person, upt_time, upt_person, del_flag, year_type, season_type, month_type, second_type)
......@@ -246,4 +157,77 @@
delete from t_data_goods where data_goods_id = #{dataGoodsId}
</delete>
<select id="findByCategoryId" resultType="com.jz.dm.mall.moduls.controller.goods.bean.dto.DataGoodsListDto" parameterType="list">
SELECT
t1.data_goods_id,
t1.category_id,
t2.category_name,
t1.data_name,
(CASE WHEN t1.data_type = '01' then 'api' WHEN t1.data_type = '01' then 'api' end) dataTYpe,
t1.data_label,
t1.data_picture,
(CASE when t1.price_type = '01' then '免费' when t1.price_type = '02' then '收费' end) priceType,
t1.discount_price,
t1.data_price,
t1.price_type,
t2.if_child,
t2.parent_id
FROM
t_data_goods t1
INNER JOIN t_data_goods_category t2 on t1.category_id = t2.category_id
</select>
<!--通过实体作为筛选条件查询-->
<select id="findList" resultType="com.jz.dm.mall.moduls.controller.goods.bean.dto.DataGoodsListDto" parameterType="map">
SELECT
t1.data_goods_id as dataGoods,
t1.category_id as categoryId,
t2.category_name as categoryName,
t1.data_name as dataName,
(CASE WHEN t1.data_type = '01' then 'api' WHEN t1.data_type = '01' then 'api' end) dataTYpe,
t1.data_label as dataLabel,
t1.data_picture as dataPicture,
(CASE when t1.price_type = '01' then '免费' when t1.price_type = '02' then '收费' end) priceType,
t1.discount_price as discountPrice,
t1.data_price as dataPrice,
t1.price_type as pariceType,
t2.parent_id as parentId,
t1.year_type as yearType,
t1.season_type as seasonType,
t1.month_type as monthType,
t1.second_type as secondType
FROM
t_data_goods t1
INNER JOIN t_data_goods_category t2 on t1.category_id = t2.category_id
where
1= 1 and
t1.del_flag = 'N' and
t1.data_status = '02'
<if test="categoryId != null">
and t1.category_id = #{categoryId}
</if>
<if test="dataName != null and dataName != ''">
and data_name like concat('%',#{dataName},'%')
</if>
<if test="dataType != null and dataType != ''">
and data_type = #{dataType}
</if>
<if test="priceType != null and priceType != ''">
and price_type = #{priceType}
</if>
<if test="uptTime != null">
ORDER BY
#{uptTime} desc
</if>
<if test="usePerson != null">
ORDER BY
#{usePerson} desc
</if>
<if test="synthesizeRank != null">
ORDER BY
#{synthesizeRank} desc
</if>
</select>
</mapper>
\ No newline at end of file
......@@ -165,18 +165,34 @@
delete from t_mall_customer where customer_id = #{customerId}
</delete>
<select id="selectByAccount" resultMap="TMallCustomerMap">
<select id="selectByAccount" resultType="com.jz.dm.mall.moduls.controller.customer.bean.CustomerDto">
select
customer_id, department_id, password, customer_account, customer_name, customer_phone, customer_email, customer_address, customer_point, register_time, customer_level, identity_card, cre_time, upt_time, del_flag
from t_mall_customer
where customer_account = #{username};
t1.customer_id as customerId,
t1.department_id as departmentId,
t1.password,
t1.customer_account as customerAccount,
t1.customer_name as customerName,
t1.customer_phone as customerPhone,
t3.assets_id as assetsId
from t_mall_customer t1
left join t_department t2 on t1.department_id=t2.department_id
left join t_finance_customer_assets t3 on t3.department_id=t2.department_id
where 1=1 and t1.del_flag='N' and customer_account = #{username};
</select>
<select id="selectByPhone" resultMap="TMallCustomerMap">
select
customer_id, department_id, password, customer_account, customer_name, customer_phone, customer_email, customer_address, customer_point, register_time, customer_level, identity_card, cre_time, upt_time, del_flag
from t_mall_customer
where customer_phone = #{username};
<select id="selectByPhone" resultType="com.jz.dm.mall.moduls.controller.customer.bean.CustomerDto">
select
t1.customer_id as customerId,
t1.department_id as departmentId,
t1.password,
t1.customer_account as customerAccount,
t1.customer_name as customerName,
t1.customer_phone as customerPhone,
t3.assets_id as assetsId
from t_mall_customer t1
left join t_department t2 on t1.department_id=t2.department_id
left join t_finance_customer_assets t3 on t3.department_id=t2.department_id
where 1=1 and t1.del_flag='N' and customer_phone = #{username}
</select>
<select id="selectByPhoneExist" resultMap="TMallCustomerMap">
......@@ -205,13 +221,6 @@
AND del_flag ='N'
</select>
<select id="selectByCustomerId" resultMap="TMallCustomerMap">
select
customer_id, department_id, password, customer_account, customer_name, customer_phone, customer_email, customer_address, customer_point, register_time, customer_level, identity_card, cre_time, upt_time, del_flag
from t_mall_customer
where customer_id = #{customerId};
</select>
<update id="updatePassword" parameterType="map">
update t_mall_customer set password =#{password} where customer_id = #{customerId};
</update>
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.jz.dm.mall.moduls.mapper.MallHotRecommendGoodsDao">
<resultMap type="com.jz.dm.mall.moduls.entity.MallHotRecommendGoods" id="TMallHotRecommendGoodsMap">
<result property="hotRecommendGoods" column="hot_recommend_goods" jdbcType="INTEGER"/>
<result property="dataGoodsId" column="data_goods_id" jdbcType="INTEGER"/>
<result property="customerId" column="customer_id" jdbcType="INTEGER"/>
<result property="delFlag" column="del_flag" jdbcType="VARCHAR"/>
<result property="creTime" column="cre_time" jdbcType="TIMESTAMP"/>
</resultMap>
<!--查询单个-->
<select id="queryById" resultMap="TMallHotRecommendGoodsMap">
select
hot_recommend_goods, data_goods_id, customer_id, del_flag, cre_time
from t_mall_hot_recommend_goods
where hot_recommend_goods = #{hotRecommendGoods}
</select>
<!--查询指定行数据-->
<select id="queryAllByLimit" resultMap="TMallHotRecommendGoodsMap">
select
hot_recommend_goods, data_goods_id, customer_id, del_flag, cre_time
from t_mall_hot_recommend_goods
limit #{offset}, #{limit}
</select>
<!--通过实体作为筛选条件查询-->
<select id="queryAll" resultMap="TMallHotRecommendGoodsMap">
select
hot_recommend_goods, data_goods_id, customer_id, del_flag, cre_time
from t_mall_hot_recommend_goods
<where>
<if test="hotRecommendGoods != null">
and hot_recommend_goods = #{hotRecommendGoods}
</if>
<if test="dataGoodsId != null">
and data_goods_id = #{dataGoodsId}
</if>
<if test="customerId != null">
and customer_id = #{customerId}
</if>
<if test="delFlag != null and delFlag != ''">
and del_flag = #{delFlag}
</if>
<if test="creTime != null">
and cre_time = #{creTime}
</if>
</where>
</select>
<!--新增所有列-->
<insert id="insert" keyProperty="hotRecommendGoods" useGeneratedKeys="true">
insert into t_mall_hot_recommend_goods(data_goods_id, customer_id, del_flag, cre_time)
values (#{dataGoodsId}, #{customerId}, #{delFlag}, #{creTime})
</insert>
<insert id="insertBatch" keyProperty="hotRecommendGoods" useGeneratedKeys="true">
insert into t_mall_hot_recommend_goods(data_goods_id, customer_id, del_flag, cre_time)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.dataGoodsId}, #{entity.customerId}, #{entity.delFlag}, #{entity.creTime})
</foreach>
</insert>
<!--通过主键修改数据-->
<update id="update">
update t_mall_hot_recommend_goods
<set>
<if test="dataGoodsId != null">
data_goods_id = #{dataGoodsId},
</if>
<if test="customerId != null">
customer_id = #{customerId},
</if>
<if test="delFlag != null and delFlag != ''">
del_flag = #{delFlag},
</if>
<if test="creTime != null">
cre_time = #{creTime},
</if>
</set>
where hot_recommend_goods = #{hotRecommendGoods}
</update>
<!--通过主键删除-->
<delete id="deleteById">
delete from t_mall_hot_recommend_goods where hot_recommend_goods = #{hotRecommendGoods}
</delete>
<select id="selectByPopularApi" parameterType="list" resultType="com.jz.dm.mall.moduls.controller.goods.bean.dto.MallHotRecommendGoodsDto">
SELECT
t1.data_goods_id as dataGoodsId ,
t1.data_name as dataName,
(CASE WHEN t1.data_type = '01' then 'api' WHEN t1.data_type = '01' then 'api' end) dataTYpe,
t1.data_label as dataLabel,
t1.data_picture as dataPicture,
t1.data_price as dataPrice,
t1.discount_price as discountPrice,
(CASE when t1.price_type = '01' then '免费' when t1.price_type = '02' then '收费' end) priceType,
t1.use_person AS usePerson
FROM
t_data_goods t1
INNER JOIN t_mall_hot_recommend_goods t2 ON t1.data_goods_id = t2.data_goods_id
where
1=1 and
t1.del_flag = 'N' and
t1.data_status = '02'
group by t1.data_goods_id
order by usePerson desc
</select>
</mapper>
\ No newline at end of file
......@@ -262,17 +262,17 @@
<!--根据订单id 查询详情-->
<select id="getOrderDetail" resultType="com.jz.dm.mall.moduls.controller.order.bean.OrderDto" parameterType="map">
select
t.order_id as orderId,
t.order_number as orderNumber,
(case when t.order_status ='01' then '待支付' when t.order_status ='02' then '已支付' when t.order_status ='03' then '已取消' end) as orderStatus,
t.order_time as orderTime,
(case when t.purchase_method ='01' then '年' when t.purchase_method ='02' then '季' when t.purchase_method ='03' then '月'
when t.purchase_method ='04' then '次' end) as purchaseMethod,
t.take_effect_time as takeEffectTime,
t.invalid_time as invalidTime,
t.api_key as apiKey,
t2.data_name as dataName,
(case when t2.data_type ='01' then 'API' when t2.data_type ='02' then '数据包' end) as dataType
t.order_id as orderId,
t.order_number as orderNumber,
(case when t.order_status ='01' then '待支付' when t.order_status ='02' then '已支付' when t.order_status ='03' then '已取消' end) as orderStatus,
t.order_time as orderTime,
(case when t.purchase_method ='01' then '年' when t.purchase_method ='02' then '季' when t.purchase_method ='03' then '月'
when t.purchase_method ='04' then '次' end) as purchaseMethod,
(DATE_FORMAT(t.take_effect_time,'%Y-%m-%d %H:%i:%s')) as takeEffectTime,
(DATE_FORMAT(t.invalid_time,'%Y-%m-%d %H:%i:%s')) as invalidTime,
t.api_key as apiKey,
t2.data_name as dataName,
(case when t2.data_type ='01' then 'API' when t2.data_type ='02' then '数据包' end) as dataType
from t_order t
left join t_order_goods_info t1 on t.order_id=t1.order_id
inner join t_data_goods t2 on t2.data_goods_id=t1.data_goods_id
......
package com.jz.manage.moduls.controller.customer;
import com.jz.common.bean.PageInfoResponse;
import com.jz.common.constant.Constants;
import com.jz.common.constant.ResultMsg;
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.customer.bean.dto.CompanyDetailsDto;
import com.jz.manage.moduls.controller.customer.bean.dto.EnterpriseAuditDto;
import com.jz.manage.moduls.controller.customer.bean.request.EnterpriseAuditRequest;
import com.jz.manage.moduls.controller.customer.bean.request.SaveCustomerRequest;
import com.jz.manage.moduls.service.DepartmentService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
/**
* 企业(Department)表控制层
......@@ -14,6 +28,7 @@ import org.springframework.web.bind.annotation.RestController;
*/
@RestController
@RequestMapping("department")
@Api(tags = "企业api")
public class DepartmentController extends BaseController {
/**
* 服务对象
......@@ -21,5 +36,67 @@ public class DepartmentController extends BaseController {
@Autowired
private DepartmentService departmentService;
/**
* 条件分页查询企业审核信息
* @param auditRequest
* @param req
* @return
* @throws Exception
*/
@PostMapping(value = "/findList")
@ApiOperation(value = "条件分页查询企业审核信息")
public PageInfoResponse<EnterpriseAuditDto> findList(@RequestBody EnterpriseAuditRequest auditRequest, HttpServletRequest req) throws Exception {
PageInfoResponse<EnterpriseAuditDto> pageInfo = new PageInfoResponse<>();
try {
pageInfo = departmentService.findList(auditRequest, req);
}catch (Exception e) {
pageInfo.setMessage("查询失败");
pageInfo.setCode(Constants.FAILURE_CODE);
e.printStackTrace();
}
return pageInfo;
}
/**
* 主键获取企业审核信息
* @param id
* @param req
* @return
*/
@GetMapping(value = "/{id}")
@ApiOperation(value = "主键查询用户企业详情信息")
public Result<CompanyDetailsDto> selectById(@PathVariable(value = "id") Long id, HttpServletRequest req) {
if (id != null) {
CompanyDetailsDto companyDetails = departmentService.selectById(id);
return new Result<CompanyDetailsDto>(true, "查询企业详情成功!", StatusCode.OK, companyDetails);
}
return new Result<CompanyDetailsDto>(false, "查询企业详情失败!", StatusCode.ERROR);
}
/**
* 企业审核接口
* @param id
* @return
*/
@PostMapping(value = "/audit/{id}")
@ApiModelProperty(value = "企业审核")
public Result audit(@PathVariable(value = "id") Long id) {
if (id != null) {
departmentService.audit(id);
return new Result<CompanyDetailsDto>(true, "企业审核成功!", StatusCode.OK);
}
return new Result<CompanyDetailsDto>(false, "企业审核失败!", StatusCode.ERROR);
}
}
\ No newline at end of file
@PostMapping(value = "/add")
@ApiModelProperty(value = "添加用户")
public Result add(@RequestBody SaveCustomerRequest saveCustomerRequest, HttpServletRequest req) throws Exception {
if (saveCustomerRequest != null) {
Result result = departmentService.add(saveCustomerRequest);
result.getMessage();
result.getCode();
return result;
}
return new Result<CompanyDetailsDto>(false, "添加用户失败!", StatusCode.ERROR);
}
}
\ No newline at end of file
package com.jz.manage.moduls.controller.customer.bean.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* @ClassName:
* @Author: Carl
* @Date: 2020/12/10
* @Version:
*/
@ApiModel(value = "企业详细信息返回参数")
public class CompanyDetailsDto {
@ApiModelProperty(value = "企业id")
private Long departmentId;
@ApiModelProperty(value = "企业名称")
private String departmentName;
@ApiModelProperty(value = "联系人姓名")
private String customerName;
@ApiModelProperty(value = "联系人电话")
private String customerPhone;
@ApiModelProperty(value = "企业地址")
private String registeredAddress;
@ApiModelProperty(value = "营业执照")
private String businessLicense;
@ApiModelProperty(value = "统一社会信用代码")
private String unifredCreditCode;
@ApiModelProperty(value = "银行卡号")
private String bankCardNubmer;
@ApiModelProperty(value = "开户行地址")
private String bankAddress;
public Long getDepartmentId() {
return departmentId;
}
public void setDepartmentId(Long departmentId) {
this.departmentId = departmentId;
}
public String getDepartmentName() {
return departmentName;
}
public void setDepartmentName(String departmentName) {
this.departmentName = departmentName;
}
public String getCustomerName() {
return customerName;
}
public void setCustomerName(String customerName) {
this.customerName = customerName;
}
public String getCustomerPhone() {
return customerPhone;
}
public void setCustomerPhone(String customerPhone) {
this.customerPhone = customerPhone;
}
public String getRegisteredAddress() {
return registeredAddress;
}
public void setRegisteredAddress(String registeredAddress) {
this.registeredAddress = registeredAddress;
}
public String getBusinessLicense() {
return businessLicense;
}
public void setBusinessLicense(String businessLicense) {
this.businessLicense = businessLicense;
}
public String getUnifredCreditCode() {
return unifredCreditCode;
}
public void setUnifredCreditCode(String unifredCreditCode) {
this.unifredCreditCode = unifredCreditCode;
}
public String getBankCardNubmer() {
return bankCardNubmer;
}
public void setBankCardNubmer(String bankCardNubmer) {
this.bankCardNubmer = bankCardNubmer;
}
public String getBankAddress() {
return bankAddress;
}
public void setBankAddress(String bankAddress) {
this.bankAddress = bankAddress;
}
}
package com.jz.manage.moduls.controller.customer.bean.dto;
import io.swagger.annotations.ApiModel;
/**
* @ClassName: CustomerDto
* @Description: 商城用户返回对象参数
* @Author Bellamy
* @Date 2020/12/9
* @Version 1.0
*/
@ApiModel(value = "商城用户--返回参数对象", description = "返回参数对象")
public class CustomerDto {
/**
* 用户id
*/
private Long customerId;
/**
* 企业id
*/
private Long departmentId;
/**
* 密码
*/
private String password;
/**
* 账户
*/
private String customerAccount;
/**
* 用户真实姓名
*/
private String customerName;
/**
* 联系电话
*/
private String customerPhone;
/**
* 资产账户id
*/
private String assetsId;
public Long getCustomerId() {
return customerId;
}
public void setCustomerId(Long customerId) {
this.customerId = customerId;
}
public Long getDepartmentId() {
return departmentId;
}
public void setDepartmentId(Long departmentId) {
this.departmentId = departmentId;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getCustomerAccount() {
return customerAccount;
}
public void setCustomerAccount(String customerAccount) {
this.customerAccount = customerAccount;
}
public String getCustomerName() {
return customerName;
}
public void setCustomerName(String customerName) {
this.customerName = customerName;
}
public String getCustomerPhone() {
return customerPhone;
}
public void setCustomerPhone(String customerPhone) {
this.customerPhone = customerPhone;
}
public String getAssetsId() {
return assetsId;
}
public void setAssetsId(String assetsId) {
this.assetsId = assetsId;
}
}
package com.jz.manage.moduls.controller.customer.bean.dto;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
/**
* @ClassName:
* @Author: Carl
* @Date: 2020/12/10
* @Version:
*/
@ApiModel(value = "企业审核信息返回参数")
public class EnterpriseAuditDto {
@ApiModelProperty(value = "企业id")
private Long departmentId;
@ApiModelProperty(value = "企业名称")
private String departmentName;
@ApiModelProperty(value = "联系人姓名")
private String customerName;
@ApiModelProperty(value = "联系人电话")
private String customerPhone;
@ApiModelProperty(value = "审核状态")
private String auditStatus;
@ApiModelProperty(value = "提交时间")
private Date creTime;
@ApiModelProperty(value = "审核时间")
private Date auditTime;
public Long getDepartmentId() {
return departmentId;
}
public void setDepartmentId(Long departmentId) {
this.departmentId = departmentId;
}
public String getDepartmentName() {
return departmentName;
}
public void setDepartmentName(String departmentName) {
this.departmentName = departmentName;
}
public String getCustomerName() {
return customerName;
}
public void setCustomerName(String customerName) {
this.customerName = customerName;
}
public String getCustomerPhone() {
return customerPhone;
}
public void setCustomerPhone(String customerPhone) {
this.customerPhone = customerPhone;
}
public String getAuditStatus() {
return auditStatus;
}
public void setAuditStatus(String auditStatus) {
this.auditStatus = auditStatus;
}
public Date getCreTime() {
return creTime;
}
public void setCreTime(Date creTime) {
this.creTime = creTime;
}
public Date getAuditTime() {
return auditTime;
}
public void setAuditTime(Date auditTime) {
this.auditTime = auditTime;
}
}
package com.jz.manage.moduls.controller.customer.bean.request;
import com.jz.common.bean.BasePageBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* @ClassName:
* @Author: Carl
* @Date: 2020/12/10
* @Version:
*/
@ApiModel(value = "企业审核信息请求参数封装")
public class EnterpriseAuditRequest extends BasePageBean {
@ApiModelProperty(value = "企业地址")
private String registeredAddress;
@ApiModelProperty(value = "企业名称")
private String departmentName;
@ApiModelProperty(value = "联系人电话")
private String customerPhone;
@ApiModelProperty(value = "审核状态")
private String auditStatus;
public String getRegisteredAddress() {
return registeredAddress;
}
public void setRegisteredAddress(String registeredAddress) {
this.registeredAddress = registeredAddress;
}
public String getDepartmentName() {
return departmentName;
}
public void setDepartmentName(String departmentName) {
this.departmentName = departmentName;
}
public String getCustomerPhone() {
return customerPhone;
}
public void setCustomerPhone(String customerPhone) {
this.customerPhone = customerPhone;
}
public String getAuditStatus() {
return auditStatus;
}
public void setAuditStatus(String auditStatus) {
this.auditStatus = auditStatus;
}
}
package com.jz.manage.moduls.controller.customer.bean.request;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.jz.common.bean.BasePageBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.math.BigDecimal;
/**
* @ClassName:
* @Author: Carl
* @Date: 2020/12/10
* @Version:
*/
@ApiModel(value = "用户添加信息请求参数封装")
public class SaveCustomerRequest extends BasePageBean {
@ApiModelProperty(value = "企业id")
@TableId(value = "department_id",type = IdType.AUTO)
private Long departmentId;
@ApiModelProperty(value = "企业名称")
private String departmentName;
@ApiModelProperty(value = "企业地址")
private String registeredAddress;
@ApiModelProperty(value = "营业执照")
private String businessLicense;
@ApiModelProperty(value = "统一社会信用代码")
private String unifiedCreditCode;
@ApiModelProperty(value = "银行卡号")
private String bankCardNumber;
@ApiModelProperty(value = "开户行地址")
private String bankAddress;
@ApiModelProperty(value = "联系人姓名")
private String linkman;
@ApiModelProperty(value = "联系人电话")
private String telephone;
@ApiModelProperty(value = "账号名")
private String customerAccount;
@ApiModelProperty(value = "账号手机号")
private String customerPhone;
@ApiModelProperty(value = "密码")
private String password;
@ApiModelProperty(value = "充值金额")
private BigDecimal balanceMoney;
public Long getDepartmentId() {
return departmentId;
}
public void setDepartmentId(Long departmentId) {
this.departmentId = departmentId;
}
public String getDepartmentName() {
return departmentName;
}
public void setDepartmentName(String departmentName) {
this.departmentName = departmentName;
}
public String getRegisteredAddress() {
return registeredAddress;
}
public void setRegisteredAddress(String registeredAddress) {
this.registeredAddress = registeredAddress;
}
public String getBusinessLicense() {
return businessLicense;
}
public void setBusinessLicense(String businessLicense) {
this.businessLicense = businessLicense;
}
public String getUnifiedCreditCode() {
return unifiedCreditCode;
}
public void setUnifiedCreditCode(String unifiedCreditCode) {
this.unifiedCreditCode = unifiedCreditCode;
}
public String getBankCardNumber() {
return bankCardNumber;
}
public void setBankCardNumber(String bankCardNumber) {
this.bankCardNumber = bankCardNumber;
}
public String getLinkman() {
return linkman;
}
public void setLinkman(String linkman) {
this.linkman = linkman;
}
public String getBankAddress() {
return bankAddress;
}
public void setBankAddress(String bankAddress) {
this.bankAddress = bankAddress;
}
public String getCustomerPhone() {
return customerPhone;
}
public void setCustomerPhone(String customerPhone) {
this.customerPhone = customerPhone;
}
public String getCustomerAccount() {
return customerAccount;
}
public void setCustomerAccount(String customerAccount) {
this.customerAccount = customerAccount;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public BigDecimal getBalanceMoney() {
return balanceMoney;
}
public void setBalanceMoney(BigDecimal balanceMoney) {
this.balanceMoney = balanceMoney;
}
public String getTelephone() {
return telephone;
}
public void setTelephone(String telephone) {
this.telephone = telephone;
}
}
package com.jz.manage.moduls.controller.finance;
import com.jz.common.bean.PageInfoResponse;
import com.jz.common.constant.Constants;
import com.jz.common.utils.Result;
import com.jz.manage.moduls.controller.BaseController;
import com.jz.manage.moduls.controller.finance.platForm.BalanceAuditRequest;
import com.jz.manage.moduls.controller.finance.platForm.BalanceInfoDto;
import com.jz.manage.moduls.controller.finance.platForm.BalanceListDto;
import com.jz.manage.moduls.controller.finance.platForm.BalanceListRequest;
import com.jz.manage.moduls.service.FinanceCustomerBalanceService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;
/**
* 企业客户充值记录(TFinanceCustomerBalance)表控制层
......@@ -14,12 +27,78 @@ import org.springframework.web.bind.annotation.RestController;
*/
@RestController
@RequestMapping("financeCustomerBalance")
@Api(tags = "平台--利润中心")
public class FinanceCustomerBalanceController extends BaseController {
/**
* 服务对象
*/
@Autowired
private FinanceCustomerBalanceService tFinanceCustomerBalanceService;
private FinanceCustomerBalanceService financeCustomerBalanceService;
/**
* 充值管理--分页列表
*
* @return
* @author Bellamy
* @since 2020-12-03
*/
@PostMapping(value = "/cashOutList")
@ApiOperation(value = "充值管理--分页列表", notes = "分页列表")
public PageInfoResponse<BalanceListDto> getFinanceCashOutList(@RequestBody BalanceListRequest balanceListRequest, HttpServletRequest httpRequest) throws Exception {
PageInfoResponse<BalanceListDto> pageInfo = new PageInfoResponse<BalanceListDto>();
Map map = new HashMap();
//从session中获取平台用户id
//SysUserDto user = (SysUserDto) SessionUtils.getUserCurrent(requset,"sysUser");
//map.put("userId", user.getUserId());
try {
pageInfo = financeCustomerBalanceService.findListBalance(balanceListRequest, httpRequest);
} catch (Exception e) {
pageInfo.setMessage("查询失败");
pageInfo.setCode(Constants.FAILURE_CODE);
e.printStackTrace();
}
return pageInfo;
}
/**
* 充值管理--充值详情
*
* @return
* @author Bellamy
* @since 2020-12-06
*/
@PostMapping(value = "/balanceInfoById")
@ApiOperation(value = "充值管理--充值详情", notes = "充值详情")
public Result<BalanceInfoDto> getFinanceBalanceInfoById(@RequestParam(value = "customerBalanceId") String customerBalanceId, HttpServletRequest httpRequest) throws Exception {
Result<BalanceInfoDto> result = new Result<>();
if (StringUtils.isEmpty(customerBalanceId)) {
result.setMsg("参数为空!");
result.setSuccess(false);
return result;
}
BalanceInfoDto dto = financeCustomerBalanceService.queryBalanceByid(customerBalanceId);
result.setData(dto);
return result;
}
/**
* 充值管理--充值审核
*
* @return
* @author Bellamy
* @since 2020-12-08
*/
@PostMapping(value = "/balanceInfoAudit")
@ApiOperation(value = "充值管理--充值审核", notes = "充值审核")
public Result<Object> getBalanceInfoAudit(@RequestBody BalanceAuditRequest balanceAuditRequest, HttpServletRequest httpRequest) throws Exception {
Result<Object> result = new Result<>();
if (StringUtils.isEmpty(balanceAuditRequest.getCustomerBalanceId())) {
return Result.error("参数不能为空!");
}
if (StringUtils.isEmpty(balanceAuditRequest.getAuditStatus())) {
return Result.error("参数不能为空!");
}
Result<Object> dto = financeCustomerBalanceService.uptBalanceInfoAuditByid(balanceAuditRequest);
return dto;
}
}
\ No newline at end of file
......@@ -5,17 +5,15 @@ import com.jz.common.bean.PageInfoResponse;
import com.jz.common.constant.Constants;
import com.jz.common.utils.Result;
import com.jz.manage.moduls.controller.BaseController;
import com.jz.manage.moduls.controller.finance.platForm.OrderCountInfoDto;
import com.jz.manage.moduls.controller.finance.platForm.PlatFormMoneyAndDepartDto;
import com.jz.manage.moduls.controller.finance.platForm.TradeDetilDto;
import com.jz.manage.moduls.controller.finance.platForm.TradeDetilRequest;
import com.jz.manage.moduls.controller.finance.platForm.*;
import com.jz.manage.moduls.service.PlatformTradeFlowInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
......@@ -31,6 +29,8 @@ import java.util.Map;
@RequestMapping("platformTradeFlowInfo")
@Api(tags = "平台--利润中心")
public class PlatformTradeFlowInfoController extends BaseController {
private static final Logger logger = LoggerFactory.getLogger(PlatformTradeFlowInfoController.class);
/**
* 服务对象
*/
......@@ -65,16 +65,16 @@ public class PlatformTradeFlowInfoController extends BaseController {
* @author Bellamy
* @since 2020-12-03
*/
@GetMapping(value = "/orderCountList")
@PostMapping(value = "/orderCountList")
@ApiOperation(value = "财务管理---我的订单", notes = "我的订单")
public PageInfoResponse<OrderCountInfoDto> findList(BasePageBean pageBean, HttpServletRequest httpRequest) throws Exception {
public PageInfoResponse<OrderCountInfoDto> findList(@RequestBody BasePageBean pageBean, HttpServletRequest httpRequest) throws Exception {
PageInfoResponse<OrderCountInfoDto> pageInfo = new PageInfoResponse<OrderCountInfoDto>();
Map map = new HashMap();
//从session中获取平台用户id
//SysUserDto user = (SysUserDto) SessionUtils.getUserCurrent(requset,"sysUser");
//map.put("userId", user.getUserId());
try {
pageInfo = platformTradeFlowInfoService.findListOrderCount(pageBean,httpRequest);
pageInfo = platformTradeFlowInfoService.findListOrderCount(pageBean, httpRequest);
} catch (Exception e) {
pageInfo.setMessage("查询失败");
pageInfo.setCode(Constants.FAILURE_CODE);
......@@ -91,16 +91,41 @@ public class PlatformTradeFlowInfoController extends BaseController {
* @author Bellamy
* @since 2020-12-03
*/
@GetMapping(value = "/tradeDetilList")
@PostMapping(value = "/tradeDetilList")
@ApiOperation(value = "财务管理--交易明细", notes = "交易明细")
public PageInfoResponse<TradeDetilDto> getFinanceTradeDetil(TradeDetilRequest tradeDetilRequest, HttpServletRequest httpRequest) throws Exception {
public PageInfoResponse<TradeDetilDto> getFinanceTradeDetil(@RequestBody TradeDetilRequest tradeDetilRequest, HttpServletRequest httpRequest) throws Exception {
PageInfoResponse<TradeDetilDto> pageInfo = new PageInfoResponse<TradeDetilDto>();
Map map = new HashMap();
//从session中获取平台用户id
//SysUserDto user = (SysUserDto) SessionUtils.getUserCurrent(requset,"sysUser");
//map.put("userId", user.getUserId());
try {
pageInfo = platformTradeFlowInfoService.findListFinanceTradeDetil(tradeDetilRequest,httpRequest);
pageInfo = platformTradeFlowInfoService.findListFinanceTradeDetil(tradeDetilRequest, httpRequest);
} catch (Exception e) {
pageInfo.setMessage("查询失败");
pageInfo.setCode(Constants.FAILURE_CODE);
e.printStackTrace();
}
return pageInfo;
}
/**
* 提现管理--分页列表
*
* @return
* @author Bellamy
* @since 2020-12-03
*/
@PostMapping(value = "/cashOutList")
@ApiOperation(value = "提现管理--分页列表", notes = "分页列表")
public PageInfoResponse<CashOutListDto> getFinanceCashOutList(@RequestBody CashOutListRequest cashOutListRequest, HttpServletRequest httpRequest) throws Exception {
PageInfoResponse<CashOutListDto> pageInfo = new PageInfoResponse<CashOutListDto>();
Map map = new HashMap();
//从session中获取平台用户id
//SysUserDto user = (SysUserDto) SessionUtils.getUserCurrent(requset,"sysUser");
//map.put("userId", user.getUserId());
try {
pageInfo = platformTradeFlowInfoService.findListFinanceCashOut(cashOutListRequest, httpRequest);
} catch (Exception e) {
pageInfo.setMessage("查询失败");
pageInfo.setCode(Constants.FAILURE_CODE);
......@@ -109,4 +134,44 @@ public class PlatformTradeFlowInfoController extends BaseController {
return pageInfo;
}
/**
* 提现管理--提现详情
*
* @return
* @author Bellamy
* @since 2020-12-06
*/
@PostMapping(value = "/cashOutInfoById")
@ApiOperation(value = "提现管理--提现详情", notes = "提现详情")
public Result<Object> getFinanceCashOutInfoById(@RequestParam(value = "cashOutId") String cashOutId, HttpServletRequest httpRequest) throws Exception {
Result<Object> result = new Result<>();
if (StringUtils.isEmpty(cashOutId)) {
return Result.error("参数不能为空!");
}
CashOutInfoDto dto = platformTradeFlowInfoService.queryCashOutByid(cashOutId);
result.setData(dto);
return result;
}
/**
* 提现管理--提现审核
*
* @return
* @author Bellamy
* @since 2020-12-06
*/
@PostMapping(value = "/cashOutInfoAudit")
@ApiOperation(value = "提现管理--提现审核", notes = "提现审核")
public Result<Object> getCashOutInfoAudit(@RequestBody CashOutAuditRequest cashOutAuditRequest, HttpServletRequest httpRequest) throws Exception {
Result<Object> result = new Result<>();
if (StringUtils.isEmpty(cashOutAuditRequest.getCashOutId())) {
return Result.error("参数不能为空!");
}
if (StringUtils.isEmpty(cashOutAuditRequest.getAuditStatus())) {
return Result.error("参数不能为空!");
}
Result<Object> dto = platformTradeFlowInfoService.uptCashOutInfoAuditByid(cashOutAuditRequest);
return dto;
}
}
\ No newline at end of file
package com.jz.manage.moduls.controller.finance.platForm;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* 平台利润中心--充值管理--充值审核参数对象
*
* @author Bellamy
* @since 2020-12-08 10:41:43
*/
@ApiModel(value = "充值管理--充值审核参数对象", description = "充值审核参数对象")
public class BalanceAuditRequest {
/**
* 审核意见
*/
@ApiModelProperty(value = "审核意见")
private String rejectReason;
/**
* 充值id
*/
@ApiModelProperty(value = "充值id")
private String customerBalanceId;
/**
* 审核状态:01待审核,02审核通过,03未通过
*/
@ApiModelProperty(value = "审核状态")
private String auditStatus;
public String getRejectReason() {
return rejectReason;
}
public void setRejectReason(String rejectReason) {
this.rejectReason = rejectReason;
}
public String getAuditStatus() {
return auditStatus;
}
public void setAuditStatus(String auditStatus) {
this.auditStatus = auditStatus;
}
public String getCustomerBalanceId() {
return customerBalanceId;
}
public void setCustomerBalanceId(String customerBalanceId) {
this.customerBalanceId = customerBalanceId;
}
}
\ No newline at end of file
package com.jz.manage.moduls.controller.finance.platForm;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.math.BigDecimal;
/**
* 平台利润中心--充值详情返回参数对象
*
* @author Bellamy
* @since 2020-12-05 10:41:43
*/
@ApiModel(value = "充值管理--充值详情返回参数对象", description = "充值详情返回参数对象")
public class BalanceInfoDto {
/**
* 企业名
*/
@ApiModelProperty(value = "企业名")
private String departmentName;
/**
* 充值描述
*/
@ApiModelProperty(value = "充值描述")
private String remark;
/**
* 充值金额
*/
@ApiModelProperty(value = "充值金额")
private BigDecimal balanceMoney;
/**
* 审核意见
*/
@ApiModelProperty(value = "审核意见")
private String rejectReason;
/**
* 充值状态:01待审核,02审核通过,03未通过
*/
@ApiModelProperty(value = "充值状态")
private String auditStatus;
/**
* 充值id
*/
@ApiModelProperty(value = "充值id")
private Long customerBalanceId;
public String getDepartmentName() {
return departmentName;
}
public void setDepartmentName(String departmentName) {
this.departmentName = departmentName;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public String getAuditStatus() {
return auditStatus;
}
public void setAuditStatus(String auditStatus) {
this.auditStatus = auditStatus;
}
public String getRejectReason() {
return rejectReason;
}
public void setRejectReason(String rejectReason) {
this.rejectReason = rejectReason;
}
public BigDecimal getBalanceMoney() {
return balanceMoney;
}
public void setBalanceMoney(BigDecimal balanceMoney) {
this.balanceMoney = balanceMoney;
}
public Long getCustomerBalanceId() {
return customerBalanceId;
}
public void setCustomerBalanceId(Long customerBalanceId) {
this.customerBalanceId = customerBalanceId;
}
}
\ No newline at end of file
package com.jz.manage.moduls.controller.finance.platForm;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.math.BigDecimal;
import java.util.Date;
/**
* 平台利润中心--充值管理--分页列表返回参数对象
*
* @author Bellamy
* @since 2020-12-05 10:41:43
*/
@ApiModel(value = "充值管理--分页列表返回参数对象", description = "分页列表返回参数对象")
public class BalanceListDto {
/**
* 企业名
*/
@ApiModelProperty(value = "企业名")
private String departmentName;
/**
* 充值描述
*/
@ApiModelProperty(value = "充值描述")
private String remark;
/**
* 充值金额
*/
@ApiModelProperty(value = "充值金额")
private BigDecimal balanceMoney;
/**
* 充值时间
*/
@ApiModelProperty(value = "充值时间")
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date balanceTime;
/**
* 充值状态:01待审核,02审核通过,03未通过
*/
@ApiModelProperty(value = "充值状态")
private String auditStatus;
/**
* 提现id
*/
@ApiModelProperty(value = "提现id")
private Long customerBalanceId;
public String getDepartmentName() {
return departmentName;
}
public void setDepartmentName(String departmentName) {
this.departmentName = departmentName;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public String getAuditStatus() {
return auditStatus;
}
public void setAuditStatus(String auditStatus) {
this.auditStatus = auditStatus;
}
public BigDecimal getBalanceMoney() {
return balanceMoney;
}
public void setBalanceMoney(BigDecimal balanceMoney) {
this.balanceMoney = balanceMoney;
}
public Date getBalanceTime() {
return balanceTime;
}
public void setBalanceTime(Date balanceTime) {
this.balanceTime = balanceTime;
}
public Long getCustomerBalanceId() {
return customerBalanceId;
}
public void setCustomerBalanceId(Long customerBalanceId) {
this.customerBalanceId = customerBalanceId;
}
}
\ No newline at end of file
package com.jz.manage.moduls.controller.finance.platForm;
import com.jz.common.bean.BasePageBean;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* 平台利润中心--充值管理--分页列表参数对象
*
* @author Bellamy
* @since 2020-12-05 10:41:43
*/
@ApiModel(value = "充值管理--分页列表参数对象", description = "分页列表参数对象")
public class BalanceListRequest extends BasePageBean {
/**
* 企业名
*/
@ApiModelProperty(value = "企业名")
private String departmentName;
/**
* 充值描述
*/
@ApiModelProperty(value = "充值描述")
private String remark;
/**
* 充值状态:01待审核,02审核通过,03未通过
*/
@ApiModelProperty(value = "充值状态")
private String auditStatus;
/**
* 充值时间
*/
@ApiModelProperty(value = "充值时间")
private String balanceTime;
public String getDepartmentName() {
return departmentName;
}
public void setDepartmentName(String departmentName) {
this.departmentName = departmentName;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public String getAuditStatus() {
return auditStatus;
}
public void setAuditStatus(String auditStatus) {
this.auditStatus = auditStatus;
}
public String getBalanceTime() {
return balanceTime;
}
public void setBalanceTime(String balanceTime) {
this.balanceTime = balanceTime;
}
}
\ No newline at end of file
package com.jz.manage.moduls.controller.finance.platForm;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* 平台利润中心--提现管理--提现参数对象
*
* @author Bellamy
* @since 2020-12-05 10:41:43
*/
@ApiModel(value = "提现管理--提现参数对象", description = "提现参数对象")
public class CashOutAuditRequest {
/**
* 审核意见
*/
@ApiModelProperty(value = "审核意见")
private String rejectReason;
/**
* 提现id
*/
@ApiModelProperty(value = "提现id")
private String cashOutId;
/**
* 审核状态:01待审核,02审核通过,03未通过
*/
@ApiModelProperty(value = "审核状态")
private String auditStatus;
public String getRejectReason() {
return rejectReason;
}
public void setRejectReason(String rejectReason) {
this.rejectReason = rejectReason;
}
public String getCashOutId() {
return cashOutId;
}
public void setCashOutId(String cashOutId) {
this.cashOutId = cashOutId;
}
public String getAuditStatus() {
return auditStatus;
}
public void setAuditStatus(String auditStatus) {
this.auditStatus = auditStatus;
}
}
\ No newline at end of file
package com.jz.manage.moduls.controller.finance.platForm;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.math.BigDecimal;
/**
* 平台利润中心--提现详情返回参数对象
*
* @author Bellamy
* @since 2020-12-05 10:41:43
*/
@ApiModel(value = "提现管理--提现详情返回参数对象", description = "提现详情返回参数对象")
public class CashOutInfoDto {
/**
* 企业名
*/
@ApiModelProperty(value = "企业名")
private String departmentName;
/**
* 提现描述
*/
@ApiModelProperty(value = "提现描述")
private String remark;
/**
* 提现金额
*/
@ApiModelProperty(value = "提现金额")
private BigDecimal cashOutMoney;
/**
* 审核意见
*/
@ApiModelProperty(value = "审核意见")
private String rejectReason;
/**
* 提现状态:01待审核,02审核通过,03未通过
*/
@ApiModelProperty(value = "提现状态")
private String auditStatus;
/**
* 提现id
*/
@ApiModelProperty(value = "提现id")
private Long cashOutId;
public String getDepartmentName() {
return departmentName;
}
public void setDepartmentName(String departmentName) {
this.departmentName = departmentName;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public String getAuditStatus() {
return auditStatus;
}
public void setAuditStatus(String auditStatus) {
this.auditStatus = auditStatus;
}
public BigDecimal getCashOutMoney() {
return cashOutMoney;
}
public void setCashOutMoney(BigDecimal cashOutMoney) {
this.cashOutMoney = cashOutMoney;
}
public Long getCashOutId() {
return cashOutId;
}
public void setCashOutId(Long cashOutId) {
this.cashOutId = cashOutId;
}
public String getRejectReason() {
return rejectReason;
}
public void setRejectReason(String rejectReason) {
this.rejectReason = rejectReason;
}
}
\ No newline at end of file
package com.jz.manage.moduls.controller.finance.platForm;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.math.BigDecimal;
import java.util.Date;
/**
* 平台利润中心--提现管理--分页列表返回参数对象
*
* @author Bellamy
* @since 2020-12-05 10:41:43
*/
@ApiModel(value = "提现管理--分页列表返回参数对象", description = "分页列表返回参数对象")
public class CashOutListDto {
/**
* 企业名
*/
@ApiModelProperty(value = "企业名")
private String departmentName;
/**
* 提现描述
*/
@ApiModelProperty(value = "提现描述")
private String remark;
/**
* 提现金额
*/
@ApiModelProperty(value = "提现金额")
private BigDecimal cashOutMoney;
/**
* 提现时间
*/
@ApiModelProperty(value = "提现时间")
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date casOutTime;
/**
* 提现状态:01待审核,02审核通过,03未通过
*/
@ApiModelProperty(value = "提现状态")
private String auditStatus;
/**
* 提现id
*/
@ApiModelProperty(value = "提现id")
private Long cashOutId;
public String getDepartmentName() {
return departmentName;
}
public void setDepartmentName(String departmentName) {
this.departmentName = departmentName;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public String getAuditStatus() {
return auditStatus;
}
public void setAuditStatus(String auditStatus) {
this.auditStatus = auditStatus;
}
public Date getCasOutTime() {
return casOutTime;
}
public void setCasOutTime(Date casOutTime) {
this.casOutTime = casOutTime;
}
public BigDecimal getCashOutMoney() {
return cashOutMoney;
}
public void setCashOutMoney(BigDecimal cashOutMoney) {
this.cashOutMoney = cashOutMoney;
}
public Long getCashOutId() {
return cashOutId;
}
public void setCashOutId(Long cashOutId) {
this.cashOutId = cashOutId;
}
}
\ No newline at end of file
package com.jz.manage.moduls.controller.finance.platForm;
import com.jz.common.bean.BasePageBean;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* 平台利润中心--提现管理--分页列表参数对象
*
* @author Bellamy
* @since 2020-12-05 10:41:43
*/
@ApiModel(value = "提现管理--分页列表参数对象", description = "分页列表参数对象")
public class CashOutListRequest extends BasePageBean {
/**
* 企业名
*/
@ApiModelProperty(value = "企业名")
private String departmentName;
/**
* 提现描述
*/
@ApiModelProperty(value = "提现描述")
private String remark;
/**
* 提现状态:01待审核,02审核通过,03未通过
*/
@ApiModelProperty(value = "提现状态")
private String auditStatus;
/**
* 提现时间
*/
@ApiModelProperty(value = "提现时间")
private String casOutTime;
public String getDepartmentName() {
return departmentName;
}
public void setDepartmentName(String departmentName) {
this.departmentName = departmentName;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public String getAuditStatus() {
return auditStatus;
}
public void setAuditStatus(String auditStatus) {
this.auditStatus = auditStatus;
}
public String getCasOutTime() {
return casOutTime;
}
public void setCasOutTime(String casOutTime) {
this.casOutTime = casOutTime;
}
}
\ No newline at end of file
package com.jz.manage.moduls.controller.finance.platForm;
import com.jz.common.bean.BasePageBean;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.math.BigDecimal;
import java.util.Date;
/**
* 平台利润中心--财务管理交易明细返回对象
*
......@@ -11,13 +14,13 @@ import io.swagger.annotations.ApiModelProperty;
* @since 2020-12-01 10:41:43
*/
@ApiModel(value = "财务管理--交易明细返回对象", description = "交易明细返回对象")
public class TradeDetilDto extends BasePageBean {
public class TradeDetilDto {
/**
* 企业名
* 订单编号
*/
@ApiModelProperty(value = "企业名")
private String departmentName;
@ApiModelProperty(value = "订单编号")
private String orderNumber;
/**
* 数据名称
*/
......@@ -25,17 +28,39 @@ public class TradeDetilDto extends BasePageBean {
private String dataName;
/**
* 数据行业
* 时间
*/
@ApiModelProperty(value = "数据行业")
private String categoryId;
@ApiModelProperty(value = "时间")
@JsonFormat(pattern="HH:mm:ss")
private Date orderTime;
/**
* 金额
*/
@ApiModelProperty(value = "金额")
private BigDecimal orderMoney;
/**
* 支付方式
*/
@ApiModelProperty(value = "支付方式")
private String paymentMethod;
/**
* 订单方式
*/
@ApiModelProperty(value = "订单方式")
private String orderMethod;
private String purchaseMethod;
/**
* 行业
*/
@ApiModelProperty(value = "行业")
private String categoryId;
/**
* 企业名称
*/
@ApiModelProperty(value = "企业名称")
private String departmentName;
public String getDepartmentName() {
return departmentName;
}
......@@ -60,11 +85,42 @@ public class TradeDetilDto extends BasePageBean {
this.categoryId = categoryId;
}
public String getOrderMethod() {
return orderMethod;
public String getOrderNumber() { return orderNumber;
}
public void setOrderNumber(String orderNumber) {
this.orderNumber = orderNumber;
}
public Date getOrderTime() {
return orderTime;
}
public void setOrderTime(Date orderTime) {
this.orderTime = orderTime;
}
public BigDecimal getOrderMoney() {
return orderMoney;
}
public void setOrderMoney(BigDecimal orderMoney) {
this.orderMoney = orderMoney;
}
public String getPaymentMethod() {
return paymentMethod;
}
public void setPaymentMethod(String paymentMethod) {
this.paymentMethod = paymentMethod;
}
public String getPurchaseMethod() {
return purchaseMethod;
}
public void setOrderMethod(String orderMethod) {
this.orderMethod = orderMethod;
public void setPurchaseMethod(String purchaseMethod) {
this.purchaseMethod = purchaseMethod;
}
}
\ No newline at end of file
package com.jz.manage.moduls.controller.goods;
import com.jz.common.entity.DataGoods;
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.goods.bean.dto.DataGoodsApiDto;
import com.jz.manage.moduls.service.DataGoodsApiService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
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.RestController;
......@@ -21,5 +28,19 @@ public class DataGoodsApiController extends BaseController {
@Autowired
private DataGoodsApiService tDataGoodsApiService;
/**
* 根据主键查询商品详情-api
* @param id
* @return
*/
@GetMapping("/getDataDetails/{id}")
@ApiOperation(value = "点击商品查看商品详情", notes = "api商品")
public Result<DataGoodsApiDto> findById(@PathVariable(value = "id") Long id) {
if (id != null) {
Result<DataGoodsApiDto> result = new Result<>();
DataGoodsApiDto dataGoodsApi = tDataGoodsApiService.selectById(id);
return new Result<DataGoodsApiDto>(true, "查询商品详情成功!", StatusCode.OK, dataGoodsApi);
}
return new Result<>(false, "查询商品详情失败!");
}
}
\ No newline at end of file
......@@ -7,16 +7,15 @@ import com.jz.common.constant.Constants;
import com.jz.common.entity.DataGoods;
import com.jz.manage.moduls.controller.BaseController;
import com.jz.manage.moduls.controller.goods.bean.dto.DataGoodsDto;
import com.jz.manage.moduls.controller.goods.bean.dto.DataGoodsListDto;
import com.jz.manage.moduls.controller.goods.bean.request.DataGoodsListRequest;
import com.jz.manage.moduls.controller.goods.bean.request.DataGoodsRequest;
import com.jz.manage.moduls.service.DataGoodsService;
import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
/**
* 数据商品(dataGoods)表控制层
......@@ -32,22 +31,22 @@ public class DataGoodsController extends BaseController {
*/
@Autowired
private DataGoodsService dataGoodsService;
/**列表查询数据商品
* @param DataGoodsRequest
* @param dataGoodsListRequest
* @return
*/
@RequestMapping(method = RequestMethod.POST, value = "/findList")
public PageInfoResponse<DataGoodsDto> findList(@RequestBody DataGoodsRequest DataGoodsRequest, HttpServletRequest httpRequest){
PageInfoResponse<DataGoodsDto> pageInfo = new PageInfoResponse<DataGoodsDto>();
@PostMapping(value = "/findList")
public PageInfoResponse<DataGoodsListDto> findList(@RequestBody DataGoodsListRequest dataGoodsListRequest, HttpServletRequest httpRequest){
PageInfoResponse<DataGoodsListDto> pageInfo = new PageInfoResponse<>();
try {
pageInfo = dataGoodsService.findList(DataGoodsRequest, httpRequest);
pageInfo = dataGoodsService.findList(dataGoodsListRequest, httpRequest);
} catch (Exception e) {
pageInfo.setMessage("查询失败");
pageInfo.setCode(Constants.FAILURE_CODE);
e.printStackTrace();
}
return pageInfo;
}
......
package com.jz.manage.moduls.controller.goods.bean.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
/**
* @ClassName:
* @Author: Carl
* @Date: 2020/12/14
* @Version:
*/
@ApiModel("数据管理-数据详情参数")
public class DataGoodsApiDto {
@ApiModelProperty(value = "数据id")
private Long dataGoodsId;
@ApiModelProperty(value = "商品分类名称")
private String categoryName;
@ApiModelProperty(value = "数据商品名称")
private String dataName;
@ApiModelProperty(value = "数据类型")
private String dataType;
@ApiModelProperty(value = "价格类型")
private String priceType;
@ApiModelProperty(value = "更新时间")
private Date uptTime;
@ApiModelProperty(value = "接口地址")
private String apiUrl;
@ApiModelProperty(value = "接口方法")
private String apiMethod;
@ApiModelProperty(value = "请求方式")
private String requestType;
@ApiModelProperty(value = "返回类型")
private String returnType;
@ApiModelProperty(value = "apiKey")
private String apiKey;
@ApiModelProperty(value = "token")
private String requestToken;
@ApiModelProperty(value = "参数分类")