Commit 7985fa38 authored by zhangc's avatar zhangc

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

 Conflicts:
	jz-dm-manage/src/main/java/com/jz/manage/moduls/service/impl/SysUserServiceImpl.java
parents 865cf125 6910b82f
alter table t_finance_customer_assets add remark text COMMENT '备注'; 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_platform_log add caller_type char(2) NOT NULL COMMENT '调用类型:01商城用户,02平台用户';
\ No newline at end of file alter table t_finance_trade_flow add assets_id Bigint(20) default NULL COMMENT'企业资产id';
\ No newline at end of file
package com.jz.common.bean; package com.jz.common.bean;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**分页信息封装 /**分页信息封装
* @author ybz * @author ybz
* *
*/ */
@ApiModel(value = "分页参数对象", description = "分页参数对象")
public class BasePageBean { public class BasePageBean {
@ApiModelProperty(value = "当前页码值")
private int pageNum = 1; private int pageNum = 1;
@ApiModelProperty(value = "每页条数")
private int pageSize = 10; private int pageSize = 10;
public int getPageNum() { public int getPageNum() {
......
...@@ -43,4 +43,15 @@ public class CommonsUtil implements Serializable { ...@@ -43,4 +43,15 @@ public class CommonsUtil implements Serializable {
} }
return dt; return dt;
} }
/**
* 按指定格式返回字符串当前日期时间
*
* @return
*/
public static String getDate2String(String curDateFormat,Date date) {
SimpleDateFormat sdf = new SimpleDateFormat(curDateFormat);
String sd = sdf.format(date);
return sd;
}
} }
package com.jz.common.utils;
import java.text.SimpleDateFormat;
import java.util.*;
/**
* @ClassName: 日期工具类
* @Author: Carl
* @Date: 2020/12/4
* @Version:
*/
public class DateUtils {
/**
* 日期转换- String -> Date
*
* @param dateString 字符串时间
* @return Date类型信息
* @throws Exception 抛出异常
*/
public static Date parseString2Date(String dateString) throws Exception {
if (dateString == null) {
return null;
}
return parseString2Date(dateString, "yyyy-MM-dd");
}
/**
* 日期转换- String -> Date
*
* @param dateString 字符串时间
* @param pattern 格式模板
* @return Date类型信息
* @throws Exception 抛出异常
*/
public static Date parseString2Date(String dateString, String pattern) throws Exception {
if (dateString == null) {
return null;
}
SimpleDateFormat sdf = new SimpleDateFormat(pattern);
Date date = sdf.parse(dateString);
return date;
}
/**
* 日期转换 Date -> String
*
* @param date Date类型信息
* @return 字符串时间
* @throws Exception 抛出异常
*/
public static String parseDate2String(Date date) throws Exception {
if (date == null) {
return null;
}
return parseDate2String(date, "yyyy-MM-dd");
}
/**
* 日期转换 Date -> String
*
* @param date Date类型信息
* @param pattern 格式模板
* @return 字符串时间
* @throws Exception 抛出异常
*/
public static String parseDate2String(Date date, String pattern) throws Exception {
if (date == null) {
return null;
}
SimpleDateFormat sdf = new SimpleDateFormat(pattern);
String strDate = sdf.format(date);
return strDate;
}
/**
* 获取当前日期的本周一是几号
*
* @return 本周一的日期
*/
public static Date getThisWeekMonday() {
Calendar cal = Calendar.getInstance();
cal.setTime(new Date());
// 获得当前日期是一个星期的第几天
int dayWeek = cal.get(Calendar.DAY_OF_WEEK);
if (1 == dayWeek) {
cal.add(Calendar.DAY_OF_MONTH, -1);
}
// 设置一个星期的第一天,按中国的习惯一个星期的第一天是星期一
cal.setFirstDayOfWeek(Calendar.MONDAY);
// 获得当前日期是一个星期的第几天
int day = cal.get(Calendar.DAY_OF_WEEK);
// 根据日历的规则,给当前日期减去星期几与一个星期第一天的差值
cal.add(Calendar.DATE, cal.getFirstDayOfWeek() - day);
return cal.getTime();
}
/**
* 获取当前日期周的最后一天
*
* @return 当前日期周的最后一天
*/
public static Date getSundayOfThisWeek() {
Calendar c = Calendar.getInstance();
int dayOfWeek = c.get(Calendar.DAY_OF_WEEK) - 1;
if (dayOfWeek == 0) {
dayOfWeek = 7;
}
c.add(Calendar.DATE, -dayOfWeek + 7);
return c.getTime();
}
/**
* 根据日期区间获取月份列表
*
* @param minDate 开始时间
* @param maxDate 结束时间
* @return 月份列表
* @throws Exception
*/
public static List<String> getMonthBetween(String minDate, String maxDate, String format) throws Exception {
ArrayList<String> result = new ArrayList<>();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
Calendar min = Calendar.getInstance();
Calendar max = Calendar.getInstance();
min.setTime(sdf.parse(minDate));
min.set(min.get(Calendar.YEAR), min.get(Calendar.MONTH), 1);
max.setTime(sdf.parse(maxDate));
max.set(max.get(Calendar.YEAR), max.get(Calendar.MONTH), 2);
SimpleDateFormat sdf2 = new SimpleDateFormat(format);
Calendar curr = min;
while (curr.before(max)) {
result.add(sdf2.format(curr.getTime()));
curr.add(Calendar.MONTH, 1);
}
return result;
}
/**
* 根据日期获取年度中的周索引
*
* @param date 日期
* @return 周索引
* @throws Exception
*/
public static Integer getWeekOfYear(String date) throws Exception {
Date useDate = parseString2Date(date);
Calendar cal = Calendar.getInstance();
cal.setTime(useDate);
return cal.get(Calendar.WEEK_OF_YEAR);
}
/**
* 根据年份获取年中周列表
*
* @param year 年分
* @return 周列表
* @throws Exception
*/
public static Map<Integer, String> getWeeksOfYear(String year) throws Exception {
Date useDate = parseString2Date(year, "yyyy");
Calendar cal = Calendar.getInstance();
cal.setTime(useDate);
//获取年中周数量
int weeksCount = cal.getWeeksInWeekYear();
Map<Integer, String> mapWeeks = new HashMap<>(55);
for (int i = 0; i < weeksCount; i++) {
cal.get(Calendar.DAY_OF_YEAR);
mapWeeks.put(i + 1, parseDate2String(getFirstDayOfWeek(cal.get(Calendar.YEAR), i)));
}
return mapWeeks;
}
/**
* 获取某年的第几周的开始日期
*
* @param year 年分
* @param week 周索引
* @return 开始日期
* @throws Exception
*/
public static Date getFirstDayOfWeek(int year, int week) throws Exception {
Calendar c = new GregorianCalendar();
c.set(Calendar.YEAR, year);
c.set(Calendar.MONTH, Calendar.JANUARY);
c.set(Calendar.DATE, 1);
Calendar cal = (GregorianCalendar) c.clone();
cal.add(Calendar.DATE, week * 7);
return getFirstDayOfWeek(cal.getTime());
}
/**
* 获取某年的第几周的结束日期
*
* @param year 年份
* @param week 周索引
* @return 结束日期
* @throws Exception
*/
public static Date getLastDayOfWeek(int year, int week) throws Exception {
Calendar c = new GregorianCalendar();
c.set(Calendar.YEAR, year);
c.set(Calendar.MONTH, Calendar.JANUARY);
c.set(Calendar.DATE, 1);
Calendar cal = (GregorianCalendar) c.clone();
cal.add(Calendar.DATE, week * 7);
return getLastDayOfWeek(cal.getTime());
}
/**
* 获取当前时间所在周的开始日期
*
* @param date 当前时间
* @return 开始时间
*/
public static Date getFirstDayOfWeek(Date date) {
Calendar c = new GregorianCalendar();
c.setFirstDayOfWeek(Calendar.SUNDAY);
c.setTime(date);
c.set(Calendar.DAY_OF_WEEK, c.getFirstDayOfWeek());
return c.getTime();
}
/**
* 获取当前时间所在周的结束日期
*
* @param date 当前时间
* @return 结束日期
*/
public static Date getLastDayOfWeek(Date date) {
Calendar c = new GregorianCalendar();
c.setFirstDayOfWeek(Calendar.SUNDAY);
c.setTime(date);
c.set(Calendar.DAY_OF_WEEK, c.getFirstDayOfWeek() + 6);
return c.getTime();
}
//获得上周一的日期
public static Date geLastWeekMonday(Date date) {
Calendar cal = Calendar.getInstance();
cal.setTime(getThisWeekMonday(date));
cal.add(Calendar.DATE, -7);
return cal.getTime();
}
//获得本周一的日期
public static Date getThisWeekMonday(Date date) {
Calendar cal = Calendar.getInstance();
cal.setTime(date);
// 获得当前日期是一个星期的第几天
int dayWeek = cal.get(Calendar.DAY_OF_WEEK);
if (1 == dayWeek) {
cal.add(Calendar.DAY_OF_MONTH, -1);
}
// 设置一个星期的第一天,按中国的习惯一个星期的第一天是星期一
cal.setFirstDayOfWeek(Calendar.MONDAY);
// 获得当前日期是一个星期的第几天
int day = cal.get(Calendar.DAY_OF_WEEK);
// 根据日历的规则,给当前日期减去星期几与一个星期第一天的差值
cal.add(Calendar.DATE, cal.getFirstDayOfWeek() - day);
return cal.getTime();
}
//获得下周一的日期
public static Date getNextWeekMonday(Date date) {
Calendar cal = Calendar.getInstance();
cal.setTime(getThisWeekMonday(date));
cal.add(Calendar.DATE, 7);
return cal.getTime();
}
//获得今天日期
public static Date getToday(){
return new Date();
}
//获得本月一日的日期
public static Date getFirstDay4ThisMonth(){
Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.DAY_OF_MONTH,1);
return calendar.getTime();
}
public static void main(String[] args) {
try {
System.out.println("本周一" + parseDate2String(getThisWeekMonday()));
System.out.println("本月一日" + parseDate2String(getFirstDay4ThisMonth()));
} catch (Exception e) {
e.printStackTrace();
}
}
}
...@@ -2,9 +2,11 @@ package com.jz.dm.mall.moduls.controller.customer; ...@@ -2,9 +2,11 @@ package com.jz.dm.mall.moduls.controller.customer;
import com.baomidou.mybatisplus.extension.api.R; import com.baomidou.mybatisplus.extension.api.R;
import com.jz.common.base.BaseController; import com.jz.common.base.BaseController;
import com.jz.common.base.CurrentUser;
import com.jz.common.constant.RedisMessageConstant; import com.jz.common.constant.RedisMessageConstant;
import com.jz.common.constant.ResultCode; import com.jz.common.constant.ResultCode;
import com.jz.common.constant.ResultMsg; import com.jz.common.constant.ResultMsg;
import com.jz.common.utils.SessionUtils;
import com.jz.dm.mall.moduls.entity.MallCustomer; import com.jz.dm.mall.moduls.entity.MallCustomer;
import com.jz.common.utils.Result; import com.jz.common.utils.Result;
import com.jz.common.utils.StatusCode; import com.jz.common.utils.StatusCode;
...@@ -18,6 +20,7 @@ import org.springframework.web.bind.annotation.*; ...@@ -18,6 +20,7 @@ import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.util.Map; import java.util.Map;
/** /**
...@@ -71,5 +74,39 @@ public class MallCustomerController extends BaseController { ...@@ -71,5 +74,39 @@ public class MallCustomerController extends BaseController {
} }
return new Result(false, "注册失败!", StatusCode.ERROR); return new Result(false, "注册失败!", StatusCode.ERROR);
} }
/**
* 获取用户信息
* @return
*/
@GetMapping("/getLoginUserName")
@ApiOperation(value = "注册用户", notes = "添加用户")
public Result getLoginUserName (HttpServletRequest request) {
// 从session中获取id
try {
MallCustomer mallCustomer = (MallCustomer) 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) {
e.printStackTrace();
return new Result(false, "获取用户信息失败");
}
}
@PostMapping(value = "/updatePassword")
public Result updatePassword(String oldPassword, String newPassword,HttpServletRequest request) throws Exception {
// 获取用户信息
MallCustomer mallCustomer = (MallCustomer) getLoginUserName(request).getData();
// 如果密码一致
if (mallCustomer.getPassword().equals(oldPassword)) {
// 修改密码
Long customerId = mallCustomer.getCustomerId();
mallCustomerService.updatePassword(customerId, newPassword);
return new Result(true, "密码修改成功");
}
return new Result(false, "密码修改失败");
}
} }
\ No newline at end of file
package com.jz.dm.mall.moduls.controller.finance; package com.jz.dm.mall.moduls.controller.finance;
import com.jz.common.base.BaseController; import com.jz.common.base.BaseController;
import com.jz.common.bean.BasePageBean;
import com.jz.common.bean.PageInfoResponse;
import com.jz.common.constant.Constants;
import com.jz.common.utils.Result; import com.jz.common.utils.Result;
import com.jz.dm.mall.moduls.controller.finance.bean.FinanceCashOutDto; import com.jz.dm.mall.moduls.controller.finance.bean.*;
import com.jz.dm.mall.moduls.controller.finance.bean.FinanceCashOutRequest;
import com.jz.dm.mall.moduls.controller.finance.bean.FinanceCustomerAssetsDto;
import com.jz.dm.mall.moduls.controller.finance.bean.FinanceCustomerBalanceRequest;
import com.jz.dm.mall.moduls.service.FinanceTradeFlowService; import com.jz.dm.mall.moduls.service.FinanceTradeFlowService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
...@@ -26,7 +26,7 @@ import java.util.Map; ...@@ -26,7 +26,7 @@ import java.util.Map;
*/ */
@RestController @RestController
@RequestMapping("/financeTradeFlow") @RequestMapping("/financeTradeFlow")
@Api(tags = "利润中心") @Api(tags = "商城--利润中心")
public class FinanceTradeFlowController extends BaseController { public class FinanceTradeFlowController extends BaseController {
/** /**
* 服务对象 * 服务对象
...@@ -63,14 +63,14 @@ public class FinanceTradeFlowController extends BaseController { ...@@ -63,14 +63,14 @@ public class FinanceTradeFlowController extends BaseController {
@ApiOperation(value = "充值----保存充值金额", notes = "保存充值金额") @ApiOperation(value = "充值----保存充值金额", notes = "保存充值金额")
@ApiParam() @ApiParam()
public Result<Object> uptAccountMoney(@RequestBody FinanceCustomerBalanceRequest customerBalanceRequest, HttpServletRequest requset) throws Exception { public Result<Object> uptAccountMoney(@RequestBody FinanceCustomerBalanceRequest customerBalanceRequest, HttpServletRequest requset) throws Exception {
if(StringUtils.isEmpty(customerBalanceRequest.getAssetsId().toString())){ //企业资产id if (StringUtils.isEmpty(customerBalanceRequest.getAssetsId().toString())) { //企业资产id
return Result.error("参数不能为空!"); return Result.error("参数不能为空!");
} }
if(StringUtils.isEmpty(customerBalanceRequest.getBalanceMoney().toString())){ //充值金额 if (StringUtils.isEmpty(customerBalanceRequest.getBalanceMoney().toString())) { //充值金额
return Result.error("参数不能为空!"); return Result.error("参数不能为空!");
} }
Boolean str = financeTradeFlowService.uptAccountMoney(customerBalanceRequest); Boolean str = financeTradeFlowService.uptAccountMoney(customerBalanceRequest);
if(!str){ if (!str) {
return Result.error("提交失败!"); return Result.error("提交失败!");
} }
return Result.ok("提交成功!"); return Result.ok("提交成功!");
...@@ -110,7 +110,7 @@ public class FinanceTradeFlowController extends BaseController { ...@@ -110,7 +110,7 @@ public class FinanceTradeFlowController extends BaseController {
map.put("assetsId", 1); //企业资产账户id map.put("assetsId", 1); //企业资产账户id
map.put("departmentId", 1); //企业ID map.put("departmentId", 1); //企业ID
FinanceCashOutDto dto = financeTradeFlowService.getCashOutAuditStutas(map); FinanceCashOutDto dto = financeTradeFlowService.getCashOutAuditStutas(map);
if(dto.getCashOutMoney() != null){ if (dto.getCashOutMoney() != null) {
result.setData(dto.getCashOutMoney()); result.setData(dto.getCashOutMoney());
result.setMessage("存在提现审核记录!"); result.setMessage("存在提现审核记录!");
} else { } else {
...@@ -128,30 +128,58 @@ public class FinanceTradeFlowController extends BaseController { ...@@ -128,30 +128,58 @@ public class FinanceTradeFlowController extends BaseController {
@PostMapping(value = "/addCashOutMoney") @PostMapping(value = "/addCashOutMoney")
@ApiOperation(value = "提现----保存提现金额", notes = "保存提现金额") @ApiOperation(value = "提现----保存提现金额", notes = "保存提现金额")
public Result<Object> addCashOutMoney(@RequestBody FinanceCashOutRequest financeCashOutRequest, HttpServletRequest requset) throws Exception { public Result<Object> addCashOutMoney(@RequestBody FinanceCashOutRequest financeCashOutRequest, HttpServletRequest requset) throws Exception {
if(financeCashOutRequest.getCashOutMoney() == null){ //提现金额 if (financeCashOutRequest.getCashOutMoney() == null) { //提现金额
return Result.error("参数不能为空!"); return Result.error("参数不能为空!");
} }
Result<Object> result = financeTradeFlowService.addCashOutMoney(financeCashOutRequest); Result<Object> result = financeTradeFlowService.addCashOutMoney(financeCashOutRequest);
return result; return result;
} }
/** /**
* 订单管理列表(分页查询) * 收支情况(分页查询)
* *
* @author Bellamy * @author Bellamy
* @since 2020-12-04
*/ */
/*@PostMapping(value = "/list") @PostMapping(value = "/receiveListInfo")
@ApiOperation(value = "订单管理列表(分页查询)", notes = "订单列表(分页查询)") @ApiOperation(value = "收支情况(分页查询)", notes = "收支情况(分页查询)")
public PageInfoResponse<FinanceTradeFlow> queryPageList(HttpServletRequest req) throws Exception { public PageInfoResponse<FinanceTradeFlowDto> queryPageList(@RequestBody BasePageBean pageBean, HttpServletRequest req) throws Exception {
PageInfoResponse<FinanceTradeFlow> pageInfo = new PageInfoResponse<FinanceTradeFlow>(); PageInfoResponse<FinanceTradeFlowDto> pageInfo = new PageInfoResponse<FinanceTradeFlowDto>();
Map map = new HashMap(); Map map = new HashMap();
try { try {
pageInfo = financeTradeFlowService.findListTradeFlow(map,req); pageInfo = financeTradeFlowService.findListScTradeFlow(pageBean, req);
} catch (Exception e) { } catch (Exception e) {
pageInfo.setMessage("查询失败"); pageInfo.setMessage("查询失败");
pageInfo.setCode(Constants.FAILURE_CODE); pageInfo.setCode(Constants.FAILURE_CODE);
e.printStackTrace(); e.printStackTrace();
} }
return pageInfo; return pageInfo;
}*/ }
/**
* 点击查看--每天--收支情况(分页查询)
*
* @author Bellamy
* @since 2020-12-04
*/
@PostMapping(value = "/everyPageLisInfo")
@ApiOperation(value = "点击查看--每天--收支情况(分页查询)", notes = "点击查看--每天--收支情况(分页查询)")
public PageInfoResponse<EveryTradeFlowDto> queryEveryDayPageList(@RequestBody EveryTradeFlowRequest everyTradeFlowRequest, HttpServletRequest req) throws Exception {
PageInfoResponse<EveryTradeFlowDto> pageInfo = new PageInfoResponse<EveryTradeFlowDto>();
if (everyTradeFlowRequest.getCreTime() == null || "".equals(everyTradeFlowRequest.getCreTime())) {
pageInfo.setMessage("参数为空");
pageInfo.setCode(Constants.FAILURE_CODE);
return pageInfo;
}
Map map = new HashMap();
try {
pageInfo = financeTradeFlowService.findListEveryDayScInfo(everyTradeFlowRequest, req);
} catch (Exception e) {
pageInfo.setMessage("查询失败");
pageInfo.setCode(Constants.FAILURE_CODE);
e.printStackTrace();
}
return pageInfo;
}
} }
\ No newline at end of file
package com.jz.dm.mall.moduls.controller.finance.bean;
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 makejava
* @since 2020-12-01 10:41:39
*/
@ApiModel(value = "每天收支情况明细返回对象", description = "每天收支情况明细返回对象")
public class EveryTradeFlowDto {
/**
* 交易流水编号
*/
@ApiModelProperty(value = "交易流水编号")
private String tradeFlowNumber;
/**
* 交易流水金额
*/
@ApiModelProperty(value = "交易流水金额")
private BigDecimal tradeMoney;
/**
* 交易类型:01提现,02充值,03付款,04收款,05续费
*/
@ApiModelProperty(value = "交易类型")
private String tradeType;
/**
* 交易类型id
*/
@ApiModelProperty(value = "交易类型:01提现,02充值,03付款,04收款,05续费")
private String tradeTypeId;
/**
* 创建时间
*/
@ApiModelProperty(value = "创建时间")
@JsonFormat(pattern="HH:mm:ss")
private Date creTime;
/**
* 数据名称
*/
@ApiModelProperty(value = "数据名称")
private String dataName;
/**
* 订单方式
*/
@ApiModelProperty(value = "订单方式")
private String purchaseMethod;
/**
* 余额
*/
@ApiModelProperty(value = "余额")
private BigDecimal balanceMoney;
public String getTradeFlowNumber() {
return tradeFlowNumber;
}
public void setTradeFlowNumber(String tradeFlowNumber) {
this.tradeFlowNumber = tradeFlowNumber;
}
public BigDecimal getTradeMoney() {
return tradeMoney;
}
public void setTradeMoney(BigDecimal tradeMoney) {
this.tradeMoney = tradeMoney;
}
public String getTradeType() {
return tradeType;
}
public void setTradeType(String tradeType) {
this.tradeType = tradeType;
}
public Date getCreTime() {
return creTime;
}
public void setCreTime(Date creTime) {
this.creTime = creTime;
}
public String getTradeTypeId() {
return tradeTypeId;
}
public void setTradeTypeId(String tradeTypeId) {
this.tradeTypeId = tradeTypeId;
}
public String getDataName() {
return dataName;
}
public void setDataName(String dataName) {
this.dataName = dataName;
}
public String getPurchaseMethod() {
return purchaseMethod;
}
public void setPurchaseMethod(String purchaseMethod) {
this.purchaseMethod = purchaseMethod;
}
public BigDecimal getBalanceMoney() {
return balanceMoney;
}
public void setBalanceMoney(BigDecimal balanceMoney) {
this.balanceMoney = balanceMoney;
}
}
\ No newline at end of file
package com.jz.dm.mall.moduls.controller.finance.bean;
import com.jz.common.bean.BasePageBean;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* 每天收支情况参数接收对象
*
* @author Bellamy
* @since 2020-12-04 10:41:39
*/
@ApiModel(value = "每天收支情况参数接收对象", description = "每天收支情况参数接收对象")
public class EveryTradeFlowRequest extends BasePageBean {
/**
* 创建时间
*/
@ApiModelProperty(value = "创建时间 yyyy-MM-dd")
private String creTime;
public String getCreTime() {
return creTime;
}
public void setCreTime(String creTime) {
this.creTime = creTime;
}
}
\ No newline at end of file
package com.jz.dm.mall.moduls.controller.finance.bean;
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;
/**
* 企业客户交易流水(TFinanceTradeFlow)实体类
*
* @author Bellamy
* @since 2020-12-01 10:41:39
*/
@ApiModel(value = "收支情况返回对象", description = "收支情况返回对象")
public class FinanceTradeFlowDto implements Serializable {
private static final long serialVersionUID = -55257582310832314L;
/**
* 收入金额
*/
@ApiModelProperty(value = "收入金额")
private BigDecimal receiveMoey;
/**
* 提现金额
*/
@ApiModelProperty(value = "提现金额")
private BigDecimal cashOutMoney;
/**
* 充值金额
*/
@ApiModelProperty(value = "充值金额")
private BigDecimal rechargeMoney;
/**
* 支出金额
*/
@ApiModelProperty(value = "支出金额")
private BigDecimal payMoey;
/**
* 结余
*/
@ApiModelProperty(value = "结余")
private BigDecimal balanceMoney;
/**
* 创建时间
*/
@ApiModelProperty(value = "创建时间")
@JsonFormat(pattern="yyyy-MM-dd")
private Date creTime;
public BigDecimal getReceiveMoey() {
return receiveMoey;
}
public void setReceiveMoey(BigDecimal receiveMoey) {
this.receiveMoey = receiveMoey;
}
public BigDecimal getCashOutMoney() {
return cashOutMoney;
}
public void setCashOutMoney(BigDecimal cashOutMoney) {
this.cashOutMoney = cashOutMoney;
}
public BigDecimal getRechargeMoney() {
return rechargeMoney;
}
public void setRechargeMoney(BigDecimal rechargeMoney) {
this.rechargeMoney = rechargeMoney;
}
public BigDecimal getPayMoey() {
return payMoey;
}
public void setPayMoey(BigDecimal payMoey) {
this.payMoey = payMoey;
}
public BigDecimal getBalanceMoney() {
return balanceMoney;
}
public void setBalanceMoney(BigDecimal balanceMoney) {
this.balanceMoney = balanceMoney;
}
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.controller.goods;
import com.jz.common.base.BaseController;
import com.jz.dm.mall.moduls.service.DataGoodsApiService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* api商品(TDataGoodsApi)表控制层
*
* @author Bellamy
* @since 2020-12-01 10:41:31
*/
@RestController
@RequestMapping("dataGoodsApi")
public class DataGoodsApiController extends BaseController {
/**
* 服务对象
*/
@Autowired
private DataGoodsApiService tDataGoodsApiService;
}
\ No newline at end of file
package com.jz.dm.mall.moduls.controller.goods;
import com.jz.common.base.BaseController;
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.request.DataGoodsRequest;
import com.jz.dm.mall.moduls.entity.DataGoods;
import com.jz.dm.mall.moduls.service.DataGoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
/**
* 数据商品(dataGoods)表控制层
*
* @author Bellamy
* @since 2020-12-01 10:41:30
*/
@RestController
@RequestMapping("dataGoods")
public class DataGoodsController extends BaseController {
/**
* 服务对象
*/
@Autowired
private DataGoodsService dataGoodsService;
/**列表查询数据商品
* @param DataGoodsRequest
* @return
*/
@PostMapping(value = "/findList")
public PageInfoResponse<DataGoodsDto> findList(@RequestBody DataGoodsRequest DataGoodsRequest, HttpServletRequest httpRequest){
PageInfoResponse<DataGoodsDto> pageInfo = new PageInfoResponse<DataGoodsDto>();
try {
pageInfo = dataGoodsService.findList(DataGoodsRequest, httpRequest);
} catch (Exception e) {
pageInfo.setMessage("查询失败");
pageInfo.setCode(Constants.FAILURE_CODE);
e.printStackTrace();
}
return pageInfo;
}
/**主键查询数据商品
* @param DataGoodsRequest
* @return
*/
@RequestMapping(method = RequestMethod.POST, value = "/view")
public BaseBeanResponse<DataGoodsDto> view(@RequestBody DataGoodsRequest DataGoodsRequest, HttpServletRequest httpRequest){
BaseBeanResponse<DataGoodsDto> baseBeanResponse = new BaseBeanResponse<DataGoodsDto>();
try {
baseBeanResponse = dataGoodsService.findById(DataGoodsRequest, httpRequest);
} catch (Exception e) {
baseBeanResponse.setMessage("请求失败");
baseBeanResponse.setCode(Constants.FAILURE_CODE);
e.printStackTrace();
}
return baseBeanResponse;
}
/**删除数据商品
* @param DataGoodsRequest
* @return
*/
@RequestMapping(method = RequestMethod.POST, value = "/delete")
public BaseResponse delete(@RequestBody DataGoodsRequest DataGoodsRequest, HttpServletRequest httpRequest){
BaseResponse baseResponse = new BaseResponse();
try {
baseResponse = dataGoodsService.deleteById(DataGoodsRequest, httpRequest);
} catch (Exception e) {
baseResponse.setMessage("删除失败");
baseResponse.setCode(Constants.FAILURE_CODE);
e.printStackTrace();
}
return baseResponse;
}
/**新增数据商品
* @param DataGoodsRequest
* @return
*/
@RequestMapping(method = RequestMethod.POST, value = "/add")
public BaseBeanResponse<DataGoods> add(@RequestBody DataGoods dataGoods, HttpServletRequest httpRequest){
BaseBeanResponse<DataGoods> baseBeanResponse = new BaseBeanResponse<DataGoods>();
try {
baseBeanResponse = dataGoodsService.add(dataGoods, httpRequest);
} catch (Exception e) {
baseBeanResponse.setMessage("新增失败");
baseBeanResponse.setCode(Constants.FAILURE_CODE);
e.printStackTrace();
}
return baseBeanResponse;
}
/**修改数据商品
* @param DataGoodsRequest
* @return
*/
@RequestMapping(method = RequestMethod.POST, value = "/edit")
public BaseBeanResponse<DataGoods> edit(@RequestBody DataGoods dataGoods, HttpServletRequest httpRequest){
BaseBeanResponse<DataGoods> baseBeanResponse = new BaseBeanResponse<DataGoods>();
try {
baseBeanResponse = dataGoodsService.edit(dataGoods, httpRequest);
} catch (Exception e) {
baseBeanResponse.setMessage("修改失败");
baseBeanResponse.setCode(Constants.FAILURE_CODE);
e.printStackTrace();
}
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.bean.dto;
import com.jz.common.entity.DataGoods;
public class DataGoodsDto extends DataGoods {
}
package com.jz.dm.mall.moduls.controller.goods.bean.request;
import com.jz.common.bean.BasePageBean;
import java.math.BigDecimal;
import java.util.Date;
/**数据商品参数请求封装
* @author ybz
*
*/
public class DataGoodsRequest extends BasePageBean {
/**
* 数据商品id
*/
private Long dataGoodsId;
/**
* 商品分类id(行业)
*/
private Long categoryId;
/**
* 数据商户id
*/
private Long userId;
/**
* 数据商品名称
*/
private String dataName;
/**
* 数据类型:01api,02数据包
*/
private String dataType;
/**
* 数据商品标签
*/
private String dataLabel;
/**
* 数据商品图片
*/
private String dataPicture;
/**
* 数据商品价格
*/
private BigDecimal dataPrice;
/**
* 优惠价格
*/
private BigDecimal discountPrice;
/**
* 价格类型:01免费,02收费
*/
private String priceType;
/**
* 商品规格
*/
private String goodsStandards;
/**
* 数据状态:01预售,02在售中,03下架,04上架
*/
private String dataStatus;
/**
* 审核状态:01待审核,02已审核,03未通过
*/
private String auditStatus;
/**
* 清洗规则(脱敏校验)
*/
private String cleanRule;
/**
* 驳回原因
*/
private String rejectReason;
/**
* 审核人
*/
private String auditPerson;
/**
* 审核时间起
*/
private Date auditTimeStart;
/**
* 审核时间止
*/
private Date auditTimeEnd;
/**
* 创建时间起
*/
private Date creTimeStart;
/**
* 创建时间止
*/
private Date creTimeEnd;
/**
* 创建人
*/
private String crePerson;
/**
* 更新时间起
*/
private Date uptTimeStart;
/**
* 更新时间止
*/
private Date uptTimeEnd;
/**
* 更新人
*/
private String uptPerson;
/**
* 删除标识
*/
private String delFlag;
/**
* 年(元)
*/
private BigDecimal yearType;
/**
* 季(元)
*/
private BigDecimal seasonType;
/**
* 月(元)
*/
private BigDecimal monthType;
/**
* 次(元)
*/
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 Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
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 BigDecimal getDataPrice() {
return dataPrice;
}
public void setDataPrice(BigDecimal dataPrice) {
this.dataPrice = dataPrice;
}
public BigDecimal getDiscountPrice() {
return discountPrice;
}
public void setDiscountPrice(BigDecimal discountPrice) {
this.discountPrice = discountPrice;
}
public String getPriceType() {
return priceType;
}
public void setPriceType(String priceType) {
this.priceType = priceType;
}
public String getGoodsStandards() {
return goodsStandards;
}
public void setGoodsStandards(String goodsStandards) {
this.goodsStandards = goodsStandards;
}
public String getDataStatus() {
return dataStatus;
}
public void setDataStatus(String dataStatus) {
this.dataStatus = dataStatus;
}
public String getAuditStatus() {
return auditStatus;
}
public void setAuditStatus(String auditStatus) {
this.auditStatus = auditStatus;
}
public String getCleanRule() {
return cleanRule;
}
public void setCleanRule(String cleanRule) {
this.cleanRule = cleanRule;
}
public String getRejectReason() {
return rejectReason;
}
public void setRejectReason(String rejectReason) {
this.rejectReason = rejectReason;
}
public String getAuditPerson() {
return auditPerson;
}
public void setAuditPerson(String auditPerson) {
this.auditPerson = auditPerson;
}
public Date getAuditTimeStart() {
return auditTimeStart;
}
public void setAuditTimeStart(Date auditTimeStart) {
this.auditTimeStart = auditTimeStart;
}
public Date getAuditTimeEnd() {
return auditTimeEnd;
}
public void setAuditTimeEnd(Date auditTimeEnd) {
this.auditTimeEnd = auditTimeEnd;
}
public Date getCreTimeStart() {
return creTimeStart;
}
public void setCreTimeStart(Date creTimeStart) {
this.creTimeStart = creTimeStart;
}
public Date getCreTimeEnd() {
return creTimeEnd;
}
public void setCreTimeEnd(Date creTimeEnd) {
this.creTimeEnd = creTimeEnd;
}
public String getCrePerson() {
return crePerson;
}
public void setCrePerson(String crePerson) {
this.crePerson = crePerson;
}
public Date getUptTimeStart() {
return uptTimeStart;
}
public void setUptTimeStart(Date uptTimeStart) {
this.uptTimeStart = uptTimeStart;
}
public Date getUptTimeEnd() {
return uptTimeEnd;
}
public void setUptTimeEnd(Date uptTimeEnd) {
this.uptTimeEnd = uptTimeEnd;
}
public String getUptPerson() {
return uptPerson;
}
public void setUptPerson(String uptPerson) {
this.uptPerson = uptPerson;
}
public String getDelFlag() {
return delFlag;
}
public void setDelFlag(String delFlag) {
this.delFlag = delFlag;
}
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.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* 数据商品(TDataGoods)实体类
*
* @author Bellamy
* @since 2020-12-01 10:41:30
*/
@TableName("t_data_goods")
@ApiModel
public class DataGoods implements Serializable {
private static final long serialVersionUID = 938517475031285541L;
/**
* 数据商品id
*/
private Long dataGoodsId;
/**
* 商品分类id(行业)
*/
private Long categoryId;
/**
* 数据商户id
*/
private Long userId;
/**
* 数据商品名称
*/
private String dataName;
/**
* 数据类型:01api,02数据包
*/
private String dataType;
/**
* 数据商品标签
*/
private String dataLabel;
/**
* 数据商品图片
*/
private String dataPicture;
/**
* 数据商品价格
*/
private BigDecimal dataPrice;
/**
* 优惠价格
*/
private BigDecimal discountPrice;
/**
* 价格类型:01免费,02收费
*/
private String priceType;
/**
* 商品规格
*/
private String goodsStandards;
/**
* 数据状态:01预售,02在售中,03下架,04上架
*/
private String dataStatus;
/**
* 审核状态:01待审核,02已审核,03未通过
*/
private String auditStatus;
/**
* 清洗规则(脱敏校验)
*/
private String cleanRule;
/**
* 驳回原因
*/
private String rejectReason;
/**
* 审核人
*/
private String auditPerson;
/**
* 审核时间
*/
private Date auditTime;
/**
* 创建时间
*/
private Date creTime;
/**
* 创建人
*/
private String crePerson;
/**
* 更新时间
*/
private Date uptTime;
/**
* 更新人
*/
private String uptPerson;
/**
* 删除标识
*/
private String delFlag;
/**
* 年(元)
*/
private BigDecimal yearType;
/**
* 季(元)
*/
private BigDecimal seasonType;
/**
* 月(元)
*/
private BigDecimal monthType;
/**
* 次(元)
*/
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 Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
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 BigDecimal getDataPrice() {
return dataPrice;
}
public void setDataPrice(BigDecimal dataPrice) {
this.dataPrice = dataPrice;
}
public BigDecimal getDiscountPrice() {
return discountPrice;
}
public void setDiscountPrice(BigDecimal discountPrice) {
this.discountPrice = discountPrice;
}
public String getPriceType() {
return priceType;
}
public void setPriceType(String priceType) {
this.priceType = priceType;
}
public String getGoodsStandards() {
return goodsStandards;
}
public void setGoodsStandards(String goodsStandards) {
this.goodsStandards = goodsStandards;
}
public String getDataStatus() {
return dataStatus;
}
public void setDataStatus(String dataStatus) {
this.dataStatus = dataStatus;
}
public String getAuditStatus() {
return auditStatus;
}
public void setAuditStatus(String auditStatus) {
this.auditStatus = auditStatus;
}
public String getCleanRule() {
return cleanRule;
}
public void setCleanRule(String cleanRule) {
this.cleanRule = cleanRule;
}
public String getRejectReason() {
return rejectReason;
}
public void setRejectReason(String rejectReason) {
this.rejectReason = rejectReason;
}
public String getAuditPerson() {
return auditPerson;
}
public void setAuditPerson(String auditPerson) {
this.auditPerson = auditPerson;
}
public Date getAuditTime() {
return auditTime;
}
public void setAuditTime(Date auditTime) {
this.auditTime = auditTime;
}
public Date getCreTime() {
return creTime;
}
public void setCreTime(Date creTime) {
this.creTime = creTime;
}
public String getCrePerson() {
return crePerson;
}
public void setCrePerson(String crePerson) {
this.crePerson = crePerson;
}
public Date getUptTime() {
return uptTime;
}
public void setUptTime(Date uptTime) {
this.uptTime = uptTime;
}
public String getUptPerson() {
return uptPerson;
}
public void setUptPerson(String uptPerson) {
this.uptPerson = uptPerson;
}
public String getDelFlag() {
return delFlag;
}
public void setDelFlag(String delFlag) {
this.delFlag = delFlag;
}
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;
}
}
\ 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;
/**
* api商品(DataGoodsApi)实体类
*
* @author Bellamy
* @since 2020-12-01 10:41:31
*/
@TableName("t_data_goods_api")
@ApiModel
public class DataGoodsApi implements Serializable {
private static final long serialVersionUID = -14346819849726413L;
/**
* api商品id
*/
private Long goodsApi;
/**
* 数据id
*/
private Long dataGoodsId;
/**
* api服务名称
*/
private String apiName;
/**
* 请求类型(方式)
*/
private String requestType;
/**
* api接口地址
*/
private String apiUrl;
/**
* api接口方法
*/
private String apiMethod;
/**
* api请求协议:http,https
*/
private String apiProtocl;
/**
* api返回数据样例
*/
private String returnDataExample;
/**
* api请求样例
*/
private String requestExample;
/**
* 返回类型
*/
private String returnType;
/**
* apikey
*/
private String apiKey;
/**
* 创建时间
*/
private Date creTime;
/**
* 创建人
*/
private String crePerson;
/**
* 更新人
*/
private String uptPerson;
/**
* 更新时间
*/
private Date uptTime;
/**
* 删除标识
*/
private String delFlag;
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 getReturnDataExample() {
return returnDataExample;
}
public void setReturnDataExample(String returnDataExample) {
this.returnDataExample = returnDataExample;
}
public String getRequestExample() {
return requestExample;
}
public void setRequestExample(String requestExample) {
this.requestExample = requestExample;
}
public String getReturnType() {
return returnType;
}
public void setReturnType(String returnType) {
this.returnType = returnType;
}
public String getApiKey() {
return apiKey;
}
public void setApiKey(String apiKey) {
this.apiKey = apiKey;
}
public Date getCreTime() {
return creTime;
}
public void setCreTime(Date creTime) {
this.creTime = creTime;
}
public String getCrePerson() {
return crePerson;
}
public void setCrePerson(String crePerson) {
this.crePerson = crePerson;
}
public String getUptPerson() {
return uptPerson;
}
public void setUptPerson(String uptPerson) {
this.uptPerson = uptPerson;
}
public Date getUptTime() {
return uptTime;
}
public void setUptTime(Date uptTime) {
this.uptTime = uptTime;
}
public String getDelFlag() {
return delFlag;
}
public void setDelFlag(String delFlag) {
this.delFlag = delFlag;
}
}
\ 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;
/**
* api商品(TDataGoodsApi)表数据库访问层
*
* @author Bellamy
* @since 2020-12-01 10:41:31
*/
public interface DataGoodsApiDao extends BaseMapper<DataGoodsApi> {
}
\ No newline at end of file
package com.jz.dm.mall.moduls.mapper;
import java.util.List;
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.entity.DataGoods;
/**
* 数据商品(DataGoods)表数据库访问层
*
* @author Bellamy
* @since 2020-12-01 10:41:30
*/
public interface DataGoodsDao extends BaseMapper<DataGoods> {
/**选择性增加数据商品
* @param dataGoods
* @return
* @throws Exception
*/
public int insertSelective(DataGoods dataGoods)throws Exception;
/**主键修改数据商品
* @param dataGoods
* @return
* @throws Exception
*/
public int updateByPrimaryKey(DataGoods dataGoods)throws Exception;
/**选择性修改数据商品
* @param dataGoods
* @return
* @throws Exception
*/
public int updateByPrimaryKeySelective(DataGoods dataGoods)throws Exception;
/**主键查询数据商品
* @param dataGoodsId
* @return
* @throws Exception
*/
public DataGoods selectByPrimaryKey(Long dataGoodsId)throws Exception;
/**主键删除数据商品
* @param dataGoodsId
* @return
* @throws Exception
*/
public int deleteByPrimaryKey(Long dataGoodsId)throws Exception;
/**条件查询数据商品
* @param param
* @return
* @throws Exception
*/
public List<DataGoodsDto> findList(Map<String, Object> param)throws Exception;
/**主键查询数据商品
* @param DataGoodsId
* @return
* @throws Exception
*/
public DataGoodsDto findById(Long dataGoodsId)throws Exception;
/**批量新增数据商品
* @param DataGoodses
* @throws Exception
*/
public void insertBatch(List<DataGoods> dataGoodses)throws Exception;
}
\ No newline at end of file
package com.jz.dm.mall.moduls.mapper; package com.jz.dm.mall.moduls.mapper;
import com.jz.common.base.BaseMapper; import com.jz.common.base.BaseMapper;
import com.jz.dm.mall.moduls.controller.finance.bean.EveryTradeFlowDto;
import com.jz.dm.mall.moduls.controller.finance.bean.FinanceCashOutDto; import com.jz.dm.mall.moduls.controller.finance.bean.FinanceCashOutDto;
import com.jz.dm.mall.moduls.controller.finance.bean.FinanceCustomerAssetsDto; import com.jz.dm.mall.moduls.controller.finance.bean.FinanceCustomerAssetsDto;
import com.jz.dm.mall.moduls.controller.finance.bean.FinanceTradeFlowDto;
import com.jz.dm.mall.moduls.entity.FinanceCashOut; import com.jz.dm.mall.moduls.entity.FinanceCashOut;
import com.jz.dm.mall.moduls.entity.FinanceTradeFlow; import com.jz.dm.mall.moduls.entity.FinanceTradeFlow;
...@@ -24,4 +26,8 @@ public interface FinanceTradeFlowDao extends BaseMapper<FinanceTradeFlow> { ...@@ -24,4 +26,8 @@ public interface FinanceTradeFlowDao extends BaseMapper<FinanceTradeFlow> {
List<FinanceCashOutDto> getCashOutAuditStutas(Map map) throws Exception; List<FinanceCashOutDto> getCashOutAuditStutas(Map map) throws Exception;
int addCashOutMoney(FinanceCashOut financeCashOut) throws Exception; int addCashOutMoney(FinanceCashOut financeCashOut) throws Exception;
List<FinanceTradeFlowDto> findListScTradeFlow(Map param) throws Exception;
List<EveryTradeFlowDto> findListEveryDayScInfo(Map param) throws Exception;
} }
\ No newline at end of file
...@@ -2,10 +2,9 @@ package com.jz.dm.mall.moduls.mapper; ...@@ -2,10 +2,9 @@ package com.jz.dm.mall.moduls.mapper;
import com.jz.common.base.BaseMapper; import com.jz.common.base.BaseMapper;
import com.jz.dm.mall.moduls.entity.MallCustomer; import com.jz.dm.mall.moduls.entity.MallCustomer;
import org.apache.ibatis.annotations.*;
import org.apache.ibatis.annotations.Insert; import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultType;
import org.apache.ibatis.annotations.Select;
import java.util.Map; import java.util.Map;
...@@ -43,7 +42,7 @@ public interface MallCustomerDao extends BaseMapper<MallCustomer> { ...@@ -43,7 +42,7 @@ public interface MallCustomerDao extends BaseMapper<MallCustomer> {
* 添加用户 * 添加用户
* @param mallCustomer * @param mallCustomer
*/ */
@Insert("INSERT into t_mall_customer(customer_account, customer_phone, password) VALUES (#{customerAccount},#{customerPhone}, #{password})") @Insert("INSERT into t_mall_customer(customer_account, customer_phone, password, register_time, cre_time) VALUES (#{customerAccount},#{customerPhone}, #{password},#{registerTime}, #{creTime})")
void saveCustomer(MallCustomer mallCustomer); void saveCustomer(MallCustomer mallCustomer);
...@@ -54,4 +53,8 @@ public interface MallCustomerDao extends BaseMapper<MallCustomer> { ...@@ -54,4 +53,8 @@ public interface MallCustomerDao extends BaseMapper<MallCustomer> {
*/ */
MallCustomer findById(@Param("customerId") Long customerId); MallCustomer findById(@Param("customerId") Long customerId);
void updatePassword(Map map);
MallCustomer selectByCustomerId(Long customerId);
} }
\ No newline at end of file
package com.jz.dm.mall.moduls.service;
/**
* api商品(TDataGoodsApi)表服务接口
*
* @author Bellamy
* @since 2020-12-01 10:41:31
*/
public interface DataGoodsApiService {
}
\ No newline at end of file
package com.jz.dm.mall.moduls.service;
import com.jz.common.bean.BaseBeanResponse;
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.request.DataGoodsRequest;
import com.jz.dm.mall.moduls.entity.DataGoods;
import javax.servlet.http.HttpServletRequest;
/**
* 数据商品(DataGoods)表服务接口
*
* @author Bellamy
* @since 2020-12-01 10:41:30
*/
public interface DataGoodsService {
/**条件查询所有数据商品
* @param DataGoodsRequest
* @param httpRequest
* @return
* @throws Exception
*/
public PageInfoResponse<DataGoodsDto> findList(DataGoodsRequest dataGoodsRequest, HttpServletRequest httpRequest)throws Exception;
/**新增数据商品
* @param DataGoods
* @param httpRequest
* @return
* @throws Exception
*/
public BaseBeanResponse<DataGoods> add(DataGoods dataGoods, HttpServletRequest httpRequest)throws Exception;
/**主键查询数据商品
* @param DataGoodsRequest
* @param httpRequest
* @return
* @throws Exception
*/
public BaseBeanResponse<DataGoodsDto> findById(DataGoodsRequest dataGoodsRequest, HttpServletRequest httpRequest)throws Exception;
/**修改数据商品
* @param DataGoods
* @param httpRequest
* @return
* @throws Exception
*/
public BaseBeanResponse<DataGoods> edit(DataGoods dataGoods, HttpServletRequest httpRequest)throws Exception;
/**主键删除数据商品
* @param DataGoodsRequest
* @param httpRequest
* @return
* @throws Exception
*/
public BaseResponse deleteById(DataGoodsRequest dataGoodsRequest, HttpServletRequest httpRequest)throws Exception;
}
\ No newline at end of file
package com.jz.dm.mall.moduls.service; package com.jz.dm.mall.moduls.service;
import com.jz.common.bean.BasePageBean;
import com.jz.common.bean.PageInfoResponse;
import com.jz.common.utils.Result; import com.jz.common.utils.Result;
import com.jz.dm.mall.moduls.controller.finance.bean.FinanceCashOutDto; import com.jz.dm.mall.moduls.controller.finance.bean.*;
import com.jz.dm.mall.moduls.controller.finance.bean.FinanceCashOutRequest;
import com.jz.dm.mall.moduls.controller.finance.bean.FinanceCustomerAssetsDto;
import com.jz.dm.mall.moduls.controller.finance.bean.FinanceCustomerBalanceRequest;
import javax.servlet.http.HttpServletRequest;
import java.util.Map; import java.util.Map;
/** /**
...@@ -24,4 +24,8 @@ public interface FinanceTradeFlowService { ...@@ -24,4 +24,8 @@ public interface FinanceTradeFlowService {
FinanceCashOutDto getCashOutAuditStutas(Map map) throws Exception; FinanceCashOutDto getCashOutAuditStutas(Map map) throws Exception;
Result<Object> addCashOutMoney(FinanceCashOutRequest financeCashOutRequest) throws Exception; Result<Object> addCashOutMoney(FinanceCashOutRequest financeCashOutRequest) throws Exception;
PageInfoResponse<FinanceTradeFlowDto> findListScTradeFlow(BasePageBean pageBean, HttpServletRequest req) throws Exception;
PageInfoResponse<EveryTradeFlowDto> findListEveryDayScInfo(EveryTradeFlowRequest everyTradeFlowRequest, HttpServletRequest req) throws Exception;
} }
\ No newline at end of file
package com.jz.dm.mall.moduls.service; package com.jz.dm.mall.moduls.service;
import com.jz.dm.mall.moduls.entity.MallCustomer; import com.jz.dm.mall.moduls.entity.MallCustomer;
import org.apache.ibatis.annotations.Param;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.util.Map; import java.util.Map;
...@@ -40,4 +41,17 @@ public interface MallCustomerService { ...@@ -40,4 +41,17 @@ public interface MallCustomerService {
*/ */
MallCustomer selectByPhone(String telephone); MallCustomer selectByPhone(String telephone);
/**
* 修改密码
* @param customerId
* @param password
*/
void updatePassword(Long customerId, String password);
/**
* 通过id查找用户信息
* @param customerId
* @return
*/
MallCustomer selectByUser(Long customerId);
} }
\ No newline at end of file
package com.jz.dm.mall.moduls.service.impl;
import com.jz.dm.mall.moduls.mapper.DataGoodsApiDao;
import com.jz.dm.mall.moduls.service.DataGoodsApiService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* api商品(TDataGoodsApi)表服务实现类
*
* @author Bellamy
* @since 2020-12-01 10:41:31
*/
@Service("dataGoodsApiService")
public class DataGoodsApiServiceImpl implements DataGoodsApiService {
@Autowired
private DataGoodsApiDao tDataGoodsApiDao;
}
\ No newline at end of file
package com.jz.dm.mall.moduls.service.impl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
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.dm.mall.moduls.controller.goods.bean.dto.DataGoodsDto;
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;
import com.jz.dm.mall.moduls.service.DataGoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils;
import javax.servlet.http.HttpServletRequest;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 数据商品(DataGoods)表服务实现类
*
* @author Bellamy
* @since 2020-12-01 10:41:30
*/
@Service("dataGoodsService")
public class DataGoodsServiceImpl implements DataGoodsService {
@Autowired
private DataGoodsDao dataGoodsDao;
@Override
public PageInfoResponse<DataGoodsDto> findList(DataGoodsRequest dataGoodsRequest, HttpServletRequest httpRequest)
throws Exception {
PageInfoResponse<DataGoodsDto> 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 (!StringUtils.isEmpty(dataGoodsRequest.getDataName())) {
param.put("dataName", dataGoodsRequest.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());
}
//价格类型: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 (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 (dataGoodsRequest.getMonthType() != null) {
param.put("monthType", dataGoodsRequest.getMonthType());
}
//次(元)
if (dataGoodsRequest.getSecondType() != null) {
param.put("secondType", dataGoodsRequest.getSecondType());
}
PageHelper.startPage(dataGoodsRequest.getPageNum(), dataGoodsRequest.getPageSize());
List<DataGoodsDto> list = dataGoodsDao.findList(param);
PageInfo<DataGoodsDto> pageInfo = new PageInfo<>(list);
pageInfoResponse.setCode(Constants.SUCCESS_CODE);
pageInfoResponse.setMessage("查询成功");
pageInfoResponse.setData(pageInfo);
return pageInfoResponse;
}
/* (non-Javadoc)
* @see com.ycxc.vmts.service.DataGoodsService#add(com.ycxc.vmts.entity.DataGoods, javax.servlet.http.HttpServletRequest)
*/
@Override
@Transactional(rollbackFor=Exception.class)
public BaseBeanResponse<DataGoods> add(DataGoods dataGoods, HttpServletRequest httpRequest) throws Exception {
BaseBeanResponse<DataGoods> baseBeanResponse = new BaseBeanResponse<>();
/*$*seDataGoodsIdCodeReplace*$*/
//创建人
//dataGoods.setCreateUser(getHttpRequestUserId(httpRequest));
//创建时间
dataGoods.setCreTime(new Date());
dataGoodsDao.insertSelective(dataGoods);
baseBeanResponse.setCode(Constants.SUCCESS_CODE);
baseBeanResponse.setMessage("新增成功");
baseBeanResponse.setData(dataGoods);
return baseBeanResponse;
}
/* (non-Javadoc)
* @see com.ycxc.vmts.service.DataGoodsService#edit(com.ycxc.vmts.entity.DataGoods, javax.servlet.http.HttpServletRequest)
*/
@Override
@Transactional(rollbackFor=Exception.class)
public BaseBeanResponse<DataGoods> edit(DataGoods dataGoods, HttpServletRequest httpRequest) throws Exception {
BaseBeanResponse<DataGoods> baseBeanResponse = new BaseBeanResponse<>();
//修改人
//dataGoods.setUpdateUser(getHttpRequestUserId(httpRequest));
//修改时间
dataGoods.setUptTime(new Date());
dataGoodsDao.updateByPrimaryKeySelective(dataGoods);
baseBeanResponse.setCode(Constants.SUCCESS_CODE);
baseBeanResponse.setMessage("修改成功");
baseBeanResponse.setData(dataGoods);
return baseBeanResponse;
}
/* (non-Javadoc)
* @see com.ycxc.vmts.service.DataGoodsService#findById(com.ycxc.vmts.controller.bean.DataGoodsRequest, javax.servlet.http.HttpServletRequest)
*/
@Override
public BaseBeanResponse<DataGoodsDto> findById(DataGoodsRequest dataGoodsRequest, HttpServletRequest httpRequest)
throws Exception {
BaseBeanResponse<DataGoodsDto> baseBeanResponse = new BaseBeanResponse<>();
DataGoodsDto DataGoodsDto = dataGoodsDao.findById(dataGoodsRequest.getDataGoodsId());
baseBeanResponse.setCode(Constants.SUCCESS_CODE);
baseBeanResponse.setMessage("查询成功");
baseBeanResponse.setData(DataGoodsDto);
return baseBeanResponse;
}
/* (non-Javadoc)
* @see com.ycxc.vmts.service.DataGoodsService#deleteById(com.ycxc.vmts.controller.bean.DataGoodsRequest, javax.servlet.http.HttpServletRequest)
*/
@Override
@Transactional(rollbackFor=Exception.class)
public BaseResponse deleteById(DataGoodsRequest dataGoodsRequest, HttpServletRequest httpRequest)
throws Exception {
BaseResponse baseResponse = new BaseResponse();
dataGoodsDao.deleteByPrimaryKey(dataGoodsRequest.getDataGoodsId());
baseResponse.setCode(Constants.SUCCESS_CODE);
baseResponse.setMessage("删除成功");
return baseResponse;
}
}
\ No newline at end of file
package com.jz.dm.mall.moduls.service.impl; package com.jz.dm.mall.moduls.service.impl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.jz.common.bean.BasePageBean;
import com.jz.common.bean.PageInfoResponse;
import com.jz.common.constant.Constants;
import com.jz.common.enums.AuditStatusEnum; import com.jz.common.enums.AuditStatusEnum;
import com.jz.common.utils.CommonsUtil;
import com.jz.common.utils.Result; import com.jz.common.utils.Result;
import com.jz.dm.mall.moduls.controller.finance.bean.FinanceCashOutDto; import com.jz.dm.mall.moduls.controller.finance.bean.*;
import com.jz.dm.mall.moduls.controller.finance.bean.FinanceCashOutRequest;
import com.jz.dm.mall.moduls.controller.finance.bean.FinanceCustomerAssetsDto;
import com.jz.dm.mall.moduls.controller.finance.bean.FinanceCustomerBalanceRequest;
import com.jz.dm.mall.moduls.entity.FinanceCashOut; import com.jz.dm.mall.moduls.entity.FinanceCashOut;
import com.jz.dm.mall.moduls.entity.FinanceCustomerAssets; import com.jz.dm.mall.moduls.entity.FinanceCustomerAssets;
import com.jz.dm.mall.moduls.entity.FinanceCustomerBalance; import com.jz.dm.mall.moduls.entity.FinanceCustomerBalance;
import com.jz.dm.mall.moduls.mapper.FinanceCustomerAssetsDao; import com.jz.dm.mall.moduls.mapper.FinanceCustomerAssetsDao;
import com.jz.dm.mall.moduls.mapper.FinanceTradeFlowDao; import com.jz.dm.mall.moduls.mapper.FinanceTradeFlowDao;
import com.jz.dm.mall.moduls.service.FinanceTradeFlowService; import com.jz.dm.mall.moduls.service.FinanceTradeFlowService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
...@@ -124,11 +129,47 @@ public class FinanceTradeFlowServiceImpl implements FinanceTradeFlowService { ...@@ -124,11 +129,47 @@ public class FinanceTradeFlowServiceImpl implements FinanceTradeFlowService {
return result; return result;
} }
} else { } else {
result.setMessage("提交失败!"); result.setMessage("提现金额必须小于等于可用金额!");
result.setCode(500); result.setCode(500);
return result; return result;
} }
} }
return result; return result;
} }
@Override
public PageInfoResponse<FinanceTradeFlowDto> findListScTradeFlow(BasePageBean pageBean, HttpServletRequest req) throws Exception {
PageInfoResponse<FinanceTradeFlowDto> pageInfoResponse = new PageInfoResponse<>();
PageHelper.startPage(pageBean.getPageNum(), pageBean.getPageSize());
Map param = new HashMap();
//param.put("assetsId",assetsId); //企业资产id
List<FinanceTradeFlowDto> list = financeTradeFlowDao.findListScTradeFlow(param);
PageInfo<FinanceTradeFlowDto> pageInfo = new PageInfo<>(list);
pageInfoResponse.setCode(Constants.SUCCESS_CODE);
pageInfoResponse.setMessage("查询成功");
pageInfoResponse.setData(pageInfo);
return pageInfoResponse;
}
@Override
public PageInfoResponse<EveryTradeFlowDto> findListEveryDayScInfo(EveryTradeFlowRequest everyTradeFlowRequest, HttpServletRequest req) throws Exception {
PageInfoResponse<EveryTradeFlowDto> pageInfoResponse = new PageInfoResponse<>();
PageHelper.startPage(everyTradeFlowRequest.getPageNum(), everyTradeFlowRequest.getPageSize());
Map param = new HashMap();
//商品分类id(行业)
if (!StringUtils.isEmpty(everyTradeFlowRequest.getCreTime())) {
param.put("creTime", everyTradeFlowRequest.getCreTime());
}
//param.put("assetsId",assetsId); //企业资产id
List<EveryTradeFlowDto> list = financeTradeFlowDao.findListEveryDayScInfo(param);
PageInfo<EveryTradeFlowDto> pageInfo = new PageInfo<>(list);
pageInfoResponse.setCode(Constants.SUCCESS_CODE);
pageInfoResponse.setMessage("查询成功");
pageInfoResponse.setData(pageInfo);
return pageInfoResponse;
}
} }
\ No newline at end of file
...@@ -3,18 +3,22 @@ package com.jz.dm.mall.moduls.service.impl; ...@@ -3,18 +3,22 @@ package com.jz.dm.mall.moduls.service.impl;
import com.jz.common.constant.RedisMessageConstant; import com.jz.common.constant.RedisMessageConstant;
import com.jz.common.enums.UserTypeEnum; import com.jz.common.enums.UserTypeEnum;
import com.jz.common.utils.DateUtils;
import com.jz.common.utils.Result; import com.jz.common.utils.Result;
import com.jz.common.utils.SessionUtils; import com.jz.common.utils.SessionUtils;
import com.jz.common.bean.MallCustomerApiDto; import com.jz.common.bean.MallCustomerApiDto;
import com.jz.dm.mall.moduls.entity.MallCustomer; import com.jz.dm.mall.moduls.entity.MallCustomer;
import com.jz.dm.mall.moduls.mapper.MallCustomerDao; import com.jz.dm.mall.moduls.mapper.MallCustomerDao;
import com.jz.dm.mall.moduls.service.MallCustomerService; import com.jz.dm.mall.moduls.service.MallCustomerService;
import freemarker.template.utility.DateUtil;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.util.Date;
import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
...@@ -107,6 +111,8 @@ public class MallCustomerServiceImpl implements MallCustomerService { ...@@ -107,6 +111,8 @@ public class MallCustomerServiceImpl implements MallCustomerService {
mallCustomer.setCustomerAccount(username); mallCustomer.setCustomerAccount(username);
mallCustomer.setPassword(paramMap.get("password")); mallCustomer.setPassword(paramMap.get("password"));
mallCustomer.setCustomerPhone(telephone); mallCustomer.setCustomerPhone(telephone);
mallCustomer.setCreTime(DateUtils.getToday());
mallCustomer.setRegisterTime(DateUtils.getToday());
tMallCustomerDao.saveCustomer(mallCustomer); tMallCustomerDao.saveCustomer(mallCustomer);
} }
} }
...@@ -125,5 +131,34 @@ public class MallCustomerServiceImpl implements MallCustomerService { ...@@ -125,5 +131,34 @@ public class MallCustomerServiceImpl implements MallCustomerService {
return null; return null;
} }
/**
* 修改密码
*
* @param customerId
* @param password
*/
@Override
public void updatePassword(Long customerId, String password) {
MallCustomer mallCustomer = tMallCustomerDao.selectByCustomerId(customerId);
if (mallCustomer != null) {
Map map = new HashMap();
map.put("password", password);
map.put("customerId", customerId);
tMallCustomerDao.updatePassword(map);
}
}
/**
* 通过id查找用户信息
*
* @param customerId
* @return
*/
@Override
public MallCustomer selectByUser(Long customerId) {
MallCustomer mallCustomer = tMallCustomerDao.selectByCustomerId(customerId);
return mallCustomer;
}
} }
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.jz.dm.mall.moduls.mapper.DataGoodsApiDao">
<resultMap type="com.jz.dm.mall.moduls.entity.DataGoodsApi" id="TDataGoodsApiMap">
<result property="goodsApi" column="goods_api" jdbcType="INTEGER"/>
<result property="dataGoodsId" column="data_goods_id" jdbcType="INTEGER"/>
<result property="apiName" column="api_name" jdbcType="VARCHAR"/>
<result property="requestType" column="request_type" jdbcType="VARCHAR"/>
<result property="apiUrl" column="api_url" jdbcType="VARCHAR"/>
<result property="apiMethod" column="api_method" jdbcType="VARCHAR"/>
<result property="apiProtocl" column="api_protocl" jdbcType="VARCHAR"/>
<result property="returnDataExample" column="return_data_example" jdbcType="VARCHAR"/>
<result property="requestExample" column="request_example" jdbcType="VARCHAR"/>
<result property="returnType" column="return_type" jdbcType="VARCHAR"/>
<result property="apiKey" column="api_key" jdbcType="VARCHAR"/>
<result property="creTime" column="cre_time" jdbcType="TIMESTAMP"/>
<result property="crePerson" column="cre_person" jdbcType="VARCHAR"/>
<result property="uptPerson" column="upt_person" jdbcType="VARCHAR"/>
<result property="uptTime" column="upt_time" jdbcType="TIMESTAMP"/>
<result property="delFlag" column="del_flag" jdbcType="VARCHAR"/>
</resultMap>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.jz.dm.mall.moduls.mapper.DataGoodsDao">
<resultMap type="com.jz.dm.mall.moduls.entity.DataGoods" id="TDataGoodsMap">
<result property="dataGoodsId" column="data_goods_id" jdbcType="INTEGER"/>
<result property="categoryId" column="category_id" jdbcType="INTEGER"/>
<result property="userId" column="user_id" jdbcType="INTEGER"/>
<result property="dataName" column="data_name" jdbcType="VARCHAR"/>
<result property="dataType" column="data_type" jdbcType="VARCHAR"/>
<result property="dataLabel" column="data_label" jdbcType="VARCHAR"/>
<result property="dataPicture" column="data_picture" jdbcType="VARCHAR"/>
<result property="dataPrice" column="data_price" jdbcType="NUMERIC"/>
<result property="discountPrice" column="discount_price" jdbcType="NUMERIC"/>
<result property="priceType" column="price_type" jdbcType="VARCHAR"/>
<result property="goodsStandards" column="goods_standards" jdbcType="VARCHAR"/>
<result property="dataStatus" column="data_status" jdbcType="VARCHAR"/>
<result property="auditStatus" column="audit_status" jdbcType="VARCHAR"/>
<result property="cleanRule" column="clean_rule" jdbcType="VARCHAR"/>
<result property="rejectReason" column="reject_reason" jdbcType="VARCHAR"/>
<result property="auditPerson" column="audit_person" jdbcType="VARCHAR"/>
<result property="auditTime" column="audit_time" jdbcType="TIMESTAMP"/>
<result property="creTime" column="cre_time" jdbcType="TIMESTAMP"/>
<result property="crePerson" column="cre_person" jdbcType="VARCHAR"/>
<result property="uptTime" column="upt_time" jdbcType="TIMESTAMP"/>
<result property="uptPerson" column="upt_person" jdbcType="VARCHAR"/>
<result property="delFlag" column="del_flag" jdbcType="VARCHAR"/>
<result property="yearType" column="year_type" jdbcType="NUMERIC"/>
<result property="seasonType" column="season_type" jdbcType="NUMERIC"/>
<result property="monthType" column="month_type" jdbcType="NUMERIC"/>
<result property="secondType" column="second_type" jdbcType="NUMERIC"/>
</resultMap>
<!--查询单个-->
<select id="queryById" 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 data_goods_id = #{dataGoodsId}
</select>
<!--查询指定行数据-->
<select id="queryAllByLimit" 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
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)
values (#{categoryId}, #{userId}, #{dataName}, #{dataType}, #{dataLabel}, #{dataPicture}, #{dataPrice}, #{discountPrice}, #{priceType}, #{goodsStandards}, #{dataStatus}, #{auditStatus}, #{cleanRule}, #{rejectReason}, #{auditPerson}, #{auditTime}, #{creTime}, #{crePerson}, #{uptTime}, #{uptPerson}, #{delFlag}, #{yearType}, #{seasonType}, #{monthType}, #{secondType})
</insert>
<insert id="insertBatch" 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)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.categoryId}, #{entity.userId}, #{entity.dataName}, #{entity.dataType}, #{entity.dataLabel},
#{entity.dataPicture}, #{entity.dataPrice}, #{entity.discountPrice}, #{entity.priceType},
#{entity.goodsStandards}, #{entity.dataStatus}, #{entity.auditStatus}, #{entity.cleanRule},
#{entity.rejectReason}, #{entity.auditPerson}, #{entity.auditTime}, #{entity.creTime}, #{entity.crePerson},
#{entity.uptTime}, #{entity.uptPerson}, #{entity.delFlag}, #{entity.yearType}, #{entity.seasonType},
#{entity.monthType}, #{entity.secondType})
</foreach>
</insert>
<!--通过主键修改数据-->
<update id="update">
update t_data_goods
<set>
<if test="categoryId != null">
category_id = #{categoryId},
</if>
<if test="userId != null">
user_id = #{userId},
</if>
<if test="dataName != null and dataName != ''">
data_name = #{dataName},
</if>
<if test="dataType != null and dataType != ''">
data_type = #{dataType},
</if>
<if test="dataLabel != null and dataLabel != ''">
data_label = #{dataLabel},
</if>
<if test="dataPicture != null and dataPicture != ''">
data_picture = #{dataPicture},
</if>
<if test="dataPrice != null">
data_price = #{dataPrice},
</if>
<if test="discountPrice != null">
discount_price = #{discountPrice},
</if>
<if test="priceType != null and priceType != ''">
price_type = #{priceType},
</if>
<if test="goodsStandards != null and goodsStandards != ''">
goods_standards = #{goodsStandards},
</if>
<if test="dataStatus != null and dataStatus != ''">
data_status = #{dataStatus},
</if>
<if test="auditStatus != null and auditStatus != ''">
audit_status = #{auditStatus},
</if>
<if test="cleanRule != null and cleanRule != ''">
clean_rule = #{cleanRule},
</if>
<if test="rejectReason != null and rejectReason != ''">
reject_reason = #{rejectReason},
</if>
<if test="auditPerson != null and auditPerson != ''">
audit_person = #{auditPerson},
</if>
<if test="auditTime != null">
audit_time = #{auditTime},
</if>
<if test="creTime != null">
cre_time = #{creTime},
</if>
<if test="crePerson != null and crePerson != ''">
cre_person = #{crePerson},
</if>
<if test="uptTime != null">
upt_time = #{uptTime},
</if>
<if test="uptPerson != null and uptPerson != ''">
upt_person = #{uptPerson},
</if>
<if test="delFlag != null and delFlag != ''">
del_flag = #{delFlag},
</if>
<if test="yearType != null">
year_type = #{yearType},
</if>
<if test="seasonType != null">
season_type = #{seasonType},
</if>
<if test="monthType != null">
month_type = #{monthType},
</if>
<if test="secondType != null">
second_type = #{secondType},
</if>
</set>
where data_goods_id = #{dataGoodsId}
</update>
<!--通过主键删除-->
<delete id="deleteById">
delete from t_data_goods where data_goods_id = #{dataGoodsId}
</delete>
</mapper>
\ No newline at end of file
...@@ -136,6 +136,9 @@ ...@@ -136,6 +136,9 @@
<if test="totalMoney != null"> <if test="totalMoney != null">
total_money = #{totalMoney}, total_money = #{totalMoney},
</if> </if>
<if test="frozenMoney != null">
frozen_money = #{frozenMoney},
</if>
<if test="uptTime != null"> <if test="uptTime != null">
upt_time = #{uptTime}, upt_time = #{uptTime},
</if> </if>
......
...@@ -35,4 +35,56 @@ ...@@ -35,4 +35,56 @@
#{payTime}, #{payPerson}, #{remark}, #{auditStatus}, #{crePerson}, #{creTime}, #{delFlag}) #{payTime}, #{payPerson}, #{remark}, #{auditStatus}, #{crePerson}, #{creTime}, #{delFlag})
</insert> </insert>
<!--商城利润中心每天收支情况-->
<select id="findListScTradeFlow" resultType="com.jz.dm.mall.moduls.controller.finance.bean.FinanceTradeFlowDto" parameterType="map">
select
sum(case when a.tradeType='01' then a.tradeMoney else 0 end) cashOutMoney,
sum(case when a.tradeType='02' then a.tradeMoney else 0 end) rechargeMoney,
sum(case when a.tradeType='03' then a.tradeMoney else 0 end) payMoey,
sum(case when a.tradeType='04' then a.tradeMoney else 0 end) receiveMoey,
a.creTime,
a.balanceMoney
from(
select
t.trade_type as tradeType,
t.trade_money as tradeMoney,
t.balance_money as balanceMoney,
date_format(t.cre_time,'%Y-%m-%d') as creTime
from t_finance_trade_flow t
inner join t_finance_customer_assets t1 on t1.assets_id=t.assets_id
where 1=1 and date_format(NOW(),'%Y-%m-%d') > date_format(t.cre_time,'%Y-%m-%d')
<if test="assetsId != null">and t.assets_id = #{assetsId}</if>
) a
group by a.creTime
order by a.creTime desc
</select>
<!--商城利润中心每天收支情况明细-->
<select id="findListEveryDayScInfo" resultType="com.jz.dm.mall.moduls.controller.finance.bean.EveryTradeFlowDto" parameterType="map">
select
t.trade_flow_number as tradeFlowNumber,
(case when t.trade_type ='01' then '提现' when t.trade_type ='02' then '充值' when t.trade_type ='03' then '支付'
when t.trade_type ='04' then '收入' end) as tradeType,
t.trade_type as tradeTypeId,
t.cre_time as creTime,
t.trade_money as tradeMoney,
t.balance_money as balanceMoney,
a.data_name as dataName,
(case when a.purchase_method ='01' then '年' when a.purchase_method ='02' then '季' when a.purchase_method ='03' then '月'
when a.purchase_method ='04' then '次' end) as purchaseMethod
from t_finance_trade_flow t
left join (
select
t1.order_id,
t3.data_name,
t1.purchase_method
from t_order_goods_info t2
inner join t_order t1 on t1.order_id=t2.order_id
inner join t_data_goods t3 on t2.data_goods_id=t3.data_goods_id
) a on a.order_id=t.order_id
where 1=1
<if test="assetsId != null">and t.assets_id = #{assetsId}</if>
<if test="creTime != null">and date_format(t.cre_time,'%Y-%m-%d')= #{creTime}</if>
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -204,4 +204,15 @@ ...@@ -204,4 +204,15 @@
WHERE customer_id =#{customerId} WHERE customer_id =#{customerId}
AND del_flag ='N' AND del_flag ='N'
</select> </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>
</mapper> </mapper>
\ No newline at end of file
package com.jz.manage.moduls.controller.finance; package com.jz.manage.moduls.controller.finance;
import com.jz.common.bean.BasePageBean;
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.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.service.PlatformTradeFlowInfoService; import com.jz.manage.moduls.service.PlatformTradeFlowInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;
/** /**
* 平台交易流水(TPlatformTradeFlowInfo)表控制层 * 平台交易流水(TPlatformTradeFlowInfo)表控制层
* *
...@@ -14,12 +29,84 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -14,12 +29,84 @@ import org.springframework.web.bind.annotation.RestController;
*/ */
@RestController @RestController
@RequestMapping("platformTradeFlowInfo") @RequestMapping("platformTradeFlowInfo")
@Api(tags = "平台--利润中心")
public class PlatformTradeFlowInfoController extends BaseController { public class PlatformTradeFlowInfoController extends BaseController {
/** /**
* 服务对象 * 服务对象
*/ */
@Autowired @Autowired
private PlatformTradeFlowInfoService tPlatformTradeFlowInfoService; private PlatformTradeFlowInfoService platformTradeFlowInfoService;
/**
* 获取平台累计收入和企业总数
*
* @author Bellamy
* @since 2020-12-03
*/
@GetMapping(value = "/platFormMoneyAndDepart")
@ApiOperation(value = "财务管理---累计收入和企业总数", notes = "累计收入和企业总数")
public Result<PlatFormMoneyAndDepartDto> getPlatFormMoneyAndDepart(HttpServletRequest requset) throws Exception {
Result<PlatFormMoneyAndDepartDto> result = new Result<>();
Map map = new HashMap();
//从session中获取平台用户id
//SysUserDto user = (SysUserDto) SessionUtils.getUserCurrent(requset,"sysUser");
//map.put("userId", user.getUserId());
PlatFormMoneyAndDepartDto dto = platformTradeFlowInfoService.queryPlatFormMoneyAndDepart(map);
result.setData(dto);
return result;
}
/**
* 财务管理---我的订单
*
* @return
* @author Bellamy
* @since 2020-12-03
*/
@GetMapping(value = "/orderCountList")
@ApiOperation(value = "财务管理---我的订单", notes = "我的订单")
public PageInfoResponse<OrderCountInfoDto> findList(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);
} catch (Exception e) {
pageInfo.setMessage("查询失败");
pageInfo.setCode(Constants.FAILURE_CODE);
e.printStackTrace();
}
return pageInfo;
}
/**
* 财务管理--交易明细
*
* @return
* @author Bellamy
* @since 2020-12-03
*/
@GetMapping(value = "/tradeDetilList")
@ApiOperation(value = "财务管理--交易明细", notes = "交易明细")
public PageInfoResponse<TradeDetilDto> getFinanceTradeDetil(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);
} catch (Exception e) {
pageInfo.setMessage("查询失败");
pageInfo.setCode(Constants.FAILURE_CODE);
e.printStackTrace();
}
return pageInfo;
}
} }
\ 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-01 10:41:43
*/
@ApiModel(value = "累计收入和企业总数返回对象", description = "累计收入和企业总数返回对象")
public class OrderCountInfoDto {
/**
* 累计收入
*/
@ApiModelProperty(value = "累计收入")
private BigDecimal platformReceiveMoney;
/**
* 企业总数
*/
@ApiModelProperty(value = "企业总数")
private String departTotal;
public BigDecimal getPlatformReceiveMoney() {
return platformReceiveMoney;
}
public void setPlatformReceiveMoney(BigDecimal platformReceiveMoney) {
this.platformReceiveMoney = platformReceiveMoney;
}
public String getDepartTotal() {
return departTotal;
}
public void setDepartTotal(String departTotal) {
this.departTotal = departTotal;
}
}
\ 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-01 10:41:43
*/
@ApiModel(value = "累计收入和企业总数返回对象", description = "累计收入和企业总数返回对象")
public class PlatFormMoneyAndDepartDto {
/**
* 累计收入
*/
@ApiModelProperty(value = "累计收入")
private BigDecimal platformReceiveMoney;
/**
* 企业总数
*/
@ApiModelProperty(value = "企业总数")
private String departTotal;
public BigDecimal getPlatformReceiveMoney() {
return platformReceiveMoney;
}
public void setPlatformReceiveMoney(BigDecimal platformReceiveMoney) {
this.platformReceiveMoney = platformReceiveMoney;
}
public String getDepartTotal() {
return departTotal;
}
public void setDepartTotal(String departTotal) {
this.departTotal = departTotal;
}
}
\ 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;
import java.math.BigDecimal;
/**
* 平台利润中心--财务管理交易明细返回对象
*
* @author Bellamy
* @since 2020-12-01 10:41:43
*/
@ApiModel(value = "财务管理--交易明细返回对象", description = "交易明细返回对象")
public class TradeDetilDto extends BasePageBean {
/**
* 企业名
*/
@ApiModelProperty(value = "企业名")
private BigDecimal departmentName;
/**
* 数据名称
*/
@ApiModelProperty(value = "数据名称")
private String dataName;
/**
* 数据行业
*/
@ApiModelProperty(value = "数据行业")
private String categoryId;
/**
* 订单方式
*/
@ApiModelProperty(value = "订单方式")
private String orderMethod;
public BigDecimal getDepartmentName() {
return departmentName;
}
public void setDepartmentName(BigDecimal departmentName) {
this.departmentName = departmentName;
}
public String getDataName() {
return dataName;
}
public void setDataName(String dataName) {
this.dataName = dataName;
}
public String getCategoryId() {
return categoryId;
}
public void setCategoryId(String categoryId) {
this.categoryId = categoryId;
}
public String getOrderMethod() {
return orderMethod;
}
public void setOrderMethod(String orderMethod) {
this.orderMethod = orderMethod;
}
}
\ 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;
import java.math.BigDecimal;
/**
* 平台利润中心--财务管理交易明细参数对象
*
* @author Bellamy
* @since 2020-12-01 10:41:43
*/
@ApiModel(value = "财务管理--交易明细参数对象", description = "交易明细参数对象")
public class TradeDetilRequest extends BasePageBean {
/**
* 企业名
*/
@ApiModelProperty(value = "企业名")
private BigDecimal departmentName;
/**
* 数据名称
*/
@ApiModelProperty(value = "数据名称")
private String dataName;
/**
* 数据行业
*/
@ApiModelProperty(value = "数据行业")
private String categoryId;
/**
* 订单方式
*/
@ApiModelProperty(value = "订单方式")
private String orderMethod;
public BigDecimal getDepartmentName() {
return departmentName;
}
public void setDepartmentName(BigDecimal departmentName) {
this.departmentName = departmentName;
}
public String getDataName() {
return dataName;
}
public void setDataName(String dataName) {
this.dataName = dataName;
}
public String getCategoryId() {
return categoryId;
}
public void setCategoryId(String categoryId) {
this.categoryId = categoryId;
}
public String getOrderMethod() {
return orderMethod;
}
public void setOrderMethod(String orderMethod) {
this.orderMethod = orderMethod;
}
}
\ No newline at end of file
...@@ -42,7 +42,7 @@ public class LoginController extends BaseController { ...@@ -42,7 +42,7 @@ public class LoginController extends BaseController {
// 如果是手机验证 // 如果是手机验证
if (username.matches(username)) { if (username.matches(username)) {
SysUser sysUser = sysUserService.selectByPhone(username); SysUser sysUser = sysUserService.selectByPhone(username, request);
if (sysUser != null) { if (sysUser != null) {
if (sysUser.getTelephone().equals(username) && sysUser.getPassword().equals(password)){ if (sysUser.getTelephone().equals(username) && sysUser.getPassword().equals(password)){
return new Result<>(true, "登录成功!", StatusCode.OK); return new Result<>(true, "登录成功!", StatusCode.OK);
...@@ -50,7 +50,7 @@ public class LoginController extends BaseController { ...@@ -50,7 +50,7 @@ public class LoginController extends BaseController {
return new Result<>(false, "用户名或密码错误!", StatusCode.ERROR); return new Result<>(false, "用户名或密码错误!", StatusCode.ERROR);
} }
} }
SysUser sysUser = sysUserService.selectByUsername(username); SysUser sysUser = sysUserService.selectByUsername(username, request);
if (sysUser != null) { if (sysUser != null) {
if (sysUser.getAccount().equals(username) && sysUser.getPassword().equals(password)){ if (sysUser.getAccount().equals(username) && sysUser.getPassword().equals(password)){
return new Result<>(true, "登录成功!", StatusCode.OK); return new Result<>(true, "登录成功!", StatusCode.OK);
......
...@@ -2,6 +2,12 @@ package com.jz.manage.moduls.mapper; ...@@ -2,6 +2,12 @@ package com.jz.manage.moduls.mapper;
import com.jz.common.base.BaseMapper; import com.jz.common.base.BaseMapper;
import com.jz.common.entity.PlatformTradeFlowInfo; import com.jz.common.entity.PlatformTradeFlowInfo;
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 java.util.List;
import java.util.Map;
/** /**
* 平台交易流水(TPlatformTradeFlowInfo)表数据库访问层 * 平台交易流水(TPlatformTradeFlowInfo)表数据库访问层
...@@ -11,4 +17,9 @@ import com.jz.common.entity.PlatformTradeFlowInfo; ...@@ -11,4 +17,9 @@ import com.jz.common.entity.PlatformTradeFlowInfo;
*/ */
public interface PlatformTradeFlowInfoDao extends BaseMapper<PlatformTradeFlowInfo> { public interface PlatformTradeFlowInfoDao extends BaseMapper<PlatformTradeFlowInfo> {
PlatFormMoneyAndDepartDto queryPlatFormMoneyAndDepart(Map map) throws Exception;
List<OrderCountInfoDto> findListOrderCount(Map param) throws Exception;
List<TradeDetilDto> findListFinanceTradeDetil(Map param) throws Exception;
} }
\ No newline at end of file
package com.jz.manage.moduls.service; package com.jz.manage.moduls.service;
import com.jz.common.bean.BasePageBean;
import com.jz.common.bean.PageInfoResponse;
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 javax.servlet.http.HttpServletRequest;
import java.util.Map;
/** /**
* 平台交易流水(TPlatformTradeFlowInfo)表服务接口 * 平台交易流水(TPlatformTradeFlowInfo)表服务接口
* *
...@@ -9,5 +19,9 @@ package com.jz.manage.moduls.service; ...@@ -9,5 +19,9 @@ package com.jz.manage.moduls.service;
public interface PlatformTradeFlowInfoService { public interface PlatformTradeFlowInfoService {
PlatFormMoneyAndDepartDto queryPlatFormMoneyAndDepart(Map map) throws Exception ;
PageInfoResponse<OrderCountInfoDto> findListOrderCount(BasePageBean pageBean, HttpServletRequest httpRequest) throws Exception ;
PageInfoResponse<TradeDetilDto> findListFinanceTradeDetil(TradeDetilRequest tradeDetilRequest, HttpServletRequest httpRequest) throws Exception ;
} }
\ No newline at end of file
...@@ -3,6 +3,7 @@ package com.jz.manage.moduls.service; ...@@ -3,6 +3,7 @@ package com.jz.manage.moduls.service;
import com.jz.common.entity.SysUser; import com.jz.common.entity.SysUser;
import javax.servlet.http.HttpServletRequest;
import java.util.Map; import java.util.Map;
/** /**
...@@ -16,9 +17,9 @@ public interface SysUserService { ...@@ -16,9 +17,9 @@ public interface SysUserService {
/* /*
* 通过用户帐号进行查询 * 通过用户帐号进行查询
* */ * */
SysUser selectByUsername(String username); SysUser selectByUsername(String username, HttpServletRequest request);
SysUser selectByPhone(String telephone); SysUser selectByPhone(String telephone, HttpServletRequest request);
Map<String,Object> getUserRoleByAccount(String account); Map<String,Object> getUserRoleByAccount(String account);
} }
\ No newline at end of file
package com.jz.manage.moduls.service.impl; package com.jz.manage.moduls.service.impl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.jz.common.bean.BasePageBean;
import com.jz.common.bean.PageInfoResponse;
import com.jz.common.constant.Constants;
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.mapper.PlatformTradeFlowInfoDao; import com.jz.manage.moduls.mapper.PlatformTradeFlowInfoDao;
import com.jz.manage.moduls.service.PlatformTradeFlowInfoService; import com.jz.manage.moduls.service.PlatformTradeFlowInfoService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/** /**
* 平台交易流水(TPlatformTradeFlowInfo)表服务实现类 * 平台交易流水(TPlatformTradeFlowInfo)表服务实现类
...@@ -12,7 +27,52 @@ import org.springframework.stereotype.Service; ...@@ -12,7 +27,52 @@ import org.springframework.stereotype.Service;
* @since 2020-12-01 10:41:44 * @since 2020-12-01 10:41:44
*/ */
@Service("platformTradeFlowInfoService") @Service("platformTradeFlowInfoService")
@Transactional
public class PlatformTradeFlowInfoServiceImpl implements PlatformTradeFlowInfoService { public class PlatformTradeFlowInfoServiceImpl implements PlatformTradeFlowInfoService {
@Autowired @Autowired
private PlatformTradeFlowInfoDao tPlatformTradeFlowInfoDao; private PlatformTradeFlowInfoDao platformTradeFlowInfoDao;
@Override
public PlatFormMoneyAndDepartDto queryPlatFormMoneyAndDepart(Map map) throws Exception {
return platformTradeFlowInfoDao.queryPlatFormMoneyAndDepart(map);
}
@Override
public PageInfoResponse<OrderCountInfoDto> findListOrderCount(BasePageBean pageBean, HttpServletRequest httpRequest) throws Exception {
PageInfoResponse<OrderCountInfoDto> pageInfoResponse = new PageInfoResponse<>();
Map param = new HashMap();
//从session中获取平台用户id
//SysUserDto user = (SysUserDto) SessionUtils.getUserCurrent(requset,"sysUser");
//map.put("userId", user.getUserId());
PageHelper.startPage(pageBean.getPageNum(), pageBean.getPageSize());
List<OrderCountInfoDto> list = platformTradeFlowInfoDao.findListOrderCount(param);
PageInfo<OrderCountInfoDto> pageInfo = new PageInfo<>(list);
pageInfoResponse.setCode(Constants.SUCCESS_CODE);
pageInfoResponse.setMessage("查询成功");
pageInfoResponse.setData(pageInfo);
return pageInfoResponse;
}
@Override
public PageInfoResponse<TradeDetilDto> findListFinanceTradeDetil(TradeDetilRequest tradeDetilRequest, HttpServletRequest httpRequest) throws Exception {
PageInfoResponse<TradeDetilDto> pageInfoResponse = new PageInfoResponse<>();
Map param = new HashMap();
//从session中获取平台用户id
//SysUserDto user = (SysUserDto) SessionUtils.getUserCurrent(requset,"sysUser");
//map.put("userId", user.getUserId());
PageHelper.startPage(tradeDetilRequest.getPageNum(), tradeDetilRequest.getPageSize());
List<TradeDetilDto> list = platformTradeFlowInfoDao.findListFinanceTradeDetil(param);
PageInfo<TradeDetilDto> pageInfo = new PageInfo<>(list);
pageInfoResponse.setCode(Constants.SUCCESS_CODE);
pageInfoResponse.setMessage("查询成功");
pageInfoResponse.setData(pageInfo);
return pageInfoResponse;
}
} }
\ No newline at end of file
...@@ -13,6 +13,7 @@ import org.springframework.data.redis.core.RedisTemplate; ...@@ -13,6 +13,7 @@ import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletRequest;
import java.util.*; import java.util.*;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
...@@ -34,7 +35,7 @@ public class SysUserServiceImpl implements SysUserService { ...@@ -34,7 +35,7 @@ public class SysUserServiceImpl implements SysUserService {
@Override @Override
public SysUser selectByUsername(String username) { public SysUser selectByUsername(String username, HttpServletRequest request) {
QueryWrapper queryWrapper = new QueryWrapper(); QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.eq("account", username); queryWrapper.eq("account", username);
SysUser sysUser = sysUserDao.selectOne(queryWrapper); SysUser sysUser = sysUserDao.selectOne(queryWrapper);
...@@ -47,7 +48,7 @@ public class SysUserServiceImpl implements SysUserService { ...@@ -47,7 +48,7 @@ public class SysUserServiceImpl implements SysUserService {
SysUserDto.setUserTypeEnum(UserTypeEnum.BACKGROUND_ROLE); SysUserDto.setUserTypeEnum(UserTypeEnum.BACKGROUND_ROLE);
SysUserDto.setUserName(sysUser.getUserName()); SysUserDto.setUserName(sysUser.getUserName());
// 存入到session // 存入到session
// SessionUtils.setUserCurrent("sysUser", SysUserDto); SessionUtils.setUserCurrent("sysUser", SysUserDto, request);
// 存入到redis // 存入到redis
redisTemplate.opsForValue().set("user_" + RedisMessageConstant.SENDTYPE_LOGIN_SYS, SysUserDto, 3, TimeUnit.DAYS); redisTemplate.opsForValue().set("user_" + RedisMessageConstant.SENDTYPE_LOGIN_SYS, SysUserDto, 3, TimeUnit.DAYS);
} }
...@@ -55,7 +56,7 @@ public class SysUserServiceImpl implements SysUserService { ...@@ -55,7 +56,7 @@ public class SysUserServiceImpl implements SysUserService {
} }
@Override @Override
public SysUser selectByPhone(String username) { public SysUser selectByPhone(String username, HttpServletRequest request) {
QueryWrapper queryWrapper = new QueryWrapper(); QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.eq("telephone", username); queryWrapper.eq("telephone", username);
SysUser sysUser = sysUserDao.selectOne(queryWrapper); SysUser sysUser = sysUserDao.selectOne(queryWrapper);
...@@ -68,7 +69,7 @@ public class SysUserServiceImpl implements SysUserService { ...@@ -68,7 +69,7 @@ public class SysUserServiceImpl implements SysUserService {
SysUserDto.setUserTypeEnum(UserTypeEnum.BACKGROUND_ROLE); SysUserDto.setUserTypeEnum(UserTypeEnum.BACKGROUND_ROLE);
SysUserDto.setUserName(sysUser.getUserName()); SysUserDto.setUserName(sysUser.getUserName());
// 存入到session // 存入到session
// SessionUtils.setUserCurrent("sysUser", SysUserDto); SessionUtils.setUserCurrent("sysUser", SysUserDto, request);
// 存入到redis // 存入到redis
redisTemplate.opsForValue().set("user_" + RedisMessageConstant.SENDTYPE_LOGIN_SYS, SysUserDto, 3, TimeUnit.DAYS); redisTemplate.opsForValue().set("user_" + RedisMessageConstant.SENDTYPE_LOGIN_SYS, SysUserDto, 3, TimeUnit.DAYS);
} }
......
...@@ -120,4 +120,29 @@ ...@@ -120,4 +120,29 @@
delete from t_platform_trade_flow_info where trade_flow_info_id = #{tradeFlowInfoId} delete from t_platform_trade_flow_info where trade_flow_info_id = #{tradeFlowInfoId}
</delete> </delete>
<select id="queryPlatFormMoneyAndDepart" resultType="com.jz.manage.moduls.controller.finance.platForm.PlatFormMoneyAndDepartDto" parameterType="map">
select
t1.departTotal,
t2.platformReceiveMoney
from(
select
count(department_id) as departTotal
from t_department
where 1=1 and del_flag='N' and audit_status='02'
) t1,
( select
ifnull(sum(platform_trade_money),0) as platformReceiveMoney
from t_platform_trade_flow_info
where 1=1 and trade_type='01' and del_flag='N'
)t2
</select>
<select id="findListOrderCount" resultType="com.jz.manage.moduls.controller.finance.platForm.OrderCountInfoDto" parameterType="map">
</select>
<select id="findListFinanceTradeDetil" resultType="com.jz.manage.moduls.controller.finance.platForm.TradeDetilDto" parameterType="map">
</select>
</mapper> </mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment