|
@@ -694,18 +694,57 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
|
|
Optional.ofNullable(maxTfCustomFlow).orElseThrow(() -> ExceptionResultEnum.FLOW_CUSTOM_NO_DATA.exception());
|
|
Optional.ofNullable(maxTfCustomFlow).orElseThrow(() -> ExceptionResultEnum.FLOW_CUSTOM_NO_DATA.exception());
|
|
sopInfoListParam.setVersion(maxTfCustomFlow.getVersion());
|
|
sopInfoListParam.setVersion(maxTfCustomFlow.getVersion());
|
|
String tableName = sopInfoListParam.getType().getTableName() + "_" + sopInfoListParam.getVersion();
|
|
String tableName = sopInfoListParam.getType().getTableName() + "_" + sopInfoListParam.getVersion();
|
|
- String fieldName = null, fieldValue = null, fieldOrder = null;
|
|
|
|
|
|
+ String fieldName = null, fieldValue = null, fieldOrder = null, defaultFieldName = null, defaultFieldOrder = null;
|
|
StringJoiner stringJoinerView = new StringJoiner(",");
|
|
StringJoiner stringJoinerView = new StringJoiner(",");
|
|
StringJoiner stringJoinerCondition = new StringJoiner("");
|
|
StringJoiner stringJoinerCondition = new StringJoiner("");
|
|
StringJoiner stringJoinerOrder = new StringJoiner("");
|
|
StringJoiner stringJoinerOrder = new StringJoiner("");
|
|
|
|
+ StringJoiner stringJoinerDefaultView = new StringJoiner(",");
|
|
|
|
+ StringJoiner stringJoinerDefaultFieldOrderView = new StringJoiner(",");
|
|
|
|
+ stringJoinerDefaultFieldOrderView = stringJoinerDefaultFieldOrderView.add("order by tbsi.update_time desc");
|
|
|
|
|
|
//显示字段
|
|
//显示字段
|
|
|
|
+ boolean pendApproveName = false;
|
|
if (!CollectionUtils.isEmpty(sopInfoListParam.getFormWidgetMetadataViewList())) {
|
|
if (!CollectionUtils.isEmpty(sopInfoListParam.getFormWidgetMetadataViewList())) {
|
|
for (FormWidgetMetadataParam f : sopInfoListParam.getFormWidgetMetadataViewList()) {
|
|
for (FormWidgetMetadataParam f : sopInfoListParam.getFormWidgetMetadataViewList()) {
|
|
- stringJoinerView.add(f.getFieldId());
|
|
|
|
|
|
+ //加入固定字段转换
|
|
|
|
+ if (SystemConstant.SOP_TRANSFORM_MAP.containsKey(f.getFieldId())) {
|
|
|
|
+ if (Objects.equals(f.getFieldId(), "pendApproveName")) {
|
|
|
|
+ pendApproveName = true;
|
|
|
|
+ } else if (Objects.equals(f.getFieldId(), "taskName")) {
|
|
|
|
+ stringJoinerDefaultView.add(
|
|
|
|
+ "IFNULL(" + SystemConstant.SOP_TRANSFORM_MAP.get(f.getFieldId()) + ",'--') as "
|
|
|
|
+ + f.getFieldId());
|
|
|
|
+ } else if (Objects.equals(f.getFieldId(), "sopNo")) {
|
|
|
|
+ stringJoinerDefaultFieldOrderView.add(
|
|
|
|
+ SystemConstant.SOP_TRANSFORM_MAP.get(f.getFieldId()) + " desc");
|
|
|
|
+ stringJoinerDefaultView.add(
|
|
|
|
+ SystemConstant.SOP_TRANSFORM_MAP.get(f.getFieldId()) + " as " + f.getFieldId());
|
|
|
|
+ } else {
|
|
|
|
+ stringJoinerDefaultView.add(
|
|
|
|
+ SystemConstant.SOP_TRANSFORM_MAP.get(f.getFieldId()) + " as " + f.getFieldId());
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ stringJoinerView.add(f.getFieldId());
|
|
|
|
+ }
|
|
}
|
|
}
|
|
fieldName = stringJoinerView.toString();
|
|
fieldName = stringJoinerView.toString();
|
|
|
|
+ } else {
|
|
|
|
+ for (Map.Entry<String, String> entry : SystemConstant.SOP_TRANSFORM_MAP.entrySet()) {
|
|
|
|
+ if (Objects.equals(entry.getKey(), "pendApproveName")) {
|
|
|
|
+ pendApproveName = true;
|
|
|
|
+ } else if (Objects.equals(entry.getKey(), "taskName")) {
|
|
|
|
+ stringJoinerDefaultView.add("IFNULL(" + entry.getValue() + ",'--') as " + entry.getKey());
|
|
|
|
+ } else if (Objects.equals(entry.getKey(), "sopNo")) {
|
|
|
|
+ stringJoinerDefaultFieldOrderView.add(entry.getValue() + " desc");
|
|
|
|
+ stringJoinerDefaultView.add(entry.getValue() + " as " + entry.getKey());
|
|
|
|
+ } else {
|
|
|
|
+ stringJoinerDefaultView.add(entry.getValue() + " as " + entry.getKey());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+ defaultFieldName = stringJoinerDefaultView.toString();
|
|
|
|
+ defaultFieldOrder = stringJoinerDefaultFieldOrderView.toString();
|
|
|
|
+
|
|
//筛选字段
|
|
//筛选字段
|
|
if (!CollectionUtils.isEmpty(sopInfoListParam.getFormWidgetMetadataConditionList())) {
|
|
if (!CollectionUtils.isEmpty(sopInfoListParam.getFormWidgetMetadataConditionList())) {
|
|
LinkedMultiValueMap<String, FormWidgetMetadataParam> formWidgetMetadataParamLinkedMultiValueMap = new LinkedMultiValueMap<>(
|
|
LinkedMultiValueMap<String, FormWidgetMetadataParam> formWidgetMetadataParamLinkedMultiValueMap = new LinkedMultiValueMap<>(
|
|
@@ -849,9 +888,10 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
|
|
IPage<Map> list = this.baseMapper.list(
|
|
IPage<Map> list = this.baseMapper.list(
|
|
new Page<>(sopInfoListParam.getPageNumber(), sopInfoListParam.getPageSize()),
|
|
new Page<>(sopInfoListParam.getPageNumber(), sopInfoListParam.getPageSize()),
|
|
Objects.nonNull(sopInfoListParam.getType()) ? sopInfoListParam.getType().name() : null,
|
|
Objects.nonNull(sopInfoListParam.getType()) ? sopInfoListParam.getType().name() : null,
|
|
- sopInfoListParam.getServiceId(), tableName, fieldName, fieldValue, dpr, fieldOrder,
|
|
|
|
- sopInfoListParam.getLeadId(), sopInfoListParam.getCrmUserId(), sopInfoListParam.getCustomName(),
|
|
|
|
- sopInfoListParam.getTaskKey(), sopInfoListParam.getCrmName(), sopInfoListParam.getSopNo(),
|
|
|
|
|
|
+ sopInfoListParam.getServiceId(), tableName, fieldName, fieldValue, dpr, fieldOrder, defaultFieldName,
|
|
|
|
+ defaultFieldOrder, sopInfoListParam.getLeadId(), sopInfoListParam.getCrmUserId(),
|
|
|
|
+ sopInfoListParam.getCustomName(), sopInfoListParam.getTaskKey(), sopInfoListParam.getCrmName(),
|
|
|
|
+ sopInfoListParam.getSopNo(),
|
|
Objects.nonNull(sopInfoListParam.getDingPlan()) ? sopInfoListParam.getDingPlan().toString() : null);
|
|
Objects.nonNull(sopInfoListParam.getDingPlan()) ? sopInfoListParam.getDingPlan().toString() : null);
|
|
SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
|
|
SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
|
|
for (Map m : list.getRecords()) {
|
|
for (Map m : list.getRecords()) {
|
|
@@ -888,17 +928,19 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
|
|
}
|
|
}
|
|
|
|
|
|
String flowId = (String) m.get("flowId");
|
|
String flowId = (String) m.get("flowId");
|
|
- TFFlowLog tfFlowLog = tfFlowLogService.findByLastFlowLog(Long.parseLong(flowId));
|
|
|
|
- if (Objects.nonNull(tfFlowLog) && Objects.nonNull(tfFlowLog.getPendApproveId())) {
|
|
|
|
- List<String> userList = Arrays.asList(
|
|
|
|
- tfFlowLog.getPendApproveId().split(SystemConstant.LIST_JOIN_SPLIT));
|
|
|
|
- List<OrgUserNameDto> orgUserNameDtoList = sysUserService.findOrgUserName(
|
|
|
|
- userList.stream().map(s -> Long.parseLong(s)).collect(Collectors.toList()));
|
|
|
|
- List<String> userName = orgUserNameDtoList.stream().map(s -> s.getOrgUserName())
|
|
|
|
- .collect(Collectors.toList());
|
|
|
|
- m.put("pendApproveName", StringUtils.join(userName, SystemConstant.LIST_JOIN_SPLIT));
|
|
|
|
- } else {
|
|
|
|
- m.put("pendApproveName", "--");
|
|
|
|
|
|
+ if (pendApproveName) {
|
|
|
|
+ TFFlowLog tfFlowLog = tfFlowLogService.findByLastFlowLog(Long.parseLong(flowId));
|
|
|
|
+ if (Objects.nonNull(tfFlowLog) && Objects.nonNull(tfFlowLog.getPendApproveId())) {
|
|
|
|
+ List<String> userList = Arrays.asList(
|
|
|
|
+ tfFlowLog.getPendApproveId().split(SystemConstant.LIST_JOIN_SPLIT));
|
|
|
|
+ List<OrgUserNameDto> orgUserNameDtoList = sysUserService.findOrgUserName(
|
|
|
|
+ userList.stream().map(s -> Long.parseLong(s)).collect(Collectors.toList()));
|
|
|
|
+ List<String> userName = orgUserNameDtoList.stream().map(s -> s.getOrgUserName())
|
|
|
|
+ .collect(Collectors.toList());
|
|
|
|
+ m.put("pendApproveName", StringUtils.join(userName, SystemConstant.LIST_JOIN_SPLIT));
|
|
|
|
+ } else {
|
|
|
|
+ m.put("pendApproveName", "--");
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
String taskIds = (String) m.get("taskId");
|
|
String taskIds = (String) m.get("taskId");
|