后付费用户的负金额
This commit is contained in:
parent
af68a3956d
commit
b37be9472f
@ -185,6 +185,7 @@ public class AccountItemResourceController extends DefaultBaseController {
|
|||||||
accountItemVO.setDescription(accountItemOrderVO.getDescription());
|
accountItemVO.setDescription(accountItemOrderVO.getDescription());
|
||||||
accountItemVO.setOrderId(accountItemOrderVO.getOrderId());
|
accountItemVO.setOrderId(accountItemOrderVO.getOrderId());
|
||||||
accountItemVO.setOrderType(type);
|
accountItemVO.setOrderType(type);
|
||||||
|
accountItemVO.setIsPostpaid(accountItemOrderVO.getIsPostpaid());
|
||||||
accountItemService.saveReturnId(accountItemVO);
|
accountItemService.saveReturnId(accountItemVO);
|
||||||
return new SuccessResult();
|
return new SuccessResult();
|
||||||
}
|
}
|
||||||
|
@ -21,6 +21,7 @@ public class UserExpandDTO extends UserDTO {
|
|||||||
private Long priceMaterialAgentUrgent;
|
private Long priceMaterialAgentUrgent;
|
||||||
private String availableProjType;
|
private String availableProjType;
|
||||||
private String postpaid;
|
private String postpaid;
|
||||||
|
private Integer postpaidCount;
|
||||||
private Integer freeProjCount;
|
private Integer freeProjCount;
|
||||||
private Integer correctionCount;
|
private Integer correctionCount;
|
||||||
|
|
||||||
@ -88,6 +89,14 @@ public class UserExpandDTO extends UserDTO {
|
|||||||
this.postpaid = postpaid;
|
this.postpaid = postpaid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Integer getPostpaidCount() {
|
||||||
|
return postpaidCount == null ? 0 : postpaidCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPostpaidCount(Integer postpaidCount) {
|
||||||
|
this.postpaidCount = postpaidCount;
|
||||||
|
}
|
||||||
|
|
||||||
public Integer getFreeProjCount() {
|
public Integer getFreeProjCount() {
|
||||||
return freeProjCount == null ? 3 : freeProjCount;
|
return freeProjCount == null ? 3 : freeProjCount;
|
||||||
}
|
}
|
||||||
|
@ -17,6 +17,7 @@ public class UserExpandPO {
|
|||||||
private Long priceMaterialAgentUrgent;
|
private Long priceMaterialAgentUrgent;
|
||||||
private String availableProjType;
|
private String availableProjType;
|
||||||
private String postpaid;
|
private String postpaid;
|
||||||
|
private Integer postpaidCount;
|
||||||
private Integer freeProjCount;
|
private Integer freeProjCount;
|
||||||
private Integer correctionCount;
|
private Integer correctionCount;
|
||||||
|
|
||||||
@ -84,6 +85,14 @@ public class UserExpandPO {
|
|||||||
this.postpaid = postpaid;
|
this.postpaid = postpaid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Integer getPostpaidCount() {
|
||||||
|
return postpaidCount == null ? 0 : postpaidCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPostpaidCount(Integer postpaidCount) {
|
||||||
|
this.postpaidCount = postpaidCount;
|
||||||
|
}
|
||||||
|
|
||||||
public Integer getFreeProjCount() {
|
public Integer getFreeProjCount() {
|
||||||
return freeProjCount == null ? 3 : freeProjCount;
|
return freeProjCount == null ? 3 : freeProjCount;
|
||||||
}
|
}
|
||||||
|
@ -27,6 +27,9 @@ public class AccountItemOrderVO {
|
|||||||
@ApiModelProperty(name = "code", value = "编码")
|
@ApiModelProperty(name = "code", value = "编码")
|
||||||
@CheckEmptyAnnotation(name = "编码")
|
@CheckEmptyAnnotation(name = "编码")
|
||||||
private String code;
|
private String code;
|
||||||
|
@ApiModelProperty(name = "isPostpaid", value = "是否后付费")
|
||||||
|
@CheckEmptyAnnotation(name = "是否后付费")
|
||||||
|
private Integer isPostpaid;
|
||||||
|
|
||||||
public String getCode() {
|
public String getCode() {
|
||||||
return code == null ? "" : code.trim();
|
return code == null ? "" : code.trim();
|
||||||
@ -75,4 +78,12 @@ public class AccountItemOrderVO {
|
|||||||
public void setOrderId(String orderId) {
|
public void setOrderId(String orderId) {
|
||||||
this.orderId = orderId;
|
this.orderId = orderId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Integer getIsPostpaid() {
|
||||||
|
return isPostpaid == null ? 0 : isPostpaid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIsPostpaid(Integer isPostpaid) {
|
||||||
|
this.isPostpaid = isPostpaid;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -41,6 +41,7 @@ public class AccountItemVO {
|
|||||||
private String orderType;
|
private String orderType;
|
||||||
@ApiModelProperty(name = "checkStatus", value = "核对状态0:待核对,1:已核对")
|
@ApiModelProperty(name = "checkStatus", value = "核对状态0:待核对,1:已核对")
|
||||||
private String checkStatus;
|
private String checkStatus;
|
||||||
|
private Integer isPostpaid;
|
||||||
|
|
||||||
public String getOrderType() {
|
public String getOrderType() {
|
||||||
return orderType == null ? "" : orderType.trim();
|
return orderType == null ? "" : orderType.trim();
|
||||||
@ -122,5 +123,11 @@ public class AccountItemVO {
|
|||||||
this.checkStatus = checkStatus;
|
this.checkStatus = checkStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Integer getIsPostpaid() {
|
||||||
|
return isPostpaid == null ? 0 : isPostpaid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIsPostpaid(Integer isPostpaid) {
|
||||||
|
this.isPostpaid = isPostpaid;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -27,6 +27,7 @@ public class UserExpandVO {
|
|||||||
@CheckEmptyAnnotation(name = "可用项目类型")
|
@CheckEmptyAnnotation(name = "可用项目类型")
|
||||||
private String availableProjType;
|
private String availableProjType;
|
||||||
private String postpaid;
|
private String postpaid;
|
||||||
|
private Integer postpaidCount;
|
||||||
@CheckNumberAnnotation(name = "免费项目个数", min = 0, max = 10)
|
@CheckNumberAnnotation(name = "免费项目个数", min = 0, max = 10)
|
||||||
private Integer freeProjCount;
|
private Integer freeProjCount;
|
||||||
@CheckNumberAnnotation(name = "资料补正次数", min = 0, max = 10)
|
@CheckNumberAnnotation(name = "资料补正次数", min = 0, max = 10)
|
||||||
@ -96,6 +97,14 @@ public class UserExpandVO {
|
|||||||
this.postpaid = postpaid;
|
this.postpaid = postpaid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Integer getPostpaidCount() {
|
||||||
|
return postpaidCount == null ? 0 : postpaidCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPostpaidCount(Integer postpaidCount) {
|
||||||
|
this.postpaidCount = postpaidCount;
|
||||||
|
}
|
||||||
|
|
||||||
public Integer getFreeProjCount() {
|
public Integer getFreeProjCount() {
|
||||||
return freeProjCount == null ? 3 : freeProjCount;
|
return freeProjCount == null ? 3 : freeProjCount;
|
||||||
}
|
}
|
||||||
|
@ -267,9 +267,9 @@ public class AccountServiceImpl extends DefaultBaseService implements IAccountSe
|
|||||||
Map<String, Object> params = super.getHashMap(2);
|
Map<String, Object> params = super.getHashMap(2);
|
||||||
params.put("accountId", accountId);
|
params.put("accountId", accountId);
|
||||||
params.put("accountMoney", money);
|
params.put("accountMoney", money);
|
||||||
if (money < 0) {
|
// if (money < 0) {
|
||||||
throw new SaveException("余额不足");
|
// throw new SaveException("余额不足");
|
||||||
}
|
// }
|
||||||
accountDao.updateMoney(params);
|
accountDao.updateMoney(params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package cn.com.tenlion.operator.service.accountitem.impl;
|
package cn.com.tenlion.operator.service.accountitem.impl;
|
||||||
|
|
||||||
import cn.com.tenlion.operator.pojo.dtos.account.AccountDTO;
|
import cn.com.tenlion.operator.pojo.dtos.account.AccountDTO;
|
||||||
|
import cn.com.tenlion.operator.pojo.pos.user.expand.UserExpandPO;
|
||||||
import cn.com.tenlion.operator.pojo.vos.accountitem.AccountItemOrderVO;
|
import cn.com.tenlion.operator.pojo.vos.accountitem.AccountItemOrderVO;
|
||||||
import cn.com.tenlion.operator.service.account.IAccountService;
|
import cn.com.tenlion.operator.service.account.IAccountService;
|
||||||
import cn.com.tenlion.operator.util.EncryptUtil;
|
import cn.com.tenlion.operator.util.EncryptUtil;
|
||||||
@ -100,7 +101,7 @@ public class AccountItemServiceImpl extends DefaultBaseService implements IAccou
|
|||||||
new1 = old1 + accountItemVO.getAccountMoney();
|
new1 = old1 + accountItemVO.getAccountMoney();
|
||||||
} else {
|
} else {
|
||||||
new1 = old1 - accountItemVO.getAccountMoney();
|
new1 = old1 - accountItemVO.getAccountMoney();
|
||||||
if(new1 == null || new1 < 0) {
|
if (accountItemVO.getIsPostpaid() == 0 && new1 < 0) {
|
||||||
throw new SaveException("余额不足抵扣");
|
throw new SaveException("余额不足抵扣");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,20 @@
|
|||||||
|
package cn.com.tenlion.operator.service.user;
|
||||||
|
|
||||||
|
import cn.com.tenlion.operator.service.account.IAccountService;
|
||||||
|
import ink.wgink.exceptions.base.SystemException;
|
||||||
|
import ink.wgink.interfaces.user.IUserSaveAfterHandler;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class UserSaveAfterHandlerImpl implements IUserSaveAfterHandler {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IAccountService iAccountService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void handle(String userId, String username, String userName) throws SystemException {
|
||||||
|
iAccountService.saveCreate("普通用户", userId);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -11,6 +11,7 @@
|
|||||||
<result column="price_material_agent_urgent" property="priceMaterialAgentUrgent"/>
|
<result column="price_material_agent_urgent" property="priceMaterialAgentUrgent"/>
|
||||||
<result column="available_proj_type" property="availableProjType"/>
|
<result column="available_proj_type" property="availableProjType"/>
|
||||||
<result column="postpaid" property="postpaid"/>
|
<result column="postpaid" property="postpaid"/>
|
||||||
|
<result column="postpaid_count" property="postpaidCount"/>
|
||||||
<result column="free_proj_count" property="freeProjCount"/>
|
<result column="free_proj_count" property="freeProjCount"/>
|
||||||
<result column="correction_count" property="correctionCount"/>
|
<result column="correction_count" property="correctionCount"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
@ -24,6 +25,7 @@
|
|||||||
<result column="price_material_agent_urgent" property="priceMaterialAgentUrgent"/>
|
<result column="price_material_agent_urgent" property="priceMaterialAgentUrgent"/>
|
||||||
<result column="available_proj_type" property="availableProjType"/>
|
<result column="available_proj_type" property="availableProjType"/>
|
||||||
<result column="postpaid" property="postpaid"/>
|
<result column="postpaid" property="postpaid"/>
|
||||||
|
<result column="postpaid_count" property="postpaidCount"/>
|
||||||
<result column="free_proj_count" property="freeProjCount"/>
|
<result column="free_proj_count" property="freeProjCount"/>
|
||||||
<result column="correction_count" property="correctionCount"/>
|
<result column="correction_count" property="correctionCount"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
@ -39,6 +41,7 @@
|
|||||||
price_material_agent_urgent,
|
price_material_agent_urgent,
|
||||||
available_proj_type,
|
available_proj_type,
|
||||||
postpaid,
|
postpaid,
|
||||||
|
postpaid_count,
|
||||||
free_proj_count,
|
free_proj_count,
|
||||||
correction_count
|
correction_count
|
||||||
) VALUES (
|
) VALUES (
|
||||||
@ -51,6 +54,7 @@
|
|||||||
#{priceMaterialAgentUrgent},
|
#{priceMaterialAgentUrgent},
|
||||||
#{availableProjType},
|
#{availableProjType},
|
||||||
#{postpaid},
|
#{postpaid},
|
||||||
|
#{postpaidCount},
|
||||||
#{freeProjCount},
|
#{freeProjCount},
|
||||||
#{correctionCount}
|
#{correctionCount}
|
||||||
)
|
)
|
||||||
@ -68,6 +72,7 @@
|
|||||||
price_material_agent_urgent = #{priceMaterialAgentUrgent},
|
price_material_agent_urgent = #{priceMaterialAgentUrgent},
|
||||||
available_proj_type = #{availableProjType},
|
available_proj_type = #{availableProjType},
|
||||||
postpaid = #{postpaid},
|
postpaid = #{postpaid},
|
||||||
|
postpaid_count = #{postpaidCount},
|
||||||
free_proj_count = #{freeProjCount},
|
free_proj_count = #{freeProjCount},
|
||||||
correction_count = #{correctionCount}
|
correction_count = #{correctionCount}
|
||||||
WHERE
|
WHERE
|
||||||
@ -84,6 +89,7 @@
|
|||||||
price_material_agent_urgent,
|
price_material_agent_urgent,
|
||||||
available_proj_type,
|
available_proj_type,
|
||||||
postpaid,
|
postpaid,
|
||||||
|
postpaid_count,
|
||||||
free_proj_count,
|
free_proj_count,
|
||||||
correction_count
|
correction_count
|
||||||
FROM
|
FROM
|
||||||
@ -104,6 +110,7 @@
|
|||||||
price_material_agent_urgent,
|
price_material_agent_urgent,
|
||||||
available_proj_type,
|
available_proj_type,
|
||||||
postpaid,
|
postpaid,
|
||||||
|
postpaid_count,
|
||||||
free_proj_count,
|
free_proj_count,
|
||||||
correction_count
|
correction_count
|
||||||
FROM
|
FROM
|
||||||
|
@ -90,6 +90,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class=" layui-row layui-col-space15">
|
||||||
<div class="layui-col-xs6">
|
<div class="layui-col-xs6">
|
||||||
<div class="layui-form-item">
|
<div class="layui-form-item">
|
||||||
<label class="layui-form-label layui-form-label-new">后付费用户</label>
|
<label class="layui-form-label layui-form-label-new">后付费用户</label>
|
||||||
@ -98,6 +100,14 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="layui-col-xs6">
|
||||||
|
<div class="layui-form-item">
|
||||||
|
<label class="layui-form-label layui-form-label-new">后付费数量</label>
|
||||||
|
<div class="layui-input-block layui-input-block-new">
|
||||||
|
<input type="number" id="postpaidCount" name="postpaidCount" class="layui-input" value="" placeholder="后付费数量(后付费激活有效),0不限制" maxlength="50">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class=" layui-row layui-col-space15">
|
<div class=" layui-row layui-col-space15">
|
||||||
<div class="layui-col-xs6">
|
<div class="layui-col-xs6">
|
||||||
@ -211,7 +221,7 @@
|
|||||||
if(key.indexOf('availableProjType') === 0) {
|
if(key.indexOf('availableProjType') === 0) {
|
||||||
availableProjTypeArray.push(key.split('[')[1].split(']')[0]);
|
availableProjTypeArray.push(key.split('[')[1].split(']')[0]);
|
||||||
}
|
}
|
||||||
if(key.indexOf('postpaid') === 0) {
|
if(key.indexOf('postpaid[') === 0) {
|
||||||
postpaidArray.push(key.split('[')[1].split(']')[0]);
|
postpaidArray.push(key.split('[')[1].split(']')[0]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user