Merge branch 'dev_20230829_change' into 'dev_20231101_TXSS'
Dev 20230829 change See merge request laws-foton-slrs/foton-slrs-system-rest!134
This commit is contained in:
+4
-5
@@ -29,17 +29,16 @@ public class ActSarLawsInformationEOService {
|
||||
SarLawsInformation sarLawsInformation = JSONObject.parseObject(lawsInformationInfo, SarLawsInformation.class);
|
||||
JSONObject jsonObject = JSONObject.parseObject(lawsInformationInfo);
|
||||
String applyUserId = jsonObject.getString("applyUserId");
|
||||
String applyUserName = jsonObject.getString("applyUserName");
|
||||
// String applyUserName = jsonObject.getString("applyUserName");
|
||||
String approverId = jsonObject.getString("approverId");
|
||||
String approverName = jsonObject.getString("approverName");
|
||||
// String approverName = jsonObject.getString("approverName");
|
||||
String createAndApproveBy = "";
|
||||
// 判断发起人和审批人是否相同
|
||||
if (approverId.equals(applyUserId)) {
|
||||
createAndApproveBy = applyUserName + "(" + applyUserId + ")";
|
||||
createAndApproveBy = applyUserId;
|
||||
}else {
|
||||
createAndApproveBy = applyUserName + "(" + applyUserId + ")," + approverName + "(" + approverId + ")";
|
||||
createAndApproveBy = applyUserId + "," + approverId;
|
||||
}
|
||||
sarLawsInformation.setCreateAndApproveBy(createAndApproveBy);
|
||||
sarLawsInformation.setDownloadableBy(createAndApproveBy);
|
||||
sarLawsInformation.setViewableBy(createAndApproveBy);
|
||||
logger.info("政策法规资料入库:" + sarLawsInformation);
|
||||
|
||||
@@ -196,8 +196,18 @@ public class WebMvcConfig implements WebMvcConfigurer {
|
||||
// 政策课题导出接口
|
||||
addInterceptor.excludePathPatterns("/api/lawss/sarLawsTopic/exportLawsTopicInfo");
|
||||
|
||||
// 政策资料导出接口
|
||||
addInterceptor.excludePathPatterns("/api/lawss/sarLawsInformation/exportLawsInformationInfo");
|
||||
|
||||
// 内外部会议模板下载
|
||||
addInterceptor.excludePathPatterns("/api/lawss/insideOutsideMeeting/exportTemplateFile");
|
||||
|
||||
// 政策课题模板下载
|
||||
addInterceptor.excludePathPatterns("/api/lawss/sarLawsTopic/exportTemplateFile");
|
||||
|
||||
// 政策资料模板下载
|
||||
addInterceptor.excludePathPatterns("/api/lawss/sarLawsInformation/exportTemplateFile");
|
||||
|
||||
// // 添加自定义拦截器,并拦截对应 url
|
||||
addInterceptor.addPathPatterns("/**");
|
||||
}
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@ import java.util.List;
|
||||
@Mapper
|
||||
public interface InsideOutsideMeetingDao extends BaseMapper<InsideOutsideMeeting> {
|
||||
|
||||
Integer queryByPageCount(InsideOutsideMeetingVO page);
|
||||
List<Integer> queryByPageCount(InsideOutsideMeetingVO page);
|
||||
|
||||
List<InsideOutsideMeetingVO> queryByPage(InsideOutsideMeetingVO page);
|
||||
|
||||
|
||||
+3
-1
@@ -86,7 +86,9 @@ public class InsideOutsideMeetingVO extends BasePage {
|
||||
|
||||
private String sortMode = "asc";
|
||||
|
||||
private String meetingTimeOperator = "=";
|
||||
// 会议时间查询字段
|
||||
private Date meetingTimeBegin;
|
||||
private Date meetingTimeEnd;
|
||||
|
||||
// 导出使用字段
|
||||
// 被前端选中的记录的ids
|
||||
|
||||
+1
-1
@@ -187,7 +187,7 @@ public class InsideOutsideMeetingServiceImpl extends ServiceImpl<InsideOutsideMe
|
||||
page.setSortField("ID");
|
||||
page.setSortMode("asc");
|
||||
}
|
||||
Integer rowCount = this.baseMapper.queryByPageCount(page);
|
||||
int rowCount = this.baseMapper.queryByPageCount(page).size();
|
||||
page.getPager().setRowCount(rowCount);
|
||||
List<InsideOutsideMeetingVO> insideOutsideMeetingVOList = this.baseMapper.queryByPage(page);
|
||||
for (InsideOutsideMeetingVO insideOutsideMeeting : insideOutsideMeetingVOList) {
|
||||
|
||||
+38
-39
@@ -8,8 +8,7 @@ import com.adc.da.http.PageInfo;
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.slrs.esRevisePlan.service.IEsRevisePlanService;
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.dao.QualityEvaluationDao;
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity.QualityEvaluation;
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.service.IQualityEvaluationService;
|
||||
import com.adc.da.utils.util.EsRevisePlanExportUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@@ -29,10 +28,7 @@ import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -52,7 +48,7 @@ public class EsRevisePlanController extends BaseController<EsRevisePlan> {
|
||||
@Autowired
|
||||
IEsRevisePlanService iEsRevisePlanService;
|
||||
@Autowired
|
||||
private QualityEvaluationDao qualityEvaluationDao;
|
||||
private IQualityEvaluationService qualityEvaluationService;
|
||||
|
||||
@ApiOperation(value = "获取所有企标计划")
|
||||
@GetMapping("getAllPlans")
|
||||
@@ -106,38 +102,41 @@ public class EsRevisePlanController extends BaseController<EsRevisePlan> {
|
||||
revisePlan.setArea(area);
|
||||
//查评分
|
||||
if (ObjectUtils.isNotEmpty(revisePlan.getStandId())) {
|
||||
List<Double> last = new ArrayList<>();
|
||||
List<QualityEvaluation> evaluations = qualityEvaluationDao.getEvaluationForm(new QueryWrapper<QualityEvaluation>().eq("law_id", revisePlan.getStandId()).eq("evaluation_type", "quality"));
|
||||
for (QualityEvaluation evaluation : evaluations) {
|
||||
Double score;
|
||||
String value;
|
||||
if (evaluation.getProcessNode()==null){
|
||||
value="";
|
||||
}else {
|
||||
value=evaluation.getProcessNode();
|
||||
}
|
||||
String evaluationScore = ObjectUtils.isEmpty(evaluation.getScore()) ? "0" : evaluation.getScore();
|
||||
switch (value){
|
||||
case "征求意见":
|
||||
score=Double.valueOf(evaluationScore) * 0.3;
|
||||
break;
|
||||
case "技术委员会评审、评审意见修改":
|
||||
score=Double.valueOf(evaluationScore) * 0.4;
|
||||
break;
|
||||
case "重新技术委员会评审、评审意见修改":
|
||||
score=Double.valueOf(evaluationScore) * 0.4;
|
||||
break;
|
||||
case "标准化复审":
|
||||
score=Double.valueOf(evaluationScore) * 0.15;
|
||||
break;
|
||||
case "标准法规部高级经理审核":
|
||||
score=Double.valueOf(evaluationScore) * 0.15;
|
||||
break;
|
||||
default: score=Double.valueOf(evaluationScore);
|
||||
}
|
||||
last.add(score);
|
||||
}
|
||||
revisePlan.setScore(last.stream().mapToDouble(Double::doubleValue).sum());
|
||||
Map<String, Double> score = qualityEvaluationService.getScore(revisePlan.getStandId());
|
||||
revisePlan.setScore(score.get("finalScore"));
|
||||
// List<Double> last = new ArrayList<>();
|
||||
// List<QualityEvaluation> evaluations = qualityEvaluationDao.getEvaluationForm(new QueryWrapper<QualityEvaluation>().eq("law_id", revisePlan.getStandId()).eq("evaluation_type", "quality"));
|
||||
// for (QualityEvaluation evaluation : evaluations) {
|
||||
// Double score;
|
||||
// String value;
|
||||
// if (evaluation.getProcessNode()==null){
|
||||
// value="";
|
||||
// }else {
|
||||
// value=evaluation.getProcessNode();
|
||||
// }
|
||||
// String evaluationScore = ObjectUtils.isEmpty(evaluation.getScore()) ? "0" : evaluation.getScore();
|
||||
// switch (value){
|
||||
// case "征求意见":
|
||||
// score=Double.valueOf(evaluationScore) * 0.3;
|
||||
// break;
|
||||
// case "技术委员会评审、评审意见修改":
|
||||
// score=Double.valueOf(evaluationScore) * 0.4;
|
||||
// break;
|
||||
// case "重新技术委员会评审、评审意见修改":
|
||||
// score=Double.valueOf(evaluationScore) * 0.4;
|
||||
// break;
|
||||
// case "标准化复审":
|
||||
// score=Double.valueOf(evaluationScore) * 0.15;
|
||||
// break;
|
||||
// case "标准法规部高级经理审核":
|
||||
// score=Double.valueOf(evaluationScore) * 0.15;
|
||||
// break;
|
||||
// default: score=Double.valueOf(evaluationScore);
|
||||
// }
|
||||
// last.add(score);
|
||||
// }
|
||||
// revisePlan.setScore(last.stream().mapToDouble(Double::doubleValue).sum());
|
||||
|
||||
}
|
||||
}
|
||||
workbook = EsRevisePlanExportUtil.exportDatas(datas);
|
||||
|
||||
+3
@@ -69,6 +69,9 @@ public class SarLawsInformationController extends BaseController<SarLawsInformat
|
||||
@GetMapping("/page")
|
||||
public ResponseMessage<PageInfo<SarLawsInformation>> page(SarLawsInformation sarLawsInformation) {
|
||||
List<SarLawsInformation> rows = informationService.queryByPage(sarLawsInformation);
|
||||
if (rows == null) {
|
||||
return Result.error("查询失败!");
|
||||
}
|
||||
return Result.success(getPageInfo(sarLawsInformation.getPager(), rows));
|
||||
}
|
||||
|
||||
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package com.adc.da.slrs.sarLawsInformation.dao;
|
||||
|
||||
import com.adc.da.slrs.sarLawsInformation.entity.SarLawsInformationAuth;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @author tjzdw
|
||||
* @description
|
||||
* @date 2023/11/10
|
||||
*/
|
||||
@Mapper
|
||||
public interface SarLawsInformationAuthDao extends BaseMapper<SarLawsInformationAuth> {
|
||||
}
|
||||
+28
-12
@@ -37,7 +37,7 @@ public class SarLawsInformation extends BasePage implements Serializable {
|
||||
/**
|
||||
* 一级资料类别
|
||||
*/
|
||||
@ApiModelProperty("一级资料类别")
|
||||
@ApiModelProperty("1级资料分类")
|
||||
@TableField(value = "FIRST_TYPE")
|
||||
private String firstType;
|
||||
|
||||
@@ -45,8 +45,8 @@ public class SarLawsInformation extends BasePage implements Serializable {
|
||||
* 一级资料类别名称
|
||||
*/
|
||||
@ApiModelProperty(value = "一级资料类别名称")
|
||||
@TableField(exist = false)
|
||||
@Excel(name = "一级资料类别", orderNum = "0")
|
||||
// @TableField(exist = false)
|
||||
@Excel(name = "1级资料分类", orderNum = "0")
|
||||
private String firstTypeName;
|
||||
|
||||
/**
|
||||
@@ -60,8 +60,8 @@ public class SarLawsInformation extends BasePage implements Serializable {
|
||||
* 二级资料类别名称
|
||||
*/
|
||||
@ApiModelProperty(value = "二级资料类别名称")
|
||||
@TableField(exist = false)
|
||||
@Excel(name = "二级资料类别", orderNum = "1")
|
||||
// @TableField(exist = false)
|
||||
@Excel(name = "2级资料分类", orderNum = "1")
|
||||
private String secondTypeName;
|
||||
|
||||
/**
|
||||
@@ -75,8 +75,8 @@ public class SarLawsInformation extends BasePage implements Serializable {
|
||||
* 三级资料类别名称
|
||||
*/
|
||||
@ApiModelProperty(value = "三级资料类别名称")
|
||||
@TableField(exist = false)
|
||||
@Excel(name = "三级资料类别", orderNum = "2")
|
||||
// @TableField(exist = false)
|
||||
@Excel(name = "3级资料分类", orderNum = "2")
|
||||
private String thirdTypeName;
|
||||
|
||||
/**
|
||||
@@ -90,8 +90,8 @@ public class SarLawsInformation extends BasePage implements Serializable {
|
||||
* 四级资料类别名称
|
||||
*/
|
||||
@ApiModelProperty(value = "四级资料类别名称")
|
||||
@TableField(exist = false)
|
||||
@Excel(name = "四级资料类别", orderNum = "3")
|
||||
// @TableField(exist = false)
|
||||
@Excel(name = "4级资料分类", orderNum = "3")
|
||||
private String fourthTypeName;
|
||||
|
||||
/**
|
||||
@@ -154,21 +154,21 @@ public class SarLawsInformation extends BasePage implements Serializable {
|
||||
* 可查看者,若设置为空则所有用户均可查看,若设置人员后,仅有可查看者可以查看文件信息。
|
||||
*/
|
||||
@ApiModelProperty(value = "可查看者")
|
||||
@TableField(value = "VIEWABLE_BY")
|
||||
@TableField(exist = false)
|
||||
private String viewableBy;
|
||||
|
||||
/**
|
||||
* 可下载者,若设置为空则仅有上传人和审批人可以查看,若设置人员后,仅有可下载者可下载文件信息。
|
||||
*/
|
||||
@ApiModelProperty(value = "可下载者")
|
||||
@TableField(value = "DOWNLOADABLE_BY")
|
||||
@TableField(exist = false)
|
||||
private String downloadableBy;
|
||||
|
||||
/**
|
||||
* 创建人和审批人
|
||||
*/
|
||||
@ApiModelProperty(value = "创建人和审批人")
|
||||
@TableField
|
||||
@TableField(exist = false)
|
||||
private String createAndApproveBy;
|
||||
|
||||
/**
|
||||
@@ -242,4 +242,20 @@ public class SarLawsInformation extends BasePage implements Serializable {
|
||||
|
||||
@TableField(exist = false)
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
// 上传时间查询字段
|
||||
@TableField(exist = false)
|
||||
private String uploadTimeBegin;
|
||||
@TableField(exist = false)
|
||||
private String uploadTimeEnd;
|
||||
// 查询使用 所有子节点列表
|
||||
@TableField(exist = false)
|
||||
private List<String> treeNodeIdList;
|
||||
|
||||
@TableField(exist = false)
|
||||
private List<String> informationIdList;
|
||||
|
||||
// 是否可下载
|
||||
@TableField(exist = false)
|
||||
private Boolean downloadable;
|
||||
}
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
package com.adc.da.slrs.sarLawsInformation.entity;
|
||||
|
||||
import com.adc.da.base.entity.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author tjzdw
|
||||
* @description
|
||||
* @date 2023/11/10
|
||||
*/
|
||||
@TableName(value ="sar_laws_information_auth")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Accessors(chain = true)
|
||||
@Data
|
||||
public class SarLawsInformationAuth extends BaseEntity implements Serializable {
|
||||
|
||||
@ApiModelProperty(value = "主键")
|
||||
@TableId(value = "ID", type = IdType.ID_WORKER_STR)
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty(value = "权限类型")
|
||||
@TableField(value = "AUTH_TYPE")
|
||||
private String authType;
|
||||
|
||||
@ApiModelProperty(value = "政策资料ID")
|
||||
@TableField(value = "LAWS_INFORMATION_ID")
|
||||
private String lawsInformationId;
|
||||
|
||||
@ApiModelProperty(value = "用户ID")
|
||||
@TableField(value = "USER_ID")
|
||||
private String userId;
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package com.adc.da.slrs.sarLawsInformation.service;
|
||||
|
||||
import com.adc.da.slrs.sarLawsInformation.entity.SarLawsInformationAuth;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @author tjzdw
|
||||
* @description
|
||||
* @date 2023/11/10
|
||||
*/
|
||||
public interface SarLawsInformationAuthService extends IService<SarLawsInformationAuth> {
|
||||
}
|
||||
+1
-1
@@ -18,7 +18,7 @@ public interface SarLawsInformationService extends IService<SarLawsInformation>
|
||||
|
||||
List<SarLawsInformation> queryByPage(SarLawsInformation sarLawsInformation);
|
||||
|
||||
Integer addLawsInformation(SarLawsInformation sarLawsInformation);
|
||||
Boolean addLawsInformation(SarLawsInformation sarLawsInformation);
|
||||
|
||||
Boolean deleteInformation(String id);
|
||||
|
||||
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
package com.adc.da.slrs.sarLawsInformation.service.impl;
|
||||
|
||||
import com.adc.da.slrs.sarLawsInformation.dao.SarLawsInformationAuthDao;
|
||||
import com.adc.da.slrs.sarLawsInformation.dao.SarLawsInformationDao;
|
||||
import com.adc.da.slrs.sarLawsInformation.entity.SarLawsInformationAuth;
|
||||
import com.adc.da.slrs.sarLawsInformation.service.SarLawsInformationAuthService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author tjzdw
|
||||
* @description
|
||||
* @date 2023/11/10
|
||||
*/
|
||||
@Service
|
||||
public class SarLawsInformationAuthServiceImpl extends ServiceImpl<SarLawsInformationAuthDao, SarLawsInformationAuth>
|
||||
implements SarLawsInformationAuthService {
|
||||
}
|
||||
+248
-59
@@ -1,6 +1,5 @@
|
||||
package com.adc.da.slrs.sarLawsInformation.service.impl;
|
||||
|
||||
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||
import cn.afterturn.easypoi.excel.ExcelImportUtil;
|
||||
import cn.afterturn.easypoi.excel.entity.ImportParams;
|
||||
import com.adc.da.att.entity.AttFileEO;
|
||||
@@ -10,11 +9,12 @@ import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.person.entity.TsPersonCollect;
|
||||
import com.adc.da.person.service.IPersonCollectEOService;
|
||||
import com.adc.da.slrs.sarLawsInformation.entity.SarLawsInformationAuth;
|
||||
import com.adc.da.slrs.sarLawsInformation.service.SarLawsInformationAuthService;
|
||||
import com.adc.da.slrs.sarLawsInformationCenterTree.entity.SarLawsInformationCenterTree;
|
||||
import com.adc.da.slrs.sarLawsInformationCenterTree.service.SarLawsInformationCenterTreeService;
|
||||
import com.adc.da.slrs.sarUpdLog.entity.SarUpdLog;
|
||||
import com.adc.da.slrs.sarUpdLog.service.ISarUpdLogService;
|
||||
import com.adc.da.slrs.sarUser.entity.TsUser;
|
||||
import com.adc.da.slrs.sarUser.service.ITsUserService;
|
||||
import com.adc.da.slrs.tsDictionaryType.entity.TsDicType;
|
||||
import com.adc.da.slrs.tsDictionaryType.service.ITsDicTypeService;
|
||||
@@ -22,7 +22,6 @@ import com.adc.da.util.LoginUserUtil;
|
||||
import com.adc.da.util.UUIDUtils;
|
||||
import com.adc.da.utils.util.FieldConvertUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.adc.da.slrs.sarLawsInformation.entity.SarLawsInformation;
|
||||
@@ -47,6 +46,8 @@ import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@@ -61,6 +62,8 @@ public class SarLawsInformationServiceImpl extends ServiceImpl<SarLawsInformatio
|
||||
@Resource
|
||||
private SarLawsInformationCenterTreeService treeService;
|
||||
@Resource
|
||||
private SarLawsInformationAuthService authService;
|
||||
@Resource
|
||||
private IAttFileEOService attFileEOService;
|
||||
@Resource
|
||||
private ITsDicTypeService dicTypeService;
|
||||
@@ -77,7 +80,7 @@ public class SarLawsInformationServiceImpl extends ServiceImpl<SarLawsInformatio
|
||||
public SarLawsInformation getLawsInformationInfo(String id) {
|
||||
SarLawsInformation sarLawsInformation = this.baseMapper.selectById(id);
|
||||
// 将字典编号变更为字典值
|
||||
convertCodeToName(sarLawsInformation);
|
||||
// convertCodeToName(sarLawsInformation);
|
||||
// 查询资料文件信息
|
||||
if (StringUtils.isNotBlank(sarLawsInformation.getInformationFile())) {
|
||||
String[] split = sarLawsInformation.getInformationFile().split(",");
|
||||
@@ -100,12 +103,74 @@ public class SarLawsInformationServiceImpl extends ServiceImpl<SarLawsInformatio
|
||||
if (list.size() > 0) {
|
||||
sarLawsInformation.setCollectId(list.get(0).getId());
|
||||
}
|
||||
// 查询可查看用户和可下载用户
|
||||
String userId = LoginUserUtil.getUserId();
|
||||
LambdaQueryWrapper<SarLawsInformationAuth> wrapper1 = new LambdaQueryWrapper<>();
|
||||
wrapper1.eq(SarLawsInformationAuth::getLawsInformationId, sarLawsInformation.getId());
|
||||
wrapper1.eq(SarLawsInformationAuth::getAuthType, "viewableBy");
|
||||
wrapper1.select(SarLawsInformationAuth::getUserId);
|
||||
List<SarLawsInformationAuth> list1 = authService.list(wrapper1);
|
||||
if (list1.size() > 0) {
|
||||
List<String> viewableBy = new ArrayList<>();
|
||||
list1.forEach(item -> {
|
||||
String userName = userService.userIdByName(item.getUserId());
|
||||
viewableBy.add(userName + "(" + item.getUserId() + ")");
|
||||
});
|
||||
sarLawsInformation.setViewableBy(String.join(",", viewableBy));
|
||||
}
|
||||
sarLawsInformation.setDownloadable(false);
|
||||
LambdaQueryWrapper<SarLawsInformationAuth> wrapper2 = new LambdaQueryWrapper<>();
|
||||
wrapper2.eq(SarLawsInformationAuth::getLawsInformationId, sarLawsInformation.getId());
|
||||
wrapper2.eq(SarLawsInformationAuth::getAuthType, "downloadableBy");
|
||||
wrapper2.select(SarLawsInformationAuth::getUserId);
|
||||
List<SarLawsInformationAuth> list2 = authService.list(wrapper2);
|
||||
if (list2.size() > 0) {
|
||||
List<String> downloadableBy = new ArrayList<>();
|
||||
list2.forEach(item -> {
|
||||
String userName = userService.userIdByName(item.getUserId());
|
||||
downloadableBy.add(userName + "(" + item.getUserId() + ")");
|
||||
// 判断是否可下载
|
||||
if (item.getUserId().equals(userId)) {
|
||||
sarLawsInformation.setDownloadable(true);
|
||||
}
|
||||
});
|
||||
sarLawsInformation.setDownloadableBy(String.join(",", downloadableBy));
|
||||
} else {
|
||||
sarLawsInformation.setDownloadable(true);
|
||||
}
|
||||
LambdaQueryWrapper<SarLawsInformationAuth> wrapper3 = new LambdaQueryWrapper<>();
|
||||
wrapper3.eq(SarLawsInformationAuth::getLawsInformationId, sarLawsInformation.getId());
|
||||
wrapper3.eq(SarLawsInformationAuth::getAuthType, "createAndApproveBy");
|
||||
wrapper3.eq(SarLawsInformationAuth::getUserId, userId);
|
||||
int count = authService.count(wrapper3);
|
||||
if (count > 0) {
|
||||
sarLawsInformation.setDownloadable(true);
|
||||
}
|
||||
return sarLawsInformation;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SarLawsInformation> queryByPage(SarLawsInformation page) {
|
||||
String userId = LoginUserUtil.getUserId();
|
||||
if (StringUtils.isBlank(userId)) {
|
||||
return null;
|
||||
}
|
||||
// 查询有权限的资料ID
|
||||
LambdaQueryWrapper<SarLawsInformationAuth> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(SarLawsInformationAuth::getUserId, userId);
|
||||
wrapper.eq(SarLawsInformationAuth::getAuthType, "viewableBy");
|
||||
wrapper.or().eq(SarLawsInformationAuth::getAuthType, "createAndApproveBy");
|
||||
wrapper.select(SarLawsInformationAuth::getLawsInformationId);
|
||||
List<SarLawsInformationAuth> informationAuthList = authService.list(wrapper);
|
||||
if (informationAuthList.size() > 0) {
|
||||
List<String> informationIdList = informationAuthList.stream().map(SarLawsInformationAuth::getLawsInformationId).collect(Collectors.toList());
|
||||
page.setInformationIdList(informationIdList);
|
||||
}
|
||||
// 设置排序字段
|
||||
// if("name".equals(page.getSortField()) || "uploadTime".equals(page.getSortField())) {
|
||||
// String sortField = StringUtils.join(StringUtils.splitByCharacterTypeCamelCase(page.getSortField()),"_").toUpperCase();
|
||||
// page.setSortField(sortField);
|
||||
// }
|
||||
if (StringUtils.isNotBlank(page.getSortField())) {
|
||||
String sortField = StringUtils.join(StringUtils.splitByCharacterTypeCamelCase(page.getSortField()),"_").toUpperCase();
|
||||
page.setSortField(sortField);
|
||||
@@ -113,9 +178,17 @@ public class SarLawsInformationServiceImpl extends ServiceImpl<SarLawsInformatio
|
||||
page.setSortField("ID");
|
||||
page.setSortMode("asc");
|
||||
}
|
||||
// 查询树节点及其子节点
|
||||
if (StringUtils.isNotBlank(page.getTreeNodeId())) {
|
||||
List<String> treeNodeIdList = new ArrayList<>();
|
||||
treeService.querySubordinateTreeNode(treeNodeIdList, page.getTreeNodeId());
|
||||
page.setTreeNodeIdList(treeNodeIdList);
|
||||
}
|
||||
Integer rowCount = this.baseMapper.queryByPageCount(page);
|
||||
page.getPager().setRowCount(rowCount);
|
||||
List<SarLawsInformation> sarLawsInformationList = this.baseMapper.queryByPage(page);
|
||||
// 对一级类别或二级类别做排序
|
||||
// if (page.getSortField().contains("_"))
|
||||
for (SarLawsInformation sarLawsInformation : sarLawsInformationList) {
|
||||
// 将字典编号变更为字典值
|
||||
convertCodeToName(sarLawsInformation);
|
||||
@@ -134,7 +207,7 @@ public class SarLawsInformationServiceImpl extends ServiceImpl<SarLawsInformatio
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer addLawsInformation(SarLawsInformation sarLawsInformation) {
|
||||
public Boolean addLawsInformation(SarLawsInformation sarLawsInformation) {
|
||||
sarLawsInformation.setCreateTime(new Date());
|
||||
sarLawsInformation.setModifyTime(new Date());
|
||||
if (sarLawsInformation.getUploadTime() == null) {
|
||||
@@ -142,9 +215,6 @@ public class SarLawsInformationServiceImpl extends ServiceImpl<SarLawsInformatio
|
||||
}
|
||||
sarLawsInformation.setValidFlag(0);
|
||||
String userId = LoginUserUtil.getUserId();
|
||||
TsUser tsUser = userService.getById(userId);
|
||||
sarLawsInformation.setViewableBy(tsUser.getUname() + "(" + userId + ")");
|
||||
sarLawsInformation.setDownloadableBy(tsUser.getUname() + "(" + userId + ")");
|
||||
// 若体系类别不存在,则默认属于根节点
|
||||
if (StringUtils.isBlank(sarLawsInformation.getTreeNodeId())) {
|
||||
LambdaQueryWrapper<SarLawsInformationCenterTree> wrapper = new LambdaQueryWrapper<>();
|
||||
@@ -152,7 +222,56 @@ public class SarLawsInformationServiceImpl extends ServiceImpl<SarLawsInformatio
|
||||
SarLawsInformationCenterTree one = treeService.getOne(wrapper);
|
||||
sarLawsInformation.setTreeNodeId(one.getId());
|
||||
}
|
||||
return this.baseMapper.insert(sarLawsInformation);
|
||||
convertCodeToName(sarLawsInformation);
|
||||
int insert = this.baseMapper.insert(sarLawsInformation);
|
||||
if (insert <= 0) {
|
||||
return false;
|
||||
}
|
||||
// 设置可见人和下载人
|
||||
if (StringUtils.isNotBlank(sarLawsInformation.getViewableBy())) {
|
||||
List<String> viewableByList = extractContentInParentheses(sarLawsInformation.getViewableBy());
|
||||
if (!viewableByList.contains(userId)) {
|
||||
viewableByList.add(userId);
|
||||
}
|
||||
viewableByList.forEach(viewableBy -> {
|
||||
SarLawsInformationAuth auth = new SarLawsInformationAuth();
|
||||
auth.setLawsInformationId(sarLawsInformation.getId());
|
||||
auth.setAuthType("viewableBy");
|
||||
auth.setUserId(viewableBy);
|
||||
authService.save(auth);
|
||||
});
|
||||
}
|
||||
if (StringUtils.isNotBlank(sarLawsInformation.getDownloadableBy())) {
|
||||
List<String> downloadableByList = extractContentInParentheses(sarLawsInformation.getDownloadableBy());
|
||||
if (!downloadableByList.contains(userId)) {
|
||||
downloadableByList.add(userId);
|
||||
}
|
||||
downloadableByList.forEach(viewableBy -> {
|
||||
SarLawsInformationAuth auth = new SarLawsInformationAuth();
|
||||
auth.setLawsInformationId(sarLawsInformation.getId());
|
||||
auth.setAuthType("downloadableBy");
|
||||
auth.setUserId(viewableBy);
|
||||
authService.save(auth);
|
||||
});
|
||||
}
|
||||
// 流程入库审批人和创建人入库
|
||||
if (sarLawsInformation.getCreateAndApproveBy() != null) {
|
||||
for (String userIdBy : sarLawsInformation.getCreateAndApproveBy().split(",")) {
|
||||
SarLawsInformationAuth auth = new SarLawsInformationAuth();
|
||||
auth.setLawsInformationId(sarLawsInformation.getId());
|
||||
auth.setAuthType("createAndApproveBy");
|
||||
auth.setUserId(userIdBy);
|
||||
authService.save(auth);
|
||||
}
|
||||
} else {
|
||||
// 配置初始人员权限
|
||||
SarLawsInformationAuth auth = new SarLawsInformationAuth();
|
||||
auth.setLawsInformationId(sarLawsInformation.getId());
|
||||
auth.setAuthType("createAndApproveBy");
|
||||
auth.setUserId(userId);
|
||||
authService.save(auth);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -161,7 +280,13 @@ public class SarLawsInformationServiceImpl extends ServiceImpl<SarLawsInformatio
|
||||
wrapper.eq(SarLawsInformation::getId, id);
|
||||
wrapper.set(SarLawsInformation::getValidFlag,1);
|
||||
wrapper.set(SarLawsInformation::getModifyTime,new Date());
|
||||
return update(wrapper);
|
||||
boolean update = update(wrapper);
|
||||
if (update) {
|
||||
LambdaQueryWrapper<SarLawsInformationAuth> wrapper1 = new LambdaQueryWrapper<>();
|
||||
wrapper1.eq(SarLawsInformationAuth::getLawsInformationId, id);
|
||||
authService.remove(wrapper1);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -175,6 +300,36 @@ public class SarLawsInformationServiceImpl extends ServiceImpl<SarLawsInformatio
|
||||
List<String> compareResult = compareSarLawsInformation(oldLawsInformation, lawsInformation);
|
||||
if (compareResult.size() > 0) {
|
||||
int update = this.baseMapper.updateById(lawsInformation);
|
||||
for (String compareItem : compareResult) {
|
||||
if (compareItem.contains("可查看者")) {
|
||||
LambdaQueryWrapper<SarLawsInformationAuth> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(SarLawsInformationAuth::getLawsInformationId, lawsInformation.getId());
|
||||
wrapper.eq(SarLawsInformationAuth::getAuthType, "viewableBy");
|
||||
authService.remove(wrapper);
|
||||
List<String> viewableByList = extractContentInParentheses(lawsInformation.getViewableBy());
|
||||
viewableByList.forEach(viewableBy -> {
|
||||
SarLawsInformationAuth auth = new SarLawsInformationAuth();
|
||||
auth.setLawsInformationId(lawsInformation.getId());
|
||||
auth.setAuthType("viewableBy");
|
||||
auth.setUserId(viewableBy);
|
||||
authService.save(auth);
|
||||
});
|
||||
}
|
||||
if (compareItem.contains("可下载者")) {
|
||||
LambdaQueryWrapper<SarLawsInformationAuth> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(SarLawsInformationAuth::getLawsInformationId, lawsInformation.getId());
|
||||
wrapper.eq(SarLawsInformationAuth::getAuthType, "downloadableBy");
|
||||
authService.remove(wrapper);
|
||||
List<String> downloadableByList = extractContentInParentheses(lawsInformation.getDownloadableBy());
|
||||
downloadableByList.forEach(downloadableBy -> {
|
||||
SarLawsInformationAuth auth = new SarLawsInformationAuth();
|
||||
auth.setLawsInformationId(lawsInformation.getId());
|
||||
auth.setAuthType("downloadableBy");
|
||||
auth.setUserId(downloadableBy);
|
||||
authService.save(auth);
|
||||
});
|
||||
}
|
||||
}
|
||||
// 添加修改记录
|
||||
SarUpdLog sarUpdLogEO = new SarUpdLog();
|
||||
sarUpdLogEO.setId(UUIDUtils.randomUUID20());
|
||||
@@ -193,19 +348,31 @@ public class SarLawsInformationServiceImpl extends ServiceImpl<SarLawsInformatio
|
||||
LambdaQueryWrapper<SarLawsInformation> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.in(SarLawsInformation::getId, idList);
|
||||
List<SarLawsInformation> sarLawsInformationList = this.baseMapper.selectList(wrapper);
|
||||
for (SarLawsInformation sarLawsInformation : sarLawsInformationList) {
|
||||
// 将字典编号变更为字典值
|
||||
convertCodeToName(sarLawsInformation);
|
||||
}
|
||||
// for (SarLawsInformation sarLawsInformation : sarLawsInformationList) {
|
||||
// // 将字典编号变更为字典值
|
||||
// convertCodeToName(sarLawsInformation);
|
||||
// }
|
||||
return sarLawsInformationList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SarLawsInformation> getAllLawsInformation(SarLawsInformation sarLawsInformation) {
|
||||
String userId = LoginUserUtil.getUserId();
|
||||
// 查询有权限的资料ID
|
||||
LambdaQueryWrapper<SarLawsInformationAuth> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(SarLawsInformationAuth::getUserId, userId);
|
||||
wrapper.eq(SarLawsInformationAuth::getAuthType, "viewableBy");
|
||||
wrapper.or().eq(SarLawsInformationAuth::getAuthType, "createAndApproveBy");
|
||||
wrapper.select(SarLawsInformationAuth::getLawsInformationId);
|
||||
List<SarLawsInformationAuth> informationAuthList = authService.list(wrapper);
|
||||
if (informationAuthList.size() > 0) {
|
||||
List<String> informationIdList = informationAuthList.stream().map(SarLawsInformationAuth::getLawsInformationId).collect(Collectors.toList());
|
||||
sarLawsInformation.setInformationIdList(informationIdList);
|
||||
}
|
||||
List<SarLawsInformation> sarLawsInformationList = this.baseMapper.getAllLawsInformation(sarLawsInformation);
|
||||
for (SarLawsInformation lawsInformation : sarLawsInformationList) {
|
||||
// 将字典编号变更为字典值
|
||||
convertCodeToName(lawsInformation);
|
||||
// convertCodeToName(lawsInformation);
|
||||
// 查询文件信息
|
||||
if (StringUtils.isNotBlank(lawsInformation.getInformationFile())) {
|
||||
String[] split = lawsInformation.getInformationFile().split(",");
|
||||
@@ -425,63 +592,70 @@ public class SarLawsInformationServiceImpl extends ServiceImpl<SarLawsInformatio
|
||||
*/
|
||||
public List<String> compareSarLawsInformation(SarLawsInformation oldInfo, SarLawsInformation newInfo) {
|
||||
List<String> changes = new ArrayList<>();
|
||||
// 不需要比较的字段
|
||||
String[] ignoreFields = {"id","firstTypeName","secondTypeName","thirdTypeName","fourthTypeName","uploadTime",
|
||||
"informationFileList","createAndApproveBy","treeNodeId","treeNodeName","validFlag","createTime",
|
||||
"modifyTime","sortField","sortMode","collectId","serialVersionUID"};
|
||||
List<String> ignoreFieldList = Arrays.asList(ignoreFields);
|
||||
// 需要比较的字段
|
||||
String[] fieldArr = {"firstType","secondType","thirdType","fourthType","name",
|
||||
"department","author","description","informationFile","treeNodeId","viewableBy","downloadableBy"};
|
||||
List<String> fieldList = Arrays.asList(fieldArr);
|
||||
// 获取SarLawsInformation类的所有字段
|
||||
Field[] fields = SarLawsInformation.class.getDeclaredFields();
|
||||
for (Field field : fields) {
|
||||
if (!ignoreFieldList.contains(field.getName())) {
|
||||
if (fieldList.contains(field.getName())) {
|
||||
try {
|
||||
field.setAccessible(true);
|
||||
String oldValue = String.valueOf(field.get(oldInfo));
|
||||
String newValue = String.valueOf(field.get(newInfo));
|
||||
if (!Objects.equals(oldValue, newValue)) {
|
||||
if ("firstType".equals(field.getName()) || "secondType".equals(field.getName()) || "thirdType".equals(field.getName()) ||
|
||||
"fourthType".equals(field.getName())) {
|
||||
List<String> typeNameList = new ArrayList<>();
|
||||
if (StringUtils.isNotBlank(newValue)) {
|
||||
for (String type : newValue.split(",")) {
|
||||
if (StringUtils.isNotBlank(type)) {
|
||||
typeNameList.add(dicTypeService.getDicTypeNameByDicCode(type));
|
||||
switch (field.getName()) {
|
||||
// case "firstType":
|
||||
// case "secondType":
|
||||
// case "thirdType":
|
||||
// case "fourthType": {
|
||||
// List<String> typeNameList = new ArrayList<>();
|
||||
// if (StringUtils.isNotBlank(newValue)) {
|
||||
// for (String type : newValue.split(",")) {
|
||||
// if (StringUtils.isNotBlank(type)) {
|
||||
// typeNameList.add(dicTypeService.getDicTypeNameByDicCode(type));
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// // 获取资料类型名称
|
||||
// String fieldName = field.getName().substring(0, 1).toUpperCase() + field.getName().substring(1);
|
||||
// Method method = SarLawsInformation.class.getMethod("get" + fieldName + "Name");
|
||||
// Object oldTypeName = method.invoke(oldInfo);
|
||||
// ApiModelProperty annotationsByType = field.getAnnotationsByType(ApiModelProperty.class)[0];
|
||||
// changes.add(annotationsByType.value() + "由\"" + oldTypeName + "\"改为\"" + String.join(",", typeNameList) + "\"");
|
||||
// break;
|
||||
// }
|
||||
case "informationFile": {
|
||||
List<String> fileNameList = new ArrayList<>();
|
||||
if (StringUtils.isNotBlank(newValue)) {
|
||||
String[] split = newValue.split(",");
|
||||
for (String attId : split) {
|
||||
AttFileEO fileInfo = attFileEOService.getFileInfo(attId);
|
||||
fileNameList.add(fileInfo.getOldFileName());
|
||||
}
|
||||
}
|
||||
}
|
||||
// 获取资料类型名称
|
||||
String fieldName = field.getName().substring(0, 1).toUpperCase() + field.getName().substring(1);
|
||||
Method method = SarLawsInformation.class.getMethod("get" + fieldName + "Name");
|
||||
Object oldTypeName = method.invoke(oldInfo);
|
||||
ApiModelProperty annotationsByType = field.getAnnotationsByType(ApiModelProperty.class)[0];
|
||||
changes.add(annotationsByType.value() + "由\"" + oldTypeName + "\"改为\"" + String.join(",",typeNameList) + "\"");
|
||||
} else if ("informationFile".equals(field.getName())) {
|
||||
List<String> fileNameList = new ArrayList<>();
|
||||
if (StringUtils.isNotBlank(newValue)) {
|
||||
String[] split = newValue.split(",");
|
||||
for (String attId : split) {
|
||||
AttFileEO fileInfo = attFileEOService.getFileInfo(attId);
|
||||
fileNameList.add(fileInfo.getOldFileName());
|
||||
// 获取资料类型名称
|
||||
String fieldName = field.getName().substring(0, 1).toUpperCase() + field.getName().substring(1);
|
||||
Method method = SarLawsInformation.class.getMethod("get" + fieldName + "List");
|
||||
List<?> oldFileList = (List) method.invoke(oldInfo);
|
||||
List<String> oldFileNameList = new ArrayList<>();
|
||||
if (oldFileList != null && oldFileList.size() > 0) {
|
||||
for (Object oldFile : oldFileList) {
|
||||
AttFileEO oldFile1 = (AttFileEO) oldFile;
|
||||
oldFileNameList.add(oldFile1.getOldFileName());
|
||||
}
|
||||
}
|
||||
// 获取字段名称
|
||||
ApiModelProperty annotationsByType = field.getAnnotationsByType(ApiModelProperty.class)[0];
|
||||
changes.add(annotationsByType.value() + "由\"" + String.join(",", oldFileNameList) + "\"改为\"" + String.join(",", fileNameList) + "\"");
|
||||
break;
|
||||
}
|
||||
// 获取资料类型名称
|
||||
String fieldName = field.getName().substring(0, 1).toUpperCase() + field.getName().substring(1);
|
||||
Method method = SarLawsInformation.class.getMethod("get" + fieldName + "Name");
|
||||
List<?> oldFileList = (List)method.invoke(oldInfo);
|
||||
List<String> oldFileNameList = new ArrayList<>();
|
||||
if (oldFileList != null && oldFileList.size() > 0) {
|
||||
for (Object oldFile : oldFileList) {
|
||||
AttFileEO oldFile1 = (AttFileEO) oldFile;
|
||||
oldFileNameList.add(oldFile1.getOldFileName());
|
||||
}
|
||||
default: {
|
||||
ApiModelProperty annotationsByType = field.getAnnotationsByType(ApiModelProperty.class)[0];
|
||||
changes.add(annotationsByType.value() + "由\"" + oldValue + "\"改为\"" + newValue + "\"");
|
||||
break;
|
||||
}
|
||||
// 获取字段名称
|
||||
ApiModelProperty annotationsByType = field.getAnnotationsByType(ApiModelProperty.class)[0];
|
||||
changes.add(annotationsByType.value() + "由\"" + String.join(",",oldFileNameList) + "\"改为\"" + String.join(",",fileNameList) + "\"");
|
||||
}
|
||||
else {
|
||||
ApiModelProperty annotationsByType = field.getAnnotationsByType(ApiModelProperty.class)[0];
|
||||
changes.add(annotationsByType.value() + "由\"" + oldValue + "\"改为\"" + newValue + "\"");
|
||||
}
|
||||
}
|
||||
} catch (IllegalAccessException | NoSuchMethodException | InvocationTargetException e) {
|
||||
@@ -509,6 +683,21 @@ public class SarLawsInformationServiceImpl extends ServiceImpl<SarLawsInformatio
|
||||
}
|
||||
return resultlist;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取括号内的内容转换成列表
|
||||
* @param input 类似于 张兰英(zhanglanying),管理员(admin) 的字符串
|
||||
* @return 括号内内容的List
|
||||
*/
|
||||
private static List<String> extractContentInParentheses(String input) {
|
||||
List<String> results = new ArrayList<>();
|
||||
Pattern pattern = Pattern.compile("\\(([^)]+)\\)");
|
||||
Matcher matcher = pattern.matcher(input);
|
||||
while (matcher.find()) {
|
||||
results.add(matcher.group(1));
|
||||
}
|
||||
return results;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
+2
@@ -22,4 +22,6 @@ public interface SarLawsInformationCenterTreeService extends IService<SarLawsInf
|
||||
List<SarLawsInformationCenterTreeData> getTree();
|
||||
|
||||
boolean updateTreeNode(SarLawsInformationCenterTree informationCenterTree);
|
||||
|
||||
void querySubordinateTreeNode(List<String> treeNodeIdList, String treeNodeId);
|
||||
}
|
||||
|
||||
+14
@@ -101,6 +101,20 @@ public class SarLawsInformationCenterTreeServiceImpl extends ServiceImpl<SarLaws
|
||||
return updated > 0;
|
||||
}
|
||||
|
||||
// 递归查询所有子节点
|
||||
@Override
|
||||
public void querySubordinateTreeNode(List<String> treeNodeIdList, String treeNodeId) {
|
||||
treeNodeIdList.add(treeNodeId);
|
||||
LambdaQueryWrapper<SarLawsInformationCenterTree> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(SarLawsInformationCenterTree::getParentId, treeNodeId);
|
||||
List<SarLawsInformationCenterTree> list = list(wrapper);
|
||||
if (list.size()>0) {
|
||||
for (SarLawsInformationCenterTree sarLawsInformationCenterTree : list) {
|
||||
querySubordinateTreeNode(treeNodeIdList,sarLawsInformationCenterTree.getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public void setResource(SarLawsInformationCenterTree informationCenterTree) {
|
||||
|
||||
+8
-8
@@ -76,24 +76,24 @@ public class SarLawsTopicController extends BaseController<SarLawsTopicVO> {
|
||||
|
||||
@ApiOperation(value = "新增政策课题")
|
||||
@PostMapping(value = "/addLawsTopic", consumes = "application/json;charset=UTF-8")
|
||||
public ResponseMessage<?> create(@RequestBody SarLawsTopic lawsTopic) throws Exception {
|
||||
public ResponseMessage<?> addLawsTopic(@RequestBody SarLawsTopic lawsTopic) throws Exception {
|
||||
lawsTopicService.addLawsTopicInfo(lawsTopic);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@ApiOperation("根据会议ID删除会议")
|
||||
@ApiOperation("根据政策课题id删除课题")
|
||||
@DeleteMapping("/deleteLawsTopicById")
|
||||
public ResponseMessage<?> deleteMeeting(String lawsTopicId) {
|
||||
if (StringUtils.isBlank(lawsTopicId)) {
|
||||
public ResponseMessage<?> deleteLawsTopicById(String id) {
|
||||
if (StringUtils.isBlank(id)) {
|
||||
return Result.error("删除失败,政策课题ID为空");
|
||||
}
|
||||
lawsTopicService.deleteLawsTopicInfo(lawsTopicId);
|
||||
lawsTopicService.deleteLawsTopicInfo(id);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@ApiOperation("根据会议ID修改会议信息")
|
||||
@ApiOperation("根据政策课题ID修改课题信息")
|
||||
@PutMapping("/updateLawsTopicInfo")
|
||||
public ResponseMessage<?> updateMeetingInfo(@RequestBody SarLawsTopic lawsTopic) {
|
||||
public ResponseMessage<?> updateLawsTopicInfo(@RequestBody SarLawsTopic lawsTopic) {
|
||||
if (ObjectUtils.isEmpty(lawsTopic)) {
|
||||
return Result.error("更新失败,政策课题信息不存在");
|
||||
}
|
||||
@@ -178,7 +178,7 @@ public class SarLawsTopicController extends BaseController<SarLawsTopicVO> {
|
||||
HSSFCellStyle cellStyle1 = workbook.createCellStyle();
|
||||
cellStyle1.setAlignment(HorizontalAlignment.CENTER);
|
||||
cellStyle1.setVerticalAlignment(VerticalAlignment.CENTER);
|
||||
String exportFieldName = "课题名称,课题承办单位,课题指导单位,课题参与单位,开始时间,结题时间,课题费用(万元)";
|
||||
String exportFieldName = "课题名称,课题承办单位,课题指导单位,课题参与单位,启动时间,结题时间,课题费用(万元)";
|
||||
String[] headerArr = exportFieldName.split(",");
|
||||
for (int i=0;i < headerArr.length; i++) {
|
||||
Cell cell = rowHeader.createCell(i);
|
||||
|
||||
@@ -17,7 +17,7 @@ import java.util.List;
|
||||
@Mapper
|
||||
public interface SarLawsTopicMapper extends BaseMapper<SarLawsTopic> {
|
||||
|
||||
Integer queryByPageCount(SarLawsTopicVO page);
|
||||
List<Integer> queryByPageCount(SarLawsTopicVO page);
|
||||
|
||||
List<SarLawsTopicVO> queryByPage(SarLawsTopicVO page);
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ public class SarLawsTopic implements Serializable {
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
@ApiModelProperty(value = "开始时间")
|
||||
@ApiModelProperty(value = "启动时间")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@TableField(value = "START_TIME")
|
||||
private Date startTime;
|
||||
|
||||
@@ -56,7 +56,7 @@ public class SarLawsTopicVO extends BasePage {
|
||||
*/
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "开始时间", orderNum = "4", exportFormat = "yyyy-MM-dd", needMerge = true)
|
||||
@Excel(name = "启动时间", orderNum = "4", exportFormat = "yyyy-MM-dd", needMerge = true)
|
||||
private Date startTime;
|
||||
|
||||
/**
|
||||
@@ -238,8 +238,9 @@ public class SarLawsTopicVO extends BasePage {
|
||||
|
||||
private String sortMode = "asc";
|
||||
|
||||
private String startTimeOperator = "=";
|
||||
private String closeTimeOperator = "=";
|
||||
// 排序字段
|
||||
private Date startTimeBegin;
|
||||
private Date startTimeEnd;
|
||||
|
||||
// 导出使用的属性
|
||||
// 导出文件名
|
||||
|
||||
+22
-6
@@ -217,7 +217,7 @@ public class SarLawsTopicServiceImpl extends ServiceImpl<SarLawsTopicMapper, Sar
|
||||
page.setSortField("ID");
|
||||
page.setSortMode("asc");
|
||||
}
|
||||
Integer rowCount = this.baseMapper.queryByPageCount(page);
|
||||
int rowCount = this.baseMapper.queryByPageCount(page).size();
|
||||
page.getPager().setRowCount(rowCount);
|
||||
List<SarLawsTopicVO> sarLawsTopicVOList = this.baseMapper.queryByPage(page);
|
||||
for (SarLawsTopicVO lawsTopicVO : sarLawsTopicVOList) {
|
||||
@@ -414,14 +414,16 @@ public class SarLawsTopicServiceImpl extends ServiceImpl<SarLawsTopicMapper, Sar
|
||||
if (!ignoreFieldList.contains(field.getName())) {
|
||||
try {
|
||||
field.setAccessible(true);
|
||||
String oldValue = String.valueOf(field.get(oldLawsTopic));
|
||||
String newValue = String.valueOf(field.get(newLawsTopic));
|
||||
Object oldValue = field.get(oldLawsTopic);
|
||||
Object newValue = field.get(newLawsTopic);
|
||||
if (!Objects.equals(oldValue, newValue)) {
|
||||
// 对比文件字段
|
||||
if (fileAttIdFieldList.contains(field.getName())) {
|
||||
String oldValueStr = String.valueOf(oldValue);
|
||||
String newValueStr = String.valueOf(newValue);
|
||||
List<String> fileNameList = new ArrayList<>();
|
||||
if (StringUtils.isNotBlank(newValue)) {
|
||||
String[] split = newValue.split(",");
|
||||
if (StringUtils.isNotBlank(newValueStr)) {
|
||||
String[] split = newValueStr.split(",");
|
||||
for (String attId : split) {
|
||||
AttFileEO fileInfo = attFileEOService.getFileInfo(attId);
|
||||
fileNameList.add(fileInfo.getOldFileName());
|
||||
@@ -447,7 +449,21 @@ public class SarLawsTopicServiceImpl extends ServiceImpl<SarLawsTopicMapper, Sar
|
||||
|| "insideContactInformationList".equals(field.getName())) {
|
||||
ApiModelProperty annotationsByType = field.getAnnotationsByType(ApiModelProperty.class)[0];
|
||||
changes.add(annotationsByType.value() + "被变更");
|
||||
} else {
|
||||
} else if ("startTime".equals(field.getName()) || "closeTime".equals(field.getName())) {
|
||||
ApiModelProperty annotationsByType = field.getAnnotationsByType(ApiModelProperty.class)[0];
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
String oldDateStr = null;
|
||||
String newDateStr = null;
|
||||
if (newValue != null) {
|
||||
Date oldDate = (Date) newValue;
|
||||
oldDateStr = sdf.format(oldDate);
|
||||
}
|
||||
if (oldValue!= null) {
|
||||
Date newDate = (Date) oldValue;
|
||||
newDateStr = sdf.format(newDate);
|
||||
}
|
||||
changes.add(annotationsByType.value() + "由\"" + oldDateStr + "\"改为\"" + newDateStr + "\"");
|
||||
}else {
|
||||
// 对比其他字段
|
||||
ApiModelProperty annotationsByType = field.getAnnotationsByType(ApiModelProperty.class)[0];
|
||||
changes.add(annotationsByType.value() + "由\"" + oldValue + "\"改为\"" + newValue + "\"");
|
||||
|
||||
@@ -33,8 +33,11 @@ public class BussStandExportUtil {
|
||||
Map<String,String> attrInfoMap = new HashMap<>();
|
||||
for (SarStandAttrDetails detailsEO : detailsEOList) {
|
||||
if (!InitStandAttrUtil.fileFieldListBuss.contains(detailsEO.getAttrField())) {
|
||||
attrBud.append(detailsEO.getAttrName() + ",");
|
||||
attrInfoMap.put(detailsEO.getAttrName(),detailsEO.getAttrField());
|
||||
if ("关联流程".equals(detailsEO.getAttrName())) {
|
||||
continue;
|
||||
}
|
||||
attrBud.append(detailsEO.getAttrName() + ",");
|
||||
}
|
||||
}
|
||||
String header = FieldConvertUtil.exportBaseFieldNamesBuss + "," + attrBud.toString();
|
||||
|
||||
@@ -33,9 +33,15 @@ public class FieldConvertUtil {
|
||||
public static String exportBaseFieldNames = "标准体系,是否纳入认证清单,标准性质,标准类别,标准编号,标准年份,中文名称,英文名称," +
|
||||
"文本状态,发布日期"; // 导出基础表字段 //删除 实施日期 2021-05-28
|
||||
|
||||
public static String exportBaseFieldNewNames = "标准编号,中文名称,英文名称,标准体系," +
|
||||
"文本状态,发布日期,标准性质"; // 导出基础表字段 // 删除是否纳入认证清单,删除 标准类别 标准编号 标准年份 ,统一为标准编号 2023-11-13
|
||||
|
||||
public static String exportBaseFieldNamesForeign = "标准类别,标准编号,标准年份,中文名称,英文名称," +
|
||||
"文本状态,发布日期,是否纳入认证清单,标准体系,适用认证,能源类型";// 导出基础表字段
|
||||
|
||||
public static String exportBaseFieldNamesNewForeign = "标准编号,中文名称,英文名称," +
|
||||
"文本状态,发布日期,是否纳入认证清单,标准体系,适用认证,能源类型";// 导出基础表字段 //删除 标准类别 标准编号 标准年份 ,统一为标准编号 2023-11-13
|
||||
|
||||
public static String exportAttrFieldNamesInland = "归口管理部门,发布机构,工作组信息,我司参与深度,适用车辆类型,要求类型," +
|
||||
"标签,发布稿(必读),增补件(必读),报批稿,送审稿,征求意见稿,草案,相关资料,新车型实施日期(文本),在产车实施日期(文本)," +
|
||||
"EOP实施日期(文本),责任部门,相关部门,SVPPS,FO,项目评估角色,法规维护人,代替标准编号," +
|
||||
@@ -64,7 +70,7 @@ public class FieldConvertUtil {
|
||||
public static String exportFieldNamesMeetingTopic = "议题名称,汇报人,汇报单位,议题主要内容";
|
||||
|
||||
// 政策法规资料 表头
|
||||
public static String exportFieldLawsInformation = "一级资料类别,二级资料类别,三级资料类别,四级资料类别,资料名称,资料归属部门,作者,资料说明";
|
||||
public static String exportFieldLawsInformation = "1级资料分类,2级资料分类,3级资料分类,4级资料分类,资料名称,资料归属部门,作者,资料说明";
|
||||
|
||||
// 政策课题 表头
|
||||
public static String exportFieldLawsTopic = "课题名称,课题承办单位,课题指导单位,课题参与单位,开始时间,结题时间,课题费用(万元),课题组会议列表,课题组联系方式,内部联系方式";
|
||||
|
||||
@@ -39,17 +39,21 @@ public class StandExportUtil {
|
||||
}
|
||||
for (SarStandAttrDetails detailsEO : detailsEOList) {
|
||||
if (!InitStandAttrUtil.fileFieldList.contains(detailsEO.getAttrField())) {
|
||||
attrBud.append(detailsEO.getAttrName() + ",");
|
||||
attrInfoMap.put(detailsEO.getAttrName(),detailsEO.getAttrField());
|
||||
// 去掉 参会记录 和 相关流程 两个导出字段 2023-11-13
|
||||
if("参会记录".equals(detailsEO.getAttrName()) || "相关流程".equals(detailsEO.getAttrName())) {
|
||||
continue;
|
||||
}
|
||||
attrBud.append(detailsEO.getAttrName() + ",");
|
||||
}
|
||||
}
|
||||
String header = FieldConvertUtil.exportBaseFieldNames + "," + attrBud.toString();
|
||||
String header = FieldConvertUtil.exportBaseFieldNewNames + "," + attrBud.toString();
|
||||
//国内导出去掉体系类别
|
||||
if (SarTypeEnum.INLAND_STAND.getValue().equals(standType)) {
|
||||
header = header.replace(",体系类别","");
|
||||
}
|
||||
if (SarTypeEnum.FOREIGN_STAND.getValue().equals(standType)) {
|
||||
header = FieldConvertUtil.exportBaseFieldNamesForeign + "," + attrBud.toString();
|
||||
header = FieldConvertUtil.exportBaseFieldNamesNewForeign + "," + attrBud.toString();
|
||||
}
|
||||
//创建工作表对象
|
||||
Sheet sheet = workbook.createSheet();
|
||||
@@ -125,9 +129,9 @@ public class StandExportUtil {
|
||||
case "适用区域":
|
||||
value = verifyBean(sarStandardsInfoEO.getCountryShow());
|
||||
break;
|
||||
case "标准类别":
|
||||
value = verifyBean(sarStandardsInfoEO.getStandSortShow());
|
||||
break;
|
||||
// case "标准类别":
|
||||
// value = verifyBean(sarStandardsInfoEO.getStandSortShow());
|
||||
// break;
|
||||
case "重要度":
|
||||
if (StringUtils.isNotBlank(sarStandardsInfoEO.getIsRelateAccess())) {
|
||||
if ("1".equals(sarStandardsInfoEO.getIsRelateAccess())) {
|
||||
@@ -138,11 +142,14 @@ public class StandExportUtil {
|
||||
}
|
||||
value = sarStandardsInfoEO.getIsRelateAccess();
|
||||
break;
|
||||
// case "标准编号":
|
||||
// value = verifyBean(sarStandardsInfoEO.getStandNumber());
|
||||
// break;
|
||||
// case "标准年份":
|
||||
// value = verifyBean(sarStandardsInfoEO.getStandYear());
|
||||
// break;
|
||||
case "标准编号":
|
||||
value = verifyBean(sarStandardsInfoEO.getStandNumber());
|
||||
break;
|
||||
case "标准年份":
|
||||
value = verifyBean(sarStandardsInfoEO.getStandYear());
|
||||
value = sarStandardsInfoEO.getStandCode();
|
||||
break;
|
||||
case "中文名称":
|
||||
value = verifyBean(sarStandardsInfoEO.getStandName());
|
||||
|
||||
+4
-3
@@ -50,8 +50,8 @@
|
||||
<if test="meetingOrganizer != null and meetingOrganizer != ''" >
|
||||
and MEETING_ORGANIZER like concat('%',#{meetingOrganizer},'%')
|
||||
</if>
|
||||
<if test="meetingTime != null and meetingTime !=''">
|
||||
and MEETING_TIME ${meetingTimeOperator} #{meetingTime}
|
||||
<if test="meetingTimeBegin != null and meetingTimeEnd != null">
|
||||
and MEETING_TIME between #{meetingTimeBegin} and #{meetingTimeEnd}
|
||||
</if>
|
||||
<if test="meetingAddress != null and meetingAddress != ''" >
|
||||
and MEETING_ADDRESS like concat('%',#{meetingAddress},'%')
|
||||
@@ -88,10 +88,11 @@
|
||||
</if>
|
||||
</sql>
|
||||
<select id="queryByPageCount" resultType="java.lang.Integer">
|
||||
select count(1) from inside_outside_meeting iom join meeting_topic mt on iom.ID = mt.MEETING_ID
|
||||
select count(iom.ID) from inside_outside_meeting iom join meeting_topic mt on iom.ID = mt.MEETING_ID
|
||||
where iom.VALID_FLAG = 0
|
||||
<include refid="Base_Where_Clause"/>
|
||||
<include refid="MeetingTopic_where" />
|
||||
group by iom.ID
|
||||
</select>
|
||||
<select id="queryByPage" resultMap="BaseResultMap" parameterType="com.adc.da.slrs.InsideOntSideMeeting.entity.InsideOutsideMeetingVO">
|
||||
select <include refid="Base_Column_Join_MeetingTopic_List" />
|
||||
|
||||
+21
-10
@@ -20,10 +20,8 @@
|
||||
<result property="uploadTime" column="UPLOAD_TIME" jdbcType="TIMESTAMP"/>
|
||||
<result property="description" column="DESCRIPTION" jdbcType="VARCHAR"/>
|
||||
<result property="informationFile" column="INFORMATION_FILE" jdbcType="VARCHAR"/>
|
||||
<result property="viewableBy" column="VIEWABLE_BY" jdbcType="VARCHAR"/>
|
||||
<result property="downloadableBy" column="DOWNLOADABLE_BY" jdbcType="VARCHAR"/>
|
||||
<result property="treeNodeId" column="TREE_NODE_ID" jdbcType="VARCHAR"/>
|
||||
<result property="viewableBy" column="VALID_FLAG" jdbcType="TINYINT"/>
|
||||
<result property="validFlag" column="VALID_FLAG" jdbcType="TINYINT"/>
|
||||
<result property="createTime" column="CREATE_TIME" jdbcType="TIMESTAMP"/>
|
||||
<result property="modifyTime" column="MODIFY_TIME" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
@@ -35,9 +33,13 @@
|
||||
THIRD_TYPE,
|
||||
FOURTH_TYPE,
|
||||
`NAME`,
|
||||
DEPARTMENT,AUTHOR,UPLOAD_TIME,
|
||||
`DESCRIPTION`,INFORMATION_FILE,VIEWABLE_BY,
|
||||
DOWNLOADABLE_BY,VALID_FLAG,CREATE_TIME,
|
||||
DEPARTMENT,
|
||||
AUTHOR,
|
||||
UPLOAD_TIME,
|
||||
`DESCRIPTION`,
|
||||
INFORMATION_FILE,
|
||||
VALID_FLAG,
|
||||
CREATE_TIME,
|
||||
MODIFY_TIME
|
||||
</sql>
|
||||
<sql id="Base_Where_Clause">
|
||||
@@ -50,11 +52,20 @@
|
||||
<if test="name != null and name != ''">
|
||||
and `NAME` like concat('%',#{name},'%')
|
||||
</if>
|
||||
<if test="uploadTime != null">
|
||||
and UPLOAD_TIME = #{uploadTime}
|
||||
<if test="uploadTimeBegin != null and uploadTimeEnd != null">
|
||||
and UPLOAD_TIME between DATE_FORMAT(#{uploadTimeBegin}, '%Y-%m-%d') and DATE_FORMAT(${uploadTimeEnd}, '%Y-%m-%d')
|
||||
</if>
|
||||
<if test="treeNodeId != null and treeNodeId != ''">
|
||||
and TREE_NODE_ID = #{treeNodeId}
|
||||
<if test="treeNodeIdList != null and treeNodeIdList.size() > 0">
|
||||
and TREE_NODE_ID in
|
||||
<foreach collection="treeNodeIdList" item="treeNodeId" index="index" separator="," open="(" close=")">
|
||||
#{treeNodeId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="informationIdList != null and informationIdList.size() > 0">
|
||||
and ID in
|
||||
<foreach collection="informationIdList" item="informationId" index="index" separator="," open="(" close=")">
|
||||
#{informationId}
|
||||
</foreach>
|
||||
</if>
|
||||
</sql>
|
||||
<select id="queryByPageCount" resultType="java.lang.Integer">
|
||||
|
||||
@@ -114,11 +114,8 @@
|
||||
<if test="participatingUnit != null and participatingUnit != ''" >
|
||||
and PARTICIPATING_UNIT like concat('%',#{participatingUnit},'%')
|
||||
</if>
|
||||
<if test="startTime != null">
|
||||
and START_TIME ${startTimeOperator} #{startTime}
|
||||
</if>
|
||||
<if test="closeTime != null">
|
||||
and CLOSE_TIME ${startTimeOperator} #{closeTime}
|
||||
<if test="startTimeBegin != null and startTimeEnd != null">
|
||||
and START_TIME between #{startTimeBegin} and ${startTimeEnd}
|
||||
</if>
|
||||
<if test="topicStatus != null and topicStatus != ''" >
|
||||
and TOPIC_STATUS = #{topicStatus}
|
||||
@@ -185,13 +182,14 @@
|
||||
</sql>
|
||||
|
||||
<select id="queryByPageCount" resultType="java.lang.Integer">
|
||||
select count(1) from sar_laws_topic slt left join sar_laws_topic_meeting sltm on slt.ID = sltm.LAWS_TOPIC_ID
|
||||
select count(slt.ID) from sar_laws_topic slt left join sar_laws_topic_meeting sltm on slt.ID = sltm.LAWS_TOPIC_ID
|
||||
left join sar_laws_contact_information slci1 on slt.ID = slci1.LAWS_TOPIC_ID and slci1.GROUP_TYPE = 'topicGroup'
|
||||
left join sar_laws_contact_information slci2 on slt.ID = slci2.LAWS_TOPIC_ID and slci2.GROUP_TYPE = 'inside'
|
||||
where slt.VALID_FLAG = 0
|
||||
<include refid="Base_Where_Clause"/>
|
||||
<include refid="TopicMeeting_where" />
|
||||
<include refid="ContactInformation_where" />
|
||||
group by slt.ID
|
||||
</select>
|
||||
<select id="queryByPage" resultMap="BaseResultMap">
|
||||
select <include refid="Base_Join_Column_List" />
|
||||
|
||||
+2
@@ -44,6 +44,7 @@
|
||||
<result column="stand_name" property="standName"/>
|
||||
<result column="stand_year" property="standYear"/>
|
||||
<result column="stand_number" property="standNumber"/>
|
||||
<result property="standCode" column="standCode" />
|
||||
<result column="id" property="id"/>
|
||||
</resultMap>
|
||||
|
||||
@@ -115,6 +116,7 @@
|
||||
SAR_STANDARDS_INFO.stand_sort,
|
||||
SAR_STANDARDS_INFO.stand_number,
|
||||
SAR_STANDARDS_INFO.stand_year,
|
||||
concat(COALESCE(SAR_STANDARDS_INFO.stand_sort, ''), ' ', COALESCE(SAR_STANDARDS_INFO.stand_number, ''), '-' , COALESCE(SAR_STANDARDS_INFO.stand_year, '')) as standCode,
|
||||
SAR_STANDARDS_INFO.stand_name,
|
||||
SAR_STANDARDS_INFO.stand_en_name,
|
||||
SAR_STANDARDS_INFO.stand_state,
|
||||
|
||||
Reference in New Issue
Block a user