| @@ -93,4 +93,11 @@ public class WxBillRentController extends BaseController { | |||||
| return new ResultData(Result.SUCCESS, "查询成功", wxBillRentService.detail(id)); | return new ResultData(Result.SUCCESS, "查询成功", wxBillRentService.detail(id)); | ||||
| } | } | ||||
| @PostMapping("updateRevenue") | |||||
| public ResultData updateRevenue(@RequestBody WxBillRent wxBillRent) { | |||||
| logger.debug("[" + getIpAddr() + "] WxBillRentController::updateRevenue"); | |||||
| return wxBillRentService.updateRevenue(wxBillRent); | |||||
| } | |||||
| } | } | ||||
| @@ -51,4 +51,7 @@ public interface WxBillRentService { | |||||
| Object detail(Long id); | Object detail(Long id); | ||||
| ResultData updateRevenue(WxBillRent wxBillRent); | |||||
| } | } | ||||
| @@ -200,4 +200,18 @@ public class WxBillRentServiceImpl implements WxBillRentService { | |||||
| return result; | return result; | ||||
| } | } | ||||
| @Override | |||||
| public ResultData updateRevenue(WxBillRent record) { | |||||
| WxBillRent wxBillRent = wxBillRentMapper.selectByPrimaryKey(record.getId()); | |||||
| wxBillRent.setRevenue(record.getRevenue()); | |||||
| wxBillRent.setUpdatetime(new Date()); | |||||
| try { | |||||
| wxBillRentMapper.updateByPrimaryKeySelective(wxBillRent); | |||||
| } catch (Exception e) { | |||||
| logger.error("修改营业额失败,e:" + e.getMessage()); | |||||
| throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); | |||||
| } | |||||
| return new ResultData(Result.SUCCESS, "修改营业额成功"); | |||||
| } | |||||
| } | } | ||||