fix: pos机管理,功能优化。
This commit is contained in:
@@ -88,6 +88,11 @@ public class PosMachine extends BaseEntity
|
||||
@Excel(name = "账户状态")
|
||||
private String status;
|
||||
|
||||
/** 舍入模式 */
|
||||
@ApiModelProperty(value="舍入模式")
|
||||
@Excel(name = "舍入模式")
|
||||
private String roundingMode;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
@@ -111,6 +116,7 @@ public class PosMachine extends BaseEntity
|
||||
.append("activationDate", getActivationDate())
|
||||
.append("ratePlus", getRatePlus())
|
||||
.append("status", getStatus())
|
||||
.append("roundingMode", getRoundingMode())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package com.ruoyi.invest.domain.vo;
|
||||
|
||||
import com.ruoyi.invest.domain.PosMachine;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
/**
|
||||
* pos机信息Vo对象 pos_machine
|
||||
*
|
||||
@@ -26,4 +26,8 @@ public class PosMachineVo extends PosMachine
|
||||
@ApiModelProperty(value="名称+商户)")
|
||||
private String nameMerchantName;
|
||||
|
||||
/** 刷卡费率 */
|
||||
@ApiModelProperty(value="刷卡费率")
|
||||
private String rateName;
|
||||
|
||||
}
|
||||
|
||||
@@ -164,7 +164,20 @@ public class AccountsTransferRecordServiceImpl implements IAccountsTransferRecor
|
||||
BankCardLendVo creditVo=bankCardLendMapper.selectBankCardLendById(accountsTransferRecord.getOutAccountId());
|
||||
Double commission=accountsTransferRecord.getRate()*accountsTransferRecord.getAmount()+accountsTransferRecord.getRatePlus();
|
||||
BigDecimal bg = BigDecimal.valueOf(commission);
|
||||
commission = bg.setScale(2, BigDecimal.ROUND_UP).doubleValue();
|
||||
String roudingMode=pos.getRoundingMode() ;
|
||||
if(roudingMode.equals("1")){
|
||||
commission = bg.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
|
||||
}
|
||||
if(roudingMode.equals("2")){
|
||||
commission = bg.setScale(2, BigDecimal.ROUND_UP).doubleValue();
|
||||
}
|
||||
if(roudingMode.equals("3")){
|
||||
commission = bg.setScale(2, BigDecimal.ROUND_DOWN).doubleValue();
|
||||
}
|
||||
if(roudingMode.equals("4")){
|
||||
commission = bg.setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue();
|
||||
}
|
||||
|
||||
//手续费
|
||||
accountsTransferRecord.setCommission(commission);
|
||||
//实际入账金额
|
||||
|
||||
@@ -42,6 +42,9 @@ public class PosMachineServiceImpl implements IPosMachineService
|
||||
public PosMachineVo selectPosMachineById(Long id)
|
||||
{
|
||||
PosMachineVo posMachine=posMachineMapper.selectPosMachineById(id);
|
||||
posMachine.setRateName(posMachine.getRate()*100+"%");
|
||||
//展示的时候乘以100
|
||||
posMachine.setRate(posMachine.getRate()*100);
|
||||
posMachine.setBankNameCode(posMachine.getBankName()+"("+ StringUtils.getLastNumberChars(4,posMachine.getBankCode()+")"));
|
||||
posMachine.setNameMerchantName(posMachine.getName()+"-"+ posMachine.getMerchantName()+"-"+posMachine.getBankName()+"("+ StringUtils.getLastNumberChars(4,posMachine.getBankCode()+")"));
|
||||
return posMachine;
|
||||
@@ -53,15 +56,20 @@ public class PosMachineServiceImpl implements IPosMachineService
|
||||
* @param posMachineDto pos机信息
|
||||
* @return pos机信息
|
||||
*/
|
||||
|
||||
@Override
|
||||
public List<PosMachineVo> selectPosMachineList(PosMachineDto posMachineDto)
|
||||
{
|
||||
List<PosMachineVo> posMachineVoList= posMachineMapper.selectPosMachineList(posMachineDto);
|
||||
//修改名称加卡号
|
||||
for (PosMachineVo posMachine : posMachineVoList) {
|
||||
posMachine.setRateName(posMachine.getRate()*100+"%");
|
||||
//展示的时候乘以100
|
||||
posMachine.setRate(posMachine.getRate()*100);
|
||||
posMachine.setBankNameCode(posMachine.getBankName()+"("+ StringUtils.getLastNumberChars(4,posMachine.getBankCode()+")"));
|
||||
posMachine.setNameMerchantName(posMachine.getName()+"-"+ posMachine.getMerchantName()+"-"+posMachine.getBankName()+"("+ StringUtils.getLastNumberChars(4,posMachine.getBankCode()+")"));
|
||||
}
|
||||
|
||||
return posMachineVoList;
|
||||
}
|
||||
|
||||
@@ -77,6 +85,8 @@ public class PosMachineServiceImpl implements IPosMachineService
|
||||
posMachine.setCreateBy(SecurityUtils.getUsername());
|
||||
posMachine.setCreateTime(DateUtils.getNowDate());
|
||||
posMachine.setId(IdWorker.getId());
|
||||
//存入数据时,按实际来,需要重新计算下
|
||||
posMachine.setRate(posMachine.getRate()/100);
|
||||
|
||||
//记账账户信息插入
|
||||
Accounts accounts=new Accounts();
|
||||
|
||||
@@ -27,6 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="bankName" column="bank_name" />
|
||||
<result property="bankCode" column="bank_code" />
|
||||
<result property="status" column="status" />
|
||||
<result property="roundingMode" column="rounding_mode" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectPosMachineVo">
|
||||
@@ -51,6 +52,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
a.merchant_code,
|
||||
a.activation_date,
|
||||
a.status,
|
||||
a.rounding_mode,
|
||||
bc."name" as bank_name,
|
||||
bc.code as bank_code
|
||||
from
|
||||
@@ -100,6 +102,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="merchantCode != null">merchant_code,</if>
|
||||
<if test="activationDate != null">activation_date,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="roundingMode != null">rounding_mode,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
@@ -122,6 +125,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="merchantCode != null">#{merchantCode},</if>
|
||||
<if test="activationDate != null">#{activationDate},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="roundingMode != null">#{roundingMode},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
@@ -147,6 +151,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="merchantCode != null">merchant_code = #{merchantCode},</if>
|
||||
<if test="activationDate != null">activation_date = #{activationDate},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="roundingMode != null">rounding_mode = #{roundingMode},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
Reference in New Issue
Block a user