|
@@ -60,34 +60,31 @@ public class CustomerInfoServiceImpl extends ServiceImpl<CustomerInfoMapper, Cus
|
|
|
|
|
|
|
|
|
/**
|
|
|
- * 编辑
|
|
|
- * @param id
|
|
|
- * @param money 更新的值
|
|
|
- * @param flag 0 修改定金比例 1增加定金 2 退回定金
|
|
|
+ * 增加\退回定金
|
|
|
+ * @param customerInfo
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
- public String editCustomerInfo(String id, Float money, Integer flag) {
|
|
|
+ public String editCustomerInfo(CustomerInfo customerInfo) {
|
|
|
//查询客户信息
|
|
|
- CustomerInfo customerInfo = this.selectById(id);
|
|
|
if (customerInfo != null ){
|
|
|
//0 修改定金比例
|
|
|
- if(flag == 0) {
|
|
|
- customerInfo.setDepositRatio(money);
|
|
|
+ if("0".equals(customerInfo.getFlag())) {
|
|
|
+ customerInfo.setDepositRatio(customerInfo.getDepositRatio());
|
|
|
//更改客户信息
|
|
|
this.updateById(customerInfo);
|
|
|
return "OK";
|
|
|
}
|
|
|
//1 增加定金
|
|
|
- else if(flag==1){
|
|
|
- customerInfo.setTotalDeposit(customerInfo.getTotalDeposit()+money);
|
|
|
+ else if("1".equals(customerInfo.getFlag())){
|
|
|
+ customerInfo.setTotalDeposit(customerInfo.getTotalDeposit()+customerInfo.getMoney());
|
|
|
//更改客户信息
|
|
|
this.updateById(customerInfo);
|
|
|
return "OK";
|
|
|
}
|
|
|
//2 退回定金
|
|
|
else {
|
|
|
- customerInfo.setTotalDeposit(customerInfo.getTotalDeposit()-money);
|
|
|
+ customerInfo.setTotalDeposit(customerInfo.getTotalDeposit()-customerInfo.getMoney());
|
|
|
//更改客户信息
|
|
|
this.updateById(customerInfo);
|
|
|
return "OK";
|