那些年我看到过的京东垃圾代码

的位置是我觉得垃圾的地方,欢迎补充!!

    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());
                    
                    ......

}

 

转载于:https://my.oschina.net/u/3047936/blog/2877201

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值