市场法规库清单添加发布接口
This commit is contained in:
+2
-5
@@ -169,12 +169,9 @@ public class MarketStandardController {
|
|||||||
@PostMapping(value = "/publish")
|
@PostMapping(value = "/publish")
|
||||||
@RequiresPermissions("marketStandard:publish")
|
@RequiresPermissions("marketStandard:publish")
|
||||||
public Result<?> publish(@RequestBody Map<String, String> map) {
|
public Result<?> publish(@RequestBody Map<String, String> map) {
|
||||||
if (!map.containsKey("ids") || StringUtils.isEmpty(map.get("ids"))) {
|
if (!map.containsKey("id") || StringUtils.isEmpty(map.get("id"))) {
|
||||||
return Result.error("请选择数据!");
|
return Result.error("请选择数据!");
|
||||||
}
|
}
|
||||||
return Result.OK(map);
|
return marketStandardService.publish(map.get("id"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+10
@@ -12,6 +12,8 @@ import lombok.Data;
|
|||||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @TableName laws_market_standard_detail
|
* @TableName laws_market_standard_detail
|
||||||
@@ -76,6 +78,7 @@ public class LawsMarketStandardDetail implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 标准编号
|
* 标准编号
|
||||||
*/
|
*/
|
||||||
|
@NotBlank(message = "标准编号不能为空")
|
||||||
@ApiModelProperty(value = "标准编号")
|
@ApiModelProperty(value = "标准编号")
|
||||||
@Excel(name = "标准编号", width = 15)
|
@Excel(name = "标准编号", width = 15)
|
||||||
private String standardNumber;
|
private String standardNumber;
|
||||||
@@ -84,6 +87,7 @@ public class LawsMarketStandardDetail implements Serializable {
|
|||||||
* 标准名称
|
* 标准名称
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "标准名称")
|
@ApiModelProperty(value = "标准名称")
|
||||||
|
@NotBlank(message = "标准名称不能为空")
|
||||||
@Excel(name = "标准名称", width = 15)
|
@Excel(name = "标准名称", width = 15)
|
||||||
private String standardName;
|
private String standardName;
|
||||||
|
|
||||||
@@ -98,6 +102,7 @@ public class LawsMarketStandardDetail implements Serializable {
|
|||||||
* 新生产车实施日期
|
* 新生产车实施日期
|
||||||
*/
|
*/
|
||||||
@Excel(name = "新生产车实施日期", width = 15)
|
@Excel(name = "新生产车实施日期", width = 15)
|
||||||
|
@NotBlank(message = "新生产车实施日期不能为空")
|
||||||
@ApiModelProperty(value = "新生产车实施日期")
|
@ApiModelProperty(value = "新生产车实施日期")
|
||||||
private String newProductImplDate;
|
private String newProductImplDate;
|
||||||
|
|
||||||
@@ -105,6 +110,7 @@ public class LawsMarketStandardDetail implements Serializable {
|
|||||||
* 新认证车实施日期
|
* 新认证车实施日期
|
||||||
*/
|
*/
|
||||||
@Excel(name = "新认证车实施日期", width = 15)
|
@Excel(name = "新认证车实施日期", width = 15)
|
||||||
|
@NotBlank(message = "新认证车实施日期不能为空")
|
||||||
@ApiModelProperty(value = "新认证车实施日期")
|
@ApiModelProperty(value = "新认证车实施日期")
|
||||||
private String newAuthImplDate;
|
private String newAuthImplDate;
|
||||||
|
|
||||||
@@ -112,6 +118,7 @@ public class LawsMarketStandardDetail implements Serializable {
|
|||||||
* 注册日期
|
* 注册日期
|
||||||
*/
|
*/
|
||||||
@Excel(name = "注册日期", width = 15)
|
@Excel(name = "注册日期", width = 15)
|
||||||
|
@NotBlank(message = "注册日期不能为空")
|
||||||
@ApiModelProperty(value = "注册日期")
|
@ApiModelProperty(value = "注册日期")
|
||||||
private String registrationDate;
|
private String registrationDate;
|
||||||
|
|
||||||
@@ -119,6 +126,7 @@ public class LawsMarketStandardDetail implements Serializable {
|
|||||||
* 国家
|
* 国家
|
||||||
*/
|
*/
|
||||||
@Excel(name = "国家/地区", width = 15,dicCode = "market_state")
|
@Excel(name = "国家/地区", width = 15,dicCode = "market_state")
|
||||||
|
@NotBlank(message = "国家/地区不能为空")
|
||||||
@ApiModelProperty(value = "国家")
|
@ApiModelProperty(value = "国家")
|
||||||
@Dict(dicCode = "market_state")
|
@Dict(dicCode = "market_state")
|
||||||
private String country;
|
private String country;
|
||||||
@@ -173,6 +181,7 @@ public class LawsMarketStandardDetail implements Serializable {
|
|||||||
*/
|
*/
|
||||||
@Dict(dictTable = "sys_depart", dicCode = "id", dicText = "depart_name")
|
@Dict(dictTable = "sys_depart", dicCode = "id", dicText = "depart_name")
|
||||||
@ApiModelProperty(value = "主控部门")
|
@ApiModelProperty(value = "主控部门")
|
||||||
|
@NotBlank(message = "主控部门不能为空")
|
||||||
@Excel(name = "主控部门", width = 15,dictTable = "sys_depart", dicCode = "id", dicText = "depart_name")
|
@Excel(name = "主控部门", width = 15,dictTable = "sys_depart", dicCode = "id", dicText = "depart_name")
|
||||||
private String mainDept;
|
private String mainDept;
|
||||||
|
|
||||||
@@ -180,6 +189,7 @@ public class LawsMarketStandardDetail implements Serializable {
|
|||||||
* 主控部门专业模块
|
* 主控部门专业模块
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "主控部门专业模块")
|
@ApiModelProperty(value = "主控部门专业模块")
|
||||||
|
@NotBlank(message = "主控部门专业模块不能为空")
|
||||||
@Dict(dicCode = "professional_module")
|
@Dict(dicCode = "professional_module")
|
||||||
@Excel(name = "主控部门专业模块", width = 15, dicCode = "professional_module")
|
@Excel(name = "主控部门专业模块", width = 15, dicCode = "professional_module")
|
||||||
private String mainDeptProfMode;
|
private String mainDeptProfMode;
|
||||||
|
|||||||
+8
@@ -1,6 +1,7 @@
|
|||||||
package com.jero.modules.laws.marketStandard.service;
|
package com.jero.modules.laws.marketStandard.service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.jero.common.api.vo.Result;
|
||||||
import com.jero.modules.laws.marketStandard.entity.LawsMarketStandard;
|
import com.jero.modules.laws.marketStandard.entity.LawsMarketStandard;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.jero.modules.laws.marketStandard.entity.LawsMarketStandardDetail;
|
import com.jero.modules.laws.marketStandard.entity.LawsMarketStandardDetail;
|
||||||
@@ -68,4 +69,11 @@ public interface ILawsMarketStandardService extends IService<LawsMarketStandard>
|
|||||||
* @param marketStandardDetailVO
|
* @param marketStandardDetailVO
|
||||||
*/
|
*/
|
||||||
void edit(MarketStandardDetailVO marketStandardDetailVO);
|
void edit(MarketStandardDetailVO marketStandardDetailVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发布
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Result<?> publish(String id);
|
||||||
}
|
}
|
||||||
|
|||||||
+26
-8
@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|||||||
import com.jero.common.api.vo.Result;
|
import com.jero.common.api.vo.Result;
|
||||||
import com.jero.common.exception.JeroBootException;
|
import com.jero.common.exception.JeroBootException;
|
||||||
import com.jero.common.system.query.QueryGenerator;
|
import com.jero.common.system.query.QueryGenerator;
|
||||||
|
import com.jero.common.system.vo.LoginUser;
|
||||||
import com.jero.common.util.ImportExcelUtil;
|
import com.jero.common.util.ImportExcelUtil;
|
||||||
import com.jero.modules.laws.marketStandard.entity.LawsMarketStandard;
|
import com.jero.modules.laws.marketStandard.entity.LawsMarketStandard;
|
||||||
import com.jero.modules.laws.marketStandard.entity.LawsMarketStandardDetail;
|
import com.jero.modules.laws.marketStandard.entity.LawsMarketStandardDetail;
|
||||||
@@ -16,6 +17,7 @@ import com.jero.modules.laws.marketStandard.service.ILawsMarketStandardService;
|
|||||||
import com.jero.modules.laws.utils.ValidUtil;
|
import com.jero.modules.laws.utils.ValidUtil;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.apache.shiro.SecurityUtils;
|
||||||
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||||
import org.jeecgframework.poi.excel.entity.ImportParams;
|
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
@@ -115,25 +117,28 @@ public class LawsMarketStandardDetailServiceImpl extends ServiceImpl<LawsMarketS
|
|||||||
ImportParams params = new ImportParams();
|
ImportParams params = new ImportParams();
|
||||||
params.setHeadRows(1);
|
params.setHeadRows(1);
|
||||||
// 校验excel 字段是否正确
|
// 校验excel 字段是否正确
|
||||||
boolean b = ImportExcelUtil.checkTemplateTitle(file, LawsMarketStandardDetail.class, params.getTitleRows(), 0);
|
// boolean b = ImportExcelUtil.checkTemplateTitle(file, LawsMarketStandardDetail.class, params.getTitleRows(), 0);
|
||||||
if (!b) {
|
// if (!b) {
|
||||||
throw new JeroBootException("excel文件表头错误,请重新下载");
|
// throw new JeroBootException("excel文件表头错误,请重新下载");
|
||||||
}
|
// }
|
||||||
try {
|
try {
|
||||||
List<LawsMarketStandardDetail> listLawsMarketStandardDetail = ExcelImportUtil.importExcel(file.getInputStream(), LawsMarketStandardDetail.class, params);
|
List<LawsMarketStandardDetail> listLawsMarketStandardDetail = ExcelImportUtil.importExcel(file.getInputStream(), LawsMarketStandardDetail.class, params);
|
||||||
if(!CollectionUtils.isEmpty(listLawsMarketStandardDetail) && listLawsMarketStandardDetail.size() >= 2){
|
if(!CollectionUtils.isEmpty(listLawsMarketStandardDetail) && listLawsMarketStandardDetail.size() >= 2){
|
||||||
listLawsMarketStandardDetail = listLawsMarketStandardDetail.subList(2,listLawsMarketStandardDetail.size());
|
listLawsMarketStandardDetail = listLawsMarketStandardDetail.subList(2,listLawsMarketStandardDetail.size());
|
||||||
}
|
}
|
||||||
for (LawsMarketStandardDetail lawsMarketStandardDetail : listLawsMarketStandardDetail) {
|
StringBuilder m = new StringBuilder();
|
||||||
|
for (int i = 0; i < listLawsMarketStandardDetail.size(); i++) {
|
||||||
|
LawsMarketStandardDetail lawsMarketStandardDetail = listLawsMarketStandardDetail.get(i);
|
||||||
lawsMarketStandardDetail.setManifestId(manifestId);
|
lawsMarketStandardDetail.setManifestId(manifestId);
|
||||||
// 校验数据
|
// 校验数据
|
||||||
StringBuilder m = new StringBuilder();
|
|
||||||
StringBuilder g = ValidUtil.validateReturnBuilder(lawsMarketStandardDetail);
|
StringBuilder g = ValidUtil.validateReturnBuilder(lawsMarketStandardDetail);
|
||||||
if(!StringUtils.isEmpty(g.toString())){
|
if(!StringUtils.isEmpty(g.toString())){
|
||||||
m.append(g.toString());
|
m.append(i + 4).append("行,").append(g.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(!StringUtils.isBlank(m.toString())){
|
||||||
|
return Result.error(m.toString());
|
||||||
|
}
|
||||||
saveBatch(listLawsMarketStandardDetail);
|
saveBatch(listLawsMarketStandardDetail);
|
||||||
return Result.OK("导入成功");
|
return Result.OK("导入成功");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@@ -198,15 +203,28 @@ public class LawsMarketStandardDetailServiceImpl extends ServiceImpl<LawsMarketS
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result<?> deleteById(String id) {
|
public Result<?> deleteById(String id) {
|
||||||
|
checkData(id);
|
||||||
removeById(id);
|
removeById(id);
|
||||||
return Result.OK("删除成功");
|
return Result.OK("删除成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result<?> deleteBatchById(String ids) {
|
public Result<?> deleteBatchById(String ids) {
|
||||||
|
checkData(ids);
|
||||||
removeByIds(Arrays.asList(ids.split(",")));
|
removeByIds(Arrays.asList(ids.split(",")));
|
||||||
return Result.OK("批量删除成功");
|
return Result.OK("批量删除成功");
|
||||||
}
|
}
|
||||||
|
// 验证数据权限
|
||||||
|
private void checkData(String id) {
|
||||||
|
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||||
|
LambdaQueryWrapper<LawsMarketStandardDetail> queryLawsMarketStandardDetail = new LambdaQueryWrapper<>();
|
||||||
|
queryLawsMarketStandardDetail.eq(LawsMarketStandardDetail::getCreateBy, sysUser.getUsername());
|
||||||
|
queryLawsMarketStandardDetail.in(LawsMarketStandardDetail::getId, Arrays.asList(id.split(",")));
|
||||||
|
long l = count(queryLawsMarketStandardDetail);
|
||||||
|
if (l == 0) {
|
||||||
|
throw new JeroBootException("没有权限");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+49
-16
@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.jero.common.api.vo.Result;
|
||||||
import com.jero.common.exception.JeroBootException;
|
import com.jero.common.exception.JeroBootException;
|
||||||
import com.jero.common.system.api.ISysBaseAPI;
|
import com.jero.common.system.api.ISysBaseAPI;
|
||||||
import com.jero.common.system.vo.DictModel;
|
import com.jero.common.system.vo.DictModel;
|
||||||
@@ -22,22 +23,18 @@ import com.jero.modules.system.service.ISysDictService;
|
|||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.apache.shiro.SecurityUtils;
|
import org.apache.shiro.SecurityUtils;
|
||||||
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
|
||||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||||
import org.jeecgframework.poi.excel.entity.ImportParams;
|
|
||||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
|
||||||
import org.springframework.web.servlet.ModelAndView;
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@@ -133,7 +130,6 @@ public class LawsMarketStandardServiceImpl extends ServiceImpl<LawsMarketStandar
|
|||||||
List<String> country = listDict.stream().map(DictModel::getText).collect(Collectors.toList());
|
List<String> country = listDict.stream().map(DictModel::getText).collect(Collectors.toList());
|
||||||
// 国家/地区+自定义+固定字段,自定义字段:预留手填,当前默认不填;固定字段:车型需满足标准法规清单
|
// 国家/地区+自定义+固定字段,自定义字段:预留手填,当前默认不填;固定字段:车型需满足标准法规清单
|
||||||
manifest.setManifestName(String.join("",country) + manifest.getCustomColumnName() + "车型需满足标准法规清单");
|
manifest.setManifestName(String.join("",country) + manifest.getCustomColumnName() + "车型需满足标准法规清单");
|
||||||
manifest.setManifestVersion("V1.0");
|
|
||||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||||
manifest.setAuthor(sysUser.getId());
|
manifest.setAuthor(sysUser.getId());
|
||||||
save(manifest);
|
save(manifest);
|
||||||
@@ -167,26 +163,43 @@ public class LawsMarketStandardServiceImpl extends ServiceImpl<LawsMarketStandar
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = JeroBootException.class)
|
@Transactional(rollbackFor = JeroBootException.class)
|
||||||
public synchronized void edit(MarketStandardDetailVO marketStandardDetailVO) {
|
public synchronized void edit(MarketStandardDetailVO marketStandardDetailVO) {
|
||||||
// todo 状态为已发布需要生成新数据,版本号等
|
|
||||||
// 修改清单信息
|
// 修改清单信息
|
||||||
LawsMarketStandard manifest = marketStandardDetailVO.getManifest();
|
LawsMarketStandard manifest = marketStandardDetailVO.getManifest();
|
||||||
LawsMarketStandard lawsMarketStandardOld = getById(manifest.getId());
|
LawsMarketStandard lawsMarketStandardOld = getById(manifest.getId());
|
||||||
if(Objects.isNull(lawsMarketStandardOld)){
|
if(Objects.isNull(lawsMarketStandardOld)){
|
||||||
throw new JeroBootException("数据不存在");
|
throw new JeroBootException("数据不存在");
|
||||||
}
|
}
|
||||||
List<String> listCountry = Arrays.stream(manifest.getCountry().split(",")).sorted().collect(Collectors.toList());
|
// 状态为已发布需要生成新数据
|
||||||
List<String> listOldCountry = Arrays.stream(lawsMarketStandardOld.getCountry().split(",")).sorted().collect(Collectors.toList());;
|
if(Objects.equals(lawsMarketStandardOld.getManifestStatus(),MarketStandardConstants.MANIFEST_STATUS_PUBLISH)){
|
||||||
if(!Objects.equals(listCountry,listOldCountry)){
|
manifest.setManifestStatus(MarketStandardConstants.MANIFEST_STATUS_EDIT);
|
||||||
manifest.setManifestNo(generateManifestNo(manifest.getCountry()));
|
manifest.setManifestVersion("");
|
||||||
|
// 设置清单编号
|
||||||
|
manifest.setManifestNo(this.generateManifestNo(manifest.getCountry()));
|
||||||
|
Map<String, List<DictModel>> map = sysBaseAPI.translateManyDict("market_state",manifest.getCountry());
|
||||||
|
List<DictModel> listDict = map.get("market_state");
|
||||||
|
List<String> country = listDict.stream().map(DictModel::getText).collect(Collectors.toList());
|
||||||
|
// 国家/地区+自定义+固定字段,自定义字段:预留手填,当前默认不填;固定字段:车型需满足标准法规清单
|
||||||
|
manifest.setManifestName(String.join("",country) + manifest.getCustomColumnName() + "车型需满足标准法规清单");
|
||||||
|
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||||
|
manifest.setAuthor(sysUser.getId());
|
||||||
|
manifest.setVersionFlag(lawsMarketStandardOld.getVersionFlag());
|
||||||
|
save(manifest);
|
||||||
|
}else{
|
||||||
|
List<String> listCountry = Arrays.stream(manifest.getCountry().split(",")).sorted().collect(Collectors.toList());
|
||||||
|
List<String> listOldCountry = Arrays.stream(lawsMarketStandardOld.getCountry().split(",")).sorted().collect(Collectors.toList());;
|
||||||
|
if(!Objects.equals(listCountry,listOldCountry)){
|
||||||
|
manifest.setManifestNo(generateManifestNo(manifest.getCountry()));
|
||||||
|
}
|
||||||
|
Map<String, List<DictModel>> map = sysBaseAPI.translateManyDict("market_state",manifest.getCountry());
|
||||||
|
List<DictModel> listDict = map.get("market_state");
|
||||||
|
List<String> country = listDict.stream().map(DictModel::getText).collect(Collectors.toList());
|
||||||
|
// 国家/地区+自定义+固定字段,自定义字段:预留手填,当前默认不填;固定字段:车型需满足标准法规清单
|
||||||
|
manifest.setManifestName(String.join("",country) + manifest.getCustomColumnName() + "车型需满足标准法规清单");
|
||||||
|
updateById(manifest);
|
||||||
}
|
}
|
||||||
Map<String, List<DictModel>> map = sysBaseAPI.translateManyDict("market_state",manifest.getCountry());
|
|
||||||
List<DictModel> listDict = map.get("market_state");
|
|
||||||
List<String> country = listDict.stream().map(DictModel::getText).collect(Collectors.toList());
|
|
||||||
// 国家/地区+自定义+固定字段,自定义字段:预留手填,当前默认不填;固定字段:车型需满足标准法规清单
|
|
||||||
manifest.setManifestName(String.join("",country) + manifest.getCustomColumnName() + "车型需满足标准法规清单");
|
|
||||||
updateById(manifest);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ModelAndView export(HttpServletRequest request, HttpServletResponse response, LawsMarketStandard marketStandard, String fileName, String sheetName, HttpServletRequest req) {
|
public ModelAndView export(HttpServletRequest request, HttpServletResponse response, LawsMarketStandard marketStandard, String fileName, String sheetName, HttpServletRequest req) {
|
||||||
// 过滤选中数据
|
// 过滤选中数据
|
||||||
@@ -319,6 +332,26 @@ public class LawsMarketStandardServiceImpl extends ServiceImpl<LawsMarketStandar
|
|||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = JeroBootException.class)
|
||||||
|
public Result<?> publish(String id) {
|
||||||
|
LawsMarketStandard lawsMarketStandardOld = getById(id);
|
||||||
|
if(Objects.isNull(lawsMarketStandardOld)){
|
||||||
|
Result.error("数据不存在");
|
||||||
|
}
|
||||||
|
LambdaQueryWrapper<LawsMarketStandard> queryLawsMarketStandard = new LambdaQueryWrapper<>();
|
||||||
|
queryLawsMarketStandard.eq(LawsMarketStandard::getVersionFlag,lawsMarketStandardOld.getVersionFlag());
|
||||||
|
long l = count(queryLawsMarketStandard);
|
||||||
|
// 更新状态
|
||||||
|
LambdaUpdateWrapper<LawsMarketStandard> updateLawsMarketStandard = new LambdaUpdateWrapper<>();
|
||||||
|
updateLawsMarketStandard.eq(LawsMarketStandard::getId,id);
|
||||||
|
updateLawsMarketStandard.eq(LawsMarketStandard::getManifestVersion, "V1." + l);
|
||||||
|
updateLawsMarketStandard.set(LawsMarketStandard::getManifestStatus,MarketStandardConstants.MANIFEST_STATUS_PUBLISH);
|
||||||
|
update(updateLawsMarketStandard);
|
||||||
|
// todo 发起流程
|
||||||
|
return Result.OK("发布成功");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user