提交 f679b40d 编写于 作者: ibizdev's avatar ibizdev

ibizdev提交

上级 7cffb530
......@@ -35,7 +35,7 @@ import cn.ibizlab.core.dict.filter.IBZDictSearchContext;
import cn.ibizlab.core.dict.service.mapping.IBZDictMapping;
import cn.ibizlab.service.dictapi.dto.IBZDictItemDTO;
import cn.ibizlab.core.dict.service.dto.IBZDictItemDTO;
import cn.ibizlab.core.dict.domain.IBZDictItem;
import cn.ibizlab.core.dict.service.IIBZDictItemService;
......@@ -59,7 +59,7 @@ public class IBZDictResource {
@RequestMapping(method = RequestMethod.GET, value = "/dictapi/ibzdicts/{ibzdict_id}")
public ResponseEntity<IBZDictDTO> get(@PathVariable("ibzdict_id") String ibzdict_id) {
IBZDict domain = ibzdictService.get(ibzdict_id);
IBZDictDTO dto = IBZDictMapping.MAPPER.toDto(domain);
IBZDictDTO dto = ibzdictMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
......@@ -77,7 +77,7 @@ public class IBZDictResource {
@ApiOperation(value = "CheckKey", tags = {"IBZDict" }, notes = "CheckKey")
@RequestMapping(method = RequestMethod.POST, value = "/dictapi/ibzdicts/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody IBZDictDTO ibzdictdto) {
return ResponseEntity.status(HttpStatus.OK).body(true);
return ResponseEntity.status(HttpStatus.OK).body(ibzdictService.checkKey(ibzdictMapping.toDomain(itemCodeNameLC + "dto")));
}
@ApiOperation(value = "GetDraft", tags = {"IBZDict" }, notes = "GetDraft")
......@@ -90,10 +90,10 @@ public class IBZDictResource {
@RequestMapping(method = RequestMethod.PUT, value = "/dictapi/ibzdicts/{ibzdict_id}")
@Transactional
public ResponseEntity<IBZDictDTO> update(@PathVariable("ibzdict_id") String ibzdict_id, @RequestBody IBZDictDTO ibzdictdto) {
IBZDict domain = IBZDictMapping.MAPPER.toDomain(ibzdictdto);
domain.setDictId(ibzdict_id);
IBZDict domain = ibzdictMapping.toDomain(ibzdictdto);
domain.setDictid(ibzdict_id);
ibzdictService.update(domain);
IBZDictDTO dto = IBZDictMapping.MAPPER.toDto(domain);
IBZDictDTO dto = ibzdictMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
......@@ -101,25 +101,14 @@ public class IBZDictResource {
@RequestMapping(method = RequestMethod.DELETE, value = "/dictapi/ibzdicts/{ibzdict_id}")
@Transactional
public ResponseEntity<Boolean> remove(@PathVariable("ibzdict_id") String ibzdict_id) {
IBZDictDTO ibzdictdto = new IBZDictDTO();
IBZDict domain = new IBZDict();
ibzdictdto.setDictId(ibzdict_id);
domain.setDictId(ibzdict_id);
Boolean rst = ibzdictService.remove(domain.getDictId());
if(rst){
return ResponseEntity.status(HttpStatus.OK).body(rst);
}else{
return ResponseEntity.status(HttpStatus.OK).body(rst);
}
return ResponseEntity.status(HttpStatus.OK).body(ibzdictService.remove(ibzdict_id));
}
//SAVE
@ApiOperation(value = "Save", tags = {"IBZDict" }, notes = "Save")
@RequestMapping(method = RequestMethod.POST, value = "/dictapi/ibzdicts/{ibzdict_id}/save")
public ResponseEntity<Boolean> save(@RequestBody IBZDictDTO ibzdictdto) {
IBZDict ibzdict = IBZDictMapping.MAPPER.toDomain(ibzdictdto);
Boolean b = ibzdictService.save(ibzdict) ;
return ResponseEntity.status(HttpStatus.OK).body(b);
return ResponseEntity.status(HttpStatus.OK).body(ibzdictService.save(ibzdictMapping.toDomain(ibzdictdto)));
}
//9
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册