Merge remote-tracking branch 'origin/dev_third_stage' into dev_third_stage

This commit is contained in:
zyx.net
2022-08-08 14:41:44 +08:00
26 changed files with 397 additions and 132 deletions
@@ -54,12 +54,16 @@ public class SarFileCompareInfoController extends JeroController<SarFileCompareI
@AutoLog(value = "文档对比信息表-分页列表查询") @AutoLog(value = "文档对比信息表-分页列表查询")
@ApiOperation(value = "文档对比信息表-分页列表查询", notes = "文档对比信息表-分页列表查询") @ApiOperation(value = "文档对比信息表-分页列表查询", notes = "文档对比信息表-分页列表查询")
@GetMapping(value = "/page") @GetMapping(value = "/page")
public Result<?> queryPageList(SarFileCompareInfo sarFileCompareInfo, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { public Result<?> queryPageList(SarFileCompareInfo sarFileCompareInfo, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
@RequestParam(name = "cut", defaultValue = "cn") String cut, HttpServletRequest req) {
QueryWrapper<SarFileCompareInfo> queryWrapper = QueryGenerator.initQueryWrapper(sarFileCompareInfo, req.getParameterMap()); QueryWrapper<SarFileCompareInfo> queryWrapper = QueryGenerator.initQueryWrapper(sarFileCompareInfo, req.getParameterMap());
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
queryWrapper.eq("create_by", sysUser.getUsername()).or().eq("release_state", ReleaseConditionEnum.DRAFT.getValue()); queryWrapper.eq("create_by", sysUser.getUsername()).or().eq("release_state", ReleaseConditionEnum.DRAFT.getValue());
Page<SarFileCompareInfo> page = new Page<SarFileCompareInfo>(pageNo, pageSize); Page<SarFileCompareInfo> page = new Page<SarFileCompareInfo>(pageNo, pageSize);
IPage<SarFileCompareInfo> pageList = sarFileCompareInfoService.page(page, queryWrapper); IPage<SarFileCompareInfo> pageList = sarFileCompareInfoService.page(page, queryWrapper);
for (SarFileCompareInfo info : pageList.getRecords()) {
info.setReleaseStateTitle(ReleaseConditionEnum.getTextByValue(info.getReleaseState(), cut));
}
return Result.OK(pageList); return Result.OK(pageList);
} }
@@ -208,12 +212,13 @@ public class SarFileCompareInfoController extends JeroController<SarFileCompareI
@ApiOperation(value = "文档对比信息表-更改发布状态", notes = "文档对比信息表-更改发布状态") @ApiOperation(value = "文档对比信息表-更改发布状态", notes = "文档对比信息表-更改发布状态")
@RequestMapping(value = "/changeState", method = RequestMethod.POST) @RequestMapping(value = "/changeState", method = RequestMethod.POST)
public Result<?> changeState(@Validated @RequestBody SarFileCompareInfo sarFileCompareInfo) { public Result<?> changeState(@Validated @RequestBody SarFileCompareInfo sarFileCompareInfo) {
if (sarFileCompareInfo.getReleaseState().equals(ReleaseConditionEnum.DRAFT.getValue())) { SarFileCompareInfo info = sarFileCompareInfoService.queryById(sarFileCompareInfo.getId());
sarFileCompareInfo.setReleaseState(ReleaseConditionEnum.PUBLISHED.getValue()); if (ReleaseConditionEnum.DRAFT.getValue().equals(sarFileCompareInfo.getReleaseState())) {
info.setReleaseState(ReleaseConditionEnum.PUBLISHED.getValue());
} else { } else {
sarFileCompareInfo.setReleaseState(ReleaseConditionEnum.DRAFT.getValue()); info.setReleaseState(ReleaseConditionEnum.DRAFT.getValue());
} }
sarFileCompareInfoService.editById(sarFileCompareInfo); sarFileCompareInfoService.editById(info);
return Result.OK("更改成功!"); return Result.OK("更改成功!");
} }
@@ -4,6 +4,7 @@ import java.io.Serializable;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import java.math.BigDecimal; import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data; import lombok.Data;
@@ -126,6 +127,10 @@ public class SarFileCompareInfo implements Serializable {
@ApiModelProperty(value = "发布状态") @ApiModelProperty(value = "发布状态")
private String releaseState; private String releaseState;
/**发布状态-翻译后*/
@TableField(exist = false)
private String releaseStateTitle;
/**备注*/ /**备注*/
@Excel(name = "备注", width = 15) @Excel(name = "备注", width = 15)
@ApiModelProperty(value = "备注") @ApiModelProperty(value = "备注")
@@ -1,24 +0,0 @@
package com.jero.modules.compare.enums;
/**
* 对比信息发布状态
*/
public enum ComparesInfoStateEnum {
DRAFT(0, "草稿"), RELEASE(1, "发布");
private int value;
private String lable;
private ComparesInfoStateEnum(int value, String lable) {
this.value = value;
this.lable = lable;
}
public int getValue() {
return value;
}
public String getLable() {
return lable;
}
}
@@ -160,7 +160,7 @@ public class SarFileCompareInfoServiceImpl extends ServiceImpl<SarFileCompareInf
} }
if (j >= rightItemList.size() - 1) { if (j >= rightItemList.size() - 1) {
int ts = leftItemList.get(i).getTargetStand(); int ts = leftItemList.get(i).getTargetStand();
if(ts > -1){ if (ts > -1) {
rightItemList.get(ts).setTargetStand(i); rightItemList.get(ts).setTargetStand(i);
} }
} }
@@ -106,7 +106,7 @@ public class SarFileCompareResCommentServiceImpl extends ServiceImpl<SarFileComp
if (StringUtils.isEmpty(rc.getParentId())) { if (StringUtils.isEmpty(rc.getParentId())) {
SarFileCompareResComVO resComVO = wrapperSarFileCompareResComVO(rc); SarFileCompareResComVO resComVO = wrapperSarFileCompareResComVO(rc);
for (SarFileCompareResComment rc1 : list) { for (SarFileCompareResComment rc1 : list) {
if (!StringUtils.isEmpty(rc.getParentId()) && rc.getParentId().equals(resComVO.getId())) { if (!StringUtils.isEmpty(rc1.getParentId()) && rc1.getParentId().equals(resComVO.getId())) {
resComVO.addResComVo(wrapperSarFileCompareResComVO(rc1)); resComVO.addResComVo(wrapperSarFileCompareResComVO(rc1));
} }
} }
@@ -4,6 +4,8 @@ import java.util.Arrays;
import java.util.List; import java.util.List;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.alibaba.fastjson.JSONObject;
import com.jero.common.api.vo.Result; import com.jero.common.api.vo.Result;
import com.jero.common.system.query.QueryGenerator; import com.jero.common.system.query.QueryGenerator;
import com.jero.modules.problemKnowledgeBase.entity.CountryCardManageReleaseEO; import com.jero.modules.problemKnowledgeBase.entity.CountryCardManageReleaseEO;
@@ -170,4 +172,17 @@ public class CountryCardManageReleaseEOController extends JeroController<Country
return super.importExcel(request, response, CountryCardManageReleaseEO.class); return super.importExcel(request, response, CountryCardManageReleaseEO.class);
} }
/**
* 更新状态 发布或撤回
* @param json
* @return
*/
@AutoLog(value = "问题知识库-country_card-管理发布表-发布或撤回")
@ApiOperation(value="问题知识库-country_card-管理发布表-发布或撤回", notes="问题知识库-country_card-管理发布表-发布或撤回")
@PostMapping(value = "/batchUpdateReleaseStatus")
public Result<?> batchUpdateReleaseStatus(@RequestBody JSONObject json) {
this.countryCardManageReleaseEOService.batchUpdateReleaseStatus(json);
return Result.OK("批量更新发布状态成功!");
}
} }
@@ -54,6 +54,7 @@ public class CountryCardTempEOController extends JeroController<CountryCardTempE
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize, @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) { HttpServletRequest req) {
QueryWrapper<CountryCardTempEO> queryWrapper = QueryGenerator.initQueryWrapper(countryCardTempEO, req.getParameterMap()); QueryWrapper<CountryCardTempEO> queryWrapper = QueryGenerator.initQueryWrapper(countryCardTempEO, req.getParameterMap());
queryWrapper.orderByAsc("order_num");
Page<CountryCardTempEO> page = new Page<CountryCardTempEO>(pageNo, pageSize); Page<CountryCardTempEO> page = new Page<CountryCardTempEO>(pageNo, pageSize);
IPage<CountryCardTempEO> pageList = countryCardTempEOService.page(page, queryWrapper); IPage<CountryCardTempEO> pageList = countryCardTempEOService.page(page, queryWrapper);
this.countryCardTempEOService.disposeData(pageList.getRecords(),countryCardTempEO.getCut()); this.countryCardTempEOService.disposeData(pageList.getRecords(),countryCardTempEO.getCut());
@@ -53,6 +53,7 @@ public class ProblemKnowledgeBaseClassifyEOController extends JeroController<Pro
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize, @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) { HttpServletRequest req) {
QueryWrapper<ProblemKnowledgeBaseClassifyEO> queryWrapper = QueryGenerator.initQueryWrapper(problemKnowledgeBaseClassifyEO, req.getParameterMap()); QueryWrapper<ProblemKnowledgeBaseClassifyEO> queryWrapper = QueryGenerator.initQueryWrapper(problemKnowledgeBaseClassifyEO, req.getParameterMap());
queryWrapper.orderByDesc("create_time");
Page<ProblemKnowledgeBaseClassifyEO> page = new Page<ProblemKnowledgeBaseClassifyEO>(pageNo, pageSize); Page<ProblemKnowledgeBaseClassifyEO> page = new Page<ProblemKnowledgeBaseClassifyEO>(pageNo, pageSize);
IPage<ProblemKnowledgeBaseClassifyEO> pageList = problemKnowledgeBaseClassifyEOService.page(page, queryWrapper); IPage<ProblemKnowledgeBaseClassifyEO> pageList = problemKnowledgeBaseClassifyEOService.page(page, queryWrapper);
return Result.OK(pageList); return Result.OK(pageList);
@@ -53,6 +53,7 @@ public class ProblemKnowledgeBaseCommentEOController extends JeroController<Prob
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize, @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) { HttpServletRequest req) {
QueryWrapper<ProblemKnowledgeBaseCommentEO> queryWrapper = QueryGenerator.initQueryWrapper(problemKnowledgeBaseCommentEO, req.getParameterMap()); QueryWrapper<ProblemKnowledgeBaseCommentEO> queryWrapper = QueryGenerator.initQueryWrapper(problemKnowledgeBaseCommentEO, req.getParameterMap());
queryWrapper.orderByDesc("create_time");
Page<ProblemKnowledgeBaseCommentEO> page = new Page<ProblemKnowledgeBaseCommentEO>(pageNo, pageSize); Page<ProblemKnowledgeBaseCommentEO> page = new Page<ProblemKnowledgeBaseCommentEO>(pageNo, pageSize);
IPage<ProblemKnowledgeBaseCommentEO> pageList = problemKnowledgeBaseCommentEOService.page(page, queryWrapper); IPage<ProblemKnowledgeBaseCommentEO> pageList = problemKnowledgeBaseCommentEOService.page(page, queryWrapper);
return Result.OK(pageList); return Result.OK(pageList);
@@ -53,6 +53,8 @@ public class ProblemKnowledgeBaseEOController extends JeroController<ProblemKnow
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize, @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) { HttpServletRequest req) {
QueryWrapper<ProblemKnowledgeBaseEO> queryWrapper = QueryGenerator.initQueryWrapper(problemKnowledgeBaseEO, req.getParameterMap()); QueryWrapper<ProblemKnowledgeBaseEO> queryWrapper = QueryGenerator.initQueryWrapper(problemKnowledgeBaseEO, req.getParameterMap());
this.problemKnowledgeBaseEOService.createQueryPermission(queryWrapper);
queryWrapper.orderByDesc("create_time");
Page<ProblemKnowledgeBaseEO> page = new Page<ProblemKnowledgeBaseEO>(pageNo, pageSize); Page<ProblemKnowledgeBaseEO> page = new Page<ProblemKnowledgeBaseEO>(pageNo, pageSize);
IPage<ProblemKnowledgeBaseEO> pageList = problemKnowledgeBaseEOService.page(page, queryWrapper); IPage<ProblemKnowledgeBaseEO> pageList = problemKnowledgeBaseEOService.page(page, queryWrapper);
this.problemKnowledgeBaseEOService.disposeData(pageList.getRecords(),problemKnowledgeBaseEO.getCut()); this.problemKnowledgeBaseEOService.disposeData(pageList.getRecords(),problemKnowledgeBaseEO.getCut());
@@ -73,6 +73,8 @@ public class CountryCardTempEO implements Serializable {
@Excel(name = "标签类型", width = 15) @Excel(name = "标签类型", width = 15)
@ApiModelProperty(value = "标签类型") @ApiModelProperty(value = "标签类型")
private java.lang.String lableType; private java.lang.String lableType;
@TableField(exist = false)
private java.lang.String lableType_dicText;
/**展示顺序*/ /**展示顺序*/
@Excel(name = "展示顺序", width = 15) @Excel(name = "展示顺序", width = 15)
@@ -4,6 +4,7 @@ import java.io.Serializable;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import java.math.BigDecimal; import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data; import lombok.Data;
@@ -70,5 +71,8 @@ public class ProblemKnowledgeBaseUserEO implements Serializable {
@Excel(name = "用户id", width = 15) @Excel(name = "用户id", width = 15)
@ApiModelProperty(value = "用户id") @ApiModelProperty(value = "用户id")
private java.lang.String userId; private java.lang.String userId;
/**用户姓名*/
@TableField(exist = false)
private String userName;
} }
@@ -8,8 +8,8 @@ import org.apache.commons.lang3.StringUtils;
*/ */
public enum ReleaseStatusEnum { public enum ReleaseStatusEnum {
HAVE_RELEASED("已发布","Have released","have released"), HAVE_RELEASED("已发布","Have released","Have released"),
DRAFT("草稿","Draft","draft"), DRAFT("草稿","Draft","Draft"),
; ;
@@ -1,5 +1,6 @@
package com.jero.modules.problemKnowledgeBase.service; package com.jero.modules.problemKnowledgeBase.service;
import com.alibaba.fastjson.JSONObject;
import com.jero.modules.problemKnowledgeBase.entity.CountryCardManageReleaseEO; import com.jero.modules.problemKnowledgeBase.entity.CountryCardManageReleaseEO;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List; import java.util.List;
@@ -65,4 +66,10 @@ public interface ICountryCardManageReleaseEOService extends IService<CountryCard
* @param cut * @param cut
*/ */
void disposeData(List<CountryCardManageReleaseEO> datas, String cut); void disposeData(List<CountryCardManageReleaseEO> datas, String cut);
/**
* 批量更新发布状态
* @param json
*/
void batchUpdateReleaseStatus(JSONObject json);
} }
@@ -1,5 +1,6 @@
package com.jero.modules.problemKnowledgeBase.service; package com.jero.modules.problemKnowledgeBase.service;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.jero.modules.problemKnowledgeBase.entity.ProblemKnowledgeBaseEO; import com.jero.modules.problemKnowledgeBase.entity.ProblemKnowledgeBaseEO;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
@@ -68,4 +69,10 @@ public interface IProblemKnowledgeBaseEOService extends IService<ProblemKnowledg
* @param cut * @param cut
*/ */
void disposeData(List<ProblemKnowledgeBaseEO> datas,String cut); void disposeData(List<ProblemKnowledgeBaseEO> datas,String cut);
/**
* 创建查询权限
* @param queryWrapper
*/
void createQueryPermission(QueryWrapper<ProblemKnowledgeBaseEO> queryWrapper);
} }
@@ -58,4 +58,11 @@ public interface IProblemKnowledgeBaseUserEOService extends IService<ProblemKnow
* @return * @return
*/ */
List<ProblemKnowledgeBaseUserEO> queryList(); List<ProblemKnowledgeBaseUserEO> queryList();
/**
* 处理数据
* @param datas
* @param cut
*/
void disposeData(List<ProblemKnowledgeBaseUserEO> datas,String cut);
} }
@@ -1,5 +1,6 @@
package com.jero.modules.problemKnowledgeBase.service.impl; package com.jero.modules.problemKnowledgeBase.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.jero.modules.problemKnowledgeBase.entity.CountryCardManageReleaseDetailEO; import com.jero.modules.problemKnowledgeBase.entity.CountryCardManageReleaseDetailEO;
import com.jero.modules.problemKnowledgeBase.entity.CountryCardManageReleaseEO; import com.jero.modules.problemKnowledgeBase.entity.CountryCardManageReleaseEO;
@@ -12,6 +13,7 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Date; import java.util.Date;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@@ -142,4 +144,19 @@ public class CountryCardManageReleaseEOServiceImpl extends ServiceImpl<CountryCa
}); });
} }
} }
@Override
public void batchUpdateReleaseStatus(JSONObject json) {
String ids = json.getString("ids");
String releaseStatus = json.getString("releaseStatus");
QueryWrapper<CountryCardManageReleaseEO> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().in(CountryCardManageReleaseEO::getId,Arrays.asList(ids.split(",")));
List<CountryCardManageReleaseEO> countryCardManageReleaseEOList = this.list(queryWrapper);
countryCardManageReleaseEOList.forEach(countryCardManageReleaseEO -> {
countryCardManageReleaseEO.setReleaseStatus(releaseStatus);
});
this.updateBatchById(countryCardManageReleaseEOList);
}
} }
@@ -118,6 +118,7 @@ public class CountryCardTempEOServiceImpl extends ServiceImpl<CountryCardTempEOM
@Override @Override
public List<CountryCardTempEO> queryList(CountryCardTempEO countryCardTempEO, HttpServletRequest req) { public List<CountryCardTempEO> queryList(CountryCardTempEO countryCardTempEO, HttpServletRequest req) {
QueryWrapper<CountryCardTempEO> queryWrapper = QueryGenerator.initQueryWrapper(countryCardTempEO, req.getParameterMap()); QueryWrapper<CountryCardTempEO> queryWrapper = QueryGenerator.initQueryWrapper(countryCardTempEO, req.getParameterMap());
queryWrapper.orderByAsc("order_num");
List<CountryCardTempEO> result = this.list(queryWrapper); List<CountryCardTempEO> result = this.list(queryWrapper);
return result; return result;
} }
@@ -144,6 +145,10 @@ public class CountryCardTempEOServiceImpl extends ServiceImpl<CountryCardTempEOM
countryCardTemp.setCountryCardTempItemEOList(collect); countryCardTemp.setCountryCardTempItemEOList(collect);
} }
if(StringUtils.isNotEmpty(countryCardTemp.getLableType())){
countryCardTemp.setLableType_dicText(LableTypeEnum.getTextByValue(countryCardTemp.getLableType(),cut));
}
}); });
} }
} }
@@ -92,6 +92,7 @@ public class ProblemKnowledgeBaseCommentEOServiceImpl extends ServiceImpl<Proble
@Override @Override
public List<ProblemKnowledgeBaseCommentEO> queryList(ProblemKnowledgeBaseCommentEO problemKnowledgeBaseCommentEO, HttpServletRequest req) { public List<ProblemKnowledgeBaseCommentEO> queryList(ProblemKnowledgeBaseCommentEO problemKnowledgeBaseCommentEO, HttpServletRequest req) {
QueryWrapper<ProblemKnowledgeBaseCommentEO> queryWrapper = QueryGenerator.initQueryWrapper(problemKnowledgeBaseCommentEO, req.getParameterMap()); QueryWrapper<ProblemKnowledgeBaseCommentEO> queryWrapper = QueryGenerator.initQueryWrapper(problemKnowledgeBaseCommentEO, req.getParameterMap());
queryWrapper.orderByDesc("create_time");
List<ProblemKnowledgeBaseCommentEO> result = this.list(queryWrapper); List<ProblemKnowledgeBaseCommentEO> result = this.list(queryWrapper);
return result; return result;
} }
@@ -129,6 +129,8 @@ public class ProblemKnowledgeBaseEOServiceImpl extends ServiceImpl<ProblemKnowle
public List<ProblemKnowledgeBaseEO> queryList(ProblemKnowledgeBaseEO problemKnowledgeBaseEO, public List<ProblemKnowledgeBaseEO> queryList(ProblemKnowledgeBaseEO problemKnowledgeBaseEO,
HttpServletRequest req) { HttpServletRequest req) {
QueryWrapper<ProblemKnowledgeBaseEO> queryWrapper = QueryGenerator.initQueryWrapper(problemKnowledgeBaseEO, req.getParameterMap()); QueryWrapper<ProblemKnowledgeBaseEO> queryWrapper = QueryGenerator.initQueryWrapper(problemKnowledgeBaseEO, req.getParameterMap());
this.createQueryPermission(queryWrapper);
queryWrapper.orderByDesc("create_time");
List<ProblemKnowledgeBaseEO> result = this.list(queryWrapper); List<ProblemKnowledgeBaseEO> result = this.list(queryWrapper);
this.disposeData(result,problemKnowledgeBaseEO.getCut()); this.disposeData(result,problemKnowledgeBaseEO.getCut());
return result; return result;
@@ -181,6 +183,12 @@ public class ProblemKnowledgeBaseEOServiceImpl extends ServiceImpl<ProblemKnowle
collectQueryWrapper.lambda().in(ProblemKnowledgeBaseCollectEO::getProblemKnowledgeBaseId,probleKnowledgeBaseIdList); collectQueryWrapper.lambda().in(ProblemKnowledgeBaseCollectEO::getProblemKnowledgeBaseId,probleKnowledgeBaseIdList);
List<ProblemKnowledgeBaseCollectEO> collectEOList = this.problemKnowledgeBaseCollectEOService.list(collectQueryWrapper); List<ProblemKnowledgeBaseCollectEO> collectEOList = this.problemKnowledgeBaseCollectEOService.list(collectQueryWrapper);
//查询出数据的所有的权限用户
QueryWrapper<ProblemKnowledgeBaseUserEO> permissionUserQueryWrapper = new QueryWrapper<>();
permissionUserQueryWrapper.lambda().in(ProblemKnowledgeBaseUserEO::getProblemKnowledgeBaseId,probleKnowledgeBaseIdList);
List<ProblemKnowledgeBaseUserEO> permissionUserEOList = this.problemKnowledgeBaseUserEOService.list(permissionUserQueryWrapper);
this.problemKnowledgeBaseUserEOService.disposeData(permissionUserEOList,cut);
datas.forEach(data -> { datas.forEach(data -> {
if(StringUtils.isNotEmpty(data.getShowPermissions())){ if(StringUtils.isNotEmpty(data.getShowPermissions())){
data.setShowPermissions_dicText(ShowPermissionsEnum.getTextByValue(data.getShowPermissions(),cut)); data.setShowPermissions_dicText(ShowPermissionsEnum.getTextByValue(data.getShowPermissions(),cut));
@@ -238,7 +246,42 @@ public class ProblemKnowledgeBaseEOServiceImpl extends ServiceImpl<ProblemKnowle
if(CollectionUtils.isNotEmpty(problemKnowledgeBaseCollectEOS)){ if(CollectionUtils.isNotEmpty(problemKnowledgeBaseCollectEOS)){
data.setCollectEO(problemKnowledgeBaseCollectEOS.get(0)); data.setCollectEO(problemKnowledgeBaseCollectEOS.get(0));
} }
List<ProblemKnowledgeBaseUserEO> permissionUserEOS = permissionUserEOList.stream().filter(permissionUserEO -> {
boolean flag = false;
if (StringUtils.equals(data.getId(), permissionUserEO.getProblemKnowledgeBaseId())) {
flag = true;
}
return flag;
}).collect(Collectors.toList());
if(CollectionUtils.isNotEmpty(permissionUserEOS)){
data.setPermissionUserList(permissionUserEOS);
}
}); });
} }
} }
@Override
public void createQueryPermission(QueryWrapper<ProblemKnowledgeBaseEO> queryWrapper) {
/**
* 查询权限
* 公开:所有人都可以看到。
* 私密:只有配置了的权限用户可以看到。
*/
LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
QueryWrapper<ProblemKnowledgeBaseUserEO> userPermissionQueryWrapper = new QueryWrapper<>();
userPermissionQueryWrapper.lambda().eq(ProblemKnowledgeBaseUserEO::getUserId,currentUser.getId());
List<ProblemKnowledgeBaseUserEO> problemKnowledgeBaseUserEOList = problemKnowledgeBaseUserEOService.list(userPermissionQueryWrapper);
List<String> problemKnowledgeBaseIdList = problemKnowledgeBaseUserEOList.stream().map(ProblemKnowledgeBaseUserEO::getProblemKnowledgeBaseId).distinct().collect(Collectors.toList());
queryWrapper.lambda().and(query -> {
query.eq(ProblemKnowledgeBaseEO::getShowPermissions,ShowPermissionsEnum.OPEN.getValue()).
or(o -> {
o.eq(ProblemKnowledgeBaseEO::getShowPermissions,ShowPermissionsEnum.PRIVACY.getValue());
o.in(ProblemKnowledgeBaseEO::getId,problemKnowledgeBaseIdList);
});
});
}
} }
@@ -3,9 +3,16 @@ package com.jero.modules.problemKnowledgeBase.service.impl;
import com.jero.modules.problemKnowledgeBase.entity.ProblemKnowledgeBaseUserEO; import com.jero.modules.problemKnowledgeBase.entity.ProblemKnowledgeBaseUserEO;
import com.jero.modules.problemKnowledgeBase.mapper.ProblemKnowledgeBaseUserEOMapper; import com.jero.modules.problemKnowledgeBase.mapper.ProblemKnowledgeBaseUserEOMapper;
import com.jero.modules.problemKnowledgeBase.service.IProblemKnowledgeBaseUserEOService; import com.jero.modules.problemKnowledgeBase.service.IProblemKnowledgeBaseUserEOService;
import com.jero.modules.system.entity.SysUser;
import com.jero.modules.system.service.ISysUserService;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List; import java.util.List;
import java.util.Date; import java.util.Date;
import java.util.stream.Collectors;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@@ -20,6 +27,9 @@ import org.springframework.transaction.annotation.Transactional;
@Transactional(value = "transactionManager", readOnly = false, propagation = Propagation.REQUIRED, rollbackFor = Throwable.class) @Transactional(value = "transactionManager", readOnly = false, propagation = Propagation.REQUIRED, rollbackFor = Throwable.class)
public class ProblemKnowledgeBaseUserEOServiceImpl extends ServiceImpl<ProblemKnowledgeBaseUserEOMapper, ProblemKnowledgeBaseUserEO> implements IProblemKnowledgeBaseUserEOService { public class ProblemKnowledgeBaseUserEOServiceImpl extends ServiceImpl<ProblemKnowledgeBaseUserEOMapper, ProblemKnowledgeBaseUserEO> implements IProblemKnowledgeBaseUserEOService {
@Autowired
private ISysUserService sysUserService;
/** /**
* 保存 * 保存
* *
@@ -89,4 +99,30 @@ public class ProblemKnowledgeBaseUserEOServiceImpl extends ServiceImpl<ProblemKn
public List<ProblemKnowledgeBaseUserEO> queryList() { public List<ProblemKnowledgeBaseUserEO> queryList() {
return list(); return list();
} }
@Override
public void disposeData(List<ProblemKnowledgeBaseUserEO> datas, String cut) {
if(CollectionUtils.isNotEmpty(datas)){
List<String> userIdList = datas.stream().map(ProblemKnowledgeBaseUserEO::getUserId).distinct().collect(Collectors.toList());
List<SysUser> userList = sysUserService.querySysUserListByIdList(userIdList);
datas.forEach(data -> {
if(CollectionUtils.isNotEmpty(userList)){
String userName = "";
for (SysUser user : userList) {
if (StringUtils.equals(data.getUserId(), user.getId())) {
userName = user.getUsername();
break;
}
}
if(StringUtils.isNotEmpty(userName)){
data.setUserName(userName);
}
}
});
}
}
} }
@@ -132,14 +132,24 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl<LawsMonthly
saveOrUpdate(lawsMonthlyReportWriteEO); saveOrUpdate(lawsMonthlyReportWriteEO);
if(ContentTemplateEnum.NEW_REQUEST_LIST_TEMPLATE.getValue().equals(lawsMonthlyReportWriteEO.getContentTemplate())){ if(ContentTemplateEnum.NEW_REQUEST_LIST_TEMPLATE.getValue().equals(lawsMonthlyReportWriteEO.getContentTemplate())){
//新征求意见清单模板 //新征求意见清单模板(先删除在新增)
//删除
LambdaQueryWrapper<NewOpinionTemplateEO> wrapper = new LambdaQueryWrapper<>();
wrapper.in(NewOpinionTemplateEO::getLawsMonthlyReportWriteId,lawsMonthlyReportWriteEO.getId());
iNewOpinionTemplateEOService.remove(wrapper);
//新增
List<NewOpinionTemplateEO> newOpinionTemplateEOList = lawsMonthlyReportWriteEO.getNewOpinionTemplateEOList(); List<NewOpinionTemplateEO> newOpinionTemplateEOList = lawsMonthlyReportWriteEO.getNewOpinionTemplateEOList();
iNewOpinionTemplateEOService.updateBatchById(newOpinionTemplateEOList); iNewOpinionTemplateEOService.saveBatch(newOpinionTemplateEOList);
}else if (ContentTemplateEnum.NEW_RELEASE_STANDARD_MANIFEST_TEMPLATE.getValue().equals(lawsMonthlyReportWriteEO.getContentTemplate())){ }else if (ContentTemplateEnum.NEW_RELEASE_STANDARD_MANIFEST_TEMPLATE.getValue().equals(lawsMonthlyReportWriteEO.getContentTemplate())){
//新发布标准清单模板 //新发布标准清单模板(先删除在新增)
//删除
LambdaQueryWrapper<NewStandardTemplateEO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.in(NewStandardTemplateEO::getLawsMonthlyReportWriteId,lawsMonthlyReportWriteEO.getId());
iNewStandardTemplateEOService.remove(lambdaQueryWrapper);
//新增
List<NewStandardTemplateEO> newStandardTemplateEOList = lawsMonthlyReportWriteEO.getNewStandardTemplateEOList(); List<NewStandardTemplateEO> newStandardTemplateEOList = lawsMonthlyReportWriteEO.getNewStandardTemplateEOList();
iNewStandardTemplateEOService.updateBatchById(newStandardTemplateEOList); iNewStandardTemplateEOService.saveBatch(newStandardTemplateEOList);
} }
} }
@@ -36,8 +36,8 @@
<a-icon type="message"/> <a-icon type="message"/>
</div> </div>
</div> </div>
<div class="inside-box" v-if="item.projectCommentVOList && item.projectCommentVOList.length > 0"> <div class="inside-box" v-if="item.resComVoList && item.resComVoList.length > 0">
<div class="box-content-inside" v-for="(val,indexOne) in item.projectCommentVOList" :key="indexOne"> <div class="box-content-inside" v-for="(val,indexOne) in item.resComVoList" :key="indexOne">
<div class="img-box"> <div class="img-box">
<img src="../../../../assets/daiban.png" class="img" alt=""> <img src="../../../../assets/daiban.png" class="img" alt="">
</div> </div>
@@ -97,7 +97,7 @@
</template> </template>
<script> <script>
import { getAction, postAction } from '@/api/manage' import { getAction, postAction, putAction } from '@/api/manage'
export default { export default {
name: 'commentList', name: 'commentList',
@@ -112,9 +112,9 @@
confirmLoading: false, confirmLoading: false,
visibleComment: false, visibleComment: false,
url: { url: {
list: '/compare/sarFileCompareResComment/list', list: '/compare/sarFileCompareResComment/queryListByInfoId',
add: '/sarFileCompareResComment/add', add: '/compare/sarFileCompareResComment/add',
edit: '/project/projectReplyEO/add' edit: '/compare/sarFileCompareResComment/edit'
}, },
rules: { rules: {
commentContent: [ commentContent: [
@@ -161,7 +161,7 @@
getList() { getList() {
this.loading = true this.loading = true
getAction(this.url.list, { getAction(this.url.list, {
projectLibraryId: this.$route.query.id, id: this.$route.query.id,
commentContent: this.commentContent commentContent: this.commentContent
}).then((res) => { }).then((res) => {
if (res.success) { if (res.success) {
@@ -178,21 +178,25 @@
if (valid) { if (valid) {
let url = '' let url = ''
let query = {} let query = {}
let Action
if (this.title == this.$t('publishComment')) { if (this.title == this.$t('publishComment')) {
url = this.url.add url = this.url.add
Action = postAction
query = { query = {
commentContent: this.formInline.commentContent, comment: this.formInline.commentContent,
projectLibraryId: this.$route.query.id infoId: this.$route.query.id
} }
} else if (this.title == this.$t('replyToComments')) { } else if (this.title == this.$t('replyToComments')) {
url = this.url.edit Action = postAction
url = this.url.add
query = { query = {
replyContent: this.formInline.replyContent, comment: this.formInline.replyContent,
projectCommentId: this.formInline.projectCommentId parentId: this.formInline.projectCommentId,
infoId: this.$route.query.id
} }
} }
this.confirmLoading = true this.confirmLoading = true
postAction(url, query).then((res) => { Action(url, query).then((res) => {
if (res.success) { if (res.success) {
this.$message.success(this.$t('OperationSuccessful')) this.$message.success(this.$t('OperationSuccessful'))
this.visibleComment = false this.visibleComment = false
@@ -200,7 +204,7 @@
this.getList() this.getList()
} else { } else {
this.confirmLoading = false this.confirmLoading = false
this.$message.success(this.$t('operationFailed')) this.$message.warning(this.$t('operationFailed'))
} }
}) })
} }
@@ -29,43 +29,38 @@
<div class="detail-content-header-content"> <div class="detail-content-header-content">
<div class="detail-content-header-content-left" <div class="detail-content-header-content-left"
:class="{'detail-content-header-content-left-active':isDisplay}"> :class="{'detail-content-header-content-left-active':isDisplay}">
所选标准:GB 23456-2020 机动车标准 FMVSS 114 中文.word {{$t('selectedStandard')}}{{resultData.serialNumberLeft}} {{resultData.fileNameLeft}}
</div> </div>
<div class="detail-content-header-content-content" <div class="detail-content-header-content-content"
:class="{'detail-content-header-content-left-active':isDisplay}"> :class="{'detail-content-header-content-left-active':isDisplay}">
所选标准:GB 23456-2020 机动车标准 FMVSS 114 中文.word {{$t('selectedStandard')}}{{resultData.serialNumberRight}} {{resultData.fileNameRight}}
</div> </div>
<div class="detail-content-header-content-right" v-if="!isDisplay"> <div class="detail-content-header-content-right" v-if="!isDisplay">
操作 {{$t('operation')}}
</div> </div>
</div> </div>
</div> </div>
<a-checkbox-group @change="checkboxChange" v-model="checkboxList" <a-checkbox-group @change="checkboxChange" v-model="checkboxList"
style="width: 100%;overflow: overlay;height: calc(100vh - 300px)"> style="width: 100%;overflow: overlay;height: calc(100vh - 300px)">
<div class="detail-content-content" v-for="item in 4"> <div class="detail-content-content" v-for="(item,index) in resultData.resList">
<a-checkbox value="A" class="detail-checkbox"> <a-checkbox :value="item.id" class="detail-checkbox">
</a-checkbox> </a-checkbox>
<div class="detail-content-content-text"> <div class="detail-content-content-text">
<div class="detail-content-content-text-left" <div class="detail-content-content-text-left"
:class="{'detail-content-content-text-dis':isDisplay}"> :class="{'detail-content-content-text-dis':isDisplay}">
<div class="detail-content-left"> <div class="detail-content-left">
<div class="detail-content-left-top"> <div class="detail-content-left-top">
<span>第10条</span> <span>{{item.itemsNumLeft}}</span>
<span style="margin-left: 10px">光反射器</span> <span style="margin-left: 10px">{{item.itemsNameLeft}}</span>
</div>
<div class="detail-content-left-button">
12. 附加光反射器,可以是贴纸,具有以下规格: a) 正面左右两侧呈白色或淡黄色; b) 背面左右两侧呈红色; c) 防护板
sdf kdsf kljsfkldsfdsfdsf
</div> </div>
<div class="detail-content-left-button" v-html="item.itemsTextLeft"></div>
</div> </div>
<div class="detail-content-right"> <div class="detail-content-right">
<div class="detail-content-left-top"> <div class="detail-content-left-top">
<span>第10条</span> <span>{{item.itemsNumRight}}</span>
<span style="margin-left: 10px">光反射器</span> <span style="margin-left: 10px">{{item.itemsNameRight}}</span>
</div>
<div class="detail-content-left-button">
12. 附加光反射器,可以是贴纸,具有以下规格: a) 正面左右两侧呈白色或淡黄色; b) 背面左右两侧呈红色; c) 防护板收到反是馈就但是罚款决定书发的科技示范
</div> </div>
<div class="detail-content-left-button" v-html="item.itemsTextRight"></div>
</div> </div>
<div class="detail-content-bottom"> <div class="detail-content-bottom">
<div class="detail-content-bottom-left" :title="$t('comparisonDifferenceComment')"> <div class="detail-content-bottom-left" :title="$t('comparisonDifferenceComment')">
@@ -73,41 +68,27 @@
{{$t('comparisonDifferenceComment')}}: {{$t('comparisonDifferenceComment')}}:
</div> </div>
<div class="detail-content-bottom-right"> <div class="detail-content-bottom-right">
差异是各单位在结构上的差别程度成员在时间横轴上的位置的差别程经理与其他的差别程度 横轴上的位置的差别程经理与其他的差别程度差异 {{item.comment}}
</div> </div>
</div> </div>
</div> </div>
<div class="detail-content-content-text-right" v-if="!isDisplay"> <div class="detail-content-content-text-right" v-if="!isDisplay">
<span class="text-button-one"> <span class="text-button-one">
<a class="text-button" @click="comparaEdit">{{$t('edit')}}</a> <a class="text-button" @click="comparaEdit(item)">{{$t('edit')}}</a>
<a class="text-button" @click="comparaDelete">{{$t('delete')}}</a> <a class="text-button" @click="comparaDelete(item)">{{$t('delete')}}</a>
</span> </span>
</div> </div>
</div> </div>
</div> </div>
</a-checkbox-group> </a-checkbox-group>
<div class="detail-content-content"> <div class="detail-content-content">
<a-checkbox value="D" class="detail-checkbox"> <a-checkbox @change="fullCheckboxChange" v-model="fullCheckbox" class="detail-checkbox">
</a-checkbox> </a-checkbox>
<div class="detail-content-content-text"> <div class="detail-content-content-text">
<div class="detail-content-content-text-left" <div class="detail-content-content-text-left"
:class="{'detail-content-content-text-dis':isDisplay}"> :class="{'detail-content-content-text-dis':isDisplay}">
<div class="detail-content-content-text-left-text"> <div class="detail-content-content-text-left-text">
{{$t('fullTextComments')}}: 文字占位符评论文字内容文字占位符评论文 {{$t('fullTextComments')}}: {{resultData.comments}}
字内容文字占位符评论文字内容文字
占位符评论文字内容文字占位符评论文字内容文字占
文字占位符评论文字内容文字占位符评论文
字内容文字占位符评论文字内容文字
占位符评论文字内容文字占位符评论文字内容文字占
文字占位符评论文字内容文字占位符评论文
字内容文字占位符评论文字内容文字
占位符评论文字内容文字占位符评论文字内容文字占
文字占位符评论文字内容文字占位符评论文
字内容文字占位符评论文字内容文字
占位符评论文字内容文字占位符评论文字内容文字占
文字占位符评论文字内容文字占位符评论文
字内容文字占位符评论文字内容文字
占位符评论文字内容文字占位符评论文字内容文字占
</div> </div>
</div> </div>
<div class="detail-content-content-text-right" v-if="!isDisplay"> <div class="detail-content-content-text-right" v-if="!isDisplay">
@@ -133,7 +114,7 @@
<a-button key="back" @click="visible = false"> <a-button key="back" @click="visible = false">
{{$t('cancel')}} {{$t('cancel')}}
</a-button> </a-button>
<a-button type="primary" @click="fullTextCommentsSubmit"> <a-button type="primary" :loading="confirmLoading" @click="fullTextCommentsSubmit">
{{$t('submit')}} {{$t('submit')}}
</a-button> </a-button>
</template> </template>
@@ -142,9 +123,9 @@
<div class="title-text-Remarks" :title="$t('fullTextComments')"> <div class="title-text-Remarks" :title="$t('fullTextComments')">
<span>{{$t('fullTextComments')}}</span> <span>{{$t('fullTextComments')}}</span>
</div> </div>
<a-form-model-item class="itemModel" style="width: calc(100% - 113px)" prop="dreUserIdName"> <a-form-model-item class="itemModel" style="width: calc(100% - 113px)" prop="comment">
<a-textarea :placeholder="$t('pleaseEnter')+$t('fullTextComments')" <a-textarea :placeholder="$t('pleaseEnter')+$t('fullTextComments')"
v-model="formInlineText.fullTextComments" v-model="formInlineText.comment"
:rows="4"/> :rows="4"/>
</a-form-model-item> </a-form-model-item>
</div> </div>
@@ -152,9 +133,9 @@
<div class="title-text-Remarks" :title="$t('comparativeComments')"> <div class="title-text-Remarks" :title="$t('comparativeComments')">
<span>{{$t('comparativeComments')}}</span> <span>{{$t('comparativeComments')}}</span>
</div> </div>
<a-form-model-item class="itemModel" style="width: calc(100% - 113px)" prop="dreUserIdName"> <a-form-model-item class="itemModel" style="width: calc(100% - 113px)" prop="comment">
<a-textarea :placeholder="$t('pleaseEnter')+$t('comparativeComments')" <a-textarea :placeholder="$t('pleaseEnter')+$t('comparativeComments')"
v-model="formInlineText.comparativeComments" v-model="formInlineText.comment"
:rows="4"/> :rows="4"/>
</a-form-model-item> </a-form-model-item>
</div> </div>
@@ -168,6 +149,7 @@
<script> <script>
import { getAction, postAction, downloadFile, deleteAction } from '@/api/manage' import { getAction, postAction, downloadFile, deleteAction } from '@/api/manage'
import commentList from './commentList' import commentList from './commentList'
import { putAction } from '../../../../api/manage'
export default { export default {
name: 'comparisonResults', name: 'comparisonResults',
@@ -185,7 +167,9 @@
title: '', title: '',
indeterminate: false, indeterminate: false,
checkAll: false, checkAll: false,
isDisplay: false isDisplay: false,
fullCheckbox: false,
resultData: {}
} }
}, },
mounted() { mounted() {
@@ -210,51 +194,129 @@
}, },
getData() { getData() {
let query = { let query = {
id: this.$route.query.id id: this.$route.query.id,
infoId: this.$route.query.id
} }
getAction('/compare/sarFileCompareItemComment/list', query).then((res) => { this.loading = true
getAction('/compare/sarFileCompareItemComment/queryCompareResult', query).then((res) => {
if (res.success) { if (res.success) {
this.resultData = res.result || {}
this.loading = false
} else {
this.resultData = {}
this.loading = false
} }
}) })
}, },
checkboxChange(checkedList) { checkboxChange(checkedList) {
this.indeterminate = !!checkedList.length && checkedList.length < this.checkboxList.length this.indeterminate = !!checkedList.length && checkedList.length < this.resultData.resList.length || (this.fullCheckbox && this.checkboxList.length < this.resultData.resList.length) || (!this.fullCheckbox && !!checkedList.length)
this.checkAll = checkedList.length === this.checkboxList.length this.checkAll = checkedList.length === this.resultData.resList.length && this.fullCheckbox
},
fullCheckboxChange(event) {
this.indeterminate = !!this.checkboxList.length && this.checkboxList.length < this.resultData.resList.length || (event.target.checked && this.checkboxList.length < this.resultData.resList.length) || (!this.fullCheckbox && !!this.checkboxList.length)
this.checkAll = this.checkboxList.length === this.resultData.resList.length && event.target.checked
}, },
onChange(event) { onChange(event) {
this.checkAll = event.target.checked this.checkAll = event.target.checked
if (event.target.checked) { if (event.target.checked) {
this.checkboxList = ['A', 'B', 'C', 'D'] this.resultData.resList.forEach(res => {
this.checkboxList.push(res.id)
})
this.fullCheckbox = true
this.indeterminate = false
} else { } else {
this.checkboxList = [] this.checkboxList = []
this.fullCheckbox = false
} }
if (this.checkboxList.length == 0) { if (this.checkboxList.length == 0 && !this.fullCheckbox) {
this.checkAll = false this.checkAll = false
this.indeterminate = false this.indeterminate = false
} }
}, },
fullTextCommentsSubmit() { fullTextCommentsSubmit() {
this.$refs.ruleForm.validate(valid => { this.$refs.ruleFormText.validate(valid => {
if (valid) { if (valid) {
if (this.title == this.$t('fullTextComments')) {
this.fullTextComments()
} else {
this.comparaComments()
}
} }
}) })
}, },
fullTextEdit() { fullTextComments() {
this.visible = true this.confirmLoading = true
this.title = this.$t('fullTextComments') let query = {
this.formInlineText = {} id: this.$route.query.id,
this.$nextTick(() => { comments: this.formInlineText.comment
this.$refs.ruleFormText.clearValidate() }
putAction('/compare/sarFileCompareInfo/editComments', query).then((res) => {
if (res.success) {
this.$message.success(this.$t('OperationSuccessful'))
this.confirmLoading = false
this.visible = false
this.getData()
} else {
this.$message.warning(this.$t('operationFailed'))
this.confirmLoading = false
}
}) })
}, },
comparaEdit() { comparaComments() {
this.confirmLoading = true
let query = {
infoId: this.$route.query.id,
id: this.formInlineText.id,
comment: this.formInlineText.comment
}
putAction('/compare/sarFileCompareItemComment/edit', query).then((res) => {
if (res.success) {
this.$message.success(this.$t('OperationSuccessful'))
this.confirmLoading = false
this.visible = false
this.getData()
} else {
this.$message.warning(this.$t('operationFailed'))
this.confirmLoading = false
}
})
},
fullTextEdit(item) {
this.visible = true this.visible = true
this.title = this.$t('comparativeComments') this.title = this.$t('fullTextComments')
this.formInlineText = {} this.formInlineText.comment = this.resultData.comments || ''
this.formInlineText = { ...this.formInlineText }
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.ruleFormText.clearValidate() this.$refs.ruleFormText.clearValidate()
this.rulesText = {
comment: [
{
max: 300,
message: this.$t('fullTextComments') + this.$t('cannotExceed') + 300 + this.$t('Characters'),
trigger: 'blur'
}
]
}
this.rulesText = { ...this.rulesText }
})
},
comparaEdit(item) {
this.visible = true
this.title = this.$t('comparativeComments')
this.formInlineText = JSON.parse(JSON.stringify(item))
this.formInlineText = { ...this.formInlineText }
this.$nextTick(() => {
this.$refs.ruleFormText.clearValidate()
this.rulesText = {
comment: [
{
max: 300,
message: this.$t('comparativeComments') + this.$t('cannotExceed') + 300 + this.$t('Characters'),
trigger: 'blur'
}
]
}
this.rulesText = { ...this.rulesText }
}) })
}, },
comparaDelete(val) { comparaDelete(val) {
@@ -262,10 +324,10 @@
this.$confirm({ this.$confirm({
content: _this.$t('ConfirmDelete'), content: _this.$t('ConfirmDelete'),
onOk() { onOk() {
deleteAction(_this.url.deleteOne, { id: val.id }).then((res) => { deleteAction('/compare/sarFileCompareItemComment/delete', { id: val.id }).then((res) => {
if (res.success) { if (res.success) {
_this.$message.success(_this.$t('OperationSuccessful')) _this.$message.success(_this.$t('OperationSuccessful'))
_this.getList() _this.getData()
} else { } else {
_this.$message.warning(_this.$t('operationFailed')) _this.$message.warning(_this.$t('operationFailed'))
} }
@@ -45,7 +45,7 @@
<div class="detail-content-content-right"> <div class="detail-content-content-right">
<div class="detail-content-content-right-data" @click="detailLeft(index,item)" <div class="detail-content-content-right-data" @click="detailLeft(index,item)"
v-for="(item,index) in resultData.textLeft" v-for="(item,index) in resultData.textLeft"
:class="{'detail-content-content-right-data-blue':false}"> :class="{'detail-content-content-right-data-blue':item.reviewed == '1'?true:false}">
<div class="detail-content-content-right-data-text" style="margin-bottom: 10px;color: #040B29"> <div class="detail-content-content-right-data-text" style="margin-bottom: 10px;color: #040B29">
{{item.itemsNum + ' ' + item.itemsName}} {{item.itemsNum + ' ' + item.itemsName}}
</div> </div>
@@ -76,7 +76,7 @@
<div class="detail-content-content-right-right"> <div class="detail-content-content-right-right">
<div class="detail-content-content-right-data-right" @click="detailRight(index,item)" <div class="detail-content-content-right-data-right" @click="detailRight(index,item)"
v-for="(item,index) in resultData.textRight" v-for="(item,index) in resultData.textRight"
:class="{'detail-content-content-right-data-blue-right':false}"> :class="{'detail-content-content-right-data-blue-right':item.reviewed == '1'?true:false}">
<div class="detail-content-content-right-data-text" style="margin-bottom: 10px;color: #040B29"> <div class="detail-content-content-right-data-text" style="margin-bottom: 10px;color: #040B29">
{{item.itemsNum + ' ' + item.itemsName}} {{item.itemsNum + ' ' + item.itemsName}}
</div> </div>
@@ -119,7 +119,7 @@
<a-button type="primary" @click="fullTextCommentsEdit"> <a-button type="primary" @click="fullTextCommentsEdit">
{{$t('edit')}} {{$t('edit')}}
</a-button> </a-button>
<a-button type="primary" :confirm-loading="confirmLoading" @click="fullTextCommentsSubmit"> <a-button type="primary" :loading="confirmLoading" @click="fullTextCommentsSubmit">
{{$t('submit')}} {{$t('submit')}}
</a-button> </a-button>
</template> </template>
@@ -130,7 +130,7 @@
</div> </div>
<a-form-model-item class="itemModel" style="width: calc(100% - 113px)" prop="comment"> <a-form-model-item class="itemModel" style="width: calc(100% - 113px)" prop="comment">
<a-textarea :placeholder="$t('pleaseEnter')+$t('fullTextComments')" <a-textarea :placeholder="$t('pleaseEnter')+$t('fullTextComments')"
v-model="formInlineText.comment" v-model.trim="formInlineText.comment"
:disabled="fullTextDisabled" :disabled="fullTextDisabled"
:rows="4"/> :rows="4"/>
</a-form-model-item> </a-form-model-item>
@@ -142,7 +142,7 @@
</template> </template>
<script> <script>
import { postAction } from '../../../../api/manage' import { postAction, putAction } from '../../../../api/manage'
export default { export default {
name: 'documentDataComparison', name: 'documentDataComparison',
@@ -207,6 +207,28 @@
if (res.success) { if (res.success) {
this.$message.success(this.$t('OperationSuccessful')) this.$message.success(this.$t('OperationSuccessful'))
this.loading = false this.loading = false
this.formInline = {}
this.resultData.textRight.forEach(val => {
if (val.id == this.dataRight.id) {
val.reviewed = 1
}
})
this.resultData.textLeft.forEach(val => {
if (val.id == this.dataLeft.id) {
val.reviewed = 1
}
})
this.resultData = { ...this.resultData }
let detailLeftColor = document.getElementsByClassName('detail-content-content-right-data-color')
if (detailLeftColor && detailLeftColor.length > 0) {
detailLeftColor[0].classList.remove('detail-content-content-right-data-color')
}
let detailRightColor = document.getElementsByClassName('detail-content-content-right-data-color-right')
if (detailRightColor && detailRightColor.length > 0) {
detailRightColor[0].classList.remove('detail-content-content-right-data-color-right')
}
this.dataLeft = {}
this.dataRight = {}
// this.$router.push({ // this.$router.push({
// path: '/documentComparison' // path: '/documentComparison'
// }) // })
@@ -230,7 +252,11 @@
}, },
addFullTextCommentClick() { addFullTextCommentClick() {
this.visible = true this.visible = true
this.fullTextDisabled = true if (this.formInlineText.comment) {
this.fullTextDisabled = true
} else {
this.fullTextDisabled = false
}
}, },
turnOffAutomaticMatchingClick() { turnOffAutomaticMatchingClick() {
this.isMatching = !this.isMatching this.isMatching = !this.isMatching
@@ -242,16 +268,17 @@
fullTextCommentsSubmit() { fullTextCommentsSubmit() {
this.$refs.ruleFormText.validate(valid => { this.$refs.ruleFormText.validate(valid => {
if (valid) { if (valid) {
let formInlineText = JSON.parse(JSON.stringify(this.formInlineText))
this.confirmLoading = true this.confirmLoading = true
let query = { let query = {
infoId: this.$route.query.id, id: this.$route.query.id,
comment: this.formInlineText.comment comments: formInlineText.comment
} }
postAction('/compare/sarFileCompareItemComment/add', query).then((res) => { putAction('/compare/sarFileCompareInfo/editComments', query).then((res) => {
if (res.success) { if (res.success) {
this.$message.success(this.$t('OperationSuccessful')) this.$message.success(this.$t('OperationSuccessful'))
this.confirmLoading = false this.confirmLoading = false
this.fullTextDisabled = false this.visible = false
} else { } else {
this.$message.warning(this.$t('operationFailed')) this.$message.warning(this.$t('operationFailed'))
this.confirmLoading = false this.confirmLoading = false
@@ -269,6 +296,8 @@
postAction('/compare/sarFileCompareInfo/getComparisonDetail', query).then((res) => { postAction('/compare/sarFileCompareInfo/getComparisonDetail', query).then((res) => {
if (res.success) { if (res.success) {
this.resultData = res.result || {} this.resultData = res.result || {}
this.formInlineText.comment = res.result.comments || ''
this.formInlineText = { ...this.formInlineText }
this.loading = false this.loading = false
} else { } else {
this.resultData = {} this.resultData = {}
@@ -298,10 +327,10 @@
} }
let detailContent = document.getElementsByClassName('detail-content-content-right-right-top') let detailContent = document.getElementsByClassName('detail-content-content-right-right-top')
let detailRight = document.getElementsByClassName('detail-content-content-right-data-right') let detailRight = document.getElementsByClassName('detail-content-content-right-data-right')
this.dataRight = this.resultData.textRight[item.targetStand - 1] this.dataRight = this.resultData.textRight[item.targetStand]
if (detailRight && detailRight.length > 0) { if (detailRight && detailRight.length > 0) {
detailRight[item.itemsDisplayNum - 1].classList.add('detail-content-content-right-data-color-right') detailRight[item.targetStand].classList.add('detail-content-content-right-data-color-right')
detailContent[0].scrollTop = detailRight[item.targetStand - 1].offsetTop - 150 detailContent[0].scrollTop = detailRight[item.targetStand].offsetTop - 150
} }
} }
}, },
@@ -324,12 +353,12 @@
if (detailLeftColor && detailLeftColor.length > 0) { if (detailLeftColor && detailLeftColor.length > 0) {
detailLeftColor[0].classList.remove('detail-content-content-right-data-color') detailLeftColor[0].classList.remove('detail-content-content-right-data-color')
} }
this.dataLeft = this.resultData.textLeft[item.targetStand - 1] this.dataLeft = this.resultData.textLeft[item.targetStand]
let detailContent = document.getElementsByClassName('detail-content-content-right-top') let detailContent = document.getElementsByClassName('detail-content-content-right-top')
let detailLeft = document.getElementsByClassName('detail-content-content-right-data') let detailLeft = document.getElementsByClassName('detail-content-content-right-data')
if (detailLeft && detailLeft.length > 0) { if (detailLeft && detailLeft.length > 0) {
detailLeft[item.itemsDisplayNum - 1].classList.add('detail-content-content-right-data-color') detailLeft[item.targetStand].classList.add('detail-content-content-right-data-color')
detailContent[0].scrollTop = detailLeft[item.targetStand - 1].offsetTop - 150 detailContent[0].scrollTop = detailLeft[item.targetStand].offsetTop - 150
} }
} }
}, },
@@ -489,8 +518,9 @@
.detail-content-content-left { .detail-content-content-left {
width: 180px; width: 180px;
height: auto; height: 520px;
float: left; float: left;
overflow: auto;
} }
.detail-content-content-right-top { .detail-content-content-right-top {
@@ -510,6 +540,7 @@
.detail-content-content-right { .detail-content-content-right {
width: 100%; width: 100%;
display: inline-block; display: inline-block;
} }
.detail-content-content-right-right { .detail-content-content-right-right {
@@ -176,7 +176,7 @@
align: 'center', align: 'center',
width: 170, width: 170,
ellipsis: true, ellipsis: true,
dataIndex: 'releaseState' dataIndex: 'releaseStateTitle'
}, },
{ {
title: this.$t('remarks'), title: this.$t('remarks'),
@@ -294,8 +294,31 @@
}) })
window.open(newUrl.href, '_blank') window.open(newUrl.href, '_blank')
}, },
subscribe() { subscribe(record) {
let _this = this
this.$confirm({
content: record.releaseState == 'draft' ? _this.$t('confirmRelease') : _this.$t('confirmWithdraw'),
onOk() {
let releaseState = ''
if (record.releaseState == 'draft') {
releaseState = 'draft'
} else {
releaseState = 'published'
}
let query = {
releaseState: releaseState,
id: record.id
}
postAction('/compare/sarFileCompareInfo/changeState', query).then((res) => {
if (res.success) {
_this.$message.success(_this.$t('OperationSuccessful'))
_this.getList()
} else {
_this.$message.warning(_this.$t('operationFailed'))
}
})
}
})
}, },
edit(row) { edit(row) {
let newUrl = this.$router.resolve({ let newUrl = this.$router.resolve({