Shi Kejing 4 éve
szülő
commit
e74c9c45f6

+ 17 - 1
guns-main/src/main/java/cn/stylefeng/guns/zjxl/cnotroller/ZjxlCompanyCaseController.java

@ -1,9 +1,12 @@
package cn.stylefeng.guns.zjxl.cnotroller;
import cn.stylefeng.guns.zjxl.model.ZjxlArticleContent;
import cn.stylefeng.guns.zjxl.model.ZjxlCompanyCase;
import cn.stylefeng.guns.zjxl.service.ZjxlArticleContentService;
import cn.stylefeng.guns.zjxl.service.ZjxlCompanyCaseService;
import cn.stylefeng.guns.zjxlUtil.BaseController;
import cn.stylefeng.guns.zjxlUtil.PageUtil;
import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
@ -34,6 +37,8 @@ public class ZjxlCompanyCaseController extends BaseController {
    @Autowired
    private ZjxlCompanyCaseService companyCaseService;
    @Autowired
    private ZjxlArticleContentService articleContentService;
    @RequestMapping(value = "/findCompanyCaseById", method = RequestMethod.GET)
    @ApiOperation(value = "查看CompanyCase")
@ -68,12 +73,23 @@ public class ZjxlCompanyCaseController extends BaseController {
            companyCase.setCompanyDescribe(companyDescribe);
            companyCase.setCompanyDefaultImg(companyDefaultImg);
            companyCase.setCompanyExchangeImg(companyExchangeImg);
            companyCase.setCompanyAssociatedCase(companyAssociatedCase);
            companyCase.setCompanyJumpUrl(companyJumpUrl);
            companyCase.setCompanySort(companySort);
            companyCase.setCompanyIsLine(companyIsLine);
            companyCase.setCompanyTestBannerId(companyTestBannerId);
            List<ZjxlArticleContent> caseA = articleContentService.findArticleContentById(companyAssociatedCase);
            if (caseA.size()>0){
                JSONObject object = new JSONObject();
                object.put("articleContentId",caseA.get(0).getArticleContentId());
                object.put("articleContentType",caseA.get(0).getArticleContentType());
                object.put("articleContentClassify",caseA.get(0).getArticleContentClassify());
                object.put("articleContentSubclassify",caseA.get(0).getArticleContentSubclassify());
                companyCase.setCompanyAssociatedCase(object.toString());
            }else {
                return write(-1,"添加案例不存在");
            }
            SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//设置日期格式
            companyCase.setCompanyCreateTime(df.format(new Date()));// new Date()为获取当前系统时间