Merge remote-tracking branch 'refs/remotes/origin/dev' into nanguangmall
This commit is contained in:
+2
@@ -19,6 +19,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.cloud.stream.function.StreamBridge;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@@ -39,6 +40,7 @@ public class AgentSignApplicationService {
|
||||
|
||||
@Resource
|
||||
private ThirdPartyServiceFeign thirdPartyServiceFeign;
|
||||
@Lazy
|
||||
@Autowired
|
||||
private MotorcadeCollectionApplicationService motorcadeCollectionApplicationService;
|
||||
// @Autowired
|
||||
|
||||
+2
@@ -36,6 +36,7 @@ import com.mhd.user.interfaces.dto.MotorcadeCollectionDTO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -56,6 +57,7 @@ import java.util.Map;
|
||||
public class MotorcadeCollectionApplicationService {
|
||||
@Autowired
|
||||
private MotorcadeCollectionDomainService motorcadeCollectionDomainService;
|
||||
@Lazy
|
||||
@Autowired
|
||||
private AgentSignApplicationService agentSignApplicationService;
|
||||
@Autowired
|
||||
|
||||
+6
@@ -32,6 +32,7 @@ import com.mhd.user.domain.roleAggregate.service.RoleDomainService;
|
||||
import com.mhd.user.domain.userAggregate.entity.UserRoleEntity;
|
||||
import com.mhd.user.domain.userAggregate.entity.UserShipperEntity;
|
||||
import com.mhd.user.domain.userAggregate.event.ShipperEventPublisher;
|
||||
import com.mhd.user.domain.userAggregate.repository.po.UserDriverPo;
|
||||
import com.mhd.user.domain.userAggregate.repository.todo.*;
|
||||
import com.mhd.user.domain.userAggregate.service.*;
|
||||
import com.mhd.user.infrastructure.feign.ProductServiceFeign;
|
||||
@@ -1022,4 +1023,9 @@ public class UserShipperApplicationService {
|
||||
public SettlementInfoQueryVo getSettlementInfoByUserId(Long userId) {
|
||||
return userShipperDomainService.getSettlementInfoByUserId(userId);
|
||||
}
|
||||
|
||||
|
||||
public com.mhd.common.core.domain.po.UserShipperPo getShipperSummaryData(Long userId) {
|
||||
return userShipperDomainService.getShipperSummaryData(userId);
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -56,6 +56,6 @@ public interface MotorcadeMapper extends BaseMapper<Motorcade>
|
||||
|
||||
List<UserDriverPo> fleetInviteDriverList(@Param("motorcadeDriverDO") MotorcadeDriverDO motorcadeDriverDO);
|
||||
|
||||
@Select("SELECT m.* FROM `motorcade_driver` md LEFT JOIN motorcade m ON md.motorcade_id = m.motorcade_id WHERE md.del_flag = 1 AND m.del_flag = 1 AND md.user_id = #{userId} AND m.motorcade_header_id != #{userId}")
|
||||
@Select("SELECT m.* FROM motorcade_driver md LEFT JOIN motorcade m ON md.motorcade_id = m.motorcade_id WHERE md.del_flag = 1 AND m.del_flag = 1 AND md.user_id = #{userId} AND m.motorcade_header_id != #{userId}")
|
||||
List<MotorcadePo> getAllOtherMotorcade(@Param("userId") Long userId);
|
||||
}
|
||||
|
||||
+1
-1
@@ -37,6 +37,6 @@ public interface MotorcadeRecordMapper extends BaseMapper<MotorcadeRecord>
|
||||
*/
|
||||
List<MotorcadeRecordPo> invitationRecordListPC(@Param("motorcadeRecordDo")MotorcadeRecordDO motorcadeRecordDo);
|
||||
|
||||
@Select("SELECT * FROM `motorcade_record` WHERE del_flag = 1 AND motorcade_id IN (SELECT motorcade_id FROM motorcade WHERE del_flag = 1 and motorcade_header_id = #{userId})")
|
||||
@Select("SELECT * FROM motorcade_record WHERE del_flag = 1 AND motorcade_id IN (SELECT motorcade_id FROM motorcade WHERE del_flag = 1 and motorcade_header_id = #{userId})")
|
||||
List<MotorcadeRecord> getByMotorHeaderId(@Param("userId") Long userId);
|
||||
}
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ import java.util.List;
|
||||
public interface CustomAuthUserMapper extends BaseMapper<CustomAuthUserEntity> {
|
||||
|
||||
List<CustomAuthRoleOrUserPO> getCustomAuthByRoleOrUserId(CustomAuthDO customAuthDO);
|
||||
@Select("SELECT * FROM `custom_auth_role` WHERE role_id IN (SELECT role_id FROM user_role WHERE user_id = #{userId})")
|
||||
@Select("SELECT * FROM custom_auth_role WHERE role_id IN (SELECT role_id FROM user_role WHERE user_id = #{userId})")
|
||||
List<CustomAuthRoleOrUserPO> getCustomAuthByRole(@Param("userId") Long userId);
|
||||
|
||||
void deleteCustomAuthUserByUserId(CustomAuthDO customAuthDO);
|
||||
|
||||
+7
-1
@@ -14,7 +14,7 @@ import java.util.Date;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@TableName("user")
|
||||
@TableName("\"USER\"")
|
||||
public class UserEntity extends BaseVOEntity {
|
||||
|
||||
@ApiModelProperty(name = "用户ID")
|
||||
@@ -159,4 +159,10 @@ public class UserEntity extends BaseVOEntity {
|
||||
|
||||
@ApiModelProperty(name = "有效期管理 0-否 1-是")
|
||||
private Integer validityPeriodManagement;
|
||||
|
||||
@ApiModelProperty(name = "业务员nc编码")
|
||||
private String salespersonNcCode;
|
||||
|
||||
@ApiModelProperty(name = "制单员nc编码")
|
||||
private String documentPreparerNcCode;
|
||||
}
|
||||
|
||||
+3
@@ -191,4 +191,7 @@ public class UserShipperEntity extends BaseVOEntity {
|
||||
private BigDecimal authorizedUsedAmount;
|
||||
|
||||
private String remark;
|
||||
|
||||
@ApiModelProperty(name = "客户nc编码")
|
||||
private String customerNcCode;
|
||||
}
|
||||
|
||||
+2
@@ -58,4 +58,6 @@ public interface UserShipperRepositoryInterface extends IService<UserShipperEnti
|
||||
SettlementInfoQueryVo getAuthorizedAmountByShipperId(Long shipperId);
|
||||
|
||||
SettlementInfoQueryVo getSettlementInfoByUserId(Long userId);
|
||||
|
||||
public com.mhd.common.core.domain.po.UserShipperPo getShipperSummaryData(Long userId);
|
||||
}
|
||||
|
||||
+1
-1
@@ -37,6 +37,6 @@ public interface DriverVehicleBindMapper extends BaseMapper<DriverVehicleBind>
|
||||
*/
|
||||
List<VehicleDriverBindAppPo> queryVehicleBindInfo(@Param("driverVehicleBindDo") DriverVehicleBindDo driverVehicleBindDo);
|
||||
|
||||
@Select("SELECT count(driver_vehicle_bind_id) FROM `driver_vehicle_bind` WHERE (user_id = #{userId} OR driver_bind_id = #{userId}) AND del_flag = 1 ")
|
||||
@Select("SELECT count(driver_vehicle_bind_id) FROM driver_vehicle_bind WHERE (user_id = #{userId} OR driver_bind_id = #{userId}) AND del_flag = 1 ")
|
||||
Integer selectByUserId(@Param("userId") Long userId);
|
||||
}
|
||||
|
||||
+2
-2
@@ -51,7 +51,7 @@ public interface UserMapper extends BaseMapper<UserEntity> {
|
||||
|
||||
List<UserDriverEnterprisePo> getAllDriverByOrganization(@Param("topOrganizationId") Long topOrganizationId);
|
||||
|
||||
@Select("SELECT COUNT(*) FROM `user` WHERE del_flag = 1 AND create_by = #{userId} AND user_id != #{userId}")
|
||||
@Select("SELECT COUNT(*) FROM \"USER\" WHERE del_flag = 1 AND create_by = #{userId} AND user_id != #{userId}")
|
||||
Integer selectCreatByUserId(@Param("userId") Long userId);
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ public interface UserMapper extends BaseMapper<UserEntity> {
|
||||
*/
|
||||
List<UserAppPo> selectAppUserListByRoleCode(UserDO userDO);
|
||||
|
||||
@Select("SELECT * FROM `user` WHERE del_flag = 1 AND organization_id = #{organizationId} AND user_account_type = 3 limit 1")
|
||||
@Select("SELECT * FROM \"USER\" WHERE del_flag = 1 AND organization_id = #{organizationId} AND user_account_type = 3 limit 1")
|
||||
UserEntity selectByTopOrganizationId(@Param("organizationId") Long organizationId);
|
||||
|
||||
|
||||
|
||||
+2
@@ -26,4 +26,6 @@ public interface UserShipperMapper extends BaseMapper<UserShipperEntity> {
|
||||
List<UserShipperEntity> getChooseShipper(@Param("userIdList") List<Long> userIdList);
|
||||
|
||||
List<UserShipperEntity> selectBySealId(@Param("userShipperEntity") UserShipperEntity userShipperEntity);
|
||||
|
||||
public com.mhd.common.core.domain.po.UserShipperPo getShipperSummaryData(Long userId);
|
||||
}
|
||||
|
||||
+5
@@ -161,4 +161,9 @@ public class UserShipperRepositoryImpl extends ServiceImpl<UserShipperMapper, Us
|
||||
BeanUtils.copyProperties(entity, queryVo);
|
||||
return queryVo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public com.mhd.common.core.domain.po.UserShipperPo getShipperSummaryData(Long userId) {
|
||||
return shipperMapper.getShipperSummaryData(userId);
|
||||
}
|
||||
}
|
||||
|
||||
+3
@@ -254,4 +254,7 @@ public class UserShipperPo implements Serializable {
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
@ApiModelProperty(name = "客户nc编码")
|
||||
private String customerNcCode;
|
||||
}
|
||||
|
||||
+6
@@ -248,4 +248,10 @@ public class UserDO extends BaseVOEntity {
|
||||
|
||||
@ApiModelProperty(name = "有效期管理 0-否 1-是")
|
||||
private Integer validityPeriodManagement;
|
||||
|
||||
@ApiModelProperty(name = "业务员nc编码")
|
||||
private String salespersonNcCode;
|
||||
|
||||
@ApiModelProperty(name = "制单员nc编码")
|
||||
private String documentPreparerNcCode;
|
||||
}
|
||||
|
||||
+3
@@ -225,4 +225,7 @@ public class UserShipperDO extends UserDO {
|
||||
private Integer freightNode;
|
||||
|
||||
private String remark;
|
||||
|
||||
@ApiModelProperty(name = "客户nc编码")
|
||||
private String customerNcCode;
|
||||
}
|
||||
|
||||
+4
@@ -223,4 +223,8 @@ public class UserShipperDomainService {
|
||||
public SettlementInfoQueryVo getSettlementInfoByUserId(Long userId) {
|
||||
return userShipperRepositoryInterface.getSettlementInfoByUserId(userId);
|
||||
}
|
||||
|
||||
public com.mhd.common.core.domain.po.UserShipperPo getShipperSummaryData(Long userId) {
|
||||
return userShipperRepositoryInterface.getShipperSummaryData(userId);
|
||||
}
|
||||
}
|
||||
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
package com.mhd.user.infrastructure.config;
|
||||
|
||||
import com.mhd.user.infrastructure.util.CamelCaseUtils;
|
||||
import org.apache.ibatis.executor.resultset.ResultSetHandler;
|
||||
import org.apache.ibatis.plugin.*;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.sql.Statement;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
|
||||
/**
|
||||
* MyBatis插件:拦截Map类型结果,转换Key为驼峰
|
||||
*/
|
||||
@Intercepts({@Signature(
|
||||
type = ResultSetHandler.class,
|
||||
method = "handleResultSets",
|
||||
args = {Statement.class}
|
||||
)})
|
||||
@Component
|
||||
public class CamelCaseMapPlugin implements Interceptor {
|
||||
|
||||
@Override
|
||||
public Object intercept(Invocation invocation) throws Throwable {
|
||||
// 执行原方法获取结果
|
||||
Object result = invocation.proceed();
|
||||
// 处理结果:如果是List且元素是Map,转换Key
|
||||
if (result instanceof List<?>) {
|
||||
List<Map<String, Object>> list = (List<Map<String, Object>>) result;
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
Object item = list.get(i);
|
||||
if (item instanceof Map<?, ?>) {
|
||||
@SuppressWarnings("unchecked")
|
||||
Map<String, Object> map = (Map<String, Object>) item;
|
||||
// 转换Key为驼峰
|
||||
list.set(i, CamelCaseUtils.convertMapKeyToCamel(map));
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object plugin(Object target) {
|
||||
// 只拦截ResultSetHandler类型
|
||||
if (target instanceof ResultSetHandler) {
|
||||
return Plugin.wrap(target, this);
|
||||
}
|
||||
return target;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setProperties(Properties properties) {
|
||||
// 可配置参数,此处无需处理
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package com.mhd.user.infrastructure.util;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 字符串工具类扩展:下划线/大写转驼峰
|
||||
*/
|
||||
public class CamelCaseUtils {
|
||||
|
||||
/**
|
||||
* 大写下划线转驼峰(如:USER_NAME → userName)
|
||||
*/
|
||||
public static String toCamelCase(String str) {
|
||||
if (StringUtils.isBlank(str)) {
|
||||
return str;
|
||||
}
|
||||
// 先转小写,再处理下划线
|
||||
str = str.toLowerCase();
|
||||
StringBuilder sb = new StringBuilder();
|
||||
boolean nextUpperCase = false;
|
||||
for (int i = 0; i < str.length(); i++) {
|
||||
char c = str.charAt(i);
|
||||
if (c == '_') {
|
||||
nextUpperCase = true;
|
||||
} else {
|
||||
if (nextUpperCase) {
|
||||
sb.append(Character.toUpperCase(c));
|
||||
nextUpperCase = false;
|
||||
} else {
|
||||
sb.append(c);
|
||||
}
|
||||
}
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量转换Map的Key为驼峰
|
||||
*/
|
||||
public static <V> Map<String, V> convertMapKeyToCamel(Map<String, V> map) {
|
||||
if (map == null || map.isEmpty()) {
|
||||
return map;
|
||||
}
|
||||
Map<String, V> newMap = new HashMap<>(map.size());
|
||||
for (Map.Entry<String, V> entry : map.entrySet()) {
|
||||
String camelKey = toCamelCase(entry.getKey());
|
||||
newMap.put(camelKey, entry.getValue());
|
||||
}
|
||||
return newMap;
|
||||
}
|
||||
}
|
||||
@@ -235,4 +235,10 @@ public class UserDTO extends BaseVOEntity {
|
||||
|
||||
@ApiModelProperty(name = "有效期管理 0-否 1-是")
|
||||
private Integer validityPeriodManagement;
|
||||
|
||||
@ApiModelProperty("业务员nc编码")
|
||||
private String salespersonNcCode;
|
||||
|
||||
@ApiModelProperty( "制单员nc编码")
|
||||
private String documentPreparerNcCode;
|
||||
}
|
||||
|
||||
@@ -191,4 +191,7 @@ public class UserShipperDTO extends UserDTO {
|
||||
@ApiModelProperty(name = "备注信息")
|
||||
private String remark;
|
||||
|
||||
@ApiModelProperty("客户nc编码")
|
||||
private String customerNcCode;
|
||||
|
||||
}
|
||||
|
||||
@@ -199,4 +199,10 @@ public class UserShipperAPI extends BaseController {
|
||||
SettlementInfoQueryVo infoQueryVo = userShipperApplicationService.getSettlementInfoByUserId(userId);
|
||||
return R.ok(infoQueryVo);
|
||||
}
|
||||
|
||||
@ApiOperation("查询委托方汇总数据")
|
||||
@GetMapping("/getShipperSummaryData/{userId}")
|
||||
public AjaxResult<?> getShipperSummaryData(@PathVariable Long userId) {
|
||||
return AjaxResult.success(userShipperApplicationService.getShipperSummaryData(userId));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user