修改返回数据
This commit is contained in:
parent
6f5257adc9
commit
1ca997fd74
|
|
@ -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) {
|
public static boolean toBoolean(Object obj) {
|
||||||
if (obj != null && !(Boolean) obj) {
|
if (obj != null && !(Boolean) obj) {
|
||||||
|
|
|
||||||
|
|
@ -156,4 +156,6 @@ public class MaterialInfoEntity implements Serializable {
|
||||||
private String xsdw;
|
private String xsdw;
|
||||||
private Double arrivalPrice;
|
private Double arrivalPrice;
|
||||||
private Double procurementPrice;
|
private Double procurementPrice;
|
||||||
|
@Dict(dicCode = "pd_type")
|
||||||
|
private String pdType;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ package com.nu.modules.employeesInfo.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
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.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.nu.entity.EmployeesInfoEntity;
|
import com.nu.entity.EmployeesInfoEntity;
|
||||||
|
|
@ -64,8 +65,9 @@ public class BizEmployeesInfoServiceImpl extends ServiceImpl<BizEmployeesInfoMap
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<EmployeesInfoEntity> queryEmpList(EmployeesInfoEntity dto) {
|
public List<EmployeesInfoEntity> queryEmpList(EmployeesInfoEntity dto) {
|
||||||
LambdaQueryWrapper<BizEmployeesInfo> qw = new LambdaQueryWrapper<>();
|
QueryWrapper<BizEmployeesInfo> qw = new QueryWrapper<>();
|
||||||
qw.ne(StringUtils.isNotBlank(dto.getId()), BizEmployeesInfo::getId, dto.getId());
|
qw.notLike("name","nusys");
|
||||||
|
qw.ne(StringUtils.isNotBlank(dto.getId()), "id", dto.getId());
|
||||||
return BeanUtil.copyToList(baseMapper.selectList(qw), EmployeesInfoEntity.class);
|
return BeanUtil.copyToList(baseMapper.selectList(qw), EmployeesInfoEntity.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -113,4 +113,6 @@ public interface IInvoicingApi {
|
||||||
void editXsjg(WarehouseMaterialInfoEntity warehouseMaterialInfoEntity);
|
void editXsjg(WarehouseMaterialInfoEntity warehouseMaterialInfoEntity);
|
||||||
|
|
||||||
InvoicingPddInfoEntity generatedPddInfo(InvoicingPddInfoEntity invoicingPddInfoEntity);
|
InvoicingPddInfoEntity generatedPddInfo(InvoicingPddInfoEntity invoicingPddInfoEntity);
|
||||||
|
|
||||||
|
Map<String, String> getPdjd(MaterialInfoEntity materialInfoEntity);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -208,12 +208,51 @@
|
||||||
|
|
||||||
|
|
||||||
<select id="getCkWlList" resultType="com.nu.entity.MaterialInfoEntity">
|
<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,
|
-- 步骤1:给每个ck_id的记录按create_time降序编号
|
||||||
b.category_id,b.type_id,b.material_name,b.pinyin,b.material_no,b.specification_model,b.material_img,
|
WITH LatestPdd AS (
|
||||||
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
|
SELECT
|
||||||
from nu_warehouse_material_info a
|
*,
|
||||||
left join nu_config_material_info b on a.wl_id = b.id
|
-- 按ck_id分组,create_time降序,最新记录rn=1
|
||||||
left join nu_invoicing_cgd_info c on a.cgd_info_id = c.id and a.wl_id = c.wl_id
|
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}
|
${ew.customSqlSegment}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
|
|
@ -1795,7 +1795,11 @@ public class NuInvoicingCgdMainServiceImpl extends ServiceImpl<NuInvoicingCgdMai
|
||||||
pddInfo.setPicPath(invoicingPddInfoEntity.getPicPath());
|
pddInfo.setPicPath(invoicingPddInfoEntity.getPicPath());
|
||||||
pddInfo.setCkId(invoicingPddInfoEntity.getCkId());
|
pddInfo.setCkId(invoicingPddInfoEntity.getCkId());
|
||||||
pddInfo.setContent(invoicingPddInfoEntity.getContent());
|
pddInfo.setContent(invoicingPddInfoEntity.getContent());
|
||||||
pddInfo.setPdType(invoicingPddInfoEntity.getPdType());
|
if(StringUtils.isBlank(invoicingPddInfoEntity.getPdType())){
|
||||||
|
pddInfo.setPdType("0");
|
||||||
|
}else {
|
||||||
|
pddInfo.setPdType(invoicingPddInfoEntity.getPdType());
|
||||||
|
}
|
||||||
pddInfoMapper.insert(pddInfo);
|
pddInfoMapper.insert(pddInfo);
|
||||||
pddXlhInt++;
|
pddXlhInt++;
|
||||||
redisUtil.set("PDD"+qgdDate,pddXlhInt);
|
redisUtil.set("PDD"+qgdDate,pddXlhInt);
|
||||||
|
|
@ -1856,4 +1860,15 @@ public class NuInvoicingCgdMainServiceImpl extends ServiceImpl<NuInvoicingCgdMai
|
||||||
return pddInfoMapper.generatedPddInfo(invoicingPddInfoEntity);
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ package com.nu.modules.pdd.mapper;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.nu.entity.InvoicingPddInfoEntity;
|
import com.nu.entity.InvoicingPddInfoEntity;
|
||||||
|
import com.nu.entity.MaterialInfoEntity;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
import com.nu.modules.pdd.entity.NuInvoicingPddInfo;
|
import com.nu.modules.pdd.entity.NuInvoicingPddInfo;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
@ -24,4 +25,6 @@ public interface NuInvoicingPddInfoMapper extends BaseMapper<NuInvoicingPddInfo>
|
||||||
InvoicingPddInfoEntity getPddInfoById(@Param("params") InvoicingPddInfoEntity invoicingPddInfoEntity);
|
InvoicingPddInfoEntity getPddInfoById(@Param("params") InvoicingPddInfoEntity invoicingPddInfoEntity);
|
||||||
|
|
||||||
InvoicingPddInfoEntity generatedPddInfo(@Param("params") InvoicingPddInfoEntity invoicingPddInfoEntity);
|
InvoicingPddInfoEntity generatedPddInfo(@Param("params") InvoicingPddInfoEntity invoicingPddInfoEntity);
|
||||||
|
|
||||||
|
Long getPdjd(@Param("params") MaterialInfoEntity materialInfoEntity);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -48,4 +48,16 @@
|
||||||
left join nu_config_material_type e on b.type_id = e.id
|
left join nu_config_material_type e on b.type_id = e.id
|
||||||
where a.id = #{params.id}
|
where a.id = #{params.id}
|
||||||
</select>
|
</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>
|
</mapper>
|
||||||
Loading…
Reference in New Issue