| @@ -2,14 +2,10 @@ package com.iformall.controller.rent; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.annotation.SystemControllerLog; | |||
| import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.controller.base.BaseController; | |||
| import com.iformall.domain.po.BaseEntity; | |||
| import com.iformall.domain.po.WxBillRent; | |||
| import com.iformall.domain.po.WxBillSettle; | |||
| import com.iformall.domain.po.WxBillSettleRecord; | |||
| import com.iformall.service.WxBillRentService; | |||
| import com.iformall.service.WxBillSettleRecordService; | |||
| import com.iformall.service.WxBillSettleService; | |||
| import io.swagger.annotations.ApiImplicitParam; | |||
| @@ -19,7 +15,6 @@ import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.web.bind.annotation.*; | |||
| import javax.servlet.http.HttpServletRequest; | |||
| import javax.servlet.http.HttpServletResponse; | |||
| @@ -53,21 +48,13 @@ public class WxBillSettleController extends BaseController { | |||
| return new ResultData(page); | |||
| } | |||
| @PostMapping("add") | |||
| @ApiOperation("账单管理-结算单-新增") | |||
| @SystemControllerLog(description = "账单管理-结算单-新增") | |||
| public ResultData add(@RequestBody WxBillSettle wxBillSettle) { | |||
| logger.debug("[" + getIpAddr() + "] WxBillSettleController::add"); | |||
| @PostMapping("addOrUpdate") | |||
| @ApiOperation("账单管理-结算单-新增或编辑") | |||
| @SystemControllerLog(description = "账单管理-结算单-新增或编辑") | |||
| public ResultData addOrUpdate(@RequestBody WxBillSettle wxBillSettle) { | |||
| logger.debug("[" + getIpAddr() + "] WxBillSettleController::addOrUpdate"); | |||
| wxBillSettle.setTenantId(getTenantId()); | |||
| return wxBillSettleService.saveOrUpdate(wxBillSettle); | |||
| } | |||
| @PostMapping("update") | |||
| @ApiOperation("账单管理-结算单-更新") | |||
| @SystemControllerLog(description = "账单管理-结算单-更新") | |||
| public ResultData update(@RequestBody WxBillSettle wxBillSettle) { | |||
| logger.debug("[" + getIpAddr() + "] WxBillSettleController::update"); | |||
| return wxBillSettleService.saveOrUpdate(wxBillSettle); | |||
| return wxBillSettleService.saveOrUpdate(wxBillSettle,getUser()); | |||
| } | |||
| @GetMapping("exportSettle") | |||
| @@ -8,6 +8,7 @@ import javax.persistence.Table; | |||
| import javax.persistence.Transient; | |||
| import java.util.Date; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| /** | |||
| * @author luozukai | |||
| @@ -46,5 +47,7 @@ public class WxBillSettle extends BaseEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updatetime") | |||
| private Date updatetime; | |||
| @Transient | |||
| @io.swagger.annotations.ApiModelProperty(value = "审批流参数", name = "flowParams") | |||
| private Map<String, Object> flowParams; | |||
| } | |||
| @@ -2,6 +2,7 @@ package com.iformall.service; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.MallUserInfo; | |||
| import com.iformall.domain.po.WxBillSettle; | |||
| import javax.servlet.http.HttpServletRequest; | |||
| @@ -33,7 +34,7 @@ public interface WxBillSettleService { | |||
| * | |||
| * @param record | |||
| */ | |||
| ResultData saveOrUpdate(WxBillSettle record); | |||
| ResultData saveOrUpdate(WxBillSettle record, MallUserInfo userInfo); | |||
| void exportBill(HttpServletRequest request, HttpServletResponse response, WxBillSettle wxBillSettle); | |||
| } | |||
| @@ -1,12 +1,17 @@ | |||
| package com.iformall.service.impl; | |||
| import com.github.pagehelper.PageHelper; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.IdWorker; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.MallUserInfo; | |||
| import com.iformall.domain.po.WxBillSettle; | |||
| import com.iformall.mapper.WxBillSettleMapper; | |||
| import com.iformall.service.WxBillSettleService; | |||
| import com.iformall.service.WxFlowService; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.stereotype.Service; | |||
| import org.springframework.transaction.annotation.Transactional; | |||
| import javax.servlet.http.HttpServletRequest; | |||
| import javax.servlet.http.HttpServletResponse; | |||
| @@ -18,20 +23,35 @@ import javax.servlet.http.HttpServletResponse; | |||
| public class WxBillSettleServiceImpl implements WxBillSettleService { | |||
| @Autowired | |||
| private WxBillSettleMapper wxBillSettleMapper; | |||
| @Autowired | |||
| private WxFlowService wxFlowService; | |||
| @Override | |||
| public PageInfo<WxBillSettle> listAsPage(WxBillSettle record, Integer pageIndex, Integer pageSize) { | |||
| return null; | |||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxBillSettleMapper.findList(record)); | |||
| } | |||
| @Override | |||
| public WxBillSettle getById(Long id) { | |||
| return null; | |||
| return wxBillSettleMapper.selectByPrimaryKey(id); | |||
| } | |||
| @Override | |||
| public ResultData saveOrUpdate(WxBillSettle record) { | |||
| return null; | |||
| @Transactional | |||
| public ResultData saveOrUpdate(WxBillSettle record, MallUserInfo userInfo) { | |||
| if (record.getId() == null) { | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| record.setId(idWorker.nextId()); | |||
| wxBillSettleMapper.insertSelective(record); | |||
| } else { | |||
| wxBillSettleMapper.updateByPrimaryKeySelective(record); | |||
| } | |||
| //启动审批流 | |||
| record.getFlowParams().put("businessId",record.getId()); | |||
| if (record.getFlowParams() != null && record.getFlowParams().size() > 0) { | |||
| wxFlowService.start(record.getFlowParams(), userInfo.getId(), userInfo.getName(), record.getTenantId()); | |||
| } | |||
| return new ResultData(); | |||
| } | |||
| @Override | |||