标黄的位置是我觉得垃圾的地方,欢迎补充!!
private String getProcessKey(){ WorkFlowConfigKeyReq workFlowConfigKeyReq = new WorkFlowConfigKeyReq(); workFlowConfigKeyReq.setBizCode(bizCode); workFlowConfigKeyReq.setChannelId(CetusChannelTypeEnum.BRAND_DIS.getValue()); workFlowConfigKeyReq.setIndustryType("3"); workFlowConfigKeyReq.setPlatformSource(1); String workFlowProcessKey = ""; if(org.apache.commons.lang3.StringUtils.isBlank(workFlowProcessKey)){ //查询工作流信息 CetusRemoteResult<WorkFlowConfigKeyRes> workFlowConfigKeyResCetusRemoteResult = workFlowInfoQueryService.getWorkflowBizKey(workFlowConfigKeyReq); if(workFlowConfigKeyResCetusRemoteResult==null||!workFlowConfigKeyResCetusRemoteResult.isSuccess() ||workFlowConfigKeyResCetusRemoteResult.getModel()==null){ logger.error("没有查询到可用的工作流数据"); } workFlowProcessKey = workFlowConfigKeyResCetusRemoteResult.getModel().getWorkFlowProcessKey(); } return workFlowProcessKey; }
。。。
下面这个,Banner 对象里面本来就包含了rank,state等字段。。
@RequestMapping ("dict/banner/save") @ResponseBody public Map<String, Object> bannerSave (Banner banner, Integer rank, Integer state, MultipartFile img, String link, Integer industryType,HttpServletRequest request, ModelMap modelMap) { Map<String, Object> result = new HashMap<String, Object>(); Integer channeltype = banner.getChanneltype(); try { if (permissionWrapService.isOperatorLogin()) {//鉴权,是否是运维 List<CetusChannelTypeEnum> channelTypeEnumList = permissionWrapService.queryChannelByPin(LoginContext.getLoginContext().getPin()); // 增加 if (CollectionUtils.isEmpty(channelTypeEnumList)) { result.put("success", false); result.put("message", "须补填渠道信息"); return result; } if (banner.getId() != null) { banner = bannerService.getById(banner.getId()); if (banner != null && (banner.getIndustryType() == null || permissionWrapService.getLoginIndustryType().getType().equals(banner.getIndustryType()))) { // 更新了图片 if (img.getSize() != 0) { Result uploadResult = uploadImg(img); if (uploadResult.isSuccess()) { banner.setIcon(uploadResult.get()+""); } else { result.put("success", false); result.put("message", "图片上传失败:" + (StringUtil.isNotBlank(uploadResult.getResultCode()) ? uploadResult.getResultCode() : uploadResult.get())); return result; } } banner.setRank(rank); banner.setState(state); banner.setLink(link); banner.setChanneltype(channeltype); banner.setModified(new Date()); ...... }