diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/service/impl/DevInfoServiceImpl.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/service/impl/DevInfoServiceImpl.java index f894293..d7438db 100644 --- a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/service/impl/DevInfoServiceImpl.java +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/service/impl/DevInfoServiceImpl.java @@ -328,13 +328,15 @@ public class DevInfoServiceImpl implements DevInfoService { @Transactional(rollbackFor = Exception.class) public AjaxResult insertDraft(DevInfo devInfo) { //获取用户信息 - Long userId = SecurityUtils.getUserId(); + Long userId = SecurityUtils.getLoginUser().getUserid(); //保存用户信息 - devInfo.setCreator(userId).setMaStatus(TO_BE_LISTED.getCode()); + devInfo.setCreator(userId).setMaStatus(TO_BE_LISTED.getCode()).setOwnId(userId); try { if (devInfo.getMaId() != null) { devInfoMapper.deleteDevInfoByMaId(devInfo.getMaId(), MaStatusEnum.UNDER_RENT.getCode()); } + String code = getString(); + devInfo.setCode(code); int insertedDraft = devInfoMapper.insertDraft(devInfo); if (insertedDraft == 0) { return AjaxResult.error("装备草稿保存失败,请修改后重试"); diff --git a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/device/DevInfoMapper.xml b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/device/DevInfoMapper.xml index 87ace72..f5ee769 100644 --- a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/device/DevInfoMapper.xml +++ b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/device/DevInfoMapper.xml @@ -584,6 +584,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" is_operator, is_active, update_by, + own_id, #{deviceName}, @@ -619,6 +620,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{isOperator}, 1, #{updateBy}, + #{ownId},