liding
2026-04-09 269ff4fbac22ae08107ee47ef500bd9574ccccce
feat:1.groupBy
2.appVersion添加
已添加5个文件
已修改8个文件
222 ■■■■ 文件已修改
src/main/java/com/ruoyi/common/enums/FileNameType.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/other/controller/PdaVersionController.java 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/other/mapper/PdaVersionMapper.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/other/pojo/PdaVersion.java 57 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/other/pojo/TempFile.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/other/service/PdaVersionService.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/other/service/impl/PdaVersionServiceImpl.java 60 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/account/AccountExpenseMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/account/AccountIncomeMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/production/SalesLedgerProductionAccountingMapper.xml 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/purchase/PaymentRegistrationMapper.xml 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/sales/SalesLedgerProductMapper.xml 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/staff/PersonalShiftMapper.xml 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/common/enums/FileNameType.java
@@ -1,6 +1,8 @@
package com.ruoyi.common.enums;
import lombok.Getter;
@Getter
public enum FileNameType {
    SALE(1),      // é”€å”®
@@ -14,17 +16,13 @@
    SHIP(9),//发货台账
    INSPECTION_PRODUCTION_BEFORE(10),
    INSPECTION_PRODUCTION_AFTER(11),
    INSPECTION(12);//巡检 ç”Ÿäº§å‰
    INSPECTION(12),//巡检 ç”Ÿäº§å‰
    APP(13);
    private final int value;
    FileNameType(int value) {
        this.value = value;
    }
    public int getValue() {
        return value;
    }
    // æ ¹æ®æ•´æ•°å€¼èŽ·å–å¯¹åº”çš„æžšä¸¾å€¼
src/main/java/com/ruoyi/other/controller/PdaVersionController.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,31 @@
package com.ruoyi.other.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.framework.web.domain.R;
import com.ruoyi.other.pojo.PdaVersion;
import com.ruoyi.other.service.PdaVersionService;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
@RestController
@RequestMapping("/app")
@AllArgsConstructor
public class PdaVersionController {
    private PdaVersionService pdaVersionService;
    @ApiOperation("查询所有版本")
    @GetMapping("/getAllVersion")
    public R getAllVersion(Page<PdaVersion> page, PdaVersion pdaVersion) {
        return R.ok(pdaVersionService.getAllVersion(page, pdaVersion));
    }
    @ApiOperation("上传apk")
    @PostMapping("/uploadApk")
    public R uploadApk(@RequestParam("file") MultipartFile file, String name, String version) {
        return R.ok(pdaVersionService.uploadApk(file, name, version));
    }
}
src/main/java/com/ruoyi/other/mapper/PdaVersionMapper.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,9 @@
package com.ruoyi.other.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.other.pojo.PdaVersion;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface PdaVersionMapper extends BaseMapper<PdaVersion> {
}
src/main/java/com/ruoyi/other/pojo/PdaVersion.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,57 @@
package com.ruoyi.other.pojo;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.sales.pojo.CommonFile;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;
@Data
@TableName("pda_version")
@ApiModel(value = "PdaVersion", description = "PDA版本信息表")
public class PdaVersion implements Serializable {
    private static final long serialVersionUID = 1L;
    @ApiModelProperty("主键ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    @ApiModelProperty("名称")
    private String name;
    @ApiModelProperty("版本号")
    private String version;
    @ApiModelProperty("创建时间")
    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @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", timezone = "GMT+8")
    @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;
    @TableField(exist = false)
    private List<CommonFile> commonFileList;
}
src/main/java/com/ruoyi/other/pojo/TempFile.java
@@ -4,11 +4,12 @@
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.io.Serializable;
import java.time.LocalDateTime;
@Data
@TableName("temp_file")
public class TempFile {
public class TempFile implements Serializable {
    private static final long serialVersionUID = 1L;
    @TableId
src/main/java/com/ruoyi/other/service/PdaVersionService.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,13 @@
package com.ruoyi.other.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.other.pojo.PdaVersion;
import org.springframework.web.multipart.MultipartFile;
public interface PdaVersionService extends IService<PdaVersion> {
    IPage<PdaVersion> getAllVersion(Page<PdaVersion> page, PdaVersion pdaVersion);
    boolean uploadApk(MultipartFile file, String name, String version);
}
src/main/java/com/ruoyi/other/service/impl/PdaVersionServiceImpl.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,60 @@
package com.ruoyi.other.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
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.enums.FileNameType;
import com.ruoyi.other.mapper.PdaVersionMapper;
import com.ruoyi.other.pojo.PdaVersion;
import com.ruoyi.other.service.PdaVersionService;
import com.ruoyi.other.service.TempFileService;
import com.ruoyi.sales.service.impl.CommonFileServiceImpl;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.Assert;
import org.springframework.web.multipart.MultipartFile;
@Service
@RequiredArgsConstructor
@Transactional(rollbackFor = Exception.class)
public class PdaVersionServiceImpl extends ServiceImpl<PdaVersionMapper, PdaVersion> implements PdaVersionService {
    private final PdaVersionMapper pdaVersionMapper;
    private final TempFileService tempFileService;
    private final CommonFileServiceImpl commonFileService;
    @Override
    public IPage<PdaVersion> getAllVersion(Page<PdaVersion> page, PdaVersion pdaVersion) {
        LambdaQueryWrapper<PdaVersion> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.orderByDesc(PdaVersion::getCreateTime);
        Page<PdaVersion> pdaVersionPage = pdaVersionMapper.selectPage(page, queryWrapper);
        pdaVersionPage.getRecords().forEach(item ->{
            item.setCommonFileList(commonFileService.getFileListByBusinessId(item.getId(), FileNameType.APP.getValue()));
        });
        return pdaVersionPage;
    }
    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean uploadApk(MultipartFile file, String name, String version) {
        // å‚数校验
        Assert.notNull(file, "文件不能为空");
        Assert.hasText(version, "版本号不能为空");
        try {
            PdaVersion pdaVersion = new PdaVersion();
            pdaVersion.setName(name);
            pdaVersion.setVersion(version);
            pdaVersionMapper.insert(pdaVersion);
            tempFileService.uploadByCommon(file, FileNameType.APP.getValue(), pdaVersion.getId());
            return true;
        } catch (Exception e) {
            throw new RuntimeException("上传APK失败: " + e.getMessage());
        }
    }
}
src/main/resources/mapper/account/AccountExpenseMapper.xml
@@ -59,7 +59,7 @@
        <if test="dateQueryDto.entryDateEnd != null and dateQueryDto.entryDateEnd != '' ">
            AND expense_date &lt;= DATE_FORMAT(#{dateQueryDto.entryDateEnd},'%Y-%m-%d')
        </if>
        group by expense_type
        group by sdd.dict_label, ae.expense_type
    </select>
    <select id="report1" resultType="java.math.BigDecimal">
src/main/resources/mapper/account/AccountIncomeMapper.xml
@@ -61,7 +61,7 @@
        <if test="dateQueryDto.entryDateEnd != null and dateQueryDto.entryDateEnd != '' ">
            AND income_date &lt;= DATE_FORMAT(#{dateQueryDto.entryDateEnd},'%Y-%m-%d')
        </if>
        group by income_type
        GROUP BY sdd.dict_label, ai.income_type
    </select>
    <select id="report1" resultType="java.math.BigDecimal">
        SELECT
src/main/resources/mapper/production/SalesLedgerProductionAccountingMapper.xml
@@ -84,8 +84,7 @@
            </if>
        </where>
        GROUP BY slpa.scheduling_user_name
        GROUP BY slpa.scheduling_user_id, slpa.scheduling_user_name
    </select>
    <select id="selectDailyWagesStats" resultType="java.util.Map">
src/main/resources/mapper/purchase/PaymentRegistrationMapper.xml
@@ -197,27 +197,27 @@
                T1.supplier_name LIKE CONCAT ('%',#{req.supplierName},'%')
            </if>
        </where>
        GROUP BY T1.supplier_name
        GROUP BY T1.supplier_id, T1.supplier_name
    </select>
    <select id="supplierNameListPageDetails" resultType="com.ruoyi.purchase.dto.PaymentRegistrationDto">
        SELECT
        T1.supplier_id,
        T1.supplier_name,
        SUM(contract_amount) AS invoiceAmount,
        IFNULL( SUM(T2.current_payment_amount) , 0 ) AS paymentAmount,
        IFNULL((IFNULL(SUM(contract_amount),0)  - IFNULL(SUM(T2.current_payment_amount),0)),0) AS payableAmount,
        T1.purchase_contract_number,
        T2.payment_date
        T2.payment_date,
        SUM(T1.contract_amount) AS invoiceAmount,
        IFNULL(SUM(T2.current_payment_amount), 0) AS paymentAmount,
        IFNULL((IFNULL(SUM(T1.contract_amount), 0) - IFNULL(SUM(T2.current_payment_amount), 0)), 0) AS payableAmount
        FROM purchase_ledger T1
        INNER JOIN payment_registration T2 ON T1.id = T2.purchase_ledger_id
        <where>
            T1.supplier_id = #{req.supplierId}
            <if test="req.supplierName != null and req.supplierName != '' ">
                T1.supplier_name LIKE CONCAT ('%',#{req.supplierName},'%')
                AND T1.supplier_name LIKE CONCAT ('%',#{req.supplierName},'%')
            </if>
        </where>
        GROUP BY  T1.purchase_contract_number,T2.payment_date
        GROUP BY T1.supplier_id, T1.supplier_name, T1.purchase_contract_number, T2.payment_date
    </select>
</mapper>
src/main/resources/mapper/sales/SalesLedgerProductMapper.xml
@@ -131,9 +131,7 @@
        <if test="req.productCategory != null and req.productCategory != ''">
            AND slp.product_category = #{req.productCategory}
        </if>
        <!-- æŒ‰äº§å“å¤§ç±»åˆ†ç»„聚合 -->
        GROUP BY slp.product_category
        <!-- æŒ‰äº§å“å¤§ç±»æŽ’序 -->
        GROUP BY slp.product_category, slp.specification_model, sl.supplier_name
        ORDER BY slp.product_category
    </select>
    <select id="selectProductBomStructure" resultType="com.ruoyi.sales.dto.LossProductModelDto">
src/main/resources/mapper/staff/PersonalShiftMapper.xml
@@ -12,26 +12,26 @@
        <result column="work_time" property="workTime" />
    </resultMap>
    <select id="performanceShiftPage" resultType="com.ruoyi.staff.dto.PerformanceShiftMapDto">
         SELECT
        SELECT
        u.staff_name name,
        GROUP_CONCAT(s.work_time, ':', IFNULL(palc.shift, ''), ':', s.id order by s.work_time SEPARATOR ';') AS shift_time,
                u.id user_id
        GROUP_CONCAT(s.work_time, ':', IFNULL(palc.shift, ''), ':', s.id ORDER BY s.work_time SEPARATOR ';') AS shift_time,
        u.id user_id
        FROM personal_shift s
        LEFT JOIN staff_on_job u ON u.id = s.staff_on_job_id
        LEFT JOIN personal_attendance_location_config palc ON palc.id = s.personal_attendance_location_config_id
        <where>
             <if test="sysDeptId != null and sysDeptId != ''">
            <if test="sysDeptId != null and sysDeptId != ''">
                and u.sys_dept_id = #{sysDeptId}
            </if>
            <if test="time != null and time != ''">
                and DATE_FORMAT(s.work_time, '%Y-%m') = DATE_FORMAT(#{time}, '%Y-%m' )
                and DATE_FORMAT(s.work_time, '%Y-%m') = DATE_FORMAT(#{time}, '%Y-%m')
            </if>
            <if test="userName != null and userName != ''">
                and u.staff_name like concat('%', #{userName}, '%')
            </if>
        </where>
        GROUP BY u.id
        order by s.create_time
        GROUP BY u.id, u.staff_name
        ORDER BY MAX(s.create_time)
    </select>
   
    <select id="performanceShiftYear" resultType="java.util.Map">