From 3a5cab69fbe90ab060e2e275afe64d1d7fdf65b3 Mon Sep 17 00:00:00 2001 From: "2265829957@qq.com" <2265829957@qq.com> Date: Sat, 17 Jan 2026 15:26:41 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BD=A6=E9=98=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../evcs/api/CheckChargeOrderController.java | 2 +- .../com/xhpc/common/util/UserTypeUtil.java | 2 + .../controller/XhpcMotorcadeController.java | 163 ++++++ .../com/xhpc/user/domain/XhpcMotorcade.java | 105 ++++ .../user/domain/XhpcMotorcadePersonnel.java | 90 ++++ .../xhpc/user/mapper/XhpcMotorcadeMapper.java | 114 ++++ .../user/service/IXhpcMotorcadeService.java | 111 ++++ .../impl/XhpcMotorcadeServiceImpl.java | 332 ++++++++++++ .../resources/mapper/XhpcMotorcadeMapper.xml | 496 ++++++++++++++++++ 9 files changed, 1414 insertions(+), 1 deletion(-) create mode 100644 xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcMotorcadeController.java create mode 100644 xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/domain/XhpcMotorcade.java create mode 100644 xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/domain/XhpcMotorcadePersonnel.java create mode 100644 xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/mapper/XhpcMotorcadeMapper.java create mode 100644 xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/IXhpcMotorcadeService.java create mode 100644 xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcMotorcadeServiceImpl.java create mode 100644 xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcMotorcadeMapper.xml diff --git a/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/api/CheckChargeOrderController.java b/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/api/CheckChargeOrderController.java index 71a9ad4e..4aed8ce8 100644 --- a/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/api/CheckChargeOrderController.java +++ b/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/api/CheckChargeOrderController.java @@ -147,7 +147,7 @@ public class CheckChargeOrderController { // // System.out.println("==========sss==============="+s); - String date= "NR0oe4La+0SLizVoKCDfRkj37avo59qzZBUm7BFSmU+XA81uaP2614Vjbb7VvhRRumS4LwHu6CR981cKMxNM57w7bhdEl/7Q0euTasU7M8fo7HcWH9akyN4bKS3jzYeGs7Zm+J7MXj1713oBDANjUtAbzy+hFyOQH/QOl91vhehanzG9gvc5yOL/PUnSb50sVSCOGEQqF65I7nzmQrgr9PiJzV32kpb2n2GnXurZG6HJ48OAoFfKwrEUfqGTE2OSHeGi4GcPbuuhxvaiFTS4yVtlra494NGaAvpDWCW3uNeaOqdyDGXxJS6SbKRqCPlMdFGcRRAVujKsQ7Q2Yl5WK7pNFeLWC48wBDzPHpd+var8BeUf83D5v6GHDxCnrbbCEk3G2y/uPJm0P1qmEpNu/jwg7WI3rjphVXLOBtPVtdyyXBDOp+6R8WTXk4r6fVCdPznsVHb5Ikh/sW2wWrkugxplwNs11mQHhwnWCzkQSwNCYB1SKy48U5/mUPdYViWrnHBZjQrJY2F3uETvm8lTZfLVRUyuK0A7SAelsoyxAFPqyw5HEm+5K0cDvOBWZ2QMHzsTofZSw80ROVxOYjmKgIAGLjoNme2FHtqUlXiWLriesAdNLoyr6uUaELKwmJLXEhD52n0dXxhT+UbhKdmdQ3uOZUUpukUUYEbLEkNWpPUy9CZQsFeiVFF96dHHnKDXtTdzpV8ZSkU/nQ75CVOdtRynvrnrzVROrYihrbtrR4F5fq2rrdn2AJePTrFoJU1JED4RjoaAmWbTGUyUM4nfn83fe+l0twtfKLUEYtgVF2iw9wIkHGW0/rLTHr59qqX99BkgxHA0NVCbCA5X+wImk+6wGaQ9kZ1B8bSDR+X2FVR5QcDPUOOIt2q7Zc6qTZcO0b9VniYQx08D7jDXpMz+VoHjJzOgW7AsNxV/nsZwsoAa8E1MlIF42MTBg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uy2X5CD+hr5X8YR2KhJqCzc7GWusinzGAY0BVTHqkisGo8EqzacGD1mWrMSdTWqoPnzqogLbcAnzxI2Dt1HR38fEIo+sS8AtTOacrx6F8GyvRw96ZnXcnuViy3Mr58lkAZ8p3qwFfBTlsYziMfKKZSOHFV8ZUwTyyXqpE+M4iRxSCByaGDZ52MuvRg6Sowr9GaGE+gS6R4tg3/tUfebRLZEO1mZdEV/9xSFtPSUdCVLyEVAxHtjVOclI9RtJNmbzHEGhx/RKuo5BOVmiheMRXYHgwayhzpczOOJshlb93yVzVfwH6YuXUI26fEZppdF/daCx+T31xB8gYk0O+anRGEs6JueNifPISPfn818k8nKYvGb2Mim+bQT8ML9eOvl/2vVCE5He6m5mmkfmHp6cmcnAqsjU8Q11LN24JskAMfa6QmFfOUFF1vo+qIjEz7j6Ei1s7iMJAo8tXyB7HxLt5SxjaD4IXTy2mPfC8i/c0J2Bv6fhvPoJa2KPZy5hEi/sR6fvCXLHNErzbhi4HBtuKwpxPfsBZ+zPuyKf9GaAtB9Vp1P/5DZeBJWnCzpcVutWbSRwnYgIrKMj3pbHCYCwNI/9EbUJzGwy+UdD2eWeVs85iEGfQwb7usoj5/Vk9SRSyh+oV3qhnQLrDTsAwrd3EgSz7AR6y2qmgb2JY0zzobNKoEy58vb3k/Q0JlkjImwAeIhaxhjh5OgvTkH/Mz1Yg/KCDaMaI+5Hg+moVncfVkN9OQ6UW3k5E6b8qpZXmyhZ4zncCiF55IThPw3omlKQ//ck+KiF4=" ; String s2 = decryptString(date, "8LpncubmWiPCzY3V", "av6A8QdnRaVRMXu6"); diff --git a/xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/util/UserTypeUtil.java b/xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/util/UserTypeUtil.java index 92dc6454..cce5635a 100644 --- a/xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/util/UserTypeUtil.java +++ b/xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/util/UserTypeUtil.java @@ -27,6 +27,8 @@ public class UserTypeUtil { public static final Integer COMMUNIT_TYPE = 2; //B端大客户 public static final Integer CUSTOMERS_TYPE = 3; + //车队 + public static final Integer MOTORCADE_TYPE = 4; //重新登录 public static final Integer LOGIN_TYPE = 1999; diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcMotorcadeController.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcMotorcadeController.java new file mode 100644 index 00000000..a20409ea --- /dev/null +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcMotorcadeController.java @@ -0,0 +1,163 @@ +package com.xhpc.user.controller; + +import com.xhpc.common.core.domain.R; +import com.xhpc.common.core.web.controller.BaseController; +import com.xhpc.common.core.web.domain.AjaxResult; +import com.xhpc.common.core.web.page.TableDataInfo; +import com.xhpc.common.log.annotation.Log; +import com.xhpc.common.log.enums.BusinessType; +import com.xhpc.common.util.UserTypeUtil; +import com.xhpc.user.domain.XhpcCommunity; +import com.xhpc.user.domain.XhpcCommunityPersonnel; +import com.xhpc.user.domain.XhpcMotorcade; +import com.xhpc.user.domain.XhpcMotorcadePersonnel; +import com.xhpc.user.service.IXhpcMotorcadeService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +/** + * 车队 + * + * @author yuyang + * @Date 2026-01-15 14:13 + */ +@RestController +@RequestMapping("/motorcade") +public class XhpcMotorcadeController extends BaseController { + + @Autowired + private IXhpcMotorcadeService xhpcMotorcadeService; + + /** + * 车队列表 + */ + @GetMapping("/userList") + public R userList(HttpServletRequest request, String name) { + return R.ok(xhpcMotorcadeService.userList(request,name)); + } + + /** + * 车队组树列表 + */ + @GetMapping("/list") + public TableDataInfo list(HttpServletRequest request, String name) { + List> list = xhpcMotorcadeService.list(request,name); + return getDataTable(list); + } + + /** + * 新增车队组树 + * + * @return + */ + @Log(title = "车队", businessType = BusinessType.INSERT) + @PostMapping(value = "/addMotorcade") + public AjaxResult addMotorcade(HttpServletRequest request, @RequestBody XhpcMotorcade xhpcMotorcade) { + return xhpcMotorcadeService.addMotorcade(request,xhpcMotorcade); + } + + /** + * 删除车队组树 + */ + @Log(title = "车队", businessType = BusinessType.DELETE) + @PostMapping(value = "/deleteMotorcade") + public AjaxResult deleteMotorcade(@RequestBody XhpcMotorcade xhpcMotorcade) { + return xhpcMotorcadeService.deleteMotorcade(xhpcMotorcade); + } + + /** + * 查询车队组 + */ + @PostMapping(value = "/getMotorcadeById") + public AjaxResult getMotorcadeById(@RequestBody XhpcMotorcade xhpcMotorcade) { + return AjaxResult.success(xhpcMotorcadeService.getMotorcadeById(xhpcMotorcade)); + } + + /** + * 编辑车队组树 + * + * @return + */ + @Log(title = "车队", businessType = BusinessType.UPDATE) + @PostMapping(value = "/updateMotorcade") + public AjaxResult updateMotorcade(@RequestBody XhpcMotorcade xhpcMotorcade) { + return xhpcMotorcadeService.updateMotorcade(xhpcMotorcade); + } + + + + + /** + * 车队人员列表 + */ + @GetMapping("/motorcadePersonnelList") + public TableDataInfo motorcadePersonnelList(Long communityId,String account,String phone,Integer status) { + startPage(); + List> list = xhpcMotorcadeService.motorcadePersonnelList(communityId, account, phone, status); + return getDataTable(list); + } + + /** + * 车队人员添加 + * + */ + @Log(title = "车队人员", businessType = BusinessType.INSERT) + @PostMapping(value = "/addMotorcadePersonnel") + public AjaxResult addMotorcadePersonnel(HttpServletRequest request,@RequestBody XhpcMotorcadePersonnel xhpcMotorcadePersonnel) { + return xhpcMotorcadeService.addMotorcadePersonnel(request,xhpcMotorcadePersonnel); + } + + /** + * 查看车队人员 + * + */ + @PostMapping(value = "/getMotorcadePersonnelById") + public AjaxResult getMotorcadePersonnelById(@RequestBody XhpcMotorcadePersonnel xhpcMotorcadePersonnel) { + return AjaxResult.success(xhpcMotorcadeService.getMotorcadePersonnelById(xhpcMotorcadePersonnel)); + } + + /** + * 编辑车队人员 + * + */ + @Log(title = "车队人员", businessType = BusinessType.UPDATE) + @PostMapping(value = "/updateMotorcadePersonnel") + public AjaxResult updateMotorcadePersonnel(@RequestBody XhpcMotorcadePersonnel xhpcMotorcadePersonnel) { + return xhpcMotorcadeService.updateMotorcadePersonnel(xhpcMotorcadePersonnel); + } + + /** + * 删除车队人员 + */ + @Log(title = "车队人员", businessType = BusinessType.DELETE) + @PostMapping(value = "/deleteMotorcadePersonnel") + public AjaxResult deleteMotorcadePersonnel(@RequestBody XhpcMotorcadePersonnel xhpcMotorcadePersonnel) { + xhpcMotorcadeService.deleteMotorcadePersonnel(xhpcMotorcadePersonnel); + return AjaxResult.success(); + } + + /** + * 改变车队人员状态 + */ + @Log(title = "车队人员-状态", businessType = BusinessType.UPDATE) + @PostMapping(value = "/updateMotorcadePersonnelStatus") + public AjaxResult updateMotorcadePersonnelStatus(@RequestBody XhpcMotorcadePersonnel xhpcMotorcadePersonnel) { + xhpcMotorcadeService.updateMotorcadePersonnelStatus(xhpcMotorcadePersonnel); + return AjaxResult.success(); + } + + /** + * 充值 + */ + @Log(title = "车队人员-充值", businessType = BusinessType.INSERT) + @PostMapping(value = "/addRecharge") + public AjaxResult addRecharge(@RequestBody XhpcMotorcadePersonnel xhpcMotorcadePersonnel) { + xhpcMotorcadePersonnel.setRechargeType(UserTypeUtil.RECHARGE_PT); + return xhpcMotorcadeService.addRecharge(xhpcMotorcadePersonnel); + } + +} diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/domain/XhpcMotorcade.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/domain/XhpcMotorcade.java new file mode 100644 index 00000000..2cd5ec1e --- /dev/null +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/domain/XhpcMotorcade.java @@ -0,0 +1,105 @@ +package com.xhpc.user.domain; + +import com.xhpc.common.core.web.domain.BaseEntity; +import lombok.Data; +import org.apache.poi.hpsf.Decimal; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotEmpty; +import java.math.BigDecimal; + +/** + * 车队 + * + * @author yuyang + * @Date 2026-01-15 14:06 + */ +@Data +public class XhpcMotorcade extends BaseEntity { + /** + * 车队ID + */ + private Long motorcadeId; + + /** + * 社区组名称 + */ + @NotEmpty(message = "车队名称不能为空") + @Length(min = 2,max = 10,message = "车队名称长度2~10之间") + private String name; + + /** + * 0总金额提成 1服务费提成 2电量抽成 + */ + private Integer motorcadeType; + + /** + * 服务费优惠比例 + */ + private Double servicePreferential; + + /** + * 享受折扣人数最低限制 + */ + private Integer minPeople; + + /** + * 联系人 + */ + @NotEmpty(message = "联系人不能为空") + private String contactName; + + /** + * 联系人电话 + */ + @NotEmpty(message = "联系人电话不能为空") + private String contactPhone; + + /** + * 地址 + */ + @NotEmpty(message = "地址不能为空") + @Length(max = 200,message = "地址最大200位") + private String address; + + /** + * 父级为0,子集为父级id + */ + private Long parentId; + + /** + * 社区组类型 (1.平台 2.运营商) + */ + private Integer type; + + /** + * 数据维度 0 地区 1.运营商 2. 运营商地区 + */ + @NotEmpty(message = "数据维度不能为空") + private String dimension; + + /** + * 是否有不参与合作的场站 (0 没有 1有) + */ + private Integer status; + + /** + * 删除标志(0代表存在 2代表删除) + */ + private Integer delFlag; + + /** + * 电站id + */ + private String chargingStationIds; + + /** + * 运营商id + */ + private Long operatorId; + + private Integer ilk; + + private BigDecimal totalAmount; + +} diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/domain/XhpcMotorcadePersonnel.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/domain/XhpcMotorcadePersonnel.java new file mode 100644 index 00000000..e5cd05e9 --- /dev/null +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/domain/XhpcMotorcadePersonnel.java @@ -0,0 +1,90 @@ +package com.xhpc.user.domain; + +import com.xhpc.common.core.web.domain.BaseEntity; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import java.math.BigDecimal; + +/** + * 车队人员 + * + * @author yuyang + * @Date 2026-01-15 14:09 + */ +@Data +public class XhpcMotorcadePersonnel extends BaseEntity { + + private Long motorcadePersonnelId; + + private Long motorcadeId; + + private String name; + + private String account; + + private BigDecimal rechargeMoney; + + private BigDecimal consumeMoney; + + private BigDecimal redPacket; + + private BigDecimal surplusMoney; + + private String phone; + + private Integer type; + + private Integer status; + + private Integer delFlag; + + /** + * 是否有退款订单审核(0无 1有) + */ + private Integer isRefundApplication; + + private Integer soc; + + /** + * 头像地址 + */ + private String avatar; + /** + * weixin_open_id + */ + @Length(max = 50, message = "openId不能超过50位") + private String weixinOpenId; + + /** + * alipay_open_id + */ + @Length(max = 50, message = "openId不能超过50位") + private String alipayOpenId; + + /** + * 微信是否登录(0未登录 1已登录) + */ + private Integer weixinLogin; + + /** + * 支付宝是否登录(0未登录 1已登录) + */ + private Integer alipayLogin; + + /** + * 充值渠道(1微信 2支付宝 3平台) + */ + private Integer rechargeType; + + /** + * 充值订单id、退款订单id + */ + private Long moneyOrderId; + + private Long createId; + + private Integer createType; + + private String vinNumber; +} diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/mapper/XhpcMotorcadeMapper.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/mapper/XhpcMotorcadeMapper.java new file mode 100644 index 00000000..c8d74ff7 --- /dev/null +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/mapper/XhpcMotorcadeMapper.java @@ -0,0 +1,114 @@ +package com.xhpc.user.mapper; + +import com.xhpc.user.domain.XhpcCommunity; +import com.xhpc.user.domain.XhpcCommunityPersonnel; +import com.xhpc.user.domain.XhpcMotorcade; +import com.xhpc.user.domain.XhpcMotorcadePersonnel; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; + +/** + * @author yuyang + * @Date 2026-01-15 14:15 + */ +public interface XhpcMotorcadeMapper { + + /** + * 获取登陆用户信息 + */ + Map getLandUser(@Param("userId") Long userId); + + /** + * 车队组树列表 + * + * @param name 桩名称 + * @return + */ + List> list(@Param("name") String name, @Param("tenantId") String tenantId); + + /** + * 车队组树列表 + * + * @param name 桩名称 + * @return + */ + List> tree(@Param("name") String name,@Param("tenantId") String tenantId); + + /** + * 添加车队组 + * @return + */ + int addMotorcade(XhpcMotorcade xhpcMotorcade); + + /** + * 修改车队组 + * @return + */ + int updateMotorcade(XhpcMotorcade xhpcMotorcade); + /** + * 删除车队车队组 + */ + void deleteMotorcade(@Param("motorcadeId")Long motorcadeId); + + /** + * 检查改组是否还存在车队人员 + */ + int countMotorcadePersonnel(@Param("motorcadeId")Long motorcadeId); + + + /** + * 查询车队组 + * @param motorcadeId 车队id + * @param name 名称 + * @param type 1 表示已车队id进行查询 2 排查车队id查询 + * @return + */ + Map getMotorcadeById(@Param("motorcadeId")Long motorcadeId,@Param("name")String name,@Param("type")Integer type); + + + List> motorcadePersonnelTree(@Param("motorcadeId")String motorcadeId); + + /** + * 车队人员列表 + * @return + */ + List> motorcadePersonnelList(@Param("motorcadeId")Long motorcadeId,@Param("account")String account,@Param("phone")String phone,@Param("status")Integer status); + + /** + * 添加车队人员 + * @return + */ + int addMotorcadePersonnel(XhpcMotorcadePersonnel XhpcMotorcadePersonnel); + + /** + * 查询车队人员 + * @return + */ + Map getMotorcadePersonnelById(@Param("motorcadePersonnelId")Long motorcadePersonnelId,@Param("phone")String phone,@Param("account")String account,@Param("type")Integer type); + + + /** + * 修改车队人员 + * @return + */ + int updateMotorcadePersonnel(XhpcMotorcadePersonnel XhpcMotorcadePersonnel); + + /** + * 删除车队社人员 + * @param motorcadePersonnelId + */ + void deleteMotorcadePersonnel(@Param("motorcadePersonnelId")Long motorcadePersonnelId); + + /** + * 车队人员状态改变 + */ + void updateMotorcadePersonnelStatus(@Param("motorcadePersonnelId")Long motorcadePersonnelId,@Param("status")Integer status); + + + /** + * 根据用户id获取车队组 + */ + Map getMotorcadePersonnelUserId(@Param("userId")Long userId,@Param("tenantId")String tenantId,@Param("chargingStationId")Long chargingStationId); +} diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/IXhpcMotorcadeService.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/IXhpcMotorcadeService.java new file mode 100644 index 00000000..159152e1 --- /dev/null +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/IXhpcMotorcadeService.java @@ -0,0 +1,111 @@ +package com.xhpc.user.service; + +import com.xhpc.common.core.web.domain.AjaxResult; +import com.xhpc.user.domain.XhpcCommunity; +import com.xhpc.user.domain.XhpcCommunityPersonnel; +import com.xhpc.user.domain.XhpcMotorcade; +import com.xhpc.user.domain.XhpcMotorcadePersonnel; + +import javax.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +/** + * @author yuyang + * @Date 2026-01-15 14:14 + */ +public interface IXhpcMotorcadeService { + + /** + * 车队组树列表 + * + * @param name 桩名称 + * @return + */ + List> userList(HttpServletRequest request, String name); + + + /** + * 车队组树列表 + * + * @param name 桩名称 + * @return + */ + List> list(HttpServletRequest request, String name); + + /** + * 新增车队组树 + * + * @param + * @return + */ + AjaxResult addMotorcade(HttpServletRequest request, XhpcMotorcade xhpcMotorcade); + + /** + * 删除车队组树 + */ + AjaxResult deleteMotorcade(XhpcMotorcade xhpcMotorcade); + + /** + * 编辑车队组树 + * + * @param + * @return + */ + AjaxResult updateMotorcade(XhpcMotorcade xhpcMotorcade); + /** + * 查询车队组 + * + * @return + */ + Map getMotorcadeById(XhpcMotorcade xhpcMotorcade); + + /** + * 车队人员列表 + * @return + */ + List> motorcadePersonnelList(Long motorcadeId,String account,String phone,Integer status); + + + /** + * 新增车队人员 + * @param + * @return + */ + AjaxResult addMotorcadePersonnel(HttpServletRequest request, XhpcMotorcadePersonnel xhpcMotorcadePersonnel); + + /** + * 查询车队人员 + * + * @return + */ + Map getMotorcadePersonnelById(XhpcMotorcadePersonnel xhpcMotorcadePersonnel); + + /** + * 编辑车队组树 + * + * @param + * @return + */ + AjaxResult updateMotorcadePersonnel(XhpcMotorcadePersonnel xhpcMotorcadePersonnel); + + /** + * 删除车队人员 + */ + void deleteMotorcadePersonnel(XhpcMotorcadePersonnel xhpcMotorcadePersonnel); + + /** + * 车队人员状态改变 + */ + void updateMotorcadePersonnelStatus(XhpcMotorcadePersonnel xhpcMotorcadePersonnel); + + /** + * 充值 + */ + AjaxResult addRecharge(XhpcMotorcadePersonnel xhpcMotorcadePersonnel); + + /** + * 根据用户id获取车队组 + */ + Map getMotorcadePersonnelUserId(Long userId,String tenantId,Long chargingStationId); +} diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcMotorcadeServiceImpl.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcMotorcadeServiceImpl.java new file mode 100644 index 00000000..0a07633c --- /dev/null +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcMotorcadeServiceImpl.java @@ -0,0 +1,332 @@ +package com.xhpc.user.service.impl; + +import com.xhpc.common.core.domain.R; +import com.xhpc.common.core.utils.SecurityUtils; +import com.xhpc.common.core.web.domain.AjaxResult; +import com.xhpc.common.core.web.service.BaseService; +import com.xhpc.common.security.service.TokenService; +import com.xhpc.common.util.UserTypeUtil; +import com.xhpc.system.api.domain.SysUser; +import com.xhpc.system.api.model.LoginUser; +import com.xhpc.user.domain.XhpcCommunity; +import com.xhpc.user.domain.XhpcCommunityPersonnel; +import com.xhpc.user.domain.XhpcMotorcade; +import com.xhpc.user.domain.XhpcMotorcadePersonnel; +import com.xhpc.user.mapper.XhpcMotorcadeMapper; +import com.xhpc.user.service.IMechanismService; +import com.xhpc.user.service.IXhpcMotorcadeService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.math.BigDecimal; +import java.util.*; + +/** + * @author yuyang + * @Date 2026-01-15 14:15 + */ +@Service +public class XhpcMotorcadeServiceImpl extends BaseService implements IXhpcMotorcadeService { + + @Resource + private XhpcMotorcadeMapper xhpcMotorcadeMapper; + @Resource + IMechanismService mechanismService; + @Resource + TokenService tokenService; + + @Override + public List> userList(HttpServletRequest request, String name) { + Long userId = SecurityUtils.getUserId(); + List> list =new ArrayList<>(); + LoginUser loginUser = tokenService.getLoginUser(request); + if(userId !=null){ + String userType = loginUser.getSysUser().getUserType(); + if(UserTypeUtil.SYS_USER_TYPE_ZERO.equals(userType)){ + list = xhpcMotorcadeMapper.tree(name, loginUser.getTenantId()); + } + } + + Iterator> iterator = list.iterator(); + while (iterator.hasNext()){ + Map commMap = iterator.next(); + List> userMapList = xhpcMotorcadeMapper.communityPersonnelTree(commMap.get("id").toString().replaceAll("COMM_", "")); + if (userMapList.size() < 1){ + iterator.remove(); + } else { + commMap.put("children", userMapList); + } + } + return list; + } + + @Override + public List> list(HttpServletRequest request, String name) { + Long userId = SecurityUtils.getUserId(); + List> list =new ArrayList<>(); + LoginUser loginUser = tokenService.getLoginUser(request); + if(userId !=null){ + startPage(); + String userType = loginUser.getSysUser().getUserType(); + if(UserTypeUtil.SYS_USER_TYPE_ZERO.equals(userType)){ + list = xhpcMotorcadeMapper.list(name,loginUser.getTenantId()); + } + } + return list; + } + + @Override + public AjaxResult addMotorcade(HttpServletRequest request, XhpcMotorcade xhpcMotorcade) { + R r= judgeXhpcCommunity(xhpcMotorcade); + if(r.getCode() !=200){ + return AjaxResult.error(r.getMsg()); + } + //名称重复不能入库 + Map communityById = xhpcMotorcadeMapper.getMotorcadeById(null, xhpcMotorcade.getName(), null); + if(communityById !=null){ + return AjaxResult.error("车队组名称重复"); + } + + String chargingStationIds = xhpcMotorcade.getChargingStationIds(); + if("".equals(chargingStationIds) || chargingStationIds ==null){ + xhpcMotorcade.setStatus(0); + }else{ + xhpcMotorcade.setStatus(1); + } + Long userId = SecurityUtils.getUserId(); + if(userId !=null){ + LoginUser loginUser = tokenService.getLoginUser(request); + SysUser sysUser = loginUser.getSysUser(); + if(UserTypeUtil.SYS_USER_TYPE_ONE.equals(sysUser.getUserType()) || UserTypeUtil.SYS_USER_TYPE_THREE.equals(sysUser.getUserType())){ + xhpcMotorcade.setType(2); + xhpcMotorcade.setOperatorId(sysUser.getOperatorId()); + }else{ + xhpcMotorcade.setType(1); + } + }else{ + return AjaxResult.error("请重新登录"); + } + xhpcMotorcadeMapper.addMotorcade(xhpcMotorcade); + if(!"".equals(chargingStationIds) && chargingStationIds !=null){ + mechanismService.addMechanism(Arrays.asList(chargingStationIds.split(",")),xhpcMotorcade.getMotorcadeId(),3); + } + return AjaxResult.success(); + } + + @Override + public AjaxResult deleteMotorcade(XhpcMotorcade xhpcMotorcade) { + if(xhpcMotorcade !=null && xhpcMotorcade.getMotorcadeId() !=null){ + int i = xhpcMotorcadeMapper.countMotorcadePersonnel(xhpcMotorcade.getMotorcadeId()); + if(i==0){ + xhpcMotorcadeMapper.deleteMotorcade(xhpcMotorcade.getMotorcadeId()); + return AjaxResult.success(); + }else{ + return AjaxResult.error("该车队组下有用户不能删除"); + } + }else{ + return AjaxResult.error("请传车队组id"); + } + } + + @Override + public AjaxResult updateMotorcade(XhpcMotorcade xhpcMotorcade) { + R r = judgeXhpcCommunity(xhpcMotorcade); + if(r.getCode()!=200){ + return AjaxResult.error(r.getMsg()); + } + //名称重复不能入库 + Map communityById = xhpcMotorcadeMapper.getMotorcadeById(xhpcMotorcade.getMotorcadeId(), xhpcMotorcade.getName(), 2); + if(communityById !=null){ + return AjaxResult.error("社区名称重复"); + } + + String chargingStationIds = xhpcMotorcade.getChargingStationIds(); + if("".equals(chargingStationIds) || chargingStationIds ==null){ + xhpcMotorcade.setStatus(0); + }else{ + xhpcMotorcade.setStatus(1); + } + xhpcMotorcadeMapper.updateMotorcade(xhpcMotorcade); + mechanismService.updateMechanism(xhpcMotorcade.getMotorcadeId(),3); + if(!"".equals(chargingStationIds) && chargingStationIds !=null){ + mechanismService.addMechanism(Arrays.asList(chargingStationIds.split(",")),xhpcMotorcade.getMotorcadeId(),3); + } + return AjaxResult.success(); + } + + @Override + public Map getMotorcadeById(XhpcMotorcade xhpcMotorcade) { + return xhpcMotorcadeMapper.getMotorcadeById(xhpcMotorcade.getMotorcadeId(),null,1); + + } + + @Override + public List> motorcadePersonnelList(Long motorcadeId, String account, String phone, Integer status) { + return xhpcMotorcadeMapper.motorcadePersonnelList(motorcadeId, account, phone, status); + + } + + @Override + public AjaxResult addMotorcadePersonnel(HttpServletRequest request, XhpcMotorcadePersonnel xhpcMotorcadePersonnel) { + R r = judgeXhpcCommunityPersonnel(xhpcMotorcadePersonnel); + if(r.getCode()!=200){ + return AjaxResult.error(r.getMsg()); + } + String phone = xhpcMotorcadePersonnel.getPhone(); + String account = xhpcMotorcadePersonnel.getAccount(); + Map communityPersonnelById = xhpcMotorcadeMapper.getMotorcadePersonnelById(null, phone, account, 3); + if(communityPersonnelById !=null){ + if(phone.equals(communityPersonnelById.get("phone").toString())){ + return AjaxResult.error("手机号重复"); + } + if(account.equals(communityPersonnelById.get("account").toString())){ + return AjaxResult.error("账号重复"); + } + } + BigDecimal rechargeMoney = xhpcMotorcadePersonnel.getRechargeMoney(); + if(new BigDecimal(0).compareTo(rechargeMoney)==-1){ + //增加社区用户的剩余金额 + xhpcMotorcadePersonnel.setSurplusMoney(rechargeMoney); + } + Long userId = SecurityUtils.getUserId(); + if(userId !=null){ + LoginUser loginUser = tokenService.getLoginUser(request); + SysUser sysUser = loginUser.getSysUser(); + if(UserTypeUtil.SYS_USER_TYPE_ONE.equals(sysUser.getUserType()) || UserTypeUtil.SYS_USER_TYPE_THREE.equals(sysUser.getUserType())){ + xhpcMotorcadePersonnel.setCreateType(2); + xhpcMotorcadePersonnel.setCreateId(sysUser.getOperatorId()); + }else{ + xhpcMotorcadePersonnel.setCreateType(1); + } + }else{ + return AjaxResult.error("请重新登录"); + } + xhpcMotorcadeMapper.addMotorcadePersonnel(xhpcMotorcadePersonnel); + //增加一条充值记录 + if(new BigDecimal(0).compareTo(rechargeMoney)==-1){ + mechanismService.addRechargeOrder(xhpcMotorcadePersonnel.getMotorcadePersonnelId(),UserTypeUtil.MOTORCADE_TYPE,rechargeMoney,rechargeMoney,UserTypeUtil.RECHARGE_PT); + } + return AjaxResult.success(); + } + + @Override + public Map getMotorcadePersonnelById(XhpcMotorcadePersonnel xhpcMotorcadePersonnel) { + return xhpcMotorcadeMapper.getMotorcadePersonnelById(xhpcMotorcadePersonnel.getMotorcadePersonnelId(), null, null, 1); + } + + @Override + public AjaxResult updateMotorcadePersonnel(XhpcMotorcadePersonnel xhpcMotorcadePersonnel) { + R r = judgeXhpcCommunityPersonnel(xhpcMotorcadePersonnel); + if(r.getCode()!=200){ + return AjaxResult.error(r.getMsg()); + } + Long motorcadePersonnelId = xhpcMotorcadePersonnel.getMotorcadePersonnelId(); + String phone = xhpcMotorcadePersonnel.getPhone(); + String account = xhpcMotorcadePersonnel.getAccount(); + BigDecimal rechargeMoney = xhpcMotorcadePersonnel.getRechargeMoney(); + BigDecimal surplusMoney = xhpcMotorcadePersonnel.getSurplusMoney(); + if( rechargeMoney!=null){ + return AjaxResult.error("充值金额不能填写"); + } + if( surplusMoney!=null){ + return AjaxResult.error("剩余金额不能填写"); + } + Map communityPersonnelById = xhpcMotorcadeMapper.getMotorcadePersonnelById(motorcadePersonnelId, phone, account, 2); + if(communityPersonnelById !=null){ + if(phone.equals(communityPersonnelById.get("phone").toString())){ + return AjaxResult.error("手机号重复"); + } + if(account.equals(communityPersonnelById.get("account").toString())){ + return AjaxResult.error("账号重复"); + } + } + xhpcMotorcadeMapper.updateMotorcadePersonnel(xhpcMotorcadePersonnel); + return AjaxResult.success(); + } + + @Override + public void deleteMotorcadePersonnel(XhpcMotorcadePersonnel xhpcMotorcadePersonnel) { + xhpcMotorcadeMapper.deleteMotorcadePersonnel(xhpcMotorcadePersonnel.getMotorcadePersonnelId()); + + } + + @Override + public void updateMotorcadePersonnelStatus(XhpcMotorcadePersonnel xhpcMotorcadePersonnel) { + xhpcMotorcadeMapper.updateMotorcadePersonnelStatus(xhpcMotorcadePersonnel.getMotorcadePersonnelId(),xhpcMotorcadePersonnel.getStatus()); + + } + + @Override + public AjaxResult addRecharge(XhpcMotorcadePersonnel xhpcMotorcadePersonnel) { + //充值金额 + BigDecimal rechargeMoney = xhpcMotorcadePersonnel.getRechargeMoney(); + Long motorcadePersonnelId = xhpcMotorcadePersonnel.getMotorcadePersonnelId(); + if(rechargeMoney !=null &&new BigDecimal(0).compareTo(rechargeMoney)==-1){ + //增加社区用户的剩余金额 + Map communityPersonnelById = xhpcMotorcadeMapper.getMotorcadePersonnelById(motorcadePersonnelId, null, null, 1); + if(communityPersonnelById !=null){ + BigDecimal surplusMoney = new BigDecimal(communityPersonnelById.get("surplusMoney").toString()); + //原本充值金额 + BigDecimal rechargeMoney1 = new BigDecimal(communityPersonnelById.get("rechargeMoney").toString()); + XhpcMotorcadePersonnel xhpcMotorcadePersonnel1=new XhpcMotorcadePersonnel(); + xhpcMotorcadePersonnel1.setMotorcadePersonnelId(motorcadePersonnelId); + BigDecimal remainingSum = surplusMoney.add(rechargeMoney); + xhpcMotorcadePersonnel1.setSurplusMoney(remainingSum); + xhpcMotorcadePersonnel1.setRechargeMoney(rechargeMoney1.add(rechargeMoney)); + xhpcMotorcadeMapper.updateMotorcadePersonnel(xhpcMotorcadePersonnel1); + + Long rechargeOrderId=null; + if(UserTypeUtil.RECHARGE_PT.equals(xhpcMotorcadePersonnel.getRechargeType())){ + //增加充值记录 + rechargeOrderId = mechanismService.addRechargeOrder(motorcadePersonnelId, UserTypeUtil.MOTORCADE_TYPE, rechargeMoney, remainingSum, xhpcMotorcadePersonnel.getRechargeType()); + }else{ + rechargeOrderId=xhpcMotorcadePersonnel.getMoneyOrderId(); + } + //增加用户流水 + mechanismService.insertUserAccount(motorcadePersonnelId,rechargeMoney,remainingSum,null,rechargeOrderId,null,UserTypeUtil.INSERT_BALANCE,xhpcMotorcadePersonnel1.getTenantId(),UserTypeUtil.MOTORCADE_TYPE); + return AjaxResult.success(); + } + } + return AjaxResult.error("充值金额必需大于0"); + } + + @Override + public Map getMotorcadePersonnelUserId(Long userId, String tenantId, Long chargingStationId) { + return xhpcMotorcadeMapper.getMotorcadePersonnelUserId(userId, tenantId,chargingStationId); + } + + public R judgeXhpcCommunity(XhpcMotorcade xhpcMotorcade){ + + if(xhpcMotorcade.getName()==null || "".equals(xhpcMotorcade.getName())){ + return R.fail("名称必填"); + } + if(xhpcMotorcade.getContactName()==null || "".equals(xhpcMotorcade.getContactName())){ + return R.fail("联系人必填"); + } + if(xhpcMotorcade.getContactPhone()==null || "".equals(xhpcMotorcade.getContactPhone())){ + return R.fail("联系人电话必填"); + } + if(xhpcMotorcade.getAddress()==null || "".equals(xhpcMotorcade.getAddress())){ + return R.fail("地址必填"); + } + return R.ok(); + } + + + public R judgeXhpcCommunityPersonnel(XhpcMotorcadePersonnel xhpcMotorcadePersonnel){ + + if(xhpcMotorcadePersonnel.getName()==null || "".equals(xhpcMotorcadePersonnel.getName())){ + return R.fail("名称必填"); + } + if(xhpcMotorcadePersonnel.getAccount()==null || "".equals(xhpcMotorcadePersonnel.getAccount()) || !"CD".equals(xhpcMotorcadePersonnel.getAccount().substring(0,2))){ + return R.fail("账号必填且CD开头10位"); + } + if(xhpcMotorcadePersonnel.getPhone()==null || "".equals(xhpcMotorcadePersonnel.getPhone()) || xhpcMotorcadePersonnel.getPhone().length()!=11){ + return R.fail("绑定手机号必填"); + } + + return R.ok(); + } +} diff --git a/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcMotorcadeMapper.xml b/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcMotorcadeMapper.xml new file mode 100644 index 00000000..22c66246 --- /dev/null +++ b/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcMotorcadeMapper.xml @@ -0,0 +1,496 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + insert into xhpc_motorcade + + + motorcade_id, + + + name, + + + service_preferential, + + + min_people, + + + contact_name, + + + contact_phone, + + + address, + + + dimension, + + + status, + + + del_flag, + + + create_time, + + + create_by, + + + update_time, + + + update_by, + + + remark, + + + type, + + + operatorId, + + + motorcade_type, + + + ilk, + + + total_amount, + + + + + #{motorcadeId}, + + + #{name}, + + + #{servicePreferential}, + + + #{minPeople}, + + + #{contactName}, + + + #{contactPhone}, + + + #{address}, + + + #{dimension}, + + + #{status}, + + + #{delFlag}, + + + #{createTime}, + + + #{createBy}, + + + #{updateTime}, + + + #{updateBy}, + + + #{remark}, + + + #{type}, + + + #{operatorId}, + + + #{motorcadeType}, + + + #{ilk}, + + + #{totalAmount}, + + + + + + update xhpc_motorcade + + name = #{name}, + service_preferential = #{servicePreferential}, + min_people = #{minPeople}, + contact_name = #{contactName}, + contact_phone = #{contactPhone}, + address = #{address}, + dimension = #{dimension}, + status = #{status}, + del_flag = #{delFlag}, + create_time = #{createTime}, + create_by = #{createBy}, + update_time = #{updateTime}, + update_by = #{updateBy}, + remark = #{remark}, + motorcade_type = #{motorcadeType}, + ilk = #{ilk}, + total_amount = #{totalAmount}, + + where motorcade_id=#{motorcadeId} + + + + update xhpc_motorcade set del_flag =1 where motorcade_id=#{motorcadeId} + + + + + + + + + + + + insert into xhpc_motorcade_personnel + + + motorcade_personnel_id, + + + motorcade_id, + + + name, + + + account, + + + recharge_money, + + + consume_money, + + + red_packet, + + + surplus_money, + + + phone, + + + type, + + + status, + + + del_flag, + + + create_time, + + + create_by, + + + update_time, + + + update_by, + + + remark, + + + create_id, + + + create_type, + + + vin_number, + + + + + #{motorcadePersonnelId}, + + + #{motorcadeId}, + + + #{name}, + + + #{account}, + + + #{rechargeMoney}, + + + #{consumeMoney}, + + + #{redPacket}, + + + #{surplusMoney}, + + + #{phone}, + + + #{type}, + + + #{status}, + + + #{delFlag}, + + + #{createTime}, + + + #{createBy}, + + + #{updateTime}, + + + #{updateBy}, + + + #{remark}, + + + #{createId}, + + + #{createType}, + + + #{vinNumber}, + + + + + + + + + update xhpc_motorcade_personnel + + motorcade_id = #{motorcadeId}, + name = #{name}, + account = #{account}, + phone = #{phone}, + recharge_money = #{rechargeMoney}, + surplus_money = #{surplusMoney}, + type = #{type}, + address = #{status}, + del_flag = #{delFlag}, + create_time = #{createTime}, + create_by = #{createBy}, + update_time = #{updateTime}, + update_by = #{updateBy}, + remark = #{remark}, + vin_number = #{vinNumber}, + is_refund_application = #{isRefundApplication}, + + where motorcade_personnel_id=#{motorcadePersonnelId} + + + + update xhpc_motorcade_personnel set del_flag=1 where motorcade_personnel_id=#{motorcadePersonnelId} + + + + update xhpc_motorcade_personnel set status=#{status} where motorcade_personnel_id=#{motorcadePersonnelId} + + + +