| @@ -13,6 +13,8 @@ import com.iformall.domain.po.WxFinanceReceive; | |||
| import com.iformall.domain.po.base.BaseEntity; | |||
| import com.iformall.domain.po.base.WxBillBaseEntity; | |||
| import com.iformall.enums.EnumBillAllType; | |||
| import com.iformall.enums.EnumFinanceReceiveStatus; | |||
| import com.iformall.enums.EnumFinanceReceiveType; | |||
| import com.iformall.enums.EnumYesOrNo; | |||
| import com.iformall.service.WxEnergyService; | |||
| import com.iformall.service.WxFinanceService; | |||
| @@ -241,17 +243,35 @@ public class WxFinanceController extends BaseController { | |||
| return new ResultData(wxFinanceService.getBills(record, list)); | |||
| } | |||
| // @ApiOperation("收款记录列表") | |||
| // @GetMapping("receiveList") | |||
| // @ApiImplicitParams({ | |||
| // @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||
| // @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true), | |||
| // }) | |||
| // public ResultData receiveList(@ModelAttribute WxFinanceReceive record, Integer pageNum, Integer pageSize) { | |||
| // record.updateTenantInfo(getTenantInfo()); | |||
| // record.setSortColumns(BaseEntity.SortField.CreateTime_DESC); | |||
| // PageInfo<WxFinanceAdvanceType> page = wxFinanceService.receiveListAsPage(record, pageNum, pageSize); | |||
| // return new ResultData(page); | |||
| // } | |||
| @GetMapping("receiveStatus") | |||
| public ResultData receiveStatus() { | |||
| Map<Integer,EnumFinanceReceiveStatus> tmap = new HashMap<Integer,EnumFinanceReceiveStatus>(); | |||
| for (EnumFinanceReceiveStatus t : EnumFinanceReceiveStatus.values()) { | |||
| tmap.put(t.getCode(), t); | |||
| } | |||
| return new ResultData(tmap); | |||
| } | |||
| @GetMapping("receiveTypes") | |||
| public ResultData receiveTypes() { | |||
| Map<Integer,EnumFinanceReceiveType> tmap = new HashMap<Integer,EnumFinanceReceiveType>(); | |||
| for (EnumFinanceReceiveType t : EnumFinanceReceiveType.values()) { | |||
| tmap.put(t.getCode(), t); | |||
| } | |||
| return new ResultData(tmap); | |||
| } | |||
| @ApiOperation("收款记录列表") | |||
| @GetMapping("receiveList") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true), | |||
| }) | |||
| public ResultData receiveList(@ModelAttribute WxFinanceReceive record, Integer pageNum, Integer pageSize) { | |||
| record.updateTenantInfo(getTenantInfo()); | |||
| record.setSortColumns(BaseEntity.SortField.CreateTime_DESC); | |||
| PageInfo<WxFinanceReceive> page = wxFinanceService.receiveListAsPage(record, pageNum, pageSize); | |||
| return new ResultData(page); | |||
| } | |||
| } | |||
| @@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.annotation.TableField; | |||
| import com.baomidou.mybatisplus.annotation.TableName; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.po.base.WxBillBaseEntity; | |||
| import com.iformall.enums.EnumFinanceReceiveStatus; | |||
| import com.iformall.enums.EnumFinanceReceiveType; | |||
| import lombok.Data; | |||
| import lombok.EqualsAndHashCode; | |||
| @@ -25,6 +27,10 @@ public class WxFinanceReceive extends TenantEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value="createTime",name="createTime") | |||
| private Date createTime; | |||
| @TableField(exist = false) | |||
| private Date createTimeBegin; | |||
| @TableField(exist = false) | |||
| private Date createTimeEnd; | |||
| @io.swagger.annotations.ApiModelProperty(value="updateTime",name="updateTime") | |||
| private Date updateTime; | |||
| @@ -34,9 +40,19 @@ public class WxFinanceReceive extends TenantEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value = "状态EnumFinanceReceiveStatus", name = "status") | |||
| private Integer status; | |||
| @TableField(exist = false) | |||
| private String statusName; | |||
| public String getStatusName() { | |||
| return EnumFinanceReceiveStatus.getEnum(status).getMessage(); | |||
| } | |||
| @io.swagger.annotations.ApiModelProperty(value = "类型EnumFinanceReceiveType", name = "type") | |||
| private Integer type; | |||
| @TableField(exist = false) | |||
| private String typeName; | |||
| public String getTypeName() { | |||
| return EnumFinanceReceiveType.getEnum(type).getMessage(); | |||
| } | |||
| @io.swagger.annotations.ApiModelProperty(value="createBy",name="createBy") | |||
| private Long createBy; | |||
| @@ -53,6 +69,8 @@ public class WxFinanceReceive extends TenantEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value = "merchantId", name = "merchantId") | |||
| private Long merchantId; | |||
| @TableField(exist = false) | |||
| private List<Long> merchantIdList; | |||
| @io.swagger.annotations.ApiModelProperty(value = "remark", name = "remark") | |||
| private String remark; | |||
| @@ -62,4 +80,15 @@ public class WxFinanceReceive extends TenantEntity { | |||
| @TableField(exist = false) | |||
| private List<WxBillPayWay> payWays; | |||
| @TableField(exist = false) | |||
| private String shopNumber; | |||
| @TableField(exist = false) | |||
| private String merchantName; | |||
| @TableField(exist = false) | |||
| private Long building; | |||
| @TableField(exist = false) | |||
| private Long floor; | |||
| @TableField(exist = false) | |||
| private String shopIds; | |||
| } | |||
| @@ -10,7 +10,7 @@ import java.util.List; | |||
| public interface WxFinanceReceiveBillMapper extends CommonMapper<WxFinanceReceiveBill, Long> { | |||
| List<WxFinanceReceiveBill> findList(WxFinanceReceiveBill wxBillRent); | |||
| WxFinanceReceiveBill selectById(@Param("id")Long id,@Param("tenantId")String tenantId); | |||
| } | |||
| @@ -1,6 +1,7 @@ | |||
| package com.iformall.service.impl; | |||
| import com.alibaba.fastjson.JSON; | |||
| import com.aliyun.openservices.shade.org.apache.commons.lang3.StringUtils; | |||
| import com.github.pagehelper.PageHelper; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.ErrorCode; | |||
| @@ -422,12 +423,91 @@ public class WxFinanceServiceImpl implements WxFinanceService { | |||
| return bill; | |||
| } | |||
| private void initQueryParam(WxFinanceReceive record) { | |||
| List<Long> queryMerchantIds = new ArrayList<Long>(); | |||
| if (StringUtils.isNotBlank(record.getShopNumber()) || StringUtils.isNotBlank(record.getShopIds()) | |||
| || null != record.getBuilding() || null != record.getFloor()) { | |||
| //根据店铺去找到商户 | |||
| WxShop sq = new WxShop(); | |||
| sq.updateTenantInfo(record); | |||
| sq.setShopNumber(record.getShopNumber()); | |||
| if (StringUtils.isNotBlank(record.getShopIds())) { | |||
| String[] sids = record.getShopIds().split(","); | |||
| if (null != sids) { | |||
| List<Long> shopIdList = new ArrayList<Long>(); | |||
| for (int i = 0 ; i < sids.length; i++) { | |||
| String s = sids[i]; | |||
| if (StringUtils.isNotBlank(s)) { | |||
| shopIdList.add(Long.parseLong(s)); | |||
| } | |||
| } | |||
| if (shopIdList.size() > 0 ) { | |||
| sq.setIds(shopIdList); | |||
| }else { | |||
| sq.setId(-1L); | |||
| } | |||
| } | |||
| } | |||
| sq.setBuilding(record.getBuilding()); | |||
| sq.setFloor(record.getFloor()); | |||
| List<Long> merchantIds = wxShopService.getMerchantIds(sq); | |||
| if (null == merchantIds || merchantIds.size() <= 0 ) { | |||
| record.setId(-1L); | |||
| }else { | |||
| queryMerchantIds.addAll(merchantIds); | |||
| } | |||
| } | |||
| if (StringUtils.isNotBlank(record.getMerchantName())) { | |||
| WxMerchant mq = new WxMerchant(); | |||
| mq.updateTenantInfo(record); | |||
| mq.setName(record.getMerchantName()); | |||
| List<Long> mids = wxMerchantService.findIdList(mq); | |||
| if (null == mids || mids.size() <= 0 ) { | |||
| record.setId(-1L); | |||
| }else { | |||
| if (queryMerchantIds.size() > 0 ) { | |||
| queryMerchantIds.retainAll(mids); | |||
| }else { | |||
| queryMerchantIds.addAll(mids); | |||
| } | |||
| } | |||
| } | |||
| if (queryMerchantIds.size() > 0 ) { | |||
| record.setMerchantIdList(queryMerchantIds); | |||
| } | |||
| } | |||
| @Override | |||
| public PageInfo<WxFinanceReceive> receiveListAsPage(WxFinanceReceive record, Integer pageIndex, Integer pageSize) { | |||
| initQueryParam(record); | |||
| PageInfo<WxFinanceReceive> page = PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxFinanceReceiveMapper.findList(record)); | |||
| return page; | |||
| if (null != page && null != page.getList()) { | |||
| WxMerchant mq = new WxMerchant(); | |||
| mq.updateTenantInfo(record); | |||
| Map<Long, WxMerchant> merchantMap = wxMerchantService.findMerchantMap(mq); | |||
| for (int i = 0 ; i < page.getList().size() ; i++) { | |||
| WxFinanceReceive fr = page.getList().get(i); | |||
| if (null != merchantMap && null != fr.getMerchantId()) { | |||
| WxMerchant merchant = merchantMap.get(fr.getMerchantId()); | |||
| if (null != merchant) { | |||
| fr.setMerchantName(merchant.getName()); | |||
| } | |||
| } | |||
| //查询关联的账单记录 | |||
| WxFinanceReceiveBill rb = new WxFinanceReceiveBill(); | |||
| rb.updateTenantInfo(record); | |||
| rb.setReceiveId(fr.getId()); | |||
| List<WxFinanceReceiveBill> bills = wxFinanceReceiveBillMapper.findList(rb); | |||
| if (null != bills && bills.size() > 0 ) { | |||
| } | |||
| } | |||
| } | |||
| return page; | |||
| } | |||
| @Override | |||
| public void saveOrUpdateReceive(WxFinanceReceive record, MallUserInfo user) { | |||
| @@ -36,6 +36,14 @@ | |||
| <if test=" null != status ">and `status` = #{status}</if> | |||
| <if test=" null != type ">and `type` = #{type}</if> | |||
| <if test=" null != merchantId ">and `merchantId` = #{merchant_id}</if> | |||
| <if test=" null != createTimeBegin ">and `create_time` >= #{createTimeBegin}</if> | |||
| <if test=" null != createTimeEnd ">and `create_time` <= #{createTimeEnd}</if> | |||
| <if test=" null != merchantIdList "> | |||
| and merchantId in | |||
| <foreach collection="merchantIdList" index="index" item="midItem" open="(" separator="," close=")"> | |||
| #{midItem} | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||