From 30e7e70855c699bd5d3b06c18b71d87523201a09 Mon Sep 17 00:00:00 2001 From: whb <17803890193@163.com> Date: Wed, 19 Mar 2025 17:46:07 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E6=B5=8B=E8=AF=95=E4=B8=AD?= =?UTF-8?q?=E5=87=BA=E7=8E=B0=E7=9A=84=E6=8A=A5=E9=94=99=E9=97=AE=E9=A2=98?= =?UTF-8?q?=EF=BC=8C=E4=BF=AE=E6=94=B9=E5=AF=B9=E5=BA=94=E6=88=90=E7=BB=A9?= =?UTF-8?q?=E5=92=8C=E8=BF=9B=E5=BA=A6=E7=BB=9F=E8=AE=A1=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../stu/PersonalBankCardController.java | 9 +- .../bank/entity/CustomerInfoCreate.java | 17 ++ ...BankCardInformationAndCustomerInfoDTO.java | 19 ++ .../entity/dto/CustomerInfoCreateDTO.java | 12 + .../dto/PersonTakeOutInfoAnswerDTO.java | 5 - .../entity/dto/PersonTransferToInfoDTO.java | 37 ++-- .../bank/service/PersonalBankCardService.java | 5 +- ...BankAcceptanceBillBusinessServiceImpl.java | 77 ++++++- .../impl/BillTransactionSalfServieImpl.java | 58 ++++- .../impl/CurrentBusinessServiceImpl.java | 94 +++++++- ...tLetterOfCreditApplicationServiceImpl.java | 2 +- .../InternationalRemittanceServiceImpl.java | 61 ++++++ .../PaymentSettlementBusinessServiceImpl.java | 67 +++++- .../impl/PersonalBankCardServiceImpl.java | 139 +++++++++--- .../PersonalDepositWithdrawalServiceImpl.java | 206 +++++++++++++----- 15 files changed, 675 insertions(+), 133 deletions(-) create mode 100644 src/main/java/com/sztzjy/bank/entity/dto/BankCardInformationAndCustomerInfoDTO.java diff --git a/src/main/java/com/sztzjy/bank/controller/stu/PersonalBankCardController.java b/src/main/java/com/sztzjy/bank/controller/stu/PersonalBankCardController.java index acf7ead..fcefe71 100644 --- a/src/main/java/com/sztzjy/bank/controller/stu/PersonalBankCardController.java +++ b/src/main/java/com/sztzjy/bank/controller/stu/PersonalBankCardController.java @@ -3,6 +3,7 @@ package com.sztzjy.bank.controller.stu; import com.sztzjy.bank.annotation.AnonymousAccess; import com.sztzjy.bank.entity.BankCardInformation; import com.sztzjy.bank.entity.CustomerInformation; +import com.sztzjy.bank.entity.dto.BankCardInformationAndCustomerInfoDTO; import com.sztzjy.bank.service.PersonalBankCardService; import com.sztzjy.bank.util.ResultDataEntity; import com.sztzjy.bank.util.ResultEntity; @@ -16,7 +17,7 @@ import javax.validation.Valid; -@Api(tags = "个人银行卡业务") +@Api(tags = "个人银行卡业务-1") @RequestMapping("api/personBankCard") @RestController @Validated @@ -63,7 +64,7 @@ public class PersonalBankCardController { @AnonymousAccess @ApiOperation("开设银行卡-查询回显") @GetMapping(path = "getBaseInfoByCreateCard") - public ResultEntity getBaseInfoByCreateCard(@ApiParam("用户ID") String userId,Integer number) { + public ResultEntity getBaseInfoByCreateCard(@ApiParam("用户ID") String userId, Integer number) { return personalBankCardService.getBaseInfoByCreateCard(userId,number); @@ -72,9 +73,9 @@ public class PersonalBankCardController { @AnonymousAccess @ApiOperation("开设银行卡-证件号码查询") @GetMapping(path = "getCardInfoByUserId") - public ResultDataEntity getCardInfoByUserId(@ApiParam("用户ID") String userId,Integer number,@ApiParam("证件号码")String code) { + public ResultDataEntity getCardInfoByUserId(@ApiParam("用户ID") String userId,Integer number,@ApiParam("证件号码")String code,@ApiParam("证件类型") String type) { - return personalBankCardService.getCardInfoByUserId(userId,number,code); + return personalBankCardService.getCardInfoByUserId(userId,number,code,type); } diff --git a/src/main/java/com/sztzjy/bank/entity/CustomerInfoCreate.java b/src/main/java/com/sztzjy/bank/entity/CustomerInfoCreate.java index 6b5cff9..186e370 100644 --- a/src/main/java/com/sztzjy/bank/entity/CustomerInfoCreate.java +++ b/src/main/java/com/sztzjy/bank/entity/CustomerInfoCreate.java @@ -2,7 +2,10 @@ package com.sztzjy.bank.entity; import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModelProperty; +import org.springframework.format.annotation.DateTimeFormat; + /** * 客户信息建立 * @@ -38,12 +41,18 @@ public class CustomerInfoCreate { private String taxpayerQualification; @ApiModelProperty(notes = "成立日期") + @DateTimeFormat(pattern = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") private Date establishmentDate; @ApiModelProperty(notes = "核准日期") + @DateTimeFormat(pattern = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") private Date approvalDate; @ApiModelProperty(notes = "营业开始日") + @DateTimeFormat(pattern = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") private Date businessStartDate; @ApiModelProperty(notes = "营业终止日") @@ -92,9 +101,13 @@ public class CustomerInfoCreate { private String validityType; @ApiModelProperty(notes = "有效开始日") + @DateTimeFormat(pattern = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") private Date validityStartDate; @ApiModelProperty(notes = "有效终止日") + @DateTimeFormat(pattern = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") private Date validityEndDate; @ApiModelProperty(notes = "联系人") @@ -113,9 +126,13 @@ public class CustomerInfoCreate { private String customerNumber; @ApiModelProperty(notes = "创建时间") + @DateTimeFormat(pattern = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") private Date createTime; @ApiModelProperty(notes = "更新时间") + @DateTimeFormat(pattern = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") private Date updateTime; @ApiModelProperty(notes = "提交状态(1已提交 : 0未提交)") diff --git a/src/main/java/com/sztzjy/bank/entity/dto/BankCardInformationAndCustomerInfoDTO.java b/src/main/java/com/sztzjy/bank/entity/dto/BankCardInformationAndCustomerInfoDTO.java new file mode 100644 index 0000000..7654ca4 --- /dev/null +++ b/src/main/java/com/sztzjy/bank/entity/dto/BankCardInformationAndCustomerInfoDTO.java @@ -0,0 +1,19 @@ +package com.sztzjy.bank.entity.dto; + +import com.sztzjy.bank.entity.BankCardInformation; +import com.sztzjy.bank.entity.CustomerInformation; +import lombok.Data; + +/** + * @author 17803 + * @date 2025-03-19 14:02 + */ +@Data +public class BankCardInformationAndCustomerInfoDTO { + + + private CustomerInformation customerInformation; + + private BankCardInformation bankCardInformation; + +} diff --git a/src/main/java/com/sztzjy/bank/entity/dto/CustomerInfoCreateDTO.java b/src/main/java/com/sztzjy/bank/entity/dto/CustomerInfoCreateDTO.java index 34adba1..3defc1e 100644 --- a/src/main/java/com/sztzjy/bank/entity/dto/CustomerInfoCreateDTO.java +++ b/src/main/java/com/sztzjy/bank/entity/dto/CustomerInfoCreateDTO.java @@ -1,7 +1,9 @@ package com.sztzjy.bank.entity.dto; +import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; import java.util.Date; @@ -39,11 +41,17 @@ public class CustomerInfoCreateDTO { private String taxpayerQualification; @ApiModelProperty(notes = "成立日期") + @DateTimeFormat(pattern = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") private Date establishmentDate; @ApiModelProperty(notes = "核准日期") + @DateTimeFormat(pattern = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") private Date approvalDate; @ApiModelProperty(notes = "营业开始日") + @DateTimeFormat(pattern = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") private Date businessStartDate; @ApiModelProperty(notes = "营业终止日") @@ -91,9 +99,13 @@ public class CustomerInfoCreateDTO { private String validityType; @ApiModelProperty(notes = "有效开始日") + @DateTimeFormat(pattern = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") private Date validityStartDate; @ApiModelProperty(notes = "有效终止日") + @DateTimeFormat(pattern = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") private Date validityEndDate; diff --git a/src/main/java/com/sztzjy/bank/entity/dto/PersonTakeOutInfoAnswerDTO.java b/src/main/java/com/sztzjy/bank/entity/dto/PersonTakeOutInfoAnswerDTO.java index 7c42ae8..41125ea 100644 --- a/src/main/java/com/sztzjy/bank/entity/dto/PersonTakeOutInfoAnswerDTO.java +++ b/src/main/java/com/sztzjy/bank/entity/dto/PersonTakeOutInfoAnswerDTO.java @@ -10,11 +10,6 @@ import lombok.Data; @Data public class PersonTakeOutInfoAnswerDTO { - @ApiModelProperty(notes = "卡号") - private String cardNumber; - - @ApiModelProperty(notes = "刷卡密码") - private String cardPwd; @ApiModelProperty(notes = "币种") private String currency; diff --git a/src/main/java/com/sztzjy/bank/entity/dto/PersonTransferToInfoDTO.java b/src/main/java/com/sztzjy/bank/entity/dto/PersonTransferToInfoDTO.java index 2670921..ce7a992 100644 --- a/src/main/java/com/sztzjy/bank/entity/dto/PersonTransferToInfoDTO.java +++ b/src/main/java/com/sztzjy/bank/entity/dto/PersonTransferToInfoDTO.java @@ -12,11 +12,11 @@ import lombok.Data; public class PersonTransferToInfoDTO { - @ApiModelProperty(notes = "卡号") - private String cardNumber; - - @ApiModelProperty(notes = "刷卡密码") - private String cardPwd; +// @ApiModelProperty(notes = "卡号") +// private String cardNumber; +// +// @ApiModelProperty(notes = "刷卡密码") +// private String cardPwd; @ApiModelProperty(notes = "币种") private String currency; @@ -25,21 +25,26 @@ public class PersonTransferToInfoDTO { private String currencyExchSymbol; - @ApiModelProperty(notes = "转入卡号") - private String transferCardNumber; - @ApiModelProperty(notes = "转账金额") private String transferAccountsAmount; - @ApiModelProperty(notes = "转入开户银行") - private String transferToAccountOpenBank; - - @ApiModelProperty(notes = "转入户名") - private String transferToUserName; - - @ApiModelProperty(notes = "手续费") - private String commission; @ApiModelProperty(notes = "收费状态") private String chargingStatus; +// +// @ApiModelProperty(notes = "转入卡号") +// private String transferCardNumber; + + +// +// @ApiModelProperty(notes = "转入开户银行") +// private String transferToAccountOpenBank; +// +// @ApiModelProperty(notes = "转入户名") +// private String transferToUserName; +// +// @ApiModelProperty(notes = "手续费") +// private String commission; + + } diff --git a/src/main/java/com/sztzjy/bank/service/PersonalBankCardService.java b/src/main/java/com/sztzjy/bank/service/PersonalBankCardService.java index 5d917ce..b2412be 100644 --- a/src/main/java/com/sztzjy/bank/service/PersonalBankCardService.java +++ b/src/main/java/com/sztzjy/bank/service/PersonalBankCardService.java @@ -2,6 +2,7 @@ package com.sztzjy.bank.service; import com.sztzjy.bank.entity.BankCardInformation; import com.sztzjy.bank.entity.CustomerInformation; +import com.sztzjy.bank.entity.dto.BankCardInformationAndCustomerInfoDTO; import com.sztzjy.bank.util.ResultDataEntity; import com.sztzjy.bank.util.ResultEntity; @@ -43,7 +44,7 @@ public interface PersonalBankCardService { * @return */ - ResultEntity getBaseInfoByCreateCard(String userId, Integer number); + ResultEntity getBaseInfoByCreateCard(String userId, Integer number); /** @@ -54,5 +55,5 @@ public interface PersonalBankCardService { * @return */ - ResultDataEntity getCardInfoByUserId(String userId, Integer number, String code); + ResultDataEntity getCardInfoByUserId(String userId, Integer number, String code,String type); } diff --git a/src/main/java/com/sztzjy/bank/service/impl/BankAcceptanceBillBusinessServiceImpl.java b/src/main/java/com/sztzjy/bank/service/impl/BankAcceptanceBillBusinessServiceImpl.java index 9217bb4..9e489af 100644 --- a/src/main/java/com/sztzjy/bank/service/impl/BankAcceptanceBillBusinessServiceImpl.java +++ b/src/main/java/com/sztzjy/bank/service/impl/BankAcceptanceBillBusinessServiceImpl.java @@ -2,6 +2,7 @@ package com.sztzjy.bank.service.impl; import cn.hutool.core.util.IdUtil; import com.alibaba.fastjson.JSON; +import com.sztzjy.bank.config.exception.handler.ServiceException; import com.sztzjy.bank.entity.*; import com.sztzjy.bank.entity.dto.FinancialBillsDTO; import com.sztzjy.bank.entity.dto.FinancialBillsLossParamDTO; @@ -9,6 +10,7 @@ import com.sztzjy.bank.entity.dto.FinancialBillsParamDTO; import com.sztzjy.bank.mapper.BankAcceptanceBillBusinessMapper; import com.sztzjy.bank.mapper.CaseAnswerInfoMapper; import com.sztzjy.bank.mapper.CaseInfoMapper; +import com.sztzjy.bank.mapper.OperationProcessMapper; import com.sztzjy.bank.service.BankAcceptanceBillBusinessService; import com.sztzjy.bank.util.RedisUtil; import com.sztzjy.bank.util.ResultEntity; @@ -42,6 +44,9 @@ public class BankAcceptanceBillBusinessServiceImpl implements BankAcceptanceBill @Autowired private CaseAnswerInfoMapper caseAnswerInfoMapper; + @Autowired + OperationProcessMapper operationProcessMapper; + //银行承兑开票 @Override @@ -57,6 +62,12 @@ public class BankAcceptanceBillBusinessServiceImpl implements BankAcceptanceBill bankAcceptanceBillBusiness.setId(IdUtil.simpleUUID()); if (bankAcceptanceBillBusiness.getSubState() == 1) { + + //判断用户是否完成上一个流程,并更新操作步骤序号 + if (!ProcessJudgment(1, bankAcceptanceBillBusiness.getUserId(), "银行承兑汇票业务")) { + throw new ServiceException(HttpStatus.ACCEPTED, "请先完成上一流程"); + } + bankAcceptanceBillBusiness = submitBytradeAcceptance(bankAcceptanceBillBusiness); } @@ -74,6 +85,12 @@ public class BankAcceptanceBillBusinessServiceImpl implements BankAcceptanceBill } if (bankAcceptanceBillBusiness.getSubState() == 1) { + + //判断用户是否完成上一个流程,并更新操作步骤序号 + if (!ProcessJudgment(1, bankAcceptanceBillBusiness.getUserId(), "银行承兑汇票业务")) { + throw new ServiceException(HttpStatus.ACCEPTED, "请先完成上一流程"); + } + bankAcceptanceBillBusiness = submitBytradeAcceptance(bankAcceptanceBillBusiness); } @@ -121,6 +138,14 @@ public class BankAcceptanceBillBusinessServiceImpl implements BankAcceptanceBill if (CollectionUtils.isEmpty(informationList)) { + + //判断用户是否完成上一个流程,并更新操作步骤序号 + if (!ProcessJudgment(2, financialBillsParamDTO.getUserId(), "银行承兑汇票业务")) { + throw new ServiceException(HttpStatus.ACCEPTED, "请先完成上一流程"); + } + + + return new ResultEntity<>(HttpStatus.OK); }else { BankAcceptanceBillBusiness financialBills = informationList.get(0); @@ -128,6 +153,11 @@ public class BankAcceptanceBillBusinessServiceImpl implements BankAcceptanceBill //二次提交 if (financialBills.getSubState()==1) { + //判断用户是否完成上一个流程,并更新操作步骤序号 + if (!ProcessJudgment(2, financialBillsParamDTO.getUserId(), "银行承兑汇票业务")) { + throw new ServiceException(HttpStatus.ACCEPTED, "请先完成上一流程"); + } + return new ResultEntity<>(HttpStatus.OK,"提交成功!",2); } @@ -138,7 +168,8 @@ public class BankAcceptanceBillBusinessServiceImpl implements BankAcceptanceBill String answer = redisUtil.get("bank" + "-银行承兑汇票业务" + "-挂失止付"); if (answer == null) { CaseInfoExample caseInfoExample = new CaseInfoExample(); - caseInfoExample.createCriteria().andLargeModuleEqualTo("商业承兑汇票业务") + // caseInfoExample.createCriteria().andLargeModuleEqualTo("商业承兑汇票业务") + caseInfoExample.createCriteria().andLargeModuleEqualTo("银行承兑汇票业务") .andModuleEqualTo("挂失止付") .andNumberEqualTo(financialBills.getNumber()); List caseInfoList = caseInfoMapper.selectByExampleWithBLOBs(caseInfoExample); @@ -207,6 +238,16 @@ public class BankAcceptanceBillBusinessServiceImpl implements BankAcceptanceBill if (CollectionUtils.isEmpty(informationList)) { + + //判断用户是否完成上一个流程,并更新操作步骤序号 + if (!ProcessJudgment(3, financialBillsLossParamDTO.getUserId(), "银行承兑汇票业务")) { + throw new ServiceException(HttpStatus.ACCEPTED, "请先完成上一流程"); + } + + + + + return new ResultEntity<>(HttpStatus.OK); }else { BankAcceptanceBillBusiness financialBills = informationList.get(0); @@ -214,6 +255,11 @@ public class BankAcceptanceBillBusinessServiceImpl implements BankAcceptanceBill //二次提交 if (financialBills.getSubState()==1) { + //判断用户是否完成上一个流程,并更新操作步骤序号 + if (!ProcessJudgment(3, financialBillsLossParamDTO.getUserId(), "银行承兑汇票业务")) { + throw new ServiceException(HttpStatus.ACCEPTED, "请先完成上一流程"); + } + return new ResultEntity<>(HttpStatus.OK,"提交成功!",2); } @@ -429,4 +475,33 @@ public class BankAcceptanceBillBusinessServiceImpl implements BankAcceptanceBill return bankAcceptanceBillBusiness; } + + /* 下面为此类公共方法 + * @author xcj + * @Date 2025/3/13 + */ + + //判断用户操作流程 + public boolean ProcessJudgment(Integer number, String userId, String largeModule) { + OperationProcessExample example = new OperationProcessExample(); + example.createCriteria().andUserIdEqualTo(userId).andLargeModuleEqualTo(largeModule); + List operationProcesses = operationProcessMapper.selectByExample(example); + + if (operationProcesses.isEmpty()) { + OperationProcess operationProcess = new OperationProcess(userId, largeModule); + operationProcessMapper.insert(operationProcess); + + operationProcesses.add(operationProcess); + } + + OperationProcess operationProcess = operationProcesses.get(0); + + if (number == operationProcess.getCompletedStepsNumber() + 1) { //需要进行更新操作 + operationProcess.setCompletedStepsNumber(number); + + operationProcessMapper.updateByPrimaryKey(operationProcess); + } + + return number <= operationProcess.getCompletedStepsNumber() + 1; + } } diff --git a/src/main/java/com/sztzjy/bank/service/impl/BillTransactionSalfServieImpl.java b/src/main/java/com/sztzjy/bank/service/impl/BillTransactionSalfServieImpl.java index 2d7a94a..e912a97 100644 --- a/src/main/java/com/sztzjy/bank/service/impl/BillTransactionSalfServieImpl.java +++ b/src/main/java/com/sztzjy/bank/service/impl/BillTransactionSalfServieImpl.java @@ -2,14 +2,12 @@ package com.sztzjy.bank.service.impl; import cn.hutool.core.util.IdUtil; import com.alibaba.fastjson.JSON; +import com.sztzjy.bank.config.exception.handler.ServiceException; import com.sztzjy.bank.entity.*; import com.sztzjy.bank.entity.dto.BillTransactionRedemptionDTO; import com.sztzjy.bank.entity.dto.BillTransactionSalfDTO; import com.sztzjy.bank.entity.dto.FinancialBillsDTO; -import com.sztzjy.bank.mapper.BillTransactionRedemptionMapper; -import com.sztzjy.bank.mapper.BillTransactionSalfMapper; -import com.sztzjy.bank.mapper.CaseAnswerInfoMapper; -import com.sztzjy.bank.mapper.CaseInfoMapper; +import com.sztzjy.bank.mapper.*; import com.sztzjy.bank.service.BillTransactionSalfServie; import com.sztzjy.bank.util.RedisUtil; import com.sztzjy.bank.util.ResultEntity; @@ -46,6 +44,38 @@ public class BillTransactionSalfServieImpl implements BillTransactionSalfServie private BillTransactionRedemptionMapper billTransactionRedemptionMapper; + @Autowired + private OperationProcessMapper operationProcessMapper; + + /* 下面为此类公共方法 + * @author xcj + * @Date 2025/3/13 + */ + + //判断用户操作流程 + public boolean ProcessJudgment(Integer number, String userId, String largeModule) { + OperationProcessExample example = new OperationProcessExample(); + example.createCriteria().andUserIdEqualTo(userId).andLargeModuleEqualTo(largeModule); + List operationProcesses = operationProcessMapper.selectByExample(example); + + if (operationProcesses.isEmpty()) { + OperationProcess operationProcess = new OperationProcess(userId, largeModule); + operationProcessMapper.insert(operationProcess); + + operationProcesses.add(operationProcess); + } + + OperationProcess operationProcess = operationProcesses.get(0); + + if (number == operationProcess.getCompletedStepsNumber() + 1) { //需要进行更新操作 + operationProcess.setCompletedStepsNumber(number); + + operationProcessMapper.updateByPrimaryKey(operationProcess); + } + + return number <= operationProcess.getCompletedStepsNumber() + 1; + } + //银行支票结算业务-出售 @Override public ResultEntity salf(BillTransactionSalf billTransactionSalf) { @@ -60,6 +90,12 @@ public class BillTransactionSalfServieImpl implements BillTransactionSalfServie billTransactionSalf.setId(IdUtil.simpleUUID()); if (billTransactionSalf.getSubState() == 1) { + //判断用户是否完成上一个流程,并更新操作步骤序号 + if (!ProcessJudgment(1, billTransactionSalf.getUserId(), "银行支票结算业务")) { + throw new ServiceException(HttpStatus.ACCEPTED, "请先完成上一流程"); + } + + billTransactionSalf = submitBySalf(billTransactionSalf); } @@ -77,6 +113,10 @@ public class BillTransactionSalfServieImpl implements BillTransactionSalfServie } if (billTransactionSalf.getSubState() == 1) { + //判断用户是否完成上一个流程,并更新操作步骤序号 + if (!ProcessJudgment(1, billTransactionSalf.getUserId(), "银行支票结算业务")) { + throw new ServiceException(HttpStatus.ACCEPTED, "请先完成上一流程"); + } billTransactionSalf = submitBySalf(billTransactionSalf); } @@ -128,6 +168,12 @@ public class BillTransactionSalfServieImpl implements BillTransactionSalfServie billTransactionSalf.setId(IdUtil.simpleUUID()); if (billTransactionSalf.getSubState() == 1) { + + //判断用户是否完成上一个流程,并更新操作步骤序号 + if (!ProcessJudgment(2, billTransactionSalf.getUserId(), "银行支票结算业务")) { + throw new ServiceException(HttpStatus.ACCEPTED, "请先完成上一流程"); + } + billTransactionSalf = submitByRedemption(billTransactionSalf); } @@ -146,6 +192,10 @@ public class BillTransactionSalfServieImpl implements BillTransactionSalfServie } if (billTransactionSalf.getSubState() == 1) { + //判断用户是否完成上一个流程,并更新操作步骤序号 + if (!ProcessJudgment(2, billTransactionSalf.getUserId(), "银行支票结算业务")) { + throw new ServiceException(HttpStatus.ACCEPTED, "请先完成上一流程"); + } billTransactionSalf = submitByRedemption(billTransactionSalf); } diff --git a/src/main/java/com/sztzjy/bank/service/impl/CurrentBusinessServiceImpl.java b/src/main/java/com/sztzjy/bank/service/impl/CurrentBusinessServiceImpl.java index cf627c1..f8cff73 100644 --- a/src/main/java/com/sztzjy/bank/service/impl/CurrentBusinessServiceImpl.java +++ b/src/main/java/com/sztzjy/bank/service/impl/CurrentBusinessServiceImpl.java @@ -2,7 +2,9 @@ package com.sztzjy.bank.service.impl; import cn.hutool.core.convert.Convert; import cn.hutool.core.util.IdUtil; +import cn.hutool.core.util.RandomUtil; import com.alibaba.fastjson.JSON; +import com.sztzjy.bank.config.exception.handler.ServiceException; import com.sztzjy.bank.entity.*; import com.sztzjy.bank.entity.dto.*; import com.sztzjy.bank.mapper.*; @@ -44,7 +46,37 @@ public class CurrentBusinessServiceImpl implements CurrentBusinessService { @Autowired private CorporateCurrentDepositMapper corporateCurrentDepositMapper; + @Autowired + private OperationProcessMapper operationProcessMapper; + + /* 下面为此类公共方法 + * @author xcj + * @Date 2025/3/13 + */ + + //判断用户操作流程 + public boolean ProcessJudgment(Integer number, String userId, String largeModule) { + OperationProcessExample example = new OperationProcessExample(); + example.createCriteria().andUserIdEqualTo(userId).andLargeModuleEqualTo(largeModule); + List operationProcesses = operationProcessMapper.selectByExample(example); + + if (operationProcesses.isEmpty()) { + OperationProcess operationProcess = new OperationProcess(userId, largeModule); + operationProcessMapper.insert(operationProcess); + operationProcesses.add(operationProcess); + } + + OperationProcess operationProcess = operationProcesses.get(0); + + if (number == operationProcess.getCompletedStepsNumber() + 1) { //需要进行更新操作 + operationProcess.setCompletedStepsNumber(number); + + operationProcessMapper.updateByPrimaryKey(operationProcess); + } + + return number <= operationProcess.getCompletedStepsNumber() + 1; + } @@ -63,13 +95,21 @@ public class CurrentBusinessServiceImpl implements CurrentBusinessService { if (customerInfoCreate.getSubState()==1) { + //判断用户是否完成上一个流程,并更新操作步骤序号 + if (!ProcessJudgment(1, customerInfoCreate.getUserId(), "对公活期业务")) { + throw new ServiceException(HttpStatus.ACCEPTED, "请先完成上一流程"); + } customerInfoCreate = submitsubmitByCustomerCreate(customerInfoCreate); + //客户号 + String string = RandomUtil.randomString("123456789", 10); + customerInfoCreate.setCustomerNumber(string); + } //数据保存 customerInfoCreateMapper.insertSelective(customerInfoCreate); - return new ResultEntity<>(HttpStatus.OK); + return new ResultEntity<>(HttpStatus.OK,customerInfoCreate.getCustomerNumber()); }else { CustomerInfoCreate information = informationList.get(0); @@ -82,10 +122,16 @@ public class CurrentBusinessServiceImpl implements CurrentBusinessService { if (customerInfoCreate.getSubState()==1) { + //判断用户是否完成上一个流程,并更新操作步骤序号 + if (!ProcessJudgment(1, customerInfoCreate.getUserId(), "对公活期业务")) { + throw new ServiceException(HttpStatus.ACCEPTED, "请先完成上一流程"); + } customerInfoCreate = submitsubmitByCustomerCreate(customerInfoCreate); + //客户号 + String string = RandomUtil.randomString("123456789", 10); + customerInfoCreate.setCustomerNumber(string); } - String id = information.getId(); BeanUtils.copyProperties(customerInfoCreate, information); @@ -93,7 +139,7 @@ public class CurrentBusinessServiceImpl implements CurrentBusinessService { information.setId(id); customerInfoCreateMapper.updateByPrimaryKeySelective(information); - return new ResultEntity<>(HttpStatus.OK,"提交成功",1); + return new ResultEntity<>(HttpStatus.OK,customerInfoCreate.getCustomerNumber()); } } @@ -146,6 +192,11 @@ public class CurrentBusinessServiceImpl implements CurrentBusinessService { if (currentAccount.getSubState()==1) { + + //判断用户是否完成上一个流程,并更新操作步骤序号 + if (!ProcessJudgment(2, currentAccount.getUserId(), "对公活期业务")) { + throw new ServiceException(HttpStatus.ACCEPTED, "请先完成上一流程"); + } currentAccount =submitToCaculateByCurrentAccount(currentAccount); } @@ -165,6 +216,10 @@ public class CurrentBusinessServiceImpl implements CurrentBusinessService { if (currentAccount.getSubState()==1) { + //判断用户是否完成上一个流程,并更新操作步骤序号 + if (!ProcessJudgment(2, currentAccount.getUserId(), "对公活期业务")) { + throw new ServiceException(HttpStatus.ACCEPTED, "请先完成上一流程"); + } currentAccount = submitToCaculateByCurrentAccount(currentAccount); } @@ -179,9 +234,6 @@ public class CurrentBusinessServiceImpl implements CurrentBusinessService { return new ResultEntity<>(HttpStatus.OK,"提交成功",1); } - - - } //开设活期账户-查询回显 @@ -233,6 +285,10 @@ public class CurrentBusinessServiceImpl implements CurrentBusinessService { if (corporateCurrentDeposit.getSubState()==1) { + //判断用户是否完成上一个流程,并更新操作步骤序号 + if (!ProcessJudgment(3, corporateCurrentDeposit.getUserId(), "对公活期业务")) { + throw new ServiceException(HttpStatus.ACCEPTED, "请先完成上一流程"); + } corporateCurrentDeposit =submitToCaculateByCorporateCurrentDeposit(corporateCurrentDeposit); } @@ -255,6 +311,10 @@ public class CurrentBusinessServiceImpl implements CurrentBusinessService { if (corporateCurrentDeposit.getSubState()==1) { + //判断用户是否完成上一个流程,并更新操作步骤序号 + if (!ProcessJudgment(3, corporateCurrentDeposit.getUserId(), "对公活期业务")) { + throw new ServiceException(HttpStatus.ACCEPTED, "请先完成上一流程"); + } corporateCurrentDeposit = submitToCaculateByCorporateCurrentDeposit(corporateCurrentDeposit); } @@ -404,6 +464,10 @@ public class CurrentBusinessServiceImpl implements CurrentBusinessService { if (customerInfoCreate.getSubState()==1) { + //判断用户是否完成上一个流程,并更新操作步骤序号 + if (!ProcessJudgment(4, customerInfoCreate.getUserId(), "对公活期业务")) { + throw new ServiceException(HttpStatus.ACCEPTED, "请先完成上一流程"); + } customerInfoCreate = submitsubmitByCorporateCurrentTransfer(customerInfoCreate); } @@ -427,6 +491,10 @@ public class CurrentBusinessServiceImpl implements CurrentBusinessService { if (customerInfoCreate.getSubState()==1) { + //判断用户是否完成上一个流程,并更新操作步骤序号 + if (!ProcessJudgment(4, customerInfoCreate.getUserId(), "对公活期业务")) { + throw new ServiceException(HttpStatus.ACCEPTED, "请先完成上一流程"); + } customerInfoCreate = submitsubmitByCorporateCurrentTransfer(customerInfoCreate); } @@ -478,6 +546,10 @@ public class CurrentBusinessServiceImpl implements CurrentBusinessService { if (corporateCurrentWithdrawal.getSubState()==1) { + //判断用户是否完成上一个流程,并更新操作步骤序号 + if (!ProcessJudgment(5, corporateCurrentWithdrawal.getUserId(), "对公活期业务")) { + throw new ServiceException(HttpStatus.ACCEPTED, "请先完成上一流程"); + } corporateCurrentWithdrawal = submitsubmitByCorporateCurrentWithdrawal(corporateCurrentWithdrawal); } @@ -501,6 +573,10 @@ public class CurrentBusinessServiceImpl implements CurrentBusinessService { if (corporateCurrentWithdrawal.getSubState()==1) { + //判断用户是否完成上一个流程,并更新操作步骤序号 + if (!ProcessJudgment(5, corporateCurrentWithdrawal.getUserId(), "对公活期业务")) { + throw new ServiceException(HttpStatus.ACCEPTED, "请先完成上一流程"); + } corporateCurrentWithdrawal = submitsubmitByCorporateCurrentWithdrawal(corporateCurrentWithdrawal); } @@ -884,7 +960,7 @@ public class CurrentBusinessServiceImpl implements CurrentBusinessService { private CustomerInfoCreate submitsubmitByCustomerCreate(CustomerInfoCreate customerInfoCreate) { - String answer = redisUtil.get("bank" + "-对公活期业务" + "-客户信息建立"); + String answer = redisUtil.get("bank" + "-对公活期业务" + "-客户信息建立"+"-"+customerInfoCreate.getNumber()); if (answer == null) { CaseInfoExample caseInfoExample = new CaseInfoExample(); caseInfoExample.createCriteria().andLargeModuleEqualTo("对公活期业务") @@ -898,8 +974,8 @@ public class CurrentBusinessServiceImpl implements CurrentBusinessService { List answerInfoList = caseAnswerInfoMapper.selectByExampleWithBLOBs(caseAnswerInfoExample); if (!CollectionUtils.isEmpty(answerInfoList)) { String info = answerInfoList.get(0).getAnswer(); - redisUtil.set("bank" + "-对公活期业务" + "-客户信息建立",info,3600); - answer=redisUtil.get("bank" + "-对公活期业务" + "-客户信息建立"); + redisUtil.set("bank" + "-对公活期业务" + "-客户信息建立"+"-"+customerInfoCreate.getNumber(),info,3600); + answer=redisUtil.get("bank" + "-对公活期业务" + "-客户信息建立"+"-"+customerInfoCreate.getNumber()); } } } diff --git a/src/main/java/com/sztzjy/bank/service/impl/ExportLetterOfCreditApplicationServiceImpl.java b/src/main/java/com/sztzjy/bank/service/impl/ExportLetterOfCreditApplicationServiceImpl.java index fa67e2f..6c77fe0 100644 --- a/src/main/java/com/sztzjy/bank/service/impl/ExportLetterOfCreditApplicationServiceImpl.java +++ b/src/main/java/com/sztzjy/bank/service/impl/ExportLetterOfCreditApplicationServiceImpl.java @@ -65,7 +65,7 @@ public class ExportLetterOfCreditApplicationServiceImpl implements ExportLetterO if (exportLetterOfCreditApplication.getSubmitStatus() == 1) { //提交则计算错误次数 //判断用户是否完成上一个流程,并更新操作步骤序号 - if (!ProcessJudgment(1, exportLetterOfCreditApplication.getUserId(), "出口信用证业务")) { + if (!ProcessJudgment(1, exportLetterOfCreditApplication.getUserId(), "出口信用证业务")) { throw new ServiceException(HttpStatus.ACCEPTED, "请先完成上一流程"); } diff --git a/src/main/java/com/sztzjy/bank/service/impl/InternationalRemittanceServiceImpl.java b/src/main/java/com/sztzjy/bank/service/impl/InternationalRemittanceServiceImpl.java index 0b84291..22a9329 100644 --- a/src/main/java/com/sztzjy/bank/service/impl/InternationalRemittanceServiceImpl.java +++ b/src/main/java/com/sztzjy/bank/service/impl/InternationalRemittanceServiceImpl.java @@ -2,6 +2,7 @@ package com.sztzjy.bank.service.impl; import cn.hutool.core.util.IdUtil; import com.alibaba.fastjson.JSON; +import com.sztzjy.bank.config.exception.handler.ServiceException; import com.sztzjy.bank.entity.*; import com.sztzjy.bank.entity.dto.BillTransactionSalfDTO; import com.sztzjy.bank.entity.dto.InternationalRemittanceDTO; @@ -43,6 +44,38 @@ public class InternationalRemittanceServiceImpl implements InternationalRemittan @Autowired private CaseAnswerInfoMapper caseAnswerInfoMapper; + @Autowired + private OperationProcessMapper operationProcessMapper; + /* 下面为此类公共方法 + * @author xcj + * @Date 2025/3/13 + */ + + //判断用户操作流程 + public boolean ProcessJudgment(Integer number, String userId, String largeModule) { + OperationProcessExample example = new OperationProcessExample(); + example.createCriteria().andUserIdEqualTo(userId).andLargeModuleEqualTo(largeModule); + List operationProcesses = operationProcessMapper.selectByExample(example); + + if (operationProcesses.isEmpty()) { + OperationProcess operationProcess = new OperationProcess(userId, largeModule); + operationProcessMapper.insert(operationProcess); + + operationProcesses.add(operationProcess); + } + + OperationProcess operationProcess = operationProcesses.get(0); + + if (number == operationProcess.getCompletedStepsNumber() + 1) { //需要进行更新操作 + operationProcess.setCompletedStepsNumber(number); + + operationProcessMapper.updateByPrimaryKey(operationProcess); + } + + return number <= operationProcess.getCompletedStepsNumber() + 1; + } + + // @Autowired // private @@ -77,6 +110,11 @@ public class InternationalRemittanceServiceImpl implements InternationalRemittan internationalRemittance.setRecordId(IdUtil.simpleUUID()); if (internationalRemittance.getSubmitStatus() == 1) { + + //判断用户是否完成上一个流程,并更新操作步骤序号 + if (!ProcessJudgment(2, internationalRemittance.getUserId(), "汇入汇款业务")) { + throw new ServiceException(HttpStatus.ACCEPTED, "请先完成上一流程"); + } internationalRemittance = submitByNoticeInfo(internationalRemittance); } @@ -95,6 +133,10 @@ public class InternationalRemittanceServiceImpl implements InternationalRemittan } if (internationalRemittance.getSubmitStatus() == 1) { + //判断用户是否完成上一个流程,并更新操作步骤序号 + if (!ProcessJudgment(2, internationalRemittance.getUserId(), "汇入汇款业务")) { + throw new ServiceException(HttpStatus.ACCEPTED, "请先完成上一流程"); + } internationalRemittance = submitByNoticeInfo(internationalRemittance); } @@ -135,6 +177,11 @@ public class InternationalRemittanceServiceImpl implements InternationalRemittan List informationList = internationalRemittanceMapper.selectByExample(example); if (CollectionUtils.isEmpty(informationList)) { + + //判断用户是否完成上一个流程,并更新操作步骤序号 + if (!ProcessJudgment(3, userId, "汇入汇款业务")) { + throw new ServiceException(HttpStatus.ACCEPTED, "请先完成上一流程"); + } return new ResultEntity<>(HttpStatus.OK); }else { @@ -143,6 +190,12 @@ public class InternationalRemittanceServiceImpl implements InternationalRemittan //第一次提交 if (informationList.get(0).getClientSignature().equals(sign)) { + + //判断用户是否完成上一个流程,并更新操作步骤序号 + if (!ProcessJudgment(3, userId, "汇入汇款业务")) { + throw new ServiceException(HttpStatus.ACCEPTED, "请先完成上一流程"); + } + informationList.get(0).setReceiptSignUser(sign); internationalRemittanceMapper.updateByPrimaryKey(informationList.get(0)); return new ResultEntity(HttpStatus.OK,"提交成功!"); @@ -179,6 +232,10 @@ public class InternationalRemittanceServiceImpl implements InternationalRemittan inwardRemittance.setId(IdUtil.simpleUUID()); if (inwardRemittance.getSubmitStatus() == 1) { + //判断用户是否完成上一个流程,并更新操作步骤序号 + if (!ProcessJudgment(4, inwardRemittance.getUserId(), "汇入汇款业务")) { + throw new ServiceException(HttpStatus.ACCEPTED, "请先完成上一流程"); + } inwardRemittance = submitBycreditNoteInfo(inwardRemittance); } @@ -197,6 +254,10 @@ public class InternationalRemittanceServiceImpl implements InternationalRemittan } if (inwardRemittance.getSubmitStatus() == 1) { + //判断用户是否完成上一个流程,并更新操作步骤序号 + if (!ProcessJudgment(4, inwardRemittance.getUserId(), "汇入汇款业务")) { + throw new ServiceException(HttpStatus.ACCEPTED, "请先完成上一流程"); + } inwardRemittance = submitBycreditNoteInfo(inwardRemittance); } diff --git a/src/main/java/com/sztzjy/bank/service/impl/PaymentSettlementBusinessServiceImpl.java b/src/main/java/com/sztzjy/bank/service/impl/PaymentSettlementBusinessServiceImpl.java index 874c503..2e52332 100644 --- a/src/main/java/com/sztzjy/bank/service/impl/PaymentSettlementBusinessServiceImpl.java +++ b/src/main/java/com/sztzjy/bank/service/impl/PaymentSettlementBusinessServiceImpl.java @@ -2,6 +2,7 @@ package com.sztzjy.bank.service.impl; import cn.hutool.core.util.IdUtil; import com.alibaba.fastjson.JSON; +import com.sztzjy.bank.config.exception.handler.ServiceException; import com.sztzjy.bank.entity.*; import com.sztzjy.bank.entity.dto.CustomerInfoCreateDTO; import com.sztzjy.bank.entity.dto.FinancialBillsDTO; @@ -10,6 +11,7 @@ import com.sztzjy.bank.entity.dto.FinancialBillsParamDTO; import com.sztzjy.bank.mapper.CaseAnswerInfoMapper; import com.sztzjy.bank.mapper.CaseInfoMapper; import com.sztzjy.bank.mapper.FinancialBillsMapper; +import com.sztzjy.bank.mapper.OperationProcessMapper; import com.sztzjy.bank.service.PaymentSettlementBusinessService; import com.sztzjy.bank.util.RedisUtil; import com.sztzjy.bank.util.ResultDataEntity; @@ -43,6 +45,38 @@ public class PaymentSettlementBusinessServiceImpl implements PaymentSettlementBu @Autowired private CaseAnswerInfoMapper caseAnswerInfoMapper; + @Autowired + private OperationProcessMapper operationProcessMapper; + /* 下面为此类公共方法 + * @author xcj + * @Date 2025/3/13 + */ + + //判断用户操作流程 + public boolean ProcessJudgment(Integer number, String userId, String largeModule) { + OperationProcessExample example = new OperationProcessExample(); + example.createCriteria().andUserIdEqualTo(userId).andLargeModuleEqualTo(largeModule); + List operationProcesses = operationProcessMapper.selectByExample(example); + + if (operationProcesses.isEmpty()) { + OperationProcess operationProcess = new OperationProcess(userId, largeModule); + operationProcessMapper.insert(operationProcess); + + operationProcesses.add(operationProcess); + } + + OperationProcess operationProcess = operationProcesses.get(0); + + if (number == operationProcess.getCompletedStepsNumber() + 1) { //需要进行更新操作 + operationProcess.setCompletedStepsNumber(number); + + operationProcessMapper.updateByPrimaryKey(operationProcess); + } + + return number <= operationProcess.getCompletedStepsNumber() + 1; + } + + //商业承兑开票 @Override public ResultEntity tradeAcceptance(FinancialBills financialBills) { @@ -57,6 +91,10 @@ public class PaymentSettlementBusinessServiceImpl implements PaymentSettlementBu financialBills.setId(IdUtil.simpleUUID()); if (financialBills.getSubState() == 1) { + //判断用户是否完成上一个流程,并更新操作步骤序号 + if (!ProcessJudgment(1, financialBills.getUserId(), "商业承兑汇票业务")) { + throw new ServiceException(HttpStatus.ACCEPTED, "请先完成上一流程"); + } financialBills = submitBytradeAcceptance(financialBills); } @@ -67,24 +105,23 @@ public class PaymentSettlementBusinessServiceImpl implements PaymentSettlementBu } else { FinancialBills information = informationList.get(0); - //校验时候已经提交 if (information.getSubState() == 1) { return new ResultEntity<>(HttpStatus.OK, "提交成功", 2); } - if (financialBills.getSubState() == 1) { + //判断用户是否完成上一个流程,并更新操作步骤序号 + if (!ProcessJudgment(1, financialBills.getUserId(), "商业承兑汇票业务")) { + throw new ServiceException(HttpStatus.ACCEPTED, "请先完成上一流程"); + } financialBills = submitBytradeAcceptance(financialBills); } - - String id = information.getId(); BeanUtils.copyProperties(financialBills, information); //当值ID为空被覆盖 information.setId(id); financialBillsMapper.updateByPrimaryKeySelective(information); - return new ResultEntity<>(HttpStatus.OK, "提交成功", 1); } } @@ -122,6 +159,12 @@ public class PaymentSettlementBusinessServiceImpl implements PaymentSettlementBu if (CollectionUtils.isEmpty(informationList)) { + + //判断用户是否完成上一个流程,并更新操作步骤序号 + if (!ProcessJudgment(2, financialBillsParamDTO.getUserId(), "商业承兑汇票业务")) { + throw new ServiceException(HttpStatus.ACCEPTED, "请先完成上一流程"); + } + return new ResultEntity<>(HttpStatus.OK); }else { FinancialBills financialBills = informationList.get(0); @@ -129,6 +172,10 @@ public class PaymentSettlementBusinessServiceImpl implements PaymentSettlementBu //二次提交 if (financialBills.getSubState()==1) { + //判断用户是否完成上一个流程,并更新操作步骤序号 + if (!ProcessJudgment(2, financialBillsParamDTO.getUserId(), "商业承兑汇票业务")) { + throw new ServiceException(HttpStatus.ACCEPTED, "请先完成上一流程"); + } return new ResultEntity<>(HttpStatus.OK,"提交成功!",2); } @@ -219,6 +266,12 @@ public class PaymentSettlementBusinessServiceImpl implements PaymentSettlementBu if (CollectionUtils.isEmpty(informationList)) { + + //判断用户是否完成上一个流程,并更新操作步骤序号 + if (!ProcessJudgment(3, financialBillsParamDTO.getUserId(), "商业承兑汇票业务")) { + throw new ServiceException(HttpStatus.ACCEPTED, "请先完成上一流程"); + } + return new ResultEntity<>(HttpStatus.OK); }else { FinancialBills financialBills = informationList.get(0); @@ -226,6 +279,10 @@ public class PaymentSettlementBusinessServiceImpl implements PaymentSettlementBu //二次提交 if (financialBills.getSubState()==1) { + //判断用户是否完成上一个流程,并更新操作步骤序号 + if (!ProcessJudgment(3, financialBillsParamDTO.getUserId(), "商业承兑汇票业务")) { + throw new ServiceException(HttpStatus.ACCEPTED, "请先完成上一流程"); + } return new ResultEntity<>(HttpStatus.OK,"提交成功!",2); } diff --git a/src/main/java/com/sztzjy/bank/service/impl/PersonalBankCardServiceImpl.java b/src/main/java/com/sztzjy/bank/service/impl/PersonalBankCardServiceImpl.java index 2a1a78b..db21492 100644 --- a/src/main/java/com/sztzjy/bank/service/impl/PersonalBankCardServiceImpl.java +++ b/src/main/java/com/sztzjy/bank/service/impl/PersonalBankCardServiceImpl.java @@ -1,14 +1,14 @@ package com.sztzjy.bank.service.impl; import cn.hutool.core.util.IdUtil; +import cn.hutool.core.util.RandomUtil; import com.alibaba.fastjson.JSON; +import com.sztzjy.bank.config.exception.handler.ServiceException; import com.sztzjy.bank.entity.*; +import com.sztzjy.bank.entity.dto.BankCardInformationAndCustomerInfoDTO; import com.sztzjy.bank.entity.dto.BankCardInformationAnswerDTO; import com.sztzjy.bank.entity.dto.CustomerInformationAnswerDTO; -import com.sztzjy.bank.mapper.BankCardInformationMapper; -import com.sztzjy.bank.mapper.CaseAnswerInfoMapper; -import com.sztzjy.bank.mapper.CaseInfoMapper; -import com.sztzjy.bank.mapper.CustomerInformationMapper; +import com.sztzjy.bank.mapper.*; import com.sztzjy.bank.service.PersonalBankCardService; import com.sztzjy.bank.util.RedisUtil; import com.sztzjy.bank.util.ResultDataEntity; @@ -47,6 +47,8 @@ public class PersonalBankCardServiceImpl implements PersonalBankCardService { + + //提交/保存 @Override public ResultEntity submitByPersonBankCard(CustomerInformation customerInformation) { @@ -62,15 +64,31 @@ public class PersonalBankCardServiceImpl implements PersonalBankCardService { if (customerInformation.getSubState()==1) { + //判断用户是否完成上一个流程,并更新操作步骤序号 + if (!ProcessJudgment(1, customerInformation.getUserId(), "个人银行卡业务")) { + throw new ServiceException(HttpStatus.ACCEPTED, "请先完成上一流程"); + } + customerInformation = submitByPersonBankCardCaculate(customerInformation); customerInformation.setHandlingAgency("0000100"); customerInformation.setSerialNumber("0000000150101"); customerInformation.setHandlingTeller("000000015"); + + + //数据保存 + + //返回客户号 + String customerNo = "100"; + + String string = RandomUtil.randomString("123456789", 6); + customerInformation.setCustomerNo(customerNo+string); } - //数据保存 + + customerInformationMapper.insertSelective(customerInformation); - return new ResultEntity<>(HttpStatus.OK); + + return new ResultEntity<>(HttpStatus.OK,"客户号",customerInformation.getCustomerNo()); }else { CustomerInformation information = informationList.get(0); @@ -83,10 +101,20 @@ public class PersonalBankCardServiceImpl implements PersonalBankCardService { if (customerInformation.getSubState()==1) { + //判断用户是否完成上一个流程,并更新操作步骤序号 + if (!ProcessJudgment(1, customerInformation.getUserId(), "个人银行卡业务")) { + throw new ServiceException(HttpStatus.ACCEPTED, "请先完成上一流程"); + } customerInformation = submitByPersonBankCardCaculate(customerInformation); customerInformation.setHandlingAgency("0000100"); customerInformation.setSerialNumber("0000000150101"); customerInformation.setHandlingTeller("000000015"); + + //返回客户号 + String customerNo = "100"; + + String string = RandomUtil.randomString("123456789", 6); + customerInformation.setCustomerNo(customerNo+string); } @@ -97,7 +125,7 @@ public class PersonalBankCardServiceImpl implements PersonalBankCardService { information.setId(id); customerInformationMapper.updateByPrimaryKeySelective(information); - return new ResultEntity<>(HttpStatus.OK,"提交成功",1); + return new ResultEntity<>(HttpStatus.OK,"提交成功",information.getCustomerNo()); } } @@ -105,7 +133,7 @@ public class PersonalBankCardServiceImpl implements PersonalBankCardService { private CustomerInformation submitByPersonBankCardCaculate(CustomerInformation customerInformation) { - String answer = redisUtil.get("bank" + "-个人银行卡业务" + "-录入客户信息"); + String answer = redisUtil.get("bank" + "-个人银行卡业务" + "-录入客户信息"+"-"+customerInformation.getNumber()); if (answer == null) { CaseInfoExample caseInfoExample = new CaseInfoExample(); caseInfoExample.createCriteria().andLargeModuleEqualTo("个人银行卡业务").andModuleEqualTo("录入客户信息").andNumberEqualTo(customerInformation.getNumber()); @@ -117,8 +145,8 @@ public class PersonalBankCardServiceImpl implements PersonalBankCardService { List answerInfoList = caseAnswerInfoMapper.selectByExampleWithBLOBs(caseAnswerInfoExample); if (!CollectionUtils.isEmpty(answerInfoList)) { String info = answerInfoList.get(0).getAnswer(); - redisUtil.set("bank" + "-个人银行卡业务" + "-录入客户信息",info,3600); - answer=redisUtil.get("bank" + "-个人银行卡业务" + "-录入客户信息"); + redisUtil.set("bank" + "-个人银行卡业务" + "-录入客户信息"+"-"+customerInformation.getNumber(),info,3600); + answer=redisUtil.get("bank" + "-个人银行卡业务" + "-录入客户信息"+"-"+customerInformation.getNumber()); } } } @@ -211,6 +239,38 @@ public class PersonalBankCardServiceImpl implements PersonalBankCardService { } } + @Autowired + private OperationProcessMapper operationProcessMapper; + /* 下面为此类公共方法 + * @author xcj + * @Date 2025/3/13 + */ + + //判断用户操作流程 + public boolean ProcessJudgment(Integer number, String userId, String largeModule) { + OperationProcessExample example = new OperationProcessExample(); + example.createCriteria().andUserIdEqualTo(userId).andLargeModuleEqualTo(largeModule); + List operationProcesses = operationProcessMapper.selectByExample(example); + + if (operationProcesses.isEmpty()) { + OperationProcess operationProcess = new OperationProcess(userId, largeModule); + operationProcessMapper.insert(operationProcess); + + operationProcesses.add(operationProcess); + } + + OperationProcess operationProcess = operationProcesses.get(0); + + if (number == operationProcess.getCompletedStepsNumber() + 1) { //需要进行更新操作 + operationProcess.setCompletedStepsNumber(number); + + operationProcessMapper.updateByPrimaryKey(operationProcess); + } + + return number <= operationProcess.getCompletedStepsNumber() + 1; + } + + /* * 开设银行卡-提交/保存 * @param null @@ -228,13 +288,24 @@ public class PersonalBankCardServiceImpl implements PersonalBankCardService { bankCardInformation.setId(IdUtil.simpleUUID()); if (bankCardInformation.getSubState()==1) { + + //判断用户是否完成上一个流程,并更新操作步骤序号 + if (!ProcessJudgment(2, bankCardInformation.getUserId(), "个人银行卡业务")) { + throw new ServiceException(HttpStatus.ACCEPTED, "请先完成上一流程"); + } + bankCardInformation = submitByCreateCardCaculate(bankCardInformation); + + String bankCardNumber = "6217"; + bankCardInformation.setBankCardNumber(bankCardNumber+""+RandomUtil.randomString("123456789", 4)+""+RandomUtil.randomString("123456789", 4)+""+RandomUtil.randomString("123456789", 4)); + + bankCardInformationMapper.insertSelective(bankCardInformation); - return new ResultEntity<>(HttpStatus.OK,"提交成功","6217 7303 0564 8235"); + return new ResultEntity<>(HttpStatus.OK,"提交成功",bankCardInformation.getBankCardNumber()); } bankCardInformationMapper.insertSelective(bankCardInformation); - return new ResultEntity<>(HttpStatus.OK,"提交成功"); + return new ResultEntity<>(HttpStatus.OK,"保存成功"); }else { BankCardInformation bankCardInfo = bankCardInformationList.get(0); @@ -246,6 +317,10 @@ public class PersonalBankCardServiceImpl implements PersonalBankCardService { if (bankCardInformation.getSubState()==1) { + //判断用户是否完成上一个流程,并更新操作步骤序号 + if (!ProcessJudgment(2, bankCardInformation.getUserId(), "个人银行卡业务")) { + throw new ServiceException(HttpStatus.ACCEPTED, "请先完成上一流程"); + } bankCardInformation = submitByCreateCardCaculate(bankCardInformation); String id = bankCardInfo.getId(); @@ -255,7 +330,7 @@ public class PersonalBankCardServiceImpl implements PersonalBankCardService { bankCardInfo.setId(id); bankCardInformationMapper.updateByPrimaryKeySelective(bankCardInfo); - return new ResultEntity<>(HttpStatus.OK,"提交成功","6217 7303 0564 8235"); + return new ResultEntity<>(HttpStatus.OK,"提交成功",bankCardInfo.getBankCardNumber()); } @@ -275,19 +350,25 @@ public class PersonalBankCardServiceImpl implements PersonalBankCardService { //开设银行卡-查询回显 @Override - public ResultEntity getBaseInfoByCreateCard(String userId, Integer number) { + public ResultEntity getBaseInfoByCreateCard(String userId, Integer number) { BankCardInformationExample example = new BankCardInformationExample(); example.createCriteria().andUserIdEqualTo(userId).andNumberEqualTo(number); List bankCardInformationList = bankCardInformationMapper.selectByExample(example); if (CollectionUtils.isEmpty(bankCardInformationList)) { return new ResultEntity<>(HttpStatus.OK); }else { + //返回客户信息 + CustomerInformationExample customerInformationExample = new CustomerInformationExample(); + customerInformationExample.createCriteria().andUserIdEqualTo(userId).andNumberEqualTo(number); + List informationList = customerInformationMapper.selectByExample(customerInformationExample); - return new ResultEntity<>(HttpStatus.OK,bankCardInformationList.get(0)); - - } + BankCardInformationAndCustomerInfoDTO bankCardInformationAndCustomerInfo = new BankCardInformationAndCustomerInfoDTO(); + bankCardInformationAndCustomerInfo.setCustomerInformation(informationList.get(0)); + bankCardInformationAndCustomerInfo.setBankCardInformation(bankCardInformationList.get(0)); + return new ResultEntity<>(HttpStatus.OK,bankCardInformationAndCustomerInfo); + } } /** @@ -299,7 +380,7 @@ public class PersonalBankCardServiceImpl implements PersonalBankCardService { */ @Override - public ResultDataEntity getCardInfoByUserId(String userId, Integer number, String code) { + public ResultDataEntity getCardInfoByUserId(String userId, Integer number, String code,String type) { //判断身份证号码是否正确 CustomerInformationExample example = new CustomerInformationExample(); example.createCriteria().andUserIdEqualTo(userId).andNumberEqualTo(number); @@ -309,27 +390,29 @@ public class PersonalBankCardServiceImpl implements PersonalBankCardService { return new ResultDataEntity<>(HttpStatus.OK); }else { CustomerInformation information = informationList.get(0); - if (information.getIdNumber().equals(code)) - { - return new ResultDataEntity<>(HttpStatus.OK,"查询成功",informationList.get(0)); - }else { - return new ResultDataEntity<>(HttpStatus.ACCEPTED,"证件号码有误"); - } + if (!information.getIdType().equals(type)){ - } + return new ResultDataEntity<>(HttpStatus.ACCEPTED,"证件类型有误"); + } + if (!information.getIdNumber().equals(code)) + { + return new ResultDataEntity<>(HttpStatus.ACCEPTED,"证件号码有误"); + } + return new ResultDataEntity<>(information); + } } //开设银行卡-提交计算 private BankCardInformation submitByCreateCardCaculate(BankCardInformation bankCardInformation){ - String answer = redisUtil.get("bank" + "-个人银行卡业务" + "-开设银行卡"); + String answer = redisUtil.get("bank" + "-个人银行卡业务" + "-开设银行卡"+ "-" +bankCardInformation.getNumber()); if (answer == null) { CaseInfoExample caseInfoExample = new CaseInfoExample(); caseInfoExample.createCriteria().andLargeModuleEqualTo("个人银行卡业务").andModuleEqualTo("开设银行卡").andNumberEqualTo(bankCardInformation.getNumber()); @@ -341,8 +424,8 @@ public class PersonalBankCardServiceImpl implements PersonalBankCardService { List answerInfoList = caseAnswerInfoMapper.selectByExampleWithBLOBs(caseAnswerInfoExample); if (!CollectionUtils.isEmpty(answerInfoList)) { String info = answerInfoList.get(0).getAnswer(); - redisUtil.set("bank" + "-个人银行卡业务" + "-开设银行卡",info,3600); - answer=redisUtil.get("bank" + "-个人银行卡业务" + "-开设银行卡"); + redisUtil.set("bank" + "-个人银行卡业务" + "-开设银行卡"+"-"+bankCardInformation.getNumber(),info,3600); + answer=redisUtil.get("bank" + "-个人银行卡业务" + "-开设银行卡"+"-"+bankCardInformation.getNumber()); } } } diff --git a/src/main/java/com/sztzjy/bank/service/impl/PersonalDepositWithdrawalServiceImpl.java b/src/main/java/com/sztzjy/bank/service/impl/PersonalDepositWithdrawalServiceImpl.java index 34d3b6d..be65498 100644 --- a/src/main/java/com/sztzjy/bank/service/impl/PersonalDepositWithdrawalServiceImpl.java +++ b/src/main/java/com/sztzjy/bank/service/impl/PersonalDepositWithdrawalServiceImpl.java @@ -1,13 +1,12 @@ package com.sztzjy.bank.service.impl; +import cn.hutool.core.convert.Convert; import cn.hutool.core.util.IdUtil; import com.alibaba.fastjson.JSON; +import com.sztzjy.bank.config.exception.handler.ServiceException; import com.sztzjy.bank.entity.*; -import com.sztzjy.bank.entity.dto.BankCardInformationAnswerDTO; -import com.sztzjy.bank.entity.dto.PersonSavingInfoAnswerDTO; -import com.sztzjy.bank.entity.dto.PersonTakeOutInfoAnswerDTO; -import com.sztzjy.bank.entity.dto.PersonTransferToInfoDTO; +import com.sztzjy.bank.entity.dto.*; import com.sztzjy.bank.mapper.*; import com.sztzjy.bank.service.PersonalDepositWithdrawalService; @@ -49,6 +48,37 @@ public class PersonalDepositWithdrawalServiceImpl implements PersonalDepositWith @Autowired private PersonTransferToInfoMapper personTransferToInfoMapper; + @Autowired + private OperationProcessMapper operationProcessMapper; + /* 下面为此类公共方法 + * @author xcj + * @Date 2025/3/13 + */ + + //判断用户操作流程 + public boolean ProcessJudgment(Integer number, String userId, String largeModule) { + OperationProcessExample example = new OperationProcessExample(); + example.createCriteria().andUserIdEqualTo(userId).andLargeModuleEqualTo(largeModule); + List operationProcesses = operationProcessMapper.selectByExample(example); + + if (operationProcesses.isEmpty()) { + OperationProcess operationProcess = new OperationProcess(userId, largeModule); + operationProcessMapper.insert(operationProcess); + + operationProcesses.add(operationProcess); + } + + OperationProcess operationProcess = operationProcesses.get(0); + + if (number == operationProcess.getCompletedStepsNumber() + 1) { //需要进行更新操作 + operationProcess.setCompletedStepsNumber(number); + + operationProcessMapper.updateByPrimaryKey(operationProcess); + } + + return number <= operationProcess.getCompletedStepsNumber() + 1; + } + //刷卡查询户名-余额 @Override public ResultEntity getNameInfoByUserId(String bankCardNumber, String withdrawalPwd, String userId, Integer number) { @@ -66,9 +96,11 @@ public class PersonalDepositWithdrawalServiceImpl implements PersonalDepositWith if (!bankCardInformation.getWithdrawalPwd().equals(withdrawalPwd)) { return new ResultEntity<>(HttpStatus.ACCEPTED, "密码错误!"); } + String answer = redisUtil.get("bank" + "-个人银行卡业务" + "-录入客户信息"+"-"+number); + // 解析 JSON 字符串 + CustomerInformationAnswerDTO answerDTO = JSON.parseObject(answer, CustomerInformationAnswerDTO.class); - - return new ResultEntity<>(HttpStatus.OK,bankCardInformation.getChName()); + return new ResultEntity<>(HttpStatus.OK, answerDTO.getChName(),0); } } @@ -87,6 +119,12 @@ public class PersonalDepositWithdrawalServiceImpl implements PersonalDepositWith if (personSavingInfo.getSubState()==1) { + + //判断用户是否完成上一个流程,并更新操作步骤序号 + if (!ProcessJudgment(1, personSavingInfo.getUserId(), "个人存款业务")) { + throw new ServiceException(HttpStatus.ACCEPTED, "请先完成上一流程"); + } + personSavingInfo = submitByDepositWithdrawalCaculate(personSavingInfo); personSavingInfo.setHandlingAgency("0000100"); personSavingInfo.setSerialNumber("000000013201501230019"); @@ -109,6 +147,10 @@ public class PersonalDepositWithdrawalServiceImpl implements PersonalDepositWith if (personSavingInfo.getSubState()==1) { + //判断用户是否完成上一个流程,并更新操作步骤序号 + if (!ProcessJudgment(1, personSavingInfo.getUserId(), "个人存款业务")) { + throw new ServiceException(HttpStatus.ACCEPTED, "请先完成上一流程"); + } personSavingInfo = submitByDepositWithdrawalCaculate(personSavingInfo); personSavingInfo.setHandlingAgency("0000100"); personSavingInfo.setSerialNumber("000000013201501230019"); @@ -183,6 +225,10 @@ public class PersonalDepositWithdrawalServiceImpl implements PersonalDepositWith if (personTakeOutInfo.getSubState()==1) { + //判断用户是否完成上一个流程,并更新操作步骤序号 + if (!ProcessJudgment(2, personTakeOutInfo.getUserId(), "个人存款业务")) { + throw new ServiceException(HttpStatus.ACCEPTED, "请先完成上一流程"); + } personTakeOutInfo = submitTakeOutCaculate(personTakeOutInfo); personTakeOutInfo.setHandlingAgency("0000100"); personTakeOutInfo.setSerialNumber("000000013201501230021"); @@ -205,6 +251,10 @@ public class PersonalDepositWithdrawalServiceImpl implements PersonalDepositWith if (personTakeOutInfo.getSubState()==1) { + //判断用户是否完成上一个流程,并更新操作步骤序号 + if (!ProcessJudgment(2, personTakeOutInfo.getUserId(), "个人存款业务")) { + throw new ServiceException(HttpStatus.ACCEPTED, "请先完成上一流程"); + } personTakeOutInfo = submitTakeOutCaculate(personTakeOutInfo); personTakeOutInfo.setHandlingAgency("0000100"); personTakeOutInfo.setSerialNumber("000000013201501230021"); @@ -252,11 +302,25 @@ public class PersonalDepositWithdrawalServiceImpl implements PersonalDepositWith personTransferToInfo.setId(IdUtil.simpleUUID()); if (personTransferToInfo.getSubState() == 1) { + + //判断用户是否完成上一个流程,并更新操作步骤序号 + if (!ProcessJudgment(3, personTransferToInfo.getUserId(), "个人存款业务")) { + throw new ServiceException(HttpStatus.ACCEPTED, "请先完成上一流程"); + } + personTransferToInfo = submitTransferToCaculate(personTransferToInfo); personTransferToInfo.setHandlingAgency("0000100"); personTransferToInfo.setSerialNumber("000000013201501230021"); personTransferToInfo.setHandlingTeller("000000013"); - personTransferToInfo.setAccountBalance("398994"); + + + Integer anInt = Convert.toInt(personTransferToInfo.getAccountBalance()); + String answer = redisUtil.get("bank" + "-个人存取款业务" + "-个人转账业务"+"-"+personTransferToInfo.getNumber()); + // 解析 JSON 字符串 + PersonTransferToInfoDTO answerDTO = JSON.parseObject(answer, PersonTransferToInfoDTO.class); + Integer anInt1 = Convert.toInt(answerDTO.getTransferAccountsAmount()); + + personTransferToInfo.setAccountBalance(Convert.toStr(anInt-anInt1)); } //数据保存 personTransferToInfoMapper.insertSelective(personTransferToInfo); @@ -272,11 +336,23 @@ public class PersonalDepositWithdrawalServiceImpl implements PersonalDepositWith } if (personTransferToInfo.getSubState() == 1) { + //判断用户是否完成上一个流程,并更新操作步骤序号 + if (!ProcessJudgment(3, personTransferToInfo.getUserId(), "个人存款业务")) { + throw new ServiceException(HttpStatus.ACCEPTED, "请先完成上一流程"); + } + personTransferToInfo = submitTransferToCaculate(personTransferToInfo); personTransferToInfo.setHandlingAgency("0000100"); personTransferToInfo.setSerialNumber("000000013201501230021"); personTransferToInfo.setHandlingTeller("000000013"); - personTransferToInfo.setAccountBalance("398994"); + + Integer anInt = Convert.toInt(personTransferToInfo.getAccountBalance()); + String answer = redisUtil.get("bank" + "-个人存取款业务" + "-个人转账业务"+"-"+personTransferToInfo.getNumber()); + // 解析 JSON 字符串 + PersonTransferToInfoDTO answerDTO = JSON.parseObject(answer, PersonTransferToInfoDTO.class); + Integer anInt1 = Convert.toInt(answerDTO.getTransferAccountsAmount()); + + personTransferToInfo.setAccountBalance(Convert.toStr(anInt-anInt1)); } @@ -302,7 +378,6 @@ public class PersonalDepositWithdrawalServiceImpl implements PersonalDepositWith if (CollectionUtils.isEmpty(informationList)) { - return new ResultDataEntity<>(HttpStatus.OK); }else { return new ResultDataEntity<>(HttpStatus.OK,informationList.get(0)); @@ -312,16 +387,31 @@ public class PersonalDepositWithdrawalServiceImpl implements PersonalDepositWith @Override public ResultEntity getTransferToBalance(String bankCardNumber, String withdrawalPwd, String userId, Integer number) { + PersonTakeOutInfoExample example = new PersonTakeOutInfoExample(); example.createCriteria().andUserIdEqualTo(userId).andNumberEqualTo(number); List informationList = personTakeOutInfoMapper.selectByExample(example); - return null; + if (CollectionUtils.isEmpty(informationList)) { + return new ResultEntity<>(HttpStatus.OK); + }else { + PersonTakeOutInfo personTakeOutInfo = informationList.get(0); + if (!personTakeOutInfo.getCardNumber().equals(bankCardNumber)){ + return new ResultEntity<>(HttpStatus.ACCEPTED,"卡号有误!"); + } + + if (!personTakeOutInfo.getCardPwd().equals(withdrawalPwd)){ + return new ResultEntity<>(HttpStatus.ACCEPTED,"密码有误!"); + } + + + return new ResultEntity<>(HttpStatus.OK,personTakeOutInfo.getUserName(),personTakeOutInfo.getAccountBalance()); + } } //个人转账业务-提交算分 private PersonTransferToInfo submitTransferToCaculate(PersonTransferToInfo personTransferToInfo) { - String answer = redisUtil.get("bank" + "-个人存取款业务" + "-个人转账业务"); + String answer = redisUtil.get("bank" + "-个人存取款业务" + "-个人转账业务"+"-"+personTransferToInfo.getNumber()); if (answer == null) { CaseInfoExample caseInfoExample = new CaseInfoExample(); caseInfoExample.createCriteria().andLargeModuleEqualTo("个人存取款业务").andModuleEqualTo("个人转账业务").andNumberEqualTo(personTransferToInfo.getNumber()); @@ -333,8 +423,8 @@ public class PersonalDepositWithdrawalServiceImpl implements PersonalDepositWith List answerInfoList = caseAnswerInfoMapper.selectByExampleWithBLOBs(caseAnswerInfoExample); if (!CollectionUtils.isEmpty(answerInfoList)) { String info = answerInfoList.get(0).getAnswer(); - redisUtil.set("bank" + "-个人存取款业务" + "-个人转账业务",info,3600); - answer=redisUtil.get("bank" + "-个人存取款业务" + "-个人转账业务"); + redisUtil.set("bank" + "-个人存取款业务" + "-个人转账业务"+"-"+personTransferToInfo.getNumber(),info,3600); + answer=redisUtil.get("bank" + "-个人存取款业务" + "-个人转账业务"+"-"+personTransferToInfo.getNumber()); } } } @@ -348,15 +438,15 @@ public class PersonalDepositWithdrawalServiceImpl implements PersonalDepositWith } int errorNumber = personTransferToInfo.getErrorNumber(); - //卡号 - if (!answerDTO.getCardNumber().equals(personTransferToInfo.getCardNumber())) { - errorNumber++; - } - - //刷卡密码 - if (!answerDTO.getCardPwd().equals(personTransferToInfo.getCardPwd())) { - errorNumber++; - } +// //卡号 +// if (!answerDTO.getCardNumber().equals(personTransferToInfo.getCardNumber())) { +// errorNumber++; +// } +// +// //刷卡密码 +// if (!answerDTO.getCardPwd().equals(personTransferToInfo.getCardPwd())) { +// errorNumber++; +// } //币种 if (!answerDTO.getCurrency().equals(personTransferToInfo.getCurrency())) { @@ -367,32 +457,32 @@ public class PersonalDepositWithdrawalServiceImpl implements PersonalDepositWith if (!answerDTO.getCurrencyExchSymbol().equals(personTransferToInfo.getCurrencyExchSymbol())) { errorNumber++; } - - - //转入卡号 - if (!answerDTO.getTransferCardNumber().equals(personTransferToInfo.getTransferCardNumber())) { - errorNumber++; - } - //转账金额 if (!answerDTO.getTransferAccountsAmount().equals(personTransferToInfo.getTransferAccountsAmount())) { errorNumber++; } - //转入开户银行 - if (!answerDTO.getTransferToAccountOpenBank().equals(personTransferToInfo.getTransferToAccountOpenBank())) { - errorNumber++; - } - - //转入户名 - if (!answerDTO.getTransferToUserName().equals(personTransferToInfo.getTransferToUserName())) { - errorNumber++; - } - - //手续费 - if (!answerDTO.getCommission().equals(personTransferToInfo.getCommission())) { - errorNumber++; - } +// //转入卡号 +// if (!answerDTO.getTransferCardNumber().equals(personTransferToInfo.getTransferCardNumber())) { +// errorNumber++; +// } +// +// +// +// //转入开户银行 +// if (!answerDTO.getTransferToAccountOpenBank().equals(personTransferToInfo.getTransferToAccountOpenBank())) { +// errorNumber++; +// } +// +// //转入户名 +// if (!answerDTO.getTransferToUserName().equals(personTransferToInfo.getTransferToUserName())) { +// errorNumber++; +// } +// +// //手续费 +// if (!answerDTO.getCommission().equals(personTransferToInfo.getCommission())) { +// errorNumber++; +// } //收费状态 @@ -412,7 +502,7 @@ public class PersonalDepositWithdrawalServiceImpl implements PersonalDepositWith //个人取款业务-提交算分 private PersonTakeOutInfo submitTakeOutCaculate(PersonTakeOutInfo personTakeOutInfo) { - String answer = redisUtil.get("bank" + "-个人存取款业务" + "-个人取款业务"); + String answer = redisUtil.get("bank" + "-个人存取款业务" + "-个人取款业务"+"-"+personTakeOutInfo.getNumber()); if (answer == null) { CaseInfoExample caseInfoExample = new CaseInfoExample(); caseInfoExample.createCriteria().andLargeModuleEqualTo("个人存取款业务").andModuleEqualTo("个人取款业务").andNumberEqualTo(personTakeOutInfo.getNumber()); @@ -424,8 +514,8 @@ public class PersonalDepositWithdrawalServiceImpl implements PersonalDepositWith List answerInfoList = caseAnswerInfoMapper.selectByExampleWithBLOBs(caseAnswerInfoExample); if (!CollectionUtils.isEmpty(answerInfoList)) { String info = answerInfoList.get(0).getAnswer(); - redisUtil.set("bank" + "-个人存取款业务" + "-个人取款业务",info,3600); - answer=redisUtil.get("bank" + "-个人存取款业务" + "-个人取款业务"); + redisUtil.set("bank" + "-个人存取款业务" + "-个人取款业务"+"-"+personTakeOutInfo.getNumber(),info,3600); + answer=redisUtil.get("bank" + "-个人存取款业务" + "-个人取款业务"+"-"+personTakeOutInfo.getNumber()); } } } @@ -439,15 +529,15 @@ public class PersonalDepositWithdrawalServiceImpl implements PersonalDepositWith } int errorNumber = personTakeOutInfo.getErrorNumber(); - //卡号 - if (!answerDTO.getCardNumber().equals(personTakeOutInfo.getCardNumber())) { - errorNumber++; - } - - //刷卡密码 - if (!answerDTO.getCardPwd().equals(personTakeOutInfo.getCardPwd())) { - errorNumber++; - } +// //卡号 +// if (!answerDTO.getCardNumber().equals(personTakeOutInfo.getCardNumber())) { +// errorNumber++; +// } +// +// //刷卡密码 +// if (!answerDTO.getCardPwd().equals(personTakeOutInfo.getCardPwd())) { +// errorNumber++; +// } //币种 if (!answerDTO.getCurrency().equals(personTakeOutInfo.getCurrency())) { @@ -485,7 +575,7 @@ public class PersonalDepositWithdrawalServiceImpl implements PersonalDepositWith //个人存款业务-提交算分 private PersonSavingInfo submitByDepositWithdrawalCaculate(PersonSavingInfo personSavingInfo) { - String answer = redisUtil.get("bank" + "-个人存取款业务" + "-个人存款业务"); + String answer = redisUtil.get("bank" + "-个人存取款业务" + "-个人存款业务"+"-"+personSavingInfo.getNumber()); if (answer == null) { CaseInfoExample caseInfoExample = new CaseInfoExample(); caseInfoExample.createCriteria().andLargeModuleEqualTo("个人存取款业务").andModuleEqualTo("个人存款业务").andNumberEqualTo(personSavingInfo.getNumber()); @@ -497,8 +587,8 @@ public class PersonalDepositWithdrawalServiceImpl implements PersonalDepositWith List answerInfoList = caseAnswerInfoMapper.selectByExampleWithBLOBs(caseAnswerInfoExample); if (!CollectionUtils.isEmpty(answerInfoList)) { String info = answerInfoList.get(0).getAnswer(); - redisUtil.set("bank" + "-个人存取款业务" + "-个人存款业务",info,3600); - answer=redisUtil.get("bank" + "-个人存取款业务" + "-个人存款业务"); + redisUtil.set("bank" + "-个人存取款业务" + "-个人存款业务"+"-"+personSavingInfo.getNumber(),info,3600); + answer=redisUtil.get("bank" + "-个人存取款业务" + "-个人存款业务"+"-"+personSavingInfo.getNumber()); } } }