合并分支 'dev_third_stage' 到 'master'
Dev third stage 查看合并请求 laws-nio/laws-weilai!125
This commit is contained in:
+91
@@ -0,0 +1,91 @@
|
||||
package com.jero.modules.feishu.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jero.modules.feishu.service.IFeishuService;
|
||||
import com.jero.modules.feishu.utils.LarkDecryptUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@Api(tags="飞书交互控制层")
|
||||
@RestController
|
||||
@RequestMapping("/lark")
|
||||
@Slf4j
|
||||
public class LarkController {
|
||||
@Autowired
|
||||
private IFeishuService feishuService;
|
||||
|
||||
//加密密钥
|
||||
@Value("${Feishu.eventSubscription.encryptKey}")
|
||||
private String encryptKey;
|
||||
/**
|
||||
* 飞书调用接口,飞书事件订阅配置。
|
||||
* @param jsonObject
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/larkEventSubscriptionConfig")
|
||||
public String larkEventSubscriptionConfig(@RequestBody JSONObject jsonObject){
|
||||
String encrypt = jsonObject.getString("encrypt");
|
||||
log.info(encrypt);
|
||||
|
||||
LarkDecryptUtil d = new LarkDecryptUtil(encryptKey);
|
||||
|
||||
String decrypt = null;
|
||||
try {
|
||||
decrypt = d.decrypt(encrypt);
|
||||
} catch (Exception exception) {
|
||||
exception.printStackTrace();
|
||||
}
|
||||
log.info("decrypt:==========================================================" + decrypt);
|
||||
|
||||
//解析密钥json
|
||||
JSONObject decryptJson = JSONObject.parseObject(decrypt);
|
||||
Object event = decryptJson.get("event");
|
||||
if(event != null){
|
||||
JSONObject eventJson = JSONObject.parseObject(decryptJson.get("event").toString());
|
||||
|
||||
// 消息类型 与飞书开放平台文档应该一致
|
||||
String msgType = eventJson.getString("msg_type");
|
||||
|
||||
//如果是文本类型消息,进入处理,
|
||||
if(StringUtils.equals(msgType,"text")){
|
||||
//用户发送的内容
|
||||
String textWithoutAtBot = eventJson.getString("text_without_at_bot");
|
||||
//用户发送的内容 与上方textWithoutAtBot变量一致(迷惑行为,同样的内容,用了两个字段返回)
|
||||
String text = eventJson.getString("text");
|
||||
//用户id
|
||||
String employeeId = eventJson.getString("employee_id");
|
||||
|
||||
//判断用户发送的消息内容,如果包含"知识库" 那么给用户推送知识库分类菜单
|
||||
if(StringUtils.contains(text,"知识库")){
|
||||
log.info("给"+employeeId+"用户推送知识库一级分类菜单:==========================================================");
|
||||
feishuService.sendKnowledgeBaseTypeCard(employeeId.split(","));
|
||||
}
|
||||
}
|
||||
}
|
||||
return decrypt;
|
||||
}
|
||||
|
||||
/**
|
||||
* 飞书卡片消息配置
|
||||
* @param jsonObject
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/larkCardMessageConfig")
|
||||
public JSONObject larkCardMessageConfig(@RequestBody JSONObject jsonObject){
|
||||
JSONObject result = new JSONObject();
|
||||
String challenge = jsonObject.getString("challenge");
|
||||
if(StringUtils.isEmpty(challenge)){
|
||||
this.feishuService.sendKnowledgeBaseInfoCard(jsonObject);
|
||||
}
|
||||
result.put("challenge",challenge);
|
||||
log.info(result.toString());
|
||||
return result;
|
||||
}
|
||||
}
|
||||
+13
@@ -1,5 +1,6 @@
|
||||
package com.jero.modules.feishu.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jero.modules.feishu.vo.FeishuMsgVo;
|
||||
|
||||
import java.io.IOException;
|
||||
@@ -43,4 +44,16 @@ public interface IFeishuService {
|
||||
* @return
|
||||
*/
|
||||
String translateText(Map<String,Object> params);
|
||||
|
||||
/**
|
||||
* 发送知识库分类卡片消息 (用户输入知识库的时候)
|
||||
* @param userIds
|
||||
*/
|
||||
void sendKnowledgeBaseTypeCard(String[] userIds);
|
||||
|
||||
/**
|
||||
* 发送知识库信息卡片消息 (用户点击某一个分类的时候)
|
||||
* @param jsonObject
|
||||
*/
|
||||
void sendKnowledgeBaseInfoCard(JSONObject jsonObject);
|
||||
}
|
||||
|
||||
+173
@@ -3,11 +3,13 @@ package com.jero.modules.feishu.service.impl;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.druid.support.json.JSONUtils;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jero.modules.feishu.service.IFeishuService;
|
||||
import com.jero.modules.feishu.vo.FeishuMsgVo;
|
||||
import com.jero.modules.system.util.HttpRequestUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -306,4 +308,175 @@ public class FeishuServiceImpl implements IFeishuService {
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送知识库分类卡片消息 (用户输入知识库的时候)
|
||||
* @param userIds
|
||||
*/
|
||||
@Override
|
||||
public void sendKnowledgeBaseTypeCard(String[] userIds){
|
||||
String token = null;
|
||||
try {
|
||||
token = getTenantAccessToken();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
// 设置请求头
|
||||
Map<String, String> headerMap = new HashMap<>();
|
||||
headerMap.put("Authorization", "Bearer " + token);
|
||||
headerMap.put("Content-Type", "application/json; charset=utf-8");
|
||||
|
||||
String sendJson = " {\n" +
|
||||
" \"config\": {\n" +
|
||||
" \"wide_screen_mode\": true\n" +
|
||||
" },\n" +
|
||||
" \"header\": {\n" +
|
||||
" \"title\": {\n" +
|
||||
" \"tag\": \"plain_text\",\n" +
|
||||
" \"content\": \"点击下方的分类查看常见问题\"\n" +
|
||||
" }\n" +
|
||||
" }\n" +
|
||||
"}";
|
||||
JSONObject jsonObject = JSONObject.parseObject(sendJson);
|
||||
JSONArray elements = new JSONArray();
|
||||
JSONObject element = new JSONObject();
|
||||
element.put("tag","action");
|
||||
element.put("layout","bisected");
|
||||
|
||||
JSONArray actions = new JSONArray();
|
||||
//组装推送过去的点击按钮
|
||||
for (int i=0; i<5; i++){
|
||||
|
||||
JSONObject buttonObject = new JSONObject();
|
||||
JSONObject text = new JSONObject();
|
||||
JSONObject value = new JSONObject();
|
||||
buttonObject.put("tag","button");
|
||||
|
||||
if(i==0){
|
||||
text.put("tag","plain_text");
|
||||
text.put("content","content1");
|
||||
|
||||
value.put("chosen","chosen1");
|
||||
}
|
||||
if(i==1){
|
||||
text.put("tag","plain_text");
|
||||
text.put("content","content2");
|
||||
|
||||
value.put("chosen","chosen2");
|
||||
}
|
||||
if(i==2){
|
||||
text.put("tag","plain_text");
|
||||
text.put("content","content3");
|
||||
|
||||
value.put("chosen","chosen3");
|
||||
}
|
||||
if(i==3){
|
||||
text.put("tag","plain_text");
|
||||
text.put("content","content4");
|
||||
|
||||
value.put("chosen","chosen4");
|
||||
}
|
||||
if(i==4){
|
||||
text.put("tag","plain_text");
|
||||
text.put("content","content5");
|
||||
|
||||
value.put("chosen","chosen5");
|
||||
}
|
||||
if(i==5){
|
||||
text.put("tag","plain_text");
|
||||
text.put("content","content6");
|
||||
|
||||
value.put("chosen","chosen6");
|
||||
}
|
||||
buttonObject.put("text",text);
|
||||
buttonObject.put("type","primary");
|
||||
buttonObject.put("value",value);
|
||||
actions.add(buttonObject);
|
||||
}
|
||||
element.put("actions",actions);
|
||||
|
||||
|
||||
elements.add(element);
|
||||
jsonObject.put("elements",elements);
|
||||
// 设置请求参数
|
||||
JSONObject paramsMap = new JSONObject();
|
||||
paramsMap.put("user_ids", userIds);
|
||||
paramsMap.put("msg_type", "interactive");
|
||||
paramsMap.put("card", jsonObject);
|
||||
|
||||
// 发送请求给飞书
|
||||
String response = null;
|
||||
try {
|
||||
response = HttpRequestUtil.getResponseOfPOST(batchSendMessageUrl, headerMap, paramsMap.toJSONString());
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
// 获取返回结果
|
||||
JSONObject tokenJson = JSONObject.parseObject(response);
|
||||
if(!tokenJson.get("code").toString().equals("0")) {
|
||||
log.error("请求出现异常:" + tokenJson.get("msg") + " " + tokenJson);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendKnowledgeBaseInfoCard(JSONObject jsonObject) {
|
||||
String[] userIds = jsonObject.getString("user_id").split(",");
|
||||
String clickStr = JSONObject.toJSONString(JSONObject.parseObject(JSONObject.toJSONString(jsonObject.get("action"))).get("value"));
|
||||
log.info("用户点击的数据: " + clickStr);
|
||||
|
||||
String sendJson = " ";
|
||||
|
||||
JSONObject clickJson = JSONObject.parseObject(clickStr);
|
||||
if(StringUtils.isNotEmpty(clickJson.getString("chosen"))){
|
||||
sendJson = clickJson.getString("chosen");
|
||||
}
|
||||
|
||||
String token = null;
|
||||
try {
|
||||
token = getTenantAccessToken();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
// 设置请求头
|
||||
Map<String, String> headerMap = new HashMap<>();
|
||||
headerMap.put("Authorization", "Bearer " + token);
|
||||
headerMap.put("Content-Type", "application/json; charset=utf-8");
|
||||
// 设置消息标题
|
||||
JSONObject zh_cn = new JSONObject();
|
||||
zh_cn.put("title", "title");
|
||||
// 设置消息内容
|
||||
// 第一行
|
||||
JSONObject contentOne = new JSONObject();
|
||||
contentOne.put("tag", "text");
|
||||
contentOne.put("text", sendJson);
|
||||
List<JSONObject> contentList = new ArrayList<>();
|
||||
contentList.add(contentOne);
|
||||
|
||||
List<List<JSONObject>> list = new ArrayList<>();
|
||||
list.add(contentList);
|
||||
zh_cn.put("content", list);
|
||||
|
||||
JSONObject post = new JSONObject();
|
||||
post.put("zh_cn", zh_cn);
|
||||
JSONObject contentObj = new JSONObject();
|
||||
contentObj.put("post", post);
|
||||
// 设置请求参数
|
||||
JSONObject paramsMap = new JSONObject();
|
||||
paramsMap.put("user_ids", userIds);
|
||||
paramsMap.put("msg_type", "post");
|
||||
paramsMap.put("content", contentObj);
|
||||
// 发送请求给飞书
|
||||
String response = null;
|
||||
try {
|
||||
response = HttpRequestUtil.getResponseOfPOST(batchSendMessageUrl, headerMap, paramsMap.toJSONString());
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
// 返回结果样例:{"code":0,"data":{"invalid_department_ids":[],"invalid_open_ids":[],"invalid_union_ids":[],"invalid_user_ids":[],"message_id":"bm-d595567e4f448fafe397bc916f0be646"},"msg":"ok"}
|
||||
// 获取返回结果
|
||||
JSONObject tokenJson = JSONObject.parseObject(response);
|
||||
if(!tokenJson.get("code").toString().equals("0")) {
|
||||
log.error("请求出现异常:" + tokenJson.get("msg") + " " + tokenJson);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+55
@@ -0,0 +1,55 @@
|
||||
package com.jero.modules.feishu.utils;
|
||||
|
||||
import javax.crypto.Cipher;
|
||||
import javax.crypto.spec.IvParameterSpec;
|
||||
import javax.crypto.spec.SecretKeySpec;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.util.Base64;
|
||||
|
||||
/**
|
||||
* 飞书解密工具类
|
||||
* @Author: wzj
|
||||
* @Date: 2022/8/4 10:52
|
||||
**/
|
||||
public class LarkDecryptUtil {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
LarkDecryptUtil d = new LarkDecryptUtil("test key");
|
||||
System.out.println(d.decrypt("P37w+VZImNgPEO1RBhJ6RtKl7n6zymIbEG1pReEzghk=")); //hello world
|
||||
}
|
||||
|
||||
private byte[] keyBs;
|
||||
public LarkDecryptUtil(String key) {
|
||||
MessageDigest digest = null;
|
||||
try {
|
||||
digest = MessageDigest.getInstance("SHA-256");
|
||||
} catch (NoSuchAlgorithmException e) {
|
||||
// won't happen
|
||||
}
|
||||
keyBs = digest.digest(key.getBytes(StandardCharsets.UTF_8));
|
||||
}
|
||||
|
||||
public String decrypt(String base64) throws Exception {
|
||||
byte[] decode = Base64.getDecoder().decode(base64);
|
||||
Cipher cipher = Cipher.getInstance("AES/CBC/NOPADDING");
|
||||
byte[] iv = new byte[16];
|
||||
System.arraycopy(decode, 0, iv, 0, 16);
|
||||
byte[] data = new byte[decode.length - 16];
|
||||
System.arraycopy(decode, 16, data, 0, data.length);
|
||||
cipher.init(Cipher.DECRYPT_MODE, new SecretKeySpec(keyBs, "AES"), new IvParameterSpec(iv));
|
||||
byte[] r = cipher.doFinal(data);
|
||||
if (r.length > 0) {
|
||||
int p = r.length - 1;
|
||||
for (; p >= 0 && r[p] <= 16; p--) {
|
||||
}
|
||||
if (p != r.length - 1) {
|
||||
byte[] rr = new byte[p + 1];
|
||||
System.arraycopy(r, 0, rr, 0, p + 1);
|
||||
r = rr;
|
||||
}
|
||||
}
|
||||
return new String(r, StandardCharsets.UTF_8);
|
||||
}
|
||||
}
|
||||
+170
@@ -0,0 +1,170 @@
|
||||
package com.jero.modules.problemKnowledgeBase.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.modules.problemKnowledgeBase.entity.CountryCardManageReleaseDetailEO;
|
||||
import com.jero.modules.problemKnowledgeBase.service.ICountryCardManageReleaseDetailEOService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 问题知识库-country_card-管理发布明细表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-08-04
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="问题知识库-country_card-管理发布明细表")
|
||||
@RestController
|
||||
@RequestMapping("/problemKnowledgeBase/countryCardManageReleaseDetailEO")
|
||||
@Slf4j
|
||||
public class CountryCardManageReleaseDetailEOController extends JeroController<CountryCardManageReleaseDetailEO, ICountryCardManageReleaseDetailEOService> {
|
||||
@Autowired
|
||||
private ICountryCardManageReleaseDetailEOService countryCardManageReleaseDetailEOService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param countryCardManageReleaseDetailEO
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "问题知识库-country_card-管理发布明细表-分页列表查询")
|
||||
@ApiOperation(value="问题知识库-country_card-管理发布明细表-分页列表查询", notes="问题知识库-country_card-管理发布明细表-分页列表查询")
|
||||
@GetMapping(value = "/page")
|
||||
public Result<?> queryPageList(CountryCardManageReleaseDetailEO countryCardManageReleaseDetailEO,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<CountryCardManageReleaseDetailEO> queryWrapper = QueryGenerator.initQueryWrapper(countryCardManageReleaseDetailEO, req.getParameterMap());
|
||||
Page<CountryCardManageReleaseDetailEO> page = new Page<CountryCardManageReleaseDetailEO>(pageNo, pageSize);
|
||||
IPage<CountryCardManageReleaseDetailEO> pageList = countryCardManageReleaseDetailEOService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "问题知识库-country_card-管理发布明细表-列表查询")
|
||||
@ApiOperation(value="问题知识库-country_card-管理发布明细表-列表查询", notes="问题知识库-country_card-管理发布明细表-列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<List<CountryCardManageReleaseDetailEO>> queryList() {
|
||||
List<CountryCardManageReleaseDetailEO> list = countryCardManageReleaseDetailEOService.queryList();
|
||||
return Result.OK(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param countryCardManageReleaseDetailEO
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "问题知识库-country_card-管理发布明细表-添加")
|
||||
@ApiOperation(value="问题知识库-country_card-管理发布明细表-添加", notes="问题知识库-country_card-管理发布明细表-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<?> add(@Validated @RequestBody CountryCardManageReleaseDetailEO countryCardManageReleaseDetailEO) {
|
||||
countryCardManageReleaseDetailEOService.add(countryCardManageReleaseDetailEO);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param countryCardManageReleaseDetailEO
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "问题知识库-country_card-管理发布明细表-编辑")
|
||||
@ApiOperation(value="问题知识库-country_card-管理发布明细表-编辑", notes="问题知识库-country_card-管理发布明细表-编辑")
|
||||
@PutMapping(value = "/edit")
|
||||
public Result<?> edit(@Validated @RequestBody CountryCardManageReleaseDetailEO countryCardManageReleaseDetailEO) {
|
||||
countryCardManageReleaseDetailEOService.editById(countryCardManageReleaseDetailEO);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "问题知识库-country_card-管理发布明细表-通过id删除")
|
||||
@ApiOperation(value="问题知识库-country_card-管理发布明细表-通过id删除", notes="问题知识库-country_card-管理发布明细表-通过id删除")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
|
||||
countryCardManageReleaseDetailEOService.deleteById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "问题知识库-country_card-管理发布明细表-批量删除")
|
||||
@ApiOperation(value="问题知识库-country_card-管理发布明细表-批量删除", notes="问题知识库-country_card-管理发布明细表-批量删除")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
this.countryCardManageReleaseDetailEOService.deleteByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "问题知识库-country_card-管理发布明细表-通过id查询")
|
||||
@ApiOperation(value="问题知识库-country_card-管理发布明细表-通过id查询", notes="问题知识库-country_card-管理发布明细表-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<?> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
CountryCardManageReleaseDetailEO countryCardManageReleaseDetailEO = countryCardManageReleaseDetailEOService.queryById(id);
|
||||
if(countryCardManageReleaseDetailEO==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(countryCardManageReleaseDetailEO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param countryCardManageReleaseDetailEO
|
||||
*/
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, CountryCardManageReleaseDetailEO countryCardManageReleaseDetailEO) {
|
||||
return super.exportXls(request, countryCardManageReleaseDetailEO, CountryCardManageReleaseDetailEO.class, "问题知识库-country_card-管理发布明细表");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, CountryCardManageReleaseDetailEO.class);
|
||||
}
|
||||
|
||||
}
|
||||
+170
@@ -0,0 +1,170 @@
|
||||
package com.jero.modules.problemKnowledgeBase.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.modules.problemKnowledgeBase.entity.CountryCardManageReleaseEO;
|
||||
import com.jero.modules.problemKnowledgeBase.service.ICountryCardManageReleaseEOService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 问题知识库-country_card-管理发布表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-08-04
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="问题知识库-country_card-管理发布表")
|
||||
@RestController
|
||||
@RequestMapping("/problemKnowledgeBase/countryCardManageReleaseEO")
|
||||
@Slf4j
|
||||
public class CountryCardManageReleaseEOController extends JeroController<CountryCardManageReleaseEO, ICountryCardManageReleaseEOService> {
|
||||
@Autowired
|
||||
private ICountryCardManageReleaseEOService countryCardManageReleaseEOService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param countryCardManageReleaseEO
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "问题知识库-country_card-管理发布表-分页列表查询")
|
||||
@ApiOperation(value="问题知识库-country_card-管理发布表-分页列表查询", notes="问题知识库-country_card-管理发布表-分页列表查询")
|
||||
@GetMapping(value = "/page")
|
||||
public Result<?> queryPageList(CountryCardManageReleaseEO countryCardManageReleaseEO,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<CountryCardManageReleaseEO> queryWrapper = QueryGenerator.initQueryWrapper(countryCardManageReleaseEO, req.getParameterMap());
|
||||
Page<CountryCardManageReleaseEO> page = new Page<CountryCardManageReleaseEO>(pageNo, pageSize);
|
||||
IPage<CountryCardManageReleaseEO> pageList = countryCardManageReleaseEOService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "问题知识库-country_card-管理发布表-列表查询")
|
||||
@ApiOperation(value="问题知识库-country_card-管理发布表-列表查询", notes="问题知识库-country_card-管理发布表-列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<List<CountryCardManageReleaseEO>> queryList() {
|
||||
List<CountryCardManageReleaseEO> list = countryCardManageReleaseEOService.queryList();
|
||||
return Result.OK(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param countryCardManageReleaseEO
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "问题知识库-country_card-管理发布表-添加")
|
||||
@ApiOperation(value="问题知识库-country_card-管理发布表-添加", notes="问题知识库-country_card-管理发布表-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<?> add(@Validated @RequestBody CountryCardManageReleaseEO countryCardManageReleaseEO) {
|
||||
countryCardManageReleaseEOService.add(countryCardManageReleaseEO);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param countryCardManageReleaseEO
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "问题知识库-country_card-管理发布表-编辑")
|
||||
@ApiOperation(value="问题知识库-country_card-管理发布表-编辑", notes="问题知识库-country_card-管理发布表-编辑")
|
||||
@PutMapping(value = "/edit")
|
||||
public Result<?> edit(@Validated @RequestBody CountryCardManageReleaseEO countryCardManageReleaseEO) {
|
||||
countryCardManageReleaseEOService.editById(countryCardManageReleaseEO);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "问题知识库-country_card-管理发布表-通过id删除")
|
||||
@ApiOperation(value="问题知识库-country_card-管理发布表-通过id删除", notes="问题知识库-country_card-管理发布表-通过id删除")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
|
||||
countryCardManageReleaseEOService.deleteById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "问题知识库-country_card-管理发布表-批量删除")
|
||||
@ApiOperation(value="问题知识库-country_card-管理发布表-批量删除", notes="问题知识库-country_card-管理发布表-批量删除")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
this.countryCardManageReleaseEOService.deleteByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "问题知识库-country_card-管理发布表-通过id查询")
|
||||
@ApiOperation(value="问题知识库-country_card-管理发布表-通过id查询", notes="问题知识库-country_card-管理发布表-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<?> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
CountryCardManageReleaseEO countryCardManageReleaseEO = countryCardManageReleaseEOService.queryById(id);
|
||||
if(countryCardManageReleaseEO==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(countryCardManageReleaseEO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param countryCardManageReleaseEO
|
||||
*/
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, CountryCardManageReleaseEO countryCardManageReleaseEO) {
|
||||
return super.exportXls(request, countryCardManageReleaseEO, CountryCardManageReleaseEO.class, "问题知识库-country_card-管理发布表");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, CountryCardManageReleaseEO.class);
|
||||
}
|
||||
|
||||
}
|
||||
+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);
|
||||
}
|
||||
|
||||
|
||||
+84
@@ -0,0 +1,84 @@
|
||||
package com.jero.modules.problemKnowledgeBase.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigDecimal;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import com.jero.common.aspect.annotation.Dict;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 问题知识库-country_card-管理发布明细表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-08-04
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("country_card_manage_release_detail")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="country_card_manage_release_detail对象", description="问题知识库-country_card-管理发布明细表")
|
||||
public class CountryCardManageReleaseDetailEO implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**主键*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "主键")
|
||||
private java.lang.String id;
|
||||
|
||||
/**创建人*/
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private java.lang.String createBy;
|
||||
|
||||
/**创建日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "创建日期")
|
||||
private java.util.Date createTime;
|
||||
|
||||
/**更新人*/
|
||||
@ApiModelProperty(value = "更新人")
|
||||
private java.lang.String updateBy;
|
||||
|
||||
/**更新日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "更新日期")
|
||||
private java.util.Date updateTime;
|
||||
|
||||
/**所属部门*/
|
||||
@ApiModelProperty(value = "所属部门")
|
||||
private java.lang.String sysOrgCode;
|
||||
|
||||
/**country_card管理发布表id*/
|
||||
@Excel(name = "country_card管理发布表id", width = 15)
|
||||
@ApiModelProperty(value = "country_card管理发布表id")
|
||||
private java.lang.String countryCardManageReleaseId;
|
||||
|
||||
/**模板表id*/
|
||||
@Excel(name = "模板表id", width = 15)
|
||||
@ApiModelProperty(value = "模板表id")
|
||||
private java.lang.String countryCardTempId;
|
||||
|
||||
/**描述*/
|
||||
@Excel(name = "描述", width = 15)
|
||||
@ApiModelProperty(value = "描述")
|
||||
private java.lang.String description;
|
||||
|
||||
/**内容*/
|
||||
@Excel(name = "内容", width = 15)
|
||||
@ApiModelProperty(value = "内容")
|
||||
private java.lang.String content;
|
||||
|
||||
}
|
||||
+74
@@ -0,0 +1,74 @@
|
||||
package com.jero.modules.problemKnowledgeBase.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigDecimal;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import com.jero.common.aspect.annotation.Dict;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 问题知识库-country_card-管理发布表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-08-04
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("country_card_manage_release")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="country_card_manage_release对象", description="问题知识库-country_card-管理发布表")
|
||||
public class CountryCardManageReleaseEO implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**主键*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "主键")
|
||||
private java.lang.String id;
|
||||
|
||||
/**创建人*/
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private java.lang.String createBy;
|
||||
|
||||
/**创建日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "创建日期")
|
||||
private java.util.Date createTime;
|
||||
|
||||
/**更新人*/
|
||||
@ApiModelProperty(value = "更新人")
|
||||
private java.lang.String updateBy;
|
||||
|
||||
/**更新日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "更新日期")
|
||||
private java.util.Date updateTime;
|
||||
|
||||
/**所属部门*/
|
||||
@ApiModelProperty(value = "所属部门")
|
||||
private java.lang.String sysOrgCode;
|
||||
|
||||
/**适用市场*/
|
||||
@Excel(name = "适用市场", width = 15)
|
||||
@ApiModelProperty(value = "适用市场")
|
||||
private java.lang.String applyMarket;
|
||||
|
||||
/**发布状态*/
|
||||
@Excel(name = "发布状态", width = 15)
|
||||
@ApiModelProperty(value = "发布状态")
|
||||
private java.lang.String releaseStatus;
|
||||
|
||||
}
|
||||
+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;
|
||||
}
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package com.jero.modules.problemKnowledgeBase.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.jero.modules.problemKnowledgeBase.entity.CountryCardManageReleaseDetailEO;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @Description: 问题知识库-country_card-管理发布明细表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-08-04
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface CountryCardManageReleaseDetailEOMapper extends BaseMapper<CountryCardManageReleaseDetailEO> {
|
||||
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package com.jero.modules.problemKnowledgeBase.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.jero.modules.problemKnowledgeBase.entity.CountryCardManageReleaseEO;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @Description: 问题知识库-country_card-管理发布表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-08-04
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface CountryCardManageReleaseEOMapper extends BaseMapper<CountryCardManageReleaseEO> {
|
||||
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
<?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.jero.modules.problemKnowledgeBase.mapper.CountryCardManageReleaseDetailEOMapper">
|
||||
<resultMap id="CountryCardManageReleaseDetailEOResultMap" type="com.jero.modules.problemKnowledgeBase.entity.CountryCardManageReleaseDetailEO">
|
||||
<id column="id" property="id" />
|
||||
<result column="create_by" property="createBy" />
|
||||
<result column="create_time" property="createTime" />
|
||||
<result column="update_by" property="updateBy" />
|
||||
<result column="update_time" property="updateTime" />
|
||||
<result column="sys_org_code" property="sysOrgCode" />
|
||||
<result column="country_card_manage_release_id" property="countryCardManageReleaseId" />
|
||||
<result column="country_card_temp_id" property="countryCardTempId" />
|
||||
<result column="description" property="description" />
|
||||
<result column="content" property="content" />
|
||||
</resultMap>
|
||||
</mapper>
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
<?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.jero.modules.problemKnowledgeBase.mapper.CountryCardManageReleaseEOMapper">
|
||||
<resultMap id="CountryCardManageReleaseEOResultMap" type="com.jero.modules.problemKnowledgeBase.entity.CountryCardManageReleaseEO">
|
||||
<id column="id" property="id" />
|
||||
<result column="create_by" property="createBy" />
|
||||
<result column="create_time" property="createTime" />
|
||||
<result column="update_by" property="updateBy" />
|
||||
<result column="update_time" property="updateTime" />
|
||||
<result column="sys_org_code" property="sysOrgCode" />
|
||||
<result column="apply_market" property="applyMarket" />
|
||||
<result column="release_status" property="releaseStatus" />
|
||||
</resultMap>
|
||||
</mapper>
|
||||
+61
@@ -0,0 +1,61 @@
|
||||
package com.jero.modules.problemKnowledgeBase.service;
|
||||
|
||||
import com.jero.modules.problemKnowledgeBase.entity.CountryCardManageReleaseDetailEO;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 问题知识库-country_card-管理发布明细表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-08-04
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface ICountryCardManageReleaseDetailEOService extends IService<CountryCardManageReleaseDetailEO> {
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param countryCardManageReleaseDetailEO
|
||||
* @return
|
||||
*/
|
||||
void add(CountryCardManageReleaseDetailEO countryCardManageReleaseDetailEO);
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param countryCardManageReleaseDetailEO
|
||||
* @return
|
||||
*/
|
||||
void editById(CountryCardManageReleaseDetailEO countryCardManageReleaseDetailEO);
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
void deleteById(String id);
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
void deleteByIds(List<String> ids);
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
CountryCardManageReleaseDetailEO queryById(String id);
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<CountryCardManageReleaseDetailEO> queryList();
|
||||
}
|
||||
+61
@@ -0,0 +1,61 @@
|
||||
package com.jero.modules.problemKnowledgeBase.service;
|
||||
|
||||
import com.jero.modules.problemKnowledgeBase.entity.CountryCardManageReleaseEO;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 问题知识库-country_card-管理发布表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-08-04
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface ICountryCardManageReleaseEOService extends IService<CountryCardManageReleaseEO> {
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param countryCardManageReleaseEO
|
||||
* @return
|
||||
*/
|
||||
void add(CountryCardManageReleaseEO countryCardManageReleaseEO);
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param countryCardManageReleaseEO
|
||||
* @return
|
||||
*/
|
||||
void editById(CountryCardManageReleaseEO countryCardManageReleaseEO);
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
void deleteById(String id);
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
void deleteByIds(List<String> ids);
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
CountryCardManageReleaseEO queryById(String id);
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<CountryCardManageReleaseEO> queryList();
|
||||
}
|
||||
+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);
|
||||
}
|
||||
|
||||
+92
@@ -0,0 +1,92 @@
|
||||
package com.jero.modules.problemKnowledgeBase.service.impl;
|
||||
|
||||
import com.jero.modules.problemKnowledgeBase.entity.CountryCardManageReleaseDetailEO;
|
||||
import com.jero.modules.problemKnowledgeBase.mapper.CountryCardManageReleaseDetailEOMapper;
|
||||
import com.jero.modules.problemKnowledgeBase.service.ICountryCardManageReleaseDetailEOService;
|
||||
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-管理发布明细表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-08-04
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
@Transactional(value = "transactionManager", readOnly = false, propagation = Propagation.REQUIRED, rollbackFor = Throwable.class)
|
||||
public class CountryCardManageReleaseDetailEOServiceImpl extends ServiceImpl<CountryCardManageReleaseDetailEOMapper, CountryCardManageReleaseDetailEO> implements ICountryCardManageReleaseDetailEOService {
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param countryCardManageReleaseDetailEO
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void add(CountryCardManageReleaseDetailEO countryCardManageReleaseDetailEO) {
|
||||
Date now = new Date();
|
||||
countryCardManageReleaseDetailEO.setCreateTime(now);
|
||||
countryCardManageReleaseDetailEO.setUpdateTime(now);
|
||||
save(countryCardManageReleaseDetailEO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param countryCardManageReleaseDetailEO
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void editById(CountryCardManageReleaseDetailEO countryCardManageReleaseDetailEO) {
|
||||
Date now = new Date();
|
||||
countryCardManageReleaseDetailEO.setUpdateTime(now);
|
||||
saveOrUpdate(countryCardManageReleaseDetailEO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void deleteById(String id) {
|
||||
removeById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void deleteByIds(List<String> ids) {
|
||||
removeByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public CountryCardManageReleaseDetailEO queryById(String id) {
|
||||
return getById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<CountryCardManageReleaseDetailEO> queryList() {
|
||||
return list();
|
||||
}
|
||||
}
|
||||
+92
@@ -0,0 +1,92 @@
|
||||
package com.jero.modules.problemKnowledgeBase.service.impl;
|
||||
|
||||
import com.jero.modules.problemKnowledgeBase.entity.CountryCardManageReleaseEO;
|
||||
import com.jero.modules.problemKnowledgeBase.mapper.CountryCardManageReleaseEOMapper;
|
||||
import com.jero.modules.problemKnowledgeBase.service.ICountryCardManageReleaseEOService;
|
||||
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-管理发布表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-08-04
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
@Transactional(value = "transactionManager", readOnly = false, propagation = Propagation.REQUIRED, rollbackFor = Throwable.class)
|
||||
public class CountryCardManageReleaseEOServiceImpl extends ServiceImpl<CountryCardManageReleaseEOMapper, CountryCardManageReleaseEO> implements ICountryCardManageReleaseEOService {
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param countryCardManageReleaseEO
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void add(CountryCardManageReleaseEO countryCardManageReleaseEO) {
|
||||
Date now = new Date();
|
||||
countryCardManageReleaseEO.setCreateTime(now);
|
||||
countryCardManageReleaseEO.setUpdateTime(now);
|
||||
save(countryCardManageReleaseEO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param countryCardManageReleaseEO
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void editById(CountryCardManageReleaseEO countryCardManageReleaseEO) {
|
||||
Date now = new Date();
|
||||
countryCardManageReleaseEO.setUpdateTime(now);
|
||||
saveOrUpdate(countryCardManageReleaseEO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void deleteById(String id) {
|
||||
removeById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void deleteByIds(List<String> ids) {
|
||||
removeByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public CountryCardManageReleaseEO queryById(String id) {
|
||||
return getById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<CountryCardManageReleaseEO> queryList() {
|
||||
return list();
|
||||
}
|
||||
}
|
||||
+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 {
|
||||
|
||||
/**
|
||||
|
||||
+15
-1
@@ -116,6 +116,8 @@ public class ProjectTaskPlanningServiceImpl extends ServiceImpl<ProjectTaskPlann
|
||||
Date trueNow = cal1.getTime();
|
||||
for (ProjectTaskPlanning projectTaskPlanning : list) {
|
||||
List<TimeNodeVO> timeNodeVOS = new ArrayList<>();
|
||||
|
||||
// 清单确认
|
||||
if(ObjectUtils.isNotEmpty(projectTaskPlanning.getListConfirmation())) {
|
||||
listConfirmationVO = new TimeNodeVO();
|
||||
|
||||
@@ -137,6 +139,7 @@ public class ProjectTaskPlanningServiceImpl extends ServiceImpl<ProjectTaskPlann
|
||||
timeNodeVOS.add(listConfirmationVO);
|
||||
}
|
||||
|
||||
// 任务确认
|
||||
if(ObjectUtils.isNotEmpty(projectTaskPlanning.getLegalTaskConfirmation())) {
|
||||
TimeNodeVO legalTaskConfirmationVO = new TimeNodeVO();
|
||||
|
||||
@@ -158,6 +161,7 @@ public class ProjectTaskPlanningServiceImpl extends ServiceImpl<ProjectTaskPlann
|
||||
timeNodeVOS.add(legalTaskConfirmationVO);
|
||||
}
|
||||
|
||||
// 设计符合性
|
||||
if(ObjectUtils.isNotEmpty(projectTaskPlanning.getDesignDeadline())) {
|
||||
TimeNodeVO designDeadlineVO = new TimeNodeVO();
|
||||
|
||||
@@ -179,6 +183,7 @@ public class ProjectTaskPlanningServiceImpl extends ServiceImpl<ProjectTaskPlann
|
||||
timeNodeVOS.add(designDeadlineVO);
|
||||
}
|
||||
|
||||
// 摸底试验结束
|
||||
if(ObjectUtils.isNotEmpty(projectTaskPlanning.getPrehomoDeadline())) {
|
||||
TimeNodeVO prehomoDeadlineVO = new TimeNodeVO();
|
||||
|
||||
@@ -200,6 +205,7 @@ public class ProjectTaskPlanningServiceImpl extends ServiceImpl<ProjectTaskPlann
|
||||
timeNodeVOS.add(prehomoDeadlineVO);
|
||||
}
|
||||
|
||||
// 认证试验结束
|
||||
if(ObjectUtils.isNotEmpty(projectTaskPlanning.getAttestationStartTime())) {
|
||||
TimeNodeVO attestationStartTimeVO = new TimeNodeVO();
|
||||
|
||||
@@ -220,6 +226,8 @@ public class ProjectTaskPlanningServiceImpl extends ServiceImpl<ProjectTaskPlann
|
||||
attestationStartTimeVO.setProjectId(projectTaskPlanning.getProjectId());
|
||||
timeNodeVOS.add(attestationStartTimeVO);
|
||||
}
|
||||
|
||||
// 认证批准
|
||||
if(ObjectUtils.isNotEmpty(projectTaskPlanning.getAttestationEndTime())) {
|
||||
TimeNodeVO attestationEndTimeVO = new TimeNodeVO();
|
||||
|
||||
@@ -241,6 +249,7 @@ public class ProjectTaskPlanningServiceImpl extends ServiceImpl<ProjectTaskPlann
|
||||
timeNodeVOS.add(attestationEndTimeVO);
|
||||
}
|
||||
|
||||
// 验证符合性
|
||||
if(ObjectUtils.isNotEmpty(projectTaskPlanning.getVerifyDeadline())) {
|
||||
TimeNodeVO verifyDeadlineVO = new TimeNodeVO();
|
||||
|
||||
@@ -261,8 +270,13 @@ public class ProjectTaskPlanningServiceImpl extends ServiceImpl<ProjectTaskPlann
|
||||
verifyDeadlineVO.setProjectId(projectTaskPlanning.getProjectId());
|
||||
timeNodeVOS.add(verifyDeadlineVO);
|
||||
}
|
||||
|
||||
// 排序
|
||||
Collections.sort(timeNodeVOS, listConfirmationVO);
|
||||
// Collections.sort(timeNodeVOS, listConfirmationVO);
|
||||
timeNodeVOS = timeNodeVOS.stream()
|
||||
.sorted(Comparator.comparing(TimeNodeVO::getTime))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
//设置在已过时,和未发生之间的数据的状态为进行中
|
||||
for(int i=0;i<timeNodeVOS.size();i++){
|
||||
if(i == timeNodeVOS.size()-1){
|
||||
|
||||
+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