Merge remote-tracking branch 'origin/dev_third_stage' into dev_third_stage
This commit is contained in:
+16
-4
@@ -1,5 +1,6 @@
|
||||
package com.jero.modules.problemKnowledgeBase.controller;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
@@ -35,7 +36,7 @@ import com.jero.common.aspect.annotation.AutoLog;
|
||||
public class CountryCardTempEOController extends JeroController<CountryCardTempEO, ICountryCardTempEOService> {
|
||||
@Autowired
|
||||
private ICountryCardTempEOService countryCardTempEOService;
|
||||
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
@@ -55,6 +56,7 @@ public class CountryCardTempEOController extends JeroController<CountryCardTempE
|
||||
QueryWrapper<CountryCardTempEO> queryWrapper = QueryGenerator.initQueryWrapper(countryCardTempEO, req.getParameterMap());
|
||||
Page<CountryCardTempEO> page = new Page<CountryCardTempEO>(pageNo, pageSize);
|
||||
IPage<CountryCardTempEO> pageList = countryCardTempEOService.page(page, queryWrapper);
|
||||
this.countryCardTempEOService.disposeData(pageList.getRecords(),countryCardTempEO.getCut());
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
@@ -66,8 +68,9 @@ public class CountryCardTempEOController extends JeroController<CountryCardTempE
|
||||
@AutoLog(value = "Country Card模板维护表-列表查询")
|
||||
@ApiOperation(value="Country Card模板维护表-列表查询", notes="Country Card模板维护表-列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<List<CountryCardTempEO>> queryList() {
|
||||
List<CountryCardTempEO> list = countryCardTempEOService.queryList();
|
||||
public Result<List<CountryCardTempEO>> queryList(CountryCardTempEO countryCardTempEO,HttpServletRequest req) {
|
||||
List<CountryCardTempEO> list = countryCardTempEOService.queryList(countryCardTempEO,req);
|
||||
this.countryCardTempEOService.disposeData(list,countryCardTempEO.getCut());
|
||||
return Result.OK(list);
|
||||
}
|
||||
|
||||
@@ -141,7 +144,16 @@ public class CountryCardTempEOController extends JeroController<CountryCardTempE
|
||||
if(countryCardTempEO==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(countryCardTempEO);
|
||||
|
||||
List<CountryCardTempEO> countryCardTempEOList = new ArrayList<>();
|
||||
countryCardTempEOList.add(countryCardTempEO);
|
||||
this.countryCardTempEOService.disposeData(countryCardTempEOList,countryCardTempEO.getCut());
|
||||
|
||||
if(countryCardTempEOList.size() == 0){
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
|
||||
return Result.OK(countryCardTempEOList.get(0));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+3
-3
@@ -35,7 +35,7 @@ import com.jero.common.aspect.annotation.AutoLog;
|
||||
public class CountryCardTempItemEOController extends JeroController<CountryCardTempItemEO, ICountryCardTempItemEOService> {
|
||||
@Autowired
|
||||
private ICountryCardTempItemEOService countryCardTempItemEOService;
|
||||
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
@@ -66,8 +66,8 @@ public class CountryCardTempItemEOController extends JeroController<CountryCardT
|
||||
@AutoLog(value = "Country Card模板维护-字典项表-列表查询")
|
||||
@ApiOperation(value="Country Card模板维护-字典项表-列表查询", notes="Country Card模板维护-字典项表-列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<List<CountryCardTempItemEO>> queryList() {
|
||||
List<CountryCardTempItemEO> list = countryCardTempItemEOService.queryList();
|
||||
public Result<List<CountryCardTempItemEO>> queryList(CountryCardTempItemEO countryCardTempItemEO,HttpServletRequest req) {
|
||||
List<CountryCardTempItemEO> list = countryCardTempItemEOService.queryList(countryCardTempItemEO,req);
|
||||
return Result.OK(list);
|
||||
}
|
||||
|
||||
|
||||
+9
@@ -3,7 +3,10 @@ package com.jero.modules.problemKnowledgeBase.entity;
|
||||
import java.io.Serializable;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
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 lombok.Data;
|
||||
@@ -86,4 +89,10 @@ public class CountryCardTempEO implements Serializable {
|
||||
@ApiModelProperty(value = "描述")
|
||||
private java.lang.String description;
|
||||
|
||||
/**Country Card模板维护-字典项实体*/
|
||||
@TableField(exist = false)
|
||||
private List<CountryCardTempItemEO> countryCardTempItemEOList;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String cut;
|
||||
}
|
||||
|
||||
+49
@@ -0,0 +1,49 @@
|
||||
package com.jero.modules.problemKnowledgeBase.enums;
|
||||
|
||||
import com.jero.common.constant.enums.CutEnum;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
/**
|
||||
* 标签类型枚举类
|
||||
*/
|
||||
public enum LableTypeEnum {
|
||||
|
||||
PULL_SINGLE("单选下拉框","Option drop - down box","3"),
|
||||
FILE("文件","file","7"),
|
||||
TEXT("文本框","text","8"),
|
||||
LINK("链接输入","Link to the input","9"),
|
||||
;
|
||||
|
||||
|
||||
String cnName;
|
||||
String enName;
|
||||
String value;
|
||||
|
||||
private LableTypeEnum(String cnName,String enName, String value) {
|
||||
this.cnName = cnName;
|
||||
this.enName = enName;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public static String getTextByValue(String value,String cut) {
|
||||
LableTypeEnum[] values = values();
|
||||
for (LableTypeEnum taskStatusEnum : values) {
|
||||
if (taskStatusEnum.value.equals(value)) {
|
||||
if(StringUtils.equals(cut, CutEnum.CN.getValue())){
|
||||
return taskStatusEnum.cnName;
|
||||
}else if(StringUtils.equals(cut,CutEnum.EN.getValue())){
|
||||
return taskStatusEnum.enName;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
+10
-1
@@ -2,6 +2,8 @@ package com.jero.modules.problemKnowledgeBase.service;
|
||||
|
||||
import com.jero.modules.problemKnowledgeBase.entity.CountryCardTempEO;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -57,5 +59,12 @@ public interface ICountryCardTempEOService extends IService<CountryCardTempEO> {
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<CountryCardTempEO> queryList();
|
||||
List<CountryCardTempEO> queryList(CountryCardTempEO countryCardTempEO, HttpServletRequest req);
|
||||
|
||||
/***
|
||||
* 处理数据
|
||||
* @param datas
|
||||
* @param cut
|
||||
*/
|
||||
void disposeData(List<CountryCardTempEO> datas, String cut);
|
||||
}
|
||||
|
||||
+6
-1
@@ -1,7 +1,10 @@
|
||||
package com.jero.modules.problemKnowledgeBase.service;
|
||||
|
||||
import com.jero.modules.problemKnowledgeBase.entity.CountryCardTempEO;
|
||||
import com.jero.modules.problemKnowledgeBase.entity.CountryCardTempItemEO;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -57,5 +60,7 @@ public interface ICountryCardTempItemEOService extends IService<CountryCardTempI
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<CountryCardTempItemEO> queryList();
|
||||
List<CountryCardTempItemEO> queryList(CountryCardTempItemEO countryCardTempItemEO, HttpServletRequest req);
|
||||
|
||||
void batchInsert(List<CountryCardTempItemEO> countryCardTempItemEOList, String id,String cut);
|
||||
}
|
||||
|
||||
+3
@@ -7,6 +7,8 @@ import org.springframework.stereotype.Service;
|
||||
import java.util.List;
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* @Description: 问题知识库-country_card-管理发布明细表
|
||||
@@ -15,6 +17,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
@Transactional(value = "transactionManager", readOnly = false, propagation = Propagation.REQUIRED, rollbackFor = Throwable.class)
|
||||
public class CountryCardManageReleaseDetailEOServiceImpl extends ServiceImpl<CountryCardManageReleaseDetailEOMapper, CountryCardManageReleaseDetailEO> implements ICountryCardManageReleaseDetailEOService {
|
||||
|
||||
/**
|
||||
|
||||
+3
@@ -7,6 +7,8 @@ import org.springframework.stereotype.Service;
|
||||
import java.util.List;
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* @Description: 问题知识库-country_card-管理发布表
|
||||
@@ -15,6 +17,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
@Transactional(value = "transactionManager", readOnly = false, propagation = Propagation.REQUIRED, rollbackFor = Throwable.class)
|
||||
public class CountryCardManageReleaseEOServiceImpl extends ServiceImpl<CountryCardManageReleaseEOMapper, CountryCardManageReleaseEO> implements ICountryCardManageReleaseEOService {
|
||||
|
||||
/**
|
||||
|
||||
+58
-2
@@ -1,12 +1,28 @@
|
||||
package com.jero.modules.problemKnowledgeBase.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.modules.problemKnowledgeBase.entity.CountryCardTempEO;
|
||||
import com.jero.modules.problemKnowledgeBase.entity.CountryCardTempItemEO;
|
||||
import com.jero.modules.problemKnowledgeBase.enums.LableTypeEnum;
|
||||
import com.jero.modules.problemKnowledgeBase.mapper.CountryCardTempEOMapper;
|
||||
import com.jero.modules.problemKnowledgeBase.service.ICountryCardTempEOService;
|
||||
import com.jero.modules.problemKnowledgeBase.service.ICountryCardTempItemEOService;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Date;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* @Description: Country Card模板维护表
|
||||
@@ -15,8 +31,12 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
@Transactional(value = "transactionManager", readOnly = false, propagation = Propagation.REQUIRED, rollbackFor = Throwable.class)
|
||||
public class CountryCardTempEOServiceImpl extends ServiceImpl<CountryCardTempEOMapper, CountryCardTempEO> implements ICountryCardTempEOService {
|
||||
|
||||
@Autowired
|
||||
private ICountryCardTempItemEOService countryCardTempItemEOService;
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
@@ -29,6 +49,10 @@ public class CountryCardTempEOServiceImpl extends ServiceImpl<CountryCardTempEOM
|
||||
countryCardTempEO.setCreateTime(now);
|
||||
countryCardTempEO.setUpdateTime(now);
|
||||
save(countryCardTempEO);
|
||||
//如果选择了下拉框
|
||||
if(StringUtils.equals(countryCardTempEO.getLableType(), LableTypeEnum.PULL_SINGLE.getValue())){
|
||||
this.countryCardTempItemEOService.batchInsert(countryCardTempEO.getCountryCardTempItemEOList(),countryCardTempEO.getId(),countryCardTempEO.getCut());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -42,6 +66,10 @@ public class CountryCardTempEOServiceImpl extends ServiceImpl<CountryCardTempEOM
|
||||
Date now = new Date();
|
||||
countryCardTempEO.setUpdateTime(now);
|
||||
saveOrUpdate(countryCardTempEO);
|
||||
//如果选择了下拉框
|
||||
if(StringUtils.equals(countryCardTempEO.getLableType(), LableTypeEnum.PULL_SINGLE.getValue())){
|
||||
this.countryCardTempItemEOService.batchInsert(countryCardTempEO.getCountryCardTempItemEOList(),countryCardTempEO.getId(),countryCardTempEO.getCut());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -83,7 +111,35 @@ public class CountryCardTempEOServiceImpl extends ServiceImpl<CountryCardTempEOM
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<CountryCardTempEO> queryList() {
|
||||
return list();
|
||||
public List<CountryCardTempEO> queryList(CountryCardTempEO countryCardTempEO, HttpServletRequest req) {
|
||||
QueryWrapper<CountryCardTempEO> queryWrapper = QueryGenerator.initQueryWrapper(countryCardTempEO, req.getParameterMap());
|
||||
List<CountryCardTempEO> result = this.list(queryWrapper);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disposeData(List<CountryCardTempEO> datas, String cut) {
|
||||
if (CollectionUtils.isNotEmpty(datas)) {
|
||||
List<String> countroCardTempIdList = datas.stream().map(CountryCardTempEO::getId).distinct().collect(Collectors.toList());
|
||||
QueryWrapper<CountryCardTempItemEO> tempItemEOQueryWrapper = new QueryWrapper<>();
|
||||
tempItemEOQueryWrapper.lambda().in(CountryCardTempItemEO::getCountryCardTempId,countroCardTempIdList);
|
||||
List<CountryCardTempItemEO> countryCardTempItemEOList = this.countryCardTempItemEOService.list(tempItemEOQueryWrapper);
|
||||
|
||||
datas.forEach(countryCardTemp -> {
|
||||
//如果该条数据的标签类型是下拉选项
|
||||
if(CollectionUtils.isNotEmpty(countryCardTempItemEOList) && StringUtils.equals(countryCardTemp.getLableType(),LableTypeEnum.PULL_SINGLE.getValue())){
|
||||
//把这条模板的下拉选项设置进去
|
||||
List<CountryCardTempItemEO> collect = countryCardTempItemEOList.stream().filter(countryCardTempItemEO -> {
|
||||
boolean flag = false;
|
||||
if (StringUtils.equals(countryCardTemp.getId(), countryCardTempItemEO.getCountryCardTempId())) {
|
||||
flag = true;
|
||||
}
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
countryCardTemp.setCountryCardTempItemEOList(collect);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+44
-2
@@ -1,12 +1,26 @@
|
||||
package com.jero.modules.problemKnowledgeBase.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.jero.common.constant.CommonConstant;
|
||||
import com.jero.common.constant.enums.CutEnum;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.modules.problemKnowledgeBase.entity.CountryCardTempEO;
|
||||
import com.jero.modules.problemKnowledgeBase.entity.CountryCardTempItemEO;
|
||||
import com.jero.modules.problemKnowledgeBase.mapper.CountryCardTempItemEOMapper;
|
||||
import com.jero.modules.problemKnowledgeBase.service.ICountryCardTempItemEOService;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import java.util.List;
|
||||
import java.util.Date;
|
||||
import java.util.UUID;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* @Description: Country Card模板维护-字典项表
|
||||
@@ -15,6 +29,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
@Transactional(value = "transactionManager", readOnly = false, propagation = Propagation.REQUIRED, rollbackFor = Throwable.class)
|
||||
public class CountryCardTempItemEOServiceImpl extends ServiceImpl<CountryCardTempItemEOMapper, CountryCardTempItemEO> implements ICountryCardTempItemEOService {
|
||||
|
||||
/**
|
||||
@@ -83,7 +98,34 @@ public class CountryCardTempItemEOServiceImpl extends ServiceImpl<CountryCardTem
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<CountryCardTempItemEO> queryList() {
|
||||
return list();
|
||||
public List<CountryCardTempItemEO> queryList(CountryCardTempItemEO countryCardTempItemEO, HttpServletRequest req) {
|
||||
QueryWrapper<CountryCardTempItemEO> queryWrapper = QueryGenerator.initQueryWrapper(countryCardTempItemEO, req.getParameterMap());
|
||||
List<CountryCardTempItemEO> countryCardTempItemEOList = this.list(queryWrapper);
|
||||
return countryCardTempItemEOList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void batchInsert(List<CountryCardTempItemEO> countryCardTempItemEOList, String countryCardTempId,String cut) {
|
||||
if(CollectionUtils.isEmpty(countryCardTempItemEOList)){
|
||||
if(StringUtils.equals(cut, CutEnum.CN.getValue())){
|
||||
throw new JeroBootException("请维护下拉选项值!");
|
||||
}else if(StringUtils.equals(cut,CutEnum.EN.getValue())){
|
||||
throw new JeroBootException("Please maintain the drop-down option values!");
|
||||
}
|
||||
}
|
||||
|
||||
countryCardTempItemEOList.forEach(countryCardTempItemEO -> {
|
||||
if(StringUtils.isEmpty(countryCardTempItemEO.getItemValue())){
|
||||
String itemValue = UUID.randomUUID().toString().replace("-", "");
|
||||
countryCardTempItemEO.setItemValue(itemValue);
|
||||
}
|
||||
countryCardTempItemEO.setCountryCardTempId(countryCardTempId);
|
||||
countryCardTempItemEO.setDelFlag(String.valueOf(CommonConstant.DEL_FLAG_0));
|
||||
});
|
||||
QueryWrapper<CountryCardTempItemEO> deleteWrapper = new QueryWrapper<>();
|
||||
deleteWrapper.lambda().eq(CountryCardTempItemEO::getCountryCardTempId,countryCardTempId);
|
||||
this.baseMapper.delete(deleteWrapper);
|
||||
|
||||
this.saveBatch(countryCardTempItemEOList);
|
||||
}
|
||||
}
|
||||
|
||||
+3
@@ -7,6 +7,8 @@ import org.springframework.stereotype.Service;
|
||||
import java.util.List;
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* @Description: 问题知识库浏览历史表
|
||||
@@ -15,6 +17,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
@Transactional(value = "transactionManager", readOnly = false, propagation = Propagation.REQUIRED, rollbackFor = Throwable.class)
|
||||
public class ProblemKnowledgeBaseBrowsingHistoryEOServiceImpl extends ServiceImpl<ProblemKnowledgeBaseBrowsingHistoryEOMapper, ProblemKnowledgeBaseBrowsingHistoryEO> implements IProblemKnowledgeBaseBrowsingHistoryEOService {
|
||||
|
||||
/**
|
||||
|
||||
+3
@@ -7,6 +7,8 @@ import org.springframework.stereotype.Service;
|
||||
import java.util.List;
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* @Description: 问题知识库-分类表
|
||||
@@ -15,6 +17,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
@Transactional(value = "transactionManager", readOnly = false, propagation = Propagation.REQUIRED, rollbackFor = Throwable.class)
|
||||
public class ProblemKnowledgeBaseClassifyEOServiceImpl extends ServiceImpl<ProblemKnowledgeBaseClassifyEOMapper, ProblemKnowledgeBaseClassifyEO> implements IProblemKnowledgeBaseClassifyEOService {
|
||||
|
||||
/**
|
||||
|
||||
+3
@@ -7,6 +7,8 @@ import org.springframework.stereotype.Service;
|
||||
import java.util.List;
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* @Description: 问题知识库收藏表
|
||||
@@ -15,6 +17,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
@Transactional(value = "transactionManager", readOnly = false, propagation = Propagation.REQUIRED, rollbackFor = Throwable.class)
|
||||
public class ProblemKnowledgeBaseCollectEOServiceImpl extends ServiceImpl<ProblemKnowledgeBaseCollectEOMapper, ProblemKnowledgeBaseCollectEO> implements IProblemKnowledgeBaseCollectEOService {
|
||||
|
||||
/**
|
||||
|
||||
+3
@@ -7,6 +7,8 @@ import org.springframework.stereotype.Service;
|
||||
import java.util.List;
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* @Description: 问题知识库评论表
|
||||
@@ -15,6 +17,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
@Transactional(value = "transactionManager", readOnly = false, propagation = Propagation.REQUIRED, rollbackFor = Throwable.class)
|
||||
public class ProblemKnowledgeBaseCommentEOServiceImpl extends ServiceImpl<ProblemKnowledgeBaseCommentEOMapper, ProblemKnowledgeBaseCommentEO> implements IProblemKnowledgeBaseCommentEOService {
|
||||
|
||||
/**
|
||||
|
||||
+3
@@ -7,6 +7,8 @@ import org.springframework.stereotype.Service;
|
||||
import java.util.List;
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* @Description: 问题知识库表
|
||||
@@ -15,6 +17,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
@Transactional(value = "transactionManager", readOnly = false, propagation = Propagation.REQUIRED, rollbackFor = Throwable.class)
|
||||
public class ProblemKnowledgeBaseEOServiceImpl extends ServiceImpl<ProblemKnowledgeBaseEOMapper, ProblemKnowledgeBaseEO> implements IProblemKnowledgeBaseEOService {
|
||||
|
||||
/**
|
||||
|
||||
+3
@@ -7,6 +7,8 @@ import org.springframework.stereotype.Service;
|
||||
import java.util.List;
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* @Description: 问题知识库点赞表
|
||||
@@ -15,6 +17,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
@Transactional(value = "transactionManager", readOnly = false, propagation = Propagation.REQUIRED, rollbackFor = Throwable.class)
|
||||
public class ProblemKnowledgeBasePraiseEOServiceImpl extends ServiceImpl<ProblemKnowledgeBasePraiseEOMapper, ProblemKnowledgeBasePraiseEO> implements IProblemKnowledgeBasePraiseEOService {
|
||||
|
||||
/**
|
||||
|
||||
+3
@@ -7,6 +7,8 @@ import org.springframework.stereotype.Service;
|
||||
import java.util.List;
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* @Description: 问题知识库展示权限表
|
||||
@@ -15,6 +17,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
@Transactional(value = "transactionManager", readOnly = false, propagation = Propagation.REQUIRED, rollbackFor = Throwable.class)
|
||||
public class ProblemKnowledgeBaseUserEOServiceImpl extends ServiceImpl<ProblemKnowledgeBaseUserEOMapper, ProblemKnowledgeBaseUserEO> implements IProblemKnowledgeBaseUserEOService {
|
||||
|
||||
/**
|
||||
|
||||
+1
-1
@@ -100,7 +100,7 @@ public class LawsMonthlyReportTitleTemplateEOController extends JeroController<L
|
||||
*/
|
||||
@AutoLog(value = "月报标题模板-编辑")
|
||||
@ApiOperation(value="月报标题模板-编辑", notes="月报标题模板-编辑")
|
||||
@GetMapping(value = "/edit")
|
||||
@PostMapping(value = "/edit")
|
||||
public Result<?> edit(@Validated @RequestBody LawsMonthlyReportTitleTemplateEO lawsMonthlyReportTitleTemplateEO) {
|
||||
lawsMonthlyReportTitleTemplateEOService.editById(lawsMonthlyReportTitleTemplateEO);
|
||||
return Result.OK("编辑成功!");
|
||||
|
||||
+1
@@ -103,6 +103,7 @@ public class LawsMonthlyReportManageEOServiceImpl extends ServiceImpl<LawsMonthl
|
||||
query.in("create_by",sysUser.getUsername()).in("issue_status", InventoryStateEnum.TO_BE_RELEASED.getValue())
|
||||
.or().in("issue_status",InventoryStateEnum.ISSUE.getValue());
|
||||
});
|
||||
queryWrapper.orderByDesc("create_time");
|
||||
Page<LawsMonthlyReportManageEO> pageInfo = this.page(page, queryWrapper);
|
||||
return pageInfo;
|
||||
}
|
||||
|
||||
+21
-1
@@ -5,12 +5,15 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jero.common.constant.enums.CutEnum;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.modules.report.entity.LawsMonthlyReportTitleTemplateEO;
|
||||
import com.jero.modules.report.entity.LawsMonthlyReportWriteEO;
|
||||
import com.jero.modules.report.mapper.LawsMonthlyReportTitleTemplateEOMapper;
|
||||
import com.jero.modules.report.service.ILawsMonthlyReportTitleTemplateEOService;
|
||||
import com.jero.modules.report.vo.LawsMonthlyReportTitleTemplateVO;
|
||||
import com.jero.modules.system.util.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
@@ -30,6 +33,8 @@ import java.util.stream.Collectors;
|
||||
@Service
|
||||
public class LawsMonthlyReportTitleTemplateEOServiceImpl extends ServiceImpl<LawsMonthlyReportTitleTemplateEOMapper, LawsMonthlyReportTitleTemplateEO> implements ILawsMonthlyReportTitleTemplateEOService {
|
||||
|
||||
@Autowired
|
||||
private LawsMonthlyReportWriteEOServiceImpl lawsMonthlyReportWriteEOService;
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
@@ -98,7 +103,22 @@ public class LawsMonthlyReportTitleTemplateEOServiceImpl extends ServiceImpl<Law
|
||||
*/
|
||||
@Override
|
||||
public void deleteByIds(List<String> ids) {
|
||||
removeByIds(ids);
|
||||
//标题下存在内容或子标题时不能删除
|
||||
//1. 判断是否存在子标题
|
||||
LambdaQueryWrapper<LawsMonthlyReportTitleTemplateEO> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.in(LawsMonthlyReportTitleTemplateEO::getParentId,ids);
|
||||
List<LawsMonthlyReportTitleTemplateEO> list = this.list(wrapper);
|
||||
if(list.size() != 0){
|
||||
throw new JeroBootException("该标题下存在子标题,不能删除");
|
||||
}
|
||||
//2. 判断是否存在内容 memories_chapter
|
||||
LambdaQueryWrapper<LawsMonthlyReportWriteEO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.in(LawsMonthlyReportWriteEO::getMemoriesChapter,ids);
|
||||
List<LawsMonthlyReportWriteEO> lawsMonthlyReportWriteEOS = lawsMonthlyReportWriteEOService.list(lambdaQueryWrapper);
|
||||
if(lawsMonthlyReportWriteEOS.size() != 0){
|
||||
throw new JeroBootException("该标题下存在新增内容,不能删除");
|
||||
}
|
||||
removeByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+19
-1
@@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jero.common.constant.enums.CutEnum;
|
||||
import com.jero.common.constant.enums.ModuleEnum;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.generater.modules.online.cgform.entity.OnlCgformField;
|
||||
import com.jero.generater.modules.online.cgform.service.impl.OnlCgformFieldServiceImpl;
|
||||
import com.jero.modules.document.enums.FieldTypeEnum;
|
||||
@@ -29,11 +30,14 @@ import com.jero.modules.report.service.INewStandardTemplateEOService;
|
||||
import com.jero.modules.report.util.WordUtil;
|
||||
import com.jero.modules.system.entity.SysCategory;
|
||||
import com.jero.modules.system.entity.SysDictItem;
|
||||
import com.jero.modules.system.enums.ProjectRoleEnum;
|
||||
import com.jero.modules.system.service.impl.SysBaseApiImpl;
|
||||
import com.jero.modules.system.service.impl.SysCategoryServiceImpl;
|
||||
import com.jero.modules.system.service.impl.SysDictItemServiceImpl;
|
||||
import com.jero.modules.system.util.StringUtils;
|
||||
import org.apache.poi.xwpf.usermodel.ParagraphAlignment;
|
||||
import org.apache.poi.xwpf.usermodel.XWPFDocument;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.aspectj.util.FileUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
@@ -81,6 +85,8 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl<LawsMonthly
|
||||
private BussDocumentLibraryEOMapper bussDocumentLibraryEOMapper;
|
||||
@Autowired
|
||||
private SysDictItemServiceImpl sysDictItemServiceImpl;
|
||||
@Autowired
|
||||
private SysBaseApiImpl sysBaseApi;
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
@@ -92,6 +98,7 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl<LawsMonthly
|
||||
Date now = new Date();
|
||||
lawsMonthlyReportWriteEO.setCreateTime(now);
|
||||
lawsMonthlyReportWriteEO.setUpdateTime(now);
|
||||
lawsMonthlyReportWriteEO.setExportState(ExportStateEnum.NOT_EXPORT.getValue());
|
||||
save(lawsMonthlyReportWriteEO);
|
||||
|
||||
if(ContentTemplateEnum.NEW_REQUEST_LIST_TEMPLATE.getValue().equals(lawsMonthlyReportWriteEO.getContentTemplate())){
|
||||
@@ -261,6 +268,13 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl<LawsMonthly
|
||||
Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<LawsMonthlyReportWriteEO> queryWrapper = QueryGenerator.initQueryWrapper(lawsMonthlyReportWriteEOTemp, req.getParameterMap());
|
||||
queryWrapper.orderByDesc("create_time");
|
||||
//管理员查看全部数据,其余人只能查看自己的数据
|
||||
LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
List<String> rolesList = sysBaseApi.getRolesByUsername(currentUser.getUsername());
|
||||
if(!rolesList.contains(ProjectRoleEnum.ADMIN.getCode())){
|
||||
queryWrapper.in("create_by",currentUser.getUsername());
|
||||
}
|
||||
Page<LawsMonthlyReportWriteEO> page = new Page<LawsMonthlyReportWriteEO>(pageNo, pageSize);
|
||||
Page<LawsMonthlyReportWriteEO> pageInfo = this.page(page, queryWrapper);
|
||||
//法规月报id
|
||||
@@ -522,6 +536,8 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl<LawsMonthly
|
||||
}else{
|
||||
content = "Content";
|
||||
}
|
||||
//单独设置每页右侧的时间
|
||||
WordUtil.exportWordMonth(document, lawsMonthlyReportWriteEOS.get(0).getMonth(), null, ParagraphAlignment.RIGHT, 0, 12, false, true, "微软雅黑");
|
||||
WordUtil.exportWord(document, titleCN, null, ParagraphAlignment.CENTER, 0, 12, false, true, "Microsoft YaHei UI");
|
||||
WordUtil.exportWord(document, content, null, ParagraphAlignment.LEFT, 0, 12, false, true, "Microsoft YaHei UI");
|
||||
int oneCount = 1;
|
||||
@@ -597,7 +613,9 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl<LawsMonthly
|
||||
content = "Content";
|
||||
}
|
||||
WordUtil.exportWord(document, titleCN, null, ParagraphAlignment.CENTER, 0, 12, false, true, "Microsoft YaHei UI");
|
||||
WordUtil.exportWord(document, content, null, ParagraphAlignment.LEFT, 0, 12, false, true, "Microsoft YaHei UI");
|
||||
//单独设置每页右侧的时间
|
||||
WordUtil.exportWordMonth(document, lawsMonthlyReportWriteEOS.get(0).getMonth(), null, ParagraphAlignment.RIGHT, 0, 12, false, true, "Microsoft YaHei UI");
|
||||
// WordUtil.exportWord(document, content, null, ParagraphAlignment.LEFT, 0, 12, false, true, "Microsoft YaHei UI");
|
||||
int oneCount = 1;
|
||||
|
||||
for (LawsMonthlyReportTitleTemplateEO lawsMonthlyReportTitleTemplateEO : reportTitleOneList) {
|
||||
|
||||
@@ -103,6 +103,100 @@ public class WordUtil {
|
||||
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 导出工具示例
|
||||
*
|
||||
* @param document POI文件类
|
||||
* @param text 输出文本
|
||||
* @param textColor 字体颜色
|
||||
* @param align 字体位置,默认居左
|
||||
* @param spaceNum 预留空格数,默认不留空格
|
||||
* @param fontSize 字体大小,默认11
|
||||
* @param isNewline 是否换行,换行后文本失效
|
||||
* @param isBold 是否加粗,默认不加粗
|
||||
* @param fontFamily 字体,默认宋体
|
||||
*/
|
||||
public static void exportWordMonth(XWPFDocument document,
|
||||
String text,
|
||||
String textColor,
|
||||
ParagraphAlignment align,
|
||||
Integer spaceNum,
|
||||
Integer fontSize,
|
||||
Boolean isNewline,
|
||||
Boolean isBold,
|
||||
String fontFamily) {
|
||||
|
||||
// CTSectPr sectPr = document.getDocument().getBody().addNewSectPr();
|
||||
// XWPFHeaderFooterPolicy policy = new XWPFHeaderFooterPolicy(document, sectPr);
|
||||
//
|
||||
// //添加页眉
|
||||
// CTP ctpHeader = CTP.Factory.newInstance();
|
||||
// CTR ctrHeader = ctpHeader.addNewR();
|
||||
// CTText ctHeader = ctrHeader.addNewT();
|
||||
// String headerText = "Java POI create MS word file.";
|
||||
// ctHeader.setStringValue(headerText);
|
||||
// XWPFParagraph headerParagraph = new XWPFParagraph(ctpHeader, document);
|
||||
// //设置为右对齐
|
||||
// headerParagraph.setAlignment(ParagraphAlignment.RIGHT);
|
||||
// XWPFParagraph[] parsHeader = new XWPFParagraph[1];
|
||||
// parsHeader[0] = headerParagraph;
|
||||
// try {
|
||||
// policy.createHeader(XWPFHeaderFooterPolicy.DEFAULT, parsHeader);
|
||||
// } catch (IOException e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
|
||||
|
||||
//添加标题
|
||||
XWPFParagraph titleParagraph = document.createParagraph();
|
||||
//设置段落左对齐
|
||||
if (align == null) {
|
||||
titleParagraph.setAlignment(ParagraphAlignment.RIGHT);
|
||||
} else {
|
||||
titleParagraph.setAlignment(align);
|
||||
}
|
||||
|
||||
XWPFRun titleParagraphRun = titleParagraph.createRun();
|
||||
if (isNewline) {
|
||||
titleParagraphRun.setText("\r");
|
||||
} else {
|
||||
//封装文字内容
|
||||
StringBuilder newText = new StringBuilder();
|
||||
for (int i = 0; i < spaceNum; i++) {
|
||||
newText.append(" ");
|
||||
}
|
||||
newText.append(text);
|
||||
titleParagraphRun.setText(newText.toString());
|
||||
|
||||
//设置颜色
|
||||
if (StringUtils.isNotEmpty(textColor)) {
|
||||
titleParagraphRun.setColor(textColor);
|
||||
} else {
|
||||
titleParagraphRun.setColor("000000");
|
||||
}
|
||||
//设置文字大小
|
||||
if (ObjectUtil.isNotEmpty(fontSize)) {
|
||||
titleParagraphRun.setFontSize(fontSize);
|
||||
} else {
|
||||
titleParagraphRun.setFontSize(11);
|
||||
}
|
||||
|
||||
//设置加粗
|
||||
if (ObjectUtil.isNotEmpty(isBold)) {
|
||||
titleParagraphRun.setBold(isBold);
|
||||
} else {
|
||||
titleParagraphRun.setBold(false);
|
||||
}
|
||||
|
||||
//设置字体样式
|
||||
if (StringUtils.isNotEmpty(fontFamily)) {
|
||||
titleParagraphRun.setFontFamily(fontFamily);
|
||||
} else {
|
||||
titleParagraphRun.setFontFamily("宋体");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public static void exportWordExcelDefault(XWPFDocument document,
|
||||
LawsMonthlyReportWriteEO lawsMonthlyReportWriteEO,
|
||||
|
||||
Reference in New Issue
Block a user