Commit 9dabe269 authored by ysongq's avatar ysongq

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

parents b3b082b7 5caeba35
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平台用户';
\ No newline at end of file
package com.jz.common.utils;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.jz.common.constant.CommonConstant;
import com.jz.common.constant.ResultCode;
import com.jz.common.constant.ResultMsg;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -16,8 +19,8 @@ import java.io.Serializable;
*/
@Data
@ApiModel(value = "接口返回对象", description = "接口返回对象")
@JsonInclude(JsonInclude.Include.NON_NULL)
public class Result<T> implements Serializable {
private static final long serialVersionUID = 1L;
/**
......@@ -30,19 +33,19 @@ public class Result<T> implements Serializable {
* 返回处理消息
*/
@ApiModelProperty(value = "返回处理消息")
private String message = "操作成功!";
private String message;
/**
* 返回代码
*/
@ApiModelProperty(value = "返回代码")
private Integer code = 200;
private Integer code ;
/**
* 返回数据对象 data
*/
@ApiModelProperty(value = "返回数据对象")
private T result;
private T data;
/**
* 时间戳
......@@ -50,66 +53,92 @@ public class Result<T> implements Serializable {
@ApiModelProperty(value = "时间戳")
private long timestamp = System.currentTimeMillis();
public Result() {
}
public Result<T> success(String message) {
this.message = message;
this.code = CommonConstant.SC_OK_200;
this.success = true;
return this;
private Result(Integer code) {
this.code = code;
}
public static long getSerialVersionUID() {
return serialVersionUID;
/**
* 构造函数
* @param code 操作代码
* @param data 数据对象
*/
private Result(Integer code, T data) {
this(code);
this.data = data;
}
public boolean isSuccess() {
return success;
/**
* 构造函数
*
* @param code
* 操作代码
* @param data
* 数据对象
* @param msg
* 提示消息
*/
private Result(Integer code, T data, ResultMsg msg) {
this(code, data);
this.message = msg.getMsg();
}
public void setSuccess(boolean success) {
this.success = success;
public Result setMsg(ResultMsg msg) {
this.message = msg.getMsg();
return this;
}
public String getMessage() {
return message;
public Result setMsg(String msg) {
this.message = msg;
return this;
}
/**
* 构造函数
*
* @param code
* 操作代码
* @param data
* 数据对象
* @param msg
* 提示消息
*/
public void setMessage(String message) {
this.message = message;
private Result(Integer code, T data, String msg) {
this(code, data);
this.message = msg;
}
public Integer getCode() {
return code;
/**new Add*/
public Result() {
this.code = ResultCode.SUCCESS.getCode();
}
public void setCode(Integer code) {
this.code = code;
public static Result of_success(ResultMsg msg,Object data) {
Result resultJson = new Result(ResultCode.SUCCESS.getCode(),data,msg);
return resultJson;
}
public T getResult() {
return result;
public static Result of_success(Object data) {
Result resultJson = new Result(ResultCode.SUCCESS.getCode(),data);
resultJson.setMessage(ResultMsg.SUCCESS.getMsg());
return resultJson;
}
public void setResult(T result) {
this.result = result;
public static Result of_success(ResultMsg msg) {
Result resultJson = new Result(ResultCode.SUCCESS.getCode(),null,msg);
return resultJson;
}
public long getTimestamp() {
return timestamp;
public static Result of_error(ResultMsg msg) {
Result resultJson = new Result(ResultCode.FAILURE.getCode(),null,msg);
return resultJson;
}
public void setTimestamp(long timestamp) {
this.timestamp = timestamp;
public static Result of_error(Object data) {
Result resultJson = new Result(ResultCode.FAILURE.getCode(),data);
return resultJson;
}
@Deprecated
public static Result of_error(String msg) {
Result resultJson = new Result(ResultCode.FAILURE.getCode(),null,msg);
return resultJson;
}
public Result(boolean success, String message) {
this.success = success;
this.message = message;
}
public Result(boolean success, String message, Integer code) {
this.success = success;
this.message = message;
......@@ -120,14 +149,14 @@ public class Result<T> implements Serializable {
this.success = success;
this.message = message;
this.code = code;
this.result = result;
this.data = result;
}
public Result(boolean success, String message, Integer code, T result, long timestamp) {
this.success = success;
this.message = message;
this.code = code;
this.result = result;
this.data = result;
this.timestamp = timestamp;
}
......@@ -151,7 +180,7 @@ public class Result<T> implements Serializable {
Result<Object> r = new Result<Object>();
r.setSuccess(true);
r.setCode(CommonConstant.SC_OK_200);
r.setResult(data);
r.setData(data);
return r;
}
......@@ -173,5 +202,11 @@ public class Result<T> implements Serializable {
this.success = false;
return this;
}
public Result<T> success(String message) {
this.message = message;
this.code = CommonConstant.SC_OK_200;
this.success = true;
return this;
}
}
......@@ -4,6 +4,7 @@ import com.aliyuncs.http.HttpRequest;
import com.jz.common.entity.Department;
import com.jz.common.utils.Result;
import com.jz.dm.mall.moduls.controller.company.bean.CompanyAddReq;
import com.jz.dm.mall.moduls.controller.company.bean.CompanyUpdateReq;
import com.jz.dm.mall.moduls.entity.MallCustomer;
import com.jz.dm.mall.moduls.service.CompanyAuthService;
import io.swagger.annotations.Api;
......@@ -59,4 +60,24 @@ public class CompanyAuthController {
return Result.ok(companyAuthService.selectCompany(type));
});
}
/**
* @Description: 企业认证信息更新
* @Author: Mr.zhang
* @Date: 2020-12-2
*/
@GetMapping("/updateCompany")
@ApiOperation(value = "企业认证信息更新")
public Mono<Result> updateCompany(@RequestBody @Validated CompanyUpdateReq req) {
return Mono.fromSupplier(() ->companyAuthService.updateCompanyInfo(req));
}
/**
* @Description: 企业认证信息更新
* @Author: Mr.zhang
* @Date: 2020-12-2
*/
@GetMapping("/checkCompany")
@ApiOperation(value = "企业认证信息校验")
public Mono<Result> checkCompany() {
return Mono.fromSupplier(() ->companyAuthService.checkCompanyInfo());
}
}
package com.jz.dm.mall.moduls.controller.company.bean;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
* @author ZC
* @PACKAGE_NAME: com.jz.dm.mall.moduls.controller.company.bean
* @PROJECT_NAME: jz-dm-parent
* @NAME: CompanyUpdateReq
* @USER: key
* @DATE: 2020-12-3/15:32
* @DAY_NAME_SHORT: 周四
* @Description:
**/
@Data
@ApiModel
public class CompanyUpdateReq implements Serializable {
@ApiModelProperty(name = "企业ID",required = true)
@NotNull(message = "企业Id不能为空")
private Long departmentId;
@ApiModelProperty(name = "企业名称",required = true)
@NotNull(message = "企业名称不能为空")
private String departmentName;
@ApiModelProperty(name = "省",required = true)
@NotNull(message = "省信息不能为空")
private String province;
@ApiModelProperty(name = "市",required = true)
@NotNull(message = "市信息不能为空")
private String city;
@ApiModelProperty(name = "公司详细地址",required = true)
@NotNull(message = "公司详细地址不能为空")
private String registeredAddress;
@ApiModelProperty(name = "统一社会编码",required = true)
@NotNull(message = "统一社会编码不能忍为空")
private String unifiedCreditCode;
@ApiModelProperty(name = "营业执照照片",required = true)
@NotNull(message = "营业执照照片不能忍为空")
private String businessLicense;
@ApiModelProperty(name = "开户银行",required = true)
@NotNull(message = "开户银行不能为空")
private String bankName;
@ApiModelProperty(name = "银行账户",required = true)
@NotNull(message = "银行账户不能忍为空")
private String bankCardNumber;
@ApiModelProperty(name = "联系人名称",required = true)
@NotNull(message = "联系人名称不能为空")
private String linkman;
@ApiModelProperty(name = "联系人电话",required = true)
@NotNull(message = "联系人电话不能为空")
private String telephone;
@ApiModelProperty(name = "登录用户id",hidden = true)
private Long customerId;
@ApiModelProperty(name = "登录用户名称",hidden = true)
private String loginName;
}
package com.jz.dm.mall.moduls.controller.company.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* @author ZC
* @PACKAGE_NAME: com.jz.dm.mall.moduls.controller.company.dto
* @PROJECT_NAME: jz-dm-parent
* @NAME: CompanyInfoDto
* @USER: key
* @DATE: 2020-12-3/15:23
* @DAY_NAME_SHORT: 周四
* @Description:
**/
@Data
@ApiModel
public class CompanyInfoDto implements Serializable {
@ApiModelProperty(value = "企业名称")
private String departmentName;
@ApiModelProperty(value = "注册地址")
private String registeredAddress;
@ApiModelProperty(value = "营业执照链接")
private String businessLicense;
@ApiModelProperty(value = "开户行")
private String bankName;
@ApiModelProperty(value = "企业名称")
private String bankCardNumber;
@ApiModelProperty(value = "联系人")
private String linkman;
@ApiModelProperty(value = "联系人手机号")
private String telephone;
@ApiModelProperty(value = "企业自增ID")
private String departmentId;
@ApiModelProperty(value = "审核状态:01待审核,02已审核,03未通过")
private String auditStatus;
}
package com.jz.dm.mall.moduls.controller.customer;
import com.jz.common.utils.Result;
import com.jz.dm.mall.moduls.controller.company.bean.CompanyAddReq;
import com.jz.dm.mall.moduls.service.PersonalUserControllerService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import reactor.core.publisher.Mono;
/**
* @author ZC
* @PACKAGE_NAME: com.jz.dm.mall.moduls.controller.customer
* @PROJECT_NAME: jz-dm-parent
* @NAME: PersonalUserController
* @USER: key
* @DATE: 2020-12-3/18:01
* @DAY_NAME_SHORT: 周四
* @Description:
**/
@RestController
@RequestMapping("/personalUser")
@Api(tags = "用户信息controller")
public class PersonalUserController {
@Autowired
private PersonalUserControllerService personalUserControllerService;
/**
* @Description: 查询个人信息
* @Author: Mr.zhang
* @Date: 2020-12-2
*/
@PostMapping("/getPersonalInfo")
@ApiOperation(value = "查询个人信息")
public Mono<Result> getUserInfo() {
return Mono.fromSupplier(() -> personalUserControllerService.getUserInfo());
}
/**
* @Description: 修改用户密码
* @Author: Mr.zhang
* @Date: 2020-12-2
*/
@PostMapping("/updatePassWard")
@ApiOperation(value = "修改用户密码")
public Mono<Result> updateUserPassWard(@RequestParam(value = "oldPassWard") String oldPassWard,
@RequestParam(value = "newPassWard") String newPassWard) {
return Mono.fromSupplier(() -> personalUserControllerService.updateUserPassWard(oldPassWard,newPassWard));
}
}
......@@ -2,14 +2,17 @@ package com.jz.dm.mall.moduls.controller.finance;
import com.jz.common.base.BaseController;
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.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 io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
......@@ -46,8 +49,109 @@ public class FinanceTradeFlowController extends BaseController {
map.put("assetsId", 1); //企业资产账户id
map.put("departmentId", 1); //企业ID
FinanceCustomerAssetsDto dto = financeTradeFlowService.queryAccountMoneyByMap(map);
result.setResult(dto);
result.setData(dto);
return result;
}
/**
* 保存充值金额
*
* @author Bellamy
* @since 2020-12-03
*/
@PostMapping(value = "/getAccountMoney")
@ApiOperation(value = "充值----保存充值金额", notes = "保存充值金额")
@ApiParam()
public Result<Object> uptAccountMoney(@RequestBody FinanceCustomerBalanceRequest customerBalanceRequest, HttpServletRequest requset) throws Exception {
if(StringUtils.isEmpty(customerBalanceRequest.getAssetsId().toString())){ //企业资产id
return Result.error("参数不能为空!");
}
if(StringUtils.isEmpty(customerBalanceRequest.getBalanceMoney().toString())){ //充值金额
return Result.error("参数不能为空!");
}
Boolean str = financeTradeFlowService.uptAccountMoney(customerBalanceRequest);
if(!str){
return Result.error("提交失败!");
}
return Result.ok("提交成功!");
}
/**
* 充值----获取企业账户余额
*
* @author Bellamy
* @since 2020-12-03
*/
@GetMapping(value = "/cashOutAccountMoney")
@ApiOperation(value = "提现----获取账户余额", notes = "获取账户余额")
public Result<FinanceCustomerAssetsDto> getCashOutAccountMoney(HttpServletRequest requset) throws Exception {
Result<FinanceCustomerAssetsDto> result = new Result<>();
//requset.getSession().getAttribute(""); //从session中获取商城用户的 id,和企业资产账户id
Map map = new HashMap();
map.put("assetsId", 1); //企业资产账户id
map.put("departmentId", 1); //企业ID
FinanceCustomerAssetsDto dto = financeTradeFlowService.queryAccountMoneyByMap(map);
result.setData(dto);
return result;
}
/**
* 是否存在提现为审核接口
*
* @author Bellamy
* @since 2020-12-03
*/
@GetMapping(value = "/cashOutAuditStutas")
@ApiOperation(value = "提现----是否存在提现为审核接口", notes = "获取可提现金额")
public Result<Object> getCashOutAuditStutas(HttpServletRequest requset) throws Exception {
Result<Object> result = new Result<>();
//requset.getSession().getAttribute(""); //从session中获取商城用户的 id,和企业资产账户id
Map map = new HashMap();
map.put("assetsId", 1); //企业资产账户id
map.put("departmentId", 1); //企业ID
FinanceCashOutDto dto = financeTradeFlowService.getCashOutAuditStutas(map);
if(dto.getCashOutMoney() != null){
result.setData(dto.getCashOutMoney());
result.setMessage("存在提现审核记录!");
} else {
result.setMessage("不存在!");
}
return result;
}
/**
* 保存提现金额
*
* @author Bellamy
* @since 2020-12-03
*/
@PostMapping(value = "/addCashOutMoney")
@ApiOperation(value = "提现----保存提现金额", notes = "保存提现金额")
public Result<Object> addCashOutMoney(@RequestBody FinanceCashOutRequest financeCashOutRequest, HttpServletRequest requset) throws Exception {
if(financeCashOutRequest.getCashOutMoney() == null){ //提现金额
return Result.error("参数不能为空!");
}
Result<Object> result = financeTradeFlowService.addCashOutMoney(financeCashOutRequest);
return result;
}
/**
* 订单管理列表(分页查询)
*
* @author Bellamy
*/
/*@PostMapping(value = "/list")
@ApiOperation(value = "订单管理列表(分页查询)", notes = "订单列表(分页查询)")
public PageInfoResponse<FinanceTradeFlow> queryPageList(HttpServletRequest req) throws Exception {
PageInfoResponse<FinanceTradeFlow> pageInfo = new PageInfoResponse<FinanceTradeFlow>();
Map map = new HashMap();
try {
pageInfo = financeTradeFlowService.findListTradeFlow(map,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.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* 商城企业客户资产(TFinanceCustomerAssets)实体类
*
* @author Bellamy
* @since 2020-12-01 10:41:38
*/
@ApiModel
public class CustomerAssetsRequest implements Serializable {
private static final long serialVersionUID = -86484762300825431L;
/**
* 资产id
*/
@TableId(value = "assets_id",type = IdType.AUTO)
@ApiModelProperty(value = "资产id")
private Long assetsId;
/**
* 企业id
*/
@ApiModelProperty(value = "企业id")
private Long departmentId;
/**
* 可用金额
*/
@ApiModelProperty(value = "可用金额")
private BigDecimal useMoney;
/**
* 冻结金额
*/
@ApiModelProperty(value = "冻结金额")
private BigDecimal frozenMoney;
/**
* 总金额
*/
@ApiModelProperty(value = "总金额")
private BigDecimal totalMoney;
/**
* 更新时间
*/
@ApiModelProperty(value = "更新时间")
private Date uptTime;
/**
* 更新人
*/
@ApiModelProperty(value = "更新人")
private String uptPerson;
/**
* 备注
*/
@ApiModelProperty(value = "备注")
private String remark;
public Long getAssetsId() {
return assetsId;
}
public void setAssetsId(Long assetsId) {
this.assetsId = assetsId;
}
public Long getDepartmentId() {
return departmentId;
}
public void setDepartmentId(Long departmentId) {
this.departmentId = departmentId;
}
public BigDecimal getUseMoney() {
return useMoney;
}
public void setUseMoney(BigDecimal useMoney) {
this.useMoney = useMoney;
}
public BigDecimal getFrozenMoney() {
return frozenMoney;
}
public void setFrozenMoney(BigDecimal frozenMoney) {
this.frozenMoney = frozenMoney;
}
public BigDecimal getTotalMoney() {
return totalMoney;
}
public void setTotalMoney(BigDecimal totalMoney) {
this.totalMoney = totalMoney;
}
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 getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
}
\ No newline at end of file
package com.jz.dm.mall.moduls.controller.finance.bean;
import io.swagger.annotations.ApiModel;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* 提现申请(TFinanceCashOut)实体类
*
* @author Bellamy
* @since 2020-12-01 10:41:37
*/
@ApiModel
public class FinanceCashOutDto implements Serializable {
private static final long serialVersionUID = 584623943576096734L;
/**
* 提现id
*/
private Long cashOutId;
/**
* 资产id
*/
private Long assetsId;
/**
* 提现金额
*/
private BigDecimal cashOutMoney;
/**
* 提现时间
*/
private Date cashOutTime;
/**
* 审核时间
*/
private Date auditTime;
/**
* 审核人
*/
private String auditPerson;
/**
* 驳回原因
*/
private String rejectReason;
/**
* 付款时间
*/
private Date payTime;
/**
* 付款人
*/
private String payPerson;
/**
* 备注
*/
private String remark;
/**
* 审核状态:01待审核,02审核通过,03未通过
*/
private String auditStatus;
/**
* 创建人
*/
private String crePerson;
/**
* 创建时间
*/
private Date creTime;
/**
* 删除标识
*/
private String delFlag;
public Long getCashOutId() {
return cashOutId;
}
public void setCashOutId(Long cashOutId) {
this.cashOutId = cashOutId;
}
public Long getAssetsId() {
return assetsId;
}
public void setAssetsId(Long assetsId) {
this.assetsId = assetsId;
}
public BigDecimal getCashOutMoney() {
return cashOutMoney;
}
public void setCashOutMoney(BigDecimal cashOutMoney) {
this.cashOutMoney = cashOutMoney;
}
public Date getCashOutTime() {
return cashOutTime;
}
public void setCashOutTime(Date cashOutTime) {
this.cashOutTime = cashOutTime;
}
public Date getAuditTime() {
return auditTime;
}
public void setAuditTime(Date auditTime) {
this.auditTime = auditTime;
}
public String getAuditPerson() {
return auditPerson;
}
public void setAuditPerson(String auditPerson) {
this.auditPerson = auditPerson;
}
public String getRejectReason() {
return rejectReason;
}
public void setRejectReason(String rejectReason) {
this.rejectReason = rejectReason;
}
public Date getPayTime() {
return payTime;
}
public void setPayTime(Date payTime) {
this.payTime = payTime;
}
public String getPayPerson() {
return payPerson;
}
public void setPayPerson(String payPerson) {
this.payPerson = payPerson;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public String getAuditStatus() {
return auditStatus;
}
public void setAuditStatus(String auditStatus) {
this.auditStatus = auditStatus;
}
public String getCrePerson() {
return crePerson;
}
public void setCrePerson(String crePerson) {
this.crePerson = crePerson;
}
public Date getCreTime() {
return creTime;
}
public void setCreTime(Date creTime) {
this.creTime = creTime;
}
public String getDelFlag() {
return delFlag;
}
public void setDelFlag(String delFlag) {
this.delFlag = delFlag;
}
}
\ No newline at end of file
package com.jz.dm.mall.moduls.controller.finance.bean;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* 提现申请(TFinanceCashOut)实体类
*
* @author Bellamy
* @since 2020-12-01 10:41:37
*/
@ApiModel(value = "接口请求参数对象", description = "接口请求参数对象")
public class FinanceCashOutRequest implements Serializable {
private static final long serialVersionUID = 584623943576096734L;
/**
* 资产id
*/
@ApiModelProperty(value = "企业资产id")
private Long assetsId;
/**
* 提现金额
*/
@ApiModelProperty(value = "提现金额")
private BigDecimal cashOutMoney;
/**
* 备注
*/
@ApiModelProperty(value = "提现备注")
private String remark;
public Long getAssetsId() {
return assetsId;
}
public void setAssetsId(Long assetsId) {
this.assetsId = assetsId;
}
public BigDecimal getCashOutMoney() {
return cashOutMoney;
}
public void setCashOutMoney(BigDecimal cashOutMoney) {
this.cashOutMoney = cashOutMoney;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
}
\ No newline at end of file
package com.jz.dm.mall.moduls.controller.finance.bean;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* 企业客户充值记录(TFinanceCustomerBalance)实体类
*
* @author Bellamy
* @since 2020-12-01 10:41:38
*/
@ApiModel
public class FinanceCustomerBalanceRequest implements Serializable {
private static final long serialVersionUID = -13102196689933511L;
/**
* 企业客户资产id
*/
@ApiModelProperty(value = "企业客户资产id")
private Long assetsId;
/**
* 充值金额
*/
@ApiModelProperty(value = "充值金额")
private BigDecimal balanceMoney;
/**
* 备注
*/
@ApiModelProperty(value = "备注")
private String remark;
public Long getAssetsId() {
return assetsId;
}
public void setAssetsId(Long assetsId) {
this.assetsId = assetsId;
}
public BigDecimal getBalanceMoney() {
return balanceMoney;
}
public void setBalanceMoney(BigDecimal balanceMoney) {
this.balanceMoney = balanceMoney;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
}
\ No newline at end of file
package com.jz.dm.mall.moduls.controller.log;
import com.jz.common.bean.PageInfoResponse;
import com.jz.common.entity.PlatformLog;
import com.jz.common.utils.Result;
import com.jz.dm.mall.moduls.controller.company.bean.CompanyAddReq;
import com.jz.dm.mall.moduls.controller.log.bean.LogInfoQueryReq;
import com.jz.dm.mall.moduls.controller.order.bean.OrderDto;
import com.jz.dm.mall.moduls.service.LogInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import reactor.core.publisher.Mono;
/**
* @author ZC
* @PACKAGE_NAME: com.jz.dm.mall.moduls.controller.log
* @PROJECT_NAME: jz-dm-parent
* @NAME: LogInfoController
* @USER: key
* @DATE: 2020-12-3
* @DAY_NAME_SHORT: 周四
* @Description:
**/
@RestController
@RequestMapping("/logInfo")
@Api(tags = "日志信息controller")
public class LogInfoController {
@Autowired
private LogInfoService logInfoService;
/**
* @Description: 获取商城用户日志信息列表
* @Author: Mr.zhang
* @Date: 2020-12-2
*/
@PostMapping("/getMallLogInfo")
@ApiOperation(value = "获取商城用户日志信息列表")
public Mono<Result<PageInfoResponse<PlatformLog>>> getLogInfo(@RequestBody @Validated LogInfoQueryReq req) {
return Mono.fromSupplier(() -> logInfoService.getMallUserLogInfo(req));
}
/**
* @Description: 获取商城用户日志信息详情
* @Author: Mr.zhang
* @Date: 2020-12-2
*/
@PostMapping("/getMallLogDetail")
@ApiOperation(value = "获取商城用户日志信息详情")
public Mono<Result> getLogInfoDetail(@RequestParam(value = "日志信息Id") Long platformLogId) {
return Mono.fromSupplier(() -> logInfoService.getMallUserLogDetail(platformLogId));
}
}
package com.jz.dm.mall.moduls.controller.log.bean;
import com.jz.common.bean.BasePageBean;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import java.io.Serializable;
/**
* @author ZC
* @PACKAGE_NAME: com.jz.dm.mall.moduls.controller.log.bean
* @PROJECT_NAME: jz-dm-parent
* @NAME: LogInfoQueryReq
* @USER: key
* @DATE: 2020-12-3/19:05
* @DAY_NAME_SHORT: 周四
* @Description:
**/
@Data
@ApiModel
public class LogInfoQueryReq extends BasePageBean implements Serializable {
}
......@@ -64,7 +64,7 @@ public class OrderController {
Result<OrderDto> result = new Result<OrderDto>();
if (StringUtils.isNotEmpty(orderId)) {
OrderDto orderDto = orderService.getOrderDetail(orderId);
result.setResult(orderDto);
result.setData(orderDto);
} else {
result.setMessage("参数为不能为空!");
}
......@@ -91,7 +91,7 @@ public class OrderController {
}
//查询接口文档 和参数信息
Map dataGoodsApi = orderService.getApiInterfaceDetail(params);
result.setResult(dataGoodsApi);
result.setData(dataGoodsApi);
return result;
}
}
\ 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.math.BigDecimal;
import java.util.Date;
/**
* 提现申请(TFinanceCashOut)实体类
*
* @author Bellamy
* @since 2020-12-01 10:41:37
*/
@TableName("t_finance_cash_out")
@ApiModel
public class FinanceCashOut implements Serializable {
private static final long serialVersionUID = 584623943576096734L;
/**
* 提现id
*/
private Long cashOutId;
/**
* 资产id
*/
private Long assetsId;
/**
* 提现金额
*/
private BigDecimal cashOutMoney;
/**
* 提现时间
*/
private Date cashOutTime;
/**
* 审核时间
*/
private Date auditTime;
/**
* 审核人
*/
private String auditPerson;
/**
* 驳回原因
*/
private String rejectReason;
/**
* 付款时间
*/
private Date payTime;
/**
* 付款人
*/
private String payPerson;
/**
* 备注
*/
private String remark;
/**
* 审核状态:01待审核,02审核通过,03未通过
*/
private String auditStatus;
/**
* 创建人
*/
private String crePerson;
/**
* 创建时间
*/
private Date creTime;
/**
* 删除标识
*/
private String delFlag;
public Long getCashOutId() {
return cashOutId;
}
public void setCashOutId(Long cashOutId) {
this.cashOutId = cashOutId;
}
public Long getAssetsId() {
return assetsId;
}
public void setAssetsId(Long assetsId) {
this.assetsId = assetsId;
}
public BigDecimal getCashOutMoney() {
return cashOutMoney;
}
public void setCashOutMoney(BigDecimal cashOutMoney) {
this.cashOutMoney = cashOutMoney;
}
public Date getCashOutTime() {
return cashOutTime;
}
public void setCashOutTime(Date cashOutTime) {
this.cashOutTime = cashOutTime;
}
public Date getAuditTime() {
return auditTime;
}
public void setAuditTime(Date auditTime) {
this.auditTime = auditTime;
}
public String getAuditPerson() {
return auditPerson;
}
public void setAuditPerson(String auditPerson) {
this.auditPerson = auditPerson;
}
public String getRejectReason() {
return rejectReason;
}
public void setRejectReason(String rejectReason) {
this.rejectReason = rejectReason;
}
public Date getPayTime() {
return payTime;
}
public void setPayTime(Date payTime) {
this.payTime = payTime;
}
public String getPayPerson() {
return payPerson;
}
public void setPayPerson(String payPerson) {
this.payPerson = payPerson;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public String getAuditStatus() {
return auditStatus;
}
public void setAuditStatus(String auditStatus) {
this.auditStatus = auditStatus;
}
public String getCrePerson() {
return crePerson;
}
public void setCrePerson(String crePerson) {
this.crePerson = crePerson;
}
public Date getCreTime() {
return creTime;
}
public void setCreTime(Date creTime) {
this.creTime = creTime;
}
public String getDelFlag() {
return delFlag;
}
public void setDelFlag(String delFlag) {
this.delFlag = delFlag;
}
}
\ No newline at end of file
......@@ -23,8 +23,8 @@ public class FinanceCustomerAssets implements Serializable {
/**
* 资产id
*/
@TableId(value = "customer_id",type = IdType.AUTO)
@ApiModelProperty(value = "企业id")
@TableId(value = "assets_id",type = IdType.AUTO)
@ApiModelProperty(value = "资产id")
private Long assetsId;
/**
* 企业id
......@@ -71,6 +71,11 @@ public class FinanceCustomerAssets implements Serializable {
*/
@ApiModelProperty(value = "删除标识")
private String delFlag;
/**
* 备注
*/
@ApiModelProperty(value = "备注")
private String remark;
public Long getAssetsId() {
......@@ -153,4 +158,11 @@ public class FinanceCustomerAssets implements Serializable {
this.delFlag = delFlag;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
}
\ 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.math.BigDecimal;
import java.util.Date;
/**
* 企业客户充值记录(TFinanceCustomerBalance)实体类
*
* @author Bellamy
* @since 2020-12-01 10:41:38
*/
@TableName("t_finance_customer_balance")
@ApiModel
public class FinanceCustomerBalance implements Serializable {
private static final long serialVersionUID = -13102196689933511L;
/**
* 充值id
*/
private Long customerBalanceId;
/**
* 企业客户资产id
*/
private Long assetsId;
/**
* 充值金额
*/
private BigDecimal balanceMoney;
/**
* 备注
*/
private String remark;
/**
* 创建时间
*/
private Date creTime;
/**
* 创建人
*/
private String crePerson;
/**
* 删除标识
*/
private String delFlag;
/**
* 审核状态:01待审核,02审核通过,03未通过
*/
private String auditStatus;
/**
* 审核意见
*/
private String rejectReason;
public Long getCustomerBalanceId() {
return customerBalanceId;
}
public void setCustomerBalanceId(Long customerBalanceId) {
this.customerBalanceId = customerBalanceId;
}
public Long getAssetsId() {
return assetsId;
}
public void setAssetsId(Long assetsId) {
this.assetsId = assetsId;
}
public BigDecimal getBalanceMoney() {
return balanceMoney;
}
public void setBalanceMoney(BigDecimal balanceMoney) {
this.balanceMoney = balanceMoney;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
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 getDelFlag() {
return delFlag;
}
public void setDelFlag(String delFlag) {
this.delFlag = delFlag;
}
public String getAuditStatus() {
return auditStatus;
}
public void setAuditStatus(String auditStatus) {
this.auditStatus = auditStatus;
}
public String getRejectReason() {
return rejectReason;
}
public void setRejectReason(String rejectReason) {
this.rejectReason = rejectReason;
}
}
\ No newline at end of file
......@@ -75,12 +75,24 @@ public class MallCustomer implements Serializable {
* 更新时间
*/
private Date uptTime;
/**
* 更新人
*/
private String uptPerson;
/**
* 删除标识:Y是,N否
*/
private String delFlag;
public String getUptPerson() {
return uptPerson;
}
public void setUptPerson(String uptPerson) {
this.uptPerson = uptPerson;
}
public Long getCustomerId() {
return customerId;
}
......
......@@ -3,6 +3,10 @@ package com.jz.dm.mall.moduls.mapper;
import com.jz.common.base.BaseMapper;
import com.jz.common.entity.Department;
import com.jz.dm.mall.moduls.controller.company.bean.CompanyAddReq;
import com.jz.dm.mall.moduls.controller.company.dto.CompanyInfoDto;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultType;
import org.apache.ibatis.annotations.Select;
/**
* 企业(TDepartment)表数据库访问层
......@@ -18,4 +22,20 @@ public interface DepartmentDao extends BaseMapper<Department> {
* @return
*/
Department selectDepartmentData(CompanyAddReq req);
/**
* 查询企业状态
* @param departmentId
* @return
*/
@Select("select audit_status AS auditStatus from t_department where department_id =#{departmentId} and del_flag ='N'")
@ResultType(String.class)
String selectCompanyStatus(Long departmentId);
/**
* 根据企业ID查询企业信息
* @param departmentId
* @return
*/
CompanyInfoDto selectCompanyDetail(@Param("departmentId") Long departmentId);
}
\ No newline at end of file
package com.jz.dm.mall.moduls.mapper;
import com.jz.common.base.BaseMapper;
import com.jz.dm.mall.moduls.entity.FinanceCustomerAssets;
import com.jz.dm.mall.moduls.entity.FinanceCustomerBalance;
/**
* 商城企业客户资产(TFinanceCustomerAssets)表数据库访问层
......@@ -12,4 +12,7 @@ import com.jz.dm.mall.moduls.entity.FinanceCustomerAssets;
*/
public interface FinanceCustomerAssetsDao extends BaseMapper<FinanceCustomerAssets> {
int uptAccountMoney(FinanceCustomerAssets financeCustomerAssets) throws Exception;
int addCoustomerCzMoney(FinanceCustomerBalance financeCustomerBalance) throws Exception;
}
\ No newline at end of file
package com.jz.dm.mall.moduls.mapper;
import com.jz.common.base.BaseMapper;
import com.jz.dm.mall.moduls.controller.finance.bean.FinanceCashOutDto;
import com.jz.dm.mall.moduls.controller.finance.bean.FinanceCustomerAssetsDto;
import com.jz.dm.mall.moduls.entity.FinanceCashOut;
import com.jz.dm.mall.moduls.entity.FinanceTradeFlow;
import java.util.List;
import java.util.Map;
/**
......@@ -16,5 +19,9 @@ import java.util.Map;
public interface FinanceTradeFlowDao extends BaseMapper<FinanceTradeFlow> {
FinanceCustomerAssetsDto queryAccountMoneyByMap(Map map) throws Exception ;
FinanceCustomerAssetsDto queryAccountMoneyByMap(Map map) throws Exception;
List<FinanceCashOutDto> getCashOutAuditStutas(Map map) throws Exception;
int addCashOutMoney(FinanceCashOut financeCashOut) throws Exception;
}
\ No newline at end of file
package com.jz.dm.mall.moduls.mapper;
import com.jz.common.base.BaseMapper;
import com.jz.common.entity.PlatformLog;
import com.jz.dm.mall.moduls.controller.order.bean.OrderDto;
import java.util.List;
/**
* 日志管理(TPlatformLog)表数据库访问层
*
* @author Bellamy
* @since 2020-12-01 10:41:42
*/
public interface PlatformLogDao extends BaseMapper<PlatformLog> {
/**
* 查询商城用户日志列表
* @param customerId
* @return
*/
List<PlatformLog> listMallLogInfo(Long customerId);
}
\ No newline at end of file
......@@ -3,6 +3,7 @@ package com.jz.dm.mall.moduls.service;
import com.jz.common.entity.Department;
import com.jz.dm.mall.moduls.controller.company.bean.CompanyAddReq;
import com.jz.common.utils.Result;
import com.jz.dm.mall.moduls.controller.company.bean.CompanyUpdateReq;
/**
* @author ZC
......@@ -27,7 +28,20 @@ public interface CompanyAuthService {
* @param type
* @return
*/
Result<Department> selectCompany(String type);
Result selectCompany(String type);
/**
* 更新企业信息
* @param req
* @return
*/
Result updateCompanyInfo(CompanyUpdateReq req);
/**
* 校验当前用户是否已经企业认证
* @return
*/
Result checkCompanyInfo();
}
package com.jz.dm.mall.moduls.service;
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.FinanceCashOutRequest;
import com.jz.dm.mall.moduls.controller.finance.bean.FinanceCustomerAssetsDto;
import com.jz.dm.mall.moduls.controller.finance.bean.FinanceCustomerBalanceRequest;
import java.util.Map;
......@@ -13,5 +17,11 @@ import java.util.Map;
public interface FinanceTradeFlowService {
FinanceCustomerAssetsDto queryAccountMoneyByMap(Map map) throws Exception ;
FinanceCustomerAssetsDto queryAccountMoneyByMap(Map map) throws Exception;
Boolean uptAccountMoney(FinanceCustomerBalanceRequest financeCustomerBalanceRequest) throws Exception;
FinanceCashOutDto getCashOutAuditStutas(Map map) throws Exception;
Result<Object> addCashOutMoney(FinanceCashOutRequest financeCashOutRequest) throws Exception;
}
\ No newline at end of file
package com.jz.dm.mall.moduls.service;
import com.jz.common.bean.PageInfoResponse;
import com.jz.common.entity.PlatformLog;
import com.jz.common.utils.Result;
import com.jz.dm.mall.moduls.controller.log.bean.LogInfoQueryReq;
import com.jz.dm.mall.moduls.controller.order.bean.OrderDto;
/**
* @author ZC
* @PACKAGE_NAME: com.jz.dm.mall.moduls.service
* @PROJECT_NAME: jz-dm-parent
* @NAME: LogInfoService
* @USER: key
* @DATE: 2020-12-3/18:59
* @DAY_NAME_SHORT: 周四
* @Description:
**/
public interface LogInfoService {
/**
* 获取用户调用日志列表
* @param req
* @return
*/
Result<PageInfoResponse<PlatformLog>> getMallUserLogInfo(LogInfoQueryReq req);
/**
* 获取商城用户日志信息详情
* @param platformLogId
* @return
*/
Result getMallUserLogDetail(Long platformLogId);
}
package com.jz.dm.mall.moduls.service;
import com.jz.common.utils.Result;
/**
* @author ZC
* @PACKAGE_NAME: com.jz.dm.mall.moduls.service
* @PROJECT_NAME: jz-dm-parent
* @NAME: PersonalUserControllerService
* @USER: key
* @DATE: 2020-12-3/18:04
* @DAY_NAME_SHORT: 周四
* @Description:
**/
public interface PersonalUserControllerService {
/**
* 获取登录用户信息
* @return
*/
Result getUserInfo();
/**
* 修改用户密码
* @param oldPassWard
* @param newPassWard
* @return
*/
Result updateUserPassWard(String oldPassWard, String newPassWard);
}
package com.jz.dm.mall.moduls.service.impl;
import com.jz.common.constant.ResultCode;
import com.jz.common.constant.ResultMsg;
import com.jz.common.entity.Department;
import com.jz.common.exception.ResponseException;
import com.jz.dm.mall.moduls.controller.company.bean.CompanyUpdateReq;
import com.jz.dm.mall.moduls.controller.company.dto.CompanyInfoDto;
import com.jz.dm.mall.moduls.entity.FinanceCustomerAssets;
import com.jz.dm.mall.moduls.entity.MallCustomer;
import com.jz.common.utils.Result;
......@@ -40,6 +44,7 @@ public class CompanyAuthServiceImpl implements CompanyAuthService {
private FinanceCustomerAssetsDao financeCustomerAssetsDao;
@Resource
private MallCustomerDao mallCustomerDao;
/**
* 添加企业认证
*
......@@ -47,54 +52,123 @@ public class CompanyAuthServiceImpl implements CompanyAuthService {
* @return
*/
@Override
@Transactional(rollbackFor = Exception.class,propagation = Propagation.REQUIRES_NEW)
@Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRES_NEW)
public Result addCompanyData(CompanyAddReq req) {
//TODO 获取当前用户ID判断当前用户是否已经关联企业
// Long customerId = (Long) UserContextUtil.pop("customer_id");
Long customerId = 0L;
if (null ==customerId){
return Result.error("获取用户信息失败");
if (null == customerId) {
return Result.of_error(ResultMsg.USER_NOT_EXIST);
}
MallCustomer mallCustomer = mallCustomerDao.findById(customerId);
if (null == mallCustomer){
return Result.error("用户信息不存在");
if (null == mallCustomer) {
return Result.of_error(ResultMsg.USER_NOT_EXIST);
}
if (null != mallCustomer.getDepartmentId()){
return Result.error("用户已关联企业,请勿重复操作");
if (null != mallCustomer.getDepartmentId()) {
return Result.of_error("用户已关联企业,请勿重复操作");
}
req.setCustomerId(mallCustomer.getCustomerId());
if (StringUtils.isNotBlank(req.getDepartmentName()) &&
StringUtils.isNotBlank(req.getUnifiedCreditCode())) { //企业名称 && 营业执照
Department department = departmentDao.selectDepartmentData(req);
if (null != department) {
return Result.error("企业用户信息已存在");
return Result.of_error("企业用户信息已存在");
}
}
insetCompany(req);
return Result.ok("添加企业用户成功");
return Result.of_success(ResultMsg.SUCCESS);
}
/**
* 查询企业认证详情
*
* @param type
* @return
*/
@Override
public Result<Department> selectCompany(String type) {
//查询用户判断用户是否认证
// Long customerId = (Long) UserContextUtil.pop("customer_id");
// if (null ==customerId){
// return Result.error("获取用户信息失败");
// }
// MallCustomer mallCustomer = mallCustomerDao.findById(customerId);
// if (null == mallCustomer){
// return Result.error("用户信息不存在");
// }
public Result selectCompany(String type) {
// TODO 查询用户判断用户是否认证
MallCustomer currentUser = getCurrentUser(0L);
if (null == currentUser) {
return Result.error("当前用户信息不存在");
}
if (StringUtils.equals(type, "STATUS")) {//状态
String auditStatus = departmentDao.selectCompanyStatus(currentUser.getDepartmentId());
return Result.of_success(auditStatus);
} else if (StringUtils.equals(type, "DETAIL")) {//详情
CompanyInfoDto department = departmentDao.selectCompanyDetail(currentUser.getDepartmentId());
return Result.of_success(department);
}
return Result.of_error("查询企业信息异常");
}
/**
* 获取登录用户信息
*
* @param customerId
* @return
*/
private MallCustomer getCurrentUser(Long customerId) {
try {
MallCustomer mallCustomer = mallCustomerDao.findById(customerId);
if (null != mallCustomer) {
return mallCustomer;
}
} catch (Exception e) {
log.error("用户:" + customerId + "信息不存在~~~~~~~~~~");
}
return null;
}
/**
* 更新企业信息
*
* @param req
* @return
*/
@Override
public Result updateCompanyInfo(CompanyUpdateReq req) {
Long coustomId = 0L;
MallCustomer currentUser = getCurrentUser(req.getCustomerId());
if (null == currentUser) {
return Result.of_error(ResultMsg.USER_NOT_EXIST);
}
if (!req.getDepartmentId().equals(coustomId)) {
return Result.of_error("更新企业用户信息与绑定企业信息不一致");
}
Department department = new Department();
department.setUptTime(new Date());
department.setUptPerson(req.getLoginName());
BeanUtils.copyProperties(req, department);
if (departmentDao.updateById(department) != 1) {
throw ResponseException.of_error("更新企业信息失败");
}
return Result.of_success(ResultMsg.UPDATE_SUCCESS);
}
/**
* 校验用户是否已经企业认证
*
* @return
*/
@Override
public Result checkCompanyInfo() {
//Todo 获取当前登录用户
Long customId = 0L;
MallCustomer currentUser = getCurrentUser(customId);
if (null == currentUser) {
return Result.of_success(ResultMsg.USER_NOT_EXIST);
}
CompanyInfoDto companyInfoDto = departmentDao.selectCompanyDetail(currentUser.getDepartmentId());
if (null != companyInfoDto && "02".equals(companyInfoDto.getAuditStatus())) {
return Result.of_success("用户已进行企业认证");
}
return Result.of_success("用户未进行企业认证");
}
/**
* 保存企业信息
*
* @param req
*/
private void insetCompany(CompanyAddReq req) {
......@@ -103,8 +177,8 @@ public class CompanyAuthServiceImpl implements CompanyAuthService {
departmentInset.setAuditStatus("01");//待审核
departmentInset.setCreTime(new Date());
departmentInset.setCrePerson(req.getLoginName());
BeanUtils.copyProperties(req,departmentInset);
if (departmentDao.insert(departmentInset) != 1){
BeanUtils.copyProperties(req, departmentInset);
if (departmentDao.insert(departmentInset) != 1) {
throw ResponseException.of_error("保存企业信息失败");
}
//初始化用户资产表
......@@ -112,7 +186,7 @@ public class CompanyAuthServiceImpl implements CompanyAuthService {
finance.setDepartmentId(departmentInset.getDepartmentId());//企业ID
finance.setCreTime(new Date());
finance.setCrePerson(req.getLoginName());
if (financeCustomerAssetsDao.insert(finance) != 1){
if (financeCustomerAssetsDao.insert(finance) != 1) {
throw ResponseException.of_error("初始化用户资产失败");
}
//更新用户企业信息
......@@ -120,8 +194,8 @@ public class CompanyAuthServiceImpl implements CompanyAuthService {
mallCustomer.setCustomerId(req.getCustomerId());//用户ID
mallCustomer.setDepartmentId(departmentInset.getDepartmentId());
mallCustomer.setUptTime(new Date());
// mallCustomer.setUptPerson(req.getLoginName());
if (mallCustomerDao.updateById(mallCustomer) != 1){
mallCustomer.setUptPerson(req.getLoginName());
if (mallCustomerDao.updateById(mallCustomer) != 1) {
throw ResponseException.of_error("更新用户企业信息失败");
}
}
......
package com.jz.dm.mall.moduls.service.impl;
import com.jz.common.enums.AuditStatusEnum;
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.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.FinanceCustomerAssets;
import com.jz.dm.mall.moduls.entity.FinanceCustomerBalance;
import com.jz.dm.mall.moduls.mapper.FinanceCustomerAssetsDao;
import com.jz.dm.mall.moduls.mapper.FinanceTradeFlowDao;
import com.jz.dm.mall.moduls.service.FinanceTradeFlowService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
......@@ -15,13 +30,105 @@ import java.util.Map;
* @since 2020-12-01 10:41:39
*/
@Service("financeTradeFlowService")
@Transactional
public class FinanceTradeFlowServiceImpl implements FinanceTradeFlowService {
@Autowired
private FinanceTradeFlowDao financeTradeFlowDao;
@Autowired
private FinanceCustomerAssetsDao financeCustomerAssetsDao;
@Override
public FinanceCustomerAssetsDto queryAccountMoneyByMap(Map map) throws Exception {
return financeTradeFlowDao.queryAccountMoneyByMap(map);
}
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean uptAccountMoney(FinanceCustomerBalanceRequest customerBalanceRequest) throws Exception {
//1.充值记录表中加数据
FinanceCustomerBalance financeCustomerBalance = new FinanceCustomerBalance();
financeCustomerBalance.setAssetsId(customerBalanceRequest.getAssetsId());//企业资产id
financeCustomerBalance.setBalanceMoney(customerBalanceRequest.getBalanceMoney()); //充值金额
//financeCustomerBalance.setCrePerson();
financeCustomerBalance.setCreTime(new Date());
financeCustomerBalance.setAuditStatus("01"); //待审核
financeCustomerBalance.setRemark(customerBalanceRequest.getRemark()); //备注
int len = financeCustomerAssetsDao.addCoustomerCzMoney(financeCustomerBalance);
/* //2.更新企业资产账户
int len = financeCustomerAssetsDao.uptAccountMoney(financeCustomerBalanceRequest);
//3.在流水记录中添加数据*/
return len > 0;
}
@Override
public FinanceCashOutDto getCashOutAuditStutas(Map map) throws Exception {
//查询当前企业账户,存在的提现未审核的记录
BigDecimal auditMoney = new BigDecimal("0");
List<FinanceCashOutDto> list = financeTradeFlowDao.getCashOutAuditStutas(map);
if (list.size() > 0 && list != null) {
for (FinanceCashOutDto dto : list) {
auditMoney = auditMoney.add(new BigDecimal(dto.getCashOutMoney().toString())); //累加提现待审核 金额
}
}
FinanceCashOutDto returnDto = new FinanceCashOutDto();
returnDto.setCashOutMoney(auditMoney);
return returnDto;
}
@Override
@Transactional(rollbackFor = Exception.class)
public Result<Object> addCashOutMoney(FinanceCashOutRequest financeCashOutRequest) throws Exception {
Result<Object> result = new Result<>();
Long assetId = financeCashOutRequest.getAssetsId(); // 企业资产id
BigDecimal cashOutMoney = new BigDecimal(financeCashOutRequest.getCashOutMoney().toString()); //提现金额
FinanceCashOut financeCashOut = new FinanceCashOut();
BeanUtils.copyProperties(financeCashOutRequest, financeCashOut);
financeCashOut.setCreTime(new Date()); //创建时间
financeCashOut.setCashOutTime(new Date()); //提现时间
financeCashOut.setAuditStatus(AuditStatusEnum.DSH.getValue()); //待审核
//financeCashOut.setCrePerson();
//添加一条提现记录
int len = financeTradeFlowDao.addCashOutMoney(financeCashOut);
if (len == 0) {
result.setMessage("提交失败!");
result.setCode(500);
return result;
}
// 查询 当前企业 可用余额 冻结金额
Map map = new HashMap();
map.put("assetId", assetId);
FinanceCustomerAssetsDto dto = financeTradeFlowDao.queryAccountMoneyByMap(map);
BigDecimal useMoney = new BigDecimal(dto.getUseMoney().toString()); //可用金额
if (useMoney != null && cashOutMoney != null) {
if (useMoney.compareTo(cashOutMoney) > -1) { //可用大于等于提现
useMoney = useMoney.subtract(cashOutMoney); //可用 减去 提现
BigDecimal djMoney = new BigDecimal(dto.getFrozenMoney().toString()); //冻结金额
djMoney = djMoney.add(cashOutMoney); //累计冻结金额
//修改企业资产 金额
FinanceCustomerAssets assets = new FinanceCustomerAssets();
assets.setUptTime(new Date());
//assets.setUptPerson();
assets.setUseMoney(useMoney);
assets.setFrozenMoney(djMoney);
assets.setAssetsId(assetId);
int lens = financeCustomerAssetsDao.uptAccountMoney(assets);
if (lens == 0) {
result.setMessage("提交失败!");
result.setCode(500);
return result;
}
} else {
result.setMessage("提交失败!");
result.setCode(500);
return result;
}
}
return result;
}
}
\ No newline at end of file
package com.jz.dm.mall.moduls.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.jz.common.bean.PageInfoResponse;
import com.jz.common.constant.Constants;
import com.jz.common.constant.ResultCode;
import com.jz.common.constant.ResultMsg;
import com.jz.common.entity.PlatformLog;
import com.jz.common.utils.Result;
import com.jz.dm.mall.moduls.controller.log.bean.LogInfoQueryReq;
import com.jz.dm.mall.moduls.controller.order.bean.OrderDto;
import com.jz.dm.mall.moduls.entity.MallCustomer;
import com.jz.dm.mall.moduls.mapper.MallCustomerDao;
import com.jz.dm.mall.moduls.mapper.PlatformLogDao;
import com.jz.dm.mall.moduls.service.LogInfoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/**
* @author ZC
* @PACKAGE_NAME: com.jz.dm.mall.moduls.service.impl
* @PROJECT_NAME: jz-dm-parent
* @NAME: LogInfoServiceImpl
* @USER: key
* @DATE: 2020-12-3/19:00
* @DAY_NAME_SHORT: 周四
* @Description:
**/
@Slf4j
@Service("logInfoService")
public class LogInfoServiceImpl implements LogInfoService {
@Resource
private PlatformLogDao platformLogDao;
@Resource
private MallCustomerDao mallCustomerDao;
@Override
public Result<PageInfoResponse<PlatformLog>> getMallUserLogInfo(LogInfoQueryReq req) {
Long customerId =0L;
if (null == customerId) {
return Result.of_error(ResultMsg.USER_NOT_EXIST);
}
MallCustomer mallCustomer = mallCustomerDao.findById(customerId);
if (null == mallCustomer) {
return Result.of_error(ResultMsg.USER_NOT_EXIST);
}
PageInfoResponse<PlatformLog> pageInfoResponse = new PageInfoResponse<>();
PageHelper.startPage(req.getPageNum(), req.getPageSize());
List<PlatformLog> list = platformLogDao.listMallLogInfo(mallCustomer.getCustomerId());
PageInfo<PlatformLog> pageInfo = new PageInfo<>(list);
pageInfoResponse.setCode(Constants.SUCCESS_CODE);
pageInfoResponse.setMessage(ResultMsg.SUCCESS.getMsg());
pageInfoResponse.setData(pageInfo);
return Result.of_success(pageInfoResponse);
}
/**
* 获取商城用户日志信息详情
* @param platformLogId
* @return
*/
@Override
public Result getMallUserLogDetail(Long platformLogId) {
PlatformLog platformLog = platformLogDao.selectById(platformLogId);
if (null == platformLog){
return Result.of_error(ResultMsg.DATA_NOT_FOUND);
}
return Result.of_success(platformLog);
}
}
package com.jz.dm.mall.moduls.service.impl;
import com.jz.common.constant.ResultMsg;
import com.jz.common.utils.Result;
import com.jz.dm.mall.moduls.entity.MallCustomer;
import com.jz.dm.mall.moduls.mapper.MallCustomerDao;
import com.jz.dm.mall.moduls.service.PersonalUserControllerService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Date;
/**
* @author ZC
* @PACKAGE_NAME: com.jz.dm.mall.moduls.service.impl
* @PROJECT_NAME: jz-dm-parent
* @NAME: PersonalUserControllerServiceImpl
* @USER: key
* @DATE: 2020-12-3/18:04
* @DAY_NAME_SHORT: 周四
* @Description:
**/
@Service("personalUserControllerService")
@Slf4j
public class PersonalUserControllerServiceImpl implements PersonalUserControllerService {
@Resource
private MallCustomerDao mallCustomerDao;
@Override
public Result getUserInfo() {
Long customId =0L;
MallCustomer mallCustomer = mallCustomerDao.findById(customId);
if (null == mallCustomer){
return Result.of_error(ResultMsg.USER_NOT_EXIST);
}
return Result.of_success(mallCustomer);
}
/**
* 修改用户密码
* @param oldPassWard
* @param newPassWard
* @return
*/
@Override
public Result updateUserPassWard(String oldPassWard, String newPassWard) {
Long customId =0L;
MallCustomer mallCustomer = mallCustomerDao.findById(customId);
if (null == mallCustomer){
return Result.of_error(ResultMsg.USER_NOT_EXIST);
}
if (!oldPassWard.equals(mallCustomer.getPassword())){
return Result.of_error("旧密码错误");
}
MallCustomer customer = new MallCustomer();
customer.setCustomerId(mallCustomer.getCustomerId());
customer.setPassword(newPassWard);
customer.setUptPerson(mallCustomer.getCustomerName());
customer.setUptTime(new Date());
if (mallCustomerDao.updateById(customer) != 1){
return Result.of_error(ResultMsg.UPDATE_FAIL);
}
return Result.of_success(ResultMsg.UPDATE_SUCCESS);
}
}
......@@ -54,4 +54,19 @@
</if>
</select>
<select id="selectCompanyDetail" resultType="com.jz.dm.mall.moduls.controller.company.dto.CompanyInfoDto">
SELECT
department_id AS departmentId,
audit_status AS auditStatus,
department_name AS departmentName,
registered_address AS registeredAddress,
business_license AS businessLicense,
bank_name AS bankName,
brank_card_number AS bankCardNumber,
linkman AS linkman,
telephone AS telephone
FROM t_department
WHERE department_id=#{departmentId} AND del_flag ='N'
</select>
</mapper>
\ No newline at end of file
......@@ -127,4 +127,32 @@
delete from t_finance_customer_assets where assets_id = #{assetsId}
</delete>
<update id="uptAccountMoney" parameterType="com.jz.dm.mall.moduls.entity.FinanceCustomerAssets">
update t_finance_customer_assets
<set>
<if test="useMoney != null">
use_money = #{useMoney},
</if>
<if test="totalMoney != null">
total_money = #{totalMoney},
</if>
<if test="uptTime != null">
upt_time = #{uptTime},
</if>
<if test="uptPerson != null and uptPerson != ''">
upt_person = #{uptPerson},
</if>
<if test="remark != null">
remark = #{remark},
</if>
</set>
where assets_id = #{assetsId}
</update>
<!--添加一条充值记录-->
<insert id="addCoustomerCzMoney" keyProperty="cashOutId" useGeneratedKeys="true">
insert into t_finance_customer_balance(assets_id, balance_money, remark, cre_time, cre_person, audit_status)
values (#{assetsId}, #{balanceMoney}, #{remark}, #{creTime}, #{crePerson}, #{auditStatus})
</insert>
</mapper>
\ No newline at end of file
......@@ -3,18 +3,36 @@
<mapper namespace="com.jz.dm.mall.moduls.mapper.FinanceTradeFlowDao">
<!--商城 充值 只有已审核(认证)企业-->
<select id="queryAccountMoneyByMap" resultType="com.jz.dm.mall.moduls.controller.finance.bean.FinanceCustomerAssetsDto" parameterType="map">
<select id="queryAccountMoneyByMap"
resultType="com.jz.dm.mall.moduls.controller.finance.bean.FinanceCustomerAssetsDto" parameterType="map">
select
assets_id as assetsId,
department_id as departmentId,
use_money as useMoney,
frozen_money as frozenMoney,
total_money as totalMoney
t.assets_id as assetsId,
t.department_id as departmentId,
t.use_money as useMoney,
t.frozen_money as frozenMoney,
t.total_money as totalMoney
from t_finance_customer_assets t
left join t_department t1 on t.department_id=t1.department_id and t1.audit_status='02'
where 1=1
<if test="assetsId != null">and assets_id = #{assetsId}</if>
<if test="departmentId != null">and department_id = #{departmentId}</if>
<if test="assetsId != null">and t.assets_id = #{assetsId}</if>
<if test="departmentId != null">and t.department_id = #{departmentId}</if>
</select>
<select id="getCashOutAuditStutas" resultType="com.jz.dm.mall.moduls.controller.finance.bean.FinanceCashOutDto"
parameterType="map">
select
assets_id as assetsId,
cash_out_money as cashOutMoney,
audit_status as auditStatus
from t_finance_cash_out
where 1=1 and audit_status ='01' and assets_id = #{assetsId}
</select>
<insert id="addCashOutMoney" keyProperty="customerBalanceId" useGeneratedKeys="true">
insert into t_finance_cash_out(assets_id, cash_out_money, cash_out_time, audit_time, audit_person,
reject_reason, pay_time, pay_person, remark, audit_status, cre_person, cre_time, del_flag)
values (#{assetsId}, #{cashOutMoney}, #{cashOutTime}, #{auditTime}, #{auditPerson}, #{rejectReason},
#{payTime}, #{payPerson}, #{remark}, #{auditStatus}, #{crePerson}, #{creTime}, #{delFlag})
</insert>
</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.PlatformLogDao">
<select id="listMallLogInfo" resultType="com.jz.common.entity.PlatformLog">
</select>
</mapper>
\ No newline at end of file
......@@ -141,6 +141,10 @@
<version>1.0.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>io.projectreactor</groupId>
<artifactId>reactor-core</artifactId>
</dependency>
<!--阿里云服务器短信平台-->
<dependency>
<groupId>com.aliyun</groupId>
......
......@@ -41,7 +41,7 @@ public class TestUserController extends BaseController {
Result<IPage<User>> result = new Result<IPage<User>>();
IPage<User> pageList = testUserService.queryPage(new Page<User>(1, 2), event);
result.setSuccess(true);
result.setResult(pageList);
result.setData(pageList);
return result;
}
......@@ -51,7 +51,7 @@ public class TestUserController extends BaseController {
Result<IPage<Map>> result = new Result<IPage<Map>>();
IPage<Map> pageList = testUserService.queryListPage(new Page<Map>(1, 2), event);
result.setSuccess(true);
result.setResult(pageList);
result.setData(pageList);
return result;
}
}
package com.jz.manage.moduls.controller.log;
import com.jz.common.bean.PageInfoResponse;
import com.jz.common.entity.PlatformLog;
import com.jz.common.utils.Result;
import com.jz.manage.moduls.controller.BaseController;
import com.jz.manage.moduls.controller.log.bean.ManageLogInfoQueryReq;
import com.jz.manage.moduls.service.PlatformLogService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import reactor.core.publisher.Mono;
/**
* 日志管理(TPlatformLog)表控制层
......@@ -21,5 +27,25 @@ public class PlatformLogController extends BaseController {
@Autowired
private PlatformLogService tPlatformLogService;
/**
* @Description: 后台用户日志信息列表
* @Author: Mr.zhang
* @Date: 2020-12-2
*/
@PostMapping("/listManageLogInfo")
@ApiOperation(value = "后台用户日志信息列表")
public Mono<Result<PageInfoResponse<PlatformLog>>> getLogInfo(@RequestBody @Validated ManageLogInfoQueryReq req) {
return Mono.fromSupplier(() -> tPlatformLogService.listManageUserLogInfo(req));
}
/**
* @Description: 获取用户日志信息详情
* @Author: Mr.zhang
* @Date: 2020-12-2
*/
@PostMapping("/getLogDetail")
@ApiOperation(value = "获取用户日志信息详情")
public Mono<Result> getLogInfoDetail(@RequestParam(value = "日志信息Id") Long platformLogId) {
return Mono.fromSupplier(() -> tPlatformLogService.getMallUserLogDetail(platformLogId));
}
}
\ No newline at end of file
......@@ -3,6 +3,8 @@ package com.jz.manage.moduls.mapper;
import com.jz.common.base.BaseMapper;
import com.jz.common.entity.PlatformLog;
import java.util.List;
/**
* 日志管理(TPlatformLog)表数据库访问层
*
......@@ -11,4 +13,11 @@ import com.jz.common.entity.PlatformLog;
*/
public interface PlatformLogDao extends BaseMapper<PlatformLog> {
/**
* 查询平台用户日志列表
* @return
*/
List<PlatformLog> listMallLogInfo();
}
\ No newline at end of file
package com.jz.manage.moduls.service;
import com.jz.common.bean.PageInfoResponse;
import com.jz.common.entity.PlatformLog;
import com.jz.common.utils.Result;
import com.jz.manage.moduls.controller.log.bean.ManageLogInfoQueryReq;
/**
* 日志管理(TPlatformLog)表服务接口
*
......@@ -9,4 +14,17 @@ package com.jz.manage.moduls.service;
public interface PlatformLogService {
/**
* 平台用户日志列表
* @param req
* @return
*/
Result<PageInfoResponse<PlatformLog>> listManageUserLogInfo(ManageLogInfoQueryReq req);
/**
* 获取用户日志详情
* @param platformLogId
* @return
*/
Result getMallUserLogDetail(Long platformLogId);
}
\ No newline at end of file
package com.jz.manage.moduls.service.impl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.jz.common.bean.PageInfoResponse;
import com.jz.common.constant.Constants;
import com.jz.common.constant.ResultMsg;
import com.jz.common.entity.PlatformLog;
import com.jz.common.utils.Result;
import com.jz.manage.moduls.controller.log.bean.ManageLogInfoQueryReq;
import com.jz.manage.moduls.mapper.PlatformLogDao;
import com.jz.manage.moduls.service.PlatformLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 日志管理(TPlatformLog)表服务实现类
*
......@@ -15,4 +25,31 @@ import org.springframework.stereotype.Service;
public class PlatformLogServiceImpl implements PlatformLogService {
@Autowired
private PlatformLogDao tPlatformLogDao;
@Override
public Result<PageInfoResponse<PlatformLog>> listManageUserLogInfo(ManageLogInfoQueryReq req) {
PageInfoResponse<PlatformLog> pageInfoResponse = new PageInfoResponse<>();
PageHelper.startPage(req.getPageNum(), req.getPageSize());
List<PlatformLog> list = tPlatformLogDao.listMallLogInfo();
PageInfo<PlatformLog> pageInfo = new PageInfo<>(list);
pageInfoResponse.setCode(Constants.SUCCESS_CODE);
pageInfoResponse.setMessage(ResultMsg.SUCCESS.getMsg());
pageInfoResponse.setData(pageInfo);
return Result.of_success(pageInfoResponse);
}
/**
* 获取用户日志详情
* @param platformLogId
* @return
*/
@Override
public Result getMallUserLogDetail(Long platformLogId) {
PlatformLog platformLog = tPlatformLogDao.selectById(platformLogId);
if (null == platformLog){
return Result.of_error(ResultMsg.DATA_NOT_FOUND);
}
return Result.of_success(platformLog);
}
}
\ No newline at end of file
......@@ -25,189 +25,8 @@
<result property="creTime" column="cre_time" jdbcType="TIMESTAMP"/>
<result property="delFlag" column="del_flag" jdbcType="VARCHAR"/>
</resultMap>
<!--查询单个-->
<select id="queryById" resultMap="TPlatformLogMap">
select
platform_log_id, request_ip, caller_id, data_goods_id, api_key, request_params, return_params, request_url, request_time, service_type, data_goods_type, download_address, data_price, price_type, total_times, used_times, remain_times, start_time, end_time, cre_time, del_flag
from t_platform_log
where platform_log_id = #{platformLogId}
</select>
<!--查询指定行数据-->
<select id="queryAllByLimit" resultMap="TPlatformLogMap">
select
platform_log_id, request_ip, caller_id, data_goods_id, api_key, request_params, return_params, request_url, request_time, service_type, data_goods_type, download_address, data_price, price_type, total_times, used_times, remain_times, start_time, end_time, cre_time, del_flag
from t_platform_log
limit #{offset}, #{limit}
</select>
<!--通过实体作为筛选条件查询-->
<select id="queryAll" resultMap="TPlatformLogMap">
select
platform_log_id, request_ip, caller_id, data_goods_id, api_key, request_params, return_params, request_url,
request_time, service_type, data_goods_type, download_address, data_price, price_type, total_times, used_times,
remain_times, start_time, end_time, cre_time, del_flag
from t_platform_log
<where>
<if test="platformLogId != null">
and platform_log_id = #{platformLogId}
</if>
<if test="requestIp != null and requestIp != ''">
and request_ip = #{requestIp}
</if>
<if test="callerId != null and callerId != ''">
and caller_id = #{callerId}
</if>
<if test="dataGoodsId != null">
and data_goods_id = #{dataGoodsId}
</if>
<if test="apiKey != null and apiKey != ''">
and api_key = #{apiKey}
</if>
<if test="requestParams != null and requestParams != ''">
and request_params = #{requestParams}
</if>
<if test="returnParams != null and returnParams != ''">
and return_params = #{returnParams}
</if>
<if test="requestUrl != null and requestUrl != ''">
and request_url = #{requestUrl}
</if>
<if test="requestTime != null">
and request_time = #{requestTime}
</if>
<if test="serviceType != null and serviceType != ''">
and service_type = #{serviceType}
</if>
<if test="dataGoodsType != null and dataGoodsType != ''">
and data_goods_type = #{dataGoodsType}
</if>
<if test="downloadAddress != null and downloadAddress != ''">
and download_address = #{downloadAddress}
</if>
<if test="dataPrice != null">
and data_price = #{dataPrice}
</if>
<if test="priceType != null and priceType != ''">
and price_type = #{priceType}
</if>
<if test="totalTimes != null">
and total_times = #{totalTimes}
</if>
<if test="usedTimes != null">
and used_times = #{usedTimes}
</if>
<if test="remainTimes != null">
and remain_times = #{remainTimes}
</if>
<if test="startTime != null">
and start_time = #{startTime}
</if>
<if test="endTime != null">
and end_time = #{endTime}
</if>
<if test="creTime != null">
and cre_time = #{creTime}
</if>
<if test="delFlag != null and delFlag != ''">
and del_flag = #{delFlag}
</if>
</where>
<select id="listMallLogInfo" resultMap="TPlatformLogMap">
SELECT * FROM t_t_platform_log
</select>
<!--新增所有列-->
<insert id="insert" keyProperty="platformLogId" useGeneratedKeys="true">
insert into t_platform_log(request_ip, caller_id, data_goods_id, api_key, request_params, return_params, request_url, request_time, service_type, data_goods_type, download_address, data_price, price_type, total_times, used_times, remain_times, start_time, end_time, cre_time, del_flag)
values (#{requestIp}, #{callerId}, #{dataGoodsId}, #{apiKey}, #{requestParams}, #{returnParams}, #{requestUrl}, #{requestTime}, #{serviceType}, #{dataGoodsType}, #{downloadAddress}, #{dataPrice}, #{priceType}, #{totalTimes}, #{usedTimes}, #{remainTimes}, #{startTime}, #{endTime}, #{creTime}, #{delFlag})
</insert>
<insert id="insertBatch" keyProperty="platformLogId" useGeneratedKeys="true">
insert into t_platform_log(request_ip, caller_id, data_goods_id, api_key, request_params,
return_params, request_url, request_time, service_type, data_goods_type, download_address, data_price,
price_type, total_times, used_times, remain_times, start_time, end_time, cre_time, del_flag)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.requestIp}, #{entity.callerId}, #{entity.dataGoodsId}, #{entity.apiKey}, #{entity.requestParams},
#{entity.returnParams}, #{entity.requestUrl}, #{entity.requestTime}, #{entity.serviceType},
#{entity.dataGoodsType}, #{entity.downloadAddress}, #{entity.dataPrice}, #{entity.priceType},
#{entity.totalTimes}, #{entity.usedTimes}, #{entity.remainTimes}, #{entity.startTime}, #{entity.endTime},
#{entity.creTime}, #{entity.delFlag})
</foreach>
</insert>
<!--通过主键修改数据-->
<update id="update">
update t_platform_log
<set>
<if test="requestIp != null and requestIp != ''">
request_ip = #{requestIp},
</if>
<if test="callerId != null and callerId != ''">
caller_id = #{callerId},
</if>
<if test="dataGoodsId != null">
data_goods_id = #{dataGoodsId},
</if>
<if test="apiKey != null and apiKey != ''">
api_key = #{apiKey},
</if>
<if test="requestParams != null and requestParams != ''">
request_params = #{requestParams},
</if>
<if test="returnParams != null and returnParams != ''">
return_params = #{returnParams},
</if>
<if test="requestUrl != null and requestUrl != ''">
request_url = #{requestUrl},
</if>
<if test="requestTime != null">
request_time = #{requestTime},
</if>
<if test="serviceType != null and serviceType != ''">
service_type = #{serviceType},
</if>
<if test="dataGoodsType != null and dataGoodsType != ''">
data_goods_type = #{dataGoodsType},
</if>
<if test="downloadAddress != null and downloadAddress != ''">
download_address = #{downloadAddress},
</if>
<if test="dataPrice != null">
data_price = #{dataPrice},
</if>
<if test="priceType != null and priceType != ''">
price_type = #{priceType},
</if>
<if test="totalTimes != null">
total_times = #{totalTimes},
</if>
<if test="usedTimes != null">
used_times = #{usedTimes},
</if>
<if test="remainTimes != null">
remain_times = #{remainTimes},
</if>
<if test="startTime != null">
start_time = #{startTime},
</if>
<if test="endTime != null">
end_time = #{endTime},
</if>
<if test="creTime != null">
cre_time = #{creTime},
</if>
<if test="delFlag != null and delFlag != ''">
del_flag = #{delFlag},
</if>
</set>
where platform_log_id = #{platformLogId}
</update>
<!--通过主键删除-->
<delete id="deleteById">
delete from t_platform_log where platform_log_id = #{platformLogId}
</delete>
</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