修改合同逻辑前

dev
IT-xiaoXiong 2022-02-17 10:43:48 +08:00
parent df192939ce
commit 138947dc15
24 changed files with 750 additions and 525 deletions

View File

@ -63,10 +63,10 @@ public class Util extends weaver.general.Util {
private static final UtilService utilService = new UtilService(); private static final UtilService utilService = new UtilService();
private static final RecordSet rs = new RecordSet(); private static final RecordSet rs = new RecordSet();
private static final String LOGGER_NAME = "cusAYH"; private static final String LOGGER_NAME = "cusAYH";
static ToolUtil toolUtil = new ToolUtil();
private static final RecordsetUtil recordsetUtil = new RecordsetUtil(); private static final RecordsetUtil recordsetUtil = new RecordsetUtil();
private static final UtilMapper mapper = getMapper(UtilMapper.class); private static final UtilMapper mapper = getMapper(UtilMapper.class);
private static final LoggerUtil loggerUtil = new LoggerUtil(); private static final LoggerUtil loggerUtil = new LoggerUtil();
static ToolUtil toolUtil = new ToolUtil();
private static volatile Logger log = null; private static volatile Logger log = null;
/** /**
@ -1806,20 +1806,13 @@ public class Util extends weaver.general.Util {
public static String getErrString(Throwable throwable) { public static String getErrString(Throwable throwable) {
StringWriter stringWriter = new StringWriter(); StringWriter stringWriter = new StringWriter();
throwable.printStackTrace(new PrintWriter(stringWriter, true)); throwable.printStackTrace(new PrintWriter(stringWriter, true));
new Thread(() -> { String errStr = stringWriter.getBuffer().toString();
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
} finally {
try { try {
stringWriter.close(); stringWriter.close();
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
} }
} return errStr;
});
return stringWriter.getBuffer().toString();
} }
/** /**

View File

@ -1,12 +0,0 @@
package aiyh.utils.apirequest;
/**
* <p></p>
* <p>create 2022/1/22 0022 20:15</p>
*
* @author EBU7-dev1-ayh
*/
public class ApiRequestUtil {
}

View File

@ -12,7 +12,25 @@ import aiyh.utils.apirequest.pojo.ApiRequestMain;
* @author EBU7-dev1-ayh * @author EBU7-dev1-ayh
*/ */
/*
* 2
*
*
* ---->
*
*
* iPhone12
* \ps4
*
*
*
*
*
*
* 29%
*
*
*/
public class ModelDataHandler implements IDataSourceHandler { public class ModelDataHandler implements IDataSourceHandler {
@Override @Override
public ParamConfigInfo parseDataSource(ApiRequestData apiRequestData) { public ParamConfigInfo parseDataSource(ApiRequestData apiRequestData) {

View File

@ -27,7 +27,22 @@ import java.util.Map;
* @author EBU7-dev1-ayh * @author EBU7-dev1-ayh
*/ */
/*
* 3
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
public class WorkflowDataHandler implements IDataSourceHandler { public class WorkflowDataHandler implements IDataSourceHandler {
private final DataSourceMapper mapper = Util.getMapper(DataSourceMapper.class); private final DataSourceMapper mapper = Util.getMapper(DataSourceMapper.class);
@ -56,6 +71,7 @@ public class WorkflowDataHandler implements IDataSourceHandler {
/** /**
* *
*
* @param apiRequestData api * @param apiRequestData api
* @param mainData * @param mainData
* @return api * @return api
@ -65,6 +81,10 @@ public class WorkflowDataHandler implements IDataSourceHandler {
List<Map<String, Object>> detailList = mapper.selectDetailData(requestDetailTableName, String.valueOf(mainData.get("id"))); List<Map<String, Object>> detailList = mapper.selectDetailData(requestDetailTableName, String.valueOf(mainData.get("id")));
// 获取api请求配置明细表配置信息 // 获取api请求配置明细表配置信息
List<ApiRequestParamData> paramDetailList = apiRequestData.getParamDetailList(); List<ApiRequestParamData> paramDetailList = apiRequestData.getParamDetailList();
// 树形结构转换
paramDetailList = Util.listToTree(paramDetailList, ApiRequestParamData::getLineNum, ApiRequestParamData::getParentLine,
ApiRequestParamData::getChildList, ApiRequestParamData::setChildList,
parentLine -> parentLine == null || parentLine <= 0);
// 创建参数处理对象 // 创建参数处理对象
ParamValueRuleHandlerFactory paramHandlerFactory = factory.createParamHandlerFactory(ParamValueRuleHandlerFactory.class); ParamValueRuleHandlerFactory paramHandlerFactory = factory.createParamHandlerFactory(ParamValueRuleHandlerFactory.class);
ParamTypeHandlerFactory paramTypeHandlerFactory = factory.createParamHandlerFactory(ParamTypeHandlerFactory.class); ParamTypeHandlerFactory paramTypeHandlerFactory = factory.createParamHandlerFactory(ParamTypeHandlerFactory.class);
@ -78,12 +98,18 @@ public class WorkflowDataHandler implements IDataSourceHandler {
dataMap.put("detail", detail); dataMap.put("detail", detail);
List<ParamInfo> paramInfoList = new ArrayList<>(); List<ParamInfo> paramInfoList = new ArrayList<>();
for (ApiRequestParamData paramDetail : paramDetailList) { for (ApiRequestParamData paramDetail : paramDetailList) {
// 获取值转换类型对应的枚举对象
ParamValueRuleEnum paramValueRuleEnum = ParamValueRuleEnum.get(paramDetail.getValueRule()); ParamValueRuleEnum paramValueRuleEnum = ParamValueRuleEnum.get(paramDetail.getValueRule());
ParamTypeEnum paramTypeEnum = ParamTypeEnum.get(paramDetail.getParamType()); ParamTypeEnum paramTypeEnum = ParamTypeEnum.get(paramDetail.getParamType());
// 通过工厂获取对应的参数处理对象
IParamValueRuleHandler paramHandler = paramHandlerFactory.createParamHandler(paramValueRuleEnum); IParamValueRuleHandler paramHandler = paramHandlerFactory.createParamHandler(paramValueRuleEnum);
IParamTypeHandler paramTypeHandler = paramTypeHandlerFactory.createParamHandler(paramTypeEnum); IParamTypeHandler paramTypeHandler = paramTypeHandlerFactory.createParamHandler(paramTypeEnum);
Object value = paramTypeHandler.getValue(paramDetail, paramHandler,dataMap); // 处理参数值类型
Object value = paramTypeHandler.getValue(paramDetail, paramHandler, dataMap);
// 参数类型转换
ParamInfo paramInfo = BeanMapper.INSTANCE.apiRequestData2ParamInfo(paramDetail); ParamInfo paramInfo = BeanMapper.INSTANCE.apiRequestData2ParamInfo(paramDetail);
// 设置子结点
paramInfo.setChildList(paramDetail.getParamInfoList());
paramInfo.setParamValue(value); paramInfo.setParamValue(value);
paramInfoList.add(paramInfo); paramInfoList.add(paramInfo);
} }

View File

@ -1,9 +1,12 @@
package aiyh.utils.apirequest.core.typehandler.paramtype; package aiyh.utils.apirequest.core.typehandler.paramtype;
import aiyh.utils.Util;
import aiyh.utils.apirequest.core.typehandler.IParamTypeHandler; import aiyh.utils.apirequest.core.typehandler.IParamTypeHandler;
import aiyh.utils.apirequest.core.typehandler.IParamValueRuleHandler; import aiyh.utils.apirequest.core.typehandler.IParamValueRuleHandler;
import aiyh.utils.apirequest.entity.ApiRequestParamData; import aiyh.utils.apirequest.entity.ApiRequestParamData;
import aiyh.utils.apirequest.mapper.ParamValueParseMapper;
import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
@ -16,8 +19,21 @@ import java.util.Map;
public class ListTypeHandler implements IParamTypeHandler { public class ListTypeHandler implements IParamTypeHandler {
private ParamValueParseMapper mapper = Util.getMapper(ParamValueParseMapper.class);
@Override @Override
public Object getValue(ApiRequestParamData paramData, IParamValueRuleHandler paramValueRuleHandler, Map<String, Object> dataMap) { public Object getValue(ApiRequestParamData paramData, IParamValueRuleHandler paramValueRuleHandler, Map<String, Object> dataMap) {
return null; return null;
} }
public List<Map<String,Object>> getDataListBySql(ApiRequestParamData paramData, Map<String,Object> dataMap){
mapper.selectListByCustomerSql(paramData.getCustomerValue(),dataMap);
return null;
}
public List<Map<String,Object>> getDataListByDetail(){
return null;
}
} }

View File

@ -1,9 +1,20 @@
package aiyh.utils.apirequest.core.typehandler.paramtype; package aiyh.utils.apirequest.core.typehandler.paramtype;
import aiyh.utils.apirequest.core.factory.AbstractFactory;
import aiyh.utils.apirequest.core.factory.AbstractFactoryImpl;
import aiyh.utils.apirequest.core.factory.ParamTypeHandlerFactory;
import aiyh.utils.apirequest.core.factory.ParamValueRuleHandlerFactory;
import aiyh.utils.apirequest.core.typehandler.IParamTypeHandler; import aiyh.utils.apirequest.core.typehandler.IParamTypeHandler;
import aiyh.utils.apirequest.core.typehandler.IParamValueRuleHandler; import aiyh.utils.apirequest.core.typehandler.IParamValueRuleHandler;
import aiyh.utils.apirequest.entity.ApiRequestParamData; import aiyh.utils.apirequest.entity.ApiRequestParamData;
import aiyh.utils.apirequest.entity.ParamInfo;
import aiyh.utils.apirequest.enumtype.ParamTypeEnum;
import aiyh.utils.apirequest.enumtype.ParamValueRuleEnum;
import aiyh.utils.apirequest.mapsturct.BeanMapper;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
@ -16,8 +27,30 @@ import java.util.Map;
public class ObjectTypeHandler implements IParamTypeHandler { public class ObjectTypeHandler implements IParamTypeHandler {
private final AbstractFactory factory = new AbstractFactoryImpl();
@Override @Override
public Object getValue(ApiRequestParamData paramData, IParamValueRuleHandler paramValueRuleHandler, Map<String, Object> dataMap) { public Object getValue(ApiRequestParamData paramData, IParamValueRuleHandler paramValueRuleHandler, Map<String, Object> dataMap) {
List<ApiRequestParamData> childList = paramData.getChildList();
if(childList == null || childList.size() == 0){
return new HashMap<>(2);
}
ParamValueRuleHandlerFactory paramHandlerFactory = factory.createParamHandlerFactory(ParamValueRuleHandlerFactory.class);
ParamTypeHandlerFactory paramTypeHandlerFactory = factory.createParamHandlerFactory(ParamTypeHandlerFactory.class);
List<ParamInfo> paramInfoList = new ArrayList<>();
// 对子项进行解析和类型转换
for (ApiRequestParamData apiRequestParamData : childList) {
// 获取转换规则对应的枚举对象
ParamValueRuleEnum paramValueRuleEnum = ParamValueRuleEnum.get(apiRequestParamData.getValueRule());
ParamTypeEnum paramTypeEnum = ParamTypeEnum.get(apiRequestParamData.getParamType());
IParamTypeHandler paramTypeHandler = paramTypeHandlerFactory.createParamHandler(paramTypeEnum);
IParamValueRuleHandler paramHandler = paramHandlerFactory.createParamHandler(paramValueRuleEnum);
Object value = paramTypeHandler.getValue(apiRequestParamData, paramHandler,dataMap);
ParamInfo paramInfo = BeanMapper.INSTANCE.apiRequestData2ParamInfo(apiRequestParamData);
paramInfo.setParamValue(value);
paramInfoList.add(paramInfo);
}
paramData.setParamInfoList(paramInfoList);
return null; return null;
} }
} }

View File

@ -2,7 +2,6 @@ package aiyh.utils.apirequest.core.typehandler.paramvalue;
import aiyh.utils.apirequest.core.typehandler.IParamValueRuleHandler; import aiyh.utils.apirequest.core.typehandler.IParamValueRuleHandler;
import aiyh.utils.apirequest.entity.ApiRequestParamData; import aiyh.utils.apirequest.entity.ApiRequestParamData;
import aiyh.utils.apirequest.pojo.ApiRequestParamDetail;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;

View File

@ -43,6 +43,7 @@ public class CustomerSqlRuleHandler implements IParamValueRuleHandler {
if (paramTypeEnum == ParamTypeEnum.LIST_TYPE) { if (paramTypeEnum == ParamTypeEnum.LIST_TYPE) {
List<Map<String, Object>> maps = mapper.selectListByCustomerSql(sqlStr, dataMap); List<Map<String, Object>> maps = mapper.selectListByCustomerSql(sqlStr, dataMap);
dataMap.put(name, maps); dataMap.put(name, maps);
return null;
} }
// 如果是Object类型则需要查询Map类型的数据并将数据保存在dataMap中 // 如果是Object类型则需要查询Map类型的数据并将数据保存在dataMap中
if (paramTypeEnum == ParamTypeEnum.OBJECT_TYPE) { if (paramTypeEnum == ParamTypeEnum.OBJECT_TYPE) {

View File

@ -1,6 +1,10 @@
package aiyh.utils.apirequest.entity; package aiyh.utils.apirequest.entity;
import aiyh.utils.apirequest.pojo.ApiRequestParamDetail; import aiyh.utils.apirequest.pojo.ApiRequestParamDetail;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.List;
/** /**
* <p>Api </p> * <p>Api </p>
@ -9,6 +13,9 @@ import aiyh.utils.apirequest.pojo.ApiRequestParamDetail;
* @author EBU7-dev1-ayh * @author EBU7-dev1-ayh
*/ */
@EqualsAndHashCode(callSuper = true)
@Data
public class ApiRequestParamData extends ApiRequestParamDetail { public class ApiRequestParamData extends ApiRequestParamDetail {
private List<ApiRequestParamData> childList;
private List<ParamInfo> paramInfoList;
} }

View File

@ -1,6 +1,5 @@
package aiyh.utils.apirequest.entity; package aiyh.utils.apirequest.entity;
import aiyh.utils.apirequest.pojo.ApiRequestParamDetail;
import lombok.Data; import lombok.Data;
import java.util.List; import java.util.List;

View File

@ -20,17 +20,19 @@ public interface ParamValueParseMapper {
/** /**
* SQL * SQL
*
* @param sql SQL * @param sql SQL
* @param map * @param map
* @return * @return
*/ */
@Select(custom = true) @Select(custom = true)
@CaseConversion(false) @CaseConversion(false)
public String selectCustomerSql(@SqlString String sql, Map<String,Object> map); public String selectCustomerSql(@SqlString String sql, Map<String, Object> map);
/** /**
* SQL * SQL
*
* @param sqlStr SQL * @param sqlStr SQL
* @param dataMap * @param dataMap
* @return * @return
@ -42,11 +44,34 @@ public interface ParamValueParseMapper {
/** /**
* SQL * SQL
*
* @param sql SQL * @param sql SQL
* @param dataMap * @param dataMap
* @return * @return
*/ */
@Select(custom = true) @Select(custom = true)
@CaseConversion(false) @CaseConversion(false)
public List<Map<String,Object>> selectListByCustomerSql(@SqlString String sql, Map<String,Object> dataMap); public List<Map<String, Object>> selectListByCustomerSql(@SqlString String sql, Map<String, Object> dataMap);
/**
*
*
* @param sql SQL
* @param dataMap
* @return
*/
@Select(custom = true)
@CaseConversion(false)
public List<String> selectStringListByCustomerSql(@SqlString String sql, Map<String, Object> dataMap);
/**
*
*
* @param sql SQL
* @param dataMap
* @return
*/
@Select(custom = true)
@CaseConversion(false)
public List<Integer> selectIntegerListByCustomerSql(@SqlString String sql, Map<String, Object> dataMap);
} }

View File

@ -15,6 +15,7 @@ import aiyh.utils.apirequest.pojo.ApiRequestMain;
import aiyh.utils.apirequest.pojo.ApiRequestParamDetail; import aiyh.utils.apirequest.pojo.ApiRequestParamDetail;
import lombok.Data; import lombok.Data;
import lombok.Setter; import lombok.Setter;
import org.jetbrains.annotations.Nullable;
import java.util.List; import java.util.List;
import java.util.Objects; import java.util.Objects;
@ -28,6 +29,20 @@ import java.util.concurrent.atomic.AtomicReference;
* @author EBU7-dev1-ayh * @author EBU7-dev1-ayh
*/ */
/*
* 1
* 2022/02/14
* 12
* 200-2000
*
* 2022/02/13
*
*
*
* */
@Setter @Setter
@Data @Data
public class ApiRequestService { public class ApiRequestService {
@ -52,22 +67,44 @@ public class ApiRequestService {
this.interceptor = interceptor; this.interceptor = interceptor;
} }
public void requestById(int id){
ApiRequestMain apiRequestMain = getApiRequestMainById(id);
ParamConfigInfo paramConfigInfo = parseParam(apiRequestMain);
}
public void requestByMark(){
}
/** /**
* *
* *
* @param id id * @param mark
* @return * @return
*/ */
public ApiRequestMain getApiRequestMain(int id) { public ApiRequestMain getApiRequestMainByMark(String mark) {
AtomicReference<ApiRequestMain> apiRequestMain = new AtomicReference<>(mapper.selectApiConfigById(id)); AtomicReference<ApiRequestMain> apiRequestMain = new AtomicReference<>(mapper.selectApiConfigByOnlyMark(mark));
return getApiRequestMain(apiRequestMain);
}
/**
*
* @param apiRequestMain
* @return
*/
@Nullable
private ApiRequestMain getApiRequestMain(AtomicReference<ApiRequestMain> apiRequestMain) {
if (Objects.isNull(apiRequestMain.get())) { if (Objects.isNull(apiRequestMain.get())) {
return null; return null;
} }
// 查询配置表明细信息
List<ApiRequestParamDetail> paramDetailList = mapper.selectApiParamListByMainId(apiRequestMain.get().getId()); List<ApiRequestParamDetail> paramDetailList = mapper.selectApiParamListByMainId(apiRequestMain.get().getId());
apiRequestMain.get().setParamDetailList(paramDetailList); apiRequestMain.get().setParamDetailList(paramDetailList);
List<ApiRequestHeardDetail> heardDetailList = mapper.selectApiHeardListByMainId(apiRequestMain.get().getId()); List<ApiRequestHeardDetail> heardDetailList = mapper.selectApiHeardListByMainId(apiRequestMain.get().getId());
apiRequestMain.get().setHeardDetailList(heardDetailList); apiRequestMain.get().setHeardDetailList(heardDetailList);
// 回调拦截器
Optional.ofNullable(interceptor).map(interceptor -> { Optional.ofNullable(interceptor).map(interceptor -> {
Optional.ofNullable(interceptor.parseBefore(apiRequestMain.get())).map(v -> { Optional.ofNullable(interceptor.parseBefore(apiRequestMain.get())).map(v -> {
apiRequestMain.set(v); apiRequestMain.set(v);
@ -78,20 +115,33 @@ public class ApiRequestService {
return apiRequestMain.get(); return apiRequestMain.get();
} }
/**
*
*
* @param id id
* @return
*/
public ApiRequestMain getApiRequestMainById(int id) {
AtomicReference<ApiRequestMain> apiRequestMain = new AtomicReference<>(mapper.selectApiConfigById(id));
return getApiRequestMain(apiRequestMain);
}
/** /**
* *
* * ( , ) Σσ(Д)!!!
* @param apiRequestMain * @param apiRequestMain
* @return * @return
*/ */
public ParamConfigInfo parseParam(ApiRequestMain apiRequestMain) { public ParamConfigInfo parseParam(ApiRequestMain apiRequestMain) {
// 抽象工厂获取参数数据源处理对象
DataSourceHandlerFactory dataSourceHandlerFactory = abstractFactory.createParamHandlerFactory(DataSourceHandlerFactory.class); DataSourceHandlerFactory dataSourceHandlerFactory = abstractFactory.createParamHandlerFactory(DataSourceHandlerFactory.class);
DataSourceRuleEnum dataSourceRuleEnum = DataSourceRuleEnum.get(apiRequestMain.getDataSource()); DataSourceRuleEnum dataSourceRuleEnum = DataSourceRuleEnum.get(apiRequestMain.getDataSource());
IDataSourceHandler paramHandler = dataSourceHandlerFactory.createParamHandler(dataSourceRuleEnum); IDataSourceHandler paramHandler = dataSourceHandlerFactory.createParamHandler(dataSourceRuleEnum);
ApiRequestData apiRequestData = BeanMapper.INSTANCE.apiRequestMain2Data(apiRequestMain); ApiRequestData apiRequestData = BeanMapper.INSTANCE.apiRequestMain2Data(apiRequestMain);
apiRequestData.setApiBaseInfo(this.apiBaseInfo); apiRequestData.setApiBaseInfo(this.apiBaseInfo);
// 解析数据参数
AtomicReference<ParamConfigInfo> paramConfigInfo = new AtomicReference<>(paramHandler.parseDataSource(apiRequestData)); AtomicReference<ParamConfigInfo> paramConfigInfo = new AtomicReference<>(paramHandler.parseDataSource(apiRequestData));
// TODO 解析配置表中的参数
Optional.ofNullable(interceptor).map(interceptor -> { Optional.ofNullable(interceptor).map(interceptor -> {
Optional.ofNullable(interceptor.parseAfter(paramConfigInfo.get())).map(v -> { Optional.ofNullable(interceptor.parseAfter(paramConfigInfo.get())).map(v -> {
paramConfigInfo.set(v); paramConfigInfo.set(v);
@ -130,3 +180,8 @@ public class ApiRequestService {
} }
} }

View File

@ -74,8 +74,9 @@ public class ExportExcel {
Employee e = employeeList.get(i); Employee e = employeeList.get(i);
// toolUtil.writeErrorLog("item数据库" + e); // toolUtil.writeErrorLog("item数据库" + e);
if (e.getJOBCODEID() == null || e.getJOBCODEID() == 0){ if (e.getJOBCODEID() == null || e.getJOBCODEID() == 0){
toolUtil.writeErrorLog("数据出现错误:" + e); // toolUtil.writeErrorLog("数据出现错误:" + e);
continue; e.setJOBCODEID(-0L);
// continue;
} }
Row row = sheet.createRow(i + 2); Row row = sheet.createRow(i + 2);
row.createCell(0).setCellValue(e.getUserID()); row.createCell(0).setCellValue(e.getUserID());

View File

@ -90,12 +90,9 @@ public class ConfigTableData {
tableName + tableName +
" where id = ?"; " where id = ?";
ToolUtil toolUtil = new ToolUtil(); ToolUtil toolUtil = new ToolUtil();
toolUtil.writeDebuggerLog("接收到参数tableName{" + tableName + "},fieldName{" + fieldName + "}configId{" + configId);
toolUtil.writeDebuggerLog("sql:" + queryBuilder);
rs.executeQuery(queryBuilder,configId); rs.executeQuery(queryBuilder,configId);
if(rs.next()){ if(rs.next()){
String docIds = Util.null2String(rs.getString(1)); String docIds = Util.null2String(rs.getString(1));
toolUtil.writeDebuggerLog("查询到数据:" + docIds);
return docIds.split(","); return docIds.split(",");
} }
return new String[0]; return new String[0];

View File

@ -66,7 +66,6 @@ public class DocTemplateDao {
public int[] copyFile(int userId, String tableName, String fieldName, String configId) { public int[] copyFile(int userId, String tableName, String fieldName, String configId) {
this.userId = userId; this.userId = userId;
String[] templateData = ConfigTableData.getTemplateData(tableName, fieldName, configId); String[] templateData = ConfigTableData.getTemplateData(tableName, fieldName, configId);
this.toolUtil.writeDebuggerLog("模板数据:" + Arrays.toString(templateData));
int[] array = Arrays.stream(templateData).mapToInt(Integer::parseInt).toArray(); int[] array = Arrays.stream(templateData).mapToInt(Integer::parseInt).toArray();
return this.copyFile(array); return this.copyFile(array);
} }
@ -138,7 +137,6 @@ public class DocTemplateDao {
.uPut("seccategory", docCategory.split(",")[docCategory.split(",").length - 1]); .uPut("seccategory", docCategory.split(",")[docCategory.split(",").length - 1]);
Where whereIn = Util.createPrepWhereImpl().whereAnd("id").whereInList(list); Where whereIn = Util.createPrepWhereImpl().whereAnd("id").whereInList(list);
PrepSqlResultImpl updateResult = Util.createSqlBuilder().updateSql("docdetail", updateMap, whereIn); PrepSqlResultImpl updateResult = Util.createSqlBuilder().updateSql("docdetail", updateMap, whereIn);
this.toolUtil.writeDebuggerLog(updateResult.getSqlStr() + " : " + updateResult.getArgs());
return rs.executeUpdate(updateResult.getSqlStr(), updateResult.getArgs()); return rs.executeUpdate(updateResult.getSqlStr(), updateResult.getArgs());
} }
return false; return false;

View File

@ -34,7 +34,6 @@ public class CopyAttachment {
@Produces(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON)
public String copyAttachment(@Context HttpServletRequest request, @Context HttpServletResponse response, public String copyAttachment(@Context HttpServletRequest request, @Context HttpServletResponse response,
@RequestBody Map<String, Object> params) { @RequestBody Map<String, Object> params) {
this.toolUtil.writeDebuggerLog("文件拷贝,接收参数:" + params);
User user = HrmUserVarify.getUser(request, response); User user = HrmUserVarify.getUser(request, response);
return CopyAttachmentService.copyFile(user,params); return CopyAttachmentService.copyFile(user,params);
} }
@ -45,7 +44,6 @@ public class CopyAttachment {
@Produces(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON)
public String deleteFile(@Context HttpServletRequest request, @Context HttpServletResponse response, public String deleteFile(@Context HttpServletRequest request, @Context HttpServletResponse response,
@PathParam("docIds") String docIds) { @PathParam("docIds") String docIds) {
this.toolUtil.writeDebuggerLog("文件删除,接收参数:" + docIds);
return CopyAttachmentService.deleteFile(docIds); return CopyAttachmentService.deleteFile(docIds);
} }
@ -54,7 +52,6 @@ public class CopyAttachment {
@Consumes(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON)
public String queryConfig(@PathParam("workflowId") String workflowId) { public String queryConfig(@PathParam("workflowId") String workflowId) {
this.toolUtil.writeDebuggerLog("获取配置参数,接收参数为: " + workflowId);
return ApiResult.success(ConfigTableData.getConfig(workflowId)); return ApiResult.success(ConfigTableData.getConfig(workflowId));
} }
@ -64,7 +61,6 @@ public class CopyAttachment {
@Produces(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON)
public String queryFilesData(@Context HttpServletRequest request, @Context HttpServletResponse response, public String queryFilesData(@Context HttpServletRequest request, @Context HttpServletResponse response,
@RequestBody Map<String, Object> params){ @RequestBody Map<String, Object> params){
this.toolUtil.writeDebuggerLog("查看文件信息,接收参数:" + params);
User user = HrmUserVarify.getUser(request, response); User user = HrmUserVarify.getUser(request, response);
return CopyAttachmentService.queryFilesData(user, params); return CopyAttachmentService.queryFilesData(user, params);
} }

View File

@ -39,9 +39,43 @@ import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream; import java.util.zip.ZipOutputStream;
/** /**
*
*
* @author EBU7-dev1-ayh * @author EBU7-dev1-ayh
* @create 2021/11/3 0003 14:51 * @create 2021/11/3 0003 14:51
*/ */
// 写这个代码的时候只有我和上帝知道在写啥 2021/11/10
// 好了,现在只有上帝知道了 2022/02/16
/*
* 2022/02/18
*
*
*
*
*
*
*/
/*
*
*
*
*
*
*
*
*
* */
public class FaDDContractService { public class FaDDContractService {
private final ToolUtil toolUtil = new ToolUtil(); private final ToolUtil toolUtil = new ToolUtil();
private final String contractInfoTable = "uf_contract_info"; private final String contractInfoTable = "uf_contract_info";
@ -971,17 +1005,12 @@ public class FaDDContractService {
private PushAPushEmailEntity queryEmailInfo(int workflowType, String requestId) { private PushAPushEmailEntity queryEmailInfo(int workflowType, String requestId) {
PushAPushEmailEntity pushAPushEmailEntity = faDDContractMapping.queryEmailInfo(workflowType); PushAPushEmailEntity pushAPushEmailEntity = faDDContractMapping.queryEmailInfo(workflowType);
Map<String, Object> workflowData = getWorkflowData(String.valueOf(workflowType), requestId); Map<String, Object> workflowData = getWorkflowData(String.valueOf(workflowType), requestId);
toolUtil.writeDebuggerLog("获取到邮件配置参数:" + JSON.toJSONString(pushAPushEmailEntity));
toolUtil.writeDebuggerLog("查询到的数据:===> " + JSON.toJSONString(workflowData));
String parsingTitle = parsingValue(pushAPushEmailEntity.getEmailTitle(), workflowData); String parsingTitle = parsingValue(pushAPushEmailEntity.getEmailTitle(), workflowData);
toolUtil.writeDebuggerLog("parsingTitle解析后的值" + parsingTitle);
pushAPushEmailEntity.setEmailTitle(parsingTitle); pushAPushEmailEntity.setEmailTitle(parsingTitle);
String parsingEmail = parsingValue(pushAPushEmailEntity.getEmailAddress(), workflowData); String parsingEmail = parsingValue(pushAPushEmailEntity.getEmailAddress(), workflowData);
toolUtil.writeDebuggerLog("parsingEmail解析后的值" + parsingEmail);
pushAPushEmailEntity.setEmailAddress(parsingEmail); pushAPushEmailEntity.setEmailAddress(parsingEmail);
try { try {
String parsingContent = parsingValue(pushAPushEmailEntity.getEmailContent(), workflowData); String parsingContent = parsingValue(pushAPushEmailEntity.getEmailContent(), workflowData);
toolUtil.writeDebuggerLog("parsingContent解析后的值" + parsingContent);
pushAPushEmailEntity.setEmailContent(parsingContent); pushAPushEmailEntity.setEmailContent(parsingContent);
} catch (Exception e) { } catch (Exception e) {
toolUtil.writeDebuggerLog("解析出错:" + e.toString()); toolUtil.writeDebuggerLog("解析出错:" + e.toString());

View File

@ -160,7 +160,6 @@ public class FaDDContractController {
@GET @GET
@Produces(MediaType.APPLICATION_OCTET_STREAM) @Produces(MediaType.APPLICATION_OCTET_STREAM)
public Response contractDownload(@PathParam("requestId") String requestId) { public Response contractDownload(@PathParam("requestId") String requestId) {
toolUtil.writeErrorLog("进入请求方法获取到请求id" + requestId);
try { try {
UfContractInfoDTO ufContractInfoDTO = faDDContractMapping.queryContractInfoByRequestId(requestId); UfContractInfoDTO ufContractInfoDTO = faDDContractMapping.queryContractInfoByRequestId(requestId);
StreamingOutput contractZipStream = faDDService.download4mFDD(ufContractInfoDTO); StreamingOutput contractZipStream = faDDService.download4mFDD(ufContractInfoDTO);

View File

@ -7,6 +7,7 @@ import com.api.aiyh_pcn.patentWall.service.PatentWallService;
import com.api.aiyh_pcn.patentWall.vo.PatentVO; import com.api.aiyh_pcn.patentWall.vo.PatentVO;
import com.api.aiyh_pcn.patentWall.vo.SearchInputVO; import com.api.aiyh_pcn.patentWall.vo.SearchInputVO;
import io.swagger.v3.oas.annotations.parameters.RequestBody; import io.swagger.v3.oas.annotations.parameters.RequestBody;
import org.apache.log4j.Logger;
import weaver.hrm.HrmUserVarify; import weaver.hrm.HrmUserVarify;
import weaver.hrm.User; import weaver.hrm.User;
@ -28,16 +29,22 @@ import java.util.Map;
@Path("/patten/") @Path("/patten/")
public class PatentWallController { public class PatentWallController {
private final PatentWallService patentWallService = new PatentWallService(); private final PatentWallService patentWallService = new PatentWallService();
private final Logger logger = Util.getLogger();
@Path("/getSearchList/{prefix}") @Path("/getSearchList/{prefix}")
@GET @GET
@Produces(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON)
public String getPatentList(@Context HttpServletRequest request, @Context HttpServletResponse response, public String getPatentList(@Context HttpServletRequest request, @Context HttpServletResponse response,
@PathParam("prefix") String prefix){ @PathParam("prefix") String prefix){
try {
User user = HrmUserVarify.getUser(request, response); User user = HrmUserVarify.getUser(request, response);
int languageId = user.getLanguage(); int languageId = user.getLanguage();
List<SearchInputVO> result = patentWallService.getSearchList(prefix,languageId); List<SearchInputVO> result = patentWallService.getSearchList(prefix,languageId);
return ApiResult.success(result); return ApiResult.success(result);
}catch (Exception e){
logger.error("捕获到异常信息:" + Util.getErrString(e));
return ApiResult.error("捕获到调用异常信息");
}
} }
@Path("/getList/{prefix}") @Path("/getList/{prefix}")
@ -45,8 +52,13 @@ public class PatentWallController {
@Produces(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON)
public String getPatentList(@RequestBody List<FilterWhere> filterWheres, @PathParam("prefix") String prefix){ public String getPatentList(@RequestBody List<FilterWhere> filterWheres, @PathParam("prefix") String prefix){
try {
List<PatentVO> result = patentWallService.getList(filterWheres,prefix); List<PatentVO> result = patentWallService.getList(filterWheres,prefix);
return ApiResult.success(result); return ApiResult.success(result);
}catch (Exception e){
logger.error("捕获到异常信息:" + Util.getErrString(e));
return ApiResult.error("捕获到调用异常信息");
}
} }
@Path("/clearConf") @Path("/clearConf")

View File

@ -9,6 +9,7 @@ import com.api.aiyh_pcn.patentWall.vo.LinkUrlVO;
import com.api.aiyh_pcn.patentWall.vo.PatentVO; import com.api.aiyh_pcn.patentWall.vo.PatentVO;
import com.api.aiyh_pcn.patentWall.vo.SearchInputVO; import com.api.aiyh_pcn.patentWall.vo.SearchInputVO;
import com.api.aiyh_pcn.patentWall.vo.SelectOptionsVo; import com.api.aiyh_pcn.patentWall.vo.SelectOptionsVo;
import org.apache.log4j.Logger;
import weaver.conn.RecordSet; import weaver.conn.RecordSet;
import java.beans.BeanInfo; import java.beans.BeanInfo;
@ -30,9 +31,10 @@ import java.util.regex.Pattern;
public class PatentWallService { public class PatentWallService {
private final PatentWallMapping patentWallMapping = new PatentWallMapping(); private final PatentWallMapping patentWallMapping = new PatentWallMapping();
private final ToolUtil toolUtil = new ToolUtil(); private final ToolUtil toolUtil = new ToolUtil();
private final RecordSet rs = new RecordSet();
private Map<String, Object> patentWallConf; private Map<String, Object> patentWallConf;
private Map<String, Object> patentWallSearchConf; private Map<String, Object> patentWallSearchConf;
private final RecordSet rs = new RecordSet(); private final Logger logger = Util.getLogger();
/** /**
* *
@ -135,7 +137,6 @@ public class PatentWallService {
public List<PatentVO> getList(List<FilterWhere> filterWheres, String prefix) { public List<PatentVO> getList(List<FilterWhere> filterWheres, String prefix) {
Map<String, Object> patentWallConf = getPatentWallConf(prefix + ".voMapping"); Map<String, Object> patentWallConf = getPatentWallConf(prefix + ".voMapping");
List<Map<String, Object>> dataList; List<Map<String, Object>> dataList;
toolUtil.writeDebuggerLog(String.format("查询数据,接收到的过滤信息为: %s", JSON.toJSONString(filterWheres)));
if (filterWheres == null || filterWheres.isEmpty()) { if (filterWheres == null || filterWheres.isEmpty()) {
// 查询全部 // 查询全部
dataList = patentWallMapping.getAllList(Util.null2String(patentWallConf.get("dataResource"))); dataList = patentWallMapping.getAllList(Util.null2String(patentWallConf.get("dataResource")));
@ -146,7 +147,6 @@ public class PatentWallService {
} }
List<PatentVO> list = new ArrayList<>(); List<PatentVO> list = new ArrayList<>();
List<String> args = new ArrayList<>(); List<String> args = new ArrayList<>();
RecordSet rs = new RecordSet();
for (Map<String, Object> data : dataList) { for (Map<String, Object> data : dataList) {
Map<String, Object> config = new HashMap<>(patentWallConf); Map<String, Object> config = new HashMap<>(patentWallConf);
for (Map.Entry<String, Object> entry : patentWallConf.entrySet()) { for (Map.Entry<String, Object> entry : patentWallConf.entrySet()) {
@ -207,6 +207,7 @@ public class PatentWallService {
PatentVO patentVO = null; PatentVO patentVO = null;
try { try {
patentVO = Util.mapToObject(config, PatentVO.class); patentVO = Util.mapToObject(config, PatentVO.class);
patentVO.setLinkList((List<LinkUrlVO>) config.get("linkList"));
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
toolUtil.writeErrorLog("map转为PatentVO失败"); toolUtil.writeErrorLog("map转为PatentVO失败");
@ -354,6 +355,9 @@ public class PatentWallService {
* @return * @return
*/ */
private Map<String, Object> getPatentWallSearchConf(String prefix) { private Map<String, Object> getPatentWallSearchConf(String prefix) {
if (this.patentWallSearchConf != null) {
return this.patentWallSearchConf;
}
synchronized (this) { synchronized (this) {
if (this.patentWallSearchConf == null) { if (this.patentWallSearchConf == null) {
this.patentWallSearchConf = Util.readProperties2Map("PatentWall", "aiyh." + prefix); this.patentWallSearchConf = Util.readProperties2Map("PatentWall", "aiyh." + prefix);

View File

@ -1,12 +1,13 @@
package weaver.aiyh_pcn.async_organization; package weaver.aiyh_pcn.async_organization;
import aiyh.utils.Util;
import aiyh.utils.zwl.common.ToolUtil; import aiyh.utils.zwl.common.ToolUtil;
import com.weaver.esb.server.cache.ResourceComInfo;
import weaver.aiyh_pcn.async_organization.model.Department; import weaver.aiyh_pcn.async_organization.model.Department;
import weaver.aiyh_pcn.async_organization.model.Employee; import weaver.aiyh_pcn.async_organization.model.Employee;
import weaver.aiyh_pcn.async_organization.model.Position; import weaver.aiyh_pcn.async_organization.model.Position;
import weaver.aiyh_pcn.async_organization.result.GetOrganizationResult; import weaver.aiyh_pcn.async_organization.result.GetOrganizationResult;
import weaver.aiyh_pcn.async_organization.util.SyncOrganizationUtils; import weaver.aiyh_pcn.async_organization.util.SyncOrganizationUtils;
import com.weaver.esb.server.cache.ResourceComInfo;
import weaver.hrm.company.DepartmentComInfo; import weaver.hrm.company.DepartmentComInfo;
import weaver.hrm.company.SubCompanyComInfo; import weaver.hrm.company.SubCompanyComInfo;
import weaver.hrm.job.JobTitlesComInfo; import weaver.hrm.job.JobTitlesComInfo;
@ -27,37 +28,43 @@ import java.util.*;
public class SyncOrganizationForOtherAPI extends ToolUtil implements HrmSynService { public class SyncOrganizationForOtherAPI extends ToolUtil implements HrmSynService {
private HashMap<String,Object> synResult;
String className = "SyncOrganizationForOtherAPI";
private final Logger log = LoggerFactory.getLogger(SyncOrganizationForOtherAPI.class); private final Logger log = LoggerFactory.getLogger(SyncOrganizationForOtherAPI.class);
private final GetOrganizationResult getOrganizationResult = new GetOrganizationResult(); private final GetOrganizationResult getOrganizationResult = new GetOrganizationResult();
private final SyncOrganizationUtils organizationUtils = new SyncOrganizationUtils(); private final SyncOrganizationUtils organizationUtils = new SyncOrganizationUtils();
String className = "SyncOrganizationForOtherAPI";
private HashMap<String, Object> synResult;
public SyncOrganizationForOtherAPI(){ public SyncOrganizationForOtherAPI() {
this.writeDebuggerLog(className,"===========> create Object! <============"); this.writeDebuggerLog(className, "===========> create Object! <============");
this.synResult = new HashMap<>(); this.synResult = new HashMap<>();
} }
/**同步到分公司(分部)*/
/**
* ()
*/
@Override @Override
public String SynTimingToOASubCompany() { public String SynTimingToOASubCompany() {
this.writeDebuggerLog(className,"===========> synchronous company to OA system start <============"); this.writeDebuggerLog(className, "===========> synchronous company to OA system start <============");
this.synResult.put("1",null); this.synResult.put("1", null);
this.writeDebuggerLog(className,"===========> synchronous company to OA system end <============"); this.writeDebuggerLog(className, "===========> synchronous company to OA system end <============");
return null; return null;
} }
/**同步到部门*/ /**
*
*/
@Override @Override
public String SynTimingToOADepartment() { public String SynTimingToOADepartment() {
this.writeDebuggerLog(className,"===========> synchronous department to OA system starts <============"); this.writeDebuggerLog(className, "===========> synchronous department to OA system starts <============");
try {
List<Department> departmentList = getOrganizationResult.getDepartmentList(); List<Department> departmentList = getOrganizationResult.getDepartmentList();
Collections.sort(departmentList); Collections.sort(departmentList);
List<Map<String,Object>> synResultlist = new ArrayList<>(); List<Map<String, Object>> synResultlist = new ArrayList<>();
departmentList.forEach(department -> { departmentList.forEach(department -> {
Map<String, String> stringStringMap = organizationUtils.asyncDepartment(department); Map<String, String> stringStringMap = organizationUtils.asyncDepartment(department);
synResultlist.add(buildItemMap("","",department.getDEPARTMENTNAME(),stringStringMap.get("code"),stringStringMap.get("msg"))); synResultlist.add(buildItemMap("", "", department.getDEPARTMENTNAME(), stringStringMap.get("code"), stringStringMap.get("msg")));
}); });
this.writeDebuggerLog(className,departmentList.size() +" data pieces are updated this time"); this.writeDebuggerLog(className, departmentList.size() + " data pieces are updated this time");
//清除OA中分部的缓存记录 //清除OA中分部的缓存记录
SubCompanyComInfo subCompanyComInfo = new SubCompanyComInfo(); SubCompanyComInfo subCompanyComInfo = new SubCompanyComInfo();
subCompanyComInfo.removeCompanyCache(); subCompanyComInfo.removeCompanyCache();
@ -70,56 +77,71 @@ public class SyncOrganizationForOtherAPI extends ToolUtil implements HrmSynServi
//同步部门数据到矩阵 //同步部门数据到矩阵
MatrixUtil.sysDepartmentData(); MatrixUtil.sysDepartmentData();
this.writeDebuggerLog(className,"This time together step or update data " + departmentList.size()); this.writeDebuggerLog(className, "This time together step or update data " + departmentList.size());
this.synResult.put("2",synResultlist); this.synResult.put("2", synResultlist);
this.writeDebuggerLog(className,"===========> synchronous department to OA system end <============"); this.writeDebuggerLog(className, "===========> synchronous department to OA system end <============");
} catch (Exception e) {
this.writeErrorLog("同步部门出现错误:错误信息:" + Util.getErrString(e));
}
return null; return null;
} }
/**同步到职位*/ /**
*
*/
@Override @Override
public String SynTimingToOAJobtitle() { public String SynTimingToOAJobtitle() {
this.writeDebuggerLog(className,"===========> synchronous job to OA system starts <============"); this.writeDebuggerLog(className, "===========> synchronous job to OA system starts <============");
try {
List<Position> positionList = getOrganizationResult.getPositionList(); List<Position> positionList = getOrganizationResult.getPositionList();
Collections.sort(positionList); Collections.sort(positionList);
List<Map<String,Object>> synResultlist = new ArrayList<>(); List<Map<String, Object>> synResultlist = new ArrayList<>();
positionList.forEach(position->{ positionList.forEach(position -> {
Map<String, String> stringStringMap = organizationUtils.asyncPosition(position); Map<String, String> stringStringMap = organizationUtils.asyncPosition(position);
synResultlist.add(buildItemMap(position.getJOBCODE(),position.getJOBCODE(),position.getJOBFUNCTION(),stringStringMap.get("code"),stringStringMap.get("msg"))); synResultlist.add(buildItemMap(position.getJOBCODE(), position.getJOBCODE(), position.getJOBFUNCTION(), stringStringMap.get("code"), stringStringMap.get("msg")));
}); });
this.writeDebuggerLog(className,positionList.size() +" data pieces are updated this time"); this.writeDebuggerLog(className, positionList.size() + " data pieces are updated this time");
// 清除职位缓存 // 清除职位缓存
JobTitlesComInfo jobTitlesComInfo = new JobTitlesComInfo(); JobTitlesComInfo jobTitlesComInfo = new JobTitlesComInfo();
jobTitlesComInfo.removeJobTitlesCache(); jobTitlesComInfo.removeJobTitlesCache();
jobTitlesComInfo.removeCache(); jobTitlesComInfo.removeCache();
this.synResult.put("3",synResultlist); this.synResult.put("3", synResultlist);
this.writeDebuggerLog(className,"===========> synchronous job to OA system end <============"); this.writeDebuggerLog(className, "===========> synchronous job to OA system end <============");
} catch (Exception e) {
this.writeErrorLog("同步职位失败,失败信息:" + Util.getErrString(e));
}
return null; return null;
} }
/**同步到人员*/ /**
*
*/
@Override @Override
public String SynTimingToOAHrmResource() { public String SynTimingToOAHrmResource() {
this.writeDebuggerLog(className,"===========> synchronous hrm to OA system starts <============"); this.writeDebuggerLog(className, "===========> synchronous hrm to OA system starts <============");
try {
List<Employee> employeeList = getOrganizationResult.getEmployeeList(); List<Employee> employeeList = getOrganizationResult.getEmployeeList();
List<Map<String,Object>> synResultlist = new ArrayList<>(); List<Map<String, Object>> synResultlist = new ArrayList<>();
Collections.sort(employeeList); Collections.sort(employeeList);
employeeList.forEach(employee->{ employeeList.forEach(employee -> {
Map<String, String> stringStringMap = organizationUtils.asyncEmployee(employee); Map<String, String> stringStringMap = organizationUtils.asyncEmployee(employee);
synResultlist.add(buildItemMap(employee.getUSERCODE(),employee.getUSERCODE(),employee.getPreferred_Name() + "/" + employee.getUSERNAMECN(),stringStringMap.get("code"),stringStringMap.get("msg"))); synResultlist.add(buildItemMap(employee.getUSERCODE(), employee.getUSERCODE(), employee.getPreferred_Name() + "/" + employee.getUSERNAMECN(), stringStringMap.get("code"), stringStringMap.get("msg")));
}); });
this.writeDebuggerLog(className,employeeList.size() +" data pieces are updated this time"); this.writeDebuggerLog(className, employeeList.size() + " data pieces are updated this time");
// 清除人员缓存 // 清除人员缓存
try { try {
ResourceComInfo rsc = new ResourceComInfo(); ResourceComInfo rsc = new ResourceComInfo();
rsc.removeCache(); rsc.removeCache();
} catch (Exception e) { } catch (Exception e) {
this.writeErrorLog(className,"removeCache error!"); this.writeErrorLog(className, "removeCache error!");
e.printStackTrace(); e.printStackTrace();
} }
// organizationUtils.asyncEmployee(employeeList.get(0)); // organizationUtils.asyncEmployee(employeeList.get(0));
this.synResult.put("4", synResultlist); this.synResult.put("4", synResultlist);
this.writeDebuggerLog(className,"===========> synchronous hrm to OA system end <============"); this.writeDebuggerLog(className, "===========> synchronous hrm to OA system end <============");
} catch (Exception e) {
this.writeErrorLog("同步人员信息失败,失败信息:" + Util.getErrString(e));
}
return null; return null;
} }
@ -169,7 +191,7 @@ public class SyncOrganizationForOtherAPI extends ToolUtil implements HrmSynServi
} }
@Override @Override
public HashMap<String,Object> getSynResult() { public HashMap<String, Object> getSynResult() {
return this.synResult; return this.synResult;
} }
@ -178,9 +200,9 @@ public class SyncOrganizationForOtherAPI extends ToolUtil implements HrmSynServi
this.synResult = new HashMap(); this.synResult = new HashMap();
} }
private Map<String,Object> buildItemMap(String pkcode, String pk, String memo, String succ, String error){ private Map<String, Object> buildItemMap(String pkcode, String pk, String memo, String succ, String error) {
//保存结果 //保存结果
HashMap<String,Object> itemMap = new HashMap<>(); HashMap<String, Object> itemMap = new HashMap<>();
itemMap.put(weaver.hrm.resource.HrmSynDAO.OUTPK, pkcode); itemMap.put(weaver.hrm.resource.HrmSynDAO.OUTPK, pkcode);
itemMap.put(weaver.hrm.resource.HrmSynDAO.PK, pk); itemMap.put(weaver.hrm.resource.HrmSynDAO.PK, pk);
itemMap.put(weaver.hrm.resource.HrmSynDAO.Memo, memo); itemMap.put(weaver.hrm.resource.HrmSynDAO.Memo, memo);

View File

@ -241,6 +241,12 @@ public class Employee implements Comparable<Employee>{
@Override @Override
public int compareTo(@NotNull Employee o) { public int compareTo(@NotNull Employee o) {
if(this.getJOBCODEID() == null){
return -1;
}
if(o.getJOBCODEID() == null){
return 1;
}
return new Long(this.JOBCODEID - o.getJOBCODEID()).intValue(); return new Long(this.JOBCODEID - o.getJOBCODEID()).intValue();
} }
} }

View File

@ -9,6 +9,7 @@ log4j.appender.A2=org.apache.log4j.DailyRollingFileAppender
log4j.appender.A2.DatePattern='_'yyyyMMdd'.log' log4j.appender.A2.DatePattern='_'yyyyMMdd'.log'
#don't modify the file property #don't modify the file property
log4j.appender.A2.File=@ecology log4j.appender.A2.File=@ecology
log4j.appender.A2.Encoding=UTF-8
log4j.appender.A2.layout=org.apache.log4j.PatternLayout log4j.appender.A2.layout=org.apache.log4j.PatternLayout
log4j.appender.A2.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p %c - %m%n log4j.appender.A2.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p %c - %m%n
log4j.appender.A3=org.apache.log4j.RollingFileAppender log4j.appender.A3=org.apache.log4j.RollingFileAppender

View File

@ -328,7 +328,7 @@ public class UtilTest {
// 通过物理文件的id进行获取对应的输入流信息。 // 通过物理文件的id进行获取对应的输入流信息。
// ImageFileManager imageFileManager = new ImageFileManager(); // ImageFileManager imageFileManager = new ImageFileManager();
// 通过文件id获取输入流 // 通过文件id获取输入流
InputStream inputStreamById = new FileInputStream("C:\\Users\\77449\\Desktop\\test.jpg"); InputStream inputStreamById = new FileInputStream("C:\\Users\\77449\\Desktop\\mmexport1640757115149.jpg");
try { try {
// 获取媒体数据 // 获取媒体数据
Metadata metadata = ImageMetadataReader.readMetadata(inputStreamById); Metadata metadata = ImageMetadataReader.readMetadata(inputStreamById);