diff --git a/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/OmsServiceFeign.java b/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/OmsServiceFeign.java index f6477f04b..4a79cdac0 100644 --- a/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/OmsServiceFeign.java +++ b/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/OmsServiceFeign.java @@ -12,7 +12,7 @@ import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; -@FeignClient(contextId = "OmsService", value = ServiceNameConstants.OMS_SERVICE,url = "http://10.102.192.33:8017", configuration = FeignAutoConfiguration.class) +@FeignClient(contextId = "OmsService", value = ServiceNameConstants.OMS_SERVICE, configuration = FeignAutoConfiguration.class) public interface OmsServiceFeign { diff --git a/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/domain/YmsLoginUser.java b/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/domain/YmsLoginUser.java new file mode 100644 index 000000000..025557b10 --- /dev/null +++ b/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/domain/YmsLoginUser.java @@ -0,0 +1,63 @@ +package com.mhd.system.api.domain; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.Date; + +/** + * YMS登录用户信息 + * @author AI + * @date 2026/05/13 + */ +@Data +public class YmsLoginUser { + + //登录人id + private Long id; + //登录人账号 + private String username; + //登录人名字 + private String nickName; + //登录人密码 + private String password; + //当前登录部门code + private String orgCode; + //头像 + private String avatar; + //性别(0男 1女 2未知) + private String sex; + //电子邮件 + private String email; + //电话 + private String phonenumber; + //状态(0正常 1停用) + private String status; + //删除标志(0代表存在 2代表删除) + private String delFlag; + //最后登录IP + private String loginIp; + //最后登录时间 + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date loginDate; + //创建时间 + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + //数字物流用户ID + private Long szwlUserId; + //一级组织表ID + private Long topOrganizationId; + //组织表ID + private Long organizationId; + //角色code集合 + private String roleCodes; + //角色名称集合 + private String roleNames; + //推广码 + private String promoCode; + //账号类型 1.普通账号,2.组织账号,3.一级账号,4.平台员工,5.企业员工,6.合作商 + private Integer userAccountType; +} diff --git a/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/model/LoginUser.java b/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/model/LoginUser.java index 3afe4170e..c4b161884 100644 --- a/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/model/LoginUser.java +++ b/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/model/LoginUser.java @@ -11,6 +11,7 @@ import com.mhd.system.api.domain.MallOAuthToken; import com.mhd.system.api.domain.mall.BaseUser; import com.mhd.system.api.domain.SysUser; import com.mhd.system.api.domain.WlhyLoginUser; +import com.mhd.system.api.domain.YmsLoginUser; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -87,6 +88,11 @@ public class LoginUser implements Serializable */ private WlhyLoginUser wlhyLoginUser; + /** + * YMS用户信息 + */ + private YmsLoginUser ymsLoginUser; + /** * websocket地址 */ diff --git a/mhd-auth/src/main/java/com/mhd/auth/system/service/SysLoginService.java b/mhd-auth/src/main/java/com/mhd/auth/system/service/SysLoginService.java index cc5f85252..dbf6b5e80 100644 --- a/mhd-auth/src/main/java/com/mhd/auth/system/service/SysLoginService.java +++ b/mhd-auth/src/main/java/com/mhd/auth/system/service/SysLoginService.java @@ -26,6 +26,7 @@ import com.mhd.common.log.service.AsyncLogService; import com.mhd.common.redis.service.RedisService; import com.mhd.system.api.*; import com.mhd.system.api.domain.*; +import com.mhd.system.api.domain.YmsLoginUser; import com.mhd.system.api.domain.mall.SysTenant; import com.mhd.system.api.domain.mall.UserInfo; import com.mhd.system.api.domain.mall.UserInfoLoginDTO; @@ -70,6 +71,8 @@ public class SysLoginService { private UserServiceFeign userServiceFeign; @Resource private WlhyServiceFeign wlhyServiceFeign; + @Resource + private YmsServiceFeign ymsServiceFeign; @Resource private RedisService redisService; @@ -459,6 +462,17 @@ public class SysLoginService { userInfo.setWlhyLoginUser(wlhyLoginUserR.getData()); } } + // 获取YMS登录用户基本信息 + try { + R ymsLoginUserR = ymsServiceFeign.getYmsUserInfo(userInfo.getUserPo().getUserId()); + if (ymsLoginUserR.getCode() == R.SUCCESS && ymsLoginUserR.getData() != null) { + userInfo.setYmsLoginUser(ymsLoginUserR.getData()); + log.info("获取YMS用户信息成功,userId: {}", userInfo.getUserPo().getUserId()); + } + } catch (Exception e) { + // 获取YMS用户信息失败时,记录日志但不影响登录 + log.warn("获取YMS用户信息失败,但不影响登录: {}", e.getMessage()); + } if(mallFlag == 1){ /*单点登录,获取商城鉴权 * 根据用户角色判断需要鉴权的服务, diff --git a/mhd-common/mhd-common-core/src/main/java/com/mhd/common/core/constant/ServiceNameConstants.java b/mhd-common/mhd-common-core/src/main/java/com/mhd/common/core/constant/ServiceNameConstants.java index 9943737d1..326d15114 100644 --- a/mhd-common/mhd-common-core/src/main/java/com/mhd/common/core/constant/ServiceNameConstants.java +++ b/mhd-common/mhd-common-core/src/main/java/com/mhd/common/core/constant/ServiceNameConstants.java @@ -63,6 +63,9 @@ public class ServiceNameConstants //OMS结算系统 public static final String OMS_SERVICE = "mhd-oms-service"; + //YMS系统 + public static final String YMS_SERVICE = "mhd-yms-service"; + } \ No newline at end of file diff --git a/mhd-common/mhd-common-core/src/main/java/com/mhd/common/core/domain/dto/YmsSysDeptDTO.java b/mhd-common/mhd-common-core/src/main/java/com/mhd/common/core/domain/dto/YmsSysDeptDTO.java new file mode 100644 index 000000000..5883b1480 --- /dev/null +++ b/mhd-common/mhd-common-core/src/main/java/com/mhd/common/core/domain/dto/YmsSysDeptDTO.java @@ -0,0 +1,47 @@ +package com.mhd.common.core.domain.dto; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author: brb + * @description: + * @create: 2026-05-13 10:28 + */ +public class YmsSysDeptDTO { + /** 部门ID */ + private Long deptId; + + /** 父部门ID */ + private Long parentId; + + /** 祖级列表 */ + private String ancestors; + + /** 部门名称 */ + private String deptName; + + /** 显示顺序 */ + private Integer orderNum; + + /** 负责人 */ + private String leader; + + /** 联系电话 */ + private String phone; + + /** 邮箱 */ + private String email; + + /** 部门状态:0正常,1停用 */ + private String status; + + /** 删除标志(0代表存在 2代表删除) */ + private String delFlag; + + /** 父部门名称 */ + private String parentName; + + /** 子部门 */ + private List children = new ArrayList(); +} diff --git a/mhd-common/mhd-common-core/src/main/java/com/mhd/common/core/domain/dto/YmsSysUserDTO.java b/mhd-common/mhd-common-core/src/main/java/com/mhd/common/core/domain/dto/YmsSysUserDTO.java new file mode 100644 index 000000000..1358a1829 --- /dev/null +++ b/mhd-common/mhd-common-core/src/main/java/com/mhd/common/core/domain/dto/YmsSysUserDTO.java @@ -0,0 +1,105 @@ +package com.mhd.common.core.domain.dto; + +import com.mhd.common.core.annotation.Excel; +import com.mhd.common.core.annotation.Excels; +import lombok.Data; + +import java.util.Date; +import java.util.List; + +/** + * @author: brb + * @description: YMS系统用户DTO + * @create: 2026-05-13 10:27 + */ +@Data +public class YmsSysUserDTO { + /** 用户ID */ + @Excel(name = "用户序号", prompt = "用户编号") + private Long userId; + + /** 部门ID */ + @Excel(name = "部门编号") + private Long deptId; + + /** 用户账号 */ + @Excel(name = "登录名称") + private String userName; + + /** 用户昵称 */ + @Excel(name = "用户名称") + private String nickName; + + /** 用户邮箱 */ + @Excel(name = "用户邮箱") + private String email; + + /** 手机号码 */ + @Excel(name = "手机号码") + private String phonenumber; + + /** 用户性别 */ + @Excel(name = "用户性别", readConverterExp = "0=男,1=女,2=未知") + private String sex; + + /** 用户头像 */ + private String avatar; + + /** 密码 */ + private String password; + + /** 帐号状态(0正常 1停用) */ + @Excel(name = "帐号状态", readConverterExp = "0=正常,1=停用") + private String status; + + /** 删除标志(0代表存在 2代表删除) */ + private String delFlag; + + /** 最后登录IP */ + @Excel(name = "最后登录IP") + private String loginIp; + + /** 最后登录时间 */ + @Excel(name = "最后登录时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date loginDate; + + /** 部门对象 */ + @Excels({ + @Excel(name = "部门名称", targetAttr = "deptName", type = Excel.Type.EXPORT), + @Excel(name = "部门负责人", targetAttr = "leader", type = Excel.Type.EXPORT) + }) + private YmsSysDeptDTO dept; + + /** 角色对象 */ + private List roles; + + /** 角色组 */ + private Long[] roleIds; + + /** 岗位组 */ + private Long[] postIds; + + /** 角色ID */ + private Long roleId; + + /** szwl用户ID */ + private Long szwlUserId; + + /** 一级组织表ID */ + private Long topOrganizationId; + + /** 组织表ID */ + private Long organizationId; + + /** 角色code集合 */ + private List roleCodes; + + /** 角色名称集合 */ + private List roleNames; + + /** 推广码 */ + private String promoCode; + + /** 账号类型 1.普通账号,2.组织账号,3.一级账号,4.平台员工,5.企业员工,6.合作商 */ + private Integer userAccountType; +} diff --git a/mhd-common/mhd-common-core/src/main/java/com/mhd/common/core/domain/po/OrganizationPo.java b/mhd-common/mhd-common-core/src/main/java/com/mhd/common/core/domain/po/OrganizationPo.java index b1c509ce1..51bb2ac97 100644 --- a/mhd-common/mhd-common-core/src/main/java/com/mhd/common/core/domain/po/OrganizationPo.java +++ b/mhd-common/mhd-common-core/src/main/java/com/mhd/common/core/domain/po/OrganizationPo.java @@ -104,5 +104,7 @@ public class OrganizationPo extends BaseVOEntity implements Serializable { @ApiModelProperty("是否绑定 1-是,2-否") private Integer isBand; + @ApiModelProperty("是否排队:0-否,1-是") + private Integer isQueue; } diff --git a/mhd-user-center/src/main/java/com/mhd/user/application/service/UserApplicationService.java b/mhd-user-center/src/main/java/com/mhd/user/application/service/UserApplicationService.java index 900aa8caa..32642d0ee 100644 --- a/mhd-user-center/src/main/java/com/mhd/user/application/service/UserApplicationService.java +++ b/mhd-user-center/src/main/java/com/mhd/user/application/service/UserApplicationService.java @@ -30,6 +30,7 @@ import com.mhd.system.api.FinanceServiceFeign; import com.mhd.system.api.OrganizationServiceFeign; import com.mhd.system.api.TicketServiceFeign; import com.mhd.system.api.TransportFeign; +import com.mhd.system.api.YmsServiceFeign; import com.mhd.system.api.domain.PlatformUserDTO; import com.mhd.system.api.domain.cache.AssociationWarehouseCacheDO; import com.mhd.system.api.domain.WlhyLoginUser; @@ -181,6 +182,8 @@ public class UserApplicationService { private TicketServiceFeign ticketServiceFeign; @Resource private UserWlhyDomainService wlhyDomainService; + @Resource + private UserYmsDomainService ymsDomainService; @Resource private UserShipperApplicationService userShipperApplicationService; @@ -1381,6 +1384,7 @@ public class UserApplicationService { @Transactional(rollbackFor = Exception.class) public UserPo addUserYG(UserDO userDO) { LoginUser loginUser = SecurityUtils.getLoginUser(); + String password = userDO.getPlainPassword(); if (ObjectUtil.isNull(loginUser)) { throw new DigitalLogisticsException(UserError.TIMEOUT); } @@ -1484,6 +1488,20 @@ public class UserApplicationService { // 如果业务要求必须同步成功,可以取消下面的注释,让异常抛出 // throw e; } + //获取组织信息 + Long organizationId = loginUser.getUserPo().getOrganizationId(); + Integer isQueue = userMapper.getOrdIsQueue(organizationId); + + if (isQueue==1) { + //同步YMS员工信息 + try { + userEntity.setUserPassword(password); + ymsDomainService.addOrEditYmsUser(userEntity); + } catch (Exception e) { + // 同步YMS失败时,记录日志但不影响用户保存 + log.warn("同步YMS员工信息失败,但不影响用户保存: {}", e.getMessage()); + } + } return userPo; } } @@ -2096,6 +2114,8 @@ public class UserApplicationService { UserEntity userEntity = userDomainService.updateUser(userDO); //同步网货平台员工信息 wlhyDomainService.addOrEditPlatformUser(userEntity); + //同步yms员工信息 + ymsDomainService.addOrEditYmsUser(userEntity); BeanUtils.copyProperties(userPo, userEntity); diff --git a/mhd-user-center/src/main/java/com/mhd/user/application/service/UserDriverApplicationService.java b/mhd-user-center/src/main/java/com/mhd/user/application/service/UserDriverApplicationService.java index ad7394719..d074d2b9f 100644 --- a/mhd-user-center/src/main/java/com/mhd/user/application/service/UserDriverApplicationService.java +++ b/mhd-user-center/src/main/java/com/mhd/user/application/service/UserDriverApplicationService.java @@ -29,6 +29,7 @@ import com.mhd.common.core.utils.poi.WpsImg; import com.mhd.system.api.FinanceServiceFeign; import com.mhd.system.api.TransportFeign; import com.mhd.system.api.WlhyServiceFeign; +import com.mhd.system.api.YmsServiceFeign; import com.mhd.system.api.service.webSocket.AsyncWebSocketApplicationService; import com.mhd.user.application.strategy.VehicleBindingStrategy; import com.mhd.user.domain.motorcade.entity.Motorcade; @@ -119,6 +120,8 @@ public class UserDriverApplicationService { private AsyncJPushApplicationService asyncJPushApplicationService; @Resource private SpecialLogisticsFeign specialLogisticsFeign; + @Resource + private UserYmsDomainService ymsDomainService; @Resource private UserDataPermissionApplicationService userDataPermissionApplicationService; @@ -184,6 +187,7 @@ public class UserDriverApplicationService { private DriverVehicleBindMapper driverVehicleBindMapper; @Autowired private UserMapper userMapper; + private YmsServiceFeign ymsServiceFeign; /** * @Description 承运人列表查询 @@ -515,6 +519,28 @@ public class UserDriverApplicationService { // 同步信息到网络货运平台 wlhyDomainService.saveOrUpdateDriverInfo(userDriverDO); + Long organizationId = loginUser.getUserPo().getOrganizationId(); + Integer isQueue = userMapper.getOrdIsQueue(organizationId); + if (isQueue==1) { + // 同步YMS员工信息 + try { + UserEntity userEntity = new UserEntity(); + userEntity.setUserId(userDriverDO.getUserId()); + userEntity.setUserAccount(userDriverDO.getUserAccount()); + userEntity.setUserName(userDriverDO.getUserName()); + userEntity.setUserPhone(userDriverDO.getUserPhone()); + userEntity.setUserPassword("Aa123456"); + userEntity.setOrganizationId(userDriverDO.getOrganizationId()); + userEntity.setOrganizationName(userDriverDO.getOrganizationName()); + userEntity.setTopOrganizationId(userDriverDO.getTopOrganizationId()); + userEntity.setUserAuthStatus(userDriverDO.getUserAuthStatus()); + userEntity.setBusinessType(userDriverDO.getBusinessType()); + ymsDomainService.addOrEditYmsUser(userEntity); + } catch (Exception e) { + // 同步YMS失败时,记录日志但不影响用户保存 + log.warn("同步YMS员工信息失败,但不影响用户保存: {}", e.getMessage()); + } + } // 自动审核或提交审核 if (ObjectUtil.equal(configSwitch.getAutomaticCheckUserInfo(), UserDriverConstants.AUTOMATIC_CHECK_ENABLED)) { diff --git a/mhd-user-center/src/main/java/com/mhd/user/domain/userAggregate/repository/mapper/UserMapper.java b/mhd-user-center/src/main/java/com/mhd/user/domain/userAggregate/repository/mapper/UserMapper.java index 1660234b2..a55f709d5 100644 --- a/mhd-user-center/src/main/java/com/mhd/user/domain/userAggregate/repository/mapper/UserMapper.java +++ b/mhd-user-center/src/main/java/com/mhd/user/domain/userAggregate/repository/mapper/UserMapper.java @@ -1,6 +1,7 @@ package com.mhd.user.domain.userAggregate.repository.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.mhd.common.core.domain.dto.YmsSysUserDTO; import com.mhd.user.domain.userAggregate.entity.UserEntity; import com.mhd.user.domain.userAggregate.repository.po.UserDocumentWarningQueryPo; import com.mhd.user.domain.userAggregate.repository.po.UserDriverCaptainAuthPo; @@ -74,4 +75,8 @@ public interface UserMapper extends BaseMapper { String finShipperEnterpriseNamedByUserId(@Param("userId") Long userId); + + YmsSysUserDTO selectYmsByUserId(Long userId); + + Integer getOrdIsQueue(Long organizationId); } \ No newline at end of file diff --git a/mhd-user-center/src/main/java/com/mhd/user/domain/userAggregate/repository/todo/UserDO.java b/mhd-user-center/src/main/java/com/mhd/user/domain/userAggregate/repository/todo/UserDO.java index 61281c395..efb65cb8d 100644 --- a/mhd-user-center/src/main/java/com/mhd/user/domain/userAggregate/repository/todo/UserDO.java +++ b/mhd-user-center/src/main/java/com/mhd/user/domain/userAggregate/repository/todo/UserDO.java @@ -281,4 +281,10 @@ public class UserDO extends BaseVOEntity { @ApiModelProperty("税号") private String taxNumber; + + @ApiModelProperty("yms密码") + private String plainPassword; + + @ApiModelProperty("当前用户的组织是否开启排队") + private Integer isQueue; } diff --git a/mhd-user-center/src/main/java/com/mhd/user/domain/userAggregate/repository/todo/UserDriverDO.java b/mhd-user-center/src/main/java/com/mhd/user/domain/userAggregate/repository/todo/UserDriverDO.java index f6c3d8a2c..bad8143e1 100644 --- a/mhd-user-center/src/main/java/com/mhd/user/domain/userAggregate/repository/todo/UserDriverDO.java +++ b/mhd-user-center/src/main/java/com/mhd/user/domain/userAggregate/repository/todo/UserDriverDO.java @@ -289,4 +289,7 @@ public class UserDriverDO extends UserDO { @ApiModelProperty(name = "车辆主体") private String vehicleBody; + @ApiModelProperty("当前用户的组织是否开启排队") + private Integer isQueue; + } diff --git a/mhd-user-center/src/main/java/com/mhd/user/domain/userAggregate/service/UserYmsDomainService.java b/mhd-user-center/src/main/java/com/mhd/user/domain/userAggregate/service/UserYmsDomainService.java new file mode 100644 index 000000000..73cfa870d --- /dev/null +++ b/mhd-user-center/src/main/java/com/mhd/user/domain/userAggregate/service/UserYmsDomainService.java @@ -0,0 +1,117 @@ +package com.mhd.user.domain.userAggregate.service; + +import com.mhd.common.core.domain.dto.YmsSysUserDTO; +import com.mhd.common.core.domain.entity.R; +import com.mhd.common.core.exception.ServiceException; +import com.mhd.common.core.utils.StringUtils; +import com.mhd.system.api.YmsServiceFeign; +import com.mhd.user.domain.userAggregate.entity.UserEntity; +import com.mhd.user.domain.userAggregate.repository.mapper.UserMapper; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.Arrays; + +/** + * YMS平台用户同步领域服务 + * @author AI + * @date 2026/05/12 + */ +@Service +@Slf4j +public class UserYmsDomainService { + + @Resource + private YmsServiceFeign ymsServiceFeign; + @Autowired + private UserMapper userMapper; + + /** + * 同步YMS平台员工信息(新增或修改) + * @param userEntity 用户实体 + * @return boolean + */ + public boolean addOrEditYmsUser(UserEntity userEntity){ + if(userEntity == null){ + log.warn("同步YMS平台员工信息失败:用户实体为空"); + return false; + } + +// R isAddOrEdit = ymsServiceFeign.innerGetInfo(userEntity.getUserId()); + YmsSysUserDTO userEntityByYms = userMapper.selectYmsByUserId(userEntity.getUserId()); +// if (R.FAIL == isAddOrEdit.getCode()) { +// throw new ServiceException(isAddOrEdit.getMsg()); +// } + + if (userEntityByYms == null) { + //新增 + return addYmsUser(userEntity); + }else { + //修改 + return editYmsUser(userEntity); + } + } + + /** + * 新增YMS平台员工基本信息 + * @param userEntity 用户实体 + * @return boolean + */ + public boolean addYmsUser(UserEntity userEntity){ + YmsSysUserDTO ymsSysUserDTO = new YmsSysUserDTO(); + ymsSysUserDTO.setUserName(userEntity.getUserAccount()); + ymsSysUserDTO.setOrganizationId(userEntity.getOrganizationId()); + ymsSysUserDTO.setTopOrganizationId(userEntity.getTopOrganizationId()); + ymsSysUserDTO.setSzwlUserId(userEntity.getUserId()); + ymsSysUserDTO.setNickName(userEntity.getUserName()); + ymsSysUserDTO.setPhonenumber(userEntity.getUserPhone()); + ymsSysUserDTO.setAvatar(userEntity.getAvatar()); + ymsSysUserDTO.setPromoCode(userEntity.getPromoCode()); + ymsSysUserDTO.setUserAccountType(userEntity.getUserAccountType()); + ymsSysUserDTO.setPassword(userEntity.getUserPassword()); + ymsSysUserDTO.setDeptId(103L); + + if (StringUtils.isNotBlank(userEntity.getRoleCode())){ + ymsSysUserDTO.setRoleCodes(Arrays.asList(userEntity.getRoleCode().split(","))); + } + if (StringUtils.isNotBlank(userEntity.getRoleName())){ + ymsSysUserDTO.setRoleNames(Arrays.asList(userEntity.getRoleName().split(","))); + } + + R result = ymsServiceFeign.innerAdd(ymsSysUserDTO); + if (R.FAIL == result.getCode()) { + throw new ServiceException(result.getMsg()); + } + return true; + } + + /** + * 修改YMS平台员工基本信息 + * @param userEntity 用户实体 + * @return boolean + */ + public boolean editYmsUser(UserEntity userEntity){ + YmsSysUserDTO ymsSysUserDTO = new YmsSysUserDTO(); + ymsSysUserDTO.setUserName(userEntity.getUserAccount()); + ymsSysUserDTO.setSzwlUserId(userEntity.getUserId()); + ymsSysUserDTO.setNickName(userEntity.getUserName()); + ymsSysUserDTO.setPhonenumber(userEntity.getUserPhone()); + ymsSysUserDTO.setAvatar(userEntity.getAvatar()); + ymsSysUserDTO.setUserAccountType(userEntity.getUserAccountType()); + + if (StringUtils.isNotBlank(userEntity.getRoleCode())){ + ymsSysUserDTO.setRoleCodes(Arrays.asList(userEntity.getRoleCode().split(","))); + } + if (StringUtils.isNotBlank(userEntity.getRoleName())){ + ymsSysUserDTO.setRoleNames(Arrays.asList(userEntity.getRoleName().split(","))); + } + + R result = ymsServiceFeign.innerEdit(ymsSysUserDTO); + if (R.FAIL == result.getCode()) { + throw new ServiceException(result.getMsg()); + } + return true; + } +} diff --git a/mhd-user-center/src/main/java/com/mhd/user/interfaces/dto/addDTO/UserDTO.java b/mhd-user-center/src/main/java/com/mhd/user/interfaces/dto/addDTO/UserDTO.java index 08c26f52e..8882260a0 100644 --- a/mhd-user-center/src/main/java/com/mhd/user/interfaces/dto/addDTO/UserDTO.java +++ b/mhd-user-center/src/main/java/com/mhd/user/interfaces/dto/addDTO/UserDTO.java @@ -247,4 +247,7 @@ public class UserDTO extends BaseVOEntity { @ApiModelProperty(value = "紧急联系电话") private String emergencyContactPhone; + + @ApiModelProperty("yms密码") + private String plainPassword; } diff --git a/mhd-user-center/src/main/resources/mapper/UserMapper.xml b/mhd-user-center/src/main/resources/mapper/UserMapper.xml index 0af63c215..a2bc6d8f3 100644 --- a/mhd-user-center/src/main/resources/mapper/UserMapper.xml +++ b/mhd-user-center/src/main/resources/mapper/UserMapper.xml @@ -774,4 +774,11 @@ AND u.business_type IN (1, 3) AND u.user_Id = #{userId} + + + \ No newline at end of file diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/businessDocumentOrder/service/BusinessDocumentOrderDomainService.java b/mhd_oms/src/main/java/com/mhd/oms/domain/businessDocumentOrder/service/BusinessDocumentOrderDomainService.java index 94a8f67f2..33c0aa0cd 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/domain/businessDocumentOrder/service/BusinessDocumentOrderDomainService.java +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/businessDocumentOrder/service/BusinessDocumentOrderDomainService.java @@ -386,7 +386,7 @@ public class BusinessDocumentOrderDomainService { businessDocumentOrderDO.setOrgName(String.valueOf(u.getUserPo().getOrganizationName())); } businessDocumentOrderDO.setTopOrganizationId(u.getUserPo().getTopOrganizationId()); - BigDecimal deliveryFreight=tmsOrder.getDeliveryFreight(); + BigDecimal deliveryFreight=businessDocumentOrderDO.getDeliveryFreight(); /** * 生成货源单信息 */ diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationOrder/service/OmsAddressMultiService.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationOrder/service/OmsAddressMultiService.java index c3c4a6025..3ddce8ecd 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationOrder/service/OmsAddressMultiService.java +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationOrder/service/OmsAddressMultiService.java @@ -992,6 +992,9 @@ public class OmsAddressMultiService implements IOmsAddressMultiService { BeanUtils.copyProperties(tmsOrderAddDTO, resevationOrder); String id = tmsOrderAddDTO.getId(); resevationOrder.setId(Long.valueOf(id)); + if (tmsOrderAddDTO.getOrderType()==2){ + resevationOrder.setOrderType(0); + } // 设置更新时间戳和用户信息 resevationOrder.setUpdateTime(new Date()); @@ -1417,12 +1420,15 @@ public class OmsAddressMultiService implements IOmsAddressMultiService { cargoDTO.setCargoName(reservationCargo.getCargoName()); cargoDTO.setCargoNum(reservationCargo.getCargoNum() != null ? reservationCargo.getCargoNum() : BigDecimal.ZERO); cargoDTO.setCargoWeight(reservationCargo.getCargoWeight() != null ? reservationCargo.getCargoWeight() : BigDecimal.ZERO); + cargoDTO.setWeight(reservationCargo.getCargoWeight() != null ? reservationCargo.getCargoWeight() : BigDecimal.ZERO); + cargoDTO.setMaterialVolume(reservationCargo.getCargoVolume() != null ? reservationCargo.getCargoVolume() : BigDecimal.ZERO); cargoDTO.setCargoUnitName(reservationCargo.getCargoUnitName()); cargoDTO.setWeightUnit(reservationCargo.getCargoUnitName()); cargoDTO.setGoodsTypeId(reservationCargo.getGoodsTypeId()); cargoDTO.setGoodsType(reservationCargo.getGoodsType()); cargoDTO.setGoodsNameId(reservationCargo.getGoodsNameId()); cargoDTO.setGoodsName(reservationCargo.getGoodsName()); + cargoDTO.setCargoName(reservationCargo.getGoodsName()); cargoDTO.setMaterialContent(reservationCargo.getCargoContent()); cargoDTO.setMachineCode(reservationCargo.getMachineCode()); businessDocumentCargoMultiList.add(cargoDTO); @@ -1522,8 +1528,8 @@ public class OmsAddressMultiService implements IOmsAddressMultiService { tmsCargoInfo.setCreateTime(new Date()); tmsCargoInfo.setUpdateTime(new Date()); tmsCargoInfo.setOrderId(id); - tmsCargoInfo.setCargoWeight(tmsCargoInfoDTO.getWeight()==null ? BigDecimal.ZERO: tmsCargoInfoDTO.getWeight()); - tmsCargoInfo.setCargoVolume(tmsCargoInfoDTO.getMaterialVolume()==null ? BigDecimal.ZERO: tmsCargoInfoDTO.getMaterialVolume()); + tmsCargoInfo.setCargoWeight(tmsCargoInfoDTO.getCargoWeight()==null ? BigDecimal.ZERO: tmsCargoInfoDTO.getCargoWeight()); + tmsCargoInfo.setCargoVolume(tmsCargoInfoDTO.getCargoVolume()==null ? BigDecimal.ZERO: tmsCargoInfoDTO.getCargoVolume()); tmsCargoInfo.setCargoContent(tmsCargoInfoDTO.getCargoContent()); tmsCargoInfo.setCargoNum(tmsCargoInfoDTO.getCargoNum()==null ? BigDecimal.ZERO: tmsCargoInfoDTO.getCargoNum()); tmsCargoInfo.setGoodsName(tmsCargoInfoDTO.getGoodsName()); @@ -1682,6 +1688,10 @@ public class OmsAddressMultiService implements IOmsAddressMultiService { @Override public Map countByOrderType() { + //获取当前登录用户 + LoginUser loginUser = SecurityUtils.getLoginUser(); + Long userId = loginUser.getUserPo().getUserId(); + // 使用MyBatis Plus的LambdaQueryWrapper进行分组统计 Map countMap = new HashMap<>(); @@ -1689,7 +1699,8 @@ public class OmsAddressMultiService implements IOmsAddressMultiService { for (int i = 0; i <= 5; i++) { LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); queryWrapper.eq(ReservationOrder::getIsDelete, 0) - .eq(ReservationOrder::getOrderType, i); + .eq(ReservationOrder::getOrderType, i) + .eq(ReservationOrder::getRealCreateBy, userId); long count = resevationOrderMapper.selectCount(queryWrapper); countMap.put(i, count); } diff --git a/mhd_oms/src/main/java/com/mhd/oms/interfaces/dto/resevationOrder/OmsCargoInfoDTO.java b/mhd_oms/src/main/java/com/mhd/oms/interfaces/dto/resevationOrder/OmsCargoInfoDTO.java index 0e561729b..6eb232ea0 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/interfaces/dto/resevationOrder/OmsCargoInfoDTO.java +++ b/mhd_oms/src/main/java/com/mhd/oms/interfaces/dto/resevationOrder/OmsCargoInfoDTO.java @@ -62,6 +62,9 @@ public class OmsCargoInfoDTO implements Serializable { @ApiModelProperty("体积") private BigDecimal materialVolume; + @ApiModelProperty("货物体积") + private BigDecimal cargoVolume; + @ApiModelProperty("内容") private String cargoContent; diff --git a/mhd_oms/src/main/java/com/mhd/oms/interfaces/dto/resevationOrder/OmsOrderAddDTO.java b/mhd_oms/src/main/java/com/mhd/oms/interfaces/dto/resevationOrder/OmsOrderAddDTO.java index 819e0fde1..a2c4746c8 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/interfaces/dto/resevationOrder/OmsOrderAddDTO.java +++ b/mhd_oms/src/main/java/com/mhd/oms/interfaces/dto/resevationOrder/OmsOrderAddDTO.java @@ -480,6 +480,9 @@ public class OmsOrderAddDTO implements Serializable { @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") private java.util.Date documentDate; + @ApiModelProperty(value = "预约单类型") + private Integer orderType; + @ApiModelProperty("费用科目明细") private List tmsOrderAccountList; diff --git a/mhd_oms/src/main/java/com/mhd/oms/interfaces/facade/resevationOrder/ResevationOrderApi.java b/mhd_oms/src/main/java/com/mhd/oms/interfaces/facade/resevationOrder/ResevationOrderApi.java index cc4aee747..e2b549876 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/interfaces/facade/resevationOrder/ResevationOrderApi.java +++ b/mhd_oms/src/main/java/com/mhd/oms/interfaces/facade/resevationOrder/ResevationOrderApi.java @@ -236,7 +236,12 @@ public class ResevationOrderApi extends BaseController{ } catch (Exception e) { e.printStackTrace(); - return Result.error("取消预约失败:" + e.getMessage()); + String errorMsg = e.getMessage(); + // 移除错误消息中的换行符及后面的无用信息 + if (errorMsg != null && errorMsg.contains("\n[ErrorCode]:")) { + errorMsg = errorMsg.substring(0, errorMsg.indexOf("\n[ErrorCode]:")); + } + return Result.error("取消预约失败:" + errorMsg); } } diff --git a/mhd_product/src/main/java/com/linke/product/domain/organization/entity/Organization.java b/mhd_product/src/main/java/com/linke/product/domain/organization/entity/Organization.java index eddf6c184..668673a56 100644 --- a/mhd_product/src/main/java/com/linke/product/domain/organization/entity/Organization.java +++ b/mhd_product/src/main/java/com/linke/product/domain/organization/entity/Organization.java @@ -114,6 +114,8 @@ public class Organization extends BaseVOEntity implements Serializable { private String contactPhone; @ApiModelProperty("nc编码") private String ncCode; + @ApiModelProperty("是否排队:0-否,1-是") + private Integer isQueue; } \ No newline at end of file diff --git a/mhd_product/src/main/java/com/linke/product/domain/organization/repository/po/OrganizationPo.java b/mhd_product/src/main/java/com/linke/product/domain/organization/repository/po/OrganizationPo.java index 0b66b6a7c..121d7fa00 100644 --- a/mhd_product/src/main/java/com/linke/product/domain/organization/repository/po/OrganizationPo.java +++ b/mhd_product/src/main/java/com/linke/product/domain/organization/repository/po/OrganizationPo.java @@ -129,4 +129,6 @@ public class OrganizationPo extends BaseVOEntity implements Serializable { private String contactPhone; @ApiModelProperty("nc编码") private String ncCode; + @ApiModelProperty("是否排队:0-否,1-是") + private Integer isQueue; } \ No newline at end of file diff --git a/mhd_product/src/main/java/com/linke/product/domain/organization/repository/todo/OrganizationCorrelationDO.java b/mhd_product/src/main/java/com/linke/product/domain/organization/repository/todo/OrganizationCorrelationDO.java index b49a20345..f9fca3e43 100644 --- a/mhd_product/src/main/java/com/linke/product/domain/organization/repository/todo/OrganizationCorrelationDO.java +++ b/mhd_product/src/main/java/com/linke/product/domain/organization/repository/todo/OrganizationCorrelationDO.java @@ -64,4 +64,6 @@ public class OrganizationCorrelationDO extends BaseVOEntity{ private String contact; @ApiModelProperty("联系人电话") private String contactPhone; + @ApiModelProperty("是否排队:0-否,1-是") + private Integer isQueue; } diff --git a/mhd_product/src/main/java/com/linke/product/interfaces/dto/organization/OrganizationDto.java b/mhd_product/src/main/java/com/linke/product/interfaces/dto/organization/OrganizationDto.java index 3ce72d4e0..fa7b8a5b9 100644 --- a/mhd_product/src/main/java/com/linke/product/interfaces/dto/organization/OrganizationDto.java +++ b/mhd_product/src/main/java/com/linke/product/interfaces/dto/organization/OrganizationDto.java @@ -123,6 +123,8 @@ public class OrganizationDto extends BaseVOEntity implements Serializable { private String contactPhone; @ApiModelProperty("nc编码") private String ncCode; + @ApiModelProperty("是否排队:0-否,1-是") + private Integer isQueue; @ApiModelProperty(name = "唯一key集合(操作菜单使用)") private List idKeyList; diff --git a/mhd_product/src/main/resources/mapper/organization/OrganizationMapper.xml b/mhd_product/src/main/resources/mapper/organization/OrganizationMapper.xml index 92a234b12..9abb4423b 100644 --- a/mhd_product/src/main/resources/mapper/organization/OrganizationMapper.xml +++ b/mhd_product/src/main/resources/mapper/organization/OrganizationMapper.xml @@ -102,7 +102,8 @@ o1.company_name_en, o1.contact, o1.nc_code, - o1.contact_phone + o1.contact_phone, + o1.is_queue FROM sys_organization o1 LEFT JOIN