注掉部分超哥代码 使程序先跑起来
This commit is contained in:
+5
-5
@@ -77,11 +77,11 @@ public class SarStandardsInfoController extends BaseController<SarStandardsInfo>
|
|||||||
@Autowired
|
@Autowired
|
||||||
ISarLawsInfoService sarLawsInfoEOService;
|
ISarLawsInfoService sarLawsInfoEOService;
|
||||||
|
|
||||||
@ApiOperation(value="SarStandardsInfoEO|反向标准操作")
|
// @ApiOperation(value="SarStandardsInfoEO|反向标准操作")
|
||||||
@GetMapping(value = "/reverseQueryStand")
|
// @GetMapping(value = "/reverseQueryStand")
|
||||||
public void reverseQueryStand(@RequestParam(name="ids",required=true) String ids, String standName, String type) {
|
// public void reverseQueryStand(@RequestParam(name="ids",required=true) String ids, String standName, String type) {
|
||||||
this.sarStandardsInfoEOService.reverseQueryStand(Arrays.asList(ids.split(",")),standName,type);
|
// this.sarStandardsInfoEOService.reverseQueryStand(Arrays.asList(ids.split(",")),standName,type);
|
||||||
}
|
// }
|
||||||
|
|
||||||
@ApiOperation(value = "|SarStandardsInfoEO|自定义分页查询")
|
@ApiOperation(value = "|SarStandardsInfoEO|自定义分页查询")
|
||||||
@GetMapping("/getSarStandardsInfoPage")
|
@GetMapping("/getSarStandardsInfoPage")
|
||||||
|
|||||||
+1
-1
@@ -17,7 +17,7 @@ import java.util.Map;
|
|||||||
*/
|
*/
|
||||||
public interface ISarStandardsInfoService extends IService<SarStandardsInfo> {
|
public interface ISarStandardsInfoService extends IService<SarStandardsInfo> {
|
||||||
|
|
||||||
void reverseQueryStand(List<String> ids, String standName,String type);
|
// void reverseQueryStand(List<String> ids, String standName,String type);
|
||||||
|
|
||||||
List<SarStandardsInfo> getSarStandardsInfoPage(SarStandardsInfoEOPage page) throws Exception;
|
List<SarStandardsInfo> getSarStandardsInfoPage(SarStandardsInfoEOPage page) throws Exception;
|
||||||
|
|
||||||
|
|||||||
+53
-53
@@ -194,59 +194,59 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
|
|||||||
@Autowired
|
@Autowired
|
||||||
private StandLawsSearchService standLawsSearchService;
|
private StandLawsSearchService standLawsSearchService;
|
||||||
|
|
||||||
/**
|
// /**
|
||||||
* 反向操作标准
|
// * 反向操作标准
|
||||||
*/
|
// */
|
||||||
@Override
|
// @Override
|
||||||
@Async
|
// @Async
|
||||||
public void reverseQueryStand(List<String> ids, String standName,String type){
|
// public void reverseQueryStand(List<String> ids, String standName,String type){
|
||||||
String fieldInfo = InitStandAttrUtil.queryField;
|
// String fieldInfo = InitStandAttrUtil.queryField;
|
||||||
if (StringUtils.isNotBlank(fieldInfo) && StringUtils.isNotBlank(type)) {
|
// if (StringUtils.isNotBlank(fieldInfo) && StringUtils.isNotBlank(type)) {
|
||||||
List<Map<String, Object>> getAttrListMap = sarStandAttrInfoEODao.selectStandFieldAndDataListMap(fieldInfo, ids);
|
// List<Map<String, Object>> getAttrListMap = sarStandAttrInfoEODao.selectStandFieldAndDataListMap(fieldInfo, ids);
|
||||||
getAttrListMap.forEach(attrMap -> {
|
// getAttrListMap.forEach(attrMap -> {
|
||||||
List<String> list = Collections.singletonList(attrMap.get(type).toString());
|
// List<String> list = Collections.singletonList(attrMap.get(type).toString());
|
||||||
list.add(standName);
|
// list.add(standName);
|
||||||
String reverseStandName = list.stream().map(String::toString).collect(Collectors.joining(","));
|
// String reverseStandName = list.stream().map(String::toString).collect(Collectors.joining(","));
|
||||||
attrMap.put(type,reverseStandName);
|
// attrMap.put(type,reverseStandName);
|
||||||
SarStandAttrInfo sarStandAttrInfo = map2Object(attrMap,SarStandAttrInfo.class);
|
// SarStandAttrInfo sarStandAttrInfo = map2Object(attrMap,SarStandAttrInfo.class);
|
||||||
sarStandAttrInfoEODao.updateById(sarStandAttrInfo);
|
// sarStandAttrInfoEODao.updateById(sarStandAttrInfo);
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
public static <T> T map2Object(Map<String, Object> map, Class<T> clazz) {
|
// public static <T> T map2Object(Map<String, Object> map, Class<T> clazz) {
|
||||||
|
//
|
||||||
T obj = null;
|
// T obj = null;
|
||||||
try {
|
// try {
|
||||||
BeanInfo bean = Introspector.getBeanInfo(clazz);
|
// BeanInfo bean = Introspector.getBeanInfo(clazz);
|
||||||
PropertyDescriptor[] propertyDescriptorArr = bean.getPropertyDescriptors();
|
// PropertyDescriptor[] propertyDescriptorArr = bean.getPropertyDescriptors();
|
||||||
for (int i = 0; i < propertyDescriptorArr.length; i++) {
|
// for (int i = 0; i < propertyDescriptorArr.length; i++) {
|
||||||
PropertyDescriptor propertyDescriptor = propertyDescriptorArr[i];
|
// PropertyDescriptor propertyDescriptor = propertyDescriptorArr[i];
|
||||||
String name = propertyDescriptor.getName();
|
// String name = propertyDescriptor.getName();
|
||||||
if(map.containsKey(name)) {
|
// if(map.containsKey(name)) {
|
||||||
Object value = map.get(name);
|
// Object value = map.get(name);
|
||||||
if("null".equals(value)) {
|
// if("null".equals(value)) {
|
||||||
value = null;
|
// value = null;
|
||||||
}
|
// }
|
||||||
Object[] objArr = new Object[0];
|
// Object[] objArr = new Object[0];
|
||||||
objArr[0] = value;
|
// objArr[0] = value;
|
||||||
try {
|
// try {
|
||||||
propertyDescriptor.getWriteMethod().invoke(obj, objArr);
|
// propertyDescriptor.getWriteMethod().invoke(obj, objArr);
|
||||||
} catch (IllegalAccessException e) {
|
// } catch (IllegalAccessException e) {
|
||||||
e.printStackTrace();
|
// e.printStackTrace();
|
||||||
} catch (IllegalArgumentException e) {
|
// } catch (IllegalArgumentException e) {
|
||||||
e.printStackTrace();
|
// e.printStackTrace();
|
||||||
} catch (InvocationTargetException e) {
|
// } catch (InvocationTargetException e) {
|
||||||
e.printStackTrace();
|
// e.printStackTrace();
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
}
|
// }
|
||||||
} catch (IntrospectionException e) {
|
// } catch (IntrospectionException e) {
|
||||||
e.printStackTrace();
|
// e.printStackTrace();
|
||||||
}
|
// }
|
||||||
return obj;
|
// return obj;
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
/***
|
/***
|
||||||
|
|||||||
Reference in New Issue
Block a user