Commit b2c3262d authored by yaobaizheng's avatar yaobaizheng

园区字典开发区新增保存、提交

parent f5219337
package com.lyy.admin.VO;
import com.lyy.admin.domain.developmentinfo.*;
import com.lyy.admin.domain.system.SysCarouselInfo;
import com.lyy.admin.domain.system.SysFileInfo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;
@Data
@ApiModel(value = "开发区保存信息", description = "")
public class DevelopmentInfoAllSaveVO {
@ApiModelProperty(value = "开发区基本信息")
private DevelopmentInfoSaveVO developmentInfo = new DevelopmentInfoSaveVO();
@ApiModelProperty(value = "招商方向")
private List<DevelopmentInvestmentDirectionInfo> investmentDirectionInfos = new ArrayList<>();
@ApiModelProperty(value = "重点企业")
private List<DevelopmentPrimaryEnterpriseInfo> primaryEnterpriseInfos = new ArrayList<>();
@ApiModelProperty(value = "产业政策")
private List<DevelopmentIndustryPolicyInfo> industryPolicyInfos = new ArrayList<>();
@ApiModelProperty(value = "产业基金")
private List<DevelopmentIndustryFundInfo> industryFundInfos = new ArrayList<>();
@ApiModelProperty(value = "土地信息")
private List<DevelopmentIndustrialLandInfo> industryLandInfos = new ArrayList<>();
@ApiModelProperty(value = "开发区图片上传")
private List<String> carouselUrls = new ArrayList<>();
@ApiModelProperty(value = "政策文件上传")
private List<String> policyUrls = new ArrayList<>();
}
package com.lyy.admin.VO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
@Data
@ApiModel(value = "都市圈基本信息", description = "都市圈基本信息")
public class DevelopmentInfoSaveVO implements Serializable {
@ApiModelProperty(value = "开发区id")
private Integer id;
@ApiModelProperty(value = "开发区名称")
private String name;
@ApiModelProperty(value = "开发区级别")
private String levelName;
@ApiModelProperty(value = "开发区类型")
private String type;
@ApiModelProperty(value = "开发区简介")
private String description;
@ApiModelProperty(value = "省")
private String provinceName;
@ApiModelProperty(value = "市")
private String cityName;
@ApiModelProperty(value = "区/县")
private String regionName;
@ApiModelProperty(value = "详细地址")
private String address;
@ApiModelProperty(value = "规划面积(平方公里)")
private BigDecimal planArea;
@ApiModelProperty(value = "招商对接人")
private String contactPerson;
@ApiModelProperty(value = "联系方式")
private String contactPhone;
@ApiModelProperty(value = "主导产业")
private String primaryIndustry;
@ApiModelProperty(value = "总投资额(亿元)")
private BigDecimal investmentAmountTotal;
@ApiModelProperty(value = "亩均投资强度(单位:万/亩)")
private String investmentStrength;
@ApiModelProperty(value = "亩均税收(单位:万/亩)")
private String taxationStrength;
@ApiModelProperty(value = "亩均年产值(单位:万/亩)")
private String averageOutputValue;
@ApiModelProperty(value = "投资周期(月)")
private Integer buildingPeriod;
@ApiModelProperty(value = "环评要求")
private String environmentalEquirements;
@ApiModelProperty(value = "能评要求(单位:tce/万元)")
private String valueAddedEnergy;
@ApiModelProperty(value = "禁限目录")
private String prohibitedDirectory;
@ApiModelProperty(value = "禁限目录文件URL")
private String prohibitedUrl;
@ApiModelProperty(value = "是否有其他要求(0-无;1-有)")
private Integer isOtherRequirements;
@ApiModelProperty(value = "其他")
private String accessOther;
@ApiModelProperty(value = "人力成本(元/月)")
private BigDecimal laborCost;
@ApiModelProperty(value = "土地成本(万元/亩)")
private BigDecimal landCost;
@ApiModelProperty(value = "工业用电(元/㎡/天)")
private String industrialElectricity;
@ApiModelProperty(value = "供电类型")
private String powerSupplyType;
@ApiModelProperty(value = "变电站级别")
private String substationLevel;
@ApiModelProperty(value = "工业用水单价(元/吨)")
private String industrialWaterPrice;
@ApiModelProperty(value = "污水处理类别")
private String sewageWaterType;
@ApiModelProperty(value = "污水处理价格(元/吨)")
private String sewageWaterPrice;
@ApiModelProperty(value = "是否有供暖(0-无;1-有)")
private Integer isHeating;
@ApiModelProperty(value = "供暖单价(元/m³)")
private String heatingPrice;
@ApiModelProperty(value = "是否有蒸汽(0-无;1-有)")
private Integer isSteam;
@ApiModelProperty(value = "蒸汽价格(元/m³)")
private String steamPrice;
@ApiModelProperty(value = "是否有天然气(0-无;1-有)")
private Integer isNaturalGas;
@ApiModelProperty(value = "天然气单价(元/m³)")
private String naturalGasPrice;
@ApiModelProperty(value = "是否有产业基金(0-无;1-有)")
private Integer isIndustryFund;
@ApiModelProperty(value = "认证状态(1-未认证;2-认证中;3-已认证;4-已拒绝;9-作废)")
private Integer status;
@ApiModelProperty(value = "是否为系统提前预录入(0-否;1-是)")
private Integer isSystem;
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
package com.lyy.admin.VO;
import com.lyy.admin.domain.parkinfo.*;
import com.lyy.admin.domain.system.SysCarouselInfo;
import lombok.Data;
import java.io.Serializable;
......@@ -13,6 +14,8 @@ public class ParkInfoAllSaveVO implements Serializable {
private List<ParkTrafficInfo> parkTrafficInfos;
private List<SysCarouselInfoVO> sysCarouselInfos;
private List<ParkCarrierInfo> parkCarrierInfos;
private List<ParkResourcesInfo> parkResourcesInfos;
......
......@@ -19,24 +19,6 @@ import java.util.Date;
@Data
@ApiModel(value = "轮播图信息")
public class SysCarouselInfoVO implements Serializable {
/**
* 主键id
*/
@TableId
@ApiModelProperty(value = "填写主键id为更新,不填写为新增")
private Integer id;
/**
*
*/
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
/**
*
*/
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateTime;
/**
* 图片地址链接
......@@ -44,47 +26,6 @@ public class SysCarouselInfoVO implements Serializable {
@ApiModelProperty(value = "图片地址链接")
private String imgUrl;
/**
* 图片描述
*/
@ApiModelProperty(value = "图片描述")
private String description;
/**
* 图片状态(0-禁用;1-可用)
*/
@ApiModelProperty(value = "图片状态(0-禁用;1-可用),不传的话默认为1")
private Integer status;
/**
* 类型(0 -都市圈、1-开发区、2-园区、3-首页)
*/
@ApiModelProperty(value = "类型(0 -都市圈、1-开发区、2-园区、3-首页)")
private Integer type;
/**
* 排序
*/
@ApiModelProperty(value = "排序")
private Integer orderNumber;
/**
* 关联id
*/
@ApiModelProperty(value = "关联id")
private Integer associationId;
/**
* 关联名称
*/
@ApiModelProperty(value = "关联名称")
private String associationName;
/**
* 跳转链接
*/
@ApiModelProperty(value = "跳转链接")
private String linkUrl;
@TableField(exist = false)
private static final long serialVersionUID = 1L;
......
......@@ -55,7 +55,7 @@ public class ResourceConfig implements WebMvcConfigurer {
String[] excludeUrl = new String[]{"/demo/login","/login/login","/weixin/login",
"/parkInfo/list",
"/developmentInfo/list","/megalopolisInfo/list",
"/treeInfo/**","/homePage/**"};
"/treeInfo/**","/homePage/**","/sysFile/**"};
String[] excludePatterns = (String[]) ArrayUtils.addAll(excludeSwagger, excludeUrl);
System.out.println("自定义拦截器#############################################");
......
......@@ -19,7 +19,12 @@ public enum APIExceptionEnum {
NOTEXISTS_EXCEPTION(4500, "数据不存在,请确认!"),
//
WX_GETPHONENUMBER_ERROR(40029, "微信获取手机号code码无效,或着微信异常,请重试!");
WX_GETPHONENUMBER_ERROR(40029, "微信获取手机号code码无效,或着微信异常,请重试!"),
//园区开发区认证
ALREADY_AUTH(4200, "当前数据已经认证成功,请勿重复认证");
private int code;
private String message;
......
package com.lyy.admin.controller.developmentinfo;
import com.github.pagehelper.PageInfo;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.lyy.admin.VO.DevelopmentInfoAllSaveVO;
import com.lyy.admin.VO.ParkInfoAllSaveVO;
import com.lyy.admin.common.anno.Cache;
import com.lyy.admin.common.exception.APIException;
import com.lyy.admin.common.page.TableDataInfo;
......@@ -21,6 +24,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.List;
import java.util.stream.Collectors;
......@@ -67,5 +71,22 @@ public class DevelopmentInfoController extends BaseController {
public DevelopmentInfoAllVO get(@PathVariable Integer id) {
return developmentInfoSerivce.getDevelopmentInfo(id,getUserInfo().getUserId(),getUserInfo().getIsMembership());
}
@PostMapping("/saveOrUpdateDevelopmentInfo")
@ResponseBody
@ApiOperation(value = "保存或者更新开发区信息", notes = "点击新增时, 保存status=1,isSystem=0;提交status=2,isSystem=0;" +
"点击认证时,保存status=1,isSystem=1;提交status=2,isSystem=1;")
public Boolean saveOrUpdateParkInfo(@Valid @RequestBody DevelopmentInfoAllSaveVO developmentInfoSaveVO) {
return developmentInfoSerivce.saveOrUpdateDevelopmentInfo(developmentInfoSaveVO, getUserInfo().getUserId(), getUserInfo().getUserName());
}
@PostMapping("/isAlreadyAuthentication")
@ResponseBody
@ApiOperation(value = "草稿箱点击编辑时判断是否已认证", notes = "true-已认证;false-未认证")
@ApiImplicitParam(name = "id", value = "开发区id", type = "Integer")
public boolean isAlreadyAuthentication(Integer id){
return developmentInfoSerivce.isAlreadyAuthentication(id);
}
}
......@@ -87,7 +87,7 @@ public class ParkInfoController extends BaseController {
@PostMapping("/saveOrUpdateParkInfo")
@ResponseBody
@ApiOperation(value = "保存或者更新信息园区信息", notes = "")
@ApiOperation(value = "保存或者更新园区信息", notes = "")
@ApiOperationSupport(ignoreParameters = {"parkTrafficInfo", "carrierInfoVO", "id"})
public ParkInfoAllSaveVO saveOrUpdateParkInfo(@Valid @RequestBody ParkInfoAllSaveVO parkInfoAllVO) {
return parkInfoService.saveOrUpdateParkInfo(parkInfoAllVO, getUserInfo().getUserId(), getUserInfo().getUserName());
......
......@@ -453,6 +453,21 @@ public class DevelopmentInfo implements Serializable {
//天然气单价(元/m³)
private String naturalGasPrice;
//是否有产业基金(0-无;1-有)
private Integer isIndustryFund;
//用户id
private Integer userId;
//用户名称
private String userName;
//是否为系统提前预录入(0-否;1-是)
private Integer isSystem;
//系统预录入数据id
private Integer mirrorId;
@TableField(exist = false)
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
......@@ -16,7 +16,7 @@ import lombok.Data;
*/
@TableName(value ="development_primary_enterprise_info")
@Data
@ApiModel(value = "开发区片区龙头/链主企业代表信息", description = "片区龙头/链主企业代表")
@ApiModel(value = "企业代表信息", description = "企业代表信息")
public class DevelopmentPrimaryEnterpriseInfo implements Serializable {
/**
* 主键id
......
......@@ -21,58 +21,69 @@ public class SysCarouselInfo implements Serializable {
* 主键id
*/
@TableId
@ApiModelProperty(hidden = true)
private Integer id;
/**
*
*/
@ApiModelProperty(hidden = true)
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
/**
*
*/
@ApiModelProperty(hidden = true)
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateTime;
/**
* 图片地址链接
*/
@ApiModelProperty(value = "图片地址链接")
private String imgUrl;
/**
* 图片描述
*/
@ApiModelProperty(hidden = true)
private String description;
/**
* 图片状态(0-禁用;1-可用)
*/
@ApiModelProperty(hidden = true)
private Integer status;
/**
* 类型(0 -都市圈、1-开发区、2-园区、3-首页)
*/
@ApiModelProperty(hidden = true)
private Integer type;
/**
* 排序
*/
@ApiModelProperty(hidden = true)
private Integer orderNumber;
/**
* 关联id
*/
@ApiModelProperty(hidden = true)
private Integer associationId;
/**
* 关联名称
*/
@ApiModelProperty(hidden = true)
private String associationName;
/**
* 跳转链接
*/
@ApiModelProperty(hidden = true)
private String linkUrl;
@TableField(exist = false)
......
package com.lyy.admin.enumerate;
public enum DevelopmentStatusEnum {
NOAUTHENTICATION(0,"未认知"),
AUTHENTICATION(1,"认证");
STATUS_WRZ(1,"未认证"),
STATUS_RZZ(2,"认证中"),
STATUS_YRZ(3,"已认证"),
STATUS_YJJ(4,"已拒绝"),
STATUS_ZF(9,"作废"),
IS_SYSTEM_0(0,"不是系统提前预录入"),
IS_SYSTEM_1(1,"是系统提前预录入"),
IS_COLLECTION_0(0,"未收藏"),
IS_COLLECTION_1(1,"收藏");
private Integer code;
private String name;
......
package com.lyy.admin.enumerate;
public enum ParkInfoEnum {
STATUS_WRZ(1,"未认证"),
STATUS_RZZ(2,"认证中"),
STATUS_YRZ(3,"已认证"),
STATUS_YJJ(4,"已拒绝"),
STATUS_ZF(9,"作废"),
IS_SYSTEM_0(0,"不是系统提前预录入"),
IS_SYSTEM_1(1,"是系统提前预录入"),
IS_COLLECTION_0(0,"未收藏"),
IS_COLLECTION_1(1,"收藏"),
HOT_PARK(1,"是热点园区")
;
private Integer code;
private String name;
ParkInfoEnum(Integer code,String name){
this.code = code;
this.name = name;
}
public Integer getCode(){
return code;
}
}
package com.lyy.admin.enumerate;
public enum SubmitExamineEnum {
TYPE_MEGALOPOLIS(0,"都市圈"),
TYPE_DEVELOPMENT(1,"开发区"),
TYPE_PARK(2,"园区"),
TYPE_OTHER(3,"其他"),
CHANNELSOURCE_WX(1,"微信小程序"),
CHANNELSOURCE_LYY(2,"立业云"),
INFO_SOURCE_RZ(1,"认证信息"),
INF_SOURCE_LR(2,"新录入信息"),
;
private Integer code;
private String name;
SubmitExamineEnum(Integer code,String name){
this.code = code;
this.name = name;
}
public Integer getCode(){
return code;
}
}
package com.lyy.admin.enumerate;
public enum SysCarouselTypeEnum {
MEGALOPOLIS(0,"都市圈"),
DEVELOPMENT(1,"开发区"),
PARK(2,"园区"),
HOMEPAGE(3,"首页");
SysCarouselTypeEnum(Integer code, String name) {
this.code = code;
this.name = name;
}
private Integer code;
private String name;
public Integer getCode() {
return code;
}
}
package com.lyy.admin.service.developmentinfo;
import com.lyy.admin.VO.DevelopmentInfoAllSaveVO;
import com.lyy.admin.common.page.TableDataInfo;
import com.lyy.admin.domain.developmentinfo.DevelopmentInfo;
import com.baomidou.mybatisplus.extension.service.IService;
......@@ -23,5 +24,9 @@ public interface DevelopmentInfoService extends IService<DevelopmentInfo> {
public List<DevelopmentInfoListVO> selectDevelopmentInfoCollectionList(DevelopmentInfoCollectionParam developmentInfoParam);
public Boolean saveOrUpdateDevelopmentInfo(DevelopmentInfoAllSaveVO developmentInfoSaveVO, Integer userId, String userName);
public boolean isExistInfo(Integer userId, Integer collectionId);
public boolean isAlreadyAuthentication(Integer id);
}
......@@ -5,31 +5,30 @@ import cn.hutool.json.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lyy.admin.VO.DevelopmentInfoAllVO;
import com.lyy.admin.VO.DevelopmentInfoListVO;
import com.lyy.admin.VO.DevelopmentInfoVO;
import com.lyy.admin.enumerate.CarouselTypeEnum;
import com.lyy.admin.enumerate.StatusEnum;
import com.lyy.admin.VO.*;
import com.lyy.admin.enumerate.*;
import com.lyy.admin.common.exception.APIException;
import com.lyy.admin.common.exception.APIExceptionEnum;
import com.lyy.admin.domain.SysCollection;
import com.lyy.admin.domain.developmentinfo.*;
import com.lyy.admin.VO.ParkInfoListVO;
import com.lyy.admin.domain.parkinfo.ParkInfo;
import com.lyy.admin.domain.parkinfo.ParkInfoParam;
import com.lyy.admin.domain.system.SysCarouselInfo;
import com.lyy.admin.mapper.SysCollectionMapper;
import com.lyy.admin.mapper.system.SysCarouselInfoMapper;
import com.lyy.admin.mapper.system.SysMembershipInfoMapper;
import com.lyy.admin.service.FileSourceService;
import com.lyy.admin.service.developmentinfo.*;
import com.lyy.admin.mapper.developmentinfo.DevelopmentInfoMapper;
import com.lyy.admin.service.parkinfo.ParkInfoService;
import com.lyy.admin.service.system.SysCarouselInfoService;
import com.lyy.admin.service.system.SysMembershipInfoService;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
import java.util.stream.Collectors;
......@@ -76,8 +75,13 @@ public class DevelopmentInfoServiceImpl extends ServiceImpl<DevelopmentInfoMappe
@Autowired
SysCollectionMapper sysCollectionMapper;
@Autowired
SysCarouselInfoService sysCarouselInfoService;
@Autowired
SysCarouselInfoMapper sysCarouselInfoMapper;
FileSourceService fileSourceService;
@Override
public List<DevelopmentInfo> selectDevelopmentInfoVOList(DevelopmentInfoParam developmentInfoParam) {
String planArea = developmentInfoParam.getPlanArea();
......@@ -279,7 +283,7 @@ public class DevelopmentInfoServiceImpl extends ServiceImpl<DevelopmentInfoMappe
Integer yuanquId = CarouselTypeEnum.KAIFAQU.getType();
LambdaQueryWrapper<SysCarouselInfo> tWrapper = new LambdaQueryWrapper<>();
tWrapper.eq(SysCarouselInfo::getType, yuanquId).eq(SysCarouselInfo::getAssociationId, id).eq(SysCarouselInfo::getStatus, StatusEnum.ENABLE.getCode());
List<SysCarouselInfo> sysCarouselInfos = sysCarouselInfoMapper.selectList(tWrapper);
List<SysCarouselInfo> sysCarouselInfos = sysCarouselInfoService.list(tWrapper);
developmentInfoAllVO.setSysCarouselInfos(sysCarouselInfos);
return developmentInfoAllVO;
......@@ -290,6 +294,61 @@ public class DevelopmentInfoServiceImpl extends ServiceImpl<DevelopmentInfoMappe
return developmentInfoMapper.selectDevelopmentInfoCollectionList(developmentInfoParam);
}
@Override
@Transactional
public Boolean saveOrUpdateDevelopmentInfo(DevelopmentInfoAllSaveVO developmentInfoSaveVO, Integer userId, String userName) {
DevelopmentInfo developmentInfo = new DevelopmentInfo();
BeanUtils.copyProperties(developmentInfoSaveVO.getDevelopmentInfo(),developmentInfo);
//系统预录入
if(developmentInfoSaveVO.getDevelopmentInfo().getIsSystem() == DevelopmentStatusEnum.IS_SYSTEM_1.getCode()){
developmentInfo.setUserId(userId);
developmentInfo.setUserName(userName);
developmentInfo.setIsSystem(0);
developmentInfo.setId(null);
developmentInfo.setMirrorId(developmentInfoSaveVO.getDevelopmentInfo().getId());
}
//新增
if(developmentInfoSaveVO.getDevelopmentInfo().getIsSystem() == DevelopmentStatusEnum.IS_SYSTEM_0.getCode()){
developmentInfo.setUserId(userId);
developmentInfo.setUserName(userName);
developmentInfo.setIsSystem(0);
if(ObjectUtils.isNotEmpty(developmentInfoSaveVO.getDevelopmentInfo().getId())){
DevelopmentInfo developmentInfoSource = developmentInfoMapper.selectById(developmentInfoSaveVO.getDevelopmentInfo().getId());
developmentInfo.setMirrorId( developmentInfoSource.getMirrorId());
}
}
//校验是否已认证
isAlreadyAuthentication(developmentInfo);
this.saveOrUpdate(developmentInfo);
Integer id = developmentInfo.getId();
// String name = developmentInfo.getName();
//招商方向
developmentInfoSaveVO.getInvestmentDirectionInfos().stream().forEach(e->e.setDevelopmentId(id));
developmentInvestmentDirectionInfoService.saveBatch(developmentInfoSaveVO.getInvestmentDirectionInfos());
//重点企业
developmentInfoSaveVO.getPrimaryEnterpriseInfos().stream().forEach(e->e.setDevelopmentId(id));
developmentPrimaryEnterpriseInfoService.saveBatch(developmentInfoSaveVO.getPrimaryEnterpriseInfos());
//产业基金
developmentInfoSaveVO.getIndustryFundInfos().stream().forEach(e->e.setDevelopmentId(id));
developmentIndustryFundInfoService.saveBatch(developmentInfoSaveVO.getIndustryFundInfos());
//产业政策
developmentInfoSaveVO.getIndustryPolicyInfos().stream().forEach(e->e.setDevelopmentId(id));
developmentIndustryPolicyInfoService.saveBatch(developmentInfoSaveVO.getIndustryPolicyInfos());
//土地详情
developmentInfoSaveVO.getIndustryLandInfos().stream().forEach(e->e.setDevelopmentId(id));
developmentIndustrialLandInfoService.saveBatch(developmentInfoSaveVO.getIndustryLandInfos());
//开发区图片
sysCarouselInfoService.saveCarouselInfo(id,developmentInfoSaveVO.getCarouselUrls(), SysCarouselTypeEnum.DEVELOPMENT);
//政策文件上传
fileSourceService.saveFileSource(id,developmentInfoSaveVO.getPolicyUrls(), FileSourceObjectTypeEnum.DEVELOPMENT);
return true;
}
@Override
public boolean isExistInfo(Integer userId, Integer collectionId) {
//是否收藏
......@@ -299,6 +358,33 @@ public class DevelopmentInfoServiceImpl extends ServiceImpl<DevelopmentInfoMappe
PIQueryWrapper.eq("user_id", userId);
return sysCollectionMapper.exists(PIQueryWrapper);
}
@Override
public boolean isAlreadyAuthentication(Integer id){
DevelopmentInfo developmentInfo = developmentInfoMapper.selectById(id);
return isAlreadyAuthentication(developmentInfo);
}
/**
* 保存提交、编辑之前的校验逻辑
*
* 对于系统提前预录入去认证的数据:
* 若其中某一条数据已经认证(status=3),认证中的数据全部置为作废(status=9);
* 保存草稿未提交的数据进行判断,若原始数据已经作废,则这条数据也不允许再次编辑或者提交。
* @param developmentInfo
*/
public boolean isAlreadyAuthentication(DevelopmentInfo developmentInfo){
boolean flag = false;
if(ObjectUtils.isNotEmpty(developmentInfo.getMirrorId())){
DevelopmentInfo developmentInfoSource = developmentInfoMapper.selectById(developmentInfo.getMirrorId());
if(developmentInfoSource.getStatus() == DevelopmentStatusEnum.STATUS_ZF.getCode()){
// throw new APIException(APIExceptionEnum.ALREADY_AUTH);
flag = true;
}
}
return flag;
}
}
......
......@@ -27,6 +27,9 @@ public class FileSourceServiceImpl extends ServiceImpl<FileSourceMapper, FileSou
@Transactional
@Override
public void saveFileSource(Integer objectId, List<String> urls, FileSourceObjectTypeEnum fileSourceObjectTypeEnum) {
if(urls == null){
return;
}
for (String url : urls) {
FileSource fileSource = new FileSource();
......
......@@ -2,6 +2,9 @@ package com.lyy.admin.service.system;
import com.baomidou.mybatisplus.extension.service.IService;
import com.lyy.admin.domain.system.SysCarouselInfo;
import com.lyy.admin.enumerate.SysCarouselTypeEnum;
import java.util.List;
/**
* @author 26996
......@@ -10,4 +13,6 @@ import com.lyy.admin.domain.system.SysCarouselInfo;
*/
public interface SysCarouselInfoService extends IService<SysCarouselInfo> {
public void saveCarouselInfo(Integer id, List<String> imgUrls, SysCarouselTypeEnum sysCarouselTypeEnum);
}
......@@ -2,9 +2,15 @@ package com.lyy.admin.service.system.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lyy.admin.domain.system.SysCarouselInfo;
import com.lyy.admin.enumerate.StatusEnum;
import com.lyy.admin.enumerate.SysCarouselTypeEnum;
import com.lyy.admin.mapper.system.SysCarouselInfoMapper;
import com.lyy.admin.service.system.SysCarouselInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
......@@ -16,6 +22,24 @@ import org.springframework.stereotype.Service;
public class SysCarouselInfoServiceImpl extends ServiceImpl<SysCarouselInfoMapper, SysCarouselInfo>
implements SysCarouselInfoService {
@Autowired
private SysCarouselInfoMapper sysCarouselInfoMapper;
@Override
@Transactional
public void saveCarouselInfo(Integer id,List<String> imgUrls, SysCarouselTypeEnum sysCarouselTypeEnum) {
if(imgUrls == null){
return;
}
for (String url : imgUrls) {
SysCarouselInfo sysCarouselInfo = new SysCarouselInfo();
sysCarouselInfo.setAssociationId(id);
sysCarouselInfo.setStatus(StatusEnum.ENABLE.getCode());
sysCarouselInfo.setType(sysCarouselTypeEnum.getCode());
sysCarouselInfo.setImgUrl(url);
sysCarouselInfoMapper.insert(sysCarouselInfo);
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment