From 4a70209948165929a697b06f77e36f043ed77ec4 Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Mon, 29 May 2023 17:50:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=B7=B2=E7=9F=A5=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/BsMerLedgerController.java | 10 ++- .../channel/lakala/LaKaLaLedgerService.java | 2 +- .../java/com/hfkj/dao/BsMerLedgerMapper.java | 35 ++++++---- .../com/hfkj/dao/BsMerLedgerSqlProvider.java | 14 ++++ .../java/com/hfkj/entity/BsMerLedger.java | 16 +++++ .../com/hfkj/entity/BsMerLedgerExample.java | 70 +++++++++++++++++++ .../com/hfkj/service/BsMerLedgerService.java | 10 +++ .../service/impl/BsMerLedgerServiceImpl.java | 23 ++++++ 8 files changed, 162 insertions(+), 18 deletions(-) diff --git a/cweb/src/main/java/com/cweb/controller/BsMerLedgerController.java b/cweb/src/main/java/com/cweb/controller/BsMerLedgerController.java index 495170d..ea595bd 100644 --- a/cweb/src/main/java/com/cweb/controller/BsMerLedgerController.java +++ b/cweb/src/main/java/com/cweb/controller/BsMerLedgerController.java @@ -11,6 +11,7 @@ import com.hfkj.model.ResponseData; import com.hfkj.service.BsMerLedgerReceiverService; import com.hfkj.service.BsMerLedgerService; import com.hfkj.service.BsMerPlatformNoService; +import com.hfkj.service.BsMerService; import com.hfkj.sysenum.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -41,6 +42,8 @@ public class BsMerLedgerController { @Resource private BsMerLedgerService merLedgerService; @Resource + private BsMerService merService; + @Resource private BsMerLedgerReceiverService merLedgerReceiverService; @RequestMapping(value="/merLedgerApply",method = RequestMethod.POST) @@ -64,11 +67,14 @@ public class BsMerLedgerController { log.error("BsDeviceOrderPayController -> payOrder error!","参数校验失败"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "当前平台未进件"); } + BsMer mer = merService.getMer(body.getMerId()); + // 设备订单 BsMerLedger merLedger = merLedgerService.getMerLedger(body.getMerId(), PlatformTypeEnum.getDataByNumber(body.getPlatformType())); if (merLedger == null) { merLedger = new BsMerLedger(); merLedger.setMerId(merPlatform.getMerId()); + merLedger.setMerName(mer.getMerName()); merLedger.setPlatformType(merPlatform.getPlatformType()); merLedger.setPlatformNo(merPlatform.getPlatformNo()); merLedger.setCupNo(merPlatform.getCupNo()); @@ -256,11 +262,11 @@ public class BsMerLedgerController { Map param = new HashMap<>(); param.put("platformType", platformType); - param.put("status", MerLedgerReceiverStatusEnum.status1.getNumber()); + param.put("status", MerLedgerStatusEnum.status1.getNumber()); param.put("receiverNoNotNull", "true"); PageHelper.startPage(pageNum, pageSize); - return ResponseMsgUtil.success(new PageInfo<>(merLedgerReceiverService.getMerLedgerReceiverList(param))); + return ResponseMsgUtil.success(new PageInfo<>(merLedgerService.getMerLedgerList(param))); } catch (Exception e) { log.error(e.getMessage(), e); diff --git a/service/src/main/java/com/hfkj/channel/lakala/LaKaLaLedgerService.java b/service/src/main/java/com/hfkj/channel/lakala/LaKaLaLedgerService.java index 8a02578..ca1d8c6 100644 --- a/service/src/main/java/com/hfkj/channel/lakala/LaKaLaLedgerService.java +++ b/service/src/main/java/com/hfkj/channel/lakala/LaKaLaLedgerService.java @@ -330,7 +330,7 @@ public class LaKaLaLedgerService { } } } - map.put("attachList", attachMapList); + map.put("attachList", attachMapList); commonParam.put("reqData", map); Map reqParam = LaKaLaConfig.generateSignParamsV2(JSONObject.parseObject(JSONObject.toJSONString(commonParam))); diff --git a/service/src/main/java/com/hfkj/dao/BsMerLedgerMapper.java b/service/src/main/java/com/hfkj/dao/BsMerLedgerMapper.java index 24e5c0b..c726875 100644 --- a/service/src/main/java/com/hfkj/dao/BsMerLedgerMapper.java +++ b/service/src/main/java/com/hfkj/dao/BsMerLedgerMapper.java @@ -39,20 +39,22 @@ public interface BsMerLedgerMapper extends BsMerLedgerMapperExt { int deleteByPrimaryKey(Long id); @Insert({ - "insert into bs_mer_ledger (mer_id, platform_type, ", - "platform_no, cup_no, ", - "receiver_no, split_lowest_ratio, ", - "split_entrust_file_name, split_entrust_file_path, ", - "`status`, reject_reason, ", - "create_time, update_time, ", - "ext_1, ext_2, ext_3)", - "values (#{merId,jdbcType=BIGINT}, #{platformType,jdbcType=INTEGER}, ", - "#{platformNo,jdbcType=VARCHAR}, #{cupNo,jdbcType=VARCHAR}, ", - "#{receiverNo,jdbcType=VARCHAR}, #{splitLowestRatio,jdbcType=DECIMAL}, ", - "#{splitEntrustFileName,jdbcType=VARCHAR}, #{splitEntrustFilePath,jdbcType=VARCHAR}, ", - "#{status,jdbcType=INTEGER}, #{rejectReason,jdbcType=VARCHAR}, ", - "#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ", - "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" + "insert into bs_mer_ledger (mer_id, mer_name, ", + "platform_type, platform_no, ", + "cup_no, receiver_no, ", + "split_lowest_ratio, split_entrust_file_name, ", + "split_entrust_file_path, `status`, ", + "reject_reason, create_time, ", + "update_time, ext_1, ", + "ext_2, ext_3)", + "values (#{merId,jdbcType=BIGINT}, #{merName,jdbcType=VARCHAR}, ", + "#{platformType,jdbcType=INTEGER}, #{platformNo,jdbcType=VARCHAR}, ", + "#{cupNo,jdbcType=VARCHAR}, #{receiverNo,jdbcType=VARCHAR}, ", + "#{splitLowestRatio,jdbcType=DECIMAL}, #{splitEntrustFileName,jdbcType=VARCHAR}, ", + "#{splitEntrustFilePath,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, ", + "#{rejectReason,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, ", + "#{updateTime,jdbcType=TIMESTAMP}, #{ext1,jdbcType=VARCHAR}, ", + "#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" }) @Options(useGeneratedKeys=true,keyProperty="id") int insert(BsMerLedger record); @@ -65,6 +67,7 @@ public interface BsMerLedgerMapper extends BsMerLedgerMapperExt { @Results({ @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), @Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT), + @Result(column="mer_name", property="merName", jdbcType=JdbcType.VARCHAR), @Result(column="platform_type", property="platformType", jdbcType=JdbcType.INTEGER), @Result(column="platform_no", property="platformNo", jdbcType=JdbcType.VARCHAR), @Result(column="cup_no", property="cupNo", jdbcType=JdbcType.VARCHAR), @@ -84,7 +87,7 @@ public interface BsMerLedgerMapper extends BsMerLedgerMapperExt { @Select({ "select", - "id, mer_id, platform_type, platform_no, cup_no, receiver_no, split_lowest_ratio, ", + "id, mer_id, mer_name, platform_type, platform_no, cup_no, receiver_no, split_lowest_ratio, ", "split_entrust_file_name, split_entrust_file_path, `status`, reject_reason, create_time, ", "update_time, ext_1, ext_2, ext_3", "from bs_mer_ledger", @@ -93,6 +96,7 @@ public interface BsMerLedgerMapper extends BsMerLedgerMapperExt { @Results({ @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), @Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT), + @Result(column="mer_name", property="merName", jdbcType=JdbcType.VARCHAR), @Result(column="platform_type", property="platformType", jdbcType=JdbcType.INTEGER), @Result(column="platform_no", property="platformNo", jdbcType=JdbcType.VARCHAR), @Result(column="cup_no", property="cupNo", jdbcType=JdbcType.VARCHAR), @@ -122,6 +126,7 @@ public interface BsMerLedgerMapper extends BsMerLedgerMapperExt { @Update({ "update bs_mer_ledger", "set mer_id = #{merId,jdbcType=BIGINT},", + "mer_name = #{merName,jdbcType=VARCHAR},", "platform_type = #{platformType,jdbcType=INTEGER},", "platform_no = #{platformNo,jdbcType=VARCHAR},", "cup_no = #{cupNo,jdbcType=VARCHAR},", diff --git a/service/src/main/java/com/hfkj/dao/BsMerLedgerSqlProvider.java b/service/src/main/java/com/hfkj/dao/BsMerLedgerSqlProvider.java index 675b602..20209c6 100644 --- a/service/src/main/java/com/hfkj/dao/BsMerLedgerSqlProvider.java +++ b/service/src/main/java/com/hfkj/dao/BsMerLedgerSqlProvider.java @@ -32,6 +32,10 @@ public class BsMerLedgerSqlProvider { sql.VALUES("mer_id", "#{merId,jdbcType=BIGINT}"); } + if (record.getMerName() != null) { + sql.VALUES("mer_name", "#{merName,jdbcType=VARCHAR}"); + } + if (record.getPlatformType() != null) { sql.VALUES("platform_type", "#{platformType,jdbcType=INTEGER}"); } @@ -99,6 +103,7 @@ public class BsMerLedgerSqlProvider { sql.SELECT("id"); } sql.SELECT("mer_id"); + sql.SELECT("mer_name"); sql.SELECT("platform_type"); sql.SELECT("platform_no"); sql.SELECT("cup_no"); @@ -138,6 +143,10 @@ public class BsMerLedgerSqlProvider { sql.SET("mer_id = #{record.merId,jdbcType=BIGINT}"); } + if (record.getMerName() != null) { + sql.SET("mer_name = #{record.merName,jdbcType=VARCHAR}"); + } + if (record.getPlatformType() != null) { sql.SET("platform_type = #{record.platformType,jdbcType=INTEGER}"); } @@ -204,6 +213,7 @@ public class BsMerLedgerSqlProvider { sql.SET("id = #{record.id,jdbcType=BIGINT}"); sql.SET("mer_id = #{record.merId,jdbcType=BIGINT}"); + sql.SET("mer_name = #{record.merName,jdbcType=VARCHAR}"); sql.SET("platform_type = #{record.platformType,jdbcType=INTEGER}"); sql.SET("platform_no = #{record.platformNo,jdbcType=VARCHAR}"); sql.SET("cup_no = #{record.cupNo,jdbcType=VARCHAR}"); @@ -232,6 +242,10 @@ public class BsMerLedgerSqlProvider { sql.SET("mer_id = #{merId,jdbcType=BIGINT}"); } + if (record.getMerName() != null) { + sql.SET("mer_name = #{merName,jdbcType=VARCHAR}"); + } + if (record.getPlatformType() != null) { sql.SET("platform_type = #{platformType,jdbcType=INTEGER}"); } diff --git a/service/src/main/java/com/hfkj/entity/BsMerLedger.java b/service/src/main/java/com/hfkj/entity/BsMerLedger.java index 7408870..9f9c80d 100644 --- a/service/src/main/java/com/hfkj/entity/BsMerLedger.java +++ b/service/src/main/java/com/hfkj/entity/BsMerLedger.java @@ -24,6 +24,11 @@ public class BsMerLedger implements Serializable { */ private Long merId; + /** + * 商户名称 + */ + private String merName; + /** * 平台 */ @@ -103,6 +108,14 @@ public class BsMerLedger implements Serializable { this.merId = merId; } + public String getMerName() { + return merName; + } + + public void setMerName(String merName) { + this.merName = merName; + } + public Integer getPlatformType() { return platformType; } @@ -229,6 +242,7 @@ public class BsMerLedger implements Serializable { BsMerLedger other = (BsMerLedger) that; return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) && (this.getMerId() == null ? other.getMerId() == null : this.getMerId().equals(other.getMerId())) + && (this.getMerName() == null ? other.getMerName() == null : this.getMerName().equals(other.getMerName())) && (this.getPlatformType() == null ? other.getPlatformType() == null : this.getPlatformType().equals(other.getPlatformType())) && (this.getPlatformNo() == null ? other.getPlatformNo() == null : this.getPlatformNo().equals(other.getPlatformNo())) && (this.getCupNo() == null ? other.getCupNo() == null : this.getCupNo().equals(other.getCupNo())) @@ -251,6 +265,7 @@ public class BsMerLedger implements Serializable { int result = 1; result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); result = prime * result + ((getMerId() == null) ? 0 : getMerId().hashCode()); + result = prime * result + ((getMerName() == null) ? 0 : getMerName().hashCode()); result = prime * result + ((getPlatformType() == null) ? 0 : getPlatformType().hashCode()); result = prime * result + ((getPlatformNo() == null) ? 0 : getPlatformNo().hashCode()); result = prime * result + ((getCupNo() == null) ? 0 : getCupNo().hashCode()); @@ -276,6 +291,7 @@ public class BsMerLedger implements Serializable { sb.append("Hash = ").append(hashCode()); sb.append(", id=").append(id); sb.append(", merId=").append(merId); + sb.append(", merName=").append(merName); sb.append(", platformType=").append(platformType); sb.append(", platformNo=").append(platformNo); sb.append(", cupNo=").append(cupNo); diff --git a/service/src/main/java/com/hfkj/entity/BsMerLedgerExample.java b/service/src/main/java/com/hfkj/entity/BsMerLedgerExample.java index 4e81902..d05b6aa 100644 --- a/service/src/main/java/com/hfkj/entity/BsMerLedgerExample.java +++ b/service/src/main/java/com/hfkj/entity/BsMerLedgerExample.java @@ -246,6 +246,76 @@ public class BsMerLedgerExample { return (Criteria) this; } + public Criteria andMerNameIsNull() { + addCriterion("mer_name is null"); + return (Criteria) this; + } + + public Criteria andMerNameIsNotNull() { + addCriterion("mer_name is not null"); + return (Criteria) this; + } + + public Criteria andMerNameEqualTo(String value) { + addCriterion("mer_name =", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameNotEqualTo(String value) { + addCriterion("mer_name <>", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameGreaterThan(String value) { + addCriterion("mer_name >", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameGreaterThanOrEqualTo(String value) { + addCriterion("mer_name >=", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameLessThan(String value) { + addCriterion("mer_name <", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameLessThanOrEqualTo(String value) { + addCriterion("mer_name <=", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameLike(String value) { + addCriterion("mer_name like", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameNotLike(String value) { + addCriterion("mer_name not like", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameIn(List values) { + addCriterion("mer_name in", values, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameNotIn(List values) { + addCriterion("mer_name not in", values, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameBetween(String value1, String value2) { + addCriterion("mer_name between", value1, value2, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameNotBetween(String value1, String value2) { + addCriterion("mer_name not between", value1, value2, "merName"); + return (Criteria) this; + } + public Criteria andPlatformTypeIsNull() { addCriterion("platform_type is null"); return (Criteria) this; diff --git a/service/src/main/java/com/hfkj/service/BsMerLedgerService.java b/service/src/main/java/com/hfkj/service/BsMerLedgerService.java index 9852914..6940d02 100644 --- a/service/src/main/java/com/hfkj/service/BsMerLedgerService.java +++ b/service/src/main/java/com/hfkj/service/BsMerLedgerService.java @@ -1,8 +1,12 @@ package com.hfkj.service; import com.hfkj.entity.BsMerLedger; +import com.hfkj.entity.BsMerLedgerReceiver; import com.hfkj.sysenum.PlatformTypeEnum; +import java.util.List; +import java.util.Map; + /** * @className: BsMerLedgerService * @author: HuRui @@ -37,5 +41,11 @@ public interface BsMerLedgerService { */ BsMerLedger getMerLedgerById(Long id); + /** + * 查询商户分账列表 + * @param param + * @return + */ + List getMerLedgerList(Map param); } diff --git a/service/src/main/java/com/hfkj/service/impl/BsMerLedgerServiceImpl.java b/service/src/main/java/com/hfkj/service/impl/BsMerLedgerServiceImpl.java index 6624097..f5f257a 100644 --- a/service/src/main/java/com/hfkj/service/impl/BsMerLedgerServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/impl/BsMerLedgerServiceImpl.java @@ -6,6 +6,7 @@ import com.hfkj.entity.BsMerLedger; import com.hfkj.entity.BsMerLedgerExample; import com.hfkj.service.BsMerLedgerService; import com.hfkj.sysenum.PlatformTypeEnum; +import org.apache.commons.collections4.MapUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; @@ -13,6 +14,7 @@ import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; import java.util.Date; import java.util.List; +import java.util.Map; /** * @className: BsMerLedgerServiceImpl @@ -57,6 +59,7 @@ public class BsMerLedgerServiceImpl implements BsMerLedgerService { .andMerIdEqualTo(merId) .andStatusNotEqualTo(0) .andPlatformTypeEqualTo(platformType.getNumber()); + example.setOrderByClause("create_time desc"); List list = merLedgerMapper.selectByExample(example); if (list.size() > 0) { return list.get(0); @@ -68,4 +71,24 @@ public class BsMerLedgerServiceImpl implements BsMerLedgerService { public BsMerLedger getMerLedgerById(Long id) { return merLedgerMapper.selectByPrimaryKey(id); } + + @Override + public List getMerLedgerList(Map param) { + BsMerLedgerExample example = new BsMerLedgerExample(); + BsMerLedgerExample.Criteria criteria = example.createCriteria().andStatusNotEqualTo(0); + if (MapUtils.getInteger(param, "platformType") != null) { + criteria.andPlatformTypeEqualTo(MapUtils.getInteger(param, "platformType")); + } + + if (MapUtils.getInteger(param, "status") != null) { + criteria.andStatusEqualTo(MapUtils.getInteger(param, "status")); + } + + if (MapUtils.getBoolean(param, "receiverNoNotNull") != null) { + criteria.andReceiverNoIsNotNull(); + } + + example.setOrderByClause("create_time desc"); + return merLedgerMapper.selectByExample(example); + } }