| @@ -44,12 +44,14 @@ public class WxBillDailyController extends BaseController | |||
| public ResultData add(@RequestBody WxBillDaily wxBillDaily) { | |||
| logger.debug("[" + getIpAddr() + "] WxBillDailyController::add"); | |||
| wxBillDaily.setTenantId(getTenantId()); | |||
| wxBillDaily.setUserId(getUser().getId()); | |||
| return wxBillDailyService.saveOrUpdate(wxBillDaily); | |||
| } | |||
| @PostMapping("update") | |||
| public ResultData update(@RequestBody WxBillDaily wxBillDaily) { | |||
| logger.debug("[" + getIpAddr() + "] WxBillDailyController::update"); | |||
| wxBillDaily.setUserId(getUser().getId()); | |||
| return wxBillDailyService.saveOrUpdate(wxBillDaily); | |||
| } | |||
| @@ -44,12 +44,14 @@ public class WxBillOtherController extends BaseController | |||
| public ResultData add(@RequestBody WxBillOther wxBillOther) { | |||
| logger.debug("[" + getIpAddr() + "] WxBillOtherController::add"); | |||
| wxBillOther.setTenantId(getTenantId()); | |||
| wxBillOther.setUserId(getUser().getId()); | |||
| return wxBillOtherService.saveOrUpdate(wxBillOther); | |||
| } | |||
| @PostMapping("update") | |||
| public ResultData update(@RequestBody WxBillOther wxBillOther) { | |||
| logger.debug("[" + getIpAddr() + "] WxBillOtherController::update"); | |||
| wxBillOther.setUserId(getUser().getId()); | |||
| return wxBillOtherService.saveOrUpdate(wxBillOther); | |||
| } | |||
| @@ -96,7 +96,7 @@ public class WxMerchantController extends BaseController { | |||
| public ResultData addMerchant(@RequestBody WxMerchant wxMerchant) { | |||
| logger.debug("[" + getIpAddr() + "] WxMerchantController::addMerchant"); | |||
| wxMerchant.setTenantId(getTenantId()); | |||
| return wxMerchantService.addMerchant(wxMerchant); | |||
| return wxMerchantService.addMerchant(wxMerchant, getUser().getId()); | |||
| } | |||
| @ApiOperation("更新商户接口") | |||
| @@ -45,14 +45,14 @@ public class WxPropertyContractController extends BaseController | |||
| public ResultData add(@RequestBody WxPropertyContract wxPropertyContract) { | |||
| logger.debug("[" + getIpAddr() + "] WxPropertyContractController::add"); | |||
| wxPropertyContract.setTenantId(getTenantId()); | |||
| return wxPropertyContractService.saveOrUpdate(wxPropertyContract); | |||
| return wxPropertyContractService.saveOrUpdate(wxPropertyContract, getUser().getId()); | |||
| } | |||
| @PostMapping("update") | |||
| public ResultData update(@RequestBody WxPropertyContract wxPropertyContract) { | |||
| logger.debug("[" + getIpAddr() + "] WxPropertyContractController::update"); | |||
| wxPropertyContract.setTenantId(getTenantId()); | |||
| return wxPropertyContractService.saveOrUpdate(wxPropertyContract); | |||
| return wxPropertyContractService.saveOrUpdate(wxPropertyContract, getUser().getId()); | |||
| } | |||
| @GetMapping("/del") | |||
| @@ -44,28 +44,28 @@ public class WxRentContractController extends BaseController { | |||
| public ResultData add(@RequestBody WxRentContract wxRentContract) { | |||
| logger.debug("[" + getIpAddr() + "] WxRentContractController::add"); | |||
| wxRentContract.setTenantId(getTenantId()); | |||
| return wxRentContractService.save(wxRentContract); | |||
| return wxRentContractService.save(wxRentContract, getUser().getId()); | |||
| } | |||
| @PostMapping("update") | |||
| public ResultData update(@RequestBody WxRentContract wxRentContract) { | |||
| logger.debug("[" + getIpAddr() + "] WxRentContractController::update"); | |||
| wxRentContract.setTenantId(getTenantId()); | |||
| return wxRentContractService.update(wxRentContract); | |||
| return wxRentContractService.update(wxRentContract, getUser().getId()); | |||
| } | |||
| @PostMapping("updateMoney") | |||
| public ResultData updateMoney(@RequestBody WxRentContract wxRentContract) { | |||
| logger.debug("[" + getIpAddr() + "] WxRentContractController::updateMoney"); | |||
| wxRentContract.setTenantId(getTenantId()); | |||
| return wxRentContractService.update(wxRentContract); | |||
| return wxRentContractService.update(wxRentContract, getUser().getId()); | |||
| } | |||
| @PostMapping("updateFile") | |||
| public ResultData updateFile(@RequestBody WxRentContract wxRentContract) { | |||
| logger.debug("[" + getIpAddr() + "] WxRentContractController::updateFile"); | |||
| wxRentContract.setTenantId(getTenantId()); | |||
| return wxRentContractService.updateFile(wxRentContract); | |||
| return wxRentContractService.updateFile(wxRentContract, getUser().getId()); | |||
| } | |||
| @@ -130,7 +130,7 @@ public class WxRentContractController extends BaseController { | |||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||
| public ResultData updateRentContractStatus(Long id) { | |||
| logger.debug("[" + getIpAddr() + "] WxRentContractController::updateRentContractStatus"); | |||
| return wxRentContractService.updateRentContractStatus(id); | |||
| return wxRentContractService.updateRentContractStatus(id, getUser().getId()); | |||
| } | |||
| } | |||
| @@ -65,7 +65,7 @@ public interface WxMerchantService { | |||
| void disable(Long id); | |||
| ResultData addMerchant(WxMerchant wxMerchant); | |||
| ResultData addMerchant(WxMerchant wxMerchant, Long userId); | |||
| ResultData updateMerchant(WxMerchant wxMerchant); | |||
| @@ -35,7 +35,7 @@ public interface WxPropertyContractService { | |||
| * | |||
| * @param record | |||
| */ | |||
| ResultData saveOrUpdate(WxPropertyContract record); | |||
| ResultData saveOrUpdate(WxPropertyContract record, Long userId); | |||
| /** | |||
| * 根据Id删除实体 | |||
| @@ -34,10 +34,11 @@ public interface WxRentContractService { | |||
| * 保存或更新实体 | |||
| * | |||
| * @param record | |||
| * @param id | |||
| */ | |||
| ResultData save(WxRentContract record); | |||
| ResultData save(WxRentContract record, Long userId); | |||
| ResultData update(WxRentContract record); | |||
| ResultData update(WxRentContract record, Long userId); | |||
| /** | |||
| * 根据Id删除实体 | |||
| @@ -59,8 +60,8 @@ public interface WxRentContractService { | |||
| void exportContract(HttpServletRequest request, HttpServletResponse response, String tenantId, Long id); | |||
| ResultData updateFile(WxRentContract wxRentContract); | |||
| ResultData updateFile(WxRentContract wxRentContract, Long userId); | |||
| ResultData updateRentContractStatus(Long id); | |||
| ResultData updateRentContractStatus(Long id, Long userId); | |||
| } | |||
| @@ -6,7 +6,6 @@ import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.IdWorker; | |||
| import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.MallUserInfo; | |||
| import com.iformall.domain.po.WxBillDaily; | |||
| import com.iformall.domain.po.WxShop; | |||
| import com.iformall.enums.EnumBillDailyStatus; | |||
| @@ -16,7 +15,6 @@ import com.iformall.exception.MallinkException; | |||
| import com.iformall.mapper.WxBillDailyMapper; | |||
| import com.iformall.mapper.WxShopMapper; | |||
| import com.iformall.service.WxBillDailyService; | |||
| import org.apache.shiro.SecurityUtils; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| @@ -117,7 +115,6 @@ public class WxBillDailyServiceImpl implements WxBillDailyService { | |||
| return new ResultData(ErrorCode.BILL_PAY_ERROR.getCode(),"实收金额不能大于实际应收金额"); | |||
| } | |||
| MallUserInfo user = (MallUserInfo) SecurityUtils.getSubject().getSession().getAttribute("userSession"); | |||
| if (record.getId() == null) { | |||
| logger.info("新增日常账单"); | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| @@ -126,7 +123,6 @@ public class WxBillDailyServiceImpl implements WxBillDailyService { | |||
| record.setStatus(record.getReceiveDate().after(date)?EnumBillDailyStatus.WAIT_PAY.getCode():EnumBillDailyStatus.NOT_PAID.getCode()); | |||
| record.setCreatetime(date); | |||
| record.setUpdatetime(date); | |||
| record.setUserId(user.getId()); | |||
| record.setExpiredDay(0L); | |||
| record.setOwe(record.getReceivePay()-record.getPay()); | |||
| record.setIsDel(EnumDelStatus.NOT_DEL.getCode()); | |||
| @@ -149,7 +145,6 @@ public class WxBillDailyServiceImpl implements WxBillDailyService { | |||
| wxBillDaily.setOwe(record.getReceivePay()-record.getPay()); | |||
| wxBillDaily.setStatus(record.getPay().equals(record.getReceivePay()) ? EnumBillDailyStatus.PAID.getCode() : wxBillDaily.getStatus()); | |||
| wxBillDaily.setUpdatetime(new Date()); | |||
| wxBillDaily.setUserId(user.getId()); | |||
| try { | |||
| wxBillDailyMapper.updateByPrimaryKeySelective(wxBillDaily); | |||
| } catch (Exception e) { | |||
| @@ -6,7 +6,6 @@ import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.IdWorker; | |||
| import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.MallUserInfo; | |||
| import com.iformall.domain.po.WxBillOther; | |||
| import com.iformall.domain.po.WxShop; | |||
| import com.iformall.enums.EnumBillDailyStatus; | |||
| @@ -16,7 +15,6 @@ import com.iformall.exception.MallinkException; | |||
| import com.iformall.mapper.WxBillOtherMapper; | |||
| import com.iformall.mapper.WxShopMapper; | |||
| import com.iformall.service.WxBillOtherService; | |||
| import org.apache.shiro.SecurityUtils; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| @@ -116,7 +114,6 @@ public class WxBillOtherServiceImpl implements WxBillOtherService { | |||
| if(pay>receivepay){ | |||
| return new ResultData(ErrorCode.BILL_PAY_ERROR,"实收金额不能大于实际应收金额"); | |||
| } | |||
| MallUserInfo user = (MallUserInfo) SecurityUtils.getSubject().getSession().getAttribute("userSession"); | |||
| if (record.getId() == null) { | |||
| logger.info("新增其他账单"); | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| @@ -125,7 +122,6 @@ public class WxBillOtherServiceImpl implements WxBillOtherService { | |||
| record.setStatus(record.getReceiveDate().after(date)?EnumBillDailyStatus.WAIT_PAY.getCode():EnumBillDailyStatus.NOT_PAID.getCode()); | |||
| record.setCreatetime(date); | |||
| record.setUpdatetime(date); | |||
| record.setUserId(user.getId()); | |||
| record.setExpiredDay(0L); | |||
| record.setOwe(record.getReceivePay()-record.getPay()); | |||
| record.setIsDel(EnumDelStatus.NOT_DEL.getCode()); | |||
| @@ -148,7 +144,6 @@ public class WxBillOtherServiceImpl implements WxBillOtherService { | |||
| wxBillOther.setOwe(record.getReceivePay()-record.getPay()); | |||
| wxBillOther.setStatus(record.getPay().equals(record.getReceivePay()) ? EnumBillDailyStatus.PAID.getCode() : wxBillOther.getStatus()); | |||
| wxBillOther.setUpdatetime(new Date()); | |||
| wxBillOther.setUserId(user.getId()); | |||
| try { | |||
| wxBillOtherMapper.updateByPrimaryKeySelective(wxBillOther); | |||
| } catch (Exception e) { | |||
| @@ -14,7 +14,6 @@ import com.iformall.mapper.*; | |||
| import com.iformall.service.WxCouponService; | |||
| import com.iformall.service.WxMerchantService; | |||
| import com.iformall.service.WxProfitSharingReceiverService; | |||
| import org.apache.shiro.SecurityUtils; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| @@ -251,7 +250,7 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||
| @Transactional(rollbackFor = {Exception.class}) | |||
| @Override | |||
| public ResultData addMerchant(WxMerchant wxMerchant) { | |||
| public ResultData addMerchant(WxMerchant wxMerchant, Long userId) { | |||
| try { | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| @@ -312,9 +311,9 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||
| wxRentContract.setStatus(EnumRentContractStatus.SIGNED_RENT_UNPAID.getCode()); | |||
| wxRentContractMapper.updateByPrimaryKeySelective(wxRentContract); | |||
| //创建账单 | |||
| buildRent(wxMerchant); | |||
| buildRent(wxMerchant, userId); | |||
| //创建押金 | |||
| buildDeposit(wxMerchant); | |||
| buildDeposit(wxMerchant, userId); | |||
| } | |||
| return new ResultData(Result.SUCCESS, "商户创建成功", merchantId); | |||
| } catch (Exception e) { | |||
| @@ -510,8 +509,7 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||
| @Transactional(rollbackFor = {Exception.class}) | |||
| public void buildDeposit(WxMerchant wxMerchant) { | |||
| MallUserInfo user = (MallUserInfo) SecurityUtils.getSubject().getSession().getAttribute("userSession"); | |||
| public void buildDeposit(WxMerchant wxMerchant, Long userId) { | |||
| WxRentContract wxRentContract = new WxRentContract(); | |||
| wxRentContract.setMerchantId(wxMerchant.getId()); | |||
| List<WxRentContract> list = wxRentContractMapper.findList(wxRentContract); | |||
| @@ -558,7 +556,7 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||
| wxBillDeposit.setTenantId(wxMerchant.getTenantId()); | |||
| wxBillDeposit.setIsDel(0); | |||
| wxBillDeposit.setMerchantId(wxMerchant.getId()); | |||
| wxBillDeposit.setUserId(user.getId()); | |||
| wxBillDeposit.setUserId(userId); | |||
| wxBillDeposit.setShopId(wxRentContract.getShopId()); | |||
| wxBillDeposit.setCreatetime(date); | |||
| wxBillDeposit.setUpdatetime(date); | |||
| @@ -572,10 +570,8 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||
| } | |||
| @Transactional(rollbackFor = {Exception.class}) | |||
| public void buildRent(WxMerchant wxMerchant) { | |||
| public void buildRent(WxMerchant wxMerchant, Long userId) { | |||
| //获取用户 | |||
| MallUserInfo user = (MallUserInfo) SecurityUtils.getSubject().getSession().getAttribute("userSession"); | |||
| WxRentContract wxRentContract = new WxRentContract(); | |||
| wxRentContract.setMerchantId(wxMerchant.getId()); | |||
| //根据商户ID找出合同 | |||
| @@ -656,7 +652,7 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||
| wxBillRent.setTenantId(wxRentContract.getTenantId()); | |||
| wxBillRent.setIsDel(0); | |||
| wxBillRent.setMerchantId(wxRentContract.getMerchantId()); | |||
| wxBillRent.setUserId(user.getId()); | |||
| wxBillRent.setUserId(userId); | |||
| wxBillRent.setShopId(wxRentContract.getShopId()); | |||
| wxBillRent.setCreatetime(date); | |||
| wxBillRent.setUpdatetime(date); | |||
| @@ -15,7 +15,6 @@ import com.iformall.exception.MallinkException; | |||
| import com.iformall.mapper.*; | |||
| import com.iformall.service.WxPropertyContractService; | |||
| import com.iformall.utils.Constant; | |||
| import org.apache.shiro.SecurityUtils; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| @@ -100,7 +99,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||
| } | |||
| @Override | |||
| public ResultData saveOrUpdate(WxPropertyContract record) { | |||
| public ResultData saveOrUpdate(WxPropertyContract record, Long userId) { | |||
| if (null == record.getShopId()) { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL, "shopId不能为空"); | |||
| @@ -188,9 +187,9 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||
| wxMerchant.setId(record.getMerchantId()); | |||
| wxMerchant.setTenantId(record.getTenantId()); | |||
| //物业账单 | |||
| buildProperty(wxMerchant); | |||
| buildProperty(wxMerchant, userId); | |||
| //物业押金账单 | |||
| buildDeposit(wxMerchant); | |||
| buildDeposit(wxMerchant, userId); | |||
| } | |||
| } | |||
| } catch (Exception e) { | |||
| @@ -231,8 +230,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||
| } | |||
| @Transactional(rollbackFor = {Exception.class}) | |||
| public void buildDeposit(WxMerchant wxMerchant) { | |||
| MallUserInfo user = (MallUserInfo) SecurityUtils.getSubject().getSession().getAttribute("userSession"); | |||
| public void buildDeposit(WxMerchant wxMerchant, Long userId) { | |||
| WxPropertyContract wxPropertyContract = new WxPropertyContract(); | |||
| wxPropertyContract.setMerchantId(wxMerchant.getId()); | |||
| List<WxPropertyContract> list = wxPropertyContractMapper.findList(wxPropertyContract); | |||
| @@ -276,7 +274,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||
| wxBillDeposit.setTenantId(wxMerchant.getTenantId()); | |||
| wxBillDeposit.setIsDel(0); | |||
| wxBillDeposit.setMerchantId(wxMerchant.getId()); | |||
| wxBillDeposit.setUserId(user.getId()); | |||
| wxBillDeposit.setUserId(userId); | |||
| wxBillDeposit.setShopId(wxPropertyContract.getShopId()); | |||
| wxBillDeposit.setCreatetime(date); | |||
| wxBillDeposit.setUpdatetime(date); | |||
| @@ -291,9 +289,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||
| } | |||
| @Transactional(rollbackFor = {Exception.class}) | |||
| public void buildProperty(WxMerchant wxMerchant) { | |||
| //获取用户 | |||
| MallUserInfo user = (MallUserInfo) SecurityUtils.getSubject().getSession().getAttribute("userSession"); | |||
| public void buildProperty(WxMerchant wxMerchant, Long userId) { | |||
| //根据商户ID找出合同 | |||
| WxPropertyContract wxPropertyContract = new WxPropertyContract(); | |||
| wxPropertyContract.setMerchantId(wxMerchant.getId()); | |||
| @@ -371,7 +367,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||
| wxBillProperty.setTenantId(wxMerchant.getTenantId()); | |||
| wxBillProperty.setIsDel(0); | |||
| wxBillProperty.setMerchantId(wxMerchant.getId()); | |||
| wxBillProperty.setUserId(user.getId()); | |||
| wxBillProperty.setUserId(userId); | |||
| wxBillProperty.setShopId(wxPropertyContract.getShopId()); | |||
| wxBillProperty.setCreatetime(date); | |||
| wxBillProperty.setUpdatetime(date); | |||
| @@ -18,7 +18,6 @@ import com.iformall.utils.DateUtils; | |||
| import org.apache.commons.io.FileUtils; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| import org.apache.poi.xwpf.usermodel.XWPFDocument; | |||
| import org.apache.shiro.SecurityUtils; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| @@ -116,7 +115,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| @Transactional(rollbackFor = {Exception.class}) | |||
| @Override | |||
| public ResultData save(WxRentContract record) { | |||
| public ResultData save(WxRentContract record, Long userId) { | |||
| //保存租赁合同信息 | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| record.setId(idWorker.nextId()); | |||
| @@ -176,9 +175,9 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| wxMerchant.setId(record.getMerchantId()); | |||
| wxMerchant.setTenantId(record.getTenantId()); | |||
| //租金 | |||
| buildRent(wxMerchant); | |||
| buildRent(wxMerchant, userId); | |||
| //押金 | |||
| buildDeposit(wxMerchant); | |||
| buildDeposit(wxMerchant, userId); | |||
| } | |||
| } | |||
| } catch (Exception e) { | |||
| @@ -190,11 +189,11 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| @Transactional(rollbackFor = {Exception.class}) | |||
| @Override | |||
| public ResultData update(WxRentContract record) { | |||
| return getResultDataForUpdate(record); | |||
| public ResultData update(WxRentContract record, Long userId) { | |||
| return getResultDataForUpdate(record, userId); | |||
| } | |||
| public ResultData getResultDataForUpdate(WxRentContract record) { | |||
| public ResultData getResultDataForUpdate(WxRentContract record, Long userId) { | |||
| //更新租赁合同信息 | |||
| WxRentContract wxRentContract = wxRentContractMapper.selectByPrimaryKey(record.getId()); | |||
| if (wxRentContract == null) { | |||
| @@ -252,9 +251,9 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| wxMerchant.setId(record.getMerchantId()); | |||
| wxMerchant.setTenantId(record.getTenantId()); | |||
| //租金 | |||
| buildRent(wxMerchant); | |||
| buildRent(wxMerchant, userId); | |||
| //押金 | |||
| buildDeposit(wxMerchant); | |||
| buildDeposit(wxMerchant, userId); | |||
| } | |||
| } | |||
| } catch (Exception e) { | |||
| @@ -266,8 +265,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| @Transactional(rollbackFor = {Exception.class}) | |||
| public void buildDeposit(WxMerchant wxMerchant) { | |||
| MallUserInfo user = (MallUserInfo) SecurityUtils.getSubject().getSession().getAttribute("userSession"); | |||
| public void buildDeposit(WxMerchant wxMerchant, Long userId) { | |||
| WxRentContract wxRentContract = new WxRentContract(); | |||
| wxRentContract.setMerchantId(wxMerchant.getId()); | |||
| List<WxRentContract> list = wxRentContractMapper.findList(wxRentContract); | |||
| @@ -316,7 +314,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| wxBillDeposit.setTenantId(wxMerchant.getTenantId()); | |||
| wxBillDeposit.setIsDel(0); | |||
| wxBillDeposit.setMerchantId(wxMerchant.getId()); | |||
| wxBillDeposit.setUserId(user.getId()); | |||
| wxBillDeposit.setUserId(userId); | |||
| wxBillDeposit.setShopId(wxRentContract.getShopId()); | |||
| wxBillDeposit.setCreatetime(date); | |||
| wxBillDeposit.setUpdatetime(date); | |||
| @@ -332,10 +330,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| } | |||
| @Transactional(rollbackFor = {Exception.class}) | |||
| public void buildRent(WxMerchant wxMerchant) { | |||
| //获取用户 | |||
| MallUserInfo user = (MallUserInfo) SecurityUtils.getSubject().getSession().getAttribute("userSession"); | |||
| public void buildRent(WxMerchant wxMerchant, Long userId) { | |||
| //根据商户ID找出合同 | |||
| WxRentContract wxRentContract = new WxRentContract(); | |||
| @@ -417,7 +412,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| wxBillRent.setTenantId(wxMerchant.getTenantId()); | |||
| wxBillRent.setIsDel(0); | |||
| wxBillRent.setMerchantId(wxMerchant.getId()); | |||
| wxBillRent.setUserId(user.getId()); | |||
| wxBillRent.setUserId(userId); | |||
| wxBillRent.setShopId(wxRentContract.getShopId()); | |||
| wxBillRent.setCreatetime(date); | |||
| wxBillRent.setUpdatetime(date); | |||
| @@ -712,12 +707,12 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| } | |||
| @Override | |||
| public ResultData updateFile(WxRentContract record) { | |||
| return getResultDataForUpdate(record); | |||
| public ResultData updateFile(WxRentContract record, Long userId) { | |||
| return getResultDataForUpdate(record, userId); | |||
| } | |||
| @Override | |||
| public ResultData updateRentContractStatus(Long id) { | |||
| public ResultData updateRentContractStatus(Long id, Long userId) { | |||
| if(id == null) { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR); | |||
| } | |||
| @@ -742,9 +737,9 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| wxMerchant.setId(record.getMerchantId()); | |||
| wxMerchant.setTenantId(record.getTenantId()); | |||
| //租金 | |||
| buildRent(wxMerchant); | |||
| buildRent(wxMerchant, userId); | |||
| //押金 | |||
| buildDeposit(wxMerchant); | |||
| buildDeposit(wxMerchant, userId); | |||
| } | |||
| } | |||
| return new ResultData(Result.SUCCESS, "操作成功"); | |||