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

ibizdev提交

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