提交 10d71a9c 编写于 作者: sq3536's avatar sq3536

bugfix

上级 39c53762
......@@ -36,8 +36,15 @@ public class G1ResResource {
{{#each app.exModel as |item|}}
INSERT INTO datasubscription (C_ID, C_ACCESS_ID, C_RESOURCE_ID, C_CRON, C_TARGET) VALUES ('hbxfdpt0068-{{upperCase @key}}', 'hbxfdpt0068', 'TOPIC_WSXF_RESOURCE_{{upperCase @key}}', '20 3 * * *', null);
{{/each}}
{{#each app.appEntities as |appEntity|}}
{{#each appEntity.forms as |form|}}
INSERT INTO apioperation (C_ID, C_RESOURCE_ID, C_VALUE, C_TAGS, C_HTTP_METHOD, C_PATH, C_DOC_PATH) VALUES ('add{{pascalCase appEntity.codeName}}{{pascalCase form.codeName}}UsingPOST', 'push', '新建{{appEntity.entity.logicName}}[{{form.codeName}}]{{replace form.logicName "表单" ""}}', '{{appEntity.entity.logicName}}', 'POST', '/xftong/link/{{pluralize appEntity.entity.codeName}}/{{lowerCase form.codeName}}', '/xftong/doc2.html#/服务接口/{{appEntity.entity.logicName}}/add{{pascalCase appEntity.codeName}}{{pascalCase form.codeName}}UsingPOST');
{{/each}}
{{/each}}
*/
{{#each app.exModel as |item|}}
@ApiOperationSupport(order = 1{{@index}})
@ApiOperation(value = "{{item}}", tags = {"资源目录" }, notes = "topic主题:TOPIC_WSXF_RESOURCE_{{upperCase @key}}")
......
......@@ -43,13 +43,13 @@ public class {{pascalCase appEntity.codeName}}Resource {
{{#each appEntity.forms}}
@ApiOperation(value = "新建[{{codeName}}]{{replace logicName "表单" ""}}", tags = {"{{appEntity.entity.logicName}}" }, notes = "新建[{{codeName}}]{{replace logicName "表单" ""}}")
@RequestMapping(method = RequestMethod.POST, value = "/{{lowerCase codeName}}")
public ResponseEntity<{{pascalCase codeName}}Dto> add{{pascalCase codeName}}(@Validated @RequestBody {{pascalCase codeName}}AddDto dto) {
public ResponseEntity<{{pascalCase codeName}}Dto> add{{pascalCase appEntity.codeName}}{{pascalCase codeName}}(@Validated @RequestBody {{pascalCase codeName}}AddDto dto) {
return null;
}
@ApiOperation(value = "更新[{{codeName}}]{{replace logicName "表单" ""}}", tags = {"{{appEntity.entity.logicName}}" }, notes = "更新[{{codeName}}]{{replace logicName "表单" ""}}")
@RequestMapping(method = RequestMethod.PUT, value = "/{{lowerCase codeName}}/{id}")
public ResponseEntity<{{pascalCase codeName}}Dto> update{{pascalCase codeName}}(@ApiParam("{{appEntity.entity.keyField.logicName}}") @PathVariable("id") {{appEntity.entity.keyField.type.java}} {{camelCase appEntity.entity.keyField.codeName}},@Validated @RequestBody {{pascalCase codeName}}UpdateDto dto) {
public ResponseEntity<{{pascalCase codeName}}Dto> update{{pascalCase appEntity.codeName}}{{pascalCase codeName}}(@ApiParam("{{appEntity.entity.keyField.logicName}}") @PathVariable("id") {{appEntity.entity.keyField.type.java}} {{camelCase appEntity.entity.keyField.codeName}},@Validated @RequestBody {{pascalCase codeName}}UpdateDto dto) {
return null;
}
{{/each}}
......
......@@ -120,7 +120,7 @@ public class {{entity.codeName}}ServiceBase extends ServiceImpl<{{entity.codeNam
}
public Integer checkKey({{entity.codeName}} et) {
return this.count(Wrappers.<{{entity.codeName}}>query(){{#each entity.keyFields as |field|}}.eq("{{lowerCase field.name}}", et.get{{pascalCase field.codeName}}()){{/each}})>0?1:0;
return ( (!ObjectUtils.isEmpty(et.get{{pascalCase entity.keyField.codeName}}())) && this.count(Wrappers.<{{entity.codeName}}>query(){{#each entity.keyFields as |field|}}.eq("{{lowerCase field.name}}", et.get{{pascalCase field.codeName}}()){{/each}})>0 )?1:0;
}
@Override
......@@ -239,7 +239,7 @@ public class {{entity.codeName}}ServiceBase extends ServiceImpl<{{entity.codeNam
{{#eq entity.actions.save.transactionMode "GLOBAL"}}@GlobalTransactional{{/eq}}{{#eq entity.actions.save.transactionMode "DEFAULT"}}@Transactional{{/eq}}
public boolean save({{entity.codeName}} et) {
if(checkKey(et)==0)
if(checkKey(et)>0)
return getSelf().update(et);
else
return getSelf().create(et);
......
......@@ -125,7 +125,7 @@ public class {{entity.codeName}}ServiceImpl extends ServiceImpl<{{entity.codeNam
}
public boolean checkKey({{entity.codeName}} et) {
return this.count(Wrappers.<{{entity.codeName}}>query(){{#each entity.keyFields as |field|}}.eq("{{lowerCase field.name}}", et.get{{pascalCase field.codeName}}()){{/each}})>0;
return (!ObjectUtils.isEmpty(et.get{{pascalCase entity.keyField.codeName}}())) && this.count(Wrappers.<{{entity.codeName}}>query(){{#each entity.keyFields as |field|}}.eq("{{lowerCase field.name}}", et.get{{pascalCase field.codeName}}()){{/each}})>0;
}
@Override
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册