Commit 987b299f authored by yaobaizheng's avatar yaobaizheng

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

parent b2c3262d
......@@ -75,8 +75,7 @@ public class DevelopmentInfoController extends BaseController {
@PostMapping("/saveOrUpdateDevelopmentInfo")
@ResponseBody
@ApiOperation(value = "保存或者更新开发区信息", notes = "点击新增时, 保存status=1,isSystem=0;提交status=2,isSystem=0;" +
"点击认证时,保存status=1,isSystem=1;提交status=2,isSystem=1;")
@ApiOperation(value = "保存或者更新开发区信息", notes = "保存时status=1;提交时status=2;认证isSystem=1")
public Boolean saveOrUpdateParkInfo(@Valid @RequestBody DevelopmentInfoAllSaveVO developmentInfoSaveVO) {
return developmentInfoSerivce.saveOrUpdateDevelopmentInfo(developmentInfoSaveVO, getUserInfo().getUserId(), getUserInfo().getUserName());
}
......
......@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.math.BigDecimal;
......@@ -468,6 +469,9 @@ public class DevelopmentInfo implements Serializable {
//系统预录入数据id
private Integer mirrorId;
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date submitTime;
@TableField(exist = false)
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
......@@ -6,6 +6,7 @@ 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.*;
import com.lyy.admin.domain.FileSource;
import com.lyy.admin.enumerate.*;
import com.lyy.admin.common.exception.APIException;
import com.lyy.admin.common.exception.APIExceptionEnum;
......@@ -300,24 +301,24 @@ public class DevelopmentInfoServiceImpl extends ServiceImpl<DevelopmentInfoMappe
DevelopmentInfo developmentInfo = new DevelopmentInfo();
BeanUtils.copyProperties(developmentInfoSaveVO.getDevelopmentInfo(),developmentInfo);
developmentInfo.setUserId(userId);
developmentInfo.setUserName(userName);
developmentInfo.setIsSystem(DevelopmentStatusEnum.IS_SYSTEM_0.getCode());
//系统预录入
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());
}
if(developmentInfoSaveVO.getDevelopmentInfo().getStatus() == DevelopmentStatusEnum.STATUS_RZZ.getCode()){
developmentInfo.setSubmitTime(new Date());
}
//新增
// if(developmentInfoSaveVO.getDevelopmentInfo().getIsSystem() == DevelopmentStatusEnum.IS_SYSTEM_0.getCode()){
// if(ObjectUtils.isNotEmpty(developmentInfoSaveVO.getDevelopmentInfo().getId())){
// DevelopmentInfo developmentInfoSource = developmentInfoMapper.selectById(developmentInfoSaveVO.getDevelopmentInfo().getId());
// developmentInfo.setMirrorId( developmentInfoSource.getMirrorId());
// }
// }
//校验是否已认证
isAlreadyAuthentication(developmentInfo);
......@@ -325,6 +326,39 @@ public class DevelopmentInfoServiceImpl extends ServiceImpl<DevelopmentInfoMappe
Integer id = developmentInfo.getId();
// String name = developmentInfo.getName();
//招商方向
QueryWrapper<DevelopmentInvestmentDirectionInfo> didiQW = new QueryWrapper<>();
didiQW.eq("development_id", id);
developmentInvestmentDirectionInfoService.remove(didiQW);
//重点企业
QueryWrapper<DevelopmentPrimaryEnterpriseInfo> dpeiQW = new QueryWrapper<>();
dpeiQW.eq("development_id", id);
developmentPrimaryEnterpriseInfoService.remove(dpeiQW);
//产业基金
QueryWrapper<DevelopmentIndustryFundInfo> difiQW = new QueryWrapper<>();
difiQW.eq("development_id", id);
developmentIndustryFundInfoService.remove(difiQW);
//产业政策
QueryWrapper<DevelopmentIndustryPolicyInfo> dipiQW = new QueryWrapper<>();
dipiQW.eq("development_id", id);
developmentIndustryPolicyInfoService.remove(dipiQW);
//土地详情
QueryWrapper<DevelopmentIndustrialLandInfo> diliQW = new QueryWrapper<>();
diliQW.eq("development_id", id);
developmentIndustrialLandInfoService.remove(diliQW);
//开发区图片
QueryWrapper<SysCarouselInfo> sciQW = new QueryWrapper<>();
sciQW.eq("association_id", id);
sciQW.eq("type", CarouselTypeEnum.KAIFAQU.getType());
sysCarouselInfoService.remove(sciQW);
//政策文件上传
QueryWrapper<FileSource> fsQW = new QueryWrapper<>();
fsQW.eq("object_id", id);
fsQW.eq("object_type", FileSourceObjectTypeEnum.DEVELOPMENT.getCode());
fileSourceService.remove(fsQW);
//招商方向
developmentInfoSaveVO.getInvestmentDirectionInfos().stream().forEach(e->e.setDevelopmentId(id));
developmentInvestmentDirectionInfoService.saveBatch(developmentInfoSaveVO.getInvestmentDirectionInfos());
......
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