Commit 63e629b9 authored by hezhen's avatar hezhen

123

parent c19673ee
...@@ -7,7 +7,10 @@ import io.swagger.annotations.ApiModelProperty; ...@@ -7,7 +7,10 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List; import java.util.List;
/** /**
...@@ -23,7 +26,7 @@ import java.util.List; ...@@ -23,7 +26,7 @@ import java.util.List;
public class CompanyWalletDTO extends PageParam implements DataInter { public class CompanyWalletDTO extends PageParam implements DataInter {
private SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM");
@ApiModelProperty("门店") @ApiModelProperty("门店")
private Integer companyId; private Integer companyId;
...@@ -32,6 +35,9 @@ public class CompanyWalletDTO extends PageParam implements DataInter { ...@@ -32,6 +35,9 @@ public class CompanyWalletDTO extends PageParam implements DataInter {
@ApiModelProperty("企业") @ApiModelProperty("企业")
private Integer branchId; private Integer branchId;
@ApiModelProperty("月份")
private String month;
List<Integer> dataCorporationIds; List<Integer> dataCorporationIds;
...@@ -41,6 +47,14 @@ public class CompanyWalletDTO extends PageParam implements DataInter { ...@@ -41,6 +47,14 @@ public class CompanyWalletDTO extends PageParam implements DataInter {
Integer bizType; Integer bizType;
public String getMonth(){
if (StringUtils.isBlank(month)){
month=dateFormat.format(new Date());
}
return month;
}
......
...@@ -40,6 +40,13 @@ public class WalletDetailDTO extends PageParam implements DataInter { ...@@ -40,6 +40,13 @@ public class WalletDetailDTO extends PageParam implements DataInter {
@ApiModelProperty("结束时间") @ApiModelProperty("结束时间")
private Long endTime; private Long endTime;
@ApiModelProperty("月份")
private String month;
@ApiModelProperty("0-未提现;1-已提现")
private Integer status;
List<Integer> itypes; List<Integer> itypes;
......
...@@ -2,6 +2,7 @@ package com.github.wxiaoqi.security.admin.entity; ...@@ -2,6 +2,7 @@ package com.github.wxiaoqi.security.admin.entity;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import org.apache.commons.lang3.StringUtils;
import javax.persistence.Column; import javax.persistence.Column;
import javax.persistence.GeneratedValue; import javax.persistence.GeneratedValue;
...@@ -34,6 +35,11 @@ public class BranchCompany { ...@@ -34,6 +35,11 @@ public class BranchCompany {
private String name; private String name;
@ApiModelProperty("门头照")
@Column(name = "head_logo")
private String headLogo;
@Column(name = "short_name") @Column(name = "short_name")
@ApiModelProperty("简称") @ApiModelProperty("简称")
private String shortName; private String shortName;
...@@ -195,4 +201,11 @@ public class BranchCompany { ...@@ -195,4 +201,11 @@ public class BranchCompany {
//点赞数量 //点赞数量
@Column(name = "give_num") @Column(name = "give_num")
private Integer giveNum; private Integer giveNum;
public String getHeadLogo(){
if (StringUtils.isBlank(headLogo)){
headLogo="https://chwplatform.upyuns.com/image/app/shop_logo_default.png";
}
return headLogo;
}
} }
\ No newline at end of file
...@@ -9,6 +9,7 @@ import javax.persistence.Column; ...@@ -9,6 +9,7 @@ import javax.persistence.Column;
import javax.persistence.GeneratedValue; import javax.persistence.GeneratedValue;
import javax.persistence.Id; import javax.persistence.Id;
import javax.persistence.Table; import javax.persistence.Table;
import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
@Data @Data
...@@ -27,6 +28,12 @@ public class CompanyInfo { ...@@ -27,6 +28,12 @@ public class CompanyInfo {
private String name; private String name;
@ApiModelProperty("门头照")
@Column(name = "head_logo")
private String headLogo;
@ApiModelProperty("公司类型:1-个体;2-企业") @ApiModelProperty("公司类型:1-个体;2-企业")
private Integer type; private Integer type;
...@@ -190,4 +197,14 @@ public class CompanyInfo { ...@@ -190,4 +197,14 @@ public class CompanyInfo {
@Column(name = "is_del") @Column(name = "is_del")
private Integer isDel; private Integer isDel;
@ApiModelProperty("公司地址-纬度")
private BigDecimal latitude;
/**
* 公司地址-经度
*/
@ApiModelProperty("公司地址-经度")
private BigDecimal longitude;
} }
\ No newline at end of file
...@@ -30,10 +30,11 @@ public class CompanyInfoApply { ...@@ -30,10 +30,11 @@ public class CompanyInfoApply {
private Long branchId; private Long branchId;
@ApiModelProperty("公司名称") @ApiModelProperty("公司名称")
private String name; private String name;
@ApiModelProperty("公司类型:1-个体;2-企业") @ApiModelProperty("公司类型:1-个体;2-企业")
private Integer type; private Integer type;
......
...@@ -79,8 +79,16 @@ public class CompanyWalletDetail implements Serializable { ...@@ -79,8 +79,16 @@ public class CompanyWalletDetail implements Serializable {
@Column(name = "s_amount") @Column(name = "s_amount")
@ApiModelProperty(value = "门店剩余金额") @ApiModelProperty(value = "门店剩余金额")
private BigDecimal sAmount; private BigDecimal sAmount;
@Column(name = "status")
@ApiModelProperty(value = "状态:0-未提现;1-已提现")
private Integer status;
@Column(name = "status_time")
@ApiModelProperty(value = "提现时间")
private Long statusTime;
@Column(name = "crt_time") @Column(name = "crt_time")
......
...@@ -23,13 +23,20 @@ public class CompanyWalletDetailVo extends CompanyWalletDetail { ...@@ -23,13 +23,20 @@ public class CompanyWalletDetailVo extends CompanyWalletDetail {
@ApiModelProperty("类型") @ApiModelProperty("类型")
private String typeName; private String typeName;
@ApiModelProperty("显示时间")
private Long showTime;
public String getSourceName(){ public String getSourceName(){
if (getItype() == null)
return "";
return CompanyWalletITypeEnum.get(getItype()).getDesc(); return CompanyWalletITypeEnum.get(getItype()).getDesc();
} }
public String getTypeName(){ public String getTypeName(){
if (getItype() == null)
return "";
return getType() == 1 ? "收入":"支出"; return getType() == 1 ? "收入":"支出";
} }
......
...@@ -25,6 +25,10 @@ public class CompanyWalletVo extends CompanyWallet { ...@@ -25,6 +25,10 @@ public class CompanyWalletVo extends CompanyWallet {
private BigDecimal todayAmount; private BigDecimal todayAmount;
@ApiModelProperty("月度营收")
private BigDecimal monthAmount;
@ApiModelProperty("未入账") @ApiModelProperty("未入账")
private BigDecimal notDoAmount; private BigDecimal notDoAmount;
......
...@@ -19,6 +19,7 @@ import com.xxfc.platform.universal.feign.MQSenderFeign; ...@@ -19,6 +19,7 @@ import com.xxfc.platform.universal.feign.MQSenderFeign;
import com.github.wxiaoqi.security.admin.dto.CompanyInfoFindDTO; import com.github.wxiaoqi.security.admin.dto.CompanyInfoFindDTO;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example; import tk.mybatis.mapper.entity.Example;
...@@ -81,6 +82,7 @@ public class CompanyInfoBiz extends BaseBiz<CompanyInfoMapper, CompanyInfo>{ ...@@ -81,6 +82,7 @@ public class CompanyInfoBiz extends BaseBiz<CompanyInfoMapper, CompanyInfo>{
//初始化店铺 //初始化店铺
setInviterAccount(companyInfoApply); setInviterAccount(companyInfoApply);
BranchCompany branchCompany = getBranchCompanyInfo(); BranchCompany branchCompany = getBranchCompanyInfo();
BeanUtils.copyProperties(companyInfo,branchCompany);
branchCompany.setCompanyId(id); branchCompany.setCompanyId(id);
branchCompany.setInviterAccount(companyInfoApply.getInviterAccount()); branchCompany.setInviterAccount(companyInfoApply.getInviterAccount());
branchCompany.setCode(CODE+ReferralCodeUtil.encode(companyInfoApply.getId().intValue())); branchCompany.setCode(CODE+ReferralCodeUtil.encode(companyInfoApply.getId().intValue()));
......
...@@ -65,6 +65,7 @@ public class CompanyWalletBiz extends BaseBiz<CompanyWalletMapper, CompanyWallet ...@@ -65,6 +65,7 @@ public class CompanyWalletBiz extends BaseBiz<CompanyWalletMapper, CompanyWallet
CompanyWalletVo companyWalletVo = list.get(0); CompanyWalletVo companyWalletVo = list.get(0);
companyWalletVo.setTodayAmount(mapper.todayAmount(companyWalletVo.getCompanyId())); companyWalletVo.setTodayAmount(mapper.todayAmount(companyWalletVo.getCompanyId()));
companyWalletVo.setNotDoAmount(mapper.notDoAmount(companyWalletVo.getCompanyId())); companyWalletVo.setNotDoAmount(mapper.notDoAmount(companyWalletVo.getCompanyId()));
companyWalletVo.setMonthAmount(mapper.monthAmount(companyWalletVo.getCompanyId(),walletDTO.getMonth()));
return companyWalletVo; return companyWalletVo;
} }
......
...@@ -122,6 +122,15 @@ public class CompanyWalletDetailBiz extends BaseBiz<CompanyWalletDetailMapper, C ...@@ -122,6 +122,15 @@ public class CompanyWalletDetailBiz extends BaseBiz<CompanyWalletDetailMapper, C
return mapper.selectList(walletDetailDTO); return mapper.selectList(walletDetailDTO);
} }
public PageDataVO<CompanyWalletDetailVo> selectListByCompanyId(WalletDetailDTO walletDetailDTO) {
return PageDataVO.pageInfo(walletDetailDTO.getPage(), walletDetailDTO.getLimit(), () -> walletDetail(walletDetailDTO));
}
public List<CompanyWalletDetailVo> walletDetail(WalletDetailDTO walletDetailDTO){
return mapper.walletDetail(walletDetailDTO);
}
public JSONObject getSumAmount(WalletDetailDTO walletDetailDTO){ public JSONObject getSumAmount(WalletDetailDTO walletDetailDTO){
List<Integer> itypes=new ArrayList<>(); List<Integer> itypes=new ArrayList<>();
itypes.add(1); itypes.add(1);
......
...@@ -29,6 +29,8 @@ public interface CompanyWalletDetailMapper extends Mapper<CompanyWalletDetail> { ...@@ -29,6 +29,8 @@ public interface CompanyWalletDetailMapper extends Mapper<CompanyWalletDetail> {
BigDecimal sumAmount(WalletDetailDTO walletDetailDTO); BigDecimal sumAmount(WalletDetailDTO walletDetailDTO);
List<CompanyWalletDetailVo> walletDetail(WalletDetailDTO walletDetailDTO);
} }
...@@ -41,6 +41,10 @@ public interface CompanyWalletMapper extends Mapper<CompanyWallet> { ...@@ -41,6 +41,10 @@ public interface CompanyWalletMapper extends Mapper<CompanyWallet> {
BigDecimal todayAmount(@Param("companyId") Integer companyId); BigDecimal todayAmount(@Param("companyId") Integer companyId);
@Select("SELECT IFNULL(SUM(amount),0) FROM company_wallet_detail WHERE type=1 and company_id=#{companyId} and from_unixtime(crt_time/1000,'%Y-%m')=#{month}")
BigDecimal monthAmount(@Param("companyId") Integer companyId,@Param("month") String month);
@Select("SELECT IFNULL(SUM(division_amount-fee),0) FROM base_order_accept_detailed WHERE `status`=0 and mch_id=#{companyId} and division_type in (3,5,6,7,8)") @Select("SELECT IFNULL(SUM(division_amount-fee),0) FROM base_order_accept_detailed WHERE `status`=0 and mch_id=#{companyId} and division_type in (3,5,6,7,8)")
BigDecimal notDoAmount(@Param("companyId") Integer companyId); BigDecimal notDoAmount(@Param("companyId") Integer companyId);
} }
...@@ -29,7 +29,6 @@ public class AppCompanyWalletController extends BaseController<CompanyWalletBiz> ...@@ -29,7 +29,6 @@ public class AppCompanyWalletController extends BaseController<CompanyWalletBiz>
@GetMapping("info") @GetMapping("info")
@ApiModelProperty("店铺营收信息") @ApiModelProperty("店铺营收信息")
@IgnoreUserToken
public ObjectRestResponse info(CompanyWalletDTO companyWalletDTO) { public ObjectRestResponse info(CompanyWalletDTO companyWalletDTO) {
if (companyWalletDTO.getCompanyId() == null || companyWalletDTO.getCompanyId() == 0){ if (companyWalletDTO.getCompanyId() == null || companyWalletDTO.getCompanyId() == 0){
List<Integer> companyIds = getBusinessUserCompanyIds(); List<Integer> companyIds = getBusinessUserCompanyIds();
......
package com.github.wxiaoqi.security.admin.rest;
import com.github.wxiaoqi.security.admin.biz.CompanyWalletDetailBiz;
import com.github.wxiaoqi.security.admin.dto.WalletDetailDTO;
import com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* @author Administrator
*/
@Slf4j
@RestController
@RequestMapping("app/companyWalletDetail")
@RequiredArgsConstructor(onConstructor_ = {@Autowired})
@Api(tags = {"店铺钱包明细"})
public class AppCompanyWalletDetailController extends BaseController<CompanyWalletDetailBiz> {
@GetMapping("selectList")
@ApiModelProperty("钱包明细")
public ObjectRestResponse info(WalletDetailDTO walletDetailDTO) {
if (walletDetailDTO.getCompanyId() == null || walletDetailDTO.getCompanyId() == 0){
List<Integer> companyIds = getBusinessUserCompanyIds();
if (companyIds != null && companyIds.size() > 0){
walletDetailDTO.setCompanyId(companyIds.get(0));
}
}
return ObjectRestResponse.succ(baseBiz.selectListByCompanyId(walletDetailDTO));
}
}
<?xml version="1.0" encoding="UTF-8" ?> <?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" > <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.xxfc.platform.order.mapper.CompanyWalletDetailMapper"> <mapper namespace="com.github.wxiaoqi.security.admin.mapper.CompanyWalletDetailMapper">
<select id="selectList" resultType="com.xxfc.platform.order.pojo.vo.CompanyWalletDetailVo" parameterType="com.xxfc.platform.order.pojo.dto.WalletDetailDTO"> <select id="selectList" resultType="com.github.wxiaoqi.security.admin.vo.CompanyWalletDetailVo" parameterType="com.github.wxiaoqi.security.admin.dto.WalletDetailDTO">
SELECT SELECT
d.cono, d.cono,
d.itype, d.itype,
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
order by d.id desc order by d.id desc
</select> </select>
<select id="sumAmount" resultType="BigDecimal" parameterType="com.xxfc.platform.order.pojo.dto.WalletDetailDTO"> <select id="sumAmount" resultType="BigDecimal" parameterType="com.github.wxiaoqi.security.admin.dto.WalletDetailDTO">
SELECT IFNULL(SUM(amount),0) as amount FROM company_wallet_detail SELECT IFNULL(SUM(amount),0) as amount FROM company_wallet_detail
<where> <where>
itype in itype in
...@@ -73,8 +73,42 @@ ...@@ -73,8 +73,42 @@
</if> </if>
</where> </where>
</select> </select>
<select id="walletDetail" resultType="com.github.wxiaoqi.security.admin.vo.CompanyWalletDetailVo" parameterType="com.github.wxiaoqi.security.admin.dto.WalletDetailDTO">
SELECT r.* FROM
(
SELECT
cono,
IFNULL(SUM(amount),0) as amount,
IF(FIND_IN_SET(GROUP_CONCAT(source),2)=1 ,2,1) as type,
`status`,
IF(status_time>0,status_time,crt_time) showTime
FROM company_wallet_detail
WHERE
company_id = #{companyId} and source in (1,2,3,5)
GROUP BY cono
UNION ALL
SELECT
cono,
IFNULL(SUM(amount),0) as totalAmount,
3 as type ,
`status`,
IF(status_time>0,status_time,crt_time) showTime
FROM company_wallet_detail
WHERE
company_id = #{companyId} and source in (4)
GROUP BY cono
) r
<where>
<if test="month != null and month != '' ">
and from_unixtime(r.showTime/1000,'%Y-%m')=#{month}
</if>
<if test="status != null and status == 0">
and r.status in (0,1)
</if>
</where>
order by r.showTime desc
</select>
</mapper> </mapper>
\ No newline at end of file
package com.xxfc.platform.order.pojo.vo; package com.xxfc.platform.order.pojo.vo;
import com.github.wxiaoqi.security.admin.entity.CompanyWalletDetail;
import com.xxfc.platform.order.contant.enumerate.CompanyWalletITypeEnum; import com.xxfc.platform.order.contant.enumerate.CompanyWalletITypeEnum;
import com.xxfc.platform.order.contant.enumerate.CompanyWalletSourceEnum;
import com.xxfc.platform.order.entity.CompanyWalletDetail;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
...@@ -25,6 +25,10 @@ public class CompanyWalletDetailVo extends CompanyWalletDetail { ...@@ -25,6 +25,10 @@ public class CompanyWalletDetailVo extends CompanyWalletDetail {
private String typeName; private String typeName;
@ApiModelProperty("显示时间")
private Long showTime;
public String getSourceName(){ public String getSourceName(){
return CompanyWalletITypeEnum.get(getItype()).getDesc(); return CompanyWalletITypeEnum.get(getItype()).getDesc();
} }
......
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