Browse Source

2025-10-30

生产派工单列表支持拖拽
master
fengyuan_yang 3 months ago
parent
commit
197b81cb24
  1. 16
      src/main/java/com/gaotao/modules/shopOrder/controller/ShopOrderController.java
  2. 27
      src/main/java/com/gaotao/modules/shopOrder/entity/SearchProductionDispatchListData.java
  3. 6
      src/main/resources/mapper/shopOrder/ShopOrderMapper.xml

16
src/main/java/com/gaotao/modules/shopOrder/controller/ShopOrderController.java

@ -208,10 +208,24 @@ public class ShopOrderController extends AbstractController {
public Object searchProductionDispatchList(@RequestBody SearchProductionDispatchListData indata) {
Map<String, Object> map = new HashMap<>();
try {
// 计算OFFSET值页码从1开始OFFSET从0开始
if (indata.getPage() != null && indata.getLimit() != null) {
indata.setPage((indata.getPage() - 1) * indata.getLimit());
}
List<SearchProductionDispatchListData> result = shopOrderService.searchProductionDispatchList(indata);
// 获取总记录数从第一条记录中获取
int total = 0;
if (result != null && !result.isEmpty() && result.get(0).getTotalCount() != null) {
total = result.get(0).getTotalCount();
} else if (result != null) {
total = result.size();
}
map.put("success", true);
map.put("rows", result);
map.put("total", result.size());
map.put("total", total);
} catch (Exception e) {
map.put("success", false);
map.put("msg", e.getMessage());

27
src/main/java/com/gaotao/modules/shopOrder/entity/SearchProductionDispatchListData.java

@ -84,6 +84,9 @@ public class SearchProductionDispatchListData {
private boolean checked;
private String sql;
private Integer serialNumber;
private Integer page; // 当前页码
private Integer limit; // 每页数量
private Integer totalCount; // 总记录数
public Integer getSerialNumber() {
return serialNumber;
@ -93,6 +96,30 @@ public class SearchProductionDispatchListData {
this.serialNumber = serialNumber;
}
public Integer getPage() {
return page;
}
public void setPage(Integer page) {
this.page = page;
}
public Integer getLimit() {
return limit;
}
public void setLimit(Integer limit) {
this.limit = limit;
}
public Integer getTotalCount() {
return totalCount;
}
public void setTotalCount(Integer totalCount) {
this.totalCount = totalCount;
}
public String getSite() {
return site;
}

6
src/main/resources/mapper/shopOrder/ShopOrderMapper.xml

@ -97,6 +97,9 @@
<select id="searchProductionDispatchList" resultType="com.gaotao.modules.shopOrder.entity.SearchProductionDispatchListData">
SELECT
<if test="page != null and limit != null">
COUNT(*) OVER() AS totalCount,
</if>
T.Site,
T.OrderNo,
T.ItemNo,
@ -211,6 +214,9 @@
${sql}
</where>
ORDER BY d.bu_no, T.S_ResourceID, ISNULL(T.serial_number, 999999)
<if test="page != null and limit != null">
OFFSET #{page} ROWS FETCH NEXT #{limit} ROWS ONLY
</if>
</select>
<select id="searchShopOrder" resultType="com.gaotao.modules.shopOrder.entity.SearchShopOrder">
Select T.OrderNo,T.NeedDate,T.OrderType,T.PartNo,p.PartDescription+' / '+isnull(p.Spec,'') as PartDescription,

Loading…
Cancel
Save