Browse Source

fix: oracle分页查询sql

master
李永德 1 year ago
parent
commit
0a779f2b00
  1. 8
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java
  2. 15
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/WmsToMesService.java
  3. 4
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/dao/mapper/MesRequestMapper.java
  4. 17
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/dao/mapper/MesRequestMapper.xml
  5. 10
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/impl/WmsToMesServiceImpl.java
  6. 12
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/workorder/service/impl/PdmBdWorkorderServiceImpl.java

8
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java

@ -308,14 +308,6 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
// 分拣需要在这设置特殊值
// 校验是否够码满一托
boolean enoughCallEmpty = workorderService.isEnoughCallEmpty(param.getString("device_code"));
// PdmBdWorkorder workorder = workorderService.getDeviceDockingProductionTask(param.getString("device_code"));
// BigDecimal realQty = workorder.getReal_qty();
// BigDecimal planQty = workorder.getPlan_qty();
// if (realQty.compareTo(planQty) < 0) { // 还可以叫空盘
// torus = 0;
// } else {
// torus = 1;
// }
return enoughCallEmpty ? 0 : 1;
}
return torus;

15
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/WmsToMesService.java

@ -92,13 +92,6 @@ public interface WmsToMesService {
*/
void saveShelfInfoBatchToMes(MesShelfInfo shelfInfo);
/**
* 根据成品物料编码获取订单号
* @param materialId
* @return
*/
IPage<MesOrderInfo> selectPageMesOrder(IPage<MesOrderInfo> pages, String materialId);
/**
* 获取所有客户信息
* @return
@ -111,4 +104,12 @@ public interface WmsToMesService {
* @return
*/
CusterVo getCusterByNo(String custerNo);
/**
* 分页获取数据
* @param currentPage
* @param currentSize
* @return
*/
List<MesOrderInfo> selectPageMesOrder(int currentPage, int currentSize);
}

4
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/dao/mapper/MesRequestMapper.java

@ -61,9 +61,9 @@ public interface MesRequestMapper {
@DS("oracle")
void saveShelfInfoBatchToMes(MesShelfInfo shelfInfo);
@DS("oracle")
IPage<MesOrderInfo> findOrderInfoByMaterialId(IPage<MesOrderInfo> pages, String materialId);
@DS("oracle")
List<CusterVo> getCusterInfo();
@DS("oracle")
CusterVo getCusterByNo(String custerNo);
@DS("oracle")
List<MesOrderInfo> selectPageMesOrder(int currentPage, int currentSize);
}

17
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/dao/mapper/MesRequestMapper.xml

@ -281,13 +281,6 @@
LEFT JOIN sch_base_point p2 ON p2.point_code = vg.source_vehicle_code
WHERE p1.region_code = 'GTPHC'
</select>
<select id="findOrderInfoByMaterialId" resultType="org.nl.wms.ext.mes.service.dto.MesOrderInfo">
SELECT * FROM "RTMG"."VIEW_POP_ORDER_RESULT_LMS" vp
WHERE 1 = 1
<if test="materialId != null and materialId != ''">
AND vp.FMATERIAL_ID = #{materialId}
</if>
</select>
<select id="getCusterInfo" resultType="org.nl.wms.ext.mes.service.dto.CusterVo">
SELECT * FROM "RTMG"."VIEW_CUSTER_LMS"
</select>
@ -295,4 +288,14 @@
SELECT * FROM "RTMG"."VIEW_CUSTER_LMS"
WHERE CUSTER_NO = #{custerNo}
</select>
<select id="selectPageMesOrder" resultType="org.nl.wms.ext.mes.service.dto.MesOrderInfo">
SELECT *
FROM (
SELECT ROWNUM AS rn,
"RTMG"."VIEW_POP_ORDER_RESULT_LMS".*
FROM "RTMG"."VIEW_POP_ORDER_RESULT_LMS"
WHERE ROWNUM <![CDATA[ <= ]]> #{currentSize}
)
WHERE rn <![CDATA[ > ]]> #{currentPage}
</select>
</mapper>

10
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/impl/WmsToMesServiceImpl.java

@ -408,11 +408,6 @@ public class WmsToMesServiceImpl implements WmsToMesService {
mesRequestMapper.saveShelfInfoBatchToMes(shelfInfo);
}
@Override
public IPage<MesOrderInfo> selectPageMesOrder(IPage<MesOrderInfo> pages, String materialId) {
return mesRequestMapper.findOrderInfoByMaterialId(pages, materialId);
}
@Override
public List<CusterVo> getCusterInfo() {
return mesRequestMapper.getCusterInfo();
@ -423,6 +418,11 @@ public class WmsToMesServiceImpl implements WmsToMesService {
return mesRequestMapper.getCusterByNo(custerNo);
}
@Override
public List<MesOrderInfo> selectPageMesOrder(int currentPage, int currentSize) {
return mesRequestMapper.selectPageMesOrder(currentPage, currentSize);
}
/**
* 转换
*

12
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/workorder/service/impl/PdmBdWorkorderServiceImpl.java

@ -51,7 +51,6 @@ public class PdmBdWorkorderServiceImpl extends ServiceImpl<PdmBdWorkorderMapper,
@Autowired
private PdmBdWorkorderMapper pdmBdWorkorderMapper;
@Autowired
private WmsToAcsService wmsToAcsService;
@Autowired
@ -219,9 +218,14 @@ public class PdmBdWorkorderServiceImpl extends ServiceImpl<PdmBdWorkorderMapper,
}
@Override
public IPage<MesOrderInfo> queryMesOrder(PdmBdWorkorderQuery query, PageQuery page) {
IPage<MesOrderInfo> pages = new Page<>(page.getPage() + 1, page.getSize());
pages = wmsToMesService.selectPageMesOrder(pages, query.getMaterialId());
public IPage<MesOrderInfo> queryMesOrder(PdmBdWorkorderQuery query, PageQuery pageQuery) {
Integer page = pageQuery.getPage() + 1;
Integer size = pageQuery.getSize();
IPage<MesOrderInfo> pages = new Page<>(page, size);
int currentPage = page * size;
int currentSize = pageQuery.getPage() == 0 ? 1 : pageQuery.getPage() * size;
List<MesOrderInfo> mesOrderInfoList = wmsToMesService.selectPageMesOrder(currentPage, currentSize);
pages.setRecords(mesOrderInfoList);
return pages;
}

Loading…
Cancel
Save