Commit 8b9d8fbe authored by zuoyh's avatar zuoyh

Merge remote-tracking branch 'origin/dev' into dev

parents 318d7a63 fcc0acde
...@@ -15,9 +15,9 @@ import java.util.stream.Collectors; ...@@ -15,9 +15,9 @@ import java.util.stream.Collectors;
* @data 2019/11/13 17:23 * @data 2019/11/13 17:23
*/ */
public enum LevelEnum { public enum LevelEnum {
DIAMOND(3, "钻石"), DIAMOND(3, "钻石会员"),
GOLD(2, "黄金"), GOLD(2, "黄金会员"),
GENERAL(1, "普通"); GENERAL(1, "普通会员");
LevelEnum(Integer level, String desc) { LevelEnum(Integer level, String desc) {
this.level = level; this.level = level;
......
...@@ -26,4 +26,8 @@ public class WalletCathFindDTO extends PageParam { ...@@ -26,4 +26,8 @@ public class WalletCathFindDTO extends PageParam {
private Long startTime; private Long startTime;
private Long endTime; private Long endTime;
/**
* 提现方式 1:线下自动 2:线下手动 3:线上自动
*/
private Integer withdrawWay;
} }
...@@ -56,6 +56,6 @@ public class WalletCathListDTO { ...@@ -56,6 +56,6 @@ public class WalletCathListDTO {
private String accountName; private String accountName;
@ApiModelProperty(value = "线下提现方式 1:自动 2:手动") @ApiModelProperty(value = "提现方式 1:线下自动 2:线下手动 3:线上自动")
private Integer offlineWay; private Integer withdrawWay;
} }
...@@ -134,9 +134,9 @@ public class MyWalletCath implements Serializable { ...@@ -134,9 +134,9 @@ public class MyWalletCath implements Serializable {
@Column(name = "account_name") @Column(name = "account_name")
private String accountName; private String accountName;
@Column(name = "offline_way") @Column(name = "withdraw_way")
@ApiModelProperty(value = "线下提现方式 1:自动 2:手动") @ApiModelProperty(value = "提现方式 1:线下自动 2:线下手动 3:线上自动")
private Integer offlineWay; private Integer withdrawWay;
@Column(name = "real_reason") @Column(name = "real_reason")
private String realReason; private String realReason;
......
...@@ -164,11 +164,6 @@ public interface UserFeign { ...@@ -164,11 +164,6 @@ public interface UserFeign {
@RequestParam(value = "isSuccess") Boolean isSuccess, @RequestParam(value = "isSuccess") Boolean isSuccess,
@RequestParam(value = "realReason",required = false) String realReason); @RequestParam(value = "realReason",required = false) String realReason);
@GetMapping("/app/user/collect/exist")
boolean isCollectionByTypeAndTypeId(@RequestParam("userId") Integer userId,
@RequestParam(value = "type") int type,
@RequestParam("id") Integer typId);
/** /**
* 通过公司id,获取员工的下级用户id * 通过公司id,获取员工的下级用户id
* @param parentCompanyId * @param parentCompanyId
...@@ -193,4 +188,11 @@ public interface UserFeign { ...@@ -193,4 +188,11 @@ public interface UserFeign {
@GetMapping("/public/getUsersByUserIdList") @GetMapping("/public/getUsersByUserIdList")
ObjectRestResponse<List<AppUserVo>> getByUserIdList(@RequestParam("userIds") List<Integer> userIds); ObjectRestResponse<List<AppUserVo>> getByUserIdList(@RequestParam("userIds") List<Integer> userIds);
@GetMapping("/app/user/collect/exist")
boolean isCollectionByTypeAndTypeId(@RequestParam("userId") Integer userId,
@RequestParam(value = "type") int type,
@RequestParam("id") Integer typId);
@GetMapping("/app/user/list_user_info")
List<UserBo> findUserDetailUserIds(@RequestParam(value = "userIds",required = false) List<Integer> userIds);
} }
...@@ -52,6 +52,6 @@ public class WalletCathAdminVo { ...@@ -52,6 +52,6 @@ public class WalletCathAdminVo {
private String accountName; private String accountName;
@ApiModelProperty(value = "线下提现方式 1:自动 2:手动") @ApiModelProperty(value = "提现方式 1:线下自动 2:线下手动 3:线上自动")
private Integer offlineWay; private Integer withdrawWay;
} }
...@@ -241,4 +241,9 @@ public class AppUserDetailBiz extends BaseBiz<AppUserDetailMapper, AppUserDetail ...@@ -241,4 +241,9 @@ public class AppUserDetailBiz extends BaseBiz<AppUserDetailMapper, AppUserDetail
List<AppUserDetail> appUserDetails = mapper.selectAllWithNoProviinceCode(); List<AppUserDetail> appUserDetails = mapper.selectAllWithNoProviinceCode();
return CollectionUtils.isEmpty(appUserDetails)?Collections.EMPTY_LIST:appUserDetails; return CollectionUtils.isEmpty(appUserDetails)?Collections.EMPTY_LIST:appUserDetails;
} }
public List<UserBo> findUserDetailByUserIds(List<Integer> userIds) {
List<UserBo> userBoList = mapper.selectUserByUserIds(userIds);
return CollectionUtils.isEmpty(userBoList)?Collections.EMPTY_LIST:userBoList;
} }
}
...@@ -3,9 +3,8 @@ package com.github.wxiaoqi.security.admin.biz; ...@@ -3,9 +3,8 @@ package com.github.wxiaoqi.security.admin.biz;
import com.ace.cache.annotation.Cache; import com.ace.cache.annotation.Cache;
import com.ace.cache.annotation.CacheClear; import com.ace.cache.annotation.CacheClear;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.github.wxiaoqi.security.admin.dto.AccountBindDTO;
import com.github.wxiaoqi.security.admin.bo.UserBo; import com.github.wxiaoqi.security.admin.bo.UserBo;
import com.github.wxiaoqi.security.admin.entity.AppUserDetail; import com.github.wxiaoqi.security.admin.dto.AccountBindDTO;
import com.github.wxiaoqi.security.admin.entity.AppUserLogin; import com.github.wxiaoqi.security.admin.entity.AppUserLogin;
import com.github.wxiaoqi.security.admin.entity.AppUserPositionTemp; import com.github.wxiaoqi.security.admin.entity.AppUserPositionTemp;
import com.github.wxiaoqi.security.admin.entity.AppUserRelation; import com.github.wxiaoqi.security.admin.entity.AppUserRelation;
...@@ -13,9 +12,7 @@ import com.github.wxiaoqi.security.admin.mapper.AppUserLoginMapper; ...@@ -13,9 +12,7 @@ import com.github.wxiaoqi.security.admin.mapper.AppUserLoginMapper;
import com.github.wxiaoqi.security.common.biz.BaseBiz; import com.github.wxiaoqi.security.common.biz.BaseBiz;
import com.github.wxiaoqi.security.common.config.rabbit.RabbitConstant; import com.github.wxiaoqi.security.common.config.rabbit.RabbitConstant;
import com.github.wxiaoqi.security.common.constant.UserConstant; import com.github.wxiaoqi.security.common.constant.UserConstant;
import com.github.wxiaoqi.security.common.exception.BaseException;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse; import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.xxfc.platform.im.utils.StringUtil;
import com.xxfc.platform.universal.entity.IdInformation; import com.xxfc.platform.universal.entity.IdInformation;
import com.xxfc.platform.universal.feign.MQSenderFeign; import com.xxfc.platform.universal.feign.MQSenderFeign;
import com.xxfc.platform.universal.feign.ThirdFeign; import com.xxfc.platform.universal.feign.ThirdFeign;
...@@ -183,7 +180,7 @@ public class AppUserLoginBiz extends BaseBiz<AppUserLoginMapper, AppUserLogin> { ...@@ -183,7 +180,7 @@ public class AppUserLoginBiz extends BaseBiz<AppUserLoginMapper, AppUserLogin> {
public AppUserLogin checkeUserLogin(String username) { public AppUserLogin checkeUserLogin(String username) {
Example example = new Example(AppUserLogin.class); Example example = new Example(AppUserLogin.class);
example.createCriteria().andEqualTo("username", username).andEqualTo("isdel", 0).andEqualTo("status", 0); example.createCriteria().andEqualTo("username", username).andEqualTo("isdel", 0);
List<AppUserLogin> userLoginList = mapper.selectByExample(example); List<AppUserLogin> userLoginList = mapper.selectByExample(example);
if (userLoginList != null && userLoginList.size() != 0) { if (userLoginList != null && userLoginList.size() != 0) {
return userLoginList.get(0); return userLoginList.get(0);
......
package com.github.wxiaoqi.security.admin.biz; package com.github.wxiaoqi.security.admin.biz;
import com.github.wxiaoqi.security.admin.bo.UserIncomeBo; import com.github.wxiaoqi.security.admin.bo.UserIncomeBo;
import com.github.wxiaoqi.security.admin.bo.UserStaffBo;
import com.github.wxiaoqi.security.admin.dto.*; import com.github.wxiaoqi.security.admin.dto.*;
import com.github.wxiaoqi.security.admin.entity.*; import com.github.wxiaoqi.security.admin.entity.*;
import com.github.wxiaoqi.security.admin.entity.AppUserRelation; import com.github.wxiaoqi.security.admin.mapper.AppUserSellingWaterMapper;
import com.github.wxiaoqi.security.admin.vo.SellingWalletVo;
import com.github.wxiaoqi.security.admin.vo.SellingWalletPagVo; import com.github.wxiaoqi.security.admin.vo.SellingWalletPagVo;
import com.github.wxiaoqi.security.admin.vo.SellingWalletVo;
import com.github.wxiaoqi.security.common.biz.BaseBiz;
import com.github.wxiaoqi.security.common.vo.PageDataVO; import com.github.wxiaoqi.security.common.vo.PageDataVO;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.github.wxiaoqi.security.admin.mapper.AppUserSellingWaterMapper;
import com.github.wxiaoqi.security.common.biz.BaseBiz;
import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import tk.mybatis.mapper.entity.Example; import tk.mybatis.mapper.entity.Example;
...@@ -352,7 +350,7 @@ public class AppUserSellingWaterBiz extends BaseBiz<AppUserSellingWaterMapper, A ...@@ -352,7 +350,7 @@ public class AppUserSellingWaterBiz extends BaseBiz<AppUserSellingWaterMapper, A
sellingWaterVo = new SellingWalletVo(); sellingWaterVo = new SellingWalletVo();
BeanUtils.copyProperties(appUserSellingWater, sellingWaterVo); BeanUtils.copyProperties(appUserSellingWater, sellingWaterVo);
sellingWaterVo.setUsername(userIdAndAppUserLoginMap.get(appUserSellingWater.getSourceId()).getUsername()); sellingWaterVo.setUsername(userIdAndAppUserLoginMap.get(appUserSellingWater.getSourceId())==null?"":userIdAndAppUserLoginMap.get(appUserSellingWater.getSourceId()).getUsername());
if (userIdAndAppUserDetailMap != null) { if (userIdAndAppUserDetailMap != null) {
AppUserDetail appUserDetail = userIdAndAppUserDetailMap.get(appUserSellingWater.getSourceId()); AppUserDetail appUserDetail = userIdAndAppUserDetailMap.get(appUserSellingWater.getSourceId());
sellingWaterVo.setNickName(appUserDetail == null ? "" : appUserDetail.getNickname()); sellingWaterVo.setNickName(appUserDetail == null ? "" : appUserDetail.getNickname());
......
...@@ -21,6 +21,7 @@ import com.github.wxiaoqi.security.common.util.OrderUtil; ...@@ -21,6 +21,7 @@ import com.github.wxiaoqi.security.common.util.OrderUtil;
import com.github.wxiaoqi.security.common.util.process.ResultCode; import com.github.wxiaoqi.security.common.util.process.ResultCode;
import com.github.wxiaoqi.security.common.vo.PageDataVO; import com.github.wxiaoqi.security.common.vo.PageDataVO;
import com.xxfc.platform.app.entity.vo.WithDrawRuleVo; import com.xxfc.platform.app.entity.vo.WithDrawRuleVo;
import com.xxfc.platform.app.enumconstant.WithDrawWayEnum;
import com.xxfc.platform.app.feign.ConfigFeign; import com.xxfc.platform.app.feign.ConfigFeign;
import com.xxfc.platform.universal.feign.ThirdFeign; import com.xxfc.platform.universal.feign.ThirdFeign;
import com.xxfc.platform.universal.vo.FundPayVo; import com.xxfc.platform.universal.vo.FundPayVo;
...@@ -100,9 +101,6 @@ public class MyWalletBiz extends BaseBiz<MyWalletMapper, MyWallet> implements In ...@@ -100,9 +101,6 @@ public class MyWalletBiz extends BaseBiz<MyWalletMapper, MyWallet> implements In
private DateTimeFormatter dateTimeFormatter; private DateTimeFormatter dateTimeFormatter;
private static final Integer WITHDRAW_ONLINE_WAY = 1;
private static final Integer WITHDRAW_OFFLINE_WAY = 2;
private BCryptPasswordEncoder encoder = new BCryptPasswordEncoder(12); private BCryptPasswordEncoder encoder = new BCryptPasswordEncoder(12);
...@@ -347,8 +345,10 @@ public class MyWalletBiz extends BaseBiz<MyWalletMapper, MyWallet> implements In ...@@ -347,8 +345,10 @@ public class MyWalletBiz extends BaseBiz<MyWalletMapper, MyWallet> implements In
walletCath.setAccountName(applyCathVo.getAccountName()); walletCath.setAccountName(applyCathVo.getAccountName());
walletCath.setAccountNumber(accountNumber); walletCath.setAccountNumber(accountNumber);
walletCath.setAmount(amount); walletCath.setAmount(amount);
//手续费
walletCath.setCommission(commission); walletCath.setCommission(commission);
walletCath.setRealAmount(realAmount); walletCath.setRealAmount(realAmount);
walletCath.setWithdrawWay(withdrawWay);
myWalletCathBiz.insertSelective(walletCath); myWalletCathBiz.insertSelective(walletCath);
//提现金额 //提现金额
BigDecimal withdrawals = realAmount.add(commission); BigDecimal withdrawals = realAmount.add(commission);
...@@ -362,7 +362,7 @@ public class MyWalletBiz extends BaseBiz<MyWalletMapper, MyWallet> implements In ...@@ -362,7 +362,7 @@ public class MyWalletBiz extends BaseBiz<MyWalletMapper, MyWallet> implements In
myWallet.setVersion(sumDto.getVersion()); myWallet.setVersion(sumDto.getVersion());
mapper.updMyWater(myWallet); mapper.updMyWater(myWallet);
//线上自动提现 //线上自动提现
if (WITHDRAW_ONLINE_WAY.equals(withdrawWay)) { if (WithDrawWayEnum.WITHDRAW_ONLINE_WAY.getCode() == withdrawWay) {
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String host = StringUtils.defaultIfBlank(request.getHeader("userHost"), ClientUtil.getClientIp(request)); String host = StringUtils.defaultIfBlank(request.getHeader("userHost"), ClientUtil.getClientIp(request));
FundPayVo fundPayVo = FundPayVo.builder() FundPayVo fundPayVo = FundPayVo.builder()
......
...@@ -101,12 +101,7 @@ public class MyWalletCathBiz extends BaseBiz<MyWalletCathMapper, MyWalletCath> { ...@@ -101,12 +101,7 @@ public class MyWalletCathBiz extends BaseBiz<MyWalletCathMapper, MyWalletCath> {
PageDataVO<WalletCathListDTO> walletCathListDTOPage = PageDataVO.pageInfo(walletCathFindDTO.getPage(), PageDataVO<WalletCathListDTO> walletCathListDTOPage = PageDataVO.pageInfo(walletCathFindDTO.getPage(),
walletCathFindDTO.getLimit(), walletCathFindDTO.getLimit(),
() -> mapper.selectByUserNameOrPhoneOrWithDrawSate(walletCathFindDTO.getUsername(), () -> mapper.selectWalletCatchAll(walletCathFindDTO));
walletCathFindDTO.getPhone(),
walletCathFindDTO.getState(),
walletCathFindDTO.getOrderNo(),
walletCathFindDTO.getStartTime(),
walletCathFindDTO.getEndTime()));
List<WalletCathListDTO> walletCathListDTOList = walletCathListDTOPage.getData(); List<WalletCathListDTO> walletCathListDTOList = walletCathListDTOPage.getData();
if (CollectionUtils.isEmpty(walletCathListDTOList)) { if (CollectionUtils.isEmpty(walletCathListDTOList)) {
......
...@@ -50,6 +50,11 @@ public class MyWalletDetailBiz extends BaseBiz<MyWalletDetailMapper, MyWalletDet ...@@ -50,6 +50,11 @@ public class MyWalletDetailBiz extends BaseBiz<MyWalletDetailMapper, MyWalletDet
PageDataVO<MyWalletDetail> walletDetailPageVoPageDataVO = PageDataVO.pageInfo(pageNo, pageSize, () -> mapper.selectByExample(example)); PageDataVO<MyWalletDetail> walletDetailPageVoPageDataVO = PageDataVO.pageInfo(pageNo, pageSize, () -> mapper.selectByExample(example));
List<MyWalletDetail> walletDetails = walletDetailPageVoPageDataVO.getData(); List<MyWalletDetail> walletDetails = walletDetailPageVoPageDataVO.getData();
if (CollectionUtils.isEmpty(walletDetails)){ if (CollectionUtils.isEmpty(walletDetails)){
walletDetailPageVo.setPageNum(pageNo);
walletDetailPageVo.setPageSize(pageSize);
walletDetailPageVo.setData(Collections.EMPTY_LIST);
walletDetailPageVo.setTotalPage(0);
walletDetailPageVo.setTotalCount(0L);
return walletDetailPageVo; return walletDetailPageVo;
} }
List<WalletDetailPageVo> walletDetailPageVoList = new ArrayList<>(); List<WalletDetailPageVo> walletDetailPageVoList = new ArrayList<>();
......
...@@ -41,4 +41,5 @@ public interface AppUserDetailMapper extends Mapper<AppUserDetail> { ...@@ -41,4 +41,5 @@ public interface AppUserDetailMapper extends Mapper<AppUserDetail> {
List<AppUserDetail> selectAllWithNoProviinceCode(); List<AppUserDetail> selectAllWithNoProviinceCode();
List<UserBo> selectUserByUserIds(@Param("userIds") List<Integer> userIds);
} }
\ No newline at end of file
package com.github.wxiaoqi.security.admin.mapper; package com.github.wxiaoqi.security.admin.mapper;
import com.github.wxiaoqi.security.admin.dto.PersonalConsumptionDTO; import com.github.wxiaoqi.security.admin.dto.PersonalConsumptionDTO;
import com.github.wxiaoqi.security.admin.dto.WalletCathFindDTO;
import com.github.wxiaoqi.security.admin.dto.WalletCathListDTO; import com.github.wxiaoqi.security.admin.dto.WalletCathListDTO;
import com.github.wxiaoqi.security.admin.dto.WalletCathSumDto; import com.github.wxiaoqi.security.admin.dto.WalletCathSumDto;
import com.github.wxiaoqi.security.admin.entity.MyWalletCath; import com.github.wxiaoqi.security.admin.entity.MyWalletCath;
...@@ -17,12 +18,7 @@ import java.util.List; ...@@ -17,12 +18,7 @@ import java.util.List;
*/ */
public interface MyWalletCathMapper extends Mapper<MyWalletCath> { public interface MyWalletCathMapper extends Mapper<MyWalletCath> {
List<WalletCathListDTO> selectByUserNameOrPhoneOrWithDrawSate(@Param("userName") String userName, List<WalletCathListDTO> selectWalletCatchAll(WalletCathFindDTO walletCathFindDTO);
@Param("phone") String phone,
@Param("state") Integer state,
@Param("orderNo") String orderNo,
@Param("startTime") Long startTime,
@Param("endTime") Long endTime);
List<PersonalConsumptionDTO> findUserWithDrawingByUserIds(@Param("userIds") List<Integer> userIds); List<PersonalConsumptionDTO> findUserWithDrawingByUserIds(@Param("userIds") List<Integer> userIds);
......
...@@ -25,7 +25,6 @@ import io.swagger.annotations.ApiOperation; ...@@ -25,7 +25,6 @@ import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.beanutils.BeanUtils; import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -378,4 +377,9 @@ public class AppUserController extends CommonBaseController{ ...@@ -378,4 +377,9 @@ public class AppUserController extends CommonBaseController{
AppUserVo appUserVo = userDetailBiz.findByCode(code); AppUserVo appUserVo = userDetailBiz.findByCode(code);
return ObjectRestResponse.succ(appUserVo); return ObjectRestResponse.succ(appUserVo);
} }
@GetMapping("/list_user_info")
public List<UserBo> findUserDetailByUserIds(@RequestParam(value = "userIds",required = false) List<Integer> userIds){
return userDetailBiz.findUserDetailByUserIds(userIds);
}
} }
...@@ -343,4 +343,16 @@ from `app_user_detail` as `aud` left join `app_user_login` as `aul` on aul.id= ...@@ -343,4 +343,16 @@ from `app_user_detail` as `aud` left join `app_user_login` as `aul` on aul.id=
resultType="com.github.wxiaoqi.security.admin.entity.AppUserDetail"> resultType="com.github.wxiaoqi.security.admin.entity.AppUserDetail">
select `id`,`crt_host` from `app_user_detail` where crt_host is not null and ( province_code = 0 or province_code is null) select `id`,`crt_host` from `app_user_detail` where crt_host is not null and ( province_code = 0 or province_code is null)
</select> </select>
<select id="selectUserByUserIds" resultType="com.github.wxiaoqi.security.admin.bo.UserBo">
select aud.userid as `userId`,case when length(aud.realname)>0 then aud.realname else aud.nickname end as `name`,aul.username as `phone` from `app_user_detail` as aud left join `app_user_login` as aul on aul.id=aud.userid
<where>
<if test="userIds != null and userIds.size() != 0">
userid in
<foreach collection="userIds" item="userId" open="(" close=")" separator=",">
#{userId}
</foreach>
</if>
</where>
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<mapper namespace="com.github.wxiaoqi.security.admin.mapper.MyWalletCathMapper"> <mapper namespace="com.github.wxiaoqi.security.admin.mapper.MyWalletCathMapper">
<select id="selectByUserNameOrPhoneOrWithDrawSate" <select id="selectWalletCatchAll"
resultType="com.github.wxiaoqi.security.admin.dto.WalletCathListDTO"> resultType="com.github.wxiaoqi.security.admin.dto.WalletCathListDTO">
SELECT SELECT
wc.id, wc.id,
...@@ -19,12 +19,16 @@ ...@@ -19,12 +19,16 @@
wc.order_no AS `orderNo`, wc.order_no AS `orderNo`,
wc.account_number AS `accountNumber`, wc.account_number AS `accountNumber`,
wc.account_name AS `accountName`, wc.account_name AS `accountName`,
wc.offline_way AS `offlineWay` wc.withdraw_way AS `withdrawWay`
FROM FROM
(SELECT * FROM `my_wallet_cath` WHERE 1 = 1 (SELECT * FROM `my_wallet_cath`
<where>
<if test="state != null"> <if test="state != null">
AND `stauts`=#{state} AND `stauts`=#{state}
</if> </if>
<if test="withdrawWay != null">
AND `withdraw_way`=#{withdrawWay}
</if>
<if test="orderNo !=null and orderNo !=''"> <if test="orderNo !=null and orderNo !=''">
AND `order_no` = #{orderNo} AND `order_no` = #{orderNo}
</if> </if>
...@@ -41,13 +45,14 @@ ...@@ -41,13 +45,14 @@
`crt_time` <= #{endTime} `crt_time` <= #{endTime}
]]> ]]>
</if> </if>
</where>
) AS `wc` ) AS `wc`
INNER JOIN ( SELECT `id`, `username` FROM `app_user_login` <if test="phone != null and phone != ''"> INNER JOIN ( SELECT `id`, `username` FROM `app_user_login` <if test="phone != null and phone != ''">
WHERE `username`=#{phone} WHERE `username`=#{phone}
</if> ) AS `aul` ON aul.id = wc.user_id </if> ) AS `aul` ON aul.id = wc.user_id
INNER JOIN ( SELECT `userid`, `nickname`, `realname` FROM `app_user_detail` <if INNER JOIN ( SELECT `userid`, `nickname`, `realname` FROM `app_user_detail` <if
test="userName != null and userName != ''"> test="username != null and username != ''">
WHERE nickname =#{userName} OR realname =#{userName} WHERE nickname =#{username} OR realname =#{username}
</if> ) AS `aud` ON aud.userid = aul.id order by wc.crt_time DESC </if> ) AS `aud` ON aud.userid = aul.id order by wc.crt_time DESC
</select> </select>
......
...@@ -16,11 +16,11 @@ ...@@ -16,11 +16,11 @@
wd.crt_time AS `crtTime`, wd.crt_time AS `crtTime`,
aul.username AS `phone`, aul.username AS `phone`,
aud.nickname, aud.nickname,
aud.realname<!--, aud.realname,
ausw.price, ausw.price,
ausw.extract, ausw.extract,
ausw.waiting, ausw.waiting,
ausw.title--> ausw.title
FROM FROM
(select id,user_id,source,amount,`with_draw_order_no`,cono,itype,activity_id,activity_name,`crt_time` FROM (select id,user_id,source,amount,`with_draw_order_no`,cono,itype,activity_id,activity_name,`crt_time` FROM
`my_wallet_detail` WHERE 1=1 `my_wallet_detail` WHERE 1=1
...@@ -48,8 +48,8 @@ ...@@ -48,8 +48,8 @@
test="userName != null and userName != ''"> test="userName != null and userName != ''">
WHERE `nickname`=#{userName} OR `realname`=#{userName} WHERE `nickname`=#{userName} OR `realname`=#{userName}
</if>) AS `aud` ON aud.userid = aul.id </if>) AS `aud` ON aud.userid = aul.id
<!-- LEFT JOIN (SELECT DISTINCT order_id,id,price,extract,waiting,title FROM `app_user_selling_water`) AS `ausw` ON LEFT JOIN (SELECT DISTINCT order_id,id,price,extract,waiting,title FROM `app_user_selling_water`) AS `ausw` ON
ausw.order_id = wd.cono--> ausw.order_id = wd.cono
ORDER BY `crtTime` DESC ORDER BY `crtTime` DESC
</select> </select>
......
...@@ -44,7 +44,7 @@ public class WithDrawRuleVo { ...@@ -44,7 +44,7 @@ public class WithDrawRuleVo {
private Integer maxNumberOfDay; private Integer maxNumberOfDay;
/** /**
* 1. 线上 2.线下 * 1.线下:自动 2.线下:手动 3. 线上
*/ */
private Integer withdrawWay; private Integer withdrawWay;
......
package com.xxfc.platform.app.enumconstant;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* @author libin
* @version 1.0
* @description 提现方式
* @data 2020/1/7 8:44
*/
@AllArgsConstructor
@Getter
public enum WithDrawWayEnum {
WITHDRAW_ONLINE_WAY(3, "线上"),
WITHDRAW_OFFLINE_AUTO_WAY(2, "线下手动"),
WITHDRAW_OFFLINE_WAY(1, "线下自动");
private int code;
private String desc;
}
...@@ -97,10 +97,22 @@ ...@@ -97,10 +97,22 @@
<dependency> <dependency>
<groupId>org.springframework.cloud</groupId> <groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId> <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
<exclusions>
<exclusion>
<artifactId>commons-io</artifactId>
<groupId>commons-io</groupId>
</exclusion>
</exclusions>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.cloud</groupId> <groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId> <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
<exclusions>
<exclusion>
<artifactId>commons-io</artifactId>
<groupId>commons-io</groupId>
</exclusion>
</exclusions>
</dependency> </dependency>
<dependency> <dependency>
<groupId>commons-beanutils</groupId> <groupId>commons-beanutils</groupId>
...@@ -142,6 +154,11 @@ ...@@ -142,6 +154,11 @@
<version>3.11.0</version> <version>3.11.0</version>
</dependency> </dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.5</version>
</dependency>
</dependencies> </dependencies>
</project> </project>
\ No newline at end of file
package com.xxfc.platform.order.contant.enumerate;
/**
* @author libin
* @version 1.0
* @description
* @data 2020/1/6 12:48
*/
public enum MemberStatisticsBehaviorTypeEnum {
FIRST_TIME_BUY(0, "首次购买"),
RENEW(1, "续费"),
ACTIVATE(2, "激活"),
PAY(3, "付费(首次购买+续费)");
private int code;
private String desc;
MemberStatisticsBehaviorTypeEnum(int code, String desc) {
this.code = code;
this.desc = desc;
}
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
}
package com.xxfc.platform.order.entity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.persistence.*;
import java.math.BigDecimal;
/**
* @author libin
* @version 1.0
* @description
* @data 2020/1/6 12:38
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Table(name = "order_member_view")
@Entity
public class MemberStatistics {
@Id
@GeneratedValue(generator = "JDBC")
private Long id;
@Column(name = "user_id")
private Integer userId;
@Column(name = "real_amount")
private BigDecimal realAmount;
@Column(name = "pay_time")
private Long payTime;
@Column(name = "order_no")
private String orderNo;
/**
* 0:首次购买 1:续费 2:激活
*/
@Column(name = "behavior_type")
private Integer behaviorType;
@Column(name = "member_level")
private Integer memberLevel;
@Column(name = "parent_id")
private Integer parentId;
/**
* 是否是第一时时间成为会员
*/
@Column(name = "is_first_time_member")
private Integer isFirstTimeMember;
}
...@@ -114,4 +114,13 @@ public class OrderInvoice { ...@@ -114,4 +114,13 @@ public class OrderInvoice {
*/ */
private String extend; private String extend;
/**
* 1、开票成功,2、开票中
*/
private Integer status;
/**
* 发票PDF路径
*/
private String invoiceUrl;
} }
\ No newline at end of file
package com.xxfc.platform.order.pojo.bo;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* @author libin
* @version 1.0
* @description
* @data 2020/1/6 11:04
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class MemberStatisticsBo implements Serializable {
private static final long serialVersionUID = 1L;
@JsonIgnore
private Integer userId;
private String name;
private String phone;
private BigDecimal realAmount;
private Long payTime;
private String orderNo;
/**
* 0:首次购买 1:续费 2:激活
*/
private Integer behaviorType;
@JsonIgnore
private Integer memberLevel;
private String memberName;
@JsonIgnore
private Integer parentId;
private String parentName;
private String parentPhone;
}
package com.xxfc.platform.order.pojo.bo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.collections4.CollectionUtils;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Collections;
import java.util.List;
/**
* @author libin
* @version 1.0
* @description
* @data 2020/1/6 11:21
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class MemberStatisticsPageBo implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 会员订单数
*/
private long memberOrdersNum;
/**
* 新增会员人数
*/
private long newMembersNum;
/**
* 激活人数
*/
private long activateMembersNum;
/**
* 会员费
*/
private BigDecimal memberAmount = BigDecimal.ZERO;
/**
* 普通会员订单数
*/
private long commonMemberOrdersNum;
/**
* 普通会员订单金额
*/
private BigDecimal commonMemberOrderAmount = BigDecimal.ZERO;
/**
* 黄金会员订单数
*/
private long goldMemberOrdersNum;
/**
* 黄金会员订单金额
*/
private BigDecimal goldMemberOrderAmount = BigDecimal.ZERO;
/**
* 钻石会员订单数
*/
private long diamondMemberOrdersNum;
/**
* 钻石会员订单金额
*/
private BigDecimal diamondMemberOrderAmount = BigDecimal.ZERO;
/**
* 会员统计
*/
private List<MemberStatisticsBo> memberStatistics;
private Long totalCount;
private Integer totalPage;
private Integer pageNum;
private Integer pageSize;
public List<MemberStatisticsBo> getMemberStatistics() {
return CollectionUtils.isEmpty(memberStatistics)? Collections.EMPTY_LIST:memberStatistics;
}
}
package com.xxfc.platform.order.pojo.dto;
import com.github.wxiaoqi.security.common.vo.PageParam;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author libin
* @version 1.0
* @description
* @data 2020/1/6 12:31
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class MemberStatisticsFindDTO extends PageParam {
private Long startTime;
private Long endTime;
private Integer behaviorType;
private Boolean isExport;
}
package com.xxfc.platform.order.biz; package com.xxfc.platform.order.biz;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.github.wxiaoqi.security.admin.feign.UserFeign; import com.github.wxiaoqi.security.admin.feign.UserFeign;
import com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO; import com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO;
import com.github.wxiaoqi.security.common.biz.BaseBiz; import com.github.wxiaoqi.security.common.biz.BaseBiz;
...@@ -144,4 +146,22 @@ public class OrderInvoiceBiz extends BaseBiz<OrderInvoiceMapper, OrderInvoice> { ...@@ -144,4 +146,22 @@ public class OrderInvoiceBiz extends BaseBiz<OrderInvoiceMapper, OrderInvoice> {
return ObjectRestResponse.succ(pageDataVO); return ObjectRestResponse.succ(pageDataVO);
} }
public ObjectRestResponse update(OrderInvoice orderInvoice) {
AppUserDTO appUserDTO = userFeign.userDetailByToken(request.getHeader("Authorization")).getData();
if (appUserDTO == null) {
return ObjectRestResponse.createFailedResult(ResultCode.RSTOKEN_EXPIRED_CODE, ResultCode.getMsg(ResultCode.RSTOKEN_EXPIRED_CODE));
}
if (orderInvoice == null || orderInvoice.getId() == null) {
return ObjectRestResponse.paramIsEmpty();
}
OrderInvoice oldValue = mapper.selectByPrimaryKey(orderInvoice.getId());
if (oldValue != null) {
BeanUtil.copyProperties(orderInvoice, oldValue, CopyOptions.create().setIgnoreNullValue(true).setIgnoreError(true));
updateSelectiveByIdRe(oldValue);
return ObjectRestResponse.succ();
}
return ObjectRestResponse.createFailedResult(ResultCode.FAILED_CODE, "发票不存在!");
}
} }
package com.xxfc.platform.order.mapper;
import com.xxfc.platform.order.entity.MemberStatistics;
import tk.mybatis.mapper.common.Mapper;
/**
* @author libin
* @version 1.0
* @description
* @data 2020/1/6 12:36
*/
public interface MemberStatisticsMapper extends Mapper<MemberStatistics> {
}
...@@ -382,9 +382,9 @@ public class BackStageOrderController extends CommonBaseController implements Us ...@@ -382,9 +382,9 @@ public class BackStageOrderController extends CommonBaseController implements Us
return ObjectRestResponse.paramIsEmpty(); return ObjectRestResponse.paramIsEmpty();
} }
if(flag != null && flag == true) { if(flag != null && flag == true) {
return baseOrderBiz.getOrderDetail(orderNo, userDTO);
} else {
return baseOrderBiz.orderDetail(orderNo, userDTO); return baseOrderBiz.orderDetail(orderNo, userDTO);
} else {
return baseOrderBiz.getOrderDetail(orderNo, userDTO);
} }
} }
......
...@@ -42,4 +42,9 @@ public class OrderInvoiceController extends BaseController<OrderInvoiceBiz, Orde ...@@ -42,4 +42,9 @@ public class OrderInvoiceController extends BaseController<OrderInvoiceBiz, Orde
return baseBiz.getByParam(orderInvoiceDto); return baseBiz.getByParam(orderInvoiceDto);
} }
@PostMapping(value = "/update")
public ObjectRestResponse update(@RequestBody OrderInvoice orderInvoice) {
return baseBiz.update(orderInvoice);
}
} }
package com.xxfc.platform.order.rest; package com.xxfc.platform.order.rest;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.github.wxiaoqi.security.admin.feign.UserFeign; import com.github.wxiaoqi.security.admin.feign.UserFeign;
import com.github.wxiaoqi.security.auth.client.annotation.IgnoreClientToken; import com.github.wxiaoqi.security.auth.client.annotation.IgnoreClientToken;
...@@ -15,13 +14,11 @@ import com.xxfc.platform.order.biz.OrderRentVehicleBiz; ...@@ -15,13 +14,11 @@ import com.xxfc.platform.order.biz.OrderRentVehicleBiz;
import com.xxfc.platform.order.biz.inner.OrderCalculateBiz; import com.xxfc.platform.order.biz.inner.OrderCalculateBiz;
import com.xxfc.platform.order.entity.BaseOrder; import com.xxfc.platform.order.entity.BaseOrder;
import com.xxfc.platform.order.entity.OrderRentVehicleDetail; import com.xxfc.platform.order.entity.OrderRentVehicleDetail;
import com.xxfc.platform.order.pojo.order.add.AddRentVehicleDTO;
import com.xxfc.platform.order.pojo.order.RentVehicleBO; import com.xxfc.platform.order.pojo.order.RentVehicleBO;
import com.xxfc.platform.order.pojo.order.add.AddRentVehicleDTO;
import com.xxfc.platform.order.pojo.order.add.BgAddRentDTO; import com.xxfc.platform.order.pojo.order.add.BgAddRentDTO;
import com.xxfc.platform.order.pojo.price.RentVehiclePriceVO; import com.xxfc.platform.order.pojo.price.RentVehiclePriceVO;
import com.xxfc.platform.order.service.OrderRentVehicleService; import com.xxfc.platform.order.service.OrderRentVehicleService;
import com.xxfc.platform.universal.constant.DictionaryKey;
import com.xxfc.platform.universal.entity.Dictionary;
import com.xxfc.platform.universal.feign.ThirdFeign; import com.xxfc.platform.universal.feign.ThirdFeign;
import com.xxfc.platform.vehicle.entity.BranchCompany; import com.xxfc.platform.vehicle.entity.BranchCompany;
import com.xxfc.platform.vehicle.feign.VehicleFeign; import com.xxfc.platform.vehicle.feign.VehicleFeign;
...@@ -37,14 +34,10 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -37,14 +34,10 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import static com.xxfc.platform.universal.constant.DictionaryKey.APP_ORDER;
@Controller @Controller
@RequestMapping("orderRentVehicle") @RequestMapping("orderRentVehicle")
@Api(value="租车订单",tags={"租车订单"}) @Api(value="租车订单",tags={"租车订单"})
...@@ -81,6 +74,7 @@ public class OrderRentVehicleController extends CommonBaseController { ...@@ -81,6 +74,7 @@ public class OrderRentVehicleController extends CommonBaseController {
bo.setAppUserDTO(userFeign.userDetailByToken(BaseContextHandler.getToken()).getData()); bo.setAppUserDTO(userFeign.userDetailByToken(BaseContextHandler.getToken()).getData());
orderRentVehicleService.createOrder(bo); orderRentVehicleService.createOrder(bo);
return ObjectRestResponse.succ(bo.getOrder()); return ObjectRestResponse.succ(bo.getOrder());
// return ObjectRestResponse.createFailedResult(ResultCode.FAILED_CODE, "系统维护,请联系客服线下租车: 4000-369-369!");
} }
@RequestMapping(value = "back-stage/add",method = RequestMethod.POST) @RequestMapping(value = "back-stage/add",method = RequestMethod.POST)
......
package com.xxfc.platform.order.rest.background;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.xxfc.platform.order.biz.MemberStatisticsBiz;
import com.xxfc.platform.order.pojo.bo.MemberStatisticsPageBo;
import com.xxfc.platform.order.pojo.dto.MemberStatisticsFindDTO;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
/**
* @author libin
* @version 1.0
* @description
* @data 2020/1/6 12:34
*/
@Controller
@RequestMapping("/admin/member/statistics")
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class MemberStatisticsAdminController {
private final MemberStatisticsBiz memberStatisticsBiz;
@PostMapping("/page")
@ResponseBody
public ObjectRestResponse<MemberStatisticsPageBo> findMemberStatisticsWithPage(@RequestBody MemberStatisticsFindDTO memberStatisticsFindDTO){
MemberStatisticsPageBo memberStatisticsPageBo = memberStatisticsBiz.findMemberStatisticsWithPage(memberStatisticsFindDTO);
return ObjectRestResponse.succ(memberStatisticsPageBo);
}
}
...@@ -20,7 +20,10 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -20,7 +20,10 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled; import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
@Service @Service
@Slf4j @Slf4j
...@@ -95,8 +98,8 @@ public class BranchCompanyVehicleCountBiz extends BaseBiz<BranchCompanyVehicleCo ...@@ -95,8 +98,8 @@ public class BranchCompanyVehicleCountBiz extends BaseBiz<BranchCompanyVehicleCo
branchCompanyVehicleCountDTO.setPage(page); branchCompanyVehicleCountDTO.setPage(page);
branchCompanyVehicleCountDTO.setLimit(limit); branchCompanyVehicleCountDTO.setLimit(limit);
if (StringUtils.isBlank(branchCompanyVehicleCountDTO.getStartTime()) || StringUtils.isBlank(branchCompanyVehicleCountDTO.getEndTime())) { if (StringUtils.isBlank(branchCompanyVehicleCountDTO.getStartTime()) || StringUtils.isBlank(branchCompanyVehicleCountDTO.getEndTime())) {
branchCompanyVehicleCountDTO.setStartTime(DateTime.now().minusDays(1).toString(DATE_TIME_FORMATTER)); branchCompanyVehicleCountDTO.setStartTime(DateTime.now().toString(DATE_TIME_FORMATTER));
branchCompanyVehicleCountDTO.setEndTime(DateTime.now().minusDays(1).toString(DATE_TIME_FORMATTER)); branchCompanyVehicleCountDTO.setEndTime(DateTime.now().toString(DATE_TIME_FORMATTER));
} }
Query query = new Query(branchCompanyVehicleCountDTO); Query query = new Query(branchCompanyVehicleCountDTO);
if (type == 1) {//按天 if (type == 1) {//按天
...@@ -120,4 +123,32 @@ public class BranchCompanyVehicleCountBiz extends BaseBiz<BranchCompanyVehicleCo ...@@ -120,4 +123,32 @@ public class BranchCompanyVehicleCountBiz extends BaseBiz<BranchCompanyVehicleCo
return ObjectRestResponse.succ(new PageDataVO<>()); return ObjectRestResponse.succ(new PageDataVO<>());
} }
public List<BranchCompanyVehicleCountVo> exportAllDate(BranchCompanyVehicleCountDTO branchCompanyVehicleCountDTO) {
Integer type = branchCompanyVehicleCountDTO.getType() == null ? 1 : branchCompanyVehicleCountDTO.getType();
Map<String, Object> param = new HashMap<>();
if (branchCompanyVehicleCountDTO.getCompanyId() != null) {
param.put("companyId", branchCompanyVehicleCountDTO.getCompanyId());
}
if (type == 1) {//按天
return mapper.getAllCountInfo(param);
}
if (type == 2) {//按周
List<BranchCompanyVehicleCountVo> pageDataVO = mapper.countByWeek(param);
if (pageDataVO != null && pageDataVO.size() > 0) {
pageDataVO.parallelStream().forEach(result -> {
String weekStartDate = OrderDateUtils.getStartDayOfWeekNo(result.getCountYear(), result.getCountWeek());
String weekEndDate = OrderDateUtils.getEndDayOfWeekNo(result.getCountYear(), result.getCountWeek());
result.setWeekStartDate(weekStartDate);
result.setWeekEndDate(weekEndDate);
});
}
return pageDataVO;
}
if (type == 3) {//按月
return mapper.countByMonth(param);
}
return new ArrayList<>();
}
} }
...@@ -123,7 +123,8 @@ public class VehicleCountRecordBiz extends BaseBiz<VehicleCountRecordMapper, Veh ...@@ -123,7 +123,8 @@ public class VehicleCountRecordBiz extends BaseBiz<VehicleCountRecordMapper, Veh
DateTime startDay = DateTime.parse(startDate, DEFAULT_DATE_TIME_FORMATTER); DateTime startDay = DateTime.parse(startDate, DEFAULT_DATE_TIME_FORMATTER);
DateTime endDay = DateTime.parse(endDate, DEFAULT_DATE_TIME_FORMATTER); DateTime endDay = DateTime.parse(endDate, DEFAULT_DATE_TIME_FORMATTER);
int i = 0; int i = 0;
for (DateTime curDate = startDay; i < 30; curDate = curDate.minusDays(1)) { int monthDay = endDay.getDayOfMonth() - startDay.getDayOfMonth() + 1;
for (DateTime curDate = startDay; i < monthDay; curDate = curDate.minusDays(1)) {
i++; i++;
nowTime = curDate.getMillis(); nowTime = curDate.getMillis();
lastTime = nowTime + 24 * 3600 * 1000 - 1; lastTime = nowTime + 24 * 3600 * 1000 - 1;
......
...@@ -4,7 +4,6 @@ import cn.hutool.core.io.IoUtil; ...@@ -4,7 +4,6 @@ import cn.hutool.core.io.IoUtil;
import cn.hutool.poi.excel.ExcelUtil; import cn.hutool.poi.excel.ExcelUtil;
import cn.hutool.poi.excel.ExcelWriter; import cn.hutool.poi.excel.ExcelWriter;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse; import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.vo.PageDataVO;
import com.xxfc.platform.vehicle.biz.BranchCompanyVehicleCountBiz; import com.xxfc.platform.vehicle.biz.BranchCompanyVehicleCountBiz;
import com.xxfc.platform.vehicle.common.BaseController; import com.xxfc.platform.vehicle.common.BaseController;
import com.xxfc.platform.vehicle.pojo.BranchCompanyVehicleCountVo; import com.xxfc.platform.vehicle.pojo.BranchCompanyVehicleCountVo;
...@@ -17,6 +16,7 @@ import org.springframework.web.bind.annotation.ResponseBody; ...@@ -17,6 +16,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.ServletOutputStream; import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.util.List;
@Controller @Controller
@RequestMapping(value = "/bg-vehicle/count") @RequestMapping(value = "/bg-vehicle/count")
...@@ -33,8 +33,8 @@ public class BranchCompanyVehicleCountController extends BaseController<BranchCo ...@@ -33,8 +33,8 @@ public class BranchCompanyVehicleCountController extends BaseController<BranchCo
} }
@GetMapping("/app/unauth/export") @GetMapping("/app/unauth/export")
public void exportVehicleInfo(BranchCompanyVehicleCountDTO branchCompanyVehicleCountDTO) throws Exception { public void exportVehicleInfo(BranchCompanyVehicleCountDTO branchCompanyVehicleCountDTO) throws Exception {
PageDataVO<BranchCompanyVehicleCountVo> pageDataVO = baseBiz.getAllCountInfo(branchCompanyVehicleCountDTO).getData(); List<BranchCompanyVehicleCountVo> pageDataVO = baseBiz.exportAllDate(branchCompanyVehicleCountDTO);
if (pageDataVO != null && pageDataVO.getData() != null) { if (pageDataVO != null && pageDataVO.size() > 0) {
ExcelWriter writer = ExcelUtil.getWriter(true); ExcelWriter writer = ExcelUtil.getWriter(true);
writer.addHeaderAlias("companyId", "公司ID"); writer.addHeaderAlias("companyId", "公司ID");
writer.addHeaderAlias("companyName", "公司名"); writer.addHeaderAlias("companyName", "公司名");
...@@ -50,7 +50,7 @@ public class BranchCompanyVehicleCountController extends BaseController<BranchCo ...@@ -50,7 +50,7 @@ public class BranchCompanyVehicleCountController extends BaseController<BranchCo
writer.setColumnWidth(6, 17); writer.setColumnWidth(6, 17);
writer.setColumnWidth(1, 17); writer.setColumnWidth(1, 17);
// 一次性写出内容,使用默认样式,强制输出标题 // 一次性写出内容,使用默认样式,强制输出标题
writer.write(pageDataVO.getData(), true); writer.write(pageDataVO, true);
//response为HttpServletResponse对象 //response为HttpServletResponse对象
response.setContentType("application/vnd.ms-excel;charset=utf-8"); response.setContentType("application/vnd.ms-excel;charset=utf-8");
//test.xls是弹出下载对话框的文件名,不能为中文,中文请自行编码 //test.xls是弹出下载对话框的文件名,不能为中文,中文请自行编码
......
...@@ -606,6 +606,7 @@ ...@@ -606,6 +606,7 @@
FROM FROM
vehicle v vehicle v
LEFT JOIN branch_company b ON b.id = v.park_branch_company_id LEFT JOIN branch_company b ON b.id = v.park_branch_company_id
where v.is_del = 0
GROUP BY GROUP BY
b.id b.id
</select> </select>
......
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