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

ibizdev提交

上级 47eeb636
......@@ -8,7 +8,7 @@
type="date"
:transfer="true"
:format="valFormat"
:placeholder="$t('info.placeholder')"
:placeholder="$t('components.appRangeEditor.placeholder')"
:value="activeData[item]"
:disabled="disabled"
@on-change="(value,type)=>{onValueChange(item,value)}">
......@@ -18,34 +18,33 @@
v-else-if="editorType.startsWith('DATEPICKEREX')"
:transfer="true"
:format="valFormat"
:placeholder="$t('info.placeholder')"
:placeholder="$t('components.appRangeEditor.placeholder')"
:value="activeData[item]"
:disabled="disabled"
@on-change="(value)=>{onValueChange(item,value)}">
</time-picker>
<i-input
<InputNumber
:key="index"
v-else-if="Object.is(editorType, 'NUMBER')"
type="number"
:value="getValue(item)"
:value="activeData[item]"
:disabled="disabled"
:placeholder="$t('info.input')"
@on-change="setValue">
</i-input>
:placeholder="$t('components.appRangeEditor.input')"
@on-change="(value)=>{onValueChange(item,value)}">
</InputNumber>
<app-span
:key="index"
v-else-if="Object.is(editorType, 'SPAN')"
:value="activeData[item]"
:disabled="disabled">
</app-span>
<i-input
<el-input
:key="index"
v-else
:value="getValue(item)"
:disabled="disabled"
:placeholder="$t('info.input')"
@on-change="setValue">
</i-input>
:placeholder="$t('components.appRangeEditor.input')"
@input="(value)=>{onValueChange(item,value)}">
</el-input>
</template>
</div>
</template>
......
......@@ -116,7 +116,7 @@ export default class EntityService {
* @memberof EntityService
*/
public async Select(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
return { status: 500, data: { title: '失败', message: '预置实体行为 Select 未实现' }};
return this.SelectTemp(context,data,isloading);
}
/**
......@@ -198,7 +198,7 @@ export default class EntityService {
* @memberof EntityService
*/
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
return { status: 500, data: { title: '失败', message: '预置实体行为 Update 未实现' }};
return this.UpdateTemp(context,data,isloading);
}
/**
......@@ -322,7 +322,7 @@ export default class EntityService {
* @memberof EntityService
*/
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
return { status: 500, data: { title: '失败', message: '预置实体行为 GetDraft 未实现' }};
return this.GetDraftTemp(context,data,isloading);
}
/**
......@@ -335,7 +335,7 @@ export default class EntityService {
* @memberof EntityService
*/
public async Remove(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
return { status: 500, data: { title: '失败', message: '预置实体行为 Remove 未实现' }};
return this.RemoveTemp(context,data,isloading);
}
/**
......@@ -374,7 +374,7 @@ export default class EntityService {
* @memberof EntityService
*/
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
return { status: 500, data: { title: '失败', message: '预置实体行为 Get 未实现' }};
return this.GetTemp(context,data,isloading);
}
/**
......@@ -400,7 +400,7 @@ export default class EntityService {
* @memberof EntityService
*/
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
return { status: 500, data: { title: '失败', message: '预置实体行为 Create 未实现' }};
return this.CreateTemp(context,data,isloading);
}
/**
......
......@@ -57,50 +57,35 @@ public class IBZDictItemResource {
@RequestMapping(method = RequestMethod.GET, value = "/dictapi/ibzdicts/{ibzdict_id}/ibzdictitems/{ibzdictitem_id}")
public ResponseEntity<IBZDictItemDTO> getByIBZDict(@PathVariable("ibzdict_id") String ibzdict_id, @PathVariable("ibzdictitem_id") String ibzdictitem_id) {
IBZDictItem domain = ibzdictitemService.get(ibzdictitem_id);
IBZDictItemDTO dto = IBZDictItemMapping.MAPPER.toDto(domain);
IBZDictItemDTO dto = ibzdictitemMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "GetDraft", tags = {"IBZDictItem" }, notes = "GetDraft")
@RequestMapping(method = RequestMethod.GET, value = "/dictapi/ibzdicts/{ibzdict_id}/ibzdictitems/{ibzdictitemitemid}/getdraft")
@Transactional
public ResponseEntity<IBZDictItemDTO> getDraftByIBZDict(@PathVariable("ibzdict_id") String ibzdict_id, @PathVariable("ibzdictitem_id") String ibzdictitem_id, @RequestBody IBZDictItemDTO ibzdictitemdto) {
//8
IBZDictItem ibzdictitem = IBZDictItemMapping.MAPPER.toDomain(ibzdictitemdto);
ibzdictitem = ibzdictitemService.getDraft(ibzdictitem) ;
ibzdictitemdto = IBZDictItemMapping.MAPPER.toDto(ibzdictitem);
return ResponseEntity.status(HttpStatus.OK).body(ibzdictitemdto);
@RequestMapping(method = RequestMethod.GET, value = "/dictapi/ibzdicts/{ibzdict_id}/ibzdictitems/getdraft")
public ResponseEntity<IBZDictItemDTO> getDraftByIBZDict(@PathVariable("ibzdict_id") String ibzdict_id) {
IBZDictItem domain = new IBZDictItem();
domain.setDictid(ibzdict_id);
return ResponseEntity.status(HttpStatus.OK).body(ibzdictitemMapping.toDto(ibzdictitemService.getDraft(domain)));
}
@ApiOperation(value = "Save", tags = {"IBZDictItem" }, notes = "Save")
@RequestMapping(method = RequestMethod.POST, value = "/dictapi/ibzdicts/{ibzdict_id}/ibzdictitems/save")
public ResponseEntity<Boolean> saveByIBZDict(@PathVariable("ibzdict_id") String ibzdict_id, @RequestBody IBZDictItemDTO ibzdictitemdto) {
//6
IBZDictItem domain = IBZDictItemMapping.MAPPER.toDomain(ibzdictitemdto);
domain.setDictId(ibzdict_id);
Boolean b = ibzdictitemService.save(domain) ;
return ResponseEntity.status(HttpStatus.OK).body(b);
IBZDictItem domain = ibzdictitemMapping.toDomain(ibzdictitemdto);
domain.setDictid(ibzdict_id);
return ResponseEntity.status(HttpStatus.OK).body(ibzdictitemService.save(domain));
}
@ApiOperation(value = "CheckKey", tags = {"IBZDictItem" }, notes = "CheckKey")
@RequestMapping(method = RequestMethod.POST, value = "/dictapi/ibzdicts/{ibzdict_id}/ibzdictitems/checkkey")
public ResponseEntity<Boolean> checkKeyByIBZDict(@PathVariable("ibzdict_id") String ibzdict_id, @RequestBody IBZDictItemDTO ibzdictitemdto) {
return ResponseEntity.status(HttpStatus.OK).body(true);
return ResponseEntity.status(HttpStatus.OK).body(ibzdictitemService.checkKey(ibzdictitemMapping.toDomain(ibzdictitemdto)));
}
@ApiOperation(value = "Remove", tags = {"IBZDictItem" }, notes = "Remove")
@RequestMapping(method = RequestMethod.DELETE, value = "/dictapi/ibzdicts/{ibzdict_id}/ibzdictitems/{ibzdictitem_id}")
@Transactional
public ResponseEntity<Boolean> removeByIBZDict(@PathVariable("ibzdict_id") String ibzdict_id, @PathVariable("ibzdictitem_id") String ibzdictitem_id) {
IBZDictItem domain = new IBZDictItem();
domain.setItemid(ibzdictitem_id);
Boolean rst = ibzdictitemService.remove(domain.getItemid());
if(rst){
return ResponseEntity.status(HttpStatus.OK).body(rst);
}else{
return ResponseEntity.status(HttpStatus.OK).body(rst);
}
return ResponseEntity.status(HttpStatus.OK).body(ibzdictitemService.remove(ibzdictitem_id));
}
@ApiOperation(value = "Create", tags = {"IBZDictItem" }, notes = "Create")
......@@ -108,10 +93,10 @@ public class IBZDictItemResource {
@Transactional
public ResponseEntity<IBZDictItemDTO> createByIBZDict(@PathVariable("ibzdict_id") String ibzdict_id, @RequestBody IBZDictItemDTO ibzdictitemdto) {
//4
IBZDictItem domain = IBZDictItemMapping.MAPPER.toDomain(ibzdictitemdto);
domain.setDictId(ibzdict_id);
IBZDictItem domain = ibzdictitemMapping.toDomain(ibzdictitemdto);
domain.setDictid(ibzdict_id);
ibzdictitemService.create(domain);
IBZDictItemDTO dto = IBZDictItemMapping.MAPPER.toDto(domain);
IBZDictItemDTO dto = ibzdictitemMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
......@@ -120,27 +105,26 @@ public class IBZDictItemResource {
@Transactional
public ResponseEntity<IBZDictItemDTO> updateByIBZDict(@PathVariable("ibzdict_id") String ibzdict_id, @PathVariable("ibzdictitem_id") String ibzdictitem_id, @RequestBody IBZDictItemDTO ibzdictitemdto) {
//5
IBZDictItem domain = IBZDictItemMapping.MAPPER.toDomain(ibzdictitemdto);
domain.setDictId(ibzdict_id);
IBZDictItem domain = ibzdictitemMapping.toDomain(ibzdictitemdto);
domain.setDictid(ibzdict_id);
domain.setItemid(ibzdictitem_id);
ibzdictitemService.update(domain);
IBZDictItemDTO dto = IBZDictItemMapping.MAPPER.toDto(domain);
IBZDictItemDTO dto = ibzdictitemMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
//10
@ApiOperation(value = "获取DEFAULT", tags = {"IBZDictItem" } ,notes = "获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/dictapi/ibzdicts/{ibzdict_id}/ibzdictitems/fetchdefault")
public ResponseEntity<Page<IBZDictItemDTO>> fetchIBZDictItemDefault(@PathVariable("ibzdict_id") String ibzdict_id,IBZDictItemSearchContext context,Pageable pageable ,ServletRequest request) {
context.setPageable(pageable);
List<IBZDictItemDTO> list = new ArrayList<IBZDictItemDTO>();
public ResponseEntity<List<IBZDictItemDTO>> fetchIBZDictItemDefault(@PathVariable("ibzdict_id") String ibzdict_id,IBZDictItemSearchContext context) {
context.setN_dictid_eq(ibzdict_id);
Page<IBZDictItem> domains = ibzdictitemService.searchDefault(context) ;
for(IBZDictItem ibzdictitem : domains.getContent()){
IBZDictItemDTO dto = IBZDictItemMapping.MAPPER.toDto(ibzdictitem);
list.add(dto);
}
return ResponseEntity.status(HttpStatus.OK).body(new PageImpl(list,context.getPageable(),domains.getTotalElements()));
List<IBZDictItemDTO> list = ibzdictitemMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
......
......@@ -79,7 +79,7 @@ public class IBZDictResource {
@RequestMapping(method = RequestMethod.GET, value = "/ibzdicts/getdraft")
@Transactional
public ResponseEntity<IBZDictDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(new IBZDictDTO());
return ResponseEntity.status(HttpStatus.OK).body(ibzdictMapping.toDto(ibzdictService.getDraft(new IBZDict())));
}
@ApiOperation(value = "Update", tags = {"IBZDict" }, notes = "Update")
@RequestMapping(method = RequestMethod.PUT, value = "/ibzdicts/{ibzdict_id}")
......
......@@ -70,14 +70,14 @@ public class SearchContextBase implements ISearchContext{
public void setSort(String strSort) {
this.sort=strSort;
if(!StringUtils.isEmpty(strSort)){
String arrSort[]=strSort.split(",");
String field=arrSort[0];
String order=arrSort[1];
if(order.equalsIgnoreCase("asc")){
this.pageSort=Sort.by(Sort.Direction.ASC,field);
String sortArr[]=strSort.split(",");
String sortField=sortArr[0];
String sortDirection=sortArr[1];
if(sortDirection.equalsIgnoreCase("asc")){
this.pageSort=Sort.by(Sort.Direction.ASC,sortField);
}
else if(order.equalsIgnoreCase("desc")){
this.pageSort=Sort.by(Sort.Direction.DESC,field);
else if(sortDirection.equalsIgnoreCase("desc")){
this.pageSort=Sort.by(Sort.Direction.DESC,sortField);
}
}
}
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册