Merge branch 'fix_foton_20231031' into 'dev_20231101_TXSS'
Fix foton 20231031 See merge request laws-foton-slrs/foton-slrs-system-rest!133
This commit is contained in:
@@ -509,4 +509,14 @@ public interface workFlowFeignClient {
|
||||
|
||||
@RequestMapping(value = "/bat-wkflow/datas/bus-process-new/fushen",method = RequestMethod.GET)
|
||||
String fushen();
|
||||
|
||||
@RequestMapping(value = "/bat-wkflow/datas/policySolicitOpinion/queryPolicitOpinionEOList",method = RequestMethod.GET)
|
||||
ResponseMessage<List<PolicySolicitOpinionEO>> queryPolicitOpinionEOList(@RequestParam Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* 查询重点认证标准/政策合规性项目审查任务明细
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/bat-wkflow/queryZchgxxmscTaskDetail",method = RequestMethod.GET)
|
||||
BusProcessNew queryZchgxxmscTaskDetail(@RequestParam Map<String, Object> params);
|
||||
}
|
||||
|
||||
@@ -479,4 +479,12 @@ public class workFlowFeignClientImpl {
|
||||
public String fushen() {
|
||||
return workFlowFeignClient.fushen();
|
||||
}
|
||||
|
||||
public ResponseMessage<List<PolicySolicitOpinionEO>> queryPolicitOpinionEOList(@RequestParam Map<String, Object> params) {
|
||||
return this.workFlowFeignClient.queryPolicitOpinionEOList(params);
|
||||
}
|
||||
|
||||
public BusProcessNew queryZchgxxmscTaskDetail(@RequestParam Map<String, Object> params){
|
||||
return workFlowFeignClient.queryZchgxxmscTaskDetail(params);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,6 +63,18 @@ public class ActDefineStartMap {
|
||||
map.put("27","wdzxlc");
|
||||
// 标准需求(翻译)申请流程
|
||||
map.put("28","bzxqfy");
|
||||
// 内外部会议入库流程
|
||||
map.put("29","insideOutsideMeetingLibrary");
|
||||
// 政策课题入会流程
|
||||
map.put("30","policyResearchGroupEnrollment");
|
||||
// 政策课题参会流程
|
||||
map.put("31","policyResearchGroupAttendMeeting");
|
||||
// 政策法规资料入库流程
|
||||
map.put("32","PolicyLawsInformationLibrary");
|
||||
// 政策征求意见流程
|
||||
map.put("33","PolicySolicitOpinionProcessWorkFlow");
|
||||
// 重点认证标准/政策合规性项目审查流程
|
||||
map.put("34","PolicyComplianceProgramReviewProcessWorkFlow");
|
||||
|
||||
return map.get(type);
|
||||
}
|
||||
|
||||
@@ -58,4 +58,6 @@ public class BusProcessName implements Serializable {
|
||||
private String taskBackAssignee;
|
||||
|
||||
private boolean showreceive;
|
||||
|
||||
private String taskDefinitionKey;
|
||||
}
|
||||
|
||||
@@ -92,4 +92,8 @@ public class BusProcessNew {
|
||||
@ApiModelProperty(value = "当前节点信息")
|
||||
private String nowTaskInfo;
|
||||
|
||||
@TableField("RECEIVE_STATUS")
|
||||
@ApiModelProperty("接收状态")
|
||||
private String receiveStatus;
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,108 @@
|
||||
package com.adc.da.common;
|
||||
|
||||
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||
import com.adc.da.att.entity.AttFileEO;
|
||||
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.ApiModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 政策征求意见列表
|
||||
* @author: wangzhijiang
|
||||
* @date: 2023-10-18
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value="PolicySolicitOpinion对象", description="")
|
||||
public class PolicySolicitOpinionEO {
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
@TableId(value = "ID", type = IdType.UUID)
|
||||
private String id;
|
||||
|
||||
@TableField("PRC_ID")
|
||||
private String prcId;
|
||||
|
||||
@TableField("SAR_LAWS_INFO_ID")
|
||||
private String sarLawsInfoId;
|
||||
|
||||
// 章节编号
|
||||
@Excel(name = "章节编号", orderNum = "1")
|
||||
@TableField("CHAPTER_NUMBER")
|
||||
private String chapterNumber;
|
||||
|
||||
// 章节条目
|
||||
@Excel(name = "章节条目", orderNum = "2")
|
||||
@TableField("CHAPTER_ENTRIES")
|
||||
private String chapterEntries;
|
||||
|
||||
// 修改前
|
||||
@Excel(name = "修改前", orderNum = "3")
|
||||
@TableField("MODIFY_BEFORE")
|
||||
private String modifyBefore;
|
||||
|
||||
// 修改后
|
||||
@Excel(name = "修改后", orderNum = "4")
|
||||
@TableField("MODIFY_AFTER")
|
||||
private String modifyAfter;
|
||||
|
||||
// 修改理由
|
||||
@Excel(name = "修改理由", orderNum = "5")
|
||||
@TableField("MODIFY_REASON")
|
||||
private String modifyReason;
|
||||
|
||||
// 原因
|
||||
@Excel(name = "原因", orderNum = "6")
|
||||
@TableField("CAUSE")
|
||||
private String cause;
|
||||
|
||||
// 附件id
|
||||
@TableField("ANNEX_FILE_ID")
|
||||
private String annexFileId;
|
||||
@Excel(name = "附件", orderNum = "7")
|
||||
private String annexFileName;
|
||||
private List<AttFileEO> annexFileList;
|
||||
|
||||
// 处理意见
|
||||
@Excel(name = "处理意见", orderNum = "10")
|
||||
@TableField("HANDLING_OPINIONS")
|
||||
private String handlingOpinions;
|
||||
|
||||
// 处理原因
|
||||
@Excel(name = "处理原因", orderNum = "11")
|
||||
@TableField("HANDLING_CAUSE")
|
||||
private String handlingCause;
|
||||
|
||||
// 提出人/创建人/责任人
|
||||
@TableField("CREATE_USER_ID")
|
||||
private String createUserId;
|
||||
|
||||
// 提出人/创建人/责任人
|
||||
@Excel(name = "提出人", orderNum = "9")
|
||||
private String createUserName;
|
||||
// 提出部门/创建人所在部门
|
||||
@Excel(name = "提出部门", orderNum = "8")
|
||||
private String createUserDeptName;
|
||||
|
||||
// 创建时间
|
||||
@TableField("CREATE_TIME")
|
||||
private Date createTime;
|
||||
|
||||
// 更新人
|
||||
@TableField("MODIFY_USER_ID")
|
||||
private String modifyUserId;
|
||||
|
||||
// 更新时间
|
||||
@TableField("MODIFY_TIME")
|
||||
private Date modifyTime;
|
||||
|
||||
}
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
package com.adc.da.workFlow.controller;
|
||||
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.workFlow.service.ActSarItemMeetingEOService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* @author tjzdw
|
||||
* @description
|
||||
* @date 2023/10/16
|
||||
*/
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/${restPath}/lawss/meeting")
|
||||
@Api(description = "|InsideOutsideMeeting|")
|
||||
public class ActSarItemMeetingEOController {
|
||||
|
||||
@Resource
|
||||
private ActSarItemMeetingEOService meetingEOService;
|
||||
|
||||
|
||||
@ApiOperation(value = "|SarLawsStandInfo|内外部会议入库")
|
||||
@PostMapping("/processCreateMeeting")
|
||||
public ResponseMessage<String> processCreateMeeting(String infoJson) throws Exception {
|
||||
if (StringUtils.isBlank(infoJson)) {
|
||||
return Result.error("传入数据json不能为空");
|
||||
}
|
||||
meetingEOService.processCreateMeeting(infoJson);
|
||||
return Result.success("入库成功");
|
||||
}
|
||||
}
|
||||
-6
@@ -66,12 +66,6 @@ public class ActSarItemsBussEOController extends BaseController<ActSarItemsEO> {
|
||||
}
|
||||
Object issueTime = jsonObject.get("issueTime");
|
||||
Object standSort = jsonObject.get("standSort");
|
||||
// 如果是企标制修定流程 类别是修改则不修改 发布日期
|
||||
String reviseStatus = jsonObject.getString("reviseStatus");
|
||||
if ("buss1_3".equals(reviseStatus)) {
|
||||
issueTime = null;
|
||||
jsonObject.put("issueTime",null);
|
||||
}
|
||||
if(issueTime!=null && standSort!=null){
|
||||
String issueTimeStr =issueTime.toString();
|
||||
String standSortStr = standSort.toString();
|
||||
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
package com.adc.da.workFlow.controller;
|
||||
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.workFlow.service.ActSarLawsInformationEOService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* @author tjzdw
|
||||
* @description
|
||||
* @date 2023/10/27
|
||||
*/
|
||||
@Api("政策法规资料")
|
||||
@RestController
|
||||
@RequestMapping("/${restPath}/lawss/sarLawsTopic")
|
||||
public class ActSarLawsInformationEOController {
|
||||
|
||||
@Resource
|
||||
private ActSarLawsInformationEOService informationEOService;
|
||||
|
||||
@ApiOperation("政策法规资料入库")
|
||||
@PostMapping("/processLawsRegulatoryInformation")
|
||||
public ResponseMessage<String> processCreateLawsInformation(String infoJson) throws Exception {
|
||||
if (StringUtils.isBlank(infoJson)) {
|
||||
return Result.error("传入数据json不能为空");
|
||||
}
|
||||
informationEOService.processCreateLawsInformation(infoJson);
|
||||
return Result.success("入库成功");
|
||||
}
|
||||
}
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
package com.adc.da.workFlow.controller;
|
||||
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.workFlow.service.ActSarLawsTopicEOService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* @author tjzdw
|
||||
* @description 政策课题流程
|
||||
* @date 2023/10/25
|
||||
*/
|
||||
|
||||
@Api("政策课题")
|
||||
@RestController
|
||||
@RequestMapping("/${restPath}/lawss/sarLawsTopic")
|
||||
public class ActSarLawsTopicEOController {
|
||||
|
||||
@Resource
|
||||
private ActSarLawsTopicEOService lawsTopicEOService;
|
||||
|
||||
@ApiOperation("政策课题入会")
|
||||
@PostMapping("/processLawsTopicMembership")
|
||||
public ResponseMessage<String> processLawsTopicMembership(String infoJson){
|
||||
if (StringUtils.isBlank(infoJson)) {
|
||||
return Result.error("传入数据json不能为空");
|
||||
}
|
||||
lawsTopicEOService.processLawsTopicMembership(infoJson);
|
||||
return Result.success("入库成功");
|
||||
}
|
||||
|
||||
@ApiOperation("政策课题参会")
|
||||
@PostMapping("/processLawsTopicParticipation")
|
||||
public ResponseMessage<String> processLawsTopicParticipation(String infoJson){
|
||||
if (StringUtils.isBlank(infoJson)) {
|
||||
return Result.error("传入数据json不能为空");
|
||||
}
|
||||
lawsTopicEOService.processLawsTopicParticipation(infoJson);
|
||||
return Result.success("入库成功");
|
||||
}
|
||||
}
|
||||
@@ -41,6 +41,7 @@ import com.adc.da.sys.common.EmailUtils;
|
||||
import com.adc.da.sys.dao.DicTypeEODao;
|
||||
import com.adc.da.sys.entity.DicTypeEO;
|
||||
import com.adc.da.sys.entity.UserEO;
|
||||
import com.adc.da.sys.page.UserEOPage;
|
||||
import com.adc.da.sys.service.IUserEOService;
|
||||
import com.adc.da.util.LoginUserUtil;
|
||||
import com.adc.da.workFlow.entity.*;
|
||||
@@ -49,6 +50,7 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
@@ -1523,4 +1525,104 @@ public class WorkFlowController extends BaseController {
|
||||
public void conversionOnlineFilePDF(){
|
||||
// return workFlowFeignClient.conversionOnlineFilePDF();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查询政策征求意见列表")
|
||||
@GetMapping("/queryPolicitOpinionEOList")
|
||||
public ResponseMessage<List<PolicySolicitOpinionEO>> queryPolicitOpinionEOList(@RequestParam Map<String,Object> params) {
|
||||
String currentUserId = LoginUserUtil.getUserId();
|
||||
params.put("currentUserId", currentUserId);
|
||||
ResponseMessage<List<PolicySolicitOpinionEO>> responseMessage = this.workFlowFeignClient.queryPolicitOpinionEOList(params);
|
||||
List<PolicySolicitOpinionEO> datas = responseMessage.getData();
|
||||
this.disposeData(datas);
|
||||
return responseMessage;
|
||||
}
|
||||
|
||||
public void disposeData(List<PolicySolicitOpinionEO> datas) {
|
||||
if (CollectionUtils.isNotEmpty(datas)) {
|
||||
List<String> userIdList = datas.stream().map(PolicySolicitOpinionEO::getCreateUserId).distinct().collect(Collectors.toList());
|
||||
UserEOPage page = new UserEOPage();
|
||||
page.setUsidList(userIdList);
|
||||
List<UserEO> userEOS = this.userEOService.queryUserEoList(page);
|
||||
|
||||
String annexFileIds = Arrays.asList(
|
||||
datas.stream().map(PolicySolicitOpinionEO::getAnnexFileId).collect(Collectors.joining(",")).split(",")
|
||||
).stream().distinct().collect(Collectors.joining(","));
|
||||
List<AttFileEO> fileInfoList = this.attFileEOService.getMultiFileInfos(annexFileIds);
|
||||
|
||||
for (PolicySolicitOpinionEO data : datas) {
|
||||
List<UserEO> userEOList = userEOS.stream().filter(user -> {
|
||||
return StringUtils.equals(data.getCreateUserId(), user.getUsid());
|
||||
}).distinct().collect(Collectors.toList());
|
||||
if (CollectionUtils.isNotEmpty(userEOList)) {
|
||||
data.setCreateUserName(userEOList.get(0).getUname());
|
||||
data.setCreateUserDeptName(userEOList.get(0).getInstitutionName());
|
||||
}
|
||||
if (StringUtils.isNotEmpty(data.getAnnexFileId())) {
|
||||
List<String> annexFileIdList = Arrays.asList(data.getAnnexFileId().split(","));
|
||||
if (CollectionUtils.isNotEmpty(fileInfoList) && CollectionUtils.isNotEmpty(annexFileIdList)) {
|
||||
List<AttFileEO> annexFileList = fileInfoList.stream().filter(fileInfo -> {
|
||||
boolean flag = false;
|
||||
for (String annexFileId : annexFileIdList) {
|
||||
if (StringUtils.equals(fileInfo.getId(), annexFileId)) {
|
||||
flag = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}).distinct().collect(Collectors.toList());
|
||||
data.setAnnexFileList(annexFileList);
|
||||
|
||||
String annexFileNames = annexFileList.stream().map(AttFileEO::getOldFileName).distinct().collect(Collectors.joining(","));
|
||||
data.setAnnexFileName(annexFileNames);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation(value = "导出政策征求意见列表")
|
||||
@GetMapping("/exportPolicitOpinionEOListExcel")
|
||||
public void exportExcel(HttpServletRequest request, HttpServletResponse response, String exportName, @RequestParam Map<String,Object> params) throws Exception {
|
||||
OutputStream os = null;
|
||||
Workbook workbook = null;
|
||||
|
||||
ResponseMessage<List<PolicySolicitOpinionEO>> responseMessage = this.workFlowFeignClient.queryPolicitOpinionEOList(params);
|
||||
List<PolicySolicitOpinionEO> exportDataList = responseMessage.getData();
|
||||
this.disposeData(exportDataList);
|
||||
|
||||
try {
|
||||
if (StringUtils.isEmpty(exportName)) {
|
||||
exportName = "征求意见列表";
|
||||
}
|
||||
response.setHeader("Content-Disposition",
|
||||
"attachment; filename=" + ReadExcel.encodeFileName(exportName+".xlsx",request));
|
||||
response.setContentType("application/force-download");
|
||||
ExportParams exportParams = new ExportParams();
|
||||
exportParams.setType(ExcelType.XSSF);
|
||||
workbook = ExcelExportUtil.exportExcel(exportParams, PolicySolicitOpinionEO.class, exportDataList);
|
||||
workbook.setSheetName(0,"Sheet1");
|
||||
os = response.getOutputStream();
|
||||
workbook.write(os);
|
||||
os.flush();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new AdcDaBaseException("导出" + exportName + "列表数据失败,请重试");
|
||||
} finally {
|
||||
IOUtils.closeQuietly(os);
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查询重点认证标准/政策合规性项目审查任务明细")
|
||||
@GetMapping("/queryZchgxxmscTaskDetail")
|
||||
public BusProcessNew queryZchgxxmscTaskDetail(@RequestParam Map<String, Object> params) {
|
||||
/**
|
||||
* params:
|
||||
* taskIds
|
||||
* prcId
|
||||
* taskDefinitionKey
|
||||
*/
|
||||
String currentUserId = LoginUserUtil.getUserId();
|
||||
params.put("currentUserId", currentUserId);
|
||||
return workFlowFeignClient.queryZchgxxmscTaskDetail(params);
|
||||
}
|
||||
}
|
||||
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
package com.adc.da.workFlow.service;
|
||||
|
||||
import com.adc.da.exception.AdcDaBaseException;
|
||||
import com.adc.da.slrs.InsideOntSideMeeting.entity.InsideOutsideMeeting;
|
||||
import com.adc.da.slrs.InsideOntSideMeeting.service.InsideOutsideMeetingService;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @author tjzdw
|
||||
* @description
|
||||
* @date 2023/10/16
|
||||
*/
|
||||
@Service
|
||||
@Transactional(value = "transactionManager", readOnly = false, propagation = Propagation.REQUIRED, rollbackFor = Throwable.class)
|
||||
public class ActSarItemMeetingEOService {
|
||||
|
||||
@Resource
|
||||
private InsideOutsideMeetingService meetingService;
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(ActSarItemMeetingEOService.class);
|
||||
|
||||
public void processCreateMeeting(String meetingInfo) {
|
||||
InsideOutsideMeeting insideOutsideMeeting = JSONObject.parseObject(meetingInfo, InsideOutsideMeeting.class);
|
||||
if (insideOutsideMeeting == null) {
|
||||
throw new AdcDaBaseException("入库失败,会议信息出错");
|
||||
}
|
||||
logger.info("内外部会议入库:" + insideOutsideMeeting);
|
||||
meetingService.addMeetingInfo(insideOutsideMeeting);
|
||||
}
|
||||
}
|
||||
+5
-6
@@ -561,17 +561,16 @@ public class ActSarItemsBussEOService {
|
||||
evaluation.setCreateTime(date);
|
||||
evaluation.setModifyTime(date);
|
||||
evaluations.add(evaluation);
|
||||
|
||||
});
|
||||
}
|
||||
});
|
||||
qualityEvaluationService.saveBatch(evaluations);
|
||||
//当新增完成之后进行循环校验查出流程是重新技术委员会评审、评审意见修改就根据标准id将技术委员会评审、评审意见修改的评分赋值为0
|
||||
for (QualityEvaluation qualityEvaluation :evaluations){
|
||||
if (qualityEvaluation.getProcessNode().equals("重新技术委员会评审、评审意见修改")){
|
||||
qualityEvaluationDao.updateByProcessNode(qualityEvaluation.getLawId());
|
||||
}
|
||||
}
|
||||
// for (QualityEvaluation qualityEvaluation :evaluations){
|
||||
// if (qualityEvaluation.getProcessNode().equals("重新技术委员会评审、评审意见修改")){
|
||||
// qualityEvaluationDao.updateByProcessNode(qualityEvaluation.getLawId());
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+50
-45
@@ -89,7 +89,7 @@ public class ActSarItemsLawsEOService {
|
||||
private boolean elasflag;
|
||||
|
||||
/***
|
||||
* @Description: 国内外标准流程入库"
|
||||
* @Description: 政策流程入库"
|
||||
* @Author: yangxuenan
|
||||
* @Date: 2020/12/7 13:48
|
||||
* @Param: [standJson]
|
||||
@@ -100,8 +100,8 @@ public class ActSarItemsLawsEOService {
|
||||
standMap = JSONObject.parseObject(standJson);
|
||||
if (standMap != null && !standMap.isEmpty()) {
|
||||
String prcNum = String.valueOf(standMap.get("prcNum"));
|
||||
String prcName = String.valueOf(standMap.get("prcName"));
|
||||
String standType = String.valueOf(standMap.get("standType"));
|
||||
String lawsName = String.valueOf(standMap.get("lawsName"));
|
||||
// String standType = String.valueOf(standMap.get("standType"));
|
||||
// String isJudge = String.valueOf(standMap.get("ifIn")); //是否经过技术评估
|
||||
SarLawsStandInfo sarLawsStandInfo = new SarLawsStandInfo();
|
||||
// if(standMap.containsKey("standId")) {
|
||||
@@ -140,11 +140,11 @@ public class ActSarItemsLawsEOService {
|
||||
String resData = JSON.toJSONString(attInfoMap, SerializerFeature.WriteMapNullValue);
|
||||
sarLawsStandInfo.setSarStandAttrEOStr(resData);
|
||||
// 根据标准号判断数据是否已存在
|
||||
String lawsNumber = "";
|
||||
if(StringUtils.isNotBlank(sarLawsStandInfo.getLawsNumber()) && !"null".equals(sarLawsStandInfo.getLawsNumber())){
|
||||
lawsNumber = sarLawsStandInfo.getLawsNumber();
|
||||
}
|
||||
List<SarLawsStandInfo> lawsList = sarLawsStandInfoService.selectStandardsByStandNumber(lawsNumber);
|
||||
// String lawsNumber = "";
|
||||
// if(StringUtils.isNotBlank(sarLawsStandInfo.getLawsNumber()) && !"null".equals(sarLawsStandInfo.getLawsNumber())){
|
||||
// lawsNumber = sarLawsStandInfo.getLawsNumber();
|
||||
// }
|
||||
// List<SarLawsStandInfo> lawsList = sarLawsStandInfoService.selectStandardsByStandNumber(lawsNumber);
|
||||
//此处判断是否是带入的标准
|
||||
if(StringUtils.isNotBlank(sarLawsStandInfo.getId())) {
|
||||
SarLawsStandInfo query = new SarLawsStandInfo();
|
||||
@@ -161,9 +161,7 @@ public class ActSarItemsLawsEOService {
|
||||
if (StringUtils.isNotBlank(relatePro)) {
|
||||
String[] processSplit = relatePro.split(",");
|
||||
Set<String> processSet = new HashSet<>();
|
||||
for(String sData:processSplit){
|
||||
processSet.add(sData);
|
||||
}
|
||||
Collections.addAll(processSet, processSplit);
|
||||
processSet.add(prcNum);
|
||||
relatePro = StringUtils.join(processSet.toArray(), ",");
|
||||
} else {
|
||||
@@ -173,40 +171,42 @@ public class ActSarItemsLawsEOService {
|
||||
sarLawsStandInfoService.updateSarLawsStandInfo(sarLawsStandInfo);
|
||||
// 编辑相关流程
|
||||
iSarLawsAttrInfoService.updateLawsInfo(sarLawsStandInfo.getId(),"XGLC",relatePro);
|
||||
String content = "新增一条相关流程:" +prcName+" "+prcNum;
|
||||
sarUpdLogEOService.createBaseLog(sarLawsStandInfo.getId(),standType+"_STAND",content);
|
||||
}else if (lawsList != null && !lawsList.isEmpty()) {//Id不存在,但是标准号存在的情况
|
||||
String standId = lawsList.get(0).getId();
|
||||
SarLawsStandInfo query = new SarLawsStandInfo();
|
||||
query.setId(standId);
|
||||
sarLawsStandInfoService.attrInfoDetails(query);
|
||||
Map<String, Object> attrInfoMap = query.getAttrInfoMap();
|
||||
if(attInfoMap!=null && !attInfoMap.isEmpty()){
|
||||
updateStandFileFieldData(attInfoMap,attrInfoMap);
|
||||
resData = JSON.toJSONString(attInfoMap, SerializerFeature.WriteMapNullValue);
|
||||
sarLawsStandInfo.setSarStandAttrEOStr(resData);
|
||||
}
|
||||
// 查询原相关流程
|
||||
String relatePro = iSarLawsAttrInfoService.selectFieldValByLawsId("XGLC",standId);
|
||||
if (StringUtils.isNotBlank(relatePro)) {
|
||||
String[] processSplit = relatePro.split(",");
|
||||
Set<String> processSet = new HashSet<>();
|
||||
for(String sData:processSplit){
|
||||
processSet.add(sData);
|
||||
}
|
||||
processSet.add(prcNum);
|
||||
relatePro = StringUtils.join(processSet.toArray(), ",");
|
||||
} else {
|
||||
relatePro = prcNum;
|
||||
}
|
||||
// 编辑标准
|
||||
sarLawsStandInfo.setId(standId);
|
||||
sarLawsStandInfoService.updateSarLawsStandInfo(sarLawsStandInfo);
|
||||
// 编辑相关流程
|
||||
iSarLawsAttrInfoService.updateLawsInfo(standId,"XGLC",relatePro);
|
||||
String content = "新增一条相关流程:" +prcName+" "+prcNum;
|
||||
sarUpdLogEOService.createBaseLog(standId,standType+"_STAND",content);
|
||||
} else {//标准号、ID都不存在的情况
|
||||
String content = "新增一条相关流程:" +lawsName+" "+prcNum;
|
||||
sarUpdLogEOService.createBaseLog(sarLawsStandInfo.getId(),lawsName+"_LAWS",content);
|
||||
}
|
||||
// else if (lawsList != null && !lawsList.isEmpty()) {//Id不存在,但是标准号存在的情况
|
||||
// String standId = lawsList.get(0).getId();
|
||||
// SarLawsStandInfo query = new SarLawsStandInfo();
|
||||
// query.setId(standId);
|
||||
// sarLawsStandInfoService.attrInfoDetails(query);
|
||||
// Map<String, Object> attrInfoMap = query.getAttrInfoMap();
|
||||
// if(attInfoMap!=null && !attInfoMap.isEmpty()){
|
||||
// updateStandFileFieldData(attInfoMap,attrInfoMap);
|
||||
// resData = JSON.toJSONString(attInfoMap, SerializerFeature.WriteMapNullValue);
|
||||
// sarLawsStandInfo.setSarStandAttrEOStr(resData);
|
||||
// }
|
||||
// // 查询原相关流程
|
||||
// String relatePro = iSarLawsAttrInfoService.selectFieldValByLawsId("XGLC",standId);
|
||||
// if (StringUtils.isNotBlank(relatePro)) {
|
||||
// String[] processSplit = relatePro.split(",");
|
||||
// Set<String> processSet = new HashSet<>();
|
||||
// for(String sData:processSplit){
|
||||
// processSet.add(sData);
|
||||
// }
|
||||
// processSet.add(prcNum);
|
||||
// relatePro = StringUtils.join(processSet.toArray(), ",");
|
||||
// } else {
|
||||
// relatePro = prcNum;
|
||||
// }
|
||||
// // 编辑标准
|
||||
// sarLawsStandInfo.setId(standId);
|
||||
// sarLawsStandInfoService.updateSarLawsStandInfo(sarLawsStandInfo);
|
||||
// // 编辑相关流程
|
||||
// iSarLawsAttrInfoService.updateLawsInfo(standId,"XGLC",relatePro);
|
||||
// String content = "新增一条相关流程:" +prcName+" "+prcNum;
|
||||
// sarUpdLogEOService.createBaseLog(standId,standType+"_STAND",content);
|
||||
// }
|
||||
else {//标准号、ID都不存在的情况
|
||||
// 新增方法
|
||||
sarLawsStandInfoService.createSarStandardsInfo(sarLawsStandInfo);
|
||||
// 编辑相关流程
|
||||
@@ -836,6 +836,10 @@ public class ActSarItemsLawsEOService {
|
||||
case "country": sarLawsStandInfo.setCountry(valueStr); break;
|
||||
case "id": sarLawsStandInfo.setId(valueStr); break;
|
||||
case "lawsType": sarLawsStandInfo.setLawsType(valueStr); break;
|
||||
case "lawsTypeFirstLevel": sarLawsStandInfo.setLawsTypeFirstLevel(valueStr); break;
|
||||
case "lawsTypeSecondLevel": sarLawsStandInfo.setLawsTypeSecondLevel(valueStr); break;
|
||||
case "lawsTypeThirdLevel": sarLawsStandInfo.setLawsTypeThirdLevel(valueStr); break;
|
||||
case "lawsTypeFourthLevel": sarLawsStandInfo.setLawsTypeFourthLevel(valueStr); break;
|
||||
case "lawsNumber": sarLawsStandInfo.setLawsNumber(valueStr); break;
|
||||
case "lawsName": sarLawsStandInfo.setLawsName(valueStr); break;
|
||||
case "lawsEnName": sarLawsStandInfo.setLawsEnName(valueStr); break;
|
||||
@@ -862,6 +866,7 @@ public class ActSarItemsLawsEOService {
|
||||
case "isRelateAccess": sarLawsStandInfo.setIsRelateAccess(valueStr); break;
|
||||
case "lawsYear": sarLawsStandInfo.setLawsYear(valueStr); break;
|
||||
case "lawsNotisyncNum": sarLawsStandInfo.setLawsNotisyncNum(valueStr); break;
|
||||
case "notisyncNumLink": sarLawsStandInfo.setNotisyncNumLink(valueStr); break;
|
||||
case "lawsBulletin": sarLawsStandInfo.setLawsBulletin(valueStr); break;
|
||||
case "lawsLabel": sarLawsStandInfo.setLawsLabel(valueStr); break;
|
||||
case "lawsRemark": sarLawsStandInfo.setLawsRemark(valueStr); break;
|
||||
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
package com.adc.da.workFlow.service;
|
||||
|
||||
import com.adc.da.slrs.sarLawsInformation.entity.SarLawsInformation;
|
||||
import com.adc.da.slrs.sarLawsInformation.service.SarLawsInformationService;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* @author tjzdw
|
||||
* @description
|
||||
* @date 2023/10/27
|
||||
*/
|
||||
@Service
|
||||
@Transactional(value = "transactionManager", readOnly = false, propagation = Propagation.REQUIRED, rollbackFor = Throwable.class)
|
||||
public class ActSarLawsInformationEOService {
|
||||
|
||||
@Resource
|
||||
private SarLawsInformationService informationService;
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(ActSarLawsInformationEOService.class);
|
||||
|
||||
public void processCreateLawsInformation(String lawsInformationInfo) {
|
||||
SarLawsInformation sarLawsInformation = JSONObject.parseObject(lawsInformationInfo, SarLawsInformation.class);
|
||||
JSONObject jsonObject = JSONObject.parseObject(lawsInformationInfo);
|
||||
String applyUserId = jsonObject.getString("applyUserId");
|
||||
String applyUserName = jsonObject.getString("applyUserName");
|
||||
String approverId = jsonObject.getString("approverId");
|
||||
String approverName = jsonObject.getString("approverName");
|
||||
String createAndApproveBy = "";
|
||||
// 判断发起人和审批人是否相同
|
||||
if (approverId.equals(applyUserId)) {
|
||||
createAndApproveBy = applyUserName + "(" + applyUserId + ")";
|
||||
}else {
|
||||
createAndApproveBy = applyUserName + "(" + applyUserId + ")," + approverName + "(" + approverId + ")";
|
||||
}
|
||||
sarLawsInformation.setCreateAndApproveBy(createAndApproveBy);
|
||||
sarLawsInformation.setDownloadableBy(createAndApproveBy);
|
||||
sarLawsInformation.setViewableBy(createAndApproveBy);
|
||||
logger.info("政策法规资料入库:" + sarLawsInformation);
|
||||
informationService.addLawsInformation(sarLawsInformation);
|
||||
}
|
||||
}
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
package com.adc.da.workFlow.service;
|
||||
|
||||
import com.adc.da.exception.AdcDaBaseException;
|
||||
import com.adc.da.slrs.sarLawsTopic.entity.SarLawsTopic;
|
||||
import com.adc.da.slrs.sarLawsTopic.service.SarLawsTopicService;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* @author tjzdw
|
||||
* @description
|
||||
* @date 2023/10/25
|
||||
*/
|
||||
@Service
|
||||
@Transactional(value = "transactionManager", readOnly = false, propagation = Propagation.REQUIRED, rollbackFor = Throwable.class)
|
||||
public class ActSarLawsTopicEOService {
|
||||
|
||||
@Resource
|
||||
private SarLawsTopicService lawsTopicService;
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(ActSarLawsTopicEOService.class);
|
||||
|
||||
public void processLawsTopicMembership(String lawsTopicInfo) {
|
||||
SarLawsTopic sarLawsTopic = JSONObject.parseObject(lawsTopicInfo, SarLawsTopic.class);
|
||||
if (sarLawsTopic == null) {
|
||||
throw new AdcDaBaseException("入库失败,政策课题信息出错");
|
||||
}
|
||||
logger.info("政策课题入会:" + sarLawsTopic);
|
||||
lawsTopicService.addLawsTopicInfo(sarLawsTopic);
|
||||
}
|
||||
|
||||
public void processLawsTopicParticipation(String infoJson) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -107,6 +107,8 @@ public class WebMvcConfig implements WebMvcConfigurer {
|
||||
|
||||
addInterceptor.excludePathPatterns("/api/lawss/activiti/processModelHisOneCount");
|
||||
|
||||
addInterceptor.excludePathPatterns("/api/lawss/activiti/exportPolicitOpinionEOListExcel");
|
||||
|
||||
addInterceptor.excludePathPatterns("/api/att/attFile/getSyncPdfFileInfo");
|
||||
//附件下载
|
||||
addInterceptor.excludePathPatterns("/api/att/attFile/downloadFileForSar");
|
||||
@@ -188,6 +190,13 @@ public class WebMvcConfig implements WebMvcConfigurer {
|
||||
// 标准法规库-企标计划导出接口
|
||||
addInterceptor.excludePathPatterns("/api/esRevisePlan/es-revise-plan/exportEsRevisePlanInfoExcel");
|
||||
|
||||
// 内外部会议导出接口
|
||||
addInterceptor.excludePathPatterns("/api/lawss/insideOutsideMeeting/exportMeetingInfo");
|
||||
|
||||
// 政策课题导出接口
|
||||
addInterceptor.excludePathPatterns("/api/lawss/sarLawsTopic/exportLawsTopicInfo");
|
||||
|
||||
addInterceptor.excludePathPatterns("/api/lawss/sarLawsInformation/exportLawsInformationInfo");
|
||||
|
||||
// // 添加自定义拦截器,并拦截对应 url
|
||||
addInterceptor.addPathPatterns("/**");
|
||||
|
||||
+146
-28
@@ -6,22 +6,20 @@ import com.adc.da.search.util.DateUtil;
|
||||
import com.adc.da.search.util.InitStandAttrSearchUtil;
|
||||
import com.adc.da.sys.dao.DicTypeEODao;
|
||||
import com.adc.da.sys.entity.DicTypeEO;
|
||||
import com.adc.da.sys.sarMenuStandard.entity.SarMenuStandard;
|
||||
import com.adc.da.sys.sarMenuStandard.service.ISarMenuStandardService;
|
||||
import com.adc.da.sys.sarResource.entity.SysTsResource;
|
||||
import com.adc.da.sys.sarResource.service.ISysTsResourceService;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.beanutils.BeanUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
import org.elasticsearch.action.search.SearchRequestBuilder;
|
||||
import org.elasticsearch.action.search.SearchResponse;
|
||||
import org.elasticsearch.action.search.SearchType;
|
||||
import org.elasticsearch.action.support.master.AcknowledgedResponse;
|
||||
import org.elasticsearch.client.transport.TransportClient;
|
||||
import org.elasticsearch.common.collect.HppcMaps;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.text.Text;
|
||||
import org.elasticsearch.index.query.BoolQueryBuilder;
|
||||
@@ -60,6 +58,9 @@ public class SearchCenterServiceImpl implements SearchCenterService {
|
||||
@Resource
|
||||
private ISarMenuStandardService sarMenuStandardService;
|
||||
|
||||
@Resource
|
||||
private ISysTsResourceService tsResourceService;
|
||||
|
||||
|
||||
@Autowired
|
||||
private TransportClient transportClient;
|
||||
@@ -230,6 +231,7 @@ public class SearchCenterServiceImpl implements SearchCenterService {
|
||||
String sortField1 = "";
|
||||
String sortField2 = "";
|
||||
String sortField3 = "";
|
||||
String sortField4 = "";
|
||||
if("laws".equals(searchInfoEO.getSelectIndex())){
|
||||
sortField1 = "lawsNumber";
|
||||
sortField2 = "lawsYear";
|
||||
@@ -239,27 +241,79 @@ public class SearchCenterServiceImpl implements SearchCenterService {
|
||||
sortField2 = "standYear";
|
||||
sortField3 = "standSort.keyword";
|
||||
}
|
||||
if("laws".equals(searchInfoEO.getSelectIndex())){
|
||||
sortField1 = "lawsNumber";
|
||||
sortField2 = "lawsYear";
|
||||
sortField3 = "lawsType.keyword";
|
||||
} else if("bussstand".equals(searchInfoEO.getSelectIndex())) {
|
||||
sortField1 = "put_time_data";
|
||||
sortField2 = "standNumber";
|
||||
sortField3 = "standYear";
|
||||
sortField4 = "standSort.keyword";
|
||||
} else if ("stand".equals(searchInfoEO.getSelectIndex())) {
|
||||
sortField1 = "SSRQName";
|
||||
sortField2 = "standNumber";
|
||||
sortField3 = "standYear";
|
||||
sortField4 = "standSort.keyword";
|
||||
} else {
|
||||
sortField1 = "standNumber";
|
||||
sortField2 = "standYear";
|
||||
sortField3 = "standSort.keyword";
|
||||
}
|
||||
|
||||
List<String> menuNameList = new ArrayList<>();
|
||||
// 国内海外查询标准体系字段由id变为文字
|
||||
// if (StringUtils.isNotBlank(searchInfoEO.getStandSystem())) {
|
||||
// ArrayList<String> menuIdList = new ArrayList<>();
|
||||
// Collections.addAll(menuIdList,searchInfoEO.getStandSystem().split(","));
|
||||
// LambdaQueryWrapper<SarMenuStandard> wrapper = new LambdaQueryWrapper<>();
|
||||
// wrapper.in(SarMenuStandard::getId,menuIdList);
|
||||
// wrapper.select(SarMenuStandard::getMenuName);
|
||||
// List<SarMenuStandard> sarMenuStandardList = sarMenuStandardService.list(wrapper);
|
||||
// menuNameList = sarMenuStandardList.stream().map(SarMenuStandard::getMenuName).collect(Collectors.toList());
|
||||
// }
|
||||
|
||||
// 处理菜单名称
|
||||
List<String> menuNameList = new ArrayList<>();
|
||||
if (StringUtils.isNotBlank(searchInfoEO.getStandSystem())) {
|
||||
ArrayList<String> menuIdList = new ArrayList<>();
|
||||
Collections.addAll(menuIdList,searchInfoEO.getStandSystem().split(","));
|
||||
LambdaQueryWrapper<SarMenuStandard> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.in(SarMenuStandard::getId,menuIdList);
|
||||
wrapper.select(SarMenuStandard::getMenuName);
|
||||
List<SarMenuStandard> sarMenuStandardList = sarMenuStandardService.list(wrapper);
|
||||
menuNameList = sarMenuStandardList.stream().map(SarMenuStandard::getMenuName).collect(Collectors.toList());
|
||||
Collections.addAll(menuIdList, searchInfoEO.getStandSystem().split(","));
|
||||
LambdaQueryWrapper<SysTsResource> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.in(SysTsResource::getId, menuIdList);
|
||||
wrapper.select(SysTsResource::getMenuName);
|
||||
List<SysTsResource> tsResourceList = tsResourceService.list(wrapper);
|
||||
List<String> tempList = tsResourceList.stream().map(SysTsResource::getMenuName).collect(Collectors.toList());
|
||||
if ("bussstand".equals(searchInfoEO.getSelectIndex())) {
|
||||
// 和ES中的类别对应
|
||||
for (String menuName : tempList) {
|
||||
menuNameList.add(getReplaceStandSortStr(menuName));
|
||||
}
|
||||
} else if ("stand".equals(searchInfoEO.getSelectIndex())) {
|
||||
if (StringUtils.isNotBlank(searchInfoEO.getStandSystem())) {
|
||||
// 使用正则表达式提取括号内的内容
|
||||
Pattern pattern = Pattern.compile("(([^()]+))");
|
||||
for (String menuName : tempList) {
|
||||
Matcher matcher = pattern.matcher(menuName);
|
||||
if (matcher.find()) {
|
||||
String contentInBrackets = matcher.group(1);
|
||||
menuNameList.add(contentInBrackets);
|
||||
} else {
|
||||
menuNameList.add(menuName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
searchRequestBuilder = client.prepareSearch(searchInfoEO.getSelectIndex())
|
||||
.setSearchType(SearchType.DFS_QUERY_THEN_FETCH)
|
||||
.setFrom((searchInfoEO.getPage()-1)*searchInfoEO.getPageSize())
|
||||
.addSort(new ScoreSortBuilder().order(SortOrder.DESC))
|
||||
.addSort(sortField1, SortOrder.DESC)
|
||||
.addSort("standSortOrder", SortOrder.ASC)
|
||||
.addSort(sortField1, SortOrder.ASC)
|
||||
.addSort(sortField2, SortOrder.DESC)
|
||||
.addSort(sortField3, SortOrder.ASC)
|
||||
.addSort(sortField2, SortOrder.ASC)
|
||||
.addSort(sortField3, SortOrder.DESC)
|
||||
.addSort(sortField4, SortOrder.ASC)
|
||||
.addSort("issue_time_data", SortOrder.DESC)
|
||||
.setFrom((searchInfoEO.getPage()-1) * searchInfoEO.getPageSize())
|
||||
.setSize(searchInfoEO.getPageSize());
|
||||
|
||||
if(StringUtils.isNotEmpty(searchInfoEO.getSelectValue())){
|
||||
@@ -353,9 +407,9 @@ public class SearchCenterServiceImpl implements SearchCenterService {
|
||||
boolQueryBuilder.must(QueryBuilders.wildcardQuery("standType.keyword", "*"+searchInfoEO.getStandType()+"*"));
|
||||
}
|
||||
}
|
||||
if (StringUtils.isNotBlank(searchInfoEO.getTextStatus())) {
|
||||
boolQueryBuilder.must(QueryBuilders.wildcardQuery("textStatus.keyword", "*"+searchInfoEO.getTextStatus()+"*"));
|
||||
}
|
||||
// if (StringUtils.isNotBlank(searchInfoEO.getTextStatus())) {
|
||||
// boolQueryBuilder.must(QueryBuilders.wildcardQuery("textStatus.keyword", "*"+searchInfoEO.getTextStatus()+"*"));
|
||||
// }
|
||||
|
||||
if (StringUtils.isNotBlank(searchInfoEO.getLawsSyqy())) {
|
||||
boolQueryBuilder.must(QueryBuilders.wildcardQuery("lawsSyqy.keyword", "*"+searchInfoEO.getLawsSyqy()+"*"));
|
||||
@@ -366,21 +420,39 @@ public class SearchCenterServiceImpl implements SearchCenterService {
|
||||
}
|
||||
boolQueryBuilder.must(boolQueryShould);
|
||||
}else {
|
||||
// if (!menuNameList.isEmpty()) {
|
||||
// menuNameList.forEach(each -> {
|
||||
// if ("stand".equals(searchInfoEO.getSelectIndex())) {
|
||||
// boolQueryBuilder.must(QueryBuilders.matchQuery("standSystem","*"+each+"*"));
|
||||
// }else if ("bussstand".equals(searchInfoEO.getSelectIndex())) {
|
||||
// boolQueryBuilder.must(QueryBuilders.matchQuery("TXLBBUSS",each));
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
|
||||
if (!menuNameList.isEmpty()) {
|
||||
menuNameList.forEach(each -> {
|
||||
if ("stand".equals(searchInfoEO.getSelectIndex())) {
|
||||
boolQueryBuilder.must(QueryBuilders.matchQuery("standSystem","*"+each+"*"));
|
||||
}else if ("bussstand".equals(searchInfoEO.getSelectIndex())) {
|
||||
boolQueryBuilder.must(QueryBuilders.matchQuery("TXLBBUSS",each));
|
||||
}
|
||||
});
|
||||
menuNameList.forEach(each -> boolQueryBuilder.must(QueryBuilders.matchQuery("standSort","*"+each+"*")));
|
||||
}
|
||||
if ("stand".equals(searchInfoEO.getSelectIndex()) && StringUtils.isNotBlank(searchInfoEO.getStandType())) {
|
||||
boolQueryBuilder.must(QueryBuilders.wildcardQuery("standType.keyword", "*"+searchInfoEO.getStandType()+"*"));
|
||||
}
|
||||
boolQueryBuilder.must(boolQueryShould);
|
||||
}
|
||||
|
||||
}
|
||||
if (StringUtils.isNotBlank(searchInfoEO.getTextStatusBuss())) {
|
||||
if (searchInfoEO.getSelectIndex().equals("bussstand")) {
|
||||
if ("现行有效".equals(searchInfoEO.getTextStatusBuss())) {
|
||||
boolQueryBuilder.must(QueryBuilders.termQuery("textStatusBuss", "9z741h2m3j")).boost(1009f);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (StringUtils.isNotBlank(searchInfoEO.getTextStatus())) {
|
||||
if (searchInfoEO.getSelectIndex().equals("stand")) {
|
||||
if ("现行有效".equals(searchInfoEO.getTextStatus())) {
|
||||
boolQueryBuilder.must(QueryBuilders.termQuery("textStatus", "vsaga7nwub")).boost(1009f);
|
||||
}
|
||||
}
|
||||
}
|
||||
searchRequestBuilder.setQuery(boolQueryBuilder).setTrackTotalHits(true);
|
||||
|
||||
// 获取查询到的结果
|
||||
@@ -1124,6 +1196,7 @@ public class SearchCenterServiceImpl implements SearchCenterService {
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
public static Map<String, Object> objectToMap(Object obj){
|
||||
if(obj == null){
|
||||
return null;
|
||||
@@ -1664,6 +1737,7 @@ public class SearchCenterServiceImpl implements SearchCenterService {
|
||||
.should(QueryBuilders.wildcardQuery("numberTitle.keyword","*" + searchInfoEO.getSelectValue() + "*").boost(1004f))
|
||||
.should(QueryBuilders.wildcardQuery("yearOrder.keyword","*" + searchInfoEO.getSelectValue() + "*").boost(1003f))
|
||||
.should(QueryBuilders.wildcardQuery("nameTitle.keyword","*" + searchInfoEO.getSelectValue() + "*").boost(1002f))
|
||||
.should(QueryBuilders.wildcardQuery("nameEnTitle.keyword","*"+ searchInfoEO.getSelectValue() + "*").boost(1002f))
|
||||
.should(QueryBuilders.wildcardQuery("title.keyword", "*" + searchInfoEO.getSelectValue() + "*").boost(1000f))
|
||||
.should(QueryBuilders.wildcardQuery("titleBig.keyword", "*" + searchInfoEO.getSelectValue().toUpperCase() + "*").boost(1000f))
|
||||
.should(QueryBuilders.wildcardQuery("NYLXName.keyword",searchInfoEO.getSelectValue().toUpperCase()).boost(1005f))
|
||||
@@ -1771,8 +1845,10 @@ public class SearchCenterServiceImpl implements SearchCenterService {
|
||||
//高亮标题覆盖原标题
|
||||
String titleStr = sourceAsMap.get("title").toString();
|
||||
int i = indexOfToKMP(titleStr.toUpperCase(), searchInfoEO.getSelectValue().toUpperCase(), 0, getNextValInstance());
|
||||
String selectValue = titleStr.substring(i,i+searchInfoEO.getSelectValue().length());
|
||||
titleStr = titleStr.replace(selectValue,"<span class='highlight-Es-class'>"+selectValue+"</span>");
|
||||
if (i >= 0) {
|
||||
String selectValue = titleStr.substring(i,i+searchInfoEO.getSelectValue().length());
|
||||
titleStr = titleStr.replace(selectValue,"<span class='highlight-Es-class'>"+selectValue+"</span>");
|
||||
}
|
||||
if(StringUtils.isNotBlank(textStatusColor)){
|
||||
sourceAsMap.put("title", "<span class='"+textStatusColor+"'>"+titleStr+"</span>");
|
||||
}else {
|
||||
@@ -2203,6 +2279,48 @@ public class SearchCenterServiceImpl implements SearchCenterService {
|
||||
log.info(response.getHits().toString());
|
||||
|
||||
}
|
||||
|
||||
|
||||
public String getReplaceStandSortStr(String standSort){
|
||||
switch (standSort){
|
||||
case "A类标准(技术条件)":
|
||||
return "Q/FT A";
|
||||
case "B类标准(技术基础)":
|
||||
return "Q/FT B";
|
||||
case "C类标准(产品标准)":
|
||||
return "Q/FT C";
|
||||
case "E类标准(发动机)":
|
||||
return "Q/FT E";
|
||||
case " F类标准(仿真分析)":
|
||||
return "Q/FT F";
|
||||
case "G类标准":
|
||||
return "Q/FT G";
|
||||
case "M类标准(工程机械)":
|
||||
return "Q/FT M";
|
||||
case "P类标准(工艺工装)":
|
||||
return "Q/FT P";
|
||||
case "Q类标准(质量评审)":
|
||||
return "Q/FT Q";
|
||||
case "T类标准(试验标准)":
|
||||
return "Q/FT T";
|
||||
case "R类标准(设计规范)":
|
||||
return "Q/FT R";
|
||||
case "V类标准(评价标准)":
|
||||
return "Q/FT V";
|
||||
case "X类标准(出口车)":
|
||||
return "Q/FT X";
|
||||
case "Z类标准(指导性技术文件)":
|
||||
return "Q/FT Z";
|
||||
case "S类标准(产品试制标准)":
|
||||
return "Q/FT S";
|
||||
case "Y类标准(标杆研究标准)":
|
||||
return "Q/FT Y";
|
||||
case "参考标准":
|
||||
return "FT";
|
||||
default:
|
||||
return "其他企业标准";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -121,6 +121,7 @@ public class SendBussMQService {
|
||||
}else{
|
||||
saveMap.put("put_time_data",-1000000000000000000L);
|
||||
}
|
||||
saveMap.put("warehousingTime",sdf.format(infoEO.getCreationTime())); // 入库时间
|
||||
|
||||
//查询字典表,形成Hash映射提升速度
|
||||
List<DicTypeEO> dicInfo = dicTypeEODao.getDicInfo("dic_id","dic_type_code", "dic_type_name","show_index");
|
||||
|
||||
@@ -243,7 +243,9 @@ public class SendLawsMQService {
|
||||
|
||||
// 动态存储属性字段
|
||||
for (String field : fieldInfoList) {
|
||||
saveMap.put(field,attrInfoMap.getOrDefault(field,""));
|
||||
Object fieldValueObj = attrInfoMap.getOrDefault(field,"");
|
||||
saveMap.put(field,fieldValueObj);
|
||||
|
||||
String fieldValue = "";
|
||||
String fieldFilter = field.toLowerCase();
|
||||
if(infoMap.get(fieldFilter) != null && StringUtils.isNotBlank(infoMap.get(fieldFilter).toString())){
|
||||
@@ -259,7 +261,12 @@ public class SendLawsMQService {
|
||||
fieldValue = fieldValue.replace("null","");
|
||||
}
|
||||
}
|
||||
saveMap.put(field+"Name",fieldValue);
|
||||
if("SSRQ".equals(field)){
|
||||
saveMap.put(field+"Name",fieldValue.replace(" ","").replace("-",""));
|
||||
}else{
|
||||
saveMap.put(field+"Name",fieldValue);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if(infoEOMapItems != null && !infoEOMapItems.isEmpty()){
|
||||
|
||||
@@ -194,6 +194,8 @@ public class SendStandMQService {
|
||||
saveMap.put("validFlag","0");
|
||||
saveMap.put("content",infoEO.getFileIds());
|
||||
saveMap.put("CHJL",infoEO.getCHJL());
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
saveMap.put("warehousingTime",sdf.format(infoEO.getCreationTime())); // 入库时间
|
||||
|
||||
String fieldInfo = InitStandAttrUtil.queryField;
|
||||
List<String> fieldInfoList = Arrays.asList(fieldInfo .split(",")).stream().map(s -> (s.trim())).collect(Collectors.toList());
|
||||
|
||||
@@ -31,13 +31,25 @@ public class ScheduledSync {
|
||||
private boolean isNotScheduled; //是否开启定时器
|
||||
|
||||
//每天凌晨两点执行
|
||||
// @Scheduled(cron="0 0 2 * * ?")
|
||||
// @Async
|
||||
// public void syncSchedulingTasks() {
|
||||
// if(isNotScheduled){
|
||||
// log.info("======================================开始同步基础数据========================================");
|
||||
// iDataSyncService.orgDataSync(); //时间短
|
||||
// iDataSyncService.dataSync(); //时间长
|
||||
// log.info("======================================结束同步基础数据========================================");
|
||||
// }
|
||||
// }
|
||||
|
||||
//每天凌晨两点执行,改为全量同步
|
||||
@Scheduled(cron="0 0 2 * * ?")
|
||||
@Async
|
||||
public void syncSchedulingTasks() {
|
||||
if(isNotScheduled){
|
||||
log.info("======================================开始同步基础数据========================================");
|
||||
iDataSyncService.orgDataSync(); //时间短
|
||||
iDataSyncService.dataSync(); //时间长
|
||||
iDataSyncService.orgDataSync3(); //时间短
|
||||
iDataSyncService.dataSync3(); //时间长
|
||||
log.info("======================================结束同步基础数据========================================");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,12 +47,24 @@ public class DataSyncController {
|
||||
return iDataSyncService.dataSync2(chuo);
|
||||
}
|
||||
|
||||
@ApiOperation("同步用户数据3,不带时间戳,全量同步")
|
||||
@PostMapping("/importUserData3")
|
||||
public String importUserData3() throws Exception {
|
||||
return iDataSyncService.dataSync3();
|
||||
}
|
||||
|
||||
@ApiOperation("同步组织机构")
|
||||
@PostMapping("/importOrgData")
|
||||
public String importOrgData() throws Exception {
|
||||
return iDataSyncService.orgDataSync2();
|
||||
}
|
||||
|
||||
@ApiOperation("同步组织机构,改成全量同步")
|
||||
@PostMapping("/importOrgData3")
|
||||
public String importOrgData3() throws Exception {
|
||||
return iDataSyncService.orgDataSync3();
|
||||
}
|
||||
|
||||
@ApiOperation("同步组织机构,添加参数")
|
||||
@PostMapping("/updateByOrgs")
|
||||
public String updateByOrgs() throws Exception {
|
||||
|
||||
@@ -8,10 +8,14 @@ public interface IDataSyncService {
|
||||
public String dataSync();
|
||||
|
||||
public String dataSync2(Long chuo);
|
||||
|
||||
public String dataSync3();
|
||||
// 定时增量同步
|
||||
public String orgDataSync();
|
||||
// 手动全量同步
|
||||
|
||||
public String orgDataSync2();
|
||||
// 全量同步
|
||||
public String orgDataSync3();
|
||||
|
||||
public String updateByOrgs();
|
||||
}
|
||||
|
||||
+225
@@ -23,7 +23,9 @@ import com.adc.da.sys.constant.ValidFlagEnum;
|
||||
import com.adc.da.sys.entity.UserOrgEO;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
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.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import lombok.extern.log4j.Log4j;
|
||||
@@ -469,6 +471,134 @@ public class DataSyncServiceImpl implements IDataSyncService {
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 同步人员数据,去掉时间戳 版本
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = {RuntimeException.class,Exception.class})
|
||||
public String dataSync3(){
|
||||
try{
|
||||
SyncUserService syncUserService = new SyncUserService();
|
||||
List<String> res = syncUserService.syncFotonUser3();
|
||||
if(res!=null && !res.isEmpty()){
|
||||
res.forEach(each -> logger.info("同步人员数据:"+each));
|
||||
//存放岗位信息
|
||||
Map<String, String> positionMap = new HashMap<>();
|
||||
TsPosition position = new TsPosition();
|
||||
position.setCurrent(1);
|
||||
position.setPageSize(100000);
|
||||
IPage<TsPosition> iPage = tsPositionService.getPosition(position);
|
||||
List<TsPosition> positions=iPage.getRecords();
|
||||
if (!positions.isEmpty()) {
|
||||
positions.forEach(tsPosition -> {
|
||||
positionMap.put(tsPosition.getName(), tsPosition.getId());
|
||||
});
|
||||
}
|
||||
List<TsUser> addUserList = new ArrayList<>();
|
||||
List<TsUser> upUserList = new ArrayList<>();
|
||||
Set<String> syncUserIdSet = new HashSet<>();
|
||||
for (String s : res) {
|
||||
JSONObject userData = JSONObject.parseObject(s);
|
||||
if(userData.containsKey("results")){
|
||||
JSONArray jsonArray = userData.getJSONArray("results");
|
||||
jsonArray.forEach(object -> {
|
||||
JSONObject jsonObject = JSONObject.parseObject(object.toString());
|
||||
String userid = jsonObject.getString("userid");
|
||||
syncUserIdSet.add(userid);
|
||||
TsUser userEO = tsUserService.getById(userid);
|
||||
String userState = "";
|
||||
if(userEO != null){
|
||||
userState = "UPDATE";
|
||||
}else{
|
||||
userState = "ADD";
|
||||
userEO = new TsUser();
|
||||
}
|
||||
//先获取岗位以及岗位id
|
||||
//设置岗位
|
||||
if (null != jsonObject.getString("title")) {
|
||||
//通过岗位名称查询系统表中是否有岗位,有则设定用户的岗位为系统中的岗位,否则新增
|
||||
if (null == positionMap.get(jsonObject.getString("title"))) {
|
||||
TsPosition tsPosition = new TsPosition();
|
||||
tsPosition.setId(String.valueOf(UUID.randomUUID()));
|
||||
tsPosition.setName(jsonObject.getString("title"));
|
||||
tsPositionService.addPosition(tsPosition);
|
||||
//放入岗位的map集合中
|
||||
positionMap.put(tsPosition.getName(), tsPosition.getId());
|
||||
//放入类中
|
||||
userEO.setPositionName(tsPosition.getName());
|
||||
userEO.setPositionId(tsPosition.getId());
|
||||
} else {
|
||||
userEO.setPositionName(jsonObject.getString("title").trim());
|
||||
userEO.setPositionId(positionMap.get(jsonObject.getString("title").trim()));
|
||||
}
|
||||
}else{
|
||||
userEO.setPositionId(null);
|
||||
userEO.setPositionName(null);
|
||||
}
|
||||
//设置其他数据
|
||||
Timestamp createTime = new Timestamp(new Date().getTime());
|
||||
userEO.setState(jsonObject.getString("userStatus"));
|
||||
userEO.setUname(null!=jsonObject.getString("name")?jsonObject.getString("name"):"");
|
||||
userEO.setCreationTime(createTime);
|
||||
userEO.setUserId(jsonObject.getString("userid"));
|
||||
userEO.setAccount(jsonObject.getString("userid"));
|
||||
userEO.setInstitutionId(null!=jsonObject.getString("orgNumber")?jsonObject.getString("orgNumber"):"" );
|
||||
userEO.setInstitutionName(null!=jsonObject.getString("orgName")?jsonObject.getString("orgName"):"" );
|
||||
//2022-05-23:用户同步增加状态标识,将停用的用户过滤掉
|
||||
if("1".equals(jsonObject.getString("userStatus"))){
|
||||
userEO.setValidFlag(ValidFlagEnum.VALID_TRUE.getValue()+"");
|
||||
userEO.setDisableFlag(ValidFlagEnum.VALID_TRUE.getValue()+"");
|
||||
}else{
|
||||
userEO.setValidFlag(ValidFlagEnum.VALID_FALSE.getValue()+"");
|
||||
userEO.setDisableFlag(ValidFlagEnum.VALID_FALSE.getValue()+"");
|
||||
}
|
||||
if("ADD".equals(userState)){
|
||||
addUserList.add(userEO);
|
||||
}else {
|
||||
upUserList.add(userEO);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
if(!addUserList.isEmpty()){
|
||||
logger.debug("本次新增的用户为:"+JSONObject.toJSONString(addUserList));
|
||||
tsUserService.saveBatch(addUserList);
|
||||
}
|
||||
if(!upUserList.isEmpty()){
|
||||
logger.debug("本次更新的用户为:"+JSONObject.toJSONString(upUserList));
|
||||
tsUserService.updateBatchById(upUserList);
|
||||
}
|
||||
LambdaQueryWrapper<TsUser> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(TsUser::getState,"1");
|
||||
wrapper.eq(TsUser::getValidFlag,"0");
|
||||
wrapper.eq(TsUser::getDisableFlag,"0");
|
||||
wrapper.select(TsUser::getUserId);
|
||||
Set<String> userIdDbList = tsUserService.list(wrapper).stream().map(TsUser::getUserId).collect(Collectors.toSet());
|
||||
userIdDbList.removeAll(syncUserIdSet);
|
||||
logger.info("本次同步删除掉的用户有:"+userIdDbList);
|
||||
if(!userIdDbList.isEmpty()){
|
||||
//删除数据库中不存在的用户
|
||||
LambdaUpdateWrapper<TsUser> wrapper1 = new LambdaUpdateWrapper<>();
|
||||
wrapper1.in(TsUser::getUserId,userIdDbList);
|
||||
wrapper1.set(TsUser::getState,"0");
|
||||
wrapper1.set(TsUser::getValidFlag,"1");
|
||||
wrapper1.set(TsUser::getDisableFlag,"1");
|
||||
tsUserService.update(wrapper1);
|
||||
}
|
||||
}else{
|
||||
logger.info("本次获取用户的数据为空,原因有2种:1、没有同步数据 2、请求接口报错");
|
||||
}
|
||||
}catch(Exception e){
|
||||
logger.error(e.getMessage(),e);
|
||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||
}
|
||||
return "1";
|
||||
|
||||
}
|
||||
|
||||
|
||||
// 增量同步部门数据
|
||||
@Transactional(rollbackFor = {RuntimeException.class,Exception.class})
|
||||
public String orgDataSync(){
|
||||
@@ -655,6 +785,101 @@ public class DataSyncServiceImpl implements IDataSyncService {
|
||||
return "1";
|
||||
}
|
||||
|
||||
|
||||
// 手动全量同步部门信息
|
||||
@Override
|
||||
@Transactional(rollbackFor = {RuntimeException.class,Exception.class})
|
||||
public String orgDataSync3(){
|
||||
try{
|
||||
SyncUserService syncUserService = new SyncUserService();
|
||||
List<String> res = syncUserService.syncFotonOrg3();
|
||||
if(res!=null && !res.isEmpty()){
|
||||
res.forEach(each -> logger.info("同步部门数据:"+each));
|
||||
//获取到所有用户数据
|
||||
List<String> strings=new ArrayList<>();
|
||||
//tsInstitutionService.clearData();
|
||||
for (String s : res) {
|
||||
JSONArray jsonArray = JSONArray.parseArray(JSONObject.parseObject(s.toString()).getString("results"));
|
||||
jsonArray.forEach(object -> {
|
||||
JSONObject jsonObject = JSONObject.parseObject(object.toString());
|
||||
strings.add(jsonObject.getString("parentOrgNumber"));
|
||||
});
|
||||
}
|
||||
List<TsInstitution> allTsInstitutionList = tsInstitutionService.list();
|
||||
List<TsInstitution> addTsInstitutionList = new ArrayList<>();
|
||||
List<TsInstitution> updateTsInstitutionList = new ArrayList<>();
|
||||
List<TsInstitution> delTsInstitutionList = new ArrayList<>();
|
||||
Set<String> syncAllIdList = new HashSet<>();
|
||||
for (String s : res) {
|
||||
JSONArray jsonArray = JSONArray.parseArray(JSONObject.parseObject(s.toString()).getString("results"));
|
||||
if(jsonArray!=null){
|
||||
jsonArray.forEach(object -> {
|
||||
JSONObject jsonObject = JSONObject.parseObject(object.toString());
|
||||
TsInstitution tsInstitution=new TsInstitution();
|
||||
tsInstitution.setId(jsonObject.getString("orgNumber"));
|
||||
tsInstitution.setName(jsonObject.getString("orgName"));
|
||||
tsInstitution.setHasChild(strings.contains(jsonObject.getString("orgNumber"))?"1":"0");
|
||||
tsInstitution.setParentId(jsonObject.getString("parentOrgNumber"));
|
||||
//部门为"null"的数据不保存
|
||||
if (!"null".equals(jsonObject.getString("orgName"))){
|
||||
TsInstitution institution = tsInstitutionService.getById(tsInstitution.getId());
|
||||
if(institution!=null){
|
||||
updateTsInstitutionList.add(tsInstitution);
|
||||
}else{
|
||||
addTsInstitutionList.add(tsInstitution);
|
||||
}
|
||||
syncAllIdList.add(tsInstitution.getId());
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
//遍历出来需要删除的数据
|
||||
for(TsInstitution data :allTsInstitutionList){
|
||||
if(!syncAllIdList.contains(data.getId())){
|
||||
delTsInstitutionList.add(data);
|
||||
}
|
||||
}
|
||||
//需要新增的数据
|
||||
if(!addTsInstitutionList.isEmpty()){
|
||||
logger.debug("本次新增的组织机构为:"+JSONObject.toJSONString(addTsInstitutionList));
|
||||
tsInstitutionService.saveBatch(addTsInstitutionList);
|
||||
}
|
||||
//需要更新的数据
|
||||
if(!updateTsInstitutionList.isEmpty()){
|
||||
logger.debug("本次更新的组织机构为:"+JSONObject.toJSONString(updateTsInstitutionList));
|
||||
tsInstitutionService.updateBatchById(updateTsInstitutionList);
|
||||
}
|
||||
//需要删除的数据
|
||||
// 先行注释,会删除所有部门
|
||||
if(!delTsInstitutionList.isEmpty()){
|
||||
logger.debug("本次删除的组织机构为:"+JSONObject.toJSONString(delTsInstitutionList));
|
||||
List<String> delIdList = new ArrayList<>();
|
||||
for(TsInstitution data : delTsInstitutionList){
|
||||
delIdList.add(data.getId());
|
||||
}
|
||||
tsInstitutionService.removeByIds(delIdList);
|
||||
}
|
||||
//全部部门
|
||||
List<TsInstitution> allTsInstitutionListForPids = new ArrayList<>(addTsInstitutionList);
|
||||
allTsInstitutionListForPids.addAll(updateTsInstitutionList);
|
||||
for (TsInstitution tsInstitution : allTsInstitutionListForPids){
|
||||
List<String> parentIds = new ArrayList<>();
|
||||
getParentTaxCompanyIds(allTsInstitutionListForPids, tsInstitution.getId(), parentIds);
|
||||
tsInstitution.setParentIds(String.join(",",parentIds));
|
||||
}
|
||||
if (! allTsInstitutionListForPids.isEmpty()) {
|
||||
tsInstitutionService.updateBatchById(allTsInstitutionListForPids);
|
||||
}
|
||||
}else{
|
||||
logger.info("本次获取组织机构的数据为空,原因有2种:1、没有同步数据 2、请求接口报错");
|
||||
}
|
||||
}catch(Exception e){
|
||||
logger.error(e.getMessage(),e);
|
||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||
}
|
||||
return "1";
|
||||
}
|
||||
|
||||
public String updateByOrgs(){
|
||||
QueryWrapper<TsInstitution> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.ne("id","");
|
||||
|
||||
+219
@@ -0,0 +1,219 @@
|
||||
package com.adc.da.slrs.InsideOntSideMeeting.controller;
|
||||
|
||||
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.core.util.ZipUtil;
|
||||
import com.adc.da.base.web.BaseController;
|
||||
import com.adc.da.common.ReadExcel;
|
||||
import com.adc.da.exception.AdcDaBaseException;
|
||||
import com.adc.da.http.PageInfo;
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.slrs.InsideOntSideMeeting.entity.InsideOutsideMeeting;
|
||||
import com.adc.da.slrs.InsideOntSideMeeting.entity.InsideOutsideMeetingVO;
|
||||
import com.adc.da.slrs.InsideOntSideMeeting.service.InsideOutsideMeetingService;
|
||||
import com.adc.da.util.UUIDUtils;
|
||||
import com.adc.da.utils.util.FieldConvertUtil;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
|
||||
import org.apache.poi.hssf.usermodel.HSSFSheet;
|
||||
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
||||
import org.apache.poi.ss.usermodel.*;
|
||||
import org.apache.poi.ss.util.CellRangeAddress;
|
||||
import org.apache.poi.util.IOUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.*;
|
||||
import java.text.ParseException;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author tjzdw
|
||||
* @description
|
||||
* @date 2023/10/10
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/${restPath}/lawss/insideOutsideMeeting")
|
||||
public class InsideOutSideMeetingController extends BaseController<InsideOutsideMeetingVO> {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(InsideOutSideMeetingController.class);
|
||||
|
||||
@Resource
|
||||
private InsideOutsideMeetingService meetingService;
|
||||
|
||||
@Value("${file.path}")
|
||||
private String filePath;
|
||||
|
||||
@ApiOperation(value = "根据会议ID查询会议信息")
|
||||
@GetMapping("/getMeetingInfo")
|
||||
public ResponseMessage<InsideOutsideMeeting> getMeetingInfo(String meetingId){
|
||||
if (StringUtils.isBlank(meetingId)) {
|
||||
return Result.error("会议ID为空!");
|
||||
}
|
||||
InsideOutsideMeeting meetingInfo = meetingService.getMeetingInfo(meetingId);
|
||||
return Result.success(meetingInfo);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "分页查询")
|
||||
@GetMapping("/page")
|
||||
public ResponseMessage<PageInfo<InsideOutsideMeetingVO>> page(InsideOutsideMeetingVO insideOutsideMeetingVO) {
|
||||
List<InsideOutsideMeetingVO> rows = meetingService.queryByPage(insideOutsideMeetingVO);
|
||||
return Result.success(getPageInfo(insideOutsideMeetingVO.getPager(), rows));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "新增内外部会议")
|
||||
@PostMapping(value = "/addMeetingInfo", consumes = "application/json;charset=UTF-8")
|
||||
public ResponseMessage<?> create(@RequestBody InsideOutsideMeeting insideOutSideMeeting) throws Exception {
|
||||
meetingService.addMeetingInfo(insideOutSideMeeting);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@ApiOperation("根据会议ID删除会议")
|
||||
@DeleteMapping("/deleteMeetingInfo")
|
||||
public ResponseMessage<?> deleteMeeting(String meetingId) {
|
||||
if (StringUtils.isBlank(meetingId)) {
|
||||
return Result.error("删除失败,会议ID为空");
|
||||
}
|
||||
meetingService.deleteMeetingById(meetingId);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@ApiOperation("根据会议ID修改会议信息")
|
||||
@PutMapping("/updateMeetingInfo")
|
||||
public ResponseMessage<?> updateMeetingInfo(@RequestBody InsideOutsideMeeting insideOutSideMeeting) {
|
||||
if (ObjectUtils.isEmpty(insideOutSideMeeting)) {
|
||||
return Result.error("更新失败,会议信息不存在");
|
||||
}
|
||||
Boolean updateResult = meetingService.updateMeetingInfo(insideOutSideMeeting);
|
||||
return updateResult ? Result.success() : Result.error("更新失败");
|
||||
}
|
||||
|
||||
@ApiOperation("导出内外部会议信息")
|
||||
@GetMapping("/exportMeetingInfo")
|
||||
public ResponseMessage<?> exportMeetingInfo(InsideOutsideMeetingVO insideOutsideMeetingVO, HttpServletResponse response,
|
||||
HttpServletRequest request) {
|
||||
OutputStream os = null;
|
||||
Workbook workbook = null;
|
||||
List<InsideOutsideMeetingVO> datas;
|
||||
try {
|
||||
if(StringUtils.isEmpty(insideOutsideMeetingVO.getExportName())||insideOutsideMeetingVO.getExportName().equals("null")){
|
||||
insideOutsideMeetingVO.setExportName("内外部会议信息");
|
||||
}
|
||||
response.setHeader("Content-Disposition",
|
||||
"attachment; filename=" + ReadExcel.encodeFileName(insideOutsideMeetingVO.getExportName()+".xlsx",
|
||||
request));
|
||||
// 导出数据,若指定了值则使用ids字段条件导出,否则根据条件导出
|
||||
if (StrUtil.isNotBlank(insideOutsideMeetingVO.getExportIds())) {
|
||||
List<String> idList = Arrays.asList(insideOutsideMeetingVO.getExportIds().split(","));
|
||||
datas = meetingService.queryMeetingById(idList);
|
||||
} else {
|
||||
// 导出所有数据
|
||||
datas = meetingService.queryAllMeeting(insideOutsideMeetingVO);
|
||||
}
|
||||
ExportParams exportParams = new ExportParams();
|
||||
exportParams.setType(ExcelType.XSSF);
|
||||
exportParams.setSheetName(insideOutsideMeetingVO.getExportName());
|
||||
// workbook = InsideOutsideMeetingExportUtil.exportDatas(datas);
|
||||
workbook = ExcelExportUtil.exportExcel(exportParams, InsideOutsideMeetingVO.class, datas);
|
||||
os = response.getOutputStream();
|
||||
workbook.write(os);
|
||||
os.flush();
|
||||
} catch (IOException e) {
|
||||
logger.error(e.getMessage(), e);
|
||||
throw new AdcDaBaseException("下载文件失败,请重试");
|
||||
} finally {
|
||||
IOUtils.closeQuietly(os);
|
||||
}
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@ApiOperation("Excel文件导入内外部会议信息")
|
||||
@PostMapping("/importMeetingInfo")
|
||||
public ResponseMessage<?> importMeetingInfo(@RequestParam(value = "file",required = false) MultipartFile file) throws ParseException {
|
||||
if (file == null) {
|
||||
return Result.error("文件为空,请重新上传");
|
||||
}
|
||||
return meetingService.importMeetingInfo(file);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "内外部会议导入模板下载")
|
||||
@GetMapping("/exportTemplateFile")
|
||||
public void exportTemplateFile(String fileName,HttpServletResponse response, HttpServletRequest request)throws Exception{
|
||||
|
||||
OutputStream os = null;
|
||||
OutputStream excelOS = null;
|
||||
HSSFWorkbook workbook = new HSSFWorkbook();
|
||||
String fileOriName = "内外部会议导入模板";
|
||||
if (StringUtils.isNotEmpty(fileName)) {
|
||||
fileOriName = fileName;
|
||||
}
|
||||
try{
|
||||
//创建临时文件夹
|
||||
String fileNowPath = filePath + "/tempZip/" + UUIDUtils.randomUUID20() + "/" + fileOriName;
|
||||
File nowFile = new File(fileNowPath);
|
||||
if (nowFile.exists()){
|
||||
nowFile.delete();
|
||||
}
|
||||
nowFile.mkdirs();
|
||||
String fileName2 = "导入模板.xls";
|
||||
HSSFSheet sheetItems = workbook.createSheet("模板");
|
||||
sheetItems.setDefaultColumnWidth(13);
|
||||
Row rowHeader = sheetItems.createRow(1);//开始创建标题行
|
||||
sheetItems.addMergedRegion(new CellRangeAddress(0, 0, 0, 13));
|
||||
Row row2 = sheetItems.createRow(0);//开始创建填写说明
|
||||
String exportFieldName = FieldConvertUtil.exportFieldNamesInsideOutsideMeeting + FieldConvertUtil.exportFieldNamesMeetingTopic;
|
||||
if (StringUtils.isNotBlank(exportFieldName)) {
|
||||
String[] headerArr = exportFieldName.split(",");
|
||||
for (int i=0;i < headerArr.length; i++) {
|
||||
rowHeader.createCell(i).setCellValue(headerArr[i]);
|
||||
}
|
||||
}
|
||||
Cell cellA2 = row2.createCell(0);
|
||||
cellA2.setCellValue(FieldConvertUtil.exportInsideOutsideMeetingDesc);
|
||||
//sheetItems.setColumnWidth(0, 20 * 150);
|
||||
row2.setHeight((short) (100 * 25));
|
||||
HSSFCellStyle cellStyle =workbook.createCellStyle();
|
||||
cellStyle.setAlignment(HorizontalAlignment.LEFT);
|
||||
cellStyle.setVerticalAlignment(VerticalAlignment.TOP);
|
||||
cellStyle.setWrapText(true);
|
||||
cellA2.setCellStyle(cellStyle);
|
||||
String repFileName = fileName2.replaceAll("/","_");
|
||||
excelOS = new FileOutputStream(fileNowPath + "/" + repFileName);
|
||||
response.setHeader("Content-Disposition",
|
||||
"attachment; filename=\""+ ReadExcel.encodeFileName(fileOriName+".zip", request) +"\"");
|
||||
response.setContentType("application/force-download");
|
||||
response.flushBuffer();
|
||||
os = response.getOutputStream();
|
||||
workbook.write(excelOS);
|
||||
excelOS.flush();
|
||||
excelOS.close();
|
||||
ZipUtil.zip(fileNowPath,fileNowPath+".zip");
|
||||
FileInputStream fis = new FileInputStream(fileNowPath+".zip");
|
||||
int len = 0;
|
||||
while ((len = fis.read()) != -1) {
|
||||
os.write(len);
|
||||
}
|
||||
os.flush();
|
||||
os.close(); // 后开先关
|
||||
fis.close(); // 先开后关
|
||||
} catch (Exception e) {
|
||||
logger.error(e.getMessage(), e);
|
||||
throw new com.adc.da.exception.AdcDaBaseException("下载文件失败,请重试");
|
||||
} finally {
|
||||
IOUtils.closeQuietly(os);
|
||||
IOUtils.closeQuietly(excelOS);
|
||||
}
|
||||
}
|
||||
}
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
package com.adc.da.slrs.InsideOntSideMeeting.dao;
|
||||
|
||||
import com.adc.da.slrs.InsideOntSideMeeting.entity.InsideOutsideMeeting;
|
||||
import com.adc.da.slrs.InsideOntSideMeeting.entity.InsideOutsideMeetingVO;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author tjzdw
|
||||
* @description
|
||||
* @date 2023/10/10
|
||||
*/
|
||||
@Mapper
|
||||
public interface InsideOutsideMeetingDao extends BaseMapper<InsideOutsideMeeting> {
|
||||
|
||||
Integer queryByPageCount(InsideOutsideMeetingVO page);
|
||||
|
||||
List<InsideOutsideMeetingVO> queryByPage(InsideOutsideMeetingVO page);
|
||||
|
||||
List<InsideOutsideMeetingVO> queryMeetingById(@Param("exportIdList") List<String> exportIdList);
|
||||
|
||||
List<InsideOutsideMeetingVO> queryAllMeeting(InsideOutsideMeetingVO insideOutsideMeetingVO);
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package com.adc.da.slrs.InsideOntSideMeeting.dao;
|
||||
|
||||
import com.adc.da.slrs.InsideOntSideMeeting.entity.MeetingTopic;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @author tjzdw
|
||||
* @description
|
||||
* @date 2023/10/13
|
||||
*/
|
||||
@Mapper
|
||||
public interface MeetingTopicDao extends BaseMapper<MeetingTopic> {
|
||||
|
||||
|
||||
}
|
||||
+114
@@ -0,0 +1,114 @@
|
||||
package com.adc.da.slrs.InsideOntSideMeeting.entity;
|
||||
|
||||
import com.adc.da.att.entity.AttFileEO;
|
||||
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 com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author tjzdw
|
||||
* @description
|
||||
* @date 2023/10/10
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value="inside_outside_meeting表对象", description="内外部会议")
|
||||
@TableName("inside_outside_meeting")
|
||||
public class InsideOutsideMeeting extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "主键")
|
||||
@TableId(value = "ID", type = IdType.ID_WORKER_STR)
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty(value = "会议名称")
|
||||
@TableField("MEETING_NAME")
|
||||
private String meetingName;
|
||||
|
||||
/**
|
||||
* 课题名称,可通过调取功能从政策课题模块中获取
|
||||
*/
|
||||
@ApiModelProperty(value = "课题名称")
|
||||
@TableField("TOPIC_NAME")
|
||||
private String topicName;
|
||||
|
||||
@ApiModelProperty(value = "会议主办单位")
|
||||
@TableField("MEETING_ORGANIZER")
|
||||
private String meetingOrganizer;
|
||||
|
||||
@ApiModelProperty(value = "会议时间")
|
||||
@TableField("MEETING_TIME")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
private Date meetingTime;
|
||||
|
||||
@ApiModelProperty(value = "会议地点")
|
||||
@TableField("MEETING_ADDRESS")
|
||||
private String meetingAddress;
|
||||
|
||||
@ApiModelProperty(value = "参会人员")
|
||||
@TableField("PARTICIPANTS")
|
||||
private String participants;
|
||||
|
||||
@ApiModelProperty(value = "会议纪要")
|
||||
@TableField("MEETING_MINUTES")
|
||||
private String meetingMinutes;
|
||||
|
||||
@ApiModelProperty(value = "会议纪要文件列表")
|
||||
@TableField(exist = false)
|
||||
private List<AttFileEO> meetingMinutesList;
|
||||
|
||||
@ApiModelProperty(value = "会议主要内容")
|
||||
@TableField("MEETING_CONTENT")
|
||||
private String meetingContent;
|
||||
|
||||
@ApiModelProperty(value = "1级会议类别")
|
||||
@TableField("FIRST_MEETING_TYPE")
|
||||
private String firstMeetingType;
|
||||
|
||||
@ApiModelProperty(value = "1级会议类别名称")
|
||||
@TableField(exist = false)
|
||||
private String firstMeetingTypeName;
|
||||
|
||||
@ApiModelProperty(value = "2级会议类别")
|
||||
@TableField("SECOND_MEETING_TYPE")
|
||||
private String secondMeetingType;
|
||||
|
||||
@ApiModelProperty(value = "2级会议类别名称")
|
||||
@TableField(exist = false)
|
||||
private String secondMeetingTypeName;
|
||||
|
||||
@ApiModelProperty(value = "会议议题")
|
||||
@TableField(exist = false)
|
||||
private List<MeetingTopic> meetingTopicList;
|
||||
|
||||
/**
|
||||
* 逻辑删除,0可用,1不可用
|
||||
*/
|
||||
@ApiModelProperty(value = "逻辑删除")
|
||||
@TableField("VALID_FLAG")
|
||||
private Integer validFlag;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@TableField("CREATE_TIME")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
@TableField("MODIFY_TIME")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date modifyTime;
|
||||
}
|
||||
+100
@@ -0,0 +1,100 @@
|
||||
package com.adc.da.slrs.InsideOntSideMeeting.entity;
|
||||
|
||||
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||
import cn.afterturn.easypoi.excel.annotation.ExcelCollection;
|
||||
import com.adc.da.att.entity.AttFileEO;
|
||||
import com.adc.da.base.page.BasePage;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author tjzdw
|
||||
* @description
|
||||
* @date 2023/10/12
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Accessors(chain = true)
|
||||
@Data
|
||||
public class InsideOutsideMeetingVO extends BasePage {
|
||||
|
||||
private String id;
|
||||
|
||||
@Excel(name = "会议名称", needMerge = true)
|
||||
private String meetingName;
|
||||
|
||||
@Excel(name = "课题名称", needMerge = true)
|
||||
private String topicName;
|
||||
|
||||
@Excel(name = "会议主办单位", needMerge = true)
|
||||
private String meetingOrganizer;
|
||||
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "会议时间", exportFormat = "yyyy-MM-dd", needMerge = true)
|
||||
private Date meetingTime;
|
||||
|
||||
@Excel(name = "会议地点", needMerge = true)
|
||||
private String meetingAddress;
|
||||
|
||||
@Excel(name = "参会人员", needMerge = true)
|
||||
private String participants;
|
||||
private List<String> participantsList;
|
||||
|
||||
private String meetingMinutes;
|
||||
|
||||
private List<AttFileEO> meetingMinutesList;
|
||||
|
||||
@Excel(name = "会议主要内容", needMerge = true)
|
||||
private String meetingContent;
|
||||
|
||||
private String firstMeetingType;
|
||||
|
||||
@Excel(name = "1级会议类别", needMerge = true)
|
||||
private String firstMeetingTypeName;
|
||||
|
||||
private String secondMeetingType;
|
||||
|
||||
@Excel(name = "2级会议类别", needMerge = true)
|
||||
private String secondMeetingTypeName;
|
||||
|
||||
@ExcelCollection(name = "会议议题")
|
||||
private List<MeetingTopic> meetingTopicList;
|
||||
|
||||
private String agendaName;
|
||||
|
||||
private String agendaMaterials;
|
||||
|
||||
private String reporter;
|
||||
|
||||
private String reportingUnit;
|
||||
|
||||
private String agendaContent;
|
||||
|
||||
private Integer validFlag;
|
||||
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date modifyTime;
|
||||
|
||||
private String sortField = "ID";
|
||||
|
||||
private String sortMode = "asc";
|
||||
|
||||
private String meetingTimeOperator = "=";
|
||||
|
||||
// 导出使用字段
|
||||
// 被前端选中的记录的ids
|
||||
private String exportIds;
|
||||
|
||||
// 从ids转换过来的id集合
|
||||
private List<String> exportIdList;
|
||||
|
||||
// 导出的文件名
|
||||
private String exportName;
|
||||
}
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
package com.adc.da.slrs.InsideOntSideMeeting.entity;
|
||||
|
||||
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||
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.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* @author tjzdw
|
||||
* @description
|
||||
* @date 2023/10/12
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value="meeting_topic表对象", description="会议议题表")
|
||||
@TableName("meeting_topic")
|
||||
public class MeetingTopic extends BaseEntity {
|
||||
|
||||
@ApiModelProperty(value = "主键")
|
||||
@TableId(value = "ID", type = IdType.ID_WORKER_STR)
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty(value = "内外部会议ID")
|
||||
@TableField("MEETING_ID")
|
||||
private String meetingId;
|
||||
|
||||
@ApiModelProperty(value = "议题名称")
|
||||
@TableField("AGENDA_NAME")
|
||||
@Excel(name = "议题名称")
|
||||
private String agendaName;
|
||||
|
||||
@ApiModelProperty(value = "议题材料")
|
||||
@TableField("AGENDA_MATERIALS")
|
||||
private String agendaMaterials;
|
||||
|
||||
@ApiModelProperty(value = "汇报人")
|
||||
@TableField("REPORTER")
|
||||
@Excel(name = "汇报人")
|
||||
private String reporter;
|
||||
|
||||
@ApiModelProperty(value = "汇报单位")
|
||||
@TableField("REPORTING_UNIT")
|
||||
@Excel(name = "汇报单位")
|
||||
private String reportingUnit;
|
||||
|
||||
@ApiModelProperty(value = "议题主要内容")
|
||||
@TableField("AGENDA_CONTENT")
|
||||
@Excel(name = "议题主要内容")
|
||||
private String agendaContent;
|
||||
}
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
package com.adc.da.slrs.InsideOntSideMeeting.service;
|
||||
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.slrs.InsideOntSideMeeting.entity.InsideOutsideMeeting;
|
||||
import com.adc.da.slrs.InsideOntSideMeeting.entity.InsideOutsideMeetingVO;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author tjzdw
|
||||
* @description
|
||||
* @date 2023/10/10
|
||||
*/
|
||||
public interface InsideOutsideMeetingService extends IService<InsideOutsideMeeting> {
|
||||
|
||||
Integer addMeetingInfo(InsideOutsideMeeting insideOutSideMeeting);
|
||||
|
||||
List<InsideOutsideMeetingVO> queryByPage(InsideOutsideMeetingVO page);
|
||||
|
||||
InsideOutsideMeeting getMeetingInfo(String meetingId);
|
||||
|
||||
Boolean deleteMeetingById(String meetingId);
|
||||
|
||||
Boolean updateMeetingInfo(InsideOutsideMeeting insideOutSideMeeting);
|
||||
|
||||
List<InsideOutsideMeetingVO> queryAllMeeting(InsideOutsideMeetingVO insideOutsideMeetingVO);
|
||||
|
||||
List<InsideOutsideMeetingVO> queryMeetingById(List<String> exportIdList);
|
||||
|
||||
ResponseMessage<?> importMeetingInfo(MultipartFile file) throws ParseException;
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package com.adc.da.slrs.InsideOntSideMeeting.service;
|
||||
|
||||
import com.adc.da.slrs.InsideOntSideMeeting.entity.InsideOutsideMeeting;
|
||||
import com.adc.da.slrs.InsideOntSideMeeting.entity.MeetingTopic;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author tjzdw
|
||||
* @description
|
||||
* @date 2023/10/13
|
||||
*/
|
||||
public interface MeetingTopicService extends IService<MeetingTopic> {
|
||||
|
||||
public List<String> compareMeetingTopic(InsideOutsideMeeting oldTopic, InsideOutsideMeeting newTopic);
|
||||
}
|
||||
+512
@@ -0,0 +1,512 @@
|
||||
package com.adc.da.slrs.InsideOntSideMeeting.service.impl;
|
||||
|
||||
import com.adc.da.att.entity.AttFileEO;
|
||||
import com.adc.da.att.service.IAttFileEOService;
|
||||
import com.adc.da.common.FileUnZip;
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.slrs.InsideOntSideMeeting.dao.InsideOutsideMeetingDao;
|
||||
import com.adc.da.slrs.InsideOntSideMeeting.entity.InsideOutsideMeeting;
|
||||
import com.adc.da.slrs.InsideOntSideMeeting.entity.InsideOutsideMeetingVO;
|
||||
import com.adc.da.slrs.InsideOntSideMeeting.entity.MeetingTopic;
|
||||
import com.adc.da.slrs.InsideOntSideMeeting.service.InsideOutsideMeetingService;
|
||||
import com.adc.da.slrs.InsideOntSideMeeting.service.MeetingTopicService;
|
||||
import com.adc.da.slrs.sarLawsInformation.entity.SarLawsInformation;
|
||||
import com.adc.da.slrs.sarUpdLog.entity.SarUpdLog;
|
||||
import com.adc.da.slrs.sarUpdLog.service.ISarUpdLogService;
|
||||
import com.adc.da.slrs.tsDictionaryType.entity.TsDicType;
|
||||
import com.adc.da.slrs.tsDictionaryType.service.ITsDicTypeService;
|
||||
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.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.hssf.usermodel.HSSFDateUtil;
|
||||
import org.apache.poi.ss.usermodel.*;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author tjzdw
|
||||
* @description
|
||||
* @date 2023/10/10
|
||||
*/
|
||||
@Service
|
||||
public class InsideOutsideMeetingServiceImpl extends ServiceImpl<InsideOutsideMeetingDao, InsideOutsideMeeting> implements InsideOutsideMeetingService {
|
||||
|
||||
@Resource
|
||||
private MeetingTopicService meetingTopicService;
|
||||
@Resource
|
||||
private IAttFileEOService attFileEOService;
|
||||
@Resource
|
||||
private ITsDicTypeService dicTypeService;
|
||||
@Resource
|
||||
private ISarUpdLogService updLogService;
|
||||
|
||||
@Value("${file.path}")
|
||||
private String filePath;//文件存储路径
|
||||
|
||||
@Override
|
||||
public InsideOutsideMeeting getMeetingInfo(String meetingId){
|
||||
InsideOutsideMeeting insideOutsideMeeting = this.baseMapper.selectById(meetingId);
|
||||
if (insideOutsideMeeting != null) {
|
||||
// 获取会议纪要文件对象
|
||||
if (StringUtils.isNotBlank(insideOutsideMeeting.getMeetingMinutes())) {
|
||||
List<AttFileEO> meetingMinutesList = new ArrayList<>();
|
||||
for (String attId : insideOutsideMeeting.getMeetingMinutes().split(",")) {
|
||||
AttFileEO fileInfo = attFileEOService.getFileInfo(attId);
|
||||
meetingMinutesList.add(fileInfo);
|
||||
}
|
||||
insideOutsideMeeting.setMeetingMinutesList(meetingMinutesList);
|
||||
}
|
||||
// 获取会议类别值
|
||||
getTypeByCode(insideOutsideMeeting);
|
||||
// 获取会议课题列表
|
||||
LambdaQueryWrapper<MeetingTopic> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(MeetingTopic::getMeetingId, meetingId);
|
||||
List<MeetingTopic> meetingTopicList = meetingTopicService.list(wrapper);
|
||||
insideOutsideMeeting.setMeetingTopicList(meetingTopicList);
|
||||
}
|
||||
return insideOutsideMeeting;
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public Boolean deleteMeetingById(String meetingId) {
|
||||
LambdaUpdateWrapper<InsideOutsideMeeting> wrapper = new LambdaUpdateWrapper<>();
|
||||
wrapper.eq(InsideOutsideMeeting::getId, meetingId);
|
||||
wrapper.set(InsideOutsideMeeting::getValidFlag,1);
|
||||
boolean update = update(wrapper);
|
||||
if (update) {
|
||||
LambdaQueryWrapper<MeetingTopic> topicWrapper = new LambdaQueryWrapper<>();
|
||||
topicWrapper.eq(MeetingTopic::getMeetingId, meetingId);
|
||||
meetingTopicService.remove(topicWrapper);
|
||||
}
|
||||
return update;
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public Boolean updateMeetingInfo(InsideOutsideMeeting insideOutsideMeeting) {
|
||||
if (StringUtils.isBlank(insideOutsideMeeting.getId())) {
|
||||
return false;
|
||||
}
|
||||
InsideOutsideMeeting insideOutsideMeetingDB = this.baseMapper.selectById(insideOutsideMeeting.getId());
|
||||
List<String> diffList = compareInsideOutsideMeeting(insideOutsideMeetingDB, insideOutsideMeeting);
|
||||
if (diffList.size() > 0) {
|
||||
insideOutsideMeeting.setModifyTime(new Date());
|
||||
int update = this.baseMapper.updateById(insideOutsideMeeting);
|
||||
if (update > 0) {
|
||||
LambdaQueryWrapper<MeetingTopic> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(MeetingTopic::getMeetingId,insideOutsideMeeting.getId());
|
||||
// 先删除会议信息
|
||||
meetingTopicService.remove(wrapper);
|
||||
// 再添加会议信息
|
||||
for (MeetingTopic meetingTopic : insideOutsideMeeting.getMeetingTopicList()) {
|
||||
meetingTopic.setMeetingId(insideOutsideMeeting.getId());
|
||||
meetingTopicService.save(meetingTopic);
|
||||
}
|
||||
// 存储修改记录
|
||||
SarUpdLog sarUpdLogEO = new SarUpdLog();
|
||||
sarUpdLogEO.setId(UUIDUtils.randomUUID20());
|
||||
sarUpdLogEO.setSarId(insideOutsideMeetingDB.getId());
|
||||
sarUpdLogEO.setSarType("INSIDE_OUTSIDE_MEETING");
|
||||
sarUpdLogEO.setCreationTime(new Date());
|
||||
sarUpdLogEO.setCreationUser(LoginUserUtil.getUserId());
|
||||
sarUpdLogEO.setContent(insideOutsideMeetingDB.getMeetingName() + "," + String.join(",",diffList));
|
||||
updLogService.save(sarUpdLogEO);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// 用于Excel文件导出
|
||||
@Override
|
||||
public List<InsideOutsideMeetingVO> queryAllMeeting(InsideOutsideMeetingVO insideOutsideMeetingVO) {
|
||||
List<InsideOutsideMeetingVO> insideOutsideMeetingVOList = this.baseMapper.queryAllMeeting(insideOutsideMeetingVO);
|
||||
for (InsideOutsideMeetingVO meetingVO : insideOutsideMeetingVOList) {
|
||||
// 获取会议类别值
|
||||
getTypeByCode(meetingVO);
|
||||
}
|
||||
return insideOutsideMeetingVOList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<InsideOutsideMeetingVO> queryMeetingById(List<String> exportIdList) {
|
||||
List<InsideOutsideMeetingVO> insideOutsideMeetingVOList = this.baseMapper.queryMeetingById(exportIdList);
|
||||
for (InsideOutsideMeetingVO meetingVO : insideOutsideMeetingVOList) {
|
||||
getTypeByCode(meetingVO);
|
||||
}
|
||||
return insideOutsideMeetingVOList;
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public Integer addMeetingInfo(InsideOutsideMeeting insideOutsideMeeting) {
|
||||
insideOutsideMeeting.setCreateTime(new Date());
|
||||
insideOutsideMeeting.setModifyTime(new Date());
|
||||
insideOutsideMeeting.setValidFlag(0);
|
||||
int insert = this.baseMapper.insert(insideOutsideMeeting);
|
||||
if (!insideOutsideMeeting.getMeetingTopicList().isEmpty()) {
|
||||
for (MeetingTopic meetingTopic : insideOutsideMeeting.getMeetingTopicList()) {
|
||||
meetingTopic.setMeetingId(insideOutsideMeeting.getId());
|
||||
meetingTopicService.save(meetingTopic);
|
||||
}
|
||||
}
|
||||
return insert;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<InsideOutsideMeetingVO> queryByPage(InsideOutsideMeetingVO page){
|
||||
if (StringUtils.isNotBlank(page.getParticipants())) {
|
||||
page.setParticipantsList(Arrays.asList(page.getParticipants().split(",")));
|
||||
}
|
||||
// 设置排序字段
|
||||
if (StringUtils.isNotBlank(page.getSortField())) {
|
||||
// 小驼峰变成 ABC_DEF
|
||||
String sortField = StringUtils.join(StringUtils.splitByCharacterTypeCamelCase(page.getSortField()),"_").toUpperCase();
|
||||
page.setSortField(sortField);
|
||||
} else {
|
||||
page.setSortField("ID");
|
||||
page.setSortMode("asc");
|
||||
}
|
||||
Integer rowCount = this.baseMapper.queryByPageCount(page);
|
||||
page.getPager().setRowCount(rowCount);
|
||||
List<InsideOutsideMeetingVO> insideOutsideMeetingVOList = this.baseMapper.queryByPage(page);
|
||||
for (InsideOutsideMeetingVO insideOutsideMeeting : insideOutsideMeetingVOList) {
|
||||
// 获取会议纪要文件对象
|
||||
if (StringUtils.isNotBlank(insideOutsideMeeting.getMeetingMinutes())) {
|
||||
List<AttFileEO> meetingMinutesList = new ArrayList<>();
|
||||
for (String attId : insideOutsideMeeting.getMeetingMinutes().split(",")) {
|
||||
AttFileEO fileInfo = attFileEOService.getFileInfo(attId);
|
||||
meetingMinutesList.add(fileInfo);
|
||||
}
|
||||
insideOutsideMeeting.setMeetingMinutesList(meetingMinutesList);
|
||||
}
|
||||
// 获取会议类别值
|
||||
getTypeByCode(insideOutsideMeeting);
|
||||
}
|
||||
return insideOutsideMeetingVOList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseMessage<?> importMeetingInfo(MultipartFile file) throws ParseException {
|
||||
//获取文件全称
|
||||
String fileNameStr = file.getOriginalFilename();
|
||||
//获取最后.的位置
|
||||
assert fileNameStr != null;
|
||||
int pos = fileNameStr.lastIndexOf(".");
|
||||
//获取压缩文件名称并以小写显示
|
||||
String fileStr = fileNameStr.substring(pos + 1).toLowerCase();
|
||||
//校验是否是zip文件
|
||||
if (!fileStr.equals("zip")) {
|
||||
return Result.error("请上传zip格式的文件");
|
||||
}
|
||||
//进行拼接获取文件名称
|
||||
String fileName = fileNameStr.substring(0, pos);
|
||||
//获取路径和文件名称
|
||||
String path = filePath + "/" + fileName;
|
||||
|
||||
File saveDirectory = new File(path);
|
||||
//判断saveDirectory中是否是文件夹
|
||||
if (!saveDirectory.isDirectory()) {
|
||||
saveDirectory.mkdir();
|
||||
}
|
||||
//将文件写入到指定路径中
|
||||
try {
|
||||
FileUtils.copyInputStreamToFile(file.getInputStream(), new File(path + "/" + fileNameStr));
|
||||
} catch (IOException e) {
|
||||
return Result.error("文件存储失败!");
|
||||
}
|
||||
//解压缩
|
||||
String zipEntryName = null;
|
||||
try {
|
||||
zipEntryName = FileUnZip.unZipFiles(path + "/" + fileNameStr, path);
|
||||
FileUnZip.delete(new File(path + "/" + fileNameStr));
|
||||
} catch (IOException e) {
|
||||
return Result.error("文件解压失败");
|
||||
}
|
||||
//获取文件信息
|
||||
List<File> fileList = readImpExcelFile(zipEntryName);
|
||||
//判断获取到的文件数量
|
||||
if (fileList.size() != 1) {
|
||||
return Result.error("上传的文件只能有一个");
|
||||
}
|
||||
File importFile = fileList.get(0);
|
||||
if (!importFile.getName().contains(".xls") && !importFile.getName().contains(".xlsx")) {
|
||||
return Result.error("文件必须是EXCEL文件");
|
||||
}
|
||||
Workbook workbook = null;
|
||||
try {
|
||||
workbook = WorkbookFactory.create(importFile);
|
||||
} catch (IOException e) {
|
||||
FileUnZip.deleteDir(saveDirectory);
|
||||
return Result.error("导入失败,需要导入的数据有问题或导入的企标标号和企标名称已存在");
|
||||
}
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
Sheet sheet = workbook.getSheetAt(0);
|
||||
if (sheet == null) {
|
||||
return Result.error("工作表为空");
|
||||
}
|
||||
StringBuilder sb = new StringBuilder();
|
||||
List<String> headerList = new ArrayList<>();
|
||||
// 获取excel表头
|
||||
Row headerRow = sheet.getRow(1);
|
||||
for (int i = 0; i <= 12; i++) {
|
||||
headerList.add(headerRow.getCell(i).getStringCellValue());
|
||||
}
|
||||
|
||||
// 判断表头字段是否相同
|
||||
if (!String.join(",",headerList).equals(FieldConvertUtil.exportFieldNamesInsideOutsideMeeting + "," + FieldConvertUtil.exportFieldNamesMeetingTopic)) {
|
||||
try {
|
||||
workbook.close();
|
||||
} catch (IOException e) {
|
||||
return Result.error("文件关闭出错");
|
||||
}
|
||||
//删除原上传文件
|
||||
FileUnZip.deleteDir(saveDirectory);
|
||||
return Result.error("fail", "读取失败,请严格按照模板文件导入数据");
|
||||
}
|
||||
// 获取总行数
|
||||
int rowNum = sheet.getPhysicalNumberOfRows();
|
||||
List<Map<String,String>> importDataList = new ArrayList<>();
|
||||
// 开始遍历表格行
|
||||
for (int rowIndex = 2; rowIndex < rowNum; rowIndex++) {
|
||||
// 获取每一行
|
||||
Row row = sheet.getRow(rowIndex);
|
||||
// 用于存储每行的键值对数据,对应一条数据
|
||||
Map<String, String> rowMap = new LinkedHashMap<>();
|
||||
// 总列数
|
||||
int columnNum = 13;
|
||||
// 遍历每个单元格
|
||||
for (int columnIndex = 0; columnIndex < columnNum; columnIndex++) {
|
||||
// 获取单元格
|
||||
Cell cell = row.getCell(columnIndex);
|
||||
// 获取表头单元格
|
||||
Cell headerCell = headerRow.getCell(columnIndex);
|
||||
if (cell != null) {
|
||||
if (CellType.NUMERIC == cell.getCellType() && HSSFDateUtil.isCellDateFormatted(cell)) {
|
||||
Date d = cell.getDateCellValue();
|
||||
if (d.before(sdf.parse("1900-01-01")) || d.after(sdf.parse("2500-01-01"))) {
|
||||
return Result.error("输入的日期异常,请按照实际日期填写");
|
||||
}
|
||||
// 将单元格数据存入Map中
|
||||
rowMap.put(headerCell.getStringCellValue(), sdf.format(d));
|
||||
} else {
|
||||
cell.setCellType(CellType.STRING);
|
||||
if (cell.getStringCellValue().length() > 500) {
|
||||
return Result.error("单元格输入过长");
|
||||
}
|
||||
rowMap.put(headerCell.getStringCellValue(), cell.getStringCellValue());
|
||||
}
|
||||
} else {
|
||||
rowMap.put(headerCell.getStringCellValue(), "");
|
||||
}
|
||||
}
|
||||
importDataList.add(rowMap);
|
||||
}
|
||||
|
||||
// 获取需要校验的字段
|
||||
List<TsDicType> firstMeetingTypeList = dicTypeService.selectAllDicTypeNameByDicCode("firstMeetingType");
|
||||
Set<String> firstMeetingTypeNameSet = firstMeetingTypeList.stream().map(TsDicType::getDicTypeName).collect(Collectors.toSet());
|
||||
List<TsDicType> secondMeetingTypeList = dicTypeService.selectAllDicTypeNameByDicCode("secondMeetingType");
|
||||
Set<String> secondMeetingTypeNameSet = secondMeetingTypeList.stream().map(TsDicType::getDicTypeName).collect(Collectors.toSet());
|
||||
// 计数器,用于处理出现多条会议课题的情况
|
||||
int count = 0;
|
||||
// InsideOutsideMeeting insideOutsideMeetingDB = null;
|
||||
InsideOutsideMeeting insideOutsideMeeting = new InsideOutsideMeeting();
|
||||
List<MeetingTopic> meetingTopicList = new ArrayList<>();
|
||||
for (Map<String, String> dataMap : importDataList) {
|
||||
String meetingName = dataMap.get("会议名称");
|
||||
// 如果会议名称为空,则表示该行为会议课题行,是之前会议的会议课题,不提交之前的会议信息。不为空则进入
|
||||
if (StringUtils.isNotBlank(meetingName)) {
|
||||
// 如果计数器大于0,表示进入了新的会议信息中,提交之前的会议信息
|
||||
if (count > 0) {
|
||||
insideOutsideMeeting.setMeetingTopicList(meetingTopicList);
|
||||
addMeetingInfo(insideOutsideMeeting);
|
||||
// 初始化会议课题列表
|
||||
meetingTopicList.clear();
|
||||
// 初始化会议对象
|
||||
insideOutsideMeeting = new InsideOutsideMeeting();
|
||||
// 计数器归零
|
||||
count = 0;
|
||||
}
|
||||
insideOutsideMeeting.setMeetingName(meetingName);
|
||||
insideOutsideMeeting.setTopicName(dataMap.get("课题名称"));
|
||||
insideOutsideMeeting.setMeetingOrganizer(dataMap.get("会议主办单位"));
|
||||
insideOutsideMeeting.setMeetingTime(sdf.parse(dataMap.get("会议时间")));
|
||||
insideOutsideMeeting.setMeetingAddress(dataMap.get("会议地点"));
|
||||
insideOutsideMeeting.setParticipants(dataMap.get("参会人员"));
|
||||
insideOutsideMeeting.setMeetingContent(dataMap.get("会议主要内容"));
|
||||
if (StringUtils.isNotBlank(dataMap.get("一级会议类别"))) {
|
||||
if (!firstMeetingTypeNameSet.contains(dataMap.get("一级会议类别"))){
|
||||
return Result.error("一级会议类别不符合输入要求");
|
||||
}
|
||||
for (TsDicType tsDicType : firstMeetingTypeList) {
|
||||
if (dataMap.get("一级会议类别").equals(tsDicType.getDicTypeName())) {
|
||||
insideOutsideMeeting.setFirstMeetingType(tsDicType.getDicTypeCode());
|
||||
}
|
||||
}
|
||||
}
|
||||
if (StringUtils.isNotBlank(dataMap.get("二级会议类别"))) {
|
||||
if (!secondMeetingTypeNameSet.contains(dataMap.get("二级会议类别"))){
|
||||
return Result.error("二级会议类别不符合输入要求");
|
||||
}
|
||||
for (TsDicType tsDicType : secondMeetingTypeList) {
|
||||
if (dataMap.get("二级会议类别").equals(tsDicType.getDicTypeName())) {
|
||||
insideOutsideMeeting.setSecondMeetingType(tsDicType.getDicTypeCode());
|
||||
}
|
||||
}
|
||||
}
|
||||
// 会议课题信息
|
||||
MeetingTopic meetingTopic = new MeetingTopic();
|
||||
meetingTopic.setAgendaName(dataMap.get("议题名称"));
|
||||
meetingTopic.setReporter(dataMap.get("汇报人"));
|
||||
meetingTopic.setReportingUnit(dataMap.get("汇报单位"));
|
||||
meetingTopic.setAgendaContent(dataMap.get("议题主要内容"));
|
||||
meetingTopicList.add(meetingTopic);
|
||||
count++;
|
||||
} else {
|
||||
// 进入else 表示该行是会议课题行
|
||||
MeetingTopic meetingTopic = new MeetingTopic();
|
||||
meetingTopic.setAgendaName(dataMap.get("议题名称"));
|
||||
meetingTopic.setReporter(dataMap.get("汇报人"));
|
||||
meetingTopic.setReportingUnit(dataMap.get("汇报单位"));
|
||||
meetingTopic.setAgendaContent(dataMap.get("议题主要内容"));
|
||||
meetingTopicList.add(meetingTopic);
|
||||
count++;
|
||||
}
|
||||
}
|
||||
// 插入最后一条记录
|
||||
insideOutsideMeeting.setMeetingTopicList(meetingTopicList);
|
||||
addMeetingInfo(insideOutsideMeeting);
|
||||
return Result.success("导入完成");
|
||||
}
|
||||
|
||||
private static List<File> readImpExcelFile(String path) {
|
||||
File file = new File(path);
|
||||
List<File> resultlist = new ArrayList<>();
|
||||
if (file.isDirectory()) {
|
||||
File[] files = file.listFiles();
|
||||
for (File fi : files) {
|
||||
// 对文件进行过滤,读取所有文件
|
||||
String name = fi.getName();
|
||||
//文件不为空 添加
|
||||
if (name != null){
|
||||
resultlist.add(fi);
|
||||
}
|
||||
}
|
||||
}
|
||||
return resultlist;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 比较两个InsideOutSideMeeting 对象
|
||||
* @param oldMeeting 数据库中存储的对象
|
||||
* @param newMeeting 更新后的对象
|
||||
* @return 差异
|
||||
*/
|
||||
public List<String> compareInsideOutsideMeeting(InsideOutsideMeeting oldMeeting, InsideOutsideMeeting newMeeting) {
|
||||
List<String> changes = new ArrayList<>();
|
||||
// 不需要比较的字段
|
||||
String[] ignoreFields = {"id","validFlag","createTime","modifyTime", "firstMeetingTypeName", "secondMeetingTypeName"};
|
||||
List<String> ignoreFieldList = Arrays.asList(ignoreFields);
|
||||
// 获取SarLawsInformation类的所有字段
|
||||
Field[] fields = InsideOutsideMeeting.class.getDeclaredFields();
|
||||
for (Field field : fields) {
|
||||
if (!ignoreFieldList.contains(field.getName())) {
|
||||
try {
|
||||
field.setAccessible(true);
|
||||
String oldValue = String.valueOf(field.get(oldMeeting));
|
||||
String newValue = String.valueOf(field.get(newMeeting));
|
||||
if (!Objects.equals(oldValue, newValue)) {
|
||||
if ("firstMeetingType".equals(field.getName()) || "secondMeetingType".equals(field.getName())) {
|
||||
String typeName = "";
|
||||
if (StringUtils.isNotBlank(newValue)) {
|
||||
typeName = dicTypeService.getDicTypeNameByDicCode(newValue);
|
||||
}
|
||||
// 获取资料类型名称
|
||||
String fieldName = field.getName().substring(0, 1).toUpperCase() + field.getName().substring(1);
|
||||
Method method = InsideOutsideMeeting.class.getMethod("get" + fieldName + "Name");
|
||||
Object oldTypeName = method.invoke(oldMeeting);
|
||||
ApiModelProperty annotationsByType = field.getAnnotationsByType(ApiModelProperty.class)[0];
|
||||
changes.add(annotationsByType.value() + "由\"" + oldTypeName + "\"改为\"" + typeName + "\"");
|
||||
} else if ("meetingMinutes".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 = InsideOutsideMeeting.class.getMethod("get" + fieldName + "List");
|
||||
List<?> oldFileList = (List)method.invoke(oldMeeting);
|
||||
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) + "\"");
|
||||
}
|
||||
else if ("meetingTopicList".equals(field.getName())) {
|
||||
ApiModelProperty annotationsByType = field.getAnnotationsByType(ApiModelProperty.class)[0];
|
||||
changes.add(annotationsByType.value() + "被变更");
|
||||
}
|
||||
else {
|
||||
ApiModelProperty annotationsByType = field.getAnnotationsByType(ApiModelProperty.class)[0];
|
||||
changes.add(annotationsByType.value() + "由\"" + oldValue + "\"改为\"" + newValue + "\"");
|
||||
}
|
||||
}
|
||||
} catch (IllegalAccessException | NoSuchMethodException | InvocationTargetException e) {
|
||||
// 处理异常
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
return changes;
|
||||
}
|
||||
|
||||
public void getTypeByCode(InsideOutsideMeetingVO meetingVO) {
|
||||
// 获取会议类别值
|
||||
if (StringUtils.isNotBlank(meetingVO.getFirstMeetingType())) {
|
||||
meetingVO.setFirstMeetingTypeName(dicTypeService.getDicTypeNameByDicCode(meetingVO.getFirstMeetingType()));
|
||||
}
|
||||
if (StringUtils.isNotBlank(meetingVO.getSecondMeetingType())) {
|
||||
meetingVO.setSecondMeetingTypeName(dicTypeService.getDicTypeNameByDicCode(meetingVO.getSecondMeetingType()));
|
||||
}
|
||||
}
|
||||
public void getTypeByCode(InsideOutsideMeeting meeting) {
|
||||
// 获取会议类别值
|
||||
if (StringUtils.isNotBlank(meeting.getFirstMeetingType())) {
|
||||
meeting.setFirstMeetingTypeName(dicTypeService.getDicTypeNameByDicCode(meeting.getFirstMeetingType()));
|
||||
}
|
||||
if (StringUtils.isNotBlank(meeting.getSecondMeetingType())) {
|
||||
meeting.setSecondMeetingTypeName(dicTypeService.getDicTypeNameByDicCode(meeting.getSecondMeetingType()));
|
||||
}
|
||||
}
|
||||
}
|
||||
+79
@@ -0,0 +1,79 @@
|
||||
package com.adc.da.slrs.InsideOntSideMeeting.service.impl;
|
||||
|
||||
import com.adc.da.att.entity.AttFileEO;
|
||||
import com.adc.da.att.service.IAttFileEOService;
|
||||
import com.adc.da.slrs.InsideOntSideMeeting.dao.MeetingTopicDao;
|
||||
import com.adc.da.slrs.InsideOntSideMeeting.entity.InsideOutsideMeeting;
|
||||
import com.adc.da.slrs.InsideOntSideMeeting.entity.MeetingTopic;
|
||||
import com.adc.da.slrs.InsideOntSideMeeting.service.MeetingTopicService;
|
||||
import com.adc.da.slrs.sarLawsInformation.entity.SarLawsInformation;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author tjzdw
|
||||
* @description
|
||||
* @date 2023/10/13
|
||||
*/
|
||||
@Service
|
||||
public class MeetingTopicServiceImpl extends ServiceImpl<MeetingTopicDao, MeetingTopic> implements MeetingTopicService {
|
||||
|
||||
@Resource
|
||||
private IAttFileEOService attFileEOService;
|
||||
|
||||
@Override
|
||||
public List<String> compareMeetingTopic(InsideOutsideMeeting oldTopic, InsideOutsideMeeting newTopic) {
|
||||
List<String> changes = new ArrayList<>();
|
||||
// 不需要比较的字段
|
||||
String[] ignoreFields = {"id","meetingId"};
|
||||
List<String> ignoreFieldList = Arrays.asList(ignoreFields);
|
||||
// 获取SarLawsInformation类的所有字段
|
||||
Field[] fields = SarLawsInformation.class.getDeclaredFields();
|
||||
for (Field field : fields) {
|
||||
if (!ignoreFieldList.contains(field.getName())) {
|
||||
try {
|
||||
field.setAccessible(true);
|
||||
String oldValue = String.valueOf(field.get(oldTopic));
|
||||
String newValue = String.valueOf(field.get(newTopic));
|
||||
if (!Objects.equals(oldValue, newValue)) {
|
||||
if ("agendaMaterials".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 + "Name");
|
||||
Object oldTypeName = method.invoke(oldTopic);
|
||||
// 获取字段名称
|
||||
ApiModelProperty annotationsByType = field.getAnnotationsByType(ApiModelProperty.class)[0];
|
||||
changes.add(annotationsByType.value() + "由\"" + oldTypeName + "\"改为\"" + String.join(",",fileNameList) + "\"");
|
||||
} else {
|
||||
ApiModelProperty annotationsByType = field.getAnnotationsByType(ApiModelProperty.class)[0];
|
||||
changes.add(annotationsByType.value() + "由\"" + oldValue + "\"改为\"" + newValue + "\"");
|
||||
}
|
||||
}
|
||||
} catch (IllegalAccessException | NoSuchMethodException | InvocationTargetException e) {
|
||||
// 处理异常
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
return changes;
|
||||
}
|
||||
}
|
||||
+14
-5
@@ -1,11 +1,9 @@
|
||||
package com.adc.da.slrs.NewsFeed.controller;
|
||||
|
||||
import com.adc.da.base.web.BaseController;
|
||||
import com.adc.da.http.PageInfo;
|
||||
import com.adc.da.slrs.NewsFeed.entity.NewsFeed;
|
||||
import com.adc.da.slrs.NewsFeed.page.NewsFeedPage;
|
||||
import com.adc.da.slrs.NewsFeed.service.Impl.NewsFeedServiceImpl;
|
||||
import com.adc.da.slrs.msgDynamicInfo.entity.MsgDynamicInfoEO;
|
||||
import com.adc.da.util.http.ResponseMessage;
|
||||
import com.adc.da.util.http.Result;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
@@ -20,7 +18,12 @@ import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalTime;
|
||||
import java.time.ZoneId;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -42,9 +45,15 @@ public class NewsFeedController extends BaseController<NewsFeed> {
|
||||
iPage.setCurrent(page.getPage());
|
||||
iPage.setSize(page.getPageSize());
|
||||
List<String> list = new ArrayList<>();
|
||||
if("GNWBZFG".equals(page.getMessageType())){
|
||||
QueryWrapper<NewsFeed> queryWrapper = new QueryWrapper<>();
|
||||
if("GNBZFG".equals(page.getMessageType())){
|
||||
list.add("hc99551723c");
|
||||
}else if("ZYBZFG".equals(page.getMessageType())){
|
||||
queryWrapper.eq("RESOURCE_TYPE","INLAND");
|
||||
}else if ("GWBZFG".equals(page.getMessageType())){
|
||||
list.add("hc99551723c");
|
||||
queryWrapper.eq("RESOURCE_TYPE","FOREIGN");
|
||||
}
|
||||
else if("ZYBZFG".equals(page.getMessageType())){
|
||||
list.add("hya6gay4vx");
|
||||
list.add("8rjsx83ows");
|
||||
list.add("ncb6osftj8");
|
||||
@@ -52,7 +61,7 @@ public class NewsFeedController extends BaseController<NewsFeed> {
|
||||
}else if("QYBZFB".equals(page.getMessageType())){
|
||||
list.add("6jnqba2mby");
|
||||
}
|
||||
QueryWrapper queryWrapper = new QueryWrapper();
|
||||
|
||||
queryWrapper.eq(StringUtils.isNotEmpty(page.getStandardId()),"STANDARD_ID",page.getStandardId());
|
||||
queryWrapper.eq(StringUtils.isNotEmpty(page.getStandardName()),"STANDARD_NAME",page.getStandardName());
|
||||
queryWrapper.eq("MESSAGE_TYPE",page.getMessageType());
|
||||
|
||||
+25
@@ -14,6 +14,7 @@ import com.adc.da.util.LoginUserUtil;
|
||||
import com.adc.da.util.UUIDUtils;
|
||||
import com.adc.da.util.http.ResponseMessage;
|
||||
import com.adc.da.util.http.Result;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
@@ -110,6 +111,30 @@ public class AskQuestionsController extends BaseController<AskQuestions> {
|
||||
return Result.success(iPage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据问题ID查询问题
|
||||
* @param id 问题ID
|
||||
* @return 问题对象
|
||||
*/
|
||||
@GetMapping("/askQuestionById")
|
||||
public ResponseMessage<AskQuestions> getAskQuestionById(String id) {
|
||||
if (StringUtils.isBlank(id)) {
|
||||
return Result.error("ID为空");
|
||||
}
|
||||
AskQuestions askQuestion = askQuestionsService.getById(id);
|
||||
if (askQuestion == null) {
|
||||
return Result.success(null);
|
||||
}
|
||||
QueryWrapper<Subscription> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("ASK_ID",askQuestion.getId());
|
||||
queryWrapper.eq("USID", LoginUserUtil.getUserId());
|
||||
List<Subscription> list = subscriptionService.list(queryWrapper);
|
||||
if(!list.isEmpty()){
|
||||
askQuestion.setSubState(list.get(0).getSubState());
|
||||
}
|
||||
return Result.success(askQuestion);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询问题列表
|
||||
* @return
|
||||
|
||||
+6
@@ -238,6 +238,12 @@ public class EsRevisePlanController extends BaseController<EsRevisePlan> {
|
||||
return Result.success(iEsRevisePlanService.modPlanByState(esRevisePlan));
|
||||
}
|
||||
|
||||
// @ApiOperation(value = "编辑企标计划-企标技术更新计划状态-计算质量评分")
|
||||
// @PostMapping("modPlanByStateAndScore")
|
||||
// public ResponseMessage<Object> modPlanByStateAndScore(EsRevisePlan esRevisePlan){
|
||||
// return Result.success(iEsRevisePlanService.modPlanByStateAndScore(esRevisePlan));
|
||||
// }
|
||||
|
||||
@ApiOperation(value = "编辑企标计划-流程")
|
||||
@PostMapping("modPlanByProcess")
|
||||
public ResponseMessage<Object> modPlanByProcess(@RequestBody EsRevisePlan esRevisePlan){
|
||||
|
||||
@@ -62,7 +62,6 @@ public class EsRevisePlan extends BasePage {
|
||||
@TableField(exist = false)
|
||||
private String standNumber;
|
||||
@ApiModelProperty(value = "质量评分")
|
||||
@TableField(exist = false)
|
||||
private Double score;
|
||||
|
||||
|
||||
|
||||
+1
@@ -37,4 +37,5 @@ public interface IEsRevisePlanService extends IService<EsRevisePlan> {
|
||||
|
||||
List<EsRevisePlan> batchToDoTasks(String json);
|
||||
|
||||
// String modPlanByStateAndScore(EsRevisePlan esRevisePlan);
|
||||
}
|
||||
|
||||
+25
-8
@@ -20,7 +20,9 @@ import com.adc.da.sys.entity.UserEO;
|
||||
import com.adc.da.util.UUIDUtils;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
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.google.gson.JsonObject;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
@@ -80,14 +82,15 @@ public class EsRevisePlanServiceImpl extends ServiceImpl<EsRevisePlanDao, EsRevi
|
||||
esRevisePlan.getPager().setRowCount(count);
|
||||
List<EsRevisePlan> esRevisePlans = esRevisePlanDao.queryAll(esRevisePlan);
|
||||
// 获取质量评分
|
||||
NumberFormat nf = NumberFormat.getNumberInstance();
|
||||
nf.setMaximumFractionDigits(2);
|
||||
nf.setRoundingMode(RoundingMode.UP);
|
||||
for (EsRevisePlan revisePlan : esRevisePlans) {
|
||||
if (StringUtils.isNotBlank(revisePlan.getStandId())) {
|
||||
Map<String, Double> scoreMap = qualityEvaluationService.getScore(revisePlan.getStandId());
|
||||
String quality = nf.format(scoreMap.get("quality"));
|
||||
revisePlan.setScore(Double.valueOf(quality));
|
||||
// NumberFormat nf = NumberFormat.getNumberInstance();
|
||||
// nf.setMaximumFractionDigits(2);
|
||||
// nf.setRoundingMode(RoundingMode.UP);
|
||||
if (esRevisePlan.getScore() == null){
|
||||
for (EsRevisePlan revisePlan : esRevisePlans) {
|
||||
if (StringUtils.isNotBlank(revisePlan.getStandId())) {
|
||||
Map<String, Double> score = qualityEvaluationService.getScore(revisePlan.getStandId());
|
||||
revisePlan.setScore(score.get("finalScore"));
|
||||
}
|
||||
}
|
||||
}
|
||||
return esRevisePlans;
|
||||
@@ -279,4 +282,18 @@ public class EsRevisePlanServiceImpl extends ServiceImpl<EsRevisePlanDao, EsRevi
|
||||
}
|
||||
return esRevisePlans;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public String modPlanByStateAndScore(EsRevisePlan esRevisePlan) {
|
||||
// if (StringUtils.isBlank(esRevisePlan.getStandId())) {
|
||||
// return "失败";
|
||||
// }
|
||||
// modPlanByState(esRevisePlan);
|
||||
// String score = qualityEvaluationService.getScore(esRevisePlan.getStandId());
|
||||
// LambdaUpdateWrapper<EsRevisePlan> wrapper = new LambdaUpdateWrapper<>();
|
||||
// wrapper.eq(EsRevisePlan::getStandId, esRevisePlan.getStandId());
|
||||
// wrapper.set(EsRevisePlan::getScore, score.get("quality"));
|
||||
// update(wrapper);
|
||||
// return "修改成功";
|
||||
// }
|
||||
}
|
||||
|
||||
+12
-4
@@ -4,11 +4,14 @@ import com.adc.da.slrs.sarBussStandSn.entity.SarBussStandSn;
|
||||
import com.adc.da.slrs.sarBussStandSn.dao.SarBussStandSnDao;
|
||||
import com.adc.da.slrs.sarBussStandSn.service.ISarBussStandSnService;
|
||||
import com.adc.da.slrs.sarBussionessStand.service.ISarBussionessStandService;
|
||||
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.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -25,6 +28,8 @@ import java.util.Date;
|
||||
@Service
|
||||
public class SarBussStandSnServiceImpl extends ServiceImpl<SarBussStandSnDao, SarBussStandSn> implements ISarBussStandSnService {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(SarBussStandSnServiceImpl.class);
|
||||
|
||||
@Autowired
|
||||
private ISarBussStandSnService iSarBussStandSnService;
|
||||
|
||||
@@ -33,10 +38,12 @@ public class SarBussStandSnServiceImpl extends ServiceImpl<SarBussStandSnDao, Sa
|
||||
|
||||
@Override
|
||||
public Boolean verifySnExists(String taskId,String standSn,String standSort){
|
||||
QueryWrapper<SarBussStandSn> qw = new QueryWrapper();
|
||||
qw.eq("STAND_SORT",standSort);
|
||||
qw.eq("STAND_SN",standSn);
|
||||
qw.and(wrapper -> wrapper.ne("TASK_ID",taskId).or().isNull("TASK_ID"));
|
||||
LambdaQueryWrapper<SarBussStandSn> qw = new LambdaQueryWrapper<>();
|
||||
qw.eq(SarBussStandSn::getStandSort,standSort);
|
||||
qw.eq(SarBussStandSn::getStandSn,standSn);
|
||||
qw.eq(SarBussStandSn::getUseStatus,"yes");
|
||||
qw.eq(SarBussStandSn::getValidFlag,"0");
|
||||
qw.and(wrapper -> wrapper.ne(SarBussStandSn::getTaskId,taskId).or().isNull(SarBussStandSn::getTaskId));
|
||||
int count = iSarBussStandSnService.count(qw);
|
||||
QueryWrapper qw2 = new QueryWrapper();
|
||||
qw2.eq("STAND_SORT",standSort);
|
||||
@@ -59,6 +66,7 @@ public class SarBussStandSnServiceImpl extends ServiceImpl<SarBussStandSnDao, Sa
|
||||
updateWrapper.set("USE_STATUS","no");
|
||||
updateWrapper.set("TASK_ID",null);
|
||||
updateWrapper.eq("TASK_ID",taskId);
|
||||
logger.info("任务"+ taskId +",修改顺序号为未使用");
|
||||
return iSarBussStandSnService.update(updateWrapper);
|
||||
}
|
||||
|
||||
|
||||
+36
-1
@@ -89,6 +89,7 @@ import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.File;
|
||||
import java.sql.Clob;
|
||||
import java.text.DecimalFormat;
|
||||
@@ -228,6 +229,8 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
||||
|
||||
@Autowired
|
||||
private ISarBussStandSnService sarBussStandSnService;
|
||||
@Resource
|
||||
private ISarMenuStandardService sarMenuStandardService;
|
||||
|
||||
@Override
|
||||
public String getStandInfoByReviseStatus(String reviseStatus,String standSort,String taskId){
|
||||
@@ -1380,6 +1383,14 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
||||
}
|
||||
}
|
||||
sarBussionessStandEO = newStandList.get(0);
|
||||
// 处理标准体系字段
|
||||
Object txlbbuss = sarBussionessStandEO.getAttrInfoMap().get("TXLBBUSS");
|
||||
if (txlbbuss != null && !Objects.equals(txlbbuss.toString(), "")) {
|
||||
// 配置体系类别
|
||||
String txlbBussLevel = getParentNodePathRecursive((String) txlbbuss);
|
||||
sarBussionessStandEO.getAttrInfoCaseMap().put("txlbbuss",txlbBussLevel);
|
||||
sarBussionessStandEO.getAttrInfoMap().put("TXLBBUSS",txlbBussLevel);
|
||||
}
|
||||
}
|
||||
// 处理 在线编辑pdf存储失败问题 发布稿的在线编辑文件 判断文件表是否有没有则 添加 每次进入 都进行判断
|
||||
Object fbgbuss = sarBussionessStandEO.getAttrInfoCaseMap().get("fbgbuss");
|
||||
@@ -1945,7 +1956,7 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
||||
if("TXLBBUSS".equals(name)){
|
||||
if(value1 != null){
|
||||
String value = entry.getValue().toString();
|
||||
QueryWrapper wrapper = new QueryWrapper();
|
||||
QueryWrapper<SarMenuStandard> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("REPLACE(MENU_NAME,' ','')",value.trim());
|
||||
wrapper.like("PARENT_IDS","aaaaaaaaaaaaaaaaaaaaaa");
|
||||
List<SarMenuStandard> list = iSarMenuStandardService.list(wrapper);
|
||||
@@ -5213,4 +5224,28 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
||||
}
|
||||
return "2";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询标准体系
|
||||
* @param nodeName 标准体系节点名称
|
||||
* @return
|
||||
*/
|
||||
public String getParentNodePathRecursive(String nodeName) {
|
||||
LambdaQueryWrapper<SarMenuStandard> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(SarMenuStandard::getMenuName, nodeName);
|
||||
SarMenuStandard node = sarMenuStandardService.list(wrapper).get(0); // 根据 txlbBuss 查询节点
|
||||
if (node == null) {
|
||||
return nodeName; // 未找到节点,返回空路径
|
||||
}
|
||||
if (StringUtils.isBlank(node.getParentId())) {
|
||||
return nodeName;
|
||||
}
|
||||
SarMenuStandard sarMenuStandard = sarMenuStandardService.selectMenuById(node.getParentId());
|
||||
String parentNodePath = getParentNodePathRecursive(sarMenuStandard.getMenuName()); // 递归获取父节点路径
|
||||
if (parentNodePath.isEmpty()) {
|
||||
return nodeName; // 如果父节点路径为空,直接返回当前节点的 txlbBuss
|
||||
} else {
|
||||
return parentNodePath + "/" + nodeName; // 否则,拼接当前节点的 txlbBuss 到父节点路径
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
@@ -37,6 +37,8 @@ public interface QualityEvaluationDao extends BaseMapper<QualityEvaluation> {
|
||||
|
||||
List<Integer> selectBZSH(@Param("node") String node,@Param("lawId") String lawId);
|
||||
|
||||
List<Integer> selectDTPJ(@Param("lawId") String lawId);
|
||||
|
||||
void updateByProcessNode(@Param("lawId") String lawId);
|
||||
|
||||
@Select("select * from quality_evaluation")
|
||||
|
||||
+55
-36
@@ -20,6 +20,9 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.io.PipedReader;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.text.NumberFormat;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collector;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -61,6 +64,7 @@ public class QualityEvaluationServiceImpl extends ServiceImpl<QualityEvaluationD
|
||||
|
||||
QueryWrapper<QualityEvaluation> qw = new QueryWrapper();
|
||||
qw.eq("law_id",form.getLawId());
|
||||
qw.eq("user_id",form.getUserId());
|
||||
qw.eq("evaluation_type","dynamic");
|
||||
List<QualityEvaluation> list = this.baseMapper.selectList(qw);
|
||||
|
||||
@@ -194,52 +198,58 @@ public class QualityEvaluationServiceImpl extends ServiceImpl<QualityEvaluationD
|
||||
Integer countCXJSWYStr = null;
|
||||
Integer countBZHFSStr = null;
|
||||
Integer countBZSHStr = null;
|
||||
if(!list.isEmpty()){
|
||||
for (QualityEvaluation qualityEvaluations :list){
|
||||
if("征求意见".equals(qualityEvaluations.getProcessNode())) {
|
||||
List<Integer> countZQYJList = qualityEvaluationDao.selectCountZQYJ(qualityEvaluations.getProcessNode(), qualityEvaluations.getLawId());
|
||||
if(!countZQYJList.isEmpty()){
|
||||
countZQYJStr = countZQYJList.size();
|
||||
}
|
||||
}
|
||||
|
||||
if("技术委员会评审、评审意见修改".equals(qualityEvaluations.getProcessNode())) {
|
||||
List<Integer> countJSWYList = qualityEvaluationDao.selectCountJSWY(qualityEvaluations.getProcessNode(), qualityEvaluations.getLawId());
|
||||
if(!countJSWYList.isEmpty()){
|
||||
countJSWYStr = countJSWYList.size();
|
||||
}
|
||||
}
|
||||
if("重新技术委员会评审、评审意见修改".equals(qualityEvaluations.getProcessNode())) {
|
||||
List<Integer> countCXJSWYList = qualityEvaluationDao.selectCXJSWY(qualityEvaluations.getProcessNode(), qualityEvaluations.getLawId());
|
||||
if(!countCXJSWYList.isEmpty()){
|
||||
countCXJSWYStr = countCXJSWYList.size();
|
||||
}
|
||||
}
|
||||
if("标准化复审".equals(qualityEvaluations.getProcessNode())) {
|
||||
List<Integer> countBZHFSList = qualityEvaluationDao.selectBZHFS(qualityEvaluations.getProcessNode(), qualityEvaluations.getLawId());
|
||||
if(!countBZHFSList.isEmpty()){
|
||||
countBZHFSStr = countBZHFSList.size();
|
||||
}
|
||||
}
|
||||
if("标准法规部高级经理审核".equals(qualityEvaluations.getProcessNode())) {
|
||||
List<Integer> countBZSHList = qualityEvaluationDao.selectBZSH(qualityEvaluations.getProcessNode(), qualityEvaluations.getLawId());
|
||||
if(!countBZSHList.isEmpty()){
|
||||
countBZSHStr = countBZSHList.size();
|
||||
}
|
||||
}
|
||||
Integer countDTPJStr = null;
|
||||
if (!list.isEmpty()) {
|
||||
List<Integer> countZQYJList = qualityEvaluationDao.selectCountZQYJ("征求意见", lawId);
|
||||
if (!countZQYJList.isEmpty()) {
|
||||
countZQYJStr = countZQYJList.size();
|
||||
}
|
||||
|
||||
List<Integer> countJSWYList = qualityEvaluationDao.selectCountJSWY("技术委员会评审、评审意见修改", lawId);
|
||||
if (!countJSWYList.isEmpty()) {
|
||||
countJSWYStr = countJSWYList.size();
|
||||
}
|
||||
List<Integer> countCXJSWYList = qualityEvaluationDao.selectCXJSWY("重新技术委员会评审、评审意见修改", lawId);
|
||||
if (!countCXJSWYList.isEmpty()) {
|
||||
countCXJSWYStr = countCXJSWYList.size();
|
||||
}
|
||||
List<Integer> countBZHFSList = qualityEvaluationDao.selectBZHFS("标准化复审", lawId);
|
||||
if (!countBZHFSList.isEmpty()) {
|
||||
countBZHFSStr = countBZHFSList.size();
|
||||
}
|
||||
List<Integer> countBZSHList = qualityEvaluationDao.selectBZSH("标准法规部高级经理审核", lawId);
|
||||
if (!countBZSHList.isEmpty()) {
|
||||
countBZSHStr = countBZSHList.size();
|
||||
}
|
||||
List<Integer> countDTPJList = qualityEvaluationDao.selectDTPJ(lawId);
|
||||
if (!countDTPJList.isEmpty()) {
|
||||
countDTPJStr = countDTPJList.size();
|
||||
}
|
||||
//
|
||||
}
|
||||
|
||||
final Integer countZQYJ = countZQYJStr;
|
||||
final Integer countJSWY = countJSWYStr;
|
||||
final Integer countCXJSWY = countCXJSWYStr;
|
||||
final Integer countBZHFS = countBZHFSStr;
|
||||
final Integer countBZSH = countBZSHStr;
|
||||
final Integer countDTPJ = countDTPJStr;
|
||||
|
||||
HashMap<String, Double> result = new HashMap<>();
|
||||
result.put("dynamic",0.0);
|
||||
result.put("quality",0.0);
|
||||
|
||||
|
||||
if (list.size() > 0) {
|
||||
// 如果存在 技术委员会评审、评审意见修改 节点 和 重新技术委员会评审、评审意见修改 节点,则仅计算 重新技术委员会评审、评审意见修改
|
||||
List<QualityEvaluation> collect = list.stream().filter(item -> item.getProcessNode() != null
|
||||
&& "重新技术委员会评审、评审意见修改".equals(item.getProcessNode())).collect(Collectors.toList());
|
||||
if (collect.size()>0) {
|
||||
List<QualityEvaluation> collect1 = list.stream().filter(item -> item.getProcessNode() != null
|
||||
&& "技术委员会评审、评审意见修改".equals(item.getProcessNode())).collect(Collectors.toList());
|
||||
list.removeAll(collect1);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 同一节点为多人评价时,需要取多人评价的平均分用以计算最终得分。
|
||||
* 各环节评分权重分别设置为30%、40%、30%,
|
||||
@@ -249,7 +259,7 @@ public class QualityEvaluationServiceImpl extends ServiceImpl<QualityEvaluationD
|
||||
.collect(Collectors.groupingBy(QualityEvaluation::getEvaluationType,
|
||||
Collectors.summingDouble(item ->{
|
||||
|
||||
Double score;
|
||||
double score;
|
||||
String value;
|
||||
if (item.getProcessNode()==null){
|
||||
value="";
|
||||
@@ -272,12 +282,21 @@ public class QualityEvaluationServiceImpl extends ServiceImpl<QualityEvaluationD
|
||||
case "标准法规部高级经理审核":
|
||||
score=Double.valueOf(item.getScore()) / countBZSH * 0.15;
|
||||
break;
|
||||
|
||||
default: score=Double.valueOf(item.getScore());
|
||||
case "动态评价":
|
||||
score=Double.valueOf(item.getScore()) / (countDTPJ*4);
|
||||
break;
|
||||
default:
|
||||
score=Double.valueOf(item.getScore());
|
||||
}
|
||||
|
||||
return score;
|
||||
} ))));
|
||||
BigDecimal qualityScore = BigDecimal.valueOf(result.get("quality"));
|
||||
BigDecimal dynamicScore = BigDecimal.valueOf(result.get("dynamic"));
|
||||
double finalScore = qualityScore.setScale(2, RoundingMode.HALF_UP).doubleValue() * 0.9 + dynamicScore.setScale(2, RoundingMode.HALF_UP).doubleValue();
|
||||
result.put("dynamic",dynamicScore.setScale(2, RoundingMode.HALF_UP).doubleValue());
|
||||
result.put("quality",qualityScore.setScale(2, RoundingMode.HALF_UP).doubleValue());
|
||||
result.put("finalScore", new BigDecimal(finalScore).setScale(2, RoundingMode.HALF_UP).doubleValue());
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
+5
-5
@@ -88,11 +88,11 @@ public class SarLawsAttrInfo extends BaseEntity {
|
||||
@TableField("TGDWLAWS")
|
||||
private String tgdwlaws;
|
||||
|
||||
@TableField("NYLXLAWS")
|
||||
private String nylxlaws;
|
||||
|
||||
@TableField("YYRZLAWS")
|
||||
private String yyrzlaws;
|
||||
// @TableField("NYLXLAWS")
|
||||
// private String nylxlaws;
|
||||
//
|
||||
// @TableField("YYRZLAWS")
|
||||
// private String yyrzlaws;
|
||||
|
||||
@TableField("ZRBMLAWS")
|
||||
private String zrbmlaws;
|
||||
|
||||
+217
@@ -0,0 +1,217 @@
|
||||
package com.adc.da.slrs.sarLawsInformation.controller;
|
||||
|
||||
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.core.util.ZipUtil;
|
||||
import com.adc.da.base.web.BaseController;
|
||||
import com.adc.da.common.ReadExcel;
|
||||
import com.adc.da.exception.AdcDaBaseException;
|
||||
import com.adc.da.http.PageInfo;
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.slrs.sarLawsInformation.entity.SarLawsInformation;
|
||||
import com.adc.da.slrs.sarLawsInformation.service.SarLawsInformationService;
|
||||
import com.adc.da.util.UUIDUtils;
|
||||
import com.adc.da.utils.util.FieldConvertUtil;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
|
||||
import org.apache.poi.hssf.usermodel.HSSFSheet;
|
||||
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
||||
import org.apache.poi.ss.usermodel.*;
|
||||
import org.apache.poi.ss.util.CellRangeAddress;
|
||||
import org.apache.poi.util.IOUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.*;
|
||||
import java.text.ParseException;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author tjzdw
|
||||
* @description 政策资料中心
|
||||
* @date 2023/10/23
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/${restPath}/lawss/sarLawsInformation")
|
||||
public class SarLawsInformationController extends BaseController<SarLawsInformation> {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(SarLawsInformationController.class);
|
||||
|
||||
@Resource
|
||||
private SarLawsInformationService informationService;
|
||||
|
||||
@Value("${file.path}")
|
||||
private String filePath;
|
||||
|
||||
@ApiOperation(value = "根据政策资料ID查询资料信息")
|
||||
@GetMapping("/getLawsInformationInfo")
|
||||
public ResponseMessage<SarLawsInformation> getLawsInformationInfo(String id){
|
||||
if (StringUtils.isBlank(id)) {
|
||||
return Result.error("会议ID为空!");
|
||||
}
|
||||
SarLawsInformation sarLawsInformation = informationService.getLawsInformationInfo(id);
|
||||
return Result.success(sarLawsInformation);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "分页查询")
|
||||
@GetMapping("/page")
|
||||
public ResponseMessage<PageInfo<SarLawsInformation>> page(SarLawsInformation sarLawsInformation) {
|
||||
List<SarLawsInformation> rows = informationService.queryByPage(sarLawsInformation);
|
||||
return Result.success(getPageInfo(sarLawsInformation.getPager(), rows));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "新增政策资料")
|
||||
@PostMapping(value = "/addLawsInformation", consumes = "application/json;charset=UTF-8")
|
||||
public ResponseMessage<?> create(@RequestBody SarLawsInformation sarLawsInformation) throws Exception {
|
||||
informationService.addLawsInformation(sarLawsInformation);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@ApiOperation("根据资料ID删除资料信息")
|
||||
@DeleteMapping("/deleteLawsInformation")
|
||||
public ResponseMessage<?> deleteInformation(String id) {
|
||||
if (StringUtils.isBlank(id)) {
|
||||
return Result.error("删除失败,政策资料ID为空");
|
||||
}
|
||||
informationService.deleteInformation(id);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@ApiOperation("根据资料ID修改政策资料信息")
|
||||
@PutMapping("/updateLawsInformationInfo")
|
||||
public ResponseMessage<?> updateLawsInformationInfo(@RequestBody SarLawsInformation lawsInformation) {
|
||||
if (ObjectUtils.isEmpty(lawsInformation)) {
|
||||
return Result.error("更新失败,政策资料信息不存在");
|
||||
}
|
||||
Boolean updateResult = informationService.updateLawsInformationInfo(lawsInformation);
|
||||
return updateResult ? Result.success() : Result.error("更新失败");
|
||||
}
|
||||
|
||||
@ApiOperation("导出政策法规资料信息")
|
||||
@GetMapping("/exportLawsInformationInfo")
|
||||
public ResponseMessage<?> exportLawsInformationInfo(SarLawsInformation sarLawsInformation, HttpServletResponse response,
|
||||
HttpServletRequest request) {
|
||||
OutputStream os = null;
|
||||
Workbook workbook = null;
|
||||
List<SarLawsInformation> datas;
|
||||
try {
|
||||
if(StringUtils.isEmpty(sarLawsInformation.getExportName())||sarLawsInformation.getExportName().equals("null")){
|
||||
sarLawsInformation.setExportName("政策法规资料信息");
|
||||
}
|
||||
response.setHeader("Content-Disposition",
|
||||
"attachment; filename=" + ReadExcel.encodeFileName(sarLawsInformation.getExportName()+".xlsx",
|
||||
request));
|
||||
// 导出数据,若指定了值则使用ids字段条件导出,否则根据条件导出
|
||||
if (StrUtil.isNotBlank(sarLawsInformation.getExportIds())) {
|
||||
List<String> idList = Arrays.asList(sarLawsInformation.getExportIds().split(","));
|
||||
datas = informationService.getLawsInformationByIds(idList);
|
||||
} else {
|
||||
// 导出所有数据
|
||||
datas = informationService.getAllLawsInformation(sarLawsInformation);
|
||||
}
|
||||
ExportParams exportParams = new ExportParams();
|
||||
exportParams.setType(ExcelType.XSSF);
|
||||
exportParams.setSheetName(sarLawsInformation.getExportName());
|
||||
workbook = ExcelExportUtil.exportExcel(exportParams,SarLawsInformation.class,datas);
|
||||
os = response.getOutputStream();
|
||||
workbook.write(os);
|
||||
os.flush();
|
||||
} catch (IOException e) {
|
||||
logger.error(e.getMessage(), e);
|
||||
throw new AdcDaBaseException("下载文件失败,请重试");
|
||||
} finally {
|
||||
IOUtils.closeQuietly(os);
|
||||
}
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@ApiOperation("Excel文件导入政策资料信息")
|
||||
@PostMapping("/importLawsInformationInfo")
|
||||
public ResponseMessage<?> importLawsInformationInfo(@RequestParam(value = "file",required = false) MultipartFile file) throws ParseException {
|
||||
if (file == null) {
|
||||
return Result.error("文件为空,请重新上传");
|
||||
}
|
||||
return informationService.importLawsInformationInfo(file);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "政策法规资料导入模板下载")
|
||||
@GetMapping("/exportTemplateFile")
|
||||
public void exportTemplateFile(String fileName,HttpServletResponse response, HttpServletRequest request)throws Exception{
|
||||
|
||||
OutputStream os = null;
|
||||
OutputStream excelOS = null;
|
||||
HSSFWorkbook workbook = new HSSFWorkbook();
|
||||
String fileOriName = "政策法规资料导入模板";
|
||||
if (StringUtils.isNotEmpty(fileName)) {
|
||||
fileOriName = fileName;
|
||||
}
|
||||
try{
|
||||
//创建临时文件夹
|
||||
String fileNowPath = filePath + "/tempZip/" + UUIDUtils.randomUUID20() + "/" + fileOriName;
|
||||
File nowFile = new File(fileNowPath);
|
||||
if (nowFile.exists()){
|
||||
nowFile.delete();
|
||||
}
|
||||
nowFile.mkdirs();
|
||||
String fileName2 = "导入模板.xls";
|
||||
HSSFSheet sheetItems = workbook.createSheet("模板");
|
||||
sheetItems.setDefaultColumnWidth(13);
|
||||
Row rowHeader = sheetItems.createRow(1);//开始创建标题行
|
||||
sheetItems.addMergedRegion(new CellRangeAddress(0, 0, 0, 8));
|
||||
Row row2 = sheetItems.createRow(0);//开始创建填写说明
|
||||
String exportFieldName = FieldConvertUtil.exportFieldLawsInformation;
|
||||
if (StringUtils.isNotBlank(exportFieldName)) {
|
||||
String[] headerArr = exportFieldName.split(",");
|
||||
for (int i=0;i < headerArr.length; i++) {
|
||||
rowHeader.createCell(i).setCellValue(headerArr[i]);
|
||||
}
|
||||
}
|
||||
Cell cellA2 = row2.createCell(0);
|
||||
cellA2.setCellValue(FieldConvertUtil.exportLawsInformationDesc);
|
||||
//sheetItems.setColumnWidth(0, 20 * 150);
|
||||
row2.setHeight((short) (100 * 25));
|
||||
HSSFCellStyle cellStyle =workbook.createCellStyle();
|
||||
cellStyle.setAlignment(HorizontalAlignment.LEFT);
|
||||
cellStyle.setVerticalAlignment(VerticalAlignment.TOP);
|
||||
cellStyle.setWrapText(true);
|
||||
cellA2.setCellStyle(cellStyle);
|
||||
String repFileName = fileName2.replaceAll("/","_");
|
||||
excelOS = new FileOutputStream(fileNowPath + "/" + repFileName);
|
||||
response.setHeader("Content-Disposition",
|
||||
"attachment; filename=\""+ ReadExcel.encodeFileName(fileOriName+".zip", request) +"\"");
|
||||
response.setContentType("application/force-download");
|
||||
response.flushBuffer();
|
||||
os = response.getOutputStream();
|
||||
workbook.write(excelOS);
|
||||
excelOS.flush();
|
||||
excelOS.close();
|
||||
ZipUtil.zip(fileNowPath,fileNowPath+".zip");
|
||||
FileInputStream fis = new FileInputStream(fileNowPath+".zip");
|
||||
int len = 0;
|
||||
while ((len = fis.read()) != -1) {
|
||||
os.write(len);
|
||||
}
|
||||
os.flush();
|
||||
os.close(); // 后开先关
|
||||
fis.close(); // 先开后关
|
||||
} catch (Exception e) {
|
||||
logger.error(e.getMessage(), e);
|
||||
throw new com.adc.da.exception.AdcDaBaseException("下载文件失败,请重试");
|
||||
} finally {
|
||||
IOUtils.closeQuietly(os);
|
||||
IOUtils.closeQuietly(excelOS);
|
||||
}
|
||||
}
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
package com.adc.da.slrs.sarLawsInformation.dao;
|
||||
|
||||
import com.adc.da.slrs.sarLawsInformation.entity.SarLawsInformation;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author tjzdw
|
||||
* @description 针对表【sar_laws_information】的数据库操作Mapper
|
||||
* @createDate 2023-10-23 09:41:56
|
||||
* @Entity com.adc.da.slrs.sarLawsInformation.entity.SarLawsInformation
|
||||
*/
|
||||
@Mapper
|
||||
public interface SarLawsInformationDao extends BaseMapper<SarLawsInformation> {
|
||||
|
||||
Integer queryByPageCount(SarLawsInformation page);
|
||||
|
||||
List<SarLawsInformation> queryByPage(SarLawsInformation page);
|
||||
|
||||
List<SarLawsInformation> getAllLawsInformation(SarLawsInformation sarLawsInformation);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
+245
@@ -0,0 +1,245 @@
|
||||
package com.adc.da.slrs.sarLawsInformation.entity;
|
||||
|
||||
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||
import com.adc.da.att.entity.AttFileEO;
|
||||
import com.adc.da.base.page.BasePage;
|
||||
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 java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
/**
|
||||
*
|
||||
* @TableName sar_laws_information
|
||||
*/
|
||||
@TableName(value ="sar_laws_information")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Accessors(chain = true)
|
||||
@Data
|
||||
public class SarLawsInformation extends BasePage implements Serializable {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@ApiModelProperty(value = "主键")
|
||||
@TableId(value = "ID", type = IdType.ID_WORKER_STR)
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 一级资料类别
|
||||
*/
|
||||
@ApiModelProperty("一级资料类别")
|
||||
@TableField(value = "FIRST_TYPE")
|
||||
private String firstType;
|
||||
|
||||
/**
|
||||
* 一级资料类别名称
|
||||
*/
|
||||
@ApiModelProperty(value = "一级资料类别名称")
|
||||
@TableField(exist = false)
|
||||
@Excel(name = "一级资料类别", orderNum = "0")
|
||||
private String firstTypeName;
|
||||
|
||||
/**
|
||||
* 二级资料类别
|
||||
*/
|
||||
@ApiModelProperty(value = "二级资料类别")
|
||||
@TableField(value = "SECOND_TYPE")
|
||||
private String secondType;
|
||||
|
||||
/**
|
||||
* 二级资料类别名称
|
||||
*/
|
||||
@ApiModelProperty(value = "二级资料类别名称")
|
||||
@TableField(exist = false)
|
||||
@Excel(name = "二级资料类别", orderNum = "1")
|
||||
private String secondTypeName;
|
||||
|
||||
/**
|
||||
* 三级资料类别
|
||||
*/
|
||||
@ApiModelProperty(value = "三级资料类别")
|
||||
@TableField(value = "THIRD_TYPE")
|
||||
private String thirdType;
|
||||
|
||||
/**
|
||||
* 三级资料类别名称
|
||||
*/
|
||||
@ApiModelProperty(value = "三级资料类别名称")
|
||||
@TableField(exist = false)
|
||||
@Excel(name = "三级资料类别", orderNum = "2")
|
||||
private String thirdTypeName;
|
||||
|
||||
/**
|
||||
* 四级资料类别
|
||||
*/
|
||||
@ApiModelProperty(value = "四级资料类别")
|
||||
@TableField(value = "FOURTH_TYPE")
|
||||
private String fourthType;
|
||||
|
||||
/**
|
||||
* 四级资料类别名称
|
||||
*/
|
||||
@ApiModelProperty(value = "四级资料类别名称")
|
||||
@TableField(exist = false)
|
||||
@Excel(name = "四级资料类别", orderNum = "3")
|
||||
private String fourthTypeName;
|
||||
|
||||
/**
|
||||
* 资料名称
|
||||
*/
|
||||
@ApiModelProperty(value = "资料名称")
|
||||
@TableField(value = "NAME")
|
||||
@Excel(name = "资料名称", orderNum = "4")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 资料归属部门
|
||||
*/
|
||||
@ApiModelProperty(value = "资料归属部门")
|
||||
@TableField(value = "DEPARTMENT")
|
||||
@Excel(name = "资料归属部门", orderNum = "5")
|
||||
private String department;
|
||||
|
||||
/**
|
||||
* 作者
|
||||
*/
|
||||
@ApiModelProperty(value = "作者")
|
||||
@TableField(value = "AUTHOR")
|
||||
@Excel(name = "作者", orderNum = "6")
|
||||
private String author;
|
||||
|
||||
/**
|
||||
* 上传时间
|
||||
*/
|
||||
@ApiModelProperty(value = "上传时间")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@TableField(value = "UPLOAD_TIME")
|
||||
@Excel(name = "上传时间", orderNum = "7", exportFormat = "yyyy-MM-dd")
|
||||
private Date uploadTime;
|
||||
|
||||
/**
|
||||
* 资料说明
|
||||
*/
|
||||
@ApiModelProperty(value = "资料说明")
|
||||
@TableField(value = "DESCRIPTION")
|
||||
@Excel(name = "资料说明", orderNum = "8")
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 资料文件
|
||||
*/
|
||||
@ApiModelProperty(value = "资料文件")
|
||||
@TableField(value = "INFORMATION_FILE")
|
||||
private String informationFile;
|
||||
|
||||
/**
|
||||
* 资料文件名称
|
||||
*/
|
||||
@ApiModelProperty(value = "资料文件对象列表")
|
||||
@TableField(exist = false)
|
||||
private List<AttFileEO> informationFileList;
|
||||
|
||||
/**
|
||||
* 可查看者,若设置为空则所有用户均可查看,若设置人员后,仅有可查看者可以查看文件信息。
|
||||
*/
|
||||
@ApiModelProperty(value = "可查看者")
|
||||
@TableField(value = "VIEWABLE_BY")
|
||||
private String viewableBy;
|
||||
|
||||
/**
|
||||
* 可下载者,若设置为空则仅有上传人和审批人可以查看,若设置人员后,仅有可下载者可下载文件信息。
|
||||
*/
|
||||
@ApiModelProperty(value = "可下载者")
|
||||
@TableField(value = "DOWNLOADABLE_BY")
|
||||
private String downloadableBy;
|
||||
|
||||
/**
|
||||
* 创建人和审批人
|
||||
*/
|
||||
@ApiModelProperty(value = "创建人和审批人")
|
||||
@TableField
|
||||
private String createAndApproveBy;
|
||||
|
||||
/**
|
||||
* 树节点ID
|
||||
*/
|
||||
@ApiModelProperty(value = "树节点ID")
|
||||
private String treeNodeId;
|
||||
|
||||
/**
|
||||
* 树节点名称
|
||||
*/
|
||||
@ApiModelProperty(value = "树节点名称")
|
||||
@TableField(exist = false)
|
||||
private String treeNodeName;
|
||||
|
||||
/**
|
||||
* 逻辑删除,0可用,1不可用
|
||||
*/
|
||||
@ApiModelProperty(value = "逻辑删除")
|
||||
@TableField(value = "VALID_FLAG")
|
||||
private Integer validFlag;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@TableField(value = "CREATE_TIME")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@ApiModelProperty("修改时间")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@TableField(value = "MODIFY_TIME")
|
||||
private Date modifyTime;
|
||||
|
||||
|
||||
/**
|
||||
* 排序字段
|
||||
*/
|
||||
@ApiModelProperty(value = "排序字段")
|
||||
@TableField(exist = false)
|
||||
private String sortField = "ID";
|
||||
|
||||
/**
|
||||
* 排序方式
|
||||
*/
|
||||
@ApiModelProperty(value = "排序方式")
|
||||
@TableField(exist = false)
|
||||
private String sortMode = "asc";
|
||||
|
||||
/**
|
||||
* 收藏ID
|
||||
*/
|
||||
@ApiModelProperty(value = "收藏ID")
|
||||
@TableField(exist = false)
|
||||
private String collectId;
|
||||
|
||||
// Excel导出使用字段
|
||||
@ApiModelProperty("导出文件名")
|
||||
@TableField(exist = false)
|
||||
private String exportName;
|
||||
|
||||
@ApiModelProperty("导出的文件Ids")
|
||||
@TableField(exist = false)
|
||||
private String exportIds;
|
||||
|
||||
@TableField(exist = false)
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
package com.adc.da.slrs.sarLawsInformation.service;
|
||||
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.slrs.sarLawsInformation.entity.SarLawsInformation;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author tjzdw
|
||||
* @description 针对表【sar_laws_information】的数据库操作Service
|
||||
* @createDate 2023-10-23 09:41:56
|
||||
*/
|
||||
public interface SarLawsInformationService extends IService<SarLawsInformation> {
|
||||
|
||||
SarLawsInformation getLawsInformationInfo(String id);
|
||||
|
||||
List<SarLawsInformation> queryByPage(SarLawsInformation sarLawsInformation);
|
||||
|
||||
Integer addLawsInformation(SarLawsInformation sarLawsInformation);
|
||||
|
||||
Boolean deleteInformation(String id);
|
||||
|
||||
Boolean updateLawsInformationInfo(SarLawsInformation lawsInformation);
|
||||
|
||||
/**
|
||||
* 根据法规资料id列表查询资料信息,用于导出,不包含文件信息
|
||||
* @param idList 法规资料Id列表
|
||||
* @return 法规资料列表
|
||||
*/
|
||||
List<SarLawsInformation> getLawsInformationByIds(List<String> idList);
|
||||
|
||||
/**
|
||||
* 查询法规资料信息,用于导出,不包含文件信息
|
||||
* @param sarLawsInformation 法规资料对象,用于查询
|
||||
* @return 法规资料列表
|
||||
*/
|
||||
List<SarLawsInformation> getAllLawsInformation(SarLawsInformation sarLawsInformation);
|
||||
|
||||
ResponseMessage<?> importLawsInformationInfo(MultipartFile file);
|
||||
}
|
||||
+516
@@ -0,0 +1,516 @@
|
||||
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;
|
||||
import com.adc.da.att.service.IAttFileEOService;
|
||||
import com.adc.da.common.FileUnZip;
|
||||
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.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;
|
||||
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;
|
||||
import com.adc.da.slrs.sarLawsInformation.service.SarLawsInformationService;
|
||||
import com.adc.da.slrs.sarLawsInformation.dao.SarLawsInformationDao;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.ss.usermodel.Row;
|
||||
import org.apache.poi.ss.usermodel.Sheet;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.apache.poi.ss.usermodel.WorkbookFactory;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author tjzdw
|
||||
* @description 针对表【sar_laws_information】的数据库操作Service实现
|
||||
* @createDate 2023-10-23 09:41:56
|
||||
*/
|
||||
@Service
|
||||
public class SarLawsInformationServiceImpl extends ServiceImpl<SarLawsInformationDao, SarLawsInformation>
|
||||
implements SarLawsInformationService{
|
||||
|
||||
@Resource
|
||||
private SarLawsInformationCenterTreeService treeService;
|
||||
@Resource
|
||||
private IAttFileEOService attFileEOService;
|
||||
@Resource
|
||||
private ITsDicTypeService dicTypeService;
|
||||
@Resource
|
||||
private IPersonCollectEOService collectEOService;
|
||||
@Resource
|
||||
private ISarUpdLogService updLogService;
|
||||
@Resource
|
||||
private ITsUserService userService;
|
||||
@Value("${file.path}")
|
||||
private String filePath;//文件存储路径
|
||||
|
||||
@Override
|
||||
public SarLawsInformation getLawsInformationInfo(String id) {
|
||||
SarLawsInformation sarLawsInformation = this.baseMapper.selectById(id);
|
||||
// 将字典编号变更为字典值
|
||||
convertCodeToName(sarLawsInformation);
|
||||
// 查询资料文件信息
|
||||
if (StringUtils.isNotBlank(sarLawsInformation.getInformationFile())) {
|
||||
String[] split = sarLawsInformation.getInformationFile().split(",");
|
||||
List<AttFileEO> fileNameList = new ArrayList<>();
|
||||
for (String attId : split) {
|
||||
AttFileEO fileInfo = attFileEOService.getFileInfo(attId);
|
||||
fileNameList.add(fileInfo);
|
||||
}
|
||||
sarLawsInformation.setInformationFileList(fileNameList);
|
||||
}
|
||||
// 查询体系节点信息
|
||||
if (StringUtils.isNotBlank(sarLawsInformation.getTreeNodeId())) {
|
||||
SarLawsInformationCenterTree treeNode = treeService.getById(sarLawsInformation.getTreeNodeId());
|
||||
sarLawsInformation.setTreeNodeName(treeNode.getName());
|
||||
}
|
||||
// 查询是否被收藏
|
||||
LambdaQueryWrapper<TsPersonCollect> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(TsPersonCollect::getCollectResId, sarLawsInformation.getId());
|
||||
List<TsPersonCollect> list = collectEOService.list(wrapper);
|
||||
if (list.size() > 0) {
|
||||
sarLawsInformation.setCollectId(list.get(0).getId());
|
||||
}
|
||||
return sarLawsInformation;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SarLawsInformation> queryByPage(SarLawsInformation page) {
|
||||
// 设置排序字段
|
||||
if (StringUtils.isNotBlank(page.getSortField())) {
|
||||
String sortField = StringUtils.join(StringUtils.splitByCharacterTypeCamelCase(page.getSortField()),"_").toUpperCase();
|
||||
page.setSortField(sortField);
|
||||
} else {
|
||||
page.setSortField("ID");
|
||||
page.setSortMode("asc");
|
||||
}
|
||||
Integer rowCount = this.baseMapper.queryByPageCount(page);
|
||||
page.getPager().setRowCount(rowCount);
|
||||
List<SarLawsInformation> sarLawsInformationList = this.baseMapper.queryByPage(page);
|
||||
for (SarLawsInformation sarLawsInformation : sarLawsInformationList) {
|
||||
// 将字典编号变更为字典值
|
||||
convertCodeToName(sarLawsInformation);
|
||||
// 查询文件信息
|
||||
if (StringUtils.isNotBlank(sarLawsInformation.getInformationFile())) {
|
||||
String[] split = sarLawsInformation.getInformationFile().split(",");
|
||||
List<AttFileEO> fileNameList = new ArrayList<>();
|
||||
for (String attId : split) {
|
||||
AttFileEO fileInfo = attFileEOService.getFileInfo(attId);
|
||||
fileNameList.add(fileInfo);
|
||||
}
|
||||
sarLawsInformation.setInformationFileList(fileNameList);
|
||||
}
|
||||
}
|
||||
return sarLawsInformationList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer addLawsInformation(SarLawsInformation sarLawsInformation) {
|
||||
sarLawsInformation.setCreateTime(new Date());
|
||||
sarLawsInformation.setModifyTime(new Date());
|
||||
if (sarLawsInformation.getUploadTime() == null) {
|
||||
sarLawsInformation.setUploadTime(new Date());
|
||||
}
|
||||
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<>();
|
||||
wrapper.isNull(SarLawsInformationCenterTree::getParentId);
|
||||
SarLawsInformationCenterTree one = treeService.getOne(wrapper);
|
||||
sarLawsInformation.setTreeNodeId(one.getId());
|
||||
}
|
||||
return this.baseMapper.insert(sarLawsInformation);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean deleteInformation(String id) {
|
||||
LambdaUpdateWrapper<SarLawsInformation> wrapper = new LambdaUpdateWrapper<>();
|
||||
wrapper.eq(SarLawsInformation::getId, id);
|
||||
wrapper.set(SarLawsInformation::getValidFlag,1);
|
||||
wrapper.set(SarLawsInformation::getModifyTime,new Date());
|
||||
return update(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean updateLawsInformationInfo(SarLawsInformation lawsInformation) {
|
||||
if (StringUtils.isBlank(lawsInformation.getId())) {
|
||||
return false;
|
||||
}
|
||||
SarLawsInformation oldLawsInformation = getLawsInformationInfo(lawsInformation.getId());
|
||||
lawsInformation.setModifyTime(new Date());
|
||||
// 比较修改前后的不同
|
||||
List<String> compareResult = compareSarLawsInformation(oldLawsInformation, lawsInformation);
|
||||
if (compareResult.size() > 0) {
|
||||
int update = this.baseMapper.updateById(lawsInformation);
|
||||
// 添加修改记录
|
||||
SarUpdLog sarUpdLogEO = new SarUpdLog();
|
||||
sarUpdLogEO.setId(UUIDUtils.randomUUID20());
|
||||
sarUpdLogEO.setSarId(oldLawsInformation.getId());
|
||||
sarUpdLogEO.setSarType("LAWS_INFORMATION");
|
||||
sarUpdLogEO.setCreationTime(new Date());
|
||||
sarUpdLogEO.setCreationUser(LoginUserUtil.getUserId());
|
||||
sarUpdLogEO.setContent(oldLawsInformation.getName() + "," + String.join(",",compareResult));
|
||||
updLogService.save(sarUpdLogEO);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SarLawsInformation> getLawsInformationByIds(List<String> idList) {
|
||||
LambdaQueryWrapper<SarLawsInformation> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.in(SarLawsInformation::getId, idList);
|
||||
List<SarLawsInformation> sarLawsInformationList = this.baseMapper.selectList(wrapper);
|
||||
for (SarLawsInformation sarLawsInformation : sarLawsInformationList) {
|
||||
// 将字典编号变更为字典值
|
||||
convertCodeToName(sarLawsInformation);
|
||||
}
|
||||
return sarLawsInformationList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SarLawsInformation> getAllLawsInformation(SarLawsInformation sarLawsInformation) {
|
||||
List<SarLawsInformation> sarLawsInformationList = this.baseMapper.getAllLawsInformation(sarLawsInformation);
|
||||
for (SarLawsInformation lawsInformation : sarLawsInformationList) {
|
||||
// 将字典编号变更为字典值
|
||||
convertCodeToName(lawsInformation);
|
||||
// 查询文件信息
|
||||
if (StringUtils.isNotBlank(lawsInformation.getInformationFile())) {
|
||||
String[] split = lawsInformation.getInformationFile().split(",");
|
||||
List<AttFileEO> fileNameList = new ArrayList<>();
|
||||
for (String attId : split) {
|
||||
AttFileEO fileInfo = attFileEOService.getFileInfo(attId);
|
||||
fileNameList.add(fileInfo);
|
||||
}
|
||||
lawsInformation.setInformationFileList(fileNameList);
|
||||
}
|
||||
}
|
||||
return sarLawsInformationList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseMessage<?> importLawsInformationInfo(MultipartFile file) {
|
||||
//获取文件全称
|
||||
String fileNameStr = file.getOriginalFilename();
|
||||
//获取最后.的位置
|
||||
assert fileNameStr != null;
|
||||
int pos = fileNameStr.lastIndexOf(".");
|
||||
//获取压缩文件名称并以小写显示
|
||||
String fileStr = fileNameStr.substring(pos + 1).toLowerCase();
|
||||
//校验是否是zip文件
|
||||
if (!fileStr.equals("zip")) {
|
||||
return Result.error("请上传zip格式的文件");
|
||||
}
|
||||
//进行拼接获取文件名称
|
||||
String fileName = fileNameStr.substring(0, pos);
|
||||
//获取路径和文件名称
|
||||
String path = filePath + "/" + fileName;
|
||||
|
||||
File saveDirectory = new File(path);
|
||||
//判断saveDirectory中是否是文件夹
|
||||
if (!saveDirectory.isDirectory()) {
|
||||
saveDirectory.mkdir();
|
||||
}
|
||||
//将文件写入到指定路径中
|
||||
try {
|
||||
FileUtils.copyInputStreamToFile(file.getInputStream(), new File(path + "/" + fileNameStr));
|
||||
} catch (IOException e) {
|
||||
return Result.error("文件存储失败!");
|
||||
}
|
||||
//解压缩
|
||||
String zipEntryName = null;
|
||||
try {
|
||||
zipEntryName = FileUnZip.unZipFiles(path + "/" + fileNameStr, path);
|
||||
FileUnZip.delete(new File(path + "/" + fileNameStr));
|
||||
} catch (IOException e) {
|
||||
return Result.error("文件解压失败");
|
||||
}
|
||||
//获取文件信息
|
||||
List<File> fileList = readImpExcelFile(zipEntryName);
|
||||
//判断获取到的文件数量
|
||||
if (fileList.size() != 1) {
|
||||
return Result.error("上传的文件只能有一个");
|
||||
}
|
||||
File importFile = fileList.get(0);
|
||||
if (!importFile.getName().contains(".xls") && !importFile.getName().contains(".xlsx")) {
|
||||
return Result.error("文件必须是EXCEL文件");
|
||||
}
|
||||
Workbook workbook = null;
|
||||
try {
|
||||
workbook = WorkbookFactory.create(importFile);
|
||||
} catch (IOException e) {
|
||||
FileUnZip.deleteDir(saveDirectory);
|
||||
return Result.error("导入失败,需要导入的数据有问题或导入的企标标号和企标名称已存在");
|
||||
}
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
Sheet sheet = workbook.getSheetAt(0);
|
||||
if (sheet == null) {
|
||||
return Result.error("工作表为空");
|
||||
}
|
||||
StringBuilder sb = new StringBuilder();
|
||||
List<String> headerList = new ArrayList<>();
|
||||
// 获取excel表头
|
||||
Row headerRow = sheet.getRow(1);
|
||||
for (int i = 0; i < 8; i++) {
|
||||
headerList.add(headerRow.getCell(i).getStringCellValue());
|
||||
}
|
||||
|
||||
// 判断表头字段是否相同
|
||||
if (!String.join(",",headerList).equals(FieldConvertUtil.exportFieldLawsInformation)) {
|
||||
try {
|
||||
workbook.close();
|
||||
} catch (IOException e) {
|
||||
return Result.error("文件关闭出错");
|
||||
}
|
||||
//删除原上传文件
|
||||
FileUnZip.deleteDir(saveDirectory);
|
||||
return Result.error("fail", "读取失败,请严格按照模板文件导入数据");
|
||||
}
|
||||
|
||||
ImportParams importParams = new ImportParams();
|
||||
importParams.setTitleRows(1);
|
||||
List<SarLawsInformation> sarLawsInformationList = ExcelImportUtil.importExcel(readImpExcelFile(zipEntryName).get(0), SarLawsInformation.class, importParams);
|
||||
// 获取需要校验的字段
|
||||
List<TsDicType> firstMaterialTypeList = dicTypeService.selectAllDicTypeNameByDicCode("firstMaterialType");
|
||||
Set<String> firstMaterialTypeNameSet = firstMaterialTypeList.stream().map(TsDicType::getDicTypeName).collect(Collectors.toSet());
|
||||
List<TsDicType> secondMaterialTypeList = dicTypeService.selectAllDicTypeNameByDicCode("secondMaterialType");
|
||||
Set<String> secondMaterialTypeNameSet = secondMaterialTypeList.stream().map(TsDicType::getDicTypeName).collect(Collectors.toSet());
|
||||
List<TsDicType> thirdMaterialTypeList = dicTypeService.selectAllDicTypeNameByDicCode("thirdMaterialType");
|
||||
Set<String> thirdMaterialTypeNameSet = thirdMaterialTypeList.stream().map(TsDicType::getDicTypeName).collect(Collectors.toSet());
|
||||
List<TsDicType> fourthMaterialTypeList = dicTypeService.selectAllDicTypeNameByDicCode("fourthMaterialType");
|
||||
Set<String> fourthMaterialTypeNameSet = fourthMaterialTypeList.stream().map(TsDicType::getDicTypeName).collect(Collectors.toSet());
|
||||
// 遍历索引
|
||||
int index = 1;
|
||||
// 去除空数据
|
||||
List<SarLawsInformation> sarLawsInformationListNew = new ArrayList<>();
|
||||
for (SarLawsInformation sarLawsInformation : sarLawsInformationList) {
|
||||
if (StringUtils.isNotBlank(sarLawsInformation.getName())) {
|
||||
sarLawsInformationListNew.add(sarLawsInformation);
|
||||
}
|
||||
}
|
||||
for (SarLawsInformation sarLawsInformation : sarLawsInformationListNew){
|
||||
// 把excel表中的类别名转换为类别编号,并对类别名做检测
|
||||
if (StringUtils.isNotBlank(sarLawsInformation.getFirstTypeName())) {
|
||||
List<String> firstTypeCodeList = new ArrayList<>();
|
||||
for (String firstTypeName : sarLawsInformation.getFirstTypeName().split(",")) {
|
||||
if (!firstMaterialTypeNameSet.contains(firstTypeName)){
|
||||
return Result.error("第" + index + "条记录的一级会议类别不符合输入要求");
|
||||
}
|
||||
for (TsDicType tsDicType : firstMaterialTypeList) {
|
||||
if (firstTypeName.equals(tsDicType.getDicTypeName())) {
|
||||
firstTypeCodeList.add(tsDicType.getDicTypeCode());
|
||||
}
|
||||
}
|
||||
}
|
||||
sarLawsInformation.setFirstType(String.join(",", firstTypeCodeList));
|
||||
}
|
||||
if (StringUtils.isNotBlank(sarLawsInformation.getSecondTypeName())) {
|
||||
List<String> secondTypeCodeList = new ArrayList<>();
|
||||
for (String secondTypeName : sarLawsInformation.getSecondTypeName().split(",")) {
|
||||
if (!secondMaterialTypeNameSet.contains(secondTypeName)){
|
||||
return Result.error("第" + index + "条记录的二级会议类别不符合输入要求");
|
||||
}
|
||||
for (TsDicType tsDicType : secondMaterialTypeList) {
|
||||
if (secondTypeName.equals(tsDicType.getDicTypeName())) {
|
||||
secondTypeCodeList.add(tsDicType.getDicTypeCode());
|
||||
}
|
||||
}
|
||||
}
|
||||
sarLawsInformation.setSecondType(String.join(",", secondTypeCodeList));
|
||||
}
|
||||
if (StringUtils.isNotBlank(sarLawsInformation.getThirdTypeName())) {
|
||||
List<String> thirdTypeCodeList = new ArrayList<>();
|
||||
for (String thirdTypeName : sarLawsInformation.getThirdTypeName().split(",")) {
|
||||
if (!thirdMaterialTypeNameSet.contains(thirdTypeName)){
|
||||
return Result.error("第" + index + "条记录的三级会议类别不符合输入要求");
|
||||
}
|
||||
for (TsDicType tsDicType : thirdMaterialTypeList) {
|
||||
if (thirdTypeName.equals(tsDicType.getDicTypeName())) {
|
||||
thirdTypeCodeList.add(tsDicType.getDicTypeCode());
|
||||
}
|
||||
}
|
||||
}
|
||||
sarLawsInformation.setThirdType(String.join(",", thirdTypeCodeList));
|
||||
}
|
||||
if (StringUtils.isNotBlank(sarLawsInformation.getFourthTypeName())) {
|
||||
List<String> fourthTypeCodeList = new ArrayList<>();
|
||||
for (String fourthTypeName : sarLawsInformation.getFourthTypeName().split(",")) {
|
||||
if (!fourthMaterialTypeNameSet.contains(fourthTypeName)){
|
||||
return Result.error("第" + index + "条记录的四级会议类别不符合输入要求");
|
||||
}
|
||||
for (TsDicType tsDicType : fourthMaterialTypeList) {
|
||||
if (fourthTypeName.equals(tsDicType.getDicTypeName())) {
|
||||
fourthTypeCodeList.add(tsDicType.getDicTypeCode());
|
||||
}
|
||||
}
|
||||
}
|
||||
sarLawsInformation.setFourthType(String.join(",", fourthTypeCodeList));
|
||||
}
|
||||
// 索引 +1
|
||||
index++;
|
||||
// 存入数据库
|
||||
addLawsInformation(sarLawsInformation);
|
||||
}
|
||||
return Result.success("导入成功");
|
||||
}
|
||||
|
||||
public void convertCodeToName(SarLawsInformation sarLawsInformation) {
|
||||
List<String> firstTypeList = new ArrayList<>();
|
||||
for (String type : sarLawsInformation.getFirstType().split(",")) {
|
||||
if (StringUtils.isNotBlank(type)) {
|
||||
firstTypeList.add(dicTypeService.getDicTypeNameByDicCode(type));
|
||||
}
|
||||
}
|
||||
sarLawsInformation.setFirstTypeName(String.join(",",firstTypeList));
|
||||
List<String> secondTypeList = new ArrayList<>();
|
||||
for (String type : sarLawsInformation.getSecondType().split(",")) {
|
||||
if (StringUtils.isNotBlank(type)) {
|
||||
secondTypeList.add(dicTypeService.getDicTypeNameByDicCode(type));
|
||||
}
|
||||
}
|
||||
sarLawsInformation.setSecondTypeName(String.join(",",secondTypeList));
|
||||
List<String> thirdTypeList = new ArrayList<>();
|
||||
for (String type : sarLawsInformation.getThirdType().split(",")) {
|
||||
if (StringUtils.isNotBlank(type)) {
|
||||
thirdTypeList.add(dicTypeService.getDicTypeNameByDicCode(type));
|
||||
}
|
||||
}
|
||||
sarLawsInformation.setThirdTypeName(String.join(",",thirdTypeList));
|
||||
List<String> fourthTypeList = new ArrayList<>();
|
||||
for (String type : sarLawsInformation.getFourthType().split(",")) {
|
||||
if (StringUtils.isNotBlank(type)) {
|
||||
fourthTypeList.add(dicTypeService.getDicTypeNameByDicCode(type));
|
||||
}
|
||||
}
|
||||
sarLawsInformation.setFourthTypeName(String.join(",",fourthTypeList));
|
||||
}
|
||||
|
||||
/**
|
||||
* 比较两个SarLawsInformation 对象
|
||||
* @param oldInfo 数据库中存储的对象
|
||||
* @param newInfo 更新后的对象
|
||||
* @return 差异
|
||||
*/
|
||||
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);
|
||||
// 获取SarLawsInformation类的所有字段
|
||||
Field[] fields = SarLawsInformation.class.getDeclaredFields();
|
||||
for (Field field : fields) {
|
||||
if (!ignoreFieldList.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));
|
||||
}
|
||||
}
|
||||
}
|
||||
// 获取资料类型名称
|
||||
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 + "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());
|
||||
}
|
||||
}
|
||||
// 获取字段名称
|
||||
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) {
|
||||
// 处理异常
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
return changes;
|
||||
}
|
||||
|
||||
private static List<File> readImpExcelFile(String path) {
|
||||
File file = new File(path);
|
||||
List<File> resultlist = new ArrayList<>();
|
||||
if (file.isDirectory()) {
|
||||
File[] files = file.listFiles();
|
||||
for (File fi : files) {
|
||||
// 对文件进行过滤,读取所有文件
|
||||
String name = fi.getName();
|
||||
//文件不为空 添加
|
||||
if (name != null){
|
||||
resultlist.add(fi);
|
||||
}
|
||||
}
|
||||
}
|
||||
return resultlist;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
+56
@@ -0,0 +1,56 @@
|
||||
package com.adc.da.slrs.sarLawsInformationCenterTree.controller;
|
||||
|
||||
import com.adc.da.base.web.BaseController;
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.slrs.sarLawsInformationCenterTree.entity.SarLawsInformationCenterTree;
|
||||
import com.adc.da.slrs.sarLawsInformationCenterTree.entity.SarLawsInformationCenterTreeData;
|
||||
import com.adc.da.slrs.sarLawsInformationCenterTree.service.SarLawsInformationCenterTreeService;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author tjzdw
|
||||
* @description
|
||||
* @date 2023/10/23
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/${restPath}/lawss/sarLawsInformation/tree")
|
||||
public class SarLawsInformationCenterTreeController extends BaseController<SarLawsInformationCenterTree> {
|
||||
|
||||
@Resource
|
||||
private SarLawsInformationCenterTreeService informationCenterTreeService;
|
||||
|
||||
@ApiOperation("新增资料中心左侧树节点")
|
||||
@PostMapping("/addTreeNode")
|
||||
public ResponseMessage<?> addTreeNode(@RequestBody SarLawsInformationCenterTree informationCenterTree){
|
||||
informationCenterTreeService.addTreeNode(informationCenterTree);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@ApiOperation("删除树节点")
|
||||
@DeleteMapping("/deleteTreeNode")
|
||||
public ResponseMessage<String> deleteTreeNode(String id){
|
||||
Boolean aBoolean = informationCenterTreeService.deleteTreeNode(id);
|
||||
return aBoolean ? Result.success("删除成功") : Result.error("节点下存在数据无法删除。");
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("查询树结构")
|
||||
@GetMapping("/getTree")
|
||||
public ResponseMessage<List<SarLawsInformationCenterTreeData>> getTree(){
|
||||
List<SarLawsInformationCenterTreeData> informationCenterTreeList = informationCenterTreeService.getTree();
|
||||
return Result.success(informationCenterTreeList);
|
||||
}
|
||||
|
||||
@ApiOperation("修改树节点")
|
||||
@PutMapping("/updateTreeNode")
|
||||
public ResponseMessage<?> updateTreeNode(@RequestBody SarLawsInformationCenterTree informationCenterTree){
|
||||
boolean b = informationCenterTreeService.updateTreeNode(informationCenterTree);
|
||||
return Result.success("修改成功");
|
||||
}
|
||||
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
package com.adc.da.slrs.sarLawsInformationCenterTree.dao;
|
||||
|
||||
import com.adc.da.slrs.sarLawsInformationCenterTree.entity.SarLawsInformationCenterTree;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @author tjzdw
|
||||
* @description 针对表【sar_laws_information_center_tree】的数据库操作Mapper
|
||||
* @createDate 2023-10-23 11:20:26
|
||||
* @Entity com.adc.da.slrs.sarLawsInformationCenterTree.entity.SarLawsInformationCenterTree
|
||||
*/
|
||||
public interface SarLawsInformationCenterTreeDao extends BaseMapper<SarLawsInformationCenterTree> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
package com.adc.da.slrs.sarLawsInformationCenterTree.entity;
|
||||
|
||||
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 java.io.Serializable;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
*
|
||||
* @TableName sar_laws_information_center_tree
|
||||
*/
|
||||
@TableName(value ="sar_laws_information_center_tree")
|
||||
@Data
|
||||
public class SarLawsInformationCenterTree implements Serializable {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.ID_WORKER_STR)
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 父ID
|
||||
*/
|
||||
@TableField(value = "parent_id")
|
||||
private String parentId;
|
||||
|
||||
/**
|
||||
* 节点名称
|
||||
*/
|
||||
@TableField(value = "name")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 排序字段
|
||||
*/
|
||||
@TableField(value = "sort")
|
||||
private Integer sort;
|
||||
|
||||
@TableField(exist = false)
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
package com.adc.da.slrs.sarLawsInformationCenterTree.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
* @TableName sar_laws_information_center_tree
|
||||
*/
|
||||
@Data
|
||||
public class SarLawsInformationCenterTreeData implements Serializable {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 父ID
|
||||
*/
|
||||
private String parentId;
|
||||
|
||||
/**
|
||||
* 节点名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 排序字段
|
||||
*/
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* 子节点
|
||||
*/
|
||||
private List<SarLawsInformationCenterTreeData> children;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
package com.adc.da.slrs.sarLawsInformationCenterTree.service;
|
||||
|
||||
import com.adc.da.slrs.sarLawsInformationCenterTree.entity.SarLawsInformationCenterTree;
|
||||
import com.adc.da.slrs.sarLawsInformationCenterTree.entity.SarLawsInformationCenterTreeData;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author tjzdw
|
||||
* @description 针对表【sar_laws_information_center_tree】的数据库操作Service
|
||||
* @createDate 2023-10-23 11:20:26
|
||||
*/
|
||||
public interface SarLawsInformationCenterTreeService extends IService<SarLawsInformationCenterTree> {
|
||||
|
||||
void setResource(SarLawsInformationCenterTree informationCenterTree);
|
||||
|
||||
void addTreeNode(SarLawsInformationCenterTree informationCenterTree);
|
||||
|
||||
Boolean deleteTreeNode(String id);
|
||||
|
||||
List<SarLawsInformationCenterTreeData> getTree();
|
||||
|
||||
boolean updateTreeNode(SarLawsInformationCenterTree informationCenterTree);
|
||||
}
|
||||
+142
@@ -0,0 +1,142 @@
|
||||
package com.adc.da.slrs.sarLawsInformationCenterTree.service.impl;
|
||||
|
||||
import com.adc.da.slrs.sarLawsInformation.entity.SarLawsInformation;
|
||||
import com.adc.da.slrs.sarLawsInformation.service.SarLawsInformationService;
|
||||
import com.adc.da.slrs.sarLawsInformationCenterTree.dao.SarLawsInformationCenterTreeDao;
|
||||
import com.adc.da.slrs.sarLawsInformationCenterTree.entity.SarLawsInformationCenterTreeData;
|
||||
import com.adc.da.slrs.sarRole.dao.TsRoleDao;
|
||||
import com.adc.da.slrs.sarUser.service.ITsUserService;
|
||||
import com.adc.da.slrs.tsRoleMeunData.dao.TsRoleMenuDataDao;
|
||||
import com.adc.da.util.LoginUserUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.adc.da.slrs.sarLawsInformationCenterTree.entity.SarLawsInformationCenterTree;
|
||||
import com.adc.da.slrs.sarLawsInformationCenterTree.service.SarLawsInformationCenterTreeService;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author tjzdw
|
||||
* @description 针对表【sar_laws_information_center_tree】的数据库操作Service实现
|
||||
* @createDate 2023-10-23 11:20:26
|
||||
*/
|
||||
@Service
|
||||
public class SarLawsInformationCenterTreeServiceImpl extends ServiceImpl<SarLawsInformationCenterTreeDao, SarLawsInformationCenterTree>
|
||||
implements SarLawsInformationCenterTreeService{
|
||||
|
||||
@Resource
|
||||
private TsRoleDao tsRoleDao;
|
||||
@Resource
|
||||
private TsRoleMenuDataDao tsRoleMenuDataDao;
|
||||
@Resource
|
||||
private ITsUserService tsUserService;
|
||||
@Resource
|
||||
private SarLawsInformationService sarLawsInformationService;
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public void addTreeNode(SarLawsInformationCenterTree informationCenterTree) {
|
||||
int save = this.baseMapper.insert(informationCenterTree);
|
||||
//新增后给所有角色配置权限
|
||||
setResource(informationCenterTree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean deleteTreeNode(String id) {
|
||||
List<String> idList = Arrays.asList(id.split(","));
|
||||
LambdaQueryWrapper<SarLawsInformation> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.in(SarLawsInformation::getTreeNodeId,idList);
|
||||
int count = sarLawsInformationService.count(wrapper);
|
||||
if (count > 0) {
|
||||
return false;
|
||||
}
|
||||
int deleted = this.baseMapper.deleteBatchIds(idList);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SarLawsInformationCenterTreeData> getTree() {
|
||||
// 获取当前登录人
|
||||
String loginUserId = LoginUserUtil.getUserId();
|
||||
// 查询当前登录人的权限菜单
|
||||
List<String> resourceIdList = tsUserService.getResourceUserId(loginUserId);
|
||||
|
||||
List<SarLawsInformationCenterTreeData> resList = new ArrayList<>();
|
||||
LambdaQueryWrapper<SarLawsInformationCenterTree> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.in(SarLawsInformationCenterTree::getId, resourceIdList);
|
||||
wrapper.orderByAsc(SarLawsInformationCenterTree::getSort);
|
||||
List<SarLawsInformationCenterTree> list = this.list(wrapper);
|
||||
List<SarLawsInformationCenterTreeData> treeData = new ArrayList<>();
|
||||
//代码遍历生成树
|
||||
for (SarLawsInformationCenterTree informationCenterTree : list) {
|
||||
if (StringUtils.isNotBlank(informationCenterTree.getParentId())) {
|
||||
SarLawsInformationCenterTreeData informationCenterTreeData = new SarLawsInformationCenterTreeData();
|
||||
BeanUtils.copyProperties(informationCenterTree, informationCenterTreeData);
|
||||
treeData.add(informationCenterTreeData);
|
||||
}else {
|
||||
SarLawsInformationCenterTreeData res = new SarLawsInformationCenterTreeData();
|
||||
BeanUtils.copyProperties(informationCenterTree, res);
|
||||
resList.add(res);
|
||||
}
|
||||
}
|
||||
List<SarLawsInformationCenterTreeData> treeData1 = new ArrayList<>();
|
||||
//递归生成树
|
||||
for (SarLawsInformationCenterTreeData data : resList) {
|
||||
digui(data,treeData);
|
||||
treeData1.add(data);
|
||||
}
|
||||
return treeData1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean updateTreeNode(SarLawsInformationCenterTree informationCenterTree) {
|
||||
int updated = this.baseMapper.updateById(informationCenterTree);
|
||||
return updated > 0;
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public void setResource(SarLawsInformationCenterTree informationCenterTree) {
|
||||
//获取pid
|
||||
String pId = informationCenterTree.getParentId();
|
||||
List<String> roleIds = tsRoleDao.getResourceId(pId);
|
||||
for (String roleId : roleIds){
|
||||
tsRoleDao.addResource(roleId,informationCenterTree.getId());
|
||||
tsRoleMenuDataDao.save(roleId,informationCenterTree.getId());
|
||||
}
|
||||
}
|
||||
|
||||
private void digui(SarLawsInformationCenterTreeData res,List<SarLawsInformationCenterTreeData> treeData){
|
||||
for (SarLawsInformationCenterTreeData data : treeData) {
|
||||
if (null==res.getChildren()) {
|
||||
List<SarLawsInformationCenterTreeData> data1=new ArrayList<>();
|
||||
res.setChildren(data1);
|
||||
}
|
||||
if (res.getId().equals(data.getParentId())){
|
||||
if (null!=res.getChildren()){
|
||||
res.getChildren().add(data);
|
||||
}else {
|
||||
List<SarLawsInformationCenterTreeData> data1 = new ArrayList<>();
|
||||
data1.add(data);
|
||||
res.setChildren(data1);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (null!=res.getChildren()){
|
||||
for (SarLawsInformationCenterTreeData treeData1:res.getChildren()) {
|
||||
digui(treeData1,treeData);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
+16
-13
@@ -74,13 +74,16 @@ public class SarLawsStandInfoController extends BaseController<SarLawsStandInfo>
|
||||
public ResponseMessage<PageInfo<SarLawsStandInfo>> page(SarLawsStandInfoPage page) throws Exception {
|
||||
if (null != page.getNowOrderBy()) {
|
||||
switch (page.getNowOrderBy()) {
|
||||
case 1:
|
||||
case "issueTime":
|
||||
page.setOrderByA("SAR_LAWS_STAND_INFO.ISSUE_TIME");//发布日期
|
||||
break;
|
||||
case 2:
|
||||
page.setOrderByA("XCXSSRQLAWS");
|
||||
case "SSRQLAWS":
|
||||
page.setOrderByA("SSRQLAWS");
|
||||
break;
|
||||
case 3:
|
||||
case "LAWSSYCX":
|
||||
page.setOrderByA("LAWS_SYCX");
|
||||
break;
|
||||
case "standStatusShow":
|
||||
page.setOrderByA("standStatusShow");//文本状态
|
||||
break;
|
||||
default:
|
||||
@@ -89,10 +92,10 @@ public class SarLawsStandInfoController extends BaseController<SarLawsStandInfo>
|
||||
}
|
||||
if (null != page.getNowOrder()) {
|
||||
switch (page.getNowOrder()) {
|
||||
case 1:
|
||||
case "desc":
|
||||
page.setOrder1("desc");
|
||||
break;
|
||||
case 2:
|
||||
case "asc":
|
||||
page.setOrder1("asc");
|
||||
break;
|
||||
default:
|
||||
@@ -103,7 +106,7 @@ public class SarLawsStandInfoController extends BaseController<SarLawsStandInfo>
|
||||
}
|
||||
|
||||
|
||||
if (com.adc.da.util.utils.StringUtils.isNotBlank(page.getAdvanceSearchVOStr())) {
|
||||
if (StringUtils.isNotBlank(page.getAdvanceSearchVOStr())) {
|
||||
List<SarAdvanceSearchVO> searchList = JSONObject.parseArray(page.getAdvanceSearchVOStr(),SarAdvanceSearchVO.class);
|
||||
String advanceStr = SarAdvanceSearchUtil.createSql(searchList,"SAR_LAWS_ATTR_INFO");
|
||||
if (StringUtils.isNotBlank(advanceStr)) {
|
||||
@@ -142,13 +145,13 @@ public class SarLawsStandInfoController extends BaseController<SarLawsStandInfo>
|
||||
|
||||
private void nowOrderFunc(SarLawsStandInfoPage page) {
|
||||
switch (page.getNowOrderBy()) {
|
||||
case 1:
|
||||
case "issueTime":
|
||||
page.setOrderByA("SAR_LAWS_STAND_INFO.ISSUE_TIME");//发布日期
|
||||
break;
|
||||
case 2:
|
||||
page.setOrderByA("XCXSSRQLAWS");//实施日期
|
||||
case "SSRQLAWS":
|
||||
page.setOrderByA("SSRQLAWS");//实施日期
|
||||
break;
|
||||
case 3:
|
||||
case "standStatusShow":
|
||||
page.setOrderByA("standStatusShow");//文本状态
|
||||
break;
|
||||
default:
|
||||
@@ -157,10 +160,10 @@ public class SarLawsStandInfoController extends BaseController<SarLawsStandInfo>
|
||||
}
|
||||
if (null != page.getNowOrder()) {
|
||||
switch (page.getNowOrder()) {
|
||||
case 1:
|
||||
case "desc":
|
||||
page.setOrder1("desc");
|
||||
break;
|
||||
case 2:
|
||||
case "asc":
|
||||
page.setOrder1("asc");
|
||||
break;
|
||||
default:
|
||||
|
||||
+44
@@ -45,6 +45,38 @@ public class SarLawsStandInfo extends BaseEntity {
|
||||
@TableField("LAWS_TYPE")
|
||||
private String lawsType;
|
||||
|
||||
@ApiModelProperty(value = "一级政策分类")
|
||||
@TableField("LAWS_TYPE_FIRST_LEVEL")
|
||||
private String lawsTypeFirstLevel;
|
||||
|
||||
@ApiModelProperty(value = "一级政策分类名称")
|
||||
@TableField(exist = false)
|
||||
private String lawTypeFirstLevelName;
|
||||
|
||||
@ApiModelProperty(value = "二级政策份分类")
|
||||
@TableField("LAWS_TYPE_SECOND_LEVEL")
|
||||
private String lawsTypeSecondLevel;
|
||||
|
||||
@ApiModelProperty(value = "二级政策分类名称")
|
||||
@TableField(exist = false)
|
||||
private String lawTypeSecondLevelName;
|
||||
|
||||
@ApiModelProperty(value = "三级政策分类")
|
||||
@TableField("LAWS_TYPE_THIRD_LEVEL")
|
||||
private String lawsTypeThirdLevel;
|
||||
|
||||
@ApiModelProperty(value = "三级政策分类名称")
|
||||
@TableField(exist = false)
|
||||
private String lawTypeThirdLevelName;
|
||||
|
||||
@ApiModelProperty(value = "四级政策分类")
|
||||
@TableField("LAWS_TYPE_FOURTH_LEVEL")
|
||||
private String lawsTypeFourthLevel;
|
||||
|
||||
@ApiModelProperty(value = "四级政策分类名称")
|
||||
@TableField(exist = false)
|
||||
private String lawTypeFourthLevelName;
|
||||
|
||||
@ApiModelProperty(value = "政策编号")
|
||||
@TableField("LAWS_NUMBER")
|
||||
private String lawsNumber;
|
||||
@@ -100,10 +132,18 @@ public class SarLawsStandInfo extends BaseEntity {
|
||||
@TableField("LAWS_YEAR")
|
||||
private String lawsYear;
|
||||
|
||||
@ApiModelProperty(value = "年度值")
|
||||
@TableField(exist = false)
|
||||
private String lawsYearValue;
|
||||
|
||||
@ApiModelProperty(value = "福田转发通知文号")
|
||||
@TableField("LAWS_NOTISYNC_NUM")
|
||||
private String lawsNotisyncNum;
|
||||
|
||||
@ApiModelProperty(value = "通知文号链接")
|
||||
@TableField("NOTISYNC_NUM_LINK")
|
||||
private String notisyncNumLink;
|
||||
|
||||
@ApiModelProperty(value = "信息简报 xxx期次xxx板块")
|
||||
@TableField("LAWS_BULLETIN")
|
||||
private String lawsBulletin;
|
||||
@@ -262,4 +302,8 @@ public class SarLawsStandInfo extends BaseEntity {
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
private String XCXSSRQLAWS; // 新车实施日期
|
||||
|
||||
// 实施日期
|
||||
@TableField(exist = false)
|
||||
private String SSRQLAWS;
|
||||
|
||||
}
|
||||
|
||||
+21
-2
@@ -34,6 +34,18 @@ public class SarLawsStandInfoPage extends BasePage {
|
||||
@ApiModelProperty(value = "政策分类 共四级,逐级选择-配置管理中维护")
|
||||
private String lawsType;
|
||||
|
||||
@ApiModelProperty(value = "一级政策分类")
|
||||
private String lawsTypeFirstLevel;
|
||||
|
||||
@ApiModelProperty(value = "二级政策份分类")
|
||||
private String lawsTypeSecondLevel;
|
||||
|
||||
@ApiModelProperty(value = "三级政策分类")
|
||||
private String lawsTypeThirdLevel;
|
||||
|
||||
@ApiModelProperty(value = "四级政策分类")
|
||||
private String lawsTypeFourthLevel;
|
||||
|
||||
@ApiModelProperty(value = "政策编号")
|
||||
private String lawsNumber;
|
||||
|
||||
@@ -70,6 +82,8 @@ public class SarLawsStandInfoPage extends BasePage {
|
||||
@ApiModelProperty(value = "适用车型-配置管理中维护")
|
||||
private String lawsSycx;
|
||||
|
||||
private String[] lawsSycxArray;
|
||||
|
||||
@ApiModelProperty(value = "是/否(选择否,只有政策、政策中文名称是必填项目)")
|
||||
private String isRelateAccess;
|
||||
|
||||
@@ -231,8 +245,10 @@ public class SarLawsStandInfoPage extends BasePage {
|
||||
private String XCSJBUSS;
|
||||
|
||||
private String SSRQLAWS;
|
||||
private String XRZSSRQLAWS;
|
||||
private String XCXSSRQLAWS;
|
||||
private String ZCXSSRQLAWS;
|
||||
private String SXRQLAWS;
|
||||
private String ZCWBLAWS;
|
||||
private String GCWBLAWS;
|
||||
private String JDWJLAWS;
|
||||
@@ -240,6 +256,7 @@ public class SarLawsStandInfoPage extends BasePage {
|
||||
private String CYSDLAWS;
|
||||
private String TGRLAWS;
|
||||
private String TGDWLAWS;
|
||||
private String SYRZLAWS;
|
||||
private String NYLXLAWS;
|
||||
private String YYRZLAWS;
|
||||
private String ZRBMLAWS;
|
||||
@@ -263,10 +280,12 @@ public class SarLawsStandInfoPage extends BasePage {
|
||||
private String ids;
|
||||
@TableField(exist = false)
|
||||
private String proType;
|
||||
// 排序方式
|
||||
@TableField(exist = false)
|
||||
private Integer nowOrder;
|
||||
private String nowOrder;
|
||||
//排序字段
|
||||
@TableField(exist = false)
|
||||
private Integer nowOrderBy;
|
||||
private String nowOrderBy;
|
||||
@TableField(exist = false)
|
||||
private String orderByA = "";
|
||||
@TableField(exist = false)
|
||||
|
||||
+13
-7
@@ -170,6 +170,10 @@ public class SarLawsStandInfoServiceImpl extends ServiceImpl<SarLawsStandInfoDao
|
||||
}
|
||||
}
|
||||
}
|
||||
// 查询的使适用车型是多选
|
||||
if (StringUtils.isNotBlank(page.getLawsSycx())) {
|
||||
page.setLawsSycxArray(page.getLawsSycx().split(","));
|
||||
}
|
||||
Integer rowCount = this.baseMapper.getSarStandardsInfoCount(page);
|
||||
page.getPager().setRowCount(rowCount);
|
||||
List<SarLawsStandInfo> rows = this.baseMapper.getSarStandardsInfoPage(page);
|
||||
@@ -431,7 +435,9 @@ public class SarLawsStandInfoServiceImpl extends ServiceImpl<SarLawsStandInfoDao
|
||||
value = entry.getValue().toString();
|
||||
List<String> valArr = Arrays.asList(value.split(","));
|
||||
value = dicTypeEODao.getDicNamesByCodes(valArr,"");
|
||||
entry.setValue(value);
|
||||
if (value != null) {
|
||||
entry.setValue(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -522,13 +528,13 @@ public class SarLawsStandInfoServiceImpl extends ServiceImpl<SarLawsStandInfoDao
|
||||
|
||||
private void nowOrderFunc(SarLawsStandInfoPage page) {
|
||||
switch (page.getNowOrderBy()) {
|
||||
case 1:
|
||||
case "issue":
|
||||
page.setOrderByA("SAR_LAWS_STAND_INFO.ISSUE_TIME");//发布日期
|
||||
break;
|
||||
case 2:
|
||||
page.setOrderByA("XCXSSRQLAWS");//实施日期
|
||||
case "SSRQ":
|
||||
page.setOrderByA("SSRQLAWS");//实施日期
|
||||
break;
|
||||
case 3:
|
||||
case "standStatusShow":
|
||||
page.setOrderByA("standStatusShow");//文本状态
|
||||
break;
|
||||
default:
|
||||
@@ -537,10 +543,10 @@ public class SarLawsStandInfoServiceImpl extends ServiceImpl<SarLawsStandInfoDao
|
||||
}
|
||||
if (null != page.getNowOrder()) {
|
||||
switch (page.getNowOrder()) {
|
||||
case 1:
|
||||
case "desc":
|
||||
page.setOrder1("desc");
|
||||
break;
|
||||
case 2:
|
||||
case "asc":
|
||||
page.setOrder1("asc");
|
||||
break;
|
||||
default:
|
||||
|
||||
+253
@@ -0,0 +1,253 @@
|
||||
package com.adc.da.slrs.sarLawsTopic.controller;
|
||||
|
||||
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.core.util.ZipUtil;
|
||||
import com.adc.da.base.web.BaseController;
|
||||
import com.adc.da.common.ReadExcel;
|
||||
import com.adc.da.exception.AdcDaBaseException;
|
||||
import com.adc.da.http.PageInfo;
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.slrs.sarLawsInformation.entity.SarLawsInformation;
|
||||
import com.adc.da.slrs.sarLawsTopic.entity.SarLawsTopic;
|
||||
import com.adc.da.slrs.sarLawsTopic.entity.SarLawsTopicVO;
|
||||
import com.adc.da.slrs.sarLawsTopic.service.SarLawsTopicService;
|
||||
import com.adc.da.util.UUIDUtils;
|
||||
import com.adc.da.utils.util.FieldConvertUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.hssf.usermodel.*;
|
||||
import org.apache.poi.ss.usermodel.*;
|
||||
import org.apache.poi.ss.util.CellRangeAddress;
|
||||
import org.apache.poi.util.IOUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.*;
|
||||
import java.text.ParseException;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author tjzdw
|
||||
* @description
|
||||
* @date 2023/10/17
|
||||
*/
|
||||
@Api("政策课题模块")
|
||||
@RestController
|
||||
@RequestMapping("/${restPath}/lawss/sarLawsTopic")
|
||||
public class SarLawsTopicController extends BaseController<SarLawsTopicVO> {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(SarLawsTopicController.class);
|
||||
|
||||
@Resource
|
||||
private SarLawsTopicService lawsTopicService;
|
||||
|
||||
@Value("${file.path}")
|
||||
private String filePath;
|
||||
|
||||
@ApiOperation(value = "根据政策课题ID查询会议信息")
|
||||
@GetMapping("/getLawsTopicInfo")
|
||||
public ResponseMessage<SarLawsTopic> getLawsTopicInfo(String id) throws Exception{
|
||||
if (StringUtils.isBlank(id)) {
|
||||
return Result.error("会议ID为空!");
|
||||
}
|
||||
SarLawsTopic sarLawsTopic = lawsTopicService.getLawsTopicInfo(id);
|
||||
return Result.success(sarLawsTopic);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "分页查询")
|
||||
@GetMapping("/page")
|
||||
public ResponseMessage<PageInfo<SarLawsTopicVO>> page(SarLawsTopicVO sarLawsTopicVO) {
|
||||
List<SarLawsTopicVO> rows = lawsTopicService.queryByPage(sarLawsTopicVO);
|
||||
return Result.success(getPageInfo(sarLawsTopicVO.getPager(), rows));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "新增政策课题")
|
||||
@PostMapping(value = "/addLawsTopic", consumes = "application/json;charset=UTF-8")
|
||||
public ResponseMessage<?> create(@RequestBody SarLawsTopic lawsTopic) throws Exception {
|
||||
lawsTopicService.addLawsTopicInfo(lawsTopic);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@ApiOperation("根据会议ID删除会议")
|
||||
@DeleteMapping("/deleteLawsTopicById")
|
||||
public ResponseMessage<?> deleteMeeting(String lawsTopicId) {
|
||||
if (StringUtils.isBlank(lawsTopicId)) {
|
||||
return Result.error("删除失败,政策课题ID为空");
|
||||
}
|
||||
lawsTopicService.deleteLawsTopicInfo(lawsTopicId);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@ApiOperation("根据会议ID修改会议信息")
|
||||
@PutMapping("/updateLawsTopicInfo")
|
||||
public ResponseMessage<?> updateMeetingInfo(@RequestBody SarLawsTopic lawsTopic) {
|
||||
if (ObjectUtils.isEmpty(lawsTopic)) {
|
||||
return Result.error("更新失败,政策课题信息不存在");
|
||||
}
|
||||
Boolean updateResult = lawsTopicService.updateLawsTopicInfo(lawsTopic);
|
||||
return updateResult ? Result.success() : Result.error("更新失败");
|
||||
}
|
||||
|
||||
@ApiOperation("导出政策课题信息")
|
||||
@GetMapping("/exportLawsTopicInfo")
|
||||
public ResponseMessage<?> exportLawsTopicInfo(SarLawsTopicVO sarLawsTopicVO, HttpServletResponse response,
|
||||
HttpServletRequest request) {
|
||||
OutputStream os = null;
|
||||
Workbook workbook = null;
|
||||
List<SarLawsTopicVO> datas;
|
||||
try {
|
||||
if(StringUtils.isEmpty(sarLawsTopicVO.getExportName())||sarLawsTopicVO.getExportName().equals("null")){
|
||||
sarLawsTopicVO.setExportName("政策课题信息");
|
||||
}
|
||||
response.setHeader("Content-Disposition",
|
||||
"attachment; filename=" + ReadExcel.encodeFileName(sarLawsTopicVO.getExportName()+".xlsx",
|
||||
request));
|
||||
// 导出数据,若指定了值则使用ids字段条件导出,否则根据条件导出
|
||||
if (StrUtil.isNotBlank(sarLawsTopicVO.getExportIds())) {
|
||||
List<String> idList = Arrays.asList(sarLawsTopicVO.getExportIds().split(","));
|
||||
datas = lawsTopicService.getLawsTopicByIds(idList);
|
||||
} else {
|
||||
// 导出所有数据
|
||||
datas = lawsTopicService.getAllLawsTopic(sarLawsTopicVO);
|
||||
}
|
||||
ExportParams exportParams = new ExportParams();
|
||||
exportParams.setType(ExcelType.XSSF);
|
||||
exportParams.setSheetName(sarLawsTopicVO.getExportName());
|
||||
workbook = ExcelExportUtil.exportExcel(exportParams, SarLawsTopicVO.class, datas);
|
||||
os = response.getOutputStream();
|
||||
workbook.write(os);
|
||||
os.flush();
|
||||
} catch (IOException e) {
|
||||
logger.error(e.getMessage(), e);
|
||||
throw new AdcDaBaseException("下载文件失败,请重试");
|
||||
} finally {
|
||||
IOUtils.closeQuietly(os);
|
||||
}
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@ApiOperation("Excel文件导入政策资料信息")
|
||||
@PostMapping("/importLawsTopicInfo")
|
||||
public ResponseMessage<?> importLawsTopicInfo(@RequestParam(value = "file",required = false) MultipartFile file) throws ParseException {
|
||||
if (file == null) {
|
||||
return Result.error("文件为空,请重新上传");
|
||||
}
|
||||
return lawsTopicService.importLawsTopicInfo(file);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "政策课题导入模板下载")
|
||||
@GetMapping("/exportTemplateFile")
|
||||
public void exportTemplateFile(String fileName,HttpServletResponse response, HttpServletRequest request)throws Exception{
|
||||
|
||||
OutputStream os = null;
|
||||
OutputStream excelOS = null;
|
||||
HSSFWorkbook workbook = new HSSFWorkbook();
|
||||
String fileOriName = "政策课题导入模板";
|
||||
if (StringUtils.isNotEmpty(fileName)) {
|
||||
fileOriName = fileName;
|
||||
}
|
||||
try{
|
||||
//创建临时文件夹
|
||||
String fileNowPath = filePath + "/tempZip/" + UUIDUtils.randomUUID20() + "/" + fileOriName;
|
||||
File nowFile = new File(fileNowPath);
|
||||
if (nowFile.exists()){
|
||||
nowFile.delete();
|
||||
}
|
||||
nowFile.mkdirs();
|
||||
String fileName2 = "导入模板.xls";
|
||||
HSSFSheet sheetItems = workbook.createSheet("模板");
|
||||
sheetItems.setDefaultColumnWidth(13);
|
||||
Row rowHeader = sheetItems.createRow(1);//开始创建标题行
|
||||
sheetItems.addMergedRegion(new CellRangeAddress(0, 0, 0, 21));
|
||||
Row row2 = sheetItems.createRow(0);//开始创建填写说明
|
||||
|
||||
// 表头样式
|
||||
HSSFCellStyle cellStyle1 = workbook.createCellStyle();
|
||||
cellStyle1.setAlignment(HorizontalAlignment.CENTER);
|
||||
cellStyle1.setVerticalAlignment(VerticalAlignment.CENTER);
|
||||
String exportFieldName = "课题名称,课题承办单位,课题指导单位,课题参与单位,开始时间,结题时间,课题费用(万元)";
|
||||
String[] headerArr = exportFieldName.split(",");
|
||||
for (int i=0;i < headerArr.length; i++) {
|
||||
Cell cell = rowHeader.createCell(i);
|
||||
cell.setCellValue(headerArr[i]);
|
||||
sheetItems.addMergedRegion(new CellRangeAddress(1,2,i,i));
|
||||
cell.setCellStyle(cellStyle1);
|
||||
}
|
||||
|
||||
String exportFieldListName = "课题组会议列表,课题组联系方式,内部联系方式";
|
||||
String[] headerListArr = exportFieldListName.split(",");
|
||||
for (int i=0;i < headerListArr.length; i++) {
|
||||
Cell cell = rowHeader.createCell(7 + (i * 5));
|
||||
cell.setCellValue(headerListArr[i]);
|
||||
sheetItems.addMergedRegion(new CellRangeAddress(1,1,7+(i*5),7+(i*5)+4));
|
||||
cell.setCellStyle(cellStyle1);
|
||||
}
|
||||
HSSFRow rowHeader2 = sheetItems.createRow(2);
|
||||
String exportFieldMeetingName = "会议名称,会议时间,会议地点,参会人员(内部),会议主要内容";
|
||||
String[] headerMeetingListArr = exportFieldMeetingName.split(",");
|
||||
for (int i=0;i < headerMeetingListArr.length; i++) {
|
||||
Cell cell = rowHeader2.createCell(7 + i);
|
||||
cell.setCellValue(headerMeetingListArr[i]);
|
||||
cell.setCellStyle(cellStyle1);
|
||||
}
|
||||
String exportFieldContactName = "姓名,单位,电话,邮箱,身份";
|
||||
String[] headerContactListArr = exportFieldContactName.split(",");
|
||||
for (int i=0;i < headerContactListArr.length; i++) {
|
||||
Cell cell1 = rowHeader2.createCell(12 + i);
|
||||
cell1.setCellValue(headerContactListArr[i]);
|
||||
cell1.setCellStyle(cellStyle1);
|
||||
Cell cell2 = rowHeader2.createCell(17 + i);
|
||||
cell2.setCellValue(headerContactListArr[i]);
|
||||
cell2.setCellStyle(cellStyle1);
|
||||
}
|
||||
Cell cellA2 = row2.createCell(0);
|
||||
cellA2.setCellValue(FieldConvertUtil.exportLawsTopicDesc);
|
||||
//sheetItems.setColumnWidth(0, 20 * 150);
|
||||
row2.setHeight((short) (50 * 22));
|
||||
// 说明样式
|
||||
HSSFCellStyle cellStyle =workbook.createCellStyle();
|
||||
cellStyle.setAlignment(HorizontalAlignment.LEFT);
|
||||
cellStyle.setVerticalAlignment(VerticalAlignment.TOP);
|
||||
cellStyle.setWrapText(true);
|
||||
cellA2.setCellStyle(cellStyle);
|
||||
String repFileName = fileName2.replaceAll("/","_");
|
||||
excelOS = new FileOutputStream(fileNowPath + "/" + repFileName);
|
||||
response.setHeader("Content-Disposition",
|
||||
"attachment; filename=\""+ ReadExcel.encodeFileName(fileOriName+".zip", request) +"\"");
|
||||
response.setContentType("application/force-download");
|
||||
response.flushBuffer();
|
||||
os = response.getOutputStream();
|
||||
workbook.write(excelOS);
|
||||
excelOS.flush();
|
||||
excelOS.close();
|
||||
ZipUtil.zip(fileNowPath,fileNowPath+".zip");
|
||||
FileInputStream fis = new FileInputStream(fileNowPath+".zip");
|
||||
int len = 0;
|
||||
while ((len = fis.read()) != -1) {
|
||||
os.write(len);
|
||||
}
|
||||
os.flush();
|
||||
os.close(); // 后开先关
|
||||
fis.close(); // 先开后关
|
||||
} catch (Exception e) {
|
||||
logger.error(e.getMessage(), e);
|
||||
throw new com.adc.da.exception.AdcDaBaseException("下载文件失败,请重试");
|
||||
} finally {
|
||||
IOUtils.closeQuietly(os);
|
||||
IOUtils.closeQuietly(excelOS);
|
||||
}
|
||||
}
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
package com.adc.da.slrs.sarLawsTopic.dao;
|
||||
|
||||
import com.adc.da.slrs.sarLawsTopic.entity.SarLawsContactInformation;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @author tjzdw
|
||||
* @description 针对表【sar_laws_contact_information(政策课题组联系方式)】的数据库操作Mapper
|
||||
* @createDate 2023-10-17 15:41:32
|
||||
* @Entity com.adc.da.slrs.sarLawsTopic.entity.SarLawsContactInformation
|
||||
*/
|
||||
@Mapper
|
||||
public interface SarLawsContactInformationMapper extends BaseMapper<SarLawsContactInformation> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.adc.da.slrs.sarLawsTopic.dao;
|
||||
|
||||
import com.adc.da.slrs.sarLawsTopic.entity.SarLawsTopic;
|
||||
import com.adc.da.slrs.sarLawsTopic.entity.SarLawsTopicVO;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author tjzdw
|
||||
* @description 针对表【sar_laws_topic(政策课题)】的数据库操作Mapper
|
||||
* @createDate 2023-10-17 15:17:33
|
||||
* @Entity com.adc.da.slrs.sarLawsTopic.entity.SarLawsTopic
|
||||
*/
|
||||
@Mapper
|
||||
public interface SarLawsTopicMapper extends BaseMapper<SarLawsTopic> {
|
||||
|
||||
Integer queryByPageCount(SarLawsTopicVO page);
|
||||
|
||||
List<SarLawsTopicVO> queryByPage(SarLawsTopicVO page);
|
||||
|
||||
List<SarLawsTopicVO> getLawsTopicByIds(@Param("idList") List<String> idList);
|
||||
|
||||
List<SarLawsTopicVO> getAllLawsTopic(SarLawsTopicVO sarLawsTopicVO);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
package com.adc.da.slrs.sarLawsTopic.dao;
|
||||
|
||||
import com.adc.da.slrs.sarLawsTopic.entity.SarLawsTopicMeeting;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @author tjzdw
|
||||
* @description 针对表【sar_laws_topic_meeting(政策课题组会议)】的数据库操作Mapper
|
||||
* @createDate 2023-10-17 15:20:27
|
||||
* @Entity com.adc.da.slrs.sarLawsTopic.entity.SarLawsTopicMeeting
|
||||
*/
|
||||
@Mapper
|
||||
public interface SarLawsTopicMeetingMapper extends BaseMapper<SarLawsTopicMeeting> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
+73
@@ -0,0 +1,73 @@
|
||||
package com.adc.da.slrs.sarLawsTopic.entity;
|
||||
|
||||
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||
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 java.io.Serializable;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 政策课题组联系方式
|
||||
* @TableName sar_laws_contact_information
|
||||
*/
|
||||
@TableName(value ="sar_laws_contact_information")
|
||||
@Data
|
||||
public class SarLawsContactInformation implements Serializable {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "ID", type = IdType.ID_WORKER_STR)
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 政策课题ID
|
||||
*/
|
||||
@TableField(value = "LAWS_TOPIC_ID")
|
||||
private String lawsTopicId;
|
||||
|
||||
/**
|
||||
* 所属组别
|
||||
*/
|
||||
@TableField(value = "GROUP_TYPE")
|
||||
private String groupType;
|
||||
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
@TableField(value = "NAME")
|
||||
@Excel(name = "姓名", orderNum = "0", type = 1)
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
@TableField(value = "DEPARTMENT")
|
||||
@Excel(name = "单位", orderNum = "1", type = 1)
|
||||
private String department;
|
||||
|
||||
/**
|
||||
* 电话
|
||||
*/
|
||||
@TableField(value = "PHONE")
|
||||
@Excel(name = "电话", orderNum = "2", type = 1)
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 邮箱
|
||||
*/
|
||||
@TableField(value = "EMAIL")
|
||||
@Excel(name = "邮箱", orderNum = "3", type = 1)
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* 身份
|
||||
*/
|
||||
@TableField(value = "IDENTITY")
|
||||
@Excel(name = "身份", orderNum = "4", type = 1)
|
||||
private String identity;
|
||||
|
||||
@TableField(exist = false)
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
@@ -0,0 +1,247 @@
|
||||
package com.adc.da.slrs.sarLawsTopic.entity;
|
||||
|
||||
import com.adc.da.att.entity.AttFileEO;
|
||||
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 java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 政策课题
|
||||
* @TableName sar_laws_topic
|
||||
*/
|
||||
@TableName(value ="sar_laws_topic")
|
||||
@Data
|
||||
public class SarLawsTopic implements Serializable {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@ApiModelProperty(value = "主键")
|
||||
@TableId(value = "ID", type = IdType.ID_WORKER_STR)
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 课题名称
|
||||
*/
|
||||
@ApiModelProperty(value = "课题名称")
|
||||
@TableField(value = "TOPIC_NAME")
|
||||
private String topicName;
|
||||
|
||||
/**
|
||||
* 课题承办单位
|
||||
*/
|
||||
@ApiModelProperty(value = "课题承办单位")
|
||||
@TableField(value = "ORGANIZER")
|
||||
private String organizer;
|
||||
|
||||
/**
|
||||
* 课题指导单位
|
||||
*/
|
||||
@ApiModelProperty(value = "课题指导单位")
|
||||
@TableField(value = "GUIDANCE_UNIT")
|
||||
private String guidanceUnit;
|
||||
|
||||
/**
|
||||
* 课题参与单位
|
||||
*/
|
||||
@ApiModelProperty(value = "课题参与单位")
|
||||
@TableField(value = "PARTICIPATING_UNIT")
|
||||
private String participatingUnit;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
@ApiModelProperty(value = "开始时间")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@TableField(value = "START_TIME")
|
||||
private Date startTime;
|
||||
|
||||
/**
|
||||
* 结题时间
|
||||
*/
|
||||
@ApiModelProperty(value = "结题时间")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@TableField(value = "CLOSE_TIME")
|
||||
private Date closeTime;
|
||||
|
||||
/**
|
||||
* 课题状态
|
||||
*/
|
||||
@ApiModelProperty(value = "课题状态")
|
||||
@TableField(value = "TOPIC_STATUS")
|
||||
private String topicStatus;
|
||||
|
||||
/**
|
||||
* 课题费用(万元)
|
||||
*/
|
||||
@ApiModelProperty(value = "课题费用")
|
||||
@TableField(value = "TOPIC_COST")
|
||||
private String topicCost;
|
||||
|
||||
/**
|
||||
* 协议
|
||||
*/
|
||||
@ApiModelProperty("协议文件")
|
||||
@TableField(value = "AGREEMENT")
|
||||
private String agreement;
|
||||
|
||||
@ApiModelProperty(value = "协议文件列表")
|
||||
@TableField(exist = false)
|
||||
private List<AttFileEO> agreementList;
|
||||
|
||||
/**
|
||||
* 课题组会议列表
|
||||
*/
|
||||
@ApiModelProperty(value = "课题组会议列表")
|
||||
@TableField(exist = false)
|
||||
private List<SarLawsTopicMeeting> meetingList;
|
||||
|
||||
/**
|
||||
* 课题组研究方案
|
||||
*/
|
||||
@ApiModelProperty(value = "课题研究方案")
|
||||
@TableField(value = "RESEARCH_PLAN")
|
||||
private String researchPlan;
|
||||
|
||||
@ApiModelProperty(value = "课题组研究方案文件列表")
|
||||
@TableField(exist = false)
|
||||
private List<AttFileEO> researchPlanList;
|
||||
|
||||
/**
|
||||
* 课题组研究成果
|
||||
*/
|
||||
@ApiModelProperty(value = "课题组研究成果")
|
||||
@TableField(value = "RESEARCH_FINDINGS")
|
||||
private String researchFindings;
|
||||
|
||||
/**
|
||||
* 课题组研究成果真实文件名
|
||||
*/
|
||||
@ApiModelProperty(value = "课题组研究成果文件列表")
|
||||
@TableField(exist = false)
|
||||
private List<AttFileEO> researchFindingsList;
|
||||
|
||||
/**
|
||||
* 课题组其他
|
||||
*/
|
||||
@ApiModelProperty(value = "课题组其他文件")
|
||||
@TableField(value = "RESEARCH_GROUP_OTHER")
|
||||
private String researchGroupOther;
|
||||
|
||||
@ApiModelProperty(value = "课题组其他文件列表")
|
||||
@TableField(exist = false)
|
||||
private List<AttFileEO> researchGroupOtherList;
|
||||
|
||||
/**
|
||||
* 课题组会议资料
|
||||
*/
|
||||
@ApiModelProperty(value = "课题组会议资料")
|
||||
@TableField(value = "CONFERENCE_MATERIALS")
|
||||
private String conferenceMaterials;
|
||||
|
||||
@ApiModelProperty(value = "课题组会议资料文件列表")
|
||||
@TableField(exist = false)
|
||||
private List<AttFileEO> conferenceMaterialsList;
|
||||
|
||||
/**
|
||||
* 课题组联系方式
|
||||
*/
|
||||
@ApiModelProperty(value = "课题组联系方式列表")
|
||||
@TableField(exist = false)
|
||||
private List<SarLawsContactInformation> topicContactInformationList;
|
||||
|
||||
/**
|
||||
* 内部资料立项报告
|
||||
*/
|
||||
@ApiModelProperty(value = "内部资料立项报告")
|
||||
@TableField(value = "INSIDE_PROJECT_PROPOSAL_REPORT")
|
||||
private String insideProjectProposalRepost;
|
||||
|
||||
@ApiModelProperty(value = "内部资料立项报告文件列表")
|
||||
@TableField(exist = false)
|
||||
private List<AttFileEO> insideProjectProposalRepostList;
|
||||
|
||||
/**
|
||||
* 内部资料研究方案
|
||||
*/
|
||||
@ApiModelProperty(value = "内部资料研究方案")
|
||||
@TableField(value = "INSIDE_RESEARCH_PLAN")
|
||||
private String insideResearchPlan;
|
||||
|
||||
@ApiModelProperty(value = "内部资料研究方案文件列表")
|
||||
@TableField(exist = false)
|
||||
private List<AttFileEO> insideResearchPlanList;
|
||||
|
||||
/**
|
||||
* 内部资料会议资料
|
||||
*/
|
||||
@ApiModelProperty(value = "内部资料会议资料")
|
||||
@TableField(value = "INSIDE_CONFERENCE_MATERIALS")
|
||||
private String insideConferenceMaterials;
|
||||
|
||||
@ApiModelProperty(value = "内部资料会议资料文件列表")
|
||||
@TableField(exist = false)
|
||||
private List<AttFileEO> insideConferenceMaterialsList;
|
||||
|
||||
/**
|
||||
* 内部会议研究成果
|
||||
*/
|
||||
@ApiModelProperty(value = "内部会议研究成果")
|
||||
@TableField(value = "INSIDE_RESEARCH_FINDINGS")
|
||||
private String insideResearchFindings;
|
||||
|
||||
@ApiModelProperty(value = "内部会议研究成果文件列表")
|
||||
@TableField(exist = false)
|
||||
private List<AttFileEO> insideResearchFindingsList;
|
||||
|
||||
/**
|
||||
* 内部会议其他
|
||||
*/
|
||||
@ApiModelProperty(value = "内部会议其他文件")
|
||||
@TableField(value = "INSIDE_OTHER")
|
||||
private String insideOther;
|
||||
|
||||
@ApiModelProperty(value = "内部会议其他文件列表")
|
||||
@TableField(exist = false)
|
||||
private List<AttFileEO> insideOtherList;
|
||||
|
||||
/**
|
||||
* 内部联系方式
|
||||
*/
|
||||
@ApiModelProperty(value = "内部联系方式列表")
|
||||
@TableField(exist = false)
|
||||
private List<SarLawsContactInformation> insideContactInformationList;
|
||||
|
||||
/**
|
||||
* 逻辑删除,0可用,1不可用
|
||||
*/
|
||||
@ApiModelProperty(value = "逻辑删除")
|
||||
@TableField(value = "VALID_FLAG")
|
||||
private Integer validFlag;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@TableField(value = "CREATE_TIME")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@TableField(value = "MODIFY_TIME")
|
||||
private Date modifyTime;
|
||||
|
||||
@TableField(exist = false)
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
+68
@@ -0,0 +1,68 @@
|
||||
package com.adc.da.slrs.sarLawsTopic.entity;
|
||||
|
||||
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||
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 java.io.Serializable;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 政策课题组会议
|
||||
* @TableName sar_laws_topic_meeting
|
||||
*/
|
||||
@TableName(value ="sar_laws_topic_meeting")
|
||||
@Data
|
||||
public class SarLawsTopicMeeting implements Serializable {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "ID", type = IdType.ID_WORKER_STR)
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 政策课题ID
|
||||
*/
|
||||
@TableField(value = "LAWS_TOPIC_ID")
|
||||
private String lawsTopicId;
|
||||
|
||||
/**
|
||||
* 会议名称
|
||||
*/
|
||||
@TableField(value = "MEETING_NAME")
|
||||
@Excel(name = "会议名称", orderNum = "0", type = 1)
|
||||
private String meetingName;
|
||||
|
||||
/**
|
||||
* 会议时间
|
||||
*/
|
||||
@TableField(value = "MEETING_TIME")
|
||||
@Excel(name = "会议时间", orderNum = "1", type = 1)
|
||||
private String meetingTime;
|
||||
|
||||
/**
|
||||
* 会议地点
|
||||
*/
|
||||
@TableField(value = "MEETING_ADDRESS")
|
||||
@Excel(name = "会议地点", orderNum = "2", type = 1)
|
||||
private String meetingAddress;
|
||||
|
||||
/**
|
||||
* 参会人员(内部)
|
||||
*/
|
||||
@TableField(value = "PARTICIPANTS")
|
||||
@Excel(name = "参会人员(内部)", orderNum = "3", type = 1)
|
||||
private String participants;
|
||||
|
||||
/**
|
||||
* 会议主要内容
|
||||
*/
|
||||
@TableField(value = "MEETING_CONTENT")
|
||||
@Excel(name = "会议主要内容", orderNum = "4", type = 1)
|
||||
private String meetingContent;
|
||||
|
||||
@TableField(exist = false)
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
@@ -0,0 +1,249 @@
|
||||
package com.adc.da.slrs.sarLawsTopic.entity;
|
||||
|
||||
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||
import cn.afterturn.easypoi.excel.annotation.ExcelCollection;
|
||||
import com.adc.da.att.entity.AttFileEO;
|
||||
import com.adc.da.base.page.BasePage;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author tjzdw
|
||||
* @description
|
||||
* @date 2023/10/17
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Accessors(chain = true)
|
||||
@Data
|
||||
public class SarLawsTopicVO extends BasePage {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 课题名称
|
||||
*/
|
||||
@Excel(name = "课题名称", orderNum = "0", type = 1, needMerge = true)
|
||||
private String topicName;
|
||||
|
||||
/**
|
||||
* 课题承办单位
|
||||
*/
|
||||
@Excel(name = "课题承办单位", orderNum = "1",type = 1, needMerge = true)
|
||||
private String organizer;
|
||||
|
||||
/**
|
||||
* 课题指导单位
|
||||
*/
|
||||
@Excel(name = "课题指导单位", orderNum = "2", type = 1, needMerge = true)
|
||||
private String guidanceUnit;
|
||||
|
||||
/**
|
||||
* 课题参与单位
|
||||
*/
|
||||
@Excel(name = "课题参与单位", orderNum = "3", type = 1, needMerge = true)
|
||||
private String participatingUnit;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "开始时间", orderNum = "4", exportFormat = "yyyy-MM-dd", needMerge = true)
|
||||
private Date startTime;
|
||||
|
||||
/**
|
||||
* 结题时间
|
||||
*/
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "结题时间", orderNum = "5", exportFormat = "yyyy-MM-dd", needMerge = true)
|
||||
private Date closeTime;
|
||||
|
||||
/**
|
||||
* 课题状态
|
||||
*/
|
||||
@Excel(name = "课题状态", orderNum = "6", type = 1, needMerge = true)
|
||||
private String topicStatus;
|
||||
|
||||
/**
|
||||
* 课题费用(万元)
|
||||
*/
|
||||
@Excel(name = "课题费用(万元)", orderNum = "7", type = 1, needMerge = true)
|
||||
private String topicCost;
|
||||
|
||||
/**
|
||||
* 协议
|
||||
*/
|
||||
private String agreement;
|
||||
|
||||
private List<AttFileEO> agreementList;
|
||||
|
||||
/**
|
||||
* 课题组会议列表
|
||||
*/
|
||||
@ExcelCollection(name = "课题组会议列表", orderNum = "8")
|
||||
private List<SarLawsTopicMeeting> meetingList;
|
||||
|
||||
/**
|
||||
* 会议名称
|
||||
*/
|
||||
private String meetingName;
|
||||
|
||||
/**
|
||||
* 会议时间
|
||||
*/
|
||||
private String meetingTime;
|
||||
|
||||
/**
|
||||
* 会议地点
|
||||
*/
|
||||
private String meetingAddress;
|
||||
|
||||
/**
|
||||
* 参会人员(内部)
|
||||
*/
|
||||
private String participants;
|
||||
|
||||
// 参会人员列表
|
||||
private List<String> participantsList;
|
||||
|
||||
/**
|
||||
* 会议主要内容
|
||||
*/
|
||||
private String meetingContent;
|
||||
|
||||
/**
|
||||
* 课题组研究方案
|
||||
*/
|
||||
private String researchPlan;
|
||||
|
||||
private List<AttFileEO> researchPlanList;
|
||||
|
||||
/**
|
||||
* 课题组研究成果
|
||||
*/
|
||||
private String researchFindings;
|
||||
|
||||
private List<AttFileEO> researchFindingsList;
|
||||
|
||||
/**
|
||||
* 课题组其他
|
||||
*/
|
||||
private String researchGroupOther;
|
||||
|
||||
private List<AttFileEO> researchGroupOtherList;
|
||||
|
||||
/**
|
||||
* 课题组会议资料
|
||||
*/
|
||||
private String conferenceMaterials;
|
||||
|
||||
private List<AttFileEO> conferenceMaterialsList;
|
||||
|
||||
/**
|
||||
* 课题组联系方式
|
||||
*/
|
||||
@ExcelCollection(name = "课题组联系方式", orderNum = "9")
|
||||
private List<SarLawsContactInformation> topicContactInformationList;
|
||||
|
||||
// 课题组用户名称
|
||||
private String topicGroupName;
|
||||
// 课题组部门
|
||||
private String topicGroupDepartment;
|
||||
// 课题组电话
|
||||
private String topicGroupPhone;
|
||||
// 课题组用户邮箱
|
||||
private String topicGroupEmail;
|
||||
// 课题组用户身份
|
||||
private String topicGroupIdentity;
|
||||
|
||||
/**
|
||||
* 内部资料立项报告
|
||||
*/
|
||||
private String insideProjectProposalRepost;
|
||||
|
||||
private List<AttFileEO> insideProjectProposalRepostList;
|
||||
|
||||
/**
|
||||
* 内部资料研究方案
|
||||
*/
|
||||
private String insideResearchPlan;
|
||||
|
||||
private List<AttFileEO> insideResearchPlanList;
|
||||
|
||||
/**
|
||||
* 内部资料会议资料
|
||||
*/
|
||||
private String insideConferenceMaterials;
|
||||
|
||||
private List<AttFileEO> insideConferenceMaterialsList;
|
||||
|
||||
/**
|
||||
* 内部会议研究成果
|
||||
*/
|
||||
private String insideResearchFindings;
|
||||
|
||||
private List<AttFileEO> insideResearchFindingsList;
|
||||
|
||||
/**
|
||||
* 内部会议其他
|
||||
*/
|
||||
private String insideOther;
|
||||
|
||||
private List<AttFileEO> insideOtherList;
|
||||
|
||||
/**
|
||||
* 内部联系方式
|
||||
*/
|
||||
@ExcelCollection(name = "内部联系方式", orderNum = "10")
|
||||
private List<SarLawsContactInformation> insideContactInformationList;
|
||||
|
||||
// 内部人员名称
|
||||
private String insideName;
|
||||
// 内部人员部门
|
||||
private String insideDepartment;
|
||||
// 内部人员电话
|
||||
private String insidePhone;
|
||||
// 内部人员邮箱
|
||||
private String insideEmail;
|
||||
// 内部人员身份
|
||||
private String insideIdentity;
|
||||
|
||||
/**
|
||||
* 逻辑删除,0可用,1不可用
|
||||
*/
|
||||
private Integer validFlag;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date modifyTime;
|
||||
|
||||
private String sortField = "ID";
|
||||
|
||||
private String sortMode = "asc";
|
||||
|
||||
private String startTimeOperator = "=";
|
||||
private String closeTimeOperator = "=";
|
||||
|
||||
// 导出使用的属性
|
||||
// 导出文件名
|
||||
private String exportName;
|
||||
// 导出的ID列表字符串
|
||||
private String exportIds;
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
package com.adc.da.slrs.sarLawsTopic.service;
|
||||
|
||||
import com.adc.da.slrs.sarLawsTopic.entity.SarLawsContactInformation;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @author tjzdw
|
||||
* @description 针对表【sar_laws_contact_information(政策课题组联系方式)】的数据库操作Service
|
||||
* @createDate 2023-10-17 15:41:32
|
||||
*/
|
||||
public interface SarLawsContactInformationService extends IService<SarLawsContactInformation> {
|
||||
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
package com.adc.da.slrs.sarLawsTopic.service;
|
||||
|
||||
import com.adc.da.slrs.sarLawsTopic.entity.SarLawsTopicMeeting;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @author tjzdw
|
||||
* @description 针对表【sar_laws_topic_meeting(政策课题组会议)】的数据库操作Service
|
||||
* @createDate 2023-10-17 15:20:27
|
||||
*/
|
||||
public interface SarLawsTopicMeetingService extends IService<SarLawsTopicMeeting> {
|
||||
|
||||
}
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
package com.adc.da.slrs.sarLawsTopic.service;
|
||||
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.slrs.sarLawsInformation.entity.SarLawsInformation;
|
||||
import com.adc.da.slrs.sarLawsTopic.entity.SarLawsTopic;
|
||||
import com.adc.da.slrs.sarLawsTopic.entity.SarLawsTopicVO;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author tjzdw
|
||||
* @description 针对表【sar_laws_topic(政策课题)】的数据库操作Service
|
||||
* @createDate 2023-10-17 15:17:33
|
||||
*/
|
||||
public interface SarLawsTopicService extends IService<SarLawsTopic> {
|
||||
|
||||
SarLawsTopic getLawsTopicInfo(String lawsTopicId) throws Exception;
|
||||
|
||||
Integer addLawsTopicInfo(SarLawsTopic lawsTopic);
|
||||
|
||||
Boolean deleteLawsTopicInfo(String lawsTopicId);
|
||||
|
||||
Boolean updateLawsTopicInfo(SarLawsTopic lawsTopic);
|
||||
|
||||
List<SarLawsTopicVO> queryByPage(SarLawsTopicVO sarLawsTopicVO);
|
||||
|
||||
List<SarLawsTopicVO> getLawsTopicByIds(List<String> idList);
|
||||
|
||||
List<SarLawsTopicVO> getAllLawsTopic(SarLawsTopicVO sarLawsTopicVO);
|
||||
|
||||
ResponseMessage<?> importLawsTopicInfo(MultipartFile file);
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package com.adc.da.slrs.sarLawsTopic.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.adc.da.slrs.sarLawsTopic.entity.SarLawsContactInformation;
|
||||
import com.adc.da.slrs.sarLawsTopic.service.SarLawsContactInformationService;
|
||||
import com.adc.da.slrs.sarLawsTopic.dao.SarLawsContactInformationMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author tjzdw
|
||||
* @description 针对表【sar_laws_contact_information(政策课题组联系方式)】的数据库操作Service实现
|
||||
* @createDate 2023-10-17 15:41:32
|
||||
*/
|
||||
@Service
|
||||
public class SarLawsContactInformationServiceImpl extends ServiceImpl<SarLawsContactInformationMapper, SarLawsContactInformation>
|
||||
implements SarLawsContactInformationService{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package com.adc.da.slrs.sarLawsTopic.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.adc.da.slrs.sarLawsTopic.entity.SarLawsTopicMeeting;
|
||||
import com.adc.da.slrs.sarLawsTopic.service.SarLawsTopicMeetingService;
|
||||
import com.adc.da.slrs.sarLawsTopic.dao.SarLawsTopicMeetingMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author tjzdw
|
||||
* @description 针对表【sar_laws_topic_meeting(政策课题组会议)】的数据库操作Service实现
|
||||
* @createDate 2023-10-17 15:20:27
|
||||
*/
|
||||
@Service
|
||||
public class SarLawsTopicMeetingServiceImpl extends ServiceImpl<SarLawsTopicMeetingMapper, SarLawsTopicMeeting>
|
||||
implements SarLawsTopicMeetingService{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
+485
@@ -0,0 +1,485 @@
|
||||
package com.adc.da.slrs.sarLawsTopic.service.impl;
|
||||
|
||||
import cn.afterturn.easypoi.excel.ExcelImportUtil;
|
||||
import cn.afterturn.easypoi.excel.entity.ImportParams;
|
||||
import com.adc.da.att.entity.AttFileEO;
|
||||
import com.adc.da.att.service.impl.AttFileEOServiceImpl;
|
||||
import com.adc.da.common.FileUnZip;
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.slrs.sarLawsTopic.entity.SarLawsContactInformation;
|
||||
import com.adc.da.slrs.sarLawsTopic.entity.SarLawsTopicMeeting;
|
||||
import com.adc.da.slrs.sarLawsTopic.entity.SarLawsTopicVO;
|
||||
import com.adc.da.slrs.sarLawsTopic.service.SarLawsContactInformationService;
|
||||
import com.adc.da.slrs.sarLawsTopic.service.SarLawsTopicMeetingService;
|
||||
import com.adc.da.slrs.sarUpdLog.entity.SarUpdLog;
|
||||
import com.adc.da.slrs.sarUpdLog.service.ISarUpdLogService;
|
||||
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.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.adc.da.slrs.sarLawsTopic.entity.SarLawsTopic;
|
||||
import com.adc.da.slrs.sarLawsTopic.service.SarLawsTopicService;
|
||||
import com.adc.da.slrs.sarLawsTopic.dao.SarLawsTopicMapper;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.ss.usermodel.Row;
|
||||
import org.apache.poi.ss.usermodel.Sheet;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.apache.poi.ss.usermodel.WorkbookFactory;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @author tjzdw
|
||||
* @description 针对表【sar_laws_topic(政策课题)】的数据库操作Service实现
|
||||
* @createDate 2023-10-17 15:17:33
|
||||
*/
|
||||
@Service
|
||||
public class SarLawsTopicServiceImpl extends ServiceImpl<SarLawsTopicMapper, SarLawsTopic>
|
||||
implements SarLawsTopicService{
|
||||
|
||||
@Resource
|
||||
private SarLawsTopicMeetingService meetingService;
|
||||
@Resource
|
||||
private AttFileEOServiceImpl attFileEOService;
|
||||
@Resource
|
||||
private ISarUpdLogService updLogService;
|
||||
@Value("${file.path}")
|
||||
private String filePath;//文件存储路径
|
||||
|
||||
@Resource
|
||||
private SarLawsContactInformationService contactInformationService;
|
||||
|
||||
@Override
|
||||
public SarLawsTopic getLawsTopicInfo(String lawsTopicId) {
|
||||
SarLawsTopic sarLawsTopic = this.baseMapper.selectById(lawsTopicId);
|
||||
// 查询课题组会议
|
||||
LambdaQueryWrapper<SarLawsTopicMeeting> meetingWrapper = new LambdaQueryWrapper<>();
|
||||
meetingWrapper.eq(SarLawsTopicMeeting::getLawsTopicId, lawsTopicId);
|
||||
List<SarLawsTopicMeeting> topicMeetingList = meetingService.list(meetingWrapper);
|
||||
sarLawsTopic.setMeetingList(topicMeetingList);
|
||||
// 查询课题组联系方式
|
||||
LambdaQueryWrapper<SarLawsContactInformation> topicGroupWrapper = new LambdaQueryWrapper<>();
|
||||
topicGroupWrapper.eq(SarLawsContactInformation::getLawsTopicId, lawsTopicId);
|
||||
topicGroupWrapper.eq(SarLawsContactInformation::getGroupType,"topicGroup");
|
||||
List<SarLawsContactInformation> lawsTopicContactInformation = contactInformationService.list(topicGroupWrapper);
|
||||
sarLawsTopic.setTopicContactInformationList(lawsTopicContactInformation);
|
||||
// 查询内部联系房方式
|
||||
LambdaQueryWrapper<SarLawsContactInformation> insideWrapper = new LambdaQueryWrapper<>();
|
||||
insideWrapper.eq(SarLawsContactInformation::getLawsTopicId, lawsTopicId);
|
||||
insideWrapper.eq(SarLawsContactInformation::getGroupType,"inside");
|
||||
List<SarLawsContactInformation> insideContactInformation = contactInformationService.list(insideWrapper);
|
||||
sarLawsTopic.setInsideContactInformationList(insideContactInformation);
|
||||
// 获取文件信息
|
||||
getFileListByAttFile(sarLawsTopic);
|
||||
return sarLawsTopic;
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public Integer addLawsTopicInfo(SarLawsTopic lawsTopic) {
|
||||
lawsTopic.setCreateTime(new Date());
|
||||
lawsTopic.setModifyTime(new Date());
|
||||
lawsTopic.setValidFlag(0);
|
||||
int insert = this.baseMapper.insert(lawsTopic);
|
||||
if (lawsTopic.getMeetingList() != null && !lawsTopic.getMeetingList().isEmpty()) {
|
||||
for (SarLawsTopicMeeting meeting : lawsTopic.getMeetingList()) {
|
||||
if (StringUtils.isNotBlank(meeting.getMeetingName())) {
|
||||
meeting.setLawsTopicId(lawsTopic.getId());
|
||||
meetingService.save(meeting);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (lawsTopic.getTopicContactInformationList() != null && !lawsTopic.getTopicContactInformationList().isEmpty()) {
|
||||
for (SarLawsContactInformation information : lawsTopic.getTopicContactInformationList()) {
|
||||
if (StringUtils.isNotBlank(information.getName())) {
|
||||
information.setLawsTopicId(lawsTopic.getId());
|
||||
information.setGroupType("topicGroup");
|
||||
contactInformationService.save(information);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (lawsTopic.getInsideContactInformationList() != null && !lawsTopic.getInsideContactInformationList().isEmpty()) {
|
||||
for (SarLawsContactInformation information : lawsTopic.getInsideContactInformationList()) {
|
||||
if (StringUtils.isNotBlank(information.getName())) {
|
||||
information.setLawsTopicId(lawsTopic.getId());
|
||||
information.setGroupType("inside");
|
||||
contactInformationService.save(information);
|
||||
}
|
||||
}
|
||||
}
|
||||
return insert;
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public Boolean deleteLawsTopicInfo(String lawsTopicId) {
|
||||
LambdaUpdateWrapper<SarLawsTopic> wrapper = new LambdaUpdateWrapper<>();
|
||||
wrapper.eq(SarLawsTopic::getId, lawsTopicId);
|
||||
wrapper.set(SarLawsTopic::getValidFlag,1);
|
||||
wrapper.set(SarLawsTopic::getModifyTime,new Date());
|
||||
boolean update = update(wrapper);
|
||||
if (update) {
|
||||
LambdaQueryWrapper<SarLawsTopicMeeting> lawsTopicWrapper = new LambdaQueryWrapper<>();
|
||||
lawsTopicWrapper.eq(SarLawsTopicMeeting::getLawsTopicId, lawsTopicId);
|
||||
meetingService.remove(lawsTopicWrapper);
|
||||
LambdaQueryWrapper<SarLawsContactInformation> informationWrapper = new LambdaQueryWrapper<>();
|
||||
informationWrapper.eq(SarLawsContactInformation::getLawsTopicId, lawsTopicId);
|
||||
contactInformationService.remove(informationWrapper);
|
||||
}
|
||||
return update;
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public Boolean updateLawsTopicInfo(SarLawsTopic lawsTopic) {
|
||||
if (StringUtils.isBlank(lawsTopic.getId())) {
|
||||
return false;
|
||||
}
|
||||
SarLawsTopic lawsTopicInfoDB = getLawsTopicInfo(lawsTopic.getId());
|
||||
List<String> compareList = compareLawsTopic(lawsTopicInfoDB, lawsTopic);
|
||||
if (compareLawsTopic(lawsTopicInfoDB, lawsTopic).size() == 0) {
|
||||
return true;
|
||||
}
|
||||
lawsTopic.setModifyTime(new Date());
|
||||
int update = this.baseMapper.updateById(lawsTopic);
|
||||
// 比较列表字段是否经过修改,如果经过修改,先删除,再添加
|
||||
if (compareList.contains("课题组会议列表被变更")) {
|
||||
LambdaQueryWrapper<SarLawsTopicMeeting> topicWrapper = new LambdaQueryWrapper<>();
|
||||
topicWrapper.eq(SarLawsTopicMeeting::getLawsTopicId,lawsTopic.getId());
|
||||
meetingService.remove(topicWrapper);
|
||||
for (SarLawsTopicMeeting meeting : lawsTopic.getMeetingList()) {
|
||||
meeting.setLawsTopicId(lawsTopic.getId());
|
||||
meetingService.save(meeting);
|
||||
}
|
||||
}
|
||||
if (compareList.contains("课题组联系方式列表被变更")) {
|
||||
LambdaQueryWrapper<SarLawsContactInformation> informationWrapper = new LambdaQueryWrapper<>();
|
||||
informationWrapper.eq(SarLawsContactInformation::getLawsTopicId,lawsTopic.getId());
|
||||
informationWrapper.eq(SarLawsContactInformation::getGroupType,"topicGroup");
|
||||
contactInformationService.remove(informationWrapper);
|
||||
for (SarLawsContactInformation information : lawsTopic.getTopicContactInformationList()) {
|
||||
information.setGroupType("topicGroup");
|
||||
information.setLawsTopicId(lawsTopic.getId());
|
||||
contactInformationService.save(information);
|
||||
}
|
||||
}
|
||||
if (compareList.contains("内部联系方式列表被变更")) {
|
||||
LambdaQueryWrapper<SarLawsContactInformation> informationWrapper = new LambdaQueryWrapper<>();
|
||||
informationWrapper.eq(SarLawsContactInformation::getLawsTopicId,lawsTopic.getId());
|
||||
informationWrapper.eq(SarLawsContactInformation::getGroupType,"inside");
|
||||
contactInformationService.remove(informationWrapper);
|
||||
for (SarLawsContactInformation information : lawsTopic.getInsideContactInformationList()) {
|
||||
information.setGroupType("inside");
|
||||
information.setLawsTopicId(lawsTopic.getId());
|
||||
contactInformationService.save(information);
|
||||
}
|
||||
}
|
||||
// 存储修改记录
|
||||
SarUpdLog sarUpdLogEO = new SarUpdLog();
|
||||
sarUpdLogEO.setId(UUIDUtils.randomUUID20());
|
||||
sarUpdLogEO.setSarId(lawsTopicInfoDB.getId());
|
||||
sarUpdLogEO.setSarType("LAWS_TOPIC");
|
||||
sarUpdLogEO.setCreationTime(new Date());
|
||||
sarUpdLogEO.setCreationUser(LoginUserUtil.getUserId());
|
||||
sarUpdLogEO.setContent(lawsTopicInfoDB.getTopicName() + "," + String.join(",",compareList));
|
||||
updLogService.save(sarUpdLogEO);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<SarLawsTopicVO> queryByPage(SarLawsTopicVO page){
|
||||
if (StringUtils.isNotBlank(page.getParticipants())) {
|
||||
page.setParticipantsList(Arrays.asList(page.getParticipants().split(",")));
|
||||
}
|
||||
// 设置排序字段
|
||||
if (StringUtils.isNotBlank(page.getSortField())) {
|
||||
String sortField = StringUtils.join(StringUtils.splitByCharacterTypeCamelCase(page.getSortField()),"_").toUpperCase();
|
||||
page.setSortField(sortField);
|
||||
} else {
|
||||
page.setSortField("ID");
|
||||
page.setSortMode("asc");
|
||||
}
|
||||
Integer rowCount = this.baseMapper.queryByPageCount(page);
|
||||
page.getPager().setRowCount(rowCount);
|
||||
List<SarLawsTopicVO> sarLawsTopicVOList = this.baseMapper.queryByPage(page);
|
||||
for (SarLawsTopicVO lawsTopicVO : sarLawsTopicVOList) {
|
||||
getFileListByAttFile(lawsTopicVO);
|
||||
}
|
||||
return sarLawsTopicVOList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SarLawsTopicVO> getLawsTopicByIds(List<String> idList) {
|
||||
return this.baseMapper.getLawsTopicByIds(idList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SarLawsTopicVO> getAllLawsTopic(SarLawsTopicVO sarLawsTopicVO) {
|
||||
return this.baseMapper.getAllLawsTopic(sarLawsTopicVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseMessage<?> importLawsTopicInfo(MultipartFile file) {
|
||||
//获取文件全称
|
||||
String fileNameStr = file.getOriginalFilename();
|
||||
//获取最后.的位置
|
||||
assert fileNameStr != null;
|
||||
int pos = fileNameStr.lastIndexOf(".");
|
||||
//获取压缩文件名称并以小写显示
|
||||
String fileStr = fileNameStr.substring(pos + 1).toLowerCase();
|
||||
//校验是否是zip文件
|
||||
if (!fileStr.equals("zip")) {
|
||||
return Result.error("请上传zip格式的文件");
|
||||
}
|
||||
//进行拼接获取文件名称
|
||||
String fileName = fileNameStr.substring(0, pos);
|
||||
//获取路径和文件名称
|
||||
String path = filePath + "/" + fileName;
|
||||
|
||||
File saveDirectory = new File(path);
|
||||
//判断saveDirectory中是否是文件夹
|
||||
if (!saveDirectory.isDirectory()) {
|
||||
saveDirectory.mkdir();
|
||||
}
|
||||
//将文件写入到指定路径中
|
||||
try {
|
||||
FileUtils.copyInputStreamToFile(file.getInputStream(), new File(path + "/" + fileNameStr));
|
||||
} catch (IOException e) {
|
||||
return Result.error("文件存储失败!");
|
||||
}
|
||||
//解压缩
|
||||
String zipEntryName = null;
|
||||
try {
|
||||
zipEntryName = FileUnZip.unZipFiles(path + "/" + fileNameStr, path);
|
||||
FileUnZip.delete(new File(path + "/" + fileNameStr));
|
||||
} catch (IOException e) {
|
||||
return Result.error("文件解压失败");
|
||||
}
|
||||
//获取文件信息
|
||||
List<File> fileList = readImpExcelFile(zipEntryName);
|
||||
//判断获取到的文件数量
|
||||
if (fileList.size() != 1) {
|
||||
return Result.error("上传的文件只能有一个");
|
||||
}
|
||||
File importFile = fileList.get(0);
|
||||
if (!importFile.getName().contains(".xls") && !importFile.getName().contains(".xlsx")) {
|
||||
return Result.error("文件必须是EXCEL文件");
|
||||
}
|
||||
Workbook workbook = null;
|
||||
try {
|
||||
workbook = WorkbookFactory.create(importFile);
|
||||
} catch (IOException e) {
|
||||
FileUnZip.deleteDir(saveDirectory);
|
||||
return Result.error("导入失败,需要导入的数据有问题或导入的企标标号和企标名称已存在");
|
||||
}
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
Sheet sheet = workbook.getSheetAt(0);
|
||||
if (sheet == null) {
|
||||
return Result.error("工作表为空");
|
||||
}
|
||||
StringBuilder sb = new StringBuilder();
|
||||
// 获取excel表头
|
||||
List<String> headerList = new ArrayList<>();
|
||||
Row headerRow = sheet.getRow(1);
|
||||
for (int i = 0; i < 22; i++) {
|
||||
headerList.add(headerRow.getCell(i).getStringCellValue());
|
||||
}
|
||||
// 获取关联表表头
|
||||
Row relationRow = sheet.getRow(2);
|
||||
List<String> relationList = new ArrayList<>();
|
||||
for (int i = 7; i < 22; i++) {
|
||||
relationList.add(relationRow.getCell(i).getStringCellValue());
|
||||
}
|
||||
|
||||
// 判断表头字段是否相同
|
||||
if (!String.join(",",headerList).equals(FieldConvertUtil.exportFieldLawsTopic)
|
||||
&& !String.join(",",relationList).equals(FieldConvertUtil.exportFieldLawsTopicRelation)) {
|
||||
try {
|
||||
workbook.close();
|
||||
} catch (IOException e) {
|
||||
return Result.error("文件关闭出错");
|
||||
}
|
||||
//删除原上传文件
|
||||
FileUnZip.deleteDir(saveDirectory);
|
||||
return Result.error("fail", "读取失败,请严格按照模板文件导入数据");
|
||||
}
|
||||
|
||||
ImportParams importParams = new ImportParams();
|
||||
importParams.setTitleRows(1);
|
||||
importParams.setHeadRows(2);
|
||||
List<SarLawsTopicVO> lawsTopicVOList = ExcelImportUtil.importExcel(readImpExcelFile(zipEntryName).get(0), SarLawsTopicVO.class, importParams);
|
||||
// 去除空数据
|
||||
for (SarLawsTopicVO lawsTopicVO : lawsTopicVOList) {
|
||||
if (StringUtils.isNotBlank(lawsTopicVO.getTopicName())) {
|
||||
// 存入数据库
|
||||
SarLawsTopic sarLawsTopic = new SarLawsTopic();
|
||||
BeanUtils.copyProperties(lawsTopicVO,sarLawsTopic);
|
||||
if (sarLawsTopic.getStartTime() != null && sarLawsTopic.getCloseTime() != null) {
|
||||
sarLawsTopic.setTopicStatus("已结题");
|
||||
} else {
|
||||
sarLawsTopic.setTopicStatus("进行中");
|
||||
}
|
||||
addLawsTopicInfo(sarLawsTopic);
|
||||
}
|
||||
}
|
||||
return Result.success("导入成功");
|
||||
}
|
||||
|
||||
// 通过反射获取文件内容
|
||||
public void getFileListByAttFile(SarLawsTopic lawsTopic) {
|
||||
String[] fileField = {"agreement","researchPlan","researchFindings","researchGroupOther","conferenceMaterials",
|
||||
"insideProjectProposalRepost","insideResearchPlan","insideConferenceMaterials","insideResearchFindings","insideOther"};
|
||||
try {
|
||||
for (String field : fileField) {
|
||||
String getMethod = "get" + StringUtils.capitalize(field);
|
||||
Method method = SarLawsTopic.class.getMethod(getMethod);
|
||||
String fileAttId = String.valueOf(method.invoke(lawsTopic));
|
||||
if (StringUtils.isNotBlank(fileAttId) && !"null".equals(fileAttId)) {
|
||||
List<AttFileEO> fileList = new ArrayList<>();
|
||||
for (String attId : fileAttId.split(",")) {
|
||||
AttFileEO fileInfo = attFileEOService.getFileInfo(attId);
|
||||
fileList.add(fileInfo);
|
||||
}
|
||||
String setMethod = "set" + StringUtils.capitalize(field) + "List";
|
||||
method = SarLawsTopic.class.getMethod(setMethod, List.class);
|
||||
method.invoke(lawsTopic, fileList);
|
||||
}
|
||||
}
|
||||
}catch (NoSuchMethodException | InvocationTargetException | IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public void getFileListByAttFile(SarLawsTopicVO lawsTopic) {
|
||||
String[] fileField = {"agreement","researchPlan","researchFindings","researchGroupOther","conferenceMaterials",
|
||||
"insideProjectProposalRepost","insideResearchPlan","insideConferenceMaterials","insideResearchFindings","insideOther"};
|
||||
try {
|
||||
for (String field : fileField) {
|
||||
String getMethod = "get" + StringUtils.capitalize(field);
|
||||
Method method = SarLawsTopicVO.class.getMethod(getMethod);
|
||||
String fileAttId = String.valueOf(method.invoke(lawsTopic));
|
||||
if (StringUtils.isNotBlank(fileAttId) && !"null".equals(fileAttId)) {
|
||||
List<AttFileEO> fileList = new ArrayList<>();
|
||||
for (String attId : fileAttId.split(",")) {
|
||||
AttFileEO fileInfo = attFileEOService.getFileInfo(attId);
|
||||
fileList.add(fileInfo);
|
||||
}
|
||||
String setMethod = "set" + StringUtils.capitalize(field) + "List";
|
||||
method = SarLawsTopicVO.class.getMethod(setMethod, List.class);
|
||||
method.invoke(lawsTopic, fileList);
|
||||
}
|
||||
}
|
||||
}catch (NoSuchMethodException | InvocationTargetException | IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 比较两个SarLawsTopic 对象
|
||||
* @param oldLawsTopic 数据库中存储的对象
|
||||
* @param newLawsTopic 更新后的对象
|
||||
* @return 差异
|
||||
*/
|
||||
public List<String> compareLawsTopic(SarLawsTopic oldLawsTopic, SarLawsTopic newLawsTopic) {
|
||||
List<String> changes = new ArrayList<>();
|
||||
// 不需要比较的字段
|
||||
String[] ignoreFields = {"id","validFlag","createTime","modifyTime","agreementList","researchPlanList",
|
||||
"researchFindingsList","researchGroupOtherList","conferenceMaterialsList","insideProjectProposalRepostList",
|
||||
"insideResearchPlanList","insideConferenceMaterialsList","insideResearchFindingsList","insideOtherList","serialVersionUID"};
|
||||
String[] fileAttIdFields = {"agreement","researchPlan","researchFindings","researchGroupOther","conferenceMaterials",
|
||||
"insideProjectProposalRepost","insideResearchPlan","insideConferenceMaterials","insideResearchFindings","insideOther"};
|
||||
List<String> ignoreFieldList = Arrays.asList(ignoreFields);
|
||||
List<String> fileAttIdFieldList = Arrays.asList(fileAttIdFields);
|
||||
// 获取SarLawsTopic类的所有字段
|
||||
Field[] fields = SarLawsTopic.class.getDeclaredFields();
|
||||
for (Field field : fields) {
|
||||
if (!ignoreFieldList.contains(field.getName())) {
|
||||
try {
|
||||
field.setAccessible(true);
|
||||
String oldValue = String.valueOf(field.get(oldLawsTopic));
|
||||
String newValue = String.valueOf(field.get(newLawsTopic));
|
||||
if (!Objects.equals(oldValue, newValue)) {
|
||||
// 对比文件字段
|
||||
if (fileAttIdFieldList.contains(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 = SarLawsTopic.class.getMethod("get" + fieldName + "List");
|
||||
// 获取旧的文件名
|
||||
List<?> oldFileList = (List)method.invoke(oldLawsTopic);
|
||||
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) + "\"");
|
||||
// 对比列表字段
|
||||
} else if ("meetingList".equals(field.getName()) || "topicContactInformationList".equals(field.getName())
|
||||
|| "insideContactInformationList".equals(field.getName())) {
|
||||
ApiModelProperty annotationsByType = field.getAnnotationsByType(ApiModelProperty.class)[0];
|
||||
changes.add(annotationsByType.value() + "被变更");
|
||||
} else {
|
||||
// 对比其他字段
|
||||
ApiModelProperty annotationsByType = field.getAnnotationsByType(ApiModelProperty.class)[0];
|
||||
changes.add(annotationsByType.value() + "由\"" + oldValue + "\"改为\"" + newValue + "\"");
|
||||
}
|
||||
}
|
||||
} catch (IllegalAccessException | NoSuchMethodException | InvocationTargetException e) {
|
||||
// 处理异常
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
return changes;
|
||||
}
|
||||
|
||||
private static List<File> readImpExcelFile(String path) {
|
||||
File file = new File(path);
|
||||
List<File> resultlist = new ArrayList<>();
|
||||
if (file.isDirectory()) {
|
||||
File[] files = file.listFiles();
|
||||
for (File fi : files) {
|
||||
// 对文件进行过滤,读取所有文件
|
||||
String name = fi.getName();
|
||||
//文件不为空 添加
|
||||
if (name != null){
|
||||
resultlist.add(fi);
|
||||
}
|
||||
}
|
||||
}
|
||||
return resultlist;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
+37
@@ -11,6 +11,8 @@ import com.adc.da.sys.sarMenuStandard.entity.SarMenuStandard;
|
||||
import com.adc.da.util.LoginUserUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -50,5 +52,40 @@ public class SarMenuStandardNewController extends BaseController<SarMenuStandard
|
||||
return Result.success(tsResources);
|
||||
}
|
||||
|
||||
@ApiOperation("添加标准体系菜单项")
|
||||
@PostMapping("/addMenuStandard")
|
||||
public ResponseMessage<?> addMenuStandard(@RequestBody SarMenuStandardNew sarMenuStandardNew) {
|
||||
if (ObjectUtils.isEmpty(sarMenuStandardNew)) {
|
||||
return Result.error("添加失败,对象为空");
|
||||
}
|
||||
iSarMenuStandardNewService.addMenuStandard(sarMenuStandardNew);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@ApiOperation("根据菜单ID查询菜单")
|
||||
@GetMapping("/getMenuStandardById")
|
||||
public ResponseMessage<SarMenuStandard> getMenuStandardById(@RequestParam String menuId){
|
||||
if (StringUtils.isBlank(menuId)) {
|
||||
return Result.error("获取失败,菜单ID为空");
|
||||
}
|
||||
return Result.success(iSarMenuStandardNewService.getMenuStandardById(menuId));
|
||||
}
|
||||
|
||||
@ApiOperation("修改标准体系菜单项")
|
||||
@PutMapping("/updateMenuStandard")
|
||||
public ResponseMessage<?> updateMenuStandard(@RequestBody SarMenuStandardNew sarMenuStandardNew) {
|
||||
if (ObjectUtils.isEmpty(sarMenuStandardNew)) {
|
||||
return Result.error("修改失败,对象为空");
|
||||
}
|
||||
return Result.success(iSarMenuStandardNewService.updateMenuStandard(sarMenuStandardNew));
|
||||
}
|
||||
|
||||
@ApiOperation("删除标准体系菜单项")
|
||||
@DeleteMapping("/deleteMenuStandard")
|
||||
public ResponseMessage<?> deleteMenuStandard(String menuId) {
|
||||
if (StringUtils.isBlank(menuId)) {
|
||||
return Result.error("删除失败,菜单ID为空");
|
||||
}
|
||||
return Result.success(iSarMenuStandardNewService.deleteMenuStandard(menuId));
|
||||
}
|
||||
}
|
||||
|
||||
+7
@@ -22,4 +22,11 @@ public interface ISarMenuStandardNewService extends IService<SarMenuStandardNew>
|
||||
String getTopMenu(SarMenuStandardNew sarMenuStandardNew);
|
||||
|
||||
|
||||
void addMenuStandard(SarMenuStandardNew sarMenuStandardNew);
|
||||
|
||||
Integer updateMenuStandard(SarMenuStandardNew sarMenuStandardNew);
|
||||
|
||||
Integer deleteMenuStandard(String menuId);
|
||||
|
||||
SarMenuStandard getMenuStandardById(String menuId);
|
||||
}
|
||||
|
||||
+73
-4
@@ -3,18 +3,21 @@ package com.adc.da.slrs.sarMenuStandard.service.impl;
|
||||
import com.adc.da.slrs.sarMenuStandard.dao.SarMenuStandardNewDao;
|
||||
import com.adc.da.slrs.sarMenuStandard.entity.SarMenuStandardNew;
|
||||
import com.adc.da.slrs.sarMenuStandard.service.ISarMenuStandardNewService;
|
||||
import com.adc.da.slrs.sarResource.dao.TsResourceDao;
|
||||
import com.adc.da.slrs.sarRole.dao.TsRoleDao;
|
||||
import com.adc.da.sys.sarMenuStandard.dao.SarMenuStandardDao;
|
||||
import com.adc.da.sys.sarMenuStandard.entity.SarMenuStandard;
|
||||
import com.adc.da.util.LoginUserUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import javax.annotation.Resource;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@@ -30,6 +33,10 @@ public class SarMenuStandardNewServiceNewImpl extends ServiceImpl<SarMenuStandar
|
||||
|
||||
@Autowired
|
||||
private SarMenuStandardDao dao;
|
||||
@Resource
|
||||
private TsRoleDao tsRoleDao;
|
||||
@Resource
|
||||
private TsResourceDao resourceDao;
|
||||
|
||||
|
||||
@Override
|
||||
@@ -63,6 +70,66 @@ public class SarMenuStandardNewServiceNewImpl extends ServiceImpl<SarMenuStandar
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addMenuStandard(SarMenuStandardNew sarMenuStandardNew) {
|
||||
SarMenuStandard sarMenuStandard = new SarMenuStandard();
|
||||
BeanUtils.copyProperties(sarMenuStandardNew,sarMenuStandard);
|
||||
String parentId = sarMenuStandardNew.getParentId();
|
||||
if (StringUtils.isNotBlank(parentId)) {
|
||||
SarMenuStandard sarMenuStandard1 = dao.selectById(parentId);
|
||||
if (StringUtils.isNotBlank(sarMenuStandard1.getParentIds())) {
|
||||
sarMenuStandard.setParentIds(sarMenuStandard1.getParentIds() + "," + parentId);
|
||||
} else {
|
||||
sarMenuStandard.setParentIds(parentId);
|
||||
}
|
||||
}
|
||||
sarMenuStandard.setCreationTime(new Date());
|
||||
sarMenuStandard.setModifyTime(new Date());
|
||||
sarMenuStandard.setValidFlag(0);
|
||||
sarMenuStandard.setDicId("9m4qqqaansxmox5e82zm");
|
||||
dao.insert(sarMenuStandard);
|
||||
List<String> roleIdList = tsRoleDao.getRoleByUserId(LoginUserUtil.getUserId());
|
||||
for (String roleId : roleIdList) {
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
map.put("resourceId",sarMenuStandard.getId());
|
||||
map.put("roleId",roleId);
|
||||
resourceDao.insertTsRoleResource(map);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public SarMenuStandard getMenuStandardById(String menuId) {
|
||||
SarMenuStandard sarMenuStandard = dao.selectById(menuId);
|
||||
if(sarMenuStandard != null && StringUtils.isNotBlank(sarMenuStandard.getParentIds())){
|
||||
LambdaQueryWrapper<SarMenuStandard> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.in(SarMenuStandard::getId,Arrays.asList(sarMenuStandard.getParentIds().split(",")));
|
||||
List<SarMenuStandard> menuStandards = dao.selectList(wrapper);
|
||||
if(!menuStandards.isEmpty()){
|
||||
String parentIdsName = menuStandards.stream().map(SarMenuStandard::getMenuName).collect(Collectors.joining(","));
|
||||
sarMenuStandard.setParentIdsName(parentIdsName);
|
||||
}
|
||||
}
|
||||
return sarMenuStandard;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer updateMenuStandard(SarMenuStandardNew sarMenuStandardNew) {
|
||||
SarMenuStandard menuStandarddb = dao.selectById(sarMenuStandardNew.getId());
|
||||
menuStandarddb.setMenuName(sarMenuStandardNew.getMenuName());
|
||||
menuStandarddb.setDisplaySeq(sarMenuStandardNew.getDisplaySeq());
|
||||
menuStandarddb.setRemarks(sarMenuStandardNew.getRemarks());
|
||||
menuStandarddb.setModifyTime(new Date());
|
||||
return dao.updateById(menuStandarddb);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer deleteMenuStandard(String menuId) {
|
||||
SarMenuStandard menuStandard = new SarMenuStandard();
|
||||
menuStandard.setId(menuId);
|
||||
menuStandard.setValidFlag(1);
|
||||
return dao.updateById(menuStandard);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询有权限菜单
|
||||
* @param sarMenuStandardNew
|
||||
@@ -82,6 +149,7 @@ public class SarMenuStandardNewServiceNewImpl extends ServiceImpl<SarMenuStandar
|
||||
if(access!=null && !access.isEmpty()){
|
||||
queryWrapper.in(null!=access && !access.isEmpty(),"ID",access);
|
||||
}
|
||||
queryWrapper.eq("VALID_FLAG",0);
|
||||
queryWrapper.isNull("PARENT_ID");
|
||||
queryWrapper.orderByAsc("DISPLAY_SEQ");
|
||||
TsResources=dao.selectList(queryWrapper);
|
||||
@@ -93,6 +161,7 @@ public class SarMenuStandardNewServiceNewImpl extends ServiceImpl<SarMenuStandar
|
||||
if(access!=null && !access.isEmpty()){
|
||||
TsResourceQueryWrapper.in(null!=access && !access.isEmpty(),"ID",access);
|
||||
}
|
||||
TsResourceQueryWrapper.eq("VALID_FLAG",0);
|
||||
TsResourceQueryWrapper.orderByAsc("DISPLAY_SEQ");
|
||||
List<SarMenuStandard> children=dao.selectList(TsResourceQueryWrapper);
|
||||
resource.setChildren(recursionGetListChildrenStand((resource),(children)));
|
||||
|
||||
@@ -3,8 +3,10 @@ package com.adc.da.slrs.tsDictionaryType.dao;
|
||||
import com.adc.da.slrs.tsDictionaryType.entity.TsDicType;
|
||||
import com.adc.da.slrs.tsDictionaryType.entity.TsSearchMenu;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.MapKey;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -16,4 +18,8 @@ import java.util.List;
|
||||
*/
|
||||
public interface TsDicTypeDao extends BaseMapper<TsDicType> {
|
||||
public List<TsSearchMenu> getSearchMenu();
|
||||
|
||||
String selectDicTypeNameByDicCode(String typeCode);
|
||||
|
||||
List<TsDicType> selectAllDicTypeNameByDicCode(String dicCode);
|
||||
}
|
||||
|
||||
+15
@@ -5,6 +5,7 @@ import com.adc.da.slrs.tsDictionaryType.entity.TsSearchMenu;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -18,4 +19,18 @@ public interface ITsDicTypeService extends IService<TsDicType> {
|
||||
|
||||
public List<TsSearchMenu> getSearchMenu();
|
||||
|
||||
/**
|
||||
* 根据数据字典编码查询字典值
|
||||
* @param typeCode 字典编码
|
||||
* @return 字典值
|
||||
*/
|
||||
public String getDicTypeNameByDicCode(String typeCode);
|
||||
|
||||
/**
|
||||
* 根据字典值类别查询指定类别的所有类别名
|
||||
* @param dicCode 字典类别编号
|
||||
* @return 字典值列表
|
||||
*/
|
||||
List<TsDicType> selectAllDicTypeNameByDicCode(String dicCode);
|
||||
|
||||
}
|
||||
|
||||
+11
@@ -9,6 +9,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -25,4 +26,14 @@ public class TsDicTypeServiceImpl extends ServiceImpl<TsDicTypeDao, TsDicType> i
|
||||
public List<TsSearchMenu> getSearchMenu() {
|
||||
return getBaseMapper().getSearchMenu();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDicTypeNameByDicCode(String typeCode) {
|
||||
return this.baseMapper.selectDicTypeNameByDicCode(typeCode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TsDicType> selectAllDicTypeNameByDicCode(String dicCode) {
|
||||
return this.baseMapper.selectAllDicTypeNameByDicCode(dicCode);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,112 @@
|
||||
package com.adc.da.utils.util;
|
||||
|
||||
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
||||
import com.adc.da.slrs.processModel.utils.TrainFormDate;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
||||
import org.apache.poi.ss.usermodel.*;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author tjzdw
|
||||
* @description
|
||||
* @date 2023/10/28
|
||||
*/
|
||||
@Slf4j
|
||||
public class ExcelExportUtil {
|
||||
|
||||
private ExcelExportUtil() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出Excel文件
|
||||
* @param params 导出参数,主要包含,导出的文件名,导出类型
|
||||
* @param tClass 导出文件的对象类
|
||||
* @param datas 数据
|
||||
* @return 工作簿
|
||||
*/
|
||||
public static Workbook exportWithData(ExportParams params, Class<?> tClass , List<?> datas) {
|
||||
Workbook wb = null;
|
||||
|
||||
if (params.getType().equals(ExcelType.XSSF)) {
|
||||
wb = new XSSFWorkbook();
|
||||
} else {
|
||||
wb = new HSSFWorkbook();
|
||||
}
|
||||
|
||||
// 第二步,在workbook中添加一个sheet,对应Excel文件中的sheet
|
||||
Sheet sheet = wb.createSheet(params.getSheetName());
|
||||
|
||||
// 第三步,在sheet中添加表头第0行,注意老版本poi对Excel的行数列数有限制
|
||||
Row row = sheet.createRow(0);
|
||||
|
||||
// 第四步,创建单元格,并设置值表头 设置表头居中
|
||||
CellStyle style = wb.createCellStyle();
|
||||
style.setAlignment(HorizontalAlignment.CENTER);
|
||||
//声明列对象
|
||||
Cell cell = null;
|
||||
Map<Integer, Excel> map = new HashMap<>();
|
||||
Map<Integer, Field> mapField = new HashMap<>();
|
||||
Field[] fields = tClass.getDeclaredFields();
|
||||
for (Field field : fields) {
|
||||
field.setAccessible(true);
|
||||
Excel excel = field.getAnnotation(Excel.class);
|
||||
if (null != excel) {
|
||||
map.put(Integer.valueOf(excel.orderNum()), excel);
|
||||
mapField.put(Integer.valueOf(excel.orderNum()), field);
|
||||
}
|
||||
}
|
||||
//创建标题行
|
||||
DataFormat df = wb.createDataFormat();
|
||||
for (Integer i : map.keySet()) {
|
||||
sheet.setColumnWidth(i, (int) (map.get(i).width() * 256));
|
||||
cell = row.createCell(i);
|
||||
cell.setCellValue(map.get(i).name());
|
||||
if (null != map.get(i).exportFormat()) {
|
||||
CellStyle style1 = wb.createCellStyle();
|
||||
style1.setAlignment(HorizontalAlignment.CENTER); // 创建一个居中格式
|
||||
style1.setDataFormat(df.getFormat(map.get(i).exportFormat()));
|
||||
sheet.setDefaultColumnStyle(i, style1);
|
||||
}
|
||||
cell.setCellStyle(style);
|
||||
}
|
||||
//赋值数据
|
||||
int rowNum = 1;
|
||||
for (Object o : datas) {
|
||||
Row row1 = sheet.createRow(rowNum);
|
||||
for (Integer i : map.keySet()) {
|
||||
Cell cell1 = row1.createCell(i);
|
||||
Field field = null;
|
||||
try {
|
||||
field = o.getClass().getDeclaredField(mapField.get(i).getName());
|
||||
} catch (NoSuchFieldException e) {
|
||||
log.warn(e.getMessage());
|
||||
}
|
||||
if (null != field) {
|
||||
field.setAccessible(true);
|
||||
try {
|
||||
Object fieldVal = field.get(o);
|
||||
if (null != map.get(i).exportFormat() && !"".equals(map.get(i).exportFormat())) {
|
||||
cell1.setCellValue("null".equals(String.valueOf(fieldVal)) ? "" : TrainFormDate.dealWithTimeZoneyyyy(String.valueOf(fieldVal), map.get(i).exportFormat()));
|
||||
} else {
|
||||
cell1.setCellValue("null".equals(String.valueOf(fieldVal)) ? "" : String.valueOf(fieldVal));
|
||||
}
|
||||
} catch (IllegalAccessException e) {
|
||||
log.warn(e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
System.out.println(o.toString());
|
||||
rowNum++;
|
||||
}
|
||||
return wb;
|
||||
}
|
||||
}
|
||||
@@ -58,6 +58,19 @@ public class FieldConvertUtil {
|
||||
// 企标计划 表头
|
||||
public static String exportFieldNamesEsRevisePlan = "企标类别,企标编号,企标名称,计划状态,制修订类型,起草人,内部评审责任人,技术委员会评审负责人,计划标准初稿完成时间,计划标准发布时间,起草责任单位,实际标准发布时间,质量评分";
|
||||
|
||||
// 内外部会议 表头
|
||||
public static String exportFieldNamesInsideOutsideMeeting = "会议名称,课题名称,会议主办单位,会议时间,会议地点,参会人员,会议主要内容,一级会议类别,二级会议类别";
|
||||
// 内外部会议关联表 表头
|
||||
public static String exportFieldNamesMeetingTopic = "议题名称,汇报人,汇报单位,议题主要内容";
|
||||
|
||||
// 政策法规资料 表头
|
||||
public static String exportFieldLawsInformation = "一级资料类别,二级资料类别,三级资料类别,四级资料类别,资料名称,资料归属部门,作者,资料说明";
|
||||
|
||||
// 政策课题 表头
|
||||
public static String exportFieldLawsTopic = "课题名称,课题承办单位,课题指导单位,课题参与单位,开始时间,结题时间,课题费用(万元),课题组会议列表,课题组联系方式,内部联系方式";
|
||||
// 政策课题关联表 表头
|
||||
public static String exportFieldLawsTopicRelation = "会议名称,会议时间,会议地点,参会人员(内部),会议主要内容,姓名,单位,电话,邮箱,身份,姓名,单位,电话,邮箱,身份";
|
||||
|
||||
public static String exportBaseFieldNamesBussCode = "起草部门,废止日期,代替企标编号,复审日期,起草人,被代替企标编号,采用标准,文件上传人员,采标程度,引用标准,适用车型,能源类型,适用产品线,上传时间,体系类别,备案日期,关联模块-乘用车VPPS编码,关联模块--乘用车vpps中文名称,关联模块--卡车VPPS编码,关联模块--卡车vpps中文名称";
|
||||
|
||||
public static String exportAttrFieldNamesBuss = "SVPPS,规范性引用文件,废止日期,复审日期,密级,授权,相关部门," +
|
||||
@@ -80,6 +93,19 @@ public class FieldConvertUtil {
|
||||
"7.关联模块-乘用车VPPS编码和关联模块--卡车VPPS编码是填写数据库中已有的编码从而带出乘用车VPPS名称和卡车VPPS名称\n" +
|
||||
"8.发布稿,编制说明,历史版本,其他文件,修改单,关联文件为附件文件,需要放在Excel文档同级目录中";
|
||||
|
||||
public static String exportInsideOutsideMeetingDesc ="填写说明\n" +
|
||||
"1.导入数据从第三行开始,第一行为填写说明,第二行为表头,第三行是正式数据\n" +
|
||||
"2.会议分类按照系统下拉菜单中的分类填写\n" +
|
||||
"3.会议议题如果存在多条,则在下面以此填写,新的内外部会议另起一行填写";
|
||||
|
||||
public static String exportLawsInformationDesc = "填写说明\n" +
|
||||
"1.导入数据从第三行开始,第一行为填写说明,第二行为表头,第三行是正式数据\n" +
|
||||
"2.资料分类按照系统下拉菜单中的分类填写\n";
|
||||
|
||||
public static String exportLawsTopicDesc = "填写说明\n" +
|
||||
"1.导入数据从第三行开始,第一行为填写说明,第二行为表头,第三行是正式数据\n" +
|
||||
"2.课题组会议、课题组联系方式、内部联系方式如果存在多条,则在下面一次填写,新的课题组会议、课题组联系方式、内部联系方式在下面依次填写";
|
||||
|
||||
public static String exportFieldName = "*企标类别,*企标编号,*标准年份,*企标名称,企标英文名称,*文本状态,发布日期,企标实施日期,起草部门,起草人,适用车型,能源类型,适用产品线,体系类别,关联模块-乘用车VPPS编码,关联模块--卡车VPPS编码,发布稿,编制说明,历史版本,其他文件,修改单,代替企标编号,采用标准,采标程度,引用标准,关联文件,";
|
||||
|
||||
/***
|
||||
|
||||
@@ -0,0 +1,173 @@
|
||||
package com.adc.da.utils.util;
|
||||
|
||||
import com.adc.da.slrs.InsideOntSideMeeting.entity.InsideOutsideMeetingVO;
|
||||
import com.adc.da.slrs.InsideOntSideMeeting.entity.MeetingTopic;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.poi.ss.usermodel.*;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author tjzdw
|
||||
* @description
|
||||
* @date 2023/10/20
|
||||
*/
|
||||
public class InsideOutsideMeetingExportUtil {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(InsideOutsideMeetingExportUtil.class);
|
||||
|
||||
|
||||
public static Workbook exportDatas(List<InsideOutsideMeetingVO> datas) {
|
||||
Workbook workbook = new XSSFWorkbook();
|
||||
try {
|
||||
//定义表头
|
||||
String header = FieldConvertUtil.exportFieldNamesInsideOutsideMeeting + "," + FieldConvertUtil.exportFieldNamesMeetingTopic;
|
||||
//创建工作表对象
|
||||
Sheet sheet = workbook.createSheet();
|
||||
// 创建头部
|
||||
createHeader(workbook, sheet, header);
|
||||
// 创建数据
|
||||
createDatas(workbook, sheet, datas, header);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.getMessage(), e);
|
||||
}
|
||||
return workbook;
|
||||
}
|
||||
|
||||
public static void createHeader(Workbook workbook, Sheet sheet, String header) {
|
||||
CellStyle cellStyle = workbook.createCellStyle();//初始化单元格格式对象
|
||||
cellStyle.setAlignment(HorizontalAlignment.CENTER);
|
||||
Row rowHeader = sheet.createRow(0);//开始创建标题行
|
||||
if (StringUtils.isNotBlank(header)) {
|
||||
String[] headerArr = header.split(",");
|
||||
for (int i = 0; i < headerArr.length; i++) {
|
||||
rowHeader.createCell(i).setCellValue(headerArr[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void createDatas(Workbook workbook, Sheet sheet, List<InsideOutsideMeetingVO> datas,
|
||||
String header) throws Exception {
|
||||
String[] insideOutsideMeetingHeaderList = FieldConvertUtil.exportFieldNamesInsideOutsideMeeting.split(",");
|
||||
String[] meetingTopicHeaderList = FieldConvertUtil.exportFieldNamesMeetingTopic.split(",");
|
||||
CellStyle cellStyle = workbook.createCellStyle();//初始化单元格格式对象
|
||||
cellStyle.setAlignment(HorizontalAlignment.CENTER);
|
||||
if (datas != null && !datas.isEmpty()) {
|
||||
int rowIndex = 1;
|
||||
for (InsideOutsideMeetingVO data : datas) {
|
||||
String[] headerArr = header.split(",");
|
||||
Row row = sheet.createRow(rowIndex);
|
||||
int cellIndex = 0;
|
||||
if (data.getMeetingTopicList().isEmpty()) {
|
||||
for (String headerName : headerArr) {
|
||||
String value = getValueByName(headerName, data);
|
||||
if (StringUtils.isBlank(value) || "null".equals(value)) {
|
||||
value = "";
|
||||
}
|
||||
row.createCell(cellIndex).setCellValue(value);
|
||||
cellIndex++;
|
||||
}
|
||||
} else {
|
||||
for (String headerName : insideOutsideMeetingHeaderList) {
|
||||
String value = getValueByName(headerName, data);
|
||||
if (StringUtils.isBlank(value) || "null".equals(value)) {
|
||||
value = "";
|
||||
}
|
||||
row.createCell(cellIndex).setCellValue(value);
|
||||
cellIndex++;
|
||||
}
|
||||
int newCellIndex = cellIndex;
|
||||
for (String field : meetingTopicHeaderList) {
|
||||
String topicValue = getMeetingTopicValueByName(field, data.getMeetingTopicList().get(0));
|
||||
if (StringUtils.isBlank(topicValue) || "null".equals(topicValue)) {
|
||||
topicValue = "";
|
||||
}
|
||||
row.createCell(cellIndex).setCellValue(topicValue);
|
||||
cellIndex++;
|
||||
}
|
||||
rowIndex++;
|
||||
for (int index = 1; index < data.getMeetingTopicList().size(); index++) {
|
||||
Row newRow = sheet.createRow(rowIndex);
|
||||
for (String field : meetingTopicHeaderList) {
|
||||
String topicValue = getMeetingTopicValueByName(field, data.getMeetingTopicList().get(index));
|
||||
if (StringUtils.isBlank(topicValue) || "null".equals(topicValue)) {
|
||||
topicValue = "";
|
||||
}
|
||||
newRow.createCell(newCellIndex).setCellValue(topicValue);
|
||||
newCellIndex++;
|
||||
}
|
||||
rowIndex++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 根据表头返回相应值
|
||||
public static String getValueByName(String name, InsideOutsideMeetingVO insideOutsideMeeting) throws Exception{
|
||||
String value = "";
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
switch (name) {
|
||||
case "会议名称":
|
||||
value = insideOutsideMeeting.getMeetingName();
|
||||
break;
|
||||
case "课题名称":
|
||||
value = insideOutsideMeeting.getTopicName();
|
||||
break;
|
||||
case "会议主办单位":
|
||||
value = insideOutsideMeeting.getMeetingOrganizer();
|
||||
break;
|
||||
case "会议时间":
|
||||
String meetingTime = null;
|
||||
if (insideOutsideMeeting.getMeetingTime() != null){
|
||||
meetingTime = sdf.format(insideOutsideMeeting.getMeetingTime());
|
||||
}
|
||||
value = meetingTime;
|
||||
break;
|
||||
case "会议地点":
|
||||
value = insideOutsideMeeting.getMeetingAddress();
|
||||
break;
|
||||
case "参会人员":
|
||||
value = insideOutsideMeeting.getParticipants();
|
||||
break;
|
||||
case "会议主要内容":
|
||||
value = insideOutsideMeeting.getMeetingContent();
|
||||
break;
|
||||
case "一级会议类别":
|
||||
value = insideOutsideMeeting.getFirstMeetingTypeName();
|
||||
break;
|
||||
case "二级会议类别":
|
||||
value = insideOutsideMeeting.getSecondMeetingTypeName();
|
||||
break;
|
||||
default:
|
||||
value = null;
|
||||
break;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
public static String getMeetingTopicValueByName (String name, MeetingTopic meetingTopic) {
|
||||
String value = "";
|
||||
switch (name) {
|
||||
case "议题名称":
|
||||
value = meetingTopic.getAgendaName();
|
||||
break;
|
||||
case "汇报人":
|
||||
value = meetingTopic.getReporter();
|
||||
break;
|
||||
case "汇报单位":
|
||||
value = meetingTopic.getReportingUnit();
|
||||
break;
|
||||
case "议题主要内容":
|
||||
value = meetingTopic.getAgendaContent();
|
||||
break;
|
||||
default:
|
||||
value = null;
|
||||
break;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
}
|
||||
+130
@@ -0,0 +1,130 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.adc.da.slrs.InsideOntSideMeeting.dao.InsideOutsideMeetingDao">
|
||||
<resultMap id="BaseResultMap" type="com.adc.da.slrs.InsideOntSideMeeting.entity.InsideOutsideMeetingVO" >
|
||||
<id column="id" property="id" />
|
||||
<result column="MEETING_NAME" property="meetingName" />
|
||||
<result column="TOPIC_NAME" property="topicName" />
|
||||
<result column="MEETING_ORGANIZER" property="meetingOrganizer" />
|
||||
<result column="MEETING_TIME" property="meetingTime" />
|
||||
<result column="MEETING_ADDRESS" property="meetingAddress" />
|
||||
<result column="PARTICIPANTS" property="participants" />
|
||||
<result column="MEETING_MINUTES" property="meetingMinutes" />
|
||||
<result column="MEETING_CONTENT" property="meetingContent" />
|
||||
<result column="FIRST_MEETING_TYPE" property="firstMeetingType" />
|
||||
<result column="SECOND_MEETING_TYPE" property="secondMeetingType" />
|
||||
<result column="VALID_FLAG" property="validFlag" />
|
||||
<result column="CREATE_TIME" property="createTime" />
|
||||
<result column="MODIFY_TIME" property="modifyTime" />
|
||||
<collection property="meetingTopicList" ofType="com.adc.da.slrs.InsideOntSideMeeting.entity.MeetingTopic">
|
||||
<id column="mtId" property="id" />
|
||||
<result column="MEETING_ID" property="meetingId" />
|
||||
<result column="AGENDA_NAME" property="agendaName" />
|
||||
<result column="AGENDA_MATERIALS" property="agendaMaterials" />
|
||||
<result column="REPORTER" property="reporter" />
|
||||
<result column="REPORTING_UNIT" property="reportingUnit" />
|
||||
<result column="AGENDA_CONTENT" property="agendaContent" />
|
||||
</collection>
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
ID,MEETING_NAME,TOPIC_NAME,MEETING_ORGANIZER,MEETING_TIME,MEETING_ADDRESS,
|
||||
PARTICIPANTS,MEETING_MINUTES,MEETING_CONTENT,FIRST_MEETING_TYPE,SECOND_MEETING_TYPE,VALID_FLAG,CREATE_TIME,MODIFY_TIME
|
||||
</sql>
|
||||
<sql id="Base_Column_Join_MeetingTopic_List">
|
||||
iom.ID,iom.MEETING_NAME,iom.TOPIC_NAME,iom.MEETING_ORGANIZER,iom.MEETING_TIME,iom.MEETING_ADDRESS,
|
||||
iom.PARTICIPANTS,iom.MEETING_MINUTES,iom.MEETING_CONTENT,iom.FIRST_MEETING_TYPE,iom.SECOND_MEETING_TYPE,
|
||||
mt.ID as mtId,mt.MEETING_ID,mt.AGENDA_NAME,mt.AGENDA_MATERIALS,mt.REPORTER,mt.REPORTING_UNIT,
|
||||
mt.AGENDA_CONTENT,
|
||||
iom.VALID_FLAG,iom.CREATE_TIME,iom.MODIFY_TIME
|
||||
</sql>
|
||||
<sql id="Base_Where_Clause">
|
||||
<trim suffixOverrides="," >
|
||||
<if test="meetingName != null and meetingName !=''">
|
||||
and MEETING_NAME like concat('%',#{meetingName},'%')
|
||||
</if>
|
||||
<if test="topicName != null and topicName !=''">
|
||||
and TOPIC_NAME = #{topicName}
|
||||
</if>
|
||||
<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>
|
||||
<if test="meetingAddress != null and meetingAddress != ''" >
|
||||
and MEETING_ADDRESS like concat('%',#{meetingAddress},'%')
|
||||
</if>
|
||||
<if test="participantsList != null and participantsList.size() > 0" >
|
||||
and PARTICIPANTS in
|
||||
<foreach collection="participantsList" separator="," open="(" close=")" item="participant">
|
||||
#{participant}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="meetingContent != null" >
|
||||
and MEETING_CONTENT like concat('%',#{meetingContent},'%')
|
||||
</if>
|
||||
<if test="firstMeetingType != null and firstMeetingType != ''" >
|
||||
and FIRST_MEETING_TYPE = #{firstMeetingType}
|
||||
</if>
|
||||
<if test="secondMeetingType != null and secondMeetingType != ''" >
|
||||
and SECOND_MEETING_TYPE = #{secondMeetingType}
|
||||
</if>
|
||||
</trim>
|
||||
</sql>
|
||||
<sql id="MeetingTopic_where">
|
||||
<if test="agendaName != null and agendaName != ''">
|
||||
and mt.AGENDA_NAME like concat('%',#{agendaName},'%')
|
||||
</if>
|
||||
<if test="reporter != null and reporter != ''">
|
||||
and mt.REPORTER like concat('%',#{reporter},'%')
|
||||
</if>
|
||||
<if test="reportingUnit != null and reportingUnit != ''">
|
||||
and mt.REPORTING_UNIT like concat('%',#{reportingUnit},'%')
|
||||
</if>
|
||||
<if test="agendaContent != null and agendaContent != ''">
|
||||
and mt.AGENDA_CONTENT like concat('%',#{agendaContent},'%')
|
||||
</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
|
||||
where iom.VALID_FLAG = 0
|
||||
<include refid="Base_Where_Clause"/>
|
||||
<include refid="MeetingTopic_where" />
|
||||
</select>
|
||||
<select id="queryByPage" resultMap="BaseResultMap" parameterType="com.adc.da.slrs.InsideOntSideMeeting.entity.InsideOutsideMeetingVO">
|
||||
select <include refid="Base_Column_Join_MeetingTopic_List" />
|
||||
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" />
|
||||
order by
|
||||
<choose>
|
||||
<when test="sortField == 'AGENDA_NAME'">
|
||||
mt.${sortField} ${sortMode}
|
||||
</when>
|
||||
<otherwise>
|
||||
iom.${sortField} ${sortMode}
|
||||
</otherwise>
|
||||
</choose>
|
||||
limit ${pager.startIndex-1},${pageSize}
|
||||
</select>
|
||||
<select id="queryMeetingById" resultMap="BaseResultMap">
|
||||
select <include refid="Base_Column_Join_MeetingTopic_List" />
|
||||
from inside_outside_meeting iom join meeting_topic mt on iom.ID = mt.MEETING_ID
|
||||
where iom.VALID_FLAG = 0 and iom.ID in
|
||||
<foreach collection="exportIdList" item="id" open="(" close=")" separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
order by iom.MEETING_NAME
|
||||
</select>
|
||||
<select id="queryAllMeeting" resultMap="BaseResultMap">
|
||||
select <include refid="Base_Column_Join_MeetingTopic_List" />
|
||||
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" />
|
||||
order by iom.MEETING_NAME
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -70,6 +70,7 @@
|
||||
<result property="area" column="area"></result>
|
||||
<result property="rqbJson" column="rqb_json"></result>
|
||||
<result property="tsJson" column="ts_json"></result>
|
||||
<result property="score" column="score" />
|
||||
<result property="esMatingRelations" column="es_mating_relations"/>
|
||||
<result property="esStandRelations" column="es_stand_relations"/>
|
||||
<result property="isRelate" column="is_relate"/>
|
||||
@@ -147,6 +148,7 @@
|
||||
es_revise_plan.technologic,
|
||||
es_revise_plan.buss_sort,
|
||||
es_revise_plan.LXD,
|
||||
es_revise_plan.score,
|
||||
sar_bussioness_stand.STAND_CODE as rqbName,
|
||||
sar_bussioness_stand.STAND_SORT as standType,
|
||||
(select group_concat(ts_institution.name order by ts_institution.name) from ts_institution where find_in_set(ts_institution.id,unit) ORDER BY find_in_set(ts_institution.id,unit)) as unitName,
|
||||
@@ -219,6 +221,7 @@
|
||||
es_revise_plan.technologic,
|
||||
es_revise_plan.buss_sort,
|
||||
es_revise_plan.LXD,
|
||||
es_revise_plan.score,
|
||||
sar_bussioness_stand.STAND_CODE as rqbName,
|
||||
sar_bussioness_stand.STAND_SORT as standType,
|
||||
sar_bussioness_stand.stand_number as standNum,
|
||||
@@ -301,6 +304,7 @@
|
||||
es_revise_plan.technologic,
|
||||
es_revise_plan.buss_sort,
|
||||
es_revise_plan.LXD,
|
||||
es_revise_plan.score,
|
||||
sar_bussioness_stand.STAND_CODE as rqbName,
|
||||
sar_bussioness_stand.STAND_SORT as standType,
|
||||
(select group_concat(ts_institution.name order by ts_institution.name) from ts_institution where find_in_set(ts_institution.id,unit) ORDER BY find_in_set(ts_institution.id,unit)) as unitName,
|
||||
@@ -544,6 +548,7 @@
|
||||
es_revise_plan.technologic,
|
||||
es_revise_plan.buss_sort,
|
||||
es_revise_plan.LXD,
|
||||
es_revise_plan.score,
|
||||
sar_bussioness_stand.STAND_CODE as rqbName,
|
||||
sar_bussioness_stand.STAND_SORT as standType,
|
||||
(select group_concat(ts_institution.name order by ts_institution.name) from ts_institution where find_in_set(ts_institution.id,unit) ORDER BY find_in_set(ts_institution.id,unit)) as unitName,
|
||||
|
||||
+10
@@ -124,4 +124,14 @@
|
||||
and process_node = '标准法规部高级经理审核'
|
||||
group by user_id
|
||||
</select>
|
||||
<select id="selectDTPJ" resultType="java.lang.Integer">
|
||||
select
|
||||
count(1)
|
||||
from
|
||||
quality_evaluation
|
||||
where
|
||||
law_id = #{lawId}
|
||||
and process_node = '动态评价'
|
||||
group by user_id;
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
+4
-2
@@ -47,8 +47,9 @@
|
||||
<select id="selectPreviousInstitution" resultMap="TsUser">
|
||||
select * from ts_user
|
||||
<where>
|
||||
STATE = '1' and VALID_FLAG = '0' and DISABLE_FLAG = '0'
|
||||
<if test="userName != null and userName != '' ">
|
||||
( ts_user.ACCOUNT like concat(concat('%',#{userName}),'%') or ts_user.UNAME like concat(concat('%',#{userName}),'%') )
|
||||
and ( ts_user.ACCOUNT like concat(concat('%',#{userName}),'%') or ts_user.UNAME like concat(concat('%',#{userName}),'%') )
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
@@ -96,7 +97,8 @@
|
||||
from ts_user
|
||||
left join ts_institution ON ts_institution.id = (SELECT parent_id from ts_institution WHERE id = ts_user.INSTITUTION_ID)
|
||||
left join ts_institution t2 on t2.id=ts_user.INSTITUTION_ID
|
||||
WHERE institution_id=#{institutionId}
|
||||
WHERE ts_user.STATE = '1' and ts_user.VALID_FLAG = '0' and ts_user.DISABLE_FLAG = '0'
|
||||
and institution_id=#{institutionId}
|
||||
<if test="userName != null and userName != '' ">
|
||||
and ( ts_user.ACCOUNT like concat(concat('%',#{userName}),'%') or ts_user.UNAME like concat(concat('%',#{userName}),'%') )
|
||||
</if>
|
||||
|
||||
+82
@@ -0,0 +1,82 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.adc.da.slrs.sarLawsInformation.dao.SarLawsInformationDao">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.adc.da.slrs.sarLawsInformation.entity.SarLawsInformation">
|
||||
<id property="id" column="ID" jdbcType="VARCHAR"/>
|
||||
<result property="firstType" column="FIRST_TYPE" jdbcType="VARCHAR"/>
|
||||
<result property="firstTypeName" column="firstTypeName" jdbcType="VARCHAR"/>
|
||||
<result property="secondType" column="SECOND_TYPE" jdbcType="VARCHAR"/>
|
||||
<result property="secondTypeName" column="secondTypeName" jdbcType="VARCHAR"/>
|
||||
<result property="thirdType" column="THIRD_TYPE" jdbcType="VARCHAR"/>
|
||||
<result property="thirdTypeName" column="thirdTypeName" jdbcType="VARCHAR"/>
|
||||
<result property="fourthType" column="FOURTH_TYPE" jdbcType="VARCHAR"/>
|
||||
<result property="fourthTypeName" column="fourthTypeName" jdbcType="VARCHAR"/>
|
||||
<result property="name" column="NAME" jdbcType="VARCHAR"/>
|
||||
<result property="department" column="DEPARTMENT" jdbcType="VARCHAR"/>
|
||||
<result property="author" column="AUTHOR" jdbcType="VARCHAR"/>
|
||||
<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="createTime" column="CREATE_TIME" jdbcType="TIMESTAMP"/>
|
||||
<result property="modifyTime" column="MODIFY_TIME" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
ID,
|
||||
FIRST_TYPE,
|
||||
SECOND_TYPE,
|
||||
THIRD_TYPE,
|
||||
FOURTH_TYPE,
|
||||
`NAME`,
|
||||
DEPARTMENT,AUTHOR,UPLOAD_TIME,
|
||||
`DESCRIPTION`,INFORMATION_FILE,VIEWABLE_BY,
|
||||
DOWNLOADABLE_BY,VALID_FLAG,CREATE_TIME,
|
||||
MODIFY_TIME
|
||||
</sql>
|
||||
<sql id="Base_Where_Clause">
|
||||
<if test="firstType != null and firstType != ''">
|
||||
and FIRST_TYPE like concat('%',#{firstType},'%')
|
||||
</if>
|
||||
<if test="secondType != null and secondType != ''">
|
||||
and SECOND_TYPE like concat('%',#{secondType},'%')
|
||||
</if>
|
||||
<if test="name != null and name != ''">
|
||||
and `NAME` like concat('%',#{name},'%')
|
||||
</if>
|
||||
<if test="uploadTime != null">
|
||||
and UPLOAD_TIME = #{uploadTime}
|
||||
</if>
|
||||
<if test="treeNodeId != null and treeNodeId != ''">
|
||||
and TREE_NODE_ID = #{treeNodeId}
|
||||
</if>
|
||||
</sql>
|
||||
<select id="queryByPageCount" resultType="java.lang.Integer">
|
||||
select count(1)
|
||||
from sar_laws_information
|
||||
where VALID_FLAG = 0
|
||||
<include refid="Base_Where_Clause" />
|
||||
</select>
|
||||
<select id="queryByPage" resultType="com.adc.da.slrs.sarLawsInformation.entity.SarLawsInformation">
|
||||
select <include refid="Base_Column_List" />
|
||||
from sar_laws_information
|
||||
where VALID_FLAG = 0
|
||||
<include refid="Base_Where_Clause" />
|
||||
order by ${sortField} ${sortMode}
|
||||
limit ${pager.startIndex-1},${pageSize}
|
||||
</select>
|
||||
<select id="getAllLawsInformation"
|
||||
resultType="com.adc.da.slrs.sarLawsInformation.entity.SarLawsInformation">
|
||||
select <include refid="Base_Column_List" />
|
||||
from sar_laws_information
|
||||
where VALID_FLAG = 0
|
||||
<include refid="Base_Where_Clause" />
|
||||
order by ID asc
|
||||
</select>
|
||||
</mapper>
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.adc.da.slrs.sarLawsInformationCenterTree.dao.SarLawsInformationCenterTreeDao">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.adc.da.slrs.sarLawsInformationCenterTree.entity.SarLawsInformationCenterTree">
|
||||
<result property="id" column="id" jdbcType="VARCHAR"/>
|
||||
<result property="parentId" column="parent_id" jdbcType="VARCHAR"/>
|
||||
<result property="name" column="name" jdbcType="VARCHAR"/>
|
||||
<result property="sort" column="sort" jdbcType="INTEGER"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,parent_id,`name`,
|
||||
sort
|
||||
</sql>
|
||||
</mapper>
|
||||
+94
-9
@@ -91,8 +91,17 @@
|
||||
<if test='syncParam != null and syncParam == "sync"'>
|
||||
and SAR_LAWS_STAND_INFO.MODIFY_TIME between DATE_SUB(NOW(),INTERVAL 7 day) and DATE_SUB(NOW(),INTERVAL -1 day)
|
||||
</if>
|
||||
<if test="lawsType != null and lawsType != ''">
|
||||
and SAR_LAWS_STAND_INFO.LAWS_TYPE like concat(concat('%',#{lawsType}),'%')
|
||||
<if test="lawsTypeFirstLevel != null and lawsTypeFirstLevel != ''">
|
||||
and SAR_LAWS_STAND_INFO.LAWS_TYPE_FIRST_LEVEL = #{lawsTypeFirstLevel}
|
||||
</if>
|
||||
<if test="lawsTypeSecondLevel != null and lawsTypeSecondLevel != ''">
|
||||
and SAR_LAWS_STAND_INFO.LAWS_TYPE_SECOND_LEVEL = #{lawsTypeSecondLevel}
|
||||
</if>
|
||||
<if test="lawsTypeThirdLevel != null and lawsTypeThirdLevel != ''">
|
||||
and SAR_LAWS_STAND_INFO.LAWS_TYPE_THIRD_LEVEL = #{lawsTypeThirdLevel}
|
||||
</if>
|
||||
<if test="lawsTypeFourthLevel != null and lawsTypeFourthLevel != ''">
|
||||
and SAR_LAWS_STAND_INFO.LAWS_TYPE_FOURTH_LEVEL = #{lawsTypeFourthLevel}
|
||||
</if>
|
||||
<if test="lawsNumber != null and lawsNumber != ''">
|
||||
and SAR_LAWS_STAND_INFO.LAWS_NUMBER like concat(concat('%',#{lawsNumber}),'%')
|
||||
@@ -129,8 +138,12 @@
|
||||
<if test="lawsSyqy != null and lawsSyqy != ''">
|
||||
and FIND_IN_SET(#{lawsSyqy},SAR_LAWS_STAND_INFO.LAWS_SYQY)
|
||||
</if>
|
||||
<if test="lawsSycx != null and lawsSycx != ''">
|
||||
and FIND_IN_SET(#{lawsSycx},SAR_LAWS_STAND_INFO.LAWS_SYCX)
|
||||
<if test="lawsSycxArray != null and lawsSycxArray.length > 0">
|
||||
and (
|
||||
<foreach collection="lawsSycxArray" item="eachSycx" separator="or">
|
||||
FIND_IN_SET(#{eachSycx},SAR_LAWS_STAND_INFO.LAWS_SYCX)
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
<if test="isRelateAccess != null and isRelateAccess != ''">
|
||||
and SAR_LAWS_STAND_INFO.IS_RELATE_ACCESS = #{isRelateAccess}
|
||||
@@ -189,6 +202,57 @@
|
||||
<if test="advanceSearchStr != null and advanceSearchStr != ''">
|
||||
and (${advanceSearchStr})
|
||||
</if>
|
||||
<if test="SSRQLAWS != null and SSRQLAWS != ''">
|
||||
and DATE_FORMAT(SAR_LAWS_ATTR_INFO.SSRQLAWS ,'%Y-%m-%d') = DATE_FORMAT(#{SSRQLAWS},'%Y-%m-%d')
|
||||
</if>
|
||||
<if test="XCXSSRQLAWS != null and XCXSSRQLAWS != ''">
|
||||
and DATE_FORMAT(SAR_LAWS_ATTR_INFO.XCXSSRQLAWS ,'%Y-%m-%d') = DATE_FORMAT(#{XCXSSRQLAWS},'%Y-%m-%d')
|
||||
</if>
|
||||
<if test="ZCXSSRQLAWS != null and ZCXSSRQLAWS != ''">
|
||||
and DATE_FORMAT(SAR_LAWS_ATTR_INFO.ZCXSSRQLAWS ,'%Y-%m-%d') = DATE_FORMAT(#{ZCXSSRQLAWS},'%Y-%m-%d')
|
||||
</if>
|
||||
<if test="XRZSSRQLAWS != null and XRZSSRQLAWS != ''">
|
||||
and DATE_FORMAT(SAR_LAWS_ATTR_INFO.XRZSSRQLAWS ,'%Y-%m-%d') = DATE_FORMAT(#{XRZSSRQLAWS},'%Y-%m-%d')
|
||||
</if>
|
||||
<if test="SXRQLAWS != null and SXRQLAWS != ''">
|
||||
and DATE_FORMAT(SAR_LAWS_ATTR_INFO.SXRQLAWS ,'%Y-%m-%d') = DATE_FORMAT(#{SXRQLAWS},'%Y-%m-%d')
|
||||
</if>
|
||||
<if test="CYSDLAWS != null and CYSDLAWS != ''">
|
||||
and SAR_LAWS_ATTR_INFO.CYSDLAWS = #{CYSDLAWS}
|
||||
</if>
|
||||
<if test="CYSDLAWS != null and CYSDLAWS != ''">
|
||||
and SAR_LAWS_ATTR_INFO.CYSDLAWS = #{CYSDLAWS}
|
||||
</if>
|
||||
<if test="TGRLAWS != null and TGRLAWS != ''">
|
||||
and SAR_LAWS_ATTR_INFO.TGRLAWS = #{TGRLAWS}
|
||||
</if>
|
||||
<if test="TGDWLAWS != null and TGDWLAWS != ''">
|
||||
and SAR_LAWS_ATTR_INFO.TGDWLAWS = #{TGDWLAWS}
|
||||
</if>
|
||||
<if test="SYRZLAWS != null and SYRZLAWS != ''">
|
||||
and SAR_LAWS_ATTR_INFO.SYRZLAWS = #{SYRZLAWS}
|
||||
</if>
|
||||
<if test="ZRBMLAWS != null and ZRBMLAWS != ''">
|
||||
and SAR_LAWS_ATTR_INFO.ZRBMLAWS = #{ZRBMLAWS}
|
||||
</if>
|
||||
<if test="ZRGCSLAWS != null and ZRGCSLAWS != ''">
|
||||
and SAR_LAWS_ATTR_INFO.ZRGCSLAWS = #{ZRGCSLAWS}
|
||||
</if>
|
||||
<if test="DTWJHLAWS != null and DTWJHLAWS != ''">
|
||||
and SAR_LAWS_ATTR_INFO.DTWJHLAWS = #{DTWJHLAWS}
|
||||
</if>
|
||||
<if test="BDTWJHLAWS != null and BDTWJHLAWS != ''">
|
||||
and SAR_LAWS_ATTR_INFO.BDTWJHLAWS = #{BDTWJHLAWS}
|
||||
</if>
|
||||
<if test="YYBZZCLAWS != null and YYBZZCLAWS != ''">
|
||||
and SAR_LAWS_ATTR_INFO.YYBZZCLAWS = #{YYBZZCLAWS}
|
||||
</if>
|
||||
<if test="XGLC != null and XGLC != ''">
|
||||
and SAR_LAWS_ATTR_INFO.XGLC = #{XGLC}
|
||||
</if>
|
||||
<if test="CHJLLAWS != null and CHJLLAWS != ''">
|
||||
and SAR_LAWS_ATTR_INFO.CHJLLAWS like concat(concat('%',#{CHJLLAWS}),'%')
|
||||
</if>
|
||||
</trim>
|
||||
</sql>
|
||||
<sql id="SarStandardsInfo_in_left1">
|
||||
@@ -309,6 +373,14 @@
|
||||
<sql id="Base_Column_List_Show" >
|
||||
DISTINCT SAR_LAWS_STAND_INFO.ID,
|
||||
SAR_LAWS_STAND_INFO.LAWS_TYPE,
|
||||
SAR_LAWS_STAND_INFO.LAWS_TYPE_FIRST_LEVEL,
|
||||
(select DIC_TYPE_NAME from ts_dictype where DIC_TYPE_CODE = SAR_LAWS_STAND_INFO.LAWS_TYPE_FIRST_LEVEL) as lawTypeFirstLevelName,
|
||||
SAR_LAWS_STAND_INFO.LAWS_TYPE_SECOND_LEVEL,
|
||||
(select DIC_TYPE_NAME from ts_dictype where DIC_TYPE_CODE = SAR_LAWS_STAND_INFO.LAWS_TYPE_SECOND_LEVEL) as lawTypeSecondLevelName,
|
||||
SAR_LAWS_STAND_INFO.LAWS_TYPE_THIRD_LEVEL,
|
||||
(select DIC_TYPE_NAME from ts_dictype where DIC_TYPE_CODE = SAR_LAWS_STAND_INFO.LAWS_TYPE_THIRD_LEVEL) as lawTypeThirdLevelName,
|
||||
SAR_LAWS_STAND_INFO.LAWS_TYPE_FOURTH_LEVEL,
|
||||
(select DIC_TYPE_NAME from ts_dictype where DIC_TYPE_CODE = SAR_LAWS_STAND_INFO.LAWS_TYPE_FOURTH_LEVEL) as lawTypeFourthLevelName,
|
||||
SAR_LAWS_STAND_INFO.LAWS_NUMBER,
|
||||
SAR_LAWS_STAND_INFO.LAWS_NAME,
|
||||
SAR_LAWS_STAND_INFO.LAWS_EN_NAME,
|
||||
@@ -322,7 +394,9 @@
|
||||
SAR_LAWS_STAND_INFO.LAWS_SYCX,
|
||||
SAR_LAWS_STAND_INFO.IS_RELATE_ACCESS,
|
||||
SAR_LAWS_STAND_INFO.LAWS_YEAR,
|
||||
(select DIC_TYPE_NAME from ts_dictype where DIC_TYPE_CODE = SAR_LAWS_STAND_INFO.LAWS_YEAR) as lawsYearValue,
|
||||
SAR_LAWS_STAND_INFO.LAWS_NOTISYNC_NUM,
|
||||
SAR_LAWS_STAND_INFO.NOTISYNC_NUM_LINK,
|
||||
SAR_LAWS_STAND_INFO.LAWS_BULLETIN,
|
||||
SAR_LAWS_STAND_INFO.LAWS_LABEL,
|
||||
SAR_LAWS_STAND_INFO.LAWS_REMARK,
|
||||
@@ -351,6 +425,10 @@
|
||||
SELECT
|
||||
DISTINCT SAR_LAWS_STAND_INFO.ID,
|
||||
SAR_LAWS_STAND_INFO.LAWS_TYPE,
|
||||
SAR_LAWS_STAND_INFO.LAWS_TYPE_FIRST_LEVEL,
|
||||
SAR_LAWS_STAND_INFO.LAWS_TYPE_SECOND_LEVEL,
|
||||
SAR_LAWS_STAND_INFO.LAWS_TYPE_THIRD_LEVEL,
|
||||
SAR_LAWS_STAND_INFO.LAWS_TYPE_FOURTH_LEVEL,
|
||||
SAR_LAWS_STAND_INFO.LAWS_NUMBER,
|
||||
SAR_LAWS_STAND_INFO.LAWS_NAME,
|
||||
SAR_LAWS_STAND_INFO.LAWS_EN_NAME,
|
||||
@@ -365,12 +443,14 @@
|
||||
SAR_LAWS_STAND_INFO.IS_RELATE_ACCESS,
|
||||
SAR_LAWS_STAND_INFO.LAWS_YEAR,
|
||||
SAR_LAWS_STAND_INFO.LAWS_NOTISYNC_NUM,
|
||||
SAR_LAWS_STAND_INFO.NOTISYNC_NUM_LINK,
|
||||
SAR_LAWS_STAND_INFO.LAWS_BULLETIN,
|
||||
SAR_LAWS_STAND_INFO.LAWS_LABEL,
|
||||
SAR_LAWS_STAND_INFO.LAWS_REMARK,
|
||||
SAR_LAWS_STAND_INFO.COUNTRY,
|
||||
SAR_LAWS_STAND_INFO.MODIFY_TIME,
|
||||
dicstandTextStatus.DIC_TYPE_NAME AS standStatusShow,
|
||||
SAR_LAWS_ATTR_INFO.SSRQLAWS,
|
||||
(
|
||||
CASE
|
||||
WHEN SAR_LAWS_ATTR_INFO.XCXSSRQLAWS ='' THEN '9999-01-01'
|
||||
@@ -380,9 +460,16 @@
|
||||
from SAR_LAWS_STAND_INFO
|
||||
<include refid="SarStandardsInfo_in_left"/>
|
||||
order by
|
||||
<if test='orderByA != null and orderByA != "" and order1 != null and order1 != ""'>
|
||||
${orderByA} ${order1},
|
||||
</if>
|
||||
<choose>
|
||||
<when test="orderByA == SSRQLAWS">
|
||||
${orderByA} SUBSTRING_INDEX(SSRQLAWS,',',1),
|
||||
</when>
|
||||
<otherwise>
|
||||
<if test='orderByA != null and orderByA != "" and order1 != null and order1 != ""'>
|
||||
${orderByA} ${order1},
|
||||
</if>
|
||||
</otherwise>
|
||||
</choose>
|
||||
SAR_LAWS_STAND_INFO.id
|
||||
limit ${pager.startIndex-1},${pageSize}
|
||||
</select>
|
||||
@@ -493,8 +580,6 @@
|
||||
tmp_tb.CYSDLAWS,
|
||||
tmp_tb.TGRLAWS,
|
||||
tmp_tb.TGDWLAWS,
|
||||
tmp_tb.NYLXLAWS,
|
||||
tmp_tb.YYRZLAWS,
|
||||
tmp_tb.ZRBMLAWS,
|
||||
tmp_tb.ZRGCSLAWS,
|
||||
tmp_tb.DTWJHLAWS,
|
||||
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.adc.da.slrs.sarLawsTopic.dao.SarLawsContactInformationMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.adc.da.slrs.sarLawsTopic.entity.SarLawsContactInformation">
|
||||
<result property="id" column="ID" jdbcType="VARCHAR"/>
|
||||
<result property="lawsTopicId" column="LAWS_TOPIC_ID" jdbcType="VARCHAR"/>
|
||||
<result property="groupType" column="GROUP_TYPE" jdbcType="VARCHAR"/>
|
||||
<result property="name" column="NAME" jdbcType="VARCHAR"/>
|
||||
<result property="department" column="DEPARTMENT" jdbcType="VARCHAR"/>
|
||||
<result property="phone" column="PHONE" jdbcType="VARCHAR"/>
|
||||
<result property="email" column="EMAIL" jdbcType="VARCHAR"/>
|
||||
<result property="identity" column="IDENTITY" jdbcType="VARCHAR"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
ID,LAWS_TOPIC_ID,GROUP_TYPE,
|
||||
`NAME`,DEPARTMENT,PHONE,
|
||||
EMAIL,IDENTITY
|
||||
</sql>
|
||||
</mapper>
|
||||
@@ -0,0 +1,230 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.adc.da.slrs.sarLawsTopic.dao.SarLawsTopicMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.adc.da.slrs.sarLawsTopic.entity.SarLawsTopicVO">
|
||||
<id property="id" column="ID" jdbcType="VARCHAR"/>
|
||||
<result property="topicName" column="TOPIC_NAME" jdbcType="VARCHAR"/>
|
||||
<result property="organizer" column="ORGANIZER" jdbcType="VARCHAR"/>
|
||||
<result property="guidanceUnit" column="GUIDANCE_UNIT" jdbcType="VARCHAR"/>
|
||||
<result property="participatingUnit" column="PARTICIPATING_UNIT" jdbcType="VARCHAR"/>
|
||||
<result property="startTime" column="START_TIME" jdbcType="DATE"/>
|
||||
<result property="closeTime" column="CLOSE_TIME" jdbcType="DATE"/>
|
||||
<result property="topicStatus" column="TOPIC_STATUS" jdbcType="VARCHAR"/>
|
||||
<result property="topicCost" column="TOPIC_COST" jdbcType="VARCHAR"/>
|
||||
<result property="agreement" column="AGREEMENT" jdbcType="VARCHAR"/>
|
||||
<result property="researchPlan" column="RESEARCH_PLAN" jdbcType="VARCHAR"/>
|
||||
<result property="researchFindings" column="RESEARCH_FINDINGS" jdbcType="VARCHAR"/>
|
||||
<result property="researchGroupOther" column="RESEARCH_GROUP_OTHER" jdbcType="VARCHAR"/>
|
||||
<result property="conferenceMaterials" column="CONFERENCE_MATERIALS" jdbcType="VARCHAR"/>
|
||||
<result property="insideProjectProposalRepost" column="INSIDE_PROJECT_PROPOSAL_REPORT" jdbcType="VARCHAR"/>
|
||||
<result property="insideResearchPlan" column="INSIDE_RESEARCH_PLAN" jdbcType="VARCHAR"/>
|
||||
<result property="insideConferenceMaterials" column="INSIDE_CONFERENCE_MATERIALS" jdbcType="VARCHAR"/>
|
||||
<result property="insideResearchFindings" column="INSIDE_RESEARCH_FINDINGS" jdbcType="VARCHAR"/>
|
||||
<result property="insideOther" column="INSIDE_OTHER" jdbcType="VARCHAR"/>
|
||||
<result property="validFlag" column="VALID_FLAG" jdbcType="TINYINT"/>
|
||||
<result property="createTime" column="CREATE_TIME" jdbcType="TIMESTAMP"/>
|
||||
<result property="modifyTime" column="MODIFY_TIME" jdbcType="TIMESTAMP"/>
|
||||
<collection property="meetingList" ofType="com.adc.da.slrs.sarLawsTopic.entity.SarLawsTopicMeeting">
|
||||
<id property="id" column="sltmId" jdbcType="VARCHAR"/>
|
||||
<result property="lawsTopicId" column="sltmLawsTopicId"/>
|
||||
<result property="meetingName" column="MEETING_NAME"/>
|
||||
<result property="meetingTime" column="MEETING_TIME"/>
|
||||
<result property="meetingAddress" column="MEETING_ADDRESS"/>
|
||||
<result property="participants" column="PARTICIPANTS"/>
|
||||
<result property="meetingContent" column="MEETING_CONTENT"/>
|
||||
</collection>
|
||||
<collection property="topicContactInformationList" ofType="com.adc.da.slrs.sarLawsTopic.entity.SarLawsContactInformation">
|
||||
<id property="id" column="slci1Id" jdbcType="VARCHAR"/>
|
||||
<result property="lawsTopicId" column="slci1LawsTopicId"/>
|
||||
<result property="groupType" column="slci1GroupType"/>
|
||||
<result property="name" column="slci1Name"/>
|
||||
<result property="department" column="slci1Department"/>
|
||||
<result property="phone" column="slci1Phone"/>
|
||||
<result property="email" column="slci1Email"/>
|
||||
<result property="identity" column="slci1Identity" />
|
||||
</collection>
|
||||
<collection property="insideContactInformationList" ofType="com.adc.da.slrs.sarLawsTopic.entity.SarLawsContactInformation">
|
||||
<id property="id" column="slci2Id" jdbcType="VARCHAR"/>
|
||||
<result property="lawsTopicId" column="slci2LawsTopicId"/>
|
||||
<result property="groupType" column="slci2GroupType"/>
|
||||
<result property="name" column="slci2Name"/>
|
||||
<result property="department" column="slci2Department"/>
|
||||
<result property="phone" column="slci2Phone"/>
|
||||
<result property="email" column="slci2Email"/>
|
||||
<result property="identity" column="slci2Identity" />
|
||||
</collection>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
ID,TOPIC_NAME,ORGANIZER,
|
||||
GUIDANCE_UNIT,PARTICIPATING_UNIT,START_TIME,
|
||||
CLOSE_TIME,TOPIC_STATUS,TOPIC_COST,AGREEMENT,
|
||||
RESEARCH_PLAN,RESEARCH_FINDINGS,RESEARCH_GROUP_OTHER,
|
||||
CONFERENCE_MATERIALS,INSIDE_PROJECT_PROPOSAL_REPORT,INSIDE_RESEARCH_PLAN,
|
||||
INSIDE_CONFERENCE_MATERIALS,INSIDE_RESEARCH_FINDINGS,INSIDE_OTHER,
|
||||
VALID_FLAG,CREATE_TIME,MODIFY_TIME
|
||||
</sql>
|
||||
<sql id="Base_Join_Column_List">
|
||||
slt.ID,slt.TOPIC_NAME,slt.ORGANIZER,
|
||||
slt.GUIDANCE_UNIT,slt.PARTICIPATING_UNIT,slt.START_TIME,
|
||||
slt.CLOSE_TIME,slt.TOPIC_STATUS,slt.TOPIC_COST,slt.AGREEMENT,
|
||||
sltm.ID as sltmId,
|
||||
sltm.LAWS_TOPIC_ID as sltmLawsTopicId,
|
||||
sltm.MEETING_NAME,
|
||||
sltm.MEETING_TIME,
|
||||
sltm.MEETING_ADDRESS,
|
||||
sltm.PARTICIPANTS,
|
||||
sltm.MEETING_CONTENT,
|
||||
slt.RESEARCH_PLAN,slt.RESEARCH_FINDINGS,slt.RESEARCH_GROUP_OTHER,
|
||||
slt.CONFERENCE_MATERIALS,
|
||||
slci1.ID as slci1Id,
|
||||
slci1.LAWS_TOPIC_ID as slci1LawsTopicId,
|
||||
slci1.GROUP_TYPE slci1GroupType,
|
||||
slci1.`NAME` as slci1Name,
|
||||
slci1.DEPARTMENT as slci1Department,
|
||||
slci1.PHONE as slci1Phone,
|
||||
slci1.EMAIL as slci1Email,
|
||||
slci1.IDENTITY as slci1Identity,
|
||||
slci2.ID as slci2Id,
|
||||
slci2.LAWS_TOPIC_ID as slci2LawsTopicId,
|
||||
slci2.GROUP_TYPE as slci2GroupType,
|
||||
slci2.`NAME` as slci2Name,
|
||||
slci2.DEPARTMENT as slci2Department,
|
||||
slci2.PHONE as slci2Phone,
|
||||
slci2.EMAIL as slci2Email,
|
||||
slci2.IDENTITY as slci2Identity,
|
||||
slt.INSIDE_PROJECT_PROPOSAL_REPORT,slt.INSIDE_RESEARCH_PLAN,
|
||||
slt.INSIDE_CONFERENCE_MATERIALS,slt.INSIDE_RESEARCH_FINDINGS,slt.INSIDE_OTHER,
|
||||
slt.VALID_FLAG,slt.CREATE_TIME,slt.MODIFY_TIME
|
||||
</sql>
|
||||
<sql id="Base_Where_Clause">
|
||||
<trim suffixOverrides="," >
|
||||
<if test="topicName != null and topicName !=''">
|
||||
and TOPIC_NAME like concat('%',#{topicName},'%')
|
||||
</if>
|
||||
<if test="organizer != null and organizer !=''">
|
||||
and ORGANIZER like concat('%',#{organizer},'%')
|
||||
</if>
|
||||
<if test="guidanceUnit != null and guidanceUnit != ''" >
|
||||
and GUIDANCE_UNIT like concat('%',#{guidanceUnit},'%')
|
||||
</if>
|
||||
<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>
|
||||
<if test="topicStatus != null and topicStatus != ''" >
|
||||
and TOPIC_STATUS = #{topicStatus}
|
||||
</if>
|
||||
<if test="topicCost != null and topicCost != ''" >
|
||||
and TOPIC_COST like concat('%',#{topicCost},'%')
|
||||
</if>
|
||||
</trim>
|
||||
</sql>
|
||||
<sql id="TopicMeeting_where">
|
||||
<if test="meetingName != null and meetingName != ''">
|
||||
and sltm.MEETING_NAME like concat('%',#{meetingName},'%')
|
||||
</if>
|
||||
<if test="meetingTime != null and meetingTime != ''">
|
||||
and sltm.MEETING_TIME like concat('%',#{meetingTime},'%')
|
||||
</if>
|
||||
<if test="meetingAddress != null and meetingAddress != ''">
|
||||
and sltm.MEETING_ADDRESS like concat('%',#{meetingAddress},'%')
|
||||
</if>
|
||||
<!-- <if test="participantsList != null and participantsList.size() > 0" >-->
|
||||
<!-- and PARTICIPANTS in-->
|
||||
<!-- <foreach collection="participantsList" separator="," open="(" close=")" item="participant">-->
|
||||
<!-- #{participant}-->
|
||||
<!-- </foreach>-->
|
||||
<!-- </if>-->
|
||||
<if test="participants != null and participants != ''">
|
||||
and sltm.PARTICIPANTS like concat('%',#{participants},'%')
|
||||
</if>
|
||||
<if test="meetingContent != null and meetingContent != ''">
|
||||
and sltm.MEETING_CONTENT like concat('%',#{meetingContent},'%')
|
||||
</if>
|
||||
</sql>
|
||||
<sql id="ContactInformation_where">
|
||||
<if test="topicGroupName != null and topicGroupName !=''">
|
||||
and slci1.NAME like concat('%',#{topicGroupName},'%')
|
||||
</if>
|
||||
<if test="topicGroupDepartment != null and topicGroupDepartment != ''">
|
||||
and slci1.DEPARTMENT like concat('%',#{topicGroupDepartment},'%')
|
||||
</if>
|
||||
<if test="topicGroupPhone != null and topicGroupPhone != ''">
|
||||
and slci1.PHONE like concat('%',#{topicGroupPhone},'%')
|
||||
</if>
|
||||
<if test="topicGroupEmail != null and topicGroupEmail != ''">
|
||||
and slci1.EMAIL like concat('%',#{topicGroupEmail},'%')
|
||||
</if>
|
||||
<if test="topicGroupIdentity != null and topicGroupIdentity != ''">
|
||||
and slci1.IDENTITY like concat('%',#{topicGroupIdentity},'%')
|
||||
</if>
|
||||
<if test="insideName != null and insideName !=''">
|
||||
and slci2.NAME like concat('%',#{insideName},'%')
|
||||
</if>
|
||||
<if test="insideDepartment != null and insideDepartment != ''">
|
||||
and slci2.DEPARTMENT like concat('%',#{insideDepartment},'%')
|
||||
</if>
|
||||
<if test="insidePhone != null and insidePhone != ''">
|
||||
and slci2.PHONE like concat('%',#{insidePhone},'%')
|
||||
</if>
|
||||
<if test="insideEmail != null and insideEmail != ''">
|
||||
and slci2.EMAIL like concat('%',#{insideEmail},'%')
|
||||
</if>
|
||||
<if test="insideIdentity != null and insideIdentity != ''">
|
||||
and slci2.IDENTITY like concat('%',#{insideIdentity},'%')
|
||||
</if>
|
||||
</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
|
||||
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" />
|
||||
</select>
|
||||
<select id="queryByPage" resultMap="BaseResultMap">
|
||||
select <include refid="Base_Join_Column_List" />
|
||||
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" />
|
||||
order by slt.${sortField} ${sortMode}
|
||||
limit ${pager.startIndex-1},${pageSize}
|
||||
</select>
|
||||
<select id="getLawsTopicByIds" resultMap="BaseResultMap">
|
||||
select <include refid="Base_Join_Column_List" />
|
||||
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 and slt.ID in
|
||||
<foreach collection="idList" open="(" close=")" separator="," item="id">
|
||||
#{id}
|
||||
</foreach>
|
||||
order by slt.ID asc
|
||||
</select>
|
||||
<select id="getAllLawsTopic" resultMap="BaseResultMap">
|
||||
select <include refid="Base_Join_Column_List" />
|
||||
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" />
|
||||
order by slt.ID asc
|
||||
</select>
|
||||
</mapper>
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.adc.da.slrs.sarLawsTopic.dao.SarLawsTopicMeetingMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.adc.da.slrs.sarLawsTopic.entity.SarLawsTopicMeeting">
|
||||
<id property="id" column="ID" jdbcType="VARCHAR"/>
|
||||
<result property="lawsTopicId" column="LAWS_TOPIC_ID" jdbcType="VARCHAR"/>
|
||||
<result property="meetingName" column="MEETING_NAME" jdbcType="VARCHAR"/>
|
||||
<result property="meetingTime" column="MEETING_TIME" jdbcType="VARCHAR"/>
|
||||
<result property="meetingAddress" column="MEETING_ADDRESS" jdbcType="VARCHAR"/>
|
||||
<result property="participants" column="PARTICIPANTS" jdbcType="VARCHAR"/>
|
||||
<result property="meetingContent" column="MEETING_CONTENT" jdbcType="VARCHAR"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
ID,LAWS_TOPIC_ID,MEETING_NAME,
|
||||
MEETING_TIME,MEETING_ADDRESS,PARTICIPANTS,
|
||||
MEETING_CONTENT
|
||||
</sql>
|
||||
</mapper>
|
||||
@@ -14,6 +14,11 @@
|
||||
</collection>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="codeAndName" type="com.adc.da.slrs.tsDictionaryType.entity.TsDicType">
|
||||
<result property="dicTypeCode" column="dicTypeCode"/>
|
||||
<result property="dicTypeName" column="dicTypeName"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="getSearchMenu" resultMap="searchMenu">
|
||||
select t_d.ID as id,
|
||||
t_d.DICTIONARY_CODE as dictionary_code,
|
||||
@@ -28,4 +33,11 @@
|
||||
t_d_t.DIC_TYPE_NAME is not null and
|
||||
t_d.DICTIONARY_NAME is not null
|
||||
</select>
|
||||
<select id="selectDicTypeNameByDicCode" resultType="java.lang.String">
|
||||
select DIC_TYPE_NAME from ts_dictype where DIC_TYPE_CODE = #{typeCode}
|
||||
</select>
|
||||
<select id="selectAllDicTypeNameByDicCode" resultMap="codeAndName">
|
||||
select DIC_TYPE_CODE as dicTypeCode, DIC_TYPE_NAME as dicTypeName from ts_dictype
|
||||
where DIC_ID = (select id from ts_dictionary where DICTIONARY_CODE = #{dicCode})
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -84,10 +84,10 @@ public class SyncUserService {
|
||||
// 用户参数
|
||||
params.put("filter", "(userid=*)");
|
||||
params.put("basedn", "ou=People,o=foton.com.cn,o=isp");
|
||||
System.out.println("RequestBody:" + params.toString());
|
||||
log.info("RequestBody:" + params.toString());
|
||||
// 用户测试
|
||||
String rs = util.getResponseFromServer("http://idmsync.foton.com.cn/rest/users/getUserList", params);
|
||||
log.debug("远程调用同步的员工数据:"+rs);
|
||||
log.info("远程调用同步的员工数据:"+rs);
|
||||
JSONObject responseStr = JSON.parseObject(rs);
|
||||
if(responseStr.containsKey("status") && responseStr.getBoolean("status")){
|
||||
json.add(rs);
|
||||
@@ -114,6 +114,57 @@ public class SyncUserService {
|
||||
return json;
|
||||
}
|
||||
|
||||
/**
|
||||
* 去掉时间戳,其他与syncFotonUser2相同
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<String> syncFotonUser3()throws Exception{
|
||||
String appuser = "app_slrs";
|
||||
String appkey = "Fxi5LHbI5yGbQQDpVp86GcCdXeC5Bjfe";
|
||||
AuthUtils util = new AuthUtils(appuser, appkey, null);
|
||||
|
||||
List<String> json=new ArrayList<>();
|
||||
byte[] cookie = null;
|
||||
int index = 1;
|
||||
do {
|
||||
Map<String, Object> params = new HashMap<String, Object>();
|
||||
params.put("cookie", Base64.encodeBase64String(cookie));
|
||||
// params.put("timestamp", "");
|
||||
|
||||
// 用户参数
|
||||
params.put("filter", "(userid=*)");
|
||||
params.put("basedn", "ou=People,o=foton.com.cn,o=isp");
|
||||
params.forEach((key, value) -> log.info("同步用户数据的请求参数:" + key + " : " + value));
|
||||
// 用户测试
|
||||
String rs = util.getResponseFromServer("http://idmsync.foton.com.cn/rest/users/getUserList", params);
|
||||
log.info("第{}次调用,远程调用同步的员工数据:{}",index,rs);
|
||||
JSONObject responseStr = JSON.parseObject(rs);
|
||||
if(responseStr.containsKey("status") && responseStr.getBoolean("status")){
|
||||
json.add(rs);
|
||||
}
|
||||
if (responseStr.containsKey("cookie")) {
|
||||
try {
|
||||
JSONArray entries = responseStr.getJSONArray("cookie");
|
||||
if(entries==null){
|
||||
break;
|
||||
}
|
||||
cookie = new byte[entries.size()];
|
||||
for (int i = 0; i < entries.size(); i++) {
|
||||
cookie[i] = (byte) entries.getByte(i);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(),e);
|
||||
if (e.getMessage().contains("is not a JSONArray")) {
|
||||
cookie = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
index++;
|
||||
} while (cookie != null);
|
||||
return json;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public List<String> syncFotonOrg()throws Exception{
|
||||
@@ -128,9 +179,10 @@ public class SyncUserService {
|
||||
Map<String, Object> params = new HashMap<String, Object>();
|
||||
params.put("cookie", Base64.encodeBase64String(cookie));
|
||||
// params.put("timestamp", System.currentTimeMillis());
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
String timestamp = sdf.format(calendar.getTime());
|
||||
params.put("timestamp", timestamp);
|
||||
// Calendar calendar = Calendar.getInstance();
|
||||
// String timestamp = sdf.format(calendar.getTime());
|
||||
// params.put("timestamp", timestamp);
|
||||
params.put("timestamp",null);
|
||||
// 组织参数
|
||||
params.put("filter", "(orgNumber=*)");
|
||||
params.put("basedn", "ou=Organizations,o=foton.com.cn,o=isp");
|
||||
@@ -204,4 +256,50 @@ public class SyncUserService {
|
||||
} while (cookie != null);
|
||||
return json;
|
||||
}
|
||||
|
||||
// 不添加时间戳,全量同步部门信息
|
||||
public List<String> syncFotonOrg3()throws Exception{
|
||||
String appuser = "app_slrs";
|
||||
String appkey = "Fxi5LHbI5yGbQQDpVp86GcCdXeC5Bjfe";
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss'Z'");
|
||||
AuthUtils util = new AuthUtils(appuser, appkey, null);
|
||||
|
||||
byte[] cookie = null;
|
||||
List<String> json=new ArrayList<>();
|
||||
int index=1;
|
||||
do {
|
||||
Map<String, Object> params = new HashMap<String, Object>();
|
||||
params.put("cookie", Base64.encodeBase64String(cookie));
|
||||
// params.put("timestamp","");
|
||||
// 组织参数
|
||||
params.put("filter", "(orgNumber=*)");
|
||||
params.put("basedn", "ou=Organizations,o=foton.com.cn,o=isp");
|
||||
// 组织测试
|
||||
String rs = util.getResponseFromServer("http://idmsync.foton.com.cn/rest/orgs/getOrgList", params);
|
||||
log.info("第{}次调用:远程调用同步的部门数据:{}",index,rs);
|
||||
JSONObject responseStr = JSONObject.parseObject(rs);
|
||||
if(responseStr.containsKey("status") && responseStr.getBoolean("status")){
|
||||
json.add(rs);
|
||||
}
|
||||
if (responseStr.containsKey("cookie")) {
|
||||
try {
|
||||
JSONArray entries = responseStr.getJSONArray("cookie");
|
||||
if(entries==null){
|
||||
break;
|
||||
}
|
||||
cookie = new byte[entries.size()];
|
||||
for (int i = 0; i < entries.size(); i++) {
|
||||
cookie[i] = (byte) entries.getByte(i);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(),e);
|
||||
if (e.getMessage().contains("is not a JSONArray")) {
|
||||
cookie = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
index++;
|
||||
} while (cookie != null);
|
||||
return json;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,8 +39,11 @@ public class AuthUtils {
|
||||
public String getResponseFromServer(String url, Map<String, Object> params) throws Exception {
|
||||
HttpPost httpPost = new HttpPost(url);
|
||||
createSignHeader(httpPost, params);
|
||||
Header[] allHeaders = httpPost.getAllHeaders();
|
||||
for (Header header : allHeaders) {
|
||||
logger.info("请求头:" + header.getName() + ":" + header.getValue());
|
||||
}
|
||||
JSONObject object = JSONObject.fromObject(params);
|
||||
params.forEach((key,value) -> logger.info("请求参数:{}:{}",key,value));
|
||||
httpPost.setEntity(new ByteArrayEntity(object.toString().getBytes(), ContentType.APPLICATION_JSON));
|
||||
return execute(httpPost);
|
||||
}
|
||||
@@ -52,7 +55,7 @@ public class AuthUtils {
|
||||
client = HttpClientBuilder.create().build();
|
||||
logger.info("请求地址:"+request.getURI().toString());
|
||||
for (Header header : request.getAllHeaders()) {
|
||||
logger.info("请求头:"+header.toString());
|
||||
logger.info("请求头:"+header.getName() + ":" + header.getValue());
|
||||
}
|
||||
resp = client.execute(request);
|
||||
return EntityUtils.toString(resp.getEntity());
|
||||
|
||||
@@ -2,6 +2,8 @@ package com.adc.da.sys.page;
|
||||
|
||||
import com.adc.da.base.page.BasePage;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* <b>功能:</b>TS_USER UserEOPage<br>
|
||||
@@ -11,6 +13,7 @@ import com.adc.da.base.page.BasePage;
|
||||
*/
|
||||
public class UserEOPage extends BasePage {
|
||||
|
||||
private List<String> usidList;
|
||||
private String usid;
|
||||
private String usidOperator = "=";
|
||||
private String account;
|
||||
@@ -40,6 +43,13 @@ public class UserEOPage extends BasePage {
|
||||
private boolean disAdmin=true;
|
||||
|
||||
|
||||
public List<String> getUsidList() {
|
||||
return usidList;
|
||||
}
|
||||
|
||||
public void setUsidList(List<String> usidList) {
|
||||
this.usidList = usidList;
|
||||
}
|
||||
|
||||
public String getUsid() {
|
||||
return this.usid;
|
||||
|
||||
+1
@@ -110,6 +110,7 @@ public class SarMenuStandardServiceImpl extends ServiceImpl<SarMenuStandardDao,
|
||||
@Override
|
||||
public List<SarMenuStandard> getAll(String dicId) {
|
||||
QueryWrapper sarMenuQueryWrapper=new QueryWrapper<>();
|
||||
//sarMenuQueryWrapper.eq("VALID_FLAG",0);
|
||||
sarMenuQueryWrapper.eq("DIC_ID",dicId);
|
||||
sarMenuQueryWrapper.orderByAsc("DISPLAY_SEQ");
|
||||
// sarMenuQueryWrapper.isNull("PARENT_ID");
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.adc.da.sys.sarResource.dao;
|
||||
|
||||
import com.adc.da.sys.sarResource.entity.SysTsResource;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author zyl
|
||||
* @since 2021-06-30
|
||||
*/
|
||||
@Repository
|
||||
public interface SysTsResourceDao extends BaseMapper<SysTsResource> {
|
||||
|
||||
List<SysTsResource> queryMenuByDis(SysTsResource sarMenuEO);
|
||||
|
||||
List<SysTsResource> selectMenuByRole(SysTsResource sarMenuEO);
|
||||
|
||||
int insertTsRoleResource(HashMap<String,Object> map);
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user