| | |
| | | |
| | | @Autowired |
| | | private ProductServiceMapper productServiceMapper; |
| | | |
| | | @Override |
| | | public CommonPage selectStandardizedTemplateList(StandardizedTemplate standardizedTemplate) { |
| | | boolean admin = SecurityUtils.adminUser(); |
| | |
| | | |
| | | @Override |
| | | public CommonResult insertStandardizedTemplate(StandardizedTemplate standardizedTemplate) { |
| | | checkPer(); |
| | | LoginUserDetails loginUser = SecurityUtils.getLoginUser(); |
| | | |
| | | SysCompany sysCompany = sysCompanyService.selectCompanyById(standardizedTemplate.getCompanyId().longValue()); |
| | |
| | | |
| | | @Override |
| | | public CommonResult updateStandardizedTemplate(StandardizedTemplate standardizedTemplate) { |
| | | checkPer(); |
| | | LoginUserDetails loginUser = SecurityUtils.getLoginUser(); |
| | | SysCompany sysCompany = sysCompanyService.selectCompanyById(standardizedTemplate.getCompanyId().longValue()); |
| | | standardizedTemplate.setCompanyName(sysCompany.getName()); |
| | |
| | | |
| | | @Override |
| | | public CommonResult deletedStandardizedTemplate(Integer standardizedTemplateId) { |
| | | checkPer(); |
| | | StandardizedTemplate standardizedTemplate = new StandardizedTemplate(); |
| | | LoginUserDetails loginUser = SecurityUtils.getLoginUser(); |
| | | standardizedTemplate.setUpdateBy(loginUser.getUsername()); |
| | |
| | | return CommonResult.failed(); |
| | | } |
| | | |
| | | private void checkPer(){ |
| | | boolean admin = SecurityUtils.adminUser(); |
| | | if (!admin) { |
| | | throw new ApiException("非管理员不可操作"); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public CommonResult selectStandardizedQuality(Integer companyId) { |
| | | boolean admin = SecurityUtils.adminUser(); |