fix: 新增pos机刷卡推荐功能代码提交。
This commit is contained in:
@@ -1,30 +1,25 @@
|
|||||||
package com.intc.invest.controller;
|
package com.intc.invest.controller;
|
||||||
|
|
||||||
import java.util.List;
|
import com.intc.common.core.utils.poi.ExcelUtil;
|
||||||
import java.io.IOException;
|
import com.intc.common.core.web.controller.BaseController;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import com.intc.common.core.web.domain.AjaxResult;
|
||||||
import javax.annotation.Resource;
|
import com.intc.common.core.web.page.TableDataInfo;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PutMapping;
|
|
||||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
import com.intc.common.log.annotation.Log;
|
import com.intc.common.log.annotation.Log;
|
||||||
import com.intc.common.log.enums.BusinessType;
|
import com.intc.common.log.enums.BusinessType;
|
||||||
import com.intc.common.security.annotation.RequiresPermissions;
|
import com.intc.common.security.annotation.RequiresPermissions;
|
||||||
import com.intc.invest.domain.PosMachine;
|
import com.intc.invest.domain.PosMachine;
|
||||||
import com.intc.invest.domain.vo.PosMachineVo;
|
import com.intc.invest.domain.dto.AccountsDto;
|
||||||
import com.intc.invest.domain.dto.PosMachineDto;
|
import com.intc.invest.domain.dto.PosMachineDto;
|
||||||
|
import com.intc.invest.domain.vo.AccountsVo;
|
||||||
|
import com.intc.invest.domain.vo.PosMachineVo;
|
||||||
import com.intc.invest.service.IPosMachineService;
|
import com.intc.invest.service.IPosMachineService;
|
||||||
import com.intc.common.core.web.controller.BaseController;
|
|
||||||
import com.intc.common.core.web.domain.AjaxResult;
|
|
||||||
import com.intc.common.core.utils.poi.ExcelUtil;
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import com.intc.common.core.web.page.TableDataInfo;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* pos机信息Controller
|
* pos机信息Controller
|
||||||
@@ -113,4 +108,18 @@ public class PosMachineController extends BaseController
|
|||||||
{
|
{
|
||||||
return toAjax(posMachineService.deletePosMachineByIds(ids));
|
return toAjax(posMachineService.deletePosMachineByIds(ids));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询pos机信息列表
|
||||||
|
*/
|
||||||
|
@ApiOperation(value="查询信用卡刷pos机信息列表",response = PosMachineVo.class)
|
||||||
|
@RequiresPermissions("invest:posmachine:list")
|
||||||
|
@GetMapping("/creditPosList")
|
||||||
|
public TableDataInfo selectCreditPosList(AccountsDto accountsDto)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<AccountsVo> list = posMachineService.selectCreditPosList(accountsDto);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,6 +22,10 @@ public class AccountsDto extends BaseEntity implements Serializable
|
|||||||
@ApiModelProperty(value="名称")
|
@ApiModelProperty(value="名称")
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
|
/** 账号 */
|
||||||
|
@ApiModelProperty(value="账号")
|
||||||
|
private String code;
|
||||||
|
|
||||||
/** 账户类型 */
|
/** 账户类型 */
|
||||||
@ApiModelProperty(value="账户类型")
|
@ApiModelProperty(value="账户类型")
|
||||||
private String type;
|
private String type;
|
||||||
|
|||||||
@@ -43,4 +43,7 @@ public class AccountsVo extends Accounts
|
|||||||
|
|
||||||
private String lendType;
|
private String lendType;
|
||||||
|
|
||||||
|
private String advicePosNames;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,9 @@ package com.intc.invest.mapper;
|
|||||||
|
|
||||||
import com.intc.common.datascope.annotation.DataScope;
|
import com.intc.common.datascope.annotation.DataScope;
|
||||||
import com.intc.invest.domain.PosMachine;
|
import com.intc.invest.domain.PosMachine;
|
||||||
|
import com.intc.invest.domain.dto.AccountsDto;
|
||||||
import com.intc.invest.domain.dto.PosMachineDto;
|
import com.intc.invest.domain.dto.PosMachineDto;
|
||||||
|
import com.intc.invest.domain.vo.AccountsVo;
|
||||||
import com.intc.invest.domain.vo.PosMachineVo;
|
import com.intc.invest.domain.vo.PosMachineVo;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -79,4 +81,13 @@ public interface PosMachineMapper
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int removePosMachineByIds(Long[] ids);
|
public int removePosMachineByIds(Long[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询记账账户列表
|
||||||
|
*
|
||||||
|
* @param accountsDto 记账账户
|
||||||
|
* @return 记账账户集合
|
||||||
|
*/
|
||||||
|
@DataScope(businessAlias = "a")
|
||||||
|
public List<AccountsVo> selectCreditPosList(AccountsDto accountsDto);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
package com.intc.invest.service;
|
package com.intc.invest.service;
|
||||||
|
|
||||||
import com.intc.invest.domain.PosMachine;
|
import com.intc.invest.domain.PosMachine;
|
||||||
|
import com.intc.invest.domain.dto.AccountsDto;
|
||||||
import com.intc.invest.domain.dto.PosMachineDto;
|
import com.intc.invest.domain.dto.PosMachineDto;
|
||||||
|
import com.intc.invest.domain.vo.AccountsVo;
|
||||||
import com.intc.invest.domain.vo.PosMachineVo;
|
import com.intc.invest.domain.vo.PosMachineVo;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -62,4 +64,6 @@ public interface IPosMachineService
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deletePosMachineById(Long id);
|
public int deletePosMachineById(Long id);
|
||||||
|
|
||||||
|
public List<AccountsVo> selectCreditPosList(AccountsDto accountsDto);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,9 @@ import com.intc.common.core.utils.StringUtils;
|
|||||||
import com.intc.common.security.utils.SecurityUtils;
|
import com.intc.common.security.utils.SecurityUtils;
|
||||||
import com.intc.invest.domain.Accounts;
|
import com.intc.invest.domain.Accounts;
|
||||||
import com.intc.invest.domain.PosMachine;
|
import com.intc.invest.domain.PosMachine;
|
||||||
|
import com.intc.invest.domain.dto.AccountsDto;
|
||||||
import com.intc.invest.domain.dto.PosMachineDto;
|
import com.intc.invest.domain.dto.PosMachineDto;
|
||||||
|
import com.intc.invest.domain.vo.AccountsVo;
|
||||||
import com.intc.invest.domain.vo.PosMachineVo;
|
import com.intc.invest.domain.vo.PosMachineVo;
|
||||||
import com.intc.invest.mapper.AccountsMapper;
|
import com.intc.invest.mapper.AccountsMapper;
|
||||||
import com.intc.invest.mapper.PosMachineMapper;
|
import com.intc.invest.mapper.PosMachineMapper;
|
||||||
@@ -161,4 +163,16 @@ public class PosMachineServiceImpl implements IPosMachineService
|
|||||||
{
|
{
|
||||||
return posMachineMapper.removePosMachineById(id);
|
return posMachineMapper.removePosMachineById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* pos机信息
|
||||||
|
*
|
||||||
|
* @param accountsDto pos机信息主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<AccountsVo> selectCreditPosList(AccountsDto accountsDto){
|
||||||
|
|
||||||
|
return posMachineMapper.selectCreditPosList(accountsDto);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -176,4 +176,71 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
#{id}
|
#{id}
|
||||||
</foreach>
|
</foreach>
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
<select id="selectCreditPosList" parameterType="AccountsDto" resultType="AccountsVo">
|
||||||
|
select
|
||||||
|
a."name",
|
||||||
|
a.code,
|
||||||
|
a.available_limit as availableLimit,
|
||||||
|
bcl.bill_date || '日' as billDateName,
|
||||||
|
(
|
||||||
|
select
|
||||||
|
STRING_AGG(to_char(atr.create_time,
|
||||||
|
'yyyy-MM-dd')|| '-' || pm.name || '(' || pm.merchant_name || ')'|| '-' ||bcl.name ::text,
|
||||||
|
'、'
|
||||||
|
order by
|
||||||
|
atr.create_time) as posNames
|
||||||
|
from
|
||||||
|
accounts_transfer_record atr
|
||||||
|
left join pos_machine pm on
|
||||||
|
pm.id = atr.pos_id
|
||||||
|
left join bank_card_lend bcl on
|
||||||
|
bcl.id = pm.debit_card
|
||||||
|
where
|
||||||
|
atr.out_account_id = a.id
|
||||||
|
and atr.create_time >= CURRENT_DATE - interval '1 months'
|
||||||
|
and atr.del_flag = '0'
|
||||||
|
|
||||||
|
) as remark,
|
||||||
|
(
|
||||||
|
select
|
||||||
|
STRING_AGG(pm.name || '(' || pm.merchant_name || ')'|| '-' ||bcl.name ::text,
|
||||||
|
'、'
|
||||||
|
)
|
||||||
|
from
|
||||||
|
pos_machine pm
|
||||||
|
left join bank_card_lend bcl on
|
||||||
|
bcl.id = pm.debit_card
|
||||||
|
where
|
||||||
|
pm.status = '1'
|
||||||
|
and bcl.name not like '%' || a.name || '%'
|
||||||
|
and pm.del_flag = '0'
|
||||||
|
and pm.id not in
|
||||||
|
(
|
||||||
|
select
|
||||||
|
atr.pos_id
|
||||||
|
from
|
||||||
|
accounts_transfer_record atr
|
||||||
|
left join pos_machine pm on
|
||||||
|
pm.id = atr.pos_id
|
||||||
|
where
|
||||||
|
atr.out_account_id = a.id
|
||||||
|
and atr.create_time >= CURRENT_DATE - interval '1 months'
|
||||||
|
and atr.del_flag = '0'
|
||||||
|
) ) as advicePosNames
|
||||||
|
from
|
||||||
|
accounts a
|
||||||
|
left join bank_card_lend bcl on
|
||||||
|
bcl.id = a.id
|
||||||
|
where
|
||||||
|
a."type" = '2'
|
||||||
|
and a.status = '1'
|
||||||
|
and a.del_flag = '0'
|
||||||
|
<if test="name != null and name != ''"> and a.name like '%'|| #{name}||'%'</if>
|
||||||
|
<if test="code != null and code != ''"> and a.code like '%'|| #{code}||'%'</if>
|
||||||
|
<!-- 数据范围过滤 -->
|
||||||
|
${params.dataScope}
|
||||||
|
order by
|
||||||
|
bcl.bill_date
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
Reference in New Issue
Block a user