Merge remote-tracking branch 'origin/dev_New_pro' into dev_pro_河南鹤壁
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | # é¦é¡µçäº§çæ¿å端èè°ææ¡£ |
| | | |
| | | æ´æ°æ¶é´ï¼2026-05-20 |
| | | 模åï¼`/home`ï¼é¦é¡µï¼ |
| | | |
| | | ## 1. æ¥å£æ¸
å |
| | | |
| | | 1. `GET /home/productionOverview`ï¼ç产æ»è§ |
| | | 2. `GET /home/productionRealtimeBoard`ï¼çäº§å®æ¶çæ¿ |
| | | 3. `GET /home/productionOrderProgress`ï¼ç产订åè¿åº¦ |
| | | 4. `GET /home/todayProductionPlan`ï¼ä»æ¥ç产计å |
| | | |
| | | æææ¥å£ç»ä¸è¿å `AjaxResult`ï¼ |
| | | |
| | | ```json |
| | | { |
| | | "code": 200, |
| | | "msg": "æä½æå", |
| | | "data": {} |
| | | } |
| | | ``` |
| | | |
| | | ## 2. ç产æ»è§ |
| | | |
| | | ### 2.1 è¯·æ± |
| | | |
| | | ```http |
| | | GET /home/productionOverview |
| | | ``` |
| | | |
| | | ### 2.2 è¿å `data` |
| | | |
| | | ```json |
| | | { |
| | | "totalOutput": 1280.00, |
| | | "totalScrap": 25.00, |
| | | "yieldRate": 98.08 |
| | | } |
| | | ``` |
| | | |
| | | åæ®µè¯´æï¼ |
| | | |
| | | - `totalOutput`ï¼ç´¯è®¡äº§åºï¼ä»¶ï¼åæ ¼æ°ï¼ |
| | | - `totalScrap`ï¼ç´¯è®¡æ¥åºï¼ä»¶ï¼ |
| | | - `yieldRate`ï¼è¯çï¼0-100ï¼å端å±ç¤ºæ¶å¯æ¼æ¥ `%`ï¼ |
| | | |
| | | ## 3. çäº§å®æ¶çæ¿ |
| | | |
| | | ### 3.1 è¯·æ± |
| | | |
| | | ```http |
| | | GET /home/productionRealtimeBoard |
| | | ``` |
| | | |
| | | ### 3.2 è¿å `data` |
| | | |
| | | ```json |
| | | { |
| | | "deviceOee": { |
| | | "value": 74.00, |
| | | "compareYesterday": 2.50 |
| | | }, |
| | | "orderAchievementRate": { |
| | | "value": 81.30, |
| | | "compareYesterday": -1.20 |
| | | }, |
| | | "defectRate": { |
| | | "value": 1.40, |
| | | "compareYesterday": 0.30 |
| | | } |
| | | } |
| | | ``` |
| | | |
| | | åæ®µè¯´æï¼ |
| | | |
| | | - `value`ï¼å½æ¥ææ å¼ï¼0-100ï¼ |
| | | - `compareYesterday`ï¼è¾æ¨æ¥ååå¼ï¼å¯æ£å¯è´ï¼åç«¯ææ£è´å³å®ç®å¤´æ¹ååé¢è²ï¼ |
| | | |
| | | ## 4. ç产订åè¿åº¦ |
| | | |
| | | ### 4.1 è¯·æ± |
| | | |
| | | ```http |
| | | GET /home/productionOrderProgress?tab=all&pageNum=1&pageSize=10 |
| | | ``` |
| | | |
| | | åæ°ï¼ |
| | | |
| | | - `tab`ï¼`all` / `inProgress` / `completed` / `paused` |
| | | - `pageNum`ï¼é¡µç ï¼é»è®¤ `1`ï¼ |
| | | - `pageSize`ï¼æ¯é¡µæ¡æ°ï¼é»è®¤ `10`ï¼æå¤§ `50`ï¼ |
| | | |
| | | ### 4.2 è¿å `data` |
| | | |
| | | ```json |
| | | { |
| | | "tab": "all", |
| | | "total": 24, |
| | | "pageNum": 1, |
| | | "pageSize": 10, |
| | | "inProgressCount": 6, |
| | | "completedCount": 12, |
| | | "pausedCount": 2, |
| | | "records": [ |
| | | { |
| | | "orderNo": "MO-20260518-001", |
| | | "productName": "æºè½æ§å¶å¨", |
| | | "plannedQuantity": 1000.00, |
| | | "completedQuantity": 860.00, |
| | | "completionRate": 86.00, |
| | | "dueDate": "2026-05-20", |
| | | "status": 2, |
| | | "statusLabel": "è¿è¡ä¸" |
| | | } |
| | | ] |
| | | } |
| | | ``` |
| | | |
| | | åæ®µè¯´æï¼ |
| | | |
| | | - `completionRate`ï¼å®æçï¼0-100ï¼ |
| | | - `status`ï¼åç«¯ç¶æç ï¼`1`å¾
å¼å§ï¼`2`è¿è¡ä¸ï¼`3`已宿ï¼`4`å·²æåï¼ |
| | | - `statusLabel`ï¼ç¶æä¸æå±ç¤ºå¼ |
| | | |
| | | ## 5. 仿¥ç产计å |
| | | |
| | | ### 5.1 è¯·æ± |
| | | |
| | | ```http |
| | | GET /home/todayProductionPlan?limit=4 |
| | | ``` |
| | | |
| | | åæ°ï¼ |
| | | |
| | | - `limit`ï¼è¿åæ¡æ°ï¼é»è®¤ `4`ï¼æå¤§ `20`ï¼ |
| | | |
| | | ### 5.2 è¿å `data` |
| | | |
| | | ```json |
| | | { |
| | | "total": 9, |
| | | "records": [ |
| | | { |
| | | "orderNo": "MO-20260518-004", |
| | | "productName": "ç»æä»¶A", |
| | | "plannedQuantity": 1200.00, |
| | | "dueDate": "2026-05-15", |
| | | "status": 2, |
| | | "statusLabel": "è¿è¡ä¸" |
| | | } |
| | | ] |
| | | } |
| | | ``` |
| | | |
| | | ## 6. å端å±ç¤ºçº¦å® |
| | | |
| | | - ç¾åæ¯å段ç»ä¸æ¯æ°å¼ï¼å¦ `74.00`ï¼ï¼å端èªè¡æ¼æ¥ `%`ã |
| | | - æææ°å¼ä¿ç两ä½å°æ°ã |
| | | - `dueDate` å¯è½ä¸º `null`ï¼å端éå
åºå±ç¤ºï¼å¦ `--`ï¼ã |
| | | - `compareYesterday` æ£è´é½å¯è½åºç°ï¼å»ºè®®æ `>0` ä¸åã`<0` ä¸éã`=0` æå¹³å¤çã |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | # é¦é¡µçäº§çæ¿æ§è½ä¼ååç«¯åæ´ææ¡£ |
| | | |
| | | æ´æ°æ¶é´ï¼2026-05-20 |
| | | éç¨é¡µé¢ï¼é¦é¡µ |
| | | æ¶ååºåï¼ |
| | | |
| | | 1. ç产订åè¿åº¦ |
| | | 2. 仿¥ç产计å |
| | | |
| | | ## 1. æ¬æ¬¡ä¼åç®æ |
| | | |
| | | éå¯¹å¤§æ°æ®éåºæ¯ï¼è®¢åæ°éå¤ãç产åå²é¿ï¼ä¼åæ¥è¯¢æ§è½ï¼éä½é¦é¡µæ¥å£ååºæ¶é´åå
åå ç¨ã |
| | | |
| | | ## 2. æ¶åæ¥å£ |
| | | |
| | | 1. `GET /home/productionOrderProgress` |
| | | 2. `GET /home/todayProductionPlan` |
| | | |
| | | ## 3. å端æ¯å¦éè¦æ¹ä»£ç |
| | | |
| | | ç»è®ºï¼**æ å¼ºå¶æ¹å¨ï¼æ¥å£å
¥åä¸è¿åç»æä¿æå
¼å®¹**ã |
| | | ä½ ç°æé¡µé¢å¯ä»¥ç´æ¥èè°ï¼ä¸éè¦æ¹å段æ å°ã |
| | | |
| | | ## 4. æ¥å£è¯´æï¼ä¿æä¸åï¼ |
| | | |
| | | ### 4.1 ç产订åè¿åº¦ |
| | | |
| | | 请æ±ï¼ |
| | | |
| | | ```http |
| | | GET /home/productionOrderProgress?tab=all&pageNum=1&pageSize=10 |
| | | ``` |
| | | |
| | | åæ°ï¼ |
| | | |
| | | - `tab`ï¼`all` / `inProgress` / `completed` / `paused` |
| | | - `pageNum`ï¼é¡µç ï¼é»è®¤ `1` |
| | | - `pageSize`ï¼æ¯é¡µæ¡æ°ï¼é»è®¤ `10`ï¼æå¤§ `50` |
| | | |
| | | è¿å `data`ï¼ç»æä¸åï¼ï¼ |
| | | |
| | | ```json |
| | | { |
| | | "tab": "all", |
| | | "total": 1200, |
| | | "pageNum": 1, |
| | | "pageSize": 10, |
| | | "inProgressCount": 180, |
| | | "completedCount": 900, |
| | | "pausedCount": 20, |
| | | "records": [ |
| | | { |
| | | "orderNo": "MO-20260518-001", |
| | | "productName": "æºè½æ§å¶å¨", |
| | | "plannedQuantity": 1000.00, |
| | | "completedQuantity": 860.00, |
| | | "completionRate": 86.00, |
| | | "dueDate": "2026-05-20", |
| | | "status": 2, |
| | | "statusLabel": "è¿è¡ä¸" |
| | | } |
| | | ] |
| | | } |
| | | ``` |
| | | |
| | | ### 4.2 仿¥ç产计å |
| | | |
| | | 请æ±ï¼ |
| | | |
| | | ```http |
| | | GET /home/todayProductionPlan?limit=4 |
| | | ``` |
| | | |
| | | åæ°ï¼ |
| | | |
| | | - `limit`ï¼è¿åæ¡æ°ï¼é»è®¤ `4`ï¼æå¤§ `20` |
| | | |
| | | è¿å `data`ï¼ç»æä¸åï¼ï¼ |
| | | |
| | | ```json |
| | | { |
| | | "total": 230, |
| | | "records": [ |
| | | { |
| | | "orderNo": "MO-20260518-004", |
| | | "productName": "ç»æä»¶A", |
| | | "plannedQuantity": 1200.00, |
| | | "dueDate": "2026-05-15", |
| | | "status": 2, |
| | | "statusLabel": "è¿è¡ä¸" |
| | | } |
| | | ] |
| | | } |
| | | ``` |
| | | |
| | | ## 5. å端ä¼åç¹ï¼ä¾åç«¯ç¥æï¼ |
| | | |
| | | 1. 订åè¿åº¦ä¸ä»æ¥è®¡åæ¹ä¸ºè½»é SQLï¼ä»
æ¥è¯¢é¦é¡µå¿
éåæ®µã |
| | | 2. 廿äºé¦é¡µæ¥è¯¢è·¯å¾ä¸ä¸å¿
è¦ç大å
³èãå¾çå¡«å
å对象è£
é
ã |
| | | 3. ç¶æç»è®¡æ¹ä¸ºæ°æ®åºèå计æ°ï¼ä¸åéæ¡æå计ç®ã |
| | | 4. å页䏿¡æ°ä¸éä¿çï¼`pageSize <= 50`, `limit <= 20`ï¼ã |
| | | |
| | | ## 6. å端建议 |
| | | |
| | | 1. 忢 `tab` æ¶ä¿çç°æè°ç¨æ¹å¼å³å¯ã |
| | | 2. `dueDate` å¯è½ä¸ºç©ºï¼ç»§ç»æ `--` å
åºå±ç¤ºã |
| | | 3. ç¾åæ¯å段ä»ä¸ºæ°å¼ï¼å端继ç»è¿½å `%` å±ç¤ºã |
| | |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.dto.DateQueryDto; |
| | | import com.ruoyi.framework.security.LoginUser; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import jakarta.annotation.Resource; |
| | |
| | | @RestController |
| | | @RequestMapping("/account/accountExpense") |
| | | @Tag(name = "è´¢å¡ç®¡ç--æ¯åºç®¡ç") |
| | | public class AccountExpenseController { |
| | | public class AccountExpenseController extends BaseController { |
| | | |
| | | @Resource |
| | | private AccountExpenseService accountExpenseService; |
| | |
| | | */ |
| | | @PostMapping("/add") |
| | | @Operation(summary = "æ°å¢") |
| | | public AjaxResult add(@RequestBody AccountExpense accountExpense) { |
| | | public R<?> add(@RequestBody AccountExpense accountExpense) { |
| | | accountExpense.setInputTime(new Date()); |
| | | LoginUser loginUser = SecurityUtils.getLoginUser(); |
| | | accountExpense.setInputUser(loginUser.getNickName()); |
| | | return AjaxResult.success(accountExpenseService.save(accountExpense)); |
| | | return R.ok(accountExpenseService.save(accountExpense)); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @DeleteMapping("/del") |
| | | @Operation(summary = "å é¤") |
| | | public AjaxResult delQualityInspect(@RequestBody List<Integer> ids) { |
| | | public R<?> delQualityInspect(@RequestBody List<Integer> ids) { |
| | | if(CollectionUtils.isEmpty(ids)){ |
| | | return AjaxResult.error("è¯·éæ©è³å°ä¸æ¡æ°æ®"); |
| | | return R.fail("è¯·éæ©è³å°ä¸æ¡æ°æ®"); |
| | | } |
| | | //å 餿£éªå |
| | | return AjaxResult.success(accountExpenseService.removeBatchByIds(ids)); |
| | | return R.ok(accountExpenseService.removeBatchByIds(ids)); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @PostMapping("/update") |
| | | @Operation(summary = "ä¿®æ¹") |
| | | public AjaxResult update(@RequestBody AccountExpense accountExpense) { |
| | | return AjaxResult.success(accountExpenseService.updateById(accountExpense)); |
| | | public R<?> update(@RequestBody AccountExpense accountExpense) { |
| | | return R.ok(accountExpenseService.updateById(accountExpense)); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @GetMapping("/listPage") |
| | | @Operation(summary = "å页æ¥è¯¢") |
| | | public AjaxResult accountExpenseListPage(Page page, AccountExpense accountExpense) { |
| | | return AjaxResult.success(accountExpenseService.accountExpenseListPage(page, accountExpense)); |
| | | public R<?> accountExpenseListPage(Page page, AccountExpense accountExpense) { |
| | | return R.ok(accountExpenseService.accountExpenseListPage(page, accountExpense)); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @GetMapping("/{id}") |
| | | @Operation(summary = "详æ
") |
| | | public AjaxResult accountExpenseDetail(@PathVariable("id") Integer id) { |
| | | return AjaxResult.success(accountExpenseService.getById(id)); |
| | | public R<?> accountExpenseDetail(@PathVariable("id") Integer id) { |
| | | return R.ok(accountExpenseService.getById(id)); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @GetMapping("/report/forms") |
| | | @Operation(summary = "è´¢å¡æ¥è¡¨å¾è¡¨æ¥è¯¢") |
| | | public AjaxResult report(DateQueryDto dateQueryDto) { |
| | | return AjaxResult.success(accountExpenseService.report(dateQueryDto)); |
| | | public R<?> report(DateQueryDto dateQueryDto) { |
| | | return R.ok(accountExpenseService.report(dateQueryDto)); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @GetMapping("/report/analysis") |
| | | @Operation(summary = "è´¢å¡æ¥è¡¨-è´¢å¡åæ") |
| | | public AjaxResult analysis() { |
| | | return AjaxResult.success(accountExpenseService.analysis()); |
| | | public R<?> analysis() { |
| | | return R.ok(accountExpenseService.analysis()); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @GetMapping("/report/income") |
| | | @Operation(summary = "è´¢å¡æ¥è¡¨å¾è¡¨æ¶å
¥å¹´åº¦æ¥è¯¢") |
| | | public AjaxResult reportIncome(ReportDateDto reportDateDto) { |
| | | return AjaxResult.success(accountIncomeService.reportIncome(reportDateDto)); |
| | | public R<?> reportIncome(ReportDateDto reportDateDto) { |
| | | return R.ok(accountIncomeService.reportIncome(reportDateDto)); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @GetMapping("/report/expense") |
| | | @Operation(summary = "è´¢å¡æ¥è¡¨å¾è¡¨æ¯åºå¹´åº¦æ¥è¯¢") |
| | | public AjaxResult reportExpense(ReportDateDto reportDateDto) { |
| | | return AjaxResult.success(accountExpenseService.reportExpense(reportDateDto)); |
| | | public R<?> reportExpense(ReportDateDto reportDateDto) { |
| | | return R.ok(accountExpenseService.reportExpense(reportDateDto)); |
| | | } |
| | | |
| | | |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.account.pojo.AccountFile; |
| | | import com.ruoyi.account.service.AccountFileService; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.quality.pojo.QualityInspectFile; |
| | | import com.ruoyi.quality.service.IQualityInspectFileService; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import org.springframework.util.CollectionUtils; |
| | |
| | | @RestController |
| | | @RequestMapping("/account/accountFile") |
| | | @Tag(name = "è´¢å¡éä»¶") |
| | | public class AccountFileController { |
| | | public class AccountFileController extends BaseController { |
| | | |
| | | |
| | | @Resource |
| | |
| | | */ |
| | | @PostMapping("/add") |
| | | @Operation(summary = "æ°å¢") |
| | | public AjaxResult add(@RequestBody AccountFile accountFile) { |
| | | return AjaxResult.success(accountFileService.save(accountFile)); |
| | | public R<?> add(@RequestBody AccountFile accountFile) { |
| | | return R.ok(accountFileService.save(accountFile)); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @DeleteMapping("/del") |
| | | @Operation(summary = "å é¤") |
| | | public AjaxResult delAccountFile(@RequestBody List<Integer> ids) { |
| | | public R<?> delAccountFile(@RequestBody List<Integer> ids) { |
| | | if(CollectionUtils.isEmpty(ids)){ |
| | | return AjaxResult.error("è¯·éæ©è³å°ä¸æ¡æ°æ®"); |
| | | return R.fail("è¯·éæ©è³å°ä¸æ¡æ°æ®"); |
| | | } |
| | | //å 餿£éªéä»¶ |
| | | return AjaxResult.success(accountFileService.removeBatchByIds(ids)); |
| | | return R.ok(accountFileService.removeBatchByIds(ids)); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @GetMapping("/listPage") |
| | | @Operation(summary = "å页æ¥è¯¢") |
| | | public AjaxResult accountFileListPage(Page page, AccountFile accountFile) { |
| | | return AjaxResult.success(accountFileService.accountFileListPage(page, accountFile)); |
| | | public R<?> accountFileListPage(Page page, AccountFile accountFile) { |
| | | return R.ok(accountFileService.accountFileListPage(page, accountFile)); |
| | | } |
| | | |
| | | |
| | |
| | | package com.ruoyi.account.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.account.pojo.AccountIncome; |
| | | import com.ruoyi.account.service.AccountFileService; |
| | | import com.ruoyi.account.service.AccountIncomeService; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.framework.security.LoginUser; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.quality.pojo.QualityInspect; |
| | | import com.ruoyi.quality.pojo.QualityInspectFile; |
| | | import com.ruoyi.quality.pojo.QualityInspectParam; |
| | | import com.ruoyi.quality.service.IQualityInspectFileService; |
| | | import com.ruoyi.quality.service.IQualityInspectParamService; |
| | | import com.ruoyi.quality.service.IQualityInspectService; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import org.springframework.util.CollectionUtils; |
| | |
| | | @RestController |
| | | @RequestMapping("/account/accountIncome") |
| | | @Tag(name = "è´¢å¡ç®¡ç--æ¶å
¥ç®¡ç") |
| | | public class AccountIncomeController { |
| | | public class AccountIncomeController extends BaseController { |
| | | |
| | | @Resource |
| | | private AccountIncomeService accountIncomeService; |
| | |
| | | */ |
| | | @PostMapping("/add") |
| | | @Operation(summary = "æ°å¢") |
| | | public AjaxResult add(@RequestBody AccountIncome accountIncome) { |
| | | public R<?> add(@RequestBody AccountIncome accountIncome) { |
| | | accountIncome.setInputTime(new Date()); |
| | | LoginUser loginUser = SecurityUtils.getLoginUser(); |
| | | accountIncome.setInputUser(loginUser.getNickName()); |
| | | return AjaxResult.success(accountIncomeService.save(accountIncome)); |
| | | return R.ok(accountIncomeService.save(accountIncome)); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @DeleteMapping("/del") |
| | | @Operation(summary = "å é¤") |
| | | public AjaxResult delQualityInspect(@RequestBody List<Integer> ids) { |
| | | public R<?> delQualityInspect(@RequestBody List<Integer> ids) { |
| | | if(CollectionUtils.isEmpty(ids)){ |
| | | return AjaxResult.error("è¯·éæ©è³å°ä¸æ¡æ°æ®"); |
| | | return R.fail("è¯·éæ©è³å°ä¸æ¡æ°æ®"); |
| | | } |
| | | //å 餿£éªå |
| | | return AjaxResult.success(accountIncomeService.removeBatchByIds(ids)); |
| | | return R.ok(accountIncomeService.removeBatchByIds(ids)); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @PostMapping("/update") |
| | | @Operation(summary = "ä¿®æ¹") |
| | | public AjaxResult update(@RequestBody AccountIncome accountIncome) { |
| | | return AjaxResult.success(accountIncomeService.updateById(accountIncome)); |
| | | public R<?> update(@RequestBody AccountIncome accountIncome) { |
| | | return R.ok(accountIncomeService.updateById(accountIncome)); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @GetMapping("/listPage") |
| | | @Operation(summary = "å页æ¥è¯¢") |
| | | public AjaxResult accountIncomeListPage(Page page, AccountIncome accountIncome) { |
| | | return AjaxResult.success(accountIncomeService.accountIncomeListPage(page, accountIncome)); |
| | | public R<?> accountIncomeListPage(Page page, AccountIncome accountIncome) { |
| | | return R.ok(accountIncomeService.accountIncomeListPage(page, accountIncome)); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @GetMapping("/{id}") |
| | | @Operation(summary = "详æ
") |
| | | public AjaxResult accountIncomeDetail(@PathVariable("id") Integer id) { |
| | | return AjaxResult.success(accountIncomeService.getById(id)); |
| | | public R<?> accountIncomeDetail(@PathVariable("id") Integer id) { |
| | | return R.ok(accountIncomeService.getById(id)); |
| | | } |
| | | |
| | | /** |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.account.service.impl.AccountingServiceImpl; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import lombok.AllArgsConstructor; |
| | |
| | | |
| | | @Operation(summary = "æ»è®¡") |
| | | @GetMapping("/total") |
| | | public AjaxResult total(@RequestParam Integer year) { |
| | | public R<?> total(@RequestParam Integer year) { |
| | | return accountingService.total(year); |
| | | } |
| | | |
| | | @Operation(summary = "设å¤ç±»ååå¸") |
| | | @GetMapping("/deviceTypeDistribution") |
| | | public AjaxResult deviceTypeDistribution(@RequestParam Integer year) { |
| | | public R<?> deviceTypeDistribution(@RequestParam Integer year) { |
| | | return accountingService.deviceTypeDistribution(year); |
| | | } |
| | | |
| | | @Operation(summary = "设å¤å页æ¥è¯¢è®¡ç®ææ§") |
| | | @GetMapping("/calculateDepreciation") |
| | | public AjaxResult calculateDepreciation(Page page, @RequestParam Integer year) { |
| | | public R<?> calculateDepreciation(Page page, @RequestParam Integer year) { |
| | | return accountingService.calculateDepreciation(page,year); |
| | | } |
| | | |
| | |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | @RestController |
| | | @RequestMapping("/borrowInfo") |
| | | @AllArgsConstructor |
| | | public class BorrowInfoController { |
| | | public class BorrowInfoController extends BaseController { |
| | | |
| | | private BorrowInfoService borrowInfoService; |
| | | |
| | | @GetMapping("/listPage") |
| | | @Operation(summary = "å页æ¥è¯¢") |
| | | public AjaxResult listPage(Page page, BorrowInfo borrowInfo) { |
| | | public R<?> listPage(Page page, BorrowInfo borrowInfo) { |
| | | return borrowInfoService.listPage(page,borrowInfo); |
| | | } |
| | | |
| | |
| | | @PostMapping("/add") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Log(title = "æ°å¢å款信æ¯", businessType = BusinessType.INSERT) |
| | | public AjaxResult add(@RequestBody BorrowInfo borrowInfo) { |
| | | public R<?> add(@RequestBody BorrowInfo borrowInfo) { |
| | | return borrowInfoService.add(borrowInfo); |
| | | } |
| | | |
| | |
| | | @PostMapping("/update") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Log(title = "ä¿®æ¹å款信æ¯", businessType = BusinessType.UPDATE) |
| | | public AjaxResult updateBorrowInfo(@RequestBody BorrowInfo borrowInfo) { |
| | | public R<?> updateBorrowInfo(@RequestBody BorrowInfo borrowInfo) { |
| | | return borrowInfoService.updateBorrowInfo(borrowInfo); |
| | | } |
| | | |
| | |
| | | @DeleteMapping("/delete") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Log(title = "å é¤å款信æ¯", businessType = BusinessType.DELETE) |
| | | public AjaxResult delete(@RequestBody List<Long> ids) { |
| | | public R<?> delete(@RequestBody List<Long> ids) { |
| | | return borrowInfoService.delete(ids); |
| | | } |
| | | |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.account.pojo.BorrowInfo; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | */ |
| | | public interface BorrowInfoService extends IService<BorrowInfo> { |
| | | |
| | | AjaxResult listPage(Page page, BorrowInfo borrowInfo); |
| | | R<?> listPage(Page page, BorrowInfo borrowInfo); |
| | | |
| | | AjaxResult add(BorrowInfo borrowInfo); |
| | | R<?> add(BorrowInfo borrowInfo); |
| | | |
| | | AjaxResult updateBorrowInfo(BorrowInfo borrowInfo); |
| | | R<?> updateBorrowInfo(BorrowInfo borrowInfo); |
| | | |
| | | AjaxResult delete(List<Long> ids); |
| | | R<?> delete(List<Long> ids); |
| | | } |
| | |
| | | import com.ruoyi.account.pojo.BorrowInfo; |
| | | import com.ruoyi.device.mapper.DeviceLedgerMapper; |
| | | import com.ruoyi.device.pojo.DeviceLedger; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.procurementrecord.mapper.CustomStorageMapper; |
| | | import com.ruoyi.procurementrecord.mapper.ProcurementRecordMapper; |
| | | import com.ruoyi.procurementrecord.mapper.ProcurementRecordOutMapper; |
| | |
| | | private final ProcurementRecordMapper procurementRecordMapper; |
| | | private final ProcurementRecordOutMapper procurementRecordOutMapper; |
| | | |
| | | public AjaxResult total(Integer year) { |
| | | public R<?> total(Integer year) { |
| | | Map<String,Object> map = new HashMap<>(); |
| | | map.put("deprAmount",0); // ææ§éé¢ |
| | | map.put("deviceTotal",0); // è®¾å¤æ»æ° |
| | |
| | | }); |
| | | } |
| | | map.put("inventoryValue",procurementRecordTotal.add(customStorageTotal)); |
| | | return AjaxResult.success( map); |
| | | return R.ok(map); |
| | | } |
| | | |
| | | /** |
| | |
| | | return totalDepreciation.setScale(2, BigDecimal.ROUND_HALF_UP); |
| | | } |
| | | |
| | | public AjaxResult deviceTypeDistribution(Integer year) { |
| | | public R<?> deviceTypeDistribution(Integer year) { |
| | | // 2. ç»è£
è¿åVO |
| | | DeviceTypeDistributionVO vo = new DeviceTypeDistributionVO(); |
| | | List<DeviceTypeDetail> details = deviceLedgerMapper.getDeviceTypeDistributionByYear( year); |
| | |
| | | .collect(Collectors.toList())); |
| | | vo.setTotalCount(vo.getCategories().size()); |
| | | } |
| | | return AjaxResult.success(vo); |
| | | return R.ok(vo); |
| | | } |
| | | |
| | | public AjaxResult calculateDepreciation(Page page, Integer year) { |
| | | public R<?> calculateDepreciation(Page page, Integer year) { |
| | | LambdaQueryWrapper<DeviceLedger> deviceLedgerLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | deviceLedgerLambdaQueryWrapper.like(DeviceLedger::getCreateTime,year) |
| | | .eq(DeviceLedger::getIsDepr,1); |
| | |
| | | record.setDeprAmount(calculatePreciseDepreciation(record)); |
| | | record.setNetValue(record.getTaxIncludingPriceTotal().subtract(record.getDeprAmount())); |
| | | } |
| | | return AjaxResult.success(deviceLedgerIPage); |
| | | return R.ok(deviceLedgerIPage); |
| | | } |
| | | } |
| | |
| | | import com.ruoyi.account.service.BorrowInfoService; |
| | | import com.ruoyi.common.utils.DateUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | private final AccountExpenseService accountExpenseService; |
| | | |
| | | @Override |
| | | public AjaxResult listPage(Page page, BorrowInfo borrowInfo) { |
| | | public R<?> listPage(Page page, BorrowInfo borrowInfo) { |
| | | LambdaQueryWrapper<BorrowInfo> borrowInfoLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | if(borrowInfo != null){ |
| | | if(StringUtils.isNotEmpty(borrowInfo.getEntryDateStart()) && StringUtils.isNotEmpty(borrowInfo.getEntryDateEnd())){ |
| | |
| | | borrowInfoLambdaQueryWrapper.like(BorrowInfo::getBorrowerName, borrowInfo.getBorrowerName()); |
| | | } |
| | | } |
| | | return AjaxResult.success(borrowInfoMapper.selectPage(page, borrowInfoLambdaQueryWrapper)); |
| | | return R.ok(borrowInfoMapper.selectPage(page, borrowInfoLambdaQueryWrapper)); |
| | | } |
| | | |
| | | @Override |
| | | public AjaxResult add(BorrowInfo borrowInfo) { |
| | | public R<?> add(BorrowInfo borrowInfo) { |
| | | int insert = borrowInfoMapper.insert(borrowInfo); |
| | | if(insert > 0){ |
| | | // æ·»å æåï¼è¿å
¥æ¶å
¥ç®¡ç |
| | |
| | | accountIncome.setInputTime(DateUtils.getNowDate()); |
| | | accountIncome.setInputUser(borrowInfo.getBorrowerName()); |
| | | accountIncomeService.save(accountIncome); |
| | | return AjaxResult.success("æ·»å æå"); |
| | | return R.ok(null, "æ·»å æå"); |
| | | } |
| | | return AjaxResult.success("æ·»å 失败"); |
| | | return R.ok(null, "æ·»å 失败"); |
| | | } |
| | | |
| | | @Override |
| | | public AjaxResult updateBorrowInfo(BorrowInfo borrowInfo) { |
| | | public R<?> updateBorrowInfo(BorrowInfo borrowInfo) { |
| | | int update = borrowInfoMapper.updateById(borrowInfo); |
| | | if(update > 0){ |
| | | // ä¿®æ¹æåï¼ä¿®æ¹æ¶å
¥ç®¡ç |
| | |
| | | accountExpense.setInputUser(borrowInfo.getBorrowerName()); |
| | | accountExpenseService.save(accountExpense); |
| | | } |
| | | return AjaxResult.success("ä¿®æ¹æå"); |
| | | return R.ok(null, "ä¿®æ¹æå"); |
| | | } |
| | | return AjaxResult.success("ä¿®æ¹å¤±è´¥"); |
| | | return R.ok(null, "ä¿®æ¹å¤±è´¥"); |
| | | } |
| | | |
| | | @Override |
| | | public AjaxResult delete(List<Long> ids) { |
| | | public R<?> delete(List<Long> ids) { |
| | | int delete = borrowInfoMapper.deleteBatchIds(ids); |
| | | if(delete > 0){ |
| | | // å 餿åï¼å 餿¶å
¥ç®¡ç |
| | |
| | | accountExpenseService.remove(new LambdaQueryWrapper<AccountExpense>() |
| | | .in(AccountExpense::getBusinessId, ids) |
| | | .eq(AccountExpense::getBusinessType, 2)); |
| | | return AjaxResult.success("å 餿å"); |
| | | return R.ok(null, "å 餿å"); |
| | | } |
| | | return AjaxResult.success("å é¤å¤±è´¥"); |
| | | return R.ok(null, "å é¤å¤±è´¥"); |
| | | } |
| | | } |
| | |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import lombok.AllArgsConstructor; |
| | |
| | | @PostMapping("/add") |
| | | @Operation(summary = "æ°å¢ä¸´æå®å") |
| | | @Log(title = "æ°å¢ä¸´æå®å", businessType = BusinessType.INSERT) |
| | | public AjaxResult add(@RequestBody AfterSalesNearExpiry entity) { |
| | | public R<?> add(@RequestBody AfterSalesNearExpiry entity) { |
| | | afterSalesNearExpiryService.add(entity); |
| | | return AjaxResult.success("æ·»å æå"); |
| | | return R.ok(null, "æ·»å æå"); |
| | | } |
| | | |
| | | /** |
| | |
| | | @PostMapping("/update") |
| | | @Operation(summary = "æ´æ°ä¸´æå®å") |
| | | @Log(title = "æ´æ°ä¸´æå®å", businessType = BusinessType.UPDATE) |
| | | public AjaxResult update(@RequestBody AfterSalesNearExpiry entity) { |
| | | public R<?> update(@RequestBody AfterSalesNearExpiry entity) { |
| | | afterSalesNearExpiryService.update(entity); |
| | | return AjaxResult.success("æ´æ°æå"); |
| | | return R.ok(null, "æ´æ°æå"); |
| | | } |
| | | |
| | | /** |
| | |
| | | @DeleteMapping("/delete") |
| | | @Operation(summary = "å é¤ä¸´æå®å") |
| | | @Log(title = "å é¤ä¸´æå®å", businessType = BusinessType.DELETE) |
| | | public AjaxResult delete(Long[] ids) { |
| | | public R<?> delete(Long[] ids) { |
| | | afterSalesNearExpiryService.delete(ids); |
| | | return AjaxResult.success("å 餿å"); |
| | | return R.ok(null, "å 餿å"); |
| | | } |
| | | |
| | | /** |
| | |
| | | @GetMapping("/listPage") |
| | | @Operation(summary = "å页æ¥è¯¢ä¸´æå®å") |
| | | @Log(title = "å页æ¥è¯¢ä¸´æå®å", businessType = BusinessType.OTHER) |
| | | public AjaxResult listPage(Page<AfterSalesNearExpiry> page, AfterSalesNearExpiry entity) { |
| | | public R<?> listPage(Page<AfterSalesNearExpiry> page, AfterSalesNearExpiry entity) { |
| | | IPage<AfterSalesNearExpiry> listPage = afterSalesNearExpiryService.listPage(page, entity); |
| | | return AjaxResult.success(listPage); |
| | | return R.ok(listPage); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.project.system.domain.SysUser; |
| | | import com.ruoyi.project.system.mapper.SysUserMapper; |
| | | import com.ruoyi.sales.dto.SalesLedgerDto; |
| | |
| | | @GetMapping("/listPage") |
| | | @Operation(summary = "å®åæå¡-å页æ¥è¯¢") |
| | | @Log(title = "å®åæå¡-å页æ¥è¯¢", businessType = BusinessType.OTHER) |
| | | public AjaxResult listPage(Page page, AfterSalesServiceNewDto afterSalesService) { |
| | | public R<?> listPage(Page page, AfterSalesServiceNewDto afterSalesService) { |
| | | IPage<AfterSalesServiceNewDto> listPage = afterSalesServiceService.listPage(page, afterSalesService); |
| | | return AjaxResult.success(listPage); |
| | | return R.ok(listPage); |
| | | } |
| | | |
| | | @Log(title = "å®åæå¡-åé¦ç»è®°", businessType = BusinessType.EXPORT) |
| | |
| | | @PostMapping("/add") |
| | | @Operation(summary = "å®åæå¡-æ°å¢") |
| | | @Log(title = "å®åæå¡-æ°å¢", businessType = BusinessType.INSERT) |
| | | public AjaxResult add(@RequestBody AfterSalesServiceNewDto afterSalesServiceNewDto) { |
| | | return afterSalesServiceService.addAfterSalesServiceDto(afterSalesServiceNewDto) ? AjaxResult.success() : AjaxResult.error(); |
| | | public R<?> add(@RequestBody AfterSalesServiceNewDto afterSalesServiceNewDto) { |
| | | return afterSalesServiceService.addAfterSalesServiceDto(afterSalesServiceNewDto) ? R.ok() : R.fail(); |
| | | } |
| | | |
| | | @PostMapping("/update") |
| | | @Operation(summary = "å®åæå¡-ä¿®æ¹") |
| | | @Log(title = "å®åæå¡-ä¿®æ¹", businessType = BusinessType.UPDATE) |
| | | public AjaxResult update(@RequestBody AfterSalesServiceNewDto afterSalesServiceNewDto) { |
| | | public R<?> update(@RequestBody AfterSalesServiceNewDto afterSalesServiceNewDto) { |
| | | if (afterSalesServiceNewDto.getProductModelIdList() != null && afterSalesServiceNewDto.getProductModelIdList().isEmpty() ) { |
| | | String productModelIds = afterSalesServiceNewDto.getProductModelIdList().stream() |
| | | .map(String::valueOf) |
| | |
| | | afterSalesServiceNewDto.setProductModelIds(productModelIds); |
| | | } |
| | | boolean update = afterSalesServiceService.updateById(afterSalesServiceNewDto); |
| | | return update ? AjaxResult.success() : AjaxResult.error(); |
| | | return update ? R.ok() : R.fail(); |
| | | } |
| | | |
| | | @DeleteMapping("/delete") |
| | | @Operation(summary = "å®åæå¡-å é¤") |
| | | @Log(title = "å®åæå¡-å é¤", businessType = BusinessType.DELETE) |
| | | public AjaxResult delete(@RequestBody List<Long> ids) { |
| | | public R<?> delete(@RequestBody List<Long> ids) { |
| | | if (CollectionUtils.isEmpty(ids)) { |
| | | return AjaxResult.error("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | return R.fail("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | } |
| | | boolean delete = afterSalesServiceService.removeByIds(ids); |
| | | return delete ? AjaxResult.success() : AjaxResult.error(); |
| | | return delete ? R.ok() : R.fail(); |
| | | } |
| | | |
| | | @PostMapping("/dispose") |
| | | @Operation(summary = "å®åæå¡-å¤ç") |
| | | @Log(title = "å®åæå¡-å¤ç", businessType = BusinessType.UPDATE) |
| | | public AjaxResult dispose(@RequestBody AfterSalesService afterSalesService) { |
| | | public R<?> dispose(@RequestBody AfterSalesService afterSalesService) { |
| | | AfterSalesService byId = afterSalesServiceService.getById(afterSalesService.getId()); |
| | | if(byId == null) throw new RuntimeException("æªæ¾å°è¯¥æ°æ®"); |
| | | if(byId.getStatus().equals(2)) throw new RuntimeException("è¯¥æ°æ®å·²å¤ç"); |
| | |
| | | afterSalesService.setDisposeNickName(sysUser.getNickName()); |
| | | afterSalesService.setStatus(2); |
| | | boolean update = afterSalesServiceService.updateById(afterSalesService); |
| | | return update ? AjaxResult.success() : AjaxResult.error(); |
| | | return update ? R.ok() : R.fail(); |
| | | } |
| | | |
| | | |
| | | @GetMapping("listSalesLedger") |
| | | @Operation(summary = "å®åæå¡-è·åéå®å°è´¦") |
| | | public AjaxResult listSalesLedger(SalesLedgerDto salesLedgerDto, Page page) { |
| | | public R<?> listSalesLedger(SalesLedgerDto salesLedgerDto, Page page) { |
| | | IPage<SalesLedgerDto> list = salesLedgerService.listSalesLedger(salesLedgerDto,page); |
| | | return AjaxResult.success(list); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | |
| | | @GetMapping("getById") |
| | | @Operation(summary = "å®åæå¡-æ ¹æ®idè·å详æ
") |
| | | public AjaxResult getById(Long id) { |
| | | return AjaxResult.success(afterSalesServiceService.getAfterSalesServiceNewDtoById(id)); |
| | | public R<?> getById(Long id) { |
| | | return R.ok(afterSalesServiceService.getAfterSalesServiceNewDtoById(id)); |
| | | } |
| | | |
| | | @Operation(summary = "å®åæå¡-ç»è®¡å·¥åæ
åµ") |
| | | @GetMapping("count") |
| | | public AjaxResult count() { |
| | | return AjaxResult.success(afterSalesServiceService.countAfterSalesService()); |
| | | public R<?> count() { |
| | | return R.ok(afterSalesServiceService.countAfterSalesService()); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import lombok.AllArgsConstructor; |
| | |
| | | @PostMapping("/upload") |
| | | @Operation(summary = "å®åæå¡-æä»¶ä¸ä¼ ") |
| | | @Log(title = "å®åæå¡-æä»¶ä¸ä¼ ", businessType = BusinessType.INSERT) |
| | | public AjaxResult fileUpload(@RequestParam("file") MultipartFile file, |
| | | public R<?> fileUpload(@RequestParam("file") MultipartFile file, |
| | | @RequestParam("id") Long afterSalesServiceId) { |
| | | afterSalesServiceFileService.fileUpload(file, afterSalesServiceId); |
| | | return AjaxResult.success("ä¸ä¼ æå"); |
| | | return R.ok(null, "ä¸ä¼ æå"); |
| | | } |
| | | |
| | | @GetMapping("/listPage") |
| | | @Operation(summary = "å®åå¤ç-å®åéä»¶å表") |
| | | @Log(title = "å®åå¤ç-å®åéä»¶å表", businessType = BusinessType.OTHER) |
| | | public AjaxResult fileList(Page<AfterSalesServiceFile> page, Long afterSalesServiceId) { |
| | | return AjaxResult.success(afterSalesServiceFileService.fileList(page, afterSalesServiceId)); |
| | | public R<?> fileList(Page<AfterSalesServiceFile> page, Long afterSalesServiceId) { |
| | | return R.ok(afterSalesServiceFileService.fileList(page, afterSalesServiceId)); |
| | | } |
| | | |
| | | @DeleteMapping("/del/{fileId}") |
| | | @Operation(summary = "å®åå¤ç-å é¤éä»¶") |
| | | @Log(title = "å®åå¤ç-å é¤éä»¶", businessType = BusinessType.DELETE) |
| | | public AjaxResult delFile(@PathVariable Long fileId) { |
| | | public R<?> delFile(@PathVariable Long fileId) { |
| | | afterSalesServiceFileService.delFile(fileId); |
| | | return AjaxResult.success("å 餿å!"); |
| | | return R.ok(null, "å 餿å!"); |
| | | } |
| | | } |
| | |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.framework.security.LoginUser; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import dev.langchain4j.data.message.AiMessage; |
| | | import dev.langchain4j.data.message.UserMessage; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | |
| | | |
| | | @Operation(summary = "å¶é ä¼è¯å表") |
| | | @GetMapping("/history/sessions") |
| | | public AjaxResult listSessions() { |
| | | return success(aiChatSessionService.listCurrentUserSessions(SecurityUtils.getLoginUser())); |
| | | public R<?> listSessions() { |
| | | return R.ok(aiChatSessionService.listCurrentUserSessions(SecurityUtils.getLoginUser())); |
| | | } |
| | | |
| | | @Operation(summary = "å¶é ä¼è¯æ¶æ¯") |
| | | @GetMapping("/history/messages/{memoryId}") |
| | | public AjaxResult listMessages(@PathVariable String memoryId) { |
| | | return success(aiChatSessionService.listCurrentUserMessages(memoryId, SecurityUtils.getLoginUser())); |
| | | public R<?> listMessages(@PathVariable String memoryId) { |
| | | return R.ok(aiChatSessionService.listCurrentUserMessages(memoryId, SecurityUtils.getLoginUser())); |
| | | } |
| | | |
| | | @Operation(summary = "å é¤å¶é ä¼è¯") |
| | | @DeleteMapping("/history/{memoryId}") |
| | | public AjaxResult deleteSession(@PathVariable String memoryId) { |
| | | public R<?> deleteSession(@PathVariable String memoryId) { |
| | | aiSessionUserContext.remove(memoryId); |
| | | return toAjax(aiChatSessionService.deleteCurrentUserSession(memoryId, SecurityUtils.getLoginUser())); |
| | | aiChatSessionService.deleteCurrentUserSession(memoryId, SecurityUtils.getLoginUser()); |
| | | return R.ok(); |
| | | } |
| | | } |
| | |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.framework.security.LoginUser; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | import reactor.core.publisher.Flux; |
| | | |
| | |
| | | |
| | | @Operation(summary = "éè´å¤æä»¶åæç¡®è®¤å¤ç") |
| | | @PostMapping("/analyze-files/confirm") |
| | | public AjaxResult confirmAnalyzeResult(@RequestBody PurchaseAiConfirmRequest request) { |
| | | public R confirmAnalyzeResult(@RequestBody PurchaseAiConfirmRequest request) { |
| | | return purchaseAiService.confirmAnalyzeResult(request); |
| | | } |
| | | |
| | | @Operation(summary = "éè´ä¼è¯å表") |
| | | @GetMapping("/history/sessions") |
| | | public AjaxResult listSessions() { |
| | | public R listSessions() { |
| | | LoginUser loginUser = SecurityUtils.getLoginUser(); |
| | | return success(purchaseAiService.listSessions(loginUser)); |
| | | return R.ok(purchaseAiService.listSessions(loginUser)); |
| | | } |
| | | |
| | | @Operation(summary = "éè´ä¼è¯æ¶æ¯") |
| | | @GetMapping("/history/messages/{memoryId}") |
| | | public AjaxResult listMessages(@PathVariable String memoryId) { |
| | | public R listMessages(@PathVariable String memoryId) { |
| | | LoginUser loginUser = SecurityUtils.getLoginUser(); |
| | | return success(purchaseAiService.listMessages(memoryId, loginUser)); |
| | | return R.ok(purchaseAiService.listMessages(memoryId, loginUser)); |
| | | } |
| | | |
| | | @Operation(summary = "å é¤éè´ä¼è¯") |
| | | @DeleteMapping("/history/{memoryId}") |
| | | public AjaxResult deleteSession(@PathVariable String memoryId) { |
| | | public R deleteSession(@PathVariable String memoryId) { |
| | | LoginUser loginUser = SecurityUtils.getLoginUser(); |
| | | return toAjax(purchaseAiService.deleteSession(memoryId, loginUser)); |
| | | return R.ok(purchaseAiService.deleteSession(memoryId, loginUser)); |
| | | } |
| | | } |
| | |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.framework.security.LoginUser; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import dev.langchain4j.data.message.AiMessage; |
| | | import dev.langchain4j.data.message.UserMessage; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | |
| | | |
| | | @Operation(summary = "éå®å©æä¼è¯å表") |
| | | @GetMapping("/history/sessions") |
| | | public AjaxResult listSessions() { |
| | | return success(aiChatSessionService.listCurrentUserSessions(SecurityUtils.getLoginUser())); |
| | | public R<?> listSessions() { |
| | | return R.ok(aiChatSessionService.listCurrentUserSessions(SecurityUtils.getLoginUser())); |
| | | } |
| | | |
| | | @Operation(summary = "éå®å©æä¼è¯æ¶æ¯") |
| | | @GetMapping("/history/messages/{memoryId}") |
| | | public AjaxResult listMessages(@PathVariable String memoryId) { |
| | | return success(aiChatSessionService.listCurrentUserMessages(memoryId, SecurityUtils.getLoginUser())); |
| | | public R<?> listMessages(@PathVariable String memoryId) { |
| | | return R.ok(aiChatSessionService.listCurrentUserMessages(memoryId, SecurityUtils.getLoginUser())); |
| | | } |
| | | |
| | | @Operation(summary = "å é¤éå®å©æä¼è¯") |
| | | @DeleteMapping("/history/{memoryId}") |
| | | public AjaxResult deleteSession(@PathVariable String memoryId) { |
| | | public R<?> deleteSession(@PathVariable String memoryId) { |
| | | aiSessionUserContext.remove(memoryId); |
| | | return toAjax(aiChatSessionService.deleteCurrentUserSession(memoryId, SecurityUtils.getLoginUser())); |
| | | aiChatSessionService.deleteCurrentUserSession(memoryId, SecurityUtils.getLoginUser()); |
| | | return R.ok(); |
| | | } |
| | | |
| | | private boolean isBusinessDataIntent(String message) { |
| | |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.framework.security.LoginUser; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import dev.langchain4j.data.message.AiMessage; |
| | | import dev.langchain4j.data.message.UserMessage; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | import reactor.core.publisher.Flux; |
| | | |
| | |
| | | |
| | | @Operation(summary = "ä¼è¯å表") |
| | | @GetMapping("/history/sessions") |
| | | public AjaxResult listSessions() { |
| | | return success(aiChatSessionService.listCurrentUserSessions(SecurityUtils.getLoginUser())); |
| | | public R listSessions() { |
| | | return R.ok(aiChatSessionService.listCurrentUserSessions(SecurityUtils.getLoginUser())); |
| | | } |
| | | |
| | | @Operation(summary = "ä¼è¯æ¶æ¯") |
| | | @GetMapping("/history/messages/{memoryId}") |
| | | public AjaxResult listMessages(@PathVariable String memoryId) { |
| | | return success(aiChatSessionService.listCurrentUserMessages(memoryId, SecurityUtils.getLoginUser())); |
| | | public R listMessages(@PathVariable String memoryId) { |
| | | return R.ok(aiChatSessionService.listCurrentUserMessages(memoryId, SecurityUtils.getLoginUser())); |
| | | } |
| | | |
| | | @Operation(summary = "å é¤ä¼è¯") |
| | | @DeleteMapping("/history/{memoryId}") |
| | | public AjaxResult deleteSession(@PathVariable String memoryId) { |
| | | public R deleteSession(@PathVariable String memoryId) { |
| | | aiSessionUserContext.remove(memoryId); |
| | | return toAjax(aiChatSessionService.deleteCurrentUserSession(memoryId, SecurityUtils.getLoginUser())); |
| | | return R.ok(aiChatSessionService.deleteCurrentUserSession(memoryId, SecurityUtils.getLoginUser())); |
| | | } |
| | | |
| | | private boolean isApproveTodoBusinessIntent(String message) { |
| | |
| | | import com.ruoyi.basic.service.StorageBlobService; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.framework.security.LoginUser; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.purchase.dto.PurchaseLedgerDto; |
| | | import com.ruoyi.purchase.dto.PurchaseReturnOrderDto; |
| | | import com.ruoyi.purchase.pojo.PaymentRegistration; |
| | |
| | | import com.ruoyi.purchase.service.PurchaseReturnOrdersService; |
| | | import com.ruoyi.sales.pojo.SalesLedgerProduct; |
| | | import dev.langchain4j.data.image.Image; |
| | | import dev.langchain4j.data.message.AiMessage; |
| | | import dev.langchain4j.data.message.ChatMessage; |
| | | import dev.langchain4j.data.message.Content; |
| | | import dev.langchain4j.data.message.ImageContent; |
| | | import dev.langchain4j.data.message.SystemMessage; |
| | | import dev.langchain4j.data.message.TextContent; |
| | | import dev.langchain4j.data.message.UserMessage; |
| | | import dev.langchain4j.data.message.*; |
| | | import dev.langchain4j.model.chat.StreamingChatLanguageModel; |
| | | import dev.langchain4j.model.chat.response.ChatResponse; |
| | | import dev.langchain4j.model.chat.response.StreamingChatResponseHandler; |
| | |
| | | import java.io.InputStream; |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.util.Base64; |
| | | import java.util.Arrays; |
| | | import java.nio.file.Files; |
| | | import java.time.LocalDate; |
| | | import java.time.ZoneId; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.time.format.DateTimeParseException; |
| | | import java.util.ArrayList; |
| | | import java.util.Collections; |
| | | import java.util.Date; |
| | | import java.util.LinkedHashMap; |
| | | import java.util.List; |
| | | import java.util.Locale; |
| | | import java.util.Map; |
| | | import java.util.NoSuchElementException; |
| | | import java.util.UUID; |
| | | import java.nio.file.Files; |
| | | import java.util.*; |
| | | |
| | | @Service |
| | | public class PurchaseAiService { |
| | |
| | | .doOnError(ex -> aiChatSessionService.refreshSessionStats(finalMemoryId, loginUser)); |
| | | } |
| | | |
| | | public AjaxResult confirmAnalyzeResult(PurchaseAiConfirmRequest request) { |
| | | public R confirmAnalyzeResult(PurchaseAiConfirmRequest request) { |
| | | if (request == null || !StringUtils.hasText(request.getBusinessType())) { |
| | | return AjaxResult.error("businessTypeä¸è½ä¸ºç©º"); |
| | | return R.fail("businessTypeä¸è½ä¸ºç©º"); |
| | | } |
| | | if (request.getPayload() == null || request.getPayload().isEmpty()) { |
| | | return AjaxResult.error("payloadä¸è½ä¸ºç©º"); |
| | | return R.fail("payloadä¸è½ä¸ºç©º"); |
| | | } |
| | | |
| | | try { |
| | |
| | | case "purchase_ledger" -> processPurchaseLedger(request.getPayload()); |
| | | case "payment_registration" -> processPaymentRegistration(request.getPayload()); |
| | | case "purchase_return_order" -> processPurchaseReturnOrder(request.getPayload()); |
| | | default -> AjaxResult.error("æä¸æ¯æè¯¥ä¸å¡ç±»å: " + businessType); |
| | | default -> R.fail("æä¸æ¯æè¯¥ä¸å¡ç±»å: " + businessType); |
| | | }; |
| | | } catch (Exception ex) { |
| | | return AjaxResult.error(toCustomerMessage(ex)); |
| | | return R.fail(toCustomerMessage(ex)); |
| | | } |
| | | } |
| | | |
| | |
| | | è¾åºè¦æ±: |
| | | 1. åªè¾åºåæ³ JSONï¼ä¸è¦ Markdownï¼ä¸è¦é¢å¤è§£éã |
| | | 2. JSON é¡¶å±å段åºå®ä¸º: |
| | | - success: boolean |
| | | - ok: boolean |
| | | - businessType: purchase_ledger | payment_registration | purchase_return_order | unknown |
| | | - action: confirm_required |
| | | - description: ä¸æè¯´æ |
| | |
| | | """.formatted(message, fileContent); |
| | | } |
| | | |
| | | private AjaxResult processPurchaseLedger(Map<String, Object> payload) throws Exception { |
| | | private R processPurchaseLedger(Map<String, Object> payload) throws Exception { |
| | | if (payload.containsKey("purchaseLedgers")) { |
| | | return processPurchaseLedgerBatch(payload); |
| | | } |
| | | |
| | | Map<String, Object> normalizedPayload = normalizePurchaseLedgerMap(payload); |
| | | PurchaseLedgerDto dto = objectMapper.convertValue(normalizedPayload, PurchaseLedgerDto.class); |
| | | AjaxResult ledgerResult = validatePurchaseLedger(dto, 0); |
| | | R ledgerResult = validatePurchaseLedger(dto, 0); |
| | | if (ledgerResult != null) { |
| | | return ledgerResult; |
| | | } |
| | | AjaxResult supplierResult = fillSupplierIdByName(dto); |
| | | R supplierResult = fillSupplierIdByName(dto); |
| | | if (supplierResult != null) { |
| | | return supplierResult; |
| | | } |
| | | AjaxResult productResult = validatePurchaseProducts(dto.getProductData(), 0); |
| | | R productResult = validatePurchaseProducts(dto.getProductData(), 0); |
| | | if (productResult != null) { |
| | | return productResult; |
| | | } |
| | | int result = purchaseLedgerService.addOrEditPurchase(dto); |
| | | return AjaxResult.success("éè´å°è´¦å·²å¤ç", result); |
| | | return R.ok( result,"éè´å°è´¦å·²å¤ç"); |
| | | } |
| | | |
| | | private AjaxResult processPurchaseLedgerBatch(Map<String, Object> payload) throws Exception { |
| | | private R processPurchaseLedgerBatch(Map<String, Object> payload) throws Exception { |
| | | List<Map<String, Object>> purchaseLedgers = toMapList(payload.get("purchaseLedgers")); |
| | | if (purchaseLedgers.isEmpty()) { |
| | | return AjaxResult.error("purchaseLedgersä¸è½ä¸ºç©º"); |
| | | return R.fail("purchaseLedgersä¸è½ä¸ºç©º"); |
| | | } |
| | | |
| | | List<Map<String, Object>> topLevelProductData = toMapList(payload.get("productData")); |
| | |
| | | for (int i = 0; i < purchaseLedgers.size(); i++) { |
| | | Map<String, Object> ledgerMap = normalizePurchaseLedgerMap(purchaseLedgers.get(i)); |
| | | PurchaseLedgerDto dto = objectMapper.convertValue(ledgerMap, PurchaseLedgerDto.class); |
| | | AjaxResult ledgerResult = validatePurchaseLedger(dto, i); |
| | | R ledgerResult = validatePurchaseLedger(dto, i); |
| | | if (ledgerResult != null) { |
| | | return ledgerResult; |
| | | } |
| | | AjaxResult supplierResult = fillSupplierIdByName(dto); |
| | | R supplierResult = fillSupplierIdByName(dto); |
| | | if (supplierResult != null) { |
| | | return supplierResult; |
| | | } |
| | |
| | | products = matchProductsForLedger(ledgerMap, dto, topLevelProductData, purchaseLedgers.size() == 1); |
| | | dto.setProductData(products); |
| | | } |
| | | AjaxResult productResult = validatePurchaseProducts(products, i); |
| | | R productResult = validatePurchaseProducts(products, i); |
| | | if (productResult != null) { |
| | | return productResult; |
| | | } |
| | |
| | | item.put("result", result); |
| | | results.add(item); |
| | | } |
| | | return AjaxResult.success("éè´å°è´¦å·²æ¹éå¤ç", results); |
| | | return R.ok( results,"éè´å°è´¦å·²æ¹éå¤ç"); |
| | | } |
| | | |
| | | private List<SalesLedgerProduct> matchProductsForLedger(Map<String, Object> ledgerMap, |
| | |
| | | } |
| | | } |
| | | |
| | | private AjaxResult validatePurchaseProducts(List<SalesLedgerProduct> products, int ledgerIndex) { |
| | | private R validatePurchaseProducts(List<SalesLedgerProduct> products, int ledgerIndex) { |
| | | if (products == null || products.isEmpty()) { |
| | | return null; |
| | | } |
| | |
| | | SalesLedgerProduct product = products.get(i); |
| | | String prefix = "第" + (ledgerIndex + 1) + "个éè´å°è´¦ç第" + (i + 1) + "æ¡äº§å"; |
| | | if (!StringUtils.hasText(product.getProductCategory())) { |
| | | return AjaxResult.error(prefix + "缺å°äº§ååç§°ï¼è¯·è¡¥å
åå确认"); |
| | | return R.fail(prefix + "缺å°äº§ååç§°ï¼è¯·è¡¥å
åå确认"); |
| | | } |
| | | if (!StringUtils.hasText(product.getSpecificationModel())) { |
| | | return AjaxResult.error(prefix + "缺å°è§æ ¼åå·ï¼è¯·è¡¥å
åå确认"); |
| | | return R.fail(prefix + "缺å°è§æ ¼åå·ï¼è¯·è¡¥å
åå确认"); |
| | | } |
| | | if (!StringUtils.hasText(product.getUnit())) { |
| | | return AjaxResult.error(prefix + "缺å°åä½ï¼è¯·è¡¥å
åå确认"); |
| | | return R.fail(prefix + "缺å°åä½ï¼è¯·è¡¥å
åå确认"); |
| | | } |
| | | if (product.getQuantity() == null) { |
| | | return AjaxResult.error(prefix + "ç¼ºå°æ°é"); |
| | | return R.fail(prefix + "ç¼ºå°æ°é"); |
| | | } |
| | | if (product.getTaxInclusiveUnitPrice() == null) { |
| | | return AjaxResult.error(prefix + "缺å°å«ç¨åä»·ï¼è¯·è¡¥å
åå确认"); |
| | | return R.fail(prefix + "缺å°å«ç¨åä»·ï¼è¯·è¡¥å
åå确认"); |
| | | } |
| | | if (product.getTaxInclusiveTotalPrice() == null) { |
| | | return AjaxResult.error(prefix + "缺å°å«ç¨æ»ä»·ï¼è¯·è¡¥å
åå确认"); |
| | | return R.fail(prefix + "缺å°å«ç¨æ»ä»·ï¼è¯·è¡¥å
åå确认"); |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | private AjaxResult validatePurchaseLedger(PurchaseLedgerDto dto, int ledgerIndex) { |
| | | private R validatePurchaseLedger(PurchaseLedgerDto dto, int ledgerIndex) { |
| | | String prefix = "第" + (ledgerIndex + 1) + "个éè´å°è´¦"; |
| | | if (!StringUtils.hasText(dto.getPurchaseContractNumber())) { |
| | | return AjaxResult.error(prefix + "缺å°éè´ååå·ï¼è¯·è¡¥å
åå确认"); |
| | | return R.fail(prefix + "缺å°éè´ååå·ï¼è¯·è¡¥å
åå确认"); |
| | | } |
| | | if (dto.getSupplierId() == null && !StringUtils.hasText(dto.getSupplierName())) { |
| | | return AjaxResult.error(prefix + "缺å°ä¾åºååç§°ï¼è¯·è¡¥å
åå确认"); |
| | | return R.fail(prefix + "缺å°ä¾åºååç§°ï¼è¯·è¡¥å
åå确认"); |
| | | } |
| | | return null; |
| | | } |
| | |
| | | return "å¤ç失败ï¼" + message; |
| | | } |
| | | |
| | | private AjaxResult fillSupplierIdByName(PurchaseLedgerDto dto) { |
| | | private R fillSupplierIdByName(PurchaseLedgerDto dto) { |
| | | if (dto.getSupplierId() != null) { |
| | | return null; |
| | | } |
| | | if (!StringUtils.hasText(dto.getSupplierName())) { |
| | | return AjaxResult.error("ä¾åºåIDä¸è½ä¸ºç©ºï¼æªè¯å«å°ä¾åºååç§°ï¼æ æ³èªå¨å¹é
ä¾åºåID"); |
| | | return R.fail("ä¾åºåIDä¸è½ä¸ºç©ºï¼æªè¯å«å°ä¾åºååç§°ï¼æ æ³èªå¨å¹é
ä¾åºåID"); |
| | | } |
| | | |
| | | SupplierManage supplier = supplierManageMapper.selectOne(new LambdaQueryWrapper<SupplierManage>() |
| | | .eq(SupplierManage::getSupplierName, dto.getSupplierName().trim()) |
| | | .last("limit 1")); |
| | | if (supplier == null) { |
| | | return AjaxResult.error("æªæ¾å°ä¾åºåï¼" + dto.getSupplierName() + "ï¼è¯·å
ç»´æ¤ä¾åºåææå¨éæ©ä¾åºåID"); |
| | | return R.fail("æªæ¾å°ä¾åºåï¼" + dto.getSupplierName() + "ï¼è¯·å
ç»´æ¤ä¾åºåææå¨éæ©ä¾åºåID"); |
| | | } |
| | | dto.setSupplierId(supplier.getId()); |
| | | return null; |
| | | } |
| | | |
| | | private AjaxResult processPaymentRegistration(Map<String, Object> payload) { |
| | | private R processPaymentRegistration(Map<String, Object> payload) { |
| | | Object recordsValue = payload.get("records"); |
| | | List<PaymentRegistration> records; |
| | | if (recordsValue == null) { |
| | |
| | | }); |
| | | } |
| | | int result = paymentRegistrationService.insertPaymentRegistration(records); |
| | | return AjaxResult.success("仿¬¾ç»è®°å·²å¤ç", result); |
| | | return R.ok( result,"仿¬¾ç»è®°å·²å¤ç"); |
| | | } |
| | | |
| | | private AjaxResult processPurchaseReturnOrder(Map<String, Object> payload) { |
| | | private R processPurchaseReturnOrder(Map<String, Object> payload) { |
| | | PurchaseReturnOrderDto dto = objectMapper.convertValue(payload, PurchaseReturnOrderDto.class); |
| | | Boolean result = purchaseReturnOrdersService.add(dto); |
| | | return AjaxResult.success("éè´éè´§åå·²å¤ç", result); |
| | | return R.ok( result,"éè´éè´§åå·²å¤ç"); |
| | | } |
| | | } |
| | |
| | | |
| | | import com.ruoyi.approve.pojo.ApproveNode; |
| | | import com.ruoyi.approve.service.IApproveNodeService; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import lombok.AllArgsConstructor; |
| | |
| | | @RestController |
| | | @RequestMapping("/approveNode") |
| | | @AllArgsConstructor |
| | | public class ApproveNodeController { |
| | | public class ApproveNodeController extends BaseController { |
| | | |
| | | private IApproveNodeService approveNodeService; |
| | | |
| | |
| | | */ |
| | | @GetMapping("/details/{id}") |
| | | @Operation(summary = "æµç¨ç¶æè¯¦æ
") |
| | | public AjaxResult details(@PathVariable String id) { |
| | | return AjaxResult.success(approveNodeService.details(id)); |
| | | public R<?> details(@PathVariable String id) { |
| | | return R.ok(approveNodeService.details(id)); |
| | | } |
| | | |
| | | /** |
| | |
| | | @PostMapping("/updateApproveNode") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Operation(summary = "审æ¹èç¹") |
| | | public AjaxResult updateApproveNode(@RequestBody ApproveNode approveNode) throws IOException { |
| | | public R<?> updateApproveNode(@RequestBody ApproveNode approveNode) throws IOException { |
| | | approveNodeService.updateApproveNode(approveNode); |
| | | return AjaxResult.success(); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping("/init") |
| | | public AjaxResult init(String id) { |
| | | public R<?> init(String id) { |
| | | approveNodeService.initApproveNodes("",id,1L); |
| | | return AjaxResult.success(); |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.framework.security.LoginUser; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.common.constant.HttpStatus; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.project.system.domain.SysDept; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | |
| | | @RequestMapping("/approveProcess") |
| | | @AllArgsConstructor |
| | | @Tag(name = "审æ¹") |
| | | public class ApproveProcessController { |
| | | public class ApproveProcessController extends BaseController { |
| | | |
| | | private IApproveProcessService approveProcessService; |
| | | /**ã |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/getDept") |
| | | public AjaxResult getDept() { |
| | | public R<?> getDept() { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | LoginUser user = SecurityUtils.getLoginUser(); |
| | | Long[] deptIds = SecurityUtils.getDeptId(); |
| | | |
| | | List<SysDept> sysDeptList = approveProcessService.selectDeptListByDeptIds(deptIds); |
| | | return AjaxResult.success(sysDeptList); |
| | | return R.ok(sysDeptList); |
| | | } |
| | | |
| | | /** |
| | |
| | | @PostMapping("/add") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Operation(summary = "æ·»å 审æ¹") |
| | | public AjaxResult add(@RequestBody ApproveProcessVO approveProcessVO) throws Exception { |
| | | public R<?> add(@RequestBody ApproveProcessVO approveProcessVO) throws Exception { |
| | | if (approveProcessVO == null) { |
| | | return AjaxResult.warn("åæ°ä¸è½ä¸ºç©º"); |
| | | return R.fail(HttpStatus.WARN,"åæ°ä¸è½ä¸ºç©º"); |
| | | } |
| | | |
| | | approveProcessService.addApprove(approveProcessVO); |
| | | return AjaxResult.success("æ·»å æå"); |
| | | return R.ok(null, "æ·»å æå"); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @GetMapping("/get") |
| | | @Operation(summary = "审æ¹è¯¦æ
") |
| | | public AjaxResult get(ApproveGetAndUpdateVo approveGetAndUpdateVo){ |
| | | public R<?> get(ApproveGetAndUpdateVo approveGetAndUpdateVo){ |
| | | if (approveGetAndUpdateVo.getId() == null || approveGetAndUpdateVo.getId().isEmpty()) { |
| | | return AjaxResult.warn("åæ°ä¸è½ä¸ºç©º"); |
| | | return R.fail(HttpStatus.WARN,"åæ°ä¸è½ä¸ºç©º"); |
| | | } |
| | | return AjaxResult.success(approveProcessService.getApproveById(approveGetAndUpdateVo.getId())); |
| | | return R.ok(approveProcessService.getApproveById(approveGetAndUpdateVo.getId())); |
| | | } |
| | | |
| | | /** |
| | |
| | | @PostMapping("/update") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Operation(summary = "æ´æ°å®¡æ¹") |
| | | public AjaxResult update(@RequestBody ApproveGetAndUpdateVo approveGetAndUpdateVo) throws IOException { |
| | | public R<?> update(@RequestBody ApproveGetAndUpdateVo approveGetAndUpdateVo) throws IOException { |
| | | if (approveGetAndUpdateVo == null) { |
| | | return AjaxResult.warn("åæ°ä¸è½ä¸ºç©º"); |
| | | return R.fail(HttpStatus.WARN,"åæ°ä¸è½ä¸ºç©º"); |
| | | } |
| | | approveProcessService.updateByApproveId(approveGetAndUpdateVo); |
| | | return AjaxResult.success("æä½æå"); |
| | | return R.ok(null, "æä½æå"); |
| | | } |
| | | /** |
| | | * è·å审æ¹å表 |
| | |
| | | */ |
| | | @GetMapping("/list") |
| | | @Operation(summary = "è·å审æ¹å表") |
| | | public AjaxResult list(Page page, ApproveProcess approveProcess) { |
| | | return AjaxResult.success(approveProcessService.listAll(page, approveProcess)); |
| | | public R<?> list(Page page, ApproveProcess approveProcess) { |
| | | return R.ok(approveProcessService.listAll(page, approveProcess)); |
| | | } |
| | | |
| | | /** |
| | |
| | | @DeleteMapping("/deleteIds") |
| | | @Operation(summary = "å é¤å®¡æ¹") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult deleteIds(@RequestBody List<Long> ids) { |
| | | public R<?> deleteIds(@RequestBody List<Long> ids) { |
| | | if (ids == null || ids.size() == 0) { |
| | | return AjaxResult.warn("åæ°ä¸è½ä¸ºç©º"); |
| | | return R.fail(HttpStatus.WARN,"åæ°ä¸è½ä¸ºç©º"); |
| | | } |
| | | approveProcessService.delApprove(ids); |
| | | return AjaxResult.success("æä½æå"); |
| | | return R.ok(null, "æä½æå"); |
| | | } |
| | | |
| | | @Operation(summary = "å
¬åºç®¡ç导åº") |
| | |
| | | import com.ruoyi.approve.mapper.WorkingHoursSettingMapper; |
| | | import com.ruoyi.approve.pojo.*; |
| | | import com.ruoyi.approve.service.HolidaySettingsService; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | @RestController |
| | | @RequestMapping("/holidaySettings") |
| | | @AllArgsConstructor |
| | | public class HolidaySettingsController { |
| | | public class HolidaySettingsController extends BaseController { |
| | | private HolidaySettingsService holidaySettingsService; |
| | | private AnnualLeaveSettingMapper annualLeaveSettingMapper; |
| | | private OvertimeSettingMapper overtimeSettingMapper; |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/getList") |
| | | public AjaxResult getList(@RequestParam(defaultValue = "1") long current, |
| | | public R<?> getList(@RequestParam(defaultValue = "1") long current, |
| | | @RequestParam(defaultValue = "50") long size, HolidaySettings holidaySettings) { |
| | | Page page = new Page(current, size); |
| | | return AjaxResult.success(holidaySettingsService.listpage(page,holidaySettings)); |
| | | return R.ok(holidaySettingsService.listpage(page,holidaySettings)); |
| | | } |
| | | /**ã |
| | | * 墿·» |
| | | * @return |
| | | */ |
| | | @PostMapping("/add") |
| | | public AjaxResult add(@RequestBody HolidaySettings holidaySettings){ |
| | | return AjaxResult.success(holidaySettingsService.save(holidaySettings)); |
| | | public R<?> add(@RequestBody HolidaySettings holidaySettings){ |
| | | return R.ok(holidaySettingsService.save(holidaySettings)); |
| | | } |
| | | /** |
| | | * æ´æ° |
| | | * @return |
| | | */ |
| | | @PostMapping("/update") |
| | | public AjaxResult update(@RequestBody HolidaySettings holidaySettings){ |
| | | return AjaxResult.success(holidaySettingsService.updateById(holidaySettings)); |
| | | public R<?> update(@RequestBody HolidaySettings holidaySettings){ |
| | | return R.ok(holidaySettingsService.updateById(holidaySettings)); |
| | | } |
| | | /** |
| | | * å é¤ |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/delete") |
| | | public AjaxResult delete(@RequestBody List<Long> ids){ |
| | | if(CollectionUtils.isEmpty(ids)) return AjaxResult.error("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | return AjaxResult.success(holidaySettingsService.removeByIds(ids)); |
| | | public R<?> delete(@RequestBody List<Long> ids){ |
| | | if(CollectionUtils.isEmpty(ids)) return R.fail("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | return R.ok(holidaySettingsService.removeByIds(ids)); |
| | | } |
| | | /**ã |
| | | * è·åå¹´åè§åå表 |
| | | * @return |
| | | */ |
| | | @GetMapping("/getAnnualLeaveSettingList") |
| | | public AjaxResult getAnnualLeaveSettingList(@RequestParam(defaultValue = "1") long current, |
| | | public R<?> getAnnualLeaveSettingList(@RequestParam(defaultValue = "1") long current, |
| | | @RequestParam(defaultValue = "50") long size, AnnualLeaveSetting annualLeaveSetting) { |
| | | Page page = new Page(current, size); |
| | | return AjaxResult.success(annualLeaveSettingMapper.listPage(page,annualLeaveSetting)); |
| | | return R.ok(annualLeaveSettingMapper.listPage(page,annualLeaveSetting)); |
| | | } |
| | | /**ã |
| | | * 墿·»å¹´åè§å |
| | | * @return |
| | | */ |
| | | @PostMapping("/addAnnualLeaveSetting") |
| | | public AjaxResult addAnnualLeaveSetting(@RequestBody AnnualLeaveSetting annualLeaveSetting){ |
| | | return AjaxResult.success(annualLeaveSettingMapper.insert(annualLeaveSetting)); |
| | | public R<?> addAnnualLeaveSetting(@RequestBody AnnualLeaveSetting annualLeaveSetting){ |
| | | return R.ok(annualLeaveSettingMapper.insert(annualLeaveSetting)); |
| | | } |
| | | /**ã |
| | | * æ´æ°å¹´åè§å |
| | | * @return |
| | | */ |
| | | @PostMapping("/updateAnnualLeaveSetting") |
| | | public AjaxResult updateAnnualLeaveSetting(@RequestBody AnnualLeaveSetting annualLeaveSetting){ |
| | | return AjaxResult.success(annualLeaveSettingMapper.updateById(annualLeaveSetting)); |
| | | public R<?> updateAnnualLeaveSetting(@RequestBody AnnualLeaveSetting annualLeaveSetting){ |
| | | return R.ok(annualLeaveSettingMapper.updateById(annualLeaveSetting)); |
| | | } |
| | | /**ã |
| | | * å é¤å¹´åè§å |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/deleteAnnualLeaveSetting") |
| | | public AjaxResult deleteAnnualLeaveSetting(@RequestBody List<Long> ids){ |
| | | if(CollectionUtils.isEmpty(ids)) return AjaxResult.error("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | return AjaxResult.success(annualLeaveSettingMapper.deleteBatchIds(ids)); |
| | | public R<?> deleteAnnualLeaveSetting(@RequestBody List<Long> ids){ |
| | | if(CollectionUtils.isEmpty(ids)) return R.fail("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | return R.ok(annualLeaveSettingMapper.deleteBatchIds(ids)); |
| | | } |
| | | |
| | | /**ã |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/getOvertimeSettingList") |
| | | public AjaxResult getOvertimeSettingList(@RequestParam(defaultValue = "1") long current, |
| | | public R<?> getOvertimeSettingList(@RequestParam(defaultValue = "1") long current, |
| | | @RequestParam(defaultValue = "50") long size, OvertimeSetting overtimeSetting) { |
| | | Page page = new Page(current, size); |
| | | return AjaxResult.success(overtimeSettingMapper.listPage(page,overtimeSetting)); |
| | | return R.ok(overtimeSettingMapper.listPage(page,overtimeSetting)); |
| | | } |
| | | /**ã |
| | | * 墿·»å çè§å |
| | | * @return |
| | | */ |
| | | @PostMapping("/addOvertimeSetting") |
| | | public AjaxResult addOvertimeSetting(@RequestBody OvertimeSetting overtimeSetting){ |
| | | return AjaxResult.success(overtimeSettingMapper.insert(overtimeSetting)); |
| | | public R<?> addOvertimeSetting(@RequestBody OvertimeSetting overtimeSetting){ |
| | | return R.ok(overtimeSettingMapper.insert(overtimeSetting)); |
| | | } |
| | | /**ã |
| | | * æ´æ°å çè§å |
| | | * @return |
| | | */ |
| | | @PostMapping("/updateOvertimeSetting") |
| | | public AjaxResult updateOvertimeSetting(@RequestBody OvertimeSetting overtimeSetting){ |
| | | return AjaxResult.success(overtimeSettingMapper.updateById(overtimeSetting)); |
| | | public R<?> updateOvertimeSetting(@RequestBody OvertimeSetting overtimeSetting){ |
| | | return R.ok(overtimeSettingMapper.updateById(overtimeSetting)); |
| | | } |
| | | /**ã |
| | | * å é¤å çè§å |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/deleteOvertimeSetting") |
| | | public AjaxResult deleteOvertimeSetting(@RequestBody List<Long> ids){ |
| | | if(CollectionUtils.isEmpty(ids)) return AjaxResult.error("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | return AjaxResult.success(overtimeSettingMapper.deleteBatchIds(ids)); |
| | | public R<?> deleteOvertimeSetting(@RequestBody List<Long> ids){ |
| | | if(CollectionUtils.isEmpty(ids)) return R.fail("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | return R.ok(overtimeSettingMapper.deleteBatchIds(ids)); |
| | | } |
| | | /**ã |
| | | * è·åä¸çæ¶é´è®¾ç½®-çå¶è§åå表 |
| | | * @return |
| | | */ |
| | | @GetMapping("/getWorkingHoursSettingList") |
| | | public AjaxResult getWorkingHoursSettingList(@RequestParam(defaultValue = "1") long current, |
| | | public R<?> getWorkingHoursSettingList(@RequestParam(defaultValue = "1") long current, |
| | | @RequestParam(defaultValue = "50") long size, WorkingHoursSetting workingHoursSetting) { |
| | | Page page = new Page(current, size); |
| | | return AjaxResult.success(workingHoursSettingMapper.listPage(page,workingHoursSetting)); |
| | | return R.ok(workingHoursSettingMapper.listPage(page,workingHoursSetting)); |
| | | } |
| | | /**ã |
| | | * 墿·»çå¶è§å |
| | | * @return |
| | | */ |
| | | @PostMapping("/addWorkingHoursSetting") |
| | | public AjaxResult addWorkingHoursSetting(@RequestBody WorkingHoursSetting workingHoursSetting){ |
| | | return AjaxResult.success(workingHoursSettingMapper.insert(workingHoursSetting)); |
| | | public R<?> addWorkingHoursSetting(@RequestBody WorkingHoursSetting workingHoursSetting){ |
| | | return R.ok(workingHoursSettingMapper.insert(workingHoursSetting)); |
| | | } |
| | | /**ã |
| | | * æ´æ°çå¶è§å |
| | | * @return |
| | | */ |
| | | @PostMapping("/updateWorkingHoursSetting") |
| | | public AjaxResult updateWorkingHoursSetting(@RequestBody WorkingHoursSetting workingHoursSetting){ |
| | | return AjaxResult.success(workingHoursSettingMapper.updateById(workingHoursSetting)); |
| | | public R<?> updateWorkingHoursSetting(@RequestBody WorkingHoursSetting workingHoursSetting){ |
| | | return R.ok(workingHoursSettingMapper.updateById(workingHoursSetting)); |
| | | } |
| | | /**ã |
| | | * å é¤çå¶è§å |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/deleteWorkingHoursSetting") |
| | | public AjaxResult deleteWorkingHoursSetting(@RequestBody List<Long> ids){ |
| | | if(CollectionUtils.isEmpty(ids)) return AjaxResult.error("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | return AjaxResult.success(workingHoursSettingMapper.deleteBatchIds(ids)); |
| | | public R<?> deleteWorkingHoursSetting(@RequestBody List<Long> ids){ |
| | | if(CollectionUtils.isEmpty(ids)) return R.fail("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | return R.ok(workingHoursSettingMapper.deleteBatchIds(ids)); |
| | | } |
| | | |
| | | |
| | |
| | | import com.ruoyi.approve.pojo.KnowledgeBase; |
| | | import com.ruoyi.approve.service.KnowledgeBaseService; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | |
| | | @RequestMapping("/knowledgeBase") |
| | | @AllArgsConstructor |
| | | @Tag(name = "ç¥è¯åºç®¡ç") |
| | | public class KnowledgeBaseController { |
| | | public class KnowledgeBaseController extends BaseController { |
| | | private KnowledgeBaseService knowledgeBaseService; |
| | | |
| | | /**ã |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/getList") |
| | | public AjaxResult getList(@RequestParam(defaultValue = "1") long current, |
| | | public R<?> getList(@RequestParam(defaultValue = "1") long current, |
| | | @RequestParam(defaultValue = "10") long size, KnowledgeBase knowledgeBase) { |
| | | Page page = new Page(current, size); |
| | | return AjaxResult.success(knowledgeBaseService.listpage(page,knowledgeBase)); |
| | | return R.ok(knowledgeBaseService.listpage(page,knowledgeBase)); |
| | | } |
| | | /**ã |
| | | * 墿·» |
| | | * @return |
| | | */ |
| | | @PostMapping("/add") |
| | | public AjaxResult add(@RequestBody KnowledgeBase knowledgeBase){ |
| | | return AjaxResult.success(knowledgeBaseService.save(knowledgeBase)); |
| | | public R<?> add(@RequestBody KnowledgeBase knowledgeBase){ |
| | | return R.ok(knowledgeBaseService.save(knowledgeBase)); |
| | | } |
| | | /** |
| | | * æ´æ° |
| | | * @return |
| | | */ |
| | | @PostMapping("/update") |
| | | public AjaxResult update(@RequestBody KnowledgeBase knowledgeBase){ |
| | | return AjaxResult.success(knowledgeBaseService.updateById(knowledgeBase)); |
| | | public R<?> update(@RequestBody KnowledgeBase knowledgeBase){ |
| | | return R.ok(knowledgeBaseService.updateById(knowledgeBase)); |
| | | } |
| | | /** |
| | | * å é¤ |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/delete") |
| | | public AjaxResult delete(@RequestBody List<Long> ids){ |
| | | if(CollectionUtils.isEmpty(ids)) return AjaxResult.error("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | return AjaxResult.success(knowledgeBaseService.removeByIds(ids)); |
| | | public R<?> delete(@RequestBody List<Long> ids){ |
| | | if(CollectionUtils.isEmpty(ids)) return R.fail("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | return R.ok(knowledgeBaseService.removeByIds(ids)); |
| | | } |
| | | |
| | | @Operation(summary = "ç¥è¯åºç®¡ç导åº") |
| | |
| | | import com.ruoyi.approve.pojo.NotificationManagement; |
| | | import com.ruoyi.approve.pojo.OnlineMeeting; |
| | | import com.ruoyi.approve.service.NotificationManagementService; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | @RestController |
| | | @RequestMapping("/notificationManagement") |
| | | @AllArgsConstructor |
| | | public class NotificationManagementController { |
| | | public class NotificationManagementController extends BaseController { |
| | | private NotificationManagementService notificationManagementService ; |
| | | private OnlineMeetingMapper onlineMeetingMapper; |
| | | private FileSharingMapper fileSharingMapper; |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/getList") |
| | | public AjaxResult getList(@RequestParam(defaultValue = "1") long current, |
| | | public R<?> getList(@RequestParam(defaultValue = "1") long current, |
| | | @RequestParam(defaultValue = "50") long size, NotificationManagement notificationManagement) { |
| | | Page page = new Page(current, size); |
| | | return AjaxResult.success(notificationManagementService.listpage(page,notificationManagement)); |
| | | return R.ok(notificationManagementService.listpage(page,notificationManagement)); |
| | | } |
| | | /**ã |
| | | * 墿·» |
| | | * @return |
| | | */ |
| | | @PostMapping("/add") |
| | | public AjaxResult add(@RequestBody NotificationManagement notificationManagement){ |
| | | return AjaxResult.success(notificationManagementService.save(notificationManagement)); |
| | | public R<?> add(@RequestBody NotificationManagement notificationManagement){ |
| | | return R.ok(notificationManagementService.save(notificationManagement)); |
| | | } |
| | | /** |
| | | * æ´æ° |
| | | * @return |
| | | */ |
| | | @PostMapping("/update") |
| | | public AjaxResult update(@RequestBody NotificationManagement notificationManagement){ |
| | | return AjaxResult.success(notificationManagementService.updateById(notificationManagement)); |
| | | public R<?> update(@RequestBody NotificationManagement notificationManagement){ |
| | | return R.ok(notificationManagementService.updateById(notificationManagement)); |
| | | } |
| | | /** |
| | | * å é¤ |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/delete") |
| | | public AjaxResult delete(@RequestBody List<Long> ids){ |
| | | if(CollectionUtils.isEmpty(ids)) return AjaxResult.error("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | return AjaxResult.success(notificationManagementService.removeByIds(ids)); |
| | | public R<?> delete(@RequestBody List<Long> ids){ |
| | | if(CollectionUtils.isEmpty(ids)) return R.fail("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | return R.ok(notificationManagementService.removeByIds(ids)); |
| | | } |
| | | /** |
| | | *æ°å¢ä¼è®® |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping("/addOnlineMeeting") |
| | | public AjaxResult addOnlineMeeting(@RequestBody OnlineMeeting onlineMeeting){ |
| | | return AjaxResult.success(onlineMeetingMapper.insert(onlineMeeting)); |
| | | public R<?> addOnlineMeeting(@RequestBody OnlineMeeting onlineMeeting){ |
| | | return R.ok(onlineMeetingMapper.insert(onlineMeeting)); |
| | | } |
| | | /** |
| | | *æ°å¢æä»¶å
񄧮 |
| | | * |
| | | */ |
| | | @PostMapping("/addFileSharing") |
| | | public AjaxResult addFileSharing(@RequestBody FileSharing fileSharing){ |
| | | return AjaxResult.success(fileSharingMapper.insert(fileSharing)); |
| | | public R<?> addFileSharing(@RequestBody FileSharing fileSharing){ |
| | | return R.ok(fileSharingMapper.insert(fileSharing)); |
| | | } |
| | | } |
| | | |
| | |
| | | import com.ruoyi.approve.pojo.RpaProcessAutomation; |
| | | import com.ruoyi.approve.service.RpaProcessAutomationService; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | |
| | | @RequestMapping("/rpaProcessAutomation") |
| | | @AllArgsConstructor |
| | | @Tag(name = "RPAæµç¨èªå¨å") |
| | | public class RpaProcessAutomationController { |
| | | public class RpaProcessAutomationController extends BaseController { |
| | | private RpaProcessAutomationService rpaProcessAutomationService; |
| | | /**ã |
| | | * è·åå表 |
| | | * @return |
| | | */ |
| | | @GetMapping("/getList") |
| | | public AjaxResult getList(@RequestParam(defaultValue = "1") long current, |
| | | public R<?> getList(@RequestParam(defaultValue = "1") long current, |
| | | @RequestParam(defaultValue = "100") long size, RpaProcessAutomation rpaProcessAutomation) { |
| | | Page page = new Page(current, size); |
| | | return AjaxResult.success(rpaProcessAutomationService.listpage(page,rpaProcessAutomation)); |
| | | return R.ok(rpaProcessAutomationService.listpage(page,rpaProcessAutomation)); |
| | | } |
| | | /**ã |
| | | * 墿·» |
| | | * @return |
| | | */ |
| | | @PostMapping("/add") |
| | | public AjaxResult add(@RequestBody RpaProcessAutomation rpaProcessAutomation){ |
| | | return AjaxResult.success(rpaProcessAutomationService.save(rpaProcessAutomation)); |
| | | public R<?> add(@RequestBody RpaProcessAutomation rpaProcessAutomation){ |
| | | return R.ok(rpaProcessAutomationService.save(rpaProcessAutomation)); |
| | | } |
| | | /** |
| | | * æ´æ° |
| | | * @return |
| | | */ |
| | | @PostMapping("/update") |
| | | public AjaxResult update(@RequestBody RpaProcessAutomation rpaProcessAutomation){ |
| | | return AjaxResult.success(rpaProcessAutomationService.updateById(rpaProcessAutomation)); |
| | | public R<?> update(@RequestBody RpaProcessAutomation rpaProcessAutomation){ |
| | | return R.ok(rpaProcessAutomationService.updateById(rpaProcessAutomation)); |
| | | } |
| | | /** |
| | | * å é¤ |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/delete") |
| | | public AjaxResult delete(@RequestBody List<Long> ids){ |
| | | if(CollectionUtils.isEmpty(ids)) return AjaxResult.error("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | return AjaxResult.success(rpaProcessAutomationService.removeByIds(ids)); |
| | | public R<?> delete(@RequestBody List<Long> ids){ |
| | | if(CollectionUtils.isEmpty(ids)) return R.fail("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | return R.ok(rpaProcessAutomationService.removeByIds(ids)); |
| | | } |
| | | |
| | | @Operation(summary = "RPAæµç¨èªå¨å导åº") |
| | |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | */ |
| | | @Operation(summary = "è·å客æ·è·è¿è¯¦ç»ä¿¡æ¯") |
| | | @GetMapping(value = "/{id}") |
| | | public AjaxResult getInfo(@PathVariable("id") Integer id) { |
| | | return AjaxResult.success(customerFollowUpService.getFollowUpWithFiles(id)); |
| | | public R getInfo(@PathVariable("id") Integer id) { |
| | | return R.ok(customerFollowUpService.getFollowUpWithFiles(id)); |
| | | } |
| | | |
| | | /** |
| | |
| | | @PostMapping("/add") |
| | | @Operation(summary = "æ°å¢å®¢æ·è·è¿") |
| | | @Log(title = "客æ·è·è¿-æ°å¢", businessType = BusinessType.INSERT) |
| | | public AjaxResult add(@RequestBody CustomerFollowUp customerFollowUp) { |
| | | return toAjax(customerFollowUpService.insertCustomerFollowUp(customerFollowUp)); |
| | | public R<?> add(@RequestBody CustomerFollowUp customerFollowUp) { |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | |
| | | @PutMapping("/edit") |
| | | @Operation(summary = "ä¿®æ¹å®¢æ·è·è¿") |
| | | @Log(title = "客æ·è·è¿-ä¿®æ¹", businessType = BusinessType.UPDATE) |
| | | public AjaxResult edit(@RequestBody CustomerFollowUp customerFollowUp) { |
| | | return toAjax(customerFollowUpService.updateCustomerFollowUp(customerFollowUp)); |
| | | public R<?> edit(@RequestBody CustomerFollowUp customerFollowUp) { |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | |
| | | @Operation(summary = "ä¸ä¼ è·è¿éä»¶") |
| | | @PostMapping("/upload/{followUpId}") |
| | | @Log(title = "客æ·è·è¿-ä¸ä¼ éä»¶", businessType = BusinessType.INSERT) |
| | | public AjaxResult uploadFiles(@RequestParam("files") List<MultipartFile> files, @PathVariable Integer followUpId) { |
| | | return AjaxResult.success(customerFollowUpService.addFollowUpFiles(files, followUpId)); |
| | | public R uploadFiles(@RequestParam("files") List<MultipartFile> files, @PathVariable Integer followUpId) { |
| | | return R.ok(customerFollowUpService.addFollowUpFiles(files, followUpId)); |
| | | } |
| | | |
| | | /** |
| | |
| | | @Operation(summary = "ä¸ä¼ éä»¶(å¤ç¨)") |
| | | @PostMapping("/upload") |
| | | @Log(title = "ä¸ä¼ éä»¶(å¤ç¨)", businessType = BusinessType.INSERT) |
| | | public AjaxResult uploadFiles(@RequestParam("files") List<MultipartFile> files, @RequestParam(required = false) String name) { |
| | | public R uploadFiles(@RequestParam("files") List<MultipartFile> files, @RequestParam(required = false) String name) { |
| | | List<CustomerFollowUpFileDto> uploadedFiles = customerFollowUpService.addFollowUpFiles(files, null); |
| | | return AjaxResult.success(uploadedFiles); |
| | | return R.ok(uploadedFiles); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Operation(summary = "æ¹éæ¥è¯¢éä»¶å表") |
| | | @PostMapping("/file/list") |
| | | public AjaxResult getFileList(@RequestBody List<Long> ids) { |
| | | return AjaxResult.success(customerFollowUpService.getFollowUpFilesByIds(ids)); |
| | | public R getFileList(@RequestBody List<Long> ids) { |
| | | return R.ok(customerFollowUpService.getFollowUpFilesByIds(ids)); |
| | | } |
| | | |
| | | /** |
| | |
| | | @Operation(summary = "å é¤è·è¿éä»¶") |
| | | @DeleteMapping("/file/{fileId}") |
| | | @Log(title = "客æ·è·è¿-å é¤éä»¶", businessType = BusinessType.DELETE) |
| | | public AjaxResult deleteFile(@PathVariable Integer fileId) { |
| | | public R deleteFile(@PathVariable Integer fileId) { |
| | | customerFollowUpService.deleteFollowUpFile(fileId); |
| | | return AjaxResult.success(); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | |
| | | @Operation(summary = "å é¤å®¢æ·è·è¿") |
| | | @DeleteMapping("/{id}") |
| | | @Log(title = "客æ·è·è¿-å é¤", businessType = BusinessType.DELETE) |
| | | public AjaxResult remove(@PathVariable Integer id) { |
| | | return toAjax(customerFollowUpService.deleteCustomerFollowUpById(id)); |
| | | public R remove(@PathVariable Integer id) { |
| | | return R.ok(customerFollowUpService.deleteCustomerFollowUpById(id)); |
| | | } |
| | | |
| | | /** |
| | |
| | | @Operation(summary = "æ°å¢/æ´æ°å访æé") |
| | | @PostMapping("/return-visit") |
| | | @Log(title = "å访æé-æ°å¢/æ´æ°", businessType = BusinessType.UPDATE) |
| | | public AjaxResult saveReturnVisit(@RequestBody CustomerReturnVisit customerReturnVisit) { |
| | | return toAjax(customerReturnVisitService.saveOrUpdateReturnVisit(customerReturnVisit)); |
| | | public R saveReturnVisit(@RequestBody CustomerReturnVisit customerReturnVisit) { |
| | | return R.ok(customerReturnVisitService.saveOrUpdateReturnVisit(customerReturnVisit)); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Operation(summary = "è·åå访æé详æ
") |
| | | @GetMapping("/return-visit/{customerId}") |
| | | public AjaxResult getReturnVisit(@PathVariable Integer customerId) { |
| | | return AjaxResult.success(customerReturnVisitService.getByCustomerId(customerId)); |
| | | public R getReturnVisit(@PathVariable Integer customerId) { |
| | | return R.ok(customerReturnVisitService.getByCustomerId(customerId)); |
| | | } |
| | | |
| | | /** |
| | |
| | | @Operation(summary = "æ è®°å访æé已读") |
| | | @PutMapping("/return-visit/read/{id}") |
| | | @Log(title = "å访æé-æ 记已读", businessType = BusinessType.UPDATE) |
| | | public AjaxResult markAsRead(@PathVariable Long id) { |
| | | public R markAsRead(@PathVariable Long id) { |
| | | customerReturnVisitService.markAsRead(id); |
| | | return AjaxResult.success(); |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.sales.pojo.SalesLedgerProduct; |
| | | import com.ruoyi.sales.service.ISalesLedgerProductService; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | |
| | | */ |
| | | @Log(title = "产å", businessType = BusinessType.INSERT) |
| | | @PostMapping("/addOrEditProduct") |
| | | public AjaxResult addOrEditProduct(@RequestBody ProductDto productDto) { |
| | | return toAjax(productService.addOrEditProduct(productDto)); |
| | | public R<?> addOrEditProduct(@RequestBody ProductDto productDto) { |
| | | productService.addOrEditProduct(productDto); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Log(title = "产åè§æ ¼åå·", businessType = BusinessType.INSERT) |
| | | @PostMapping("/addOrEditProductModel") |
| | | public AjaxResult addOrEditProductModel(@RequestBody ProductModelDto productModelDto) { |
| | | return toAjax(productModelService.addOrEditProductModel(productModelDto)); |
| | | public R<?> addOrEditProductModel(@RequestBody ProductModelDto productModelDto) { |
| | | productModelService.addOrEditProductModel(productModelDto); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Log(title = "产å", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/delProduct") |
| | | public AjaxResult remove(@RequestBody Long[] ids) { |
| | | public R<?> remove(@RequestBody Long[] ids) { |
| | | if (ids == null || ids.length == 0) { |
| | | return AjaxResult.error("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | return R.fail("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | } |
| | | // æ£æ¥æ¯å¦æéå®ååè®°å½å
³è该产å |
| | | LambdaQueryWrapper<SalesLedgerProduct> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.in(SalesLedgerProduct::getProductId, ids); |
| | | List<SalesLedgerProduct> salesLedgerProductList = salesLedgerProductService.list(queryWrapper); |
| | | if (salesLedgerProductList.size() > 0) { |
| | | return AjaxResult.error("该产ååå¨éå®/éè´è®°å½ï¼ä¸è½å é¤"); |
| | | return R.fail("该产ååå¨éå®/éè´è®°å½ï¼ä¸è½å é¤"); |
| | | } |
| | | return toAjax(productService.delProductByIds(ids)); |
| | | productService.delProductByIds(ids); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Log(title = "产åè§æ ¼åå·", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/delProductModel") |
| | | public AjaxResult delProductModel(@RequestBody Long[] ids) { |
| | | public R<?> delProductModel(@RequestBody Long[] ids) { |
| | | if (ids == null || ids.length == 0) { |
| | | return AjaxResult.error("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | return R.fail("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | } |
| | | // æ£æ¥æ¯å¦æéå®ååè®°å½å
³è该产åè§æ ¼åå· |
| | | LambdaQueryWrapper<SalesLedgerProduct> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.in(SalesLedgerProduct::getProductModelId, ids); |
| | | List<SalesLedgerProduct> salesLedgerProductList = salesLedgerProductService.list(queryWrapper); |
| | | if (salesLedgerProductList.size() > 0) { |
| | | return AjaxResult.error("该产åè§æ ¼åå·åå¨éå®/éè´è®°å½ï¼ä¸è½å é¤"); |
| | | return R.fail("该产åè§æ ¼åå·åå¨éå®/éè´è®°å½ï¼ä¸è½å é¤"); |
| | | } |
| | | return toAjax(productModelService.delProductModel(ids)); |
| | | productModelService.delProductModel(ids); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @PostMapping("/import") |
| | | @Log(title = "导å
¥äº§å", businessType = BusinessType.IMPORT) |
| | | public AjaxResult importProductModel(@RequestParam("file") MultipartFile file, Integer productId) { |
| | | public R<?> importProductModel(@RequestParam("file") MultipartFile file, Integer productId) { |
| | | return productModelService.importProductModel(file, productId); |
| | | } |
| | | |
| | |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.util.CollectionUtils; |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping("/add") |
| | | public AjaxResult add(@RequestBody SupplierManage supplierManage) { |
| | | public R add(@RequestBody SupplierManage supplierManage) { |
| | | supplierService.saveSupplier(supplierManage); |
| | | return AjaxResult.success(); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/del") |
| | | public AjaxResult delSupplier(@RequestBody List<Integer> ids) { |
| | | public R delSupplier(@RequestBody List<Integer> ids) { |
| | | if(CollectionUtils.isEmpty(ids)){ |
| | | return AjaxResult.error("è¯·éæ©è³å°ä¸æ¡æ°æ®"); |
| | | return R.fail("è¯·éæ©è³å°ä¸æ¡æ°æ®"); |
| | | } |
| | | supplierService.delSupplier(ids); |
| | | return AjaxResult.success(); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/{id}") |
| | | public AjaxResult supplierDetail(@PathVariable("id") Integer id) { |
| | | return AjaxResult.success(supplierService.supplierDetail(id)); |
| | | public R supplierDetail(@PathVariable("id") Integer id) { |
| | | return R.ok(supplierService.supplierDetail(id)); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping("/update") |
| | | public AjaxResult update(@RequestBody SupplierManage supplierManage) { |
| | | public R update(@RequestBody SupplierManage supplierManage) { |
| | | supplierService.supplierUpdate(supplierManage); |
| | | return AjaxResult.success(); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/listPage") |
| | | public AjaxResult supplierListPage(Page page, SupplierManageDto supplierManageDto) { |
| | | return AjaxResult.success(supplierService.supplierListPage(page, supplierManageDto)); |
| | | public R supplierListPage(Page page, SupplierManageDto supplierManageDto) { |
| | | return R.ok(supplierService.supplierListPage(page, supplierManageDto)); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @PostMapping("/import") |
| | | @Log(title = "ä¾åºå导å
¥", businessType = BusinessType.IMPORT) |
| | | public AjaxResult importData(MultipartFile file) { |
| | | Boolean b = supplierService.importData(file); |
| | | if (b) { |
| | | return AjaxResult.success("导å
¥æå"); |
| | | } |
| | | return AjaxResult.error("导å
¥å¤±è´¥"); |
| | | public R importData(MultipartFile file) throws Exception { |
| | | return supplierService.importData(file); |
| | | } |
| | | |
| | | |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/getOptions") |
| | | public AjaxResult getOptions() { |
| | | return AjaxResult.success(supplierService.list()); |
| | | public R getOptions() { |
| | | return R.ok(supplierService.list()); |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.basic.pojo.SupplierManageFile; |
| | | import com.ruoyi.basic.service.SupplierManageFileService; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/basic/supplierManageFile") |
| | | public class SupplierManageFileController { |
| | | public class SupplierManageFileController extends BaseController { |
| | | |
| | | |
| | | @Resource |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping("/add") |
| | | public AjaxResult add(@RequestBody SupplierManageFile supplierManageFile) { |
| | | return AjaxResult.success(supplierManageFileService.save(supplierManageFile)); |
| | | public R<?> add(@RequestBody SupplierManageFile supplierManageFile) { |
| | | return R.ok(supplierManageFileService.save(supplierManageFile)); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/del") |
| | | public AjaxResult delSupplierManageFile(@RequestBody List<Integer> ids) { |
| | | public R<?> delSupplierManageFile(@RequestBody List<Integer> ids) { |
| | | if(CollectionUtils.isEmpty(ids)){ |
| | | return AjaxResult.error("è¯·éæ©è³å°ä¸æ¡æ°æ®"); |
| | | return R.fail("è¯·éæ©è³å°ä¸æ¡æ°æ®"); |
| | | } |
| | | //å 餿£éªéä»¶ |
| | | return AjaxResult.success(supplierManageFileService.removeBatchByIds(ids)); |
| | | return R.ok(supplierManageFileService.removeBatchByIds(ids)); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/listPage") |
| | | public AjaxResult supplierManageFileListPage(Page page, SupplierManageFile supplierManageFile) { |
| | | return AjaxResult.success(supplierManageFileService.supplierManageFileListPage(page, supplierManageFile)); |
| | | public R<?> supplierManageFileListPage(Page page, SupplierManageFile supplierManageFile) { |
| | | return R.ok(supplierManageFileService.supplierManageFileListPage(page, supplierManageFile)); |
| | | } |
| | | |
| | | |
| | |
| | | @Excel(name = "ä¾åºååç§°") |
| | | private String supplierName; |
| | | |
| | | @Excel(name = "ä¾åºåç±»å") |
| | | private String supplierType; |
| | | |
| | | @Excel(name = "纳ç¨äººè¯å«å·") |
| | | private String taxpayerIdentificationNum; |
| | | |
| | |
| | | @Excel(name = "ä¾åºååç§°") |
| | | private String supplierName; |
| | | |
| | | @Schema(description = "ä¾åºåç±»å") |
| | | @TableField(value = "supplier_type") |
| | | @Excel(name = "ä¾åºåç±»å") |
| | | private String supplierType; |
| | | |
| | | @Schema(description = "纳ç¨äººè¯å«å·") |
| | | @Excel(name = "纳ç¨äººè¯å«å·") |
| | | private String taxpayerIdentificationNum; |
| | |
| | | @Schema(description = "ç§æ·ID") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | |
| | | @Schema(description = "ä¾åºåç±»å") |
| | | @TableField(value = "supplier_type") |
| | | private String supplierType; |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long deptId; |
| | |
| | | import com.ruoyi.basic.dto.ProductDto; |
| | | import com.ruoyi.basic.dto.ProductModelDto; |
| | | import com.ruoyi.basic.pojo.ProductModel; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.util.List; |
| | |
| | | */ |
| | | IPage<ProductModel> modelListPage(Page page , ProductDto productDto); |
| | | |
| | | AjaxResult importProductModel(MultipartFile file, Integer productId); |
| | | R<?> importProductModel(MultipartFile file, Integer productId); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.basic.dto.SupplierManageDto; |
| | | import com.ruoyi.basic.pojo.SupplierManage; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | |
| | | */ |
| | | void supplierExport(HttpServletResponse response, SupplierManageDto supplierManageDto); |
| | | |
| | | Boolean importData(MultipartFile file); |
| | | R importData(MultipartFile file); |
| | | } |
| | |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.bean.BeanUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.sales.dto.LossProductModelDto; |
| | | import com.ruoyi.sales.mapper.SalesLedgerProductMapper; |
| | | import com.ruoyi.sales.pojo.SalesLedgerProduct; |
| | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult importProductModel(MultipartFile file, Integer productId) { |
| | | public R<?> importProductModel(MultipartFile file, Integer productId) { |
| | | if (productId == null) { |
| | | return AjaxResult.error("请å
éæ©äº§åå导å
¥è§æ ¼åå·"); |
| | | return R.fail("请å
éæ©äº§åå导å
¥è§æ ¼åå·"); |
| | | } |
| | | |
| | | Product product = productMapper.selectById(productId); |
| | | if (product == null) { |
| | | return AjaxResult.error("éæ©ç产åä¸åå¨"); |
| | | return R.fail("éæ©ç产åä¸åå¨"); |
| | | } |
| | | |
| | | try { |
| | |
| | | List<ProductModel> productModelList = productModelExcelUtil.importExcel(file.getInputStream()); |
| | | |
| | | if (CollectionUtils.isEmpty(productModelList)) { |
| | | return AjaxResult.error("导å
¥æ°æ®ä¸è½ä¸ºç©º"); |
| | | return R.fail("导å
¥æ°æ®ä¸è½ä¸ºç©º"); |
| | | } |
| | | |
| | | // è·åå½å产å䏿æçè§æ ¼åå·å |
| | |
| | | int rowNum = i + 2; |
| | | |
| | | if (StringUtils.isEmpty(item.getProductCode())) { |
| | | return AjaxResult.error("第 " + rowNum + " è¡å¯¼å
¥å¤±è´¥: [产åç¼ç ] ä¸è½ä¸ºç©º"); |
| | | return R.fail("第 " + rowNum + " è¡å¯¼å
¥å¤±è´¥: [产åç¼ç ] ä¸è½ä¸ºç©º"); |
| | | } |
| | | if (StringUtils.isEmpty(item.getModel())) { |
| | | return AjaxResult.error("第 " + rowNum + " è¡å¯¼å
¥å¤±è´¥: [è§æ ¼åå·] ä¸è½ä¸ºç©º"); |
| | | return R.fail("第 " + rowNum + " è¡å¯¼å
¥å¤±è´¥: [è§æ ¼åå·] ä¸è½ä¸ºç©º"); |
| | | } |
| | | if (StringUtils.isEmpty(item.getUnit())) { |
| | | return AjaxResult.error("第 " + rowNum + " è¡å¯¼å
¥å¤±è´¥: [åä½] ä¸è½ä¸ºç©º"); |
| | | return R.fail("第 " + rowNum + " è¡å¯¼å
¥å¤±è´¥: [åä½] ä¸è½ä¸ºç©º"); |
| | | } |
| | | |
| | | // å»é,妿已å
å«è¯¥åå·,åè·³è¿ |
| | |
| | | } |
| | | |
| | | if (skipCount == 0) { |
| | | return AjaxResult.success(String.format("æå导å
¥ %d æ¡æ°æ®", waitToSaveList.size())); |
| | | return R.ok(null, String.format("æå导å
¥ %d æ¡æ°æ®", waitToSaveList.size())); |
| | | } else { |
| | | return AjaxResult.success(String.format("æå导å
¥ %d æ¡ï¼è·³è¿å·²å卿°æ® %d æ¡", waitToSaveList.size(), skipCount)); |
| | | return R.ok(null, String.format("æå导å
¥ %d æ¡ï¼è·³è¿å·²å卿°æ® %d æ¡", waitToSaveList.size(), skipCount)); |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("导å
¥äº§åè§æ ¼å¼å¸¸", e); |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.basic.dto.SupplierManageDto; |
| | |
| | | import com.ruoyi.basic.service.ISupplierService; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.project.system.mapper.SysDictDataMapper; |
| | | import com.ruoyi.purchase.mapper.PurchaseLedgerMapper; |
| | | import com.ruoyi.purchase.pojo.PurchaseLedger; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | |
| | | |
| | | private final SupplierManageMapper supplierMapper; |
| | | private final PurchaseLedgerMapper purchaseLedgerMapper; |
| | | private final SysDictDataMapper sysDictDataMapper; |
| | | |
| | | /** |
| | | * ä¾åºåæ°å¢ |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Boolean importData(MultipartFile file) { |
| | | |
| | | public R importData(MultipartFile file) { |
| | | try { |
| | | ExcelUtil<SupplierManageExcelDto> util = new ExcelUtil<SupplierManageExcelDto>(SupplierManageExcelDto.class); |
| | | List<SupplierManageExcelDto> list = util.importExcel(file.getInputStream()); |
| | | |
| | | if (CollectionUtils.isEmpty(list)) { |
| | | return R.fail("模æ¿é误æå¯¼å
¥æ°æ®ä¸ºç©º"); |
| | | } |
| | | |
| | | ArrayList<SupplierManage> supplierManages = new ArrayList<>(); |
| | | list.stream().forEach(dto -> { |
| | | // ä¾åºåç±»åæ¯å¦åå¨ ï¼ç²ä¹ä¸ä¸ï¼ |
| | | String supplierType = dto.getSupplierType(); |
| | | if (!supplierType.equals("ç²") && !supplierType.equals("ä¹") && !supplierType.equals("ä¸") && !supplierType.equals("ä¸")) { |
| | | throw new RuntimeException("ä¾åºåç±»å " + supplierType + " ä¸åå¨ï¼"); |
| | | } |
| | | SupplierManage supplierManage = new SupplierManage(); |
| | | BeanUtils.copyProperties(dto,supplierManage); |
| | | supplierManage.setMaintainTime(LocalDate.now()); |
| | |
| | | }); |
| | | |
| | | this.saveOrUpdateBatch(supplierManages); |
| | | return true; |
| | | return R.ok("导å
¥æå"); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | return false; |
| | | } |
| | | } |
| | |
| | | import com.ruoyi.collaborativeApproval.pojo.RulesRegulationsManagement; |
| | | import com.ruoyi.collaborativeApproval.service.DutyPlanService; |
| | | import com.ruoyi.common.utils.excel.ExcelUtils; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | @RestController |
| | | @RequestMapping("/dutyPlan") |
| | | @AllArgsConstructor |
| | | public class DutyPlanController { |
| | | public class DutyPlanController extends BaseController { |
| | | private DutyPlanService dutyPlanService; |
| | | |
| | | @GetMapping("/getList") |
| | | @Operation(summary = "å页æ¥è¯¢") |
| | | public AjaxResult listPage(Page page, DutyPlanDTO dutyPlanDTO){ |
| | | return AjaxResult.success(dutyPlanService.listPage(page, dutyPlanDTO)); |
| | | public R<?> listPage(Page page, DutyPlanDTO dutyPlanDTO){ |
| | | return R.ok(dutyPlanService.listPage(page, dutyPlanDTO)); |
| | | } |
| | | @GetMapping("/getNum") |
| | | @Operation(summary = "è·åççº§æ°æ®") |
| | | public AjaxResult getNum(){ |
| | | return AjaxResult.success(dutyPlanService.getNum()); |
| | | public R<?> getNum(){ |
| | | return R.ok(dutyPlanService.getNum()); |
| | | } |
| | | |
| | | @PostMapping("/add") |
| | | @Operation(summary = "æ°å¢") |
| | | public AjaxResult add(@RequestBody DutyPlan dutyPlan){ |
| | | return AjaxResult.success(dutyPlanService.save(dutyPlan)); |
| | | public R<?> add(@RequestBody DutyPlan dutyPlan){ |
| | | return R.ok(dutyPlanService.save(dutyPlan)); |
| | | } |
| | | |
| | | @PostMapping("/update") |
| | | @Operation(summary = "ä¿®æ¹") |
| | | public AjaxResult update(@RequestBody DutyPlan dutyPlan){ |
| | | return AjaxResult.success(dutyPlanService.updateById(dutyPlan)); |
| | | public R<?> update(@RequestBody DutyPlan dutyPlan){ |
| | | return R.ok(dutyPlanService.updateById(dutyPlan)); |
| | | } |
| | | |
| | | @DeleteMapping("/delete") |
| | | @Operation(summary = "å é¤") |
| | | public AjaxResult delete(@RequestBody List<Long> ids){ |
| | | public R<?> delete(@RequestBody List<Long> ids){ |
| | | if (CollectionUtils.isEmpty(ids)) { |
| | | throw new RuntimeException("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | } |
| | | return AjaxResult.success(dutyPlanService.removeBatchByIds(ids)); |
| | | return R.ok(dutyPlanService.removeBatchByIds(ids)); |
| | | } |
| | | @PostMapping("/export") |
| | | @Operation(summary = "导åº") |
| | |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.project.system.service.ISysNoticeService; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | |
| | | @GetMapping("/page") |
| | | @Log(title = "å页æ¥è¯¢", businessType = BusinessType.OTHER) |
| | | @Operation(summary = "å页æ¥è¯¢") |
| | | public AjaxResult listPage(Page page, NoticeDTO noticeDTO){ |
| | | return AjaxResult.success(noticeService.listPage(page, noticeDTO)); |
| | | public R<?> listPage(Page page, NoticeDTO noticeDTO){ |
| | | return R.ok(noticeService.listPage(page, noticeDTO)); |
| | | } |
| | | |
| | | @PostMapping("/add") |
| | | @Log(title = "æ°å¢", businessType = BusinessType.INSERT) |
| | | @Operation(summary = "æ°å¢") |
| | | public AjaxResult add(@RequestBody NoticeDTO noticeDTO){ |
| | | public R<?> add(@RequestBody NoticeDTO noticeDTO){ |
| | | if (noticeDTO.getStatus()==1){ |
| | | //æ£å¼åå¸éç¥ææäººçæ¶æ¯éç¥ |
| | | sysNoticeService.simpleNoticeAll("éç¥å
Œ", |
| | | noticeDTO.getTitle(), |
| | | "/collaborativeApproval/noticeManagement?type="+noticeDTO.getType()); |
| | | } |
| | | return AjaxResult.success(noticeService.save(noticeDTO)); |
| | | return R.ok(noticeService.save(noticeDTO)); |
| | | } |
| | | |
| | | @PutMapping("/update") |
| | | @Log(title = "ä¿®æ¹", businessType = BusinessType.UPDATE) |
| | | @Operation(summary = "ä¿®æ¹") |
| | | public AjaxResult update(@RequestBody NoticeDTO noticeDTO){ |
| | | public R<?> update(@RequestBody NoticeDTO noticeDTO){ |
| | | if (ObjectUtils.isNotNull(noticeDTO.getStatus()) && noticeDTO.getStatus()==1){ |
| | | Notice notice = noticeService.getById(noticeDTO.getId()); |
| | | //æ£å¼åå¸éç¥ææäººçæ¶æ¯éç¥ |
| | |
| | | notice.getTitle(), |
| | | "/collaborativeApproval/noticeManagement?type="+notice.getType()); |
| | | } |
| | | return AjaxResult.success(noticeService.updateById(noticeDTO)); |
| | | return R.ok(noticeService.updateById(noticeDTO)); |
| | | } |
| | | |
| | | @DeleteMapping("/{ids}") |
| | | @Log(title = "å é¤", businessType = BusinessType.DELETE) |
| | | @Operation(summary = "å é¤") |
| | | public AjaxResult delete(@PathVariable("ids") List<Long> ids){ |
| | | public R<?> delete(@PathVariable("ids") List<Long> ids){ |
| | | if (CollectionUtils.isEmpty(ids)) { |
| | | throw new RuntimeException("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | } |
| | | return AjaxResult.success(noticeService.removeBatchByIds(ids)); |
| | | return R.ok(noticeService.removeBatchByIds(ids)); |
| | | } |
| | | |
| | | @GetMapping("/count") |
| | | @Log(title = "è·åå
¬åæ°é", businessType = BusinessType.OTHER) |
| | | @Operation(summary = "è·åå
¬åæ°é") |
| | | public AjaxResult count(){ |
| | | return AjaxResult.success(noticeService.selectCount()); |
| | | public R<?> count(){ |
| | | return R.ok(noticeService.selectCount()); |
| | | } |
| | | } |
| | |
| | | import com.ruoyi.basic.pojo.SupplierManage; |
| | | import com.ruoyi.collaborativeApproval.pojo.NoticeType; |
| | | import com.ruoyi.collaborativeApproval.service.NoticeTypeService; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.CollectionUtils; |
| | |
| | | @RestController |
| | | @RequestMapping("/noticeType") |
| | | @AllArgsConstructor |
| | | public class NoticeTypeController { |
| | | public class NoticeTypeController extends BaseController { |
| | | |
| | | private NoticeTypeService noticeTypeService; |
| | | |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping("/add") |
| | | public AjaxResult add(@RequestBody NoticeType noticeType) { |
| | | return AjaxResult.success(noticeTypeService.saveOrUpdate(noticeType)); |
| | | public R<?> add(@RequestBody NoticeType noticeType) { |
| | | return R.ok(noticeTypeService.saveOrUpdate(noticeType)); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/del") |
| | | public AjaxResult delNoticeType(@RequestBody List<Integer> ids) { |
| | | public R<?> delNoticeType(@RequestBody List<Integer> ids) { |
| | | if(CollectionUtils.isEmpty(ids)){ |
| | | return AjaxResult.error("è¯·éæ©è³å°ä¸æ¡æ°æ®"); |
| | | return R.fail("è¯·éæ©è³å°ä¸æ¡æ°æ®"); |
| | | } |
| | | return AjaxResult.success(noticeTypeService.removeBatchByIds(ids)); |
| | | return R.ok(noticeTypeService.removeBatchByIds(ids)); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/list") |
| | | public AjaxResult noticeTypeList() { |
| | | return AjaxResult.success(noticeTypeService.list()); |
| | | public R<?> noticeTypeList() { |
| | | return R.ok(noticeTypeService.list()); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.ruoyi.collaborativeApproval.pojo.SealApplicationManagement; |
| | | import com.ruoyi.collaborativeApproval.service.RulesRegulationsManagementService; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import lombok.AllArgsConstructor; |
| | |
| | | @RequestMapping("/rulesRegulationsManagement") |
| | | @AllArgsConstructor |
| | | @Tag(name = "å¶åº¦ç®¡ç") |
| | | public class RulesRegulationsManagementController { |
| | | public class RulesRegulationsManagementController extends BaseController { |
| | | private RulesRegulationsManagementService rulesRegulationsManagementService; |
| | | private ReadingStatusMapper readingStatusMapper; |
| | | |
| | | @GetMapping("/getList") |
| | | @Operation(summary = "å页æ¥è¯¢") |
| | | public AjaxResult listPage(Page page, RulesRegulationsManagement rulesRegulationsManagement){ |
| | | return AjaxResult.success(rulesRegulationsManagementService.listPage(page, rulesRegulationsManagement)); |
| | | public R<?> listPage(Page page, RulesRegulationsManagement rulesRegulationsManagement){ |
| | | return R.ok(rulesRegulationsManagementService.listPage(page, rulesRegulationsManagement)); |
| | | } |
| | | |
| | | @PostMapping("/add") |
| | | @Operation(summary = "æ°å¢") |
| | | public AjaxResult add(@RequestBody RulesRegulationsManagement rulesRegulationsManagement){ |
| | | public R<?> add(@RequestBody RulesRegulationsManagement rulesRegulationsManagement){ |
| | | rulesRegulationsManagementService.save(rulesRegulationsManagement); |
| | | return AjaxResult.success(rulesRegulationsManagement.getId()); |
| | | return R.ok(rulesRegulationsManagement.getId()); |
| | | } |
| | | |
| | | @PostMapping("/update") |
| | | @Operation(summary = "ä¿®æ¹") |
| | | public AjaxResult update(@RequestBody RulesRegulationsManagement rulesRegulationsManagement){ |
| | | return AjaxResult.success(rulesRegulationsManagementService.updateById(rulesRegulationsManagement)); |
| | | public R<?> update(@RequestBody RulesRegulationsManagement rulesRegulationsManagement){ |
| | | return R.ok(rulesRegulationsManagementService.updateById(rulesRegulationsManagement)); |
| | | } |
| | | |
| | | @DeleteMapping("/delete") |
| | | @Operation(summary = "å é¤") |
| | | public AjaxResult delete(@PathVariable("ids") List<Long> ids){ |
| | | public R<?> delete(@PathVariable("ids") List<Long> ids){ |
| | | if (CollectionUtils.isEmpty(ids)) { |
| | | throw new RuntimeException("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | } |
| | | return AjaxResult.success(rulesRegulationsManagementService.removeBatchByIds(ids)); |
| | | return R.ok(rulesRegulationsManagementService.removeBatchByIds(ids)); |
| | | } |
| | | //è§åæ¥çæ¶æ°å¢é
è¯»ç¶æ |
| | | @PostMapping("/addReadingStatus") |
| | | @Operation(summary = "æ°å¢é
è¯»ç¶æ") |
| | | public AjaxResult addReadingStatus(@RequestBody ReadingStatus readingStatus){ |
| | | return AjaxResult.success(readingStatusMapper.insert(readingStatus)); |
| | | public R<?> addReadingStatus(@RequestBody ReadingStatus readingStatus){ |
| | | return R.ok(readingStatusMapper.insert(readingStatus)); |
| | | } |
| | | @PostMapping("/updateReadingStatus") |
| | | @Operation(summary = "ä¿®æ¹é
è¯»ç¶æ") |
| | | public AjaxResult updateReadingStatus(@RequestBody ReadingStatus readingStatus){ |
| | | return AjaxResult.success(readingStatusMapper.updateById(readingStatus)); |
| | | public R<?> updateReadingStatus(@RequestBody ReadingStatus readingStatus){ |
| | | return R.ok(readingStatusMapper.updateById(readingStatus)); |
| | | } |
| | | @GetMapping("/getReadingStatusList") |
| | | @Operation(summary = "å页æ¥è¯¢é
è¯»ç¶æ") |
| | | public AjaxResult listPage(Page page, ReadingStatus readingStatus){ |
| | | return AjaxResult.success(readingStatusMapper.selectPage(page,new QueryWrapper<ReadingStatus>(readingStatus))); |
| | | public R<?> listPage(Page page, ReadingStatus readingStatus){ |
| | | return R.ok(readingStatusMapper.selectPage(page,new QueryWrapper<ReadingStatus>(readingStatus))); |
| | | } |
| | | @GetMapping("/getReadingStatusByRuleId/{ruleId}") |
| | | @Operation(summary = "æ ¹æ®å¶åº¦idæ¥è¯¢é
è¯»ç¶æ") |
| | | public AjaxResult getReadingStatusByRuleId(@PathVariable Long ruleId){ |
| | | return AjaxResult.success(readingStatusMapper.selectList(new QueryWrapper<ReadingStatus>().eq("rule_id", ruleId))); |
| | | public R<?> getReadingStatusByRuleId(@PathVariable Long ruleId){ |
| | | return R.ok(readingStatusMapper.selectList(new QueryWrapper<ReadingStatus>().eq("rule_id", ruleId))); |
| | | } |
| | | |
| | | @Operation(summary = "è§ç« å¶åº¦ç®¡ç导åº") |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.collaborativeApproval.pojo.RulesRegulationsManagementFile; |
| | | import com.ruoyi.collaborativeApproval.service.RulesRegulationsManagementFileService; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.quality.pojo.QualityInspectFile; |
| | | import com.ruoyi.quality.service.IQualityInspectFileService; |
| | | import org.springframework.util.CollectionUtils; |
| | |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/rulesRegulationsManagementFile") |
| | | public class RulesRegulationsManagementFileController { |
| | | public class RulesRegulationsManagementFileController extends BaseController { |
| | | |
| | | @Resource |
| | | private RulesRegulationsManagementFileService rulesRegulationsManagementFileService; |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping("/add") |
| | | public AjaxResult add(@RequestBody RulesRegulationsManagementFile rulesRegulationsManagementFile) { |
| | | return AjaxResult.success(rulesRegulationsManagementFileService.save(rulesRegulationsManagementFile)); |
| | | public R<?> add(@RequestBody RulesRegulationsManagementFile rulesRegulationsManagementFile) { |
| | | return R.ok(rulesRegulationsManagementFileService.save(rulesRegulationsManagementFile)); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/del") |
| | | public AjaxResult delQualityUnqualified(@RequestBody List<Integer> ids) { |
| | | public R<?> delQualityUnqualified(@RequestBody List<Integer> ids) { |
| | | if(CollectionUtils.isEmpty(ids)){ |
| | | return AjaxResult.error("è¯·éæ©è³å°ä¸æ¡æ°æ®"); |
| | | return R.fail("è¯·éæ©è³å°ä¸æ¡æ°æ®"); |
| | | } |
| | | //å 餿£éªéä»¶ |
| | | return AjaxResult.success(rulesRegulationsManagementFileService.removeBatchByIds(ids)); |
| | | return R.ok(rulesRegulationsManagementFileService.removeBatchByIds(ids)); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/listPage") |
| | | public AjaxResult listPage(Page page, RulesRegulationsManagementFile rulesRegulationsManagementFile) { |
| | | return AjaxResult.success(rulesRegulationsManagementFileService.listPage(page, rulesRegulationsManagementFile)); |
| | | public R<?> listPage(Page page, RulesRegulationsManagementFile rulesRegulationsManagementFile) { |
| | | return R.ok(rulesRegulationsManagementFileService.listPage(page, rulesRegulationsManagementFile)); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.project.system.service.ISysNoticeService; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | |
| | | @RestController |
| | | @RequestMapping("/sealApplicationManagement") |
| | | @Tag(name = "ç¨å°ç³è¯·ç®¡ç") |
| | | public class SealApplicationManagementController { |
| | | public class SealApplicationManagementController extends BaseController { |
| | | private SealApplicationManagementService sealApplicationManagementService; |
| | | private ISysNoticeService sysNoticeService; |
| | | private FileUtil fileUtil; |
| | | |
| | | @GetMapping("/getList") |
| | | @Operation(summary = "å页æ¥è¯¢") |
| | | public AjaxResult listPage(Page page, SealApplicationManagement sealApplicationManagement){ |
| | | return AjaxResult.success(sealApplicationManagementService.listPage(page,sealApplicationManagement)); |
| | | public R<?> listPage(Page page, SealApplicationManagement sealApplicationManagement){ |
| | | return R.ok(sealApplicationManagementService.listPage(page,sealApplicationManagement)); |
| | | } |
| | | |
| | | @PostMapping("/add") |
| | | @Operation(summary = "æ°å¢") |
| | | public AjaxResult add(@RequestBody SealApplicationManagementDTO sealApplicationManagement){ |
| | | public R<?> add(@RequestBody SealApplicationManagementDTO sealApplicationManagement){ |
| | | sealApplicationManagementService.save(sealApplicationManagement); |
| | | // 5. ä¿åéå®å°è´¦éä»¶ |
| | | fileUtil.saveStorageAttachment(ApplicationTypeEnum.FILE, |
| | |
| | | +"ç³è¯·æ é¢ï¼"+sealApplicationManagement.getTitle(), |
| | | Arrays.asList(sealApplicationManagement.getApproveUserId()), |
| | | "/collaborativeApproval/sealManagement?applicationNum="+sealApplicationManagement.getApplicationNum()); |
| | | return AjaxResult.success(); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @PostMapping("/update") |
| | | @Operation(summary = "ä¿®æ¹") |
| | | public AjaxResult update(@RequestBody SealApplicationManagementDTO sealApplicationManagement){ |
| | | public R<?> update(@RequestBody SealApplicationManagementDTO sealApplicationManagement){ |
| | | // 5. ä¿åéå®å°è´¦éä»¶ |
| | | fileUtil.saveStorageAttachment(ApplicationTypeEnum.FILE, |
| | | RecordTypeEnum.SEAL_APPLICATION_MANAGEMENT, |
| | | sealApplicationManagement.getId(), |
| | | sealApplicationManagement.getStorageBlobDTOs()); |
| | | return AjaxResult.success(sealApplicationManagementService.updateById(sealApplicationManagement)); |
| | | return R.ok(sealApplicationManagementService.updateById(sealApplicationManagement)); |
| | | } |
| | | |
| | | @DeleteMapping("/delete") |
| | | @Operation(summary = "å é¤") |
| | | public AjaxResult delete(@PathVariable("ids") List<Long> ids){ |
| | | public R<?> delete(@PathVariable("ids") List<Long> ids){ |
| | | if (CollectionUtils.isEmpty(ids)) { |
| | | throw new RuntimeException("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | } |
| | | fileUtil.deleteStorageAttachmentsByApplicationAndRecordTypeAndRecordIds(ApplicationTypeEnum.FILE, |
| | | RecordTypeEnum.SEAL_APPLICATION_MANAGEMENT, |
| | | ids); |
| | | return AjaxResult.success(sealApplicationManagementService.removeBatchByIds(ids)); |
| | | return R.ok(sealApplicationManagementService.removeBatchByIds(ids)); |
| | | } |
| | | |
| | | @Operation(summary = "ç¨å°ç³è¯·ç®¡ç导åº") |
| | |
| | | import com.ruoyi.collaborativeApproval.dto.StaffContactsPersonalDTO; |
| | | import com.ruoyi.collaborativeApproval.pojo.StaffContactsPersonal; |
| | | import com.ruoyi.collaborativeApproval.service.StaffContactsPersonalService; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | @RestController |
| | | @RequestMapping("/staffContactsPersonal") |
| | | @AllArgsConstructor |
| | | public class StaffContactsPersonalController { |
| | | public class StaffContactsPersonalController extends BaseController { |
| | | private StaffContactsPersonalService staffContactsPersonalService; |
| | | |
| | | @GetMapping("/getList") |
| | | @Operation(summary = "å页æ¥è¯¢") |
| | | public AjaxResult listPage(Page page, StaffContactsPersonalDTO staffContactsPersonalDTO) { |
| | | return AjaxResult.success(staffContactsPersonalService.listPage(page, staffContactsPersonalDTO)); |
| | | public R<?> listPage(Page page, StaffContactsPersonalDTO staffContactsPersonalDTO) { |
| | | return R.ok(staffContactsPersonalService.listPage(page, staffContactsPersonalDTO)); |
| | | } |
| | | |
| | | @PostMapping("/add") |
| | | @Operation(summary = "æ°å¢") |
| | | public AjaxResult add(@RequestBody StaffContactsPersonal staffContactsPersonal) { |
| | | return AjaxResult.success(staffContactsPersonalService.save(staffContactsPersonal)); |
| | | public R<?> add(@RequestBody StaffContactsPersonal staffContactsPersonal) { |
| | | return R.ok(staffContactsPersonalService.save(staffContactsPersonal)); |
| | | } |
| | | |
| | | @DeleteMapping("/delete/{id}") |
| | | @Operation(summary = "å é¤") |
| | | public AjaxResult delete(@PathVariable("id") Long id) { |
| | | public R<?> delete(@PathVariable("id") Long id) { |
| | | // if (CollectionUtils.isEmpty(id)) { |
| | | // throw new RuntimeException("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | // } |
| | | return AjaxResult.success(staffContactsPersonalService.removeById(id)); |
| | | return R.ok(staffContactsPersonalService.removeById(id)); |
| | | } |
| | | } |
| | |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.staff.mapper.StaffOnJobMapper; |
| | | import com.ruoyi.staff.pojo.StaffOnJob; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | |
| | | @GetMapping("/listPage") |
| | | @Log(title = "èªé
¬ç»©æ-å页æ¥è¯¢", businessType = BusinessType.OTHER) |
| | | @Operation(summary = "èªé
¬ç»©æ-å页æ¥è¯¢") |
| | | public AjaxResult listPage(Page page, String staffName, String payDateStr) { |
| | | public R<?> listPage(Page page, String staffName, String payDateStr) { |
| | | IPage<CompensationPerformance> listPage = compensationPerformanceService.listPage(page, staffName, payDateStr); |
| | | return AjaxResult.success(listPage); |
| | | return R.ok(listPage); |
| | | } |
| | | |
| | | @PostMapping("/add") |
| | | @Log(title = "èªé
¬ç»©æ-æ·»å ", businessType = BusinessType.INSERT) |
| | | @Operation(summary = "èªé
¬ç»©æ-æ·»å ") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult add(@RequestBody CompensationPerformance compensationPerformance) { |
| | | public R<?> add(@RequestBody CompensationPerformance compensationPerformance) { |
| | | boolean save = compensationPerformanceService.save(compensationPerformance); |
| | | return save ? AjaxResult.success("æ·»å æå") : AjaxResult.error("æ·»å 失败"); |
| | | return save ? R.ok(null, "æ·»å æå") : R.fail("æ·»å 失败"); |
| | | } |
| | | |
| | | @PostMapping("/update") |
| | | @Log(title = "èªé
¬ç»©æ-ä¿®æ¹", businessType = BusinessType.UPDATE) |
| | | @Operation(summary = "èªé
¬ç»©æ-ä¿®æ¹") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult update(@RequestBody CompensationPerformance compensationPerformance) { |
| | | public R<?> update(@RequestBody CompensationPerformance compensationPerformance) { |
| | | boolean update = compensationPerformanceService.updateById(compensationPerformance); |
| | | return update ? AjaxResult.success("ä¿®æ¹æå") : AjaxResult.error("ä¿®æ¹å¤±è´¥"); |
| | | return update ? R.ok(null, "ä¿®æ¹æå") : R.fail("ä¿®æ¹å¤±è´¥"); |
| | | } |
| | | |
| | | @DeleteMapping("/delete") |
| | | @Log(title = "èªé
¬ç»©æ-å é¤", businessType = BusinessType.DELETE) |
| | | @Operation(summary = "èªé
¬ç»©æ-å é¤") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult delete(@RequestBody List<Long> ids) { |
| | | if (CollectionUtils.isEmpty(ids)) return AjaxResult.error("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | public R<?> delete(@RequestBody List<Long> ids) { |
| | | if (CollectionUtils.isEmpty(ids)) return R.fail("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | boolean delete = compensationPerformanceService.removeBatchByIds(ids); |
| | | return delete ? AjaxResult.success("å 餿å") : AjaxResult.error("å é¤å¤±è´¥"); |
| | | return delete ? R.ok(null, "å 餿å") : R.fail("å é¤å¤±è´¥"); |
| | | } |
| | | |
| | | @Log(title = "导åºèªèµç®¡çå表", businessType = BusinessType.EXPORT) |
| | |
| | | |
| | | @Log(title = "导å
¥èªèµç®¡çå表", businessType = BusinessType.IMPORT) |
| | | @PostMapping("/importData") |
| | | public AjaxResult importData(MultipartFile file) throws Exception { |
| | | public R<?> importData(MultipartFile file) throws Exception { |
| | | ExcelUtil<CompensationPerformance> util = new ExcelUtil<>(CompensationPerformance.class); |
| | | List<CompensationPerformance> list = util.importExcel(file.getInputStream()); |
| | | list.forEach(item -> { |
| | |
| | | } |
| | | }); |
| | | boolean b = compensationPerformanceService.saveBatch(list); |
| | | return AjaxResult.success(b); |
| | | return R.ok(b); |
| | | } |
| | | |
| | | |
| | |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import lombok.AllArgsConstructor; |
| | |
| | | @GetMapping("/listPage") |
| | | @Log(title = "å®¢æ·æè®¿-å页æ¥è¯¢", businessType = BusinessType.OTHER) |
| | | @Operation(summary = "å®¢æ·æè®¿-å页æ¥è¯¢") |
| | | public AjaxResult listPage(Page page, CustomerVisits customerVisits) { |
| | | public R<?> listPage(Page page, CustomerVisits customerVisits) { |
| | | IPage<CustomerVisits> listPage = customerVisitsService.listPage(page, customerVisits); |
| | | return AjaxResult.success(listPage); |
| | | return R.ok(listPage); |
| | | } |
| | | |
| | | @Log(title = "å®¢æ·æè®¿-æ·»å ", businessType = BusinessType.INSERT) |
| | | @Operation(summary = "å®¢æ·æè®¿-æ·»å ") |
| | | @PostMapping("/add") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult add(@RequestBody CustomerVisits customerVisits) { |
| | | public R<?> add(@RequestBody CustomerVisits customerVisits) { |
| | | boolean save = customerVisitsService.save(customerVisits); |
| | | if (save) { |
| | | return AjaxResult.success("æ·»å æå"); |
| | | return R.ok(null, "æ·»å æå"); |
| | | } |
| | | return AjaxResult.error("æ·»å 失败"); |
| | | return R.fail("æ·»å 失败"); |
| | | } |
| | | |
| | | @Log(title = "å®¢æ·æè®¿-ç¼è¾", businessType = BusinessType.UPDATE) |
| | | @Operation(summary = "å®¢æ·æè®¿-ç¼è¾") |
| | | @PostMapping("update") |
| | | public AjaxResult updateCustomerVisit(@RequestBody CustomerVisits customerVisits) { |
| | | public R<?> updateCustomerVisit(@RequestBody CustomerVisits customerVisits) { |
| | | boolean updateResult = customerVisitsService.updateCustomerVisit(customerVisits); |
| | | if (updateResult) { |
| | | return AjaxResult.success("ç¼è¾æå"); |
| | | return R.ok(null, "ç¼è¾æå"); |
| | | } |
| | | return AjaxResult.error("ç¼è¾å¤±è´¥"); |
| | | return R.fail("ç¼è¾å¤±è´¥"); |
| | | } |
| | | |
| | | @Log(title = "å®¢æ·æè®¿-å é¤", businessType = BusinessType.DELETE) |
| | | @Operation(summary = "å®¢æ·æè®¿-å é¤") |
| | | @DeleteMapping("{customerId}") |
| | | public AjaxResult deleteCustomerVisit(@PathVariable Integer customerId) { |
| | | public R<?> deleteCustomerVisit(@PathVariable Integer customerId) { |
| | | if (customerId == null) { |
| | | return AjaxResult.error("客æ·IDä¸è½ä¸ºç©º"); |
| | | return R.fail("客æ·IDä¸è½ä¸ºç©º"); |
| | | } |
| | | boolean deleteResult = customerVisitsService.removeById(customerId); |
| | | if (deleteResult) { |
| | | return AjaxResult.success("å 餿å"); |
| | | return R.ok(null, "å 餿å"); |
| | | } |
| | | return AjaxResult.error("å é¤å¤±è´¥"); |
| | | return R.fail("å é¤å¤±è´¥"); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.customervisits.pojo.CustomerVisits; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | |
| | | /** |
| | | * @author :yys |
| | |
| | | import com.ruoyi.device.dto.DeviceDefectRecordDto; |
| | | import com.ruoyi.device.pojo.DeviceDefectRecord; |
| | | import com.ruoyi.device.service.DeviceDefectRecordService; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import lombok.AllArgsConstructor; |
| | |
| | | @RequestMapping("/defect") |
| | | @AllArgsConstructor |
| | | @RestController |
| | | public class DeviceDefectRecordController { |
| | | public class DeviceDefectRecordController extends BaseController { |
| | | private DeviceDefectRecordService deviceDefectRecordService; |
| | | @Operation(summary = "设å¤ç¼ºé·è®°å½å表") |
| | | @GetMapping("/page") |
| | | public AjaxResult page(Page page , DeviceDefectRecordDto deviceDefectRecordDto) { |
| | | return AjaxResult.success(deviceDefectRecordService.listPage(page,deviceDefectRecordDto)); |
| | | public R<?> page(Page page , DeviceDefectRecordDto deviceDefectRecordDto) { |
| | | return R.ok(deviceDefectRecordService.listPage(page,deviceDefectRecordDto)); |
| | | } |
| | | @Operation(summary = "设å¤idæ¥è¯¢è®¾å¤ç¼ºé·è®°å½å表") |
| | | @GetMapping("/find/{deviceLedgerId}") |
| | | public AjaxResult find(@PathVariable Long deviceLedgerId) { |
| | | public R<?> find(@PathVariable Long deviceLedgerId) { |
| | | DeviceDefectRecordDto deviceDefectRecordDto = new DeviceDefectRecordDto(); |
| | | deviceDefectRecordDto.setDeviceLedgerId(deviceLedgerId); |
| | | return AjaxResult.success(deviceDefectRecordService.listPage(new Page<>(1,-1),deviceDefectRecordDto)); |
| | | return R.ok(deviceDefectRecordService.listPage(new Page<>(1,-1),deviceDefectRecordDto)); |
| | | } |
| | | |
| | | @PostMapping("/add") |
| | | @Operation(summary = "æ·»å 设å¤ç¼ºé·è®°å½") |
| | | public AjaxResult add(@RequestBody DeviceDefectRecord deviceDefectRecord) { |
| | | return AjaxResult.success(deviceDefectRecordService.add(deviceDefectRecord)); |
| | | public R<?> add(@RequestBody DeviceDefectRecord deviceDefectRecord) { |
| | | return R.ok(deviceDefectRecordService.add(deviceDefectRecord)); |
| | | } |
| | | @PostMapping("/update") |
| | | @Operation(summary = "ä¿®æ¹è®¾å¤ç¼ºé·è®°å½") |
| | | public AjaxResult update(@RequestBody DeviceDefectRecord deviceDefectRecord) { |
| | | return AjaxResult.success(deviceDefectRecordService.updateByDDR(deviceDefectRecord)); |
| | | public R<?> update(@RequestBody DeviceDefectRecord deviceDefectRecord) { |
| | | return R.ok(deviceDefectRecordService.updateByDDR(deviceDefectRecord)); |
| | | } |
| | | @DeleteMapping("/delete") |
| | | @Operation(summary = "å é¤è®¾å¤ç¼ºé·è®°å½") |
| | | public AjaxResult delete(@PathVariable Long id) { |
| | | return AjaxResult.success(deviceDefectRecordService.removeById(id)); |
| | | public R<?> delete(@PathVariable Long id) { |
| | | return R.ok(deviceDefectRecordService.removeById(id)); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.ruoyi.device.pojo.DeviceMaintenance; |
| | | import com.ruoyi.device.service.IDeviceLedgerService; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Anonymous; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | |
| | | @RequestMapping("/device/ledger") |
| | | @RestController |
| | | @AllArgsConstructor |
| | | public class DeviceLedgerController { |
| | | public class DeviceLedgerController extends BaseController { |
| | | |
| | | private IDeviceLedgerService deviceLedgerService; |
| | | private DeviceLedgerMapper deviceLedgerMapper; |
| | |
| | | |
| | | @Operation(summary = "设å¤å°è´¦å表") |
| | | @GetMapping("/page") |
| | | public AjaxResult page(Page page , DeviceLedgerDto deviceLedger) { |
| | | return AjaxResult.success(deviceLedgerService.queryPage(page,deviceLedger)); |
| | | public R<?> page(Page page , DeviceLedgerDto deviceLedger) { |
| | | return R.ok(deviceLedgerService.queryPage(page,deviceLedger)); |
| | | } |
| | | |
| | | @PostMapping() |
| | | @Operation(summary = "æ·»å 设å¤å°è´¦") |
| | | public AjaxResult add(@RequestBody DeviceLedger deviceLedger) { |
| | | public R<?> add(@RequestBody DeviceLedger deviceLedger) { |
| | | |
| | | return deviceLedgerService.saveDeviceLedger(deviceLedger); |
| | | } |
| | | |
| | | @Operation(summary = "æ ¹æ®idæ¥è¯¢è®¾å¤å°è´¦") |
| | | @GetMapping("/{id}") |
| | | public AjaxResult detail(@PathVariable Long id) { |
| | | return AjaxResult.success(deviceLedgerService.getById(id)); |
| | | public R<?> detail(@PathVariable Long id) { |
| | | return R.ok(deviceLedgerService.getById(id)); |
| | | } |
| | | |
| | | @PutMapping () |
| | | @Operation(summary = "ä¿®æ¹è®¾å¤å°è´¦") |
| | | public AjaxResult update(@RequestBody DeviceLedger deviceLedger) { |
| | | public R<?> update(@RequestBody DeviceLedger deviceLedger) { |
| | | return deviceLedgerService.updateDeviceLedger(deviceLedger); |
| | | } |
| | | |
| | | @DeleteMapping("/{ids}") |
| | | @Operation(summary = "å é¤è®¾å¤å°è´¦") |
| | | public AjaxResult delete(@PathVariable("ids") ArrayList<Long> ids) { |
| | | public R<?> delete(@PathVariable("ids") ArrayList<Long> ids) { |
| | | boolean b = deviceLedgerService.removeBatchByIds(ids); |
| | | if (!b) { |
| | | return AjaxResult.error("å é¤å¤±è´¥"); |
| | | return R.fail("å é¤å¤±è´¥"); |
| | | } |
| | | return AjaxResult.success(); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @PostMapping("export") |
| | |
| | | |
| | | @PostMapping("/import") |
| | | @Operation(summary = "导å
¥è®¾å¤å°è´¦") |
| | | public AjaxResult importData(MultipartFile file) throws IOException { |
| | | public R<?> importData(MultipartFile file) throws IOException { |
| | | Boolean b = deviceLedgerService.importData(file); |
| | | if (b) { |
| | | return AjaxResult.success("导å
¥æå"); |
| | | return R.ok(null, "导å
¥æå"); |
| | | } |
| | | return AjaxResult.error("导å
¥å¤±è´¥"); |
| | | return R.fail("导å
¥å¤±è´¥"); |
| | | } |
| | | |
| | | |
| | | @GetMapping("getDeviceLedger") |
| | | @Operation(summary = "è·å设å¤å°è´¦") |
| | | public AjaxResult getDeviceLedger( ) { |
| | | return AjaxResult.success(deviceLedgerService.list(new QueryWrapper<DeviceLedger>().lambda() |
| | | public R<?> getDeviceLedger( ) { |
| | | return R.ok(deviceLedgerService.list(new QueryWrapper<DeviceLedger>().lambda() |
| | | .select(DeviceLedger::getId, DeviceLedger::getDeviceName,DeviceLedger::getDeviceModel))); |
| | | } |
| | | |
| | | @GetMapping("scanDevice") |
| | | @Operation(summary = "è·å设å¤å°è´¦") |
| | | @Anonymous |
| | | public AjaxResult scanDevice(Long id) { |
| | | public R<?> scanDevice(Long id) { |
| | | List<DeviceMaintenance> list = deviceMaintenanceMapper.list1(id); |
| | | DeviceLedger deviceLedger = deviceLedgerMapper.selectById1(id); |
| | | if (list.size()>0){ |
| | | deviceLedger.setUpdateTime(list.get(0).getMaintenanceActuallyTime());//æåç»´æ¤æ¶é´ |
| | | } |
| | | deviceLedger.setCreateTime(deviceLedger.getUpdateTime().plusMonths(1));//䏿¬¡ç»´æ¤æ¶é´ |
| | | return AjaxResult.success(deviceLedger); |
| | | return R.ok(deviceLedger); |
| | | } |
| | | } |
| | |
| | | import com.ruoyi.device.pojo.DeviceMaintenance; |
| | | import com.ruoyi.device.service.IDeviceLedgerService; |
| | | import com.ruoyi.device.service.IDeviceMaintenanceService; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | |
| | | @RestController |
| | | @RequestMapping("/device/maintenance") |
| | | @AllArgsConstructor |
| | | public class DeviceMaintenanceController { |
| | | public class DeviceMaintenanceController extends BaseController { |
| | | |
| | | |
| | | private IDeviceMaintenanceService deviceMaintenanceService; |
| | |
| | | |
| | | @Operation(summary = "设å¤ä¿å
»å表") |
| | | @GetMapping("/page") |
| | | public AjaxResult page(Page page , DeviceMaintenanceDto deviceMaintenanceDto) { |
| | | return AjaxResult.success(deviceMaintenanceService.queryPage(page,deviceMaintenanceDto)); |
| | | public R<?> page(Page page , DeviceMaintenanceDto deviceMaintenanceDto) { |
| | | return R.ok(deviceMaintenanceService.queryPage(page,deviceMaintenanceDto)); |
| | | } |
| | | |
| | | @PostMapping() |
| | | @Operation(summary = "æ·»å 设å¤ä¿å
»") |
| | | public AjaxResult add(@RequestBody DeviceMaintenanceDto deviceMaintenance) { |
| | | public R<?> add(@RequestBody DeviceMaintenanceDto deviceMaintenance) { |
| | | DeviceLedger byId = deviceLedgerService.getById(deviceMaintenance.getDeviceLedgerId()); |
| | | deviceMaintenance.setDeviceName(byId.getDeviceName()); |
| | | deviceMaintenance.setDeviceModel(byId.getDeviceModel()); |
| | |
| | | |
| | | @Operation(summary = "æ ¹æ®idæ¥è¯¢è®¾å¤ä¿å
»") |
| | | @GetMapping("/{id}") |
| | | public AjaxResult detail(@PathVariable Long id) { |
| | | return AjaxResult.success(deviceMaintenanceService.detailById(id)); |
| | | public R<?> detail(@PathVariable Long id) { |
| | | return R.ok(deviceMaintenanceService.detailById(id)); |
| | | } |
| | | |
| | | @PutMapping () |
| | | @Operation(summary = "ä¿®æ¹è®¾å¤ä¿å
»") |
| | | public AjaxResult update(@RequestBody DeviceMaintenanceDto deviceMaintenance) { |
| | | public R<?> update(@RequestBody DeviceMaintenanceDto deviceMaintenance) { |
| | | DeviceLedger byId = deviceLedgerService.getById(deviceMaintenance.getDeviceLedgerId()); |
| | | deviceMaintenance.setDeviceName(byId.getDeviceName()); |
| | | deviceMaintenance.setDeviceModel(byId.getDeviceModel()); |
| | |
| | | |
| | | @PostMapping ("maintenance") |
| | | @Operation(summary = "ä¿®æ¹è®¾å¤ä¿å
»") |
| | | public AjaxResult maintenance(@RequestBody DeviceMaintenanceDto deviceMaintenance) { |
| | | public R<?> maintenance(@RequestBody DeviceMaintenanceDto deviceMaintenance) { |
| | | return deviceMaintenanceService.updateDeviceDeviceMaintenance(deviceMaintenance); |
| | | } |
| | | |
| | | |
| | | @DeleteMapping("/{ids}") |
| | | @Operation(summary = "å é¤è®¾å¤ä¿å
»") |
| | | public AjaxResult delete(@PathVariable("ids") Long[] ids) { |
| | | public R<?> delete(@PathVariable("ids") Long[] ids) { |
| | | boolean b = deviceMaintenanceService.removeBatchByIds(Arrays.asList(ids)); |
| | | if (!b) { |
| | | return AjaxResult.error("å é¤å¤±è´¥"); |
| | | return R.fail("å é¤å¤±è´¥"); |
| | | } |
| | | return AjaxResult.success(); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @PostMapping("export") |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.device.pojo.DeviceMaintenanceFile; |
| | | import com.ruoyi.device.service.DeviceMaintenanceFileService; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | @RestController |
| | | @RequestMapping("/maintenanceTaskFile") |
| | | @Tag(name = "设å¤ä¿å
»éä»¶") |
| | | public class DeviceMaintenanceFileController { |
| | | public class DeviceMaintenanceFileController extends BaseController { |
| | | |
| | | @Resource |
| | | private DeviceMaintenanceFileService deviceMaintenanceFileService; |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping("/add") |
| | | public AjaxResult add(@RequestBody DeviceMaintenanceFile deviceMaintenanceFile) { |
| | | return AjaxResult.success(deviceMaintenanceFileService.save(deviceMaintenanceFile)); |
| | | public R<?> add(@RequestBody DeviceMaintenanceFile deviceMaintenanceFile) { |
| | | return R.ok(deviceMaintenanceFileService.save(deviceMaintenanceFile)); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/del") |
| | | public AjaxResult delQualityUnqualified(@RequestBody List<Integer> ids) { |
| | | public R<?> delQualityUnqualified(@RequestBody List<Integer> ids) { |
| | | if(CollectionUtils.isEmpty(ids)){ |
| | | return AjaxResult.error("è¯·éæ©è³å°ä¸æ¡æ°æ®"); |
| | | return R.fail("è¯·éæ©è³å°ä¸æ¡æ°æ®"); |
| | | } |
| | | //å 餿£éªéä»¶ |
| | | return AjaxResult.success(deviceMaintenanceFileService.removeBatchByIds(ids)); |
| | | return R.ok(deviceMaintenanceFileService.removeBatchByIds(ids)); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/listPage") |
| | | public AjaxResult qualityInspectFileListPage(Page page, DeviceMaintenanceFile deviceMaintenanceFile) { |
| | | return AjaxResult.success(deviceMaintenanceFileService.page(page, Wrappers.<DeviceMaintenanceFile>lambdaQuery().eq(DeviceMaintenanceFile::getDeviceMaintenanceId,deviceMaintenanceFile.getDeviceMaintenanceId()))); |
| | | public R<?> qualityInspectFileListPage(Page page, DeviceMaintenanceFile deviceMaintenanceFile) { |
| | | return R.ok(deviceMaintenanceFileService.page(page, Wrappers.<DeviceMaintenanceFile>lambdaQuery().eq(DeviceMaintenanceFile::getDeviceMaintenanceId,deviceMaintenanceFile.getDeviceMaintenanceId()))); |
| | | } |
| | | |
| | | |
| | |
| | | import com.ruoyi.device.dto.DeviceRepairDto; |
| | | import com.ruoyi.device.pojo.DeviceRepair; |
| | | import com.ruoyi.device.service.IDeviceRepairService; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | |
| | | @RequestMapping("/device/repair") |
| | | @RestController |
| | | @AllArgsConstructor |
| | | public class DeviceRepairController { |
| | | public class DeviceRepairController extends BaseController { |
| | | |
| | | private IDeviceRepairService deviceRepairService; |
| | | |
| | | @Operation(summary = "è®¾å¤æ¥ä¿®å表") |
| | | @GetMapping("/page") |
| | | public AjaxResult page(Page page , DeviceRepairDto deviceRepairDto) { |
| | | return AjaxResult.success(deviceRepairService.queryPage(page,deviceRepairDto)); |
| | | public R<?> page(Page page , DeviceRepairDto deviceRepairDto) { |
| | | return R.ok(deviceRepairService.queryPage(page,deviceRepairDto)); |
| | | } |
| | | |
| | | @PostMapping() |
| | | @Operation(summary = "æ·»å è®¾å¤æ¥ä¿®") |
| | | public AjaxResult add( @RequestBody DeviceRepairDto deviceRepairDto) { |
| | | public R<?> add( @RequestBody DeviceRepairDto deviceRepairDto) { |
| | | return deviceRepairService.saveDeviceRepair(deviceRepairDto); |
| | | } |
| | | |
| | | @Operation(summary = "æ ¹æ®idæ¥è¯¢è®¾å¤æ¥ä¿®") |
| | | @GetMapping("/{id}") |
| | | public AjaxResult detail(@PathVariable Long id) { |
| | | return AjaxResult.success(deviceRepairService.detailById(id)); |
| | | public R<?> detail(@PathVariable Long id) { |
| | | return R.ok(deviceRepairService.detailById(id)); |
| | | } |
| | | |
| | | @PutMapping () |
| | | @Operation(summary = "ä¿®æ¹è®¾å¤æ¥ä¿®") |
| | | public AjaxResult update( @RequestBody DeviceRepairDto deviceRepairDto) { |
| | | public R<?> update( @RequestBody DeviceRepairDto deviceRepairDto) { |
| | | return deviceRepairService.updateDeviceRepair(deviceRepairDto); |
| | | } |
| | | |
| | | @PostMapping ("/repair") |
| | | @Operation(summary = "设å¤ç»´ä¿®") |
| | | public AjaxResult repair( @RequestBody DeviceRepairDto deviceRepairDto) { |
| | | public R<?> repair( @RequestBody DeviceRepairDto deviceRepairDto) { |
| | | return deviceRepairService.confirmRepair(deviceRepairDto); |
| | | } |
| | | |
| | | @PostMapping ("/acceptance") |
| | | @Operation(summary = "è®¾å¤æ¥ä¿®éªæ¶å®¡æ¹") |
| | | public AjaxResult acceptance(@RequestBody DeviceRepairDto deviceRepairDto) { |
| | | public R<?> acceptance(@RequestBody DeviceRepairDto deviceRepairDto) { |
| | | return deviceRepairService.approveRepairAcceptance(deviceRepairDto); |
| | | } |
| | | |
| | | @DeleteMapping("/{ids}") |
| | | @Operation(summary = "å é¤è®¾å¤æ¥ä¿®") |
| | | public AjaxResult delete(@PathVariable("ids") Long[] ids) { |
| | | public R<?> delete(@PathVariable("ids") Long[] ids) { |
| | | boolean b = deviceRepairService.removeBatchByIds(Arrays.asList(ids)); |
| | | if (!b) { |
| | | return AjaxResult.error("å é¤å¤±è´¥"); |
| | | return R.fail("å é¤å¤±è´¥"); |
| | | } |
| | | return AjaxResult.success(); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @PostMapping("export") |
| | |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import lombok.AllArgsConstructor; |
| | |
| | | |
| | | @GetMapping("/listPage") |
| | | @Operation(summary = "设å¤ä¿å
»å®æ¶ä»»å¡å表") |
| | | public AjaxResult listPage(Page page, MaintenanceTask maintenanceTask) { |
| | | public R<?> listPage(Page page, MaintenanceTask maintenanceTask) { |
| | | return maintenanceTaskService.listPage(page,maintenanceTask); |
| | | } |
| | | |
| | |
| | | @PostMapping("/add") |
| | | @Operation(summary = "æ·»å 设å¤ä¿å
»å®æ¶ä»»å¡") |
| | | @Log(title = "设å¤ä¿å
»å®æ¶ä»»å¡", businessType = BusinessType.INSERT) |
| | | public AjaxResult add(@RequestBody MaintenanceTask maintenanceTask) { |
| | | public R<?> add(@RequestBody MaintenanceTask maintenanceTask) { |
| | | return maintenanceTaskService.add(maintenanceTask); |
| | | } |
| | | |
| | | @PostMapping("/update") |
| | | @Operation(summary = "ä¿®æ¹è®¾å¤ä¿å
»å®æ¶ä»»å¡") |
| | | @Log(title = "设å¤ä¿å
»å®æ¶ä»»å¡", businessType = BusinessType.UPDATE) |
| | | public AjaxResult update(@RequestBody MaintenanceTask maintenanceTask) { |
| | | public R<?> update(@RequestBody MaintenanceTask maintenanceTask) { |
| | | return maintenanceTaskService.updateByMaintenanceTaskId(maintenanceTask); |
| | | } |
| | | |
| | | @DeleteMapping("/delete") |
| | | @Operation(summary = "å é¤è®¾å¤ä¿å
»å®æ¶ä»»å¡") |
| | | @Log(title = "设å¤ä¿å
»å®æ¶ä»»å¡", businessType = BusinessType.DELETE) |
| | | public AjaxResult delete(@RequestBody List<Long> ids) { |
| | | public R<?> delete(@RequestBody List<Long> ids) { |
| | | return maintenanceTaskService.delete(ids); |
| | | } |
| | | |
| | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.device.dto.DeviceLedgerDto; |
| | | import com.ruoyi.device.pojo.DeviceLedger; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | |
| | | public interface IDeviceLedgerService extends IService<DeviceLedger> { |
| | | IPage<DeviceLedgerDto> queryPage(Page page, DeviceLedgerDto deviceLedger); |
| | | |
| | | AjaxResult saveDeviceLedger(DeviceLedger deviceLedger); |
| | | R<?> saveDeviceLedger(DeviceLedger deviceLedger); |
| | | |
| | | AjaxResult updateDeviceLedger(DeviceLedger deviceLedger); |
| | | R<?> updateDeviceLedger(DeviceLedger deviceLedger); |
| | | |
| | | void export(HttpServletResponse response, Long[] ids); |
| | | |
| | |
| | | import com.ruoyi.device.dto.DeviceMaintenanceDto; |
| | | import com.ruoyi.device.pojo.DeviceMaintenance; |
| | | import com.ruoyi.device.vo.DeviceMaintenanceVo; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | |
| | |
| | | |
| | | IPage<DeviceMaintenanceDto> queryPage(Page page, DeviceMaintenanceDto deviceMaintenanceDto); |
| | | |
| | | AjaxResult saveDeviceRepair(DeviceMaintenanceDto deviceMaintenance); |
| | | R<?> saveDeviceRepair(DeviceMaintenanceDto deviceMaintenance); |
| | | |
| | | AjaxResult updateDeviceDeviceMaintenance(DeviceMaintenanceDto deviceMaintenance); |
| | | R<?> updateDeviceDeviceMaintenance(DeviceMaintenanceDto deviceMaintenance); |
| | | |
| | | void export(HttpServletResponse response, Long[] ids); |
| | | |
| | |
| | | import com.ruoyi.device.dto.DeviceRepairDto; |
| | | import com.ruoyi.device.pojo.DeviceRepair; |
| | | import com.ruoyi.device.vo.DeviceRepairVo; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | |
| | |
| | | |
| | | IPage<DeviceRepairVo> queryPage(Page page, DeviceRepairDto deviceRepairDto); |
| | | |
| | | AjaxResult saveDeviceRepair(DeviceRepairDto deviceRepairDto); |
| | | R<?> saveDeviceRepair(DeviceRepairDto deviceRepairDto); |
| | | |
| | | AjaxResult updateDeviceRepair(DeviceRepairDto deviceRepairDto); |
| | | R<?> updateDeviceRepair(DeviceRepairDto deviceRepairDto); |
| | | |
| | | AjaxResult confirmRepair(DeviceRepairDto deviceRepairDto); |
| | | R<?> confirmRepair(DeviceRepairDto deviceRepairDto); |
| | | |
| | | AjaxResult approveRepairAcceptance(DeviceRepairDto deviceRepairDto); |
| | | R<?> approveRepairAcceptance(DeviceRepairDto deviceRepairDto); |
| | | |
| | | void export(HttpServletResponse response, Long[] ids); |
| | | |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.device.pojo.MaintenanceTask; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | * @date : 2025/12/22 14:56 |
| | | */ |
| | | public interface MaintenanceTaskService extends IService<MaintenanceTask> { |
| | | AjaxResult listPage(Page page, MaintenanceTask maintenanceTask); |
| | | R<?> listPage(Page page, MaintenanceTask maintenanceTask); |
| | | |
| | | AjaxResult add(MaintenanceTask maintenanceTask); |
| | | R<?> add(MaintenanceTask maintenanceTask); |
| | | |
| | | AjaxResult updateByMaintenanceTaskId(MaintenanceTask maintenanceTask); |
| | | R<?> updateByMaintenanceTaskId(MaintenanceTask maintenanceTask); |
| | | |
| | | AjaxResult delete(List<Long> ids); |
| | | R<?> delete(List<Long> ids); |
| | | } |
| | |
| | | import com.ruoyi.device.mapper.DeviceLedgerMapper; |
| | | import com.ruoyi.device.pojo.DeviceLedger; |
| | | import com.ruoyi.device.service.IDeviceLedgerService; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.project.system.domain.SysUser; |
| | | import com.ruoyi.project.system.mapper.SysUserMapper; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public AjaxResult saveDeviceLedger(DeviceLedger deviceLedger) { |
| | | public R<?> saveDeviceLedger(DeviceLedger deviceLedger) { |
| | | LambdaQueryWrapper<DeviceLedger> deviceLedgerLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | deviceLedgerLambdaQueryWrapper.eq(DeviceLedger::getDeviceName,deviceLedger.getDeviceName()); |
| | | if (this.count(deviceLedgerLambdaQueryWrapper) > 0) { |
| | | return AjaxResult.error("设å¤åç§°å·²åå¨"); |
| | | return R.fail("设å¤åç§°å·²åå¨"); |
| | | } |
| | | boolean save = this.save(deviceLedger); |
| | | if (save){ |
| | | return AjaxResult.success(); |
| | | return R.ok(); |
| | | } |
| | | return AjaxResult.error(); |
| | | return R.fail(); |
| | | } |
| | | |
| | | @Override |
| | | public AjaxResult updateDeviceLedger(DeviceLedger deviceLedger) { |
| | | public R<?> updateDeviceLedger(DeviceLedger deviceLedger) { |
| | | if (this.updateById(deviceLedger)) { |
| | | return AjaxResult.success(); |
| | | return R.ok(); |
| | | } |
| | | return AjaxResult.error(); |
| | | return R.fail(); |
| | | } |
| | | |
| | | @Override |
| | |
| | | import com.ruoyi.device.service.IDeviceMaintenanceService; |
| | | import com.ruoyi.device.vo.DeviceMaintenanceVo; |
| | | import com.ruoyi.device.vo.DeviceRepairVo; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.measuringinstrumentledger.mapper.SparePartsMapper; |
| | | import com.ruoyi.measuringinstrumentledger.pojo.SpareParts; |
| | | import com.ruoyi.measuringinstrumentledger.pojo.SparePartsRequisitionRecord; |
| | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult saveDeviceRepair(DeviceMaintenanceDto deviceMaintenance) { |
| | | public R<?> saveDeviceRepair(DeviceMaintenanceDto deviceMaintenance) { |
| | | boolean save = this.save(deviceMaintenance); |
| | | if (save){ |
| | | // å¤çå¾çä¸ä¼ |
| | | fileUtil.saveStorageAttachmentByRecordTypeAndRecordId("file", RecordTypeEnum.DEVICE_MAINTENANCE, deviceMaintenance.getId(), deviceMaintenance.getStorageBlobDTOs()); |
| | | return AjaxResult.success(); |
| | | return R.ok(); |
| | | } |
| | | return AjaxResult.error(); |
| | | return R.fail(); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult updateDeviceDeviceMaintenance(DeviceMaintenanceDto deviceMaintenance) { |
| | | public R<?> updateDeviceDeviceMaintenance(DeviceMaintenanceDto deviceMaintenance) { |
| | | DeviceMaintenance oldDeviceMaintenance = this.getById(deviceMaintenance.getId()); |
| | | // å¤çå¤ä»¶ä½¿ç¨æ
åµ |
| | | if (com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(deviceMaintenance.getSparePartsUseList())) { |
| | |
| | | record.setQuantity(sparePartUse.getQuantity()); |
| | | sparePartsRequisitionRecordService.save(record); |
| | | } else { |
| | | return AjaxResult.error("å¤ä»¶ " + spareParts.getName() + " æ°éä¸è¶³"); |
| | | return R.fail("å¤ä»¶ " + spareParts.getName() + " æ°éä¸è¶³"); |
| | | } |
| | | } |
| | | } |
| | |
| | | if (this.updateById(deviceMaintenance)) { |
| | | // å¤çå¾çä¸ä¼ |
| | | fileUtil.saveStorageAttachmentByRecordTypeAndRecordId("file", RecordTypeEnum.DEVICE_MAINTENANCE, deviceMaintenance.getId(), deviceMaintenance.getStorageBlobDTOs()); |
| | | return AjaxResult.success(); |
| | | return R.ok(); |
| | | } |
| | | return AjaxResult.error(); |
| | | return R.fail(); |
| | | } |
| | | |
| | | @Override |
| | |
| | | import com.ruoyi.device.service.IDeviceLedgerService; |
| | | import com.ruoyi.device.service.IDeviceRepairService; |
| | | import com.ruoyi.device.vo.DeviceRepairVo; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.measuringinstrumentledger.mapper.SparePartsMapper; |
| | | import com.ruoyi.measuringinstrumentledger.pojo.SpareParts; |
| | | import com.ruoyi.measuringinstrumentledger.pojo.SparePartsRequisitionRecord; |
| | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult saveDeviceRepair(DeviceRepairDto deviceRepairDto) { |
| | | public R<?> saveDeviceRepair(DeviceRepairDto deviceRepairDto) { |
| | | DeviceLedger byId = deviceLedgerService.getById(deviceRepairDto.getDeviceLedgerId()); |
| | | deviceRepairDto.setDeviceName(byId.getDeviceName()); |
| | | deviceRepairDto.setDeviceModel(byId.getDeviceModel()); |
| | |
| | | if (save) { |
| | | // å¤çå¾çä¸ä¼ |
| | | fileUtil.saveStorageAttachmentByRecordTypeAndRecordId("file", RecordTypeEnum.DEVICE_REPAIR, deviceRepairDto.getId(), deviceRepairDto.getStorageBlobDTOs()); |
| | | return AjaxResult.success(); |
| | | return R.ok(); |
| | | } |
| | | return AjaxResult.error("ä¿å失败"); |
| | | return R.fail("ä¿å失败"); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult updateDeviceRepair(DeviceRepairDto deviceRepairDto) { |
| | | public R<?> updateDeviceRepair(DeviceRepairDto deviceRepairDto) { |
| | | DeviceRepair oldDeviceRepair = this.getById(deviceRepairDto.getId()); |
| | | if (oldDeviceRepair == null) { |
| | | return AjaxResult.error("æ¥ä¿®è®°å½ä¸åå¨"); |
| | | return R.fail("æ¥ä¿®è®°å½ä¸åå¨"); |
| | | } |
| | | if (deviceRepairDto.getStatus() != null |
| | | && deviceRepairDto.getStatus() == STATUS_COMPLETED |
| | | && (oldDeviceRepair.getStatus() == null |
| | | || oldDeviceRepair.getStatus() != STATUS_COMPLETED)) { |
| | | return AjaxResult.error("请å
æäº¤éªæ¶å®¡æ¹ï¼éªæ¶éè¿åæå¯å®ç»"); |
| | | return R.fail("请å
æäº¤éªæ¶å®¡æ¹ï¼éªæ¶éè¿åæå¯å®ç»"); |
| | | } |
| | | // å¤çå¤ä»¶ä½¿ç¨æ
åµ |
| | | if (CollectionUtils.isNotEmpty(deviceRepairDto.getSparePartsUseList())) { |
| | |
| | | record.setQuantity(sparePartUse.getQuantity()); |
| | | sparePartsRequisitionRecordService.save(record); |
| | | } else { |
| | | return AjaxResult.error("å¤ä»¶ " + spareParts.getName() + " æ°éä¸è¶³"); |
| | | return R.fail("å¤ä»¶ " + spareParts.getName() + " æ°éä¸è¶³"); |
| | | } |
| | | } |
| | | } |
| | |
| | | if (deviceRepairDto.getStorageBlobDTOs() != null) { |
| | | fileUtil.saveStorageAttachmentByRecordTypeAndRecordId("file", RecordTypeEnum.DEVICE_REPAIR, id, deviceRepairDto.getStorageBlobDTOs()); |
| | | } |
| | | return AjaxResult.success(); |
| | | return R.ok(); |
| | | } |
| | | return AjaxResult.error(); |
| | | return R.fail(); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult confirmRepair(DeviceRepairDto deviceRepairDto) { |
| | | public R<?> confirmRepair(DeviceRepairDto deviceRepairDto) { |
| | | DeviceRepair oldDeviceRepair = this.getById(deviceRepairDto.getId()); |
| | | if (oldDeviceRepair == null) { |
| | | return AjaxResult.error("æ¥ä¿®è®°å½ä¸åå¨"); |
| | | return R.fail("æ¥ä¿®è®°å½ä¸åå¨"); |
| | | } |
| | | if (oldDeviceRepair.getStatus() != null && oldDeviceRepair.getStatus() == STATUS_COMPLETED) { |
| | | return AjaxResult.error("该æ¥ä¿®å·²å®ç»ï¼ä¸è½éå¤ç¡®è®¤ç»´ä¿®"); |
| | | return R.fail("该æ¥ä¿®å·²å®ç»ï¼ä¸è½éå¤ç¡®è®¤ç»´ä¿®"); |
| | | } |
| | | if (oldDeviceRepair.getStatus() != null && oldDeviceRepair.getStatus() == STATUS_PENDING_ACCEPTANCE) { |
| | | return AjaxResult.error("该æ¥ä¿®å·²æäº¤éªæ¶å®¡æ¹"); |
| | | return R.fail("该æ¥ä¿®å·²æäº¤éªæ¶å®¡æ¹"); |
| | | } |
| | | deviceRepairDto.setStatus(STATUS_PENDING_ACCEPTANCE); |
| | | return updateDeviceRepair(deviceRepairDto); |
| | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult approveRepairAcceptance(DeviceRepairDto deviceRepairDto) { |
| | | public R<?> approveRepairAcceptance(DeviceRepairDto deviceRepairDto) { |
| | | if (deviceRepairDto.getId() == null) { |
| | | return AjaxResult.error("æ¥ä¿®è®°å½idä¸è½ä¸ºç©º"); |
| | | return R.fail("æ¥ä¿®è®°å½idä¸è½ä¸ºç©º"); |
| | | } |
| | | DeviceRepair oldDeviceRepair = this.getById(deviceRepairDto.getId()); |
| | | if (oldDeviceRepair == null) { |
| | | return AjaxResult.error("æ¥ä¿®è®°å½ä¸åå¨"); |
| | | return R.fail("æ¥ä¿®è®°å½ä¸åå¨"); |
| | | } |
| | | if (oldDeviceRepair.getStatus() == null || oldDeviceRepair.getStatus() != STATUS_PENDING_ACCEPTANCE) { |
| | | return AjaxResult.error("该æ¥ä¿®æªè¿å
¥å¾
éªæ¶ç¶æï¼ä¸è½å®¡æ¹"); |
| | | return R.fail("该æ¥ä¿®æªè¿å
¥å¾
éªæ¶ç¶æï¼ä¸è½å®¡æ¹"); |
| | | } |
| | | if (StringUtils.isBlank(deviceRepairDto.getAcceptanceName())) { |
| | | return AjaxResult.error("éªæ¶äººä¸è½ä¸ºç©º"); |
| | | return R.fail("éªæ¶äººä¸è½ä¸ºç©º"); |
| | | } |
| | | if (deviceRepairDto.getAcceptanceTime() == null) { |
| | | return AjaxResult.error("éªæ¶æ¶é´ä¸è½ä¸ºç©º"); |
| | | return R.fail("éªæ¶æ¶é´ä¸è½ä¸ºç©º"); |
| | | } |
| | | if (StringUtils.isBlank(deviceRepairDto.getAcceptanceRemark())) { |
| | | return AjaxResult.error("éªæ¶å¤æ³¨ä¸è½ä¸ºç©º"); |
| | | return R.fail("éªæ¶å¤æ³¨ä¸è½ä¸ºç©º"); |
| | | } |
| | | |
| | | DeviceRepair update = new DeviceRepair(); |
| | |
| | | update.setAcceptanceRemark(deviceRepairDto.getAcceptanceRemark()); |
| | | update.setStatus(STATUS_COMPLETED); |
| | | if (this.updateById(update)) { |
| | | return AjaxResult.success(); |
| | | return R.ok(); |
| | | } |
| | | return AjaxResult.error("éªæ¶å®¡æ¹å¤±è´¥"); |
| | | return R.fail("éªæ¶å®¡æ¹å¤±è´¥"); |
| | | } |
| | | |
| | | @Override |
| | |
| | | import com.ruoyi.device.mapper.MaintenanceTaskMapper; |
| | | import com.ruoyi.device.pojo.MaintenanceTask; |
| | | import com.ruoyi.device.service.MaintenanceTaskService; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.common.constant.HttpStatus; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.inspectiontask.pojo.TimingTask; |
| | | import com.ruoyi.inspectiontask.service.impl.TimingTaskServiceImpl; |
| | | import com.ruoyi.project.system.domain.SysUser; |
| | |
| | | private final MaintenanceTaskScheduler maintenanceTaskScheduler; |
| | | |
| | | @Override |
| | | public AjaxResult listPage(Page page, MaintenanceTask maintenanceTask) { |
| | | public R<?> listPage(Page page, MaintenanceTask maintenanceTask) { |
| | | Page<MaintenanceTask> taskPage = maintenanceTaskMapper.selectPage(page, null); |
| | | // 2. å¦ææ²¡ææ°æ®ï¼ç´æ¥è¿å空å页 |
| | | if (taskPage.getRecords().isEmpty()) { |
| | | return AjaxResult.success(taskPage); |
| | | return R.ok(taskPage); |
| | | } |
| | | |
| | | // 3. æ¶éææéè¦æ¥è¯¢çç¨æ·ID |
| | |
| | | task.setRegistrant(userNickNameMap.getOrDefault(task.getRegistrantId(), "æªç¥ç¨æ·")); |
| | | } |
| | | }); |
| | | return AjaxResult.success(taskPage); |
| | | return R.ok(taskPage); |
| | | } |
| | | |
| | | @Override |
| | | public AjaxResult add(MaintenanceTask maintenanceTask) { |
| | | public R<?> add(MaintenanceTask maintenanceTask) { |
| | | maintenanceTask.setActive(true); |
| | | // 计ç®é¦æ¬¡æ§è¡æ¶é´ |
| | | TimingTask task = new TimingTask(); |
| | |
| | | if (insert > 0) { |
| | | maintenanceTaskScheduler.scheduleMaintenanceTask(maintenanceTask); |
| | | } |
| | | return AjaxResult.success("æ·»å æå"); |
| | | return R.ok(null, "æ·»å æå"); |
| | | } |
| | | |
| | | @Override |
| | | public AjaxResult updateByMaintenanceTaskId(MaintenanceTask maintenanceTask) { |
| | | public R<?> updateByMaintenanceTaskId(MaintenanceTask maintenanceTask) { |
| | | MaintenanceTask maintenanceTask1 = maintenanceTaskMapper.selectById(maintenanceTask.getId()); |
| | | if (maintenanceTask1 == null) { |
| | | return AjaxResult.warn("æ²¡ææ¤æ°æ®"); |
| | | return R.fail(HttpStatus.WARN, "æ²¡ææ¤æ°æ®"); |
| | | } |
| | | BeanUtils.copyProperties(maintenanceTask, maintenanceTask1); |
| | | int update = maintenanceTaskMapper.updateById(maintenanceTask1); |
| | | if (update > 0) { |
| | | maintenanceTaskScheduler.rescheduleMaintenanceTask(maintenanceTask1); |
| | | } |
| | | return AjaxResult.success("æ´æ°æå"); |
| | | return R.ok(null, "æ´æ°æå"); |
| | | } |
| | | |
| | | @Override |
| | | public AjaxResult delete(List<Long> ids) { |
| | | public R<?> delete(List<Long> ids) { |
| | | int delete = maintenanceTaskMapper.deleteBatchIds(ids); |
| | | if (delete > 0) { |
| | | ids.forEach(id -> { |
| | | maintenanceTaskScheduler.unscheduleMaintenanceTask(id); |
| | | }); |
| | | } |
| | | return AjaxResult.success("å 餿å"); |
| | | return R.ok(null, "å 餿å"); |
| | | } |
| | | } |
| | |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import lombok.AllArgsConstructor; |
| | |
| | | @GetMapping("/listPage") |
| | | @Operation(summary = "ç¨çµåºå-å页æ¥è¯¢") |
| | | @Log(title = "ç¨çµåºå-å页æ¥è¯¢", businessType = BusinessType.OTHER) |
| | | public AjaxResult listPage(Page page, ElectricityConsumptionArea electricityConsumptionArea) { |
| | | public R<?> listPage(Page page, ElectricityConsumptionArea electricityConsumptionArea) { |
| | | IPage<ElectricityConsumptionArea> listPage = electricityConsumptionAreaService.listPage(page, electricityConsumptionArea); |
| | | return AjaxResult.success(listPage); |
| | | return R.ok(listPage); |
| | | } |
| | | |
| | | @PostMapping("/add") |
| | | @Operation(summary = "ç¨çµåºå-æ°å¢") |
| | | @Log(title = "ç¨çµåºå-æ°å¢", businessType = BusinessType.INSERT) |
| | | public AjaxResult add(@RequestBody ElectricityConsumptionArea electricityConsumptionArea) { |
| | | public R<?> add(@RequestBody ElectricityConsumptionArea electricityConsumptionArea) { |
| | | boolean save = electricityConsumptionAreaService.saveOrUpdate(electricityConsumptionArea); |
| | | return save ? AjaxResult.success() : AjaxResult.error(); |
| | | return save ? R.ok() : R.fail(); |
| | | } |
| | | |
| | | @DeleteMapping("/delete") |
| | | @Operation(summary = "ç¨çµåºå-å é¤") |
| | | @Log(title = "ç¨çµåºå-å é¤", businessType = BusinessType.DELETE) |
| | | public AjaxResult delete(@RequestBody List<Long> ids) { |
| | | if(CollectionUtils.isEmpty(ids)) return AjaxResult.error("è¯·éæ©è³å°ä¸æ¡æ°æ®"); |
| | | public R<?> delete(@RequestBody List<Long> ids) { |
| | | if(CollectionUtils.isEmpty(ids)) return R.fail("è¯·éæ©è³å°ä¸æ¡æ°æ®"); |
| | | boolean remove = electricityConsumptionAreaService.removeBatchByIds(ids); |
| | | return remove ? AjaxResult.success() : AjaxResult.error(); |
| | | return remove ? R.ok() : R.fail(); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | |
| | | @GetMapping("/listPage") |
| | | @Operation(summary = "ç¨çµæ¶æ®µ-å页æ¥è¯¢") |
| | | @Log(title = "ç¨çµæ¶æ®µ-å页æ¥è¯¢", businessType = BusinessType.OTHER) |
| | | public AjaxResult listPage(Page page, EnergyPeriod energyPeriod) { |
| | | public R<?> listPage(Page page, EnergyPeriod energyPeriod) { |
| | | IPage<EnergyPeriod> listPage = energyPeriodService.listPage(page, energyPeriod); |
| | | return AjaxResult.success(listPage); |
| | | return R.ok(listPage); |
| | | } |
| | | |
| | | @PostMapping("/add") |
| | | @Operation(summary = "ç¨çµæ¶æ®µ-æ°å¢") |
| | | @Log(title = "ç¨çµæ¶æ®µ-æ°å¢", businessType = BusinessType.INSERT) |
| | | public AjaxResult add(@RequestBody EnergyPeriod energyPeriod) { |
| | | public R<?> add(@RequestBody EnergyPeriod energyPeriod) { |
| | | boolean save = energyPeriodService.save(energyPeriod); |
| | | return save ? AjaxResult.success() : AjaxResult.error(); |
| | | return save ? R.ok() : R.fail(); |
| | | } |
| | | |
| | | @PostMapping("/addBatch") |
| | | @Operation(summary = "ç¨çµæ¶æ®µ-æ¹éæ°å¢") |
| | | @Log(title = "ç¨çµæ¶æ®µ-æ¹éæ°å¢", businessType = BusinessType.INSERT) |
| | | public AjaxResult addBatch(@RequestBody List<EnergyPeriod> energyPeriods) { |
| | | public R<?> addBatch(@RequestBody List<EnergyPeriod> energyPeriods) { |
| | | boolean save = energyPeriodService.saveBatch(energyPeriods); |
| | | return save ? AjaxResult.success() : AjaxResult.error(); |
| | | return save ? R.ok() : R.fail(); |
| | | } |
| | | |
| | | @PostMapping("/update") |
| | | @Operation(summary = "ç¨çµæ¶æ®µ-ä¿®æ¹") |
| | | @Log(title = "ç¨çµæ¶æ®µ-ä¿®æ¹", businessType = BusinessType.UPDATE) |
| | | public AjaxResult update(@RequestBody EnergyPeriod energyPeriod) { |
| | | public R<?> update(@RequestBody EnergyPeriod energyPeriod) { |
| | | boolean update = energyPeriodService.updateById(energyPeriod); |
| | | return update ? AjaxResult.success() : AjaxResult.error(); |
| | | return update ? R.ok() : R.fail(); |
| | | } |
| | | |
| | | @DeleteMapping("/delete") |
| | | @Operation(summary = "ç¨çµæ¶æ®µ-å é¤") |
| | | @Log(title = "ç¨çµæ¶æ®µ-å é¤", businessType = BusinessType.DELETE) |
| | | public AjaxResult delete(@RequestBody List<Long> ids) { |
| | | if (CollectionUtils.isEmpty(ids)) return AjaxResult.error("è¯·éæ©è³å°ä¸æ¡æ°æ®"); |
| | | public R<?> delete(@RequestBody List<Long> ids) { |
| | | if (CollectionUtils.isEmpty(ids)) return R.fail("è¯·éæ©è³å°ä¸æ¡æ°æ®"); |
| | | boolean remove = energyPeriodService.removeBatchByIds(ids); |
| | | return remove ? AjaxResult.success() : AjaxResult.error("å é¤å¤±è´¥"); |
| | | return remove ? R.ok() : R.fail("å é¤å¤±è´¥"); |
| | | } |
| | | |
| | | |
| | |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import lombok.AllArgsConstructor; |
| | |
| | | @GetMapping("/listPage") |
| | | @Operation(summary = "设å¤è½è-å页æ¥è¯¢") |
| | | @Log(title = "设å¤è½è-å页æ¥è¯¢", businessType = BusinessType.OTHER) |
| | | public AjaxResult listPage(Page page, EquipmentEnergyConsumption equipmentEnergyConsumption) { |
| | | public R<?> listPage(Page page, EquipmentEnergyConsumption equipmentEnergyConsumption) { |
| | | IPage<EquipmentEnergyConsumption> listPage = equipmentEnergyConsumptionService.listPage(page, equipmentEnergyConsumption); |
| | | return AjaxResult.success(listPage); |
| | | return R.ok(listPage); |
| | | } |
| | | |
| | | @GetMapping("/deviceList") |
| | | @Operation(summary = "设å¤å°è´¦-æ¥è¯¢") |
| | | @Log(title = "设å¤å°è´¦-æ¥è¯¢", businessType = BusinessType.OTHER) |
| | | public AjaxResult deviceList(DeviceLedger deviceLedger) { |
| | | public R<?> deviceList(DeviceLedger deviceLedger) { |
| | | List<DeviceLedger> listPage = equipmentEnergyConsumptionService.deviceList(deviceLedger); |
| | | return AjaxResult.success(listPage); |
| | | return R.ok(listPage); |
| | | } |
| | | |
| | | @PostMapping("/add") |
| | | @Operation(summary = "设å¤è½è-æ°å¢") |
| | | @Log(title = "设å¤è½è-æ°å¢", businessType = BusinessType.INSERT) |
| | | public AjaxResult add(@RequestBody EquipmentEnergyConsumption equipmentEnergyConsumption) { |
| | | public R<?> add(@RequestBody EquipmentEnergyConsumption equipmentEnergyConsumption) { |
| | | boolean save = equipmentEnergyConsumptionService.save(equipmentEnergyConsumption); |
| | | return save ? AjaxResult.success() : AjaxResult.error(); |
| | | return save ? R.ok() : R.fail(); |
| | | } |
| | | |
| | | @PostMapping("/addBatch") |
| | | @Operation(summary = "设å¤è½è-æ¹éæ°å¢") |
| | | @Log(title = "设å¤è½è-æ¹éæ°å¢", businessType = BusinessType.INSERT) |
| | | public AjaxResult addBatch(@RequestBody List<EquipmentEnergyConsumption> list) { |
| | | public R<?> addBatch(@RequestBody List<EquipmentEnergyConsumption> list) { |
| | | boolean save = equipmentEnergyConsumptionService.saveBatch(list); |
| | | return save ? AjaxResult.success() : AjaxResult.error(); |
| | | return save ? R.ok() : R.fail(); |
| | | } |
| | | |
| | | @PostMapping("/update") |
| | | @Operation(summary = "设å¤è½è-ä¿®æ¹") |
| | | @Log(title = "设å¤è½è-ä¿®æ¹", businessType = BusinessType.UPDATE) |
| | | public AjaxResult update(@RequestBody EquipmentEnergyConsumption equipmentEnergyConsumption) { |
| | | public R<?> update(@RequestBody EquipmentEnergyConsumption equipmentEnergyConsumption) { |
| | | boolean update = equipmentEnergyConsumptionService.updateById(equipmentEnergyConsumption); |
| | | return update ? AjaxResult.success() : AjaxResult.error(); |
| | | return update ? R.ok() : R.fail(); |
| | | } |
| | | |
| | | @DeleteMapping("/delete") |
| | | @Operation(summary = "设å¤è½è-å é¤") |
| | | @Log(title = "设å¤è½è-å é¤", businessType = BusinessType.DELETE) |
| | | public AjaxResult delete(@RequestBody List<Long> ids) { |
| | | if(CollectionUtils.isEmpty(ids)) return AjaxResult.error("è¯·éæ©è³å°ä¸æ¡æ°æ®"); |
| | | public R<?> delete(@RequestBody List<Long> ids) { |
| | | if(CollectionUtils.isEmpty(ids)) return R.fail("è¯·éæ©è³å°ä¸æ¡æ°æ®"); |
| | | boolean remove = equipmentEnergyConsumptionService.removeBatchByIds(ids); |
| | | return remove ? AjaxResult.success() : AjaxResult.error(); |
| | | return remove ? R.ok() : R.fail(); |
| | | } |
| | | |
| | | /** |
| | |
| | | @Log(title = "导å
¥è®¾å¤è½è", businessType = BusinessType.IMPORT) |
| | | @PostMapping("/importData") |
| | | @Operation(summary = "导å
¥è®¾å¤è½è") |
| | | public AjaxResult importData(MultipartFile file) throws Exception { |
| | | public R<?> importData(MultipartFile file) throws Exception { |
| | | return equipmentEnergyConsumptionService.importData(file); |
| | | } |
| | | |
| | |
| | | @GetMapping("/listPageByTrend") |
| | | @Operation(summary = "设å¤è½è-è½æºè¶å¿-å页æ¥è¯¢") |
| | | @Log(title = "设å¤è½è-è½æºè¶å¿-å页æ¥è¯¢", businessType = BusinessType.OTHER) |
| | | public AjaxResult listPageByTrend(Page page, EquipmentEnergyConsumption equipmentEnergyConsumption) { |
| | | public R<?> listPageByTrend(Page page, EquipmentEnergyConsumption equipmentEnergyConsumption) { |
| | | IPage<EquipmentEnergyConsumption> listPage = equipmentEnergyConsumptionService.listPageByTrend(page, equipmentEnergyConsumption); |
| | | return AjaxResult.success(listPage); |
| | | return R.ok(listPage); |
| | | } |
| | | |
| | | /** |
| | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.device.pojo.DeviceLedger; |
| | | import com.ruoyi.equipmentenergyconsumption.pojo.EquipmentEnergyConsumption; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.util.List; |
| | |
| | | |
| | | IPage<EquipmentEnergyConsumption> listPage(Page page, EquipmentEnergyConsumption equipmentEnergyConsumption); |
| | | |
| | | AjaxResult importData(MultipartFile file); |
| | | R<?> importData(MultipartFile file); |
| | | |
| | | IPage<EquipmentEnergyConsumption> listPageByTrend(Page page, EquipmentEnergyConsumption equipmentEnergyConsumption); |
| | | |
| | |
| | | import com.ruoyi.equipmentenergyconsumption.mapper.EquipmentEnergyConsumptionMapper; |
| | | import com.ruoyi.equipmentenergyconsumption.pojo.EquipmentEnergyConsumption; |
| | | import com.ruoyi.equipmentenergyconsumption.service.EquipmentEnergyConsumptionService; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.common.constant.HttpStatus; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public AjaxResult importData(MultipartFile file) { |
| | | public R<?> importData(MultipartFile file) { |
| | | try { |
| | | ExcelUtil<EquipmentEnergyConsumption> util = new ExcelUtil<EquipmentEnergyConsumption>(EquipmentEnergyConsumption.class); |
| | | List<EquipmentEnergyConsumption> userList = util.importExcel(file.getInputStream()); |
| | | if(CollectionUtils.isEmpty(userList)){ |
| | | return AjaxResult.warn("模æ¿é误æå¯¼å
¥æ°æ®ä¸ºç©º"); |
| | | return R.fail(HttpStatus.WARN, "模æ¿é误æå¯¼å
¥æ°æ®ä¸ºç©º"); |
| | | } |
| | | this.saveOrUpdateBatch(userList); |
| | | return AjaxResult.success(true); |
| | | return R.ok(true); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return AjaxResult.error("导å
¥å¤±è´¥"); |
| | | return R.fail("导å
¥å¤±è´¥"); |
| | | } |
| | | } |
| | | |
| | |
| | | import com.ruoyi.common.utils.StringUtils;
|
| | | import com.ruoyi.common.utils.sql.SqlUtil;
|
| | | import com.ruoyi.framework.security.LoginUser;
|
| | | import com.ruoyi.framework.web.domain.AjaxResult;
|
| | | import com.ruoyi.framework.web.domain.R;
|
| | | import com.ruoyi.framework.web.page.PageDomain;
|
| | | import com.ruoyi.framework.web.page.TableDataInfo;
|
| | | import com.ruoyi.framework.web.page.TableSupport;
|
| | |
| | | /**
|
| | | * è¿åæå
|
| | | */
|
| | | public AjaxResult success()
|
| | | public R<?> success()
|
| | | {
|
| | | return AjaxResult.success();
|
| | | return R.ok();
|
| | | }
|
| | |
|
| | | /**
|
| | | * è¿åæåæ¶æ¯
|
| | | */
|
| | | public AjaxResult success(String message)
|
| | | public R<?> success(String message)
|
| | | {
|
| | | return AjaxResult.success(message);
|
| | | return R.ok(null, message);
|
| | | }
|
| | |
|
| | | /**
|
| | | * è¿åæåæ¶æ¯
|
| | | */
|
| | | public AjaxResult success(Object data)
|
| | | public R<?> success(Object data)
|
| | | {
|
| | | return AjaxResult.success(data);
|
| | | return R.ok(data);
|
| | | }
|
| | |
|
| | | /**
|
| | | * è¿åå¤±è´¥æ¶æ¯
|
| | | */
|
| | | public AjaxResult error()
|
| | | public R<?> error()
|
| | | {
|
| | | return AjaxResult.error();
|
| | | return R.fail();
|
| | | }
|
| | |
|
| | | /**
|
| | | * è¿åå¤±è´¥æ¶æ¯
|
| | | */
|
| | | public AjaxResult error(String message)
|
| | | public R<?> error(String message)
|
| | | {
|
| | | return AjaxResult.error(message);
|
| | | return R.fail(message);
|
| | | }
|
| | |
|
| | | /**
|
| | | * è¿åè¦åæ¶æ¯
|
| | | */
|
| | | public AjaxResult warn(String message)
|
| | | public R<?> warn(String message)
|
| | | {
|
| | | return AjaxResult.warn(message);
|
| | | return R.fail(HttpStatus.WARN, message);
|
| | | }
|
| | |
|
| | | /**
|
| | | * ååºè¿åç»æ
|
| | | * |
| | | *
|
| | | * @param rows å½±åè¡æ°
|
| | | * @return æä½ç»æ
|
| | | */
|
| | | protected AjaxResult toAjax(int rows)
|
| | | protected R<?> toAjax(int rows)
|
| | | {
|
| | | return rows > 0 ? AjaxResult.success() : AjaxResult.error();
|
| | | return rows > 0 ? R.ok() : R.fail();
|
| | | }
|
| | |
|
| | | /**
|
| | | * ååºè¿åç»æ
|
| | | * |
| | | *
|
| | | * @param result ç»æ
|
| | | * @return æä½ç»æ
|
| | | */
|
| | | protected AjaxResult toAjax(boolean result)
|
| | | protected R<?> toAjax(boolean result)
|
| | | {
|
| | | return result ? success() : error();
|
| | | }
|
| | |
| | | package com.ruoyi.home.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.ruoyi.approve.pojo.ApproveProcess; |
| | | import com.ruoyi.device.mapper.DeviceLedgerMapper; |
| | | import com.ruoyi.device.mapper.DeviceRepairMapper; |
| | | import com.ruoyi.device.pojo.DeviceRepair; |
| | | import com.ruoyi.dto.MapDto; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.home.annotation.DefaultType; |
| | | import com.ruoyi.home.dto.*; |
| | | import com.ruoyi.home.service.HomeService; |
| | | import com.ruoyi.production.mapper.ProductionOrderMapper; |
| | | import com.ruoyi.production.mapper.ProductionProductOutputMapper; |
| | | import com.ruoyi.production.pojo.ProductionOrder; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import lombok.AllArgsConstructor; |
| | |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.text.ParseException; |
| | | import java.time.LocalDate; |
| | | import java.time.ZoneId; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.LinkedHashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * @author :yys |
| | |
| | | @Tag(name = "é¦é¡µç»è®¡") |
| | | @RequestMapping("/home") |
| | | @AllArgsConstructor |
| | | public class HomeController extends BaseController { |
| | | public class HomeController extends BaseController { |
| | | |
| | | private final HomeService homeService; |
| | | private final ProductionOrderMapper productionOrderMapper; |
| | | private final ProductionProductOutputMapper productionProductOutputMapper; |
| | | private final DeviceLedgerMapper deviceLedgerMapper; |
| | | private final DeviceRepairMapper deviceRepairMapper; |
| | | |
| | | private static final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); |
| | | private static final Integer ORDER_STATUS_WAIT = 1; |
| | | private static final Integer ORDER_STATUS_RUNNING = 2; |
| | | private static final Integer ORDER_STATUS_COMPLETED = 3; |
| | | private static final Integer ORDER_STATUS_PAUSED = 4; |
| | | |
| | | /********************************************************åºç¡ç±»*****************************************************/ |
| | | @GetMapping("/todos") |
| | | @Log(title = "å¾
åäºé¡¹", businessType = BusinessType.OTHER) |
| | | @Operation(summary = "å¾
åäºé¡¹") |
| | | public AjaxResult todos(ApproveProcess req) throws ParseException { |
| | | public R todos(ApproveProcess req) throws ParseException { |
| | | List<ApproveProcess> approveProcessList = homeService.todos(); |
| | | return AjaxResult.success(approveProcessList); |
| | | return R.ok(approveProcessList); |
| | | } |
| | | |
| | | @GetMapping("/approveAndDeviceTodos") |
| | | @Operation(summary = "审æ¹ååï¼è®¾å¤æ¥ä¿®å¾
åäºé¡¹") |
| | | public AjaxResult approveAndDeviceTodos(){ |
| | | public R approveAndDeviceTodos(){ |
| | | Map<String, Object> map = homeService.approveAndDeviceTodos(); |
| | | return AjaxResult.success(map); |
| | | return R.ok(map); |
| | | } |
| | | |
| | | @GetMapping("/noticesCount") |
| | | @Operation(summary = "æªè¿æçå
¬åæ°é") |
| | | public AjaxResult noticesCount(){ |
| | | public R noticesCount(){ |
| | | Long count = homeService.noticesCount(); |
| | | return AjaxResult.success(count); |
| | | return R.ok(count); |
| | | } |
| | | |
| | | @GetMapping("/deptStaffDistribution") |
| | | @Operation(summary = "åé¨é¨äººååå¸") |
| | | public AjaxResult deptStaffDistribution() { |
| | | public R deptStaffDistribution() { |
| | | DeptStaffDistributionDto dto = homeService.deptStaffDistribution(); |
| | | return AjaxResult.success(dto); |
| | | return R.ok(dto); |
| | | } |
| | | |
| | | @GetMapping("/summaryStatistics") |
| | | @Operation(summary = "åå·¥-客æ·-ä¾åºåæ»æ°") |
| | | public AjaxResult summaryStatistics() { |
| | | public R summaryStatistics() { |
| | | HomeSummaryDto homeSummaryDto = homeService.summaryStatistics(); |
| | | return AjaxResult.success(homeSummaryDto); |
| | | return R.ok(homeSummaryDto); |
| | | } |
| | | |
| | | /********************************************************è¥ééè´ç±»**************************************************/ |
| | | @GetMapping("/supplierPurchaseRanking") |
| | | @Operation(summary = "ä¾åºåéè´æå") |
| | | public AjaxResult supplierPurchaseRanking(@DefaultType Integer type) { |
| | | public R supplierPurchaseRanking(@DefaultType Integer type) { |
| | | List<SupplierPurchaseRankingDto> list = homeService.supplierPurchaseRanking(type); |
| | | return AjaxResult.success(list); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | @GetMapping("/customerRevenueAnalysis") |
| | | @Operation(summary = "客æ·è¥æ¶è´¡ç®æ°å¼åæ") |
| | | public AjaxResult customerRevenueAnalysis(Long customerId, @DefaultType Integer type) { |
| | | public R customerRevenueAnalysis(Long customerId, @DefaultType Integer type) { |
| | | CustomerRevenueAnalysisDto dto = homeService.customerRevenueAnalysis(customerId, type); |
| | | return AjaxResult.success(dto); |
| | | return R.ok(dto); |
| | | } |
| | | |
| | | @GetMapping("/customerContributionRanking") |
| | | @Operation(summary = "客æ·éé¢è´¡ç®æå") |
| | | public AjaxResult customerContributionRanking(@DefaultType Integer type) { |
| | | public R customerContributionRanking(@DefaultType Integer type) { |
| | | List<CustomerContributionRankingDto> list = homeService.customerContributionRanking(type); |
| | | return AjaxResult.success(list); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | @GetMapping("/productSalesAnalysis") |
| | | @Operation(summary = "å产åéå®éé¢åæ") |
| | | public AjaxResult productSalesAnalysis() { |
| | | public R productSalesAnalysis() { |
| | | List<MapDto> list = homeService.productSalesAnalysis(); |
| | | return AjaxResult.success(list); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | @GetMapping("/rawMaterialPurchaseAmountRatio") |
| | | @Operation(summary = "åææéè´éé¢å æ¯") |
| | | public AjaxResult rawMaterialPurchaseAmountRatio(){ |
| | | public R rawMaterialPurchaseAmountRatio(){ |
| | | List<MapDto> list = homeService.rawMaterialPurchaseAmountRatio(); |
| | | return AjaxResult.success(list); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | @GetMapping("/business") |
| | | @Log(title = "éå®-éè´-åºåæ°æ®", businessType = BusinessType.OTHER) |
| | | @Operation(summary = "éå®-éè´-åºåæ°æ®") |
| | | public AjaxResult business(HomeBusinessDto req) { |
| | | public R business(HomeBusinessDto req) { |
| | | HomeBusinessDto homeBusinessDto = homeService.business(); |
| | | return AjaxResult.success(homeBusinessDto); |
| | | return R.ok(homeBusinessDto); |
| | | } |
| | | |
| | | @GetMapping("/analysisCustomerContractAmounts") |
| | | @Log(title = "客æ·ååéé¢åæ", businessType = BusinessType.OTHER) |
| | | @Operation(summary = "客æ·ååéé¢åæ") |
| | | public AjaxResult analysisCustomerContractAmounts(AnalysisCustomerContractAmountsDto req) { |
| | | public R analysisCustomerContractAmounts(AnalysisCustomerContractAmountsDto req) { |
| | | AnalysisCustomerContractAmountsDto analysisCustomerContractAmounts = homeService.analysisCustomerContractAmounts(); |
| | | return AjaxResult.success(analysisCustomerContractAmounts); |
| | | return R.ok(analysisCustomerContractAmounts); |
| | | } |
| | | |
| | | /********************************************************ç产类*****************************************************/ |
| | | @GetMapping("/inputOutputAnalysis") |
| | | @Operation(summary = "æå
¥äº§åºåæ") |
| | | public AjaxResult inputOutputAnalysis(@DefaultType Integer type){ |
| | | public R inputOutputAnalysis(@DefaultType Integer type){ |
| | | List<InputOutputAnalysisDto> list = homeService.inputOutputAnalysis(type); |
| | | return AjaxResult.success(list); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | @GetMapping("/processOutputAnalysis") |
| | | @Operation(summary = "å·¥åºäº§åºåæ") |
| | | public AjaxResult processOutputAnalysis(@DefaultType Integer type){ |
| | | public R processOutputAnalysis(@DefaultType Integer type){ |
| | | List<MapDto> list = homeService.processOutputAnalysis(type); |
| | | return AjaxResult.success(list); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | @GetMapping("/workOrderEfficiencyAnalysis") |
| | | @Operation(summary = "å·¥åæ§è¡æçåæ") |
| | | public AjaxResult workOrderEfficiencyAnalysis(@DefaultType Integer type){ |
| | | public R workOrderEfficiencyAnalysis(@DefaultType Integer type){ |
| | | List<WorkOrderEfficiencyDto> list = homeService.workOrderEfficiencyAnalysis(type); |
| | | return AjaxResult.success(list); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | @GetMapping("/productionAccountingAnalysis") |
| | | @Operation(summary = "çäº§æ ¸ç®åæ") |
| | | public AjaxResult productionAccountingAnalysis(@DefaultType Integer type){ |
| | | public R productionAccountingAnalysis(@DefaultType Integer type){ |
| | | List<ProductionAccountingDto> list = homeService.productionAccountingAnalysis(type); |
| | | return AjaxResult.success(list); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | @GetMapping("/orderCount") |
| | | @Operation(summary = "è®¢åæ°") |
| | | public AjaxResult orderCount(){ |
| | | return AjaxResult.success(homeService.orderCount()); |
| | | public R orderCount(){ |
| | | return R.ok(homeService.orderCount()); |
| | | } |
| | | |
| | | @GetMapping("/progressStatistics") |
| | | @Operation(summary = "åç产订åç宿è¿åº¦ç»è®¡") |
| | | public AjaxResult progressStatistics(){ |
| | | public R progressStatistics(){ |
| | | ProductionProgressDto productionProgressDto = homeService.productionProgress(); |
| | | return AjaxResult.success(productionProgressDto); |
| | | return R.ok(productionProgressDto); |
| | | } |
| | | |
| | | @GetMapping("/workInProcessTurnover") |
| | | @Operation(summary = "å¨å¶åå¨è½¬æ
åµ") |
| | | public AjaxResult workInProcessTurnover(){ |
| | | public R workInProcessTurnover(){ |
| | | ProductionTurnoverDto productionTurnoverDto = homeService.workInProcessTurnover(); |
| | | return AjaxResult.success(productionTurnoverDto); |
| | | return R.ok(productionTurnoverDto); |
| | | } |
| | | |
| | | @GetMapping("/processDataProductionStatistics") |
| | | @Operation(summary = "å·¥åºæ°æ®ç产ç»è®¡æ°æ®") |
| | | public AjaxResult processDataProductionStatistics(@DefaultType Integer type,@RequestParam(required = false) List<Long> processIds) { |
| | | public R processDataProductionStatistics(@DefaultType Integer type,@RequestParam(required = false) List<Long> processIds) { |
| | | List<processDataProductionStatisticsDto> list = homeService.processDataProductionStatistics(type, processIds); |
| | | return AjaxResult.success(list); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | /********************************************************è´¨éç±»*****************************************************/ |
| | | @GetMapping("/productionOverview") |
| | | @Operation(summary = "Production Overview") |
| | | public R productionOverview() { |
| | | LocalDate today = LocalDate.now(); |
| | | Map<String, BigDecimal> totalStats = loadOutputStats(LocalDate.of(2000, 1, 1), today.plusDays(1)); |
| | | BigDecimal totalOutput = totalStats.get("quantity"); |
| | | BigDecimal totalScrap = totalStats.get("scrapQty"); |
| | | BigDecimal yieldRate = calcRate(totalOutput, totalOutput.add(totalScrap)); |
| | | |
| | | Map<String, Object> result = new LinkedHashMap<>(); |
| | | result.put("totalOutput", scale(totalOutput)); |
| | | result.put("totalScrap", scale(totalScrap)); |
| | | result.put("yieldRate", scale(yieldRate)); |
| | | return R.ok(result); |
| | | } |
| | | |
| | | @GetMapping("/productionRealtimeBoard") |
| | | @Operation(summary = "Production Realtime Board") |
| | | public R productionRealtimeBoard() { |
| | | LocalDate today = LocalDate.now(); |
| | | LocalDate yesterday = today.minusDays(1); |
| | | |
| | | BigDecimal todayDeviceOee = calcDeviceOee(today); |
| | | BigDecimal yesterdayDeviceOee = calcDeviceOee(yesterday); |
| | | |
| | | BigDecimal todayOrderAchievementRate = calcOrderAchievementRate(today); |
| | | BigDecimal yesterdayOrderAchievementRate = calcOrderAchievementRate(yesterday); |
| | | |
| | | BigDecimal todayDefectRate = calcDefectRate(today); |
| | | BigDecimal yesterdayDefectRate = calcDefectRate(yesterday); |
| | | |
| | | Map<String, Object> result = new LinkedHashMap<>(); |
| | | result.put("deviceOee", buildRealtimeMetric(todayDeviceOee, todayDeviceOee.subtract(yesterdayDeviceOee))); |
| | | result.put("orderAchievementRate", buildRealtimeMetric(todayOrderAchievementRate, todayOrderAchievementRate.subtract(yesterdayOrderAchievementRate))); |
| | | result.put("defectRate", buildRealtimeMetric(todayDefectRate, todayDefectRate.subtract(yesterdayDefectRate))); |
| | | return R.ok(result); |
| | | } |
| | | |
| | | @GetMapping("/productionOrderProgress") |
| | | @Operation(summary = "Production Order Progress") |
| | | public R productionOrderProgress(@RequestParam(defaultValue = "all") String tab, |
| | | @RequestParam(defaultValue = "1") Long pageNum, |
| | | @RequestParam(defaultValue = "10") Long pageSize) { |
| | | long safePageNum = pageNum == null || pageNum < 1 ? 1 : pageNum; |
| | | long safePageSize = pageSize == null || pageSize < 1 ? 10 : Math.min(pageSize, 50); |
| | | Integer status = resolveOrderStatus(tab); |
| | | long offset = (safePageNum - 1) * safePageSize; |
| | | List<Map<String, Object>> rawRows = productionOrderMapper.selectHomeOrderProgressPage(status, offset, safePageSize); |
| | | List<Map<String, Object>> records = new ArrayList<>(); |
| | | if (rawRows != null) { |
| | | for (Map<String, Object> rawRow : rawRows) { |
| | | records.add(buildOrderProgressRow(rawRow)); |
| | | } |
| | | } |
| | | |
| | | long inProgressCount = 0L; |
| | | long completedCount = 0L; |
| | | long pausedCount = 0L; |
| | | List<Map<String, Object>> statusCountRows = productionOrderMapper.countHomeOrderProgressByStatus(); |
| | | if (statusCountRows != null) { |
| | | for (Map<String, Object> countRow : statusCountRows) { |
| | | Integer statusKey = toInteger(countRow.get("status")); |
| | | long cnt = toLong(countRow.get("cnt")); |
| | | if (Objects.equals(statusKey, ORDER_STATUS_RUNNING)) { |
| | | inProgressCount = cnt; |
| | | } else if (Objects.equals(statusKey, ORDER_STATUS_COMPLETED)) { |
| | | completedCount = cnt; |
| | | } else if (Objects.equals(statusKey, ORDER_STATUS_PAUSED)) { |
| | | pausedCount = cnt; |
| | | } |
| | | } |
| | | } |
| | | |
| | | Map<String, Object> result = new LinkedHashMap<>(); |
| | | result.put("tab", tab); |
| | | result.put("total", toLong(productionOrderMapper.countHomeOrderProgress(status))); |
| | | result.put("pageNum", safePageNum); |
| | | result.put("pageSize", safePageSize); |
| | | result.put("inProgressCount", inProgressCount); |
| | | result.put("completedCount", completedCount); |
| | | result.put("pausedCount", pausedCount); |
| | | result.put("records", records); |
| | | return R.ok(result); |
| | | } |
| | | |
| | | @GetMapping("/todayProductionPlan") |
| | | @Operation(summary = "Today Production Plan") |
| | | public R todayProductionPlan(@RequestParam(defaultValue = "4") Long limit) { |
| | | long safeLimit = limit == null || limit < 1 ? 4 : Math.min(limit, 20); |
| | | List<Map<String, Object>> records = new ArrayList<>(); |
| | | List<Map<String, Object>> rawRows = productionOrderMapper.selectHomeTodayProductionPlan(safeLimit); |
| | | if (rawRows != null) { |
| | | for (Map<String, Object> rawRow : rawRows) { |
| | | Map<String, Object> row = new LinkedHashMap<>(); |
| | | Integer rowStatus = toInteger(rawRow.get("status")); |
| | | row.put("orderNo", rawRow.get("orderNo")); |
| | | row.put("productName", rawRow.get("productName")); |
| | | row.put("plannedQuantity", scale(toBigDecimal(rawRow.get("plannedQuantity")))); |
| | | row.put("dueDate", rawRow.get("dueDate")); |
| | | row.put("status", rowStatus); |
| | | row.put("statusLabel", mapOrderStatusLabel(rowStatus)); |
| | | records.add(row); |
| | | } |
| | | } |
| | | |
| | | Map<String, Object> result = new LinkedHashMap<>(); |
| | | result.put("total", toLong(productionOrderMapper.countHomeTodayProductionPlan())); |
| | | result.put("records", records); |
| | | return R.ok(result); |
| | | } |
| | | |
| | | @GetMapping("/rawMaterialDetection") |
| | | @Operation(summary = "åæææ£æµ") |
| | | public AjaxResult rawMaterialDetection(@DefaultType Integer type){ |
| | | return AjaxResult.success(homeService.rawMaterialDetection(type)); |
| | | public R rawMaterialDetection(@DefaultType Integer type){ |
| | | return R.ok(homeService.rawMaterialDetection(type)); |
| | | } |
| | | |
| | | @GetMapping("/processDetection") |
| | | @Operation(summary = "è¿ç¨æ£æµ") |
| | | public AjaxResult processDetection(@DefaultType Integer type){ |
| | | return AjaxResult.success(homeService.processDetection(type)); |
| | | public R processDetection(@DefaultType Integer type){ |
| | | return R.ok(homeService.processDetection(type)); |
| | | } |
| | | |
| | | @GetMapping("/factoryDetection") |
| | | @Operation(summary = "æååºåæ£æµ") |
| | | public AjaxResult factoryDetection(@DefaultType Integer type){ |
| | | return AjaxResult.success(homeService.factoryDetection(type)); |
| | | public R factoryDetection(@DefaultType Integer type){ |
| | | return R.ok(homeService.factoryDetection(type)); |
| | | } |
| | | |
| | | @GetMapping("/qualityInspectionCount") |
| | | @Operation(summary = "è´¨éæ£éªæ°é") |
| | | public AjaxResult qualityInspectionCount(){ |
| | | public R qualityInspectionCount(){ |
| | | QualityInspectionCountDto qualityInspectionCountDto = homeService.qualityInspectionCount(); |
| | | return AjaxResult.success(qualityInspectionCountDto); |
| | | return R.ok(qualityInspectionCountDto); |
| | | } |
| | | |
| | | @GetMapping("/nonComplianceWarning") |
| | | @Operation(summary = "ä¸åæ ¼é¢è¦") |
| | | public AjaxResult nonComplianceWarning(){ |
| | | public R nonComplianceWarning(){ |
| | | NonComplianceWarningDto nonComplianceWarningDto = homeService.nonComplianceWarning(); |
| | | return AjaxResult.success(nonComplianceWarningDto); |
| | | return R.ok(nonComplianceWarningDto); |
| | | } |
| | | |
| | | @GetMapping("/completedInspectionCount") |
| | | @Operation(summary = "宿æ£éªæ°") |
| | | public AjaxResult completedInspectionCount(){ |
| | | public R completedInspectionCount(){ |
| | | List<CompletedInspectionCountDto> list = homeService.completedInspectionCount(); |
| | | return AjaxResult.success(list); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | @GetMapping("/unqualifiedProductRanking") |
| | | @Operation(summary = "ä¸åæ ¼äº§åæå") |
| | | public AjaxResult unqualifiedProductRanking(){ |
| | | public R unqualifiedProductRanking(){ |
| | | List<UnqualifiedProductRankDto> list = homeService.unqualifiedProductRanking(); |
| | | return AjaxResult.success(list); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | @GetMapping("/unqualifiedProductProcessingAnalysis") |
| | | @Operation(summary = "ä¸åæ ¼æ£åå¤çåæ") |
| | | public AjaxResult unqualifiedProductProcessingAnalysis(){ |
| | | public R unqualifiedProductProcessingAnalysis(){ |
| | | List<MapDto> list = homeService.unqualifiedProductProcessingAnalysis(); |
| | | return AjaxResult.success(list); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | @GetMapping("/qualityStatistics") |
| | | @Log(title = "è´¨éåæ", businessType = BusinessType.OTHER) |
| | | @Operation(summary = "è´¨éåæ") |
| | | public AjaxResult qualityStatistics(QualityStatisticsDto req) { |
| | | public R qualityStatistics(QualityStatisticsDto req) { |
| | | QualityStatisticsDto qualityStatisticsDto = homeService.qualityStatistics(); |
| | | return AjaxResult.success(qualityStatisticsDto); |
| | | return R.ok(qualityStatisticsDto); |
| | | } |
| | | |
| | | @GetMapping("/qualityInspectionStatistics") |
| | | @Operation(summary = "è´¨éç»è®¡") |
| | | public AjaxResult qualityInspectionStatistics(@DefaultType Integer type) { |
| | | public R qualityInspectionStatistics(@DefaultType Integer type) { |
| | | QualityStatisticsDto dto = homeService.qualityInspectionStatistics(type); |
| | | return AjaxResult.success(dto); |
| | | return R.ok(dto); |
| | | } |
| | | |
| | | /********************************************************è´¢å¡ç±»*****************************************************/ |
| | | @GetMapping("/incomeExpenseAnalysis") |
| | | @Operation(summary = "æ¯æ¶å¯¹æ¯åæ") |
| | | public AjaxResult incomeExpenseAnalysis(@DefaultType Integer type) { |
| | | public R incomeExpenseAnalysis(@DefaultType Integer type) { |
| | | List<Map<String, Object>> result = homeService.incomeExpenseAnalysis(type); |
| | | return AjaxResult.success(result); |
| | | return R.ok(result); |
| | | } |
| | | |
| | | @GetMapping("/profitTrendAnalysis") |
| | | @Operation(summary = "婿¶¦è¶å¿åæ") |
| | | public AjaxResult profitTrendAnalysis(){ |
| | | public R profitTrendAnalysis(){ |
| | | List<MapDto> list = homeService.profitTrendAnalysis(); |
| | | return AjaxResult.success(list); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | @GetMapping("/expenseCompositionAnalysis") |
| | | @Operation(summary = "ææåæ") |
| | | public AjaxResult expenseCompositionAnalysis(@DefaultType Integer type) { |
| | | public R expenseCompositionAnalysis(@DefaultType Integer type) { |
| | | List<MapDto> list = homeService.expenseCompositionAnalysis(type); |
| | | return AjaxResult.success(list); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | @GetMapping("/monthlyIncome") |
| | | @Operation(summary = "æåº¦æ¶å
¥") |
| | | public AjaxResult monthlyIncome(){ |
| | | public R monthlyIncome(){ |
| | | MonthlyIncomeDto dto = homeService.monthlyIncome(); |
| | | return AjaxResult.success(dto); |
| | | return R.ok(dto); |
| | | } |
| | | |
| | | @GetMapping("/monthlyExpenditure") |
| | | @Operation(summary = "æåº¦æ¯åº") |
| | | public AjaxResult monthlyExpenditure(){ |
| | | public R monthlyExpenditure(){ |
| | | MonthlyExpenditureDto dto = homeService.monthlyExpenditure(); |
| | | return AjaxResult.success(dto); |
| | | return R.ok(dto); |
| | | } |
| | | |
| | | @GetMapping("/statisticsReceivablePayable") |
| | | @Log(title = "åºæ¶åºä»ç»è®¡", businessType = BusinessType.OTHER) |
| | | @Operation(summary = "åºæ¶åºä»ç»è®¡") |
| | | public AjaxResult statisticsReceivablePayable(StatisticsReceivablePayableDto req, @DefaultType Integer type ) { |
| | | public R statisticsReceivablePayable(StatisticsReceivablePayableDto req, @DefaultType Integer type ) { |
| | | StatisticsReceivablePayableDto statisticsReceivablePayable = homeService.statisticsReceivablePayable(type); |
| | | return AjaxResult.success(statisticsReceivablePayable); |
| | | return R.ok(statisticsReceivablePayable); |
| | | } |
| | | |
| | | /********************************************************ä»å¨ç±»*****************************************************/ |
| | | |
| | | @GetMapping("/productCategoryDistribution") |
| | | @Operation(summary = "产å大类åå¸") |
| | | public AjaxResult productCategoryDistribution() { |
| | | public R productCategoryDistribution() { |
| | | ProductCategoryDistributionDto dto = homeService.productCategoryDistribution(); |
| | | return AjaxResult.success(dto); |
| | | return R.ok(dto); |
| | | } |
| | | |
| | | @GetMapping("/salesPurchaseStorageProductCount") |
| | | @Operation(summary = "éå®-éè´-å¨åäº§åæ°") |
| | | public AjaxResult salesPurchaseStorageProductCount(){ |
| | | public R salesPurchaseStorageProductCount(){ |
| | | List<MapDto> list = homeService.salesPurchaseStorageProductCount(); |
| | | return AjaxResult.success(list); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | @GetMapping("/productInOutAnalysis") |
| | | @Operation(summary = "产ååºå
¥åºåæ") |
| | | public AjaxResult productInOutAnalysis(@DefaultType Integer type){ |
| | | public R productInOutAnalysis(@DefaultType Integer type){ |
| | | List<Map<String, Object>> result = homeService.productInOutAnalysis(type); |
| | | return AjaxResult.success(result); |
| | | return R.ok(result); |
| | | } |
| | | |
| | | @GetMapping("/productTurnoverDays") |
| | | @Operation(summary = "产åå¨è½¬å¤©æ°") |
| | | public AjaxResult productTurnoverDays(){ |
| | | public R productTurnoverDays(){ |
| | | List<MapDto> list = homeService.productTurnoverDays(); |
| | | return AjaxResult.success(list); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | private Map<String, Object> buildOrderProgressRow(Map<String, Object> rawRow) { |
| | | Map<String, Object> row = new LinkedHashMap<>(); |
| | | Integer rowStatus = toInteger(rawRow.get("status")); |
| | | row.put("orderNo", rawRow.get("orderNo")); |
| | | row.put("productName", rawRow.get("productName")); |
| | | row.put("plannedQuantity", scale(toBigDecimal(rawRow.get("plannedQuantity")))); |
| | | row.put("completedQuantity", scale(toBigDecimal(rawRow.get("completedQuantity")))); |
| | | row.put("completionRate", scale(toBigDecimal(rawRow.get("completionRate")))); |
| | | row.put("dueDate", rawRow.get("dueDate")); |
| | | row.put("status", rowStatus); |
| | | row.put("statusLabel", mapOrderStatusLabel(rowStatus)); |
| | | return row; |
| | | } |
| | | |
| | | private Integer resolveOrderStatus(String tab) { |
| | | if (tab == null) { |
| | | return null; |
| | | } |
| | | String normalized = tab.trim().toLowerCase(); |
| | | if ("inprogress".equals(normalized)) { |
| | | return ORDER_STATUS_RUNNING; |
| | | } |
| | | if ("completed".equals(normalized)) { |
| | | return ORDER_STATUS_COMPLETED; |
| | | } |
| | | if ("paused".equals(normalized)) { |
| | | return ORDER_STATUS_PAUSED; |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | private String mapOrderStatusLabel(Integer status) { |
| | | if (Objects.equals(status, ORDER_STATUS_WAIT)) { |
| | | return "å¾
å¼å§"; |
| | | } |
| | | if (Objects.equals(status, ORDER_STATUS_RUNNING)) { |
| | | return "è¿è¡ä¸"; |
| | | } |
| | | if (Objects.equals(status, ORDER_STATUS_COMPLETED)) { |
| | | return "已宿"; |
| | | } |
| | | if (Objects.equals(status, ORDER_STATUS_PAUSED)) { |
| | | return "å·²æå"; |
| | | } |
| | | return "æªç¥"; |
| | | } |
| | | |
| | | private Map<String, BigDecimal> loadOutputStats(LocalDate startDate, LocalDate endDateExclusive) { |
| | | String start = startDate.atStartOfDay().format(DATE_TIME_FORMATTER); |
| | | String end = endDateExclusive.atStartOfDay().format(DATE_TIME_FORMATTER); |
| | | |
| | | BigDecimal quantity = BigDecimal.ZERO; |
| | | BigDecimal scrapQty = BigDecimal.ZERO; |
| | | List<Map<String, Object>> rows = productionProductOutputMapper.selectDailyOutputStats(start, end); |
| | | if (rows != null) { |
| | | for (Map<String, Object> row : rows) { |
| | | quantity = quantity.add(toBigDecimal(row.get("quantity"))); |
| | | scrapQty = scrapQty.add(toBigDecimal(row.get("scrapQty"))); |
| | | } |
| | | } |
| | | |
| | | Map<String, BigDecimal> stats = new LinkedHashMap<>(); |
| | | stats.put("quantity", quantity); |
| | | stats.put("scrapQty", scrapQty); |
| | | return stats; |
| | | } |
| | | |
| | | private BigDecimal calcDeviceOee(LocalDate day) { |
| | | long totalDeviceCount = deviceLedgerMapper.selectCount(new LambdaQueryWrapper<>()); |
| | | if (totalDeviceCount <= 0) { |
| | | return BigDecimal.ZERO; |
| | | } |
| | | |
| | | Date start = Date.from(day.atStartOfDay(ZoneId.systemDefault()).toInstant()); |
| | | Date end = Date.from(day.plusDays(1).atStartOfDay(ZoneId.systemDefault()).toInstant()); |
| | | |
| | | List<DeviceRepair> repairList = deviceRepairMapper.selectList(new LambdaQueryWrapper<DeviceRepair>() |
| | | .select(DeviceRepair::getDeviceLedgerId) |
| | | .ge(DeviceRepair::getRepairTime, start) |
| | | .lt(DeviceRepair::getRepairTime, end) |
| | | .in(DeviceRepair::getStatus, 0, 3)); |
| | | |
| | | long repairingDeviceCount = repairList == null ? 0 : repairList.stream() |
| | | .map(DeviceRepair::getDeviceLedgerId) |
| | | .filter(Objects::nonNull) |
| | | .distinct() |
| | | .count(); |
| | | |
| | | long availableDeviceCount = Math.max(totalDeviceCount - repairingDeviceCount, 0); |
| | | return new BigDecimal(availableDeviceCount) |
| | | .multiply(new BigDecimal("100")) |
| | | .divide(new BigDecimal(totalDeviceCount), 2, RoundingMode.HALF_UP); |
| | | } |
| | | |
| | | private BigDecimal calcOrderAchievementRate(LocalDate day) { |
| | | List<ProductionOrder> orderList = productionOrderMapper.selectList(new LambdaQueryWrapper<ProductionOrder>() |
| | | .select(ProductionOrder::getQuantity, ProductionOrder::getCompleteQuantity) |
| | | .ge(ProductionOrder::getCreateTime, day.atStartOfDay()) |
| | | .lt(ProductionOrder::getCreateTime, day.plusDays(1).atStartOfDay()) |
| | | .ne(ProductionOrder::getStatus, ORDER_STATUS_PAUSED)); |
| | | |
| | | BigDecimal totalQuantity = BigDecimal.ZERO; |
| | | BigDecimal totalCompleteQuantity = BigDecimal.ZERO; |
| | | if (orderList != null) { |
| | | for (ProductionOrder order : orderList) { |
| | | totalQuantity = totalQuantity.add(zeroIfNull(order.getQuantity())); |
| | | totalCompleteQuantity = totalCompleteQuantity.add(zeroIfNull(order.getCompleteQuantity())); |
| | | } |
| | | } |
| | | return calcRate(totalCompleteQuantity, totalQuantity); |
| | | } |
| | | |
| | | private BigDecimal calcDefectRate(LocalDate day) { |
| | | Map<String, BigDecimal> stats = loadOutputStats(day, day.plusDays(1)); |
| | | BigDecimal quantity = stats.get("quantity"); |
| | | BigDecimal scrapQty = stats.get("scrapQty"); |
| | | return calcRate(scrapQty, quantity.add(scrapQty)); |
| | | } |
| | | |
| | | private Map<String, Object> buildRealtimeMetric(BigDecimal value, BigDecimal change) { |
| | | Map<String, Object> metric = new LinkedHashMap<>(); |
| | | metric.put("value", scale(value)); |
| | | metric.put("compareYesterday", scale(change)); |
| | | return metric; |
| | | } |
| | | |
| | | private BigDecimal calcRate(BigDecimal numerator, BigDecimal denominator) { |
| | | if (denominator == null || denominator.compareTo(BigDecimal.ZERO) <= 0) { |
| | | return BigDecimal.ZERO; |
| | | } |
| | | return zeroIfNull(numerator) |
| | | .multiply(new BigDecimal("100")) |
| | | .divide(denominator, 2, RoundingMode.HALF_UP); |
| | | } |
| | | |
| | | private BigDecimal toBigDecimal(Object value) { |
| | | if (value == null) { |
| | | return BigDecimal.ZERO; |
| | | } |
| | | if (value instanceof BigDecimal) { |
| | | return (BigDecimal) value; |
| | | } |
| | | if (value instanceof Number) { |
| | | return BigDecimal.valueOf(((Number) value).doubleValue()); |
| | | } |
| | | try { |
| | | return new BigDecimal(String.valueOf(value)); |
| | | } catch (Exception ex) { |
| | | return BigDecimal.ZERO; |
| | | } |
| | | } |
| | | |
| | | private Integer toInteger(Object value) { |
| | | if (value == null) { |
| | | return null; |
| | | } |
| | | if (value instanceof Integer) { |
| | | return (Integer) value; |
| | | } |
| | | if (value instanceof Number) { |
| | | return ((Number) value).intValue(); |
| | | } |
| | | try { |
| | | return Integer.valueOf(String.valueOf(value)); |
| | | } catch (Exception ex) { |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | private long toLong(Object value) { |
| | | if (value == null) { |
| | | return 0L; |
| | | } |
| | | if (value instanceof Long) { |
| | | return (Long) value; |
| | | } |
| | | if (value instanceof Number) { |
| | | return ((Number) value).longValue(); |
| | | } |
| | | try { |
| | | return Long.parseLong(String.valueOf(value)); |
| | | } catch (Exception ex) { |
| | | return 0L; |
| | | } |
| | | } |
| | | |
| | | private BigDecimal zeroIfNull(BigDecimal value) { |
| | | return value == null ? BigDecimal.ZERO : value; |
| | | } |
| | | |
| | | private BigDecimal scale(BigDecimal value) { |
| | | return zeroIfNull(value).setScale(2, RoundingMode.HALF_UP); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.lavorissue.dto.StatisticsLaborIssue; |
| | | import com.ruoyi.lavorissue.mapper.LavorIssueMapper; |
| | | import com.ruoyi.lavorissue.pojo.LaborIssue; |
| | |
| | | @GetMapping("/listPage") |
| | | @Log(title = "å³ä¿åæ¾-å页æ¥è¯¢", businessType = BusinessType.OTHER) |
| | | @Operation(summary = "å³ä¿åæ¾-å页æ¥è¯¢") |
| | | public AjaxResult listPage(Page page, LaborIssue laborIssue){ |
| | | public R<?> listPage(Page page, LaborIssue laborIssue){ |
| | | IPage<LaborIssue> listPage = laborIssueService.listPage(page, laborIssue); |
| | | return AjaxResult.success(listPage); |
| | | return R.ok(listPage); |
| | | } |
| | | |
| | | @GetMapping("/statisticsList") |
| | | @Log(title = "å³ä¿åæ¾-ç»è®¡æ¥è¯¢", businessType = BusinessType.OTHER) |
| | | @Operation(summary = "å³ä¿åæ¾-ç»è®¡æ¥è¯¢") |
| | | public AjaxResult statisticsList(LaborIssue laborIssue){ |
| | | public R<?> statisticsList(LaborIssue laborIssue){ |
| | | List<Map<String, Object>> listPage = laborIssueService.statisticsList(laborIssue); |
| | | return AjaxResult.success(listPage); |
| | | return R.ok(listPage); |
| | | } |
| | | |
| | | @PostMapping("/add") |
| | | @Log(title = "å³ä¿åæ¾-æ·»å ", businessType = BusinessType.INSERT) |
| | | @Operation(summary = "å³ä¿åæ¾-æ·»å ") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult add(@RequestBody LaborIssue laborIssue){ |
| | | public R<?> add(@RequestBody LaborIssue laborIssue){ |
| | | String today = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyyMMdd")); |
| | | StartAndEndDateDto dateTime = DailyRedisCounter.getDateTime(); |
| | | Long approveId = lavorIssueMapper.selectCount(new LambdaQueryWrapper<LaborIssue>() |
| | |
| | | laborIssue.setOrderNo(String.format("%03d", l + 1)); |
| | | } |
| | | boolean save = laborIssueService.save(laborIssue); |
| | | return save ? AjaxResult.success() : AjaxResult.error(); |
| | | return save ? R.ok() : R.fail(); |
| | | } |
| | | |
| | | @PostMapping("/update") |
| | | @Log(title = "å³ä¿åæ¾-ä¿®æ¹", businessType = BusinessType.UPDATE) |
| | | @Operation(summary = "å³ä¿åæ¾-ä¿®æ¹") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult update(@RequestBody LaborIssue laborIssue){ |
| | | public R<?> update(@RequestBody LaborIssue laborIssue){ |
| | | boolean update = laborIssueService.updateById(laborIssue); |
| | | return update ? AjaxResult.success() : AjaxResult.error(); |
| | | return update ? R.ok() : R.fail(); |
| | | } |
| | | |
| | | @DeleteMapping("/delete") |
| | | @Log(title = "å³ä¿åæ¾-å é¤", businessType = BusinessType.DELETE) |
| | | @Operation(summary = "å³ä¿åæ¾-å é¤") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult delete(@RequestBody List<Long> ids){ |
| | | public R<?> delete(@RequestBody List<Long> ids){ |
| | | boolean delete = laborIssueService.removeBatchByIds(ids); |
| | | return delete ? AjaxResult.success() : AjaxResult.error(); |
| | | return delete ? R.ok() : R.fail(); |
| | | } |
| | | |
| | | @GetMapping("/statistics") |
| | | @Operation(summary = "å³ä¿åæ¾-ç»è®¡") |
| | | public AjaxResult statistics(StatisticsLaborIssue req) throws Exception { |
| | | public R<?> statistics(StatisticsLaborIssue req) throws Exception { |
| | | StatisticsLaborIssue statisticsLaborIssue = laborIssueService.statistics(req); |
| | | return AjaxResult.success(statisticsLaborIssue); |
| | | return R.ok(statisticsLaborIssue); |
| | | } |
| | | |
| | | |
| | |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.measuringinstrumentledger.dto.MeasuringInstrumentLedgerDto; |
| | | import com.ruoyi.measuringinstrumentledger.mapper.MeasuringInstrumentLedgerRecordMapper; |
| | | import com.ruoyi.measuringinstrumentledger.pojo.MeasuringInstrumentLedger; |
| | |
| | | @GetMapping("/listPage") |
| | | @Operation(summary = "计éå¨å
·å°è´¦-å页æ¥è¯¢") |
| | | @Log(title = "计éå¨å
·å°è´¦-å页æ¥è¯¢", businessType = BusinessType.OTHER) |
| | | public AjaxResult listPage(Page page, MeasuringInstrumentLedger measuringInstrumentLedger) { |
| | | public R<?> listPage(Page page, MeasuringInstrumentLedger measuringInstrumentLedger) { |
| | | IPage<MeasuringInstrumentLedger> listPage = measuringInstrumentLedgerService.listPage(page, measuringInstrumentLedger); |
| | | return AjaxResult.success(listPage); |
| | | return R.ok(listPage); |
| | | } |
| | | |
| | | |
| | |
| | | @Operation(summary = "计éå¨å
·å°è´¦-æ°å¢") |
| | | @Log(title = "计éå¨å
·å°è´¦-æ°å¢", businessType = BusinessType.INSERT) |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult add(@RequestBody MeasuringInstrumentLedger measuringInstrumentLedger) throws IOException { |
| | | public R<?> add(@RequestBody MeasuringInstrumentLedger measuringInstrumentLedger) throws IOException { |
| | | boolean save = measuringInstrumentLedgerService.add(measuringInstrumentLedger); |
| | | if (save) { |
| | | return AjaxResult.success(); |
| | | return R.ok(); |
| | | } |
| | | return AjaxResult.error(); |
| | | return R.fail(); |
| | | } |
| | | |
| | | @PostMapping("/update") |
| | | @Operation(summary = "计éå¨å
·å°è´¦-ä¿®æ¹") |
| | | @Log(title = "计éå¨å
·å°è´¦-ä¿®æ¹", businessType = BusinessType.UPDATE) |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult update(@RequestBody MeasuringInstrumentLedger measuringInstrumentLedger) { |
| | | public R<?> update(@RequestBody MeasuringInstrumentLedger measuringInstrumentLedger) { |
| | | SysUser sysUser = sysUserMapper.selectUserById(measuringInstrumentLedger.getUserId()); |
| | | if (sysUser == null) { |
| | | return AjaxResult.error("ç¨æ·ä¸åå¨"); |
| | | return R.fail("ç¨æ·ä¸åå¨"); |
| | | } |
| | | measuringInstrumentLedger.setUserName(sysUser.getUserName()); |
| | | boolean update = measuringInstrumentLedgerService.updateById(measuringInstrumentLedger); |
| | | if (update) { |
| | | return AjaxResult.success(); |
| | | return R.ok(); |
| | | } |
| | | return AjaxResult.error(); |
| | | return R.fail(); |
| | | } |
| | | |
| | | @DeleteMapping("/delete") |
| | | @Operation(summary = "计éå¨å
·å°è´¦-å é¤") |
| | | @Log(title = "计éå¨å
·å°è´¦-å é¤", businessType = BusinessType.DELETE) |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult delete(@RequestBody List<Long> ids) { |
| | | if(CollectionUtils.isEmpty(ids)) return AjaxResult.error("è¯·éæ©è³å°ä¸æ¡æ°æ®"); |
| | | public R<?> delete(@RequestBody List<Long> ids) { |
| | | if(CollectionUtils.isEmpty(ids)) return R.fail("è¯·éæ©è³å°ä¸æ¡æ°æ®"); |
| | | for (Long id : ids) { |
| | | LambdaQueryWrapper<MeasuringInstrumentLedgerRecord> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(MeasuringInstrumentLedgerRecord::getMeasuringInstrumentLedgerId,id); |
| | | List<MeasuringInstrumentLedgerRecord> measuringInstrumentLedgerRecords = measuringInstrumentLedgerRecordMapper.selectList(queryWrapper); |
| | | if(!CollectionUtils.isEmpty(measuringInstrumentLedgerRecords)){ |
| | | return AjaxResult.error("请å
å é¤éä¸è®¡éå¨å
·å°è´¦ä¸çæææ£å®è®°å½"); |
| | | return R.fail("请å
å é¤éä¸è®¡éå¨å
·å°è´¦ä¸çæææ£å®è®°å½"); |
| | | } |
| | | } |
| | | boolean delete = measuringInstrumentLedgerService.removeBatchByIds(ids); |
| | | if (delete) { |
| | | return AjaxResult.success(); |
| | | return R.ok(); |
| | | } |
| | | return AjaxResult.error(); |
| | | return R.fail(); |
| | | } |
| | | |
| | | @PostMapping("/verifying") |
| | | @Operation(summary = "计éå¨å
·å°è´¦-æ£å®") |
| | | @Log(title = "计éå¨å
·å°è´¦-æ£å®", businessType = BusinessType.UPDATE) |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult verifying(@RequestBody MeasuringInstrumentLedgerDto measuringInstrumentLedger) throws IOException { |
| | | public R<?> verifying(@RequestBody MeasuringInstrumentLedgerDto measuringInstrumentLedger) throws IOException { |
| | | boolean update = measuringInstrumentLedgerService.verifying(measuringInstrumentLedger); |
| | | return update ? AjaxResult.success("æ£å®æå") : AjaxResult.error("æ£å®å¤±è´¥"); |
| | | return update ? R.ok(null, "æ£å®æå") : R.fail("æ£å®å¤±è´¥"); |
| | | } |
| | | |
| | | /** |
| | |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.measuringinstrumentledger.pojo.MeasuringInstrumentLedgerRecord; |
| | | import com.ruoyi.measuringinstrumentledger.service.MeasuringInstrumentLedgerRecordService; |
| | | import io.jsonwebtoken.lang.Collections; |
| | |
| | | @GetMapping("/listPage") |
| | | @Operation(summary = "计éå¨å
·å°è´¦è®°å½-å页æ¥è¯¢") |
| | | @Log(title = "计éå¨å
·å°è´¦è®°å½-å页æ¥è¯¢", businessType = BusinessType.OTHER) |
| | | public AjaxResult listPage(Page page, MeasuringInstrumentLedgerRecord measuringInstrumentLedgerRecord){ |
| | | public R<?> listPage(Page page, MeasuringInstrumentLedgerRecord measuringInstrumentLedgerRecord){ |
| | | IPage<MeasuringInstrumentLedgerRecord> listPage = measuringInstrumentLedgerRecordService.listPage(page, measuringInstrumentLedgerRecord); |
| | | return AjaxResult.success(listPage); |
| | | return R.ok(listPage); |
| | | } |
| | | |
| | | @PostMapping("/update") |
| | | @Operation(summary = "计éå¨å
·å°è´¦è®°å½-ä¿®æ¹") |
| | | @Log(title = "计éå¨å
·å°è´¦è®°å½-ä¿®æ¹", businessType = BusinessType.UPDATE) |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult update(@RequestBody MeasuringInstrumentLedgerRecord measuringInstrumentLedgerRecord) throws IOException { |
| | | public R<?> update(@RequestBody MeasuringInstrumentLedgerRecord measuringInstrumentLedgerRecord) throws IOException { |
| | | boolean update = measuringInstrumentLedgerRecordService.updateMeasuringInstrumentLedgerRecord(measuringInstrumentLedgerRecord); |
| | | if (update) { |
| | | return AjaxResult.success(); |
| | | return R.ok(); |
| | | } |
| | | return AjaxResult.error(); |
| | | return R.fail(); |
| | | } |
| | | |
| | | @DeleteMapping("/delete") |
| | | @Operation(summary = "计éå¨å
·å°è´¦è®°å½-å é¤") |
| | | @Log(title = "计éå¨å
·å°è´¦è®°å½-å é¤", businessType = BusinessType.DELETE) |
| | | public AjaxResult delete(@RequestBody List<Long> ids) { |
| | | if(Collections.isEmpty(ids)) return AjaxResult.error("è¯·éæ©è¦å é¤çæ°æ®"); |
| | | return AjaxResult.success(measuringInstrumentLedgerRecordService.removeBatchByIds(ids)); |
| | | public R<?> delete(@RequestBody List<Long> ids) { |
| | | if(Collections.isEmpty(ids)) return R.fail("è¯·éæ©è¦å é¤çæ°æ®"); |
| | | return R.ok(measuringInstrumentLedgerRecordService.removeBatchByIds(ids)); |
| | | } |
| | | |
| | | /** |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.measuringinstrumentledger.dto.SparePartsDto; |
| | | import com.ruoyi.measuringinstrumentledger.pojo.SpareParts; |
| | | import com.ruoyi.measuringinstrumentledger.service.SparePartsService; |
| | |
| | | @RequestMapping("/spareParts") |
| | | @Tag(name = "å¤ä»¶åç±»æ¥å£") |
| | | @AllArgsConstructor |
| | | public class SparePartsController { |
| | | public class SparePartsController extends BaseController { |
| | | private SparePartsService sparePartsService; |
| | | @GetMapping("/getTree") |
| | | @Operation(summary = "å¤ä»¶åç±»-æ ç»æ") |
| | | public AjaxResult getTree(){ |
| | | public R<?> getTree(){ |
| | | List<SparePartsDto> tree = sparePartsService.getTree(); |
| | | return AjaxResult.success(tree); |
| | | return R.ok(tree); |
| | | } |
| | | @GetMapping("/listPage") |
| | | @Operation(summary = "å¤ä»¶åç±»-å页æ¥è¯¢") |
| | | public AjaxResult listPage(Page page, SpareParts spareParts){ |
| | | public R<?> listPage(Page page, SpareParts spareParts){ |
| | | IPage<SparePartsDto> listPage = sparePartsService.listPage(page, spareParts); |
| | | return AjaxResult.success(listPage); |
| | | return R.ok(listPage); |
| | | } |
| | | // @GetMapping("/list") |
| | | // @Operation(summary = "å¤ä»¶åç±»-æ¥è¯¢ææ") |
| | |
| | | @PostMapping("/add") |
| | | @Operation(summary = "å¤ä»¶åç±»-æ·»å ") |
| | | @Log(title = "å¤ä»¶åç±»-æ·»å ", businessType = BusinessType.INSERT) |
| | | public AjaxResult add(@RequestBody SpareParts spareParts){ |
| | | return AjaxResult.success(sparePartsService.save(spareParts)); |
| | | public R<?> add(@RequestBody SpareParts spareParts){ |
| | | return R.ok(sparePartsService.save(spareParts)); |
| | | } |
| | | @PostMapping("/update") |
| | | @Operation(summary = "å¤ä»¶åç±»-æ´æ°") |
| | | @Log(title = "å¤ä»¶åç±»-æ´æ°", businessType = BusinessType.UPDATE) |
| | | public AjaxResult update(@RequestBody SpareParts spareParts){ |
| | | return AjaxResult.success(sparePartsService.updateById(spareParts)); |
| | | public R<?> update(@RequestBody SpareParts spareParts){ |
| | | return R.ok(sparePartsService.updateById(spareParts)); |
| | | } |
| | | @DeleteMapping("/delete/{id}") |
| | | @Operation(summary = "å¤ä»¶åç±»-å é¤") |
| | | @Log(title = "å¤ä»¶åç±»-å é¤", businessType = BusinessType.DELETE) |
| | | public AjaxResult delete(@PathVariable Long id){ |
| | | return AjaxResult.success(sparePartsService.removeById(id)); |
| | | public R<?> delete(@PathVariable Long id){ |
| | | return R.ok(sparePartsService.removeById(id)); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.measuringinstrumentledger.dto.SparePartsRequisitionRecordDto; |
| | | import com.ruoyi.measuringinstrumentledger.service.SparePartsRequisitionRecordService; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | |
| | | @RequestMapping("/sparePartsRequisitionRecord") |
| | | @Tag(name = "å¤ä»¶é¢ç¨è®°å½æ¥å£") |
| | | @AllArgsConstructor |
| | | public class SparePartsRequisitionRecordController { |
| | | public class SparePartsRequisitionRecordController extends BaseController { |
| | | private SparePartsRequisitionRecordService sparePartsRequisitionRecordService; |
| | | |
| | | @GetMapping("/listPage") |
| | | @Operation(summary = "å¤ä»¶åç±»-å页æ¥è¯¢") |
| | | public AjaxResult listPage(Page page, SparePartsRequisitionRecordDto sparePartsRequisitionRecordDto){ |
| | | public R<?> listPage(Page page, SparePartsRequisitionRecordDto sparePartsRequisitionRecordDto){ |
| | | IPage<SparePartsRequisitionRecordDto> listPage = sparePartsRequisitionRecordService.listPage(page, sparePartsRequisitionRecordDto); |
| | | return AjaxResult.success(listPage); |
| | | return R.ok(listPage); |
| | | } |
| | | } |
| | |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.officesupplies.pojo.OfficeSupplies; |
| | | import com.ruoyi.officesupplies.service.OfficeSuppliesService; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | |
| | | |
| | | @GetMapping("/listPage") |
| | | @Operation(summary = "åå
¬ç©èµ-å页æ¥è¯¢") |
| | | public AjaxResult listPage(Page page, OfficeSupplies officeSupplies) { |
| | | public R<?> listPage(Page page, OfficeSupplies officeSupplies) { |
| | | return officeSuppliesService.listPage(page, officeSupplies); |
| | | } |
| | | |
| | | @PostMapping("/add") |
| | | @Operation(summary = "åå
¬ç©èµ-æ·»å ") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult add(@RequestBody OfficeSupplies officeSupplies) { |
| | | public R<?> add(@RequestBody OfficeSupplies officeSupplies) { |
| | | // æç
§å½åæ¶é´yyyyMMdd + å½å¤©æ°å¢æ°é + 1çæç¼å· |
| | | // è·åå½å¤©æ°å¢æ°é |
| | | long count = officeSuppliesService.count(new LambdaQueryWrapper<OfficeSupplies>() |
| | |
| | | officeSupplies.setCode(code); |
| | | officeSupplies.setStatus(1); |
| | | officeSupplies.setApplyTime(new Date()); |
| | | return officeSuppliesService.save(officeSupplies) ? success() : error(); |
| | | return officeSuppliesService.save(officeSupplies) ? R.ok() : R.fail(); |
| | | } |
| | | |
| | | @PostMapping("/update") |
| | | @Operation(summary = "åå
¬ç©èµ-ä¿®æ¹") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult update(@RequestBody OfficeSupplies officeSupplies) { |
| | | return officeSuppliesService.updateById(officeSupplies) ? success() : error(); |
| | | public R<?> update(@RequestBody OfficeSupplies officeSupplies) { |
| | | return officeSuppliesService.updateById(officeSupplies) ? R.ok() : R.fail(); |
| | | } |
| | | |
| | | @DeleteMapping("/delete") |
| | | @Operation(summary = "åå
¬ç©èµ-å é¤") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult delete(@RequestBody List<Long> ids) { |
| | | if(CollectionUtils.isEmpty(ids)) return AjaxResult.error("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | return officeSuppliesService.removeBatchByIds(ids) ? success() : error(); |
| | | public R<?> delete(@RequestBody List<Long> ids) { |
| | | if(CollectionUtils.isEmpty(ids)) return R.fail("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | return officeSuppliesService.removeBatchByIds(ids) ? R.ok() : R.fail(); |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.officesupplies.pojo.OfficeSupplies; |
| | | |
| | | /** |
| | |
| | | * @param officeSupplies |
| | | * @return |
| | | */ |
| | | AjaxResult listPage(Page page, OfficeSupplies officeSupplies); |
| | | R<?> listPage(Page page, OfficeSupplies officeSupplies); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.officesupplies.mapper.OfficeSuppliesMapper; |
| | | import com.ruoyi.officesupplies.pojo.OfficeSupplies; |
| | | import com.ruoyi.officesupplies.service.OfficeSuppliesService; |
| | |
| | | private final OfficeSuppliesMapper officeSuppliesMapper; |
| | | |
| | | @Override |
| | | public AjaxResult listPage(Page page, OfficeSupplies officeSupplies) { |
| | | public R<?> listPage(Page page, OfficeSupplies officeSupplies) { |
| | | IPage<OfficeSupplies> list = officeSuppliesMapper.listPage(page, officeSupplies); |
| | | return AjaxResult.success(list); |
| | | return R.ok(list); |
| | | } |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.procurementrecord.pojo.GasTankWarning; |
| | | import com.ruoyi.procurementrecord.service.GasTankWarningService; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | |
| | | @RestController |
| | | @RequestMapping("/gasTankWarning") |
| | | @AllArgsConstructor |
| | | public class GasTankWarningController { |
| | | public class GasTankWarningController extends BaseController { |
| | | private GasTankWarningService gasTankWarningService; |
| | | |
| | | @GetMapping("/listPage") |
| | | public AjaxResult listPage(Page page, GasTankWarning gasTankWarning) { |
| | | return AjaxResult.success(gasTankWarningService.listPage(page, gasTankWarning)); |
| | | public R<?> listPage(Page page, GasTankWarning gasTankWarning) { |
| | | return R.ok(gasTankWarningService.listPage(page, gasTankWarning)); |
| | | } |
| | | |
| | | @PostMapping("/add") |
| | | public AjaxResult add(@RequestBody GasTankWarning gasTankWarning) { |
| | | return AjaxResult.success(gasTankWarningService.save(gasTankWarning)); |
| | | public R<?> add(@RequestBody GasTankWarning gasTankWarning) { |
| | | return R.ok(gasTankWarningService.save(gasTankWarning)); |
| | | } |
| | | |
| | | @PostMapping("update") |
| | | public AjaxResult update(@RequestBody GasTankWarning gasTankWarning) { |
| | | return AjaxResult.success(gasTankWarningService.updateById(gasTankWarning)); |
| | | public R<?> update(@RequestBody GasTankWarning gasTankWarning) { |
| | | return R.ok(gasTankWarningService.updateById(gasTankWarning)); |
| | | } |
| | | |
| | | @DeleteMapping("delete") |
| | | public AjaxResult delete(@RequestBody List<Long> ids) { |
| | | if (CollectionUtils.isEmpty(ids)) return AjaxResult.error("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | return AjaxResult.success(gasTankWarningService.removeByIds(ids)); |
| | | public R<?> delete(@RequestBody List<Long> ids) { |
| | | if (CollectionUtils.isEmpty(ids)) return R.fail("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | return R.ok(gasTankWarningService.removeByIds(ids)); |
| | | } |
| | | |
| | | //å¯¼åº |
| | |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.procurementrecord.pojo.InboundManagement; |
| | | import com.ruoyi.procurementrecord.service.InboundManagementService; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | |
| | | |
| | | @GetMapping("/listPage") |
| | | @Operation(summary = "å°è´§ç®¡ç-æ¥è¯¢") |
| | | public AjaxResult listPage(Page page, InboundManagement inboundManagement) { |
| | | public R<?> listPage(Page page, InboundManagement inboundManagement) { |
| | | IPage<InboundManagement> result = inboundManagementService.listPage(page, inboundManagement); |
| | | return AjaxResult.success(result); |
| | | return R.ok(result); |
| | | } |
| | | |
| | | @PostMapping("/add") |
| | | @Operation(summary = "å°è´§ç®¡ç-æ·»å ") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult add(@RequestBody InboundManagement inboundManagement) { |
| | | public R<?> add(@RequestBody InboundManagement inboundManagement) { |
| | | inboundManagement.setArrivalTime(new Date()); |
| | | boolean result = inboundManagementService.save(inboundManagement); |
| | | return result ? AjaxResult.success() : AjaxResult.error(); |
| | | return result ? R.ok() : R.fail(); |
| | | } |
| | | |
| | | @PostMapping("/update") |
| | | @Operation(summary = "å°è´§ç®¡ç-ä¿®æ¹") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult update(@RequestBody InboundManagement inboundManagement) { |
| | | public R<?> update(@RequestBody InboundManagement inboundManagement) { |
| | | boolean result = inboundManagementService.updateById(inboundManagement); |
| | | return result ? AjaxResult.success() : AjaxResult.error(); |
| | | return result ? R.ok() : R.fail(); |
| | | } |
| | | |
| | | @DeleteMapping("/del") |
| | | @Operation(summary = "å°è´§ç®¡ç-å é¤") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult del(@RequestBody List<Long> ids) { |
| | | if(CollectionUtils.isEmpty(ids)) return AjaxResult.error("è¯·éæ©è³å°ä¸æ¡æ°æ®"); |
| | | public R<?> del(@RequestBody List<Long> ids) { |
| | | if(CollectionUtils.isEmpty(ids)) return R.fail("è¯·éæ©è³å°ä¸æ¡æ°æ®"); |
| | | boolean result = inboundManagementService.removeByIds(ids); |
| | | return result ? AjaxResult.success() : AjaxResult.error(); |
| | | return result ? R.ok() : R.fail(); |
| | | } |
| | | |
| | | } |
| | |
| | | package com.ruoyi.procurementrecord.controller; |
| | | |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.procurementrecord.mapper.ProcurementExceptionRecordMapper; |
| | | import com.ruoyi.procurementrecord.pojo.ProcurementExceptionRecord; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | |
| | | |
| | | @PostMapping("/add") |
| | | @Transactional |
| | | public AjaxResult add(@RequestBody ProcurementExceptionRecord procurementExceptionRecord) { |
| | | return AjaxResult.success(procurementExceptionRecordMapper.insert(procurementExceptionRecord)); |
| | | public R<?> add(@RequestBody ProcurementExceptionRecord procurementExceptionRecord) { |
| | | return R.ok(procurementExceptionRecordMapper.insert(procurementExceptionRecord)); |
| | | } |
| | | |
| | | @PostMapping("/update") |
| | | @Transactional |
| | | public AjaxResult updatePro(@RequestBody ProcurementExceptionRecord procurementExceptionRecord) { |
| | | return AjaxResult.success(procurementExceptionRecordMapper.updateById(procurementExceptionRecord)); |
| | | public R<?> updatePro(@RequestBody ProcurementExceptionRecord procurementExceptionRecord) { |
| | | return R.ok(procurementExceptionRecordMapper.updateById(procurementExceptionRecord)); |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.procurementrecord.pojo.ProcurementPlan; |
| | | import com.ruoyi.procurementrecord.service.ProcurementPlanService; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | |
| | | |
| | | @RequestMapping("/listPage") |
| | | @Operation(summary = "éè´è®¡å-æ¥è¯¢") |
| | | public AjaxResult listPage(Page page, ProcurementPlan procurementPlan){ |
| | | public R<?> listPage(Page page, ProcurementPlan procurementPlan){ |
| | | IPage<ProcurementPlan> result = procurementPlanService.listPage(page, procurementPlan); |
| | | return AjaxResult.success(result); |
| | | return R.ok(result); |
| | | } |
| | | |
| | | @PostMapping("/add") |
| | | @Operation(summary = "éè´è®¡å-æ·»å ") |
| | | public AjaxResult add(@RequestBody ProcurementPlan procurementPlan){ |
| | | public R<?> add(@RequestBody ProcurementPlan procurementPlan){ |
| | | boolean result = procurementPlanService.save(procurementPlan); |
| | | return result ? AjaxResult.success() : AjaxResult.error(); |
| | | return result ? R.ok() : R.fail(); |
| | | } |
| | | |
| | | @PostMapping("/update") |
| | | @Operation(summary = "éè´è®¡å-ä¿®æ¹") |
| | | public AjaxResult update(@RequestBody ProcurementPlan procurementPlan){ |
| | | public R<?> update(@RequestBody ProcurementPlan procurementPlan){ |
| | | boolean result = procurementPlanService.updateById(procurementPlan); |
| | | return result ? AjaxResult.success() : AjaxResult.error(); |
| | | return result ? R.ok() : R.fail(); |
| | | } |
| | | |
| | | @DeleteMapping("/del") |
| | | @Operation(summary = "éè´è®¡å-å é¤") |
| | | public AjaxResult del(@RequestBody List<Long> ids){ |
| | | public R<?> del(@RequestBody List<Long> ids){ |
| | | boolean result = procurementPlanService.removeByIds(ids); |
| | | return result ? AjaxResult.success() : AjaxResult.error(); |
| | | return result ? R.ok() : R.fail(); |
| | | } |
| | | |
| | | /** |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.procurementrecord.pojo.ProcurementPriceManagement; |
| | | import com.ruoyi.procurementrecord.service.ProcurementPriceManagementService; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | |
| | | |
| | | @GetMapping("/listPage") |
| | | @Operation(summary = "éè´ä»·æ ¼ç®¡ç-æ¥è¯¢") |
| | | public AjaxResult listPage(Page page, ProcurementPriceManagement procurementPriceManagement){ |
| | | public R<?> listPage(Page page, ProcurementPriceManagement procurementPriceManagement){ |
| | | IPage<ProcurementPriceManagement> result = procurementPriceManagementService.listPage(page, procurementPriceManagement); |
| | | return AjaxResult.success(result); |
| | | return R.ok(result); |
| | | } |
| | | |
| | | @PostMapping("/add") |
| | | @Operation(summary = "éè´ä»·æ ¼ç®¡ç-æ·»å ") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult add(@RequestBody ProcurementPriceManagement procurementPriceManagement){ |
| | | public R<?> add(@RequestBody ProcurementPriceManagement procurementPriceManagement){ |
| | | boolean result = procurementPriceManagementService.save(procurementPriceManagement); |
| | | return result ? AjaxResult.success() : AjaxResult.error(); |
| | | return result ? R.ok() : R.fail(); |
| | | } |
| | | |
| | | @PostMapping("/update") |
| | | @Operation(summary = "éè´ä»·æ ¼ç®¡ç-ä¿®æ¹") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult update(@RequestBody ProcurementPriceManagement procurementPriceManagement){ |
| | | public R<?> update(@RequestBody ProcurementPriceManagement procurementPriceManagement){ |
| | | boolean result = procurementPriceManagementService.updateById(procurementPriceManagement); |
| | | return result ? AjaxResult.success() : AjaxResult.error(); |
| | | return result ? R.ok() : R.fail(); |
| | | } |
| | | |
| | | @DeleteMapping("/del") |
| | | @Operation(summary = "éè´ä»·æ ¼ç®¡ç-å é¤") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult delete(@RequestBody List<Long> ids){ |
| | | public R<?> delete(@RequestBody List<Long> ids){ |
| | | if (ids == null || ids.isEmpty()) { |
| | | return AjaxResult.error("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | return R.fail("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | } |
| | | boolean result = procurementPriceManagementService.removeByIds(ids); |
| | | return result ? AjaxResult.success() : AjaxResult.error(); |
| | | return result ? R.ok() : R.fail(); |
| | | } |
| | | |
| | | /** |
| | |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.procurementrecord.bean.dto.*; |
| | | import com.ruoyi.procurementrecord.mapper.CustomStorageMapper; |
| | | import com.ruoyi.procurementrecord.pojo.CustomStorage; |
| | |
| | | */ |
| | | @GetMapping("/getProcurementAmount") |
| | | @Operation(summary = "éè¿éå®äº§åidè·åå
¥åºæ°é") |
| | | public AjaxResult getProcurementAmount(@RequestParam("salesProductId") Long salesProductId) { |
| | | return AjaxResult.success(procurementRecordService.getProcurementAmount(salesProductId)); |
| | | public R<?> getProcurementAmount(@RequestParam("salesProductId") Long salesProductId) { |
| | | return R.ok(procurementRecordService.getProcurementAmount(salesProductId)); |
| | | } |
| | | |
| | | |
| | | @GetMapping("/productlist") |
| | | @Log(title = "éè´å
¥åº-å
¥åºç®¡ç-æ°å¢å
¥åºæ¥è¯¢", businessType = BusinessType.OTHER) |
| | | public AjaxResult list(ProcurementDto procurementDto) { |
| | | public R<?> list(ProcurementDto procurementDto) { |
| | | List<ProcurementDto> result = procurementRecordService.listProcurementBySalesLedgerId(procurementDto); |
| | | return AjaxResult.success(result); |
| | | return R.ok(result); |
| | | } |
| | | |
| | | @PostMapping("/add") |
| | | @Log(title = "éè´å
¥åº-å
¥åºç®¡ç-æ°å¢å
¥åº", businessType = BusinessType.INSERT) |
| | | @Transactional |
| | | public AjaxResult add(@RequestBody ProcurementAddDto procurementDto) { |
| | | public R<?> add(@RequestBody ProcurementAddDto procurementDto) { |
| | | procurementDto.setType(1); |
| | | procurementDto.setTypeName("éè´å
¥åº"); |
| | | return AjaxResult.success(procurementRecordService.add(procurementDto)); |
| | | return R.ok(procurementRecordService.add(procurementDto)); |
| | | } |
| | | |
| | | @PostMapping("/addCustom") |
| | | @Log(title = "èªå®ä¹å
¥åº-å
¥åºç®¡ç-æ°å¢å
¥åº", businessType = BusinessType.INSERT) |
| | | @Transactional |
| | | public AjaxResult addCustom(@RequestBody List<CustomStorage> customStorage) { |
| | | public R<?> addCustom(@RequestBody List<CustomStorage> customStorage) { |
| | | return procurementRecordService.addCustom(customStorage); |
| | | } |
| | | |
| | | @PostMapping("/updateCustom") |
| | | @Log(title = "èªå®ä¹å
¥åº-å
¥åºç®¡ç-ä¿®æ¹å
¥åº", businessType = BusinessType.UPDATE) |
| | | @Transactional |
| | | public AjaxResult updateCustom(@RequestBody CustomStorage customStorage) { |
| | | public R<?> updateCustom(@RequestBody CustomStorage customStorage) { |
| | | return procurementRecordService.updateCustom(customStorage); |
| | | } |
| | | |
| | | @Delete("/delteCustom") |
| | | @Log(title = "èªå®ä¹å
¥åº-å
¥åºç®¡ç-å é¤å
¥åº", businessType = BusinessType.DELETE) |
| | | @Transactional |
| | | public AjaxResult deleteCustom(@RequestBody List<Long> ids) { |
| | | public R<?> deleteCustom(@RequestBody List<Long> ids) { |
| | | return procurementRecordService.deleteCustom(ids); |
| | | } |
| | | |
| | | @PostMapping("/update") |
| | | @Log(title = "éè´å
¥åº-å
¥åºç®¡ç-ä¿®æ¹å
¥åº", businessType = BusinessType.UPDATE) |
| | | @Transactional |
| | | public AjaxResult updatePro(@RequestBody ProcurementUpdateDto procurementDto) { |
| | | return AjaxResult.success(procurementRecordService.updatePro(procurementDto)); |
| | | public R<?> updatePro(@RequestBody ProcurementUpdateDto procurementDto) { |
| | | return R.ok(procurementRecordService.updatePro(procurementDto)); |
| | | } |
| | | |
| | | @PostMapping("/updateManagement") |
| | | @Log(title = "æåå
¥åº-åºåå°è´¦-ä¿®æ¹", businessType = BusinessType.UPDATE) |
| | | @Transactional |
| | | public AjaxResult updateManagement(@RequestBody ProcurementManagementUpdateDto procurementDto) { |
| | | return AjaxResult.success(procurementRecordService.updateManagement(procurementDto)); |
| | | public R<?> updateManagement(@RequestBody ProcurementManagementUpdateDto procurementDto) { |
| | | return R.ok(procurementRecordService.updateManagement(procurementDto)); |
| | | } |
| | | |
| | | @PostMapping("/updateManagementByCustom") |
| | | @Log(title = "èªå®ä¹å
¥åº-åºåå°è´¦-ä¿®æ¹", businessType = BusinessType.UPDATE) |
| | | @Transactional |
| | | public AjaxResult updateManagementByCustom(@RequestBody ProcurementManagementUpdateDto procurementDto) { |
| | | return AjaxResult.success(procurementRecordService.updateManagementByCustom(procurementDto)); |
| | | public R<?> updateManagementByCustom(@RequestBody ProcurementManagementUpdateDto procurementDto) { |
| | | return R.ok(procurementRecordService.updateManagementByCustom(procurementDto)); |
| | | } |
| | | |
| | | @PostMapping("/del") |
| | | @Log(title = "éè´å
¥åº-å
¥åºç®¡ç-å é¤å
¥åº", businessType = BusinessType.DELETE) |
| | | @Transactional |
| | | public AjaxResult deletePro(@RequestBody ProcurementUpdateDto procurementDto) { |
| | | return AjaxResult.success(procurementRecordService.deletePro(procurementDto)); |
| | | public R<?> deletePro(@RequestBody ProcurementUpdateDto procurementDto) { |
| | | return R.ok(procurementRecordService.deletePro(procurementDto)); |
| | | } |
| | | |
| | | @GetMapping("/listPage") |
| | | @Log(title = "éè´å
¥åº-å
¥åºç®¡ç-å
¥åºæ¥è¯¢", businessType = BusinessType.OTHER) |
| | | @Operation(summary = "å
¥åºæ¥è¯¢") |
| | | public AjaxResult listPage(Page page, ProcurementPageDto procurementDto) { |
| | | public R<?> listPage(Page page, ProcurementPageDto procurementDto) { |
| | | IPage<ProcurementPageDto> result = procurementRecordService.listPage(page, procurementDto); |
| | | return AjaxResult.success(result); |
| | | return R.ok(result); |
| | | } |
| | | |
| | | @GetMapping("/listReport") |
| | | @Operation(summary = "æ¥è¯¢åºåå¾è¡¨æ°æ®") |
| | | public AjaxResult listReport() { |
| | | return AjaxResult.success(procurementRecordService.getReportList()); |
| | | public R<?> listReport() { |
| | | return R.ok(procurementRecordService.getReportList()); |
| | | } |
| | | |
| | | @GetMapping("/listPageByProduction") |
| | | @Log(title = "ç产å
¥åº-å
¥åºç®¡ç-å
¥åºæ¥è¯¢", businessType = BusinessType.OTHER) |
| | | @Operation(summary = "å
¥åºæ¥è¯¢") |
| | | public AjaxResult listPageByProduction(Page page, ProcurementPageDto procurementDto) { |
| | | public R<?> listPageByProduction(Page page, ProcurementPageDto procurementDto) { |
| | | IPage<ProcurementPageDto> result = procurementRecordService.listPageByProduction(page, procurementDto); |
| | | return AjaxResult.success(result); |
| | | return R.ok(result); |
| | | } |
| | | |
| | | @GetMapping("/listPageByProductProduction") |
| | | @Log(title = "ç产å
¥åº-å
¥åºç®¡ç-ç产å
¥åºæ¥è¯¢", businessType = BusinessType.OTHER) |
| | | @Operation(summary = "å
¥åºæ¥è¯¢") |
| | | public AjaxResult listPageByProductProduction(Page page, ProcurementPageDto procurementDto) { |
| | | public R<?> listPageByProductProduction(Page page, ProcurementPageDto procurementDto) { |
| | | IPage<ProcurementPageDto> result = procurementRecordService.listPageByProductProduction(page, procurementDto); |
| | | return AjaxResult.success(result); |
| | | return R.ok(result); |
| | | } |
| | | |
| | | @GetMapping("/listPageByCustom") |
| | | @Log(title = "èªå®ä¹å
¥åº-å
¥åºç®¡ç-å
¥åºæ¥è¯¢", businessType = BusinessType.OTHER) |
| | | @Operation(summary = "å
¥åºæ¥è¯¢") |
| | | public AjaxResult listPageByCustom(Page page, CustomStorage customStorage) { |
| | | public R<?> listPageByCustom(Page page, CustomStorage customStorage) { |
| | | IPage<CustomStorage> result = procurementRecordService.listPageByCustom(page, customStorage); |
| | | return AjaxResult.success(result); |
| | | return R.ok(result); |
| | | } |
| | | |
| | | @GetMapping("/listPageCopy") |
| | | @Log(title = "éè´å
¥åº-åºå管ç-å页æ¥è¯¢", businessType = BusinessType.OTHER) |
| | | public AjaxResult listPageCopy(Page page, ProcurementPageDto procurementDto) { |
| | | public R<?> listPageCopy(Page page, ProcurementPageDto procurementDto) { |
| | | IPage<ProcurementPageDtoCopy> result = procurementRecordService.listPageCopy(page, procurementDto); |
| | | return AjaxResult.success(result); |
| | | return R.ok(result); |
| | | } |
| | | |
| | | @GetMapping("/listPageCopyByProduction") |
| | | @Log(title = "ç产å
¥åº-åºå管ç-å页æ¥è¯¢", businessType = BusinessType.OTHER) |
| | | public AjaxResult listPageCopyByProduction(Page page, ProcurementPageDto procurementDto) { |
| | | public R<?> listPageCopyByProduction(Page page, ProcurementPageDto procurementDto) { |
| | | IPage<ProcurementPageDtoCopy> result = procurementRecordService.listPageCopyByProduction(page, procurementDto); |
| | | return AjaxResult.success(result); |
| | | return R.ok(result); |
| | | } |
| | | |
| | | @GetMapping("/listPageCopyByCustom") |
| | | @Log(title = "èªå®ä¹å
¥åº-åºå管ç-å页æ¥è¯¢", businessType = BusinessType.OTHER) |
| | | public AjaxResult listPageCopyByCustom(Page page, CustomStorage customStorage) { |
| | | public R<?> listPageCopyByCustom(Page page, CustomStorage customStorage) { |
| | | IPage<CustomStorage> result = procurementRecordService.listPageCopyByCustom(page, customStorage); |
| | | return AjaxResult.success(result); |
| | | return R.ok(result); |
| | | } |
| | | |
| | | @GetMapping("/getReportList") |
| | | @Log(title = "åºåæ¥è¡¨æ¥è¯¢", businessType = BusinessType.OTHER) |
| | | public AjaxResult getReportList(Page page, ProcurementPageDto procurementDto) { |
| | | return AjaxResult.success(procurementRecordService.getReportList(page, procurementDto)); |
| | | public R<?> getReportList(Page page, ProcurementPageDto procurementDto) { |
| | | return R.ok(procurementRecordService.getReportList(page, procurementDto)); |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | @GetMapping("/listPageProductionStock") |
| | | @Log(title = "åºå管ç-æååºå", businessType = BusinessType.OTHER) |
| | | public AjaxResult listPageProductionStock(Page page, ProcurementPageDto procurementDto) { |
| | | public R<?> listPageProductionStock(Page page, ProcurementPageDto procurementDto) { |
| | | IPage<ProductModel> result = procurementRecordService.listPageProductionStock(page, procurementDto); |
| | | return AjaxResult.success(result); |
| | | return R.ok(result); |
| | | } |
| | | } |
| | |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.procurementrecord.bean.dto.ProcurementRecordOutAdd; |
| | | import com.ruoyi.procurementrecord.bean.dto.ProcurementRecordOutPageDto; |
| | | import com.ruoyi.procurementrecord.bean.dto.ProcurementUpdateDto; |
| | |
| | | |
| | | @PostMapping("/stockout") |
| | | @Log(title = "éè´åºåº-åºåºç®¡ç-åºåº", businessType = BusinessType.INSERT) |
| | | public AjaxResult stockout(@RequestBody ProcurementRecordOutAdd procurementRecordOutAdd) { |
| | | return AjaxResult.success(procurementRecordOutService.stockout(procurementRecordOutAdd)); |
| | | public R<?> stockout(@RequestBody ProcurementRecordOutAdd procurementRecordOutAdd) { |
| | | return R.ok(procurementRecordOutService.stockout(procurementRecordOutAdd)); |
| | | } |
| | | |
| | | @GetMapping("/listPage") |
| | | @Log(title = "éè´åºåº-åºåºå°è´¦-åºåºæ¥è¯¢", businessType = BusinessType.OTHER) |
| | | public AjaxResult listPage(Page page, ProcurementRecordOutPageDto procurementDto) { |
| | | public R<?> listPage(Page page, ProcurementRecordOutPageDto procurementDto) { |
| | | IPage<ProcurementRecordOutPageDto> result = procurementRecordOutService.listPage(page, procurementDto); |
| | | return AjaxResult.success(result); |
| | | return R.ok(result); |
| | | } |
| | | |
| | | @GetMapping("/listPageByProduct") |
| | | @Log(title = "ç产åºåº-åºåºå°è´¦-åºåºæ¥è¯¢", businessType = BusinessType.OTHER) |
| | | public AjaxResult listPageByProduct(Page page, ProcurementRecordOutPageDto procurementDto) { |
| | | public R<?> listPageByProduct(Page page, ProcurementRecordOutPageDto procurementDto) { |
| | | IPage<ProcurementRecordOutPageDto> result = procurementRecordOutService.listPageByProduct(page, procurementDto); |
| | | return AjaxResult.success(result); |
| | | return R.ok(result); |
| | | } |
| | | |
| | | @GetMapping("/listPageBySemiProduct") |
| | | @Log(title = "ç产åºåº-åºåºå°è´¦-åºåºæ¥è¯¢", businessType = BusinessType.OTHER) |
| | | public AjaxResult listPageBySemiProduct(Page page, ProcurementRecordOutPageDto procurementDto) { |
| | | public R<?> listPageBySemiProduct(Page page, ProcurementRecordOutPageDto procurementDto) { |
| | | IPage<ProcurementRecordOutPageDto> result = procurementRecordOutService.listPageBySemiProduct(page, procurementDto); |
| | | return AjaxResult.success(result); |
| | | return R.ok(result); |
| | | } |
| | | |
| | | @GetMapping("/listPageByCustom") |
| | | @Log(title = "èªå®ä¹åºåº-åºåºå°è´¦-åºåºæ¥è¯¢", businessType = BusinessType.OTHER) |
| | | public AjaxResult listPageByCustom(Page page, ProcurementRecordOutPageDto procurementDto) { |
| | | public R<?> listPageByCustom(Page page, ProcurementRecordOutPageDto procurementDto) { |
| | | IPage<ProcurementRecordOutPageDto> result = procurementRecordOutService.listPageByCustom(page, procurementDto); |
| | | return AjaxResult.success(result); |
| | | return R.ok(result); |
| | | } |
| | | |
| | | @PostMapping("/del") |
| | | @Log(title = "éè´åºåº-åºåºå°è´¦-å é¤åºåº", businessType = BusinessType.DELETE) |
| | | public AjaxResult deletePro(@RequestBody ProcurementUpdateDto procurementDto) { |
| | | return AjaxResult.success(procurementRecordOutService.deletePro(procurementDto)); |
| | | public R<?> deletePro(@RequestBody ProcurementUpdateDto procurementDto) { |
| | | return R.ok(procurementRecordOutService.deletePro(procurementDto)); |
| | | } |
| | | |
| | | /** |
| | |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.procurementrecord.bean.dto.ReturnManagementDto; |
| | | import com.ruoyi.procurementrecord.bean.vo.ShippingInfoVo; |
| | | import com.ruoyi.procurementrecord.pojo.ReturnSaleProduct; |
| | |
| | | |
| | | @GetMapping("/listPage") |
| | | @Operation(summary = "éå®éè´§-æ¥è¯¢") |
| | | public AjaxResult listPage(Page page, ReturnManagementDto returnManagement) { |
| | | public R<?> listPage(Page page, ReturnManagementDto returnManagement) { |
| | | IPage<ReturnManagementDto> result = returnManagementService.listPage(page, returnManagement); |
| | | return AjaxResult.success(result); |
| | | return R.ok(result); |
| | | } |
| | | |
| | | @PostMapping("/add") |
| | | @Operation(summary = "éå®éè´§-æ·»å ") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult add(@RequestBody ReturnManagementDto returnManagementDto) { |
| | | return returnManagementService.addReturnManagementDto(returnManagementDto) ? success() : error(); |
| | | public R<?> add(@RequestBody ReturnManagementDto returnManagementDto) { |
| | | return returnManagementService.addReturnManagementDto(returnManagementDto) ? R.ok() : R.fail(); |
| | | } |
| | | |
| | | @PostMapping("/update") |
| | | @Operation(summary = "éå®éè´§-ä¿®æ¹") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult update(@RequestBody ReturnManagementDto returnManagementDto) { |
| | | return returnManagementService.updateReturnManagementDto(returnManagementDto) ? success() : error(); |
| | | public R<?> update(@RequestBody ReturnManagementDto returnManagementDto) { |
| | | return returnManagementService.updateReturnManagementDto(returnManagementDto) ? R.ok() : R.fail(); |
| | | } |
| | | |
| | | |
| | | @Operation(summary = "éå®éè´§-å¤çéè´§å") |
| | | @GetMapping("/handle") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult handle(Long returnManagementId) { |
| | | return returnManagementService.handle(returnManagementId) ? success() : error(); |
| | | public R<?> handle(Long returnManagementId) { |
| | | return returnManagementService.handle(returnManagementId) ? R.ok() : R.fail(); |
| | | } |
| | | |
| | | |
| | | @DeleteMapping("/del") |
| | | @Operation(summary = "éå®éè´§-å é¤") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult del(@RequestBody List<Long> ids) { |
| | | if (CollectionUtils.isEmpty(ids)) return error("è¯·éæ©è³å°ä¸æ¡æ°æ®"); |
| | | public R<?> del(@RequestBody List<Long> ids) { |
| | | if (CollectionUtils.isEmpty(ids)) return R.fail("è¯·éæ©è³å°ä¸æ¡æ°æ®"); |
| | | returnSaleProductService.remove(new QueryWrapper<ReturnSaleProduct>() |
| | | .lambda() |
| | | .in(ReturnSaleProduct::getReturnManagementId, ids)); |
| | | boolean result = returnManagementService.removeByIds(ids); |
| | | return result ? success() : error(); |
| | | return result ? R.ok() : R.fail(); |
| | | } |
| | | |
| | | @GetMapping("/getById") |
| | | @Operation(summary = "éå®éè´§-æ ¹æ®idæ¥è¯¢") |
| | | public AjaxResult getById(Long returnManagementId) { |
| | | public R<?> getById(Long returnManagementId) { |
| | | ReturnManagementDto returnManagementDto = returnManagementService.getReturnManagementDtoById(returnManagementId); |
| | | return success(returnManagementDto); |
| | | return R.ok(returnManagementDto); |
| | | } |
| | | |
| | | @GetMapping("/getByShippingId") |
| | | @Operation(summary = "éå®éè´§-æ ¹æ®åè´§åæ¥è¯¢éå®è®¢å以ååºåºç产åä¿¡æ¯") |
| | | public AjaxResult getByShippingId(Long shippingId) { |
| | | public R<?> getByShippingId(Long shippingId) { |
| | | ShippingInfoVo shippingInfoVo = returnManagementService.getReturnManagementDtoByShippingIdId(shippingId); |
| | | return success(shippingInfoVo); |
| | | return R.ok(shippingInfoVo); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.basic.pojo.ProductModel; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.procurementrecord.bean.dto.*; |
| | | import com.ruoyi.procurementrecord.pojo.CustomStorage; |
| | | import com.ruoyi.procurementrecord.pojo.ProcurementRecordStorage; |
| | |
| | | |
| | | IPage<ProcurementPageDto> listPageByProduction(Page page, ProcurementPageDto procurementDto); |
| | | |
| | | AjaxResult addCustom(List<CustomStorage> customStorage); |
| | | R<?> addCustom(List<CustomStorage> customStorage); |
| | | |
| | | IPage<CustomStorage> listPageByCustom(Page page, CustomStorage customStorage); |
| | | |
| | |
| | | |
| | | IPage<CustomStorage> listPageCopyByCustom(Page page, CustomStorage customStorage); |
| | | |
| | | AjaxResult updateCustom(CustomStorage customStorage); |
| | | R<?> updateCustom(CustomStorage customStorage); |
| | | |
| | | AjaxResult deleteCustom(List<Long> ids); |
| | | R<?> deleteCustom(List<Long> ids); |
| | | |
| | | int updateManagementByCustom(ProcurementManagementUpdateDto procurementDto); |
| | | |
| | |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.framework.security.LoginUser; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.procurementrecord.bean.dto.*; |
| | | import com.ruoyi.procurementrecord.mapper.CustomStorageMapper; |
| | | import com.ruoyi.procurementrecord.mapper.ProcurementRecordMapper; |
| | |
| | | private final CustomStorageMapper customStorageMapper; |
| | | |
| | | @Override |
| | | public AjaxResult addCustom(List<CustomStorage> customStorage) { |
| | | public R<?> addCustom(List<CustomStorage> customStorage) { |
| | | LoginUser loginUser = SecurityUtils.getLoginUser(); |
| | | if(CollectionUtils.isEmpty(customStorage)){ |
| | | return AjaxResult.error("æ°æ®ä¸è½ä¸ºç©º"); |
| | | return R.fail("æ°æ®ä¸è½ä¸ºç©º"); |
| | | } |
| | | customStorage.forEach(item -> { |
| | | // æ¥è¯¢éè´å
¥åºæ°é |
| | |
| | | item.setCode(OrderUtils.countTodayByCreateTime(customStorageMapper, "", "code")); |
| | | customStorageMapper.insert(item); |
| | | }); |
| | | return AjaxResult.success("èªå®ä¹å
¥åºæå"); |
| | | return R.ok(null, "èªå®ä¹å
¥åºæå"); |
| | | } |
| | | |
| | | @Override |
| | |
| | | } |
| | | |
| | | @Override |
| | | public AjaxResult updateCustom(CustomStorage customStorage) { |
| | | return AjaxResult.success(customStorageMapper.updateById(customStorage)); |
| | | public R<?> updateCustom(CustomStorage customStorage) { |
| | | return R.ok(customStorageMapper.updateById(customStorage)); |
| | | } |
| | | |
| | | @Override |
| | | public AjaxResult deleteCustom(List<Long> ids) { |
| | | return AjaxResult.success(customStorageMapper.deleteBatchIds(ids)); |
| | | public R<?> deleteCustom(List<Long> ids) { |
| | | return R.ok(customStorageMapper.deleteBatchIds(ids)); |
| | | } |
| | | |
| | | @Override |
| | |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | |
| | | Integer countPending(@Param("startDate") String startDate, @Param("endDate") String endDate); |
| | | |
| | | List<Map<String, Object>> selectHomeOrderProgressPage(@Param("status") Integer status, |
| | | @Param("offset") Long offset, |
| | | @Param("size") Long size); |
| | | |
| | | Long countHomeOrderProgress(@Param("status") Integer status); |
| | | |
| | | List<Map<String, Object>> countHomeOrderProgressByStatus(); |
| | | |
| | | List<Map<String, Object>> selectHomeTodayProductionPlan(@Param("size") Long size); |
| | | |
| | | Long countHomeTodayProductionPlan(); |
| | | |
| | | } |
| | |
| | | ProductionOrderBom orderBom, |
| | | List<ProductionBomStructure> structureList, |
| | | Long rootProductModelId) { |
| | | // éæ°æ¥è¯¢BOMç»æï¼æåèç¹ä¼å
æåº |
| | | List<ProductionBomStructure> routingStructureList = this.list( |
| | | Wrappers.<ProductionBomStructure>lambdaQuery() |
| | | .eq(ProductionBomStructure::getProductionOrderBomId, orderBom.getId()) |
| | | .orderByDesc(ProductionBomStructure::getParentId) |
| | | .orderByAsc(ProductionBomStructure::getId)); |
| | | |
| | | ProductionOrderRouting orderRouting = getOrCreateOrderRoutingSnapshot(productionOrderId, productionOrder, orderBom, rootProductModelId); |
| | | List<ProductionOrderRoutingOperation> desiredOperationList = buildDesiredRoutingOperationList(structureList, rootProductModelId); |
| | | List<ProductionOrderRoutingOperation> desiredOperationList = buildDesiredRoutingOperationList(routingStructureList, rootProductModelId); |
| | | List<ProductionOrderRoutingOperation> existingOperationList = productionOrderRoutingOperationMapper.selectList( |
| | | Wrappers.<ProductionOrderRoutingOperation>lambdaQuery() |
| | | .eq(ProductionOrderRoutingOperation::getOrderRoutingId, orderRouting.getId()) |
| | |
| | | if (matchedOperation == null) { |
| | | matchedOperation = insertRoutingOperationSnapshot(orderRouting.getId(), productionOrderId, desiredOperation); |
| | | } else { |
| | | updateRoutingOperationSnapshotIfNecessary(desiredOperation, orderRouting.getId(), productionOrderId, matchedOperation); |
| | | updateRoutingOperationSnapshotIfNecessary(matchedOperation, orderRouting.getId(), productionOrderId, desiredOperation); |
| | | } |
| | | finalOperationList.add(matchedOperation); |
| | | } |
| | |
| | | Map<Long, ProductionBomStructure> structureById = structureList.stream() |
| | | .filter(item -> item != null && item.getId() != null) |
| | | .collect(Collectors.toMap(ProductionBomStructure::getId, item -> item, (left, right) -> left)); |
| | | |
| | | // æå»ºç¶-åæ å°å
³ç³» |
| | | Map<Long, List<ProductionBomStructure>> treeMap = buildParentChildMap(structureList); |
| | | |
| | | // 使ç¨ååºéåæå»ºæä½å表ï¼å
ååç¶ï¼ç¡®ä¿å·¥èºè·¯çº¿é¡ºåºæ£ç¡®ï¼ |
| | | Map<String, ProductionBomStructure> uniqueOperationMap = new LinkedHashMap<>(); |
| | | for (ProductionBomStructure bomStructure : structureList) { |
| | | if (bomStructure == null || bomStructure.getTechnologyOperationId() == null) { |
| | | continue; |
| | | } |
| | | Long outputProductModelId = resolveOutputProductModelId(resolveOperationOutputNode(bomStructure, structureById), rootProductModelId); |
| | | uniqueOperationMap.putIfAbsent(buildBomOperationDedupKey(bomStructure, outputProductModelId), bomStructure); |
| | | } |
| | | buildOperationListPostOrder(null, treeMap, uniqueOperationMap, structureById, rootProductModelId); |
| | | |
| | | List<ProductionOrderRoutingOperation> desiredOperationList = new ArrayList<>(); |
| | | int dragSort = 1; |
| | | for (ProductionBomStructure bomStructure : uniqueOperationMap.values()) { |
| | |
| | | desiredOperationList.add(routingOperation); |
| | | } |
| | | return desiredOperationList; |
| | | } |
| | | |
| | | private Map<Long, List<ProductionBomStructure>> buildParentChildMap(List<ProductionBomStructure> structureList) { |
| | | Map<Long, List<ProductionBomStructure>> treeMap = new LinkedHashMap<>(); |
| | | Map<Long, Integer> childCountMap = new HashMap<>(); |
| | | |
| | | // 第ä¸éï¼ç»è®¡æ¯ä¸ªèç¹çåèç¹æ°éï¼åæ¶æå»ºåå§æ å° |
| | | for (ProductionBomStructure structure : structureList) { |
| | | if (structure == null) continue; |
| | | Long parentId = structure.getParentId(); |
| | | childCountMap.merge(parentId, 1, Integer::sum); // ç»è®¡æ¯ä¸ªç¶èç¹æå¤å°ä¸ªåèç¹ |
| | | treeMap.computeIfAbsent(parentId, k -> new ArrayList<>()).add(structure); |
| | | } |
| | | |
| | | // 第äºéï¼å¯¹æ¯ä¸ªç¶èç¹ä¸çåèç¹æåèç¹æ°éååºæåºï¼æåèç¹çä¼å
ï¼ |
| | | for (Map.Entry<Long, List<ProductionBomStructure>> entry : treeMap.entrySet()) { |
| | | List<ProductionBomStructure> children = entry.getValue(); |
| | | children.sort((a, b) -> { |
| | | int countA = childCountMap.getOrDefault(a.getId(), 0); |
| | | int countB = childCountMap.getOrDefault(b.getId(), 0); |
| | | return Integer.compare(countB, countA); // åèç¹å¤çæåé¢ |
| | | }); |
| | | } |
| | | |
| | | return treeMap; |
| | | } |
| | | |
| | | private void buildOperationListPostOrder(Long parentId, |
| | | Map<Long, List<ProductionBomStructure>> treeMap, |
| | | Map<String, ProductionBomStructure> uniqueOperationMap, |
| | | Map<Long, ProductionBomStructure> structureById, |
| | | Long rootProductModelId) { |
| | | List<ProductionBomStructure> children = treeMap.get(parentId); |
| | | if (children == null || children.isEmpty()) { |
| | | return; |
| | | } |
| | | for (ProductionBomStructure child : children) { |
| | | // å
éå½å¤çåèç¹ |
| | | buildOperationListPostOrder(child.getId(), treeMap, uniqueOperationMap, structureById, rootProductModelId); |
| | | |
| | | // åå¤çå½åèç¹ |
| | | if (child.getTechnologyOperationId() != null) { |
| | | Long outputProductModelId = resolveOutputProductModelId(resolveOperationOutputNode(child, structureById), rootProductModelId); |
| | | uniqueOperationMap.putIfAbsent(buildBomOperationDedupKey(child, outputProductModelId), child); |
| | | } |
| | | } |
| | | } |
| | | |
| | | private Map<String, Deque<ProductionOrderRoutingOperation>> buildExistingRoutingOperationBucketMap(List<ProductionOrderRoutingOperation> existingOperationList) { |
| | |
| | | if (!Objects.equals(currentOperation.getIsProduction(), desiredOperation.getIsProduction())) { |
| | | update.setIsProduction(desiredOperation.getIsProduction()); |
| | | currentOperation.setIsProduction(desiredOperation.getIsProduction()); |
| | | changed = true; |
| | | } |
| | | // æ´æ° dragSort åæ®µï¼ç¡®ä¿å·¥èºè·¯çº¿é¡ºåºæ£ç¡® |
| | | if (!Objects.equals(currentOperation.getDragSort(), desiredOperation.getDragSort())) { |
| | | update.setDragSort(desiredOperation.getDragSort()); |
| | | currentOperation.setDragSort(desiredOperation.getDragSort()); |
| | | changed = true; |
| | | } |
| | | if (!Objects.equals(currentOperation.getType(), desiredOperation.getType())) { |
| | |
| | | return; |
| | | } |
| | | for (ProductionBomStructureDto node : source) { |
| | | flattenTree(node.getChildren(), result); // å
é彿·»å åèç¹ |
| | | result.add(node); |
| | | flattenTree(node.getChildren(), result); |
| | | } |
| | | } |
| | | |
| | |
| | | package com.ruoyi.project.common;
|
| | |
|
| | | import com.google.code.kaptcha.Producer;
|
| | | import com.ruoyi.common.constant.CacheConstants;
|
| | | import com.ruoyi.common.constant.Constants;
|
| | | import com.ruoyi.common.utils.sign.Base64;
|
| | | import com.ruoyi.common.utils.uuid.IdUtils;
|
| | | import com.ruoyi.framework.redis.RedisCache;
|
| | | import com.ruoyi.framework.web.domain.AjaxResult;
|
| | | import com.ruoyi.project.system.service.ISysConfigService;
|
| | | import jakarta.annotation.Resource;
|
| | | import jakarta.servlet.http.HttpServletResponse;
|
| | | import lombok.RequiredArgsConstructor;
|
| | | import org.springframework.beans.factory.annotation.Value;
|
| | | import org.springframework.util.FastByteArrayOutputStream;
|
| | | import org.springframework.web.bind.annotation.GetMapping;
|
| | | import org.springframework.web.bind.annotation.RestController;
|
| | |
|
| | | import javax.imageio.ImageIO;
|
| | | import java.awt.image.BufferedImage;
|
| | | import java.io.IOException;
|
| | | import java.util.concurrent.TimeUnit;
|
| | |
|
| | | /**
|
| | | * éªè¯ç æä½å¤ç
|
| | | * |
| | | * @author ruoyi
|
| | | */
|
| | | @RestController
|
| | | @RequiredArgsConstructor
|
| | | public class CaptchaController
|
| | | {
|
| | | @Resource(name = "captchaProducer")
|
| | | private Producer captchaProducer;
|
| | |
|
| | | @Resource(name = "captchaProducerMath")
|
| | | private Producer captchaProducerMath;
|
| | |
|
| | | private final RedisCache redisCache;
|
| | | |
| | | // éªè¯ç ç±»å
|
| | | @Value("${ruoyi.captchaType}")
|
| | | private String captchaType;
|
| | | |
| | | private final ISysConfigService configService;
|
| | |
|
| | | /**
|
| | | * çæéªè¯ç
|
| | | */
|
| | | @GetMapping("/captchaImage")
|
| | | public AjaxResult getCode(HttpServletResponse response) throws IOException
|
| | | {
|
| | | AjaxResult ajax = AjaxResult.success();
|
| | | boolean captchaEnabled = configService.selectCaptchaEnabled();
|
| | | ajax.put("captchaEnabled", captchaEnabled);
|
| | | if (!captchaEnabled)
|
| | | {
|
| | | return ajax;
|
| | | }
|
| | |
|
| | | // ä¿åéªè¯ç ä¿¡æ¯
|
| | | String uuid = IdUtils.simpleUUID();
|
| | | String verifyKey = CacheConstants.CAPTCHA_CODE_KEY + uuid;
|
| | |
|
| | | String capStr = null, code = null;
|
| | | BufferedImage image = null;
|
| | |
|
| | | // çæéªè¯ç
|
| | | if ("math".equals(captchaType))
|
| | | {
|
| | | String capText = captchaProducerMath.createText();
|
| | | capStr = capText.substring(0, capText.lastIndexOf("@"));
|
| | | code = capText.substring(capText.lastIndexOf("@") + 1);
|
| | | image = captchaProducerMath.createImage(capStr);
|
| | | }
|
| | | else if ("char".equals(captchaType))
|
| | | {
|
| | | capStr = code = captchaProducer.createText();
|
| | | image = captchaProducer.createImage(capStr);
|
| | | }
|
| | |
|
| | | redisCache.setCacheObject(verifyKey, code, Constants.CAPTCHA_EXPIRATION, TimeUnit.MINUTES);
|
| | | // è½¬æ¢æµä¿¡æ¯ååº
|
| | | FastByteArrayOutputStream os = new FastByteArrayOutputStream();
|
| | | try
|
| | | {
|
| | | ImageIO.write(image, "jpg", os);
|
| | | }
|
| | | catch (IOException e)
|
| | | {
|
| | | return AjaxResult.error(e.getMessage());
|
| | | }
|
| | |
|
| | | ajax.put("uuid", uuid);
|
| | | ajax.put("img", Base64.encode(os.toByteArray()));
|
| | | return ajax;
|
| | | }
|
| | | }
|
| | | package com.ruoyi.project.common; |
| | | |
| | | import com.google.code.kaptcha.Producer; |
| | | import com.ruoyi.common.constant.CacheConstants; |
| | | import com.ruoyi.common.constant.Constants; |
| | | import com.ruoyi.common.utils.sign.Base64; |
| | | import com.ruoyi.common.utils.uuid.IdUtils; |
| | | import com.ruoyi.framework.redis.RedisCache; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.project.system.service.ISysConfigService; |
| | | import jakarta.annotation.Resource; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.util.FastByteArrayOutputStream; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.imageio.ImageIO; |
| | | import java.awt.image.BufferedImage; |
| | | import java.io.IOException; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | /** |
| | | * éªè¯ç æä½å¤ç |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @RequiredArgsConstructor |
| | | public class CaptchaController |
| | | { |
| | | @Resource(name = "captchaProducer") |
| | | private Producer captchaProducer; |
| | | |
| | | @Resource(name = "captchaProducerMath") |
| | | private Producer captchaProducerMath; |
| | | |
| | | private final RedisCache redisCache; |
| | | |
| | | // éªè¯ç ç±»å |
| | | @Value("${ruoyi.captchaType}") |
| | | private String captchaType; |
| | | |
| | | private final ISysConfigService configService; |
| | | |
| | | /** |
| | | * çæéªè¯ç |
| | | */ |
| | | @GetMapping("/captchaImage") |
| | | public R<?> getCode(HttpServletResponse response) throws IOException |
| | | { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | boolean captchaEnabled = configService.selectCaptchaEnabled(); |
| | | map.put("captchaEnabled", captchaEnabled); |
| | | if (!captchaEnabled) |
| | | { |
| | | return R.ok(map); |
| | | } |
| | | |
| | | // ä¿åéªè¯ç ä¿¡æ¯ |
| | | String uuid = IdUtils.simpleUUID(); |
| | | String verifyKey = CacheConstants.CAPTCHA_CODE_KEY + uuid; |
| | | |
| | | String capStr = null, code = null; |
| | | BufferedImage image = null; |
| | | |
| | | // çæéªè¯ç |
| | | if ("math".equals(captchaType)) |
| | | { |
| | | String capText = captchaProducerMath.createText(); |
| | | capStr = capText.substring(0, capText.lastIndexOf("@")); |
| | | code = capText.substring(capText.lastIndexOf("@") + 1); |
| | | image = captchaProducerMath.createImage(capStr); |
| | | } |
| | | else if ("char".equals(captchaType)) |
| | | { |
| | | capStr = code = captchaProducer.createText(); |
| | | image = captchaProducer.createImage(capStr); |
| | | } |
| | | |
| | | redisCache.setCacheObject(verifyKey, code, Constants.CAPTCHA_EXPIRATION, TimeUnit.MINUTES); |
| | | // è½¬æ¢æµä¿¡æ¯ååº |
| | | FastByteArrayOutputStream os = new FastByteArrayOutputStream(); |
| | | try |
| | | { |
| | | ImageIO.write(image, "jpg", os); |
| | | } |
| | | catch (IOException e) |
| | | { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | |
| | | map.put("uuid", uuid); |
| | | map.put("img", Base64.encode(os.toByteArray())); |
| | | return R.ok(map); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.project.monitor.controller;
|
| | |
|
| | | import com.ruoyi.common.constant.CacheConstants;
|
| | | import com.ruoyi.common.utils.StringUtils;
|
| | | import com.ruoyi.framework.web.domain.AjaxResult;
|
| | | import com.ruoyi.project.monitor.domain.SysCache;
|
| | | import lombok.AllArgsConstructor;
|
| | | import org.springframework.data.redis.core.RedisCallback;
|
| | | import org.springframework.data.redis.core.RedisTemplate;
|
| | | import org.springframework.security.access.prepost.PreAuthorize;
|
| | | import org.springframework.web.bind.annotation.*;
|
| | |
|
| | | import java.util.*;
|
| | |
|
| | | /**
|
| | | * ç¼åçæ§
|
| | | * |
| | | * @author ruoyi
|
| | | */
|
| | | @RestController
|
| | | @RequestMapping("/monitor/cache")
|
| | | @AllArgsConstructor
|
| | | public class CacheController
|
| | | {
|
| | | private RedisTemplate<String, String> redisTemplate;
|
| | |
|
| | | private final static List<SysCache> caches = new ArrayList<SysCache>();
|
| | | {
|
| | | caches.add(new SysCache(CacheConstants.LOGIN_TOKEN_KEY, "ç¨æ·ä¿¡æ¯"));
|
| | | caches.add(new SysCache(CacheConstants.SYS_CONFIG_KEY, "é
置信æ¯"));
|
| | | caches.add(new SysCache(CacheConstants.SYS_DICT_KEY, "æ°æ®åå
¸"));
|
| | | caches.add(new SysCache(CacheConstants.CAPTCHA_CODE_KEY, "éªè¯ç "));
|
| | | caches.add(new SysCache(CacheConstants.REPEAT_SUBMIT_KEY, "é²éæäº¤"));
|
| | | caches.add(new SysCache(CacheConstants.RATE_LIMIT_KEY, "éæµå¤ç"));
|
| | | caches.add(new SysCache(CacheConstants.PWD_ERR_CNT_KEY, "å¯ç é误次æ°"));
|
| | | }
|
| | |
|
| | | @PreAuthorize("@ss.hasPermi('monitor:cache:list')")
|
| | | @GetMapping()
|
| | | public AjaxResult getInfo() throws Exception
|
| | | {
|
| | | Properties info = (Properties) redisTemplate.execute((RedisCallback<Object>) connection -> connection.info());
|
| | | Properties commandStats = (Properties) redisTemplate.execute((RedisCallback<Object>) connection -> connection.info("commandstats"));
|
| | | Object dbSize = redisTemplate.execute((RedisCallback<Object>) connection -> connection.dbSize());
|
| | |
|
| | | Map<String, Object> result = new HashMap<>(3);
|
| | | result.put("info", info);
|
| | | result.put("dbSize", dbSize);
|
| | |
|
| | | List<Map<String, String>> pieList = new ArrayList<>();
|
| | | commandStats.stringPropertyNames().forEach(key -> {
|
| | | Map<String, String> data = new HashMap<>(2);
|
| | | String property = commandStats.getProperty(key);
|
| | | data.put("name", StringUtils.removeStart(key, "cmdstat_"));
|
| | | data.put("value", StringUtils.substringBetween(property, "calls=", ",usec"));
|
| | | pieList.add(data);
|
| | | });
|
| | | result.put("commandStats", pieList);
|
| | | return AjaxResult.success(result);
|
| | | }
|
| | |
|
| | | @PreAuthorize("@ss.hasPermi('monitor:cache:list')")
|
| | | @GetMapping("/getNames")
|
| | | public AjaxResult cache()
|
| | | {
|
| | | return AjaxResult.success(caches);
|
| | | }
|
| | |
|
| | | @PreAuthorize("@ss.hasPermi('monitor:cache:list')")
|
| | | @GetMapping("/getKeys/{cacheName}")
|
| | | public AjaxResult getCacheKeys(@PathVariable String cacheName)
|
| | | {
|
| | | Set<String> cacheKeys = redisTemplate.keys(cacheName + "*");
|
| | | return AjaxResult.success(new TreeSet<>(cacheKeys));
|
| | | }
|
| | |
|
| | | @PreAuthorize("@ss.hasPermi('monitor:cache:list')")
|
| | | @GetMapping("/getValue/{cacheName}/{cacheKey}")
|
| | | public AjaxResult getCacheValue(@PathVariable String cacheName, @PathVariable String cacheKey)
|
| | | {
|
| | | String cacheValue = redisTemplate.opsForValue().get(cacheKey);
|
| | | SysCache sysCache = new SysCache(cacheName, cacheKey, cacheValue);
|
| | | return AjaxResult.success(sysCache);
|
| | | }
|
| | |
|
| | | @PreAuthorize("@ss.hasPermi('monitor:cache:list')")
|
| | | @DeleteMapping("/clearCacheName/{cacheName}")
|
| | | public AjaxResult clearCacheName(@PathVariable String cacheName)
|
| | | {
|
| | | Collection<String> cacheKeys = redisTemplate.keys(cacheName + "*");
|
| | | redisTemplate.delete(cacheKeys);
|
| | | return AjaxResult.success();
|
| | | }
|
| | |
|
| | | @PreAuthorize("@ss.hasPermi('monitor:cache:list')")
|
| | | @DeleteMapping("/clearCacheKey/{cacheKey}")
|
| | | public AjaxResult clearCacheKey(@PathVariable String cacheKey)
|
| | | {
|
| | | redisTemplate.delete(cacheKey);
|
| | | return AjaxResult.success();
|
| | | }
|
| | |
|
| | | @PreAuthorize("@ss.hasPermi('monitor:cache:list')")
|
| | | @DeleteMapping("/clearCacheAll")
|
| | | public AjaxResult clearCacheAll()
|
| | | {
|
| | | Collection<String> cacheKeys = redisTemplate.keys("*");
|
| | | redisTemplate.delete(cacheKeys);
|
| | | return AjaxResult.success();
|
| | | }
|
| | | }
|
| | | package com.ruoyi.project.monitor.controller; |
| | | |
| | | import com.ruoyi.common.constant.CacheConstants; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.project.monitor.domain.SysCache; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.data.redis.core.RedisCallback; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * ç¼åçæ§ |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/monitor/cache") |
| | | @AllArgsConstructor |
| | | public class CacheController extends BaseController |
| | | { |
| | | private RedisTemplate<String, String> redisTemplate; |
| | | |
| | | private final static List<SysCache> caches = new ArrayList<SysCache>(); |
| | | { |
| | | caches.add(new SysCache(CacheConstants.LOGIN_TOKEN_KEY, "ç¨æ·ä¿¡æ¯")); |
| | | caches.add(new SysCache(CacheConstants.SYS_CONFIG_KEY, "é
置信æ¯")); |
| | | caches.add(new SysCache(CacheConstants.SYS_DICT_KEY, "æ°æ®åå
¸")); |
| | | caches.add(new SysCache(CacheConstants.CAPTCHA_CODE_KEY, "éªè¯ç ")); |
| | | caches.add(new SysCache(CacheConstants.REPEAT_SUBMIT_KEY, "é²éæäº¤")); |
| | | caches.add(new SysCache(CacheConstants.RATE_LIMIT_KEY, "éæµå¤ç")); |
| | | caches.add(new SysCache(CacheConstants.PWD_ERR_CNT_KEY, "å¯ç é误次æ°")); |
| | | } |
| | | |
| | | @PreAuthorize("@ss.hasPermi('monitor:cache:list')") |
| | | @GetMapping() |
| | | public R<?> getInfo() throws Exception |
| | | { |
| | | Properties info = (Properties) redisTemplate.execute((RedisCallback<Object>) connection -> connection.info()); |
| | | Properties commandStats = (Properties) redisTemplate.execute((RedisCallback<Object>) connection -> connection.info("commandstats")); |
| | | Object dbSize = redisTemplate.execute((RedisCallback<Object>) connection -> connection.dbSize()); |
| | | |
| | | Map<String, Object> result = new HashMap<>(3); |
| | | result.put("info", info); |
| | | result.put("dbSize", dbSize); |
| | | |
| | | List<Map<String, String>> pieList = new ArrayList<>(); |
| | | commandStats.stringPropertyNames().forEach(key -> { |
| | | Map<String, String> data = new HashMap<>(2); |
| | | String property = commandStats.getProperty(key); |
| | | data.put("name", StringUtils.removeStart(key, "cmdstat_")); |
| | | data.put("value", StringUtils.substringBetween(property, "calls=", ",usec")); |
| | | pieList.add(data); |
| | | }); |
| | | result.put("commandStats", pieList); |
| | | return R.ok(result); |
| | | } |
| | | |
| | | @PreAuthorize("@ss.hasPermi('monitor:cache:list')") |
| | | @GetMapping("/getNames") |
| | | public R<?> cache() |
| | | { |
| | | return R.ok(caches); |
| | | } |
| | | |
| | | @PreAuthorize("@ss.hasPermi('monitor:cache:list')") |
| | | @GetMapping("/getKeys/{cacheName}") |
| | | public R<?> getCacheKeys(@PathVariable String cacheName) |
| | | { |
| | | Set<String> cacheKeys = redisTemplate.keys(cacheName + "*"); |
| | | return R.ok(new TreeSet<>(cacheKeys)); |
| | | } |
| | | |
| | | @PreAuthorize("@ss.hasPermi('monitor:cache:list')") |
| | | @GetMapping("/getValue/{cacheName}/{cacheKey}") |
| | | public R<?> getCacheValue(@PathVariable String cacheName, @PathVariable String cacheKey) |
| | | { |
| | | String cacheValue = redisTemplate.opsForValue().get(cacheKey); |
| | | SysCache sysCache = new SysCache(cacheName, cacheKey, cacheValue); |
| | | return R.ok(sysCache); |
| | | } |
| | | |
| | | @PreAuthorize("@ss.hasPermi('monitor:cache:list')") |
| | | @DeleteMapping("/clearCacheName/{cacheName}") |
| | | public R<?> clearCacheName(@PathVariable String cacheName) |
| | | { |
| | | Collection<String> cacheKeys = redisTemplate.keys(cacheName + "*"); |
| | | redisTemplate.delete(cacheKeys); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @PreAuthorize("@ss.hasPermi('monitor:cache:list')") |
| | | @DeleteMapping("/clearCacheKey/{cacheKey}") |
| | | public R<?> clearCacheKey(@PathVariable String cacheKey) |
| | | { |
| | | redisTemplate.delete(cacheKey); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @PreAuthorize("@ss.hasPermi('monitor:cache:list')") |
| | | @DeleteMapping("/clearCacheAll") |
| | | public R<?> clearCacheAll() |
| | | { |
| | | Collection<String> cacheKeys = redisTemplate.keys("*"); |
| | | redisTemplate.delete(cacheKeys); |
| | | return R.ok(); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.project.monitor.controller;
|
| | |
|
| | | import org.springframework.security.access.prepost.PreAuthorize;
|
| | | import org.springframework.web.bind.annotation.GetMapping;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.bind.annotation.RestController;
|
| | | import com.ruoyi.framework.web.domain.AjaxResult;
|
| | | import com.ruoyi.framework.web.domain.Server;
|
| | |
|
| | | /**
|
| | | * æå¡å¨çæ§
|
| | | * |
| | | * @author ruoyi
|
| | | */
|
| | | @RestController
|
| | | @RequestMapping("/monitor/server")
|
| | | public class ServerController
|
| | | {
|
| | | @PreAuthorize("@ss.hasPermi('monitor:server:list')")
|
| | | @GetMapping()
|
| | | public AjaxResult getInfo() throws Exception
|
| | | {
|
| | | Server server = new Server();
|
| | | server.copyTo();
|
| | | return AjaxResult.success(server);
|
| | | }
|
| | | }
|
| | | package com.ruoyi.project.monitor.controller; |
| | | |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.framework.web.domain.Server; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * æå¡å¨çæ§ |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/monitor/server") |
| | | public class ServerController extends BaseController |
| | | { |
| | | @PreAuthorize("@ss.hasPermi('monitor:server:list')") |
| | | @GetMapping() |
| | | public R<?> getInfo() throws Exception |
| | | { |
| | | Server server = new Server(); |
| | | server.copyTo(); |
| | | return R.ok(server); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.project.monitor.controller;
|
| | |
|
| | | import java.util.List;
|
| | | import jakarta.servlet.http.HttpServletResponse;
|
| | | import lombok.AllArgsConstructor;
|
| | | import org.quartz.SchedulerException;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.security.access.prepost.PreAuthorize;
|
| | | import org.springframework.web.bind.annotation.DeleteMapping;
|
| | | import org.springframework.web.bind.annotation.GetMapping;
|
| | | import org.springframework.web.bind.annotation.PathVariable;
|
| | | import org.springframework.web.bind.annotation.PostMapping;
|
| | | import org.springframework.web.bind.annotation.PutMapping;
|
| | | import org.springframework.web.bind.annotation.RequestBody;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.bind.annotation.RestController;
|
| | | import com.ruoyi.common.constant.Constants;
|
| | | import com.ruoyi.common.exception.job.TaskException;
|
| | | import com.ruoyi.common.utils.StringUtils;
|
| | | import com.ruoyi.common.utils.job.CronUtils;
|
| | | import com.ruoyi.common.utils.job.ScheduleUtils;
|
| | | import com.ruoyi.common.utils.poi.ExcelUtil;
|
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log;
|
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
|
| | | import com.ruoyi.framework.web.controller.BaseController;
|
| | | import com.ruoyi.framework.web.domain.AjaxResult;
|
| | | import com.ruoyi.framework.web.page.TableDataInfo;
|
| | | import com.ruoyi.project.monitor.domain.SysJob;
|
| | | import com.ruoyi.project.monitor.service.ISysJobService;
|
| | |
|
| | | /**
|
| | | * è°åº¦ä»»å¡ä¿¡æ¯æä½å¤ç
|
| | | * |
| | | * @author ruoyi
|
| | | */
|
| | | @RestController
|
| | | @RequestMapping("/monitor/job")
|
| | | @AllArgsConstructor
|
| | | public class SysJobController extends BaseController
|
| | | {
|
| | | private ISysJobService jobService;
|
| | |
|
| | | /**
|
| | | * æ¥è¯¢å®æ¶ä»»å¡å表
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('monitor:job:list')")
|
| | | @GetMapping("/list")
|
| | | public TableDataInfo list(SysJob sysJob)
|
| | | {
|
| | | startPage();
|
| | | List<SysJob> list = jobService.selectJobList(sysJob);
|
| | | return getDataTable(list);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 导åºå®æ¶ä»»å¡å表
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('monitor:job:export')")
|
| | | @Log(title = "宿¶ä»»å¡", businessType = BusinessType.EXPORT)
|
| | | @PostMapping("/export")
|
| | | public void export(HttpServletResponse response, SysJob sysJob)
|
| | | {
|
| | | List<SysJob> list = jobService.selectJobList(sysJob);
|
| | | ExcelUtil<SysJob> util = new ExcelUtil<SysJob>(SysJob.class);
|
| | | util.exportExcel(response, list, "宿¶ä»»å¡");
|
| | | }
|
| | |
|
| | | /**
|
| | | * è·å宿¶ä»»å¡è¯¦ç»ä¿¡æ¯
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('monitor:job:query')")
|
| | | @GetMapping(value = "/{jobId}")
|
| | | public AjaxResult getInfo(@PathVariable("jobId") Long jobId)
|
| | | {
|
| | | return success(jobService.selectJobById(jobId));
|
| | | }
|
| | |
|
| | | /**
|
| | | * æ°å¢å®æ¶ä»»å¡
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('monitor:job:add')")
|
| | | @Log(title = "宿¶ä»»å¡", businessType = BusinessType.INSERT)
|
| | | @PostMapping
|
| | | public AjaxResult add(@RequestBody SysJob job) throws SchedulerException, TaskException
|
| | | {
|
| | | if (!CronUtils.isValid(job.getCronExpression()))
|
| | | {
|
| | | return error("æ°å¢ä»»å¡'" + job.getJobName() + "'失败ï¼Cron表达å¼ä¸æ£ç¡®");
|
| | | }
|
| | | else if (StringUtils.containsIgnoreCase(job.getInvokeTarget(), Constants.LOOKUP_RMI))
|
| | | {
|
| | | return error("æ°å¢ä»»å¡'" + job.getJobName() + "'失败ï¼ç®æ å符串ä¸å
许'rmi'è°ç¨");
|
| | | }
|
| | | else if (StringUtils.containsAnyIgnoreCase(job.getInvokeTarget(), new String[] { Constants.LOOKUP_LDAP, Constants.LOOKUP_LDAPS }))
|
| | | {
|
| | | return error("æ°å¢ä»»å¡'" + job.getJobName() + "'失败ï¼ç®æ å符串ä¸å
许'ldap(s)'è°ç¨");
|
| | | }
|
| | | else if (StringUtils.containsAnyIgnoreCase(job.getInvokeTarget(), new String[] { Constants.HTTP, Constants.HTTPS }))
|
| | | {
|
| | | return error("æ°å¢ä»»å¡'" + job.getJobName() + "'失败ï¼ç®æ å符串ä¸å
许'http(s)'è°ç¨");
|
| | | }
|
| | | else if (StringUtils.containsAnyIgnoreCase(job.getInvokeTarget(), Constants.JOB_ERROR_STR))
|
| | | {
|
| | | return error("æ°å¢ä»»å¡'" + job.getJobName() + "'失败ï¼ç®æ å符串åå¨è¿è§");
|
| | | }
|
| | | else if (!ScheduleUtils.whiteList(job.getInvokeTarget()))
|
| | | {
|
| | | return error("æ°å¢ä»»å¡'" + job.getJobName() + "'失败ï¼ç®æ å符串ä¸å¨ç½ååå
");
|
| | | }
|
| | | job.setCreateBy(getUsername());
|
| | | return toAjax(jobService.insertJob(job));
|
| | | }
|
| | |
|
| | | /**
|
| | | * ä¿®æ¹å®æ¶ä»»å¡
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('monitor:job:edit')")
|
| | | @Log(title = "宿¶ä»»å¡", businessType = BusinessType.UPDATE)
|
| | | @PutMapping
|
| | | public AjaxResult edit(@RequestBody SysJob job) throws SchedulerException, TaskException
|
| | | {
|
| | | if (!CronUtils.isValid(job.getCronExpression()))
|
| | | {
|
| | | return error("ä¿®æ¹ä»»å¡'" + job.getJobName() + "'失败ï¼Cron表达å¼ä¸æ£ç¡®");
|
| | | }
|
| | | else if (StringUtils.containsIgnoreCase(job.getInvokeTarget(), Constants.LOOKUP_RMI))
|
| | | {
|
| | | return error("ä¿®æ¹ä»»å¡'" + job.getJobName() + "'失败ï¼ç®æ å符串ä¸å
许'rmi'è°ç¨");
|
| | | }
|
| | | else if (StringUtils.containsAnyIgnoreCase(job.getInvokeTarget(), new String[] { Constants.LOOKUP_LDAP, Constants.LOOKUP_LDAPS }))
|
| | | {
|
| | | return error("ä¿®æ¹ä»»å¡'" + job.getJobName() + "'失败ï¼ç®æ å符串ä¸å
许'ldap(s)'è°ç¨");
|
| | | }
|
| | | else if (StringUtils.containsAnyIgnoreCase(job.getInvokeTarget(), new String[] { Constants.HTTP, Constants.HTTPS }))
|
| | | {
|
| | | return error("ä¿®æ¹ä»»å¡'" + job.getJobName() + "'失败ï¼ç®æ å符串ä¸å
许'http(s)'è°ç¨");
|
| | | }
|
| | | else if (StringUtils.containsAnyIgnoreCase(job.getInvokeTarget(), Constants.JOB_ERROR_STR))
|
| | | {
|
| | | return error("ä¿®æ¹ä»»å¡'" + job.getJobName() + "'失败ï¼ç®æ å符串åå¨è¿è§");
|
| | | }
|
| | | else if (!ScheduleUtils.whiteList(job.getInvokeTarget()))
|
| | | {
|
| | | return error("ä¿®æ¹ä»»å¡'" + job.getJobName() + "'失败ï¼ç®æ å符串ä¸å¨ç½ååå
");
|
| | | }
|
| | | job.setUpdateBy(getUsername());
|
| | | return toAjax(jobService.updateJob(job));
|
| | | }
|
| | |
|
| | | /**
|
| | | * 宿¶ä»»å¡ç¶æä¿®æ¹
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('monitor:job:changeStatus')")
|
| | | @Log(title = "宿¶ä»»å¡", businessType = BusinessType.UPDATE)
|
| | | @PutMapping("/changeStatus")
|
| | | public AjaxResult changeStatus(@RequestBody SysJob job) throws SchedulerException
|
| | | {
|
| | | SysJob newJob = jobService.selectJobById(job.getJobId());
|
| | | newJob.setStatus(job.getStatus());
|
| | | return toAjax(jobService.changeStatus(newJob));
|
| | | }
|
| | |
|
| | | /**
|
| | | * 宿¶ä»»å¡ç«å³æ§è¡ä¸æ¬¡
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('monitor:job:changeStatus')")
|
| | | @Log(title = "宿¶ä»»å¡", businessType = BusinessType.UPDATE)
|
| | | @PutMapping("/run")
|
| | | public AjaxResult run(@RequestBody SysJob job) throws SchedulerException
|
| | | {
|
| | | boolean result = jobService.run(job);
|
| | | return result ? success() : error("ä»»å¡ä¸åå¨æå·²è¿æï¼");
|
| | | }
|
| | |
|
| | | /**
|
| | | * å é¤å®æ¶ä»»å¡
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('monitor:job:remove')")
|
| | | @Log(title = "宿¶ä»»å¡", businessType = BusinessType.DELETE)
|
| | | @DeleteMapping("/{jobIds}")
|
| | | public AjaxResult remove(@PathVariable Long[] jobIds) throws SchedulerException
|
| | | {
|
| | | jobService.deleteJobByIds(jobIds);
|
| | | return success();
|
| | | }
|
| | | }
|
| | | package com.ruoyi.project.monitor.controller; |
| | | |
| | | import java.util.List; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import lombok.AllArgsConstructor; |
| | | import org.quartz.SchedulerException; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ruoyi.common.constant.Constants; |
| | | import com.ruoyi.common.exception.job.TaskException; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.job.CronUtils; |
| | | import com.ruoyi.common.utils.job.ScheduleUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.framework.web.page.TableDataInfo; |
| | | import com.ruoyi.project.monitor.domain.SysJob; |
| | | import com.ruoyi.project.monitor.service.ISysJobService; |
| | | |
| | | /** |
| | | * è°åº¦ä»»å¡ä¿¡æ¯æä½å¤ç |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/monitor/job") |
| | | @AllArgsConstructor |
| | | public class SysJobController extends BaseController |
| | | { |
| | | private ISysJobService jobService; |
| | | |
| | | /** |
| | | * æ¥è¯¢å®æ¶ä»»å¡å表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('monitor:job:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(SysJob sysJob) |
| | | { |
| | | startPage(); |
| | | List<SysJob> list = jobService.selectJobList(sysJob); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | /** |
| | | * 导åºå®æ¶ä»»å¡å表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('monitor:job:export')") |
| | | @Log(title = "宿¶ä»»å¡", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, SysJob sysJob) |
| | | { |
| | | List<SysJob> list = jobService.selectJobList(sysJob); |
| | | ExcelUtil<SysJob> util = new ExcelUtil<SysJob>(SysJob.class); |
| | | util.exportExcel(response, list, "宿¶ä»»å¡"); |
| | | } |
| | | |
| | | /** |
| | | * è·å宿¶ä»»å¡è¯¦ç»ä¿¡æ¯ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('monitor:job:query')") |
| | | @GetMapping(value = "/{jobId}") |
| | | public R<?> getInfo(@PathVariable("jobId") Long jobId) |
| | | { |
| | | return R.ok(jobService.selectJobById(jobId)); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢å®æ¶ä»»å¡ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('monitor:job:add')") |
| | | @Log(title = "宿¶ä»»å¡", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public R<?> add(@RequestBody SysJob job) throws SchedulerException, TaskException |
| | | { |
| | | if (!CronUtils.isValid(job.getCronExpression())) |
| | | { |
| | | return R.fail("æ°å¢ä»»å¡'" + job.getJobName() + "'失败ï¼Cron表达å¼ä¸æ£ç¡®"); |
| | | } |
| | | else if (StringUtils.containsIgnoreCase(job.getInvokeTarget(), Constants.LOOKUP_RMI)) |
| | | { |
| | | return R.fail("æ°å¢ä»»å¡'" + job.getJobName() + "'失败ï¼ç®æ å符串ä¸å
许'rmi'è°ç¨"); |
| | | } |
| | | else if (StringUtils.containsAnyIgnoreCase(job.getInvokeTarget(), new String[] { Constants.LOOKUP_LDAP, Constants.LOOKUP_LDAPS })) |
| | | { |
| | | return R.fail("æ°å¢ä»»å¡'" + job.getJobName() + "'失败ï¼ç®æ å符串ä¸å
许'ldap(s)'è°ç¨"); |
| | | } |
| | | else if (StringUtils.containsAnyIgnoreCase(job.getInvokeTarget(), new String[] { Constants.HTTP, Constants.HTTPS })) |
| | | { |
| | | return R.fail("æ°å¢ä»»å¡'" + job.getJobName() + "'失败ï¼ç®æ å符串ä¸å
许'http(s)'è°ç¨"); |
| | | } |
| | | else if (StringUtils.containsAnyIgnoreCase(job.getInvokeTarget(), Constants.JOB_ERROR_STR)) |
| | | { |
| | | return R.fail("æ°å¢ä»»å¡'" + job.getJobName() + "'失败ï¼ç®æ å符串åå¨è¿è§"); |
| | | } |
| | | else if (!ScheduleUtils.whiteList(job.getInvokeTarget())) |
| | | { |
| | | return R.fail("æ°å¢ä»»å¡'" + job.getJobName() + "'失败ï¼ç®æ å符串ä¸å¨ç½ååå
"); |
| | | } |
| | | job.setCreateBy(getUsername()); |
| | | jobService.insertJob(job); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹å®æ¶ä»»å¡ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('monitor:job:edit')") |
| | | @Log(title = "宿¶ä»»å¡", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public R<?> edit(@RequestBody SysJob job) throws SchedulerException, TaskException |
| | | { |
| | | if (!CronUtils.isValid(job.getCronExpression())) |
| | | { |
| | | return R.fail("ä¿®æ¹ä»»å¡'" + job.getJobName() + "'失败ï¼Cron表达å¼ä¸æ£ç¡®"); |
| | | } |
| | | else if (StringUtils.containsIgnoreCase(job.getInvokeTarget(), Constants.LOOKUP_RMI)) |
| | | { |
| | | return R.fail("ä¿®æ¹ä»»å¡'" + job.getJobName() + "'失败ï¼ç®æ å符串ä¸å
许'rmi'è°ç¨"); |
| | | } |
| | | else if (StringUtils.containsAnyIgnoreCase(job.getInvokeTarget(), new String[] { Constants.LOOKUP_LDAP, Constants.LOOKUP_LDAPS })) |
| | | { |
| | | return R.fail("ä¿®æ¹ä»»å¡'" + job.getJobName() + "'失败ï¼ç®æ å符串ä¸å
许'ldap(s)'è°ç¨"); |
| | | } |
| | | else if (StringUtils.containsAnyIgnoreCase(job.getInvokeTarget(), new String[] { Constants.HTTP, Constants.HTTPS })) |
| | | { |
| | | return R.fail("ä¿®æ¹ä»»å¡'" + job.getJobName() + "'失败ï¼ç®æ å符串ä¸å
许'http(s)'è°ç¨"); |
| | | } |
| | | else if (StringUtils.containsAnyIgnoreCase(job.getInvokeTarget(), Constants.JOB_ERROR_STR)) |
| | | { |
| | | return R.fail("ä¿®æ¹ä»»å¡'" + job.getJobName() + "'失败ï¼ç®æ å符串åå¨è¿è§"); |
| | | } |
| | | else if (!ScheduleUtils.whiteList(job.getInvokeTarget())) |
| | | { |
| | | return R.fail("ä¿®æ¹ä»»å¡'" + job.getJobName() + "'失败ï¼ç®æ å符串ä¸å¨ç½ååå
"); |
| | | } |
| | | job.setUpdateBy(getUsername()); |
| | | jobService.updateJob(job); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 宿¶ä»»å¡ç¶æä¿®æ¹ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('monitor:job:changeStatus')") |
| | | @Log(title = "宿¶ä»»å¡", businessType = BusinessType.UPDATE) |
| | | @PutMapping("/changeStatus") |
| | | public R<?> changeStatus(@RequestBody SysJob job) throws SchedulerException |
| | | { |
| | | SysJob newJob = jobService.selectJobById(job.getJobId()); |
| | | newJob.setStatus(job.getStatus()); |
| | | jobService.changeStatus(newJob); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 宿¶ä»»å¡ç«å³æ§è¡ä¸æ¬¡ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('monitor:job:changeStatus')") |
| | | @Log(title = "宿¶ä»»å¡", businessType = BusinessType.UPDATE) |
| | | @PutMapping("/run") |
| | | public R<?> run(@RequestBody SysJob job) throws SchedulerException |
| | | { |
| | | boolean result = jobService.run(job); |
| | | return result ? R.ok() : R.fail("ä»»å¡ä¸åå¨æå·²è¿æï¼"); |
| | | } |
| | | |
| | | /** |
| | | * å é¤å®æ¶ä»»å¡ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('monitor:job:remove')") |
| | | @Log(title = "宿¶ä»»å¡", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{jobIds}") |
| | | public R<?> remove(@PathVariable Long[] jobIds) throws SchedulerException |
| | | { |
| | | jobService.deleteJobByIds(jobIds); |
| | | return R.ok(); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.project.monitor.controller;
|
| | |
|
| | | import java.util.List;
|
| | | import jakarta.servlet.http.HttpServletResponse;
|
| | | import lombok.AllArgsConstructor;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.security.access.prepost.PreAuthorize;
|
| | | import org.springframework.web.bind.annotation.DeleteMapping;
|
| | | import org.springframework.web.bind.annotation.GetMapping;
|
| | | import org.springframework.web.bind.annotation.PathVariable;
|
| | | import org.springframework.web.bind.annotation.PostMapping;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.bind.annotation.RestController;
|
| | | import com.ruoyi.common.utils.poi.ExcelUtil;
|
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log;
|
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
|
| | | import com.ruoyi.framework.web.controller.BaseController;
|
| | | import com.ruoyi.framework.web.domain.AjaxResult;
|
| | | import com.ruoyi.framework.web.page.TableDataInfo;
|
| | | import com.ruoyi.project.monitor.domain.SysJobLog;
|
| | | import com.ruoyi.project.monitor.service.ISysJobLogService;
|
| | |
|
| | | /**
|
| | | * è°åº¦æ¥å¿æä½å¤ç
|
| | | * |
| | | * @author ruoyi
|
| | | */
|
| | | @RestController
|
| | | @RequestMapping("/monitor/jobLog")
|
| | | @AllArgsConstructor
|
| | | public class SysJobLogController extends BaseController
|
| | | {
|
| | | private ISysJobLogService jobLogService;
|
| | |
|
| | | /**
|
| | | * æ¥è¯¢å®æ¶ä»»å¡è°åº¦æ¥å¿å表
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('monitor:job:list')")
|
| | | @GetMapping("/list")
|
| | | public TableDataInfo list(SysJobLog sysJobLog)
|
| | | {
|
| | | startPage();
|
| | | List<SysJobLog> list = jobLogService.selectJobLogList(sysJobLog);
|
| | | return getDataTable(list);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 导åºå®æ¶ä»»å¡è°åº¦æ¥å¿å表
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('monitor:job:export')")
|
| | | @Log(title = "ä»»å¡è°åº¦æ¥å¿", businessType = BusinessType.EXPORT)
|
| | | @PostMapping("/export")
|
| | | public void export(HttpServletResponse response, SysJobLog sysJobLog)
|
| | | {
|
| | | List<SysJobLog> list = jobLogService.selectJobLogList(sysJobLog);
|
| | | ExcelUtil<SysJobLog> util = new ExcelUtil<SysJobLog>(SysJobLog.class);
|
| | | util.exportExcel(response, list, "è°åº¦æ¥å¿");
|
| | | }
|
| | | |
| | | /**
|
| | | * æ ¹æ®è°åº¦ç¼å·è·å详ç»ä¿¡æ¯
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('monitor:job:query')")
|
| | | @GetMapping(value = "/{jobLogId}")
|
| | | public AjaxResult getInfo(@PathVariable Long jobLogId)
|
| | | {
|
| | | return success(jobLogService.selectJobLogById(jobLogId));
|
| | | }
|
| | |
|
| | |
|
| | | /**
|
| | | * å é¤å®æ¶ä»»å¡è°åº¦æ¥å¿
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('monitor:job:remove')")
|
| | | @Log(title = "宿¶ä»»å¡è°åº¦æ¥å¿", businessType = BusinessType.DELETE)
|
| | | @DeleteMapping("/{jobLogIds}")
|
| | | public AjaxResult remove(@PathVariable Long[] jobLogIds)
|
| | | {
|
| | | return toAjax(jobLogService.deleteJobLogByIds(jobLogIds));
|
| | | }
|
| | |
|
| | | /**
|
| | | * æ¸
ç©ºå®æ¶ä»»å¡è°åº¦æ¥å¿
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('monitor:job:remove')")
|
| | | @Log(title = "è°åº¦æ¥å¿", businessType = BusinessType.CLEAN)
|
| | | @DeleteMapping("/clean")
|
| | | public AjaxResult clean()
|
| | | {
|
| | | jobLogService.cleanJobLog();
|
| | | return success();
|
| | | }
|
| | | }
|
| | | package com.ruoyi.project.monitor.controller; |
| | | |
| | | import java.util.List; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.framework.web.page.TableDataInfo; |
| | | import com.ruoyi.project.monitor.domain.SysJobLog; |
| | | import com.ruoyi.project.monitor.service.ISysJobLogService; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | |
| | | /** |
| | | * è°åº¦æ¥å¿æä½å¤ç |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/monitor/jobLog") |
| | | @AllArgsConstructor |
| | | public class SysJobLogController extends BaseController |
| | | { |
| | | private ISysJobLogService jobLogService; |
| | | |
| | | /** |
| | | * æ¥è¯¢å®æ¶ä»»å¡è°åº¦æ¥å¿å表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('monitor:job:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(SysJobLog sysJobLog) |
| | | { |
| | | startPage(); |
| | | List<SysJobLog> list = jobLogService.selectJobLogList(sysJobLog); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | /** |
| | | * 导åºå®æ¶ä»»å¡è°åº¦æ¥å¿å表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('monitor:job:export')") |
| | | @Log(title = "ä»»å¡è°åº¦æ¥å¿", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, SysJobLog sysJobLog) |
| | | { |
| | | List<SysJobLog> list = jobLogService.selectJobLogList(sysJobLog); |
| | | ExcelUtil<SysJobLog> util = new ExcelUtil<SysJobLog>(SysJobLog.class); |
| | | util.exportExcel(response, list, "è°åº¦æ¥å¿"); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®è°åº¦ç¼å·è·å详ç»ä¿¡æ¯ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('monitor:job:query')") |
| | | @GetMapping(value = "/{jobLogId}") |
| | | public R<?> getInfo(@PathVariable Long jobLogId) |
| | | { |
| | | return R.ok(jobLogService.selectJobLogById(jobLogId)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * å é¤å®æ¶ä»»å¡è°åº¦æ¥å¿ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('monitor:job:remove')") |
| | | @Log(title = "宿¶ä»»å¡è°åº¦æ¥å¿", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{jobLogIds}") |
| | | public R<?> remove(@PathVariable Long[] jobLogIds) |
| | | { |
| | | jobLogService.deleteJobLogByIds(jobLogIds); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * æ¸
ç©ºå®æ¶ä»»å¡è°åº¦æ¥å¿ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('monitor:job:remove')") |
| | | @Log(title = "è°åº¦æ¥å¿", businessType = BusinessType.CLEAN) |
| | | @DeleteMapping("/clean") |
| | | public R<?> clean() |
| | | { |
| | | jobLogService.cleanJobLog(); |
| | | return R.ok(); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.project.monitor.controller;
|
| | |
|
| | | import com.ruoyi.common.utils.poi.ExcelUtil;
|
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log;
|
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
|
| | | import com.ruoyi.framework.security.service.SysPasswordService;
|
| | | import com.ruoyi.framework.web.controller.BaseController;
|
| | | import com.ruoyi.framework.web.domain.AjaxResult;
|
| | | import com.ruoyi.framework.web.page.TableDataInfo;
|
| | | import com.ruoyi.project.monitor.domain.SysLogininfor;
|
| | | import com.ruoyi.project.monitor.service.ISysLogininforService;
|
| | | import jakarta.servlet.http.HttpServletResponse;
|
| | | import lombok.AllArgsConstructor;
|
| | | import org.springframework.security.access.prepost.PreAuthorize;
|
| | | import org.springframework.web.bind.annotation.*;
|
| | |
|
| | | import java.util.List;
|
| | |
|
| | | /**
|
| | | * ç³»ç»è®¿é®è®°å½
|
| | | *
|
| | | * @author ruoyi
|
| | | */
|
| | | @RestController
|
| | | @RequestMapping("/monitor/logininfor")
|
| | | @AllArgsConstructor
|
| | | public class SysLogininforController extends BaseController {
|
| | | private ISysLogininforService logininforService;
|
| | | private SysPasswordService passwordService;
|
| | |
|
| | | @PreAuthorize("@ss.hasPermi('monitor:logininfor:list')")
|
| | | @GetMapping("/list")
|
| | | public TableDataInfo list(SysLogininfor logininfor) {
|
| | | startPage();
|
| | | List<SysLogininfor> list = logininforService.selectLogininforList(logininfor);
|
| | | return getDataTable(list);
|
| | | }
|
| | |
|
| | | @Log(title = "ç»å½æ¥å¿", businessType = BusinessType.EXPORT)
|
| | | @PreAuthorize("@ss.hasPermi('monitor:logininfor:export')")
|
| | | @PostMapping("/export")
|
| | | public void export(HttpServletResponse response, SysLogininfor logininfor) {
|
| | | List<SysLogininfor> list = logininforService.selectLogininforList(logininfor);
|
| | | ExcelUtil<SysLogininfor> util = new ExcelUtil<SysLogininfor>(SysLogininfor.class);
|
| | | util.exportExcel(response, list, "ç»å½æ¥å¿");
|
| | | }
|
| | |
|
| | | @PreAuthorize("@ss.hasPermi('monitor:logininfor:remove')")
|
| | | @Log(title = "ç»å½æ¥å¿", businessType = BusinessType.DELETE)
|
| | | @DeleteMapping("/{infoIds}")
|
| | | public AjaxResult remove(@PathVariable Long[] infoIds) {
|
| | | return toAjax(logininforService.deleteLogininforByIds(infoIds));
|
| | | }
|
| | |
|
| | | @PreAuthorize("@ss.hasPermi('monitor:logininfor:remove')")
|
| | | @Log(title = "ç»å½æ¥å¿", businessType = BusinessType.CLEAN)
|
| | | @DeleteMapping("/clean")
|
| | | public AjaxResult clean() {
|
| | | logininforService.cleanLogininfor();
|
| | | return success();
|
| | | }
|
| | |
|
| | | @PreAuthorize("@ss.hasPermi('monitor:logininfor:unlock')")
|
| | | @Log(title = "è´¦æ·è§£é", businessType = BusinessType.OTHER)
|
| | | @GetMapping("/unlock/{userName}")
|
| | | public AjaxResult unlock(@PathVariable("userName") String userName) {
|
| | | passwordService.clearLoginRecordCache(userName);
|
| | | return success();
|
| | | }
|
| | | }
|
| | | package com.ruoyi.project.monitor.controller; |
| | | |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.security.service.SysPasswordService; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.page.TableDataInfo; |
| | | import com.ruoyi.project.monitor.domain.SysLogininfor; |
| | | import com.ruoyi.project.monitor.service.ISysLogininforService; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * ç³»ç»è®¿é®è®°å½ |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/monitor/logininfor") |
| | | @AllArgsConstructor |
| | | public class SysLogininforController extends BaseController { |
| | | private ISysLogininforService logininforService; |
| | | private SysPasswordService passwordService; |
| | | |
| | | @PreAuthorize("@ss.hasPermi('monitor:logininfor:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(SysLogininfor logininfor) { |
| | | startPage(); |
| | | List<SysLogininfor> list = logininforService.selectLogininforList(logininfor); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | @Log(title = "ç»å½æ¥å¿", businessType = BusinessType.EXPORT) |
| | | @PreAuthorize("@ss.hasPermi('monitor:logininfor:export')") |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, SysLogininfor logininfor) { |
| | | List<SysLogininfor> list = logininforService.selectLogininforList(logininfor); |
| | | ExcelUtil<SysLogininfor> util = new ExcelUtil<SysLogininfor>(SysLogininfor.class); |
| | | util.exportExcel(response, list, "ç»å½æ¥å¿"); |
| | | } |
| | | |
| | | @PreAuthorize("@ss.hasPermi('monitor:logininfor:remove')") |
| | | @Log(title = "ç»å½æ¥å¿", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{infoIds}") |
| | | public R<?> remove(@PathVariable Long[] infoIds) { |
| | | logininforService.deleteLogininforByIds(infoIds); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @PreAuthorize("@ss.hasPermi('monitor:logininfor:remove')") |
| | | @Log(title = "ç»å½æ¥å¿", businessType = BusinessType.CLEAN) |
| | | @DeleteMapping("/clean") |
| | | public R<?> clean() { |
| | | logininforService.cleanLogininfor(); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @PreAuthorize("@ss.hasPermi('monitor:logininfor:unlock')") |
| | | @Log(title = "è´¦æ·è§£é", businessType = BusinessType.OTHER) |
| | | @GetMapping("/unlock/{userName}") |
| | | public R<?> unlock(@PathVariable("userName") String userName) { |
| | | passwordService.clearLoginRecordCache(userName); |
| | | return R.ok(); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.project.monitor.controller;
|
| | |
|
| | | import java.util.List;
|
| | | import jakarta.servlet.http.HttpServletResponse;
|
| | | import lombok.AllArgsConstructor;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.security.access.prepost.PreAuthorize;
|
| | | import org.springframework.web.bind.annotation.DeleteMapping;
|
| | | import org.springframework.web.bind.annotation.GetMapping;
|
| | | import org.springframework.web.bind.annotation.PathVariable;
|
| | | import org.springframework.web.bind.annotation.PostMapping;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.bind.annotation.RestController;
|
| | | import com.ruoyi.common.utils.poi.ExcelUtil;
|
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log;
|
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
|
| | | import com.ruoyi.framework.web.controller.BaseController;
|
| | | import com.ruoyi.framework.web.domain.AjaxResult;
|
| | | import com.ruoyi.framework.web.page.TableDataInfo;
|
| | | import com.ruoyi.project.monitor.domain.SysOperLog;
|
| | | import com.ruoyi.project.monitor.service.ISysOperLogService;
|
| | |
|
| | | /**
|
| | | * æä½æ¥å¿è®°å½
|
| | | * |
| | | * @author ruoyi
|
| | | */
|
| | | @RestController
|
| | | @RequestMapping("/monitor/operlog")
|
| | | @AllArgsConstructor
|
| | | public class SysOperlogController extends BaseController
|
| | | {
|
| | | private ISysOperLogService operLogService;
|
| | |
|
| | | @PreAuthorize("@ss.hasPermi('monitor:operlog:list')")
|
| | | @GetMapping("/list")
|
| | | public TableDataInfo list(SysOperLog operLog)
|
| | | {
|
| | | startPage();
|
| | | List<SysOperLog> list = operLogService.selectOperLogList(operLog);
|
| | | return getDataTable(list);
|
| | | }
|
| | |
|
| | | @Log(title = "æä½æ¥å¿", businessType = BusinessType.EXPORT)
|
| | | @PreAuthorize("@ss.hasPermi('monitor:operlog:export')")
|
| | | @PostMapping("/export")
|
| | | public void export(HttpServletResponse response, SysOperLog operLog)
|
| | | {
|
| | | List<SysOperLog> list = operLogService.selectOperLogList(operLog);
|
| | | ExcelUtil<SysOperLog> util = new ExcelUtil<SysOperLog>(SysOperLog.class);
|
| | | util.exportExcel(response, list, "æä½æ¥å¿");
|
| | | }
|
| | |
|
| | | @Log(title = "æä½æ¥å¿", businessType = BusinessType.DELETE)
|
| | | @PreAuthorize("@ss.hasPermi('monitor:operlog:remove')")
|
| | | @DeleteMapping("/{operIds}")
|
| | | public AjaxResult remove(@PathVariable Long[] operIds)
|
| | | {
|
| | | return toAjax(operLogService.deleteOperLogByIds(operIds));
|
| | | }
|
| | |
|
| | | @Log(title = "æä½æ¥å¿", businessType = BusinessType.CLEAN)
|
| | | @PreAuthorize("@ss.hasPermi('monitor:operlog:remove')")
|
| | | @DeleteMapping("/clean")
|
| | | public AjaxResult clean()
|
| | | {
|
| | | operLogService.cleanOperLog();
|
| | | return success();
|
| | | }
|
| | | }
|
| | | package com.ruoyi.project.monitor.controller; |
| | | |
| | | import java.util.List; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.framework.web.page.TableDataInfo; |
| | | import com.ruoyi.project.monitor.domain.SysOperLog; |
| | | import com.ruoyi.project.monitor.service.ISysOperLogService; |
| | | |
| | | /** |
| | | * æä½æ¥å¿è®°å½ |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/monitor/operlog") |
| | | @AllArgsConstructor |
| | | public class SysOperlogController extends BaseController |
| | | { |
| | | private ISysOperLogService operLogService; |
| | | |
| | | @PreAuthorize("@ss.hasPermi('monitor:operlog:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(SysOperLog operLog) |
| | | { |
| | | startPage(); |
| | | List<SysOperLog> list = operLogService.selectOperLogList(operLog); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | @Log(title = "æä½æ¥å¿", businessType = BusinessType.EXPORT) |
| | | @PreAuthorize("@ss.hasPermi('monitor:operlog:export')") |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, SysOperLog operLog) |
| | | { |
| | | List<SysOperLog> list = operLogService.selectOperLogList(operLog); |
| | | ExcelUtil<SysOperLog> util = new ExcelUtil<SysOperLog>(SysOperLog.class); |
| | | util.exportExcel(response, list, "æä½æ¥å¿"); |
| | | } |
| | | |
| | | @Log(title = "æä½æ¥å¿", businessType = BusinessType.DELETE) |
| | | @PreAuthorize("@ss.hasPermi('monitor:operlog:remove')") |
| | | @DeleteMapping("/{operIds}") |
| | | public R<?> remove(@PathVariable Long[] operIds) |
| | | { |
| | | operLogService.deleteOperLogByIds(operIds); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @Log(title = "æä½æ¥å¿", businessType = BusinessType.CLEAN) |
| | | @PreAuthorize("@ss.hasPermi('monitor:operlog:remove')") |
| | | @DeleteMapping("/clean") |
| | | public R<?> clean() |
| | | { |
| | | operLogService.cleanOperLog(); |
| | | return R.ok(); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.project.monitor.controller;
|
| | |
|
| | | import java.util.ArrayList;
|
| | | import java.util.Collection;
|
| | | import java.util.Collections;
|
| | | import java.util.List;
|
| | |
|
| | | import lombok.AllArgsConstructor;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.security.access.prepost.PreAuthorize;
|
| | | import org.springframework.web.bind.annotation.DeleteMapping;
|
| | | import org.springframework.web.bind.annotation.GetMapping;
|
| | | import org.springframework.web.bind.annotation.PathVariable;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.bind.annotation.RestController;
|
| | | import com.ruoyi.common.constant.CacheConstants;
|
| | | import com.ruoyi.common.utils.StringUtils;
|
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log;
|
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
|
| | | import com.ruoyi.framework.redis.RedisCache;
|
| | | import com.ruoyi.framework.security.LoginUser;
|
| | | import com.ruoyi.framework.web.controller.BaseController;
|
| | | import com.ruoyi.framework.web.domain.AjaxResult;
|
| | | import com.ruoyi.framework.web.page.TableDataInfo;
|
| | | import com.ruoyi.project.monitor.domain.SysUserOnline;
|
| | | import com.ruoyi.project.system.service.ISysUserOnlineService;
|
| | |
|
| | | /**
|
| | | * å¨çº¿ç¨æ·çæ§
|
| | | * |
| | | * @author ruoyi
|
| | | */
|
| | | @RestController
|
| | | @RequestMapping("/monitor/online")
|
| | | @AllArgsConstructor
|
| | | public class SysUserOnlineController extends BaseController
|
| | | {
|
| | | private ISysUserOnlineService userOnlineService;
|
| | | private RedisCache redisCache;
|
| | |
|
| | | @PreAuthorize("@ss.hasPermi('monitor:online:list')")
|
| | | @GetMapping("/list")
|
| | | public TableDataInfo list(String ipaddr, String userName)
|
| | | {
|
| | | Collection<String> keys = redisCache.keys(CacheConstants.LOGIN_TOKEN_KEY + "*");
|
| | | List<SysUserOnline> userOnlineList = new ArrayList<SysUserOnline>();
|
| | | for (String key : keys)
|
| | | {
|
| | | LoginUser user = redisCache.getCacheObject(key);
|
| | | if (StringUtils.isNotEmpty(ipaddr) && StringUtils.isNotEmpty(userName))
|
| | | {
|
| | | userOnlineList.add(userOnlineService.selectOnlineByInfo(ipaddr, userName, user));
|
| | | }
|
| | | else if (StringUtils.isNotEmpty(ipaddr))
|
| | | {
|
| | | userOnlineList.add(userOnlineService.selectOnlineByIpaddr(ipaddr, user));
|
| | | }
|
| | | else if (StringUtils.isNotEmpty(userName) && StringUtils.isNotNull(user.getUser()))
|
| | | {
|
| | | userOnlineList.add(userOnlineService.selectOnlineByUserName(userName, user));
|
| | | }
|
| | | else
|
| | | {
|
| | | userOnlineList.add(userOnlineService.loginUserToUserOnline(user));
|
| | | }
|
| | | }
|
| | | Collections.reverse(userOnlineList);
|
| | | userOnlineList.removeAll(Collections.singleton(null));
|
| | | return getDataTable(userOnlineList);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 强éç¨æ·
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('monitor:online:forceLogout')")
|
| | | @Log(title = "å¨çº¿ç¨æ·", businessType = BusinessType.FORCE)
|
| | | @DeleteMapping("/{tokenId}")
|
| | | public AjaxResult forceLogout(@PathVariable String tokenId)
|
| | | {
|
| | | redisCache.deleteObject(CacheConstants.LOGIN_TOKEN_KEY + tokenId);
|
| | | return success();
|
| | | }
|
| | | }
|
| | | package com.ruoyi.project.monitor.controller; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ruoyi.common.constant.CacheConstants; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.redis.RedisCache; |
| | | import com.ruoyi.framework.security.LoginUser; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.page.TableDataInfo; |
| | | import com.ruoyi.project.monitor.domain.SysUserOnline; |
| | | import com.ruoyi.project.system.service.ISysUserOnlineService; |
| | | |
| | | /** |
| | | * å¨çº¿ç¨æ·çæ§ |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/monitor/online") |
| | | @AllArgsConstructor |
| | | public class SysUserOnlineController extends BaseController |
| | | { |
| | | private ISysUserOnlineService userOnlineService; |
| | | private RedisCache redisCache; |
| | | |
| | | @PreAuthorize("@ss.hasPermi('monitor:online:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(String ipaddr, String userName) |
| | | { |
| | | Collection<String> keys = redisCache.keys(CacheConstants.LOGIN_TOKEN_KEY + "*"); |
| | | List<SysUserOnline> userOnlineList = new ArrayList<SysUserOnline>(); |
| | | for (String key : keys) |
| | | { |
| | | LoginUser user = redisCache.getCacheObject(key); |
| | | if (StringUtils.isNotEmpty(ipaddr) && StringUtils.isNotEmpty(userName)) |
| | | { |
| | | userOnlineList.add(userOnlineService.selectOnlineByInfo(ipaddr, userName, user)); |
| | | } |
| | | else if (StringUtils.isNotEmpty(ipaddr)) |
| | | { |
| | | userOnlineList.add(userOnlineService.selectOnlineByIpaddr(ipaddr, user)); |
| | | } |
| | | else if (StringUtils.isNotEmpty(userName) && StringUtils.isNotNull(user.getUser())) |
| | | { |
| | | userOnlineList.add(userOnlineService.selectOnlineByUserName(userName, user)); |
| | | } |
| | | else |
| | | { |
| | | userOnlineList.add(userOnlineService.loginUserToUserOnline(user)); |
| | | } |
| | | } |
| | | Collections.reverse(userOnlineList); |
| | | userOnlineList.removeAll(Collections.singleton(null)); |
| | | return getDataTable(userOnlineList); |
| | | } |
| | | |
| | | /** |
| | | * 强éç¨æ· |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('monitor:online:forceLogout')") |
| | | @Log(title = "å¨çº¿ç¨æ·", businessType = BusinessType.FORCE) |
| | | @DeleteMapping("/{tokenId}") |
| | | public R<?> forceLogout(@PathVariable String tokenId) |
| | | { |
| | | redisCache.deleteObject(CacheConstants.LOGIN_TOKEN_KEY + tokenId); |
| | | return R.ok(); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.project.system.controller;
|
| | |
|
| | | import com.ruoyi.common.utils.poi.ExcelUtil;
|
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log;
|
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
|
| | | import com.ruoyi.framework.web.controller.BaseController;
|
| | | import com.ruoyi.framework.web.domain.AjaxResult;
|
| | | import com.ruoyi.framework.web.page.TableDataInfo;
|
| | | import com.ruoyi.project.system.domain.SysConfig;
|
| | | import com.ruoyi.project.system.service.ISysConfigService;
|
| | | import jakarta.servlet.http.HttpServletResponse;
|
| | | import lombok.AllArgsConstructor;
|
| | | import org.springframework.security.access.prepost.PreAuthorize;
|
| | | import org.springframework.validation.annotation.Validated;
|
| | | import org.springframework.web.bind.annotation.*;
|
| | |
|
| | | import java.util.List;
|
| | |
|
| | | /**
|
| | | * åæ°é
ç½® ä¿¡æ¯æä½å¤ç
|
| | | * |
| | | * @author ruoyi
|
| | | */
|
| | | @RestController
|
| | | @RequestMapping("/system/config")
|
| | | @AllArgsConstructor
|
| | | public class SysConfigController extends BaseController
|
| | | {
|
| | | private ISysConfigService configService;
|
| | |
|
| | | /**
|
| | | * è·ååæ°é
ç½®å表
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('system:config:list')")
|
| | | @GetMapping("/list")
|
| | | public TableDataInfo list(SysConfig config)
|
| | | {
|
| | | startPage();
|
| | | List<SysConfig> list = configService.selectConfigList(config);
|
| | | return getDataTable(list);
|
| | | }
|
| | |
|
| | | @Log(title = "åæ°ç®¡ç", businessType = BusinessType.EXPORT)
|
| | | @PreAuthorize("@ss.hasPermi('system:config:export')")
|
| | | @PostMapping("/export")
|
| | | public void export(HttpServletResponse response, SysConfig config)
|
| | | {
|
| | | List<SysConfig> list = configService.selectConfigList(config);
|
| | | ExcelUtil<SysConfig> util = new ExcelUtil<SysConfig>(SysConfig.class);
|
| | | util.exportExcel(response, list, "åæ°æ°æ®");
|
| | | }
|
| | |
|
| | | /**
|
| | | * æ ¹æ®åæ°ç¼å·è·å详ç»ä¿¡æ¯
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('system:config:query')")
|
| | | @GetMapping(value = "/{configId}")
|
| | | public AjaxResult getInfo(@PathVariable Long configId)
|
| | | {
|
| | | return success(configService.selectConfigById(configId));
|
| | | }
|
| | |
|
| | | /**
|
| | | * æ ¹æ®åæ°é®åæ¥è¯¢åæ°å¼
|
| | | */
|
| | | @GetMapping(value = "/configKey/{configKey}")
|
| | | public AjaxResult getConfigKey(@PathVariable String configKey)
|
| | | {
|
| | | return success(configService.selectConfigByKey(configKey));
|
| | | }
|
| | |
|
| | | /**
|
| | | * æ°å¢åæ°é
ç½®
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('system:config:add')")
|
| | | @Log(title = "åæ°ç®¡ç", businessType = BusinessType.INSERT)
|
| | | @PostMapping
|
| | | public AjaxResult add(@Validated @RequestBody SysConfig config)
|
| | | {
|
| | | if (!configService.checkConfigKeyUnique(config))
|
| | | {
|
| | | return error("æ°å¢åæ°'" + config.getConfigName() + "'失败ï¼åæ°é®åå·²åå¨");
|
| | | }
|
| | | config.setCreateBy(getUsername());
|
| | | return toAjax(configService.insertConfig(config));
|
| | | }
|
| | |
|
| | | /**
|
| | | * ä¿®æ¹åæ°é
ç½®
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('system:config:edit')")
|
| | | @Log(title = "åæ°ç®¡ç", businessType = BusinessType.UPDATE)
|
| | | @PutMapping
|
| | | public AjaxResult edit(@Validated @RequestBody SysConfig config)
|
| | | {
|
| | | if (!configService.checkConfigKeyUnique(config))
|
| | | {
|
| | | return error("ä¿®æ¹åæ°'" + config.getConfigName() + "'失败ï¼åæ°é®åå·²åå¨");
|
| | | }
|
| | | config.setUpdateBy(getUsername());
|
| | | return toAjax(configService.updateConfig(config));
|
| | | }
|
| | |
|
| | | /**
|
| | | * å é¤åæ°é
ç½®
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('system:config:remove')")
|
| | | @Log(title = "åæ°ç®¡ç", businessType = BusinessType.DELETE)
|
| | | @DeleteMapping("/{configIds}")
|
| | | public AjaxResult remove(@PathVariable Long[] configIds)
|
| | | {
|
| | | configService.deleteConfigByIds(configIds);
|
| | | return success();
|
| | | }
|
| | |
|
| | | /**
|
| | | * å·æ°åæ°ç¼å
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('system:config:remove')")
|
| | | @Log(title = "åæ°ç®¡ç", businessType = BusinessType.CLEAN)
|
| | | @DeleteMapping("/refreshCache")
|
| | | public AjaxResult refreshCache()
|
| | | {
|
| | | configService.resetConfigCache();
|
| | | return success();
|
| | | }
|
| | | }
|
| | | package com.ruoyi.project.system.controller; |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.page.TableDataInfo; |
| | | import com.ruoyi.project.system.domain.SysConfig; |
| | | import com.ruoyi.project.system.service.ISysConfigService; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * åæ°é
ç½® ä¿¡æ¯æä½å¤ç |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/system/config") |
| | | @AllArgsConstructor |
| | | public class SysConfigController extends BaseController |
| | | { |
| | | private ISysConfigService configService; |
| | | |
| | | /** |
| | | * è·ååæ°é
ç½®å表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:config:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(SysConfig config) |
| | | { |
| | | startPage(); |
| | | List<SysConfig> list = configService.selectConfigList(config); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | @Log(title = "åæ°ç®¡ç", businessType = BusinessType.EXPORT) |
| | | @PreAuthorize("@ss.hasPermi('system:config:export')") |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, SysConfig config) |
| | | { |
| | | List<SysConfig> list = configService.selectConfigList(config); |
| | | ExcelUtil<SysConfig> util = new ExcelUtil<SysConfig>(SysConfig.class); |
| | | util.exportExcel(response, list, "åæ°æ°æ®"); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®åæ°ç¼å·è·å详ç»ä¿¡æ¯ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:config:query')") |
| | | @GetMapping(value = "/{configId}") |
| | | public R<?> getInfo(@PathVariable Long configId) |
| | | { |
| | | return R.ok(configService.selectConfigById(configId)); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®åæ°é®åæ¥è¯¢åæ°å¼ |
| | | */ |
| | | @GetMapping(value = "/configKey/{configKey}") |
| | | public R<?> getConfigKey(@PathVariable String configKey) |
| | | { |
| | | return R.ok(configService.selectConfigByKey(configKey)); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢åæ°é
ç½® |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:config:add')") |
| | | @Log(title = "åæ°ç®¡ç", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public R<?> add(@Validated @RequestBody SysConfig config) |
| | | { |
| | | if (!configService.checkConfigKeyUnique(config)) |
| | | { |
| | | return R.fail("æ°å¢åæ°'" + config.getConfigName() + "'失败ï¼åæ°é®åå·²åå¨"); |
| | | } |
| | | config.setCreateBy(getUsername()); |
| | | configService.insertConfig(config); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹åæ°é
ç½® |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:config:edit')") |
| | | @Log(title = "åæ°ç®¡ç", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public R<?> edit(@Validated @RequestBody SysConfig config) |
| | | { |
| | | if (!configService.checkConfigKeyUnique(config)) |
| | | { |
| | | return R.fail("ä¿®æ¹åæ°'" + config.getConfigName() + "'失败ï¼åæ°é®åå·²åå¨"); |
| | | } |
| | | config.setUpdateBy(getUsername()); |
| | | configService.updateConfig(config); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * å é¤åæ°é
ç½® |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:config:remove')") |
| | | @Log(title = "åæ°ç®¡ç", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{configIds}") |
| | | public R<?> remove(@PathVariable Long[] configIds) |
| | | { |
| | | configService.deleteConfigByIds(configIds); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * å·æ°åæ°ç¼å |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:config:remove')") |
| | | @Log(title = "åæ°ç®¡ç", businessType = BusinessType.CLEAN) |
| | | @DeleteMapping("/refreshCache") |
| | | public R<?> refreshCache() |
| | | { |
| | | configService.resetConfigCache(); |
| | | return R.ok(); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.project.system.controller;
|
| | |
|
| | | import java.util.List;
|
| | |
|
| | | import lombok.AllArgsConstructor;
|
| | | import org.apache.commons.lang3.ArrayUtils;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.security.access.prepost.PreAuthorize;
|
| | | import org.springframework.validation.annotation.Validated;
|
| | | import org.springframework.web.bind.annotation.DeleteMapping;
|
| | | import org.springframework.web.bind.annotation.GetMapping;
|
| | | import org.springframework.web.bind.annotation.PathVariable;
|
| | | import org.springframework.web.bind.annotation.PostMapping;
|
| | | import org.springframework.web.bind.annotation.PutMapping;
|
| | | import org.springframework.web.bind.annotation.RequestBody;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.bind.annotation.RestController;
|
| | | import com.ruoyi.common.constant.UserConstants;
|
| | | import com.ruoyi.common.utils.StringUtils;
|
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log;
|
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
|
| | | import com.ruoyi.framework.web.controller.BaseController;
|
| | | import com.ruoyi.framework.web.domain.AjaxResult;
|
| | | import com.ruoyi.project.system.domain.SysDept;
|
| | | import com.ruoyi.project.system.service.ISysDeptService;
|
| | |
|
| | | /**
|
| | | * é¨é¨ä¿¡æ¯
|
| | | * |
| | | * @author ruoyi
|
| | | */
|
| | | @RestController
|
| | | @RequestMapping("/system/dept")
|
| | | @AllArgsConstructor
|
| | | public class SysDeptController extends BaseController
|
| | | {
|
| | | private ISysDeptService deptService;
|
| | |
|
| | | /**
|
| | | * è·åé¨é¨å表
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('system:dept:list')")
|
| | | @GetMapping("/list")
|
| | | public AjaxResult list(SysDept dept)
|
| | | {
|
| | | List<SysDept> depts = deptService.selectDeptList(dept);
|
| | | return success(depts);
|
| | | }
|
| | |
|
| | | /**
|
| | | * æ¥è¯¢é¨é¨åè¡¨ï¼æé¤èç¹ï¼
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('system:dept:list')")
|
| | | @GetMapping("/list/exclude/{deptId}")
|
| | | public AjaxResult excludeChild(@PathVariable(value = "deptId", required = false) Long deptId)
|
| | | {
|
| | | List<SysDept> depts = deptService.selectDeptList(new SysDept());
|
| | | depts.removeIf(d -> d.getDeptId().intValue() == deptId || ArrayUtils.contains(StringUtils.split(d.getAncestors(), ","), deptId + ""));
|
| | | return success(depts);
|
| | | }
|
| | |
|
| | | /**
|
| | | * æ ¹æ®é¨é¨ç¼å·è·å详ç»ä¿¡æ¯
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('system:dept:query')")
|
| | | @GetMapping(value = "/{deptId}")
|
| | | public AjaxResult getInfo(@PathVariable Long deptId)
|
| | | {
|
| | | deptService.checkDeptDataScope(deptId);
|
| | | return success(deptService.selectDeptById(deptId));
|
| | | }
|
| | |
|
| | | /**
|
| | | * æ°å¢é¨é¨
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('system:dept:add')")
|
| | | @Log(title = "é¨é¨ç®¡ç", businessType = BusinessType.INSERT)
|
| | | @PostMapping
|
| | | public AjaxResult add(@Validated @RequestBody SysDept dept)
|
| | | {
|
| | | if (!deptService.checkDeptNameUnique(dept))
|
| | | {
|
| | | return error("æ°å¢é¨é¨'" + dept.getDeptName() + "'失败ï¼é¨é¨åç§°å·²åå¨");
|
| | | }
|
| | | dept.setCreateBy(getUsername());
|
| | | return toAjax(deptService.insertDept(dept));
|
| | | }
|
| | |
|
| | | /**
|
| | | * ä¿®æ¹é¨é¨
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('system:dept:edit')")
|
| | | @Log(title = "é¨é¨ç®¡ç", businessType = BusinessType.UPDATE)
|
| | | @PutMapping
|
| | | public AjaxResult edit(@Validated @RequestBody SysDept dept)
|
| | | {
|
| | | Long deptId = dept.getDeptId();
|
| | | deptService.checkDeptDataScope(deptId);
|
| | | if (!deptService.checkDeptNameUnique(dept))
|
| | | {
|
| | | return error("ä¿®æ¹é¨é¨'" + dept.getDeptName() + "'失败ï¼é¨é¨åç§°å·²åå¨");
|
| | | }
|
| | | else if (dept.getParentId().equals(deptId))
|
| | | {
|
| | | return error("ä¿®æ¹é¨é¨'" + dept.getDeptName() + "'失败ï¼ä¸çº§é¨é¨ä¸è½æ¯èªå·±");
|
| | | }
|
| | | else if (StringUtils.equals(UserConstants.DEPT_DISABLE, dept.getStatus()) && deptService.selectNormalChildrenDeptById(deptId) > 0)
|
| | | {
|
| | | return error("该é¨é¨å
嫿ªåç¨çåé¨é¨ï¼");
|
| | | }
|
| | | dept.setUpdateBy(getUsername());
|
| | | return toAjax(deptService.updateDept(dept));
|
| | | }
|
| | |
|
| | | /**
|
| | | * å é¤é¨é¨
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('system:dept:remove')")
|
| | | @Log(title = "é¨é¨ç®¡ç", businessType = BusinessType.DELETE)
|
| | | @DeleteMapping("/{deptId}")
|
| | | public AjaxResult remove(@PathVariable Long deptId)
|
| | | {
|
| | | if (deptService.hasChildByDeptId(deptId))
|
| | | {
|
| | | return warn("åå¨ä¸çº§é¨é¨,ä¸å
许å é¤");
|
| | | }
|
| | | if (deptService.checkDeptExistUser(deptId))
|
| | | {
|
| | | return warn("é¨é¨åå¨ç¨æ·,ä¸å
许å é¤");
|
| | | }
|
| | | deptService.checkDeptDataScope(deptId);
|
| | | return toAjax(deptService.deleteDeptById(deptId));
|
| | | }
|
| | | }
|
| | | package com.ruoyi.project.system.controller; |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.ruoyi.common.constant.HttpStatus; |
| | | import lombok.AllArgsConstructor; |
| | | import org.apache.commons.lang3.ArrayUtils; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ruoyi.common.constant.UserConstants; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.project.system.domain.SysDept; |
| | | import com.ruoyi.project.system.service.ISysDeptService; |
| | | |
| | | /** |
| | | * é¨é¨ä¿¡æ¯ |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/system/dept") |
| | | @AllArgsConstructor |
| | | public class SysDeptController extends BaseController |
| | | { |
| | | private ISysDeptService deptService; |
| | | |
| | | /** |
| | | * è·åé¨é¨å表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dept:list')") |
| | | @GetMapping("/list") |
| | | public R<?> list(SysDept dept) |
| | | { |
| | | List<SysDept> depts = deptService.selectDeptList(dept); |
| | | return R.ok(depts); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢é¨é¨åè¡¨ï¼æé¤èç¹ï¼ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dept:list')") |
| | | @GetMapping("/list/exclude/{deptId}") |
| | | public R<?> excludeChild(@PathVariable(value = "deptId", required = false) Long deptId) |
| | | { |
| | | List<SysDept> depts = deptService.selectDeptList(new SysDept()); |
| | | depts.removeIf(d -> d.getDeptId().intValue() == deptId || ArrayUtils.contains(StringUtils.split(d.getAncestors(), ","), deptId + "")); |
| | | return R.ok(depts); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®é¨é¨ç¼å·è·å详ç»ä¿¡æ¯ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dept:query')") |
| | | @GetMapping(value = "/{deptId}") |
| | | public R<?> getInfo(@PathVariable Long deptId) |
| | | { |
| | | deptService.checkDeptDataScope(deptId); |
| | | return R.ok(deptService.selectDeptById(deptId)); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢é¨é¨ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dept:add')") |
| | | @Log(title = "é¨é¨ç®¡ç", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public R<?> add(@Validated @RequestBody SysDept dept) |
| | | { |
| | | if (!deptService.checkDeptNameUnique(dept)) |
| | | { |
| | | return R.fail("æ°å¢é¨é¨'" + dept.getDeptName() + "'失败ï¼é¨é¨åç§°å·²åå¨"); |
| | | } |
| | | dept.setCreateBy(getUsername()); |
| | | deptService.insertDept(dept); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹é¨é¨ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dept:edit')") |
| | | @Log(title = "é¨é¨ç®¡ç", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public R<?> edit(@Validated @RequestBody SysDept dept) |
| | | { |
| | | Long deptId = dept.getDeptId(); |
| | | deptService.checkDeptDataScope(deptId); |
| | | if (!deptService.checkDeptNameUnique(dept)) |
| | | { |
| | | return R.fail("ä¿®æ¹é¨é¨'" + dept.getDeptName() + "'失败ï¼é¨é¨åç§°å·²åå¨"); |
| | | } |
| | | else if (dept.getParentId().equals(deptId)) |
| | | { |
| | | return R.fail("ä¿®æ¹é¨é¨'" + dept.getDeptName() + "'失败ï¼ä¸çº§é¨é¨ä¸è½æ¯èªå·±"); |
| | | } |
| | | else if (StringUtils.equals(UserConstants.DEPT_DISABLE, dept.getStatus()) && deptService.selectNormalChildrenDeptById(deptId) > 0) |
| | | { |
| | | return R.fail("该é¨é¨å
嫿ªåç¨çåé¨é¨ï¼"); |
| | | } |
| | | dept.setUpdateBy(getUsername()); |
| | | deptService.updateDept(dept); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * å é¤é¨é¨ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dept:remove')") |
| | | @Log(title = "é¨é¨ç®¡ç", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{deptId}") |
| | | public R<?> remove(@PathVariable Long deptId) |
| | | { |
| | | if (deptService.hasChildByDeptId(deptId)) |
| | | { |
| | | return R.fail(HttpStatus.WARN, "åå¨ä¸çº§é¨é¨,ä¸å
许å é¤"); |
| | | } |
| | | if (deptService.checkDeptExistUser(deptId)) |
| | | { |
| | | return R.fail(HttpStatus.WARN, "é¨é¨åå¨ç¨æ·,ä¸å
许å é¤"); |
| | | } |
| | | deptService.checkDeptDataScope(deptId); |
| | | deptService.deleteDeptById(deptId); |
| | | return R.ok(); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.project.system.controller;
|
| | |
|
| | | import java.util.ArrayList;
|
| | | import java.util.List;
|
| | | import jakarta.servlet.http.HttpServletResponse;
|
| | | import lombok.AllArgsConstructor;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.security.access.prepost.PreAuthorize;
|
| | | import org.springframework.validation.annotation.Validated;
|
| | | import org.springframework.web.bind.annotation.DeleteMapping;
|
| | | import org.springframework.web.bind.annotation.GetMapping;
|
| | | import org.springframework.web.bind.annotation.PathVariable;
|
| | | import org.springframework.web.bind.annotation.PostMapping;
|
| | | import org.springframework.web.bind.annotation.PutMapping;
|
| | | import org.springframework.web.bind.annotation.RequestBody;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.bind.annotation.RestController;
|
| | | import com.ruoyi.common.utils.StringUtils;
|
| | | import com.ruoyi.common.utils.poi.ExcelUtil;
|
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log;
|
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
|
| | | import com.ruoyi.framework.web.controller.BaseController;
|
| | | import com.ruoyi.framework.web.domain.AjaxResult;
|
| | | import com.ruoyi.framework.web.page.TableDataInfo;
|
| | | import com.ruoyi.project.system.domain.SysDictData;
|
| | | import com.ruoyi.project.system.service.ISysDictDataService;
|
| | | import com.ruoyi.project.system.service.ISysDictTypeService;
|
| | |
|
| | | /**
|
| | | * æ°æ®åå
¸ä¿¡æ¯
|
| | | * |
| | | * @author ruoyi
|
| | | */
|
| | | @RestController
|
| | | @RequestMapping("/system/dict/data")
|
| | | @AllArgsConstructor
|
| | | public class SysDictDataController extends BaseController
|
| | | {
|
| | | private ISysDictDataService dictDataService;
|
| | | private ISysDictTypeService dictTypeService;
|
| | |
|
| | | @PreAuthorize("@ss.hasPermi('system:dict:list')")
|
| | | @GetMapping("/list")
|
| | | public TableDataInfo list(SysDictData dictData)
|
| | | {
|
| | | startPage();
|
| | | List<SysDictData> list = dictDataService.selectDictDataList(dictData);
|
| | | return getDataTable(list);
|
| | | }
|
| | |
|
| | | @Log(title = "åå
¸æ°æ®", businessType = BusinessType.EXPORT)
|
| | | @PreAuthorize("@ss.hasPermi('system:dict:export')")
|
| | | @PostMapping("/export")
|
| | | public void export(HttpServletResponse response, SysDictData dictData)
|
| | | {
|
| | | List<SysDictData> list = dictDataService.selectDictDataList(dictData);
|
| | | ExcelUtil<SysDictData> util = new ExcelUtil<SysDictData>(SysDictData.class);
|
| | | util.exportExcel(response, list, "åå
¸æ°æ®");
|
| | | }
|
| | |
|
| | | /**
|
| | | * æ¥è¯¢åå
¸æ°æ®è¯¦ç»
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('system:dict:query')")
|
| | | @GetMapping(value = "/{dictCode}")
|
| | | public AjaxResult getInfo(@PathVariable Long dictCode)
|
| | | {
|
| | | return success(dictDataService.selectDictDataById(dictCode));
|
| | | }
|
| | |
|
| | | /**
|
| | | * æ ¹æ®åå
¸ç±»åæ¥è¯¢åå
¸æ°æ®ä¿¡æ¯
|
| | | */
|
| | | @GetMapping(value = "/type/{dictType}")
|
| | | public AjaxResult dictType(@PathVariable String dictType)
|
| | | {
|
| | | List<SysDictData> data = dictTypeService.selectDictDataByType(dictType);
|
| | | if (StringUtils.isNull(data))
|
| | | {
|
| | | data = new ArrayList<SysDictData>();
|
| | | }
|
| | | return success(data);
|
| | | }
|
| | |
|
| | | /**
|
| | | * æ°å¢åå
¸ç±»å
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('system:dict:add')")
|
| | | @Log(title = "åå
¸æ°æ®", businessType = BusinessType.INSERT)
|
| | | @PostMapping
|
| | | public AjaxResult add(@Validated @RequestBody SysDictData dict)
|
| | | {
|
| | | dict.setCreateBy(getUsername());
|
| | | return toAjax(dictDataService.insertDictData(dict));
|
| | | }
|
| | |
|
| | | /**
|
| | | * ä¿®æ¹ä¿ååå
¸ç±»å
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('system:dict:edit')")
|
| | | @Log(title = "åå
¸æ°æ®", businessType = BusinessType.UPDATE)
|
| | | @PutMapping
|
| | | public AjaxResult edit(@Validated @RequestBody SysDictData dict)
|
| | | {
|
| | | dict.setUpdateBy(getUsername());
|
| | | return toAjax(dictDataService.updateDictData(dict));
|
| | | }
|
| | |
|
| | | /**
|
| | | * å é¤åå
¸ç±»å
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('system:dict:remove')")
|
| | | @Log(title = "åå
¸ç±»å", businessType = BusinessType.DELETE)
|
| | | @DeleteMapping("/{dictCodes}")
|
| | | public AjaxResult remove(@PathVariable Long[] dictCodes)
|
| | | {
|
| | | dictDataService.deleteDictDataByIds(dictCodes);
|
| | | return success();
|
| | | }
|
| | | }
|
| | | package com.ruoyi.project.system.controller; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.framework.web.page.TableDataInfo; |
| | | import com.ruoyi.project.system.domain.SysDictData; |
| | | import com.ruoyi.project.system.service.ISysDictDataService; |
| | | import com.ruoyi.project.system.service.ISysDictTypeService; |
| | | |
| | | /** |
| | | * æ°æ®åå
¸ä¿¡æ¯ |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/system/dict/data") |
| | | @AllArgsConstructor |
| | | public class SysDictDataController extends BaseController |
| | | { |
| | | private ISysDictDataService dictDataService; |
| | | private ISysDictTypeService dictTypeService; |
| | | |
| | | @PreAuthorize("@ss.hasPermi('system:dict:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(SysDictData dictData) |
| | | { |
| | | startPage(); |
| | | List<SysDictData> list = dictDataService.selectDictDataList(dictData); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | @Log(title = "åå
¸æ°æ®", businessType = BusinessType.EXPORT) |
| | | @PreAuthorize("@ss.hasPermi('system:dict:export')") |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, SysDictData dictData) |
| | | { |
| | | List<SysDictData> list = dictDataService.selectDictDataList(dictData); |
| | | ExcelUtil<SysDictData> util = new ExcelUtil<SysDictData>(SysDictData.class); |
| | | util.exportExcel(response, list, "åå
¸æ°æ®"); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢åå
¸æ°æ®è¯¦ç» |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dict:query')") |
| | | @GetMapping(value = "/{dictCode}") |
| | | public R<?> getInfo(@PathVariable Long dictCode) |
| | | { |
| | | return R.ok(dictDataService.selectDictDataById(dictCode)); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®åå
¸ç±»åæ¥è¯¢åå
¸æ°æ®ä¿¡æ¯ |
| | | */ |
| | | @GetMapping(value = "/type/{dictType}") |
| | | public R<?> dictType(@PathVariable String dictType) |
| | | { |
| | | List<SysDictData> data = dictTypeService.selectDictDataByType(dictType); |
| | | if (StringUtils.isNull(data)) |
| | | { |
| | | data = new ArrayList<SysDictData>(); |
| | | } |
| | | return R.ok(data); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢åå
¸ç±»å |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dict:add')") |
| | | @Log(title = "åå
¸æ°æ®", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public R<?> add(@Validated @RequestBody SysDictData dict) |
| | | { |
| | | dict.setCreateBy(getUsername()); |
| | | dictDataService.insertDictData(dict); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ä¿ååå
¸ç±»å |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dict:edit')") |
| | | @Log(title = "åå
¸æ°æ®", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public R<?> edit(@Validated @RequestBody SysDictData dict) |
| | | { |
| | | dict.setUpdateBy(getUsername()); |
| | | dictDataService.updateDictData(dict); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * å é¤åå
¸ç±»å |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dict:remove')") |
| | | @Log(title = "åå
¸ç±»å", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{dictCodes}") |
| | | public R<?> remove(@PathVariable Long[] dictCodes) |
| | | { |
| | | dictDataService.deleteDictDataByIds(dictCodes); |
| | | return R.ok(); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.project.system.controller;
|
| | |
|
| | | import java.util.List;
|
| | | import jakarta.servlet.http.HttpServletResponse;
|
| | | import lombok.AllArgsConstructor;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.security.access.prepost.PreAuthorize;
|
| | | import org.springframework.validation.annotation.Validated;
|
| | | import org.springframework.web.bind.annotation.DeleteMapping;
|
| | | import org.springframework.web.bind.annotation.GetMapping;
|
| | | import org.springframework.web.bind.annotation.PathVariable;
|
| | | import org.springframework.web.bind.annotation.PostMapping;
|
| | | import org.springframework.web.bind.annotation.PutMapping;
|
| | | import org.springframework.web.bind.annotation.RequestBody;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.bind.annotation.RestController;
|
| | | import com.ruoyi.common.utils.poi.ExcelUtil;
|
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log;
|
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
|
| | | import com.ruoyi.framework.web.controller.BaseController;
|
| | | import com.ruoyi.framework.web.domain.AjaxResult;
|
| | | import com.ruoyi.framework.web.page.TableDataInfo;
|
| | | import com.ruoyi.project.system.domain.SysDictType;
|
| | | import com.ruoyi.project.system.service.ISysDictTypeService;
|
| | |
|
| | | /**
|
| | | * æ°æ®åå
¸ä¿¡æ¯
|
| | | * |
| | | * @author ruoyi
|
| | | */
|
| | | @RestController
|
| | | @RequestMapping("/system/dict/type")
|
| | | @AllArgsConstructor
|
| | | public class SysDictTypeController extends BaseController
|
| | | {
|
| | | private ISysDictTypeService dictTypeService;
|
| | |
|
| | | @PreAuthorize("@ss.hasPermi('system:dict:list')")
|
| | | @GetMapping("/list")
|
| | | public TableDataInfo list(SysDictType dictType)
|
| | | {
|
| | | startPage();
|
| | | List<SysDictType> list = dictTypeService.selectDictTypeList(dictType);
|
| | | return getDataTable(list);
|
| | | }
|
| | |
|
| | | @Log(title = "åå
¸ç±»å", businessType = BusinessType.EXPORT)
|
| | | @PreAuthorize("@ss.hasPermi('system:dict:export')")
|
| | | @PostMapping("/export")
|
| | | public void export(HttpServletResponse response, SysDictType dictType)
|
| | | {
|
| | | List<SysDictType> list = dictTypeService.selectDictTypeList(dictType);
|
| | | ExcelUtil<SysDictType> util = new ExcelUtil<SysDictType>(SysDictType.class);
|
| | | util.exportExcel(response, list, "åå
¸ç±»å");
|
| | | }
|
| | |
|
| | | /**
|
| | | * æ¥è¯¢åå
¸ç±»å详ç»
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('system:dict:query')")
|
| | | @GetMapping(value = "/{dictId}")
|
| | | public AjaxResult getInfo(@PathVariable Long dictId)
|
| | | {
|
| | | return success(dictTypeService.selectDictTypeById(dictId));
|
| | | }
|
| | |
|
| | | /**
|
| | | * æ°å¢åå
¸ç±»å
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('system:dict:add')")
|
| | | @Log(title = "åå
¸ç±»å", businessType = BusinessType.INSERT)
|
| | | @PostMapping
|
| | | public AjaxResult add(@Validated @RequestBody SysDictType dict)
|
| | | {
|
| | | if (!dictTypeService.checkDictTypeUnique(dict))
|
| | | {
|
| | | return error("æ°å¢åå
¸'" + dict.getDictName() + "'失败ï¼åå
¸ç±»åå·²åå¨");
|
| | | }
|
| | | dict.setCreateBy(getUsername());
|
| | | return toAjax(dictTypeService.insertDictType(dict));
|
| | | }
|
| | |
|
| | | /**
|
| | | * ä¿®æ¹åå
¸ç±»å
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('system:dict:edit')")
|
| | | @Log(title = "åå
¸ç±»å", businessType = BusinessType.UPDATE)
|
| | | @PutMapping
|
| | | public AjaxResult edit(@Validated @RequestBody SysDictType dict)
|
| | | {
|
| | | if (!dictTypeService.checkDictTypeUnique(dict))
|
| | | {
|
| | | return error("ä¿®æ¹åå
¸'" + dict.getDictName() + "'失败ï¼åå
¸ç±»åå·²åå¨");
|
| | | }
|
| | | dict.setUpdateBy(getUsername());
|
| | | return toAjax(dictTypeService.updateDictType(dict));
|
| | | }
|
| | |
|
| | | /**
|
| | | * å é¤åå
¸ç±»å
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('system:dict:remove')")
|
| | | @Log(title = "åå
¸ç±»å", businessType = BusinessType.DELETE)
|
| | | @DeleteMapping("/{dictIds}")
|
| | | public AjaxResult remove(@PathVariable Long[] dictIds)
|
| | | {
|
| | | dictTypeService.deleteDictTypeByIds(dictIds);
|
| | | return success();
|
| | | }
|
| | |
|
| | | /**
|
| | | * å·æ°åå
¸ç¼å
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('system:dict:remove')")
|
| | | @Log(title = "åå
¸ç±»å", businessType = BusinessType.CLEAN)
|
| | | @DeleteMapping("/refreshCache")
|
| | | public AjaxResult refreshCache()
|
| | | {
|
| | | dictTypeService.resetDictCache();
|
| | | return success();
|
| | | }
|
| | |
|
| | | /**
|
| | | * è·ååå
¸éæ©æ¡å表
|
| | | */
|
| | | @GetMapping("/optionselect")
|
| | | public AjaxResult optionselect()
|
| | | {
|
| | | List<SysDictType> dictTypes = dictTypeService.selectDictTypeAll();
|
| | | return success(dictTypes);
|
| | | }
|
| | | }
|
| | | package com.ruoyi.project.system.controller; |
| | | |
| | | import java.util.List; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.framework.web.page.TableDataInfo; |
| | | import com.ruoyi.project.system.domain.SysDictType; |
| | | import com.ruoyi.project.system.service.ISysDictTypeService; |
| | | |
| | | /** |
| | | * æ°æ®åå
¸ä¿¡æ¯ |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/system/dict/type") |
| | | @AllArgsConstructor |
| | | public class SysDictTypeController extends BaseController |
| | | { |
| | | private ISysDictTypeService dictTypeService; |
| | | |
| | | @PreAuthorize("@ss.hasPermi('system:dict:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(SysDictType dictType) |
| | | { |
| | | startPage(); |
| | | List<SysDictType> list = dictTypeService.selectDictTypeList(dictType); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | @Log(title = "åå
¸ç±»å", businessType = BusinessType.EXPORT) |
| | | @PreAuthorize("@ss.hasPermi('system:dict:export')") |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, SysDictType dictType) |
| | | { |
| | | List<SysDictType> list = dictTypeService.selectDictTypeList(dictType); |
| | | ExcelUtil<SysDictType> util = new ExcelUtil<SysDictType>(SysDictType.class); |
| | | util.exportExcel(response, list, "åå
¸ç±»å"); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢åå
¸ç±»åè¯¦ç» |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dict:query')") |
| | | @GetMapping(value = "/{dictId}") |
| | | public R<?> getInfo(@PathVariable Long dictId) |
| | | { |
| | | return R.ok(dictTypeService.selectDictTypeById(dictId)); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢åå
¸ç±»å |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dict:add')") |
| | | @Log(title = "åå
¸ç±»å", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public R<?> add(@Validated @RequestBody SysDictType dict) |
| | | { |
| | | if (!dictTypeService.checkDictTypeUnique(dict)) |
| | | { |
| | | return R.fail("æ°å¢åå
¸'" + dict.getDictName() + "'失败ï¼åå
¸ç±»åå·²åå¨"); |
| | | } |
| | | dict.setCreateBy(getUsername()); |
| | | dictTypeService.insertDictType(dict); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹åå
¸ç±»å |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dict:edit')") |
| | | @Log(title = "åå
¸ç±»å", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public R<?> edit(@Validated @RequestBody SysDictType dict) |
| | | { |
| | | if (!dictTypeService.checkDictTypeUnique(dict)) |
| | | { |
| | | return R.fail("ä¿®æ¹åå
¸'" + dict.getDictName() + "'失败ï¼åå
¸ç±»åå·²åå¨"); |
| | | } |
| | | dict.setUpdateBy(getUsername()); |
| | | dictTypeService.updateDictType(dict); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * å é¤åå
¸ç±»å |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dict:remove')") |
| | | @Log(title = "åå
¸ç±»å", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{dictIds}") |
| | | public R<?> remove(@PathVariable Long[] dictIds) |
| | | { |
| | | dictTypeService.deleteDictTypeByIds(dictIds); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * å·æ°åå
¸ç¼å |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dict:remove')") |
| | | @Log(title = "åå
¸ç±»å", businessType = BusinessType.CLEAN) |
| | | @DeleteMapping("/refreshCache") |
| | | public R<?> refreshCache() |
| | | { |
| | | dictTypeService.resetDictCache(); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * è·ååå
¸éæ©æ¡å表 |
| | | */ |
| | | @GetMapping("/optionselect") |
| | | public R<?> optionselect() |
| | | { |
| | | List<SysDictType> dictTypes = dictTypeService.selectDictTypeAll(); |
| | | return R.ok(dictTypes); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.project.system.controller;
|
| | |
|
| | | import com.ruoyi.common.constant.Constants;
|
| | | import com.ruoyi.common.utils.SecurityUtils;
|
| | | import com.ruoyi.framework.security.LoginBody;
|
| | | import com.ruoyi.framework.security.LoginUser;
|
| | | import com.ruoyi.framework.security.service.SysLoginService;
|
| | | import com.ruoyi.framework.security.service.SysPermissionService;
|
| | | import com.ruoyi.framework.security.service.TokenService;
|
| | | import com.ruoyi.framework.web.domain.AjaxResult;
|
| | | import com.ruoyi.project.system.domain.SysDept;
|
| | | import com.ruoyi.project.system.domain.SysMenu;
|
| | | import com.ruoyi.project.system.domain.SysUser;
|
| | | import com.ruoyi.project.system.domain.vo.SysUserDeptVo;
|
| | | import com.ruoyi.project.system.mapper.SysDeptMapper;
|
| | | import com.ruoyi.project.system.service.ISysMenuService;
|
| | | import com.ruoyi.project.system.service.ISysUserDeptService;
|
| | | import com.ruoyi.project.system.service.ISysUserService;
|
| | | import lombok.AllArgsConstructor;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.util.ObjectUtils;
|
| | | import org.springframework.web.bind.annotation.GetMapping;
|
| | | import org.springframework.web.bind.annotation.PostMapping;
|
| | | import org.springframework.web.bind.annotation.RequestBody;
|
| | | import org.springframework.web.bind.annotation.RestController;
|
| | |
|
| | | import java.util.ArrayList;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | | import java.util.Set;
|
| | | import java.util.stream.Collectors;
|
| | |
|
| | | /**
|
| | | * ç»å½éªè¯
|
| | | * |
| | | * @author ruoyi
|
| | | */
|
| | | @RestController
|
| | | @AllArgsConstructor
|
| | | public class SysLoginController
|
| | | {
|
| | | private SysLoginService loginService;
|
| | | private ISysMenuService menuService;
|
| | | private SysPermissionService permissionService;
|
| | | private TokenService tokenService;
|
| | | private ISysUserDeptService userDeptService;
|
| | | private ISysUserService userService;
|
| | | private SysDeptMapper sysDeptMapper;
|
| | |
|
| | | /**
|
| | | * ç»å½æ¹æ³
|
| | | * |
| | | * @param loginBody ç»å½ä¿¡æ¯
|
| | | * @return ç»æ
|
| | | */
|
| | | @PostMapping("/login")
|
| | | public AjaxResult login(@RequestBody LoginBody loginBody)
|
| | | {
|
| | | AjaxResult ajax = AjaxResult.success();
|
| | | // çæä»¤ç
|
| | | String token = loginService.login(loginBody.getUsername(), loginBody.getPassword(), loginBody.getCode(),
|
| | | loginBody.getUuid());
|
| | | ajax.put(Constants.TOKEN, token);
|
| | | return ajax;
|
| | | }
|
| | |
|
| | | /**
|
| | | * è·åç¨æ·ä¿¡æ¯
|
| | | * |
| | | * @return ç¨æ·ä¿¡æ¯
|
| | | */
|
| | | @GetMapping("/getInfo")
|
| | | public AjaxResult getInfo()
|
| | | {
|
| | | LoginUser loginUser = SecurityUtils.getLoginUser();
|
| | | SysUser user = loginUser.getUser();
|
| | | // è·åå½åç»å½å
¬å¸
|
| | | Long tenantId = loginUser.getTenantId();
|
| | | if(null != tenantId){
|
| | | user.setTenantId(tenantId);
|
| | | SysDept sysDept = sysDeptMapper.selectDeptById(tenantId.longValue());
|
| | | if(!ObjectUtils.isEmpty(sysDept)){
|
| | | user.setCurrentFactoryName(sysDept.getDeptName());
|
| | | }
|
| | | }
|
| | | // è§è²éå
|
| | | Set<String> roles = permissionService.getRolePermission(user);
|
| | | // æééå
|
| | | Set<String> permissions = permissionService.getMenuPermission(user);
|
| | | if (!loginUser.getPermissions().equals(permissions))
|
| | | {
|
| | | loginUser.setPermissions(permissions);
|
| | | tokenService.refreshToken(loginUser);
|
| | | }
|
| | | AjaxResult ajax = AjaxResult.success();
|
| | | ajax.put("user", user);
|
| | | ajax.put("aiEnabled", loginUser.getAiEnabled());
|
| | | ajax.put("roles", roles);
|
| | | ajax.put("permissions", permissions);
|
| | | return ajax;
|
| | | }
|
| | |
|
| | | /**
|
| | | * è·åè·¯ç±ä¿¡æ¯
|
| | | * |
| | | * @return è·¯ç±ä¿¡æ¯
|
| | | */
|
| | | @GetMapping("getRouters")
|
| | | public AjaxResult getRouters()
|
| | | {
|
| | | Long userId = SecurityUtils.getUserId();
|
| | | List<SysMenu> menus = menuService.selectMenuTreeByUserId(userId);
|
| | | return AjaxResult.success(menuService.buildMenus(menus));
|
| | | }
|
| | |
|
| | | @PostMapping("/loginCheck")
|
| | | public AjaxResult loginCheck(@RequestBody LoginBody loginBody)
|
| | | {
|
| | | try {
|
| | | Long userId = loginService.loginCheck(loginBody.getUsername(), loginBody.getPassword());
|
| | | return AjaxResult.success(userId);
|
| | | }catch (Exception e) {
|
| | | return AjaxResult.error(e.getMessage());
|
| | | }
|
| | | }
|
| | |
|
| | | @GetMapping("/userLoginFacotryList")
|
| | | public AjaxResult userLoginFacotryList(SysUserDeptVo sysUserDeptVo){
|
| | | List<SysUserDeptVo> sysUserDeptVoList = userDeptService.userLoginFacotryList(sysUserDeptVo);
|
| | | Map<Long, SysUserDeptVo> map = sysUserDeptVoList.stream()
|
| | | .collect(Collectors.toMap(
|
| | | SysUserDeptVo::getDeptId,
|
| | | item -> item,
|
| | | (existing, replacement) -> existing // 妿éå¤ï¼ä¿ç第ä¸ä¸ª
|
| | | ));
|
| | | List<SysUserDeptVo> uniqueList = new ArrayList<>(map.values());
|
| | | return AjaxResult.success(uniqueList);
|
| | | }
|
| | |
|
| | | /**
|
| | | * éæ©å
¬å¸ç»å½
|
| | | *
|
| | | * @param loginBody ç»å½ä¿¡æ¯
|
| | | * @return ç»æ
|
| | | */
|
| | | @PostMapping("/loginCheckFactory")
|
| | | public AjaxResult loginCheckFactory(@RequestBody LoginBody loginBody)
|
| | | {
|
| | | AjaxResult ajax = AjaxResult.success();
|
| | | // çæä»¤ç
|
| | | String token = loginService.loginCheckFactory(loginBody.getUsername(), loginBody.getPassword(),loginBody.getFactoryId());
|
| | | ajax.put(Constants.TOKEN, token);
|
| | | return ajax;
|
| | | }
|
| | | }
|
| | | package com.ruoyi.project.system.controller; |
| | | |
| | | import com.ruoyi.common.constant.Constants; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.framework.security.LoginBody; |
| | | import com.ruoyi.framework.security.LoginUser; |
| | | import com.ruoyi.framework.security.service.SysLoginService; |
| | | import com.ruoyi.framework.security.service.SysPermissionService; |
| | | import com.ruoyi.framework.security.service.TokenService; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.project.system.domain.SysDept; |
| | | import com.ruoyi.project.system.domain.SysMenu; |
| | | import com.ruoyi.project.system.domain.SysUser; |
| | | import com.ruoyi.project.system.domain.vo.SysUserDeptVo; |
| | | import com.ruoyi.project.system.mapper.SysDeptMapper; |
| | | import com.ruoyi.project.system.service.ISysMenuService; |
| | | import com.ruoyi.project.system.service.ISysUserDeptService; |
| | | import com.ruoyi.project.system.service.ISysUserService; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.util.ObjectUtils; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Set; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * ç»å½éªè¯ |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @AllArgsConstructor |
| | | public class SysLoginController extends BaseController |
| | | { |
| | | private SysLoginService loginService; |
| | | private ISysMenuService menuService; |
| | | private SysPermissionService permissionService; |
| | | private TokenService tokenService; |
| | | private ISysUserDeptService userDeptService; |
| | | private ISysUserService userService; |
| | | private SysDeptMapper sysDeptMapper; |
| | | |
| | | /** |
| | | * ç»å½æ¹æ³ |
| | | * |
| | | * @param loginBody ç»å½ä¿¡æ¯ |
| | | * @return ç»æ |
| | | */ |
| | | @PostMapping("/login") |
| | | public R<?> login(@RequestBody LoginBody loginBody) |
| | | { |
| | | // çæä»¤ç |
| | | String token = loginService.login(loginBody.getUsername(), loginBody.getPassword(), loginBody.getCode(), |
| | | loginBody.getUuid()); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put(Constants.TOKEN, token); |
| | | return R.ok(map); |
| | | } |
| | | |
| | | /** |
| | | * è·åç¨æ·ä¿¡æ¯ |
| | | * |
| | | * @return ç¨æ·ä¿¡æ¯ |
| | | */ |
| | | @GetMapping("/getInfo") |
| | | public R<?> getInfo() |
| | | { |
| | | LoginUser loginUser = SecurityUtils.getLoginUser(); |
| | | SysUser user = loginUser.getUser(); |
| | | // è·åå½åç»å½å
¬å¸ |
| | | Long tenantId = loginUser.getTenantId(); |
| | | if(null != tenantId){ |
| | | user.setTenantId(tenantId); |
| | | SysDept sysDept = sysDeptMapper.selectDeptById(tenantId.longValue()); |
| | | if(!ObjectUtils.isEmpty(sysDept)){ |
| | | user.setCurrentFactoryName(sysDept.getDeptName()); |
| | | } |
| | | } |
| | | // è§è²éå |
| | | Set<String> roles = permissionService.getRolePermission(user); |
| | | // æééå |
| | | Set<String> permissions = permissionService.getMenuPermission(user); |
| | | if (!loginUser.getPermissions().equals(permissions)) |
| | | { |
| | | loginUser.setPermissions(permissions); |
| | | tokenService.refreshToken(loginUser); |
| | | } |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("user", user); |
| | | map.put("aiEnabled", loginUser.getAiEnabled()); |
| | | map.put("roles", roles); |
| | | map.put("permissions", permissions); |
| | | return R.ok(map); |
| | | } |
| | | |
| | | /** |
| | | * è·åè·¯ç±ä¿¡æ¯ |
| | | * |
| | | * @return è·¯ç±ä¿¡æ¯ |
| | | */ |
| | | @GetMapping("getRouters") |
| | | public R<?> getRouters() |
| | | { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | List<SysMenu> menus = menuService.selectMenuTreeByUserId(userId); |
| | | return R.ok(menuService.buildMenus(menus)); |
| | | } |
| | | |
| | | @PostMapping("/loginCheck") |
| | | public R<?> loginCheck(@RequestBody LoginBody loginBody) |
| | | { |
| | | try { |
| | | Long userId = loginService.loginCheck(loginBody.getUsername(), loginBody.getPassword()); |
| | | return R.ok(userId); |
| | | }catch (Exception e) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | @GetMapping("/userLoginFacotryList") |
| | | public R<?> userLoginFacotryList(SysUserDeptVo sysUserDeptVo){ |
| | | List<SysUserDeptVo> sysUserDeptVoList = userDeptService.userLoginFacotryList(sysUserDeptVo); |
| | | Map<Long, SysUserDeptVo> map = sysUserDeptVoList.stream() |
| | | .collect(Collectors.toMap( |
| | | SysUserDeptVo::getDeptId, |
| | | item -> item, |
| | | (existing, replacement) -> existing // 妿éå¤ï¼ä¿ç第ä¸ä¸ª |
| | | )); |
| | | List<SysUserDeptVo> uniqueList = new ArrayList<>(map.values()); |
| | | return R.ok(uniqueList); |
| | | } |
| | | |
| | | /** |
| | | * éæ©å
¬å¸ç»å½ |
| | | * |
| | | * @param loginBody ç»å½ä¿¡æ¯ |
| | | * @return ç»æ |
| | | */ |
| | | @PostMapping("/loginCheckFactory") |
| | | public R<?> loginCheckFactory(@RequestBody LoginBody loginBody) |
| | | { |
| | | // çæä»¤ç |
| | | String token = loginService.loginCheckFactory(loginBody.getUsername(), loginBody.getPassword(),loginBody.getFactoryId()); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put(Constants.TOKEN, token); |
| | | return R.ok(map); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.project.system.controller;
|
| | |
|
| | | import com.ruoyi.common.constant.UserConstants;
|
| | | import com.ruoyi.common.utils.StringUtils;
|
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log;
|
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
|
| | | import com.ruoyi.framework.web.controller.BaseController;
|
| | | import com.ruoyi.framework.web.domain.AjaxResult;
|
| | | import com.ruoyi.project.system.domain.SysMenu;
|
| | | import com.ruoyi.project.system.service.ISysMenuService;
|
| | | import lombok.AllArgsConstructor;
|
| | | import org.springframework.security.access.prepost.PreAuthorize;
|
| | | import org.springframework.validation.annotation.Validated;
|
| | | import org.springframework.web.bind.annotation.*;
|
| | |
|
| | | import java.util.List;
|
| | |
|
| | | /**
|
| | | * èåä¿¡æ¯
|
| | | * |
| | | * @author ruoyi
|
| | | */
|
| | | @RestController
|
| | | @RequestMapping("/system/menu")
|
| | | @AllArgsConstructor
|
| | | public class SysMenuController extends BaseController
|
| | | {
|
| | | private ISysMenuService menuService;
|
| | |
|
| | | /**
|
| | | * è·åèåå表
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('system:menu:list')")
|
| | | @GetMapping("/list")
|
| | | public AjaxResult list(SysMenu menu)
|
| | | {
|
| | | List<SysMenu> menus = menuService.selectMenuList(menu, getUserId());
|
| | | return success(menus);
|
| | | }
|
| | |
|
| | | /**
|
| | | * æ ¹æ®èåç¼å·è·å详ç»ä¿¡æ¯
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('system:menu:query')")
|
| | | @GetMapping(value = "/{menuId}")
|
| | | public AjaxResult getInfo(@PathVariable Long menuId)
|
| | | {
|
| | | return success(menuService.selectMenuById(menuId));
|
| | | }
|
| | |
|
| | | /**
|
| | | * è·åèå䏿æ å表
|
| | | */
|
| | | @GetMapping("/treeselect")
|
| | | public AjaxResult treeselect(SysMenu menu)
|
| | | {
|
| | | List<SysMenu> menus = menuService.selectMenuList(menu, getUserId());
|
| | | return success(menuService.buildMenuTreeSelect(menus));
|
| | | }
|
| | |
|
| | | /**
|
| | | * å 载对åºè§è²èåå表æ
|
| | | */
|
| | | @GetMapping(value = "/roleMenuTreeselect/{roleId}")
|
| | | public AjaxResult roleMenuTreeselect(@PathVariable("roleId") Long roleId)
|
| | | {
|
| | | List<SysMenu> menus = menuService.selectMenuList(getUserId());
|
| | | AjaxResult ajax = AjaxResult.success();
|
| | | ajax.put("checkedKeys", menuService.selectMenuListByRoleId(roleId));
|
| | | ajax.put("menus", menuService.buildMenuTreeSelect(menus));
|
| | | return ajax;
|
| | | }
|
| | |
|
| | | /**
|
| | | * æ°å¢èå
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('system:menu:add')")
|
| | | @Log(title = "èå管ç", businessType = BusinessType.INSERT)
|
| | | @PostMapping
|
| | | public AjaxResult add(@Validated @RequestBody SysMenu menu)
|
| | | {
|
| | | if (!menuService.checkMenuNameUnique(menu))
|
| | | {
|
| | | return error("æ°å¢èå'" + menu.getMenuName() + "'失败ï¼èååç§°å·²åå¨");
|
| | | }
|
| | | else if (UserConstants.YES_FRAME.equals(menu.getIsFrame()) && !StringUtils.ishttp(menu.getPath()))
|
| | | {
|
| | | return error("æ°å¢èå'" + menu.getMenuName() + "'失败ï¼å°åå¿
须以http(s)://å¼å¤´");
|
| | | }
|
| | | menu.setCreateBy(getUsername());
|
| | | return toAjax(menuService.insertMenu(menu));
|
| | | }
|
| | |
|
| | | /**
|
| | | * ä¿®æ¹èå
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('system:menu:edit')")
|
| | | @Log(title = "èå管ç", businessType = BusinessType.UPDATE)
|
| | | @PutMapping
|
| | | public AjaxResult edit(@Validated @RequestBody SysMenu menu)
|
| | | {
|
| | | if (!menuService.checkMenuNameUnique(menu))
|
| | | {
|
| | | return error("ä¿®æ¹èå'" + menu.getMenuName() + "'失败ï¼èååç§°å·²åå¨");
|
| | | }
|
| | | else if (UserConstants.YES_FRAME.equals(menu.getIsFrame()) && !StringUtils.ishttp(menu.getPath()))
|
| | | {
|
| | | return error("ä¿®æ¹èå'" + menu.getMenuName() + "'失败ï¼å°åå¿
须以http(s)://å¼å¤´");
|
| | | }
|
| | | else if (menu.getMenuId().equals(menu.getParentId()))
|
| | | {
|
| | | return error("ä¿®æ¹èå'" + menu.getMenuName() + "'失败ï¼ä¸çº§èåä¸è½éæ©èªå·±");
|
| | | }
|
| | | menu.setUpdateBy(getUsername());
|
| | | return toAjax(menuService.updateMenu(menu));
|
| | | }
|
| | |
|
| | | /**
|
| | | * å é¤èå
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('system:menu:remove')")
|
| | | @Log(title = "èå管ç", businessType = BusinessType.DELETE)
|
| | | @DeleteMapping("/{menuId}")
|
| | | public AjaxResult remove(@PathVariable("menuId") Long menuId)
|
| | | {
|
| | | if (menuService.hasChildByMenuId(menuId))
|
| | | {
|
| | | return warn("åå¨åèå,ä¸å
许å é¤");
|
| | | }
|
| | | if (menuService.checkMenuExistRole(menuId))
|
| | | {
|
| | | return warn("èåå·²åé
,ä¸å
许å é¤");
|
| | | }
|
| | | return toAjax(menuService.deleteMenuById(menuId));
|
| | | }
|
| | | package com.ruoyi.project.system.controller; |
| | | |
| | | import com.ruoyi.common.constant.HttpStatus; |
| | | import com.ruoyi.common.constant.UserConstants; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.project.system.domain.SysMenu; |
| | | import com.ruoyi.project.system.service.ISysMenuService; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * èåä¿¡æ¯ |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/system/menu") |
| | | @AllArgsConstructor |
| | | public class SysMenuController extends BaseController |
| | | { |
| | | private ISysMenuService menuService; |
| | | |
| | | /** |
| | | * è·åèåå表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:menu:list')") |
| | | @GetMapping("/list") |
| | | public R<?> list(SysMenu menu) |
| | | { |
| | | List<SysMenu> menus = menuService.selectMenuList(menu, getUserId()); |
| | | return R.ok(menus); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®èåç¼å·è·å详ç»ä¿¡æ¯ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:menu:query')") |
| | | @GetMapping(value = "/{menuId}") |
| | | public R<?> getInfo(@PathVariable Long menuId) |
| | | { |
| | | return R.ok(menuService.selectMenuById(menuId)); |
| | | } |
| | | |
| | | /** |
| | | * è·åèå䏿æ å表 |
| | | */ |
| | | @GetMapping("/treeselect") |
| | | public R<?> treeselect(SysMenu menu) |
| | | { |
| | | List<SysMenu> menus = menuService.selectMenuList(menu, getUserId()); |
| | | return R.ok(menuService.buildMenuTreeSelect(menus)); |
| | | } |
| | | |
| | | /** |
| | | * å 载对åºè§è²èåå表æ |
| | | */ |
| | | @GetMapping(value = "/roleMenuTreeselect/{roleId}") |
| | | public R<?> roleMenuTreeselect(@PathVariable("roleId") Long roleId) |
| | | { |
| | | List<SysMenu> menus = menuService.selectMenuList(getUserId()); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("checkedKeys", menuService.selectMenuListByRoleId(roleId)); |
| | | map.put("menus", menuService.buildMenuTreeSelect(menus)); |
| | | return R.ok(map); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢èå |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:menu:add')") |
| | | @Log(title = "èå管ç", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public R<?> add(@Validated @RequestBody SysMenu menu) |
| | | { |
| | | if (!menuService.checkMenuNameUnique(menu)) |
| | | { |
| | | return R.fail("æ°å¢èå'" + menu.getMenuName() + "'失败ï¼èååç§°å·²åå¨"); |
| | | } |
| | | else if (UserConstants.YES_FRAME.equals(menu.getIsFrame()) && !StringUtils.ishttp(menu.getPath())) |
| | | { |
| | | return R.fail("æ°å¢èå'" + menu.getMenuName() + "'失败ï¼å°åå¿
须以http(s)://å¼å¤´"); |
| | | } |
| | | menu.setCreateBy(getUsername()); |
| | | menuService.insertMenu(menu); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹èå |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:menu:edit')") |
| | | @Log(title = "èå管ç", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public R<?> edit(@Validated @RequestBody SysMenu menu) |
| | | { |
| | | if (!menuService.checkMenuNameUnique(menu)) |
| | | { |
| | | return R.fail("ä¿®æ¹èå'" + menu.getMenuName() + "'失败ï¼èååç§°å·²åå¨"); |
| | | } |
| | | else if (UserConstants.YES_FRAME.equals(menu.getIsFrame()) && !StringUtils.ishttp(menu.getPath())) |
| | | { |
| | | return R.fail("ä¿®æ¹èå'" + menu.getMenuName() + "'失败ï¼å°åå¿
须以http(s)://å¼å¤´"); |
| | | } |
| | | else if (menu.getMenuId().equals(menu.getParentId())) |
| | | { |
| | | return R.fail("ä¿®æ¹èå'" + menu.getMenuName() + "'失败ï¼ä¸çº§èåä¸è½éæ©èªå·±"); |
| | | } |
| | | menu.setUpdateBy(getUsername()); |
| | | menuService.updateMenu(menu); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * å é¤èå |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:menu:remove')") |
| | | @Log(title = "èå管ç", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{menuId}") |
| | | public R<?> remove(@PathVariable("menuId") Long menuId) |
| | | { |
| | | if (menuService.hasChildByMenuId(menuId)) |
| | | { |
| | | return R.fail(HttpStatus.WARN, "åå¨åèå,ä¸å
许å é¤"); |
| | | } |
| | | if (menuService.checkMenuExistRole(menuId)) |
| | | { |
| | | return R.fail(HttpStatus.WARN, "èåå·²åé
,ä¸å
许å é¤"); |
| | | } |
| | | menuService.deleteMenuById(menuId); |
| | | return R.ok(); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.project.system.controller;
|
| | |
|
| | | import java.util.List;
|
| | |
|
| | | import com.baomidou.mybatisplus.core.metadata.IPage;
|
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
| | | import com.ruoyi.framework.web.domain.R;
|
| | | import io.swagger.v3.oas.annotations.Operation;
|
| | | import lombok.AllArgsConstructor;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.security.access.prepost.PreAuthorize;
|
| | | import org.springframework.validation.annotation.Validated;
|
| | | import org.springframework.web.bind.annotation.*;
|
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log;
|
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
|
| | | import com.ruoyi.framework.web.controller.BaseController;
|
| | | import com.ruoyi.framework.web.domain.AjaxResult;
|
| | | import com.ruoyi.framework.web.page.TableDataInfo;
|
| | | import com.ruoyi.project.system.domain.SysNotice;
|
| | | import com.ruoyi.project.system.service.ISysNoticeService;
|
| | |
|
| | | /**
|
| | | * å
¬å ä¿¡æ¯æä½å¤ç
|
| | | *
|
| | | * @author ruoyi
|
| | | */
|
| | | @RestController
|
| | | @RequestMapping("/system/notice")
|
| | | @AllArgsConstructor
|
| | | public class SysNoticeController extends BaseController {
|
| | | private ISysNoticeService noticeService;
|
| | |
|
| | | /**
|
| | | * è·åéç¥å
¬åå表
|
| | | */
|
| | | @GetMapping("/list")
|
| | | public R<IPage<SysNotice>> list(SysNotice notice, Page page) {
|
| | | IPage<SysNotice> list = noticeService.selectNoticeList(notice, page);
|
| | | return R.ok(list);
|
| | | }
|
| | |
|
| | | /**
|
| | | * è·åæªè¯»æ°é
|
| | | */
|
| | | @GetMapping("/getCount")
|
| | | public R getCount(Long consigneeId) {
|
| | | return R.ok(noticeService.getCount(consigneeId));
|
| | | }
|
| | |
|
| | | /**
|
| | | * æ ¹æ®éç¥å
¬åç¼å·è·å详ç»ä¿¡æ¯
|
| | | */
|
| | | @GetMapping(value = "/{noticeId}")
|
| | | public AjaxResult getInfo(@PathVariable Long noticeId) {
|
| | | return success(noticeService.selectNoticeById(noticeId));
|
| | | }
|
| | |
|
| | | /**
|
| | | * æ°å¢éç¥å
Œ
|
| | | */
|
| | | @PostMapping
|
| | | public AjaxResult add(@Validated @RequestBody SysNotice notice) {
|
| | | return toAjax(noticeService.insertNotice(notice));
|
| | | }
|
| | |
|
| | | /**
|
| | | * ä¿®æ¹éç¥å
Œ
|
| | | */
|
| | | @PutMapping
|
| | | public AjaxResult edit(@Validated @RequestBody SysNotice notice) {
|
| | | return toAjax(noticeService.updateNotice(notice));
|
| | | }
|
| | |
|
| | | /**
|
| | | * å é¤éç¥å
Œ
|
| | | */
|
| | | @DeleteMapping("/{noticeIds}")
|
| | | public AjaxResult remove(@PathVariable Long[] noticeIds) {
|
| | | return toAjax(noticeService.deleteNoticeByIds(noticeIds));
|
| | | }
|
| | |
|
| | | /**
|
| | | * ä¸é®å·²è¯»
|
| | | */
|
| | | @PostMapping("/readAll")
|
| | | public AjaxResult readAll() {
|
| | | return toAjax(noticeService.readAll());
|
| | | }
|
| | |
|
| | | @PostMapping("appReadNotice")
|
| | | @Operation(summary = "ç§»å¨ç«¯æ ¹æ®æ¶æ¯IDè¿è¡å·²è¯»")
|
| | | public AjaxResult appReadNotice(@RequestParam("noticeId") Long noticeId) {
|
| | | boolean result = noticeService.appReadNotice(noticeId);
|
| | | return toAjax(result);
|
| | | }
|
| | | }
|
| | | package com.ruoyi.project.system.controller; |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.page.TableDataInfo; |
| | | import com.ruoyi.project.system.domain.SysNotice; |
| | | import com.ruoyi.project.system.service.ISysNoticeService; |
| | | |
| | | /** |
| | | * å
¬å ä¿¡æ¯æä½å¤ç |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/system/notice") |
| | | @AllArgsConstructor |
| | | public class SysNoticeController extends BaseController { |
| | | private ISysNoticeService noticeService; |
| | | |
| | | /** |
| | | * è·åéç¥å
¬åå表 |
| | | */ |
| | | @GetMapping("/list") |
| | | public R<IPage<SysNotice>> list(SysNotice notice, Page page) { |
| | | IPage<SysNotice> list = noticeService.selectNoticeList(notice, page); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | /** |
| | | * è·åæªè¯»æ°é |
| | | */ |
| | | @GetMapping("/getCount") |
| | | public R getCount(Long consigneeId) { |
| | | return R.ok(noticeService.getCount(consigneeId)); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®éç¥å
¬åç¼å·è·å详ç»ä¿¡æ¯ |
| | | */ |
| | | @GetMapping(value = "/{noticeId}") |
| | | public R<?> getInfo(@PathVariable Long noticeId) { |
| | | return R.ok(noticeService.selectNoticeById(noticeId)); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢éç¥å
Œ |
| | | */ |
| | | @PostMapping |
| | | public R<?> add(@Validated @RequestBody SysNotice notice) { |
| | | noticeService.insertNotice(notice); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹éç¥å
Œ |
| | | */ |
| | | @PutMapping |
| | | public R<?> edit(@Validated @RequestBody SysNotice notice) { |
| | | noticeService.updateNotice(notice); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * å é¤éç¥å
Œ |
| | | */ |
| | | @DeleteMapping("/{noticeIds}") |
| | | public R<?> remove(@PathVariable Long[] noticeIds) { |
| | | noticeService.deleteNoticeByIds(noticeIds); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * ä¸é®å·²è¯» |
| | | */ |
| | | @PostMapping("/readAll") |
| | | public R<?> readAll() { |
| | | noticeService.readAll(); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @PostMapping("appReadNotice") |
| | | @Operation(summary = "ç§»å¨ç«¯æ ¹æ®æ¶æ¯IDè¿è¡å·²è¯»") |
| | | public R<?> appReadNotice(@RequestParam("noticeId") Long noticeId) { |
| | | noticeService.appReadNotice(noticeId); |
| | | return R.ok(); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.project.system.controller;
|
| | |
|
| | | import java.util.List;
|
| | | import jakarta.servlet.http.HttpServletResponse;
|
| | | import lombok.AllArgsConstructor;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.security.access.prepost.PreAuthorize;
|
| | | import org.springframework.validation.annotation.Validated;
|
| | | import org.springframework.web.bind.annotation.DeleteMapping;
|
| | | import org.springframework.web.bind.annotation.GetMapping;
|
| | | import org.springframework.web.bind.annotation.PathVariable;
|
| | | import org.springframework.web.bind.annotation.PostMapping;
|
| | | import org.springframework.web.bind.annotation.PutMapping;
|
| | | import org.springframework.web.bind.annotation.RequestBody;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.bind.annotation.RestController;
|
| | | import com.ruoyi.common.utils.poi.ExcelUtil;
|
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log;
|
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
|
| | | import com.ruoyi.framework.web.controller.BaseController;
|
| | | import com.ruoyi.framework.web.domain.AjaxResult;
|
| | | import com.ruoyi.framework.web.page.TableDataInfo;
|
| | | import com.ruoyi.project.system.domain.SysPost;
|
| | | import com.ruoyi.project.system.service.ISysPostService;
|
| | |
|
| | | /**
|
| | | * å²ä½ä¿¡æ¯æä½å¤ç
|
| | | * |
| | | * @author ruoyi
|
| | | */
|
| | | @RestController
|
| | | @RequestMapping("/system/post")
|
| | | @AllArgsConstructor
|
| | | public class SysPostController extends BaseController
|
| | | {
|
| | | private ISysPostService postService;
|
| | |
|
| | | /**
|
| | | * è·åå²ä½å表
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('system:post:list')")
|
| | | @GetMapping("/list")
|
| | | public TableDataInfo list(SysPost post)
|
| | | {
|
| | | startPage();
|
| | | List<SysPost> list = postService.selectPostList(post);
|
| | | return getDataTable(list);
|
| | | }
|
| | | /**
|
| | | * 导åºå²ä½å表
|
| | | */
|
| | | |
| | | @Log(title = "å²ä½ç®¡ç", businessType = BusinessType.EXPORT)
|
| | | @PreAuthorize("@ss.hasPermi('system:post:export')")
|
| | | @PostMapping("/export")
|
| | | public void export(HttpServletResponse response, SysPost post)
|
| | | {
|
| | | List<SysPost> list = postService.selectPostList(post);
|
| | | ExcelUtil<SysPost> util = new ExcelUtil<SysPost>(SysPost.class);
|
| | | util.exportExcel(response, list, "å²ä½æ°æ®");
|
| | | }
|
| | |
|
| | | /**
|
| | | * æ ¹æ®å²ä½ç¼å·è·å详ç»ä¿¡æ¯
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('system:post:query')")
|
| | | @GetMapping(value = "/{postId}")
|
| | | public AjaxResult getInfo(@PathVariable Long postId)
|
| | | {
|
| | | return success(postService.selectPostById(postId));
|
| | | }
|
| | |
|
| | | /**
|
| | | * æ°å¢å²ä½
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('system:post:add')")
|
| | | @Log(title = "å²ä½ç®¡ç", businessType = BusinessType.INSERT)
|
| | | @PostMapping
|
| | | public AjaxResult add(@Validated @RequestBody SysPost post)
|
| | | {
|
| | | if (!postService.checkPostNameUnique(post))
|
| | | {
|
| | | return error("æ°å¢å²ä½'" + post.getPostName() + "'失败ï¼å²ä½åç§°å·²åå¨");
|
| | | }
|
| | | else if (!postService.checkPostCodeUnique(post))
|
| | | {
|
| | | return error("æ°å¢å²ä½'" + post.getPostName() + "'失败ï¼å²ä½ç¼ç å·²åå¨");
|
| | | }
|
| | | post.setCreateBy(getUsername());
|
| | | return toAjax(postService.insertPost(post));
|
| | | }
|
| | |
|
| | | /**
|
| | | * ä¿®æ¹å²ä½
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('system:post:edit')")
|
| | | @Log(title = "å²ä½ç®¡ç", businessType = BusinessType.UPDATE)
|
| | | @PutMapping
|
| | | public AjaxResult edit(@Validated @RequestBody SysPost post)
|
| | | {
|
| | | if (!postService.checkPostNameUnique(post))
|
| | | {
|
| | | return error("ä¿®æ¹å²ä½'" + post.getPostName() + "'失败ï¼å²ä½åç§°å·²åå¨");
|
| | | }
|
| | | else if (!postService.checkPostCodeUnique(post))
|
| | | {
|
| | | return error("ä¿®æ¹å²ä½'" + post.getPostName() + "'失败ï¼å²ä½ç¼ç å·²åå¨");
|
| | | }
|
| | | post.setUpdateBy(getUsername());
|
| | | return toAjax(postService.updatePost(post));
|
| | | }
|
| | |
|
| | | /**
|
| | | * å é¤å²ä½
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('system:post:remove')")
|
| | | @Log(title = "å²ä½ç®¡ç", businessType = BusinessType.DELETE)
|
| | | @DeleteMapping("/{postIds}")
|
| | | public AjaxResult remove(@PathVariable Long[] postIds)
|
| | | {
|
| | | return toAjax(postService.deletePostByIds(postIds));
|
| | | }
|
| | |
|
| | | /**
|
| | | * è·åå²ä½éæ©æ¡å表
|
| | | */
|
| | | @GetMapping("/optionselect")
|
| | | public AjaxResult optionselect()
|
| | | {
|
| | | List<SysPost> posts = postService.selectPostAll();
|
| | | return success(posts);
|
| | | }
|
| | | }
|
| | | package com.ruoyi.project.system.controller; |
| | | |
| | | import java.util.List; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.framework.web.page.TableDataInfo; |
| | | import com.ruoyi.project.system.domain.SysPost; |
| | | import com.ruoyi.project.system.service.ISysPostService; |
| | | |
| | | /** |
| | | * å²ä½ä¿¡æ¯æä½å¤ç |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/system/post") |
| | | @AllArgsConstructor |
| | | public class SysPostController extends BaseController |
| | | { |
| | | private ISysPostService postService; |
| | | |
| | | /** |
| | | * è·åå²ä½å表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:post:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(SysPost post) |
| | | { |
| | | startPage(); |
| | | List<SysPost> list = postService.selectPostList(post); |
| | | return getDataTable(list); |
| | | } |
| | | /** |
| | | * 导åºå²ä½å表 |
| | | */ |
| | | |
| | | @Log(title = "å²ä½ç®¡ç", businessType = BusinessType.EXPORT) |
| | | @PreAuthorize("@ss.hasPermi('system:post:export')") |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, SysPost post) |
| | | { |
| | | List<SysPost> list = postService.selectPostList(post); |
| | | ExcelUtil<SysPost> util = new ExcelUtil<SysPost>(SysPost.class); |
| | | util.exportExcel(response, list, "å²ä½æ°æ®"); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®å²ä½ç¼å·è·å详ç»ä¿¡æ¯ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:post:query')") |
| | | @GetMapping(value = "/{postId}") |
| | | public R<?> getInfo(@PathVariable Long postId) |
| | | { |
| | | return R.ok(postService.selectPostById(postId)); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢å²ä½ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:post:add')") |
| | | @Log(title = "å²ä½ç®¡ç", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public R<?> add(@Validated @RequestBody SysPost post) |
| | | { |
| | | if (!postService.checkPostNameUnique(post)) |
| | | { |
| | | return R.fail("æ°å¢å²ä½'" + post.getPostName() + "'失败ï¼å²ä½åç§°å·²åå¨"); |
| | | } |
| | | else if (!postService.checkPostCodeUnique(post)) |
| | | { |
| | | return R.fail("æ°å¢å²ä½'" + post.getPostName() + "'失败ï¼å²ä½ç¼ç å·²åå¨"); |
| | | } |
| | | post.setCreateBy(getUsername()); |
| | | postService.insertPost(post); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹å²ä½ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:post:edit')") |
| | | @Log(title = "å²ä½ç®¡ç", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public R<?> edit(@Validated @RequestBody SysPost post) |
| | | { |
| | | if (!postService.checkPostNameUnique(post)) |
| | | { |
| | | return R.fail("ä¿®æ¹å²ä½'" + post.getPostName() + "'失败ï¼å²ä½åç§°å·²åå¨"); |
| | | } |
| | | else if (!postService.checkPostCodeUnique(post)) |
| | | { |
| | | return R.fail("ä¿®æ¹å²ä½'" + post.getPostName() + "'失败ï¼å²ä½ç¼ç å·²åå¨"); |
| | | } |
| | | post.setUpdateBy(getUsername()); |
| | | postService.updatePost(post); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * å é¤å²ä½ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:post:remove')") |
| | | @Log(title = "å²ä½ç®¡ç", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{postIds}") |
| | | public R<?> remove(@PathVariable Long[] postIds) |
| | | { |
| | | postService.deletePostByIds(postIds); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * è·åå²ä½éæ©æ¡å表 |
| | | */ |
| | | @GetMapping("/optionselect") |
| | | public R<?> optionselect() |
| | | { |
| | | List<SysPost> posts = postService.selectPostAll(); |
| | | return R.ok(posts); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.project.system.controller;
|
| | |
|
| | | import com.ruoyi.common.utils.SecurityUtils;
|
| | | import com.ruoyi.common.utils.StringUtils;
|
| | | import com.ruoyi.common.utils.file.FileUploadUtils;
|
| | | import com.ruoyi.common.utils.file.MimeTypeUtils;
|
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log;
|
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
|
| | | import com.ruoyi.framework.config.RuoYiConfig;
|
| | | import com.ruoyi.framework.security.LoginUser;
|
| | | import com.ruoyi.framework.security.service.TokenService;
|
| | | import com.ruoyi.framework.web.controller.BaseController;
|
| | | import com.ruoyi.framework.web.domain.AjaxResult;
|
| | | import com.ruoyi.project.system.domain.SysUser;
|
| | | import com.ruoyi.project.system.service.ISysUserService;
|
| | | import lombok.AllArgsConstructor;
|
| | | import org.springframework.web.bind.annotation.*;
|
| | | import org.springframework.web.multipart.MultipartFile;
|
| | |
|
| | | import java.util.Map;
|
| | |
|
| | | /**
|
| | | * ä¸ªäººä¿¡æ¯ ä¸å¡å¤ç
|
| | | * |
| | | * @author ruoyi
|
| | | */
|
| | | @RestController
|
| | | @RequestMapping("/system/user/profile")
|
| | | @AllArgsConstructor
|
| | | public class SysProfileController extends BaseController
|
| | | {
|
| | | private ISysUserService userService;
|
| | | private TokenService tokenService;
|
| | |
|
| | | /**
|
| | | * 个人信æ¯
|
| | | */
|
| | | @GetMapping
|
| | | public AjaxResult profile()
|
| | | {
|
| | | LoginUser loginUser = getLoginUser();
|
| | | SysUser user = loginUser.getUser();
|
| | | AjaxResult ajax = AjaxResult.success(user);
|
| | | ajax.put("roleGroup", userService.selectUserRoleGroup(loginUser.getUsername()));
|
| | | ajax.put("postGroup", userService.selectUserPostGroup(loginUser.getUsername()));
|
| | | return ajax;
|
| | | }
|
| | |
|
| | | /**
|
| | | * ä¿®æ¹ç¨æ·
|
| | | */
|
| | | @Log(title = "个人信æ¯", businessType = BusinessType.UPDATE)
|
| | | @PutMapping
|
| | | public AjaxResult updateProfile(@RequestBody SysUser user)
|
| | | {
|
| | | LoginUser loginUser = getLoginUser();
|
| | | SysUser currentUser = loginUser.getUser();
|
| | | currentUser.setNickName(user.getNickName());
|
| | | currentUser.setEmail(user.getEmail());
|
| | | currentUser.setPhonenumber(user.getPhonenumber());
|
| | | currentUser.setSex(user.getSex());
|
| | | if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(currentUser))
|
| | | {
|
| | | return error("ä¿®æ¹ç¨æ·'" + loginUser.getUsername() + "'å¤±è´¥ï¼ææºå·ç å·²åå¨");
|
| | | }
|
| | | if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(currentUser))
|
| | | {
|
| | | return error("ä¿®æ¹ç¨æ·'" + loginUser.getUsername() + "'失败ï¼é®ç®±è´¦å·å·²åå¨");
|
| | | }
|
| | | if (userService.updateUserProfile(currentUser) > 0)
|
| | | {
|
| | | // æ´æ°ç¼åç¨æ·ä¿¡æ¯
|
| | | tokenService.setLoginUser(loginUser);
|
| | | return success();
|
| | | }
|
| | | return error("ä¿®æ¹ä¸ªäººä¿¡æ¯å¼å¸¸ï¼è¯·è系管çå");
|
| | | }
|
| | |
|
| | | /**
|
| | | * éç½®å¯ç
|
| | | */
|
| | | @Log(title = "个人信æ¯", businessType = BusinessType.UPDATE)
|
| | | @PutMapping("/updatePwd")
|
| | | public AjaxResult updatePwd(@RequestBody Map<String, String> params)
|
| | | {
|
| | | String oldPassword = params.get("oldPassword");
|
| | | String newPassword = params.get("newPassword");
|
| | | LoginUser loginUser = getLoginUser();
|
| | | String userName = loginUser.getUsername();
|
| | | String password = loginUser.getPassword();
|
| | | if (!SecurityUtils.matchesPassword(oldPassword, password))
|
| | | {
|
| | | return error("ä¿®æ¹å¯ç å¤±è´¥ï¼æ§å¯ç é误");
|
| | | }
|
| | | if (SecurityUtils.matchesPassword(newPassword, password))
|
| | | {
|
| | | return error("æ°å¯ç ä¸è½ä¸æ§å¯ç ç¸å");
|
| | | }
|
| | | newPassword = SecurityUtils.encryptPassword(newPassword);
|
| | | if (userService.resetUserPwd(userName, newPassword) > 0)
|
| | | {
|
| | | // æ´æ°ç¼åç¨æ·å¯ç
|
| | | loginUser.getUser().setPassword(newPassword);
|
| | | tokenService.setLoginUser(loginUser);
|
| | | return success();
|
| | | }
|
| | | return error("ä¿®æ¹å¯ç å¼å¸¸ï¼è¯·è系管çå");
|
| | | }
|
| | |
|
| | | /**
|
| | | * 头åä¸ä¼
|
| | | */
|
| | | @Log(title = "ç¨æ·å¤´å", businessType = BusinessType.UPDATE)
|
| | | @PostMapping("/avatar")
|
| | | public AjaxResult avatar(@RequestParam("avatarfile") MultipartFile file) throws Exception
|
| | | {
|
| | | if (!file.isEmpty())
|
| | | {
|
| | | LoginUser loginUser = getLoginUser();
|
| | | String avatar = FileUploadUtils.upload(RuoYiConfig.getAvatarPath(), file, MimeTypeUtils.IMAGE_EXTENSION);
|
| | | if (userService.updateUserAvatar(loginUser.getUsername(), avatar))
|
| | | {
|
| | | AjaxResult ajax = AjaxResult.success();
|
| | | ajax.put("imgUrl", avatar);
|
| | | // æ´æ°ç¼åç¨æ·å¤´å
|
| | | loginUser.getUser().setAvatar(avatar);
|
| | | tokenService.setLoginUser(loginUser);
|
| | | return ajax;
|
| | | }
|
| | | }
|
| | | return error("ä¸ä¼ å¾çå¼å¸¸ï¼è¯·è系管çå");
|
| | | }
|
| | | }
|
| | | package com.ruoyi.project.system.controller; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.file.FileUploadUtils; |
| | | import com.ruoyi.common.utils.file.MimeTypeUtils; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.config.RuoYiConfig; |
| | | import com.ruoyi.framework.security.LoginUser; |
| | | import com.ruoyi.framework.security.service.TokenService; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.project.system.domain.SysUser; |
| | | import com.ruoyi.project.system.service.ISysUserService; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | /** |
| | | * ä¸ªäººä¿¡æ¯ ä¸å¡å¤ç |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/system/user/profile") |
| | | @AllArgsConstructor |
| | | public class SysProfileController extends BaseController |
| | | { |
| | | private ISysUserService userService; |
| | | private TokenService tokenService; |
| | | |
| | | /** |
| | | * ä¸ªäººä¿¡æ¯ |
| | | */ |
| | | @GetMapping |
| | | public R<?> profile() |
| | | { |
| | | LoginUser loginUser = getLoginUser(); |
| | | SysUser user = loginUser.getUser(); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("data", user); |
| | | map.put("roleGroup", userService.selectUserRoleGroup(loginUser.getUsername())); |
| | | map.put("postGroup", userService.selectUserPostGroup(loginUser.getUsername())); |
| | | return R.ok(map); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ç¨æ· |
| | | */ |
| | | @Log(title = "个人信æ¯", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public R<?> updateProfile(@RequestBody SysUser user) |
| | | { |
| | | LoginUser loginUser = getLoginUser(); |
| | | SysUser currentUser = loginUser.getUser(); |
| | | currentUser.setNickName(user.getNickName()); |
| | | currentUser.setEmail(user.getEmail()); |
| | | currentUser.setPhonenumber(user.getPhonenumber()); |
| | | currentUser.setSex(user.getSex()); |
| | | if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(currentUser)) |
| | | { |
| | | return R.fail("ä¿®æ¹ç¨æ·'" + loginUser.getUsername() + "'å¤±è´¥ï¼ææºå·ç å·²åå¨"); |
| | | } |
| | | if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(currentUser)) |
| | | { |
| | | return R.fail("ä¿®æ¹ç¨æ·'" + loginUser.getUsername() + "'失败ï¼é®ç®±è´¦å·å·²åå¨"); |
| | | } |
| | | if (userService.updateUserProfile(currentUser) > 0) |
| | | { |
| | | // æ´æ°ç¼åç¨æ·ä¿¡æ¯ |
| | | tokenService.setLoginUser(loginUser); |
| | | return R.ok(); |
| | | } |
| | | return R.fail("ä¿®æ¹ä¸ªäººä¿¡æ¯å¼å¸¸ï¼è¯·è系管çå"); |
| | | } |
| | | |
| | | /** |
| | | * éç½®å¯ç |
| | | */ |
| | | @Log(title = "个人信æ¯", businessType = BusinessType.UPDATE) |
| | | @PutMapping("/updatePwd") |
| | | public R<?> updatePwd(@RequestBody Map<String, String> params) |
| | | { |
| | | String oldPassword = params.get("oldPassword"); |
| | | String newPassword = params.get("newPassword"); |
| | | LoginUser loginUser = getLoginUser(); |
| | | String userName = loginUser.getUsername(); |
| | | String password = loginUser.getPassword(); |
| | | if (!SecurityUtils.matchesPassword(oldPassword, password)) |
| | | { |
| | | return R.fail("ä¿®æ¹å¯ç å¤±è´¥ï¼æ§å¯ç é误"); |
| | | } |
| | | if (SecurityUtils.matchesPassword(newPassword, password)) |
| | | { |
| | | return R.fail("æ°å¯ç ä¸è½ä¸æ§å¯ç ç¸å"); |
| | | } |
| | | newPassword = SecurityUtils.encryptPassword(newPassword); |
| | | if (userService.resetUserPwd(userName, newPassword) > 0) |
| | | { |
| | | // æ´æ°ç¼åç¨æ·å¯ç |
| | | loginUser.getUser().setPassword(newPassword); |
| | | tokenService.setLoginUser(loginUser); |
| | | return R.ok(); |
| | | } |
| | | return R.fail("ä¿®æ¹å¯ç å¼å¸¸ï¼è¯·è系管çå"); |
| | | } |
| | | |
| | | /** |
| | | * 头åä¸ä¼ |
| | | */ |
| | | @Log(title = "ç¨æ·å¤´å", businessType = BusinessType.UPDATE) |
| | | @PostMapping("/avatar") |
| | | public R<?> avatar(@RequestParam("avatarfile") MultipartFile file) throws Exception |
| | | { |
| | | if (!file.isEmpty()) |
| | | { |
| | | LoginUser loginUser = getLoginUser(); |
| | | String avatar = FileUploadUtils.upload(RuoYiConfig.getAvatarPath(), file, MimeTypeUtils.IMAGE_EXTENSION); |
| | | if (userService.updateUserAvatar(loginUser.getUsername(), avatar)) |
| | | { |
| | | // æ´æ°ç¼åç¨æ·å¤´å |
| | | loginUser.getUser().setAvatar(avatar); |
| | | tokenService.setLoginUser(loginUser); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("imgUrl", avatar); |
| | | return R.ok(map); |
| | | } |
| | | } |
| | | return R.fail("ä¸ä¼ å¾çå¼å¸¸ï¼è¯·è系管çå"); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.project.system.controller;
|
| | |
|
| | | import com.ruoyi.common.utils.StringUtils;
|
| | | import com.ruoyi.framework.security.RegisterBody;
|
| | | import com.ruoyi.framework.security.service.SysRegisterService;
|
| | | import com.ruoyi.framework.web.controller.BaseController;
|
| | | import com.ruoyi.framework.web.domain.AjaxResult;
|
| | | import com.ruoyi.project.system.service.ISysConfigService;
|
| | | import lombok.AllArgsConstructor;
|
| | | import org.springframework.web.bind.annotation.PostMapping;
|
| | | import org.springframework.web.bind.annotation.RequestBody;
|
| | | import org.springframework.web.bind.annotation.RestController;
|
| | |
|
| | | /**
|
| | | * 注åéªè¯
|
| | | *
|
| | | * @author ruoyi
|
| | | */
|
| | | @RestController
|
| | | @AllArgsConstructor
|
| | | public class SysRegisterController extends BaseController {
|
| | | private SysRegisterService registerService;
|
| | | private ISysConfigService configService;
|
| | |
|
| | | @PostMapping("/register")
|
| | | public AjaxResult register(@RequestBody RegisterBody user) {
|
| | | if (!("true".equals(configService.selectConfigByKey("sys.account.registerUser")))) {
|
| | | return error("å½åç³»ç»æ²¡æå¼å¯æ³¨ååè½ï¼");
|
| | | }
|
| | | String msg = registerService.register(user);
|
| | | return StringUtils.isEmpty(msg) ? success() : error(msg);
|
| | | }
|
| | | }
|
| | | package com.ruoyi.project.system.controller; |
| | | |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.framework.security.RegisterBody; |
| | | import com.ruoyi.framework.security.service.SysRegisterService; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.project.system.service.ISysConfigService; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * 注åéªè¯ |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @AllArgsConstructor |
| | | public class SysRegisterController extends BaseController { |
| | | private SysRegisterService registerService; |
| | | private ISysConfigService configService; |
| | | |
| | | @PostMapping("/register") |
| | | public R<?> register(@RequestBody RegisterBody user) { |
| | | if (!("true".equals(configService.selectConfigByKey("sys.account.registerUser")))) { |
| | | return R.fail("å½åç³»ç»æ²¡æå¼å¯æ³¨ååè½ï¼"); |
| | | } |
| | | String msg = registerService.register(user); |
| | | return StringUtils.isEmpty(msg) ? R.ok() : R.fail(msg); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.project.system.controller;
|
| | |
|
| | | import java.util.List;
|
| | | import jakarta.servlet.http.HttpServletResponse;
|
| | | import lombok.AllArgsConstructor;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.security.access.prepost.PreAuthorize;
|
| | | import org.springframework.validation.annotation.Validated;
|
| | | import org.springframework.web.bind.annotation.DeleteMapping;
|
| | | import org.springframework.web.bind.annotation.GetMapping;
|
| | | import org.springframework.web.bind.annotation.PathVariable;
|
| | | import org.springframework.web.bind.annotation.PostMapping;
|
| | | import org.springframework.web.bind.annotation.PutMapping;
|
| | | import org.springframework.web.bind.annotation.RequestBody;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.bind.annotation.RestController;
|
| | | import com.ruoyi.common.utils.StringUtils;
|
| | | import com.ruoyi.common.utils.poi.ExcelUtil;
|
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log;
|
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
|
| | | import com.ruoyi.framework.security.LoginUser;
|
| | | import com.ruoyi.framework.security.service.SysPermissionService;
|
| | | import com.ruoyi.framework.security.service.TokenService;
|
| | | import com.ruoyi.framework.web.controller.BaseController;
|
| | | import com.ruoyi.framework.web.domain.AjaxResult;
|
| | | import com.ruoyi.framework.web.page.TableDataInfo;
|
| | | import com.ruoyi.project.system.domain.SysDept;
|
| | | import com.ruoyi.project.system.domain.SysRole;
|
| | | import com.ruoyi.project.system.domain.SysUser;
|
| | | import com.ruoyi.project.system.domain.SysUserRole;
|
| | | import com.ruoyi.project.system.service.ISysDeptService;
|
| | | import com.ruoyi.project.system.service.ISysRoleService;
|
| | | import com.ruoyi.project.system.service.ISysUserService;
|
| | |
|
| | | /**
|
| | | * è§è²ä¿¡æ¯
|
| | | * |
| | | * @author ruoyi
|
| | | */
|
| | | @RestController
|
| | | @RequestMapping("/system/role")
|
| | | @AllArgsConstructor
|
| | | public class SysRoleController extends BaseController
|
| | | {
|
| | | private ISysRoleService roleService;
|
| | | private TokenService tokenService;
|
| | | private SysPermissionService permissionService;
|
| | | private ISysUserService userService;
|
| | | private ISysDeptService deptService;
|
| | |
|
| | | @PreAuthorize("@ss.hasPermi('system:role:list')")
|
| | | @GetMapping("/list")
|
| | | public TableDataInfo list(SysRole role)
|
| | | {
|
| | | startPage();
|
| | | List<SysRole> list = roleService.selectRoleList(role);
|
| | | return getDataTable(list);
|
| | | }
|
| | |
|
| | | @Log(title = "è§è²ç®¡ç", businessType = BusinessType.EXPORT)
|
| | | @PreAuthorize("@ss.hasPermi('system:role:export')")
|
| | | @PostMapping("/export")
|
| | | public void export(HttpServletResponse response, SysRole role)
|
| | | {
|
| | | List<SysRole> list = roleService.selectRoleList(role);
|
| | | ExcelUtil<SysRole> util = new ExcelUtil<SysRole>(SysRole.class);
|
| | | util.exportExcel(response, list, "è§è²æ°æ®");
|
| | | }
|
| | |
|
| | | /**
|
| | | * æ ¹æ®è§è²ç¼å·è·å详ç»ä¿¡æ¯
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('system:role:query')")
|
| | | @GetMapping(value = "/{roleId}")
|
| | | public AjaxResult getInfo(@PathVariable Long roleId)
|
| | | {
|
| | | roleService.checkRoleDataScope(roleId);
|
| | | return success(roleService.selectRoleById(roleId));
|
| | | }
|
| | |
|
| | | /**
|
| | | * æ°å¢è§è²
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('system:role:add')")
|
| | | @Log(title = "è§è²ç®¡ç", businessType = BusinessType.INSERT)
|
| | | @PostMapping
|
| | | public AjaxResult add(@Validated @RequestBody SysRole role)
|
| | | {
|
| | | if (!roleService.checkRoleNameUnique(role))
|
| | | {
|
| | | return error("æ°å¢è§è²'" + role.getRoleName() + "'失败ï¼è§è²åç§°å·²åå¨");
|
| | | }
|
| | | else if (!roleService.checkRoleKeyUnique(role))
|
| | | {
|
| | | return error("æ°å¢è§è²'" + role.getRoleName() + "'失败ï¼è§è²æéå·²åå¨");
|
| | | }
|
| | | role.setCreateBy(getUsername());
|
| | | return toAjax(roleService.insertRole(role));
|
| | |
|
| | | }
|
| | |
|
| | | /**
|
| | | * ä¿®æ¹ä¿åè§è²
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('system:role:edit')")
|
| | | @Log(title = "è§è²ç®¡ç", businessType = BusinessType.UPDATE)
|
| | | @PutMapping
|
| | | public AjaxResult edit(@Validated @RequestBody SysRole role)
|
| | | {
|
| | | roleService.checkRoleAllowed(role);
|
| | | roleService.checkRoleDataScope(role.getRoleId());
|
| | | if (!roleService.checkRoleNameUnique(role))
|
| | | {
|
| | | return error("ä¿®æ¹è§è²'" + role.getRoleName() + "'失败ï¼è§è²åç§°å·²åå¨");
|
| | | }
|
| | | else if (!roleService.checkRoleKeyUnique(role))
|
| | | {
|
| | | return error("ä¿®æ¹è§è²'" + role.getRoleName() + "'失败ï¼è§è²æéå·²åå¨");
|
| | | }
|
| | | role.setUpdateBy(getUsername());
|
| | | |
| | | if (roleService.updateRole(role) > 0)
|
| | | {
|
| | | // æ´æ°ç¼åç¨æ·æé
|
| | | LoginUser loginUser = getLoginUser();
|
| | | if (StringUtils.isNotNull(loginUser.getUser()) && !loginUser.getUser().isAdmin())
|
| | | {
|
| | | loginUser.setUser(userService.selectUserByUserName(loginUser.getUser().getUserName()));
|
| | | loginUser.setPermissions(permissionService.getMenuPermission(loginUser.getUser()));
|
| | | tokenService.setLoginUser(loginUser);
|
| | | }
|
| | | return success();
|
| | | }
|
| | | return error("ä¿®æ¹è§è²'" + role.getRoleName() + "'失败ï¼è¯·è系管çå");
|
| | | }
|
| | |
|
| | | /**
|
| | | * ä¿®æ¹ä¿åæ°æ®æé
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('system:role:edit')")
|
| | | @Log(title = "è§è²ç®¡ç", businessType = BusinessType.UPDATE)
|
| | | @PutMapping("/dataScope")
|
| | | public AjaxResult dataScope(@RequestBody SysRole role)
|
| | | {
|
| | | roleService.checkRoleAllowed(role);
|
| | | roleService.checkRoleDataScope(role.getRoleId());
|
| | | return toAjax(roleService.authDataScope(role));
|
| | | }
|
| | |
|
| | | /**
|
| | | * ç¶æä¿®æ¹
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('system:role:edit')")
|
| | | @Log(title = "è§è²ç®¡ç", businessType = BusinessType.UPDATE)
|
| | | @PutMapping("/changeStatus")
|
| | | public AjaxResult changeStatus(@RequestBody SysRole role)
|
| | | {
|
| | | roleService.checkRoleAllowed(role);
|
| | | roleService.checkRoleDataScope(role.getRoleId());
|
| | | role.setUpdateBy(getUsername());
|
| | | return toAjax(roleService.updateRoleStatus(role));
|
| | | }
|
| | |
|
| | | /**
|
| | | * å é¤è§è²
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('system:role:remove')")
|
| | | @Log(title = "è§è²ç®¡ç", businessType = BusinessType.DELETE)
|
| | | @DeleteMapping("/{roleIds}")
|
| | | public AjaxResult remove(@PathVariable Long[] roleIds)
|
| | | {
|
| | | return toAjax(roleService.deleteRoleByIds(roleIds));
|
| | | }
|
| | |
|
| | | /**
|
| | | * è·åè§è²éæ©æ¡å表
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('system:role:query')")
|
| | | @GetMapping("/optionselect")
|
| | | public AjaxResult optionselect()
|
| | | {
|
| | | return success(roleService.selectRoleAll());
|
| | | }
|
| | |
|
| | | /**
|
| | | * æ¥è¯¢å·²åé
ç¨æ·è§è²å表
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('system:role:list')")
|
| | | @GetMapping("/authUser/allocatedList")
|
| | | public TableDataInfo allocatedList(SysUser user)
|
| | | {
|
| | | startPage();
|
| | | List<SysUser> list = userService.selectAllocatedList(user);
|
| | | return getDataTable(list);
|
| | | }
|
| | |
|
| | | /**
|
| | | * æ¥è¯¢æªåé
ç¨æ·è§è²å表
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('system:role:list')")
|
| | | @GetMapping("/authUser/unallocatedList")
|
| | | public TableDataInfo unallocatedList(SysUser user)
|
| | | {
|
| | | startPage();
|
| | | List<SysUser> list = userService.selectUnallocatedList(user);
|
| | | return getDataTable(list);
|
| | | }
|
| | |
|
| | | /**
|
| | | * åæ¶ææç¨æ·
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('system:role:edit')")
|
| | | @Log(title = "è§è²ç®¡ç", businessType = BusinessType.GRANT)
|
| | | @PutMapping("/authUser/cancel")
|
| | | public AjaxResult cancelAuthUser(@RequestBody SysUserRole userRole)
|
| | | {
|
| | | return toAjax(roleService.deleteAuthUser(userRole));
|
| | | }
|
| | |
|
| | | /**
|
| | | * æ¹éåæ¶ææç¨æ·
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('system:role:edit')")
|
| | | @Log(title = "è§è²ç®¡ç", businessType = BusinessType.GRANT)
|
| | | @PutMapping("/authUser/cancelAll")
|
| | | public AjaxResult cancelAuthUserAll(Long roleId, Long[] userIds)
|
| | | {
|
| | | return toAjax(roleService.deleteAuthUsers(roleId, userIds));
|
| | | }
|
| | |
|
| | | /**
|
| | | * æ¹ééæ©ç¨æ·ææ
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('system:role:edit')")
|
| | | @Log(title = "è§è²ç®¡ç", businessType = BusinessType.GRANT)
|
| | | @PutMapping("/authUser/selectAll")
|
| | | public AjaxResult selectAuthUserAll(Long roleId, Long[] userIds)
|
| | | {
|
| | | roleService.checkRoleDataScope(roleId);
|
| | | return toAjax(roleService.insertAuthUsers(roleId, userIds));
|
| | | }
|
| | |
|
| | | /**
|
| | | * è·å对åºè§è²é¨é¨æ å表
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('system:role:query')")
|
| | | @GetMapping(value = "/deptTree/{roleId}")
|
| | | public AjaxResult deptTree(@PathVariable("roleId") Long roleId)
|
| | | {
|
| | | AjaxResult ajax = AjaxResult.success();
|
| | | ajax.put("checkedKeys", deptService.selectDeptListByRoleId(roleId));
|
| | | ajax.put("depts", deptService.selectDeptTreeList(new SysDept()));
|
| | | return ajax;
|
| | | }
|
| | | }
|
| | | package com.ruoyi.project.system.controller; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.project.system.domain.vo.SysUserDeptVo; |
| | | import com.ruoyi.project.system.mapper.SysUserMapper; |
| | | import com.ruoyi.project.system.service.*; |
| | | import lombok.AllArgsConstructor; |
| | | import org.apache.commons.lang3.ArrayUtils; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.security.LoginUser; |
| | | import com.ruoyi.framework.security.service.SysPermissionService; |
| | | import com.ruoyi.framework.security.service.TokenService; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.page.TableDataInfo; |
| | | import com.ruoyi.project.system.domain.SysDept; |
| | | import com.ruoyi.project.system.domain.SysRole; |
| | | import com.ruoyi.project.system.domain.SysUser; |
| | | import com.ruoyi.project.system.domain.SysUserRole; |
| | | |
| | | /** |
| | | * è§è²ä¿¡æ¯ |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/system/role") |
| | | @AllArgsConstructor |
| | | public class SysRoleController extends BaseController |
| | | { |
| | | private ISysRoleService roleService; |
| | | private TokenService tokenService; |
| | | private SysPermissionService permissionService; |
| | | private ISysUserService userService; |
| | | private ISysDeptService deptService; |
| | | |
| | | @PreAuthorize("@ss.hasPermi('system:role:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(SysRole role) |
| | | { |
| | | startPage(); |
| | | List<SysRole> list = roleService.selectRoleList(role); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | @Log(title = "è§è²ç®¡ç", businessType = BusinessType.EXPORT) |
| | | @PreAuthorize("@ss.hasPermi('system:role:export')") |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, SysRole role) |
| | | { |
| | | List<SysRole> list = roleService.selectRoleList(role); |
| | | ExcelUtil<SysRole> util = new ExcelUtil<SysRole>(SysRole.class); |
| | | util.exportExcel(response, list, "è§è²æ°æ®"); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®è§è²ç¼å·è·å详ç»ä¿¡æ¯ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:role:query')") |
| | | @GetMapping(value = "/{roleId}") |
| | | public R<?> getInfo(@PathVariable Long roleId) |
| | | { |
| | | roleService.checkRoleDataScope(roleId); |
| | | return R.ok(roleService.selectRoleById(roleId)); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢è§è² |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:role:add')") |
| | | @Log(title = "è§è²ç®¡ç", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public R<?> add(@Validated @RequestBody SysRole role) |
| | | { |
| | | if (!roleService.checkRoleNameUnique(role)) |
| | | { |
| | | return R.fail("æ°å¢è§è²'" + role.getRoleName() + "'失败ï¼è§è²åç§°å·²åå¨"); |
| | | } |
| | | else if (!roleService.checkRoleKeyUnique(role)) |
| | | { |
| | | return R.fail("æ°å¢è§è²'" + role.getRoleName() + "'失败ï¼è§è²æéå·²åå¨"); |
| | | } |
| | | role.setCreateBy(getUsername()); |
| | | roleService.insertRole(role); |
| | | return R.ok(); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ä¿åè§è² |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:role:edit')") |
| | | @Log(title = "è§è²ç®¡ç", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public R<?> edit(@Validated @RequestBody SysRole role) |
| | | { |
| | | roleService.checkRoleAllowed(role); |
| | | roleService.checkRoleDataScope(role.getRoleId()); |
| | | if (!roleService.checkRoleNameUnique(role)) |
| | | { |
| | | return R.fail("ä¿®æ¹è§è²'" + role.getRoleName() + "'失败ï¼è§è²åç§°å·²åå¨"); |
| | | } |
| | | else if (!roleService.checkRoleKeyUnique(role)) |
| | | { |
| | | return R.fail("ä¿®æ¹è§è²'" + role.getRoleName() + "'失败ï¼è§è²æéå·²åå¨"); |
| | | } |
| | | role.setUpdateBy(getUsername()); |
| | | |
| | | if (roleService.updateRole(role) > 0) |
| | | { |
| | | // æ´æ°ç¼åç¨æ·æé |
| | | LoginUser loginUser = getLoginUser(); |
| | | if (StringUtils.isNotNull(loginUser.getUser()) && !loginUser.getUser().isAdmin()) |
| | | { |
| | | loginUser.setUser(userService.selectUserByUserName(loginUser.getUser().getUserName())); |
| | | loginUser.setPermissions(permissionService.getMenuPermission(loginUser.getUser())); |
| | | tokenService.setLoginUser(loginUser); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | return R.fail("ä¿®æ¹è§è²'" + role.getRoleName() + "'失败ï¼è¯·è系管çå"); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ä¿åæ°æ®æé |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:role:edit')") |
| | | @Log(title = "è§è²ç®¡ç", businessType = BusinessType.UPDATE) |
| | | @PutMapping("/dataScope") |
| | | public R<?> dataScope(@RequestBody SysRole role) |
| | | { |
| | | roleService.checkRoleAllowed(role); |
| | | roleService.checkRoleDataScope(role.getRoleId()); |
| | | roleService.authDataScope(role); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * ç¶æä¿®æ¹ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:role:edit')") |
| | | @Log(title = "è§è²ç®¡ç", businessType = BusinessType.UPDATE) |
| | | @PutMapping("/changeStatus") |
| | | public R<?> changeStatus(@RequestBody SysRole role) |
| | | { |
| | | roleService.checkRoleAllowed(role); |
| | | roleService.checkRoleDataScope(role.getRoleId()); |
| | | role.setUpdateBy(getUsername()); |
| | | roleService.updateRoleStatus(role); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * å é¤è§è² |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:role:remove')") |
| | | @Log(title = "è§è²ç®¡ç", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{roleIds}") |
| | | public R<?> remove(@PathVariable Long[] roleIds) |
| | | { |
| | | roleService.deleteRoleByIds(roleIds); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * è·åè§è²éæ©æ¡å表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:role:query')") |
| | | @GetMapping("/optionselect") |
| | | public R<?> optionselect() |
| | | { |
| | | return R.ok(roleService.selectRoleAll()); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢å·²åé
ç¨æ·è§è²å表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:role:list')") |
| | | @GetMapping("/authUser/allocatedList") |
| | | public TableDataInfo allocatedList(SysUser user) |
| | | { |
| | | startPage(); |
| | | List<SysUser> list = userService.selectAllocatedList(user); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢æªåé
ç¨æ·è§è²å表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:role:list')") |
| | | @GetMapping("/authUser/unallocatedList") |
| | | public TableDataInfo unallocatedList(SysUser user) |
| | | { |
| | | startPage(); |
| | | List<SysUser> list = userService.selectUnallocatedList(user); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | /** |
| | | * åæ¶ææç¨æ· |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:role:edit')") |
| | | @Log(title = "è§è²ç®¡ç", businessType = BusinessType.GRANT) |
| | | @PutMapping("/authUser/cancel") |
| | | public R<?> cancelAuthUser(@RequestBody SysUserRole userRole) |
| | | { |
| | | roleService.deleteAuthUser(userRole); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * æ¹éåæ¶ææç¨æ· |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:role:edit')") |
| | | @Log(title = "è§è²ç®¡ç", businessType = BusinessType.GRANT) |
| | | @PutMapping("/authUser/cancelAll") |
| | | public R<?> cancelAuthUserAll(Long roleId, Long[] userIds) |
| | | { |
| | | roleService.deleteAuthUsers(roleId, userIds); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * æ¹ééæ©ç¨æ·ææ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:role:edit')") |
| | | @Log(title = "è§è²ç®¡ç", businessType = BusinessType.GRANT) |
| | | @PutMapping("/authUser/selectAll") |
| | | public R<?> selectAuthUserAll(Long roleId, Long[] userIds) |
| | | { |
| | | roleService.checkRoleDataScope(roleId); |
| | | roleService.insertAuthUsers(roleId, userIds); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * è·å对åºè§è²é¨é¨æ å表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:role:query')") |
| | | @GetMapping(value = "/deptTree/{roleId}") |
| | | public R<?> deptTree(@PathVariable("roleId") Long roleId) |
| | | { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("checkedKeys", deptService.selectDeptListByRoleId(roleId)); |
| | | map.put("depts", deptService.selectDeptTreeList(new SysDept())); |
| | | return R.ok(map); |
| | | } |
| | | } |
| | |
| | | |
| | | import com.ruoyi.framework.security.LoginUser; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.project.system.domain.GetuiConfig; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.project.system.domain.SysUserClient; |
| | | import com.ruoyi.project.system.service.SysUserClientService; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | |
| | | */ |
| | | @PostMapping("/addOrUpdateClientId") |
| | | @Operation(summary = "æ·»å /æ´æ°ç¨æ·cid") |
| | | public AjaxResult addOrUpdateClientId(@RequestBody SysUserClient sysUserClient) { |
| | | public R<?> addOrUpdateClientId(@RequestBody SysUserClient sysUserClient) { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | sysUserClient.setUserId(userId); |
| | | boolean result = sysUserClientService.addOrUpdateClientId(sysUserClient); |
| | | return result ? success() : error("设å¤ç»å®å¤±è´¥"); |
| | | return result ? R.ok() : R.fail("设å¤ç»å®å¤±è´¥"); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.project.system.controller;
|
| | |
|
| | | import java.util.List;
|
| | | import java.util.stream.Collectors;
|
| | | import jakarta.servlet.http.HttpServletResponse;
|
| | |
|
| | | import com.ruoyi.project.system.domain.vo.SysUserDeptVo;
|
| | | import com.ruoyi.project.system.mapper.SysUserMapper;
|
| | | import com.ruoyi.project.system.service.*;
|
| | | import lombok.AllArgsConstructor;
|
| | | import org.apache.commons.lang3.ArrayUtils;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.security.access.prepost.PreAuthorize;
|
| | | import org.springframework.validation.annotation.Validated;
|
| | | import org.springframework.web.bind.annotation.DeleteMapping;
|
| | | import org.springframework.web.bind.annotation.GetMapping;
|
| | | import org.springframework.web.bind.annotation.PathVariable;
|
| | | import org.springframework.web.bind.annotation.PostMapping;
|
| | | import org.springframework.web.bind.annotation.PutMapping;
|
| | | import org.springframework.web.bind.annotation.RequestBody;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.bind.annotation.RestController;
|
| | | import org.springframework.web.multipart.MultipartFile;
|
| | | import com.ruoyi.common.utils.SecurityUtils;
|
| | | import com.ruoyi.common.utils.StringUtils;
|
| | | import com.ruoyi.common.utils.poi.ExcelUtil;
|
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log;
|
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
|
| | | import com.ruoyi.framework.web.controller.BaseController;
|
| | | import com.ruoyi.framework.web.domain.AjaxResult;
|
| | | import com.ruoyi.framework.web.page.TableDataInfo;
|
| | | import com.ruoyi.project.system.domain.SysDept;
|
| | | import com.ruoyi.project.system.domain.SysRole;
|
| | | import com.ruoyi.project.system.domain.SysUser;
|
| | |
|
| | | /**
|
| | | * ç¨æ·ä¿¡æ¯
|
| | | * |
| | | * @author ruoyi
|
| | | */
|
| | | @RestController
|
| | | @RequestMapping("/system/user")
|
| | | @AllArgsConstructor
|
| | | public class SysUserController extends BaseController
|
| | | {
|
| | | private ISysUserService userService;
|
| | | private ISysRoleService roleService;
|
| | | private ISysDeptService deptService;
|
| | | private ISysPostService postService;
|
| | | private ISysUserDeptService userDeptService;
|
| | |
|
| | | /**
|
| | | * è·åç¨æ·å表
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('system:user:list')")
|
| | | @GetMapping("/list")
|
| | | public TableDataInfo list(SysUser user)
|
| | | {
|
| | | startPage();
|
| | | List<SysUser> list = userService.selectUserList(user);
|
| | | return getDataTable(list);
|
| | | }
|
| | |
|
| | | /**
|
| | | * è·åç¨æ·å表
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('system:user:list')")
|
| | | @GetMapping("/listAll")
|
| | | public AjaxResult listAll(SysUser user)
|
| | | {
|
| | | List<SysUser> list = userService.selectUserList(user);
|
| | | return AjaxResult.success(list);
|
| | | }
|
| | |
|
| | | @Log(title = "ç¨æ·ç®¡ç", businessType = BusinessType.EXPORT)
|
| | | @PreAuthorize("@ss.hasPermi('system:user:export')")
|
| | | @PostMapping("/export")
|
| | | public void export(HttpServletResponse response, SysUser user)
|
| | | {
|
| | | List<SysUser> list = userService.selectUserList(user);
|
| | | ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
|
| | | util.exportExcel(response, list, "ç¨æ·æ°æ®");
|
| | | }
|
| | |
|
| | | @Log(title = "ç¨æ·ç®¡ç", businessType = BusinessType.IMPORT)
|
| | | @PreAuthorize("@ss.hasPermi('system:user:import')")
|
| | | @PostMapping("/importData")
|
| | | public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception
|
| | | {
|
| | | ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
|
| | | List<SysUser> userList = util.importExcel(file.getInputStream());
|
| | | String operName = getUsername();
|
| | | String message = userService.importUser(userList, updateSupport, operName);
|
| | | return success(message);
|
| | | }
|
| | |
|
| | | @PostMapping("/importTemplate")
|
| | | public void importTemplate(HttpServletResponse response)
|
| | | {
|
| | | ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
|
| | | util.importTemplateExcel(response, "ç¨æ·æ°æ®");
|
| | | }
|
| | |
|
| | | /**
|
| | | * æ ¹æ®ç¨æ·ç¼å·è·å详ç»ä¿¡æ¯
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('system:user:query')")
|
| | | @GetMapping(value = { "/", "/{userId}" })
|
| | | public AjaxResult getInfo(@PathVariable(value = "userId", required = false) Long userId)
|
| | | {
|
| | | AjaxResult ajax = AjaxResult.success();
|
| | | if (StringUtils.isNotNull(userId))
|
| | | {
|
| | | userService.checkUserDataScope(userId);
|
| | | SysUser sysUser = userService.selectUserById(userId);
|
| | | ajax.put(AjaxResult.DATA_TAG, sysUser);
|
| | | ajax.put("postIds", postService.selectPostListByUserId(userId));
|
| | | ajax.put("roleIds", sysUser.getRoles().stream().map(SysRole::getRoleId).collect(Collectors.toList()));
|
| | | }
|
| | | List<SysRole> roles = roleService.selectRoleAll();
|
| | | ajax.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList()));
|
| | | ajax.put("posts", postService.selectPostAll());
|
| | | SysUserDeptVo sysUserDeptVo = new SysUserDeptVo();
|
| | | sysUserDeptVo.setUserId(userId);
|
| | | List<SysUserDeptVo> sysUserDeptVos = userDeptService.userLoginFacotryList(sysUserDeptVo);
|
| | | ajax.put("deptIds",sysUserDeptVos.stream().map(SysUserDeptVo::getDeptId).collect(Collectors.toList()));
|
| | | return ajax;
|
| | | }
|
| | |
|
| | | /**
|
| | | * æ°å¢ç¨æ·
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('system:user:add')")
|
| | | @Log(title = "ç¨æ·ç®¡ç", businessType = BusinessType.INSERT)
|
| | | @PostMapping
|
| | | public AjaxResult add(@Validated @RequestBody SysUser user)
|
| | | {
|
| | | roleService.checkRoleDataScope(user.getRoleIds());
|
| | | if (!userService.checkUserNameUnique(user))
|
| | | {
|
| | | return error("æ°å¢ç¨æ·'" + user.getUserName() + "'失败ï¼ç»å½è´¦å·å·²åå¨");
|
| | | }
|
| | | else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user))
|
| | | {
|
| | | return error("æ°å¢ç¨æ·'" + user.getUserName() + "'å¤±è´¥ï¼ææºå·ç å·²åå¨");
|
| | | }
|
| | | else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user))
|
| | | {
|
| | | return error("æ°å¢ç¨æ·'" + user.getUserName() + "'失败ï¼é®ç®±è´¦å·å·²åå¨");
|
| | | }
|
| | | user.setCreateBy(getUsername());
|
| | | user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
|
| | | user.setTenantId(user.getDeptId());
|
| | | return toAjax(userService.insertUser(user));
|
| | | }
|
| | |
|
| | | /**
|
| | | * ä¿®æ¹ç¨æ·
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('system:user:edit')")
|
| | | @Log(title = "ç¨æ·ç®¡ç", businessType = BusinessType.UPDATE)
|
| | | @PutMapping
|
| | | public AjaxResult edit(@Validated @RequestBody SysUser user)
|
| | | {
|
| | | userService.checkUserAllowed(user);
|
| | | userService.checkUserDataScope(user.getUserId());
|
| | | roleService.checkRoleDataScope(user.getRoleIds());
|
| | | if (!userService.checkUserNameUnique(user))
|
| | | {
|
| | | return error("ä¿®æ¹ç¨æ·'" + user.getUserName() + "'失败ï¼ç»å½è´¦å·å·²åå¨");
|
| | | }
|
| | | else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user))
|
| | | {
|
| | | return error("ä¿®æ¹ç¨æ·'" + user.getUserName() + "'å¤±è´¥ï¼ææºå·ç å·²åå¨");
|
| | | }
|
| | | else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user))
|
| | | {
|
| | | return error("ä¿®æ¹ç¨æ·'" + user.getUserName() + "'失败ï¼é®ç®±è´¦å·å·²åå¨");
|
| | | }
|
| | | user.setUpdateBy(getUsername());
|
| | | userService.bindUserDept(user);
|
| | | return toAjax(userService.updateUser(user));
|
| | | }
|
| | |
|
| | | /**
|
| | | * å é¤ç¨æ·
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('system:user:remove')")
|
| | | @Log(title = "ç¨æ·ç®¡ç", businessType = BusinessType.DELETE)
|
| | | @DeleteMapping("/{userIds}")
|
| | | public AjaxResult remove(@PathVariable Long[] userIds)
|
| | | {
|
| | | if (ArrayUtils.contains(userIds, getUserId()))
|
| | | {
|
| | | return error("å½åç¨æ·ä¸è½å é¤");
|
| | | }
|
| | | return toAjax(userService.deleteUserByIds(userIds));
|
| | | }
|
| | |
|
| | | /**
|
| | | * éç½®å¯ç
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('system:user:resetPwd')")
|
| | | @Log(title = "ç¨æ·ç®¡ç", businessType = BusinessType.UPDATE)
|
| | | @PutMapping("/resetPwd")
|
| | | public AjaxResult resetPwd(@RequestBody SysUser user)
|
| | | {
|
| | | userService.checkUserAllowed(user);
|
| | | userService.checkUserDataScope(user.getUserId());
|
| | | user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
|
| | | user.setUpdateBy(getUsername());
|
| | | return toAjax(userService.resetPwd(user));
|
| | | }
|
| | |
|
| | | /**
|
| | | * ç¶æä¿®æ¹
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('system:user:edit')")
|
| | | @Log(title = "ç¨æ·ç®¡ç", businessType = BusinessType.UPDATE)
|
| | | @PutMapping("/changeStatus")
|
| | | public AjaxResult changeStatus(@RequestBody SysUser user)
|
| | | {
|
| | | userService.checkUserAllowed(user);
|
| | | userService.checkUserDataScope(user.getUserId());
|
| | | user.setUpdateBy(getUsername());
|
| | | return toAjax(userService.updateUserStatus(user));
|
| | | }
|
| | |
|
| | | /**
|
| | | * æ ¹æ®ç¨æ·ç¼å·è·åææè§è²
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('system:user:query')")
|
| | | @GetMapping("/authRole/{userId}")
|
| | | public AjaxResult authRole(@PathVariable("userId") Long userId)
|
| | | {
|
| | | AjaxResult ajax = AjaxResult.success();
|
| | | SysUser user = userService.selectUserById(userId);
|
| | | List<SysRole> roles = roleService.selectRolesByUserId(userId);
|
| | | ajax.put("user", user);
|
| | | ajax.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList()));
|
| | | return ajax;
|
| | | }
|
| | |
|
| | | /**
|
| | | * ç¨æ·ææè§è²
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('system:user:edit')")
|
| | | @Log(title = "ç¨æ·ç®¡ç", businessType = BusinessType.GRANT)
|
| | | @PutMapping("/authRole")
|
| | | public AjaxResult insertAuthRole(Long userId, Long[] roleIds)
|
| | | {
|
| | | userService.checkUserDataScope(userId);
|
| | | roleService.checkRoleDataScope(roleIds);
|
| | | userService.insertUserAuth(userId, roleIds);
|
| | | return success();
|
| | | }
|
| | |
|
| | | /**
|
| | | * è·åé¨é¨æ å表
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('system:user:list')")
|
| | | @GetMapping("/deptTree")
|
| | | public AjaxResult deptTree(SysDept dept)
|
| | | {
|
| | | return success(deptService.selectDeptTreeList(dept));
|
| | | }
|
| | |
|
| | | /**
|
| | | * ä¸åé¡µç¨æ·æ¥è¯¢
|
| | | * @param user
|
| | | * @return
|
| | | */
|
| | | @GetMapping("/userListNoPage")
|
| | | public AjaxResult userListNoPage(SysUser user){
|
| | | List<SysUser> sysUserList = userService.userListNoPage(user);
|
| | | return AjaxResult.success(sysUserList);
|
| | | }
|
| | |
|
| | | /**
|
| | | * æ¥è¯¢å½åç¨æ·å
¬å¸ä¸ææç¨æ·
|
| | | * @param user
|
| | | * @return
|
| | | */
|
| | | @GetMapping("/userListNoPageByTenantId")
|
| | | public AjaxResult userListNoPageByTenantId(SysUser user){
|
| | | //è·åç»å½ç¨æ·ä¿¡æ¯
|
| | | SysUser loginUser = SecurityUtils.getLoginUser().getUser();
|
| | | user.setTenantId(loginUser.getTenantId());
|
| | | List<SysUser> sysUserList = userService.userListNoPage(user);
|
| | | return AjaxResult.success(sysUserList);
|
| | | }
|
| | | }
|
| | | package com.ruoyi.project.system.controller; |
| | | |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.framework.web.page.TableDataInfo; |
| | | import com.ruoyi.project.system.domain.SysDept; |
| | | import com.ruoyi.project.system.domain.SysRole; |
| | | import com.ruoyi.project.system.domain.SysUser; |
| | | import com.ruoyi.project.system.domain.vo.SysUserDeptVo; |
| | | import com.ruoyi.project.system.service.*; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import lombok.AllArgsConstructor; |
| | | import org.apache.commons.lang3.ArrayUtils; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * ç¨æ·ä¿¡æ¯ |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/system/user") |
| | | @AllArgsConstructor |
| | | public class SysUserController extends BaseController |
| | | { |
| | | private ISysUserService userService; |
| | | private ISysRoleService roleService; |
| | | private ISysDeptService deptService; |
| | | private ISysPostService postService; |
| | | private ISysUserDeptService userDeptService; |
| | | |
| | | /** |
| | | * è·åç¨æ·å表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:user:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(SysUser user) |
| | | { |
| | | startPage(); |
| | | List<SysUser> list = userService.selectUserList(user); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | /** |
| | | * è·åç¨æ·å表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:user:list')") |
| | | @GetMapping("/listAll") |
| | | public R<?> listAll(SysUser user) |
| | | { |
| | | List<SysUser> list = userService.selectUserList(user); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | @Log(title = "ç¨æ·ç®¡ç", businessType = BusinessType.EXPORT) |
| | | @PreAuthorize("@ss.hasPermi('system:user:export')") |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, SysUser user) |
| | | { |
| | | List<SysUser> list = userService.selectUserList(user); |
| | | ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class); |
| | | util.exportExcel(response, list, "ç¨æ·æ°æ®"); |
| | | } |
| | | |
| | | @Log(title = "ç¨æ·ç®¡ç", businessType = BusinessType.IMPORT) |
| | | @PreAuthorize("@ss.hasPermi('system:user:import')") |
| | | @PostMapping("/importData") |
| | | public R<?> importData(MultipartFile file, boolean updateSupport) throws Exception |
| | | { |
| | | ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class); |
| | | List<SysUser> userList = util.importExcel(file.getInputStream()); |
| | | String operName = getUsername(); |
| | | String message = userService.importUser(userList, updateSupport, operName); |
| | | return R.ok(null, message); |
| | | } |
| | | |
| | | @PostMapping("/importTemplate") |
| | | public void importTemplate(HttpServletResponse response) |
| | | { |
| | | ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class); |
| | | util.importTemplateExcel(response, "ç¨æ·æ°æ®"); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®ç¨æ·ç¼å·è·å详ç»ä¿¡æ¯ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:user:query')") |
| | | @GetMapping(value = { "/", "/{userId}" }) |
| | | public R<?> getInfo(@PathVariable(value = "userId", required = false) Long userId) |
| | | { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | if (StringUtils.isNotNull(userId)) |
| | | { |
| | | userService.checkUserDataScope(userId); |
| | | SysUser sysUser = userService.selectUserById(userId); |
| | | map.put("data", sysUser); |
| | | map.put("postIds", postService.selectPostListByUserId(userId)); |
| | | map.put("roleIds", sysUser.getRoles().stream().map(SysRole::getRoleId).collect(Collectors.toList())); |
| | | } |
| | | List<SysRole> roles = roleService.selectRoleAll(); |
| | | map.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList())); |
| | | map.put("posts", postService.selectPostAll()); |
| | | SysUserDeptVo sysUserDeptVo = new SysUserDeptVo(); |
| | | sysUserDeptVo.setUserId(userId); |
| | | List<SysUserDeptVo> sysUserDeptVos = userDeptService.userLoginFacotryList(sysUserDeptVo); |
| | | map.put("deptIds",sysUserDeptVos.stream().map(SysUserDeptVo::getDeptId).collect(Collectors.toList())); |
| | | return R.ok(map); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢ç¨æ· |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:user:add')") |
| | | @Log(title = "ç¨æ·ç®¡ç", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public R<?> add(@Validated @RequestBody SysUser user) |
| | | { |
| | | roleService.checkRoleDataScope(user.getRoleIds()); |
| | | if (!userService.checkUserNameUnique(user)) |
| | | { |
| | | return R.fail("æ°å¢ç¨æ·'" + user.getUserName() + "'失败ï¼ç»å½è´¦å·å·²åå¨"); |
| | | } |
| | | else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user)) |
| | | { |
| | | return R.fail("æ°å¢ç¨æ·'" + user.getUserName() + "'å¤±è´¥ï¼ææºå·ç å·²åå¨"); |
| | | } |
| | | else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user)) |
| | | { |
| | | return R.fail("æ°å¢ç¨æ·'" + user.getUserName() + "'失败ï¼é®ç®±è´¦å·å·²åå¨"); |
| | | } |
| | | user.setCreateBy(getUsername()); |
| | | user.setPassword(SecurityUtils.encryptPassword(user.getPassword())); |
| | | user.setTenantId(user.getDeptId()); |
| | | return R.ok(userService.insertUser(user)); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ç¨æ· |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:user:edit')") |
| | | @Log(title = "ç¨æ·ç®¡ç", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public R<?> edit(@Validated @RequestBody SysUser user) |
| | | { |
| | | userService.checkUserAllowed(user); |
| | | userService.checkUserDataScope(user.getUserId()); |
| | | roleService.checkRoleDataScope(user.getRoleIds()); |
| | | if (!userService.checkUserNameUnique(user)) |
| | | { |
| | | return R.fail("ä¿®æ¹ç¨æ·'" + user.getUserName() + "'失败ï¼ç»å½è´¦å·å·²åå¨"); |
| | | } |
| | | else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user)) |
| | | { |
| | | return R.fail("ä¿®æ¹ç¨æ·'" + user.getUserName() + "'å¤±è´¥ï¼ææºå·ç å·²åå¨"); |
| | | } |
| | | else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user)) |
| | | { |
| | | return R.fail("ä¿®æ¹ç¨æ·'" + user.getUserName() + "'失败ï¼é®ç®±è´¦å·å·²åå¨"); |
| | | } |
| | | user.setUpdateBy(getUsername()); |
| | | userService.bindUserDept(user); |
| | | return R.ok(userService.updateUser(user)); |
| | | } |
| | | |
| | | /** |
| | | * å é¤ç¨æ· |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:user:remove')") |
| | | @Log(title = "ç¨æ·ç®¡ç", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{userIds}") |
| | | public R<?> remove(@PathVariable Long[] userIds) |
| | | { |
| | | if (ArrayUtils.contains(userIds, getUserId())) |
| | | { |
| | | return R.fail("å½åç¨æ·ä¸è½å é¤"); |
| | | } |
| | | return R.ok(userService.deleteUserByIds(userIds)) ; |
| | | } |
| | | |
| | | /** |
| | | * éç½®å¯ç |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:user:resetPwd')") |
| | | @Log(title = "ç¨æ·ç®¡ç", businessType = BusinessType.UPDATE) |
| | | @PutMapping("/resetPwd") |
| | | public R<?> resetPwd(@RequestBody SysUser user) |
| | | { |
| | | userService.checkUserAllowed(user); |
| | | userService.checkUserDataScope(user.getUserId()); |
| | | user.setPassword(SecurityUtils.encryptPassword(user.getPassword())); |
| | | user.setUpdateBy(getUsername()); |
| | | return R.ok(userService.resetPwd(user)); |
| | | } |
| | | |
| | | /** |
| | | * ç¶æä¿®æ¹ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:user:edit')") |
| | | @Log(title = "ç¨æ·ç®¡ç", businessType = BusinessType.UPDATE) |
| | | @PutMapping("/changeStatus") |
| | | public R<?> changeStatus(@RequestBody SysUser user) |
| | | { |
| | | userService.checkUserAllowed(user); |
| | | userService.checkUserDataScope(user.getUserId()); |
| | | user.setUpdateBy(getUsername()); |
| | | return R.ok(userService.updateUserStatus(user)) ; |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®ç¨æ·ç¼å·è·åææè§è² |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:user:query')") |
| | | @GetMapping("/authRole/{userId}") |
| | | public R<?> authRole(@PathVariable("userId") Long userId) |
| | | { |
| | | SysUser user = userService.selectUserById(userId); |
| | | List<SysRole> roles = roleService.selectRolesByUserId(userId); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("user", user); |
| | | map.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList())); |
| | | return R.ok(map); |
| | | } |
| | | |
| | | /** |
| | | * ç¨æ·ææè§è² |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:user:edit')") |
| | | @Log(title = "ç¨æ·ç®¡ç", businessType = BusinessType.GRANT) |
| | | @PutMapping("/authRole") |
| | | public R<?> insertAuthRole(Long userId, Long[] roleIds) |
| | | { |
| | | userService.checkUserDataScope(userId); |
| | | roleService.checkRoleDataScope(roleIds); |
| | | userService.insertUserAuth(userId, roleIds); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * è·åé¨é¨æ å表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:user:list')") |
| | | @GetMapping("/deptTree") |
| | | public R<?> deptTree(SysDept dept) |
| | | { |
| | | return R.ok(deptService.selectDeptTreeList(dept)); |
| | | } |
| | | |
| | | /** |
| | | * ä¸åé¡µç¨æ·æ¥è¯¢ |
| | | * @param user |
| | | * @return |
| | | */ |
| | | @GetMapping("/userListNoPage") |
| | | public R<?> userListNoPage(SysUser user){ |
| | | List<SysUser> sysUserList = userService.userListNoPage(user); |
| | | return R.ok(sysUserList); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢å½åç¨æ·å
¬å¸ä¸ææç¨æ· |
| | | * @param user |
| | | * @return |
| | | */ |
| | | @GetMapping("/userListNoPageByTenantId") |
| | | public R<?> userListNoPageByTenantId(SysUser user){ |
| | | //è·åç»å½ç¨æ·ä¿¡æ¯ |
| | | SysUser loginUser = SecurityUtils.getLoginUser().getUser(); |
| | | user.setTenantId(loginUser.getTenantId()); |
| | | List<SysUser> sysUserList = userService.userListNoPage(user); |
| | | return R.ok(sysUserList); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.project.tool.gen.controller;
|
| | |
|
| | | import com.alibaba.druid.DbType;
|
| | | import com.alibaba.druid.sql.SQLUtils;
|
| | | import com.alibaba.druid.sql.ast.SQLStatement;
|
| | | import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlCreateTableStatement;
|
| | | import com.ruoyi.common.core.text.Convert;
|
| | | import com.ruoyi.common.utils.SecurityUtils;
|
| | | import com.ruoyi.common.utils.sql.SqlUtil;
|
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log;
|
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
|
| | | import com.ruoyi.framework.config.GenConfig;
|
| | | import com.ruoyi.framework.web.controller.BaseController;
|
| | | import com.ruoyi.framework.web.domain.AjaxResult;
|
| | | import com.ruoyi.framework.web.page.TableDataInfo;
|
| | | import com.ruoyi.project.tool.gen.domain.GenTable;
|
| | | import com.ruoyi.project.tool.gen.domain.GenTableColumn;
|
| | | import com.ruoyi.project.tool.gen.service.IGenTableColumnService;
|
| | | import com.ruoyi.project.tool.gen.service.IGenTableService;
|
| | | import jakarta.servlet.http.HttpServletResponse;
|
| | | import lombok.AllArgsConstructor;
|
| | | import org.apache.commons.io.IOUtils;
|
| | | import org.springframework.security.access.prepost.PreAuthorize;
|
| | | import org.springframework.validation.annotation.Validated;
|
| | | import org.springframework.web.bind.annotation.*;
|
| | |
|
| | | import java.io.IOException;
|
| | | import java.util.ArrayList;
|
| | | import java.util.HashMap;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
|
| | | /**
|
| | | * 代ç çæ æä½å¤ç
|
| | | * |
| | | * @author ruoyi
|
| | | */
|
| | | @RestController
|
| | | @RequestMapping("/tool/gen")
|
| | | @AllArgsConstructor
|
| | | public class GenController extends BaseController
|
| | | {
|
| | | private IGenTableService genTableService;
|
| | | private IGenTableColumnService genTableColumnService;
|
| | |
|
| | | /**
|
| | | * æ¥è¯¢ä»£ç çæå表
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('tool:gen:list')")
|
| | | @GetMapping("/list")
|
| | | public TableDataInfo genList(GenTable genTable)
|
| | | {
|
| | | startPage();
|
| | | List<GenTable> list = genTableService.selectGenTableList(genTable);
|
| | | return getDataTable(list);
|
| | | }
|
| | |
|
| | | /**
|
| | | * è·å代ç çæä¿¡æ¯
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('tool:gen:query')")
|
| | | @GetMapping(value = "/{talbleId}")
|
| | | public AjaxResult getInfo(@PathVariable Long talbleId)
|
| | | {
|
| | | GenTable table = genTableService.selectGenTableById(talbleId);
|
| | | List<GenTable> tables = genTableService.selectGenTableAll();
|
| | | List<GenTableColumn> list = genTableColumnService.selectGenTableColumnListByTableId(talbleId);
|
| | | Map<String, Object> map = new HashMap<String, Object>();
|
| | | map.put("info", table);
|
| | | map.put("rows", list);
|
| | | map.put("tables", tables);
|
| | | return success(map);
|
| | | }
|
| | |
|
| | | /**
|
| | | * æ¥è¯¢æ°æ®åºå表
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('tool:gen:list')")
|
| | | @GetMapping("/db/list")
|
| | | public TableDataInfo dataList(GenTable genTable)
|
| | | {
|
| | | startPage();
|
| | | List<GenTable> list = genTableService.selectDbTableList(genTable);
|
| | | return getDataTable(list);
|
| | | }
|
| | |
|
| | | /**
|
| | | * æ¥è¯¢æ°æ®è¡¨å段å表
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('tool:gen:list')")
|
| | | @GetMapping(value = "/column/{tableId}")
|
| | | public TableDataInfo columnList(Long tableId)
|
| | | {
|
| | | TableDataInfo dataInfo = new TableDataInfo();
|
| | | List<GenTableColumn> list = genTableColumnService.selectGenTableColumnListByTableId(tableId);
|
| | | dataInfo.setRows(list);
|
| | | dataInfo.setTotal(list.size());
|
| | | return dataInfo;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 导å
¥è¡¨ç»æï¼ä¿åï¼
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('tool:gen:import')")
|
| | | @Log(title = "代ç çæ", businessType = BusinessType.IMPORT)
|
| | | @PostMapping("/importTable")
|
| | | public AjaxResult importTableSave(String tables)
|
| | | {
|
| | | String[] tableNames = Convert.toStrArray(tables);
|
| | | // æ¥è¯¢è¡¨ä¿¡æ¯
|
| | | List<GenTable> tableList = genTableService.selectDbTableListByNames(tableNames);
|
| | | genTableService.importGenTable(tableList, SecurityUtils.getUsername());
|
| | | return success();
|
| | | }
|
| | |
|
| | | /**
|
| | | * åå»ºè¡¨ç»æï¼ä¿åï¼
|
| | | */
|
| | | @PreAuthorize("@ss.hasRole('admin')")
|
| | | @Log(title = "å建表", businessType = BusinessType.OTHER)
|
| | | @PostMapping("/createTable")
|
| | | public AjaxResult createTableSave(String sql)
|
| | | {
|
| | | try
|
| | | {
|
| | | SqlUtil.filterKeyword(sql);
|
| | | List<SQLStatement> sqlStatements = SQLUtils.parseStatements(sql, DbType.mysql);
|
| | | List<String> tableNames = new ArrayList<>();
|
| | | for (SQLStatement sqlStatement : sqlStatements)
|
| | | {
|
| | | if (sqlStatement instanceof MySqlCreateTableStatement)
|
| | | {
|
| | | MySqlCreateTableStatement createTableStatement = (MySqlCreateTableStatement) sqlStatement;
|
| | | if (genTableService.createTable(createTableStatement.toString()))
|
| | | {
|
| | | String tableName = createTableStatement.getTableName().replaceAll("`", "");
|
| | | tableNames.add(tableName);
|
| | | }
|
| | | }
|
| | | }
|
| | | List<GenTable> tableList = genTableService.selectDbTableListByNames(tableNames.toArray(new String[tableNames.size()]));
|
| | | String operName = SecurityUtils.getUsername();
|
| | | genTableService.importGenTable(tableList, operName);
|
| | | return AjaxResult.success();
|
| | | }
|
| | | catch (Exception e)
|
| | | {
|
| | | logger.error(e.getMessage(), e);
|
| | | return AjaxResult.error("åå»ºè¡¨ç»æå¼å¸¸");
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * ä¿®æ¹ä¿å代ç çæä¸å¡
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('tool:gen:edit')")
|
| | | @Log(title = "代ç çæ", businessType = BusinessType.UPDATE)
|
| | | @PutMapping
|
| | | public AjaxResult editSave(@Validated @RequestBody GenTable genTable)
|
| | | {
|
| | | genTableService.validateEdit(genTable);
|
| | | genTableService.updateGenTable(genTable);
|
| | | return success();
|
| | | }
|
| | |
|
| | | /**
|
| | | * å é¤ä»£ç çæ
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('tool:gen:remove')")
|
| | | @Log(title = "代ç çæ", businessType = BusinessType.DELETE)
|
| | | @DeleteMapping("/{tableIds}")
|
| | | public AjaxResult remove(@PathVariable Long[] tableIds)
|
| | | {
|
| | | genTableService.deleteGenTableByIds(tableIds);
|
| | | return success();
|
| | | }
|
| | |
|
| | | /**
|
| | | * é¢è§ä»£ç
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('tool:gen:preview')")
|
| | | @GetMapping("/preview/{tableId}")
|
| | | public AjaxResult preview(@PathVariable("tableId") Long tableId) throws IOException
|
| | | {
|
| | | Map<String, String> dataMap = genTableService.previewCode(tableId);
|
| | | return success(dataMap);
|
| | | }
|
| | |
|
| | | /**
|
| | | * çæä»£ç ï¼ä¸è½½æ¹å¼ï¼
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('tool:gen:code')")
|
| | | @Log(title = "代ç çæ", businessType = BusinessType.GENCODE)
|
| | | @GetMapping("/download/{tableName}")
|
| | | public void download(HttpServletResponse response, @PathVariable("tableName") String tableName) throws IOException
|
| | | {
|
| | | byte[] data = genTableService.downloadCode(tableName);
|
| | | genCode(response, data);
|
| | | }
|
| | |
|
| | | /**
|
| | | * çæä»£ç ï¼èªå®ä¹è·¯å¾ï¼
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('tool:gen:code')")
|
| | | @Log(title = "代ç çæ", businessType = BusinessType.GENCODE)
|
| | | @GetMapping("/genCode/{tableName}")
|
| | | public AjaxResult genCode(@PathVariable("tableName") String tableName)
|
| | | {
|
| | | if (!GenConfig.isAllowOverwrite())
|
| | | {
|
| | | return AjaxResult.error("ãç³»ç»é¢è®¾ãä¸å
è®¸çææä»¶è¦çå°æ¬å°");
|
| | | }
|
| | | genTableService.generatorCode(tableName);
|
| | | return success();
|
| | | }
|
| | |
|
| | | /**
|
| | | * åæ¥æ°æ®åº
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('tool:gen:edit')")
|
| | | @Log(title = "代ç çæ", businessType = BusinessType.UPDATE)
|
| | | @GetMapping("/synchDb/{tableName}")
|
| | | public AjaxResult synchDb(@PathVariable("tableName") String tableName)
|
| | | {
|
| | | genTableService.synchDb(tableName);
|
| | | return success();
|
| | | }
|
| | |
|
| | | /**
|
| | | * æ¹éçæä»£ç
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('tool:gen:code')")
|
| | | @Log(title = "代ç çæ", businessType = BusinessType.GENCODE)
|
| | | @GetMapping("/batchGenCode")
|
| | | public void batchGenCode(HttpServletResponse response, String tables) throws IOException
|
| | | {
|
| | | String[] tableNames = Convert.toStrArray(tables);
|
| | | byte[] data = genTableService.downloadCode(tableNames);
|
| | | genCode(response, data);
|
| | | }
|
| | |
|
| | | /**
|
| | | * çæzipæä»¶
|
| | | */
|
| | | private void genCode(HttpServletResponse response, byte[] data) throws IOException
|
| | | {
|
| | | response.reset();
|
| | | response.addHeader("Access-Control-Allow-Origin", "*");
|
| | | response.addHeader("Access-Control-Expose-Headers", "Content-Disposition");
|
| | | response.setHeader("Content-Disposition", "attachment; filename=\"ruoyi.zip\"");
|
| | | response.addHeader("Content-Length", "" + data.length);
|
| | | response.setContentType("application/octet-stream; charset=UTF-8");
|
| | | IOUtils.write(data, response.getOutputStream());
|
| | | }
|
| | | package com.ruoyi.project.tool.gen.controller; |
| | | |
| | | import com.alibaba.druid.DbType; |
| | | import com.alibaba.druid.sql.SQLUtils; |
| | | import com.alibaba.druid.sql.ast.SQLStatement; |
| | | import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlCreateTableStatement; |
| | | import com.ruoyi.common.core.text.Convert; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.sql.SqlUtil; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.config.GenConfig; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.framework.web.page.TableDataInfo; |
| | | import com.ruoyi.project.tool.gen.domain.GenTable; |
| | | import com.ruoyi.project.tool.gen.domain.GenTableColumn; |
| | | import com.ruoyi.project.tool.gen.service.IGenTableColumnService; |
| | | import com.ruoyi.project.tool.gen.service.IGenTableService; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import lombok.AllArgsConstructor; |
| | | import org.apache.commons.io.IOUtils; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 代ç çæ æä½å¤ç |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/tool/gen") |
| | | @AllArgsConstructor |
| | | public class GenController extends BaseController |
| | | { |
| | | private IGenTableService genTableService; |
| | | private IGenTableColumnService genTableColumnService; |
| | | |
| | | /** |
| | | * æ¥è¯¢ä»£ç çæå表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('tool:gen:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo genList(GenTable genTable) |
| | | { |
| | | startPage(); |
| | | List<GenTable> list = genTableService.selectGenTableList(genTable); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | /** |
| | | * è·å代ç çæä¿¡æ¯ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('tool:gen:query')") |
| | | @GetMapping(value = "/{talbleId}") |
| | | public R<?> getInfo(@PathVariable Long talbleId) |
| | | { |
| | | GenTable table = genTableService.selectGenTableById(talbleId); |
| | | List<GenTable> tables = genTableService.selectGenTableAll(); |
| | | List<GenTableColumn> list = genTableColumnService.selectGenTableColumnListByTableId(talbleId); |
| | | Map<String, Object> map = new HashMap<String, Object>(); |
| | | map.put("info", table); |
| | | map.put("rows", list); |
| | | map.put("tables", tables); |
| | | return R.ok(map); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢æ°æ®åºå表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('tool:gen:list')") |
| | | @GetMapping("/db/list") |
| | | public TableDataInfo dataList(GenTable genTable) |
| | | { |
| | | startPage(); |
| | | List<GenTable> list = genTableService.selectDbTableList(genTable); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢æ°æ®è¡¨å段å表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('tool:gen:list')") |
| | | @GetMapping(value = "/column/{tableId}") |
| | | public TableDataInfo columnList(Long tableId) |
| | | { |
| | | TableDataInfo dataInfo = new TableDataInfo(); |
| | | List<GenTableColumn> list = genTableColumnService.selectGenTableColumnListByTableId(tableId); |
| | | dataInfo.setRows(list); |
| | | dataInfo.setTotal(list.size()); |
| | | return dataInfo; |
| | | } |
| | | |
| | | /** |
| | | * 导å
¥è¡¨ç»æï¼ä¿åï¼ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('tool:gen:import')") |
| | | @Log(title = "代ç çæ", businessType = BusinessType.IMPORT) |
| | | @PostMapping("/importTable") |
| | | public R<?> importTableSave(String tables) |
| | | { |
| | | String[] tableNames = Convert.toStrArray(tables); |
| | | // æ¥è¯¢è¡¨ä¿¡æ¯ |
| | | List<GenTable> tableList = genTableService.selectDbTableListByNames(tableNames); |
| | | genTableService.importGenTable(tableList, SecurityUtils.getUsername()); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * åå»ºè¡¨ç»æï¼ä¿åï¼ |
| | | */ |
| | | @PreAuthorize("@ss.hasRole('admin')") |
| | | @Log(title = "å建表", businessType = BusinessType.OTHER) |
| | | @PostMapping("/createTable") |
| | | public R<?> createTableSave(String sql) |
| | | { |
| | | try |
| | | { |
| | | SqlUtil.filterKeyword(sql); |
| | | List<SQLStatement> sqlStatements = SQLUtils.parseStatements(sql, DbType.mysql); |
| | | List<String> tableNames = new ArrayList<>(); |
| | | for (SQLStatement sqlStatement : sqlStatements) |
| | | { |
| | | if (sqlStatement instanceof MySqlCreateTableStatement) |
| | | { |
| | | MySqlCreateTableStatement createTableStatement = (MySqlCreateTableStatement) sqlStatement; |
| | | if (genTableService.createTable(createTableStatement.toString())) |
| | | { |
| | | String tableName = createTableStatement.getTableName().replaceAll("`", ""); |
| | | tableNames.add(tableName); |
| | | } |
| | | } |
| | | } |
| | | List<GenTable> tableList = genTableService.selectDbTableListByNames(tableNames.toArray(new String[tableNames.size()])); |
| | | String operName = SecurityUtils.getUsername(); |
| | | genTableService.importGenTable(tableList, operName); |
| | | return R.ok(); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | logger.error(e.getMessage(), e); |
| | | return R.fail("åå»ºè¡¨ç»æå¼å¸¸"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ä¿å代ç çæä¸å¡ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('tool:gen:edit')") |
| | | @Log(title = "代ç çæ", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public R<?> editSave(@Validated @RequestBody GenTable genTable) |
| | | { |
| | | genTableService.validateEdit(genTable); |
| | | genTableService.updateGenTable(genTable); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * å é¤ä»£ç çæ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('tool:gen:remove')") |
| | | @Log(title = "代ç çæ", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{tableIds}") |
| | | public R<?> remove(@PathVariable Long[] tableIds) |
| | | { |
| | | genTableService.deleteGenTableByIds(tableIds); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * é¢è§ä»£ç |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('tool:gen:preview')") |
| | | @GetMapping("/preview/{tableId}") |
| | | public R<?> preview(@PathVariable("tableId") Long tableId) throws IOException |
| | | { |
| | | Map<String, String> dataMap = genTableService.previewCode(tableId); |
| | | return R.ok(dataMap); |
| | | } |
| | | |
| | | /** |
| | | * çæä»£ç ï¼ä¸è½½æ¹å¼ï¼ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('tool:gen:code')") |
| | | @Log(title = "代ç çæ", businessType = BusinessType.GENCODE) |
| | | @GetMapping("/download/{tableName}") |
| | | public void download(HttpServletResponse response, @PathVariable("tableName") String tableName) throws IOException |
| | | { |
| | | byte[] data = genTableService.downloadCode(tableName); |
| | | genCode(response, data); |
| | | } |
| | | |
| | | /** |
| | | * çæä»£ç ï¼èªå®ä¹è·¯å¾ï¼ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('tool:gen:code')") |
| | | @Log(title = "代ç çæ", businessType = BusinessType.GENCODE) |
| | | @GetMapping("/genCode/{tableName}") |
| | | public R<?> genCode(@PathVariable("tableName") String tableName) |
| | | { |
| | | if (!GenConfig.isAllowOverwrite()) |
| | | { |
| | | return R.fail("ãç³»ç»é¢è®¾ãä¸å
è®¸çææä»¶è¦çå°æ¬å°"); |
| | | } |
| | | genTableService.generatorCode(tableName); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * åæ¥æ°æ®åº |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('tool:gen:edit')") |
| | | @Log(title = "代ç çæ", businessType = BusinessType.UPDATE) |
| | | @GetMapping("/synchDb/{tableName}") |
| | | public R<?> synchDb(@PathVariable("tableName") String tableName) |
| | | { |
| | | genTableService.synchDb(tableName); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * æ¹éçæä»£ç |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('tool:gen:code')") |
| | | @Log(title = "代ç çæ", businessType = BusinessType.GENCODE) |
| | | @GetMapping("/batchGenCode") |
| | | public void batchGenCode(HttpServletResponse response, String tables) throws IOException |
| | | { |
| | | String[] tableNames = Convert.toStrArray(tables); |
| | | byte[] data = genTableService.downloadCode(tableNames); |
| | | genCode(response, data); |
| | | } |
| | | |
| | | /** |
| | | * çæzipæä»¶ |
| | | */ |
| | | private void genCode(HttpServletResponse response, byte[] data) throws IOException |
| | | { |
| | | response.reset(); |
| | | response.addHeader("Access-Control-Allow-Origin", "*"); |
| | | response.addHeader("Access-Control-Expose-Headers", "Content-Disposition"); |
| | | response.setHeader("Content-Disposition", "attachment; filename=\"ruoyi.zip\""); |
| | | response.addHeader("Content-Length", "" + data.length); |
| | | response.setContentType("application/octet-stream; charset=UTF-8"); |
| | | IOUtils.write(data, response.getOutputStream()); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.projectManagement.controller; |
| | | |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.projectManagement.dto.InfoStageDto; |
| | | import com.ruoyi.projectManagement.dto.UpdateStateInfo; |
| | | import com.ruoyi.projectManagement.service.InfoService; |
| | |
| | | @RequestMapping("/projectManagement/info") |
| | | @Tag(name = "项ç®ç®¡çä¿¡æ¯è¡¨(项ç®ç®¡çç±»å)") |
| | | @RequiredArgsConstructor |
| | | public class InfoController { |
| | | public class InfoController extends BaseController { |
| | | |
| | | private final InfoService infoService; |
| | | private final InfoStageHandleService infoStageHandleService; |
| | | |
| | | @PostMapping("/save") |
| | | @Operation(summary = "ä¿å") |
| | | public AjaxResult save(@RequestBody @Valid SaveInfoVo saveInfoVo) { |
| | | public R<?> save(@RequestBody @Valid SaveInfoVo saveInfoVo) { |
| | | infoService.save(saveInfoVo); |
| | | return AjaxResult.success(); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @PostMapping("/updateStatus") |
| | | @Operation(summary = "ä¿®æ¹ç¶æ") |
| | | public AjaxResult updateStatus(@RequestBody @Valid UpdateStateInfo updateStateInfo){ |
| | | public R<?> updateStatus(@RequestBody @Valid UpdateStateInfo updateStateInfo){ |
| | | infoService.updateStatus(updateStateInfo); |
| | | return AjaxResult.success(); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @PostMapping("/delete/{id}") |
| | | @Operation(summary = "å é¤") |
| | | public AjaxResult delete(@PathVariable Long id) { |
| | | public R<?> delete(@PathVariable Long id) { |
| | | infoService.deleteInfo(id); |
| | | return AjaxResult.success(); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @PostMapping("/listPage") |
| | | @Operation(summary = "å页å表") |
| | | public AjaxResult listPage(@RequestBody @Valid SearchInfoVo vo) { |
| | | return AjaxResult.success(infoService.searchListInfo(vo)); |
| | | public R<?> listPage(@RequestBody @Valid SearchInfoVo vo) { |
| | | return R.ok(infoService.searchListInfo(vo)); |
| | | } |
| | | |
| | | |
| | | @PostMapping("/{id}") |
| | | @Operation(summary = "详æ
") |
| | | public AjaxResult getInfoById(@PathVariable Long id) { |
| | | return AjaxResult.success(infoService.getInfoById(id)); |
| | | public R<?> getInfoById(@PathVariable Long id) { |
| | | return R.ok(infoService.getInfoById(id)); |
| | | } |
| | | |
| | | @PostMapping("/saveStage") |
| | | @Operation(summary = "ä¿åé¶æ®µ") |
| | | public AjaxResult saveStage(@RequestBody @Valid SaveInfoStageVo dto) { |
| | | public R<?> saveStage(@RequestBody @Valid SaveInfoStageVo dto) { |
| | | infoStageHandleService.save(dto); |
| | | return AjaxResult.success(); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @PostMapping("/listStage/{id}") |
| | | @Operation(summary = "åè¡¨é¶æ®µ") |
| | | public AjaxResult listStage(@PathVariable Long id) { |
| | | return AjaxResult.success(infoStageHandleService.getListVoByInfoId(id)); |
| | | public R<?> listStage(@PathVariable Long id) { |
| | | return R.ok(infoStageHandleService.getListVoByInfoId(id)); |
| | | } |
| | | |
| | | @PostMapping("/deleteStage/{id}") |
| | | @Operation(summary = "å é¤é¶æ®µ") |
| | | public AjaxResult deleteStage(@PathVariable Long id) { |
| | | public R<?> deleteStage(@PathVariable Long id) { |
| | | infoStageHandleService.deleteById(id); |
| | | return AjaxResult.success(); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | |
| | | package com.ruoyi.projectManagement.controller; |
| | | |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.projectManagement.service.PlanService; |
| | | import com.ruoyi.projectManagement.vo.SavePlanNodeVo; |
| | | import com.ruoyi.projectManagement.vo.SavePlanVo; |
| | |
| | | @RequestMapping("/projectManagement/plan") |
| | | @Tag(name = "项ç®ç®¡ç计å表(项ç®ç®¡çç±»å)") |
| | | @RequiredArgsConstructor |
| | | public class PlanController { |
| | | public class PlanController extends BaseController { |
| | | |
| | | private final PlanService planService; |
| | | |
| | | @PostMapping("/save") |
| | | @Operation(summary = "ä¿å") |
| | | public AjaxResult save(@RequestBody @Valid SavePlanVo savePlanVo) { |
| | | public R<?> save(@RequestBody @Valid SavePlanVo savePlanVo) { |
| | | planService.savePlan(savePlanVo); |
| | | return AjaxResult.success(); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @PostMapping("/delete/{id}") |
| | | @Operation(summary = "å é¤") |
| | | public AjaxResult delete(@PathVariable Long id) { |
| | | public R<?> delete(@PathVariable Long id) { |
| | | planService.deletePlan(id); |
| | | return AjaxResult.success(); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @PostMapping("/listPage") |
| | | @Operation(summary = "å页å表") |
| | | public AjaxResult listPage(@RequestBody SearchPlanVo searchPlanVo) { |
| | | return AjaxResult.success(planService.searchPlan(searchPlanVo)); |
| | | public R<?> listPage(@RequestBody SearchPlanVo searchPlanVo) { |
| | | return R.ok(planService.searchPlan(searchPlanVo)); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.utils.OrderUtils; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.projectManagement.dto.RoleDto; |
| | | import com.ruoyi.projectManagement.mapper.RolesMapper; |
| | | import com.ruoyi.projectManagement.pojo.Roles; |
| | |
| | | @AllArgsConstructor |
| | | @RequestMapping("/projectManagement/roles") |
| | | @Tag(name = "") |
| | | public class RolesController { |
| | | public class RolesController extends BaseController { |
| | | |
| | | private RolesService rolesservice; |
| | | private RolesMapper rolesMapper; |
| | | |
| | | @GetMapping("/listPage") |
| | | @Operation(summary = "å页æ¥è¯¢ææ") |
| | | public AjaxResult listPage(Page<Roles> page, Roles roles) { |
| | | return AjaxResult.success(rolesservice.listPage(page, roles)); |
| | | public R<?> listPage(Page<Roles> page, Roles roles) { |
| | | return R.ok(rolesservice.listPage(page, roles)); |
| | | } |
| | | |
| | | @PostMapping("/add") |
| | | @Operation(summary = "æ°å¢") |
| | | public AjaxResult add(@RequestBody RoleDto roleDto) { |
| | | public R<?> add(@RequestBody RoleDto roleDto) { |
| | | if (roleDto.getIsDefaultNo()) { |
| | | roleDto.setNo(OrderUtils.countTodayByCreateTime(rolesMapper, "XMJS","no")); |
| | | } |
| | | return AjaxResult.success(rolesservice.save(roleDto)); |
| | | return R.ok(rolesservice.save(roleDto)); |
| | | } |
| | | |
| | | @PostMapping("/update") |
| | | @Operation(summary = "ä¿®æ¹") |
| | | public AjaxResult update(@RequestBody Roles roles) { |
| | | return AjaxResult.success(rolesservice.updateById(roles)); |
| | | public R<?> update(@RequestBody Roles roles) { |
| | | return R.ok(rolesservice.updateById(roles)); |
| | | } |
| | | |
| | | @DeleteMapping("/delete") |
| | | @Operation(summary = "å é¤") |
| | | public AjaxResult delete(@RequestBody List<Long> ids) { |
| | | if (CollectionUtils.isEmpty(ids)) return AjaxResult.error("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | return AjaxResult.success(rolesservice.removeBatchByIds(ids)); |
| | | public R<?> delete(@RequestBody List<Long> ids) { |
| | | if (CollectionUtils.isEmpty(ids)) return R.fail("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | return R.ok(rolesservice.removeBatchByIds(ids)); |
| | | } |
| | | |
| | | @PostMapping("/listSimpleRole") |
| | | public AjaxResult listSimpleRole() { |
| | | return AjaxResult.success(rolesservice.listSimpleRole()); |
| | | public R<?> listSimpleRole() { |
| | | return R.ok(rolesservice.listSimpleRole()); |
| | | } |
| | | } |
| | |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.purchase.dto.InvoicePurchaseReportDto; |
| | | import com.ruoyi.purchase.dto.VatDto; |
| | | import com.ruoyi.purchase.pojo.InvoicePurchase; |
| | |
| | | @Tag(name = "éè´æ¥è¡¨") |
| | | @RequestMapping("/purchase/report") |
| | | @AllArgsConstructor |
| | | public class AccountingReportController { |
| | | public class AccountingReportController extends BaseController { |
| | | |
| | | private IInvoicePurchaseService invoicePurchaseService; |
| | | |
| | | @GetMapping("/list") |
| | | @Log(title = "éè´æ¥è¡¨-项ç®å©æ¶¦", businessType = BusinessType.OTHER) |
| | | public AjaxResult list(Page page, InvoicePurchaseReportDto invoicePurchaseReportDto) { |
| | | public R<?> list(Page page, InvoicePurchaseReportDto invoicePurchaseReportDto) { |
| | | IPage<InvoicePurchaseReportDto> result =invoicePurchaseService.listPurchaseReport(page, invoicePurchaseReportDto); |
| | | return AjaxResult.success(result); |
| | | return R.ok(result); |
| | | } |
| | | |
| | | @Log(title = "éè´æ¥è¡¨-项ç®å©æ¶¦å¯¼åº", businessType = BusinessType.EXPORT) |
| | |
| | | |
| | | @Log(title = "éè´æ¥è¡¨-å¢å¼ç¨æ¯å¯¹", businessType = BusinessType.OTHER) |
| | | @GetMapping("/listVat") |
| | | public AjaxResult listVat(Page page,String month) { |
| | | public R<?> listVat(Page page,String month) { |
| | | IPage<VatDto> result = invoicePurchaseService.listVat(page, month); |
| | | return AjaxResult.success(result); |
| | | return R.ok(result); |
| | | } |
| | | |
| | | @Log(title = "éè´æ¥è¡¨-å¢å¼ç¨æ¯å¯¹", businessType = BusinessType.EXPORT) |
| | |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.framework.web.page.TableDataInfo; |
| | | import com.ruoyi.purchase.dto.InvoicePurchaseDto; |
| | | import com.ruoyi.purchase.pojo.InvoicePurchase; |
| | |
| | | */ |
| | | @Log(title = "å票信æ¯", businessType = BusinessType.INSERT) |
| | | @PostMapping("/addOrUpdateInvoice") |
| | | public AjaxResult addOrUpdateInvoice(@RequestBody InvoicePurchaseDto invoicePurchaseDto) throws IOException { |
| | | return toAjax(invoicePurchaseService.addOrUpdateInvoice(invoicePurchaseDto)); |
| | | public R<?> addOrUpdateInvoice(@RequestBody InvoicePurchaseDto invoicePurchaseDto) throws IOException { |
| | | invoicePurchaseService.addOrUpdateInvoice(invoicePurchaseDto); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Log(title = "å票信æ¯", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/delInvoice") |
| | | public AjaxResult remove(@RequestBody Long[] ids) { |
| | | return toAjax(invoicePurchaseService.delInvoice(ids)); |
| | | public R<?> remove(@RequestBody Long[] ids) { |
| | | invoicePurchaseService.delInvoice(ids); |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.framework.web.page.TableDataInfo; |
| | | import com.ruoyi.purchase.dto.PaymentHistoryRecordVo; |
| | | import com.ruoyi.purchase.dto.PaymentLedgerDto; |
| | |
| | | * è·å仿¬¾ç»è®°è¯¦ç»ä¿¡æ¯ |
| | | */ |
| | | @GetMapping(value = "/{id}") |
| | | public AjaxResult getInfo(@PathVariable("id") Long id) { |
| | | return success(paymentRegistrationService.selectPaymentRegistrationById(id)); |
| | | public R<?> getInfo(@PathVariable("id") Long id) { |
| | | return R.ok(paymentRegistrationService.selectPaymentRegistrationById(id)); |
| | | } |
| | | |
| | | /** |
| | |
| | | @Log(title = "仿¬¾ç»è®°", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult add(@RequestBody List<PaymentRegistration> paymentRegistration) { |
| | | return toAjax(paymentRegistrationService.insertPaymentRegistration(paymentRegistration)); |
| | | public R<?> add(@RequestBody List<PaymentRegistration> paymentRegistration) { |
| | | paymentRegistrationService.insertPaymentRegistration(paymentRegistration); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | |
| | | @Log(title = "仿¬¾ç»è®°", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult edit(@RequestBody PaymentRegistration paymentRegistration) { |
| | | return toAjax(paymentRegistrationService.updatePaymentRegistration(paymentRegistration)); |
| | | public R<?> edit(@RequestBody PaymentRegistration paymentRegistration) { |
| | | paymentRegistrationService.updatePaymentRegistration(paymentRegistration); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Log(title = "仿¬¾ç»è®°", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/del") |
| | | public AjaxResult remove(@RequestBody Long[] ids) { |
| | | return toAjax(paymentRegistrationService.deletePaymentRegistrationByIds(ids)); |
| | | public R<?> remove(@RequestBody Long[] ids) { |
| | | paymentRegistrationService.deletePaymentRegistrationByIds(ids); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Log(title = "仿¬¾ç»è®°", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/delete") |
| | | public AjaxResult delete(@RequestBody Long[] ids) { |
| | | return toAjax(paymentRegistrationService.delete(ids)); |
| | | public R<?> delete(@RequestBody Long[] ids) { |
| | | paymentRegistrationService.delete(ids); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * è·å仿¬¾ç»è®°è¯¦ç»ä¿¡æ¯ |
| | | */ |
| | | @GetMapping(value = "/byPurchaseId/{id}") |
| | | public AjaxResult getPurchaseInfo(@PathVariable("id") Long id) { |
| | | return success(paymentRegistrationService.selectPaymentRegistrationByPurchaseId(id)); |
| | | public R<?> getPurchaseInfo(@PathVariable("id") Long id) { |
| | | return R.ok(paymentRegistrationService.selectPaymentRegistrationByPurchaseId(id)); |
| | | } |
| | | |
| | | /** |
| | | * è·å仿¬¾ç»è®°è¯¦ç»ä¿¡æ¯ |
| | | */ |
| | | @GetMapping(value = "/paymentLedgerList") |
| | | public AjaxResult paymentLedgerList(PaymentLedgerDto paymentLedgerDto, Page page, |
| | | public R<?> paymentLedgerList(PaymentLedgerDto paymentLedgerDto, Page page, |
| | | Integer detailPageNum, |
| | | Integer detailPageSize) { |
| | | IPage<Map<String, Object>> mapIPage = paymentRegistrationService.selectPaymentLedgerList(paymentLedgerDto, page, detailPageNum, detailPageSize); |
| | | return success(mapIPage); |
| | | return R.ok(mapIPage); |
| | | } |
| | | |
| | | /** |
| | | * ä¾åºå徿¥å页æ¥å£ |
| | | */ |
| | | @GetMapping("/supplierNameListPage") |
| | | public AjaxResult supplierNameListPage(PaymentLedgerDto paymentLedgerDto, Page page){ |
| | | return success(paymentRegistrationService.supplierNameListPage(page,paymentLedgerDto)); |
| | | public R<?> supplierNameListPage(PaymentLedgerDto paymentLedgerDto, Page page){ |
| | | return R.ok(paymentRegistrationService.supplierNameListPage(page,paymentLedgerDto)); |
| | | } |
| | | |
| | | /** |
| | | * ä¾åºå徿¥å页æ¥å£ |
| | | */ |
| | | @GetMapping("/supplierNameListPageDetails") |
| | | public AjaxResult supplierNameListPageDetails(PaymentLedgerDto paymentLedgerDto){ |
| | | return success(paymentRegistrationService.supplierNameListPageDetails(paymentLedgerDto)); |
| | | public R<?> supplierNameListPageDetails(PaymentLedgerDto paymentLedgerDto){ |
| | | return R.ok(paymentRegistrationService.supplierNameListPageDetails(paymentLedgerDto)); |
| | | } |
| | | |
| | | /** |
| | | * è·åæ¬æåºä»ä¿¡æ¯ |
| | | */ |
| | | @GetMapping(value = "/paymentMonthList") |
| | | public AjaxResult paymentMonthList() { |
| | | return success(paymentRegistrationService.paymentMonthList()); |
| | | public R<?> paymentMonthList() { |
| | | return R.ok(paymentRegistrationService.paymentMonthList()); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/getPaymentRecordList/{supplierId}") |
| | | public AjaxResult getPaymentRecordList(@PathVariable Long supplierId) { |
| | | public R<?> getPaymentRecordList(@PathVariable Long supplierId) { |
| | | List<PaymentHistoryRecordVo> paymentRecordList = paymentRegistrationService.getPaymentRecordList(supplierId); |
| | | return success(paymentRecordList); |
| | | return R.ok(paymentRecordList); |
| | | } |
| | | |
| | | /** |
| | |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.purchase.dto.ProcurementBusinessSummaryDto; |
| | | import com.ruoyi.purchase.service.impl.ProcurementBusinessSummaryServiceImpl; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | |
| | | private ProcurementBusinessSummaryServiceImpl procurementBusinessSummaryService; |
| | | |
| | | @GetMapping("/listPage") |
| | | public AjaxResult listPage(Page page, ProcurementBusinessSummaryDto procurementBusinessSummaryDto) { |
| | | return AjaxResult.success(procurementBusinessSummaryService.listPage(page, procurementBusinessSummaryDto)); |
| | | public R<?> listPage(Page page, ProcurementBusinessSummaryDto procurementBusinessSummaryDto) { |
| | | return R.ok(procurementBusinessSummaryService.listPage(page, procurementBusinessSummaryDto)); |
| | | } |
| | | |
| | | /** |
| | |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.framework.web.page.TableDataInfo; |
| | | import com.ruoyi.purchase.dto.PurchaseLedgerDto; |
| | | import com.ruoyi.purchase.mapper.PurchaseLedgerTemplateMapper; |
| | |
| | | @Log(title = "导å
¥éè´å°è´¦", businessType = BusinessType.INSERT) |
| | | @PostMapping("/import") |
| | | @Operation(summary = "导å
¥éè´å°è´¦") |
| | | public AjaxResult importData(@RequestParam("file") |
| | | public R<?> importData(@RequestParam("file") |
| | | @ApiParam(value = "Excelæä»¶", required = true) |
| | | MultipartFile file) { |
| | | return purchaseLedgerService.importData(file); |
| | |
| | | */ |
| | | @Log(title = "éè´å°è´¦", businessType = BusinessType.INSERT) |
| | | @PostMapping("/addOrEditPurchase") |
| | | public AjaxResult addOrEditPurchase(@RequestBody PurchaseLedgerDto purchaseLedgerDto) throws Exception { |
| | | return toAjax(purchaseLedgerService.addOrEditPurchase(purchaseLedgerDto)); |
| | | public R<?> addOrEditPurchase(@RequestBody PurchaseLedgerDto purchaseLedgerDto) throws Exception { |
| | | purchaseLedgerService.addOrEditPurchase(purchaseLedgerDto); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Operation(summary = "/æ¥è¯¢éè´æ¨¡æ¿") |
| | | @GetMapping("/getPurchaseTemplateList") |
| | | public AjaxResult getPurchaseTemplateList() { |
| | | public R<?> getPurchaseTemplateList() { |
| | | List<PurchaseLedgerTemplate> purchaseLedgers = purchaseLedgerTemplateMapper.selectList(null); |
| | | purchaseLedgers.forEach(purchaseLedgerDto1 -> { |
| | | LambdaQueryWrapper<SalesLedgerProductTemplate> queryWrapper = new LambdaQueryWrapper<>(); |
| | |
| | | purchaseLedgerDto1.setProductList(list); |
| | | } |
| | | }); |
| | | return AjaxResult.success(purchaseLedgers); |
| | | return R.ok(purchaseLedgers); |
| | | } |
| | | /** |
| | | * ä¿®æ¹éè´å°è´¦å®¡æ¹ç¶æ |
| | | */ |
| | | @PostMapping("/updateApprovalStatus") |
| | | public AjaxResult addOrEditPurchase(@RequestBody PurchaseLedger purchaseLedger){ |
| | | return toAjax(purchaseLedgerService.updateById(purchaseLedger)); |
| | | public R<?> addOrEditPurchase(@RequestBody PurchaseLedger purchaseLedger){ |
| | | purchaseLedgerService.updateById(purchaseLedger); |
| | | return R.ok(); |
| | | } |
| | | /** |
| | | * æ¥è¯¢éè´å°è´¦å产åç¶åå表 |
| | |
| | | */ |
| | | @Log(title = "éè´å°è´¦", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/delPurchase") |
| | | public AjaxResult remove(@RequestBody Long[] ids) { |
| | | return toAjax(purchaseLedgerService.deletePurchaseLedgerByIds(ids)); |
| | | public R<?> remove(@RequestBody Long[] ids) { |
| | | purchaseLedgerService.deletePurchaseLedgerByIds(ids); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | |
| | | * æ ¹æ®éå®ååæ¥è¯¢äº§åä¿¡æ¯ |
| | | */ |
| | | @GetMapping("/getProductBySalesNo") |
| | | public AjaxResult getProductBySalesNo(Long id) { |
| | | return AjaxResult.success(purchaseLedgerService.getProductBySalesNo(id)); |
| | | public R<?> getProductBySalesNo(Long id) { |
| | | return R.ok(purchaseLedgerService.getProductBySalesNo(id)); |
| | | } |
| | | |
| | | /** |
| | |
| | | * æ ¹æ®idæ¥è¯¢éè´ååå· |
| | | */ |
| | | @GetMapping("/getPurchaseNoById") |
| | | public AjaxResult getPurchaseNoById(Long id) { |
| | | return AjaxResult.success(purchaseLedgerService.getPurchaseNoById(id)); |
| | | public R<?> getPurchaseNoById(Long id) { |
| | | return R.ok(purchaseLedgerService.getPurchaseNoById(id)); |
| | | } |
| | | |
| | | /** |
| | |
| | | * æ ¹æ®éè´ååå·æ¥è¯¢äº§å |
| | | */ |
| | | @GetMapping("/getInfo") |
| | | public AjaxResult getInfo(PurchaseLedgerDto purchaseLedgerDto) { |
| | | return AjaxResult.success(purchaseLedgerService.getInfo(purchaseLedgerDto)); |
| | | public R<?> getInfo(PurchaseLedgerDto purchaseLedgerDto) { |
| | | return R.ok(purchaseLedgerService.getInfo(purchaseLedgerDto)); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢éè´å°è´¦å表 |
| | | */ |
| | | @GetMapping("/listPage") |
| | | public AjaxResult listPage(Page page, PurchaseLedgerDto purchaseLedger) { |
| | | return AjaxResult.success(purchaseLedgerService.selectPurchaseLedgerListPage(page, purchaseLedger)); |
| | | public R<?> listPage(Page page, PurchaseLedgerDto purchaseLedger) { |
| | | return R.ok(purchaseLedgerService.selectPurchaseLedgerListPage(page, purchaseLedger)); |
| | | } |
| | | |
| | | @Operation(summary = "çæéè´åºåå·") |
| | | @GetMapping("/createPurchaseNo") |
| | | @Log(title = "çæéè´åºåå·", businessType = BusinessType.OTHER) |
| | | public AjaxResult createPurchaseNo() { |
| | | return AjaxResult.success("çææå",purchaseLedgerService.getPurchaseNo()); |
| | | public R<?> createPurchaseNo() { |
| | | return R.ok(purchaseLedgerService.getPurchaseNo(), "çææå"); |
| | | } |
| | | } |
| | |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.purchase.dto.PurchaseLedgerDto; |
| | | import com.ruoyi.purchase.mapper.PurchaseLedgerTemplateMapper; |
| | | import com.ruoyi.purchase.mapper.SalesLedgerProductTemplateMapper; |
| | |
| | | @RequestMapping("/purchaseLedgerTemplate") |
| | | @Tag(name = "éè´å°è´¦æ¨¡æ¿") |
| | | @AllArgsConstructor |
| | | public class PurchaseLedgerTemplateController { |
| | | public class PurchaseLedgerTemplateController extends BaseController { |
| | | |
| | | private PurchaseLedgerTemplateMapper purchaseLedgerTemplateMapper; |
| | | private SalesLedgerProductTemplateMapper salesLedgerProductTemplateMapper; |
| | |
| | | @PostMapping("/add") |
| | | @Log(title = "æ·»å éè´å°è´¦æ¨¡æ¿", businessType = BusinessType.INSERT) |
| | | @Operation(summary = "æ·»å éè´å°è´¦æ¨¡æ¿") |
| | | public AjaxResult add(@RequestBody PurchaseLedgerDto purchaseLedgerDto) { |
| | | public R<?> add(@RequestBody PurchaseLedgerDto purchaseLedgerDto) { |
| | | // éè´æ¨¡æ¿ |
| | | if(StringUtils.isNotEmpty(purchaseLedgerDto.getTemplateName())){ |
| | | // 模æ¿åç§°ä¸è½éå¤ï¼æéå¤å°±ä¸éè¦æ°å¢äº |
| | |
| | | }); |
| | | } |
| | | } |
| | | return AjaxResult.success(); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @DeleteMapping("/delete") |
| | | @Log(title = "éè´å°è´¦æ¨¡æ¿", businessType = BusinessType.DELETE) |
| | | @Operation(summary = "å é¤éè´å°è´¦æ¨¡æ¿") |
| | | public AjaxResult delete(@RequestBody List<Long> id) { |
| | | if(CollectionUtils.isEmpty(id)) return AjaxResult.error("è¯·éæ©è¦å é¤çéè´å°è´¦æ¨¡æ¿"); |
| | | public R<?> delete(@RequestBody List<Long> id) { |
| | | if(CollectionUtils.isEmpty(id)) return R.fail("è¯·éæ©è¦å é¤çéè´å°è´¦æ¨¡æ¿"); |
| | | int result = purchaseLedgerTemplateMapper.deleteBatchIds(id); |
| | | salesLedgerProductTemplateMapper.delete(new LambdaQueryWrapper<SalesLedgerProductTemplate>() |
| | | .in(SalesLedgerProductTemplate::getSalesLedgerId, id)); |
| | | return AjaxResult.success(result); |
| | | return R.ok(result); |
| | | } |
| | | |
| | | @PostMapping("/update") |
| | | @Log(title = "ä¿®æ¹éè´å°è´¦æ¨¡æ¿", businessType = BusinessType.UPDATE) |
| | | @Operation(summary = "ä¿®æ¹éè´å°è´¦æ¨¡æ¿") |
| | | public AjaxResult update(@RequestBody PurchaseLedgerDto purchaseLedgerDto) { |
| | | public R<?> update(@RequestBody PurchaseLedgerDto purchaseLedgerDto) { |
| | | // 模æ¿åç§°ä¸è½éå¤ï¼æéå¤å°±ä¸éè¦æ°å¢äº |
| | | PurchaseLedgerTemplate purchaseLedgerTemplate = purchaseLedgerTemplateMapper |
| | | .selectOne(new LambdaQueryWrapper<PurchaseLedgerTemplate>() |
| | |
| | | salesLedgerProductTemplateMapper.insert(salesLedgerProductTemplate); |
| | | }); |
| | | } |
| | | return AjaxResult.success(); |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.ruoyi.common.utils.OrderUtils; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.purchase.dto.PurchaseReturnOrderDto; |
| | | import com.ruoyi.purchase.mapper.PurchaseReturnOrdersMapper; |
| | | import com.ruoyi.purchase.service.PurchaseReturnOrdersService; |
| | |
| | | @RequestMapping("/purchaseReturnOrders") |
| | | @Tag(name = "éè´éè´§å") |
| | | @AllArgsConstructor |
| | | public class PurchaseReturnOrdersController { |
| | | public class PurchaseReturnOrdersController extends BaseController { |
| | | private PurchaseReturnOrdersService purchaseReturnOrdersService; |
| | | private PurchaseReturnOrdersMapper purchaseReturnOrdersMapper; |
| | | |
| | | |
| | | @GetMapping("/listPage") |
| | | public AjaxResult listPage(Page page, PurchaseReturnOrderDto purchaseReturnOrderDto) { |
| | | return AjaxResult.success(purchaseReturnOrdersService.listPage(page, purchaseReturnOrderDto)); |
| | | public R<?> listPage(Page page, PurchaseReturnOrderDto purchaseReturnOrderDto) { |
| | | return R.ok(purchaseReturnOrdersService.listPage(page, purchaseReturnOrderDto)); |
| | | } |
| | | |
| | | // æ°å¢ |
| | | @Log(title = "éè´éè´§å", businessType = BusinessType.INSERT) |
| | | @PostMapping("/add") |
| | | public AjaxResult add(@RequestBody PurchaseReturnOrderDto purchaseReturnOrderDto) throws Exception { |
| | | public R<?> add(@RequestBody PurchaseReturnOrderDto purchaseReturnOrderDto) throws Exception { |
| | | if (purchaseReturnOrderDto.getIsDefaultNo()) { |
| | | purchaseReturnOrderDto.setNo(OrderUtils.countTodayByCreateTime(purchaseReturnOrdersMapper, "CGTL", "no")); |
| | | } |
| | | return AjaxResult.success(purchaseReturnOrdersService.add(purchaseReturnOrderDto)); |
| | | return R.ok(purchaseReturnOrdersService.add(purchaseReturnOrderDto)); |
| | | } |
| | | |
| | | |
| | | @GetMapping("/selectById/{id}") |
| | | public AjaxResult selectById(@PathVariable Long id) { |
| | | return AjaxResult.success(purchaseReturnOrdersService.getPurchaseReturnOrderDtoById(id)); |
| | | public R<?> selectById(@PathVariable Long id) { |
| | | return R.ok(purchaseReturnOrdersService.getPurchaseReturnOrderDtoById(id)); |
| | | } |
| | | |
| | | @PostMapping("/deleteById/{id}") |
| | | public AjaxResult deleteById(@PathVariable Long id) { |
| | | public R<?> deleteById(@PathVariable Long id) { |
| | | purchaseReturnOrdersService.deleteById(id); |
| | | return AjaxResult.success(); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @GetMapping("/getByPurchaseLedgerId") |
| | | @Operation(summary = "éè´éè´§-æ ¹æ®éè´è®¢åidæ¥è¯¢éè´è®¢å对åºçå
¥åºäº§åä¿¡æ¯") |
| | | public AjaxResult getByPurchaseLedgerId(Long purchaseLedgerId) { |
| | | public R<?> getByPurchaseLedgerId(Long purchaseLedgerId) { |
| | | List<PurchaseStockInProductVo> purchaseStockInProductVos = purchaseReturnOrdersService.getByPurchaseLedgerId(purchaseLedgerId); |
| | | return AjaxResult.success(purchaseStockInProductVos); |
| | | return R.ok(purchaseStockInProductVos); |
| | | } |
| | | |
| | | |
| | |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.framework.web.page.TableDataInfo; |
| | | import com.ruoyi.purchase.dto.PaymentRegistrationDto; |
| | | import com.ruoyi.purchase.dto.ProductRecordDto; |
| | |
| | | |
| | | @Operation(summary = "æ ¹æ®idæ¥è¯¢ä»æ¬¾æµæ°´") |
| | | @GetMapping("/getPaymentRegistrationById") |
| | | public AjaxResult getPaymentRegistrationById(Long id) { |
| | | public R<?> getPaymentRegistrationById(Long id) { |
| | | PaymentRegistration byId = paymentRegistrationService.getById(id); |
| | | return AjaxResult.success(byId); |
| | | return R.ok(byId); |
| | | } |
| | | |
| | | @Operation(summary = "ä¿®æ¹ä»æ¬¾æµæ°´") |
| | | @PutMapping("/updatePaymentRegistration") |
| | | @Log(title = "ä¿®æ¹ä»æ¬¾æµæ°´", businessType = BusinessType.UPDATE) |
| | | public AjaxResult updatePaymentRegistration(@RequestBody PaymentRegistration paymentRegistratio) { |
| | | return AjaxResult.success(paymentRegistrationService.updatePaymentRegistration(paymentRegistratio)); |
| | | public R<?> updatePaymentRegistration(@RequestBody PaymentRegistration paymentRegistratio) { |
| | | return R.ok(paymentRegistrationService.updatePaymentRegistration(paymentRegistratio)); |
| | | } |
| | | |
| | | @Operation(summary = "å é¤ä»æ¬¾æµæ°´") |
| | | @DeleteMapping("/delPaymentRegistration") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult delPaymentRegistration(@RequestBody List<Long> id) { |
| | | return toAjax(paymentRegistrationService.delPaymentRegistration(id)); |
| | | public R<?> delPaymentRegistration(@RequestBody List<Long> id) { |
| | | paymentRegistrationService.delPaymentRegistration(id); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | |
| | | @Log(title = "æ¥ç¥¨ç»è®°", businessType = BusinessType.INSERT) |
| | | @PostMapping("/addOrUpdateRegistration") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult addOrUpdateRegistration(@RequestBody List<TicketRegistrationDto> ticketRegistrationDto) throws IOException { |
| | | if(CollectionUtils.isEmpty(ticketRegistrationDto)) return AjaxResult.error("è¯·éæ©è¦ä¿åçè®°å½"); |
| | | public R<?> addOrUpdateRegistration(@RequestBody List<TicketRegistrationDto> ticketRegistrationDto) throws IOException { |
| | | if(CollectionUtils.isEmpty(ticketRegistrationDto)) return R.fail("è¯·éæ©è¦ä¿åçè®°å½"); |
| | | for (TicketRegistrationDto ticketRegistrationDto1 : ticketRegistrationDto) { |
| | | ticketRegistrationService.addOrUpdateRegistration(ticketRegistrationDto1); |
| | | } |
| | | return toAjax(1); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | @PostMapping("/getProductRecordById") |
| | | public AjaxResult getProductRecordById(@RequestBody ProductRecordDto productRecordDto) { |
| | | public R<?> getProductRecordById(@RequestBody ProductRecordDto productRecordDto) { |
| | | if (productRecordDto.getId() == null) { |
| | | return AjaxResult.error("åæ°é误"); |
| | | return R.fail("åæ°é误"); |
| | | } |
| | | return AjaxResult.success(productRecordService.getProductRecordById(productRecordDto)); |
| | | return R.ok(productRecordService.getProductRecordById(productRecordDto)); |
| | | } |
| | | |
| | | @Schema(description = "ä¿®æ¹æ¥ç¥¨ç»è®°") |
| | | @PostMapping("/updateRegistration") |
| | | public AjaxResult updateRegistration(@RequestBody ProductRecordDto productRecordDto) { |
| | | public R<?> updateRegistration(@RequestBody ProductRecordDto productRecordDto) { |
| | | |
| | | return productRecordService.updateRecord(productRecordDto); |
| | | } |
| | |
| | | @Log(title = "å 餿¥ç¥¨ç»è®°(æ¥ç¥¨å°è´¦)", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/delRegistration") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult delRegistration(@RequestBody Long[] ids) { |
| | | return toAjax(ticketRegistrationService.delRegistration(ids)); |
| | | public R<?> delRegistration(@RequestBody Long[] ids) { |
| | | ticketRegistrationService.delRegistration(ids); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | |
| | | * å页æ¥è¯¢äº§åä¿¡æ¯å¼ç¥¨è®°å½å表 |
| | | */ |
| | | @GetMapping("/productRecordPage") |
| | | public AjaxResult productRecordPage(Page page, TicketRegistrationDto ticketRegistrationDto) { |
| | | public R<?> productRecordPage(Page page, TicketRegistrationDto ticketRegistrationDto) { |
| | | |
| | | IPage<ProductRecordDto> list = productRecordService.productRecordPage(page,ticketRegistrationDto); |
| | | return AjaxResult.success(list); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢åç¥¨å· |
| | | */ |
| | | @GetMapping("/getTicketNo") |
| | | public AjaxResult getTicketNo(TicketRegistrationDto ticketRegistrationDto) { |
| | | return AjaxResult.success(ticketRegistrationService.getTicketNo(ticketRegistrationDto)); |
| | | public R<?> getTicketNo(TicketRegistrationDto ticketRegistrationDto) { |
| | | return R.ok(ticketRegistrationService.getTicketNo(ticketRegistrationDto)); |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | @Schema(description = "æ ¹æ®idæ¥è¯¢æ¥æ¼ç»è®°") |
| | | @GetMapping("/getPuargeById") |
| | | public AjaxResult getPuargeById(Long id) { |
| | | return AjaxResult.success(ticketRegistrationService.getPuargeById( id)); |
| | | public R<?> getPuargeById(Long id) { |
| | | return R.ok(ticketRegistrationService.getPuargeById( id)); |
| | | } |
| | | |
| | | |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.purchase.dto.ProductRecordDto; |
| | | import com.ruoyi.purchase.dto.TicketRegistrationDto; |
| | | import com.ruoyi.purchase.pojo.ProductRecord; |
| | |
| | | |
| | | IPage<ProductRecordDto> productRecordPage(Page page, TicketRegistrationDto ticketRegistrationDto); |
| | | |
| | | AjaxResult updateRecord(ProductRecordDto productRecordDto); |
| | | R<?> updateRecord(ProductRecordDto productRecordDto); |
| | | |
| | | ProductRecordDto getProductRecordById(ProductRecordDto productRecordDto); |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.purchase.dto.PurchaseLedgerDto; |
| | | import com.ruoyi.purchase.pojo.PurchaseLedger; |
| | | import com.ruoyi.sales.pojo.InvoiceRegistrationProduct; |
| | |
| | | |
| | | String getPurchaseNo(); |
| | | |
| | | AjaxResult importData(MultipartFile file); |
| | | R<?> importData(MultipartFile file); |
| | | |
| | | PurchaseLedgerDto getPurchaseByCode(PurchaseLedgerDto purchaseLedgerDto); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.enums.FileNameType; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.purchase.dto.ProductRecordDto; |
| | | import com.ruoyi.purchase.dto.TicketRegistrationDto; |
| | | import com.ruoyi.purchase.mapper.ProductRecordMapper; |
| | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult updateRecord(ProductRecordDto productRecordDto) { |
| | | public R<?> updateRecord(ProductRecordDto productRecordDto) { |
| | | ProductRecord productRecord = productRecordMapper.selectById(productRecordDto.getId()); |
| | | if (productRecord == null) return AjaxResult.error("è®°å½ä¸åå¨"); |
| | | if (productRecord == null) return R.fail("è®°å½ä¸åå¨"); |
| | | |
| | | // æ´æ°äº§åå°è´¦ |
| | | SalesLedgerProduct salesLedgerProduct = salesLedgerProductMapper.selectById(productRecord.getSaleLedgerProjectId()); |
| | |
| | | productRecord.setFutureTicketsAmount(productRecord.getFutureTickets().multiply(productRecord.getTaxInclusiveUnitPrice())); |
| | | productRecordMapper.updateById(productRecord); |
| | | |
| | | return AjaxResult.success("ä¿®æ¹æå"); |
| | | return R.ok(null, "ä¿®æ¹æå"); |
| | | } |
| | | |
| | | @Override |
| | |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.framework.security.LoginUser; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.other.mapper.TempFileMapper; |
| | | import com.ruoyi.procurementrecord.mapper.ProcurementRecordMapper; |
| | | import com.ruoyi.procurementrecord.pojo.ProcurementRecordStorage; |
| | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult importData(MultipartFile file) { |
| | | public R<?> importData(MultipartFile file) { |
| | | LoginUser loginUser = SecurityUtils.getLoginUser(); |
| | | try { |
| | | InputStream inputStream = file.getInputStream(); |
| | | ExcelUtil<PurchaseLedgerImportDto> salesLedgerImportDtoExcelUtil = new ExcelUtil<>(PurchaseLedgerImportDto.class); |
| | | Map<String, List<PurchaseLedgerImportDto>> stringListMap = salesLedgerImportDtoExcelUtil.importExcelMultiSheet(Arrays.asList("éè´å°è´¦æ°æ®", "éè´äº§åæ°æ®"), inputStream, 0); |
| | | if (CollectionUtils.isEmpty(stringListMap)) return AjaxResult.error("éè´è¡¨æ ¼ä¸ºç©ºï¼"); |
| | | if (CollectionUtils.isEmpty(stringListMap)) return R.fail("éè´è¡¨æ ¼ä¸ºç©ºï¼"); |
| | | // ä¸å¡å±åå¹¶ |
| | | List<PurchaseLedgerImportDto> salesLedgerImportDtoList = stringListMap.get("éè´å°è´¦æ°æ®"); |
| | | if (CollectionUtils.isEmpty(salesLedgerImportDtoList)) return AjaxResult.error("éè´å°è´¦æ°æ®ä¸ºç©ºï¼"); |
| | | if (CollectionUtils.isEmpty(salesLedgerImportDtoList)) return R.fail("éè´å°è´¦æ°æ®ä¸ºç©ºï¼"); |
| | | List<PurchaseLedgerImportDto> salesLedgerProductImportDtoList = stringListMap.get("éè´äº§åæ°æ®"); |
| | | if (CollectionUtils.isEmpty(salesLedgerProductImportDtoList)) return AjaxResult.error("éè´äº§åæ°æ®ä¸ºç©ºï¼"); |
| | | if (CollectionUtils.isEmpty(salesLedgerProductImportDtoList)) return R.fail("éè´äº§åæ°æ®ä¸ºç©ºï¼"); |
| | | // ä¾åºåæ°æ® |
| | | List<SupplierManage> customers = supplierManageMapper.selectList(new LambdaQueryWrapper<SupplierManage>().in(SupplierManage::getSupplierName, |
| | | salesLedgerImportDtoList.stream().map(PurchaseLedgerImportDto::getSupplierName).collect(Collectors.toList()))); |
| | |
| | | addApproveByPurchase(loginUser,salesLedger); |
| | | } |
| | | |
| | | return AjaxResult.success("导å
¥æå"); |
| | | return R.ok(null, "导å
¥æå"); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return AjaxResult.success("导å
¥å¤±è´¥"); |
| | | return R.ok(null, "导å
¥å¤±è´¥"); |
| | | } |
| | | |
| | | @Override |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.quality.dto.QualityInspectDto; |
| | | import com.ruoyi.quality.pojo.QualityInspect; |
| | | import com.ruoyi.quality.pojo.QualityInspectFile; |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping("/add") |
| | | public AjaxResult add(@RequestBody QualityInspectDto qualityInspectDto) { |
| | | return AjaxResult.success(qualityInspectService.add(qualityInspectDto)); |
| | | public R<?> add(@RequestBody QualityInspectDto qualityInspectDto) { |
| | | return R.ok(qualityInspectService.add(qualityInspectDto)); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/del") |
| | | public AjaxResult delQualityInspect(@RequestBody List<Integer> ids) { |
| | | public R<?> delQualityInspect(@RequestBody List<Integer> ids) { |
| | | if (CollectionUtils.isEmpty(ids)) { |
| | | return AjaxResult.error("è¯·éæ©è³å°ä¸æ¡æ°æ®"); |
| | | return R.fail("è¯·éæ©è³å°ä¸æ¡æ°æ®"); |
| | | } |
| | | //å¦æå·²ç»æäº¤å°±ä¸å
许å é¤ |
| | | List<QualityInspect> qualityInspects = qualityInspectService.listByIds(ids); |
| | |
| | | qualityInspectFileService.remove(Wrappers.<QualityInspectFile>lambdaQuery() |
| | | .in(QualityInspectFile::getInspectId, ids)); |
| | | //å 餿£éªå |
| | | return AjaxResult.success(qualityInspectService.removeBatchByIds(ids)); |
| | | return R.ok(qualityInspectService.removeBatchByIds(ids)); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/{id}") |
| | | public AjaxResult QualityInspectDetail(@PathVariable("id") Integer id) { |
| | | return AjaxResult.success(qualityInspectService.getDetailById(id)); |
| | | public R<?> QualityInspectDetail(@PathVariable("id") Integer id) { |
| | | return R.ok(qualityInspectService.getDetailById(id)); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping("/update") |
| | | public AjaxResult update(@RequestBody QualityInspectDto qualityInspectDto) { |
| | | return AjaxResult.success(qualityInspectService.updateQualityInspect(qualityInspectDto)); |
| | | public R<?> update(@RequestBody QualityInspectDto qualityInspectDto) { |
| | | return R.ok(qualityInspectService.updateQualityInspect(qualityInspectDto)); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/listPage") |
| | | public AjaxResult qualityInspectListPage(Page page, QualityInspectDto qualityInspect) { |
| | | return AjaxResult.success(qualityInspectService.qualityInspectListPage(page, qualityInspect)); |
| | | public R<?> qualityInspectListPage(Page page, QualityInspectDto qualityInspect) { |
| | | return R.ok(qualityInspectService.qualityInspectListPage(page, qualityInspect)); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping("/submit") |
| | | public AjaxResult submit(@RequestBody QualityInspect qualityInspect) { |
| | | return AjaxResult.success(qualityInspectService.submit(qualityInspect)); |
| | | public R<?> submit(@RequestBody QualityInspect qualityInspect) { |
| | | return R.ok(qualityInspectService.submit(qualityInspect)); |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.quality.pojo.QualityInspect; |
| | | import com.ruoyi.quality.pojo.QualityInspectFile; |
| | | import com.ruoyi.quality.pojo.QualityInspectParam; |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping("/add") |
| | | public AjaxResult add(@RequestBody QualityInspectFile qualityInspectFile) { |
| | | return AjaxResult.success(qualityInspectFileService.save(qualityInspectFile)); |
| | | public R<?> add(@RequestBody QualityInspectFile qualityInspectFile) { |
| | | return R.ok(qualityInspectFileService.save(qualityInspectFile)); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/del") |
| | | public AjaxResult delQualityUnqualified(@RequestBody List<Integer> ids) { |
| | | public R<?> delQualityUnqualified(@RequestBody List<Integer> ids) { |
| | | if(CollectionUtils.isEmpty(ids)){ |
| | | return AjaxResult.error("è¯·éæ©è³å°ä¸æ¡æ°æ®"); |
| | | return R.fail("è¯·éæ©è³å°ä¸æ¡æ°æ®"); |
| | | } |
| | | //å 餿£éªéä»¶ |
| | | return AjaxResult.success(qualityInspectFileService.removeBatchByIds(ids)); |
| | | return R.ok(qualityInspectFileService.removeBatchByIds(ids)); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/listPage") |
| | | public AjaxResult qualityInspectFileListPage(Page page, QualityInspectFile qualityInspectFile) { |
| | | return AjaxResult.success(qualityInspectFileService.qualityInspectFileListPage(page, qualityInspectFile)); |
| | | public R<?> qualityInspectFileListPage(Page page, QualityInspectFile qualityInspectFile) { |
| | | return R.ok(qualityInspectFileService.qualityInspectFileListPage(page, qualityInspectFile)); |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.quality.pojo.QualityInspect; |
| | | import com.ruoyi.quality.pojo.QualityInspectFile; |
| | | import com.ruoyi.quality.pojo.QualityInspectParam; |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/{inspectId}") |
| | | public AjaxResult QualityInspectParamDetail(@PathVariable("inspectId") Integer inspectId) { |
| | | return AjaxResult.success(qualityInspectParamService.qualityInspectParamDetail(inspectId)); |
| | | public R<?> QualityInspectParamDetail(@PathVariable("inspectId") Integer inspectId) { |
| | | return R.ok(qualityInspectParamService.qualityInspectParamDetail(inspectId)); |
| | | } |
| | | |
| | | |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping("/update") |
| | | public AjaxResult update(@RequestBody List<QualityInspectParam> qualityInspectParams) { |
| | | return AjaxResult.success(qualityInspectParamService.updateBatchById(qualityInspectParams)); |
| | | public R<?> update(@RequestBody List<QualityInspectParam> qualityInspectParams) { |
| | | return R.ok(qualityInspectParamService.updateBatchById(qualityInspectParams)); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/del") |
| | | public AjaxResult delQualityUnqualified(@RequestBody List<Integer> ids) { |
| | | public R<?> delQualityUnqualified(@RequestBody List<Integer> ids) { |
| | | if(CollectionUtils.isEmpty(ids)){ |
| | | return AjaxResult.error("è¯·éæ©è³å°ä¸æ¡æ°æ®"); |
| | | return R.fail("è¯·éæ©è³å°ä¸æ¡æ°æ®"); |
| | | } |
| | | return AjaxResult.success(qualityInspectParamService.removeBatchByIds(ids)); |
| | | return R.ok(qualityInspectParamService.removeBatchByIds(ids)); |
| | | } |
| | | |
| | | |
| | |
| | | package com.ruoyi.quality.controller; |
| | | |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.quality.service.QualityReportService; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | |
| | | */ |
| | | @Operation(summary = "è·åæ£éªç»è®¡æ°æ®") |
| | | @GetMapping("/getInspectStatistics") |
| | | public AjaxResult getInspectStatistics() { |
| | | return AjaxResult.success(qualityReportService.getInspectStatistics()); |
| | | public R<?> getInspectStatistics() { |
| | | return R.ok(qualityReportService.getInspectStatistics()); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Operation(summary = "è·ååæ ¼çç»è®¡æ°æ®") |
| | | @GetMapping("/getPassRateStatistics") |
| | | public AjaxResult getPassRateStatistics() { |
| | | return AjaxResult.success(qualityReportService.getPassRateStatistics()); |
| | | public R<?> getPassRateStatistics() { |
| | | return R.ok(qualityReportService.getPassRateStatistics()); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Operation(summary = "è·åæåº¦åæ ¼çç»è®¡æ°æ®") |
| | | @GetMapping("/getMonthlyPassRateStatistics") |
| | | public AjaxResult getMonthlyPassRateStatistics(@RequestParam("year") String year) { |
| | | return AjaxResult.success(qualityReportService.getMonthlyPassRateStatistics(year)); |
| | | public R<?> getMonthlyPassRateStatistics(@RequestParam("year") String year) { |
| | | return R.ok(qualityReportService.getMonthlyPassRateStatistics(year)); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Operation(summary = "è·å年度æ»åæ ¼çç»è®¡æ°æ®") |
| | | @GetMapping("/getYearlyPassRateStatistics") |
| | | public AjaxResult getYearlyPassRateStatistics(@RequestParam("year") String year) { |
| | | return AjaxResult.success(qualityReportService.getYearlyPassRateStatistics(year)); |
| | | public R<?> getYearlyPassRateStatistics(@RequestParam("year") String year) { |
| | | return R.ok(qualityReportService.getYearlyPassRateStatistics(year)); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Operation(summary = "è·åæåº¦å®ææç»æ°æ®") |
| | | @GetMapping("/getMonthlyCompletionDetails") |
| | | public AjaxResult getMonthlyCompletionDetails(@RequestParam("year") String year) { |
| | | return AjaxResult.success(qualityReportService.getMonthlyCompletionDetails(year)); |
| | | public R<?> getMonthlyCompletionDetails(@RequestParam("year") String year) { |
| | | return R.ok(qualityReportService.getMonthlyCompletionDetails(year)); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Operation(summary = "è·åçç¹æ£æµææ ç»è®¡") |
| | | @GetMapping("/getTopParameters") |
| | | public AjaxResult getTopParameters(@RequestParam("modelType") Integer modelType) { |
| | | return AjaxResult.success(qualityReportService.getTopParameters(modelType)); |
| | | public R<?> getTopParameters(@RequestParam("modelType") Integer modelType) { |
| | | return R.ok(qualityReportService.getTopParameters(modelType)); |
| | | } |
| | | |
| | | } |
| | |
| | | package com.ruoyi.quality.controller; |
| | | |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.quality.pojo.QualityTestStandardBinding; |
| | | import com.ruoyi.quality.service.QualityTestStandardBindingService; |
| | | import lombok.AllArgsConstructor; |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping("/add") |
| | | public AjaxResult add(@RequestBody List<QualityTestStandardBinding> qualityTestStandardBindings) { |
| | | return AjaxResult.success(qualityTestStandardBindingService.add(qualityTestStandardBindings)); |
| | | public R<?> add(@RequestBody List<QualityTestStandardBinding> qualityTestStandardBindings) { |
| | | return R.ok(qualityTestStandardBindingService.add(qualityTestStandardBindings)); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/del") |
| | | public AjaxResult delQualityTestStandard(@RequestBody List<Integer> ids) { |
| | | public R<?> delQualityTestStandard(@RequestBody List<Integer> ids) { |
| | | if (CollectionUtils.isEmpty(ids)) { |
| | | return AjaxResult.error("è¯·éæ©è³å°ä¸æ¡æ°æ®"); |
| | | return R.fail("è¯·éæ©è³å°ä¸æ¡æ°æ®"); |
| | | } |
| | | return AjaxResult.success(qualityTestStandardBindingService.removeBatchByIds(ids)); |
| | | return R.ok(qualityTestStandardBindingService.removeBatchByIds(ids)); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/list") |
| | | public AjaxResult listBinding(Long testStandardId) { |
| | | return AjaxResult.success(qualityTestStandardBindingService.listBinding(testStandardId)); |
| | | public R<?> listBinding(Long testStandardId) { |
| | | return R.ok(qualityTestStandardBindingService.listBinding(testStandardId)); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.quality.pojo.QualityTestStandard; |
| | | import com.ruoyi.quality.pojo.QualityTestStandardParam; |
| | | import com.ruoyi.quality.service.IQualityTestStandardService; |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping("/add") |
| | | public AjaxResult add(@RequestBody QualityTestStandard qualityTestStandard) { |
| | | return AjaxResult.success(qualityTestStandardService.save(qualityTestStandard)); |
| | | public R<?> add(@RequestBody QualityTestStandard qualityTestStandard) { |
| | | return R.ok(qualityTestStandardService.save(qualityTestStandard)); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/del") |
| | | public AjaxResult delQualityTestStandard(@RequestBody List<Integer> ids) { |
| | | public R<?> delQualityTestStandard(@RequestBody List<Integer> ids) { |
| | | if(CollectionUtils.isEmpty(ids)){ |
| | | return AjaxResult.error("è¯·éæ©è³å°ä¸æ¡æ°æ®"); |
| | | return R.fail("è¯·éæ©è³å°ä¸æ¡æ°æ®"); |
| | | } |
| | | return AjaxResult.success(qualityTestStandardService.delQualityTestStandard(ids)); |
| | | return R.ok(qualityTestStandardService.delQualityTestStandard(ids)); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping("/update") |
| | | public AjaxResult update(@RequestBody QualityTestStandard qualityTestStandard) { |
| | | return AjaxResult.success(qualityTestStandardService.updateById(qualityTestStandard)); |
| | | public R<?> update(@RequestBody QualityTestStandard qualityTestStandard) { |
| | | return R.ok(qualityTestStandardService.updateById(qualityTestStandard)); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/listPage") |
| | | public AjaxResult qualityTestStandardListPage(Page page, QualityTestStandard qualityTestStandard) { |
| | | return AjaxResult.success(qualityTestStandardService.qualityTestStandardListPage(page, qualityTestStandard)); |
| | | public R<?> qualityTestStandardListPage(Page page, QualityTestStandard qualityTestStandard) { |
| | | return R.ok(qualityTestStandardService.qualityTestStandardListPage(page, qualityTestStandard)); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping("/copyParam") |
| | | public AjaxResult copyParam(@RequestBody QualityTestStandard qualityTestStandard) { |
| | | return AjaxResult.success(qualityTestStandardService.copyParam(qualityTestStandard)); |
| | | public R<?> copyParam(@RequestBody QualityTestStandard qualityTestStandard) { |
| | | return R.ok(qualityTestStandardService.copyParam(qualityTestStandard)); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping("/qualityTestStandardAudit") |
| | | public AjaxResult qualityTestStandardAudit(@RequestBody List<QualityTestStandard> qualityTestStandards) { |
| | | return AjaxResult.success(qualityTestStandardService.updateBatchById(qualityTestStandards)); |
| | | public R<?> qualityTestStandardAudit(@RequestBody List<QualityTestStandard> qualityTestStandards) { |
| | | return R.ok(qualityTestStandardService.updateBatchById(qualityTestStandards)); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/getQualityTestStandardByProductId") |
| | | public AjaxResult getQualityTestStandardByProductId(@Nonnull Long productId, @Nonnull Integer inspectType, String process) { |
| | | return AjaxResult.success(qualityTestStandardService.getQualityTestStandardByProductId(productId,inspectType,process)); |
| | | public R<?> getQualityTestStandardByProductId(@Nonnull Long productId, @Nonnull Integer inspectType, String process) { |
| | | return R.ok(qualityTestStandardService.getQualityTestStandardByProductId(productId,inspectType,process)); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/getQualityTestStandardParamByTestStandardId") |
| | | public AjaxResult getQualityTestStandardParamByTestStandardId(Long testStandardId) { |
| | | return AjaxResult.success(qualityTestStandardParamService.list(Wrappers.<QualityTestStandardParam>lambdaQuery().eq(QualityTestStandardParam::getTestStandardId, testStandardId))); |
| | | public R<?> getQualityTestStandardParamByTestStandardId(Long testStandardId) { |
| | | return R.ok(qualityTestStandardParamService.list(Wrappers.<QualityTestStandardParam>lambdaQuery().eq(QualityTestStandardParam::getTestStandardId, testStandardId))); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.quality.pojo.QualityTestStandard; |
| | | import com.ruoyi.quality.pojo.QualityTestStandardParam; |
| | | import com.ruoyi.quality.service.QualityTestStandardParamService; |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping("/add") |
| | | public AjaxResult add(@RequestBody QualityTestStandardParam qualityTestStandardParam) { |
| | | return AjaxResult.success(qualityTestStandardParamService.save(qualityTestStandardParam)); |
| | | public R<?> add(@RequestBody QualityTestStandardParam qualityTestStandardParam) { |
| | | return R.ok(qualityTestStandardParamService.save(qualityTestStandardParam)); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/del") |
| | | public AjaxResult delQualityTestStandard(@RequestBody List<Integer> ids) { |
| | | public R<?> delQualityTestStandard(@RequestBody List<Integer> ids) { |
| | | if(CollectionUtils.isEmpty(ids)){ |
| | | return AjaxResult.error("è¯·éæ©è³å°ä¸æ¡æ°æ®"); |
| | | return R.fail("è¯·éæ©è³å°ä¸æ¡æ°æ®"); |
| | | } |
| | | return AjaxResult.success(qualityTestStandardParamService.removeBatchByIds(ids)); |
| | | return R.ok(qualityTestStandardParamService.removeBatchByIds(ids)); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping("/update") |
| | | public AjaxResult update(@RequestBody QualityTestStandardParam qualityTestStandardParam) { |
| | | return AjaxResult.success(qualityTestStandardParamService.updateById(qualityTestStandardParam)); |
| | | public R<?> update(@RequestBody QualityTestStandardParam qualityTestStandardParam) { |
| | | return R.ok(qualityTestStandardParamService.updateById(qualityTestStandardParam)); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/list") |
| | | public AjaxResult list(Long testStandardId) { |
| | | return AjaxResult.success(qualityTestStandardParamService.list(Wrappers.<QualityTestStandardParam>lambdaQuery().eq(QualityTestStandardParam::getTestStandardId,testStandardId))); |
| | | public R<?> list(Long testStandardId) { |
| | | return R.ok(qualityTestStandardParamService.list(Wrappers.<QualityTestStandardParam>lambdaQuery().eq(QualityTestStandardParam::getTestStandardId,testStandardId))); |
| | | } |
| | | |
| | | } |
| | |
| | | package com.ruoyi.quality.controller; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.quality.pojo.QualityUnqualified; |
| | | import com.ruoyi.quality.service.IQualityUnqualifiedService; |
| | | import org.springframework.util.CollectionUtils; |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping("/add") |
| | | public AjaxResult add(@RequestBody QualityUnqualified qualityUnqualified) { |
| | | public R<?> add(@RequestBody QualityUnqualified qualityUnqualified) { |
| | | qualityUnqualified.setInspectState(0); |
| | | return AjaxResult.success(qualityUnqualifiedService.save(qualityUnqualified)); |
| | | return R.ok(qualityUnqualifiedService.save(qualityUnqualified)); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/del") |
| | | public AjaxResult delQualityUnqualified(@RequestBody List<Integer> ids) { |
| | | public R<?> delQualityUnqualified(@RequestBody List<Integer> ids) { |
| | | qualityUnqualifiedService.listByIds(ids).stream().forEach(qualityUnqualified -> { |
| | | if (qualityUnqualified.getInspectState()==1){ |
| | | throw new RuntimeException("该ä¸åæ ¼æ°æ®å·²ç»å¤çæ æ³å é¤!"); |
| | | } |
| | | }); |
| | | return AjaxResult.success(qualityUnqualifiedService.removeBatchByIds(ids)); |
| | | return R.ok(qualityUnqualifiedService.removeBatchByIds(ids)); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/{id}") |
| | | public AjaxResult QualityUnqualifiedDetail(@PathVariable("id") Integer id) { |
| | | return AjaxResult.success(qualityUnqualifiedService.getUnqualified(id)); |
| | | public R<?> QualityUnqualifiedDetail(@PathVariable("id") Integer id) { |
| | | return R.ok(qualityUnqualifiedService.getUnqualified(id)); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping("/update") |
| | | public AjaxResult update(@RequestBody QualityUnqualified qualityUnqualified) { |
| | | return AjaxResult.success(qualityUnqualifiedService.updateById(qualityUnqualified)); |
| | | public R<?> update(@RequestBody QualityUnqualified qualityUnqualified) { |
| | | return R.ok(qualityUnqualifiedService.updateById(qualityUnqualified)); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/listPage") |
| | | public AjaxResult qualityUnqualifiedListPage(Page page, QualityUnqualified qualityUnqualified) { |
| | | return AjaxResult.success(qualityUnqualifiedService.qualityUnqualifiedListPage(page, qualityUnqualified)); |
| | | public R<?> qualityUnqualifiedListPage(Page page, QualityUnqualified qualityUnqualified) { |
| | | return R.ok(qualityUnqualifiedService.qualityUnqualifiedListPage(page, qualityUnqualified)); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping("/deal") |
| | | public AjaxResult deal(@RequestBody QualityUnqualified qualityUnqualified) { |
| | | return AjaxResult.success(qualityUnqualifiedService.deal(qualityUnqualified)); |
| | | public R<?> deal(@RequestBody QualityUnqualified qualityUnqualified) { |
| | | return R.ok(qualityUnqualifiedService.deal(qualityUnqualified)); |
| | | } |
| | | |
| | | |
| | |
| | | String text = inspectParams.stream().map(QualityInspectParam::getParameterItem).collect(Collectors.joining(",")); |
| | | qualityUnqualified.setDefectivePhenomena(text + "è¿äºææ ä¸åå¨ä¸åæ ¼");//ä¸åæ ¼ç°è±¡ |
| | | qualityUnqualified.setInspectId(qualityInspect.getId()); |
| | | qualityUnqualified.setId(null); |
| | | qualityUnqualifiedMapper.insert(qualityUnqualified); |
| | | } |
| | | |
| | |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.sales.service.ICommonFileService; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | |
| | | */ |
| | | @Log(title = "éä»¶å é¤", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/delCommonFile") |
| | | public AjaxResult delCommonFile(@RequestBody Long[] ids) { |
| | | public R<?> delCommonFile(@RequestBody Long[] ids) { |
| | | if (ids == null || ids.length == 0) { |
| | | return AjaxResult.error("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | return R.fail("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | } |
| | | return toAjax(commonFileService.delCommonFileByIds(ids)); |
| | | commonFileService.delCommonFileByIds(ids); |
| | | return R.ok(); |
| | | } |
| | | |
| | | public void migrateTempFilesToFormal(Long businessId, List<String> tempFileIds) throws IOException{ |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.sales.dto.InvoiceLedgerDto; |
| | | import com.ruoyi.sales.dto.InvoiceRegistrationProductDto; |
| | | import com.ruoyi.sales.mapper.InvoiceLedgerFileMapper; |
| | |
| | | @RestController |
| | | @RequestMapping("/invoiceLedger") |
| | | @AllArgsConstructor |
| | | public class InvoiceLedgerController { |
| | | public class InvoiceLedgerController extends BaseController { |
| | | |
| | | private InvoiceLedgerService invoiceLedgerService; |
| | | private InvoiceLedgerFileMapper invoiceLedgerFileMapper; |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping("/saveOrUpdate") |
| | | public AjaxResult invoiceLedgerSaveOrUpdate(@RequestBody InvoiceRegistrationProductDto productDto) { |
| | | public R<?> invoiceLedgerSaveOrUpdate(@RequestBody InvoiceRegistrationProductDto productDto) { |
| | | invoiceLedgerService.invoiceLedgerSaveOrUpdate(productDto); |
| | | return AjaxResult.success(); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/del") |
| | | public AjaxResult invoiceLedgerDel(@RequestBody List<Integer> ids) { |
| | | public R<?> invoiceLedgerDel(@RequestBody List<Integer> ids) { |
| | | invoiceLedgerService.invoiceLedgerDel(ids); |
| | | return AjaxResult.success(); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/page") |
| | | public AjaxResult invoiceLedgerPage(Page page, InvoiceLedgerDto invoiceLedgerDto) { |
| | | return AjaxResult.success(invoiceLedgerService.invoiceLedgerPage(page, invoiceLedgerDto)); |
| | | public R<?> invoiceLedgerPage(Page page, InvoiceLedgerDto invoiceLedgerDto) { |
| | | return R.ok(invoiceLedgerService.invoiceLedgerPage(page, invoiceLedgerDto)); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/fileList") |
| | | public AjaxResult invoiceLedgerFileList(Integer invoiceLedgerId) { |
| | | return AjaxResult.success(invoiceLedgerService.invoiceLedgerFileList(invoiceLedgerId)); |
| | | public R<?> invoiceLedgerFileList(Integer invoiceLedgerId) { |
| | | return R.ok(invoiceLedgerService.invoiceLedgerFileList(invoiceLedgerId)); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @DeleteMapping("/delFile") |
| | | @Log(title = "å¼ç¥¨å°è´¦", businessType = BusinessType.DELETE) |
| | | public AjaxResult invoiceLedgerDelFile(@RequestBody List<Integer> ids) { |
| | | if(Collections.isEmpty(ids)) return AjaxResult.error("è¯·éæ©è¦å é¤çæä»¶"); |
| | | public R<?> invoiceLedgerDelFile(@RequestBody List<Integer> ids) { |
| | | if(Collections.isEmpty(ids)) return R.fail("è¯·éæ©è¦å é¤çæä»¶"); |
| | | invoiceLedgerFileMapper.deleteBatchIds(ids); |
| | | return AjaxResult.success(); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping("/uploadFile") |
| | | public AjaxResult invoiceLedgerUploadFile(MultipartFile file) { |
| | | public R<?> invoiceLedgerUploadFile(MultipartFile file) { |
| | | try { |
| | | return AjaxResult.success(invoiceLedgerService.invoiceLedgerUploadFile(file)); |
| | | return R.ok(invoiceLedgerService.invoiceLedgerUploadFile(file)); |
| | | }catch (Exception e) { |
| | | return AjaxResult.error(e.getMessage()); |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/info") |
| | | public AjaxResult invoiceLedgerInfo(Integer id) { |
| | | return AjaxResult.success(invoiceLedgerService.invoiceLedgerDetail(id)); |
| | | public R<?> invoiceLedgerInfo(Integer id) { |
| | | return R.ok(invoiceLedgerService.invoiceLedgerDetail(id)); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping("/commitFile") |
| | | public AjaxResult invoiceLedgerCommitFile(@RequestBody InvoiceLedgerDto invoiceLedgerDto) { |
| | | public R<?> invoiceLedgerCommitFile(@RequestBody InvoiceLedgerDto invoiceLedgerDto) { |
| | | try { |
| | | invoiceLedgerService.invoiceLedgerCommitFile(invoiceLedgerDto); |
| | | return AjaxResult.success(); |
| | | return R.ok(); |
| | | }catch (Exception e) { |
| | | return AjaxResult.error(e.getMessage()); |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/list") |
| | | public AjaxResult invoiceLedgerList(InvoiceLedgerDto invoiceLedgerDto) { |
| | | return AjaxResult.success(invoiceLedgerService.invoiceLedgerList(invoiceLedgerDto)); |
| | | public R<?> invoiceLedgerList(InvoiceLedgerDto invoiceLedgerDto) { |
| | | return R.ok(invoiceLedgerService.invoiceLedgerList(invoiceLedgerDto)); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/salesAccount") |
| | | public AjaxResult invoiceLedgerSalesAccount(Page page, InvoiceLedgerDto invoiceLedgerDto) { |
| | | return AjaxResult.success(invoiceLedgerService.invoiceLedgerSalesAccount(page,invoiceLedgerDto)); |
| | | public R<?> invoiceLedgerSalesAccount(Page page, InvoiceLedgerDto invoiceLedgerDto) { |
| | | return R.ok(invoiceLedgerService.invoiceLedgerSalesAccount(page,invoiceLedgerDto)); |
| | | } |
| | | |
| | | /** |
| | | * æ¬æå¼ç¥¨éé¢ |
| | | */ |
| | | @GetMapping("/getInvoiceAmount") |
| | | public AjaxResult getInvoiceAmount() { |
| | | public R<?> getInvoiceAmount() { |
| | | try { |
| | | BigDecimal amount = invoiceLedgerService.getInvoiceAmount(); |
| | | return AjaxResult.success(amount != null ? amount : BigDecimal.ZERO); |
| | | return R.ok(amount != null ? amount : BigDecimal.ZERO); |
| | | } catch (Exception e) { |
| | | return AjaxResult.error("è·åå¼ç¥¨éé¢å¤±è´¥ï¼" + e.getMessage()); |
| | | return R.fail("è·åå¼ç¥¨éé¢å¤±è´¥ï¼" + e.getMessage()); |
| | | } |
| | | } |
| | | |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/registrationProductPage") |
| | | public AjaxResult registrationProductPage(Page page, InvoiceRegistrationProductDto registrationProductDto) { |
| | | public R<?> registrationProductPage(Page page, InvoiceRegistrationProductDto registrationProductDto) { |
| | | |
| | | return AjaxResult.success(invoiceLedgerService.registrationProductPage(page,registrationProductDto)); |
| | | return R.ok(invoiceLedgerService.registrationProductPage(page,registrationProductDto)); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/invoiceLedgerProductInfo") |
| | | public AjaxResult invoiceLedgerProductDetail(Integer id) { |
| | | return AjaxResult.success(invoiceLedgerService.invoiceLedgerProductDetail(id)); |
| | | public R<?> invoiceLedgerProductDetail(Integer id) { |
| | | return R.ok(invoiceLedgerService.invoiceLedgerProductDetail(id)); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @DeleteMapping("delInvoiceLedger/{invoiceRegistrationProductId}") |
| | | public AjaxResult delInvoiceLedger(@PathVariable Integer invoiceRegistrationProductId) { |
| | | public R<?> delInvoiceLedger(@PathVariable Integer invoiceRegistrationProductId) { |
| | | try { |
| | | invoiceLedgerService.delInvoiceLedger(invoiceRegistrationProductId); |
| | | return AjaxResult.success(); |
| | | return R.ok(); |
| | | }catch (Exception e) { |
| | | return AjaxResult.error(e.getMessage()); |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.sales.dto.InvoiceRegistrationDto; |
| | | import com.ruoyi.sales.dto.InvoiceRegistrationProductDto; |
| | | import com.ruoyi.sales.dto.SalesLedgerDto; |
| | |
| | | @RestController |
| | | @RequestMapping("/invoiceRegistration") |
| | | @AllArgsConstructor |
| | | public class InvoiceRegistrationController { |
| | | public class InvoiceRegistrationController extends BaseController { |
| | | |
| | | private InvoiceRegistrationService invoiceRegistrationService; |
| | | |
| | |
| | | @PostMapping("/save") |
| | | @Log(title = "å¼ç¥¨ç»è®°", businessType = com.ruoyi.framework.aspectj.lang.enums.BusinessType.INSERT) |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult invoiceRegistrationSave(@RequestBody List<SalesLedgerDto> salesLedgerDto) { |
| | | if(Collections.isEmpty(salesLedgerDto)) return AjaxResult.error("è¯·éæ©è¦ä¿åçè®°å½"); |
| | | public R<?> invoiceRegistrationSave(@RequestBody List<SalesLedgerDto> salesLedgerDto) { |
| | | if(Collections.isEmpty(salesLedgerDto)) return R.fail("è¯·éæ©è¦ä¿åçè®°å½"); |
| | | salesLedgerDto.forEach(item ->{ |
| | | invoiceRegistrationService.invoiceRegistrationSave(item); |
| | | }); |
| | | |
| | | return AjaxResult.success(); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/del") |
| | | public AjaxResult invoiceRegistrationDel(@RequestBody List<Integer> ids) { |
| | | public R<?> invoiceRegistrationDel(@RequestBody List<Integer> ids) { |
| | | invoiceRegistrationService.invoiceRegistrationDel(ids); |
| | | return AjaxResult.success(); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping("/update") |
| | | public AjaxResult invoiceRegistrationUpdate(@RequestBody InvoiceRegistrationDto invoiceRegistrationDto) { |
| | | public R<?> invoiceRegistrationUpdate(@RequestBody InvoiceRegistrationDto invoiceRegistrationDto) { |
| | | invoiceRegistrationService.invoiceRegistrationUpdate(invoiceRegistrationDto); |
| | | return AjaxResult.success(); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/listPage") |
| | | public AjaxResult invoiceRegistrationListPage(Page page, InvoiceRegistrationDto invoiceRegistrationDto) { |
| | | return AjaxResult.success(invoiceRegistrationService.invoiceRegistrationListPage(page, invoiceRegistrationDto)); |
| | | public R<?> invoiceRegistrationListPage(Page page, InvoiceRegistrationDto invoiceRegistrationDto) { |
| | | return R.ok(invoiceRegistrationService.invoiceRegistrationListPage(page, invoiceRegistrationDto)); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/productList") |
| | | public AjaxResult invoiceRegistrationProductList(InvoiceRegistrationProductDto invoiceRegistrationProductDto) { |
| | | return AjaxResult.success(invoiceRegistrationService.invoiceRegistrationProductList(invoiceRegistrationProductDto)); |
| | | public R<?> invoiceRegistrationProductList(InvoiceRegistrationProductDto invoiceRegistrationProductDto) { |
| | | return R.ok(invoiceRegistrationService.invoiceRegistrationProductList(invoiceRegistrationProductDto)); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/detail") |
| | | public AjaxResult invoiceRegistrationDetail(Integer id) { |
| | | return AjaxResult.success(invoiceRegistrationService.invoiceRegistrationDetail(id)); |
| | | public R<?> invoiceRegistrationDetail(Integer id) { |
| | | return R.ok(invoiceRegistrationService.invoiceRegistrationDetail(id)); |
| | | } |
| | | |
| | | /** |
| | |
| | | package com.ruoyi.sales.controller; |
| | | |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.sales.dto.StatisticsTableDto; |
| | | import com.ruoyi.sales.service.impl.MetricStatisticsServiceImpl; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | |
| | | |
| | | @Operation(summary = "头鍿»è®¡") |
| | | @GetMapping("/total") |
| | | public AjaxResult total() { |
| | | public R<?> total() { |
| | | return metricStatisticsService.total(); |
| | | } |
| | | |
| | | @Operation(summary = "ç»è®¡è¡¨") |
| | | @GetMapping("/statisticsTable") |
| | | public AjaxResult statisticsTable(StatisticsTableDto statisticsTableDto) { |
| | | public R<?> statisticsTable(StatisticsTableDto statisticsTableDto) { |
| | | return metricStatisticsService.statisticsTable(statisticsTableDto); |
| | | } |
| | | |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.utils.OrderUtils; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.sales.mapper.PaymentShippingMapper; |
| | | import com.ruoyi.sales.pojo.PaymentShipping; |
| | | import com.ruoyi.sales.service.PaymentShippingService; |
| | |
| | | |
| | | @GetMapping("/listPage") |
| | | @Operation(summary = "å页æ¥è¯¢æ¯ä»ä¸åè´§ä¿¡æ¯") |
| | | public AjaxResult listPage(Page page, PaymentShipping paymentShipping) { |
| | | public R<?> listPage(Page page, PaymentShipping paymentShipping) { |
| | | IPage<PaymentShipping> listPage = paymentShippingService.listPage(page, paymentShipping); |
| | | return AjaxResult.success(listPage); |
| | | return R.ok(listPage); |
| | | } |
| | | |
| | | @PostMapping("/add") |
| | | @Operation(summary = "æ·»å æ¯ä»ä¸åè´§ä¿¡æ¯") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult add(@RequestBody PaymentShipping paymentShipping) { |
| | | public R<?> add(@RequestBody PaymentShipping paymentShipping) { |
| | | String ord = OrderUtils.countTodayByCreateTime(paymentShippingMapper, "ORD","order_no"); |
| | | paymentShipping.setOrderNo(ord); |
| | | boolean save = paymentShippingService.save(paymentShipping); |
| | | return save ? success() : error(); |
| | | return save ? R.ok() : R.fail(); |
| | | } |
| | | |
| | | @PostMapping("/update") |
| | | @Operation(summary = "ä¿®æ¹æ¯ä»ä¸åè´§ä¿¡æ¯") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult update(@RequestBody PaymentShipping paymentShipping) { |
| | | public R<?> update(@RequestBody PaymentShipping paymentShipping) { |
| | | boolean update = paymentShippingService.updateById(paymentShipping); |
| | | return update ? success() : error(); |
| | | return update ? R.ok() : R.fail(); |
| | | } |
| | | |
| | | @DeleteMapping("/delete") |
| | | @Operation(summary = "å 餿¯ä»ä¸åè´§ä¿¡æ¯") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult delete(@RequestBody List<Long> ids){ |
| | | public R<?> delete(@RequestBody List<Long> ids){ |
| | | if (CollectionUtils.isEmpty(ids)){ |
| | | return AjaxResult.error("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | return R.fail("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | } |
| | | return AjaxResult.success(paymentShippingService.removeByIds(ids)); |
| | | return R.ok(paymentShippingService.removeByIds(ids)); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.framework.web.page.TableDataInfo; |
| | | import com.ruoyi.sales.dto.InvoiceLedgerDto; |
| | | import com.ruoyi.sales.dto.ReceiptPaymentDto; |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping("/saveOrUpdate") |
| | | public AjaxResult receiptPaymentSaveOrUpdate (@RequestBody List<ReceiptPayment> receiptPayment) { |
| | | public R<?> receiptPaymentSaveOrUpdate (@RequestBody List<ReceiptPayment> receiptPayment) { |
| | | receiptPaymentService.receiptPaymentSaveOrUpdate(receiptPayment); |
| | | return AjaxResult.success(); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @PostMapping("/update") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult receiptPaymentUpdate (@RequestBody ReceiptPayment receiptPayment) { |
| | | return AjaxResult.success(receiptPaymentService.receiptPaymentUpdate(receiptPayment)); |
| | | public R<?> receiptPaymentUpdate (@RequestBody ReceiptPayment receiptPayment) { |
| | | return R.ok(receiptPaymentService.receiptPaymentUpdate(receiptPayment)); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @DeleteMapping("/del") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult receiptPaymentDel (@RequestBody List<Integer> ids) { |
| | | return AjaxResult.success(receiptPaymentService.receiptPaymentDel(ids)); |
| | | public R<?> receiptPaymentDel (@RequestBody List<Integer> ids) { |
| | | return R.ok(receiptPaymentService.receiptPaymentDel(ids)); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/customerInteractions") |
| | | public AjaxResult customerInteractions (InvoiceLedgerDto receiptPaymentDto) { |
| | | return AjaxResult.success(receiptPaymentService.customerInteractions(receiptPaymentDto)); |
| | | public R<?> customerInteractions (InvoiceLedgerDto receiptPaymentDto) { |
| | | return R.ok(receiptPaymentService.customerInteractions(receiptPaymentDto)); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/info") |
| | | public AjaxResult receiptPaymentInfo (Integer id) { |
| | | return AjaxResult.success(receiptPaymentService.receiptPaymentInfo(id)); |
| | | public R<?> receiptPaymentInfo (Integer id) { |
| | | return R.ok(receiptPaymentService.receiptPaymentInfo(id)); |
| | | } |
| | | |
| | | /** |
| | | * æ¬æåæ¬¾éé¢ |
| | | */ |
| | | @GetMapping("/getReceiptAmount") |
| | | public AjaxResult getReceiptAmount() { |
| | | public R<?> getReceiptAmount() { |
| | | try { |
| | | BigDecimal receiptAmount = receiptPaymentService.getReceiptAmount(); |
| | | return AjaxResult.success(receiptAmount != null ? receiptAmount : BigDecimal.ZERO); |
| | | return R.ok(receiptAmount != null ? receiptAmount : BigDecimal.ZERO); |
| | | } catch (Exception e) { |
| | | return AjaxResult.error("è·å忬¾éé¢å¤±è´¥ï¼" + e.getMessage()); |
| | | return R.fail("è·å忬¾éé¢å¤±è´¥ï¼" + e.getMessage()); |
| | | } |
| | | } |
| | | |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/bindInvoiceNoRegPage") |
| | | public AjaxResult bindInvoiceNoRegPage(Page page, ReceiptPaymentDto receiptPaymentDto) { |
| | | return AjaxResult.success(receiptPaymentService.bindInvoiceNoRegPage(page,receiptPaymentDto)); |
| | | public R<?> bindInvoiceNoRegPage(Page page, ReceiptPaymentDto receiptPaymentDto) { |
| | | return R.ok(receiptPaymentService.bindInvoiceNoRegPage(page,receiptPaymentDto)); |
| | | } |
| | | |
| | | @Schema(description = "导åºå款ç»è®°") |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/invoiceInfo") |
| | | public AjaxResult invoiceInfo (Integer id) { |
| | | return AjaxResult.success(receiptPaymentService.invoiceInfo(id)); |
| | | public R<?> invoiceInfo (Integer id) { |
| | | return R.ok(receiptPaymentService.invoiceInfo(id)); |
| | | } |
| | | |
| | | /** |
| | | * æ¬æåºæ¶,忬¾éé¢ |
| | | */ |
| | | @GetMapping("/getAmountMouth") |
| | | public AjaxResult getAmountMouth() { |
| | | return AjaxResult.success(receiptPaymentService.getAmountMouth()); |
| | | public R<?> getAmountMouth() { |
| | | return R.ok(receiptPaymentService.getAmountMouth()); |
| | | } |
| | | |
| | | /** |
| | |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.framework.web.page.TableDataInfo; |
| | | import com.ruoyi.sales.dto.InvoiceLedgerDto; |
| | |
| | | @Log(title = "导å
¥éå®å°è´¦", businessType = BusinessType.INSERT) |
| | | @PostMapping("/import") |
| | | @Operation(summary = "导å
¥éå®å°è´¦") |
| | | public AjaxResult importData(@RequestParam("file") |
| | | public R<?> importData(@RequestParam("file") |
| | | @ApiParam(value = "Excelæä»¶", required = true) |
| | | MultipartFile file) { |
| | | return salesLedgerService.importData(file); |
| | |
| | | */ |
| | | @Log(title = "éå®å°è´¦", businessType = BusinessType.INSERT) |
| | | @PostMapping("/addOrUpdateSalesLedger") |
| | | public AjaxResult add(@RequestBody SalesLedgerDto salesLedgerDto) { |
| | | return toAjax(salesLedgerService.addOrUpdateSalesLedger(salesLedgerDto)); |
| | | public R<?> add(@RequestBody SalesLedgerDto salesLedgerDto) { |
| | | salesLedgerService.addOrUpdateSalesLedger(salesLedgerDto); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Log(title = "éå®å°è´¦", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/delLedger") |
| | | public AjaxResult remove(@RequestBody Long[] ids) { |
| | | public R<?> remove(@RequestBody Long[] ids) { |
| | | if (ids == null || ids.length == 0) { |
| | | return AjaxResult.error("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | return R.fail("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | } |
| | | return toAjax(salesLedgerService.deleteSalesLedgerByIds(ids)); |
| | | salesLedgerService.deleteSalesLedgerByIds(ids); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/listNoPage") |
| | | public AjaxResult listNoPage(SalesLedgerDto salesLedgerDto) { |
| | | public R<?> listNoPage(SalesLedgerDto salesLedgerDto) { |
| | | List<SalesLedger> list = salesLedgerService.selectSalesLedgerList(salesLedgerDto); |
| | | return AjaxResult.success(list); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Log(title = "éå®å°è´¦éä»¶å é¤", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/delLedgerFile") |
| | | public AjaxResult delLedgerFile(@RequestBody Long[] ids) { |
| | | public R<?> delLedgerFile(@RequestBody Long[] ids) { |
| | | if (ids == null || ids.length == 0) { |
| | | return AjaxResult.error("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | return R.fail("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | } |
| | | return toAjax(commonFileService.deleteSalesLedgerByIds(ids)); |
| | | commonFileService.deleteSalesLedgerByIds(ids); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * æ¬æéå®ååéé¢ |
| | | */ |
| | | @GetMapping("/getContractAmount") |
| | | public AjaxResult getContractAmount() { |
| | | public R<?> getContractAmount() { |
| | | try { |
| | | BigDecimal contractAmount = salesLedgerService.getContractAmount(); |
| | | return AjaxResult.success(contractAmount != null ? contractAmount : BigDecimal.ZERO); |
| | | return R.ok(contractAmount != null ? contractAmount : BigDecimal.ZERO); |
| | | } catch (Exception e) { |
| | | return AjaxResult.error("è·åååéé¢å¤±è´¥ï¼" + e.getMessage()); |
| | | return R.fail("è·åååéé¢å¤±è´¥ï¼" + e.getMessage()); |
| | | } |
| | | } |
| | | |
| | |
| | | * 客æ·ååéé¢TOP5ç»è®¡ |
| | | */ |
| | | @GetMapping("/getTopFiveList") |
| | | public AjaxResult getTopFiveList() { |
| | | return AjaxResult.success(salesLedgerService.getTopFiveList()); |
| | | public R<?> getTopFiveList() { |
| | | return R.ok(salesLedgerService.getTopFiveList()); |
| | | } |
| | | |
| | | /** |
| | | * è¿åå¹´å¼ç¥¨,忬¾éé¢ |
| | | */ |
| | | @GetMapping("/getAmountHalfYear") |
| | | public AjaxResult getAmountHalfYear(@RequestParam(value = "type",defaultValue = "1") Integer type) { |
| | | return AjaxResult.success(salesLedgerService.getAmountHalfYear(type)); |
| | | public R<?> getAmountHalfYear(@RequestParam(value = "type",defaultValue = "1") Integer type) { |
| | | return R.ok(salesLedgerService.getAmountHalfYear(type)); |
| | | } |
| | | |
| | | /** |
| | |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.procurementrecord.service.ProcurementRecordService; |
| | | import com.ruoyi.procurementrecord.utils.StockUtils; |
| | |
| | | * 忬¾ç»è®°å页æ¥è¯¢ |
| | | */ |
| | | @GetMapping("/listPageSalesLedger") |
| | | public AjaxResult listPage(Page page, SalesLedgerProductDto salesLedgerProduct) { |
| | | public R<?> listPageSalesLedger(Page page, SalesLedgerProductDto salesLedgerProduct) { |
| | | IPage<SalesLedgerProductDto> list = salesLedgerProductService.listPage(page,salesLedgerProduct); |
| | | return AjaxResult.success(list); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | |
| | |
| | | * 仿¬¾ç»è®°å页æ¥è¯¢ |
| | | */ |
| | | @GetMapping("/listPagePurchaseLedger") |
| | | public AjaxResult listPagePurchaseLedger(Page page, SalesLedgerProductDto salesLedgerProduct) { |
| | | public R<?> listPagePurchaseLedger(Page page, SalesLedgerProductDto salesLedgerProduct) { |
| | | IPage<SalesLedgerProductDto> list = salesLedgerProductService.listPagePurchaseLedger(page,salesLedgerProduct); |
| | | return AjaxResult.success(list); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | |
| | |
| | | * æ¥è¯¢äº§åä¿¡æ¯å表 |
| | | */ |
| | | @GetMapping("/list") |
| | | public AjaxResult list(SalesLedgerProduct salesLedgerProduct) { |
| | | public R<?> list(SalesLedgerProduct salesLedgerProduct) { |
| | | List<SalesLedgerProduct> list = salesLedgerProductService.selectSalesLedgerProductList(salesLedgerProduct); |
| | | if (CollUtil.isEmpty(list)) { |
| | | return AjaxResult.success(list); |
| | | return R.ok(list); |
| | | } |
| | | List<Long> productIds = list.stream().map(SalesLedgerProduct::getProductModelId).collect(Collectors.toList()); |
| | | List<SimpleReturnOrderGroupDto> groupListByProductIds = purchaseReturnOrderProductsMapper.getReturnOrderGroupListByProductIds(productIds); |
| | |
| | | item.setReturnQuality(returnQuality); |
| | | item.setAvailableQuality(item.getQuantity().subtract(returnQuality)); |
| | | }); |
| | | return AjaxResult.success(list); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | /** |
| | |
| | | * è·å产åä¿¡æ¯è¯¦ç»ä¿¡æ¯ |
| | | */ |
| | | @GetMapping(value = "/{id}") |
| | | public AjaxResult getInfo(@PathVariable("id") Long id) |
| | | public R<?> getInfo(@PathVariable("id") Long id) |
| | | { |
| | | return success(salesLedgerProductService.selectSalesLedgerProductById(id)); |
| | | return R.ok(salesLedgerProductService.selectSalesLedgerProductById(id)); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Log(title = "产åä¿¡æ¯", businessType = BusinessType.INSERT) |
| | | @PostMapping ("/addOrUpdateSalesLedgerProduct") |
| | | public AjaxResult add(@RequestBody SalesLedgerProduct salesLedgerProduct) |
| | | public R<?> add(@RequestBody SalesLedgerProduct salesLedgerProduct) |
| | | { |
| | | return toAjax(salesLedgerProductService.addOrUpdateSalesLedgerProduct(salesLedgerProduct)); |
| | | salesLedgerProductService.addOrUpdateSalesLedgerProduct(salesLedgerProduct); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Log(title = "产åä¿¡æ¯", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/delProduct") |
| | | public AjaxResult remove(@RequestBody Long[] ids) |
| | | public R<?> remove(@RequestBody Long[] ids) |
| | | { |
| | | if (ids == null || ids.length == 0) { |
| | | return AjaxResult.error("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | return R.fail("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | } |
| | | return toAjax(salesLedgerProductService.deleteSalesLedgerProductByIds(ids)); |
| | | salesLedgerProductService.deleteSalesLedgerProductByIds(ids); |
| | | return R.ok(); |
| | | } |
| | | |
| | | //æ ¹æ®äº§åidè·åbom夿åºåæ¯å¦å
è¶³ |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.sales.dto.SalesQuotationDto; |
| | | import com.ruoyi.sales.service.SalesQuotationService; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | |
| | | @RestController |
| | | @RequestMapping("/sales/quotation") |
| | | @AllArgsConstructor |
| | | public class SalesQuotationController { |
| | | public class SalesQuotationController extends BaseController { |
| | | private final SalesQuotationService salesQuotationService; |
| | | @GetMapping("/list") |
| | | public AjaxResult getList(Page page, SalesQuotationDto salesQuotationDto) { |
| | | return AjaxResult.success(salesQuotationService.listPage(page, salesQuotationDto)); |
| | | public R<?> getList(Page page, SalesQuotationDto salesQuotationDto) { |
| | | return R.ok(salesQuotationService.listPage(page, salesQuotationDto)); |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | |
| | | @PostMapping("/add") |
| | | public AjaxResult add(@RequestBody SalesQuotationDto salesQuotationDto) { |
| | | return AjaxResult.success(salesQuotationService.add(salesQuotationDto)); |
| | | public R<?> add(@RequestBody SalesQuotationDto salesQuotationDto) { |
| | | return R.ok(salesQuotationService.add(salesQuotationDto)); |
| | | } |
| | | @PostMapping("/update") |
| | | public AjaxResult update(@RequestBody SalesQuotationDto salesQuotationDto) { |
| | | return AjaxResult.success(salesQuotationService.edit(salesQuotationDto)); |
| | | public R<?> update(@RequestBody SalesQuotationDto salesQuotationDto) { |
| | | return R.ok(salesQuotationService.edit(salesQuotationDto)); |
| | | } |
| | | @DeleteMapping("/delete") |
| | | public AjaxResult delete(@RequestBody Long id) { |
| | | return AjaxResult.success(salesQuotationService.delete(id)); |
| | | public R<?> delete(@RequestBody Long id) { |
| | | return R.ok(salesQuotationService.delete(id)); |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.sales.pojo.SalespersonManagement; |
| | | import com.ruoyi.sales.service.SalespersonManagementService; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | |
| | | |
| | | @GetMapping("/listPage") |
| | | @Operation(summary = "å页æ¥è¯¢ä¸å¡åä¿¡æ¯") |
| | | public AjaxResult listPage(Page page, SalespersonManagement salespersonManagement) { |
| | | public R<?> listPage(Page page, SalespersonManagement salespersonManagement) { |
| | | IPage<SalespersonManagement> listPage = salespersonManagementService.listPage(page, salespersonManagement); |
| | | return AjaxResult.success(listPage); |
| | | return R.ok(listPage); |
| | | } |
| | | |
| | | @PostMapping("/add") |
| | | @Operation(summary = "æ·»å ä¸å¡åä¿¡æ¯") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult add(@RequestBody SalespersonManagement salespersonManagement) { |
| | | public R<?> add(@RequestBody SalespersonManagement salespersonManagement) { |
| | | boolean save = salespersonManagementService.save(salespersonManagement); |
| | | return save ? AjaxResult.success() : AjaxResult.error(); |
| | | return save ? R.ok() : R.fail(); |
| | | } |
| | | |
| | | @PostMapping("/update") |
| | | @Operation(summary = "ä¿®æ¹ä¸å¡åä¿¡æ¯") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult update(@RequestBody SalespersonManagement salespersonManagement) { |
| | | public R<?> update(@RequestBody SalespersonManagement salespersonManagement) { |
| | | boolean update = salespersonManagementService.updateById(salespersonManagement); |
| | | return update ? AjaxResult.success() : AjaxResult.error(); |
| | | return update ? R.ok() : R.fail(); |
| | | } |
| | | |
| | | @DeleteMapping("/delete") |
| | | @Operation(summary = "å é¤ä¸å¡åä¿¡æ¯") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult delete(@RequestBody List<Long> ids) { |
| | | public R<?> delete(@RequestBody List<Long> ids) { |
| | | if (ids == null || ids.isEmpty()) { |
| | | return AjaxResult.error("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | return R.fail("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | } |
| | | boolean delete = salespersonManagementService.removeByIds(ids); |
| | | return delete ? AjaxResult.success() : AjaxResult.error(); |
| | | return delete ? R.ok() : R.fail(); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.security.LoginUser; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.sales.dto.ShippingInfoDto; |
| | | import com.ruoyi.sales.mapper.ShippingInfoMapper; |
| | |
| | | |
| | | @GetMapping("/listPage") |
| | | @Operation(summary = "åè´§ä¿¡æ¯å表") |
| | | public AjaxResult listPage(Page page, ShippingInfo req) { |
| | | public R<?> listPage(Page page, ShippingInfo req) { |
| | | IPage<ShippingInfoDto> listPage = shippingInfoService.listPage(page,req); |
| | | return AjaxResult.success(listPage); |
| | | return R.ok(listPage); |
| | | } |
| | | |
| | | @PostMapping("/add") |
| | | @Operation(summary = "æ·»å åè´§ä¿¡æ¯") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Log(title = "åè´§ä¿¡æ¯ç®¡ç", businessType = BusinessType.INSERT) |
| | | public AjaxResult add(@RequestBody ShippingInfoDto req) throws Exception { |
| | | public R<?> add(@RequestBody ShippingInfoDto req) throws Exception { |
| | | LoginUser loginUser = SecurityUtils.getLoginUser(); |
| | | String sh = OrderUtils.countTodayByCreateTime(shippingInfoMapper, "SH","shipping_no"); |
| | | // åè´§å®¡æ¹ |
| | |
| | | req.setShippingNo(sh); |
| | | req.setStatus("å¾
å®¡æ ¸"); |
| | | boolean save = shippingInfoService.add(req); |
| | | return save ? AjaxResult.success() : AjaxResult.error(); |
| | | return save ? R.ok() : R.fail(); |
| | | } |
| | | |
| | | @Operation(summary = "åè´§æ£åºå") |
| | | @PostMapping("/deductStock") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Log(title = "åè´§ä¿¡æ¯ç®¡ç", businessType = BusinessType.UPDATE) |
| | | public AjaxResult deductStock(@RequestBody ShippingInfoDto req) throws IOException { |
| | | return shippingInfoService.deductStock( req) ? AjaxResult.success() : AjaxResult.error(); |
| | | public R<?> deductStock(@RequestBody ShippingInfoDto req) throws IOException { |
| | | return shippingInfoService.deductStock( req) ? R.ok() : R.fail(); |
| | | } |
| | | |
| | | @PostMapping("/update") |
| | | @Operation(summary = "ä¿®æ¹åè´§ä¿¡æ¯") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Log(title = "åè´§ä¿¡æ¯ç®¡ç", businessType = BusinessType.UPDATE) |
| | | public AjaxResult update(@RequestBody ShippingInfo req) { |
| | | public R<?> update(@RequestBody ShippingInfo req) { |
| | | ShippingInfo byId = shippingInfoService.getById(req.getId()); |
| | | if (byId == null) { |
| | | return AjaxResult.error("åè´§ä¿¡æ¯ä¸åå¨"); |
| | | return R.fail("åè´§ä¿¡æ¯ä¸åå¨"); |
| | | } |
| | | boolean update = shippingInfoService.updateById(req); |
| | | return update ? AjaxResult.success() : AjaxResult.error(); |
| | | return update ? R.ok() : R.fail(); |
| | | } |
| | | |
| | | @DeleteMapping("/delete") |
| | | @Operation(summary = "å é¤åè´§ä¿¡æ¯") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Log(title = "åè´§ä¿¡æ¯ç®¡ç", businessType = BusinessType.DELETE) |
| | | public AjaxResult delete(@RequestBody List<Long> ids) { |
| | | public R<?> delete(@RequestBody List<Long> ids) { |
| | | |
| | | return shippingInfoService.delete(ids) ? AjaxResult.success("å 餿å") : AjaxResult.error("å é¤å¤±è´¥"); |
| | | return shippingInfoService.delete(ids) ? R.ok("å 餿å") : R.fail("å é¤å¤±è´¥"); |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | @GetMapping("/getByCustomerName") |
| | | @Operation(summary = "éè¿å®¢æ·åç§°æ¥è¯¢å
³èçåè´§åå·") |
| | | public AjaxResult getByCustomerName(String customerName) { |
| | | return AjaxResult.success(shippingInfoService.getShippingInfoByCustomerName(customerName)); |
| | | public R<?> getByCustomerName(String customerName) { |
| | | return R.ok(shippingInfoService.getShippingInfoByCustomerName(customerName)); |
| | | } |
| | | |
| | | @GetMapping("/getDateil/{id}") |
| | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.aftersalesservice.pojo.AfterSalesService; |
| | | import com.ruoyi.common.enums.SaleEnum; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.sales.dto.LossProductModelDto; |
| | | import com.ruoyi.sales.dto.MonthlyAmountDto; |
| | | import com.ruoyi.sales.dto.SalesLedgerDto; |
| | |
| | | |
| | | IPage<SalesLedgerVo> selectSalesLedgerListPage(Page page, SalesLedgerDto salesLedgerDto); |
| | | |
| | | AjaxResult importData(MultipartFile file); |
| | | R<?> importData(MultipartFile file); |
| | | |
| | | List<LossProductModelDto> getSalesLedgerWithProductsLoss(Long salesLedgerId); |
| | | |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.sales.dto.SalesTrendDto; |
| | | import com.ruoyi.sales.dto.StatisticsTableDto; |
| | | import com.ruoyi.sales.mapper.SalesLedgerMapper; |
| | |
| | | private final SalesLedgerProductMapper salesLedgerProductMapper; |
| | | private final ShippingInfoMapper shippingInfoMapper; |
| | | |
| | | public AjaxResult total() { |
| | | public R<?> total() { |
| | | List<SalesLedger> salesLedgers = salesLedgerMapper.selectList(null); |
| | | if(CollectionUtils.isEmpty(salesLedgers)) return AjaxResult.success(salesLedgers); |
| | | if(CollectionUtils.isEmpty(salesLedgers)) return R.ok(salesLedgers); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | // éå®é¢ |
| | | map.put("contractAmountTotal", salesLedgers.stream().map(SalesLedger::getContractAmount).reduce(BigDecimal.ZERO, BigDecimal::add)); |
| | |
| | | List<SalesLedgerProduct> salesLedgerProducts = salesLedgerProductMapper.selectList(new LambdaQueryWrapper<SalesLedgerProduct>() |
| | | .eq(SalesLedgerProduct::getType, 1)); |
| | | map.put("shipRate", "0%"); |
| | | if(CollectionUtils.isEmpty(salesLedgerProducts)) return AjaxResult.success(map); |
| | | if(CollectionUtils.isEmpty(salesLedgerProducts)) return R.ok(map); |
| | | // åè´§æ°é |
| | | long count = shippingInfoMapper.selectCount(new LambdaQueryWrapper<ShippingInfo>() |
| | | .in(ShippingInfo::getSalesLedgerProductId, salesLedgerProducts.stream().map(SalesLedgerProduct::getId).collect(Collectors.toList())) |
| | | .eq(ShippingInfo::getStatus,"å·²åè´§")); |
| | | map.put("shipRate", String.format("%.2f", count * 100.0 / salesLedgerProducts.size()) + "%"); |
| | | return AjaxResult.success(map); |
| | | return R.ok(map); |
| | | } |
| | | |
| | | public AjaxResult statisticsTable(StatisticsTableDto statisticsTableDto) { |
| | | public R<?> statisticsTable(StatisticsTableDto statisticsTableDto) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | Calendar calendar = Calendar.getInstance(); |
| | | |
| | |
| | | map.put("orderCountList", orderCountList); |
| | | map.put("salesAmountList", salesAmountList); |
| | | map.put("shippingRateList", shippingRateList); |
| | | return AjaxResult.success(map); |
| | | return R.ok(map); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.sales.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.framework.security.LoginUser; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.other.mapper.TempFileMapper; |
| | | import com.ruoyi.other.pojo.TempFile; |
| | | import com.ruoyi.production.mapper.*; |
| | | import com.ruoyi.production.mapper.ProductionProductInputMapper; |
| | | import com.ruoyi.production.mapper.ProductionProductMainMapper; |
| | | import com.ruoyi.production.mapper.ProductionProductOutputMapper; |
| | | import com.ruoyi.production.service.ProductionProductMainService; |
| | | import com.ruoyi.project.system.domain.SysDept; |
| | | import com.ruoyi.project.system.domain.SysUser; |
| | |
| | | import com.ruoyi.sales.vo.SalesLedgerVo; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.io.FilenameUtils; |
| | | import org.jetbrains.annotations.Nullable; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.lang.reflect.Field; |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.nio.file.Files; |
| | | import java.nio.file.Path; |
| | | import java.nio.file.Paths; |
| | | import java.nio.file.StandardCopyOption; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.time.YearMonth; |
| | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult importData(MultipartFile file) { |
| | | public R<?> importData(MultipartFile file) { |
| | | LoginUser loginUser = SecurityUtils.getLoginUser(); |
| | | try { |
| | | InputStream inputStream = file.getInputStream(); |
| | | ExcelUtil<SalesLedgerImportDto> salesLedgerImportDtoExcelUtil = new ExcelUtil<>(SalesLedgerImportDto.class); |
| | | Map<String, List<SalesLedgerImportDto>> stringListMap = salesLedgerImportDtoExcelUtil.importExcelMultiSheet(Arrays.asList("éå®å°è´¦æ°æ®", "éå®äº§åæ°æ®"), inputStream, 0); |
| | | if (CollectionUtils.isEmpty(stringListMap)) return AjaxResult.error("éå®è¡¨æ ¼ä¸ºç©ºï¼"); |
| | | if (CollectionUtils.isEmpty(stringListMap)) return R.fail("éå®è¡¨æ ¼ä¸ºç©ºï¼"); |
| | | // ä¸å¡å±åå¹¶ |
| | | List<SalesLedgerImportDto> salesLedgerImportDtoList = stringListMap.get("éå®å°è´¦æ°æ®"); |
| | | if (CollectionUtils.isEmpty(salesLedgerImportDtoList)) return AjaxResult.error("éå®å°è´¦æ°æ®ä¸ºç©ºï¼"); |
| | | if (CollectionUtils.isEmpty(salesLedgerImportDtoList)) return R.fail("éå®å°è´¦æ°æ®ä¸ºç©ºï¼"); |
| | | List<SalesLedgerImportDto> salesLedgerProductImportDtoList = stringListMap.get("éå®äº§åæ°æ®"); |
| | | if (CollectionUtils.isEmpty(salesLedgerProductImportDtoList)) return AjaxResult.error("éå®äº§åæ°æ®ä¸ºç©ºï¼"); |
| | | // å®¢æ·æ°æ® |
| | | List<Customer> customers = customerMapper.selectList(new LambdaQueryWrapper<Customer>().in(Customer::getCustomerName, |
| | | salesLedgerImportDtoList.stream().map(SalesLedgerImportDto::getCustomerName).collect(Collectors.toList()))); |
| | | if (CollectionUtils.isEmpty(salesLedgerProductImportDtoList)) return R.fail("éå®äº§åæ°æ®ä¸ºç©ºï¼"); |
| | | // å®¢æ·æ°æ® - åè listPage æ¥è¯¢ç§æµ·å®¢æ·ï¼type = 0ï¼ |
| | | // type = 0ï¼ç§æµ·å®¢æ·ï¼æè
type = 1ï¼å
¬æµ·å®¢æ·ï¼ä¸å·²è¢«åé
ï¼å¹¶ä¸æ¯èªå·±é¢ç¨ãèªå·±å建æè
å
±äº«ç»èªå·±çå®¢æ· |
| | | Long loginUserId = loginUser.getUser().getUserId(); |
| | | List<Customer> customers = customerMapper.selectList(new QueryWrapper<Customer>() |
| | | .in("customer_name", salesLedgerImportDtoList.stream() |
| | | .map(SalesLedgerImportDto::getCustomerName).collect(Collectors.toList())) |
| | | .and(wrapper -> wrapper.eq("type", 0) |
| | | .or(wrapper2 -> wrapper2.eq("type", 1).eq("is_assigned", 1))) |
| | | .and(wrapper -> wrapper.eq("usage_user", loginUserId) |
| | | .or(wrapper2 -> wrapper2.eq("create_user", loginUserId) |
| | | .or(wrapper3 -> wrapper3.exists("select 1 from customer_user cu where cu.customer_id = customer.id and cu.user_id = " + loginUserId))))); |
| | | // // è§æ ¼åå·æ°æ® |
| | | // List<ProductModel> productModels = productModelMapper.selectList(new LambdaQueryWrapper<ProductModel>().in(ProductModel::getModel, |
| | | // salesLedgerProductImportDtoList.stream().map(SalesLedgerImportDto::getSpecificationModel).collect(Collectors.toList()))); |
| | |
| | | salesLedger.setExecutionDate(DateUtils.toLocalDate(salesLedgerImportDto.getExecutionDate())); |
| | | salesLedger.setDeliveryDate(DateUtils.toLocalDate(salesLedgerImportDto.getDeliveryDate())); |
| | | // éè¿å®¢æ·åç§°æ¥è¯¢å®¢æ·IDï¼å®¢æ·ååå· |
| | | salesLedger.setCustomerId(customers.stream() |
| | | Optional<Customer> customerOptional = customers.stream() |
| | | .filter(customer -> customer.getCustomerName().equals(salesLedger.getCustomerName())) |
| | | .findFirst() |
| | | .map(Customer::getId) |
| | | .orElse(null)); |
| | | salesLedger.setCustomerContractNo(customers.stream() |
| | | .filter(customer -> customer.getCustomerName().equals(salesLedger.getCustomerName())) |
| | | .findFirst() |
| | | .map(Customer::getTaxpayerIdentificationNumber) |
| | | .orElse(null)); |
| | | .findFirst(); |
| | | if (customerOptional.isEmpty()) { |
| | | throw new RuntimeException("客æ·:" + salesLedger.getCustomerName() + "ä¸åå¨ï¼æè
éç§æµ·ç¨æ·"); |
| | | } |
| | | salesLedger.setCustomerId(customerOptional.get().getId()); |
| | | salesLedger.setCustomerContractNo(customerOptional.get().getTaxpayerIdentificationNumber()); |
| | | Long aLong = sysUsers.stream() |
| | | .filter(sysUser -> sysUser.getNickName().equals(salesLedger.getEntryPerson())) |
| | | .findFirst() |
| | |
| | | salesLedgerProduct.setTaxExclusiveTotalPrice(salesLedgerProduct.getTaxInclusiveTotalPrice().divide(new BigDecimal(1).add(salesLedgerProduct.getTaxRate().divide(new BigDecimal(100))), 2, RoundingMode.HALF_UP)); |
| | | salesLedgerProduct.setNoInvoiceNum(salesLedgerProduct.getQuantity()); |
| | | salesLedgerProduct.setNoInvoiceAmount(salesLedgerProduct.getTaxExclusiveTotalPrice()); |
| | | list.stream() |
| | | // æ ¡éªäº§åè§æ ¼æ¯å¦åå¨ |
| | | Optional<Map<String, Object>> productModelOptional = list.stream() |
| | | .filter(map -> Objects.equals(map.get("productName"), salesLedgerProduct.getProductCategory()) && Objects.equals(map.get("model"), salesLedgerProduct.getSpecificationModel())) |
| | | .findFirst() |
| | | .ifPresent(map -> { |
| | | salesLedgerProduct.setProductModelId(Long.parseLong(map.get("modelId").toString())); |
| | | salesLedgerProduct.setProductId(Long.parseLong(map.get("id").toString())); |
| | | }); |
| | | .findFirst(); |
| | | if (productModelOptional.isEmpty()) { |
| | | throw new RuntimeException("产å大类:" + salesLedgerProduct.getProductCategory() + ",è§æ ¼åå·:" + salesLedgerProduct.getSpecificationModel() + "ä¸åå¨ï¼"); |
| | | } |
| | | Map<String, Object> productModelMap = productModelOptional.get(); |
| | | salesLedgerProduct.setProductModelId(Long.parseLong(productModelMap.get("modelId").toString())); |
| | | salesLedgerProduct.setProductId(Long.parseLong(productModelMap.get("id").toString())); |
| | | // salesLedgerProduct.setProductId(productList.stream() |
| | | // .filter(product -> product.getProductName().equals(salesLedgerProduct.getProductCategory())) |
| | | // .findFirst() |
| | |
| | | } |
| | | } |
| | | |
| | | return AjaxResult.success("导å
¥æå"); |
| | | return R.ok(null, "导å
¥æå"); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return AjaxResult.error("导å
¥å¤±è´¥ï¼" + e.getMessage()); |
| | | return R.fail("导å
¥å¤±è´¥ï¼" + e.getMessage()); |
| | | } |
| | | } |
| | | |
| | |
| | | salesLedger.setTenantId(customer.getTenantId()); |
| | | // 3. æ°å¢ææ´æ°ä¸»è¡¨ |
| | | if (salesLedger.getId() == null) { |
| | | String contractNo = generateSalesContractNo(); |
| | | String contractNo = salesLedger.getSalesContractNo(); |
| | | if (StringUtils.isEmpty(contractNo)) { |
| | | contractNo = generateSalesContractNo(); |
| | | } |
| | | salesLedger.setSalesContractNo(contractNo); |
| | | salesLedgerMapper.insert(salesLedger); |
| | | } else { |
| | |
| | | package com.ruoyi.staff.controller; |
| | | |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.staff.service.AnalyticsService; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | |
| | | |
| | | @RestController |
| | | @RequestMapping("/staff/analytics") |
| | | public class AnalyticsController { |
| | | public class AnalyticsController extends BaseController { |
| | | |
| | | @Resource |
| | | private AnalyticsService analyticsService; |
| | | |
| | | @GetMapping("/reason") |
| | | public AjaxResult staffLeaveReasonAnalytics() { |
| | | return AjaxResult.success(analyticsService.staffLeaveReasonAnalytics()); |
| | | public R<?> staffLeaveReasonAnalytics() { |
| | | return R.ok(analyticsService.staffLeaveReasonAnalytics()); |
| | | } |
| | | |
| | | @GetMapping("/monthly_turnover_rate") |
| | | public AjaxResult getMonthlyTurnoverRateFor12Months() { |
| | | return AjaxResult.success(analyticsService.getMonthlyTurnoverRateFor12Months()); |
| | | public R<?> getMonthlyTurnoverRateFor12Months() { |
| | | return R.ok(analyticsService.getMonthlyTurnoverRateFor12Months()); |
| | | } |
| | | |
| | | @GetMapping("/total_statistic") |
| | | public AjaxResult getTotalStatistic() { |
| | | return AjaxResult.success(analyticsService.getTotalStatistic()); |
| | | public R<?> getTotalStatistic() { |
| | | return R.ok(analyticsService.getTotalStatistic()); |
| | | } |
| | | } |
| | |
| | | |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.staff.pojo.Bank; |
| | | import com.ruoyi.staff.service.BankService; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | |
| | | @RestController |
| | | @RequestMapping("/bank") |
| | | @AllArgsConstructor |
| | | public class BankController { |
| | | public class BankController extends BaseController { |
| | | |
| | | private BankService bankService; |
| | | |
| | | @GetMapping("/list") |
| | | public AjaxResult list() { |
| | | return AjaxResult.success(bankService.list()); |
| | | public R<?> list() { |
| | | return R.ok(bankService.list()); |
| | | } |
| | | |
| | | @PostMapping("/add") |
| | | @Operation(summary = "æ°å¢é¶è¡ç®¡ç表") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Log(title = "é¶è¡ç®¡ç表", businessType = BusinessType.INSERT) |
| | | public AjaxResult add(@RequestBody Bank bank) { |
| | | return AjaxResult.success(bankService.save(bank)); |
| | | public R<?> add(@RequestBody Bank bank) { |
| | | return R.ok(bankService.save(bank)); |
| | | } |
| | | |
| | | @PostMapping("/update") |
| | | @Operation(summary = "æ´æ°é¶è¡ç®¡ç表") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Log(title = "é¶è¡ç®¡ç表", businessType = BusinessType.UPDATE) |
| | | public AjaxResult update(@RequestBody Bank bank) { |
| | | return AjaxResult.success(bankService.updateById(bank)); |
| | | public R<?> update(@RequestBody Bank bank) { |
| | | return R.ok(bankService.updateById(bank)); |
| | | } |
| | | |
| | | @DeleteMapping("/delete") |
| | | @Operation(summary = "å é¤é¶è¡ç®¡ç表") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Log(title = "é¶è¡ç®¡ç表", businessType = BusinessType.DELETE) |
| | | public AjaxResult delete(@RequestBody List<Long> ids) { |
| | | return AjaxResult.success(bankService.removeBatchByIds(ids)); |
| | | public R<?> delete(@RequestBody List<Long> ids) { |
| | | return R.ok(bankService.removeBatchByIds(ids)); |
| | | } |
| | | |
| | | } |
| | |
| | | package com.ruoyi.staff.controller; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.staff.pojo.HolidayApplication; |
| | | import com.ruoyi.staff.service.HolidayApplicationService; |
| | | import lombok.AllArgsConstructor; |
| | |
| | | @RestController |
| | | @RequestMapping("/staff/holidayApplication") |
| | | @AllArgsConstructor |
| | | public class HolidayApplicationController { |
| | | public class HolidayApplicationController extends BaseController { |
| | | |
| | | private HolidayApplicationService holidayApplicationService; |
| | | /** |
| | | * 请åç³è¯·å页æ¥è¯¢ |
| | | */ |
| | | @GetMapping("/listPage") |
| | | public AjaxResult listPage(Page page, HolidayApplication holidayApplication){ |
| | | return AjaxResult.success(holidayApplicationService.listPage(page, holidayApplication)); |
| | | public R<?> listPage(Page page, HolidayApplication holidayApplication){ |
| | | return R.ok(holidayApplicationService.listPage(page, holidayApplication)); |
| | | } |
| | | /** |
| | | * æ°å¢è¯·åç³è¯· |
| | | */ |
| | | @PostMapping("/add") |
| | | public AjaxResult add(@RequestBody HolidayApplication holidayApplication){ |
| | | return AjaxResult.success(holidayApplicationService.save(holidayApplication)); |
| | | public R<?> add(@RequestBody HolidayApplication holidayApplication){ |
| | | return R.ok(holidayApplicationService.save(holidayApplication)); |
| | | } |
| | | /** |
| | | * ä¿®æ¹è¯·åç³è¯· |
| | | */ |
| | | @PostMapping("/update") |
| | | public AjaxResult update(@RequestBody HolidayApplication holidayApplication){ |
| | | return AjaxResult.success(holidayApplicationService.updateById(holidayApplication)); |
| | | public R<?> update(@RequestBody HolidayApplication holidayApplication){ |
| | | return R.ok(holidayApplicationService.updateById(holidayApplication)); |
| | | } |
| | | /** |
| | | * å é¤è¯·åç³è¯· |
| | | */ |
| | | @DeleteMapping("/delete/{id}") |
| | | public AjaxResult delete(@PathVariable("id") Long id){ |
| | | return AjaxResult.success(holidayApplicationService.removeById(id)); |
| | | public R<?> delete(@PathVariable("id") Long id){ |
| | | return R.ok(holidayApplicationService.removeById(id)); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.staff.controller; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.staff.dto.PersonalAttendanceRecordsDto; |
| | | import com.ruoyi.staff.pojo.PersonalAttendanceRecords; |
| | | import com.ruoyi.staff.service.PersonalAttendanceRecordsService; |
| | |
| | | @RestController |
| | | @RequestMapping("/personalAttendanceRecords") |
| | | @Tag(name = "人åæå¡ç¾å°") |
| | | public class PersonalAttendanceRecordsController { |
| | | public class PersonalAttendanceRecordsController extends BaseController { |
| | | @Resource |
| | | private PersonalAttendanceRecordsService personalAttendanceRecordsService; |
| | | |
| | | @Operation(summary = "æ°å¢æå¡ç¾å°") |
| | | @PostMapping("") |
| | | public AjaxResult add(@RequestBody PersonalAttendanceRecordsDto personalAttendanceRecordsDto){ |
| | | return AjaxResult.success(personalAttendanceRecordsService.add(personalAttendanceRecordsDto)); |
| | | public R<?> add(@RequestBody PersonalAttendanceRecordsDto personalAttendanceRecordsDto){ |
| | | return R.ok(personalAttendanceRecordsService.add(personalAttendanceRecordsDto)); |
| | | } |
| | | |
| | | @Operation(summary = "å页æ¥è¯¢æå¡ç¾å°") |
| | | @GetMapping("/listPage") |
| | | public AjaxResult listPage(Page page, PersonalAttendanceRecordsDto personalAttendanceRecordsDto){ |
| | | return AjaxResult.success(personalAttendanceRecordsService.listPage(page, personalAttendanceRecordsDto)); |
| | | public R<?> listPage(Page page, PersonalAttendanceRecordsDto personalAttendanceRecordsDto){ |
| | | return R.ok(personalAttendanceRecordsService.listPage(page, personalAttendanceRecordsDto)); |
| | | } |
| | | |
| | | @Operation(summary = "è·åå½å人çèå¤ç¸å
³æ°æ®") |
| | | @GetMapping("/today") |
| | | public AjaxResult todayInfo(PersonalAttendanceRecordsDto personalAttendanceRecordsDto){ |
| | | return AjaxResult.success(personalAttendanceRecordsService.todayInfo(personalAttendanceRecordsDto)); |
| | | public R<?> todayInfo(PersonalAttendanceRecordsDto personalAttendanceRecordsDto){ |
| | | return R.ok(personalAttendanceRecordsService.todayInfo(personalAttendanceRecordsDto)); |
| | | } |
| | | |
| | | @Operation(summary = "å¯¼åºæå¡ç¾å°") |
| | |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.staff.pojo.SchemeApplicableStaff; |
| | | import com.ruoyi.staff.service.SchemeApplicableStaffService; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | |
| | | |
| | | @GetMapping("/listPage") |
| | | @Operation(summary = "å页æ¥è¯¢") |
| | | public AjaxResult listPage(Page page, SchemeApplicableStaff schemeApplicableStaff) { |
| | | public R<?> listPage(Page page, SchemeApplicableStaff schemeApplicableStaff) { |
| | | return schemeApplicableStaffService.listPage(page,schemeApplicableStaff); |
| | | } |
| | | |
| | |
| | | @Operation(summary = "æ·»å ") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Log(title = "ç¤¾ä¿æ¹æ¡éç¨äººå表", businessType = BusinessType.INSERT) |
| | | public AjaxResult add(@RequestBody SchemeApplicableStaff schemeApplicableStaff) { |
| | | public R<?> add(@RequestBody SchemeApplicableStaff schemeApplicableStaff) { |
| | | return schemeApplicableStaffService.add(schemeApplicableStaff); |
| | | } |
| | | |
| | |
| | | @Operation(summary = "ä¿®æ¹") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Log(title = "ç¤¾ä¿æ¹æ¡éç¨äººå表", businessType = BusinessType.UPDATE) |
| | | public AjaxResult updateSchemeApplicableStaff(@RequestBody SchemeApplicableStaff schemeApplicableStaff) { |
| | | public R<?> updateSchemeApplicableStaff(@RequestBody SchemeApplicableStaff schemeApplicableStaff) { |
| | | return schemeApplicableStaffService.updateSchemeApplicableStaff(schemeApplicableStaff); |
| | | } |
| | | |
| | |
| | | @Operation(summary = "å é¤") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Log(title = "ç¤¾ä¿æ¹æ¡éç¨äººå表", businessType = BusinessType.DELETE) |
| | | public AjaxResult delete(@RequestBody List<Long> ids) { |
| | | public R<?> delete(@RequestBody List<Long> ids) { |
| | | return schemeApplicableStaffService.delete(ids); |
| | | } |
| | | |
| | |
| | | package com.ruoyi.staff.controller; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.staff.pojo.StaffContract; |
| | | import com.ruoyi.staff.service.StaffContractService; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | |
| | | @RestController |
| | | @RequestMapping("/staff/staffContract") |
| | | @Tag(name = "åå·¥å°è´¦/åå管ç") |
| | | public class StaffContractController { |
| | | public class StaffContractController extends BaseController { |
| | | |
| | | @Resource |
| | | private StaffContractService staffContractService; |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/listPage") |
| | | public AjaxResult staffContractListPage(Page page, StaffContract staffContract) { |
| | | return AjaxResult.success(staffContractService.staffContractListPage(page, staffContract)); |
| | | public R<?> staffContractListPage(Page page, StaffContract staffContract) { |
| | | return R.ok(staffContractService.staffContractListPage(page, staffContract)); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.staff.controller; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.staff.dto.StaffLeaveDto; |
| | | import com.ruoyi.staff.service.StaffLeaveService; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | |
| | | @RestController |
| | | @RequestMapping("/staff/staffLeave") |
| | | @Tag(name = "å工离è") |
| | | public class StaffLeaveController { |
| | | public class StaffLeaveController extends BaseController { |
| | | @Resource |
| | | private StaffLeaveService staffLeaveService; |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/listPage") |
| | | public AjaxResult staffLeaveListPage(Page page, StaffLeaveDto staffLeaveDto) { |
| | | return AjaxResult.success(staffLeaveService.staffLeaveListPage(page, staffLeaveDto)); |
| | | public R<?> staffLeaveListPage(Page page, StaffLeaveDto staffLeaveDto) { |
| | | return R.ok(staffLeaveService.staffLeaveListPage(page, staffLeaveDto)); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping("") |
| | | public AjaxResult add(@RequestBody StaffLeaveDto staffLeaveDto) { |
| | | return AjaxResult.success(staffLeaveService.add(staffLeaveDto)); |
| | | public R<?> add(@RequestBody StaffLeaveDto staffLeaveDto) { |
| | | return R.ok(staffLeaveService.add(staffLeaveDto)); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @PutMapping("/{id}") |
| | | public AjaxResult update(@PathVariable("id") Long id, @RequestBody StaffLeaveDto staffLeaveDto) { |
| | | return AjaxResult.success(staffLeaveService.update(id, staffLeaveDto)); |
| | | public R<?> update(@PathVariable("id") Long id, @RequestBody StaffLeaveDto staffLeaveDto) { |
| | | return R.ok(staffLeaveService.update(id, staffLeaveDto)); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/del") |
| | | public AjaxResult del(@RequestBody List<Integer> ids) { |
| | | public R<?> del(@RequestBody List<Integer> ids) { |
| | | if(CollectionUtils.isEmpty(ids)){ |
| | | return AjaxResult.error("è¯·éæ©è³å°ä¸æ¡æ°æ®"); |
| | | return R.fail("è¯·éæ©è³å°ä¸æ¡æ°æ®"); |
| | | } |
| | | return AjaxResult.success(staffLeaveService.del(ids)); |
| | | return R.ok(staffLeaveService.del(ids)); |
| | | } |
| | | |
| | | /** |
| | |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.staff.dto.StaffOnJobDto; |
| | | import com.ruoyi.staff.dto.StaffOnJobExcelDto; |
| | | import com.ruoyi.staff.pojo.StaffContract; |
| | |
| | | @RestController |
| | | @RequestMapping("/staff/staffOnJob") |
| | | @Tag(name = "åå·¥å°è´¦") |
| | | public class StaffOnJobController { |
| | | public class StaffOnJobController extends BaseController { |
| | | |
| | | @Resource |
| | | private IStaffOnJobService staffOnJobService; |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/listPage") |
| | | public AjaxResult staffOnJobListPage(Page page, StaffOnJob staffOnJob) { |
| | | return AjaxResult.success(staffOnJobService.staffOnJobListPage(page, staffOnJob)); |
| | | public R<?> staffOnJobListPage(Page page, StaffOnJob staffOnJob) { |
| | | return R.ok(staffOnJobService.staffOnJobListPage(page, staffOnJob)); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/list") |
| | | public AjaxResult staffOnJobList(StaffOnJob staffOnJob) { |
| | | return AjaxResult.success(staffOnJobService.staffOnJobList(staffOnJob)); |
| | | public R<?> staffOnJobList(StaffOnJob staffOnJob) { |
| | | return R.ok(staffOnJobService.staffOnJobList(staffOnJob)); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping("") |
| | | public AjaxResult add(@RequestBody StaffOnJobDto staffOnJob) { |
| | | return AjaxResult.success(staffOnJobService.add(staffOnJob)); |
| | | public R<?> add(@RequestBody StaffOnJobDto staffOnJob) { |
| | | return R.ok(staffOnJobService.add(staffOnJob)); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @PutMapping("/{id}") |
| | | public AjaxResult update(@PathVariable("id") Long id, @RequestBody StaffOnJobDto staffOnJobDto) { |
| | | return AjaxResult.success(staffOnJobService.update(id, staffOnJobDto)); |
| | | public R<?> update(@PathVariable("id") Long id, @RequestBody StaffOnJobDto staffOnJobDto) { |
| | | return R.ok(staffOnJobService.update(id, staffOnJobDto)); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/del") |
| | | public AjaxResult delStaffOnJobs(@RequestBody List<Integer> ids) { |
| | | public R<?> delStaffOnJobs(@RequestBody List<Integer> ids) { |
| | | if(CollectionUtils.isEmpty(ids)){ |
| | | return AjaxResult.error("è¯·éæ©è³å°ä¸æ¡æ°æ®"); |
| | | return R.fail("è¯·éæ©è³å°ä¸æ¡æ°æ®"); |
| | | } |
| | | return AjaxResult.success(staffOnJobService.delStaffOnJobs(ids)); |
| | | return R.ok(staffOnJobService.delStaffOnJobs(ids)); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/{id}") |
| | | public AjaxResult staffOnJobDetail(@PathVariable("id") Long id) { |
| | | return AjaxResult.success(staffOnJobService.staffOnJobDetail(id)); |
| | | public R<?> staffOnJobDetail(@PathVariable("id") Long id) { |
| | | return R.ok(staffOnJobService.staffOnJobDetail(id)); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping("/renewContract/{id}") |
| | | public AjaxResult renewContract(@PathVariable Long id, @RequestBody StaffContract staffContract) { |
| | | return AjaxResult.success(staffOnJobService.renewContract(id, staffContract)); |
| | | public R<?> renewContract(@PathVariable Long id, @RequestBody StaffContract staffContract) { |
| | | return R.ok(staffOnJobService.renewContract(id, staffContract)); |
| | | } |
| | | |
| | | @Operation(summary = "ä¸è½½æ¨¡æ¿") |
| | |
| | | */ |
| | | @PostMapping("/import") |
| | | @Log(title = "å¨èå工导å
¥", businessType = BusinessType.IMPORT) |
| | | public AjaxResult importData(@RequestPart("file") MultipartFile file) { |
| | | public R<?> importData(@RequestPart("file") MultipartFile file) { |
| | | Boolean b = staffOnJobService.importData(file); |
| | | if (b) { |
| | | return AjaxResult.success("导å
¥æå"); |
| | | return R.ok(null, "导å
¥æå"); |
| | | } |
| | | return AjaxResult.error("导å
¥å¤±è´¥"); |
| | | return R.fail("导å
¥å¤±è´¥"); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @PostMapping("/exportCopy") |
| | | @Operation(summary = "word模æ¿ååå¨èå工导åº") |
| | | public AjaxResult exportCopy(HttpServletResponse response,@RequestBody StaffOnJob staffOnJob) throws Exception{ |
| | | return AjaxResult.success(staffOnJobService.exportCopy(response, staffOnJob)); |
| | | public R<?> exportCopy(HttpServletResponse response,@RequestBody StaffOnJob staffOnJob) throws Exception{ |
| | | return R.ok(staffOnJobService.exportCopy(response, staffOnJob)); |
| | | } |
| | | |
| | | |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.staff.dto.CalculateSalaryDto; |
| | | import com.ruoyi.staff.pojo.StaffSalaryMain; |
| | | import com.ruoyi.staff.service.StaffSalaryMainService; |
| | |
| | | @RestController |
| | | @RequestMapping("/staffSalaryMain") |
| | | @AllArgsConstructor |
| | | public class StaffSalaryMainController { |
| | | public class StaffSalaryMainController extends BaseController { |
| | | |
| | | private StaffSalaryMainService staffSalaryMainService; |
| | | |
| | | @GetMapping("/listPage") |
| | | @Operation(summary = "å工工èµä¸»è¡¨å页æ¥è¯¢") |
| | | public AjaxResult listPage(Page page, StaffSalaryMain staffSalaryMain) { |
| | | public R<?> listPage(Page page, StaffSalaryMain staffSalaryMain) { |
| | | return staffSalaryMainService.listPage(page, staffSalaryMain); |
| | | } |
| | | |
| | | @Operation(summary = "éè¿é¨é¨idsè·åç¨æ·ä¿¡æ¯è®¡ç®æ¯ä¸ªåå·¥çå·¥èµ") |
| | | @PostMapping("/calculateSalary") |
| | | public AjaxResult calculateSalary(@RequestBody CalculateSalaryDto calculateSalaryDto) { |
| | | public R<?> calculateSalary(@RequestBody CalculateSalaryDto calculateSalaryDto) { |
| | | return staffSalaryMainService.calculateSalary(calculateSalaryDto); |
| | | } |
| | | |
| | |
| | | @Operation(summary = "æ°å»ºå·¥èµè¡¨") |
| | | @Log(title = "æ°å»ºå·¥èµè¡¨", businessType = BusinessType.INSERT) |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult add(@RequestBody StaffSalaryMain staffSalaryMain) { |
| | | public R<?> add(@RequestBody StaffSalaryMain staffSalaryMain) { |
| | | return staffSalaryMainService.add(staffSalaryMain); |
| | | } |
| | | |
| | |
| | | @Operation(summary = "ä¿®æ¹å·¥èµè¡¨") |
| | | @Log(title = "ä¿®æ¹å·¥èµè¡¨", businessType = BusinessType.UPDATE) |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult updateStaffSalaryMain(@RequestBody StaffSalaryMain staffSalaryMain) { |
| | | public R<?> updateStaffSalaryMain(@RequestBody StaffSalaryMain staffSalaryMain) { |
| | | return staffSalaryMainService.updateStaffSalaryMain(staffSalaryMain); |
| | | } |
| | | |
| | |
| | | @Operation(summary = "å é¤å·¥èµè¡¨") |
| | | @Log(title = "å é¤å·¥èµè¡¨", businessType = BusinessType.DELETE) |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult delete(@RequestBody List<Long> ids) { |
| | | public R<?> delete(@RequestBody List<Long> ids) { |
| | | return staffSalaryMainService.delete(ids); |
| | | } |
| | | |
| | |
| | | import com.ruoyi.compensationperformance.pojo.CompensationPerformance; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.staff.dto.SaveStaffSchedulingDto; |
| | | import com.ruoyi.staff.dto.StaffSchedulingDto; |
| | | import com.ruoyi.staff.service.StaffSchedulingService; |
| | |
| | | @RestController |
| | | @RequestMapping("/staff/staffScheduling") |
| | | @RequiredArgsConstructor |
| | | public class StaffSchedulingController { |
| | | public class StaffSchedulingController extends BaseController { |
| | | |
| | | private final StaffSchedulingService staffSchedulingService; |
| | | |
| | | @PostMapping("/listPage") |
| | | public AjaxResult listPage(@RequestBody SearchSchedulingVo vo){ |
| | | return AjaxResult.success(staffSchedulingService.listPage(vo)); |
| | | public R<?> listPage(@RequestBody SearchSchedulingVo vo){ |
| | | return R.ok(staffSchedulingService.listPage(vo)); |
| | | } |
| | | |
| | | @PostMapping("/save") |
| | | public AjaxResult save(@RequestBody @Validated SaveStaffSchedulingDto saveStaffSchedulingDto){ |
| | | public R<?> save(@RequestBody @Validated SaveStaffSchedulingDto saveStaffSchedulingDto){ |
| | | staffSchedulingService.saveStaffScheduling(saveStaffSchedulingDto); |
| | | return AjaxResult.success(); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @DeleteMapping("/delByIds") |
| | | public AjaxResult delByIds(@RequestBody List<Integer> ids){ |
| | | public R<?> delByIds(@RequestBody List<Integer> ids){ |
| | | staffSchedulingService.removeByIds(ids); |
| | | return AjaxResult.success(); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @DeleteMapping("/del/{id}") |
| | | public AjaxResult del(@PathVariable("id") Integer id){ |
| | | public R<?> del(@PathVariable("id") Integer id){ |
| | | staffSchedulingService.removeById(id); |
| | | return AjaxResult.success(); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * è·åå½åç¨æ·ææ°æçè®°å½ |
| | | */ |
| | | @GetMapping("/getCurrentUserLatestScheduling") |
| | | public AjaxResult getCurrentUserLatestScheduling(){ |
| | | return AjaxResult.success(staffSchedulingService.getCurrentUserLatestScheduling()); |
| | | public R<?> getCurrentUserLatestScheduling(){ |
| | | return R.ok(staffSchedulingService.getCurrentUserLatestScheduling()); |
| | | } |
| | | |
| | | @Log(title = "导åºäººåæçå表", businessType = BusinessType.EXPORT) |
| | |
| | | package com.ruoyi.staff.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.staff.pojo.SchemeApplicableStaff; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | |
| | | */ |
| | | public interface SchemeApplicableStaffService extends IService<SchemeApplicableStaff> { |
| | | |
| | | AjaxResult listPage(Page page, SchemeApplicableStaff schemeApplicableStaff); |
| | | R<?> listPage(Page page, SchemeApplicableStaff schemeApplicableStaff); |
| | | |
| | | AjaxResult add(SchemeApplicableStaff schemeApplicableStaff); |
| | | R<?> add(SchemeApplicableStaff schemeApplicableStaff); |
| | | |
| | | AjaxResult updateSchemeApplicableStaff(SchemeApplicableStaff schemeApplicableStaff); |
| | | R<?> updateSchemeApplicableStaff(SchemeApplicableStaff schemeApplicableStaff); |
| | | |
| | | AjaxResult delete(List<Long> ids); |
| | | R<?> delete(List<Long> ids); |
| | | } |
| | |
| | | package com.ruoyi.staff.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.staff.dto.CalculateSalaryDto; |
| | | import com.ruoyi.staff.pojo.StaffSalaryMain; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | |
| | | */ |
| | | public interface StaffSalaryMainService extends IService<StaffSalaryMain> { |
| | | |
| | | AjaxResult listPage(Page page, StaffSalaryMain staffSalaryMain); |
| | | R listPage(Page page, StaffSalaryMain staffSalaryMain); |
| | | |
| | | AjaxResult add(StaffSalaryMain staffSalaryMain); |
| | | R<?> add(StaffSalaryMain staffSalaryMain); |
| | | |
| | | AjaxResult updateStaffSalaryMain(StaffSalaryMain staffSalaryMain); |
| | | R<?> updateStaffSalaryMain(StaffSalaryMain staffSalaryMain); |
| | | |
| | | AjaxResult delete(List<Long> ids); |
| | | R<?> delete(List<Long> ids); |
| | | |
| | | AjaxResult calculateSalary(CalculateSalaryDto calculateSalaryDto); |
| | | R<?> calculateSalary(CalculateSalaryDto calculateSalaryDto); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.production.bean.dto.UserAccountDto; |
| | | import com.ruoyi.production.bean.dto.UserProductionAccountingDto; |
| | | import com.ruoyi.production.service.SalesLedgerProductionAccountingService; |
| | |
| | | |
| | | |
| | | @Override |
| | | public AjaxResult listPage(Page page, SchemeApplicableStaff schemeApplicableStaff) { |
| | | public R<?> listPage(Page page, SchemeApplicableStaff schemeApplicableStaff) { |
| | | LambdaQueryWrapper<SchemeApplicableStaff> schemeApplicableStaffLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | if(schemeApplicableStaff != null){ |
| | | if(StringUtils.isNotEmpty(schemeApplicableStaff.getTitle())){ |
| | |
| | | Page<SchemeApplicableStaff> page1 = schemeApplicableStaffMapper.selectPage(page, schemeApplicableStaffLambdaQueryWrapper); |
| | | List<Long> collect = page1.getRecords().stream().map(SchemeApplicableStaff::getId).collect(Collectors.toList()); |
| | | if(CollectionUtils.isEmpty(collect)){ |
| | | return AjaxResult.success(page1); |
| | | return R.ok(page1); |
| | | } |
| | | List<SchemeInsuranceDetail> schemeInsuranceDetails = schemeInsuranceDetailMapper |
| | | .selectList(new LambdaQueryWrapper<SchemeInsuranceDetail>() |
| | |
| | | item.setDeptNames(sysDepts.stream().map(SysDept::getDeptName).collect(Collectors.joining(","))); |
| | | } |
| | | }); |
| | | return AjaxResult.success(page1); |
| | | return R.ok(page1); |
| | | } |
| | | |
| | | public void setSchemeApplicableStaffUserInfo(SchemeApplicableStaff schemeApplicableStaff) { |
| | |
| | | } |
| | | |
| | | @Override |
| | | public AjaxResult add(SchemeApplicableStaff schemeApplicableStaff) { |
| | | public R<?> add(SchemeApplicableStaff schemeApplicableStaff) { |
| | | if(schemeApplicableStaff == null){ |
| | | return AjaxResult.error("åæ°é误"); |
| | | return R.fail("åæ°é误"); |
| | | } |
| | | if(CollectionUtils.isEmpty(schemeApplicableStaff.getSchemeInsuranceDetailList())){ |
| | | return AjaxResult.error("è¯·éæ©æ¹æ¡æç»"); |
| | | return R.fail("è¯·éæ©æ¹æ¡æç»"); |
| | | } |
| | | setSchemeApplicableStaffUserInfo(schemeApplicableStaff); //æ ¹æ®é¨é¨è®¾ç½®ç¨æ·ä¿¡æ¯ |
| | | int insert = schemeApplicableStaffMapper.insert(schemeApplicableStaff); |
| | |
| | | item.setSchemeId(schemeApplicableStaff.getId()); |
| | | schemeInsuranceDetailMapper.insert(item); |
| | | }); |
| | | return AjaxResult.success(insert); |
| | | return R.ok(insert); |
| | | } |
| | | |
| | | @Override |
| | | public AjaxResult updateSchemeApplicableStaff(SchemeApplicableStaff schemeApplicableStaff) { |
| | | public R<?> updateSchemeApplicableStaff(SchemeApplicableStaff schemeApplicableStaff) { |
| | | if(schemeApplicableStaff == null){ |
| | | return AjaxResult.error("åæ°é误"); |
| | | return R.fail("åæ°é误"); |
| | | } |
| | | setSchemeApplicableStaffUserInfo(schemeApplicableStaff); //æ ¹æ®é¨é¨è®¾ç½®ç¨æ·ä¿¡æ¯ |
| | | int update = schemeApplicableStaffMapper.updateById(schemeApplicableStaff); |
| | |
| | | item.setSchemeId(schemeApplicableStaff.getId()); |
| | | schemeInsuranceDetailMapper.insert(item); |
| | | }); |
| | | return AjaxResult.success(update); |
| | | return R.ok(update); |
| | | } |
| | | |
| | | @Override |
| | | public AjaxResult delete(List<Long> ids) { |
| | | public R<?> delete(List<Long> ids) { |
| | | if (CollectionUtils.isEmpty(ids)) { |
| | | return AjaxResult.error("åæ°é误"); |
| | | return R.fail("åæ°é误"); |
| | | } |
| | | int delete = schemeApplicableStaffMapper.deleteBatchIds(ids); |
| | | schemeInsuranceDetailMapper.delete(new LambdaQueryWrapper<SchemeInsuranceDetail>() |
| | | .in(SchemeInsuranceDetail::getSchemeId, ids)); |
| | | return AjaxResult.success(delete); |
| | | return R.ok(delete); |
| | | } |
| | | |
| | | /** |
| | |
| | | import com.ruoyi.account.pojo.AccountExpense; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.project.system.mapper.SysUserDeptMapper; |
| | | import com.ruoyi.staff.dto.CalculateSalaryDto; |
| | | import com.ruoyi.staff.mapper.StaffLeaveMapper; |
| | |
| | | private final AccountExpenseMapper accountExpenseMapper; |
| | | |
| | | @Override |
| | | public AjaxResult listPage(Page page, StaffSalaryMain staffSalaryMain) { |
| | | public R<?> listPage(Page page, StaffSalaryMain staffSalaryMain) { |
| | | LambdaQueryWrapper<StaffSalaryMain> staffSalaryMainLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | if(staffSalaryMain != null){ |
| | | if(StringUtils.isNotEmpty(staffSalaryMain.getSalaryTitle())){ |
| | |
| | | List<StaffSalaryDetail> staffSalaryDetailList = staffSalaryDetailMapper.selectList(new LambdaQueryWrapper<StaffSalaryDetail>().eq(StaffSalaryDetail::getMainId, main.getId())); |
| | | main.setStaffSalaryDetailList(staffSalaryDetailList); |
| | | }); |
| | | return AjaxResult.success(page1); |
| | | return R.ok(page1); |
| | | } |
| | | |
| | | @Override |
| | | public AjaxResult add(StaffSalaryMain staffSalaryMain) { |
| | | public R<?> add(StaffSalaryMain staffSalaryMain) { |
| | | staffSalaryMainMapper.insert(staffSalaryMain); |
| | | staffSalaryMain.getStaffSalaryDetailList().forEach(detail -> { |
| | | detail.setMainId(staffSalaryMain.getId()); |
| | | }); |
| | | staffSalaryDetailService.saveBatch(staffSalaryMain.getStaffSalaryDetailList()); |
| | | return AjaxResult.success("æ°å¢æå"); |
| | | return R.ok(null, "æ°å¢æå"); |
| | | } |
| | | |
| | | @Override |
| | | public AjaxResult updateStaffSalaryMain(StaffSalaryMain staffSalaryMain) { |
| | | public R<?> updateStaffSalaryMain(StaffSalaryMain staffSalaryMain) { |
| | | if(staffSalaryMain == null){ |
| | | return AjaxResult.error("åæ°é误"); |
| | | return R.fail("åæ°é误"); |
| | | } |
| | | StaffSalaryMain staffSalaryMain1 = staffSalaryMainMapper.selectById(staffSalaryMain.getId()); |
| | | if(staffSalaryMain1 == null){ |
| | | return AjaxResult.error("åæ°é误"); |
| | | return R.fail("åæ°é误"); |
| | | } |
| | | // å¾
å®¡æ ¸ä¸å¯ç¼è¾ |
| | | // if(staffSalaryMain1.getStatus() > 3){ |
| | | // return AjaxResult.error("å¾
å®¡æ ¸ä¸å¯ç¼è¾"); |
| | | // return R.fail("å¾
å®¡æ ¸ä¸å¯ç¼è¾"); |
| | | // } |
| | | staffSalaryMainMapper.updateById(staffSalaryMain); |
| | | if(org.apache.commons.collections4.CollectionUtils.isNotEmpty(staffSalaryMain.getStaffSalaryDetailList())){ |
| | |
| | | accountExpense.setInputTime(new Date()); |
| | | accountExpenseMapper.insert(accountExpense); |
| | | } |
| | | return AjaxResult.success("ä¿®æ¹æå"); |
| | | return R.ok(null, "ä¿®æ¹æå"); |
| | | } |
| | | |
| | | @Override |
| | | public AjaxResult delete(List<Long> ids) { |
| | | public R<?> delete(List<Long> ids) { |
| | | if(CollectionUtils.isEmpty(ids)){ |
| | | return AjaxResult.error("åæ°é误"); |
| | | return R.fail("åæ°é误"); |
| | | } |
| | | staffSalaryMainMapper.deleteBatchIds(ids); |
| | | staffSalaryDetailMapper.delete(new LambdaQueryWrapper<StaffSalaryDetail>().in(StaffSalaryDetail::getMainId, ids)); |
| | | return AjaxResult.success("å 餿å"); |
| | | return R.ok(null, "å 餿å"); |
| | | } |
| | | |
| | | @Override |
| | | public AjaxResult calculateSalary(CalculateSalaryDto calculateSalaryDto) { |
| | | public R<?> calculateSalary(CalculateSalaryDto calculateSalaryDto) { |
| | | if(CollectionUtils.isEmpty(calculateSalaryDto.getIds())){ |
| | | return AjaxResult.error("åæ°é误"); |
| | | return R.fail("åæ°é误"); |
| | | } |
| | | List<Map<String, Object>> longs = setSchemeApplicableStaffUserInfo(calculateSalaryDto.getIds()); // éè¿é¨é¨idsè·åç¨æ·ä¿¡æ¯ |
| | | if(CollectionUtils.isEmpty(longs)){ |
| | | return AjaxResult.error("æ åå·¥"); |
| | | return R.fail("æ åå·¥"); |
| | | } |
| | | List<Map<String, Object>> mapList = new ArrayList<>(); |
| | | for (Map<String, Object> id : longs) { |
| | |
| | | schemeApplicableStaffService.calculateByEmployeeId((Integer) id.get("id"),id,calculateSalaryDto.getDate()); |
| | | mapList.add(id); |
| | | } |
| | | return AjaxResult.success(mapList); |
| | | return R.ok(mapList); |
| | | } |
| | | |
| | | public List<Map<String, Object>> setSchemeApplicableStaffUserInfo(List<Long> ids) { |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.stock.dto.StockInRecordDto; |
| | | import com.ruoyi.stock.service.StockInRecordService; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | |
| | | @Tag(name = "å
¥åº") |
| | | @RequestMapping("/stockInRecord") |
| | | @RequiredArgsConstructor |
| | | public class StockInRecordController { |
| | | public class StockInRecordController extends BaseController { |
| | | |
| | | private final StockInRecordService stockInRecordService; |
| | | |
| | | @GetMapping("/listPage") |
| | | @Log(title = "ç产å
¥åº-å
¥åºç®¡ç-å表", businessType = BusinessType.OTHER) |
| | | @Operation(summary = "å
¥åºç®¡çå表") |
| | | public AjaxResult listPage(Page page, StockInRecordDto stockInRecordDto) { |
| | | public R<?> listPage(Page page, StockInRecordDto stockInRecordDto) { |
| | | IPage<StockInRecordDto> result = stockInRecordService.listPage(page, stockInRecordDto); |
| | | return AjaxResult.success(result); |
| | | return R.ok(result); |
| | | } |
| | | |
| | | |
| | | |
| | | @DeleteMapping("") |
| | | @Log(title = "å
¥åºç®¡ç-å é¤å
¥åº", businessType = BusinessType.DELETE) |
| | | public AjaxResult delete(@RequestBody List<Long> ids) { |
| | | public R<?> delete(@RequestBody List<Long> ids) { |
| | | if(CollectionUtils.isEmpty(ids)){ |
| | | return AjaxResult.error("è¯·éæ©è³å°ä¸æ¡æ°æ®"); |
| | | return R.fail("è¯·éæ©è³å°ä¸æ¡æ°æ®"); |
| | | } |
| | | return AjaxResult.success(stockInRecordService.batchDelete(ids)); |
| | | return R.ok(stockInRecordService.batchDelete(ids)); |
| | | } |
| | | |
| | | @DeleteMapping("/pending") |
| | | @Log(title = "å
¥åºç®¡ç-å é¤å¾
审æ¹å
¥åº", businessType = BusinessType.DELETE) |
| | | @Operation(summary = "å é¤å¾
审æ¹çå
¥åºè®°å½") |
| | | public AjaxResult deletePending(@RequestBody List<Long> ids) { |
| | | public R<?> deletePending(@RequestBody List<Long> ids) { |
| | | if(CollectionUtils.isEmpty(ids)){ |
| | | return AjaxResult.error("è¯·éæ©è³å°ä¸æ¡æ°æ®"); |
| | | return R.fail("è¯·éæ©è³å°ä¸æ¡æ°æ®"); |
| | | } |
| | | return AjaxResult.success(stockInRecordService.batchDeletePending(ids)); |
| | | return R.ok(stockInRecordService.batchDeletePending(ids)); |
| | | } |
| | | |
| | | @PostMapping("/exportStockInRecord") |
| | |
| | | @PostMapping("/approve") |
| | | @Log(title = "å
¥åºç®¡ç-审æ¹å
¥åº", businessType = BusinessType.UPDATE) |
| | | @Operation(summary = "æ¹é审æ¹å
¥åºè®°å½") |
| | | public AjaxResult approve(@RequestBody StockInRecordDto approveDto) { |
| | | public R<?> approve(@RequestBody StockInRecordDto approveDto) { |
| | | if(CollectionUtils.isEmpty(approveDto.getIds())){ |
| | | return AjaxResult.error("è¯·éæ©è³å°ä¸æ¡æ°æ®"); |
| | | return R.fail("è¯·éæ©è³å°ä¸æ¡æ°æ®"); |
| | | } |
| | | stockInRecordService.batchApprove(approveDto.getIds(), approveDto.getApprovalStatus()); |
| | | return AjaxResult.success(); |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.stock.dto.StockOutRecordDto; |
| | | import com.ruoyi.stock.service.StockOutRecordService; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | @GetMapping("/listPage") |
| | | @Log(title = "ç产åºåº-åºåºç®¡ç-å表", businessType = BusinessType.OTHER) |
| | | @Operation(summary = "åºåºç®¡çå表") |
| | | public AjaxResult listPage(Page page, StockOutRecordDto stockOutRecordDto) { |
| | | public R listPage(Page page, StockOutRecordDto stockOutRecordDto) { |
| | | IPage<StockOutRecordDto> result = stockOutRecordService.listPage(page, stockOutRecordDto); |
| | | return AjaxResult.success(result); |
| | | return R.ok(result); |
| | | } |
| | | |
| | | @PostMapping("") |
| | | @Log(title = "åºåºç®¡ç-æ°å¢åºåº", businessType = BusinessType.INSERT) |
| | | public AjaxResult add(@RequestBody StockOutRecordDto stockOutRecordDto) { |
| | | return AjaxResult.success(stockOutRecordService.add(stockOutRecordDto)); |
| | | public R add(@RequestBody StockOutRecordDto stockOutRecordDto) { |
| | | return R.ok(stockOutRecordService.add(stockOutRecordDto)); |
| | | } |
| | | |
| | | @PutMapping("/{id}") |
| | | @Log(title = "åºåºç®¡ç-æ´æ°åºåº", businessType = BusinessType.UPDATE) |
| | | public AjaxResult update(@PathVariable("id") Long id, @RequestBody StockOutRecordDto stockOutRecordDto) { |
| | | return AjaxResult.success(stockOutRecordService.update(id, stockOutRecordDto)); |
| | | public R update(@PathVariable("id") Long id, @RequestBody StockOutRecordDto stockOutRecordDto) { |
| | | return R.ok(stockOutRecordService.update(id, stockOutRecordDto)); |
| | | } |
| | | |
| | | @DeleteMapping("") |
| | | @Log(title = "åºåºç®¡ç-å é¤åºåº", businessType = BusinessType.DELETE) |
| | | public AjaxResult delete(@RequestBody List<Long> ids) { |
| | | public R delete(@RequestBody List<Long> ids) { |
| | | if(CollectionUtils.isEmpty(ids)){ |
| | | return AjaxResult.error("è¯·éæ©è³å°ä¸æ¡æ°æ®"); |
| | | return R.fail("è¯·éæ©è³å°ä¸æ¡æ°æ®"); |
| | | } |
| | | return AjaxResult.success(stockOutRecordService.batchDelete(ids)); |
| | | return R.ok(stockOutRecordService.batchDelete(ids)); |
| | | } |
| | | |
| | | @DeleteMapping("/pending") |
| | | @Log(title = "åºåºç®¡ç-å é¤å¾
审æ¹åºåº", businessType = BusinessType.DELETE) |
| | | @Operation(summary = "å é¤å¾
审æ¹çåºåºè®°å½") |
| | | public AjaxResult deletePending(@RequestBody List<Long> ids) { |
| | | public R deletePending(@RequestBody List<Long> ids) { |
| | | if(CollectionUtils.isEmpty(ids)){ |
| | | return AjaxResult.error("è¯·éæ©è³å°ä¸æ¡æ°æ®"); |
| | | return R.fail("è¯·éæ©è³å°ä¸æ¡æ°æ®"); |
| | | } |
| | | return AjaxResult.success(stockOutRecordService.batchDeletePending(ids)); |
| | | return R.ok(stockOutRecordService.batchDeletePending(ids)); |
| | | } |
| | | |
| | | @PostMapping("/exportStockOutRecord") |
| | |
| | | @PostMapping("/approve") |
| | | @Log(title = "åºåºç®¡ç-审æ¹åºåº", businessType = BusinessType.UPDATE) |
| | | @Operation(summary = "æ¹é审æ¹åºåºè®°å½") |
| | | public AjaxResult approve(@RequestBody StockOutRecordDto approveDto) { |
| | | public R approve(@RequestBody StockOutRecordDto approveDto) { |
| | | if(CollectionUtils.isEmpty(approveDto.getIds())){ |
| | | return AjaxResult.error("è¯·éæ©è³å°ä¸æ¡æ°æ®"); |
| | | return R.fail("è¯·éæ©è³å°ä¸æ¡æ°æ®"); |
| | | } |
| | | stockOutRecordService.batchApprove(approveDto.getIds(), approveDto.getApprovalStatus()); |
| | | return AjaxResult.success(); |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | @Schema(description = "产åid") |
| | | private Long productId; |
| | | |
| | | @Schema(description = "æ¹æ¬¡å·") |
| | | private String batchNo; |
| | | } |
| | |
| | | |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.technology.bean.dto.TechnologyOperationParamDto; |
| | | import com.ruoyi.technology.bean.vo.TechnologyOperationParamVo; |
| | |
| | | @RequestMapping("/technologyOperationParam") |
| | | @Tag(name = "å·¥åºåæ°") |
| | | @RequiredArgsConstructor |
| | | public class TechnologyOperationParamController { |
| | | public class TechnologyOperationParamController extends BaseController { |
| | | |
| | | private final TechnologyOperationParamService technologyOperationParamService; |
| | | |
| | |
| | | @DeleteMapping("/batchDelete/{id}") |
| | | @Log(title = "Delete technology operation param", businessType = BusinessType.DELETE) |
| | | @Operation(summary = "å é¤å·¥åºåæ°") |
| | | public AjaxResult batchDelete(@PathVariable("id") Long id) { |
| | | return AjaxResult.success(technologyOperationParamService.batchDelete(id)); |
| | | public R<?> batchDelete(@PathVariable("id") Long id) { |
| | | return R.ok(technologyOperationParamService.batchDelete(id)); |
| | | } |
| | | } |
| | |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.warehouse.pojo.DocumentClassification; |
| | | import com.ruoyi.warehouse.service.DocumentClassificationService; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | |
| | | |
| | | //æ ç»æ |
| | | @GetMapping("/getList") |
| | | public AjaxResult getList() { |
| | | return AjaxResult.success(documentClassificationService.selectDocumentClassificationList()); |
| | | public R<?> getList() { |
| | | return R.ok(documentClassificationService.selectDocumentClassificationList()); |
| | | } |
| | | |
| | | @PostMapping("/add") |
| | | @Operation(summary = "ææ¡£åç±»-æ·»å ") |
| | | @Log(title = "ææ¡£åç±»-æ·»å ", businessType = BusinessType.INSERT) |
| | | public AjaxResult add(@RequestBody DocumentClassification documentClassification) { |
| | | return AjaxResult.success(documentClassificationService.save(documentClassification)); |
| | | public R<?> add(@RequestBody DocumentClassification documentClassification) { |
| | | return R.ok(documentClassificationService.save(documentClassification)); |
| | | } |
| | | |
| | | @PutMapping("/update") |
| | | @Operation(summary = "ææ¡£åç±»-æ´æ°") |
| | | @Log(title = "ææ¡£åç±»-æ´æ°", businessType = BusinessType.UPDATE) |
| | | public AjaxResult update(@RequestBody DocumentClassification documentClassification) { |
| | | return AjaxResult.success(documentClassificationService.updateById(documentClassification)); |
| | | public R<?> update(@RequestBody DocumentClassification documentClassification) { |
| | | return R.ok(documentClassificationService.updateById(documentClassification)); |
| | | } |
| | | |
| | | @DeleteMapping("/delete") |
| | | @Operation(summary = "ææ¡£åç±»å é¤") |
| | | @Log(title = "ææ¡£åç±»å é¤", businessType = BusinessType.DELETE) |
| | | public AjaxResult delete(@RequestBody List<Long> ids) { |
| | | if (CollectionUtils.isEmpty(ids)) return AjaxResult.error("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | return AjaxResult.success(documentClassificationService.deleteByIds(ids)); |
| | | public R<?> delete(@RequestBody List<Long> ids) { |
| | | if (CollectionUtils.isEmpty(ids)) return R.fail("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | return R.ok(documentClassificationService.deleteByIds(ids)); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.warehouse.mapper.DocumentationReturnManagementMapper; |
| | | import com.ruoyi.warehouse.pojo.DocumentationBorrowManagement; |
| | | import com.ruoyi.warehouse.pojo.DocumentationReturnManagement; |
| | |
| | | @GetMapping("/listPage") |
| | | @Operation(summary = "ææ¡£åé
管ç-åé
å页æ¥è¯¢") |
| | | @Log(title = "ææ¡£åé
管ç-åé
å页æ¥è¯¢", businessType = BusinessType.OTHER) |
| | | public AjaxResult listPage(Page page, DocumentationBorrowManagement documentationBorrowManagement) { |
| | | return AjaxResult.success(documentationBorrowManagementService.listPage(page, documentationBorrowManagement)); |
| | | public R<?> listPage(Page page, DocumentationBorrowManagement documentationBorrowManagement) { |
| | | return R.ok(documentationBorrowManagementService.listPage(page, documentationBorrowManagement)); |
| | | } |
| | | @GetMapping("/list") |
| | | @Operation(summary = "ææ¡£åé
管ç-åé
æ¥è¯¢") |
| | | @Log(title = "ææ¡£åé
管ç-åé
æ¥è¯¢", businessType = BusinessType.OTHER) |
| | | public AjaxResult list() { |
| | | return AjaxResult.success(documentationBorrowManagementService.listAll()); |
| | | public R<?> list() { |
| | | return R.ok(documentationBorrowManagementService.listAll()); |
| | | } |
| | | @GetMapping("/listPageReturn") |
| | | @Operation(summary = "ææ¡£åé
管ç-å½è¿å页æ¥è¯¢") |
| | | @Log(title = "ææ¡£åé
管ç-å½è¿å页æ¥è¯¢", businessType = BusinessType.OTHER) |
| | | public AjaxResult listPageReturn(Page page, DocumentationReturnManagement documentationReturnManagement) { |
| | | return AjaxResult.success(documentationReturnManagementMapper.listPage(page, documentationReturnManagement)); |
| | | public R<?> listPageReturn(Page page, DocumentationReturnManagement documentationReturnManagement) { |
| | | return R.ok(documentationReturnManagementMapper.listPage(page, documentationReturnManagement)); |
| | | } |
| | | @GetMapping("/getByDocumentationId/{id}") |
| | | @Operation(summary = "æ ¹æ®ä¹¦ç±idæ¥è¯¢åé
è®°å½") |
| | | @Log(title = "æ ¹æ®ä¹¦ç±idæ¥è¯¢åé
è®°å½", businessType = BusinessType.OTHER) |
| | | public AjaxResult getByDocumentationId(@PathVariable Long id) { |
| | | return AjaxResult.success(documentationBorrowManagementService.selectByDocumentationId(id)); |
| | | public R<?> getByDocumentationId(@PathVariable Long id) { |
| | | return R.ok(documentationBorrowManagementService.selectByDocumentationId(id)); |
| | | } |
| | | @PostMapping("/add") |
| | | @Operation(summary = "ææ¡£åé
管ç-åé
") |
| | | @Log(title = "ææ¡£åé
管ç-åé
", businessType = BusinessType.INSERT) |
| | | public AjaxResult add(@RequestBody DocumentationBorrowManagement documentationBorrowManagement) { |
| | | return AjaxResult.success(documentationBorrowManagementService.add(documentationBorrowManagement)); |
| | | public R<?> add(@RequestBody DocumentationBorrowManagement documentationBorrowManagement) { |
| | | return R.ok(documentationBorrowManagementService.add(documentationBorrowManagement)); |
| | | } |
| | | @PutMapping("/revent") |
| | | @Operation(summary = "ææ¡£åé
管ç-å½è¿") |
| | | @Log(title = "ææ¡£åé
管ç-å½è¿", businessType = BusinessType.UPDATE) |
| | | public AjaxResult revent(@RequestBody DocumentationReturnManagement documentationReturnManagement) { |
| | | return AjaxResult.success(documentationBorrowManagementService.reventdbm(documentationReturnManagement)); |
| | | public R<?> revent(@RequestBody DocumentationReturnManagement documentationReturnManagement) { |
| | | return R.ok(documentationBorrowManagementService.reventdbm(documentationReturnManagement)); |
| | | } |
| | | @PutMapping("/update") |
| | | @Operation(summary = "ææ¡£åé
管ç-æ´æ°") |
| | | @Log(title = "ææ¡£åé
管ç-æ´æ°", businessType = BusinessType.UPDATE) |
| | | public AjaxResult update(@RequestBody DocumentationBorrowManagement documentationBorrowManagement) { |
| | | return AjaxResult.success(documentationBorrowManagementService.updateById(documentationBorrowManagement)); |
| | | public R<?> update(@RequestBody DocumentationBorrowManagement documentationBorrowManagement) { |
| | | return R.ok(documentationBorrowManagementService.updateById(documentationBorrowManagement)); |
| | | } |
| | | @PutMapping("/reventUpdate") |
| | | @Operation(summary = "ææ¡£åé
管ç-å½è¿æ´æ°") |
| | | @Log(title = "ææ¡£åé
管ç-å½è¿æ´æ°", businessType = BusinessType.UPDATE) |
| | | public AjaxResult reventupdate(@RequestBody DocumentationReturnManagement documentationReturnManagement) { |
| | | return AjaxResult.success(documentationReturnManagementMapper.updateById(documentationReturnManagement)); |
| | | public R<?> reventupdate(@RequestBody DocumentationReturnManagement documentationReturnManagement) { |
| | | return R.ok(documentationReturnManagementMapper.updateById(documentationReturnManagement)); |
| | | } |
| | | @DeleteMapping ("/delete") |
| | | @Operation(summary = "ææ¡£åé
管ç-åé
å é¤") |
| | | @Log(title = "ææ¡£åé
管ç-åé
å é¤", businessType = BusinessType.DELETE) |
| | | public AjaxResult delete(@RequestBody List<Long> ids) { |
| | | if(CollectionUtils.isEmpty(ids)) return AjaxResult.error("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | return AjaxResult.success(documentationBorrowManagementService.deleteByIds(ids)); |
| | | public R<?> delete(@RequestBody List<Long> ids) { |
| | | if(CollectionUtils.isEmpty(ids)) return R.fail("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | return R.ok(documentationBorrowManagementService.deleteByIds(ids)); |
| | | } |
| | | @DeleteMapping ("/reventDelete") |
| | | @Operation(summary = "ææ¡£åé
管ç-å½è¿å é¤") |
| | | @Log(title = "ææ¡£åé
管ç-å½è¿å é¤", businessType = BusinessType.DELETE) |
| | | public AjaxResult reventdelete(@RequestBody List<Long> ids) { |
| | | if(CollectionUtils.isEmpty(ids)) return AjaxResult.error("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | return AjaxResult.success(documentationBorrowManagementService.reventDeleteByIds(ids)); |
| | | public R<?> reventdelete(@RequestBody List<Long> ids) { |
| | | if(CollectionUtils.isEmpty(ids)) return R.fail("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | return R.ok(documentationBorrowManagementService.reventDeleteByIds(ids)); |
| | | } |
| | | @PostMapping("/export") |
| | | @Operation(summary = "ææ¡£åé
管ç-åé
导åº") |
| | |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.warehouse.dto.DocumentationDto; |
| | | import com.ruoyi.warehouse.pojo.Documentation; |
| | | import com.ruoyi.warehouse.service.DocumentationService; |
| | |
| | | @GetMapping("/listPage") |
| | | @Operation(summary = "ææ¡£ä¿¡æ¯è¡¨-å页æ¥è¯¢") |
| | | @Log(title = "ææ¡£ä¿¡æ¯è¡¨-å页æ¥è¯¢", businessType = BusinessType.OTHER) |
| | | public AjaxResult listPage(Page page, Documentation documentation) { |
| | | public R<?> listPage(Page page, Documentation documentation) { |
| | | IPage<DocumentationDto> list = documentationService.listPage(page, documentation); |
| | | return AjaxResult.success(list); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | @GetMapping("/list") |
| | | @Operation(summary = "ææ¡£ä¿¡æ¯è¡¨æ¥è¯¢") |
| | | @Log(title = "ææ¡£ä¿¡æ¯è¡¨æ¥è¯¢", businessType = BusinessType.OTHER) |
| | | public AjaxResult list() { |
| | | public R<?> list() { |
| | | List<DocumentationDto> list = documentationService.listAll(); |
| | | return AjaxResult.success(list); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | @PostMapping("/add") |
| | | @Operation(summary = "ææ¡£ä¿¡æ¯è¡¨-æ·»å ") |
| | | @Log(title = "ææ¡£ä¿¡æ¯è¡¨-æ·»å ", businessType = BusinessType.INSERT) |
| | | public AjaxResult add(@RequestBody Documentation documentation) { |
| | | return AjaxResult.success(documentationService.save(documentation)); |
| | | public R<?> add(@RequestBody Documentation documentation) { |
| | | return R.ok(documentationService.save(documentation)); |
| | | } |
| | | |
| | | @PutMapping("/update") |
| | | @Operation(summary = "ææ¡£ä¿¡æ¯è¡¨-æ´æ°") |
| | | @Log(title = "ææ¡£ä¿¡æ¯è¡¨-æ´æ°", businessType = BusinessType.UPDATE) |
| | | public AjaxResult update(@RequestBody Documentation documentation) { |
| | | return AjaxResult.success(documentationService.updateById(documentation)); |
| | | public R<?> update(@RequestBody Documentation documentation) { |
| | | return R.ok(documentationService.updateById(documentation)); |
| | | } |
| | | |
| | | @DeleteMapping("/delete") |
| | | @Operation(summary = "ææ¡£ä¿¡æ¯è¡¨-å é¤") |
| | | @Log(title = "ææ¡£ä¿¡æ¯è¡¨-å é¤", businessType = BusinessType.DELETE) |
| | | public AjaxResult delete(@RequestBody List<Long> ids) { |
| | | if (CollectionUtils.isEmpty(ids)) return AjaxResult.error("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | return AjaxResult.success(documentationService.deleteByIds(ids)); |
| | | public R<?> delete(@RequestBody List<Long> ids) { |
| | | if (CollectionUtils.isEmpty(ids)) return R.fail("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | return R.ok(documentationService.deleteByIds(ids)); |
| | | } |
| | | |
| | | @PostMapping("/export") |
| | |
| | | |
| | | @Operation(summary = "ææ¡£ä¿¡æ¯è¡¨-ç»è®¡") |
| | | @GetMapping("/overview") |
| | | public AjaxResult getOverviewStatistics() { |
| | | public R<?> getOverviewStatistics() { |
| | | Map<String, Object> result = new HashMap<>(); |
| | | result.put("totalDocsCount", documentationService.getTotalDocsCount()); |
| | | result.put("categoryNumCount", documentationService.getCategoryNumCount()); |
| | | result.put("borrowedDocsCount", documentationService.getBorrowedDocsCount()); |
| | | result.put("monthlyAddedDocsCount", documentationService.getMonthlyAddedDocsCount()); |
| | | return AjaxResult.success(result); |
| | | return R.ok(result); |
| | | } |
| | | |
| | | @Operation(summary = "ææ¡£ä¿¡æ¯è¡¨-åç±»ç»è®¡") |
| | | @GetMapping("/category") |
| | | public AjaxResult getCategoryDistribution() { |
| | | return AjaxResult.success(documentationService.getCategoryDistribution()); |
| | | public R<?> getCategoryDistribution() { |
| | | return R.ok(documentationService.getCategoryDistribution()); |
| | | } |
| | | |
| | | @Operation(summary = "ææ¡£ä¿¡æ¯è¡¨-ç¶æç»è®¡") |
| | | @GetMapping("/status") |
| | | public AjaxResult getStatusDistribution() { |
| | | return AjaxResult.success(documentationService.getStatusDistribution()); |
| | | public R<?> getStatusDistribution() { |
| | | return R.ok(documentationService.getStatusDistribution()); |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.account.pojo.AccountFile; |
| | | import com.ruoyi.account.service.AccountFileService; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.warehouse.pojo.DocumentationFile; |
| | | import com.ruoyi.warehouse.service.DocumentationFileService; |
| | | import org.springframework.util.CollectionUtils; |
| | |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/documentation/documentationFile") |
| | | public class DocumentationFileController { |
| | | public class DocumentationFileController extends BaseController { |
| | | |
| | | |
| | | @Resource |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping("/add") |
| | | public AjaxResult add(@RequestBody DocumentationFile documentationFile) { |
| | | return AjaxResult.success(documentationFileService.save(documentationFile)); |
| | | public R<?> add(@RequestBody DocumentationFile documentationFile) { |
| | | return R.ok(documentationFileService.save(documentationFile)); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/del") |
| | | public AjaxResult delDocumentationFile(@RequestBody List<Long> ids) { |
| | | public R<?> delDocumentationFile(@RequestBody List<Long> ids) { |
| | | if(CollectionUtils.isEmpty(ids)){ |
| | | return AjaxResult.error("è¯·éæ©è³å°ä¸æ¡æ°æ®"); |
| | | return R.fail("è¯·éæ©è³å°ä¸æ¡æ°æ®"); |
| | | } |
| | | //å 餿£éªéä»¶ |
| | | return AjaxResult.success(documentationFileService.removeBatchByIds(ids)); |
| | | return R.ok(documentationFileService.removeBatchByIds(ids)); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/listPage") |
| | | public AjaxResult documentationFileListPage(DocumentationFile documentationFile) { |
| | | return AjaxResult.success(documentationFileService.documentationFileListPage( documentationFile)); |
| | | public R<?> documentationFileListPage(DocumentationFile documentationFile) { |
| | | return R.ok(documentationFileService.documentationFileListPage( documentationFile)); |
| | | } |
| | | |
| | | |
| | |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.warehouse.pojo.Warehouse; |
| | | import com.ruoyi.warehouse.service.WarehouseService; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | |
| | | @GetMapping("/tree") |
| | | @Operation(summary = "ä»åº-æ¥è¯¢æ ") |
| | | @Log(title = "ä»åº-æ¥è¯¢æ ", businessType = BusinessType.OTHER) |
| | | public AjaxResult listTree() { |
| | | return AjaxResult.success(warehouseService.findListTree()); |
| | | public R<?> listTree() { |
| | | return R.ok(warehouseService.findListTree()); |
| | | } |
| | | |
| | | @GetMapping("/list") |
| | | @Operation(summary = "ä»åº-æ¥è¯¢") |
| | | @Log(title = "ä»åº-æ¥è¯¢", businessType = BusinessType.OTHER) |
| | | public AjaxResult list(Warehouse warehouse) { |
| | | return AjaxResult.success(warehouseService.findList(warehouse)); |
| | | public R<?> list(Warehouse warehouse) { |
| | | return R.ok(warehouseService.findList(warehouse)); |
| | | } |
| | | |
| | | @PostMapping("/add") |
| | | @Operation(summary = "ä»åº-æ·»å ") |
| | | @Log(title = "ä»åº-æ·»å ", businessType = BusinessType.INSERT) |
| | | public AjaxResult add(@RequestBody Warehouse warehouse) { |
| | | return AjaxResult.success(warehouseService.save(warehouse)); |
| | | public R<?> add(@RequestBody Warehouse warehouse) { |
| | | return R.ok(warehouseService.save(warehouse)); |
| | | } |
| | | |
| | | @PutMapping("/update") |
| | | @Operation(summary = "ä»åº-æ´æ°") |
| | | @Log(title = "ä»åº-æ´æ°", businessType = BusinessType.UPDATE) |
| | | public AjaxResult update(@RequestBody Warehouse warehouse) { |
| | | return AjaxResult.success(warehouseService.updateById(warehouse)); |
| | | public R<?> update(@RequestBody Warehouse warehouse) { |
| | | return R.ok(warehouseService.updateById(warehouse)); |
| | | } |
| | | |
| | | @DeleteMapping("/delete") |
| | | @Operation(summary = "ä»åº-å é¤") |
| | | @Log(title = "ä»åº-å é¤", businessType = BusinessType.DELETE) |
| | | public AjaxResult delete(@RequestBody List<Long> ids) { |
| | | if (CollectionUtils.isEmpty(ids)) return AjaxResult.error("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | return AjaxResult.success(warehouseService.deleteByIds(ids)); |
| | | public R<?> delete(@RequestBody List<Long> ids) { |
| | | if (CollectionUtils.isEmpty(ids)) return R.fail("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | return R.ok(warehouseService.deleteByIds(ids)); |
| | | } |
| | | } |
| | |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.warehouse.dto.WarehouseGoodsShelvesDto; |
| | | import com.ruoyi.warehouse.pojo.WarehouseGoodsShelves; |
| | | import com.ruoyi.warehouse.service.WarehouseGoodsShelvesService; |
| | |
| | | @GetMapping("/listById") |
| | | @Operation(summary = "ååè´§æ¶-æ¥è¯¢") |
| | | @Log(title = "ååè´§æ¶-æ¥è¯¢", businessType = BusinessType.OTHER) |
| | | public AjaxResult listById(WarehouseGoodsShelves warehouseGoodsShelves) { |
| | | public R<?> listById(WarehouseGoodsShelves warehouseGoodsShelves) { |
| | | List<WarehouseGoodsShelvesDto> list = warehouseGoodsShelvesService.findList(warehouseGoodsShelves); |
| | | return AjaxResult.success(list); |
| | | return R.ok(list); |
| | | } |
| | | @PostMapping("/add") |
| | | @Operation(summary = "ååè´§æ¶-æ·»å ") |
| | | @Log(title = "ååè´§æ¶-æ·»å ", businessType = BusinessType.INSERT) |
| | | public AjaxResult add(@RequestBody WarehouseGoodsShelves warehouseGoodsShelves) { |
| | | return AjaxResult.success(warehouseGoodsShelvesService.add(warehouseGoodsShelves)); |
| | | public R<?> add(@RequestBody WarehouseGoodsShelves warehouseGoodsShelves) { |
| | | return R.ok(warehouseGoodsShelvesService.add(warehouseGoodsShelves)); |
| | | } |
| | | @PutMapping("/update") |
| | | @Operation(summary = "ååè´§æ¶-æ´æ°") |
| | | @Log(title = "ååè´§æ¶-æ´æ°", businessType = BusinessType.UPDATE) |
| | | public AjaxResult update(@RequestBody WarehouseGoodsShelves warehouseGoodsShelves) { |
| | | return AjaxResult.success(warehouseGoodsShelvesService.updateRowcolById(warehouseGoodsShelves)); |
| | | public R<?> update(@RequestBody WarehouseGoodsShelves warehouseGoodsShelves) { |
| | | return R.ok(warehouseGoodsShelvesService.updateRowcolById(warehouseGoodsShelves)); |
| | | } |
| | | @DeleteMapping("/delete") |
| | | @Operation(summary = "ååè´§æ¶-å é¤") |
| | | @Log(title = "ååè´§æ¶-å é¤", businessType = BusinessType.DELETE) |
| | | public AjaxResult delete(@RequestBody List<Long> ids) { |
| | | if(CollectionUtils.isEmpty(ids)) return AjaxResult.error("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | return AjaxResult.success(warehouseGoodsShelvesService.deleteByIds(ids)); |
| | | public R<?> delete(@RequestBody List<Long> ids) { |
| | | if(CollectionUtils.isEmpty(ids)) return R.fail("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | return R.ok(warehouseGoodsShelvesService.deleteByIds(ids)); |
| | | } |
| | | } |
| | |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.warehouse.dto.WarehouseGoodsShelvesRowcolDto; |
| | | import com.ruoyi.warehouse.pojo.WarehouseGoodsShelvesRowcol; |
| | | import com.ruoyi.warehouse.service.WarehouseGoodsShelvesRowcolService; |
| | |
| | | @GetMapping("/list") |
| | | @Operation(summary = "ååè´§æ¶è¡å-æ¥è¯¢") |
| | | @Log(title = "ååè´§æ¶è¡å-æ¥è¯¢", businessType = BusinessType.OTHER) |
| | | public AjaxResult list(WarehouseGoodsShelvesRowcol warehouseGoodsShelvesRowcol) { |
| | | public R<?> list(WarehouseGoodsShelvesRowcol warehouseGoodsShelvesRowcol) { |
| | | |
| | | List<WarehouseGoodsShelvesRowcolDto> list = warehouseGoodsShelvesRowcolService.getList(warehouseGoodsShelvesRowcol); |
| | | return AjaxResult.success(list); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.waterrecord.pojo.WaterRecord; |
| | | import com.ruoyi.waterrecord.service.WaterRecordService; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | |
| | | |
| | | @GetMapping("/listPage") |
| | | @Log(title = "ç¨æ°´ç®¡ç-å页æ¥è¯¢", businessType = BusinessType.OTHER) |
| | | public AjaxResult listPage(Page page, WaterRecord waterRecord){ |
| | | public R<?> listPage(Page page, WaterRecord waterRecord){ |
| | | IPage<WaterRecord> listPage = waterRecordService.listPage(page, waterRecord); |
| | | return AjaxResult.success(listPage); |
| | | return R.ok(listPage); |
| | | } |
| | | |
| | | @PostMapping("/add") |
| | | @Log(title = "ç¨æ°´ç®¡ç-æ°å¢", businessType = BusinessType.INSERT) |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult add(@RequestBody WaterRecord waterRecord){ |
| | | public R<?> add(@RequestBody WaterRecord waterRecord){ |
| | | boolean save = waterRecordService.save(waterRecord); |
| | | return save ? AjaxResult.success() : AjaxResult.error(); |
| | | return save ? R.ok() : R.fail(); |
| | | } |
| | | |
| | | @PostMapping("/update") |
| | | @Log(title = "ç¨æ°´ç®¡ç-ä¿®æ¹", businessType = BusinessType.UPDATE) |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult update(@RequestBody WaterRecord waterRecord){ |
| | | public R<?> update(@RequestBody WaterRecord waterRecord){ |
| | | boolean update = waterRecordService.updateById(waterRecord); |
| | | return update ? AjaxResult.success() : AjaxResult.error(); |
| | | return update ? R.ok() : R.fail(); |
| | | } |
| | | |
| | | @DeleteMapping("/delete") |
| | | @Log(title = "ç¨æ°´ç®¡ç-å é¤", businessType = BusinessType.DELETE) |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult delete(@RequestBody List<Long> ids){ |
| | | if(CollectionUtils.isEmpty(ids)) return AjaxResult.error("è¯·éæ©è³å°ä¸æ¡æ°æ®"); |
| | | public R<?> delete(@RequestBody List<Long> ids){ |
| | | if(CollectionUtils.isEmpty(ids)) return R.fail("è¯·éæ©è³å°ä¸æ¡æ°æ®"); |
| | | boolean delete = waterRecordService.removeBatchByIds(ids); |
| | | return delete ? AjaxResult.success() : AjaxResult.error(); |
| | | return delete ? R.ok() : R.fail(); |
| | | } |
| | | |
| | | /** |
| | |
| | | @Log(title = "导å
¥ç¨æ°´ç®¡ç", businessType = BusinessType.IMPORT) |
| | | @PostMapping("/importData") |
| | | @Operation(summary = "导å
¥ç¨æ°´ç®¡ç") |
| | | public AjaxResult importData(MultipartFile file) throws Exception { |
| | | public R<?> importData(MultipartFile file) throws Exception { |
| | | return waterRecordService.importData(file); |
| | | } |
| | | |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.waterrecord.pojo.WaterRecord; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | |
| | | */ |
| | | IPage<WaterRecord> listPage(Page page, WaterRecord waterRecord); |
| | | |
| | | AjaxResult importData(MultipartFile file); |
| | | R<?> importData(MultipartFile file); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.common.constant.HttpStatus; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.waterrecord.mapper.WaterRecordMapper; |
| | | import com.ruoyi.waterrecord.pojo.WaterRecord; |
| | | import com.ruoyi.waterrecord.service.WaterRecordService; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public AjaxResult importData(MultipartFile file) { |
| | | public R<?> importData(MultipartFile file) { |
| | | try { |
| | | ExcelUtil<WaterRecord> util = new ExcelUtil<WaterRecord>(WaterRecord.class); |
| | | List<WaterRecord> userList = util.importExcel(file.getInputStream()); |
| | | if(CollectionUtils.isEmpty(userList)){ |
| | | return AjaxResult.warn("模æ¿é误æå¯¼å
¥æ°æ®ä¸ºç©º"); |
| | | return R.fail(HttpStatus.WARN, "模æ¿é误æå¯¼å
¥æ°æ®ä¸ºç©º"); |
| | | } |
| | | this.saveOrUpdateBatch(userList); |
| | | return AjaxResult.success(true); |
| | | return R.ok(true); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return AjaxResult.error("导å
¥å¤±è´¥"); |
| | | return R.fail("导å
¥å¤±è´¥"); |
| | | } |
| | | } |
| | | } |
| | |
| | | compressQuality: 0.5 # å缩质é(0.0-1.0) |
| | | knowledge: |
| | | one: D:\æ°ç大ç½ç´ ä¼ä¸äº§åä½ç³»è¯´æææ¡£.md |
| | | |
| | |
| | | and ifnull(complete_quantity, 0) < quantity |
| | | </select> |
| | | |
| | | <select id="selectHomeOrderProgressPage" resultType="java.util.Map"> |
| | | select po.nps_no as orderNo, |
| | | p.product_name as productName, |
| | | ifnull(po.quantity, 0) as plannedQuantity, |
| | | ifnull(po.complete_quantity, 0) as completedQuantity, |
| | | round(ifnull(po.complete_quantity, 0) / nullif(po.quantity, 0) * 100, 2) as completionRate, |
| | | po.plan_complete_time as dueDate, |
| | | po.status as status |
| | | from production_order po |
| | | left join product_model pm on po.product_model_id = pm.id |
| | | left join product p on pm.product_id = p.id |
| | | <where> |
| | | <if test="status != null"> |
| | | and po.status = #{status} |
| | | </if> |
| | | </where> |
| | | order by po.id desc |
| | | limit #{offset}, #{size} |
| | | </select> |
| | | |
| | | <select id="countHomeOrderProgress" resultType="java.lang.Long"> |
| | | select count(1) |
| | | from production_order po |
| | | <where> |
| | | <if test="status != null"> |
| | | and po.status = #{status} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="countHomeOrderProgressByStatus" resultType="java.util.Map"> |
| | | select po.status as status, count(1) as cnt |
| | | from production_order po |
| | | where po.status in (2, 3, 4) |
| | | group by po.status |
| | | </select> |
| | | |
| | | <select id="selectHomeTodayProductionPlan" resultType="java.util.Map"> |
| | | select po.nps_no as orderNo, |
| | | p.product_name as productName, |
| | | ifnull(po.quantity, 0) as plannedQuantity, |
| | | po.plan_complete_time as dueDate, |
| | | po.status as status |
| | | from production_order po |
| | | left join product_model pm on po.product_model_id = pm.id |
| | | left join product p on pm.product_id = p.id |
| | | where po.status in (1, 2) |
| | | order by case when po.status = 2 then 0 else 1 end, po.id desc |
| | | limit #{size} |
| | | </select> |
| | | |
| | | <select id="countHomeTodayProductionPlan" resultType="java.lang.Long"> |
| | | select count(1) |
| | | from production_order po |
| | | where po.status in (1, 2) |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <if test="ew.topParentProductId != null and ew.topParentProductId > 0"> |
| | | and combined.product_id in (select id from product_tree) |
| | | </if> |
| | | <if test="ew.model != null and ew.model !=''"> |
| | | and combined.model like concat('%',#{ew.model},'%') |
| | | </if> |
| | | <if test="ew.batchNo != null and ew.batchNo !=''"> |
| | | and combined.batch_no like concat('%',#{ew.batchNo},'%') |
| | | </if> |
| | | </where> |
| | | group by |
| | | product_model_id, |