From c7f624f62a3cb5e6db90c3494ffa3947bd756c4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AE=B8=E5=85=81=E6=9E=9E?= <3422692813@qq.com> Date: Wed, 16 Oct 2024 13:28:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B010.16?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/FleetMemberController.java | 10 + .../fleet/service/FleetMemberService.java | 7 + .../service/impl/FleetMemberServiceImpl.java | 43 ++ .../pagesMy/fleetMember/addMember.vue | 505 +++++++++--------- 4 files changed, 317 insertions(+), 248 deletions(-) diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/fleet/controller/FleetMemberController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/fleet/controller/FleetMemberController.java index b6cf39bf3..d2d2cbcc0 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/fleet/controller/FleetMemberController.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/fleet/controller/FleetMemberController.java @@ -92,6 +92,16 @@ public class FleetMemberController extends BaseController { public ResponseObject add(@RequestBody FleetMember fleetMember) { return getSuccessResult(fleetMemberService.insert(fleetMember)); } + /** + * 新增数据(小程序) + * + * @param fleetMember 实体 + * @return 新增结果 + */ + @PostMapping("addUni") + public ResponseObject addUni(@RequestBody FleetMember fleetMember) { + return getSuccessResult(fleetMemberService.insertUni(fleetMember)); + } /** * 编辑数据 diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/fleet/service/FleetMemberService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/fleet/service/FleetMemberService.java index 6934d28e9..fa3b5eb6f 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/fleet/service/FleetMemberService.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/fleet/service/FleetMemberService.java @@ -49,6 +49,13 @@ public interface FleetMemberService { * @return 实例对象 */ int insert(FleetMember fleetMember); + /** + * 新增数据 + * + * @param fleetMember 实例对象 + * @return 实例对象 + */ + int insertUni(FleetMember fleetMember); /** * 新增数据 diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/fleet/service/impl/FleetMemberServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/fleet/service/impl/FleetMemberServiceImpl.java index 7f8b542a9..7a153b6a9 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/fleet/service/impl/FleetMemberServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/fleet/service/impl/FleetMemberServiceImpl.java @@ -167,6 +167,49 @@ public class FleetMemberServiceImpl extends ServiceImpl() + .eq(FleetMember::getMobile, fleetMember.getMobile()) + .last("limit 1")); + if (ObjectUtil.isNotEmpty(fleetMember2)) { +// throw new RuntimeException("该用户已绑定车队"); + return 0; + } + + //判断当前车队成员否存在账号 + MtUser mtUser = mtUserMapper.selectOne(new LambdaQueryWrapper() + .eq(MtUser::getMobile, fleetMember.getMobile()) + .last("limit 1")); + if (ObjectUtil.isEmpty(mtUser)) { + //注册用户 + mtUser = new MtUser(); + mtUser.setUserNo(editUserNo()); + mtUser.setMobile(fleetMember.getMobile()); + mtUser.setName(fleetMember.getName()); + mtUser.setDescription("车队成员自动注册"); + mtUser.setCreateTime(DateUtil.date()); + mtUserMapper.insert(mtUser); + + createVaseInfo(mtUser, nowAccountInfo.getStoreId().toString(), null, null); + } + + fleetMember.setUserId(mtUser.getId()); + fleetMember.setCarNum(mtUser.getCarNo()); + fleetMember.setStoreId(nowAccountInfo.getStoreId()); + fleetMember.setChainStoreId(nowAccountInfo.getChainStoreId()); + return baseMapper.insert(fleetMember); + } + @Override public int insertFleetMember(FleetMemberVo fleetMember) { FleetMember fleetMember1 = queryByMobile(fleetMember); diff --git a/gasStation-uni/pagesMy/fleetMember/addMember.vue b/gasStation-uni/pagesMy/fleetMember/addMember.vue index 78a916890..ae39909ae 100644 --- a/gasStation-uni/pagesMy/fleetMember/addMember.vue +++ b/gasStation-uni/pagesMy/fleetMember/addMember.vue @@ -1,272 +1,281 @@ \ No newline at end of file +.but-sub { + width: 305px; + height: 40px; + line-height: 40px; + margin: 0 auto; + background-color: #FF9655; + color: white; + border-radius: 50px; + text-align: center; + position: absolute; + bottom: 40px; + left: 11%; +} +