Commit ec70df2b by 李小惠

修改前端返回数据

parent 5f948795
...@@ -69,6 +69,8 @@ public class InventoryDto implements Serializable { ...@@ -69,6 +69,8 @@ public class InventoryDto implements Serializable {
*/ */
private String locationId ; private String locationId ;
private String locationName;
/** /**
* 价格 * 价格
*/ */
...@@ -91,7 +93,8 @@ public class InventoryDto implements Serializable { ...@@ -91,7 +93,8 @@ public class InventoryDto implements Serializable {
/** /**
* 组织机构id * 组织机构id
*/ */
private Long orgId; private String orgId;
private Long orgIdInt;
/** /**
* 组织机构 * 组织机构
*/ */
......
...@@ -92,4 +92,15 @@ public class OrderDto implements Serializable { ...@@ -92,4 +92,15 @@ public class OrderDto implements Serializable {
private String repairName; private String repairName;
private String destoryName; private String destoryName;
/**
* 附件地址
*/
private String attachmentLocation;
/**
* 归还人id,归还入库特有(相当于领用人)
*/
private String returnUserId;
private String returnUser;
} }
...@@ -139,7 +139,7 @@ public class UpdateOrderReq extends BaseRequest implements Serializable { ...@@ -139,7 +139,7 @@ public class UpdateOrderReq extends BaseRequest implements Serializable {
/** /**
* 调拨类型(2支拨,1价拨),调拨出入库才有 * 调拨类型(2支拨,1价拨),调拨出入库才有
*/ */
private Integer transferType; private Integer allocateType;
/** /**
* 归还人id,归还入库特有(相当于领用人) * 归还人id,归还入库特有(相当于领用人)
......
...@@ -94,6 +94,12 @@ public class InventoryController { ...@@ -94,6 +94,12 @@ public class InventoryController {
return ApiRes.success(inventorySummaryService.getEquipmentInfo(req)); return ApiRes.success(inventorySummaryService.getEquipmentInfo(req));
} }
@PostMapping("/getOne")
@ApiOperation("获取单个库存的数量")
public ApiRes<InventorySummary> getOne(@RequestBody InventorySumReq req){
return ApiRes.success(inventorySummaryService.getOne(req));
}
//根据组织机构id/单警柜id/仓库id查询出库存汇总数量以及金额(和getEquipmentInfo同时调用,汇总出符合查询条件的装备) //根据组织机构id/单警柜id/仓库id查询出库存汇总数量以及金额(和getEquipmentInfo同时调用,汇总出符合查询条件的装备)
...@@ -239,5 +245,12 @@ public class InventoryController { ...@@ -239,5 +245,12 @@ public class InventoryController {
return ApiRes.success(inventoryService.checkEPCList(req)); return ApiRes.success(inventoryService.checkEPCList(req));
} }
//调用存储过程将汇总信息进行插入
@PostMapping("/insertToSummary")
@ApiOperation("将汇总信息进行插入")
public ApiRes<Boolean> insertToSummary(){
return ApiRes.success(inventorySummaryService.insertToSummary());
}
} }
...@@ -133,6 +133,14 @@ public class InventorySummary implements Serializable { ...@@ -133,6 +133,14 @@ public class InventorySummary implements Serializable {
@TableField("destruction_number") @TableField("destruction_number")
private Integer destructionNumber; private Integer destructionNumber;
/**
* 销毁金额
*/
@ApiModelProperty(value = "销毁金额")
@TableField("destruction_price")
private BigDecimal destructionPrice;
/** /**
* 过质保数量 * 过质保数量
*/ */
......
...@@ -20,7 +20,7 @@ public class OrderMain implements Serializable { ...@@ -20,7 +20,7 @@ public class OrderMain implements Serializable {
@TableField("order_type") @TableField("order_type")
private String orderType; private String orderType;
@TableField("process_id") @TableField(value = "process_id",updateStrategy = FieldStrategy.IGNORED)
private String processId; private String processId;
@TableField("bussiness_type") @TableField("bussiness_type")
......
...@@ -81,7 +81,7 @@ import java.util.stream.Collectors; ...@@ -81,7 +81,7 @@ import java.util.stream.Collectors;
String Type= orderType.get(0).getValue().toString(); String Type= orderType.get(0).getValue().toString();
if (Type.equals("workOrder"))//出入库单据 if (Type.equals("workOrder") || Type.equals("quickOrder"))//出入库单据(包含快速移库出库单)
{ {
// OrderMainReq req=new OrderMainReq(); // OrderMainReq req=new OrderMainReq();
// req.setProcessId(processInstanceId); // req.setProcessId(processInstanceId);
...@@ -122,21 +122,7 @@ import java.util.stream.Collectors; ...@@ -122,21 +122,7 @@ import java.util.stream.Collectors;
if (Type.equals("stocktakeOrder")){//盘库申请单 if (Type.equals("stocktakeOrder")){//盘库申请单
} }
if (Type.equals("quickOrder")){
OrderMain existOrder= orderMainService.getOne(new LambdaQueryWrapper<OrderMain>()
.eq(OrderMain::getProcessId, processInstanceId));
existOrder.setExamineState("finished");
existOrder.setOrderState("ready");
orderMainService.updateById(existOrder);
//创建快速出库单并且通过快速出库单再去创建入库单(主单)
boolean b = orderMainService.addQuickOrder(existOrder);
if (!b){
throw new ServiceException(OrderExceptionEnum.ORDER_CREATE_ERROR);
}
}
} }
} }
......
...@@ -64,4 +64,7 @@ public interface InventoryMapper extends BaseMapper<Inventory> { ...@@ -64,4 +64,7 @@ public interface InventoryMapper extends BaseMapper<Inventory> {
//根据条件查询满足条件的数据(用于快速移库修改装备仓库id) //根据条件查询满足条件的数据(用于快速移库修改装备仓库id)
List<Inventory> selectEqsByItem(@Param("list") List<Object[]> searchCriteria); List<Inventory> selectEqsByItem(@Param("list") List<Object[]> searchCriteria);
//根据epc获取装备信息
List<InventoryDto> GetInvInfoByEpc(@Param("list") List<String> epcList);
} }
\ No newline at end of file
...@@ -45,4 +45,6 @@ public interface InventorySummaryMapper extends BaseMapper<InventorySummary> { ...@@ -45,4 +45,6 @@ public interface InventorySummaryMapper extends BaseMapper<InventorySummary> {
List<TjOrgEqsDto> test(@Param("req") InventoryReq req); List<TjOrgEqsDto> test(@Param("req") InventoryReq req);
List<TjOrgEqsDto> selectDynamicView(); List<TjOrgEqsDto> selectDynamicView();
void insertToSummary(@Param("summaryTableName") String summaryTableName,@Param("sourceTableName") String sourceTableName, @Param("warrantyThreshold") Integer warrantyThreshold);
} }
\ No newline at end of file
...@@ -22,6 +22,8 @@ public interface InventorySummaryService extends IService<InventorySummary> { ...@@ -22,6 +22,8 @@ public interface InventorySummaryService extends IService<InventorySummary> {
//根据条件查询装备汇总信息,用于出库单的选择装备 //根据条件查询装备汇总信息,用于出库单的选择装备
List<InventorySumDto> GetInventorySumInfo(InventorySumReq req); List<InventorySumDto> GetInventorySumInfo(InventorySumReq req);
InventorySummary getOne(InventorySumReq req);
//对summary表中数据进行重新计算装备信息汇总 //对summary表中数据进行重新计算装备信息汇总
Boolean updateSummaryInsByOrder(Long orgId); Boolean updateSummaryInsByOrder(Long orgId);
...@@ -37,4 +39,6 @@ public interface InventorySummaryService extends IService<InventorySummary> { ...@@ -37,4 +39,6 @@ public interface InventorySummaryService extends IService<InventorySummary> {
//出入库时无单据查询库存汇总并统计更新或者记账时根据单据查询库存汇总并统计更新 //出入库时无单据查询库存汇总并统计更新或者记账时根据单据查询库存汇总并统计更新
List<InventorySummary> selectSumByItems(List<Object[]> searchCriteria); List<InventorySummary> selectSumByItems(List<Object[]> searchCriteria);
boolean insertToSummary();
} }
...@@ -194,22 +194,8 @@ public class InventoryServiceImpl extends ServiceImpl<InventoryMapper, Inventory ...@@ -194,22 +194,8 @@ public class InventoryServiceImpl extends ServiceImpl<InventoryMapper, Inventory
if (epcList.size()==0){ if (epcList.size()==0){
throw new ServiceException(CabinetExceptionEnum.PARAMETER_ERROR); throw new ServiceException(CabinetExceptionEnum.PARAMETER_ERROR);
} }
List<InventoryDto> inventoryDtoList=new ArrayList<>(); List<InventoryDto> inventoryDtoList=inventoryMapper.GetInvInfoByEpc(epcList);
List<Inventory> inventoryList = list(new LambdaQueryWrapper<Inventory>().in(Inventory::getEpc, epcList));
for (Inventory inventory:inventoryList) {
InventoryDto inventoryDto = new InventoryDto();
BeanPlusUtil.copyProperties(inventory, inventoryDto);
//设置型号名称,类别名称,供应商名称
String sizeName = equipmentSizeService.getById(inventory.getSizeId()).getName();
String typeName = equipmentTypeService.getById(inventory.getTypeId()).getName();
if (inventory.getSupplierId() != null) {
String supplierName = supplierService.getById(inventory.getSupplierId()).getName();
inventoryDto.setSupplierName(supplierName);
}
inventoryDto.setSizeName(sizeName);
inventoryDto.setTypeName(typeName);
inventoryDtoList.add(inventoryDto);
}
return inventoryDtoList; return inventoryDtoList;
} }
......
...@@ -93,6 +93,7 @@ public class InventorySummaryServiceImpl extends ServiceImpl<InventorySummaryMa ...@@ -93,6 +93,7 @@ public class InventorySummaryServiceImpl extends ServiceImpl<InventorySummaryMa
return o1.getTypeId().compareTo(o2.getTypeId()); return o1.getTypeId().compareTo(o2.getTypeId());
} }
}); });
Page<InventorySummary> page1 = PageFactory.getDefaultPage(req.getPageNo(), req.getPageSize()); Page<InventorySummary> page1 = PageFactory.getDefaultPage(req.getPageNo(), req.getPageSize());
page1.setRecords(list); page1.setRecords(list);
page1.setTotal(size); page1.setTotal(size);
...@@ -109,7 +110,17 @@ public class InventorySummaryServiceImpl extends ServiceImpl<InventorySummaryMa ...@@ -109,7 +110,17 @@ public class InventorySummaryServiceImpl extends ServiceImpl<InventorySummaryMa
return inventorySummaryMapper.GetInventorySumInfo(req); return inventorySummaryMapper.GetInventorySumInfo(req);
} }
@Override
public InventorySummary getOne(InventorySumReq req) {
LambdaQueryWrapper<InventorySummary> eq = new LambdaQueryWrapper<InventorySummary>()
.eq(ObjectUtil.isNotEmpty(req.getOrgId()), InventorySummary::getOrgId, req.getOrgId())
.eq(ObjectUtil.isNotEmpty(req.getLocationId()), InventorySummary::getLocationId, req.getLocationId())
.eq(ObjectUtil.isNotEmpty(req.getTypeId()), InventorySummary::getTypeId, req.getTypeId())
.eq(ObjectUtil.isNotEmpty(req.getSizeId()), InventorySummary::getSizeId, req.getSizeId())
.eq(ObjectUtil.isNotEmpty(req.getUnitPrice()), InventorySummary::getUnitPrice, req.getUnitPrice());
InventorySummary one = getOne(eq);
return one;
}
//对summary表中数据进行重新计算装备信息汇总 //对summary表中数据进行重新计算装备信息汇总
...@@ -229,6 +240,14 @@ public class InventorySummaryServiceImpl extends ServiceImpl<InventorySummaryMa ...@@ -229,6 +240,14 @@ public class InventorySummaryServiceImpl extends ServiceImpl<InventorySummaryMa
return inventorySummaryMapper.selectSumByItems(searchCriteria); return inventorySummaryMapper.selectSumByItems(searchCriteria);
} }
@Override
public boolean insertToSummary() {
String summaryTableName="base_inventory_summary";
String sourceTableName="base_inventory";
Integer warrantyThreshold=15;
inventorySummaryMapper.insertToSummary(summaryTableName,sourceTableName,warrantyThreshold);
return true;
}
private LambdaQueryWrapper<InventorySummary> createWrapper(InventorySumReq req) { private LambdaQueryWrapper<InventorySummary> createWrapper(InventorySumReq req) {
......
...@@ -34,7 +34,7 @@ import java.util.Map; ...@@ -34,7 +34,7 @@ import java.util.Map;
/** /**
* @Author: Zhaojw * @Author: Zhaojw
* @Description: 过期物资消息提醒 * @Description: 过期物资消息提醒(过质保期数量的消息提醒)
* @DateTime: 2023/7/14 16:25 * @DateTime: 2023/7/14 16:25
* @Params: * @Params:
* @Return * @Return
...@@ -62,6 +62,7 @@ public class InvExpireMsg implements JobAction { ...@@ -62,6 +62,7 @@ public class InvExpireMsg implements JobAction {
//所有待判断的物资 //所有待判断的物资
wrapper.eq( Inventory::getTermState, 0); wrapper.eq( Inventory::getTermState, 0);
//获取未超期的物资数量 //获取未超期的物资数量
long termCount= inventoryService.count(wrapper); long termCount= inventoryService.count(wrapper);
List<Inventory> list=new ArrayList<>(); List<Inventory> list=new ArrayList<>();
......
...@@ -474,6 +474,32 @@ ...@@ -474,6 +474,32 @@
) )
</foreach> </foreach>
</select> </select>
<select id="GetInvInfoByEpc" resultType="com.junmp.jyzb.api.bean.dto.InventoryDto">
SELECT bi.*, po.org_name, es.name, et.name, bs.name, bw.name
FROM base_inventory bi
JOIN pub_org po ON po.org_id = bi.org_id_int
JOIN base_equipment_size es ON es.id = bi.size_id
JOIN base_equipment_type et ON et.id = bi.type_id
JOIN base_supplier bs ON bs.id = bi.supplier_id
JOIN base_warehouse bw ON bw.id = bi.location_id
WHERE bi.location_type = 0 AND epc IN
<foreach collection="list" item="item" open="(" separator="," close=")">
#{item}
</foreach>
UNION ALL
SELECT bi.*, po.org_name, es.name, et.name, bs.name, bc.name
FROM base_inventory bi
JOIN pub_org po ON po.org_id = bi.org_id_int
JOIN base_equipment_size es ON es.id = bi.size_id
JOIN base_equipment_type et ON et.id = bi.type_id
JOIN base_supplier bs ON bs.id = bi.supplier_id
JOIN base_cabinet_box bcb ON bcb.id = bi.location_id
JOIN base_cabinet bc ON bc.id = bcb.cabinet_id
WHERE bi.location_type = 1 AND epc IN
<foreach collection="list" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -268,7 +268,7 @@ ...@@ -268,7 +268,7 @@
select * from base_inventory_summary where select * from base_inventory_summary where
<foreach collection="list" item="item" separator="or"> <foreach collection="list" item="item" separator="or">
( (
org_id_int = ${item[0]} AND location_id = '${item[1]}' AND type_id = ${item[3]} AND size_id = '${item[2]}' AND unit_price = ${item[4]} org_id_int = ${item[0]} AND location_id = '${item[1]}' AND type_id = ${item[2]} AND size_id = '${item[3]}' AND unit_price = ${item[4]}
) )
</foreach> </foreach>
</select> </select>
...@@ -368,6 +368,13 @@ ...@@ -368,6 +368,13 @@
GROUP BY type_id,size_id,bi.org_id_int,location_id,bi.price) as t GROUP BY type_id,size_id,bi.org_id_int,location_id,bi.price) as t
GROUP BY t.locationId,t.type_id,t.size_id,t.orgId,t.unitPrice GROUP BY t.locationId,t.type_id,t.size_id,t.orgId,t.unitPrice
</insert> </insert>
<insert id="insertToSummary" statementType="CALLABLE">
{call InsertInventorySummary(
#{summaryTableName, mode=IN},
#{sourceTableName, mode=IN},
#{warrantyThreshold, mode=IN, jdbcType=INTEGER}
)}
</insert>
</mapper> </mapper>
\ No newline at end of file
...@@ -165,7 +165,7 @@ public class FlowInstanceServiceImpl extends FlowServiceFactory implements IFlow ...@@ -165,7 +165,7 @@ public class FlowInstanceServiceImpl extends FlowServiceFactory implements IFlow
Object skip = runtimeService.getVariable(processInstance.getId(), "skip"); Object skip = runtimeService.getVariable(processInstance.getId(), "skip");
if (ObjectUtils.isNotEmpty(skip) && BooleanUtils.toBoolean(skip.toString())){ if (ObjectUtils.isNotEmpty(skip) && BooleanUtils.toBoolean(skip.toString())){
return "TG"+processInstance.getId(); return "skip"+processInstance.getId();
} }
else else
{ {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论