Merge remote-tracking branch 'origin/dev_New_pro' into dev_浪潮_pro
# Conflicts:
# src/main/java/com/ruoyi/common/enums/StockInQualifiedRecordTypeEnum.java
# src/main/java/com/ruoyi/procurementrecord/utils/StockUtils.java
# src/main/java/com/ruoyi/stock/service/impl/StockInRecordServiceImpl.java
# src/main/java/com/ruoyi/stock/service/impl/StockOutRecordServiceImpl.java
已添加15个文件
已修改35个文件
已删除22个文件
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | # 设å¤ä¿å
»å®æ¶ä»»å¡è®¾å¤é¡¹ç®å段å端èè°è¯´æ |
| | | |
| | | > æ´æ°æ¶é´ï¼2026-05-11 |
| | | > éç¨èå´ï¼è®¾å¤ä¿å
»å®æ¶ä»»å¡ï¼`maintenance_task`ï¼ä¸è®¾å¤ä¿å
»è®°å½ï¼`device_maintenance`ï¼ |
| | | |
| | | ## 1. åæ´æ¦è¿° |
| | | |
| | | æ¬æ¬¡åç«¯åæ´ï¼ |
| | | |
| | | 1. `MaintenanceTask` æ°å¢å段 `machineryCategory`ï¼è®¾å¤é¡¹ç®ï¼ã |
| | | 2. 宿¶ä»»å¡æ§è¡çæè®¾å¤ä¿å
»è®°å½æ¶ï¼ä¼æ `MaintenanceTask.machineryCategory` 忥åå
¥ `DeviceMaintenance.machineryCategory`ã |
| | | |
| | | 对åºä»£ç ä½ç½®ï¼ |
| | | |
| | | - `src/main/java/com/ruoyi/device/pojo/MaintenanceTask.java` |
| | | - `src/main/java/com/ruoyi/device/service/impl/MaintenanceTaskJob.java` |
| | | |
| | | ## 2. æ°æ®åºåæ´ |
| | | |
| | | éè¦å
æ§è¡æ°æ®åºåæ´ï¼å¦åæ°å¢/æ¥è¯¢è¯¥å段ä¼å¼å¸¸ï¼ï¼ |
| | | |
| | | ```sql |
| | | ALTER TABLE `maintenance_task` |
| | | ADD COLUMN `machinery_category` VARCHAR(100) NULL COMMENT '设å¤é¡¹ç®' AFTER `device_model`; |
| | | ``` |
| | | |
| | | ## 3. åæ®µçº¦å® |
| | | |
| | | | åæ®µ | å«ä¹ | ç±»å | 建议 | |
| | | | --- | --- | --- | --- | |
| | | | machineryCategory | 设å¤é¡¹ç® | string | å端æ°å¢/ç¼è¾å®æ¶ä»»å¡æ¶ä¼ å¼ | |
| | | |
| | | 说æï¼ |
| | | |
| | | - å端å½åæªå¯¹è¯¥å段å强å¶éç©ºæ ¡éªï¼ä½ä¸å¡ä¸å»ºè®®å端ä½ä¸ºå¿
å¡«å¤çã |
| | | - åå² `maintenance_task` æ§æ°æ®è¥è¯¥å段为空ï¼ååºäºæ§ä»»å¡çæçä¿å
»è®°å½ä¹ä¼ä¸ºç©ºã |
| | | |
| | | ## 4. æ¥å£èè° |
| | | |
| | | ### 4.1 æ°å¢å®æ¶ä»»å¡ |
| | | |
| | | ```http |
| | | POST /deviceMaintenanceTask/add |
| | | Content-Type: application/json |
| | | ``` |
| | | |
| | | 请æ±ç¤ºä¾ï¼ |
| | | |
| | | ```json |
| | | { |
| | | "taskName": "ç©ºåæºA-å¨ä¿å
»", |
| | | "taskId": 1001, |
| | | "deviceModel": "GA75", |
| | | "machineryCategory": "å¨å设å¤", |
| | | "frequencyType": "WEEKLY", |
| | | "frequencyDetail": "MON,09:00", |
| | | "registrantId": 1, |
| | | "registrationDate": "2026-05-11", |
| | | "remarks": "èè°æ ·ä¾" |
| | | } |
| | | ``` |
| | | |
| | | ### 4.2 ä¿®æ¹å®æ¶ä»»å¡ |
| | | |
| | | ```http |
| | | POST /deviceMaintenanceTask/update |
| | | Content-Type: application/json |
| | | ``` |
| | | |
| | | 请æ±ç¤ºä¾ï¼å« `id`ï¼ï¼ |
| | | |
| | | ```json |
| | | { |
| | | "id": 12, |
| | | "machineryCategory": "å¨å设å¤" |
| | | } |
| | | ``` |
| | | |
| | | ### 4.3 宿¶ä»»å¡å表 |
| | | |
| | | ```http |
| | | GET /deviceMaintenanceTask/listPage?pageNum=1&pageSize=10 |
| | | ``` |
| | | |
| | | è¿åè®°å½ä¸ä¼å
å« `machineryCategory` åæ®µã |
| | | |
| | | ### 4.4 设å¤ä¿å
»è®°å½å表/详æ
|
| | | |
| | | ```http |
| | | GET /device/maintenance/page?pageNum=1&pageSize=10 |
| | | GET /device/maintenance/{id} |
| | | ``` |
| | | |
| | | è¿åä¸ `machineryCategory` æ¥æºäº `device_maintenance.machinery_category`ã |
| | | 对äºâç±å®æ¶ä»»å¡èªå¨çæâçè®°å½ï¼è¯¥å¼ä¼ç»§æ¿çææ¶å¯¹åºä»»å¡ç `machineryCategory`ã |
| | | |
| | | ## 5. å端æ¹é ç¹ |
| | | |
| | | 1. 宿¶ä»»å¡æ°å¢/ç¼è¾è¡¨åå¢å â设å¤é¡¹ç®ï¼machineryCategoryï¼âè¾å
¥é¡¹ã |
| | | 2. æäº¤ `/deviceMaintenanceTask/add`ã`/deviceMaintenanceTask/update` æ¶æºå¸¦ `machineryCategory`ã |
| | | 3. 宿¶ä»»å¡å表å¢å â设å¤é¡¹ç®âåï¼å¦é¡µé¢æè¯¥å表ï¼ã |
| | | 4. 设å¤ä¿å
»è®°å½å表/详æ
å¢å â设å¤é¡¹ç®âå±ç¤ºï¼ç©ºå¼æ¾ç¤º `--`ã |
| | | |
| | | ## 6. èè°éªæ¶æ¸
å |
| | | |
| | | 1. æ°å¢ä¸ä¸ªå¸¦ `machineryCategory` ç宿¶ä»»å¡ï¼ä¿åæåã |
| | | 2. æ¥è¯¢ `/deviceMaintenanceTask/listPage`ï¼ç¡®è®¤è¯¥ä»»å¡è¿å `machineryCategory`ã |
| | | 3. çå¾
䏿¬¡å®æ¶è§¦åï¼æå°é¢çè°å°ä¸´è¿æ¶é´ï¼ï¼çæä¿å
»è®°å½ã |
| | | 4. æ¥è¯¢ `/device/maintenance/page` æè¯¦æ
æ¥å£ï¼ç¡®è®¤æ°è®°å½ç `machineryCategory` ä¸ä»»å¡ä¸è´ã |
| | | 5. ä¿®æ¹ä»»å¡ `machineryCategory` å忬¡è§¦åï¼ç¡®è®¤âæ°çæè®°å½âä½¿ç¨æ°å¼ï¼åå²è®°å½ä¸ååï¼ã |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.account.bean.dto; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @Schema(name = "PurchaseInboundDto", description = "è´¢å¡ç®¡ç--éè´å
¥åºå°è´¦(ä¼ å)") |
| | | public class PurchaseInboundDto { |
| | | |
| | | @Schema(description = "å
¥åºåå·") |
| | | private String inboundBatches; |
| | | |
| | | @Schema(description = "ä¾åºå") |
| | | private String supplierName; |
| | | |
| | | @Schema(description = "å¼å§æ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date startDate; |
| | | |
| | | @Schema(description = "ç»ææ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date endDate; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.account.bean.dto; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @Schema(name = "PurchaseReturnDto", description = "è´¢å¡ç®¡ç--éè´éè´§å°è´¦(ä¼ å)") |
| | | public class PurchaseReturnDto { |
| | | |
| | | @Schema(description = "éè´§åå·") |
| | | private String returnNo; |
| | | |
| | | @Schema(description = "ä¾åºå") |
| | | private String supplierName; |
| | | |
| | | @Schema(description = "å¼å§æ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date startDate; |
| | | |
| | | @Schema(description = "ç»ææ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date endDate; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.account.bean.dto; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @Schema(name = "SalesOutboundDto", description = "è´¢å¡ç®¡ç--éå®åºåºå°è´¦(ä¼ å)") |
| | | public class SalesOutboundDto { |
| | | |
| | | @Schema(description = "åºåºåå·") |
| | | private String outboundBatches; |
| | | |
| | | @Schema(description = "客æ·åç§°") |
| | | private String customerName; |
| | | |
| | | @Schema(description = "å¼å§æ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date startDate; |
| | | |
| | | @Schema(description = "ç»ææ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date endDate; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.account.bean.dto; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @Schema(name = "SalesReturnDto", description = "è´¢å¡ç®¡ç--éå®éè´§å°è´¦(ä¼ å)") |
| | | public class SalesReturnDto { |
| | | |
| | | @Schema(description = "éè´§åå·") |
| | | private String returnNo; |
| | | |
| | | @Schema(description = "客æ·åç§°") |
| | | private String customerName; |
| | | |
| | | @Schema(description = "å¼å§æ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date startDate; |
| | | |
| | | @Schema(description = "ç»ææ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date endDate; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.account.bean.vo; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @Schema(name = "PurchaseInboundVo", description = "è´¢å¡ç®¡ç--éè´å
¥åºå°è´¦(è¿å)") |
| | | @ExcelIgnoreUnannotated |
| | | public class PurchaseInboundVo { |
| | | |
| | | @Schema(description = "å
¥åºåid") |
| | | private Long id; |
| | | |
| | | @Schema(description = "å
¥åºåå·") |
| | | @Excel(name = "å
¥åºåå·") |
| | | private String inboundBatches; |
| | | |
| | | @Schema(description = "ä¾åºå") |
| | | @Excel(name = "ä¾åºå") |
| | | private String supplierName; |
| | | |
| | | @Schema(description = "å
¥åºæ¥æ") |
| | | @Excel(name = "å
¥åºæ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date InboundDate; |
| | | |
| | | @Schema(description = "产ååç§°") |
| | | @Excel(name = "产ååç§°") |
| | | private String productName; |
| | | |
| | | @Schema(description = "产åè§æ ¼") |
| | | @Excel(name = "产åè§æ ¼") |
| | | private String specificationModel; |
| | | |
| | | @Schema(description = "éé¢") |
| | | @Excel(name = "éé¢") |
| | | private BigDecimal InboundAmount; |
| | | |
| | | @Schema(description = "éè´è®¢åå·") |
| | | @Excel(name = "éè´è®¢åå·") |
| | | private String purchaseContractNumber; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.account.bean.vo; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Data |
| | | @Schema(name = "PurchaseReturnVo", description = "è´¢å¡ç®¡ç--éè´éè´§å°è´¦(è¿å)") |
| | | @ExcelIgnoreUnannotated |
| | | public class PurchaseReturnVo { |
| | | |
| | | @Schema(description = "éè´§åid") |
| | | private Long id; |
| | | |
| | | @Excel(name = "éè´§åå·") |
| | | @Schema(description = "éè´§åå·") |
| | | private String returnNo; |
| | | |
| | | @Schema(description = "ä¾åºå") |
| | | @Excel(name = "ä¾åºå") |
| | | private String supplierName; |
| | | |
| | | @Schema(description = "å
³èå
¥åºåå·") |
| | | @Excel(name = "å
³èå
¥åºåå·") |
| | | private String inboundBatches; |
| | | |
| | | @Schema(description = "éè´§æ¥æ") |
| | | @Excel(name = "éè´§æ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private LocalDateTime preparedAt; |
| | | |
| | | @Schema(description = "鿬¾æ»é¢") |
| | | @Excel(name = "鿬¾æ»é¢") |
| | | private BigDecimal totalAmount; |
| | | |
| | | @Schema(description = "éè´§æ¹å¼") |
| | | @Excel(name = "éè´§æ¹å¼") |
| | | private String returnType; |
| | | |
| | | @Schema(description = "éè´è®¢åå·") |
| | | @Excel(name = "éè´è®¢åå·") |
| | | private String purchaseContractNumber; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.account.bean.vo; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @Schema(name = "SalesOutboundVo", description = "è´¢å¡ç®¡ç--éå®åºåºå°è´¦(è¿å)") |
| | | @ExcelIgnoreUnannotated |
| | | public class SalesOutboundVo { |
| | | |
| | | @Schema(description = "åºåºåid") |
| | | private Long id; |
| | | |
| | | @Schema(description = "åºåºåå·") |
| | | @Excel(name = "åºåºåå·") |
| | | private String outboundBatches; |
| | | |
| | | @Schema(description = "客æ·åç§°") |
| | | @Excel(name = "客æ·åç§°") |
| | | private String customerName; |
| | | |
| | | @Schema(description = "åºåºæ¥æ") |
| | | @Excel(name = "åºåºæ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date shippingDate; |
| | | |
| | | @Schema(description = "产ååç§°") |
| | | @Excel(name = "产ååç§°") |
| | | private String productName; |
| | | |
| | | @Schema(description = "产åè§æ ¼") |
| | | @Excel(name = "产åè§æ ¼") |
| | | private String specificationModel; |
| | | |
| | | @Schema(description = "éé¢") |
| | | @Excel(name = "éé¢") |
| | | private BigDecimal outboundAmount; |
| | | |
| | | @Schema(description = "åè´§ç¼å·") |
| | | @Excel(name = "åè´§ç¼å·") |
| | | private String shippingNo; |
| | | |
| | | @Schema(description = "éå®è®¢åå·") |
| | | @Excel(name = "éå®è®¢åå·") |
| | | private String salesContractNo; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.account.bean.vo; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Data |
| | | @Schema(name = "SalesReturnVo", description = "è´¢å¡ç®¡ç--éå®éè´§å°è´¦(è¿å)") |
| | | @ExcelIgnoreUnannotated |
| | | public class SalesReturnVo { |
| | | |
| | | @Schema(description = "éè´§åid") |
| | | private Long id; |
| | | |
| | | @Excel(name = "éè´§åå·") |
| | | @Schema(description = "éè´§åå·") |
| | | private String returnNo; |
| | | |
| | | @Schema(description = "客æ·åç§°") |
| | | @Excel(name = "客æ·åç§°") |
| | | private String customerName; |
| | | |
| | | @Schema(description = "å
³èåè´§åå·") |
| | | @Excel(name = "å
³èåè´§åå·") |
| | | private String shippingNo; |
| | | |
| | | @Schema(description = "éè´§æ¥æ") |
| | | @Excel(name = "éè´§æ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private LocalDateTime makeTime; |
| | | |
| | | @Schema(description = "鿬¾æ»é¢") |
| | | @Excel(name = "鿬¾æ»é¢") |
| | | private BigDecimal refundAmount; |
| | | |
| | | @Schema(description = "éè´§åå ") |
| | | @Excel(name = "éè´§åå ") |
| | | private String returnReason; |
| | | |
| | | @Schema(description = "éå®è®¢åå·") |
| | | @Excel(name = "éå®è®¢åå·") |
| | | private String salesContractNo; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.account.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.account.bean.dto.PurchaseInboundDto; |
| | | import com.ruoyi.account.bean.dto.PurchaseReturnDto; |
| | | import com.ruoyi.account.bean.vo.PurchaseInboundVo; |
| | | import com.ruoyi.account.bean.vo.PurchaseReturnVo; |
| | | import com.ruoyi.account.service.AccountPurchaseService; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * <p> |
| | | * è´¢å¡ç®¡ççéè´é¨å å端æ§å¶å¨ |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-05-07 04:45:30 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/accountPurchase") |
| | | @RequiredArgsConstructor |
| | | @Tag(name = "è´¢å¡ç®¡ççéè´é¨å") |
| | | public class AccounPurchaseController { |
| | | |
| | | private final AccountPurchaseService accountPurchaseService; |
| | | |
| | | @GetMapping("/listPageAccountPurchase") |
| | | @Log(title = "éè´å
¥åºå°è´¦", businessType = BusinessType.OTHER) |
| | | @Operation(summary = "è´¢å¡ç®¡ç--éè´å
¥åºå°è´¦") |
| | | public R<IPage<PurchaseInboundVo>> listPageAccountPurchase(Page page, PurchaseInboundDto purchaseInboundDto) { |
| | | IPage<PurchaseInboundVo> listPage = accountPurchaseService.listPageAccountPurchase(page,purchaseInboundDto); |
| | | return R.ok(listPage); |
| | | } |
| | | |
| | | @PostMapping("/exportAccountPurchaseInbound") |
| | | @Operation(summary = "导åºéè´å
¥åºæä»¶") |
| | | @Log(title = "导åºéè´å
¥åºæä»¶", businessType = BusinessType.EXPORT) |
| | | public void exportAccountPurchaseInbound(HttpServletResponse response, PurchaseInboundDto purchaseInboundDto) { |
| | | accountPurchaseService.exportAccountPurchaseInbound(response,purchaseInboundDto); |
| | | } |
| | | |
| | | @GetMapping("/listPageAccountPurchaseReturn") |
| | | @Log(title = "éè´éè´§å°è´¦", businessType = BusinessType.OTHER) |
| | | @Operation(summary = "è´¢å¡ç®¡ç--éè´éè´§å°è´¦") |
| | | public R<IPage<PurchaseReturnVo>> listPageAccountPurchaseReturn(Page page, PurchaseReturnDto purchaseReturnDto) { |
| | | IPage<PurchaseReturnVo> listPage = accountPurchaseService.listPageAccountPurchaseReturn(page,purchaseReturnDto); |
| | | return R.ok(listPage); |
| | | } |
| | | |
| | | @PostMapping("/exportAccountPurchaseReturn") |
| | | @Operation(summary = "导åºéè´éè´§æä»¶") |
| | | @Log(title = "导åºéè´éè´§æä»¶", businessType = BusinessType.EXPORT) |
| | | public void exportAccountPurchaseReturn(HttpServletResponse response,PurchaseReturnDto purchaseReturnDto) { |
| | | accountPurchaseService.exportAccountPurchaseReturn(response,purchaseReturnDto); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.account.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.account.bean.dto.SalesOutboundDto; |
| | | import com.ruoyi.account.bean.dto.SalesReturnDto; |
| | | import com.ruoyi.account.bean.vo.SalesOutboundVo; |
| | | import com.ruoyi.account.bean.vo.SalesReturnVo; |
| | | import com.ruoyi.account.service.AccountSalesService; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * <p> |
| | | * è´¢å¡ç®¡ççéå®é¨å å端æ§å¶å¨ |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-05-07 04:45:30 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/accountSales") |
| | | @RequiredArgsConstructor |
| | | @Tag(name = "è´¢å¡ç®¡ççéå®é¨å") |
| | | public class AccountSalesController { |
| | | |
| | | private final AccountSalesService accountSalesService; |
| | | |
| | | @GetMapping("/listPageAccountSales") |
| | | @Log(title = "éå®åºåºå°è´¦", businessType = BusinessType.OTHER) |
| | | @Operation(summary = "è´¢å¡ç®¡ç--éå®åºåºå°è´¦") |
| | | public R<IPage<SalesOutboundVo>> listPageAccountSales(Page page, SalesOutboundDto salesOutboundDto) { |
| | | IPage<SalesOutboundVo> listPage = accountSalesService.listPageAccountSales(page,salesOutboundDto); |
| | | return R.ok(listPage); |
| | | } |
| | | |
| | | @PostMapping("/exportAccountSalesOutbound") |
| | | @Operation(summary = "导åºéå®åºåºæä»¶") |
| | | @Log(title = "导åºéå®åºåºæä»¶", businessType = BusinessType.EXPORT) |
| | | public void exportAccountSalesOutbound(HttpServletResponse response,SalesOutboundDto salesOutboundDto) { |
| | | accountSalesService.exportAccountSalesOutbound(response,salesOutboundDto); |
| | | } |
| | | |
| | | @GetMapping("/listPageAccountSalesReturn") |
| | | @Log(title = "éå®éè´§å°è´¦", businessType = BusinessType.OTHER) |
| | | @Operation(summary = "è´¢å¡ç®¡ç--éå®éè´§å°è´¦") |
| | | public R<IPage<SalesReturnVo>> listPageAccountSalesReturn(Page page, SalesReturnDto salesReturnDto) { |
| | | IPage<SalesReturnVo> listPage = accountSalesService.listPageAccountSalesReturn(page,salesReturnDto); |
| | | return R.ok(listPage); |
| | | } |
| | | |
| | | @PostMapping("/exportAccountSalesReturn") |
| | | @Operation(summary = "导åºéå®éè´§æä»¶") |
| | | @Log(title = "导åºéå®éè´§æä»¶", businessType = BusinessType.EXPORT) |
| | | public void exportAccountSalesReturn(HttpServletResponse response,SalesReturnDto salesReturnDto) { |
| | | accountSalesService.exportAccountSalesReturn(response,salesReturnDto); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.account.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.account.bean.dto.PurchaseInboundDto; |
| | | import com.ruoyi.account.bean.dto.PurchaseReturnDto; |
| | | import com.ruoyi.account.bean.vo.PurchaseInboundVo; |
| | | import com.ruoyi.account.bean.vo.PurchaseReturnVo; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | |
| | | /** |
| | | * <p> |
| | | * è´¢å¡ç®¡ççéå®é¨å æå¡ç±» |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-05-07 04:45:30 |
| | | */ |
| | | public interface AccountPurchaseService { |
| | | IPage<PurchaseInboundVo> listPageAccountPurchase(Page page, PurchaseInboundDto purchaseInboundDto); |
| | | |
| | | void exportAccountPurchaseInbound(HttpServletResponse response, PurchaseInboundDto purchaseInboundDto); |
| | | |
| | | IPage<PurchaseReturnVo> listPageAccountPurchaseReturn(Page page, PurchaseReturnDto purchaseReturnDto); |
| | | |
| | | void exportAccountPurchaseReturn(HttpServletResponse response, PurchaseReturnDto purchaseReturnDto); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.account.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.account.bean.dto.SalesOutboundDto; |
| | | import com.ruoyi.account.bean.dto.SalesReturnDto; |
| | | import com.ruoyi.account.bean.vo.SalesOutboundVo; |
| | | import com.ruoyi.account.bean.vo.SalesReturnVo; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | |
| | | /** |
| | | * <p> |
| | | * è´¢å¡ç®¡ççéå®é¨å æå¡ç±» |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-05-07 04:45:30 |
| | | */ |
| | | public interface AccountSalesService { |
| | | |
| | | IPage<SalesOutboundVo> listPageAccountSales(Page page, SalesOutboundDto salesOutboundDto); |
| | | |
| | | void exportAccountSalesOutbound(HttpServletResponse response, SalesOutboundDto salesOutboundDto); |
| | | |
| | | IPage<SalesReturnVo> listPageAccountSalesReturn(Page page, SalesReturnDto salesReturnDto); |
| | | |
| | | void exportAccountSalesReturn(HttpServletResponse response, SalesReturnDto salesReturnDto); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.account.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.account.bean.dto.PurchaseInboundDto; |
| | | import com.ruoyi.account.bean.dto.PurchaseReturnDto; |
| | | import com.ruoyi.account.bean.vo.PurchaseInboundVo; |
| | | import com.ruoyi.account.bean.vo.PurchaseReturnVo; |
| | | import com.ruoyi.account.service.AccountPurchaseService; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.purchase.mapper.PurchaseReturnOrdersMapper; |
| | | import com.ruoyi.stock.mapper.StockInRecordMapper; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * è´¢å¡ç®¡ççéå®é¨å æå¡å®ç°ç±» |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-05-07 04:45:30 |
| | | */ |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | public class AccountPurchaseServiceImpl implements AccountPurchaseService { |
| | | |
| | | private final StockInRecordMapper stockInRecordMapper; |
| | | |
| | | private final PurchaseReturnOrdersMapper purchaseReturnOrdersMapper; |
| | | |
| | | |
| | | @Override |
| | | public IPage<PurchaseInboundVo> listPageAccountPurchase(Page page, PurchaseInboundDto purchaseInboundDto) { |
| | | return stockInRecordMapper.listPageAccountPurchase(page,purchaseInboundDto); |
| | | } |
| | | |
| | | @Override |
| | | public void exportAccountPurchaseInbound(HttpServletResponse response, PurchaseInboundDto purchaseInboundDto) { |
| | | List<PurchaseInboundVo> list = stockInRecordMapper.listPageAccountPurchase(new Page(1,-1),purchaseInboundDto).getRecords(); |
| | | ExcelUtil<PurchaseInboundVo> util = new ExcelUtil<>(PurchaseInboundVo.class); |
| | | util.exportExcel(response, list , "éè´å
¥åº"); |
| | | } |
| | | |
| | | @Override |
| | | public IPage<PurchaseReturnVo> listPageAccountPurchaseReturn(Page page, PurchaseReturnDto purchaseReturnDto) { |
| | | return purchaseReturnOrdersMapper.listPageAccountPurchaseReturn(page,purchaseReturnDto); |
| | | } |
| | | |
| | | @Override |
| | | public void exportAccountPurchaseReturn(HttpServletResponse response, PurchaseReturnDto purchaseReturnDto) { |
| | | List<PurchaseReturnVo> list = purchaseReturnOrdersMapper.listPageAccountPurchaseReturn(new Page(1,-1),purchaseReturnDto).getRecords(); |
| | | ExcelUtil<PurchaseReturnVo> util = new ExcelUtil<>(PurchaseReturnVo.class); |
| | | util.exportExcel(response, list , "éè´éè´§"); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.account.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.account.bean.dto.SalesOutboundDto; |
| | | import com.ruoyi.account.bean.dto.SalesReturnDto; |
| | | import com.ruoyi.account.bean.vo.SalesOutboundVo; |
| | | import com.ruoyi.account.bean.vo.SalesReturnVo; |
| | | import com.ruoyi.account.service.AccountSalesService; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.procurementrecord.mapper.ReturnManagementMapper; |
| | | import com.ruoyi.stock.mapper.StockOutRecordMapper; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * è´¢å¡ç®¡ççéå®é¨å æå¡å®ç°ç±» |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-05-07 04:45:30 |
| | | */ |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | public class AccountSalesServiceImpl implements AccountSalesService { |
| | | |
| | | private final StockOutRecordMapper stockOutRecordMapper; |
| | | |
| | | private final ReturnManagementMapper returnManagementMapper; |
| | | |
| | | @Override |
| | | public IPage<SalesOutboundVo> listPageAccountSales(Page page, SalesOutboundDto salesOutboundDto) { |
| | | return stockOutRecordMapper.listPageAccountSales(page,salesOutboundDto); |
| | | } |
| | | |
| | | @Override |
| | | public void exportAccountSalesOutbound(HttpServletResponse response, SalesOutboundDto salesOutboundDto) { |
| | | List<SalesOutboundVo> list = stockOutRecordMapper.listPageAccountSales(new Page(1,-1),salesOutboundDto).getRecords(); |
| | | ExcelUtil<SalesOutboundVo> util = new ExcelUtil<>(SalesOutboundVo.class); |
| | | util.exportExcel(response, list , "éå®åºåº"); |
| | | } |
| | | |
| | | @Override |
| | | public IPage<SalesReturnVo> listPageAccountSalesReturn(Page page, SalesReturnDto salesReturnDto) { |
| | | return returnManagementMapper.listPageAccountSalesReturn(page,salesReturnDto); |
| | | } |
| | | |
| | | @Override |
| | | public void exportAccountSalesReturn(HttpServletResponse response, SalesReturnDto salesReturnDto) { |
| | | List<SalesReturnVo> list = returnManagementMapper.listPageAccountSalesReturn(new Page(1,-1),salesReturnDto).getRecords(); |
| | | ExcelUtil<SalesReturnVo> util = new ExcelUtil<>(SalesReturnVo.class); |
| | | util.exportExcel(response, list , "éå®éè´§"); |
| | | } |
| | | } |
| | |
| | | import com.ruoyi.basic.utils.FileUtil; |
| | | import com.ruoyi.common.enums.FileNameType; |
| | | import com.ruoyi.common.enums.StockInQualifiedRecordTypeEnum; |
| | | import com.ruoyi.common.enums.StockOutQualifiedRecordTypeEnum; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.device.mapper.DeviceRepairMapper; |
| | | import com.ruoyi.procurementrecord.utils.StockUtils; |
| | |
| | | import com.ruoyi.quality.pojo.QualityInspectParam; |
| | | import com.ruoyi.quality.pojo.QualityTestStandard; |
| | | import com.ruoyi.quality.pojo.QualityTestStandardParam; |
| | | import com.ruoyi.sales.mapper.CommonFileMapper; |
| | | import com.ruoyi.sales.mapper.SalesLedgerProductMapper; |
| | | import com.ruoyi.sales.mapper.SalesQuotationMapper; |
| | | import com.ruoyi.sales.mapper.ShippingInfoMapper; |
| | | import com.ruoyi.sales.pojo.CommonFile; |
| | | import com.ruoyi.sales.pojo.SalesLedgerProduct; |
| | | import com.ruoyi.sales.pojo.SalesQuotation; |
| | | import com.ruoyi.sales.pojo.ShippingInfo; |
| | | import com.ruoyi.sales.mapper.*; |
| | | import com.ruoyi.sales.pojo.*; |
| | | import com.ruoyi.sales.service.impl.CommonFileServiceImpl; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | private final PurchaseLedgerMapper purchaseLedgerMapper; |
| | | private final SalesQuotationMapper salesQuotationMapper; |
| | | private final ShippingInfoMapper shippingInfoMapper; |
| | | private final ShippingProductDetailMapper shippingProductDetailMapper; |
| | | private final CommonFileServiceImpl commonFileService; |
| | | private final StockUtils stockUtils; |
| | | private final SalesLedgerProductMapper salesLedgerProductMapper; |
| | |
| | | addQualityInspect(purchaseLedger, salesLedgerProduct); |
| | | } else { |
| | | //ç´æ¥å
¥åº |
| | | stockUtils.addStockWithBatchNo(salesLedgerProduct.getProductModelId(), salesLedgerProduct.getQuantity(), StockInQualifiedRecordTypeEnum.PURCHASE_STOCK_IN.getCode(), purchaseLedger.getId(),purchaseLedger.getPurchaseContractNumber()+"-"+salesLedgerProduct.getId()); |
| | | stockUtils.addStockWithBatchNo(salesLedgerProduct.getProductModelId(), salesLedgerProduct.getQuantity(), StockInQualifiedRecordTypeEnum.PURCHASE_STOCK_IN.getCode(), purchaseLedger.getId(), purchaseLedger.getPurchaseContractNumber() + "-" + salesLedgerProduct.getId()); |
| | | } |
| | | } |
| | | } else if (status.equals(3)) { |
| | |
| | | if (shippingInfo != null) { |
| | | if (status.equals(2)) { |
| | | shippingInfo.setStatus("å®¡æ ¸éè¿"); |
| | | //æ´æ¹åºåºå®¡æ ¸ç¶æï¼å¾
ç¡®è®¤æ¹æå¾
å®¡æ ¸ï¼ |
| | | stockUtils.shipmentStatus(StockOutQualifiedRecordTypeEnum.SALE_SHIP_STOCK_OUT.getCode(), shippingInfo.getId()); |
| | | } else if (status.equals(3)) { |
| | | shippingInfo.setStatus("å®¡æ ¸æç»"); |
| | | } else if (status.equals(1)) { |
| | |
| | | } |
| | | shippingInfoMapper.updateById(shippingInfo); |
| | | } |
| | | //åºåæ£å |
| | | |
| | | } |
| | | fileUtil.saveStorageAttachment(ApplicationTypeEnum.FILE, RecordTypeEnum.APPROVE_NODE, approveNode.getId(), approveNode.getStorageBlobDTOS()); |
| | |
| | | INBOUND_MANAGEMENT("inbound_management"), |
| | | // Office Supplies |
| | | OFFICE_SUPPLIES("office_supplies"), |
| | | // OA |
| | | OA_PROJECT_PHASE_TASK("oa_project_phase_task"), |
| | | OA_PROJECT("oa_project"), |
| | | OA_PROJECT_PHASE("oa_project_phase"), |
| | | // Measuring Instrument Ledger |
| | | SPARE_PARTS("spare_parts"), |
| | | MEASURING_INSTRUMENT_LEDGER_RECORD("measuring_instrument_ledger_record"), |
| | |
| | | } |
| | | |
| | | // å 餿§éä»¶ä¿¡æ¯ |
| | | if (application == null) { |
| | | if (application == null || application.trim().isEmpty()) { |
| | | for (StorageBlobDTO storageBlobDTO : storageBlobDTOS) { |
| | | if (storageBlobDTO.getApplication() == null || storageBlobDTO.getApplication().trim().isEmpty()) { |
| | | throw new RuntimeException("æä»¶ç¨éä¸è½ä¸ºç©º"); |
| | | } |
| | | deleteStorageAttachmentsByApplicationAndRecordTypeAndRecordId(ApplicationTypeEnum.getByType(storageBlobDTO.getApplication()), recordType, recordId); |
| | | } |
| | | } else { |
| | |
| | | |
| | | import lombok.Getter; |
| | | |
| | | |
| | | //å
¥åºæä¸¾ |
| | | @Getter |
| | | public enum StockInQualifiedRecordTypeEnum implements BaseEnum<String> { |
| | | |
| | | |
| | | CUSTOMIZATION_STOCK_IN("0", "åæ ¼èªå®ä¹å
¥åº"), |
| | | CUSTOMIZATION_STOCK_OUT("1", "åæ ¼èªå®ä¹åºåº"), |
| | | PRODUCTION_REPORT_STOCK_IN("2", "ç产æ¥å·¥-å
¥åº"), |
| | | PRODUCTION_REPORT_STOCK_OUT("3", "ç产æ¥å·¥-åºåº"), |
| | | DEFECTIVE_SCRAP("4", "ä¸åæ ¼å¤ç-æ¥åº"), |
| | | PRODUCTION_SCRAP("5", "ç产æ¥å·¥-æ¥åº"), |
| | | QUALITYINSPECT_STOCK_IN("6", "è´¨æ£-åæ ¼å
¥åº"), |
| | | PURCHASE_STOCK_IN("7", "éè´-å
¥åº"), |
| | | SALE_STOCK_OUT("8", "éå®-åºåº"), |
| | | CUSTOMIZATION_UNSTOCK_IN("9", "ä¸åæ ¼èªå®ä¹å
¥åº"), |
| | | CUSTOMIZATION_UNSTOCK_OUT("10", "ä¸åæ ¼èªå®ä¹åºåº"), |
| | | CUSTOMIZATION_UNSTOCK_OUT("10", "éè´-è´¨æ£-åæ ¼å
¥åº"), |
| | | DEFECTIVE_PASS("11", "ä¸åæ ¼-è®©æ¥æ¾è¡"), |
| | | QUALITYINSPECT_UNSTOCK_IN("12", "è´¨æ£-ä¸åæ ¼å
¥åº"), |
| | | SALE_SHIP_STOCK_OUT("13", "éå®-åè´§åºåº"), |
| | | RETURN_HE_IN("14", "éå®éè´§-åæ ¼å
¥åº"), |
| | | RETURN_UNSTOCK_IN("15", "éå®éè´§-ä¸åæ ¼å
¥åº"), |
| | | PICK_RETURN_IN("20", "颿éæ-åæ ¼å
¥åº"), |
| | | PURCHASE_RETURN_STOCK_OUT("21", "éè´éè´§"), |
| | | FEED_RETURN_IN("22", "ç产éæ-åæ ¼å
¥åº"), |
| | | INVENTORY_CHECK_STOCK_IN("23", "çç¹-å
¥åº"), |
| | | INVENTORY_CHECK_STOCK_OUT("24", "çç¹-åºåº"); |
| | | FEED_RETURN_IN("22", "ç产éæ-åæ ¼å
¥åº"); |
| | | |
| | | |
| | | |
| | |
| | | PRODUCTION_REPORT_STOCK_OUT("3", "ç产æ¥å·¥-åºåº"), |
| | | SALE_STOCK_OUT("8", "éå®-åºåº"), |
| | | PURCHASE_RETURN_STOCK_OUT("9", "éè´éè´§"), |
| | | CUSTOMIZATION_UNSTOCK_OUT("10", "ä¸åæ ¼èªå®ä¹åºåº"), |
| | | SALE_SHIP_STOCK_OUT("13", "éå®-åè´§åºåº"), |
| | | PICK_STOCK_OUT("14", "çäº§é¢æåºåº"), |
| | | FEED_STOCK_OUT("15", "ç产补æåºåº"), |
| | |
| | | @Schema(description = "è§æ ¼åå·") |
| | | private String deviceModel; |
| | | |
| | | @Schema(description = "设å¤é¡¹ç®") |
| | | private String machineryCategory; |
| | | |
| | | /** |
| | | * 主é®ID |
| | | */ |
| | |
| | | import com.ruoyi.device.pojo.MaintenanceTask; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.quartz.*; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.jdbc.core.BeanPropertyRowMapper; |
| | | import org.springframework.jdbc.core.JdbcTemplate; |
| | | import org.springframework.stereotype.Component; |
| | |
| | | import java.util.Set; |
| | | |
| | | @Component |
| | | @DisallowConcurrentExecution // ç¦æ¢å¹¶åæ§è¡åä¸ä¸ªJob |
| | | @RequiredArgsConstructor |
| | | @DisallowConcurrentExecution |
| | | public class MaintenanceTaskJob implements Job, Serializable { |
| | | private static final long serialVersionUID = 1L; // å¿
é¡»å®ä¹åºååID |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | private final DeviceMaintenanceServiceImpl deviceMaintenanceService; |
| | | @Autowired |
| | | private DeviceMaintenanceServiceImpl deviceMaintenanceService; |
| | | |
| | | private final JdbcTemplate jdbcTemplate; |
| | | @Autowired |
| | | private JdbcTemplate jdbcTemplate; |
| | | |
| | | @Override |
| | | public void execute(JobExecutionContext context) throws JobExecutionException { |
| | |
| | | inspectionTask.setTenantId(timingTask.getTenantId()); |
| | | inspectionTask.setStatus(0); |
| | | inspectionTask.setDeviceModel(timingTask.getDeviceModel()); |
| | | inspectionTask.setMachineryCategory(timingTask.getMachineryCategory()); |
| | | inspectionTask.setCreateUser(Integer.parseInt(timingTask.getRegistrantId().toString())); |
| | | inspectionTask.setUpdateTime(LocalDateTime.now()); |
| | | inspectionTask.setCreateTime(LocalDateTime.now()); |
| | |
| | | import com.ruoyi.inspectiontask.pojo.TimingTask; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.quartz.*; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.jdbc.core.BeanPropertyRowMapper; |
| | | import org.springframework.jdbc.core.JdbcTemplate; |
| | | import org.springframework.stereotype.Component; |
| | |
| | | |
| | | @Component |
| | | @DisallowConcurrentExecution // ç¦æ¢å¹¶åæ§è¡åä¸ä¸ªJob |
| | | @RequiredArgsConstructor |
| | | public class TimingTaskJob implements Job, Serializable { |
| | | private static final long serialVersionUID = 1L; // å¿
é¡»å®ä¹åºååID |
| | | |
| | | private final InspectionTaskMapper inspectionTaskMapper; |
| | | private final JdbcTemplate jdbcTemplate; |
| | | @Autowired |
| | | private InspectionTaskMapper inspectionTaskMapper; |
| | | @Autowired |
| | | private JdbcTemplate jdbcTemplate; |
| | | |
| | | @Override |
| | | public void execute(JobExecutionContext context) throws JobExecutionException { |
| | |
| | | if (timingTask == null) { |
| | | throw new JobExecutionException("æ¾ä¸å°å®æ¶ä»»å¡: " + taskId); |
| | | } |
| | | |
| | | |
| | | // if (!timingTask.isActive()) { |
| | | // throw new JobExecutionException("宿¶ä»»å¡å·²ç¦ç¨: " + taskId); |
| | | // } |
| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.account.bean.dto.SalesReturnDto; |
| | | import com.ruoyi.account.bean.vo.SalesReturnVo; |
| | | import com.ruoyi.procurementrecord.dto.ReturnManagementDto; |
| | | import com.ruoyi.procurementrecord.pojo.ReturnManagement; |
| | | import org.apache.ibatis.annotations.Param; |
| | |
| | | IPage<ReturnManagementDto> listPage(Page page, @Param("req") ReturnManagementDto returnManagement); |
| | | |
| | | ReturnManagementDto getReturnManagementDtoById(Long id); |
| | | |
| | | IPage<SalesReturnVo> listPageAccountSalesReturn(Page page, @Param("req") SalesReturnDto salesReturnDto); |
| | | } |
| | |
| | | import com.ruoyi.account.pojo.AccountExpense; |
| | | import com.ruoyi.account.service.SalesRefundAmountOrderService; |
| | | import com.ruoyi.common.enums.StockInQualifiedRecordTypeEnum; |
| | | import com.ruoyi.common.enums.StockInUnQualifiedRecordTypeEnum; |
| | | import com.ruoyi.common.utils.OrderUtils; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.procurementrecord.dto.ReturnManagementDto; |
| | |
| | | // æ¯å¦æè´¨éé®é¢ |
| | | if (returnSaleProduct.getIsQuality() == 1) { |
| | | // æè´¨éé®é¢ï¼å
¥ä¸åæ ¼åº |
| | | stockUtils.addUnStock(returnSaleProduct.getProductModelId(),returnSaleProduct.getNum(), StockInUnQualifiedRecordTypeEnum.RETURN_UNSTOCK_IN.getCode(),returnSaleProduct.getId()); |
| | | stockUtils.addUnStock(returnSaleProduct.getProductModelId(),returnSaleProduct.getNum(), StockInQualifiedRecordTypeEnum.RETURN_UNSTOCK_IN.getCode(),returnSaleProduct.getId()); |
| | | }else{ |
| | | // æ è´¨éé®é¢ï¼å
¥åæ ¼åº |
| | | stockUtils.addStock(returnSaleProduct.getProductModelId(),returnSaleProduct.getNum(), StockInQualifiedRecordTypeEnum.RETURN_HE_IN.getCode(),returnSaleProduct.getId()); |
| | |
| | | package com.ruoyi.procurementrecord.utils; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
| | | import com.ruoyi.procurementrecord.mapper.ProcurementRecordMapper; |
| | |
| | | |
| | | /** |
| | | * åæ ¼å
¥åº |
| | | * @param productModelId |
| | | * @param quantity |
| | | * @param recordType |
| | | * @param recordId |
| | | */ |
| | |
| | | return stockInventoryService.addStockOutRecordOnly(stockInventoryDto); |
| | | } |
| | | |
| | | /** |
| | | * å货审æ¹ç¶ææ´æ¹ |
| | | * @param recordType |
| | | * @param recordId |
| | | */ |
| | | public void shipmentStatus(String recordType, Long recordId) { |
| | | LambdaQueryWrapper<StockOutRecord> queryWrapper = new LambdaQueryWrapper<StockOutRecord>().eq(StockOutRecord::getRecordType, recordType) |
| | | .eq(StockOutRecord::getRecordId, recordId); |
| | | StockOutRecord stockOutRecord = stockOutRecordService.getOne(queryWrapper); |
| | | stockOutRecord.setApprovalStatus(0); |
| | | stockOutRecordService.updateById(stockOutRecord); |
| | | } |
| | | |
| | | //ä¸åæ ¼åºåå é¤ |
| | | public void deleteStockInRecord(Long recordId, String recordType) { |
| | | StockInRecord one = stockInRecordService.getOne(new QueryWrapper<StockInRecord>() |
| | |
| | | import com.ruoyi.basic.pojo.Product; |
| | | import com.ruoyi.basic.pojo.ProductModel; |
| | | import com.ruoyi.common.enums.StockInQualifiedRecordTypeEnum; |
| | | import com.ruoyi.common.enums.StockInUnQualifiedRecordTypeEnum; |
| | | import com.ruoyi.common.enums.StockOutQualifiedRecordTypeEnum; |
| | | import com.ruoyi.common.exception.ServiceException; |
| | | import com.ruoyi.common.utils.bean.BeanUtils; |
| | |
| | | } |
| | | ProductionAccount productionAccount = new ProductionAccount(); |
| | | productionAccount.setProductionProductMainId(productionProductMain.getId()); |
| | | // productionAccount.setSalesLedgerId(productionOrder.getSalesLedgerId()); |
| | | // productionAccount.setSalesLedgerProductId(productionOrder.getSalesLedgerProductId() == null ? null : productionOrder.getSalesLedgerProductId().longValue()); |
| | | productionAccount.setSchedulingUserId(user == null ? null : user.getUserId()); |
| | | productionAccount.setSchedulingUserName(user == null ? dto.getUserName() : user.getNickName()); |
| | | productionAccount.setFinishedNum(productQty); |
| | |
| | | productionAccount.setSchedulingDate(LocalDateTime.now()); |
| | | productionAccountMapper.insert(productionAccount); |
| | | } |
| | | // if (defaultDecimal(dto.getScrapQty()).compareTo(BigDecimal.ZERO) > 0) { |
| | | // stockUtils.addUnStock(productModel.getId(), dto.getScrapQty(), |
| | | // StockInUnQualifiedRecordTypeEnum.PRODUCTION_SCRAP.getCode(), productionProductMain.getId()); |
| | | // } |
| | | return true; |
| | | } |
| | | |
| | |
| | | productionOrderRoutingOperationParamMapper.delete( |
| | | Wrappers.<ProductionOrderRoutingOperationParam>lambdaQuery() |
| | | .eq(ProductionOrderRoutingOperationParam::getProductionProductMainId, productionProductMain.getId())); |
| | | stockUtils.deleteStockInRecord(productionProductMain.getId(), StockInUnQualifiedRecordTypeEnum.PRODUCTION_SCRAP.getCode()); |
| | | stockUtils.deleteStockInRecord(productionProductMain.getId(), StockInQualifiedRecordTypeEnum.PRODUCTION_SCRAP.getCode()); |
| | | stockUtils.deleteStockInRecord(productionProductMain.getId(), StockInQualifiedRecordTypeEnum.PRODUCTION_REPORT_STOCK_IN.getCode()); |
| | | stockUtils.deleteStockOutRecord(productionProductMain.getId(), StockOutQualifiedRecordTypeEnum.PRODUCTION_REPORT_STOCK_OUT.getCode()); |
| | | productionProductMainMapper.deleteById(productionProductMain.getId()); |
| | |
| | | public void savePlan(SavePlanVo savePlanVo) { |
| | | Plan plan = BeanUtil.copyProperties(savePlanVo, Plan.class); |
| | | // éä»¶å¤ç |
| | | fileUtil.saveStorageAttachmentByRecordTypeAndRecordId("", RecordTypeEnum.PLAN, savePlanVo.getId(), savePlanVo.getStorageBlobDTOs()); |
| | | fileUtil.saveStorageAttachmentByRecordTypeAndRecordId(null, RecordTypeEnum.PLAN, savePlanVo.getId(), savePlanVo.getStorageBlobDTOs()); |
| | | if (savePlanVo.getId() == null) { |
| | | planMapper.insert(plan); |
| | | } else { |
| | |
| | | String attachmentIds = StrUtil.join(",", Optional.ofNullable(saveInfoStageVo.getAttachmentIds()).orElse(Collections.emptyList())); |
| | | infoStage.setAttachment(attachmentIds); |
| | | |
| | | fileUtil.saveStorageAttachmentByRecordTypeAndRecordId("", RecordTypeEnum.INFO_STAGE, infoStage.getProjectManagementInfoId(), saveInfoStageVo.getStorageBlobDTOs()); |
| | | fileUtil.saveStorageAttachmentByRecordTypeAndRecordId(null, RecordTypeEnum.INFO_STAGE, infoStage.getProjectManagementInfoId(), saveInfoStageVo.getStorageBlobDTOs()); |
| | | |
| | | if (infoStage.getId() == null) { |
| | | infoStageMapper.insert(infoStage); |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.account.bean.dto.PurchaseReturnDto; |
| | | import com.ruoyi.account.bean.vo.PurchaseReturnVo; |
| | | import com.ruoyi.purchase.dto.PurchaseReturnOrderDto; |
| | | import com.ruoyi.purchase.pojo.PurchaseReturnOrders; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | |
| | | IPage<PurchaseReturnOrderHasAllInfoDto> listPage(Page page, @Param("params") PurchaseReturnOrderDto purchaseReturnOrder); |
| | | |
| | | PurchaseReturnOrderHasAllInfoDto getPurchaseReturnOrderHasAllInfoById(@Param("id") @NotNull Long id); |
| | | |
| | | IPage<PurchaseReturnVo> listPageAccountPurchaseReturn(Page page, @Param("req") PurchaseReturnDto purchaseReturnDto); |
| | | } |
| | |
| | | // stockUtils.addStock(qualityInspect.getProductModelId(), qualityInspect.getQuantity(), StockInQualifiedRecordTypeEnum.QUALITYINSPECT_STOCK_IN.getCode(), qualityInspect.getId()); |
| | | //ä»
æ·»å å
¥åºè®°å½ |
| | | StockInventoryDto stockInventoryDto = new StockInventoryDto(); |
| | | //妿æ¯éè´è´¨æ£åæ ¼å
¥åºéç¨CUSTOMIZATION_UNSTOCK_OUT,å
¶ä½åæ ¼å
¥åºéç¨QUALITYINSPECT_STOCK_IN |
| | | stockInventoryDto.setRecordType(String.valueOf(StockInQualifiedRecordTypeEnum.QUALITYINSPECT_STOCK_IN.getCode())); |
| | | if (ObjectUtils.isNotEmpty(qualityInspect.getPurchaseLedgerId())){ |
| | | stockInventoryDto.setRecordType(String.valueOf(StockInQualifiedRecordTypeEnum.CUSTOMIZATION_UNSTOCK_OUT.getCode())); |
| | | } |
| | | stockInventoryDto.setRecordId(qualityInspect.getId()); |
| | | stockInventoryDto.setProductModelId(qualityInspect.getProductModelId()); |
| | | stockInventoryDto.setQualitity(qualityInspect.getQuantity()); |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.enums.StockInQualifiedRecordTypeEnum; |
| | | import com.ruoyi.common.enums.StockInUnQualifiedRecordTypeEnum; |
| | | import com.ruoyi.common.exception.ServiceException; |
| | | import com.ruoyi.common.utils.bean.BeanUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | |
| | | break; |
| | | case "æ¥åº": |
| | | stockUtils.addUnStock(qualityInspect.getProductModelId(), unqualified.getQuantity(), |
| | | StockInUnQualifiedRecordTypeEnum.DEFECTIVE_SCRAP.getCode(), unqualified.getId()); |
| | | StockInQualifiedRecordTypeEnum.DEFECTIVE_SCRAP.getCode(), unqualified.getId()); |
| | | break; |
| | | case "è®©æ¥æ¾è¡": |
| | | stockUtils.addStock(qualityInspect.getProductModelId(), unqualified.getQuantity(), |
| | |
| | | switch (qualityUnqualified.getDealResult()) { |
| | | case "æ¥åº": |
| | | stockUtils.addUnStock(modelId, unqualified.getQuantity(), |
| | | StockInUnQualifiedRecordTypeEnum.DEFECTIVE_SCRAP.getCode(), unqualified.getId()); |
| | | StockInQualifiedRecordTypeEnum.DEFECTIVE_SCRAP.getCode(), unqualified.getId()); |
| | | break; |
| | | case "è®©æ¥æ¾è¡": |
| | | stockUtils.addStock(modelId, unqualified.getQuantity(), |
| | |
| | | import com.ruoyi.sales.dto.SalesLedgerProductDto; |
| | | import com.ruoyi.sales.dto.ShippingInfoDto; |
| | | import com.ruoyi.sales.pojo.ShippingInfo; |
| | | import com.ruoyi.sales.pojo.ShippingProductDetail; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | |
| | | List<SalesLedgerProductDto> getReturnManagementDtoById(@Param("shippingId")Long shippingId); |
| | | |
| | | List<ShippingInfo> getShippingInfoByCustomerName(String customerName); |
| | | |
| | | List<ShippingProductDetail> getDateil(Long id); |
| | | } |
| | |
| | | @Override |
| | | public IPage<ShippingInfoDto> listPage(Page page, ShippingInfo req) { |
| | | IPage<ShippingInfoDto> listPage = shippingInfoMapper.listPage(page, req); |
| | | listPage.getRecords().forEach(item ->{ |
| | | listPage.getRecords().forEach(item -> { |
| | | item.setStorageBlobVOs(fileUtil.getStorageBlobVOsByApplicationAndRecordTypeAndRecordId(ApplicationTypeEnum.IMAGE, RecordTypeEnum.SHIPPING_INFO, item.getId())); |
| | | }); |
| | | return listPage; |
| | |
| | | throw new RuntimeException("åè´§ä¿¡æ¯ä¸åå¨"); |
| | | } |
| | | //æ£ååºå |
| | | if(!"å·²åè´§".equals(byId.getStatus())){ |
| | | if (!"å·²åè´§".equals(byId.getStatus())) { |
| | | List<ShippingProductDetail> shippingProductDetails = shippingProductDetailMapper.selectList(new LambdaQueryWrapper<ShippingProductDetail>().eq(ShippingProductDetail::getShippingInfoId, req.getId())); |
| | | if (CollectionUtils.isEmpty(shippingProductDetails)) { |
| | | throw new RuntimeException("åè´§ä¿¡æ¯ä¸åå¨"); |
| | |
| | | boolean update = this.updateById(byId); |
| | | // ä¿åæä»¶ |
| | | fileUtil.saveStorageAttachment(ApplicationTypeEnum.IMAGE, RecordTypeEnum.SHIPPING_INFO, req.getId(), req.getStorageBlobDTOs()); |
| | | return update ; |
| | | return update; |
| | | } |
| | | |
| | | @Override |
| | | public boolean delete(List<Long> ids) { |
| | | List<ShippingInfo> shippingInfos = shippingInfoMapper.selectList(new LambdaQueryWrapper<ShippingInfo>() |
| | | .in(ShippingInfo::getId, ids)); |
| | | if(CollectionUtils.isEmpty(shippingInfos)) return false; |
| | | if (CollectionUtils.isEmpty(shippingInfos)) return false; |
| | | // å é¤éä»¶ |
| | | commonFileService.deleteByBusinessIds(ids, FileNameType.SHIP.getValue()); |
| | | // æ£å·²åè´§åºå |
| | | for (ShippingInfo shippingInfo : shippingInfos) { |
| | | if("å·²åè´§".equals(shippingInfo.getStatus())) { |
| | | if ("å·²åè´§".equals(shippingInfo.getStatus())) { |
| | | stockUtils.deleteStockOutRecord(shippingInfo.getId(), StockOutQualifiedRecordTypeEnum.SALE_SHIP_STOCK_OUT.getCode()); |
| | | } |
| | | } |
| | | // å é¤åè´§å®¡æ¹ |
| | | if(CollectionUtils.isNotEmpty(shippingInfos)){ |
| | | for (ShippingInfo shippingInfo : shippingInfos){ |
| | | if (CollectionUtils.isNotEmpty(shippingInfos)) { |
| | | for (ShippingInfo shippingInfo : shippingInfos) { |
| | | List<ApproveProcess> one = approveProcessService.list(new LambdaQueryWrapper<ApproveProcess>() |
| | | .like(ApproveProcess::getApproveReason, shippingInfo.getShippingNo())); |
| | | if(one != null){ |
| | | if (one != null) { |
| | | List<Long> list = one.stream().map(ApproveProcess::getId).toList(); |
| | | approveProcessService.delByIds(list); |
| | | } |
| | |
| | | |
| | | @Override |
| | | public List<SalesLedgerProductDto> getReturnManagementDtoById(Long shippingId) { |
| | | return shippingInfoMapper.getReturnManagementDtoById(shippingId ); |
| | | return shippingInfoMapper.getReturnManagementDtoById(shippingId); |
| | | |
| | | } |
| | | |
| | |
| | | |
| | | @Override |
| | | public boolean add(ShippingInfoDto req) { |
| | | this.save( req); |
| | | this.save(req); |
| | | req.getBatchNoDetailList().forEach(item -> item.setShippingInfoId(req.getId())); |
| | | shippingProductDetailMapper.insert(req.getBatchNoDetailList()); |
| | | for (ShippingProductDetail shippingProductDetail : req.getBatchNoDetailList()) { |
| | | stockUtils.substractStock(shippingProductDetail.getProductModelId(), shippingProductDetail.getQuantity(), StockOutQualifiedRecordTypeEnum.SALE_SHIP_STOCK_OUT.getCode(), req.getId(), shippingProductDetail.getBatchNo()); |
| | | } |
| | | // ä¿åæä»¶ |
| | | fileUtil.saveStorageAttachment(ApplicationTypeEnum.IMAGE, RecordTypeEnum.SHIPPING_INFO, req.getId(), req.getStorageBlobDTOs()); |
| | | return true; |
| | | } |
| | | |
| | |
| | | ShippingApproveDto shippingApproveDto = new ShippingApproveDto(); |
| | | ShippingInfo shippingInfo = new ShippingInfo(); |
| | | shippingInfo.setShippingNo(shippingNo); |
| | | shippingApproveDto.setShippingInfo(shippingInfoMapper.listPage(new Page(1, -1),shippingInfo).getRecords().get(0)); |
| | | shippingApproveDto.setShippingInfo(shippingInfoMapper.listPage(new Page(1, -1), shippingInfo).getRecords().get(0)); |
| | | List<ShippingProductDetailDto> dateilByShippingNo = shippingProductDetailMapper.getDateilByShippingNo(shippingNo); |
| | | shippingApproveDto.setShippingProductDetailDtoList(dateilByShippingNo); |
| | | return shippingApproveDto; |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.enums.StockInUnQualifiedRecordTypeEnum; |
| | | import com.ruoyi.common.enums.StockOutUnQualifiedRecordTypeEnum; |
| | | import com.ruoyi.common.enums.StockInQualifiedRecordTypeEnum; |
| | | import com.ruoyi.common.enums.StockOutQualifiedRecordTypeEnum; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.stock.dto.StockInventoryDto; |
| | | import com.ruoyi.stock.dto.StockUninventoryDto; |
| | |
| | | @PostMapping("/addstockUninventory") |
| | | @Operation(summary = "æ°å¢åºå") |
| | | public R addstockUninventory(@RequestBody StockUninventoryDto stockUninventoryDto) { |
| | | stockUninventoryDto.setRecordType(String.valueOf(StockInUnQualifiedRecordTypeEnum.CUSTOMIZATION_UNSTOCK_IN.getCode())); |
| | | stockUninventoryDto.setRecordType(String.valueOf(StockInQualifiedRecordTypeEnum.CUSTOMIZATION_UNSTOCK_IN.getCode())); |
| | | stockUninventoryDto.setRecordId(0L); |
| | | return R.ok(stockUninventoryService.addStockUninventory(stockUninventoryDto)); |
| | | } |
| | |
| | | @PostMapping("/subtractstockUninventory") |
| | | @Operation(summary = "æ£ååºå") |
| | | public R subtractstockUninventory(@RequestBody StockUninventoryDto stockUninventoryDto) { |
| | | stockUninventoryDto.setRecordType(String.valueOf(StockOutUnQualifiedRecordTypeEnum.CUSTOMIZATION_UNSTOCK_OUT.getCode())); |
| | | stockUninventoryDto.setRecordType(String.valueOf(StockOutQualifiedRecordTypeEnum.CUSTOMIZATION_UNSTOCK_OUT.getCode())); |
| | | stockUninventoryDto.setRecordId(0L); |
| | | return R.ok(stockUninventoryService.subtractStockUninventory(stockUninventoryDto)); |
| | | } |
| | |
| | | @PostMapping("/addStockInRecordOnly") |
| | | @Operation(summary = "æ°å¢å
¥åºè®°å½ï¼ä»
å建记å½ï¼ä¸è°æ´åºåï¼") |
| | | public R addStockInRecordOnly(@RequestBody StockUninventoryDto stockUninventoryDto) { |
| | | stockUninventoryDto.setRecordType(String.valueOf(StockInUnQualifiedRecordTypeEnum.CUSTOMIZATION_UNSTOCK_IN.getCode())); |
| | | stockUninventoryDto.setRecordType(String.valueOf(StockInQualifiedRecordTypeEnum.CUSTOMIZATION_UNSTOCK_IN.getCode())); |
| | | stockUninventoryDto.setRecordId(0L); |
| | | return R.ok(stockUninventoryService.addStockInRecordOnly(stockUninventoryDto)); |
| | | } |
| | |
| | | @PostMapping("/addStockOutRecordOnly") |
| | | @Operation(summary = "æ°å¢åºåºè®°å½ï¼ä»
å建记å½ï¼ä¸è°æ´åºåï¼") |
| | | public R addStockOutRecordOnly(@RequestBody StockUninventoryDto stockUninventoryDto) { |
| | | stockUninventoryDto.setRecordType(String.valueOf(StockOutUnQualifiedRecordTypeEnum.CUSTOMIZATION_UNSTOCK_OUT.getCode())); |
| | | stockUninventoryDto.setRecordType(String.valueOf(StockOutQualifiedRecordTypeEnum.CUSTOMIZATION_UNSTOCK_OUT.getCode())); |
| | | stockUninventoryDto.setRecordId(0L); |
| | | return R.ok(stockUninventoryService.addStockOutRecordOnly(stockUninventoryDto)); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.account.bean.dto.PurchaseInboundDto; |
| | | import com.ruoyi.account.bean.vo.PurchaseInboundVo; |
| | | import com.ruoyi.stock.dto.StockInRecordDto; |
| | | import com.ruoyi.stock.execl.StockInRecordExportData; |
| | | import com.ruoyi.stock.pojo.StockInRecord; |
| | |
| | | IPage<StockInRecordDto> listPage(Page page, @Param("params") StockInRecordDto stockInRecordDto); |
| | | |
| | | List<StockInRecordExportData> listStockInRecordExportData(@Param("params") StockInRecordDto stockInRecordDto); |
| | | |
| | | IPage<PurchaseInboundVo> listPageAccountPurchase(Page page, @Param("req") PurchaseInboundDto purchaseInboundDto); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.account.bean.dto.SalesOutboundDto; |
| | | import com.ruoyi.account.bean.vo.SalesOutboundVo; |
| | | import com.ruoyi.stock.dto.StockOutRecordDto; |
| | | import com.ruoyi.stock.execl.StockOutRecordExportData; |
| | | import com.ruoyi.stock.pojo.StockOutRecord; |
| | |
| | | |
| | | List<StockOutRecordExportData> listStockOutRecordExportData(@Param("params") StockOutRecordDto stockOutRecordDto); |
| | | |
| | | IPage<SalesOutboundVo> listPageAccountSales(Page page, @Param("req") SalesOutboundDto salesOutboundDto); |
| | | } |
| | |
| | | @Schema(description = "ç±»å 0åæ ¼å
¥åº 1ä¸åæ ¼å
¥åº") |
| | | private String type; |
| | | |
| | | @Schema(description = "审æ¹ç¶æ 0-å¾
å®¡æ¹ 1-éè¿ 2-驳å", implementation = ReviewStatusEnum.class) |
| | | @Schema(description = "审æ¹ç¶æ 0-å¾
å®¡æ¹ 1-éè¿ 2-驳å 3-éå®åºåºå¾
确认", implementation = ReviewStatusEnum.class) |
| | | private Integer approvalStatus; |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.enums.ReviewStatusEnum; |
| | | import com.ruoyi.common.enums.StockInQualifiedRecordTypeEnum; |
| | | import com.ruoyi.common.enums.StockInUnQualifiedRecordTypeEnum; |
| | | import com.ruoyi.common.enums.StockOutQualifiedRecordTypeEnum; |
| | | import com.ruoyi.common.exception.base.BaseException; |
| | | import com.ruoyi.common.utils.EnumUtil; |
| | |
| | | if (stockInRecordExportData.getType().equals("0")) { |
| | | stockInRecordExportData.setRecordType(EnumUtil.fromCode(StockOutQualifiedRecordTypeEnum.class, Integer.parseInt(stockInRecordExportData.getRecordType())).getValue()); |
| | | }else { |
| | | stockInRecordExportData.setRecordType(EnumUtil.fromCode(StockInUnQualifiedRecordTypeEnum.class, Integer.parseInt(stockInRecordExportData.getRecordType())).getValue()); |
| | | stockInRecordExportData.setRecordType(EnumUtil.fromCode(StockInQualifiedRecordTypeEnum.class, Integer.parseInt(stockInRecordExportData.getRecordType())).getValue()); |
| | | } |
| | | } |
| | | ExcelUtil<StockInRecordExportData> util = new ExcelUtil<>(StockInRecordExportData.class); |
| | |
| | | import com.ruoyi.basic.mapper.ProductModelMapper; |
| | | import com.ruoyi.basic.pojo.ProductModel; |
| | | import com.ruoyi.common.enums.StockInQualifiedRecordTypeEnum; |
| | | import com.ruoyi.common.enums.StockInUnQualifiedRecordTypeEnum; |
| | | import com.ruoyi.common.exception.ServiceException; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | |
| | | if (dto.getUnQualifiedQuantity() != null && dto.getUnQualifiedQuantity().compareTo(BigDecimal.ZERO) > 0) { |
| | | StockUninventoryDto stockUninventoryDto = new StockUninventoryDto(); |
| | | stockUninventoryDto.setRecordId(0L); |
| | | stockUninventoryDto.setRecordType(StockInUnQualifiedRecordTypeEnum.CUSTOMIZATION_UNSTOCK_IN.getCode()); |
| | | stockUninventoryDto.setRecordType(StockInQualifiedRecordTypeEnum.CUSTOMIZATION_UNSTOCK_IN.getCode()); |
| | | stockUninventoryDto.setQualitity(dto.getUnQualifiedQuantity()); |
| | | stockUninventoryDto.setRemark(dto.getRemark()); |
| | | |
| | |
| | | public Long add(StockOutRecordDto stockOutRecordDto) { |
| | | String no = OrderUtils.countTodayByCreateTime(stockOutRecordMapper, "CK","outbound_batches"); |
| | | stockOutRecordDto.setOutboundBatches(no); |
| | | if (StockOutQualifiedRecordTypeEnum.SALE_SHIP_STOCK_OUT.getCode().equals(stockOutRecordDto.getRecordType())){ |
| | | stockOutRecordDto.setApprovalStatus(3); |
| | | } |
| | | StockInRecord stockInRecord = new StockInRecord(); |
| | | BeanUtils.copyProperties(stockOutRecordDto, stockInRecord); |
| | | stockOutRecordMapper.insert(stockOutRecordDto); |
| | |
| | | if (stockInRecordExportData.getType().equals("0")) { |
| | | stockInRecordExportData.setRecordType(EnumUtil.fromCode(StockOutQualifiedRecordTypeEnum.class, Integer.parseInt(stockInRecordExportData.getRecordType())).getValue()); |
| | | }else { |
| | | stockInRecordExportData.setRecordType(EnumUtil.fromCode(StockInUnQualifiedRecordTypeEnum.class, Integer.parseInt(stockInRecordExportData.getRecordType())).getValue()); |
| | | stockInRecordExportData.setRecordType(EnumUtil.fromCode(StockInQualifiedRecordTypeEnum.class, Integer.parseInt(stockInRecordExportData.getRecordType())).getValue()); |
| | | } |
| | | } |
| | | ExcelUtil<StockOutRecordExportData> util = new ExcelUtil<>(StockOutRecordExportData.class); |
| | |
| | | <select id="pageSalesRefundAmountOrderDto" resultType="com.ruoyi.account.bean.dto.SalesRefundAmountOrderDto"> |
| | | select sl.sales_contract_no, |
| | | sl.customer_contract_no, |
| | | slp.specification_model, |
| | | slp.product_category as product_name, |
| | | slp.unit, |
| | | pm.model as specification_model, |
| | | p.product_name , |
| | | pm.unit, |
| | | sl.customer_name, |
| | | rm.return_no as return_management_no, |
| | | srao.* |
| | |
| | | left join return_management rm on srao.return_management_id = rm.id |
| | | left join return_sale_product rs on rm.id = rs.return_management_id |
| | | left join sales_ledger_product slp on rs.return_sales_ledger_product_id = slp.id |
| | | left join product_model pm on slp.product_model_id = pm.id |
| | | left join product p on pm.product_id = p.id |
| | | left join sales_ledger sl on slp.sales_ledger_id = sl.id |
| | | <where> |
| | | <if test="ew.salesContractNo != null and ew.salesContractNo !=''"> |
| | |
| | | left join sales_ledger sl on si.sales_ledger_id = sl.id |
| | | where rm.id = #{id} |
| | | </select> |
| | | </mapper> |
| | | <select id="listPageBySalesReturn" resultType="com.ruoyi.account.bean.vo.SalesReturnVo"> |
| | | select rm.id, |
| | | rm.return_no, |
| | | c.customer_name, |
| | | si.shipping_no, |
| | | rm.make_time, |
| | | rm.refund_amount, |
| | | rm.return_reason, |
| | | rm.make_time, |
| | | sl.sales_contract_no |
| | | from return_management rm |
| | | left join shipping_info si on rm.shipping_id = si.id |
| | | left join customer c on rm.customer_id = c.id |
| | | left join sales_ledger sl on si.sales_ledger_id = sl.id |
| | | where rm.status=1 |
| | | <if test="req.returnNo != null and req.returnNo != ''"> |
| | | and rm.return_no like concat('%',#{req.returnNo},'%') |
| | | </if> |
| | | <if test="req.customerName != null and req.customerName != ''"> |
| | | and c.customer_name like concat('%',#{req.customerName},'%') |
| | | </if> |
| | | <if test="req.startDate != null and req.endDate != null"> |
| | | AND DATE_FORMAT(rm.make_time, '%Y-%m-%d') BETWEEN #{startDate} AND #{endDate} |
| | | </if> |
| | | order by rm.id DESC |
| | | </select> |
| | | </mapper> |
| | |
| | | <result column="status" property="status" /> |
| | | </resultMap> |
| | | <select id="listReturnSaleProductDto" resultType="com.ruoyi.procurementrecord.dto.ReturnSaleProductDto"> |
| | | SELECT slp.product_category as product_name, |
| | | slp.specification_model as model, |
| | | slp.unit as unit, |
| | | SELECT p.product_name as product_name, |
| | | pm.model as model, |
| | | pm.unit as unit, |
| | | rsp.*, |
| | | GREATEST(slp.quantity - COALESCE(rs.total_return_num, 0), 0) AS un_quantity, |
| | | COALESCE(rs.total_return_num, 0) AS total_return_num |
| | |
| | | LEFT JOIN return_management rm ON rm.id = rsp.return_management_id |
| | | LEFT JOIN shipping_info si ON si.id = rm.shipping_id |
| | | LEFT JOIN sales_ledger_product slp ON si.sales_ledger_product_id = slp.id and slp.type = 1 |
| | | left join product_model pm on slp.product_model_id = pm.id |
| | | LEFT JOIN product p on pm.product_id = p.id |
| | | LEFT JOIN (SELECT return_sales_ledger_product_id, |
| | | |
| | | SUM(num) AS total_return_num |
| | |
| | | <include refid="getPurchaseReturnOrderHasAllInfoFormAndColumn"/> |
| | | where pro.id = #{id} |
| | | </select> |
| | | <select id="listPageAccountPurchaseReturn" |
| | | resultType="com.ruoyi.account.bean.vo.PurchaseReturnVo"> |
| | | select pro.id, |
| | | pro.no returnNo, |
| | | sm.supplier_name, |
| | | |
| | | pro.prepared_at, |
| | | pro.total_amount, |
| | | CASE pro.return_type WHEN 0 THEN 'éè´§éæ¬¾' WHEN 1 THEN 'ææ¶' END AS returnType, |
| | | pl.purchase_contract_number |
| | | from purchase_return_orders pro |
| | | left join supplier_manage sm on pro.supplier_id = sm.id |
| | | left join purchase_ledger pl on pro.purchase_ledger_id = pl.id |
| | | where rm.status=1 |
| | | <if test="req.returnNo != null and req.returnNo != ''"> |
| | | and pro.no like concat('%',#{req.returnNo},'%') |
| | | </if> |
| | | <if test="req.supplierName != null and req.supplierName != ''"> |
| | | and sm.supplier_name like concat('%',#{req.supplierName},'%') |
| | | </if> |
| | | <if test="req.startDate != null and req.endDate != null"> |
| | | AND DATE_FORMAT(pro.prepared_at, '%Y-%m-%d') BETWEEN #{startDate} AND #{endDate} |
| | | </if> |
| | | order by pro.id DESC |
| | | </select> |
| | | </mapper> |
| | |
| | | |
| | | <select id="selectSalesLedgerProductList" resultType="com.ruoyi.sales.pojo.SalesLedgerProduct"> |
| | | SELECT |
| | | T1.*, |
| | | T1.id, |
| | | T1.sales_ledger_id, |
| | | T1.warn_num, |
| | | T1.speculative_trading_name, |
| | | T1.quantity, |
| | | T1.min_stock, |
| | | T1.tax_rate, |
| | | T1.tax_inclusive_unit_price, |
| | | T1.tax_inclusive_total_price, |
| | | T1.tax_exclusive_total_price, |
| | | T1.invoice_type, |
| | | T1.type, |
| | | T1.tickets_num, |
| | | T1.tickets_amount, |
| | | T1.future_tickets, |
| | | T1.future_tickets_amount, |
| | | T1.invoice_num, |
| | | T1.no_invoice_num, |
| | | T1.invoice_amount, |
| | | T1.no_invoice_amount, |
| | | T1.product_id, |
| | | T1.product_model_id, |
| | | T1.register, |
| | | T1.register_date, |
| | | T1.approve_status, |
| | | T1.pending_invoice_total, |
| | | T1.invoice_total, |
| | | T1.pending_tickets_total, |
| | | T1.tickets_total, |
| | | T1.is_checked, |
| | | T1.is_production, |
| | | T1.create_user, |
| | | T1.dept_id, |
| | | p.product_name as product_category, |
| | | pm.model as specification_model, |
| | | pm.unit as unit, |
| | | CASE |
| | | WHEN (IFNULL(t2.qualitity, 0) - IFNULL(t2.locked_quantity, 0)) >0 THEN 1 |
| | | ELSE 0 |
| | |
| | | LEFT JOIN shipping_product_detail spd ON si.id = spd.shipping_info_id |
| | | GROUP BY sales_ledger_product_id |
| | | ) t3 ON t3.sales_ledger_product_id = T1.id |
| | | left join product_model pm ON T1.product_model_id = pm.id |
| | | left join product p ON pm.product_id = p.id |
| | | <where> |
| | | <if test="salesLedgerProduct.salesLedgerId != null"> |
| | | AND T1.sales_ledger_id = #{salesLedgerProduct.salesLedgerId} |
| | |
| | | s.update_user, |
| | | s.tenant_id, |
| | | sl.sales_contract_no, |
| | | slp.specification_model, |
| | | pm.model as specification_model, |
| | | pm.unit, |
| | | p.product_name, |
| | | sl.customer_name |
| | | FROM shipping_info s |
| | |
| | | </where> |
| | | order by sir.id desc |
| | | </select> |
| | | <select id="listPageAccountPurchase" resultType="com.ruoyi.account.bean.vo.PurchaseInboundVo"> |
| | | SELECT |
| | | sir.id, |
| | | sir.inbound_batches, |
| | | pl.supplier_name, |
| | | DATE(sir.create_time) AS inboundDate, |
| | | p.product_name, |
| | | pm.model as specification_model, |
| | | sor.stock_in_num * slp.tax_inclusive_unit_price AS InboundAmount, |
| | | pl.purchase_contract_number |
| | | FROM stock_in_record sir |
| | | -- 10 ç±»åæå
³èè´¨æ£è¡¨ |
| | | LEFT JOIN quality_inspect qi ON sir.record_type = 10 AND sir.record_id = qi.id |
| | | -- 卿å
³èéè´ï¼èªå¨éé
7 å 10ï¼ |
| | | LEFT JOIN purchase_ledger pl |
| | | ON pl.id = IF(sir.record_type = 7, sir.record_id, qi.purchase_ledger_id) |
| | | -- 产åå
³èä¸å¨ |
| | | LEFT JOIN sales_ledger_product slp ON slp.type = 2 AND pl.id = slp.product_id |
| | | LEFT JOIN product_model pm ON slp.product_model_id = pm.id |
| | | LEFT JOIN product p ON pm.product_id = p.id |
| | | -- æ¡ä»¶ |
| | | WHERE sir.approval_status = 1 |
| | | AND sir.record_type IN ('7','10') |
| | | <if test="req.inboundBatches != null and req.inboundBatches != ''"> |
| | | AND sir.inbound_batches LIKE CONCAT('%',#{req.inboundBatches},'%') |
| | | </if> |
| | | <if test="req.supplierName != null and req.supplierName != ''"> |
| | | AND pl.supplier_name LIKE CONCAT('%',#{req.supplierName},'%') |
| | | </if> |
| | | <if test="req.startDate != null and req.endDate != null"> |
| | | AND DATE(sir.create_time) BETWEEN #{startDate} AND #{endDate} |
| | | </if> |
| | | order by sir.id DESC |
| | | </select> |
| | | </mapper> |
| | |
| | | WHERE sor.product_model_id = #{productModelId} |
| | | AND (sor.batch_no = #{batchNo} OR (#{batchNo} IS NULL AND sor.batch_no IS NULL)) |
| | | AND sor.type = #{type} |
| | | AND sor.approval_status = 0 |
| | | AND sor.approval_status IN (0, 3) |
| | | </select> |
| | | |
| | | <select id="listSelectableBatchNoByProductModelIds" resultType="com.ruoyi.stock.pojo.StockInventory"> |
| | |
| | | order by si.product_model_id, si.batch_no |
| | | </select> |
| | | <select id="getByModelId" resultType="com.ruoyi.stock.pojo.StockInventory"> |
| | | select spd.id, spd.batch_no, spd.locked_quantity, (spd.qualitity - IFNULL(sd.qualitity, 0)) as qualitity |
| | | from stock_inventory spd |
| | | left join (select stock_inventory_id, sum(quantity) as qualitity |
| | | from shipping_product_detail |
| | | group by stock_inventory_id) as sd on sd.stock_inventory_id = spd.id |
| | | where product_model_id = #{productModelId} |
| | | select si.id, si.batch_no, si.locked_quantity, (si.qualitity - IFNULL(sd.qualitity, 0)) as qualitity |
| | | from stock_inventory si |
| | | left join ( |
| | | select spd.stock_inventory_id, sum(spd.quantity) as qualitity |
| | | from shipping_product_detail spd |
| | | where exists ( |
| | | select 1 |
| | | from stock_out_record sor |
| | | where sor.record_id = spd.shipping_info_id |
| | | and sor.record_type = '13' |
| | | and sor.type = '0' |
| | | and sor.approval_status in (0, 3) |
| | | and sor.product_model_id = spd.product_model_id |
| | | and (sor.batch_no = spd.batch_no or (sor.batch_no is null and spd.batch_no is null)) |
| | | ) |
| | | group by spd.stock_inventory_id |
| | | ) as sd on sd.stock_inventory_id = si.id |
| | | where si.product_model_id = #{productModelId} |
| | | </select> |
| | | <select id="selectStockInvenrory" resultType="com.ruoyi.stock.dto.StockInventoryDto"> |
| | | select spd.id, spd.batch_no,pm.model,pm.unit,p.product_name, spd.qualitity,spd.product_model_id |
| | |
| | | order by sor.id desc |
| | | </select> |
| | | |
| | | <select id="listPageAccountSales" resultType="com.ruoyi.account.bean.vo.SalesOutboundVo"> |
| | | SELECT |
| | | sor.id, |
| | | sor.outbound_batches, |
| | | sl.customer_name, |
| | | s.shipping_date, |
| | | p.product_name, |
| | | pm.model as specification_model, |
| | | sor.stock_out_num * slp.tax_inclusive_unit_price as outboundAmount, |
| | | s.shipping_no, |
| | | sl.sales_contract_no |
| | | FROM stock_out_record sor |
| | | left join shipping_info s on sor.record_id = s.id |
| | | LEFT JOIN sales_ledger sl ON s.sales_ledger_id = sl.id |
| | | LEFT JOIN sales_ledger_product slp ON s.sales_ledger_product_id = slp.id and slp.type = 1 |
| | | left join product_model pm on slp.product_model_id = pm.id |
| | | left join product p on pm.product_id = p.id |
| | | WHERE s.status='å·²åè´§' and sor.record_type='13' |
| | | <if test="req.outboundBatches != null and req.outboundBatches != ''"> |
| | | AND sor.outbound_batches LIKE CONCAT('%',#{req.outboundBatches},'%') |
| | | </if> |
| | | <if test="req.customerName != null and req.customerName != ''"> |
| | | AND sl.customer_name LIKE CONCAT('%',#{req.customerName},'%') |
| | | </if> |
| | | <if test="req.startDate != null and req.endDate != null"> |
| | | AND s.shipping_date BETWEEN #{startDate} AND #{endDate} |
| | | </if> |
| | | order by sor.id DESC |
| | | </select> |
| | | </mapper> |