结算相关
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
package com.chaozhanggui.admin.system.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.chaozhanggui.admin.system.annotation.OpLog;
|
||||
import com.chaozhanggui.admin.system.service.AccountService;
|
||||
import com.chaozhanggui.admin.system.service.MerchantInfoService;
|
||||
import com.chaozhanggui.admin.system.service.SxfMccInfoService;
|
||||
@@ -16,9 +19,12 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author lyf
|
||||
@@ -53,6 +59,7 @@ public class MerchantInfoController {
|
||||
* @param userApp
|
||||
* @return
|
||||
*/
|
||||
@OpLog(opName = "更改实名认证信息", opDetail = "更改实名认证信息", opCode = "NAME_UPDATE")
|
||||
@PostMapping("/updatePromoterInformation")
|
||||
public RespBody updatePromoterInformation(@RequestBody TbPlussUserApp userApp){
|
||||
if (userApp == null){
|
||||
@@ -68,6 +75,7 @@ public class MerchantInfoController {
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/updateMerchantInformation")
|
||||
@OpLog(opName = "修改商户相关信息", opDetail = "修改商户相关信息", opCode = "MERCHANT_UPDATE")
|
||||
public RespBody updateMerchantInformation(@RequestBody TbPlussMerchantBaseInfo merchantBaseInfo){
|
||||
if (merchantBaseInfo == null ){
|
||||
log.error("参数错误");
|
||||
@@ -111,6 +119,15 @@ public class MerchantInfoController {
|
||||
return merchantInfoService.merchantAccount(userId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更改结算信息D1或者D0
|
||||
* @param account
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/detail/updateAccount")
|
||||
public RespBody updateAccount(@RequestBody AccountDTO account){
|
||||
return merchantInfoService.updateAccountD1(account);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取对应的银行
|
||||
@@ -147,6 +164,26 @@ public class MerchantInfoController {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 实名认证信息页面(实名个数)
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/connectInfo/{userId}")
|
||||
public RespBody connectInfo(@PathVariable("userId") Integer userId) {
|
||||
return merchantInfoService.connectInfo(userId);
|
||||
}
|
||||
|
||||
// /**
|
||||
// * 通道进件信息
|
||||
// * @param userId
|
||||
// * @return
|
||||
// */
|
||||
// @GetMapping("/detail/channelAuditInfo/{userId}")
|
||||
// public RespBody channelAuditInfo(@PathVariable("userId") Integer userId) {
|
||||
// merchantInfoService.channelAuditInfo(userId);
|
||||
//
|
||||
// }
|
||||
|
||||
// @PostMapping("/updateMerchantSettlement2")
|
||||
// public RespBody updateMerchantSettlement2(@RequestBody AccountDTO accountDTO) {
|
||||
@@ -216,9 +253,6 @@ public class MerchantInfoController {
|
||||
//
|
||||
// }
|
||||
|
||||
/**
|
||||
* 获取所有省
|
||||
*/
|
||||
// private void getProvince() {
|
||||
// QueryWrapper<TbPlussAreaCity> queryWrapper = new QueryWrapper<TbPlussAreaCity>().eq("type", "1");
|
||||
// List<TbPlussAreaCity> areaCitiesList = TbPlussAreaCityMapper.selectList(queryWrapper);
|
||||
|
||||
@@ -44,6 +44,8 @@ public class MerchantInfoService {
|
||||
@Resource
|
||||
private TbPlussMerchantChannelMapper merchantChannelMapper;
|
||||
@Resource
|
||||
private TbPlussMerchantChannelStatusMapper merchantChannelStatusMapper;
|
||||
@Resource
|
||||
private TbPlussUserInfoMapper userInfoMapper;
|
||||
@Resource
|
||||
private TbPlussUserAppMapper userAppMapper;
|
||||
@@ -93,6 +95,28 @@ public class MerchantInfoService {
|
||||
return new RespBody("000000",realAccount);
|
||||
}
|
||||
|
||||
public RespBody connectInfo(Integer userId){
|
||||
//实名身份证信息条数
|
||||
TbPlussIdCard certIdCard = idCardMapper.selectCertByUserId(userId, "01");
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
if (certIdCard != null){
|
||||
map.put("CertNoCount",idCardMapper.countByCertno(certIdCard.getCertno()));
|
||||
}else {
|
||||
map.put("CertNoCount",0);
|
||||
}
|
||||
|
||||
// 结算身份证相关的结算信息条数
|
||||
map.put("countAccountCount",merchantBaseInfoMapper.countByIdCardNo(certIdCard.getCertno()));
|
||||
// 结算身份证相关的结算信息条数
|
||||
TbPlussMerchantBaseInfo merchantBaseInfo = merchantBaseInfoMapper.selectByUserId(String.valueOf(userId));
|
||||
if (merchantBaseInfo != null) {
|
||||
map.put("countMbiName", idCardMapper.countByAliasAndName(merchantBaseInfo.getAlias(), merchantBaseInfo.getMerchantname()));
|
||||
}else {
|
||||
map.put("countMbiName",0);
|
||||
}
|
||||
return new RespBody("000000",map);
|
||||
}
|
||||
|
||||
public HashMap<String,Object> getRealAccount(Integer userId) {
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
//D1
|
||||
@@ -224,6 +248,7 @@ public class MerchantInfoService {
|
||||
// UpdateWrapper<TbPlussMerchantBaseInfo> merchantBaseInfoUpdateWrapper = new UpdateWrapper<TbPlussMerchantBaseInfo>()
|
||||
// .eq("userId", userApp.getUserid());
|
||||
// merchantChannelMapper.update(userApp.getMerchantBaseInfo(), merchantBaseInfoUpdateWrapper);
|
||||
|
||||
merchantBaseInfoMapper.updateByPrimaryKeySelective(merchantBaseInfo);
|
||||
}
|
||||
if (merchantBaseInfo.getMerchantcode() != null) {
|
||||
@@ -268,5 +293,23 @@ public class MerchantInfoService {
|
||||
}
|
||||
return new RespBody("000000");
|
||||
}
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public RespBody updateAccountD1(AccountDTO account){
|
||||
TbPlussAccount tbPlussAccount = accountMapper.selectByAccountD1(account.getUserid(), account.getChanneltype());
|
||||
if (tbPlussAccount == null){
|
||||
return new RespBody("000051");
|
||||
}
|
||||
bankCardMapper.updateByPrimaryKeySelective(account.getBankCard());
|
||||
idCardMapper.updateByPrimaryKeySelective(account.getIdcard());
|
||||
|
||||
return new RespBody("000000");
|
||||
}
|
||||
|
||||
// public RespBody channelAuditInfo(Integer userId){
|
||||
// TbPlussMerchantBaseInfo merchantBaseInfo = merchantBaseInfoMapper.selectByUserId(String.valueOf(userId));
|
||||
// if(merchantBaseInfo != null) {
|
||||
// List<TbPlussMerchantChannelStatus> merchantCodeList = merchantChannelStatusMapper.getByMerchantCodeList(merchantBaseInfo.getMerchantcode());
|
||||
// merchantCodeList
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
@@ -8,10 +8,13 @@ import com.chaozhanggui.common.system.config.RespBody;
|
||||
import com.chaozhanggui.dao.system.dao.TbPlussBankCodeSxfMapper;
|
||||
import com.chaozhanggui.dao.system.dao.TbPlussSxfMccInfoMapper;
|
||||
import com.chaozhanggui.dao.system.entity.TbPlussSxfMccInfo;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lyf
|
||||
@@ -22,8 +25,10 @@ public class SxfMccInfoService{
|
||||
private TbPlussBankCodeSxfMapper bankCodeSxfMapper;
|
||||
|
||||
public RespBody pageData(Integer current, Integer size,String keyWord){
|
||||
current = (current-1)*size;
|
||||
return new RespBody("000000",bankCodeSxfMapper.pageData(current,size,keyWord));
|
||||
PageHelper.startPage(current,size);
|
||||
List<TbPlussSxfMccInfo> list = bankCodeSxfMapper.pageData(keyWord);
|
||||
PageInfo pageInfo = new PageInfo(list);
|
||||
return new RespBody("000000",pageInfo);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ public interface TbPlussAccountMapper {
|
||||
TbPlussAccount selectByPrimaryKey(Integer id);
|
||||
TbPlussAccount selectByUser(@Param("userId") Integer userId, @Param("channelType")String channelType);
|
||||
TbPlussAccount selectByAccount(TbPlussAccount record);
|
||||
|
||||
TbPlussAccount selectByAccountD1(@Param("userId") String userId,@Param("channelType") String channelType);
|
||||
int updateByPrimaryKeySelective(TbPlussAccount record);
|
||||
|
||||
int updateByPrimaryKeyWithBLOBs(TbPlussAccount record);
|
||||
|
||||
@@ -21,7 +21,7 @@ public interface TbPlussBankCodeSxfMapper extends BaseMapper<TbPlussBankCodeSxf>
|
||||
|
||||
TbPlussBankCodeSxf selectByPrimaryKey(Integer id);
|
||||
|
||||
List<TbPlussSxfMccInfo> pageData(@Param("current") Integer current, @Param("size") Integer size, @Param("keyWord") String keyWord);
|
||||
List<TbPlussSxfMccInfo> pageData(@Param("keyWord") String keyWord);
|
||||
|
||||
int updateByPrimaryKeySelective(TbPlussBankCodeSxf record);
|
||||
|
||||
|
||||
@@ -19,6 +19,9 @@ public interface TbPlussIdCardMapper {
|
||||
TbPlussIdCard selectByPrimaryKey(Integer id);
|
||||
TbPlussIdCard selectCertByUserId(Integer userId, String type);
|
||||
|
||||
Integer countByCertno(@Param("Certno") String Certno);
|
||||
Integer countByAliasAndName(@Param("alias") String alias, @Param("merchantName") String merchantName);
|
||||
|
||||
int updateByPrimaryKeySelective(TbPlussIdCard record);
|
||||
|
||||
int updateByPrimaryKey(TbPlussIdCard record);
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.chaozhanggui.dao.system.dao;
|
||||
import com.chaozhanggui.dao.system.entity.TbPlussMerchantBaseInfo;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@@ -20,6 +21,8 @@ public interface TbPlussMerchantBaseInfoMapper {
|
||||
|
||||
int updateByPrimaryKey(TbPlussMerchantBaseInfo record);
|
||||
|
||||
Integer countByIdCardNo(@Param("idCardNo") String idCardNo);
|
||||
|
||||
TbPlussMerchantBaseInfo selectByUserId(String userId);
|
||||
|
||||
TbPlussMerchantBaseInfo selectByMerchantcode(String merchantcode);
|
||||
|
||||
@@ -32,6 +32,7 @@ public interface TbPlussMerchantChannelStatusMapper {
|
||||
|
||||
TbPlussMerchantChannelStatus getByMerchantCode(@Param("merchantCode") String merchantCode,@Param("channel") String channel );
|
||||
|
||||
List<TbPlussMerchantChannelStatus> getByMerchantCodeList(@Param("merchantCode") String merchantCode);
|
||||
|
||||
TbPlussMerchantChannelStatus getValidData(String merchantCode);
|
||||
|
||||
|
||||
@@ -92,6 +92,13 @@ public class TbPlussMerchantBaseInfo implements Serializable {
|
||||
|
||||
private String appid;
|
||||
|
||||
private String provinceCode;
|
||||
|
||||
private String cityCode;
|
||||
|
||||
private String districtCode;
|
||||
|
||||
|
||||
private Date firsttradetime;
|
||||
|
||||
private Date lasttradetime;
|
||||
@@ -99,6 +106,31 @@ public class TbPlussMerchantBaseInfo implements Serializable {
|
||||
private Byte splitflag;
|
||||
|
||||
private Byte validflag;
|
||||
|
||||
public String getProvinceCode() {
|
||||
return provinceCode;
|
||||
}
|
||||
|
||||
public void setProvinceCode(String provinceCode) {
|
||||
this.provinceCode = provinceCode;
|
||||
}
|
||||
|
||||
public String getCityCode() {
|
||||
return cityCode;
|
||||
}
|
||||
|
||||
public void setCityCode(String cityCode) {
|
||||
this.cityCode = cityCode;
|
||||
}
|
||||
|
||||
public String getDistrictCode() {
|
||||
return districtCode;
|
||||
}
|
||||
|
||||
public void setDistrictCode(String districtCode) {
|
||||
this.districtCode = districtCode;
|
||||
}
|
||||
|
||||
@TableField(exist = false)
|
||||
private String picUrl1;
|
||||
@TableField(exist = false)
|
||||
|
||||
@@ -96,6 +96,20 @@
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="selectByAccountD1" resultType="com.chaozhanggui.dao.system.entity.TbPlussAccount">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from tb_pluss_account
|
||||
<where>
|
||||
<if test="userId != null">
|
||||
userId = #{userId}
|
||||
</if>
|
||||
<if test="channelType!= null">
|
||||
and channelType = #{channelType}
|
||||
</if>
|
||||
</where>
|
||||
limit 1
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
||||
delete from tb_pluss_account
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
|
||||
@@ -34,7 +34,6 @@
|
||||
OR F_father_txt LIKE #{keyWord}
|
||||
</if>
|
||||
</where>
|
||||
LIMIT #{size} offSET #{current}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
||||
delete from tb_pluss_bank_code_sxf
|
||||
|
||||
@@ -42,6 +42,16 @@
|
||||
AND `userType` = '03'
|
||||
Limit 1
|
||||
</select>
|
||||
<select id="countByCertno" resultType="java.lang.Integer">
|
||||
SELECT count(Certno)
|
||||
FROM tb_pluss_id_card
|
||||
WHERE certNo = #{Certno}
|
||||
</select>
|
||||
<select id="countByAliasAndName" resultType="java.lang.Integer">
|
||||
SELECT COUNT( 1 )
|
||||
FROM tb_pluss_merchant_base_info
|
||||
WHERE (alias = #{alias} OR merchantName = #{merchantName})
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
||||
delete from tb_pluss_id_card
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
|
||||
@@ -390,6 +390,15 @@
|
||||
<if test="validflag != null">
|
||||
#{validflag,jdbcType=TINYINT},
|
||||
</if>
|
||||
<if test="provinceCode != null">
|
||||
#{provinceCode},
|
||||
</if>
|
||||
<if test="cityCode != null">
|
||||
#{cityCode},
|
||||
</if>
|
||||
<if test="districtCode != null">
|
||||
#{districtCode},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.chaozhanggui.dao.system.entity.TbPlussMerchantBaseInfo">
|
||||
@@ -410,9 +419,6 @@
|
||||
<if test="merchantname != null">
|
||||
merchantName = #{merchantname,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="merchanttype != null">
|
||||
merchantType = #{merchanttype,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="productdesc != null">
|
||||
productDesc = #{productdesc,jdbcType=VARCHAR},
|
||||
</if>
|
||||
@@ -422,9 +428,6 @@
|
||||
<if test="mcc != null">
|
||||
mcc = #{mcc,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="mccname != null">
|
||||
mccName = #{mccname,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="alias != null">
|
||||
alias = #{alias,jdbcType=VARCHAR},
|
||||
</if>
|
||||
@@ -533,6 +536,15 @@
|
||||
<if test="validflag != null">
|
||||
validFlag = #{validflag,jdbcType=TINYINT},
|
||||
</if>
|
||||
<if test="provinceCode != null">
|
||||
provinceCode=#{provinceCode},
|
||||
</if>
|
||||
<if test="cityCode != null">
|
||||
cityCode=#{cityCode},
|
||||
</if>
|
||||
<if test="districtCode != null">
|
||||
districtCode=#{districtCode},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
@@ -594,4 +606,13 @@
|
||||
<select id="selectByMerchantcode" resultMap="BaseResultMap">
|
||||
select * from tb_pluss_merchant_base_info where merchantCode=#{merchantcode}
|
||||
</select>
|
||||
<select id="countByIdCardNo" resultType="java.lang.Integer">
|
||||
SELECT IFNULL(count(DISTINCT mbi.userId),0)
|
||||
FROM tb_pluss_merchant_base_info mbi
|
||||
LEFT JOIN tb_pluss_account account ON account.userId = mbi.userId
|
||||
LEFT JOIN tb_pluss_id_card ic ON account.userId = ic.userId AND account.idCardId = ic.id
|
||||
LEFT JOIN tb_pluss_merchant_channel_status mcs ON mcs.merchantCode = mbi.merchantCode
|
||||
WHERE mcs.`status` IN (3, 7)
|
||||
AND ic.certNo = #{idCardNo}
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -409,4 +409,11 @@
|
||||
</where>
|
||||
order by id desc
|
||||
</select>
|
||||
<select id="getByMerchantCodeList"
|
||||
resultType="com.chaozhanggui.dao.system.entity.TbPlussMerchantChannelStatus">
|
||||
select * from tb_pluss_merchant_channel_status
|
||||
where merchantCode=#{merchantCode}
|
||||
order by valid desc
|
||||
limit 1
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -229,7 +229,7 @@
|
||||
) d
|
||||
LEFT JOIN view_base_order o ON d.user_id = o.userId
|
||||
WHERE
|
||||
date_format( `o`.`createDt`, '%Y-%m-%d' ) = date_format(( curdate() - INTERVAL 1 DAY ), '%Y-%m-%d' )) m ON t.id = m.id
|
||||
date_format( `o`.`createDt`, '%Y-%m-%d' ) = date_format(( curdate() - INTERVAL 0 DAY ), '%Y-%m-%d' )) m ON t.id = m.id
|
||||
JOIN ( SELECT * FROM view_merchant_profit_sum WHERE userId = #{userId} ) p
|
||||
</select>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user