| | |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.hx.common.service.CommonService; |
| | | import com.hx.mybatisTool.SqlSentence; |
| | | import com.hx.phiappt.model.appeal.AppealType; |
| | |
| | | */ |
| | | public class AppealTypeTool { |
| | | |
| | | public static void orderProjectInsert(String orderId, String orderItemId, List<String> appealTypeIdList, CommonService commonService){ |
| | | |
| | | if(appealTypeIdList == null || appealTypeIdList.size() < 1){ |
| | | public static void orderProjectInsert(String orderId, String orderItemId, List<AppealTypeVo> appealTypeVoList, CommonService commonService){ |
| | | if(appealTypeVoList == null || appealTypeVoList.size() < 1){ |
| | | return; |
| | | } |
| | | |
| | | List<AppealTypeVo> appealTypeVoList = getAppealTypeListByIdList(appealTypeIdList, commonService); |
| | | |
| | | OrderAppealType orderAppeelType; |
| | | for(AppealTypeVo appealTypeVo : appealTypeVoList){ |
| | | orderAppeelType = new OrderAppealType(); |
| | |
| | | return arr; |
| | | } |
| | | |
| | | /** |
| | | * 拼接诉求分类名称 |
| | | * 此方法只支持一二三级都只是一个的 |
| | | * */ |
| | | public static String getStr(List<AppealTypeVo> appealTypeVoList) { |
| | | |
| | | //父级标识 |
| | | String parenId = ""; |
| | | //二级名称拼接 |
| | | StringBuilder towName = new StringBuilder(); |
| | | //三级名称拼接 |
| | | StringBuilder threeName = new StringBuilder(); |
| | | |
| | | //父级标识,当前数据 |
| | | Map<String,AppealTypeVo> parentMap = new HashMap<>(); |
| | | |
| | | //循环 |
| | | for (AppealTypeVo appealTypeVo : appealTypeVoList) { |
| | | if (StringUtils.isEmpty(appealTypeVo.getParentId())){ |
| | | parenId = appealTypeVo.getId(); |
| | | towName.append(appealTypeVo.getName()); |
| | | threeName.append(appealTypeVo.getName()); |
| | | }else { |
| | | parentMap.put(appealTypeVo.getParentId(),appealTypeVo); |
| | | } |
| | | } |
| | | |
| | | //二级 |
| | | AppealTypeVo secondVo = parentMap.get(parenId); |
| | | if (secondVo != null){ |
| | | if (towName.length() > 0){ |
| | | towName.append("/").append(secondVo.getName()); |
| | | } |
| | | if (threeName.length() > 0){ |
| | | threeName.append("/").append(secondVo.getName()); |
| | | } |
| | | //三级 |
| | | AppealTypeVo thirdVo = parentMap.get(secondVo.getId()); |
| | | if (thirdVo != null){ |
| | | if (towName.length() > 0){ |
| | | towName.append("/").append(thirdVo.getName()); |
| | | } |
| | | if (threeName.length() > 0){ |
| | | threeName.append("/").append(thirdVo.getName()); |
| | | } |
| | | } |
| | | |
| | | } |
| | | return towName.append("-").append(threeName).toString(); |
| | | } |
| | | |
| | | |
| | | //////////////////////////////////////////////////////////////////////////////////////////////////// |