Commit af39161a by 赵剑炜

修改盘点功能

parent b413bd27
......@@ -9,7 +9,7 @@ import java.util.List;
@Data
public class BussinessInventoryDto implements Serializable {
private String rules;
private String totalNum;
private String actualNum;
private String addNum;
......
package com.junmp.jyzb.api.bean.dto.TempDto;
import lombok.Data;
import java.io.Serializable;
@Data
public class TypeSizeDto implements Serializable {
private String sizeId;
private String typeName;
private String sizeName;
}
......@@ -21,10 +21,9 @@ public class QueryEquipmentTypeReq {
private String typeName;
private String nickName;
private Date updateTime;
/**
* 是否需要添加组织机构返回
*/
private Boolean flag;
private String name;
private String typeIds;
private String sizeIds;
}
......@@ -3,6 +3,7 @@ package com.junmp.jyzb.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.junmp.jyzb.api.bean.dto.EquipmentTypeDto;
import com.junmp.jyzb.api.bean.dto.FetchingDataDto.TypeDto;
import com.junmp.jyzb.api.bean.dto.TempDto.TypeSizeDto;
import com.junmp.jyzb.api.bean.query.QueryEquipmentTypeReq;
import com.junmp.jyzb.api.bean.req.UpdateEquipmentTypeReq;
import com.junmp.jyzb.entity.EquipmentType;
......@@ -24,6 +25,7 @@ public interface EquipmentTypeMapper extends BaseMapper<EquipmentType> {
@Param("list2") List<String> list2,
@Param("list3") List<String> list3,
@Param("list4") List<String> list4);
List<TypeSizeDto> GetNameBySizeIds(@Param("sizeIds") List<String> sizeIds);
List<TypeDto> alignTypeInfo(@Param("date") String date);
}
\ No newline at end of file
......@@ -19,6 +19,10 @@ public interface EquipmentTypeService extends IService<EquipmentType> {
Object addEs();
String addEquipment(UpdateEquipmentTypeReq req );
String GetEquipmentByIds(QueryEquipmentTypeReq req );
String GetEquipmentBySizeIds(QueryEquipmentTypeReq req );
Boolean deleteEquipment(UpdateEquipmentTypeReq req);
Boolean updateEquipment(UpdateEquipmentTypeReq msg);
Boolean changeEquipmentState(UpdateEquipmentTypeReq req);
......
......@@ -13,6 +13,7 @@ import com.junmp.junmpProcess.service.IFlowInstanceService;
import com.junmp.jyzb.api.bean.dto.*;
import com.junmp.jyzb.api.bean.query.BussinessInventoryReq;
import com.junmp.jyzb.api.bean.query.InventorySumReq;
import com.junmp.jyzb.api.bean.query.QueryEquipmentTypeReq;
import com.junmp.jyzb.api.bean.req.UpdateDetailReq;
import com.junmp.jyzb.api.bean.req.UpdateInventoryReq;
import com.junmp.jyzb.api.bean.req.UploadInventoryReq;
......@@ -79,6 +80,8 @@ public class BussinessInventoryServiceImpl extends ServiceImpl<BussinessInventor
@Resource
private InventoryService inventoryService;
@Resource
private EquipmentTypeService equipmentTypeService;
@Resource
private InventoryMapper inventoryMapper;
......@@ -271,17 +274,27 @@ public class BussinessInventoryServiceImpl extends ServiceImpl<BussinessInventor
sumreq.setLocationType("0");
sumreq.setLocationId(warehouseId);
BussinessInventoryDto BIDto=new BussinessInventoryDto();
String rules="盘点规则-";
if (type.equals("1"))//按装备类型盘点
{
List<String> typeIds = Arrays.asList(inventory.getRules().split(","));
sumreq.setTypeIds(typeIds);
QueryEquipmentTypeReq typeReq=new QueryEquipmentTypeReq();
typeReq.setTypeIds(inventory.getRules());
String types= equipmentTypeService.GetEquipmentByIds(typeReq);
rules=rules+"类别盘点:"+types;
} else if (type.equals("2"))//按装备号型盘点
{
QueryEquipmentTypeReq typeReq=new QueryEquipmentTypeReq();
List<String> sizeIds = Arrays.asList(inventory.getRules().split(","));
sumreq.setSizeIds(sizeIds);
}
typeReq.setSizeIds(inventory.getRules());
String sizes= equipmentTypeService.GetEquipmentBySizeIds(typeReq);
rules=rules+"类别及号型盘点:"+sizes;
}
BIDto.setRules(rules);
List<EquipmentListDto> eqList = new ArrayList<>();
Integer totalNumber = 0;
......@@ -289,7 +302,6 @@ public class BussinessInventoryServiceImpl extends ServiceImpl<BussinessInventor
Map<String, EquipmentListDto> processedData = new HashMap<>();
List<InventorySummary> SumResult = inventorySummaryService.getEquipmentInfoList(sumreq);
for (InventorySummary summary : SumResult) {
String key = summary.getSizeId() + "-" + summary.getTypeId();
......@@ -632,7 +644,7 @@ public class BussinessInventoryServiceImpl extends ServiceImpl<BussinessInventor
for (BussinessDetail bdList :bussinessDetail) {
InventorySummary InsertSum=new InventorySummary();
InsertSum.setValuekey(org.getOrgCode()+BI.getWarehouseId()+bdList.getTypeId()+bdList.getSizeId()+bdList.getPrice()+"0");
InsertSum.setNumber(bdList.getNum());
InsertSum.setNumber(bdList.getFixNumber());
InsertSum.setOrgId(BI.getOrgId());
InsertSum.setOrgName(BI.getOrgName());
InsertSum.setOrgCode(org.getOrgCode());
......@@ -645,7 +657,7 @@ public class BussinessInventoryServiceImpl extends ServiceImpl<BussinessInventor
InsertSum.setLocationName(BI.getWarehouseName());
InsertSum.setUnitPrice(bdList.getPrice());
InsertSum.setPrice(bdList.getStockPrice());
InsertSum.setStockNumber(bdList.getStockNumber());
InsertSum.setStockNumber(bdList.getFixNumber());
InsertSum.setStockNumberPrice(bdList.getStockPrice());
InsertSum.setOutboundNumber(0);
InsertSum.setOutboundNumberPrice(BigDecimal.valueOf(0));
......@@ -655,6 +667,9 @@ public class BussinessInventoryServiceImpl extends ServiceImpl<BussinessInventor
InsertSum.setExpireNumberPrice(BigDecimal.valueOf(0));
InsertSum.setBrokenNumber(0);
InsertSum.setBrokenNumberPrice(BigDecimal.valueOf(0));
InsertSum.setProperty(0);
InsertSum.setUpdateTime(DateTimeUtil.getCurrentDateTime());
InsertSum.setCreateTime(DateTimeUtil.getCurrentDateTime());
InsertSumResult.add(InsertSum);
}
}
......@@ -851,7 +866,7 @@ public class BussinessInventoryServiceImpl extends ServiceImpl<BussinessInventor
}
if (InsertSumResult.size()>0)
{
inventorySummaryService.saveBatch(SumResult);
inventorySummaryService.saveBatch(InsertSumResult);
}
//入库添加虚拟装备
if (CollectionUtil.isNotEmpty(addInvList)){
......
......@@ -10,6 +10,7 @@ import com.junmp.jyzb.Repository.TypeRepository;
import com.junmp.jyzb.api.bean.dto.*;
import com.junmp.jyzb.api.bean.dto.FetchingDataDto.SizeDto;
import com.junmp.jyzb.api.bean.dto.FetchingDataDto.TypeDto;
import com.junmp.jyzb.api.bean.dto.TempDto.TypeSizeDto;
import com.junmp.jyzb.api.bean.query.QueryEquipmentTypeReq;
import com.junmp.jyzb.api.bean.req.UpdateEquipmentTypeReq;
import com.junmp.jyzb.api.exception.JYZBAppException;
......@@ -162,8 +163,29 @@ public class EquipmentTypeServiceImpl extends ServiceImpl<EquipmentTypeMapper, E
}
@Override
public String GetEquipmentByIds(QueryEquipmentTypeReq req) {
List<String> typeIds = Arrays.asList(req.getTypeIds().split(","));
List<EquipmentType> list = list(new LambdaQueryWrapper<EquipmentType>()
.and(qw -> typeIds.forEach(typeId -> qw.or().eq(EquipmentType::getId, typeId))));
list.forEach(p->p.getName());
String concatenatedNames = list.stream()
.map(EquipmentType::getName) // 获取每个 EquipmentType 的 name 属性
.collect(Collectors.joining(",")); // 使用逗号拼接所有的 name
return concatenatedNames;
}
@Override
public String GetEquipmentBySizeIds(QueryEquipmentTypeReq req) {
List<String> sizeIds = Arrays.asList(req.getSizeIds().split(","));
List<TypeSizeDto> sizeList= equipmentTypeMapper.GetNameBySizeIds(sizeIds);
String concatenatedNames = sizeList.stream()
.map(dto -> dto.getTypeName() + "-" + dto.getSizeName()) // 获取每个 EquipmentType 的 name 属性
.collect(Collectors.joining(",")); // 使用逗号拼接所有的 name
return concatenatedNames;
}
@Override
public Boolean deleteEquipment(UpdateEquipmentTypeReq req) {
LambdaQueryWrapper<EquipmentType> wrapper = new LambdaQueryWrapper<>();
......
......@@ -44,6 +44,17 @@
SET t1.parent_ids = t2.parent_ids
WHERE t1.parent_id IS NOT NULL;
</update>
<select id="GetNameBySizeIds" resultType="com.junmp.jyzb.api.bean.dto.TempDto.TypeSizeDto">
SELECT bes.id as size_id, bet.`name` as typeName,bes.`name` as sizeName
FROM base_equipment_type bet join `base_equipment_size` bes
on bet.id=bes.type_id
where bes.id in
<foreach collection="sizeIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</select>
<select id="selectByItems" resultType="java.lang.String">
SELECT DISTINCT t4.id, t4.parent_id
FROM base_equipment_type t1
......
......@@ -816,39 +816,6 @@
LEFT JOIN base_supplier bs ON bs.id = i.supplier_id
WHERE wi.org_id=#{req.orgId} and wi.type_id=#{req.typeId} and i.state !="destory"
-- SELECT //修改后应该按照这个来
-- wi.type_id,
-- wi.size_id,
-- wi.shelf_id,
-- wi.shelf_location,
-- wi.epc,
-- wi.org_id,
-- wi.location_state,
-- wi.location_type,
-- wi.location_id,
-- i.id,
-- i.supplier_id,
-- i.price,
-- i.state,
-- i.bussiness_state,
-- i.production_date,
-- i.warranty_period,
-- i.maintenance_period,
-- i.term_state,
-- i.property,
-- i.area_id,
-- wi.type_name AS type_name,
-- wi.size_name AS size_name,
-- wi.org_name AS org_name,
-- bs.NAME AS supplier_name,
-- wi.location_name AS location_name
-- FROM
-- base_warehouse_inventory wi
-- LEFT JOIN base_inventory i ON i.epc = wi.epc
-- LEFT JOIN base_supplier bs ON bs.id = i.supplier_id
<if test="req.locationType !='all' and req.locationType != null">
and wi.location_type=#{req.locationType}
</if>
......
......@@ -33,7 +33,7 @@ spring:
virtual-host: /
profiles:
#@spring.active@
active: prod
active: local
servlet:
multipart:
max-request-size: 500MB
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论