| | |
| | | |
| | | select count(*) from lf.sys_downlog a inner join lf.sys_user b on a.create_user = b.id inner join lf.sys_download c on a.downid = c.id |
| | | WHERE 1 = 1 and b.uname like '%管çå%' and c.type = 3 and a.create_time >= ? and a.create_time <= ? |
| | | select * from lf.sys_download |
| | | select * from lf.sys_downlog |
| | | select * from lf.sys_download where id in (80,100); |
| | | select * from lf.sys_downlog; |
| | | |
| | | |
| | | |
| | |
| | | -- insert into lf.sys_downlog(downid,ip,create_user) values (100,'192.168.20.39',1); |
| | | |
| | | select * from lf.sys_downlog; |
| | | ----------------------------------------------------------------------------------------------------- 30.æ°æ®ç³è¯·è¡¨ |
| | | -- drop table if exists lf.sys_apply; |
| | | create table lf.sys_apply ( |
| | | id serial primary key, |
| | | userid integer default 0, |
| | | depids varchar(100), |
| | | tables varchar(1000), |
| | | wkt varchar(4000), |
| | | status integer default 0, |
| | | count integer default 0, |
| | | descr varchar(50), |
| | | create_user integer default 1, |
| | | create_time timestamp(6) without time zone default now(), |
| | | update_user integer, |
| | | update_time timestamp(6) without time zone |
| | | ); |
| | | comment on table lf.sys_apply is 'æ°æ®ç³è¯·è¡¨'; |
| | | comment on column lf.sys_apply.id is '主é®ID'; |
| | | comment on column lf.sys_apply.userid is 'ç¨æ·ID'; |
| | | comment on column lf.sys_apply.depids is 'åä½ID'; |
| | | comment on column lf.sys_apply.tables is '表å'; |
| | | comment on column lf.sys_apply.wkt is 'WKT'; |
| | | comment on column lf.sys_apply.status is 'ç¶æï¼-10-ä½åºï¼-1-æåï¼0-ç³è¯·ä¸ï¼1~9ï¼å®¡æ ¸ä¸ï¼10-éè¿'; |
| | | comment on column lf.sys_apply.count is 'å®¡æ ¸æ»æ°'; |
| | | comment on column lf.sys_apply.descr is 'æè¿°'; |
| | | comment on column lf.sys_apply.create_user is 'å建人id'; |
| | | comment on column lf.sys_apply.create_time is 'å建æ¶é´'; |
| | | comment on column lf.sys_apply.update_user is 'æ´æ°äººid'; |
| | | comment on column lf.sys_apply.update_time is 'æ´æ°æ¶é´'; |
| | | |
| | | select * from lf.sys_apply; |
| | | ----------------------------------------------------------------------------------------------------- 31.ç³è¯·æµç¨è¡¨ |
| | | -- drop table if exists lf.sys_flow; |
| | | create table lf.sys_flow ( |
| | | id serial primary key, |
| | | applyid integer, |
| | | depid integer, |
| | | userid integer, |
| | | status integer default 0, |
| | | descr varchar(50), |
| | | create_user integer default 1, |
| | | create_time timestamp(6) without time zone default now(), |
| | | update_user integer, |
| | | update_time timestamp(6) without time zone |
| | | ); |
| | | comment on table lf.sys_flow is 'ç³è¯·æµç¨è¡¨'; |
| | | comment on column lf.sys_flow.id is '主é®id'; |
| | | comment on column lf.sys_flow.applyid is 'ç³è¯·ID'; |
| | | comment on column lf.sys_flow.depid is 'åä½ID'; |
| | | comment on column lf.sys_flow.userid is 'ç¨æ·ID'; |
| | | comment on column lf.sys_flow.status is 'ç¶æï¼-1-æåï¼0-ç³è¯·ä¸ï¼1-éè¿'; |
| | | comment on column lf.sys_flow.descr is 'æè¿°'; |
| | | comment on column lf.sys_flow.create_user is 'å建人id'; |
| | | comment on column lf.sys_flow.create_time is 'å建æ¶é´'; |
| | | comment on column lf.sys_flow.update_user is 'æ´æ°äººid'; |
| | | comment on column lf.sys_flow.update_time is 'æ´æ°æ¶é´'; |
| | | |
| | | select * from lf.sys_flow; |
| | | ----------------------------------------------------------------------------------------------------- å
æ°æ®æµè¯è¡¨ * |
| | | -- drop table if exists md.md_zxcg; |
| | | create table md.md_zxcg( |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.lf.server.controller.show; |
| | | |
| | | import com.lf.server.annotation.SysLog; |
| | | import com.lf.server.controller.all.BaseController; |
| | | import com.lf.server.entity.all.ResponseMsg; |
| | | import com.lf.server.entity.show.ApplyEntity; |
| | | import com.lf.server.entity.sys.UserEntity; |
| | | import com.lf.server.service.show.ApplyService; |
| | | import com.lf.server.service.sys.TokenService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * æ°æ®ç³è¯· |
| | | * @author WWW |
| | | */ |
| | | @Api(tags = "è¿ç»´ç®¡ç\\æ°æ®ç³è¯·") |
| | | @RestController |
| | | @RequestMapping("/apply") |
| | | public class ApplyController extends BaseController { |
| | | @Autowired |
| | | ApplyService applyService; |
| | | |
| | | @Autowired |
| | | TokenService tokenService; |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢è®°å½æ°") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "userid", value = "ç¨æ·ID", dataType = "Integer", paramType = "query", required = false, example = "") |
| | | }) |
| | | @GetMapping({"/selectCount"}) |
| | | public ResponseMsg<Integer> selectCount(Integer userid) { |
| | | try { |
| | | int count = applyService.selectCount(userid); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "å页æ¥è¯¢") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "userid", value = "ç¨æ·ID", dataType = "Integer", paramType = "query", example = ""), |
| | | @ApiImplicitParam(name = "pageSize", value = "æ¯é¡µæ¡æ°", dataType = "Integer", paramType = "query", example = "10"), |
| | | @ApiImplicitParam(name = "pageIndex", value = "å页æ°ï¼ä»1å¼å§ï¼", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/selectByPage") |
| | | public ResponseMsg<List<ApplyEntity>> selectByPage(Integer userid, Integer pageSize, Integer pageIndex) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("æ¯é¡µé¡µæ°æå页æ°å°äº1", null); |
| | | } |
| | | |
| | | List<ApplyEntity> rs = applyService.selectByPage(userid, pageSize, pageSize * (pageIndex - 1)); |
| | | |
| | | return success(rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "å页æ¥è¯¢å¹¶è¿åè®°å½æ°") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "userid", value = "ç¨æ·ID", dataType = "Integer", paramType = "query", example = ""), |
| | | @ApiImplicitParam(name = "pageSize", value = "æ¯é¡µæ¡æ°", dataType = "Integer", paramType = "query", example = "10"), |
| | | @ApiImplicitParam(name = "pageIndex", value = "å页æ°ï¼ä»1å¼å§ï¼", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/selectByPageAndCount") |
| | | public ResponseMsg<List<ApplyEntity>> selectByPageAndCount(Integer userid, Integer pageSize, Integer pageIndex) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("æ¯é¡µé¡µæ°æå页æ°å°äº1", null); |
| | | } |
| | | |
| | | int count = applyService.selectCount(userid); |
| | | if (count == 0) { |
| | | return success(0, null); |
| | | } |
| | | |
| | | List<ApplyEntity> rs = applyService.selectByPage(userid, pageSize, pageSize * (pageIndex - 1)); |
| | | |
| | | return success(count, rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢ææ") |
| | | @GetMapping(value = "/selectAll") |
| | | public ResponseMsg<List<ApplyEntity>> selectAll() { |
| | | try { |
| | | List<ApplyEntity> list = applyService.selectAll(); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ ¹æ®IDæ¥è¯¢") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "ID", dataType = "int", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/selectById") |
| | | public ResponseMsg<ApplyEntity> selectById(int id) { |
| | | try { |
| | | ApplyEntity entity = applyService.selectById(id); |
| | | |
| | | return success(entity); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æå
¥ä¸æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "entity", value = "å®ä½ç±»", dataType = "ApplyEntity", paramType = "body") |
| | | }) |
| | | @PostMapping(value = "/insert", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> insert(@RequestBody ApplyEntity entity, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | entity.setCreateUser(ue.getId()); |
| | | } |
| | | |
| | | int count = applyService.insert(entity); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æå
¥å¤æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "list", value = "å®ä½ç±»éå", dataType = "ApplyEntity", paramType = "body") |
| | | }) |
| | | @PostMapping(value = "/inserts", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> inserts(@RequestBody List<ApplyEntity> list, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | for (ApplyEntity entity : list) { |
| | | entity.setCreateUser(ue.getId()); |
| | | } |
| | | } |
| | | |
| | | int count = applyService.inserts(list); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "å é¤ä¸æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "ID", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/delete") |
| | | public ResponseMsg<Integer> delete(int id) { |
| | | try { |
| | | int count = applyService.delete(id); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "å é¤å¤æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "ids", value = "IDæ°ç»", dataType = "Integer", paramType = "query", example = "1,2") |
| | | }) |
| | | @GetMapping(value = "/deletes") |
| | | public ResponseMsg<Integer> deletes(@RequestParam List<Integer> ids) { |
| | | try { |
| | | if (ids == null || ids.isEmpty()) { |
| | | return fail("idæ°ç»ä¸è½ä¸ºç©º", -1); |
| | | } |
| | | |
| | | int count = applyService.deletes(ids); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ´æ°ä¸æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "entity", value = "å®ä½ç±»", dataType = "ApplyEntity", paramType = "body") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/update", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> update(@RequestBody ApplyEntity entity, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | entity.setUpdateUser(ue.getId()); |
| | | } |
| | | |
| | | int count = applyService.update(entity); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ´æ°å¤æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "list", value = "å®ä½ç±»éå", dataType = "ApplyEntity", paramType = "body") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/updates", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> updates(@RequestBody List<ApplyEntity> list, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | for (ApplyEntity entity : list) { |
| | | entity.setUpdateUser(ue.getId()); |
| | | } |
| | | } |
| | | |
| | | int count = applyService.updates(list); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), -1); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.lf.server.controller.show; |
| | | |
| | | import com.lf.server.annotation.SysLog; |
| | | import com.lf.server.controller.all.BaseController; |
| | | import com.lf.server.entity.all.ResponseMsg; |
| | | import com.lf.server.entity.show.FlowEntity; |
| | | import com.lf.server.entity.sys.UserEntity; |
| | | import com.lf.server.service.show.FlowService; |
| | | import com.lf.server.service.sys.TokenService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * ç³è¯·æµç¨ |
| | | * @author WWW |
| | | */ |
| | | @Api(tags = "è¿ç»´ç®¡ç\\ç³è¯·æµç¨") |
| | | @RestController |
| | | @RequestMapping("/flow") |
| | | public class FlowController extends BaseController { |
| | | @Autowired |
| | | FlowService flowService; |
| | | |
| | | @Autowired |
| | | TokenService tokenService; |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢è®°å½æ°") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "userid", value = "ç¨æ·ID", dataType = "Integer", paramType = "query", required = false, example = "") |
| | | }) |
| | | @GetMapping({"/selectCount"}) |
| | | public ResponseMsg<Integer> selectCount(Integer userid) { |
| | | try { |
| | | int count = flowService.selectCount(userid); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "å页æ¥è¯¢") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "userid", value = "ç¨æ·ID", dataType = "Integer", paramType = "query", example = ""), |
| | | @ApiImplicitParam(name = "pageSize", value = "æ¯é¡µæ¡æ°", dataType = "Integer", paramType = "query", example = "10"), |
| | | @ApiImplicitParam(name = "pageIndex", value = "å页æ°ï¼ä»1å¼å§ï¼", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/selectByPage") |
| | | public ResponseMsg<List<FlowEntity>> selectByPage(Integer userid, Integer pageSize, Integer pageIndex) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("æ¯é¡µé¡µæ°æå页æ°å°äº1", null); |
| | | } |
| | | |
| | | List<FlowEntity> rs = flowService.selectByPage(userid, pageSize, pageSize * (pageIndex - 1)); |
| | | |
| | | return success(rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "å页æ¥è¯¢å¹¶è¿åè®°å½æ°") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "userid", value = "ç¨æ·ID", dataType = "Integer", paramType = "query", example = ""), |
| | | @ApiImplicitParam(name = "pageSize", value = "æ¯é¡µæ¡æ°", dataType = "Integer", paramType = "query", example = "10"), |
| | | @ApiImplicitParam(name = "pageIndex", value = "å页æ°ï¼ä»1å¼å§ï¼", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/selectByPageAndCount") |
| | | public ResponseMsg<List<FlowEntity>> selectByPageAndCount(Integer userid, Integer pageSize, Integer pageIndex) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("æ¯é¡µé¡µæ°æå页æ°å°äº1", null); |
| | | } |
| | | |
| | | int count = flowService.selectCount(userid); |
| | | if (count == 0) { |
| | | return success(0, null); |
| | | } |
| | | |
| | | List<FlowEntity> rs = flowService.selectByPage(userid, pageSize, pageSize * (pageIndex - 1)); |
| | | |
| | | return success(count, rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢ææ") |
| | | @GetMapping(value = "/selectAll") |
| | | public ResponseMsg<List<FlowEntity>> selectAll() { |
| | | try { |
| | | List<FlowEntity> list = flowService.selectAll(); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ ¹æ®IDæ¥è¯¢") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "ID", dataType = "int", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/selectById") |
| | | public ResponseMsg<FlowEntity> selectById(int id) { |
| | | try { |
| | | FlowEntity entity = flowService.selectById(id); |
| | | |
| | | return success(entity); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æå
¥ä¸æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "entity", value = "å®ä½ç±»", dataType = "FlowEntity", paramType = "body") |
| | | }) |
| | | @PostMapping(value = "/insert", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> insert(@RequestBody FlowEntity entity, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | entity.setCreateUser(ue.getId()); |
| | | } |
| | | |
| | | int count = flowService.insert(entity); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æå
¥å¤æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "list", value = "å®ä½ç±»éå", dataType = "FlowEntity", paramType = "body") |
| | | }) |
| | | @PostMapping(value = "/inserts", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> inserts(@RequestBody List<FlowEntity> list, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | for (FlowEntity entity : list) { |
| | | entity.setCreateUser(ue.getId()); |
| | | } |
| | | } |
| | | |
| | | int count = flowService.inserts(list); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "å é¤ä¸æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "ID", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/delete") |
| | | public ResponseMsg<Integer> delete(int id) { |
| | | try { |
| | | int count = flowService.delete(id); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "å é¤å¤æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "ids", value = "IDæ°ç»", dataType = "Integer", paramType = "query", example = "1,2") |
| | | }) |
| | | @GetMapping(value = "/deletes") |
| | | public ResponseMsg<Integer> deletes(@RequestParam List<Integer> ids) { |
| | | try { |
| | | if (ids == null || ids.isEmpty()) { |
| | | return fail("idæ°ç»ä¸è½ä¸ºç©º", -1); |
| | | } |
| | | |
| | | int count = flowService.deletes(ids); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ´æ°ä¸æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "entity", value = "å®ä½ç±»", dataType = "FlowEntity", paramType = "body") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/update", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> update(@RequestBody FlowEntity entity, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | entity.setUpdateUser(ue.getId()); |
| | | } |
| | | |
| | | int count = flowService.update(entity); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ´æ°å¤æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "list", value = "å®ä½ç±»éå", dataType = "FlowEntity", paramType = "body") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/updates", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> updates(@RequestBody List<FlowEntity> list, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | for (FlowEntity entity : list) { |
| | | entity.setUpdateUser(ue.getId()); |
| | | } |
| | | } |
| | | |
| | | int count = flowService.updates(list); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), -1); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.lf.server.entity.show; |
| | | |
| | | import java.io.Serializable; |
| | | import java.sql.Timestamp; |
| | | |
| | | /** |
| | | * æ°æ®ç³è¯· |
| | | * @author WWW |
| | | */ |
| | | public class ApplyEntity implements Serializable { |
| | | private static final long serialVersionUID = -681840196569375744L; |
| | | |
| | | private int id; |
| | | |
| | | private int userid; |
| | | |
| | | private String depids; |
| | | |
| | | private String tables; |
| | | |
| | | private String wkt; |
| | | |
| | | private int status; |
| | | |
| | | private int count; |
| | | |
| | | private String descr; |
| | | |
| | | private int createUser; |
| | | |
| | | private Timestamp createTime; |
| | | |
| | | private int updateUser; |
| | | |
| | | private Timestamp updateTime; |
| | | |
| | | public ApplyEntity() { |
| | | } |
| | | |
| | | public int getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(int id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public int getUserid() { |
| | | return userid; |
| | | } |
| | | |
| | | public void setUserid(int userid) { |
| | | this.userid = userid; |
| | | } |
| | | |
| | | public String getDepids() { |
| | | return depids; |
| | | } |
| | | |
| | | public void setDepids(String depids) { |
| | | this.depids = depids; |
| | | } |
| | | |
| | | public String getTables() { |
| | | return tables; |
| | | } |
| | | |
| | | public void setTables(String tables) { |
| | | this.tables = tables; |
| | | } |
| | | |
| | | public String getWkt() { |
| | | return wkt; |
| | | } |
| | | |
| | | public void setWkt(String wkt) { |
| | | this.wkt = wkt; |
| | | } |
| | | |
| | | public int getStatus() { |
| | | return status; |
| | | } |
| | | |
| | | public void setStatus(int status) { |
| | | this.status = status; |
| | | } |
| | | |
| | | public int getCount() { |
| | | return count; |
| | | } |
| | | |
| | | public void setCount(int count) { |
| | | this.count = count; |
| | | } |
| | | |
| | | public String getDescr() { |
| | | return descr; |
| | | } |
| | | |
| | | public void setDescr(String descr) { |
| | | this.descr = descr; |
| | | } |
| | | |
| | | public int getCreateUser() { |
| | | return createUser; |
| | | } |
| | | |
| | | public void setCreateUser(int createUser) { |
| | | this.createUser = createUser; |
| | | } |
| | | |
| | | public Timestamp getCreateTime() { |
| | | return createTime; |
| | | } |
| | | |
| | | public void setCreateTime(Timestamp createTime) { |
| | | this.createTime = createTime; |
| | | } |
| | | |
| | | public int getUpdateUser() { |
| | | return updateUser; |
| | | } |
| | | |
| | | public void setUpdateUser(int updateUser) { |
| | | this.updateUser = updateUser; |
| | | } |
| | | |
| | | public Timestamp getUpdateTime() { |
| | | return updateTime; |
| | | } |
| | | |
| | | public void setUpdateTime(Timestamp updateTime) { |
| | | this.updateTime = updateTime; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.lf.server.entity.show; |
| | | |
| | | import java.io.Serializable; |
| | | import java.sql.Timestamp; |
| | | |
| | | /** |
| | | * ç³è¯·æµç¨ |
| | | * @author WWW |
| | | */ |
| | | public class FlowEntity implements Serializable { |
| | | private static final long serialVersionUID = -267684465864526336L; |
| | | |
| | | private int id; |
| | | |
| | | private int applyid; |
| | | |
| | | private int depid; |
| | | |
| | | private int userid; |
| | | |
| | | private int status; |
| | | |
| | | private String descr; |
| | | |
| | | private int createUser; |
| | | |
| | | private Timestamp createTime; |
| | | |
| | | private int updateUser; |
| | | |
| | | private Timestamp updateTime; |
| | | |
| | | public FlowEntity() { |
| | | } |
| | | |
| | | public int getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(int id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public int getApplyid() { |
| | | return applyid; |
| | | } |
| | | |
| | | public void setApplyid(int applyid) { |
| | | this.applyid = applyid; |
| | | } |
| | | |
| | | public int getDepid() { |
| | | return depid; |
| | | } |
| | | |
| | | public void setDepid(int depid) { |
| | | this.depid = depid; |
| | | } |
| | | |
| | | public int getUserid() { |
| | | return userid; |
| | | } |
| | | |
| | | public void setUserid(int userid) { |
| | | this.userid = userid; |
| | | } |
| | | |
| | | public int getStatus() { |
| | | return status; |
| | | } |
| | | |
| | | public void setStatus(int status) { |
| | | this.status = status; |
| | | } |
| | | |
| | | public String getDescr() { |
| | | return descr; |
| | | } |
| | | |
| | | public void setDescr(String descr) { |
| | | this.descr = descr; |
| | | } |
| | | |
| | | public int getCreateUser() { |
| | | return createUser; |
| | | } |
| | | |
| | | public void setCreateUser(int createUser) { |
| | | this.createUser = createUser; |
| | | } |
| | | |
| | | public Timestamp getCreateTime() { |
| | | return createTime; |
| | | } |
| | | |
| | | public void setCreateTime(Timestamp createTime) { |
| | | this.createTime = createTime; |
| | | } |
| | | |
| | | public int getUpdateUser() { |
| | | return updateUser; |
| | | } |
| | | |
| | | public void setUpdateUser(int updateUser) { |
| | | this.updateUser = updateUser; |
| | | } |
| | | |
| | | public Timestamp getUpdateTime() { |
| | | return updateTime; |
| | | } |
| | | |
| | | public void setUpdateTime(Timestamp updateTime) { |
| | | this.updateTime = updateTime; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.lf.server.mapper.show; |
| | | |
| | | import com.lf.server.entity.show.ApplyEntity; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * æ°æ®ç³è¯· |
| | | * @author WWW |
| | | */ |
| | | @Mapper |
| | | @Repository |
| | | public interface ApplyMapper { |
| | | /** |
| | | * æ¥è¯¢è®°å½æ° |
| | | * |
| | | * @param userid ç¨æ·ID |
| | | * @return è®°å½æ° |
| | | */ |
| | | public Integer selectCount(Integer userid); |
| | | |
| | | /** |
| | | * å页æ¥è¯¢ |
| | | * |
| | | * @param userid ç¨æ·ID |
| | | * @param limit è®°å½æ° |
| | | * @param offset åç§»é |
| | | * @return å表 |
| | | */ |
| | | public List<ApplyEntity> selectByPage(Integer userid, Integer limit, Integer offset); |
| | | |
| | | /** |
| | | * æ¥è¯¢ææ |
| | | * |
| | | * @return |
| | | */ |
| | | public List<ApplyEntity> selectAll(); |
| | | |
| | | /** |
| | | * æ ¹æ®IDæ¥è¯¢ |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | public ApplyEntity selectById(int id); |
| | | |
| | | /** |
| | | * æå
¥ä¸æ¡ |
| | | * |
| | | * @param entity |
| | | * @return |
| | | */ |
| | | public Integer insert(ApplyEntity entity); |
| | | |
| | | /** |
| | | * æå
¥å¤æ¡ |
| | | * |
| | | * @param list |
| | | * @return |
| | | */ |
| | | public Integer inserts(List<ApplyEntity> list); |
| | | |
| | | /** |
| | | * å é¤ä¸æ¡ |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | public Integer delete(int id); |
| | | |
| | | /** |
| | | * å é¤å¤æ¡ |
| | | * |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | public Integer deletes(List<Integer> ids); |
| | | |
| | | /** |
| | | * æ´æ°ä¸æ¡ |
| | | * |
| | | * @param entity |
| | | * @return |
| | | */ |
| | | public Integer update(ApplyEntity entity); |
| | | |
| | | /** |
| | | * æ´æ°å¤æ¡ |
| | | * |
| | | * @param list |
| | | * @return |
| | | */ |
| | | public Integer updates(List<ApplyEntity> list); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.lf.server.mapper.show; |
| | | |
| | | import com.lf.server.entity.show.FlowEntity; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * ç³è¯·æµç¨ |
| | | * @author WWW |
| | | */ |
| | | @Mapper |
| | | @Repository |
| | | public interface FlowMapper { |
| | | /** |
| | | * æ¥è¯¢è®°å½æ° |
| | | * |
| | | * @param userid ç¨æ·ID |
| | | * @return è®°å½æ° |
| | | */ |
| | | public Integer selectCount(Integer userid); |
| | | |
| | | /** |
| | | * å页æ¥è¯¢ |
| | | * |
| | | * @param userid ç¨æ·ID |
| | | * @param limit è®°å½æ° |
| | | * @param offset åç§»é |
| | | * @return å表 |
| | | */ |
| | | public List<FlowEntity> selectByPage(Integer userid, Integer limit, Integer offset); |
| | | |
| | | /** |
| | | * æ¥è¯¢ææ |
| | | * |
| | | * @return |
| | | */ |
| | | public List<FlowEntity> selectAll(); |
| | | |
| | | /** |
| | | * æ ¹æ®IDæ¥è¯¢ |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | public FlowEntity selectById(int id); |
| | | |
| | | /** |
| | | * æå
¥ä¸æ¡ |
| | | * |
| | | * @param entity |
| | | * @return |
| | | */ |
| | | public Integer insert(FlowEntity entity); |
| | | |
| | | /** |
| | | * æå
¥å¤æ¡ |
| | | * |
| | | * @param list |
| | | * @return |
| | | */ |
| | | public Integer inserts(List<FlowEntity> list); |
| | | |
| | | /** |
| | | * å é¤ä¸æ¡ |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | public Integer delete(int id); |
| | | |
| | | /** |
| | | * å é¤å¤æ¡ |
| | | * |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | public Integer deletes(List<Integer> ids); |
| | | |
| | | /** |
| | | * æ´æ°ä¸æ¡ |
| | | * |
| | | * @param entity |
| | | * @return |
| | | */ |
| | | public Integer update(FlowEntity entity); |
| | | |
| | | /** |
| | | * æ´æ°å¤æ¡ |
| | | * |
| | | * @param list |
| | | * @return |
| | | */ |
| | | public Integer updates(List<FlowEntity> list); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.lf.server.service.show; |
| | | |
| | | import com.lf.server.entity.show.ApplyEntity; |
| | | import com.lf.server.helper.StringHelper; |
| | | import com.lf.server.mapper.show.ApplyMapper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * æ°æ®ç³è¯· |
| | | * @author WWW |
| | | */ |
| | | @Service |
| | | public class ApplyService implements ApplyMapper { |
| | | @Autowired |
| | | ApplyMapper applyMapper; |
| | | |
| | | @Override |
| | | public Integer selectCount(Integer userid) { |
| | | return applyMapper.selectCount(userid); |
| | | } |
| | | |
| | | @Override |
| | | public List<ApplyEntity> selectByPage(Integer userid, Integer limit, Integer offset) { |
| | | return applyMapper.selectByPage(userid, limit, offset); |
| | | } |
| | | |
| | | @Override |
| | | public List<ApplyEntity> selectAll() { |
| | | return applyMapper.selectAll(); |
| | | } |
| | | |
| | | @Override |
| | | public ApplyEntity selectById(int id) { |
| | | return applyMapper.selectById(id); |
| | | } |
| | | |
| | | @Override |
| | | public Integer insert(ApplyEntity entity) { |
| | | return applyMapper.insert(entity); |
| | | } |
| | | |
| | | @Override |
| | | public Integer inserts(List<ApplyEntity> list) { |
| | | return applyMapper.inserts(list); |
| | | } |
| | | |
| | | @Override |
| | | public Integer delete(int id) { |
| | | return applyMapper.delete(id); |
| | | } |
| | | |
| | | @Override |
| | | public Integer deletes(List<Integer> ids) { |
| | | return applyMapper.deletes(ids); |
| | | } |
| | | |
| | | @Override |
| | | public Integer update(ApplyEntity entity) { |
| | | return applyMapper.update(entity); |
| | | } |
| | | |
| | | @Override |
| | | public Integer updates(List<ApplyEntity> list) { |
| | | return applyMapper.updates(list); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.lf.server.service.show; |
| | | |
| | | import com.lf.server.entity.show.FlowEntity; |
| | | import com.lf.server.helper.StringHelper; |
| | | import com.lf.server.mapper.show.FlowMapper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * ç³è¯·æµç¨ |
| | | * @author WWW |
| | | */ |
| | | @Service |
| | | public class FlowService implements FlowMapper { |
| | | @Autowired |
| | | FlowMapper flowMapper; |
| | | |
| | | @Override |
| | | public Integer selectCount(Integer userid) { |
| | | return flowMapper.selectCount(userid); |
| | | } |
| | | |
| | | @Override |
| | | public List<FlowEntity> selectByPage(Integer userid, Integer limit, Integer offset) { |
| | | return flowMapper.selectByPage(userid, limit, offset); |
| | | } |
| | | |
| | | @Override |
| | | public List<FlowEntity> selectAll() { |
| | | return flowMapper.selectAll(); |
| | | } |
| | | |
| | | @Override |
| | | public FlowEntity selectById(int id) { |
| | | return flowMapper.selectById(id); |
| | | } |
| | | |
| | | @Override |
| | | public Integer insert(FlowEntity entity) { |
| | | return flowMapper.insert(entity); |
| | | } |
| | | |
| | | @Override |
| | | public Integer inserts(List<FlowEntity> list) { |
| | | return flowMapper.inserts(list); |
| | | } |
| | | |
| | | @Override |
| | | public Integer delete(int id) { |
| | | return flowMapper.delete(id); |
| | | } |
| | | |
| | | @Override |
| | | public Integer deletes(List<Integer> ids) { |
| | | return flowMapper.deletes(ids); |
| | | } |
| | | |
| | | @Override |
| | | public Integer update(FlowEntity entity) { |
| | | return flowMapper.update(entity); |
| | | } |
| | | |
| | | @Override |
| | | public Integer updates(List<FlowEntity> list) { |
| | | return flowMapper.updates(list); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.lf.server.mapper.show.ApplyMapper"> |
| | | <select id="selectCount" resultType="java.lang.Integer"> |
| | | select count(*) from lf.sys_apply |
| | | <where> |
| | | <if test="userid != null"> |
| | | userid = #{userid} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="selectByPage" resultType="com.lf.server.entity.show.ApplyEntity"> |
| | | select * from lf.sys_apply |
| | | <where> |
| | | <if test="userid != null"> |
| | | userid = #{userid} |
| | | </if> |
| | | </where> |
| | | order by id |
| | | limit #{limit} offset #{offset} |
| | | </select> |
| | | |
| | | <select id="selectAll" resultType="com.lf.server.entity.show.ApplyEntity"> |
| | | select * from lf.sys_apply order by id; |
| | | </select> |
| | | |
| | | <select id="selectById" resultType="com.lf.server.entity.show.ApplyEntity"> |
| | | select * from lf.sys_apply where id = #{id} |
| | | </select> |
| | | |
| | | <insert id="insert" parameterType="com.lf.server.entity.show.ApplyEntity"> |
| | | insert into lf.sys_apply |
| | | (userid,depids,tables,wkt,status,count,descr,create_user,create_time) |
| | | values |
| | | (#{userid},#{depids},#{tables},#{wkt},#{status},#{count},#{descr},#{createUser},now()) |
| | | </insert> |
| | | |
| | | <insert id="inserts"> |
| | | insert into lf.sys_apply |
| | | (userid,depids,tables,wkt,status,count,descr,create_user,create_time) |
| | | values |
| | | <foreach collection="list" item="item" index="index" separator=","> |
| | | (#{item.userid},#{item.depids},#{item.tables},#{item.wkt},#{item.status},#{item.count},#{item.descr},#{item.createUser},now()) |
| | | </foreach> |
| | | </insert> |
| | | |
| | | <delete id="delete"> |
| | | delete from lf.sys_apply where id = #{id} |
| | | </delete> |
| | | |
| | | <delete id="deletes"> |
| | | delete from lf.sys_apply where id in |
| | | <foreach item="id" collection="ids" index="index" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </delete> |
| | | |
| | | <update id="update"> |
| | | update lf.sys_apply |
| | | set userid=#{userid},depids=#{depids},tables=#{tables},wkt=#{wkt},status=#{status},count=#{count},descr=#{descr},update_user=#{updateUser},update_time=now() |
| | | where id=#{id} |
| | | </update> |
| | | |
| | | <update id="updates"> |
| | | <foreach collection="list" item="item" index="index" separator=";"> |
| | | update lf.sys_apply |
| | | <set> |
| | | userid=#{item.userid},depids=#{item.depids},tables=#{item.tables},wkt=#{item.wkt},status=#{item.status},count=#{item.count},descr=#{item.descr},update_user=#{item.updateUser},update_time=now() |
| | | </set> |
| | | where id = #{item.id} |
| | | </foreach> |
| | | </update> |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.lf.server.mapper.show.FlowMapper"> |
| | | <select id="selectCount" resultType="java.lang.Integer"> |
| | | select count(*) from lf.sys_flow |
| | | <where> |
| | | <if test="userid != null"> |
| | | userid = #{userid} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="selectByPage" resultType="com.lf.server.entity.show.FlowEntity"> |
| | | select * from lf.sys_flow |
| | | <where> |
| | | <if test="userid != null"> |
| | | userid = #{userid} |
| | | </if> |
| | | </where> |
| | | order by id |
| | | limit #{limit} offset #{offset} |
| | | </select> |
| | | |
| | | <select id="selectAll" resultType="com.lf.server.entity.show.FlowEntity"> |
| | | select * from lf.sys_flow order by id; |
| | | </select> |
| | | |
| | | <select id="selectById" resultType="com.lf.server.entity.show.FlowEntity"> |
| | | select * from lf.sys_flow where id = #{id} |
| | | </select> |
| | | |
| | | <insert id="insert" parameterType="com.lf.server.entity.show.FlowEntity"> |
| | | insert into lf.sys_flow |
| | | (applyid,depid,userid,status,descr,create_user,create_time) |
| | | values |
| | | (#{applyid},#{depid},#{userid},#{status},#{descr},#{createUser},now()) |
| | | </insert> |
| | | |
| | | <insert id="inserts"> |
| | | insert into lf.sys_flow |
| | | (applyid,depid,userid,status,descr,create_user,create_time) |
| | | values |
| | | <foreach collection="list" item="item" index="index" separator=","> |
| | | (#{item.applyid},#{item.depid},#{item.userid},#{item.status},#{item.descr},#{item.createUser},now()) |
| | | </foreach> |
| | | </insert> |
| | | |
| | | <delete id="delete"> |
| | | delete from lf.sys_flow where id = #{id} |
| | | </delete> |
| | | |
| | | <delete id="deletes"> |
| | | delete from lf.sys_flow where id in |
| | | <foreach item="id" collection="ids" index="index" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </delete> |
| | | |
| | | <update id="update"> |
| | | update lf.sys_flow |
| | | set applyid=#{applyid},depid=#{depid},userid=#{userid},status=#{status},descr=#{descr},update_user=#{updateUser},update_time=now() |
| | | where id=#{id} |
| | | </update> |
| | | |
| | | <update id="updates"> |
| | | <foreach collection="list" item="item" index="index" separator=";"> |
| | | update lf.sys_flow |
| | | <set> |
| | | applyid=#{item.applyid},depid=#{item.depid},userid=#{item.userid},status=#{item.status},descr=#{item.descr},update_user=#{item.updateUser},update_time=now() |
| | | </set> |
| | | where id = #{item.id} |
| | | </foreach> |
| | | </update> |
| | | </mapper> |