Compare commits

...

2 Commits

12 changed files with 690 additions and 13 deletions

View File

@ -131,6 +131,12 @@
<version>4.0.0</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
</dependency>
</dependencies>

View File

@ -0,0 +1,34 @@
package com.api.test.aiyh.controller;
import aiyh.utils.ApiResult;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.core.MediaType;
import java.io.IOException;
/**
* <h1>ceshi servlet</h1>
*
* <p>create: 2023/7/18 10:36</p>
*
* @author youHong.ai
*/
@WebServlet("/test/servlet/v1")
public class TestServlet extends HttpServlet {
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse res) throws IOException {
String success = ApiResult.success("成功!");
res.setContentType(MediaType.APPLICATION_JSON + ";charset=utf-8");
res.getWriter().write(success);
}
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
super.doPost(req, res);
}
}

View File

@ -0,0 +1,40 @@
package com.api.youhong.ai.guojun.sso.controller;
import aiyh.utils.Util;
import com.sun.jersey.api.view.Viewable;
import org.apache.log4j.Logger;
import weaver.integration.util.SessionUtil;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.Context;
/**
* <h1>poc</h1>
*
* <p>create: 2023/7/18 11:03</p>
*
* @author youHong.ai
*/
@Path("aiyh/guojun/sso")
public class SsoLoginAuthController {
private final Logger log = Util.getLogger();
@GET
@Path("/auth")
public Viewable authSso(@Context HttpServletRequest request, @Context HttpServletResponse response,
@QueryParam("account") String account,
@QueryParam("redirectChannel") String redirectChannel) {
try {
String userId = Util.getCusConfigValue(account);
SessionUtil.createSession(userId, request, response);
response.sendRedirect(redirectChannel);
} catch (Exception e) {
log.error("认证失败:" + Util.getErrString(e));
}
return null;
}
}

View File

@ -0,0 +1,42 @@
package com.api.youhong.ai.guojun.todolist.controller;
import aiyh.utils.ApiResult;
import com.api.youhong.ai.guojun.todolist.service.WorkflowTaskService;
import weaver.hrm.HrmUserVarify;
import weaver.hrm.User;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
/**
* <h1></h1>
*
* <p>create: 2023/7/18 11:23</p>
*
* @author youHong.ai
*/
@Path("/aiyh/guojun/workflow-task")
public class WorkflowTaskController {
private final WorkflowTaskService service = new WorkflowTaskService();
@Path("/todo-list")
@GET
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public String getTodoList(@Context HttpServletRequest request, @Context HttpServletResponse response) {
try {
User user = HrmUserVarify.getUser(request, response);
return ApiResult.success(service.getTodoList(user), 0, "成功");
} catch (Exception e) {
return ApiResult.error(-1, "system error");
}
}
}

View File

@ -0,0 +1,20 @@
package com.api.youhong.ai.guojun.todolist.mapper;
import aiyh.utils.annotation.recordset.SqlMapper;
import java.util.List;
import java.util.Map;
/**
* <h1></h1>
*
* <p>create: 2023/7/18 11:33</p>
*
* @author youHong.ai
*/
@SqlMapper
public interface WorkflowTaskMapper {
List<Map<String, Object>> selectTodoList();
}

View File

@ -0,0 +1,23 @@
package com.api.youhong.ai.guojun.todolist.service;
import aiyh.utils.Util;
import com.api.youhong.ai.guojun.todolist.mapper.WorkflowTaskMapper;
import weaver.hrm.User;
/**
* <h1></h1>
*
* <p>create: 2023/7/18 11:29</p>
*
* @author youHong.ai
*/
public class WorkflowTaskService {
private final WorkflowTaskMapper mapper = Util.getMapper(WorkflowTaskMapper.class);
public Object getTodoList(User user) {
return null;
}
}

View File

@ -44,6 +44,8 @@ public class ExamBtnControlController {
@Consumes(MediaType.APPLICATION_JSON)
public String isReadDoc(@Context HttpServletRequest request, @Context HttpServletResponse response,
@RequestBody Map<String, Object> params) {
try {
User user = HrmUserVarify.getUser(request, response);
return ApiResult.success(service.isReadDoc(user, params));

View File

@ -99,8 +99,8 @@ public class ExamBtnControlService {
}
// 循环对比
for (Map<String, Object> map : docInfo) {
String docId = Util.null2String(map.get(docIdField));
String time = Util.null2String(map.get(timeField));
String docId = Util.null2String(map.get("docId"));
String time = Util.null2String(map.get("readTime"));
if (!readDocTime.containsKey(docId)) {
return false;
}

View File

@ -0,0 +1,444 @@
package com.customization.youhong.pcn.datasmultilingual.impl;
import aiyh.utils.Util;
import aiyh.utils.tool.cn.hutool.core.collection.CollectionUtil;
import aiyh.utils.tool.cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.customization.youhong.pcn.datasmultilingual.MultilingualUtil;
import com.engine.common.constant.ParamConstant;
import com.engine.core.cfg.annotation.ServiceDynamicProxy;
import com.engine.core.impl.aop.AbstractServiceProxy;
import com.engine.workflow.entity.requestForm.AutoApproveEntity;
import com.engine.workflow.entity.requestForm.FieldValueBean;
import com.engine.workflow.service.RequestFormService;
import com.engine.workflow.service.impl.RequestFormServiceImpl;
import org.apache.log4j.Logger;
import weaver.hrm.HrmUserVarify;
import weaver.hrm.User;
import weaver.workflow.request.RequestManager;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.ConcurrentHashMap;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* <h1></h1>
*
* <p>create: 2023/7/17 15:24</p>
*
* @author youHong.ai
*/
@ServiceDynamicProxy(target = RequestFormServiceImpl.class, desc = "拦截解析多语言")
public class RequestFormServiceMultilingualImpl extends AbstractServiceProxy implements RequestFormService {
private final Logger log = Util.getLogger();
private final Map<String, Integer> ipLanguageMap = new ConcurrentHashMap<>();
private final String startPattern = "~`~`";
private final String endPattern = "`~`~";
@Override
public Map<String, Object> judgeCreateRight(HttpServletRequest request) {
return null;
}
@Override
public String loadForm(HttpServletRequest request) {
String o = (String) executeMethod(request);
log.info("加载主表数据信息:" + JSON.toJSONString(o));
try {
User user = HrmUserVarify.getUser(request, null);
String ipAddr = Util.getIpAddr(request);
ipLanguageMap.put(ipAddr, user.getUID());
JSONObject jsonObject = JSON.parseObject(o);
Object mainData = jsonObject.get("maindata");
if (Objects.isNull(mainData)) {
return o;
}
String mainDataStr = JSON.toJSONString(mainData);
// 构建正则表达式模式
String pattern = Pattern.quote(startPattern) + "(.*?)" + Pattern.quote(endPattern);
Pattern regex = Pattern.compile(pattern);
Matcher matcher = regex.matcher(mainDataStr);
List<String> valueList = new ArrayList<>();
while (matcher.find()) {
String multilingualStr = matcher.group(1);
Map<Integer, String> languageMap = MultilingualUtil.getLanguageMap(multilingualStr);
String value = languageMap.get(user.getLanguage());
valueList.add(value);
}
if (CollectionUtil.isEmpty(valueList)) {
return o;
}
for (String value : valueList) {
mainDataStr = mainDataStr.replaceFirst(pattern, value);
}
jsonObject.put("maindata", mainDataStr);
return jsonObject.toJSONString();
} catch (Exception e) {
log.error("解析转换失败:" + Util.getErrString(e));
}
return o;
}
@Override
public String loadPreView(Map<String, Object> map) {
return null;
}
@Override
public Map<String, Object> loadDetailData(Map<String, Object> map) {
Map<String, Object> o = (Map<String, Object>) executeMethod(map);
log.info("加载明细数据信息:" + JSON.toJSONString(o));
try {
String ip = Util.null2String(o.get(ParamConstant.PARAM_IP));
Integer languageId = ipLanguageMap.get(ip);
for (Map.Entry<String, Object> entry : o.entrySet()) {
Object value = entry.getValue();
if (value instanceof Map) {
Map<Object, Object> valueMap = (Map<Object, Object>) value;
for (Map.Entry<Object, Object> valueEntry : valueMap.entrySet()) {
Object filed = valueEntry.getValue();
if (filed instanceof FieldValueBean) {
FieldValueBean filedValueBean = (FieldValueBean) filed;
String filedValue = filedValueBean.getValue();
String multilingualStr = MultilingualUtil.findString(filedValue, startPattern, endPattern);
if (StrUtil.isNotBlank(multilingualStr)) {
Map<Integer, String> languageMap = MultilingualUtil.getLanguageMap(multilingualStr);
String parseValue = languageMap.get(languageId);
filedValueBean.setValue(parseValue);
}
}
}
}
}
} catch (Exception e) {
log.error("解析转换明细失败:" + Util.getErrString(e));
}
return o;
}
@Override
public Map<String, Object> saveDetailPaging(Map<String, Object> params) {
return null;
}
@Override
public Map<String, Object> copyCustomPageFile(String custompage) {
return null;
}
@Override
public Map<String, Object> updateReqInfo(HttpServletRequest request) {
return null;
}
@Override
public Map<String, Object> getLinkageResult(HttpServletRequest request, String type) {
return null;
}
@Override
public Map<String, Object> getRightMenu(HttpServletRequest httpServletRequest, Map<String, Object> map) {
return null;
}
@Override
public Map<String, Object> getStatusData(Map<String, Object> params) {
return null;
}
@Override
public Map<String, Object> getStatusCount(Map<String, Object> params) {
return null;
}
@Override
public Map<String, Object> getResourcesKey(Map<String, Object> params) {
return null;
}
@Override
public Map<String, Object> getModifyLog(HttpServletRequest request) {
return null;
}
@Override
public Map<String, Object> requestBatchSubmit(HttpServletRequest request) {
return null;
}
@Override
public Map<String, Object> judgeRejectWay(HttpServletRequest request) {
return null;
}
@Override
public Map<String, Object> getRejectOption(Map<String, Object> params) {
return null;
}
@Override
public Map<String, Object> requestSubmit(HttpServletRequest request) {
return null;
}
@Override
public Map<String, Object> forwardSubmit(HttpServletRequest request) {
return null;
}
@Override
public Map<String, Object> requestWithdraw(HttpServletRequest httpServletRequest) {
return null;
}
@Override
public Map<String, Object> remarkSubmit(HttpServletRequest request) {
return null;
}
@Override
public Map<String, Object> functionManage(HttpServletRequest request, HttpServletResponse response) {
return null;
}
@Override
public Map<String, Object> triggerSubWf(HttpServletRequest request) {
return null;
}
@Override
public Map<String, Object> uploadFile(HttpServletRequest request, HttpServletResponse response) {
return null;
}
@Override
public Map<String, Object> getFileFieldObj(Map<String, Object> params) {
return null;
}
@Override
public Map<String, Object> createWfCode(Map<String, Object> params) {
return null;
}
@Override
public Map<String, Object> getWfCodeFieldValue(Map<String, Object> params) {
return null;
}
@Override
public Map<String, Object> requestImport(Map<String, Object> params) {
return null;
}
@Override
public Map<String, Object> requestDetailImport(HttpServletRequest request) {
return null;
}
@Override
public Map<String, Object> chooseExceptionOperator(Map<String, Object> params) {
return null;
}
@Override
public Map<String, Object> overTimeSetting(HttpServletRequest request) {
return null;
}
@Override
public Map<String, Object> getPrintLogBase(Map<String, Object> params) {
return null;
}
@Override
public Map<String, Object> getPrintLogData(Map<String, Object> params) {
return null;
}
@Override
public Map<String, Object> freeFlowRead(Map<String, Object> params) {
return null;
}
@Override
public Map<String, Object> freeFlowSave(Map<String, Object> params) {
return null;
}
@Override
public Map<String, Object> editLockOper(Map<String, Object> params) {
return null;
}
@Override
public Map<String, Object> loadPrintTemplates(Map<String, Object> params) {
return null;
}
@Override
public Map<String, Object> doEvalExpression(Map<String, Object> params) {
return null;
}
@Override
public Map<String, Object> generatePrintLog(HttpServletRequest request) {
return null;
}
@Override
public Map<String, Object> getForwardDatas(Map<String, Object> params) {
return null;
}
@Override
public Map<String, Object> doBack(Map<String, Object> params) {
return null;
}
@Override
public Map<String, Object> getFormTab(Map<String, Object> params) {
return null;
}
@Override
public Map<String, Object> getSelectNextFlowCondition(Map<String, Object> params) {
return null;
}
@Override
public Map<String, Object> getSelectNextFlowNodes(Map<String, Object> params) {
return null;
}
@Override
public Map<String, Object> getRemindData(Map<String, Object> params) {
return null;
}
@Override
public Map<String, Object> judgeRequestIsValid(Map<String, Object> map) {
return null;
}
@Override
public Map<String, Object> takeBack(Map<String, Object> map) {
return null;
}
@Override
public Map<String, Object> getCustomOperation(Map<String, Object> map) {
return null;
}
@Override
public Map<String, Object> runCustomOperationAction(Map<String, Object> map) {
return null;
}
@Override
public Map<String, Object> JudgeAutoApprove(AutoApproveEntity autoApproveEntity) {
return null;
}
@Override
public Map<String, Object> delApproveLog(AutoApproveEntity autoApproveEntity) {
return null;
}
@Override
public Map<String, Object> verifyRequestForView(Map<String, Object> map) {
return null;
}
@Override
public Map<String, Object> doTakEnd(HttpServletRequest httpServletRequest, Map<String, Object> map) {
return null;
}
@Override
public Map<String, Object> importFieldLinkageCfg(Map<String, Object> map) {
return null;
}
@Override
public Map<String, Object> importFormulaCfg(Map<String, Object> map) {
return null;
}
@Override
public Map<String, Object> getDetailDataKeyId(Map<String, Object> map) {
return null;
}
@Override
public Map<String, Object> judgeWorkflowPenetrate(AutoApproveEntity autoApproveEntity, RequestManager requestManager) {
return null;
}
@Override
public Map<String, Object> getThPreviewUrl(Map<String, Object> map) {
return null;
}
@Override
public Map<String, Object> getThMouldList(Map<String, Object> map) {
return null;
}
@Override
public Map<String, Object> getDetailExpSet(Map<String, Object> map) {
return null;
}
@Override
public Map<String, Object> saveDetailExpSet(Map<String, Object> map) {
return null;
}
@Override
public Map<String, Object> exportFieldSet(Map<String, Object> map) {
return null;
}
@Override
public Map<String, Object> getNextNodeContent(Map<String, Object> map) {
return null;
}
@Override
public Map<String, Object> delRequestVerify(Map<String, Object> map) {
return null;
}
@Override
public Map<String, Object> getFreeNodeBrowserItem(Map<String, Object> map) {
return null;
}
@Override
public Map<String, Object> saveFreeNodeFormConfig(Map<String, Object> map) {
return null;
}
@Override
public Map<String, Object> conformCheck(Map<String, Object> map) {
return null;
}
@Override
public Map<String, Object> getDetailByRequestId(Map<String, Object> map) {
return null;
}
}

View File

@ -2,8 +2,6 @@ package builderpackage;
import aiyh.utils.excention.CustomerException;
import aiyh.utils.tool.cn.hutool.core.util.StrUtil;
import org.apache.commons.lang3.StringUtils;
import weaver.common.util.string.StringUtil;
import java.io.*;
import java.nio.charset.StandardCharsets;
@ -11,8 +9,8 @@ import java.util.*;
public class FileTreeBuilder {
public static final String DIRECTORY_TYPE = "文件夹";
public static final String FILE_TYPE = "文件";
public static final String DIRECTORY_TYPE = "folder";
public static final String FILE_TYPE = "file";
public static String targetPath;
@ -55,7 +53,7 @@ public class FileTreeBuilder {
zipDefaultName = properties.getProperty("zipDefaultName");
defaultDir = properties.getProperty("defaultDir");
cusDateFormat = properties.getProperty("cusDateFormat");
if(StrUtil.isBlank(cusDateFormat)){
if (StrUtil.isBlank(cusDateFormat)) {
cusDateFormat = "yyyyMMdd";
}
List<String> blacklistPrefixes = Arrays.asList(
@ -94,12 +92,11 @@ public class FileTreeBuilder {
private static FileInfo buildFileTreeRecursively(File directory, List<String> blacklistPrefixes) {
String filePath = directory.getAbsolutePath();
String fileName = directory.getName();
String fileType = DIRECTORY_TYPE;
boolean isSelected = false;
FileInfo fileInfo = new FileInfo();
fileInfo.setFilePath(filePath);
fileInfo.setFileName(fileName);
fileInfo.setFileType(fileType);
fileInfo.setFileType(DIRECTORY_TYPE);
fileInfo.setSelected(isSelected);
File[] files = directory.listFiles();
if (files != null) {
@ -115,12 +112,11 @@ public class FileTreeBuilder {
}
String childFilePath = file.getAbsolutePath();
String childFileName = file.getName();
String childFileType = FILE_TYPE;
boolean childIsSelected = false;
FileInfo childFileInfo = new FileInfo();
childFileInfo.setFilePath(childFilePath);
childFileInfo.setFileName(childFileName);
childFileInfo.setFileType(childFileType);
childFileInfo.setFileType(FILE_TYPE);
childFileInfo.setSelected(childIsSelected);
fileInfo.addChild(childFileInfo);
}

View File

@ -0,0 +1,68 @@
package youhong.ai.pcn.multilingual;
import basetest.BaseTest;
import org.junit.Test;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* <h1>ceshi</h1>
*
* <p>create: 2023/7/17 15:48</p>
*
* @author youHong.ai
*/
public class MultilingualTest extends BaseTest {
@Test
public void test() {
String mainDataStr = "{\n" +
" \"detail_1\":\n" +
" {\n" +
" \"indexnum\": 1,\n" +
" \"rowDatas\":\n" +
" {\n" +
" \"row_0\":\n" +
" {\n" +
" \"field24478\":\n" +
" {\n" +
" \"value\": \"A:\\nB:\\nC:\\nD:\"\n" +
" },\n" +
" \"field24632\":\n" +
" {\n" +
" \"value\": \"\"\n" +
" },\n" +
" \"field24631\":\n" +
" {\n" +
" \"value\": \"~`~`7当与商业伙伴、客户或第三方打交道时必须避免留下任何保时捷进行不寻常的业务实践或有针对性的措施以对业务决策施加不公平的影响的印象。因此如果向商业伙伴、客户或第三方提供/收取的利益不符合以下容许标准,或者发现给予方的动机不纯正时,则不得寻求或鼓励、且应拒绝从商业伙伴、客户或第三方那里获得或向其提供利益。\\n(1) 无(潜在)利益冲突:根据员工和直线经理的评估,以及经咨询集团或本地合规咨询平台(如适用),提供或收取利益不构成利益冲突。\\n(2) 不得给予好处:不得采取意在影响商业决策或获得对价、超出内部批准的促销或客户保留措施、无法被定义为一般商业惯例或显示不公平的动机的措施。\\n(3) 非关键时刻:不得于例如招标邀请时、合同谈判和谈判结束时或进行业务关系审计时(或于接近的时间)收取或提供利益。\\n(4) 适当价值利益应当有符合社交的适当需要即利益价值应当与接收者或提供者的生活水平相符或符合第三方的惯例即与行业水平相当或是在相关措施的背景下。且遵守礼物的价格限额每份礼物为800元人民币税前或每一项邀请为1600元人民币税前。提供或接受的邀请主办方代表应同样参加。\\n(5) 不得形成固定惯例利益不得由同一人定期地或频繁地收取或提供每个商业伙伴一年之内仅限一份总价值为800元人民币的礼物或两份总价值不超过800元人民币的礼物。\\n(6) 非私人场合:应在商业背景下,而非私人活动(例如生日或婚礼)的场合中提供或接受利益。\\n(7) 批准:在上述容许范围内向商业伙伴、客户或第三方收取或提供利益前需获得直线经理的批准。任何上述容许范围的例外情形及提供给或自政府工作人员收取的利益必须由合规咨询平台检查和批准。`~`8When dealing with Business Partners, Customers or Third Parties, it is essential to avoid any impression that PCN engages in unusual business practices or targeted measures to exercise unfair influence on business decisions. Therefore, benefits from / to Business Partners, Customers or Third Parties must not be solicited or encouraged but should be rejected, if these are not in accordance with the following admissibility criteria or if unfair motivation of the giver is identified.\\n(1) No (potential) conflict of interest: On the basis of the assessment by the employee and the Line Manager and, if applicable, after consultation with the central or local Compliance Helpdesk, granting or accepting the benefit does not cause a Conflict of Interest.\\n(2) No granting of advantages: No measures have been taken which are specifically intended to influence a business decision or in the expectation of consideration, which either exceed an internally approved sales promotion or customer retention measures, which cannot be regarded as customary business practice, or which reveals an unfair motivation.\\n(3) No critical timing: Benefits are not granted or accepted in connection with (or close in time to), for instance, an invitation of tender, contract negotiations and the conclusion of such negotiations or auditing the business relationship.\\n(4) Appropriate value: Benefits are socially appropriate (i.e. the value of the benefit is consistent with the standard of living of the recipient or giver) or customary among Third Parties (i.e. comparable in the industry or in the context of the measure) and stay within the value limits for gifts of RMB 800 (pre-tax) per gift or RMB 1600 (pre-tax) per invitation. An invitation should only be granted or accepted if the host's representative(s) participate in the event.\\n(5) Not applied practice: The benefits are not granted or accepted by the same person on a regular or frequent basis, i.e. only one gift with a total value of RMB 800 or two gifts up to a maximum limit of RMB 800 per Business Partner per year are permitted.\\n(6) No personal occasion: Benefits are granted or accepted in a business context and not on the occasion of a personal event such as a birthday or a wedding.\\n(7) Approval: Benefits to/from Business Partner(s) or from Customers or Third Parties within the above mentioned admissibility criteria must be checked and approved by the Line Manager. Exceptions to the above admissibility criteria and benefits to/from Public Official(s) must be checked and approved by the Compliance Helpdesk.`~`~\"\n" +
" },\n" +
" \"field24629\":\n" +
" {\n" +
" \"value\": \"当与商业伙伴、客户或第三方打交道时,必须避免留下任何保时捷进行不寻常的业务实践或有针对性的措施以对业务决策施加不公平的影响的印象。因此,如果向商业伙伴、客户或第三方提供/收取的利益不符合以下容许标准,或者发现给予方的动机不纯正时,则不得寻求或鼓励、且应拒绝从商业伙伴、客户或第三方那里获得或向其提供利益。\\n(1) 无(潜在)利益冲突:根据员工和直线经理的评估,以及经咨询集团或本地合规咨询平台(如适用),提供或收取利益不构成利益冲突。\\n(2) 不得给予好处:不得采取意在影响商业决策或获得对价、超出内部批准的促销或客户保留措施、无法被定义为一般商业惯例或显示不公平的动机的措施。\\n(3) 非关键时刻:不得于例如招标邀请时、合同谈判和谈判结束时或进行业务关系审计时(或于接近的时间)收取或提供利益。\\n(4) 适当价值利益应当有符合社交的适当需要即利益价值应当与接收者或提供者的生活水平相符或符合第三方的惯例即与行业水平相当或是在相关措施的背景下。且遵守礼物的价格限额每份礼物为800元人民币税前或每一项邀请为1600元人民币税前。提供或接受的邀请主办方代表应同样参加。\\n(5) 不得形成固定惯例利益不得由同一人定期地或频繁地收取或提供每个商业伙伴一年之内仅限一份总价值为800元人民币的礼物或两份总价值不超过800元人民币的礼物。\\n(6) 非私人场合:应在商业背景下,而非私人活动(例如生日或婚礼)的场合中提供或接受利益。\\n(7) 批准:在上述容许范围内向商业伙伴、客户或第三方收取或提供利益前需获得直线经理的批准。任何上述容许范围的例外情形及提供给或自政府工作人员收取的利益必须由合规咨询平台检查和批准。\"\n" +
" },\n" +
" \"field24631\":\n" +
" {\n" +
" \"value\": \"~`~`7当与商业伙伴、客户或第三方打交道时益不符合以下容许标准或者发现给予方益冲突根据员工和直线经理的评估以及得给予好处近的时间收取或提供利益。\\n(4) 适当价值:利益应当有符合社交的适当需要(即利益价值应当与接收者或提供者的生活水平相符),或符合第三方的惯例(即与行业水平相当或是在相关措施的背景下)。且遵守礼物的价格限额:每份礼物为台检查和批准。`~`8When dealing with Business Partners, Customers or Third Parties, it is essential to avoid any impression that PCN engages in unusual business practices or targeted measures to exercise unfair influence on business decisions. Therefore, benefits from / to Business Partners, Customers or Thirdmer retention measures, which cannot be regarded as customary business practice, or which reveals an unfair motivation.\\n(3) No critical timing: Benefits are not granted or accepted in connection with (or close in time to), for instance, an invitation of tender, contract negotiations and the conclusion of such negotiations or auditing the business relationship.\\n(4) Appropriate value: Benefits are socially appropriate (i.e. the value of the benefit is consistent with the standard of living of the recipient or giver) or customary among Third Parties (i.e. comparable in the industry or in the context of the measure) and stay within the value limits for gifts of RMB 800 (pre-tax) per gift or RMB 1600 (pre-tax) per invitation. An invitation should only be granted or accepted if the host's representative(s) participate in the event.\\n(5) Not applied practice: The benefits are not granted or accepted by the same person on a regular or frequent basis, i.e. only one gift with a total value of RMB 800 or two gifts up to a maximum limit of RMB 800 per Business Partner per year are permitted.\\n(6) No ps to/from Public Official(s) must be checked and approved by the Compliance Helpdesk.`~`~\"\n" +
" },\n" +
" \"keyid\": 65,\n" +
" \"field24476\":\n" +
" {\n" +
" \"value\": \"When dealing with Business Partners, Customers or Third Parties, it is essential to avoid any impression that PCN engages in unusual business practices or targeted measures to exercise unfair influence on business decisions. Therefore, benefits from / to Business Partners, Customers or Third Parties must not be solicited or encouraged but should be rejected, if these are not in accordance with the following admissibility criteria or if unfair motivation of the giver is identified.\\n(1) No (potential) conflict of interest: On the basis of the assessment by the employee and the Line Manager and, if applicable, after consultation with the central or local Compliance Helpdesk, granting or accepting the benefit does not cause a Conflict of Interest.\\n(2) No granting of advantages: No measures have been taken which are specifically intended to influence a business decision or in the expectation of consideration, which either exceed an internally approved sales promotion or customer retention measures, which cannot be regarded as customary business practice, or which reveals an unfair motivation.\\n(3) No critical timing: Benefits are not granted or accepted in connection with (or close in time to), for instance, an invitation of tender, contract negotiations and the conclusion of such negotiations or auditing the business relationship.\\n(4) Appropriate value: Benefits are socially appropriate (i.e. the value of the benefit is consistent with the standard of living of the recipient or giver) or customary among Third Parties (i.e. comparable in the industry or in the context of the measure) and stay within the value limits for gifts of RMB 800 (pre-tax) per gift or RMB 1600 (pre-tax) per invitation. An invitation should only be granted or accepted if the host's representative(s) participate in the event.\\n(5) Not applied practice: The benefits are not granted or accepted by the same person on a regular or frequent basis, i.e. only one gift with a total value of RMB 800 or two gifts up to a maximum limit of RMB 800 per Business Partner per year are permitted.\\n(6) No personal occasion: Benefits are granted or accepted in a business context and not on the occasion of a personal event such as a birthday or a wedding.\\n(7) Approval: Benefits to/from Business Partner(s) or from Customers or Third Parties within the above mentioned admissibility criteria must be checked and approved by the Line Manager. Exceptions to the above admissibility criteria and benefits to/from Public Official(s) must be checked and approved by the Compliance Helpdesk.\"\n" +
" }\n" +
" }\n" +
" }\n" +
" }\n" +
"}";
String startPattern = "~`~`";
String endPattern = "`~`~";
// 构建正则表达式模式
String pattern = Pattern.quote(startPattern) + "(.*?)" + Pattern.quote(endPattern);
Pattern regex = Pattern.compile(pattern);
Matcher matcher = regex.matcher(mainDataStr);
while (matcher.find()) {
System.out.println(matcher.group(1));
}
}
}

View File

@ -37,4 +37,6 @@ public class StringFinder {
System.out.println(remainingString);
}
}
}