feat:1.groupBy
2.appVersion添加
| | |
| | | package com.ruoyi.common.enums; |
| | | |
| | | import lombok.Getter; |
| | | |
| | | @Getter |
| | | public enum FileNameType { |
| | | |
| | | SALE(1), // éå® |
| | |
| | | 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; |
| | | |
| | | } |
| | | |
| | | // æ ¹æ®æ´æ°å¼è·å对åºçæä¸¾å¼ |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | 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)); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | 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> { |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | 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; |
| | | } |
| | |
| | | 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 |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | 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); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | 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()); |
| | | } |
| | | } |
| | | } |
| | |
| | | <if test="dateQueryDto.entryDateEnd != null and dateQueryDto.entryDateEnd != '' "> |
| | | AND expense_date <= 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"> |
| | |
| | | <if test="dateQueryDto.entryDateEnd != null and dateQueryDto.entryDateEnd != '' "> |
| | | AND income_date <= 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 |
| | |
| | | </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"> |
| | |
| | | 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> |
| | |
| | | <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"> |
| | |
| | | <select id="performanceShiftPage" resultType="com.ruoyi.staff.dto.PerformanceShiftMapDto"> |
| | | SELECT |
| | | u.staff_name name, |
| | | GROUP_CONCAT(s.work_time, 'ï¼', IFNULL(palc.shift, ''), 'ï¼', s.id order by s.work_time SEPARATOR ';') AS shift_time, |
| | | 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 |
| | |
| | | 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"> |