jyy
2021-04-13 3c46485b302f347211d32d4a872a0e4d84a32a1d
修改充值卡查询接口格式
1 files added
4 files modified
92 ■■■■ changed files
zq-erp/src/main/java/com/matrix/system/hive/dao/MoneyCardUseFlowDao.java 7 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxCommonAction.java 3 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxMoneyCardUseAction.java 18 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/MoneyCardUseFlowDto.java 34 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/mybatis/mapper/hive/MoneyCardUseFlowDao.xml 30 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/hive/dao/MoneyCardUseFlowDao.java
@@ -1,10 +1,11 @@
package com.matrix.system.hive.dao;
import java.util.List;
import com.matrix.core.pojo.PaginationVO;
import com.matrix.system.hive.bean.MoneyCardUseFlow;
import com.matrix.system.shopXcx.api.dto.MoneyCardUseFlowDto;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
@@ -25,6 +26,8 @@
    
    public List<MoneyCardUseFlow> selectInPage(@Param("record") MoneyCardUseFlow moneyCardUseFlow, @Param("pageVo") PaginationVO pageVo);
    public List<MoneyCardUseFlow> selectForWxInPage(@Param("record")MoneyCardUseFlowDto moneyCardUseFlowDto);
    public List<MoneyCardUseFlow> selectByModel(@Param("record") MoneyCardUseFlow moneyCardUseFlow);
    
    public int  selectTotalRecord(@Param("record") MoneyCardUseFlow moneyCardUseFlow);
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxCommonAction.java
@@ -313,7 +313,8 @@
                                MoneyCardUse moneyCardUse = moneyCardUseDao.selectVipCard(user.getId());
                                moneyCardUseFlow.setCarUseId(moneyCardUse.getId());
                                moneyCardUseFlow.setCardName(moneyCardUse.getCardName());
                                moneyCardUseFlow.setBalance(moneyCardUse.getGiftMoney() + moneyCardUse.getRealMoney());
                                Double balance=moneyCardUse.getGiftMoney() + moneyCardUse.getRealMoney();
                                moneyCardUseFlow.setBalance(balance==null?0:balance);
                                moneyCardUseFlowDao.update(moneyCardUseFlow);
                                moneyCardUse.setRealMoney(moneyCardUse.getRealMoney()+payMoney.doubleValue());
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxMoneyCardUseAction.java
@@ -8,7 +8,6 @@
import com.matrix.component.wechat.externalInterface.weixinUtil.WeixinServiceUtil;
import com.matrix.core.pojo.AjaxResult;
import com.matrix.core.pojo.BasePageQueryDto;
import com.matrix.core.pojo.PaginationVO;
import com.matrix.core.tools.LogUtil;
import com.matrix.core.tools.StringUtils;
import com.matrix.system.hive.bean.MoneyCardUse;
@@ -17,6 +16,7 @@
import com.matrix.system.hive.dao.MoneyCardUseFlowDao;
import com.matrix.system.hive.dao.MoneyCardUseV2Dao;
import com.matrix.system.hive.service.CodeService;
import com.matrix.system.shopXcx.api.dto.MoneyCardUseFlowDto;
import com.matrix.system.shopXcx.api.vo.WxMoneyCardUseVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@@ -135,19 +135,11 @@
    @ApiResponses({
            @ApiResponse(code = 200, message = "ok", response = MoneyCardUseFlow.class)
    })
    public AjaxResult getRechargeList(@RequestBody @Validated BasePageQueryDto pageDto) {
        if(StringUtils.isBlank(pageDto.getKeywords())){
            return AjaxResult.buildFailInstance("keywords参数是必须的");
        }
        PaginationVO pageVo = new PaginationVO();
        pageVo.setOffset((pageDto.getPageNum() - 1) * pageDto.getPageSize());
        pageVo.setLimit(pageDto.getPageSize());
    public AjaxResult getRechargeList(@RequestBody @Validated MoneyCardUseFlowDto pageDto) {
        SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
        MoneyCardUseFlow moneyCardUseFlow=new MoneyCardUseFlow();
        moneyCardUseFlow.setVipId(sysVipInfo.getId());
        moneyCardUseFlow.setCarUseId(Long.parseLong(pageDto.getKeywords()));
        List<MoneyCardUseFlow> dataList = moneyCardUseFlowDao.selectInPage(moneyCardUseFlow, pageVo);
        return AjaxResult.buildSuccessInstance(dataList, moneyCardUseFlowDao.selectTotalRecord(moneyCardUseFlow));
        pageDto.setCompanyId(sysVipInfo.getCompanyId());
        List<MoneyCardUseFlow> dataList = moneyCardUseFlowDao.selectForWxInPage(pageDto);
        return AjaxResult.buildSuccessInstance(dataList);
    }
zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/MoneyCardUseFlowDto.java
New file
@@ -0,0 +1,34 @@
package com.matrix.system.shopXcx.api.dto;
import com.matrix.core.pojo.BasePageQueryDto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
@Data
@ApiModel(value = "MoneyCardUseFlowDto", description = "储值卡流水查询参数接收类")
public class MoneyCardUseFlowDto extends BasePageQueryDto {
    @NotEmpty(message = "请选择查询时间")
    @ApiModelProperty(value = "查询月份",example = "2021-03")
    private String queryTime;
    @ApiModelProperty(value = "收支类型 不传全部,1,收入,2支出", example = "1")
    private Integer  revenueType;
    @NotNull(message = "请选择要查询的储值卡ID")
    @ApiModelProperty(value = "储值卡id", example = "1")
    private Long  carUseId;
    @ApiModelProperty(hidden = true)
    private Long  companyId;
}
zq-erp/src/main/resources/mybatis/mapper/hive/MoneyCardUseFlowDao.xml
@@ -331,6 +331,36 @@
            </if>
        </if>
    </select>
    <select id="selectForWxInPage" resultMap="MoneyCardUseFlowMap">
        select
            id,
            order_no,
            pay_no,
            content,
            create_time,
            type,
            total,
            times,
            gift_money,
            balance,
            (SELECT su_name from sys_users a WHERE operation_id=a.su_id) staffName
        from money_card_use_flow
        <where>
                and car_use_id=#{record.carUseId}
            <if test="record.queryTime!=null and record.queryTime!=''">
                and DATE_FORMAT(create_time,'%Y-%m')=#{record.queryTime}
            </if>
            <if test="record.revenueType==1">
                and  total>0
            </if>
            <if test="record.revenueType==2">
                <![CDATA[ and total<0 ]]>
            </if>
        </where>
        order by  create_time desc
    </select>
</mapper>