Merge branch 'dev' of http://192.168.2.237:3000/root/kangarooDataCenterV3 into yuecheng-project
This commit is contained in:
commit
466aaaf04f
|
@ -20,7 +20,7 @@
|
|||
<select id="queryComparisonDetailsPage" resultType="java.util.Map"
|
||||
parameterType="com.hzya.frame.sysnew.comparison.entity.ComparisonDetailsEntity">
|
||||
select * from ${dbName}
|
||||
where formmain_id=#{formmainId} and sts='Y'
|
||||
where formmain_id=#{formmainId} and sts='Y' and (data_status='Y' or data_status='F')
|
||||
</select>
|
||||
|
||||
|
||||
|
@ -48,7 +48,7 @@
|
|||
${key} =#{value}
|
||||
</foreach>
|
||||
</set>
|
||||
where data_id=#{dataId} and sts='Y'
|
||||
where data_id=#{dataId} and formmain_id= #{formmainId} and sts='Y' and (data_status='Y' or data_status='F')
|
||||
</update>
|
||||
|
||||
<!-- 多条件逻辑删除 -->
|
||||
|
@ -60,7 +60,7 @@
|
|||
<!--<foreach collection="mapDetails.entrySet()" item="value" index="key">
|
||||
${key} =#{value}
|
||||
</foreach>-->
|
||||
and formmain_id=#{formmainId} and sts='Y'
|
||||
and formmain_id=#{formmainId} and sts='Y' and (data_status='Y' or data_status='F')
|
||||
</trim>
|
||||
</update>
|
||||
|
||||
|
|
|
@ -106,7 +106,7 @@
|
|||
${key} =#{value}
|
||||
</foreach>
|
||||
</set>
|
||||
where data_id=#{dataId} and sts='Y'
|
||||
where id=#{id} and sts='Y' and (data_status='Y' or data_status='F')
|
||||
</update>
|
||||
|
||||
|
||||
|
@ -119,7 +119,7 @@
|
|||
<foreach collection="map.entrySet()" item="value" index="key">
|
||||
and ${key} =#{value}
|
||||
</foreach>
|
||||
and data_id=#{dataId} and sts='Y'
|
||||
and id=#{id} and sts='Y' and (data_status='Y' or data_status='F')
|
||||
</trim>
|
||||
</update>
|
||||
|
||||
|
|
|
@ -102,7 +102,7 @@ public class ComparisonServiceImpl extends BaseService<ComparisonEntity, String>
|
|||
JSONObject jsonObjects=new JSONObject();
|
||||
jsonObjects.put(comparisonEntity.getDbName(),comparisonEntitiePage);
|
||||
if(comparisonDetailsEntity.getDbName()!=null){
|
||||
comparisonDetailsEntity.setFormmainId(String.valueOf(comparisonEntitiePage.get("data_id")));
|
||||
comparisonDetailsEntity.setFormmainId(String.valueOf(comparisonEntitiePage.get("id")));
|
||||
//查询明细表数据
|
||||
List<Map<String, Object>> maps = comparisonDetailsDao.queryComparisonDetailsPage(comparisonDetailsEntity);
|
||||
if(CollectionUtils.isNotEmpty(maps)){
|
||||
|
@ -191,7 +191,8 @@ public class ComparisonServiceImpl extends BaseService<ComparisonEntity, String>
|
|||
List<List<Map<String, Object>>> mapDetails = new ArrayList<>();//将子表数据存到map中
|
||||
if (comparisonEntities != null && comparisonEntities.size() > 0) {
|
||||
map = spliceMainMap(comparisonEntities, jsonObjectMain, map, comparisonEntity, comparisonDetailsEntity);
|
||||
map.put("id", UUIDLong.longUUID());
|
||||
String uuid= String.valueOf(UUIDLong.longUUID());
|
||||
map.put("id", uuid);
|
||||
map.put("create_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443");
|
||||
map.put("modify_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443");
|
||||
map.put("org_id", "0");
|
||||
|
@ -249,7 +250,7 @@ public class ComparisonServiceImpl extends BaseService<ComparisonEntity, String>
|
|||
for (List<Map<String, Object>> mapDetail : mapDetails) {
|
||||
for (Map<String, Object> stringObjectMap : mapDetail) {
|
||||
stringObjectMap.put("id", UUIDLong.longUUID());
|
||||
stringObjectMap.put("formmain_id", jsonObjectMain.getString("data_id"));
|
||||
stringObjectMap.put("formmain_id", uuid);
|
||||
stringObjectMap.put("create_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443");
|
||||
stringObjectMap.put("modify_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443");
|
||||
stringObjectMap.put("org_id", "0");
|
||||
|
@ -273,7 +274,7 @@ public class ComparisonServiceImpl extends BaseService<ComparisonEntity, String>
|
|||
}
|
||||
list.add(jsonObjectList);
|
||||
//保存操作日志
|
||||
controlsLogDaoimpl.saveControlsLog(jsonObjectMain.getString("data_id"),jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口新增",jsonObject.getString("optionName"),comparisonEntityRule.getDbName()+"_option_log");
|
||||
controlsLogDaoimpl.saveControlsLog(uuid,jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口新增",jsonObject.getString("optionName"),comparisonEntityRule.getDbName()+"_option_log");
|
||||
return BaseResult.getSuccessMessageEntity("保存成功", list);
|
||||
} catch (Exception e) {
|
||||
logger.info("保存通用数据时候错误:{}", e.getMessage());
|
||||
|
@ -347,6 +348,19 @@ public class ComparisonServiceImpl extends BaseService<ComparisonEntity, String>
|
|||
List<List<Map<String,Object>>> mapDetails=new ArrayList<>();//将子表数据存到map中
|
||||
if(comparisonEntities !=null && comparisonEntities.size()>0) {
|
||||
map=spliceMainMap(comparisonEntities,jsonObjectMain,map,comparisonEntity,comparisonDetailsEntity);
|
||||
|
||||
//根据data_id查询id.根据id更新主表数据,然后再根据主表id和明细表的data_id,删除明细表数据
|
||||
Map<String,Object> mapId=new HashMap<>();
|
||||
mapId.put("data_id",jsonObjectMain.getString("data_id"));
|
||||
ComparisonEntity comparison=new ComparisonEntity();
|
||||
comparison.setDbName(comparisonEntity.getDbName());
|
||||
comparison.setMap(mapId);
|
||||
List<Map<String,Object>> comparisonEntitiePages = comparisonDao.queryComparisonPage(comparison);
|
||||
if(CollectionUtils.isEmpty(comparisonEntitiePages)){
|
||||
return BaseResult.getFailureMessageEntity("根据data_id查询id数据为空,请检查data_id");
|
||||
}
|
||||
String id = String.valueOf(comparisonEntitiePages.get(0).get("id"));
|
||||
|
||||
map.put("create_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443");
|
||||
map.put("modify_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443");
|
||||
map.put("org_id", "0");
|
||||
|
@ -355,7 +369,7 @@ public class ComparisonServiceImpl extends BaseService<ComparisonEntity, String>
|
|||
map.put("data_status","F");//数据状态
|
||||
map.put("update_status","0");//修改状态
|
||||
comparisonEntity.setMap(map);
|
||||
comparisonEntity.setDataId(jsonObjectMain.getString("data_id"));
|
||||
comparisonEntity.setId(id);
|
||||
/*//生成单据规则
|
||||
comparisonEntity.setRulePrefix(jsonObject.getString("rulePrefix"));
|
||||
try {
|
||||
|
@ -385,6 +399,7 @@ public class ComparisonServiceImpl extends BaseService<ComparisonEntity, String>
|
|||
stringObjectMap.put("sts", "Y");
|
||||
stringObjectMap.put("data_status","F");//数据状态
|
||||
comparisonDetailsEntity.setDataId(String.valueOf(stringObjectMap.get("data_id")));
|
||||
comparisonDetailsEntity.setFormmainId(id);
|
||||
comparisonDetailsEntity.setMapDetails(stringObjectMap);
|
||||
comparisonDetailsEntity.setDbName(String.valueOf(stringObjectMap.get("table_name")));
|
||||
stringObjectMap.remove("table_name");
|
||||
|
@ -473,14 +488,27 @@ public class ComparisonServiceImpl extends BaseService<ComparisonEntity, String>
|
|||
}
|
||||
}
|
||||
}
|
||||
comparisonEntity.setDataId(jsonObjectMain.getString("data_id"));
|
||||
|
||||
//根据data_id查询主表id.根据id删除主表数据,然后再根据主表id和明细表data_id删除明细表数据
|
||||
Map<String,Object> mapId=new HashMap<>();
|
||||
mapId.put("data_id",jsonObjectMain.getString("data_id"));
|
||||
ComparisonEntity comparison=new ComparisonEntity();
|
||||
comparison.setDbName(comparisonEntity.getDbName());
|
||||
comparison.setMap(mapId);
|
||||
List<Map<String,Object>> comparisonEntitiePages = comparisonDao.queryComparisonPage(comparison);
|
||||
if(CollectionUtils.isEmpty(comparisonEntitiePages)){
|
||||
return BaseResult.getFailureMessageEntity("根据data_id查询id数据为空,请检查data_id");
|
||||
}
|
||||
String id = String.valueOf(comparisonEntitiePages.get(0).get("id"));
|
||||
|
||||
comparisonEntity.setId(id);
|
||||
comparisonEntity.setModify_user_id("c796fd9ba4c9f5ff3cc2fa41a040e443");
|
||||
comparisonEntity.setMap(map);
|
||||
try {
|
||||
Integer integer = comparisonDao.deleteComparison(comparisonEntity);
|
||||
if(integer>0){
|
||||
if(comparisonDetailsEntity.getDbName()!=null){
|
||||
comparisonDetailsEntity.setFormmainId(jsonObjectMain.getString("data_id"));
|
||||
comparisonDetailsEntity.setFormmainId(id);
|
||||
comparisonDetailsEntity.setModify_user_id("c796fd9ba4c9f5ff3cc2fa41a040e443");
|
||||
comparisonDetailsDao.deleteComparisonDetails(comparisonDetailsEntity);
|
||||
// controlsLogDaoimpl.saveControlsLog(comparisonDetailsEntity.getId(),jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口删除",jsonObject.getString("optionName"),comparisonEntity.getDbName()+"_option_log");
|
||||
|
|
Loading…
Reference in New Issue