修改bug

This commit is contained in:
yangjun 2025-11-17 14:39:11 +08:00
parent 8231629e3f
commit 3cc2210d25
7 changed files with 84 additions and 11 deletions

View File

@ -108,6 +108,16 @@ public class CgdInfoEntity implements Serializable {
private String jhType;//0拣货 1销账
private BigDecimal totalPrice;
@TableField(exist = false)
private java.lang.String categoryName;
@TableField(exist = false)
private java.lang.String typeName;
@TableField(exist = false)
private java.lang.String medicationName;
// 格式化getter方法
public String getProcurementPrice() {

View File

@ -14,9 +14,9 @@
b.id as type_id,
c.id as medication_id
from nu_config_material_category a
LEFT JOIN nu_config_material_type b on a.id = b.category_id and b.iz_enabled = 0 and b.del_flag = 0
LEFT JOIN nu_config_material_medication c on b.id = c.type_id and c.iz_enabled = 0 and c.del_flag = 0
where a.iz_enabled = 0 and a.del_flag = 0
LEFT JOIN nu_config_material_type b on a.id = b.category_id and b.iz_enabled = 'Y' and b.del_flag = 0
LEFT JOIN nu_config_material_medication c on b.id = c.type_id and c.iz_enabled = 'Y' and c.del_flag = 0
where a.iz_enabled = 'Y' and a.del_flag = 0
order by a.sort asc,b.id asc,c.id asc ) a
${ew.customSqlSegment}
</select>
@ -31,7 +31,7 @@
<select id="getWarehouseInfoList" resultType="com.nu.modules.ConfigMaterial.entity.ConfigMaterialCategory">
select b.category_id,b.type_id,b.medication_id from nu_warehouse_material_info a
left join nu_config_material_info b on a.wl_id = b.id
where a.nu_id = #{params.nuId} and a.del_flag = 0 and a.iz_enabled = 0 GROUP BY b.category_id,b.type_id,b.medication_id
where a.nu_id = #{params.nuId} and a.del_flag = 0 and a.iz_enabled = 'Y' GROUP BY b.category_id,b.type_id,b.medication_id
</select>
<select id="getCgdMaterialTreeData" resultType="com.nu.modules.ConfigMaterial.entity.ConfigMaterialCategory">
@ -53,7 +53,7 @@
<select id="getWaringMaterialTreeData" resultType="com.nu.modules.ConfigMaterial.entity.ConfigMaterialCategory">
select b.category_id,b.type_id,b.medication_id from nu_warehouse_material_info c ,nu_config_material_info b
where b.id = c.wl_id and c.del_flag = 0 and c.iz_enabled = 0
where b.id = c.wl_id and c.del_flag = 0 and c.iz_enabled = 'Y'
and c.kcsl - 0 &lt;= b.lower_limit
<if test="params.nuId != null and params.nuId != ''">
and c.nu_id = #{params.nuId}

View File

@ -151,6 +151,13 @@ public class NuInvoicingCgdInfo implements Serializable {
@TableField(exist = false)
private BigDecimal totalPrice;
@TableField(exist = false)
private java.lang.String categoryName;
@TableField(exist = false)
private java.lang.String typeName;
@TableField(exist = false)
private java.lang.String medicationName;
// // 格式化getter方法
// public BigDecimal getProcurementPrice() {

View File

@ -231,7 +231,8 @@ public class NuInvoicingCgdMainServiceImpl extends ServiceImpl<NuInvoicingCgdMai
List<QgdInfo> infoList = entry.getValue();//请购的物料列表
ConfigSuppliersInfo ConfigSuppliersInfo = gysMapper.selectById(suppliersId);
String cgdNo = sysUser.getOrgCode() + new SimpleDateFormat("yyyyMMdd").format(new Date()) + String.format("%03d", qgdXlhInt);
String cgdNo = new SimpleDateFormat("yyyyMMdd").format(new Date()) + String.format("%03d", qgdXlhInt);
cgdNo = sysUser.getOrgCode() + cgdNo;
//生产采购单主表
NuInvoicingCgdMain cgdMain = new NuInvoicingCgdMain();
@ -245,7 +246,6 @@ public class NuInvoicingCgdMainServiceImpl extends ServiceImpl<NuInvoicingCgdMai
cgdMain.setStatus("0");//待入库
cgdMain.setCgdType("0");//待入库
cgdMain.setGysName(ConfigSuppliersInfo.getSuppliersName());
// cgdMainMapper.insert(cgdMain);
List<NuInvoicingCgdInfo> cgdInfoList = new ArrayList<>();
BigDecimal totalPrice = new BigDecimal(0);
String qgdId = "";
@ -254,9 +254,9 @@ public class NuInvoicingCgdMainServiceImpl extends ServiceImpl<NuInvoicingCgdMai
qgdId = qgdId + params.getId() + ",";
NuInvoicingCgdInfo cgdInfo = new NuInvoicingCgdInfo();
QueryWrapper<BlWarehouseMaterialInfo> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("wl_id",params.getWlId());
queryWrapper.eq("nu_id",params.getNuId());
List<BlWarehouseMaterialInfo> wlList = mterialInfoMapper.selectList(queryWrapper);
queryWrapper.eq("a.wl_id",params.getWlId());
queryWrapper.eq("a.nu_id",params.getNuId());
List<BlWarehouseMaterialInfo> wlList = mterialInfoMapper.wlInfo(queryWrapper);
BlWarehouseMaterialInfo wlInfo = new BlWarehouseMaterialInfo();
if(wlList.size()>0){
wlInfo = wlList.get(0);
@ -284,12 +284,14 @@ public class NuInvoicingCgdMainServiceImpl extends ServiceImpl<NuInvoicingCgdMai
cgdInfo.setTypeId(wlInfo.getTypeId());
cgdInfo.setMedicationId(wlInfo.getMedicationId());
cgdInfo.setDhbl(params.getDhbl());
cgdInfo.setCategoryName(wlInfo.getCategoryName());
cgdInfo.setTypeName(wlInfo.getTypeName());
cgdInfo.setMedicationName(wlInfo.getMedicationName());
BigDecimal sl = new BigDecimal(params.getPurchaseQuantity());
BigDecimal dj = params.getReferenceUnitPrice();
BigDecimal wlzj = sl.multiply(dj);
cgdInfo.setTotalPrice(wlzj);
totalPrice = totalPrice.add(wlzj);
// cgdInfoMapper.insert(cgdInfo);
cgdInfoList.add(cgdInfo);
}
cgdMain.setQgdId(qgdId);

View File

@ -186,4 +186,12 @@ public class BlWarehouseMaterialInfo implements Serializable {
private java.lang.String wlParamInfo;//查询物料信息参数可多个查询
@TableField(exist = false)
private java.lang.String isAdd;//是否在购物车中添加 0否 1是
@TableField(exist = false)
private java.lang.String categoryName;
@TableField(exist = false)
private java.lang.String typeName;
@TableField(exist = false)
private java.lang.String medicationName;
}

View File

@ -3,8 +3,10 @@ package com.nu.modules.warehouseMaterialInfo.mapper;
import java.util.List;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.nu.entity.MaterialInfoEntity;
import net.sf.jsqlparser.expression.operators.arithmetic.Concat;
import org.apache.ibatis.annotations.Param;
import com.nu.modules.warehouseMaterialInfo.entity.BlWarehouseMaterialInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
@ -27,4 +29,6 @@ public interface BlWarehouseMaterialInfoMapper extends BaseMapper<BlWarehouseMat
void deleteBatch(@Param("ids") String ids);
void deleteAllWuliao(@Param("nuId") String nuId);
List<BlWarehouseMaterialInfo> wlInfo(@Param(Constants.WRAPPER) QueryWrapper<BlWarehouseMaterialInfo> queryWrapper);
}

View File

@ -40,6 +40,48 @@
</select>
<select id="wlInfo" resultType="com.nu.modules.warehouseMaterialInfo.entity.BlWarehouseMaterialInfo">
select
a.*,
b.category_id,
b.type_id,
b.medication_id,
b.material_name,
b.pinyin,
b.material_no,
b.specification_model,
b.suppliers,
b.material_units,
b.multi_unit_switch,
b.one_unit,
b.one_unit_proportion,
b.one_unit_price,
b.two_unit,
b.two_unit_proportion,
b.two_unit_price,
b.multi_unit_type,
b.upper_limit,
b.lower_limit,
b.tag_type,
b.sales_unit_price,
b.reference_unit_price,
b.material_img,
c.item_text as tagName,
if(d.id is null, '0', '1') as isAdd,
category_name,
type_name,
medication_name
from nu_warehouse_material_info a
left join nu_config_material_info b on a.wl_id = b.id
left join nu_invoicing_qgd_info d on a.wl_id = d.wl_id
left join sys_dict_item c on b.tag_type = c.item_value and c.dict_id = '1978662656563613698'
left join nu_config_material_category e on b.category_id = e.id
left join nu_config_material_type f on b.type_id = f.id
left join nu_config_material_medication g on b.medication_id = g.id
${ew.customSqlSegment}
</select>
<select id="getRemainingList" resultType="com.nu.modules.warehouseMaterialInfo.entity.BlWarehouseMaterialInfo">
select id as wl_id from nu_config_material_info where id not in (select wl_id from nu_warehouse_material_info where del_flag = '0') and upper_limit is not null and lower_limit is not null and del_flag = '0' and iz_enabled = '0'
</select>