修改返回数据

This commit is contained in:
yangjun 2026-04-27 14:37:37 +08:00
parent 6f5257adc9
commit 1ca997fd74
8 changed files with 94 additions and 9 deletions

View File

@ -617,6 +617,16 @@ public class InvoicingApi {
}
@GetMapping(value = "/getPdjd")
public Result<Map<String,String>> getPdjd(MaterialInfoEntity materialInfoEntity) {
if(StringUtils.isBlank(materialInfoEntity.getNuId())){
return Result.error("参数错误,请选择护理区域");
}
Map<String,String> pageList = invoicingApi.getPdjd(materialInfoEntity);
return Result.OK(pageList);
}
public static boolean toBoolean(Object obj) {
if (obj != null && !(Boolean) obj) {

View File

@ -156,4 +156,6 @@ public class MaterialInfoEntity implements Serializable {
private String xsdw;
private Double arrivalPrice;
private Double procurementPrice;
@Dict(dicCode = "pd_type")
private String pdType;
}

View File

@ -2,6 +2,7 @@ package com.nu.modules.employeesInfo.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.nu.entity.EmployeesInfoEntity;
@ -64,8 +65,9 @@ public class BizEmployeesInfoServiceImpl extends ServiceImpl<BizEmployeesInfoMap
@Override
public List<EmployeesInfoEntity> queryEmpList(EmployeesInfoEntity dto) {
LambdaQueryWrapper<BizEmployeesInfo> qw = new LambdaQueryWrapper<>();
qw.ne(StringUtils.isNotBlank(dto.getId()), BizEmployeesInfo::getId, dto.getId());
QueryWrapper<BizEmployeesInfo> qw = new QueryWrapper<>();
qw.notLike("name","nusys");
qw.ne(StringUtils.isNotBlank(dto.getId()), "id", dto.getId());
return BeanUtil.copyToList(baseMapper.selectList(qw), EmployeesInfoEntity.class);
}

View File

@ -113,4 +113,6 @@ public interface IInvoicingApi {
void editXsjg(WarehouseMaterialInfoEntity warehouseMaterialInfoEntity);
InvoicingPddInfoEntity generatedPddInfo(InvoicingPddInfoEntity invoicingPddInfoEntity);
Map<String, String> getPdjd(MaterialInfoEntity materialInfoEntity);
}

View File

@ -208,12 +208,51 @@
<select id="getCkWlList" resultType="com.nu.entity.MaterialInfoEntity">
select a.id,a.create_time,a.nu_id,a.kcsl,a.dd_no,a.xsjg,a.xsdw,a.wl_id,
b.category_id,b.type_id,b.material_name,b.pinyin,b.material_no,b.specification_model,b.material_img,
c.procurement_price,c.arrival_price,c.suppliers_id,c.suppliers_name,c.wl_units,c.brand_type,c.manufacturer,c.id as cgdInfoId,c.cgd_id
from nu_warehouse_material_info a
left join nu_config_material_info b on a.wl_id = b.id
left join nu_invoicing_cgd_info c on a.cgd_info_id = c.id and a.wl_id = c.wl_id
-- 步骤1给每个ck_id的记录按create_time降序编号
WITH LatestPdd AS (
SELECT
*,
-- 按ck_id分组create_time降序最新记录rn=1
ROW_NUMBER() OVER (PARTITION BY ck_id ORDER BY create_time DESC) AS rn
FROM nu_invoicing_pdd_info
-- 可选如果需要限制时间范围如只查当天的可加WHERE条件
WHERE DATE(create_time) = CURDATE()
)
-- 步骤2关联其他表只取rn=1的最新记录
SELECT
a.id,
a.create_time AS warehouse_create_time,
a.nu_id,
a.kcsl,
a.dd_no,
a.xsjg,
a.xsdw,
a.wl_id,
b.category_id,
b.type_id,
b.material_name,
b.pinyin,
b.material_no,
b.specification_model,
b.material_img,
c.procurement_price,
c.arrival_price,
c.suppliers_id,
c.suppliers_name,
c.wl_units,
c.brand_type,
c.manufacturer,
c.id AS cgdInfoId,
c.cgd_id,
d.pd_type, -- 最新记录的pd_type
d.create_time AS latest_pd_create_time -- 最新记录的创建时间
FROM nu_warehouse_material_info a
LEFT JOIN nu_config_material_info b ON a.wl_id = b.id
LEFT JOIN nu_invoicing_cgd_info c ON a.cgd_info_id = c.id AND a.wl_id = c.wl_id
LEFT JOIN LatestPdd d
ON a.id = d.ck_id -- 注意这里假设a.id = d.ck_id需要确认字段关联是否正确
AND d.rn = 1 -- 只取每个ck_id的最新记录rn=1
${ew.customSqlSegment}
</select>
</mapper>

View File

@ -1795,7 +1795,11 @@ public class NuInvoicingCgdMainServiceImpl extends ServiceImpl<NuInvoicingCgdMai
pddInfo.setPicPath(invoicingPddInfoEntity.getPicPath());
pddInfo.setCkId(invoicingPddInfoEntity.getCkId());
pddInfo.setContent(invoicingPddInfoEntity.getContent());
pddInfo.setPdType(invoicingPddInfoEntity.getPdType());
if(StringUtils.isBlank(invoicingPddInfoEntity.getPdType())){
pddInfo.setPdType("0");
}else {
pddInfo.setPdType(invoicingPddInfoEntity.getPdType());
}
pddInfoMapper.insert(pddInfo);
pddXlhInt++;
redisUtil.set("PDD"+qgdDate,pddXlhInt);
@ -1856,4 +1860,15 @@ public class NuInvoicingCgdMainServiceImpl extends ServiceImpl<NuInvoicingCgdMai
return pddInfoMapper.generatedPddInfo(invoicingPddInfoEntity);
}
@Override
public Map<String, String> getPdjd(MaterialInfoEntity materialInfoEntity) {
Map<String, String> map = new HashMap<>();
Long count = mterialInfoMapper.selectCount(new QueryWrapper<BlWarehouseMaterialInfo>().eq("nu_id", materialInfoEntity.getNuId()).gt("kcsl",0));
Long count1 = pddInfoMapper.getPdjd(materialInfoEntity);
map.put("totalNum",count.toString());
map.put("pdNum",count1.toString());
return map;
}
}

View File

@ -3,6 +3,7 @@ package com.nu.modules.pdd.mapper;
import java.util.List;
import com.nu.entity.InvoicingPddInfoEntity;
import com.nu.entity.MaterialInfoEntity;
import org.apache.ibatis.annotations.Param;
import com.nu.modules.pdd.entity.NuInvoicingPddInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
@ -24,4 +25,6 @@ public interface NuInvoicingPddInfoMapper extends BaseMapper<NuInvoicingPddInfo>
InvoicingPddInfoEntity getPddInfoById(@Param("params") InvoicingPddInfoEntity invoicingPddInfoEntity);
InvoicingPddInfoEntity generatedPddInfo(@Param("params") InvoicingPddInfoEntity invoicingPddInfoEntity);
Long getPdjd(@Param("params") MaterialInfoEntity materialInfoEntity);
}

View File

@ -48,4 +48,16 @@
left join nu_config_material_type e on b.type_id = e.id
where a.id = #{params.id}
</select>
<select id="getPdjd" resultType="java.lang.Long">
SELECT
count(DISTINCT ck_id) as num
FROM
nu_invoicing_pdd_info
WHERE
create_time LIKE concat( DATE_FORMAT( now(), '%Y-%m-%d' ), '%' )
and nu_id = #{params.nuId}
</select>
</mapper>