Commit 7aaa86b5 by 杨卫

feat:账户分配场景精确到4s店维度

1 parent 1c542695
...@@ -35,8 +35,11 @@ public class AssignStaffMerchantV2DTO implements Serializable { ...@@ -35,8 +35,11 @@ public class AssignStaffMerchantV2DTO implements Serializable {
@ApiModelProperty(notes = "园区店列表") @ApiModelProperty(notes = "园区店列表")
private List<ShopItem> shopItemList; private List<ShopItem> shopItemList;
@ApiModelProperty(notes = "是否编辑标识(true:编辑, false:新增)")
private Boolean editFlag;
/** /**
* 园区店项(园区店+驻店类型+4s店列表) * 园区店项(园区店+4s店列表)
*/ */
@Data @Data
@ToString @ToString
...@@ -49,15 +52,12 @@ public class AssignStaffMerchantV2DTO implements Serializable { ...@@ -49,15 +52,12 @@ public class AssignStaffMerchantV2DTO implements Serializable {
@ApiModelProperty(notes = "园区店名称") @ApiModelProperty(notes = "园区店名称")
private String yqMerchantName; private String yqMerchantName;
@ApiModelProperty(notes = "驻店类型(1:门店常驻, 2:临时调动支援)")
private Byte stationType;
@ApiModelProperty(notes = "4s店列表") @ApiModelProperty(notes = "4s店列表")
private List<FourSShopItem> fourSShopList; private List<FourSShopItem> fourSShopList;
} }
/** /**
* 4s店项(4s店+场景列表) * 4s店项(4s店+驻店类型+场景列表)
*/ */
@Data @Data
@ToString @ToString
...@@ -70,7 +70,25 @@ public class AssignStaffMerchantV2DTO implements Serializable { ...@@ -70,7 +70,25 @@ public class AssignStaffMerchantV2DTO implements Serializable {
@ApiModelProperty(notes = "4s店名称") @ApiModelProperty(notes = "4s店名称")
private String merchantName; private String merchantName;
@ApiModelProperty(notes = "业务场景标识列表") @ApiModelProperty(notes = "驻店类型(1:门店常驻, 2:临时调动支援)")
private List<String> baseSceneCodeList; private Byte stationType;
@ApiModelProperty(notes = "业务场景列表")
private List<SceneItem> sceneList;
}
/**
* 场景项(场景标识+原来的场景)
*/
@Data
@ToString
public static class SceneItem implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(notes = "场景标识", required = true)
private String baseSceneCode;
@ApiModelProperty(notes = "原来的场景(scene_type)")
private Byte sceneType;
} }
} }
...@@ -12,7 +12,7 @@ import cn.com.glsx.dj.smartcarlife.dto.scene.SceneDTO; ...@@ -12,7 +12,7 @@ import cn.com.glsx.dj.smartcarlife.dto.scene.SceneDTO;
/** /**
* @ClassName StaffAccountRecordDetailDTO * @ClassName StaffAccountRecordDetailDTO
* @Description 编辑园区店数据回显 DTO * @Description 编辑园区店数据回显 DTO(园区店维度聚合:园区店→4s店列表→场景列表)
*/ */
@Data @Data
@ToString @ToString
...@@ -20,36 +20,49 @@ public class StaffAccountRecordDetailDTO implements Serializable { ...@@ -20,36 +20,49 @@ public class StaffAccountRecordDetailDTO implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ApiModelProperty(notes = "账号记录id")
private Integer id;
@ApiModelProperty(notes = "员工手机号") @ApiModelProperty(notes = "员工手机号")
private String staffPhone; private String staffPhone;
@ApiModelProperty(notes = "4s店商户号")
private Integer merchantId;
@ApiModelProperty(notes = "4s店名称")
private String merchantName;
@ApiModelProperty(notes = "园区店商户号") @ApiModelProperty(notes = "园区店商户号")
private Integer yqMerchantId; private Integer yqMerchantId;
@ApiModelProperty(notes = "园区店名称") @ApiModelProperty(notes = "园区店名称")
private String yqMerchantName; private String yqMerchantName;
@ApiModelProperty(notes = "驻店类型(1:门店常驻, 2:临时调动支援)") @ApiModelProperty(notes = "4s店列表")
private Byte stationType; private List<FourSShopDetailItem> fourSShopList;
/**
* 4s店详情项(4s店+驻店类型+场景列表)
*/
@Data
@ToString
public static class FourSShopDetailItem implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(notes = "账号记录id")
private Integer accountRecordId;
@ApiModelProperty(notes = "4s店商户号")
private Integer merchantId;
@ApiModelProperty(notes = "4s店名称")
private String merchantName;
@ApiModelProperty(notes = "驻店类型(1:门店常驻, 2:临时调动支援)")
private Byte stationType;
@ApiModelProperty(notes = "业务场景列表") @ApiModelProperty(notes = "业务场景列表")
private List<SceneDTO> sceneList; private List<SceneDTO> sceneList;
@ApiModelProperty(notes = "创建时间") @ApiModelProperty(notes = "创建时间")
private Date createdDate; private Date createdDate;
@ApiModelProperty(notes = "创建人") @ApiModelProperty(notes = "创建人")
private String createdBy; private String createdBy;
@ApiModelProperty(notes = "删除标识") @ApiModelProperty(notes = "删除标识")
private String deletedFlag; private String deletedFlag;
} }
}
\ No newline at end of file \ No newline at end of file
...@@ -61,6 +61,9 @@ public class YqMerchant4sSceneDTO implements Serializable { ...@@ -61,6 +61,9 @@ public class YqMerchant4sSceneDTO implements Serializable {
@ApiModelProperty(notes = "场景名称") @ApiModelProperty(notes = "场景名称")
private String sceneName; private String sceneName;
@ApiModelProperty(notes = "原来的场景(scene_type)")
private Byte sceneType;
@ApiModelProperty(notes = "所属园区店商户号") @ApiModelProperty(notes = "所属园区店商户号")
private Integer yqMerchantId; private Integer yqMerchantId;
......
...@@ -223,8 +223,8 @@ public interface StaffBaseInfoRemote { ...@@ -223,8 +223,8 @@ public interface StaffBaseInfoRemote {
@ApiMethod("查询驻店员工门店账号列表") @ApiMethod("查询驻店员工门店账号列表")
@ApiParam(name = "condition", notes = "查询条件", dataType = ApiParam.DataTypeEnum.OBJECT, required = true) @ApiParam(name = "condition", notes = "查询条件", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)
@ApiResponse("门店账号列表") @ApiResponse("门店账号列表(园区店维度聚合)")
RpcResponse<List<StaffAccountRecordDTO>> listStaffAccountRecords(StaffAccountRecordDTO condition); RpcResponse<List<StaffAccountRecordDetailDTO>> listStaffAccountRecords(StaffAccountRecordDTO condition);
@ApiMethod("编辑园区店数据回显") @ApiMethod("编辑园区店数据回显")
@ApiParam(name = "accountRecordId", notes = "账号记录id", dataType = ApiParam.DataTypeEnum.INTEGER, required = true) @ApiParam(name = "accountRecordId", notes = "账号记录id", dataType = ApiParam.DataTypeEnum.INTEGER, required = true)
......
...@@ -179,12 +179,6 @@ ...@@ -179,12 +179,6 @@
<version>4.54.0-SNAPSHOT</version> <version>4.54.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>cn.com.glsx</groupId>
<artifactId>rpc-dj-mindworkplate-api</artifactId>
<version>5.6.1-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>cn.com.glsx.dj</groupId> <groupId>cn.com.glsx.dj</groupId>
<artifactId>rpc-dj-sale-api</artifactId> <artifactId>rpc-dj-sale-api</artifactId>
<version>${sale.api.version}</version> <version>${sale.api.version}</version>
......
...@@ -462,7 +462,7 @@ public class StaffBaseInfoRemoteImpl implements StaffBaseInfoRemote { ...@@ -462,7 +462,7 @@ public class StaffBaseInfoRemoteImpl implements StaffBaseInfoRemote {
return RpcResponse.success("分配成功"); return RpcResponse.success("分配成功");
} catch (Exception e) { } catch (Exception e) {
log.error("员工基础账号分配门店V2异常: {}", e.getMessage(), e); log.error("员工基础账号分配门店V2异常: {}", e.getMessage(), e);
return RpcResponse.fail(e.getMessage()); return RpcResponse.error(e);
} }
} }
...@@ -474,9 +474,12 @@ public class StaffBaseInfoRemoteImpl implements StaffBaseInfoRemote { ...@@ -474,9 +474,12 @@ public class StaffBaseInfoRemoteImpl implements StaffBaseInfoRemote {
try { try {
staffAccountRecordService.disableStaffAccountV2(condition); staffAccountRecordService.disableStaffAccountV2(condition);
return RpcResponse.success("操作成功"); return RpcResponse.success("操作成功");
} catch (RpcServiceException e) {
log.error("禁用或启用员工园区店账号V2异常: ", e);
return RpcResponse.error(e);
} catch (Exception e) { } catch (Exception e) {
log.error("禁用或启用员工园区店账号V2异常: {}", e.getMessage(), e); log.error("禁用或启用员工园区店账号V2异常: ", e);
return RpcResponse.fail(e.getMessage()); return RpcResponse.error(e);
} }
} }
...@@ -488,23 +491,29 @@ public class StaffBaseInfoRemoteImpl implements StaffBaseInfoRemote { ...@@ -488,23 +491,29 @@ public class StaffBaseInfoRemoteImpl implements StaffBaseInfoRemote {
try { try {
List<YqMerchant4sSceneDTO> result = sceneMerchantRefService.query4sByYqMerchantList(yqMerchantIdList); List<YqMerchant4sSceneDTO> result = sceneMerchantRefService.query4sByYqMerchantList(yqMerchantIdList);
return RpcResponse.success(result); return RpcResponse.success(result);
} catch (RpcServiceException e) {
log.error("查询园区店下4s店及业务场景异常: ", e);
return RpcResponse.error(e);
} catch (Exception e) { } catch (Exception e) {
log.error("查询园区店下4s店及业务场景异常: {}", e.getMessage(), e); log.error("查询园区店下4s店及业务场景异常: ", e);
return RpcResponse.fail(e.getMessage()); return RpcResponse.error(e);
} }
} }
@ApiMethod("查询驻店员工门店账号列表") @ApiMethod("查询驻店员工门店账号列表")
@ApiParam(name = "condition", notes = "查询条件", dataType = ApiParam.DataTypeEnum.OBJECT, required = true) @ApiParam(name = "condition", notes = "查询条件", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)
@ApiResponse("门店账号列表") @ApiResponse("门店账号列表(园区店维度聚合)")
@Override @Override
public RpcResponse<List<StaffAccountRecordDTO>> listStaffAccountRecords(StaffAccountRecordDTO condition) { public RpcResponse<List<StaffAccountRecordDetailDTO>> listStaffAccountRecords(StaffAccountRecordDTO condition) {
try { try {
List<StaffAccountRecordDTO> result = staffAccountRecordService.listStaffAccountRecords(condition); List<StaffAccountRecordDetailDTO> result = staffAccountRecordService.listStaffAccountRecordsGrouped(condition);
return RpcResponse.success(result); return RpcResponse.success(result);
} catch (RpcServiceException e) {
log.error("查询驻店员工门店账号列表异常: ", e);
return RpcResponse.error(e);
} catch (Exception e) { } catch (Exception e) {
log.error("查询驻店员工门店账号列表异常: {}", e.getMessage(), e); log.error("查询驻店员工门店账号列表异常: ", e);
return RpcResponse.fail(e.getMessage()); return RpcResponse.error(e);
} }
} }
...@@ -516,9 +525,12 @@ public class StaffBaseInfoRemoteImpl implements StaffBaseInfoRemote { ...@@ -516,9 +525,12 @@ public class StaffBaseInfoRemoteImpl implements StaffBaseInfoRemote {
try { try {
StaffAccountRecordDetailDTO result = staffAccountRecordService.getStaffAccountRecordDetail(accountRecordId); StaffAccountRecordDetailDTO result = staffAccountRecordService.getStaffAccountRecordDetail(accountRecordId);
return RpcResponse.success(result); return RpcResponse.success(result);
} catch (RpcServiceException e) {
log.error("编辑园区店数据回显异常: ", e);
return RpcResponse.error(e);
} catch (Exception e) { } catch (Exception e) {
log.error("编辑园区店数据回显异常: {}", e.getMessage(), e); log.error("编辑园区店数据回显异常: ", e);
return RpcResponse.fail(e.getMessage()); return RpcResponse.error(e);
} }
} }
...@@ -529,9 +541,12 @@ public class StaffBaseInfoRemoteImpl implements StaffBaseInfoRemote { ...@@ -529,9 +541,12 @@ public class StaffBaseInfoRemoteImpl implements StaffBaseInfoRemote {
try { try {
int count = staffAccountRecordService.cleanInvalidAccountScene(); int count = staffAccountRecordService.cleanInvalidAccountScene();
return RpcResponse.success(count); return RpcResponse.success(count);
} catch (RpcServiceException e) {
log.error("清理无效账户场景数据异常: ", e);
return RpcResponse.error(e);
} catch (Exception e) { } catch (Exception e) {
log.error("清理无效账户场景数据异常: {}", e.getMessage(), e); log.error("系统异常: ", e);
return RpcResponse.fail(e.getMessage()); return RpcResponse.error(e);
} }
} }
} }
...@@ -2163,11 +2163,13 @@ public class SceneMerchantRefService { ...@@ -2163,11 +2163,13 @@ public class SceneMerchantRefService {
// 4s店名称取第一条 // 4s店名称取第一条
shopDto.setShopMerchantName(shopItems.get(0).getMainMerchantName()); shopDto.setShopMerchantName(shopItems.get(0).getMainMerchantName());
// 场景列表 // 场景列表
Map<String, String> finalSceneNameMap = sceneNameMap;
List<YqMerchant4sSceneDTO.SceneDetailDTO> sceneList = shopItems.stream().map(item -> { List<YqMerchant4sSceneDTO.SceneDetailDTO> sceneList = shopItems.stream().map(item -> {
YqMerchant4sSceneDTO.SceneDetailDTO sceneDto = new YqMerchant4sSceneDTO.SceneDetailDTO(); YqMerchant4sSceneDTO.SceneDetailDTO sceneDto = new YqMerchant4sSceneDTO.SceneDetailDTO();
sceneDto.setBaseSceneCode(item.getBaseSceneCode()); sceneDto.setBaseSceneCode(item.getBaseSceneCode());
sceneDto.setScene(item.getScene() != null ? String.valueOf(item.getScene()) : null); sceneDto.setScene(item.getScene() != null ? String.valueOf(item.getScene()) : null);
sceneDto.setSceneName(sceneNameMap.getOrDefault(item.getBaseSceneCode(), item.getBaseSceneCode())); sceneDto.setSceneName(finalSceneNameMap.getOrDefault(item.getBaseSceneCode(), item.getBaseSceneCode()));
sceneDto.setSceneType(item.getScene() != null ? item.getScene().byteValue() : null);
sceneDto.setYqMerchantId(item.getSubMerchantId()); sceneDto.setYqMerchantId(item.getSubMerchantId());
sceneDto.setYqMerchantName(item.getSubMerchantName()); sceneDto.setYqMerchantName(item.getSubMerchantName());
return sceneDto; return sceneDto;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!