|
|
|
@@ -222,11 +222,14 @@ public class WxBillRentServiceImpl implements WxBillRentService { |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
@Transactional(rollbackFor = {Exception.class}) |
|
|
|
@Override |
|
|
|
public ResultData updateRevenue(WxBillRent record) { |
|
|
|
public ResultData updateRevenue(WxBillRent record, MallUserInfo user) { |
|
|
|
WxBillRent wxBillRent = wxBillRentMapper.selectByPrimaryKey(record.getId()); |
|
|
|
Long oldPrice = wxBillRent.getReceivePay(); |
|
|
|
Long newPrice = record.getReceivePay(); |
|
|
|
wxBillRent.setRevenue(record.getRevenue()); |
|
|
|
wxBillRent.setReceivePay(record.getReceivePay()); |
|
|
|
wxBillRent.setReceivePay(oldPrice.equals(newPrice) ? oldPrice : newPrice); |
|
|
|
wxBillRent.setUpdatetime(new Date()); |
|
|
|
try { |
|
|
|
wxBillRentMapper.updateByPrimaryKeySelective(wxBillRent); |
|
|
|
@@ -234,6 +237,23 @@ public class WxBillRentServiceImpl implements WxBillRentService { |
|
|
|
logger.error("修改营业额失败,e:" + e.getMessage()); |
|
|
|
throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "修改营业额失败"); |
|
|
|
} |
|
|
|
if (!oldPrice.equals(newPrice)) { |
|
|
|
//日志 |
|
|
|
WxBillAction wxBillAction = new WxBillAction(); |
|
|
|
wxBillAction.setBillId(wxBillRent.getId()); |
|
|
|
wxBillAction.setDetails("录入营业额时应收金额" + oldPrice + "元变更成" + newPrice + "元"); |
|
|
|
wxBillAction.setAction(EnumBillAction.UPDATE_BILL.getCode()); |
|
|
|
wxBillAction.setUserId(user.getId()); |
|
|
|
wxBillAction.setUserName(user.getName()); |
|
|
|
wxBillAction.setPhone(user.getPhone()); |
|
|
|
wxBillAction.setTenantId(wxBillRent.getTenantId()); |
|
|
|
try { |
|
|
|
wxBillActionService.save(wxBillAction); |
|
|
|
} catch (Exception e) { |
|
|
|
logger.error("添加租赁账单行为日志,e:" + e.getMessage()); |
|
|
|
throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "修改营业额失败"); |
|
|
|
} |
|
|
|
} |
|
|
|
return new ResultData(Result.SUCCESS, "修改营业额成功", wxBillRent); |
|
|
|
} |
|
|
|
|
|
|
|
|