diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/service/impl/MasterDataOrgsServiceImpl.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/service/impl/MasterDataOrgsServiceImpl.java index c6fe35a5..e382aabf 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/service/impl/MasterDataOrgsServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/service/impl/MasterDataOrgsServiceImpl.java @@ -102,8 +102,8 @@ public class MasterDataOrgsServiceImpl extends BaseService comparisonEntity.setDbName(entity.getDbName()); if(!"mdmCode".equals(key)){ map.put(key, jsonObject.getString(key)); + map.remove("appName"); + map.remove("appCode"); } } } @@ -207,10 +211,10 @@ public class ComparisonServiceImpl extends BaseService //comparisonEntityOne.setComparisonDetailsEntity(comparisonDetailsEntityOne); map.put("details",mapDetails); //保存操作日志 - controlsLogDaoimpl.saveControlsLog(uuidDetail,jsonObject.getString("sourceName"),jsonObject.getString("code"),jsonObject.toJSONString(),"接口新增",jsonObject.getString("optionName"),comparisonDetailsEntity.getDbName()+"_option_log"); + controlsLogDaoimpl.saveControlsLog(uuidDetail,jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口新增",jsonObject.getString("optionName"),comparisonDetailsEntity.getDbName()+"_option_log"); } //保存操作日志 - controlsLogDaoimpl.saveControlsLog(uuid,jsonObject.getString("sourceName"),jsonObject.getString("code"),jsonObject.toJSONString(),"接口新增",jsonObject.getString("optionName"),comparisonEntity.getDbName()+"_option_log"); + controlsLogDaoimpl.saveControlsLog(uuid,jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口新增",jsonObject.getString("optionName"),comparisonEntity.getDbName()+"_option_log"); return BaseResult.getSuccessMessageEntity("保存成功", map); } catch (Exception e) { logger.info("保存通用数据时候错误:{}", e.getMessage()); @@ -292,10 +296,10 @@ public class ComparisonServiceImpl extends BaseService comparisonDetailsEntity.setMapDetails(mapDetails); comparisonDetailsDao.updateComparisonDetailsByType(comparisonDetailsEntity); //保存操作日志 - controlsLogDaoimpl.saveControlsLog(comparisonDetailsEntity.getId(),jsonObject.getString("sourceName"),jsonObject.getString("code"),jsonObject.toJSONString(),"接口更新",jsonObject.getString("optionName"),comparisonDetailsEntity.getDbName()+"_option_log"); + controlsLogDaoimpl.saveControlsLog(comparisonDetailsEntity.getId(),jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口更新",jsonObject.getString("optionName"),comparisonDetailsEntity.getDbName()+"_option_log"); } //保存操作日志 - controlsLogDaoimpl.saveControlsLog(comparisonEntity.getId(),jsonObject.getString("sourceName"),jsonObject.getString("code"),jsonObject.toJSONString(),"接口更新",jsonObject.getString("optionName"),comparisonEntity.getDbName()+"_option_log"); + controlsLogDaoimpl.saveControlsLog(comparisonEntity.getId(),jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口更新",jsonObject.getString("optionName"),comparisonEntity.getDbName()+"_option_log"); return BaseResult.getSuccessMessageEntity("更新成功", integer); }else{ return BaseResult.getFailureMessageEntity("更新失败"); @@ -318,6 +322,9 @@ public class ComparisonServiceImpl extends BaseService if (!checkStr(jsonObject.getString("mdmCode"))) { return BaseResult.getFailureMessageEntity("主数据编码为空"); } + if (!checkStr(jsonObject.getString("optionName"))) { + return BaseResult.getFailureMessageEntity("操作人为空"); + } ComparisonEntity comparisonEntity = jsonObject.toJavaObject(ComparisonEntity.class); ComparisonDetailsEntity comparisonDetailsEntity=new ComparisonDetailsEntity(); JSONObject jsonObjectMain=jsonObject.getJSONObject("main");//获取主表数据 @@ -361,9 +368,9 @@ public class ComparisonServiceImpl extends BaseService comparisonDetailsEntity.setFormmainId(jsonObjectMain.getString("id")); comparisonDetailsEntity.setModify_user_id("c796fd9ba4c9f5ff3cc2fa41a040e443"); comparisonDetailsDao.deleteComparisonDetails(comparisonDetailsEntity); - controlsLogDaoimpl.saveControlsLog(comparisonDetailsEntity.getId(),jsonObject.getString("sourceName"),jsonObject.getString("code"),jsonObject.toJSONString(),"接口删除",jsonObject.getString("optionName"),comparisonEntity.getDbName()+"_option_log"); + controlsLogDaoimpl.saveControlsLog(comparisonDetailsEntity.getId(),jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口删除",jsonObject.getString("optionName"),comparisonEntity.getDbName()+"_option_log"); } - controlsLogDaoimpl.saveControlsLog(comparisonEntity.getId(),jsonObject.getString("sourceName"),jsonObject.getString("code"),jsonObject.toJSONString(),"接口删除",jsonObject.getString("optionName"),comparisonEntity.getDbName()+"_option_log"); + controlsLogDaoimpl.saveControlsLog(comparisonEntity.getId(),jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口删除",jsonObject.getString("optionName"),comparisonEntity.getDbName()+"_option_log"); return BaseResult.getSuccessMessageEntity("删除成功",integer); }else{ return BaseResult.getFailureMessageEntity("删除失败","请查看id是否在表中存在"); @@ -376,6 +383,18 @@ public class ComparisonServiceImpl extends BaseService return BaseResult.getFailureMessageEntity("查询失败","请检查传递参数"); } + //根据应用key和应用密钥获取应用编码和应用名称 + @Override + public SysExtensionApiEntity getAppNameAndCode(SysExtensionApiEntity sysExtensionApiEntity) { + String bodys = sysExtensionApiEntity.getBodys(); + SysApplicationEntity sendApp = sysExtensionApiEntity.getSendApp(); + JSONObject jsonObject = JSON.parseObject(bodys); + jsonObject.put("appName",sendApp.getName()); + jsonObject.put("appCode",sendApp.getAppId()); + sysExtensionApiEntity.setBodys(jsonObject.toJSONString()); + return sysExtensionApiEntity; + } + //根据不同的日期格式,返回不同的值 private String getRuleDate(String str){ switch (str){