dev:优化

This commit is contained in:
2023-12-05 15:43:59 +08:00
parent 8cab2ee440
commit f256124e79
15 changed files with 46 additions and 34 deletions

View File

@@ -1,6 +1,5 @@
package org.nl.modules.wql.core.engine.syntax;
import cn.hutool.core.util.StrUtil;
import lombok.extern.slf4j.Slf4j;
import org.nl.modules.wql.WQLCore;
import org.nl.modules.wql.core.DataType;
@@ -160,7 +159,7 @@ public class wqlSELECT extends IWQL {
if ((wo.wp.PAGE_PAGESTART != -99 && wo.wp.PAGE_PAGERECORDNUM != -99) && (wo.wp.SORT_ORDERBYFIELD.length() > 0)) {
// String sqlTmp = "select * from("+wo.wp.sSQL+") TOTALRECORDVIEW order by " + wo.wp.SORT_ORDERBYFIELD + " limit "+wo.wp.PAGE_PAGESTART+","+wo.wp.PAGE_PAGERECORDNUM;
// String sqlTmp = wo.wp.sSQL+" order by " + wo.wp.SORT_ORDERBYFIELD + " limit "+wo.wp.PAGE_PAGESTART+","+wo.wp.PAGE_PAGERECORDNUM;
// String sqlTmp = "select top "+wo.wp.PAGE_PAGERECORDNUM+"* FROM () WHERE ID NOT IN(SELECT TOP 45000 ID FROM ARTICLE ORDER BY YEAR DESC, ID DESC) ORDER BY YEAR DESC,ID DESC
// String sqlTmp = "select top "+wo.wp.PAGE_PAGERECORDNUM+"* FROM () WHERE ID NOT IN(SELECT TOP 45000 ID FROM ARTICLE ORDER BY YEAR DESC, ID DESC) ORDER BY YEAR DESC,ID DESC
String sqlTmp = "select * from (select row_number() over( order by " + wo.wp.SORT_ORDERBYFIELD + ") rownumber,* from (" + wo.wp.sSQL + ") b ) a1 where rownumber between " + (wo.wp.PAGE_PAGESTART + 1) + " and " + (wo.wp.PAGE_PAGESTART + wo.wp.PAGE_PAGERECORDNUM);
@@ -371,15 +370,10 @@ public class wqlSELECT extends IWQL {
//2.2、对分页进行处理
Set keySettTempTable = WQLCore.tempTableMap.keySet();
if (this.isInQuery && this.isPageQuery) {
if ((wo.wp.PAGE_PAGESTART != -99 && wo.wp.PAGE_PAGERECORDNUM != -99) ) {
if ((wo.wp.PAGE_PAGESTART != -99 && wo.wp.PAGE_PAGERECORDNUM != -99) && (wo.wp.SORT_ORDERBYFIELD.length() > 0)) {
// String sqlTmp = "select * from("+wo.wp.sSQL+") TOTALRECORDVIEW order by " + wo.wp.SORT_ORDERBYFIELD + " limit "+wo.wp.PAGE_PAGESTART+","+wo.wp.PAGE_PAGERECORDNUM;
String sqlTmp = wo.wp.sSQL + " order by " + wo.wp.SORT_ORDERBYFIELD + " limit " + wo.wp.PAGE_PAGESTART + "," + wo.wp.PAGE_PAGERECORDNUM;
if (StrUtil.isEmpty(wo.wp.SORT_ORDERBYFIELD)){
sqlTmp = wo.wp.sSQL + " limit " + wo.wp.PAGE_PAGESTART + "," + wo.wp.PAGE_PAGERECORDNUM;
}
// String sqlTmp = "select * from (select PAGE_SRCRESULTSET_1.*, row_number() over(order by " + wo.wp.SORT_ORDERBYFIELD + ")"
// + " as SORT_INDEXFIELDALIAS from ( "
// + wo.wp.sSQL
@@ -412,7 +406,7 @@ public class wqlSELECT extends IWQL {
log.error("关闭st,rs出错" + e.toString());
}
}
if (this.isPageQuery) {
if (wo.wp.SORT_ORDERBYFIELD.length() > 0) {
//对sql进行特殊处理找出和第一个select配对的from并把中间全部换为1
// String page_sql = change_1(wo.wp.sSQL);
String page_sql = wo.wp.sSQL;

View File

@@ -105,7 +105,7 @@ public class LmsToMesServiceImpl implements LmsToMesService {
if (ObjectUtil.isEmpty(sb_jo)) {
throw new BadRequestException("未查询到母卷号:" + iContainerName + "对应的生箔机台编号!");
}
if (StrUtil.equals("0", sb_jo.getString("is_used"))) {
if (StrUtil.equals("0", sb_jo.getString("mes_used"))) {
result.put("status", HttpStatus.OK.value());
result.put("message", "设备:" + sb_jo.getString("point_code") + "未启动!");
result.put("data", new JSONObject());
@@ -165,7 +165,7 @@ public class LmsToMesServiceImpl implements LmsToMesService {
if (ObjectUtil.isEmpty(sb_jo)) {
throw new BadRequestException("未查询到母卷号:" + iContainerName + "对应的生箔机台编号!");
}
if (StrUtil.equals("0", sb_jo.getString("is_used"))) {
if (StrUtil.equals("0", sb_jo.getString("mes_used"))) {
result.put("status", HttpStatus.OK.value());
result.put("message", "设备:" + sb_jo.getString("point_code") + "未启动!");
result.put("data", new JSONObject());

View File

@@ -160,7 +160,7 @@ public class MesToLmsServiceImpl implements MesToLmsService {
if (ObjectUtil.isEmpty(jsonPoint)) {
jsonPoint = new JSONObject();
}
if (StrUtil.equals("1", jsonPoint.getString("is_used"))) {
if (StrUtil.equals("1", jsonPoint.getString("mes_used"))) {
JSONObject json = new JSONObject();
json.put("ContainerName", raw_jo.getString("container_name"));
json.put("ResourceName", raw_jo.getString("resource_name"));
@@ -284,7 +284,7 @@ public class MesToLmsServiceImpl implements MesToLmsService {
if (ObjectUtil.isEmpty(sb_jo)) {
throw new BadRequestException("未查询到母卷号:" + ContainerName + "对应的生箔机台编号!");
}
if (StrUtil.equals("1", sb_jo.getString("is_used"))) {
if (StrUtil.equals("1", sb_jo.getString("mes_used"))) {
if (StrUtil.equals(nextSpec, "1")) {
/*
* 入烘箱

View File

@@ -96,15 +96,10 @@ public class BakingServiceImpl implements BakingService {
throw new BadRequestException("未查询到母卷号:" + container_name + "对应的生箔机台编号!");
}
/*if (StrUtil.equals("1", sb_jo.getString("is_used")) && !raw_jo.getString("is_baking").equals("1")) {
throw new BadRequestException("该母卷在MES上未进行决策入烘箱不允许进行入烘箱操作");
}*/
if (!raw_jo.getString("is_baking").equals("1")) {
if (StrUtil.equals("1", sb_jo.getString("mes_used")) && !raw_jo.getString("is_baking").equals("1")) {
throw new BadRequestException("该母卷在MES上未进行决策入烘箱不允许进行入烘箱操作");
}
if (ObjectUtil.isEmpty(container_name)) {
throw new BadRequestException("母卷号不能为空");
}
@@ -472,11 +467,7 @@ public class BakingServiceImpl implements BakingService {
throw new BadRequestException("未查询到母卷号:" + container_name + "对应的生箔机台编号!");
}
/*if (StrUtil.equals("1", sb_jo.getString("is_used")) && !raw_jo.getString("is_instor").equals("1")) {
throw new BadRequestException("该母卷在MES上未进行决策入半成品库不允许进行入冷却操作");
}*/
if (!raw_jo.getString("is_instor").equals("1")) {
if (StrUtil.equals("1", sb_jo.getString("mes_used")) && !raw_jo.getString("is_instor").equals("1")) {
throw new BadRequestException("该母卷在MES上未进行决策入半成品库不允许进行入冷却操作");
}

View File

@@ -43,6 +43,9 @@ public class SbPointIvtDto implements Serializable {
/** 是否启用 */
private String is_used;
/** 是否启用 */
private String mes_used;
/** 创建人 */
private String create_id;

View File

@@ -46,6 +46,7 @@ public class SbPointIvtServiceImpl implements SbPointIvtService {
map.put("point_code", "%" + whereJson.get("point_code") + "%");
map.put("product_area", whereJson.get("product_area"));
map.put("is_used", whereJson.get("is_used"));
map.put("mes_used", whereJson.get("mes_used"));
if (ObjectUtil.isNotEmpty(in_area_id)) map.put("in_area_id", in_area_id);
JSONObject json = WQL.getWO("ST_IVT_SBPOINTIVT").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "product_area,point_code");
return json;

View File

@@ -17,6 +17,7 @@
输入.point_code TYPEAS s_string
输入.product_area TYPEAS s_string
输入.is_used TYPEAS s_string
输入.mes_used TYPEAS s_string
输入.in_area_id TYPEAS f_string
@@ -58,6 +59,9 @@
OPTION 输入.is_used <> ""
is_used = 输入.is_used
ENDOPTION
OPTION 输入.is_used <> ""
mes_used = 输入.mes_used
ENDOPTION
ENDSELECT
ENDPAGEQUERY
ENDIF

View File

@@ -154,8 +154,8 @@ public class CheckOutBillController {
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@PostMapping("/allSetPoint")
@Log("设置全部站点")
@ApiOperation("设置全部站点")
@Log("一键设置")
@ApiOperation("一键设置")
public ResponseEntity<Object> allSetPoint(@RequestBody JSONObject whereJson) {
checkOutBillService.allSetPoint(whereJson);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);

View File

@@ -93,7 +93,7 @@
LEFT JOIN md_cs_customerbase cu ON ios.cust_code = cu.cust_code
LEFT JOIN st_ivt_iostorinvdtl dtl ON ios.iostorinv_id = dtl.iostorinv_id
LEFT JOIN st_ivt_iostorinvdis dis ON dtl.iostorinvdtl_id = dis.iostorinvdtl_id
LEFT JOIN pdm_bi_subpackagerelation sub ON sub.container_name = dis.pcsn AND dis.box_no = sub.package_box_sn
LEFT JOIN pdm_bi_subpackagerelationrecord sub ON sub.container_name = dis.pcsn AND dis.box_no = sub.package_box_sn AND sub.bill_code = ios.bill_code
WHERE
ios.io_type = '1'
and ios.is_delete='0'

View File

@@ -415,7 +415,7 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
}
JSONObject jsonSub = subTab.query("container_name = '" + json2.getString("pcsn") + "' AND package_box_sn = '" + json2.getString("box_no") + "'").uniqueResult(0);
if (ObjectUtil.isNotEmpty(jsonSect)) {
if (ObjectUtil.isNotEmpty(jsonSub)) {
jsonDis.put("CHARG", jsonSub.getString("sap_pcsn")); // sap批次
}
jsonDis.put("VBELN", json.getString("vbeln")); // 交货

View File

@@ -68,7 +68,7 @@
user.person_name AS upload_name
FROM
st_ivt_iostorinv mst
LEFT JOIN (
INNER JOIN (
SELECT
iostorinv_id,
MAX( source_bill_type ) AS source_bill_type,
@@ -91,13 +91,13 @@
GROUP BY
iostorinv_id
) a ON mst.iostorinv_id = a.iostorinv_id
LEFT JOIN (
INNER JOIN (
SELECT
iostorinv_id
FROM
st_ivt_iostorinvdis dis
LEFT JOIN pdm_bi_subpackagerelation sub ON sub.container_name = dis.pcsn
AND dis.box_no = sub.package_box_sn
LEFT JOIN pdm_bi_subpackagerelationrecord sub ON sub.container_name = dis.pcsn
AND dis.box_no = sub.package_box_sn AND dis.iostorinv_id = sub.bill_id
WHERE
1=1
OPTION 输入.pcsn <> ""

View File

@@ -48,6 +48,16 @@
@change="hand"
/>
</el-form-item>
<el-form-item label="MES启用">
<el-switch
v-model="query.mes_used"
active-value="0"
inactive-value="1"
active-color="#C0CCDA"
inactive-color="#409EFF"
@change="hand"
/>
</el-form-item>
<rrOperation :crud="crud" />
</el-form>
</div>
@@ -99,6 +109,9 @@
<el-form-item label="是否启用" prop="is_used">
<el-switch v-model="form.is_used" active-value="1" inactive-value="0" />
</el-form-item>
<el-form-item label="MES启用" prop="is_used">
<el-switch v-model="form.mes_used" active-value="1" inactive-value="0" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="crud.cancelCU">取消</el-button>
@@ -127,6 +140,11 @@
{{ dict.label.is_used[scope.row.is_used] }}
</template>
</el-table-column>
<el-table-column prop="mes_used" label="MES启用">
<template slot-scope="scope">
{{ dict.label.is_used[scope.row.mes_used] }}
</template>
</el-table-column>
<el-table-column prop="update_time" label="修改时间" min-width="150" show-overflow-tooltip />
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
<template slot-scope="scope">

View File

@@ -96,7 +96,7 @@
<el-button
slot="right"
class="filter-item"
type="warning"
type="success"
:permission="permission"
:disabled="confirm_flag"
:loading="loading_button"
@@ -109,7 +109,7 @@
<el-button
slot="right"
class="filter-item"
type="warning"
type="danger"
:permission="permission"
:disabled="confirm_flag"
icon="el-icon-close"

View File

@@ -652,6 +652,7 @@ export default {
const data = {
'point_code': this.form2.point_code,
'iostorinv_id': this.mstrow.iostorinv_id,
'bill_code': this.mstrow.bill_code,
'checked': this.checked
}
checkoutbill.allSetPoint(data).then(res => {