Commit f00f7b1e authored by machengbo's avatar machengbo

平台 利润中心

parent 943329bd
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
...@@ -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
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
...@@ -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