| | |
| | | package com.consum.base.controller; |
| | | |
| | | import com.consum.base.BaseController; |
| | | import com.consum.base.core.utils.CommonUtil; |
| | | import com.consum.base.pojo.FinSysServerSearchParam; |
| | | import com.consum.base.pojo.FinSysServerVo; |
| | | import com.consum.base.service.FinSysServerImpl; |
| | | import com.consum.model.po.FinSysServer; |
| | | import com.walker.db.page.GenericPager; |
| | | import com.walker.infrastructure.utils.DateUtils; |
| | | import com.walker.infrastructure.utils.NumberGenerator; |
| | | import com.walker.web.ResponseValue; |
| | | import java.util.List; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import com.consum.base.BaseController; |
| | | import com.consum.base.core.utils.CommonUtil; |
| | | import com.consum.base.pojo.FinSysServerSearchParam; |
| | | import com.consum.base.pojo.FinSysServerVo; |
| | | import com.consum.base.service.FinSysServerService; |
| | | import com.consum.model.po.FinSysServer; |
| | | import com.iplatform.model.po.S_role; |
| | | import com.walker.db.page.GenericPager; |
| | | import com.walker.infrastructure.utils.DateUtils; |
| | | import com.walker.infrastructure.utils.NumberGenerator; |
| | | import com.walker.web.ResponseValue; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | |
| | | @Api(value = "系统服务信息", tags = "系统服务信息") |
| | | @RestController |
| | | @RequestMapping("/pc/fin/sys/server") |
| | | public class FinSysServerController extends BaseController { |
| | | |
| | | private FinSysServerImpl finSysServerImpl; |
| | | private FinSysServerService finSysServerServiceImpl; |
| | | |
| | | @Autowired |
| | | public void setfinSysCategory(FinSysServerImpl finSysServerImpl) { |
| | | this.finSysServerImpl = finSysServerImpl; |
| | | public void setfinSysCategory(FinSysServerService finSysServerServiceImpl) { |
| | | this.finSysServerServiceImpl = finSysServerServiceImpl; |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @GetMapping("/selectByDataScope") |
| | | public ResponseValue selectByDataScope(Integer dataScope) { |
| | | return ResponseValue.success(finSysServerImpl.getByDataScope(dataScope)); |
| | | List<S_role> roleList = finSysServerServiceImpl.getByDataScope(dataScope); |
| | | // 过滤仓库管理员的显示 |
| | | roleList.removeIf(role -> role.getRole_name().equals("仓库管理员")); |
| | | return ResponseValue.success(roleList); |
| | | } |
| | | |
| | | /** |
| | |
| | | @GetMapping("/select/tree") |
| | | public ResponseValue selectFinSysCategoryTree() { |
| | | |
| | | List<FinSysServerVo> finSysCategoryVos = finSysServerImpl.queryAllCategory(); |
| | | List<FinSysServerVo> finSysCategoryVos = finSysServerServiceImpl.queryAllCategory(); |
| | | if (finSysCategoryVos != null) { |
| | | return ResponseValue.success(finSysCategoryVos); |
| | | } |
| | |
| | | |
| | | @GetMapping("/select/detail") |
| | | public ResponseValue selectById(@RequestParam(name = "id") Long Id) { |
| | | FinSysServer finSysServer = this.finSysServerImpl.get(new FinSysServer(Id)); |
| | | FinSysServer finSysServer = this.finSysServerServiceImpl.get(new FinSysServer(Id)); |
| | | if (finSysServer == null) { |
| | | return ResponseValue.error("查询失败!"); |
| | | } |
| | |
| | | CommonUtil.copyProperties(param, param2); |
| | | param = param2; |
| | | |
| | | GenericPager<FinSysServer> pager = this.finSysServerImpl.selectServerListByPage(param); |
| | | GenericPager<FinSysServer> pager = this.finSysServerServiceImpl.selectServerListByPage(param); |
| | | return ResponseValue.success(pager); |
| | | } |
| | | |
| | |
| | | param.setCreatedTime(DateUtils.getDateTimeNumber(System.currentTimeMillis())); |
| | | param.setCreatedBy(this.getCurrentUser().getUser_name()); |
| | | param.setLv(param.getParentId() + 1); |
| | | int num = this.finSysServerImpl.insert(param); |
| | | int num = this.finSysServerServiceImpl.insert(param); |
| | | if (num > 0) { |
| | | return ResponseValue.success(1); |
| | | } |
| | |
| | | if (param == null) { |
| | | return ResponseValue.error("参数为空"); |
| | | } |
| | | // if(finSysServer.getLvType()!=null) { |
| | | // finSysServer.setLv(Long.valueOf(finSysServer.getLvType())); |
| | | // } |
| | | int num = this.finSysServerImpl.save(param); |
| | | int num = this.finSysServerServiceImpl.save(param); |
| | | return num > 0 ? ResponseValue.success(1) : ResponseValue.error("编辑失败!"); |
| | | } |
| | | } |