已修改14个文件
已添加45个文件
3097 ■■■■■ 文件已修改
doc/add.sql 58 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/common/config/IgnoreTableConfig.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/common/config/TomcatConfig.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/device/controller/DeviceLedgerController.java 75 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/device/controller/DeviceMaintenanceController.java 69 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/device/controller/DeviceRepairController.java 67 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/device/dto/DeviceLedgerDto.java 101 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/device/dto/DeviceMaintenanceDto.java 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/device/dto/DeviceRepairDto.java 70 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/device/execl/DeviceLedgerExeclDto.java 87 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/device/execl/DeviceMaintenanceExeclDto.java 52 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/device/execl/DeviceRepairExeclDto.java 64 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/device/mapper/DeviceLedgerMapper.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/device/mapper/DeviceMaintenanceMapper.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/device/mapper/DeviceRepairMapper.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/device/pojo/DeviceLedger.java 106 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/device/pojo/DeviceMaintenance.java 63 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/device/pojo/DeviceRepair.java 74 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/device/service/IDeviceLedgerService.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/device/service/IDeviceMaintenanceService.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/device/service/IDeviceRepairService.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/device/service/impl/DeviceLedgerServiceImpl.java 91 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/device/service/impl/DeviceMaintenanceServiceImpl.java 74 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/device/service/impl/DeviceRepairServiceImpl.java 90 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/inventory/domain/StockIn.java 70 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/inventory/domain/StockManagement.java 54 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/inventory/domain/StockOut.java 70 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/inventory/domain/StockProduct.java 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/inventory/mapper/StockInMapper.java 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/inventory/mapper/StockManagementMapper.java 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/inventory/mapper/StockOutMapper.java 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/inventory/mapper/StockProductMapper.java 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/purchase/mapper/PurchaseLedgerMapper.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/purchase/pojo/PurchaseLedger.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/purchase/service/impl/PurchaseLedgerServiceImpl.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/sales/controller/ReceiptPaymentController.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/sales/dto/ReceiptPaymentDto.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/sales/dto/ReceiptPaymentExeclDto.java 57 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/sales/mapper/ReceiptPaymentMapper.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/sales/service/ReceiptPaymentService.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/sales/service/impl/ReceiptPaymentServiceImpl.java 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/staff_management/controller/RyglAddEmployeeController.java 94 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/staff_management/domain/RyglAddEmployee.java 104 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/staff_management/mapper/RyglAddEmployeeMapper.java 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/staff_management/service/RyglAddEmployeeService.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/staff_management/service/impl/RyglAddEmployeeServiceImpl.java 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/application-druid.yml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/application.yml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/StockInMapper.xml 130 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/StockManagementMapper.xml 106 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/StockOutMapper.xml 130 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/StockProductMapper.xml 75 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/device/DeviceLedgerMapper.xml 69 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/device/DeviceMaintenanceMapper.xml 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/device/DeviceRepairMapper.xml 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/purchase/PurchaseLedgerMapper.xml 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/sales/ReceiptPaymentMapper.xml 169 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/sales/SalesLedgerMapper.xml 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/staff_management/RyglAddEmployeeMapper.xml 194 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
doc/add.sql
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,58 @@
# è®¾å¤‡å°è´¦
create table `product-inventory-management`.device_repair
(
    id                 bigint auto_increment
        primary key,
    device_ledger_id   varchar(255) not null comment '设备台账id',
    repair_time        timestamp    null comment '报修日期',
    repair_name        varchar(255) not null comment '报修人',
    remark             varchar(255) not null comment '故障现象',
    maintenance_name   varchar      not null comment '维修人',
    maintenance_time   timestamp    null comment '维修时间',
    maintenance_result varchar(255) null comment '维修结果',
    status             int default 0 comment '状态',
    create_time        datetime     null comment '录入时间',
    update_time        datetime     null comment '更新时间',
    create_user        varchar(255) not null comment '录入人',
    update_user        varchar(255) not null comment '更新人',
    tenant_id          bigint       not null comment '租户id'
);
# è®¾å¤‡ç»´ä¿®
create table `product-inventory-management`.device_ledger
(
    id                           bigint auto_increment
        primary key,
    device_name                  varchar(255) not null comment '设备名称',
    device_model                 varchar(255) not null comment '规格型号',
    supplier_name                varchar(255) not null comment '供应商',
    unit                         varchar(255) not null comment '单位',
    number                       decimal      not null comment '数量',
    tax_including_price_unit     decimal      not null comment '含税单价',
    tax_including_price_total    decimal      not null comment '含税总价',
    tax_rate                     decimal      not null comment '税率',
    un_tax_including_price_total decimal      not null comment '不含税总价',
    create_time                  timestamp    null comment '录入时间',
    update_time                  timestamp    null comment '更新时间',
    create_user                  varchar(255) not null comment '录入人',
    update_user                  varchar(255) not null comment '更新人',
    tenant_id                    bigint       not null comment '租户id'
);
create table `product-inventory-management`.device_maintenance
(
    id                 bigint auto_increment
        primary key,
    device_ledger_id   varchar(255) not null comment '设备台账id',
    maintenance__plan_time        timestamp    null comment '计划保养日期',
    maintenance_actually_name   varchar(255)      not null comment '实际保养人',
    maintenance_actually_time   timestamp    null comment '实际保养日期',
    maintenance_result int not null  default 0 comment '保养结果 0 ç»´ä¿® 1 å®Œå¥½',
    status             int not null  default 0 comment '状态 0 å¾…保养 1 å®Œç»“',
    create_time        datetime     null comment '录入时间',
    update_time        datetime     null comment '更新时间',
    create_user        varchar(255) not null comment '录入人',
    update_user        varchar(255) not null comment '更新人',
    tenant_id          bigint       not null comment '租户id'
);
src/main/java/com/ruoyi/common/config/IgnoreTableConfig.java
@@ -33,5 +33,7 @@
        IGNORE_TABLES.add("sys_oper_log");
        IGNORE_TABLES.add("sys_user_dept");
        IGNORE_TABLES.add("sys_job_log");
        IGNORE_TABLES.add("gen_table");
        IGNORE_TABLES.add("gen_table_column");
    }
}
src/main/java/com/ruoyi/common/config/TomcatConfig.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,20 @@
package com.ruoyi.common.config;
import org.apache.catalina.connector.Connector;
import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
// ä¿®æ”¹tomcat配置,对get中[]放行
@Configuration
public class TomcatConfig {
    @Bean
    public TomcatServletWebServerFactory webServerFactory() {
        TomcatServletWebServerFactory factory = new TomcatServletWebServerFactory();
        factory.addConnectorCustomizers((Connector connector) -> {
            connector.setProperty("relaxedPathChars", "\"<>[\\]^`{|}");
            connector.setProperty("relaxedQueryChars", "\"<>[\\]^`{|}");
        });
        return factory;
    }
}
src/main/java/com/ruoyi/device/controller/DeviceLedgerController.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,75 @@
package com.ruoyi.device.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.device.dto.DeviceLedgerDto;
import com.ruoyi.device.pojo.DeviceLedger;
import com.ruoyi.device.service.IDeviceLedgerService;
import com.ruoyi.framework.web.domain.AjaxResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.ArrayUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.Arrays;
@Api(tags = "设备台账管理")
@RequestMapping("/device/ledger")
@RestController
public class DeviceLedgerController {
    @Autowired
    private IDeviceLedgerService deviceLedgerService;
    @ApiModelProperty("设备台账列表")
    @GetMapping("/page")
    public AjaxResult page(Page page , DeviceLedgerDto deviceLedger) {
        return AjaxResult.success(deviceLedgerService.queryPage(page,deviceLedger));
    }
    @PostMapping()
    @ApiModelProperty("添加设备台账")
    public AjaxResult add(@RequestBody DeviceLedger deviceLedger) {
        return deviceLedgerService.saveDeviceLedger(deviceLedger);
    }
    @ApiModelProperty("根据id查询设备台账")
    @GetMapping("/{id}")
    public AjaxResult detail(@PathVariable Long id) {
        return AjaxResult.success(deviceLedgerService.getById(id));
    }
    @PutMapping ()
    @ApiModelProperty("修改设备台账")
    public AjaxResult update(@RequestBody DeviceLedger deviceLedger) {
        return deviceLedgerService.updateDeviceLedger(deviceLedger);
    }
    @DeleteMapping("/{ids}")
    @ApiModelProperty("删除设备台账")
    public AjaxResult delete(@PathVariable("ids") ArrayList<Long> ids) {
        boolean b = deviceLedgerService.removeBatchByIds(ids);
        if (!b) {
            return AjaxResult.error("删除失败");
        }
        return AjaxResult.success();
    }
    @PostMapping("export")
    @ApiModelProperty("导出设备台账")
    public void export(HttpServletResponse response, Long[] ids) {
         deviceLedgerService.export(response, ids);
    }
    @GetMapping("getDeviceLedger")
    @ApiModelProperty("获取设备台账")
    public AjaxResult getDeviceLedger( ) {
        return AjaxResult.success(deviceLedgerService.list(new QueryWrapper<DeviceLedger>().lambda()
                .select(DeviceLedger::getId, DeviceLedger::getDeviceName,DeviceLedger::getDeviceModel)));
    }
}
src/main/java/com/ruoyi/device/controller/DeviceMaintenanceController.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,69 @@
package com.ruoyi.device.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.device.dto.DeviceMaintenanceDto;
import com.ruoyi.device.dto.DeviceRepairDto;
import com.ruoyi.device.pojo.DeviceMaintenance;
import com.ruoyi.device.pojo.DeviceRepair;
import com.ruoyi.device.service.IDeviceMaintenanceService;
import com.ruoyi.device.service.IDeviceRepairService;
import com.ruoyi.framework.web.domain.AjaxResult;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
@RestController
@RequestMapping("/device/maintenance")
public class DeviceMaintenanceController {
    @Autowired
    private IDeviceMaintenanceService deviceMaintenanceService;
    @ApiModelProperty("设备报修列表")
    @GetMapping("/page")
    public AjaxResult page(Page page , DeviceMaintenanceDto deviceMaintenanceDto) {
        return AjaxResult.success(deviceMaintenanceService.queryPage(page,deviceMaintenanceDto));
    }
    @PostMapping()
    @ApiModelProperty("添加设备报修")
    public AjaxResult add(@RequestBody DeviceMaintenance deviceRepair) {
        return deviceMaintenanceService.saveDeviceRepair(deviceRepair);
    }
    @ApiModelProperty("根据id查询设备报修")
    @GetMapping("/{id}")
    public AjaxResult detail(@PathVariable Long id) {
        return AjaxResult.success(deviceMaintenanceService.getById(id));
    }
    @PutMapping ()
    @ApiModelProperty("修改设备报修")
    public AjaxResult update(@RequestBody DeviceMaintenance deviceMaintenance) {
        return deviceMaintenanceService.updateDeviceRepair(deviceMaintenance);
    }
    @DeleteMapping("/{id}")
    @ApiModelProperty("删除设备报修")
    public AjaxResult delete(@PathVariable ArrayList<Long> ids) {
        boolean b = deviceMaintenanceService.removeBatchByIds(ids);
        if (!b) {
            return AjaxResult.error("删除失败");
        }
        return AjaxResult.success();
    }
    @PostMapping("export")
    @ApiModelProperty("导出设备报修")
    public void export(HttpServletResponse response, Long[] ids) {
        deviceMaintenanceService.export(response, ids);
    }
}
src/main/java/com/ruoyi/device/controller/DeviceRepairController.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,67 @@
package com.ruoyi.device.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.device.dto.DeviceRepairDto;
import com.ruoyi.device.pojo.DeviceLedger;
import com.ruoyi.device.pojo.DeviceRepair;
import com.ruoyi.device.service.IDeviceLedgerService;
import com.ruoyi.device.service.IDeviceRepairService;
import com.ruoyi.framework.web.domain.AjaxResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.Arrays;
@Api(tags = "设备报修管理")
@RequestMapping("/device/reppair")
@RestController
public class DeviceRepairController {
    @Autowired
    private IDeviceRepairService deviceRepairService;
    @ApiModelProperty("设备报修列表")
    @GetMapping("/page")
    public AjaxResult page(Page page , DeviceRepairDto deviceRepairDto) {
        return AjaxResult.success(deviceRepairService.queryPage(page,deviceRepairDto));
    }
    @PostMapping()
    @ApiModelProperty("添加设备报修")
    public AjaxResult add( @RequestBody DeviceRepair deviceRepair) {
        return deviceRepairService.saveDeviceRepair(deviceRepair);
    }
    @ApiModelProperty("根据id查询设备报修")
    @GetMapping("/{id}")
    public AjaxResult detail(@PathVariable Long id) {
        return AjaxResult.success(deviceRepairService.getById(id));
    }
    @PutMapping ()
    @ApiModelProperty("修改设备报修")
    public AjaxResult update( @RequestBody DeviceRepair deviceRepair) {
        return deviceRepairService.updateDeviceRepair(deviceRepair);
    }
    @DeleteMapping("/{ids}")
    @ApiModelProperty("删除设备报修")
    public AjaxResult delete(@PathVariable("ids") Long[] ids) {
        boolean b = deviceRepairService.removeBatchByIds(Arrays.asList(ids));
        if (!b) {
            return AjaxResult.error("删除失败");
        }
        return AjaxResult.success();
    }
    @PostMapping("export")
    @ApiModelProperty("导出设备报修")
    public void export(HttpServletResponse response, Long[] ids) {
        deviceRepairService.export(response, ids);
    }
}
src/main/java/com/ruoyi/device/dto/DeviceLedgerDto.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,101 @@
package com.ruoyi.device.dto;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal;
import java.time.LocalDateTime;
/**
 * è®¾å¤‡å°è´¦å®žä½“ç±»
 */
@Data
@TableName("device_ledger")
public class DeviceLedgerDto {
    /**
     * ä¸»é”®ID,自增
     */
    private Long id;
    /**
     * è®¾å¤‡åç§°
     */
    private String deviceName;
    /**
     * è§„格型号
     */
    private String deviceModel;
    /**
     * ä¾›åº”商名称
     */
    private String supplierName;
    /**
     * å•位
     */
    private String unit;
    /**
     * æ•°é‡
     */
    private BigDecimal number;
    /**
     * å«ç¨Žå•ä»·
     */
    private BigDecimal taxIncludingPriceUnit;
    /**
     * å«ç¨Žæ€»ä»·
     */
    private BigDecimal taxIncludingPriceTotal;
    /**
     * ç¨Žçއ
     */
    private BigDecimal taxRate;
    /**
     * ä¸å«ç¨Žæ€»ä»·
     */
    private BigDecimal unTaxIncludingPriceTotal;
    /**
     * å½•入时间
     */
    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;
    /**
     * æ›´æ–°æ—¶é—´
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;
    /**
     * å½•入人
     */
    private String createUser;
    /**
     * æ›´æ–°äºº
     */
    private String updateUser;
    /**
     * ç§Ÿæˆ·ID
     */
    private Long tenantId;
}
src/main/java/com/ruoyi/device/dto/DeviceMaintenanceDto.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,61 @@
package com.ruoyi.device.dto;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
@Data
public class DeviceMaintenanceDto {
    @ApiModelProperty("设备保养id")
    private Long id;
    @ApiModelProperty("设备台账id")
    private String deviceLedgerId;
    @ApiModelProperty("设备名称")
    private String deviceName;
    @ApiModelProperty("规格型号")
    private String deviceModel;
    @ApiModelProperty("计划保养日期")
    private Date maintenancePlanTime;
    @ApiModelProperty("实际保养人")
    private String maintenanceActuallyName;
    @ApiModelProperty("实际保养日期")
    private Date maintenanceActuallyTime;
    @ApiModelProperty("保养结果 0 ç»´ä¿® 1 å®Œå¥½")
    private Integer maintenanceResult;
    @ApiModelProperty("状态 0 å¾…保养 1 å®Œç»“")
    private Integer status;
    @ApiModelProperty("创建时间")
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;
    @ApiModelProperty("更新时间")
    @TableField(fill = FieldFill.UPDATE)
    private Date updateTime;
    @ApiModelProperty("创建人")
    @TableField(fill = FieldFill.INSERT)
    private String createUser;
    @ApiModelProperty("更新人")
    @TableField(fill = FieldFill.UPDATE)
    private String updateUser;
    @ApiModelProperty("租户id")
    @TableField(fill = FieldFill.INSERT)
    private Long tenantId;
}
src/main/java/com/ruoyi/device/dto/DeviceRepairDto.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,70 @@
package com.ruoyi.device.dto;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.time.LocalDateTime;
import java.util.Date;
@Data
public class DeviceRepairDto {
    @ApiModelProperty("设备报修id")
    private Long id;
    @ApiModelProperty("设备台账id")
    private String deviceLedgerId;
    @ApiModelProperty("设备名称")
    private String deviceName;
    @ApiModelProperty("设备型号")
    private String deviceModel;
    @ApiModelProperty("报修时间")
    private Date repairTime;
    @ApiModelProperty("报修人")
    private String repairName;
    @ApiModelProperty("报修内容")
    private String remark;
    @ApiModelProperty("维修人")
    private String maintenanceName;
    @ApiModelProperty("维修时间")
    private Date maintenanceTime;
    @ApiModelProperty("维修结果")
    private String maintenanceResult;
    @ApiModelProperty("状态")
    private Integer status;
    @ApiModelProperty("创建时间")
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;
    @ApiModelProperty("更新时间")
    @TableField(fill = FieldFill.UPDATE)
    private LocalDateTime updateTime;
    @ApiModelProperty("创建人")
    @TableField(fill = FieldFill.INSERT)
    private String createUser;
    @ApiModelProperty("更新人")
    @TableField(fill = FieldFill.UPDATE)
    private String updateUser;
    @ApiModelProperty("租户id")
    @TableField(fill = FieldFill.INSERT)
    private Long tenantId;
}
src/main/java/com/ruoyi/device/execl/DeviceLedgerExeclDto.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,87 @@
package com.ruoyi.device.execl;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.ruoyi.framework.aspectj.lang.annotation.Excel;
import lombok.Data;
import java.math.BigDecimal;
import java.time.LocalDateTime;
@Data
public class DeviceLedgerExeclDto {
    /**
     * è®¾å¤‡åç§°
     */
    @Excel(name = "设备名称" ,sort = 1)
    private String deviceName;
    /**
     * è§„格型号
     */
    @Excel(name = "规格型号" ,sort = 2)
    private String deviceModel;
    /**
     * ä¾›åº”商名称
     */
    @Excel(name = "供应商名称",sort = 3)
    private String supplierName;
    /**
     * å•位
     */
    @Excel(name = "单位",sort = 4)
    private String unit;
    /**
     * æ•°é‡
     */
    @Excel(name = "数量",sort = 5)
    private BigDecimal number;
    /**
     * å«ç¨Žå•ä»·
     */
    @Excel(name = "含税单价",sort = 6)
    private BigDecimal taxIncludingPriceUnit;
    /**
     * å«ç¨Žæ€»ä»·
     */
    @Excel(name = "含税总价",sort = 7)
    private BigDecimal taxIncludingPriceTotal;
    /**
     * ç¨Žçއ
     */
    @Excel(name = "税率",sort = 8)
    private BigDecimal taxRate;
    /**
     * ä¸å«ç¨Žæ€»ä»·
     */
    @Excel(name = "不含税总价",sort = 9)
    private BigDecimal unTaxIncludingPriceTotal;
    /**
     * å½•入时间
     *
     */
    @Excel(name = "录入时间",sort = 10)
    private LocalDateTime createTime;
    /**
     * å½•入人
     */
    @Excel(name = "录入人",sort = 9)
    private String createUser;
}
src/main/java/com/ruoyi/device/execl/DeviceMaintenanceExeclDto.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,52 @@
package com.ruoyi.device.execl;
import com.ruoyi.framework.aspectj.lang.annotation.Excel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.time.LocalDateTime;
import java.util.Date;
@Data
public class DeviceMaintenanceExeclDto {
    @ApiModelProperty("设备名称")
    @Excel(name = "设备名称")
    private String deviceName;
    @Excel(name = "规格型号")
    @ApiModelProperty("规格型号")
    private String deviceModel;
    @Excel(name = "计划保养日期")
    @ApiModelProperty("计划保养日期")
    private Date maintenancePlanTime;
    @ApiModelProperty("实际保养人")
    @Excel(name = "实际保养人")
    private String maintenanceActuallyName;
    @ApiModelProperty("实际保养日期")
    @Excel(name = "实际保养日期")
    private LocalDateTime maintenanceActuallyTime;
    @ApiModelProperty("保养结果 0 ç»´ä¿® 1 å®Œå¥½")
    @Excel(name = "保养结果")
    private String maintenanceResult;
    @ApiModelProperty("状态 0 å¾…保养 1 å®Œç»“")
    @Excel(name = "状态")
    private String status;
    @ApiModelProperty("创建时间")
    @Excel(name = "录入时间")
    private Date createTime;
    @ApiModelProperty("创建人")
    @Excel(name = "录入人")
    private String createUser;
}
src/main/java/com/ruoyi/device/execl/DeviceRepairExeclDto.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,64 @@
package com.ruoyi.device.execl;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.ruoyi.framework.aspectj.lang.annotation.Excel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.time.LocalDateTime;
import java.util.Date;
@Data
public class DeviceRepairExeclDto {
    @ApiModelProperty("设备名称")
    @Excel(name = "设备名称")
    private String deviceName;
    @ApiModelProperty("设备型号")
    @Excel(name = "设备型号")
    private String deviceModel;
    @ApiModelProperty("报修时间")
    @Excel(name = "报修时间")
    private Date repairTime;
    @ApiModelProperty("报修人")
    @Excel(name = "报修人")
    private String repairName;
    @ApiModelProperty("报修内容")
    @Excel(name = "报修内容")
    private String remark;
    @ApiModelProperty("维修人")
    @Excel(name = "维修人")
    private String maintenanceName;
    @ApiModelProperty("维修时间")
    @Excel(name = "维修时间")
    private Date maintenanceTime;
    @ApiModelProperty("维修结果")
    @Excel(name = "维修结果")
    private String maintenanceResult;
    @ApiModelProperty("状态")
    @Excel(name = "状态")
    private String statusStr;
    @ApiModelProperty("创建时间")
    @Excel(name = "录入时间")
    private LocalDateTime createTime;
    @Excel(name = "录入人")
    @ApiModelProperty("创建人")
    private String createUser;
}
src/main/java/com/ruoyi/device/mapper/DeviceLedgerMapper.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,20 @@
package com.ruoyi.device.mapper;
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.device.dto.DeviceLedgerDto;
import com.ruoyi.device.execl.DeviceLedgerExeclDto;
import com.ruoyi.device.pojo.DeviceLedger;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface DeviceLedgerMapper extends BaseMapper<DeviceLedger> {
    IPage<DeviceLedgerDto> queryPage(Page page, @Param("deviceLedger") DeviceLedgerDto deviceLedgerDto);
    List<DeviceLedgerExeclDto> deviceLedgerExportList(DeviceLedger deviceLedger);
}
src/main/java/com/ruoyi/device/mapper/DeviceMaintenanceMapper.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,16 @@
package com.ruoyi.device.mapper;
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.device.dto.DeviceMaintenanceDto;
import com.ruoyi.device.dto.DeviceRepairDto;
import com.ruoyi.device.pojo.DeviceMaintenance;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface DeviceMaintenanceMapper extends BaseMapper<DeviceMaintenance> {
    IPage<DeviceMaintenanceDto> queryPage(Page page, DeviceMaintenanceDto deviceMaintenanceDto);
}
src/main/java/com/ruoyi/device/mapper/DeviceRepairMapper.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,14 @@
package com.ruoyi.device.mapper;
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.device.dto.DeviceRepairDto;
import com.ruoyi.device.pojo.DeviceRepair;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface DeviceRepairMapper extends BaseMapper<DeviceRepair> {
    IPage<DeviceRepairDto> queryPage(Page page, @Param("deviceRepairDto") DeviceRepairDto deviceRepairDto);
}
src/main/java/com/ruoyi/device/pojo/DeviceLedger.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,106 @@
package com.ruoyi.device.pojo;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Date;
/**
 * è®¾å¤‡å°è´¦å®žä½“ç±»
 */
@Data
@TableName("device_ledger")
public class DeviceLedger {
    /**
     * ä¸»é”®ID,自增
     */
    private Long id;
    /**
     * è®¾å¤‡åç§°
     */
    private String deviceName;
    /**
     * è§„格型号
     */
    private String deviceModel;
    /**
     * ä¾›åº”商名称
     */
    private String supplierName;
    /**
     * å•位
     */
    private String unit;
    /**
     * æ•°é‡
     */
    private BigDecimal number;
    /**
     * å«ç¨Žå•ä»·
     */
    private BigDecimal taxIncludingPriceUnit;
    /**
     * å«ç¨Žæ€»ä»·
     */
    private BigDecimal taxIncludingPriceTotal;
    /**
     * ç¨Žçއ
     */
    private BigDecimal taxRate;
    /**
     * ä¸å«ç¨Žæ€»ä»·
     */
    private BigDecimal unTaxIncludingPriceTotal;
    /**
     * å½•入时间
     */
    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;
    /**
     * æ›´æ–°æ—¶é—´
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;
    /**
     * å½•入人
     */
    @TableField(fill = FieldFill.INSERT)
    private Integer createUser;
    /**
     * æ›´æ–°äºº
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Integer updateUser;
    /**
     * ç§Ÿæˆ·ID
     */
    @TableField(fill = FieldFill.INSERT)
    private Long tenantId;
}
src/main/java/com/ruoyi/device/pojo/DeviceMaintenance.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,63 @@
package com.ruoyi.device.pojo;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.models.auth.In;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import java.util.Date;
@Data
@TableName("device_maintenance")
@ApiModel("设备保养记录")
public class DeviceMaintenance {
    @ApiModelProperty("设备保养id")
    private Long id;
    @ApiModelProperty("设备台账id")
    private String deviceLedgerId;
    @ApiModelProperty("计划保养日期")
    private Date maintenancePlanTime;
    @ApiModelProperty("实际保养人")
    private String maintenanceActuallyName;
    @ApiModelProperty("实际保养日期")
    private Date maintenanceActuallyTime;
    @ApiModelProperty("保养结果 0 ç»´ä¿® 1 å®Œå¥½")
    private Integer maintenanceResult;
    @ApiModelProperty("状态 0 å¾…保养 1 å®Œç»“")
    private Integer status;
    @ApiModelProperty("创建时间")
    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;
    @ApiModelProperty("更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;
    @ApiModelProperty("创建人")
    @TableField(fill = FieldFill.INSERT)
    private Integer createUser;
    @ApiModelProperty("更新人")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Integer updateUser;
    @ApiModelProperty("租户id")
    @TableField(fill = FieldFill.INSERT)
    private Long tenantId;
}
src/main/java/com/ruoyi/device/pojo/DeviceRepair.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,74 @@
package com.ruoyi.device.pojo;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import nonapi.io.github.classgraph.json.Id;
import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Date;
@Data
@TableName("device_repair")
public class DeviceRepair {
    @ApiModelProperty("设备报修id")
    private Long id;
    @ApiModelProperty("设备台账id")
    private String deviceLedgerId;
    @ApiModelProperty("报修时间")
    private Date repairTime;
    @ApiModelProperty("报修人")
    private String repairName;
    @ApiModelProperty("报修内容")
    private String remark;
    @ApiModelProperty("维修人")
    private String maintenanceName;
    @ApiModelProperty("维修时间")
    private Date maintenanceTime;
    @ApiModelProperty("维修结果")
    private String maintenanceResult;
    @ApiModelProperty("状态 0 å¾…ç»´ä¿® 1完结")
    private Integer status;
    @ApiModelProperty("创建时间")
    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;
    @ApiModelProperty("更新时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;
    @ApiModelProperty("创建人")
    @TableField(fill = FieldFill.INSERT)
    private Integer createUser;
    @ApiModelProperty("更新人")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Integer updateUser;
    @ApiModelProperty("租户id")
    @TableField(fill = FieldFill.INSERT)
    private Long tenantId;
}
src/main/java/com/ruoyi/device/service/IDeviceLedgerService.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,21 @@
package com.ruoyi.device.service;
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.device.dto.DeviceLedgerDto;
import com.ruoyi.device.pojo.DeviceLedger;
import com.ruoyi.framework.web.domain.AjaxResult;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
public interface IDeviceLedgerService  extends IService<DeviceLedger> {
    IPage<DeviceLedgerDto> queryPage(Page page, DeviceLedgerDto deviceLedger);
    AjaxResult saveDeviceLedger(DeviceLedger deviceLedger);
    AjaxResult updateDeviceLedger(DeviceLedger deviceLedger);
    void export(HttpServletResponse response, Long[] ids);
}
src/main/java/com/ruoyi/device/service/IDeviceMaintenanceService.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,22 @@
package com.ruoyi.device.service;
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.device.dto.DeviceMaintenanceDto;
import com.ruoyi.device.pojo.DeviceMaintenance;
import com.ruoyi.framework.web.domain.AjaxResult;
import javax.servlet.http.HttpServletResponse;
public interface IDeviceMaintenanceService extends IService<DeviceMaintenance> {
    IPage<DeviceMaintenanceDto> queryPage(Page page, DeviceMaintenanceDto deviceMaintenanceDto);
    AjaxResult saveDeviceRepair(DeviceMaintenance deviceMaintenance);
    AjaxResult updateDeviceRepair(DeviceMaintenance deviceMaintenance);
    void export(HttpServletResponse response, Long[] ids);
}
src/main/java/com/ruoyi/device/service/IDeviceRepairService.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,23 @@
package com.ruoyi.device.service;
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.device.dto.DeviceRepairDto;
import com.ruoyi.device.pojo.DeviceRepair;
import com.ruoyi.framework.web.domain.AjaxResult;
import javax.servlet.http.HttpServletResponse;
public interface IDeviceRepairService extends IService<DeviceRepair> {
    IPage<DeviceRepairDto> queryPage(Page page, DeviceRepairDto deviceRepairDto);
    AjaxResult saveDeviceRepair(DeviceRepair deviceRepair);
    AjaxResult updateDeviceRepair(DeviceRepair deviceRepair);
    void export(HttpServletResponse response, Long[] ids);
}
src/main/java/com/ruoyi/device/service/impl/DeviceLedgerServiceImpl.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,91 @@
package com.ruoyi.device.service.impl;
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.common.utils.bean.BeanUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.device.dto.DeviceLedgerDto;
import com.ruoyi.device.execl.DeviceLedgerExeclDto;
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.project.system.mapper.SysUserMapper;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@Service
@AllArgsConstructor
@Slf4j
public class DeviceLedgerServiceImpl  extends ServiceImpl<DeviceLedgerMapper, DeviceLedger> implements IDeviceLedgerService {
    @Autowired
    private DeviceLedgerMapper deviceLedgerMapper;
    @Autowired
    private SysUserMapper sysUserMapper;
    @Override
    public IPage<DeviceLedgerDto> queryPage(Page page, DeviceLedgerDto deviceLedger) {
        return deviceLedgerMapper.queryPage(page, deviceLedger);
    }
    @Override
    public AjaxResult saveDeviceLedger(DeviceLedger deviceLedger) {
        boolean save = this.save(deviceLedger);
        if (save){
            return AjaxResult.success();
        }
        return AjaxResult.error();
    }
    @Override
    public AjaxResult updateDeviceLedger(DeviceLedger deviceLedger) {
        if (this.updateById(deviceLedger)) {
            return AjaxResult.success();
        }
        return AjaxResult.error();
    }
    @Override
    public void export(HttpServletResponse response, Long[] ids) {
        if (ids == null || ids.length == 0) {
            List<DeviceLedger> supplierManageList = this.list();
            ArrayList<DeviceLedgerExeclDto> deviceLedgerExeclDtos = new ArrayList<>();
            supplierManageList.stream().forEach(deviceLedger -> {
                DeviceLedgerExeclDto deviceLedgerExeclDto = new DeviceLedgerExeclDto();
                BeanUtils.copyProperties(deviceLedger,deviceLedgerExeclDto);
                deviceLedgerExeclDto.setCreateUser(sysUserMapper.selectUserById(Long.valueOf(deviceLedger.getCreateUser().toString())).getUserName());
                deviceLedgerExeclDtos.add(deviceLedgerExeclDto);
            });
            ExcelUtil<DeviceLedgerExeclDto> util = new ExcelUtil<DeviceLedgerExeclDto>(DeviceLedgerExeclDto.class);
            util.exportExcel(response, deviceLedgerExeclDtos, "设备台账导出");
        }else  {
            ArrayList<Long> arrayList = new ArrayList<>();
            Arrays.stream(ids).map(id -> {
                return arrayList.add( id);
            });
            List<DeviceLedger> supplierManageList = deviceLedgerMapper.selectBatchIds(arrayList);
            ArrayList<DeviceLedgerExeclDto> deviceLedgerExeclDtos = new ArrayList<>();
            supplierManageList.stream().forEach(deviceLedger -> {
                DeviceLedgerExeclDto deviceLedgerExeclDto = new DeviceLedgerExeclDto();
                BeanUtils.copyProperties(deviceLedger,deviceLedgerExeclDto);
                deviceLedgerExeclDto.setCreateUser(sysUserMapper.selectUserById(Long.valueOf(deviceLedger.getCreateUser().toString())).getUserName());
                deviceLedgerExeclDtos.add(deviceLedgerExeclDto);
            });
            ExcelUtil<DeviceLedgerExeclDto> util = new ExcelUtil<DeviceLedgerExeclDto>(DeviceLedgerExeclDto.class);
            util.exportExcel(response, deviceLedgerExeclDtos, "设备台账导出");
        }
    }
}
src/main/java/com/ruoyi/device/service/impl/DeviceMaintenanceServiceImpl.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,74 @@
package com.ruoyi.device.service.impl;
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.common.utils.bean.BeanUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.device.dto.DeviceMaintenanceDto;
import com.ruoyi.device.execl.DeviceMaintenanceExeclDto;
import com.ruoyi.device.mapper.DeviceMaintenanceMapper;
import com.ruoyi.device.pojo.DeviceMaintenance;
import com.ruoyi.device.service.IDeviceMaintenanceService;
import com.ruoyi.framework.web.domain.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@Service
public class DeviceMaintenanceServiceImpl extends ServiceImpl<DeviceMaintenanceMapper, DeviceMaintenance> implements IDeviceMaintenanceService {
    @Autowired
    private DeviceMaintenanceMapper deviceMaintenanceMapper;
    @Override
    public IPage<DeviceMaintenanceDto> queryPage(Page page, DeviceMaintenanceDto deviceMaintenanceDto) {
        return deviceMaintenanceMapper.queryPage(page, deviceMaintenanceDto);
    }
    @Override
    public AjaxResult saveDeviceRepair(DeviceMaintenance deviceRepair) {
        boolean save = this.save(deviceRepair);
        if (save){
            return AjaxResult.success();
        }
        return AjaxResult.error();
    }
    @Override
    public AjaxResult updateDeviceRepair(DeviceMaintenance deviceRepair) {
        if (this.updateById(deviceRepair)) {
            return AjaxResult.success();
        }
        return AjaxResult.error();
    }
    @Override
    public void export(HttpServletResponse response, Long[] ids) {
        ArrayList<Long> arrayList = new ArrayList<>();
        Arrays.stream(ids).map(id -> {
            return arrayList.add( id);
        });
        List<DeviceMaintenance> supplierManageList = deviceMaintenanceMapper.selectBatchIds(arrayList);
        ArrayList<DeviceMaintenanceExeclDto> deviceLedgerExeclDtos = new ArrayList<>();
        supplierManageList.stream().forEach(deviceMaintenance -> {
            DeviceMaintenanceExeclDto deviceRepairExeclDto = new DeviceMaintenanceExeclDto();
            BeanUtils.copyProperties(deviceMaintenance,deviceRepairExeclDto);
            deviceRepairExeclDto.setStatus(deviceMaintenance.getStatus() == 0 ? "待维修" : "完结");
            deviceRepairExeclDto.setMaintenanceResult(deviceMaintenance.getMaintenanceResult() == 0 ? "ç»´ä¿®" : "完好");
            deviceLedgerExeclDtos.add(deviceRepairExeclDto);
        });
        ExcelUtil<DeviceMaintenanceExeclDto> util = new ExcelUtil<DeviceMaintenanceExeclDto>(DeviceMaintenanceExeclDto.class);
        util.exportExcel(response, deviceLedgerExeclDtos, "设备报修导出");
    }
}
src/main/java/com/ruoyi/device/service/impl/DeviceRepairServiceImpl.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,90 @@
package com.ruoyi.device.service.impl;
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.common.utils.bean.BeanUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.device.dto.DeviceRepairDto;
import com.ruoyi.device.execl.DeviceRepairExeclDto;
import com.ruoyi.device.mapper.DeviceRepairMapper;
import com.ruoyi.device.pojo.DeviceRepair;
import com.ruoyi.device.service.IDeviceRepairService;
import com.ruoyi.framework.web.domain.AjaxResult;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@Service
@AllArgsConstructor
@Slf4j
public class DeviceRepairServiceImpl extends ServiceImpl<DeviceRepairMapper, DeviceRepair> implements IDeviceRepairService {
    @Autowired
    private DeviceRepairMapper deviceRepairMapper;
    @Override
    public IPage<DeviceRepairDto> queryPage(Page page, DeviceRepairDto deviceRepairDto) {
        return deviceRepairMapper.queryPage(page, deviceRepairDto);
    }
    @Override
    public AjaxResult saveDeviceRepair(DeviceRepair deviceRepair) {
        boolean save = this.save(deviceRepair);
        if (save){
            return AjaxResult.success();
        }
        return AjaxResult.error();
    }
    @Override
    public AjaxResult updateDeviceRepair(DeviceRepair deviceRepair) {
        if (this.updateById(deviceRepair)) {
            return AjaxResult.success();
        }
        return AjaxResult.error();
    }
    @Override
    public void export(HttpServletResponse response, Long[] ids) {
        if (ids == null || ids.length == 0) {
            List<DeviceRepair> supplierManageList = this.list();
            ArrayList<DeviceRepairExeclDto> deviceLedgerExeclDtos = new ArrayList<>();
            supplierManageList.stream().forEach(deviceRepair -> {
                DeviceRepairExeclDto deviceRepairExeclDto = new DeviceRepairExeclDto();
                BeanUtils.copyProperties(deviceRepair,deviceRepairExeclDto);
                deviceRepairExeclDto.setStatusStr(deviceRepair.getStatus() == 0 ? "待维修" : "完结");
                deviceLedgerExeclDtos.add(deviceRepairExeclDto);
            });
            ExcelUtil<DeviceRepairExeclDto> util = new ExcelUtil<DeviceRepairExeclDto>(DeviceRepairExeclDto.class);
            util.exportExcel(response, deviceLedgerExeclDtos, "设备报修导出");
        }else {
            ArrayList<Long> arrayList = new ArrayList<>();
            Arrays.stream(ids).map(id -> {
                return arrayList.add( id);
            });
            List<DeviceRepair> supplierManageList = deviceRepairMapper.selectBatchIds(arrayList);
            ArrayList<DeviceRepairExeclDto> deviceLedgerExeclDtos = new ArrayList<>();
            supplierManageList.stream().forEach(deviceRepair -> {
                DeviceRepairExeclDto deviceRepairExeclDto = new DeviceRepairExeclDto();
                BeanUtils.copyProperties(deviceRepair,deviceRepairExeclDto);
                deviceRepairExeclDto.setStatusStr(deviceRepair.getStatus() == 0 ? "待维修" : "完结");
                deviceLedgerExeclDtos.add(deviceRepairExeclDto);
            });
            ExcelUtil<DeviceRepairExeclDto> util = new ExcelUtil<DeviceRepairExeclDto>(DeviceRepairExeclDto.class);
            util.exportExcel(response, deviceLedgerExeclDtos, "设备报修导出");
        }
    }
}
src/main/java/com/ruoyi/inventory/domain/StockIn.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,70 @@
package inventory.domain;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import lombok.Data;
/**
 *
 * @TableName stock_in
 */
@Data
public class StockIn implements Serializable {
    /**
     * å…¥åº“记录ID
     */
    private Integer id;
    /**
     * äº§å“id
     */
    private Integer productId;
    /**
     * å…¥åº“æ—¶é—´
     */
    private Date inboundTime;
    /**
     * å…¥åº“批次(如“第三批次”)
     */
    private String inboundBatch;
    /**
     * ä¾›åº”商名称
     */
    private String supplierName;
    /**
     * å…¥åº“数量
     */
    private Integer inboundQuantity;
    /**
     * å«ç¨Žå•ä»·
     */
    private BigDecimal taxInclusivePrice;
    /**
     * å«ç¨Žæ€»ä»·
     */
    private BigDecimal taxInclusiveTotal;
    /**
     * ç¨Žçއ
     */
    private BigDecimal taxRate;
    /**
     * ä¸å«ç¨Žæ€»ä»·
     */
    private BigDecimal taxExclusiveTotal;
    /**
     * å…¥åº“人
     */
    private String inboundPerson;
    private static final long serialVersionUID = 1L;
}
src/main/java/com/ruoyi/inventory/domain/StockManagement.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,54 @@
package inventory.domain;
import java.io.Serializable;
import java.math.BigDecimal;
import lombok.Data;
/**
 *
 * @TableName stock_management
 */
@Data
public class StockManagement implements Serializable {
    /**
     * åº“存记录ID
     */
    private Integer id;
    /**
     * äº§å“id
     */
    private Integer productId;
    /**
     * å½“前库存量
     */
    private Integer stockQuantity;
    /**
     * å«ç¨Žå•ä»·
     */
    private BigDecimal taxInclusivePrice;
    /**
     * å«ç¨Žæ€»ä»·
     */
    private BigDecimal taxInclusiveTotal;
    /**
     * ç¨Žçއ
     */
    private BigDecimal taxRate;
    /**
     * ä¸å«ç¨Žæ€»ä»·
     */
    private BigDecimal taxExclusiveTotal;
    /**
     * å…¥åº“人
     */
    private String inboundPerson;
    private static final long serialVersionUID = 1L;
}
src/main/java/com/ruoyi/inventory/domain/StockOut.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,70 @@
package inventory.domain;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import lombok.Data;
/**
 *
 * @TableName stock_out
 */
@Data
public class StockOut implements Serializable {
    /**
     * å‡ºåº“记录ID
     */
    private Integer id;
    /**
     * äº§å“id
     */
    private Integer productId;
    /**
     * å‡ºåº“æ—¶é—´
     */
    private Date inboundTime;
    /**
     * å‡ºåº“批次(如“第三批次”)
     */
    private String inboundBatch;
    /**
     * ä¾›åº”商名称
     */
    private String supplierName;
    /**
     * å…¥åº“数量
     */
    private Integer inboundQuantity;
    /**
     * å«ç¨Žå•ä»·
     */
    private BigDecimal taxInclusivePrice;
    /**
     * å«ç¨Žæ€»ä»·
     */
    private BigDecimal taxInclusiveTotal;
    /**
     * ç¨Žçއ
     */
    private BigDecimal taxRate;
    /**
     * ä¸å«ç¨Žæ€»ä»·
     */
    private BigDecimal taxExclusiveTotal;
    /**
     * å‡ºåº“人
     */
    private String inboundPerson;
    private static final long serialVersionUID = 1L;
}
src/main/java/com/ruoyi/inventory/domain/StockProduct.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,33 @@
package inventory.domain;
import java.io.Serializable;
import lombok.Data;
/**
 *
 * @TableName stock_product
 */
@Data
public class StockProduct implements Serializable {
    /**
     * äº§å“ID
     */
    private Integer id;
    /**
     * äº§å“å¤§ç±»ï¼ˆå¦‚“产品1”)
     */
    private String productCategory;
    /**
     * è§„格型号
     */
    private String specModel;
    /**
     * å•位(如“吨”)
     */
    private String unit;
    private static final long serialVersionUID = 1L;
}
src/main/java/com/ruoyi/inventory/mapper/StockInMapper.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,25 @@
package inventory.mapper;
import inventory.domain.StockIn;
/**
* @author 86151
* @description é’ˆå¯¹è¡¨ã€stock_in】的数据库操作Mapper
* @createDate 2025-06-23 18:11:59
* @Entity inventory.domain.StockIn
*/
public interface StockInMapper {
    int deleteByPrimaryKey(Long id);
    int insert(StockIn record);
    int insertSelective(StockIn record);
    StockIn selectByPrimaryKey(Long id);
    int updateByPrimaryKeySelective(StockIn record);
    int updateByPrimaryKey(StockIn record);
}
src/main/java/com/ruoyi/inventory/mapper/StockManagementMapper.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,25 @@
package inventory.mapper;
import inventory.domain.StockManagement;
/**
* @author 86151
* @description é’ˆå¯¹è¡¨ã€stock_management】的数据库操作Mapper
* @createDate 2025-06-23 18:11:59
* @Entity inventory.domain.StockManagement
*/
public interface StockManagementMapper {
    int deleteByPrimaryKey(Long id);
    int insert(StockManagement record);
    int insertSelective(StockManagement record);
    StockManagement selectByPrimaryKey(Long id);
    int updateByPrimaryKeySelective(StockManagement record);
    int updateByPrimaryKey(StockManagement record);
}
src/main/java/com/ruoyi/inventory/mapper/StockOutMapper.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,25 @@
package inventory.mapper;
import inventory.domain.StockOut;
/**
* @author 86151
* @description é’ˆå¯¹è¡¨ã€stock_out】的数据库操作Mapper
* @createDate 2025-06-23 18:11:59
* @Entity inventory.domain.StockOut
*/
public interface StockOutMapper {
    int deleteByPrimaryKey(Long id);
    int insert(StockOut record);
    int insertSelective(StockOut record);
    StockOut selectByPrimaryKey(Long id);
    int updateByPrimaryKeySelective(StockOut record);
    int updateByPrimaryKey(StockOut record);
}
src/main/java/com/ruoyi/inventory/mapper/StockProductMapper.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,25 @@
package inventory.mapper;
import inventory.domain.StockProduct;
/**
* @author 86151
* @description é’ˆå¯¹è¡¨ã€stock_product】的数据库操作Mapper
* @createDate 2025-06-23 18:11:59
* @Entity inventory.domain.StockProduct
*/
public interface StockProductMapper {
    int deleteByPrimaryKey(Long id);
    int insert(StockProduct record);
    int insertSelective(StockProduct record);
    StockProduct selectByPrimaryKey(Long id);
    int updateByPrimaryKeySelective(StockProduct record);
    int updateByPrimaryKey(StockProduct record);
}
src/main/java/com/ruoyi/purchase/mapper/PurchaseLedgerMapper.java
@@ -2,6 +2,7 @@
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.ruoyi.purchase.pojo.PurchaseLedger;
import org.apache.ibatis.annotations.Param;
@@ -16,4 +17,6 @@
public interface PurchaseLedgerMapper extends BaseMapper<PurchaseLedger> {
    int updateContractAmountById(@Param("id") Long id, @Param("totalTaxInclusiveAmount") BigDecimal totalTaxInclusiveAmount);
    IPage<PurchaseLedger> selectPurchaseLedgerListPage(IPage ipage, @Param("c") PurchaseLedger purchaseLedger);
}
src/main/java/com/ruoyi/purchase/pojo/PurchaseLedger.java
@@ -3,6 +3,7 @@
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.framework.aspectj.lang.annotation.Excel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
@@ -127,6 +128,14 @@
     */
    private String phoneNumber;
    @TableField(exist = false)
    @ApiModelProperty("来票金额")
    private String receiptPaymentAmount;
    @ApiModelProperty("未来票金额")
    @TableField(exist = false)
    private String unReceiptPaymentAmount;
}
src/main/java/com/ruoyi/purchase/service/impl/PurchaseLedgerServiceImpl.java
@@ -425,11 +425,8 @@
    @Override
    public IPage<PurchaseLedger> selectPurchaseLedgerListPage(IPage ipage, PurchaseLedger purchaseLedger) {
        LambdaQueryWrapper<PurchaseLedger> queryWrapper = new LambdaQueryWrapper<>();
        if (StringUtils.isNotBlank(purchaseLedger.getPurchaseContractNumber())) {
            queryWrapper.like(PurchaseLedger::getPurchaseContractNumber, purchaseLedger.getPurchaseContractNumber());
        }
        return purchaseLedgerMapper.selectPage(ipage, queryWrapper);
        return purchaseLedgerMapper.selectPurchaseLedgerListPage(ipage, purchaseLedger);
    }
    @Override
src/main/java/com/ruoyi/sales/controller/ReceiptPaymentController.java
@@ -9,11 +9,16 @@
import com.ruoyi.sales.dto.ReceiptPaymentDto;
import com.ruoyi.sales.pojo.ReceiptPayment;
import com.ruoyi.sales.service.ReceiptPaymentService;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
@RestController
@RequestMapping("/receiptPayment")
@@ -97,6 +102,21 @@
        return AjaxResult.success(receiptPaymentService.bindInvoiceNoRegPage(page,receiptPaymentDto));
    }
    @ApiModelProperty("导出回款登记")
    @PostMapping("/export")
    public void export(HttpServletResponse response, String ids) {
        if (ids == null || ids.isEmpty()) {
            receiptPaymentService.exportPaymentList(response, null);
        } else {
            ArrayList<Long> idList = (ArrayList<Long>) Arrays.stream(ids.split(","))
                    .map(s -> s.replaceAll("[\\[\\]]", "").trim())
                    .map(Long::valueOf)
                    .collect(Collectors.toList());
            receiptPaymentService.exportPaymentList(response, idList);
        }
    }
    /**
     * å¼€ç¥¨å°è´¦è¯¦æƒ…
     * @param id
src/main/java/com/ruoyi/sales/dto/ReceiptPaymentDto.java
@@ -1,6 +1,7 @@
package com.ruoyi.sales.dto;
import com.baomidou.mybatisplus.annotation.TableField;
import com.ruoyi.framework.aspectj.lang.annotation.Excel;
import com.ruoyi.sales.pojo.ReceiptPayment;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@@ -12,49 +13,65 @@
public class ReceiptPaymentDto extends ReceiptPayment {
    @ApiModelProperty(value = "客户合同号")
    @Excel(name = "客户合同号")
    private String customerContractNo;
    @ApiModelProperty(value = "客户名称")
    @Excel(name = "客户名称")
    private String customerName;
    @ApiModelProperty(value = "查询文本")
    private String searchText;
    @ApiModelProperty(value = "销售台账sales_ledger")
    @Excel(isExport = false)
    private Integer salesLedgerId;
    @ApiModelProperty(value = "销售合同号")
    @Excel(name = "销售合同号")
    private String salesContractNo;
    @ApiModelProperty(value = "客户名称ID")
    @Excel(isExport = false)
    private Integer customerId;
    @ApiModelProperty(value = "发票号")
    @Excel(name = "发票号")
    private String invoiceNo;
    @ApiModelProperty(value = "发票金额")
    @Excel(name = "发票金额")
    private BigDecimal invoiceTotal;
    @ApiModelProperty(value = "税率")
    @ApiModelProperty(value = "税率(%)")
    @Excel(name = "税率(%)")
    private BigDecimal taxRate;
    @ApiModelProperty(value = "产品大类")
    @Excel(name = "产品大类")
    private String productCategory;
    @ApiModelProperty(value = "回款金额")
    @Excel(name = "回款金额")
    private BigDecimal receiptPaymentAmountTotal;
    @ApiModelProperty(value = "待回款金额")
    @Excel(name = "待回款金额")
    private BigDecimal noReceiptAmount;
    @TableField(exist = false)
    @Excel(isExport = false)
    private Boolean status;
    @TableField(exist = false)
    @Excel(isExport = false)
    private String receiptPaymentDateStart;
    @TableField(exist = false)
    @Excel(isExport = false)
    private String receiptPaymentDateEnd;
    @ApiModelProperty(value = "项目名称")
    @Excel(name = "项目名称")
    private String projectName;
src/main/java/com/ruoyi/sales/dto/ReceiptPaymentExeclDto.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,57 @@
package com.ruoyi.sales.dto;
import com.baomidou.mybatisplus.annotation.TableField;
import com.ruoyi.framework.aspectj.lang.annotation.Excel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
@Data
public class ReceiptPaymentExeclDto {
    @ApiModelProperty(value = "销售合同号")
    @Excel(name = "销售合同号",sort = 1)
    private String salesContractNo;
    @ApiModelProperty(value = "客户合同号")
    @Excel(name = "客户合同号",sort = 2)
    private String customerContractNo;
    @ApiModelProperty(value = "客户名称")
    @Excel(name = "客户名称",sort = 3)
    private String customerName;
    @ApiModelProperty(value = "产品大类")
    @Excel(name = "产品大类",sort = 4)
    private String productCategory;
    @ApiModelProperty(value = "项目名称")
    @Excel(name = "项目名称",sort = 5)
    private String projectName;
    @ApiModelProperty(value = "发票号")
    @Excel(name = "发票号",sort = 6)
    private String invoiceNo;
    @ApiModelProperty(value = "发票金额")
    @Excel(name = "发票金额",sort = 7)
    private BigDecimal invoiceTotal;
    @ApiModelProperty(value = "税率(%)")
    @Excel(name = "税率(%)",sort = 8)
    private BigDecimal taxRate;
    @ApiModelProperty(value = "回款金额")
    @Excel(name = "回款金额",sort = 9)
    private BigDecimal receiptPaymentAmountTotal;
    @ApiModelProperty(value = "待回款金额")
    @Excel(name = "待回款金额",sort = 10)
    private BigDecimal noReceiptAmount;
}
src/main/java/com/ruoyi/sales/mapper/ReceiptPaymentMapper.java
@@ -6,10 +6,12 @@
import com.ruoyi.sales.dto.CustomerInteractionDto;
import com.ruoyi.sales.dto.InvoiceLedgerDto;
import com.ruoyi.sales.dto.ReceiptPaymentDto;
import com.ruoyi.sales.dto.ReceiptPaymentExeclDto;
import com.ruoyi.sales.pojo.ReceiptPayment;
import org.apache.ibatis.annotations.Param;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
public interface ReceiptPaymentMapper extends BaseMapper<ReceiptPayment> {
@@ -24,7 +26,7 @@
     * @param receiptPaymentDto
     * @return
     */
    IPage<ReceiptPaymentDto> bindInvoiceNoRegPage(Page page, ReceiptPaymentDto receiptPaymentDto);
    IPage<ReceiptPaymentDto> bindInvoiceNoRegPage(Page page, @Param("c") ReceiptPaymentDto receiptPaymentDto);
    /**
     * å¼€ç¥¨å°è´¦è¯¦æƒ…
@@ -69,4 +71,10 @@
     * @return
     */
    List<ReceiptPayment> receiptPaymentListByProdRegId(Integer invoiceRegistrationProductId);
    List<ReceiptPaymentDto> bindInvoiceNoRegListAll();
    List<ReceiptPaymentExeclDto> bindInvoiceNoRegListByIds(List<Long> ids,Long tenantId);
}
src/main/java/com/ruoyi/sales/service/ReceiptPaymentService.java
@@ -6,8 +6,8 @@
import com.ruoyi.sales.dto.InvoiceLedgerDto;
import com.ruoyi.sales.dto.ReceiptPaymentDto;
import com.ruoyi.sales.pojo.ReceiptPayment;
import org.apache.ibatis.annotations.Param;
import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
@@ -90,4 +90,14 @@
     * æŸ¥è¯¢å›žæ¬¾è®°å½•分页
     */
    List<ReceiptPaymentDto> receiptPaymentHistoryListNoPage(ReceiptPaymentDto receiptPaymentDto);
    /**
     * å…¨å¯¼å‡ºå›žæ¬¾åˆ—表
     */
    void exportPaymentList(HttpServletResponse response);
    /**
     * éƒ¨åˆ†å¯¼å‡ºå›žæ¬¾åˆ—表
     */
    void exportPaymentList(HttpServletResponse response, List<Long> ids);
}
src/main/java/com/ruoyi/sales/service/impl/ReceiptPaymentServiceImpl.java
@@ -4,9 +4,12 @@
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.common.utils.SecurityUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.sales.dto.CustomerInteractionDto;
import com.ruoyi.sales.dto.InvoiceLedgerDto;
import com.ruoyi.sales.dto.ReceiptPaymentDto;
import com.ruoyi.sales.dto.ReceiptPaymentExeclDto;
import com.ruoyi.sales.mapper.ReceiptPaymentMapper;
import com.ruoyi.sales.mapper.SalesLedgerMapper;
import com.ruoyi.sales.pojo.ReceiptPayment;
@@ -17,6 +20,7 @@
import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.YearMonth;
@@ -253,4 +257,25 @@
    public List<ReceiptPaymentDto> receiptPaymentHistoryListNoPage(ReceiptPaymentDto receiptPaymentDto) {
        return receiptPaymentMapper.receiptPaymentHistoryListNoPage( receiptPaymentDto);
    }
    @Override
    public void exportPaymentList(HttpServletResponse response) {
       List<ReceiptPaymentDto> receiptPaymentDtoList =  receiptPaymentMapper.bindInvoiceNoRegListAll();
        ExcelUtil<ReceiptPaymentDto> util = new ExcelUtil<ReceiptPaymentDto>(ReceiptPaymentDto.class);
        util.exportExcel(response, receiptPaymentDtoList, "回款登记");
    }
    @Override
    public void exportPaymentList(HttpServletResponse response, List<Long> ids) {
        if (ids == null) {
            List<ReceiptPaymentExeclDto> receiptPaymentDtoList =  receiptPaymentMapper.bindInvoiceNoRegListByIds(new ArrayList<>(), SecurityUtils.getLoginUser().getTenantId());
            ExcelUtil<ReceiptPaymentExeclDto> util = new ExcelUtil<ReceiptPaymentExeclDto>(ReceiptPaymentExeclDto.class);
            util.exportExcel(response, receiptPaymentDtoList, "回款登记");
        }else {
            List<ReceiptPaymentExeclDto> receiptPaymentDtoList =  receiptPaymentMapper.bindInvoiceNoRegListByIds(ids,SecurityUtils.getLoginUser().getTenantId());
            ExcelUtil<ReceiptPaymentExeclDto> util = new ExcelUtil<ReceiptPaymentExeclDto>(ReceiptPaymentExeclDto.class);
            util.exportExcel(response, receiptPaymentDtoList, "回款登记");
        }
    }
}
src/main/java/com/ruoyi/staff_management/controller/RyglAddEmployeeController.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,94 @@
package com.ruoyi.staff_management.controller;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.staff_management.domain.RyglAddEmployee;
import com.ruoyi.staff_management.service.RyglAddEmployeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@RestController
@RequestMapping("/staff_management")
public class RyglAddEmployeeController extends BaseController {
    @Autowired
    private RyglAddEmployeeService ryglAddEmployeeService;
    /**
     * èŽ·å–äººå‘˜åˆ—è¡¨
     */
//    @PreAuthorize("@ss.hasPermi('system:dept:list')")
    @GetMapping("/list")
    public AjaxResult list()
    {
        List<RyglAddEmployee> allEmployees = ryglAddEmployeeService.getAllEmployees();
        return success(allEmployees);
    }
    /**
     * æ ¹æ® ID èŽ·å–å‘˜å·¥ä¿¡æ¯
     * @param id å‘˜å·¥ ID
     * @return å‘˜å·¥ä¿¡æ¯
     */
    @GetMapping("/{id}")
    public AjaxResult getInfo(@PathVariable Long id) {
        RyglAddEmployee employee = ryglAddEmployeeService.getById(id);
        return success(employee);
    }
    /**
     * æ ¹æ®å§“名查询员工信息
     * @param name å‘˜å·¥å§“名
     * @return å‘˜å·¥ä¿¡æ¯åˆ—表
     */
    @GetMapping("/search")
    public AjaxResult searchByName(@RequestParam String name) {
        List<RyglAddEmployee> employees = ryglAddEmployeeService.searchByName(name);
        return success(employees);
    }
    /**
     * æ·»åŠ å‘˜å·¥ä¿¡æ¯
     * @param employee å‘˜å·¥ä¿¡æ¯
     * @return æ“ä½œç»“æžœ
     */
    @PostMapping
    public AjaxResult add(@RequestBody RyglAddEmployee employee) {
        boolean result = ryglAddEmployeeService.save(employee);
        return result ? success() : error();
    }
    /**
     * ä¿®æ”¹å‘˜å·¥ä¿¡æ¯
     * @param employee å‘˜å·¥ä¿¡æ¯
     * @return æ“ä½œç»“æžœ
     */
    @PutMapping
    public AjaxResult update(@RequestBody RyglAddEmployee employee) {
        boolean result = ryglAddEmployeeService.updateById(employee);
        return result ? success() : error();
    }
    /**
     * åˆ é™¤å‘˜å·¥ä¿¡æ¯
     * @param id å‘˜å·¥ ID
     * @return æ“ä½œç»“æžœ
     */
    @DeleteMapping("/{id}")
    public AjaxResult delete(@PathVariable Long id) {
        boolean result = ryglAddEmployeeService.removeById(id);
        return result ? success() : error();
    }
    /**
     * å¯¼å‡ºå‘˜å·¥ä¿¡æ¯
     * @return æ“ä½œç»“æžœ (Excel æ–‡ä»¶)
     */
//    @GetMapping("/export")
//    public AjaxResult export() {
//        // è°ƒç”¨å¯¼å‡ºæ–¹æ³•
//        ryglAddEmployeeService.export();
//        return success();
//    }
}
src/main/java/com/ruoyi/staff_management/domain/RyglAddEmployee.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,104 @@
package com.ruoyi.staff_management.domain;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
 *
 * @TableName rygl_add_employee
 */
@Data
public class RyglAddEmployee implements Serializable {
    /**
     * åºå·
     */
    private Integer id;
    /**
     * 1入职2离职
     */
    private Integer status;
    /**
     * å‘˜å·¥ç¼–号
     */
    private String employeeNumber;
    /**
     * å§“名
     */
    private String name;
    /**
     * æ€§åˆ«
     */
    private String sex;
    /**
     * ç±è´¯
     */
    private String nativePlace;
    /**
     * å²—位
     */
    private String post;
    /**
     * å®¶åº­ä½å€
     */
    private String homeAddress;
    /**
     * ç¬¬ä¸€å­¦åކ
     */
    private String firstDegree;
    /**
     * ä¸“业
     */
    private String major;
    /**
     * èº«ä»½è¯å·
     */
    private Integer idNumber;
    /**
     * å¹´é¾„
     */
    private Integer age;
    /**
     * è”系电话
     */
    private Integer contactNumber;
    /**
     * ç´§æ€¥è”系人
     */
    private String emergencyContact;
    /**
     * ç´§æ€¥è”系电话
     */
    private Integer emergencyContactNumber;
    /**
     * åˆåŒå¹´é™
     */
    private String contractTerm;
    /**
     * åˆåŒå¼€å§‹æ—¥æœŸ
     */
    private Date contractStartDate;
    /**
     * åˆåŒç»“束日期
     */
    private Date contractEndDate;
    private static final long serialVersionUID = 1L;
}
src/main/java/com/ruoyi/staff_management/mapper/RyglAddEmployeeMapper.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,30 @@
package com.ruoyi.staff_management.mapper;
import com.ruoyi.staff_management.domain.RyglAddEmployee;
import java.util.List;
/**
* @author 86151
* @description é’ˆå¯¹è¡¨ã€rygl_add_employee】的数据库操作Mapper
* @createDate 2025-06-23 16:05:34
* @Entity staff_management.domain.RyglAddEmployee
*/
public interface RyglAddEmployeeMapper {
    //获取所有员工信息
    List<RyglAddEmployee> getAllEmployees();
    int deleteByPrimaryKey(Long id);//删除员工信息
//    int insert(RyglAddEmployee record);//添加员工信息
    int insertSelective(RyglAddEmployee record);//添加员工信息
    RyglAddEmployee selectByPrimaryKey(Long id);//根据id查询员工信息
    int updateByPrimaryKeySelective(RyglAddEmployee record);//修改员工信息
    List<RyglAddEmployee> searchByName(String name);
//    int updateByPrimaryKey(RyglAddEmployee record);//修改员工信息
}
src/main/java/com/ruoyi/staff_management/service/RyglAddEmployeeService.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,20 @@
package com.ruoyi.staff_management.service;
import com.ruoyi.staff_management.domain.RyglAddEmployee;
import java.util.List;
public interface RyglAddEmployeeService {
    List<RyglAddEmployee> getAllEmployees();
    RyglAddEmployee getById(Long id);
    boolean save(RyglAddEmployee employee);
    boolean updateById(RyglAddEmployee employee);
    boolean removeById(Long id);
    List<RyglAddEmployee> searchByName(String name);
}
src/main/java/com/ruoyi/staff_management/service/impl/RyglAddEmployeeServiceImpl.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,61 @@
package com.ruoyi.staff_management.service.impl;
import com.ruoyi.staff_management.domain.RyglAddEmployee;
import com.ruoyi.staff_management.mapper.RyglAddEmployeeMapper;
import com.ruoyi.staff_management.service.RyglAddEmployeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class RyglAddEmployeeServiceImpl implements RyglAddEmployeeService {
    @Autowired
    private RyglAddEmployeeMapper ryglAddEmployeeMapper;
    @Override
    public List<RyglAddEmployee> getAllEmployees() {
        List<RyglAddEmployee> allEmployees = ryglAddEmployeeMapper.getAllEmployees();
        return allEmployees;
    }
    @Override
    public RyglAddEmployee getById(Long id) {
        RyglAddEmployee ryglAddEmployee = ryglAddEmployeeMapper.selectByPrimaryKey(id);
        return ryglAddEmployee;
    }
    @Override
    public boolean save(RyglAddEmployee employee) {
        int i = ryglAddEmployeeMapper.insertSelective(employee);
        if (i>0){
            return true;
        }
        return false;
    }
    @Override
    public boolean updateById(RyglAddEmployee employee) {
        int i = ryglAddEmployeeMapper.updateByPrimaryKeySelective(employee);
        if (i>0){
            return true;
        }
        return false;
    }
    @Override
    public boolean removeById(Long id) {
        int i = ryglAddEmployeeMapper.deleteByPrimaryKey(id);
        if (i>0){
            return true;
        }
        return false;
    }
    @Override
    public List<RyglAddEmployee> searchByName(String name) {
        List<RyglAddEmployee> ryglAddEmployees = ryglAddEmployeeMapper.searchByName(name);
        return ryglAddEmployees;
    }
}
src/main/resources/application-druid.yml
@@ -6,8 +6,8 @@
        druid:
            # ä¸»åº“数据源
            master:
#                url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
                url: jdbc:mysql://114.132.189.42:9004/product-inventory-management?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
#                url: jdbc:mysql://localhost:3306/product-inventory-management?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
                url: jdbc:mysql://114.132.189.42:9004/product-inventory-management-copy?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
                username: root
                password: 123456
            # ä»Žåº“数据源
src/main/resources/application.yml
@@ -75,7 +75,7 @@
    # æ•°æ®åº“索引
    database: 0
    # å¯†ç 
    password: root2022!
#    password: root2022!
    # è¿žæŽ¥è¶…æ—¶æ—¶é—´
    timeout: 10s
    lettuce:
src/main/resources/mapper/StockInMapper.xml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,130 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="inventory.mapper.StockInMapper">
    <resultMap id="BaseResultMap" type="inventory.domain.StockIn">
            <id property="id" column="id" jdbcType="INTEGER"/>
            <result property="productId" column="product_id" jdbcType="INTEGER"/>
            <result property="inboundTime" column="inbound_time" jdbcType="TIMESTAMP"/>
            <result property="inboundBatch" column="inbound_batch" jdbcType="VARCHAR"/>
            <result property="supplierName" column="supplier_name" jdbcType="VARCHAR"/>
            <result property="inboundQuantity" column="inbound_quantity" jdbcType="INTEGER"/>
            <result property="taxInclusivePrice" column="tax_inclusive_price" jdbcType="DECIMAL"/>
            <result property="taxInclusiveTotal" column="tax_inclusive_total" jdbcType="DECIMAL"/>
            <result property="taxRate" column="tax_rate" jdbcType="DECIMAL"/>
            <result property="taxExclusiveTotal" column="tax_exclusive_total" jdbcType="DECIMAL"/>
            <result property="inboundPerson" column="inbound_person" jdbcType="VARCHAR"/>
    </resultMap>
    <sql id="Base_Column_List">
        id,product_id,inbound_time,
        inbound_batch,supplier_name,inbound_quantity,
        tax_inclusive_price,tax_inclusive_total,tax_rate,
        tax_exclusive_total,inbound_person
    </sql>
    <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List" />
        from stock_in
        where  id = #{id,jdbcType=INTEGER}
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
        delete from stock_in
        where  id = #{id,jdbcType=INTEGER}
    </delete>
    <insert id="insert" keyColumn="id" keyProperty="id" parameterType="inventory.domain.StockIn" useGeneratedKeys="true">
        insert into stock_in
        ( id,product_id,inbound_time
        ,inbound_batch,supplier_name,inbound_quantity
        ,tax_inclusive_price,tax_inclusive_total,tax_rate
        ,tax_exclusive_total,inbound_person)
        values (#{id,jdbcType=INTEGER},#{productId,jdbcType=INTEGER},#{inboundTime,jdbcType=TIMESTAMP}
        ,#{inboundBatch,jdbcType=VARCHAR},#{supplierName,jdbcType=VARCHAR},#{inboundQuantity,jdbcType=INTEGER}
        ,#{taxInclusivePrice,jdbcType=DECIMAL},#{taxInclusiveTotal,jdbcType=DECIMAL},#{taxRate,jdbcType=DECIMAL}
        ,#{taxExclusiveTotal,jdbcType=DECIMAL},#{inboundPerson,jdbcType=VARCHAR})
    </insert>
    <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="inventory.domain.StockIn" useGeneratedKeys="true">
        insert into stock_in
        <trim prefix="(" suffix=")" suffixOverrides=",">
                <if test="id != null">id,</if>
                <if test="productId != null">product_id,</if>
                <if test="inboundTime != null">inbound_time,</if>
                <if test="inboundBatch != null">inbound_batch,</if>
                <if test="supplierName != null">supplier_name,</if>
                <if test="inboundQuantity != null">inbound_quantity,</if>
                <if test="taxInclusivePrice != null">tax_inclusive_price,</if>
                <if test="taxInclusiveTotal != null">tax_inclusive_total,</if>
                <if test="taxRate != null">tax_rate,</if>
                <if test="taxExclusiveTotal != null">tax_exclusive_total,</if>
                <if test="inboundPerson != null">inbound_person,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
                <if test="id != null">#{id,jdbcType=INTEGER},</if>
                <if test="productId != null">#{productId,jdbcType=INTEGER},</if>
                <if test="inboundTime != null">#{inboundTime,jdbcType=TIMESTAMP},</if>
                <if test="inboundBatch != null">#{inboundBatch,jdbcType=VARCHAR},</if>
                <if test="supplierName != null">#{supplierName,jdbcType=VARCHAR},</if>
                <if test="inboundQuantity != null">#{inboundQuantity,jdbcType=INTEGER},</if>
                <if test="taxInclusivePrice != null">#{taxInclusivePrice,jdbcType=DECIMAL},</if>
                <if test="taxInclusiveTotal != null">#{taxInclusiveTotal,jdbcType=DECIMAL},</if>
                <if test="taxRate != null">#{taxRate,jdbcType=DECIMAL},</if>
                <if test="taxExclusiveTotal != null">#{taxExclusiveTotal,jdbcType=DECIMAL},</if>
                <if test="inboundPerson != null">#{inboundPerson,jdbcType=VARCHAR},</if>
        </trim>
    </insert>
    <update id="updateByPrimaryKeySelective" parameterType="inventory.domain.StockIn">
        update stock_in
        <set>
                <if test="productId != null">
                    product_id = #{productId,jdbcType=INTEGER},
                </if>
                <if test="inboundTime != null">
                    inbound_time = #{inboundTime,jdbcType=TIMESTAMP},
                </if>
                <if test="inboundBatch != null">
                    inbound_batch = #{inboundBatch,jdbcType=VARCHAR},
                </if>
                <if test="supplierName != null">
                    supplier_name = #{supplierName,jdbcType=VARCHAR},
                </if>
                <if test="inboundQuantity != null">
                    inbound_quantity = #{inboundQuantity,jdbcType=INTEGER},
                </if>
                <if test="taxInclusivePrice != null">
                    tax_inclusive_price = #{taxInclusivePrice,jdbcType=DECIMAL},
                </if>
                <if test="taxInclusiveTotal != null">
                    tax_inclusive_total = #{taxInclusiveTotal,jdbcType=DECIMAL},
                </if>
                <if test="taxRate != null">
                    tax_rate = #{taxRate,jdbcType=DECIMAL},
                </if>
                <if test="taxExclusiveTotal != null">
                    tax_exclusive_total = #{taxExclusiveTotal,jdbcType=DECIMAL},
                </if>
                <if test="inboundPerson != null">
                    inbound_person = #{inboundPerson,jdbcType=VARCHAR},
                </if>
        </set>
        where   id = #{id,jdbcType=INTEGER}
    </update>
    <update id="updateByPrimaryKey" parameterType="inventory.domain.StockIn">
        update stock_in
        set
            product_id =  #{productId,jdbcType=INTEGER},
            inbound_time =  #{inboundTime,jdbcType=TIMESTAMP},
            inbound_batch =  #{inboundBatch,jdbcType=VARCHAR},
            supplier_name =  #{supplierName,jdbcType=VARCHAR},
            inbound_quantity =  #{inboundQuantity,jdbcType=INTEGER},
            tax_inclusive_price =  #{taxInclusivePrice,jdbcType=DECIMAL},
            tax_inclusive_total =  #{taxInclusiveTotal,jdbcType=DECIMAL},
            tax_rate =  #{taxRate,jdbcType=DECIMAL},
            tax_exclusive_total =  #{taxExclusiveTotal,jdbcType=DECIMAL},
            inbound_person =  #{inboundPerson,jdbcType=VARCHAR}
        where   id = #{id,jdbcType=INTEGER}
    </update>
</mapper>
src/main/resources/mapper/StockManagementMapper.xml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,106 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="inventory.mapper.StockManagementMapper">
    <resultMap id="BaseResultMap" type="inventory.domain.StockManagement">
            <id property="id" column="id" jdbcType="INTEGER"/>
            <result property="productId" column="product_id" jdbcType="INTEGER"/>
            <result property="stockQuantity" column="stock_quantity" jdbcType="INTEGER"/>
            <result property="taxInclusivePrice" column="tax_inclusive_price" jdbcType="DECIMAL"/>
            <result property="taxInclusiveTotal" column="tax_inclusive_total" jdbcType="DECIMAL"/>
            <result property="taxRate" column="tax_rate" jdbcType="DECIMAL"/>
            <result property="taxExclusiveTotal" column="tax_exclusive_total" jdbcType="DECIMAL"/>
            <result property="inboundPerson" column="inbound_person" jdbcType="VARCHAR"/>
    </resultMap>
    <sql id="Base_Column_List">
        id,product_id,stock_quantity,
        tax_inclusive_price,tax_inclusive_total,tax_rate,
        tax_exclusive_total,inbound_person
    </sql>
    <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List" />
        from stock_management
        where  id = #{id,jdbcType=INTEGER}
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
        delete from stock_management
        where  id = #{id,jdbcType=INTEGER}
    </delete>
    <insert id="insert" keyColumn="id" keyProperty="id" parameterType="inventory.domain.StockManagement" useGeneratedKeys="true">
        insert into stock_management
        ( id,product_id,stock_quantity
        ,tax_inclusive_price,tax_inclusive_total,tax_rate
        ,tax_exclusive_total,inbound_person)
        values (#{id,jdbcType=INTEGER},#{productId,jdbcType=INTEGER},#{stockQuantity,jdbcType=INTEGER}
        ,#{taxInclusivePrice,jdbcType=DECIMAL},#{taxInclusiveTotal,jdbcType=DECIMAL},#{taxRate,jdbcType=DECIMAL}
        ,#{taxExclusiveTotal,jdbcType=DECIMAL},#{inboundPerson,jdbcType=VARCHAR})
    </insert>
    <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="inventory.domain.StockManagement" useGeneratedKeys="true">
        insert into stock_management
        <trim prefix="(" suffix=")" suffixOverrides=",">
                <if test="id != null">id,</if>
                <if test="productId != null">product_id,</if>
                <if test="stockQuantity != null">stock_quantity,</if>
                <if test="taxInclusivePrice != null">tax_inclusive_price,</if>
                <if test="taxInclusiveTotal != null">tax_inclusive_total,</if>
                <if test="taxRate != null">tax_rate,</if>
                <if test="taxExclusiveTotal != null">tax_exclusive_total,</if>
                <if test="inboundPerson != null">inbound_person,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
                <if test="id != null">#{id,jdbcType=INTEGER},</if>
                <if test="productId != null">#{productId,jdbcType=INTEGER},</if>
                <if test="stockQuantity != null">#{stockQuantity,jdbcType=INTEGER},</if>
                <if test="taxInclusivePrice != null">#{taxInclusivePrice,jdbcType=DECIMAL},</if>
                <if test="taxInclusiveTotal != null">#{taxInclusiveTotal,jdbcType=DECIMAL},</if>
                <if test="taxRate != null">#{taxRate,jdbcType=DECIMAL},</if>
                <if test="taxExclusiveTotal != null">#{taxExclusiveTotal,jdbcType=DECIMAL},</if>
                <if test="inboundPerson != null">#{inboundPerson,jdbcType=VARCHAR},</if>
        </trim>
    </insert>
    <update id="updateByPrimaryKeySelective" parameterType="inventory.domain.StockManagement">
        update stock_management
        <set>
                <if test="productId != null">
                    product_id = #{productId,jdbcType=INTEGER},
                </if>
                <if test="stockQuantity != null">
                    stock_quantity = #{stockQuantity,jdbcType=INTEGER},
                </if>
                <if test="taxInclusivePrice != null">
                    tax_inclusive_price = #{taxInclusivePrice,jdbcType=DECIMAL},
                </if>
                <if test="taxInclusiveTotal != null">
                    tax_inclusive_total = #{taxInclusiveTotal,jdbcType=DECIMAL},
                </if>
                <if test="taxRate != null">
                    tax_rate = #{taxRate,jdbcType=DECIMAL},
                </if>
                <if test="taxExclusiveTotal != null">
                    tax_exclusive_total = #{taxExclusiveTotal,jdbcType=DECIMAL},
                </if>
                <if test="inboundPerson != null">
                    inbound_person = #{inboundPerson,jdbcType=VARCHAR},
                </if>
        </set>
        where   id = #{id,jdbcType=INTEGER}
    </update>
    <update id="updateByPrimaryKey" parameterType="inventory.domain.StockManagement">
        update stock_management
        set
            product_id =  #{productId,jdbcType=INTEGER},
            stock_quantity =  #{stockQuantity,jdbcType=INTEGER},
            tax_inclusive_price =  #{taxInclusivePrice,jdbcType=DECIMAL},
            tax_inclusive_total =  #{taxInclusiveTotal,jdbcType=DECIMAL},
            tax_rate =  #{taxRate,jdbcType=DECIMAL},
            tax_exclusive_total =  #{taxExclusiveTotal,jdbcType=DECIMAL},
            inbound_person =  #{inboundPerson,jdbcType=VARCHAR}
        where   id = #{id,jdbcType=INTEGER}
    </update>
</mapper>
src/main/resources/mapper/StockOutMapper.xml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,130 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="inventory.mapper.StockOutMapper">
    <resultMap id="BaseResultMap" type="inventory.domain.StockOut">
            <id property="id" column="id" jdbcType="INTEGER"/>
            <result property="productId" column="product_id" jdbcType="INTEGER"/>
            <result property="inboundTime" column="inbound_time" jdbcType="TIMESTAMP"/>
            <result property="inboundBatch" column="inbound_batch" jdbcType="VARCHAR"/>
            <result property="supplierName" column="supplier_name" jdbcType="VARCHAR"/>
            <result property="inboundQuantity" column="inbound_quantity" jdbcType="INTEGER"/>
            <result property="taxInclusivePrice" column="tax_inclusive_price" jdbcType="DECIMAL"/>
            <result property="taxInclusiveTotal" column="tax_inclusive_total" jdbcType="DECIMAL"/>
            <result property="taxRate" column="tax_rate" jdbcType="DECIMAL"/>
            <result property="taxExclusiveTotal" column="tax_exclusive_total" jdbcType="DECIMAL"/>
            <result property="inboundPerson" column="inbound_person" jdbcType="VARCHAR"/>
    </resultMap>
    <sql id="Base_Column_List">
        id,product_id,inbound_time,
        inbound_batch,supplier_name,inbound_quantity,
        tax_inclusive_price,tax_inclusive_total,tax_rate,
        tax_exclusive_total,inbound_person
    </sql>
    <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List" />
        from stock_out
        where  id = #{id,jdbcType=INTEGER}
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
        delete from stock_out
        where  id = #{id,jdbcType=INTEGER}
    </delete>
    <insert id="insert" keyColumn="id" keyProperty="id" parameterType="inventory.domain.StockOut" useGeneratedKeys="true">
        insert into stock_out
        ( id,product_id,inbound_time
        ,inbound_batch,supplier_name,inbound_quantity
        ,tax_inclusive_price,tax_inclusive_total,tax_rate
        ,tax_exclusive_total,inbound_person)
        values (#{id,jdbcType=INTEGER},#{productId,jdbcType=INTEGER},#{inboundTime,jdbcType=TIMESTAMP}
        ,#{inboundBatch,jdbcType=VARCHAR},#{supplierName,jdbcType=VARCHAR},#{inboundQuantity,jdbcType=INTEGER}
        ,#{taxInclusivePrice,jdbcType=DECIMAL},#{taxInclusiveTotal,jdbcType=DECIMAL},#{taxRate,jdbcType=DECIMAL}
        ,#{taxExclusiveTotal,jdbcType=DECIMAL},#{inboundPerson,jdbcType=VARCHAR})
    </insert>
    <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="inventory.domain.StockOut" useGeneratedKeys="true">
        insert into stock_out
        <trim prefix="(" suffix=")" suffixOverrides=",">
                <if test="id != null">id,</if>
                <if test="productId != null">product_id,</if>
                <if test="inboundTime != null">inbound_time,</if>
                <if test="inboundBatch != null">inbound_batch,</if>
                <if test="supplierName != null">supplier_name,</if>
                <if test="inboundQuantity != null">inbound_quantity,</if>
                <if test="taxInclusivePrice != null">tax_inclusive_price,</if>
                <if test="taxInclusiveTotal != null">tax_inclusive_total,</if>
                <if test="taxRate != null">tax_rate,</if>
                <if test="taxExclusiveTotal != null">tax_exclusive_total,</if>
                <if test="inboundPerson != null">inbound_person,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
                <if test="id != null">#{id,jdbcType=INTEGER},</if>
                <if test="productId != null">#{productId,jdbcType=INTEGER},</if>
                <if test="inboundTime != null">#{inboundTime,jdbcType=TIMESTAMP},</if>
                <if test="inboundBatch != null">#{inboundBatch,jdbcType=VARCHAR},</if>
                <if test="supplierName != null">#{supplierName,jdbcType=VARCHAR},</if>
                <if test="inboundQuantity != null">#{inboundQuantity,jdbcType=INTEGER},</if>
                <if test="taxInclusivePrice != null">#{taxInclusivePrice,jdbcType=DECIMAL},</if>
                <if test="taxInclusiveTotal != null">#{taxInclusiveTotal,jdbcType=DECIMAL},</if>
                <if test="taxRate != null">#{taxRate,jdbcType=DECIMAL},</if>
                <if test="taxExclusiveTotal != null">#{taxExclusiveTotal,jdbcType=DECIMAL},</if>
                <if test="inboundPerson != null">#{inboundPerson,jdbcType=VARCHAR},</if>
        </trim>
    </insert>
    <update id="updateByPrimaryKeySelective" parameterType="inventory.domain.StockOut">
        update stock_out
        <set>
                <if test="productId != null">
                    product_id = #{productId,jdbcType=INTEGER},
                </if>
                <if test="inboundTime != null">
                    inbound_time = #{inboundTime,jdbcType=TIMESTAMP},
                </if>
                <if test="inboundBatch != null">
                    inbound_batch = #{inboundBatch,jdbcType=VARCHAR},
                </if>
                <if test="supplierName != null">
                    supplier_name = #{supplierName,jdbcType=VARCHAR},
                </if>
                <if test="inboundQuantity != null">
                    inbound_quantity = #{inboundQuantity,jdbcType=INTEGER},
                </if>
                <if test="taxInclusivePrice != null">
                    tax_inclusive_price = #{taxInclusivePrice,jdbcType=DECIMAL},
                </if>
                <if test="taxInclusiveTotal != null">
                    tax_inclusive_total = #{taxInclusiveTotal,jdbcType=DECIMAL},
                </if>
                <if test="taxRate != null">
                    tax_rate = #{taxRate,jdbcType=DECIMAL},
                </if>
                <if test="taxExclusiveTotal != null">
                    tax_exclusive_total = #{taxExclusiveTotal,jdbcType=DECIMAL},
                </if>
                <if test="inboundPerson != null">
                    inbound_person = #{inboundPerson,jdbcType=VARCHAR},
                </if>
        </set>
        where   id = #{id,jdbcType=INTEGER}
    </update>
    <update id="updateByPrimaryKey" parameterType="inventory.domain.StockOut">
        update stock_out
        set
            product_id =  #{productId,jdbcType=INTEGER},
            inbound_time =  #{inboundTime,jdbcType=TIMESTAMP},
            inbound_batch =  #{inboundBatch,jdbcType=VARCHAR},
            supplier_name =  #{supplierName,jdbcType=VARCHAR},
            inbound_quantity =  #{inboundQuantity,jdbcType=INTEGER},
            tax_inclusive_price =  #{taxInclusivePrice,jdbcType=DECIMAL},
            tax_inclusive_total =  #{taxInclusiveTotal,jdbcType=DECIMAL},
            tax_rate =  #{taxRate,jdbcType=DECIMAL},
            tax_exclusive_total =  #{taxExclusiveTotal,jdbcType=DECIMAL},
            inbound_person =  #{inboundPerson,jdbcType=VARCHAR}
        where   id = #{id,jdbcType=INTEGER}
    </update>
</mapper>
src/main/resources/mapper/StockProductMapper.xml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,75 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="inventory.mapper.StockProductMapper">
    <resultMap id="BaseResultMap" type="inventory.domain.StockProduct">
            <id property="id" column="id" jdbcType="INTEGER"/>
            <result property="productCategory" column="product_category" jdbcType="VARCHAR"/>
            <result property="specModel" column="spec_model" jdbcType="VARCHAR"/>
            <result property="unit" column="unit" jdbcType="VARCHAR"/>
    </resultMap>
    <sql id="Base_Column_List">
        id,product_category,spec_model,
        unit
    </sql>
    <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List" />
        from stock_product
        where  id = #{id,jdbcType=INTEGER}
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
        delete from stock_product
        where  id = #{id,jdbcType=INTEGER}
    </delete>
    <insert id="insert" keyColumn="id" keyProperty="id" parameterType="inventory.domain.StockProduct" useGeneratedKeys="true">
        insert into stock_product
        ( id,product_category,spec_model
        ,unit)
        values (#{id,jdbcType=INTEGER},#{productCategory,jdbcType=VARCHAR},#{specModel,jdbcType=VARCHAR}
        ,#{unit,jdbcType=VARCHAR})
    </insert>
    <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="inventory.domain.StockProduct" useGeneratedKeys="true">
        insert into stock_product
        <trim prefix="(" suffix=")" suffixOverrides=",">
                <if test="id != null">id,</if>
                <if test="productCategory != null">product_category,</if>
                <if test="specModel != null">spec_model,</if>
                <if test="unit != null">unit,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
                <if test="id != null">#{id,jdbcType=INTEGER},</if>
                <if test="productCategory != null">#{productCategory,jdbcType=VARCHAR},</if>
                <if test="specModel != null">#{specModel,jdbcType=VARCHAR},</if>
                <if test="unit != null">#{unit,jdbcType=VARCHAR},</if>
        </trim>
    </insert>
    <update id="updateByPrimaryKeySelective" parameterType="inventory.domain.StockProduct">
        update stock_product
        <set>
                <if test="productCategory != null">
                    product_category = #{productCategory,jdbcType=VARCHAR},
                </if>
                <if test="specModel != null">
                    spec_model = #{specModel,jdbcType=VARCHAR},
                </if>
                <if test="unit != null">
                    unit = #{unit,jdbcType=VARCHAR},
                </if>
        </set>
        where   id = #{id,jdbcType=INTEGER}
    </update>
    <update id="updateByPrimaryKey" parameterType="inventory.domain.StockProduct">
        update stock_product
        set
            product_category =  #{productCategory,jdbcType=VARCHAR},
            spec_model =  #{specModel,jdbcType=VARCHAR},
            unit =  #{unit,jdbcType=VARCHAR}
        where   id = #{id,jdbcType=INTEGER}
    </update>
</mapper>
src/main/resources/mapper/device/DeviceLedgerMapper.xml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,69 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.device.mapper.DeviceLedgerMapper">
    <select id="queryPage" resultType="com.ruoyi.device.dto.DeviceLedgerDto">
        SELECT
        dl.id,
        dl.device_name,
        dl.device_model,
        dl.supplier_name,
        dl.unit,
        dl.number,
        dl.tax_including_price_unit,
        dl.tax_including_price_total,
        dl.tax_rate,
        dl.un_tax_including_price_total,
        dl.create_time,
        dl.update_time ,
        su.user_name AS createUser,
        dl.update_user,
        dl.tenant_id
        FROM device_ledger dl
        left join  sys_user  su on dl.create_user = su.user_id
        <where>
            <!-- è®¾å¤‡åç§° -->
            <if test="deviceLedger.deviceName != null and deviceLedger.deviceName != ''">
                AND device_name LIKE CONCAT('%', #{deviceLedger.deviceName}, '%')
            </if>
            <!-- è§„格型号 -->
            <if test="deviceLedger.deviceModel != null and deviceLedger.deviceModel != ''">
                AND device_model LIKE CONCAT('%', #{deviceLedger.deviceModel}, '%')
            </if>
            <!-- ä¾›åº”商名称 -->
            <if test="deviceLedger.supplierName != null and deviceLedger.supplierName != ''">
                AND supplier_name LIKE CONCAT('%', #{deviceLedger.supplierName}, '%')
            </if>
            <!-- å•位 -->
            <if test="deviceLedger.unit != null and deviceLedger.unit != ''">
                AND unit = #{deviceLedger.unit}
            </if>
            <!-- å½•入人 -->
            <if test="deviceLedger.createUser != null and deviceLedger.createUser != ''">
                AND create_user LIKE CONCAT('%', #{deviceLedger.createUser}, '%')
            </if>
            <!-- æ›´æ–°äºº -->
            <if test="deviceLedger.updateUser != null and deviceLedger.updateUser != ''">
                AND update_user LIKE CONCAT('%', #{deviceLedger.updateUser}, '%')
            </if>
            <!-- ç§Ÿæˆ·ID -->
            <if test="deviceLedger.tenantId != null">
                AND tenant_id = #{deviceLedger.tenantId}
            </if>
        </where>
        ORDER BY create_time DESC
    </select>
    <select id="deviceLedgerExportList" resultType="com.ruoyi.device.execl.DeviceLedgerExeclDto">
    </select>
</mapper>
src/main/resources/mapper/device/DeviceMaintenanceMapper.xml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.device.mapper.DeviceMaintenanceMapper">
    <select id="queryPage" resultType="com.ruoyi.device.dto.DeviceMaintenanceDto">
        select dm.*,
               dl.device_name,
               dl.device_model
        from device_maintenance dm
        left join device_ledger dl on dm.device_ledger_id = dl.id
        <where>
            <if test="deviceRepairDto.deviceName != null">
                and dl.device_name like concat('%',#{deviceRepairDto.deviceName},'%')
            </if>
            <if test="deviceRepairDto.deviceModel != null">
                and dl.device_model like concat('%',#{deviceRepairDto.deviceModel},'%')
            </if>
        </where>
    </select>
</mapper>
src/main/resources/mapper/device/DeviceRepairMapper.xml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.device.mapper.DeviceRepairMapper">
    <select id="queryPage" resultType="com.ruoyi.device.dto.DeviceRepairDto">
        select dr.*,
               dl.device_name,
               dl.device_model
        from device_repair dr
        left join device_ledger dl on dr.device_ledger_id = dl.id
        <where>
            <if test="deviceRepairDto.deviceName != null">
                and dl.device_name like concat('%',#{deviceRepairDto.deviceName},'%')
            </if>
            <if test="deviceRepairDto.deviceModel != null">
                and dl.device_model like concat('%',#{deviceRepairDto.deviceModel},'%')
            </if>
        </where>
    </select>
</mapper>
src/main/resources/mapper/purchase/PurchaseLedgerMapper.xml
@@ -9,4 +9,29 @@
        SET contract_amount = #{totalTaxInclusiveAmount}
        WHERE id = #{id}
    </update>
    <select id="selectPurchaseLedgerListPage" resultType="com.ruoyi.purchase.pojo.PurchaseLedger">
        select
        pl.id,
        pl.purchase_contract_number ,
        pl.sales_contract_no,
        pl.supplier_name,
        pl.project_name,
        pl.contract_amount,
        sum(pr.tickets_amount)as receipt_payment_amount,
        pl.contract_amount-sum(pr.tickets_amount) AS unReceipt_payment_amount,
        pl.entry_date,
        pl.recorder_name
        from purchase_ledger pl
        left join product_record pr on pl.id = pr.purchase_ledger_id
        <where>
            <if test="c.purchaseContractNumber != null and c.purchaseContractNumber != ''">
                pl.purchase_contract_number like concat('%',#{c.purchaseContractNumber},'%')
            </if>
        </where>
        group by pl.id, pl.purchase_contract_number, pl.sales_contract_no, pl.supplier_name,
        pl.project_name,pl.entry_date,
        pl.recorder_name,
        pl.contract_amount
    </select>
</mapper>
src/main/resources/mapper/sales/ReceiptPaymentMapper.xml
@@ -61,38 +61,50 @@
    <select id="bindInvoiceNoRegPage" resultType="com.ruoyi.sales.dto.ReceiptPaymentDto">
        SELECT
            T1.id                ,
            T1.invoice_no        ,
            T1.invoice_total    ,
            T3.project_name,
            T1.invoice_person    ,
            T1.invoice_date      ,
            T1.create_time       ,
            T1.create_user       ,
            T1.update_time       ,
            T1.update_user       ,
            T1.tenant_id         ,
            T2.tax_rate,
            T3.sales_contract_no,
            T3.customer_contract_no,
            T3.customer_name,
            T4.invoiceFileName,
            T5.product_category,
            IFNULL(T6.receipt_payment_amount_total ,0) AS receipt_payment_amount_total,
            (T1.invoice_total  - IFNULL(T6.receipt_payment_amount_total ,0)) AS no_receipt_amount
        T1.id ,
        T1.invoice_no ,
        T1.invoice_total ,
        T3.project_name,
        T1.invoice_person ,
        T1.invoice_date ,
        T1.create_time ,
        T1.create_user ,
        T1.update_time ,
        T1.update_user ,
        T1.tenant_id ,
        T2.tax_rate,
        T3.sales_contract_no,
        T3.customer_contract_no,
        T3.customer_name,
        T4.invoiceFileName,
        T5.product_category,
        IFNULL(T6.receipt_payment_amount_total ,0) AS receipt_payment_amount_total,
        (T1.invoice_total - IFNULL(T6.receipt_payment_amount_total ,0)) AS no_receipt_amount
        FROM invoice_ledger T1
                 LEFT JOIN invoice_registration_product T2 ON T2.id = T1.invoice_registration_product_id
                 LEFT JOIN sales_ledger T3 ON T3.id = T2.sales_ledger_id
                 LEFT JOIN (
            SELECT
                invoice_ledger_id,
                GROUP_CONCAT( name ORDER BY id ASC SEPARATOR ' | ') AS invoiceFileName
            FROM invoice_ledger_file GROUP BY invoice_ledger_id
        LEFT JOIN invoice_registration_product T2 ON T2.id = T1.invoice_registration_product_id
        LEFT JOIN sales_ledger T3 ON T3.id = T2.sales_ledger_id
        LEFT JOIN (
        SELECT
        invoice_ledger_id,
        GROUP_CONCAT( name ORDER BY id ASC SEPARATOR ' | ') AS invoiceFileName
        FROM invoice_ledger_file GROUP BY invoice_ledger_id
        ) T4 ON T4.invoice_ledger_id = T1.id
                 LEFT JOIN sales_ledger_product T5 ON T2.sales_ledger_product_id = T5.id
                 LEFT JOIN (
            SELECT SUM(receipt_payment_amount) AS receipt_payment_amount_total,invoice_ledger_id FROM receipt_payment GROUP BY invoice_ledger_id
        )  T6 ON T1.id = T6.invoice_ledger_id
        LEFT JOIN sales_ledger_product T5 ON T2.sales_ledger_product_id = T5.id
        LEFT JOIN (
        SELECT SUM(receipt_payment_amount) AS receipt_payment_amount_total,invoice_ledger_id FROM receipt_payment GROUP
        BY invoice_ledger_id
        ) T6 ON T1.id = T6.invoice_ledger_id
        <where>
            <if test="c.customerName != null and c.customerName !=''">
                AND T3.customer_name LIKE CONCAT('%',#{c.customerName},'%')
            </if>
            <if test="c.customerContractNo != null and c.customerContractNo !=''">
                AND T3.customer_contract_no LIKE CONCAT('%',#{c.customerContractNo},'%')
            </if>
            <if test="c.projectName != null and c.projectName !=''">
                AND T3.project_name LIKE CONCAT('%',#{c.projectName},'%')
            </if>
        </where>
        ORDER BY T2.create_time DESC
    </select>
@@ -174,7 +186,9 @@
        T1.receipt_payment_type,
        T1.registrant,
        T1.create_time,
        T4.project_name
        T4.project_name,
        T4.sales_contract_no,
        T4.customer_contract_no
        FROM
        receipt_payment T1
        LEFT JOIN
@@ -191,6 +205,15 @@
            </if>
            <if test="params.receiptPaymentDateEnd != null and params.receiptPaymentDateEnd != '' ">
                AND T1.receipt_payment_date &lt;= date_format(#{params.receiptPaymentDateEnd}, '%Y-%m-%d')
            </if>
            <if test="params.projectName != null and params.projectName != '' ">
                AND T4.project_name LIKE CONCAT('%',#{params.projectName},'%')
            </if>
            <if test="params.customerContractNo != null and params.customerContractNo != '' ">
                AND T4.customer_contract_no LIKE CONCAT('%',#{params.customerContractNo},'%')
            </if>
            <if test="params.salesContractNo != null and params.salesContractNo != '' ">
                AND T4.sales_contract_no LIKE CONCAT('%',#{params.salesContractNo},'%')
            </if>
        </where>
        ORDER BY T1.receipt_payment_date DESC
@@ -309,5 +332,89 @@
        WHERE
            T2.invoice_registration_product_id = #{invoiceRegistrationProductId}
    </select>
    <select id="bindInvoiceNoRegListAll" resultType="com.ruoyi.sales.dto.ReceiptPaymentDto">
        SELECT
            T1.id ,
            T1.invoice_no ,
            T1.invoice_total ,
            T3.project_name,
            T1.invoice_person ,
            T1.invoice_date ,
            T1.create_time ,
            T1.create_user ,
            T1.update_time ,
            T1.update_user ,
            T1.tenant_id ,
            T2.tax_rate,
            T3.sales_contract_no,
            T3.customer_contract_no,
            T3.customer_name,
            T4.invoiceFileName,
            T5.product_category,
            IFNULL(T6.receipt_payment_amount_total ,0) AS receipt_payment_amount_total,
            (T1.invoice_total - IFNULL(T6.receipt_payment_amount_total ,0)) AS no_receipt_amount
        FROM invoice_ledger T1
                 LEFT JOIN invoice_registration_product T2 ON T2.id = T1.invoice_registration_product_id
                 LEFT JOIN sales_ledger T3 ON T3.id = T2.sales_ledger_id
                 LEFT JOIN (
            SELECT
                invoice_ledger_id,
                GROUP_CONCAT( name ORDER BY id ASC SEPARATOR ' | ') AS invoiceFileName
            FROM invoice_ledger_file GROUP BY invoice_ledger_id
        ) T4 ON T4.invoice_ledger_id = T1.id
                 LEFT JOIN sales_ledger_product T5 ON T2.sales_ledger_product_id = T5.id
                 LEFT JOIN (
            SELECT SUM(receipt_payment_amount) AS receipt_payment_amount_total,invoice_ledger_id FROM receipt_payment GROUP
                BY invoice_ledger_id
        ) T6 ON T1.id = T6.invoice_ledger_id
    </select>
    <select id="bindInvoiceNoRegListByIds" resultType="com.ruoyi.sales.dto.ReceiptPaymentExeclDto">
        SELECT
        T1.id ,
        T1.invoice_no ,
        T1.invoice_total ,
        T3.project_name,
        T1.invoice_person ,
        T1.invoice_date ,
        T1.create_time ,
        T1.create_user ,
        T1.update_time ,
        T1.update_user ,
        T1.tenant_id ,
        T2.tax_rate,
        T3.sales_contract_no,
        T3.customer_contract_no,
        T3.customer_name,
        T4.invoiceFileName,
        T5.product_category,
        IFNULL(T6.receipt_payment_amount_total ,0) AS receipt_payment_amount_total,
        (T1.invoice_total - IFNULL(T6.receipt_payment_amount_total ,0)) AS no_receipt_amount
        FROM invoice_ledger T1
        LEFT JOIN invoice_registration_product T2 ON T2.id = T1.invoice_registration_product_id
        LEFT JOIN sales_ledger T3 ON T3.id = T2.sales_ledger_id
        LEFT JOIN (
        SELECT
        invoice_ledger_id,
        GROUP_CONCAT( name ORDER BY id ASC SEPARATOR ' | ') AS invoiceFileName
        FROM invoice_ledger_file GROUP BY invoice_ledger_id
        ) T4 ON T4.invoice_ledger_id = T1.id
        LEFT JOIN sales_ledger_product T5 ON T2.sales_ledger_product_id = T5.id
        LEFT JOIN (
        SELECT SUM(receipt_payment_amount) AS receipt_payment_amount_total,invoice_ledger_id FROM receipt_payment GROUP
        BY invoice_ledger_id
        ) T6 ON T1.id = T6.invoice_ledger_id
        <where>
        <if test="ids.size() > 0">
            T1.id IN
            <foreach item="item" collection="ids" separator="," open="(" close=")">
                #{item}
            </foreach>
        </if>
        <if test="tenantId != null " >
            AND T1.tenant_id = #{tenantId}
        </if>
        </where>
    </select>
</mapper>
src/main/resources/mapper/sales/SalesLedgerMapper.xml
@@ -64,8 +64,11 @@
            <if test="salesLedgerDto.customerName != null and salesLedgerDto.customerName != '' ">
                T1.customer_name LIKE CONCAT('%',#{salesLedgerDto.customerName},'%')
            </if>
            <if test="salesLedgerDto.customerContractNo != null and salesLedgerDto.customerContractNo != '' ">
                T1.sales_contract_no LIKE CONCAT('%',#{salesLedgerDto.customerContractNo},'%')
            <if test="salesLedgerDto.customerContractNo != null and salesLedgerDto.customerContractNo !='' ">
                T1.customer_contract_no LIKE CONCAT('%',#{salesLedgerDto.customerContractNo},'%')
            </if>
            <if test="salesLedgerDto.salesContractNo != null and salesLedgerDto.salesContractNo != '' ">
                T1.sales_contract_no LIKE CONCAT('%',#{salesLedgerDto.salesContractNo},'%')
            </if>
            <if test="salesLedgerDto.projectName != null and salesLedgerDto.projectName != '' ">
                T1.project_name LIKE CONCAT('%',#{salesLedgerDto.projectName},'%')
src/main/resources/mapper/staff_management/RyglAddEmployeeMapper.xml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,194 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.staff_management.mapper.RyglAddEmployeeMapper">
    <resultMap id="BaseResultMap" type="staff_management.domain.RyglAddEmployee">
            <id property="id" column="id" jdbcType="INTEGER"/>
            <result property="status" column="status" jdbcType="INTEGER"/>
            <result property="employeeNumber" column="employee_number" jdbcType="VARCHAR"/>
            <result property="name" column="name" jdbcType="VARCHAR"/>
            <result property="sex" column="sex" jdbcType="VARCHAR"/>
            <result property="nativePlace" column="native_place" jdbcType="VARCHAR"/>
            <result property="post" column="post" jdbcType="VARCHAR"/>
            <result property="homeAddress" column="home_address" jdbcType="VARCHAR"/>
            <result property="firstDegree" column="first_degree" jdbcType="VARCHAR"/>
            <result property="major" column="major" jdbcType="VARCHAR"/>
            <result property="idNumber" column="id_number" jdbcType="INTEGER"/>
            <result property="age" column="age" jdbcType="INTEGER"/>
            <result property="contactNumber" column="contact_number" jdbcType="INTEGER"/>
            <result property="emergencyContact" column="emergency_contact" jdbcType="VARCHAR"/>
            <result property="emergencyContactNumber" column="emergency_contact_number" jdbcType="INTEGER"/>
            <result property="contractTerm" column="contract_term" jdbcType="VARCHAR"/>
            <result property="contractStartDate" column="contract_start_date" jdbcType="TIMESTAMP"/>
            <result property="contractEndDate" column="contract_end_date" jdbcType="TIMESTAMP"/>
    </resultMap>
    <sql id="Base_Column_List">
        id,status,employee_number,
        name,sex,native_place,
        post,home_address,first_degree,
        major,id_number,age,
        contact_number,emergency_contact,emergency_contact_number,
        contract_term,contract_start_date,contract_end_date
    </sql>
    <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List" />
        from rygl_add_employee
        where  id = #{id,jdbcType=INTEGER}
    </select>
    <select id="getAllEmployees" resultType="com.ruoyi.staff_management.domain.RyglAddEmployee">
        SELECT * FROM rygl_add_employee
    </select>
    <select id="searchByName" resultType="com.ruoyi.staff_management.domain.RyglAddEmployee">
        SELECT * FROM rygl_add_employee WHERE name LIKE CONCAT('%', #{name}, '%')
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
        delete from rygl_add_employee
        where  id = #{id,jdbcType=INTEGER}
    </delete>
    <insert id="insert" keyColumn="id" keyProperty="id" parameterType="staff_management.domain.RyglAddEmployee" useGeneratedKeys="true">
        insert into rygl_add_employee
        ( id,status,employee_number
        ,name,sex,native_place
        ,post,home_address,first_degree
        ,major,id_number,age
        ,contact_number,emergency_contact,emergency_contact_number
        ,contract_term,contract_start_date,contract_end_date
        )
        values (#{id,jdbcType=INTEGER},#{status,jdbcType=INTEGER},#{employeeNumber,jdbcType=VARCHAR}
        ,#{name,jdbcType=VARCHAR},#{sex,jdbcType=VARCHAR},#{nativePlace,jdbcType=VARCHAR}
        ,#{post,jdbcType=VARCHAR},#{homeAddress,jdbcType=VARCHAR},#{firstDegree,jdbcType=VARCHAR}
        ,#{major,jdbcType=VARCHAR},#{idNumber,jdbcType=INTEGER},#{age,jdbcType=INTEGER}
        ,#{contactNumber,jdbcType=INTEGER},#{emergencyContact,jdbcType=VARCHAR},#{emergencyContactNumber,jdbcType=INTEGER}
        ,#{contractTerm,jdbcType=VARCHAR},#{contractStartDate,jdbcType=TIMESTAMP},#{contractEndDate,jdbcType=TIMESTAMP}
        )
    </insert>
    <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="staff_management.domain.RyglAddEmployee" useGeneratedKeys="true">
        insert into rygl_add_employee
        <trim prefix="(" suffix=")" suffixOverrides=",">
                <if test="id != null">id,</if>
                <if test="status != null">status,</if>
                <if test="employeeNumber != null">employee_number,</if>
                <if test="name != null">name,</if>
                <if test="sex != null">sex,</if>
                <if test="nativePlace != null">native_place,</if>
                <if test="post != null">post,</if>
                <if test="homeAddress != null">home_address,</if>
                <if test="firstDegree != null">first_degree,</if>
                <if test="major != null">major,</if>
                <if test="idNumber != null">id_number,</if>
                <if test="age != null">age,</if>
                <if test="contactNumber != null">contact_number,</if>
                <if test="emergencyContact != null">emergency_contact,</if>
                <if test="emergencyContactNumber != null">emergency_contact_number,</if>
                <if test="contractTerm != null">contract_term,</if>
                <if test="contractStartDate != null">contract_start_date,</if>
                <if test="contractEndDate != null">contract_end_date,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
                <if test="id != null">#{id,jdbcType=INTEGER},</if>
                <if test="status != null">#{status,jdbcType=INTEGER},</if>
                <if test="employeeNumber != null">#{employeeNumber,jdbcType=VARCHAR},</if>
                <if test="name != null">#{name,jdbcType=VARCHAR},</if>
                <if test="sex != null">#{sex,jdbcType=VARCHAR},</if>
                <if test="nativePlace != null">#{nativePlace,jdbcType=VARCHAR},</if>
                <if test="post != null">#{post,jdbcType=VARCHAR},</if>
                <if test="homeAddress != null">#{homeAddress,jdbcType=VARCHAR},</if>
                <if test="firstDegree != null">#{firstDegree,jdbcType=VARCHAR},</if>
                <if test="major != null">#{major,jdbcType=VARCHAR},</if>
                <if test="idNumber != null">#{idNumber,jdbcType=INTEGER},</if>
                <if test="age != null">#{age,jdbcType=INTEGER},</if>
                <if test="contactNumber != null">#{contactNumber,jdbcType=INTEGER},</if>
                <if test="emergencyContact != null">#{emergencyContact,jdbcType=VARCHAR},</if>
                <if test="emergencyContactNumber != null">#{emergencyContactNumber,jdbcType=INTEGER},</if>
                <if test="contractTerm != null">#{contractTerm,jdbcType=VARCHAR},</if>
                <if test="contractStartDate != null">#{contractStartDate,jdbcType=TIMESTAMP},</if>
                <if test="contractEndDate != null">#{contractEndDate,jdbcType=TIMESTAMP},</if>
        </trim>
    </insert>
    <update id="updateByPrimaryKeySelective" parameterType="staff_management.domain.RyglAddEmployee">
        update rygl_add_employee
        <set>
                <if test="status != null">
                    status = #{status,jdbcType=INTEGER},
                </if>
                <if test="employeeNumber != null">
                    employee_number = #{employeeNumber,jdbcType=VARCHAR},
                </if>
                <if test="name != null">
                    name = #{name,jdbcType=VARCHAR},
                </if>
                <if test="sex != null">
                    sex = #{sex,jdbcType=VARCHAR},
                </if>
                <if test="nativePlace != null">
                    native_place = #{nativePlace,jdbcType=VARCHAR},
                </if>
                <if test="post != null">
                    post = #{post,jdbcType=VARCHAR},
                </if>
                <if test="homeAddress != null">
                    home_address = #{homeAddress,jdbcType=VARCHAR},
                </if>
                <if test="firstDegree != null">
                    first_degree = #{firstDegree,jdbcType=VARCHAR},
                </if>
                <if test="major != null">
                    major = #{major,jdbcType=VARCHAR},
                </if>
                <if test="idNumber != null">
                    id_number = #{idNumber,jdbcType=INTEGER},
                </if>
                <if test="age != null">
                    age = #{age,jdbcType=INTEGER},
                </if>
                <if test="contactNumber != null">
                    contact_number = #{contactNumber,jdbcType=INTEGER},
                </if>
                <if test="emergencyContact != null">
                    emergency_contact = #{emergencyContact,jdbcType=VARCHAR},
                </if>
                <if test="emergencyContactNumber != null">
                    emergency_contact_number = #{emergencyContactNumber,jdbcType=INTEGER},
                </if>
                <if test="contractTerm != null">
                    contract_term = #{contractTerm,jdbcType=VARCHAR},
                </if>
                <if test="contractStartDate != null">
                    contract_start_date = #{contractStartDate,jdbcType=TIMESTAMP},
                </if>
                <if test="contractEndDate != null">
                    contract_end_date = #{contractEndDate,jdbcType=TIMESTAMP},
                </if>
        </set>
        where   id = #{id,jdbcType=INTEGER}
    </update>
    <update id="updateByPrimaryKey" parameterType="staff_management.domain.RyglAddEmployee">
        update rygl_add_employee
        set
            status =  #{status,jdbcType=INTEGER},
            employee_number =  #{employeeNumber,jdbcType=VARCHAR},
            name =  #{name,jdbcType=VARCHAR},
            sex =  #{sex,jdbcType=VARCHAR},
            native_place =  #{nativePlace,jdbcType=VARCHAR},
            post =  #{post,jdbcType=VARCHAR},
            home_address =  #{homeAddress,jdbcType=VARCHAR},
            first_degree =  #{firstDegree,jdbcType=VARCHAR},
            major =  #{major,jdbcType=VARCHAR},
            id_number =  #{idNumber,jdbcType=INTEGER},
            age =  #{age,jdbcType=INTEGER},
            contact_number =  #{contactNumber,jdbcType=INTEGER},
            emergency_contact =  #{emergencyContact,jdbcType=VARCHAR},
            emergency_contact_number =  #{emergencyContactNumber,jdbcType=INTEGER},
            contract_term =  #{contractTerm,jdbcType=VARCHAR},
            contract_start_date =  #{contractStartDate,jdbcType=TIMESTAMP},
            contract_end_date =  #{contractEndDate,jdbcType=TIMESTAMP}
        where   id = #{id,jdbcType=INTEGER}
    </update>
</mapper>