use of com.ngtesting.platform.vo.CustomFieldOptionVo in project ngtesting-platform by aaronchen2k.
the class CustomFieldOptionServiceImpl method genVos.
@Override
public List<CustomFieldOptionVo> genVos(List<TestCustomFieldOption> pos) {
List<CustomFieldOptionVo> vos = new LinkedList<>();
for (TestCustomFieldOption po : pos) {
CustomFieldOptionVo vo = genVo(po);
vos.add(vo);
}
return vos;
}
use of com.ngtesting.platform.vo.CustomFieldOptionVo in project ngtesting-platform by aaronchen2k.
the class CustomFieldOptionServiceImpl method genVo.
@Override
public CustomFieldOptionVo genVo(TestCustomFieldOption po) {
CustomFieldOptionVo vo = new CustomFieldOptionVo();
BeanUtilEx.copyProperties(vo, po);
return vo;
}
use of com.ngtesting.platform.vo.CustomFieldOptionVo in project ngtesting-platform by aaronchen2k.
the class CustomFieldOptionAction method changeOrder.
@AuthPassport(validate = true)
@RequestMapping(value = "changeOrder", method = RequestMethod.POST)
@ResponseBody
public Map<String, Object> changeOrder(HttpServletRequest request, @RequestBody JSONObject json) {
Map<String, Object> ret = new HashMap<String, Object>();
UserVo userVo = (UserVo) request.getSession().getAttribute(Constant.HTTP_SESSION_USER_KEY);
Long fieldId = json.getLong("fieldId");
Long id = json.getLong("id");
String act = json.getString("act");
boolean success = customFieldOptionService.changeOrderPers(id, act, fieldId);
List<CustomFieldOptionVo> vos = customFieldOptionService.listVos(fieldId);
ret.put("data", vos);
ret.put("code", Constant.RespCode.SUCCESS.getCode());
return ret;
}
use of com.ngtesting.platform.vo.CustomFieldOptionVo in project ngtesting-platform by aaronchen2k.
the class CustomFieldOptionAction method save.
@AuthPassport(validate = true)
@RequestMapping(value = "save", method = RequestMethod.POST)
@ResponseBody
public Map<String, Object> save(HttpServletRequest request, @RequestBody JSONObject json) {
Map<String, Object> ret = new HashMap<String, Object>();
UserVo userVo = (UserVo) request.getSession().getAttribute(Constant.HTTP_SESSION_USER_KEY);
CustomFieldOptionVo option = JSON.parseObject(JSON.toJSONString(json.getJSONObject("model")), CustomFieldOptionVo.class);
TestCustomFieldOption po = customFieldOptionService.save(option);
List<CustomFieldOptionVo> vos = customFieldOptionService.listVos(po.getFieldId());
ret.put("data", vos);
ret.put("code", Constant.RespCode.SUCCESS.getCode());
return ret;
}
use of com.ngtesting.platform.vo.CustomFieldOptionVo in project ngtesting-platform by aaronchen2k.
the class CustomFieldOptionServiceImpl method listVos.
@Override
public List<CustomFieldOptionVo> listVos(Long fieldId) {
DetachedCriteria dc = DetachedCriteria.forClass(TestCustomFieldOption.class);
dc.add(Restrictions.eq("fieldId", fieldId));
dc.add(Restrictions.eq("disabled", Boolean.FALSE));
dc.add(Restrictions.eq("deleted", Boolean.FALSE));
dc.addOrder(Order.asc("ordr"));
List ls = findAllByCriteria(dc);
List<CustomFieldOptionVo> vos = genVos(ls);
return vos;
}
Aggregations