质量宣传图查询修改

This commit is contained in:
yf001217 2026-06-26 18:20:55 +08:00
parent 0e4d3d7aa8
commit 6a91d8ce94
9 changed files with 56 additions and 11 deletions

View File

@ -5,6 +5,7 @@ import com.nflg.wms.common.pojo.ApiResult;
import com.nflg.wms.common.pojo.PageData;
import com.nflg.wms.common.pojo.qo.AdvertisementRequst;
import com.nflg.wms.common.pojo.qo.AdvertisementSaveRequest;
import com.nflg.wms.common.pojo.qo.AdvertisementVersionRequest;
import com.nflg.wms.common.pojo.qo.EnableBatchQO;
import com.nflg.wms.common.pojo.qo.PageQO;
import com.nflg.wms.common.pojo.vo.AdvertisementListVO;
@ -106,7 +107,7 @@ public class AdvertisementController extends BaseController {
* @return 质量宣传图版本列表
*/
@PostMapping("versions")
public ApiResult<List<AdvertisementListVO>> getAdvertisementVersions(@Valid @RequestBody @NotNull AdvertisementRequst request){
public ApiResult<List<AdvertisementListVO>> getAdvertisementVersions(@Valid @RequestBody @NotNull AdvertisementVersionRequest request){
return ApiResult.success(advertisementService.getVersions(request.getType(), request.getPosition()));
}

View File

@ -1,6 +1,6 @@
package com.nflg.wms.common.pojo.qo;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;
@ -10,12 +10,12 @@ public class AdvertisementRequst {
/**
* 广告类型
*/
@NotNull
private Long type;
@NotBlank
private String type;
/**
* 广告位置
*/
@NotNull
private Long position;
@NotBlank
private String position;
}

View File

@ -0,0 +1,20 @@
package com.nflg.wms.common.pojo.qo;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
@Data
public class AdvertisementVersionRequest {
/**
* 广告类型id
*/
@NotNull
private Long type;
/**
* 广告位置id
*/
@NotNull
private Long position;
}

View File

@ -27,9 +27,25 @@ public class QmsReturnInspectionTaskRecordVO {
private String batchNo;
/**
* 送检数量
*/
private Integer inspectionQty;
/**
* 合格数量
*/
private Integer qualifiedQty;
/**
* 不合格数量
*/
private Integer unqualifiedQty;
/**
* 是否合格
*/
@Deprecated
private Boolean qualified;
/**

View File

@ -1,6 +1,7 @@
package com.nflg.wms.repository.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Getter;
@ -25,6 +26,11 @@ public class QmsReturnInspectionTaskRecord implements Serializable {
private Long taskId;
private String materialUniqueNo;
private String batchNo;
private Integer inspectionQty;
private Integer qualifiedQty;
private Integer unqualifiedQty;
@Deprecated
@TableField(exist = false)
private Boolean qualified;
private Long createUserId;
private String createUserName;

View File

@ -18,7 +18,7 @@ import java.util.List;
public interface AdvertisementMapper extends BaseMapper<Advertisement> {
Advertisement getByType(Long type, Long position);
Advertisement getByType(String type, String position);
IPage<AdvertisementListVO> getList(IPage<?> page);

View File

@ -21,7 +21,7 @@ import java.util.List;
*/
public interface IAdvertisementService extends IService<Advertisement> {
AdvertisementVO getByType(Long type, Long position);
AdvertisementVO getByType(String type, String position);
void save(AdvertisementSaveRequest request);

View File

@ -32,7 +32,7 @@ import java.util.Objects;
public class AdvertisementServiceImpl extends ServiceImpl<AdvertisementMapper, Advertisement> implements IAdvertisementService {
@Override
public AdvertisementVO getByType(Long type, Long position) {
public AdvertisementVO getByType(String type, String position) {
Advertisement ad = baseMapper.getByType(type, position);
if (Objects.isNull(ad)) {
return null;

View File

@ -5,8 +5,10 @@
<select id="getByType" resultType="com.nflg.wms.repository.entity.Advertisement">
SELECT ad.*
FROM qms_advertisement ad
WHERE ad.type = #{type}
AND ad.position = #{position}
INNER JOIN dictionary_item di1 ON ad.type = di1.id
INNER JOIN dictionary_item di2 ON ad.position = di2.id
WHERE di1.code = #{type}
AND di2.code = #{position}
AND ad.enable
ORDER BY CAST(SUBSTRING(ad.version, 2) AS INTEGER) DESC
LIMIT 1