|
@ -13,6 +13,7 @@ import io.swagger.annotations.ApiParam;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
@ -20,6 +21,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
import java.util.Date;
|
|
import java.util.Date;
|
|
|
|
import java.util.Iterator;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
/***
|
|
/***
|
|
@ -39,6 +41,8 @@ public class ZjxlCompanyCaseController extends BaseController {
|
|
private ZjxlCompanyCaseService companyCaseService;
|
|
private ZjxlCompanyCaseService companyCaseService;
|
|
@Autowired
|
|
@Autowired
|
|
private ZjxlArticleContentService articleContentService;
|
|
private ZjxlArticleContentService articleContentService;
|
|
|
|
@Value("${article.id_url}")
|
|
|
|
private String idUrl;
|
|
|
|
|
|
@RequestMapping(value = "/findCompanyCaseById", method = RequestMethod.GET)
|
|
@RequestMapping(value = "/findCompanyCaseById", method = RequestMethod.GET)
|
|
@ApiOperation(value = "查看CompanyCase")
|
|
@ApiOperation(value = "查看CompanyCase")
|
|
@ -69,11 +73,21 @@ public class ZjxlCompanyCaseController extends BaseController {
|
|
@ApiParam(name = "companyTestBannerId", value = "测试用字段", required = false, defaultValue = "1") @RequestParam(value = "companyTestBannerId", required = false)String companyTestBannerId){
|
|
@ApiParam(name = "companyTestBannerId", value = "测试用字段", required = false, defaultValue = "1") @RequestParam(value = "companyTestBannerId", required = false)String companyTestBannerId){
|
|
try {
|
|
try {
|
|
ZjxlCompanyCase companyCase = new ZjxlCompanyCase();
|
|
ZjxlCompanyCase companyCase = new ZjxlCompanyCase();
|
|
|
|
|
|
|
|
List<ZjxlCompanyCase> companyCases = companyCaseService.findAll();
|
|
|
|
Iterator iterator = companyCases.iterator();
|
|
|
|
while (iterator.hasNext()){
|
|
|
|
if (companyName.equals(iterator.next())){
|
|
|
|
return write(-1,"该案例名称已存在");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
companyCase.setCompanyName(companyName);
|
|
companyCase.setCompanyName(companyName);
|
|
companyCase.setCompanyDescribe(companyDescribe);
|
|
companyCase.setCompanyDescribe(companyDescribe);
|
|
companyCase.setCompanyDefaultImg(companyDefaultImg);
|
|
companyCase.setCompanyDefaultImg(companyDefaultImg);
|
|
companyCase.setCompanyExchangeImg(companyExchangeImg);
|
|
companyCase.setCompanyExchangeImg(companyExchangeImg);
|
|
companyCase.setCompanyJumpUrl(companyJumpUrl);
|
|
|
|
|
|
//http://172.26.0.30:8080/zjxl/zjxlArticleContent/findArticleContentById?articleContentTitle=&id=1&pageNo=1&pageSize=10&systemDictType=
|
|
|
|
companyCase.setCompanyJumpUrl(idUrl+"id="+companyJumpUrl+"");
|
|
companyCase.setCompanySort(companySort);
|
|
companyCase.setCompanySort(companySort);
|
|
companyCase.setCompanyIsLine(companyIsLine);
|
|
companyCase.setCompanyIsLine(companyIsLine);
|
|
companyCase.setCompanyTestBannerId(companyTestBannerId);
|
|
companyCase.setCompanyTestBannerId(companyTestBannerId);
|
|
@ -130,4 +144,59 @@ public class ZjxlCompanyCaseController extends BaseController {
|
|
return write(-1,"修改失败");
|
|
return write(-1,"修改失败");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@RequestMapping(value = "/updateCompanyCase", method = RequestMethod.POST)
|
|
|
|
@ApiOperation(value = "编辑公司案例")
|
|
|
|
public String updateCompanyCase(
|
|
|
|
@ApiParam(name = "companyId", value = "案例id", required = false) @RequestParam(value = "companyId", required = false)String companyId,
|
|
|
|
@ApiParam(name = "companyName", value = "案例名称", required = false) @RequestParam(value = "companyName", required = false)String companyName,
|
|
|
|
@ApiParam(name = "companyDescribe", value = "案例描述", required = false) @RequestParam(value = "companyDescribe", required = false)String companyDescribe,
|
|
|
|
@ApiParam(name = "companyDefaultImg", value = "默认图片", required = false) @RequestParam(value = "companyDefaultImg", required = false)String companyDefaultImg,
|
|
|
|
@ApiParam(name = "companyExchangeImg", value = "交互图片", required = false) @RequestParam(value = "companyExchangeImg", required = false)String companyExchangeImg,
|
|
|
|
@ApiParam(name = "companyAssociatedCase", value = "关联案例(对应的文章id)", required = false) @RequestParam(value = "companyAssociatedCase", required = false)String companyAssociatedCase,
|
|
|
|
@ApiParam(name = "companyJumpUrl", value = "跳转链接", required = false) @RequestParam(value = "companyJumpUrl", required = false)String companyJumpUrl,
|
|
|
|
@ApiParam(name = "companySort", value = "排序", required = false) @RequestParam(value = "companySort", required = false)Integer companySort,
|
|
|
|
@ApiParam(name = "companyIsLine", value = "是否上线", required = false, defaultValue = "0") @RequestParam(value = "companyIsLine", required = false)Integer companyIsLine,
|
|
|
|
@ApiParam(name = "companyTestBannerId", value = "测试用字段", required = false, defaultValue = "1") @RequestParam(value = "companyTestBannerId", required = false)String companyTestBannerId){
|
|
|
|
try {
|
|
|
|
ZjxlCompanyCase companyCase = new ZjxlCompanyCase();
|
|
|
|
companyCase.setCompanyId(companyId);
|
|
|
|
|
|
|
|
List<ZjxlCompanyCase> companyCases = companyCaseService.findAll();
|
|
|
|
Iterator iterator = companyCases.iterator();
|
|
|
|
while (iterator.hasNext()){
|
|
|
|
if (companyName.equals(iterator.next())){
|
|
|
|
return write(-1,"该案例名称已存在");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
companyCase.setCompanyName(companyName);
|
|
|
|
companyCase.setCompanyDescribe(companyDescribe);
|
|
|
|
companyCase.setCompanyDefaultImg(companyDefaultImg);
|
|
|
|
companyCase.setCompanyExchangeImg(companyExchangeImg);
|
|
|
|
//http://172.26.0.30:8080/zjxl/zjxlArticleContent/findArticleContentById?articleContentTitle=&id=1&pageNo=1&pageSize=10&systemDictType=
|
|
|
|
companyCase.setCompanyJumpUrl(idUrl+"id="+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());
|
|
|
|
object.put("articleContentTitle",caseA.get(0).getArticleContentTitle());
|
|
|
|
companyCase.setCompanyAssociatedCase(object.toString());
|
|
|
|
}else {
|
|
|
|
return write(-1,"添加案例不存在");
|
|
|
|
}
|
|
|
|
|
|
|
|
return write(200,"编辑成功","data",companyCaseService.updateCompanyCase(companyCase));
|
|
|
|
}catch (Exception e){
|
|
|
|
e.printStackTrace();
|
|
|
|
return write(-1,"编辑失败");
|
|
|
|
}
|
|
|
|
}
|
|
}
|
|
}
|